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
214f8143f02f7cb7b2589e6de1a4cd56940178be
477
py
Python
DSA/bit_magic/max_consecutive_set_bits.py
RohanMiraje/DSAwithPython
ea4884afcac9d6cc2817a93e918c829dd10cef5d
[ "MIT" ]
2
2020-02-12T03:00:03.000Z
2020-07-06T17:27:03.000Z
DSA/bit_magic/max_consecutive_set_bits.py
RohanMiraje/DSAwithPython
ea4884afcac9d6cc2817a93e918c829dd10cef5d
[ "MIT" ]
null
null
null
DSA/bit_magic/max_consecutive_set_bits.py
RohanMiraje/DSAwithPython
ea4884afcac9d6cc2817a93e918c829dd10cef5d
[ "MIT" ]
null
null
null
def max_consecutive_ones(x): # e.g. x= 95 (1101111) """ Steps 1. x & x<<1 --> 1101111 & 1011110 == 1001110 2. x & x<<1 --> 1001110 & 0011100 == 0001100 3. x & x<<1 --> 0001100 & 0011000 == 0001000 4. x & x<<1 --> 0001000 & 0010000 == 0000000 :param x: :return: """ count = 0 while x > 0: x = x & (x << 1) count += 1 return count if __name__ == '__main__': print(max_consecutive_ones(7))
22.714286
52
0.484277
63
477
3.47619
0.507937
0.054795
0.068493
0
0
0
0
0
0
0
0
0.341935
0.350105
477
20
53
23.85
0.364516
0.507338
0
0
0
0
0.041026
0
0
0
0
0
0
1
0.125
false
0
0
0
0.25
0.125
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2156629d841c02adcb7168c3eae3157b2c83db3f
841
py
Python
connexion_db/travel_agency_bot/web_app.py
frflefevre/defiiv
968cb8f3fde31537deaef6b2f9299541dac2ef04
[ "MIT" ]
null
null
null
connexion_db/travel_agency_bot/web_app.py
frflefevre/defiiv
968cb8f3fde31537deaef6b2f9299541dac2ef04
[ "MIT" ]
null
null
null
connexion_db/travel_agency_bot/web_app.py
frflefevre/defiiv
968cb8f3fde31537deaef6b2f9299541dac2ef04
[ "MIT" ]
3
2020-11-17T15:24:25.000Z
2020-12-30T15:19:18.000Z
#from rasa_core.channels.facebook import FacebookInput from rasa_core.channels.socketio import SocketIOInput from rasa_core.interpreter import RasaNLUInterpreter import yaml from rasa_core.utils import EndpointConfig from rasa_core.agent import Agent from flask import Flask from flask import render_template, jsonify, request import requests from urllib.request import urlopen import json #from models import * from responses import * import random app = Flask(__name__) @app.route('/') def hello_world(): return render_template('index.html') #return render_template('home.html') app.config["DEBUG"] = True if __name__ == "__main__": app.run(port=8000) # python -m rasa_core.run -d models/dialogue -u models/nlu/current --port 5005 --credentials credentials.yml in case of chatbot.js
25.484848
131
0.753864
113
841
5.415929
0.530973
0.078431
0.098039
0.065359
0
0
0
0
0
0
0
0.011412
0.166468
841
33
131
25.484848
0.861626
0.282996
0
0
0
0
0.042254
0
0
0
0
0
0
1
0.052632
false
0
0.631579
0.052632
0.736842
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
215809cadf55edb1ad30067ffe3f41e22519a0d6
972
py
Python
Cryptopals Set 5/set5_challenge33.py
rajKarra69420/CryptoPals
6ade402ed652a902249a82cce53aedf2081a5db9
[ "MIT" ]
2
2020-12-12T00:49:37.000Z
2020-12-31T05:03:05.000Z
Cryptopals Set 5/set5_challenge33.py
rajKarra69420/CryptoPals
6ade402ed652a902249a82cce53aedf2081a5db9
[ "MIT" ]
null
null
null
Cryptopals Set 5/set5_challenge33.py
rajKarra69420/CryptoPals
6ade402ed652a902249a82cce53aedf2081a5db9
[ "MIT" ]
null
null
null
import random # https://www.programiz.com/python-programming/methods/built-in/pow def diffie_hellman(p, g, q): a = random.SystemRandom().randint(0, q - 1) A = pow(g, a, p) b = random.SystemRandom().randint(0, q - 1) B = pow(g, b, p) return {'a': a, 'A': A, 'b': b, 'B': B} if __name__ == "__main__": p = 37 g = 5 q = p - 1 z = diffie_hellman(p, g, q) assert (pow(z['B'], z['a'], p) == pow(z['A'], z['b'], p)) p = 0xffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff g = 2 q = p // 2 - 1 z = diffie_hellman(p, g, q) assert (pow(z['B'], z['a'], p) == pow(z['A'], z['b'], p))
38.88
394
0.690329
107
972
6.168224
0.317757
0.024242
0.063636
0.068182
0.230303
0.206061
0.121212
0.121212
0.121212
0.121212
0
0.293612
0.162551
972
24
395
40.5
0.517199
0.066872
0
0.222222
0
0
0.022099
0
0
0
0.426519
0
0.111111
1
0.055556
false
0
0.055556
0
0.166667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
2
21630180626f4f4959b09db9c583117e18e2ad9c
443
py
Python
LTIME50/A.py
parthlathiya/Codechef_Submissions
d404129e4a59c4df10eace61541f48263c32480c
[ "MIT" ]
null
null
null
LTIME50/A.py
parthlathiya/Codechef_Submissions
d404129e4a59c4df10eace61541f48263c32480c
[ "MIT" ]
null
null
null
LTIME50/A.py
parthlathiya/Codechef_Submissions
d404129e4a59c4df10eace61541f48263c32480c
[ "MIT" ]
null
null
null
###################################################### # # # author # # Parth Lathiya # # https://www.cse.iitb.ac.in/~parthiitb/ # # # ###################################################### at = int(input().strip()) for att in range(at): u = list(map(int, input().strip().split())) u.remove(len(u)-1) print(max(u))
29.533333
55
0.277652
34
443
3.617647
0.764706
0.130081
0.211382
0
0
0
0
0
0
0
0
0.003497
0.354402
443
15
56
29.533333
0.426573
0.284424
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.2
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2163ab1f8f3ac9081d358cf54c8f1544fef7a3e4
13,188
py
Python
testproject/testapp/tests.py
dobarkod/django-restless-oauth
7f4ae7f5af95aa82d6af818c3ff73214489c2657
[ "Unlicense" ]
null
null
null
testproject/testapp/tests.py
dobarkod/django-restless-oauth
7f4ae7f5af95aa82d6af818c3ff73214489c2657
[ "Unlicense" ]
null
null
null
testproject/testapp/tests.py
dobarkod/django-restless-oauth
7f4ae7f5af95aa82d6af818c3ff73214489c2657
[ "Unlicense" ]
1
2021-07-08T09:48:37.000Z
2021-07-08T09:48:37.000Z
import json from django.test import TestCase, LiveServerTestCase import django.test.client from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.sites.models import Site import oauthlib.oauth1.rfc5849 from restless_oauth.models import * import requests from oauth_hook import OAuthHook import urlparse class OAuthTestClient(django.test.client.Client): def __init__(self, *args, **kwargs): super(OAuthTestClient, self).__init__(*args, **kwargs) self.client_key = None self.client_secret = None self.access_token = None self.access_secret = None self.oauth_verifier = None self.oauth_uri = None self.oauth_client = None def _init_oauth_client(self): if self.client_key: self.oauth_client = oauthlib.oauth1.rfc5849.Client(self.client_key, client_secret=self.client_secret, resource_owner_key=self.access_token, resource_owner_secret=self.access_secret, verifier=self.oauth_verifier) else: self.oauth_client = None def set_uri(self, uri): self.oauth_uri = unicode(uri) def set_client_key(self, client_key, client_secret=None): self.client_key = unicode(client_key) self.client_secret = unicode(client_secret) self._init_oauth_client() def set_access_token(self, access_token, access_secret=None): self.access_token = unicode(access_token) self.access_secret = unicode(access_secret) self._init_oauth_client() def set_verifier(self, verifier): self.oauth_verifier = verifier self._init_oauth_client() @staticmethod def process(response): try: response.json = json.loads(response.content) except Exception: response.json = None finally: return response def inject_oauth_headers(self, headers, method): if self.oauth_client and self.oauth_uri: uri, oauth_headers, body = self.oauth_client.sign(self.oauth_uri, http_method=unicode(method)) headers = dict(headers) for k, v in oauth_headers.items(): headers['HTTP_' + k.upper()] = v return headers def get(self, url_name, data={}, follow=False, extra={}, *args, **kwargs): return self.process( super(OAuthTestClient, self).get( reverse(url_name, args=args, kwargs=kwargs), data=data, follow=follow, **self.inject_oauth_headers(extra, 'GET'))) def post(self, url_name, data={}, follow=False, extra={}, *args, **kwargs): return self.process( super(OAuthTestClient, self).post( reverse(url_name, args=args, kwargs=kwargs), data=data, follow=follow, **self.inject_oauth_headers(extra, 'POST'))) def put(self, url_name, data={}, follow=False, extra={}, *args, **kwargs): return self.process( super(OAuthTestClient, self).put( reverse(url_name, args=args, kwargs=kwargs), data=data, follow=follow, **self.inject_oauth_headers(extra, 'PUT'))) def delete(self, url_name, data={}, follow=False, extra={}, *args, **kwargs): return self.process( super(OAuthTestClient, self).delete( reverse(url_name, args=args, kwargs=kwargs), content_type=content_type, data=data, follow=follow, **self.inject_oauth_headers(extra, 'DELETE'))) class OAuthViewTest(TestCase): def clean(self): User.objects.all().delete() OAuthClient.objects.all().delete() OAuthRequestToken.objects.all().delete() OAuthAccessToken.objects.all().delete() OAuthVerifier.objects.all().delete() OAuthNonce.objects.all().delete() def setUp(self): self.clean() s = Site.objects.get(id=1) s.domain = 'localhost' s.save() Site.objects.clear_cache() self.client_key = u'CLIENTKEYCLIENTKEYCLIENTKEY' self.client_secret = u'CLIENTSECRETCLIENTSECRET' self.user = User.objects.create_user(username='foo', password='bar') self.client = OAuthClient.objects.create(key=self.client_key, secret=self.client_secret) self.testclient = OAuthTestClient() def tearDown(self): self.clean() def test_returns_bad_req_if_no_oauth_signature(self): tc = OAuthTestClient() r = tc.post('oauth_get_request_token') self.assertEqual(r.status_code, 400) def test_returns_bad_req_if_invalid_client_key(self): tc = OAuthTestClient() tc.set_client_key('foo', 'bar') tc.set_uri('http://localhost/oauth/request_token') r = tc.post('oauth_get_request_token') self.assertEqual(r.status_code, 400) self.assertTrue('client key' in r.json.get('error', '')) def test_returns_bad_req_if_nonexistent_client(self): tc = OAuthTestClient() tc.set_client_key(u'CLIENTKEYDOESNTEXIST', u'CLIENTSECRETDOESNTEXIST') tc.set_uri('http://localhost/oauth/request_token') r = tc.post('oauth_get_request_token') self.assertEqual(r.status_code, 400) self.assertTrue('client key' in r.json.get('error', '')) def test_returns_unauthorized_on_uri_mismatch(self): tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_uri('http://localhost/incorrect/uri') r = tc.post('oauth_get_request_token') self.assertEqual(r.status_code, 401) def test_get_request_token_succeeds(self): tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_uri('http://localhost/oauth/request_token') r = tc.post('oauth_get_request_token') self.assertEqual(r.status_code, 200) self.assertTrue(OAuthRequestToken.objects.filter( token=r.json['oauth_token'], secret=r.json['oauth_token_secret']).exists()) def test_returns_unauthorized_if_request_replay_attempted(self): tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_uri('http://localhost/oauth/request_token') r = tc.post('oauth_get_request_token') self.assertEqual(r.status_code, 200) tc2 = OAuthTestClient() r2 = tc2.post('oauth_get_request_token', extra={'HTTP_AUTHORIZATION': r.request['HTTP_AUTHORIZATION']}) self.assertEqual(r2.status_code, 401) def test_get_access_token_succeeds(self): request_token = OAuthRequestToken.generate(self.client) verifier = OAuthVerifier.generate(self.user, request_token) tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_access_token(request_token.token, request_token.secret) tc.set_verifier(verifier.verifier) tc.set_uri('http://localhost/oauth/access_token') r = tc.post('oauth_get_access_token') self.assertEqual(r.status_code, 200) self.assertTrue(OAuthAccessToken.objects.filter( token=r.json['oauth_token'], secret=r.json['oauth_token_secret']).exists()) def test_get_access_token_returns_bad_req_on_invalid_verifier(self): request_token = OAuthRequestToken.generate(self.client) tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_access_token(request_token.token, request_token.secret) tc.set_verifier(u'INVALIDVERIFIERKEY') tc.set_uri('http://localhost/oauth/access_token') r = tc.post('oauth_get_access_token') self.assertEqual(r.status_code, 400) self.assertTrue('verifier' in r.json.get('error', '')) def test_get_access_token_returns_bad_req_on_invalid_request_token(self): request_token = OAuthRequestToken.generate(self.client) verifier = OAuthVerifier.generate(self.user, request_token) tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_access_token(u'INVALIDREQUESTTOKEN', u'INVALIDREQUESTSECRET') tc.set_verifier(verifier.verifier) tc.set_uri('http://localhost/oauth/access_token') r = tc.post('oauth_get_access_token') self.assertEqual(r.status_code, 400) self.assertTrue('resource owner key' in r.json.get('error', '')) def test_access_protected_resource_fails_without_oauth(self): tc = OAuthTestClient() tc.set_uri('http://localhost/secret/') r = tc.get('protected_endpoint') self.assertEqual(r.status_code, 403) def test_access_protected_resource_succeeds_with_oauth(self): token = OAuthAccessToken.generate(self.user, self.client) tc = OAuthTestClient() tc.set_client_key(self.client_key, self.client_secret) tc.set_access_token(token.token, token.secret) tc.set_uri('http://localhost/secret/') r = tc.get('protected_endpoint') self.assertEqual(r.status_code, 200) self.assertTrue(r.json['success']) class RequestsInteropTest(LiveServerTestCase): def clean(self): User.objects.all().delete() OAuthClient.objects.all().delete() OAuthRequestToken.objects.all().delete() OAuthAccessToken.objects.all().delete() OAuthVerifier.objects.all().delete() OAuthNonce.objects.all().delete() def setUp(self): self.clean() s = Site.objects.get(id=1) s.domain = urlparse.urlparse(self.live_server_url).netloc s.save() Site.objects.clear_cache() self.client_key = u'CLIENTKEYCLIENTKEYCLIENTKEY' self.client_secret = u'CLIENTSECRETCLIENTSECRET' self.user = User.objects.create_user(username='foo', password='bar') self.client = OAuthClient.objects.create(key=self.client_key, secret=self.client_secret) self.testclient = OAuthTestClient() def url_for(self, url_name, *args, **kwargs): return '%s%s' % (self.live_server_url, reverse(url_name, args=args, kwargs=kwargs)) def tearDown(self): self.clean() def test_get_request_token_params_in_query(self): hook = OAuthHook(consumer_key=self.client_key, consumer_secret=self.client_secret) r = requests.post(self.url_for('oauth_get_request_token'), hooks={'pre_request': hook}) self.assertEqual(r.status_code, 200) self.assertTrue(OAuthRequestToken.objects.filter( token=r.json['oauth_token'], secret=r.json['oauth_token_secret']).exists()) def test_get_request_token_params_in_headers(self): hook = OAuthHook(consumer_key=self.client_key, consumer_secret=self.client_secret, header_auth=True) r = requests.post(self.url_for('oauth_get_request_token'), hooks={'pre_request': hook}) self.assertEqual(r.status_code, 200) self.assertTrue(OAuthRequestToken.objects.filter( token=r.json['oauth_token'], secret=r.json['oauth_token_secret']).exists()) def test_get_request_token_params_in_body(self): hook = OAuthHook(consumer_key=self.client_key, consumer_secret=self.client_secret) r = requests.post(self.url_for('oauth_get_request_token'), hooks={'pre_request': hook}, data='foo=bar', headers={ 'Content-Type': 'application/x-www-form-urlencoded' }, config={'max_retries': 0}) self.assertEqual(r.status_code, 200) self.assertTrue(OAuthRequestToken.objects.filter( token=r.json['oauth_token'], secret=r.json['oauth_token_secret']).exists()) def test_get_access_token_succeeds(self): request_token = OAuthRequestToken.generate(self.client) verifier = OAuthVerifier.generate(self.user, request_token) hook = OAuthHook(request_token.token, request_token.secret, self.client_key, self.client_secret, header_auth=True) r = requests.post(self.url_for('oauth_get_access_token'), hooks={'pre_request': hook}, data={ 'oauth_verifier': verifier.verifier, }, config={'max_retries': 0}) self.assertEqual(r.status_code, 200) self.assertTrue(OAuthAccessToken.objects.filter( token=r.json['oauth_token'], secret=r.json['oauth_token_secret']).exists()) def test_access_protected_resource_succeeds(self): token = OAuthAccessToken.generate(self.user, self.client) hook = OAuthHook(token.token, token.secret, self.client_key, self.client_secret, header_auth=True) r = requests.get(self.url_for('protected_endpoint'), hooks={'pre_request': hook}, config={'max_retries': 0}) self.assertEqual(r.status_code, 200) self.assertTrue(r.json['success'])
36.633333
79
0.656127
1,576
13,188
5.241117
0.109772
0.058111
0.036199
0.041404
0.743947
0.715375
0.687893
0.646973
0.632809
0.627119
0
0.006882
0.228693
13,188
359
80
36.735376
0.805151
0
0
0.581818
0
0
0.10593
0.036093
0
0
0
0
0.105455
1
0.127273
false
0.007273
0.04
0.018182
0.203636
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
dcbd2b1d49bd0c28be940e971f59817ca8a0c24a
1,798
py
Python
Arukas_api.py
zzhawk/Arukas-Docker-Port-Look-Up
a1eb905c3f0b20be7cd35d26d30fed4bfc61e75c
[ "MIT" ]
null
null
null
Arukas_api.py
zzhawk/Arukas-Docker-Port-Look-Up
a1eb905c3f0b20be7cd35d26d30fed4bfc61e75c
[ "MIT" ]
null
null
null
Arukas_api.py
zzhawk/Arukas-Docker-Port-Look-Up
a1eb905c3f0b20be7cd35d26d30fed4bfc61e75c
[ "MIT" ]
null
null
null
import requests import json import subprocess ################################################################### # load_cmd = 1 user = '(your API keys "Token")' passw = '(your API keys "Secret")' contid = '(Container ID)' port = '(SSR Port)' # ssr = 'ShadowsocksR-dotnet4.0.exe' ################################################################### url = "https://app.arukas.io/api/containers/" header = {'content-type': 'application/json'} response = requests.get(url + contid, auth=(user, passw), headers = header) json_data = json.loads(response.content) sub_json_data = json_data["data"]["attributes"]; # print json.dumps(sub_json_data, indent=4, sort_keys=True) cmd = sub_json_data['cmd'] for x in sub_json_data["port_mappings"][0]: if x['container_port'] == port: output_port = x['service_port'] output_host = x['host'] print "Port = " + str(output_port) if output_host.startswith("seaof-"): output_host = output_host[6:] output_host = output_host.split(".")[0] output_host = output_host.replace("-",".") print "IP address = " + output_host ################################################################### in_file = open('gui-config.json') indata = in_file.read() out_file = open('gui-config.json.temp', 'w') out_file.write(indata) json_data_local = json.loads(indata) # json_data_local['configs']['server'] = output_host; # json_data_local['configs']['server_port'] = output_port; for x in json_data_local["configs"]: x['server_port'] = output_port x['server'] = output_host with open('gui-config.json', 'w') as outfile: json.dump(json_data_local, outfile, indent=4, sort_keys=True) ################################################################### # subprocess.Popen([ssr]) raw_input("Parameter loaded, hit close(x) to exit")
29.47541
75
0.588432
225
1,798
4.488889
0.395556
0.087129
0.064356
0.059406
0.130693
0
0
0
0
0
0
0.005057
0.120133
1,798
60
76
29.966667
0.633375
0.132369
0
0
0
0
0.263813
0
0
0
0
0
0
0
null
null
0.058824
0.088235
null
null
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
1
0
0
1
0
0
0
0
0
2
dccfb165b08cc9e8c35751077e33944389efd0ab
427
py
Python
comphyle/jinja.py
hylang/comphyle
437caaf8dee8b071c2155f4be35c66dca262b449
[ "MIT" ]
2
2022-03-21T04:35:30.000Z
2022-03-21T05:43:45.000Z
comphyle/jinja.py
hylang/comphyle
437caaf8dee8b071c2155f4be35c66dca262b449
[ "MIT" ]
null
null
null
comphyle/jinja.py
hylang/comphyle
437caaf8dee8b071c2155f4be35c66dca262b449
[ "MIT" ]
null
null
null
#!/usr/bin/env python from email.Utils import formatdate from jinja2 import Template import time import os def rfc_2822(dateobj): return formatdate(time.mktime(dateobj.timetuple())) def render_fd(fpath, ctx): output_name = fpath.replace(".jinja2", "") t = Template(open(fpath, "r").read()) ctx['rfc_2822_date'] = rfc_2822(ctx['when']) open(output_name, "w").write(t.render(**ctx)) os.unlink(fpath)
22.473684
55
0.688525
62
427
4.629032
0.580645
0.073171
0
0
0
0
0
0
0
0
0
0.038567
0.149883
427
18
56
23.722222
0.752066
0.046838
0
0
0
0
0.064039
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.083333
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
dcd80b44f988a5bb91728bded5eebb7b5fb3e32e
420
py
Python
2020/j3.py
TrustedMercury/ccc-solutions
bde6c05eee4fa377ba02a039b1c5f4984665aec8
[ "MIT" ]
3
2022-01-05T06:25:03.000Z
2022-01-09T01:26:57.000Z
2020/j3.py
TrustedMercury/ccc-solutions
bde6c05eee4fa377ba02a039b1c5f4984665aec8
[ "MIT" ]
null
null
null
2020/j3.py
TrustedMercury/ccc-solutions
bde6c05eee4fa377ba02a039b1c5f4984665aec8
[ "MIT" ]
null
null
null
# 15/15 num_of_flicks = int(input()) art = [] for _ in range(num_of_flicks): coords = input().split(",") art.append((int(coords[0]), int(coords[1]))) lowest_x = min(art, key=lambda x: x[0])[0] - 1 lowest_y = min(art, key=lambda x: x[1])[1] - 1 highest_x = max(art, key=lambda x: x[0])[0] + 1 highest_y = max(art, key=lambda x: x[1])[1] + 1 print(f"{lowest_x},{lowest_y}") print(f"{highest_x},{highest_y}")
22.105263
48
0.611905
81
420
3.012346
0.308642
0.098361
0.196721
0.213115
0.327869
0.327869
0.278689
0.278689
0
0
0
0.050704
0.154762
420
18
49
23.333333
0.63662
0.011905
0
0
0
0
0.108959
0.106538
0
0
0
0
0
1
0
false
0
0
0
0
0.181818
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
dcd91ca17d5bde60a9d72eb2fbf8bdb93443893d
224
py
Python
whileLeapRange.py
musaibnazir/MixedPy
b2911f06e2f99aba9fb5b6fa802471710196ba4b
[ "MIT" ]
null
null
null
whileLeapRange.py
musaibnazir/MixedPy
b2911f06e2f99aba9fb5b6fa802471710196ba4b
[ "MIT" ]
null
null
null
whileLeapRange.py
musaibnazir/MixedPy
b2911f06e2f99aba9fb5b6fa802471710196ba4b
[ "MIT" ]
null
null
null
print("Leap Year Range Calculator: ") year1=int(input("Enter First Year: ")) year2 = int(input("Enter Last Year: ")) while year1<=year2: if year1 % 4 == 0 : print(year1,"is a leap year") year1= year1 + 1
28
39
0.611607
33
224
4.151515
0.575758
0.116788
0.189781
0
0
0
0
0
0
0
0
0.063953
0.232143
224
7
40
32
0.732558
0
0
0
0
0
0.34375
0
0
0
0
0
0
1
0
false
0
0
0
0
0.285714
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
dcdd925a2a14841d4791ff2eb5c8c56e40e2f5d1
1,486
py
Python
013-Roman-to-Integer/solution01.py
Eroica-cpp/LeetCode
07276bd11558f3d0e32bec768b09e886de145f9e
[ "CC-BY-3.0", "MIT" ]
7
2015-05-05T22:21:30.000Z
2021-03-13T04:04:15.000Z
013-Roman-to-Integer/solution01.py
Eroica-cpp/LeetCode
07276bd11558f3d0e32bec768b09e886de145f9e
[ "CC-BY-3.0", "MIT" ]
null
null
null
013-Roman-to-Integer/solution01.py
Eroica-cpp/LeetCode
07276bd11558f3d0e32bec768b09e886de145f9e
[ "CC-BY-3.0", "MIT" ]
2
2018-12-26T08:13:25.000Z
2020-07-18T20:18:24.000Z
#!/usr/bin/python # ============================================================================== # Author: Tao Li (taoli@ucsd.edu) # Date: Jun 1, 2015 # Question: 013-Roman-to-Integer # Link: https://leetcode.com/problems/roman-to-integer/ # ============================================================================== # Given a roman numeral, convert it to an integer. # # Input is guaranteed to be within the range from 1 to 3999. # ============================================================================== # Method: Naive method # Note: # 1. Reference1: http://zh.wikipedia.org/wiki/%E7%BD%97%E9%A9%AC%E6%95%B0%E5%AD%97 # 2. Reference2: http://fisherlei.blogspot.com/2012/12/leetcode-roman-to-integer.html # ============================================================================== class Solution: # @param {string} s # @return {integer} def romanToInt(self, s): dic = { 'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000 } res = 0 for i in xrange(len(s)): if i > 0 and dic[s[i]] > dic[s[i-1]]: res += dic[s[i]] - 2*dic[s[i-1]] else: res += dic[s[i]] return res if __name__ == '__main__': roman = "MDLXXII" roman = "MDCLXXXIV" roman = "MMCXXXI" print Solution().romanToInt(roman) # print Solution().intToRoman(89)
32.304348
85
0.409152
161
1,486
3.726708
0.652174
0.033333
0.041667
0.02
0
0
0
0
0
0
0
0.052394
0.255047
1,486
46
86
32.304348
0.489612
0.569314
0
0
0
0
0.061093
0
0
0
0
0
0
0
null
null
0
0
null
null
0.043478
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
1
0
0
0
0
0
0
0
0
2
dce600ff4e91c9e242ab54d4fac7fdd0422d0507
10,681
py
Python
CAAPR/CAAPR_AstroMagic/PTS/pts/magic/catalog/importer.py
wdobbels/CAAPR
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
[ "MIT" ]
7
2016-05-20T21:56:39.000Z
2022-02-07T21:09:48.000Z
CAAPR/CAAPR_AstroMagic/PTS/pts/magic/catalog/importer.py
wdobbels/CAAPR
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
[ "MIT" ]
1
2019-03-21T16:10:04.000Z
2019-03-22T17:21:56.000Z
CAAPR/CAAPR_AstroMagic/PTS/pts/magic/catalog/importer.py
wdobbels/CAAPR
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
[ "MIT" ]
1
2020-05-19T16:17:17.000Z
2020-05-19T16:17:17.000Z
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ## \package pts.magic.catalog.importer Contains the CatalogImporter class. # ----------------------------------------------------------------- # Ensure Python 3 functionality from __future__ import absolute_import, division, print_function # Import standard modules import os from config import Sequence # Import the relevant PTS classes and modules from ..basics.catalogcoverage import CatalogCoverage from ..tools import catalogs from ...core.basics.configurable import OldConfigurable from ...core.tools import introspection, tables from ...core.tools import filesystem as fs from ...core.tools.logging import log # ----------------------------------------------------------------- class CatalogImporter(OldConfigurable): """ This class ... """ def __init__(self, config=None): """ The constructor ... :param config: :return: """ # Call the constructor of the base class super(CatalogImporter, self).__init__(config, "magic") # The image frame self.frame = None # The name of the galaxy self._has_dustpedia_catalog = None self.galaxy_name = None # The galactic and stellar catalogs self.galactic_catalog = None self.stellar_catalog = None # Determine the path to the catalogs user directory (where the DustPedia catalogs are now stored) self.catalogs_user_path = os.path.join(introspection.pts_user_dir, "magic", "catalogs") # ----------------------------------------------------------------- def run(self, frame): """ This function ... :param frame: :return: """ # 1. Call the setup function self.setup(frame) # 2. Import the galactic catalog self.import_galactic_catalog() # 3. Import the stellar catalog self.import_stellar_catalog() # ----------------------------------------------------------------- def clear(self): """ This function ... :return: """ # Set attributes to None self.frame = None self.galaxy_name = None self.galactic_catalog = None self.stellar_catalog = None # ----------------------------------------------------------------- def setup(self, frame): """ This function ... :param frame: :return: """ # Call the setup function of the base class super(CatalogImporter, self).setup() # Set the frame self.frame = frame # ----------------------------------------------------------------- def import_galactic_catalog(self): """ This function ... :return: """ # Inform the user log.info("Importing galactic catalog ...") # Use catalog file if specified if self.config.galaxies.use_catalog_file: self.import_galactic_catalog_from_file() elif self.has_dustpedia_catalog: self.import_galactic_dustpedia_catalog() else: self.fetch_galactic_catalog() # ----------------------------------------------------------------- def import_stellar_catalog(self): """ This function ... :return: """ # Inform the user log.info("Importing stellar catalog ...") # Use catalog file if specified if self.config.stars.use_catalog_file: self.import_stellar_catalog_from_file() elif self.has_dustpedia_catalog: self.import_stellar_dustpedia_catalog() else: self.fetch_stellar_catalog() # ----------------------------------------------------------------- @property def has_dustpedia_catalog(self): """ This function ... :return: """ # Avoid overhead when calling this function twice if self._has_dustpedia_catalog is not None: return self._has_dustpedia_catalog # Get bounding box of the frame bounding_box = self.frame.bounding_box() # Loop over all directories within the catalogs directory (different galaxies) for galaxy_path in fs.directories_in_path(self.catalogs_user_path): # Get the galaxy name galaxy_name = os.path.basename(galaxy_path) # Get the catalog coverage for this galaxy coverage = CatalogCoverage(galaxy_name) # Check whether this galaxy matches the current frame if coverage.matches(bounding_box): # Debug info log.debug("Found a match with DustPedia catalog for galaxy " + galaxy_name) self._has_dustpedia_catalog = True self.galaxy_name = galaxy_name break # If a break is not encountered else: self._has_dustpedia_catalog = False # Return the answer return self._has_dustpedia_catalog # ----------------------------------------------------------------- def import_galactic_catalog_from_file(self): """ This function ... :return: """ # Determine the full path to the catalog file path = self.full_input_path(self.config.galaxies.catalog_path) # Inform the user log.info("Importing galactic catalog from file " + path + " ...") # Load the catalog self.galactic_catalog = tables.from_file(path, format="ascii.commented_header") # ----------------------------------------------------------------- def import_stellar_catalog_from_file(self): """ This function ... :return: """ # Determine the full path to the catalog file path = self.full_input_path(self.config.stars.catalog_path) # Inform the user log.info("Importing stellar catalog from file " + path + " ...") # Load the catalog self.stellar_catalog = tables.from_file(path, format="ascii.commented_header") # ----------------------------------------------------------------- def import_galactic_dustpedia_catalog(self): """ This function ... :return: """ # Inform the user log.info("Importing galactic DustPedia catalog for " + self.galaxy_name) # Determine the path to the DustPedia galactic catalog for this galaxy galaxy_path = os.path.join(self.catalogs_user_path, self.galaxy_name) galactic_catalog_path = os.path.join(galaxy_path, "galaxies.cat") # Load the galactic catalog self.galactic_catalog = tables.from_file(galactic_catalog_path) # ----------------------------------------------------------------- def import_stellar_dustpedia_catalog(self): """ This function ... :return: """ # Inform the user log.info("Importing stellar DustPedia catalog for " + self.galaxy_name) # Determine the path to the DustPedia stellar catalog for this galaxy galaxy_path = os.path.join(self.catalogs_user_path, self.galaxy_name) stellar_catalog_path = os.path.join(galaxy_path, "stars.cat") # Load the stellar catalog self.stellar_catalog = tables.from_file(stellar_catalog_path) # ----------------------------------------------------------------- def fetch_galactic_catalog(self): """ This function ... :return: """ # Inform the user log.info("Fetching galaxy positions from an online catalog ...") # Create the galaxy catalog self.galactic_catalog = catalogs.create_galaxy_catalog(self.frame) # Inform the user log.debug("Number of galaxies: " + str(len(self.galactic_catalog))) # ----------------------------------------------------------------- def fetch_stellar_catalog(self): """ This function ... :return: """ # Inform the user log.info("Fetching star positions from online catalogs ...") # Check whether the 'catalogs' setting defines a single catalog name or a list of such names if isinstance(self.config.stars.fetching.catalogs, basestring): catalog_list = [self.config.stars.fetching.catalogs] elif isinstance(self.config.stars.fetching.catalogs, Sequence): catalog_list = self.config.stars.fetching.catalogs else: raise ValueError("Invalid option for 'catalogs', should be a string or a list of strings") # Create the star catalog self.stellar_catalog = catalogs.create_star_catalog(self.frame, catalog_list) # Inform the user log.debug("Number of stars: " + str(len(self.stellar_catalog))) # ----------------------------------------------------------------- def write_galactic_catalog_to(self, path): """ This function ... :param path: :return: """ # Inform the user log.info("Writing galactic catalog to " + path + " ...") # Write the catalog to file tables.write(self.galactic_catalog, path, format="ascii.commented_header") # ----------------------------------------------------------------- def write_stellar_catalog_to(self, path): """ This function ... :param path: :return: """ # Inform the user log.info("Writing stellar catalog to " + path + " ...") # Write the catalog to file tables.write(self.stellar_catalog, path, format="ascii.commented_header") # ----------------------------------------------------------------- def write_galactic_catalog(self): """ This function ... :return: """ # Determine the full path to the catalog file path = self.full_output_path(self.config.writing.galactic_catalog_path) # Write self.write_galactic_catalog_to(path) # ----------------------------------------------------------------- def write_stellar_catalog(self): """ This function ... :return: """ # Determine the full path to the catalog file path = self.full_output_path(self.config.writing.stellar_catalog_path) # Write self.write_stellar_catalog_to(path) # -----------------------------------------------------------------
29.343407
124
0.534688
1,045
10,681
5.288995
0.169378
0.067849
0.034739
0.047766
0.527049
0.470056
0.445631
0.364574
0.301429
0.285508
0
0.000633
0.260369
10,681
363
125
29.424242
0.698861
0.358674
0
0.105263
0
0
0.107645
0.014223
0
0
0
0
0
1
0.178947
false
0
0.315789
0
0.515789
0.010526
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
dcec245fe5c595efb2ab21254680e380a8487c57
1,446
py
Python
tests/checks/test_open_graph.py
rohan-pednekar/combine
23206e1a7a34800acd34beedeea018fb48591633
[ "MIT" ]
5
2021-01-25T19:40:04.000Z
2022-01-02T13:45:45.000Z
tests/checks/test_open_graph.py
rohan-pednekar/combine
23206e1a7a34800acd34beedeea018fb48591633
[ "MIT" ]
14
2018-07-06T17:19:33.000Z
2021-12-22T18:05:57.000Z
tests/checks/test_open_graph.py
rohan-pednekar/combine
23206e1a7a34800acd34beedeea018fb48591633
[ "MIT" ]
3
2019-02-12T10:05:45.000Z
2021-11-16T04:32:43.000Z
from bs4 import BeautifulSoup from combine.checks.open_graph import ( OpenGraphTitleCheck, OpenGraphDescriptionCheck, OpenGraphTypeCheck, OpenGraphURLCheck, OpenGraphImageCheck, OpenGraphSiteNameCheck, ) def test_open_graph_missing_checks(snapshot): content = """<!doctype html> <html> <head> </head> <body> </body> </html>""" soup = BeautifulSoup(content, "html.parser") check_classes = ( OpenGraphTitleCheck, OpenGraphDescriptionCheck, OpenGraphTypeCheck, OpenGraphURLCheck, OpenGraphImageCheck, OpenGraphSiteNameCheck, ) for check_class in check_classes: check = check_class(soup) issues = check.run() snapshot.assert_match(issues.as_data()) def test_open_graph_url_check(snapshot): content = """<!doctype html> <html> <head> <meta property="og:url" content="/page" /> </head> <body> </body> </html>""" check = OpenGraphURLCheck(BeautifulSoup(content, "html.parser")) issues = check.run() snapshot.assert_match(issues.as_data()) def test_open_graph_image_check(snapshot): content = """<!doctype html> <html> <head> <meta property="og:image" content="/page" /> </head> <body> </body> </html>""" check = OpenGraphImageCheck(BeautifulSoup(content, "html.parser")) issues = check.run() snapshot.assert_match(issues.as_data())
22.59375
70
0.650761
138
1,446
6.652174
0.304348
0.039216
0.035948
0.052288
0.730937
0.730937
0.432462
0.362745
0.362745
0.362745
0
0.000889
0.221992
1,446
63
71
22.952381
0.815111
0
0
0.722222
0
0
0.25242
0
0
0
0
0
0.055556
1
0.055556
false
0
0.037037
0
0.092593
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0d1417b0fea7fe950fc0083428f0a940a05b7c84
598
py
Python
basics/problem-4/code_py/pentagon_p_solution-garid.py
Ochirgarid/algorithms
c9c674de3c4af657daf2a5cd18510993d6fd18bd
[ "MIT" ]
null
null
null
basics/problem-4/code_py/pentagon_p_solution-garid.py
Ochirgarid/algorithms
c9c674de3c4af657daf2a5cd18510993d6fd18bd
[ "MIT" ]
null
null
null
basics/problem-4/code_py/pentagon_p_solution-garid.py
Ochirgarid/algorithms
c9c674de3c4af657daf2a5cd18510993d6fd18bd
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ File: pentagon_p_solution-garid.py Find the perimeter of pentagon. """ __author__ = "Ochirgarid Chinzorig (Ochirgarid)" __version__ = "1.0" # Open file on read mode inp = open("../test/test1.txt", "r") # read input lines one by one # and convert them to integer a = int(inp.readline().strip()) b = int(inp.readline().strip()) c = int(inp.readline().strip()) d = int(inp.readline().strip()) e = int(inp.readline().strip()) # must close opened file inp.close() # calculate perimeter p = a + b + c + d + e # print for std out print("Perimeter : {}".format(p))
19.933333
48
0.655518
91
598
4.197802
0.604396
0.078534
0.183246
0.248691
0
0
0
0
0
0
0
0.006024
0.167224
598
29
49
20.62069
0.761044
0.379599
0
0
0
0
0.194842
0
0
0
0
0
0
1
0
false
0
0
0
0
0.090909
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0d14b9242719c671cd0590497507f4ec8db699da
6,310
py
Python
pysnmp/MITEL-IPVIRTUAL-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/MITEL-IPVIRTUAL-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/MITEL-IPVIRTUAL-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 MITEL-IPVIRTUAL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MITEL-IPVIRTUAL-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:03:05 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ValueSizeConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") IpAddress, iso, Unsigned32, Counter64, TimeTicks, Bits, enterprises, ModuleIdentity, Gauge32, ObjectIdentity, Integer32, NotificationType, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "iso", "Unsigned32", "Counter64", "TimeTicks", "Bits", "enterprises", "ModuleIdentity", "Gauge32", "ObjectIdentity", "Integer32", "NotificationType", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32") RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "DisplayString", "TextualConvention") mitelIpGrpIpVirtualGroup = ModuleIdentity((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4)) mitelIpGrpIpVirtualGroup.setRevisions(('2003-03-24 09:31', '1999-03-01 00:00',)) if mibBuilder.loadTexts: mitelIpGrpIpVirtualGroup.setLastUpdated('200303240931Z') if mibBuilder.loadTexts: mitelIpGrpIpVirtualGroup.setOrganization('MITEL Corporation') mitel = MibIdentifier((1, 3, 6, 1, 4, 1, 1027)) mitelProprietary = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4)) mitelPropIpNetworking = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8)) mitelIpNetRouter = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1)) mitelRouterIpGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1)) mitelIpVGrpPortTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1), ) if mibBuilder.loadTexts: mitelIpVGrpPortTable.setStatus('current') mitelIpVGrpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1, 1), ).setIndexNames((0, "MITEL-IPVIRTUAL-MIB", "mitelIpVGrpPortTableNetAddr"), (0, "MITEL-IPVIRTUAL-MIB", "mitelIpVGrpPortTableIfIndex")) if mibBuilder.loadTexts: mitelIpVGrpPortEntry.setStatus('current') mitelIpVGrpPortTableNetAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpPortTableNetAddr.setStatus('current') mitelIpVGrpPortTableNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelIpVGrpPortTableNetMask.setStatus('current') mitelIpVGrpPortTableIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpPortTableIfIndex.setStatus('current') mitelIpVGrpPortTableStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1, 1, 12), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mitelIpVGrpPortTableStatus.setStatus('current') mitelIpVGrpPortTableCfgMethod = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("static", 1), ("addressless", 2), ("dhcp", 3), ("ipcp", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mitelIpVGrpPortTableCfgMethod.setStatus('current') mitelIpVGrpRipTable = MibTable((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2), ) if mibBuilder.loadTexts: mitelIpVGrpRipTable.setStatus('current') mitelIpVGrpRipEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2, 1), ).setIndexNames((0, "MITEL-IPVIRTUAL-MIB", "mitelIpVGrpTableRipIpAddr")) if mibBuilder.loadTexts: mitelIpVGrpRipEntry.setStatus('current') mitelIpVGrpTableRipIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpTableRipIpAddr.setStatus('current') mitelIpVGrpTableRipRxPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpTableRipRxPkts.setStatus('current') mitelIpVGrpTableRipRxBadPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpTableRipRxBadPkts.setStatus('current') mitelIpVGrpTableRipRxBadRtes = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpTableRipRxBadRtes.setStatus('current') mitelIpVGrpTableRipTxUpdates = MibTableColumn((1, 3, 6, 1, 4, 1, 1027, 4, 8, 1, 1, 4, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mitelIpVGrpTableRipTxUpdates.setStatus('current') mibBuilder.exportSymbols("MITEL-IPVIRTUAL-MIB", mitelIpVGrpTableRipRxBadRtes=mitelIpVGrpTableRipRxBadRtes, mitel=mitel, mitelIpVGrpRipTable=mitelIpVGrpRipTable, mitelIpVGrpPortTableNetMask=mitelIpVGrpPortTableNetMask, mitelIpVGrpPortTableStatus=mitelIpVGrpPortTableStatus, mitelIpGrpIpVirtualGroup=mitelIpGrpIpVirtualGroup, mitelIpVGrpPortTable=mitelIpVGrpPortTable, mitelIpVGrpTableRipIpAddr=mitelIpVGrpTableRipIpAddr, mitelIpNetRouter=mitelIpNetRouter, PYSNMP_MODULE_ID=mitelIpGrpIpVirtualGroup, mitelIpVGrpPortEntry=mitelIpVGrpPortEntry, mitelIpVGrpPortTableIfIndex=mitelIpVGrpPortTableIfIndex, mitelProprietary=mitelProprietary, mitelPropIpNetworking=mitelPropIpNetworking, mitelIpVGrpTableRipRxPkts=mitelIpVGrpTableRipRxPkts, mitelIpVGrpRipEntry=mitelIpVGrpRipEntry, mitelIpVGrpTableRipRxBadPkts=mitelIpVGrpTableRipRxBadPkts, mitelRouterIpGroup=mitelRouterIpGroup, mitelIpVGrpPortTableCfgMethod=mitelIpVGrpPortTableCfgMethod, mitelIpVGrpTableRipTxUpdates=mitelIpVGrpTableRipTxUpdates, mitelIpVGrpPortTableNetAddr=mitelIpVGrpPortTableNetAddr)
121.346154
1,046
0.775277
677
6,310
7.223043
0.212703
0.014724
0.016564
0.01636
0.326994
0.260941
0.207362
0.207362
0.1818
0.176892
0
0.07816
0.083518
6,310
51
1,047
123.72549
0.767422
0.052615
0
0
0
0
0.148099
0.020606
0
0
0
0
0
1
0
false
0
0.136364
0
0.136364
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0d189fec607ed774abe70bd69717342584a2dbf6
4,439
py
Python
django-react-web/users/models.py
DoggiKong/deco3801-project
1c4ff0f6032ee6517d7887fe3e7a0478ee3a9589
[ "MIT" ]
null
null
null
django-react-web/users/models.py
DoggiKong/deco3801-project
1c4ff0f6032ee6517d7887fe3e7a0478ee3a9589
[ "MIT" ]
6
2022-02-12T04:05:16.000Z
2022-03-08T22:34:03.000Z
django-react-web/users/models.py
ravenlib/deco3801-project
1c4ff0f6032ee6517d7887fe3e7a0478ee3a9589
[ "MIT" ]
null
null
null
import random import string from django.db import models from django.contrib.auth.models import AbstractUser, BaseUserManager from django.core import validators from django.utils.translation import gettext_lazy as _ from systemsdb.models import hrms_system, chromatography, analytical_column class UserManager(BaseUserManager): """ Model manager for User with email as username. """ use_in_migrations = True def _create_user(self, email, first_name, last_name, password, username=None, **extra_fields): """ Create and save a User with the given email and password. """ if not email: raise ValueError('Email must be given') elif self.filter(email__iexact=email): raise ValueError('An account with this email already exists') if not first_name: raise ValueError('First name must be given') if not last_name: raise ValueError('Last name must be given') if not password: raise ValueError('A password must be given') # Generate a unique username if not given if username is None: pool = string.ascii_lowercase + string.digits username = ''.join(random.choice(pool) for i in range(8)) while self.filter(username__iexact=username): username = ''.join(random.choice(pool) for i in range(8)) # If username is given check that it is unique elif self.filter(username__iexact=username): raise ValueError('An account with this username already exists') email = self.normalize_email(email) username = self.model.normalize_username(username) user = self.model( username=username, email=email, first_name=first_name, last_name=last_name, **extra_fields ) user.set_password(password) user.save(using=self._db) return user def create_user(self, email, first_name, last_name, password=None, **extra_fields): """ Create and save a User with the given email and password. """ extra_fields.setdefault('is_staff', False) extra_fields.setdefault('is_superuser', False) return self._create_user(email, first_name, last_name, password, **extra_fields) def create_superuser(self, email, first_name, last_name, password, **extra_fields): """ Create and save a User with the given email and password with superuser access. """ extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) if extra_fields.get('is_staff') is not True: raise ValueError('Superuser must have is_staff=True.') if extra_fields.get('is_superuser') is not True: raise ValueError('Superuser must have is_superuser=True.') return self._create_user(email, first_name, last_name, password, **extra_fields) def get_by_natural_key(self, username): return self.get(**{'{}__iexact'.format(self.model.USERNAME_FIELD): username}) class User(AbstractUser): """ User with email as username. """ email = models.EmailField(_('email address'), unique=True) first_name = models.CharField(_('first name'), max_length=30) last_name = models.CharField(_('last name'), max_length=150) position = models.TextField(blank=True) aid = models.ForeignKey('Affiliation', blank=True, null=True, on_delete=models.SET_NULL) USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['first_name', 'last_name'] objects = UserManager() def __unicode__(self): return self.email class Affiliation(models.Model): """ Affiliation associated with a User. """ aid = models.CharField(max_length=100, unique=True) location = models.TextField() def __str__(self): return self.aid class user_hrms(models.Model): User_id = models.ForeignKey(User, on_delete=models.CASCADE) HRMS_id = models.ForeignKey(hrms_system, on_delete=models.CASCADE) class user_column(models.Model): User_id = models.ForeignKey(User, on_delete=models.CASCADE) Column_id = models.ForeignKey(analytical_column, on_delete=models.CASCADE) class user_chroma(models.Model): User_id = models.ForeignKey(User, on_delete=models.CASCADE) Chroma_id = models.ForeignKey(chromatography, on_delete=models.CASCADE)
36.385246
98
0.675377
555
4,439
5.210811
0.223423
0.037344
0.033195
0.041148
0.419433
0.339903
0.267981
0.266598
0.256224
0.226487
0
0.002924
0.229556
4,439
121
99
36.68595
0.84269
0.088533
0
0.089744
0
0
0.09771
0
0
0
0
0
0
1
0.076923
false
0.102564
0.089744
0.038462
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
0d23a9504841a0b803f9f97aae1976a5dafc3c51
6,536
py
Python
week1.py
WhiteAu/python_intro
3cd71640543806258dec04573c84c0583e0065ef
[ "CC-BY-4.0" ]
null
null
null
week1.py
WhiteAu/python_intro
3cd71640543806258dec04573c84c0583e0065ef
[ "CC-BY-4.0" ]
null
null
null
week1.py
WhiteAu/python_intro
3cd71640543806258dec04573c84c0583e0065ef
[ "CC-BY-4.0" ]
null
null
null
#!/usr/bin/env python3 #### Intro to Python and Jupyter Notebooks #### #### Before class #### # share URL to hack.md # check installation of python and jupyter notebooks #### Welcome #### # instructor introduction # overview of fredhutch.io # sign in # learner introductions and motivation # overview course philosophy, how to stay engaged # course objectives: overview of basic functionality of python (syntax, data manipulation, visualization) #### Objectives #### # Today: # Python and jupyter notebooks # operators, functions, and data types # sequences and dictionaries # defining functions #### Orientation to Python and projects #### # ask about previous experience with Python or other programming languages # overview course philosophy, how to stay engaged # motivation for Python: programming language, reproducibility, open source # many ways to interact with Python # python in terminal # ipython in terminal # save script in text editor # IDE like spyder # notebook: web application that combines code, graphs, and text # interactive mode in terminal, chevrons (>>>) is prompt, waiting for input # scripting mode: save commands in file (ends in .py), execute entire file at once # about our tools # Anaconda: distribution (way of obtaining) Python; # includes extra packages like ipython, spyder # conda: package manager that comes with Anaconda, installs/updates packages # jupyter notebook: installed with Anaconda # setting up a project directory # create new directory called python_project # keep data, analyses, and text in single folder (directory) # scripts and text files in folder relate to relative places in the directory # suggested directories to go with project: # data/ which may include separate directories for raw and processed data # documents/ for outlines, drafts, and other text # scripts/ for scripts related to data cleaning, analysis, plotting # setting up Notebooks # open Terminal (Mac) or Command Prompt (Windows) # execute `jupyter notebook` # terminal window must stay open, this is kernel (running python) # web browser is how you interact with notebook # navigate to project directory # click "New" in upper right hand, then select "Python3" # creates notebook (*.ipynb, or ipython notebook file) # autosaves, or can save manually # click on title to rename # executing code in a jupyter notebook: # enter code in cell and execute by pressing Shift + Return/enter # output is printed directly below cell, prefaced by Out[ ]: # add new cell with + button # can add Markdown cells with nicely formatted text # comments prefaced with # (not read/executed by python) # commands and output saved in notebook # talk about other menu options and buttons to remove/add/run cells # example notebook: https://github.com/rasilab/machkovech_2018/blob/master/scripts/NA43_competition.ipynb #### Operators, functions, and data types #### # operators (mathematical calculations) 4 + 5 4+5 # spaces are optional, but easier to read 3 > 4 # comparisons, logic # built-in data types: strings, integers, floats number = 42 pi_value = 3.1415 text = "Fred Hutch" # find type of each using function (type) type(number) # integer type(pi_value) # float type(text) # string: characters (letters, numbers, punctuation, emoji) # convert float to integer int(pi_value) # decimals removed type(pi_value) # type hasn't changed! pi_value = int(pi_value) # convert original object type(pi_value) # convert integer to float float(number) # decimals added # see value of something (required to display output in a script) print(text) # demo example.py in separate window # print and type are built in functions; there can also be methods (subset of functions) and user-defined functions # find help on a function help(print) #### Sequences #### # lists: data structure that holds sequence of elements # surrounded by square brackets numbers = [1, 2, 3] # reference one part of a list numbers[0] # indexing starts at 0 # find help on an object (can also check under help menu) ?numbers # can also use help(numbers), but may not be useful to you right now # add number to end of list numbers.append(4) # append() is an attribute print(numbers) # can use tab complete in notebook to see other options ?numbers.append # find help for attribute # lists can be string data as well organs = ["lung", "breast", "prostate"] ## Challenge: what google search could you use to determine a method for adding multiple values to a list? ## Challenge: how do you remove items from a list? # tuple: list with ordered sequence of elements; cannot be modified # surrounded by parentheses a_tuple = (1, 2, 3) ## Challenge: # What happens when you execute: #numbers[1] = 5 #a_tuple[2] = 5 # Traceback is a multi-line error block printed # includes information on what error and where in code # comment out code error if you want to keep it for notes # sequences can include more than just one data type mix_tuple = ("lung", 200, "chromosome 1") # can apply to lists, but they're more often one data type # for loop to access elements in list, tuple, or other data structure one at a time for num in mix_tuple: print(num) #### Dictionaries #### # dictionary: container holding a pair of objects, key and value translation = {"one": 1, "two": 2} translation["one"] # can include lists as values list_value = {"yes": [1, 2, 3]} # cannot include lists as keys #list_key = {[1, 2, 3]: "nope"} # add items to dictionaries by assigning new value to key rev = {1: "one", 2: "two"} # different data types can be key, value rev[3] = "three" rev # access each element by key for key in rev.keys(): print(key, "->", rev[key]) # access each element one at a time with item for key, value in rev.items(): print(key, "->", value) ## Challenge: # print only the values of the rev dictionary to the screen # Reassign the second value (in the key value pair) so that it no longer reads “two” but instead “apple-sauce” # Print the values of rev to the screen again to see if the value has changed #### Functions #### # define a chunk of code as function def add_function(a, b): result = a + b return result z = add_function(20, 22) print(z) ## Challenge: define a new function called subtract_function that subtracts d from c and test on numbers of your choice #### Wrapping up #### # make sure work is saved # review how to get back into notebook # review objectives # preview next week's objectives # remind to sign in
32.039216
119
0.733323
982
6,536
4.861507
0.42057
0.010264
0.002514
0.01571
0.029326
0.016757
0.016757
0
0
0
0
0.009951
0.185129
6,536
203
120
32.197044
0.886406
0.822062
0
0.119048
0
0
0.074113
0
0
0
0
0
0
0
null
null
0
0
null
null
0.166667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
0d3f304864889ed76c7b55f11d5da2ba414a85da
530
py
Python
conflex/config_loader.py
odesenfans/conflex
6c871edf27495468ea58df24985771b3bcbea4ea
[ "MIT" ]
null
null
null
conflex/config_loader.py
odesenfans/conflex
6c871edf27495468ea58df24985771b3bcbea4ea
[ "MIT" ]
null
null
null
conflex/config_loader.py
odesenfans/conflex
6c871edf27495468ea58df24985771b3bcbea4ea
[ "MIT" ]
null
null
null
import abc from conflex.config_dict import ConfigDict class ConfigLoader(abc.ABC): """ Base class for configuration loaders. Configuration loaders are used to load a configuration dictionary from any type of configuration input (files, environment variables and so on). """ @abc.abstractmethod def load(self) -> ConfigDict: """ Loads the configuration and returns it as a ConfigDict object. :return: A ConfigDict object that represents the configuration. """ ...
29.444444
112
0.688679
62
530
5.870968
0.66129
0.10989
0.093407
0
0
0
0
0
0
0
0
0
0.243396
530
17
113
31.176471
0.907731
0.583019
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
0d5197178b7b05cbf1b9bffdb813e37c079f6061
429
py
Python
test/test_language_models/test_lstm.py
entn-at/BrnoLM
9f8c62523382098809c1c0967f62a67d151eafe0
[ "MIT" ]
null
null
null
test/test_language_models/test_lstm.py
entn-at/BrnoLM
9f8c62523382098809c1c0967f62a67d151eafe0
[ "MIT" ]
null
null
null
test/test_language_models/test_lstm.py
entn-at/BrnoLM
9f8c62523382098809c1c0967f62a67d151eafe0
[ "MIT" ]
null
null
null
from test.common import TestCase import torch from brnolm.language_models.lstm_model import LSTMLanguageModel class OutputExtractionTests(TestCase): def test_multilayer(self): model = LSTMLanguageModel(4, ninp=10, nhid=10, nlayers=2, dropout=0.0) h0 = model.init_hidden(3) o, h1 = model(torch.tensor([[1], [2], [3]]), h0) self.assertEqual(model.extract_output_from_h(h1).unsqueeze(1), o)
28.6
78
0.703963
59
429
5
0.644068
0
0
0
0
0
0
0
0
0
0
0.047887
0.172494
429
14
79
30.642857
0.783099
0
0
0
0
0
0
0
0
0
0
0
0.111111
1
0.111111
false
0
0.333333
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
0d55bfa7a19d8dfee60cf6e9fae2fb06ad9ab274
1,644
py
Python
bgpstream-api/bgpread-json.py
mathias4github/ulg-backend
75165a60996952f8902ad60687367f80ab33a240
[ "MIT" ]
null
null
null
bgpstream-api/bgpread-json.py
mathias4github/ulg-backend
75165a60996952f8902ad60687367f80ab33a240
[ "MIT" ]
null
null
null
bgpstream-api/bgpread-json.py
mathias4github/ulg-backend
75165a60996952f8902ad60687367f80ab33a240
[ "MIT" ]
null
null
null
from wsgiref.simple_server import make_server from pyramid.config import Configurator from pyramid.response import Response from pyramid.view import view_config import pyramid.httpexceptions as exc import re from pyramid.request import Request from _pybgpstream import BGPStream, BGPRecord, BGPElem from datetime import time, timedelta import json #@view_config(renderer='json') def data(request): import pdb; pdb.set_trace() #for prameter in request.GET.keys(): collector, start, end = 0 if request.GET.has_key("route_collector"): collector=request.GET["route_collector"] if request.GET.has_key('timespan_start'): start=request.GET["timespan_start"] if request.GET.has_key('timespan_end'): end=request.GET["timespan_end"] # create a new bgpstream instance stream = BGPStream() # select the data source # on the CLI it works this way $ bgpreader -d sqlite -o db-file,ULG.sqlite -w 1477000000,1777360000 stream.set_data_interface("sqlite") print("collector from URL is: " + collector) # FIXME Use the collector name stream.set_data_interface_option('db-file', collector +'.sqlite') # create a reusable bgprecord instance rec = BGPRecord() #if start >= 0 and end >= 0 # do something #else # do the default timerange return response if __name__ == '__main__': config = Configurator() config.add_route('bgpread', '/peers/') config.add_view(data, route_name='bgpread', renderer='json') app = config.make_wsgi_app() server = make_server('0.0.0.0', 8080, app) server.serve_forever()
27.864407
103
0.700122
218
1,644
5.119266
0.431193
0.062724
0.032258
0.040323
0.062724
0.046595
0
0
0
0
0
0.023538
0.198905
1,644
58
104
28.344828
0.823842
0.213504
0
0
0
0
0.128806
0
0
0
0
0.017241
0
1
0.03125
false
0
0.34375
0
0.40625
0.03125
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
2
0d561c9dd286295ad0cb35d437c1ba3771970e73
138
py
Python
functions/algorithms/classes/table.py
aaronyan/line
8f37b78231c83763497a7b310da6d8cda9c02cef
[ "MIT" ]
3
2015-04-17T10:43:24.000Z
2015-05-21T16:57:29.000Z
functions/algorithms/classes/table.py
aaronyan/line
8f37b78231c83763497a7b310da6d8cda9c02cef
[ "MIT" ]
null
null
null
functions/algorithms/classes/table.py
aaronyan/line
8f37b78231c83763497a7b310da6d8cda9c02cef
[ "MIT" ]
null
null
null
import datetime class Table(object): def __init__(self): self.idn = '' self.q = [] self.min_wait = datetime.timedelta(minutes = 0)
19.714286
49
0.681159
19
138
4.684211
0.789474
0
0
0
0
0
0
0
0
0
0
0.008772
0.173913
138
7
49
19.714286
0.77193
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
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
0
0
0
0
0
0
2
b495f69dd48c70d3880916b2faeee9ae25bc101c
3,080
py
Python
neutrino_api/models/blacklist.py
NeutrinoAPI/NeutrinoAPI-Python
cc00933eefef0f40710f606e9fbf2dfb97a4f063
[ "MIT" ]
3
2019-01-23T19:34:01.000Z
2019-12-05T06:21:25.000Z
neutrino_api/models/blacklist.py
NeutrinoAPI/NeutrinoAPI-Python
cc00933eefef0f40710f606e9fbf2dfb97a4f063
[ "MIT" ]
null
null
null
neutrino_api/models/blacklist.py
NeutrinoAPI/NeutrinoAPI-Python
cc00933eefef0f40710f606e9fbf2dfb97a4f063
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ neutrino_api This file was automatically generated for NeutrinoAPI by APIMATIC v2.0 ( https://apimatic.io ). """ class Blacklist(object): """Implementation of the 'Blacklist' model. TODO: type model description here. Attributes: is_listed (bool): true if listed, false if not list_host (string): the domain/hostname of the DNSBL list_rating (int): the list rating [1-3] with 1 being the best rating and 3 the lowest rating list_name (string): the name of the DNSBL txt_record (string): the TXT record returned for this listing (if listed) return_code (string): the specific return code for this listing (if listed) response_time (int): the DNSBL server response time in milliseconds """ # Create a mapping from Model property names to API property names _names = { "is_listed":'isListed', "list_host":'listHost', "list_rating":'listRating', "list_name":'listName', "txt_record":'txtRecord', "return_code":'returnCode', "response_time":'responseTime' } def __init__(self, is_listed=None, list_host=None, list_rating=None, list_name=None, txt_record=None, return_code=None, response_time=None): """Constructor for the Blacklist class""" # Initialize members of the class self.is_listed = is_listed self.list_host = list_host self.list_rating = list_rating self.list_name = list_name self.txt_record = txt_record self.return_code = return_code self.response_time = response_time @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary is_listed = dictionary.get('isListed') list_host = dictionary.get('listHost') list_rating = dictionary.get('listRating') list_name = dictionary.get('listName') txt_record = dictionary.get('txtRecord') return_code = dictionary.get('returnCode') response_time = dictionary.get('responseTime') # Return an object of this model return cls(is_listed, list_host, list_rating, list_name, txt_record, return_code, response_time)
31.752577
100
0.573701
334
3,080
5.122754
0.317365
0.046756
0.011689
0.018703
0.025716
0
0
0
0
0
0
0.003514
0.353247
3,080
96
101
32.083333
0.855422
0.405519
0
0
1
0
0.127364
0
0
0
0
0.010417
0
1
0.045455
false
0
0
0
0.136364
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
b49a04fffed2cad26ed27a8f3436acc16f9cf2c8
158
py
Python
telegram_bot/handlers/users/__init__.py
Oorzhakau/TeamForce_bot
b8037d53b228bc2ab5149fa67dde6bea17f25a65
[ "MIT" ]
null
null
null
telegram_bot/handlers/users/__init__.py
Oorzhakau/TeamForce_bot
b8037d53b228bc2ab5149fa67dde6bea17f25a65
[ "MIT" ]
null
null
null
telegram_bot/handlers/users/__init__.py
Oorzhakau/TeamForce_bot
b8037d53b228bc2ab5149fa67dde6bea17f25a65
[ "MIT" ]
null
null
null
from . import ( about_us, cancel, distribution, help, info, link, menu, messages, select_messages, start, tags, )
11.285714
20
0.531646
15
158
5.466667
0.933333
0
0
0
0
0
0
0
0
0
0
0
0.379747
158
13
21
12.153846
0.836735
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.076923
0
0.076923
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
b4ac1524a47c6efcfe06c002c29f5d2e1941e093
263
py
Python
states/auth.py
DNL-inc/bit
b6f35e95b2b40a3eec308a2c7179a73eadad3556
[ "MIT" ]
1
2020-11-04T16:15:52.000Z
2020-11-04T16:15:52.000Z
states/auth.py
DNL-inc/bit
b6f35e95b2b40a3eec308a2c7179a73eadad3556
[ "MIT" ]
null
null
null
states/auth.py
DNL-inc/bit
b6f35e95b2b40a3eec308a2c7179a73eadad3556
[ "MIT" ]
null
null
null
from aiogram import types from aiogram.dispatcher.filters.state import State, StatesGroup class AuthStates(StatesGroup): choose_lang = State() choose_faculty = State() choose_course = State() choose_group = State() choose_subgroups = State()
26.3
63
0.737643
30
263
6.3
0.533333
0.232804
0
0
0
0
0
0
0
0
0
0
0.178707
263
10
64
26.3
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
b4b31654ec3139e5c4eed374a6f1e2ad1e526196
1,160
py
Python
Mundo 1/desafios/desafio031-Custo da viagem.py
marioarl/python
0bd677cdbec87e9603866c09cb8009fef295b89b
[ "MIT" ]
1
2021-11-21T21:04:04.000Z
2021-11-21T21:04:04.000Z
Mundo 1/desafios/desafio031-Custo da viagem.py
marioarl/python
0bd677cdbec87e9603866c09cb8009fef295b89b
[ "MIT" ]
null
null
null
Mundo 1/desafios/desafio031-Custo da viagem.py
marioarl/python
0bd677cdbec87e9603866c09cb8009fef295b89b
[ "MIT" ]
null
null
null
# Desenvolva um programa que pergunte a distancia de uma viagem em Km. #Calcule o preço da passagem, cobrando R$0,50 por Km para viagens de até 200Km e R$0,45 # para viagens mais longas. #minha resposta #dist = float(input('Qual a distancia da sua viagem? ')) #print('Voce está prestes a começar uma viagem de {:.1f}Km'.format(dist)) #if dist <= 200: # print('E o preço da sua passagem será de R${:.2f}'.format(dist * 0.50)) #else: # print('E o preço da sua passagem será de R${:.2f}'.format(dist * 0.45)) #resposta1 do Gustavo #distancia = float(input('Qual a distancia da sua viagem? ')) #print('Voce está prestes a começar uma viagem de {:.1f}Km'.format(distancia)) #if distancia <= 200: # preco = distancia * 0.50 #else: # preco = distancia * 0.45 #print('E o preço da sua passagem será de R${:.2f}'.format(preco)) #resposta2 do gustavo distancia = float(input('Qual a distancia da sua viagem? ')) print('Voce está prestes a começar uma viagem de {:.1f}Km'.format(distancia)) preco = distancia * 0.50 if distancia <= 200 else distancia * 0.45 #if in line ou operador ternario print('E o preço da sua passagem será de R${:.2f}'.format(preco))
44.615385
99
0.698276
199
1,160
4.070352
0.296482
0.04321
0.049383
0.059259
0.6
0.6
0.6
0.6
0.6
0.6
0
0.046536
0.166379
1,160
26
100
44.615385
0.791107
0.728448
0
0
0
0
0.420339
0
0
0
0
0
0
1
0
false
0.25
0
0
0
0.5
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
1
0
2
b4b529c54918d9975a7becf7bac859c5d91e7de0
203
py
Python
python/lab-4/user.py
vanjantsPIJ/lab-4
82fea2ebb541f9c0635f31a05322a4dacf554339
[ "MIT" ]
null
null
null
python/lab-4/user.py
vanjantsPIJ/lab-4
82fea2ebb541f9c0635f31a05322a4dacf554339
[ "MIT" ]
null
null
null
python/lab-4/user.py
vanjantsPIJ/lab-4
82fea2ebb541f9c0635f31a05322a4dacf554339
[ "MIT" ]
null
null
null
name = input("Как вас зовут?:") age = input("Сколько вам лет?:") livePlace = input("Где вы живете?:") age = int(age) print("Это ", name) print("Ему/ей ", age, " лет") print("Он/она живет ", livePlace)
20.3
36
0.625616
31
203
4.096774
0.677419
0
0
0
0
0
0
0
0
0
0
0
0.157635
203
9
37
22.555556
0.74269
0
0
0
0
0
0.369458
0
0
0
0
0
0
1
0
false
0
0
0
0
0.428571
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
b4ce7985aad6090be4d87bdfbb78caeca2ab9dea
1,328
py
Python
apps/task_manager/migrations/0017_auto_20170911_1855.py
ycheng-aa/gated_launch_backend
cbb9e7e530ab28d5914276e9607ebfcf84be6433
[ "MIT" ]
null
null
null
apps/task_manager/migrations/0017_auto_20170911_1855.py
ycheng-aa/gated_launch_backend
cbb9e7e530ab28d5914276e9607ebfcf84be6433
[ "MIT" ]
null
null
null
apps/task_manager/migrations/0017_auto_20170911_1855.py
ycheng-aa/gated_launch_backend
cbb9e7e530ab28d5914276e9607ebfcf84be6433
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-09-11 18:55 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('task_manager', '0016_merge_20170901_0928'), ] operations = [ migrations.AlterField( model_name='grayappversion', name='android_download_url', field=models.CharField(default='', max_length=1000, verbose_name='android版本下载链接'), ), migrations.AlterField( model_name='grayappversion', name='android_release_date', field=models.DateField(null=True, verbose_name='android版本创建时间'), ), migrations.AlterField( model_name='grayappversion', name='ios_download_url', field=models.CharField(default='', max_length=1000, verbose_name='ios版本下载链接'), ), migrations.AlterField( model_name='grayappversion', name='ios_release_date', field=models.DateField(null=True, verbose_name='ios版本创建时间'), ), migrations.AlterField( model_name='grayappversion', name='ios_version', field=models.CharField(default='', max_length=256, verbose_name='ios版本号'), ), ]
32.390244
94
0.614458
127
1,328
6.181102
0.464567
0.127389
0.159236
0.184713
0.659873
0.659873
0.614013
0.28535
0.28535
0.157962
0
0.044239
0.268072
1,328
40
95
33.2
0.763374
0.049699
0
0.454545
1
0
0.189833
0.019063
0
0
0
0
0
1
0
false
0
0.060606
0
0.151515
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b4d29d12243c83635b1e3fa954d810712a5f8401
566
py
Python
issues/permissions.py
rh-cssre/glitchtip-backend
ae12fbd54532cff5fd3d7a72631ba18625bbf1de
[ "MIT" ]
null
null
null
issues/permissions.py
rh-cssre/glitchtip-backend
ae12fbd54532cff5fd3d7a72631ba18625bbf1de
[ "MIT" ]
null
null
null
issues/permissions.py
rh-cssre/glitchtip-backend
ae12fbd54532cff5fd3d7a72631ba18625bbf1de
[ "MIT" ]
null
null
null
from glitchtip.permissions import ScopedPermission class IssuePermission(ScopedPermission): scope_map = { "GET": ["event:read", "event:write", "event:admin"], "POST": ["event:write", "event:admin"], "PUT": ["event:write", "event:admin"], "DELETE": ["event:admin"], } def get_user_scopes(self, obj, user): return obj.project.organization.get_user_scopes(user) class EventPermission(IssuePermission): def get_user_scopes(self, obj, user): return obj.issue.project.organization.get_user_scopes(user)
29.789474
67
0.667845
64
566
5.765625
0.421875
0.108401
0.140921
0.162602
0.390244
0.390244
0.195122
0.195122
0.195122
0
0
0
0.185512
566
18
68
31.444444
0.800434
0
0
0.153846
0
0
0.181979
0
0
0
0
0
0
1
0.153846
false
0
0.076923
0.153846
0.615385
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
0
0
0
2
b4e04f6dc682592088fff0260be14c8de3850762
1,937
py
Python
grading_module/autograder/junitparser/test/test_mocha.py
minneapolis-edu/web-autograder
96e8e976166576a396ac7b6f6fb978d62c20d665
[ "Unlicense" ]
1
2019-02-27T00:38:08.000Z
2019-02-27T00:38:08.000Z
grading_module/autograder/junitparser/test/test_mocha.py
minneapolis-edu/web-autograder
96e8e976166576a396ac7b6f6fb978d62c20d665
[ "Unlicense" ]
5
2020-02-11T23:32:47.000Z
2022-03-02T02:54:52.000Z
grading_module/autograder/junitparser/test/test_mocha.py
minneapolis-edu/web-autograder
96e8e976166576a396ac7b6f6fb978d62c20d665
[ "Unlicense" ]
null
null
null
from unittest import TestCase from parse import parse import sys import os class TestMochaParser(TestCase): def test_mocha_file_pass_and_fail(self): filename = os.path.join('test', 'example_mocha_pass_fail.xml') testsuites = parse.parse(filename) self.assertEqual(5, testsuites.tests) self.assertEqual(1, testsuites.failures) self.assertEqual(4, len(testsuites)) ts_root = testsuites[0] # Empty testsuite, no tests self.assertEqual(0, ts_root.tests) self.assertEqual('Root Suite', ts_root.name) # Testsuite with two testcases, with two passsing tests ts_has_testcases = testsuites[2] self.assertEqual('api crud tests with no data in DB', ts_has_testcases.name) self.assertEqual(2, ts_has_testcases.tests) self.assertEqual(2, len(ts_has_testcases)) for tc in ts_has_testcases.testcases: self.assertTrue(tc.passed) # Testsuite with one pass, one fail testcase ts_has_fail = testsuites[3] self.assertEqual("api crud tests with test data in DB", ts_has_fail.name) self.assertEqual(3, ts_has_fail.tests) self.assertEqual(1, ts_has_fail.failures) self.assertEqual(2, ts_has_fail.passes) self.assertEqual('/Users/admin/Development/node/AllOfTheWebLabs/Server_Week_1/test/api_test.js', ts_has_fail.filename) tc_fail = ts_has_fail[0] self.assertFalse(tc_fail.passed) self.assertIsNotNone(tc_fail.failure) self.assertEqual('expected [ Array(3) ] to have a length of 30000 but got 3', tc_fail.failure.message) expected = 'AssertionError: expected [ Array(3) ] to have a length of 30000 but got 3\n at chai_server.get.end (test/api_test.js:108:32)\n at Test.Request.callback (node_modules/superagent/lib/node/index.js:716:12)' self.assertTrue(tc_fail.failure.fulltext.startswith(expected))
39.530612
229
0.696954
272
1,937
4.794118
0.352941
0.161043
0.048313
0.032209
0.162577
0.110429
0.062883
0.062883
0.062883
0.062883
0
0.02474
0.207021
1,937
48
230
40.354167
0.824219
0.062984
0
0
0
0.03125
0.248482
0.110988
0
0
0
0
0.59375
1
0.03125
false
0.15625
0.125
0
0.1875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
1
0
0
0
0
0
2
b4e24d6eb18e914e0bfbee4387c1fc9c359f83b6
2,883
py
Python
survae/tests/transforms/bijections/coupling/coupling_linear.py
alisiahkoohi/survae_flows
e1747b05524c7ab540a211ed360ab3e67bc3e96d
[ "MIT" ]
262
2020-07-05T20:57:44.000Z
2022-03-28T02:24:43.000Z
survae/tests/transforms/bijections/coupling/coupling_linear.py
alisiahkoohi/survae_flows
e1747b05524c7ab540a211ed360ab3e67bc3e96d
[ "MIT" ]
17
2020-08-15T05:43:34.000Z
2022-01-31T12:24:21.000Z
survae/tests/transforms/bijections/coupling/coupling_linear.py
alisiahkoohi/survae_flows
e1747b05524c7ab540a211ed360ab3e67bc3e96d
[ "MIT" ]
35
2020-08-24T06:55:37.000Z
2022-02-11T05:17:58.000Z
import numpy as np import torch import torch.nn as nn import torchtestcase import unittest from survae.transforms.bijections.coupling import * from survae.nn.layers import ElementwiseParams, ElementwiseParams2d from survae.tests.transforms.bijections import BijectionTest class AdditiveCouplingBijectionTest(BijectionTest): def test_bijection_is_well_behaved(self): batch_size = 10 self.eps = 1e-6 for shape in [(6,), (6,8,8)]: for num_condition in [None, 1]: with self.subTest(shape=shape, num_condition=num_condition): x = torch.randn(batch_size, *shape) if num_condition is None: if len(shape) == 1: net = nn.Linear(3,3) if len(shape) == 3: net = nn.Conv2d(3,3, kernel_size=3, padding=1) else: if len(shape) == 1: net = nn.Linear(1,5) if len(shape) == 3: net = nn.Conv2d(1,5, kernel_size=3, padding=1) bijection = AdditiveCouplingBijection(net, num_condition=num_condition) self.assert_bijection_is_well_behaved(bijection, x, z_shape=(batch_size, *shape)) z, _ = bijection.forward(x) if num_condition is None: self.assertEqual(x[:,:3], z[:,:3]) else: self.assertEqual(x[:,:1], z[:,:1]) class AffineCouplingBijectionTest(BijectionTest): def test_bijection_is_well_behaved(self): batch_size = 10 self.eps = 5e-6 for shape in [(6,), (6,8,8)]: for num_condition in [None, 1]: with self.subTest(shape=shape, num_condition=num_condition): x = torch.randn(batch_size, *shape) if num_condition is None: if len(shape) == 1: net = nn.Sequential(nn.Linear(3,3*2), ElementwiseParams(2)) if len(shape) == 3: net = nn.Sequential(nn.Conv2d(3,3*2, kernel_size=3, padding=1), ElementwiseParams2d(2)) else: if len(shape) == 1: net = nn.Sequential(nn.Linear(1,5*2), ElementwiseParams(2)) if len(shape) == 3: net = nn.Sequential(nn.Conv2d(1,5*2, kernel_size=3, padding=1), ElementwiseParams2d(2)) bijection = AffineCouplingBijection(net, num_condition=num_condition) self.assert_bijection_is_well_behaved(bijection, x, z_shape=(batch_size, *shape)) z, _ = bijection.forward(x) if num_condition is None: self.assertEqual(x[:,:3], z[:,:3]) else: self.assertEqual(x[:,:1], z[:,:1]) if __name__ == '__main__': unittest.main()
44.353846
131
0.546653
338
2,883
4.508876
0.198225
0.110236
0.052493
0.057743
0.732283
0.707349
0.707349
0.654856
0.602362
0.568241
0
0.038441
0.341311
2,883
64
132
45.046875
0.764086
0
0
0.555556
0
0
0.002775
0
0
0
0
0
0.111111
1
0.037037
false
0
0.148148
0
0.222222
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b4ec993cde81c5d6371362c0a25f6439c8f2e39d
215
py
Python
pyvisdk/enums/file_system_interface_version.py
Infinidat/pyvisdk
f2f4e5f50da16f659ccc1d84b6a00f397fa997f8
[ "MIT" ]
null
null
null
pyvisdk/enums/file_system_interface_version.py
Infinidat/pyvisdk
f2f4e5f50da16f659ccc1d84b6a00f397fa997f8
[ "MIT" ]
null
null
null
pyvisdk/enums/file_system_interface_version.py
Infinidat/pyvisdk
f2f4e5f50da16f659ccc1d84b6a00f397fa997f8
[ "MIT" ]
null
null
null
######################################## # Automatically generated, do not edit. ######################################## from pyvisdk.thirdparty import Enum FileSystemInterfaceVersion = Enum( 'NFSV3_0', )
16.538462
40
0.460465
14
215
7
0.928571
0
0
0
0
0
0
0
0
0
0
0.010582
0.12093
215
12
41
17.916667
0.507937
0.172093
0
0
1
0
0.073684
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3714039093c25536514ce5010372b68ff1d492fc
673
py
Python
bases/vision/transforms.py
yeshwanthv5/PruneFL
ad1f7f33b0605d1d79abfbe42ef287fcc613a943
[ "MIT" ]
6
2021-07-01T05:35:08.000Z
2022-03-04T18:53:31.000Z
bases/vision/transforms.py
yeshwanthv5/PruneFL
ad1f7f33b0605d1d79abfbe42ef287fcc613a943
[ "MIT" ]
null
null
null
bases/vision/transforms.py
yeshwanthv5/PruneFL
ad1f7f33b0605d1d79abfbe42ef287fcc613a943
[ "MIT" ]
1
2021-06-21T14:24:47.000Z
2021-06-21T14:24:47.000Z
import torch from torch.nn.functional import one_hot class Flatten: def __call__(self, img: torch.FloatTensor): return img.reshape((-1)) class OneHot: def __init__(self, n_classes, to_float: bool = False): self.n_classes = n_classes self.to_float = to_float def __call__(self, label: torch.Tensor): return one_hot(label, self.n_classes).float() if self.to_float else one_hot(label, self.n_classes) class DataToTensor: def __init__(self, dtype=None): if dtype is None: dtype = torch.float self.dtype = dtype def __call__(self, data): return torch.tensor(data, dtype=self.dtype)
24.925926
106
0.667162
95
673
4.389474
0.357895
0.095923
0.115108
0.071942
0.110312
0.110312
0
0
0
0
0
0.001942
0.23477
673
26
107
25.884615
0.807767
0
0
0
0
0
0
0
0
0
0
0
0
1
0.277778
false
0
0.111111
0.166667
0.722222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
37172e74cb9196a9163a4e96fa8c953c959e5d67
2,373
py
Python
src/fts3/rest/client/easy/state.py
Jar-win/fts-rest
4db0880cf328037b8587b4d16741c40959b47ad2
[ "Apache-2.0" ]
1
2018-08-28T11:28:09.000Z
2018-08-28T11:28:09.000Z
src/fts3/rest/client/easy/state.py
Jar-win/fts-rest
4db0880cf328037b8587b4d16741c40959b47ad2
[ "Apache-2.0" ]
13
2019-06-17T13:24:21.000Z
2022-02-03T16:28:10.000Z
src/fts3/rest/client/easy/state.py
Jar-win/fts-rest
4db0880cf328037b8587b4d16741c40959b47ad2
[ "Apache-2.0" ]
3
2018-11-29T12:16:29.000Z
2021-02-25T09:16:47.000Z
# Copyright notice: # Copyright CERN, 2014. # # 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 fts3.rest.client import Inquirer def list_jobs(context, user_dn=None, vo=None, source_se=None, dest_se=None, delegation_id=None, state_in=None): """ List active jobs. Can filter by user_dn and vo Args: context: fts3.rest.client.context.Context instance user_dn: Filter by user dn. Can be left empty vo: Filter by vo. Can be left empty delegation_id: Filter by delegation ID. Mandatory for state_in state_in: Filter by job state. An iterable is expected (i.e. ['SUBMITTED', 'ACTIVE'] Returns: Decoded JSON message returned by the server (list of jobs) """ inquirer = Inquirer(context) return inquirer.get_job_list(user_dn, vo, source_se, dest_se, delegation_id, state_in) def get_job_status(context, job_id, list_files=False): """ Get a job status Args: context: fts3.rest.client.context.Context instance job_id: The job ID list_files: If True, the status of each individual file will be queried Returns: Decoded JSON message returned by the server (job status plus, optionally, list of files) """ inquirer = Inquirer(context) return inquirer.get_job_status(job_id, list_files) def get_jobs_statuses(context, job_ids, list_files=False): """ Get status for a list of jobs Args: context: fts3.rest.client.context.Context instance job_ids: The job list list_files: If True, the status of each individual file will be queried Returns: Decoded JSON message returned by the server (job status plus, optionally, list of files) """ inquirer = Inquirer(context) return inquirer.get_jobs_statuses(job_ids, list_files)
35.954545
111
0.691951
345
2,373
4.649275
0.344928
0.037406
0.034913
0.035536
0.36596
0.36596
0.36596
0.337282
0.280549
0.218204
0
0.006626
0.236831
2,373
65
112
36.507692
0.879072
0.687316
0
0.3
0
0
0
0
0
0
0
0
0
1
0.3
false
0
0.1
0
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
0
1
0
0
2
2e9b71de943af081cff0fc622e29dae6d17d8427
543
py
Python
src/emutils/args.py
emanuele-albini/emutils
d5e3939da8a14b629879f06d87d4bd371e7117ab
[ "MIT" ]
null
null
null
src/emutils/args.py
emanuele-albini/emutils
d5e3939da8a14b629879f06d87d4bd371e7117ab
[ "MIT" ]
null
null
null
src/emutils/args.py
emanuele-albini/emutils
d5e3939da8a14b629879f06d87d4bd371e7117ab
[ "MIT" ]
null
null
null
ATTACK = '-' SUPPORT = '+' NEUTRAL = '0' CRITICAL_SUPPORT = '+!' CRITICAL_ATTACK = '-!' WEAK_SUPPORT = '+*' WEAK_ATTACK = '-*' NON_SUPPORT = '+~' NON_ATTACK = '-~' TRIPOLAR_RELATIONS = [ATTACK, SUPPORT, NEUTRAL] QUADPOLAR_RELATIONS = [ATTACK, SUPPORT, NEUTRAL, CRITICAL_SUPPORT] def get_type(val): if val > 0: return SUPPORT elif val < 0: return ATTACK else: return NEUTRAL def get_relations_set(G, rel=None): return set([edge for edge in G.edges if rel is None or G.edges[edge]['type'] == rel])
19.392857
89
0.635359
70
543
4.757143
0.4
0.117117
0.18018
0.174174
0
0
0
0
0
0
0
0.007075
0.219153
543
28
89
19.392857
0.778302
0
0
0
0
0
0.034926
0
0
0
0
0
0
1
0.1
false
0
0
0.05
0.3
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2ea3106155f2dde74b52f99f317711e3826f4c70
339
py
Python
demo_20191126/models/user.py
samllzhuzhu/cao
8c2311926409f0d7cfab1a564500b7d42a013d7c
[ "Apache-2.0" ]
null
null
null
demo_20191126/models/user.py
samllzhuzhu/cao
8c2311926409f0d7cfab1a564500b7d42a013d7c
[ "Apache-2.0" ]
null
null
null
demo_20191126/models/user.py
samllzhuzhu/cao
8c2311926409f0d7cfab1a564500b7d42a013d7c
[ "Apache-2.0" ]
null
null
null
from database import db class User(db.Model): # __table_args__ = {"schema": "demo"} __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(20)) age = db.Column(db.Integer) def __init__(self, name, age): self.name = name self.age = age
24.214286
69
0.631268
46
339
4.347826
0.565217
0.12
0.15
0.17
0
0
0
0
0
0
0
0.007692
0.233038
339
13
70
26.076923
0.761538
0.103245
0
0
0
0
0.013245
0
0
0
0
0
0
1
0.111111
false
0
0.111111
0
0.777778
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
2ea3adbac26869342e324adc64be5809e20cc68e
140
py
Python
api/src/model/ModelAssociation.py
SamuelJansen/idealizar-whats-app-manager-api
a23114d5b841b3b3e45c0309b19c68df2fe1373e
[ "MIT" ]
null
null
null
api/src/model/ModelAssociation.py
SamuelJansen/idealizar-whats-app-manager-api
a23114d5b841b3b3e45c0309b19c68df2fe1373e
[ "MIT" ]
null
null
null
api/src/model/ModelAssociation.py
SamuelJansen/idealizar-whats-app-manager-api
a23114d5b841b3b3e45c0309b19c68df2fe1373e
[ "MIT" ]
null
null
null
from python_framework import FrameworkModel MESSAGE = 'Message' SESSION = 'Session' CONTACT = 'Contact' MODEL = FrameworkModel.getModel()
17.5
43
0.778571
14
140
7.714286
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.128571
140
7
44
20
0.885246
0
0
0
0
0
0.15
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2eaf1d9897892ca1c7ff710d63c1353dc4310340
181
py
Python
req.py
algoneer/algoneer-py
5f300543116278c91a9cf8c9ef5a1375e3f1e75d
[ "MIT" ]
10
2019-08-05T16:06:12.000Z
2020-12-19T16:40:48.000Z
req.py
algoneer/algoneer-py
5f300543116278c91a9cf8c9ef5a1375e3f1e75d
[ "MIT" ]
null
null
null
req.py
algoneer/algoneer-py
5f300543116278c91a9cf8c9ef5a1375e3f1e75d
[ "MIT" ]
2
2020-11-17T20:05:09.000Z
2021-01-11T21:15:28.000Z
with open('requirements.txt') as input_file: reqs = [line.strip() for line in input_file.read().split() if not line.strip().startswith('#') and line.find(' req: ignore') == -1]
60.333333
135
0.668508
28
181
4.25
0.785714
0.151261
0
0
0
0
0
0
0
0
0
0.006369
0.132597
181
2
136
90.5
0.751592
0
0
0
0
0
0.160221
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2eb1aa9590d2ad3d7b9bcee7b1587bb80e025d18
1,514
py
Python
pyfunt/affine.py
RaulMurillo/PyFunt
a1bc4b91894c7af5052cf851150533dca1275e2a
[ "MIT" ]
null
null
null
pyfunt/affine.py
RaulMurillo/PyFunt
a1bc4b91894c7af5052cf851150533dca1275e2a
[ "MIT" ]
null
null
null
pyfunt/affine.py
RaulMurillo/PyFunt
a1bc4b91894c7af5052cf851150533dca1275e2a
[ "MIT" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 from .module import Module import numpy as np class Affine(Module): def __init__(self, input_size, output_size, bias=False): super(Affine, self).__init__() self.weight = np.ndarray(output_size, input_size) self.grad_weight = np.ndarray(output_size, input_size) if bias: self.bias = np.ndarray(output_size) self.grad_bias = np.ndarray(output_size) self.reset() def no_bias(self): self.bias = None self.grad_bias = None return self def reset(self, stdv=None): if not stdv: stdv = 1./np.sqrt(self.weight.shape[2]) self.weight = np.uniform(-stdv, stdv, self.weight.shape) self.bias = np.uniform(-stdv, stdv, self.weight.shape[0]) def update_output(self, x): w = self.weight b = self.bias or np.zeros(self.weight.shape[0]) self.out = x.reshape(x.shape[0], -1).dot(w) + b self.x = x return self.output def update_grad_input(self, input, grad_output): x, w = self.x, self.weight self.grad_input = grad_output.dot(w.T).reshape(x.shape) return self.grad_input def acc_grad_parameters(self, x, grad_output, scale=1): x = self.x self.grad_weight = x.reshape(x.shape[0], -1).T.dot(grad_output) if self.bias: self.grad_bias = np.sum(grad_output, axis=0) def clear_state(self): pass def __str__(self): pass
28.566038
71
0.60502
224
1,514
3.915179
0.263393
0.09122
0.068415
0.086659
0.248575
0.248575
0.150513
0
0
0
0
0.009973
0.271466
1,514
52
72
29.115385
0.785131
0.022457
0
0.051282
0
0
0
0
0
0
0
0
0
1
0.205128
false
0.051282
0.051282
0
0.358974
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
2ec57428f580c070feeb3e31b8f5c9445f2e5396
294
py
Python
gooddata-pandas/tests/dataframe/conftest.py
jaceksan/gooddata-python-sdk
640bd8b679e00a5f0eb627bdf6143de078f8b59b
[ "MIT" ]
7
2022-01-24T16:27:06.000Z
2022-02-25T10:18:49.000Z
gooddata-pandas/tests/dataframe/conftest.py
jaceksan/gooddata-python-sdk
640bd8b679e00a5f0eb627bdf6143de078f8b59b
[ "MIT" ]
29
2022-01-20T15:45:38.000Z
2022-03-31T09:39:25.000Z
gooddata-pandas/tests/dataframe/conftest.py
jaceksan/gooddata-python-sdk
640bd8b679e00a5f0eb627bdf6143de078f8b59b
[ "MIT" ]
7
2022-01-20T07:11:15.000Z
2022-03-09T14:50:17.000Z
# (C) 2021 GoodData Corporation import pytest from gooddata_pandas import DataFrameFactory, GoodPandas @pytest.fixture def gdf(test_config) -> DataFrameFactory: gdpd = GoodPandas(host=test_config["host"], token=test_config["token"]) return gdpd.data_frames(test_config["workspace"])
26.727273
75
0.77551
36
294
6.166667
0.611111
0.18018
0
0
0
0
0
0
0
0
0
0.015385
0.115646
294
10
76
29.4
0.838462
0.098639
0
0
0
0
0.068441
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
2ed54aa2ec5c5c0594b2ab3afbc4f1906ec019ab
1,140
py
Python
test/test_pycompile.py
lephe/lesscpy
b2bc597e7a66738f5af6f28bc616cacf7aaee693
[ "MIT" ]
95
2015-02-02T05:41:33.000Z
2021-12-08T08:06:53.000Z
test/test_pycompile.py
lephe/lesscpy
b2bc597e7a66738f5af6f28bc616cacf7aaee693
[ "MIT" ]
59
2015-01-02T19:01:25.000Z
2022-03-30T09:23:51.000Z
test/test_pycompile.py
lephe/lesscpy
b2bc597e7a66738f5af6f28bc616cacf7aaee693
[ "MIT" ]
41
2015-02-09T04:52:38.000Z
2021-07-13T16:07:11.000Z
""" Test the high-level compile function """ import unittest from six import StringIO from lesscpy import compile class TestCompileFunction(unittest.TestCase): """ Unit tests for compile """ def test_compile_from_stream(self): """ It can compile input from a file-like object """ output = compile(StringIO("a { border-width: 2px * 3; }"), minify=True) self.assertEqual(output, "a{border-width:6px;}") def test_compile_from_file(self): """ It can compile input from a file object """ import tempfile in_file = tempfile.NamedTemporaryFile(mode='w+') in_file.write("a { border-width: 2px * 3; }") in_file.seek(0) output = compile(in_file, minify=True) self.assertEqual(output, "a{border-width:6px;}") def test_raises_exception(self): """ Test if a syntax error raises an exception """ from lesscpy.exceptions import CompilationError def fail_func(): compile(StringIO("a }"), minify=True) self.assertRaises(CompilationError, fail_func)
24.255319
79
0.616667
134
1,140
5.141791
0.41791
0.040639
0.069666
0.05225
0.287373
0.240929
0.240929
0.240929
0.153846
0.153846
0
0.008444
0.272807
1,140
46
80
24.782609
0.822678
0.164035
0
0.105263
0
0
0.117442
0
0
0
0
0
0.157895
1
0.210526
false
0
0.263158
0
0.526316
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
2ef651ff245f3fd7e8f79cac149ec031efba2ffd
785
py
Python
dashboard/internet_nl_dashboard/apps.py
platforminternetstandaarden/dashboard-internet.nl
8b8129c67703a8ae51b441046ff5a90cf72bf537
[ "Apache-2.0" ]
5
2019-09-02T13:26:05.000Z
2021-07-19T19:30:14.000Z
dashboard/internet_nl_dashboard/apps.py
platforminternetstandaarden/dashboard-internet.nl
8b8129c67703a8ae51b441046ff5a90cf72bf537
[ "Apache-2.0" ]
247
2019-06-18T08:48:34.000Z
2022-03-17T10:58:18.000Z
dashboard/internet_nl_dashboard/apps.py
platforminternetstandaarden/dashboard-internet.nl
8b8129c67703a8ae51b441046ff5a90cf72bf537
[ "Apache-2.0" ]
7
2019-03-27T15:59:24.000Z
2021-11-15T22:24:56.000Z
# SPDX-License-Identifier: Apache-2.0 from django.apps import AppConfig class DashboardConfig(AppConfig): name = 'dashboard.internet_nl_dashboard' # See: https://django-activity-stream.readthedocs.io/en/latest/configuration.html def ready(self): # Loading actstream is not possible yet, as the apps aren't loaded. Django will crash. from actstream import registry # pylint: disable=import-outside-toplevel registry.register(self.get_model('UrlList')) registry.register(self.get_model('AccountInternetNLScan')) registry.register(self.get_model('UrlListReport')) registry.register(self.get_model('Account')) registry.register(self.get_model('DashboardUser')) registry.register(self.get_model('UploadLog'))
41.315789
94
0.727389
93
785
6.053763
0.612903
0.170515
0.213144
0.245115
0.298401
0
0
0
0
0
0
0.003035
0.16051
785
18
95
43.611111
0.85129
0.305732
0
0
0
0
0.187037
0.096296
0
0
0
0
0
1
0.090909
false
0
0.181818
0
0.454545
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2ef8aa4587b156504fb01555c635885e21d387fa
1,957
py
Python
algorithms/encoding/state_aggregation.py
lschw/rl-experiments
8b911b5d655288a60b12ffbacc123e3a3c78638c
[ "MIT" ]
null
null
null
algorithms/encoding/state_aggregation.py
lschw/rl-experiments
8b911b5d655288a60b12ffbacc123e3a3c78638c
[ "MIT" ]
null
null
null
algorithms/encoding/state_aggregation.py
lschw/rl-experiments
8b911b5d655288a60b12ffbacc123e3a3c78638c
[ "MIT" ]
null
null
null
import numpy as np class StateAggregation: """Combine multiple states into groups and provide linear feature vector for function approximation""" def __init__(self, N_states, group_size, N_actions=1): """ Args: N_states: Total number of states group_size: Combine this many states into group N_actions: Number of actions """ self.N_states = N_states self.N_actions = N_actions self.group_size = group_size self.size = int(self.N_states/self.group_size)*N_actions self.index = {} for s in range(self.N_states): for a in range(self.N_actions): self.index[(s,a)] = int(s/self.group_size) \ + a*int(self.N_states/self.group_size) def q(self, state, action, w): """Returns action-value function Args: state: State index action: Action index w: Weight vector """ return w[self.index[(state,action)]] def q_deriv(self, state, action, w): """Returns gradient of action-value function with respect to weights Args: state: State index action: Action index w: Weight vector """ feature_vector = np.zeros(self.size) feature_vector[self.index[(state,action)]] = 1 return feature_vector def v(self, state, w): """Returns state-value function Args: state: State index w: Weight vector """ return self.q(state, 0, w) def v_deriv(self, state, w): """Returns gradient of state-value function with respect to weights Args: state: State index w: Weight vector """ return self.q_deriv(state, 0, w) def generate_weights(self): """ Returns weight vector """ return np.zeros(self.size)
28.362319
76
0.56464
241
1,957
4.456432
0.236515
0.032588
0.05121
0.070764
0.35568
0.307263
0.283054
0.232775
0.232775
0.232775
0
0.003118
0.344405
1,957
68
77
28.779412
0.833983
0.35258
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.041667
0
0.541667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
2c0e708805de7c9c1a7ef586eb03c20212d975d4
95
py
Python
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_Loop_Through_the_Index_Numbers.txt.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
5
2021-06-02T23:44:25.000Z
2021-12-27T16:21:57.000Z
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_Loop_Through_the_Index_Numbers.txt.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
22
2021-05-31T01:33:25.000Z
2021-10-18T18:32:39.000Z
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/python_Loop_Through_the_Index_Numbers.txt.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
3
2021-06-19T03:37:47.000Z
2021-08-31T00:49:51.000Z
thislist = ["apple", "banana", "cherry"] for i in range(len(thislist)): print(thislist[i])
23.75
40
0.642105
13
95
4.692308
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.147368
95
3
41
31.666667
0.753086
0
0
0
0
0
0.178947
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
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2c1d7f20720c50be194afbae69016301919a4e16
890
py
Python
QRSMS/actor/migrations/0008_auto_20200529_1020.py
Srishti-Ahuja/QRSMS-V1
1f2fa82e8ddaeb62e633fcd6a136696355317bba
[ "Apache-2.0" ]
4
2020-06-16T09:42:20.000Z
2021-11-24T08:18:16.000Z
QRSMS/actor/migrations/0008_auto_20200529_1020.py
Srishti-Ahuja/QRSMS-V1
1f2fa82e8ddaeb62e633fcd6a136696355317bba
[ "Apache-2.0" ]
7
2021-04-08T21:57:34.000Z
2022-02-27T06:41:15.000Z
QRSMS/actor/migrations/0008_auto_20200529_1020.py
Srishti-Ahuja/QRSMS-V1
1f2fa82e8ddaeb62e633fcd6a136696355317bba
[ "Apache-2.0" ]
7
2020-11-29T09:45:44.000Z
2022-03-30T15:27:33.000Z
# Generated by Django 2.2 on 2020-05-29 05:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('actor', '0007_auto_20200415_0658'), ] operations = [ migrations.AlterField( model_name='user', name='emergency_contact', field=models.PositiveIntegerField(default=923293571854, null=True, verbose_name='Emergency Contact'), ), migrations.AlterField( model_name='user', name='mobile_contact', field=models.PositiveIntegerField(default=923293571855, null=True, verbose_name='Mobile Contact'), ), migrations.AlterField( model_name='user', name='nationality', field=models.CharField(default='Pakistani', max_length=100, null=True, verbose_name='Nationality'), ), ]
30.689655
113
0.623596
86
890
6.313953
0.511628
0.110497
0.138122
0.160221
0.395948
0.230203
0.162063
0
0
0
0
0.08689
0.262921
890
28
114
31.785714
0.740854
0.048315
0
0.409091
1
0
0.157396
0.027219
0
0
0
0
0
1
0
false
0
0.045455
0
0.181818
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2c211357a72dc2df1df2f79445e8b773ea04f77d
2,362
py
Python
src/replies.py
strangeman/python-telegram-bot
6450a4021ea6f570b29de6dd4a39f9fed6dcd511
[ "MIT" ]
2
2018-02-03T05:59:39.000Z
2020-11-09T19:58:15.000Z
src/replies.py
strangeman/python-telegram-bot
6450a4021ea6f570b29de6dd4a39f9fed6dcd511
[ "MIT" ]
null
null
null
src/replies.py
strangeman/python-telegram-bot
6450a4021ea6f570b29de6dd4a39f9fed6dcd511
[ "MIT" ]
null
null
null
import keyboards import logging from telegram.ext import ConversationHandler START, STAGE_1, STAGE_2_1, STAGE_2_2, STAGE_3_1, STAGE_3_2, STAGE_4 = range(7) def start(bot, update): logging.info('New user arrived! His update info: %s', update) if update.message.chat.type == 'private': update.message.reply_text("Hi dude! Let's test state machine! Here is the 'START' location.", reply_markup=keyboards.start_markup) else: update.message.reply_text( "Sorry, I work only in one-to-one conversations") return ConversationHandler.END return START def stage_1(bot, update): update.message.reply_text("Welcome to the Stage 1! Let's go futher. What variant you're choose?", reply_markup=keyboards.stage_1_markup) return STAGE_1 def stage_2_1(bot, update): update.message.reply_text("Stage 2.1? Nice choice! What's next?", reply_markup=keyboards.stage_2_1_markup) return STAGE_2_1 def stage_2_2(bot, update): update.message.reply_text("Stage 2.2? Not so bad. Let's go to the next stage!", reply_markup=keyboards.stage_2_2_markup) return STAGE_2_2 def stage_3_1(bot, update): update.message.reply_text("Oh. Stage 3.1 was wrong choice. Go back to the Stage 1", reply_markup=keyboards.stage_3_1_markup) return STAGE_3_1 def stage_3_2(bot, update): update.message.reply_text("Stage 3.2! You're made the right choice!", reply_markup=keyboards.stage_3_2_markup) return STAGE_3_2 def stage_3_3(bot, update): update.message.reply_text("Stage 3.3! Great! You're almost finished!", reply_markup=keyboards.stage_3_2_markup) return STAGE_3_2 def stage_4(bot, update): update.message.reply_text("Stage 4! Congratulations! Now you can restart the state. :)", reply_markup=keyboards.reset_markup) return STAGE_4 def reset(bot, update): update.message.reply_text("Okay, resetting the state machine.", reply_markup=keyboards.start_markup) return START def default_response(bot, update): update.message.reply_text( "What you need? I don't understand you. Try to reset the state.", reply_markup=keyboards.reset_markup) return STAGE_1 def done(bot, update): update.message.reply_text("Bye-bye. See you later!") return ConversationHandler.END
29.898734
101
0.713378
368
2,362
4.36413
0.255435
0.052304
0.134496
0.164384
0.446451
0.343711
0.285803
0.222914
0.129514
0.067248
0
0.031397
0.19094
2,362
79
102
29.898734
0.809001
0
0
0.296296
0
0
0.262802
0
0
0
0
0
0
1
0.203704
false
0
0.055556
0
0.481481
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
2c2c0776a9592d048b2a2656481cdaa527d11ec2
444
py
Python
api/views.py
julianarchila/music_controller
166936ff9b03fbf7dc0d27db923638ac284636bd
[ "MIT" ]
1
2021-08-07T08:03:52.000Z
2021-08-07T08:03:52.000Z
api/views.py
julianarchila/music_controller
166936ff9b03fbf7dc0d27db923638ac284636bd
[ "MIT" ]
null
null
null
api/views.py
julianarchila/music_controller
166936ff9b03fbf7dc0d27db923638ac284636bd
[ "MIT" ]
null
null
null
""" Api views. """ # Django REST Framework from rest_framework.viewsets import GenericViewSet from rest_framework import mixins # Serializers from api.serializers import RoomModelSerializer # Models from api.models import Room class RoomViewSet( mixins.CreateModelMixin, mixins.ListModelMixin, GenericViewSet): """ Room view set. """ serializer_class = RoomModelSerializer queryset = Room.objects.all()
21.142857
50
0.734234
45
444
7.177778
0.533333
0.120743
0.105263
0
0
0
0
0
0
0
0
0
0.191441
444
20
51
22.2
0.899721
0.155405
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
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
0
0
0
1
0
1
0
0
2
257eeb0edc3700e9311183e1160de5636d0e5ba4
1,361
py
Python
sdk/python/pulumi_azure_native/botservice/v20180712/_enums.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
31
2020-09-21T09:41:01.000Z
2021-02-26T13:21:59.000Z
sdk/python/pulumi_azure_native/botservice/v20180712/_enums.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
231
2020-09-21T09:38:45.000Z
2021-03-01T11:16:03.000Z
sdk/python/pulumi_azure_native/botservice/v20180712/_enums.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
4
2020-09-29T14:14:59.000Z
2021-02-10T20:38:16.000Z
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from enum import Enum __all__ = [ 'EnterpriseChannelNodeState', 'EnterpriseChannelState', 'Kind', 'SkuName', ] class EnterpriseChannelNodeState(str, Enum): """ The current state of the Enterprise Channel Node. """ CREATING = "Creating" CREATE_FAILED = "CreateFailed" STARTED = "Started" STARTING = "Starting" START_FAILED = "StartFailed" STOPPED = "Stopped" STOPPING = "Stopping" STOP_FAILED = "StopFailed" DELETING = "Deleting" DELETE_FAILED = "DeleteFailed" class EnterpriseChannelState(str, Enum): """ The current state of the Enterprise Channel. """ CREATING = "Creating" CREATE_FAILED = "CreateFailed" STARTED = "Started" STARTING = "Starting" START_FAILED = "StartFailed" STOPPED = "Stopped" STOPPING = "Stopping" STOP_FAILED = "StopFailed" DELETING = "Deleting" DELETE_FAILED = "DeleteFailed" class Kind(str, Enum): """ Required. Gets or sets the Kind of the resource. """ SDK = "sdk" DESIGNER = "designer" BOT = "bot" FUNCTION = "function" class SkuName(str, Enum): """ The sku name """ F0 = "F0" S1 = "S1"
21.603175
80
0.628949
140
1,361
6.028571
0.485714
0.033175
0.035545
0.040284
0.547393
0.547393
0.547393
0.547393
0.547393
0.443128
0
0.004931
0.25496
1,361
62
81
21.951613
0.827416
0.234386
0
0.540541
1
0
0.272727
0.04903
0
0
0
0
0
1
0
false
0
0.027027
0
0.837838
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
25883384fd26424e95fe9045f03e41d62c25c783
1,568
py
Python
alipay/aop/api/domain/HealthServiceSku.py
antopen/alipay-sdk-python-all
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
[ "Apache-2.0" ]
213
2018-08-27T16:49:32.000Z
2021-12-29T04:34:12.000Z
alipay/aop/api/domain/HealthServiceSku.py
antopen/alipay-sdk-python-all
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
[ "Apache-2.0" ]
29
2018-09-29T06:43:00.000Z
2021-09-02T03:27:32.000Z
alipay/aop/api/domain/HealthServiceSku.py
antopen/alipay-sdk-python-all
8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c
[ "Apache-2.0" ]
59
2018-08-27T16:59:26.000Z
2022-03-25T10:08:15.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class HealthServiceSku(object): def __init__(self): self._merchant_item_sku_bar_code = None self._sku_id = None @property def merchant_item_sku_bar_code(self): return self._merchant_item_sku_bar_code @merchant_item_sku_bar_code.setter def merchant_item_sku_bar_code(self, value): self._merchant_item_sku_bar_code = value @property def sku_id(self): return self._sku_id @sku_id.setter def sku_id(self, value): self._sku_id = value def to_alipay_dict(self): params = dict() if self.merchant_item_sku_bar_code: if hasattr(self.merchant_item_sku_bar_code, 'to_alipay_dict'): params['merchant_item_sku_bar_code'] = self.merchant_item_sku_bar_code.to_alipay_dict() else: params['merchant_item_sku_bar_code'] = self.merchant_item_sku_bar_code if self.sku_id: if hasattr(self.sku_id, 'to_alipay_dict'): params['sku_id'] = self.sku_id.to_alipay_dict() else: params['sku_id'] = self.sku_id return params @staticmethod def from_alipay_dict(d): if not d: return None o = HealthServiceSku() if 'merchant_item_sku_bar_code' in d: o.merchant_item_sku_bar_code = d['merchant_item_sku_bar_code'] if 'sku_id' in d: o.sku_id = d['sku_id'] return o
28
103
0.63648
219
1,568
4.114155
0.196347
0.199778
0.249723
0.299667
0.54939
0.467259
0.27303
0.175361
0.175361
0.119867
0
0.000881
0.276148
1,568
55
104
28.509091
0.792952
0.026786
0
0.097561
0
0
0.102497
0.068331
0
0
0
0
0
1
0.170732
false
0
0.04878
0.04878
0.365854
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
258a9a7715a0aa522994935925598051d48f9734
9,872
py
Python
generator/verify/test_bench.py
biarmic/OpenCache
bb9e110e434deb83900de328cc76b63901ba582f
[ "BSD-3-Clause" ]
5
2021-09-15T18:29:49.000Z
2022-03-26T04:41:01.000Z
generator/verify/test_bench.py
VLSIDA/OpenCache
0e79bf353c68d57dcc49d78178b12fd0b468f19a
[ "BSD-3-Clause" ]
null
null
null
generator/verify/test_bench.py
VLSIDA/OpenCache
0e79bf353c68d57dcc49d78178b12fd0b468f19a
[ "BSD-3-Clause" ]
null
null
null
# See LICENSE for licensing information. # # Copyright (c) 2021 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # class test_bench: """ Class to generate the test bench file for simulation. """ def __init__(self, cache_config, name): cache_config.set_local_config(self) self.name = name self.success_message = "Simulation successful." self.failure_message = "Simulation failed." def test_bench_write(self, tb_path): """ Write the test bench file. """ self.tbf = open(tb_path, "w") self.tbf.write("// Timescale is overwritten when running the EDA tool to prevent bugs\n") self.tbf.write("// `timescale 1ns / 1ps\n\n") self.tbf.write("module test_bench;\n\n") self.write_parameters() self.write_registers() self.write_dumps() self.write_clock_generator() self.write_reset_block() self.write_instances() self.write_tasks() self.tbf.write(" initial begin\n") self.tbf.write(" `include \"test_data.v\"\n") self.tbf.write(" end\n\n") self.tbf.write("endmodule\n") self.tbf.close() def write_parameters(self): """ Write the parameters of the test bench. """ self.tbf.write(" parameter TAG_WIDTH = {};\n".format(self.tag_size)) # TODO: Fully associative cache's set_size = 0. self.tbf.write(" parameter SET_WIDTH = {};\n".format(self.set_size)) self.tbf.write(" parameter OFFSET_WIDTH = {};\n\n".format(self.offset_size)) self.tbf.write(" parameter WORD_WIDTH = {};\n".format(self.word_size)) if self.num_masks: self.tbf.write(" parameter MASK_COUNT = {};\n".format(self.num_masks)) self.tbf.write(" parameter WORD_COUNT = {};\n".format(self.words_per_line)) self.tbf.write(" localparam LINE_WIDTH = WORD_WIDTH * WORD_COUNT;\n\n") self.tbf.write(" localparam ADDR_WIDTH = TAG_WIDTH + SET_WIDTH + OFFSET_WIDTH;\n\n") self.tbf.write(" parameter CLOCK_DELAY = 5;\n") self.tbf.write(" // Reset is asserted for 1.5 cycles\n") self.tbf.write(" parameter RESET_DELAY = 15;\n") self.tbf.write(" parameter DELAY = 3;\n") self.tbf.write(" parameter MAX_TEST_SIZE = 64;\n\n") def write_registers(self): """ Write the registers of the test bench. """ self.tbf.write(" reg clk;\n") self.tbf.write(" reg rst;\n\n") self.tbf.write(" // Cache input pins\n") self.tbf.write(" reg cache_flush;\n") self.tbf.write(" reg cache_csb;\n") self.tbf.write(" reg cache_web;\n") if self.num_masks: self.tbf.write(" reg [MASK_COUNT-1:0] cache_wmask;\n") self.tbf.write(" reg [ADDR_WIDTH-1:0] cache_addr;\n") self.tbf.write(" reg [WORD_WIDTH-1:0] cache_din;\n\n") self.tbf.write(" // Cache output pins\n") self.tbf.write(" wire [WORD_WIDTH-1:0] cache_dout;\n\n") self.tbf.write(" wire cache_stall;\n") self.tbf.write(" // DRAM input pins\n") self.tbf.write(" wire dram_csb;\n") self.tbf.write(" wire dram_web;\n") self.tbf.write(" wire [ADDR_WIDTH-OFFSET_WIDTH-1:0] dram_addr;\n") self.tbf.write(" wire [LINE_WIDTH-1:0] dram_din;\n\n") self.tbf.write(" // DRAM output pins\n") self.tbf.write(" wire [LINE_WIDTH-1:0] dram_dout;\n\n") self.tbf.write(" wire dram_stall;\n") self.tbf.write(" // Test registers\n") self.tbf.write(" reg [MAX_TEST_SIZE-1:0] error_count;\n\n") def write_dumps(self): """ Write the $dumpfile and $dumpvars system functions for waveforms. """ self.tbf.write(" initial begin\n") self.tbf.write(" $dumpfile(\"waves.vcd\");\n") self.tbf.write(" $dumpvars;\n") self.tbf.write(" end\n\n") def write_clock_generator(self): """ Write the clock generator of the test bench. """ self.tbf.write(" // Clock generator\n") self.tbf.write(" initial begin\n") self.tbf.write(" clk = 1;\n") self.tbf.write(" forever #(CLOCK_DELAY) clk = !clk;\n") self.tbf.write(" end\n\n") def write_reset_block(self): """ Write the reset block of the test bench. """ self.tbf.write(" // Reset registers\n") self.tbf.write(" initial begin\n") self.tbf.write(" rst = 0;\n") self.tbf.write(" cache_flush = 0;\n") self.tbf.write(" cache_csb = 1;\n") self.tbf.write(" cache_web = 1;\n") if self.num_masks: self.tbf.write(" cache_wmask = 0;\n") self.tbf.write(" error_count = 0;\n") self.tbf.write(" end\n\n") def write_instances(self): """ Write the module instances of the cache and DRAM. """ self.tbf.write(" {} cache_instance (\n".format(self.name)) self.tbf.write(" .clk (clk),\n") self.tbf.write(" .rst (rst),\n") self.tbf.write(" .flush (cache_flush),\n") self.tbf.write(" .csb (cache_csb),\n") self.tbf.write(" .web (cache_web),\n") if self.num_masks: self.tbf.write(" .wmask (cache_wmask),\n") self.tbf.write(" .addr (cache_addr),\n") self.tbf.write(" .din (cache_din),\n") self.tbf.write(" .dout (cache_dout),\n") self.tbf.write(" .stall (cache_stall),\n") self.tbf.write(" .main_csb (dram_csb),\n") self.tbf.write(" .main_web (dram_web),\n") self.tbf.write(" .main_addr (dram_addr),\n") self.tbf.write(" .main_din (dram_din),\n") self.tbf.write(" .main_dout (dram_dout),\n") self.tbf.write(" .main_stall (dram_stall)\n") self.tbf.write(" );\n\n") self.tbf.write(" dram dram_instance (\n") self.tbf.write(" .clk (clk),\n") self.tbf.write(" .rst (rst),\n") self.tbf.write(" .csb (dram_csb),\n") self.tbf.write(" .web (dram_web),\n") self.tbf.write(" .addr (dram_addr),\n") self.tbf.write(" .din (dram_din),\n") self.tbf.write(" .dout (dram_dout),\n") self.tbf.write(" .stall (dram_stall)\n") self.tbf.write(" );\n\n") def write_tasks(self): """ Write the tasks of the test bench. """ self.tbf.write(" // Assert the reset signal\n") self.tbf.write(" task assert_reset;\n") self.tbf.write(" begin\n") self.tbf.write(" // Reset is asserted just before a posedge of the clock.\n") self.tbf.write(" // Therefore, it is enough to assert it for DELAY.\n") self.tbf.write(" rst <= 1;\n") self.tbf.write(" rst <= #(DELAY) 0;\n") self.tbf.write(" end\n") self.tbf.write(" endtask\n\n") self.tbf.write(" // Assert the flush signal\n") self.tbf.write(" task assert_flush;\n") self.tbf.write(" begin\n") self.tbf.write(" // Flush is asserted just before a posedge of the clock.\n") self.tbf.write(" // Therefore, it is enough to assert it for DELAY.\n") self.tbf.write(" cache_flush <= 1;\n") self.tbf.write(" cache_flush <= #(DELAY) 0;\n") self.tbf.write(" end\n") self.tbf.write(" endtask\n\n") self.tbf.write(" // Check for a number of stall cycles starting from the current cycle\n") self.tbf.write(" task check_stall;\n") self.tbf.write(" input integer cycle_count;\n") self.tbf.write(" input [MAX_TEST_SIZE-1:0] test_count;\n") self.tbf.write(" integer i;\n") self.tbf.write(" begin\n") self.tbf.write(" for (i = 1; i <= cycle_count; i = i + 1) begin\n") self.tbf.write(" if (!cache_stall) begin\n") self.tbf.write(" $display(\"Error at test #%0d! Cache stall #%0d is expected to be high but it is low.\", test_count, i);\n") self.tbf.write(" error_count = error_count + 1;\n") self.tbf.write(" end\n") self.tbf.write(" #(CLOCK_DELAY * 2);\n") self.tbf.write(" end\n") self.tbf.write(" end\n") self.tbf.write(" endtask\n\n") self.tbf.write(" // Output of the cache must match the expected\n") self.tbf.write(" task check_dout;\n") self.tbf.write(" input [WORD_WIDTH-1:0] dout_expected;\n") self.tbf.write(" input [MAX_TEST_SIZE-1:0] test_count;\n") self.tbf.write(" begin\n") self.tbf.write(" if (cache_dout !== dout_expected) begin\n") self.tbf.write(" $display(\"Error at test #%0d! Expected: %d, Received: %d\", test_count, dout_expected, cache_dout);\n") self.tbf.write(" error_count = error_count + 1;\n") self.tbf.write(" end\n") self.tbf.write(" end\n") self.tbf.write(" endtask\n\n") self.tbf.write(" // Print simulation result\n") self.tbf.write(" task end_simulation;\n") self.tbf.write(" begin\n") self.tbf.write(" if (!error_count) begin\n") self.tbf.write(" $display(\"{}\");\n".format(self.success_message)) self.tbf.write(" end else begin\n") self.tbf.write(" $display(\"{} Error count: %0d\", error_count);\n".format(self.failure_message)) self.tbf.write(" end\n") self.tbf.write(" end\n") self.tbf.write(" endtask\n\n")
42.735931
142
0.559765
1,381
9,872
3.888487
0.125996
0.18771
0.317318
0.292924
0.643389
0.530168
0.401862
0.273929
0.268901
0.212477
0
0.007969
0.275425
9,872
231
143
42.735931
0.742765
0.071313
0
0.254438
0
0
0.425148
0.003188
0
0
0
0.004329
0.053254
1
0.053254
false
0
0
0
0.059172
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
258b8a997c868175ab85895f9af611275ec018fd
3,104
py
Python
services/lab-service/traffexam/kilda/traffexam/context.py
mikalstill/open-kilda
39a2e4fd94d96a0dfa5456d22acfbdd8f3d88b34
[ "Apache-2.0" ]
2
2019-01-03T17:19:25.000Z
2019-01-03T17:19:37.000Z
services/lab-service/traffexam/kilda/traffexam/context.py
gauravchug/open-kilda
a6ac3343a29f8934d2f872d8d50f9cc45584e273
[ "Apache-2.0" ]
2
2018-04-23T16:37:54.000Z
2018-04-23T18:35:54.000Z
services/lab-service/traffexam/kilda/traffexam/context.py
gauravchug/open-kilda
a6ac3343a29f8934d2f872d8d50f9cc45584e273
[ "Apache-2.0" ]
null
null
null
# Copyright 2017 Telstra Open Source # # 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 logging.config import os import pathlib from kilda.traffexam import const from kilda.traffexam import common from kilda.traffexam import exc class Context(object): is_debug = False root = os.path.join(os.sep, 'var', 'run', const.PROJECT_NAME) service = None _init_done = False def __init__(self, iface, rest_bind): self.iface = iface self.rest_bind = rest_bind self.children = common.ProcMonitor() self.shared_registry = common.Registry() self._acquired_resources = [] self.set_root(self.root) self.set_debug_mode(self.is_debug) self._init_done = True def close(self): for resource in self._acquired_resources: resource.release() def path(self, *chunks): return self.root.joinpath(*chunks) def acquire_resources(self, *resources): for allocator in resources: self._acquired_resources.insert(0, allocator(self)) def make_lock_file_name(self): name = '{}-{}.lock'.format(self.iface.name, self.iface.index) return str(self.path(name)) def make_network_namespace_name(self): return '{}{}.{}'.format( const.IF_PREFIX, self.iface.name, self.iface.index) def make_bridge_name(self): return '{}gw.{}'.format(const.IF_PREFIX, self.iface.index) def make_veth_base_name(self): return '{}nsgw.{}'.format(const.IF_PREFIX, self.iface.index) def set_root(self, root): self.root = pathlib.Path(root) if not self._init_done: self.root.mkdir(parents=True, exist_ok=True) return self def set_default_logging(self): stderr = logging.StreamHandler() stderr.setFormatter('%(asctime)s %(levelname)s %(name)s - %(message)s') log = logging.getLogger() log.addHandler(stderr) log.setLevel(logging.INFO) return self def set_logging_config(self, config, incremental=False): try: logging.config.fileConfig( config, disable_existing_loggers=not incremental) except (IOError, OSError) as e: raise exc.InvalidLoggingConfigError(config, e) return self def set_debug_mode(self, mode): self.is_debug = mode return self def set_service_adapter(self, adapter): self.service = adapter return self class ContextConsumer(object): def __init__(self, context): self.context = context
29.561905
79
0.661082
397
3,104
5.02267
0.400504
0.036108
0.028084
0.032096
0.097292
0.072718
0.036108
0.036108
0
0
0
0.003822
0.241302
3,104
104
80
29.846154
0.842887
0.184923
0
0.075758
0
0
0.034592
0
0
0
0
0
0
1
0.212121
false
0
0.090909
0.060606
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
258e42e7eaee50e0f3297163b1bc1ff86e826d38
234
py
Python
apps/django_auth_system/models.py
ipodjke/django_authorization_system
bc7b2429bf5aafdb3b0b1668aa2ab6edb5e51678
[ "MIT" ]
null
null
null
apps/django_auth_system/models.py
ipodjke/django_authorization_system
bc7b2429bf5aafdb3b0b1668aa2ab6edb5e51678
[ "MIT" ]
null
null
null
apps/django_auth_system/models.py
ipodjke/django_authorization_system
bc7b2429bf5aafdb3b0b1668aa2ab6edb5e51678
[ "MIT" ]
null
null
null
# from django.utils.translation import gettext_lazy as _ from django_auth_system.model_creator import UserModelCreator user = UserModelCreator().create_model() class User(user): class Meta(user.Meta): abstract = False
21.272727
61
0.764957
29
234
5.965517
0.655172
0.115607
0
0
0
0
0
0
0
0
0
0
0.15812
234
10
62
23.4
0.878173
0.230769
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
25b199791ad83ea88ddca8d670066de679bcf785
357
py
Python
packages/Chandra.cmd_states/test_unit.py
sot/ska_testr
dd84b89d0b5ebf6158c6cda4c1df432138044e20
[ "MIT" ]
null
null
null
packages/Chandra.cmd_states/test_unit.py
sot/ska_testr
dd84b89d0b5ebf6158c6cda4c1df432138044e20
[ "MIT" ]
27
2016-10-19T19:39:46.000Z
2022-03-04T14:56:40.000Z
packages/Chandra.cmd_states/test_unit.py
sot/ska_testr
dd84b89d0b5ebf6158c6cda4c1df432138044e20
[ "MIT" ]
null
null
null
import testr import warnings # Importing Chandra.cmd_states triggers a FutureWarning from the deprecated # Ska.ParseCM being imported. Chandra.cmd_states is itself deprecated, so # just hide that particular warning in testing. with warnings.catch_warnings(): warnings.simplefilter('ignore', FutureWarning) import Ska.ParseCM # noqa testr.testr()
29.75
75
0.792717
46
357
6.086957
0.695652
0.071429
0.114286
0
0
0
0
0
0
0
0
0
0.140056
357
11
76
32.454545
0.912052
0.54902
0
0
0
0
0.038462
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
25d604bae7e3fb476e395a12f6ccc4fe7278f062
259
py
Python
videodownloader/urls.py
muditmehrotra/download
e965d3f4c7dc71af0ba0768031abcf4227010ba3
[ "MIT" ]
null
null
null
videodownloader/urls.py
muditmehrotra/download
e965d3f4c7dc71af0ba0768031abcf4227010ba3
[ "MIT" ]
null
null
null
videodownloader/urls.py
muditmehrotra/download
e965d3f4c7dc71af0ba0768031abcf4227010ba3
[ "MIT" ]
null
null
null
from django.conf.urls import url from django.conf.urls.static import static from . import views app_name = "videodownloader" urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^downloadfile/$', views.downloadfile, name='downloadfile'), ]
21.583333
69
0.710425
33
259
5.545455
0.454545
0.10929
0.153005
0.196721
0
0
0
0
0
0
0
0
0.138996
259
11
70
23.545455
0.820628
0
0
0
0
0
0.189189
0
0
0
0
0
0
1
0
false
0
0.375
0
0.375
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
d3031fda1215425f3d09ca469cbf2e954f9ef409
238
py
Python
typeidea/mytest/models.py
abnormalmakers/typeidea
9348e85414ac06ed67fe7238d8060c29e3d59d12
[ "MIT" ]
null
null
null
typeidea/mytest/models.py
abnormalmakers/typeidea
9348e85414ac06ed67fe7238d8060c29e3d59d12
[ "MIT" ]
2
2020-06-05T20:36:07.000Z
2021-06-10T21:24:42.000Z
typeidea/mytest/models.py
abnormalmakers/typeidea
9348e85414ac06ed67fe7238d8060c29e3d59d12
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class ManyA(models.Model): name=models.CharField(max_length=10) class ManyB(models.Model): name=models.CharField(max_length=10) manya = models.ManyToManyField(ManyA)
19.833333
41
0.752101
33
238
5.363636
0.545455
0.124294
0.169492
0.237288
0.463277
0.463277
0.463277
0.463277
0
0
0
0.019608
0.142857
238
12
41
19.833333
0.848039
0.10084
0
0.333333
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
d30a1d8ba70329345819c097407523d90ce01f3e
497
py
Python
abuseipdb/setup.py
xhennessy-r7/insightconnect-plugins
59268051313d67735b5dd3a30222eccb92aca8e9
[ "MIT" ]
null
null
null
abuseipdb/setup.py
xhennessy-r7/insightconnect-plugins
59268051313d67735b5dd3a30222eccb92aca8e9
[ "MIT" ]
null
null
null
abuseipdb/setup.py
xhennessy-r7/insightconnect-plugins
59268051313d67735b5dd3a30222eccb92aca8e9
[ "MIT" ]
null
null
null
# GENERATED BY KOMAND SDK - DO NOT EDIT from setuptools import setup, find_packages setup(name='abuseipdb-rapid7-plugin', version='3.0.1', description='AbuseIPDB is a free service which allows you to look up IP reports, or report an abusive IP', author='rapid7', author_email='', url='', packages=find_packages(), install_requires=['komand'], # Add third-party dependencies to requirements.txt, not here! scripts=['bin/komand_abuseipdb'] )
33.133333
112
0.676056
65
497
5.092308
0.8
0.072508
0
0
0
0
0
0
0
0
0
0.012788
0.21328
497
14
113
35.5
0.83376
0.195171
0
0
1
0
0.380353
0.057935
0
0
0
0
0
1
0
true
0
0.090909
0
0.090909
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
d30f42b119818dbae272434fbbf38b9705f51331
1,953
py
Python
end_product/vector.py
ashwinjv/objModel
66f69140ab8549e367ea85c7899c87024a001003
[ "Apache-2.0" ]
null
null
null
end_product/vector.py
ashwinjv/objModel
66f69140ab8549e367ea85c7899c87024a001003
[ "Apache-2.0" ]
null
null
null
end_product/vector.py
ashwinjv/objModel
66f69140ab8549e367ea85c7899c87024a001003
[ "Apache-2.0" ]
null
null
null
import numbers import math class Vector: def __init__(self, components): self.components = tuple(components) @property def u(self): return self.components[0] @property def v(self): return self.components[1] @property def angle(self): return math.atan2(self.v, self.u) def __len__(self): return len(self.components) def __str__(self): return str(self.components) def __repr__(self): return '{} object: {}'.format(self.__class__.__name__, self) def __iter__(self): return iter(self.components) # def __eq__(self, other): # if len(self) != len(other): # return False # for i, j in zip(self, other): # if i != j: # return False # return True def __eq__(self, other): return len(self) == len(other) and \ all(i == j for i, j in zip(self, other)) def __add__(self, other): if len(self) != len(other): raise NotImplemented return Vector([i + j for i, j in zip(self, other)]) def __sub__(self, other): if len(self) != len(other): raise NotImplemented return Vector([i - j for i, j in zip(self, other)]) def __mul__(self, number): if not isinstance(number, numbers.Real): raise NotImplemented return Vector([number * i for i in self]) def __rmul__(self, number): return self * number def __abs__(self): return math.sqrt(sum(i * i for i in self)) # def __getitem__(self, index): # return self.components[index] def __getitem__(self, key): if isinstance(key, str): return getattr(self, key) if isinstance(key, slice): return self.components[key] if isinstance(key, numbers.Integral): return self.components[key] raise NotImplemented
25.038462
68
0.56938
240
1,953
4.366667
0.233333
0.133588
0.09542
0.057252
0.289122
0.247137
0.22042
0.177481
0.177481
0.177481
0
0.002261
0.320533
1,953
77
69
25.363636
0.787491
0.120328
0
0.22449
0
0
0.007611
0
0
0
0
0
0
1
0.306122
false
0
0.040816
0.204082
0.693878
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
d31a18a7472acc31b0d65243823070eb203b996a
711
py
Python
sample/config.py
rednoid/LCD-Content-Formatter
3ee66a21284ec94da1b843040158127591dd6dd6
[ "MIT" ]
4
2021-03-05T21:33:30.000Z
2022-01-18T22:09:19.000Z
sample/config.py
rednoid/LCD-Content-Formatter
3ee66a21284ec94da1b843040158127591dd6dd6
[ "MIT" ]
null
null
null
sample/config.py
rednoid/LCD-Content-Formatter
3ee66a21284ec94da1b843040158127591dd6dd6
[ "MIT" ]
null
null
null
################################################################################## #### Runtime configuration ################################################################################## sampleCounter = 0 ################################################################################## #### General configuration ################################################################################## version = "1.0.2103.0401" ################################################################################## #### LCD configuration ################################################################################## lcdI2cExpanderType = "PCF8574" lcdI2cAddress = 0x27 lcdColumnCount = 20 lcdRowCount = 4
35.55
82
0.220816
21
711
7.47619
0.857143
0
0
0
0
0
0
0
0
0
0
0.034125
0.052039
711
19
83
37.421053
0.198813
0.085795
0
0
0
0
0.137931
0
0
0
0.027586
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
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d3363fe7e245a9b78012333fa2f5337768214903
260
py
Python
private_rest_api/private_rest_api/data_APIs/twitter_api/urls.py
MatthewTe/ETL_project_monorepo
48b3ccfb1ec31e55556908d3b01c83d54bc5725d
[ "MIT" ]
null
null
null
private_rest_api/private_rest_api/data_APIs/twitter_api/urls.py
MatthewTe/ETL_project_monorepo
48b3ccfb1ec31e55556908d3b01c83d54bc5725d
[ "MIT" ]
null
null
null
private_rest_api/private_rest_api/data_APIs/twitter_api/urls.py
MatthewTe/ETL_project_monorepo
48b3ccfb1ec31e55556908d3b01c83d54bc5725d
[ "MIT" ]
null
null
null
# Importing native django methods: from django.contrib import admin from django.urls import path, include # Importing views: from .views import trending_twitter_topics urlpatterns = [ path(r"trending/", trending_twitter_topics, name="Trending Topics") ]
26
72
0.784615
33
260
6.060606
0.545455
0.1
0.21
0
0
0
0
0
0
0
0
0
0.134615
260
10
73
26
0.888889
0.188462
0
0
0
0
0.114833
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
d338878339cfa47affbeea9e32ca16c098f2fe16
248
py
Python
test/test_trace.py
chellvs/PyPCAPKit
f8d66f9955904196b71a6143e49ff4ec4c4922dc
[ "BSD-3-Clause" ]
131
2018-10-12T09:45:44.000Z
2022-03-31T18:58:14.000Z
test/test_trace.py
chellvs/PyPCAPKit
f8d66f9955904196b71a6143e49ff4ec4c4922dc
[ "BSD-3-Clause" ]
39
2018-08-18T12:15:04.000Z
2022-03-07T20:28:08.000Z
test/test_trace.py
chellvs/PyPCAPKit
f8d66f9955904196b71a6143e49ff4ec4c4922dc
[ "BSD-3-Clause" ]
23
2018-10-12T09:45:52.000Z
2022-03-05T15:23:00.000Z
# -*- coding: utf-8 -*- import pprint import pcapkit trace = pcapkit.extract(fin='../sample/http.pcap', nofile=True, verbose=True, trace=True, trace_format='json', trace_fout='../sample/trace') pprint.pprint(trace.trace)
24.8
86
0.645161
31
248
5.096774
0.580645
0.113924
0
0
0
0
0
0
0
0
0
0.004926
0.181452
248
9
87
27.555556
0.773399
0.084677
0
0
0
0
0.168889
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0.4
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
d33894a4501070900671eeb621fe4bb35fc4fac3
1,137
py
Python
list_entries.py
dpnetca/keepass_test
c8f9955c25b169b811ac71df25310fbf977c8cfd
[ "MIT" ]
1
2020-01-20T01:14:12.000Z
2020-01-20T01:14:12.000Z
list_entries.py
dpnetca/keepass_test
c8f9955c25b169b811ac71df25310fbf977c8cfd
[ "MIT" ]
null
null
null
list_entries.py
dpnetca/keepass_test
c8f9955c25b169b811ac71df25310fbf977c8cfd
[ "MIT" ]
null
null
null
from pykeepass import PyKeePass kp4_pass = "pass" kp4 = PyKeePass("keepass_v4_test.kdbx", password=kp4_pass) kp3_pass = "pass" kp3 = PyKeePass("keepass_v4_test.kdbx", password=kp3_pass) kp = kp4 divider = "#" * 50 print("list all groups:") print(kp.groups) print(divider) print("for each group, list all entries:") for group in kp.groups: print(group, " entries:") print(group.entries) print() print(divider) print("for each entry in each group, list entry details:") for group in kp.groups: print(group, " entries:") for entry in group.entries: print(entry, " details:") print(" TITLE: ", entry.title) print(" USERNAME: ", entry.username) print(" PASSWORD: ", entry.password) print(" URL: ", entry.url) print(" NOTES: ", entry.notes) print(" LAST MODIFIED: ", entry.mtime) # print(" TAGS: ", entry.tags) # not availalbe for test with KeePasXC print(" CUSTOM PROPERTIES:") for prop_key, prop_value in entry.custom_properties.items(): print(" " + prop_key + ": " + prop_value) print() print(divider)
28.425
79
0.629727
144
1,137
4.881944
0.298611
0.062589
0.055477
0.062589
0.26458
0.196302
0.099573
0.099573
0
0
0
0.0126
0.23219
1,137
39
80
29.153846
0.792669
0.059807
0
0.28125
0
0
0.249531
0
0
0
0
0
0
1
0
false
0.1875
0.03125
0
0.03125
0.65625
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
1
0
2
d33b5e98195341980471c29314e3111ad9f0d310
221
py
Python
bluebrain/repo-patches/packages/py-pip/package.py
BlueBrain/Spack
dc328512c70e182f3c24bb0ce64fa3586482bdf1
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
bluebrain/repo-patches/packages/py-pip/package.py
BlueBrain/Spack
dc328512c70e182f3c24bb0ce64fa3586482bdf1
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
4
2022-03-01T02:26:40.000Z
2022-03-15T02:33:38.000Z
bluebrain/repo-patches/packages/py-pip/package.py
BlueBrain/Spack
dc328512c70e182f3c24bb0ce64fa3586482bdf1
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
null
null
null
from spack.pkg.builtin.py_pip import PyPip as BuiltinPyPip class PyPip(BuiltinPyPip): __doc__ = BuiltinPyPip.__doc__ def setup_run_environment(self, env): env.prepend_path('PATH', self.spec.prefix.bin)
24.555556
58
0.746606
30
221
5.1
0.766667
0.196078
0
0
0
0
0
0
0
0
0
0
0.158371
221
8
59
27.625
0.822581
0
0
0
0
0
0.0181
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
d3493c1089a3035bfb7a08df7f3997b8bfe01783
575
py
Python
EDyA_I/theme_2/code/diccionario/crearDiccionario.py
jrg-sln/academy
498c11dcfeab78dbbbb77045a13d7d6675c0d150
[ "MIT" ]
null
null
null
EDyA_I/theme_2/code/diccionario/crearDiccionario.py
jrg-sln/academy
498c11dcfeab78dbbbb77045a13d7d6675c0d150
[ "MIT" ]
null
null
null
EDyA_I/theme_2/code/diccionario/crearDiccionario.py
jrg-sln/academy
498c11dcfeab78dbbbb77045a13d7d6675c0d150
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- def crearCombinaciones(abecedario): for d1 in abecedario: for d2 in abecedario: for d3 in abecedario: for d4 in abecedario: #print(d1 + '' + d2 + '' + d3 + '' + d4) f.write(d1 + '' + d2 + '' + d3 + '' + d4) f.write('\n') abecedario = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] f = open("dico.txt", "w") crearCombinaciones(abecedario) f.close()
28.75
78
0.393043
72
575
3.138889
0.611111
0.230089
0.199115
0.070796
0.123894
0.123894
0
0
0
0
0
0.034946
0.353043
575
19
79
30.263158
0.572581
0.104348
0
0
0
0
0.072266
0
0
0
0
0
0
1
0.083333
false
0
0
0
0.083333
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d3535511c651eef4ee2050bf88b829db895687bf
584
py
Python
src/extra_tools/classes_distribution.py
jorgeuliana1/road-generator
0cf2f95ce93362283238d07c9d14da0e13741936
[ "MIT" ]
null
null
null
src/extra_tools/classes_distribution.py
jorgeuliana1/road-generator
0cf2f95ce93362283238d07c9d14da0e13741936
[ "MIT" ]
null
null
null
src/extra_tools/classes_distribution.py
jorgeuliana1/road-generator
0cf2f95ce93362283238d07c9d14da0e13741936
[ "MIT" ]
null
null
null
import sys def main(): annotation_path = sys.argv[1] with open(annotation_path, "r") as annotation_file: csv_lines = annotation_file.read().strip().split("\n") categories_occurrences = {} for csv_line in csv_lines: csv_info = csv_line.split(",") _, _, _, _, _, category = csv_info if category not in categories_occurrences.keys(): categories_occurrences[category] = 1 else: categories_occurrences[category] += 1 print(categories_occurrences) if __name__ == "__main__": main()
23.36
62
0.618151
64
584
5.203125
0.5
0.315315
0.174174
0.18018
0
0
0
0
0
0
0
0.007059
0.27226
584
24
63
24.333333
0.776471
0
0
0
0
0
0.020548
0
0
0
0
0
0
1
0.0625
false
0
0.0625
0
0.125
0.0625
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d3557830b9b88ed7c8759b0939cd68169ead7a5a
808
py
Python
telemetry/telescope_devkit/cli.py
hmrc/telescope-devkit
86bcc7ef808ea42bc29f56bc48b4c5f1f0cb2b73
[ "Apache-2.0" ]
1
2022-01-18T09:47:30.000Z
2022-01-18T09:47:30.000Z
telemetry/telescope_devkit/cli.py
hmrc/telescope-devkit
86bcc7ef808ea42bc29f56bc48b4c5f1f0cb2b73
[ "Apache-2.0" ]
3
2021-11-18T13:59:06.000Z
2022-03-31T15:59:55.000Z
telemetry/telescope_devkit/cli.py
hmrc/telescope-devkit
86bcc7ef808ea42bc29f56bc48b4c5f1f0cb2b73
[ "Apache-2.0" ]
1
2021-04-10T23:28:45.000Z
2021-04-10T23:28:45.000Z
import fire from rich.console import Console from rich.markdown import Markdown def get_full_class_name(obj: object) -> str: module = obj.__class__.__module__ if module is None or module == str.__class__.__module__: return obj.__class__.__name__ return module + "." + obj.__class__.__name__ def display(lines: [], out) -> None: text = "\n".join(lines) + "\n" out.write(text) def cli(target, name): fire.core.Display = display return fire.Fire(target, name=name) def get_console(): console = Console() return console def print_exception(e: Exception) -> None: get_console().print(f"[red]ERROR: {e} ({get_full_class_name(e)})[/red]") def print_markdown(content): console = Console() markdown = Markdown(content) console.print(markdown)
21.263158
76
0.680693
107
808
4.747664
0.345794
0.070866
0.047244
0.062992
0
0
0
0
0
0
0
0
0.189356
808
37
77
21.837838
0.775573
0
0
0.086957
0
0
0.065594
0.039604
0
0
0
0
0
1
0.26087
false
0
0.130435
0
0.565217
0.173913
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
d3565e4ec9994e1278ae9a87af4a45773c3f495e
79
py
Python
configs/semantic_segmentation/common/optims/ep30.py
voldemortX/DeeplabV3_PyTorch1.3_Codebase
d22d23e74800fafb58eeb61d6649008745c1a287
[ "BSD-3-Clause" ]
1
2020-09-17T06:21:39.000Z
2020-09-17T06:21:39.000Z
configs/semantic_segmentation/common/optims/ep30.py
voldemortX/pytorch-segmentation
9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda
[ "BSD-3-Clause" ]
null
null
null
configs/semantic_segmentation/common/optims/ep30.py
voldemortX/pytorch-segmentation
9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda
[ "BSD-3-Clause" ]
null
null
null
lr_scheduler = dict( name='poly_scheduler', epochs=30, power=0.9 )
13.166667
26
0.620253
11
79
4.272727
0.909091
0
0
0
0
0
0
0
0
0
0
0.066667
0.240506
79
5
27
15.8
0.716667
0
0
0
0
0
0.177215
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d35a3aa300462a8c811ede001e68242ff7e0181a
1,462
py
Python
Protheus_WebApp/Modules/SIGAGFE/GFEA030TESTCASE.py
98llm/tir-script-samples
0bff8393b79356aa562e9e6512c11ee6e039b177
[ "MIT" ]
17
2018-09-24T17:27:08.000Z
2021-09-16T19:09:46.000Z
Protheus_WebApp/Modules/SIGAGFE/GFEA030TESTCASE.py
98llm/tir-script-samples
0bff8393b79356aa562e9e6512c11ee6e039b177
[ "MIT" ]
4
2018-09-24T17:30:32.000Z
2022-01-03T11:39:30.000Z
Protheus_WebApp/Modules/SIGAGFE/GFEA030TESTCASE.py
98llm/tir-script-samples
0bff8393b79356aa562e9e6512c11ee6e039b177
[ "MIT" ]
18
2019-06-07T17:41:34.000Z
2022-01-31T18:17:31.000Z
from tir import Webapp import unittest class GFEA030(unittest.TestCase): @classmethod def setUpClass(inst): inst.oHelper = Webapp() inst.oHelper.Setup('SIGAGFE','05/12/2020','T1','D MG 01 ','78') inst.oHelper.Program('GFEA030') def test_GFEA030_CT001(self): self.oHelper.SetButton('Incluir') self.oHelper.SetValue('Tipo ', '900001') self.oHelper.SetValue('Descricao ', 'TIPO OCORRENCIA TESTE AUTOMACAO') self.oHelper.SetValue('Evento ', '3') self.oHelper.SetButton('Confirmar') self.oHelper.SetButton('Fechar') self.oHelper.SearchBrowse(' 900001') self.oHelper.SetButton('Alterar') self.oHelper.SetValue('Descricao ', 'TIPO OCORR ALTERADO TESTE AUTOMACAO') self.oHelper.ClickGridCell('Motivo', 1) self.oHelper.SetValue('Motivo', '000001', grid=True) self.oHelper.LoadGrid() self.oHelper.SetButton('Confirmar') self.oHelper.SetButton('Fechar') self.oHelper.SearchBrowse(' 900001') self.oHelper.SetButton('Visualizar') self.oHelper.SetButton('Fechar') self.oHelper.SearchBrowse(' 900001') self.oHelper.SetButton('Outras Ações','Copiar') self.oHelper.SetValue('Tipo ', '900002') self.oHelper.SetValue('Descricao ', 'TIPO OCORR 2 TESTE AUTOMACAO') self.oHelper.SetButton('Confirmar') self.oHelper.SetButton('Fechar') self.oHelper.AssertTrue() @classmethod def tearDownClass(inst): inst.oHelper.TearDown() if __name__ == '__main__': unittest.main()
29.836735
78
0.708618
167
1,462
6.143713
0.377246
0.25731
0.214425
0.101365
0.44347
0.412281
0.340156
0.340156
0.340156
0.340156
0
0.050794
0.138167
1,462
48
79
30.458333
0.763492
0
0
0.315789
0
0
0.257358
0
0
0
0
0
0.026316
1
0.078947
false
0
0.052632
0
0.157895
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d38fa127bb8f555b22356dfa1a5f068eda4acba6
116
py
Python
python_programs/epdb.py
bristy/codemania
ceaacce07cb1b66202e17ad313a3467bd591bdc1
[ "MIT" ]
null
null
null
python_programs/epdb.py
bristy/codemania
ceaacce07cb1b66202e17ad313a3467bd591bdc1
[ "MIT" ]
null
null
null
python_programs/epdb.py
bristy/codemania
ceaacce07cb1b66202e17ad313a3467bd591bdc1
[ "MIT" ]
null
null
null
# experiment with python import pdb a = "aaa" pdb.set_trace() b = "bbb" c = "ccc" final = a + b + c print final
8.923077
24
0.612069
20
116
3.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.25
116
12
25
9.666667
0.804598
0.189655
0
0
0
0
0.097826
0
0
0
0
0
0
0
null
null
0
0.142857
null
null
0.142857
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
d392e3417cdf07d5297e02c5af9dea3cb112808b
270
py
Python
main.py
washingtonSampaioVieira/spreadsheet-migrator
e773dc3abc501dc84c11cf740e2de27abfb9491f
[ "Apache-2.0" ]
null
null
null
main.py
washingtonSampaioVieira/spreadsheet-migrator
e773dc3abc501dc84c11cf740e2de27abfb9491f
[ "Apache-2.0" ]
null
null
null
main.py
washingtonSampaioVieira/spreadsheet-migrator
e773dc3abc501dc84c11cf740e2de27abfb9491f
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*001- from resources.Help import init_parabrisa import time try: while True: init_parabrisa() print("\n----------------------------------\n") time.sleep(86400000) except KeyboardInterrupt: print('Stoping observer')
20.769231
55
0.566667
28
270
5.392857
0.785714
0.172185
0
0
0
0
0
0
0
0
0
0.055814
0.203704
270
12
56
22.5
0.646512
0.088889
0
0
0
0
0.221311
0.155738
0
0
0
0
0
1
0
true
0
0.222222
0
0.222222
0.222222
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
d39b692ccbea7601c42af95350c3dbf56bdc3a48
350
py
Python
programming/general/LoanCalculatorUsingClosures.py
vamsitallapudi/Coderefer-Python-Projects
a7acc682251661e296c64533f4a85d47e6eedda2
[ "Apache-2.0" ]
1
2021-01-03T06:42:58.000Z
2021-01-03T06:42:58.000Z
programming/general/LoanCalculatorUsingClosures.py
vamsitallapudi/Coderefer-Python-Projects
a7acc682251661e296c64533f4a85d47e6eedda2
[ "Apache-2.0" ]
null
null
null
programming/general/LoanCalculatorUsingClosures.py
vamsitallapudi/Coderefer-Python-Projects
a7acc682251661e296c64533f4a85d47e6eedda2
[ "Apache-2.0" ]
null
null
null
def interest(n, principle_amount): def years(x): return principle_amount + (n * principle_amount * x) / 100 return years principle = 100000 home_loan = interest(7, principle) # percentage of 7 personal_loan = interest(11, principle) # percentage of 11 print(home_loan(20)) # for 20 years print(personal_loan(3)) # for 3 years
25
66
0.702857
50
350
4.78
0.42
0.188285
0.133891
0
0
0
0
0
0
0
0
0.075
0.2
350
13
67
26.923077
0.778571
0.162857
0
0
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0
0.111111
0.444444
0.222222
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
d3a4bb7c4b53d789b181e269b6708d51d0cc6ecd
200
py
Python
python/char/chr2.py
jtraver/dev
c7cd2181594510a8fa27e7325566ed2d79371624
[ "MIT" ]
null
null
null
python/char/chr2.py
jtraver/dev
c7cd2181594510a8fa27e7325566ed2d79371624
[ "MIT" ]
null
null
null
python/char/chr2.py
jtraver/dev
c7cd2181594510a8fa27e7325566ed2d79371624
[ "MIT" ]
null
null
null
#!/usr/bin/python for i1 in xrange(256): str2 = "%s %d 0x%x '%c'" % (str(i1), i1, i1, i1) print "str2 = %s" % str2 #for i1 in range(32, 127): # c1 = chr(i1) # print "%d %s" % (i1, c1)
20
52
0.49
37
200
2.648649
0.567568
0.122449
0.142857
0
0
0
0
0
0
0
0
0.150685
0.27
200
9
53
22.222222
0.520548
0.425
0
0
0
0
0.216216
0
0
0
0
0
0
0
null
null
0
0
null
null
0.333333
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
d3a9b479124a840fdb8a50a14507940efcf42c2f
419
py
Python
tests/poly.py
ciscorn/micropython-ulab
404342aa54f088894836993c0955a18db85ba56d
[ "MIT" ]
null
null
null
tests/poly.py
ciscorn/micropython-ulab
404342aa54f088894836993c0955a18db85ba56d
[ "MIT" ]
null
null
null
tests/poly.py
ciscorn/micropython-ulab
404342aa54f088894836993c0955a18db85ba56d
[ "MIT" ]
null
null
null
import ulab as np # polynom evaluation x = np.linspace(0, 10, num=9) p = [1, 2, 3] y = np.polyval(p, x) print(y) # linear fit x = np.linspace(-5, 5, num=11) y = x + np.sin(x) p = np.polyfit(x, y, 1) print(p) # quadratic fit x = np.linspace(-5, 5, num=11) y = x*x + np.sin(x)*3.0 p = np.polyfit(x, y, 2) print(p) # cubic fit x = np.linspace(-5, 5, num=11) y = x*x*x + np.sin(x)*10.0 p = np.polyfit(x, y, 3) print(p)
16.115385
30
0.579952
97
419
2.505155
0.278351
0.08642
0.18107
0.17284
0.502058
0.399177
0.292181
0.292181
0.292181
0.292181
0
0.080357
0.198091
419
25
31
16.76
0.642857
0.126492
0
0.352941
0
0
0
0
0
0
0
0
0
1
0
false
0
0.058824
0
0.058824
0.235294
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
6c8f224775db3412793a0b456662b300f8ae1611
430
py
Python
pages/admin.py
nnscr/nnscr.de
e03948f1daa1ce16739da1924cae6db2d399d09d
[ "MIT" ]
null
null
null
pages/admin.py
nnscr/nnscr.de
e03948f1daa1ce16739da1924cae6db2d399d09d
[ "MIT" ]
null
null
null
pages/admin.py
nnscr/nnscr.de
e03948f1daa1ce16739da1924cae6db2d399d09d
[ "MIT" ]
null
null
null
from django.contrib import admin from django import forms from . import models from nnmarkdown.form import MarkdownWidget from nnscr.admin import site class PageAdminForm(forms.ModelForm): class Meta: model = models.Page exclude = ("slug",) widgets = { "text": MarkdownWidget } class PageAdmin(admin.ModelAdmin): form = PageAdminForm site.register(models.Page, PageAdmin)
19.545455
42
0.688372
47
430
6.297872
0.531915
0.067568
0
0
0
0
0
0
0
0
0
0
0.234884
430
21
43
20.47619
0.899696
0
0
0
0
0
0.018605
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
6ca5378783ce75c2b7d7fd19e73ccbbb875301e9
80
py
Python
tests/watson/framework/i18n/locales/fallback.py
watsonpy/watson-framework
ffe157cb3fe24366ee55869d4260cce778012b4a
[ "BSD-3-Clause" ]
68
2015-01-06T19:15:07.000Z
2021-02-05T13:43:42.000Z
tests/watson/framework/i18n/locales/fallback.py
watsonpy/watson-framework
ffe157cb3fe24366ee55869d4260cce778012b4a
[ "BSD-3-Clause" ]
13
2015-02-14T12:08:28.000Z
2021-03-29T20:44:50.000Z
tests/watson/framework/i18n/locales/fallback.py
watsonpy/watson-framework
ffe157cb3fe24366ee55869d4260cce778012b4a
[ "BSD-3-Clause" ]
8
2015-07-22T23:40:34.000Z
2021-07-29T06:15:34.000Z
# -*- coding: utf-8 -*- strings = { 'test.fallback': 'A fallback string' }
13.333333
40
0.55
9
80
4.888889
0.888889
0
0
0
0
0
0
0
0
0
0
0.016129
0.225
80
5
41
16
0.693548
0.2625
0
0
0
0
0.526316
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
6caaf65b029fc39d8d1281ea3f6aebbd18e1427e
8,842
py
Python
rest_framework/tests/test_permissions.py
0x64746b/django-rest-framework
8d83ff8e6c8513d0a88d6b1fecb34ed86f1e2085
[ "Unlicense" ]
2
2015-11-30T20:54:02.000Z
2022-03-01T14:12:16.000Z
rest_framework/tests/test_permissions.py
0x64746b/django-rest-framework
8d83ff8e6c8513d0a88d6b1fecb34ed86f1e2085
[ "Unlicense" ]
null
null
null
rest_framework/tests/test_permissions.py
0x64746b/django-rest-framework
8d83ff8e6c8513d0a88d6b1fecb34ed86f1e2085
[ "Unlicense" ]
null
null
null
from __future__ import unicode_literals from django.contrib.auth.models import User, Permission from django.db import models from django.test import TestCase from rest_framework import generics, status, permissions, authentication, HTTP_HEADER_ENCODING from rest_framework.tests.utils import RequestFactory import base64 import json factory = RequestFactory() class BasicModel(models.Model): text = models.CharField(max_length=100) class RootView(generics.ListCreateAPIView): model = BasicModel authentication_classes = [authentication.BasicAuthentication] permission_classes = [permissions.DjangoModelPermissions] class InstanceView(generics.RetrieveUpdateDestroyAPIView): model = BasicModel authentication_classes = [authentication.BasicAuthentication] permission_classes = [permissions.DjangoModelPermissions] root_view = RootView.as_view() instance_view = InstanceView.as_view() def basic_auth_header(username, password): credentials = ('%s:%s' % (username, password)) base64_credentials = base64.b64encode(credentials.encode(HTTP_HEADER_ENCODING)).decode(HTTP_HEADER_ENCODING) return 'Basic %s' % base64_credentials class ModelPermissionsIntegrationTests(TestCase): def setUp(self): User.objects.create_user('disallowed', 'disallowed@example.com', 'password') user = User.objects.create_user('permitted', 'permitted@example.com', 'password') user.user_permissions = [ Permission.objects.get(codename='add_basicmodel'), Permission.objects.get(codename='change_basicmodel'), Permission.objects.get(codename='delete_basicmodel') ] user = User.objects.create_user('updateonly', 'updateonly@example.com', 'password') user.user_permissions = [ Permission.objects.get(codename='change_basicmodel'), ] self.permitted_credentials = basic_auth_header('permitted', 'password') self.disallowed_credentials = basic_auth_header('disallowed', 'password') self.updateonly_credentials = basic_auth_header('updateonly', 'password') BasicModel(text='foo').save() def test_has_create_permissions(self): request = factory.post('/', json.dumps({'text': 'foobar'}), content_type='application/json', HTTP_AUTHORIZATION=self.permitted_credentials) response = root_view(request, pk=1) self.assertEqual(response.status_code, status.HTTP_201_CREATED) def test_has_put_permissions(self): request = factory.put('/1', json.dumps({'text': 'foobar'}), content_type='application/json', HTTP_AUTHORIZATION=self.permitted_credentials) response = instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) def test_has_delete_permissions(self): request = factory.delete('/1', HTTP_AUTHORIZATION=self.permitted_credentials) response = instance_view(request, pk=1) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) def test_does_not_have_create_permissions(self): request = factory.post('/', json.dumps({'text': 'foobar'}), content_type='application/json', HTTP_AUTHORIZATION=self.disallowed_credentials) response = root_view(request, pk=1) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) def test_does_not_have_put_permissions(self): request = factory.put('/1', json.dumps({'text': 'foobar'}), content_type='application/json', HTTP_AUTHORIZATION=self.disallowed_credentials) response = instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) def test_does_not_have_delete_permissions(self): request = factory.delete('/1', HTTP_AUTHORIZATION=self.disallowed_credentials) response = instance_view(request, pk=1) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) def test_has_put_as_create_permissions(self): # User only has update permissions - should be able to update an entity. request = factory.put('/1', json.dumps({'text': 'foobar'}), content_type='application/json', HTTP_AUTHORIZATION=self.updateonly_credentials) response = instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) # But if PUTing to a new entity, permission should be denied. request = factory.put('/2', json.dumps({'text': 'foobar'}), content_type='application/json', HTTP_AUTHORIZATION=self.updateonly_credentials) response = instance_view(request, pk='2') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) def test_options_permitted(self): request = factory.options('/', content_type='application/json', HTTP_AUTHORIZATION=self.permitted_credentials) response = root_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertIn('actions', response.data) self.assertEqual(list(response.data['actions'].keys()), ['POST']) request = factory.options('/1', content_type='application/json', HTTP_AUTHORIZATION=self.permitted_credentials) response = instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertIn('actions', response.data) self.assertEqual(list(response.data['actions'].keys()), ['PUT']) def test_options_disallowed(self): request = factory.options('/', content_type='application/json', HTTP_AUTHORIZATION=self.disallowed_credentials) response = root_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertNotIn('actions', response.data) request = factory.options('/1', content_type='application/json', HTTP_AUTHORIZATION=self.disallowed_credentials) response = instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertNotIn('actions', response.data) def test_options_updateonly(self): request = factory.options('/', content_type='application/json', HTTP_AUTHORIZATION=self.updateonly_credentials) response = root_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertNotIn('actions', response.data) request = factory.options('/1', content_type='application/json', HTTP_AUTHORIZATION=self.updateonly_credentials) response = instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertIn('actions', response.data) self.assertEqual(list(response.data['actions'].keys()), ['PUT']) class OwnerModel(models.Model): text = models.CharField(max_length=100) owner = models.ForeignKey(User) class IsOwnerPermission(permissions.BasePermission): def has_object_permission(self, request, view, obj): return request.user == obj.owner class OwnerInstanceView(generics.RetrieveUpdateDestroyAPIView): model = OwnerModel authentication_classes = [authentication.BasicAuthentication] permission_classes = [IsOwnerPermission] owner_instance_view = OwnerInstanceView.as_view() class ObjectPermissionsIntegrationTests(TestCase): """ Integration tests for the object level permissions API. """ def setUp(self): User.objects.create_user('not_owner', 'not_owner@example.com', 'password') user = User.objects.create_user('owner', 'owner@example.com', 'password') self.not_owner_credentials = basic_auth_header('not_owner', 'password') self.owner_credentials = basic_auth_header('owner', 'password') OwnerModel(text='foo', owner=user).save() def test_owner_has_delete_permissions(self): request = factory.delete('/1', HTTP_AUTHORIZATION=self.owner_credentials) response = owner_instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) def test_non_owner_does_not_have_delete_permissions(self): request = factory.delete('/1', HTTP_AUTHORIZATION=self.not_owner_credentials) response = owner_instance_view(request, pk='1') self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
45.112245
112
0.686157
941
8,842
6.210414
0.146653
0.048768
0.057495
0.079398
0.704997
0.681725
0.659309
0.648015
0.618925
0.618925
0
0.01297
0.206514
8,842
195
113
45.34359
0.819983
0.021149
0
0.557823
0
0
0.083005
0.009956
0
0
0
0
0.170068
1
0.108844
false
0.081633
0.054422
0.006803
0.312925
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
6cbe43e6981d9ef8338119c9b02e93cf51e4d907
1,054
py
Python
src/autogroceries/utils/pause.py
dzhang32/autogroceries
c705ab5918fd9ceaed56326aa7bfdbc4057d007c
[ "MIT" ]
null
null
null
src/autogroceries/utils/pause.py
dzhang32/autogroceries
c705ab5918fd9ceaed56326aa7bfdbc4057d007c
[ "MIT" ]
null
null
null
src/autogroceries/utils/pause.py
dzhang32/autogroceries
c705ab5918fd9ceaed56326aa7bfdbc4057d007c
[ "MIT" ]
null
null
null
import functools import time import random def pause(_func=None, *, delay=1, rand=1): """Decorator that pauses for a random-ish interval before executing function Used to delay the execution of functions that use Selenium by random-ish intervals to 1. seem more human-like and 2. avoid being blocked a website for too many requests within a set time frame. Parameters ---------- _func : function, default None Function to be wrapped by decorator. delay : float, default 1 Fixed duration in seconds to pause before function call. rand : float, default 1 Random time interval to add to fixed delay, generated using random.uniform(0, rand). """ def decorator_pause(func): @functools.wraps(func) def wrapper_pause(*args, **kwargs): time.sleep(delay + random.uniform(0, rand)) return func(*args, **kwargs) return wrapper_pause if _func is None: return decorator_pause else: return decorator_pause(_func)
29.277778
80
0.66129
141
1,054
4.879433
0.503546
0.039244
0.037791
0.052326
0
0
0
0
0
0
0
0.010323
0.264706
1,054
35
81
30.114286
0.877419
0.537002
0
0
0
0
0
0
0
0
0
0
0
1
0.214286
false
0
0.214286
0
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
6cd1a100f27b0b08f3d8bf1a561bd5402b3e217b
575
py
Python
Python/Sorting & Searching/shell_sort.py
codervikash/algorithms
6985dfb00d353e550eec6a15b3a1fd68b4103587
[ "MIT" ]
2
2022-02-03T03:18:10.000Z
2022-03-18T02:39:23.000Z
Python/Sorting & Searching/shell_sort.py
codervikash/algorithms
6985dfb00d353e550eec6a15b3a1fd68b4103587
[ "MIT" ]
null
null
null
Python/Sorting & Searching/shell_sort.py
codervikash/algorithms
6985dfb00d353e550eec6a15b3a1fd68b4103587
[ "MIT" ]
null
null
null
""" ShellSort is mainly a variation of Insertion Sort. In insertion sort, we move elements only one position ahead. When an element has to be moved far ahead, many movements are involved. The idea of shellSort is to allow exchange of far items. In shellSort, we make the array h-sorted for a large value of h. We keep reducing the value of h until it becomes 1. An array is said to be h-sorted if all sublists of every h’th element is sorted. Time complexity: Best : O(n) Average : O((nlog(n))^2) Worst : O((nlog(n))^2) Space complexity: O(1) """
41.071429
254
0.707826
104
575
3.913462
0.596154
0.054054
0.039312
0.034398
0
0
0
0
0
0
0
0.008909
0.21913
575
13
255
44.230769
0.89755
0.982609
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
6ce42419504860806876c055d1f568f3b8b323c1
886
py
Python
python/test.py
seckcoder/lang-learn
1e0d6f412bbd7f89b1af00293fd907ddb3c1b571
[ "Unlicense" ]
1
2017-10-14T04:23:45.000Z
2017-10-14T04:23:45.000Z
python/test.py
seckcoder/lang-learn
1e0d6f412bbd7f89b1af00293fd907ddb3c1b571
[ "Unlicense" ]
null
null
null
python/test.py
seckcoder/lang-learn
1e0d6f412bbd7f89b1af00293fd907ddb3c1b571
[ "Unlicense" ]
null
null
null
total = 0 c_total = 0 h_total = 0 l_total = 0 y_total = 0 s_total = 0 with open("data/ikea.txt", "r") as fin: for l in fin: l = l.strip() if l: count, ty = l.split(' ') count = float(count) total += count if ty == "c": c_total += count elif ty == "h": h_total += count elif ty == "y": y_total += count elif ty == "l": l_total += count elif ty == "s": s_total += count else: print "error" def withtax(c): return c*1.09 Meta = { "c":c_total, "h":h_total, "l":l_total, "y":y_total, "s":s_total } withtax_total = 0 for ty, cnt in Meta.iteritems(): print ty, cnt, withtax(cnt) withtax_total += withtax(cnt) print withtax_total
18.458333
39
0.44921
120
886
3.166667
0.291667
0.110526
0.147368
0.168421
0
0
0
0
0
0
0
0.019569
0.423251
886
47
40
18.851064
0.72407
0
0
0
0
0
0.034014
0
0
0
0
0
0
0
null
null
0
0
null
null
0.076923
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
6ce49b96319f4e1c00e2fa8dce4a1dc2f36da4ca
428
py
Python
sendemail/forms.py
SmartDataWithR/CovidHelper
21f8c3f3d81da0b5ec32b228c711e96f9d5c168e
[ "MIT" ]
null
null
null
sendemail/forms.py
SmartDataWithR/CovidHelper
21f8c3f3d81da0b5ec32b228c711e96f9d5c168e
[ "MIT" ]
9
2020-03-27T10:33:35.000Z
2022-03-12T00:20:47.000Z
sendemail/forms.py
SmartDataWithR/CovidHelper
21f8c3f3d81da0b5ec32b228c711e96f9d5c168e
[ "MIT" ]
null
null
null
from django import forms class ContactForm(forms.Form): from_email = forms.EmailField( widget=forms.TextInput(attrs={'placeholder': 'Your Email'}), required=True) subject = forms.CharField( widget=forms.TextInput(attrs={'placeholder': 'What can we do for you?'}), required=True) message = forms.CharField(widget=forms.Textarea( attrs={'placeholder': 'Your message to us.'}), required=True)
38.909091
96
0.693925
51
428
5.803922
0.54902
0.111486
0.135135
0.168919
0.243243
0
0
0
0
0
0
0
0.165888
428
10
97
42.8
0.829132
0
0
0
0
0
0.198598
0
0
0
0
0
0
1
0
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
0
0
0
0
0
1
0
0
2
9f1389660382e68a632f2cc93cb8a70a249b0bbb
2,590
py
Python
WordFreqCount.py
survivalcrziest/WordFreqCount
965e10ecda6131511e15ee281531303729cae9a0
[ "MIT" ]
null
null
null
WordFreqCount.py
survivalcrziest/WordFreqCount
965e10ecda6131511e15ee281531303729cae9a0
[ "MIT" ]
null
null
null
WordFreqCount.py
survivalcrziest/WordFreqCount
965e10ecda6131511e15ee281531303729cae9a0
[ "MIT" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- # TODO: add search phrases # import urllib from bs4 import BeautifulSoup from collections import Counter import os import re maxAnalysisCount = 150 maxOutputCount = 100 outFileName = "CraftConfWordFreqTrend.csv" commonWordsFileName = "CommonWords.csv" def readList(input, separator=''): retList = list() with open(input, 'rb') as inputFile: for line in inputFile: outline = line.strip() if outline != "" and not outline.startswith("#"): if separator == '': retList.append(outline) else: for item in outline.split(separator): item = item.strip() if item != "": retList.append(item) return retList def writeHeader(outFileName): try: os.remove(outFileName) except OSError: pass with open(outFileName, "a") as outfile: outfile.write("{0}, {1}, {2}\n".format("Year", "Keyword", "Frequency")) def parsePage(url, outFileName, prefix): print "Processing URL: {0}, Result: {1}, Prefix: {2}".format(url, outFileName, prefix) opener = urllib.urlopen(url) page = opener.read() opener.close() soup = BeautifulSoup(page, "html.parser", from_encoding="UTF-8") content = soup.find_all("li", "speakers-item") text = "" for entry in content: text += entry.get_text(" ", True) words = [word.lower() for word in text.split()] c = Counter(words) for key in commonWords: if key in c: del c[key] mostCommon = list() for word, count in c.most_common(maxAnalysisCount): if not re.search('[–{@#!;+=_,$<(^)>?.:%/&}''"''-]', word): if not (re.search(u'\u2014', word) or re.search(u'\u2013', word)): if not re.search('[0-9]', word): if word: mostCommon.append((word, count)) else: print("Skipping: <empty>") else: print("Skipping number: {0}".decode('ascii', 'ignore').format(word)) else: print("Skipping unicode character: {0}".decode('ascii', 'ignore').format(word)) else: print("Skipping special character: {0}".decode('ascii', 'ignore').format(word)) with open(outFileName, "a") as outfile: for word, count in mostCommon[:maxOutputCount]: outfile.write("{0}, {1}, {2}\n".format(prefix, word, count)) print "Done" # main commonWords = readList(commonWordsFileName, ',') writeHeader(outFileName) parsePage("https://web.archive.org/web/20160325231108/http://craft-conf.com/2016", outFileName, "year2016") parsePage("https://web.archive.org/web/20160406212403/http://craft-conf.com/2015", outFileName, "year2015") parsePage("https://web.archive.org/web/20160324192950/http://craft-conf.com/2014", outFileName, "year2014")
30.116279
107
0.669498
331
2,590
5.226586
0.416918
0.020809
0.039306
0.022543
0.209249
0.189595
0.104046
0.052023
0.052023
0
0
0.044232
0.153282
2,590
85
108
30.470588
0.744186
0.026641
0
0.101449
0
0.043478
0.232697
0.019889
0
0
0
0.011765
0
0
null
null
0.014493
0.072464
null
null
0.086957
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
1
0
0
0
0
0
0
0
0
2
9f1edb0ff4d8a3395711e93a0ab4e2b526ec79d9
387
py
Python
wscelery/tests/__init__.py
lowercase00/wscelery
ab0a64b81dde4c058dc169e981d37c840beb720b
[ "MIT" ]
85
2017-05-08T13:55:44.000Z
2021-08-09T09:27:18.000Z
wscelery/tests/__init__.py
lowercase00/wscelery
ab0a64b81dde4c058dc169e981d37c840beb720b
[ "MIT" ]
5
2017-05-16T15:26:19.000Z
2020-07-22T12:16:18.000Z
wscelery/tests/__init__.py
lowercase00/wscelery
ab0a64b81dde4c058dc169e981d37c840beb720b
[ "MIT" ]
7
2017-05-19T03:51:32.000Z
2022-03-17T17:25:04.000Z
import celery import tornado.testing from tornado.options import options from wscelery.app import WsCelery from wscelery.options import default_options class AsyncHTTPTestCase(tornado.testing.AsyncHTTPTestCase): """Default HTTP test case for WSCelery.""" def get_app(self): capp = celery.Celery() return WsCelery(capp=capp, options=options or default_options)
27.642857
70
0.770026
48
387
6.145833
0.4375
0.094915
0
0
0
0
0
0
0
0
0
0
0.157623
387
13
71
29.769231
0.904908
0.093023
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
false
0
0.555556
0
0.888889
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
9f1f34d2106ee0c602e58b11dca6a1ab79117f7a
69
py
Python
biolopy/__init__.py
heavywatal/biolopy
ae5440ab3136ee18adb1687a24f2906311075cc4
[ "MIT" ]
null
null
null
biolopy/__init__.py
heavywatal/biolopy
ae5440ab3136ee18adb1687a24f2906311075cc4
[ "MIT" ]
null
null
null
biolopy/__init__.py
heavywatal/biolopy
ae5440ab3136ee18adb1687a24f2906311075cc4
[ "MIT" ]
null
null
null
"""miscellaneous python scripts for biology""" __version__ = "0.1.0"
23
46
0.724638
9
69
5.111111
0.888889
0
0
0
0
0
0
0
0
0
0
0.04918
0.115942
69
2
47
34.5
0.704918
0.57971
0
0
0
0
0.217391
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9f2877a6914e25ddb84887984ecfa85542a53075
408
py
Python
logpy/__init__.py
mrocklin/logpy
7e32f4da10a0ab5b86fb23947cfce9a4d49c6b3f
[ "BSD-3-Clause" ]
1
2016-09-20T16:05:12.000Z
2016-09-20T16:05:12.000Z
logpy/__init__.py
mrocklin/logpy
7e32f4da10a0ab5b86fb23947cfce9a4d49c6b3f
[ "BSD-3-Clause" ]
null
null
null
logpy/__init__.py
mrocklin/logpy
7e32f4da10a0ab5b86fb23947cfce9a4d49c6b3f
[ "BSD-3-Clause" ]
null
null
null
""" LogPy is a Python library for logic and relational programming. """ from .core import run, eq, conde, membero from .variable import var, isvar, variables, Var from .goals import seteq, permuteq, goalify from .facts import Relation, fact, facts from .unification import unify, reify from .unifymore import unifiable from .term import arguments, operator, term, unifiable_with_term __version__ = '0.2.0'
29.142857
64
0.77451
58
408
5.344828
0.689655
0
0
0
0
0
0
0
0
0
0
0.008596
0.144608
408
13
65
31.384615
0.879656
0.154412
0
0
0
0
0.014837
0
0
0
0
0
0
1
0
false
0
0.875
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
9f2b1c8a16b57f782481292df6a78f118441f9fb
76
py
Python
Louplus_Python_Code_week1_lesson1/calculation.py
sjylawyer/shiyanlou
cf1cb35a361de67b4ca3d9ac95446642e14a947b
[ "MIT" ]
null
null
null
Louplus_Python_Code_week1_lesson1/calculation.py
sjylawyer/shiyanlou
cf1cb35a361de67b4ca3d9ac95446642e14a947b
[ "MIT" ]
null
null
null
Louplus_Python_Code_week1_lesson1/calculation.py
sjylawyer/shiyanlou
cf1cb35a361de67b4ca3d9ac95446642e14a947b
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 sum=0 a=1 while a<=100: sum +=a a+=1 print(sum)
8.444444
22
0.592105
17
76
2.647059
0.647059
0.088889
0
0
0
0
0
0
0
0
0
0.114754
0.197368
76
8
23
9.5
0.622951
0.276316
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
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
0
0
0
0
0
0
0
0
0
2
9f2cb7e5f4f67ce73dd1222284f6c28b3086ee1b
622
py
Python
tests/test_processor.py
DarkSand/fetchman
21647c3579d7255ada43b0d62b999973d24aec95
[ "Apache-2.0" ]
77
2017-11-01T07:09:31.000Z
2021-12-07T23:50:27.000Z
tests/test_processor.py
DarkSand/fetchman
21647c3579d7255ada43b0d62b999973d24aec95
[ "Apache-2.0" ]
7
2018-02-06T09:44:48.000Z
2021-03-31T23:42:54.000Z
tests/test_processor.py
DarkSand/fetchman
21647c3579d7255ada43b0d62b999973d24aec95
[ "Apache-2.0" ]
25
2017-11-07T03:17:34.000Z
2021-07-12T02:41:37.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest2 as unittest from fetchman.processor.test_processor import Tuliu_Processor from fetchman.spider.spider_core import SpiderCore from fetchman.pipeline.console_pipeline import ConsolePipeline from fetchman.pipeline.test_pipeline import TestPipeline class TestProcessor(unittest.TestCase): def test_car_processor(self): test_pipeline = TestPipeline() SpiderCore(Tuliu_Processor(),test=True).set_pipeline(ConsolePipeline(),'console')\ .set_pipeline(test_pipeline,'test').start() self.assertIn('2018',"2018-01-07 09:40:39")
38.875
90
0.762058
76
622
6.078947
0.513158
0.103896
0.08658
0
0
0
0
0
0
0
0
0.0369
0.128617
622
15
91
41.466667
0.815498
0.067524
0
0
0
0
0.058824
0
0
0
0
0
0.090909
1
0.090909
false
0
0.454545
0
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
0
0
0
1
0
1
0
0
2
9f2ded417df30dfa0f568da3ad5d35ab2cbca7aa
142
py
Python
Python/zip-bomb/get_filesize.py
MartinThoma/algorithms
4347a9b7bf54ef378d16d26ef9e357ddc710664b
[ "MIT" ]
209
2015-01-02T03:47:12.000Z
2022-03-06T16:54:47.000Z
Python/zip-bomb/get_filesize.py
Kerwin-Xie/algorithms
4347a9b7bf54ef378d16d26ef9e357ddc710664b
[ "MIT" ]
3
2015-12-06T14:40:34.000Z
2021-03-22T17:40:24.000Z
Python/zip-bomb/get_filesize.py
Kerwin-Xie/algorithms
4347a9b7bf54ef378d16d26ef9e357ddc710664b
[ "MIT" ]
114
2015-01-31T08:37:10.000Z
2022-02-23T04:42:28.000Z
import zipfile zp = zipfile.ZipFile("example.zip") size = sum([zinfo.file_size for zinfo in zp.filelist]) zip_kb = float(size) / 1000 # kB
20.285714
54
0.711268
23
142
4.304348
0.652174
0
0
0
0
0
0
0
0
0
0
0.033333
0.15493
142
6
55
23.666667
0.791667
0.014085
0
0
0
0
0.07971
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9f3bb0089bf69863ed7840ca5e55c54687bd4344
235
py
Python
polybar-scripts/news-archlinux/news-archlinux.py
alexshoo/polybar-scripts
ecfbaa45400d6184f73dd447313925f92c74828c
[ "Unlicense" ]
null
null
null
polybar-scripts/news-archlinux/news-archlinux.py
alexshoo/polybar-scripts
ecfbaa45400d6184f73dd447313925f92c74828c
[ "Unlicense" ]
null
null
null
polybar-scripts/news-archlinux/news-archlinux.py
alexshoo/polybar-scripts
ecfbaa45400d6184f73dd447313925f92c74828c
[ "Unlicense" ]
null
null
null
#!/usr/bin/python import feedparser from subprocess import call import re import textwrap d = feedparser.parse("https://www.archlinux.org/feeds/news/") for f in range(0, 1): print(d.entries[f].title) xy = d.entries[f].title
18.076923
61
0.710638
38
235
4.394737
0.736842
0.095808
0.107784
0.167665
0
0
0
0
0
0
0
0.00995
0.144681
235
12
62
19.583333
0.820896
0.068085
0
0
0
0
0.169725
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0.125
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
9f48b4c499ad4ff4b972721902976083e9d99600
1,524
py
Python
netconf/nc_rpc/rpc.py
sathishms77/test
bf8df6fc16c41720c7d99ed1ff17a64b543e9672
[ "Apache-2.0" ]
72
2017-01-18T02:36:34.000Z
2022-02-12T15:28:30.000Z
netconf/nc_rpc/rpc.py
sathishms77/test
bf8df6fc16c41720c7d99ed1ff17a64b543e9672
[ "Apache-2.0" ]
11
2017-03-03T17:56:09.000Z
2022-02-11T03:38:03.000Z
netconf/nc_rpc/rpc.py
sathishms77/test
bf8df6fc16c41720c7d99ed1ff17a64b543e9672
[ "Apache-2.0" ]
120
2017-02-02T23:26:11.000Z
2022-03-13T05:30:23.000Z
#!/usr/bin/env python # # Copyright 2017 the original author or authors. # # Code adapted from https://github.com/choppsv1/netconf # # 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 rpc_response import RpcResponse from lxml import etree import io class Rpc(object): def __init__(self, request_dict, request_xml, grpc_client, session, capabilities): self.request = request_dict self.request_xml = request_xml self.rpc_response = RpcResponse(capabilities) self.grpc_client = grpc_client self.session = session self.capabilities = capabilities def execute(self): """ run the command - returns a OperationResponse """ pass def set_rpc_response(self): self.rpc_response = RpcResponse() def _validate_parameters(self, rpc_request): """Sets and validates the node as well""" pass def get_root_element(self, xml_msg): tree = etree.parse(io.BytesIO(xml_msg)) return tree.getroot()
31.102041
74
0.7021
205
1,524
5.102439
0.570732
0.057361
0.024857
0.030593
0
0
0
0
0
0
0
0.007569
0.219816
1,524
48
75
31.75
0.872161
0.477034
0
0.095238
0
0
0
0
0
0
0
0
0
1
0.238095
false
0.095238
0.142857
0
0.47619
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
9f4f8c1d20bc0dad6de77f765d945465bf30b3c9
64
py
Python
gameanalysis/__init__.py
calebho/gameanalysis
280726a8aa125850b827a1e10b1203e91f515461
[ "Apache-2.0" ]
null
null
null
gameanalysis/__init__.py
calebho/gameanalysis
280726a8aa125850b827a1e10b1203e91f515461
[ "Apache-2.0" ]
null
null
null
gameanalysis/__init__.py
calebho/gameanalysis
280726a8aa125850b827a1e10b1203e91f515461
[ "Apache-2.0" ]
null
null
null
"""Module for performing game analysis""" __version__ = '8.0.3'
21.333333
41
0.703125
9
64
4.555556
1
0
0
0
0
0
0
0
0
0
0
0.053571
0.125
64
2
42
32
0.678571
0.546875
0
0
0
0
0.217391
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9f5556e5751bd5cdaaf66fc4de4bc0bb69723eb9
534
py
Python
example/blsgov.py
anshul96go/toolbox
f60ba0b885eb0eb4786f6e56260073f923a7f844
[ "MIT" ]
null
null
null
example/blsgov.py
anshul96go/toolbox
f60ba0b885eb0eb4786f6e56260073f923a7f844
[ "MIT" ]
null
null
null
example/blsgov.py
anshul96go/toolbox
f60ba0b885eb0eb4786f6e56260073f923a7f844
[ "MIT" ]
null
null
null
import qnt.data.common as qndc import qnt.data.id_translation as idt idt.USE_ID_TRANSLATION = False qndc.BASE_URL = 'http://127.0.0.1:7070/' import qnt.data as qndata import time import datetime as dt dbs = qndata.load_blsgov_db_list() print(dbs) db_meta = qndata.load_blsgov_db_meta('CX') print(db_meta) for s in qndata.load_blsgov_series_list('CX'): print(s) ds = qndata.load_blsgov_series_data('CXUWOMENSLB1407M', min_date='1900-01-01') print(ds) ds = qndata.load_blsgov_series_aspect('CXUWOMENSLB1407M') print(ds)
17.8
78
0.765918
91
534
4.252747
0.450549
0.129199
0.206718
0.170543
0.124031
0
0
0
0
0
0
0.055085
0.116105
534
29
79
18.413793
0.764831
0
0
0.117647
0
0
0.12782
0
0
0
0
0
0
1
0
false
0
0.294118
0
0.294118
0.294118
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9f568ee79d3ada473caf8c14db108097799b1afd
2,527
py
Python
web/models.py
william42/voronoi-board-game
f359fc37fc3a728c998b2431f79d3ef8556d9a20
[ "Apache-2.0" ]
1
2020-09-02T21:37:29.000Z
2020-09-02T21:37:29.000Z
web/models.py
william42/voronoi-board-game
f359fc37fc3a728c998b2431f79d3ef8556d9a20
[ "Apache-2.0" ]
null
null
null
web/models.py
william42/voronoi-board-game
f359fc37fc3a728c998b2431f79d3ef8556d9a20
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Google LLC # # 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 sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, MetaData from sqlalchemy.orm import relationship from sqlalchemy.sql import func # for Alembic meta = MetaData(naming_convention={ "ix": "ix_%(column_0_label)s", "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", "pk": "pk_%(table_name)s" }) Base = declarative_base(metadata=meta) class Board(Base): __tablename__ = 'boards' board_id=Column(Integer, primary_key=True) board_name=Column(String) board_json=Column(String) class Game(Base): __tablename__ = 'games' game_id=Column(Integer, primary_key=True) game_name=Column(String) board_id=Column(Integer, ForeignKey('boards.board_id')) game_status_json=Column(String) player1_id=Column(Integer, ForeignKey('users.user_id')) player2_id=Column(Integer, ForeignKey('users.user_id')) board=relationship("Board", back_populates="games") player1=relationship("User", foreign_keys=[player1_id]) player2=relationship("User", foreign_keys=[player2_id]) Board.games=relationship("Game", order_by=Game.game_id, back_populates="board") class Token(Base): __tablename__ = 'tokens' token_id=Column(Integer, primary_key=True) game_id=Column(Integer, ForeignKey('games.game_id')) player=Column(Integer) # TODO: enum 1 or 2 location=Column(Integer) placed_on=Column(DateTime(timezone=True), default=func.now()) game=relationship("Game", back_populates="tokens") Game.tokens=relationship("Token", order_by=Token.location, back_populates='game') class User(Base): __tablename__ = 'users' user_id=Column(Integer, primary_key=True) username=Column(String) display_name=Column(String) user_extra_data_json=Column(String)
34.616438
81
0.734468
347
2,527
5.123919
0.37464
0.080427
0.067492
0.049494
0.134983
0.134983
0.102362
0
0
0
0
0.008833
0.148793
2,527
72
82
35.097222
0.817759
0.22873
0
0
0
0
0.155717
0.078634
0
0
0
0.013889
0
1
0
false
0
0.090909
0
0.772727
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
9f5b2611fe2d90f6df46ee4c923375729e58e87e
249
py
Python
staplelib/__init__.py
pivotman/stapler
1cabc85521e2badfc1e0d690086e286e701c2d9e
[ "BSD-3-Clause" ]
186
2015-01-19T09:41:31.000Z
2022-03-23T02:36:25.000Z
staplelib/__init__.py
pivotman/stapler
1cabc85521e2badfc1e0d690086e286e701c2d9e
[ "BSD-3-Clause" ]
72
2015-01-19T03:59:36.000Z
2022-03-30T18:35:43.000Z
staplelib/__init__.py
pivotman/stapler
1cabc85521e2badfc1e0d690086e286e701c2d9e
[ "BSD-3-Clause" ]
44
2015-02-22T13:05:54.000Z
2022-01-26T17:41:52.000Z
class CommandError(Exception): """ Exception class indicating a problem while executing a stapler command. """ pass OPTIONS = None # optparse options def main(arguments=None): from . import stapler stapler.main(arguments)
19.153846
75
0.698795
28
249
6.214286
0.678571
0.149425
0
0
0
0
0
0
0
0
0
0
0.220884
249
12
76
20.75
0.896907
0.35743
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
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
9f5f0968a0240041fce41e795176645734d7c4d5
710
py
Python
tests/test_utils.py
douban/brownant
3c7e6d30f67b8f0f8ca1f823ea3daed74e8725cd
[ "BSD-3-Clause" ]
88
2015-01-06T08:56:53.000Z
2022-01-06T08:20:05.000Z
tests/test_utils.py
douban/brownant
3c7e6d30f67b8f0f8ca1f823ea3daed74e8725cd
[ "BSD-3-Clause" ]
3
2015-07-07T06:24:23.000Z
2017-03-03T13:13:36.000Z
tests/test_utils.py
douban/brownant
3c7e6d30f67b8f0f8ca1f823ea3daed74e8725cd
[ "BSD-3-Clause" ]
34
2015-01-20T00:45:08.000Z
2020-05-11T13:23:55.000Z
from pytest import raises from brownant.utils import to_bytes_safe UNICODE_STRING_SAMPLE = u"\u5b89\u5168 SAFE" BYTES_SEQUENCE_SAMPLE = b"\xe5\xae\x89\xe5\x85\xa8 SAFE" def test_to_bytes_safe(): assert to_bytes_safe(UNICODE_STRING_SAMPLE) == BYTES_SEQUENCE_SAMPLE assert to_bytes_safe(BYTES_SEQUENCE_SAMPLE) == BYTES_SEQUENCE_SAMPLE assert to_bytes_safe(u"ABC") == b"ABC" assert to_bytes_safe(b"ABC") == b"ABC" assert type(to_bytes_safe(UNICODE_STRING_SAMPLE)) is bytes assert type(to_bytes_safe(BYTES_SEQUENCE_SAMPLE)) is bytes assert type(to_bytes_safe(u"ABC")) is bytes assert type(to_bytes_safe(b"ABC")) is bytes with raises(TypeError): to_bytes_safe(42)
30.869565
72
0.759155
115
710
4.347826
0.269565
0.154
0.242
0.136
0.642
0.568
0.36
0.304
0
0
0
0.026403
0.146479
710
22
73
32.272727
0.79868
0
0
0
0
0
0.090141
0.033803
0
0
0
0
0.533333
1
0.066667
false
0
0.133333
0
0.2
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
1
0
0
0
0
0
0
0
0
0
2
9f747621a8b36f1c66e2654901b86270810f770b
530
py
Python
listchaining/__init__.py
Theodikes/listchaining
3d63aea066a2a7c0c68e9c260eefc67ef67889e2
[ "MIT" ]
3
2021-07-22T13:34:53.000Z
2021-07-27T12:28:04.000Z
listchaining/__init__.py
Theodikes/listchaining
3d63aea066a2a7c0c68e9c260eefc67ef67889e2
[ "MIT" ]
null
null
null
listchaining/__init__.py
Theodikes/listchaining
3d63aea066a2a7c0c68e9c260eefc67ef67889e2
[ "MIT" ]
null
null
null
import gc import ctypes from . import list_methods from inspect import getmembers, isfunction def add_method(builtin_class, method_name, method_function): patchable_builtin_class = gc.get_referents(builtin_class.__dict__)[0] patchable_builtin_class[method_name] = method_function ctypes.pythonapi.PyType_Modified(ctypes.py_object(builtin_class)) all_list_methods = getmembers(list_methods, isfunction) for method_name, method_function in all_list_methods: add_method(list, method_name[:-7], method_function)
29.444444
73
0.818868
72
530
5.611111
0.416667
0.148515
0.118812
0.178218
0.178218
0.178218
0
0
0
0
0
0.004237
0.109434
530
17
74
31.176471
0.851695
0
0
0
0
0
0
0
0
0
0
0
0
1
0.090909
false
0
0.363636
0
0.454545
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
9f87eb96e53e3d1f96a17dd22fae41f9315bc49f
727
py
Python
scratchpad/issue2/problem1/a.py
jhrcook/awesome-streamlit
83c4c4ec13f274b30e586715bb080e01432b87e6
[ "CC0-1.0" ]
null
null
null
scratchpad/issue2/problem1/a.py
jhrcook/awesome-streamlit
83c4c4ec13f274b30e586715bb080e01432b87e6
[ "CC0-1.0" ]
null
null
null
scratchpad/issue2/problem1/a.py
jhrcook/awesome-streamlit
83c4c4ec13f274b30e586715bb080e01432b87e6
[ "CC0-1.0" ]
null
null
null
"""This module provides a reference test example for https://github.com/MarcSkovMadsen/awesome-streamlit/issues/2""" import bf4.b4 as b4_new_name # Hot reload works in b4.py file import bf.b # Hot reloading works in b.py file import st_extensions # Hot reloading works in st_extensions.py file import streamlit as st from bf2 import b2 # Hot reload does not work in b2.py file from bf3 import b3 as b3_new_name # Hot reload does not work in b3.py file # c hot reloading does not work in bf/cf/c.py file through file bf/b.py # d hot reloading does not work in bf/cf/df/d.py file through file bf/cf/c.py st.write("this is a") bf.b.write() b2.write() b3_new_name.write() b4_new_name.write() st_extensions.write("awesome")
36.35
77
0.757909
143
727
3.776224
0.335664
0.077778
0.081481
0.096296
0.259259
0.188889
0.107407
0.107407
0
0
0
0.02439
0.154058
727
19
78
38.263158
0.853659
0.610729
0
0
0
0
0.059041
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
9f95d136653163744dac0890abdcddbf50b31208
193
py
Python
core/utils/constant.py
chiaki64/Windless
12eef67e7c49bd131104c223539445ccd841edc1
[ "MIT" ]
10
2016-11-30T12:15:00.000Z
2018-10-04T01:13:45.000Z
core/utils/constant.py
chiaki64/Windless
12eef67e7c49bd131104c223539445ccd841edc1
[ "MIT" ]
null
null
null
core/utils/constant.py
chiaki64/Windless
12eef67e7c49bd131104c223539445ccd841edc1
[ "MIT" ]
3
2017-11-01T09:17:18.000Z
2018-09-25T02:07:40.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from utils.abstract import Singleton class Const(metaclass=Singleton): def __init__(self): self.CATEGORY = [] CONST = Const()
12.0625
36
0.637306
23
193
5.173913
0.826087
0
0
0
0
0
0
0
0
0
0
0.013158
0.212435
193
15
37
12.866667
0.769737
0.222798
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
9f9647d6d6589d0ec87d7a271ed1ac62fda5d4db
13,417
py
Python
pysnmp/ONEACCESS-SYS-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/ONEACCESS-SYS-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/ONEACCESS-SYS-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 ONEACCESS-SYS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ONEACCESS-SYS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:25:27 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection") oacExpIMSystem, oacMIBModules = mibBuilder.importSymbols("ONEACCESS-GLOBAL-REG", "oacExpIMSystem", "oacMIBModules") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") Bits, IpAddress, Gauge32, Integer32, TimeTicks, MibIdentifier, Unsigned32, Counter32, Counter64, iso, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "IpAddress", "Gauge32", "Integer32", "TimeTicks", "MibIdentifier", "Unsigned32", "Counter32", "Counter64", "iso", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "NotificationType") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") oacSysMIBModule = ModuleIdentity((1, 3, 6, 1, 4, 1, 13191, 1, 100, 671)) oacSysMIBModule.setRevisions(('2014-05-05 00:01', '2011-06-15 00:00', '2010-12-14 00:01', '2010-08-11 10:00', '2010-07-08 10:00',)) if mibBuilder.loadTexts: oacSysMIBModule.setLastUpdated('201405050001Z') if mibBuilder.loadTexts: oacSysMIBModule.setOrganization(' OneAccess ') class OASysHwcClass(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2)) namedValues = NamedValues(("board", 0), ("cpu", 1), ("slot", 2)) class OASysHwcType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6)) namedValues = NamedValues(("mainboard", 0), ("microprocessor", 1), ("ram", 2), ("flash", 3), ("dsp", 4), ("uplink", 5), ("module", 6)) class OASysCoreType(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3)) namedValues = NamedValues(("controlplane", 0), ("dataforwarding", 1), ("application", 2), ("mixed", 3)) oacExpIMSysStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1)) oacExpIMSysHardwareDescription = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2)) oacSysMemStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 1)) oacSysCpuStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2)) oacSysSecureCrashlogCount = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 100), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysSecureCrashlogCount.setStatus('current') oacSysStartCaused = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 200), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysStartCaused.setStatus('current') oacSysIMSysMainBoard = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1)) oacExpIMSysHwComponents = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2)) oacExpIMSysFactory = MibIdentifier((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 3)) oacSysIMSysMainIdentifier = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 1), ObjectIdentifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainIdentifier.setStatus('current') oacSysIMSysMainManufacturedIdentity = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainManufacturedIdentity.setStatus('current') oacSysIMSysMainManufacturedDate = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainManufacturedDate.setStatus('current') oacSysIMSysMainCPU = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainCPU.setStatus('current') oacSysIMSysMainBSPVersion = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainBSPVersion.setStatus('current') oacSysIMSysMainBootVersion = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainBootVersion.setStatus('current') oacSysIMSysMainBootDateCreation = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysIMSysMainBootDateCreation.setStatus('current') oacSysMemoryFree = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysMemoryFree.setStatus('current') oacSysMemoryAllocated = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysMemoryAllocated.setStatus('current') oacSysMemoryTotal = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysMemoryTotal.setStatus('current') oacSysMemoryUsed = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysMemoryUsed.setStatus('current') oacSysCpuUsed = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysCpuUsed.setStatus('current') oacSysCpuUsedCoresCount = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysCpuUsedCoresCount.setStatus('current') oacSysCpuUsedCoresTable = MibTable((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 3), ) if mibBuilder.loadTexts: oacSysCpuUsedCoresTable.setStatus('current') oacSysCpuUsedCoresEntry = MibTableRow((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 3, 1), ).setIndexNames((0, "ONEACCESS-SYS-MIB", "oacSysCpuUsedIndex")) if mibBuilder.loadTexts: oacSysCpuUsedCoresEntry.setStatus('current') oacSysCpuUsedIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 3, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysCpuUsedIndex.setStatus('current') oacSysCpuUsedCoreType = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 3, 1, 2), OASysCoreType()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysCpuUsedCoreType.setStatus('current') oacSysCpuUsedValue = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 3, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysCpuUsedValue.setStatus('current') oacSysCpuUsedOneMinuteValue = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 2, 3, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysCpuUsedOneMinuteValue.setStatus('current') oacSysLastRebootCause = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacSysLastRebootCause.setStatus('current') oacExpIMSysHwComponentsCount = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwComponentsCount.setStatus('current') oacExpIMSysHwComponentsTable = MibTable((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2), ) if mibBuilder.loadTexts: oacExpIMSysHwComponentsTable.setStatus('current') oacExpIMSysHwComponentsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1), ).setIndexNames((0, "ONEACCESS-SYS-MIB", "oacExpIMSysHwcIndex")) if mibBuilder.loadTexts: oacExpIMSysHwComponentsEntry.setStatus('current') oacExpIMSysHwcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcIndex.setStatus('current') oacExpIMSysHwcClass = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 2), OASysHwcClass()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcClass.setStatus('current') oacExpIMSysHwcType = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 3), OASysHwcType()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcType.setStatus('current') oacExpIMSysHwcDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcDescription.setStatus('current') oacExpIMSysHwcSerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcSerialNumber.setStatus('current') oacExpIMSysHwcManufacturer = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcManufacturer.setStatus('current') oacExpIMSysHwcManufacturedDate = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 10))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcManufacturedDate.setStatus('current') oacExpIMSysHwcProductName = MibTableColumn((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 2, 2, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysHwcProductName.setStatus('current') oacExpIMSysFactorySupplierID = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 3, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 14))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysFactorySupplierID.setStatus('current') oacExpIMSysFactoryProductSalesCode = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 3, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 22))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysFactoryProductSalesCode.setStatus('current') oacExpIMSysFactoryHwRevision = MibScalar((1, 3, 6, 1, 4, 1, 13191, 10, 3, 3, 2, 3, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(2, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: oacExpIMSysFactoryHwRevision.setStatus('current') mibBuilder.exportSymbols("ONEACCESS-SYS-MIB", oacSysCpuUsed=oacSysCpuUsed, oacSysCpuUsedValue=oacSysCpuUsedValue, OASysCoreType=OASysCoreType, oacSysCpuUsedIndex=oacSysCpuUsedIndex, oacExpIMSysHwcManufacturedDate=oacExpIMSysHwcManufacturedDate, oacSysCpuUsedOneMinuteValue=oacSysCpuUsedOneMinuteValue, oacSysIMSysMainIdentifier=oacSysIMSysMainIdentifier, oacSysCpuUsedCoresEntry=oacSysCpuUsedCoresEntry, oacSysCpuStatistics=oacSysCpuStatistics, oacExpIMSysFactorySupplierID=oacExpIMSysFactorySupplierID, OASysHwcClass=OASysHwcClass, oacSysIMSysMainCPU=oacSysIMSysMainCPU, oacExpIMSysHwcProductName=oacExpIMSysHwcProductName, oacExpIMSysStatistics=oacExpIMSysStatistics, oacSysMemoryFree=oacSysMemoryFree, oacSysMIBModule=oacSysMIBModule, oacSysMemoryAllocated=oacSysMemoryAllocated, oacSysMemStatistics=oacSysMemStatistics, oacExpIMSysHwcSerialNumber=oacExpIMSysHwcSerialNumber, oacSysMemoryUsed=oacSysMemoryUsed, oacExpIMSysHwComponentsTable=oacExpIMSysHwComponentsTable, oacSysMemoryTotal=oacSysMemoryTotal, oacSysCpuUsedCoresTable=oacSysCpuUsedCoresTable, oacExpIMSysHardwareDescription=oacExpIMSysHardwareDescription, oacSysIMSysMainManufacturedIdentity=oacSysIMSysMainManufacturedIdentity, oacSysIMSysMainBoard=oacSysIMSysMainBoard, oacSysIMSysMainBootDateCreation=oacSysIMSysMainBootDateCreation, oacExpIMSysHwcDescription=oacExpIMSysHwcDescription, oacSysIMSysMainBootVersion=oacSysIMSysMainBootVersion, oacExpIMSysHwcClass=oacExpIMSysHwcClass, PYSNMP_MODULE_ID=oacSysMIBModule, oacSysCpuUsedCoreType=oacSysCpuUsedCoreType, oacExpIMSysHwComponentsCount=oacExpIMSysHwComponentsCount, oacExpIMSysFactoryProductSalesCode=oacExpIMSysFactoryProductSalesCode, oacSysIMSysMainBSPVersion=oacSysIMSysMainBSPVersion, oacSysStartCaused=oacSysStartCaused, oacExpIMSysHwComponents=oacExpIMSysHwComponents, oacExpIMSysFactory=oacExpIMSysFactory, oacSysIMSysMainManufacturedDate=oacSysIMSysMainManufacturedDate, oacSysCpuUsedCoresCount=oacSysCpuUsedCoresCount, oacExpIMSysHwcIndex=oacExpIMSysHwcIndex, OASysHwcType=OASysHwcType, oacSysLastRebootCause=oacSysLastRebootCause, oacExpIMSysFactoryHwRevision=oacExpIMSysFactoryHwRevision, oacExpIMSysHwComponentsEntry=oacExpIMSysHwComponentsEntry, oacExpIMSysHwcType=oacExpIMSysHwcType, oacExpIMSysHwcManufacturer=oacExpIMSysHwcManufacturer, oacSysSecureCrashlogCount=oacSysSecureCrashlogCount)
117.692982
2,330
0.773645
1,437
13,417
7.22199
0.132916
0.009443
0.012719
0.016959
0.41376
0.3492
0.317691
0.30661
0.256408
0.256408
0
0.086333
0.084892
13,417
113
2,331
118.734513
0.758918
0.024447
0
0.029126
0
0
0.100841
0.003364
0
0
0
0
0
1
0
false
0
0.067961
0
0.184466
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9f978d218a060b854bb99ec40c5a45b1a469ec2e
1,466
py
Python
tests/integration/conftest.py
e-dang/Autogarden
b15217e5d4755fc028b8dc4255cbdcb77ead80f4
[ "MIT" ]
null
null
null
tests/integration/conftest.py
e-dang/Autogarden
b15217e5d4755fc028b8dc4255cbdcb77ead80f4
[ "MIT" ]
null
null
null
tests/integration/conftest.py
e-dang/Autogarden
b15217e5d4755fc028b8dc4255cbdcb77ead80f4
[ "MIT" ]
null
null
null
import pytest from django.test import Client from pytest_factoryboy import register from pytest_factoryboy.fixture import LazyFixture from tests import factories @pytest.fixture(autouse=True) def fast_hasher(settings): settings.PASSWORD_HASHERS = [ 'django.contrib.auth.hashers.MD5PasswordHasher', ] @pytest.fixture def auth_client_user(db, user1): """Cheap authenticated client and user tuple""" client = Client() client.force_login(user1) yield client, user1 @pytest.fixture def auth_client(auth_client_user): """Cheap authenticated client""" yield auth_client_user[0] @pytest.fixture def auth_user(auth_client_user): """Cheap authenticated user""" yield auth_client_user[1] @pytest.fixture def true_auth_client_user(client, create_user, test_password): """Expensive authenticated client and user tuple""" user = create_user() client.login(email=user.email, password=test_password) yield client, user @pytest.fixture def true_auth_client(true_auth_client_user): """Expensive authenticated client""" yield true_auth_client_user[0] @pytest.fixture def true_auth_user(true_auth_client_user): """Expensive authenticated user""" yield true_auth_client_user[1] @pytest.fixture def auth_user_garden(auth_user, garden_factory): yield garden_factory(owner=auth_user) register(factories.WateringStationFactory, 'auth_user_ws', garden=LazyFixture('auth_user_garden'))
22.212121
98
0.763302
190
1,466
5.626316
0.226316
0.112254
0.130964
0.084191
0.437792
0.231993
0.115996
0
0
0
0
0.006369
0.143247
1,466
65
99
22.553846
0.844745
0.135744
0
0.194444
0
0
0.059061
0.036408
0
0
0
0
0
1
0.222222
false
0.111111
0.138889
0
0.361111
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
9f9aaaa7c1e1a9c1bd8d0547eda60ce968e0b525
757
py
Python
reflex/error.py
kenichi/Reflex
f21d502ec5b46b48818f09369d788093c71871a0
[ "MIT" ]
null
null
null
reflex/error.py
kenichi/Reflex
f21d502ec5b46b48818f09369d788093c71871a0
[ "MIT" ]
null
null
null
reflex/error.py
kenichi/Reflex
f21d502ec5b46b48818f09369d788093c71871a0
[ "MIT" ]
1
2020-10-30T00:14:19.000Z
2020-10-30T00:14:19.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- class GitCommandError(Exception): """ Exception which can be raised when git exits with a non-zero exit code. """ pass class InvalidUpgradePath(Exception): """ Exception which is thrown if an invalid upgrade path is detected. This is usually when attempting to upgrade to a version before the one that is already the latest version. """ pass class DuplicateGitReference(Exception): """ Exception which is thrown when unable to create a tag/branch/etc. as it already exists in the repo. """ pass class InvalidGitReference(Exception): """ Exception which is thrown when unable to find a given git reference in the repo. """ pass
22.264706
79
0.676354
101
757
5.069307
0.584158
0.140625
0.179688
0.146484
0.228516
0.167969
0.167969
0.167969
0
0
0
0.001751
0.245707
757
33
80
22.939394
0.894921
0.624835
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
2
9faa984b09fa973dfe2632f7348408b431d93a9e
714
py
Python
tests/all/structures/string.py
stuaxo/python-stdnet
78db5320bdedc3f28c5e4f38cda13a4469e35db7
[ "BSD-3-Clause" ]
61
2015-01-13T23:41:10.000Z
2021-09-14T03:23:59.000Z
tests/all/structures/string.py
drscream/python-stdnet
78db5320bdedc3f28c5e4f38cda13a4469e35db7
[ "BSD-3-Clause" ]
4
2015-02-28T08:57:14.000Z
2020-12-29T17:14:43.000Z
tests/all/structures/string.py
drscream/python-stdnet
78db5320bdedc3f28c5e4f38cda13a4469e35db7
[ "BSD-3-Clause" ]
12
2015-01-01T09:23:06.000Z
2021-09-16T08:09:13.000Z
import os from datetime import date from stdnet import odm, InvalidTransaction from stdnet.utils import test, encoders, zip from stdnet.utils.populate import populate from .base import StructMixin class TestString(StructMixin, test.TestCase): structure = odm.String name = 'string' def create_one(self): a = self.structure() a.push_back('this is a test') return a def test_incr(self): a = self.empty() a.session.add(a) yield self.async.assertEqual(a.incr(), 1) yield self.async.assertEqual(a.incr(), 2) yield self.async.assertEqual(a.incr(3), 5) yield self.async.assertEqual(a.incr(-7), -2)
25.5
52
0.635854
95
714
4.747368
0.452632
0.079823
0.124169
0.221729
0.266075
0.266075
0
0
0
0
0
0.011364
0.260504
714
28
53
25.5
0.842803
0
0
0
0
0
0.027972
0
0
0
0
0
0.2
0
null
null
0
0.3
null
null
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
9fadff1ef357c4368ddb8143a25f23035066ab23
1,811
py
Python
sitri/providers/base/base_config_provider.py
Elastoo-Team/sitri
d5470d9a37d3c944c0976793fce80a630e5625b1
[ "MIT" ]
11
2020-12-16T07:00:29.000Z
2021-05-25T16:24:50.000Z
sitri/providers/base/base_config_provider.py
Elastoo-Team/sitri
d5470d9a37d3c944c0976793fce80a630e5625b1
[ "MIT" ]
1
2021-06-30T05:42:46.000Z
2021-09-03T11:45:56.000Z
sitri/providers/base/base_config_provider.py
Elastoo-Team/sitri
d5470d9a37d3c944c0976793fce80a630e5625b1
[ "MIT" ]
null
null
null
""" .. module:: config.providers :synopsis: Config Base .. moduleauthor:: Aleksander Lavrov <github.com/egnod> """ import inspect import typing from abc import ABC, abstractmethod class ConfigProvider(ABC): """Base class for config providers.""" @property @abstractmethod def provider_code(self) -> str: """Provider code property for identity provider in manager.""" @abstractmethod def get(self, key: str, **kwargs) -> typing.Optional[typing.Any]: """Get value from storage. :param key: key for find value in provider source :param kwargs: additional arguments for providers """ @abstractmethod def keys(self, **kwargs) -> typing.List[str]: """Get keys list in storage.""" def fill(self, call: typing.Callable, **kwargs): """Fill callable object kwargs if all founded by provider. :param call: callable object for fill :param kwargs: additional arguments for getting """ parameters = inspect.signature(call).parameters data = {} for key in parameters.keys(): data[key] = self.get(key=key, **kwargs) return call(**data) class ConfigProviderManager: """Manager for children ConfigProvider classes.""" @staticmethod def get_by_code(code: str) -> typing.Optional[typing.Type[ConfigProvider]]: """Get config provider by provider_code. :param code: provider_code for search config provider :Example: .. code-block:: python ConfigProviderManager.get_by_code("system") -> SystemConfigProvider """ for provider in ConfigProvider.__subclasses__(): if provider.provider_code == code: return provider return None
27.861538
79
0.631143
193
1,811
5.860104
0.357513
0.05305
0.035367
0.05305
0.058355
0
0
0
0
0
0
0
0.264495
1,811
64
80
28.296875
0.849099
0.41524
0
0.125
0
0
0
0
0
0
0
0
0
1
0.208333
false
0
0.125
0
0.541667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
9fb6b8d5a5214c3f30a5a78b48529b395ea3587f
15,345
py
Python
python/pykondo.py
burakakca/kondo-khr-3hv
7edfc83a527dd729c473b48956183d7fd9cd66d8
[ "MIT" ]
null
null
null
python/pykondo.py
burakakca/kondo-khr-3hv
7edfc83a527dd729c473b48956183d7fd9cd66d8
[ "MIT" ]
null
null
null
python/pykondo.py
burakakca/kondo-khr-3hv
7edfc83a527dd729c473b48956183d7fd9cd66d8
[ "MIT" ]
null
null
null
# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_pykondo', [dirname(__file__)]) except ImportError: import _pykondo return _pykondo if fp is not None: try: _mod = imp.load_module('_pykondo', fp, pathname, description) finally: fp.close() return _mod _pykondo = swig_import_helper() del swig_import_helper else: import _pykondo del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) try: _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 RCB4_SECOND = _pykondo.RCB4_SECOND RCB4_15MS = _pykondo.RCB4_15MS RCB4_50MS = _pykondo.RCB4_50MS RCB4_USB_VID = _pykondo.RCB4_USB_VID RCB4_USB_PID = _pykondo.RCB4_USB_PID RCB4_BAUD = _pykondo.RCB4_BAUD RCB4_SWAP_SIZE = _pykondo.RCB4_SWAP_SIZE RCB4_RX_TIMEOUT = _pykondo.RCB4_RX_TIMEOUT RCB4_ACK_BYTE = _pykondo.RCB4_ACK_BYTE RCB4_NCK_BYTE = _pykondo.RCB4_NCK_BYTE RCB4_CMD_ACK = _pykondo.RCB4_CMD_ACK RCB4_CMD_MOV = _pykondo.RCB4_CMD_MOV RCB4_CMD_CALL = _pykondo.RCB4_CMD_CALL RCB4_CMD_VERS = _pykondo.RCB4_CMD_VERS RCB4_CMD_ICS = _pykondo.RCB4_CMD_ICS RCB4_DEV_RAM = _pykondo.RCB4_DEV_RAM RCB4_DEV_DEV = _pykondo.RCB4_DEV_DEV RCB4_DEV_COM = _pykondo.RCB4_DEV_COM RCB4_DEV_ROM = _pykondo.RCB4_DEV_ROM RCB4_RAM_TO_COM = _pykondo.RCB4_RAM_TO_COM RCB4_COM_TO_RAM = _pykondo.RCB4_COM_TO_RAM RCB4_OPT_BYTES = _pykondo.RCB4_OPT_BYTES RCB4_OPT_SIO = _pykondo.RCB4_OPT_SIO RCB4_OPT_EEPROM = _pykondo.RCB4_OPT_EEPROM RCB4_OPT_RESP = _pykondo.RCB4_OPT_RESP RCB4_OPT_VEC = _pykondo.RCB4_OPT_VEC RCB4_OPT_FRAME_10MS = _pykondo.RCB4_OPT_FRAME_10MS RCB4_OPT_FRAME_20MS = _pykondo.RCB4_OPT_FRAME_20MS RCB4_OPT_FRAME_15MS = _pykondo.RCB4_OPT_FRAME_15MS RCB4_OPT_FRAME_25MS = _pykondo.RCB4_OPT_FRAME_25MS RCB4_OPT_COM_BAUD_125200 = _pykondo.RCB4_OPT_COM_BAUD_125200 RCB4_OPT_COM_BAUD_625000 = _pykondo.RCB4_OPT_COM_BAUD_625000 RCB4_OPT_COM_BAUD_1250000 = _pykondo.RCB4_OPT_COM_BAUD_1250000 RCB4_OPT_ZERO = _pykondo.RCB4_OPT_ZERO RCB4_OPT_CARRY = _pykondo.RCB4_OPT_CARRY RCB4_OPT_ERROR = _pykondo.RCB4_OPT_ERROR RCB4_OPT_ICS_BAUD_125200 = _pykondo.RCB4_OPT_ICS_BAUD_125200 RCB4_OPT_ICS_BAUD_625000 = _pykondo.RCB4_OPT_ICS_BAUD_625000 RCB4_OPT_ICS_BAUD_1250000 = _pykondo.RCB4_OPT_ICS_BAUD_1250000 RCB4_OPT_GREEN_LED = _pykondo.RCB4_OPT_GREEN_LED RCB4_OPT_LOW = _pykondo.RCB4_OPT_LOW RCB4_OPT_HIGH = _pykondo.RCB4_OPT_HIGH RCB4_ADDR_OPT = _pykondo.RCB4_ADDR_OPT RCB4_ADDR_PGC = _pykondo.RCB4_ADDR_PGC RCB4_ADDR_EEPROM_FLAG = _pykondo.RCB4_ADDR_EEPROM_FLAG RCB4_ADDR_AD_REF_BASE = _pykondo.RCB4_ADDR_AD_REF_BASE RCB4_ADDR_AD_READ_BASE = _pykondo.RCB4_ADDR_AD_READ_BASE RCB4_NUM_ANALOGS = _pykondo.RCB4_NUM_ANALOGS RCB4_ADDR_PIO_SET = _pykondo.RCB4_ADDR_PIO_SET RCB4_ADDR_PIO_OUTPUT = _pykondo.RCB4_ADDR_PIO_OUTPUT RCB4_ADDR_TIMER_0 = _pykondo.RCB4_ADDR_TIMER_0 RCB4_ADDR_TIMER_1 = _pykondo.RCB4_ADDR_TIMER_1 RCB4_ADDR_TIMER_2 = _pykondo.RCB4_ADDR_TIMER_2 RCB4_ADDR_TIMER_3 = _pykondo.RCB4_ADDR_TIMER_3 RCB4_ADDR_ICS_BASE = _pykondo.RCB4_ADDR_ICS_BASE RCB4_NUM_ICS = _pykondo.RCB4_NUM_ICS RCB4_ADDR_MAIN = _pykondo.RCB4_ADDR_MAIN RCB4_ADDR_SERVO = _pykondo.RCB4_ADDR_SERVO RCB4_SERVO_DATA_SIZE = _pykondo.RCB4_SERVO_DATA_SIZE RCB4_NUM_SERVOS = _pykondo.RCB4_NUM_SERVOS RCB4_ADDR_KRI = _pykondo.RCB4_ADDR_KRI RCB4_ADDR_BTN_L = _pykondo.RCB4_ADDR_BTN_L RCB4_ADDR_BTN_M = _pykondo.RCB4_ADDR_BTN_M RCB4_ADDR_BTN_H = _pykondo.RCB4_ADDR_BTN_H RCB4_ADDR_MOT_BASE = _pykondo.RCB4_ADDR_MOT_BASE RCB4_MOT_SIZE = _pykondo.RCB4_MOT_SIZE RCB4_MOT_MAX = _pykondo.RCB4_MOT_MAX RCB4_SERVO_ID_OFFSET = _pykondo.RCB4_SERVO_ID_OFFSET RCB4_SERVO_SETPOS_OFFSET = _pykondo.RCB4_SERVO_SETPOS_OFFSET RCB4_SERVO_POS_OFFSET = _pykondo.RCB4_SERVO_POS_OFFSET RCB4_SERVO_TRIM_OFFSET = _pykondo.RCB4_SERVO_TRIM_OFFSET RCB4_ADDR_COUNTER_BASE = _pykondo.RCB4_ADDR_COUNTER_BASE RCB4_NUM_COUNTERS = _pykondo.RCB4_NUM_COUNTERS RCB4_BTN_NP = _pykondo.RCB4_BTN_NP RCB4_BTN_LU = _pykondo.RCB4_BTN_LU RCB4_BTN_LD = _pykondo.RCB4_BTN_LD RCB4_BTN_LR = _pykondo.RCB4_BTN_LR RCB4_BTN_LL = _pykondo.RCB4_BTN_LL RCB4_BTN_RU = _pykondo.RCB4_BTN_RU RCB4_BTN_RD = _pykondo.RCB4_BTN_RD RCB4_BTN_RR = _pykondo.RCB4_BTN_RR RCB4_BTN_RL = _pykondo.RCB4_BTN_RL RCB4_BTN_S1 = _pykondo.RCB4_BTN_S1 RCB4_BTN_S2 = _pykondo.RCB4_BTN_S2 RCB4_BTN_S3 = _pykondo.RCB4_BTN_S3 RCB4_BTN_S4 = _pykondo.RCB4_BTN_S4 class KondoInstance(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, KondoInstance, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, KondoInstance, name) __repr__ = _swig_repr __swig_setmethods__["ftdic"] = _pykondo.KondoInstance_ftdic_set __swig_getmethods__["ftdic"] = _pykondo.KondoInstance_ftdic_get if _newclass:ftdic = _swig_property(_pykondo.KondoInstance_ftdic_get, _pykondo.KondoInstance_ftdic_set) __swig_setmethods__["swap"] = _pykondo.KondoInstance_swap_set __swig_getmethods__["swap"] = _pykondo.KondoInstance_swap_get if _newclass:swap = _swig_property(_pykondo.KondoInstance_swap_get, _pykondo.KondoInstance_swap_set) __swig_setmethods__["error"] = _pykondo.KondoInstance_error_set __swig_getmethods__["error"] = _pykondo.KondoInstance_error_get if _newclass:error = _swig_property(_pykondo.KondoInstance_error_get, _pykondo.KondoInstance_error_set) __swig_setmethods__["opt"] = _pykondo.KondoInstance_opt_set __swig_getmethods__["opt"] = _pykondo.KondoInstance_opt_get if _newclass:opt = _swig_property(_pykondo.KondoInstance_opt_get, _pykondo.KondoInstance_opt_set) __swig_setmethods__["debug"] = _pykondo.KondoInstance_debug_set __swig_getmethods__["debug"] = _pykondo.KondoInstance_debug_get if _newclass:debug = _swig_property(_pykondo.KondoInstance_debug_get, _pykondo.KondoInstance_debug_set) def __init__(self): this = _pykondo.new_KondoInstance() try: self.this.append(this) except: self.this = this __swig_destroy__ = _pykondo.delete_KondoInstance __del__ = lambda self : None; KondoInstance_swigregister = _pykondo.KondoInstance_swigregister KondoInstance_swigregister(KondoInstance) def kondo_init(*args): return _pykondo.kondo_init(*args) kondo_init = _pykondo.kondo_init def kondo_init_custom(*args): return _pykondo.kondo_init_custom(*args) kondo_init_custom = _pykondo.kondo_init_custom def kondo_close(*args): return _pykondo.kondo_close(*args) kondo_close = _pykondo.kondo_close def kondo_write(*args): return _pykondo.kondo_write(*args) kondo_write = _pykondo.kondo_write def kondo_read(*args): return _pykondo.kondo_read(*args) kondo_read = _pykondo.kondo_read def kondo_read_timeout(*args): return _pykondo.kondo_read_timeout(*args) kondo_read_timeout = _pykondo.kondo_read_timeout def kondo_purge(*args): return _pykondo.kondo_purge(*args) kondo_purge = _pykondo.kondo_purge def kondo_trx(*args): return _pykondo.kondo_trx(*args) kondo_trx = _pykondo.kondo_trx def kondo_ack(*args): return _pykondo.kondo_ack(*args) kondo_ack = _pykondo.kondo_ack def kondo_get_options(*args): return _pykondo.kondo_get_options(*args) kondo_get_options = _pykondo.kondo_get_options def kondo_play_motion(*args): return _pykondo.kondo_play_motion(*args) kondo_play_motion = _pykondo.kondo_play_motion def kondo_stop_motion(*args): return _pykondo.kondo_stop_motion(*args) kondo_stop_motion = _pykondo.kondo_stop_motion def kondo_krc3_buttons(*args): return _pykondo.kondo_krc3_buttons(*args) kondo_krc3_buttons = _pykondo.kondo_krc3_buttons def kondo_read_analog(*args): return _pykondo.kondo_read_analog(*args) kondo_read_analog = _pykondo.kondo_read_analog def kondo_set_pio_direction(*args): return _pykondo.kondo_set_pio_direction(*args) kondo_set_pio_direction = _pykondo.kondo_set_pio_direction def kondo_get_pio_direction(*args): return _pykondo.kondo_get_pio_direction(*args) kondo_get_pio_direction = _pykondo.kondo_get_pio_direction def kondo_read_pio(*args): return _pykondo.kondo_read_pio(*args) kondo_read_pio = _pykondo.kondo_read_pio def kondo_write_pio(*args): return _pykondo.kondo_write_pio(*args) kondo_write_pio = _pykondo.kondo_write_pio def kondo_set_counter(*args): return _pykondo.kondo_set_counter(*args) kondo_set_counter = _pykondo.kondo_set_counter def kondo_get_counter(*args): return _pykondo.kondo_get_counter(*args) kondo_get_counter = _pykondo.kondo_get_counter def kondo_send_ics_pos(*args): return _pykondo.kondo_send_ics_pos(*args) kondo_send_ics_pos = _pykondo.kondo_send_ics_pos def kondo_get_servo_data(*args): return _pykondo.kondo_get_servo_data(*args) kondo_get_servo_data = _pykondo.kondo_get_servo_data def kondo_get_servo_trim(*args): return _pykondo.kondo_get_servo_trim(*args) kondo_get_servo_trim = _pykondo.kondo_get_servo_trim def kondo_get_servo_setpos(*args): return _pykondo.kondo_get_servo_setpos(*args) kondo_get_servo_setpos = _pykondo.kondo_get_servo_setpos def kondo_get_servo_pos(*args): return _pykondo.kondo_get_servo_pos(*args) kondo_get_servo_pos = _pykondo.kondo_get_servo_pos def kondo_get_servo_id(*args): return _pykondo.kondo_get_servo_id(*args) kondo_get_servo_id = _pykondo.kondo_get_servo_id def kondo_hareket(*args): return _pykondo.kondo_hareket(*args) kondo_hareket = _pykondo.kondo_hareket def kondo_set_servo_pos(*args): return _pykondo.kondo_set_servo_pos(*args) kondo_set_servo_pos = _pykondo.kondo_set_servo_pos def kondo_checksum(*args): return _pykondo.kondo_checksum(*args) kondo_checksum = _pykondo.kondo_checksum def kondo_verify_checksum(*args): return _pykondo.kondo_verify_checksum(*args) kondo_verify_checksum = _pykondo.kondo_verify_checksum def kondo_load_asciihex(*args): return _pykondo.kondo_load_asciihex(*args) kondo_load_asciihex = _pykondo.kondo_load_asciihex ICS_BAUD = _pykondo.ICS_BAUD ICS_USB_VID = _pykondo.ICS_USB_VID ICS_USB_PID = _pykondo.ICS_USB_PID ICS_RX_TIMEOUT = _pykondo.ICS_RX_TIMEOUT ICS_POS_TIMEOUT = _pykondo.ICS_POS_TIMEOUT ICS_GET_TIMEOUT = _pykondo.ICS_GET_TIMEOUT ICS_SET_TIMEOUT = _pykondo.ICS_SET_TIMEOUT ICS_ID_TIMEOUT = _pykondo.ICS_ID_TIMEOUT ICS_CMD_POS = _pykondo.ICS_CMD_POS ICS_CMD_GET = _pykondo.ICS_CMD_GET ICS_CMD_SET = _pykondo.ICS_CMD_SET ICS_CMD_ID = _pykondo.ICS_CMD_ID ICS_SC_EEPROM = _pykondo.ICS_SC_EEPROM ICS_SC_STRETCH = _pykondo.ICS_SC_STRETCH ICS_SC_SPEED = _pykondo.ICS_SC_SPEED ICS_SC_CURRENT = _pykondo.ICS_SC_CURRENT ICS_SC_READ = _pykondo.ICS_SC_READ ICS_SC_WRITE = _pykondo.ICS_SC_WRITE class ICSData(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, ICSData, name, value) __swig_getmethods__ = {} __getattr__ = lambda self, name: _swig_getattr(self, ICSData, name) __repr__ = _swig_repr __swig_setmethods__["ftdic"] = _pykondo.ICSData_ftdic_set __swig_getmethods__["ftdic"] = _pykondo.ICSData_ftdic_get if _newclass:ftdic = _swig_property(_pykondo.ICSData_ftdic_get, _pykondo.ICSData_ftdic_set) __swig_setmethods__["swap"] = _pykondo.ICSData_swap_set __swig_getmethods__["swap"] = _pykondo.ICSData_swap_get if _newclass:swap = _swig_property(_pykondo.ICSData_swap_get, _pykondo.ICSData_swap_set) __swig_setmethods__["error"] = _pykondo.ICSData_error_set __swig_getmethods__["error"] = _pykondo.ICSData_error_get if _newclass:error = _swig_property(_pykondo.ICSData_error_get, _pykondo.ICSData_error_set) __swig_setmethods__["debug"] = _pykondo.ICSData_debug_set __swig_getmethods__["debug"] = _pykondo.ICSData_debug_get if _newclass:debug = _swig_property(_pykondo.ICSData_debug_get, _pykondo.ICSData_debug_set) def __init__(self): this = _pykondo.new_ICSData() try: self.this.append(this) except: self.this = this __swig_destroy__ = _pykondo.delete_ICSData __del__ = lambda self : None; ICSData_swigregister = _pykondo.ICSData_swigregister ICSData_swigregister(ICSData) def ics_init(*args): return _pykondo.ics_init(*args) ics_init = _pykondo.ics_init def ics_close(*args): return _pykondo.ics_close(*args) ics_close = _pykondo.ics_close def ics_write(*args): return _pykondo.ics_write(*args) ics_write = _pykondo.ics_write def ics_read(*args): return _pykondo.ics_read(*args) ics_read = _pykondo.ics_read def ics_read_timeout(*args): return _pykondo.ics_read_timeout(*args) ics_read_timeout = _pykondo.ics_read_timeout def ics_purge(*args): return _pykondo.ics_purge(*args) ics_purge = _pykondo.ics_purge def ics_trx(*args): return _pykondo.ics_trx(*args) ics_trx = _pykondo.ics_trx def ics_trx_timeout(*args): return _pykondo.ics_trx_timeout(*args) ics_trx_timeout = _pykondo.ics_trx_timeout def ics_pos(*args): return _pykondo.ics_pos(*args) ics_pos = _pykondo.ics_pos def ics_hold(*args): return _pykondo.ics_hold(*args) ics_hold = _pykondo.ics_hold def ics_free(*args): return _pykondo.ics_free(*args) ics_free = _pykondo.ics_free def ics_get_stretch(*args): return _pykondo.ics_get_stretch(*args) ics_get_stretch = _pykondo.ics_get_stretch def ics_get_speed(*args): return _pykondo.ics_get_speed(*args) ics_get_speed = _pykondo.ics_get_speed def ics_get_current(*args): return _pykondo.ics_get_current(*args) ics_get_current = _pykondo.ics_get_current def ics_set_stretch(*args): return _pykondo.ics_set_stretch(*args) ics_set_stretch = _pykondo.ics_set_stretch def ics_set_speed(*args): return _pykondo.ics_set_speed(*args) ics_set_speed = _pykondo.ics_set_speed def ics_set_current_limit(*args): return _pykondo.ics_set_current_limit(*args) ics_set_current_limit = _pykondo.ics_set_current_limit def ics_get_id(*args): return _pykondo.ics_get_id(*args) ics_get_id = _pykondo.ics_get_id def ics_set_id(*args): return _pykondo.ics_set_id(*args) ics_set_id = _pykondo.ics_set_id # This file is compatible with both classic and new-style classes.
35.194954
107
0.806647
2,317
15,345
4.706085
0.098835
0.086757
0.077953
0.062546
0.339967
0.15774
0.097579
0.092076
0.033566
0.033566
0
0.022466
0.115282
15,345
435
108
35.275862
0.780716
0.019225
0
0.065934
1
0
0.011968
0
0
0
0
0
0
1
0.156593
false
0.005495
0.024725
0.14011
0.379121
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
2