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
0d37e90dca95e3985986b6fc950f40dc1aa89c2b
140
py
Python
hello.py
alee8542/cs3240-labdemo
f80a8f1dae79167cb13c3e176e14e3942852d04e
[ "MIT" ]
null
null
null
hello.py
alee8542/cs3240-labdemo
f80a8f1dae79167cb13c3e176e14e3942852d04e
[ "MIT" ]
null
null
null
hello.py
alee8542/cs3240-labdemo
f80a8f1dae79167cb13c3e176e14e3942852d04e
[ "MIT" ]
null
null
null
import helper from helper import greeting def main(): #print("called hello") helper.greeting("hello") if __name__ == '__main__': main()
15.555556
27
0.714286
18
140
5.111111
0.611111
0
0
0
0
0
0
0
0
0
0
0
0.142857
140
9
28
15.555556
0.766667
0.15
0
0
0
0
0.109244
0
0
0
0
0
0
1
0.166667
true
0
0.333333
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
0d451f62800e63abede99f96599f3535638b9e60
1,482
py
Python
tests/v1/test_synthetics_test_config.py
MichaelTROEHLER/datadog-api-client-python
12c46626622fb1277bb1e172753b342c671348bd
[ "Apache-2.0" ]
null
null
null
tests/v1/test_synthetics_test_config.py
MichaelTROEHLER/datadog-api-client-python
12c46626622fb1277bb1e172753b342c671348bd
[ "Apache-2.0" ]
null
null
null
tests/v1/test_synthetics_test_config.py
MichaelTROEHLER/datadog-api-client-python
12c46626622fb1277bb1e172753b342c671348bd
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. from __future__ import absolute_import import sys import unittest import datadog_api_client.v1 try: from datadog_api_client.v1.model import synthetics_assertion except ImportError: synthetics_assertion = sys.modules[ 'datadog_api_client.v1.model.synthetics_assertion'] try: from datadog_api_client.v1.model import synthetics_browser_variable except ImportError: synthetics_browser_variable = sys.modules[ 'datadog_api_client.v1.model.synthetics_browser_variable'] try: from datadog_api_client.v1.model import synthetics_test_request except ImportError: synthetics_test_request = sys.modules[ 'datadog_api_client.v1.model.synthetics_test_request'] from datadog_api_client.v1.model.synthetics_test_config import SyntheticsTestConfig class TestSyntheticsTestConfig(unittest.TestCase): """SyntheticsTestConfig unit test stubs""" def setUp(self): pass def tearDown(self): pass def testSyntheticsTestConfig(self): """Test SyntheticsTestConfig""" # FIXME: construct object with mandatory attributes with example values # model = SyntheticsTestConfig() # noqa: E501 pass if __name__ == '__main__': unittest.main()
30.244898
108
0.762483
176
1,482
6.159091
0.448864
0.073801
0.118081
0.132841
0.287823
0.287823
0.284133
0.24631
0.127306
0
0
0.014575
0.166667
1,482
48
109
30.875
0.863158
0.281377
0
0.310345
0
0
0.15458
0.146947
0
0
0
0.020833
0.103448
1
0.103448
false
0.103448
0.37931
0
0.517241
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
1
0
1
0
0
4
b4c114322a503517ae099af3c79f2d917b2231a7
210
py
Python
model/contact.py
tarsic99/Python-training-
96da2df5f249f39370295504748b218247f2935c
[ "Apache-2.0" ]
null
null
null
model/contact.py
tarsic99/Python-training-
96da2df5f249f39370295504748b218247f2935c
[ "Apache-2.0" ]
null
null
null
model/contact.py
tarsic99/Python-training-
96da2df5f249f39370295504748b218247f2935c
[ "Apache-2.0" ]
null
null
null
class Contact: def __init__(self, first_name = None, last_name = None, mobile_phone = None): self.first_name = first_name self.last_name = last_name self.mobile_phone = mobile_phone
35
81
0.685714
29
210
4.517241
0.37931
0.206107
0.198473
0
0
0
0
0
0
0
0
0
0.238095
210
6
82
35
0.81875
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0
0.4
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
b4c6b2e3ba90e086aba9fcd3f0c69b5fe6016f3e
71
py
Python
web2py-appliances-master/VideoLibrary/languages/it.py
wantsomechocolate/WantsomeBeanstalk
8c8a0a80490d04ea52661a3114fd3db8de65a01e
[ "BSD-3-Clause" ]
4
2015-05-28T04:37:28.000Z
2017-12-03T11:11:27.000Z
languages/it.py
sungchi/feed9
25aafce5a47fef6133ac7fef42401cbe62003d81
[ "MIT" ]
null
null
null
languages/it.py
sungchi/feed9
25aafce5a47fef6133ac7fef42401cbe62003d81
[ "MIT" ]
null
null
null
{ 'Hello World':'Salve Mondo', 'Welcome to web2py':'Ciao da wek2py', }
14.2
37
0.661972
10
71
4.7
1
0
0
0
0
0
0
0
0
0
0
0.032787
0.140845
71
4
38
17.75
0.737705
0
0
0
0
0
0.746479
0
0
0
0
0
0
1
0
true
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b4c7bce749ccc33db70d2dbdefc0de7260a71e74
190
py
Python
rtmBot/izyrtm_prop.py
izyrtm/izyrtm-server
c1bf0a6c3734decb7cff8266706060791479d46b
[ "Apache-2.0" ]
1
2019-10-05T14:41:02.000Z
2019-10-05T14:41:02.000Z
rtmBot/izyrtm_prop.py
izyrtm/izyrtm-server
c1bf0a6c3734decb7cff8266706060791479d46b
[ "Apache-2.0" ]
null
null
null
rtmBot/izyrtm_prop.py
izyrtm/izyrtm-server
c1bf0a6c3734decb7cff8266706060791479d46b
[ "Apache-2.0" ]
null
null
null
domain='https://monbot.hopto.org' apm_id='admin' apm_pw='New1234!' apm_url='https://monbot.hopto.org:3000' db_host='monbot.hopto.org' db_user='izyrtm' db_pw='new1234!' db_datadbase='monbot'
21.111111
39
0.752632
32
190
4.25
0.53125
0.242647
0.308824
0.279412
0
0
0
0
0
0
0
0.065934
0.042105
190
9
40
21.111111
0.681319
0
0
0
0
0
0.534031
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
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
370d8cad82f39f9f6c319866224a8b6a5d29e6e7
147
py
Python
compiler/astnodes/typeannotation.py
yangdanny97/chocopy-python-frontend
d0fb63fc744771640fa4d06076743f42089899c1
[ "MIT" ]
3
2020-05-30T16:59:33.000Z
2020-05-31T00:28:45.000Z
compiler/astnodes/typeannotation.py
yangdanny97/chocopy-python-frontend
d0fb63fc744771640fa4d06076743f42089899c1
[ "MIT" ]
1
2020-05-30T17:57:11.000Z
2020-05-30T20:44:53.000Z
compiler/astnodes/typeannotation.py
yangdanny97/chocopy-python-frontend
d0fb63fc744771640fa4d06076743f42089899c1
[ "MIT" ]
null
null
null
from .node import Node class TypeAnnotation(Node): def __init__(self, location: [int], kind: str): super().__init__(location, kind)
18.375
51
0.673469
18
147
5.055556
0.722222
0
0
0
0
0
0
0
0
0
0
0
0.197279
147
7
52
21
0.771186
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
372f0b9a0c5b68436afd58d4097085803b7bfd5f
1,333
py
Python
seapy/__init__.py
oceanum/seapy
758a02677340a51bbb20d622552ce798a3221b7b
[ "MIT" ]
2
2020-07-09T03:29:10.000Z
2021-07-07T22:00:46.000Z
seapy/__init__.py
joaometocean/seapy
5df410b3f1fa928f76d3421ae3c1698e9d4a5f52
[ "MIT" ]
null
null
null
seapy/__init__.py
joaometocean/seapy
5df410b3f1fa928f76d3421ae3c1698e9d4a5f52
[ "MIT" ]
null
null
null
""" __init__.py State Estimation and Analysis for PYthon Module for working with oceanographic data and models Copyright (c)2019 University of Hawaii under the MIT-License. Requires the following packages: joblib Import classes include: - :class:`~seapy.environ.opt` - :class:`~seapy.progressbar.ProgressBar` - :class:`~seapy.tidal_energy.energetics` Imported functions include: - :func:`~seapy.lib.adddim` - :func:`~seapy.lib.chunker` - :func:`~seapy.lib.convolve_mask` - :func:`~seapy.lib.day2date` - :func:`~seapy.lib.date2day` - :func:`~seapy.lib.earth_angle` - :func:`~seapy.lib.earth_distance` - :func:`~seapy.lib.flatten` - :func:`~seapy.lib.list_files` - :func:`~seapy.lib.netcdf` - :func:`~seapy.lib.rotate` - :func:`~seapy.lib.today2day` - :func:`~seapy.lib.unique_rows` - :func:`~seapy.lib.vecfind` - :func:`~seapy.oa.oasurf` - :func:`~seapy.oa.oavol` - :func:`~seapy.tidal_energy.tidal_energy` - :func:`~seapy.progressbar.progress` """ from .lib import * from . import roms from . import model from . import qserver from . import mapping from . import filt from . import plot from . import progressbar from . import seawater from . import tide from .tidal_energy import tidal_energy from .environ import opt from .hawaii import hawaii from .oa import *
24.236364
63
0.699925
176
1,333
5.221591
0.420455
0.176279
0.182807
0.036997
0
0
0
0
0
0
0
0.006189
0.151538
1,333
54
64
24.685185
0.806366
0.711928
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
2edb46e51b23c5cc0a15172f8710ba6f0f6689e9
139
py
Python
sort-characters-by-frequency/sort-characters-by-frequency.py
anomius/Leetcode-dump
641e44c5cc614b2dc9cd01c34b9dcf12e9d16043
[ "MIT" ]
null
null
null
sort-characters-by-frequency/sort-characters-by-frequency.py
anomius/Leetcode-dump
641e44c5cc614b2dc9cd01c34b9dcf12e9d16043
[ "MIT" ]
null
null
null
sort-characters-by-frequency/sort-characters-by-frequency.py
anomius/Leetcode-dump
641e44c5cc614b2dc9cd01c34b9dcf12e9d16043
[ "MIT" ]
null
null
null
class Solution: def frequencySort(self, s: str) -> str: return reduce(lambda a, b: a + b[1]*b[0], Counter(s).most_common(), '')
46.333333
79
0.604317
22
139
3.772727
0.772727
0.048193
0
0
0
0
0
0
0
0
0
0.018018
0.201439
139
3
79
46.333333
0.72973
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
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
2c15d80e491037ea14b873717a75a66167a22e80
621
py
Python
dropme/error.py
tivaliy/dropme
3d760e1da8182cdf62ab2a6f357dea923fca3cd7
[ "Apache-2.0" ]
null
null
null
dropme/error.py
tivaliy/dropme
3d760e1da8182cdf62ab2a6f357dea923fca3cd7
[ "Apache-2.0" ]
null
null
null
dropme/error.py
tivaliy/dropme
3d760e1da8182cdf62ab2a6f357dea923fca3cd7
[ "Apache-2.0" ]
null
null
null
# # Copyright 2017 Vitalii Kulanov # class ClientException(Exception): """Base Exception for Dropme client All child classes must be instantiated before raising. """ pass class ConfigNotFoundException(ClientException): """ Should be raised if configuration for dropme client is not specified. """ pass class InvalidFileException(ClientException): """ Should be raised when some problems while working with file occurred. """ pass class ActionException(ClientException): """ Should be raised when some problems occurred while perform any command """
19.40625
74
0.702093
65
621
6.707692
0.630769
0.061927
0.158257
0.199541
0.206422
0.206422
0.206422
0
0
0
0
0.008368
0.230274
621
31
75
20.032258
0.903766
0.537842
0
0.428571
0
0
0
0
0
0
0
0
0
1
0
true
0.428571
0
0
0.571429
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
1
0
0
4
2c181e2dad47cea140e8dd9cb71766cc7851ab04
83
py
Python
sage/apps.py
one-two-four-cee-four-one-plus/sage-project
2192ef60d8d3330586147a8ca93f899ef346ed42
[ "WTFPL" ]
null
null
null
sage/apps.py
one-two-four-cee-four-one-plus/sage-project
2192ef60d8d3330586147a8ca93f899ef346ed42
[ "WTFPL" ]
null
null
null
sage/apps.py
one-two-four-cee-four-one-plus/sage-project
2192ef60d8d3330586147a8ca93f899ef346ed42
[ "WTFPL" ]
null
null
null
from django.apps import AppConfig class SageConfig(AppConfig): name = 'sage'
13.833333
33
0.73494
10
83
6.1
0.9
0
0
0
0
0
0
0
0
0
0
0
0.180723
83
5
34
16.6
0.897059
0
0
0
0
0
0.048193
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
25796623b047f49a864e729351b380a30f77c0c5
26
py
Python
Unlock_webapp/libs/grpc/_grpcio_metadata.py
maxathon2020/Enk
1bcf9c788e8b0ab5d21821b694292a3c110eb526
[ "MIT" ]
1
2021-01-15T18:00:01.000Z
2021-01-15T18:00:01.000Z
Unlock_webapp/libs/grpc/_grpcio_metadata.py
maxathon2020/Enk
1bcf9c788e8b0ab5d21821b694292a3c110eb526
[ "MIT" ]
null
null
null
Unlock_webapp/libs/grpc/_grpcio_metadata.py
maxathon2020/Enk
1bcf9c788e8b0ab5d21821b694292a3c110eb526
[ "MIT" ]
null
null
null
__version__ = """1.32.0"""
26
26
0.576923
4
26
2.75
1
0
0
0
0
0
0
0
0
0
0
0.166667
0.076923
26
1
26
26
0.291667
0
0
0
0
0
0.222222
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
257c7887bbadadf7ad524f6cc017c11ec7078dfe
219
py
Python
louis/webdev/myblog/blog/admin.py
GadinganJayHarley06/intern-blog
b442c6f307da63d8687773df7bcbf28ceab3e6a9
[ "MIT" ]
null
null
null
louis/webdev/myblog/blog/admin.py
GadinganJayHarley06/intern-blog
b442c6f307da63d8687773df7bcbf28ceab3e6a9
[ "MIT" ]
null
null
null
louis/webdev/myblog/blog/admin.py
GadinganJayHarley06/intern-blog
b442c6f307da63d8687773df7bcbf28ceab3e6a9
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Index, Tag, Category, Post # Register your models here. admin.site.register(Index) admin.site.register(Tag) admin.site.register(Category) admin.site.register(Post)
21.9
46
0.794521
32
219
5.4375
0.4375
0.206897
0.390805
0
0
0
0
0
0
0
0
0
0.100457
219
10
47
21.9
0.883249
0.118721
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
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
0
0
0
4
2592664d08f4a0c9eb9bf2b57177c0908bfc0dd1
45,764
py
Python
assignment/assignment2/test/ASTGenSuite.py
khoidohpc/ppl-course
3bcff3eeeeebc24f0fc9e3f844779f439aa97544
[ "MIT" ]
2
2020-10-21T13:04:18.000Z
2022-01-12T11:06:31.000Z
assignment/assignment2/test/ASTGenSuite.py
khoidohpc/ppl-course
3bcff3eeeeebc24f0fc9e3f844779f439aa97544
[ "MIT" ]
null
null
null
assignment/assignment2/test/ASTGenSuite.py
khoidohpc/ppl-course
3bcff3eeeeebc24f0fc9e3f844779f439aa97544
[ "MIT" ]
1
2022-01-12T11:06:45.000Z
2022-01-12T11:06:45.000Z
import unittest from TestUtils import TestAST from AST import * class ASTGenSuite(unittest.TestCase): # Test variable declaration def test_single_variable_declaration(self): input = """int a;""" expect = "Program([VarDecl(a,IntType)])" self.assertTrue(TestAST.checkASTGen(input,expect,300)) def test_single_array_declaration_float(self): input = """float a[5];""" expect = "Program([VarDecl(a,ArrayType(FloatType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,301)) def test_single_array_declaration_int(self): input = """int a[5];""" expect = "Program([VarDecl(a,ArrayType(IntType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,302)) def test_multi_variable_declaration(self): input = """boolean a,b;""" expect = "Program([VarDecl(a,BoolType),VarDecl(b,BoolType)])" self.assertTrue(TestAST.checkASTGen(input,expect,303)) def test_multi_array_declaration(self): input = """boolean a[10],b[5];""" expect = "Program([VarDecl(a,ArrayType(BoolType,10)),VarDecl(b,ArrayType(BoolType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,304)) def test_mix_variable_declaration(self): input = """boolean a,b[5];""" expect = "Program([VarDecl(a,BoolType),VarDecl(b,ArrayType(BoolType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,305)) # Test program with variable declaration def test_program_multi_variable_declaration(self): input = """int a; float b; boolean c;""" expect = "Program([VarDecl(a,IntType),VarDecl(b,FloatType),VarDecl(c,BoolType)])" self.assertTrue(TestAST.checkASTGen(input,expect,306)) def test_program_multi_array_declaration(self): input = """int a[5]; float b[6]; boolean c[7];""" expect = "Program([VarDecl(a,ArrayType(IntType,5)),VarDecl(b,ArrayType(FloatType,6)),VarDecl(c,ArrayType(BoolType,7))])" self.assertTrue(TestAST.checkASTGen(input,expect,307)) def test_program_multi_variable_array_declaration(self): input = """int a; float b; string a[10]; boolean d[5];""" expect = "Program([VarDecl(a,IntType),VarDecl(b,FloatType),VarDecl(a,ArrayType(StringType,10)),VarDecl(d,ArrayType(BoolType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,308)) def test_program_multi_variable_array_declaration_hard(self): input = """int a,x; float b,z; string a[10], l[6], r; boolean d[5];""" expect = "Program([VarDecl(a,IntType),VarDecl(x,IntType),VarDecl(b,FloatType),VarDecl(z,FloatType),VarDecl(a,ArrayType(StringType,10)),VarDecl(l,ArrayType(StringType,6)),VarDecl(r,StringType),VarDecl(d,ArrayType(BoolType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,309)) def test_expr_recursion(self): input = """void main() {(((1)));}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([IntLiteral(1)]))])" self.assertTrue(TestAST.checkASTGen(input,expect,310)) # Test function parameter def test_function_para_empty(self): input = """int main() {}""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,311)) def test_function_single_para(self): input = """int main(int a) {}""" expect = "Program([FuncDecl(Id(main),[VarDecl(a,IntType)],IntType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,312)) def test_function_multi_para(self): input = """void main(boolean a, float b) {}""" expect = "Program([FuncDecl(Id(main),[VarDecl(a,BoolType),VarDecl(b,FloatType)],VoidType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,313)) def test_function_single_array(self): input = """void main(boolean a[]) {}""" expect = "Program([FuncDecl(Id(main),[VarDecl(a,ArrayTypePointer(BoolType))],VoidType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,314)) def test_function_multi_array(self): input = """void main(boolean a[], float b[]) {}""" expect = "Program([FuncDecl(Id(main),[VarDecl(a,ArrayTypePointer(BoolType)),VarDecl(b,ArrayTypePointer(FloatType))],VoidType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,315)) # Test program with function parameter def test_function_type_array(self): input = """int[] main() {}""" expect = "Program([FuncDecl(Id(main),[],ArrayTypePointer(IntType),Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,316)) def test_function_void_type_array(self): input = """void main() {}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,317)) def test_program_multi_function(self): input = """int[] main() {} float[] pow() {}""" expect = "Program([FuncDecl(Id(main),[],ArrayTypePointer(IntType),Block([])),FuncDecl(Id(pow),[],ArrayTypePointer(FloatType),Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,318)) def test_program_multi_function_variable(self): input = """int[] main() {} float[] pow() {} int a,b,c;""" expect = "Program([FuncDecl(Id(main),[],ArrayTypePointer(IntType),Block([])),FuncDecl(Id(pow),[],ArrayTypePointer(FloatType),Block([])),VarDecl(a,IntType),VarDecl(b,IntType),VarDecl(c,IntType)])" self.assertTrue(TestAST.checkASTGen(input,expect,319)) def test_program_multi_function_array(self): input = """int[] main() {} float[] pow() {} int a[5],b[5],c[5];""" expect = "Program([FuncDecl(Id(main),[],ArrayTypePointer(IntType),Block([])),FuncDecl(Id(pow),[],ArrayTypePointer(FloatType),Block([])),VarDecl(a,ArrayType(IntType,5)),VarDecl(b,ArrayType(IntType,5)),VarDecl(c,ArrayType(IntType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,320)) # Test if statement def test_if_stmt_base(self): input = """void main() {if(true) print("hello");}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([If(BooleanLiteral(true),CallExpr(Id(print),[StringLiteral(hello)]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,321)) def test_if__else_stmt_base(self): input = """void main() {if(true) print("hello"); else put(5);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([If(BooleanLiteral(true),CallExpr(Id(print),[StringLiteral(hello)]),CallExpr(Id(put),[IntLiteral(5)]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,322)) def test_if_stmt_hard(self): input = """void main() {if(true) { print("hello"); int a; a = a + 100; a = a || 100; } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([If(BooleanLiteral(true),Block([CallExpr(Id(print),[StringLiteral(hello)]),VarDecl(a,IntType),BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(100))),BinaryOp(=,Id(a),BinaryOp(||,Id(a),IntLiteral(100)))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,323)) def test_if_else_stmt_hard(self): input = """void main() {if(a && b || c) print("hello"); else put(5);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([If(BinaryOp(||,BinaryOp(&&,Id(a),Id(b)),Id(c)),CallExpr(Id(print),[StringLiteral(hello)]),CallExpr(Id(put),[IntLiteral(5)]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,324)) def test_if_else_stmt_mix(self): input = """void main() { if(a && b || c) { print("hello"); int a[5]; string b[10]; } else { HPC(kafka); } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([If(BinaryOp(||,BinaryOp(&&,Id(a),Id(b)),Id(c)),Block([CallExpr(Id(print),[StringLiteral(hello)]),VarDecl(a,ArrayType(IntType,5)),VarDecl(b,ArrayType(StringType,10))]),Block([CallExpr(Id(HPC),[Id(kafka)])]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,325)) # Test do while statement def test_do_while_base(self): input = """void main() {do print(); while(a==1);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([Dowhile([CallExpr(Id(print),[])],BinaryOp(==,Id(a),IntLiteral(1)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,326)) def test_do_while_medium(self): input = """void main() {do {int a[5]; print();} while(a==1&&2);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([Dowhile([Block([VarDecl(a,ArrayType(IntType,5)),CallExpr(Id(print),[])])],BinaryOp(&&,BinaryOp(==,Id(a),IntLiteral(1)),IntLiteral(2)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,327)) def test_do_while_hard(self): input = """void main() {do {if(true) print();} while(func(a[5]));}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([Dowhile([Block([If(BooleanLiteral(true),CallExpr(Id(print),[]))])],CallExpr(Id(func),[ArrayCell(Id(a),IntLiteral(5))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,328)) # Test for statemet def test_for_base(self): input = """void main() {for(i=0;i<10;i=i+1) print();}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(i),IntLiteral(0));BinaryOp(<,Id(i),IntLiteral(10));BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1)));CallExpr(Id(print),[]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,329)) def test_for_medium(self): input = """void main() {for(i=0;i && 1;i=i+1) {print();}}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(i),IntLiteral(0));BinaryOp(&&,Id(i),IntLiteral(1));BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1)));Block([CallExpr(Id(print),[])]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,330)) def test_for_hard(self): input = """void main() {for(i = 1+a[6];a[i]>=(2/5);i = 10/i) print();}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(i),BinaryOp(+,IntLiteral(1),ArrayCell(Id(a),IntLiteral(6))));BinaryOp(>=,ArrayCell(Id(a),Id(i)),BinaryOp(/,IntLiteral(2),IntLiteral(5)));BinaryOp(=,Id(i),BinaryOp(/,IntLiteral(10),Id(i)));CallExpr(Id(print),[]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,331)) # Test break and continue def test_break(self): input = """void main() {for(i = 1+a[6];a[i]>=(2/5);i = 10/i) break;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(i),BinaryOp(+,IntLiteral(1),ArrayCell(Id(a),IntLiteral(6))));BinaryOp(>=,ArrayCell(Id(a),Id(i)),BinaryOp(/,IntLiteral(2),IntLiteral(5)));BinaryOp(=,Id(i),BinaryOp(/,IntLiteral(10),Id(i)));Break())]))])" self.assertTrue(TestAST.checkASTGen(input,expect,332)) def test_continue(self): input = """void main() {for(i = 1+a[6];a[i]>=(2/5);i = 10/i) continue;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(i),BinaryOp(+,IntLiteral(1),ArrayCell(Id(a),IntLiteral(6))));BinaryOp(>=,ArrayCell(Id(a),Id(i)),BinaryOp(/,IntLiteral(2),IntLiteral(5)));BinaryOp(=,Id(i),BinaryOp(/,IntLiteral(10),Id(i)));Continue())]))])" self.assertTrue(TestAST.checkASTGen(input,expect,333)) def test_assign(self): input = """void main() {a = 5;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),IntLiteral(5))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,334)) def test_or(self): input = """void main() {a = a || 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(||,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,335)) def test_and(self): input = """void main() {a = a && 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(&&,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,336)) def test_equal(self): input = """void main() {a = a == 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(==,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,337)) def test_not_equal(self): input = """void main() {a = a != 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(!=,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,338)) def test_less_than(self): input = """void main() {a = a < 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(<,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,339)) def test_less_equal(self): input = """void main() {a = a <= 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(<=,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,340)) def test_great_than(self): input = """void main() {a = a > 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(>,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,341)) def test_great_equal(self): input = """void main() {a = a >= 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(>=,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,342)) def test_add(self): input = """void main() {a = a + 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,343)) def test_subtract(self): input = """void main() {a = a - 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(-,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,344)) def test_mul(self): input = """void main() {a = a * 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(*,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,345)) def test_div(self): input = """void main() {a = a / 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(/,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,346)) def test_mod(self): input = """void main() {a = a % 0;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),BinaryOp(%,Id(a),IntLiteral(0)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,347)) def test_not(self): input = """void main() {a = !a;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),UnaryOp(!,Id(a)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,348)) def test_sub(self): input = """void main() {a = -a;}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(a),UnaryOp(-,Id(a)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,349)) # Test array cell def test_array_cell_base(self): input = """void main() {a[5];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(Id(a),IntLiteral(5))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,350)) def test_array_cell_medium(self): input = """void main() {a[5+x];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(Id(a),BinaryOp(+,IntLiteral(5),Id(x)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,351)) def test_array_cell_hard(self): input = """void main() {a[pow(2,3)];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(Id(a),CallExpr(Id(pow),[IntLiteral(2),IntLiteral(3)]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,352)) def test_array_cell_expr_base(self): input = """void main() {(5+x)[a];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(BinaryOp(+,IntLiteral(5),Id(x)),Id(a))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,353)) def test_array_cell_expr_medium(self): input = """void main() {foo()[5];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(CallExpr(Id(foo),[]),IntLiteral(5))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,354)) # TODO : Find bug ! def test_array_cell_expr_hard(self): input = """void main() {(foo()[5])[5];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(ArrayCell(CallExpr(Id(foo),[]),IntLiteral(5)),IntLiteral(5))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,355)) def test_array_cell_expr_super_hard(self): input = """void main() {foo(foo(foo(foo()[5])[5])[5])[5];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(CallExpr(Id(foo),[ArrayCell(CallExpr(Id(foo),[ArrayCell(CallExpr(Id(foo),[ArrayCell(CallExpr(Id(foo),[]),IntLiteral(5))]),IntLiteral(5))]),IntLiteral(5))]),IntLiteral(5))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,356)) def test_cal_func_base(self): input = """void main() {foo();}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([CallExpr(Id(foo),[])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,357)) def test_cal_func_single_variable(self): input = """void main() {foo(a);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([CallExpr(Id(foo),[Id(a)])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,358)) def test_cal_func_single_array(self): input = """void main() {foo(a[5]);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([CallExpr(Id(foo),[ArrayCell(Id(a),IntLiteral(5))])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,359)) def test_cal_func_multi_variable(self): input = """void main() {foo(a, b, c);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([CallExpr(Id(foo),[Id(a),Id(b),Id(c)])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,360)) def test_cal_func_multi_array(self): input = """void main() {a[5]; b[5];}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([ArrayCell(Id(a),IntLiteral(5)),ArrayCell(Id(b),IntLiteral(5))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,361)) def test_cal_func_multi_variable_array(self): input = """void main() {foo(a, b[6], c);}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([CallExpr(Id(foo),[Id(a),ArrayCell(Id(b),IntLiteral(6)),Id(c)])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,362)) # # Test program with multi function declaration def test_multi_function_declaration(self): input = """void main() {} void main() {} void main() {}""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([])),FuncDecl(Id(main),[],VoidType,Block([])),FuncDecl(Id(main),[],VoidType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,363)) def test_multi_function_variable_declaration(self): input = """void main() {} int a; void main() {} float a[5];""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([])),VarDecl(a,IntType),FuncDecl(Id(main),[],VoidType,Block([])),VarDecl(a,ArrayType(FloatType,5))])" self.assertTrue(TestAST.checkASTGen(input,expect,364)) # Test long program def test_long_program_1(self): input = r"""void main(){ for (a=1;a<10;a=a*2){ for(b=2;b==10;b=b*2){ int a; string b; b = a + 1; } } for(d=1;d!=1;d=d+1){ int e; e = d; } for(c=100;c!=0;c=c%2){ for(d=1000;d>0;d=d%10){ int e; e = d; string d; d = e; } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(<,Id(a),IntLiteral(10));BinaryOp(=,Id(a),BinaryOp(*,Id(a),IntLiteral(2)));Block([For(BinaryOp(=,Id(b),IntLiteral(2));BinaryOp(==,Id(b),IntLiteral(10));BinaryOp(=,Id(b),BinaryOp(*,Id(b),IntLiteral(2)));Block([VarDecl(a,IntType),VarDecl(b,StringType),BinaryOp(=,Id(b),BinaryOp(+,Id(a),IntLiteral(1)))]))])),For(BinaryOp(=,Id(d),IntLiteral(1));BinaryOp(!=,Id(d),IntLiteral(1));BinaryOp(=,Id(d),BinaryOp(+,Id(d),IntLiteral(1)));Block([VarDecl(e,IntType),BinaryOp(=,Id(e),Id(d))])),For(BinaryOp(=,Id(c),IntLiteral(100));BinaryOp(!=,Id(c),IntLiteral(0));BinaryOp(=,Id(c),BinaryOp(%,Id(c),IntLiteral(2)));Block([For(BinaryOp(=,Id(d),IntLiteral(1000));BinaryOp(>,Id(d),IntLiteral(0));BinaryOp(=,Id(d),BinaryOp(%,Id(d),IntLiteral(10)));Block([VarDecl(e,IntType),BinaryOp(=,Id(e),Id(d)),VarDecl(d,StringType),BinaryOp(=,Id(d),Id(e))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,365)) def test_long_program_2(self): input = r"""void main(){ for (a=1;a<10;a=a*2){ for(b=2;b==10;b=b*2){ for(c=100;c!=0;c=c%2){ for(d=1000;d>0;d=d%10){ int e; e = d; string d; d = e; } } } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(<,Id(a),IntLiteral(10));BinaryOp(=,Id(a),BinaryOp(*,Id(a),IntLiteral(2)));Block([For(BinaryOp(=,Id(b),IntLiteral(2));BinaryOp(==,Id(b),IntLiteral(10));BinaryOp(=,Id(b),BinaryOp(*,Id(b),IntLiteral(2)));Block([For(BinaryOp(=,Id(c),IntLiteral(100));BinaryOp(!=,Id(c),IntLiteral(0));BinaryOp(=,Id(c),BinaryOp(%,Id(c),IntLiteral(2)));Block([For(BinaryOp(=,Id(d),IntLiteral(1000));BinaryOp(>,Id(d),IntLiteral(0));BinaryOp(=,Id(d),BinaryOp(%,Id(d),IntLiteral(10)));Block([VarDecl(e,IntType),BinaryOp(=,Id(e),Id(d)),VarDecl(d,StringType),BinaryOp(=,Id(d),Id(e))]))]))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,366)) def test_long_program_3(self): input = r"""void main(){ int a,b,c; for (a=1;a<100;a=a+1){ for(b=1;b<10;b=b+1){ for(c=1;c<50;c=c+1){ if (c){ string rlt; rlt = c; } } } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),VarDecl(b,IntType),VarDecl(c,IntType),For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(<,Id(a),IntLiteral(100));BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(1)));Block([For(BinaryOp(=,Id(b),IntLiteral(1));BinaryOp(<,Id(b),IntLiteral(10));BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(1)));Block([For(BinaryOp(=,Id(c),IntLiteral(1));BinaryOp(<,Id(c),IntLiteral(50));BinaryOp(=,Id(c),BinaryOp(+,Id(c),IntLiteral(1)));Block([If(Id(c),Block([VarDecl(rlt,StringType),BinaryOp(=,Id(rlt),Id(c))]))]))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,367)) def test_long_program_4(self): input = r"""void main(){ int a; float b; string c; for (a=1; a % 10 == 0; a=a+1){ if (a % 2 == 0){ for (b=0; b != 1;b=b+2){ int a; float b; b = a; for (b=1;b==10;b=b+1){ string c; c = b; if (c){ float a; string d; d = c; } } } } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),VarDecl(b,FloatType),VarDecl(c,StringType),For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(==,BinaryOp(%,Id(a),IntLiteral(10)),IntLiteral(0));BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(1)));Block([If(BinaryOp(==,BinaryOp(%,Id(a),IntLiteral(2)),IntLiteral(0)),Block([For(BinaryOp(=,Id(b),IntLiteral(0));BinaryOp(!=,Id(b),IntLiteral(1));BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(2)));Block([VarDecl(a,IntType),VarDecl(b,FloatType),BinaryOp(=,Id(b),Id(a)),For(BinaryOp(=,Id(b),IntLiteral(1));BinaryOp(==,Id(b),IntLiteral(10));BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(1)));Block([VarDecl(c,StringType),BinaryOp(=,Id(c),Id(b)),If(Id(c),Block([VarDecl(a,FloatType),VarDecl(d,StringType),BinaryOp(=,Id(d),Id(c))]))]))]))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,368)) def test_long_program_5(self): input = r"""void main(){ int a; float b; string c; for (a=1; a % 10 == 0; a=a+1){ if (a % 2 == 0){ for (b=0; b != 1;b=b+2){ int a; float b; b = a; } } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),VarDecl(b,FloatType),VarDecl(c,StringType),For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(==,BinaryOp(%,Id(a),IntLiteral(10)),IntLiteral(0));BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(1)));Block([If(BinaryOp(==,BinaryOp(%,Id(a),IntLiteral(2)),IntLiteral(0)),Block([For(BinaryOp(=,Id(b),IntLiteral(0));BinaryOp(!=,Id(b),IntLiteral(1));BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(2)));Block([VarDecl(a,IntType),VarDecl(b,FloatType),BinaryOp(=,Id(b),Id(a))]))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,369)) def test_long_program_6(self): input = r"""void main(){ for (a=1;a<10;a=a+1){ for(b=2;b%10==0;b=b+1){ int c; float d; c = b; d = a; } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(<,Id(a),IntLiteral(10));BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(1)));Block([For(BinaryOp(=,Id(b),IntLiteral(2));BinaryOp(==,BinaryOp(%,Id(b),IntLiteral(10)),IntLiteral(0));BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(1)));Block([VarDecl(c,IntType),VarDecl(d,FloatType),BinaryOp(=,Id(c),Id(b)),BinaryOp(=,Id(d),Id(a))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,370)) def test_long_program_7(self): input = r"""void main(){ int a; int b; boolean c; for (a=1; a < 10; a=a+1){ for (b=0; b != 10; b=b+1){ c = b; } b = a + 1; } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),VarDecl(b,IntType),VarDecl(c,BoolType),For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(<,Id(a),IntLiteral(10));BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(1)));Block([For(BinaryOp(=,Id(b),IntLiteral(0));BinaryOp(!=,Id(b),IntLiteral(10));BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(1)));Block([BinaryOp(=,Id(c),Id(b))])),BinaryOp(=,Id(b),BinaryOp(+,Id(a),IntLiteral(1)))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,371)) def test_long_program_8(self): input = r"""void main(){ int a; int b; boolean c; for (a=1; a < 10; a=a+1){ if (a % 2 == 0){ c = false; b = b + 1; } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),VarDecl(b,IntType),VarDecl(c,BoolType),For(BinaryOp(=,Id(a),IntLiteral(1));BinaryOp(<,Id(a),IntLiteral(10));BinaryOp(=,Id(a),BinaryOp(+,Id(a),IntLiteral(1)));Block([If(BinaryOp(==,BinaryOp(%,Id(a),IntLiteral(2)),IntLiteral(0)),Block([BinaryOp(=,Id(c),BooleanLiteral(false)),BinaryOp(=,Id(b),BinaryOp(+,Id(b),IntLiteral(1)))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,372)) def test_long_program_9(self): input = r"""void main(){ int a; a = true; if (true){ if (a == true){ if (!a){ a = false; string b; b = a; if (b){ boolean c; c = b; if (!c){ int d; d = c; if (d == c || !c){ string e; e = d; } else{ string e; e = d; } } else{ int d; d = e; boolean t; t = e; if (d && !e){ string t; t = d; } } } } else{ if ((a == b || c != b) && a > b){ int e; e = a; } } } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),BinaryOp(=,Id(a),BooleanLiteral(true)),If(BooleanLiteral(true),Block([If(BinaryOp(==,Id(a),BooleanLiteral(true)),Block([If(UnaryOp(!,Id(a)),Block([BinaryOp(=,Id(a),BooleanLiteral(false)),VarDecl(b,StringType),BinaryOp(=,Id(b),Id(a)),If(Id(b),Block([VarDecl(c,BoolType),BinaryOp(=,Id(c),Id(b)),If(UnaryOp(!,Id(c)),Block([VarDecl(d,IntType),BinaryOp(=,Id(d),Id(c)),If(BinaryOp(||,BinaryOp(==,Id(d),Id(c)),UnaryOp(!,Id(c))),Block([VarDecl(e,StringType),BinaryOp(=,Id(e),Id(d))]),Block([VarDecl(e,StringType),BinaryOp(=,Id(e),Id(d))]))]),Block([VarDecl(d,IntType),BinaryOp(=,Id(d),Id(e)),VarDecl(t,BoolType),BinaryOp(=,Id(t),Id(e)),If(BinaryOp(&&,Id(d),UnaryOp(!,Id(e))),Block([VarDecl(t,StringType),BinaryOp(=,Id(t),Id(d))]))]))]))]),Block([If(BinaryOp(&&,BinaryOp(||,BinaryOp(==,Id(a),Id(b)),BinaryOp(!=,Id(c),Id(b))),BinaryOp(>,Id(a),Id(b))),Block([VarDecl(e,IntType),BinaryOp(=,Id(e),Id(a))]))]))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,373)) def test_long_program_10(self): input = r"""void main(){ int a; a = true; if (true){ if (a == true){ if (!a){ a = false; string b; b = a; } else{ string b; b = a; } } else{ a = false; } } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(a,IntType),BinaryOp(=,Id(a),BooleanLiteral(true)),If(BooleanLiteral(true),Block([If(BinaryOp(==,Id(a),BooleanLiteral(true)),Block([If(UnaryOp(!,Id(a)),Block([BinaryOp(=,Id(a),BooleanLiteral(false)),VarDecl(b,StringType),BinaryOp(=,Id(b),Id(a))]),Block([VarDecl(b,StringType),BinaryOp(=,Id(b),Id(a))]))]),Block([BinaryOp(=,Id(a),BooleanLiteral(false))]))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,374)) def test_more_simple_program(self): """More complex program""" input = """int main () { putIntLn(4); }""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([CallExpr(Id(putIntLn),[IntLiteral(4)])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,375)) def test_call_without_parameter(self): """More complex program""" input = """int main () { getIntLn(); }""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([CallExpr(Id(getIntLn),[])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,376)) def test_true_and_false(self): input = """void f(int a,float b, float c){ true && false || (2 > 3/5); }""" expect = "Program([FuncDecl(Id(f),[VarDecl(a,IntType),VarDecl(b,FloatType),VarDecl(c,FloatType)],VoidType,Block([BinaryOp(||,BinaryOp(&&,BooleanLiteral(true),BooleanLiteral(false)),BinaryOp(>,IntLiteral(2),BinaryOp(/,IntLiteral(3),IntLiteral(5))))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,377)) def test_more_call_function(self): input = """int main () { putIntLn(4); ar[12]; foo(a[10],r); break;continue; }""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([CallExpr(Id(putIntLn),[IntLiteral(4)]),ArrayCell(Id(ar),IntLiteral(12)),CallExpr(Id(foo),[ArrayCell(Id(a),IntLiteral(10)),Id(r)]),Break(),Continue()]))])" self.assertTrue(TestAST.checkASTGen(input,expect,378)) def test_if_and_have_not_semiconlon(self): input = """int main () { if( (c > x) < d){ int a,b; } }""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([If(BinaryOp(<,BinaryOp(>,Id(c),Id(x)),Id(d)),Block([VarDecl(a,IntType),VarDecl(b,IntType)]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,379)) def test_if_in_if(self): input = """int foo () { if (a+1) {{{{if(b+a) foo();}}}} else {if (c+d) t+a; else func(a(b(c)))[f+6*d()];} }""" expect = "Program([FuncDecl(Id(foo),[],IntType,Block([If(BinaryOp(+,Id(a),IntLiteral(1)),Block([Block([Block([Block([If(BinaryOp(+,Id(b),Id(a)),CallExpr(Id(foo),[]))])])])]),Block([If(BinaryOp(+,Id(c),Id(d)),BinaryOp(+,Id(t),Id(a)),ArrayCell(CallExpr(Id(func),[CallExpr(Id(a),[CallExpr(Id(b),[Id(c)])])]),BinaryOp(+,Id(f),BinaryOp(*,IntLiteral(6),CallExpr(Id(d),[])))))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,380)) def test_array_type_and_invol(self): input = """int[] ham(int a[], float b[]) { return; }""" expect = "Program([FuncDecl(Id(ham),[VarDecl(a,ArrayTypePointer(IntType)),VarDecl(b,ArrayTypePointer(FloatType))],ArrayTypePointer(IntType),Block([Return()]))])" self.assertTrue(TestAST.checkASTGen(input,expect,381)) def test_do_while(self): input = """void fo() { do{ f(foo(fr(aaa(e(r()))))); } while a>d; }""" expect = "Program([FuncDecl(Id(fo),[],VoidType,Block([Dowhile([Block([CallExpr(Id(f),[CallExpr(Id(foo),[CallExpr(Id(fr),[CallExpr(Id(aaa),[CallExpr(Id(e),[CallExpr(Id(r),[])])])])])])])],BinaryOp(>,Id(a),Id(d)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,382)) def test_bool_in_do(self): input = """int main () { do{ true;} while d>a; }""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([Dowhile([Block([BooleanLiteral(true)])],BinaryOp(>,Id(d),Id(a)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,383)) def test_if_in_do_while(self): input = """float d () { do if (a==s) {if (t>a) if (d>=e) if (a<y) if (r<=o) {x+1;}} while foo(); }""" expect = "Program([FuncDecl(Id(d),[],FloatType,Block([Dowhile([If(BinaryOp(==,Id(a),Id(s)),Block([If(BinaryOp(>,Id(t),Id(a)),If(BinaryOp(>=,Id(d),Id(e)),If(BinaryOp(<,Id(a),Id(y)),If(BinaryOp(<=,Id(r),Id(o)),Block([BinaryOp(+,Id(x),IntLiteral(1))])))))]))],CallExpr(Id(foo),[]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,384)) def test_func_decl_for_if(self): input = """int foo(int a){ for(i = 0;i!= 100; i=i+1){ if(i%2==0) i=i*2; else i = i -1; } }""" expect = "Program([FuncDecl(Id(foo),[VarDecl(a,IntType)],IntType,Block([For(BinaryOp(=,Id(i),IntLiteral(0));BinaryOp(!=,Id(i),IntLiteral(100));BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1)));Block([If(BinaryOp(==,BinaryOp(%,Id(i),IntLiteral(2)),IntLiteral(0)),BinaryOp(=,Id(i),BinaryOp(*,Id(i),IntLiteral(2))),BinaryOp(=,Id(i),BinaryOp(-,Id(i),IntLiteral(1))))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,385)) def test_func_decl_if_var(self): input = """int main() { if(true) a=10; }""" expect = "Program([FuncDecl(Id(main),[],IntType,Block([If(BooleanLiteral(true),BinaryOp(=,Id(a),IntLiteral(10)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,386)) def test_var_many_decl(self): input = """int a; float b,c,d[3]; boolean e; string s; """ expect = "Program([VarDecl(a,IntType),VarDecl(b,FloatType),VarDecl(c,FloatType),VarDecl(d,ArrayType(FloatType,3)),VarDecl(e,BoolType),VarDecl(s,StringType)])" self.assertTrue(TestAST.checkASTGen(input,expect,387)) def test_func_println(self): input = """void b(int a[],int b){ int a;a=1;println(a); { int b;b=1; println(b); } }""" expect = "Program([FuncDecl(Id(b),[VarDecl(a,ArrayTypePointer(IntType)),VarDecl(b,IntType)],VoidType,Block([VarDecl(a,IntType),BinaryOp(=,Id(a),IntLiteral(1)),CallExpr(Id(println),[Id(a)]),Block([VarDecl(b,IntType),BinaryOp(=,Id(b),IntLiteral(1)),CallExpr(Id(println),[Id(b)])])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,388)) def test_func_empty(self): input = """void Calculate(){}""" expect = "Program([FuncDecl(Id(Calculate),[],VoidType,Block([]))])" self.assertTrue(TestAST.checkASTGen(input,expect,389)) def test_func_decl_foo(self): input = """void foo(){ boolean b ; b = true; if( !b == false) println(" b is true"); }""" expect = "Program([FuncDecl(Id(foo),[],VoidType,Block([VarDecl(b,BoolType),BinaryOp(=,Id(b),BooleanLiteral(true)),If(BinaryOp(==,UnaryOp(!,Id(b)),BooleanLiteral(false)),CallExpr(Id(println),[StringLiteral( b is true)]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,390)) def test_func_many_func(self): input = """ void main(){ int oddSum, evenSum,arr[10],i; oddSum = evenSum =0; for(i=0;i<10;i=i+1) arr[i]=i; for(i=0;i<10;i=i+1){ if(arr[i]%2==0) evenSum = evenSum + arr[i]; else oddSum = oddSum + arr[i]; } }""" expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(oddSum,IntType),VarDecl(evenSum,IntType),VarDecl(arr,ArrayType(IntType,10)),VarDecl(i,IntType),BinaryOp(=,Id(oddSum),BinaryOp(=,Id(evenSum),IntLiteral(0))),For(BinaryOp(=,Id(i),IntLiteral(0));BinaryOp(<,Id(i),IntLiteral(10));BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1)));BinaryOp(=,ArrayCell(Id(arr),Id(i)),Id(i))),For(BinaryOp(=,Id(i),IntLiteral(0));BinaryOp(<,Id(i),IntLiteral(10));BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1)));Block([If(BinaryOp(==,BinaryOp(%,ArrayCell(Id(arr),Id(i)),IntLiteral(2)),IntLiteral(0)),BinaryOp(=,Id(evenSum),BinaryOp(+,Id(evenSum),ArrayCell(Id(arr),Id(i)))),BinaryOp(=,Id(oddSum),BinaryOp(+,Id(oddSum),ArrayCell(Id(arr),Id(i)))))]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,391)) def test_func_switch_case(self): input = """ void main(){ int mark; } void result(int mark){ if(mark<5) println("Trung binh"); else if (5<=mark&&mark<8) println("Kha"); else println("Gioi"); } """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(mark,IntType)])),FuncDecl(Id(result),[VarDecl(mark,IntType)],VoidType,Block([If(BinaryOp(<,Id(mark),IntLiteral(5)),CallExpr(Id(println),[StringLiteral(Trung binh)]),If(BinaryOp(&&,BinaryOp(<=,IntLiteral(5),Id(mark)),BinaryOp(<,Id(mark),IntLiteral(8))),CallExpr(Id(println),[StringLiteral(Kha)]),CallExpr(Id(println),[StringLiteral(Gioi)])))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,392)) def test_func_break_continue(self): input = """ void main(){ int i; for(i=0;i<10;i=i+1) { println(i); if(i == 5) continue; if(i==9) break; } } """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(i,IntType),For(BinaryOp(=,Id(i),IntLiteral(0));BinaryOp(<,Id(i),IntLiteral(10));BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1)));Block([CallExpr(Id(println),[Id(i)]),If(BinaryOp(==,Id(i),IntLiteral(5)),Continue()),If(BinaryOp(==,Id(i),IntLiteral(9)),Break())]))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,393)) def test_func_do_while(self): input = """ void main(){ int i; i = 0; do println(i); i=i+1; if(i==9) break; while(i<10); } """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([VarDecl(i,IntType),BinaryOp(=,Id(i),IntLiteral(0)),Dowhile([CallExpr(Id(println),[Id(i)]),BinaryOp(=,Id(i),BinaryOp(+,Id(i),IntLiteral(1))),If(BinaryOp(==,Id(i),IntLiteral(9)),Break())],BinaryOp(<,Id(i),IntLiteral(10)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,394)) def test_maximum_recursion(self): input = """ void main() {n = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((n))))))))))))))))))))))))))))))))))))))))))))))))/2))))))))));} """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(n),BinaryOp(/,Id(n),IntLiteral(2)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,395)) def test_easy_recursion(self): input = """ void main() {n = ((((((n))/2))));} """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([BinaryOp(=,Id(n),BinaryOp(/,Id(n),IntLiteral(2)))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,396)) def test_func_recursion(self): input = """ void main() {print();{print();}{print();}{print();}{print();}{print();}{print();}{print();}{print();}{print();}} """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([CallExpr(Id(print),[]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])]),Block([CallExpr(Id(print),[])])]))])" self.assertTrue(TestAST.checkASTGen(input,expect,397)) def test_for_recursion(self): input = """ void main() {for(1;1;1) for(1;1;1) for(1;1;1) for(1;1;1) for(1;1;1) for(1;1;1) for(1;1;1) for(1;1;1) print();} """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);For(IntLiteral(1);IntLiteral(1);IntLiteral(1);CallExpr(Id(print),[])))))))))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,398)) def test_do_while_recursion(self): input = """ void main() {do do do do do do print(); while true; while true; while true; while true; while true; while true;} """ expect = "Program([FuncDecl(Id(main),[],VoidType,Block([Dowhile([Dowhile([Dowhile([Dowhile([Dowhile([Dowhile([CallExpr(Id(print),[])],BooleanLiteral(true))],BooleanLiteral(true))],BooleanLiteral(true))],BooleanLiteral(true))],BooleanLiteral(true))],BooleanLiteral(true))]))])" self.assertTrue(TestAST.checkASTGen(input,expect,399))
59.126615
991
0.558976
5,617
45,764
4.502225
0.04789
0.096089
0.08304
0.126537
0.81747
0.740361
0.687374
0.624184
0.527344
0.481158
0
0.024258
0.220829
45,764
774
992
59.126615
0.684951
0.007648
0
0.256151
0
0.143271
0.677278
0.449573
0
0
0
0.001292
0.144718
1
0.144718
false
0
0.004342
0
0.150507
0.060781
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2597d104fd536046cfa0f78ca2aa1bd236dccb01
112
py
Python
arclet/alconna/__main__.py
SocialSisterYi/Alconna
3e1d986ca5486dfd3c7bd80118a75364ab6831b8
[ "MIT" ]
null
null
null
arclet/alconna/__main__.py
SocialSisterYi/Alconna
3e1d986ca5486dfd3c7bd80118a75364ab6831b8
[ "MIT" ]
null
null
null
arclet/alconna/__main__.py
SocialSisterYi/Alconna
3e1d986ca5486dfd3c7bd80118a75364ab6831b8
[ "MIT" ]
null
null
null
"""Alconna 命令行入口""" from arclet.alconna.builtin.commandline import main if __name__ == "__main__": main()
16
51
0.705357
13
112
5.461538
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.151786
112
6
52
18.666667
0.747368
0.116071
0
0
0
0
0.086022
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
25c627add607a62bf9d3af224d727b8fbf9cabb3
337
py
Python
mongosql/util/__init__.py
vdmit11/py-mongosql
8b66a3386344cf5b38021dccf32c7790a07617e5
[ "BSD-2-Clause" ]
null
null
null
mongosql/util/__init__.py
vdmit11/py-mongosql
8b66a3386344cf5b38021dccf32c7790a07617e5
[ "BSD-2-Clause" ]
null
null
null
mongosql/util/__init__.py
vdmit11/py-mongosql
8b66a3386344cf5b38021dccf32c7790a07617e5
[ "BSD-2-Clause" ]
null
null
null
from .raiseload_col import raiseload_col from .selectinquery import selectinquery from .counting_query_wrapper import CountingQuery from .reusable import Reusable from .mongoquery_settings_handler import MongoQuerySettingsHandler from .marker import Marker from .settings_dict import MongoQuerySettingsDict, StrictCrudHelperSettingsDict
42.125
79
0.890208
36
337
8.138889
0.5
0.081911
0
0
0
0
0
0
0
0
0
0
0.086053
337
7
80
48.142857
0.951299
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
25d13fa91e8a27a8e3e83ce1553d500555f00fd0
99
py
Python
src/boat/reservierung/apps.py
holytortoise/boat_project
b318cc46034c8e87cfa2db29fda7b6ea08a7745a
[ "MIT" ]
null
null
null
src/boat/reservierung/apps.py
holytortoise/boat_project
b318cc46034c8e87cfa2db29fda7b6ea08a7745a
[ "MIT" ]
null
null
null
src/boat/reservierung/apps.py
holytortoise/boat_project
b318cc46034c8e87cfa2db29fda7b6ea08a7745a
[ "MIT" ]
null
null
null
from django.apps import AppConfig class ReservierungConfig(AppConfig): name = 'reservierung'
16.5
36
0.777778
10
99
7.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.151515
99
5
37
19.8
0.916667
0
0
0
0
0
0.121212
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
25f048f3da02b6db6d6468726b80f5cf0a8210f8
172
py
Python
tests/simple_test.py
leoauri/auraloss
0e3362674ae1b53aa61c6a631fb4e6970c5683c1
[ "Apache-2.0" ]
272
2020-11-16T05:07:17.000Z
2022-03-27T11:54:16.000Z
tests/simple_test.py
leoauri/auraloss
0e3362674ae1b53aa61c6a631fb4e6970c5683c1
[ "Apache-2.0" ]
14
2020-11-20T03:16:14.000Z
2021-12-01T17:50:41.000Z
tests/simple_test.py
leoauri/auraloss
0e3362674ae1b53aa61c6a631fb4e6970c5683c1
[ "Apache-2.0" ]
32
2020-11-16T23:36:45.000Z
2022-02-18T04:48:24.000Z
import torch import auraloss input = torch.rand(8, 2, 44100) target = torch.rand(8, 2, 44100) loss = auraloss.freq.SumAndDifferenceSTFTLoss() print(loss(input, target))
17.2
47
0.744186
24
172
5.333333
0.541667
0.140625
0.15625
0.171875
0.25
0
0
0
0
0
0
0.093333
0.127907
172
9
48
19.111111
0.76
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.166667
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
d30c75900993a0da1695f71222f8a200a1c99170
52
py
Python
tests/__init__.py
frenck/python-ambee
0a03b66d2fd4aca789a44874365bf85ac3469b23
[ "MIT" ]
6
2021-06-08T19:27:01.000Z
2022-02-11T00:28:11.000Z
tests/__init__.py
frenck/python-ambee
0a03b66d2fd4aca789a44874365bf85ac3469b23
[ "MIT" ]
200
2021-06-08T19:54:54.000Z
2022-03-30T08:15:20.000Z
tests/__init__.py
frenck/python-ambee
0a03b66d2fd4aca789a44874365bf85ac3469b23
[ "MIT" ]
4
2021-06-14T18:04:06.000Z
2022-02-11T00:28:14.000Z
"""Asynchronous Python client for the Ambee API."""
26
51
0.730769
7
52
5.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.134615
52
1
52
52
0.844444
0.865385
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
d310ad4131bb13a49700299f40080306d0be5ffa
267
py
Python
KanoTerminator.py
JJFReibel/KanoTerminator
2de8b310fcf39b270d0d65dfb18c26ed8b2b621b
[ "MIT" ]
null
null
null
KanoTerminator.py
JJFReibel/KanoTerminator
2de8b310fcf39b270d0d65dfb18c26ed8b2b621b
[ "MIT" ]
null
null
null
KanoTerminator.py
JJFReibel/KanoTerminator
2de8b310fcf39b270d0d65dfb18c26ed8b2b621b
[ "MIT" ]
null
null
null
# Kano or Terminator # By Jean-Jacques F. Reibel # I will not be held responsible for: # any shenanigans import os # ಠ_ಠ # ¯¯\_(ツ)_/¯¯ # (╭ರ_•́) os.system("printf '\e[0;35;1;1m (╭ರ_'") os.system("printf '\e[0;31;1;5m°'") os.system("printf '\e[0;35;1;1m)\n'")
20.538462
46
0.599251
57
267
2.877193
0.631579
0.146341
0.256098
0.27439
0.353659
0.256098
0.256098
0.256098
0
0
0
0.066964
0.161049
267
12
47
22.25
0.625
0.449438
0
0
0
0
0.568345
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0.75
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
0
0
0
1
0
4
d330b0abc9b07d9ac27539db5194ff38a79da742
73
py
Python
python/__init__.py
SpM-lab/irbasis
5beb5cbe3c0ba0fb42c32e262f04d1f3359d6045
[ "MIT" ]
17
2018-07-16T15:07:09.000Z
2022-03-26T06:46:55.000Z
python/__init__.py
SpM-lab/irbasis
5beb5cbe3c0ba0fb42c32e262f04d1f3359d6045
[ "MIT" ]
3
2019-09-19T07:12:01.000Z
2020-02-14T11:54:03.000Z
python/__init__.py
SpM-lab/irbasis
5beb5cbe3c0ba0fb42c32e262f04d1f3359d6045
[ "MIT" ]
6
2019-01-28T19:51:50.000Z
2021-08-02T12:57:14.000Z
from .irbasis import load, basis, sampling_points_matsubara, __version__
36.5
72
0.849315
9
73
6.222222
1
0
0
0
0
0
0
0
0
0
0
0
0.09589
73
1
73
73
0.848485
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
d343f65dbd887e6c6ed96fa7058357629d64dfee
28,858
py
Python
projects/tests.py
DoubleCapitals/web-platform-prototype
b17a982d6e5d2231c9bc1127fe9f823ed546f36d
[ "MIT" ]
3
2019-02-27T18:11:11.000Z
2019-03-28T09:42:23.000Z
projects/tests.py
DoubleCapitals/web-platform-prototype
b17a982d6e5d2231c9bc1127fe9f823ed546f36d
[ "MIT" ]
7
2019-02-28T06:29:50.000Z
2019-04-26T05:46:41.000Z
projects/tests.py
DoubleCapitals/web-platform-prototype
b17a982d6e5d2231c9bc1127fe9f823ed546f36d
[ "MIT" ]
5
2019-02-27T17:28:34.000Z
2019-03-01T02:34:44.000Z
from django.test import TestCase, Client from django.urls import reverse from django.test.utils import setup_test_environment from bs4 import BeautifulSoup import re import time from projects.models import * from projects.forms import * client = Client() # length of base template, used to test for empty pages LEN_BASE = 2600 class BaseWebsiteTestCase(TestCase): def setUp(self): super() def test_homepage_load(self): url = reverse("projects:home") response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_homepage_not_empty(self): url = reverse("projects:home") response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) def test_project_list_load(self): url = reverse("projects:projects_list") response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_project_list_not_empty(self): url = reverse("projects:projects_list") response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) def test_project_students_load(self): url = reverse("projects:students") response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_project_students_not_empty(self): url = reverse("projects:students") response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) def test_project_educators_load(self): url = reverse("projects:educators") response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_project_educators_not_empty(self): url = reverse("projects:educators") response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) def test_project_leaders_load(self): url = reverse("projects:leaders") response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_project_leaders_not_empty(self): url = reverse("projects:leaders") response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) VERBOSE = False class TraverseLinksTest(TestCase): def setUp(self): # By default, login as superuser um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD", password="tompassword") self.client = Client() self.superuser = User.objects.get(username="tom") self.client.login(username="tom", password="tompassword") @classmethod def setUpTestData(cls): pm = OpenSUTDProjectManager() um = OpenSUTDUserManager() pm.create_project(project_uid="ACAD_00001", title="OpenSUTD Web Platform", caption="Sample project 1", category="ACAD", url="https://github.com/OpenSUTD/web-platform-prototype", poster_url="https://via.placeholder.com/150", featured_image="https://via.placeholder.com/150") um.create_user("dick", display_name="Dick Tan", display_picture="https://via.placeholder.com/150", graduation_year=2019, pillar="ISTD") um.create_user("jane", display_name="Jane Tan", display_picture="https://via.placeholder.com/150", graduation_year=2021, pillar="ESD") pm.create_project(project_uid="ACAD_00002", title="RandomZZZZZ", caption="Sample project 2", category="ACAD", url="https://github.com/OpenSUTD/web-platform-prototype", poster_url="https://via.placeholder.com/150", featured_image="https://via.placeholder.com/150") pm.set_project_status("ACAD_00001", "ACCEPT") pm.add_user_to_project("ACAD_00001", "dick") pm.add_user_to_project("ACAD_00001", "jane") pm.add_tag_to_project( "ACAD_00001", "rand1,rand2,education,student,policy") pm.add_user_to_project("ACAD_00002", "jane") pm.add_tag_to_project( "ACAD_00002", "rand1,rand2,education,student,policy") def test_traverse_urls(self): # Fill these lists as needed with your site specific URLs to check and to avoid to_traverse_list = ["/", "/projects/", "/students/", "/educators/", "/leaders/"] to_avoid_list = ["javascript:history\.back()", "https://*", "javascript:history\.go\(-1\)", "^mailto:.*"] done_list = [] error_list = [] source_of_link = dict() for link in to_traverse_list: source_of_link[link] = "initial" (to_traverse_list, to_avoid_list, done_list, error_list, source_of_link) = \ self.recurse_into_path( to_traverse_list, to_avoid_list, done_list, error_list, source_of_link) print("END REACHED\nStats:") if VERBOSE: print("\nto_traverse_list = " + str(to_traverse_list)) if VERBOSE: print("\nto_avoid_list = " + str(to_avoid_list)) if VERBOSE: print("\nsource_of_link = " + str(source_of_link)) if VERBOSE: print("\ndone_list = " + str(done_list)) print("Followed " + str(len(done_list)) + " links successfully") print("Avoided " + str(len(to_avoid_list)) + " links") if error_list: print("!! " + str(len(error_list)) + " error(s) : ") for error in error_list: print(str(error) + " found in page " + source_of_link[error[0]]) print("Errors found traversing links") assert False else: print("No errors") def recurse_into_path(self, to_traverse_list, to_avoid_list, done_list, error_list, source_of_link): """ Dives into first item of to_traverse_list Returns: (to_traverse_list, to_avoid_list, done_list, source_of_link) """ if to_traverse_list: url = to_traverse_list.pop() if not match_any(url, to_avoid_list): print("\nSurfing to " + str(url) + ", discovered in " + str(source_of_link[url])) response = self.client.get(url, follow=True) if response.status_code == 200: soup = BeautifulSoup(response.content, "html.parser") text = soup.get_text() for link in soup.find_all("a"): new_link = link.get("href") if VERBOSE: print(" Found link: " + str(new_link)) if match_any(new_link, to_avoid_list): if VERBOSE: print(" Avoiding it") elif new_link in done_list: if VERBOSE: print(" Already done, ignoring") elif new_link in to_traverse_list: if VERBOSE: print(" Already in to traverse list, ignoring") else: if VERBOSE: print( " New, unknown link: Storing it to traverse later") source_of_link[new_link] = url to_traverse_list.append(new_link) done_list.append(url) if VERBOSE: print("Done") else: error_list.append((url, response.status_code)) to_avoid_list.append(url) if VERBOSE: print("Diving into next level") return self.recurse_into_path(to_traverse_list, to_avoid_list, done_list, error_list, source_of_link) else: # Nothing to traverse if VERBOSE: print("Returning to upper level") return to_traverse_list, to_avoid_list, done_list, error_list, source_of_link def match_any(my_string, regexp_list): if my_string: combined = "(" + ")|(".join(regexp_list) + ")" return re.match(combined, my_string) else: # "None" as string always matches return True class SecuredPageTestCase(TestCase): def setUp(self): pm = OpenSUTDProjectManager() pm.create_project(project_uid="ACAD_00001", title="OpenSUTD Web Platform", caption="Sample project 1", category="ACAD", url="https://github.com/OpenSUTD/web-platform-prototype", poster_url="https://via.placeholder.com/150", featured_image="https://via.placeholder.com/150") um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD") def test_auth_approval_view(self): url = reverse("projects:approval") response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_auth_submit_view(self): url = reverse("projects:submit_new") response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_auth_submit_reject(self): url = reverse("projects:reject", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_auth_submit_approve(self): url = reverse("projects:approve", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_auth_user_edit(self): url = reverse("projects:user_edit", args=("tom",)) response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_auth_project_edit(self): url = reverse("projects:project_edit", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 302) def test_auth_project_bypass(self): url = reverse("projects:project_page_bypass", args=("ACAD_00001",)) response = self.client.get(url) # actually a custom 404 page self.assertEqual(response.status_code, 200) class SubmissionFormTest(TestCase): def setUp(self): self.client = Client() um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD", password="tompassword") self.client.login(username="tom", password="tompassword") def test_submission_form_entry(self): response = self.client.get(reverse("projects:submit_new")) self.assertEqual(response.status_code, 200) # test submission mechanism form = SubmissionForm({"project_name": "test", "caption": "test caption", "category": "ACAD", "featured_image": "http://pluspng.com/img-png/user-png-icon-male-user-icon-512.png", "github_url": "https://github.com/OpenSUTD/web-platform-prototype", "poster_url": "http://pluspng.com/img-png/user-png-icon-male-user-icon-512.png"}) self.assertEqual(form.is_valid(), True) def test_submission_form_entry_invalid(self): response = self.client.get(reverse("projects:submit_new")) self.assertEqual(response.status_code, 200) # test submission mechanism form = SubmissionForm({"project_name": "", "caption": "", "category": "", "featured_image": "", "github_url": "", "poster_url": ""}) self.assertEqual(form.is_valid(), False) def test_submission_form_entry_not_github(self): response = self.client.get(reverse("projects:submit_new")) self.assertEqual(response.status_code, 200) # test submission mechanism form = SubmissionForm({"project_name": "test", "caption": "test caption", "category": "ACAD", "featured_image": "http://pluspng.com/img-png/user-png-icon-male-user-icon-512.png", "github_url": "https://lolcats.com/OpenSUTD/web-platform-prototype", "poster_url": "http://pluspng.com/img-png/user-png-icon-male-user-icon-512.png"}) self.assertEqual(form.is_valid(), False) class UserProfileFormTest(TestCase): def setUp(self): self.client = Client() um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD", password="tompassword") self.client.login(username="tom", password="tompassword") def test_submission_form_entry(self): # test user can actually get to the page response = self.client.get( reverse("projects:user_edit", args=("tom",))) self.assertEqual(response.status_code, 200) # test submission mechanism form = UserProfileForm({"display_name": "tom2", "display_picture": "http://pluspng.com/img-png/user-png-icon-male-user-icon-512.png", "graduation_year": 2019, "pillar": "ISTD", "bio": "Hi I am Tom", "contact_email": "tlkh.xms@gmail.com", "personal_links": "tlkh.design"}) self.assertEqual(form.is_valid(), True) def test_submission_form_entry_invalid(self): # test user can actually get to the page response = self.client.get( reverse("projects:user_edit", args=("tom",))) self.assertEqual(response.status_code, 200) # test submission mechanism form = UserProfileForm({"display_name": "", "display_picture": "", "graduation_year": 2019, "pillar": "", "bio": "", "contact_email": "", "personal_links": ""}) self.assertEqual(form.is_valid(), False) class ProjectEditFormTest(TestCase): def setUp(self): self.client = Client() um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD", password="tompassword") pm = OpenSUTDProjectManager() pm.create_project(project_uid="ACAD_00001", title="OpenSUTD Web Platform", caption="Sample project 1", category="ACAD", url="https://github.com/OpenSUTD/web-platform-prototype", poster_url="https://via.placeholder.com/150", featured_image="https://via.placeholder.com/150") pm.set_project_status("ACAD_00001", "ACCEPT") self.client.login(username="tom", password="tompassword") def test_submission_form_entry_invalid(self): # test user can actually get to the page response = self.client.get( reverse("projects:project_edit", args=("ACAD_00001",))) self.assertEqual(response.status_code, 200) # test submission mechanism form = ProjectEditForm({"title": "", "caption": "", "featured_image": "", "url": "", "poster_url": ""}) self.assertEqual(form.is_valid(), False) def test_submission_form_entry(self): # test user can actually get to the page response = self.client.get( reverse("projects:project_edit", args=("ACAD_00001",))) self.assertEqual(response.status_code, 200) # test submission mechanism form = ProjectEditForm({"title": "lalalal", "caption": "lalalal", "featured_image": "lalalal.com", "url": "https://github.com/OpenSUTD/web-platform-prototype", "poster_url": "lalalal.com"}) self.assertEqual(form.is_valid(), True) class LogintoSecuredPageTestCase(TestCase): def setUp(self): self.client = Client() um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD", password="tompassword") pm = OpenSUTDProjectManager() pm.create_project(project_uid="ACAD_00001", title="OpenSUTD Web Platform", caption="Sample project 1", category="ACAD", url="https://github.com/OpenSUTD/web-platform-prototype", poster_url="https://via.placeholder.com/150", featured_image="https://via.placeholder.com/150") self.client.login(username="tom", password="tompassword") def test_login_approval_view(self): response = self.client.get(reverse("projects:approval")) self.assertEqual(response.status_code, 200) def test_login_submission_view(self): response = self.client.get(reverse("projects:submit_new")) self.assertEqual(response.status_code, 200) def test_login_user_edit(self): url = reverse("projects:user_edit", args=("tom",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_login_project_edit(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:project_edit", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) class UserTestCase(TestCase): def setUp(self): um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD") um.create_user("jane", display_name="Jane Tan", display_picture="https://via.placeholder.com/150", graduation_year=2021, pillar="ESD") def test_user_get_name(self): tom = User.objects.get(username="tom") self.assertEqual(tom.display_name, "Tom Magnanti") jane = User.objects.get(username="jane") self.assertEqual(jane.display_name, "Jane Tan") def test_user_get_year(self): tom = User.objects.get(username="tom") self.assertEqual(tom.graduation_year, 2018) jane = User.objects.get(username="jane") self.assertEqual(jane.graduation_year, 2021) def test_user_get_pillar(self): tom = User.objects.get(username="tom") self.assertEqual(tom.pillar, "ISTD") jane = User.objects.get(username="jane") self.assertEqual(jane.pillar, "ESD") # test user profile page contents def test_user_page_load(self): url = reverse("projects:user", args=("tom",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) url = reverse("projects:user", args=("jane",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_user_page_not_empty(self): url = reverse("projects:user", args=("tom",)) response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) url = reverse("projects:user", args=("jane",)) response = self.client.get(url) self.assertGreater(len(response.content), LEN_BASE) def test_user_page_name(self): url = reverse("projects:user", args=("tom",)) response = str(self.client.get(url).content) self.assertEqual("Tom Magnanti" in response, True) url = reverse("projects:user", args=("jane",)) response = str(self.client.get(url).content) self.assertEqual("Jane Tan" in response, True) def test_user_page_year(self): url = reverse("projects:user", args=("tom",)) response = str(self.client.get(url).content) self.assertEqual("2018" in response, True) url = reverse("projects:user", args=("jane",)) response = str(self.client.get(url).content) self.assertEqual("2021" in response, True) def test_user_page_pillar(self): url = reverse("projects:user", args=("tom",)) response = str(self.client.get(url).content) self.assertEqual("ISTD" in response, True) url = reverse("projects:user", args=("jane",)) response = str(self.client.get(url).content) self.assertEqual("ESD" in response, True) def test_user_page_performance(self): start = time.time() for i in range(10): url = reverse("projects:user", args=("tom",)) response = self.client.get(url) url = reverse("projects:user", args=("jane",)) response = self.client.get(url) duration = time.time() - start self.assertLess(duration, 1.5) class ProjectShowcaseTestCase(TestCase): def setUp(self): pm = OpenSUTDProjectManager() pm.create_project(project_uid="ACAD_00001", title="OpenSUTD Web Platform", caption="Sample project 1", category="ACAD", url="https://github.com/OpenSUTD/web-platform-prototype", poster_url="https://via.placeholder.com/150", featured_image="https://via.placeholder.com/150") um = OpenSUTDUserManager() um.create_user("tom", display_name="Tom Magnanti", display_picture="https://via.placeholder.com/150", graduation_year=2018, pillar="ISTD") um.create_user("jane", display_name="Jane Tan", display_picture="https://via.placeholder.com/150", graduation_year=2021, pillar="ESD") def test_project_properties(self): proj = Project.objects.get(project_uid="ACAD_00001") self.assertEqual(proj.title, "OpenSUTD Web Platform") def test_add_user_project(self): pm = OpenSUTDProjectManager() pm.add_user_to_project("ACAD_00001", "tom") proj = Project.objects.get(project_uid="ACAD_00001") self.assertEqual(len(proj.users.all()), 1) pm.add_user_to_project("ACAD_00001", "jane") self.assertEqual(len(proj.users.all()), 2) def test_add_tag_project(self): pm = OpenSUTDProjectManager() pm.add_tag_to_project("ACAD_00001", "rand1,rand2") proj = Project.objects.get(project_uid="ACAD_00001") self.assertEqual(len(proj.tags.all()), 2) def test_add_del_user_project(self): tom = User.objects.get(username="tom") jane = User.objects.get(username="jane") proj = Project.objects.get(project_uid="ACAD_00001") proj.users.add(tom) proj.users.add(jane) proj.users.remove(jane) self.assertEqual(len(proj.users.all()), 1) def test_project_page_not_approved(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "REJECT") url = reverse("projects:project_page", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) self.assertEqual("Error 404: Page Not Found!" in str( response.content), True) self.assertGreater(len(response.content), LEN_BASE) def test_project_page_approved(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:project_page", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) self.assertGreater(len(response.content), LEN_BASE) def test_project_page_name(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:project_page", args=("ACAD_00001",)) response = str(self.client.get(url).content) self.assertEqual("OpenSUTD Web Platform" in response, True) def test_project_tag(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") pm.add_tag_to_project("ACAD_00001", "tag1,tag2") url = reverse("projects:project_page", args=("ACAD_00001",)) response = str(self.client.get(url).content) self.assertEqual("tag1" in response, True) self.assertEqual("tag2" in response, True) def test_project_page_contents(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:project_page", args=("ACAD_00001",)) response = str(self.client.get(url).content) # print(response) # test top and bottom of contents # this does not pass on Travis for Pull Request builds # due to them disabling env variables for security reasons #self.assertEqual("Prototype for the Eventual OpenSUTD Web Platform" in response, True) #self.assertEqual("Data Model" in response, True) self.assertGreater(len(response), LEN_BASE) def test_project_page_load(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:project_page", args=("ACAD_00001",)) response = self.client.get(url) self.assertEqual(response.status_code, 200) def test_project_page_not_empty(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:project_page", args=("ACAD_00001",)) response = str(self.client.get(url).content) self.assertGreater(len(response), LEN_BASE) def test_project_author_name(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") pm.add_user_to_project("ACAD_00001", "tom") url = reverse("projects:project_page", args=("ACAD_00001",)) response = str(self.client.get(url).content) self.assertEqual("Tom Magnanti" in response, True) def test_project_author_pillar(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") pm.add_user_to_project("ACAD_00001", "tom") url = reverse("projects:project_page", args=("ACAD_00001",)) response = str(self.client.get(url).content) self.assertEqual("ISTD" in response, True) def test_project_list_page(self): pm = OpenSUTDProjectManager() pm.set_project_status("ACAD_00001", "ACCEPT") url = reverse("projects:projects_list") response = str(self.client.get(url).content) self.assertEqual("OpenSUTD Web Platform" in response, True) self.assertEqual("Sample project 1" in response, True) def test_project_page_performance(self): start = time.time() for _ in range(10): url = reverse("projects:project_page", args=("ACAD_00001",)) response = self.client.get(url) duration = time.time() - start self.assertLess(duration, 1.5)
40.530899
117
0.585557
3,139
28,858
5.194967
0.097802
0.03802
0.041455
0.04219
0.796406
0.770957
0.740909
0.708346
0.689152
0.662783
0
0.026753
0.295377
28,858
711
118
40.587904
0.775204
0.035207
0
0.635531
0
0.009158
0.182757
0.018495
0.001832
0
0
0
0.135531
1
0.119048
false
0.021978
0.014652
0
0.157509
0.03663
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
d353829766a83bdaaf1d9647932561620e2d8f0c
49
py
Python
lankuai/lankuai/lkitsm/project/workfolw/__init__.py
abiner/lankuai
55a3631528acf1c46a471cb0616e28a5396faab5
[ "MIT" ]
null
null
null
lankuai/lankuai/lkitsm/project/workfolw/__init__.py
abiner/lankuai
55a3631528acf1c46a471cb0616e28a5396faab5
[ "MIT" ]
null
null
null
lankuai/lankuai/lkitsm/project/workfolw/__init__.py
abiner/lankuai
55a3631528acf1c46a471cb0616e28a5396faab5
[ "MIT" ]
null
null
null
default_app_config='workfolw.apps.WorkfolwConfig'
49
49
0.897959
6
49
7
1
0
0
0
0
0
0
0
0
0
0
0
0
49
1
49
49
0.857143
0
0
0
0
0
0.56
0.56
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
d371bded9db80d5ecfc09ed0c62cf85341632ea2
254
py
Python
NLP_Flask/app/data_manage_api/__init__.py
Gxy-2001/NLPPlat
f339c1a7452b979b413919cf4bc128bf45af52ef
[ "MIT" ]
null
null
null
NLP_Flask/app/data_manage_api/__init__.py
Gxy-2001/NLPPlat
f339c1a7452b979b413919cf4bc128bf45af52ef
[ "MIT" ]
null
null
null
NLP_Flask/app/data_manage_api/__init__.py
Gxy-2001/NLPPlat
f339c1a7452b979b413919cf4bc128bf45af52ef
[ "MIT" ]
null
null
null
from flask import Blueprint api = Blueprint("data_manage_api", __name__) from . import data_venation from . import operator_manage from . import model_manage from . import resource_manage from . import pipeline_manage from . import trainedmodel_manage
23.090909
44
0.818898
34
254
5.764706
0.411765
0.306122
0.326531
0
0
0
0
0
0
0
0
0
0.133858
254
10
45
25.4
0.890909
0
0
0
0
0
0.059055
0
0
0
0
0
0
1
0
false
0
0.875
0
0.875
0.25
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
d38426706b82675c8a7c667f7422351da30f26ac
435
py
Python
src/thespian/sourcetree/__init__.py
mtttech/yari-dnd
bcb9d5dbbd38b09e3ac25f7a9d5d88b66b000d1a
[ "MIT" ]
1
2022-03-28T16:10:15.000Z
2022-03-28T16:10:15.000Z
src/thespian/sourcetree/__init__.py
mtttech/dndpersonae
c4fa129d1e940c9f9a5e29d703e3988b45d90356
[ "MIT" ]
null
null
null
src/thespian/sourcetree/__init__.py
mtttech/dndpersonae
c4fa129d1e940c9f9a5e29d703e3988b45d90356
[ "MIT" ]
null
null
null
from .dnd5e import dnd5e_sources class SourceTree: backgrounds: object = dnd5e_sources["backgrounds"] classes: object = dnd5e_sources["classes"] feats: object = dnd5e_sources["feats"] metrics: object = dnd5e_sources["metrics"] races: object = dnd5e_sources["races"] skills: object = dnd5e_sources["skills"] subclasses: object = dnd5e_sources["subclasses"] subraces: object = dnd5e_sources["subraces"]
33.461538
54
0.71954
47
435
6.468085
0.319149
0.355263
0.473684
0
0
0
0
0
0
0
0
0.027548
0.165517
435
12
55
36.25
0.809917
0
0
0
0
0
0.135632
0
0
0
0
0
0
1
0
true
0
0.1
0
1
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
1
0
0
4
d3970e3b64f228131e6989e131e2293b5c3f4cea
2,206
py
Python
analysis/log_analysis/check_util.py
leozz37/makani
c94d5c2b600b98002f932e80a313a06b9285cc1b
[ "Apache-2.0" ]
1,178
2020-09-10T17:15:42.000Z
2022-03-31T14:59:35.000Z
analysis/log_analysis/check_util.py
leozz37/makani
c94d5c2b600b98002f932e80a313a06b9285cc1b
[ "Apache-2.0" ]
1
2020-05-22T05:22:35.000Z
2020-05-22T05:22:35.000Z
analysis/log_analysis/check_util.py
leozz37/makani
c94d5c2b600b98002f932e80a313a06b9285cc1b
[ "Apache-2.0" ]
107
2020-09-10T17:29:30.000Z
2022-03-18T09:00:14.000Z
# Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Utilities for checks.""" from makani.analysis.checks import base_check from makani.lib.python import import_util # TODO: Move this to //analysis/checks/base_check.py def LoadListOfChecks(path_to_checks): """Load the ListOfChecks object given the path to its file and class. Args: path_to_checks: A string specifying the location of the checks. E.g. makani.analysis.my_checks.MyCheck. Returns: The ListOfChecks object. """ cls = import_util.ImportClass(path_to_checks) return cls(for_log=True) def LoadJsonCheck(path_to_check, parameters_json): r"""Load the Check object given the path to its classpath and parameters. Args: path_to_check: A string specifying the location of the checks. E.g. makani.analysis.my_checks.MyCheck parameters_json: A JSON serialized string of the parameters needed to instantiate the class. E.g. "{\"for_log\": true, \"warning_ranges\": {\"ranges\": [0, 180]}, \"normal_ranges\": {\"ranges\": [80, 150]}}" Returns: The Check object. """ cls = import_util.ImportClass(path_to_check) parameters = base_check.ParseCheckSpecs(parameters_json) return cls(**parameters) def LoadCheck(path_to_check, params): """Load the ListOfChecks object given the path to its file and class. Args: path_to_check: A string specifying the location of the checks. E.g. makani.analysis.my_checks.MyCheck. params: A string specifying parameters to be passed into the check. Returns: The CheckItem object. """ cls = import_util.ImportClass(path_to_check) return cls(**params)
32.441176
77
0.729828
319
2,206
4.937304
0.37931
0.045714
0.041905
0.034286
0.316825
0.316825
0.302222
0.279365
0.227302
0.227302
0
0.009429
0.182684
2,206
67
78
32.925373
0.864115
0.723935
0
0.153846
0
0
0
0
0
0
0
0.014925
0
1
0.230769
false
0
0.384615
0
0.846154
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
1
0
1
0
0
4
6ca4810cddee9dd6efdb1f08786256b345cb7b79
10,163
py
Python
r80_apis.py
0dadj1an/r80python
d59f2c1b07c75e028d13859b17cea5929ee3562d
[ "Apache-2.0" ]
null
null
null
r80_apis.py
0dadj1an/r80python
d59f2c1b07c75e028d13859b17cea5929ee3562d
[ "Apache-2.0" ]
null
null
null
r80_apis.py
0dadj1an/r80python
d59f2c1b07c75e028d13859b17cea5929ee3562d
[ "Apache-2.0" ]
null
null
null
#!/bin/python import requests import json import pprint #remove https warning requests.packages.urllib3.disable_warnings() #url = "https://192.168.248.150/web_api/" #user = "api_user" #pw = "demo123" def login(url,user,pw): payload_list={} payload_list['user']=user payload_list['password']=pw headers = { 'content-type': "application/json", 'Accept': "*/*", } response = requests.post(url+"login", json=payload_list, headers=headers, verify=False) return response def add_host(sid,url,name,ip_address,groups="",comments="",nat_settings=""): payload_list={} payload_list['name']=name payload_list['ipv4-address']= ip_address if nat_settings != "": payload_list['nat-settings']= nat_settings if groups != "" : payload_list['groups']= groups if comments != "": payload_list['comments']= comments headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } print payload_list response = requests.post(url+"add-host", json=payload_list, headers=headers, verify=False) return response.json() def delete_host(sid,url,name): payload_list={} payload_list['name']=name payload_list['ignore-warnings']="true" headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"delete-host", json=payload_list, headers=headers, verify=False) return response def add_network(sid,url,name,subnet,mask_length,nat_settings,groups): payload_list={} payload_list['name']=name payload_list['subnet4']= subnet payload_list['mask-length']= mask_length payload_list['nat-settings']= nat_settings payload_list['groups']= groups headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"add-network", json=payload_list, headers=headers, verify=False) return response.json() def delete_network(sid,url,name): payload_list={} payload_list['name']=name headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"delete-network", json=payload_list, headers=headers, verify=False) return response def show_network_groups(sid,url): payload_list={} payload_list['details-level']="standard" headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"show-groups", json=payload_list, headers=headers, verify=False) groups=json.loads(response.text) return groups def add_network_group(sid,url,name): payload_list={} payload_list['name']=name headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"add-group", json=payload_list, headers=headers, verify=False) return response def add_members_to_network_group(sid,url,members): payload_list={} payload_list['name']=name payload_list['members']=members headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"set-group", json=payload_list, headers=headers, verify=False) return response def add_access_layer(sid,url,name): payload_list={} payload_list['name']=name headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"add-access-layer", json=payload_list, headers=headers, verify=False) return response def add_policy_package(sid,url,name,access_layer,threat_layer,comments): payload_list={} payload_list['name']=name payload_list['access']=access_layer payload_list['threat-prevention']=threat_layer payload_list['comments']=comments headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"add-package", json=payload_list, headers=headers, verify=False) return response def add_access_section(sid,url,layer,position,name): payload_list={} payload_list['layer']=layer payload_list['position']=position payload_list['name']=name headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"add-access-section", json=payload_list, headers=headers, verify=False) return response def delete_access_section_by_name(sid,url,layer,name): payload_list={} payload_list['name']=name payload_list['layer']=layer headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"delete-access-section", json=payload_list, headers=headers, verify=False) return response def show_access_section(sid,url,layer,name): payload_list={} payload_list['layer']=layer payload_list['name']=name headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"show-access-section", json=payload_list, headers=headers, verify=False) return response def add_access_rule(sid,url,layer,position,rule): payload_list={} payload_list['layer']=layer payload_list['position']=position payload_list['name']=rule['name'] payload_list['source']=rule['source'] payload_list['destination']=rule['destination'] payload_list['service']=rule['service'] payload_list['track']=rule['track'] payload_list['action']=rule['action'] headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"add-access-rule", json=payload_list, headers=headers, verify=False) return response def delete_access_rule_by_rule_number(sid,url,layer,number): payload_list={} payload_list['layer']=layer payload_list['rule-number']=number headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"delete-access-rule", json=payload_list, headers=headers, verify=False) return response def delete_access_rule_by_rule_name(sid,url,layer,name): payload_list={} payload_list['layer']=layer payload_list['name']=name headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"delete-access-rule", json=payload_list, headers=headers, verify=False) return response def publish(sid,url): payload_list={} headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"publish", json=payload_list, headers=headers, verify=False) return response def add_range(): payload_list={} headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"publish", json=payload_list, headers=headers, verify=False) return response def show_task(sid,url,task): payload_list={} payload_list['task-id']=task headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"show-task", json=payload_list, headers=headers, verify=False) return response def logout(sid,url): payload_list={} headers = { 'content-type': "application/json", 'Accept': "*/*", 'x-chkp-sid': sid, } response = requests.post(url+"logout", json=payload_list, headers=headers, verify=False) return response #main program #login and get the session id #sid=login(url,user,pw) #get all groups #add policy package #name="my_cpx_policy2" #comments="created by automation script" #access_layer="true" #threat_layer="true" #package_return=add_policy_package(sid,url,name,access_layer,threat_layer,comments) #print package_return #add access rule section #layer="my_cpx_policy2 network" #position="top" #position={"above":"Cleanup rule"} #name="section1 - created by automation2" #show_section_return=show_access_section(sid,url,layer,name) #show_section_return=show_access_section(sid,url,layer,name) #if show_section_return.status_code == "200": # print "section already exists skipping" #else: # add_access_section(sid,url,layer,position,name) #add access rule #layer="my_cpx_policy2 network" #position="top" #rule={} #rule['source']="any" #rule['destination']="any" #rule['service']="http" #rule['action']="accept" #rule['track']="Network Log" #rule['name']="my rule 1" #rule_response=add_access_rule(sid,url,layer,position,rule) #print json.loads(rule_response.text) #print rule_response #add access rule to section #layer="my_cpx_policy2 network" #position={"top":"section1 - created by automation"} #rule={} #rule['source']="any" #rule['destination']="any" #rule['service']=["https","http"] #rule['action']="accept" #rule['track']="Network Log" #rule['name']="my rule 2" #rule_response=add_access_rule(sid,url,layer,position,rule) #print rule_response #print json.loads(rule_response.text) #publish #publish(sid,url)
30.428144
111
0.612024
1,163
10,163
5.195185
0.104901
0.15475
0.06852
0.095995
0.756372
0.747931
0.72145
0.706885
0.643496
0.599636
0
0.003861
0.235364
10,163
333
112
30.51952
0.773646
0.148972
0
0.637931
0
0
0.177682
0.002444
0
0
0
0
0
0
null
null
0.00431
0.012931
null
null
0.008621
0
0
0
null
0
0
0
0
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
1
0
0
0
0
0
0
0
0
4
6cd18b31f1d34f290e9b9c7833de3af5f36e1b66
1,513
py
Python
academica/migrations/0003_auto_20201220_1016.py
Chaoslecion123/tesis-final-aradiel-2020
bf6b4b6f08ab11da24bf965433fc36bde2f9606b
[ "MIT" ]
null
null
null
academica/migrations/0003_auto_20201220_1016.py
Chaoslecion123/tesis-final-aradiel-2020
bf6b4b6f08ab11da24bf965433fc36bde2f9606b
[ "MIT" ]
null
null
null
academica/migrations/0003_auto_20201220_1016.py
Chaoslecion123/tesis-final-aradiel-2020
bf6b4b6f08ab11da24bf965433fc36bde2f9606b
[ "MIT" ]
null
null
null
# Generated by Django 3.0.7 on 2020-12-20 15:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('academica', '0002_auto_20201220_0117'), ] operations = [ migrations.RemoveField( model_name='clase', name='nivel', ), migrations.RemoveField( model_name='clase_profesor', name='clase', ), migrations.RemoveField( model_name='clase_profesor', name='profesor', ), migrations.RemoveField( model_name='nota', name='alumno', ), migrations.RemoveField( model_name='nota', name='clase', ), migrations.RemoveField( model_name='nota', name='periodo', ), migrations.RemoveField( model_name='perfil_profesor', name='nivel', ), migrations.RemoveField( model_name='perfil_profesor', name='usuario', ), migrations.DeleteModel( name='Alumno', ), migrations.DeleteModel( name='Clase', ), migrations.DeleteModel( name='Clase_Profesor', ), migrations.DeleteModel( name='Nota', ), migrations.DeleteModel( name='Perfil_Profesor', ), migrations.DeleteModel( name='Periodo', ), ]
23.640625
49
0.497687
114
1,513
6.45614
0.324561
0.228261
0.282609
0.326087
0.493207
0.445652
0.258152
0
0
0
0
0.033623
0.390615
1,513
63
50
24.015873
0.764642
0.029742
0
0.684211
1
0
0.140518
0.015689
0
0
0
0
0
1
0
false
0
0.017544
0
0.070175
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
9f46ca6c2a027a96dbe50f686fba48b96a51859c
96
py
Python
smart_meter/apps.py
GPXenergy/gpx_server_api
9b021522be4414ac95159a0ed576848c463637f9
[ "MIT" ]
null
null
null
smart_meter/apps.py
GPXenergy/gpx_server_api
9b021522be4414ac95159a0ed576848c463637f9
[ "MIT" ]
null
null
null
smart_meter/apps.py
GPXenergy/gpx_server_api
9b021522be4414ac95159a0ed576848c463637f9
[ "MIT" ]
null
null
null
from django.apps import AppConfig class SmartMeterConfig(AppConfig): name = 'smart_meter'
16
34
0.770833
11
96
6.636364
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.15625
96
5
35
19.2
0.901235
0
0
0
0
0
0.114583
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
9f751bbb91c8500eae6e90b0594cc10254454ae4
100
py
Python
web/cache.py
therealplato/vim-awesome
54e33073f4d470230e4578239ceb8f203f5f6613
[ "MIT" ]
1,379
2016-04-10T06:35:30.000Z
2022-03-31T16:07:38.000Z
web/cache.py
therealplato/vim-awesome
54e33073f4d470230e4578239ceb8f203f5f6613
[ "MIT" ]
119
2016-04-10T04:26:48.000Z
2022-03-25T15:10:06.000Z
web/cache.py
therealplato/vim-awesome
54e33073f4d470230e4578239ceb8f203f5f6613
[ "MIT" ]
83
2016-04-10T11:32:03.000Z
2022-03-16T01:56:35.000Z
"""Module to hold the instance of the cache""" from flask.ext.cache import Cache cache = Cache()
14.285714
46
0.71
16
100
4.4375
0.6875
0.28169
0
0
0
0
0
0
0
0
0
0
0.18
100
6
47
16.666667
0.865854
0.4
0
0
0
0
0
0
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
9f76e0fb3dc684661b0f1ce53cf8d60b14cc6636
357
py
Python
mdm_inventory/clients/graphql/query.py
TeamWalls/mdm-backend-django
4e23f9abc8531eb786d5e6cf958c9ffa8acd6b1d
[ "MIT" ]
null
null
null
mdm_inventory/clients/graphql/query.py
TeamWalls/mdm-backend-django
4e23f9abc8531eb786d5e6cf958c9ffa8acd6b1d
[ "MIT" ]
null
null
null
mdm_inventory/clients/graphql/query.py
TeamWalls/mdm-backend-django
4e23f9abc8531eb786d5e6cf958c9ffa8acd6b1d
[ "MIT" ]
null
null
null
import graphene from graphene_django import DjangoObjectType #models from mdm_inventory.clients.models import Client #types from mdm_inventory.clients.graphql.types import ClientType class QueryClient(graphene.ObjectType): clients = graphene.List(ClientType) def resolve_clients(root, info): return Client.objects.filter(is_active=True)
23.8
58
0.803922
44
357
6.409091
0.613636
0.049645
0.113475
0.163121
0
0
0
0
0
0
0
0
0.128852
357
14
59
25.5
0.906752
0.030812
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
0.5
0.125
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
4c7de526802297e77a682fdac5f19a9acc13c428
275
py
Python
contratospr/contracts/manager.py
jycordero/contratospr-api
6778b02b42305aa7ce65c956a0d89029ddd857a4
[ "Apache-2.0" ]
15
2019-02-26T12:40:18.000Z
2020-01-24T00:58:00.000Z
contratospr/contracts/manager.py
jycordero/contratospr-api
6778b02b42305aa7ce65c956a0d89029ddd857a4
[ "Apache-2.0" ]
52
2019-02-13T03:54:34.000Z
2020-01-20T16:39:56.000Z
contratospr/contracts/manager.py
jycordero/contratospr-api
6778b02b42305aa7ce65c956a0d89029ddd857a4
[ "Apache-2.0" ]
6
2019-02-18T13:59:55.000Z
2019-11-30T23:36:43.000Z
from django.db import models from .queryset import ContractQuerySet class BaseContractManager(models.Manager): def get_queryset(self): return super().get_queryset().defer("search_vector") ContractManager = BaseContractManager.from_queryset(ContractQuerySet)
22.916667
69
0.792727
29
275
7.37931
0.655172
0.11215
0
0
0
0
0
0
0
0
0
0
0.123636
275
11
70
25
0.887967
0
0
0
0
0
0.047273
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.166667
0.833333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
1
0
0
4
4c8343bd0395981669f44890366d05a0d442060e
158
py
Python
Post-Exploitation/LaZagne/Linux/lazagne/config/color.py
FOGSEC/TID3xploits
b57d8bae454081a3883a5684679e2a329e72d6e5
[ "MIT" ]
5
2018-01-15T13:58:40.000Z
2022-02-17T02:38:58.000Z
Post-Exploitation/LaZagne/Linux/lazagne/config/color.py
bhattsameer/TID3xploits
b57d8bae454081a3883a5684679e2a329e72d6e5
[ "MIT" ]
null
null
null
Post-Exploitation/LaZagne/Linux/lazagne/config/color.py
bhattsameer/TID3xploits
b57d8bae454081a3883a5684679e2a329e72d6e5
[ "MIT" ]
4
2019-06-21T07:51:11.000Z
2020-11-04T05:20:09.000Z
class bcolors(): HEADER = '\033[95m' OKBLUE = '\033[94m' OK = '\033[92m' WARNING = '\033[96m' FAIL = '\033[91m' TITLE = '\033[93m' ENDC = '\033[0m'
14.363636
21
0.550633
23
158
3.782609
0.73913
0
0
0
0
0
0
0
0
0
0
0.272
0.208861
158
10
22
15.8
0.424
0
0
0
0
0
0.350318
0
0
0
0
0
0
1
0
false
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
4cb38436ee43de94cce46d68eb49a8de9473c484
32
py
Python
homeassistant/components/eliqonline/__init__.py
domwillcode/home-assistant
f170c80bea70c939c098b5c88320a1c789858958
[ "Apache-2.0" ]
30,023
2016-04-13T10:17:53.000Z
2020-03-02T12:56:31.000Z
homeassistant/components/eliqonline/__init__.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
31,101
2020-03-02T13:00:16.000Z
2022-03-31T23:57:36.000Z
homeassistant/components/eliqonline/__init__.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
11,956
2016-04-13T18:42:31.000Z
2020-03-02T09:32:12.000Z
"""The eliqonline component."""
16
31
0.6875
3
32
7.333333
1
0
0
0
0
0
0
0
0
0
0
0
0.09375
32
1
32
32
0.758621
0.78125
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
4cc491a284af54f47be381a4be2778e24923e8cc
129
py
Python
jumpscale/packages/threebot_deployer/models/backup_tokens.py
zaibon/js-sdk
cd1d26f2c3343884c1927ceef7c1e12e3f7da905
[ "Apache-2.0" ]
13
2020-09-02T09:05:08.000Z
2022-03-12T02:43:24.000Z
jumpscale/packages/threebot_deployer/models/backup_tokens.py
zaibon/js-sdk
cd1d26f2c3343884c1927ceef7c1e12e3f7da905
[ "Apache-2.0" ]
1,998
2020-06-15T11:46:10.000Z
2022-03-24T22:12:41.000Z
jumpscale/packages/threebot_deployer/models/backup_tokens.py
zaibon/js-sdk
cd1d26f2c3343884c1927ceef7c1e12e3f7da905
[ "Apache-2.0" ]
8
2020-09-29T06:50:35.000Z
2021-06-14T03:30:52.000Z
from jumpscale.core.base import Base, fields class BackupTokens(Base): tname = fields.String() token = fields.String()
18.428571
44
0.713178
16
129
5.75
0.6875
0.26087
0
0
0
0
0
0
0
0
0
0
0.178295
129
6
45
21.5
0.867925
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
4cd33a36e5a202d2c15a3e020cfd9f9644dce14d
81
py
Python
lino_book/projects/igen/__init__.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
3
2016-08-25T05:58:09.000Z
2019-12-05T11:13:45.000Z
lino_book/projects/igen/__init__.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
18
2016-11-12T21:38:58.000Z
2019-12-03T17:54:38.000Z
lino_book/projects/igen/__init__.py
lino-framework/lino_book
4eab916832cd8f48ff1b9fc8c2789f0b437da0f8
[ "BSD-2-Clause" ]
9
2016-10-15T11:12:33.000Z
2021-09-22T04:37:37.000Z
""" igen stands for "invoice generator". The project is currently inactive. """
13.5
36
0.716049
10
81
5.8
1
0
0
0
0
0
0
0
0
0
0
0
0.160494
81
5
37
16.2
0.852941
0.876543
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
4cd50bc65a9dffb20e6d862af0cb7471f35a384d
70
py
Python
code/arc028_1_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
3
2019-08-16T16:55:48.000Z
2021-04-11T10:21:40.000Z
code/arc028_1_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
null
null
null
code/arc028_1_01.py
KoyanagiHitoshi/AtCoder
731892543769b5df15254e1f32b756190378d292
[ "MIT" ]
null
null
null
N,A,B=map(int,input().split()) print("Ant" if 0<N%(A+B)<=A else "Bug")
35
39
0.585714
17
70
2.411765
0.764706
0.097561
0.146341
0
0
0
0
0
0
0
0
0.015385
0.071429
70
2
39
35
0.615385
0
0
0
0
0
0.084507
0
0
0
0
0
0
1
0
true
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
4cda412ef162b3f72b00e281488be9d02ef6682d
172
py
Python
nameko_mongoengine/__init__.py
ketgo/nameko-mongoengine
94b4a41dfa845cec8b48f874c0b64658a1c4bef6
[ "Apache-2.0" ]
2
2019-12-06T17:51:44.000Z
2020-02-20T22:38:38.000Z
nameko_mongoengine/__init__.py
ketgo/nameko-mongoengine
94b4a41dfa845cec8b48f874c0b64658a1c4bef6
[ "Apache-2.0" ]
1
2022-03-07T02:32:45.000Z
2022-03-07T06:45:43.000Z
nameko_mongoengine/__init__.py
ketgo/nameko-mongoengine
94b4a41dfa845cec8b48f874c0b64658a1c4bef6
[ "Apache-2.0" ]
null
null
null
""" MongoEngine dependency provider """ from __future__ import absolute_import from .mongo_engine import MongoEngine __all__ = ["MongoEngine", ] # pragma: no cover
17.2
47
0.744186
18
172
6.555556
0.722222
0
0
0
0
0
0
0
0
0
0
0
0.168605
172
9
48
19.111111
0.825175
0.284884
0
0
0
0
0.099099
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
980de4c0b0b2bdc8da8fd8f2177a3dbda0b77669
525
py
Python
example/serializers.py
divipayhq/drf_model_pusher
37f2d7c61839f641675da8db2bd4ec4932d4bd47
[ "MIT" ]
5
2018-07-23T00:21:29.000Z
2020-01-16T15:42:10.000Z
example/serializers.py
divipayhq/drf_model_pusher
37f2d7c61839f641675da8db2bd4ec4932d4bd47
[ "MIT" ]
39
2018-07-25T03:42:25.000Z
2021-12-20T03:51:13.000Z
example/serializers.py
divipayhq/drf_model_pusher
37f2d7c61839f641675da8db2bd4ec4932d4bd47
[ "MIT" ]
3
2018-10-02T16:29:34.000Z
2022-02-22T03:04:50.000Z
from rest_framework import serializers from example.models import MyPublicModel, MyPrivateModel, MyPresenceModel class MyPublicModelSerializer(serializers.ModelSerializer): class Meta: model = MyPublicModel fields = ("name",) class MyPrivateModelSerializer(serializers.ModelSerializer): class Meta: model = MyPrivateModel fields = ("name",) class MyPresenceModelSerializer(serializers.ModelSerializer): class Meta: model = MyPresenceModel fields = ("name",)
23.863636
73
0.721905
42
525
9
0.452381
0.206349
0.246032
0.277778
0.31746
0
0
0
0
0
0
0
0.20381
525
21
74
25
0.904306
0
0
0.428571
0
0
0.022857
0
0
0
0
0
0
1
0
false
0
0.142857
0
0.571429
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
980f19d193d1b32136b75cbaadce101f548347ae
31
py
Python
test.py
s-rohil/infrastructure-as-a-code
9919a9ea4a0a4f92cf7859cdc1919962ed6ba345
[ "MIT" ]
null
null
null
test.py
s-rohil/infrastructure-as-a-code
9919a9ea4a0a4f92cf7859cdc1919962ed6ba345
[ "MIT" ]
null
null
null
test.py
s-rohil/infrastructure-as-a-code
9919a9ea4a0a4f92cf7859cdc1919962ed6ba345
[ "MIT" ]
null
null
null
Test Dummy code to make commit
10.333333
25
0.806452
6
31
4.166667
1
0
0
0
0
0
0
0
0
0
0
0
0.193548
31
2
26
15.5
1
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
e21b633cad6ae7e10b4918cae9d3ced7f0c2f856
224
py
Python
materiais/admin.py
lucgbrl/ecossistema-django
a374662be7e93a1f57b7318487074aa0bd905043
[ "MIT" ]
null
null
null
materiais/admin.py
lucgbrl/ecossistema-django
a374662be7e93a1f57b7318487074aa0bd905043
[ "MIT" ]
null
null
null
materiais/admin.py
lucgbrl/ecossistema-django
a374662be7e93a1f57b7318487074aa0bd905043
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import Post, Material, Video, Section # Register your models here. admin.site.register(Post) admin.site.register(Section) admin.site.register(Material) admin.site.register(Video)
32
50
0.8125
32
224
5.6875
0.4375
0.197802
0.373626
0
0
0
0
0
0
0
0
0
0.084821
224
7
51
32
0.887805
0.116071
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
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
1
0
1
0
0
0
0
4
e24dbdf6d703b006001d5a126067e866e809fe94
73
py
Python
articles/imp/genfigs/tuning.py
parrt/stratx
c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22
[ "MIT" ]
54
2019-07-17T04:59:39.000Z
2022-03-18T15:25:00.000Z
articles/imp/genfigs/tuning.py
parrt/stratx
c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22
[ "MIT" ]
5
2019-07-27T16:18:37.000Z
2020-12-02T20:16:49.000Z
articles/imp/genfigs/tuning.py
parrt/stratx
c190ecc32ac7b8dd3f5532a5d5b0de34a3693a22
[ "MIT" ]
13
2019-08-08T22:17:50.000Z
2022-02-11T10:19:23.000Z
import support support.tune_all(pairs_to_tune=support.pairs, verbose=1)
18.25
56
0.835616
12
73
4.833333
0.666667
0
0
0
0
0
0
0
0
0
0
0.014706
0.068493
73
3
57
24.333333
0.838235
0
0
0
0
0
0
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
e25019f223c74f6ce84bf87834f9d201b41fe7b3
489
bzl
Python
third_party/commons_fileupload.bzl
wix-playground/rules_maven_third_party
ff0b486df194779d7d8e6c9102cd12138e3305c3
[ "Apache-2.0" ]
null
null
null
third_party/commons_fileupload.bzl
wix-playground/rules_maven_third_party
ff0b486df194779d7d8e6c9102cd12138e3305c3
[ "Apache-2.0" ]
null
null
null
third_party/commons_fileupload.bzl
wix-playground/rules_maven_third_party
ff0b486df194779d7d8e6c9102cd12138e3305c3
[ "Apache-2.0" ]
null
null
null
load(":import_external.bzl", import_external = "import_external") def dependencies(): import_external( name = "commons_fileupload_commons_fileupload", artifact = "commons-fileupload:commons-fileupload:1.4", artifact_sha256 = "a4ec02336f49253ea50405698b79232b8c5cbf02cb60df3a674d77a749a1def7", srcjar_sha256 = "2acfe29671daf8c94be5d684b8ac260d9c11f78611dff4899779b43a99205291", excludes = [ "commons-io:commons-io", ], )
37.615385
93
0.713701
35
489
9.714286
0.514286
0.164706
0.141176
0.2
0
0
0
0
0
0
0
0.23038
0.192229
489
12
94
40.75
0.63038
0
0
0
0
0
0.535787
0.464213
0
0
0
0
0
1
0.090909
true
0
0.181818
0
0.272727
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
e257f22d28c17b249ec2d577cdbb9be878a8be8b
213
py
Python
plugins/plot/__init__.py
DeStream-dev/electrum-destream
18bcaadaea65ff2fb0333787111d8e0ddf81a3d8
[ "MIT" ]
26
2017-06-09T04:13:13.000Z
2021-11-15T11:35:30.000Z
plugins/plot/__init__.py
DeStream-dev/electrum-destream
18bcaadaea65ff2fb0333787111d8e0ddf81a3d8
[ "MIT" ]
29
2017-05-07T05:08:06.000Z
2021-02-19T13:15:03.000Z
plugins/plot/__init__.py
DeStream-dev/electrum-destream
18bcaadaea65ff2fb0333787111d8e0ddf81a3d8
[ "MIT" ]
21
2017-05-31T14:24:20.000Z
2021-01-30T17:35:43.000Z
# from electrum_stratis.i18n import _ # fullname = 'Plot History' # description = _("Ability to plot transaction history in graphical mode.") # requires = [('matplotlib', 'matplotlib')] # available_for = ['qt']
30.428571
75
0.70892
23
213
6.391304
0.869565
0
0
0
0
0
0
0
0
0
0
0.01105
0.150235
213
6
76
35.5
0.801105
0.943662
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
e27585ce7f82ce155f8b78f9a6d5c4a5e52b8168
122
py
Python
notebooks/_solutions/05-spatial-operations-overlays11.py
jorisvandenbossche/DS-python-geospatial
893a12edc5c203a75815f6dcb5f1e18c577c8cd5
[ "BSD-3-Clause" ]
58
2020-10-09T10:10:59.000Z
2022-03-07T14:58:07.000Z
notebooks/_solutions/05-spatial-operations-overlays11.py
amitkb3/DS-python-geospatial
5f156ebff67e06d59b2a7ef446d1fed746ce0650
[ "BSD-3-Clause" ]
24
2020-09-30T19:57:14.000Z
2021-10-05T07:21:09.000Z
notebooks/_solutions/05-spatial-operations-overlays11.py
amitkb3/DS-python-geospatial
5f156ebff67e06d59b2a7ef446d1fed746ce0650
[ "BSD-3-Clause" ]
19
2020-10-05T09:32:18.000Z
2022-03-20T00:09:14.000Z
# Calculate the intersection of the land use polygons with Muette land_use_muette = land_use.geometry.intersection(muette)
61
65
0.844262
18
122
5.555556
0.555556
0.21
0.26
0
0
0
0
0
0
0
0
0
0.106557
122
2
66
61
0.917431
0.516393
0
0
0
0
0
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
e2850c2cd171c65701a7c0ab8f349d8b562b539c
556
py
Python
venv/Lib/site-packages/pyroute2/netlink/rtnl/riprsocket.py
kalymgr/Project-T-Cryptocurrencies
5dbb679a76bcf07b913036e7b44ba4247c39482d
[ "MIT" ]
null
null
null
venv/Lib/site-packages/pyroute2/netlink/rtnl/riprsocket.py
kalymgr/Project-T-Cryptocurrencies
5dbb679a76bcf07b913036e7b44ba4247c39482d
[ "MIT" ]
null
null
null
venv/Lib/site-packages/pyroute2/netlink/rtnl/riprsocket.py
kalymgr/Project-T-Cryptocurrencies
5dbb679a76bcf07b913036e7b44ba4247c39482d
[ "MIT" ]
null
null
null
from pyroute2.netlink import rtnl from pyroute2.netlink import NETLINK_ROUTE from pyroute2.netlink.nlsocket import NetlinkSocket from pyroute2.netlink.rtnl.marshal import MarshalRtnl class RawIPRSocketMixin(object): def __init__(self, fileno=None): super(RawIPRSocketMixin, self).__init__(NETLINK_ROUTE, fileno=fileno) self.marshal = MarshalRtnl() def bind(self, groups=rtnl.RTMGRP_DEFAULTS, **kwarg): super(RawIPRSocketMixin, self).bind(groups, **kwarg) class RawIPRSocket(RawIPRSocketMixin, NetlinkSocket): pass
29.263158
77
0.767986
62
556
6.709677
0.419355
0.115385
0.182692
0.120192
0
0
0
0
0
0
0
0.008403
0.143885
556
18
78
30.888889
0.865546
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.083333
0.333333
0
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
1
0
0
4
e285889f2e3b2ffcbbc82294049dd0be72f9d5f1
1,013
py
Python
zhixuewang/teacher/urls.py
lihaoze123/zhixuewang-python
7a54bb1ae96f74d3bb3a0845f3b084bb5942f758
[ "MIT" ]
22
2019-01-21T03:49:44.000Z
2020-02-13T08:43:01.000Z
zhixuewang/teacher/urls.py
lihaoze123/zhixuewang-python
7a54bb1ae96f74d3bb3a0845f3b084bb5942f758
[ "MIT" ]
10
2019-01-21T03:50:23.000Z
2020-01-03T13:06:49.000Z
zhixuewang/teacher/urls.py
lihaoze123/zhixuewang-python
7a54bb1ae96f74d3bb3a0845f3b084bb5942f758
[ "MIT" ]
3
2019-02-17T06:12:35.000Z
2019-10-29T13:24:06.000Z
from zhixuewang.urls import BASE_URL class Url: INFO_URL = f"{BASE_URL}/container/container/student/account/" CHANGE_PASSWORD_URL = f"{BASE_URL}/portalcenter/home/updatePassword/" TEST_URL = f"{BASE_URL}/container/container/teacher/teacherAccountNew" GET_EXAM_URL = f"{BASE_URL}/classreport/class/classReportList/" GET_AcademicTermTeachingCycle_URL = f"{BASE_URL}/classreport/class/getAcademicTermTeachingCycle/" GET_REPORT_URL = f"{BASE_URL}/exportpaper/class/getExportStudentInfo" GET_MARKING_PROGRESS_URL = f"{BASE_URL}/marking/marking/markingProgressDetail" GET_EXAM_DETAIL_URL = f"{BASE_URL}/scanmuster/cloudRec/scanrecognition" GET_EXAM_SCHOOLS_URL = f"{BASE_URL}/exam/marking/schoolClass" GET_EXAM_SUBJECTS_URL = f"{BASE_URL}/configure/class/getSubjectsIncludeSubAndGroup" #后必须接上paperId # ORIGINAL_PAPER_URL = f"{BASE_URL}/classreport/class/student/checksheet/?userId=" ORIGINAL_PAPER_URL = f"{BASE_URL}/classreport/class/student/checksheet/"
44.043478
101
0.78381
124
1,013
6.08871
0.370968
0.12053
0.127152
0.174834
0.299338
0.299338
0.150993
0.150993
0.150993
0.150993
0
0
0.105627
1,013
23
102
44.043478
0.833333
0.091807
0
0
0
0
0.57889
0.57889
0
0
0
0
0
1
0
false
0.076923
0.076923
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
1
0
0
1
0
0
4
e2a950f68a022f3db7e828101242b896367f18d0
184
py
Python
tests/test_07_left_panel.py
skostya64/Selenium_tasks
d7a01b0149aee543fa6278fd532a43afe571cf70
[ "Apache-2.0" ]
null
null
null
tests/test_07_left_panel.py
skostya64/Selenium_tasks
d7a01b0149aee543fa6278fd532a43afe571cf70
[ "Apache-2.0" ]
null
null
null
tests/test_07_left_panel.py
skostya64/Selenium_tasks
d7a01b0149aee543fa6278fd532a43afe571cf70
[ "Apache-2.0" ]
null
null
null
def test_check_left_panel(app): app.login(username="admin", password="admin") app.main_page.get_menu_items_list() app.main_page.check_all_admin_panel_items()
9.684211
49
0.711957
27
184
4.407407
0.62963
0.117647
0.184874
0
0
0
0
0
0
0
0
0
0.173913
184
18
50
10.222222
0.782895
0
0
0
0
0
0.058824
0
0
0
0
0
0
1
0.25
false
0.25
0
0
0.25
0
1
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
1
0
0
0
0
0
4
2c354ca792cf2e4db55a4069cfe0952baf84ba72
4,398
py
Python
conanfile.py
danimtb/conan-msys_installer
d5f9c1cbe6ef71035e25a26414858b55eb2011ff
[ "MIT" ]
null
null
null
conanfile.py
danimtb/conan-msys_installer
d5f9c1cbe6ef71035e25a26414858b55eb2011ff
[ "MIT" ]
null
null
null
conanfile.py
danimtb/conan-msys_installer
d5f9c1cbe6ef71035e25a26414858b55eb2011ff
[ "MIT" ]
null
null
null
from conans import ConanFile, tools import os class MsysBaseInstallerConan(ConanFile): name = "msys-base_installer" version = "2013072300" license = "http://www.mingw.org/license" url = "http://github.com/danimtb/conan-msys-installer" settings = "os", "compiler" build_policy = "missing" description = "Msys" build_requires = "7z_installer/1.0@conan/stable" def configure(self): if (self.settings.os != "Windows" and self.settings.compiler != "gcc"): raise Exception("Not valid configuration: %s, %s. %s should be used in Windows, gcc" % (self.settings.os, self.settings.compiler, self.name)) def build(self): files = { "msys-bash": "http://prdownloads.sourceforge.net/mingw/bash-3.1.23-1-msys-1.0.18-bin.tar.xz", "msys-bzip2": "http://prdownloads.sourceforge.net/mingw/bzip2-1.0.6-1-msys-1.0.17-bin.tar.lzma", "msys-bzip2-dll": "http://prdownloads.sourceforge.net/mingw/libbz2-1.0.6-1-msys-1.0.17-dll-1.tar.lzma", "msys-core": "http://prdownloads.sourceforge.net/mingw/msysCORE-1.0.19-1-msys-1.0.19-bin.tar.xz", "msys-core-ext": "http://prdownloads.sourceforge.net/mingw/msysCORE-1.0.19-1-msys-1.0.19-ext.tar.xz", "msys-core-lic": "http://prdownloads.sourceforge.net/mingw/msysCORE-1.0.19-1-msys-1.0.19-lic.tar.xz", "msys-core-doc": "http://prdownloads.sourceforge.net/mingw/msysCORE-1.0.19-1-msys-1.0.19-doc.tar.xz", "msys-coreutils": "http://prdownloads.sourceforge.net/mingw/coreutils-5.97-3-msys-1.0.13-bin.tar.lzma", "msys-diffutils": "http://prdownloads.sourceforge.net/mingw/diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin.tar.lzma", "msys-dos2unix": "http://prdownloads.sourceforge.net/mingw/dos2unix-7.3.2-1-msys-1.0.18-bin.tar.lzma", "msys-file": "http://prdownloads.sourceforge.net/mingw/file-5.04-1-msys-1.0.13-bin.tar.lzma", "msys-magic-dll": "http://prdownloads.sourceforge.net/mingw/libmagic-5.04-1-msys-1.0.13-dll-1.tar.lzma", "msys-findutils": "http://prdownloads.sourceforge.net/mingw/findutils-4.4.2-2-msys-1.0.13-bin.tar.lzma", "msys-gawk": "http://prdownloads.sourceforge.net/mingw/gawk-3.1.7-2-msys-1.0.13-bin.tar.lzma", "msys-grep": "http://prdownloads.sourceforge.net/mingw/grep-2.5.4-2-msys-1.0.13-bin.tar.lzma", "msys-gzip": "http://prdownloads.sourceforge.net/mingw/gzip-1.3.12-2-msys-1.0.13-bin.tar.lzma", "msys-less": "http://prdownloads.sourceforge.net/mingw/less-436-2-msys-1.0.13-bin.tar.lzma", "msys-libiconv": "http://prdownloads.sourceforge.net/mingw/libiconv-1.14-1-msys-1.0.17-dll-2.tar.lzma", "msys-libintl": "http://prdownloads.sourceforge.net/mingw/libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma", "msys-make": "http://prdownloads.sourceforge.net/mingw/make-3.81-3-msys-1.0.13-bin.tar.lzma", "msys-regex-dll": "http://prdownloads.sourceforge.net/mingw/libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma", "msys-sed": "http://prdownloads.sourceforge.net/mingw/sed-4.2.1-2-msys-1.0.13-bin.tar.lzma", "msys-tar": "http://prdownloads.sourceforge.net/mingw/tar-1.23-1-msys-1.0.13-bin.tar.lzma", "msys-termcap": "http://prdownloads.sourceforge.net/mingw/termcap-0.20050421_1-2-msys-1.0.13-bin.tar.lzma", "msys-termcap-dll": "http://prdownloads.sourceforge.net/mingw/libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma", "msys-texinfo": "http://prdownloads.sourceforge.net/mingw/texinfo-4.13a-2-msys-1.0.13-bin.tar.lzma", "msys-xz": "http://prdownloads.sourceforge.net/mingw/xz-5.0.3-1-msys-1.0.17-bin.tar.lzma", "msys-lzma-dll": "http://prdownloads.sourceforge.net/mingw/liblzma-5.0.3-1-msys-1.0.17-dll-5.tar.lzma", "msys-z-dll": "http://prdownloads.sourceforge.net/mingw/zlib-1.2.7-1-msys-1.0.17-dll.tar.lzma" } for util_name in files: tools.download(files[util_name], util_name) self.run("7z x %s" % util_name) self.run("7z x %s~" % util_name) os.unlink(util_name) os.unlink("%s~" % util_name) def package(self): self.copy("*", dst="", src=".") def package_info(self): self.env_info.path.append(os.path.join(self.package_folder, "bin"))
67.661538
153
0.64211
702
4,398
4
0.185185
0.025641
0.268519
0.299501
0.605413
0.371083
0.273504
0.260328
0.239672
0.095442
0
0.079656
0.15507
4,398
64
154
68.71875
0.675996
0
0
0
0
0.517857
0.669168
0.006594
0
0
0
0
0
1
0.071429
false
0
0.035714
0
0.267857
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
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
2c4e4b261a88afcb890a4de0d0a8d027edd43bd5
8,634
py
Python
web_site/wx/backends/dj.py
Fixdq/dj-deep
6712a722c7f620b76f21b1ebf0b618f42eb4a58a
[ "MIT" ]
null
null
null
web_site/wx/backends/dj.py
Fixdq/dj-deep
6712a722c7f620b76f21b1ebf0b618f42eb4a58a
[ "MIT" ]
null
null
null
web_site/wx/backends/dj.py
Fixdq/dj-deep
6712a722c7f620b76f21b1ebf0b618f42eb4a58a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on 2014-5-14 django 帮助函数 @author: skycrab @sns_userinfo def oauth(request): openid = request.openid """ import json import logging import base64 from functools import wraps from django.conf import settings from django.core.cache import cache from django.shortcuts import redirect, render_to_response from django.contrib.auth import login, logout, authenticate from rest_framework.authtoken.models import Token from core.redis_number import RedisStat from django.core.urlresolvers import reverse from .common import CommonHelper from wx import class_property, WeixinHelper from datetime import timedelta from django.utils import timezone from shop.models import ShopInfo from account.models import User import urllib, urlparse import time logger = logging.getLogger('control') class Helper(CommonHelper): """微信具体逻辑帮组类""" @class_property def cache(cls): """返回cache对象""" return cache @class_property def secret_key(cls): """返回cookie加密秘钥""" return settings.SECRET_KEY def sns_userinfo_proxy_callback(callback=None): """ 网页授权获取用户信息装饰器 callback(openid, userinfo): return user """ def wrap(func): @wraps(func) def inner(request, *args, **kwargs): if 'MicroMessenger' in request.META.get('HTTP_USER_AGENT', ''): shop = request.GET.get('shop', None) if not shop: response = func(request, *args, **kwargs) else: # 判断支付情况 if request.is_secure(): url = request.build_absolute_uri().replace('https://', 'http://') return redirect(url) unionid = request.session.get('unionid', '') timestamp_now = int(time.time()) ok, unionid = Helper.check_cookie(unionid) redis = RedisStat() if ok: # 判断微信用户token是否存在,如果不存在,则需要授权 redis_info = redis.get(unionid) if not redis_info: ok = False else: ws = json.loads(redis_info) if not ws['unionid']: ok = False if not ok: # unionid出错,重新授权 state = request.GET.get('state', None) if state: # aa|bb|cc aa:最近一级上级推客 bb:谁转发过来 cc:时间戳 state_list = urllib.unquote(state).split('|') if len(state_list) != 3: state = '0|0|%d' % timestamp_now else: state = '0|0|%d' % timestamp_now state += '|%s' % shop rs_id = redis.get('redirect_url_id') if rs_id: url_id = redis.incr('redirect_url_id') else: url_id = 1 redis.set('redirect_url_id', url_id) redis.set_ttl('redirect_url_id_%d' % url_id, request.build_absolute_uri(), 60) # 跳转到代理微信认证服务器 redirect_url = 'http://%s.control.binli360.com%s' % (shop, reverse('open:proxy_callback')) scope = 'snsapi_base' state = 'base|%s|%s' % (state, url_id) url = WeixinHelper.proxy(redirect_url, scope, state, 'mobile') return redirect(url) else: # 获取绑定的User对象 user = authenticate(unionid=unionid) if user: # token, goc = Token.objects.get_or_create(user=user) login(request, user) response = func(request, *args, **kwargs) # response.set_cookie(shop+'_key', token.key, path='/') response.set_cookie(shop, unionid, path='/') else: response = func(request, *args, **kwargs) else: response = func(request, *args, **kwargs) return response return inner return wrap sns_userinfo = sns_userinfo_proxy_callback() def sns_userinfo_proxy_test_callback(callback=None): """ 网页授权获取用户信息装饰器 callback(openid, userinfo): return user """ def wrap(func): @wraps(func) def inner(request, *args, **kwargs): if 'MicroMessenger' in request.META.get('HTTP_USER_AGENT', ''): # logger.debug('sns_userinfo_proxy_test_callback is wechat') shop = request.GET.get('shop', None) if not shop: response = func(request, *args, **kwargs) else: # 判断支付情况 if request.is_secure(): url = request.build_absolute_uri().replace('https://', 'http://') return redirect(url) unionid = request.session.get('unionid', '') timestamp_now = int(time.time()) ok, unionid = Helper.check_cookie(unionid) # logger.debug('sns_userinfo_proxy_test_callback sessino unionid is : %s' % unionid) redis = RedisStat() if ok: # 判断微信用户token是否存在,如果不存在,则需要授权 redis_info = redis.get(unionid) if not redis_info: ok = False else: ws = json.loads(redis_info) if not ws['unionid']: ok = False if not ok: # unionid出错,重新授权 state = request.GET.get('state', None) if state: # aa|bb|cc aa:最近一级上级推客 bb:谁转发过来 cc:时间戳 state_list = urllib.unquote(state).split('|') if len(state_list) != 3: state = '0|0|%d' % timestamp_now else: state = '0|0|%d' % timestamp_now state += '|%s' % shop rs_id = redis.get('redirect_url_id') if rs_id: url_id = redis.incr('redirect_url_id') else: url_id = 1 redis.set('redirect_url_id', url_id) redis.set_ttl('redirect_url_id_%d' % url_id, request.build_absolute_uri(), 60) # 跳转到代理微信认证服务器 redirect_url = 'http://%s.control.binli360.com%s' % (shop, reverse('open:proxy_callback_test')) scope = 'snsapi_base' state = 'base|%s|%s' % (state, url_id) url = WeixinHelper.proxy(redirect_url, scope, state, 'mobile') # logger.debug('sns_userinfo_proxy_test_callback redirect_url is %s' % url) return redirect(url) else: # logger.debug('sns_userinfo_proxy_test_callback unionid is : %s' % unionid) pass # 获取绑定的User对象 user = authenticate(unionid=unionid) if user: # token, goc = Token.objects.get_or_create(user=user) login(request, user) response = func(request, *args, **kwargs) # response.set_cookie(shop+'_key', token.key, path='/') response.set_cookie(shop, unionid, path='/') else: response = func(request, *args, **kwargs) else: response = func(request, *args, **kwargs) return response return inner return wrap sns_userinfo_test = sns_userinfo_proxy_test_callback()
39.788018
120
0.457378
782
8,634
4.88491
0.207161
0.02356
0.044503
0.048168
0.748953
0.736387
0.736387
0.69555
0.69555
0.69555
0
0.006771
0.452629
8,634
216
121
39.972222
0.801523
0.117443
0
0.780822
0
0
0.063167
0.003281
0
0
0
0
0
1
0.054795
false
0.006849
0.130137
0
0.273973
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
2c70f5ee336b36bda237297efa046d3ee2a8c63f
109
py
Python
job/celery_tasks/demo.py
RockFeng0/flask_demo
cf5631935de628f65c37f32aa7875cecc37f707b
[ "MIT" ]
null
null
null
job/celery_tasks/demo.py
RockFeng0/flask_demo
cf5631935de628f65c37f32aa7875cecc37f707b
[ "MIT" ]
null
null
null
job/celery_tasks/demo.py
RockFeng0/flask_demo
cf5631935de628f65c37f32aa7875cecc37f707b
[ "MIT" ]
1
2020-06-27T14:04:53.000Z
2020-06-27T14:04:53.000Z
#! python3 # -*- encoding: utf-8 -*- from job import celery @celery.task() def add(x, y): return x+y
9.909091
25
0.587156
17
109
3.764706
0.823529
0.0625
0
0
0
0
0
0
0
0
0
0.02381
0.229358
109
10
26
10.9
0.738095
0.302752
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
0
0
1
1
0
0
4
2c712ba3bbbd5dbef50c22c0533027e482779dd3
82
py
Python
config.py
outbreakdm/Dead-Matter-Discord-Bot-Player-Counter
c51335afa52aa01fc3ee037e29bbd79665af516a
[ "MIT" ]
null
null
null
config.py
outbreakdm/Dead-Matter-Discord-Bot-Player-Counter
c51335afa52aa01fc3ee037e29bbd79665af516a
[ "MIT" ]
null
null
null
config.py
outbreakdm/Dead-Matter-Discord-Bot-Player-Counter
c51335afa52aa01fc3ee037e29bbd79665af516a
[ "MIT" ]
null
null
null
BOT_TOKEN = "754938335214174210" SERVER_ADDRESS = ("192.154.227.44:7797", 27016)
20.5
47
0.743902
11
82
5.363636
1
0
0
0
0
0
0
0
0
0
0
0.513514
0.097561
82
3
48
27.333333
0.283784
0
0
0
0
0
0.45122
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
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
2c7ba2c92a4eb8e4a79941d83d6a59aa5150b61d
94
py
Python
server.py
yyc0309/watsonwork-github-issues
3377ff0fa87e5323165c7b2db9e9a3fc5da6ca50
[ "Apache-2.0" ]
null
null
null
server.py
yyc0309/watsonwork-github-issues
3377ff0fa87e5323165c7b2db9e9a3fc5da6ca50
[ "Apache-2.0" ]
7
2018-03-05T21:14:04.000Z
2018-03-09T23:16:37.000Z
server.py
yyc0309/watsonwork-github-issues
3377ff0fa87e5323165c7b2db9e9a3fc5da6ca50
[ "Apache-2.0" ]
null
null
null
from github_app import app app.run(host='0.0.0.0', port=int(app.config['PORT']), debug=True)
23.5
65
0.702128
19
94
3.421053
0.631579
0.092308
0.092308
0
0
0
0
0
0
0
0
0.046512
0.085106
94
3
66
31.333333
0.709302
0
0
0
0
0
0.117021
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
e2dbd8f583af2e25d8d0350376cb81880e383ce4
25
py
Python
src/tools/__init__.py
Talengi/phase
60ff6f37778971ae356c5b2b20e0d174a8288bfe
[ "MIT" ]
8
2016-01-29T11:53:40.000Z
2020-03-02T22:42:02.000Z
src/tools/__init__.py
PhaseDMS/phase
4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e
[ "MIT" ]
289
2015-03-23T07:42:52.000Z
2022-03-11T23:26:10.000Z
src/tools/__init__.py
Talengi/phase
60ff6f37778971ae356c5b2b20e0d174a8288bfe
[ "MIT" ]
7
2015-12-08T09:03:20.000Z
2020-05-11T15:36:51.000Z
"""Miscelanous tools."""
12.5
24
0.64
2
25
8
1
0
0
0
0
0
0
0
0
0
0
0
0.08
25
1
25
25
0.695652
0.72
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
3902e3c1d9f27314dcc2c50f2e8d39999e51a918
308
py
Python
python-algorithm/leetcode/problem_191.py
isudox/nerd-algorithm
c1fbe153953cf3fc24395f75d102016fdf9ea0fa
[ "MIT" ]
5
2017-06-11T09:19:34.000Z
2019-01-16T16:58:31.000Z
python-algorithm/leetcode/problem_191.py
isudox/leetcode-solution
60085e64deaf396a171367affc94b18114565c43
[ "MIT" ]
5
2020-03-22T13:53:54.000Z
2020-03-23T08:49:35.000Z
python-algorithm/leetcode/problem_191.py
isudox/nerd-algorithm
c1fbe153953cf3fc24395f75d102016fdf9ea0fa
[ "MIT" ]
1
2019-03-02T15:50:43.000Z
2019-03-02T15:50:43.000Z
"""191. Number of 1 Bits https://leetcode.com/problems/number-of-1-bits/ """ class Solution: def hammingWeight(self, n: int) -> int: def low_bit(x: int) -> int: return x & -x ans = 0 while n != 0: n -= low_bit(n) ans += 1 return ans
19.25
47
0.49026
43
308
3.465116
0.534884
0.107383
0.120805
0.174497
0
0
0
0
0
0
0
0.041237
0.37013
308
15
48
20.533333
0.726804
0.224026
0
0
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0
0.111111
0.555556
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
391330adf74bdbec8290fd413925031e57ebc29a
202
py
Python
venv/Lib/site-packages/Database/es/es_utils.py
jhonniel/Queuing-python
1b117dc7e4b3274b2f8fe72cce4beea363f563ef
[ "MIT" ]
null
null
null
venv/Lib/site-packages/Database/es/es_utils.py
jhonniel/Queuing-python
1b117dc7e4b3274b2f8fe72cce4beea363f563ef
[ "MIT" ]
null
null
null
venv/Lib/site-packages/Database/es/es_utils.py
jhonniel/Queuing-python
1b117dc7e4b3274b2f8fe72cce4beea363f563ef
[ "MIT" ]
null
null
null
def none_check(value): if value is None: return False else: return True def is_empty(any_type_value): if any_type_value: return False else: return True
15.538462
29
0.60396
28
202
4.142857
0.464286
0.12069
0.258621
0.362069
0.431034
0
0
0
0
0
0
0
0.346535
202
12
30
16.833333
0.878788
0
0
0.6
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0
0.6
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
1a3616b61cc48f65c6a7989293c9e978921dfdf8
55
py
Python
lrs/admin.py
ELSUru/ADL_LRS
aabeb9cf3e56795b148f37d07e1bb2b41e61e470
[ "Apache-2.0" ]
null
null
null
lrs/admin.py
ELSUru/ADL_LRS
aabeb9cf3e56795b148f37d07e1bb2b41e61e470
[ "Apache-2.0" ]
null
null
null
lrs/admin.py
ELSUru/ADL_LRS
aabeb9cf3e56795b148f37d07e1bb2b41e61e470
[ "Apache-2.0" ]
null
null
null
from util.util import autoregister autoregister('lrs')
18.333333
34
0.818182
7
55
6.428571
0.714286
0
0
0
0
0
0
0
0
0
0
0
0.090909
55
3
35
18.333333
0.9
0
0
0
0
0
0.053571
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
1a577854087d8ed49d83c5bd1d4c0683315c68ab
102
py
Python
setup.py
puhoy/django-s3file
6293e991feae77d7e18939770eecd264047bd7c3
[ "MIT" ]
null
null
null
setup.py
puhoy/django-s3file
6293e991feae77d7e18939770eecd264047bd7c3
[ "MIT" ]
null
null
null
setup.py
puhoy/django-s3file
6293e991feae77d7e18939770eecd264047bd7c3
[ "MIT" ]
null
null
null
#!/usr/bin/env python from setuptools import setup setup(name='django-s3file', use_scm_version=True)
20.4
49
0.784314
16
102
4.875
0.9375
0
0
0
0
0
0
0
0
0
0
0.010753
0.088235
102
4
50
25.5
0.827957
0.196078
0
0
0
0
0.160494
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
1a7c20d2c7403ba77a9361f7048f0edc3fee0e49
226
py
Python
webware/Tests/TestSessions/Transaction.py
PeaceWorksTechnologySolutions/w4py3
7f9e7088034e3e3ac53158edfa4f377b5b2f45fe
[ "MIT" ]
11
2020-10-18T07:33:56.000Z
2021-09-27T21:03:38.000Z
webware/Tests/TestSessions/Transaction.py
PeaceWorksTechnologySolutions/w4py3
7f9e7088034e3e3ac53158edfa4f377b5b2f45fe
[ "MIT" ]
9
2020-01-03T18:58:25.000Z
2020-01-09T18:36:23.000Z
webware/Tests/TestSessions/Transaction.py
PeaceWorksTechnologySolutions/w4py3
7f9e7088034e3e3ac53158edfa4f377b5b2f45fe
[ "MIT" ]
4
2020-06-30T09:41:56.000Z
2021-02-20T13:48:08.000Z
""""Mock Webware Transaction class.""" from .Application import Application class Transaction: def __init__(self): self._application = Application() def application(self): return self._application
17.384615
41
0.69469
22
226
6.863636
0.5
0.198676
0
0
0
0
0
0
0
0
0
0
0.212389
226
12
42
18.833333
0.848315
0.141593
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0.166667
0.833333
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
0
0
1
1
0
0
4
1a8a11ef27c7e2aabe226bd0f4e93280790db032
192
py
Python
1101-1200/1121-Divide Array Into Increasing Sequences/1121-Divide Array Into Increasing Sequences.py
jiadaizhao/LeetCode
4ddea0a532fe7c5d053ffbd6870174ec99fc2d60
[ "MIT" ]
49
2018-05-05T02:53:10.000Z
2022-03-30T12:08:09.000Z
1101-1200/1121-Divide Array Into Increasing Sequences/1121-Divide Array Into Increasing Sequences.py
jolly-fellow/LeetCode
ab20b3ec137ed05fad1edda1c30db04ab355486f
[ "MIT" ]
11
2017-12-15T22:31:44.000Z
2020-10-02T12:42:49.000Z
1101-1200/1121-Divide Array Into Increasing Sequences/1121-Divide Array Into Increasing Sequences.py
jolly-fellow/LeetCode
ab20b3ec137ed05fad1edda1c30db04ab355486f
[ "MIT" ]
28
2017-12-05T10:56:51.000Z
2022-01-26T18:18:27.000Z
import collections class Solution: def canDivideIntoSubsequences(self, nums: List[int], K: int) -> bool: return len(nums) >= K * max(v for v in collections.Counter(nums).values())
38.4
82
0.692708
26
192
5.115385
0.769231
0
0
0
0
0
0
0
0
0
0
0
0.177083
192
4
83
48
0.841772
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.25
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
1a994d2673e207331e66eaa0919c98e095dffbbc
169
py
Python
config/settings/local.py
MattE-J/django-drf
0471673a544dcf089dac6752689ac2ea7869e633
[ "MIT" ]
null
null
null
config/settings/local.py
MattE-J/django-drf
0471673a544dcf089dac6752689ac2ea7869e633
[ "MIT" ]
null
null
null
config/settings/local.py
MattE-J/django-drf
0471673a544dcf089dac6752689ac2ea7869e633
[ "MIT" ]
null
null
null
from .base import * SECRET_KEY = env('DJANGO_SECRET_KEY' , default='f8$t@ah-8n9fh%1@(&^or#8((8x#+h0^6!#spyf6egk1gs!si7') DEBUG = env.bool('DJANGO_DEBUG', default=True)
33.8
100
0.704142
29
169
3.965517
0.793103
0.156522
0
0
0
0
0
0
0
0
0
0.070968
0.08284
169
5
101
33.8
0.670968
0
0
0
0
0.333333
0.464706
0.294118
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
1aaace265db2e8442d60e8792192c99cd4ab024b
327
py
Python
vibhaga/test/demo_abstract.py
keremkoseoglu/vibhaga
6978ff55e5a6e945098e7127ce49cfef4b0747d0
[ "MIT" ]
null
null
null
vibhaga/test/demo_abstract.py
keremkoseoglu/vibhaga
6978ff55e5a6e945098e7127ce49cfef4b0747d0
[ "MIT" ]
3
2020-06-09T04:20:48.000Z
2022-03-31T12:44:59.000Z
vibhaga/test/demo_abstract.py
keremkoseoglu/vibhaga
6978ff55e5a6e945098e7127ce49cfef4b0747d0
[ "MIT" ]
null
null
null
""" Module for demo abstract class """ from abc import ABC, abstractmethod class DemoAbstract(ABC): """ Demo abstract class for testing purposes """ @abstractmethod def demo_abstract_method(self): """ Demo abstract method """ def demo_method(self): """ Demo concrete method """ pass
21.8
52
0.642202
36
327
5.75
0.472222
0.231884
0.164251
0
0
0
0
0
0
0
0
0
0.250765
327
14
53
23.357143
0.844898
0.35474
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0.166667
0.166667
0
0.666667
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
1ab6d73debd5df0f3ab75a30e6c5f37cb702dd35
177
py
Python
HW3/VeronyWise/task3,3.py
kolyasalubov/Lv-677.PythonCore
c9f9107c734a61e398154a90b8a3e249276c2704
[ "MIT" ]
null
null
null
HW3/VeronyWise/task3,3.py
kolyasalubov/Lv-677.PythonCore
c9f9107c734a61e398154a90b8a3e249276c2704
[ "MIT" ]
null
null
null
HW3/VeronyWise/task3,3.py
kolyasalubov/Lv-677.PythonCore
c9f9107c734a61e398154a90b8a3e249276c2704
[ "MIT" ]
6
2022-02-22T22:30:49.000Z
2022-03-28T12:51:19.000Z
variable1 = input('Variable 1:') variable2 = input('Variable 2:') variable1, variable2 = variable2, variable1 print(f"Variable 1: {variable1}") print(f"Variable 2: {variable2}")
35.4
43
0.734463
22
177
5.909091
0.363636
0.2
0.230769
0.353846
0
0
0
0
0
0
0
0.075472
0.101695
177
5
44
35.4
0.742138
0
0
0
0
0
0.382022
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
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
1acfdd5cb2dc4513136eed0af799bf76bf0968d8
105
py
Python
crawlerAPI/Stay_Hungry_API/apps.py
epikjjh/Stay_Hungry_Server
4d0ab3a2313c6a8f8a21053ced9834e7f2a13995
[ "MIT" ]
null
null
null
crawlerAPI/Stay_Hungry_API/apps.py
epikjjh/Stay_Hungry_Server
4d0ab3a2313c6a8f8a21053ced9834e7f2a13995
[ "MIT" ]
null
null
null
crawlerAPI/Stay_Hungry_API/apps.py
epikjjh/Stay_Hungry_Server
4d0ab3a2313c6a8f8a21053ced9834e7f2a13995
[ "MIT" ]
null
null
null
from django.apps import AppConfig class OsoricrawlerapiConfig(AppConfig): name = 'osoriCrawlerAPI'
17.5
39
0.790476
10
105
8.3
0.9
0
0
0
0
0
0
0
0
0
0
0
0.142857
105
5
40
21
0.922222
0
0
0
0
0
0.142857
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
46ca3bad392fc2171355c3c74fef7e69fc9669b7
116
py
Python
5 kyu/Memoized Fibonacci.py
mwk0408/codewars_solutions
9b4f502b5f159e68024d494e19a96a226acad5e5
[ "MIT" ]
6
2020-09-03T09:32:25.000Z
2020-12-07T04:10:01.000Z
5 kyu/Memoized Fibonacci.py
mwk0408/codewars_solutions
9b4f502b5f159e68024d494e19a96a226acad5e5
[ "MIT" ]
1
2021-12-13T15:30:21.000Z
2021-12-13T15:30:21.000Z
5 kyu/Memoized Fibonacci.py
mwk0408/codewars_solutions
9b4f502b5f159e68024d494e19a96a226acad5e5
[ "MIT" ]
null
null
null
def fibonacci(n, res=[0,1]): if len(res)<=n: res.append(fibonacci(n-1)+fibonacci(n-2)) return res[n]
29
49
0.586207
21
116
3.238095
0.52381
0.441176
0
0
0
0
0
0
0
0
0
0.043011
0.198276
116
4
50
29
0.688172
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
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
1
0
0
0
0
0
0
0
4
46fba1205b8f8301a0c377be60303c38d5a02559
3,434
py
Python
imdb/imdb.py
santhoshse7en/IMDb
c76cfa3fc9a1326587707dbab3800d0e9a32d045
[ "MIT" ]
1
2019-09-09T08:46:11.000Z
2019-09-09T08:46:11.000Z
imdb/imdb.py
santhoshse7en/imdby
c76cfa3fc9a1326587707dbab3800d0e9a32d045
[ "MIT" ]
13
2019-05-24T05:17:03.000Z
2019-05-29T12:19:18.000Z
imdb/imdb.py
santhoshse7en/imdby
c76cfa3fc9a1326587707dbab3800d0e9a32d045
[ "MIT" ]
null
null
null
# Movie Related Information from imdb.parser.character.search_character_id import search_character_id from imdb.parser.company.search_company_id import search_company_id from imdb.parser.event.search_event_id import search_event_id from imdb.parser.movie.company import company from imdb.parser.movie.critic_reviews import critic_reviews from imdb.parser.movie.external_reviews import external_reviews from imdb.parser.movie.external_sites import external_sites from imdb.parser.movie.full_cast_and_crew import full_cast_and_crew from imdb.parser.movie.imdb_charts import imdb_charts from imdb.parser.movie.movie import movie from imdb.parser.movie.parental_guide import parental_guide from imdb.parser.movie.plot import plot from imdb.parser.movie.plot_keywords import plot_keywords from imdb.parser.movie.ratings import ratings from imdb.parser.movie.release_info import release_info from imdb.parser.movie.search_title_id import search_title_id from imdb.parser.movie.taglines import taglines from imdb.parser.movie.technical_spec import technical_spec from imdb.parser.movie.top_india_charts import top_india_charts from imdb.parser.movie.trending_now_in_india import trending_now_in_india from imdb.parser.movie.upcoming_releases import upcoming_releases from imdb.parser.movie.user_reviews import user_reviews from imdb.parser.news.search_news_id import search_news_id from imdb.parser.person.search_person_id import search_person_id class IMDb: """ :returns: Search IMDb ID about Movies, Person, Company, Event, Character, News """ def search_movie(self, text): return search_title_id(text) def search_person(self, text): return search_person_id(text) def search_company(self, text): return search_company_id(text) def search_event(self, text): return search_event_id(text) def search_character(self, text): return search_character_id(text) def search_news(self, text): return search_news_id(text) """ :returns: Parser contains all kind of movie information """ def company(self, title_id): return company(title_id) def critic_reviews(self, title_id): return critic_reviews(title_id) def external_reviews(self, title_id): return external_reviews(title_id) def external_sites(self, title_id): return external_sites(title_id) def full_cast_and_crew(self, title_id): return full_cast_and_crew(title_id) def imdb_charts(self): return imdb_charts() def movie(self, title_id): return movie(title_id) def parental_guide(self, title_id): return parental_guide(title_id) def plot(self, title_id): return plot(title_id) def plot_keywords(self, title_id): return plot_keywords(title_id) def ratings(self, title_id): return ratings(title_id) def release_info(self, title_id): return release_info(title_id) def taglines(self, title_id): return taglines(title_id) def technical_spec(self, title_id): return technical_spec(title_id) def top_india_charts(self): return top_india_charts() def trending_now_in_india(self): return trending_now_in_india() def upcoming_releases(self): return upcoming_releases() def user_reviews(self, title_id, remove_spoiler): return user_reviews(title_id, remove_spoiler)
31.796296
82
0.761503
498
3,434
4.961847
0.11245
0.087819
0.135977
0.146095
0.153379
0.027519
0
0
0
0
0
0
0.169482
3,434
108
83
31.796296
0.86641
0.030577
0
0
0
0
0
0
0
0
0
0
0
1
0.328767
false
0
0.328767
0.328767
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
20199c75685354f03349a09a3834f7b34b31bc25
103
py
Python
LeetCode/python3/1025.py
ZintrulCre/LeetCode_Archiver
de23e16ead29336b5ee7aa1898a392a5d6463d27
[ "MIT" ]
279
2019-02-19T16:00:32.000Z
2022-03-23T12:16:30.000Z
LeetCode/python3/1025.py
ZintrulCre/LeetCode_Archiver
de23e16ead29336b5ee7aa1898a392a5d6463d27
[ "MIT" ]
2
2019-03-31T08:03:06.000Z
2021-03-07T04:54:32.000Z
LeetCode/python3/1025.py
ZintrulCre/LeetCode_Crawler
de23e16ead29336b5ee7aa1898a392a5d6463d27
[ "MIT" ]
12
2019-01-29T11:45:32.000Z
2019-02-04T16:31:46.000Z
class Solution: def divisorGame(self, N: int) -> bool: return True if N % 2 == 0 else False
34.333333
44
0.61165
16
103
3.9375
0.9375
0
0
0
0
0
0
0
0
0
0
0.027027
0.281553
103
3
44
34.333333
0.824324
0
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.333333
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
203d31bf82b5024f824101b94407bc8945c5c669
142
py
Python
app/model/message.py
godraadam/privy-router
05628e8744cbe26a19cf7c45b119eacb675402d4
[ "MIT" ]
null
null
null
app/model/message.py
godraadam/privy-router
05628e8744cbe26a19cf7c45b119eacb675402d4
[ "MIT" ]
null
null
null
app/model/message.py
godraadam/privy-router
05628e8744cbe26a19cf7c45b119eacb675402d4
[ "MIT" ]
null
null
null
from pydantic import BaseModel class PrivyMessage(BaseModel): recipient_alias: str # alias of recipient message: str # the message
17.75
45
0.753521
17
142
6.235294
0.705882
0
0
0
0
0
0
0
0
0
0
0
0.197183
142
7
46
20.285714
0.929825
0.211268
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.25
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
0
0
1
0
0
4
2046584bfc0657c5aba655a2373df7d1dfcd4130
90
py
Python
backdriveb2/api/objects/__init__.py
Joffreybvn/backdriveb2
bf6098a45aacbdad6a0ff95c45ff141a2bcf7e1c
[ "MIT" ]
null
null
null
backdriveb2/api/objects/__init__.py
Joffreybvn/backdriveb2
bf6098a45aacbdad6a0ff95c45ff141a2bcf7e1c
[ "MIT" ]
null
null
null
backdriveb2/api/objects/__init__.py
Joffreybvn/backdriveb2
bf6098a45aacbdad6a0ff95c45ff141a2bcf7e1c
[ "MIT" ]
null
null
null
from .account import Account from .bucket import Bucket __all__ = ["Account", "Bucket"]
15
31
0.733333
11
90
5.636364
0.454545
0
0
0
0
0
0
0
0
0
0
0
0.155556
90
5
32
18
0.815789
0
0
0
0
0
0.146067
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
2057865edd4337026cdfafcc62a8e73e95d64e8e
274
py
Python
ehub/conftest.py
teofiln/ehub
8412ac878f80bfbba2d4b2b44d895cfa07c44319
[ "MIT" ]
null
null
null
ehub/conftest.py
teofiln/ehub
8412ac878f80bfbba2d4b2b44d895cfa07c44319
[ "MIT" ]
null
null
null
ehub/conftest.py
teofiln/ehub
8412ac878f80bfbba2d4b2b44d895cfa07c44319
[ "MIT" ]
null
null
null
import pytest from ehub.users.models import User from ehub.users.tests.factories import UserFactory @pytest.fixture(autouse=True) def media_storage(settings, tmpdir): settings.MEDIA_ROOT = tmpdir.strpath @pytest.fixture def user() -> User: return UserFactory()
18.266667
50
0.770073
36
274
5.805556
0.583333
0.076555
0.124402
0
0
0
0
0
0
0
0
0
0.135037
274
14
51
19.571429
0.881857
0
0
0
0
0
0
0
0
0
0
0
0
1
0.222222
false
0
0.333333
0.111111
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
6447533b56e44b1bd8d4cefebf7b0330a82c8a36
17,428
py
Python
scripts/search/agr_mapping.py
dougli1sqrd/SGDBackend-Nex2
2ecb2436db142cf08c6f2dbab6b115a394116632
[ "MIT" ]
5
2015-11-24T23:09:46.000Z
2019-11-06T17:48:13.000Z
scripts/search/agr_mapping.py
dougli1sqrd/SGDBackend-Nex2
2ecb2436db142cf08c6f2dbab6b115a394116632
[ "MIT" ]
188
2017-08-28T22:39:03.000Z
2022-03-02T14:53:46.000Z
scripts/search/agr_mapping.py
dougli1sqrd/SGDBackend-Nex2
2ecb2436db142cf08c6f2dbab6b115a394116632
[ "MIT" ]
7
2018-05-13T01:58:07.000Z
2021-06-25T19:08:33.000Z
mapping = { "settings": { "index": { "max_result_window": 15000, "analysis": { "analyzer": { "default": { "type": "custom", "tokenizer": "whitespace", "filter": ["english_stemmer", "lowercase"] }, "autocomplete": { "type": "custom", "tokenizer": "whitespace", "filter": ["lowercase", "autocomplete_filter"] }, "symbols": { "type": "custom", "tokenizer": "whitespace", "filter": ["lowercase"] } }, "filter": { "english_stemmer": { "type": "stemmer", "language": "english" }, "autocomplete_filter": { "type": "edge_ngram", "min_gram": "1", "max_gram": "20" } } }, "number_of_replicas": "1", #temporarily "number_of_shards": "5" } }, "mappings": { # having a raw field means it can be a facet or sorted by "searchable_item": { "properties": { "name": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" }, "autocomplete": { "type": "string", "analyzer": "autocomplete" } } }, "category": { "type": "string", "analyzer": "symbols" }, "href": { "type": "string", "analyzer": "symbols" }, "description": { "type": "string" }, "first_name": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "last_name": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "institution": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "position": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "country": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "state": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "colleague_loci": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "number_annotations": { "type": "integer" }, "feature_type": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "name_description": { "type": "string" }, "summary": { "type": "string" }, "phenotypes": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" } } }, "cellular_component": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "biological_process": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "molecular_function": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "ec_number": { "type": "string", "analyzer": "symbols" }, "protein": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" } } }, "tc_number": { "type": "string", "analyzer": "symbols" }, "secondary_sgdid": { "type": "string", "analyzer": "symbols" }, "sequence_history": { "type": "string", "analyzer": "symbols" }, "gene_history": { "type": "string", "analyzer": "symbols" }, "bioentity_id": { "type": "string", "analyzer": "symbols" }, "keys": { "type": "string", "analyzer": "symbols" }, "status": { "type": "string", "analyzer": "symbols", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "observable": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "qualifier": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "references": { "type": "string", "analyzer": "symbols", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "phenotype_loci": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "chemical": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "mutant_type": { "type": "string", "fields": { "symbol": { "type": "string", "analyzer": "symbols" }, "raw": { "type": "string", "index": "not_analyzed" } } }, "synonyms": { "type": "string" }, "go_id": { "type": "string", "analyzer": "symbols" }, "go_loci": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "author": { "type": "string", "analyzer": "symbols", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "journal": { "type": "string", "analyzer": "symbols", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "year": { "type": "string", "analyzer": "symbols", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "reference_loci": { "type": "string", "analyzer": "symbols", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }, "aliases": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "format": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "keyword": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "file_size": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "readme_url": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "topic": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "data": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } }, "is_quick_flag": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" }, "symbol": { "type": "string", "analyzer": "symbols" } } } } } } }
34.105675
75
0.204441
622
17,428
5.615756
0.181672
0.294875
0.200973
0.271973
0.737189
0.675637
0.650444
0.650444
0.623533
0.572001
0
0.001823
0.685334
17,428
510
76
34.172549
0.63512
0.003844
0
0.542339
0
0
0.201452
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
1
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
64b06d39035e35021652b98bd685aa742c7ae018
66
py
Python
source/tweaks/__init__.py
mverleg/svsite
5c9dbcacf81020cf0c1960e337bdd33113acd597
[ "BSD-3-Clause" ]
null
null
null
source/tweaks/__init__.py
mverleg/svsite
5c9dbcacf81020cf0c1960e337bdd33113acd597
[ "BSD-3-Clause" ]
142
2015-06-05T07:53:09.000Z
2020-03-31T18:37:07.000Z
source/tweaks/__init__.py
mdilli/svsite
5c9dbcacf81020cf0c1960e337bdd33113acd597
[ "BSD-3-Clause" ]
null
null
null
""" Changes to the defaults of ``django``, ``djangocms``, etc. """
22
58
0.606061
8
66
5
1
0
0
0
0
0
0
0
0
0
0
0
0.136364
66
3
59
22
0.701754
0.878788
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
64d790a54760f91efa2b838551ebcdc4ea2e8758
72
py
Python
src/main.py
EfficientElevator/Simulation
fdbb479aa907c26999715e132aff0a40d9bdf892
[ "MIT" ]
1
2020-01-30T16:29:51.000Z
2020-01-30T16:29:51.000Z
src/main.py
EfficientElevator/Simulation
fdbb479aa907c26999715e132aff0a40d9bdf892
[ "MIT" ]
17
2020-01-14T16:48:53.000Z
2020-04-20T17:58:44.000Z
src/main.py
EfficientElevator28/Simulation
fdbb479aa907c26999715e132aff0a40d9bdf892
[ "MIT" ]
null
null
null
""" Author: Sean Toll Test simulation functionality """ print("Test")
9
29
0.694444
8
72
6.25
0.875
0
0
0
0
0
0
0
0
0
0
0
0.152778
72
7
30
10.285714
0.819672
0.652778
0
0
0
0
0.25
0
0
0
0
0
0
1
0
true
0
0
0
0
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
4
b3bc9655cec3454fb8290cc9ec39072f8654231f
82
py
Python
python/testData/docstrings/googleNoClosingParenthesisAfterParamType.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2019-04-28T07:48:50.000Z
2020-12-11T14:18:08.000Z
python/testData/docstrings/googleNoClosingParenthesisAfterParamType.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
173
2018-07-05T13:59:39.000Z
2018-08-09T01:12:03.000Z
python/testData/docstrings/googleNoClosingParenthesisAfterParamType.py
jnthn/intellij-community
8fa7c8a3ace62400c838e0d5926a7be106aa8557
[ "Apache-2.0" ]
2
2020-03-15T08:57:37.000Z
2020-04-07T04:48:14.000Z
def f(x, y): """ Args: x (Foo y (Bar : description """
13.666667
28
0.353659
10
82
2.9
0.8
0
0
0
0
0
0
0
0
0
0
0
0.47561
82
6
29
13.666667
0.674419
0.5
0
0
0
0
0
0
0
0
0
0
0
1
1
false
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
b3daaedddba54c9f389ca1ec586ac8d5df49336a
1,381
py
Python
python/test/test_spreadsheet_api.py
dlens/dlxapi
189a6519240ce625d7a9cdb89e305a335d2aa045
[ "MIT" ]
null
null
null
python/test/test_spreadsheet_api.py
dlens/dlxapi
189a6519240ce625d7a9cdb89e305a335d2aa045
[ "MIT" ]
1
2020-08-20T17:31:43.000Z
2020-08-20T17:31:43.000Z
python/test/test_spreadsheet_api.py
dlens/dlxapi
189a6519240ce625d7a9cdb89e305a335d2aa045
[ "MIT" ]
null
null
null
# coding: utf-8 """ Decision Lens API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import dlxapi from dlxapi.api.spreadsheet_api import SpreadsheetApi # noqa: E501 from dlxapi.rest import ApiException class TestSpreadsheetApi(unittest.TestCase): """SpreadsheetApi unit test stubs""" def setUp(self): self.api = dlxapi.api.spreadsheet_api.SpreadsheetApi() # noqa: E501 def tearDown(self): pass def test_create_spreadsheet(self): """Test case for create_spreadsheet """ pass def test_create_spreadsheet_for_kloudless_file(self): """Test case for create_spreadsheet_for_kloudless_file """ pass def test_delete_spreadsheet(self): """Test case for delete_spreadsheet Delete spreadsheet and mappings # noqa: E501 """ pass def test_get_mappings_for_spreadsheet(self): """Test case for get_mappings_for_spreadsheet """ pass def test_get_spreadsheet(self): """Test case for get_spreadsheet """ pass if __name__ == '__main__': unittest.main()
20.924242
119
0.666908
160
1,381
5.50625
0.35625
0.039728
0.062429
0.085131
0.354143
0.224745
0.086266
0
0
0
0
0.014437
0.247647
1,381
65
120
21.246154
0.833494
0.414917
0
0.272727
1
0
0.010944
0
0
0
0
0
0
1
0.318182
false
0.272727
0.227273
0
0.590909
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
b3ef0f6b300b19a75f79345e97a807ae11d3fb46
3,182
py
Python
functions/include/serializer.py
xyclin/fluent
f1dcede5d4b7d6eab722180129dbb5aff4241621
[ "Apache-2.0" ]
1,164
2018-07-25T23:17:07.000Z
2019-07-11T20:33:52.000Z
functions/include/serializer.py
longwutianya/fluent
c8fc9f2dd781e5ed91c34351adc6a101cc383083
[ "Apache-2.0" ]
126
2018-07-25T22:41:53.000Z
2019-07-10T21:49:19.000Z
functions/include/serializer.py
longwutianya/fluent
c8fc9f2dd781e5ed91c34351adc6a101cc383083
[ "Apache-2.0" ]
178
2018-07-25T23:17:11.000Z
2019-07-10T02:45:27.000Z
# Copyright 2018 U.C. Berkeley RISE Lab # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import cloudpickle as cp import pyarrow as pa import codecs from io import BytesIO import numpy as np from .functions_pb2 import * from . import shared SER_FORMAT = 'raw_unicode_escape' class Serializer(): def __init__(self): raise NotImplementedError('Cannot instantiate abstract class.') def _serialize(self, msg): pass def _deserialize(self, msg): pass def dump(self, msg): pass def load(self, msg): pass class DefaultSerializer(Serializer): def __init__(self): pass def _serialize(msg): return msg def _deserialize(self, msg): return msg def dump(self, msg): return cp.dumps(msg) def load(self, msg): return cp.loads(msg) class StringSerializer(Serializer): def __init__(self): pass def _serialize(self, msg): return codecs.decode(msg, SER_FORMAT) def _deserialize(self, msg): return codecs.encode(msg, SER_FORMAT) def dump(self, msg): return self._serialize(cp.dumps(msg)) def load(self, msg): return cp.loads(self._deserialize(msg)) # TODO: how can we make serializers pluggable? class NumpySerializer(DefaultSerializer): def __init__(self): pass def dump(self, msg): return pa.serialize(msg).to_buffer().to_pybytes() def load(self, msg): return pa.deserialize(msg) numpy_ser = NumpySerializer() default_ser = DefaultSerializer() string_ser = StringSerializer() function_ser = default_ser def get_serializer(kind): global numpy_ser, default_ser, string_ser if kind == NUMPY: return numpy_ser elif kind == STRING: return string_ser elif kind == DEFAULT: return default_ser else: return default_ser def serialize_val(val, valobj=None, serialize=True): if not valobj: valobj = Value() if isinstance(val, shared.FluentFuture): valobj.body = default_ser.dump(shared.FluentReference(val.obj_id, True, LWW)) elif isinstance(val, np.ndarray): valobj.body = numpy_ser.dump(val) valobj.type = NUMPY else: valobj.body = default_ser.dump(val) if not serialize: return valobj return valobj.SerializeToString() def deserialize_val(val): v = Value() v.ParseFromString(val) if v.type == DEFAULT: return default_ser.load(v.body) elif v.type == STRING: return string_ser.load(v.body) elif v.type == NUMPY: return numpy_ser.load(v.body)
22.892086
75
0.660905
413
3,182
4.961259
0.346247
0.044412
0.057101
0.02733
0.197657
0.092728
0.092728
0.036115
0.036115
0.036115
0
0.003782
0.252043
3,182
138
76
23.057971
0.857143
0.192646
0
0.352941
0
0
0.020368
0
0
0
0
0.007246
0
1
0.247059
false
0.082353
0.082353
0.117647
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
b6124c267a7355fff279f80fee851b3b716a05f0
458
py
Python
Python/stack.py
uday256071/DataStructures-and-Algorithms
d5740a27a8e4141616307ec3771bc7ad95ff9f72
[ "MIT" ]
null
null
null
Python/stack.py
uday256071/DataStructures-and-Algorithms
d5740a27a8e4141616307ec3771bc7ad95ff9f72
[ "MIT" ]
null
null
null
Python/stack.py
uday256071/DataStructures-and-Algorithms
d5740a27a8e4141616307ec3771bc7ad95ff9f72
[ "MIT" ]
null
null
null
class Stack(): def __init__(self): self.items=[] def isEmpty(self): return self.items==[] def push(self,item): self.items.append(item) def pop(self): return self.items.pop() def peek(self): return self.items[-1] def size(self): return len(self.items) s=Stack() s.isEmpty() s.push(5) s.push(56) s.push('sdfg') s.push(9) print(s.peek()) print(s.pop()) print(s.peek()) print(s.size())
16.357143
31
0.572052
70
458
3.685714
0.314286
0.209302
0.162791
0.22093
0.124031
0
0
0
0
0
0
0.014368
0.240175
458
27
32
16.962963
0.727011
0
0
0.086957
0
0
0.008772
0
0
0
0
0
0
1
0.26087
false
0
0
0.173913
0.478261
0.173913
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
374bb3040645d3989e57f95ec9ffc9f744b8af59
179
py
Python
examples/helpers/post/unlike.py
javad94/instauto
8d4d068863176b0a1df13e5be3d5e32388036921
[ "MIT" ]
79
2020-08-24T23:32:57.000Z
2022-02-20T19:03:17.000Z
examples/helpers/post/unlike.py
klaytonpaiva/instauto
7f8c26b22f84d3d966625c7fa656e91cc623bb2e
[ "MIT" ]
146
2020-07-25T16:27:48.000Z
2021-10-02T09:03:50.000Z
examples/helpers/post/unlike.py
klaytonpaiva/instauto
7f8c26b22f84d3d966625c7fa656e91cc623bb2e
[ "MIT" ]
41
2020-09-07T14:19:04.000Z
2022-02-07T23:08:10.000Z
from instauto.api.client import ApiClient from instauto.helpers.post import unlike_post client = ApiClient.initiate_from_file('.instauto.save') unlike_post(client, "media_id")
25.571429
55
0.815642
25
179
5.64
0.56
0.170213
0.22695
0
0
0
0
0
0
0
0
0
0.089385
179
6
56
29.833333
0.865031
0
0
0
0
0
0.123596
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
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
1
0
0
0
0
4
374f08a2bd0965255d3871d9a77cdb705b2dfb08
224
py
Python
apps/wiki/admin.py
karpiq24/django-klima-kar
e62e79c66053749e249f55e1ab47f810f449f0aa
[ "MIT" ]
2
2018-01-23T22:38:57.000Z
2019-07-14T08:59:19.000Z
apps/wiki/admin.py
karpiq24/django-klima-kar
e62e79c66053749e249f55e1ab47f810f449f0aa
[ "MIT" ]
237
2018-08-15T23:13:52.000Z
2022-01-13T13:08:50.000Z
apps/wiki/admin.py
karpiq24/django-klima-kar
e62e79c66053749e249f55e1ab47f810f449f0aa
[ "MIT" ]
null
null
null
from django.contrib import admin from apps.wiki.models import Article, Tag, ExternalLink, ArticleFile admin.site.register(Article) admin.site.register(Tag) admin.site.register(ExternalLink) admin.site.register(ArticleFile)
28
68
0.830357
30
224
6.2
0.466667
0.193548
0.365591
0
0
0
0
0
0
0
0
0
0.071429
224
7
69
32
0.894231
0
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
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
1
0
1
0
0
0
0
4
375235f443ccc25c0883b3f00cf92f6d6e16776c
157
py
Python
problemas/1100/1144.py
filimor/uri-online-judge
08b3bae3e02cc35ba8f6fba869d643ba3d028e58
[ "MIT" ]
10
2020-07-05T04:56:09.000Z
2022-03-23T00:25:02.000Z
problemas/1100/1144.py
filimor/uri-online-judge
08b3bae3e02cc35ba8f6fba869d643ba3d028e58
[ "MIT" ]
1
2021-12-30T05:18:59.000Z
2021-12-30T05:18:59.000Z
problemas/1100/1144.py
filimor/uri-online-judge
08b3bae3e02cc35ba8f6fba869d643ba3d028e58
[ "MIT" ]
5
2020-03-23T09:43:40.000Z
2022-02-04T13:07:29.000Z
for i in range(1, int(input()) + 1): quadrado = i ** 2 cubo = i ** 3 print(f'{i} {quadrado} {cubo}') print(f'{i} {quadrado + 1} {cubo + 1}')
26.166667
43
0.490446
26
157
2.961538
0.5
0.155844
0.181818
0.38961
0
0
0
0
0
0
0
0.052632
0.273885
157
5
44
31.4
0.622807
0
0
0
0
0
0.318471
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
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
3794ed2744f1e9cb2f1c9f008aeaf5a48cae917c
79
py
Python
singletons/mail.py
kwestpharedhat/quay
a0df895005bcd3e53847046f69f6a7add87c88fd
[ "Apache-2.0" ]
null
null
null
singletons/mail.py
kwestpharedhat/quay
a0df895005bcd3e53847046f69f6a7add87c88fd
[ "Apache-2.0" ]
null
null
null
singletons/mail.py
kwestpharedhat/quay
a0df895005bcd3e53847046f69f6a7add87c88fd
[ "Apache-2.0" ]
null
null
null
from flask_mail import Mail from singletons.app import _app mail = Mail(_app)
15.8
31
0.797468
13
79
4.615385
0.461538
0
0
0
0
0
0
0
0
0
0
0
0.151899
79
4
32
19.75
0.895522
0
0
0
0
0
0
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
8086a65cb78ca3eae82df3569f6ecdb2885f115e
204
py
Python
tools/check_encrypted_hash.py
airladon/ThisIGet
e54058056ed593ff1097ef4505a5ce97ea09d94b
[ "BSD-3-Clause" ]
5
2020-06-19T22:06:16.000Z
2022-02-06T17:13:14.000Z
tools/check_encrypted_hash.py
airladon/ThisIGet
e54058056ed593ff1097ef4505a5ce97ea09d94b
[ "BSD-3-Clause" ]
3
2021-03-09T00:43:58.000Z
2021-06-15T17:44:22.000Z
tools/check_encrypted_hash.py
airladon/ThisIGet
e54058056ed593ff1097ef4505a5ce97ea09d94b
[ "BSD-3-Clause" ]
null
null
null
import sys sys.path.insert(0, './app/app') from tools import decrypt, check_hash # noqa # sys.argv[1] = plain text # sys.argv[2] = hash to compare print(check_hash(sys.argv[1], decrypt(sys.argv[2])))
25.5
52
0.691176
36
204
3.861111
0.555556
0.201439
0.115108
0
0
0
0
0
0
0
0
0.028409
0.137255
204
7
53
29.142857
0.761364
0.289216
0
0
0
0
0.06383
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.25
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
809ef4ffa07e480d7b2e767240e3be82449c7ee9
82
py
Python
Python/04. Sets/006. Set union() Operation.py
stonehengee/HackerrankPractice
ec052e7447391e40d1919cf0b641ff5023da3da3
[ "MIT" ]
null
null
null
Python/04. Sets/006. Set union() Operation.py
stonehengee/HackerrankPractice
ec052e7447391e40d1919cf0b641ff5023da3da3
[ "MIT" ]
null
null
null
Python/04. Sets/006. Set union() Operation.py
stonehengee/HackerrankPractice
ec052e7447391e40d1919cf0b641ff5023da3da3
[ "MIT" ]
null
null
null
# Problem: https://www.hackerrank.com/challenges/py-set-union/problem # Score: 10
27.333333
69
0.756098
12
82
5.166667
0.916667
0
0
0
0
0
0
0
0
0
0
0.026316
0.073171
82
2
70
41
0.789474
0.939024
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
809f0a2dcf94026faf4117b1a4863d6f038ab4bf
137
py
Python
fun/vowel_counter.py
ahmedelq/PythonicAlgorithms
ce10dbb6e1fd0ea5c922a932b0f920236aa411bf
[ "MIT" ]
null
null
null
fun/vowel_counter.py
ahmedelq/PythonicAlgorithms
ce10dbb6e1fd0ea5c922a932b0f920236aa411bf
[ "MIT" ]
null
null
null
fun/vowel_counter.py
ahmedelq/PythonicAlgorithms
ce10dbb6e1fd0ea5c922a932b0f920236aa411bf
[ "MIT" ]
null
null
null
def count_vowels(txt): vs = "a, e, i, o, u".split(', ') return sum([1 for t in txt if t in vs]) print(count_vowels('Hello world'))
19.571429
40
0.605839
27
137
3
0.777778
0.271605
0
0
0
0
0
0
0
0
0
0.009174
0.20438
137
7
41
19.571429
0.733945
0
0
0
0
0
0.188406
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0.25
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
1
0
0
0
0
0
0
0
4
809f5c8d05928489dbd0063155d53bd8866d8342
75,667
py
Python
Lib/site-packages/OCC/Convert.py
JWerbrouck/RWTH_M1_Projekt
7ae63a2277361fa3273cf0677b297379482b8240
[ "bzip2-1.0.6" ]
null
null
null
Lib/site-packages/OCC/Convert.py
JWerbrouck/RWTH_M1_Projekt
7ae63a2277361fa3273cf0677b297379482b8240
[ "bzip2-1.0.6" ]
1
2022-03-17T16:46:04.000Z
2022-03-17T16:46:04.000Z
Lib/site-packages/OCC/Convert.py
JWerbrouck/RWTH_M1_Projekt
7ae63a2277361fa3273cf0677b297379482b8240
[ "bzip2-1.0.6" ]
null
null
null
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.1 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (3,0,0): new_instancemethod = lambda func, inst, cls: _Convert.SWIG_PyInstanceMethod_New(func) else: from new import instancemethod as new_instancemethod if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_Convert', [dirname(__file__)]) except ImportError: import _Convert return _Convert if fp is not None: try: _mod = imp.load_module('_Convert', fp, pathname, description) finally: fp.close() return _mod _Convert = swig_import_helper() del swig_import_helper else: import _Convert del version_info try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) try: _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 def _swig_setattr_nondynamic_method(set): def set_attr(self,name,value): if (name == "thisown"): return self.this.own(value) if hasattr(self,name) or (name == "this"): set(self,name,value) else: raise AttributeError("You cannot add attributes to %s" % self) return set_attr class SwigPyIterator(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract") __repr__ = _swig_repr __swig_destroy__ = _Convert.delete_SwigPyIterator def __iter__(self): return self SwigPyIterator.value = new_instancemethod(_Convert.SwigPyIterator_value,None,SwigPyIterator) SwigPyIterator.incr = new_instancemethod(_Convert.SwigPyIterator_incr,None,SwigPyIterator) SwigPyIterator.decr = new_instancemethod(_Convert.SwigPyIterator_decr,None,SwigPyIterator) SwigPyIterator.distance = new_instancemethod(_Convert.SwigPyIterator_distance,None,SwigPyIterator) SwigPyIterator.equal = new_instancemethod(_Convert.SwigPyIterator_equal,None,SwigPyIterator) SwigPyIterator.copy = new_instancemethod(_Convert.SwigPyIterator_copy,None,SwigPyIterator) SwigPyIterator.next = new_instancemethod(_Convert.SwigPyIterator_next,None,SwigPyIterator) SwigPyIterator.__next__ = new_instancemethod(_Convert.SwigPyIterator___next__,None,SwigPyIterator) SwigPyIterator.previous = new_instancemethod(_Convert.SwigPyIterator_previous,None,SwigPyIterator) SwigPyIterator.advance = new_instancemethod(_Convert.SwigPyIterator_advance,None,SwigPyIterator) SwigPyIterator.__eq__ = new_instancemethod(_Convert.SwigPyIterator___eq__,None,SwigPyIterator) SwigPyIterator.__ne__ = new_instancemethod(_Convert.SwigPyIterator___ne__,None,SwigPyIterator) SwigPyIterator.__iadd__ = new_instancemethod(_Convert.SwigPyIterator___iadd__,None,SwigPyIterator) SwigPyIterator.__isub__ = new_instancemethod(_Convert.SwigPyIterator___isub__,None,SwigPyIterator) SwigPyIterator.__add__ = new_instancemethod(_Convert.SwigPyIterator___add__,None,SwigPyIterator) SwigPyIterator.__sub__ = new_instancemethod(_Convert.SwigPyIterator___sub__,None,SwigPyIterator) SwigPyIterator_swigregister = _Convert.SwigPyIterator_swigregister SwigPyIterator_swigregister(SwigPyIterator) import OCC.Standard import OCC.TColgp import OCC.gp import OCC.TCollection import OCC.MMgt import OCC.TColStd Convert_TgtThetaOver2 = _Convert.Convert_TgtThetaOver2 Convert_TgtThetaOver2_1 = _Convert.Convert_TgtThetaOver2_1 Convert_TgtThetaOver2_2 = _Convert.Convert_TgtThetaOver2_2 Convert_TgtThetaOver2_3 = _Convert.Convert_TgtThetaOver2_3 Convert_TgtThetaOver2_4 = _Convert.Convert_TgtThetaOver2_4 Convert_QuasiAngular = _Convert.Convert_QuasiAngular Convert_RationalC1 = _Convert.Convert_RationalC1 Convert_Polynomial = _Convert.Convert_Polynomial class Convert_CompBezierCurves2dToBSplineCurve2d(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * Constructs a framework for converting a sequence of adjacent non-rational Bezier curves into a BSpline curve. Knots will be created on the computed BSpline curve at each junction point of two consecutive Bezier curves. The degree of continuity of the BSpline curve will be increased at the junction point of two consecutive Bezier curves if their tangent vectors at this point are parallel. AngularTolerance (given in radians, and defaulted to 1.0 e-4) will be used to check the parallelism of the two tangent vectors. Use the following functions: - AddCurve to define in sequence the adjacent Bezier curves to be converted, - Perform to compute the data needed to build the BSpline curve, - and the available consultation functions to access the computed data. This data may be used to construct the BSpline curve. :param AngularTolerance: default value is 1.0e-4 :type AngularTolerance: float :rtype: None """ _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_swiginit(self,_Convert.new_Convert_CompBezierCurves2dToBSplineCurve2d(*args)) def AddCurve(self, *args): """ * Adds the Bezier curve defined by the table of poles Poles, to the sequence (still contained in this framework) of adjacent Bezier curves to be converted into a BSpline curve. Only polynomial (i.e. non-rational) Bezier curves are converted using this framework. If this is not the first call to the function (i.e. if this framework still contains data in its sequence of Bezier curves), the degree of continuity of the BSpline curve will be increased at the time of computation at the first point of the added Bezier curve (i.e. the first point of the Poles table). This will be the case if the tangent vector of the curve at this point is parallel to the tangent vector at the end point of the preceding Bezier curve in the sequence of Bezier curves still contained in this framework. An angular tolerance given at the time of construction of this framework, will be used to check the parallelism of the two tangent vectors. This checking procedure, and all the relative computations will be performed by the function Perform. When the sequence of adjacent Bezier curves is complete, use the following functions: - Perform to compute the data needed to build the BSpline curve, - and the available consultation functions to access the computed data. This data may be used to construct the BSpline curve. Warning The sequence of Bezier curves treated by this framework is automatically initialized with the first Bezier curve when the function is first called. During subsequent use of this function, ensure that the first point of the added Bezier curve (i.e. the first point of the Poles table) is coincident with the last point of the sequence (i.e. the last point of the preceding Bezier curve in the sequence) of Bezier curves still contained in this framework. An error may occur at the time of computation if this condition is not satisfied. Particular care must be taken with respect to the above, as this condition is not checked either when defining the sequence of Bezier curves or at the time of computation. :param Poles: :type Poles: TColgp_Array1OfPnt2d :rtype: None """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_AddCurve(self, *args) def Perform(self, *args): """ * Computes all the data needed to build a BSpline curve equivalent to the sequence of adjacent Bezier curves still contained in this framework. A knot is inserted on the computed BSpline curve at the junction point of two consecutive Bezier curves. The degree of continuity of the BSpline curve will be increased at the junction point of two consecutive Bezier curves if their tangent vectors at this point are parallel. An angular tolerance given at the time of construction of this framework is used to check the parallelism of the two tangent vectors. Use the available consultation functions to access the computed data. This data may then be used to construct the BSpline curve. Warning Ensure that the curves in the sequence of Bezier curves contained in this framework are adjacent. An error may occur at the time of computation if this condition is not satisfied. Particular care must be taken with respect to the above as this condition is not checked, either when defining the Bezier curve sequence or at the time of computation. :rtype: None """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_Perform(self, *args) def Degree(self, *args): """ * Returns the degree of the BSpline curve whose data is computed in this framework. Warning Take particular care not to use this function before the computation is performed (Perform function), as this condition is not checked and an error may therefore occur. :rtype: int """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_Degree(self, *args) def NbPoles(self, *args): """ * Returns the number of poles of the BSpline curve whose data is computed in this framework. Warning Take particular care not to use this function before the computation is performed (Perform function), as this condition is not checked and an error may therefore occur. :rtype: int """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_NbPoles(self, *args) def Poles(self, *args): """ * Loads the Poles table with the poles of the BSpline curve whose data is computed in this framework. Warning - Do not use this function before the computation is performed (Perform function). - The length of the Poles array must be equal to the number of poles of the BSpline curve whose data is computed in this framework. Particular care must be taken with respect to the above, as these conditions are not checked, and an error may occur. :param Poles: :type Poles: TColgp_Array1OfPnt2d :rtype: None """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_Poles(self, *args) def NbKnots(self, *args): """ * Returns the number of knots of the BSpline curve whose data is computed in this framework. Warning Take particular care not to use this function before the computation is performed (Perform function), as this condition is not checked and an error may therefore occur. :rtype: int """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_NbKnots(self, *args) def KnotsAndMults(self, *args): """ * Loads the Knots table with the knots and the Mults table with the corresponding multiplicities of the BSpline curve whose data is computed in this framework. Warning - Do not use this function before the computation is performed (Perform function). - The length of the Knots and Mults arrays must be equal to the number of knots in the BSpline curve whose data is computed in this framework. Particular care must be taken with respect to the above as these conditions are not checked, and an error may occur. :param Knots: :type Knots: TColStd_Array1OfReal & :param Mults: :type Mults: TColStd_Array1OfInteger & :rtype: None """ return _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_KnotsAndMults(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_CompBezierCurves2dToBSplineCurve2d.AddCurve = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_AddCurve,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d.Perform = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_Perform,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d.Degree = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_Degree,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d.NbPoles = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_NbPoles,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d.Poles = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_Poles,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d.NbKnots = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_NbKnots,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d.KnotsAndMults = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d_KnotsAndMults,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d._kill_pointed = new_instancemethod(_Convert.Convert_CompBezierCurves2dToBSplineCurve2d__kill_pointed,None,Convert_CompBezierCurves2dToBSplineCurve2d) Convert_CompBezierCurves2dToBSplineCurve2d_swigregister = _Convert.Convert_CompBezierCurves2dToBSplineCurve2d_swigregister Convert_CompBezierCurves2dToBSplineCurve2d_swigregister(Convert_CompBezierCurves2dToBSplineCurve2d) class Convert_CompBezierCurvesToBSplineCurve(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * Constructs a framework for converting a sequence of adjacent non-rational Bezier curves into a BSpline curve. Knots will be created on the computed BSpline curve at each junction point of two consecutive Bezier curves. The degree of continuity of the BSpline curve will be increased at the junction point of two consecutive Bezier curves if their tangent vectors at this point are parallel. AngularTolerance (given in radians, and defaulted to 1.0 e-4) will be used to check the parallelism of the two tangent vectors. Use the following functions: - AddCurve to define in sequence the adjacent Bezier curves to be converted, - Perform to compute the data needed to build the BSpline curve, - and the available consultation functions to access the computed data. This data may be used to construct the BSpline curve. :param AngularTolerance: default value is 1.0e-4 :type AngularTolerance: float :rtype: None """ _Convert.Convert_CompBezierCurvesToBSplineCurve_swiginit(self,_Convert.new_Convert_CompBezierCurvesToBSplineCurve(*args)) def AddCurve(self, *args): """ * Adds the Bezier curve defined by the table of poles Poles, to the sequence (still contained in this framework) of adjacent Bezier curves to be converted into a BSpline curve. Only polynomial (i.e. non-rational) Bezier curves are converted using this framework. If this is not the first call to the function (i.e. if this framework still contains data in its Bezier curve sequence), the degree of continuity of the BSpline curve will be increased at the time of computation at the first point of the added Bezier curve (i.e. the first point of the Poles table). This will be the case if the tangent vector of the curve at this point is parallel to the tangent vector at the end point of the preceding Bezier curve in the Bezier curve sequence still contained in this framework. An angular tolerance given at the time of construction of this framework will be used to check the parallelism of the two tangent vectors. This checking procedure and all related computations will be performed by the Perform function. When the adjacent Bezier curve sequence is complete, use the following functions: - Perform to compute the data needed to build the BSpline curve, - and the available consultation functions to access the computed data. This data may be used to construct the BSpline curve. Warning The Bezier curve sequence treated by this framework is automatically initialized with the first Bezier curve when the function is first called. During subsequent use of this function, ensure that the first point of the added Bezier curve (i.e. the first point of the Poles table) is coincident with the last point of the Bezier curve sequence (i.e. the last point of the preceding Bezier curve in the sequence) still contained in this framework. An error may occur at the time of computation if this condition is not satisfied. Particular care must be taken with respect to the above, as this condition is not checked either when defining the Bezier curve sequence or at the time of computation. :param Poles: :type Poles: TColgp_Array1OfPnt :rtype: None """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_AddCurve(self, *args) def Perform(self, *args): """ * Computes all the data needed to build a BSpline curve equivalent to the adjacent Bezier curve sequence still contained in this framework. A knot is inserted on the computed BSpline curve at the junction point of two consecutive Bezier curves. The degree of continuity of the BSpline curve will be increased at the junction point of two consecutive Bezier curves if their tangent vectors at this point are parallel. An angular tolerance given at the time of construction of this framework is used to check the parallelism of the two tangent vectors. Use the available consultation functions to access the computed data. This data may then be used to construct the BSpline curve. Warning Make sure that the curves in the Bezier curve sequence contained in this framework are adjacent. An error may occur at the time of computation if this condition is not satisfied. Particular care must be taken with respect to the above as this condition is not checked, either when defining the Bezier curve sequence or at the time of computation. :rtype: None """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_Perform(self, *args) def Degree(self, *args): """ * Returns the degree of the BSpline curve whose data is computed in this framework. Warning Take particular care not to use this function before the computation is performed (Perform function), as this condition is not checked and an error may therefore occur. :rtype: int """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_Degree(self, *args) def NbPoles(self, *args): """ * Returns the number of poles of the BSpline curve whose data is computed in this framework. Warning Take particular care not to use this function before the computation is performed (Perform function), as this condition is not checked and an error may therefore occur. :rtype: int """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_NbPoles(self, *args) def Poles(self, *args): """ * Loads the Poles table with the poles of the BSpline curve whose data is computed in this framework. Warning - Do not use this function before the computation is performed (Perform function). - The length of the Poles array must be equal to the number of poles of the BSpline curve whose data is computed in this framework. Particular care must be taken with respect to the above, as these conditions are not checked, and an error may occur. :param Poles: :type Poles: TColgp_Array1OfPnt :rtype: None """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_Poles(self, *args) def NbKnots(self, *args): """ * Returns the number of knots of the BSpline curve whose data is computed in this framework. Warning Take particular care not to use this function before the computation is performed (Perform function), as this condition is not checked and an error may therefore occur. :rtype: int """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_NbKnots(self, *args) def KnotsAndMults(self, *args): """ * - loads the Knots table with the knots, - and loads the Mults table with the corresponding multiplicities of the BSpline curve whose data is computed in this framework. Warning - Do not use this function before the computation is performed (Perform function). - The length of the Knots and Mults arrays must be equal to the number of knots in the BSpline curve whose data is computed in this framework. Particular care must be taken with respect to the above as these conditions are not checked, and an error may occur. :param Knots: :type Knots: TColStd_Array1OfReal & :param Mults: :type Mults: TColStd_Array1OfInteger & :rtype: None """ return _Convert.Convert_CompBezierCurvesToBSplineCurve_KnotsAndMults(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_CompBezierCurvesToBSplineCurve.AddCurve = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_AddCurve,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve.Perform = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_Perform,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve.Degree = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_Degree,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve.NbPoles = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_NbPoles,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve.Poles = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_Poles,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve.NbKnots = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_NbKnots,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve.KnotsAndMults = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve_KnotsAndMults,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve._kill_pointed = new_instancemethod(_Convert.Convert_CompBezierCurvesToBSplineCurve__kill_pointed,None,Convert_CompBezierCurvesToBSplineCurve) Convert_CompBezierCurvesToBSplineCurve_swigregister = _Convert.Convert_CompBezierCurvesToBSplineCurve_swigregister Convert_CompBezierCurvesToBSplineCurve_swigregister(Convert_CompBezierCurvesToBSplineCurve) class Convert_CompPolynomialToPoles(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * Warning! Continuity can be at MOST the maximum degree of the polynomial functions TrueIntervals : this is the true parameterisation for the composite curve that is : the curve has myContinuity if the nth curve is parameterized between myTrueIntervals(n) and myTrueIntervals(n+1) Coefficients have to be the implicit 'c form': Coefficients[Numcurves][MaxDegree+1][Dimension] Warning! The NumberOfCoefficient of an polynome is his degree + 1 Example: To convert the linear function f(x) = 2*x + 1 on the domaine [2,5] to BSpline with the bound [-1,1]. Arguments are : NumCurves = 1; Continuity = 1; Dimension = 1; MaxDegree = 1; NumCoeffPerCurve [1] = {2}; Coefficients[2] = {1, 2}; PolynomialIntervals[1,2] = {{2,5}} TrueIntervals[2] = {-1, 1} :param NumCurves: :type NumCurves: int :param Continuity: :type Continuity: int :param Dimension: :type Dimension: int :param MaxDegree: :type MaxDegree: int :param NumCoeffPerCurve: :type NumCoeffPerCurve: Handle_TColStd_HArray1OfInteger & :param Coefficients: :type Coefficients: Handle_TColStd_HArray1OfReal & :param PolynomialIntervals: :type PolynomialIntervals: Handle_TColStd_HArray2OfReal & :param TrueIntervals: :type TrueIntervals: Handle_TColStd_HArray1OfReal & :rtype: None * To Convert sevral span with different order of Continuity. Warning: The Length of Continuity have to be NumCurves-1 :param NumCurves: :type NumCurves: int :param Dimension: :type Dimension: int :param MaxDegree: :type MaxDegree: int :param Continuity: :type Continuity: TColStd_Array1OfInteger & :param NumCoeffPerCurve: :type NumCoeffPerCurve: TColStd_Array1OfInteger & :param Coefficients: :type Coefficients: TColStd_Array1OfReal & :param PolynomialIntervals: :type PolynomialIntervals: TColStd_Array2OfReal & :param TrueIntervals: :type TrueIntervals: TColStd_Array1OfReal & :rtype: None * To Convert only one span. :param Dimension: :type Dimension: int :param MaxDegree: :type MaxDegree: int :param Degree: :type Degree: int :param Coefficients: :type Coefficients: TColStd_Array1OfReal & :param PolynomialIntervals: :type PolynomialIntervals: TColStd_Array1OfReal & :param TrueIntervals: :type TrueIntervals: TColStd_Array1OfReal & :rtype: None """ _Convert.Convert_CompPolynomialToPoles_swiginit(self,_Convert.new_Convert_CompPolynomialToPoles(*args)) def NbPoles(self, *args): """ * number of poles of the n-dimensional BSpline :rtype: int """ return _Convert.Convert_CompPolynomialToPoles_NbPoles(self, *args) def Poles(self, *args): """ * returns the poles of the n-dimensional BSpline in the following format : [1..NumPoles][1..Dimension] :param Poles: :type Poles: Handle_TColStd_HArray2OfReal & :rtype: None """ return _Convert.Convert_CompPolynomialToPoles_Poles(self, *args) def Degree(self, *args): """ :rtype: int """ return _Convert.Convert_CompPolynomialToPoles_Degree(self, *args) def NbKnots(self, *args): """ * Degree of the n-dimensional Bspline :rtype: int """ return _Convert.Convert_CompPolynomialToPoles_NbKnots(self, *args) def Knots(self, *args): """ * Knots of the n-dimensional Bspline :param K: :type K: Handle_TColStd_HArray1OfReal & :rtype: None """ return _Convert.Convert_CompPolynomialToPoles_Knots(self, *args) def Multiplicities(self, *args): """ * Multiplicities of the knots in the BSpline :param M: :type M: Handle_TColStd_HArray1OfInteger & :rtype: None """ return _Convert.Convert_CompPolynomialToPoles_Multiplicities(self, *args) def IsDone(self, *args): """ :rtype: bool """ return _Convert.Convert_CompPolynomialToPoles_IsDone(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_CompPolynomialToPoles.NbPoles = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_NbPoles,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles.Poles = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_Poles,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles.Degree = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_Degree,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles.NbKnots = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_NbKnots,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles.Knots = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_Knots,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles.Multiplicities = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_Multiplicities,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles.IsDone = new_instancemethod(_Convert.Convert_CompPolynomialToPoles_IsDone,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles._kill_pointed = new_instancemethod(_Convert.Convert_CompPolynomialToPoles__kill_pointed,None,Convert_CompPolynomialToPoles) Convert_CompPolynomialToPoles_swigregister = _Convert.Convert_CompPolynomialToPoles_swigregister Convert_CompPolynomialToPoles_swigregister(Convert_CompPolynomialToPoles) class Convert_ConicToBSplineCurve(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def Degree(self, *args): """ * Returns the degree of the BSpline curve whose data is computed in this framework. :rtype: int """ return _Convert.Convert_ConicToBSplineCurve_Degree(self, *args) def NbPoles(self, *args): """ * Returns the number of poles of the BSpline curve whose data is computed in this framework. :rtype: int """ return _Convert.Convert_ConicToBSplineCurve_NbPoles(self, *args) def NbKnots(self, *args): """ * Returns the number of knots of the BSpline curve whose data is computed in this framework. :rtype: int """ return _Convert.Convert_ConicToBSplineCurve_NbKnots(self, *args) def IsPeriodic(self, *args): """ * Returns true if the BSpline curve whose data is computed in this framework is periodic. :rtype: bool """ return _Convert.Convert_ConicToBSplineCurve_IsPeriodic(self, *args) def Pole(self, *args): """ * Returns the pole of index Index to the poles table of the BSpline curve whose data is computed in this framework. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table of the BSpline curve whose data is computed in this framework. :param Index: :type Index: int :rtype: gp_Pnt2d """ return _Convert.Convert_ConicToBSplineCurve_Pole(self, *args) def Weight(self, *args): """ * Returns the weight of the pole of index Index to the poles table of the BSpline curve whose data is computed in this framework. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table of the BSpline curve whose data is computed in this framework. :param Index: :type Index: int :rtype: float """ return _Convert.Convert_ConicToBSplineCurve_Weight(self, *args) def Knot(self, *args): """ * Returns the knot of index Index to the knots table of the BSpline curve whose data is computed in this framework. Exceptions Standard_OutOfRange if Index is outside the bounds of the knots table of the BSpline curve whose data is computed in this framework. :param Index: :type Index: int :rtype: float """ return _Convert.Convert_ConicToBSplineCurve_Knot(self, *args) def Multiplicity(self, *args): """ * Returns the multiplicity of the knot of index Index to the knots table of the BSpline curve whose data is computed in this framework. Exceptions Standard_OutOfRange if Index is outside the bounds of the knots table of the BSpline curve whose data is computed in this framework. :param Index: :type Index: int :rtype: int """ return _Convert.Convert_ConicToBSplineCurve_Multiplicity(self, *args) def BuildCosAndSin(self, *args): """ :param Parametrisation: :type Parametrisation: Convert_ParameterisationType :param CosNumerator: :type CosNumerator: Handle_TColStd_HArray1OfReal & :param SinNumerator: :type SinNumerator: Handle_TColStd_HArray1OfReal & :param Denominator: :type Denominator: Handle_TColStd_HArray1OfReal & :param Degree: :type Degree: int & :param Knots: :type Knots: Handle_TColStd_HArray1OfReal & :param Mults: :type Mults: Handle_TColStd_HArray1OfInteger & :rtype: None :param Parametrisation: :type Parametrisation: Convert_ParameterisationType :param UFirst: :type UFirst: float :param ULast: :type ULast: float :param CosNumerator: :type CosNumerator: Handle_TColStd_HArray1OfReal & :param SinNumerator: :type SinNumerator: Handle_TColStd_HArray1OfReal & :param Denominator: :type Denominator: Handle_TColStd_HArray1OfReal & :param Degree: :type Degree: int & :param Knots: :type Knots: Handle_TColStd_HArray1OfReal & :param Mults: :type Mults: Handle_TColStd_HArray1OfInteger & :rtype: None """ return _Convert.Convert_ConicToBSplineCurve_BuildCosAndSin(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_ConicToBSplineCurve.Degree = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_Degree,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.NbPoles = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_NbPoles,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.NbKnots = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_NbKnots,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.IsPeriodic = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_IsPeriodic,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.Pole = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_Pole,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.Weight = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_Weight,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.Knot = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_Knot,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.Multiplicity = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_Multiplicity,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve.BuildCosAndSin = new_instancemethod(_Convert.Convert_ConicToBSplineCurve_BuildCosAndSin,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve._kill_pointed = new_instancemethod(_Convert.Convert_ConicToBSplineCurve__kill_pointed,None,Convert_ConicToBSplineCurve) Convert_ConicToBSplineCurve_swigregister = _Convert.Convert_ConicToBSplineCurve_swigregister Convert_ConicToBSplineCurve_swigregister(Convert_ConicToBSplineCurve) class Convert_ElementarySurfaceToBSplineSurface(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") __repr__ = _swig_repr def UDegree(self, *args): """ :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_UDegree(self, *args) def VDegree(self, *args): """ * Returns the degree for the u or v parametric direction of the BSpline surface whose data is computed in this framework. :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_VDegree(self, *args) def NbUPoles(self, *args): """ :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_NbUPoles(self, *args) def NbVPoles(self, *args): """ * Returns the number of poles for the u or v parametric direction of the BSpline surface whose data is computed in this framework. :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_NbVPoles(self, *args) def NbUKnots(self, *args): """ :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_NbUKnots(self, *args) def NbVKnots(self, *args): """ * Returns the number of knots for the u or v parametric direction of the BSpline surface whose data is computed in this framework . :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_NbVKnots(self, *args) def IsUPeriodic(self, *args): """ :rtype: bool """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_IsUPeriodic(self, *args) def IsVPeriodic(self, *args): """ * Returns true if the BSpline surface whose data is computed in this framework is periodic in the u or v parametric direction. :rtype: bool """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_IsVPeriodic(self, *args) def Pole(self, *args): """ * Returns the pole of index (UIndex,VIndex) to the poles table of the BSpline surface whose data is computed in this framework. Exceptions Standard_OutOfRange if, for the BSpline surface whose data is computed in this framework: - UIndex is outside the bounds of the poles table in the u parametric direction, or - VIndex is outside the bounds of the poles table in the v parametric direction. :param UIndex: :type UIndex: int :param VIndex: :type VIndex: int :rtype: gp_Pnt """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_Pole(self, *args) def Weight(self, *args): """ * Returns the weight of the pole of index (UIndex,VIndex) to the poles table of the BSpline surface whose data is computed in this framework. Exceptions Standard_OutOfRange if, for the BSpline surface whose data is computed in this framework: - UIndex is outside the bounds of the poles table in the u parametric direction, or - VIndex is outside the bounds of the poles table in the v parametric direction. :param UIndex: :type UIndex: int :param VIndex: :type VIndex: int :rtype: float """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_Weight(self, *args) def UKnot(self, *args): """ * Returns the U-knot of range UIndex. Raised if UIndex < 1 or UIndex > NbUKnots. :param UIndex: :type UIndex: int :rtype: float """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_UKnot(self, *args) def VKnot(self, *args): """ * Returns the V-knot of range VIndex. Raised if VIndex < 1 or VIndex > NbVKnots. :param UIndex: :type UIndex: int :rtype: float """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_VKnot(self, *args) def UMultiplicity(self, *args): """ * Returns the multiplicity of the U-knot of range UIndex. Raised if UIndex < 1 or UIndex > NbUKnots. :param UIndex: :type UIndex: int :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_UMultiplicity(self, *args) def VMultiplicity(self, *args): """ * Returns the multiplicity of the V-knot of range VIndex. Raised if VIndex < 1 or VIndex > NbVKnots. :param VIndex: :type VIndex: int :rtype: int """ return _Convert.Convert_ElementarySurfaceToBSplineSurface_VMultiplicity(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_ElementarySurfaceToBSplineSurface.UDegree = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_UDegree,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.VDegree = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_VDegree,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.NbUPoles = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_NbUPoles,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.NbVPoles = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_NbVPoles,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.NbUKnots = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_NbUKnots,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.NbVKnots = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_NbVKnots,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.IsUPeriodic = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_IsUPeriodic,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.IsVPeriodic = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_IsVPeriodic,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.Pole = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_Pole,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.Weight = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_Weight,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.UKnot = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_UKnot,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.VKnot = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_VKnot,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.UMultiplicity = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_UMultiplicity,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface.VMultiplicity = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface_VMultiplicity,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface._kill_pointed = new_instancemethod(_Convert.Convert_ElementarySurfaceToBSplineSurface__kill_pointed,None,Convert_ElementarySurfaceToBSplineSurface) Convert_ElementarySurfaceToBSplineSurface_swigregister = _Convert.Convert_ElementarySurfaceToBSplineSurface_swigregister Convert_ElementarySurfaceToBSplineSurface_swigregister(Convert_ElementarySurfaceToBSplineSurface) class Convert_GridPolynomialToPoles(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * To only one polynomial Surface. The Length of <PolynomialUIntervals> and <PolynomialVIntervals> have to be 2. This values defined the parametric domain of the Polynomial Equation. Coefficients : The <Coefficients> have to be formated than an 'C array' [MaxUDegree+1] [MaxVDegree+1] [3] :param MaxUDegree: :type MaxUDegree: int :param MaxVDegree: :type MaxVDegree: int :param NumCoeff: :type NumCoeff: Handle_TColStd_HArray1OfInteger & :param Coefficients: :type Coefficients: Handle_TColStd_HArray1OfReal & :param PolynomialUIntervals: :type PolynomialUIntervals: Handle_TColStd_HArray1OfReal & :param PolynomialVIntervals: :type PolynomialVIntervals: Handle_TColStd_HArray1OfReal & :rtype: None * To one grid of polynomial Surface. Warning! Continuity in each parametric direction can be at MOST the maximum degree of the polynomial functions. <TrueUIntervals>, <TrueVIntervals> : this is the true parameterisation for the composite surface Coefficients : The Coefficients have to be formated than an 'C array' [NbVSurfaces] [NBUSurfaces] [MaxUDegree+1] [MaxVDegree+1] [3] raises DomainError if <NumCoeffPerSurface> is not a [1, NbVSurfaces*NbUSurfaces, 1,2] array. if <Coefficients> is not a :param NbUSurfaces: :type NbUSurfaces: int :param NBVSurfaces: :type NBVSurfaces: int :param UContinuity: :type UContinuity: int :param VContinuity: :type VContinuity: int :param MaxUDegree: :type MaxUDegree: int :param MaxVDegree: :type MaxVDegree: int :param NumCoeffPerSurface: :type NumCoeffPerSurface: Handle_TColStd_HArray2OfInteger & :param Coefficients: :type Coefficients: Handle_TColStd_HArray1OfReal & :param PolynomialUIntervals: :type PolynomialUIntervals: Handle_TColStd_HArray1OfReal & :param PolynomialVIntervals: :type PolynomialVIntervals: Handle_TColStd_HArray1OfReal & :param TrueUIntervals: :type TrueUIntervals: Handle_TColStd_HArray1OfReal & :param TrueVIntervals: :type TrueVIntervals: Handle_TColStd_HArray1OfReal & :rtype: None """ _Convert.Convert_GridPolynomialToPoles_swiginit(self,_Convert.new_Convert_GridPolynomialToPoles(*args)) def Perform(self, *args): """ :param UContinuity: :type UContinuity: int :param VContinuity: :type VContinuity: int :param MaxUDegree: :type MaxUDegree: int :param MaxVDegree: :type MaxVDegree: int :param NumCoeffPerSurface: :type NumCoeffPerSurface: Handle_TColStd_HArray2OfInteger & :param Coefficients: :type Coefficients: Handle_TColStd_HArray1OfReal & :param PolynomialUIntervals: :type PolynomialUIntervals: Handle_TColStd_HArray1OfReal & :param PolynomialVIntervals: :type PolynomialVIntervals: Handle_TColStd_HArray1OfReal & :param TrueUIntervals: :type TrueUIntervals: Handle_TColStd_HArray1OfReal & :param TrueVIntervals: :type TrueVIntervals: Handle_TColStd_HArray1OfReal & :rtype: None """ return _Convert.Convert_GridPolynomialToPoles_Perform(self, *args) def NbUPoles(self, *args): """ :rtype: int """ return _Convert.Convert_GridPolynomialToPoles_NbUPoles(self, *args) def NbVPoles(self, *args): """ :rtype: int """ return _Convert.Convert_GridPolynomialToPoles_NbVPoles(self, *args) def Poles(self, *args): """ * returns the poles of the BSpline Surface :rtype: Handle_TColgp_HArray2OfPnt """ return _Convert.Convert_GridPolynomialToPoles_Poles(self, *args) def UDegree(self, *args): """ :rtype: int """ return _Convert.Convert_GridPolynomialToPoles_UDegree(self, *args) def VDegree(self, *args): """ :rtype: int """ return _Convert.Convert_GridPolynomialToPoles_VDegree(self, *args) def NbUKnots(self, *args): """ :rtype: int """ return _Convert.Convert_GridPolynomialToPoles_NbUKnots(self, *args) def NbVKnots(self, *args): """ :rtype: int """ return _Convert.Convert_GridPolynomialToPoles_NbVKnots(self, *args) def UKnots(self, *args): """ * Knots in the U direction :rtype: Handle_TColStd_HArray1OfReal """ return _Convert.Convert_GridPolynomialToPoles_UKnots(self, *args) def VKnots(self, *args): """ * Knots in the V direction :rtype: Handle_TColStd_HArray1OfReal """ return _Convert.Convert_GridPolynomialToPoles_VKnots(self, *args) def UMultiplicities(self, *args): """ * Multiplicities of the knots in the U direction :rtype: Handle_TColStd_HArray1OfInteger """ return _Convert.Convert_GridPolynomialToPoles_UMultiplicities(self, *args) def VMultiplicities(self, *args): """ * Multiplicities of the knots in the V direction :rtype: Handle_TColStd_HArray1OfInteger """ return _Convert.Convert_GridPolynomialToPoles_VMultiplicities(self, *args) def IsDone(self, *args): """ :rtype: bool """ return _Convert.Convert_GridPolynomialToPoles_IsDone(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_GridPolynomialToPoles.Perform = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_Perform,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.NbUPoles = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_NbUPoles,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.NbVPoles = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_NbVPoles,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.Poles = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_Poles,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.UDegree = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_UDegree,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.VDegree = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_VDegree,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.NbUKnots = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_NbUKnots,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.NbVKnots = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_NbVKnots,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.UKnots = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_UKnots,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.VKnots = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_VKnots,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.UMultiplicities = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_UMultiplicities,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.VMultiplicities = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_VMultiplicities,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles.IsDone = new_instancemethod(_Convert.Convert_GridPolynomialToPoles_IsDone,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles._kill_pointed = new_instancemethod(_Convert.Convert_GridPolynomialToPoles__kill_pointed,None,Convert_GridPolynomialToPoles) Convert_GridPolynomialToPoles_swigregister = _Convert.Convert_GridPolynomialToPoles_swigregister Convert_GridPolynomialToPoles_swigregister(Convert_GridPolynomialToPoles) class Convert_SequenceNodeOfSequenceOfArray1OfPoles(OCC.TCollection.TCollection_SeqNode): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ :param I: :type I: Handle_TColgp_HArray1OfPnt :param n: :type n: TCollection_SeqNodePtr & :param p: :type p: TCollection_SeqNodePtr & :rtype: None """ _Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles_swiginit(self,_Convert.new_Convert_SequenceNodeOfSequenceOfArray1OfPoles(*args)) def Value(self, *args): """ :rtype: Handle_TColgp_HArray1OfPnt """ return _Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles_Value(self, *args) def _kill_pointed(self): """_kill_pointed(Convert_SequenceNodeOfSequenceOfArray1OfPoles self)""" return _Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles__kill_pointed(self) def GetHandle(self): """GetHandle(Convert_SequenceNodeOfSequenceOfArray1OfPoles self) -> Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles""" return _Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles_GetHandle(self) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_SequenceNodeOfSequenceOfArray1OfPoles.Value = new_instancemethod(_Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles_Value,None,Convert_SequenceNodeOfSequenceOfArray1OfPoles) Convert_SequenceNodeOfSequenceOfArray1OfPoles._kill_pointed = new_instancemethod(_Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles__kill_pointed,None,Convert_SequenceNodeOfSequenceOfArray1OfPoles) Convert_SequenceNodeOfSequenceOfArray1OfPoles.GetHandle = new_instancemethod(_Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles_GetHandle,None,Convert_SequenceNodeOfSequenceOfArray1OfPoles) Convert_SequenceNodeOfSequenceOfArray1OfPoles_swigregister = _Convert.Convert_SequenceNodeOfSequenceOfArray1OfPoles_swigregister Convert_SequenceNodeOfSequenceOfArray1OfPoles_swigregister(Convert_SequenceNodeOfSequenceOfArray1OfPoles) class Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles(OCC.TCollection.Handle_TCollection_SeqNode): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): _Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_swiginit(self,_Convert.new_Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles(*args)) DownCast = staticmethod(_Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_DownCast) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles.Nullify = new_instancemethod(_Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_Nullify,None,Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles) Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles.IsNull = new_instancemethod(_Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_IsNull,None,Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles) Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles.GetObject = new_instancemethod(_Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_GetObject,None,Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles) Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles._kill_pointed = new_instancemethod(_Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles__kill_pointed,None,Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles) Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_swigregister = _Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_swigregister Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_swigregister(Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles) def Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_DownCast(*args): return _Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_DownCast(*args) Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_DownCast = _Convert.Handle_Convert_SequenceNodeOfSequenceOfArray1OfPoles_DownCast class Convert_SequenceOfArray1OfPoles(OCC.TCollection.TCollection_BaseSequence): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ :rtype: None """ _Convert.Convert_SequenceOfArray1OfPoles_swiginit(self,_Convert.new_Convert_SequenceOfArray1OfPoles(*args)) def Clear(self, *args): """ :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_Clear(self, *args) def Assign(self, *args): """ :param Other: :type Other: Convert_SequenceOfArray1OfPoles & :rtype: Convert_SequenceOfArray1OfPoles """ return _Convert.Convert_SequenceOfArray1OfPoles_Assign(self, *args) def Set(self, *args): """ :param Other: :type Other: Convert_SequenceOfArray1OfPoles & :rtype: Convert_SequenceOfArray1OfPoles """ return _Convert.Convert_SequenceOfArray1OfPoles_Set(self, *args) def Append(self, *args): """ :param T: :type T: Handle_TColgp_HArray1OfPnt :rtype: None :param S: :type S: Convert_SequenceOfArray1OfPoles & :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_Append(self, *args) def Prepend(self, *args): """ :param T: :type T: Handle_TColgp_HArray1OfPnt :rtype: None :param S: :type S: Convert_SequenceOfArray1OfPoles & :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_Prepend(self, *args) def InsertBefore(self, *args): """ :param Index: :type Index: int :param T: :type T: Handle_TColgp_HArray1OfPnt :rtype: None :param Index: :type Index: int :param S: :type S: Convert_SequenceOfArray1OfPoles & :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_InsertBefore(self, *args) def InsertAfter(self, *args): """ :param Index: :type Index: int :param T: :type T: Handle_TColgp_HArray1OfPnt :rtype: None :param Index: :type Index: int :param S: :type S: Convert_SequenceOfArray1OfPoles & :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_InsertAfter(self, *args) def First(self, *args): """ :rtype: Handle_TColgp_HArray1OfPnt """ return _Convert.Convert_SequenceOfArray1OfPoles_First(self, *args) def Last(self, *args): """ :rtype: Handle_TColgp_HArray1OfPnt """ return _Convert.Convert_SequenceOfArray1OfPoles_Last(self, *args) def Split(self, *args): """ :param Index: :type Index: int :param Sub: :type Sub: Convert_SequenceOfArray1OfPoles & :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_Split(self, *args) def Value(self, *args): """ :param Index: :type Index: int :rtype: Handle_TColgp_HArray1OfPnt """ return _Convert.Convert_SequenceOfArray1OfPoles_Value(self, *args) def SetValue(self, *args): """ :param Index: :type Index: int :param I: :type I: Handle_TColgp_HArray1OfPnt :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_SetValue(self, *args) def ChangeValue(self, *args): """ :param Index: :type Index: int :rtype: Handle_TColgp_HArray1OfPnt """ return _Convert.Convert_SequenceOfArray1OfPoles_ChangeValue(self, *args) def Remove(self, *args): """ :param Index: :type Index: int :rtype: None :param FromIndex: :type FromIndex: int :param ToIndex: :type ToIndex: int :rtype: None """ return _Convert.Convert_SequenceOfArray1OfPoles_Remove(self, *args) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_SequenceOfArray1OfPoles.Clear = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Clear,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Assign = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Assign,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Set = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Set,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Append = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Append,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Prepend = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Prepend,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.InsertBefore = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_InsertBefore,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.InsertAfter = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_InsertAfter,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.First = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_First,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Last = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Last,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Split = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Split,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Value = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Value,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.SetValue = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_SetValue,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.ChangeValue = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_ChangeValue,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles.Remove = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles_Remove,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles._kill_pointed = new_instancemethod(_Convert.Convert_SequenceOfArray1OfPoles__kill_pointed,None,Convert_SequenceOfArray1OfPoles) Convert_SequenceOfArray1OfPoles_swigregister = _Convert.Convert_SequenceOfArray1OfPoles_swigregister Convert_SequenceOfArray1OfPoles_swigregister(Convert_SequenceOfArray1OfPoles) class Convert_CircleToBSplineCurve(Convert_ConicToBSplineCurve): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The equivalent B-spline curve has the same orientation as the circle C. :param C: :type C: gp_Circ2d :param Parameterisation: default value is Convert_TgtThetaOver2 :type Parameterisation: Convert_ParameterisationType :rtype: None * The circle C is limited between the parametric values U1, U2 in radians. U1 and U2 [0.0, 2*Pi] . The equivalent B-spline curve is oriented from U1 to U2 and has the same orientation as the circle C. Raised if U1 = U2 or U1 = U2 + 2.0 * Pi :param C: :type C: gp_Circ2d :param U1: :type U1: float :param U2: :type U2: float :param Parameterisation: default value is Convert_TgtThetaOver2 :type Parameterisation: Convert_ParameterisationType :rtype: None """ _Convert.Convert_CircleToBSplineCurve_swiginit(self,_Convert.new_Convert_CircleToBSplineCurve(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_CircleToBSplineCurve._kill_pointed = new_instancemethod(_Convert.Convert_CircleToBSplineCurve__kill_pointed,None,Convert_CircleToBSplineCurve) Convert_CircleToBSplineCurve_swigregister = _Convert.Convert_CircleToBSplineCurve_swigregister Convert_CircleToBSplineCurve_swigregister(Convert_CircleToBSplineCurve) class Convert_ConeToBSplineSurface(Convert_ElementarySurfaceToBSplineSurface): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The equivalent B-spline surface as the same orientation as the Cone in the U and V parametric directions. Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2. :param C: :type C: gp_Cone :param U1: :type U1: float :param U2: :type U2: float :param V1: :type V1: float :param V2: :type V2: float :rtype: None * The equivalent B-spline surface as the same orientation as the Cone in the U and V parametric directions. Raised if V1 = V2. :param C: :type C: gp_Cone :param V1: :type V1: float :param V2: :type V2: float :rtype: None """ _Convert.Convert_ConeToBSplineSurface_swiginit(self,_Convert.new_Convert_ConeToBSplineSurface(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_ConeToBSplineSurface._kill_pointed = new_instancemethod(_Convert.Convert_ConeToBSplineSurface__kill_pointed,None,Convert_ConeToBSplineSurface) Convert_ConeToBSplineSurface_swigregister = _Convert.Convert_ConeToBSplineSurface_swigregister Convert_ConeToBSplineSurface_swigregister(Convert_ConeToBSplineSurface) class Convert_CylinderToBSplineSurface(Convert_ElementarySurfaceToBSplineSurface): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The equivalent B-splineSurface as the same orientation as the cylinder in the U and V parametric directions. Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2. :param Cyl: :type Cyl: gp_Cylinder :param U1: :type U1: float :param U2: :type U2: float :param V1: :type V1: float :param V2: :type V2: float :rtype: None * The equivalent B-splineSurface as the same orientation as the cylinder in the U and V parametric directions. Raised if V1 = V2. :param Cyl: :type Cyl: gp_Cylinder :param V1: :type V1: float :param V2: :type V2: float :rtype: None """ _Convert.Convert_CylinderToBSplineSurface_swiginit(self,_Convert.new_Convert_CylinderToBSplineSurface(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_CylinderToBSplineSurface._kill_pointed = new_instancemethod(_Convert.Convert_CylinderToBSplineSurface__kill_pointed,None,Convert_CylinderToBSplineSurface) Convert_CylinderToBSplineSurface_swigregister = _Convert.Convert_CylinderToBSplineSurface_swigregister Convert_CylinderToBSplineSurface_swigregister(Convert_CylinderToBSplineSurface) class Convert_EllipseToBSplineCurve(Convert_ConicToBSplineCurve): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The equivalent B-spline curve has the same orientation as the ellipse E. :param E: :type E: gp_Elips2d :param Parameterisation: default value is Convert_TgtThetaOver2 :type Parameterisation: Convert_ParameterisationType :rtype: None * The ellipse E is limited between the parametric values U1, U2. The equivalent B-spline curve is oriented from U1 to U2 and has the same orientation as E. Raised if U1 = U2 or U1 = U2 + 2.0 * Pi :param E: :type E: gp_Elips2d :param U1: :type U1: float :param U2: :type U2: float :param Parameterisation: default value is Convert_TgtThetaOver2 :type Parameterisation: Convert_ParameterisationType :rtype: None """ _Convert.Convert_EllipseToBSplineCurve_swiginit(self,_Convert.new_Convert_EllipseToBSplineCurve(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_EllipseToBSplineCurve._kill_pointed = new_instancemethod(_Convert.Convert_EllipseToBSplineCurve__kill_pointed,None,Convert_EllipseToBSplineCurve) Convert_EllipseToBSplineCurve_swigregister = _Convert.Convert_EllipseToBSplineCurve_swigregister Convert_EllipseToBSplineCurve_swigregister(Convert_EllipseToBSplineCurve) class Convert_HyperbolaToBSplineCurve(Convert_ConicToBSplineCurve): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The hyperbola H is limited between the parametric values U1, U2 and the equivalent B-spline curve has the same orientation as the hyperbola. :param H: :type H: gp_Hypr2d :param U1: :type U1: float :param U2: :type U2: float :rtype: None """ _Convert.Convert_HyperbolaToBSplineCurve_swiginit(self,_Convert.new_Convert_HyperbolaToBSplineCurve(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_HyperbolaToBSplineCurve._kill_pointed = new_instancemethod(_Convert.Convert_HyperbolaToBSplineCurve__kill_pointed,None,Convert_HyperbolaToBSplineCurve) Convert_HyperbolaToBSplineCurve_swigregister = _Convert.Convert_HyperbolaToBSplineCurve_swigregister Convert_HyperbolaToBSplineCurve_swigregister(Convert_HyperbolaToBSplineCurve) class Convert_ParabolaToBSplineCurve(Convert_ConicToBSplineCurve): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The parabola Prb is limited between the parametric values U1, U2 and the equivalent B-spline curve as the same orientation as the parabola Prb. :param Prb: :type Prb: gp_Parab2d :param U1: :type U1: float :param U2: :type U2: float :rtype: None """ _Convert.Convert_ParabolaToBSplineCurve_swiginit(self,_Convert.new_Convert_ParabolaToBSplineCurve(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_ParabolaToBSplineCurve._kill_pointed = new_instancemethod(_Convert.Convert_ParabolaToBSplineCurve__kill_pointed,None,Convert_ParabolaToBSplineCurve) Convert_ParabolaToBSplineCurve_swigregister = _Convert.Convert_ParabolaToBSplineCurve_swigregister Convert_ParabolaToBSplineCurve_swigregister(Convert_ParabolaToBSplineCurve) class Convert_SphereToBSplineSurface(Convert_ElementarySurfaceToBSplineSurface): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The equivalent B-spline surface as the same orientation as the sphere in the U and V parametric directions. Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2. :param Sph: :type Sph: gp_Sphere :param U1: :type U1: float :param U2: :type U2: float :param V1: :type V1: float :param V2: :type V2: float :rtype: None * The equivalent B-spline surface as the same orientation as the sphere in the U and V parametric directions. Raised if UTrim = True and Param1 = Param2 or Param1 = Param2 + 2.0 * Pi Raised if UTrim = False and Param1 = Param2 :param Sph: :type Sph: gp_Sphere :param Param1: :type Param1: float :param Param2: :type Param2: float :param UTrim: default value is Standard_True :type UTrim: bool :rtype: None * The equivalent B-spline surface as the same orientation as the sphere in the U and V parametric directions. :param Sph: :type Sph: gp_Sphere :rtype: None """ _Convert.Convert_SphereToBSplineSurface_swiginit(self,_Convert.new_Convert_SphereToBSplineSurface(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_SphereToBSplineSurface._kill_pointed = new_instancemethod(_Convert.Convert_SphereToBSplineSurface__kill_pointed,None,Convert_SphereToBSplineSurface) Convert_SphereToBSplineSurface_swigregister = _Convert.Convert_SphereToBSplineSurface_swigregister Convert_SphereToBSplineSurface_swigregister(Convert_SphereToBSplineSurface) class Convert_TorusToBSplineSurface(Convert_ElementarySurfaceToBSplineSurface): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): """ * The equivalent B-spline surface as the same orientation as the torus in the U and V parametric directions. Raised if U1 = U2 or U1 = U2 + 2.0 * Pi Raised if V1 = V2 or V1 = V2 + 2.0 * Pi :param T: :type T: gp_Torus :param U1: :type U1: float :param U2: :type U2: float :param V1: :type V1: float :param V2: :type V2: float :rtype: None * The equivalent B-spline surface as the same orientation as the torus in the U and V parametric directions. Raised if Param1 = Param2 or Param1 = Param2 + 2.0 * Pi :param T: :type T: gp_Torus :param Param1: :type Param1: float :param Param2: :type Param2: float :param UTrim: default value is Standard_True :type UTrim: bool :rtype: None * The equivalent B-spline surface as the same orientation as the torus in the U and V parametric directions. :param T: :type T: gp_Torus :rtype: None """ _Convert.Convert_TorusToBSplineSurface_swiginit(self,_Convert.new_Convert_TorusToBSplineSurface(*args)) def __del__(self): try: self.thisown = False GarbageCollector.garbage.collect_object(self) except: pass Convert_TorusToBSplineSurface._kill_pointed = new_instancemethod(_Convert.Convert_TorusToBSplineSurface__kill_pointed,None,Convert_TorusToBSplineSurface) Convert_TorusToBSplineSurface_swigregister = _Convert.Convert_TorusToBSplineSurface_swigregister Convert_TorusToBSplineSurface_swigregister(Convert_TorusToBSplineSurface)
48.226259
2,029
0.748173
8,217
75,667
6.662772
0.060241
0.051399
0.047783
0.050395
0.808194
0.564075
0.528476
0.496603
0.471451
0.46104
0
0.008323
0.188576
75,667
1,568
2,030
48.257015
0.883368
0.386417
0
0.377856
1
0
0.01387
0
0
0
0
0
0
1
0.207381
false
0.033392
0.02812
0.005272
0.478032
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
80a09b1bd192800d93bd52bdbf72daf90e53bc85
1,376
py
Python
Tools/_create_model.py
825477418/XX
bf46e34749394002eec0fdc65e34c339ce022cab
[ "MIT" ]
null
null
null
Tools/_create_model.py
825477418/XX
bf46e34749394002eec0fdc65e34c339ce022cab
[ "MIT" ]
1
2020-06-03T13:54:29.000Z
2020-06-03T13:54:29.000Z
Tools/_create_model.py
825477418/XX
bf46e34749394002eec0fdc65e34c339ce022cab
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/11/1 11:33 # @Author : Peter # @Des : 生成model类 # @File : _create_model.py # @Software: PyCharm import os import re # fp = "C:\\Users\\billsteve\\Desktop\\tmp\\" fp = "../Model/SqlAlchemy/T.py" link = "sqlacodegen mysql+pymysql://root:HBroot21@cd-cdb-f41yw26m.sql.tencentcdb.com:63626/company> " link = "sqlacodegen mysql+pymysql://root:HBroot21@cd-cdb-f41yw26m.sql.tencentcdb.com:63626/data_sheet> " link = "sqlacodegen mysql+pymysql://root:HBroot21@rm-8vbzabox9s9kvomq61o.mysql.zhangbei.rds.aliyuncs.com:3306/data_sheet> " # link = "sqlacodegen mysql+pymysql://root:HBroot21@cd-cdb-f41yw26m.sql.tencentcdb.com:63626/weibo> " link = "sqlacodegen mysql+pymysql://root:rebind1234@zh:3306/zhihu > " link = "sqlacodegen mysql+pymysql://root:rebind1234@zh:3306/money > " # link = "sqlacodegen mysql+pymysql://root:DRsXT5ZJ6Oi55LPQ@localhost:3306/music > " # link = "sqlacodegen mysql+pymysql://root:HBroot21@cd-cdb-f41yw26m.sql.tencentcdb.com:63626/money> " os.system(link + str(fp)) content = open(fp, encoding="utf-8").read() # content = content.replace("INTEGER", "Integer").replace("BIGINT", "BigInteger") # content = re.sub("Integer(\(\d+\))", "Integer", content) # content = re.sub("BigInteger(\(\d+\))", "BigInteger", content) # open(fp, "w", encoding="utf-8").write(content) print(content)
45.866667
123
0.704215
182
1,376
5.302198
0.428571
0.124352
0.165803
0.223834
0.491192
0.459067
0.459067
0.459067
0.302591
0.302591
0
0.075
0.098837
1,376
29
124
47.448276
0.703226
0.534157
0
0
0
0.272727
0.71885
0.600639
0
0
0
0
0
1
0
false
0
0.181818
0
0.181818
0.090909
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
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
80efd9b0c916dc081a320670389bb8f5cfdb867a
76
py
Python
aoc/day06_2.py
GitOnUp/Advent2021
c9cd5a2d38a09389bdecac5f45be854da7aacee8
[ "MIT" ]
null
null
null
aoc/day06_2.py
GitOnUp/Advent2021
c9cd5a2d38a09389bdecac5f45be854da7aacee8
[ "MIT" ]
null
null
null
aoc/day06_2.py
GitOnUp/Advent2021
c9cd5a2d38a09389bdecac5f45be854da7aacee8
[ "MIT" ]
null
null
null
from aoc.day06_1 import run if __name__ == "__main__": print(run(256))
15.2
27
0.684211
12
76
3.583333
0.916667
0
0
0
0
0
0
0
0
0
0
0.096774
0.184211
76
4
28
19
0.596774
0
0
0
0
0
0.105263
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
80f3f14a093019280342ab7f0daf049daf505aeb
141
py
Python
strategy/managers.py
moshthepitt/probsc
9b8cab206bb1c41238e36bd77f5e0573df4d8e2d
[ "MIT" ]
null
null
null
strategy/managers.py
moshthepitt/probsc
9b8cab206bb1c41238e36bd77f5e0573df4d8e2d
[ "MIT" ]
null
null
null
strategy/managers.py
moshthepitt/probsc
9b8cab206bb1c41238e36bd77f5e0573df4d8e2d
[ "MIT" ]
null
null
null
from core.managers import CoreManager class StrategicThemeManager(CoreManager): pass class ObjectiveManager(CoreManager): pass
11.75
41
0.780142
13
141
8.461538
0.692308
0.272727
0
0
0
0
0
0
0
0
0
0
0.170213
141
11
42
12.818182
0.940171
0
0
0.4
0
0
0
0
0
0
0
0
0
1
0
true
0.4
0.2
0
0.6
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
03b25b5a5faef2e80acf0a941b25849bf40608d7
26
py
Python
data/studio21_generated/interview/1624/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/interview/1624/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
data/studio21_generated/interview/1624/starter_code.py
vijaykumawat256/Prompt-Summarization
614f5911e2acd2933440d909de2b4f86653dc214
[ "Apache-2.0" ]
null
null
null
def sq_cub_rev_prime(n):
13
24
0.769231
6
26
2.833333
1
0
0
0
0
0
0
0
0
0
0
0
0.115385
26
2
25
13
0.73913
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
03b31105b49366639294bcbe79b90c112f7393bb
189
py
Python
glitter_documents/apps.py
developersociety/django-glitter-documents
8d13d6fc7133f7d6f595a4e780f291caf3ab4efa
[ "BSD-3-Clause" ]
null
null
null
glitter_documents/apps.py
developersociety/django-glitter-documents
8d13d6fc7133f7d6f595a4e780f291caf3ab4efa
[ "BSD-3-Clause" ]
null
null
null
glitter_documents/apps.py
developersociety/django-glitter-documents
8d13d6fc7133f7d6f595a4e780f291caf3ab4efa
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- from django.apps import AppConfig class DocumentsConfig(AppConfig): name = 'glitter_documents' label = 'glitter_documents' verbose_name = 'Documents'
18.9
33
0.698413
20
189
6.45
0.75
0.248062
0
0
0
0
0
0
0
0
0
0.006494
0.185185
189
9
34
21
0.831169
0.111111
0
0
0
0
0.259036
0
0
0
0
0
0
1
0
false
0
0.2
0
1
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
03c53fb902449f1a9cbebfac139cb7b318479b1e
250
py
Python
kobert_transformers/utils.py
LoveMeWithoutAll/KoBERT-Transformers
5e30015ae1101b57758fbe10a4e2502bc530acc1
[ "Apache-2.0" ]
null
null
null
kobert_transformers/utils.py
LoveMeWithoutAll/KoBERT-Transformers
5e30015ae1101b57758fbe10a4e2502bc530acc1
[ "Apache-2.0" ]
null
null
null
kobert_transformers/utils.py
LoveMeWithoutAll/KoBERT-Transformers
5e30015ae1101b57758fbe10a4e2502bc530acc1
[ "Apache-2.0" ]
null
null
null
from .tokenization_kobert import KoBertTokenizer def get_tokenizer(cache_dir=None): if cache_dir is not None: return KoBertTokenizer.from_pretrained(cache_dir) else: return KoBertTokenizer.from_pretrained('monologg/kobert')
27.777778
65
0.768
30
250
6.166667
0.6
0.12973
0.27027
0.378378
0
0
0
0
0
0
0
0
0.168
250
8
66
31.25
0.889423
0
0
0
0
0
0.06
0
0
0
0
0
0
1
0.166667
false
0
0.166667
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
0
0
1
0
0
4
03d7d92d4d5bfbe186989e957053e7a566a34b64
123
py
Python
anyrun/__init__.py
mwalkowski/anyrun
48545bcbbb4872ecc4f3736c9395d69b56ff6134
[ "Apache-2.0" ]
18
2019-06-10T09:37:14.000Z
2021-09-28T18:39:50.000Z
anyrun/__init__.py
plinkert/anyrun
f0d6bd915460c9bd3d37acdcc27ddf20c92d0410
[ "Apache-2.0" ]
7
2019-07-17T04:50:59.000Z
2020-05-09T13:33:08.000Z
anyrun/__init__.py
mwalkowski/anyrun
48545bcbbb4872ecc4f3736c9395d69b56ff6134
[ "Apache-2.0" ]
5
2019-06-11T05:22:37.000Z
2021-02-18T01:47:14.000Z
from anyrun.client import AnyRunClient, AnyRunException __version__ = '0.1' __all__ = ['AnyRunClient', 'AnyRunException']
24.6
55
0.780488
12
123
7.333333
0.833333
0.613636
0
0
0
0
0
0
0
0
0
0.018182
0.105691
123
4
56
30.75
0.781818
0
0
0
0
0
0.243902
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
ff0efbaac9950eb55c068dc1d25ca25669b5b53d
189
py
Python
build/lib/NaMAZU/onnx_api/__init__.py
NMZ0429/NaMAZU
46ac3a5fab6fc21bbef323e16daadfd4111e2e68
[ "Apache-2.0" ]
5
2021-09-22T20:17:22.000Z
2021-11-26T07:09:18.000Z
build/lib/NaMAZU/onnx_api/__init__.py
NMZ0429/NaMAZU
46ac3a5fab6fc21bbef323e16daadfd4111e2e68
[ "Apache-2.0" ]
null
null
null
build/lib/NaMAZU/onnx_api/__init__.py
NMZ0429/NaMAZU
46ac3a5fab6fc21bbef323e16daadfd4111e2e68
[ "Apache-2.0" ]
null
null
null
__all__ = ["MiDASInference", "U2NetInference", "RealESRGANInference"] from .midas import MiDASInference from .segmentation import U2NetInference from .real_esr import RealESRGANInference
27
69
0.825397
17
189
8.882353
0.588235
0
0
0
0
0
0
0
0
0
0
0.011765
0.100529
189
6
70
31.5
0.876471
0
0
0
0
0
0.25
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
ff204abc808df6bc7b2066510508ef7023f10267
21
py
Python
src_py/hat/gateway/devices/modbus/__init__.py
hat-open/hat-gateway
43d02e3809a1f9dfcb6ee797bb7034b61dd3c469
[ "Apache-2.0" ]
2
2022-02-01T13:43:08.000Z
2022-02-24T09:30:36.000Z
src_py/hat/gateway/devices/modbus/__init__.py
hat-open/hat-gateway
43d02e3809a1f9dfcb6ee797bb7034b61dd3c469
[ "Apache-2.0" ]
null
null
null
src_py/hat/gateway/devices/modbus/__init__.py
hat-open/hat-gateway
43d02e3809a1f9dfcb6ee797bb7034b61dd3c469
[ "Apache-2.0" ]
null
null
null
"""Modbus devices"""
10.5
20
0.619048
2
21
6.5
1
0
0
0
0
0
0
0
0
0
0
0
0.095238
21
1
21
21
0.684211
0.666667
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
205c8698d1be613dcc084ddfdcc8d9120bb54da7
130
py
Python
PythonExercicios/ex010.py
VitorFRodrigues/Python-curso
af75ff4a7ca14bc7e67b4f3362af837d355b1746
[ "MIT" ]
null
null
null
PythonExercicios/ex010.py
VitorFRodrigues/Python-curso
af75ff4a7ca14bc7e67b4f3362af837d355b1746
[ "MIT" ]
null
null
null
PythonExercicios/ex010.py
VitorFRodrigues/Python-curso
af75ff4a7ca14bc7e67b4f3362af837d355b1746
[ "MIT" ]
null
null
null
n = float(input('Quanto dinheiro você tem na carteira? R$')) print('Com R${:.2f} você pode comprar US${:.2f}.'.format(n, n/3.27))
43.333333
68
0.646154
24
130
3.5
0.791667
0
0
0
0
0
0
0
0
0
0
0.04386
0.123077
130
2
69
65
0.692982
0
0
0
0
0
0.623077
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
207cece5083a3bf4d7a32eb8cf668d2c4b468041
91
py
Python
Chapter05/examine_tar_file_content.py
add54/ADMIN_SYS_PYTHON
5a6d9705537c8663c8f7b0f45d29ccc87b6096e7
[ "MIT" ]
116
2018-12-21T01:05:47.000Z
2022-03-23T21:41:41.000Z
Chapter05/examine_tar_file_content.py
add54/ADMIN_SYS_PYTHON
5a6d9705537c8663c8f7b0f45d29ccc87b6096e7
[ "MIT" ]
2
2021-03-31T19:36:19.000Z
2021-06-10T22:29:26.000Z
Chapter05/examine_tar_file_content.py
add54/ADMIN_SYS_PYTHON
5a6d9705537c8663c8f7b0f45d29ccc87b6096e7
[ "MIT" ]
147
2018-12-19T14:10:32.000Z
2022-03-20T11:03:20.000Z
import tarfile tar_file = tarfile.open("work.tar.gz", "r:gz") print(tar_file.getnames())
15.166667
46
0.714286
15
91
4.2
0.666667
0.222222
0
0
0
0
0
0
0
0
0
0
0.098901
91
5
47
18.2
0.768293
0
0
0
0
0
0.166667
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0.333333
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
2081deed960bb703ad8647423a60570315d1aa3c
130
py
Python
debug.py
codingjerk/ztd.blunders-web
38d4c1049dc3d0bd0b4294ffa419d25cbfbf2b83
[ "MIT" ]
null
null
null
debug.py
codingjerk/ztd.blunders-web
38d4c1049dc3d0bd0b4294ffa419d25cbfbf2b83
[ "MIT" ]
null
null
null
debug.py
codingjerk/ztd.blunders-web
38d4c1049dc3d0bd0b4294ffa419d25cbfbf2b83
[ "MIT" ]
null
null
null
#!/usr/bin/env python from app import app app.run(host = '0.0.0.0', port = 8089, debug = True, threaded = False, processes = 1)
21.666667
85
0.653846
23
130
3.695652
0.782609
0.070588
0.070588
0
0
0
0
0
0
0
0
0.084112
0.176923
130
5
86
26
0.71028
0.153846
0
0
0
0
0.06422
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
209d4037144ecf01ba71e2b23993e11ab3d64b44
1,922
py
Python
marqeta/response_models/kyc_response.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
21
2019-04-12T09:02:17.000Z
2022-02-18T11:39:06.000Z
marqeta/response_models/kyc_response.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
1
2020-07-22T21:27:40.000Z
2020-07-23T17:38:43.000Z
marqeta/response_models/kyc_response.py
marqeta/marqeta-python
66fa690eb910825c510a391720b0fe717fac0234
[ "MIT" ]
10
2019-05-08T14:20:37.000Z
2021-09-20T18:09:26.000Z
from datetime import datetime, date from marqeta.response_models.result import Result from marqeta.response_models.kyc_question import KycQuestion from marqeta.response_models import datetime_object import json import re class KycResponse(object): def __init__(self, json_response): self.json_response = json_response def __str__(self): return json.dumps(self.json_response, default=self.json_serial) @staticmethod def json_serial(o): if isinstance(o, datetime) or isinstance(o, date): return o.__str__() @property def created_time(self): if 'created_time' in self.json_response: return datetime_object('created_time', self.json_response) @property def last_modified_time(self): if 'last_modified_time' in self.json_response: return datetime_object('last_modified_time', self.json_response) @property def token(self): return self.json_response.get('token', None) @property def user_token(self): return self.json_response.get('user_token', None) @property def business_token(self): return self.json_response.get('business_token', None) @property def result(self): if 'result' in self.json_response: return Result(self.json_response['result']) @property def manual_override(self): return self.json_response.get('manual_override', None) @property def notes(self): return self.json_response.get('notes', None) @property def questions(self): if 'questions' in self.json_response: return [KycQuestion(val) for val in self.json_response['questions']] @property def reference_id(self): return self.json_response.get('reference_id', None) def __repr__(self): return '<Marqeta.response_models.kyc_response.KycResponse>' + self.__str__()
25.972973
85
0.686264
238
1,922
5.264706
0.205882
0.114924
0.217079
0.086193
0.305666
0.267358
0.148444
0.067039
0
0
0
0
0.220604
1,922
73
86
26.328767
0.836449
0
0
0.196078
0
0
0.104579
0.026015
0
0
0
0
0
1
0.27451
false
0
0.117647
0.156863
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
20ab84e3551b4b2def018eef997c7f3a722947b1
169
py
Python
01_getting_started_with_python/src/_solutions/fahrenheit_to_celsius.py
hello-world-academy/beiersdorf_05-06-2019
79b244ae21fa2815bf429653ccf6b51ddc468901
[ "MIT" ]
1
2020-01-17T14:51:40.000Z
2020-01-17T14:51:40.000Z
01_getting_started_with_python/src/_solutions/fahrenheit_to_celsius.py
hello-world-academy/beiersdorf_05-06-2019
79b244ae21fa2815bf429653ccf6b51ddc468901
[ "MIT" ]
null
null
null
01_getting_started_with_python/src/_solutions/fahrenheit_to_celsius.py
hello-world-academy/beiersdorf_05-06-2019
79b244ae21fa2815bf429653ccf6b51ddc468901
[ "MIT" ]
1
2020-12-04T15:37:28.000Z
2020-12-04T15:37:28.000Z
def fahrenheit_to_celsius(F): ''' Function to compute Celsius from Fahrenheit ''' K = fahrenheit_to_kelvin(F) C = kelvin_to_celsius(K) return C
18.777778
47
0.656805
23
169
4.565217
0.521739
0.228571
0
0
0
0
0
0
0
0
0
0
0.254438
169
8
48
21.125
0.833333
0.254438
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
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
1
0
0
0
0
0
0
0
4
20d57e1a8a831c6f94414a23cecef0df0294572f
269
py
Python
tests/conftest.py
BookOps-CAT/cat-maintenance
264d43bf8a87b80ad2fa439ae4c5bd8f719f02da
[ "MIT" ]
null
null
null
tests/conftest.py
BookOps-CAT/cat-maintenance
264d43bf8a87b80ad2fa439ae4c5bd8f719f02da
[ "MIT" ]
null
null
null
tests/conftest.py
BookOps-CAT/cat-maintenance
264d43bf8a87b80ad2fa439ae4c5bd8f719f02da
[ "MIT" ]
null
null
null
import json import pytest @pytest.fixture def test_bib(): with open(".\\test_files\\bib.json") as file: return json.load(file) @pytest.fixture def test_mixed_bib(): with open(".\\test_files\\mixed_bib.json") as file: return json.load(file)
16.8125
55
0.669145
40
269
4.35
0.375
0.149425
0.183908
0.229885
0.586207
0.356322
0.356322
0.356322
0
0
0
0
0.189591
269
15
56
17.933333
0.798165
0
0
0.4
0
0
0.193309
0.193309
0
0
0
0
0
1
0.2
true
0
0.2
0
0.6
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
0
0
1
0
0
4
20e77eb0b4c59c0312f4fc50878035a552c60784
364
py
Python
web-ui/AIOT-635/instance/config.py
kenhutaiwan/learning-practice
6597a691fd090de718937087f3610971696f4894
[ "MIT" ]
null
null
null
web-ui/AIOT-635/instance/config.py
kenhutaiwan/learning-practice
6597a691fd090de718937087f3610971696f4894
[ "MIT" ]
10
2021-04-16T01:00:49.000Z
2021-12-09T13:41:20.000Z
web-ui/AIOT-635/instance/config.py
kenhutaiwan/learning-practice
6597a691fd090de718937087f3610971696f4894
[ "MIT" ]
null
null
null
JIRA_DOMAIN = {'RD2': ['innodiv-hwacom.atlassian.net','innodiv-hwacom.atlassian.net'], 'RD5': ['srddiv5-hwacom.atlassian.net']} API_PREFIX = 'rest/agile/1.0' # project_id : column_name STORY_POINT_COL_NAME = {'10005': 'customfield_10027', '10006': 'customfield_10027', '10004': 'customfield_10026' }
40.444444
86
0.604396
39
364
5.384615
0.717949
0.214286
0.257143
0.238095
0
0
0
0
0
0
0
0.125899
0.236264
364
8
87
45.5
0.629496
0.065934
0
0
0
0
0.502959
0.248521
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
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