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
5f0f221fcb4faaaa4f67e2bdb14311d76c9a7e58
457
py
Python
myCompany/users/models/reset_pwd.py
Rom4eg/myCompany
31846a861d8b0560191e2e1d9791f101b88874df
[ "MIT" ]
null
null
null
myCompany/users/models/reset_pwd.py
Rom4eg/myCompany
31846a861d8b0560191e2e1d9791f101b88874df
[ "MIT" ]
null
null
null
myCompany/users/models/reset_pwd.py
Rom4eg/myCompany
31846a861d8b0560191e2e1d9791f101b88874df
[ "MIT" ]
null
null
null
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User class ResetPassword(models.Model): create_date = models.DateField(verbose_name=_('Create date'), auto_now=True) pwd_hash = models.TextField(verbose_name=_('Hash')) user = models.OneToOneField(User, verbose_name=_('User'), unique=True) def __unicode__(self): return "%s - %s" % user.email, create_date
35.153846
80
0.741794
61
457
5.295082
0.57377
0.092879
0
0
0
0
0
0
0
0
0
0
0.142232
457
12
81
38.083333
0.82398
0
0
0
0
0
0.056893
0
0
0
0
0
0
1
0.111111
false
0.111111
0.333333
0.111111
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
1
1
0
0
4
5f2bc1641cf1bb1c52e097f74c51d73b8b4424a1
82
py
Python
dolo/version.py
gboehl/dolo.py
bde421efe00ecc7cb78b2cead1594b0729aa3a7c
[ "BSD-2-Clause" ]
50
2015-03-16T01:07:00.000Z
2020-02-07T22:18:43.000Z
dolo/version.py
gboehl/dolo.py
bde421efe00ecc7cb78b2cead1594b0729aa3a7c
[ "BSD-2-Clause" ]
130
2015-01-01T19:33:21.000Z
2020-04-27T15:57:22.000Z
dolo/version.py
gboehl/dolo.py
bde421efe00ecc7cb78b2cead1594b0729aa3a7c
[ "BSD-2-Clause" ]
56
2015-10-14T12:27:26.000Z
2020-04-21T14:56:02.000Z
__version_info__ = ("0", "4", "9", "15") __version__ = ".".join(__version_info__)
27.333333
40
0.634146
10
82
3.8
0.7
0.578947
0
0
0
0
0
0
0
0
0
0.068493
0.109756
82
2
41
41
0.452055
0
0
0
0
0
0.073171
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a03a97049ae3d87cca44ef3f3858a5061180707b
130
py
Python
python/1114.py
LourdesOshiroIgarashi/uri-begginner
05f7993dfde2c7cc49e5b74907dee6297c82f447
[ "MIT" ]
3
2021-05-17T05:39:08.000Z
2021-05-23T05:14:54.000Z
python/1114.py
LourdesOshiroIgarashi/uri-beginner
05f7993dfde2c7cc49e5b74907dee6297c82f447
[ "MIT" ]
null
null
null
python/1114.py
LourdesOshiroIgarashi/uri-beginner
05f7993dfde2c7cc49e5b74907dee6297c82f447
[ "MIT" ]
null
null
null
senha = int(input()) while senha != 2002: print("Senha Invalida") senha = int(input()) print("Acesso Permitido")
16.25
28
0.6
15
130
5.2
0.6
0.205128
0.333333
0
0
0
0
0
0
0
0
0.040404
0.238462
130
7
29
18.571429
0.747475
0
0
0.4
0
0
0.243902
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
a03be9e4c7764479af6de4f8569e2ebf26257de6
423
py
Python
unitUnittest.py
brnomendes/talk-teste-unidade
23d086a69ebf7ce5df1a603a660af26f9b53774b
[ "MIT" ]
null
null
null
unitUnittest.py
brnomendes/talk-teste-unidade
23d086a69ebf7ce5df1a603a660af26f9b53774b
[ "MIT" ]
null
null
null
unitUnittest.py
brnomendes/talk-teste-unidade
23d086a69ebf7ce5df1a603a660af26f9b53774b
[ "MIT" ]
null
null
null
import unittest def fibonacci(n): if n < 2: return n else: return fibonacci(n - 1) + fibonacci(n - 2) class fibonacci_test(unittest.TestCase): def test_um(self): self.assertEqual(fibonacci(0), 0) def test_dois(self): self.assertEqual(fibonacci(1), 1) def test_tres(self): self.assertEqual(fibonacci(10), 55) if __name__ == "__main__": unittest.main()
17.625
50
0.617021
55
423
4.527273
0.418182
0.120482
0.228916
0.337349
0
0
0
0
0
0
0
0.035144
0.260047
423
23
51
18.391304
0.760383
0
0
0
0
0
0.018913
0
0
0
0
0
0.2
1
0.266667
false
0
0.066667
0
0.533333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
a07121b9787498f7aba4c6c29aa6f1eb2ae61db2
217
py
Python
virtual/bin/django-admin.py
aenshtyn/Instagram
cf80f90a8067f5aaf3f932e3688dd90c8b88ebb5
[ "MIT" ]
null
null
null
virtual/bin/django-admin.py
aenshtyn/Instagram
cf80f90a8067f5aaf3f932e3688dd90c8b88ebb5
[ "MIT" ]
9
2020-06-06T01:20:27.000Z
2022-03-12T00:33:22.000Z
virtual/bin/django-admin.py
aenshtyn/Instagram
cf80f90a8067f5aaf3f932e3688dd90c8b88ebb5
[ "MIT" ]
null
null
null
#!/home/mohamed/Documents/Moringa-School-Projects/Moringa Core/Django Week 2/IP/Instagram2/virtual/bin/python3 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
36.166667
110
0.806452
29
217
5.655172
0.827586
0
0
0
0
0
0
0
0
0
0
0.015075
0.082949
217
5
111
43.4
0.809045
0.502304
0
0
0
0
0.074766
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
a07138c1f83ad4723e401306174e484c75f88a36
486
py
Python
autoarray/type.py
Jammy2211/PyAutoArray
1fb9c84ca2a3333abedfbf96d070fc355e2628e4
[ "MIT" ]
5
2019-09-26T02:18:25.000Z
2021-12-11T16:29:20.000Z
autoarray/type.py
Jammy2211/PyAutoArray
1fb9c84ca2a3333abedfbf96d070fc355e2628e4
[ "MIT" ]
3
2020-03-30T14:25:57.000Z
2021-12-21T17:10:55.000Z
autoarray/type.py
Jammy2211/PyAutoArray
1fb9c84ca2a3333abedfbf96d070fc355e2628e4
[ "MIT" ]
4
2020-03-03T11:35:41.000Z
2022-01-21T17:37:35.000Z
import numpy as np from typing import Union # from autoarray.structures.grids.one_d import grid_1d as g1d from autoarray.structures.grids.two_d.grid_2d import Grid2D from autoarray.structures.grids.two_d.grid_2d_iterate import Grid2DIterate from autoarray.structures.grids.two_d.grid_2d_irregular import Grid2DIrregular Grid1D2DLike = Union[np.ndarray, "Grid1D", Grid2D, Grid2DIterate, Grid2DIrregular] Grid2DLike = Union[np.ndarray, Grid2D, Grid2DIterate, Grid2DIrregular]
44.181818
83
0.825103
66
486
5.924242
0.393939
0.132992
0.235294
0.286445
0.29156
0.29156
0.29156
0.29156
0
0
0
0.041475
0.106996
486
10
84
48.6
0.859447
0.121399
0
0
0
0
0.014458
0
0
0
0
0
0
1
0
false
0
0.714286
0
0.714286
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a08515bd21dd7cb3748619b0083a55061dd284d9
87
py
Python
picapp/apps.py
nyagajr/picsapp
4e5b93abb4b92e6d77c2cecdd6793595b53fb628
[ "Unlicense" ]
null
null
null
picapp/apps.py
nyagajr/picsapp
4e5b93abb4b92e6d77c2cecdd6793595b53fb628
[ "Unlicense" ]
null
null
null
picapp/apps.py
nyagajr/picsapp
4e5b93abb4b92e6d77c2cecdd6793595b53fb628
[ "Unlicense" ]
null
null
null
from django.apps import AppConfig class PicappConfig(AppConfig): name = 'picapp'
14.5
33
0.747126
10
87
6.5
0.9
0
0
0
0
0
0
0
0
0
0
0
0.172414
87
5
34
17.4
0.902778
0
0
0
0
0
0.068966
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a085b5b3c402e69ac837356564ab563156adb97a
175
py
Python
install.py
faraazahmad/terminoter
8694cbb9fa563f9321ce58d15f709dfbb184cb9a
[ "MIT" ]
1
2018-01-03T20:20:56.000Z
2018-01-03T20:20:56.000Z
install.py
faraazahmad/terminoter
8694cbb9fa563f9321ce58d15f709dfbb184cb9a
[ "MIT" ]
3
2018-01-04T14:28:01.000Z
2018-01-13T08:10:02.000Z
install.py
faraazahmad/terminoter
8694cbb9fa563f9321ce58d15f709dfbb184cb9a
[ "MIT" ]
null
null
null
# This file creates a new database table if it is # not present on the machine # import the db module import db # TODO: check if the database table exists db.create_table()
19.444444
49
0.754286
31
175
4.225806
0.709677
0.198473
0
0
0
0
0
0
0
0
0
0
0.2
175
9
50
19.444444
0.935714
0.777143
0
0
0
0
0
0
0
0
0
0.111111
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
1
0
1
0
0
0
0
4
a0a1fa54a786b9fc91ab128364242ee965176b25
6,684
py
Python
ooobuild/cssdyn/linguistic2/__init__.py
Amourspirit/ooo_uno_tmpl
64e0c86fd68f24794acc22d63d8d32ae05dd12b8
[ "Apache-2.0" ]
null
null
null
ooobuild/cssdyn/linguistic2/__init__.py
Amourspirit/ooo_uno_tmpl
64e0c86fd68f24794acc22d63d8d32ae05dd12b8
[ "Apache-2.0" ]
null
null
null
ooobuild/cssdyn/linguistic2/__init__.py
Amourspirit/ooo_uno_tmpl
64e0c86fd68f24794acc22d63d8d32ae05dd12b8
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http: // www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # from ...dyn.linguistic2.conversion_dictionary import ConversionDictionary as ConversionDictionary from ...dyn.linguistic2.conversion_dictionary_list import ConversionDictionaryList as ConversionDictionaryList from ...dyn.linguistic2.conversion_dictionary_type import ConversionDictionaryType as ConversionDictionaryType from ...dyn.linguistic2.conversion_dictionary_type import ConversionDictionaryTypeEnum as ConversionDictionaryTypeEnum from ...dyn.linguistic2.conversion_direction import ConversionDirection as ConversionDirection from ...dyn.linguistic2.conversion_property_type import ConversionPropertyType as ConversionPropertyType from ...dyn.linguistic2.conversion_property_type import ConversionPropertyTypeEnum as ConversionPropertyTypeEnum from ...dyn.linguistic2.dictionary import Dictionary as Dictionary from ...dyn.linguistic2.dictionary_event import DictionaryEvent as DictionaryEvent from ...dyn.linguistic2.dictionary_event_flags import DictionaryEventFlags as DictionaryEventFlags from ...dyn.linguistic2.dictionary_event_flags import DictionaryEventFlagsEnum as DictionaryEventFlagsEnum from ...dyn.linguistic2.dictionary_list import DictionaryList as DictionaryList from ...dyn.linguistic2.dictionary_list_event import DictionaryListEvent as DictionaryListEvent from ...dyn.linguistic2.dictionary_list_event_flags import DictionaryListEventFlags as DictionaryListEventFlags from ...dyn.linguistic2.dictionary_list_event_flags import DictionaryListEventFlagsEnum as DictionaryListEventFlagsEnum from ...dyn.linguistic2.dictionary_type import DictionaryType as DictionaryType from ...dyn.linguistic2.hangul_hanja_conversion_dictionary import HangulHanjaConversionDictionary as HangulHanjaConversionDictionary from ...dyn.linguistic2.hyphenator import Hyphenator as Hyphenator from ...dyn.linguistic2.language_guessing import LanguageGuessing as LanguageGuessing from ...dyn.linguistic2.lingu_properties import LinguProperties as LinguProperties from ...dyn.linguistic2.lingu_service_event import LinguServiceEvent as LinguServiceEvent from ...dyn.linguistic2.lingu_service_event_flags import LinguServiceEventFlags as LinguServiceEventFlags from ...dyn.linguistic2.lingu_service_event_flags import LinguServiceEventFlagsEnum as LinguServiceEventFlagsEnum from ...dyn.linguistic2.lingu_service_manager import LinguServiceManager as LinguServiceManager from ...dyn.linguistic2.number_text import NumberText as NumberText from ...dyn.linguistic2.proofreader import Proofreader as Proofreader from ...dyn.linguistic2.proofreading_iterator import ProofreadingIterator as ProofreadingIterator from ...dyn.linguistic2.proofreading_result import ProofreadingResult as ProofreadingResult from ...dyn.linguistic2.single_proofreading_error import SingleProofreadingError as SingleProofreadingError from ...dyn.linguistic2.spell_checker import SpellChecker as SpellChecker from ...dyn.linguistic2.spell_failure import SpellFailure as SpellFailure from ...dyn.linguistic2.spell_failure import SpellFailureEnum as SpellFailureEnum from ...dyn.linguistic2.thesaurus import Thesaurus as Thesaurus from ...dyn.linguistic2.x_available_locales import XAvailableLocales as XAvailableLocales from ...dyn.linguistic2.x_conversion_dictionary import XConversionDictionary as XConversionDictionary from ...dyn.linguistic2.x_conversion_dictionary_list import XConversionDictionaryList as XConversionDictionaryList from ...dyn.linguistic2.x_conversion_property_type import XConversionPropertyType as XConversionPropertyType from ...dyn.linguistic2.x_dictionary import XDictionary as XDictionary from ...dyn.linguistic2.x_dictionary1 import XDictionary1 as XDictionary1 from ...dyn.linguistic2.x_dictionary_entry import XDictionaryEntry as XDictionaryEntry from ...dyn.linguistic2.x_dictionary_event_listener import XDictionaryEventListener as XDictionaryEventListener from ...dyn.linguistic2.x_dictionary_list import XDictionaryList as XDictionaryList from ...dyn.linguistic2.x_dictionary_list_event_listener import XDictionaryListEventListener as XDictionaryListEventListener from ...dyn.linguistic2.x_hyphenated_word import XHyphenatedWord as XHyphenatedWord from ...dyn.linguistic2.x_hyphenator import XHyphenator as XHyphenator from ...dyn.linguistic2.x_language_guessing import XLanguageGuessing as XLanguageGuessing from ...dyn.linguistic2.x_lingu_properties import XLinguProperties as XLinguProperties from ...dyn.linguistic2.x_lingu_service_event_broadcaster import XLinguServiceEventBroadcaster as XLinguServiceEventBroadcaster from ...dyn.linguistic2.x_lingu_service_event_listener import XLinguServiceEventListener as XLinguServiceEventListener from ...dyn.linguistic2.x_lingu_service_manager import XLinguServiceManager as XLinguServiceManager from ...dyn.linguistic2.x_lingu_service_manager2 import XLinguServiceManager2 as XLinguServiceManager2 from ...dyn.linguistic2.x_meaning import XMeaning as XMeaning from ...dyn.linguistic2.x_number_text import XNumberText as XNumberText from ...dyn.linguistic2.x_possible_hyphens import XPossibleHyphens as XPossibleHyphens from ...dyn.linguistic2.x_proofreader import XProofreader as XProofreader from ...dyn.linguistic2.x_proofreading_iterator import XProofreadingIterator as XProofreadingIterator from ...dyn.linguistic2.x_searchable_dictionary import XSearchableDictionary as XSearchableDictionary from ...dyn.linguistic2.x_searchable_dictionary_list import XSearchableDictionaryList as XSearchableDictionaryList from ...dyn.linguistic2.x_set_spell_alternatives import XSetSpellAlternatives as XSetSpellAlternatives from ...dyn.linguistic2.x_spell_alternatives import XSpellAlternatives as XSpellAlternatives from ...dyn.linguistic2.x_spell_checker import XSpellChecker as XSpellChecker from ...dyn.linguistic2.x_spell_checker1 import XSpellChecker1 as XSpellChecker1 from ...dyn.linguistic2.x_supported_languages import XSupportedLanguages as XSupportedLanguages from ...dyn.linguistic2.x_supported_locales import XSupportedLocales as XSupportedLocales from ...dyn.linguistic2.x_thesaurus import XThesaurus as XThesaurus
81.512195
132
0.870437
736
6,684
7.740489
0.244565
0.079867
0.205371
0.106723
0.24627
0.169212
0.094085
0.033
0
0
0
0.013413
0.074207
6,684
81
133
82.518519
0.90724
0.086176
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
a0aa4b500f15e6ce29512e63a44c29a21eaf6811
606
py
Python
PyObjCTest/test_nswindowcontroller.py
linuxfood/pyobjc-framework-Cocoa-test
3475890f165ab26a740f13d5afe4c62b4423a140
[ "MIT" ]
null
null
null
PyObjCTest/test_nswindowcontroller.py
linuxfood/pyobjc-framework-Cocoa-test
3475890f165ab26a740f13d5afe4c62b4423a140
[ "MIT" ]
null
null
null
PyObjCTest/test_nswindowcontroller.py
linuxfood/pyobjc-framework-Cocoa-test
3475890f165ab26a740f13d5afe4c62b4423a140
[ "MIT" ]
null
null
null
import AppKit from PyObjCTools.TestSupport import TestCase class TestNSWindowController(TestCase): def testMethods(self): self.assertResultIsBOOL(AppKit.NSWindowController.shouldCascadeWindows) self.assertArgIsBOOL(AppKit.NSWindowController.setShouldCascadeWindows_, 0) self.assertArgIsBOOL(AppKit.NSWindowController.setDocumentEdited_, 0) self.assertResultIsBOOL(AppKit.NSWindowController.shouldCloseDocument) self.assertArgIsBOOL(AppKit.NSWindowController.setShouldCloseDocument_, 0) self.assertResultIsBOOL(AppKit.NSWindowController.isWindowLoaded)
46.615385
83
0.813531
46
606
10.652174
0.456522
0.293878
0.171429
0.281633
0.191837
0
0
0
0
0
0
0.005629
0.120462
606
12
84
50.5
0.913696
0
0
0
0
0
0
0
0
0
0
0
0.6
1
0.1
false
0
0.2
0
0.4
0
0
0
1
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
1
0
0
0
0
0
0
0
0
0
4
a0bd678bc56c2a61967b736e2c87d2f4a012231f
115
py
Python
pso/__init__.py
HawkTom/EAPY
c9dabbfb233f4a135bf9560bebcf6c01ec9baf94
[ "MIT" ]
2
2020-06-14T07:20:09.000Z
2021-11-20T17:29:03.000Z
pso/__init__.py
HawkTom/EAPY
c9dabbfb233f4a135bf9560bebcf6c01ec9baf94
[ "MIT" ]
null
null
null
pso/__init__.py
HawkTom/EAPY
c9dabbfb233f4a135bf9560bebcf6c01ec9baf94
[ "MIT" ]
null
null
null
from .wPSO import wPSO from .CLPSO import CLPSO from .ALCPSO import ALCPSO __all__ = ['wPSO', 'CLPSO', 'ALCPSO']
16.428571
37
0.713043
16
115
4.875
0.375
0
0
0
0
0
0
0
0
0
0
0
0.165217
115
6
38
19.166667
0.8125
0
0
0
0
0
0.131579
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
264c15739867c11d3d5c7accb232d80743abcf04
127
py
Python
meetup_6_Jun_2020/package_3/area.py
suratpug/spug
eb82942327e265748b153c2f914408454b9e861e
[ "MIT" ]
1
2020-05-09T17:15:41.000Z
2020-05-09T17:15:41.000Z
meetup_6_Jun_2020/package_3/area.py
suratpug/spug
eb82942327e265748b153c2f914408454b9e861e
[ "MIT" ]
null
null
null
meetup_6_Jun_2020/package_3/area.py
suratpug/spug
eb82942327e265748b153c2f914408454b9e861e
[ "MIT" ]
2
2020-05-11T05:00:44.000Z
2020-06-25T11:49:09.000Z
import math def area_circle(radius): return math.pi * (radius ** 2) def area_square(length): return length ** 2
14.111111
34
0.645669
18
127
4.444444
0.611111
0.175
0
0
0
0
0
0
0
0
0
0.020833
0.244094
127
8
35
15.875
0.8125
0
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.2
0.4
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
cd15ec1b88387583015b9eb4216176f02d3665cc
285
py
Python
scripts/portal/reundodraco.py
Snewmy/swordie
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
[ "MIT" ]
9
2021-04-26T11:59:29.000Z
2021-12-20T13:15:27.000Z
scripts/portal/reundodraco.py
Snewmy/swordie
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
[ "MIT" ]
null
null
null
scripts/portal/reundodraco.py
Snewmy/swordie
ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17
[ "MIT" ]
6
2021-07-14T06:32:05.000Z
2022-02-06T02:32:56.000Z
# Used to remove the Red Draco Morph Buff In Leafre : Station in case field/undomorphdarco.py fails from net.swordie.ms.client.character.skills.temp import CharacterTemporaryStat if sm.getnOptionByCTS(CharacterTemporaryStat.Morph) == 16: sm.removeCTS(CharacterTemporaryStat.Morph)
57
99
0.821053
37
285
6.324324
0.837838
0.230769
0
0
0
0
0
0
0
0
0
0.007843
0.105263
285
5
100
57
0.909804
0.340351
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
cd46d691d7bbd55d34897ad49ffde6194c8d7261
162
py
Python
coding_interviews/leetcode/easy/check_if_two_string_arrays_are_equivalent/check_if_two_string_arrays_are_equivalent.py
LeandroTk/Algorithms
569ed68eba3eeff902f8078992099c28ce4d7cd6
[ "MIT" ]
205
2018-12-01T17:49:49.000Z
2021-12-22T07:02:27.000Z
coding_interviews/leetcode/easy/check_if_two_string_arrays_are_equivalent/check_if_two_string_arrays_are_equivalent.py
LeandroTk/Algorithms
569ed68eba3eeff902f8078992099c28ce4d7cd6
[ "MIT" ]
2
2020-01-01T16:34:29.000Z
2020-04-26T19:11:13.000Z
coding_interviews/leetcode/easy/check_if_two_string_arrays_are_equivalent/check_if_two_string_arrays_are_equivalent.py
LeandroTk/Algorithms
569ed68eba3eeff902f8078992099c28ce4d7cd6
[ "MIT" ]
50
2018-11-28T20:51:36.000Z
2021-11-29T04:08:25.000Z
# https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent def array_strings_are_equal(word1, word2): return ''.join(word1) == ''.join(word2)
32.4
73
0.734568
23
162
5.043478
0.826087
0
0
0
0
0
0
0
0
0
0
0.027027
0.08642
162
5
74
32.4
0.756757
0.438272
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
cd49688f1ad05080b89d210262d41d9db4e05776
135
py
Python
model/recognition_model/GRCNN/utils/keys-Copy1.py
JinGyeSetBirdsFree/FudanOCR
e6b18b0eefaf832b2eb7198f5df79e00bd4cee36
[ "MIT" ]
25
2020-02-29T12:14:10.000Z
2020-04-24T07:56:06.000Z
model/recognition_model/GRCNN/utils/keys-Copy1.py
dun933/FudanOCR
fd79b679044ea23fd9eb30691453ed0805d2e98b
[ "MIT" ]
33
2020-12-10T19:15:39.000Z
2022-03-12T00:17:30.000Z
model/recognition_model/GRCNN/utils/keys-Copy1.py
dun933/FudanOCR
fd79b679044ea23fd9eb30691453ed0805d2e98b
[ "MIT" ]
4
2020-02-29T12:14:18.000Z
2020-04-12T12:26:50.000Z
#coding:UTF-8 #num = 94 alphabet = u'goespulitanywhNdcrkmf17:5LJIb.''90RGB(,v26FTxjMAC;WP3S4-HU!VDE>8OYQz%`?)KX/Z"$q@[]*|#&<}=+{_^\~'
33.75
110
0.644444
18
135
4.777778
1
0
0
0
0
0
0
0
0
0
0
0.102362
0.059259
135
3
111
45
0.574803
0.148148
0
0
0
0
0.823009
0.823009
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
cd6b0eb2fe4cb96c3e24dbf54a6a6da91939396c
57
py
Python
quorum/parse/__init__.py
LSaldyt/quorum
a9def89f8183e5307366f8ba1785e5ef55aeb1af
[ "MIT" ]
null
null
null
quorum/parse/__init__.py
LSaldyt/quorum
a9def89f8183e5307366f8ba1785e5ef55aeb1af
[ "MIT" ]
null
null
null
quorum/parse/__init__.py
LSaldyt/quorum
a9def89f8183e5307366f8ba1785e5ef55aeb1af
[ "MIT" ]
null
null
null
from .parse import parse_file, parse_text, parse_pattern
28.5
56
0.842105
9
57
5
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.105263
57
1
57
57
0.882353
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
cd783e7f99f42e4b0eb3d769ef3e8db1589a9dbb
748
py
Python
conftest.py
ropumar/maas-divide
7ef31e88d1371ba5b13498afb225911305287d29
[ "MIT" ]
null
null
null
conftest.py
ropumar/maas-divide
7ef31e88d1371ba5b13498afb225911305287d29
[ "MIT" ]
15
2019-05-27T17:21:48.000Z
2019-06-18T13:08:05.000Z
conftest.py
ropumar/maas-divide
7ef31e88d1371ba5b13498afb225911305287d29
[ "MIT" ]
1
2019-06-18T19:50:55.000Z
2019-06-18T19:50:55.000Z
import os os.environ["ENV"] = "TEST" os.environ["TEST_PLUS_SERVICE_ADDRESS"] = os.getenv( "TEST_PLUS_SERVICE_ADDRESS", "http://plus.service" ) os.environ["TEST_MINUS_SERVICE_ADDRESS"] = os.getenv( "TEST_MINUS_SERVICE_ADDRESS", "http://minus.service" ) os.environ["TEST_DIVIDE_SERVICE_ADDRESS"] = os.getenv( "TEST_DIVIDE_SERVICE_ADDRESS", "http://divide.service" ) os.environ["TEST_MULTIPLY_SERVICE_ADDRESS"] = os.getenv( "TEST_MULTIPLY_SERVICE_ADDRESS", "http://multiply.service" ) os.environ["TEST_POWER_SERVICE_ADDRESS"] = os.getenv( "TEST_POWER_SERVICE_ADDRESS", "http://power.service" ) os.environ["TEST_ASYNCWORKER_HTTP_PORT"] = os.getenv( "TEST_ASYNCWORKER_HTTP_PORT", "9999" ) assert os.environ["ENV"] == "TEST"
27.703704
62
0.739305
99
748
5.222222
0.181818
0.270793
0.15087
0.212766
0.251451
0
0
0
0
0
0
0.005935
0.09893
748
26
63
28.769231
0.761128
0
0
0
0
0
0.586898
0.425134
0
0
0
0
0.047619
1
0
true
0
0.047619
0
0.047619
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
cd96c99d42dafd2804a41bed2c184305a57529e3
18,087
py
Python
gexfpy/gexf.py
chunqishi/gexfpy
bcf8e2cc7bfa56682fc1296357bd7a28a1d0f97b
[ "MIT" ]
1
2022-03-12T15:30:11.000Z
2022-03-12T15:30:11.000Z
gexfpy/gexf.py
chunqishi/gexfpy
bcf8e2cc7bfa56682fc1296357bd7a28a1d0f97b
[ "MIT" ]
null
null
null
gexfpy/gexf.py
chunqishi/gexfpy
bcf8e2cc7bfa56682fc1296357bd7a28a1d0f97b
[ "MIT" ]
null
null
null
from dataclasses import dataclass, field from enum import Enum from typing import List, Optional from xsdata.models.datatype import XmlDate from dataclasses import dataclass, field from enum import Enum from typing import List, Optional, Union from xsdata.models.datatype import XmlDate, XmlDateTime __NAMESPACE__ = "http://www.gexf.net/1.2draft" from .datatypes import ( AttrtypeType, ModeType, EdgetypeType, DefaultedgetypeType, IdtypeType, GexfContentVersion ) from .dynamics import ( SpellsContent, TimeformatType, ) from .phylogenics import ParentsContent from .viz import ( ColorContent, EdgeShapeContent, NodeShapeContent, PositionContent, SizeContent, ThicknessContent, ) @dataclass class Attvalue: class Meta: name = "attvalue" namespace = "http://www.gexf.net/1.2draft" for_value: Optional[Union[str, int]] = field( default=None, metadata={ "name": "for", "type": "Attribute", "required": True, } ) value: Optional[str] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) start: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) startopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) end: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) endopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) class ClassType(Enum): NODE = "node" EDGE = "edge" @dataclass class Default: class Meta: name = "default" namespace = "http://www.gexf.net/1.2draft" value: str = field( default="", metadata={ "required": True, } ) @dataclass class Options: class Meta: name = "options" namespace = "http://www.gexf.net/1.2draft" value: str = field( default="", metadata={ "required": True, } ) @dataclass class AttributeContent: class Meta: name = "attribute-content" default: List[str] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) options: List[str] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) id: Optional[Union[str, int]] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) title: Optional[str] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) type: Optional[AttrtypeType] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) @dataclass class AttvaluesContent: class Meta: name = "attvalues-content" attvalue: List[Attvalue] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) @dataclass class Color(ColorContent): class Meta: name = "color" namespace = "http://www.gexf.net/1.2draft" @dataclass class Parents(ParentsContent): class Meta: name = "parents" namespace = "http://www.gexf.net/1.2draft" @dataclass class Position(PositionContent): class Meta: name = "position" namespace = "http://www.gexf.net/1.2draft" @dataclass class Size(SizeContent): class Meta: name = "size" namespace = "http://www.gexf.net/1.2draft" @dataclass class Spells(SpellsContent): class Meta: name = "spells" namespace = "http://www.gexf.net/1.2draft" @dataclass class Thickness(ThicknessContent): class Meta: name = "thickness" namespace = "http://www.gexf.net/1.2draft" @dataclass class Attribute(AttributeContent): class Meta: name = "attribute" namespace = "http://www.gexf.net/1.2draft" @dataclass class Attvalues(AttvaluesContent): class Meta: name = "attvalues" namespace = "http://www.gexf.net/1.2draft" @dataclass class AttributesContent: class Meta: name = "attributes-content" attribute: List[Attribute] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) class_value: Optional[ClassType] = field( default=None, metadata={ "name": "class", "type": "Attribute", "required": True, } ) mode: Optional[ModeType] = field( default=None, metadata={ "type": "Attribute", } ) start: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) startopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) end: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) endopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class EdgeContent: class Meta: name = "edge-content" attvalues: List[Attvalues] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) spells: List[Spells] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) color: List[Color] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) thickness: List[Thickness] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) shape: List[EdgeShapeContent] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) start: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) startopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) end: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) endopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) id: Optional[Union[str, int]] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) type: Optional[EdgetypeType] = field( default=None, metadata={ "type": "Attribute", } ) label: Optional[str] = field( default=None, metadata={ "type": "Attribute", } ) source: Optional[Union[str, int]] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) target: Optional[Union[str, int]] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) weight: Optional[float] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class NodeContent: class Meta: name = "node-content" attvalues: List[Attvalues] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) spells: List[Spells] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) nodes: List["Nodes"] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) edges: List["Edges"] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) parents: List[Parents] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) color: List[Color] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) position: List[Position] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) size: List[Size] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) shape: List[NodeShapeContent] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) start: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) startopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) end: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) endopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) pid: Optional[Union[str, int]] = field( default=None, metadata={ "type": "Attribute", } ) id: Optional[Union[str, int]] = field( default=None, metadata={ "type": "Attribute", "required": True, } ) label: Optional[str] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class Attributes(AttributesContent): class Meta: name = "attributes" namespace = "http://www.gexf.net/1.2draft" @dataclass class GraphContent: class Meta: name = "graph-content" attributes: List[Attributes] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) nodes: List["Nodes"] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) edges: List["Edges"] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) timeformat: Optional[TimeformatType] = field( default=None, metadata={ "type": "Attribute", } ) start: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) startopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) end: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) endopen: Optional[Union[int, float, XmlDate, XmlDateTime]] = field( default=None, metadata={ "type": "Attribute", } ) defaultedgetype: Optional[DefaultedgetypeType] = field( default=None, metadata={ "type": "Attribute", } ) idtype: Optional[IdtypeType] = field( default=None, metadata={ "type": "Attribute", } ) mode: Optional[ModeType] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class Creator: class Meta: name = "creator" namespace = "http://www.gexf.net/1.2draft" value: str = field( default="", metadata={ "required": True, } ) @dataclass class Description: class Meta: name = "description" namespace = "http://www.gexf.net/1.2draft" value: str = field( default="", metadata={ "required": True, } ) @dataclass class Keywords: class Meta: name = "keywords" namespace = "http://www.gexf.net/1.2draft" value: str = field( default="", metadata={ "required": True, } ) @dataclass class MetaContent: class Meta: name = "meta-content" creator: List[str] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) keywords: List[str] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) description: List[str] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) lastmodifieddate: Optional[XmlDate] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class Edge(EdgeContent): class Meta: name = "edge" namespace = "http://www.gexf.net/1.2draft" @dataclass class Graph(GraphContent): class Meta: name = "graph" namespace = "http://www.gexf.net/1.2draft" @dataclass class MetaType(MetaContent): class Meta: name = "meta" namespace = "http://www.gexf.net/1.2draft" @dataclass class Node(NodeContent): class Meta: name = "node" namespace = "http://www.gexf.net/1.2draft" @dataclass class EdgesContent: class Meta: name = "edges-content" edge: List[Edge] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) count: Optional[int] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class NodesContent: class Meta: name = "nodes-content" node: List[Node] = field( default_factory=list, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) count: Optional[int] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class Edges(EdgesContent): class Meta: name = "edges" namespace = "http://www.gexf.net/1.2draft" @dataclass class Nodes(NodesContent): class Meta: name = "nodes" namespace = "http://www.gexf.net/1.2draft" @dataclass class GexfContent: """ Tree. """ class Meta: name = "gexf-content" meta: Optional[MetaType] = field( default=None, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", } ) graph: Optional[Graph] = field( default=None, metadata={ "type": "Element", "namespace": "http://www.gexf.net/1.2draft", "required": True, } ) version: Optional[GexfContentVersion] = field( default=GexfContentVersion.VALUE_1_2, metadata={ "type": "Attribute", "required": True, } ) variant: Optional[str] = field( default=None, metadata={ "type": "Attribute", } ) @dataclass class Gexf(GexfContent): class Meta: name = "gexf" namespace = "http://www.gexf.net/1.2draft"
23.070153
74
0.493393
1,529
18,087
5.814258
0.072596
0.105287
0.091789
0.114736
0.818898
0.746344
0.725534
0.715411
0.690439
0.599438
0
0.009198
0.374855
18,087
783
75
23.099617
0.777041
0.000276
0
0.587302
0
0
0.17578
0
0
0
0
0
0
1
0
false
0
0.017316
0
0.226551
0
0
0
0
null
0
0
0
1
1
1
1
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
4
269a62c395580d53ce8447d0c2c362e82b05ba06
10,503
py
Python
tests/test_peewee.py
bouncyweirdo/architect
b4cbfcefb4757b5e3f276bb6156103d45da15ecf
[ "Apache-2.0" ]
352
2015-01-16T10:22:25.000Z
2022-02-25T04:19:13.000Z
tests/test_peewee.py
bouncyweirdo/architect
b4cbfcefb4757b5e3f276bb6156103d45da15ecf
[ "Apache-2.0" ]
76
2015-01-19T11:15:32.000Z
2021-12-09T15:35:47.000Z
tests/test_peewee.py
bouncyweirdo/architect
b4cbfcefb4757b5e3f276bb6156103d45da15ecf
[ "Apache-2.0" ]
72
2015-01-19T11:53:40.000Z
2022-03-14T16:09:00.000Z
""" Tests Peewee specific behaviour. """ import os import sys import datetime from . import unittest, capture if not os.environ.get('PEEWEE') or not os.environ.get('DB'): raise unittest.SkipTest('Not a Peewee build') from .models.peewee import * def setUpModule(): sys.argv = ['architect', 'partition', '--module', 'tests.models.peewee'] with capture() as (out, _): search = 'successfully (re)configured the database for the following models' assert search in out, '{0} not in {1}'.format(search, out) @unittest.skipUnless(os.environ['DB'] in ('sqlite', 'all'), 'Not a SQLite build') class SQLitePeeweePartitionTestCase(unittest.TestCase): def test_dummy(self): object1 = SqliteRangeDateDay.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(SqliteRangeDateDay.raw('SELECT * FROM TEST_rangedateday WHERE id = ?', object1.id))[0] self.assertTrue(object1.name, object2.name) @unittest.skipUnless(os.environ['DB'] in ('pgsql', 'all'), 'Not a PostgreSQL build') class PostgresqlPeeweePartitionTestCase(unittest.TestCase): def test_range_date_day(self): object1 = PgsqlRangeDateDay.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(PgsqlRangeDateDay.raw('SELECT * FROM TEST_rangedateday_y2014d105 WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_day_null(self): object1 = PgsqlRangeDateDay.create(name='foo') object2 = list(PgsqlRangeDateDay.raw('SELECT * FROM TEST_rangedateday_null WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_week(self): object1 = PgsqlRangeDateWeek.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(PgsqlRangeDateWeek.raw('SELECT * FROM TEST_rangedateweek_y2014w16 WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_week_null(self): object1 = PgsqlRangeDateWeek.create(name='foo') object2 = list(PgsqlRangeDateWeek.raw('SELECT * FROM TEST_rangedateweek_null WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_month(self): object1 = PgsqlRangeDateMonth.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(PgsqlRangeDateMonth.raw( 'SELECT * FROM TEST_rangedatemonth_y2014m04 WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_month_null(self): object1 = PgsqlRangeDateMonth.create(name='foo') object2 = list(PgsqlRangeDateMonth.raw('SELECT * FROM TEST_rangedatemonth_null WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_year(self): object1 = PgsqlRangeDateYear.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(PgsqlRangeDateYear.raw('SELECT * FROM TEST_rangedateyear_y2014 WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_year_null(self): object1 = PgsqlRangeDateYear.create(name='foo') object2 = list(PgsqlRangeDateYear.raw('SELECT * FROM TEST_rangedateyear_null WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_integer_positive(self): object1 = PgsqlRangeInteger2.create(name='foo', num=3) object2 = list(PgsqlRangeInteger2.raw('SELECT * FROM TEST_rangeinteger2_3_4 WHERE id = %s', object1.id))[0] object3 = PgsqlRangeInteger5.create(name='foo', num=3) object4 = list(PgsqlRangeInteger5.raw('SELECT * FROM TEST_rangeinteger5_1_5 WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_integer_zero(self): object1 = PgsqlRangeInteger2.create(name='foo', num=0) object2 = list(PgsqlRangeInteger2.raw('SELECT * FROM TEST_rangeinteger2_0 WHERE id = %s', object1.id))[0] object3 = PgsqlRangeInteger5.create(name='foo', num=0) object4 = list(PgsqlRangeInteger5.raw('SELECT * FROM TEST_rangeinteger5_0 WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_integer_negative(self): object1 = PgsqlRangeInteger2.create(name='foo', num=-3) object2 = list(PgsqlRangeInteger2.raw('SELECT * FROM TEST_rangeinteger2_m4_m3 WHERE id = %s', object1.id))[0] object3 = PgsqlRangeInteger5.create(name='foo', num=-3) object4 = list(PgsqlRangeInteger5.raw('SELECT * FROM TEST_rangeinteger5_m5_m1 WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_integer_null(self): object1 = PgsqlRangeInteger2.create(name='foo') object2 = list(PgsqlRangeInteger2.raw('SELECT * FROM TEST_rangeinteger2_null WHERE id = %s', object1.id))[0] object3 = PgsqlRangeInteger5.create(name='foo') object4 = list(PgsqlRangeInteger5.raw('SELECT * FROM TEST_rangeinteger5_null WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_string_firstchars(self): object1 = PgsqlRangeStringFirstchars2.create(name='foo', title='abcdef') object2 = list(PgsqlRangeStringFirstchars2.raw( 'SELECT * FROM "TEST_rangestring_firstchars2_ab" WHERE id = %s', object1.id))[0] object3 = PgsqlRangeStringFirstchars5.create(name='foo', title='abcdef') object4 = list(PgsqlRangeStringFirstchars5.raw( 'SELECT * FROM "TEST_rangestring_firstchars5_abcde" WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_string_firstchars_special_characters(self): object1 = PgsqlRangeStringFirstchars2.create(name='foo', title=';<abcdef') object2 = list(PgsqlRangeStringFirstchars2.raw( 'SELECT * FROM "TEST_rangestring_firstchars2_;<" WHERE id = %s', object1.id))[0] object3 = PgsqlRangeStringFirstchars5.create(name='foo', title='ab;<cdef') object4 = list(PgsqlRangeStringFirstchars5.raw( 'SELECT * FROM "TEST_rangestring_firstchars5_ab;<c" WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_string_firstchars_null(self): object1 = PgsqlRangeStringFirstchars2.create(name='foo') object2 = list(PgsqlRangeStringFirstchars2.raw( 'SELECT * FROM TEST_rangestring_firstchars2_null WHERE id = %s', object1.id))[0] object3 = PgsqlRangeStringFirstchars5.create(name='foo') object4 = list(PgsqlRangeStringFirstchars5.raw( 'SELECT * FROM TEST_rangestring_firstchars5_null WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_string_lastchars(self): object1 = PgsqlRangeStringLastchars2.create(name='foo', title='abcdef') object2 = list(PgsqlRangeStringLastchars2.raw( 'SELECT * FROM "TEST_rangestring_lastchars2_ef" WHERE id = %s', object1.id))[0] object3 = PgsqlRangeStringLastchars5.create(name='foo', title='abcdef') object4 = list(PgsqlRangeStringLastchars5.raw( 'SELECT * FROM "TEST_rangestring_lastchars5_bcdef" WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_string_lastchars_special_characters(self): object1 = PgsqlRangeStringLastchars2.create(name='foo', title='abcd;<') object2 = list(PgsqlRangeStringLastchars2.raw( 'SELECT * FROM "TEST_rangestring_lastchars2_;<" WHERE id = %s', object1.id))[0] object3 = PgsqlRangeStringLastchars5.create(name='foo', title='abcd;<') object4 = list(PgsqlRangeStringLastchars5.raw( 'SELECT * FROM "TEST_rangestring_lastchars5_bcd;<" WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) def test_range_string_lastchars_null(self): object1 = PgsqlRangeStringLastchars2.create(name='foo') object2 = list(PgsqlRangeStringLastchars2.raw( 'SELECT * FROM TEST_rangestring_lastchars2_null WHERE id = %s', object1.id))[0] object3 = PgsqlRangeStringLastchars5.create(name='foo') object4 = list(PgsqlRangeStringLastchars5.raw( 'SELECT * FROM TEST_rangestring_lastchars5_null WHERE id = %s', object3.id))[0] self.assertTrue(object1.name, object2.name) self.assertTrue(object3.name, object4.name) @unittest.skipUnless(os.environ['DB'] in ('mysql', 'all'), 'Not a MySQL build') class MysqlPeeweePartitionTestCase(unittest.TestCase): def test_range_date_day(self): object1 = MysqlRangeDateDay.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(MysqlRangeDateDay.raw('SELECT * FROM TEST_rangedateday WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_week(self): object1 = MysqlRangeDateWeek.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(MysqlRangeDateWeek.raw('SELECT * FROM TEST_rangedateweek WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_month(self): object1 = MysqlRangeDateMonth.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(MysqlRangeDateMonth.raw('SELECT * FROM TEST_rangedatemonth WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name) def test_range_date_year(self): object1 = MysqlRangeDateYear.create(name='foo', created=datetime.datetime(2014, 4, 15, 18, 44, 23)) object2 = list(MysqlRangeDateYear.raw('SELECT * FROM TEST_rangedateyear WHERE id = %s', object1.id))[0] self.assertTrue(object1.name, object2.name)
49.542453
120
0.69761
1,243
10,503
5.769912
0.11424
0.046012
0.059816
0.078221
0.872839
0.857362
0.799637
0.757808
0.663553
0.538622
0
0.048198
0.178235
10,503
211
121
49.777251
0.78276
0.003047
0
0.346405
0
0
0.208258
0.070534
0
0
0
0
0.222222
1
0.156863
false
0
0.03268
0
0.20915
0
0
0
0
null
0
0
0
1
1
1
1
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
4
26a121359d1c4414421afc76f76006ac6dce2063
858
py
Python
sysdfiles/__init__.py
ghuband/sysdfiles
eb13167b07b27351c3962a42b30dcd50ce551d71
[ "MIT" ]
null
null
null
sysdfiles/__init__.py
ghuband/sysdfiles
eb13167b07b27351c3962a42b30dcd50ce551d71
[ "MIT" ]
1
2020-06-05T20:58:05.000Z
2020-06-05T20:58:05.000Z
sysdfiles/__init__.py
ghuband/sysdfiles
eb13167b07b27351c3962a42b30dcd50ce551d71
[ "MIT" ]
1
2020-06-09T02:35:35.000Z
2020-06-09T02:35:35.000Z
from .automount_file import AutomountFile from .conf_file import ConfFile from .device_file import DeviceFile from .hostname_file import HostnameFile from .hosts_file import HostsFile, HostsLine from .ini_file import IniFile, IniLine, IniProperty from .link_file import LinkFile from .machine_id_file import MachineIdFile from .machine_info_file import MachineInfoFile from .mount_file import MountFile from .network_file import NetworkFile from .os_release_file import OSReleaseFile from .path_file import PathFile from .scope_file import ScopeFile from .service_file import ServiceFile from .slice_file import SliceFile from .socket_file import SocketFile from .swap_file import SwapFile from .target_file import TargetFile from .timer_file import TimerFile from .unit_file import UnitFile from .value_file import ValueFile from .vars_file import VarsFile
35.75
51
0.858974
121
858
5.876033
0.446281
0.323488
0
0
0
0
0
0
0
0
0
0
0.110723
858
23
52
37.304348
0.931848
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
26d36dc0d96b4d160e144a196767d04d9e726b0a
334
py
Python
organizational_area/apps.py
mspasiano/uniTicket
1e8e4c2274293e751deea5b8b1fb4116136c5641
[ "Apache-2.0" ]
null
null
null
organizational_area/apps.py
mspasiano/uniTicket
1e8e4c2274293e751deea5b8b1fb4116136c5641
[ "Apache-2.0" ]
null
null
null
organizational_area/apps.py
mspasiano/uniTicket
1e8e4c2274293e751deea5b8b1fb4116136c5641
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig # from django.utils.translation import gettext as _ class OrganizationalAreaConfig(AppConfig): name = 'organizational_area' verbose_name = 'Organizational Area' # verbose_name = _('Organizational Area') def ready(self): # Signals import organizational_area.signals
25.692308
51
0.730539
34
334
7
0.558824
0.302521
0.277311
0.243697
0.336134
0.336134
0.336134
0
0
0
0
0
0.197605
334
12
52
27.833333
0.88806
0.290419
0
0
0
0
0.16309
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
f81cd4f8cf5db9a4d1579cd518c56003d4a74366
152
py
Python
cry/simple-conversion/file/convert.py
wani-hackase/wanictf21spring-writeup
f5a8c84a1dd887a9cad49a9946b9b7aea512bcab
[ "MIT" ]
14
2021-05-02T11:10:44.000Z
2021-05-23T05:33:07.000Z
cry/simple-conversion/src/convert.py
wani-hackase/wanictf21spring-writeup
f5a8c84a1dd887a9cad49a9946b9b7aea512bcab
[ "MIT" ]
null
null
null
cry/simple-conversion/src/convert.py
wani-hackase/wanictf21spring-writeup
f5a8c84a1dd887a9cad49a9946b9b7aea512bcab
[ "MIT" ]
3
2021-05-15T07:15:20.000Z
2021-11-04T04:52:14.000Z
from const import flag def bytes_to_integer(x: bytes) -> int: x = int.from_bytes(x, byteorder="big") return x print(bytes_to_integer(flag))
15.2
42
0.697368
25
152
4.04
0.56
0.138614
0.277228
0
0
0
0
0
0
0
0
0
0.184211
152
9
43
16.888889
0.814516
0
0
0
0
0
0.019737
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0.2
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
f838ef6834ce2ebef76fdd3715979ed969761041
1,458
py
Python
src/decorators.py
dzil123/discord_bot
8b111a1990eeadb31d752273cf51a0ac2758c6df
[ "MIT" ]
null
null
null
src/decorators.py
dzil123/discord_bot
8b111a1990eeadb31d752273cf51a0ac2758c6df
[ "MIT" ]
null
null
null
src/decorators.py
dzil123/discord_bot
8b111a1990eeadb31d752273cf51a0ac2758c6df
[ "MIT" ]
null
null
null
import collections import functools def default_get_id(func): def _getattr(attr): return getattr(func, attr, None) return _getattr("__module__"), _getattr("__qualname__") class DictDiffKey(collections.UserDict): @staticmethod def get_id(key): # Override me return key def __getitem__(self, key): return self.data[self.get_id(key)] def __setitem__(self, key, item): self.data[self.get_id(key)] = item def __delitem__(self, key): del self.data[self.get_id(key)] def __contains__(self, key): return self.get_id(key) in self.data class MethodMarker(DictDiffKey): def __init__(self, get_id=default_get_id, params=True): super().__init__() self.get_id = get_id self.params = params def __call__(self, *args, second_call=False, **kargs): if self.params and not second_call: return functools.partial(self, *args, **kargs, second_call=True) func = args[-1] self[func] = (func, args[:-1], kargs) return func # So it's actually a null decorator def resolve(self, obj): methods = [] for key, item in self.data.items(): func = getattr(obj, item[0].__name__) # todo, use types.methodtype if self.get_id(func) != key: continue methods.append((func, item[1], item[2])) return methods decorate = MethodMarker()
25.137931
79
0.616598
186
1,458
4.516129
0.360215
0.065476
0.075
0.057143
0.078571
0.078571
0.054762
0
0
0
0
0.004682
0.26749
1,458
57
80
25.578947
0.781835
0.049383
0
0
0
0
0.015919
0
0
0
0
0.017544
0
1
0.263158
false
0
0.052632
0.105263
0.578947
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
1
1
0
0
4
f8bff48559887fac2bca68a407d4b56b7fc0ea0a
100
py
Python
main/settings/__init__.py
patcurry/spatialdatahub.org
dcf9820c35d79fc03338cc99b71bd72f9df7243e
[ "MIT" ]
1
2021-07-03T17:03:35.000Z
2021-07-03T17:03:35.000Z
main/settings/__init__.py
patcurry/spatialdatahub.org
dcf9820c35d79fc03338cc99b71bd72f9df7243e
[ "MIT" ]
2
2019-02-22T07:37:10.000Z
2019-02-22T08:22:21.000Z
main/settings/__init__.py
patcurry/spatialdatahub.org
dcf9820c35d79fc03338cc99b71bd72f9df7243e
[ "MIT" ]
3
2019-01-29T08:50:55.000Z
2022-02-16T07:17:50.000Z
# spatialdatahub.org/main/settings/__init__.py try: from .production import * except: pass
12.5
46
0.72
12
100
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.18
100
7
47
14.285714
0.829268
0.44
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.25
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
3e12f0f66332fe0adb3d41db8954e34e83fa1594
288
py
Python
models/2-Gleb/train/src/__init__.py
navekshasood/HuBMAP---Hacking-the-Kidney
018100fe4bfa5e8764b9df5a9d188e2c670ac061
[ "MIT" ]
null
null
null
models/2-Gleb/train/src/__init__.py
navekshasood/HuBMAP---Hacking-the-Kidney
018100fe4bfa5e8764b9df5a9d188e2c670ac061
[ "MIT" ]
null
null
null
models/2-Gleb/train/src/__init__.py
navekshasood/HuBMAP---Hacking-the-Kidney
018100fe4bfa5e8764b9df5a9d188e2c670ac061
[ "MIT" ]
null
null
null
from . import augs from . import config from . import data from . import logger from . import main from . import model from . import postprocessing from . import preprocessing from . import rle2tiff from . import utils from . import sampler from . import train from . import visualizers
19.2
28
0.770833
39
288
5.692308
0.384615
0.585586
0
0
0
0
0
0
0
0
0
0.004255
0.184028
288
14
29
20.571429
0.940426
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
3e1aece284fc7755e8e58ad0c223ec960c22f21f
200
py
Python
user_login.py
zoenggamming/BIT-srun-login-script
3104bcaf688868af8528523297d97a32bac2ee38
[ "MIT" ]
null
null
null
user_login.py
zoenggamming/BIT-srun-login-script
3104bcaf688868af8528523297d97a32bac2ee38
[ "MIT" ]
null
null
null
user_login.py
zoenggamming/BIT-srun-login-script
3104bcaf688868af8528523297d97a32bac2ee38
[ "MIT" ]
null
null
null
import os import getpass def input_password(): passwd = getpass.getpass("Passord Plz~ : ") return passwd def input_username(): username = input("username Plz~ : ") return username
16.666667
47
0.675
23
200
5.782609
0.478261
0.120301
0
0
0
0
0
0
0
0
0
0
0.22
200
11
48
18.181818
0.852564
0
0
0
0
0
0.155779
0
0
0
0
0
0
1
0.25
false
0.5
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
3e3168f221a5b09422e8127fa704cc0f0b0fa786
120
py
Python
tests/base/test_sample.py
ivo-bass/iCook
c45f97ac3d8da0c52ccd85ecac0bab51bc4c8048
[ "MIT" ]
1
2021-08-05T07:15:59.000Z
2021-08-05T07:15:59.000Z
tests/base/test_sample.py
ivo-bass/iCook
c45f97ac3d8da0c52ccd85ecac0bab51bc4c8048
[ "MIT" ]
null
null
null
tests/base/test_sample.py
ivo-bass/iCook
c45f97ac3d8da0c52ccd85ecac0bab51bc4c8048
[ "MIT" ]
null
null
null
from django.test import TestCase class SampleTest(TestCase): def test_sample(self): self.assertTrue(True)
17.142857
32
0.725
15
120
5.733333
0.8
0
0
0
0
0
0
0
0
0
0
0
0.191667
120
6
33
20
0.886598
0
0
0
0
0
0
0
0
0
0
0
0.25
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
3e35cc06b106fe63ba25e672a3b68f8f68be1a51
186
py
Python
Python/email/MyQr.py
LeishenKOBE/good-good-study
ac6b859f53b8b95f0746f35c5278009a5cad40a8
[ "MIT" ]
null
null
null
Python/email/MyQr.py
LeishenKOBE/good-good-study
ac6b859f53b8b95f0746f35c5278009a5cad40a8
[ "MIT" ]
null
null
null
Python/email/MyQr.py
LeishenKOBE/good-good-study
ac6b859f53b8b95f0746f35c5278009a5cad40a8
[ "MIT" ]
null
null
null
from MyQR import myqr myqr.run(words="http://weixin.qq.com/r/kzlje9TEE4lsrZAY92yB", version=5, level='H', colorized=True, contrast=1.0, brightness=1.0, save_name='Python.png')
37.2
100
0.715054
29
186
4.551724
0.862069
0.030303
0
0
0
0
0
0
0
0
0
0.054545
0.112903
186
4
101
46.5
0.745455
0
0
0
0
0
0.290323
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
3e62e7545da2b22d7f83b925e574984d4dcb2695
707
py
Python
comps/views/__init__.py
dlanghorne0428/dancesport-tracker-projec
e55d91a4f03c26d6ee8c28846a809064adfdb158
[ "MIT" ]
null
null
null
comps/views/__init__.py
dlanghorne0428/dancesport-tracker-projec
e55d91a4f03c26d6ee8c28846a809064adfdb158
[ "MIT" ]
87
2020-04-15T22:29:03.000Z
2022-01-02T02:21:28.000Z
comps/views/__init__.py
dlanghorne0428/dancesport-tracker-projec
e55d91a4f03c26d6ee8c28846a809064adfdb158
[ "MIT" ]
null
null
null
from .all_comps import * from .clear_comp import * from .combine_heats import * from .comp_detail import * from .comp_heats import * from .create_comp import * from .create_heat import * from .couples import * from .couple_heats import * from .dancers import * from .dancer_heats import * from .edit_comp import * from .edit_heat import * from .edit_heat_entry import * from .fix_couple_type import * from .fix_dup_entries import * from .fix_null_entries import * from .heat import * from .heatlist_error_crud import * from .load_dancers import * from .load_heats import * from .load_scoresheets import * from .resolve_dancers import * from .resolve_mismatches import * from .scoresheet_error_crud import *
27.192308
36
0.787836
103
707
5.135922
0.291262
0.453686
0.141777
0.068053
0
0
0
0
0
0
0
0
0.141443
707
25
37
28.28
0.871499
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
3e741b32eed2e3fcc02bcd83801d7055120ccb55
126
py
Python
vsmlib/benchmarks/__init__.py
berntham/vsmlib
b2ed762ff50b5dcdd6999ad75c205557e70c6598
[ "Apache-2.0" ]
16
2017-01-04T05:18:42.000Z
2021-08-08T09:31:08.000Z
vsmlib/benchmarks/__init__.py
berntham/vsmlib
b2ed762ff50b5dcdd6999ad75c205557e70c6598
[ "Apache-2.0" ]
8
2017-07-01T04:23:53.000Z
2019-01-04T04:03:45.000Z
vsmlib/benchmarks/__init__.py
berntham/vsmlib
b2ed762ff50b5dcdd6999ad75c205557e70c6598
[ "Apache-2.0" ]
2
2017-10-31T02:21:08.000Z
2021-01-07T00:03:23.000Z
"""Collection of benchmarks and downstream tasks on embeddings .. autosummary:: :toctree: _autosummary analogy """
14
62
0.706349
12
126
7.333333
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.198413
126
8
63
15.75
0.871287
0.928571
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
e49722ade363419b822d618dd8034902174bc3d4
653
py
Python
travello/migrations/0004_auto_20210520_1013.py
harshavardhan26082001/First
cc0e9b743b3f73322af93997901c3c24265ec870
[ "BSD-3-Clause" ]
1
2022-02-09T12:11:07.000Z
2022-02-09T12:11:07.000Z
travello/migrations/0004_auto_20210520_1013.py
harshavardhan26082001/MovieApp
cc0e9b743b3f73322af93997901c3c24265ec870
[ "BSD-3-Clause" ]
null
null
null
travello/migrations/0004_auto_20210520_1013.py
harshavardhan26082001/MovieApp
cc0e9b743b3f73322af93997901c3c24265ec870
[ "BSD-3-Clause" ]
null
null
null
# Generated by Django 3.2.3 on 2021-05-20 10:13 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('travello', '0003_auto_20210520_1013'), ] operations = [ migrations.RemoveField( model_name='destination', name='desc', ), migrations.RemoveField( model_name='destination', name='image', ), migrations.RemoveField( model_name='destination', name='offer', ), migrations.RemoveField( model_name='destination', name='price', ), ]
21.766667
48
0.537519
56
653
6.142857
0.571429
0.244186
0.302326
0.348837
0.523256
0.523256
0
0
0
0
0
0.073113
0.350689
653
29
49
22.517241
0.738208
0.068913
0
0.521739
1
0
0.155116
0.037954
0
0
0
0
0
1
0
false
0
0.043478
0
0.173913
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
e4afb56165f451757857381bd0f0c7968b96ea52
154
py
Python
reddit2telegram/channels/~inactive/completeanarchy_tg/app.py
mainyordle/reddit2telegram
1163e15aed3b6ff0fba65b222d3d9798f644c386
[ "MIT" ]
187
2016-09-20T09:15:54.000Z
2022-03-29T12:22:33.000Z
reddit2telegram/channels/~inactive/completeanarchy_tg/app.py
mainyordle/reddit2telegram
1163e15aed3b6ff0fba65b222d3d9798f644c386
[ "MIT" ]
84
2016-09-22T14:25:07.000Z
2022-03-19T01:26:17.000Z
reddit2telegram/channels/~inactive/completeanarchy_tg/app.py
mainyordle/reddit2telegram
1163e15aed3b6ff0fba65b222d3d9798f644c386
[ "MIT" ]
172
2016-09-21T15:39:39.000Z
2022-03-16T15:15:58.000Z
#encoding:utf-8 subreddit = 'completeanarchy' t_channel = '@completeanarchy_tg' def send_post(submission, r2t): return r2t.send_simple(submission)
17.111111
38
0.766234
19
154
6
0.789474
0
0
0
0
0
0
0
0
0
0
0.022222
0.123377
154
8
39
19.25
0.822222
0.090909
0
0
0
0
0.244604
0
0
0
0
0
0
1
0.25
false
0
0
0.25
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
4
e4b2500ab4cad0519650b7ab648791cfdc41f186
220
py
Python
utils/date_utils.py
Rudi9719/booksearch-web
c48300e04ebdf2f01a990c67d4ff63d282da8168
[ "Apache-2.0" ]
null
null
null
utils/date_utils.py
Rudi9719/booksearch-web
c48300e04ebdf2f01a990c67d4ff63d282da8168
[ "Apache-2.0" ]
null
null
null
utils/date_utils.py
Rudi9719/booksearch-web
c48300e04ebdf2f01a990c67d4ff63d282da8168
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python import datetime def parse_date_string(date_string): date = None try: date = datetime.datetime.strptime(date_string, "%Y-%m-%d").date() except: pass return date
13.75
73
0.622727
29
220
4.586207
0.655172
0.225564
0.210526
0
0
0
0
0
0
0
0
0
0.254545
220
15
74
14.666667
0.810976
0.090909
0
0
0
0
0.040201
0
0
0
0
0
0
1
0.125
false
0.125
0.125
0
0.375
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
e4c3b3833f16a13091acc6ed4687f86ccd43695c
488
py
Python
agent/views.py
kinnevo/kic_alone
7b0964b4438d35ac5caa9bf6d716abead91e3aea
[ "MIT" ]
null
null
null
agent/views.py
kinnevo/kic_alone
7b0964b4438d35ac5caa9bf6d716abead91e3aea
[ "MIT" ]
null
null
null
agent/views.py
kinnevo/kic_alone
7b0964b4438d35ac5caa9bf6d716abead91e3aea
[ "MIT" ]
null
null
null
__author__ = 'jorgezavala' from django.http import HttpResponse from django.shortcuts import render def index1(request): return HttpResponse("The top level.") def home(request): return render(request, 'home.html', {'ideas': 'ideas' }, content_type='text/html') def blog(request): return render(request, 'blog.html', {'ideas': 'ideas'}, content_type='text/html') def blog1(request): return render(request, 'blog1.html', {'ideas': 'ideas'}, content_type='text/html')
25.684211
86
0.704918
62
488
5.435484
0.387097
0.154303
0.169139
0.231454
0.311573
0.311573
0.311573
0.21365
0
0
0
0.007092
0.133197
488
18
87
27.111111
0.789598
0
0
0
0
0
0.22541
0
0
0
0
0
0
1
0.363636
false
0
0.181818
0.363636
0.909091
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
e4d1877fb3969393f2e0883cb2193316ba282854
1,180
py
Python
Medium/1689.PartitioningIntoMinimumNumberOfDeci-BinaryNumbers.py
YuriSpiridonov/LeetCode
2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781
[ "MIT" ]
39
2020-07-04T11:15:13.000Z
2022-02-04T22:33:42.000Z
Medium/1689.PartitioningIntoMinimumNumberOfDeci-BinaryNumbers.py
YuriSpiridonov/LeetCode
2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781
[ "MIT" ]
1
2020-07-15T11:53:37.000Z
2020-07-15T11:53:37.000Z
Medium/1689.PartitioningIntoMinimumNumberOfDeci-BinaryNumbers.py
YuriSpiridonov/LeetCode
2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781
[ "MIT" ]
20
2020-07-14T19:12:53.000Z
2022-03-02T06:28:17.000Z
''' A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not. Given a string n that represents a positive decimal integer, return the minimum number of positive deci-binary numbers needed so that they sum up to n. Example: Input: n = "32" Output: 3 Explanation: 10 + 11 + 11 = 32 Example: Input: n = "82734" Output: 8 Example: Input: n = "27346209830709182346" Output: 9 Constraints: - 1 <= n.length <= 10^5 - n consists of only digits. - n does not contain any leading zeros and represents a positive integer. ''' #Difficulty: Medium #94 / 94 test cases passed. #Runtime: 64 ms #Memory Usage: 14.7 MB #Runtime: 64 ms, faster than 50.00% of Python3 online submissions for Partitioning Into Minimum Number Of Deci-Binary Numbers. #Memory Usage: 14.7 MB, less than 25.00% of Python3 online submissions for Partitioning Into Minimum Number Of Deci-Binary Numbers. class Solution: def minPartitions(self, n: str) -> int: return max(n)
28.780488
131
0.666949
176
1,180
4.471591
0.556818
0.063532
0.057179
0.035578
0.241423
0.200762
0.200762
0.200762
0.200762
0.200762
0
0.094145
0.261864
1,180
40
132
29.5
0.809414
0.837288
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
1
0
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
1
0
0
0
1
1
0
0
4
e4d524afb0ace299791c5ad02e24dcdc1e9c5aa0
978
py
Python
models/user.py
ranusingh1993/flask_restfull
c318f7061f82e2687ec3b60ef7fa14d3a764d6c7
[ "MIT" ]
null
null
null
models/user.py
ranusingh1993/flask_restfull
c318f7061f82e2687ec3b60ef7fa14d3a764d6c7
[ "MIT" ]
null
null
null
models/user.py
ranusingh1993/flask_restfull
c318f7061f82e2687ec3b60ef7fa14d3a764d6c7
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Tue Jan 25 14:11:24 2022 @author: ranusingh1993 """ import mysql.connector from db import db class UserModel(db.Model): __tablename__='users' id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80)) password = db.Column(db.String(80)) def __init__(self,username,password): self.username = username self.password = password def save_to_db(self): db.session.add(self) db.session.commit() def json(self): return{"id" : self.id, "username":self.username, } def delete_from_db(self): db.session.delete(self) db.session.commit() @classmethod def find_user_by_username(cls,username): return cls.query.filter_by(username=username).first() @classmethod def find_user_by_id(cls,_id): return cls.query.filter_by(id=_id).first()
23.285714
61
0.605317
124
978
4.58871
0.427419
0.042179
0.091388
0.056239
0.224956
0
0
0
0
0
0
0.029494
0.271984
978
41
62
23.853659
0.769663
0.083845
0
0.153846
0
0
0.016892
0
0
0
0
0
0
1
0.230769
false
0.115385
0.076923
0.115385
0.576923
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
e4f93863d31404c478cc73dd51c0b25a711a88da
141
py
Python
django_netjsongraph/management/commands/save_snapshot.py
r14r/Django_App-D3_NetJSONGraph
cf3d75fcb2438716e207e1b9c759429661a4659e
[ "MIT" ]
80
2017-03-22T13:45:48.000Z
2019-05-05T02:35:31.000Z
django_netjsongraph/management/commands/save_snapshot.py
r14r/Django_App-D3_NetJSONGraph
cf3d75fcb2438716e207e1b9c759429661a4659e
[ "MIT" ]
79
2017-03-22T16:42:14.000Z
2019-04-25T22:39:44.000Z
django_netjsongraph/management/commands/save_snapshot.py
r14r/Django_App-D3_NetJSONGraph
cf3d75fcb2438716e207e1b9c759429661a4659e
[ "MIT" ]
53
2017-03-20T22:20:59.000Z
2019-04-12T22:26:49.000Z
from ...models import Topology from . import BaseSaveSnapshotCommand class Command(BaseSaveSnapshotCommand): topology_model = Topology
20.142857
39
0.808511
13
141
8.692308
0.615385
0
0
0
0
0
0
0
0
0
0
0
0.134752
141
6
40
23.5
0.92623
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
e4fc3aeff396ca80badb3e7be530d301b6661884
95
py
Python
clustering/apps.py
nearj/UOS_2019_crime_graph_analysis
6e5b373fd78eb38e0cf2dbe4584b36fa57eed667
[ "MIT" ]
null
null
null
clustering/apps.py
nearj/UOS_2019_crime_graph_analysis
6e5b373fd78eb38e0cf2dbe4584b36fa57eed667
[ "MIT" ]
null
null
null
clustering/apps.py
nearj/UOS_2019_crime_graph_analysis
6e5b373fd78eb38e0cf2dbe4584b36fa57eed667
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ClusteringConfig(AppConfig): name = 'clustering'
15.833333
34
0.768421
10
95
7.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.157895
95
5
35
19
0.9125
0
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
9045789f18e3881c0a25a1d37ac87d867e1b6f8a
1,717
py
Python
yb_enigma/__init__.py
YuriyBl/yb-enigma
0220490830361c6490a4d7fde8eb1aac7660dc34
[ "MIT" ]
null
null
null
yb_enigma/__init__.py
YuriyBl/yb-enigma
0220490830361c6490a4d7fde8eb1aac7660dc34
[ "MIT" ]
null
null
null
yb_enigma/__init__.py
YuriyBl/yb-enigma
0220490830361c6490a4d7fde8eb1aac7660dc34
[ "MIT" ]
null
null
null
""" Enigma emulator Classes: Enigma Rotor Reflector Plugboard Functions: parse_configuration format_output_string keep_only_alph prepare_string Initialize by: from yb_enigma import * 1. use default configuration "A I-II" enigma = Enigma() 2. use random configuration enigma = Enigma(random_cngf: True) 3. use parsed configuration string reflector, rotors_list, plugboard = parse_configuration(configuration_string) enigma = Enigma( reflector = reflector, rotors_list = rotors_list, plugboard = plugboard, ) 4. use manual configuration reflector = Reflector.A() rotors_list = [Rotor.I(pos=2), Rotor.II(pos=10), Rotor.III(pos=0)] plugboard = Plugboard(pairs=[{'a', 'b'}, {'c', 'd'}]) // above is equal to: reflector, rotors_list, plugboard = parse_configuration("A I:2-II:10-III:0 AB:CD") enigma = Enigma( reflector = reflector, rotors_list = rotors_list, plugboard = plugboard, ) Get current configuration as configuration string: cnfg_string = enigma.get_configuration() Encode string: // using 'save_state' parameter, you can define if enigma`s state will be changed after encoding, or saved as it was before encoded_string = enigma.encode('hello world', save_state=False) Set configuration by configuration string: enigma.set_configuration(cnfg_string) Decode string: decoded_string = enigma.encode(encoded_string) """ from .utils import * from .enigma import * from .rotor import * from .reflector import * from .plugboard import * from .exceptions import * from .common import *
26.828125
127
0.672685
205
1,717
5.502439
0.414634
0.062057
0.067376
0.049645
0.202128
0.202128
0.120567
0.120567
0.120567
0.120567
0
0.009202
0.240536
1,717
63
128
27.253968
0.855828
0.899825
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
5f3a1d54772811d6f5e55ad5e56697c9a4fcfd33
283
py
Python
src/croma/utils.py
jabhishek87/croma
4fff327ea37fba3d5e90215db3a1b6860c309f74
[ "bzip2-1.0.6", "MIT" ]
56
2017-11-25T05:13:17.000Z
2022-01-27T15:14:44.000Z
src/croma/utils.py
jabhishek87/croma
4fff327ea37fba3d5e90215db3a1b6860c309f74
[ "bzip2-1.0.6", "MIT" ]
4
2018-12-10T18:16:36.000Z
2020-06-15T07:34:04.000Z
src/croma/utils.py
jabhishek87/croma
4fff327ea37fba3d5e90215db3a1b6860c309f74
[ "bzip2-1.0.6", "MIT" ]
25
2018-05-03T19:26:27.000Z
2021-12-20T08:38:06.000Z
from django.core.cache import cache from django.core.cache.utils import make_template_fragment_key def invalidate_template_fragment(fragment_name, *variables): cache_key = make_template_fragment_key( fragment_name, vary_on=variables) cache.delete(cache_key)
35.375
63
0.787986
38
283
5.526316
0.447368
0.228571
0.133333
0.180952
0
0
0
0
0
0
0
0
0.14841
283
8
64
35.375
0.871369
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
5f4fae04453efa559466092bad526579efdaa3c2
138
py
Python
Addition/Addition.py
Abishankari02/the-Haunting-Robots
29dada1faa0ef7ef285746cb49c510903a5d89ab
[ "MIT" ]
null
null
null
Addition/Addition.py
Abishankari02/the-Haunting-Robots
29dada1faa0ef7ef285746cb49c510903a5d89ab
[ "MIT" ]
null
null
null
Addition/Addition.py
Abishankari02/the-Haunting-Robots
29dada1faa0ef7ef285746cb49c510903a5d89ab
[ "MIT" ]
3
2021-03-20T07:39:18.000Z
2021-03-20T07:53:12.000Z
def doaddition(a,b): ''''This function performs addition and print the sum'''' sum=a+b print(sum) a=5 b=10 doaddition(a,b)
17.25
39
0.630435
24
138
3.625
0.583333
0.068966
0.275862
0
0
0
0
0
0
0
0
0.027778
0.217391
138
8
40
17.25
0.777778
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.142857
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
5f5095208888eebb355a9a1bde5aba395e222f2c
118
py
Python
pacos4/time.py
jadnohra/PaCoS
0b97cf566d89d99f85c55581beb9ad701395d4fe
[ "MIT" ]
null
null
null
pacos4/time.py
jadnohra/PaCoS
0b97cf566d89d99f85c55581beb9ad701395d4fe
[ "MIT" ]
null
null
null
pacos4/time.py
jadnohra/PaCoS
0b97cf566d89d99f85c55581beb9ad701395d4fe
[ "MIT" ]
null
null
null
Time = float TimeInterval = float StepCount = int def repr_time(time: Time) -> str: return '{:.2e}'.format(time)
16.857143
33
0.669492
16
118
4.875
0.6875
0.205128
0
0
0
0
0
0
0
0
0
0.010309
0.177966
118
7
34
16.857143
0.793814
0
0
0
0
0
0.05042
0
0
0
0
0
0
1
0.2
false
0
0
0.2
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
4
39d86ffa9f263effcaf9dbcf3eac935fd140bbd2
189
py
Python
backend/rest/schemas/__init__.py
wook3024/go
9a2bb3d704e5bb9e21c8561fdfecb3744b97a1e7
[ "MIT" ]
2
2022-03-04T05:45:41.000Z
2022-03-11T02:22:14.000Z
backend/rest/schemas/__init__.py
wook3024/go
9a2bb3d704e5bb9e21c8561fdfecb3744b97a1e7
[ "MIT" ]
null
null
null
backend/rest/schemas/__init__.py
wook3024/go
9a2bb3d704e5bb9e21c8561fdfecb3744b97a1e7
[ "MIT" ]
null
null
null
from .task import MultipleRequest, TaskComparison, Id, TaskResult from .upload import Url __all__ = [ "MultipleRequest", "TaskComparison", "Id", "TaskResult", "Url", ]
17.181818
65
0.661376
17
189
7.117647
0.588235
0.479339
0.512397
0.677686
0
0
0
0
0
0
0
0
0.216931
189
10
66
18.9
0.817568
0
0
0
0
0
0.232804
0
0
0
0
0
0
1
0
false
0
0.222222
0
0.222222
0
1
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
39e32cf0db062b640c8044e02373e8dee94a2563
166
py
Python
src/scraping/scraping.py
tuokri/ArgumentWinnerBot
3a8befc4fba5e50cb64e05df4527499a1a7625fc
[ "MIT" ]
null
null
null
src/scraping/scraping.py
tuokri/ArgumentWinnerBot
3a8befc4fba5e50cb64e05df4527499a1a7625fc
[ "MIT" ]
null
null
null
src/scraping/scraping.py
tuokri/ArgumentWinnerBot
3a8befc4fba5e50cb64e05df4527499a1a7625fc
[ "MIT" ]
null
null
null
from praw.models.comment_forest import CommentForest def evaluate_comment_reply_pair(comment) -> CommentForest: reply = next(comment.replies) return reply
20.75
58
0.789157
20
166
6.35
0.7
0
0
0
0
0
0
0
0
0
0
0
0.144578
166
7
59
23.714286
0.894366
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
f2d1962c7607782656feb05a28963d42c75a9a79
168
py
Python
vivaldi/turn.py
Vernacular-ai/vivaldi
1b1091b43b798cf711679fe5b127a2af280d860e
[ "MIT" ]
1
2020-12-02T14:22:59.000Z
2020-12-02T14:22:59.000Z
vivaldi/turn.py
Vernacular-ai/vivaldi
1b1091b43b798cf711679fe5b127a2af280d860e
[ "MIT" ]
null
null
null
vivaldi/turn.py
Vernacular-ai/vivaldi
1b1091b43b798cf711679fe5b127a2af280d860e
[ "MIT" ]
null
null
null
from vivaldi.types import Turn def is_user_turn(t: Turn) -> bool: """ Tell whether a given turn is a user turn. """ return t.type == Turn.Type.INPUT
16.8
45
0.630952
27
168
3.851852
0.62963
0.153846
0
0
0
0
0
0
0
0
0
0
0.255952
168
9
46
18.666667
0.832
0.244048
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
0
0
0
4
f2e8ae9bd63e80e5ac8a037dec5a5dc31ad684ea
195
py
Python
examples/underscored/deep_imports.py
doboy/Underscore
d98273db3144cda79191d2c90f45d81b6d700b1f
[ "MIT" ]
7
2016-09-23T00:44:05.000Z
2021-10-04T21:19:12.000Z
examples/underscored/deep_imports.py
jameswu1991/Underscore
d98273db3144cda79191d2c90f45d81b6d700b1f
[ "MIT" ]
1
2016-09-23T00:45:05.000Z
2019-02-16T19:05:37.000Z
examples/underscored/deep_imports.py
jameswu1991/Underscore
d98273db3144cda79191d2c90f45d81b6d700b1f
[ "MIT" ]
3
2016-09-23T01:13:15.000Z
2018-07-20T21:22:17.000Z
# import logging.handlers; y = 3 # print(dir(logging.handlers)) (____,) = (3,) (___,) = (dir,) import logging.handlers (_,) = (logging,) __ = ____ print ___(_.handlers) (logging, y) = (_, __)
17.727273
33
0.615385
19
195
5.210526
0.368421
0.454545
0.424242
0
0
0
0
0
0
0
0
0.01227
0.164103
195
10
34
19.5
0.595092
0.307692
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.142857
null
null
0.142857
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
f2ff6b8577502ca4c550d1b56bdce8c2b0db6955
174
py
Python
elementalcms/services/snippets/__init__.py
paranoid-software/elemental-cms
7f09f9cd5498577d23fa70d1a51497b9de232598
[ "MIT" ]
3
2022-01-12T09:11:54.000Z
2022-02-24T22:39:11.000Z
elementalcms/services/snippets/__init__.py
paranoid-software/elemental-cms
7f09f9cd5498577d23fa70d1a51497b9de232598
[ "MIT" ]
null
null
null
elementalcms/services/snippets/__init__.py
paranoid-software/elemental-cms
7f09f9cd5498577d23fa70d1a51497b9de232598
[ "MIT" ]
1
2022-01-12T09:11:56.000Z
2022-01-12T09:11:56.000Z
from .getall import GetAll from .getone import GetOne from .getme import GetMe from .getmany import GetMany from .removeone import RemoveOne from .updateone import UpdateOne
24.857143
32
0.827586
24
174
6
0.333333
0
0
0
0
0
0
0
0
0
0
0
0.137931
174
6
33
29
0.96
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
842aa53fdb4a36fc237d1834a520cd767daa06dd
269
py
Python
scrabb/tile.py
cplyon/scrabb
2be96447841ae6491a4d455e687a159f067581b9
[ "MIT" ]
null
null
null
scrabb/tile.py
cplyon/scrabb
2be96447841ae6491a4d455e687a159f067581b9
[ "MIT" ]
null
null
null
scrabb/tile.py
cplyon/scrabb
2be96447841ae6491a4d455e687a159f067581b9
[ "MIT" ]
null
null
null
#! /usr/bin/env python3 # # Scrabble Game # Author: Chris Lyon # Contact: chris@cplyon.ca class Tile: def __init__(self, letter, score): self.letter = letter self.score = score def __str__(self): return f"({self.letter},{self.score})"
19.214286
46
0.624535
35
269
4.571429
0.628571
0.1875
0.1875
0
0
0
0
0
0
0
0
0.004878
0.237918
269
13
47
20.692308
0.77561
0.297398
0
0
0
0
0.152174
0.152174
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
842ea9c4d84a71835937ae850eb73dae8ce78851
243
py
Python
Shop/schema.py
mehulj94/BareboneShop
fdd3907c587e823b932ce27391e9c17884bf9c94
[ "MIT" ]
1
2020-12-05T14:12:13.000Z
2020-12-05T14:12:13.000Z
Shop/schema.py
mehulj94/BareboneShop
fdd3907c587e823b932ce27391e9c17884bf9c94
[ "MIT" ]
null
null
null
Shop/schema.py
mehulj94/BareboneShop
fdd3907c587e823b932ce27391e9c17884bf9c94
[ "MIT" ]
1
2020-10-19T22:09:31.000Z
2020-10-19T22:09:31.000Z
import graphene import Barebones.schema class Query(Barebones.schema.Query, graphene.ObjectType): pass class Mutation(Barebones.schema.Mutation, graphene.ObjectType): pass schema = graphene.Schema(query=Query, mutation=Mutation)
17.357143
63
0.786008
28
243
6.821429
0.321429
0.235602
0.230366
0
0
0
0
0
0
0
0
0
0.123457
243
14
64
17.357143
0.896714
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0
false
0.285714
0.285714
0
0.571429
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
844b4af9aba76bd8bdde3116e9cb85619aa1dec7
1,284
py
Python
lido_sdk/network/type.py
lidofinance/lido-validator.py
9845a048e2695bf7d26fd60f703f1410656156f6
[ "MIT" ]
6
2021-10-03T07:19:49.000Z
2022-03-31T07:12:19.000Z
lido_sdk/network/type.py
lidofinance/lido-validator.py
9845a048e2695bf7d26fd60f703f1410656156f6
[ "MIT" ]
8
2021-08-23T13:12:22.000Z
2022-02-15T10:26:22.000Z
lido_sdk/network/type.py
lidofinance/lido-validator.py
9845a048e2695bf7d26fd60f703f1410656156f6
[ "MIT" ]
null
null
null
from enum import IntEnum class Network(IntEnum): Mainnet = 1 Kovan = 42 Rinkeby = 4 Görli = 5 xDai = 100 Ropsten = 3 Kintsugi = 1337702 # Network GENESIS_FORK_VERSION = { Network.Mainnet: bytes.fromhex("00000000"), Network.Görli: bytes.fromhex("00001020"), Network.Ropsten: bytes.fromhex("00000000"), Network.Rinkeby: bytes.fromhex("00000000"), Network.Kintsugi: bytes.fromhex("60000069"), } # Existing withdrawal credentials on the chain # Will be filtered for unique values # Will be used as a fallback for used keys WITHDRAWAL_CREDENTIALS = { Network.Mainnet: [ "0x009690e5d4472c7c0dbdf490425d89862535d2a52fb686333f3a0a9ff5d2125e" ], Network.Görli: [ "0x00040517ce98f81070cea20e35610a3ae23a45f0883b0b035afc5717cc2e833e" ], Network.Ropsten: [ "0x01000000000000000000000002139137fdd974181a49268d7b0ae888634e5469", "0x000000000000000000000000ff139137fdd974181a49268d7b0ae888634e5469", "0x000000000000000000000000aa139137fdd974181a49268d7b0ae888634e5469", "0x010000000000000000000000aa139137fdd974181a49268d7b0ae888634e5469", "0x73c72beecbd832c9ce342e61a772c8cfe6f1c6d661b19a98317b5dac05ce9685", ], Network.Rinkeby: [], Network.Kintsugi: [], }
29.860465
77
0.738318
90
1,284
10.5
0.577778
0.063492
0.063492
0.085714
0
0
0
0
0
0
0
0.381179
0.180685
1,284
42
78
30.571429
0.51711
0.099688
0
0.090909
0
0
0.436142
0.40139
0
0
0.40139
0
0
1
0
false
0
0.030303
0
0.272727
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
1
0
0
0
0
0
0
0
0
0
0
0
4
ffe10ad5651c6014c75a6fb2a553fe463b4a0292
1,143
py
Python
tests/test_async_composition.py
lucarin91/async-composition
d6dba795d775cddbe2fc650ec393c28b701f2fc9
[ "MIT" ]
1
2017-08-16T16:45:55.000Z
2017-08-16T16:45:55.000Z
tests/test_async_composition.py
lucarin91/async-composition
d6dba795d775cddbe2fc650ec393c28b701f2fc9
[ "MIT" ]
null
null
null
tests/test_async_composition.py
lucarin91/async-composition
d6dba795d775cddbe2fc650ec393c28b701f2fc9
[ "MIT" ]
null
null
null
import unittest from casync import async_function, Executor, Async_Fun, af # TODO: fix the decorator # @async_function def my_fun(): return 'hello' # @async_function def my_fun2(name): return '{}'.format(name) # @async_function def concat(s1, s2, s3): return ' '.join((s1, s2, s3)) # @async_function def print1(s): return s + ' [from print1]' # @async_function def print2(s): return s + ' [from print2]' class Testcasync(unittest.TestCase): """Tests for `casync` package.""" def setUp(self): """Set Up test fixtures, if any.""" def tearDown(self): """Tear down test fixtures, if any.""" def test_hello(self): # c = (my_fun & my_fun2('luca') & my_fun2('genoveffa')) >>\ # concat >>\ # (print1 | print2) par = af(my_fun) & af(my_fun2)('luca') & af(my_fun2)('genoveffa') # And print_ = af(print1) | af(print2) # Or c = par >> af(concat) >> print_ # Seq from casync.utils import print_graph print_graph(c) ex = Executor() res = ex(c) self.assertIn('hello luca genoveffa', res)
20.410714
80
0.581802
148
1,143
4.358108
0.391892
0.12093
0.124031
0.055814
0.062016
0
0
0
0
0
0
0.022727
0.268591
1,143
55
81
20.781818
0.748804
0.263342
0
0
0
0
0.084663
0
0
0
0
0.018182
0.041667
1
0.333333
false
0
0.125
0.208333
0.708333
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
1
0
0
1
0
0
0
1
1
0
0
4
ffeb4dba79f7f707f32d26bcdee58965329bd2da
488
py
Python
enterprython/__init__.py
dvidben/enterprython
1b71ef5f66ada15d961221d24b6d2cfa064c5b35
[ "MIT" ]
null
null
null
enterprython/__init__.py
dvidben/enterprython
1b71ef5f66ada15d961221d24b6d2cfa064c5b35
[ "MIT" ]
null
null
null
enterprython/__init__.py
dvidben/enterprython
1b71ef5f66ada15d961221d24b6d2cfa064c5b35
[ "MIT" ]
null
null
null
""" enterprython - Type-based dependency injection """ from ._inject import assemble from ._inject import component from ._inject import factory from ._inject import load_config from ._inject import setting from ._inject import load_command_args from ._inject import load_env_vars #pylint: disable=invalid-name name = "enterprython" __author__ = "Tobias Hermann" __copyright__ = "Copyright 2018, Tobias Hermann" __email__ = "editgym@gmail.com" __license__ = "MIT" __version__ = "0.6.1"
24.4
48
0.788934
62
488
5.693548
0.596774
0.1983
0.31728
0.169972
0
0
0
0
0
0
0
0.016393
0.125
488
19
49
25.684211
0.810304
0.153689
0
0
0
0
0.2
0
0
0
0
0
0
1
0
false
0
0.538462
0
0.538462
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
ffee57f3355fd0edd824f08c9e687f60a2bc43e3
104
py
Python
dappled/__main__.py
lhon/dappled
3f12c1eace096f381e085e67ca7610dea9b67e3a
[ "Apache-2.0" ]
4
2017-02-01T00:35:49.000Z
2017-03-20T23:42:08.000Z
dappled/__main__.py
lhon/dappled
3f12c1eace096f381e085e67ca7610dea9b67e3a
[ "Apache-2.0" ]
null
null
null
dappled/__main__.py
lhon/dappled
3f12c1eace096f381e085e67ca7610dea9b67e3a
[ "Apache-2.0" ]
null
null
null
def main(): import dappled.command dappled.command.main() if __name__ == "__main__": main()
17.333333
26
0.644231
12
104
4.916667
0.583333
0.474576
0
0
0
0
0
0
0
0
0
0
0.211538
104
6
27
17.333333
0.719512
0
0
0
0
0
0.07619
0
0
0
0
0
0
1
0.2
true
0
0.2
0
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
0805b21072a74db2e70ae8635a8e0548b12371db
991
py
Python
analyticcenter/__init__.py
dbacc/analyticcenter
86b6d83a82c70926d1a1f505ab4f569bcd4a2b14
[ "BSD-3-Clause" ]
null
null
null
analyticcenter/__init__.py
dbacc/analyticcenter
86b6d83a82c70926d1a1f505ab4f569bcd4a2b14
[ "BSD-3-Clause" ]
null
null
null
analyticcenter/__init__.py
dbacc/analyticcenter
86b6d83a82c70926d1a1f505ab4f569bcd4a2b14
[ "BSD-3-Clause" ]
null
null
null
## ## Copyright (c) 2019 ## ## @author: Daniel Bankmann ## @company: Technische Universität Berlin ## ## This file is part of the python package analyticcenter ## (see https://gitlab.tu-berlin.de/PassivityRadius/analyticcenter/) ## ## License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause ## from .algorithm import riccatioperator, direction, analyticcenter, linearsystem from .algorithm.linearsystem import WeightedSystem from .startup import get_algorithm_object from .algorithm.newton import NewtonDirectionMultipleDimensionsCT, NewtonDirectionMultipleDimensionsDT from .algorithm.steepestascent import SteepestAscentDirectionCT, SteepestAscentDirectionDT from .algorithm.exceptions import AnalyticCenterUnstable, AnalyticCenterNotPassive, \ AnalyticCenterRiccatiSolutionFailed, AnalyticCenterUncontrollable from . import misc from . import logger # For convenience only. Should be removed if package is used as library. from .startup import get_algorithm_object
47.190476
102
0.821393
101
991
8.019802
0.643564
0.080247
0.041975
0.049383
0.08642
0.08642
0
0
0
0
0
0.006749
0.102926
991
21
103
47.190476
0.904387
0.353179
0
0.2
0
0
0
0
0
0
0
0
0
1
0
true
0.1
0.9
0
0.9
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
08269ad56fcc0a749613f3612800ae3e73d93c98
114
py
Python
main.py
LD31D/anonim_chat_bot
5d4c88f228a77195e6835aab6ad93eb7f116c0c1
[ "MIT" ]
2
2021-06-04T10:16:25.000Z
2021-10-06T10:32:41.000Z
main.py
LD31D/anonim_chat_bot
5d4c88f228a77195e6835aab6ad93eb7f116c0c1
[ "MIT" ]
null
null
null
main.py
LD31D/anonim_chat_bot
5d4c88f228a77195e6835aab6ad93eb7f116c0c1
[ "MIT" ]
3
2021-12-31T10:07:42.000Z
2022-01-11T06:29:15.000Z
from aiogram import executor from bot.handlers import dp if __name__ == '__main__': executor.start_polling(dp)
16.285714
28
0.780702
16
114
5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.140351
114
6
29
19
0.816327
0
0
0
0
0
0.070175
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
083dd5ca11fc6a995cb835d21b484e04be0bfc36
153
py
Python
src/syosetsuka/request_parameter.py
CSharpProjector/ShousetsukaScraper
bfe1c78a38034fc77965a393b2d52249bd4d47f2
[ "MIT" ]
null
null
null
src/syosetsuka/request_parameter.py
CSharpProjector/ShousetsukaScraper
bfe1c78a38034fc77965a393b2d52249bd4d47f2
[ "MIT" ]
null
null
null
src/syosetsuka/request_parameter.py
CSharpProjector/ShousetsukaScraper
bfe1c78a38034fc77965a393b2d52249bd4d47f2
[ "MIT" ]
null
null
null
class RequestParameter: name: str value: str def __init__(self, name: str, value: str): self.name = name self.value = value
19.125
46
0.601307
19
153
4.631579
0.421053
0.159091
0.272727
0.340909
0
0
0
0
0
0
0
0
0.30719
153
7
47
21.857143
0.830189
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.666667
0
1
0
0
null
0
1
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
4
f2365ebc3267f0a512dfc9f8a9d0ea9181147edf
554
py
Python
magpie/coords/__init__.py
knaidoo29/magpie
efab3c2666aab2c928ca12a631758bc1b43c149c
[ "MIT" ]
null
null
null
magpie/coords/__init__.py
knaidoo29/magpie
efab3c2666aab2c928ca12a631758bc1b43c149c
[ "MIT" ]
null
null
null
magpie/coords/__init__.py
knaidoo29/magpie
efab3c2666aab2c928ca12a631758bc1b43c149c
[ "MIT" ]
null
null
null
from .conversions import cart2polar from .conversions import polar2cart from .conversions import cart2sphere from .conversions import sphere2cart from .conversions import ortho2cart from .healpix import healpix_xy2ang from .healpix import healpix_ang2xy from .usphere_util import usphere_area from .usphere_util import sphere2lonlat from .usphere_util import lonlat2sphere from .polar import rotate_polar from .usphere import usphere_rotate from .usphere import usphere_phi_shift from .usphere import usphere_shift from .usphere import usphere_spin
26.380952
39
0.855596
72
554
6.416667
0.291667
0.166667
0.227273
0.207792
0.125541
0
0
0
0
0
0
0.018405
0.117329
554
20
40
27.7
0.92638
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
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
1
0
1
0
0
0
0
4
f251479d8a9521a17b718ea864cb7b87420d0614
37,538
py
Python
bin/presets.py
danno-s/tarea-3-mate-discreta
95f85f455167eefc0b153b4d1bef9176132c4b87
[ "MIT" ]
1
2020-05-22T21:20:11.000Z
2020-05-22T21:20:11.000Z
bin/presets.py
danno-s/tarea-3-mate-discreta
95f85f455167eefc0b153b4d1bef9176132c4b87
[ "MIT" ]
null
null
null
bin/presets.py
danno-s/tarea-3-mate-discreta
95f85f455167eefc0b153b4d1bef9176132c4b87
[ "MIT" ]
null
null
null
# coding: UTF-8 from pygltoolbox.particles import * from pygltoolbox.figures import * from pygltoolbox.materials import * import pygame.font as fonts import pygame.image as image import json as json from random import random from OpenGL import GL class Player(): def __init__(self): with open("config.json") as config: self.constants = json.load(config)["constants"] self.side_length = self.constants["side_length"] self.move_frames = self.constants["move_frames"] self.slide_frames = self.constants["slide_frames"] self.gravity = self.constants["gravity"] self.fall_speed = 0 self.falling = False self.fall_counter = 0 self.move_speed = 90 / self.move_frames self.rot_counter = 0 self.rot_spd = 0 self.rot_progress = 0 self.slide_direction = None self.slide_progress = 0 self.slide_speed = self.side_length / self.slide_frames # booleano self.move_axis = None self.direction = None self.rising = False self.figure = Particle() self.figure.add_property("GLLIST", create_cube()) self.figure.add_property("SIZE", [self.side_length / 2, self.side_length / 2, self.side_length / 2]) self.figure.add_property("MATERIAL", material_player_cube) self.figure.set_name("Jugador") def place(self, level): tilemap = level.tilemap # busca casilla donde comienza el jugador for row, i in enumerate(tilemap): for column, j in enumerate(tilemap[row]): for height, z in enumerate(tilemap[row][column]): if tilemap[row][column][height] is not None: # si es el spawn, ubica en las mismas coordenadas una altura más arriba if tilemap[row][column][height].get_name() == "Spawn": self.figure.set_x(tilemap[row][column][height].get_x()) self.figure.set_y(tilemap[row][column][height].get_y()) self.figure.set_z(tilemap[row][column][height].get_z() + self.side_length) def update(self): # animación de la rotación if self.rot_counter > 0: self.rot_counter -= 1 self.rot_progress += self.rot_spd # actualización de la posición al finalizar la rotación if self.rot_counter == 0: self.rot_progress = 0 if self.move_axis is not None and self.direction is not None and not self.rising: if self.move_axis and self.direction: self.add_y(-self.side_length) elif self.move_axis and not self.direction: self.add_y(self.side_length) elif not self.move_axis and self.direction: self.add_x(self.side_length) elif not self.move_axis and not self.direction: self.add_x(-self.side_length) if self.move_axis is not None and self.direction is not None and self.rising: if self.move_axis and self.direction: self.add_y(-self.side_length) self.add_z(self.side_length) elif self.move_axis and not self.direction: self.add_y(self.side_length) self.add_z(self.side_length) elif not self.move_axis and self.direction: self.add_x(self.side_length) self.add_z(self.side_length) elif not self.move_axis and not self.direction: self.add_x(-self.side_length) self.add_z(self.side_length) self.rising = False self.move_axis = None self.direction = None # caída si no hay bloques abajo if self.falling and self.get_z() - self.fall_speed - self.gravity > self.ground: self.fall_speed += self.gravity self.add_z(-self.fall_speed) elif self.falling: self.add_z(-self.get_z() + self.ground) self.falling = False self.fall_speed = 0 # deslizar jugador un cubo hacia una dirección if self.slide_progress > 0: if self.slide_direction == 0: self.add_x(self.slide_speed) elif self.slide_direction == 1: self.add_y(self.slide_speed) elif self.slide_direction == 2: self.add_x(-self.slide_speed) elif self.slide_direction == 3: self.add_y(-self.slide_speed) self.slide_progress -= 1 elif self.slide_progress == 0: self.slide_direction = None def add_x(self, x): self.figure.set_x(self.get_x() + x) def add_y(self, y): self.figure.set_y(self.get_y() + y) def add_z(self, z): self.figure.set_z(self.get_z() + z) def get_x(self): return self.figure.get_x() def get_y(self): return self.figure.get_y() def get_z(self): return self.figure.get_z() def get_grid_coordinates(self): height = self.get_z() / self.side_length column = self.get_y() / self.side_length row = self.get_x() / self.side_length return [int(row), int(column), int(height)] def draw(self): if self.rot_counter > 0 and not self.rising: if self.move_axis and self.direction: glTranslatef(self.get_x(), self.get_y() - self.side_length / 2, self.get_z() - self.side_length / 2) glRotatef(self.rot_progress, 1, 0, 0) glTranslatef(-self.get_x(), -self.get_y() + self.side_length / 2, -self.get_z() + self.side_length / 2) elif self.move_axis and not self.direction: glTranslatef(self.get_x(), self.get_y() + self.side_length / 2, self.get_z() - self.side_length / 2) glRotatef(self.rot_progress, 1, 0, 0) glTranslatef(-self.get_x(), -self.get_y() - self.side_length / 2, -self.get_z() + self.side_length / 2) elif not self.move_axis and self.direction: glTranslatef(self.get_x() + self.side_length / 2, self.get_y(), self.get_z() - self.side_length / 2) glRotatef(self.rot_progress, 0, 1, 0) glTranslatef(-self.get_x() - self.side_length / 2, -self.get_y(), -self.get_z() + self.side_length / 2) elif not self.move_axis and not self.direction: glTranslatef(self.get_x() - self.side_length / 2, self.get_y(), self.get_z() - self.side_length / 2) glRotatef(self.rot_progress, 0, 1, 0) glTranslatef(-self.get_x() + self.side_length / 2, -self.get_y(), -self.get_z() + self.side_length / 2) elif self.rot_counter > 0 and self.rising: if self.move_axis and self.direction: glTranslatef(self.get_x(), self.get_y() - self.side_length / 2, self.get_z() + self.side_length / 2) glRotatef(self.rot_progress, 1, 0, 0) glTranslatef(-self.get_x(), -self.get_y() + self.side_length / 2, -self.get_z() - self.side_length / 2) elif self.move_axis and not self.direction: glTranslatef(self.get_x(), self.get_y() + self.side_length / 2, self.get_z() + self.side_length / 2) glRotatef(self.rot_progress, 1, 0, 0) glTranslatef(-self.get_x(), -self.get_y() - self.side_length / 2, -self.get_z() - self.side_length / 2) elif not self.move_axis and self.direction: glTranslatef(self.get_x() + self.side_length / 2, self.get_y(), self.get_z() + self.side_length / 2) glRotatef(self.rot_progress, 0, 1, 0) glTranslatef(-self.get_x() - self.side_length / 2, -self.get_y(), -self.get_z() - self.side_length / 2) elif not self.move_axis and not self.direction: glTranslatef(self.get_x() - self.side_length / 2, self.get_y(), self.get_z() + self.side_length / 2) glRotatef(self.rot_progress, 0, 1, 0) glTranslatef(-self.get_x() + self.side_length / 2, -self.get_y(), -self.get_z() - self.side_length / 2) self.figure.exec_property_func("MATERIAL") draw_list(self.figure.get_property("GLLIST"), self.figure.get_position_list(), 0, None, self.figure.get_property("SIZE"), None) def move_neg_y(self): if (self.move_axis is None or self.move_axis) and self.rot_counter == 0: self.move_axis = True self.rot_counter += self.move_frames self.rot_spd = self.move_speed self.direction = True def move_y(self): if (self.move_axis is None or self.move_axis) and self.rot_counter == 0: self.move_axis = True self.rot_counter += self.move_frames self.rot_spd = -self.move_speed self.direction = False def move_x(self): if (self.move_axis is None or not self.move_axis) and self.rot_counter == 0: self.move_axis = False self.rot_counter += self.move_frames self.rot_spd = self.move_speed self.direction = True def move_neg_x(self): if (self.move_axis is None or not self.move_axis) and self.rot_counter == 0: self.move_axis = False self.rot_counter += self.move_frames self.rot_spd = -self.move_speed self.direction = False def rise_neg_y(self): if (self.move_axis is None or self.move_axis) and self.rot_counter == 0: self.move_axis = True self.rot_counter += 2 * self.move_frames self.rot_spd = self.move_speed self.direction = True self.rising = True def rise_y(self): if (self.move_axis is None or self.move_axis) and self.rot_counter == 0: self.move_axis = True self.rot_counter += 2 * self.move_frames self.rot_spd = -self.move_speed self.direction = False self.rising = True def rise_x(self): if (self.move_axis is None or not self.move_axis) and self.rot_counter == 0: self.move_axis = False self.rot_counter += 2 * self.move_frames self.rot_spd = self.move_speed self.direction = True self.rising = True def rise_neg_x(self): if (self.move_axis is None or not self.move_axis) and self.rot_counter == 0: self.move_axis = False self.rot_counter += 2 * self.move_frames self.rot_spd = -self.move_speed self.direction = False self.rising = True def is_moving(self): return self.rot_counter > 0 def fall(self, coords, level): self.falling = True row = coords[0] column = coords[1] for height in xrange(coords[2], -1, -1): tile = level.get_object_at([row, column, height]) if isinstance(tile, FallingTile): self.ground = tile.get_z() + self.side_length * 6 / 10 return elif tile is not None: self.ground = tile.get_z() + self.side_length return self.ground = -sys.maxint - 1 def is_falling(self): return self.falling def can_rise_x(self, level): coord = self.get_grid_coordinates() coord[0] += 1 try: if ( isinstance(level.get_object_at(coord), BasicTile) or isinstance(level.get_object_at(coord), FinishTile) or isinstance(level.get_object_at(coord), FallingTile) or isinstance(level.get_object_at(coord), PushingBlock) ): return True except IndexError: return False return False def can_rise_neg_x(self, level): coord = self.get_grid_coordinates() coord[0] -= 1 try: if ( isinstance(level.get_object_at(coord), BasicTile) or isinstance(level.get_object_at(coord), FinishTile) or isinstance(level.get_object_at(coord), FallingTile) or isinstance(level.get_object_at(coord), PushingBlock) ): return True except IndexError: return False return False def can_rise_y(self, level): coord = self.get_grid_coordinates() coord[1] += 1 try: if ( isinstance(level.get_object_at(coord), BasicTile) or isinstance(level.get_object_at(coord), FinishTile) or isinstance(level.get_object_at(coord), FallingTile) or isinstance(level.get_object_at(coord), PushingBlock) ): return True except IndexError: return False return False def can_rise_neg_y(self, level): coord = self.get_grid_coordinates() coord[1] -= 1 try: if ( isinstance(level.get_object_at(coord), BasicTile) or isinstance(level.get_object_at(coord), FinishTile) or isinstance(level.get_object_at(coord), FallingTile) or isinstance(level.get_object_at(coord), PushingBlock) ): return True except IndexError: return False return False def slide(self, orientation): if orientation == 0: self.slide_x() elif orientation == 1: self.slide_y() elif orientation == 2: self.slide_neg_x() elif orientation == 3: self.slide_neg_y() def slide_x(self): self.slide_direction = 0 self.slide_progress = self.slide_frames def slide_y(self): self.slide_direction = 1 self.slide_progress = self.slide_frames def slide_neg_x(self): self.slide_direction = 2 self.slide_progress = self.slide_frames def slide_neg_y(self): self.slide_direction = 3 self.slide_progress = self.slide_frames def sliding(self): if self.slide_direction is not None and self.slide_progress > 0: return True return False class BasicTile: def __init__(self, row, column, level, side_length): self.tile = Particle(row * side_length, column * side_length, level * side_length) self.tile.add_property("GLLIST", create_cube()) self.tile.add_property("SIZE", [side_length / 2, side_length / 2, side_length / 2]) self.tile.add_property("MATERIAL", material_tile_cube) def set_name(self, name): self.tile.set_name(name) def get_name(self): return self.tile.get_name() def get_x(self): return self.tile.get_x() def get_y(self): return self.tile.get_y() def get_z(self): return self.tile.get_z() def draw(self): self.tile.exec_property_func("MATERIAL") draw_list(self.tile.get_property("GLLIST"), self.tile.get_position_list(), 0, None, self.tile.get_property("SIZE"), None) class Shard(): def __init__(self, row, column, level, cube_side_length, shard_side_length): self.side_length = shard_side_length self.cube_side_length = cube_side_length self.figure = Particle(row * cube_side_length, column * cube_side_length, level * cube_side_length) roll = random() self.figure.add_property("GLLIST", create_octahedron()) self.figure.add_property("SIZE", [self.side_length, self.side_length, self.side_length]) self.figure.add_property("MATERIAL", material_shard) self.figure.set_name("Shard") def get_x(self): return self.figure.get_x() def get_y(self): return self.figure.get_y() def get_z(self): return self.figure.get_z() def draw(self): self.figure.exec_property_func("MATERIAL") draw_list(self.figure.get_property("GLLIST"), self.figure.get_position_list(), 0, None, self.figure.get_property("SIZE"), None) def get_name(self): return self.figure.get_name() def get_grid_coordinates(self): height = self.get_z() / self.cube_side_length column = self.get_y() / self.cube_side_length row = self.get_x() / self.cube_side_length return [int(row), int(column), int(height)] class FallingTile: def __init__(self, row, column, level, side_length): self.side_length = side_length self.start_pos = [row * self.side_length, column * self.side_length, (level + 0.4) * self.side_length] self.tile = Particle(row * self.side_length, column * self.side_length, (level + 0.4) * self.side_length) self.tile.add_property("GLLIST", create_cube()) self.tile.add_property("SIZE", [self.side_length / 2, self.side_length / 2, self.side_length / 10]) self.tile.add_property("MATERIAL", material_falling_tile) self.stable = None self.fall_speed = 0 with open("config.json") as config: constants = json.load(config)["constants"] self.gravity = constants["gravity"] self.height_treshold = constants["height_treshold"] def set_name(self, name): self.tile.set_name(name) def get_name(self): return self.tile.get_name() def add_x(self, x): self.tile.set_x(self.get_x() + x) def add_y(self, y): self.tile.set_y(self.get_y() + y) def add_z(self, z): self.tile.set_z(self.get_z() + z) def get_x(self): return self.tile.get_x() def get_y(self): return self.tile.get_y() def get_z(self): return self.tile.get_z() def get_grid_coordinates(self): height = self.get_z() / self.side_length column = self.get_y() / self.side_length row = self.get_x() / self.side_length return [int(row), int(column), int(height)] def get_original_coordinates(self): row = self.start_pos[0] / self.side_length column = self.start_pos[1] / self.side_length height = self.start_pos[2] / self.side_length return [int(row), int(column), int(height)] def fall(self): self.stable = True def draw(self): self.tile.exec_property_func("MATERIAL") draw_list(self.tile.get_property("GLLIST"), self.tile.get_position_list(), 0, None, self.tile.get_property("SIZE"), None) def update(self, player): if not self.stable and self.stable is not None: self.fall_speed += self.gravity self.add_z(-self.fall_speed) elif self.stable and self.stable is not None: self.check_above(player) def check_above(self, player): player_coord = player.get_grid_coordinates() tile_coord = self.get_grid_coordinates() above_tile = [tile_coord[0], tile_coord[1], tile_coord[2] + 1] if player_coord != above_tile and player_coord != tile_coord: self.stable = False def is_deletable(self): return self.get_z() < -2000 class PushingBlock: def __init__(self, row, column, level, side_length, orientation): with open("config.json") as config: constants = json.load(config)["constants"] self.push_frames = constants["slide_frames"] self.side_length = side_length self.orientation = orientation self.push_speed = self.side_length / self.push_frames self.push_progress = 0 self.retraction_progress = 0 if self.orientation == 0: # pointing along x axis self.body = Particle((row - 0.1) * self.side_length, column * self.side_length, level * self.side_length) self.body.add_property("GLLIST", create_cube()) self.body.add_property("SIZE", [self.side_length * 4 / 10, self.side_length / 2, self.side_length / 2]) self.body.add_property("MATERIAL", material_player_cube) self.head = Particle((row + 0.4) * self.side_length, column * self.side_length, level * self.side_length) self.head.add_property("GLLIST", create_cube()) self.head.add_property("SIZE", [self.side_length / 10, self.side_length / 2, self.side_length / 2]) self.head.add_property("MATERIAL", material_falling_tile) self.piston = Particle(row * self.side_length, column * self.side_length, level * self.side_length) self.piston.add_property("GLLIST", create_cube()) self.piston.add_property("SIZE", [self.side_length / 10, self.side_length / 10, self.side_length / 10]) self.piston.add_property("MATERIAL", material_shard) elif self.orientation == 1: # pointing along y axis self.body = Particle(row * self.side_length, (column - 0.1) * self.side_length, level * self.side_length) self.body.add_property("GLLIST", create_cube()) self.body.add_property("SIZE", [self.side_length / 2, self.side_length * 4 / 10, self.side_length / 2]) self.body.add_property("MATERIAL", material_player_cube) self.head = Particle(row * self.side_length, (column + 0.4) * self.side_length, level * self.side_length) self.head.add_property("GLLIST", create_cube()) self.head.add_property("SIZE", [self.side_length / 2, self.side_length / 10, self.side_length / 2]) self.head.add_property("MATERIAL", material_falling_tile) self.piston = Particle(row * self.side_length, column * self.side_length, level * self.side_length) self.piston.add_property("GLLIST", create_cube()) self.piston.add_property("SIZE", [self.side_length / 10, self.side_length / 10, self.side_length / 10]) self.piston.add_property("MATERIAL", material_shard) elif self.orientation == 2: # pointing along neg x axis self.body = Particle((row + 0.1) * self.side_length, column * self.side_length, level * self.side_length) self.body.add_property("GLLIST", create_cube()) self.body.add_property("SIZE", [self.side_length * 4 / 10, self.side_length / 2, self.side_length / 2]) self.body.add_property("MATERIAL", material_player_cube) self.head = Particle((row - 0.4) * self.side_length, column * self.side_length, level * self.side_length) self.head.add_property("GLLIST", create_cube()) self.head.add_property("SIZE", [self.side_length / 10, self.side_length / 2, self.side_length / 2]) self.head.add_property("MATERIAL", material_falling_tile) self.piston = Particle(row * self.side_length, column * self.side_length, level * self.side_length) self.piston.add_property("GLLIST", create_cube()) self.piston.add_property("SIZE", [self.side_length / 10, self.side_length / 10, self.side_length / 10]) self.piston.add_property("MATERIAL", material_shard) elif self.orientation == 3: # pointing along neg y axis self.body = Particle(row * self.side_length, (column + 0.1) * self.side_length, level * self.side_length) self.body.add_property("GLLIST", create_cube()) self.body.add_property("SIZE", [self.side_length / 2, self.side_length * 4 / 10, self.side_length / 2]) self.body.add_property("MATERIAL", material_player_cube) self.head = Particle(row * self.side_length, (column - 0.4) * self.side_length, level * self.side_length) self.head.add_property("GLLIST", create_cube()) self.head.add_property("SIZE", [self.side_length / 2, self.side_length / 10, self.side_length / 2]) self.head.add_property("MATERIAL", material_falling_tile) self.piston = Particle(row * self.side_length, column * self.side_length, level * self.side_length) self.piston.add_property("GLLIST", create_cube()) self.piston.add_property("SIZE", [self.side_length / 10, self.side_length / 10, self.side_length / 10]) self.piston.add_property("MATERIAL", material_shard) def get_name(self): return self.body.get_name() def draw(self): self.piston.exec_property_func("MATERIAL") draw_list(self.piston.get_property("GLLIST"), self.piston.get_position_list(), 0, None, self.piston.get_property("SIZE"), None) self.body.exec_property_func("MATERIAL") draw_list(self.body.get_property("GLLIST"), self.body.get_position_list(), 0, None, self.body.get_property("SIZE"), None) self.head.exec_property_func("MATERIAL") draw_list(self.head.get_property("GLLIST"), self.head.get_position_list(), 0, None, self.head.get_property("SIZE"), None) def head_add_x(self, x): self.head.set_x(self.get_head_x() + x) def head_add_y(self, y): self.head.set_y(self.get_head_y() + y) def head_add_z(self, z): self.head.set_z(self.get_head_z() + z) def get_grid_coordinates(self): height = self.get_z() / self.side_length column = self.get_y() / self.side_length row = self.get_x() / self.side_length return [int(row), int(column), int(height)] def get_x(self): return self.piston.get_x() def get_y(self): return self.piston.get_y() def get_z(self): return self.piston.get_z() def get_head_x(self): return self.head.get_x() def get_head_y(self): return self.head.get_y() def get_head_z(self): return self.head.get_z() def check_front(self, player): player_coords = player.get_grid_coordinates() pusher_coords = self.get_grid_coordinates() if self.orientation == 0: target = [pusher_coords[0] + 1, pusher_coords[1], pusher_coords[2]] elif self.orientation == 1: target = [pusher_coords[0], pusher_coords[1] + 1, pusher_coords[2]] elif self.orientation == 2: target = [pusher_coords[0] - 1, pusher_coords[1], pusher_coords[2]] elif self.orientation == 3: target = [pusher_coords[0], pusher_coords[1] - 1, pusher_coords[2]] return player_coords == target def get_orientation(self): return self.orientation def update(self): if self.push_progress > 0: if self.orientation == 0: self.head_add_x(self.push_speed) elif self.orientation == 1: self.head_add_y(self.push_speed) elif self.orientation == 2: self.head_add_x(-self.push_speed) elif self.orientation == 3: self.head_add_y(-self.push_speed) self.push_progress -= 1 if self.push_progress == 0: self.retraction_progress = self.push_frames elif self.retraction_progress > 0: if self.orientation == 0: self.head_add_x(-self.push_speed) elif self.orientation == 1: self.head_add_y(-self.push_speed) elif self.orientation == 2: self.head_add_x(self.push_speed) elif self.orientation == 3: self.head_add_y(self.push_speed) self.retraction_progress -= 1 def push(self): self.push_progress = self.push_frames class FinishTile: def __init__(self, row, column, level, side_length): self.tile = Particle(row * side_length, column * side_length, level * side_length) self.tile.add_property("GLLIST", create_cube()) self.tile.add_property("SIZE", [side_length / 2, side_length / 2, side_length / 2]) self.tile.add_property("MATERIAL", material_dormant_finish_tile) self.activated = False def set_name(self, name): self.tile.set_name(name) def get_name(self): return self.tile.get_name() def get_x(self): return self.tile.get_x() def get_y(self): return self.tile.get_y() def get_z(self): return self.tile.get_z() def draw(self): self.tile.exec_property_func("MATERIAL") draw_list(self.tile.get_property("GLLIST"), self.tile.get_position_list(), 0, None, self.tile.get_property("SIZE"), None) def activate(self): self.tile.modify_property("MATERIAL", material_active_finish_tile) self.activated = True class OptionTile: def __init__(self, row, column, level, side_length, text, action, parameter): self.side_length = side_length self.tile = Particle(row * side_length, column * side_length, level * side_length) self.tile.add_property("GLLIST", create_cube()) self.tile.add_property("SIZE", [side_length / 2, side_length / 2, side_length / 2]) self.tile.add_property("MATERIAL", material_active_finish_tile) with open("config.json") as json_config: config = json.load(json_config) font_location = config["settings"]["font"] self.highlight_frames = config["constants"]["move_frames"] self.highlight_progress = 0 self.highlighting = None self.red_speed = 42.0 / self.highlight_frames self.green_speed = 200.0 / self.highlight_frames self.blue_speed = 229.0 / self.highlight_frames self.text = text self.action = action self.param = parameter self.font = fonts.Font(font_location, 40) self.red_color = 0.0 self.green_color = 0.0 self.blue_color = 0.0 text_surface = self.font.render(self.text, True, (self.red_color, self.green_color, self.blue_color, 255), (210, 224, 224, 0)) self.text_width = text_surface.get_width() self.text_height = text_surface.get_height() self.text_data = image.tostring(text_surface, "RGBA", True) self.position = (row * side_length - self.text_width, column * side_length - self.text_height, level * side_length + 500) def set_name(self, name): self.tile.set_name(name) def get_name(self): return self.tile.get_name() def get_x(self): return self.tile.get_x() def get_y(self): return self.tile.get_y() def get_z(self): return self.tile.get_z() def get_action(self): return self.action def get_param(self): return self.param def get_grid_coordinates(self): height = self.get_z() / self.side_length column = self.get_y() / self.side_length row = self.get_x() / self.side_length return [int(row), int(column), int(height)] def update(self, player): if self.highlight_progress > 0 and self.highlighting: self.red_color += self.red_speed self.red_color = min(255.0, self.red_color) self.green_color += self.green_speed self.green_color = min(255.0, self.green_color) self.blue_color += self.blue_speed self.blue_color = min(255.0, self.blue_color) text_surface = self.font.render(self.text, True, (self.red_color, self.green_color, self.blue_color, 255), (210, 224, 224, 0)) self.text_data = image.tostring(text_surface, "RGBA", True) self.highlight_progress -= 1 elif self.highlight_progress > 0 and not self.highlighting: self.red_color -= self.red_speed self.red_color = max(0.0, self.red_color) self.green_color -= self.green_speed self.green_color = max(0.0, self.green_color) self.blue_color -= self.blue_speed self.blue_color = max(0.0, self.blue_color) text_surface = self.font.render(self.text, True, (self.red_color, self.green_color, self.blue_color, 255), (210, 224, 224, 0)) self.text_data = image.tostring(text_surface, "RGBA", True) self.highlight_progress -= 1 player_coords = player.get_grid_coordinates() tile_coord = self.get_grid_coordinates() target = [tile_coord[0], tile_coord[1], tile_coord[2] + 1] if target != player_coords and self.highlighting: self.dehighlight() def highlight(self): self.highlight_progress = self.highlight_frames - self.highlight_progress self.highlighting = True def dehighlight(self): self.highlight_progress = self.highlight_frames - self.highlight_progress self.highlighting = False def highlighted(self): return self.highlighting def draw(self): self.tile.exec_property_func("MATERIAL") draw_list(self.tile.get_property("GLLIST"), self.tile.get_position_list(), 0, None, self.tile.get_property("SIZE"), None) glRasterPos3d(*self.position) glDrawPixels(self.text_width, self.text_height, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, self.text_data) glLineWidth(2.5) glColor3f(0.0, 0.0, 0.0) glBegin(GL_LINES) glVertex3f(self.get_x(), self.get_y(), self.get_z()) glVertex3f(self.position[0], self.position[1], self.position[2]) glEnd()
38.819028
138
0.544248
4,479
37,538
4.33177
0.051127
0.101536
0.112566
0.040975
0.807391
0.760901
0.719462
0.693279
0.676374
0.660293
0
0.015607
0.356492
37,538
966
139
38.859213
0.787589
0.010176
0
0.642317
0
0
0.018873
0
0
0
0
0
0
1
0.127204
false
0
0.010076
0.046599
0.221662
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f25812e7f248425a0b6ab0570241376112de0a1f
135
py
Python
ipifiy/copy-ip.py
diksm8/copy-ip
7039f7eaf03e0238ceda795f921f7b91ec6d6060
[ "Unlicense" ]
null
null
null
ipifiy/copy-ip.py
diksm8/copy-ip
7039f7eaf03e0238ceda795f921f7b91ec6d6060
[ "Unlicense" ]
null
null
null
ipifiy/copy-ip.py
diksm8/copy-ip
7039f7eaf03e0238ceda795f921f7b91ec6d6060
[ "Unlicense" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import pyperclip, winsound, ipify pyperclip.copy(ipify.get_ip()) winsound.MessageBeep()
19.285714
33
0.711111
18
135
5.277778
0.833333
0
0
0
0
0
0
0
0
0
0
0.008264
0.103704
135
7
34
19.285714
0.77686
0.311111
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f28b7fffa46f98f51e7f15f37a25eac9a77cbbfd
673
py
Python
2020/Day2/functionsdemo.py
vishipayyallore/learning-python_2021
e091d47d167ecb510ea0819b64a78bd58c2a42b3
[ "Apache-2.0" ]
1
2020-09-17T15:06:44.000Z
2020-09-17T15:06:44.000Z
2020/Day2/functionsdemo.py
vishipayyallore/learning-python_2020
e091d47d167ecb510ea0819b64a78bd58c2a42b3
[ "Apache-2.0" ]
null
null
null
2020/Day2/functionsdemo.py
vishipayyallore/learning-python_2020
e091d47d167ecb510ea0819b64a78bd58c2a42b3
[ "Apache-2.0" ]
null
null
null
# 1. Accepts Nothing | Returns None def greet(): print("Hello Python") # 2. Accepts data | Returns None def greet_v2(name: str): print(f"Hello {name}") # 3. Accepts Nothing | Returns Value def greet_v3() -> str: return "Hello Python (V3)" # 4. Accepts data | Returns Value def greet_v4(name: str) -> str: return f"Hello {name} (V4)" def main(): results = greet() print(f"1. Results: {results}") results = greet_v2("Shiva") print(f"2. Results: {results}") results = greet_v3() print(f"3. Results: {results}") results = greet_v4("Rajesh Agarwal") print(f"4. Results: {results}") # Program Execution Starts Here main()
20.393939
40
0.631501
94
673
4.457447
0.329787
0.23389
0.150358
0.186158
0
0
0
0
0
0
0
0.030246
0.213967
673
32
41
21.03125
0.761815
0.239227
0
0
0
0
0.318812
0
0
0
0
0
0
1
0.277778
false
0
0
0.111111
0.388889
0.333333
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
1
0
0
0
1
0
0
0
4
f2a72a588f7e1ad55f49b0d4d2c7a0b7e1003a56
35
py
Python
sample_projects/file_module_src/file_module.py
matthewdeanmartin/jiggle_version
7bb82b75321e007f9e9e6d52a7bc569a5fe41052
[ "MIT" ]
1
2019-02-23T16:13:56.000Z
2019-02-23T16:13:56.000Z
sample_projects/file_module_ver_in_file/file_module.py
matthewdeanmartin/jiggle_version
7bb82b75321e007f9e9e6d52a7bc569a5fe41052
[ "MIT" ]
17
2018-07-14T17:04:49.000Z
2022-03-24T15:59:11.000Z
sample_projects/file_module_ver_in_file/file_module.py
matthewdeanmartin/jiggle_version
7bb82b75321e007f9e9e6d52a7bc569a5fe41052
[ "MIT" ]
1
2019-12-01T02:18:36.000Z
2019-12-01T02:18:36.000Z
foo = "bar" __version__ = "1.2.3"
8.75
21
0.571429
6
35
2.666667
1
0
0
0
0
0
0
0
0
0
0
0.107143
0.2
35
3
22
11.666667
0.464286
0
0
0
0
0
0.228571
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
4b42aeea4a16a018fed639cf5e9eb6e250162608
19
py
Python
data/studio21_generated/introductory/4120/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/4120/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/4120/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
def sort_dict(d):
9.5
17
0.684211
4
19
3
1
0
0
0
0
0
0
0
0
0
0
0
0.157895
19
2
18
9.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
4b47377738e5f5895abfd88992812a5d50ae599b
86
py
Python
ndinterval/__init__.py
ajhamdi/NDInterval
be78fbe809ceb2208e4e07c737bd5d14c7d9401c
[ "MIT" ]
3
2019-04-23T09:52:41.000Z
2019-04-25T05:52:00.000Z
ndinterval/__init__.py
ajhamdi/ndinterval
be78fbe809ceb2208e4e07c737bd5d14c7d9401c
[ "MIT" ]
null
null
null
ndinterval/__init__.py
ajhamdi/ndinterval
be78fbe809ceb2208e4e07c737bd5d14c7d9401c
[ "MIT" ]
null
null
null
from .utils import int2binarray from .ndinterval import ndinterval __version__ = '0.8'
28.666667
34
0.813953
11
86
6
0.727273
0
0
0
0
0
0
0
0
0
0
0.039474
0.116279
86
3
35
28.666667
0.828947
0
0
0
0
0
0.034483
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
4b4c56b6f68c86a21565a0ae288a6e5d30f19bad
151
py
Python
bbpyp/state_machine/model/abstract_state.py
BloggerBust/bbpyp
078f940dd38bc3ee7c5adcfb2555c2843a4ca57b
[ "Apache-2.0" ]
null
null
null
bbpyp/state_machine/model/abstract_state.py
BloggerBust/bbpyp
078f940dd38bc3ee7c5adcfb2555c2843a4ca57b
[ "Apache-2.0" ]
null
null
null
bbpyp/state_machine/model/abstract_state.py
BloggerBust/bbpyp
078f940dd38bc3ee7c5adcfb2555c2843a4ca57b
[ "Apache-2.0" ]
null
null
null
from enum import Enum, unique @unique class AbstractState(Enum): def _generate_next_value_(name, start, count, last_values): return name
18.875
63
0.735099
20
151
5.3
0.8
0
0
0
0
0
0
0
0
0
0
0
0.192053
151
7
64
21.571429
0.868852
0
0
0
1
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.8
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
1
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
0
0
4
4b5c3c7fd430599730e3a43f410fa24fa0e656a0
36
py
Python
data/studio21_generated/introductory/4877/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/4877/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/introductory/4877/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
def love_language(partner, weeks):
18
34
0.777778
5
36
5.4
1
0
0
0
0
0
0
0
0
0
0
0
0.111111
36
2
35
18
0.84375
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
4b64c0f689ad7965239d55fcd25e737117624654
93
py
Python
vergleich/apps.py
catexis/HSE_graduation_project
ae6a3dc1d36ac98b0cc9442f2016fb35433b3a5f
[ "MIT" ]
null
null
null
vergleich/apps.py
catexis/HSE_graduation_project
ae6a3dc1d36ac98b0cc9442f2016fb35433b3a5f
[ "MIT" ]
3
2020-06-05T18:11:07.000Z
2021-12-13T19:47:17.000Z
vergleich/apps.py
catexis/HSE_graduation_project
ae6a3dc1d36ac98b0cc9442f2016fb35433b3a5f
[ "MIT" ]
null
null
null
from django.apps import AppConfig class VergleichConfig(AppConfig): name = 'vergleich'
15.5
33
0.763441
10
93
7.1
0.9
0
0
0
0
0
0
0
0
0
0
0
0.16129
93
5
34
18.6
0.910256
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
4ba4ff72ad63976b2d5535a8d64f13c7a3bbf529
1,139
py
Python
viadot/flows/__init__.py
winiar93/viadot
7d8f8b0a30de3d40da161615639532012de072b0
[ "MIT" ]
null
null
null
viadot/flows/__init__.py
winiar93/viadot
7d8f8b0a30de3d40da161615639532012de072b0
[ "MIT" ]
null
null
null
viadot/flows/__init__.py
winiar93/viadot
7d8f8b0a30de3d40da161615639532012de072b0
[ "MIT" ]
null
null
null
from .adls_gen1_to_azure_sql import ADLSGen1ToAzureSQL from .adls_gen1_to_azure_sql_new import ADLSGen1ToAzureSQLNew from .adls_gen1_to_gen2 import ADLSGen1ToGen2 from .adls_to_azure_sql import ADLSToAzureSQL from .azure_sql_transform import AzureSQLTransform from .flow_of_flows import Pipeline from .supermetrics_to_adls import SupermetricsToADLS from .supermetrics_to_azure_sql import SupermetricsToAzureSQL from .adls_container_to_container import ADLSContainerToContainer from .sharepoint_to_adls import SharepointToADLS from .cloud_for_customers_report_to_adls import CloudForCustomersReportToADLS from .aselite_to_adls import ASELiteToADLS from .bigquery_to_adls import BigQueryToADLS from .outlook_to_adls import OutlookToADLS try: from .sap_to_duckdb import SAPToDuckDB except ImportError: pass from .duckdb_transform import DuckDBTransform from .duckdb_to_sql_server import DuckDBToSQLServer from .multiple_flows import MultipleFlows try: from .sap_rfc_to_adls import SAPRFCToADLS except ImportError: pass from .sql_server_to_duckdb import SQLServerToDuckDB from .epicor_to_duckdb import EpicorOrdersToDuckDB
35.59375
77
0.879719
147
1,139
6.442177
0.367347
0.044351
0.088701
0.044351
0.046463
0.046463
0
0
0
0
0
0.00779
0.098332
1,139
31
78
36.741935
0.914314
0
0
0.222222
0
0
0
0
0
0
0
0
0
1
0
true
0.074074
0.851852
0
0.851852
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
2999f6ea0f920e83912241de3f0da962efe9e168
245
py
Python
orgManager/serializers.py
vietbrother/django_iso
8e27161e598bc4c069805ebe39ef6861f0a07b83
[ "MIT" ]
null
null
null
orgManager/serializers.py
vietbrother/django_iso
8e27161e598bc4c069805ebe39ef6861f0a07b83
[ "MIT" ]
1
2018-07-30T04:39:41.000Z
2018-07-30T04:39:41.000Z
orgManager/serializers.py
vietbrother/django_iso
8e27161e598bc4c069805ebe39ef6861f0a07b83
[ "MIT" ]
null
null
null
from rest_framework import serializers from . import models class OrganizationSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = models.Organization fields = ('id', 'name', 'parent_id', 'description')
24.5
69
0.730612
23
245
7.695652
0.73913
0
0
0
0
0
0
0
0
0
0
0
0.179592
245
9
70
27.222222
0.880597
0
0
0
0
0
0.106122
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
29a4e7f6e354ae37ad23215129ae086a6fe685fd
37
py
Python
plyg/__init__.py
daniel-butler/plyg
4c95ff48feac8aa412db78df49b2b84dec46b491
[ "MIT" ]
null
null
null
plyg/__init__.py
daniel-butler/plyg
4c95ff48feac8aa412db78df49b2b84dec46b491
[ "MIT" ]
null
null
null
plyg/__init__.py
daniel-butler/plyg
4c95ff48feac8aa412db78df49b2b84dec46b491
[ "MIT" ]
null
null
null
from . import main cli = main.plyg
7.4
18
0.675676
6
37
4.166667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.243243
37
4
19
9.25
0.892857
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
29c5c0af96ece1f09106bca3dd1d398017c766ba
130
py
Python
crawler/apps.py
Diegow3b/webscrapping-beatifulsoup
285b0416818cc13cda619efe2d83c15b5b683e9d
[ "MIT" ]
null
null
null
crawler/apps.py
Diegow3b/webscrapping-beatifulsoup
285b0416818cc13cda619efe2d83c15b5b683e9d
[ "MIT" ]
null
null
null
crawler/apps.py
Diegow3b/webscrapping-beatifulsoup
285b0416818cc13cda619efe2d83c15b5b683e9d
[ "MIT" ]
null
null
null
from __future__ import unicode_literals from django.apps import AppConfig class CrawlerConfig(AppConfig): name = 'crawler'
16.25
39
0.792308
15
130
6.533333
0.8
0
0
0
0
0
0
0
0
0
0
0
0.153846
130
7
40
18.571429
0.890909
0
0
0
0
0
0.053846
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
29caf00524823f5483bdfc191ed3a8090611d8a4
31
py
Python
tests/geocoding/__init__.py
developmentseed/unicef-schools-attribute-cleaning
eb3dd8a02f26e3455ee04ac2788e79c205ae97e5
[ "MIT" ]
null
null
null
tests/geocoding/__init__.py
developmentseed/unicef-schools-attribute-cleaning
eb3dd8a02f26e3455ee04ac2788e79c205ae97e5
[ "MIT" ]
3
2020-10-08T15:28:38.000Z
2020-10-15T14:37:00.000Z
tests/geocoding/__init__.py
developmentseed/unicef-schools-attribute-cleaning
eb3dd8a02f26e3455ee04ac2788e79c205ae97e5
[ "MIT" ]
null
null
null
""" tests/geocoding module """
7.75
22
0.645161
3
31
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.129032
31
3
23
10.333333
0.740741
0.709677
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
29f117a3d2e0dbb3f4ef2d30f14f3ee612cd612d
1,135
py
Python
Wurm/Optimize/python/optimize.py
Zomega/thesis
babd1bacc7d9d1d8c9060f9835b8d10c14b107a0
[ "MIT" ]
null
null
null
Wurm/Optimize/python/optimize.py
Zomega/thesis
babd1bacc7d9d1d8c9060f9835b8d10c14b107a0
[ "MIT" ]
null
null
null
Wurm/Optimize/python/optimize.py
Zomega/thesis
babd1bacc7d9d1d8c9060f9835b8d10c14b107a0
[ "MIT" ]
null
null
null
#!/usr/bin/env python import click from MatrixIO import load, store import LP # Linear Solvers import QP # Quadratic Solvers @click.group() def optimizers(): pass @optimizers.command() @click.option('-c', type=click.Path(exists=True)) @click.option('-A', type=click.Path(exists=True)) @click.option('-b', type=click.Path(exists=True)) @click.option('--out', type=click.Path(exists=False)) def lp(c, a, b, out): c = load(c) A = load(a) b = load(b) x = LP.solve(c=c, A=A, b=b) store(out, x) print "Result written to " + out #Q = 2*matrix([ [2, .5], [.5, 1] ]) #p = matrix([1.0, 1.0]) #G = matrix([[-1.0,0.0],[0.0,-1.0]]) #h = matrix([0.0,0.0]) #A = matrix([1.0, 1.0], (1,2)) #b = matrix(1.0) # TODO: Rewrite QP... @optimizers.command() @click.option('-c', type=click.Path(exists=True)) @click.option('-A', type=click.Path(exists=True)) @click.option('-b', type=click.Path(exists=True)) @click.option('--out', type=click.Path(exists=False)) def qp(c, a, b, out): c = load(c) A = load(a) b = load(b) x = LP.solve(c=c, A=A, b=b) store(out, x) print "Result written to " + out if __name__ == '__main__': optimizers()
23.163265
53
0.622907
204
1,135
3.426471
0.245098
0.125894
0.148784
0.217454
0.695279
0.666667
0.666667
0.666667
0.666667
0.666667
0
0.029622
0.137445
1,135
48
54
23.645833
0.684372
0.201762
0
0.666667
0
0
0.073661
0
0
0
0
0.020833
0
0
null
null
0.030303
0.121212
null
null
0.060606
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
1
0
0
0
0
0
0
0
0
4
29f89c338815c7de4818880f719d37456db03b6b
122
py
Python
predictor/urls.py
Ki6an/hit-predictor
20d90b4ed7085b1fbda4d33558007705653b290e
[ "MIT" ]
null
null
null
predictor/urls.py
Ki6an/hit-predictor
20d90b4ed7085b1fbda4d33558007705653b290e
[ "MIT" ]
null
null
null
predictor/urls.py
Ki6an/hit-predictor
20d90b4ed7085b1fbda4d33558007705653b290e
[ "MIT" ]
null
null
null
from django.urls import path from .views import predict_view urlpatterns = [ path("", predict_view, name="home"), ]
15.25
40
0.704918
16
122
5.25
0.6875
0.261905
0
0
0
0
0
0
0
0
0
0
0.172131
122
7
41
17.428571
0.831683
0
0
0
0
0
0.032787
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
29ff0272e9dad2aa5f1e0f6ce879c6d7bbfa919e
1,381
py
Python
restaurant/items.py
piaotiejun/restaurant
e651f2cc27c1ff197fcdce34a484e6b2ed88b354
[ "MIT" ]
20
2015-09-08T16:13:57.000Z
2021-01-18T07:15:25.000Z
restaurant/items.py
RhmpzYYX/restaurant
14b3bc334945f48ed3b57805a8bb774519949d92
[ "MIT" ]
5
2015-09-22T03:17:03.000Z
2017-11-23T06:52:01.000Z
restaurant/items.py
RhmpzYYX/restaurant
14b3bc334945f48ed3b57805a8bb774519949d92
[ "MIT" ]
13
2016-04-26T10:13:53.000Z
2021-05-18T10:32:52.000Z
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html import scrapy class MeituanItem(scrapy.Item): restaurant_name = scrapy.Field() phone = scrapy.Field() address = scrapy.Field() score = scrapy.Field() brief = scrapy.Field() lat = scrapy.Field() lng = scrapy.Field() meituan_url = scrapy.Field() meituan_logo_url = scrapy.Field() comment = scrapy.Field() category = scrapy.Field() province = scrapy.Field() province_code = scrapy.Field() city = scrapy.Field() region = scrapy.Field() area = scrapy.Field() area_code = scrapy.Field() region_code = scrapy.Field() city_code = scrapy.Field() class DazhongdianpingItem(scrapy.Item): province = scrapy.Field() province_code = scrapy.Field() city = scrapy.Field() city_code = scrapy.Field() region = scrapy.Field() region_code = scrapy.Field() area = scrapy.Field() area_code = scrapy.Field() restaurant_name = scrapy.Field() phone = scrapy.Field() address = scrapy.Field() score = scrapy.Field() brief = scrapy.Field() lat = scrapy.Field() lng = scrapy.Field() dianping_url = scrapy.Field() dianping_logo_url = scrapy.Field() comment = scrapy.Field() category = scrapy.Field()
24.660714
51
0.648081
163
1,381
5.392638
0.288344
0.47554
0.136519
0.064846
0.732651
0.718999
0.627986
0.627986
0.627986
0.525597
0
0.000927
0.218682
1,381
55
52
25.109091
0.813716
0.100652
0
0.829268
0
0
0
0
0
0
0
0
0
1
0
false
0
0.02439
0
1
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
29ff57805fdf69f6db24e9a8af7d94be1745ff8b
434
py
Python
src/pyrin/globalization/datetime/component.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
src/pyrin/globalization/datetime/component.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
src/pyrin/globalization/datetime/component.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """ datetime component module. """ from pyrin.application.decorators import component from pyrin.application.structs import Component from pyrin.globalization.datetime import DateTimePackage from pyrin.globalization.datetime.manager import DateTimeManager @component(DateTimePackage.COMPONENT_NAME) class DateTimeComponent(Component, DateTimeManager): """ datetime component class. """ pass
24.111111
64
0.781106
43
434
7.860465
0.465116
0.106509
0.118343
0.142012
0
0
0
0
0
0
0
0.002639
0.126728
434
17
65
25.529412
0.889182
0.172811
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.142857
0.571429
0
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
4b021ea5a84b927be3e244a6e596ca681f0a13f5
44
py
Python
notebooks/ipython-master/examples/IPython Kernel/script.py
burkesquires/jupyter_training_2020
63505d9b8133f80330fe92a74b7641066dba420c
[ "MIT" ]
2
2020-11-18T19:29:20.000Z
2021-09-09T13:52:29.000Z
notebooks/ipython-master/examples/IPython Kernel/script.py
burkesquires/jupyter_training_2020
63505d9b8133f80330fe92a74b7641066dba420c
[ "MIT" ]
null
null
null
notebooks/ipython-master/examples/IPython Kernel/script.py
burkesquires/jupyter_training_2020
63505d9b8133f80330fe92a74b7641066dba420c
[ "MIT" ]
2
2020-11-18T19:39:31.000Z
2021-11-17T07:49:09.000Z
x = 10 y = 20 z = x+y print('z is: %s' % z)
8.8
21
0.431818
12
44
1.583333
0.666667
0
0
0
0
0
0
0
0
0
0
0.133333
0.318182
44
4
22
11
0.5
0
0
0
0
0
0.181818
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
1
1
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
4
4b1bc6b87ade5847551e1ce4c5a805c0e7e4974a
51
py
Python
envconsul/errors.py
cevaris/envconsul
aeb490a5f47e2c2fd8a467a9d13eb9917cc4cadb
[ "MIT" ]
36
2015-03-05T01:47:34.000Z
2021-08-09T20:07:01.000Z
envconsul/errors.py
cevaris/envconsul
aeb490a5f47e2c2fd8a467a9d13eb9917cc4cadb
[ "MIT" ]
6
2015-06-26T15:02:43.000Z
2021-06-10T17:38:54.000Z
envconsul/errors.py
cevaris/envconsul
aeb490a5f47e2c2fd8a467a9d13eb9917cc4cadb
[ "MIT" ]
11
2015-04-15T18:24:31.000Z
2022-03-26T16:35:59.000Z
class ConsulConnectionFailed(Exception): pass
12.75
40
0.784314
4
51
10
1
0
0
0
0
0
0
0
0
0
0
0
0.156863
51
3
41
17
0.930233
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
d9ae60f7c3a402dda7d899c7633a7c2c491f0c94
546
py
Python
spec/python/test_repeat_n_struct.py
DarkShadow44/kaitai_struct_tests
4bb13cef82965cca66dda2eb2b77cd64e9f70a12
[ "MIT" ]
11
2018-04-01T03:58:15.000Z
2021-08-14T09:04:55.000Z
spec/python/test_repeat_n_struct.py
DarkShadow44/kaitai_struct_tests
4bb13cef82965cca66dda2eb2b77cd64e9f70a12
[ "MIT" ]
73
2016-07-20T10:27:15.000Z
2020-12-17T18:56:46.000Z
spec/python/test_repeat_n_struct.py
DarkShadow44/kaitai_struct_tests
4bb13cef82965cca66dda2eb2b77cd64e9f70a12
[ "MIT" ]
37
2016-08-15T08:25:56.000Z
2021-08-28T14:48:46.000Z
# Autogenerated from KST: please remove this line if doing any edits by hand! import unittest from repeat_n_struct import RepeatNStruct class TestRepeatNStruct(unittest.TestCase): def test_repeat_n_struct(self): with RepeatNStruct.from_file('src/repeat_n_struct.bin') as r: self.assertEqual(len(r.chunks), 2) self.assertEqual(r.chunks[0].offset, 16) self.assertEqual(r.chunks[0].len, 8312) self.assertEqual(r.chunks[1].offset, 8328) self.assertEqual(r.chunks[1].len, 15)
36.4
77
0.688645
76
546
4.842105
0.552632
0.203804
0.173913
0.23913
0.25
0
0
0
0
0
0
0.039261
0.20696
546
14
78
39
0.810624
0.137363
0
0
1
0
0.049041
0.049041
0
0
0
0
0.5
1
0.1
false
0
0.2
0
0.4
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
d9b541d2f62b39af2cf3e3d3d383572a1cbeb5fd
124
py
Python
tutoria/review/admin.py
JRChow/tutoria
23c1669d5a8fab4e46c88a005750341c8632fea8
[ "MIT" ]
4
2018-03-25T10:26:55.000Z
2019-09-22T14:41:21.000Z
tutoria/review/admin.py
li-boxuan/tutoria
3a3832dd970c74fa0eb972171cb2600ef8146cc2
[ "MIT" ]
null
null
null
tutoria/review/admin.py
li-boxuan/tutoria
3a3832dd970c74fa0eb972171cb2600ef8146cc2
[ "MIT" ]
4
2018-09-16T22:35:52.000Z
2020-07-26T15:54:34.000Z
from django.contrib import admin from review.models import Review # Register your models here. admin.site.register(Review)
20.666667
32
0.814516
18
124
5.611111
0.611111
0
0
0
0
0
0
0
0
0
0
0
0.120968
124
5
33
24.8
0.926606
0.209677
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d9b561bc1364741987c03f2a6e92cb6a3883c07f
80
py
Python
run.py
monder/mongo-elastic-docker
441e5272b27680242a619f1354668217db2a6802
[ "MIT" ]
3
2015-09-29T05:48:46.000Z
2016-09-29T14:00:18.000Z
run.py
monder/mongo-elastic-docker
441e5272b27680242a619f1354668217db2a6802
[ "MIT" ]
null
null
null
run.py
monder/mongo-elastic-docker
441e5272b27680242a619f1354668217db2a6802
[ "MIT" ]
7
2015-09-29T05:49:05.000Z
2019-10-10T14:15:32.000Z
from mongo_es import launcher if __name__ == '__main__': launcher.launch()
16
29
0.725
10
80
4.9
0.9
0
0
0
0
0
0
0
0
0
0
0
0.175
80
4
30
20
0.742424
0
0
0
0
0
0.1
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
d9cb5b6c5b2d80eb1d6762d57ddb499794b317f0
14,214
py
Python
data/Database/user.py
TheophileDiot/Omnitron
0c147fc44da151481492da9a80d888e7a6f7dae5
[ "MIT" ]
4
2021-09-29T08:28:34.000Z
2022-01-15T15:40:43.000Z
data/Database/user.py
TheophileDiot/Omnitron
0c147fc44da151481492da9a80d888e7a6f7dae5
[ "MIT" ]
2
2021-09-20T12:06:37.000Z
2021-10-16T12:50:22.000Z
data/Database/user.py
TheophileDiot/Omnitron
0c147fc44da151481492da9a80d888e7a6f7dae5
[ "MIT" ]
null
null
null
from collections import OrderedDict from datetime import datetime from math import ceil from data import Utils class User: def __init__(self, model, bot) -> None: self.model = model self.innerpath = "users" self.bot = bot """ CHECKS """ def __check_user_exists(function): """Checks if the user exists in the database Keyword arguments: function -- the function to be invoked after the check """ def check(self, guild_id: int, user_id: int, *args, **kargs): if not self.model.get(f"{self.path}/{user_id}"): self.create_user( guild_id, user_id, f"{self.bot.get_guild(guild_id).get_member(user_id)}", ) return function(self, guild_id, user_id, *args, **kargs) return check def __check_user_level(function): """Checks if the user has less than the maximum server level Keyword arguments: function -- the function to be invoked after the check """ def check(self, guild_id: int, user_id: int, value, *args, **kargs): level = self.get_user(guild_id, user_id)["level"] warn = False if (level + value) > self.bot.configs[guild_id]["xp"]["max_lvl"]: value = self.bot.configs[guild_id]["xp"]["max_lvl"] - level warn = True return function(self, guild_id, user_id, value, warn, *args, **kargs) return check def __check_user_level_remove(function): """Checks if the user has more than 1 level Keyword arguments: function -- the function to be invoked after the check """ def check(self, guild_id: int, user_id: int, value, *args, **kargs): level = self.get_user(guild_id, user_id)["level"] warn = False if (level - value) <= 0: value = level - 1 warn = True return function(self, guild_id, user_id, value, warn, *args, **kargs) return check def __check_user_prestige(function): """Checks if the user has less than the maximum server prestige Keyword arguments: function -- the function to be invoked after the check """ def check( self, guild_id: int, user_id: int, value: int = 1, level: int = 1, xp: int = 0, warn: bool = False, *args, **kargs, ): prestige = self.get_user(guild_id, user_id)["prestige"] warn = False value = 1 if (prestige + 1) > len(self.bot.configs[guild_id]["xp"]["prestiges"]): value = 0 warn = True return function( self, guild_id, user_id, value, level, xp, warn, *args, **kargs ) return check """ CREATION & DELETION """ @Utils.resolve_guild_path def create_user(self, guild_id: int, _id: int, name: str) -> None: self.model.create( f"{self.path}/{_id}", args={ "id": _id, "name": name, "muted": False, "xp": 0, "level": 1, "prestige": 0, }, ) @Utils.resolve_guild_path def update_user(self, guild_id: int, _id: int, name: str) -> None: self.model.update( f"{self.path}/{_id}", args={ "name": name, }, ) """ SANCTIONS """ @Utils.resolve_guild_path @__check_user_exists def warn_user( self, guild_id: int, _id: int, at: float, by: str, reason: str = None ) -> None: path = f"{self.path}/{_id}/warns" x = len([warn for warn in self.model.get(f"{path}")]) self.model.create( f"{path}/{x}", args={ "at": datetime.fromtimestamp(at).strftime("%d/%m/%Y, %H:%M:%S"), "at_s": at, "by": by, "reason": reason, }, ) @Utils.resolve_guild_path @__check_user_exists def get_warns(self, guild_id: int, _id: int) -> OrderedDict: return self.model.get(f"{self.path}/{_id}/warns") @Utils.resolve_guild_path @__check_user_exists def clear_warns(self, guild_id: int, _id: int) -> None: self.model.delete(f"{self.path}/{_id}/warns") @Utils.resolve_guild_path @__check_user_exists def mute_user( self, guild_id: int, _id: int, _duration: int, at: float, by: str, reason: str = None, ) -> None: path = f"{self.path}/{_id}/mutes" x = len([mute for mute in self.model.get(f"{path}")]) self.model.create( f"{path}/{x}", args={ "duration": self.bot.utils_class.duration(_duration), "duration_s": _duration, "at": datetime.fromtimestamp(at).strftime("%d/%m/%Y, %H:%M:%S"), "at_s": at, "by": by, "reason": reason, }, ) self.model.update(f"{self.path}/{_id}", args={"muted": True}) @Utils.resolve_guild_path @__check_user_exists def unmute_user(self, guild_id: int, _id: int) -> None: self.model.update(f"{self.path}/{_id}", args={"muted": False}) @Utils.resolve_guild_path @__check_user_exists def clear_join_mutes(self, guild_id: int, _id: int) -> None: db_user = self.get_user(guild_id, _id) if "mutes" in db_user: x = 0 for mute in db_user["mutes"]: if "reason" in mute and mute["reason"] == "joined the server": self.model.delete(f"{self.path}/{_id}/mutes/{x}") x += 1 @Utils.resolve_guild_path @__check_user_exists def get_last_mute(self, guild_id: int, _id: int) -> dict: path = f"{self.path}/{_id}/mutes" mutes = [mute for mute in self.model.get(f"{path}")] return mutes[-1] if len(mutes) > 0 else {} @Utils.resolve_guild_path @__check_user_exists def ban_user( self, guild_id: int, _id: int, _duration, at: float, by: str, reason: str = None ) -> None: self.model.create( f"{self.path}/{_id}/ban", args={ "duration": self.bot.utils_class.duration(_duration) if isinstance(_duration, int) else "all Eternity", "duration_s": _duration if isinstance(_duration, int) else "infinite", "at": datetime.fromtimestamp(at).strftime("%d/%m/%Y, %H:%M:%S"), "at_s": at, "by": by, "reason": reason, }, ) @Utils.resolve_guild_path @__check_user_exists def unban_user( self, guild_id: int, _id: int, at: float, by: str, reason: str = None ) -> None: self.model.create( f"{self.path}/{_id}/unban/{int(at)}", args={ "at": datetime.fromtimestamp(at).strftime("%d/%m/%Y, %H:%M:%S"), "at_s": at, "by": by, "reason": reason, "original_ban": self.model.get(f"{self.path}/{_id}/ban"), }, ) self.model.delete(f"{self.path}/{_id}/ban") """ XP """ @Utils.resolve_guild_path @__check_user_exists def add_xp(self, guild_id: int, _id: int, value: int) -> None: path = f"{self.path}/{_id}" xp = (self.model.get(f"{path}"))["xp"] self.model.update(f"{self.path}/{_id}", args={"xp": xp + value}) @Utils.resolve_guild_path @__check_user_exists @__check_user_level def add_levels( self, guild_id: int, _id: int, value: int, warn: bool = False ) -> tuple: path = f"{self.path}/{_id}" level = (self.model.get(f"{path}"))["level"] self.model.update(f"{self.path}/{_id}", args={"level": level + value}) return warn, value, level + value @Utils.resolve_guild_path @__check_user_exists @__check_user_level_remove def remove_levels( self, guild_id: int, _id: int, value: int, warn: bool = False ) -> tuple: path = f"{self.path}/{_id}" level = (self.model.get(f"{path}"))["level"] self.model.update(f"{self.path}/{_id}", args={"level": level - value}) return warn, value, level - value @Utils.resolve_guild_path @__check_user_exists def set_levels(self, guild_id: int, _id: int, level: int) -> None: self.model.update(f"{self.path}/{_id}", args={"level": level}) @Utils.resolve_guild_path @__check_user_exists @__check_user_prestige def add_prestige( self, guild_id: int, _id: int, value: int = 1, level: int = 1, xp: int = 0, warn: bool = False, ) -> bool: db_user = self.get_user(guild_id, _id) self.model.update( f"{self.path}/{_id}", args={"prestige": db_user["prestige"] + value, "level": level, "xp": xp}, ) return warn @Utils.resolve_guild_path @__check_user_exists def remove_prestige(self, guild_id: int, _id: int, xp: int, value: int = 1) -> None: db_user = self.get_user(guild_id, _id) self.model.update( f"{self.path}/{_id}", args={ "prestige": db_user["prestige"] - value if db_user["prestige"] > 0 else 0, "level": self.bot.configs[guild_id]["xp"]["max_lvl"], "xp": xp, }, ) @Utils.resolve_guild_path @__check_user_exists def prepare_prestige(self, guild_id: int, _id: int, confirmation_id: int) -> bool: self.model.create( f"{self.path}/{_id}/prestige_pending", args={"confirmation_id": confirmation_id}, ) @Utils.resolve_guild_path @__check_user_exists def cancel_prestige(self, guild_id: int, _id: int) -> None: self.model.delete(f"{self.path}/{_id}/prestige_pending") @Utils.resolve_guild_path @__check_user_exists def clear_xp(self, guild_id: int, _id: int) -> None: self.model.update(f"{self.path}/{_id}", args={"xp": 0}) """ OTHERS """ @Utils.resolve_guild_path @__check_user_exists def get_user(self, guild_id: int, _id: int) -> OrderedDict: return self.model.get(f"{self.path}/{_id}") @Utils.resolve_guild_path def get_users(self, guild_id: int) -> OrderedDict: return self.model.get(f"{self.path}") @Utils.resolve_guild_path @__check_user_exists def new_invite(self, guild_id: int, _id: int, at: float, content: str) -> None: self.model.create( f"{self.path}/{_id}/invit_links/{ceil(at)}", args={ "at": datetime.fromtimestamp(at).strftime("%d/%m/%Y, %H:%M:%S"), "at_s": at, "content": content, }, ) @Utils.resolve_guild_path @__check_user_exists def get_invites(self, guild_id: int, _id: int) -> None: return self.model.get(f"{self.path}/{_id}/invit_links") @Utils.resolve_guild_path @__check_user_exists def clear_invites(self, guild_id: int, _id: int) -> None: self.model.delete(f"{self.path}/{_id}/invit_links") @Utils.resolve_guild_path @__check_user_exists def get_commands_count( self, guild_id: int, _id: int, details: bool = False ) -> int or OrderedDict: if details: return self.model.get(f"{self.path}/{_id}/commands_count") count = 0 commands = self.model.get(f"{self.path}/{_id}/commands_count") for command in commands.values(): count += command return count @Utils.resolve_guild_path @__check_user_exists def add_messages_count(self, guild_id: int, _id: int, channel_id: int) -> None: counts = self.model.get(f"{self.path}/{_id}/messages_count") if counts: self.model.update( f"{self.path}/{_id}/messages_count", args={ **{ channel_id: ( counts.pop(str(channel_id)) if str(channel_id) in counts else 0 ) + 1 }, **counts, }, ) else: self.model.create(f"{self.path}/{_id}/messages_count", args={channel_id: 1}) @Utils.resolve_guild_path @__check_user_exists def add_command_count(self, guild_id: int, _id: int, command: str) -> None: counts = self.model.get(f"{self.path}/{_id}/commands_count") if counts: self.model.update( f"{self.path}/{_id}/commands_count", args={ **{command: (counts.pop(command) if command in counts else 0) + 1}, **counts, }, ) else: self.model.create(f"{self.path}/{_id}/commands_count", args={command: 1}) @Utils.resolve_guild_path @__check_user_exists def add_voice_time( self, guild_id: int, _id: int, channel_id: int, value: int = 1 ) -> None: counts = self.model.get(f"{self.path}/{_id}/voice_count") if counts: self.model.update( f"{self.path}/{_id}/voice_count", args={ **{ channel_id: ( counts.pop(str(channel_id)) if str(channel_id) in counts else 0 ) + value }, **counts, }, ) else: self.model.create( f"{self.path}/{_id}/voice_count", args={channel_id: value} )
32.085779
88
0.523146
1,710
14,214
4.094737
0.079532
0.048558
0.05527
0.06441
0.835476
0.807769
0.771351
0.722079
0.631819
0.485433
0
0.003417
0.341143
14,214
442
89
32.158371
0.744261
0.035247
0
0.497207
0
0
0.118949
0.060548
0
0
0
0
0
1
0.106145
false
0
0.011173
0.011173
0.170391
0
0
0
0
null
0
0
0
1
1
1
1
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
4
d9e991943e72e0ed269d2aa2e5bf2216b521e1a2
163
py
Python
src/metrics/metrics.py
APMplusplus/falkon
95708ed0b28c4ec0f611446a478e9c3445eb3508
[ "Apache-2.0" ]
2
2019-04-20T05:25:25.000Z
2020-04-11T20:42:46.000Z
src/metrics/metrics.py
saikrishnarallabandi/falkon
95708ed0b28c4ec0f611446a478e9c3445eb3508
[ "Apache-2.0" ]
12
2019-01-07T00:17:04.000Z
2019-01-20T20:22:24.000Z
src/metrics/metrics.py
APMplusplus/falkon
95708ed0b28c4ec0f611446a478e9c3445eb3508
[ "Apache-2.0" ]
2
2019-03-26T14:09:05.000Z
2019-04-20T05:25:37.000Z
from sklearn.metrics import * class unweighted_recall(recall_score): def __init__(self, dtype='float', **kwargs): super().__init__(**kwargs)
18.111111
49
0.662577
18
163
5.444444
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.202454
163
8
50
20.375
0.753846
0
0
0
0
0
0.030675
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
8a3ff4c3c3854cb18f554614fe6d6e9c1eb36911
389
py
Python
argo_workflow_tools/__init__.py
shanioren/argo-workflow-tools
d2fb41de3f5ccf9284ff4cb027a886ff61a13e69
[ "Apache-2.0" ]
15
2021-12-08T20:57:52.000Z
2022-03-23T19:41:29.000Z
argo_workflow_tools/__init__.py
shanioren/argo-workflow-tools
d2fb41de3f5ccf9284ff4cb027a886ff61a13e69
[ "Apache-2.0" ]
18
2021-12-07T07:49:17.000Z
2022-03-02T10:27:49.000Z
argo_workflow_tools/__init__.py
shanioren/argo-workflow-tools
d2fb41de3f5ccf9284ff4cb027a886ff61a13e69
[ "Apache-2.0" ]
3
2022-01-09T08:19:11.000Z
2022-02-09T15:20:08.000Z
from .argo_client import ArgoClient from .argo_options import ArgoOptions from .dsl import CronWorkflow, Workflow, WorkflowTemplate import argo_workflow_tools.dsl.dsl_decorators as dsl from .dsl.condition import Condition from .exceptions.workflow_not_found_exception import WorkflowNotFoundException from .workflow_result import WorkflowResult from .workflow_status import WorkflowStatus
43.222222
78
0.879177
48
389
6.916667
0.5
0.048193
0
0
0
0
0
0
0
0
0
0
0.087404
389
8
79
48.625
0.935211
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
8a57ec5c79d777052999aab5d63aa3547e1b73b4
1,543
py
Python
venv/Lib/site-packages/rest_framework_extensions/etag/mixins.py
LishenZz/my_project
c2ac8199efb467e303d343ea34ed1969b64280d7
[ "Apache-2.0" ]
null
null
null
venv/Lib/site-packages/rest_framework_extensions/etag/mixins.py
LishenZz/my_project
c2ac8199efb467e303d343ea34ed1969b64280d7
[ "Apache-2.0" ]
null
null
null
venv/Lib/site-packages/rest_framework_extensions/etag/mixins.py
LishenZz/my_project
c2ac8199efb467e303d343ea34ed1969b64280d7
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from rest_framework_extensions.etag.decorators import etag from rest_framework_extensions.settings import extensions_api_settings class BaseETAGMixin(object): # todo: test me. Create generic test like test_etag(view_instance, method, should_rebuild_after_method_evaluation) object_etag_func = extensions_api_settings.DEFAULT_OBJECT_ETAG_FUNC list_etag_func = extensions_api_settings.DEFAULT_LIST_ETAG_FUNC class ListETAGMixin(BaseETAGMixin): @etag(etag_func='list_etag_func') def list(self, request, *args, **kwargs): return super(ListETAGMixin, self).list(request, *args, **kwargs) class RetrieveETAGMixin(BaseETAGMixin): @etag(etag_func='object_etag_func') def retrieve(self, request, *args, **kwargs): return super(RetrieveETAGMixin, self).retrieve(request, *args, **kwargs) class UpdateETAGMixin(BaseETAGMixin): @etag(etag_func='object_etag_func', rebuild_after_method_evaluation=True) def update(self, request, *args, **kwargs): return super(UpdateETAGMixin, self).update(request, *args, **kwargs) class DestroyETAGMixin(BaseETAGMixin): @etag(etag_func='object_etag_func') def destroy(self, request, *args, **kwargs): return super(DestroyETAGMixin, self).destroy(request, *args, **kwargs) class ReadOnlyETAGMixin(RetrieveETAGMixin, ListETAGMixin): pass class ETAGMixin(RetrieveETAGMixin, UpdateETAGMixin, DestroyETAGMixin, ListETAGMixin): pass
33.543478
118
0.728451
169
1,543
6.408284
0.289941
0.088643
0.125577
0.092336
0.327793
0.298246
0.113573
0.077562
0
0
0
0.000782
0.171743
1,543
45
119
34.288889
0.846635
0.086844
0
0.206897
0
0
0.044097
0
0
0
0
0.022222
0
1
0.137931
false
0.068966
0.068966
0.137931
0.655172
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
1
1
0
0
4
8a794303a054bbce2672eb70541d25583de0cb80
557
py
Python
trinity/rpc/modules/web3.py
Bhargavasomu/trinity
c4e387465b222f8a870966f0eacf7a68fa5aee7a
[ "MIT" ]
null
null
null
trinity/rpc/modules/web3.py
Bhargavasomu/trinity
c4e387465b222f8a870966f0eacf7a68fa5aee7a
[ "MIT" ]
null
null
null
trinity/rpc/modules/web3.py
Bhargavasomu/trinity
c4e387465b222f8a870966f0eacf7a68fa5aee7a
[ "MIT" ]
2
2019-09-05T01:31:56.000Z
2019-09-17T09:09:16.000Z
from eth_hash.auto import keccak from eth_utils import decode_hex, encode_hex from trinity._utils.version import construct_trinity_client_identifier from trinity.rpc.modules import ( RPCModule, ) class Web3(RPCModule): async def clientVersion(self) -> str: """ Returns the current client version. """ return construct_trinity_client_identifier() async def sha3(self, data: str) -> str: """ Returns Keccak-256 of the given data. """ return encode_hex(keccak(decode_hex(data)))
24.217391
70
0.67684
68
557
5.352941
0.5
0.038462
0.120879
0.175824
0
0
0
0
0
0
0
0.011792
0.238779
557
22
71
25.318182
0.846698
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.363636
0
0.636364
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
8a85200ddaa90039bf155c5d6965e7987ef55211
69
py
Python
wagtail/tests/demosite/__init__.py
Nawarrr/wagtail
4db71de5a2af19086026605be8fcb92c4be623aa
[ "BSD-3-Clause" ]
null
null
null
wagtail/tests/demosite/__init__.py
Nawarrr/wagtail
4db71de5a2af19086026605be8fcb92c4be623aa
[ "BSD-3-Clause" ]
null
null
null
wagtail/tests/demosite/__init__.py
Nawarrr/wagtail
4db71de5a2af19086026605be8fcb92c4be623aa
[ "BSD-3-Clause" ]
null
null
null
default_app_config = "wagtail.tests.demosite.apps.DemositeAppConfig"
34.5
68
0.855072
8
69
7.125
1
0
0
0
0
0
0
0
0
0
0
0
0.043478
69
1
69
69
0.863636
0
0
0
0
0
0.652174
0.652174
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8a97760daaf2f9ff26b8e553e589909a68a84397
9,796
py
Python
tests/integration/tools/test_reset_tool.py
jeisch/bokeh
6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1
[ "BSD-3-Clause" ]
1
2020-03-21T04:11:51.000Z
2020-03-21T04:11:51.000Z
tests/integration/tools/test_reset_tool.py
jeisch/bokeh
6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1
[ "BSD-3-Clause" ]
2
2021-05-08T11:43:21.000Z
2021-05-10T19:16:43.000Z
tests/integration/tools/test_reset_tool.py
jeisch/bokeh
6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1
[ "BSD-3-Clause" ]
null
null
null
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- import pytest ; pytest #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports # External imports # Bokeh imports from bokeh.models import ( Circle, CategoricalScale, ColumnDataSource, CustomAction, CustomJS, DataRange1d, FactorRange, Plot, Range1d, Rect, ResetTool, ZoomInTool) from bokeh._testing.util.selenium import COUNT, RECORD #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- pytest_plugins = ( "bokeh._testing.plugins.bokeh", ) def _make_plot(): source = ColumnDataSource(dict(x=[1, 2], y=[1, 1])) plot = Plot(plot_height=400, plot_width=400, x_range=Range1d(0, 1), y_range=Range1d(0, 1), min_border=0) plot.add_glyph(source, Rect(x='x', y='y', width=0.9, height=0.9)) plot.add_tools(ResetTool(), ZoomInTool()) code = RECORD("xrstart", "p.x_range.start") + RECORD("xrend", "p.x_range.end") + RECORD("yrstart", "p.y_range.start") + RECORD("yrend", "p.y_range.end") plot.add_tools(CustomAction(callback=CustomJS(args=dict(p=plot), code=code))) plot.toolbar_sticky = False return plot @pytest.mark.integration @pytest.mark.selenium class Test_ResetTool(object): def test_deselected_by_default(self, single_plot_page): plot = _make_plot() page = single_plot_page(plot) button = page.get_toolbar_button('reset') assert 'active' not in button.get_attribute('class') assert page.has_no_console_errors() def test_clicking_resets_range(self, single_plot_page): plot = _make_plot() page = single_plot_page(plot) # Change the ranges using a zoom in tool button = page.get_toolbar_button('zoom-in') button.click() page.click_custom_action() results = page.results assert results['xrstart'] != 0 assert results['xrend'] != 1 assert results['yrstart'] != 0 assert results['yrend'] != 1 # Click the reset tool and check the ranges are restored button = page.get_toolbar_button('reset') button.click() page.click_custom_action() results = page.results assert results['xrstart'] == 0 assert results['xrend'] == 1 assert results['yrstart'] == 0 assert results['yrend'] == 1 assert page.has_no_console_errors() def test_clicking_resets_selection(self, single_plot_page): source = ColumnDataSource(dict(x=[1, 2], y=[1, 1])) source.selected.indices = [0] source.selected.line_indices = [0] # XXX (bev) string key for multiline_indices seems questionable source.selected.multiline_indices = {"0": [0]} plot = Plot(plot_height=400, plot_width=400, x_range=Range1d(0, 1), y_range=Range1d(0, 1), min_border=0) plot.add_glyph(source, Circle(x='x', y='y', size=20)) plot.add_tools(ResetTool()) code = \ RECORD("indices", "s.selected.indices") + \ RECORD("line_indices", "s.selected.line_indices") + \ RECORD("multiline_indices", "s.selected.multiline_indices") plot.add_tools(CustomAction(callback=CustomJS(args=dict(s=source), code=code))) plot.toolbar_sticky = False page = single_plot_page(plot) # Verify selections are non empty page.click_custom_action() results = page.results assert results['indices'] == [0] assert results['line_indices'] == [0] assert results['multiline_indices'] == {"0": [0]} # XXX (bev) string key # Click the reset tool and check the selections are restored button = page.get_toolbar_button('reset') button.click() page.click_custom_action() results = page.results assert results['indices'] == [] assert results['line_indices'] == [] assert results['multiline_indices'] == {} assert page.has_no_console_errors() def test_reset_triggers_range1d_callbacks(self, single_plot_page): source = ColumnDataSource(dict(x=[1, 2], y=[1, 1])) plot = Plot(plot_height=400, plot_width=400, x_range=Range1d(0, 1), y_range=Range1d(0, 1), min_border=0) plot.add_glyph(source, Circle(x='x', y='y', size=20)) plot.add_tools(ResetTool(), ZoomInTool()) plot.x_range.callback = CustomJS(code=COUNT("xrcb")) plot.x_range.js_on_change('start', CustomJS(code=COUNT("xrstart"))) plot.x_range.js_on_change('end', CustomJS(code=COUNT("xrend"))) plot.y_range.callback = CustomJS(code=COUNT("yrcb")) plot.y_range.js_on_change('start', CustomJS(code=COUNT("yrstart"))) plot.y_range.js_on_change('end', CustomJS(code=COUNT("yrend"))) page = single_plot_page(plot) # Change the ranges using a zoom in tool button = page.get_toolbar_button('zoom-in') button.click() results = page.results assert results['xrcb'] == 1 assert results['xrstart'] == 1 assert results['xrend'] == 1 assert results['yrcb'] == 1 assert results['yrstart'] == 1 assert results['yrend'] == 1 # Click the reset tool and check the callback was called button = page.get_toolbar_button('reset') button.click() results = page.results assert results['xrcb'] == 2 assert results['xrstart'] == 2 assert results['xrend'] == 2 assert results['yrcb'] == 2 assert results['yrstart'] == 2 assert results['yrend'] == 2 assert page.has_no_console_errors() def test_reset_triggers_datarange1d_callbacks(self, single_plot_page): source = ColumnDataSource(dict(x=[1, 2], y=[1, 1])) plot = Plot(plot_height=400, plot_width=400, x_range=DataRange1d(), y_range=DataRange1d(), min_border=0) plot.add_glyph(source, Circle(x='x', y='y', size=20)) plot.add_tools(ResetTool(), ZoomInTool()) plot.x_range.callback = CustomJS(code=COUNT("xrcb")) plot.x_range.js_on_change('start', CustomJS(code=COUNT("xrstart"))) plot.x_range.js_on_change('end', CustomJS(code=COUNT("xrend"))) plot.y_range.callback = CustomJS(code=COUNT("yrcb")) plot.y_range.js_on_change('start', CustomJS(code=COUNT("yrstart"))) plot.y_range.js_on_change('end', CustomJS(code=COUNT("yrend"))) page = single_plot_page(plot) # Change the ranges using a zoom in tool button = page.get_toolbar_button('zoom-in') button.click() # Callbacks have "extra" invocations due to DataRange1d auto-ranging on init. results = page.results assert results['xrcb'] == 3 assert results['xrstart'] == 2 assert results['xrend'] == 2 assert results['yrcb'] == 3 assert results['yrstart'] == 2 assert results['yrend'] == 2 # Click the reset tool and check the callback was called button = page.get_toolbar_button('reset') button.click() results = page.results assert results['xrcb'] == 6 assert results['xrstart'] == 3 assert results['xrend'] == 3 assert results['yrcb'] == 6 assert results['yrstart'] == 3 assert results['yrend'] == 3 assert page.has_no_console_errors() def test_reset_triggers_factorrange_callbacks(self, single_plot_page): source = ColumnDataSource(dict(x=["a", "b"], y=["a", "a"])) plot = Plot(plot_height=400, plot_width=400, x_scale=CategoricalScale(), x_range=FactorRange(factors=["a", "b", "c"]), y_scale=CategoricalScale(), y_range=FactorRange(factors=["a", "b", "c"]), min_border=0) plot.add_glyph(source, Circle(x='x', y='y', size=20)) plot.add_tools(ResetTool(), ZoomInTool()) plot.x_range.callback = CustomJS(code=COUNT("xrcb")) plot.x_range.js_on_change('start', CustomJS(code=COUNT("xrstart"))) plot.x_range.js_on_change('end', CustomJS(code=COUNT("xrend"))) plot.y_range.callback = CustomJS(code=COUNT("yrcb")) plot.y_range.js_on_change('start', CustomJS(code=COUNT("yrstart"))) plot.y_range.js_on_change('end', CustomJS(code=COUNT("yrend"))) page = single_plot_page(plot) # Change the ranges using a zoom in tool button = page.get_toolbar_button('zoom-in') button.click() results = page.results assert results['xrcb'] == 1 assert results['xrstart'] == 1 assert results['xrend'] == 1 assert results['yrcb'] == 1 assert results['yrstart'] == 1 assert results['yrend'] == 1 # Click the reset tool and check the callback was called button = page.get_toolbar_button('reset') button.click() results = page.results assert results['xrcb'] == 3 assert results['xrstart'] == 2 assert results['xrend'] == 2 assert results['yrcb'] == 3 assert results['yrstart'] == 2 assert results['yrend'] == 2 assert page.has_no_console_errors()
38.415686
156
0.589016
1,175
9,796
4.740426
0.138723
0.116697
0.054937
0.032316
0.749372
0.734111
0.708438
0.703411
0.686176
0.670377
0
0.019339
0.218763
9,796
254
157
38.566929
0.70848
0.15343
0
0.662722
0
0
0.091999
0.009563
0
0
0
0
0.337278
1
0.04142
false
0
0.017751
0
0.071006
0
0
0
0
null
0
0
0
0
1
1
1
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
4
8a987b8a940f5a4c93232f2c52f7c217c76a86db
2,023
py
Python
invest/cache.py
ababic/directory-cms
198425c874bc7185267f0d3006d4b7f8a8f07595
[ "MIT" ]
null
null
null
invest/cache.py
ababic/directory-cms
198425c874bc7185267f0d3006d4b7f8a8f07595
[ "MIT" ]
null
null
null
invest/cache.py
ababic/directory-cms
198425c874bc7185267f0d3006d4b7f8a8f07595
[ "MIT" ]
null
null
null
from core.cache import AbstractDatabaseCacheSubscriber from invest import models class SectorLandingPageSubscriber(AbstractDatabaseCacheSubscriber): model = models.SectorLandingPage subscriptions = [ models.SectorPage, ] class RegionLandingPageSubscriber(AbstractDatabaseCacheSubscriber): model = models.RegionLandingPage subscriptions = [ models.SectorPage, ] class SectorPageSubscriber(AbstractDatabaseCacheSubscriber): model = models.SectorPage subscriptions = [ # not a typo: each sector page contains a list of other sector pages models.SectorPage, ] class SetupGuideLandingPageSubscriber(AbstractDatabaseCacheSubscriber): model = models.SetupGuideLandingPage subscriptions = [ models.SetupGuidePage, ] class SetupGuidePageSubscriber(AbstractDatabaseCacheSubscriber): model = models.SetupGuidePage subscriptions = [ # not a typo: each guide page contains a list of other guide pages models.SetupGuidePage, ] class InvestHomePageSubscriber(AbstractDatabaseCacheSubscriber): model = models.InvestHomePage subscriptions = [ models.SectorPage, models.SetupGuidePage, ] class InfoPageSubscriber(AbstractDatabaseCacheSubscriber): model = models.InfoPage subscriptions = [] class HighPotentialOpportunityFormPageSubscriber( AbstractDatabaseCacheSubscriber ): model = models.HighPotentialOpportunityFormPage subscriptions = [ models.HighPotentialOpportunityDetailPage, ] class HighPotentialOpportunityDetailPageSubscriber( AbstractDatabaseCacheSubscriber ): model = models.HighPotentialOpportunityDetailPage subscriptions = [ models.HighPotentialOpportunityDetailPage, ] class HighPotentialOpportunityFormSuccessPageSubscriber( AbstractDatabaseCacheSubscriber ): model = models.HighPotentialOpportunityFormSuccessPage subscriptions = [ models.HighPotentialOpportunityDetailPage, ]
24.975309
76
0.757291
125
2,023
12.256
0.336
0.234987
0.274151
0.044386
0.063969
0.031332
0
0
0
0
0
0
0.190806
2,023
80
77
25.2875
0.935858
0.064755
0
0.438596
0
0
0
0
0
0
0
0
0
1
0
false
0
0.035088
0
0.561404
0
0
0
1
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
1
0
0
4
8a9d3c362bc225cb243e9566fa82f0bdaa80c730
68
py
Python
lib/__init__.py
sybren-marechal/Digital_Led_Strip_MQTT
a2d24fa3f058bac0a60736cfd81e96b744116450
[ "MIT" ]
null
null
null
lib/__init__.py
sybren-marechal/Digital_Led_Strip_MQTT
a2d24fa3f058bac0a60736cfd81e96b744116450
[ "MIT" ]
null
null
null
lib/__init__.py
sybren-marechal/Digital_Led_Strip_MQTT
a2d24fa3f058bac0a60736cfd81e96b744116450
[ "MIT" ]
null
null
null
# Signifies to Python that it's "ok to import from this directory".
34
67
0.75
12
68
4.25
0.916667
0
0
0
0
0
0
0
0
0
0
0
0.176471
68
1
68
68
0.910714
0.955882
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
8aa6ae56d6f70d5303357058c97426b3839f463d
157
py
Python
examples/sdb/zoo.py
draustin/otk
c6e91423ec79b85b380ee9385f6d27c91f92503d
[ "MIT" ]
7
2020-05-17T14:26:42.000Z
2022-02-14T04:52:54.000Z
examples/sdb/zoo.py
uamhforever/otk
c6e91423ec79b85b380ee9385f6d27c91f92503d
[ "MIT" ]
17
2020-04-10T22:50:00.000Z
2020-06-18T04:54:19.000Z
examples/sdb/zoo.py
uamhforever/otk
c6e91423ec79b85b380ee9385f6d27c91f92503d
[ "MIT" ]
1
2022-02-14T04:52:45.000Z
2022-02-14T04:52:45.000Z
from otk.sdb import sdb_qt as sdb from otk.sdb import demoscenes with sdb.application(): w = sdb.ScenesViewer(demoscenes.make_all_scenes()) w.show()
26.166667
54
0.745223
25
157
4.56
0.6
0.122807
0.175439
0.280702
0
0
0
0
0
0
0
0
0.152866
157
6
55
26.166667
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.4
0
0.4
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
8ab01b6f4460b9c7c1fdafa494e9983fea681981
100,219
py
Python
tests/integration/test_model_attributes.py
bromic007/smartsheet-python-sdk
ef256b7421a65a56a7138dc2b3eb5d69a1a06590
[ "Apache-2.0" ]
106
2015-02-21T14:26:32.000Z
2022-03-31T05:56:53.000Z
tests/integration/test_model_attributes.py
bromic007/smartsheet-python-sdk
ef256b7421a65a56a7138dc2b3eb5d69a1a06590
[ "Apache-2.0" ]
94
2015-02-09T13:16:00.000Z
2022-03-16T06:37:41.000Z
tests/integration/test_model_attributes.py
bromic007/smartsheet-python-sdk
ef256b7421a65a56a7138dc2b3eb5d69a1a06590
[ "Apache-2.0" ]
85
2015-02-06T22:05:25.000Z
2022-03-16T06:22:59.000Z
import pytest import smartsheet # Given Python's variable naming convention of snake_case, # and Smartsheet's API attribute naming convention of # lowerCamelCase, this set of tests is intended to make # sure all of that is handled correctly. @pytest.mark.usefixtures("smart_setup") class TestModelAttributes: def test_row(self, smart_setup): smart = smart_setup['smart'] # above, above # access_level, accessLevel # attachments, attachments # cells, cells # columns, columns # conditional_format, conditionalFormat # created_at, createdAt # discussions, discussions # expanded, expanded # filtered_out, filteredOut # format, format # id, id # in_critical_path, inCriticalPath # locked, locked # locked_for_user, lockedForUser # modified_at, modifiedAt # parent_id, parentId # permalink, permalink # row_number, rowNumber # sheet_id, sheetId # sibling_id, siblingId # to_bottom, toBottom # to_top, toTop # version, version model = smart.models.Row({ 'above': True, 'accessLevel': 'VIEWER', 'attachments': smart.models.Attachment(), 'cells': smart.models.Cell(), 'columns': smart.models.Column(), 'conditionalFormat': 'foo', 'discussions': smart.models.Discussion(), 'expanded': True, 'filteredOut': True, 'format': 'foo', 'id': 19082, 'inCriticalPath': True, 'locked': True, 'lockedForUser': True, 'parentId': 19082, 'permalink': 'foo', 'rowNumber': 19082, 'sheetId': 19082, 'siblingId': 19082, 'toBottom': True, 'toTop': True, 'version': 19082 }) assert model.above == True assert model.access_level == 'VIEWER' assert isinstance(model.attachments[0], smart.models.Attachment) assert isinstance(model.cells[0], smart.models.Cell) assert isinstance(model.columns[0], smart.models.Column) assert model.conditional_format == 'foo' assert isinstance(model.discussions[0], smart.models.Discussion) assert model.expanded == True assert model.filtered_out == True assert model.format == 'foo' assert model.id == 19082 assert model.in_critical_path == True assert model.locked == True assert model.locked_for_user == True assert model.parent_id == 19082 assert model.permalink == 'foo' assert model.row_number == 19082 assert model.sheet_id == 19082 assert model.sibling_id == 19082 assert model.to_bottom == True assert model.to_top == True assert model.version == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_row_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Row({ 'above': True, 'attachments': smart.models.Attachment(), 'cells': smart.models.Cell(), 'columns': smart.models.Column(), 'discussions': smart.models.Discussion(), 'expanded': True, 'filteredOut': True, 'locked': True, 'lockedForUser': True, 'permalink': 'foo', 'rowNumber': 19082, 'sheetId': 19082, 'version': 19082, 'access_level': 'VIEWER', 'conditional_format': 'foo', 'format': 'foo', 'id': 19082, 'in_critical_path': True, 'parent_id': 19082, 'sibling_id': 19082, 'to_bottom': True, 'to_top': True }) assert model.above == True assert model.access_level == 'VIEWER' assert isinstance(model.attachments[0], smart.models.Attachment) assert isinstance(model.cells[0], smart.models.Cell) assert isinstance(model.columns[0], smart.models.Column) assert model.conditional_format == 'foo' assert isinstance(model.discussions[0], smart.models.Discussion) assert model.expanded == True assert model.filtered_out == True assert model.format == 'foo' assert model.id == 19082 assert model.in_critical_path == True assert model.locked == True assert model.locked_for_user == True assert model.parent_id == 19082 assert model.permalink == 'foo' assert model.row_number == 19082 assert model.sheet_id == 19082 assert model.sibling_id == 19082 assert model.to_bottom == True assert model.to_top == True assert model.version == 19082 def test_home(self, smart_setup): smart = smart_setup['smart'] # folders, folders # reports, reports # sheets, sheets # templates, templates # workspaces, workspaces model = smart.models.Home({ 'folders': smart.models.Folder(), 'reports': smart.models.Report(), 'sheets': smart.models.Sheet(), 'templates': smart.models.Template(), 'workspaces': smart.models.Workspace() }) assert isinstance(model.folders[0], smart.models.Folder) assert isinstance(model.reports[0], smart.models.Report) assert isinstance(model.sheets[0], smart.models.Sheet) assert isinstance(model.templates[0], smart.models.Template) assert isinstance(model.workspaces[0], smart.models.Workspace) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_cell(self, smart_setup): smart = smart_setup['smart'] # column_id, columnId # column_type, columnType # conditional_format, conditionalFormat # display_value, displayValue # format, format # formula, formula # hyperlink, hyperlink # link_in_from_cell, linkInFromCell # links_out_to_cells, linksOutToCells # strict, strict # value, value model = smart.models.Cell({ 'columnId': 19082, 'columnType': 'foo', 'conditionalFormat': 'foo', 'displayValue': 'foo', 'format': 'foo', 'formula': 'foo', 'hyperlink': smart.models.Hyperlink(), 'linkInFromCell': smart.models.CellLink(), 'linksOutToCells': smart.models.CellLink(), 'strict': True, 'value': 'foo' }) assert model.column_id == 19082 assert model.column_type == 'foo' assert model.conditional_format == 'foo' assert model.display_value == 'foo' assert model.format == 'foo' assert model.formula == 'foo' assert isinstance(model.hyperlink, smart.models.Hyperlink) assert isinstance(model.link_in_from_cell, smart.models.CellLink) assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) assert model.strict == True assert model.value == 'foo' model.hyperlink = {} assert isinstance(model.hyperlink, smart.models.Hyperlink) model.linkInFromCell = {} assert isinstance(model.link_in_from_cell, smart.models.CellLink) model.linksOutToCells = {} assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_cell_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Cell({ 'columnType': 'foo', 'conditionalFormat': 'foo', 'displayValue': 'foo', 'formula': 'foo', 'hyperlink': smart.models.Hyperlink(), 'strict': True, 'value': 'foo', 'column_id': 19082, 'format': 'foo', 'link_in_from_cell': smart.models.CellLink(), 'links_out_to_cells': smart.models.CellLink() }) assert model.column_id == 19082 assert model.column_type == 'foo' assert model.conditional_format == 'foo' assert model.display_value == 'foo' assert model.format == 'foo' assert model.formula == 'foo' assert isinstance(model.hyperlink, smart.models.Hyperlink) assert isinstance(model.link_in_from_cell, smart.models.CellLink) assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) assert model.strict == True assert model.value == 'foo' def test_user(self, smart_setup): smart = smart_setup['smart'] # admin, admin # email, email # first_name, firstName # group_admin, groupAdmin # _id, id # last_name, lastName # licensed_sheet_creator, licensedSheetCreator # name, name # resource_viewer, resourceViewer # status, status model = smart.models.User({ 'admin': True, 'email': 'foo', 'firstName': 'foo', 'groupAdmin': True, 'id': 19082, 'lastName': 'foo', 'licensedSheetCreator': True, 'name': 'foo', 'resourceViewer': True, 'status': 'ACTIVE' }) assert model.admin == True assert model.email == 'foo' assert model.first_name == 'foo' assert model.group_admin == True assert model.id == 19082 assert model.last_name == 'foo' assert model.licensed_sheet_creator == True assert model.name == 'foo' assert model.resource_viewer == True assert model.status == 'ACTIVE' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_user_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.User({ 'admin': True, 'email': 'foo', 'name': 'foo', 'status': 'ACTIVE', 'first_name': 'foo', 'group_admin': True, 'id': 19082, 'last_name': 'foo', 'licensed_sheet_creator': True, 'resource_viewer': True }) assert model.admin == True assert model.email == 'foo' assert model.first_name == 'foo' assert model.group_admin == True assert model.id == 19082 assert model.last_name == 'foo' assert model.licensed_sheet_creator == True assert model.name == 'foo' assert model.resource_viewer == True assert model.status == 'ACTIVE' def test_group(self, smart_setup): smart = smart_setup['smart'] # created_at, createdAt # description, description # _id, id # members, members # modified_at, modifiedAt # name, name # owner, owner # owner_id, ownerId model = smart.models.Group({ 'description': 'foo', 'id': 19082, 'members': smart.models.GroupMember(), 'name': 'foo', 'owner': 'foo', 'ownerId': 19082 }) assert model.description == 'foo' assert model.id == 19082 assert isinstance(model.members[0], smart.models.GroupMember) assert model.name == 'foo' assert model.owner == 'foo' assert model.owner_id == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_group_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Group({ 'description': 'foo', 'id': 19082, 'members': smart.models.GroupMember(), 'name': 'foo', 'owner': 'foo', 'owner_id': 19082 }) assert model.description == 'foo' assert model.id == 19082 assert isinstance(model.members[0], smart.models.GroupMember) assert model.name == 'foo' assert model.owner == 'foo' assert model.owner_id == 19082 def test_error(self, smart_setup): smart = smart_setup['smart'] # request_response, requestResponse # result, result model = smart.models.Error({ 'result': smart.models.ErrorResult() }) assert isinstance(model.result, smart.models.ErrorResult) model.result = {} assert isinstance(model.result, smart.models.ErrorResult) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_error_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Error({ 'result': smart.models.ErrorResult() }) assert isinstance(model.result, smart.models.ErrorResult) def test_email(self, smart_setup): smart = smart_setup['smart'] # cc_me, ccMe # message, message # send_to, sendTo # subject, subject model = smart.models.Email({ 'ccMe': True, 'message': 'foo', 'sendTo': smart.models.Recipient(), 'subject': 'foo' }) assert model.cc_me == True assert model.message == 'foo' assert isinstance(model.send_to[0], smart.models.Recipient) assert model.subject == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_email_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Email({ 'message': 'foo', 'subject': 'foo', 'cc_me': True, 'send_to': smart.models.Recipient() }) assert model.cc_me == True assert model.message == 'foo' assert isinstance(model.send_to[0], smart.models.Recipient) assert model.subject == 'foo' def test_sheet(self, smart_setup): smart = smart_setup['smart'] # access_level, accessLevel # attachments, attachments # columns, columns # created_at, createdAt # dependencies_enabled, dependenciesEnabled # discussions, discussions # effective_attachment_options, effectiveAttachmentOptions # favorite, favorite # from_id, fromId # gantt_enabled, ganttEnabled # id, id # modified_at, modifiedAt # name, name # owner, owner # owner_id, ownerId # permalink, permalink # read_only, readOnly # resource_management_enabled, resourceManagementEnabled # rows, rows # show_parent_rows_for_filters, showParentRowsForFilters # source, source # total_row_count, totalRowCount # user_settings, userSettings # version, version model = smart.models.Sheet({ 'accessLevel': 'VIEWER', 'attachments': smart.models.Attachment(), 'columns': smart.models.Column(), 'dependenciesEnabled': True, 'discussions': smart.models.Discussion(), 'effectiveAttachmentOptions': ['FILE'], 'favorite': True, 'fromId': 19082, 'ganttEnabled': True, 'id': 19082, 'name': 'foo', 'owner': 'foo', 'ownerId': 19082, 'permalink': 'foo', 'readOnly': True, 'resourceManagementEnabled': True, 'rows': smart.models.Row(), 'showParentRowsForFilters': True, 'source': smart.models.Source(), 'totalRowCount': 19082, 'userSettings': smart.models.SheetUserSettings(), 'version': 19082 }) assert model.access_level == 'VIEWER' assert isinstance(model.attachments[0], smart.models.Attachment) assert isinstance(model.columns[0], smart.models.Column) assert model.dependencies_enabled == True assert isinstance(model.discussions[0], smart.models.Discussion) assert model.effective_attachment_options[0] == 'FILE' assert model.favorite == True assert model.from_id == 19082 assert model.gantt_enabled == True assert model.id == 19082 assert model.name == 'foo' assert model.owner == 'foo' assert model.owner_id == 19082 assert model.permalink == 'foo' assert model.read_only == True assert model.resource_management_enabled == True assert isinstance(model.rows[0], smart.models.Row) assert model.show_parent_rows_for_filters == True assert isinstance(model.source, smart.models.Source) assert model.total_row_count == 19082 assert isinstance(model.user_settings, smart.models.SheetUserSettings) assert model.version == 19082 model.effective_attachment_options = 'FILE' assert model.effective_attachment_options[0] == 'FILE' tmplist = smartsheet.types.TypedList(str) tmplist.append('FILE') model.effective_attachment_options = tmplist assert model.effective_attachment_options[0] == 'FILE' model.source = {} assert isinstance(model.source, smart.models.Source) model.userSettings = {} assert isinstance(model.user_settings, smart.models.SheetUserSettings) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_sheet_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Sheet({ 'attachments': smart.models.Attachment(), 'columns': smart.models.Column(), 'discussions': smart.models.Discussion(), 'favorite': True, 'name': 'foo', 'owner': 'foo', 'permalink': 'foo', 'rows': smart.models.Row(), 'source': smart.models.Source(), 'version': 19082, 'access_level': 'VIEWER', 'dependencies_enabled': True, 'effective_attachment_options': ['FILE'], 'from_id': 19082, 'gantt_enabled': True, 'id': 19082, 'owner_id': 19082, 'read_only': True, 'resource_management_enabled': True, 'show_parent_rows_for_filters': True, 'total_row_count': 19082, 'user_settings': smart.models.SheetUserSettings() }) assert model.access_level == 'VIEWER' assert isinstance(model.attachments[0], smart.models.Attachment) assert isinstance(model.columns[0], smart.models.Column) assert model.dependencies_enabled == True assert isinstance(model.discussions[0], smart.models.Discussion) assert model.effective_attachment_options[0] == 'FILE' assert model.favorite == True assert model.from_id == 19082 assert model.gantt_enabled == True assert model.id == 19082 assert model.name == 'foo' assert model.owner == 'foo' assert model.owner_id == 19082 assert model.permalink == 'foo' assert model.read_only == True assert model.resource_management_enabled == True assert isinstance(model.rows[0], smart.models.Row) assert model.show_parent_rows_for_filters == True assert isinstance(model.source, smart.models.Source) assert model.total_row_count == 19082 assert isinstance(model.user_settings, smart.models.SheetUserSettings) assert model.version == 19082 def test_share(self, smart_setup): smart = smart_setup['smart'] # access_level, accessLevel # cc_me, ccMe # email, email # group_id, groupId # id, id # message, message # name, name # subject, subject # type, type # user_id, userId model = smart.models.Share({ 'accessLevel': 'VIEWER', 'ccMe': True, 'email': 'foo', 'groupId': 19082, 'id': 'foo', 'message': 'foo', 'name': 'foo', 'subject': 'foo', 'type': 'USER', 'userId': 19082 }) assert model.access_level == 'VIEWER' assert model.cc_me == True assert model.email == 'foo' assert model.group_id == 19082 assert model.id == 'foo' assert model.message == 'foo' assert model.name == 'foo' assert model.subject == 'foo' assert model.type == 'USER' assert model.user_id == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_share_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Share({ 'email': 'foo', 'message': 'foo', 'name': 'foo', 'subject': 'foo', 'access_level': 'VIEWER', 'cc_me': True, 'group_id': 19082, 'id': 'foo', 'type': 'USER', 'user_id': 19082 }) assert model.access_level == 'VIEWER' assert model.cc_me == True assert model.email == 'foo' assert model.group_id == 19082 assert model.id == 'foo' assert model.message == 'foo' assert model.name == 'foo' assert model.subject == 'foo' assert model.type == 'USER' assert model.user_id == 19082 def test_source(self, smart_setup): smart = smart_setup['smart'] # id, id # type, type model = smart.models.Source({ 'id': 19082, 'type': 'sheet' }) assert model.id == 19082 assert model.type == 'sheet' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_source_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Source({ 'id': 19082, 'type': 'sheet' }) assert model.id == 19082 assert model.type == 'sheet' def test_report(self, smart_setup): smart = smart_setup['smart'] # source_sheets, sourceSheets # from_id, fromId # modified_at, modifiedAt # owner_id, ownerId # columns, columns # dependencies_enabled, dependenciesEnabled # discussions, discussions # version, version # id, id # gantt_enabled, ganttEnabled # show_parent_rows_for_filters, showParentRowsForFilters # created_at, createdAt # name, name # attachments, attachments # total_row_count, totalRowCount # favorite, favorite # access_level, accessLevel # rows, rows # read_only, readOnly # permalink, permalink # source, source # effective_attachment_options, effectiveAttachmentOptions # owner, owner # resource_management_enabled, resourceManagementEnabled # user_settings, userSettings model = smart.models.Report({ 'sourceSheets': smart.models.Sheet(), 'fromId': 19082, 'ownerId': 19082, 'columns': smart.models.ReportColumn(), 'dependenciesEnabled': True, 'discussions': smart.models.Discussion(), 'version': 19082, 'id': 19082, 'ganttEnabled': True, 'showParentRowsForFilters': True, 'name': 'foo', 'attachments': smart.models.Attachment(), 'totalRowCount': 19082, 'favorite': True, 'accessLevel': 'VIEWER', 'rows': smart.models.ReportRow(), 'readOnly': True, 'permalink': 'foo', 'source': smart.models.Source(), 'effectiveAttachmentOptions': ['FILE'], 'owner': 'foo', 'resourceManagementEnabled': True, 'userSettings': smart.models.SheetUserSettings() }) assert isinstance(model.source_sheets[0], smart.models.Sheet) assert model.from_id == 19082 assert model.owner_id == 19082 assert isinstance(model.columns[0], smart.models.Column) assert model.dependencies_enabled == True assert isinstance(model.discussions[0], smart.models.Discussion) assert model.version == 19082 assert model.id == 19082 assert model.gantt_enabled == True assert model.show_parent_rows_for_filters == True assert model.name == 'foo' assert isinstance(model.attachments[0], smart.models.Attachment) assert model.total_row_count == 19082 assert model.favorite == True assert model.access_level == 'VIEWER' assert isinstance(model.rows[0], smart.models.Row) assert model.read_only == True assert model.permalink == 'foo' assert isinstance(model.source, smart.models.Source) assert model.effective_attachment_options[0] == 'FILE' assert model.owner == 'foo' assert model.resource_management_enabled == True assert isinstance(model.user_settings, smart.models.SheetUserSettings) model.source = {} assert isinstance(model.source, smart.models.Source) model.effective_attachment_options = 'FILE' assert model.effective_attachment_options[0] == 'FILE' tmplist = smartsheet.types.TypedList(str) tmplist.append('FILE') model.effective_attachment_options = tmplist assert model.effective_attachment_options[0] == 'FILE' model.userSettings = {} assert isinstance(model.user_settings, smart.models.SheetUserSettings) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_report_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Report({ 'columns': smart.models.ReportColumn(), 'discussions': smart.models.Discussion(), 'version': 19082, 'name': 'foo', 'attachments': smart.models.Attachment(), 'favorite': True, 'rows': smart.models.ReportRow(), 'permalink': 'foo', 'source': smart.models.Source(), 'owner': 'foo', 'source_sheets': smart.models.Sheet(), 'from_id': 19082, 'owner_id': 19082, 'dependencies_enabled': True, 'id': 19082, 'gantt_enabled': True, 'show_parent_rows_for_filters': True, 'total_row_count': 19082, 'access_level': 'VIEWER', 'read_only': True, 'effective_attachment_options': ['FILE'], 'resource_management_enabled': True, 'user_settings': smart.models.SheetUserSettings() }) assert isinstance(model.source_sheets[0], smart.models.Sheet) assert model.from_id == 19082 assert model.owner_id == 19082 assert isinstance(model.columns[0], smart.models.Column) assert model.dependencies_enabled == True assert isinstance(model.discussions[0], smart.models.Discussion) assert model.version == 19082 assert model.id == 19082 assert model.gantt_enabled == True assert model.show_parent_rows_for_filters == True assert model.name == 'foo' assert isinstance(model.attachments[0], smart.models.Attachment) assert model.total_row_count == 19082 assert model.favorite == True assert model.access_level == 'VIEWER' assert isinstance(model.rows[0], smart.models.Row) assert model.read_only == True assert model.permalink == 'foo' assert isinstance(model.source, smart.models.Source) assert model.effective_attachment_options[0] == 'FILE' assert model.owner == 'foo' assert model.resource_management_enabled == True assert isinstance(model.user_settings, smart.models.SheetUserSettings) def test_folder(self, smart_setup): smart = smart_setup['smart'] # favorite, favorite # folders, folders # id, id # name, name # permalink, permalink # reports, reports # sheets, sheets # templates, templates model = smart.models.Folder({ 'favorite': True, 'folders': smart.models.Folder(), 'id': 19082, 'name': 'foo', 'permalink': 'foo', 'reports': smart.models.Report(), 'sheets': smart.models.Sheet(), 'templates': smart.models.Template() }) assert model.favorite == True assert isinstance(model.folders[0], smart.models.Folder) assert model.id == 19082 assert model.name == 'foo' assert model.permalink == 'foo' assert isinstance(model.reports[0], smart.models.Report) assert isinstance(model.sheets[0], smart.models.Sheet) assert isinstance(model.templates[0], smart.models.Template) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_folder_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Folder({ 'favorite': True, 'folders': smart.models.Folder(), 'name': 'foo', 'permalink': 'foo', 'reports': smart.models.Report(), 'sheets': smart.models.Sheet(), 'templates': smart.models.Template(), 'id': 19082 }) assert model.favorite == True assert isinstance(model.folders[0], smart.models.Folder) assert model.id == 19082 assert model.name == 'foo' assert model.permalink == 'foo' assert isinstance(model.reports[0], smart.models.Report) assert isinstance(model.sheets[0], smart.models.Sheet) assert isinstance(model.templates[0], smart.models.Template) def test_column(self, smart_setup): smart = smart_setup['smart'] # auto_number_format, autoNumberFormat # format, format # hidden, hidden # id, id # index, index # locked, locked # locked_for_user, lockedForUser # options, options # primary, primary # symbol, symbol # system_column_type, systemColumnType # tags, tags # title, title # type, type # width, width model = smart.models.Column({ 'autoNumberFormat': smart.models.AutoNumberFormat(), 'format': 'foo', 'hidden': True, 'id': 19082, 'index': 19082, 'locked': True, 'lockedForUser': True, 'options': ['foo'], 'primary': True, 'symbol': 'STAR', 'systemColumnType': 'AUTO_NUMBER', 'tags': ['foo'], 'title': 'foo', 'type': 'TEXT_NUMBER', 'width': 19082 }) assert isinstance(model.auto_number_format, smart.models.AutoNumberFormat) assert model.format == 'foo' assert model.hidden == True assert model.id == 19082 assert model.index == 19082 assert model.locked == True assert model.locked_for_user == True assert model.options[0] == 'foo' assert model.primary == True assert model.symbol == 'STAR' assert model.system_column_type == 'AUTO_NUMBER' assert model.tags[0] == 'foo' assert model.title == 'foo' assert model.type == 'TEXT_NUMBER' assert model.width == 19082 model.autoNumberFormat = {} assert isinstance(model.auto_number_format, smart.models.AutoNumberFormat) model.options = 'foo' assert model.options[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.options = tmplist assert model.options[0] == 'foo' model.tags = 'foo' assert model.tags[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.tags = tmplist assert model.tags[0] == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_column_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Column({ 'hidden': True, 'index': 19082, 'locked': True, 'options': ['foo'], 'primary': True, 'symbol': 'STAR', 'tags': ['foo'], 'title': 'foo', 'width': 19082, 'auto_number_format': smart.models.AutoNumberFormat(), 'format': 'foo', 'id': 19082, 'locked_for_user': True, 'system_column_type': 'AUTO_NUMBER', 'type': 'TEXT_NUMBER' }) assert isinstance(model.auto_number_format, smart.models.AutoNumberFormat) assert model.format == 'foo' assert model.hidden == True assert model.id == 19082 assert model.index == 19082 assert model.locked == True assert model.locked_for_user == True assert model.options[0] == 'foo' assert model.primary == True assert model.symbol == 'STAR' assert model.system_column_type == 'AUTO_NUMBER' assert model.tags[0] == 'foo' assert model.title == 'foo' assert model.type == 'TEXT_NUMBER' assert model.width == 19082 def test_result(self, smart_setup): smart = smart_setup['smart'] # message, message # result, result # result_code, resultCode # version, version model = smart.models.Result({ 'message': 'foo', 'resultCode': 19082, 'version': 19082 }) assert model.message == 'foo' assert model.result_code == 19082 assert model.version == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_result_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Result({ 'message': 'foo', 'version': 19082, 'result_code': 19082 }) assert model.message == 'foo' assert model.result_code == 19082 assert model.version == 19082 def test_contact(self, smart_setup): smart = smart_setup['smart'] # email, email # id, id # name, name model = smart.models.Contact({ 'email': 'foo', 'id': 'foo', 'name': 'foo' }) assert model.email == 'foo' assert model.id == 'foo' assert model.name == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_contact_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Contact({ 'email': 'foo', 'name': 'foo', 'id': 'foo' }) assert model.email == 'foo' assert model.id == 'foo' assert model.name == 'foo' def test_comment(self, smart_setup): smart = smart_setup['smart'] # attachments, attachments # created_at, createdAt # created_by, createdBy # discussion_id, discussionId # id, id # modified_at, modifiedAt # text, text model = smart.models.Comment({ 'attachments': smart.models.Attachment(), 'createdBy': smart.models.User(), 'discussionId': 19082, 'id': 19082, 'text': 'foo' }) assert isinstance(model.attachments[0], smart.models.Attachment) assert isinstance(model.created_by, smart.models.User) assert model.discussion_id == 19082 assert model.id == 19082 assert model.text == 'foo' model.createdBy = {} assert isinstance(model.created_by, smart.models.User) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_comment_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Comment({ 'attachments': smart.models.Attachment(), 'text': 'foo', 'created_by': smart.models.User(), 'discussion_id': 19082, 'id': 19082 }) assert isinstance(model.attachments[0], smart.models.Attachment) assert isinstance(model.created_by, smart.models.User) assert model.discussion_id == 19082 assert model.id == 19082 assert model.text == 'foo' def test_account(self, smart_setup): smart = smart_setup['smart'] # id, id # name, name model = smart.models.Account({ 'id': 19082, 'name': 'foo' }) assert model.id == 19082 assert model.name == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_account_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Account({ 'name': 'foo', 'id': 19082 }) assert model.id == 19082 assert model.name == 'foo' def test_version(self, smart_setup): smart = smart_setup['smart'] # version, version model = smart.models.Version({ 'version': 19082 }) assert model.version == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_cell_link(self, smart_setup): smart = smart_setup['smart'] # column_id, columnId # row_id, rowId # sheet_id, sheetId # sheet_name, sheetName # status, status model = smart.models.CellLink({ 'columnId': 19082, 'rowId': 19082, 'sheetId': 19082, 'sheetName': 'foo', 'status': 'OK' }) assert model.column_id == 19082 assert model.row_id == 19082 assert model.sheet_id == 19082 assert model.sheet_name == 'foo' assert model.status == 'OK' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_cell_link_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.CellLink({ 'status': 'OK', 'column_id': 19082, 'row_id': 19082, 'sheet_id': 19082, 'sheet_name': 'foo' }) assert model.column_id == 19082 assert model.row_id == 19082 assert model.sheet_id == 19082 assert model.sheet_name == 'foo' assert model.status == 'OK' def test_template(self, smart_setup): smart = smart_setup['smart'] # access_level, accessLevel # description, description # id, id # name, name model = smart.models.Template({ 'accessLevel': 'VIEWER', 'description': 'foo', 'id': 19082, 'name': 'foo' }) assert model.access_level == 'VIEWER' assert model.description == 'foo' assert model.id == 19082 assert model.name == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_template_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Template({ 'description': 'foo', 'name': 'foo', 'access_level': 'VIEWER', 'id': 19082 }) assert model.access_level == 'VIEWER' assert model.description == 'foo' assert model.id == 19082 assert model.name == 'foo' def test_row_email(self, smart_setup): smart = smart_setup['smart'] # message, message # column_ids, columnIds # send_to, sendTo # include_attachments, includeAttachments # subject, subject # include_discussions, includeDiscussions # cc_me, ccMe model = smart.models.RowEmail({ 'message': 'foo', 'columnIds': [19082], 'sendTo': smart.models.Recipient(), 'includeAttachments': True, 'subject': 'foo', 'includeDiscussions': True, 'ccMe': True }) assert model.message == 'foo' assert model.column_ids[0] == 19082 assert isinstance(model.send_to[0], smart.models.Recipient) assert model.include_attachments == True assert model.subject == 'foo' assert model.include_discussions == True assert model.cc_me == True model.column_ids = 19082 assert model.column_ids[0] == 19082 tmplist = smartsheet.types.TypedList(int) tmplist.append(19082) model.column_ids = tmplist assert model.column_ids[0] == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_row_email_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.RowEmail({ 'message': 'foo', 'subject': 'foo', 'column_ids': [19082], 'send_to': smart.models.Recipient(), 'include_attachments': True, 'include_discussions': True, 'cc_me': True }) assert model.message == 'foo' assert model.column_ids[0] == 19082 assert isinstance(model.send_to[0], smart.models.Recipient) assert model.include_attachments == True assert model.subject == 'foo' assert model.include_discussions == True assert model.cc_me == True def test_criteria(self, smart_setup): smart = smart_setup['smart'] # operator, operator # value1, value1 # value2, value2 model = smart.models.Criteria({ 'operator': 'EQUAL', 'values': ['foo', 'foo'] }) assert model.operator == 'EQUAL' assert model.values[0] == 'foo' assert model.values[1] == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_currency(self, smart_setup): smart = smart_setup['smart'] # code, code # symbol, symbol model = smart.models.Currency({ 'code': 'USD', 'symbol': '$' }) assert model.code == 'USD' assert model.symbol == '$' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_favorite(self, smart_setup): smart = smart_setup['smart'] # object_id, objectId # type, type model = smart.models.Favorite({ 'objectId': 19082, 'type': 'workspace' }) assert model.object_id == 19082 assert model.type == 'workspace' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_favorite_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Favorite({ 'object_id': 19082, 'type': 'workspace' }) assert model.object_id == 19082 assert model.type == 'workspace' def test_hyperlink(self, smart_setup): smart = smart_setup['smart'] # report_id, reportId # sheet_id, sheetId # url, url model = smart.models.Hyperlink({ 'reportId': 19082, 'sheetId': 19082, 'url': 'foo' }) assert model.report_id == 19082 assert model.sheet_id == 19082 assert model.url == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_hyperlink_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Hyperlink({ 'url': 'foo', 'report_id': 19082, 'sheet_id': 19082 }) assert model.report_id == 19082 assert model.sheet_id == 19082 assert model.url == 'foo' def test_recipient(self, smart_setup): smart = smart_setup['smart'] # email, email # group_id, groupId model = smart.models.Recipient({ 'email': 'foo', 'groupId': 19082 }) assert model.email == 'foo' assert model.group_id == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_recipient_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Recipient({ 'email': 'foo', 'group_id': 19082 }) assert model.email == 'foo' assert model.group_id == 19082 def test_workspace(self, smart_setup): smart = smart_setup['smart'] # access_level, accessLevel # favorite, favorite # folders, folders # id, id # name, name # permalink, permalink # reports, reports # sheets, sheets # templates, templates model = smart.models.Workspace({ 'accessLevel': 'VIEWER', 'favorite': True, 'folders': smart.models.Folder(), 'id': 19082, 'name': 'foo', 'permalink': 'foo', 'reports': smart.models.Report(), 'sheets': smart.models.Sheet(), 'templates': smart.models.Template() }) assert model.access_level == 'VIEWER' assert model.favorite == True assert isinstance(model.folders[0], smart.models.Folder) assert model.id == 19082 assert model.name == 'foo' assert model.permalink == 'foo' assert isinstance(model.reports[0], smart.models.Report) assert isinstance(model.sheets[0], smart.models.Sheet) assert isinstance(model.templates[0], smart.models.Template) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_workspace_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Workspace({ 'favorite': True, 'folders': smart.models.Folder(), 'name': 'foo', 'permalink': 'foo', 'reports': smart.models.Report(), 'sheets': smart.models.Sheet(), 'templates': smart.models.Template(), 'access_level': 'VIEWER', 'id': 19082 }) assert model.access_level == 'VIEWER' assert model.favorite == True assert isinstance(model.folders[0], smart.models.Folder) assert model.id == 19082 assert model.name == 'foo' assert model.permalink == 'foo' assert isinstance(model.reports[0], smart.models.Report) assert isinstance(model.sheets[0], smart.models.Sheet) assert isinstance(model.templates[0], smart.models.Template) def test_report_row(self, smart_setup): smart = smart_setup['smart'] # in_critical_path, inCriticalPath # cells, cells # sibling_id, siblingId # modified_at, modifiedAt # columns, columns # row_number, rowNumber # format, format # expanded, expanded # access_level, accessLevel # version, version # discussions, discussions # id, id # parent_id, parentId # sheet_id, sheetId # to_top, toTop # to_bottom, toBottom # permalink, permalink # locked_for_user, lockedForUser # created_at, createdAt # conditional_format, conditionalFormat # filtered_out, filteredOut # above, above # locked, locked # attachments, attachments model = smart.models.ReportRow({ 'inCriticalPath': True, 'cells': smart.models.ReportCell(), 'siblingId': 19082, 'columns': smart.models.Column(), 'rowNumber': 19082, 'format': 'foo', 'expanded': True, 'accessLevel': 'VIEWER', 'version': 19082, 'discussions': smart.models.Discussion(), 'id': 19082, 'parentId': 19082, 'sheetId': 19082, 'toTop': True, 'toBottom': True, 'permalink': 'foo', 'lockedForUser': True, 'conditionalFormat': 'foo', 'filteredOut': True, 'above': True, 'locked': True, 'attachments': smart.models.Attachment() }) assert model.in_critical_path == True assert isinstance(model.cells[0], smart.models.Cell) assert model.sibling_id == 19082 assert isinstance(model.columns[0], smart.models.Column) assert model.row_number == 19082 assert model.format == 'foo' assert model.expanded == True assert model.access_level == 'VIEWER' assert model.version == 19082 assert isinstance(model.discussions[0], smart.models.Discussion) assert model.id == 19082 assert model.parent_id == 19082 assert model.sheet_id == 19082 assert model.to_top == True assert model.to_bottom == True assert model.permalink == 'foo' assert model.locked_for_user == True assert model.conditional_format == 'foo' assert model.filtered_out == True assert model.above == True assert model.locked == True assert isinstance(model.attachments[0], smart.models.Attachment) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_report_row_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.ReportRow({ 'cells': smart.models.ReportCell(), 'columns': smart.models.Column(), 'rowNumber': 19082, 'expanded': True, 'version': 19082, 'discussions': smart.models.Discussion(), 'permalink': 'foo', 'lockedForUser': True, 'filteredOut': True, 'above': True, 'locked': True, 'attachments': smart.models.Attachment(), 'in_critical_path': True, 'sibling_id': 19082, 'format': 'foo', 'access_level': 'VIEWER', 'id': 19082, 'parent_id': 19082, 'sheet_id': 19082, 'to_top': True, 'to_bottom': True, 'conditional_format': 'foo' }) assert model.in_critical_path == True assert isinstance(model.cells[0], smart.models.Cell) assert model.sibling_id == 19082 assert isinstance(model.columns[0], smart.models.Column) assert model.row_number == 19082 assert model.format == 'foo' assert model.expanded == True assert model.access_level == 'VIEWER' assert model.version == 19082 assert isinstance(model.discussions[0], smart.models.Discussion) assert model.id == 19082 assert model.parent_id == 19082 assert model.sheet_id == 19082 assert model.to_top == True assert model.to_bottom == True assert model.permalink == 'foo' assert model.locked_for_user == True assert model.conditional_format == 'foo' assert model.filtered_out == True assert model.above == True assert model.locked == True assert isinstance(model.attachments[0], smart.models.Attachment) def test_font_family(self, smart_setup): smart = smart_setup['smart'] # name, name # traits, traits model = smart.models.FontFamily({ 'name': 'foo', 'traits': ['foo'] }) assert model.name == 'foo' assert model.traits[0] == 'foo' model.traits = 'foo' assert model.traits[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.traits = tmplist assert model.traits[0] == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_server_info(self, smart_setup): smart = smart_setup['smart'] # formats, formats # supported_locales, supportedLocales model = smart.models.ServerInfo({ 'formats': smart.models.FormatTables(), 'supportedLocales': ['foo'] }) assert isinstance(model.formats, smart.models.FormatTables) assert model.supported_locales[0] == 'foo' model.formats = {} assert isinstance(model.formats, smart.models.FormatTables) model.supported_locales = 'foo' assert model.supported_locales[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.supported_locales = tmplist assert model.supported_locales[0] == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_server_info_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.ServerInfo({ 'formats': smart.models.FormatTables(), 'supported_locales': ['foo'] }) assert isinstance(model.formats, smart.models.FormatTables) assert model.supported_locales[0] == 'foo' def test_report_cell(self, smart_setup): smart = smart_setup['smart'] # link_in_from_cell, linkInFromCell # virtual_column_id, virtualColumnId # column_type, columnType # hyperlink, hyperlink # conditional_format, conditionalFormat # value, value # column_id, columnId # format, format # strict, strict # display_value, displayValue # links_out_to_cells, linksOutToCells # formula, formula model = smart.models.ReportCell({ 'linkInFromCell': smart.models.CellLink(), 'virtualColumnId': 19082, 'columnType': 'foo', 'hyperlink': smart.models.Hyperlink(), 'conditionalFormat': 'foo', 'value': 'foo', 'columnId': 19082, 'format': 'foo', 'strict': True, 'displayValue': 'foo', 'linksOutToCells': smart.models.CellLink(), 'formula': 'foo' }) assert isinstance(model.link_in_from_cell, smart.models.CellLink) assert model.virtual_column_id == 19082 assert model.column_type == 'foo' assert isinstance(model.hyperlink, smart.models.Hyperlink) assert model.conditional_format == 'foo' assert model.value == 'foo' assert model.column_id == 19082 assert model.format == 'foo' assert model.strict == True assert model.display_value == 'foo' assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) assert model.formula == 'foo' model.linkInFromCell = {} assert isinstance(model.link_in_from_cell, smart.models.CellLink) model.hyperlink = {} assert isinstance(model.hyperlink, smart.models.Hyperlink) model.linksOutToCells = {} assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_report_cell_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.ReportCell({ 'columnType': 'foo', 'hyperlink': smart.models.Hyperlink(), 'conditionalFormat': 'foo', 'value': 'foo', 'strict': True, 'displayValue': 'foo', 'formula': 'foo', 'link_in_from_cell': smart.models.CellLink(), 'virtual_column_id': 19082, 'column_id': 19082, 'format': 'foo', 'links_out_to_cells': smart.models.CellLink() }) assert isinstance(model.link_in_from_cell, smart.models.CellLink) assert model.virtual_column_id == 19082 assert model.column_type == 'foo' assert isinstance(model.hyperlink, smart.models.Hyperlink) assert model.conditional_format == 'foo' assert model.value == 'foo' assert model.column_id == 19082 assert model.format == 'foo' assert model.strict == True assert model.display_value == 'foo' assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) assert model.formula == 'foo' def test_row_mapping(self, smart_setup): smart = smart_setup['smart'] # from_, from # to, to model = smart.models.RowMapping({ 'from': 19082, 'to': 19082 }) assert model.from_ == 19082 assert model.to == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_row_mapping_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.RowMapping({ 'to': 19082, 'from': 19082 }) assert model.from_ == 19082 assert model.to == 19082 def test_o_auth_error(self, smart_setup): smart = smart_setup['smart'] # error, error # error_code, errorCode # error_description, error_description model = smart.models.OAuthError({ 'error': 'invalid_request', 'errorCode': 19082, 'error_description': 'foo' }) assert model.error == 'invalid_request' assert model.error_code == 19082 assert model.error_description == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_o_auth_error_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.OAuthError({ 'error': 'invalid_request', 'error_description': 'foo', 'error_code': 19082 }) assert model.error == 'invalid_request' assert model.error_code == 19082 assert model.error_description == 'foo' def test_discussion(self, smart_setup): smart = smart_setup['smart'] # access_level, accessLevel # comment, comment # comment_attachments, commentAttachments # comments, comments # created_by, createdBy # id, id # last_commented_at, lastCommentedAt # last_commented_user, lastCommentedUser # parent_id, parentId # parent_type, parentType # read_only, readOnly # title, title model = smart.models.Discussion({ 'accessLevel': 'VIEWER', 'comment': smart.models.Comment(), 'commentAttachments': smart.models.Attachment(), 'comments': smart.models.Comment(), 'createdBy': smart.models.User(), 'id': 19082, 'lastCommentedUser': smart.models.User(), 'parentId': 19082, 'parentType': 'foo', 'readOnly': True, 'title': 'foo' }) assert model.access_level == 'VIEWER' assert isinstance(model.comment, smart.models.Comment) assert isinstance(model.comment_attachments[0], smart.models.Attachment) assert isinstance(model.comments[0], smart.models.Comment) assert isinstance(model.created_by, smart.models.User) assert model.id == 19082 assert isinstance(model.last_commented_user, smart.models.User) assert model.parent_id == 19082 assert model.parent_type == 'foo' assert model.read_only == True assert model.title == 'foo' model.comment = {} assert isinstance(model.comment, smart.models.Comment) model.createdBy = {} assert isinstance(model.created_by, smart.models.User) model.lastCommentedUser = {} assert isinstance(model.last_commented_user, smart.models.User) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_discussion_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Discussion({ 'comment': smart.models.Comment(), 'comments': smart.models.Comment(), 'title': 'foo', 'access_level': 'VIEWER', 'comment_attachments': smart.models.Attachment(), 'created_by': smart.models.User(), 'id': 19082, 'last_commented_user': smart.models.User(), 'parent_id': 19082, 'parent_type': 'foo', 'read_only': True }) assert model.access_level == 'VIEWER' assert isinstance(model.comment, smart.models.Comment) assert isinstance(model.comment_attachments[0], smart.models.Attachment) assert isinstance(model.comments[0], smart.models.Comment) assert isinstance(model.created_by, smart.models.User) assert model.id == 19082 assert isinstance(model.last_commented_user, smart.models.User) assert model.parent_id == 19082 assert model.parent_type == 'foo' assert model.read_only == True assert model.title == 'foo' def test_attachment(self, smart_setup): smart = smart_setup['smart'] # attachment_sub_type, attachmentSubType # attachment_type, attachmentType # created_at, createdAt # created_by, createdBy # description, description # id, id # mime_type, mimeType # name, name # parent_id, parentId # parent_type, parentType # size_in_kb, sizeInKb # url, url # url_expires_in_millis, urlExpiresInMillis model = smart.models.Attachment({ 'attachmentSubType': 'DOCUMENT', 'attachmentType': 'BOX_COM', 'createdBy': smart.models.User(), 'description': 'foo', 'id': 19082, 'mimeType': 'foo', 'name': 'foo', 'parentId': 19082, 'parentType': 'SHEET', 'sizeInKb': 19082, 'url': 'foo', 'urlExpiresInMillis': 19082 }) assert model.attachment_sub_type == 'DOCUMENT' assert model.attachment_type == 'BOX_COM' assert isinstance(model.created_by, smart.models.User) assert model.id == 19082 assert model.mime_type == 'foo' assert model.name == 'foo' assert model.parent_id == 19082 assert model.parent_type == 'SHEET' assert model.size_in_kb == 19082 assert model.url == 'foo' assert model.url_expires_in_millis == 19082 model.createdBy = {} assert isinstance(model.created_by, smart.models.User) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_attachment_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.Attachment({ 'mimeType': 'foo', 'name': 'foo', 'parentId': 19082, 'parentType': 'SHEET', 'sizeInKb': 19082, 'url': 'foo', 'urlExpiresInMillis': 19082, 'attachment_sub_type': 'DOCUMENT', 'attachment_type': 'BOX_COM', 'created_by': smart.models.User(), 'id': 19082 }) assert model.attachment_sub_type == 'DOCUMENT' assert model.attachment_type == 'BOX_COM' assert isinstance(model.created_by, smart.models.User) assert model.id == 19082 assert model.mime_type == 'foo' assert model.name == 'foo' assert model.parent_id == 19082 assert model.parent_type == 'SHEET' assert model.size_in_kb == 19082 assert model.url == 'foo' assert model.url_expires_in_millis == 19082 def test_sheet_email(self, smart_setup): smart = smart_setup['smart'] # message, message # send_to, sendTo # subject, subject # format_details, formatDetails # format, format # cc_me, ccMe model = smart.models.SheetEmail({ 'message': 'foo', 'sendTo': smart.models.Recipient(), 'subject': 'foo', 'formatDetails': smart.models.FormatDetails(), 'format': 'PDF', 'ccMe': True }) assert model.message == 'foo' assert isinstance(model.send_to[0], smart.models.Recipient) assert model.subject == 'foo' assert isinstance(model.format_details, smart.models.FormatDetails) assert model.format == 'PDF' assert model.cc_me == True model.formatDetails = {} assert isinstance(model.format_details, smart.models.FormatDetails) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_sheet_email_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.SheetEmail({ 'message': 'foo', 'subject': 'foo', 'send_to': smart.models.Recipient(), 'format_details': smart.models.FormatDetails(), 'format': 'PDF', 'cc_me': True }) assert model.message == 'foo' assert isinstance(model.send_to[0], smart.models.Recipient) assert model.subject == 'foo' assert isinstance(model.format_details, smart.models.FormatDetails) assert model.format == 'PDF' assert model.cc_me == True def test_access_token(self, smart_setup): smart = smart_setup['smart'] # access_token, access_token # expires_in, expires_in # refresh_token, refresh_token # token_type, token_type model = smart.models.AccessToken({ 'access_token': 'foo', 'expires_in': 19082, 'refresh_token': 'foo', 'token_type': 'bearer' }) assert model.access_token == 'foo' assert model.expires_in == 19082 assert model.refresh_token == 'foo' assert model.token_type == 'bearer' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_index_result(self, smart_setup): smart = smart_setup['smart'] # data, data # page_number, pageNumber # page_size, pageSize # total_count, totalCount # total_pages, totalPages model = smart.models.IndexResult({ 'pageNumber': 19082, 'pageSize': 19082, 'totalCount': 19082, 'totalPages': 19082 }) assert model.page_number == 19082 assert model.page_size == 19082 assert model.total_count == 19082 assert model.total_pages == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_index_result_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.IndexResult({ 'page_number': 19082, 'page_size': 19082, 'total_count': 19082, 'total_pages': 19082 }) assert model.page_number == 19082 assert model.page_size == 19082 assert model.total_count == 19082 assert model.total_pages == 19082 def test_cell_history(self, smart_setup): smart = smart_setup['smart'] # link_in_from_cell, linkInFromCell # modified_at, modifiedAt # column_type, columnType # modified_by, modifiedBy # hyperlink, hyperlink # conditional_format, conditionalFormat # value, value # column_id, columnId # format, format # strict, strict # display_value, displayValue # links_out_to_cells, linksOutToCells # formula, formula model = smart.models.CellHistory({ 'linkInFromCell': smart.models.CellLink(), 'columnType': 'foo', 'modifiedBy': smart.models.User(), 'hyperlink': smart.models.Hyperlink(), 'conditionalFormat': 'foo', 'value': 'foo', 'columnId': 19082, 'format': 'foo', 'strict': True, 'displayValue': 'foo', 'linksOutToCells': smart.models.CellLink(), 'formula': 'foo' }) assert isinstance(model.link_in_from_cell, smart.models.CellLink) assert model.column_type == 'foo' assert isinstance(model.modified_by, smart.models.User) assert isinstance(model.hyperlink, smart.models.Hyperlink) assert model.conditional_format == 'foo' assert model.value == 'foo' assert model.column_id == 19082 assert model.format == 'foo' assert model.strict == True assert model.display_value == 'foo' assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) assert model.formula == 'foo' model.linkInFromCell = {} assert isinstance(model.link_in_from_cell, smart.models.CellLink) model.modifiedBy = {} assert isinstance(model.modified_by, smart.models.User) model.hyperlink = {} assert isinstance(model.hyperlink, smart.models.Hyperlink) model.linksOutToCells = {} assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_cell_history_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.CellHistory({ 'columnType': 'foo', 'hyperlink': smart.models.Hyperlink(), 'conditionalFormat': 'foo', 'value': 'foo', 'strict': True, 'displayValue': 'foo', 'formula': 'foo', 'link_in_from_cell': smart.models.CellLink(), 'modified_by': smart.models.User(), 'column_id': 19082, 'format': 'foo', 'links_out_to_cells': smart.models.CellLink() }) assert isinstance(model.link_in_from_cell, smart.models.CellLink) assert model.column_type == 'foo' assert isinstance(model.modified_by, smart.models.User) assert isinstance(model.hyperlink, smart.models.Hyperlink) assert model.conditional_format == 'foo' assert model.value == 'foo' assert model.column_id == 19082 assert model.format == 'foo' assert model.strict == True assert model.display_value == 'foo' assert isinstance(model.links_out_to_cells[0], smart.models.CellLink) assert model.formula == 'foo' def test_user_profile(self, smart_setup): smart = smart_setup['smart'] # account, account # admin, admin # email, email # first_name, firstName # group_admin, groupAdmin # id, id # last_name, lastName # licensed_sheet_creator, licensedSheetCreator # locale, locale # resource_viewer, resourceViewer # status, status # time_zone, timeZone model = smart.models.UserProfile({ 'account': smart.models.Account(), 'admin': True, 'email': 'foo', 'firstName': 'foo', 'groupAdmin': True, 'id': 19082, 'lastName': 'foo', 'licensedSheetCreator': True, 'locale': 'foo', 'resourceViewer': True, 'status': 'ACTIVE', 'timeZone': 'foo' }) assert isinstance(model.account, smart.models.Account) assert model.admin == True assert model.email == 'foo' assert model.first_name == 'foo' assert model.group_admin == True assert model.id == 19082 assert model.last_name == 'foo' assert model.licensed_sheet_creator == True assert model.locale == 'foo' assert model.resource_viewer == True assert model.status == 'ACTIVE' assert model.time_zone == 'foo' model.account = {} assert isinstance(model.account, smart.models.Account) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_user_profile_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.UserProfile({ 'account': smart.models.Account(), 'admin': True, 'email': 'foo', 'locale': 'foo', 'status': 'ACTIVE', 'first_name': 'foo', 'group_admin': True, 'id': 19082, 'last_name': 'foo', 'licensed_sheet_creator': True, 'resource_viewer': True, 'time_zone': 'foo' }) assert isinstance(model.account, smart.models.Account) assert model.admin == True assert model.email == 'foo' assert model.first_name == 'foo' assert model.group_admin == True assert model.id == 19082 assert model.last_name == 'foo' assert model.licensed_sheet_creator == True assert model.locale == 'foo' assert model.resource_viewer == True assert model.status == 'ACTIVE' assert model.time_zone == 'foo' def test_group_member(self, smart_setup): smart = smart_setup['smart'] # email, email # first_name, firstName # id, id # last_name, lastName # name, name model = smart.models.GroupMember({ 'email': 'foo', 'firstName': 'foo', 'id': 19082, 'lastName': 'foo', 'name': 'foo' }) assert model.email == 'foo' assert model.first_name == 'foo' assert model.id == 19082 assert model.last_name == 'foo' assert model.name == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_group_member_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.GroupMember({ 'email': 'foo', 'name': 'foo', 'first_name': 'foo', 'id': 19082, 'last_name': 'foo' }) assert model.email == 'foo' assert model.first_name == 'foo' assert model.id == 19082 assert model.last_name == 'foo' assert model.name == 'foo' def test_error_result(self, smart_setup): smart = smart_setup['smart'] # code, code # message, message # name, name # recommendation, recommendation # should_retry, shouldRetry # status_code, statusCode model = smart.models.ErrorResult({ 'code': 19082, 'message': 'foo', 'name': 'foo', 'recommendation': 'foo', 'shouldRetry': True, 'statusCode': 19082 }) assert model.code == 19082 assert model.message == 'foo' assert model.name == 'foo' assert model.recommendation == 'foo' assert model.should_retry == True assert model.status_code == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_error_result_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.ErrorResult({ 'code': 19082, 'message': 'foo', 'name': 'foo', 'recommendation': 'foo', 'should_retry': True, 'status_code': 19082 }) assert model.code == 19082 assert model.message == 'foo' assert model.name == 'foo' assert model.recommendation == 'foo' assert model.should_retry == True assert model.status_code == 19082 def test_report_column(self, smart_setup): smart = smart_setup['smart'] # sheet_name_column, sheetNameColumn # tags, tags # index, index # symbol, symbol # width, width # format, format # type, type # id, id # title, title # locked_for_user, lockedForUser # hidden, hidden # primary, primary # system_column_type, systemColumnType # locked, locked # virtual_id, virtualId # options, options # auto_number_format, autoNumberFormat model = smart.models.ReportColumn({ 'sheetNameColumn': True, 'tags': ['foo'], 'index': 19082, 'symbol': 'STAR', 'width': 19082, 'format': 'foo', 'type': 'TEXT_NUMBER', 'id': 19082, 'title': 'foo', 'lockedForUser': True, 'hidden': True, 'primary': True, 'systemColumnType': 'AUTO_NUMBER', 'locked': True, 'virtualId': 19082, 'options': ['foo'], 'autoNumberFormat': smart.models.AutoNumberFormat() }) assert model.sheet_name_column == True assert model.tags[0] == 'foo' assert model.index == 19082 assert model.symbol == 'STAR' assert model.width == 19082 assert model.format == 'foo' assert model.type == 'TEXT_NUMBER' assert model.id == 19082 assert model.title == 'foo' assert model.locked_for_user == True assert model.hidden == True assert model.primary == True assert model.system_column_type == 'AUTO_NUMBER' assert model.locked == True assert model.virtual_id == 19082 assert model.options[0] == 'foo' assert isinstance(model.auto_number_format, smart.models.AutoNumberFormat) model.tags = 'foo' assert model.tags[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.tags = tmplist assert model.tags[0] == 'foo' model.options = 'foo' assert model.options[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.options = tmplist assert model.options[0] == 'foo' model.autoNumberFormat = {} assert isinstance(model.auto_number_format, smart.models.AutoNumberFormat) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_report_column_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.ReportColumn({ 'tags': ['foo'], 'index': 19082, 'symbol': 'STAR', 'width': 19082, 'title': 'foo', 'hidden': True, 'primary': True, 'locked': True, 'options': ['foo'], 'sheet_name_column': True, 'format': 'foo', 'type': 'TEXT_NUMBER', 'id': 19082, 'locked_for_user': True, 'system_column_type': 'AUTO_NUMBER', 'virtual_id': 19082, 'auto_number_format': smart.models.AutoNumberFormat() }) assert model.sheet_name_column == True assert model.tags[0] == 'foo' assert model.index == 19082 assert model.symbol == 'STAR' assert model.width == 19082 assert model.format == 'foo' assert model.type == 'TEXT_NUMBER' assert model.id == 19082 assert model.title == 'foo' assert model.locked_for_user == True assert model.hidden == True assert model.primary == True assert model.system_column_type == 'AUTO_NUMBER' assert model.locked == True assert model.virtual_id == 19082 assert model.options[0] == 'foo' assert isinstance(model.auto_number_format, smart.models.AutoNumberFormat) def test_search_result(self, smart_setup): smart = smart_setup['smart'] # results, results # total_count, totalCount model = smart.models.SearchResult({ 'results': smart.models.SearchResultItem(), 'totalCount': 19082 }) assert isinstance(model.results[0], smart.models.SearchResultItem) assert model.total_count == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_search_result_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.SearchResult({ 'results': smart.models.SearchResultItem(), 'totalCount': 19082 }) assert isinstance(model.results[0], smart.models.SearchResultItem) assert model.total_count == 19082 def test_sheet_publish(self, smart_setup): smart = smart_setup['smart'] # ical_enabled, icalEnabled # ical_url, icalUrl # read_only_full_enabled, readOnlyFullEnabled # read_only_full_url, readOnlyFullUrl # read_only_lite_enabled, readOnlyLiteEnabled # read_only_lite_url, readOnlyLiteUrl # read_write_enabled, readWriteEnabled # read_write_url, readWriteUrl model = smart.models.SheetPublish({ 'icalEnabled': True, 'icalUrl': 'foo', 'readOnlyFullEnabled': True, 'readOnlyFullUrl': 'foo', 'readOnlyLiteEnabled': True, 'readOnlyLiteUrl': 'foo', 'readWriteEnabled': True, 'readWriteUrl': 'foo' }) assert model.ical_enabled == True assert model.ical_url == 'foo' assert model.read_only_full_enabled == True assert model.read_only_full_url == 'foo' assert model.read_only_lite_enabled == True assert model.read_only_lite_url == 'foo' assert model.read_write_enabled == True assert model.read_write_url == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_sheet_publish_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.SheetPublish({ 'icalUrl': 'foo', 'readOnlyFullUrl': 'foo', 'readOnlyLiteUrl': 'foo', 'readWriteUrl': 'foo', 'ical_enabled': True, 'read_only_full_enabled': True, 'read_only_lite_enabled': True, 'read_write_enabled': True }) assert model.ical_enabled == True assert model.ical_url == 'foo' assert model.read_only_full_enabled == True assert model.read_only_full_url == 'foo' assert model.read_only_lite_enabled == True assert model.read_only_lite_url == 'foo' assert model.read_write_enabled == True assert model.read_write_url == 'foo' def test_format_tables(self, smart_setup): smart = smart_setup['smart'] # bold, bold # color, color # currency, currency # decimal_count, decimalCount # defaults, defaults # font_family, fontFamily # font_size, fontSize # horizontal_align, horizontalAlign # italic, italic # number_format, numberFormat # strikethrough, strikethrough # text_wrap, textWrap # thousands_separator, thousandsSeparator # underline, underline # vertical_align, verticalAlign model = smart.models.FormatTables({ 'bold': ['foo'], 'color': ['foo'], 'currency': smart.models.Currency(), 'decimalCount': ['foo'], 'defaults': 'foo', 'fontFamily': smart.models.FontFamily(), 'fontSize': ['foo'], 'horizontalAlign': ['foo'], 'italic': ['foo'], 'numberFormat': ['foo'], 'strikethrough': ['foo'], 'textWrap': ['foo'], 'thousandsSeparator': ['foo'], 'underline': ['foo'], 'verticalAlign': ['foo'] }) assert model.bold[0] == 'foo' assert model.color[0] == 'foo' assert isinstance(model.currency[0], smart.models.Currency) assert model.decimal_count[0] == 'foo' assert model.defaults == 'foo' assert isinstance(model.font_family[0], smart.models.FontFamily) assert model.font_size[0] == 'foo' assert model.horizontal_align[0] == 'foo' assert model.italic[0] == 'foo' assert model.number_format[0] == 'foo' assert model.strikethrough[0] == 'foo' assert model.text_wrap[0] == 'foo' assert model.thousands_separator[0] == 'foo' assert model.underline[0] == 'foo' assert model.vertical_align[0] == 'foo' model.bold = 'foo' assert model.bold[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.bold = tmplist assert model.bold[0] == 'foo' model.color = 'foo' assert model.color[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.color = tmplist assert model.color[0] == 'foo' model.decimal_count = 'foo' assert model.decimal_count[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.decimal_count = tmplist assert model.decimal_count[0] == 'foo' model.font_size = 'foo' assert model.font_size[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.font_size = tmplist assert model.font_size[0] == 'foo' model.horizontal_align = 'foo' assert model.horizontal_align[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.horizontal_align = tmplist assert model.horizontal_align[0] == 'foo' model.italic = 'foo' assert model.italic[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.italic = tmplist assert model.italic[0] == 'foo' model.number_format = 'foo' assert model.number_format[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.number_format = tmplist assert model.number_format[0] == 'foo' model.strikethrough = 'foo' assert model.strikethrough[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.strikethrough = tmplist assert model.strikethrough[0] == 'foo' model.text_wrap = 'foo' assert model.text_wrap[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.text_wrap = tmplist assert model.text_wrap[0] == 'foo' model.thousands_separator = 'foo' assert model.thousands_separator[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.thousands_separator = tmplist assert model.thousands_separator[0] == 'foo' model.underline = 'foo' assert model.underline[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.underline = tmplist assert model.underline[0] == 'foo' model.vertical_align = 'foo' assert model.vertical_align[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.vertical_align = tmplist assert model.vertical_align[0] == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_format_tables_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.FormatTables({ 'bold': ['foo'], 'color': ['foo'], 'currency': smart.models.Currency(), 'defaults': 'foo', 'italic': ['foo'], 'strikethrough': ['foo'], 'underline': ['foo'], 'decimal_count': ['foo'], 'font_family': smart.models.FontFamily(), 'font_size': ['foo'], 'horizontal_align': ['foo'], 'number_format': ['foo'], 'text_wrap': ['foo'], 'thousands_separator': ['foo'], 'vertical_align': ['foo'] }) assert model.bold[0] == 'foo' assert model.color[0] == 'foo' assert isinstance(model.currency[0], smart.models.Currency) assert model.decimal_count[0] == 'foo' assert model.defaults == 'foo' assert isinstance(model.font_family[0], smart.models.FontFamily) assert model.font_size[0] == 'foo' assert model.horizontal_align[0] == 'foo' assert model.italic[0] == 'foo' assert model.number_format[0] == 'foo' assert model.strikethrough[0] == 'foo' assert model.text_wrap[0] == 'foo' assert model.thousands_separator[0] == 'foo' assert model.underline[0] == 'foo' assert model.vertical_align[0] == 'foo' def test_update_request(self, smart_setup): smart = smart_setup['smart'] # id, id model = smart.models.UpdateRequest({ 'id': 19082 }) assert model.id == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_update_request_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.UpdateRequest({ 'id': 19082 }) assert model.id == 19082 def test_format_details(self, smart_setup): smart = smart_setup['smart'] # paper_size, paperSize model = smart.models.FormatDetails({ 'paperSize': 'LETTER' }) assert model.paper_size == 'LETTER' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_format_details_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.FormatDetails({ 'paper_size': 'LETTER' }) assert model.paper_size == 'LETTER' def test_multi_row_email(self, smart_setup): smart = smart_setup['smart'] # row_ids, rowIds model = smart.models.MultiRowEmail({ 'rowIds': [19082] }) assert model.row_ids[0] == 19082 model.row_ids = 19082 assert model.row_ids[0] == 19082 tmplist = smartsheet.types.TypedList(int) tmplist.append(19082) model.row_ids = tmplist assert model.row_ids[0] == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_multi_row_email_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.MultiRowEmail({ 'row_ids': [19082] }) assert model.row_ids[0] == 19082 def test_downloaded_file(self, smart_setup): smart = smart_setup['smart'] # download_directory, downloadDirectory # filename, filename # message, message # resp, resp # result_code, resultCode model = smart.models.DownloadedFile({ 'downloadDirectory': 'foo', 'filename': 'foo', 'message': 'foo', 'resultCode': 19082 }) assert model.download_directory == 'foo' assert model.filename == 'foo' assert model.message == 'foo' assert model.result_code == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_downloaded_file_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.DownloadedFile({ 'filename': 'foo', 'message': 'foo', 'resultCode': 19082, 'download_directory': 'foo' }) assert model.download_directory == 'foo' assert model.filename == 'foo' assert model.message == 'foo' assert model.result_code == 19082 def test_alternate_email(self, smart_setup): smart = smart_setup['smart'] # confirmed, confirmed # email, email # id, id model = smart.models.AlternateEmail({ 'confirmed': True, 'email': 'foo', 'id': 19082 }) assert model.confirmed == True assert model.email == 'foo' assert model.id == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_alternate_email_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.AlternateEmail({ 'confirmed': True, 'email': 'foo', 'id': 19082 }) assert model.confirmed == True assert model.email == 'foo' assert model.id == 19082 def test_search_result_item(self, smart_setup): smart = smart_setup['smart'] # context_data, contextData # object_id, objectId # object_type, objectType # parent_object_id, parentObjectId # parent_object_name, parentObjectName # parent_object_type, parentObjectType # text, text model = smart.models.SearchResultItem({ 'contextData': ['foo'], 'objectId': 19082, 'objectType': 'row', 'parentObjectId': 19082, 'parentObjectName': 'foo', 'parentObjectType': 'workspace', 'text': 'foo' }) assert model.context_data[0] == 'foo' assert model.object_id == 19082 assert model.object_type == 'row' assert model.parent_object_id == 19082 assert model.parent_object_name == 'foo' assert model.parent_object_type == 'workspace' assert model.text == 'foo' model.context_data = 'foo' assert model.context_data[0] == 'foo' tmplist = smartsheet.types.TypedList(str) tmplist.append('foo') model.context_data = tmplist assert model.context_data[0] == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_search_result_item_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.SearchResultItem({ 'objectId': 19082, 'objectType': 'row', 'parentObjectId': 19082, 'parentObjectName': 'foo', 'parentObjectType': 'workspace', 'text': 'foo', 'context_data': ['foo'] }) assert model.context_data[0] == 'foo' assert model.object_id == 19082 assert model.object_type == 'row' assert model.parent_object_id == 19082 assert model.parent_object_name == 'foo' assert model.parent_object_type == 'workspace' assert model.text == 'foo' def test_auto_number_format(self, smart_setup): smart = smart_setup['smart'] # fill, fill # prefix, prefix # starting_number, startingNumber # suffix, suffix model = smart.models.AutoNumberFormat({ 'fill': 'foo', 'prefix': 'foo', 'startingNumber': 19082, 'suffix': 'foo' }) assert model.fill == 'foo' assert model.prefix == 'foo' assert model.starting_number == 19082 assert model.suffix == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_auto_number_format_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.AutoNumberFormat({ 'fill': 'foo', 'prefix': 'foo', 'suffix': 'foo', 'starting_number': 19082 }) assert model.fill == 'foo' assert model.prefix == 'foo' assert model.starting_number == 19082 assert model.suffix == 'foo' def test_sheet_user_settings(self, smart_setup): smart = smart_setup['smart'] # critical_path_enabled, criticalPathEnabled model = smart.models.SheetUserSettings({ 'criticalPathEnabled': True }) assert model.critical_path_enabled == True as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_sheet_user_settings_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.SheetUserSettings({ 'critical_path_enabled': True }) assert model.critical_path_enabled == True def test_copy_or_move_row_result(self, smart_setup): smart = smart_setup['smart'] # destination_sheet_id, destinationSheetId # row_mappings, rowMappings model = smart.models.CopyOrMoveRowResult({ 'destinationSheetId': 19082, 'rowMappings': smart.models.RowMapping() }) assert model.destination_sheet_id == 19082 assert isinstance(model.row_mappings[0], smart.models.RowMapping) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_copy_or_move_row_result_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.CopyOrMoveRowResult({ 'destination_sheet_id': 19082, 'row_mappings': smart.models.RowMapping() }) assert model.destination_sheet_id == 19082 assert isinstance(model.row_mappings[0], smart.models.RowMapping) def test_container_destination(self, smart_setup): smart = smart_setup['smart'] # destination_id, destinationId # destination_type, destinationType # new_name, newName model = smart.models.ContainerDestination({ 'destinationId': 19082, 'destinationType': 'home', 'newName': 'foo' }) assert model.destination_id == 19082 assert model.destination_type == 'home' assert model.new_name == 'foo' as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_container_destination_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.ContainerDestination({ 'destination_id': 19082, 'destination_type': 'home', 'new_name': 'foo' }) assert model.destination_id == 19082 assert model.destination_type == 'home' assert model.new_name == 'foo' def test_copy_or_move_row_directive(self, smart_setup): smart = smart_setup['smart'] # row_ids, rowIds # to, to model = smart.models.CopyOrMoveRowDirective({ 'rowIds': [19082], 'to': smart.models.CopyOrMoveRowDestination() }) assert model.row_ids[0] == 19082 assert isinstance(model.to, smart.models.CopyOrMoveRowDestination) model.row_ids = 19082 assert model.row_ids[0] == 19082 tmplist = smartsheet.types.TypedList(int) tmplist.append(19082) model.row_ids = tmplist assert model.row_ids[0] == 19082 model.to = {} assert isinstance(model.to, smart.models.CopyOrMoveRowDestination) as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_copy_or_move_row_directive_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.CopyOrMoveRowDirective({ 'to': smart.models.CopyOrMoveRowDestination(), 'row_ids': [19082] }) assert model.row_ids[0] == 19082 assert isinstance(model.to, smart.models.CopyOrMoveRowDestination) def test_copy_or_move_row_destination(self, smart_setup): smart = smart_setup['smart'] # sheet_id, sheetId model = smart.models.CopyOrMoveRowDestination({ 'sheetId': 19082 }) assert model.sheet_id == 19082 as_dict = model.to_dict() assert isinstance(as_dict, dict) def test_copy_or_move_row_destination_snake(self, smart_setup): smart = smart_setup['smart'] model = smart.models.CopyOrMoveRowDestination({ 'sheet_id': 19082 }) assert model.sheet_id == 19082
35.176904
82
0.574083
10,132
100,219
5.511844
0.039479
0.128819
0.059091
0.037424
0.782903
0.750009
0.709917
0.673012
0.645203
0.633206
0
0.028215
0.311448
100,219
2,848
83
35.189256
0.781077
0.085014
0
0.850854
0
0
0.105917
0.004655
0
0
0
0
0.389488
1
0.049416
false
0
0.000898
0
0.050764
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8abd3ef176facbaa1bc502d6bfc3377138fc5d84
190
py
Python
tests/secrets.example.py
chmreid/centillion
91e64330ad2881ff19253d54992ae989bc3a67ff
[ "MIT" ]
6
2019-03-09T18:32:55.000Z
2020-06-29T15:38:36.000Z
tests/secrets.example.py
chmreid/centillion
91e64330ad2881ff19253d54992ae989bc3a67ff
[ "MIT" ]
20
2020-02-27T06:54:22.000Z
2020-07-11T21:38:06.000Z
tests/secrets.example.py
chmreid/centillion
91e64330ad2881ff19253d54992ae989bc3a67ff
[ "MIT" ]
2
2019-08-20T01:49:15.000Z
2020-01-19T09:25:58.000Z
GITHUB_OAUTH_CLIENT_ID = "XXXXX" GITHUB_OAUTH_CLIENT_SECRET = "XXXXX" GITHUB_TOKEN = "XXXXX" DISQUS_TOKEN = "XXXXX" SECRET_KEY = "XXXXX"
31.666667
37
0.563158
19
190
5.157895
0.473684
0.22449
0.346939
0
0
0
0
0
0
0
0
0
0.357895
190
5
38
38
0.803279
0
0
0
0
0
0.131579
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
8ac602c5f80c7ac1ddd502f387a5860bbf904ff4
249
py
Python
pyppeteer_stealth/navigator_permissions.py
MeiK2333/pyppeteer-stealth
0f04fcfbf596052bbbe102d5e68f82956af57338
[ "MIT" ]
138
2019-08-29T21:36:53.000Z
2022-03-28T09:45:22.000Z
pyppeteer_stealth/navigator_permissions.py
mcolella14/pyppeteer_stealth
e511902e2531f63d4329d95a395a55a0102cf461
[ "MIT" ]
15
2020-02-04T18:49:45.000Z
2022-01-23T16:59:46.000Z
pyppeteer_stealth/navigator_permissions.py
mcolella14/pyppeteer_stealth
e511902e2531f63d4329d95a395a55a0102cf461
[ "MIT" ]
33
2019-09-09T15:23:44.000Z
2022-03-31T17:45:11.000Z
from pathlib import Path from pyppeteer.page import Page async def navigator_permissions(page: Page, **kwargs) -> None: await page.evaluateOnNewDocument( Path(__file__).parent.joinpath("js/navigator.permissions.js").read_text() )
24.9
81
0.738956
30
249
5.933333
0.666667
0.224719
0
0
0
0
0
0
0
0
0
0
0.15261
249
9
82
27.666667
0.843602
0
0
0
0
0
0.108434
0.108434
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
8acb4fef52247e295de6e6d35b579a8c6e179dc5
41
py
Python
sherpa_app/__init__.py
spmorillo/sherpa-app
a369326086d84bbe2fe84409f2b95210aa221978
[ "MIT" ]
null
null
null
sherpa_app/__init__.py
spmorillo/sherpa-app
a369326086d84bbe2fe84409f2b95210aa221978
[ "MIT" ]
null
null
null
sherpa_app/__init__.py
spmorillo/sherpa-app
a369326086d84bbe2fe84409f2b95210aa221978
[ "MIT" ]
null
null
null
import flask app = flask.Flask(__name__)
13.666667
27
0.780488
6
41
4.666667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.121951
41
2
28
20.5
0.777778
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
8ad533e0a3176e844dbec2516cd83cc391130998
190
py
Python
src/inn.py
ladroid/petrinlang
5b5ed66001640c9a8c974f615f214ad402c152f6
[ "Apache-2.0" ]
null
null
null
src/inn.py
ladroid/petrinlang
5b5ed66001640c9a8c974f615f214ad402c152f6
[ "Apache-2.0" ]
null
null
null
src/inn.py
ladroid/petrinlang
5b5ed66001640c9a8c974f615f214ad402c152f6
[ "Apache-2.0" ]
null
null
null
import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from src.arc import Arc class In(Arc): def trigger(self): self.place.markers += self.amount
31.666667
77
0.742105
32
190
4.28125
0.59375
0.131387
0.189781
0.218978
0.233577
0
0
0
0
0
0
0
0.105263
190
6
78
31.666667
0.805882
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.666667
0
0
0
0
null
0
1
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
1
0
0
0
0
4
76f24161f4a57f5c6279be3742d19e128cb7df95
265
py
Python
erpnext_biotrack/traceability/doctype/plant_entry/test_plant_entry.py
webonyx/erpnext_biotrack
eb2384a6c3fda84a91c81c959f095a5386a89665
[ "MIT" ]
11
2017-05-29T23:35:21.000Z
2022-03-12T04:29:21.000Z
erpnext_biotrack/traceability/doctype/plant_entry/test_plant_entry.py
webonyx/erpnext_biotrack
eb2384a6c3fda84a91c81c959f095a5386a89665
[ "MIT" ]
1
2016-12-11T16:58:36.000Z
2016-12-11T16:58:36.000Z
erpnext_biotrack/traceability/doctype/plant_entry/test_plant_entry.py
webonyx/erpnext_biotrack
eb2384a6c3fda84a91c81c959f095a5386a89665
[ "MIT" ]
14
2016-12-17T11:01:03.000Z
2021-11-01T10:21:45.000Z
# -*- coding: utf-8 -*- # Copyright (c) 2015, Webonyx and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest # test_records = frappe.get_test_records('Plant Entry') class TestPlantEntry(unittest.TestCase): pass
20.384615
55
0.769811
34
265
5.764706
0.823529
0.112245
0
0
0
0
0
0
0
0
0
0.021739
0.132075
265
12
56
22.083333
0.830435
0.513208
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.2
0.6
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
1
0
1
0
0
4
0a2e5c650a6ed664141f90724779a4e7fe005e7e
110
py
Python
src/s3_site_cache_optimizer/__init__.py
Appstrakt/s3-site-cache-optimizer
401cffd1c8bcd0d2f4793a89ec1c48ccb8721307
[ "MIT" ]
7
2015-01-19T18:27:11.000Z
2015-02-17T02:39:23.000Z
src/s3_site_cache_optimizer/__init__.py
novemberfiveco/s3-site-cache-optimizer
401cffd1c8bcd0d2f4793a89ec1c48ccb8721307
[ "MIT" ]
3
2020-03-13T02:11:41.000Z
2020-06-01T19:37:09.000Z
src/s3_site_cache_optimizer/__init__.py
Appstrakt/s3-site-cache-optimizer
401cffd1c8bcd0d2f4793a89ec1c48ccb8721307
[ "MIT" ]
3
2017-10-09T13:46:02.000Z
2019-03-29T01:24:43.000Z
from pkg_resources import get_distribution __version__ = get_distribution('s3-site-cache-optimizer').version
27.5
65
0.845455
14
110
6.142857
0.785714
0.348837
0
0
0
0
0
0
0
0
0
0.009804
0.072727
110
3
66
36.666667
0.833333
0
0
0
0
0
0.209091
0.209091
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
0a520c48d0b894b27cdf2e0157af30d3233e5065
1,900
py
Python
tensorflow/contrib/layers/python/layers/__init__.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
6
2022-02-04T18:12:24.000Z
2022-03-21T23:57:12.000Z
Lib/site-packages/tensorflow/contrib/layers/python/layers/__init__.py
shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings
1fa4cd6a566c8745f455fc3d2273208f21f88ced
[ "bzip2-1.0.6" ]
1
2021-05-20T00:58:04.000Z
2021-05-20T00:58:04.000Z
Lib/site-packages/tensorflow/contrib/layers/python/layers/__init__.py
shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings
1fa4cd6a566c8745f455fc3d2273208f21f88ced
[ "bzip2-1.0.6" ]
1
2022-02-08T03:53:23.000Z
2022-02-08T03:53:23.000Z
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """layers module with higher level NN primitives.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=wildcard-import from tensorflow.contrib.layers.python.layers.embedding_ops import * from tensorflow.contrib.layers.python.layers.encoders import * from tensorflow.contrib.layers.python.layers.feature_column import * from tensorflow.contrib.layers.python.layers.feature_column_ops import * from tensorflow.contrib.layers.python.layers.initializers import * from tensorflow.contrib.layers.python.layers.layers import * from tensorflow.contrib.layers.python.layers.normalization import * from tensorflow.contrib.layers.python.layers.optimizers import * from tensorflow.contrib.layers.python.layers.regularizers import * from tensorflow.contrib.layers.python.layers.rev_block_lib import * from tensorflow.contrib.layers.python.layers.summaries import * from tensorflow.contrib.layers.python.layers.target_column import * from tensorflow.contrib.layers.python.ops.bucketization_op import * from tensorflow.contrib.layers.python.ops.sparse_feature_cross_op import * # pylint: enable=wildcard-import
51.351351
81
0.767895
246
1,900
5.829268
0.418699
0.104603
0.195258
0.263598
0.461646
0.461646
0.461646
0.147838
0.080893
0
0
0.004773
0.117895
1,900
36
82
52.777778
0.850835
0.405789
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0.058824
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
1
0
1
0
0
0
0
4
0a6ae0ad430771571caf0f593ae9d5f21e07a647
129
py
Python
Python OOP/OOP/Inheritance/Exercise/Task01/project/child.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
1
2022-03-16T10:23:04.000Z
2022-03-16T10:23:04.000Z
Python OOP/OOP/Inheritance/Exercise/Task01/project/child.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
null
null
null
Python OOP/OOP/Inheritance/Exercise/Task01/project/child.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
null
null
null
from project.person import Person class Child(Person): def __init__(self, name, age): super().__init__(name, age)
16.125
35
0.674419
17
129
4.647059
0.705882
0.177215
0
0
0
0
0
0
0
0
0
0
0.209302
129
7
36
18.428571
0.77451
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
0a6beb47141f5991387d7fd9554e62a5210b27e6
139
py
Python
examples/hooks/per_test_post.py
rsp9u/side-runner-py
13ad73a0d9055b03c9de54e0bbd4234b34d86498
[ "MIT" ]
5
2020-02-13T00:24:41.000Z
2022-01-10T10:11:00.000Z
examples/hooks/per_test_post.py
rsp9u/side-runner-py
13ad73a0d9055b03c9de54e0bbd4234b34d86498
[ "MIT" ]
58
2019-04-02T02:51:02.000Z
2021-01-14T08:42:19.000Z
examples/hooks/per_test_post.py
rsp9u/side-runner-py
13ad73a0d9055b03c9de54e0bbd4234b34d86498
[ "MIT" ]
7
2019-04-02T11:42:24.000Z
2020-11-10T20:17:56.000Z
conditions = { 'test_project_ids': ['*'], 'test_suite_ids': ['*'], 'test_names': ['logout'], } def post_test_run(): pass
13.9
30
0.546763
15
139
4.6
0.733333
0.202899
0
0
0
0
0
0
0
0
0
0
0.223022
139
9
31
15.444444
0.638889
0
0
0
0
0
0.345324
0
0
0
0
0
0
1
0.142857
false
0.142857
0
0
0.142857
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4