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
2e0d039ba3ce5fcbb82a8fffabce11f58b6095a5
40
py
Python
vnpy/gateway/deribit/__init__.py
ChaunceyDong/vnpy
1c1b683ffc1c842bb7661e8194eca61af30cf586
[ "MIT" ]
19,529
2015-03-02T12:17:35.000Z
2022-03-31T17:18:27.000Z
vnpy/gateway/deribit/__init__.py
ChaunceyDong/vnpy
1c1b683ffc1c842bb7661e8194eca61af30cf586
[ "MIT" ]
2,186
2015-03-04T23:16:33.000Z
2022-03-31T03:44:01.000Z
vnpy/gateway/deribit/__init__.py
ChaunceyDong/vnpy
1c1b683ffc1c842bb7661e8194eca61af30cf586
[ "MIT" ]
8,276
2015-03-02T05:21:04.000Z
2022-03-31T13:13:13.000Z
from vnpy_deribit import DeribitGateway
20
39
0.9
5
40
7
1
0
0
0
0
0
0
0
0
0
0
0
0.1
40
1
40
40
0.972222
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
2e124983d0201eb3b420e0153f925e5362dacb7f
93
py
Python
shmchannel/__init__.py
tiliado/shmem-ipc-channel
8cbbe615de441dd72f32f9b51089cf3635e04cda
[ "BSD-2-Clause" ]
null
null
null
shmchannel/__init__.py
tiliado/shmem-ipc-channel
8cbbe615de441dd72f32f9b51089cf3635e04cda
[ "BSD-2-Clause" ]
null
null
null
shmchannel/__init__.py
tiliado/shmem-ipc-channel
8cbbe615de441dd72f32f9b51089cf3635e04cda
[ "BSD-2-Clause" ]
null
null
null
# noinspection PyUnresolvedReferences from .channel import Channel, MODE_CLIENT, MODE_SERVER
31
54
0.860215
10
93
7.8
0.8
0
0
0
0
0
0
0
0
0
0
0
0.096774
93
2
55
46.5
0.928571
0.376344
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
1
0
0
5
5cf7bc6a3afc23b4034001818d67905531eacd7a
1,024
py
Python
facebook/admin.py
fabiangermann/django-facebook-graph
e63039c94a50f293ae79e8ecda24a9c7d1b61c68
[ "Apache-2.0" ]
null
null
null
facebook/admin.py
fabiangermann/django-facebook-graph
e63039c94a50f293ae79e8ecda24a9c7d1b61c68
[ "Apache-2.0" ]
null
null
null
facebook/admin.py
fabiangermann/django-facebook-graph
e63039c94a50f293ae79e8ecda24a9c7d1b61c68
[ "Apache-2.0" ]
null
null
null
""" Use this module for imports to extend the Admin classes """ from django.conf import settings if 'facebook.modules.profile.page' in settings.INSTALLED_APPS: from facebook.modules.profile.page.admin import PageAdmin if 'facebook.modules.profile.user' in settings.INSTALLED_APPS: from facebook.modules.profile.user.admin import UserAdmin if 'facebook.modules.profile.event' in settings.INSTALLED_APPS: from facebook.modules.profile.event.admin import EventAdmin if 'facebook.modules.profile.application' in settings.INSTALLED_APPS: from facebook.modules.profile.application.admin import RequestAdmin if 'facebook.modules.media' in settings.INSTALLED_APPS: from facebook.modules.media.admin import PhotoAdmin if 'facebook.modules.connections.post' in settings.INSTALLED_APPS: from facebook.modules.connections.post.admin import PostAdmin if 'facebook.modules.connections.game' in settings.INSTALLED_APPS: from facebook.modules.connections.game.admin import ScoreAdmin, AchievementAdmin
36.571429
84
0.810547
133
1,024
6.18797
0.285714
0.255164
0.213852
0.195626
0.417983
0.417983
0.417983
0.36695
0
0
0
0
0.108398
1,024
27
85
37.925926
0.901424
0.053711
0
0
0
0
0.221064
0.221064
0
0
0
0
0
1
0
true
0
0.533333
0
0.533333
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
1
0
1
0
0
0
0
5
cf07b7e337196bac6efbf856a77d8683e211d5bf
211
py
Python
py_distance/__init__.py
dizley/py-distance
c67912513d268f8d01619ea0db31a6da13a8b34f
[ "MIT" ]
null
null
null
py_distance/__init__.py
dizley/py-distance
c67912513d268f8d01619ea0db31a6da13a8b34f
[ "MIT" ]
null
null
null
py_distance/__init__.py
dizley/py-distance
c67912513d268f8d01619ea0db31a6da13a8b34f
[ "MIT" ]
null
null
null
from .haversine import calculate as hav from .vincenty import calculate as vin from .law_of_cosines import calculate as cos from .equirectangular import calculate as rec from .polar_flat import calculate as pol
35.166667
45
0.834123
33
211
5.242424
0.515152
0.433526
0.491329
0
0
0
0
0
0
0
0
0
0.14218
211
5
46
42.2
0.955801
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
1
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
5
cf5475e5d324986246c2603c1bd34d02cebc7b23
113
py
Python
rl_toolkit/utils/__init__.py
markub3327/rl-toolk
c9478f614c03480f35d5f04f885e994b14a0c37f
[ "MIT" ]
7
2021-05-20T04:08:24.000Z
2022-01-09T20:25:03.000Z
rl_toolkit/utils/__init__.py
markub3327/rl-toolk
c9478f614c03480f35d5f04f885e994b14a0c37f
[ "MIT" ]
5
2021-05-17T08:39:59.000Z
2022-03-02T17:14:19.000Z
rl_toolkit/utils/__init__.py
markub3327/rl-toolk
c9478f614c03480f35d5f04f885e994b14a0c37f
[ "MIT" ]
null
null
null
from .replay_buffer import make_reverb_dataset # noqa from .variable_container import VariableContainer # noqa
37.666667
57
0.840708
14
113
6.5
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.123894
113
2
58
56.5
0.919192
0.079646
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
1
0
0
5
cf5cdcbaa07efc94d545743693d8d3f09183c455
56
py
Python
app/models/lgbm_default/__init__.py
carbonpredict/carbonpredict
702c761287ce4e088ae1817a88958a438a3cc006
[ "MIT" ]
null
null
null
app/models/lgbm_default/__init__.py
carbonpredict/carbonpredict
702c761287ce4e088ae1817a88958a438a3cc006
[ "MIT" ]
27
2020-06-11T11:00:15.000Z
2020-09-01T20:08:54.000Z
app/models/lgbm_default/__init__.py
carbonpredict/carbonpredict
702c761287ce4e088ae1817a88958a438a3cc006
[ "MIT" ]
1
2020-07-23T09:08:06.000Z
2020-07-23T09:08:06.000Z
from .impl import LGBMDefault, LGBMQuantileRegression
14
53
0.839286
5
56
9.4
1
0
0
0
0
0
0
0
0
0
0
0
0.125
56
3
54
18.666667
0.959184
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
1
0
0
5
d852e521dd2f3f19d406685f9b51238bd57c2971
532
py
Python
bifacial_radiance/__init__.py
kperrynrel/bifacial_radiance
cf5ae46b4ef93990e3e1619956a186376cb4fd8a
[ "BSD-3-Clause" ]
null
null
null
bifacial_radiance/__init__.py
kperrynrel/bifacial_radiance
cf5ae46b4ef93990e3e1619956a186376cb4fd8a
[ "BSD-3-Clause" ]
null
null
null
bifacial_radiance/__init__.py
kperrynrel/bifacial_radiance
cf5ae46b4ef93990e3e1619956a186376cb4fd8a
[ "BSD-3-Clause" ]
null
null
null
from bifacial_radiance.main import AnalysisObj, GroundObj, MetObj, RadianceObj, SceneObj #from bifacial_radiance.readepw import readepw from bifacial_radiance.module import ModuleObj from bifacial_radiance import load from bifacial_radiance import modelchain from bifacial_radiance.gui import gui from bifacial_radiance import mismatch from bifacial_radiance.spectral_utils import generate_spectra from bifacial_radiance import performance from ._version import get_versions __version__ = get_versions()['version'] del get_versions
40.923077
88
0.87406
68
532
6.558824
0.382353
0.242152
0.403587
0.233184
0
0
0
0
0
0
0
0
0.092105
532
12
89
44.333333
0.923395
0.084586
0
0
0
0
0.014403
0
0
0
0
0
0
1
0
false
0
0.818182
0
0.818182
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
d858422e4cf747e416eb28f83a9b9108dee3a1e0
130
py
Python
cozer/__version__.py
pearu/cozer
13220d2118f2704175857fd9812763ce4d0c973b
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
null
null
null
cozer/__version__.py
pearu/cozer
13220d2118f2704175857fd9812763ce4d0c973b
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
null
null
null
cozer/__version__.py
pearu/cozer
13220d2118f2704175857fd9812763ce4d0c973b
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
null
null
null
__version__ = '2.7' try: from __svn_version__ import version __version__ += '_svn' + version except ImportError: pass
18.571429
39
0.7
15
130
5.133333
0.666667
0.25974
0
0
0
0
0
0
0
0
0
0.019608
0.215385
130
6
40
21.666667
0.735294
0
0
0
0
0
0.053846
0
0
0
0
0
0
1
0
false
0.166667
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
1
1
0
0
0
0
5
d86d758dad1daf99d5e3d30b6af3fef9c5de5186
96
py
Python
venv/lib/python3.8/site-packages/tomlkit/toml_file.py
GiulianaPola/select_repeats
17a0d053d4f874e42cf654dd142168c2ec8fbd11
[ "MIT" ]
2
2022-03-13T01:58:52.000Z
2022-03-31T06:07:54.000Z
venv/lib/python3.8/site-packages/tomlkit/toml_file.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
19
2021-11-20T04:09:18.000Z
2022-03-23T15:05:55.000Z
venv/lib/python3.8/site-packages/tomlkit/toml_file.py
DesmoSearch/Desmobot
b70b45df3485351f471080deb5c785c4bc5c4beb
[ "MIT" ]
null
null
null
/home/runner/.cache/pip/pool/6a/4e/f0/ca7fab77637bfe77c0c551476cd744cee56f8a9723af7b78f69c36e7b0
96
96
0.895833
9
96
9.555556
1
0
0
0
0
0
0
0
0
0
0
0.385417
0
96
1
96
96
0.510417
0
0
0
0
0
0
0
0
1
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
1
0
0
0
1
0
0
0
0
0
0
0
0
5
d86f1feea46ddeafa4a74388af52b02ec5b287fc
258
py
Python
django3/crud/models.py
rafaelgarbelotte/projetopi
13f8d04d06efc65da1a1cb76f2cefe1fd05d8293
[ "MIT" ]
null
null
null
django3/crud/models.py
rafaelgarbelotte/projetopi
13f8d04d06efc65da1a1cb76f2cefe1fd05d8293
[ "MIT" ]
null
null
null
django3/crud/models.py
rafaelgarbelotte/projetopi
13f8d04d06efc65da1a1cb76f2cefe1fd05d8293
[ "MIT" ]
1
2021-11-28T14:43:08.000Z
2021-11-28T14:43:08.000Z
from django.db import models class Pessoa(models.Model): nome = models.CharField(max_length=100) servico = models.CharField(max_length=100) telefone = models.CharField(max_length=30) def __str__(self): return self.nome
21.5
47
0.682171
33
258
5.121212
0.606061
0.266272
0.319527
0.426036
0.319527
0
0
0
0
0
0
0.04
0.224806
258
11
48
23.454545
0.805
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0.142857
1
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
5
d8ae91d7c1d40144d6feb2f780b687c64af54f0c
53
py
Python
Python/Tests/TestData/AddImport/ImportFunctionFromExistingFromImportParens.py
techkey/PTVS
8355e67eedd8e915ca49bd38a2f36172696fd903
[ "Apache-2.0" ]
404
2019-05-07T02:21:57.000Z
2022-03-31T17:03:04.000Z
Python/Tests/TestData/AddImport/ImportFunctionFromExistingFromImportParens.py
techkey/PTVS
8355e67eedd8e915ca49bd38a2f36172696fd903
[ "Apache-2.0" ]
1,672
2019-05-06T21:09:38.000Z
2022-03-31T23:16:04.000Z
Python/Tests/TestData/AddImport/ImportFunctionFromExistingFromImportParens.py
techkey/PTVS
8355e67eedd8e915ca49bd38a2f36172696fd903
[ "Apache-2.0" ]
186
2019-05-13T03:17:37.000Z
2022-03-31T16:24:05.000Z
from test_module import (module_func_2) module_func()
26.5
39
0.849057
9
53
4.555556
0.666667
0.487805
0
0
0
0
0
0
0
0
0
0.020408
0.075472
53
2
40
26.5
0.816327
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
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
5
d8c0e1be3f3d4a4ba487984843b13faaa4195329
823
py
Python
packages/girder_worker/girder_worker/_test_plugins/plugins.py
ShenQianwithC/HistomicsTK
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
[ "Apache-2.0" ]
null
null
null
packages/girder_worker/girder_worker/_test_plugins/plugins.py
ShenQianwithC/HistomicsTK
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
[ "Apache-2.0" ]
null
null
null
packages/girder_worker/girder_worker/_test_plugins/plugins.py
ShenQianwithC/HistomicsTK
4ad7e72a7ebdabbdfc879254fad04ce7ca47e320
[ "Apache-2.0" ]
null
null
null
from girder_worker import GirderWorkerPluginABC class BaseTestPlugin(GirderWorkerPluginABC): def __init__(self, *args, **kwargs): pass def task_imports(self): return [] class TestCore(BaseTestPlugin): def task_imports(self): return ['os.path'] class TestPlugin1(BaseTestPlugin): pass class TestPlugin2(BaseTestPlugin): def task_imports(self): return ['girder_worker._test_plugins.tasks'] def TestPluginException1(BaseTestPlugin): def __init__(self, *arg, **kwargs): raise Exception('Exception in constructor') def TestPluginException2(BaseTestPlugin): def task_imports(self): raise Exception('Exception in task_imports') def TestPluginInvalidModule(BaseTestPlugin): def task_imports(self): return ['not a valid module']
21.102564
52
0.712029
84
823
6.761905
0.428571
0.116197
0.123239
0.158451
0.299296
0.200704
0
0
0
0
0
0.006033
0.194411
823
38
53
21.657895
0.850679
0
0
0.304348
0
0
0.130012
0.040097
0
0
0
0
0
1
0.434783
false
0.086957
0.304348
0.173913
1.086957
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
1
1
1
0
0
5
d8c3a1093f761fe84067111188fdad87b8044af1
129
py
Python
daiquiri/files/settings.py
agy-why/daiquiri
4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d
[ "Apache-2.0" ]
14
2018-12-23T18:35:02.000Z
2021-12-15T04:55:12.000Z
daiquiri/files/settings.py
agy-why/daiquiri
4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d
[ "Apache-2.0" ]
40
2018-12-20T12:44:05.000Z
2022-03-21T11:35:20.000Z
daiquiri/files/settings.py
agy-why/daiquiri
4d3e2ce51e202d5a8f1df404a0094a4e018dcb4d
[ "Apache-2.0" ]
5
2019-05-16T08:03:35.000Z
2021-08-23T20:03:11.000Z
import daiquiri.core.env as env FILES_BASE_PATH = env.get_abspath('FILES_BASE_PATH') FILES_BASE_URL = env.get('FILES_BASE_URL')
25.8
52
0.806202
23
129
4.130435
0.478261
0.378947
0.273684
0
0
0
0
0
0
0
0
0
0.085271
129
4
53
32.25
0.805085
0
0
0
0
0
0.224806
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
1
0
0
0
0
5
2b51315066df0c693bf92a9d3eae2be377c3af1c
65
py
Python
apps/pos/models.py
gvizquel/pyerp
c859f7293cabd1003f79112463cee93ac89fccba
[ "MIT" ]
null
null
null
apps/pos/models.py
gvizquel/pyerp
c859f7293cabd1003f79112463cee93ac89fccba
[ "MIT" ]
11
2020-06-05T22:50:37.000Z
2022-02-10T09:05:56.000Z
apps/pos/models.py
gvizquel/pyerp
c859f7293cabd1003f79112463cee93ac89fccba
[ "MIT" ]
null
null
null
# Librerias en carpetas locales from .submodels.pos import PyPos
21.666667
32
0.815385
9
65
5.888889
1
0
0
0
0
0
0
0
0
0
0
0
0.138462
65
2
33
32.5
0.946429
0.446154
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
1
0
0
5
991ecaae53f0a0d99b480c8e43b493c1c7e564cb
3,461
py
Python
integration/python/test/test_aggregation_api.py
ShekharPaatni/SDK
6534ffdb63af87c02c431df9add05a90370183cb
[ "Apache-2.0" ]
11
2019-04-16T02:11:17.000Z
2021-12-16T22:51:40.000Z
integration/python/test/test_aggregation_api.py
ShekharPaatni/SDK
6534ffdb63af87c02c431df9add05a90370183cb
[ "Apache-2.0" ]
81
2019-11-19T23:24:28.000Z
2022-03-28T11:35:47.000Z
integration/python/test/test_aggregation_api.py
ShekharPaatni/SDK
6534ffdb63af87c02c431df9add05a90370183cb
[ "Apache-2.0" ]
11
2020-07-08T02:29:56.000Z
2022-03-28T10:05:33.000Z
# coding: utf-8 """ Hydrogen Integration API The Hydrogen Integration API # noqa: E501 OpenAPI spec version: 1.3.1 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import integration_api from integration_api.api.aggregation_api import AggregationApi # noqa: E501 from integration_api.rest import ApiException class TestAggregationApi(unittest.TestCase): """AggregationApi unit test stubs""" def setUp(self): self.api = integration_api.api.aggregation_api.AggregationApi() # noqa: E501 def tearDown(self): pass def test_create_aggregation_account_using_post(self): """Test case for create_aggregation_account_using_post Create mapping between client,vendor,tenant # noqa: E501 """ pass def test_delete_aggregation_account_using_delete(self): """Test case for delete_aggregation_account_using_delete De-Link mapping between client,vendor,tenant # noqa: E501 """ pass def test_get_aggregation_account_all_using_get(self): """Test case for get_aggregation_account_all_using_get Fetch all aggregation account(s) details with the mapping created in POST endpoint for a client # noqa: E501 """ pass def test_get_aggregation_account_balance_all_using_get(self): """Test case for get_aggregation_account_balance_all_using_get Fetch all aggregation account balance details with for the given aggregation accounts # noqa: E501 """ pass def test_get_aggregation_account_balance_using_get(self): """Test case for get_aggregation_account_balance_using_get Fetch aggregation account balance details with the mapping created in POST endpoint # noqa: E501 """ pass def test_get_aggregation_account_holding_all_using_get(self): """Test case for get_aggregation_account_holding_all_using_get Fetch all aggregation account(s) holding details with the mapping created in POST endpoint # noqa: E501 """ pass def test_get_aggregation_account_holding_using_get(self): """Test case for get_aggregation_account_holding_using_get Fetch aggregation account holding details with the mapping created in POST endpoint # noqa: E501 """ pass def test_get_aggregation_account_transaction_all_using_get(self): """Test case for get_aggregation_account_transaction_all_using_get Fetch all aggregation account balance details with for the given aggregation accounts # noqa: E501 """ pass def test_get_aggregation_account_transaction_using_get(self): """Test case for get_aggregation_account_transaction_using_get Fetch aggregation account transaction details with the mapping created in POST endpoint # noqa: E501 """ pass def test_get_aggregation_account_using_get(self): """Test case for get_aggregation_account_using_get Fetch aggregation account details with the mapping created in POST endpoint # noqa: E501 """ pass def test_get_property_value(self): """Test case for get_property_value Get Value of the given property # noqa: E501 """ pass if __name__ == '__main__': unittest.main()
30.901786
117
0.713089
433
3,461
5.3903
0.184758
0.215938
0.143959
0.070694
0.748929
0.61054
0.600257
0.600257
0.540703
0.489289
0
0.017274
0.230569
3,461
111
118
31.18018
0.859181
0.531349
0
0.352941
1
0
0.005948
0
0
0
0
0
0
1
0.382353
false
0.352941
0.147059
0
0.558824
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
1
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
5
9958ce963946067cf63de011195b4060dfe1fc47
133,042
py
Python
docs/raspiwrite.py
LukeMcCulloch/Raspberry-Pi-Fun-Cluster-Computer
9b50fc4b0bf33f831af8372b076385e9b8f6b9b4
[ "MIT" ]
null
null
null
docs/raspiwrite.py
LukeMcCulloch/Raspberry-Pi-Fun-Cluster-Computer
9b50fc4b0bf33f831af8372b076385e9b8f6b9b4
[ "MIT" ]
null
null
null
docs/raspiwrite.py
LukeMcCulloch/Raspberry-Pi-Fun-Cluster-Computer
9b50fc4b0bf33f831af8372b076385e9b8f6b9b4
[ "MIT" ]
null
null
null
<!DOCTYPE html> <html> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# githubog: http://ogp.me/ns/fb/githubog#"> <meta charset='utf-8'> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>RasPiWrite/raspiwrite.py at master · exaviorn/RasPiWrite · GitHub</title> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" /> <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub" /> <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png" /> <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png" /> <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png" /> <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png" /> <link rel="logo" type="image/svg" href="https://github-media-downloads.s3.amazonaws.com/github-logo.svg" /> <meta property="og:image" content="https://a248.e.akamai.net/assets.github.com/images/modules/logos_page/Octocat.png"> <meta name="hostname" content="fe3.rs.github.com"> <link rel="assets" href="https://a248.e.akamai.net/assets.github.com/"> <link rel="xhr-socket" href="/_sockets" /> <meta name="msapplication-TileImage" content="/windows-tile.png" /> <meta name="msapplication-TileColor" content="#ffffff" /> <meta name="selected-link" value="repo_source" data-pjax-transient /> <meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /> <link rel="icon" type="image/x-icon" href="/favicon.ico" /> <meta content="authenticity_token" name="csrf-param" /> <meta content="5dhFHRvpv9SIDSzAt4pYVycr1snPBARiHQdvg1PL0ns=" name="csrf-token" /> <link href="https://a248.e.akamai.net/assets.github.com/assets/github-51f046bb24b211de3abde37dc8e6e0e3069e1ee6.css" media="all" rel="stylesheet" type="text/css" /> <link href="https://a248.e.akamai.net/assets.github.com/assets/github2-b046d81a359bd0dd393698ea6a790d082330c2d8.css" media="all" rel="stylesheet" type="text/css" /> <script src="https://a248.e.akamai.net/assets.github.com/assets/frameworks-5356b8919752ed538d797b3aa4996eed793b46a1.js" type="text/javascript"></script> <script src="https://a248.e.akamai.net/assets.github.com/assets/github-c8d11dc916e5476e1fc9f8ef2f896f487badc71f.js" type="text/javascript"></script> <meta http-equiv="x-pjax-version" content="0b472c00b16d62432d95c4ee6eb8616f"> <link data-pjax-transient rel='permalink' href='/exaviorn/RasPiWrite/blob/413db87d444866048bc02a9d0f2d77780a7dff69/raspiwrite.py'> <meta property="og:title" content="RasPiWrite"/> <meta property="og:type" content="githubog:gitrepository"/> <meta property="og:url" content="https://github.com/exaviorn/RasPiWrite"/> <meta property="og:image" content="https://a248.e.akamai.net/assets.github.com/images/gravatars/gravatar-user-420.png"/> <meta property="og:site_name" content="GitHub"/> <meta property="og:description" content="RasPiWrite - A Python Script that prepairs and installs a Raspberry Pi compatiable distro to an SD Card"/> <meta name="description" content="RasPiWrite - A Python Script that prepairs and installs a Raspberry Pi compatiable distro to an SD Card" /> <meta content="1570715" name="octolytics-dimension-user_id" /><meta content="exaviorn" name="octolytics-dimension-user_login" /><meta content="3817748" name="octolytics-dimension-repository_id" /><meta content="exaviorn/RasPiWrite" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="3817748" name="octolytics-dimension-repository_network_root_id" /><meta content="exaviorn/RasPiWrite" name="octolytics-dimension-repository_network_root_nwo" /> <link href="https://github.com/exaviorn/RasPiWrite/commits/master.atom" rel="alternate" title="Recent Commits to RasPiWrite:master" type="application/atom+xml" /> </head> <body class="logged_out page-blob macintosh vis-public env-production "> <div class="wrapper"> <div class="header header-logged-out"> <div class="container clearfix"> <a class="header-logo-wordmark" href="https://github.com/"> <span class="mega-octicon octicon-logo-github"></span> </a> <div class="header-actions"> <a class="button primary" href="/signup">Sign up</a> <a class="button" href="/login?return_to=%2Fexaviorn%2FRasPiWrite%2Fblob%2Fmaster%2Fraspiwrite.py">Sign in</a> </div> <div class="command-bar js-command-bar in-repository"> <ul class="top-nav"> <li class="explore"><a href="/explore">Explore</a></li> <li class="features"><a href="/features">Features</a></li> <li class="enterprise"><a href="https://enterprise.github.com/">Enterprise</a></li> <li class="blog"><a href="/blog">Blog</a></li> </ul> <form accept-charset="UTF-8" action="/search" class="command-bar-form" id="top_search_form" method="get"> <input type="text" data-hotkey=" s" name="q" id="js-command-bar-field" placeholder="Search or type a command" tabindex="1" autocapitalize="off" data-repo="exaviorn/RasPiWrite" data-branch="master" data-sha="88974c8522f7742247a0df4ea876fa4f9dbb3644" > <input type="hidden" name="nwo" value="exaviorn/RasPiWrite" /> <div class="select-menu js-menu-container js-select-menu search-context-select-menu"> <span class="minibutton select-menu-button js-menu-target"> <span class="js-select-button">This repository</span> </span> <div class="select-menu-modal-holder js-menu-content js-navigation-container"> <div class="select-menu-modal"> <div class="select-menu-item js-navigation-item js-this-repository-navigation-item selected"> <span class="select-menu-item-icon octicon octicon-check"></span> <input type="radio" class="js-search-this-repository" name="search_target" value="repository" checked="checked" /> <div class="select-menu-item-text js-select-button-text">This repository</div> </div> <!-- /.select-menu-item --> <div class="select-menu-item js-navigation-item js-all-repositories-navigation-item"> <span class="select-menu-item-icon octicon octicon-check"></span> <input type="radio" name="search_target" value="global" /> <div class="select-menu-item-text js-select-button-text">All repositories</div> </div> <!-- /.select-menu-item --> </div> </div> </div> <span class="octicon help tooltipped downwards" title="Show command bar help"> <span class="octicon octicon-question"></span> </span> <input type="hidden" name="ref" value="cmdform"> </form> </div> </div> </div> <div class="site" itemscope itemtype="http://schema.org/WebPage"> <div class="pagehead repohead instapaper_ignore readability-menu"> <div class="container"> <ul class="pagehead-actions"> <li> <a href="/login?return_to=%2Fexaviorn%2FRasPiWrite" class="minibutton with-count js-toggler-target star-button entice tooltipped upwards" title="You must be signed in to use this feature" rel="nofollow"> <span class="octicon octicon-star"></span>Star </a> <a class="social-count js-social-count" href="/exaviorn/RasPiWrite/stargazers"> 189 </a> </li> <li> <a href="/login?return_to=%2Fexaviorn%2FRasPiWrite" class="minibutton with-count js-toggler-target fork-button entice tooltipped upwards" title="You must be signed in to fork a repository" rel="nofollow"> <span class="octicon octicon-git-branch"></span>Fork </a> <a href="/exaviorn/RasPiWrite/network" class="social-count"> 154 </a> </li> </ul> <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public"> <span class="repo-label"><span>public</span></span> <span class="mega-octicon octicon-repo"></span> <span class="author"> <a href="/exaviorn" class="url fn" itemprop="url" rel="author"><span itemprop="title">exaviorn</span></a></span ><span class="repohead-name-divider">/</span><strong ><a href="/exaviorn/RasPiWrite" class="js-current-repository js-repo-home-link">RasPiWrite</a></strong> <span class="page-context-loader"> <img alt="Octocat-spinner-32" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </span> </h1> </div><!-- /.container --> </div><!-- /.repohead --> <div class="container"> <div class="repository-with-sidebar repo-container "> <div class="repository-sidebar"> <div class="repo-nav repo-nav-full js-repository-container-pjax js-octicon-loaders"> <div class="repo-nav-contents"> <ul class="repo-menu"> <li class="tooltipped leftwards" title="Code"> <a href="/exaviorn/RasPiWrite" class="js-selected-navigation-item selected" data-gotokey="c" data-pjax="true" data-selected-links="repo_source repo_downloads repo_commits repo_tags repo_branches /exaviorn/RasPiWrite"> <span class="octicon octicon-code"></span> <span class="full-word">Code</span> <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </a> </li> <li class="tooltipped leftwards" title="Issues"> <a href="/exaviorn/RasPiWrite/issues" class="js-selected-navigation-item js-disable-pjax" data-gotokey="i" data-selected-links="repo_issues /exaviorn/RasPiWrite/issues"> <span class="octicon octicon-issue-opened"></span> <span class="full-word">Issues</span> <span class='counter'>62</span> <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </a> </li> <li class="tooltipped leftwards" title="Pull Requests"><a href="/exaviorn/RasPiWrite/pulls" class="js-selected-navigation-item js-disable-pjax" data-gotokey="p" data-selected-links="repo_pulls /exaviorn/RasPiWrite/pulls"> <span class="octicon octicon-git-pull-request"></span> <span class="full-word">Pull Requests</span> <span class='counter'>45</span> <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </a> </li> </ul> <div class="repo-menu-separator"></div> <ul class="repo-menu"> <li class="tooltipped leftwards" title="Pulse"> <a href="/exaviorn/RasPiWrite/pulse" class="js-selected-navigation-item " data-pjax="true" data-selected-links="pulse /exaviorn/RasPiWrite/pulse"> <span class="octicon octicon-pulse"></span> <span class="full-word">Pulse</span> <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </a> </li> <li class="tooltipped leftwards" title="Graphs"> <a href="/exaviorn/RasPiWrite/graphs" class="js-selected-navigation-item " data-pjax="true" data-selected-links="repo_graphs repo_contributors /exaviorn/RasPiWrite/graphs"> <span class="octicon octicon-graph"></span> <span class="full-word">Graphs</span> <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </a> </li> <li class="tooltipped leftwards" title="Network"> <a href="/exaviorn/RasPiWrite/network" class="js-selected-navigation-item js-disable-pjax" data-selected-links="repo_network /exaviorn/RasPiWrite/network"> <span class="octicon octicon-git-branch"></span> <span class="full-word">Network</span> <img alt="Octocat-spinner-32" class="mini-loader" height="16" src="https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif" width="16" /> </a> </li> </ul> </div> </div> <div class="only-with-full-nav"> <div class="clone-url open" data-protocol-type="http" data-url="/users/set_protocol?protocol_selector=http&amp;protocol_type=clone"> <h3><strong>HTTPS</strong> clone URL</h3> <input type="text" class="clone js-url-field" value="https://github.com/exaviorn/RasPiWrite.git" readonly="readonly"> <span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="https://github.com/exaviorn/RasPiWrite.git" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span> </div> <div class="clone-url " data-protocol-type="subversion" data-url="/users/set_protocol?protocol_selector=subversion&amp;protocol_type=clone"> <h3><strong>Subversion</strong> checkout URL</h3> <input type="text" class="clone js-url-field" value="https://github.com/exaviorn/RasPiWrite" readonly="readonly"> <span class="js-zeroclipboard url-box-clippy minibutton zeroclipboard-button" data-clipboard-text="https://github.com/exaviorn/RasPiWrite" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span> </div> <p class="clone-options">You can clone with <a href="#" class="js-clone-selector" data-protocol="http">HTTPS</a>, <a href="#" class="js-clone-selector" data-protocol="subversion">Subversion</a>, and <a href="https://help.github.com/articles/which-remote-url-should-i-use">other methods.</a> </p> <a href="http://mac.github.com" class="minibutton sidebar-button"> <span class="octicon octicon-device-desktop"></span> Clone in Desktop </a> <a href="/exaviorn/RasPiWrite/archive/master.zip" class="minibutton sidebar-button" title="Download this repository as a zip file" rel="nofollow"> <span class="octicon octicon-cloud-download"></span> Download ZIP </a> </div> </div> <div id="js-repo-pjax-container" class="repository-content context-loader-container" data-pjax-container> <!-- blob contrib key: blob_contributors:v21:9477922454ae0e8af1af2b5f57fb70fe --> <!-- blob contrib frag key: views10/v8/blob_contributors:v21:9477922454ae0e8af1af2b5f57fb70fe --> <p title="This is a placeholder element" class="js-history-link-replace hidden"></p> <a href="/exaviorn/RasPiWrite/find/master" data-pjax data-hotkey="t" style="display:none">Show File Finder</a> <div class="file-navigation"> <div class="select-menu js-menu-container js-select-menu" > <span class="minibutton select-menu-button js-menu-target" data-hotkey="w" data-master-branch="master" data-ref="master"> <span class="octicon octicon-git-branch"></span> <i>branch:</i> <span class="js-select-button">master</span> </span> <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax> <div class="select-menu-modal"> <div class="select-menu-header"> <span class="select-menu-title">Switch branches/tags</span> <span class="octicon octicon-remove-close js-menu-close"></span> </div> <!-- /.select-menu-header --> <div class="select-menu-filters"> <div class="select-menu-text-filter"> <input type="text" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags"> </div> <div class="select-menu-tabs"> <ul> <li class="select-menu-tab"> <a href="#" data-tab-filter="branches" class="js-select-menu-tab">Branches</a> </li> <li class="select-menu-tab"> <a href="#" data-tab-filter="tags" class="js-select-menu-tab">Tags</a> </li> </ul> </div><!-- /.select-menu-tabs --> </div><!-- /.select-menu-filters --> <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches"> <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> <div class="select-menu-item js-navigation-item selected"> <span class="select-menu-item-icon octicon octicon-check"></span> <a href="/exaviorn/RasPiWrite/blob/master/raspiwrite.py" class="js-navigation-open select-menu-item-text js-select-button-text css-truncate-target" data-name="master" rel="nofollow" title="master">master</a> </div> <!-- /.select-menu-item --> </div> <div class="select-menu-no-results">Nothing to show</div> </div> <!-- /.select-menu-list --> <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags"> <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> </div> <div class="select-menu-no-results">Nothing to show</div> </div> <!-- /.select-menu-list --> </div> <!-- /.select-menu-modal --> </div> <!-- /.select-menu-modal-holder --> </div> <!-- /.select-menu --> <div class="breadcrumb"> <span class='repo-root js-repo-root'><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/exaviorn/RasPiWrite" data-branch="master" data-direction="back" data-pjax="true" itemscope="url"><span itemprop="title">RasPiWrite</span></a></span></span><span class="separator"> / </span><strong class="final-path">raspiwrite.py</strong> <span class="js-zeroclipboard minibutton zeroclipboard-button" data-clipboard-text="raspiwrite.py" data-copied-hint="copied!" title="copy to clipboard"><span class="octicon octicon-clippy"></span></span> </div> </div> <div class="commit file-history-tease"> <img class="main-avatar" height="24" src="https://secure.gravatar.com/avatar/d5f36fbefbf4a5f37d328ef5177794f7?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" /> <span class="author"><a href="/tech2077" rel="author">tech2077</a></span> <time class="js-relative-date" datetime="2012-07-14T12:29:29-07:00" title="2012-07-14 12:29:29">July 14, 2012</time> <div class="commit-title"> <a href="/exaviorn/RasPiWrite/commit/f406d657d8998791b444c5542c2f001f4c5e4f3d" class="message">Fix wrong dd block size notation for OS X with OS check and add prope…</a> </div> <div class="participation"> <p class="quickstat"><a href="#blob_contributors_box" rel="facebox"><strong>4</strong> contributors</a></p> <a class="avatar tooltipped downwards" title="exaviorn" href="/exaviorn/RasPiWrite/commits/master/raspiwrite.py?author=exaviorn"><img height="20" src="https://secure.gravatar.com/avatar/197bc69efbedc62375c469083743c20d?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="20" /></a> <a class="avatar tooltipped downwards" title="tech2077" href="/exaviorn/RasPiWrite/commits/master/raspiwrite.py?author=tech2077"><img height="20" src="https://secure.gravatar.com/avatar/d5f36fbefbf4a5f37d328ef5177794f7?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="20" /></a> <a class="avatar tooltipped downwards" title="alecthegeek" href="/exaviorn/RasPiWrite/commits/master/raspiwrite.py?author=alecthegeek"><img height="20" src="https://secure.gravatar.com/avatar/650806949023f752870363ad7de45188?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="20" /></a> <a class="avatar tooltipped downwards" title="andypiper" href="/exaviorn/RasPiWrite/commits/master/raspiwrite.py?author=andypiper"><img height="20" src="https://secure.gravatar.com/avatar/1526dcb784188b422544c6344ef223c2?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="20" /></a> </div> <div id="blob_contributors_box" style="display:none"> <h2 class="facebox-header">Users who have contributed to this file</h2> <ul class="facebox-user-list"> <li class="facebox-user-list-item"> <img height="24" src="https://secure.gravatar.com/avatar/197bc69efbedc62375c469083743c20d?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" /> <a href="/exaviorn">exaviorn</a> </li> <li class="facebox-user-list-item"> <img height="24" src="https://secure.gravatar.com/avatar/d5f36fbefbf4a5f37d328ef5177794f7?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" /> <a href="/tech2077">tech2077</a> </li> <li class="facebox-user-list-item"> <img height="24" src="https://secure.gravatar.com/avatar/650806949023f752870363ad7de45188?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" /> <a href="/alecthegeek">alecthegeek</a> </li> <li class="facebox-user-list-item"> <img height="24" src="https://secure.gravatar.com/avatar/1526dcb784188b422544c6344ef223c2?s=140&amp;d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png" width="24" /> <a href="/andypiper">andypiper</a> </li> </ul> </div> </div> <div id="files" class="bubble"> <div class="file"> <div class="meta"> <div class="info"> <span class="icon"><b class="octicon octicon-file-text"></b></span> <span class="mode" title="File Mode">executable file</span> <span>468 lines (422 sloc)</span> <span>19.0 kb</span> </div> <div class="actions"> <div class="button-group"> <a class="minibutton js-entice" href="" data-entice="You must be signed in and on a branch to make or propose changes">Edit</a> <a href="/exaviorn/RasPiWrite/raw/master/raspiwrite.py" class="button minibutton " id="raw-url">Raw</a> <a href="/exaviorn/RasPiWrite/blame/master/raspiwrite.py" class="button minibutton ">Blame</a> <a href="/exaviorn/RasPiWrite/commits/master/raspiwrite.py" class="button minibutton " rel="nofollow">History</a> </div><!-- /.button-group --> <a class="minibutton danger empty-icon js-entice" href="" data-entice="You must be signed in and on a branch to make or propose changes"> Delete </a> </div><!-- /.actions --> </div> <div class="blob-wrapper data type-python js-blob-data"> <table class="file-code file-diff"> <tr class="file-code-line"> <td class="blob-line-nums"> <span id="L1" rel="#L1">1</span> <span id="L2" rel="#L2">2</span> <span id="L3" rel="#L3">3</span> <span id="L4" rel="#L4">4</span> <span id="L5" rel="#L5">5</span> <span id="L6" rel="#L6">6</span> <span id="L7" rel="#L7">7</span> <span id="L8" rel="#L8">8</span> <span id="L9" rel="#L9">9</span> <span id="L10" rel="#L10">10</span> <span id="L11" rel="#L11">11</span> <span id="L12" rel="#L12">12</span> <span id="L13" rel="#L13">13</span> <span id="L14" rel="#L14">14</span> <span id="L15" rel="#L15">15</span> <span id="L16" rel="#L16">16</span> <span id="L17" rel="#L17">17</span> <span id="L18" rel="#L18">18</span> <span id="L19" rel="#L19">19</span> <span id="L20" rel="#L20">20</span> <span id="L21" rel="#L21">21</span> <span id="L22" rel="#L22">22</span> <span id="L23" rel="#L23">23</span> <span id="L24" rel="#L24">24</span> <span id="L25" rel="#L25">25</span> <span id="L26" rel="#L26">26</span> <span id="L27" rel="#L27">27</span> <span id="L28" rel="#L28">28</span> <span id="L29" rel="#L29">29</span> <span id="L30" rel="#L30">30</span> <span id="L31" rel="#L31">31</span> <span id="L32" rel="#L32">32</span> <span id="L33" rel="#L33">33</span> <span id="L34" rel="#L34">34</span> <span id="L35" rel="#L35">35</span> <span id="L36" rel="#L36">36</span> <span id="L37" rel="#L37">37</span> <span id="L38" rel="#L38">38</span> <span id="L39" rel="#L39">39</span> <span id="L40" rel="#L40">40</span> <span id="L41" rel="#L41">41</span> <span id="L42" rel="#L42">42</span> <span id="L43" rel="#L43">43</span> <span id="L44" rel="#L44">44</span> <span id="L45" rel="#L45">45</span> <span id="L46" rel="#L46">46</span> <span id="L47" rel="#L47">47</span> <span id="L48" rel="#L48">48</span> <span id="L49" rel="#L49">49</span> <span id="L50" rel="#L50">50</span> <span id="L51" rel="#L51">51</span> <span id="L52" rel="#L52">52</span> <span id="L53" rel="#L53">53</span> <span id="L54" rel="#L54">54</span> <span id="L55" rel="#L55">55</span> <span id="L56" rel="#L56">56</span> <span id="L57" rel="#L57">57</span> <span id="L58" rel="#L58">58</span> <span id="L59" rel="#L59">59</span> <span id="L60" rel="#L60">60</span> <span id="L61" rel="#L61">61</span> <span id="L62" rel="#L62">62</span> <span id="L63" rel="#L63">63</span> <span id="L64" rel="#L64">64</span> <span id="L65" rel="#L65">65</span> <span id="L66" rel="#L66">66</span> <span id="L67" rel="#L67">67</span> <span id="L68" rel="#L68">68</span> <span id="L69" rel="#L69">69</span> <span id="L70" rel="#L70">70</span> <span id="L71" rel="#L71">71</span> <span id="L72" rel="#L72">72</span> <span id="L73" rel="#L73">73</span> <span id="L74" rel="#L74">74</span> <span id="L75" rel="#L75">75</span> <span id="L76" rel="#L76">76</span> <span id="L77" rel="#L77">77</span> <span id="L78" rel="#L78">78</span> <span id="L79" rel="#L79">79</span> <span id="L80" rel="#L80">80</span> <span id="L81" rel="#L81">81</span> <span id="L82" rel="#L82">82</span> <span id="L83" rel="#L83">83</span> <span id="L84" rel="#L84">84</span> <span id="L85" rel="#L85">85</span> <span id="L86" rel="#L86">86</span> <span id="L87" rel="#L87">87</span> <span id="L88" rel="#L88">88</span> <span id="L89" rel="#L89">89</span> <span id="L90" rel="#L90">90</span> <span id="L91" rel="#L91">91</span> <span id="L92" rel="#L92">92</span> <span id="L93" rel="#L93">93</span> <span id="L94" rel="#L94">94</span> <span id="L95" rel="#L95">95</span> <span id="L96" rel="#L96">96</span> <span id="L97" rel="#L97">97</span> <span id="L98" rel="#L98">98</span> <span id="L99" rel="#L99">99</span> <span id="L100" rel="#L100">100</span> <span id="L101" rel="#L101">101</span> <span id="L102" rel="#L102">102</span> <span id="L103" rel="#L103">103</span> <span id="L104" rel="#L104">104</span> <span id="L105" rel="#L105">105</span> <span id="L106" rel="#L106">106</span> <span id="L107" rel="#L107">107</span> <span id="L108" rel="#L108">108</span> <span id="L109" rel="#L109">109</span> <span id="L110" rel="#L110">110</span> <span id="L111" rel="#L111">111</span> <span id="L112" rel="#L112">112</span> <span id="L113" rel="#L113">113</span> <span id="L114" rel="#L114">114</span> <span id="L115" rel="#L115">115</span> <span id="L116" rel="#L116">116</span> <span id="L117" rel="#L117">117</span> <span id="L118" rel="#L118">118</span> <span id="L119" rel="#L119">119</span> <span id="L120" rel="#L120">120</span> <span id="L121" rel="#L121">121</span> <span id="L122" rel="#L122">122</span> <span id="L123" rel="#L123">123</span> <span id="L124" rel="#L124">124</span> <span id="L125" rel="#L125">125</span> <span id="L126" rel="#L126">126</span> <span id="L127" rel="#L127">127</span> <span id="L128" rel="#L128">128</span> <span id="L129" rel="#L129">129</span> <span id="L130" rel="#L130">130</span> <span id="L131" rel="#L131">131</span> <span id="L132" rel="#L132">132</span> <span id="L133" rel="#L133">133</span> <span id="L134" rel="#L134">134</span> <span id="L135" rel="#L135">135</span> <span id="L136" rel="#L136">136</span> <span id="L137" rel="#L137">137</span> <span id="L138" rel="#L138">138</span> <span id="L139" rel="#L139">139</span> <span id="L140" rel="#L140">140</span> <span id="L141" rel="#L141">141</span> <span id="L142" rel="#L142">142</span> <span id="L143" rel="#L143">143</span> <span id="L144" rel="#L144">144</span> <span id="L145" rel="#L145">145</span> <span id="L146" rel="#L146">146</span> <span id="L147" rel="#L147">147</span> <span id="L148" rel="#L148">148</span> <span id="L149" rel="#L149">149</span> <span id="L150" rel="#L150">150</span> <span id="L151" rel="#L151">151</span> <span id="L152" rel="#L152">152</span> <span id="L153" rel="#L153">153</span> <span id="L154" rel="#L154">154</span> <span id="L155" rel="#L155">155</span> <span id="L156" rel="#L156">156</span> <span id="L157" rel="#L157">157</span> <span id="L158" rel="#L158">158</span> <span id="L159" rel="#L159">159</span> <span id="L160" rel="#L160">160</span> <span id="L161" rel="#L161">161</span> <span id="L162" rel="#L162">162</span> <span id="L163" rel="#L163">163</span> <span id="L164" rel="#L164">164</span> <span id="L165" rel="#L165">165</span> <span id="L166" rel="#L166">166</span> <span id="L167" rel="#L167">167</span> <span id="L168" rel="#L168">168</span> <span id="L169" rel="#L169">169</span> <span id="L170" rel="#L170">170</span> <span id="L171" rel="#L171">171</span> <span id="L172" rel="#L172">172</span> <span id="L173" rel="#L173">173</span> <span id="L174" rel="#L174">174</span> <span id="L175" rel="#L175">175</span> <span id="L176" rel="#L176">176</span> <span id="L177" rel="#L177">177</span> <span id="L178" rel="#L178">178</span> <span id="L179" rel="#L179">179</span> <span id="L180" rel="#L180">180</span> <span id="L181" rel="#L181">181</span> <span id="L182" rel="#L182">182</span> <span id="L183" rel="#L183">183</span> <span id="L184" rel="#L184">184</span> <span id="L185" rel="#L185">185</span> <span id="L186" rel="#L186">186</span> <span id="L187" rel="#L187">187</span> <span id="L188" rel="#L188">188</span> <span id="L189" rel="#L189">189</span> <span id="L190" rel="#L190">190</span> <span id="L191" rel="#L191">191</span> <span id="L192" rel="#L192">192</span> <span id="L193" rel="#L193">193</span> <span id="L194" rel="#L194">194</span> <span id="L195" rel="#L195">195</span> <span id="L196" rel="#L196">196</span> <span id="L197" rel="#L197">197</span> <span id="L198" rel="#L198">198</span> <span id="L199" rel="#L199">199</span> <span id="L200" rel="#L200">200</span> <span id="L201" rel="#L201">201</span> <span id="L202" rel="#L202">202</span> <span id="L203" rel="#L203">203</span> <span id="L204" rel="#L204">204</span> <span id="L205" rel="#L205">205</span> <span id="L206" rel="#L206">206</span> <span id="L207" rel="#L207">207</span> <span id="L208" rel="#L208">208</span> <span id="L209" rel="#L209">209</span> <span id="L210" rel="#L210">210</span> <span id="L211" rel="#L211">211</span> <span id="L212" rel="#L212">212</span> <span id="L213" rel="#L213">213</span> <span id="L214" rel="#L214">214</span> <span id="L215" rel="#L215">215</span> <span id="L216" rel="#L216">216</span> <span id="L217" rel="#L217">217</span> <span id="L218" rel="#L218">218</span> <span id="L219" rel="#L219">219</span> <span id="L220" rel="#L220">220</span> <span id="L221" rel="#L221">221</span> <span id="L222" rel="#L222">222</span> <span id="L223" rel="#L223">223</span> <span id="L224" rel="#L224">224</span> <span id="L225" rel="#L225">225</span> <span id="L226" rel="#L226">226</span> <span id="L227" rel="#L227">227</span> <span id="L228" rel="#L228">228</span> <span id="L229" rel="#L229">229</span> <span id="L230" rel="#L230">230</span> <span id="L231" rel="#L231">231</span> <span id="L232" rel="#L232">232</span> <span id="L233" rel="#L233">233</span> <span id="L234" rel="#L234">234</span> <span id="L235" rel="#L235">235</span> <span id="L236" rel="#L236">236</span> <span id="L237" rel="#L237">237</span> <span id="L238" rel="#L238">238</span> <span id="L239" rel="#L239">239</span> <span id="L240" rel="#L240">240</span> <span id="L241" rel="#L241">241</span> <span id="L242" rel="#L242">242</span> <span id="L243" rel="#L243">243</span> <span id="L244" rel="#L244">244</span> <span id="L245" rel="#L245">245</span> <span id="L246" rel="#L246">246</span> <span id="L247" rel="#L247">247</span> <span id="L248" rel="#L248">248</span> <span id="L249" rel="#L249">249</span> <span id="L250" rel="#L250">250</span> <span id="L251" rel="#L251">251</span> <span id="L252" rel="#L252">252</span> <span id="L253" rel="#L253">253</span> <span id="L254" rel="#L254">254</span> <span id="L255" rel="#L255">255</span> <span id="L256" rel="#L256">256</span> <span id="L257" rel="#L257">257</span> <span id="L258" rel="#L258">258</span> <span id="L259" rel="#L259">259</span> <span id="L260" rel="#L260">260</span> <span id="L261" rel="#L261">261</span> <span id="L262" rel="#L262">262</span> <span id="L263" rel="#L263">263</span> <span id="L264" rel="#L264">264</span> <span id="L265" rel="#L265">265</span> <span id="L266" rel="#L266">266</span> <span id="L267" rel="#L267">267</span> <span id="L268" rel="#L268">268</span> <span id="L269" rel="#L269">269</span> <span id="L270" rel="#L270">270</span> <span id="L271" rel="#L271">271</span> <span id="L272" rel="#L272">272</span> <span id="L273" rel="#L273">273</span> <span id="L274" rel="#L274">274</span> <span id="L275" rel="#L275">275</span> <span id="L276" rel="#L276">276</span> <span id="L277" rel="#L277">277</span> <span id="L278" rel="#L278">278</span> <span id="L279" rel="#L279">279</span> <span id="L280" rel="#L280">280</span> <span id="L281" rel="#L281">281</span> <span id="L282" rel="#L282">282</span> <span id="L283" rel="#L283">283</span> <span id="L284" rel="#L284">284</span> <span id="L285" rel="#L285">285</span> <span id="L286" rel="#L286">286</span> <span id="L287" rel="#L287">287</span> <span id="L288" rel="#L288">288</span> <span id="L289" rel="#L289">289</span> <span id="L290" rel="#L290">290</span> <span id="L291" rel="#L291">291</span> <span id="L292" rel="#L292">292</span> <span id="L293" rel="#L293">293</span> <span id="L294" rel="#L294">294</span> <span id="L295" rel="#L295">295</span> <span id="L296" rel="#L296">296</span> <span id="L297" rel="#L297">297</span> <span id="L298" rel="#L298">298</span> <span id="L299" rel="#L299">299</span> <span id="L300" rel="#L300">300</span> <span id="L301" rel="#L301">301</span> <span id="L302" rel="#L302">302</span> <span id="L303" rel="#L303">303</span> <span id="L304" rel="#L304">304</span> <span id="L305" rel="#L305">305</span> <span id="L306" rel="#L306">306</span> <span id="L307" rel="#L307">307</span> <span id="L308" rel="#L308">308</span> <span id="L309" rel="#L309">309</span> <span id="L310" rel="#L310">310</span> <span id="L311" rel="#L311">311</span> <span id="L312" rel="#L312">312</span> <span id="L313" rel="#L313">313</span> <span id="L314" rel="#L314">314</span> <span id="L315" rel="#L315">315</span> <span id="L316" rel="#L316">316</span> <span id="L317" rel="#L317">317</span> <span id="L318" rel="#L318">318</span> <span id="L319" rel="#L319">319</span> <span id="L320" rel="#L320">320</span> <span id="L321" rel="#L321">321</span> <span id="L322" rel="#L322">322</span> <span id="L323" rel="#L323">323</span> <span id="L324" rel="#L324">324</span> <span id="L325" rel="#L325">325</span> <span id="L326" rel="#L326">326</span> <span id="L327" rel="#L327">327</span> <span id="L328" rel="#L328">328</span> <span id="L329" rel="#L329">329</span> <span id="L330" rel="#L330">330</span> <span id="L331" rel="#L331">331</span> <span id="L332" rel="#L332">332</span> <span id="L333" rel="#L333">333</span> <span id="L334" rel="#L334">334</span> <span id="L335" rel="#L335">335</span> <span id="L336" rel="#L336">336</span> <span id="L337" rel="#L337">337</span> <span id="L338" rel="#L338">338</span> <span id="L339" rel="#L339">339</span> <span id="L340" rel="#L340">340</span> <span id="L341" rel="#L341">341</span> <span id="L342" rel="#L342">342</span> <span id="L343" rel="#L343">343</span> <span id="L344" rel="#L344">344</span> <span id="L345" rel="#L345">345</span> <span id="L346" rel="#L346">346</span> <span id="L347" rel="#L347">347</span> <span id="L348" rel="#L348">348</span> <span id="L349" rel="#L349">349</span> <span id="L350" rel="#L350">350</span> <span id="L351" rel="#L351">351</span> <span id="L352" rel="#L352">352</span> <span id="L353" rel="#L353">353</span> <span id="L354" rel="#L354">354</span> <span id="L355" rel="#L355">355</span> <span id="L356" rel="#L356">356</span> <span id="L357" rel="#L357">357</span> <span id="L358" rel="#L358">358</span> <span id="L359" rel="#L359">359</span> <span id="L360" rel="#L360">360</span> <span id="L361" rel="#L361">361</span> <span id="L362" rel="#L362">362</span> <span id="L363" rel="#L363">363</span> <span id="L364" rel="#L364">364</span> <span id="L365" rel="#L365">365</span> <span id="L366" rel="#L366">366</span> <span id="L367" rel="#L367">367</span> <span id="L368" rel="#L368">368</span> <span id="L369" rel="#L369">369</span> <span id="L370" rel="#L370">370</span> <span id="L371" rel="#L371">371</span> <span id="L372" rel="#L372">372</span> <span id="L373" rel="#L373">373</span> <span id="L374" rel="#L374">374</span> <span id="L375" rel="#L375">375</span> <span id="L376" rel="#L376">376</span> <span id="L377" rel="#L377">377</span> <span id="L378" rel="#L378">378</span> <span id="L379" rel="#L379">379</span> <span id="L380" rel="#L380">380</span> <span id="L381" rel="#L381">381</span> <span id="L382" rel="#L382">382</span> <span id="L383" rel="#L383">383</span> <span id="L384" rel="#L384">384</span> <span id="L385" rel="#L385">385</span> <span id="L386" rel="#L386">386</span> <span id="L387" rel="#L387">387</span> <span id="L388" rel="#L388">388</span> <span id="L389" rel="#L389">389</span> <span id="L390" rel="#L390">390</span> <span id="L391" rel="#L391">391</span> <span id="L392" rel="#L392">392</span> <span id="L393" rel="#L393">393</span> <span id="L394" rel="#L394">394</span> <span id="L395" rel="#L395">395</span> <span id="L396" rel="#L396">396</span> <span id="L397" rel="#L397">397</span> <span id="L398" rel="#L398">398</span> <span id="L399" rel="#L399">399</span> <span id="L400" rel="#L400">400</span> <span id="L401" rel="#L401">401</span> <span id="L402" rel="#L402">402</span> <span id="L403" rel="#L403">403</span> <span id="L404" rel="#L404">404</span> <span id="L405" rel="#L405">405</span> <span id="L406" rel="#L406">406</span> <span id="L407" rel="#L407">407</span> <span id="L408" rel="#L408">408</span> <span id="L409" rel="#L409">409</span> <span id="L410" rel="#L410">410</span> <span id="L411" rel="#L411">411</span> <span id="L412" rel="#L412">412</span> <span id="L413" rel="#L413">413</span> <span id="L414" rel="#L414">414</span> <span id="L415" rel="#L415">415</span> <span id="L416" rel="#L416">416</span> <span id="L417" rel="#L417">417</span> <span id="L418" rel="#L418">418</span> <span id="L419" rel="#L419">419</span> <span id="L420" rel="#L420">420</span> <span id="L421" rel="#L421">421</span> <span id="L422" rel="#L422">422</span> <span id="L423" rel="#L423">423</span> <span id="L424" rel="#L424">424</span> <span id="L425" rel="#L425">425</span> <span id="L426" rel="#L426">426</span> <span id="L427" rel="#L427">427</span> <span id="L428" rel="#L428">428</span> <span id="L429" rel="#L429">429</span> <span id="L430" rel="#L430">430</span> <span id="L431" rel="#L431">431</span> <span id="L432" rel="#L432">432</span> <span id="L433" rel="#L433">433</span> <span id="L434" rel="#L434">434</span> <span id="L435" rel="#L435">435</span> <span id="L436" rel="#L436">436</span> <span id="L437" rel="#L437">437</span> <span id="L438" rel="#L438">438</span> <span id="L439" rel="#L439">439</span> <span id="L440" rel="#L440">440</span> <span id="L441" rel="#L441">441</span> <span id="L442" rel="#L442">442</span> <span id="L443" rel="#L443">443</span> <span id="L444" rel="#L444">444</span> <span id="L445" rel="#L445">445</span> <span id="L446" rel="#L446">446</span> <span id="L447" rel="#L447">447</span> <span id="L448" rel="#L448">448</span> <span id="L449" rel="#L449">449</span> <span id="L450" rel="#L450">450</span> <span id="L451" rel="#L451">451</span> <span id="L452" rel="#L452">452</span> <span id="L453" rel="#L453">453</span> <span id="L454" rel="#L454">454</span> <span id="L455" rel="#L455">455</span> <span id="L456" rel="#L456">456</span> <span id="L457" rel="#L457">457</span> <span id="L458" rel="#L458">458</span> <span id="L459" rel="#L459">459</span> <span id="L460" rel="#L460">460</span> <span id="L461" rel="#L461">461</span> <span id="L462" rel="#L462">462</span> <span id="L463" rel="#L463">463</span> <span id="L464" rel="#L464">464</span> <span id="L465" rel="#L465">465</span> <span id="L466" rel="#L466">466</span> <span id="L467" rel="#L467">467</span> </td> <td class="blob-line-code"> <div class="highlight"><pre><div class='line' id='LC1'><span class="c">#!/usr/bin/env python</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="c"># ;d0KOd. .oOK0x: </span></div><div class='line' id='LC4'><span class="c"># 0xlllcoxolkolllloX </span></div><div class='line' id='LC5'><span class="c"># ;OccloddKNdxdocckc </span></div><div class='line' id='LC6'><span class="c"># .dkddkWNNMOdoxd, </span></div><div class='line' id='LC7'><span class="c"># .o:,x0....xd,ck&#39; </span></div><div class='line' id='LC8'><span class="c"># K:xOoloOOccloocW </span></div><div class='line' id='LC9'><span class="c"># .x;N:....xO....&#39;K;k,</span></div><div class='line' id='LC10'><span class="c"># O..Nc...:XNl...:X.,X</span></div><div class='line' id='LC11'><span class="c"># .kkx0NXk&#39;...dNNxldK&#39;</span></div><div class='line' id='LC12'><span class="c"># &#39;k...0o....,O...d: </span></div><div class='line' id='LC13'><span class="c"># ;o;&#39;oM0olkWc.;oc </span></div><div class='line' id='LC14'><span class="c"># .cOx....dOl. </span></div><div class='line' id='LC15'><span class="c"># .x00k. </span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'><span class="c">#//////////////////////////// </span></div><div class='line' id='LC18'><span class="c"># * Raspberry Pi SD Writer </span></div><div class='line' id='LC19'><span class="c"># * Matt Jump</span></div><div class='line' id='LC20'><span class="c"># * exaviorn.com</span></div><div class='line' id='LC21'><span class="c">#///////////////////////////</span></div><div class='line' id='LC22'><span class="c"># Copyright Matthew Jump 2012</span></div><div class='line' id='LC23'><span class="c"># The following code is licenced under the Gnu Public Licence, please see gpl.txt for reference</span></div><div class='line' id='LC24'><span class="c"># This program is free software: you can redistribute it and/or modify</span></div><div class='line' id='LC25'><span class="c"># it under the terms of the GNU General Public License as published by</span></div><div class='line' id='LC26'><span class="c"># the Free Software Foundation, either version 3 of the License, or</span></div><div class='line' id='LC27'><span class="c"># (at your option) any later version.</span></div><div class='line' id='LC28'><span class="c">#</span></div><div class='line' id='LC29'><span class="c"># This program is distributed in the hope that it will be useful,</span></div><div class='line' id='LC30'><span class="c"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class='line' id='LC31'><span class="c"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class='line' id='LC32'><span class="c"># GNU General Public License for more details.</span></div><div class='line' id='LC33'><span class="c">#</span></div><div class='line' id='LC34'><span class="c"># You should have received a copy of the GNU General Public License</span></div><div class='line' id='LC35'><span class="c"># along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class='line' id='LC36'><br/></div><div class='line' id='LC37'><span class="c"># VERSION 1.15 -MACOSX- (June 2012) BETA</span></div><div class='line' id='LC38'><span class="c"># * Fix to unzipping system - credit to alecthegeek</span></div><div class='line' id='LC39'><span class="c"># * More user friendly device selection, no chance of the root or time machine backup drive being selected</span></div><div class='line' id='LC40'><span class="c"># * Some spelling and grammar corrections</span></div><div class='line' id='LC41'><span class="c"># * FINALLY drag/drop file support, with full path support, e.g. /Users/me/Downloads - Thanks to Lewis Boon</span></div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'><span class="kn">import</span> <span class="nn">re</span><span class="o">,</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">urllib2</span><span class="o">,</span> <span class="nn">time</span><span class="o">,</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">threading</span></div><div class='line' id='LC44'><span class="kn">from</span> <span class="nn">commands</span> <span class="kn">import</span> <span class="o">*</span></div><div class='line' id='LC45'><span class="kn">from</span> <span class="nn">sys</span> <span class="kn">import</span> <span class="nb">exit</span></div><div class='line' id='LC46'><span class="kn">from</span> <span class="nn">random</span> <span class="kn">import</span> <span class="n">choice</span></div><div class='line' id='LC47'><span class="kn">from</span> <span class="nn">xml.dom.minidom</span> <span class="kn">import</span> <span class="n">parseString</span></div><div class='line' id='LC48'><br/></div><div class='line' id='LC49'><span class="n">version</span> <span class="o">=</span> <span class="mf">1.15</span></div><div class='line' id='LC50'><br/></div><div class='line' id='LC51'><span class="c">#Display Augs</span></div><div class='line' id='LC52'><span class="n">boldStart</span> <span class="o">=</span> <span class="s">&quot;</span><span class="se">\033</span><span class="s">[1m&quot;</span></div><div class='line' id='LC53'><span class="n">end</span> <span class="o">=</span> <span class="s">&quot;</span><span class="se">\033</span><span class="s">[0;0m&quot;</span></div><div class='line' id='LC54'><span class="n">WARNING</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\033</span><span class="s">[0;31m&#39;</span></div><div class='line' id='LC55'><br/></div><div class='line' id='LC56'><span class="n">OS</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span> <span class="c">#gets OS vars</span></div><div class='line' id='LC57'><br/></div><div class='line' id='LC58'><span class="k">def</span> <span class="nf">checkforUpdate</span><span class="p">():</span></div><div class='line' id='LC59'> <span class="k">print</span> <span class="s">&#39;Checking for updates...&#39;</span></div><div class='line' id='LC60'> <span class="k">global</span> <span class="n">version</span></div><div class='line' id='LC61'><br/></div><div class='line' id='LC62'> <span class="k">try</span><span class="p">:</span></div><div class='line' id='LC63'> <span class="nb">file</span> <span class="o">=</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="s">&#39;http://www.exaviorn.com/raspiwrite.xml&#39;</span><span class="p">,</span> <span class="n">timeout</span> <span class="o">=</span> <span class="mi">1</span><span class="p">)</span></div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'> <span class="n">data</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">read</span><span class="p">()</span></div><div class='line' id='LC66'> <span class="nb">file</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></div><div class='line' id='LC67'><br/></div><div class='line' id='LC68'> <span class="n">dom</span> <span class="o">=</span> <span class="n">parseString</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div><div class='line' id='LC69'><br/></div><div class='line' id='LC70'> <span class="n">versionToDate</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">dom</span><span class="o">.</span><span class="n">getElementsByTagName</span><span class="p">(</span><span class="s">&#39;Version&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">toxml</span><span class="p">()</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;&lt;Version&gt;&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;&lt;/Version&gt;&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">))</span></div><div class='line' id='LC71'> <span class="n">summary</span> <span class="o">=</span> <span class="n">dom</span><span class="o">.</span><span class="n">getElementsByTagName</span><span class="p">(</span><span class="s">&#39;Summary&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">toxml</span><span class="p">()</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;&lt;Summary&gt;&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;&lt;/Summary&gt;&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">)</span></div><div class='line' id='LC72'> <span class="n">dlURL</span> <span class="o">=</span> <span class="n">dom</span><span class="o">.</span><span class="n">getElementsByTagName</span><span class="p">(</span><span class="s">&#39;URL&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">toxml</span><span class="p">()</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;&lt;URL&gt;&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;&lt;/URL&gt;&#39;</span><span class="p">,</span><span class="s">&#39;&#39;</span><span class="p">)</span></div><div class='line' id='LC73'><br/></div><div class='line' id='LC74'> <span class="k">if</span> <span class="n">version</span> <span class="o">&lt;</span> <span class="n">versionToDate</span><span class="p">:</span></div><div class='line' id='LC75'> <span class="k">print</span> <span class="n">WARNING</span> <span class="o">+</span> <span class="s">&#39;#####################################################################################################################&#39;</span></div><div class='line' id='LC76'> <span class="k">print</span> <span class="s">&#39;Your current version (</span><span class="si">%s</span><span class="s">) of RasPiWrite is not the latest, please go to the link below to update to version </span><span class="si">%s</span><span class="s">,&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">version</span><span class="p">,</span> <span class="n">versionToDate</span><span class="p">)</span></div><div class='line' id='LC77'> <span class="k">print</span> <span class="s">&#39;The Changes include: </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">summary</span></div><div class='line' id='LC78'> <span class="k">print</span> <span class="s">&#39;&#39;&#39;</span></div><div class='line' id='LC79'><span class="s">Please download the latest version of RasPiWrite from </span><span class="si">%s</span><span class="s">&#39;&#39;&#39;</span> <span class="o">%</span> <span class="n">dlURL</span></div><div class='line' id='LC80'> <span class="k">print</span> <span class="s">&#39;&#39;&#39;#####################################################################################################################</span></div><div class='line' id='LC81'><span class="s"> &#39;&#39;&#39;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC82'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC83'> <span class="k">print</span> <span class="s">&#39;&#39;&#39;Your version of RasPiWrite is up-to-date</span></div><div class='line' id='LC84'><span class="s"> &#39;&#39;&#39;</span></div><div class='line' id='LC85'><br/></div><div class='line' id='LC86'> <span class="k">except</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">URLError</span><span class="p">,</span> <span class="n">e</span><span class="p">:</span></div><div class='line' id='LC87'>&nbsp;&nbsp;&nbsp;&nbsp; <span class="k">print</span> <span class="s">&quot;&quot;&quot;There was an error in checking for an update: </span><span class="si">%r</span><span class="s"></span></div><div class='line' id='LC88'><span class="s"> &quot;&quot;&quot;</span> <span class="o">%</span> <span class="n">e</span></div><div class='line' id='LC89'><br/></div><div class='line' id='LC90'><br/></div><div class='line' id='LC91'><span class="k">def</span> <span class="nf">grabRoot</span><span class="p">(</span><span class="n">distro</span><span class="p">):</span> <span class="c">#Parses the raspberry pi downloads page for the links for the currently RasPiWrite supported distros</span></div><div class='line' id='LC92'> <span class="n">links</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span></div><div class='line' id='LC93'> <span class="n">htmlSource</span> <span class="o">=</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="s">&#39;http://www.raspberrypi.org/downloads&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span></div><div class='line' id='LC94'> <span class="n">linksList</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="s">&#39;href=&quot;(.*)&quot;&#39;</span><span class="p">,</span><span class="n">htmlSource</span><span class="p">)</span></div><div class='line' id='LC95'> <span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">linksList</span><span class="p">:</span></div><div class='line' id='LC96'> <span class="k">if</span> <span class="n">distro</span> <span class="ow">in</span> <span class="n">link</span><span class="p">:</span></div><div class='line' id='LC97'> <span class="k">if</span> <span class="n">link</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s">&#39;.zip&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="n">link</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s">&#39;.tar.bz2&#39;</span><span class="p">):</span></div><div class='line' id='LC98'> <span class="k">return</span> <span class="n">link</span></div><div class='line' id='LC99'><br/></div><div class='line' id='LC100'><br/></div><div class='line' id='LC101'><span class="k">def</span> <span class="nf">getZipUrl</span><span class="p">(</span><span class="n">url</span><span class="p">):</span> <span class="c">#gets all the urls that end in .zip or .tar.bz2 (only two disk image archive types on the download web page)</span></div><div class='line' id='LC102'> <span class="n">links</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span></div><div class='line' id='LC103'> <span class="n">htmlSource</span> <span class="o">=</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="n">url</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span></div><div class='line' id='LC104'> <span class="n">linksList</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="s">&#39;&lt;a href=&quot;?([^\s^&quot;]+)&#39;</span><span class="p">,</span><span class="n">htmlSource</span><span class="p">)</span></div><div class='line' id='LC105'> <span class="k">for</span> <span class="n">link</span> <span class="ow">in</span> <span class="n">linksList</span><span class="p">:</span></div><div class='line' id='LC106'> <span class="k">if</span> <span class="n">link</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s">&#39;.zip&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="n">link</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s">&#39;.tar.bz2&#39;</span><span class="p">):</span></div><div class='line' id='LC107'> <span class="n">links</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">link</span><span class="p">)</span></div><div class='line' id='LC108'> <span class="k">return</span> <span class="n">links</span></div><div class='line' id='LC109'><br/></div><div class='line' id='LC110'><span class="k">def</span> <span class="nf">findDL</span><span class="p">(</span><span class="n">OS</span><span class="p">):</span> <span class="c">#legacy reasons (Rasberry Pi website doesn&#39;t currently list Fedora - http://www.raspberrypi.org/phpBB3/viewtopic.php?f=2&amp;t=5624)</span></div><div class='line' id='LC111'> <span class="n">fedora</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;http://achtbaan.nikhef.nl/events/rpi/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC112'> <span class="s">&#39;http://mirror.star.net.uk/raspberrypi/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC113'> <span class="s">&#39;http://www.sqltuning.cz/raspberry/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC114'> <span class="s">&#39;http://raspberrypi.peir.com/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC115'> <span class="s">&#39;http://raspberrypi.mirror.triple-it.nl/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC116'> <span class="s">&#39;http://ftp.ticklers.org/RaspberryPi/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC117'> <span class="s">&#39;http://files.velocix.com/c1410/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span></div><div class='line' id='LC118'> <span class="s">&#39;http://raspberrypi.reon.hu/images/fedora/14/r1-06-03-2012/raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">]</span></div><div class='line' id='LC119'> <span class="k">if</span> <span class="n">OS</span> <span class="o">==</span> <span class="s">&#39;fedora&#39;</span><span class="p">:</span> <span class="k">return</span> <span class="n">choice</span><span class="p">(</span><span class="n">fedora</span><span class="p">)</span></div><div class='line' id='LC120'><br/></div><div class='line' id='LC121'><br/></div><div class='line' id='LC122'><span class="k">def</span> <span class="nf">download</span><span class="p">(</span><span class="n">url</span><span class="p">):</span> <span class="c">#http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python | Downloads the disk image for the user</span></div><div class='line' id='LC123'> <span class="n">file_name</span> <span class="o">=</span> <span class="n">url</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div><div class='line' id='LC124'> <span class="n">u</span> <span class="o">=</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">urlopen</span><span class="p">(</span><span class="n">url</span><span class="p">)</span></div><div class='line' id='LC125'> <span class="n">f</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">file_name</span><span class="p">,</span> <span class="s">&#39;wb&#39;</span><span class="p">)</span></div><div class='line' id='LC126'> <span class="n">meta</span> <span class="o">=</span> <span class="n">u</span><span class="o">.</span><span class="n">info</span><span class="p">()</span></div><div class='line' id='LC127'> <span class="n">file_size</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">meta</span><span class="o">.</span><span class="n">getheaders</span><span class="p">(</span><span class="s">&quot;Content-Length&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">])</span></div><div class='line' id='LC128'> <span class="k">print</span> <span class="s">&quot;Downloading: </span><span class="si">%s</span><span class="s"> Bytes: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">file_name</span><span class="p">,</span> <span class="n">file_size</span><span class="p">)</span></div><div class='line' id='LC129'> <span class="n">file_size_dl</span> <span class="o">=</span> <span class="mi">0</span></div><div class='line' id='LC130'> <span class="n">block_sz</span> <span class="o">=</span> <span class="mi">8192</span></div><div class='line' id='LC131'> <span class="k">while</span> <span class="bp">True</span><span class="p">:</span></div><div class='line' id='LC132'> <span class="nb">buffer</span> <span class="o">=</span> <span class="n">u</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="n">block_sz</span><span class="p">)</span></div><div class='line' id='LC133'> <span class="k">if</span> <span class="ow">not</span> <span class="nb">buffer</span><span class="p">:</span></div><div class='line' id='LC134'> <span class="k">break</span></div><div class='line' id='LC135'> <span class="n">file_size_dl</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="nb">buffer</span><span class="p">)</span></div><div class='line' id='LC136'> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="nb">buffer</span><span class="p">)</span></div><div class='line' id='LC137'> <span class="n">status</span> <span class="o">=</span> <span class="s">r&quot;</span><span class="si">%10d</span><span class="s"> [</span><span class="si">%3.2f%%</span><span class="s">]&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">file_size_dl</span><span class="p">,</span> <span class="n">file_size_dl</span> <span class="o">*</span> <span class="mf">100.</span> <span class="o">/</span> <span class="n">file_size</span><span class="p">)</span></div><div class='line' id='LC138'> <span class="n">status</span> <span class="o">=</span> <span class="n">status</span> <span class="o">+</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">status</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span></div><div class='line' id='LC139'> <span class="k">print</span> <span class="n">status</span><span class="p">,</span></div><div class='line' id='LC140'> <span class="n">f</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></div><div class='line' id='LC141'><br/></div><div class='line' id='LC142'><span class="k">def</span> <span class="nf">cleanOutput</span><span class="p">(</span><span class="n">text2</span><span class="p">):</span> <span class="c">#cleans up the output from df -h</span></div><div class='line' id='LC143'> <span class="c">#^(?=.*?\b/\b)(?=.*?\bdisk0)((?!Volume).)*$ &lt;-- regex used</span></div><div class='line' id='LC144'> <span class="c">#^(?:.(?&lt;!/Volumes))*$</span></div><div class='line' id='LC145'> <span class="n">removeRootHDD</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">r&quot;(?=.*?\b/\b)(?=.*?\bdisk0)((?!Volume).)*&quot;</span><span class="p">)</span></div><div class='line' id='LC146'> <span class="n">blacklist</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">r&quot;.*Backups|.*Backup.*|.*devfs.*|.*map.*&quot;</span><span class="p">)</span></div><div class='line' id='LC147'> <span class="n">cleanOutput</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="n">removeRootHDD</span><span class="p">,</span> <span class="s">&#39; &#39;</span><span class="p">,</span> <span class="n">text2</span><span class="p">)</span></div><div class='line' id='LC148'> <span class="n">filterblacklist</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s">&quot;(?m)^\s+&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">,</span> <span class="n">re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="n">blacklist</span><span class="p">,</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="n">cleanOutput</span><span class="p">))</span></div><div class='line' id='LC149'> <span class="k">return</span> <span class="n">filterblacklist</span></div><div class='line' id='LC150'><br/></div><div class='line' id='LC151'><span class="k">def</span> <span class="nf">matchSD</span><span class="p">(</span><span class="nb">input</span><span class="p">):</span> <span class="c">#grabs just the drive&#39;s name from the df -h command (macOSX so far)</span></div><div class='line' id='LC152'> <span class="n">selectSD</span> <span class="o">=</span> <span class="s">r&quot;(?=/)(.*?)\s&quot;</span></div><div class='line' id='LC153'> <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">selectSD</span><span class="p">,</span> <span class="nb">input</span><span class="p">)</span></div><div class='line' id='LC154'> <span class="k">if</span> <span class="n">match</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span></div><div class='line' id='LC155'> <span class="n">match</span> <span class="o">=</span> <span class="s">&#39;0&#39;</span></div><div class='line' id='LC156'> <span class="k">return</span> <span class="n">match</span></div><div class='line' id='LC157'><br/></div><div class='line' id='LC158'><span class="k">def</span> <span class="nf">unmount</span><span class="p">(</span><span class="n">location</span><span class="p">):</span> <span class="c">#unmounts the drive so that it can be rewrittern</span></div><div class='line' id='LC159'> <span class="k">global</span> <span class="n">OS</span></div><div class='line' id='LC160'> <span class="k">print</span> <span class="s">&#39;Unmounting the drive in preparation for writing...&#39;</span></div><div class='line' id='LC161'> <span class="k">if</span> <span class="n">OS</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Darwin&#39;</span><span class="p">:</span></div><div class='line' id='LC162'> <span class="n">output</span> <span class="o">=</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;umount &#39;</span> <span class="o">+</span> <span class="n">location</span><span class="p">)</span></div><div class='line' id='LC163'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC164'> <span class="n">output</span> <span class="o">=</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;diskutil unmount &#39;</span> <span class="o">+</span> <span class="n">location</span><span class="p">)</span></div><div class='line' id='LC165'> <span class="k">print</span> <span class="n">output</span></div><div class='line' id='LC166'> <span class="k">if</span> <span class="s">&#39;Unmount failed for&#39;</span> <span class="ow">in</span> <span class="n">output</span><span class="p">:</span></div><div class='line' id='LC167'> <span class="k">print</span> <span class="n">WARNING</span> <span class="o">+</span> <span class="s">&#39;Error, the Following drive couldn</span><span class="se">\&#39;</span><span class="s">t be unmounted, exiting...&#39;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC168'> <span class="nb">exit</span><span class="p">()</span></div><div class='line' id='LC169'><br/></div><div class='line' id='LC170'><span class="k">class</span> <span class="nc">transferInBackground</span> <span class="p">(</span><span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">):</span> <span class="c">#Runs the dd command in a thread so that I can give a waiting... indicator</span></div><div class='line' id='LC171'><br/></div><div class='line' id='LC172'>&nbsp;&nbsp;&nbsp;<span class="k">def</span> <span class="nf">run</span> <span class="p">(</span> <span class="bp">self</span> <span class="p">):</span></div><div class='line' id='LC173'> <span class="k">global</span> <span class="n">SDsnip</span></div><div class='line' id='LC174'> <span class="k">global</span> <span class="n">path</span></div><div class='line' id='LC175'> <span class="k">if</span> <span class="n">OS</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Darwin&#39;</span><span class="p">:</span></div><div class='line' id='LC176'> <span class="n">copyString</span> <span class="o">=</span> <span class="s">&#39;dd bs=1M if=</span><span class="si">%s</span><span class="s"> of=</span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">path</span><span class="p">,</span><span class="n">SDsnip</span><span class="p">)</span></div><div class='line' id='LC177'> <span class="k">else</span></div><div class='line' id='LC178'> <span class="n">copyString</span> <span class="o">=</span> <span class="s">&#39;dd bs=1m if=</span><span class="si">%s</span><span class="s"> of=</span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">path</span><span class="p">,</span><span class="n">SDsnip</span><span class="p">)</span></div><div class='line' id='LC179'> <span class="k">print</span> <span class="s">&#39;Running &#39;</span> <span class="o">+</span> <span class="n">copyString</span> <span class="o">+</span> <span class="s">&#39;...&#39;</span></div><div class='line' id='LC180'><br/></div><div class='line' id='LC181'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="n">copyString</span><span class="p">)</span></div><div class='line' id='LC182'> <span class="k">print</span> <span class="s">&#39;done!&#39;</span></div><div class='line' id='LC183'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC184'><br/></div><div class='line' id='LC185'><span class="k">def</span> <span class="nf">transfer</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span><span class="n">archiveType</span><span class="p">,</span><span class="n">obtain</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="n">URL</span><span class="p">):</span> <span class="c">#unzips the disk image</span></div><div class='line' id='LC186'> <span class="k">global</span> <span class="n">path</span></div><div class='line' id='LC187'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;zip&#39;</span><span class="p">:</span> </div><div class='line' id='LC188'> <span class="c">#path = file.replace(&quot;.zip&quot;, &quot;&quot;) + &#39;/&#39; + file.replace(&quot;.zip&quot;, &quot;.img&quot;) &lt;- my old code</span></div><div class='line' id='LC189'> <span class="n">path</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;/&#39;</span> <span class="o">+</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">basename</span><span class="p">(</span><span class="nb">file</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;.img&quot;</span><span class="p">)</span> <span class="c">#Thanks to Lewis Boon</span></div><div class='line' id='LC190'> <span class="n">extractCMD</span> <span class="o">=</span> <span class="s">&#39;unzip &#39;</span> <span class="o">+</span> <span class="nb">file</span></div><div class='line' id='LC191'><br/></div><div class='line' id='LC192'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;img&#39;</span><span class="p">:</span> </div><div class='line' id='LC193'> <span class="n">path</span> <span class="o">=</span> <span class="nb">file</span><span class="p">;</span></div><div class='line' id='LC194'> <span class="n">extractCMD</span> <span class="o">=</span> <span class="s">&#39;echo No extracttion required for &#39;</span> <span class="o">+</span> <span class="nb">file</span></div><div class='line' id='LC195'><br/></div><div class='line' id='LC196'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;gz&#39;</span><span class="p">:</span> </div><div class='line' id='LC197'> <span class="n">path</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.gz&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="c">#&lt;-- verify</span></div><div class='line' id='LC198'> <span class="n">extractCMD</span> <span class="o">=</span> <span class="s">&#39;gunzip &#39;</span> <span class="o">+</span> <span class="nb">file</span></div><div class='line' id='LC199'><br/></div><div class='line' id='LC200'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;bz2&#39;</span><span class="p">:</span> </div><div class='line' id='LC201'> <span class="n">path</span> <span class="o">=</span> <span class="s">&#39;&#39;</span> <span class="c">#probably don&#39;t need, but I found during debug that the interpreter would complain about the var not being defined</span></div><div class='line' id='LC202'> <span class="c">#QtonPi making me jump through hoops:</span></div><div class='line' id='LC203'> <span class="n">basePath</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.tar.bz2&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span></div><div class='line' id='LC204'> <span class="c">#this path is actually changed to something that the script can locate, such as the basepath</span></div><div class='line' id='LC205'> <span class="n">extractPath</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.tar.bz2&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;/sdcard-img/&#39;</span> <span class="o">+</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">r&quot;(?=qtonpi)([^&gt;]*)(?=-)&quot;</span><span class="p">,</span> <span class="nb">file</span><span class="p">)</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;-sdcard&#39;</span> <span class="o">+</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">r&quot;(?=-)([^&gt;]*)(?=.tar)&quot;</span><span class="p">,</span> <span class="nb">file</span><span class="p">)</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;.img.bz2&#39;</span> <span class="c">#&lt;-- verify</span></div><div class='line' id='LC206'> <span class="n">finalPath</span> <span class="o">=</span> <span class="nb">file</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.tar.bz2&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;/sdcard-img/&#39;</span> <span class="o">+</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">r&quot;(?=qtonpi)([^&gt;]*)(?=-)&quot;</span><span class="p">,</span> <span class="nb">file</span><span class="p">)</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;-sdcard&#39;</span> <span class="o">+</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s">r&quot;(?=-)([^&gt;]*)(?=.tar)&quot;</span><span class="p">,</span> <span class="nb">file</span><span class="p">)</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;.img&#39;</span></div><div class='line' id='LC207'> <span class="n">extractCMD</span> <span class="o">=</span> <span class="s">&#39;tar jxf &#39;</span> <span class="o">+</span> <span class="nb">file</span></div><div class='line' id='LC208'> <span class="n">path</span> <span class="o">=</span> <span class="n">basePath</span></div><div class='line' id='LC209'><br/></div><div class='line' id='LC210'> <span class="k">if</span> <span class="n">obtain</span> <span class="o">==</span> <span class="s">&#39;dl&#39;</span><span class="p">:</span> </div><div class='line' id='LC211'> <span class="n">obtainType</span> <span class="o">=</span> <span class="s">&#39;Downloaded by this client (reliable and safe)&#39;</span></div><div class='line' id='LC212'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)):</span></div><div class='line' id='LC213'> <span class="k">print</span> <span class="s">&#39;archive already has been extracted, skipping unzipping...&#39;</span></div><div class='line' id='LC214'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;bz2&#39;</span><span class="p">:</span></div><div class='line' id='LC215'> <span class="n">path</span> <span class="o">=</span> <span class="n">extractPath</span></div><div class='line' id='LC216'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)):</span></div><div class='line' id='LC217'> <span class="k">print</span> <span class="s">&#39;Unzipping image..&#39;</span></div><div class='line' id='LC218'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;bunzip2 &#39;</span> <span class="o">+</span> <span class="n">path</span><span class="p">)</span></div><div class='line' id='LC219'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC220'> <span class="k">print</span> <span class="s">&#39;Image has already been unzipped&#39;</span></div><div class='line' id='LC221'> <span class="n">path</span> <span class="o">=</span> <span class="n">finalPath</span></div><div class='line' id='LC222'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC223'> <span class="n">download</span><span class="p">(</span><span class="n">URL</span><span class="p">)</span></div><div class='line' id='LC224'> <span class="k">print</span> <span class="s">&#39;Ok... Unzipping the disk , this may take a while...&#39;</span></div><div class='line' id='LC225'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="n">extractCMD</span><span class="p">)</span> <span class="c">#extract here!</span></div><div class='line' id='LC226'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;bz2&#39;</span><span class="p">:</span></div><div class='line' id='LC227'> <span class="n">path</span> <span class="o">=</span> <span class="n">extractPath</span></div><div class='line' id='LC228'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)):</span></div><div class='line' id='LC229'> <span class="k">print</span> <span class="s">&#39;Unzipping image..&#39;</span></div><div class='line' id='LC230'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;bunzip2 &#39;</span> <span class="o">+</span> <span class="n">path</span><span class="p">)</span></div><div class='line' id='LC231'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC232'> <span class="k">print</span> <span class="s">&#39;Image has already been unzipped&#39;</span></div><div class='line' id='LC233'> <span class="n">path</span> <span class="o">=</span> <span class="n">finalPath</span></div><div class='line' id='LC234'> <span class="k">if</span> <span class="n">obtain</span> <span class="o">==</span> <span class="s">&#39;usr&#39;</span><span class="p">:</span> </div><div class='line' id='LC235'> <span class="n">obtainType</span> <span class="o">=</span> <span class="s">&#39;Obtained by user and passed in (potentially dangerous)&#39;</span></div><div class='line' id='LC236'> <span class="k">print</span> <span class="s">&#39;Found archive inputted by user, extracting...&#39;</span></div><div class='line' id='LC237'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)):</span></div><div class='line' id='LC238'> <span class="k">print</span> <span class="s">&#39;archive already has been extracted, skipping unzipping...&#39;</span></div><div class='line' id='LC239'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;bz2&#39;</span><span class="p">:</span></div><div class='line' id='LC240'> <span class="n">path</span> <span class="o">=</span> <span class="n">extractPath</span></div><div class='line' id='LC241'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)):</span></div><div class='line' id='LC242'> <span class="k">print</span> <span class="s">&#39;Unzipping image..&#39;</span></div><div class='line' id='LC243'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;bunzip2 &#39;</span> <span class="o">+</span> <span class="n">path</span><span class="p">)</span></div><div class='line' id='LC244'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC245'> <span class="k">print</span> <span class="s">&#39;Image has already been unzipped&#39;</span></div><div class='line' id='LC246'> <span class="n">path</span> <span class="o">=</span> <span class="n">finalPath</span></div><div class='line' id='LC247'><br/></div><div class='line' id='LC248'> <span class="k">if</span> <span class="n">OS</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Darwin&#39;</span><span class="p">:</span></div><div class='line' id='LC249'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;pwd&#39;</span><span class="p">)</span></div><div class='line' id='LC250'> <span class="n">path</span> <span class="o">=</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&quot;pwd&quot;</span><span class="p">)</span><span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="nb">file</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="nb">file</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;.img&quot;</span><span class="p">)</span></div><div class='line' id='LC251'> <span class="k">print</span> <span class="n">path</span></div><div class='line' id='LC252'> <span class="k">print</span> <span class="s">&quot;Not Darwin</span><span class="se">\n</span><span class="s">&quot;</span></div><div class='line' id='LC253'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC254'> <span class="k">print</span> <span class="s">&#39;Ok... Unzipping the disk , this may take a while...&#39;</span></div><div class='line' id='LC255'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="n">extractCMD</span><span class="p">)</span> <span class="c">#extract here!</span></div><div class='line' id='LC256'> <span class="k">if</span> <span class="n">archiveType</span> <span class="o">==</span> <span class="s">&#39;bz2&#39;</span><span class="p">:</span></div><div class='line' id='LC257'> <span class="n">path</span> <span class="o">=</span> <span class="n">extractPath</span></div><div class='line' id='LC258'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">path</span><span class="p">)):</span></div><div class='line' id='LC259'> <span class="k">print</span> <span class="s">&#39;Unzipping image..&#39;</span></div><div class='line' id='LC260'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;bunzip2 &#39;</span> <span class="o">+</span> <span class="n">path</span><span class="p">)</span></div><div class='line' id='LC261'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC262'> <span class="k">print</span> <span class="s">&#39;Image has already been unzipped&#39;</span></div><div class='line' id='LC263'> <span class="n">path</span> <span class="o">=</span> <span class="n">finalPath</span></div><div class='line' id='LC264'><br/></div><div class='line' id='LC265'> <span class="k">if</span> <span class="n">OS</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Darwin&#39;</span><span class="p">:</span></div><div class='line' id='LC266'> <span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;pwd&#39;</span><span class="p">)</span></div><div class='line' id='LC267'> <span class="n">path</span> <span class="o">=</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&quot;pwd&quot;</span><span class="p">)</span><span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="nb">file</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;/&quot;</span> <span class="o">+</span> <span class="nb">file</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot;/&quot;</span><span class="p">)[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;.img&quot;</span><span class="p">)</span></div><div class='line' id='LC268'> <span class="k">print</span> <span class="n">path</span></div><div class='line' id='LC269'> <span class="k">print</span> <span class="s">&quot;Not Darwin</span><span class="se">\n</span><span class="s">&quot;</span></div><div class='line' id='LC270'> <span class="k">global</span> <span class="n">SDsnip</span></div><div class='line' id='LC271'> <span class="k">if</span> <span class="p">(</span><span class="n">SD</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&quot;/dev/mmcblk&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span></div><div class='line' id='LC272'> <span class="n">SDsnip</span> <span class="o">=</span> <span class="s">&quot;/dev/mmcblk&quot;</span> <span class="o">+</span> <span class="n">SD</span><span class="p">[</span><span class="mi">11</span><span class="p">]</span></div><div class='line' id='LC273'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC274'> <span class="k">if</span> <span class="n">OS</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Darwin&#39;</span><span class="p">:</span> </div><div class='line' id='LC275'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="n">SDsnip</span> <span class="o">=</span> <span class="n">SD</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span></div><div class='line' id='LC276'>&nbsp; <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC277'>&nbsp; <span class="c"># remove weird partition notation in OS X partition names</span></div><div class='line' id='LC278'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="n">SDsnip</span> <span class="o">=</span> <span class="n">SD</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">2</span><span class="p">]</span></div><div class='line' id='LC279'><br/></div><div class='line' id='LC280'> <span class="k">print</span> <span class="n">path</span></div><div class='line' id='LC281'> <span class="k">print</span> <span class="s">&#39;</span><span class="se">\n\n</span><span class="s">###################################################################&#39;</span></div><div class='line' id='LC282'> <span class="k">print</span> <span class="s">&#39;About to start the transfer procedure, here is your setup:&#39;</span></div><div class='line' id='LC283'> <span class="k">print</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC284'><span class="s">&gt; OS Choice: </span><span class="si">%s</span><span class="s"></span></div><div class='line' id='LC285'><span class="s">&gt; SD Card: </span><span class="si">%s</span><span class="s"></span></div><div class='line' id='LC286'><span class="s">&gt; Type: </span><span class="si">%s</span><span class="s"></span></div><div class='line' id='LC287'><span class="s"> &quot;&quot;&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="nb">file</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;.zip&quot;</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">),</span> <span class="n">SDsnip</span><span class="p">,</span> <span class="n">obtainType</span><span class="p">)</span></div><div class='line' id='LC288'> <span class="k">print</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC289'><span class="s">Please remember that neither Matt Jump, exaviorn.com or any contributors can be held to warranty for any destruction of data or hardware </span></div><div class='line' id='LC290'><span class="s">(excerpt from GNU GPL, which can be found in the script&#39;s source, as well as inside the script&#39;s folder):</span></div><div class='line' id='LC291'><span class="s">-----------------------------------------------------------------</span></div><div class='line' id='LC292'><span class="s">This program is distributed in the hope that it will be useful,</span></div><div class='line' id='LC293'><span class="s">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class='line' id='LC294'><span class="s">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class='line' id='LC295'><span class="s">GNU General Public License for more details.</span></div><div class='line' id='LC296'><span class="s">-----------------------------------------------------------------</span></div><div class='line' id='LC297'><span class="s"> &quot;&quot;&quot;</span></div><div class='line' id='LC298'> <span class="k">print</span> <span class="s">&#39;###################################################################</span><span class="se">\n</span><span class="s">&#39;</span></div><div class='line' id='LC299'> <span class="n">confirm</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="n">boldStart</span> <span class="o">+</span> <span class="s">&#39;Please verify this information before typing </span><span class="se">\&#39;</span><span class="s">accept</span><span class="se">\&#39;</span><span class="s"> to accept the terms and to start the process, if this information isn</span><span class="se">\&#39;</span><span class="s">t correct, please press ctrl + c (^C), or type </span><span class="se">\&#39;</span><span class="s">exit</span><span class="se">\&#39;</span><span class="s"> to quit: &#39;</span> <span class="o">+</span> <span class="n">end</span><span class="p">)</span></div><div class='line' id='LC300'> <span class="k">if</span> <span class="n">confirm</span> <span class="o">==</span> <span class="s">&#39;accept&#39;</span><span class="p">:</span></div><div class='line' id='LC301'>&nbsp;&nbsp;&nbsp; <span class="n">thread1</span> <span class="o">=</span> <span class="n">transferInBackground</span><span class="p">()</span></div><div class='line' id='LC302'>&nbsp;&nbsp;&nbsp; <span class="n">thread1</span><span class="o">.</span><span class="n">start</span><span class="p">()</span></div><div class='line' id='LC303'> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;Waiting&quot;</span><span class="p">)</span></div><div class='line' id='LC304'>&nbsp;&nbsp;&nbsp; <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span></div><div class='line' id='LC305'> <span class="k">while</span> <span class="n">thread1</span><span class="o">.</span><span class="n">isAlive</span><span class="p">():</span></div><div class='line' id='LC306'> <span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span></div><div class='line' id='LC307'> <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">&quot;.&quot;</span><span class="p">)</span></div><div class='line' id='LC308'>&nbsp;&nbsp;&nbsp; <span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span></div><div class='line' id='LC309'>&nbsp;&nbsp;&nbsp; <span class="k">print</span> <span class="s">&#39;Transfer Complete! Please remove the SD card&#39;</span></div><div class='line' id='LC310'>&nbsp;&nbsp;&nbsp; <span class="k">print</span> <span class="s">&quot;&quot;&quot;###########################################</span></div><div class='line' id='LC311'><span class="s">Relevent information:</span></div><div class='line' id='LC312'><span class="s">&gt; Debian - Login is pi/raspberry</span></div><div class='line' id='LC313'><span class="s">&gt; Arch - Login is root/root</span></div><div class='line' id='LC314'><span class="s">&gt; Fedora - Login is root/fedoraarm</span></div><div class='line' id='LC315'><span class="s">&gt; QtonPi - Login is root/rootme</span></div><div class='line' id='LC316'><span class="s">###########################################</span></div><div class='line' id='LC317'><span class="s">Thank You for using RasPiWrite, you are now free to eject your drive </span></div><div class='line' id='LC318'><span class="s"> &quot;&quot;&quot;</span></div><div class='line' id='LC319'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC320'> <span class="k">print</span> <span class="s">&#39;ENDING WITHOUT COPYING ANY DATA ACROSS, SD CARD HAS BEEN UNMOUNTED&#39;</span></div><div class='line' id='LC321'> <span class="nb">exit</span><span class="p">()</span></div><div class='line' id='LC322'><br/></div><div class='line' id='LC323'><span class="k">def</span> <span class="nf">getImage</span><span class="p">(</span><span class="n">SD</span><span class="p">):</span> <span class="c">#gives the user a bunch of options to download an image, or select their own, it then passes the user on to the transfer function</span></div><div class='line' id='LC324'> <span class="k">global</span> <span class="n">boldStart</span></div><div class='line' id='LC325'> <span class="k">global</span> <span class="n">end</span></div><div class='line' id='LC326'> <span class="n">userChoice</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Do you wish to Download a Raspberry Pi compatible image (choose yes if you don</span><span class="se">\&#39;</span><span class="s">t have one) (Y/n): &#39;</span><span class="p">)</span></div><div class='line' id='LC327'> <span class="k">if</span> <span class="p">(</span><span class="n">userChoice</span> <span class="o">==</span> <span class="s">&#39;Y&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">userChoice</span> <span class="o">==</span> <span class="s">&#39;y&#39;</span><span class="p">):</span></div><div class='line' id='LC328'> <span class="k">print</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC329'><span class="s">&gt; Debian </span><span class="se">\&quot;</span><span class="s">Squeeze</span><span class="se">\&quot;</span><span class="s"> [OPTION 1]&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC330'><span class="s">Reference root filesystem from Gray and Dom, containing LXDE, Midori, development tools </span></div><div class='line' id='LC331'><span class="s">and example source code for multimedia functions.</span></div><div class='line' id='LC332'><span class="s"> &quot;&quot;&quot;</span></div><div class='line' id='LC333'> <span class="k">print</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC334'><span class="s">&gt; Arch Linux [OPTION 2]&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC335'><span class="s">Arch Linux ARM is based on Arch Linux, which aims for simplicity and full control to the </span></div><div class='line' id='LC336'><span class="s">end user. Note that this distribution may not be suitable for beginners.</span></div><div class='line' id='LC337'><span class="s"> &quot;&quot;&quot;</span></div><div class='line' id='LC338'> <span class="k">print</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC339'><span class="s">&gt; Fedora 14 [OPTION 3]&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC340'><span class="s">(raspberrypi-fedora-remix-14-r1)</span></div><div class='line' id='LC341'><span class="s">The Raspberry Pi recommended choice for beginners, features a full GUI and applications for </span></div><div class='line' id='LC342'><span class="s">productivity and programming</span></div><div class='line' id='LC343'><span class="s"> &quot;&quot;&quot;</span></div><div class='line' id='LC344'> <span class="k">print</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC345'><span class="s">&gt; QtonPi [OPTION 4]&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC346'><span class="s">QtonPi is an Embedded Linux platform plus SDK optimized for developing and running Qt 5 Apps on Raspberry Pi.</span></div><div class='line' id='LC347'><span class="s"> &quot;&quot;&quot;</span></div><div class='line' id='LC348'> <span class="n">osChoice</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Your Choice e.g: </span><span class="se">\&#39;</span><span class="s">1</span><span class="se">\&#39;</span><span class="s"> : &#39;</span><span class="p">)</span></div><div class='line' id='LC349'> <span class="k">if</span> <span class="n">osChoice</span> <span class="o">==</span> <span class="s">&#39;1&#39;</span><span class="p">:</span></div><div class='line' id='LC350'> <span class="n">URL</span> <span class="o">=</span> <span class="n">choice</span><span class="p">(</span><span class="n">getZipUrl</span><span class="p">(</span><span class="n">grabRoot</span><span class="p">(</span><span class="s">&#39;debian&#39;</span><span class="p">)))</span></div><div class='line' id='LC351'> <span class="c">#URL = findDL(&#39;debian&#39;)</span></div><div class='line' id='LC352'> <span class="k">print</span> <span class="s">&#39;Downloading Debian from [</span><span class="si">%s</span><span class="s">]&#39;</span><span class="o">%</span> <span class="n">URL</span></div><div class='line' id='LC353'> <span class="n">match</span> <span class="o">=</span> <span class="n">grabRoot</span><span class="p">(</span><span class="s">&#39;debian&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">rpartition</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span></div><div class='line' id='LC354'> <span class="n">transfer</span><span class="p">(</span><span class="n">match</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;zip&#39;</span><span class="p">,</span><span class="s">&#39;dl&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="n">URL</span><span class="p">)</span></div><div class='line' id='LC355'> <span class="k">if</span> <span class="n">osChoice</span> <span class="o">==</span> <span class="s">&#39;2&#39;</span><span class="p">:</span></div><div class='line' id='LC356'> <span class="n">URL</span> <span class="o">=</span> <span class="n">choice</span><span class="p">(</span><span class="n">getZipUrl</span><span class="p">(</span><span class="n">grabRoot</span><span class="p">(</span><span class="s">&#39;arch&#39;</span><span class="p">)))</span></div><div class='line' id='LC357'> <span class="k">print</span> <span class="s">&#39;Downloading Arch Linux from [</span><span class="si">%s</span><span class="s">]&#39;</span><span class="o">%</span> <span class="n">URL</span></div><div class='line' id='LC358'> <span class="n">match</span> <span class="o">=</span> <span class="n">grabRoot</span><span class="p">(</span><span class="s">&#39;arch&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">rpartition</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span></div><div class='line' id='LC359'> <span class="n">transfer</span><span class="p">(</span><span class="n">match</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;zip&#39;</span><span class="p">,</span><span class="s">&#39;dl&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="n">URL</span><span class="p">)</span></div><div class='line' id='LC360'> <span class="k">if</span> <span class="n">osChoice</span> <span class="o">==</span> <span class="s">&#39;3&#39;</span><span class="p">:</span></div><div class='line' id='LC361'> <span class="n">URL</span> <span class="o">=</span> <span class="n">findDL</span><span class="p">(</span><span class="s">&#39;fedora&#39;</span><span class="p">)</span></div><div class='line' id='LC362'> <span class="k">print</span> <span class="s">&#39;Downloading Fedora 14 from [</span><span class="si">%s</span><span class="s">]&#39;</span><span class="o">%</span> <span class="n">URL</span></div><div class='line' id='LC363'> <span class="n">transfer</span><span class="p">(</span><span class="s">&#39;raspberrypi-fedora-remix-14-r1.img.gz&#39;</span><span class="p">,</span><span class="s">&#39;gz&#39;</span><span class="p">,</span><span class="s">&#39;dl&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span> <span class="n">URL</span><span class="p">)</span></div><div class='line' id='LC364'> <span class="k">if</span> <span class="n">osChoice</span> <span class="o">==</span> <span class="s">&#39;4&#39;</span><span class="p">:</span></div><div class='line' id='LC365'> <span class="n">URL</span> <span class="o">=</span> <span class="n">choice</span><span class="p">(</span><span class="n">getZipUrl</span><span class="p">(</span><span class="n">grabRoot</span><span class="p">(</span><span class="s">&#39;qtonpi&#39;</span><span class="p">)))</span></div><div class='line' id='LC366'> <span class="k">print</span> <span class="s">&#39;Downloading QtonPi 14 from [</span><span class="si">%s</span><span class="s">]&#39;</span><span class="o">%</span> <span class="n">URL</span></div><div class='line' id='LC367'> <span class="n">match</span> <span class="o">=</span> <span class="n">grabRoot</span><span class="p">(</span><span class="s">&#39;qtonpi&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">rpartition</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span></div><div class='line' id='LC368'> <span class="n">transfer</span><span class="p">(</span><span class="n">match</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="s">&#39;bz2&#39;</span><span class="p">,</span><span class="s">&#39;dl&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span> <span class="n">URL</span><span class="p">)</span></div><div class='line' id='LC369'><br/></div><div class='line' id='LC370'> <span class="k">if</span> <span class="p">(</span><span class="n">userChoice</span> <span class="o">==</span> <span class="s">&#39;N&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">userChoice</span> <span class="o">==</span> <span class="s">&#39;n&#39;</span><span class="p">):</span></div><div class='line' id='LC371'> <span class="n">userLocate</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Please locate the disk image (.zip, .img.gz, .tar.bz2 (.tar.bz2 only working with QtonPi distros currently): &#39;</span><span class="p">)</span></div><div class='line' id='LC372'> <span class="k">if</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">userLocate</span><span class="p">)):</span></div><div class='line' id='LC373'> <span class="n">matchZip</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="s">&#39;^.*\.zip$&#39;</span><span class="p">,</span><span class="n">userLocate</span><span class="p">)</span></div><div class='line' id='LC374'> <span class="n">matchGzip</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="s">&#39;^.*\.img.gz$&#39;</span><span class="p">,</span><span class="n">userLocate</span><span class="p">)</span></div><div class='line' id='LC375'> <span class="n">matchBzip</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="s">&#39;^.*\.tar.bz2$&#39;</span><span class="p">,</span><span class="n">userLocate</span><span class="p">)</span></div><div class='line' id='LC376'> <span class="n">matchImg</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="s">&#39;^.*\.img$&#39;</span><span class="p">,</span><span class="n">userLocate</span><span class="p">)</span></div><div class='line' id='LC377'><br/></div><div class='line' id='LC378'> <span class="k">if</span> <span class="n">matchImg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span></div><div class='line' id='LC379'> <span class="k">print</span> <span class="s">&#39;Found Image file&#39;</span></div><div class='line' id='LC380'> <span class="n">transfer</span><span class="p">(</span><span class="n">userLocate</span><span class="p">,</span><span class="s">&#39;img&#39;</span><span class="p">,</span><span class="s">&#39;usr&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="s">&#39;none&#39;</span><span class="p">)</span></div><div class='line' id='LC381'> <span class="k">if</span> <span class="n">matchZip</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span></div><div class='line' id='LC382'> <span class="k">print</span> <span class="s">&#39;Found Zip&#39;</span></div><div class='line' id='LC383'> <span class="n">transfer</span><span class="p">(</span><span class="n">userLocate</span><span class="p">,</span><span class="s">&#39;zip&#39;</span><span class="p">,</span><span class="s">&#39;usr&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="s">&#39;none&#39;</span><span class="p">)</span></div><div class='line' id='LC384'> <span class="k">if</span> <span class="n">matchGzip</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span></div><div class='line' id='LC385'> <span class="k">print</span> <span class="s">&#39;found Gzip&#39;</span></div><div class='line' id='LC386'> <span class="n">transfer</span><span class="p">(</span><span class="n">userLocate</span><span class="p">,</span> <span class="s">&#39;gz&#39;</span><span class="p">,</span> <span class="s">&#39;usr&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="s">&#39;none&#39;</span><span class="p">)</span></div><div class='line' id='LC387'> <span class="k">if</span> <span class="n">matchBzip</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span></div><div class='line' id='LC388'> <span class="k">print</span> <span class="s">&#39;found Bz2&#39;</span></div><div class='line' id='LC389'> <span class="n">transfer</span><span class="p">(</span><span class="n">userLocate</span><span class="p">,</span> <span class="s">&#39;bz2&#39;</span><span class="p">,</span> <span class="s">&#39;usr&#39;</span><span class="p">,</span><span class="n">SD</span><span class="p">,</span><span class="s">&#39;none&#39;</span><span class="p">)</span></div><div class='line' id='LC390'>&nbsp;&nbsp;&nbsp;&nbsp; </div><div class='line' id='LC391'><br/></div><div class='line' id='LC392'> <span class="k">else</span><span class="p">:</span></div><div class='line' id='LC393'> <span class="k">print</span> <span class="s">&#39;sorry, the file you have specified doesn</span><span class="se">\&#39;</span><span class="s">t exist, please try again&#39;</span></div><div class='line' id='LC394'> <span class="k">print</span> <span class="s">&#39;Press ctrl + c (^C) to quit&#39;</span></div><div class='line' id='LC395'> <span class="nb">exit</span><span class="p">()</span></div><div class='line' id='LC396'><br/></div><div class='line' id='LC397'><span class="k">def</span> <span class="nf">driveTest</span><span class="p">(</span><span class="n">SD</span><span class="p">):</span></div><div class='line' id='LC398'><br/></div><div class='line' id='LC399'> <span class="n">sdID</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&quot;I believe this is your SD card: &quot;</span> <span class="o">+</span> <span class="n">SD</span> <span class="o">+</span> <span class="s">&quot; is that correct? (Y/n) &quot;</span><span class="p">)</span></div><div class='line' id='LC400'> <span class="k">if</span> <span class="p">(</span><span class="n">sdID</span> <span class="o">==</span> <span class="s">&#39;Y&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">sdID</span> <span class="o">==</span> <span class="s">&#39;y&#39;</span><span class="p">):</span> <span class="c">#continue</span></div><div class='line' id='LC401'> <span class="n">unmount</span><span class="p">(</span><span class="n">SD</span><span class="p">)</span> <span class="c">#&lt;--works, so don&#39;t need to test</span></div><div class='line' id='LC402'> <span class="n">getImage</span><span class="p">(</span><span class="n">SD</span><span class="p">)</span></div><div class='line' id='LC403'><br/></div><div class='line' id='LC404'> <span class="k">if</span> <span class="p">(</span><span class="n">sdID</span> <span class="o">==</span> <span class="s">&#39;N&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="n">sdID</span> <span class="o">==</span> <span class="s">&#39;n&#39;</span><span class="p">):</span></div><div class='line' id='LC405'> <span class="n">manualID</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&quot;Please enter the location you believe holds the SD Card: &quot;</span><span class="p">)</span></div><div class='line' id='LC406'> <span class="n">driveTest</span><span class="p">(</span><span class="n">manualID</span><span class="p">)</span></div><div class='line' id='LC407'><br/></div><div class='line' id='LC408'><span class="c">#logic:</span></div><div class='line' id='LC409'><span class="c">#most of this stuff is pretty self explanitory, some of it could be put into a function, but I don&#39;t like </span></div><div class='line' id='LC410'><span class="c">#having loads of micro functions (the ones I do have are going to be expanded to cover all unix based OS&#39;s)</span></div><div class='line' id='LC411'><span class="k">print</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;clear&#39;</span><span class="p">)</span></div><div class='line' id='LC412'><span class="k">print</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC413'><span class="s"> ;d0KOd. .oOK0x: </span></div><div class='line' id='LC414'><span class="s"> 0xlllcoxolkolllloX </span></div><div class='line' id='LC415'><span class="s"> ;OccloddKNdxdocckc </span></div><div class='line' id='LC416'><span class="s"> .dkddkWNNMOdoxd, </span></div><div class='line' id='LC417'><span class="s"> .o:,x0....xd,ck&#39; </span></div><div class='line' id='LC418'><span class="s"> K:xOoloOOccloocW </span></div><div class='line' id='LC419'><span class="s">.x;N:....xO....&#39;K;k,</span></div><div class='line' id='LC420'><span class="s">O..Nc...:XNl...:X.,X</span></div><div class='line' id='LC421'><span class="s">.kkx0NXk&#39;...dNNxldK&#39;</span></div><div class='line' id='LC422'><span class="s"> &#39;k...0o....,O...d: </span></div><div class='line' id='LC423'><span class="s"> ;o;&#39;oM0olkWc.;oc </span></div><div class='line' id='LC424'><span class="s"> .cOx....dOl. </span></div><div class='line' id='LC425'><span class="s"> .x00k. </span></div><div class='line' id='LC426'><span class="s">&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC427'><span class="k">print</span> <span class="s">&quot;&quot;&quot;//////////////////////// &quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC428'><span class="s">* Raspberry Pi SD Writer &quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC429'><span class="s">* Matt Jump</span></div><div class='line' id='LC430'><span class="s">* exaviorn.com</span></div><div class='line' id='LC431'><span class="s">////////////////////////</span></div><div class='line' id='LC432'><span class="s">(Version 1.15 -MACOSX-)</span></div><div class='line' id='LC433'><span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC434'><span class="k">if</span> <span class="n">OS</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Darwin&#39;</span><span class="p">:</span> <span class="c">#if Mac OS, will change to posix once I have worked around some of the command differences</span></div><div class='line' id='LC435'> <span class="k">print</span> <span class="n">WARNING</span> <span class="o">+</span> <span class="s">&#39;I</span><span class="se">\&#39;</span><span class="s">m sorry, but your OS isn</span><span class="se">\&#39;</span><span class="s">t supported at this time, Linux/Unix users - please tune in soon for a POSIX version&#39;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC436'><span class="c"># exit()</span></div><div class='line' id='LC437'><span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">geteuid</span><span class="p">()</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span></div><div class='line' id='LC438'> <span class="k">print</span> <span class="n">WARNING</span> <span class="o">+</span> <span class="s">&#39;Please run the script using sudo e.g. sudo python raspiwrite.py, or sudo ./raspiwrite.py (need to chmod +x first)&#39;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC439'> <span class="nb">exit</span><span class="p">()</span></div><div class='line' id='LC440'><span class="n">checkforUpdate</span><span class="p">()</span></div><div class='line' id='LC441'><span class="k">print</span> <span class="s">&#39;The following script is designed to copy a Raspberry Pi compatible disk image to an SD Card&#39;</span></div><div class='line' id='LC442'><span class="k">print</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&#39;INCORRECTLY FOLLOWING THE WIZARD COULD RESULT IN THE CORRUPTION OF YOUR HARD DISK, PARTITIONS OR A BACKUP USB DRIVE (INCLUDING MOUNTED TIME MACHINE BACKUP DRIVES)&#39;</span> <span class="o">+</span><span class="n">end</span></div><div class='line' id='LC443'><span class="k">print</span> <span class="s">&#39;It is advisable to remove any other USB HDDs or memory sticks, the wizard might select that one, </span><span class="si">%s</span><span class="s"> if you have multiple hard drives installed, please take a LOT of care selecting the right drive </span><span class="si">%s</span><span class="s">&#39;</span><span class="o">%</span> <span class="p">(</span><span class="n">boldStart</span><span class="p">,</span> <span class="n">end</span><span class="p">)</span> </div><div class='line' id='LC444'><span class="n">text</span> <span class="o">=</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;df -h&#39;</span><span class="p">)</span></div><div class='line' id='LC445'><span class="nb">raw_input</span><span class="p">(</span><span class="s">&#39;Now insert your SD Card, press enter when you are ready...&#39;</span><span class="p">)</span></div><div class='line' id='LC446'><span class="n">text2</span> <span class="o">=</span> <span class="n">getoutput</span><span class="p">(</span><span class="s">&#39;df -h&#39;</span><span class="p">)</span></div><div class='line' id='LC447'><span class="k">print</span> <span class="s">&quot;&quot;&quot;</span></div><div class='line' id='LC448'><span class="se">\n</span><span class="s">---------------------------------------------------------</span></div><div class='line' id='LC449'><span class="s">&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">boldStart</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot;The following drives were found, please verify the name of the SD card in finder with the name under the </span><span class="se">\&#39;</span><span class="s">Mounted On</span><span class="se">\&#39;</span><span class="s"> column (after </span><span class="se">\&#39;</span><span class="s">/volumes/</span><span class="se">\&#39;</span><span class="s">):</span></div><div class='line' id='LC450'><span class="s">&quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC451'><span class="n">volumes</span> <span class="o">=</span> <span class="n">cleanOutput</span><span class="p">(</span><span class="n">text2</span><span class="p">)</span></div><div class='line' id='LC452'><span class="k">print</span> <span class="n">volumes</span></div><div class='line' id='LC453'><span class="k">print</span> <span class="s">&#39;---------------------------------------------------------</span><span class="se">\n</span><span class="s">&#39;</span></div><div class='line' id='LC454'><span class="k">if</span> <span class="n">matchSD</span><span class="p">(</span><span class="n">volumes</span><span class="p">)</span> <span class="o">==</span> <span class="s">&#39;0&#39;</span><span class="p">:</span> <span class="c">#if no device found</span></div><div class='line' id='LC455'> <span class="k">print</span> <span class="n">WARNING</span> <span class="o">+</span> <span class="s">&quot;&quot;&quot; </span></div><div class='line' id='LC456'><span class="s"> #############################################################</span></div><div class='line' id='LC457'><span class="s"> WARNING: No reliable SD Card location could be found, please </span></div><div class='line' id='LC458'><span class="s"> insert a SD card device and try again, if you are certain </span></div><div class='line' id='LC459'><span class="s"> about the location of the SD card, you can manually override </span></div><div class='line' id='LC460'><span class="s"> it below</span></div><div class='line' id='LC461'><span class="s"> #############################################################</span></div><div class='line' id='LC462'><span class="s"> &quot;&quot;&quot;</span> <span class="o">+</span> <span class="n">end</span></div><div class='line' id='LC463'> <span class="n">manualID</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">(</span><span class="s">&quot;Please enter the location you believe holds the SD Card: &quot;</span><span class="p">)</span></div><div class='line' id='LC464'> <span class="n">driveTest</span><span class="p">(</span><span class="n">manualID</span><span class="p">)</span></div><div class='line' id='LC465'><span class="k">else</span><span class="p">:</span> <span class="c">#otherwise...</span></div><div class='line' id='LC466'> <span class="n">SD</span> <span class="o">=</span> <span class="n">matchSD</span><span class="p">(</span><span class="n">volumes</span><span class="p">)</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="c">#selects the first SD/USB drive located</span></div><div class='line' id='LC467'> <span class="n">driveTest</span><span class="p">(</span><span class="n">SD</span><span class="p">)</span> <span class="c">#action gets delegated to driveTest, which then leads on to the next step, I found this to be the easiest way</span></div></pre></div> </td> </tr> </table> </div> </div> </div> <a href="#jump-to-line" rel="facebox[.linejump]" data-hotkey="l" class="js-jump-to-line" style="display:none">Jump to Line</a> <div id="jump-to-line" style="display:none"> <form accept-charset="UTF-8" class="js-jump-to-line-form"> <input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;"> <button type="submit" class="button">Go</button> </form> </div> </div> </div> </div><!-- /.repo-container --> <div class="modal-backdrop"></div> </div> </div><!-- /.site --> </div><!-- /.wrapper --> <div class="container"> <div class="site-footer"> <ul class="site-footer-links right"> <li><a href="https://status.github.com/">Status</a></li> <li><a href="http://developer.github.com">API</a></li> <li><a href="http://training.github.com">Training</a></li> <li><a href="http://shop.github.com">Shop</a></li> <li><a href="/blog">Blog</a></li> <li><a href="/about">About</a></li> </ul> <a href="/"> <span class="mega-octicon octicon-mark-github"></span> </a> <ul class="site-footer-links"> <li>&copy; 2013 <span title="0.05949s from fe3.rs.github.com">GitHub</span>, Inc.</li> <li><a href="/site/terms">Terms</a></li> <li><a href="/site/privacy">Privacy</a></li> <li><a href="/security">Security</a></li> <li><a href="/contact">Contact</a></li> </ul> </div><!-- /.site-footer --> </div><!-- /.container --> <div class="fullscreen-overlay js-fullscreen-overlay" id="fullscreen_overlay"> <div class="fullscreen-container js-fullscreen-container"> <div class="textarea-wrap"> <textarea name="fullscreen-contents" id="fullscreen-contents" class="js-fullscreen-contents" placeholder="" data-suggester="fullscreen_suggester"></textarea> <div class="suggester-container"> <div class="suggester fullscreen-suggester js-navigation-container" id="fullscreen_suggester" data-url="/exaviorn/RasPiWrite/suggestions/commit"> </div> </div> </div> </div> <div class="fullscreen-sidebar"> <a href="#" class="exit-fullscreen js-exit-fullscreen tooltipped leftwards" title="Exit Zen Mode"> <span class="mega-octicon octicon-screen-normal"></span> </a> <a href="#" class="theme-switcher js-theme-switcher tooltipped leftwards" title="Switch themes"> <span class="octicon octicon-color-mode"></span> </a> </div> </div> <div id="ajax-error-message" class="flash flash-error"> <span class="octicon octicon-alert"></span> <a href="#" class="octicon octicon-remove-close close ajax-error-dismiss"></a> Something went wrong with that request. Please try again. </div> </body> </html>
130.561335
88,688
0.62799
21,646
133,042
3.856509
0.113416
0.215626
0.276264
0.088215
0.668164
0.650231
0.606052
0.58177
0.547809
0.523335
0
0.058996
0.086243
133,042
1,018
88,689
130.689587
0.627641
0
0
0.135945
0
0.031106
0.386125
0.073877
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
41e8e00ddc3dce0cf45ef2ddd4fcad31aba312c4
43
py
Python
src/test/data/pa3/AdditionalTestCase/UnitTest/strcat_arg0_is_emptyString.py
Leo-Enrique-Wu/chocopy_compiler_code_generation
4606be0531b3de77411572aae98f73169f46b3b9
[ "BSD-2-Clause" ]
null
null
null
src/test/data/pa3/AdditionalTestCase/UnitTest/strcat_arg0_is_emptyString.py
Leo-Enrique-Wu/chocopy_compiler_code_generation
4606be0531b3de77411572aae98f73169f46b3b9
[ "BSD-2-Clause" ]
null
null
null
src/test/data/pa3/AdditionalTestCase/UnitTest/strcat_arg0_is_emptyString.py
Leo-Enrique-Wu/chocopy_compiler_code_generation
4606be0531b3de77411572aae98f73169f46b3b9
[ "BSD-2-Clause" ]
null
null
null
print("" + "1234") print("Hello" + "World")
21.5
24
0.55814
5
43
4.8
0.8
0
0
0
0
0
0
0
0
0
0
0.105263
0.116279
43
2
24
21.5
0.526316
0
0
0
0
0
0.318182
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
5
51129cfa86d8d83873034b3c75e7a54a9f297b91
145
py
Python
abc/abc036/abc036b.py
c-yan/atcoder
940e49d576e6a2d734288fadaf368e486480a948
[ "MIT" ]
1
2019-08-21T00:49:34.000Z
2019-08-21T00:49:34.000Z
abc/abc036/abc036b.py
c-yan/atcoder
940e49d576e6a2d734288fadaf368e486480a948
[ "MIT" ]
null
null
null
abc/abc036/abc036b.py
c-yan/atcoder
940e49d576e6a2d734288fadaf368e486480a948
[ "MIT" ]
null
null
null
N = int(input()) s = [input() for _ in range(N)] for y in range(N): for x in range(N): print(s[N - 1 - x][y], end='') print('')
18.125
38
0.475862
27
145
2.518519
0.444444
0.308824
0.352941
0.323529
0
0
0
0
0
0
0
0.009709
0.289655
145
7
39
20.714286
0.650485
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
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
5
51169e2ed48fd1acd7b73a37ea57537c8a7e3f38
96
py
Python
tt/expressions/__init__.py
fkromer/tt
b4dfc90f7d0f9b5794e1f5054b640e22f6f75bf7
[ "MIT" ]
233
2016-02-05T20:13:06.000Z
2022-03-26T13:01:10.000Z
tt/expressions/__init__.py
fkromer/tt
b4dfc90f7d0f9b5794e1f5054b640e22f6f75bf7
[ "MIT" ]
8
2017-12-20T17:07:58.000Z
2020-08-06T15:44:55.000Z
tt/expressions/__init__.py
fkromer/tt
b4dfc90f7d0f9b5794e1f5054b640e22f6f75bf7
[ "MIT" ]
15
2016-03-22T23:37:56.000Z
2022-02-27T17:51:08.000Z
"""Tools for working with Boolean expressions.""" from .bexpr import BooleanExpression # noqa
24
49
0.760417
11
96
6.636364
1
0
0
0
0
0
0
0
0
0
0
0
0.145833
96
3
50
32
0.890244
0.510417
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
1
0
0
5
51394b5fdcbb8014ce17029ea6d5d771d0417075
6,528
py
Python
tests/test_collector.py
ThanhTamPotter/libvirt-prometheus-exporter
07f31b29404404f6679da5a85145c7d089e5f9e9
[ "MIT" ]
5
2019-08-14T20:35:34.000Z
2022-01-05T22:58:46.000Z
tests/test_collector.py
ThanhTamPotter/libvirt-prometheus-exporter
07f31b29404404f6679da5a85145c7d089e5f9e9
[ "MIT" ]
58
2019-08-13T23:36:48.000Z
2021-08-03T04:40:51.000Z
tests/test_collector.py
ThanhTamPotter/libvirt-prometheus-exporter
07f31b29404404f6679da5a85145c7d089e5f9e9
[ "MIT" ]
3
2019-08-14T20:35:46.000Z
2020-04-03T09:40:15.000Z
from libvirt_exporter.collector import parse_net, parse_blk class TestLibvirtCollector: def test_net_parser_will_return_empty_array(self): data = {} assert len(parse_net(data)) == 0, "a empty data set should not result in a set" def test_net_parser_will_return_single_array(self): data = { 'net.count': 1, 'net.0.name': 'test', 'net.0.rx.bytes': 1, 'net.0.rx.pkts': 2, 'net.0.rx.errs': 3, 'net.0.rx.drop': 4, 'net.0.tx.bytes': 5, 'net.0.tx.errs': 6, 'net.0.tx.pkts': 7, 'net.0.tx.drop': 8, } parsed_data = parse_net(data) assert len(parsed_data) == 1, "net parser should return a single result" result = parsed_data.pop() assert result['name'] == 'test' assert result['rx_bytes'] == 1 assert result['rx_pkts'] == 2 assert result['rx_errors'] == 3 assert result['rx_drops'] == 4 assert result['tx_bytes'] == 5 assert result['tx_pkts'] == 7 assert result['tx_errors'] == 6 assert result['tx_drops'] == 8 def test_net_parser_will_return_more_than_one_array(self): data = { 'net.count': 2, 'net.0.name': 'test', 'net.0.rx.bytes': 1, 'net.0.rx.pkts': 2, 'net.0.rx.errs': 3, 'net.0.rx.drop': 4, 'net.0.tx.bytes': 5, 'net.0.tx.errs': 6, 'net.0.tx.pkts': 7, 'net.0.tx.drop': 8, 'net.1.name': 'test2', 'net.1.rx.bytes': 11, 'net.1.rx.pkts': 12, 'net.1.rx.errs': 13, 'net.1.rx.drop': 14, 'net.1.tx.bytes': 15, 'net.1.tx.errs': 16, 'net.1.tx.pkts': 17, 'net.1.tx.drop': 18, } parsed_data = parse_net(data) assert len(parsed_data) == 2, "net parser should return two objects" result = parsed_data.pop() assert result['name'] == 'test2' assert result['rx_bytes'] == 11 assert result['rx_pkts'] == 12 assert result['rx_errors'] == 13 assert result['rx_drops'] == 14 assert result['tx_bytes'] == 15 assert result['tx_pkts'] == 17 assert result['tx_errors'] == 16 assert result['tx_drops'] == 18 result = parsed_data.pop() assert result['name'] == 'test' assert result['rx_bytes'] == 1 assert result['rx_pkts'] == 2 assert result['rx_errors'] == 3 assert result['rx_drops'] == 4 assert result['tx_bytes'] == 5 assert result['tx_pkts'] == 7 assert result['tx_errors'] == 6 assert result['tx_drops'] == 8 def test_blk_parser_will_return_emby_array(self): data = {} assert len(parse_blk(data)) == 0 data = {'state.state': '5'} assert len(parse_blk(data)) == 0 def test_blk_parser_will_return_single_array(self): data = { 'state.state': 1, 'block.count': '1', 'block.0.name': 'test', 'block.0.path': 'testpath', 'block.0.allocation': 0, 'block.0.capacity': 1, 'block.0.physical': 2, 'block.0.rd.reqs': 3, 'block.0.rd.bytes': 4, 'block.0.rd.times': 5, 'block.0.wr.reqs': 6, 'block.0.wr.bytes': 7, 'block.0.wr.times': 8, 'block.0.fl.reqs': 9, 'block.0.fl.times': 10, } parsed = parse_blk(data) assert len(parsed) == 1 result = parsed.pop() assert result['name'] == 'test' assert result['path'] == 'testpath' assert result['allocation'] == 0 assert result['capacity'] == 1 assert result['physical'] == 2 assert result['read_requests'] == 3 assert result['read_bytes'] == 4 assert result['read_seconds'] == 5 assert result['write_requests'] == 6 assert result['write_bytes'] == 7 assert result['write_seconds'] == 8 assert result['flush_requests'] == 9 assert result['flush_seconds'] == 10 def test_blk_parser_will_return_more_than_one_array(self): data = { 'state.state': 1, 'block.count': '2', 'block.0.name': 'test', 'block.0.path': 'testpath', 'block.0.allocation': 0, 'block.0.capacity': 1, 'block.0.physical': 2, 'block.0.rd.reqs': 3, 'block.0.rd.bytes': 4, 'block.0.rd.times': 5, 'block.0.wr.reqs': 6, 'block.0.wr.bytes': 7, 'block.0.wr.times': 8, 'block.0.fl.reqs': 9, 'block.0.fl.times': 10, 'block.1.name': 'test2', 'block.1.path': 'testpath2', 'block.1.allocation': 0, 'block.1.capacity': 1, 'block.1.physical': 2, 'block.1.rd.reqs': 3, 'block.1.rd.bytes': 4, 'block.1.rd.times': 5, 'block.1.wr.reqs': 6, 'block.1.wr.bytes': 7, 'block.1.wr.times': 8, 'block.1.fl.reqs': 9, 'block.1.fl.times': 10, } parsed = parse_blk(data) assert len(parsed) == 2 result = parsed.pop() assert result['name'] == 'test2' assert result['path'] == 'testpath2' assert result['allocation'] == 0 assert result['capacity'] == 1 assert result['physical'] == 2 assert result['read_requests'] == 3 assert result['read_bytes'] == 4 assert result['read_seconds'] == 5 assert result['write_requests'] == 6 assert result['write_bytes'] == 7 assert result['write_seconds'] == 8 assert result['flush_requests'] == 9 assert result['flush_seconds'] == 10 result = parsed.pop() assert result['name'] == 'test' assert result['path'] == 'testpath' assert result['allocation'] == 0 assert result['capacity'] == 1 assert result['physical'] == 2 assert result['read_requests'] == 3 assert result['read_bytes'] == 4 assert result['read_seconds'] == 5 assert result['write_requests'] == 6 assert result['write_bytes'] == 7 assert result['write_seconds'] == 8 assert result['flush_requests'] == 9 assert result['flush_seconds'] == 10
35.096774
87
0.506434
819
6,528
3.908425
0.102564
0.247423
0.052484
0.035614
0.788816
0.783818
0.72946
0.684161
0.666979
0.61637
0
0.051117
0.334712
6,528
185
88
35.286486
0.685931
0
0
0.695402
0
0
0.283088
0
0
0
0
0
0.41954
1
0.034483
false
0
0.005747
0
0.045977
0
0
0
0
null
1
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
5
514f994228bd33486de090bc7445014fba3d10f0
364
py
Python
install_requirements.py
Chris-top/OKA-D
3a5d3bd9417c261dfa36159d5b25ccf8fb96a330
[ "MIT" ]
null
null
null
install_requirements.py
Chris-top/OKA-D
3a5d3bd9417c261dfa36159d5b25ccf8fb96a330
[ "MIT" ]
null
null
null
install_requirements.py
Chris-top/OKA-D
3a5d3bd9417c261dfa36159d5b25ccf8fb96a330
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import subprocess import sys subprocess.check_call([sys.executable, "-m", "pip", "install", "pip", "-U"]) # temporary workaroud for issue between main and develop subprocess.check_call([sys.executable, "-m", "pip", "uninstall", "depthai", "--yes"]) subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
36.4
89
0.692308
47
364
5.297872
0.595745
0.180723
0.228916
0.26506
0.48996
0.48996
0.48996
0.345382
0
0
0
0.00304
0.096154
364
9
90
40.444444
0.753799
0.208791
0
0
0
0
0.255245
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
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
1
0
1
0
0
0
0
5
5abdb277eaed0ad8758fc422fdbb02117d940123
33
py
Python
roamPy/__init__.py
maahutch/roamPy
d3752b982eced2b514cfe34ffde5c06d5bd77d8e
[ "MIT" ]
null
null
null
roamPy/__init__.py
maahutch/roamPy
d3752b982eced2b514cfe34ffde5c06d5bd77d8e
[ "MIT" ]
null
null
null
roamPy/__init__.py
maahutch/roamPy
d3752b982eced2b514cfe34ffde5c06d5bd77d8e
[ "MIT" ]
null
null
null
from roamPy.roamClass import Roam
33
33
0.878788
5
33
5.8
1
0
0
0
0
0
0
0
0
0
0
0
0.090909
33
1
33
33
0.966667
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
5af140404b5b58675887fc6331fa4abdd9e02bc4
136
py
Python
LeetCode/leetcode 1460.py
Xi-Plus/OJ-Code
7ff6d691f34c9553d53dc9cddf90ad7dc7092349
[ "MIT" ]
null
null
null
LeetCode/leetcode 1460.py
Xi-Plus/OJ-Code
7ff6d691f34c9553d53dc9cddf90ad7dc7092349
[ "MIT" ]
null
null
null
LeetCode/leetcode 1460.py
Xi-Plus/OJ-Code
7ff6d691f34c9553d53dc9cddf90ad7dc7092349
[ "MIT" ]
null
null
null
from collections import Counter class Solution: def canBeEqual(self, target, arr): return Counter(target) == Counter(arr)
19.428571
46
0.705882
16
136
6
0.75
0
0
0
0
0
0
0
0
0
0
0
0.205882
136
6
47
22.666667
0.888889
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
1
0
0
5
5af6fd1df93f537cfe6791e413622d66e166257e
14
py
Python
Pipe.py
ricky001/Demo
d14b0daab983ad424f65d1a25a25f65e205f6fb1
[ "MIT" ]
null
null
null
Pipe.py
ricky001/Demo
d14b0daab983ad424f65d1a25a25f65e205f6fb1
[ "MIT" ]
2
2018-05-23T06:47:49.000Z
2018-06-18T07:08:23.000Z
Pipe.py
ricky001/Demo
d14b0daab983ad424f65d1a25a25f65e205f6fb1
[ "MIT" ]
null
null
null
print("pipe")
7
13
0.642857
2
14
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.071429
14
1
14
14
0.692308
0
0
0
0
0
0.285714
0
0
0
0
0
0
1
0
true
0
0
0
0
1
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
1
0
5
85131aea301bea089e57a25d54c8549cc583263e
53
py
Python
cli/jobs/pipelines-with-components/basics/3a_basic_pipeline/componentC_src/hello.py
Ali-ry/azureml-examples
817ae89d2766dcafd70937a22cb3a80f100a2906
[ "MIT" ]
null
null
null
cli/jobs/pipelines-with-components/basics/3a_basic_pipeline/componentC_src/hello.py
Ali-ry/azureml-examples
817ae89d2766dcafd70937a22cb3a80f100a2906
[ "MIT" ]
null
null
null
cli/jobs/pipelines-with-components/basics/3a_basic_pipeline/componentC_src/hello.py
Ali-ry/azureml-examples
817ae89d2766dcafd70937a22cb3a80f100a2906
[ "MIT" ]
null
null
null
print("Hello Python World...\nI'm component C :-)")
26.5
52
0.641509
8
53
4.25
1
0
0
0
0
0
0
0
0
0
0
0
0.132075
53
1
53
53
0.73913
0
0
0
0
0
0.807692
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
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
852420f8b26f5710312eaf7e0d1fc49a0ae83d86
6,921
py
Python
groupdocs_signature_cloud/__init__.py
groupdocs-signature-cloud/groupdocs-signature-cloud-python
2b7f03b3d70f191dc1292f6221ed9301811681cf
[ "MIT" ]
null
null
null
groupdocs_signature_cloud/__init__.py
groupdocs-signature-cloud/groupdocs-signature-cloud-python
2b7f03b3d70f191dc1292f6221ed9301811681cf
[ "MIT" ]
null
null
null
groupdocs_signature_cloud/__init__.py
groupdocs-signature-cloud/groupdocs-signature-cloud-python
2b7f03b3d70f191dc1292f6221ed9301811681cf
[ "MIT" ]
1
2021-02-03T00:18:17.000Z
2021-02-03T00:18:17.000Z
# coding: utf-8 # flake8: noqa from __future__ import absolute_import # import apis from groupdocs_signature_cloud.apis.file_api import FileApi from groupdocs_signature_cloud.apis.folder_api import FolderApi from groupdocs_signature_cloud.apis.info_api import InfoApi from groupdocs_signature_cloud.apis.preview_api import PreviewApi from groupdocs_signature_cloud.apis.sign_api import SignApi from groupdocs_signature_cloud.apis.storage_api import StorageApi # import requests from groupdocs_signature_cloud.apis.file_api import CopyFileRequest, DeleteFileRequest, DownloadFileRequest, MoveFileRequest, UploadFileRequest from groupdocs_signature_cloud.apis.storage_api import GetDiscUsageRequest, GetFileVersionsRequest, ObjectExistsRequest, StorageExistsRequest from groupdocs_signature_cloud.apis.folder_api import CopyFolderRequest, CreateFolderRequest, DeleteFolderRequest, GetFilesListRequest, MoveFolderRequest from groupdocs_signature_cloud.apis.sign_api import CreateSignaturesRequest, SearchSignaturesRequest, VerifySignaturesRequest, UpdateSignaturesRequest, DeleteSignaturesRequest from groupdocs_signature_cloud.apis.info_api import GetInfoRequest from groupdocs_signature_cloud.apis.preview_api import PreviewDocumentRequest # import ApiClient from groupdocs_signature_cloud.auth import Auth from groupdocs_signature_cloud.api_exception import ApiException from groupdocs_signature_cloud.api_client import ApiClient from groupdocs_signature_cloud.configuration import Configuration # import models from groupdocs_signature_cloud.models.barcode_type import BarcodeType from groupdocs_signature_cloud.models.barcodes_result import BarcodesResult from groupdocs_signature_cloud.models.base_settings import BaseSettings from groupdocs_signature_cloud.models.border_line import BorderLine from groupdocs_signature_cloud.models.brush import Brush from groupdocs_signature_cloud.models.color import Color from groupdocs_signature_cloud.models.delete_options import DeleteOptions from groupdocs_signature_cloud.models.delete_result import DeleteResult from groupdocs_signature_cloud.models.disc_usage import DiscUsage from groupdocs_signature_cloud.models.error import Error from groupdocs_signature_cloud.models.error_details import ErrorDetails from groupdocs_signature_cloud.models.file_info import FileInfo from groupdocs_signature_cloud.models.file_versions import FileVersions from groupdocs_signature_cloud.models.files_list import FilesList from groupdocs_signature_cloud.models.files_upload_result import FilesUploadResult from groupdocs_signature_cloud.models.format import Format from groupdocs_signature_cloud.models.formats_result import FormatsResult from groupdocs_signature_cloud.models.info_result import InfoResult from groupdocs_signature_cloud.models.object_exist import ObjectExist from groupdocs_signature_cloud.models.options_base import OptionsBase from groupdocs_signature_cloud.models.padding import Padding from groupdocs_signature_cloud.models.page_info import PageInfo from groupdocs_signature_cloud.models.pages_setup import PagesSetup from groupdocs_signature_cloud.models.pdf_digital_signature import PdfDigitalSignature from groupdocs_signature_cloud.models.preview_page import PreviewPage from groupdocs_signature_cloud.models.preview_result import PreviewResult from groupdocs_signature_cloud.models.qr_code_type import QRCodeType from groupdocs_signature_cloud.models.qr_codes_result import QRCodesResult from groupdocs_signature_cloud.models.save_options import SaveOptions from groupdocs_signature_cloud.models.search_result import SearchResult from groupdocs_signature_cloud.models.sign_result import SignResult from groupdocs_signature_cloud.models.signature import Signature from groupdocs_signature_cloud.models.signature_font import SignatureFont from groupdocs_signature_cloud.models.stamp_line import StampLine from groupdocs_signature_cloud.models.storage_exist import StorageExist from groupdocs_signature_cloud.models.storage_file import StorageFile from groupdocs_signature_cloud.models.time_stamp import TimeStamp from groupdocs_signature_cloud.models.update_options import UpdateOptions from groupdocs_signature_cloud.models.update_result import UpdateResult from groupdocs_signature_cloud.models.verify_result import VerifyResult from groupdocs_signature_cloud.models.barcode_signature import BarcodeSignature from groupdocs_signature_cloud.models.delete_settings import DeleteSettings from groupdocs_signature_cloud.models.digital_signature import DigitalSignature from groupdocs_signature_cloud.models.file_version import FileVersion from groupdocs_signature_cloud.models.image_signature import ImageSignature from groupdocs_signature_cloud.models.info_settings import InfoSettings from groupdocs_signature_cloud.models.linear_gradient_brush import LinearGradientBrush from groupdocs_signature_cloud.models.preview_settings import PreviewSettings from groupdocs_signature_cloud.models.qr_code_signature import QRCodeSignature from groupdocs_signature_cloud.models.radial_gradient_brush import RadialGradientBrush from groupdocs_signature_cloud.models.search_options import SearchOptions from groupdocs_signature_cloud.models.search_settings import SearchSettings from groupdocs_signature_cloud.models.sign_options import SignOptions from groupdocs_signature_cloud.models.sign_settings import SignSettings from groupdocs_signature_cloud.models.solid_brush import SolidBrush from groupdocs_signature_cloud.models.text_signature import TextSignature from groupdocs_signature_cloud.models.texture_brush import TextureBrush from groupdocs_signature_cloud.models.update_settings import UpdateSettings from groupdocs_signature_cloud.models.verify_options import VerifyOptions from groupdocs_signature_cloud.models.verify_settings import VerifySettings from groupdocs_signature_cloud.models.search_barcode_options import SearchBarcodeOptions from groupdocs_signature_cloud.models.search_digital_options import SearchDigitalOptions from groupdocs_signature_cloud.models.search_qr_code_options import SearchQRCodeOptions from groupdocs_signature_cloud.models.sign_image_options import SignImageOptions from groupdocs_signature_cloud.models.sign_text_options import SignTextOptions from groupdocs_signature_cloud.models.verify_digital_options import VerifyDigitalOptions from groupdocs_signature_cloud.models.verify_text_options import VerifyTextOptions from groupdocs_signature_cloud.models.sign_barcode_options import SignBarcodeOptions from groupdocs_signature_cloud.models.sign_digital_options import SignDigitalOptions from groupdocs_signature_cloud.models.sign_qr_code_options import SignQRCodeOptions from groupdocs_signature_cloud.models.sign_stamp_options import SignStampOptions from groupdocs_signature_cloud.models.verify_barcode_options import VerifyBarcodeOptions from groupdocs_signature_cloud.models.verify_qr_code_options import VerifyQRCodeOptions
67.194175
175
0.913741
845
6,921
7.144379
0.201183
0.191651
0.324333
0.398045
0.557893
0.416763
0.103031
0.090111
0
0
0
0.000307
0.057651
6,921
102
176
67.852941
0.92533
0.012281
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
5
518cff6cc7c374ebbc73c77c57ca2d6ecce06fbb
1,449
py
Python
untitled2.py
nephilim2016/AutoEncoder-for-GPR-Denoise
b55be16bd0b6af785efcf072d68dd5523a72f964
[ "MIT" ]
null
null
null
untitled2.py
nephilim2016/AutoEncoder-for-GPR-Denoise
b55be16bd0b6af785efcf072d68dd5523a72f964
[ "MIT" ]
null
null
null
untitled2.py
nephilim2016/AutoEncoder-for-GPR-Denoise
b55be16bd0b6af785efcf072d68dd5523a72f964
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 29 22:06:37 2020 @author: nephilim """ import numpy as np from matplotlib import pyplot,cm import T_PowerGain import skimage.transform # data=np.load('./TunnelLining.npy') # ProfileTargetGain=T_PowerGain.tpowGain(data,np.arange(7000)/4,0.9) # ProfileTargetGain=skimage.transform.resize(ProfileTargetGain,(7000,1000),mode='symmetric') # pyplot.imshow(ProfileTargetGain,vmin=0.8*np.min(ProfileTargetGain),vmax=0.8*np.max(ProfileTargetGain),extent=(0,1,0.618,0),cmap=cm.seismic) # ax=pyplot.gca() # ax.set_xticks(np.linspace(0,1,6)) # ax.set_xticklabels([0,1,2,3,4,5]) # ax.set_yticks(np.linspace(0,0.618,8)) # ax.set_yticklabels([0,10,20,30,40,50,60,70]) # pyplot.xlabel('Scan (m)') # pyplot.ylabel('Time (ns)') # pyplot.savefig('TunnelLiningProfile.png',dpi=1000) data=np.load('./ComplexProfileClean.npy') ProfileTargetGain=T_PowerGain.tpowGain(data,np.arange(7000)/4,0.9) ProfileTargetGain=skimage.transform.resize(ProfileTargetGain,(7000,1000),mode='symmetric') pyplot.imshow(ProfileTargetGain,vmin=0.8*np.min(ProfileTargetGain),vmax=0.8*np.max(ProfileTargetGain),extent=(0,1,0.618,0),cmap=cm.seismic) ax=pyplot.gca() ax.set_xticks(np.linspace(0,1,6)) ax.set_xticklabels([0,1,2,3,4,5]) ax.set_yticks(np.linspace(0,0.618,8)) ax.set_yticklabels([0,10,20,30,40,50,60,70]) pyplot.xlabel('Scan (m)') pyplot.ylabel('Time (ns)') pyplot.savefig('ComplexCleanProfile.png',dpi=1000)
36.225
141
0.748102
239
1,449
4.48954
0.359833
0.037279
0.014911
0.055918
0.760485
0.760485
0.760485
0.760485
0.760485
0.760485
0
0.097525
0.05176
1,449
40
142
36.225
0.683406
0.484472
0
0
0
0
0.101788
0.066025
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
0
0
0
null
0
0
0
0
1
1
1
1
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
5
519f0fc6d587a5bea01dc9e0f13e9fd7169ff7b2
2,918
py
Python
network_attack_simulator/envs/test/test_machine.py
Carayolj/NetworkAttackSimulator
563fcca92543dc76dcd6850c7c4ad0950966dea9
[ "MIT" ]
null
null
null
network_attack_simulator/envs/test/test_machine.py
Carayolj/NetworkAttackSimulator
563fcca92543dc76dcd6850c7c4ad0950966dea9
[ "MIT" ]
null
null
null
network_attack_simulator/envs/test/test_machine.py
Carayolj/NetworkAttackSimulator
563fcca92543dc76dcd6850c7c4ad0950966dea9
[ "MIT" ]
null
null
null
import numpy as np import unittest from network_attack_simulator.envs.action import Action from network_attack_simulator.envs.machine import Machine A_COST = 10 class MachineTestCase(unittest.TestCase): def setUp(self): self.test_r = 5000.0 self.services = np.asarray([True, False, True]) self.test_m1 = Machine((1, 1), self.services) self.test_m2 = Machine((1, 2), self.services, self.test_r) def test_successful_exploit(self): # address is ignored as this is controlled and checked at Network level exploit = Action((1, 1), A_COST, "exploit", 0) # Test on machine with no sensitive docs (i.e. 0 value) outcome, reward, services = self.test_m1.perform_action(exploit) self.assertTrue(outcome) self.assertEqual(reward, 0) self.assertTrue((services == self.services).all()) # Test exploit on machine with sensitive docs outcome, reward, services = self.test_m2.perform_action(exploit) self.assertTrue(outcome) self.assertEqual(reward, self.test_r) self.assertTrue((services == self.services).all()) def test_unsuccessful_exploit(self): # address is ignored as this is controlled and checked at Network level exploit = Action((1, 1), A_COST, "exploit", 1) # Test on machine with no sensitive docs (i.e. 0 value) outcome, reward, services = self.test_m1.perform_action(exploit) self.assertFalse(outcome) self.assertEqual(reward, 0) self.assertTrue((services == np.asarray([])).all()) # Test exploit on machine with sensitive docs outcome, reward, services = self.test_m2.perform_action(exploit) self.assertFalse(outcome) self.assertEqual(reward, 0) self.assertTrue((services == np.asarray([])).all()) def test_scan(self): # address is ignored as this is controlled and checked at Network level exploit = Action((1, 1), A_COST, "scan", None) # Test on machine with no sensitive docs (i.e. 0 value) outcome, reward, services = self.test_m1.perform_action(exploit) self.assertTrue(outcome) self.assertEqual(reward, 0) self.assertTrue((services == self.services).all()) # Test exploit on machine with sensitive docs outcome, reward, services = self.test_m2.perform_action(exploit) self.assertTrue(outcome) self.assertEqual(reward, 0) self.assertTrue((services == self.services).all()) def test_eq(self): s1 = np.asarray([True, False, True]) s2 = np.asarray([True, False, True]) m1 = Machine((1, 1), s1) m2 = Machine((1, 1), s2) self.assertTrue(m1 == m2) m3 = Machine((1, 1), s1, self.test_r) m4 = Machine((1, 1), s2, self.test_r) self.assertTrue(m3 == m4) if __name__ == "__main__": unittest.main()
36.936709
79
0.645305
380
2,918
4.847368
0.184211
0.05646
0.06949
0.081433
0.805646
0.705755
0.705755
0.705755
0.678067
0.678067
0
0.025699
0.23989
2,918
78
80
37.410256
0.804779
0.172378
0
0.442308
0
0
0.010811
0
0
0
0
0
0.384615
1
0.096154
false
0
0.076923
0
0.192308
0
0
0
0
null
0
0
0
1
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
5
519f3a9a270ba82a25e2ff0dc4e0c8aa634fbf41
119
py
Python
Homework/Homework_0/Python_Tutorial/Functions/function_local.py
donnel2-cooper/drone_control
3bb3a1c1f768916ac41d4b78692e2edab0776c07
[ "MIT" ]
null
null
null
Homework/Homework_0/Python_Tutorial/Functions/function_local.py
donnel2-cooper/drone_control
3bb3a1c1f768916ac41d4b78692e2edab0776c07
[ "MIT" ]
null
null
null
Homework/Homework_0/Python_Tutorial/Functions/function_local.py
donnel2-cooper/drone_control
3bb3a1c1f768916ac41d4b78692e2edab0776c07
[ "MIT" ]
null
null
null
x = 50 def func(x): print('x is',x) x = 2 print('Changed local x to',x) func(x) print('x is still',x)
13.222222
33
0.521008
24
119
2.583333
0.458333
0.16129
0.322581
0.354839
0.419355
0
0
0
0
0
0
0.035714
0.294118
119
9
34
13.222222
0.702381
0
0
0
0
0
0.266667
0
0
0
0
0
0
1
0.142857
false
0
0
0
0.142857
0.428571
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
1
0
5
51a7e9d639b3997cc869cd14a27e9e263a7dc805
2,490
py
Python
api/content/signals.py
luoyangC/island_django
e40a16f1465edc1376b00aa8f953b285f9802731
[ "Apache-2.0" ]
null
null
null
api/content/signals.py
luoyangC/island_django
e40a16f1465edc1376b00aa8f953b285f9802731
[ "Apache-2.0" ]
6
2020-05-05T07:13:16.000Z
2021-09-22T18:58:16.000Z
api/content/signals.py
luoyangC/island_django
e40a16f1465edc1376b00aa8f953b285f9802731
[ "Apache-2.0" ]
null
null
null
from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from content.models import Article from action.models import Like, Fav, Comment, Reply @receiver(post_save, sender=Fav) def add_fav(sender, instance=None, **kwargs): if instance: _article = Article.objects.get(id=instance.article.id) _article.fav_nums += 1 _article.save() @receiver(post_delete, sender=Fav) def del_fav(sender, instance=None, **kwargs): if instance: _article = Article.objects.get(id=instance.article.id) if _article.fav_nums > 0: _article.fav_nums -= 1 else: _article.fav_nums = 0 _article.save() @receiver(post_save, sender=Like) def add_like(sender, instance=None, **kwargs): if instance and instance.like_type == 'article': _article = Article.objects.get(id=instance.like_id) _article.like_nums += 1 _article.save() @receiver(post_delete, sender=Like) def del_like(sender, instance=None, **kwargs): if instance and instance.like_type == 'article': _article = Article.objects.get(id=instance.like_id) if _article.like_nums > 0: _article.like_nums -= 1 else: _article.like_nums = 0 _article.save() @receiver(post_save, sender=Comment) def add_comment(sender, instance=None, **kwargs): if instance: _article = Article.objects.get(id=instance.article.id) _article.comment_nums += 1 _article.save() @receiver(post_delete, sender=Comment) def del_comment(sender, instance=None, **kwargs): if instance: _article = Article.objects.get(id=instance.article.id) if _article.comment_nums > 0: _article.comment_nums -= 1 else: _article.comment_nums = 0 _article.save() @receiver(post_save, sender=Reply) def add_reply(sender, instance=None, **kwargs): if instance: _article = Article.objects.get(id=instance.comment.article.id) _article.comment_nums += 1 _article.save() @receiver(post_delete, sender=Reply) def del_reply(sender, instance=None, **kwargs): if instance: _article = Article.objects.get(id=instance.comment.article.id) if _article.comment_nums > 0: _article.comment_nums -= 1 else: _article.comment_nums = 0 _article.save()
30.740741
71
0.640161
304
2,490
5.013158
0.115132
0.098425
0.094488
0.125984
0.802493
0.76378
0.76378
0.76378
0.646982
0.646982
0
0.008593
0.252209
2,490
80
72
31.125
0.809882
0
0
0.5625
0
0
0.005809
0
0
0
0
0
0
1
0.125
false
0
0.0625
0
0.1875
0
0
0
0
null
0
0
0
1
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
5
51c0bb612b44b86bb07289bebf916f8b24837acd
140
py
Python
adet/modeling/SMInst/__init__.py
shuaiqi361/AdelaiDet
35d944033a8d2f7aa623ad607b57bd8a1fe88b43
[ "BSD-2-Clause" ]
null
null
null
adet/modeling/SMInst/__init__.py
shuaiqi361/AdelaiDet
35d944033a8d2f7aa623ad607b57bd8a1fe88b43
[ "BSD-2-Clause" ]
null
null
null
adet/modeling/SMInst/__init__.py
shuaiqi361/AdelaiDet
35d944033a8d2f7aa623ad607b57bd8a1fe88b43
[ "BSD-2-Clause" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from .SMInst import SMInst from .SMEncoding import SparseMaskEncoding
46.666667
70
0.814286
18
140
6.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.128571
140
3
71
46.666667
0.934426
0.485714
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
1
0
0
5
51c2ba8203078865d5de62c87cc3d6b582c016a9
59
py
Python
IceSpringMusicPlayer/domains/__init__.py
baijifeilong/rawsteelp
425547e6e2395bf4acb62435b18b5b3a4b7ebef4
[ "MIT" ]
null
null
null
IceSpringMusicPlayer/domains/__init__.py
baijifeilong/rawsteelp
425547e6e2395bf4acb62435b18b5b3a4b7ebef4
[ "MIT" ]
null
null
null
IceSpringMusicPlayer/domains/__init__.py
baijifeilong/rawsteelp
425547e6e2395bf4acb62435b18b5b3a4b7ebef4
[ "MIT" ]
null
null
null
# Created by BaiJiFeiLong@gmail.com at 2022-01-03 13:16:15
29.5
58
0.762712
12
59
3.75
1
0
0
0
0
0
0
0
0
0
0
0.269231
0.118644
59
1
59
59
0.596154
0.949153
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
1
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
5
51c4ef18c5d7f3e4f7e862d249d71f037fb10972
78
py
Python
webcam_ml/__init__.py
apockill/webcam-ml
f001688cf891c44b407823cc866d8ae9bdc4c51b
[ "MIT" ]
null
null
null
webcam_ml/__init__.py
apockill/webcam-ml
f001688cf891c44b407823cc866d8ae9bdc4c51b
[ "MIT" ]
null
null
null
webcam_ml/__init__.py
apockill/webcam-ml
f001688cf891c44b407823cc866d8ae9bdc4c51b
[ "MIT" ]
null
null
null
from .video_stream import Capture from .capsule_runtime import CapsuleRuntime
26
43
0.871795
10
78
6.6
0.8
0
0
0
0
0
0
0
0
0
0
0
0.102564
78
2
44
39
0.942857
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
1
0
0
5
51ee54f6a2b58e0010425d3f8042333f2e548af2
5,189
py
Python
tests/xfdnn/test_xfdnn_compiler_caffe_deephi.py
yarenty/ml-suite
570202d904cf5980c2262b4cfc067eb8428ea8d0
[ "Apache-2.0" ]
334
2018-06-07T00:42:09.000Z
2022-01-08T19:48:50.000Z
tests/xfdnn/test_xfdnn_compiler_caffe_deephi.py
yarenty/ml-suite
570202d904cf5980c2262b4cfc067eb8428ea8d0
[ "Apache-2.0" ]
99
2018-06-20T14:13:09.000Z
2020-11-03T19:36:50.000Z
tests/xfdnn/test_xfdnn_compiler_caffe_deephi.py
yarenty/ml-suite
570202d904cf5980c2262b4cfc067eb8428ea8d0
[ "Apache-2.0" ]
151
2018-06-15T12:10:09.000Z
2021-11-19T06:22:35.000Z
#!/usr/bin/env python # # // SPDX-License-Identifier: BSD-3-CLAUSE # # (C) Copyright 2018, Xilinx, Inc. # import os,sys from xfdnn.tools.compile.bin.xfdnn_compiler_caffe import CaffeFrontend as xfdnnCompiler def run_compiler(dsp, mem, prototxt, caffemodel, quantcfg): print("Testing xfdnn_compiler_caffe...") print("Testing:\n prototxt %s\n caffemodel %s\n quantization file %s\n dsp %s\n mem %s\n" % (prototxt,caffemodel,quantcfg,dsp,mem)) compiler = xfdnnCompiler( usedeephi=True, cpulayermustgo=True, pipelineconvmaxpool=True, quant_cfgfile=quantcfg, networkfile=prototxt, weights=caffemodel, dsp=dsp, memory=mem, generatefile="work/"+prototxt.replace('/','_')+"_"+str(dsp)+"/fpga.cmds", anew="work/"+prototxt.replace('/','_')+"_"+str(dsp)+"/optimized_model" ) SUCCESS = compiler.compile() #assert(SUCCESS) # Compiler will throw exception if it does not succeed as of 3/12/19 del compiler def get_caffe_model_list_all(): prototxt_list = [ \ "/wrk/acceleration/models/deephi/License_Plate_Recognition_INT8_models_test_codes/license_plate_recognition_quantizations.prototxt", \ "/wrk/acceleration/models/deephi/Car_Logo_Recognition_INT8_models_test_codes/car_logo_recognition_quantizations.prototxt", \ "/wrk/acceleration/models/deephi/Car_Attributes_Recognition_INT8_models_test_codes/car_attributes_recognition_quantizations.prototxt", \ "/wrk/acceleration/models/deephi/Pedestrian_Attributes_Recognition_INT8_models_test_codes/pedestrian_attributes_recognition_quantizations.prototxt", \ "/wrk/acceleration/models/deephi/reid_model_release_20190301/deploy.prototxt", \ "/wrk/acceleration/models/deephi/Car_Logo_Detection/deploy.prototxt", \ "/wrk/acceleration/models/deephi/Plate_Detection/deploy.prototxt", \ # "/wrk/acceleration/models/deephi/Pedestrian_Detection_INT8_models_test_codes/deploy.prototxt", \ ] caffemodel_list = [ \ "/wrk/acceleration/models/deephi/License_Plate_Recognition_INT8_models_test_codes/license_plate_recognition_quantizations.caffemodel", \ "/wrk/acceleration/models/deephi/Car_Logo_Recognition_INT8_models_test_codes/car_logo_recognition_quantizations.caffemodel", \ "/wrk/acceleration/models/deephi/Car_Attributes_Recognition_INT8_models_test_codes/car_attributes_recognition_quantizations.caffemodel", \ "/wrk/acceleration/models/deephi/Pedestrian_Attributes_Recognition_INT8_models_test_codes/pedestrian_attributes_recognition_quantizations.caffemodel", \ "/wrk/acceleration/models/deephi/reid_model_release_20190301/deploy.caffemodel", \ "/wrk/acceleration/models/deephi/Car_Logo_Detection/deploy.caffemodel", \ "/wrk/acceleration/models/deephi/Plate_Detection/deploy.caffemodel", \ # "/wrk/acceleration/models/deephi/Pedestrian_Detection_INT8_models_test_codes/deploy.caffemodel", \ ] quantcfg_list = [ \ "/wrk/acceleration/models/deephi/License_Plate_Recognition_INT8_models_test_codes/fix_info.txt", \ "/wrk/acceleration/models/deephi/Car_Logo_Recognition_INT8_models_test_codes/fix_info.txt", \ "/wrk/acceleration/models/deephi/Car_Attributes_Recognition_INT8_models_test_codes/fix_info.txt", \ "/wrk/acceleration/models/deephi/Pedestrian_Attributes_Recognition_INT8_models_test_codes/fix_info.txt", \ "/wrk/acceleration/models/deephi/reid_model_release_20190301/fix_info.txt", \ "/wrk/acceleration/models/deephi/Car_Logo_Detection/fix_info.txt", \ "/wrk/acceleration/models/deephi/Plate_Detection/fix_info.txt", \ # "/wrk/acceleration/models/deephi/Pedestrian_Detection_INT8_models_test_codes/fix_info.txt", \ ] return (prototxt_list,caffemodel_list,quantcfg_list) def get_caffe_model_list_1(): prototxt_list = [ \ "models/caffe/bvlc_googlenet_without_lrn/fp32/bvlc_googlenet_without_lrn_deploy.prototxt" \ ] caffemodel_list = [ \ "models/caffe/bvlc_googlenet_without_lrn/fp32/bvlc_googlenet_without_lrn.caffemodel" \ ] return (prototxt_list,caffemodel_list) def get_caffe_model_list(): (p,c,q) = get_caffe_model_list_all() return list(zip(p,c,q)) testdata = get_caffe_model_list() import pytest @pytest.mark.parametrize('prototxt,caffemodel,quantcfg', testdata) def test_xfdnn_compiler_caffe_28(prototxt,caffemodel,quantcfg): print("Testing xfdnn_compiler_caffe...") dsp = 28 mem = 4 run_compiler(dsp,mem,prototxt,caffemodel,quantcfg) @pytest.mark.parametrize('prototxt,caffemodel,quantcfg', testdata) def test_xfdnn_compiler_caffe_56(prototxt,caffemodel,quantcfg): print("Testing xfdnn_compiler_caffe...") dsp = 56 mem = 6 run_compiler(dsp,mem,prototxt,caffemodel,quantcfg) @pytest.mark.parametrize('prototxt,caffemodel,quantcfg', testdata) def test_xfdnn_compiler_caffe_96(prototxt,caffemodel,quantcfg): print("Testing xfdnn_compiler_caffe...") dsp = 96 mem = 9 run_compiler(dsp,mem,prototxt,caffemodel,quantcfg) if __name__ == "__main__": for (prototxt,caffemodel) in testdata: test_xfdnn_compiler_caffe_28(prototxt,caffemodel,quantcfg) test_xfdnn_compiler_caffe_56(prototxt,caffemodel,quantcfg) test_xfdnn_compiler_caffe_96(prototxt,caffemodel,quantcfg)
39.310606
156
0.787242
641
5,189
6.014041
0.188768
0.093385
0.130739
0.168093
0.806226
0.766537
0.752789
0.696239
0.57406
0.48716
0
0.016046
0.099248
5,189
131
157
39.610687
0.808729
0.09154
0
0.166667
0
0.011905
0.542863
0.507552
0
0
0
0
0
1
0.083333
false
0
0.035714
0
0.154762
0.059524
0
0
0
null
0
0
1
1
1
1
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
0
0
0
0
0
0
5
51f94b72f1b228ed7d87c870da16af732691c7e3
47
py
Python
tests/__init__.py
mikejihbe/sentry_onboarding
f2dd4dc5b998afb6e1288d72c7d84d4b8e79aff6
[ "MIT" ]
null
null
null
tests/__init__.py
mikejihbe/sentry_onboarding
f2dd4dc5b998afb6e1288d72c7d84d4b8e79aff6
[ "MIT" ]
null
null
null
tests/__init__.py
mikejihbe/sentry_onboarding
f2dd4dc5b998afb6e1288d72c7d84d4b8e79aff6
[ "MIT" ]
null
null
null
"""Unit test package for sentry_onboarding."""
23.5
46
0.744681
6
47
5.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.106383
47
1
47
47
0.809524
0.851064
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
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
51fa1fd042aeca48ea85d4aed887649f2d457fa3
104,076
py
Python
tccli/services/cvm/v20170312/help.py
ivandksun/tencentcloud-cli-intl-en
41b84e339918961b8bc92f7498e56347d21e16d3
[ "Apache-2.0" ]
null
null
null
tccli/services/cvm/v20170312/help.py
ivandksun/tencentcloud-cli-intl-en
41b84e339918961b8bc92f7498e56347d21e16d3
[ "Apache-2.0" ]
1
2022-02-07T13:39:09.000Z
2022-02-07T13:39:09.000Z
tccli/services/cvm/v20170312/help.py
ivandksun/tencentcloud-cli-intl-en
41b84e339918961b8bc92f7498e56347d21e16d3
[ "Apache-2.0" ]
4
2020-07-20T01:51:58.000Z
2021-08-13T08:25:22.000Z
# -*- coding: utf-8 -*- DESC = "cvm-2017-03-12" INFO = { "CreateImage": { "params": [ { "name": "ImageName", "desc": "Image name" }, { "name": "InstanceId", "desc": "Instance ID used to create an image." }, { "name": "ImageDescription", "desc": "Image description" }, { "name": "ForcePoweroff", "desc": "Whether to force shut down an instance to create an image when a soft shutdown fails" }, { "name": "Sysprep", "desc": "Whether to enable Sysprep when creating a Windows image" }, { "name": "DataDiskIds", "desc": "Specified data disk ID included in the full image created from the instance." }, { "name": "SnapshotIds", "desc": "Specified snapshot ID used to create an image. A system disk snapshot must be included. It cannot be passed together with `InstanceId`." }, { "name": "DryRun", "desc": "Success status of this request, without affecting the resources involved" } ], "desc": "This API is used to create a new image with the system disk of an instance. The image can be used to create new instances." }, "DescribeInstancesStatus": { "params": [ { "name": "InstanceIds", "desc": "Query by instance ID(s). For example, instance ID: `ins-xxxxxxxx`. For the specific format, refer to section `Ids.N` of the API [Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1). You can query up to 100 instances in each request." }, { "name": "Offset", "desc": "Offset; default value: 0. For more information on `Offset`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377)." }, { "name": "Limit", "desc": "Number of results returned; default value: 20; maximum: 100. For more information on `Limit`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377)." } ], "desc": "This API is used to query the status of instances.\n\n* You can query the status of an instance with its `ID`.\n* If no parameter is defined, the status of a certain number of instances under the current account will be returned. The number is specified by `Limit` and is 20 by default." }, "ModifyImageSharePermission": { "params": [ { "name": "ImageId", "desc": "Image ID such as `img-gvbnzy6f`. You can obtain the image IDs in two ways: <br><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response. <br><li>Look for the information in the [Image Console](https://console.cloud.tencent.com/cvm/image). <br>You can only specify an image in the `NORMAL` state. For more information on image states, see [here](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#image_state)." }, { "name": "AccountIds", "desc": "List of account IDs with which an image is shared. For the format of array-type parameters, see [API Introduction](https://intl.cloud.tencent.com/document/api/213/568?from_cn_redirect=1). The account ID is different from the QQ number. You can find the account ID in [Account Information](https://console.cloud.tencent.com/developer). " }, { "name": "Permission", "desc": "Operations. Valid values: `SHARE`, sharing an image; `CANCEL`, cancelling an image sharing. " } ], "desc": "This API is used to modify image sharing information.\n\n* The accounts with which an image is shared can use the shared image to create instances.\n* Each custom image can be shared with up to 50 accounts.\n* You can use a shared image to create instances, but you cannot change its name and description.\n* If an image is shared with another account, the shared image will be in the same region as the original image.\n" }, "DescribeInstancesOperationLimit": { "params": [ { "name": "InstanceIds", "desc": "Query by instance ID(s). You can obtain the instance IDs from the value of `InstanceId` returned by the [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) API. For example, instance ID: ins-xxxxxxxx. (For the specific format, refer to section `ids.N` of the API [Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1).) You can query up to 100 instances in each request." }, { "name": "Operation", "desc": "Operation on the instance(s).\n<li> INSTANCE_DEGRADE: downgrade the instance configurations</li>" } ], "desc": "This API is used to query limitations on operations on an instance.\n\n* Currently you can use this API to query the maximum number of times you can modify the configuration of an instance." }, "DescribeImageSharePermission": { "params": [ { "name": "ImageId", "desc": "The ID of the image to be shared" } ], "desc": "This API is used to query image sharing information." }, "ImportImage": { "params": [ { "name": "Architecture", "desc": "OS architecture of the image to be imported, `x86_64` or `i386`." }, { "name": "OsType", "desc": "OS type of the image to be imported. You can call `DescribeImportImageOs` to obtain the list of supported operating systems." }, { "name": "OsVersion", "desc": "OS version of the image to be imported. You can call `DescribeImportImageOs` to obtain the list of supported operating systems." }, { "name": "ImageUrl", "desc": "Address on COS where the image to be imported is stored." }, { "name": "ImageName", "desc": "Image name" }, { "name": "ImageDescription", "desc": "Image description" }, { "name": "DryRun", "desc": "Dry run to check the parameters without performing the operation" }, { "name": "Force", "desc": "Whether to force import the image. For more information, see [Forcibly Import Image](https://intl.cloud.tencent.com/document/product/213/12849)." } ], "desc": "This API is used to import images. Imported images can be used to create instances. " }, "InquiryPriceRunInstances": { "params": [ { "name": "Placement", "desc": "Location of the instance. You can use this parameter to specify the attributes of the instance, such as its availability zone and project." }, { "name": "ImageId", "desc": "[Image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images: <br/><li>Public images </li><li>Custom images </li><li>Shared images </li><li>Marketplace images </li><br/>You can obtain the available image IDs in the following ways: <br/><li>For IDs of `public images`, `custom images`, and `shared images`, log in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE) to query the information; for IDs of `marketplace images`, go to [Cloud Marketplace](https://market.cloud.tencent.com/list). </li><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response.</li>" }, { "name": "InstanceChargeType", "desc": "The instance [billing method](https://intl.cloud.tencent.com/document/product/213/2180?from_cn_redirect=1).<br><li>POSTPAID_BY_HOUR: hourly, pay-as-you-go<br>Default value: POSTPAID_BY_HOUR." }, { "name": "InstanceChargePrepaid", "desc": "Configuration of prepaid instances. You can use the parameter to specify the attributes of prepaid instances, such as the subscription period and the auto-renewal plan. This parameter is required for prepaid instances." }, { "name": "InstanceType", "desc": "The instance model. Different resource specifications are specified for different models. For specific values, call [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) to retrieve the latest specification list or refer to [Instance Types](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1). If the parameter is not specified, `S1.SMALL1` will be used by default." }, { "name": "SystemDisk", "desc": "System disk configuration of the instance. If this parameter is not specified, the default value will be used." }, { "name": "DataDisks", "desc": "The configuration information of the instance data disk. If this parameter is not specified, no data disk will be purchased by default. When purchasing, you can specify 21 data disks, which can contain at most 1 LOCAL_BASIC data disk or LOCAL_SSD data disk, and at most 20 CLOUD_BASIC data disks, CLOUD_PREMIUM data disks, or CLOUD_SSD data disks." }, { "name": "VirtualPrivateCloud", "desc": "VPC configurations. You can use this parameter to specify the VPC ID, subnet ID, etc. If this parameter is not specified, the basic network will be used by default. If a VPC IP is specified in this parameter, the `InstanceCount` parameter can only be 1. " }, { "name": "InternetAccessible", "desc": "Configuration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default." }, { "name": "InstanceCount", "desc": "Number of instances to be purchased. Value range: [1, 100]; default value: 1. The specified number of instances to be purchased cannot exceed the remaining quota allowed for the user. For more information on quota, see [CVM instance purchase limit](https://intl.cloud.tencent.com/document/product/213/2664)." }, { "name": "InstanceName", "desc": "Instance name to be displayed.<br><li>If this parameter is not specified, \"Unnamed\" will be displayed by default.</li><li>If you purchase multiple instances at the same time and specify a pattern string `{R:x}`, numbers `[x, x+n-1]` will be generated, where `n` represents the number of instances purchased. For example, you specify a pattern string, `server_{R:3}`. If you only purchase 1 instance, the instance will be named `server_3`; if you purchase 2, they will be named `server_3` and `server_4`. You can specify multiple pattern strings in the format of `{R:x}`.</li><li>If you purchase multiple instances at the same time and do not specify a pattern string, the instance names will be suffixed by `1, 2...n`, where `n` represents the number of instances purchased. For example, if you purchase 2 instances and name them as `server_`, the instance names will be displayed as `server_1` and `server_2`.</li><li>The instance name contains up to 60 characters (including pattern strings)." }, { "name": "LoginSettings", "desc": "Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center." }, { "name": "SecurityGroupIds", "desc": "Security groups to which the instance belongs. To obtain the security group IDs, you can call [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808) and look for the `sgld` fields in the response. If this parameter is not specified, the instance will not be associated with any security group by default." }, { "name": "EnhancedService", "desc": "Enhanced services. You can use this parameter to specify whether to enable services such as Cloud Monitor and Cloud Security. If this parameter is not specified, Cloud Monitor and Cloud Security will be enabled by default." }, { "name": "ClientToken", "desc": "A string used to ensure the idempotency of the request, which is generated by the user and must be unique to each request. The maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. <br>For more information, see 'How to ensure idempotency'." }, { "name": "HostName", "desc": "Host name of the CVM. <br><li>Periods (.) or hyphens (-) cannot be the start or end of a host name or appear consecutively in a host name.<br><li>For Windows instances, the host name must be 2-15 characters long and can contain uppercase and lowercase letters, numbers, and hyphens (-). It cannot contain periods (.) or contain only numbers. <br><li>For other instances, such as Linux instances, the host name must be 2-30 characters long. It supports multiple periods (.) and allows uppercase and lowercase letters, numbers, and hyphens (-) between any two periods (.)." }, { "name": "TagSpecification", "desc": "The tag description list. This parameter is used to bind a tag to a resource instance. A tag can only be bound to CVM instances." }, { "name": "InstanceMarketOptions", "desc": "The market options of the instance." }, { "name": "HpcClusterId", "desc": "HPC cluster ID." } ], "desc": "This API is used to query the price of creating instances. You can only use this API for instances whose configuration is within the purchase limit. For more information, see [RunInstances](https://intl.cloud.tencent.com/document/api/213/15730?from_cn_redirect=1)." }, "DescribeImages": { "params": [ { "name": "ImageIds", "desc": "List of image IDs, such as `img-gvbnzy6f`. For the format of array-type parameters, see [API Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1). You can obtain the image IDs in two ways: <br><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response. <br><li>View the image IDs in the [Image Console](https://console.cloud.tencent.com/cvm/image)." }, { "name": "Filters", "desc": "Filters. Each request can have up to 10 `Filters` and 5 `Filters.Values`. You cannot specify `ImageIds` and `Filters` at the same time. Specific filters:\n<li>`image-id` - String - Optional - Filter results by image ID</li>\n<li>`image-type` - String - Optional - Filter results by image type. Valid values:\n PRIVATE_IMAGE: private image created by the current account \n PUBLIC_IMAGE: public image created by Tencent Cloud\n SHARED_IMAGE: image shared with the current account by another account.</li>" }, { "name": "Offset", "desc": "Offset; default value: 0. For more information on `Offset`, see [API Introduction](https://intl.cloud.tencent.com/document/api/213/568?from_cn_redirect=1#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)." }, { "name": "Limit", "desc": "Number of results returned; default value: 20; maximum: 100. For more information on `Limit`, see [API Introduction](https://intl.cloud.tencent.com/document/api/213/568?from_cn_redirect=1#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)." }, { "name": "InstanceType", "desc": "Instance type, e.g. `S1.SMALL1`" } ], "desc": "This API is used to view the list of images.\n\n* You specify the image ID or set filters to query the details of certain images.\n* You can specify `Offset` and `Limit` to select a certain part of the results. By default, the information on the first 20 matching results is returned." }, "ModifyKeyPairAttribute": { "params": [ { "name": "KeyId", "desc": "Key pair ID in the format of `skey-xxxxxxxx`. <br><br>You can obtain the available key pair IDs in two ways: <br><li>Log in to the [console](https://console.cloud.tencent.com/cvm/sshkey) to query the key pair IDs. <br><li>Call [DescribeKeyPairs](https://intl.cloud.tencent.com/document/api/213/15699?from_cn_redirect=1) and look for `KeyId` in the response." }, { "name": "KeyName", "desc": "New key pair name, which can contain numbers, letters, and underscores, with a maximum length of 25 characters." }, { "name": "Description", "desc": "New key pair description. You can specify any name you like, but its length cannot exceed 60 characters." } ], "desc": "This API is used to modify the attributes of key pairs.\n\n* This API modifies the name and description of the key pair identified by the key pair ID.\n* The name of the key pair must be unique.\n* Key pair ID is the unique identifier of a key pair and cannot be modified." }, "ModifyInstancesAttribute": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100." }, { "name": "InstanceName", "desc": "Instance name. You can specify any name you like, but its length cannot exceed 60 characters." }, { "name": "SecurityGroups", "desc": "ID list of security groups of the instance. The instance will be associated with the specified security groups and will be disassociated from the original security groups." } ], "desc": "This API is used to modify the attributes of an instance. Currently you can only use the API to modify the name and the associated security groups of the instance.\n\n* Instance names are used only for users' convenience. Tencent Cloud does not use the name for ticket submission or instance management.\n* Batch operations are supported. The maximum number of instances in each request is 100.\n* When you change the security groups associated with an instance, the original security groups will be disassociated." }, "DescribeRegions": { "params": [], "desc": "This API is used to query regions." }, "InquiryPriceResetInstancesInternetMaxBandwidth": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100. When changing the bandwidth of instances with `BANDWIDTH_PREPAID` or `BANDWIDTH_POSTPAID_BY_HOUR` as the network billing method, you can only specify one instance at a time." }, { "name": "InternetAccessible", "desc": "Configuration of public network egress bandwidth. The maximum bandwidth varies among different models. For more information, see the documentation on bandwidth limits. Currently only the `InternetMaxBandwidthOut` parameter is supported." }, { "name": "StartTime", "desc": "Date from which the new bandwidth takes effect. Format: `YYYY-MM-DD`, such as `2016-10-30`. The starting date cannot be earlier than the current date. If the starting date is the current date, the new bandwidth takes effect immediately. This parameter is only valid for prepaid bandwidth. If you specify the parameter for bandwidth with other network billing methods, an error code will be returned." }, { "name": "EndTime", "desc": "Date until which the new bandwidth is effective. Format: `YYYY-MM-DD`, such as `2016-10-30`. The validity period of the new bandwidth covers the end date. The end date cannot be later than the expiration date of a prepaid instance. You can query the expiration time of an instance by calling [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728) and looking for `ExpiredTime` in the response. This parameter is only valid for prepaid bandwidth. If you specify the parameter for bandwidth with other network billing methods, an error code will be returned." } ], "desc": "This API is used to query the price for upgrading the public bandwidth cap of an instance.\n\n* The allowed bandwidth cap varies for different models. For details, see [Purchasing Network Bandwidth](https://intl.cloud.tencent.com/document/product/213/509?from_cn_redirect=1).\n* For bandwidth billed by the `TRAFFIC_POSTPAID_BY_HOUR` method, changing the bandwidth cap through this API takes effect in real time. You can increase or reduce bandwidth within applicable limits." }, "DisassociateInstancesKeyPairs": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). The maximum number of instances in each request is 100. <br><br>You can obtain the available instance IDs in two ways: <br><li>Log in to the [console](https://console.cloud.tencent.com/cvm/index) to query the instance IDs. <br><li>Call [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "KeyIds", "desc": "List of key pair IDs. The maximum number of key pairs in each request is 100. The key pair ID is in the format of `skey-11112222`. <br><br>You can obtain the available key pair IDs in two ways: <br><li>Log in to the [console](https://console.cloud.tencent.com/cvm/sshkey) to query the key pair IDs. <br><li>Call [DescribeKeyPairs](https://intl.cloud.tencent.com/document/api/213/15699?from_cn_redirect=1) and look for `KeyId` in the response." }, { "name": "ForceStop", "desc": "Whether to force shut down a running instances. It is recommended to manually shut down a running instance before disassociating a key pair from it. Valid values: <br><li>TRUE: force shut down an instance after a normal shutdown fails. <br><li>FALSE: do not force shut down an instance after a normal shutdown fails. <br><br>Default value: FALSE." } ], "desc": "This API is used to unbind one or more key pairs from one or more instances.\n\n* It only supports [`STOPPED`](https://intl.cloud.tencent.com/document/product/213/15753?from_cn_redirect=1#InstanceStatus) Linux instances.\n* After a key pair is disassociated from an instance, you can log in to the instance with password.\n* If you did not set a password for the instance, you will not be able to log in via SSH after the unbinding. In this case, you can call [ResetInstancesPassword](https://intl.cloud.tencent.com/document/api/213/15736?from_cn_redirect=1) to set a login password.\n* Batch operations are supported. The maximum number of instances in each request is 100. If instances not available for the operation are selected, you will get an error code." }, "CreateKeyPair": { "params": [ { "name": "KeyName", "desc": "Name of the key pair, which can contain numbers, letters, and underscores, with a maximum length of 25 characters." }, { "name": "ProjectId", "desc": "The ID of the project to which the new key pair belongs.\nYou can query the project IDs in two ways:\n<li>Query the project IDs in the project list.\n<li>Call `DescribeProject` and look for `projectId` in the response." } ], "desc": "This API is used to create an `OpenSSH RSA` key pair, which you can use to log in to a `Linux` instance.\n\n* You only need to specify a name, and the system will automatically create a key pair and return its `ID` and the public and private keys.\n* The name of the key pair must be unique.\n* You can save the private key to a file and use it as an authentication method for `SSH`.\n* Tencent Cloud does not save users' private keys. Be sure to save it yourself." }, "DescribeInstanceFamilyConfigs": { "params": [], "desc": "This API is used to query a list of model families available to the current user in the current region." }, "DeleteKeyPairs": { "params": [ { "name": "KeyIds", "desc": "Key ID(s). The maximum number of key pairs in each request is 100. <br>You can obtain the available key pair IDs in two ways: <br><li>Log in to the [console](https://console.cloud.tencent.com/cvm/sshkey) to query the key pair IDs. <br><li>Call [DescribeKeyPairs](https://intl.cloud.tencent.com/document/api/213/15699?from_cn_redirect=1) and look for `KeyId` in the response." } ], "desc": "This API is used to delete the key pairs hosted in Tencent Cloud.\n\n* You can delete multiple key pairs at the same time.\n* A key pair used by an instance or image cannot be deleted. Therefore, you need to verify whether all the key pairs have been deleted successfully." }, "CreateDisasterRecoverGroup": { "params": [ { "name": "Name", "desc": "Name of the spread placement group. The name must be 1-60 characters long and can contain both Chinese characters and English letters." }, { "name": "Type", "desc": "Type of the spread placement group. Valid values: <br><li>HOST: physical machine <br><li>SW: switch <br><li>RACK: rack" }, { "name": "ClientToken", "desc": "A string used to ensure the idempotency of the request, which is generated by the user and must be unique to each request. The maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. <br>For more information, see 'How to ensure idempotency'." } ], "desc": "This API is used to create a [spread placement group](https://intl.cloud.tencent.com/document/product/213/15486?from_cn_redirect=1). After you create one, you can specify it for an instance when you [create the instance](https://intl.cloud.tencent.com/document/api/213/15730?from_cn_redirect=1), " }, "DescribeInstances": { "params": [ { "name": "InstanceIds", "desc": "Query by instance ID(s). For example, instance ID: `ins-xxxxxxxx`. For the specific format, refer to section `Ids.N` of the API [Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1). You can query up to 100 instances in each request. However, `InstanceIds` and `Filters` cannot be specified at the same time." }, { "name": "Filters", "desc": "Filters.\n<li> `zone` - String - Optional - Filter results by availability zone.</li>\n<li> `project-id` - Integer - Optional - Filter results by project ID. You can call [DescribeProject](https://intl.cloud.tencent.com/document/api/378/4400?from_cn_redirect=1) or log in to the [console](https://console.cloud.tencent.com/cvm/index) to view the list of existing projects. You can also create a new project by calling [AddProject](https://intl.cloud.tencent.com/document/api/378/4398?from_cn_redirect=1).</li>\n<li> `host-id` - String - Optional - Filter results by [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) ID. [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) ID format: `host-xxxxxxxx`.</li>\n</li>`vpc-id` - String - Optional - Filter results by VPC ID. VPC ID format: `vpc-xxxxxxxx`.</li>\n<li> `subnet-id` - String - Optional - Filter results by subnet ID. Subnet ID format: `subnet-xxxxxxxx`.</li>\n</li>`instance-id` - String - Optional - Filter results by instance ID. Instance ID format: `ins-xxxxxxxx`.</li>\n</li>`security-group-id` - String - Optional - Filter results by security group ID. Security group ID format: `sg-8jlk3f3r`.</li>\n</li>`instance-name` - String - Optional - Filter results by instance name.</li>\n</li>`instance-charge-type` - String - Optional - Filter results by instance billing method. `POSTPAID_BY_HOUR`: pay-as-you-go | `CDHPAID`: you are only billed for [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) instances, not the CVMs running on the [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) instances.</li>\n</li>`private-ip-address` - String - Optional - Filter results by the private IP address of the instance's primary ENI.</li>\n</li>`public-ip-address` - String - Optional - Filter results by the public IP address of the instance's primary ENI, including the IP addresses automatically assigned during the instance creation and the EIPs manually associated after the instance creation.</li>\n<li> `tag-key` - String - Optional - Filter results by tag key.</li>\n</li>`tag-value` - String - Optional - Filter results by tag value.</li>\n<li> `tag:tag-key` - String - Optional - Filter results by tag key-value pair. Replace `tag-key` with specific tag keys, as shown in example 2.</li>\nEach request can have up to 10 `Filters` and 5 `Filters.Values`. You cannot specify `InstanceIds` and `Filters` at the same time." }, { "name": "Offset", "desc": "Offset; default value: 0. For more information on `Offset`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377)." }, { "name": "Limit", "desc": "Number of results returned; default value: 20; maximum: 100. For more information on `Limit`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377). " } ], "desc": "This API is used to query the details of instances.\n\n* You can filter the query results with the instance `ID`, name, or billing method. See `Filter` for more information.\n* If no parameter is defined, a certain number of instances under the current account will be returned. The number is specified by `Limit` and is 20 by default." }, "ImportKeyPair": { "params": [ { "name": "KeyName", "desc": "Key pair name, which can contain numbers, letters, and underscores, with a maximum length of 25 characters." }, { "name": "ProjectId", "desc": "The ID of the [project](https://intl.cloud.tencent.com/document/product/378/10861?from_cn_redirect=1) to which the created key pair belongs.<br><br>You can retrieve the project ID in two ways:<br><li>Query the project ID in [Project Management](https://console.cloud.tencent.com/project).<br><li>Call [DescribeProject](https://intl.cloud.tencent.com/document/api/378/4400?from_cn_redirect=1) and search for `projectId` in the response.\n\nIf you want to use the default project, specify 0 for the parameter." }, { "name": "PublicKey", "desc": "Content of the public key in the key pair in the `OpenSSH RSA` format." } ], "desc": "This API is used to import key pairs.\n\n* You can use this API to import key pairs to a user account, but the key pairs will not be automatically associated with any instance. You may use [AssociasteInstancesKeyPair](https://intl.cloud.tencent.com/document/api/213/9404?from_cn_redirect=1) to associate key pairs with instances.\n* You need to specify the names of the key pairs and the content of the public keys.\n* If you only have private keys, you can convert them to public keys with the `SSL` tool before importing them." }, "AssociateInstancesKeyPairs": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). The maximum number of instances in each request is 100. <br>You can obtain the available instance IDs in two ways: <br><li>Log in to the [console](https://console.cloud.tencent.com/cvm/index) to query the instance IDs. <br><li>Call [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "KeyIds", "desc": "Key ID(s). The maximum number of key pairs in each request is 100. The key pair ID is in the format of `skey-3glfot13`. <br>You can obtain the available key pair IDs in two ways: <br><li>Log in to the [console](https://console.cloud.tencent.com/cvm/sshkey) to query the key pair IDs. <br><li>Call [DescribeKeyPairs](https://intl.cloud.tencent.com/document/api/213/15699?from_cn_redirect=1) and look for `KeyId` in the response." }, { "name": "ForceStop", "desc": "Whether to force shut down a running instances. It is recommended to manually shut down a running instance before associating a key pair with it. Valid values: <br><li>TRUE: force shut down an instance after a normal shutdown fails. <br><li>FALSE: do not force shut down an instance after a normal shutdown fails. <br><br>Default value: FALSE." } ], "desc": "This API is used to associate key pairs with instances.\n\n* If the public key of a key pair is written to the `SSH` configuration of the instance, users will be able to log in to the instance with the private key of the key pair.\n* If the instance is already associated with a key, the old key will become invalid.\nIf you currently use a password to log in, you will no longer be able to do so after you associate the instance with a key.\n* Batch operations are supported. The maximum number of instances in each request is 100. If any instance in the request cannot be associated with a key, you will get an error code." }, "RunInstances": { "params": [ { "name": "Placement", "desc": "Location of the instance. You can use this parameter to specify the attributes of the instance, such as its availability zone, project, and CDH. You can specify a CDH for a CVM by creating the CVM on the CDH." }, { "name": "ImageId", "desc": "The [image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images:<br/><li>Public images</li><li>Custom images</li><li>Shared images</li><li>Marketplace images</li><br/>You can retrieve available image IDs in the following ways:<br/><li>For the IDs of `public images`, `custom images`, and `shared images`, log in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE) to query the information. For the IDs of `marketplace images`, go to [Cloud Marketplace](https://market.cloud.tencent.com/list). </li><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1), pass in `InstanceType` to retrieve the list of images supported by the current model, and then find the `ImageId` in the response.</li>" }, { "name": "InstanceChargeType", "desc": "The instance [billing method](https://intl.cloud.tencent.com/document/product/213/2180?from_cn_redirect=1). Valid values: <br><li>`POSTPAID_BY_HOUR`: hourly, pay-as-you-go<br><li>`CDHPAID`: you are only billed for CDH instances, not the CVMs running on the CDH instances.<br>Default value: POSTPAID_BY_HOUR." }, { "name": "InstanceChargePrepaid", "desc": "Configuration of prepaid instances. You can use the parameter to specify the attributes of prepaid instances, such as the subscription period and the auto-renewal plan. This parameter is required for prepaid instances." }, { "name": "InstanceType", "desc": "The instance model. Different resource specifications are specified for different instance models.\n<br><li>To view specific values for `POSTPAID_BY_HOUR` instances, you can call [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) or refer to [Instance Types](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1). If this parameter is not specified, `S1.SMALL1` will be used by default.<br><li>For `CDHPAID` instances, the value of this parameter is in the format of `CDH_XCXG` based on the number of CPU cores and memory capacity. For example, if you want to create a CDH instance with a single-core CPU and 1 GB memory, specify this parameter as `CDH_1C1G`." }, { "name": "SystemDisk", "desc": "System disk configuration of the instance. If this parameter is not specified, the default value will be used." }, { "name": "DataDisks", "desc": "The configuration information of instance data disks. If this parameter is not specified, no data disk will be purchased by default. When purchasing, you can specify 21 data disks, which can contain at most 1 LOCAL_BASIC data disk or LOCAL_SSD data disk, and at most 20 CLOUD_BASIC data disks, CLOUD_PREMIUM data disks, or CLOUD_SSD data disks." }, { "name": "VirtualPrivateCloud", "desc": "Configuration information of VPC. This parameter is used to specify VPC ID and subnet ID, etc. If this parameter is not specified, the classic network is used by default. If a VPC IP is specified in this parameter, it indicates the primary ENI IP of each instance. The value of parameter InstanceCount must be same as the number of VPC IPs, which cannot be greater than 20." }, { "name": "InternetAccessible", "desc": "Configuration of public network bandwidth. If this parameter is not specified, 0 Mbps will be used by default." }, { "name": "InstanceCount", "desc": "The number of instances to be purchased. Value range: [1, 100]; default value: 1. The specified number of instances to be purchased cannot exceed the remaining quota allowed for the user. For more information on the quota, see [CVM instance purchase limit](https://intl.cloud.tencent.com/document/product/213/2664)." }, { "name": "InstanceName", "desc": "Instance name to be displayed.<br><li>If this parameter is not specified, \"Unnamed\" will be displayed by default.</li><li>If you purchase multiple instances at the same time and specify a pattern string `{R:x}`, numbers `[x, x+n-1]` will be generated, where `n` represents the number of instances purchased. For example, you specify a pattern string, `server_{R:3}`. If you only purchase 1 instance, the instance will be named `server_3`; if you purchase 2, they will be named `server_3` and `server_4`. You can specify multiple pattern strings in the format of `{R:x}`.</li><li>If you purchase multiple instances at the same time and do not specify a pattern string, the instance names will be suffixed by `1, 2...n`, where `n` represents the number of instances purchased. For example, if you purchase 2 instances and name them as `server_`, the instance names will be displayed as `server_1` and `server_2`.</li><li>The instance name contains up to 60 characters (including pattern strings)." }, { "name": "LoginSettings", "desc": "Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center." }, { "name": "SecurityGroupIds", "desc": "Security groups to which the instance belongs. To obtain the security group IDs, you can call [DescribeSecurityGroups](https://intl.cloud.tencent.com/document/api/215/15808) and look for the `sgld` fields in the response. If this parameter is not specified, the instance will be associated with default security groups." }, { "name": "EnhancedService", "desc": "Specifies whether to enable services such as Anti-DDoS and Cloud Monitor. If this parameter is not specified, Cloud Monitor and Anti-DDoS are enabled for public images by default. However, for custom images and images from the marketplace, Anti-DDoS and Cloud Monitor are not enabled by default. The original services in the image will be retained." }, { "name": "ClientToken", "desc": "A string used to ensure the idempotency of the request, which is generated by the user and must be unique to each request. The maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed. <br>For more information, see 'How to ensure idempotency'." }, { "name": "HostName", "desc": "Host name of the CVM. <br><li>Periods (.) or hyphens (-) cannot be the start or end of a host name or appear consecutively in a host name.<br><li>For Windows instances, the host name must be 2-15 characters long and can contain uppercase and lowercase letters, numbers, and hyphens (-). It cannot contain periods (.) or contain only numbers. <br><li>For other instances, such as Linux instances, the host name must be 2-60 characters long. It supports multiple periods (.) and allows uppercase and lowercase letters, numbers, and hyphens (-) between any two periods (.)." }, { "name": "ActionTimer", "desc": "Scheduled tasks. You can use this parameter to specify scheduled tasks for the instance. Only scheduled termination is supported." }, { "name": "DisasterRecoverGroupIds", "desc": "Placement group ID. You can only specify one." }, { "name": "TagSpecification", "desc": "The tag description list. This parameter is used to bind a tag to a resource instance. A tag can only be bound to CVM instances." }, { "name": "InstanceMarketOptions", "desc": "The market options of the instance." }, { "name": "UserData", "desc": "User data provided to the instance, which needs to be encoded in base64 format with the maximum size of 16KB. For more information on how to get the value of this parameter, see the commands you need to execute on startup for [Windows](https://intl.cloud.tencent.com/document/product/213/17526) or [Linux](https://intl.cloud.tencent.com/document/product/213/17525)." }, { "name": "DryRun", "desc": "Whether the request is a dry run only.\ntrue: dry run only. The request will not create instance(s). A dry run can check whether all the required parameters are specified, whether the request format is right, whether the request exceeds service limits, and whether the specified CVMs are available.\nIf the dry run fails, the corresponding error code will be returned.\nIf the dry run succeeds, the RequestId will be returned.\nfalse (default value): send a normal request and create instance(s) if all the requirements are met." }, { "name": "HpcClusterId", "desc": "HPC cluster ID. The HPC cluster must and can only be specified for a high-performance computing instance." } ], "desc": "This API is used to create one or more instances with a specified configuration.\n\n* After an instance is created successfully, it will start up automatically, and the [instance state](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#instance_state) will become \"Running\".\n* If you create a pay-as-you-go instance billed on an hourly basis, an amount equivalent to the hourly rate will be frozen before the creation. Make sure your account balance is sufficient before calling this API.\n* The number of instances you can purchase through this API is subject to the [CVM instance purchase limit](https://intl.cloud.tencent.com/document/product/213/2664?from_cn_redirect=1). Both the instances created through this API and the console will be counted toward the quota.\n* This API is an async API. An instance `ID` list will be returned after you successfully make a creation request. However, it does not mean the creation has been completed. The state of the instance will be `Creating` during the creation. You can use [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) to query the status of the instance. If the status changes from `Creating` to `Running`, it means that the instance has been created successfully." }, "DeleteImages": { "params": [ { "name": "ImageIds", "desc": "List of the IDs of the instances to be deleted." } ], "desc": "This API is used to delete images.\n\n* If the [ImageState](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#image_state) of an image is `Creating` or `In Use`, it cannot be deleted. Use [DescribeImages](https://intl.cloud.tencent.com/document/api/213/9418?from_cn_redirect=1) to query the image state.\n* You can only create up to 10 custom images in each region. If you have used up the quota, you can delete images to create new ones.\n* A shared image cannot be deleted." }, "InquiryPriceResizeInstanceDisks": { "params": [ { "name": "InstanceId", "desc": "Instance ID. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "DataDisks", "desc": "The configuration of data disks to be expanded. Currently, you can only use the API to expand non-elastic data disks whose [disk type](https://intl.cloud.tencent.com/document/product/213/15753?from_cn_redirect=1#DataDisk) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`. You can use [`DescribeDisks`](https://intl.cloud.tencent.com/document/api/362/16315?from_cn_redirect=1) to check whether a disk is elastic. If the `Portable` field in the response is `false`, it means that the disk is non-elastic. Data disk capacity unit: GB; minimum increment: 10 GB. For more information about selecting a data disk type, see the product overview on cloud disks. Available data disk types are subject to the instance type (`InstanceType`). In addition, the maximum capacity allowed for expansion varies by data disk type." }, { "name": "ForceStop", "desc": "Whether to force shut down a running instances. It is recommended to manually shut down a running instance before resetting the user password. Valid values: <br><li>TRUE: force shut down an instance after a normal shutdown fails. <br><li>FALSE: do not force shut down an instance after a normal shutdown fails. <br><br>Default value: FALSE. <br><br>A forced shutdown is similar to switching off the power of a physical computer. It may cause data loss or file system corruption. Be sure to only force shut down a CVM when it cannot be shut down normally." } ], "desc": "This API is used to query the price for expanding data disks of an instance.\n\n* Currently, you can only use this API to query the price of non-elastic data disks whose [disk type](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#block_device) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`. You can use [`DescribeDisks`](https://intl.cloud.tencent.com/document/api/362/16315?from_cn_redirect=1) to check whether a disk is elastic. If the `Portable` field in the response is `false`, it means that the disk is non-elastic.\n* Currently, you cannot use this API to query the price for [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) instances. *Also, you can only query the price of expanding one data disk at a time." }, "ModifyInstancesVpcAttribute": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "VirtualPrivateCloud", "desc": "VPC configurations. You can use this parameter to specify the VPC ID, subnet ID, VPC IP, etc. If the specified VPC ID and subnet ID (the subnet must be in the same availability zone as the instance) are different from the VPC where the specified instance resides, the instance will be migrated to a subnet of the specified VPC. You can use `PrivateIpAddresses` to specify the VPC subnet IP. If you want to specify the subnet IP, you will need to specify a subnet IP for each of the specified instances, and each `InstanceIds` will match a `PrivateIpAddresses`. If `PrivateIpAddresses` is not specified, the VPC subnet IP will be assigned randomly." }, { "name": "ForceStop", "desc": "Whether to force shut down a running instances. Default value: TRUE." }, { "name": "ReserveHostName", "desc": "Whether to keep the host name. Default value: FALSE." } ], "desc": "This API is used to modify the VPC attributes of an instance, such as the VPC IP address.\n* By default, the instances will shut down when you perform this operation and restart upon completion.\n* If the specified VPC ID and subnet ID (the subnet must be in the same availability zone as the instance) are different from the VPC where the specified instance resides, the instance will be migrated to a subnet of the specified VPC. Before performing this operation, make sure that the specified instance is not bound with an [ENI](https://intl.cloud.tencent.com/document/product/576?from_cn_redirect=1) or [CLB](https://intl.cloud.tencent.com/document/product/214?from_cn_redirect=1)." }, "InquiryPriceResetInstance": { "params": [ { "name": "InstanceId", "desc": "Instance ID. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "ImageId", "desc": "[Image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images: <br/><li>Public images </li><li>Custom images </li><li>Shared images </li><li>Marketplace images </li><br/>You can obtain the available image IDs in the following ways: <br/><li>For IDs of `public images`, `custom images`, and `shared images`, log in to the [console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE) to query the information; for IDs of `marketplace images`, go to [Cloud Marketplace](https://market.cloud.tencent.com/list). </li><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response.</li>" }, { "name": "SystemDisk", "desc": "Configuration of the system disk of the instance. For instances with a cloud disk as the system disk, you can expand the system disk by using this parameter to specify the new capacity after reinstallation. If the parameter is not specified, the system disk capacity remains unchanged by default. You can only expand the capacity of the system disk; reducing its capacity is not supported. When reinstalling the system, you can only modify the capacity of the system disk, not the type." }, { "name": "LoginSettings", "desc": "Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center." }, { "name": "EnhancedService", "desc": "Enhanced services. You can use this parameter to specify whether to enable services such as Cloud Monitor and Cloud Security. If this parameter is not specified, Cloud Monitor and Cloud Security will be enabled by default." } ], "desc": "This API is used to query the price for reinstalling an instance.\n\n* If you have specified the `ImageId` parameter, the price query is performed with the specified image. Otherwise, the image used by the current instance is used.\n* You can only query the price for reinstallation caused by switching between Linux and Windows OS. And the [system disk type](https://intl.cloud.tencent.com/document/api/213/15753?from_cn_redirect=1#SystemDisk) of the instance must be `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`.\n* Currently, this API only supports instances in Mainland China regions." }, "DescribeDisasterRecoverGroupQuota": { "params": [], "desc": "This API is used to query the quota of [spread placement groups](https://intl.cloud.tencent.com/document/product/213/15486?from_cn_redirect=1)." }, "ResetInstancesPassword": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100." }, { "name": "Password", "desc": "Login password of the instance. The rule of password complexity varies with operating systems:\nFor a Linux instance, the password must be 8 to 30 characters in length; password with more than 12 characters is recommended. It cannot begin with \"/\", and must contain at least three types of the following:<br><li>Lowercase letters: [a-z]<br><li>Uppercase letters: [A-Z]<br><li>Numbers: 0-9<br><li>Special characters: ()\\`~!@#$%^&\\*-+=\\_|{}[]:;'<>,.?/\nFor a Windows CVM, the password must be 12 to 30 characters in length. It cannot begin with \"/\" or contain your username. It must contain at least three types of the following:<br><li>Lowercase letters: [a-z]<br><li>Uppercase letters: [A-Z]<br><li>Numbers: 0-9<br><li>Special characters: ()\\`~!@#$%^&\\*-+=\\_|{}[]:;' <>,.?/<li>If the specified instances include both `Linux` and `Windows` instances, you need to follow the password requirements for `Windows` instances." }, { "name": "UserName", "desc": "Username of the instance operating system for which the password needs to be reset. This parameter is limited to 64 characters." }, { "name": "ForceStop", "desc": "Whether to force shut down a running instances. It is recommended to manually shut down a running instance before resetting the user password. Valid values: <br><li>TRUE: force shut down an instance after a normal shutdown fails. <br><li>FALSE: do not force shut down an instance after a normal shutdown fails. <br><br>Default value: FALSE. <br><br>A forced shutdown is similar to switching off the power of a physical computer. It may cause data loss or file system corruption. Be sure to only force shut down a CVM when it cannot be shut down normally." } ], "desc": "This API is used to reset the password of the operating system instances to a user-specified password.\n\n* To modify the password of the administrator account: the name of the administrator account varies with the operating system. In Windows, it is `Administrator`; in Ubuntu, it is `ubuntu`; in Linux, it is `root`.\n* To reset the password of a running instance, you need to set the parameter `ForceStop` to `True` for a forced shutdown. If not, only passwords of stopped instances can be reset.\n* Batch operations are supported. You can reset the passwords of up to 100 instances to the same value once.\n* You can call the [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) API and find the result of the operation in the response parameter `LatestOperationState`. If the value is `SUCCESS`, the operation is successful." }, "PurchaseReservedInstancesOffering": { "params": [ { "name": "InstanceCount", "desc": "The number of the Reserved Instance you are purchasing." }, { "name": "ReservedInstancesOfferingId", "desc": "The ID of the Reserved Instance." }, { "name": "DryRun", "desc": "Dry run" }, { "name": "ClientToken", "desc": "A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed.<br>For more information, see Ensuring Idempotency." }, { "name": "ReservedInstanceName", "desc": "Reserved instance name.<br><li>The RI name defaults to “unnamed” if this parameter is left empty.</li><li>You can enter any name within 60 characters (including the pattern string).</li>" } ], "desc": "This API is used to purchase one or more specific Reserved Instances." }, "ResizeInstanceDisks": { "params": [ { "name": "InstanceId", "desc": "Instance ID. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "DataDisks", "desc": "Configuration of data disks to be expanded. Currently you can only use the API to expand non-elastic data disks whose [disk type](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#block_device) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`. You can use [`DescribeDisks`](https://intl.cloud.tencent.com/document/api/362/16315?from_cn_redirect=1) to check whether a disk is elastic. If the `Portable` field in the response is `false`, it means that the disk is not elastic. Data disk capacity unit: GB; minimum increment: 10 GB. For more information on selecting the data disk type, see the [product overview on cloud disks](https://intl.cloud.tencent.com/document/product/362/2353?from_cn_redirect=1). Available data disk types are subject to the instance type (`InstanceType`). In addition, the maximum capacity allowed for expansion varies by data disk type." }, { "name": "ForceStop", "desc": "Whether to force shut down a running instances. It is recommended to manually shut down a running instance before resetting the user password. Valid values: <br><li>TRUE: force shut down an instance after a normal shutdown fails. <br><li>FALSE: do not force shut down an instance after a normal shutdown fails. <br><br>Default value: FALSE. <br><br>A forced shutdown is similar to switching off the power of a physical computer. It may cause data loss or file system corruption. Be sure to only force shut down a CVM when it cannot be shut down normally." } ], "desc": "This API (ResizeInstanceDisks) is used to expand the data disks of an instance.\n\n* Currently, you can only use the API to expand non-elastic data disks whose [disk type](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#block_device) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`. You can use [`DescribeDisks`](https://intl.cloud.tencent.com/document/api/362/16315?from_cn_redirect=1) to check whether a disk is elastic. If the `Portable` field in the response is `false`, it means that the disk is non-elastic.\n* Currently, this API does not support [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) instances.\n* Currently, only one data disk can be expanded at a time." }, "DescribeReservedInstances": { "params": [ { "name": "DryRun", "desc": "Dry run. The default is false." }, { "name": "Offset", "desc": "Offset. The default value is 0. For more information on `Offset`, see the relevant sections in API [Overview](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1)." }, { "name": "Limit", "desc": "Number of returned results. The default value is 20. The maximum is 100. For more information on `Limit`, see the relevant sections in API [Overview](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1)." }, { "name": "Filters", "desc": "<li><strong>zone</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>availability zone</strong> in which the reserved instances can be purchased, such as ap-guangzhou-1.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: please see <a href=\"https://intl.cloud.tencent.com/document/product/213/6091?from_cn_redirect=1\">Availability Zones</a></p>\n<li><strong>duration</strong></li>\n<p style=\"padding-left: 30px;\">Filters by the <strong>validity</strong> of the reserved instance, in seconds. For example, `31536000`.</p><p style=\"padding-left: 30px;\">Type: Integer</p><p style=\"padding-left: 30px;\">Unit: second</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: 31536000 (1 year) | 94608000 (3 years)</p>\n<li><strong>instance-type</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>reserved instance specification</strong>, such as `S3.MEDIUM4`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: please see <a href=\"https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1\">Reserved Instance Specifications</a></p>\n<li><strong>instance-family</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>type of the reserved instance</strong>, such as `S3`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: please see <a href=\"https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1\">Reserved Instance Types</a></p>\n<li><strong>offering-type</strong></li>\n<li><strong>offering-type</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>payment method</strong>, such as `All Upfront`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid value: All Upfront</p>\n<li><strong>product-description</strong></li>\n<p style=\"padding-left: 30px;\">Filters by the <strong>platform description</strong> (operating system) of the reserved instance, such as `linux`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid value: linux</p>\n<li><strong>reserved-instances-id</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>reserved instance ID</strong> in the form of 650c138f-ae7e-4750-952a-96841d6e9fc1.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p>\n<li><strong>state</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>reserved instance status</strong>. For example, “active”.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required</p><p style=\"padding-left: 30px;\">Valid values: active (created) | pending (waiting to be created) | retired (expired)</p>\nEach request can have up to 10 `Filters` and 5 `Filter.Values`." } ], "desc": "This API is used to list reserved instances the user has purchased." }, "DescribeZones": { "params": [], "desc": "This API is used to query availability zones." }, "DescribeImageQuota": { "params": [], "desc": "This API is used to query the image quota of an user account." }, "AssociateSecurityGroups": { "params": [ { "name": "SecurityGroupIds", "desc": "ID of the security group to be associated, such as `sg-efil73jd`. Only one security group can be associated." }, { "name": "InstanceIds", "desc": "ID of the instance bound in the format of ins-lesecurk. You can specify up to 100 instances in each request." } ], "desc": "This API is used to associate security groups with specified instances." }, "ResetInstancesType": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). You can obtain the instance IDs from the value of `InstanceId` returned by the [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) API. The maximum number of instances for each request is 1." }, { "name": "InstanceType", "desc": "Instance model. Different resource specifications are specified for different models. For specific values, call [DescribeInstanceTypeConfigs](https://intl.cloud.tencent.com/document/api/213/15749?from_cn_redirect=1) to get the latest specification list or refer to [Instance Types](https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1)." }, { "name": "ForceStop", "desc": "Forced shutdown of a running instances. We recommend you firstly try to shut down a running instance manually. Valid values: <br><li>TRUE: forced shutdown of an instance after a normal shutdown fails.<br><li>FALSE: no forced shutdown of an instance after a normal shutdown fails.<br><br>Default value: FALSE.<br><br>A forced shutdown is similar to switching off the power of a physical computer. It may cause data loss or file system corruption. Be sure to only force a CVM to shut off if the normal shutdown fails." } ], "desc": "This API is used to change the model of an instance.\n* You can only use this API to change the models of instances whose [system disk type](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#block_device) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`.\n* Currently, you cannot use this API to change the models of [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) instances." }, "ModifyImageAttribute": { "params": [ { "name": "ImageId", "desc": "Image ID such as `img-gvbnzy6f`. You can obtain the image IDs in two ways: <br><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response. <br><li>Look for the information in the [Image Console](https://console.cloud.tencent.com/cvm/image)." }, { "name": "ImageName", "desc": "New image name, which must meet the following requirements: <br> <li>No more than 20 characters. <br> <li>Must be unique." }, { "name": "ImageDescription", "desc": "New image description, which must meet the following requirement: <br> <li> No more than 60 characters." } ], "desc": "This API is used to modify image attributes.\n\n* Attributes of shared images cannot be modified." }, "DescribeReservedInstancesConfigInfos": { "params": [ { "name": "Filters", "desc": "zone\nFilters by the availability zones in which the reserved instance can be purchased, such as `ap-guangzhou-1`.\nType: String\nRequired: no\nValid values: list of regions/availability zones\n\nproduct-description\nFilters by the platform description (operating system) of the reserved instance, such as `linux`.\nType: String\nRequired: no\nValid value: linux\n\nduration\nFilters by the **validity** of the reserved instance, which is the purchased usage period. For example, `31536000`.\nType: Integer\nUnit: second\nRequired: no\nValid values: 31536000 (1 year), 94608000 (3 years)" } ], "desc": "This API is used to describe reserved instance (RI) offerings. Currently, RIs are only offered to beta users." }, "InquiryPriceResetInstancesType": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). You can obtain the instance IDs from the value of `InstanceId` returned by the [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) API. The maximum number of instances in each request is 1." }, { "name": "InstanceType", "desc": "Instance model. Resources vary with the instance model. Specific values can be found in the tables of [Instance Types] (https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1) or in the latest specifications via the [DescribeInstanceTypeConfigs] (https://intl.cloud.tencent.com/document/product/213/15749?from_cn_redirect=1) API." } ], "desc": "This API is used to query the price for adjusting the instance model.\n\n* Currently, you can only use this API to query the prices of instances whose [system disk type](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#block_device) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`.\n* Currently, you cannot use this API to query the prices of [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) instances." }, "StopInstances": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100." }, { "name": "ForceStop", "desc": "Whether to force shut down an instance after a normal shutdown fails. Valid values: <br><li>TRUE: force shut down an instance after a normal shutdown fails <br><li>FALSE: do not force shut down an instance after a normal shutdown fails <br><br>Default value: FALSE." }, { "name": "StopType", "desc": "Instance shutdown mode. Valid values: <br><li>SOFT_FIRST: perform a soft shutdown first, and force shut down the instance if the soft shutdown fails <br><li>HARD: force shut down the instance directly <br><li>SOFT: soft shutdown only <br>Default value: SOFT." }, { "name": "StoppedMode", "desc": "Billing method of a pay-as-you-go instance after shutdown.\nValid values: <br><li>KEEP_CHARGING: billing continues after shutdown <br><li>STOP_CHARGING: billing stops after shutdown <br>Default value: KEEP_CHARGING.\nThis parameter is only valid for some pay-as-you-go instances using cloud disks. For more information, see [No charges when shut down for pay-as-you-go instances](https://intl.cloud.tencent.com/document/product/213/19918)." } ], "desc": "This API is used to shut down instances.\n\n* You can only perform this operation on instances whose status is `RUNNING`.\n* The instance status will become `STOPPING` when the API is called successfully and `STOPPED` when the instance is successfully shut down.\n* Forced shutdown is supported. A forced shutdown is similar to switching off the power of a physical computer. It may cause data loss or file system corruption. Be sure to only force shut down a CVM when it cannot be sht down normally.\n* Batch operations are supported. The maximum number of instances in each request is 100." }, "ModifyHostsAttribute": { "params": [ { "name": "HostIds", "desc": "CDH instance ID(s)." }, { "name": "HostName", "desc": "CDH instance name to be displayed. You can specify any name you like, but its length cannot exceed 60 characters." }, { "name": "RenewFlag", "desc": "Auto renewal flag. Valid values: <br><li>NOTIFY_AND_AUTO_RENEW: notify upon expiration and renew automatically <br><li>NOTIFY_AND_MANUAL_RENEW: notify upon expiration but do not renew automatically <br><li>DISABLE_NOTIFY_AND_MANUAL_RENEW: neither notify upon expiration nor renew automatically <br><br>If this parameter is specified as NOTIFY_AND_AUTO_RENEW, the instance will be automatically renewed on a monthly basis if the account balance is sufficient." }, { "name": "ProjectId", "desc": "Project ID. You can create a project by using the [AddProject](https://intl.cloud.tencent.com/doc/api/403/4398?from_cn_redirect=1) API and obtain its ID from the response parameter `projectId` of the [`DescribeProject`](https://intl.cloud.tencent.com/document/product/378/4400?from_cn_redirect=1) API. Subsequently, the project ID can be used to filter results when you query instances by calling the [DescribeHosts](https://intl.cloud.tencent.com/document/api/213/16474?from_cn_redirect=1) API." } ], "desc": "This API is used to modify the attributes of a CDH instance, such as instance name and renewal flag. One of the two parameters, HostName and RenewFlag, must be set, but you cannot set both of them at the same time." }, "DescribeImportImageOs": { "params": [], "desc": "This API is used to query the list of supported operating systems of imported images." }, "InquirePricePurchaseReservedInstancesOffering": { "params": [ { "name": "InstanceCount", "desc": "The number of the reserved instances you are purchasing." }, { "name": "ReservedInstancesOfferingId", "desc": "The ID of the reserved instance offering." }, { "name": "DryRun", "desc": "Dry run." }, { "name": "ClientToken", "desc": "A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed.<br>For more information, see Ensuring Idempotency." }, { "name": "ReservedInstanceName", "desc": "Reserved instance name.<br><li>The RI name defaults to “unnamed” if this parameter is left empty.</li><li>You can enter any name within 60 characters (including the pattern string).</li>" } ], "desc": "This API is used to query the price of reserved instances. It only supports querying purchasable reserved instance offerings. Currently, RIs are only offered to beta users." }, "DescribeInstanceVncUrl": { "params": [ { "name": "InstanceId", "desc": "Instance ID. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." } ], "desc": "This API is used to query the Virtual Network Console (VNC) URL of an instance for its login to the VNC.\n\n* It does not support `STOPPED` CVMs.\n* A VNC URL is only valid for 15 seconds. If you do not access the URL within 15 seconds, it will become invalid and you have to query a URL again.\n* Once the VNC URL is accessed, it will become invalid and you have to query a URL again if needed.\n* If the connection is interrupted, you can make up to 30 reconnection attempts per minute.\n* After getting the value `InstanceVncUrl`, you need to append `InstanceVncUrl=xxxx` to the end of the link <https://img.qcloud.com/qcloud/app/active_vnc/index.html?>.\n\n - `InstanceVncUrl`: its value will be returned after the API is successfully called.\n\n The final URL is in the following format:\n\n```\nhttps://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9\n```\n" }, "ResetInstance": { "params": [ { "name": "InstanceId", "desc": "Instance ID. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response." }, { "name": "ImageId", "desc": "Specified effective [image](https://intl.cloud.tencent.com/document/product/213/4940?from_cn_redirect=1) ID in the format of `img-xxx`. There are four types of images:<br/><li>Public images</li><li>Custom images</li><li>Shared images</li><li>Marketplace images </li><br/>You can obtain the available image IDs in the following ways:<br/><li>for IDs of `public images`, `custom images`, and `shared images`, log in to the [CVM console](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE); for IDs of `marketplace images`, go to [Cloud Marketplace](https://market.cloud.tencent.com/list).</li><li>Call the API [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response.</li>\n<br>Default value: current image." }, { "name": "SystemDisk", "desc": "System disk configurations in the instance. For instances with a cloud disk as the system disk, you can expand the capacity of the system disk to the specified value after re-installation by using this parameter. If the parameter is not specified, lower system disk capacity will be automatically expanded to the image size, and extra disk costs are generated. You can only expand but cannot reduce the system disk capacity. By re-installing the system, you only modify the system disk capacity, but not the type." }, { "name": "LoginSettings", "desc": "Login settings of the instance. You can use this parameter to set the login method, password, and key of the instance or keep the login settings of the original image. By default, a random password will be generated and sent to you via the Message Center." }, { "name": "EnhancedService", "desc": "Enhanced services. You can use this parameter to specify whether to enable services such as Cloud Monitor and Cloud Security. If this parameter is not specified, Cloud Monitor and Cloud Security will be enabled by default." }, { "name": "HostName", "desc": "Host name of the CVM, editable during the system reinstallation. <br><li>Periods (.) or hyphens (-) cannot be the start or end of a host name or appear consecutively in a host name.<br><li>For Windows instances, the host name must consist of 2-15 characters , including uppercase and lowercase letters, numbers, or hyphens (-). It cannot contain periods (.) or contain only numbers.<br><li>For other instances, such as Linux instances, the host name must consist of 2-60 characters, including multiple periods (.), and allows uppercase and lowercase letters, numbers, or hyphens (-) between any two periods (.)." } ], "desc": "This API is used to reinstall the operating system of the specified instance.\n\n* If you specify an `ImageId`, the specified image is used. Otherwise, the image used by the current instance is used.\n* The system disk will be formatted and reset. Therefore, make sure that no important files are stored on the system disk.\n* If the operating system switches between `Linux` and `Windows`, the system disk `ID` of the instance will change, and the snapshots that are associated with the system disk can no longer be used to roll back and restore data.\n* If no password is specified, you will get a random password via internal message.\n* You can only use this API to switch the operating system between `Linux` and `Windows` for instances whose [system disk type](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#SystemDisk) is `CLOUD_BASIC`, `CLOUD_PREMIUM`, or `CLOUD_SSD`.\n* Currently, this API only supports instances in Mainland China regions." }, "SyncImages": { "params": [ { "name": "ImageIds", "desc": "List of image IDs. You can obtain the image IDs in two ways: <br><li>Call [DescribeImages](https://intl.cloud.tencent.com/document/api/213/15715?from_cn_redirect=1) and look for `ImageId` in the response. <br><li>Look for the information in the [Image Console](https://console.cloud.tencent.com/cvm/image). <br>The specified images must meet the following requirements: <br><li>The images must be in the `NORMAL` state. <br><li>The image size must be smaller than 50 GB. <br>For more information on image states, see [here](https://intl.cloud.tencent.com/document/api/213/9452?from_cn_redirect=1#image_state)." }, { "name": "DestinationRegions", "desc": "List of destination regions for synchronization. A destination region must meet the following requirements: <br><li>It cannot be the source region. <br><li>It must be valid. <br><li>Currently some regions do not support image synchronization. <br>For specific regions, see [Region](https://intl.cloud.tencent.com/document/product/213/6091?from_cn_redirect=1)." } ], "desc": "This API is used to sync a custom image to other regions.\n\n* Each API call syncs a single image.\n* This API supports syncing an image to multiple regions.\n* Each account can have up to 10 custom images in each region. " }, "DeleteDisasterRecoverGroups": { "params": [ { "name": "DisasterRecoverGroupIds", "desc": "ID list of spread placement groups, obtainable via the [DescribeDisasterRecoverGroups](https://intl.cloud.tencent.com/document/api/213/17810?from_cn_redirect=1) API. You can operate up to 100 spread placement groups in each request." } ], "desc": "This API is used to delete a [spread placement group](https://intl.cloud.tencent.com/document/product/213/15486?from_cn_redirect=1). Only empty placement groups can be deleted. To delete a non-empty group, you need to terminate all the CVM instances in it first. Otherwise, the deletion will fail." }, "TerminateInstances": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100." } ], "desc": "This API is used to return instances.\n\n* Use this API to return instances that are no longer required.\n* Pay-as-you-go instances can be returned directly through this API.\n* When this API is called for the first time, the instance will be moved to the recycle bin. When this API is called for the second time, the instance will be terminated and cannot be recovered.\n* Batch operations are supported. The allowed maximum number of instances in each request is 100." }, "DescribeZoneInstanceConfigInfos": { "params": [ { "name": "Filters", "desc": "Filters.\n\n<li> `zone` - String - Optional - Filter results by availability zone.</li>\n\n<li>`instance-family` - String - Optional - Filter results by instance model family, such as `S1`, `I1`, and `M1`.</li>\n\n<li>`instance-type` - String - Optional - Filter results by model. Different instance models have different configurations. You can call `DescribeInstanceTypeConfigs` to query the latest configuration list or refer to the documentation on instance types. If this parameter is not specified, `S1.SMALL1` will be used by default.</li>\n\n<li>`instance-charge-type` - String - Optional - Filter results by instance billing method. `POSTPAID_BY_HOUR`: pay-as-you-go | `CDHPAID`: you are only billed for CDH instances, not the CVMs running on the CDH instances.</li>" } ], "desc": "This API is used to query the configurations of models in an availability zone." }, "ResetInstancesInternetMaxBandwidth": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100. When changing the bandwidth of instances with `BANDWIDTH_PREPAID` or `BANDWIDTH_POSTPAID_BY_HOUR` as the network billing method, you can only specify one instance at a time." }, { "name": "InternetAccessible", "desc": "Configuration of public network egress bandwidth. The maximum bandwidth varies among different models. For more information, see the documentation on bandwidth limits. Currently only the `InternetMaxBandwidthOut` parameter is supported." }, { "name": "StartTime", "desc": "Date from which the new bandwidth takes effect. Format: `YYYY-MM-DD`, such as `2016-10-30`. The starting date cannot be earlier than the current date. If the starting date is the current date, the new bandwidth takes effect immediately. This parameter is only valid for prepaid bandwidth. If you specify the parameter for bandwidth with other network billing methods, an error code will be returned." }, { "name": "EndTime", "desc": "Date until which the new bandwidth is effective. Format: `YYYY-MM-DD`, such as `2016-10-30`. The validity period of the new bandwidth covers the end date. The end date cannot be later than the expiration date of a prepaid instance. You can query the expiration time of an instance by calling [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728) and looking for `ExpiredTime` in the response. This parameter is only valid for prepaid bandwidth. If you specify the parameter for bandwidth with other network billing methods, an error code will be returned." } ], "desc": "This API is used to change the public bandwidth cap of an instance.\n\n* The allowed bandwidth cap varies for different models. For details, see [Purchasing Network Bandwidth](https://intl.cloud.tencent.com/document/product/213/509?from_cn_redirect=1).\n* For bandwidth billed by the `TRAFFIC_POSTPAID_BY_HOUR` method, changing the bandwidth cap through this API takes effect in real time. Users can increase or reduce bandwidth within applicable limits." }, "StartInstances": { "params": [ { "name": "InstanceIds", "desc": "Instance ID(s). To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. The maximum number of instances in each request is 100." } ], "desc": "This API is used to start instances.\n\n* You can only perform this operation on instances whose status is `STOPPED`.\n* The instance status will become `STARTING` when the API is called successfully and `RUNNING` when the instance is successfully started.\n* Batch operations are supported. The maximum number of instances in each request is 100." }, "DescribeDisasterRecoverGroups": { "params": [ { "name": "DisasterRecoverGroupIds", "desc": "ID list of spread placement groups. You can operate up to 100 spread placement groups in each request." }, { "name": "Name", "desc": "Name of a spread placement group. Fuzzy match is supported." }, { "name": "Offset", "desc": "Offset; default value: 0. For more information on `Offset`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377)." }, { "name": "Limit", "desc": "Number of results returned; default value: 20; maximum: 100. For more information on `Limit`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377). " } ], "desc": "This API is used to query the information on [spread placement groups](https://intl.cloud.tencent.com/document/product/213/15486?from_cn_redirect=1)." }, "DescribeKeyPairs": { "params": [ { "name": "KeyIds", "desc": "Key pair ID(s) in the format of `skey-11112222`. This API supports using multiple IDs as filters at the same time. For more information on the format of this parameter, see the `id.N` section in [API Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1). You cannot specify `KeyIds` and `Filters` at the same time. You can log in to the [console](https://console.cloud.tencent.com/cvm/index) to query the key pair IDs." }, { "name": "Filters", "desc": "Filters.\n<li> `project-id` - Integer - Optional - Filter results by project ID. To view the list of project IDs, you can go to [Project Management](https://console.cloud.tencent.com/project), or call [DescribeProject](https://intl.cloud.tencent.com/document/api/378/4400?from_cn_redirect=1) and look for `projectId` in the response. </li>\n<li> `key-name` - String - Optional - Filter results by key pair name. </li> You cannot specify `KeyIds` and `Filters` at the same time." }, { "name": "Offset", "desc": "Offset; default value: 0. For more information on `Offset`, see the corresponding sections in API [Introduction](https://intl.cloud.tencent.com/document/product/377). Number of results returned; default value: 20; maximum: 100. For more information on `Limit`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377). " }, { "name": "Limit", "desc": "Number of results returned; default value: 20; maximum: 100. For more information on `Limit`, see the corresponding section in API [Introduction](https://intl.cloud.tencent.com/document/product/377). " } ], "desc": "This API is used to query key pairs.\n\n* A key pair is a pair of keys generated by an algorithm in which the public key is available to the public and the private key is available only to the user. You can use this API to query the public key but not the private key." }, "DescribeReservedInstancesOfferings": { "params": [ { "name": "DryRun", "desc": "Dry run. Default value: false." }, { "name": "Offset", "desc": "The offset. Default value: 0. For more information on `Offset`, see the relevant sections in API [Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1)." }, { "name": "Limit", "desc": "The number of returned results. Default value: 20. Maximum value: 100. For more information on `Limit`, see the relevant sections in API [Introduction](https://intl.cloud.tencent.com/document/api/213/15688?from_cn_redirect=1)." }, { "name": "MaxDuration", "desc": "The maximum duration as a filter, \nin seconds.\nDefault value: 94608000." }, { "name": "MinDuration", "desc": "The minimum duration as a filter, \nin seconds.\nDefault value: 2592000." }, { "name": "Filters", "desc": "<li><strong>zone</strong></li>\n<p style=\"padding-left: 30px;\">Filters by the <strong>availability zones</strong> in which the Reserved Instances can be purchased, such as ap-guangzhou-1.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: please see <a href=\"https://intl.cloud.tencent.com/document/product/213/6091?from_cn_redirect=1\">Availability Zones</a></p>\n<li><strong>duration</strong></li>\n<p style=\"padding-left: 30px;\">Filters by the <strong>duration</strong> of the Reserved Instance, in seconds. For example, 31536000.</p><p style=\"padding-left: 30px;\">Type: Integer</p><p style=\"padding-left: 30px;\">Unit: second</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: 31536000 (1 year) | 94608000 (3 years)</p>\n<li><strong>instance-type</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>type of the Reserved Instance</strong>, such as `S3.MEDIUM4`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: please see <a href=\"https://intl.cloud.tencent.com/document/product/213/11518?from_cn_redirect=1\">Instance Types</a></p>\n<li><strong>offering-type</strong></li>\n<p style=\"padding-left: 30px;\">Filters by **<strong>payment term</strong>**, such as `All Upfront`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid value: All Upfront</p>\n<li><strong>product-description</strong></li>\n<p style=\"padding-left: 30px;\">Filters by the <strong>platform description</strong> (operating system) of the Reserved Instance, such as `linux`.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid value: linux</p>\n<li><strong>reserved-instances-offering-id</strong></li>\n<p style=\"padding-left: 30px;\">Filters by <strong>Reserved Instance ID</strong>, in the form of 650c138f-ae7e-4750-952a-96841d6e9fc1.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p>\nEach request can have up to 10 `Filters` and 5 `Filter.Values`." } ], "desc": "This API is used to describe Reserved Instance offerings that are available for purchase." }, "DescribeHosts": { "params": [ { "name": "Filters", "desc": "<li><strong>zone</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>availability zones</strong>**. For example, availability zone: ap-guangzhou-1;</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: <a href=\"https://intl.cloud.tencent.com/document/product/213/6091?from_cn_redirect=1\">list of availability zones</a></p>\n<li><strong>project-id</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>project ID</strong>**. You can query the existing project list through the [DescribeProject](https://intl.cloud.tencent.com/document/api/378/4400?from_cn_redirect=1) API or [CVM console](https://console.cloud.tencent.com/cvm/index), or create a project by calling the [AddProject](https://intl.cloud.tencent.com/document/api/378/4398?from_cn_redirect=1) API. For example, project ID: 1002189;</p><p style=\"padding-left: 30px;\">Type: Integer</p><p style=\"padding-left: 30px;\">Required: no</p>\n<li><strong>host-id</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>[CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) ID</strong>**. For example, [CDH](https://intl.cloud.tencent.com/document/product/416?from_cn_redirect=1) ID: host-xxxxxxxx;</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p>\n<li><strong>state</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>CDH instance name</strong>**. </p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p>\n<li><strong>state</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>CDH instance status </strong>**. (PENDING: creating | LAUNCH_FAILURE: creation failed | RUNNING: running | EXPIRED: expired)</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p>\nEach request can have up to 10 `Filters` and 5 `Filters.Values`." }, { "name": "Offset", "desc": "Offset; default value: 0." }, { "name": "Limit", "desc": "Number of results returned; default value: 20; maximum: 100." } ], "desc": "This API is used to query the details of CDH instances." }, "ModifyDisasterRecoverGroupAttribute": { "params": [ { "name": "DisasterRecoverGroupId", "desc": "Spread placement group ID, which can be obtained by calling the [DescribeDisasterRecoverGroups](https://intl.cloud.tencent.com/document/api/213/17810?from_cn_redirect=1) API." }, { "name": "Name", "desc": "Name of a spread placement group. The name must be 1-60 characters long and can contain both Chinese characters and English letters." } ], "desc": "This API is used to modify the attributes of [spread placement groups](https://intl.cloud.tencent.com/document/product/213/15486?from_cn_redirect=1)." }, "DescribeInternetChargeTypeConfigs": { "params": [], "desc": "This API is used to query the network billing methods." }, "RebootInstances": { "params": [ { "name": "InstanceIds", "desc": "Instance IDs. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. You can operate up to 100 instances in each request." }, { "name": "ForceReboot", "desc": "Whether to force restart an instance after a normal restart fails. Valid values: <br><li>TRUE: force restart an instance after a normal restart fails <br><li>FALSE: do not force restart an instance after a normal restart fails <br><br>Default value: FALSE." }, { "name": "StopType", "desc": "Shutdown type. Valid values: <br><li>SOFT: soft shutdown<br><li>HARD: hard shutdown<br><li>SOFT_FIRST: perform a soft shutdown first, and perform a hard shutdown if the soft shutdown fails<br><br>Default value: SOFT." } ], "desc": "This API is used to restart instances.\n\n* You can only perform this operation on instances whose status is `RUNNING`.\n* If the API is called successfully, the instance status will become `REBOOTING`. After the instance is restarted, its status will become `RUNNING` again.\n* Forced restart is supported. A forced restart is similar to switching off the power of a physical computer and starting it again. It may cause data loss or file system corruption. Be sure to only force start a CVM when it cannot be restarted normally.\n* Batch operations are supported. The maximum number of instances in each request is 100." }, "DescribeInstanceTypeConfigs": { "params": [ { "name": "Filters", "desc": "<li><strong>zone</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>availability zones</strong>**. For example, availability zone: ap-guangzhou-1.</p><p style=\"padding-left: 30px;\">Type: String</p><p style=\"padding-left: 30px;\">Required: no</p><p style=\"padding-left: 30px;\">Valid values: <a href=\"https://intl.cloud.tencent.com/document/product/213/6091?from_cn_redirect=1\">list of availability zones</a></p>\n<li><strong>instance-family</strong></li>\n<p style=\"padding-left: 30px;\">Filter results by **<strong>instance models</strong>**. For example, instance models: S1, I1 and M1.</p><p style=\"padding-left: 30px;\">Type: Integer</p><p style=\"padding-left: 30px;\">Required: no</p>\nEach request can have up to 10 `Filters` and 1 `Filters.Values`." } ], "desc": "This API is used to query the model configuration of an instance.\n\n* You can filter the query results with `zone` or `instance-family`. For more information on filtering conditions, see [`Filter`](https://intl.cloud.tencent.com/document/api/213/15753?from_cn_redirect=1#Filter).\n* If no parameter is defined, the model configuration of all the instances in the specified region will be returned." }, "ModifyInstancesProject": { "params": [ { "name": "InstanceIds", "desc": "Instance IDs. To obtain the instance IDs, you can call [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) and look for `InstanceId` in the response. You can operate up to 100 instances in each request." }, { "name": "ProjectId", "desc": "Project ID. You can create a project by using the [AddProject](https://intl.cloud.tencent.com/doc/api/403/4398?from_cn_redirect=1) API and obtain its ID from the response parameter `projectId` of the [`DescribeProject`](https://intl.cloud.tencent.com/document/product/378/4400?from_cn_redirect=1) API. Subsequently, the project ID can be used to filter results when you query instances by calling the [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) API." } ], "desc": "This API is used to change the project to which an instance belongs.\n\n* Project is a virtual concept. You can create multiple projects under one account, manage different resources in each project, and assign different instances to different projects. You may use the [`DescribeInstances`](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1) API to query instances and use the project ID to filter results.\n* You cannot modify the project of an instance that is bound to a load balancer. You need to firstly unbind the load balancer from the instance by using the [`DeregisterInstancesFromLoadBalancer`](https://intl.cloud.tencent.com/document/api/214/1258?from_cn_redirect=1) API.\n[^_^]: # (If you modify the project of an instance, security groups associated with the instance will be automatically disassociated. You can use the [`ModifyInstancesAttribute`](https://intl.cloud.tencent.com/document/api/213/15739?from_cn_redirect=1) API to associate the instance with the security groups again.\n* Batch operations are supported. You can operate up to 100 instances in each request.\n* You can call the [DescribeInstances](https://intl.cloud.tencent.com/document/api/213/15728?from_cn_redirect=1#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) API and find the result of the operation in the response parameter `LatestOperationState`. If the value is `SUCCESS`, the operation is successful." }, "DisassociateSecurityGroups": { "params": [ { "name": "SecurityGroupIds", "desc": "ID of the security group to be disassociated, such as `sg-efil73jd`. Only one security group can be disassociated." }, { "name": "InstanceIds", "desc": "ID(s) of the instance(s) to be disassociated,such as `ins-lesecurk`. You can specify multiple instances." } ], "desc": "This API is used to disassociate security groups from instances." }, "AllocateHosts": { "params": [ { "name": "Placement", "desc": "Instance location. This parameter is used to specify the attributes of an instance, such as its availability zone and project." }, { "name": "ClientToken", "desc": "A string used to ensure the idempotency of the request." }, { "name": "HostChargePrepaid", "desc": "Configuration of prepaid instances. You can use the parameter to specify the attributes of prepaid instances, such as the subscription period and the auto-renewal plan. This parameter is required for prepaid instances." }, { "name": "HostChargeType", "desc": "Instance billing model, only monthly or yearly subscription supported. Default value: `PREPAID'." }, { "name": "HostType", "desc": "CDH instance model. Default value: `HS1`." }, { "name": "HostCount", "desc": "Quantity of CDH instances purchased. Default value: 1." }, { "name": "TagSpecification", "desc": "Tag description. You can specify the parameter to associate a tag with an instance." } ], "desc": "This API is used to create CDH instances with specified configuration.\n* When HostChargeType is PREPAID, the HostChargePrepaid parameter must be specified." }, "DescribeSpotTypeConfig": { "params": [], "desc": "This API is used to query spot instances that are available for purchase." } }
92.842105
3,182
0.69996
15,389
104,076
4.709013
0.068426
0.028813
0.036016
0.043468
0.742034
0.715264
0.68979
0.674735
0.650958
0.630922
0
0.024552
0.18326
104,076
1,121
3,183
92.842105
0.827971
0.000202
0
0.310714
0
0.219643
0.859746
0.042516
0
0
0
0
0
1
0
false
0.015179
0.010714
0
0.010714
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
cfc0676def4f5f1f77791e1d6222a6afd3875595
146
py
Python
Ex021-Tocando_um_mp3.py
Diego-Sil/Python_do_Curso_em_Video
31b1f059a139212d5f53c4c32038939a9d6d178b
[ "MIT" ]
null
null
null
Ex021-Tocando_um_mp3.py
Diego-Sil/Python_do_Curso_em_Video
31b1f059a139212d5f53c4c32038939a9d6d178b
[ "MIT" ]
null
null
null
Ex021-Tocando_um_mp3.py
Diego-Sil/Python_do_Curso_em_Video
31b1f059a139212d5f53c4c32038939a9d6d178b
[ "MIT" ]
null
null
null
import pygame pygame.mixer.init() pygame.init() pygame.mixer.music.load('asus-yamete-kudasai.mp3') pygame.mixer.music.play() pygame.event.wait()
18.25
50
0.767123
22
146
5.090909
0.590909
0.294643
0.285714
0
0
0
0
0
0
0
0
0.007246
0.054795
146
7
51
20.857143
0.804348
0
0
0
0
0
0.158621
0.158621
0
0
0
0
0
1
0
true
0
0.166667
0
0.166667
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
1
0
0
0
0
0
0
5
cfc5dd7d0a6b752c635de51c2d66e4d60f7090b0
2,042
py
Python
tests/rule_model_test.py
biggorilla-gh/frameit
9cae56b4089fff6c955f8b86c699aa402a1390ac
[ "Apache-2.0" ]
3
2018-12-29T01:10:37.000Z
2020-06-12T09:45:11.000Z
tests/rule_model_test.py
biggorilla-gh/frameit
9cae56b4089fff6c955f8b86c699aa402a1390ac
[ "Apache-2.0" ]
null
null
null
tests/rule_model_test.py
biggorilla-gh/frameit
9cae56b4089fff6c955f8b86c699aa402a1390ac
[ "Apache-2.0" ]
null
null
null
import unittest from frameit.models.rule_model import RuleModel class RuleModelTest(unittest.TestCase): def test_extract(self): model = RuleModel('test') model.add_rule('around * today') model.add_pattern('\d{1,2}') doc = model.nlp('I will be arriving around 3 today') extracted = model.extract(doc) self.assertEqual(len(extracted), 1) pred = model.predict([doc[5]]) self.assertEqual(pred[0][1], 1.0) def test_predict(self): model = RuleModel('test') model.add_rule('around * today') model.add_pattern('\d{1,2}') doc = model.nlp('I will be arriving around 3 today') pred = model.predict([doc[5]]) self.assertEqual(pred[0][1], 1.0) def test_predict_multiple_tokens(self): model = RuleModel('test') model.add_rule('around * * today') model.add_pattern('\d{1,2} [ap]m') doc = model.nlp('I will be arriving around 3 pm today') for i in range(len(doc)): pred = model.predict([doc[i]]) self.assertEqual(pred[0][1], 1.0 if i in [5, 6] else 0.0) def test_get_state(self): model = RuleModel('test') model.add_rule('around * * today') model.add_pattern('\d{1,2} [ap]m') self.assertEqual(model.get_state(), {'name': 'test_rule_attr', 'lang': 'en', 'rules': ['around * * today'], 'patterns': ['\d{1,2} [ap]m']}) def test_set_state(self): model = RuleModel() model.set_state({'name': 'test_rule_attr', 'rules': ['around * * today'], 'patterns': ['\d{1,2} [ap]m']}) doc = model.nlp('I will be arriving around 3 pm today') for i in range(len(doc)): pred = model.predict([doc[i]]) self.assertEqual(pred[0][1], 1.0 if i in [5, 6] else 0.0)
37.814815
76
0.516161
262
2,042
3.931298
0.21374
0.062136
0.017476
0.085437
0.753398
0.712621
0.712621
0.712621
0.712621
0.660194
0
0.031571
0.333007
2,042
53
77
38.528302
0.72467
0
0
0.681818
0
0
0.186092
0
0
0
0
0
0.136364
1
0.113636
false
0
0.045455
0
0.181818
0
0
0
0
null
0
0
0
0
1
1
1
1
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
5
cfd13369de6023053104c10354eae0f15d3d8daf
162
py
Python
contrib/node/src/python/pants/contrib/node/targets/node_thrift_library.py
itsmesatwik/pants
4f3f45ab911d5ccc1d1d90c523959588e940dc8e
[ "Apache-2.0" ]
null
null
null
contrib/node/src/python/pants/contrib/node/targets/node_thrift_library.py
itsmesatwik/pants
4f3f45ab911d5ccc1d1d90c523959588e940dc8e
[ "Apache-2.0" ]
null
null
null
contrib/node/src/python/pants/contrib/node/targets/node_thrift_library.py
itsmesatwik/pants
4f3f45ab911d5ccc1d1d90c523959588e940dc8e
[ "Apache-2.0" ]
null
null
null
from pants.contrib.node.targets.node_module import NodeModule class NodeThriftLibrary(NodeModule): """ A Node library generated from Thrift IDL Files """
20.25
61
0.771605
20
162
6.2
0.8
0
0
0
0
0
0
0
0
0
0
0
0.148148
162
7
62
23.142857
0.898551
0.283951
0
0
1
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
cfd53cc3519346947fdfe3260ba0d219f18db206
103
py
Python
tests/measures/sample/__init__.py
tandriamil/BrFAST
b687a356acc813d45dbaf5b5eb0f360df181904a
[ "MIT" ]
6
2021-04-20T17:33:17.000Z
2021-12-20T18:59:58.000Z
tests/measures/sample/__init__.py
tandriamil/BrFAST
b687a356acc813d45dbaf5b5eb0f360df181904a
[ "MIT" ]
null
null
null
tests/measures/sample/__init__.py
tandriamil/BrFAST
b687a356acc813d45dbaf5b5eb0f360df181904a
[ "MIT" ]
2
2021-12-20T19:00:03.000Z
2022-03-22T01:57:41.000Z
#!/usr/bin/python3 """Init file of the tests.measures.sample module.""" import brfast.measures.sample
20.6
52
0.747573
15
103
5.133333
0.866667
0.363636
0
0
0
0
0
0
0
0
0
0.010753
0.097087
103
4
53
25.75
0.817204
0.621359
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
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
1
0
1
0
0
0
0
5
cff26d92fc4e060fc7732908116e5432044c1217
142
py
Python
alarm-clock/__main__.py
TeenageMutantCoder/Alarm-Clock
88adf1920354f34b2e8131233617bcd84272e9ed
[ "MIT" ]
1
2020-11-28T11:37:42.000Z
2020-11-28T11:37:42.000Z
alarm-clock/__main__.py
TeenageMutantCoder/Alarm-Clock
88adf1920354f34b2e8131233617bcd84272e9ed
[ "MIT" ]
2
2022-01-13T02:26:58.000Z
2022-03-12T00:21:38.000Z
alarm-clock/__main__.py
TeenageMutantCoder/Alarm-Clock
88adf1920354f34b2e8131233617bcd84272e9ed
[ "MIT" ]
2
2020-07-15T10:53:17.000Z
2022-03-23T18:11:28.000Z
try: from app import App except ImportError: from .app import App if __name__ == "__main__": app = App(600, 185) app.start()
15.777778
26
0.633803
20
142
4.1
0.6
0.170732
0.317073
0.390244
0
0
0
0
0
0
0
0.057143
0.260563
142
9
27
15.777778
0.72381
0
0
0
0
0
0.055944
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
cff7f2243df4b2c407e88fa346cf8b19cb5ce7e2
226
py
Python
Print/printBs.py
MooersLab/jupyterlabpymolpysnipsplus
b886750d63372434df53d4d6d7cdad6cb02ae4e7
[ "MIT" ]
null
null
null
Print/printBs.py
MooersLab/jupyterlabpymolpysnipsplus
b886750d63372434df53d4d6d7cdad6cb02ae4e7
[ "MIT" ]
null
null
null
Print/printBs.py
MooersLab/jupyterlabpymolpysnipsplus
b886750d63372434df53d4d6d7cdad6cb02ae4e7
[ "MIT" ]
null
null
null
# Description: Print the B-factors of a residue. # Source: placeHolder """ cmd.do('remove element h; iterate resi ${1: 1:13}, print(resi, name,b);') """ cmd.do('remove element h; iterate resi 1:13, print(resi, name,b);')
25.111111
73
0.659292
37
226
4.027027
0.540541
0.067114
0.147651
0.241611
0.637584
0.637584
0.416107
0.416107
0
0
0
0.036649
0.154867
226
8
74
28.25
0.743456
0.632743
0
0
0
0
0.783784
0
0
0
0
0
0
1
0
true
0
0
0
0
1
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
1
0
5
5c5406afb3f563a3a36c41b8a7752867b9adc933
42
py
Python
doctest_travis/__init__.py
ofosos/doctest-travis
107c3344077cb3d6aca9c4849fc0a88abc7628f4
[ "MIT" ]
null
null
null
doctest_travis/__init__.py
ofosos/doctest-travis
107c3344077cb3d6aca9c4849fc0a88abc7628f4
[ "MIT" ]
null
null
null
doctest_travis/__init__.py
ofosos/doctest-travis
107c3344077cb3d6aca9c4849fc0a88abc7628f4
[ "MIT" ]
null
null
null
from .code import stupid_sum, stupid_mul
14
40
0.809524
7
42
4.571429
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.142857
42
2
41
21
0.888889
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
5ca2765c895bdce73bae90bf8b6ea6cc70b06557
56
py
Python
python/kyu7/ProductIDfromURL.py
Enestst/codewars
f8edffa7439a035109b1c56304a958516ade1a08
[ "MIT" ]
null
null
null
python/kyu7/ProductIDfromURL.py
Enestst/codewars
f8edffa7439a035109b1c56304a958516ade1a08
[ "MIT" ]
null
null
null
python/kyu7/ProductIDfromURL.py
Enestst/codewars
f8edffa7439a035109b1c56304a958516ade1a08
[ "MIT" ]
null
null
null
def get_product_id(url): return url.split('-')[-2]
18.666667
29
0.625
9
56
3.666667
0.888889
0
0
0
0
0
0
0
0
0
0
0.021277
0.160714
56
2
30
28
0.680851
0
0
0
0
0
0.017857
0
0
0
0
0
0
1
0.5
false
0
0
0.5
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
5cd44ed03b2fe0e2bcadf34f4c8ba90783f36509
80
py
Python
pyldb/__init__.py
jwg4/pyldl
439e9853d22ce8fa358023aa6c4bf3030b831774
[ "MIT" ]
null
null
null
pyldb/__init__.py
jwg4/pyldl
439e9853d22ce8fa358023aa6c4bf3030b831774
[ "MIT" ]
2
2019-07-08T20:42:26.000Z
2019-07-13T07:49:13.000Z
pyldb/__init__.py
jwg4/pyldl
439e9853d22ce8fa358023aa6c4bf3030b831774
[ "MIT" ]
1
2020-09-04T23:06:17.000Z
2020-09-04T23:06:17.000Z
# flake8: noqa from .render import render_board from .retrieve import get_board
20
32
0.8125
12
80
5.25
0.666667
0
0
0
0
0
0
0
0
0
0
0.014493
0.1375
80
3
33
26.666667
0.898551
0.15
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
1
0
0
5
7a4c76fb35e12619e8c96b6943ed239c9cf57315
112
py
Python
rl_starterpack/agents/__init__.py
RL-Starterpack/rl-starterpack
af61d08eb00b0c960b103eb469a73ba2f47b9990
[ "MIT" ]
25
2020-11-23T15:26:04.000Z
2021-07-21T09:24:16.000Z
rl_starterpack/agents/__init__.py
RL-Starterpack/rl-starterpack
af61d08eb00b0c960b103eb469a73ba2f47b9990
[ "MIT" ]
null
null
null
rl_starterpack/agents/__init__.py
RL-Starterpack/rl-starterpack
af61d08eb00b0c960b103eb469a73ba2f47b9990
[ "MIT" ]
9
2021-03-28T07:45:48.000Z
2022-03-22T12:43:10.000Z
from .ac import AC from .dqn import DQN from .pg import PG from .random import RandomAgent from .tql import TQL
18.666667
31
0.776786
20
112
4.35
0.4
0
0
0
0
0
0
0
0
0
0
0
0.178571
112
5
32
22.4
0.945652
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
1
0
0
5
7a559585b40e58f8af5463494fba885bb67d5b2d
1,146
py
Python
test/test_jpiarea.py
liujb/python-geohash
aa5e18dbbf887140d77a33d84d2f07d126d47ba4
[ "Unlicense", "Apache-2.0", "MIT" ]
284
2015-03-16T08:39:44.000Z
2022-03-24T12:21:22.000Z
test/test_jpiarea.py
ynb007/python-geohash
f5d105fb140ab6a1d80b85a134f834cf9c2e2390
[ "MIT", "Apache-2.0", "Unlicense" ]
20
2015-03-16T02:57:58.000Z
2021-06-24T18:13:38.000Z
test/test_jpiarea.py
ynb007/python-geohash
f5d105fb140ab6a1d80b85a134f834cf9c2e2390
[ "MIT", "Apache-2.0", "Unlicense" ]
104
2015-03-16T08:26:39.000Z
2021-12-17T14:26:21.000Z
# coding: UTF-8 import unittest import jpiarea def dms(d,m,s): return float(d) + (float(m) + float(s)/60)/60.0 class TestReference(unittest.TestCase): # hash code examples from open iarea document # http://www.nttdocomo.co.jp/service/imode/make/content/iarea/domestic/index.html def test_lv1(self): self.assertEqual("5438", jpiarea.encode(36,138)[0:4]) self.assertEqual("5637", jpiarea.encode(dms(37,20,0),137)[0:4]) def test_lv2(self): p = jpiarea.bbox("533946") self.assertAlmostEqual(503100000, p["s"]*3600*1000) self.assertAlmostEqual(503550000, p["n"]*3600*1000) self.assertAlmostEqual(128400000, p["w"]*3600*1000) self.assertAlmostEqual(128700000, p["e"]*3600*1000) def test_lv3(self): p = jpiarea.bbox("5339463") self.assertAlmostEqual(503325000, p["s"]*3600*1000) self.assertAlmostEqual(503550000, p["n"]*3600*1000) self.assertAlmostEqual(128550000, p["w"]*3600*1000) self.assertAlmostEqual(128700000, p["e"]*3600*1000) def test_lvN(self): self.assertEqual("53394600300",jpiarea.encode(dms(35,40,41), dms(139,46,9.527))) if __name__=='__main__': unittest.main()
33.705882
83
0.699825
166
1,146
4.759036
0.481928
0.212658
0.091139
0.220253
0.324051
0.324051
0.324051
0.324051
0.324051
0.324051
0
0.208167
0.123909
1,146
33
84
34.727273
0.578685
0.119546
0
0.166667
0
0
0.049383
0
0
0
0
0
0.458333
1
0.208333
false
0
0.083333
0.041667
0.375
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
1
0
0
0
0
0
0
0
5
7a69f3340bd2c7a34834a01da0ae6f8be1dde37c
182
py
Python
src/model/calculation.py
ChinonsoChima/IS_218_Stats_Calc
8f494b5ac288d4cdc55ffd2cb2eb1a1707889aee
[ "MIT" ]
null
null
null
src/model/calculation.py
ChinonsoChima/IS_218_Stats_Calc
8f494b5ac288d4cdc55ffd2cb2eb1a1707889aee
[ "MIT" ]
null
null
null
src/model/calculation.py
ChinonsoChima/IS_218_Stats_Calc
8f494b5ac288d4cdc55ffd2cb2eb1a1707889aee
[ "MIT" ]
null
null
null
class Calculation: def __init__(cls, a, b, op): cls.a = float(a) cls.b = float(b) cls.op = op def getResult(cls): return cls.op(cls.a, cls.b)
22.75
35
0.521978
29
182
3.137931
0.37931
0.131868
0.131868
0
0
0
0
0
0
0
0
0
0.335165
182
8
35
22.75
0.752066
0
0
0
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0
0.142857
0.571429
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
1
0
0
5
7a6e01293e5d018e13313ddb7457041acf654865
40
py
Python
examples/walk/__init__.py
gameduell/simcompyl
d54b7fe297cfb843c1c36b52a3b1fee449d04e6e
[ "MIT" ]
3
2019-05-29T12:28:37.000Z
2019-06-24T07:19:06.000Z
examples/walk/__init__.py
gameduell/simcompyl
d54b7fe297cfb843c1c36b52a3b1fee449d04e6e
[ "MIT" ]
3
2019-05-13T06:00:30.000Z
2019-09-30T14:19:33.000Z
examples/walk/__init__.py
gameduell/simcompyl
d54b7fe297cfb843c1c36b52a3b1fee449d04e6e
[ "MIT" ]
null
null
null
"""A random walk example simulation."""
20
39
0.7
5
40
5.6
1
0
0
0
0
0
0
0
0
0
0
0
0.125
40
1
40
40
0.8
0.825
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
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
5
7aa11f2ba928d550bdaa39d0fef504d270cfa17f
428
py
Python
rest_registration/signers/register_email.py
psibean/django-rest-registration
15f720ab3aa040775d97a2b337c98e4833d0268d
[ "MIT" ]
329
2018-05-09T13:10:37.000Z
2022-03-25T11:05:20.000Z
rest_registration/signers/register_email.py
psibean/django-rest-registration
15f720ab3aa040775d97a2b337c98e4833d0268d
[ "MIT" ]
167
2018-04-21T00:28:17.000Z
2022-03-30T09:24:52.000Z
rest_registration/signers/register_email.py
psibean/django-rest-registration
15f720ab3aa040775d97a2b337c98e4833d0268d
[ "MIT" ]
97
2018-05-09T14:17:59.000Z
2022-02-23T08:46:30.000Z
from rest_registration.settings import registration_settings from rest_registration.utils.signers import URLParamsSigner class RegisterEmailSigner(URLParamsSigner): SALT_BASE = 'register-email' USE_TIMESTAMP = True def get_base_url(self): return registration_settings.REGISTER_EMAIL_VERIFICATION_URL def get_valid_period(self): return registration_settings.REGISTER_EMAIL_VERIFICATION_PERIOD
30.571429
71
0.815421
48
428
6.916667
0.520833
0.240964
0.120482
0.180723
0.331325
0.331325
0.331325
0
0
0
0
0
0.140187
428
13
72
32.923077
0.902174
0
0
0
0
0
0.03271
0
0
0
0
0
0
1
0.222222
false
0
0.222222
0.222222
1
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
7ac2628980688c54b34796c4a79f0aa558cdf27b
25
py
Python
dj_pagination/tests/__init__.py
sampaccoud/dj-pagination
f6d968897feda4d47282922b99fb80296b4f9e30
[ "BSD-3-Clause" ]
88
2016-08-16T20:37:31.000Z
2021-11-09T11:06:18.000Z
dj_pagination/tests/__init__.py
sampaccoud/dj-pagination
f6d968897feda4d47282922b99fb80296b4f9e30
[ "BSD-3-Clause" ]
29
2016-09-27T11:18:48.000Z
2020-11-12T13:59:58.000Z
dj_pagination/tests/__init__.py
sampaccoud/dj-pagination
f6d968897feda4d47282922b99fb80296b4f9e30
[ "BSD-3-Clause" ]
37
2016-09-05T14:22:31.000Z
2020-11-12T13:03:00.000Z
from .test_main import *
12.5
24
0.76
4
25
4.5
1
0
0
0
0
0
0
0
0
0
0
0
0.16
25
1
25
25
0.857143
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8fa94a52be25ae24c442a879e917b0b4b402799a
160
py
Python
src/pycaenhv/config/__init__.py
vasoto/pycaenhv
387da8b95182a56cf3f26bf60fc499841d3b368b
[ "MIT" ]
null
null
null
src/pycaenhv/config/__init__.py
vasoto/pycaenhv
387da8b95182a56cf3f26bf60fc499841d3b368b
[ "MIT" ]
2
2021-08-03T13:48:54.000Z
2021-08-04T16:42:38.000Z
src/pycaenhv/config/__init__.py
vasoto/pycaenhv
387da8b95182a56cf3f26bf60fc499841d3b368b
[ "MIT" ]
1
2021-06-29T13:52:23.000Z
2021-06-29T13:52:23.000Z
from .enitites import Channel, Channels, HVBase, Config from ._toml import read_toml_config from .configurator import ChannelConfigurator from ._cli import main
40
55
0.84375
21
160
6.238095
0.619048
0.152672
0
0
0
0
0
0
0
0
0
0
0.1125
160
4
56
40
0.922535
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
1
0
0
5
890b6ca63ba5f0736693ac13a376817e88cdd3e8
26
py
Python
normalizer/__init__.py
TCC-ADS-2020/Normalizador
f0a013de91ac0aa8c1f20ccbd11f6ec353778de8
[ "MIT" ]
7
2020-07-07T10:27:02.000Z
2021-04-02T13:20:24.000Z
normalizer/__init__.py
TCC-ADS-2020/Normalizador
f0a013de91ac0aa8c1f20ccbd11f6ec353778de8
[ "MIT" ]
3
2020-03-31T09:35:53.000Z
2021-08-23T20:46:33.000Z
normalizer/__init__.py
TCC-ADS-2020/Normalizador
f0a013de91ac0aa8c1f20ccbd11f6ec353778de8
[ "MIT" ]
3
2020-08-31T10:21:21.000Z
2021-12-01T11:38:17.000Z
from .normalizer import *
13
25
0.769231
3
26
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.153846
26
1
26
26
0.909091
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
8917eef7ae165ec80c1de5a491dd33007d9fef04
30
py
Python
new.py
zhouliang666/py18
33ccbaf5cd8705bc28858ee0bee37bd73a72b8ff
[ "MIT" ]
null
null
null
new.py
zhouliang666/py18
33ccbaf5cd8705bc28858ee0bee37bd73a72b8ff
[ "MIT" ]
null
null
null
new.py
zhouliang666/py18
33ccbaf5cd8705bc28858ee0bee37bd73a72b8ff
[ "MIT" ]
null
null
null
new1 = 10 new2 = 20 new3 = 30
7.5
9
0.6
6
30
3
1
0
0
0
0
0
0
0
0
0
0
0.428571
0.3
30
3
10
10
0.428571
0
0
0
0
0
0
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
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
5
8f1f41290a2e6a9844e10210c5ea0698bfc59530
155
py
Python
shovel/readme.py
RazerM/odmpy
ab44bfaef27448119d0557e63c219e6a6b1be51f
[ "MIT" ]
2
2015-03-18T15:32:37.000Z
2019-04-25T22:13:43.000Z
shovel/readme.py
RazerM/odmpy
ab44bfaef27448119d0557e63c219e6a6b1be51f
[ "MIT" ]
null
null
null
shovel/readme.py
RazerM/odmpy
ab44bfaef27448119d0557e63c219e6a6b1be51f
[ "MIT" ]
2
2019-08-01T19:48:02.000Z
2020-04-17T22:06:10.000Z
from shovel import task import subprocess @task def rst(): subprocess.call(['pandoc', '--from=markdown', '--to=rst', '--output=README', 'README.md'])
22.142857
94
0.664516
20
155
5.15
0.7
0
0
0
0
0
0
0
0
0
0
0
0.122581
155
6
95
25.833333
0.757353
0
0
0
0
0
0.341935
0
0
0
0
0
0
1
0.2
true
0
0.4
0
0.6
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
1
0
0
5
8f3d30b0540826df625f7bf910a6f245a459fdd7
50
py
Python
wagtail/core/blocks/static_block.py
stevedya/wagtail
52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c
[ "BSD-3-Clause" ]
1
2022-02-09T05:25:30.000Z
2022-02-09T05:25:30.000Z
wagtail/core/blocks/static_block.py
stevedya/wagtail
52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c
[ "BSD-3-Clause" ]
null
null
null
wagtail/core/blocks/static_block.py
stevedya/wagtail
52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c
[ "BSD-3-Clause" ]
null
null
null
from wagtail.blocks.static_block import * # NOQA
25
49
0.78
7
50
5.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.14
50
1
50
50
0.883721
0.08
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
1
0
0
5
8f6881a44b7956453933a73714c5c25e81cd3f33
191
py
Python
web_scraper/__init__.py
praeducer/lambda-scrape-by-url
9263d85cfa5eeeee00e5797df864c1356de90fc6
[ "Apache-2.0" ]
1
2021-07-19T22:15:29.000Z
2021-07-19T22:15:29.000Z
web_scraper/__init__.py
praeducer/lambda-scrape-by-url
9263d85cfa5eeeee00e5797df864c1356de90fc6
[ "Apache-2.0" ]
null
null
null
web_scraper/__init__.py
praeducer/lambda-scrape-by-url
9263d85cfa5eeeee00e5797df864c1356de90fc6
[ "Apache-2.0" ]
null
null
null
from .scrape_by_url import scrape_by_url from .crawl_by_url import crawl_by_url from .crawl_by_keyword import crawl_by_keyword __all__ = ["scrape_by_url", "crawl_by_url", "crawl_by_keyword"]
38.2
63
0.837696
34
191
4.058824
0.235294
0.217391
0.23913
0.202899
0.231884
0
0
0
0
0
0
0
0.089005
191
5
63
38.2
0.793103
0
0
0
0
0
0.213542
0
0
0
0
0
0
1
0
false
0
0.75
0
0.75
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
1
0
0
0
0
5
8f752a99b3993824eca1528f20ca2de771a1951d
1,008
py
Python
lib/solutions/CHK/tests/test_checkout_solution.py
DPNT-Sourcecode/CHK-fhpr01
0c0cd73488923900ed7a5df469ad9e31a4a7eb9e
[ "Apache-2.0" ]
null
null
null
lib/solutions/CHK/tests/test_checkout_solution.py
DPNT-Sourcecode/CHK-fhpr01
0c0cd73488923900ed7a5df469ad9e31a4a7eb9e
[ "Apache-2.0" ]
null
null
null
lib/solutions/CHK/tests/test_checkout_solution.py
DPNT-Sourcecode/CHK-fhpr01
0c0cd73488923900ed7a5df469ad9e31a4a7eb9e
[ "Apache-2.0" ]
null
null
null
from ..checkout_solution import checkout class TestCheckout(): def test_illegal_val(self): assert checkout(256) == -1 def test_illegal_string(self): assert checkout('-') == -1 def test_return_val(self): """ Test return value """ assert checkout("AA") == 100 def test_return_val_with_diffrent_items(self): assert checkout("ABC") == 100 def test_multi_items_of_the_same_type(self): assert checkout("ABA") == 130 def test_multi_itmes_offer(self): assert checkout("AABA") == 160 def test_multiple_multi_items_offers(self): assert checkout("AABAAAA") == 280 def test_multiple_multi_items_offers(self): assert checkout("AABAAAAAA") == 360 def test_multiple_multi_items_offers(self): assert checkout("EEEEBB") == 160 def test_multipe_type_B_values(self): assert checkout("BB") == 45 def check_single_item_value(self): assert checkout("E") == 40
24
50
0.644841
125
1,008
4.88
0.408
0.252459
0.295082
0.098361
0.240984
0.240984
0.240984
0.240984
0.240984
0
0
0.039422
0.24504
1,008
41
51
24.585366
0.762155
0.016865
0
0.125
0
0
0.039337
0
0
0
0
0
0.458333
1
0.458333
false
0
0.041667
0
0.541667
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
1
0
1
0
0
0
0
1
0
0
5
56e241d8a3cf47c4d8882dd46ae435ee7d432218
206
py
Python
lbdrabbit/const.py
MacHu-GWU/lbdrabbit-project
e808f116bc85d95f3d545e085bede56df41b6d92
[ "MIT" ]
null
null
null
lbdrabbit/const.py
MacHu-GWU/lbdrabbit-project
e808f116bc85d95f3d545e085bede56df41b6d92
[ "MIT" ]
null
null
null
lbdrabbit/const.py
MacHu-GWU/lbdrabbit-project
e808f116bc85d95f3d545e085bede56df41b6d92
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from .apigw import HttpMethod DEFAULT_LBD_HANDLER_FUNC_NAME = "handler" VALID_LBD_HANDLER_FUNC_NAME_LIST = HttpMethod.get_all_valid_func_name() + [DEFAULT_LBD_HANDLER_FUNC_NAME, ]
29.428571
107
0.800971
30
206
4.933333
0.533333
0.216216
0.283784
0.364865
0.337838
0
0
0
0
0
0
0.005376
0.097087
206
6
108
34.333333
0.790323
0.101942
0
0
0
0
0.038251
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
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
1
0
0
0
0
5
71254810acfa22f1bddbd0a0025b73550f6da461
1,113
py
Python
sched_slack_bot/model/reminder.py
Germandrummer92/SchedSlackBot
d211f7c0d78eb8ebbc1f22cc186c94fc61bad491
[ "MIT" ]
null
null
null
sched_slack_bot/model/reminder.py
Germandrummer92/SchedSlackBot
d211f7c0d78eb8ebbc1f22cc186c94fc61bad491
[ "MIT" ]
null
null
null
sched_slack_bot/model/reminder.py
Germandrummer92/SchedSlackBot
d211f7c0d78eb8ebbc1f22cc186c94fc61bad491
[ "MIT" ]
null
null
null
from typing import Any from sched_slack_bot.model.schedule import Schedule class Reminder: def __init__(self, schedule: Schedule): self._schedule = schedule @property def schedule_id(self) -> str: return self._schedule.id @property def channel_id_to_notify_in(self) -> str: return self._schedule.channel_id_to_notify_in @property def user_id_to_notify(self) -> str: return self._schedule.members[self._schedule.current_index] @property def display_name(self) -> str: return self._schedule.display_name @property def next_next_rotation_date(self) -> str: return self._schedule.next_next_rotation_date.strftime("%Y-%m-%d-%H:%M:00") @property def next_rotation_user(self) -> str: return self._schedule.members[self._schedule.next_index] @property def next_schedule(self) -> Schedule: return self._schedule.next_schedule def __eq__(self, other: Any) -> bool: if not isinstance(other, Reminder): return False return self._schedule == other._schedule
25.883721
83
0.681941
142
1,113
5.007042
0.309859
0.219409
0.202532
0.14346
0.317862
0.123769
0.123769
0.123769
0
0
0
0.002318
0.224618
1,113
42
84
26.5
0.821553
0
0
0.233333
0
0
0.015274
0
0
0
0
0
0
1
0.3
false
0
0.066667
0.233333
0.7
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
8542385b958d9e05d1872db62c430d3630faf910
468
py
Python
musicript/timemodifiers.py
Mygod/Musicript
7e642fc206a959dd218d5d309a1d167e582a51d9
[ "Apache-2.0" ]
1
2019-12-17T15:12:21.000Z
2019-12-17T15:12:21.000Z
musicript/timemodifiers.py
Mygod/Musicript
7e642fc206a959dd218d5d309a1d167e582a51d9
[ "Apache-2.0" ]
null
null
null
musicript/timemodifiers.py
Mygod/Musicript
7e642fc206a959dd218d5d309a1d167e582a51d9
[ "Apache-2.0" ]
null
null
null
import math from abc import ABC, abstractmethod class TimeModifier(ABC): @abstractmethod def sample(self, time): pass class ConstantTimeModifier(TimeModifier): def sample(self, time): return 0 class Vibrato(TimeModifier): def __init__(self, amplitude=10, frequency=10): self.w = 2 * math.pi * frequency self.c = amplitude / self.w def sample(self, time): return (1 - math.cos(self.w * time)) * self.c
20.347826
53
0.645299
59
468
5.050847
0.440678
0.090604
0.130872
0.171141
0.154362
0
0
0
0
0
0
0.019943
0.25
468
22
54
21.272727
0.82906
0
0
0.2
0
0
0
0
0
0
0
0
0
1
0.266667
false
0.066667
0.133333
0.133333
0.733333
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
1
0
1
1
0
0
5
856def55c55d80ea0f0c3b05e2b328114135977d
123
py
Python
marcottievents/etl/base/__init__.py
soccermetrics/marcotti-events
759f3a4ee130fa155fd48e216ef6197a69ee2a33
[ "MIT" ]
22
2015-12-14T20:38:32.000Z
2020-12-26T07:40:26.000Z
marcottievents/etl/base/__init__.py
soccermetrics/marcotti-events
759f3a4ee130fa155fd48e216ef6197a69ee2a33
[ "MIT" ]
null
null
null
marcottievents/etl/base/__init__.py
soccermetrics/marcotti-events
759f3a4ee130fa155fd48e216ef6197a69ee2a33
[ "MIT" ]
6
2015-12-20T05:08:57.000Z
2020-06-28T23:57:31.000Z
from .workflows import ETL from .load import MarcottiLoad from .transform import MarcottiTransform, MarcottiEventTransform
30.75
64
0.861789
13
123
8.153846
0.692308
0
0
0
0
0
0
0
0
0
0
0
0.105691
123
3
65
41
0.963636
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
1
0
0
5
85a95787c30ac793ec7c1c9fe1ef9729829840be
395
py
Python
unit_tests/test_generate_random_room_event.py
RozanovN/PythonTextBasedAdventureGame
175f154c2c1e697bf9bf9ffcf82c820e2b17ecbd
[ "MIT", "Unlicense" ]
null
null
null
unit_tests/test_generate_random_room_event.py
RozanovN/PythonTextBasedAdventureGame
175f154c2c1e697bf9bf9ffcf82c820e2b17ecbd
[ "MIT", "Unlicense" ]
null
null
null
unit_tests/test_generate_random_room_event.py
RozanovN/PythonTextBasedAdventureGame
175f154c2c1e697bf9bf9ffcf82c820e2b17ecbd
[ "MIT", "Unlicense" ]
null
null
null
from unittest import TestCase from game import generate_random_room_event as generate_random_room_event from unittest.mock import patch class Test(TestCase): @patch('random.choices', return_value=["Shifting Mist"]) def test_generate_random_room_event(self, _): expected = "Shifting Mist" actual = generate_random_room_event() self.assertEqual(expected, actual)
32.916667
73
0.759494
50
395
5.7
0.48
0.196491
0.252632
0.322807
0.189474
0
0
0
0
0
0
0
0.164557
395
12
74
32.916667
0.863636
0
0
0
1
0
0.10101
0
0
0
0
0
0.111111
1
0.111111
false
0
0.333333
0
0.555556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
a43072eaad013dff5b5d54ca4b1e2f59ae71afab
200
py
Python
src/yellowdog_client/model/compute_source_usage.py
yellowdog/yellowdog-sdk-python-public
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
[ "Apache-2.0" ]
null
null
null
src/yellowdog_client/model/compute_source_usage.py
yellowdog/yellowdog-sdk-python-public
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
[ "Apache-2.0" ]
null
null
null
src/yellowdog_client/model/compute_source_usage.py
yellowdog/yellowdog-sdk-python-public
da69a7d6e45c92933e34fefcaef8b5d98dcd6036
[ "Apache-2.0" ]
null
null
null
from dataclasses import dataclass from typing import Optional @dataclass class ComputeSourceUsage: sourceTemplateId: str instanceType: Optional[str] = None imageId: Optional[str] = None
20
38
0.77
21
200
7.333333
0.619048
0.142857
0.194805
0
0
0
0
0
0
0
0
0
0.175
200
9
39
22.222222
0.933333
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.857143
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
1
0
0
0
1
0
0
5
a45dcdf6482d795844f6c01762d46fb35cec3999
214
py
Python
raspberryturk/embedded/__init__.py
Dzhuks/raspberryturk
bb7fa25d70f8c1291997332d12fe06d19d957a4e
[ "MIT" ]
169
2017-03-16T16:27:19.000Z
2022-03-05T12:54:19.000Z
raspberryturk/embedded/__init__.py
Dzhuks/raspberryturk
bb7fa25d70f8c1291997332d12fe06d19d957a4e
[ "MIT" ]
2
2017-03-24T17:23:23.000Z
2017-03-24T19:31:49.000Z
raspberryturk/embedded/__init__.py
Dzhuks/raspberryturk
bb7fa25d70f8c1291997332d12fe06d19d957a4e
[ "MIT" ]
38
2017-03-27T00:51:49.000Z
2022-03-01T16:16:55.000Z
from raspberryturk import is_running_on_raspberryturk, RaspberryTurkError if not is_running_on_raspberryturk(): raise RaspberryTurkError("Must be running on Raspberry Turk to use {} module.".format(__name__))
42.8
100
0.82243
27
214
6.148148
0.703704
0.162651
0.13253
0.289157
0
0
0
0
0
0
0
0
0.11215
214
4
101
53.5
0.873684
0
0
0
0
0
0.238318
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
5
f12b45788800de63286e306888dabafd7e5bd258
290
py
Python
main/schema/components/media_stats.py
kristianmk/tator
0eb75ee9333316b06f773de2b75e8e797a98ffdb
[ "MIT" ]
50
2019-09-18T14:32:18.000Z
2022-03-31T16:26:07.000Z
main/schema/components/media_stats.py
kristianmk/tator
0eb75ee9333316b06f773de2b75e8e797a98ffdb
[ "MIT" ]
566
2019-09-18T16:33:40.000Z
2022-03-31T20:01:38.000Z
main/schema/components/media_stats.py
kristianmk/tator
0eb75ee9333316b06f773de2b75e8e797a98ffdb
[ "MIT" ]
19
2019-09-21T20:08:12.000Z
2022-03-17T14:53:11.000Z
media_stats = { 'type': 'object', 'properties': { 'count': {'type': 'integer', 'minimum': 0}, 'download_size': {'type': 'integer', 'minimum': 0}, 'total_size': {'type': 'integer', 'minimum': 0}, 'duration': {'type': 'number', 'minimum': 0}, }, }
29
59
0.489655
27
290
5.148148
0.518519
0.230216
0.388489
0.410072
0.330935
0
0
0
0
0
0
0.018433
0.251724
290
9
60
32.222222
0.62212
0
0
0
0
0
0.437931
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
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
5
f16315d9917b764f274ca41176b7bb063cc7e73d
30
py
Python
py/specter/_version.py
sbailey/specter
762e56914f418ebbeaa8f67afec82113c8194371
[ "BSD-3-Clause" ]
4
2016-07-20T08:47:19.000Z
2021-06-04T18:31:03.000Z
py/specter/_version.py
desihub/specter
762e56914f418ebbeaa8f67afec82113c8194371
[ "BSD-3-Clause" ]
54
2015-07-06T23:24:18.000Z
2021-03-09T22:33:48.000Z
py/specter/_version.py
desihub/specter
762e56914f418ebbeaa8f67afec82113c8194371
[ "BSD-3-Clause" ]
7
2015-06-26T18:05:32.000Z
2020-10-21T20:25:34.000Z
__version__ = '0.10.0.dev610'
15
29
0.7
5
30
3.4
0.8
0
0
0
0
0
0
0
0
0
0
0.259259
0.1
30
1
30
30
0.37037
0
0
0
0
0
0.433333
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
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
5
f16fb96c15ef1a3ccc4a55ff6463345c1779f283
288
py
Python
core/company.py
Meliueada/Starup-Game-Python
557cb88588ae0f2dffcdaee3333581078d82b111
[ "MIT" ]
160
2015-10-07T15:28:22.000Z
2022-03-16T05:30:55.000Z
core/company.py
sunyanlan/Starup-Game-Python
cd3989222840fb959ab8ba67952f074ce0ff7e05
[ "MIT" ]
5
2015-10-13T16:50:28.000Z
2019-02-15T06:45:30.000Z
core/company.py
sunyanlan/Starup-Game-Python
cd3989222840fb959ab8ba67952f074ce0ff7e05
[ "MIT" ]
95
2015-10-08T02:16:50.000Z
2022-02-25T03:06:00.000Z
''' Time: 2015.10.2 Author: Lionel Content: Company ''' class Company(object): def __init__(self, name=None): self.__name = name @property def name(self): return self.__name @name.setter def name(self, name): self.__name = name
15.157895
34
0.576389
35
288
4.457143
0.514286
0.25641
0.230769
0
0
0
0
0
0
0
0
0.035
0.305556
288
18
35
16
0.745
0.163194
0
0.222222
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.111111
0.555556
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
5
74b05fd2cfe55cc5aaa75408f49e1882b2e1d1c4
153
py
Python
scoss/__init__.py
ngocjr7/scoss
a70f56a076ea5d64158625d5f221987a0210cc2d
[ "MIT" ]
4
2021-06-15T21:32:40.000Z
2022-02-23T08:16:10.000Z
scoss/__init__.py
ngocjr7/scoss
a70f56a076ea5d64158625d5f221987a0210cc2d
[ "MIT" ]
1
2021-04-18T18:16:59.000Z
2021-04-18T18:16:59.000Z
scoss/__init__.py
ngocjr7/scoss
a70f56a076ea5d64158625d5f221987a0210cc2d
[ "MIT" ]
1
2021-05-09T19:33:43.000Z
2021-05-09T19:33:43.000Z
from __future__ import absolute_import # from similarities import all_similarities from .scoss import Scoss from .smoss import SMoss from .main import *
25.5
43
0.830065
21
153
5.761905
0.428571
0
0
0
0
0
0
0
0
0
0
0
0.137255
153
5
44
30.6
0.916667
0.267974
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
1
0
0
5
74ce8335e7d7563eec56850777a07c0b76e378a5
130
py
Python
Project/Vividly/admin.py
silsashaji/Student_portal.github.io
5a6473cb4484b5b88304cda8ee4f8a3779e4c1ad
[ "MIT" ]
3
2021-05-16T07:12:40.000Z
2021-05-16T10:37:26.000Z
Project/Vividly/admin.py
silsashaji/Student_portal.github.io
5a6473cb4484b5b88304cda8ee4f8a3779e4c1ad
[ "MIT" ]
null
null
null
Project/Vividly/admin.py
silsashaji/Student_portal.github.io
5a6473cb4484b5b88304cda8ee4f8a3779e4c1ad
[ "MIT" ]
null
null
null
from django.contrib import admin from .models import user_profile # Register your models here. admin.site.register(user_profile)
21.666667
33
0.823077
19
130
5.526316
0.631579
0.209524
0
0
0
0
0
0
0
0
0
0
0.115385
130
5
34
26
0.913043
0.2
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.666667
0
0.666667
0
1
0
0
null
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
5
74d711ad12c0868c1e17dd5fc1ffd9b51748eec1
70
py
Python
cortex/data/metrics/__init__.py
huanglianghua/cortex
14d21a756fa117b19f10cb7b4b6405c5b78e63b2
[ "MIT" ]
8
2020-05-01T19:06:02.000Z
2021-06-17T12:44:15.000Z
cortex/data/metrics/__init__.py
huanglianghua/cortex
14d21a756fa117b19f10cb7b4b6405c5b78e63b2
[ "MIT" ]
null
null
null
cortex/data/metrics/__init__.py
huanglianghua/cortex
14d21a756fa117b19f10cb7b4b6405c5b78e63b2
[ "MIT" ]
null
null
null
from .default_metrics import * from .metric_learning_metrics import *
23.333333
38
0.828571
9
70
6.111111
0.666667
0.472727
0
0
0
0
0
0
0
0
0
0
0.114286
70
2
39
35
0.887097
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
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
1
0
1
0
0
0
0
5
74e7417c6dc50dcc392e3c51e52f63cf28a19535
2,515
py
Python
hallo/test/modules/random/test_eight_ball.py
joshcoales/Hallo
17145d8f76552ecd4cbc5caef8924bd2cf0cbf24
[ "MIT" ]
1
2018-05-19T22:27:20.000Z
2018-05-19T22:27:20.000Z
hallo/test/modules/random/test_eight_ball.py
joshcoales/Hallo
17145d8f76552ecd4cbc5caef8924bd2cf0cbf24
[ "MIT" ]
75
2015-09-26T18:07:18.000Z
2022-01-04T07:15:11.000Z
hallo/test/modules/random/test_eight_ball.py
SpangleLabs/Hallo
17145d8f76552ecd4cbc5caef8924bd2cf0cbf24
[ "MIT" ]
1
2021-04-10T12:02:47.000Z
2021-04-10T12:02:47.000Z
from hallo.events import EventMessage from hallo.modules.random.eight_ball import EightBall def test_eightball(hallo_getter): test_hallo = hallo_getter({"random"}) all_responses = ( EightBall.RESPONSES_YES_TOTALLY + EightBall.RESPONSES_YES_PROBABLY + EightBall.RESPONSES_MAYBE + EightBall.RESPONSES_NO ) test_hallo.function_dispatcher.dispatch( EventMessage(test_hallo.test_server, None, test_hallo.test_user, "eight ball") ) data = test_hallo.test_server.get_send_data(1, test_hallo.test_user, EventMessage) assert data[0].text.lower() in [ "{}.".format(x.lower()) for x in all_responses ], "Response isn't valid." def test_eightball_with_message(hallo_getter): test_hallo = hallo_getter({"random"}) all_responses = ( EightBall.RESPONSES_YES_TOTALLY + EightBall.RESPONSES_YES_PROBABLY + EightBall.RESPONSES_MAYBE + EightBall.RESPONSES_NO ) test_hallo.function_dispatcher.dispatch( EventMessage( test_hallo.test_server, None, test_hallo.test_user, "magic eightball will this test pass?", ) ) data = test_hallo.test_server.get_send_data(1, test_hallo.test_user, EventMessage) assert data[0].text.lower() in [ "{}.".format(x.lower()) for x in all_responses ], "Response isn't valid." def test_all_responses(mock_chooser, hallo_getter): test_hallo = hallo_getter({"random"}) all_responses = ( EightBall.RESPONSES_YES_TOTALLY + EightBall.RESPONSES_YES_PROBABLY + EightBall.RESPONSES_MAYBE + EightBall.RESPONSES_NO ) responses = [] for x in range(len(all_responses)): # Set RNG mock_chooser.choice = x # Shake magic eight ball test_hallo.function_dispatcher.dispatch( EventMessage(test_hallo.test_server, None, test_hallo.test_user, "magic8-ball") ) data = test_hallo.test_server.get_send_data(1, test_hallo.test_user, EventMessage) responses.append(data[0].text.lower()[:-1]) assert data[0].text.lower() in [ "{}.".format(x.lower()) for x in all_responses ], "Response isn't valid." # Check all responses given assert len(responses) == len( all_responses ), "Not the same number of responses as possible responses" assert set(responses) == set( [x.lower() for x in all_responses] ), "Not all responses are given"
34.930556
91
0.662425
307
2,515
5.162866
0.221498
0.102208
0.098423
0.071924
0.727445
0.727445
0.727445
0.712303
0.712303
0.712303
0
0.004692
0.237376
2,515
71
92
35.422535
0.821689
0.022266
0
0.532258
0
0
0.092872
0
0
0
0
0
0.080645
1
0.048387
false
0.016129
0.032258
0
0.080645
0
0
0
0
null
0
0
0
0
1
1
1
1
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
5
2d0e93c2b635320939e838c9de9d18b34c14adfe
465
py
Python
torch_metrics/regression/__init__.py
Joffreybvn/torch-metrics
587a4995730a7ec7b0370d6dd523d2c84129b255
[ "MIT" ]
95
2020-11-04T06:02:20.000Z
2022-03-17T16:27:04.000Z
torch_metrics/regression/__init__.py
Joffreybvn/torch-metrics
587a4995730a7ec7b0370d6dd523d2c84129b255
[ "MIT" ]
22
2020-11-04T06:09:29.000Z
2022-03-28T16:58:36.000Z
torch_metrics/regression/__init__.py
Joffreybvn/torch-metrics
587a4995730a7ec7b0370d6dd523d2c84129b255
[ "MIT" ]
17
2020-11-04T05:56:35.000Z
2021-08-28T15:38:14.000Z
from torch_metrics.regression.huber import Huber from torch_metrics.regression.logcosh import LogCoshError from torch_metrics.regression.mae import MeanAbsoluteError from torch_metrics.regression.meaniou import MeanIoU from torch_metrics.regression.mse import MeanSquaredError from torch_metrics.regression.msle import MeanSquaredLogarithmicError from torch_metrics.regression.rmse import RootMeanSquaredError from torch_metrics.regression.rsquared import RSquared
51.666667
69
0.896774
56
465
7.303571
0.321429
0.176039
0.312958
0.508557
0
0
0
0
0
0
0
0
0.068817
465
8
70
58.125
0.944573
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
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
5
2d2bcf59ce9d61b66c636ff2dd1cab978004bf73
228
py
Python
catalog/admin.py
loctnmps08790/django_local_library
0a3772e6da5c9a90b60a7638707ba62f927ec819
[ "Unlicense" ]
null
null
null
catalog/admin.py
loctnmps08790/django_local_library
0a3772e6da5c9a90b60a7638707ba62f927ec819
[ "Unlicense" ]
4
2021-03-30T13:45:45.000Z
2021-09-22T19:14:52.000Z
catalog/admin.py
loctnmps08790/django_local_library
0a3772e6da5c9a90b60a7638707ba62f927ec819
[ "Unlicense" ]
null
null
null
from django.contrib import admin from . import models # Register your models here. admin.site.register(models.Genre) admin.site.register(models.Author) admin.site.register(models.Book) admin.site.register(models.BookInstance)
22.8
40
0.811404
32
228
5.78125
0.4375
0.194595
0.367568
0.497297
0
0
0
0
0
0
0
0
0.083333
228
9
41
25.333333
0.885167
0.114035
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
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
1
0
1
0
0
0
0
5
741abe2884cc68b56eec7836832afd66253ba1a6
248
py
Python
ca_on_peel/people.py
dogooderapp/scrapers-ca
5e852eea93f05f3f397eec318d3094a3b1b0b458
[ "MIT" ]
19
2015-05-26T03:18:50.000Z
2022-01-31T03:27:41.000Z
ca_on_peel/people.py
dogooderapp/scrapers-ca
5e852eea93f05f3f397eec318d3094a3b1b0b458
[ "MIT" ]
119
2015-01-09T06:09:35.000Z
2022-01-20T23:05:05.000Z
ca_on_peel/people.py
dogooderapp/scrapers-ca
5e852eea93f05f3f397eec318d3094a3b1b0b458
[ "MIT" ]
17
2015-11-23T05:00:10.000Z
2021-09-15T16:03:33.000Z
from utils import CSVScraper class PeelPersonScraper(CSVScraper): # http://opendata.peelregion.ca/data-categories/regional-geography/ward-boundaries-(2018-2022).aspx csv_url = 'http://opendata.peelregion.ca/media/43505/wards1822_csv.csv'
35.428571
103
0.78629
31
248
6.225806
0.774194
0.124352
0.227979
0.248705
0
0
0
0
0
0
0
0.07489
0.084677
248
6
104
41.333333
0.77533
0.391129
0
0
0
0
0.395973
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
5
7441e1558e9caa236edfeac6341855f795dad4dc
102
py
Python
reset_password/apps.py
dariusmb/drf-reset-password
6bfdbd6cc5f08301b8ee458984a464628c40aaa0
[ "MIT" ]
10
2020-07-03T09:48:56.000Z
2022-02-19T12:14:26.000Z
reset_password/apps.py
dariusmb/drf-reset-password
6bfdbd6cc5f08301b8ee458984a464628c40aaa0
[ "MIT" ]
null
null
null
reset_password/apps.py
dariusmb/drf-reset-password
6bfdbd6cc5f08301b8ee458984a464628c40aaa0
[ "MIT" ]
6
2020-08-12T08:22:50.000Z
2022-03-30T17:29:57.000Z
from django.apps import AppConfig class ResetPasswordConfig(AppConfig): name = "reset_password"
17
37
0.784314
11
102
7.181818
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.147059
102
5
38
20.4
0.908046
0
0
0
0
0
0.137255
0
0
0
0
0
0
1
0
false
0.666667
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
1
1
0
1
0
0
5
74845bf392854fa7e61733fabd68783c5c2b7998
440
py
Python
src/pyrin/cli/structs.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
src/pyrin/cli/structs.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
src/pyrin/cli/structs.py
wilsonGmn/pyrin
25dbe3ce17e80a43eee7cfc7140b4c268a6948e0
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """ cli structs module. """ class CLIGroups: """ cli groups class. each cli handler group will be registered with its relevant group name. usage example: `python cli.py alembic upgrade --arg value` `python cli.py babel extract --arg value` `python cli.py template package` `python cli.py celery worker --arg value` `python cli.py security token --arg value` """ pass
20
75
0.640909
59
440
4.779661
0.610169
0.159574
0.195035
0.180851
0.202128
0
0
0
0
0
0
0.003021
0.247727
440
21
76
20.952381
0.848943
0.804545
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
5
77957514f544cb5711d1e4e6f7f7d26c7b8cab51
8,170
py
Python
network/light_port_scanner.py
greyshell/greyEnum
f6a26d62e6b45475d31273ab800073bd08429a10
[ "MIT" ]
6
2015-03-10T20:00:04.000Z
2015-07-29T03:02:02.000Z
network/light_port_scanner.py
greyshell/greyEnum
f6a26d62e6b45475d31273ab800073bd08429a10
[ "MIT" ]
3
2020-12-19T08:58:35.000Z
2021-06-02T03:12:54.000Z
network/light_port_scanner.py
greyshell/python_programming
cfe4c700675fb6f979245ceda775ecf656574312
[ "MIT" ]
1
2018-01-30T05:07:57.000Z
2018-01-30T05:07:57.000Z
#!/usr/bin/env python3 # author: greyshell # description: TBD import socket import optparse from socket import * from threading import * from time import sleep screenLock = Semaphore(value=1) def connect_scan(tgtHost, tgtPort): try: sock = socket(AF_INET, SOCK_STREAM) buffer = "greyshell\r\n" connect = sock.connect((tgtHost, tgtPort)) sock.send(buffer) results = sock.recv(1000) screenLock.acquire() print('[+] %d/tcp open' % tgtPort) print('[-] ' + str(results)) except Exception as e: screenLock.acquire() finally: screenLock.release() sock.close() def portScan(tgtHost, tgtPorts): try: tgtIP = gethostbyname(tgtHost) except: print("[-] Cannot resolve '%s': Unknown host" % tgtHost) return try: tgtName = gethostbyaddr(tgtIP) print('\n[+] Scan Results for: ' + tgtName[0] + '\n') except: print('\n[+] Scan Results for: ' + tgtIP) setdefaulttimeout(5) for tgtPort in tgtPorts: t = Thread(target=connect_scan, args=(tgtHost, int(tgtPort))) t.start() sleep(0.1) def main(): # Adding parser functionality parser = optparse.OptionParser('Usage %prog -H' + ' <target host> -p <target port>') parser.add_option('-H', dest='tgtHost', type='string', help='specify target host') parser.add_option('-p', dest='tgtPort', type='string', help='specify target port saperated by comma') (options, args) = parser.parse_args() tgtHost = options.tgtHost tgtPorts = str(options.tgtPort).split(',') if tgtHost is None: print('\n[-] You must specify a target host and port[s], saperated by comma') print(parser.usage) exit(0) if tgtPorts[0] == 'None': print('\n[-] Scanning top 1000 TCP ports preferred by nmap') temp = "1,3,4,6,7,9,13,17,19,20,21,22,23,24,25,26,30,32,33,37,42,43,49,53,70,79,80," \ "81,82,83,84,85,88,89,90,99,100,106,109,110,111,113,119,125,135,139,143,144,146," \ "161,163,179,199,211,212,222,254,254,256,259,264,280,301,306,311,340,366,389,406,407," \ "416,417,425,427,443,444,445,458,464,465,481,497,500,512,513,514,515,524,541,543,544," \ "545,548,554,555,563,587,593,616,617,625,631,636,646,648,666,667,668,683,687,691,700," \ "705,711,714,720,722,726,749,765,777,783,787,800,801,808,843,873,880,888,898,900,901," \ "902,903,911,912,981,987,990,992,993,995,999,1000,1001,1002,1007,1009,1010,1011,1021,1022," \ "1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038," \ "1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054," \ "1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070," \ "1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087," \ "1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1102,1104,1105,1106,1107," \ "1108,1110,1111,1112,1113,1114,1117,1119,1121,1122,1123,1124,1126,1130,1131,1132,1137,1138,1141," \ "1145,1147,1148,1149,1151,1152,1154,1163,1164,1165,1166,1169,1174,1175,1183,1185,1186,1187," \ "1192,1198,1199,1201,1213,1216,1217,1218,1233,1234,1236,1244,1247,1248,1259,1271,1272,1277,1287," \ "1296,1300,1301,1309,1310,1311,1322,1328,1334,1352,1417,1433,1434,1443,1455,1461,1494," \ "1500,1501,1503,1521,1524,1533,1556,1580,1583,1594,1600,1641,1658,1666,1687,1688,1700," \ "1717,1721,1723,1755,1761,1782,1783,1801,1805,1812,1839,1840,1862,1863,1864,1875,1900,1914," \ "1935,1947,1971,1972,1974,1984,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009," \ "2010,2013,2020,2021,2022,2030,2033,2034,2035,2038,2040,2041,2042,2043,2045,2045,2046,2047," \ "2048,2049,2065,2068,2099,2100,2103,2105,2106,2107,2111,2119,2121,2126,2135,2144,2160,2161,2170," \ "2179,2190,2191,2196,2200,2222,2251,2260,2288,2301,2323,2366,2381,2382,2383,2393,2394,2399," \ "2401,2492,2500,2522,2525,2557,2601,2602,2604,2605,2607,2608,2638,2701,2702,2710,2717,2718,2725," \ "2800,2809,2811,2869,2875,2909,2910,2920,2967,2968,2998,3000,3001,3003,3005,3006,3007,3011,3013," \ "3017,3030,3031,3052,3071,3077,3128,3168,3211,3221,3260,3261,3268,3269,3283,3300,3301,3306," \ "3322,3323,3324,3325,3333,3351,3367,3369,33670,3371,3372,3389,3390,3404,3476,3493,3517,3527," \ "3546,3551,3580,3659,3689,3690,3703,3737,3766,3784,3800,3801,3809,3814,3826,3827,3828,3851," \ "3869,3871,3878,3880,3889,3905,3914,3918,3920,3945,3971,3986,3995,3998,4000,4001,4002,4003," \ "4004,4005,4006,4045,4111,4125,4126,4129,4224,4242,4279,4321,4343,4443,4446,4449,4550,4567," \ "4662,4848,4899,4900,4998,5000,5001,5002,5003,5004,5009,5030,5033,5050,5051,5054,5060,5061," \ "5080,5087,5100,5102,5120,5190,5200,5214,5221,5222,5225,5226,5269,5280,5298,5357,5405," \ "5414,5431,5432,5440,5500,5510,5544,5550,5555,5560,5566,5631,5633,5666,5678,5679,5718,5730,5800," \ "5801,5802,5810,5811,5815,5822,5825,5850,5859,5862,5877,5900,5901,5902,5903,5904,5906,5907,5910,5911," \ "5915,5922,5925,5950,5952,5959,5960,5961,5962,5963,5987,5988,5989,5998,5999,6000,6001,6002," \ "6003,6004,6005,6006,6007,6009,6025,6059,6100,6101,6106,6112,6123,6129,6156,6346,6389,6502," \ "6510,6543,6547,6565,6567,6580,6646,6666,6667,6668,6669,6689,6692,6699,6779,6788,6789,6792," \ "6839,6881,6901,6969,7000,7001,7002,7004,7007,7019,7025,7070,7100,7103,7106,7200,7201,7402," \ "7435,7443,7496,7512,7625,7627,7676,7741,7777,7778,7800,7911,7920,7921,7937,7938,7999,8000," \ "8001,8002,8007,8008,8009,8010,8011,8021,8022,8031,8042,8045,8080,8081,8082,8083,8084,8085," \ "8086,8087,8088,8089,8090,8093,8099,8100,8180,8181,8192,8193,8194,8200,8222,8254,8290,8291," \ "8292,8300,8333,8383,8400,8402,8443,8500,8600,8649,8651,8652,8654,8701,8800,8873,8888,8899," \ "8994,9000,9001,9002,9003,9009,9010,9011,9040,9050,9071,9080,9081,9090,9091,9099,9100,9101,9102," \ "9103,9110,9111,9200,9207,9220,9290,9415,9418,9485,9500,9502,9503,9535,9575,9593,9594,9595," \ "9618,9666,9876,9877,9878,9898,9900,9917,9929," \ "9943,9944,9968,9998,9999,10000,10001,10002,10003,10004,10009,10010,10012,10024,10025,10082," \ "10180,10215,10243,10566,10616,10617,10621,10626,10628,10629,10778,11110,11111,11967,12000,12174," \ "12265,12345,13456,13722,13782,13783,14000,14238,14441,14442,15000,15002,15001,15002,15003," \ "15004,15660,15742,16000,16001,16012,16016,16018,16080,16113,16992,16993,17877,17988,18040,18101," \ "18988,19101,19283,19315,19350,19780,19801,19842,20000,20005,20031,20221,20222,20828,21571,22939," \ "23502,24444,24800,25734,25735,26214,27000,27352,27353,27355,27356,27715,28201,30000,30718,30951," \ "31038,31337,32768,32769,32770,32771,32772,32773,32774,32775,32776," \ "32777,32778,32779,32780,32781,32782,32783,32784,32785,33354,33899,34571,34572,34573,35500,38292," \ "40193,40911,41511,42510,44176,44442,44443,44501,45100,48080,49152,49153,49154,49155,49156,49157," \ "49158,49159,49160,49161,49163,49165,49167,49175,49176,49400,49999,50000,50001,50002," \ "50003,50006,50300,50389,50500,50636,50800,51103,51493,52673,52822,52848,52869,54045,54328," \ "55055,55056,55555,55600,56737,56738,57294,57797,58080,60020,60443,61532,61900,62078,63331,64623," \ "64680,65000,65129,65389" tgtPorts = str(temp).split(',') else: pass portScan(tgtHost, tgtPorts) print('[+] Finished TCP scan.') if __name__ == '__main__': main()
55.578231
119
0.640024
1,238
8,170
4.211632
0.891761
0.004603
0.008822
0.006521
0.018028
0
0
0
0
0
0
0.598443
0.182497
8,170
146
120
55.958904
0.182213
0.010282
0
0.061404
0
0.482456
0.665924
0.615689
0
0
0
0
0
1
0.026316
false
0.008772
0.04386
0
0.078947
0.078947
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
1
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5
77f96612fb597128616892f1a50ecd887ed21a64
95
py
Python
tools/pbrt/pbrt/__init__.py
PearCoding/PearRay
8654a7dcd55cc67859c7c057c7af64901bf97c35
[ "MIT" ]
19
2016-11-07T00:01:19.000Z
2021-12-29T05:35:14.000Z
tools/pbrt/pbrt/__init__.py
PearCoding/PearRay
8654a7dcd55cc67859c7c057c7af64901bf97c35
[ "MIT" ]
33
2016-07-06T21:58:05.000Z
2020-08-01T18:18:24.000Z
tools/pbrt/pbrt/__init__.py
PearCoding/PearRay
8654a7dcd55cc67859c7c057c7af64901bf97c35
[ "MIT" ]
null
null
null
from .parser import Parser, Operation from .writer import Writer from .operator import Operator
31.666667
37
0.831579
13
95
6.076923
0.461538
0
0
0
0
0
0
0
0
0
0
0
0.126316
95
3
38
31.666667
0.951807
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
1
0
0
5
7ad8171612d362021f6126b367195026952bdba7
164
py
Python
webdev/financeiro/apps.py
h-zanetti/jewelry-manager
74166b89f492303b8ebf5ff8af058f394eb2a28b
[ "MIT" ]
null
null
null
webdev/financeiro/apps.py
h-zanetti/jewelry-manager
74166b89f492303b8ebf5ff8af058f394eb2a28b
[ "MIT" ]
103
2021-04-25T21:28:11.000Z
2022-03-15T01:36:31.000Z
webdev/financeiro/apps.py
h-zanetti/jewelry-manager
74166b89f492303b8ebf5ff8af058f394eb2a28b
[ "MIT" ]
null
null
null
from django.apps import AppConfig class FinanceiroConfig(AppConfig): name = 'webdev.financeiro' def ready(self): import webdev.financeiro.signals
20.5
40
0.731707
18
164
6.666667
0.777778
0.266667
0
0
0
0
0
0
0
0
0
0
0.189024
164
8
40
20.5
0.902256
0
0
0
0
0
0.10303
0
0
0
0
0
0
1
0.2
false
0
0.4
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
1
0
1
0
0
5
7ad9a9622017074f424dc788e8b5bc4c8242d91a
66
py
Python
gutenberg/gutenberg/management/commands/PaxHeader/rdf.py
manestay/novel-chapter-dataset
a6ebb11fc95a274642230ae56f7df874f4bb5d83
[ "MIT" ]
7
2020-05-10T19:31:00.000Z
2021-11-26T06:23:19.000Z
gutenberg/gutenberg/management/commands/PaxHeader/rdf.py
manestay/novel-chapter-dataset
a6ebb11fc95a274642230ae56f7df874f4bb5d83
[ "MIT" ]
2
2021-09-16T12:09:28.000Z
2021-12-05T21:15:06.000Z
gutenberg/gutenberg/management/commands/PaxHeader/rdf.py
manestay/novel-chapter-dataset
a6ebb11fc95a274642230ae56f7df874f4bb5d83
[ "MIT" ]
1
2021-04-02T08:24:07.000Z
2021-04-02T08:24:07.000Z
18 gid=1896053708 18 uid=1356538483 30 mtime=1603850732.734074754
16.5
29
0.848485
10
66
5.6
0.9
0
0
0
0
0
0
0
0
0
0
0.75
0.090909
66
3
30
22
0.183333
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
5
bb350fbdba185db87c954074c99f7b8142c1520b
144
py
Python
src/dags/__init__.py
OpenSourceEconomics/dags
6e5f5f9a9f480b67801c2ba9b0360af88ae934c2
[ "MIT" ]
6
2022-03-08T14:56:02.000Z
2022-03-30T16:54:33.000Z
src/dags/__init__.py
OpenSourceEconomics/dags
6e5f5f9a9f480b67801c2ba9b0360af88ae934c2
[ "MIT" ]
4
2022-03-08T15:26:48.000Z
2022-03-30T12:39:27.000Z
src/dags/__init__.py
OpenSourceEconomics/dags
6e5f5f9a9f480b67801c2ba9b0360af88ae934c2
[ "MIT" ]
null
null
null
from dags.dag import concatenate_functions from dags.dag import get_ancestors __all__ = [ "concatenate_functions", "get_ancestors", ]
16
42
0.756944
17
144
5.941176
0.529412
0.158416
0.217822
0.336634
0
0
0
0
0
0
0
0
0.166667
144
8
43
18
0.841667
0
0
0
0
0
0.236111
0.145833
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
5
bb5253ec417016df705d7343db8a2f3af3ca4562
369
py
Python
tests/schema/test_embeds.py
Justasic/Privacy.py
471e6669a1e22e539459bbeb24de4efd3b7a11e0
[ "BSD-3-Clause" ]
3
2019-11-04T16:11:36.000Z
2021-05-24T18:56:40.000Z
tests/schema/test_embeds.py
Justasic/Privacy.py
471e6669a1e22e539459bbeb24de4efd3b7a11e0
[ "BSD-3-Clause" ]
9
2019-11-09T01:47:58.000Z
2022-03-30T00:19:20.000Z
tests/schema/test_embeds.py
Justasic/Privacy.py
471e6669a1e22e539459bbeb24de4efd3b7a11e0
[ "BSD-3-Clause" ]
2
2020-08-12T03:22:29.000Z
2020-12-10T00:08:46.000Z
"""Tests for privacy.schema.embed""" from privacy.schema import embeds def test_embed_request(): embed_request_obj = embeds.EmbedRequest(token="3523-6543-1236-8975", css="https://www.not_a.url") assert embed_request_obj.token == "3523-6543-1236-8975" assert embed_request_obj.css == "https://www.not_a.url" assert embed_request_obj.expiration is None
36.9
101
0.747967
56
369
4.714286
0.5
0.227273
0.227273
0.238636
0.454545
0.295455
0.295455
0.295455
0.295455
0.295455
0
0.09816
0.116531
369
9
102
41
0.711656
0.081301
0
0
0
0
0.24024
0
0
0
0
0
0.5
1
0.166667
false
0
0.166667
0
0.333333
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
1
0
0
0
0
0
0
0
0
0
5
24e2a90f9e0603e39583e05336c2477b26b35068
133
py
Python
src/products/signals.py
vladimir-grigoriev/python_curse
2ec55f453f29892bfbd8ba2d4f0712f7c0263ec2
[ "Apache-2.0" ]
null
null
null
src/products/signals.py
vladimir-grigoriev/python_curse
2ec55f453f29892bfbd8ba2d4f0712f7c0263ec2
[ "Apache-2.0" ]
null
null
null
src/products/signals.py
vladimir-grigoriev/python_curse
2ec55f453f29892bfbd8ba2d4f0712f7c0263ec2
[ "Apache-2.0" ]
null
null
null
""" for signals handlers """ import os def image_cleaner(sender, instance, *args, **kwargs): os.remove(instance.foto.file.name)
22.166667
53
0.706767
18
133
5.166667
0.888889
0
0
0
0
0
0
0
0
0
0
0
0.135338
133
6
54
22.166667
0.808696
0.150376
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
24f47d4db37730db54360b4f1604dd6d20b10b81
163
py
Python
eahub/base/admin.py
taymonbeal/eahub.org
311be65b927b7c7b02f16fba97d74903cf13cf59
[ "MIT" ]
null
null
null
eahub/base/admin.py
taymonbeal/eahub.org
311be65b927b7c7b02f16fba97d74903cf13cf59
[ "MIT" ]
null
null
null
eahub/base/admin.py
taymonbeal/eahub.org
311be65b927b7c7b02f16fba97d74903cf13cf59
[ "MIT" ]
null
null
null
from authtools import admin as authtools_admin from django.contrib import admin from . import models admin.site.register(models.User, authtools_admin.UserAdmin)
23.285714
59
0.834356
23
163
5.826087
0.521739
0.164179
0
0
0
0
0
0
0
0
0
0
0.110429
163
6
60
27.166667
0.924138
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
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
1
0
1
0
1
0
0
5
7035017cb06faaec1cc9afcba4e9547a47799627
79
py
Python
enthought/chaco/plot.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
3
2016-12-09T06:05:18.000Z
2018-03-01T13:00:29.000Z
enthought/chaco/plot.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
1
2020-12-02T00:51:32.000Z
2020-12-02T08:48:55.000Z
enthought/chaco/plot.py
enthought/etsproxy
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
[ "BSD-3-Clause" ]
null
null
null
# proxy module from __future__ import absolute_import from chaco.plot import *
19.75
38
0.822785
11
79
5.454545
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.139241
79
3
39
26.333333
0.882353
0.151899
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
1
0
0
5
7050a2968ca74ade46ea7594009ed9fb141c32d4
139,734
py
Python
erfa_test.py
nirinA/erfa_python
eed854e15e61d08d6cefd398d5354fc87ff9a55c
[ "Unlicense" ]
2
2015-03-30T12:17:31.000Z
2016-05-03T12:58:32.000Z
erfa_test.py
nirinA/erfa_python
eed854e15e61d08d6cefd398d5354fc87ff9a55c
[ "Unlicense" ]
3
2015-02-10T22:11:14.000Z
2016-08-04T13:35:20.000Z
erfa_test.py
nirinA/erfa_python
eed854e15e61d08d6cefd398d5354fc87ff9a55c
[ "Unlicense" ]
null
null
null
import unittest import sys import math import erfa class Validate(unittest.TestCase): ''' float: self.assertAlmostEqual(value, expected, places=diff) int: self.assertEqual(value, expected) char: self.assertEqual(value, expected) ''' ## astrometry tools def test_ab(self): pnat = (-0.76321968546737951,-0.60869453983060384,-0.21676408580639883) v = (2.1044018893653786e-5,-8.9108923304429319e-5,-3.8633714797716569e-5) s = 0.99980921395708788 bm1 = 0.99999999506209258 ppr = erfa.ab(pnat, v, s, bm1) self.assertAlmostEqual(ppr[0], -0.7631631094219556269, places=12) self.assertAlmostEqual(ppr[1], -0.6087553082505590832, places=12) self.assertAlmostEqual(ppr[2], -0.2167926269368471279, places=12) def test_apcg(self): date1 = 2456165.5 date2 = 0.401182685 ebpv=((0.901310875,-0.417402664,-0.180982288), ( 0.00742727954,0.0140507459,0.00609045792)) ehp=(0.903358544,-0.415395237,-0.180084014) astrom = erfa.apcg(date1,date2,ebpv,ehp) self.assertAlmostEqual(astrom.pmt, 12.65133794027378508, places=11) self.assertAlmostEqual(astrom.eb[0], 0.901310875, places=12) self.assertAlmostEqual(astrom.eb[1], -0.417402664, places=12) self.assertAlmostEqual(astrom.eb[2], -0.180982288, places=12) self.assertAlmostEqual(astrom.eh[0], 0.8940025429324143045, places=12) self.assertAlmostEqual(astrom.eh[1], -0.4110930268679817955, places=12) self.assertAlmostEqual(astrom.eh[2], -0.1782189004872870264, places=12) self.assertAlmostEqual(astrom.em, 1.010465295811013146, places=12) self.assertAlmostEqual(astrom.v[0], 0.4289638913597693554e-4, places=16) self.assertAlmostEqual(astrom.v[1], 0.8115034051581320575e-4, places=16) self.assertAlmostEqual(astrom.v[2], 0.3517555136380563427e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999951686012981, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 1.0, 0.0) self.assertAlmostEqual(astrom.bpn[1][0], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[2][0], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[0][1], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[1][1], 1.0, 0.0) self.assertAlmostEqual(astrom.bpn[2][1], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[0][2], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[1][2], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[2][2], 1.0, 0.0) def test_apcg13(self): date1 = 2456165.5 date2 = 0.401182685 astrom=erfa.apcg13(date1,date2) self.assertAlmostEqual(astrom.pmt, 12.65133794027378508, places=11) self.assertAlmostEqual(astrom.eb[0], 0.9013108747340644755, places=12) self.assertAlmostEqual(astrom.eb[1], -0.4174026640406119957, places=12) self.assertAlmostEqual(astrom.eb[2], -0.1809822877867817771, places=12) self.assertAlmostEqual(astrom.eh[0], 0.8940025429255499549, places=12) self.assertAlmostEqual(astrom.eh[1], -0.4110930268331896318, places=12) self.assertAlmostEqual(astrom.eh[2], -0.1782189006019749850, places=12) self.assertAlmostEqual(astrom.em, 1.010465295964664178, places=12) self.assertAlmostEqual(astrom.v[0], 0.4289638912941341125e-4, places=16) self.assertAlmostEqual(astrom.v[1], 0.8115034032405042132e-4, places=16) self.assertAlmostEqual(astrom.v[2], 0.3517555135536470279e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999951686013142, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 1.0, 0.0) self.assertAlmostEqual(astrom.bpn[1][0], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[2][0], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[0][1], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[1][1], 1.0, 0.0) self.assertAlmostEqual(astrom.bpn[2][1], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[0][2], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[1][2], 0.0, 0.0) self.assertAlmostEqual(astrom.bpn[2][2], 1.0, 0.0) def test_apci(self): date1 = 2456165.5 date2 = 0.401182685 ebpv = ((0.901310875,-0.417402664,-0.180982288), (0.00742727954,0.0140507459,0.00609045792)) ehp = (0.903358544,-0.415395237,-0.180084014) x = 0.0013122272 y = -2.92808623e-5 s = 3.05749468e-8 astrom = erfa.apci(date1, date2, ebpv, ehp, x, y, s) self.assertAlmostEqual(astrom.pmt, 12.65133794027378508, places=11) self.assertAlmostEqual(astrom.eb[0], 0.901310875, places=12) self.assertAlmostEqual(astrom.eb[1], -0.417402664, places=12) self.assertAlmostEqual(astrom.eb[2], -0.180982288, places=12) self.assertAlmostEqual(astrom.eh[0], 0.8940025429324143045, places=12) self.assertAlmostEqual(astrom.eh[1], -0.4110930268679817955, places=12) self.assertAlmostEqual(astrom.eh[2], -0.1782189004872870264, places=12) self.assertAlmostEqual(astrom.em, 1.010465295811013146, places=12) self.assertAlmostEqual(astrom.v[0], 0.4289638913597693554e-4, places=16) self.assertAlmostEqual(astrom.v[1], 0.8115034051581320575e-4, places=16) self.assertAlmostEqual(astrom.v[2], 0.3517555136380563427e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999951686012981, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 0.9999991390295159156, places=12) self.assertAlmostEqual(astrom.bpn[1][0], 0.4978650072505016932e-7, places=12) self.assertAlmostEqual(astrom.bpn[2][0], 0.1312227200000000000e-2, places=12) self.assertAlmostEqual(astrom.bpn[0][1], -0.1136336653771609630e-7, places=12) self.assertAlmostEqual(astrom.bpn[1][1], 0.9999999995713154868, places=12) self.assertAlmostEqual(astrom.bpn[2][1], -0.2928086230000000000e-4, places=12) self.assertAlmostEqual(astrom.bpn[0][2], -0.1312227200895260194e-2, places=12) self.assertAlmostEqual(astrom.bpn[1][2], 0.2928082217872315680e-4, places=12) def test_apci13(self): date1 = 2456165.5 date2 = 0.401182685 astrom, eo = erfa.apci13(date1, date2) self.assertAlmostEqual(astrom.pmt, 12.65133794027378508, places=11) self.assertAlmostEqual(astrom.eb[0], 0.9013108747340644755, places=12) self.assertAlmostEqual(astrom.eb[1], -0.4174026640406119957, places=12) self.assertAlmostEqual(astrom.eb[2], -0.1809822877867817771, places=12) self.assertAlmostEqual(astrom.eh[0], 0.8940025429255499549, places=12) self.assertAlmostEqual(astrom.eh[1], -0.4110930268331896318, places=12) self.assertAlmostEqual(astrom.eh[2], -0.1782189006019749850, places=12) self.assertAlmostEqual(astrom.em, 1.010465295964664178, places=12) self.assertAlmostEqual(astrom.v[0], 0.4289638912941341125e-4, places=16) self.assertAlmostEqual(astrom.v[1], 0.8115034032405042132e-4, places=16) self.assertAlmostEqual(astrom.v[2], 0.3517555135536470279e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999951686013142, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 0.9999992060376761710, places=12) self.assertAlmostEqual(astrom.bpn[1][0], 0.4124244860106037157e-7, places=12) self.assertAlmostEqual(astrom.bpn[2][0], 0.1260128571051709670e-2, places=12) self.assertAlmostEqual(astrom.bpn[0][1], -0.1282291987222130690e-7, places=12) self.assertAlmostEqual(astrom.bpn[1][1], 0.9999999997456835325, places=12) self.assertAlmostEqual(astrom.bpn[2][1], -0.2255288829420524935e-4, places=12) self.assertAlmostEqual(astrom.bpn[0][2], -0.1260128571661374559e-2, places=12) self.assertAlmostEqual(astrom.bpn[1][2], 0.2255285422953395494e-4, places=12) self.assertAlmostEqual(astrom.bpn[2][2], 0.9999992057833604343, places=12) self.assertAlmostEqual(eo, -0.2900618712657375647e-2, places=12) def test_apco(self): date1 = 2456384.5 date2 = 0.970031644 ebpv = ((-0.974170438,-0.211520082,-0.0917583024), (0.00364365824,-0.0154287319,-0.00668922024)) ehp = (-0.973458265,-0.209215307,-0.0906996477) x = 0.0013122272 y = -2.92808623e-5 s = 3.05749468e-8 theta = 3.14540971 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 sp = -3.01974337e-11 refa = 0.000201418779 refb = -2.36140831e-7 astrom = erfa.apco(date1, date2, ebpv, ehp, x, y, s, theta, elong, phi, hm, xp, yp, sp, refa, refb) self.assertAlmostEqual(astrom.pmt, 13.25248468622587269, places=11) self.assertAlmostEqual(astrom.eb[0], -0.9741827110630322720, places=12) self.assertAlmostEqual(astrom.eb[1], -0.2115130190135344832, places=12) self.assertAlmostEqual(astrom.eb[2], -0.09179840186949532298, places=12) self.assertAlmostEqual(astrom.eh[0], -0.9736425571689739035, places=12) self.assertAlmostEqual(astrom.eh[1], -0.2092452125849330936, places=12) self.assertAlmostEqual(astrom.eh[2], -0.09075578152243272599, places=12) self.assertAlmostEqual(astrom.em, 0.9998233241709957653, places=12) self.assertAlmostEqual(astrom.v[0], 0.2078704992916728762e-4, places=16) self.assertAlmostEqual(astrom.v[1], -0.8955360107151952319e-4, places=16) self.assertAlmostEqual(astrom.v[2], -0.3863338994288951082e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999950277561236, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 0.9999991390295159156, places=12) self.assertAlmostEqual(astrom.bpn[1][0], 0.4978650072505016932e-7, places=12) self.assertAlmostEqual(astrom.bpn[2][0], 0.1312227200000000000e-2, places=12) self.assertAlmostEqual(astrom.bpn[0][1], -0.1136336653771609630e-7, places=12) self.assertAlmostEqual(astrom.bpn[1][1], 0.9999999995713154868, places=12) self.assertAlmostEqual(astrom.bpn[2][1], -0.2928086230000000000e-4, places=12) self.assertAlmostEqual(astrom.bpn[0][2], -0.1312227200895260194e-2, places=12) self.assertAlmostEqual(astrom.bpn[1][2], 0.2928082217872315680e-4, places=12) self.assertAlmostEqual(astrom.bpn[2][2], 0.9999991386008323373, places=12) self.assertAlmostEqual(astrom.along, -0.5278008060301974337, places=12) self.assertAlmostEqual(astrom.xpl, 0.1133427418174939329e-5, places=17) self.assertAlmostEqual(astrom.ypl, 0.1453347595745898629e-5, places=17) self.assertAlmostEqual(astrom.sphi, -0.9440115679003211329, places=12) self.assertAlmostEqual(astrom.cphi, 0.3299123514971474711, places=12) self.assertAlmostEqual(astrom.diurab, 0, 0) self.assertAlmostEqual(astrom.eral, 2.617608903969802566, places=12) self.assertAlmostEqual(astrom.refa, 0.2014187790000000000e-3, places=15) self.assertAlmostEqual(astrom.refb, -0.2361408310000000000e-6, places=18) def test_apco13(self): utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 p = 2.47230737e-7 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 astrom, eo = erfa.apco13(utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(astrom.pmt, 13.25248468622475727, places=11) self.assertAlmostEqual(astrom.eb[0], -0.9741827107320875162, places=12) self.assertAlmostEqual(astrom.eb[1], -0.2115130190489716682, places=12) self.assertAlmostEqual(astrom.eb[2], -0.09179840189496755339, places=12) self.assertAlmostEqual(astrom.eh[0], -0.9736425572586935247, places=12) self.assertAlmostEqual(astrom.eh[1], -0.2092452121603336166, places=12) self.assertAlmostEqual(astrom.eh[2], -0.09075578153885665295, places=12) self.assertAlmostEqual(astrom.em, 0.9998233240913898141, places=12) self.assertAlmostEqual(astrom.v[0], 0.2078704994520489246e-4, places=16) self.assertAlmostEqual(astrom.v[1], -0.8955360133238868938e-4, places=16) self.assertAlmostEqual(astrom.v[2], -0.3863338993055887398e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999950277561004, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 0.9999991390295147999, places=12) self.assertAlmostEqual(astrom.bpn[1][0], 0.4978650075315529277e-7, places=12) self.assertAlmostEqual(astrom.bpn[2][0], 0.001312227200850293372, places=12) self.assertAlmostEqual(astrom.bpn[0][1], -0.1136336652812486604e-7, places=12) self.assertAlmostEqual(astrom.bpn[1][1], 0.9999999995713154865, places=12) self.assertAlmostEqual(astrom.bpn[2][1], -0.2928086230975367296e-4, places=12) self.assertAlmostEqual(astrom.bpn[0][2], -0.001312227201745553566, places=12) self.assertAlmostEqual(astrom.bpn[1][2], 0.2928082218847679162e-4, places=12) self.assertAlmostEqual(astrom.bpn[2][2], 0.9999991386008312212, places=12) self.assertAlmostEqual(astrom.along, -0.5278008060301974337, places=12) self.assertAlmostEqual(astrom.xpl, 0.1133427418174939329e-5, places=17) self.assertAlmostEqual(astrom.ypl, 0.1453347595745898629e-5, places=17) self.assertAlmostEqual(astrom.sphi, -0.9440115679003211329, places=12) self.assertAlmostEqual(astrom.cphi, 0.3299123514971474711, places=12) self.assertAlmostEqual(astrom.diurab, 0, 0) self.assertAlmostEqual(astrom.eral, 2.617608909189066140, places=12) self.assertAlmostEqual(astrom.refa, 0.2014187785940396921e-3, places=15) self.assertAlmostEqual(astrom.refb, -0.2361408314943696227e-6, places=18) self.assertAlmostEqual(eo, -0.003020548354802412839, places=14) def test_apcs(self): date1 = 2456384.5 date2 = 0.970031644 pv = ((-1836024.09,1056607.72,-5998795.26), (-77.0361767,-133.310856,0.0971855934)) ebpv = ((-0.974170438,-0.211520082,-0.0917583024), (0.00364365824,-0.0154287319,-0.00668922024)) ehp = (-0.973458265,-0.209215307,-0.0906996477) astrom = erfa.apcs(date1, date2, pv, ebpv, ehp) self.assertAlmostEqual(astrom.pmt, 13.25248468622587269, places=11) self.assertAlmostEqual(astrom.eb[0], -0.9741827110629881886, places=12) self.assertAlmostEqual(astrom.eb[1], -0.2115130190136415986, places=12) self.assertAlmostEqual(astrom.eb[2], -0.09179840186954412099, places=12) self.assertAlmostEqual(astrom.eh[0], -0.9736425571689454706, places=12) self.assertAlmostEqual(astrom.eh[1], -0.2092452125850435930, places=12) self.assertAlmostEqual(astrom.eh[2], -0.09075578152248299218, places=12) self.assertAlmostEqual(astrom.em, 0.9998233241709796859, places=12) self.assertAlmostEqual(astrom.v[0], 0.2078704993282685510e-4, places=16) self.assertAlmostEqual(astrom.v[1], -0.8955360106989405683e-4, places=16) self.assertAlmostEqual(astrom.v[2], -0.3863338994289409097e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999950277561237, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 1, 0) self.assertAlmostEqual(astrom.bpn[1][0], 0, 0) self.assertAlmostEqual(astrom.bpn[2][0], 0, 0) self.assertAlmostEqual(astrom.bpn[0][1], 0, 0) self.assertAlmostEqual(astrom.bpn[1][1], 1, 0) self.assertAlmostEqual(astrom.bpn[2][1], 0, 0) self.assertAlmostEqual(astrom.bpn[0][2], 0, 0) self.assertAlmostEqual(astrom.bpn[1][2], 0, 0) self.assertAlmostEqual(astrom.bpn[2][2], 1, 0) def test_apcs13(self): date1 = 2456165.5 date2 = 0.401182685 pv = ((-6241497.16,401346.896,-1251136.04), (-29.264597,-455.021831,0.0266151194)) astrom = erfa.apcs13(date1, date2, pv) self.assertAlmostEqual(astrom.pmt, 12.65133794027378508, places=11) self.assertAlmostEqual(astrom.eb[0], 0.9012691529025250644, places=12) self.assertAlmostEqual(astrom.eb[1], -0.4173999812023194317, places=12) self.assertAlmostEqual(astrom.eb[2], -0.1809906511146429670, places=12) self.assertAlmostEqual(astrom.eh[0], 0.8939939101760130792, places=12) self.assertAlmostEqual(astrom.eh[1], -0.4111053891734021478, places=12) self.assertAlmostEqual(astrom.eh[2], -0.1782336880636997374, places=12) self.assertAlmostEqual(astrom.em, 1.010428384373491095, places=12) self.assertAlmostEqual(astrom.v[0], 0.4279877294121697570e-4, places=16) self.assertAlmostEqual(astrom.v[1], 0.7963255087052120678e-4, places=16) self.assertAlmostEqual(astrom.v[2], 0.3517564013384691531e-4, places=16) self.assertAlmostEqual(astrom.bm1, 0.9999999952947980978, places=12) self.assertAlmostEqual(astrom.bpn[0][0], 1, 0) self.assertAlmostEqual(astrom.bpn[1][0], 0, 0) self.assertAlmostEqual(astrom.bpn[2][0], 0, 0) self.assertAlmostEqual(astrom.bpn[0][1], 0, 0) self.assertAlmostEqual(astrom.bpn[1][1], 1, 0) self.assertAlmostEqual(astrom.bpn[2][1], 0, 0) self.assertAlmostEqual(astrom.bpn[0][2], 0, 0) self.assertAlmostEqual(astrom.bpn[1][2], 0, 0) self.assertAlmostEqual(astrom.bpn[2][2], 1, 0) def test_aper(self): theta = 5.678 pmt = 0 eb = (0,0,0) eh = (0,0,0) em = 0 v = (0,0,0) bm1 = 0 bpn = ((0,0,0),(0,0,0),(0,0,0)) along = 1.234 phi, xpl, ypl, sphi, cphi, diurab, eral, refa, refb = 0, 0, 0, 0, 0, 0, 0, 0, 0 astrom = erfa.ASTROM((pmt, eb, eh, em, v, bm1, bpn, along, phi, xpl, ypl, sphi, cphi, diurab, eral, refa, refb)) astrom = erfa.aper(theta, astrom) self.assertAlmostEqual(astrom.eral, 6.912000000000000000, places=12) def test_aper13(self): ut11 = 2456165.5 ut12 = 0.401182685 pmt = 0 eb = (0,0,0) eh = (0,0,0) em = 0 v = (0,0,0) bm1 = 0 bpn = ((0,0,0),(0,0,0),(0,0,0)) along = 1.234 phi, xpl, ypl, sphi, cphi, diurab, eral, refa, refb = 0, 0, 0, 0, 0, 0, 0, 0, 0 astrom = erfa.ASTROM((pmt, eb, eh, em, v, bm1, bpn, along, phi, xpl, ypl, sphi, cphi, diurab, eral, refa, refb)) astrom = erfa.aper13(ut11, ut12, astrom) self.assertAlmostEqual(astrom.eral, 3.316236661789694933, places=12) def test_apio(self): sp = -3.01974337e-11 theta = 3.14540971 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 refa = 0.000201418779 refb = -2.36140831e-7 astrom = erfa.apio(sp, theta, elong, phi, hm, xp, yp, refa, refb) self.assertAlmostEqual(astrom.along, -0.5278008060301974337, places=12) self.assertAlmostEqual(astrom.xpl, 0.1133427418174939329e-5, places=17) self.assertAlmostEqual(astrom.ypl, 0.1453347595745898629e-5, places=17) self.assertAlmostEqual(astrom.sphi, -0.9440115679003211329, places=12) self.assertAlmostEqual(astrom.cphi, 0.3299123514971474711, places=12) self.assertAlmostEqual(astrom.diurab, 0.5135843661699913529e-6, places=12) self.assertAlmostEqual(astrom.eral, 2.617608903969802566, places=12) self.assertAlmostEqual(astrom.refa, 0.2014187790000000000e-3, places=15) self.assertAlmostEqual(astrom.refb, -0.2361408310000000000e-6, places=18) def test_apio13(self): utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 astrom = erfa.apio13(utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(astrom.along, -0.5278008060301974337, places=12) self.assertAlmostEqual(astrom.xpl, 0.1133427418174939329e-5, places=17) self.assertAlmostEqual(astrom.ypl, 0.1453347595745898629e-5, places=17) self.assertAlmostEqual(astrom.sphi, -0.9440115679003211329, places=12) self.assertAlmostEqual(astrom.cphi, 0.3299123514971474711, places=12) self.assertAlmostEqual(astrom.diurab, 0.5135843661699913529e-6, places=12) self.assertAlmostEqual(astrom.eral, 2.617608909189066140, places=12) self.assertAlmostEqual(astrom.refa, 0.2014187785940396921e-3, places=15) self.assertAlmostEqual(astrom.refb, -0.2361408314943696227e-6, places=18) def test_atci13(self): rc = 2.71 dc = 0.174 pr = 1e-5 pd = 5e-6 px = 0.1 rv = 55.0 date1 = 2456165.5 date2 = 0.401182685 ri, di, eo = erfa.atci13(rc, dc, pr, pd, px, rv, date1, date2) self.assertAlmostEqual(ri, 2.710121572969038991, places=12) self.assertAlmostEqual(di, 0.1729371367218230438, places=12) self.assertAlmostEqual(eo, -0.002900618712657375647, places=14) def test_atciq(self): date1 = 2456165.5 date2 = 0.401182685 astrom, eo = erfa.apci13(date1, date2) rc = 2.71 dc = 0.174 pr = 1e-5 pd = 5e-6 px = 0.1 rv = 55.0 ri, di = erfa.atciq(rc, dc, pr, pd, px, rv, *astrom) self.assertAlmostEqual(ri, 2.710121572969038991, places=12) self.assertAlmostEqual(di, 0.1729371367218230438, places=12) def test_atciqn(self): date1 = 2456165.5 date2 = 0.401182685 astrom, eo = erfa.apci13(date1, date2) rc = 2.71 dc = 0.174 pr = 1e-5 pd = 5e-6 px = 0.1 rv = 55.0 b0 = erfa.LDBODY((0.00028574, 3e-10, ((-7.81014427,-5.60956681,-1.98079819), (0.0030723249,-0.00406995477,-0.00181335842)))) b1 = erfa.LDBODY((0.00095435, 3e-9, ((0.738098796, 4.63658692,1.9693136), (-0.00755816922, 0.00126913722, 0.000727999001)))) b2 = erfa.LDBODY((1.0, 6e-6, ((-0.000712174377, -0.00230478303, -0.00105865966), (6.29235213e-6, -3.30888387e-7, -2.96486623e-7)))) b = [b0, b1, b2] ri, di = erfa.atciqn(rc, dc, pr, pd, px, rv, b, *astrom) self.assertAlmostEqual(ri, 2.710122008105325582, places=12) self.assertAlmostEqual(di, 0.1729371916491459122, places=12) def test_atciqz(self): date1 = 2456165.5 date2 = 0.401182685 astrom, eo = erfa.apci13(date1, date2) rc = 2.71 dc = 0.174 ri, di = erfa.atciqz(rc, dc, *astrom) self.assertAlmostEqual(ri, 2.709994899247599271, places=12) self.assertAlmostEqual(di, 0.1728740720983623469, places=12) def test_atco13(self): rc = 2.71 dc = 0.174 pr = 1e-5 pd = 5e-6 px = 0.1 rv = 55.0 utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 aob, zob, hob, dob, rob, eo = erfa.atco13(rc, dc, pr, pd, px, rv, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(aob, 0.09251774485358230653, places=12) self.assertAlmostEqual(zob, 1.407661405256767021, places=12) self.assertAlmostEqual(hob, -0.09265154431403157925, places=12) self.assertAlmostEqual(dob, 0.1716626560075591655, places=12) self.assertAlmostEqual(rob, 2.710260453503097719, places=12) self.assertAlmostEqual(eo, -0.003020548354802412839, places=14) def test_atic13(self): ri = 2.710121572969038991 di = 0.1729371367218230438 date1 = 2456165.5 date2 = 0.401182685 rc, dc, eo = erfa.atic13(ri, di, date1, date2) self.assertAlmostEqual(rc, 2.710126504531374930, places=12) self.assertAlmostEqual(dc, 0.1740632537628342320, places=12) self.assertAlmostEqual(eo, -0.002900618712657375647, places=14) def test_aticq(self): date1 = 2456165.5 date2 = 0.401182685 astrom, eo = erfa.apci13(date1, date2) ri = 2.710121572969038991 di = 0.1729371367218230438 rc, dc = erfa.aticq(ri, di, *astrom) self.assertAlmostEqual(rc, 2.710126504531374930, places=12) self.assertAlmostEqual(dc, 0.1740632537628342320, places=12) def test_aticqn(self): date1 = 2456165.5 date2 = 0.401182685 astrom, eo = erfa.apci13(date1, date2) ri = 2.709994899247599271 di = 0.1728740720983623469 b0 = erfa.LDBODY((0.00028574, 3e-10, ((-7.81014427,-5.60956681,-1.98079819), (0.0030723249,-0.00406995477,-0.00181335842)))) b1 = erfa.LDBODY((0.00095435, 3e-9, ((0.738098796, 4.63658692,1.9693136), (-0.00755816922, 0.00126913722, 0.000727999001)))) b2 = erfa.LDBODY((1.0, 6e-6, ((-0.000712174377, -0.00230478303, -0.00105865966), (6.29235213e-6, -3.30888387e-7, -2.96486623e-7)))) l = [b0, b1, b2] rc, dc = erfa.aticqn(ri, di, l, *astrom) self.assertAlmostEqual(rc, 2.709999575032685412, places=12) self.assertAlmostEqual(dc, 0.1739999656317778034, places=12) def test_atio13(self): ri = 2.710121572969038991 di = 0.1729371367218230438 utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 aob, zob, hob, dob, rob = erfa.atio13(ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(aob, 0.09233952224794989993, places=12) self.assertAlmostEqual(zob, 1.407758704513722461, places=12) self.assertAlmostEqual(hob, -0.09247619879782006106, places=12) self.assertAlmostEqual(dob, 0.1717653435758265198, places=12) self.assertAlmostEqual(rob, 2.710085107986886201, places=12) def test_atioq(self): utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 astrom = erfa.apio13(utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) ri = 2.710121572969038991 di = 0.1729371367218230438 aob, zob, hob, dob, rob = erfa.atioq(ri, di, *astrom) self.assertAlmostEqual(aob, 0.09233952224794989993, places=12) self.assertAlmostEqual(zob, 1.407758704513722461, places=12) self.assertAlmostEqual(hob, -0.09247619879782006106, places=12) self.assertAlmostEqual(dob, 0.1717653435758265198, places=12) self.assertAlmostEqual(rob, 2.710085107986886201, places=12) def test_atoc13(self): utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 ob1 = 2.710085107986886201 ob2 = 0.1717653435758265198 rc, dc = erfa.atoc13("R", ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(rc, 2.709956744661000609, places=12) self.assertAlmostEqual(dc, 0.1741696500895398562, places=12) ob1 = -0.09247619879782006106 ob2 = 0.1717653435758265198 rc, dc = erfa.atoc13("H", ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(rc, 2.709956744661000609, places=12) self.assertAlmostEqual(dc, 0.1741696500895398562, places=12) ob1 = 0.09233952224794989993 ob2 = 1.407758704513722461 rc, dc = erfa.atoc13("A", ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(rc, 2.709956744661000609, places=12) self.assertAlmostEqual(dc, 0.1741696500895398562, places=12) def test_atoi13(self): utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 ob1 = 2.710085107986886201 ob2 = 0.1717653435758265198 ri, di = erfa.atoi13("R", ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(ri, 2.710121574449135955, places=12) self.assertAlmostEqual(di, 0.1729371839114567725, places=12) ob1 = -0.09247619879782006106 ob2 = 0.1717653435758265198 ri, di = erfa.atoi13("H", ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(ri, 2.710121574449135955, places=12) self.assertAlmostEqual(di, 0.1729371839114567725, places=12) ob1 = 0.09233952224794989993 ob2 = 1.407758704513722461 ri, di = erfa.atoi13("A", ob1, ob2, utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) self.assertAlmostEqual(ri, 2.710121574449135955, places=12) self.assertAlmostEqual(di, 0.1729371839114567728, places=12) def test_atoiq(self): utc1 = 2456384.5 utc2 = 0.969254051 dut1 = 0.1550675 elong = -0.527800806 phi = -1.2345856 hm = 2738.0 xp = 2.47230737e-7 yp = 1.82640464e-6 phpa = 731.0 tc = 12.8 rh = 0.59 wl = 0.55 astrom = erfa.apio13(utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl) ob1 = 2.710085107986886201 ob2 = 0.1717653435758265198 ri, di = erfa.atoiq("R", ob1, ob2, *astrom) self.assertAlmostEqual(ri, 2.710121574449135955, places=12) self.assertAlmostEqual(di, 0.1729371839114567725, places=12) ob1 = -0.09247619879782006106 ob2 = 0.1717653435758265198 ri, di = erfa.atoiq("H", ob1, ob2, *astrom) self.assertAlmostEqual(ri, 2.710121574449135955, places=12) self.assertAlmostEqual(di, 0.1729371839114567725, places=12) ob1 = 0.09233952224794989993 ob2 = 1.407758704513722461 ri, di = erfa.atoiq("A", ob1, ob2, *astrom) self.assertAlmostEqual(ri, 2.710121574449135955, places=12) self.assertAlmostEqual(di, 0.1729371839114567728, places=12) def test_ld(self): bm = 0.00028574 p = (-0.763276255, -0.608633767, -0.216735543) q = (-0.763276255, -0.608633767, -0.216735543) e = (0.76700421, 0.605629598, 0.211937094) em = 8.91276983 dlim = 3e-10 p1 = erfa.ld(bm, p, q, e, em, dlim) self.assertAlmostEqual(p1[0], -0.7632762548968159627, places=12) self.assertAlmostEqual(p1[1], -0.6086337670823762701, places=12) self.assertAlmostEqual(p1[2], -0.2167355431320546947, places=12) def test_ldn(self): ob = (-0.974170437, -0.2115201, -0.0917583114) sc = (-0.763276255, -0.608633767, -0.216735543) b0 = erfa.LDBODY((0.00028574, 3e-10, ((-7.81014427,-5.60956681,-1.98079819), (0.0030723249,-0.00406995477,-0.00181335842)))) b1 = erfa.LDBODY((0.00095435, 3e-9, ((0.738098796, 4.63658692,1.9693136), (-0.00755816922, 0.00126913722, 0.000727999001)))) b2 = erfa.LDBODY((1.0, 6e-6, ((-0.000712174377, -0.00230478303, -0.00105865966), (6.29235213e-6, -3.30888387e-7, -2.96486623e-7)))) l = [b0, b1, b2] sn = erfa.ldn(l, ob, sc) self.assertAlmostEqual(sn[0], -0.7632762579693333866, places=12) self.assertAlmostEqual(sn[1], -0.6086337636093002660, places=12) self.assertAlmostEqual(sn[2], -0.2167355420646328159, places=12) def test_ldsun(self): p = (-0.763276255, -0.608633767, -0.216735543) e = (-0.973644023, -0.20925523, -0.0907169552) em = 0.999809214 p1 = erfa.ldsun(p, e, em) self.assertAlmostEqual(p1[0], -0.7632762580731413169, places=12) self.assertAlmostEqual(p1[1], -0.6086337635262647900, places=12) self.assertAlmostEqual(p1[2], -0.2167355419322321302, places=12) def test_pmpx(self): rc = 1.234 dc = 0.789 pr = 1e-5 pd = -2e-5 px = 1e-2 rv = 10.0 pmt = 8.75 pob = (0.9, 0.4, 0.1) pco = erfa.pmpx(rc, dc, pr, pd, px, rv, pmt, pob) self.assertAlmostEqual(pco[0], 0.2328137623960308440, places=12) self.assertAlmostEqual(pco[1], 0.6651097085397855317, places=12) self.assertAlmostEqual(pco[2], 0.7095257765896359847, places=12) def test_pmsafe(self): ra1 = 1.234 dec1 = 0.789 pmr1 = 1e-5 pmd1 = -2e-5 px1 = 1e-2 rv1 = 10.0 ep1a = 2400000.5 ep1b = 48348.5625 ep2a = 2400000.5 ep2b = 51544.5 ra2, dec2, pmr2, pmd2, px2, rv2 = erfa.pmsafe(ra1, dec1, pmr1, pmd1, px1, rv1, ep1a, ep1b, ep2a, ep2b) self.assertAlmostEqual(ra2, 1.234087484501017061, places=12) self.assertAlmostEqual(dec2, 0.7888249982450468567, places=12) self.assertAlmostEqual(pmr2, 0.9996457663586073988e-5, places=12) self.assertAlmostEqual(pmd2, -0.2000040085106754565e-4, places=16) self.assertAlmostEqual(px2, 0.9999997295356830666e-2, places=12) self.assertAlmostEqual(rv2, 10.38468380293920069, places=10) def test_pvtob(self): elong = 2.0 phi = 0.5 hm = 3000.0 xp = 1e-6 yp = -0.5e-6 sp = 1e-8 theta = 5.0 pv = erfa.pvtob(elong, phi, hm, xp, yp, sp, theta) self.assertAlmostEqual(pv[0][0], 4225081.367071159207, places=5) self.assertAlmostEqual(pv[0][1], 3681943.215856198144, places=5) self.assertAlmostEqual(pv[0][2], 3041149.399241260785, places=5) self.assertAlmostEqual(pv[1][0], -268.4915389365998787, places=9) self.assertAlmostEqual(pv[1][1], 308.0977983288903123, places=9) self.assertAlmostEqual(pv[1][2], 0, 0) def test_refco(self): phpa = 800.0 tc = 10.0 rh = 0.9 wl = 0.4 refa, refb = erfa.refco(phpa, tc, rh, wl) self.assertAlmostEqual(refa, 0.2264949956241415009e-3, places=15) self.assertAlmostEqual(refb, -0.2598658261729343970e-6, places=18) ## astronomy library def test_bi00(self): dp, de, dr = erfa.bi00() self.assertAlmostEqual(dp, -0.2025309152835086613e-6, places=15) self.assertAlmostEqual(de, -0.3306041454222147847e-7, places=15) self.assertAlmostEqual(dr, -0.7078279744199225506e-7, places=15) def test_bp00(self): rb, rp,rbp = erfa.bp00(2400000.5, 50123.9999) self.assertAlmostEqual(rb[0][0], 0.9999999999999942498, places=12) self.assertAlmostEqual(rb[0][1], -0.7078279744199196626e-7, places=16) self.assertAlmostEqual(rb[0][2], 0.8056217146976134152e-7, places=16) self.assertAlmostEqual(rb[1][0], 0.7078279477857337206e-7, places=16) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3306041454222136517e-7, places=16) self.assertAlmostEqual(rb[2][0], -0.8056217380986972157e-7, places=16) self.assertAlmostEqual(rb[2][1], -0.3306040883980552500e-7, places=16) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999995504864048241, places=12) self.assertAlmostEqual(rp[0][1], 0.8696113836207084411e-3, places=14) self.assertAlmostEqual(rp[0][2], 0.3778928813389333402e-3, places=14) self.assertAlmostEqual(rp[1][0], -0.8696113818227265968e-3, places=14) self.assertAlmostEqual(rp[1][1], 0.9999996218879365258, places=12) self.assertAlmostEqual(rp[1][2], -0.1690679263009242066e-6, places=14) self.assertAlmostEqual(rp[2][0], -0.3778928854764695214e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.1595521004195286491e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999999285984682756, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999995505175087260, places=12) self.assertAlmostEqual(rbp[0][1], 0.8695405883617884705e-3, places=14) self.assertAlmostEqual(rbp[0][2], 0.3779734722239007105e-3, places=14) self.assertAlmostEqual(rbp[1][0], -0.8695405990410863719e-3, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999996219494925900, places=12) self.assertAlmostEqual(rbp[1][2], -0.1360775820404982209e-6, places=14) self.assertAlmostEqual(rbp[2][0], -0.3779734476558184991e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.1925857585832024058e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999999285680153377, places=12) def test_bp06(self): rb, rp,rbp = erfa.bp06(2400000.5, 50123.9999) self.assertAlmostEqual(rb[0][0], 0.9999999999999942497, places=12) self.assertAlmostEqual(rb[0][1], -0.7078368960971557145e-7, places=14) self.assertAlmostEqual(rb[0][2], 0.8056213977613185606e-7, places=14) self.assertAlmostEqual(rb[1][0], 0.7078368694637674333e-7, places=14) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3305943742989134124e-7, places=14) self.assertAlmostEqual(rb[2][0], -0.8056214211620056792e-7, places=14) self.assertAlmostEqual(rb[2][1], -0.3305943172740586950e-7, places=14) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999995504864960278, places=12) self.assertAlmostEqual(rp[0][1], 0.8696112578855404832e-3, places=14) self.assertAlmostEqual(rp[0][2], 0.3778929293341390127e-3, places=14) self.assertAlmostEqual(rp[1][0], -0.8696112560510186244e-3, places=14) self.assertAlmostEqual(rp[1][1], 0.9999996218880458820, places=12) self.assertAlmostEqual(rp[1][2], -0.1691646168941896285e-6, places=14) self.assertAlmostEqual(rp[2][0], -0.3778929335557603418e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.1594554040786495076e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999999285984501222, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999995505176007047, places=12) self.assertAlmostEqual(rbp[0][1], 0.8695404617348208406e-3, places=14) self.assertAlmostEqual(rbp[0][2], 0.3779735201865589104e-3, places=14) self.assertAlmostEqual(rbp[1][0], -0.8695404723772031414e-3, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999996219496027161, places=12) self.assertAlmostEqual(rbp[1][2], -0.1361752497080270143e-6, places=14) self.assertAlmostEqual(rbp[2][0], -0.3779734957034089490e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.1924880847894457113e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999999285679971958, places=12) def test_bpn2xy(self): rbpn = ((9.999962358680738e-1,-2.516417057665452e-3,-1.093569785342370e-3), (2.516462370370876e-3,9.999968329010883e-1,4.006159587358310e-5), (1.093465510215479e-3,-4.281337229063151e-5,9.999994012499173e-1)) x, y = erfa.bpn2xy(rbpn) self.assertAlmostEqual(x, 1.093465510215479e-3, places=12) self.assertAlmostEqual(y, -4.281337229063151e-5, places=12) def test_c2i00a(self): rc2i = erfa.c2i00a(2400000.5, 53736.0) self.assertAlmostEqual(rc2i[0][0], 0.9999998323037165557, places=12) self.assertAlmostEqual(rc2i[0][1], 0.5581526348992140183e-9, places=12) self.assertAlmostEqual(rc2i[0][2], -0.5791308477073443415e-3, places=12) self.assertAlmostEqual(rc2i[1][0], -0.2384266227870752452e-7, places=12) self.assertAlmostEqual(rc2i[1][1], 0.9999999991917405258, places=12) self.assertAlmostEqual(rc2i[1][2], -0.4020594955028209745e-4, places=12) self.assertAlmostEqual(rc2i[2][0], 0.5791308472168152904e-3, places=12) self.assertAlmostEqual(rc2i[2][1], 0.4020595661591500259e-4, places=12) self.assertAlmostEqual(rc2i[2][2], 0.9999998314954572304, places=12) def test_c2i00b(self): rc2i = erfa.c2i00b(2400000.5, 53736.0) self.assertAlmostEqual(rc2i[0][0], 0.9999998323040954356, places=12) self.assertAlmostEqual(rc2i[0][1], 0.5581526349131823372e-9, places=12) self.assertAlmostEqual(rc2i[0][2], -0.5791301934855394005e-3, places=12) self.assertAlmostEqual(rc2i[1][0], -0.2384239285499175543e-7, places=12) self.assertAlmostEqual(rc2i[1][1], 0.9999999991917574043, places=12) self.assertAlmostEqual(rc2i[1][2], -0.4020552974819030066e-4, places=12) self.assertAlmostEqual(rc2i[2][0], 0.5791301929950208873e-3, places=12) self.assertAlmostEqual(rc2i[2][1], 0.4020553681373720832e-4, places=12) self.assertAlmostEqual(rc2i[2][2], 0.9999998314958529887, places=12) def test_c2i06a(self): rc2i = erfa.c2i06a(2400000.5, 53736.0) self.assertAlmostEqual(rc2i[0][0], 0.9999998323037159379, places=12) self.assertAlmostEqual(rc2i[0][1], 0.5581121329587613787e-9, places=12) self.assertAlmostEqual(rc2i[0][2], -0.5791308487740529749e-3, places=12) self.assertAlmostEqual(rc2i[1][0], -0.2384253169452306581e-7, places=12) self.assertAlmostEqual(rc2i[1][1], 0.9999999991917467827, places=12) self.assertAlmostEqual(rc2i[1][2], -0.4020579392895682558e-4, places=12) self.assertAlmostEqual(rc2i[2][0], 0.5791308482835292617e-3, places=12) self.assertAlmostEqual(rc2i[2][1], 0.4020580099454020310e-4, places=12) self.assertAlmostEqual(rc2i[2][2], 0.9999998314954628695, places=12) def test_c2ibpn(self): rbpn = ((9.999962358680738e-1,-2.516417057665452e-3,-1.093569785342370e-3), (2.516462370370876e-3,9.999968329010883e-1,4.006159587358310e-5), (1.093465510215479e-3,-4.281337229063151e-5,9.999994012499173e-1)) rc2i=erfa.c2ibpn(2400000.5, 50123.9999, rbpn) self.assertAlmostEqual(rc2i[0][0], 0.9999994021664089977, places=12) self.assertAlmostEqual(rc2i[0][1], -0.3869195948017503664e-8, places=12) self.assertAlmostEqual(rc2i[0][2], -0.1093465511383285076e-2, places=12) self.assertAlmostEqual(rc2i[1][0], 0.5068413965715446111e-7, places=12) self.assertAlmostEqual(rc2i[1][1], 0.9999999990835075686, places=12) self.assertAlmostEqual(rc2i[1][2], 0.4281334246452708915e-4, places=12) self.assertAlmostEqual(rc2i[2][0], 0.1093465510215479000e-2, places=12) self.assertAlmostEqual(rc2i[2][1], -0.4281337229063151000e-4, places=12) self.assertAlmostEqual(rc2i[2][2], 0.9999994012499173103, places=12) def test_c2ixy(self): x = 0.5791308486706011000e-3 y = 0.4020579816732961219e-4 rc2i = erfa.c2ixy(2400000.5, 53736, x, y) self.assertAlmostEqual(rc2i[0][0], 0.9999998323037157138, places=12) self.assertAlmostEqual(rc2i[0][1], 0.5581526349032241205e-9, places=12) self.assertAlmostEqual(rc2i[0][2], -0.5791308491611263745e-3, places=12) self.assertAlmostEqual(rc2i[1][0], -0.2384257057469842953e-7, places=12) self.assertAlmostEqual(rc2i[1][1], 0.9999999991917468964, places=12) self.assertAlmostEqual(rc2i[1][2], -0.4020579110172324363e-4, places=12) self.assertAlmostEqual(rc2i[2][0], 0.5791308486706011000e-3, places=12) self.assertAlmostEqual(rc2i[2][1], 0.4020579816732961219e-4, places=12) self.assertAlmostEqual(rc2i[2][2], 0.9999998314954627590, places=12) def test_c2ixys(self): x = 0.5791308486706011000e-3 y = 0.4020579816732961219e-4 s = -0.1220040848472271978e-7 rc2i = erfa.c2ixys(x, y, s) self.assertAlmostEqual(rc2i[0][0], 0.9999998323037157138, places=12) self.assertAlmostEqual(rc2i[0][1], 0.5581984869168499149e-9, places=12) self.assertAlmostEqual(rc2i[0][2], -0.5791308491611282180e-3, places=12) self.assertAlmostEqual(rc2i[1][0], -0.2384261642670440317e-7, places=12) self.assertAlmostEqual(rc2i[1][1], 0.9999999991917468964, places=12) self.assertAlmostEqual(rc2i[1][2], -0.4020579110169668931e-4, places=12) self.assertAlmostEqual(rc2i[2][0], 0.5791308486706011000e-3, places=12) self.assertAlmostEqual(rc2i[2][1], 0.4020579816732961219e-4, places=12) self.assertAlmostEqual(rc2i[2][2], 0.9999998314954627590, places=12) def test_c2t00a(self): tta = 2400000.5 uta = 2400000.5 ttb = 53736.0 utb = 53736.0 xp = 2.55060238e-7 yp = 1.860359247e-6 rc2t = erfa.c2t00a(tta, ttb, uta, utb, xp, yp) self.assertAlmostEqual(rc2t[0][0], -0.1810332128307182668, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9834769806938457836, places=12) self.assertAlmostEqual(rc2t[0][2], 0.6555535638688341725e-4, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834768134135984552, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1810332203649520727, places=12) self.assertAlmostEqual(rc2t[1][2], 0.5749801116141056317e-3, places=12) self.assertAlmostEqual(rc2t[2][0], 0.5773474014081406921e-3, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3961832391770163647e-4, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9999998325501692289, places=12) def test_c2t00b(self): tta = 2400000.5 uta = 2400000.5 ttb = 53736.0 utb = 53736.0 xp = 2.55060238e-7 yp = 1.860359247e-6 rc2t = erfa.c2t00b(tta, ttb, uta, utb, xp, yp) self.assertAlmostEqual(rc2t[0][0], -0.1810332128439678965, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9834769806913872359, places=12) self.assertAlmostEqual(rc2t[0][2], 0.6555565082458415611e-4, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834768134115435923, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1810332203784001946, places=12) self.assertAlmostEqual(rc2t[1][2], 0.5749793922030017230e-3, places=12) self.assertAlmostEqual(rc2t[2][0], 0.5773467471863534901e-3, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3961790411549945020e-4, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9999998325505635738, places=12) def test_c2t06a(self): tta = 2400000.5 uta = 2400000.5 ttb = 53736.0 utb = 53736.0 xp = 2.55060238e-7 yp = 1.860359247e-6 rc2t = erfa.c2t06a(tta, ttb, uta, utb, xp, yp) self.assertAlmostEqual(rc2t[0][0], -0.1810332128305897282, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9834769806938592296, places=12) self.assertAlmostEqual(rc2t[0][2], 0.6555550962998436505e-4, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834768134136214897, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1810332203649130832, places=12) self.assertAlmostEqual(rc2t[1][2], 0.5749800844905594110e-3, places=12) self.assertAlmostEqual(rc2t[2][0], 0.5773474024748545878e-3, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3961816829632690581e-4, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9999998325501747785, places=12) def test_c2tcio(self): c = ((0.9999998323037164738,0.5581526271714303683e-9,-0.5791308477073443903e-3), (-0.2384266227524722273e-7,0.9999999991917404296,-0.4020594955030704125e-4), (0.5791308472168153320e-3,.4020595661593994396e-4,0.9999998314954572365)) era = 1.75283325530307 p = ((0.9999999999999674705,-0.1367174580728847031e-10,0.2550602379999972723e-6), (0.1414624947957029721e-10,0.9999999999982694954,-0.1860359246998866338e-5), (-0.2550602379741215275e-6,0.1860359247002413923e-5,0.9999999999982369658)) rc2t = erfa.c2tcio(c,era,p) self.assertAlmostEqual(rc2t[0][0], -0.1810332128307110439, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9834769806938470149, places=12) self.assertAlmostEqual(rc2t[0][2], 0.6555535638685466874e-4, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834768134135996657, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1810332203649448367, places=12) self.assertAlmostEqual(rc2t[1][2], 0.5749801116141106528e-3, places=12) self.assertAlmostEqual(rc2t[2][0], 0.5773474014081407076e-3, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3961832391772658944e-4, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9999998325501691969, places=12) def test_c2teqx(self): c = ((0.9999989440476103608,-0.1332881761240011518e-2,-0.5790767434730085097e-3), (0.1332858254308954453e-2,0.9999991109044505944,-0.4097782710401555759e-4), (0.5791308472168153320e-3,0.4020595661593994396e-4,0.9999998314954572365)) gst = 1.754166138040730516 p = ((0.9999999999999674705,-0.1367174580728847031e-10,0.2550602379999972723e-6), (0.1414624947957029721e-10,0.9999999999982694954,-0.1860359246998866338e-5), (-0.2550602379741215275e-6,0.1860359247002413923e-5,0.9999999999982369658)) rc2t = erfa.c2teqx(c,gst,p) self.assertAlmostEqual(rc2t[0][0], -0.1810332128528685730, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9834769806897685071, places=12) self.assertAlmostEqual(rc2t[0][2], 0.6555535639982634449e-4, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834768134095211257, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1810332203871023800, places=12) self.assertAlmostEqual(rc2t[1][2], 0.5749801116126438962e-3, places=12) self.assertAlmostEqual(rc2t[2][0], 0.5773474014081539467e-3, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3961832391768640871e-4, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9999998325501691969, places=12) def test_c2tpe(self): tta = 2400000.5 uta = 2400000.5 ttb = 53736.0 utb = 53736.0 deps = 0.4090789763356509900 dpsi = -0.9630909107115582393e-5 xp = 2.55060238e-7 yp = 1.860359247e-6 rc2t = erfa.c2tpe(tta, ttb, uta, utb, dpsi, deps, xp, yp) self.assertAlmostEqual(rc2t[0][0], -0.1813677995763029394, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9023482206891683275, places=12) self.assertAlmostEqual(rc2t[0][2], -0.3909902938641085751, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834147641476804807, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1659883635434995121, places=12) self.assertAlmostEqual(rc2t[1][2], 0.7309763898042819705e-1, places=12) self.assertAlmostEqual(rc2t[2][0], 0.1059685430673215247e-2, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3977631855605078674, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9174875068792735362, places=12) def test_c2txy(self): tta = 2400000.5 uta = 2400000.5 ttb = 53736.0 utb = 53736.0 x = 0.5791308486706011000e-3 y = 0.4020579816732961219e-4 xp = 2.55060238e-7 yp = 1.860359247e-6; rc2t = erfa.c2txy(tta, ttb, uta, utb, x, y, xp, yp) self.assertAlmostEqual(rc2t[0][0], -0.1810332128306279253, places=12) self.assertAlmostEqual(rc2t[0][1], 0.9834769806938520084, places=12) self.assertAlmostEqual(rc2t[0][2], 0.6555551248057665829e-4, places=12) self.assertAlmostEqual(rc2t[1][0], -0.9834768134136142314, places=12) self.assertAlmostEqual(rc2t[1][1], -0.1810332203649529312, places=12) self.assertAlmostEqual(rc2t[1][2], 0.5749800843594139912e-3, places=12) self.assertAlmostEqual(rc2t[2][0], 0.5773474028619264494e-3, places=12) self.assertAlmostEqual(rc2t[2][1], 0.3961816546911624260e-4, places=12) self.assertAlmostEqual(rc2t[2][2], 0.9999998325501746670, places=12) def test_cal2jd(self): dmj0, dmj = erfa.cal2jd(2003, 6, 1) self.assertAlmostEqual(dmj0, 2400000.5, 9) self.assertAlmostEqual(dmj, 52791.0, 9) def test_d2dtf(self): y,m,d,H,M,S,F = erfa.d2dtf(5, 2400000.5, 49533.99999) self.assertEqual(y, 1994) self.assertEqual(m, 6) self.assertEqual(d, 30) self.assertEqual(H, 23) self.assertEqual(M, 59) self.assertEqual(S, 60) self.assertEqual(F, 13599) def test_d2tf(self): c,H,M,S,F = erfa.d2tf(4, -0.987654321) self.assertEqual(c, '-') self.assertEqual(H, 23) self.assertEqual(M, 42) self.assertEqual(S, 13) self.assertEqual(F, 3333) def test_dat(self): d = erfa.dat(2003, 6, 1, 0.0) self.assertAlmostEqual(d, 32.0, 9) d = erfa.dat(2008, 1, 17, 0.0) self.assertAlmostEqual(d, 33.0, 9) d = erfa.dat(2015, 9, 1, 0.0) self.assertAlmostEqual(d, 36.0, 9) d = erfa.dat(2017, 9, 1, 0.0) self.assertAlmostEqual(d, 37.0, 9) def test_dtdb(self): d = erfa.dtdb(2448939.5, 0.123, 0.76543, 5.0123, 5525.242, 3190.0) self.assertAlmostEqual(d, -0.1280368005936998991e-2, 17) def test_dtf2d(self): jd1, jd2 = erfa.dtf2d(1994, 6, 30, 23, 59, 60.13599) self.assertAlmostEqual(jd1+jd2, 2449534.49999, 6) def test_ee00(self): epsa = 0.4090789763356509900 dpsi = -0.9630909107115582393e-5 ee = erfa.ee00(2400000.5, 53736.0, epsa, dpsi) self.assertAlmostEqual(ee, -0.8834193235367965479e-5, 18) def test_ee00a(self): ee = erfa.ee00a(2400000.5, 53736.0) self.assertAlmostEqual(ee, -0.8834192459222588227e-5, 17) ##fail at 18 def test_ee00b(self): ee = erfa.ee00b(2400000.5, 53736.0) self.assertAlmostEqual(ee, -0.8835700060003032831e-5, 18) def test_ee06a(self): ee = erfa.ee06a(2400000.5, 53736.0) self.assertAlmostEqual(ee, -0.8834195072043790156e-5, 15) ##fail at 16 def test_eect00(self): ct = erfa.eect00(2400000.5, 53736.0) self.assertAlmostEqual(ct, 0.2046085004885125264e-8, 20) def test_eform(self): #a, f = erfa.eform(0) self.assertRaises(erfa.error, erfa.eform, 0) a, f = erfa.eform(1) self.assertAlmostEqual(a, 6378137.0, 10) self.assertAlmostEqual(f, 0.3352810664747480720e-2, 18) a, f = erfa.eform(2) self.assertAlmostEqual(a, 6378137.0, 10) self.assertAlmostEqual(f, 0.3352810681182318935e-2, 18) a, f = erfa.eform(3) self.assertAlmostEqual(a, 6378135.0, 10) self.assertAlmostEqual(f, 0.3352779454167504862e-2, 18) #a, f = erfa.eform(4) self.assertRaises(erfa.error, erfa.eform, 4) def test_eo06a(self): eo = erfa.eo06a(2400000.5, 53736.0) self.assertAlmostEqual(eo, -0.1332882371941833644e-2, 15) def test_eors(self): r = ((0.9999989440476103608,-0.1332881761240011518e-2,-0.5790767434730085097e-3), (0.1332858254308954453e-2,0.9999991109044505944,-0.4097782710401555759e-4), (0.5791308472168153320e-3,0.4020595661593994396e-4,0.9999998314954572365)) s = -0.1220040848472271978e-7 eo = erfa.eors(r,s) self.assertAlmostEqual(eo, -0.1332882715130744606e-2, 15) def test_epb(self): b = erfa.epb(2415019.8135, 30103.18648) self.assertAlmostEqual(b, 1982.418424159278580, 12) def test_epb2jd(self): dj0,dj1 = erfa.epb2jd(1957.3) self.assertAlmostEqual(dj0, 2400000.5, 9) self.assertAlmostEqual(dj1, 35948.1915101513, 9) def test_epj(self): j = erfa.epj(2451545, -7392.5) self.assertAlmostEqual(j, 1979.760438056125941, 12) def test_epj2jd(self): dj0,dj1 = erfa.epj2jd(1996.8) self.assertAlmostEqual(dj0, 2400000.5, 9) self.assertAlmostEqual(dj1, 50375.7, 9) def test_epv00(self): pvh,pvb = erfa.epv00(2400000.5, 53411.52501161) self.assertAlmostEqual(pvh[0][0], -0.7757238809297706813, places=14) self.assertAlmostEqual(pvh[0][1], 0.5598052241363340596, places=13) #fail at 14 self.assertAlmostEqual(pvh[0][2], 0.2426998466481686993, places=14) self.assertAlmostEqual(pvh[1][0], -0.1091891824147313846e-1, places=15) self.assertAlmostEqual(pvh[1][1], -0.1247187268440845008e-1, places=15) self.assertAlmostEqual(pvh[1][2], -0.5407569418065039061e-2, places=15) self.assertAlmostEqual(pvb[0][0], -0.7714104440491111971, places=14) self.assertAlmostEqual(pvb[0][1], 0.5598412061824171323, places=13) #fail at 14 self.assertAlmostEqual(pvb[0][2], 0.2425996277722452400, places=14) self.assertAlmostEqual(pvb[1][0], -0.1091874268116823295e-1, places=15) self.assertAlmostEqual(pvb[1][1], -0.1246525461732861538e-1, places=15) self.assertAlmostEqual(pvb[1][2], -0.5404773180966231279e-2, places=15) def test_eqeq94(self): ee = erfa.eqeq94(2400000.5, 41234.0) self.assertAlmostEqual(ee, 0.5357758254609256894e-4, 17) def test_era00(self): era = erfa.era00(2400000.5, 54388.0) self.assertAlmostEqual(era, 0.4022837240028158102, 12) def test_fad03(self): d = erfa.fad03(0.80) self.assertAlmostEqual(d, 1.946709205396925672, 12) def test_fae03(self): e = erfa.fae03(0.80) self.assertAlmostEqual(e, 1.744713738913081846, 12) def test_faf03(self): f = erfa.faf03(0.80) self.assertAlmostEqual(f, 0.2597711366745499518, 11) # failed at 12 def test_faju03(self): l = erfa.faju03(0.80) self.assertAlmostEqual(l, 5.275711665202481138, 12) def test_fal03(self): l = erfa.fal03(0.80) self.assertAlmostEqual(l, 5.132369751108684150, 12) def test_falp03(self): lp = erfa.falp03(0.80) self.assertAlmostEqual(lp, 6.226797973505507345, 12) def test_fama03(self): l = erfa.fama03(0.80) self.assertAlmostEqual(l, 3.275506840277781492, 12) def test_fame03(self): l = erfa.fame03(0.80) self.assertAlmostEqual(l, 5.417338184297289661, 12) def test_fane03(self): l = erfa.fane03(0.80) self.assertAlmostEqual(l, 2.079343830860413523, 12) def test_faom03(self): l = erfa.faom03(0.80) self.assertAlmostEqual(l, -5.973618440951302183, 12) def test_fapa03(self): l = erfa.fapa03(0.80) self.assertAlmostEqual(l, 0.1950884762240000000e-1, 12) def test_fasa03(self): l = erfa.fasa03(0.80) self.assertAlmostEqual(l, 5.371574539440827046, 12) def test_faur03(self): l = erfa.faur03(0.80) self.assertAlmostEqual(l, 5.180636450180413523, 12) def test_fave03(self): l = erfa.fave03(0.80) self.assertAlmostEqual(l, 3.424900460533758000, 12) def test_fk52h(self): r5 = 1.76779433 d5 = -0.2917517103 dr5 = -1.91851572e-7 dd5 = -5.8468475e-6 px5 = 0.379210 rv5 = -7.6 rh, dh, drh, ddh, pxh, rvh = erfa.fk52h(r5, d5, dr5, dd5, px5, rv5) self.assertAlmostEqual(rh, 1.767794226299947632, places=14) self.assertAlmostEqual(dh, -0.2917516070530391757, places=14) self.assertAlmostEqual(drh, -0.19618741256057224e-6, places=19) self.assertAlmostEqual(ddh, -0.58459905176693911e-5, places=19) self.assertAlmostEqual(pxh, 0.37921, places=14) self.assertAlmostEqual(rvh, -7.6000000940000254, places=10) def test_fk5hip(self): r5h, s5h = erfa.fk5hip() self.assertAlmostEqual(r5h[0][0], 0.9999999999999928638, places=14) self.assertAlmostEqual(r5h[0][1], 0.1110223351022919694e-6, places=17) self.assertAlmostEqual(r5h[0][2], 0.4411803962536558154e-7, places=16) # failed at 17 self.assertAlmostEqual(r5h[1][0], -0.1110223308458746430e-6, places=17) self.assertAlmostEqual(r5h[1][1], 0.9999999999999891830, places=14) self.assertAlmostEqual(r5h[1][2], -0.9647792498984142358e-7, places=17) self.assertAlmostEqual(r5h[2][0], -0.4411805033656962252e-7, places=16) # failed at 17 self.assertAlmostEqual(r5h[2][1], 0.9647792009175314354e-7, places=17) self.assertAlmostEqual(r5h[2][2], 0.9999999999999943728, places=14) self.assertAlmostEqual(s5h[0], -0.1454441043328607981e-8, places=17) self.assertAlmostEqual(s5h[1], 0.2908882086657215962e-8, places=17) self.assertAlmostEqual(s5h[2], 0.3393695767766751955e-8, places=17) def test_fk5hz(self): r5 = 1.76779433 d5 = -0.2917517103 rh,dh = erfa.fk5hz(r5,d5,2400000.5, 54479.0) self.assertAlmostEqual(rh, 1.767794191464423978, 12) self.assertAlmostEqual(dh, -0.2917516001679884419, 12) def test_fw2m(self): gamb = -0.2243387670997992368e-5 phib = 0.4091014602391312982 psi = -0.9501954178013015092e-3 eps = 0.4091014316587367472 r = erfa.fw2m(gamb, phib, psi, eps) self.assertAlmostEqual(r[0][0], 0.9999995505176007047, places=12) self.assertAlmostEqual(r[0][1], 0.8695404617348192957e-3, places=12) self.assertAlmostEqual(r[0][2], 0.3779735201865582571e-3, places=12) self.assertAlmostEqual(r[1][0], -0.8695404723772016038e-3, places=12) self.assertAlmostEqual(r[1][1], 0.9999996219496027161, places=12) self.assertAlmostEqual(r[1][2], -0.1361752496887100026e-6, places=12) self.assertAlmostEqual(r[2][0], -0.3779734957034082790e-3, places=12) self.assertAlmostEqual(r[2][1], -0.1924880848087615651e-6, places=12) self.assertAlmostEqual(r[2][2], 0.9999999285679971958, places=12) def test_fw2xy(self): gamb = -0.2243387670997992368e-5 phib = 0.4091014602391312982 psi = -0.9501954178013015092e-3 eps = 0.4091014316587367472 x, y = erfa.fw2xy(gamb, phib, psi, eps) self.assertAlmostEqual(x,-0.3779734957034082790e-3, 14) self.assertAlmostEqual(y,-0.1924880848087615651e-6, 14) def test_gc2gd(self): xyz = (2e6, 3e6, 5.244e6) #e,p,h = erfa.gc2gd(0, xyz) self.assertRaises(erfa.error, erfa.gc2gd, 0, xyz) e,p,h = erfa.gc2gd(1, xyz) self.assertAlmostEqual(e, 0.9827937232473290680, places=14) self.assertAlmostEqual(p, 0.97160184819075459, places=14) self.assertAlmostEqual(h, 331.4172461426059892, places=8) e,p,h = erfa.gc2gd(2, xyz) self.assertAlmostEqual(e, 0.9827937232473290680, places=14) self.assertAlmostEqual(p, 0.97160184820607853, places=14) self.assertAlmostEqual(h, 331.41731754844348, places=8) e,p,h = erfa.gc2gd(3, xyz) self.assertAlmostEqual(e, 0.9827937232473290680, places=14) self.assertAlmostEqual(p, 0.9716018181101511937, places=14) self.assertAlmostEqual(h, 333.2770726130318123, places=8) #e,p,h = erfa.gc2gd(4, xyz) self.assertRaises(erfa.error, erfa.gc2gd, 4, xyz) def test_gc2gde(self): a = 6378136.0 f = 0.0033528 xyz = (2e6, 3e6, 5.244e6) e, p, h = erfa.gc2gde(a, f, xyz) self.assertAlmostEqual(e, 0.9827937232473290680, places=14) self.assertAlmostEqual(p, 0.9716018377570411532, places=14) self.assertAlmostEqual(h, 332.36862495764397, places=8) def test_gd2gc(self): e = 3.1 p = -0.5 h = 2500.0 self.assertRaises(erfa.error, erfa.gd2gc, 0, e, p, h) xyz = erfa.gd2gc(1,e,p,h) self.assertAlmostEqual(xyz[0], -5599000.5577049947, places=7) self.assertAlmostEqual(xyz[1], 233011.67223479203, places=7) self.assertAlmostEqual(xyz[2], -3040909.4706983363, places=7) xyz = erfa.gd2gc(2,e,p,h) self.assertAlmostEqual(xyz[0], -5599000.5577260984, places=7) self.assertAlmostEqual(xyz[1], 233011.6722356703, places=7) self.assertAlmostEqual(xyz[2], -3040909.4706095476, places=7) xyz = erfa.gd2gc(3,e,p,h) self.assertAlmostEqual(xyz[0], -5598998.7626301490, places=7) self.assertAlmostEqual(xyz[1], 233011.5975297822, places=7) self.assertAlmostEqual(xyz[2], -3040908.6861467111, places=7) self.assertRaises(erfa.error, erfa.gd2gc, 4, e, p, h) def test_gd2gce(self): a = 6378136.0 f = 0.0033528 e = 3.1 p = -0.5 h = 2500.0 xyz = erfa.gd2gce(a, f, e, p, h) self.assertAlmostEqual(xyz[0], -5598999.6665116328, places=7) self.assertAlmostEqual(xyz[1], 233011.63514630572, places=7) self.assertAlmostEqual(xyz[2], -3040909.0517314132, places=7) def test_gmst00(self): g = erfa.gmst00(2400000.5, 53736.0, 2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754174972210740592, 14) def test_gmst06(self): g = erfa.gmst06(2400000.5, 53736.0, 2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754174971870091203, 14) def test_gmst82(self): g = erfa.gmst82(2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754174981860675096, 14) def test_gst00a(self): g = erfa.gst00a(2400000.5, 53736.0, 2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754166138018281369, 14) def test_gst00b(self): g = erfa.gst00b(2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754166136510680589, 14) def test_gst06(self): rnpb = ((0.9999989440476103608,-0.1332881761240011518e-2,-0.5790767434730085097e-3), (0.1332858254308954453e-2,0.9999991109044505944,-0.4097782710401555759e-4), (0.5791308472168153320e-3,0.4020595661593994396e-4,0.9999998314954572365)) g = erfa.gst06(2400000.5, 53736.0, 2400000.5, 53736.0, rnpb) self.assertAlmostEqual(g, 1.754166138018167568, 14) def test_gst06a(self): g = erfa.gst06a(2400000.5, 53736.0, 2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754166137675019159, 14) def test_gst94(self): g = erfa.gst94(2400000.5, 53736.0) self.assertAlmostEqual(g, 1.754166136020645203, 14) def test_h2fk5(self): rh = 1.767794352 dh = -0.2917512594 drh = -2.76413026e-6 ddh = -5.92994449e-6 pxh = 0.379210 rvh = -7.6; r5, d5, dr5, dd5, px5, rv5 = erfa.h2fk5(rh, dh, drh, ddh, pxh, rvh) self.assertAlmostEqual(r5, 1.767794455700065506, places=13) self.assertAlmostEqual(d5, -0.2917513626469638890, places=13) self.assertAlmostEqual(dr5, -0.27597945024511204e-5, places=18) self.assertAlmostEqual(dd5, -0.59308014093262838e-5, places=18) self.assertAlmostEqual(px5, 0.37921, places=13) self.assertAlmostEqual(rv5, -7.6000001309071126, places=10) def test_hfk5z(self): rh = 1.767794352 dh = -0.2917512594 r5, d5, dr5, dd5 = erfa.hfk5z(rh, dh, 2400000.5, 54479.0) self.assertAlmostEqual(r5, 1.767794490535581026, places=13) self.assertAlmostEqual(d5, -0.2917513695320114258, places=14) self.assertAlmostEqual(dr5, 0.4335890983539243029e-8, places=22) self.assertAlmostEqual(dd5, -0.8569648841237745902e-9, places=23) def test_jd2cal(self): y, m, d, fd = erfa.jd2cal(2400000.5, 50123.9999) self.assertEqual(y, 1996) self.assertEqual(m, 2) self.assertEqual(d, 10) self.assertAlmostEqual(fd, 0.9999, 7) def test_jdcalf(self): y, m, d, fd = erfa.jdcalf(4, 2400000.5, 50123.9999) self.assertEqual(y, 1996) self.assertEqual(m, 2) self.assertEqual(d, 10) self.assertEqual(fd, 9999) def test_num00a(self): rmatn = erfa.num00a(2400000.5, 53736.0) self.assertAlmostEqual(rmatn[0][0], 0.9999999999536227949, places=12) self.assertAlmostEqual(rmatn[0][1], 0.8836238544090873336e-5, places=12) self.assertAlmostEqual(rmatn[0][2], 0.3830835237722400669e-5, places=12) self.assertAlmostEqual(rmatn[1][0], -0.8836082880798569274e-5, places=12) self.assertAlmostEqual(rmatn[1][1], 0.9999999991354655028, places=12) self.assertAlmostEqual(rmatn[1][2], -0.4063240865362499850e-4, places=12) self.assertAlmostEqual(rmatn[2][0], -0.3831194272065995866e-5, places=12) self.assertAlmostEqual(rmatn[2][1], 0.4063237480216291775e-4, places=12) self.assertAlmostEqual(rmatn[2][2], 0.9999999991671660338, places=12) def test_num00b(self): rmatn = erfa.num00b(2400000.5, 53736.0) self.assertAlmostEqual(rmatn[0][0], 0.9999999999536069682, places=12) self.assertAlmostEqual(rmatn[0][1], 0.8837746144871248011e-5, places=12) self.assertAlmostEqual(rmatn[0][2], 0.3831488838252202945e-5, places=12) self.assertAlmostEqual(rmatn[1][0], -0.8837590456632304720e-5, places=12) self.assertAlmostEqual(rmatn[1][1], 0.9999999991354692733, places=12) self.assertAlmostEqual(rmatn[1][2], -0.4063198798559591654e-4, places=12) self.assertAlmostEqual(rmatn[2][0], -0.3831847930134941271e-5, places=12) self.assertAlmostEqual(rmatn[2][1], 0.4063195412258168380e-4, places=12) self.assertAlmostEqual(rmatn[2][2], 0.9999999991671806225, places=12) def test_num06a(self): rmatn = erfa.num06a(2400000.5, 53736) self.assertAlmostEqual(rmatn[0][0], 0.9999999999536227668, places=12) self.assertAlmostEqual(rmatn[0][1], 0.8836241998111535233e-5, places=12) self.assertAlmostEqual(rmatn[0][2], 0.3830834608415287707e-5, places=12) self.assertAlmostEqual(rmatn[1][0], -0.8836086334870740138e-5, places=12) self.assertAlmostEqual(rmatn[1][1], 0.9999999991354657474, places=12) self.assertAlmostEqual(rmatn[1][2], -0.4063240188248455065e-4, places=12) self.assertAlmostEqual(rmatn[2][0], -0.3831193642839398128e-5, places=12) self.assertAlmostEqual(rmatn[2][1], 0.4063236803101479770e-4, places=12) self.assertAlmostEqual(rmatn[2][2], 0.9999999991671663114, places=12) def test_numat(self): epsa = 0.4090789763356509900 dpsi = -0.9630909107115582393e-5 deps = 0.4063239174001678826e-4 rmatn = erfa.numat(epsa, dpsi, deps) self.assertAlmostEqual(rmatn[0][0], 0.9999999999536227949, places=12) self.assertAlmostEqual(rmatn[0][1], 0.8836239320236250577e-5, places=12) self.assertAlmostEqual(rmatn[0][2], 0.3830833447458251908e-5, places=12) self.assertAlmostEqual(rmatn[1][0], -0.8836083657016688588e-5, places=12) self.assertAlmostEqual(rmatn[1][1], 0.9999999991354654959, places=12) self.assertAlmostEqual(rmatn[1][2], -0.4063240865361857698e-4, places=12) self.assertAlmostEqual(rmatn[2][0], -0.3831192481833385226e-5, places=12) self.assertAlmostEqual(rmatn[2][1], 0.4063237480216934159e-4, places=12) self.assertAlmostEqual(rmatn[2][2], 0.9999999991671660407, places=12) def test_nut00a(self): dpsi, deps = erfa.nut00a(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9630909107115518431e-5, 13) self.assertAlmostEqual(deps, 0.4063239174001678710e-4, 13) def test_nut00b(self): dpsi, deps = erfa.nut00b(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9632552291148362783e-5, 13) self.assertAlmostEqual(deps, 0.4063197106621159367e-4, 13) def test_nut06a(self): dpsi, deps = erfa.nut06a(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9630912025820308797e-5, 13) self.assertAlmostEqual(deps, 0.4063238496887249798e-4, 13) def test_nut80(self): dpsi, deps = erfa.nut80(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9643658353226563966e-5, 13) self.assertAlmostEqual(deps, 0.4060051006879713322e-4, 13) def test_nutm80(self): rmatn = erfa.nutm80(2400000.5, 53736) self.assertAlmostEqual(rmatn[0][0], 0.9999999999534999268, places=12) self.assertAlmostEqual(rmatn[0][1], 0.8847935789636432161e-5, places=12) self.assertAlmostEqual(rmatn[0][2], 0.3835906502164019142e-5, places=12) self.assertAlmostEqual(rmatn[1][0], -0.8847780042583435924e-5, places=12) self.assertAlmostEqual(rmatn[1][1], 0.9999999991366569963, places=12) self.assertAlmostEqual(rmatn[1][2], -0.4060052702727130809e-4, places=12) self.assertAlmostEqual(rmatn[2][0], -0.3836265729708478796e-5, places=12) self.assertAlmostEqual(rmatn[2][1], 0.4060049308612638555e-4, places=12) self.assertAlmostEqual(rmatn[2][2], 0.9999999991684415129, places=12) def test_obl06(self): obl = erfa.obl06(2400000.5, 54388.0) self.assertAlmostEqual(obl, 0.4090749229387258204, 14) def test_obl80(self): obl = erfa.obl80(2400000.5, 54388.0) self.assertAlmostEqual(obl, 0.4090751347643816218, 14) def test_p06e(self): eps0,psia,oma,bpa,bqa,pia,bpia,epsa,chia,za,zetaa,thetaa,pa,gam,phi,psi = erfa.p06e(2400000.5, 52541.0) self.assertAlmostEqual(eps0, 0.4090926006005828715, places=14) self.assertAlmostEqual(psia, 0.6664369630191613431e-3, places=14) self.assertAlmostEqual(oma , 0.4090925973783255982, places=14) self.assertAlmostEqual(bpa, 0.5561149371265209445e-6, places=14) self.assertAlmostEqual(bqa, -0.6191517193290621270e-5, places=14) self.assertAlmostEqual(pia, 0.6216441751884382923e-5, places=14) self.assertAlmostEqual(bpia, 3.052014180023779882, places=14) self.assertAlmostEqual(epsa, 0.4090864054922431688, places=14) self.assertAlmostEqual(chia, 0.1387703379530915364e-5, places=14) self.assertAlmostEqual(za, 0.2921789846651790546e-3, places=14) self.assertAlmostEqual(zetaa, 0.3178773290332009310e-3, places=14) self.assertAlmostEqual(thetaa, 0.2650932701657497181e-3, places=14) self.assertAlmostEqual(pa, 0.6651637681381016344e-3, places=14) self.assertAlmostEqual(gam, 0.1398077115963754987e-5, places=14) self.assertAlmostEqual(phi, 0.4090864090837462602, places=14) self.assertAlmostEqual(psi, 0.6664464807480920325e-3, places=14) def test_pb06(self): bzeta, bz, btheta = erfa.pb06(2400000.5, 50123.9999) self.assertAlmostEqual(bzeta, -0.5092634016326478238e-3, places=12) self.assertAlmostEqual(bz, -0.3602772060566044413e-3, places=12) self.assertAlmostEqual(btheta, -0.3779735537167811177e-3, places=12) def test_pfw06(self): gamb, phib, psib, epsa = erfa.pfw06(2400000.5, 50123.9999) self.assertAlmostEqual(gamb, -0.2243387670997995690e-5, places=16) self.assertAlmostEqual(phib, 0.4091014602391312808, places=12) self.assertAlmostEqual(psib, -0.9501954178013031895e-3, places=14) self.assertAlmostEqual(epsa, 0.4091014316587367491, places=12) def test_plan94(self): self.assertRaises(erfa.error, erfa.plan94, 2400000.5, -320000, 0) self.assertRaises(erfa.error, erfa.plan94, 2400000.5, -320000, 10) ##self.assertRaises(erfa.error, erfa.plan94, 2400000.5, -320000, 3) pv = erfa.plan94(2400000.5, -320000, 3) self.assertAlmostEqual(pv[0][0], 0.9308038666832975759, places=11) self.assertAlmostEqual(pv[0][1], 0.3258319040261346000, places=11) self.assertAlmostEqual(pv[0][2], 0.1422794544481140560, places=11) self.assertAlmostEqual(pv[1][0], -0.6429458958255170006e-2, places=11) self.assertAlmostEqual(pv[1][1], 0.1468570657704237764e-1, places=11) self.assertAlmostEqual(pv[1][2], 0.6406996426270981189e-2, places=11) pv = erfa.plan94(2400000.5, 43999.9, 1) self.assertAlmostEqual(pv[0][0], 0.2945293959257430832, places=11) self.assertAlmostEqual(pv[0][1], -0.2452204176601049596, places=11) self.assertAlmostEqual(pv[0][2], -0.1615427700571978153, places=11) self.assertAlmostEqual(pv[1][0], 0.1413867871404614441e-1, places=11) self.assertAlmostEqual(pv[1][1], 0.1946548301104706582e-1, places=11) self.assertAlmostEqual(pv[1][2], 0.8929809783898904786e-2, places=11) def test_pmat00(self): rbp = erfa.pmat00(2400000.5, 50123.9999) self.assertAlmostEqual(rbp[0][0], 0.9999995505175087260, places=12) self.assertAlmostEqual(rbp[0][1], 0.8695405883617884705e-3, places=14) self.assertAlmostEqual(rbp[0][2], 0.3779734722239007105e-3, places=14) self.assertAlmostEqual(rbp[1][0], -0.8695405990410863719e-3, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999996219494925900, places=12) self.assertAlmostEqual(rbp[1][2], -0.1360775820404982209e-6, places=14) self.assertAlmostEqual(rbp[2][0], -0.3779734476558184991e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.1925857585832024058e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999999285680153377, places=12) def test_pmat06(self): rbp = erfa.pmat06(2400000.5, 50123.9999) self.assertAlmostEqual(rbp[0][0], 0.9999995505176007047, places=12) self.assertAlmostEqual(rbp[0][1], 0.8695404617348208406e-3, places=14) self.assertAlmostEqual(rbp[0][2], 0.3779735201865589104e-3, places=14) self.assertAlmostEqual(rbp[1][0], -0.8695404723772031414e-3, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999996219496027161, places=12) self.assertAlmostEqual(rbp[1][2], -0.1361752497080270143e-6, places=14) self.assertAlmostEqual(rbp[2][0], -0.3779734957034089490e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.1924880847894457113e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999999285679971958, places=12) def test_pmat76(self): rmatp = erfa.pmat76(2400000.5, 50123.9999) self.assertAlmostEqual(rmatp[0][0], 0.9999995504328350733, places=12) self.assertAlmostEqual(rmatp[0][1], 0.8696632209480960785e-3, places=14) self.assertAlmostEqual(rmatp[0][2], 0.3779153474959888345e-3, places=14) self.assertAlmostEqual(rmatp[1][0], -0.8696632209485112192e-3, places=14) self.assertAlmostEqual(rmatp[1][1], 0.9999996218428560614, places=12) self.assertAlmostEqual(rmatp[1][2], -0.1643284776111886407e-6, places=14) self.assertAlmostEqual(rmatp[2][0], -0.3779153474950335077e-3, places=14) self.assertAlmostEqual(rmatp[2][1], -0.1643306746147366896e-6, places=14) self.assertAlmostEqual(rmatp[2][2], 0.9999999285899790119, places=12) def test_pn00(self): dpsi = -0.9632552291149335877e-5 deps = 0.4063197106621141414e-4 epsa, rb, rp, rbp, rn, rbpn = erfa.pn00(2400000.5, 53736.0, dpsi, deps) self.assertAlmostEqual(epsa, 0.4090791789404229916, 12) self.assertAlmostEqual(rb[0][0], 0.9999999999999942498, places=12) self.assertAlmostEqual(rb[0][1], -0.7078279744199196626e-7, places=18) self.assertAlmostEqual(rb[0][2], 0.8056217146976134152e-7, places=18) self.assertAlmostEqual(rb[1][0], 0.7078279477857337206e-7, places=18) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3306041454222136517e-7, places=18) self.assertAlmostEqual(rb[2][0], -0.8056217380986972157e-7, places=18) self.assertAlmostEqual(rb[2][1], -0.3306040883980552500e-7, places=18) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999989300532289018, places=12) self.assertAlmostEqual(rp[0][1], -0.1341647226791824349e-2, places=14) self.assertAlmostEqual(rp[0][2], -0.5829880927190296547e-3, places=14) self.assertAlmostEqual(rp[1][0], 0.1341647231069759008e-2, places=14) self.assertAlmostEqual(rp[1][1], 0.9999990999908750433, places=12) self.assertAlmostEqual(rp[1][2], -0.3837444441583715468e-6, places=14) self.assertAlmostEqual(rp[2][0], 0.5829880828740957684e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.3984203267708834759e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999998300623538046, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999989300052243993, places=12) self.assertAlmostEqual(rbp[0][1], -0.1341717990239703727e-2, places=14) self.assertAlmostEqual(rbp[0][2], -0.5829075749891684053e-3, places=14) self.assertAlmostEqual(rbp[1][0], 0.1341718013831739992e-2, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999990998959191343, places=12) self.assertAlmostEqual(rbp[1][2], -0.3505759733565421170e-6, places=14) self.assertAlmostEqual(rbp[2][0], 0.5829075206857717883e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.4315219955198608970e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999998301093036269, places=12) self.assertAlmostEqual(rn[0][0], 0.9999999999536069682, places=12) self.assertAlmostEqual(rn[0][1], 0.8837746144872140812e-5, places=16) self.assertAlmostEqual(rn[0][2], 0.3831488838252590008e-5, places=16) self.assertAlmostEqual(rn[1][0], -0.8837590456633197506e-5, places=16) self.assertAlmostEqual(rn[1][1], 0.9999999991354692733, places=12) self.assertAlmostEqual(rn[1][2], -0.4063198798559573702e-4, places=15) #failed at 16 self.assertAlmostEqual(rn[2][0], -0.3831847930135328368e-5, places=16) self.assertAlmostEqual(rn[2][1], 0.4063195412258150427e-4, places=16) self.assertAlmostEqual(rn[2][2], 0.9999999991671806225, places=12) self.assertAlmostEqual(rbpn[0][0], 0.9999989440499982806, places=12) self.assertAlmostEqual(rbpn[0][1], -0.1332880253640848301e-2, places=14) self.assertAlmostEqual(rbpn[0][2], -0.5790760898731087295e-3, places=14) self.assertAlmostEqual(rbpn[1][0], 0.1332856746979948745e-2, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999991109064768883, places=12) self.assertAlmostEqual(rbpn[1][2], -0.4097740555723063806e-4, places=14) self.assertAlmostEqual(rbpn[2][0], 0.5791301929950205000e-3, places=14) self.assertAlmostEqual(rbpn[2][1], 0.4020553681373702931e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999998314958529887, places=12) def test_pn00a(self): dpsi, deps, epsa, rb, rp, rbp, rn, rbpn = erfa.pn00a(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9630909107115518431e-5, places=12) self.assertAlmostEqual(deps, 0.4063239174001678710e-4, places=12) self.assertAlmostEqual(epsa, 0.4090791789404229916, places=12) self.assertAlmostEqual(rb[0][0], 0.9999999999999942498, places=12) self.assertAlmostEqual(rb[0][1], -0.7078279744199196626e-7, places=16) self.assertAlmostEqual(rb[0][2], 0.8056217146976134152e-7, places=16) self.assertAlmostEqual(rb[1][0], 0.7078279477857337206e-7, places=16) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3306041454222136517e-7, places=16) self.assertAlmostEqual(rb[2][0], -0.8056217380986972157e-7, places=16) self.assertAlmostEqual(rb[2][1], -0.3306040883980552500e-7, places=16) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999989300532289018, places=12) self.assertAlmostEqual(rp[0][1], -0.1341647226791824349e-2, places=14) self.assertAlmostEqual(rp[0][2], -0.5829880927190296547e-3, places=14) self.assertAlmostEqual(rp[1][0], 0.1341647231069759008e-2, places=14) self.assertAlmostEqual(rp[1][1], 0.9999990999908750433, places=12) self.assertAlmostEqual(rp[1][2], -0.3837444441583715468e-6, places=14) self.assertAlmostEqual(rp[2][0], 0.5829880828740957684e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.3984203267708834759e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999998300623538046, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999989300052243993, places=12) self.assertAlmostEqual(rbp[0][1], -0.1341717990239703727e-2, places=14) self.assertAlmostEqual(rbp[0][2], -0.5829075749891684053e-3, places=14) self.assertAlmostEqual(rbp[1][0], 0.1341718013831739992e-2, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999990998959191343, places=12) self.assertAlmostEqual(rbp[1][2], -0.3505759733565421170e-6, places=14) self.assertAlmostEqual(rbp[2][0], 0.5829075206857717883e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.4315219955198608970e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999998301093036269, places=12) self.assertAlmostEqual(rn[0][0], 0.9999999999536227949, places=12) self.assertAlmostEqual(rn[0][1], 0.8836238544090873336e-5, places=14) self.assertAlmostEqual(rn[0][2], 0.3830835237722400669e-5, places=14) self.assertAlmostEqual(rn[1][0], -0.8836082880798569274e-5, places=14) self.assertAlmostEqual(rn[1][1], 0.9999999991354655028, places=12) self.assertAlmostEqual(rn[1][2], -0.4063240865362499850e-4, places=14) self.assertAlmostEqual(rn[2][0], -0.3831194272065995866e-5, places=14) self.assertAlmostEqual(rn[2][1], 0.4063237480216291775e-4, places=14) self.assertAlmostEqual(rn[2][2], 0.9999999991671660338, places=12) self.assertAlmostEqual(rbpn[0][0], 0.9999989440476103435, places=12) self.assertAlmostEqual(rbpn[0][1], -0.1332881761240011763e-2, places=14) self.assertAlmostEqual(rbpn[0][2], -0.5790767434730085751e-3, places=14) self.assertAlmostEqual(rbpn[1][0], 0.1332858254308954658e-2, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999991109044505577, places=12) self.assertAlmostEqual(rbpn[1][2], -0.4097782710396580452e-4, places=14) self.assertAlmostEqual(rbpn[2][0], 0.5791308472168152904e-3, places=14) self.assertAlmostEqual(rbpn[2][1], 0.4020595661591500259e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999998314954572304, places=12) def test_pn00b(self): dpsi, deps, epsa, rb, rp, rbp, rn, rbpn = erfa.pn00b(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9632552291148362783e-5, places=12) self.assertAlmostEqual(deps, 0.4063197106621159367e-4, places=12) self.assertAlmostEqual(epsa, 0.4090791789404229916, places=12) self.assertAlmostEqual(rb[0][0], 0.9999999999999942498, places=12) self.assertAlmostEqual(rb[0][1], -0.7078279744199196626e-7, places=16) self.assertAlmostEqual(rb[0][2], 0.8056217146976134152e-7, places=16) self.assertAlmostEqual(rb[1][0], 0.7078279477857337206e-7, places=16) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3306041454222136517e-7, places=16) self.assertAlmostEqual(rb[2][0], -0.8056217380986972157e-7, places=16) self.assertAlmostEqual(rb[2][1], -0.3306040883980552500e-7, places=16) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999989300532289018, places=12) self.assertAlmostEqual(rp[0][1], -0.1341647226791824349e-2, places=14) self.assertAlmostEqual(rp[0][2], -0.5829880927190296547e-3, places=14) self.assertAlmostEqual(rp[1][0], 0.1341647231069759008e-2, places=14) self.assertAlmostEqual(rp[1][1], 0.9999990999908750433, places=12) self.assertAlmostEqual(rp[1][2], -0.3837444441583715468e-6, places=14) self.assertAlmostEqual(rp[2][0], 0.5829880828740957684e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.3984203267708834759e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999998300623538046, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999989300052243993, places=12) self.assertAlmostEqual(rbp[0][1], -0.1341717990239703727e-2, places=14) self.assertAlmostEqual(rbp[0][2], -0.5829075749891684053e-3, places=14) self.assertAlmostEqual(rbp[1][0], 0.1341718013831739992e-2, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999990998959191343, places=12) self.assertAlmostEqual(rbp[1][2], -0.3505759733565421170e-6, places=14) self.assertAlmostEqual(rbp[2][0], 0.5829075206857717883e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.4315219955198608970e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999998301093036269, places=12) self.assertAlmostEqual(rn[0][0], 0.9999999999536069682, places=12) self.assertAlmostEqual(rn[0][1], 0.8837746144871248011e-5, places=14) self.assertAlmostEqual(rn[0][2], 0.3831488838252202945e-5, places=14) self.assertAlmostEqual(rn[1][0], -0.8837590456632304720e-5, places=14) self.assertAlmostEqual(rn[1][1], 0.9999999991354692733, places=12) self.assertAlmostEqual(rn[1][2], -0.4063198798559591654e-4, places=14) self.assertAlmostEqual(rn[2][0], -0.3831847930134941271e-5, places=14) self.assertAlmostEqual(rn[2][1], 0.4063195412258168380e-4, places=14) self.assertAlmostEqual(rn[2][2], 0.9999999991671806225, places=12) self.assertAlmostEqual(rbpn[0][0], 0.9999989440499982806, places=12) self.assertAlmostEqual(rbpn[0][1], -0.1332880253640849194e-2, places=14) self.assertAlmostEqual(rbpn[0][2], -0.5790760898731091166e-3, places=14) self.assertAlmostEqual(rbpn[1][0], 0.1332856746979949638e-2, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999991109064768883, places=12) self.assertAlmostEqual(rbpn[1][2], -0.4097740555723081811e-4, places=14) self.assertAlmostEqual(rbpn[2][0], 0.5791301929950208873e-3, places=14) self.assertAlmostEqual(rbpn[2][1], 0.4020553681373720832e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999998314958529887, places=12) def test_pn06(self): dpsi = -0.9632552291149335877e-5 deps = 0.4063197106621141414e-4 epsa, rb, rp, rbp, rn, rbpn = erfa.pn06(2400000.5, 53736.0, dpsi, deps) self.assertAlmostEqual(epsa, 0.4090789763356509926, places=12) self.assertAlmostEqual(rb[0][0], 0.9999999999999942497, places=12) self.assertAlmostEqual(rb[0][1], -0.7078368960971557145e-7, places=14) self.assertAlmostEqual(rb[0][2], 0.8056213977613185606e-7, places=14) self.assertAlmostEqual(rb[1][0], 0.7078368694637674333e-7, places=14) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3305943742989134124e-7, places=14) self.assertAlmostEqual(rb[2][0], -0.8056214211620056792e-7, places=14) self.assertAlmostEqual(rb[2][1], -0.3305943172740586950e-7, places=14) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999989300536854831, places=12) self.assertAlmostEqual(rp[0][1], -0.1341646886204443795e-2, places=14) self.assertAlmostEqual(rp[0][2], -0.5829880933488627759e-3, places=14) self.assertAlmostEqual(rp[1][0], 0.1341646890569782183e-2, places=14) self.assertAlmostEqual(rp[1][1], 0.9999990999913319321, places=12) self.assertAlmostEqual(rp[1][2], -0.3835944216374477457e-6, places=14) self.assertAlmostEqual(rp[2][0], 0.5829880833027867368e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.3985701514686976112e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999998300623534950, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999989300056797893, places=12) self.assertAlmostEqual(rbp[0][1], -0.1341717650545059598e-2, places=14) self.assertAlmostEqual(rbp[0][2], -0.5829075756493728856e-3, places=14) self.assertAlmostEqual(rbp[1][0], 0.1341717674223918101e-2, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999990998963748448, places=12) self.assertAlmostEqual(rbp[1][2], -0.3504269280170069029e-6, places=14) self.assertAlmostEqual(rbp[2][0], 0.5829075211461454599e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.4316708436255949093e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999998301093032943, places=12) self.assertAlmostEqual(rn[0][0], 0.9999999999536069682, places=12) self.assertAlmostEqual(rn[0][1], 0.8837746921149881914e-5, places=14) self.assertAlmostEqual(rn[0][2], 0.3831487047682968703e-5, places=14) self.assertAlmostEqual(rn[1][0], -0.8837591232983692340e-5, places=14) self.assertAlmostEqual(rn[1][1], 0.9999999991354692664, places=12) self.assertAlmostEqual(rn[1][2], -0.4063198798558931215e-4, places=14) self.assertAlmostEqual(rn[2][0], -0.3831846139597250235e-5, places=14) self.assertAlmostEqual(rn[2][1], 0.4063195412258792914e-4, places=14) self.assertAlmostEqual(rn[2][2], 0.9999999991671806293, places=12) self.assertAlmostEqual(rbpn[0][0], 0.9999989440504506688, places=12) self.assertAlmostEqual(rbpn[0][1], -0.1332879913170492655e-2, places=14) self.assertAlmostEqual(rbpn[0][2], -0.5790760923225655753e-3, places=14) self.assertAlmostEqual(rbpn[1][0], 0.1332856406595754748e-2, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999991109069366795, places=12) self.assertAlmostEqual(rbpn[1][2], -0.4097725651142641812e-4, places=14) self.assertAlmostEqual(rbpn[2][0], 0.5791301952321296716e-3, places=14) self.assertAlmostEqual(rbpn[2][1], 0.4020538796195230577e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999998314958576778, places=12) def test_pn06a(self): dpsi, deps, epsa, rb, rp, rbp, rn, rbpn = erfa.pn06a(2400000.5, 53736.0) self.assertAlmostEqual(dpsi, -0.9630912025820308797e-5, places=12) self.assertAlmostEqual(deps, 0.4063238496887249798e-4, places=12) self.assertAlmostEqual(epsa, 0.4090789763356509926, places=12) self.assertAlmostEqual(rb[0][0], 0.9999999999999942497, places=12) self.assertAlmostEqual(rb[0][1], -0.7078368960971557145e-7, places=14) self.assertAlmostEqual(rb[0][2], 0.8056213977613185606e-7, places=14) self.assertAlmostEqual(rb[1][0], 0.7078368694637674333e-7, places=14) self.assertAlmostEqual(rb[1][1], 0.9999999999999969484, places=12) self.assertAlmostEqual(rb[1][2], 0.3305943742989134124e-7, places=14) self.assertAlmostEqual(rb[2][0], -0.8056214211620056792e-7, places=14) self.assertAlmostEqual(rb[2][1], -0.3305943172740586950e-7, places=14) self.assertAlmostEqual(rb[2][2], 0.9999999999999962084, places=12) self.assertAlmostEqual(rp[0][0], 0.9999989300536854831, places=12) self.assertAlmostEqual(rp[0][1], -0.1341646886204443795e-2, places=14) self.assertAlmostEqual(rp[0][2], -0.5829880933488627759e-3, places=14) self.assertAlmostEqual(rp[1][0], 0.1341646890569782183e-2, places=14) self.assertAlmostEqual(rp[1][1], 0.9999990999913319321, places=12) self.assertAlmostEqual(rp[1][2], -0.3835944216374477457e-6, places=14) self.assertAlmostEqual(rp[2][0], 0.5829880833027867368e-3, places=14) self.assertAlmostEqual(rp[2][1], -0.3985701514686976112e-6, places=14) self.assertAlmostEqual(rp[2][2], 0.9999998300623534950, places=12) self.assertAlmostEqual(rbp[0][0], 0.9999989300056797893, places=12) self.assertAlmostEqual(rbp[0][1], -0.1341717650545059598e-2, places=14) self.assertAlmostEqual(rbp[0][2], -0.5829075756493728856e-3, places=14) self.assertAlmostEqual(rbp[1][0], 0.1341717674223918101e-2, places=14) self.assertAlmostEqual(rbp[1][1], 0.9999990998963748448, places=12) self.assertAlmostEqual(rbp[1][2], -0.3504269280170069029e-6, places=14) self.assertAlmostEqual(rbp[2][0], 0.5829075211461454599e-3, places=14) self.assertAlmostEqual(rbp[2][1], -0.4316708436255949093e-6, places=14) self.assertAlmostEqual(rbp[2][2], 0.9999998301093032943, places=12) self.assertAlmostEqual(rn[0][0], 0.9999999999536227668, places=12) self.assertAlmostEqual(rn[0][1], 0.8836241998111535233e-5, places=14) self.assertAlmostEqual(rn[0][2], 0.3830834608415287707e-5, places=14) self.assertAlmostEqual(rn[1][0], -0.8836086334870740138e-5, places=14) self.assertAlmostEqual(rn[1][1], 0.9999999991354657474, places=12) self.assertAlmostEqual(rn[1][2], -0.4063240188248455065e-4, places=14) self.assertAlmostEqual(rn[2][0], -0.3831193642839398128e-5, places=14) self.assertAlmostEqual(rn[2][1], 0.4063236803101479770e-4, places=14) self.assertAlmostEqual(rn[2][2], 0.9999999991671663114, places=12) self.assertAlmostEqual(rbpn[0][0], 0.9999989440480669738, places=12) self.assertAlmostEqual(rbpn[0][1], -0.1332881418091915973e-2, places=14) self.assertAlmostEqual(rbpn[0][2], -0.5790767447612042565e-3, places=14) self.assertAlmostEqual(rbpn[1][0], 0.1332857911250989133e-2, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999991109049141908, places=12) self.assertAlmostEqual(rbpn[1][2], -0.4097767128546784878e-4, places=14) self.assertAlmostEqual(rbpn[2][0], 0.5791308482835292617e-3, places=14) self.assertAlmostEqual(rbpn[2][1], 0.4020580099454020310e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999998314954628695, places=12) def test_pnm00a(self): rbpn = erfa.pnm00a(2400000.5, 50123.9999) self.assertAlmostEqual(rbpn[0][0], 0.9999995832793134257, places=12) self.assertAlmostEqual(rbpn[0][1], 0.8372384254137809439e-3, places=14) self.assertAlmostEqual(rbpn[0][2], 0.3639684306407150645e-3, places=14) self.assertAlmostEqual(rbpn[1][0], -0.8372535226570394543e-3, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999996486491582471, places=12) self.assertAlmostEqual(rbpn[1][2], 0.4132915262664072381e-4, places=14) self.assertAlmostEqual(rbpn[2][0], -0.3639337004054317729e-3, places=14) self.assertAlmostEqual(rbpn[2][1], -0.4163386925461775873e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999999329094390695, places=12) def test_pnm00b(self): rbpn = erfa.pnm00b(2400000.5, 50123.9999) self.assertAlmostEqual(rbpn[0][0], 0.9999995832776208280, places=12) self.assertAlmostEqual(rbpn[0][1], 0.8372401264429654837e-3, places=14) self.assertAlmostEqual(rbpn[0][2], 0.3639691681450271771e-3, places=14) self.assertAlmostEqual(rbpn[1][0], -0.8372552234147137424e-3, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999996486477686123, places=12) self.assertAlmostEqual(rbpn[1][2], 0.4132832190946052890e-4, places=14) self.assertAlmostEqual(rbpn[2][0], -0.3639344385341866407e-3, places=14) self.assertAlmostEqual(rbpn[2][1], -0.4163303977421522785e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999999329092049734, places=12) def test_pnm06a(self): rbpn = erfa.pnm06a(2400000.5, 50123.9999) self.assertAlmostEqual(rbpn[0][0], 0.9999995832794205484, places=12) self.assertAlmostEqual(rbpn[0][1], 0.8372382772630962111e-3, places=14) self.assertAlmostEqual(rbpn[0][2], 0.3639684771140623099e-3, places=14) self.assertAlmostEqual(rbpn[1][0], -0.8372533744743683605e-3, places=14) self.assertAlmostEqual(rbpn[1][1], 0.9999996486492861646, places=12) self.assertAlmostEqual(rbpn[1][2], 0.4132905944611019498e-4, places=14) self.assertAlmostEqual(rbpn[2][0], -0.3639337469629464969e-3, places=14) self.assertAlmostEqual(rbpn[2][1], -0.4163377605910663999e-4, places=14) self.assertAlmostEqual(rbpn[2][2], 0.9999999329094260057, places=12) def test_pnm80(self): rmatpn = erfa.pnm80(2400000.5, 50123.9999) self.assertAlmostEqual(rmatpn[0][0], 0.9999995831934611169, places=12) self.assertAlmostEqual(rmatpn[0][1], 0.8373654045728124011e-3, places=14) self.assertAlmostEqual(rmatpn[0][2], 0.3639121916933106191e-3, places=14) self.assertAlmostEqual(rmatpn[1][0], -0.8373804896118301316e-3, places=14) self.assertAlmostEqual(rmatpn[1][1], 0.9999996485439674092, places=12) self.assertAlmostEqual(rmatpn[1][2], 0.4130202510421549752e-4, places=14) self.assertAlmostEqual(rmatpn[2][0], -0.3638774789072144473e-3, places=14) self.assertAlmostEqual(rmatpn[2][1], -0.4160674085851722359e-4, places=14) self.assertAlmostEqual(rmatpn[2][2], 0.9999999329310274805, places=12) def test_pom00(self): xp = 2.55060238e-7 yp = 1.860359247e-6 sp = -0.1367174580728891460e-10 rpom = erfa.pom00(xp, yp, sp) self.assertAlmostEqual(rpom[0][0], 0.9999999999999674721, places=12) self.assertAlmostEqual(rpom[0][1], -0.1367174580728846989e-10, places=16) self.assertAlmostEqual(rpom[0][2], 0.2550602379999972345e-6, places=16) self.assertAlmostEqual(rpom[1][0], 0.1414624947957029801e-10, places=16) self.assertAlmostEqual(rpom[1][1], 0.9999999999982695317, places=12) self.assertAlmostEqual(rpom[1][2], -0.1860359246998866389e-5, places=16) self.assertAlmostEqual(rpom[2][0], -0.2550602379741215021e-6, places=16) self.assertAlmostEqual(rpom[2][1], 0.1860359247002414021e-5, places=16) self.assertAlmostEqual(rpom[2][2], 0.9999999999982370039, places=12) def test_pr00(self): dpsipr, depspr = erfa.pr00(2400000.5, 53736) self.assertAlmostEqual(dpsipr, -0.8716465172668347629e-7, places=22) self.assertAlmostEqual(depspr, -0.7342018386722813087e-8, places=22) def test_prec76(self): ep01 = 2400000.5 ep02 = 33282.0 ep11 = 2400000.5 ep12 = 51544.0 zeta, z, theta = erfa.prec76(ep01, ep02, ep11, ep12) self.assertAlmostEqual(zeta, 0.5588961642000161243e-2, places=12) self.assertAlmostEqual(z, 0.5589922365870680624e-2, places=12) self.assertAlmostEqual(theta, 0.4858945471687296760e-2, places=12) def test_pvstar(self): pv = ((126668.5912743160601,2136.792716839935195,-245251.2339876830091), (-0.4051854035740712739e-2,-0.6253919754866173866e-2,0.1189353719774107189e-1)) ra, dec, pmr, pmd, px, rv = erfa.pvstar(pv) self.assertAlmostEqual(ra, 0.1686756e-1, places=12,) self.assertAlmostEqual(dec, -1.093989828, places=12,) self.assertAlmostEqual(pmr, -0.1783235160000472788e-4, places=16,) self.assertAlmostEqual(pmd, 0.2336024047000619347e-5, places=16,) self.assertAlmostEqual(px, 0.74723, places=12,) self.assertAlmostEqual(rv, -21.60000010107306010, places=11,) def test_s00(self): x = 0.5791308486706011000e-3 y = 0.4020579816732961219e-4 s = erfa.s00(2400000.5, 53736.0, x, y) self.assertAlmostEqual(s, -0.1220036263270905693e-7, 18) def test_s00a(self): s = erfa.s00a(2400000.5, 52541.0) self.assertAlmostEqual(s, -0.1340684448919163584e-7, 18) def test_s00b(self): s = erfa.s00b(2400000.5, 52541.0) self.assertAlmostEqual(s, -0.1340695782951026584e-7, 18) def test_s06(self): x = 0.5791308486706011000e-3 y = 0.4020579816732961219e-4 s = erfa.s06(2400000.5, 53736.0, x, y) self.assertAlmostEqual(s, -0.1220032213076463117e-7, 18) def test_s06a(self): s = erfa.s06a(2400000.5, 52541.0) self.assertAlmostEqual(s, -0.1340680437291812383e-7, 18) def test_sp00(self): s = erfa.sp00(2400000.5, 52541.0) self.assertAlmostEqual(s, -0.6216698469981019309e-11, 12) def test_starpm(self): ra1 = 0.01686756 dec1 = -1.093989828 pmr1 = -1.78323516e-5 pmd1 = 2.336024047e-6 px1 = 0.74723 rv1 = -21.6 ra2, dec2, pmr2, pmd2, px2, rv2 = erfa.starpm(ra1, dec1, pmr1, pmd1, px1, rv1, 2400000.5, 50083.0, 2400000.5, 53736.0) self.assertAlmostEqual(ra2, 0.01668919069414256149, places=13) self.assertAlmostEqual(dec2, -1.093966454217127897, places=13) self.assertAlmostEqual(pmr2, -0.1783662682153176524e-4, places=17) self.assertAlmostEqual(pmd2, 0.2338092915983989595e-5, places=17) self.assertAlmostEqual(px2, 0.7473533835317719243, places=13) self.assertAlmostEqual(rv2, -21.59905170476417175, places=11) def test_starpv(self): ra = 0.01686756 dec = -1.093989828 pmr = -1.78323516e-5 pmd = 2.336024047e-6 px = 0.74723 rv = -21.6 pv = erfa.starpv(ra, dec, pmr, pmd, px, rv) self.assertAlmostEqual(pv[0][0], 126668.5912743160601, places=10) self.assertAlmostEqual(pv[0][1], 2136.792716839935195, places=12) self.assertAlmostEqual(pv[0][2], -245251.2339876830091, places=10) self.assertAlmostEqual(pv[1][0], -0.4051854008955659551e-2, places=13) self.assertAlmostEqual(pv[1][1], -0.6253919754414777970e-2, places=15) self.assertAlmostEqual(pv[1][2], 0.1189353714588109341e-1, places=13) def test_taitt(self): t1, t2 = erfa.taitt(2453750.5, 0.892482639) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.892855139, places=12) def test_taiut1(self): u1, u2 = erfa.taiut1(2453750.5, 0.892482639, -32.6659) self.assertAlmostEqual(u1, 2453750.5, places=6) self.assertAlmostEqual(u2, 0.8921045614537037037, places=12) def test_taiutc(self): u1, u2 = erfa.taiutc(2453750.5, 0.892482639) self.assertAlmostEqual(u1, 2453750.5, places=6) self.assertAlmostEqual(u2, 0.8921006945555555556, places=12) def test_tcbtdb(self): b1, b2 = erfa.tcbtdb(2453750.5, 0.893019599) self.assertAlmostEqual(b1, 2453750.5, places=6) self.assertAlmostEqual(b2, 0.8928551362746343397, places=12) def test_tcgtt(self): t1, t2 = erfa.tcgtt(2453750.5, 0.892862531) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.8928551387488816828, places=12) def test_tdbtcb(self): b1, b2 = erfa.tdbtcb(2453750.5, 0.892855137) self.assertAlmostEqual(b1, 2453750.5, places=6) self.assertAlmostEqual(b2, 0.8930195997253656716, places=12) def test_tdbtt(self): t1, t2 = erfa.tdbtt(2453750.5, 0.892855137, -0.000201) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.8928551393263888889, places=12) def test_tttai(self): t1, t2 = erfa.tttai(2453750.5, 0.892482639) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.892110139, places=12) def test_tttcg(self): t1, t2 = erfa.tttcg(2453750.5, 0.892482639) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.8924900312508587113, places=12) def test_tttdb(self): t1, t2 = erfa.tttdb(2453750.5, 0.892855139, -0.000201) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.8928551366736111111, places=12) def test_ttut1(self): t1, t2 = erfa.ttut1(2453750.5, 0.892855139, 64.8499) self.assertAlmostEqual(t1, 2453750.5, places=6) self.assertAlmostEqual(t2, 0.8921045614537037037, places=12) def test_ut1tai(self): a1, a2 = erfa.ut1tai(2453750.5, 0.892104561, -32.6659) self.assertAlmostEqual(a1, 2453750.5, places=6) self.assertAlmostEqual(a2, 0.8924826385462962963, places=12) def test_ut1tt(self): a1, a2 = erfa.ut1tt(2453750.5, 0.892104561, 64.8499) self.assertAlmostEqual(a1, 2453750.5, places=6) self.assertAlmostEqual(a2, 0.8928551385462962963, places=15) def test_ut1utc(self): a1, a2 = erfa.ut1utc(2453750.5, 0.892104561, 0.3341) self.assertAlmostEqual(a1, 2453750.5, places=6) self.assertAlmostEqual(a2, 0.8921006941018518519, places=13) def test_utctai(self): u1, u2 = erfa.utctai(2453750.5, 0.892100694) self.assertAlmostEqual(u1, 2453750.5, places=6) self.assertAlmostEqual(u2, 0.8924826384444444444, places=13) def test_utcut1(self): u1, u2 = erfa.utcut1(2453750.5, 0.892100694, 0.3341) self.assertAlmostEqual(u1, 2453750.5, places=6) self.assertAlmostEqual(u2, 0.8921045608981481481, places=13) def test_xy06(self): x, y = erfa.xy06(2400000.5, 53736.0) self.assertAlmostEqual(x, 0.5791308486706010975e-3, places=16) self.assertAlmostEqual(y, 0.4020579816732958141e-4, places=17) def test_xys00a(self): x, y, s = erfa.xys00a(2400000.5, 53736.0) self.assertAlmostEqual(x, 0.5791308472168152904e-3, places=16) self.assertAlmostEqual(y, 0.4020595661591500259e-4, places=17) self.assertAlmostEqual(s, -0.1220040848471549623e-7, places=20) def test_xys00b(self): x, y, s = erfa.xys00b(2400000.5, 53736.0) self.assertAlmostEqual(x, 0.5791301929950208873e-3, places=16) self.assertAlmostEqual(y, 0.4020553681373720832e-4, places=16) self.assertAlmostEqual(s, -0.1220027377285083189e-7, places=19) def test_xys06a(self): x, y, s = erfa.xys06a(2400000.5, 53736.0) self.assertAlmostEqual(x, 0.5791308482835292617e-3, places=16) self.assertAlmostEqual(y, 0.4020580099454020310e-4, places=15) self.assertAlmostEqual(s, -0.1220032294164579896e-7, places=19) ## vector matrix library def test_a2af(self): r = erfa.a2af(4, 2.345) self.assertEqual(r[0], '+') self.assertEqual(r[1], 134) self.assertEqual(r[2], 21) self.assertEqual(r[3], 30) self.assertEqual(r[4], 9706) def test_a2tf(self): r = erfa.a2tf(4, -3.01234) self.assertEqual(r[0], '-') self.assertEqual(r[1], 11) self.assertEqual(r[2], 30) self.assertEqual(r[3], 22) self.assertEqual(r[4], 6484) def test_af2a(self): r = erfa.af2a(-45, 13, 27.2) self.assertAlmostEqual(r, -0.7893115794313644842, 15) r = erfa.af2a(45, 13, 27.2) self.assertAlmostEqual(r, 0.7893115794313644842, 15) def test_anp(self): r = erfa.anp(-0.1) self.assertAlmostEqual(r, 6.183185307179586477, 15) def test_anpm(self): r = erfa.anpm(-4.0) self.assertAlmostEqual(r, 2.283185307179586477, 15) def test_c2s(self): t,p = erfa.c2s((100.,-50.,25.)) self.assertAlmostEqual(t, -0.4636476090008061162, 15) self.assertAlmostEqual(p, 0.2199879773954594463, 15) def test_cp(self): p = (0.3,1.2,-2.5) c = erfa.cp(p) self.assertAlmostEqual(c[0], 0.3, places=12) self.assertAlmostEqual(c[1], 1.2, places=12) self.assertAlmostEqual(c[2], -2.5, places=12) def test_cpv(self): pv = ((0.3,1.2,-2.5), (-0.5,3.1,0.9)) c = erfa.cpv(pv) self.assertAlmostEqual(c[0][0], 0.3, 0.0,) self.assertAlmostEqual(c[0][1], 1.2, 0.0,) self.assertAlmostEqual(c[0][2], -2.5, 0.0,) self.assertAlmostEqual(c[1][0], -0.5, 0.0,) self.assertAlmostEqual(c[1][1], 3.1, 0.0,) self.assertAlmostEqual(c[1][2], 0.9, 0.0,) def test_cr(self): a = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) c = erfa.cr(a) self.assertAlmostEqual(c[0][0], 2.0, places=12) self.assertAlmostEqual(c[0][1], 3.0, places=12) self.assertAlmostEqual(c[0][2], 2.0, places=12) self.assertAlmostEqual(c[1][0], 3.0, places=12) self.assertAlmostEqual(c[1][1], 2.0, places=12) self.assertAlmostEqual(c[1][2], 3.0, places=12) self.assertAlmostEqual(c[2][0], 3.0, places=12) self.assertAlmostEqual(c[2][1], 4.0, places=12) self.assertAlmostEqual(c[2][2], 5.0, places=12) def test_p2pv(self): pv = erfa.p2pv((0.25,1.2,3.0)) self.assertAlmostEqual(pv[0][0], 0.25, places=12) self.assertAlmostEqual(pv[0][1], 1.2, places=12) self.assertAlmostEqual(pv[0][2], 3.0, places=12) self.assertAlmostEqual(pv[1][0], 0.0, places=12) self.assertAlmostEqual(pv[1][1], 0.0, places=12) self.assertAlmostEqual(pv[1][2], 0.0, places=12) def test_p2s(self): theta, phi, r = erfa.p2s((100,-50,25)) self.assertAlmostEqual(theta, -0.4636476090008061162, 12) self.assertAlmostEqual(phi, 0.2199879773954594463, 12) self.assertAlmostEqual(r, 114.5643923738960002, 12) def test_pap(self): a = (1.,0.1,0.2) b= (-3.,1e-3,0.2) theta = erfa.pap(a,b) self.assertAlmostEqual(theta, 0.3671514267841113674, 12) def test_pas(self): p = erfa.pas(1.0,0.1,0.2,-1.0) self.assertAlmostEqual(p, -2.724544922932270424, 12) def test_pdp(self): ab =erfa.pdp((2.,2.,3.),(1.,3.,4.)) self.assertAlmostEqual(ab, 20, 12) def test_pm(self): ## m = erfa.pm((2.,2.,3.)) ## r = math.sqrt(2.*2.+2.*2.+3.*3.) ## self.assertAlmostEqual(m, r, 14) m = erfa.pm((0.3,1.2,-2.5)) self.assertAlmostEqual(m, 2.789265136196270604, 14) def test_pmp(self): a = (2.0,2.0,3.0) b = (1.0,3.0,4.0) amb= erfa.pmp(a,b) self.assertAlmostEqual(amb[0], 1.0, 12) self.assertAlmostEqual(amb[1], -1.0, 12) self.assertAlmostEqual(amb[2], -1.0, 12) def test_pn(self): r, u = erfa.pn((0.3,1.2,-2.5)) self.assertAlmostEqual(r, 2.789265136196270604, 12) self.assertAlmostEqual(u[0], 0.1075552109073112058, 12) self.assertAlmostEqual(u[1], 0.4302208436292448232, 12) self.assertAlmostEqual(u[2], -0.8962934242275933816, 12) def test_ppp(self): apb = erfa.ppp((2.0,2.0,3.0),(1.0,3.0,4.0)) self.assertAlmostEqual(apb[0], 3.0, places=12) self.assertAlmostEqual(apb[1], 5.0, places=12) self.assertAlmostEqual(apb[2], 7.0, places=12) def test_ppsp(self): apsb = erfa.ppsp((2.0,2.0,3.0),5.0,(1.0,3.0,4.0)) self.assertAlmostEqual(apsb[0], 7.0, places=12) self.assertAlmostEqual(apsb[1], 17.0, places=12) self.assertAlmostEqual(apsb[2], 23.0, places=12) def test_pv2p(self): p = erfa.pv2p(((0.3,1.2,-2.5),(-0.5,3.1,0.9))) self.assertAlmostEqual(p[0], 0.3, 0.0) self.assertAlmostEqual(p[1], 1.2, 0.0) self.assertAlmostEqual(p[2], -2.5, 0.0) def test_pv2s(self): pv = ((-0.4514964673880165,0.03093394277342585,0.05594668105108779), (1.292270850663260e-5,2.652814182060692e-6,2.568431853930293e-6)) theta, phi, r, td, pd, rd = erfa.pv2s(pv) self.assertAlmostEqual(theta, 3.073185307179586515, places=12) self.assertAlmostEqual(phi, 0.1229999999999999992, places=12) self.assertAlmostEqual(r, 0.4559999999999999757, places=12) self.assertAlmostEqual(td, -0.7800000000000000364e-5, places=16) self.assertAlmostEqual(pd, 0.9010000000000001639e-5, places=16) self.assertAlmostEqual(rd, -0.1229999999999999832e-4, places=16) def test_pvdpv(self): a = ((2.,2.,3.),(6.,0.,4.)) b = ((1.,3.,4.),(0.,2.,8.)) adb = erfa.pvdpv(a, b) self.assertAlmostEqual(adb[0], 20.0, places=12) self.assertAlmostEqual(adb[1], 50.0, places=12) def test_pvm(self): pv = ((0.3,1.2,-2.5),(0.45,-0.25,1.1)) r, s = erfa.pvm(pv) self.assertAlmostEqual(r, 2.789265136196270604, 12) self.assertAlmostEqual(s, 1.214495780149111922, 12) def test_pvmpv(self): a = ((2.0,2.0,3.0),(5.0,6.0,3.0)) b = ((1.0,3.0,4.0),(3.0,2.0,1.0)) amb = erfa.pvmpv(a,b) self.assertAlmostEqual(amb[0][0], 1.0, places=12) self.assertAlmostEqual(amb[0][1], -1.0, places=12) self.assertAlmostEqual(amb[0][2], -1.0, places=12) self.assertAlmostEqual(amb[1][0], 2.0, places=12) self.assertAlmostEqual(amb[1][1], 4.0, places=12) self.assertAlmostEqual(amb[1][2], 2.0, places=12) def test_pvppv(self): a = ((2.0,2.0,3.0),(5.0,6.0,3.0)) b = ((1.0,3.0,4.0),(3.0,2.0,1.0)) apb = erfa.pvppv(a,b) self.assertAlmostEqual(apb[0][0], 3.0, places=12) self.assertAlmostEqual(apb[0][1], 5.0, places=12) self.assertAlmostEqual(apb[0][2], 7.0, places=12) self.assertAlmostEqual(apb[1][0], 8.0, places=12) self.assertAlmostEqual(apb[1][1], 8.0, places=12) self.assertAlmostEqual(apb[1][2], 4.0, places=12) def test_pvu(self): dt = 2920.0 pv = ((126668.5912743160734,2136.792716839935565,-245251.2339876830229), (-0.4051854035740713039e-2,-0.6253919754866175788e-2,0.1189353719774107615e-1)) upv = erfa.pvu(dt, pv) self.assertAlmostEqual(upv[0][0], 126656.7598605317105, places=12) self.assertAlmostEqual(upv[0][1], 2118.531271155726332, places=12) self.assertAlmostEqual(upv[0][2], -245216.5048590656190, places=12) self.assertAlmostEqual(upv[1][0], -0.4051854035740713039e-2, places=12) self.assertAlmostEqual(upv[1][1], -0.6253919754866175788e-2, places=12) self.assertAlmostEqual(upv[1][2], 0.1189353719774107615e-1, places=12) def test_pvup(self): dt = 2920.0 pv = ((126668.5912743160734,2136.792716839935565,-245251.2339876830229), (-0.4051854035740713039e-2,-0.6253919754866175788e-2,0.1189353719774107615e-1)) p = erfa.pvup(dt, pv) self.assertAlmostEqual(p[0], 126656.7598605317105, 1e-12) self.assertAlmostEqual(p[1], 2118.531271155726332, places=12) self.assertAlmostEqual(p[2], -245216.5048590656190, 1e-12) def test_pvxpv(self): a = ((2.0,2.0,3.0),(6.0,0.0,4.0)) b = ((1.0,3.0,4.0),(0.0,2.0,8.0)) axb =erfa.pvxpv(a, b) self.assertAlmostEqual(axb[0][0], -1.0, places=12) self.assertAlmostEqual(axb[0][1], -5.0, places=12) self.assertAlmostEqual(axb[0][2], 4.0, places=12) self.assertAlmostEqual(axb[1][0], -2.0, places=12,) self.assertAlmostEqual(axb[1][1], -36.0, places=12,) self.assertAlmostEqual(axb[1][2], 22.0, places=12,) def test_pxp(self): axb = erfa.pxp((2.0,2.0,3.0),(1.0,3.0,4.0)) self.assertAlmostEqual(axb[0], -1.0, places=12) self.assertAlmostEqual(axb[1], -5.0, places=12) self.assertAlmostEqual(axb[2], 4.0, places=12) def test_rm2v(self): w = erfa.rm2v(((0.0,-0.8,-0.6), (0.8,-0.36,0.48), (0.6,0.48,-0.64))) self.assertAlmostEqual(w[0], 0.0, places=12) self.assertAlmostEqual(w[1], 1.413716694115406957, places=12) self.assertAlmostEqual(w[2], -1.884955592153875943, places=12) def test_rv2m(self): r = erfa.rv2m((0.0, 1.41371669, -1.88495559)) self.assertAlmostEqual(r[0][0], -0.7071067782221119905, places=14) self.assertAlmostEqual(r[0][1], -0.5656854276809129651, places=14) self.assertAlmostEqual(r[0][2], -0.4242640700104211225, places=14) self.assertAlmostEqual(r[1][0], 0.5656854276809129651, places=14) self.assertAlmostEqual(r[1][1], -0.0925483394532274246, places=14) self.assertAlmostEqual(r[1][2], -0.8194112531408833269, places=14) self.assertAlmostEqual(r[2][0], 0.4242640700104211225, places=14) self.assertAlmostEqual(r[2][1], -0.8194112531408833269, places=14) self.assertAlmostEqual(r[2][2], 0.3854415612311154341, places=14) def test_rx(self): phi = 0.3456789 r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) r = erfa.rx(phi, r) self.assertAlmostEqual(r[0][0], 2.0, 0.0) self.assertAlmostEqual(r[0][1], 3.0, 0.0) self.assertAlmostEqual(r[0][2], 2.0, 0.0) self.assertAlmostEqual(r[1][0], 3.839043388235612460, places=12) self.assertAlmostEqual(r[1][1], 3.237033249594111899, places=12) self.assertAlmostEqual(r[1][2], 4.516714379005982719, places=12) self.assertAlmostEqual(r[2][0], 1.806030415924501684, places=12) self.assertAlmostEqual(r[2][1], 3.085711545336372503, places=12) self.assertAlmostEqual(r[2][2], 3.687721683977873065, places=12) def test_rxp(self): r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) p = (0.2,1.5,0.1) rp = erfa.rxp(r, p) self.assertAlmostEqual(rp[0], 5.1, places=12) self.assertAlmostEqual(rp[1], 3.9, places=12) self.assertAlmostEqual(rp[2], 7.1, places=12) def test_rxpv(self): r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) pv = ((0.2,1.5,0.1),(1.5,0.2,0.1)) rpv = erfa.rxpv(r, pv) self.assertAlmostEqual(rpv[0][0], 5.1, places=12) self.assertAlmostEqual(rpv[1][0], 3.8, places=12) self.assertAlmostEqual(rpv[0][1], 3.9, places=12) self.assertAlmostEqual(rpv[1][1], 5.2, places=12) self.assertAlmostEqual(rpv[0][2], 7.1, places=12) self.assertAlmostEqual(rpv[1][2], 5.8, places=12) def test_rxr(self): a = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) b = ((1.0,2.0,2.0), (4.0,1.0,1.0), (3.0,0.0,1.0)) atb = erfa.rxr(a, b) self.assertAlmostEqual(atb[0][0], 20.0, places=12) self.assertAlmostEqual(atb[0][1], 7.0, places=12) self.assertAlmostEqual(atb[0][2], 9.0, places=12) self.assertAlmostEqual(atb[1][0], 20.0, places=12) self.assertAlmostEqual(atb[1][1], 8.0, places=12) self.assertAlmostEqual(atb[1][2], 11.0, places=12) self.assertAlmostEqual(atb[2][0], 34.0, places=12) self.assertAlmostEqual(atb[2][1], 10.0, places=12) self.assertAlmostEqual(atb[2][2], 15.0, places=12) def test_ry(self): theta = 0.3456789 r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) r = erfa.ry(theta, r) self.assertAlmostEqual(r[0][0], 0.8651847818978159930, places=12) self.assertAlmostEqual(r[0][1], 1.467194920539316554, places=12) self.assertAlmostEqual(r[0][2], 0.1875137911274457342, places=12) self.assertAlmostEqual(r[1][0], 3, places=12) self.assertAlmostEqual(r[1][1], 2, places=12) self.assertAlmostEqual(r[1][2], 3, places=12) self.assertAlmostEqual(r[2][0], 3.500207892850427330, places=12) self.assertAlmostEqual(r[2][1], 4.779889022262298150, places=12) self.assertAlmostEqual(r[2][2], 5.381899160903798712, places=12) def test_rz(self): psi = 0.3456789 r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) r = erfa.rz(psi, r) self.assertAlmostEqual(r[0][0], 2.898197754208926769, places=12) self.assertAlmostEqual(r[0][1], 3.500207892850427330, places=12) self.assertAlmostEqual(r[0][2], 2.898197754208926769, places=12) self.assertAlmostEqual(r[1][0], 2.144865911309686813, places=12) self.assertAlmostEqual(r[1][1], 0.865184781897815993, places=12) self.assertAlmostEqual(r[1][2], 2.144865911309686813, places=12) self.assertAlmostEqual(r[2][0], 3.0, places=12) self.assertAlmostEqual(r[2][1], 4.0, places=12) self.assertAlmostEqual(r[2][2], 5.0, places=12) def test_s2c(self): c = erfa.s2c(3.0123, -0.999) self.assertAlmostEqual(c[0], -0.5366267667260523906, places=12) self.assertAlmostEqual(c[1], 0.0697711109765145365, places=12) self.assertAlmostEqual(c[2], -0.8409302618566214041, places=12) def test_s2p(self): p = erfa.s2p(-3.21, 0.123, 0.456) self.assertAlmostEqual(p[0], -0.4514964673880165228, places=12) self.assertAlmostEqual(p[1], 0.0309339427734258688, places=12) self.assertAlmostEqual(p[2], 0.0559466810510877933, places=12) def test_s2pv(self): pv = erfa.s2pv(-3.21, 0.123, 0.456, -7.8e-6, 9.01e-6, -1.23e-5) self.assertAlmostEqual(pv[0][0], -0.4514964673880165228, places=12) self.assertAlmostEqual(pv[0][1], 0.0309339427734258688, places=12) self.assertAlmostEqual(pv[0][2], 0.0559466810510877933, places=12) self.assertAlmostEqual(pv[1][0], 0.1292270850663260170e-4, places=16) self.assertAlmostEqual(pv[1][1], 0.2652814182060691422e-5, places=16) self.assertAlmostEqual(pv[1][2], 0.2568431853930292259e-5, places=16) def test_s2xpv(self): s1 = 2.0 s2 = 3.0 pv = ((0.3,1.2,-2.5), (0.5,2.3,-0.4)) spv = erfa.s2xpv(s1, s2, pv) self.assertAlmostEqual(spv[0][0], 0.6, places=12) self.assertAlmostEqual(spv[0][1], 2.4, places=12) self.assertAlmostEqual(spv[0][2], -5.0, places=12) self.assertAlmostEqual(spv[1][0], 1.5, places=12) self.assertAlmostEqual(spv[1][1], 6.9, places=12) self.assertAlmostEqual(spv[1][2], -1.2, places=12) def test_sepp(self): a = (1.0,0.1,0.2) b = (-3.0,1e-3,0.2) s = erfa.sepp(a,b) self.assertAlmostEqual(s, 2.860391919024660768, 12) def test_seps(self): al = 1.0 ap = 0.1 bl = 0.2 bp = -3.0 s = erfa.seps(al, ap, bl, bp) self.assertAlmostEqual(s, 2.346722016996998842, 14) def test_sxp(self): s = 2.0 p = (0.3,1.2,-2.5) sp = erfa.sxp(s, p) self.assertAlmostEqual(sp[0], 0.6, 0.0) self.assertAlmostEqual(sp[1], 2.4, 0.0) self.assertAlmostEqual(sp[2], -5.0, 0.0) def test_sxpv(self): s = 2.0 pv = ((0.3,1.2,-2.5),(0.5,3.2,-0.7)) spv = erfa.sxpv(s, pv) self.assertAlmostEqual(spv[0][0], 0.6, 0.0) self.assertAlmostEqual(spv[0][1], 2.4, 0.0) self.assertAlmostEqual(spv[0][2], -5.0, 0.0) self.assertAlmostEqual(spv[1][0], 1.0, 0.0) self.assertAlmostEqual(spv[1][1], 6.4, 0.0) self.assertAlmostEqual(spv[1][2], -1.4, 0.0) def test_tf2a(self): a = erfa.tf2a(4,58,20.2) self.assertAlmostEqual(a, 1.301739278189537429, 12) def test_tf2d(self): d = erfa.tf2d(23,55,10.9) self.assertAlmostEqual(d, 0.9966539351851851852, 12) def test_tr(self): r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) rt = erfa.tr(r) self.assertAlmostEqual(rt[0][0], 2.0, 0.0) self.assertAlmostEqual(rt[0][1], 3.0, 0.0) self.assertAlmostEqual(rt[0][2], 3.0, 0.0) self.assertAlmostEqual(rt[1][0], 3.0, 0.0) self.assertAlmostEqual(rt[1][1], 2.0, 0.0) self.assertAlmostEqual(rt[1][2], 4.0, 0.0) self.assertAlmostEqual(rt[2][0], 2.0, 0.0) self.assertAlmostEqual(rt[2][1], 3.0, 0.0) self.assertAlmostEqual(rt[2][2], 5.0, 0.0) def test_trxp(self): r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) p = (0.2,1.5,0.1) trp = erfa.trxp(r, p) self.assertAlmostEqual(trp[0], 5.2, places=12) self.assertAlmostEqual(trp[1], 4.0, places=12) self.assertAlmostEqual(trp[2], 5.4, places=12) def test_trxpv(self): r = ((2.0,3.0,2.0), (3.0,2.0,3.0), (3.0,4.0,5.0)) pv = ((0.2,1.5,0.1),(1.5,0.2,0.1)) trpv = erfa.trxpv(r, pv) self.assertAlmostEqual(trpv[0][0], 5.2, places=12) self.assertAlmostEqual(trpv[0][1], 4.0, places=12) self.assertAlmostEqual(trpv[0][2], 5.4, places=12) self.assertAlmostEqual(trpv[1][0], 3.9, places=12) self.assertAlmostEqual(trpv[1][1], 5.3, places=12) self.assertAlmostEqual(trpv[1][2], 4.1, places=12) def test_icrs2g(self): dr = 5.9338074302227188048671087 dd = -1.1784870613579944551540570 dl, db = erfa.icrs2g(dr,dd) self.assertAlmostEqual(dl, 5.5850536063818546461558, places=14) self.assertAlmostEqual(db, -0.7853981633974483096157, places=14) def test_g2icrs(self): dl = 5.5850536063818546461558105 db = -0.7853981633974483096156608 dr, dd = erfa.g2icrs(dl, db) self.assertAlmostEqual(dr, 5.9338074302227188048671, places=14) self.assertAlmostEqual(dd, -1.1784870613579944551541, places=14) def test_ltp(self): epj = 1666.666 rp = erfa.ltp(epj) self.assertAlmostEqual(rp[0][0], 0.9967044141159213819, places=14) self.assertAlmostEqual(rp[0][1], 0.7437801893193210840e-1, places=14) self.assertAlmostEqual(rp[0][2], 0.3237624409345603401e-1, places=14) self.assertAlmostEqual(rp[1][0], -0.7437802731819618167e-1, places=14) self.assertAlmostEqual(rp[1][1], 0.9972293894454533070, places=14) self.assertAlmostEqual(rp[1][2], -0.1205768842723593346e-2, places=14) self.assertAlmostEqual(rp[2][0], -0.3237622482766575399e-1, places=14) self.assertAlmostEqual(rp[2][1], -0.1206286039697609008e-2, places=14) self.assertAlmostEqual(rp[2][2], 0.9994750246704010914, places=14) def test_ltpb(self): epj = 1666.666 rpb = erfa.ltpb(epj) self.assertAlmostEqual(rpb[0][0], 0.9967044167723271851, places=14) self.assertAlmostEqual(rpb[0][1], 0.7437794731203340345e-1, places=14) self.assertAlmostEqual(rpb[0][2], 0.3237632684841625547e-1, places=14) self.assertAlmostEqual(rpb[1][0], -0.7437795663437177152e-1, places=14) self.assertAlmostEqual(rpb[1][1], 0.9972293947500013666, places=14) self.assertAlmostEqual(rpb[1][2], -0.1205741865911243235e-2, places=14) self.assertAlmostEqual(rpb[2][0], -0.3237630543224664992e-1, places=14) self.assertAlmostEqual(rpb[2][1], -0.1206316791076485295e-2, places=14) self.assertAlmostEqual(rpb[2][2], 0.9994750220222438819, places=14) def test_ltpecl(self): epj = -1500.0 vec = erfa.ltpecl(epj) self.assertAlmostEqual(vec[0], 0.4768625676477096525e-3, places=14) self.assertAlmostEqual(vec[1], -0.4052259533091875112, places=14) self.assertAlmostEqual(vec[2], 0.9142164401096448012, places=14) def test_ltpequ(self): epj = -2500.0 veq = erfa.ltpequ(epj) self.assertAlmostEqual(veq[0], -0.3586652560237326659, places=14) self.assertAlmostEqual(veq[1], -0.1996978910771128475, places=14) self.assertAlmostEqual(veq[2], 0.9118552442250819624, places=14) def test_eceq06(self): date1 = 2456165.5 date2 = 0.401182685 dl = 5.1 db = -0.9 dr, dd = erfa.eceq06(date1, date2, dl, db) self.assertAlmostEqual(dr, 5.533459733613627767, places=14) self.assertAlmostEqual(dd, -1.246542932554480576, places=14) def test_ecm06(self): date1 = 2456165.5 date2 = 0.401182685 rm = erfa.ecm06(date1, date2) self.assertAlmostEqual(rm[0][0], 0.9999952427708701137, places=14) self.assertAlmostEqual(rm[0][1], -0.2829062057663042347e-2, places=14) self.assertAlmostEqual(rm[0][2], -0.1229163741100017629e-2, places=14) self.assertAlmostEqual(rm[1][0], 0.3084546876908653562e-2, places=14) self.assertAlmostEqual(rm[1][1], 0.9174891871550392514, places=14) self.assertAlmostEqual(rm[1][2], 0.3977487611849338124, places=14) self.assertAlmostEqual(rm[2][0], 0.2488512951527405928e-5, places=14) self.assertAlmostEqual(rm[2][1], -0.3977506604161195467, places=14) self.assertAlmostEqual(rm[2][2], 0.9174935488232863071, places=14) def test_eqec06(self): date1 = 1234.5 date2 = 2440000.5 dr = 1.234 dd = 0.987 dl, db = erfa.eqec06(date1, date2, dr, dd) self.assertAlmostEqual(dl, 1.342509918994654619, places=14) self.assertAlmostEqual(db, 0.5926215259704608132, places=14) def test_lteceq(self): epj = 2500.0 dl = 1.5 db = 0.6 dr, dd = erfa.lteceq(epj, dl, db) self.assertAlmostEqual(dr, 1.275156021861921167, places=14) self.assertAlmostEqual(dd, 0.9966573543519204791, places=14) def test_ltecm(self): epj = -3000.0 rm = erfa.ltecm(epj) self.assertAlmostEqual(rm[0][0], 0.3564105644859788825, places=14) self.assertAlmostEqual(rm[0][1], 0.8530575738617682284, places=14) self.assertAlmostEqual(rm[0][2], 0.3811355207795060435, places=14) self.assertAlmostEqual(rm[1][0], -0.9343283469640709942, places=14) self.assertAlmostEqual(rm[1][1], 0.3247830597681745976, places=14) self.assertAlmostEqual(rm[1][2], 0.1467872751535940865, places=14) self.assertAlmostEqual(rm[2][0], 0.1431636191201167793e-2, places=14) self.assertAlmostEqual(rm[2][1], -0.4084222566960599342, places=14) self.assertAlmostEqual(rm[2][2], 0.9127919865189030899, places=14) def test_lteqec(self): epj = -1500.0 dr = 1.234 dd = 0.987 dl, db = erfa.lteqec(epj, dr, dd) self.assertAlmostEqual(dl, 0.5039483649047114859, places=14) self.assertAlmostEqual(db, 0.5848534459726224882, places=14) ## 20180130 ## Astronomy/HorizonEquatorial def test_ae2hd(self): a = 5.5 e = 1.1 p = 0.7 h, d = erfa.ae2hd(a, e, p) self.assertAlmostEqual(h, 0.5933291115507309663, places=14) self.assertAlmostEqual(d, 0.9613934761647817620, places=14) def test_hd2ae(self): h = 1.1 d = 1.2 p = 0.3 a, e = erfa.hd2ae(h, d, p) self.assertAlmostEqual(a, 5.916889243730066194, places=13) self.assertAlmostEqual(e, 0.4472186304990486228, places=14) def test_hd2pa(self): h = 1.1 d = 1.2 p = 0.3 q = erfa.hd2pa(h, d, p) self.assertAlmostEqual(q, 1.906227428001995580, places=13) ## Astronomy/Gnomonic def test_tpors(self): xi = -0.03 eta = 0.07 ra = 1.3 dec = 1.5 az1, bz1, az2, bz2 = erfa.tpors(xi, eta, ra, dec) self.assertAlmostEqual(az1, 1.736621577783208748, places=13) self.assertAlmostEqual(bz1, 1.436736561844090323, places=13) self.assertAlmostEqual(az2, 4.004971075806584490, places=13) self.assertAlmostEqual(bz2, 1.565084088476417917, places=13) def test_tporv(self): xi = -0.03 eta = 0.07 ra = 1.3 dec = 1.5 v = erfa.s2c(ra, dec) vz1, vz2 = erfa.tporv(xi, eta, v) ## this doesn't return solution ## vz1, vz2 = erfa.tporv(ra, dec, v) self.assertAlmostEqual(vz1[0], -0.02206252822366888610, places=15) self.assertAlmostEqual(vz1[1], 0.1318251060359645016, places=14) self.assertAlmostEqual(vz1[2], 0.9910274397144543895, places=14) self.assertAlmostEqual(vz2[0], -0.003712211763801968173, places=16) self.assertAlmostEqual(vz2[1], -0.004341519956299836813, places=16) self.assertAlmostEqual(vz2[2], 0.9999836852110587012, places=14) def test_tpsts(self): xi = -0.03 eta = 0.07 raz = 2.3 decz = 1.5 ra, dec = erfa.tpsts(xi, eta, raz, decz) self.assertAlmostEqual(ra, 0.7596127167359629775, places=14) self.assertAlmostEqual(dec, 1.540864645109263028, places=13) def test_tpstv(self): xi = -0.03 eta = 0.07 raz = 2.3 decz = 1.5 vz = erfa.s2c(raz, decz) v = erfa.tpstv(xi, eta, vz) self.assertAlmostEqual(v[0], 0.02170030454907376677, places=15) self.assertAlmostEqual(v[1], 0.02060909590535367447, places=15) self.assertAlmostEqual(v[2], 0.9995520806583523804, places=14) def test_tpxes(self): ra = 1.3 dec = 1.55 raz = 2.3 decz = 1.5 xi, eta = erfa.tpxes(ra, dec, raz, decz) self.assertAlmostEqual(xi, -0.01753200983236980595, places=15) self.assertAlmostEqual(eta, 0.05962940005778712891, places=15) def test_tpxev(self): ra = 1.3 dec = 1.55 raz = 2.3 decz = 1.5 v = erfa.s2c(ra, dec) vz = erfa.s2c(raz, decz) xi, eta = erfa.tpxev(v, vz) self.assertAlmostEqual(xi, -0.01753200983236980595, places=15) self.assertAlmostEqual(eta, 0.05962940005778712891, places=15) ## some older version of Python 2.7 ## failed to use 'support' if __name__ == '__main__': if sys.version_info.major >= 3: try: from test import support except ImportError: from test import test_support as support support.run_unittest(Validate) else: unittest.main()
49.656716
113
0.647459
17,814
139,734
5.064837
0.096553
0.311887
0.13995
0.172923
0.707132
0.66762
0.605431
0.545403
0.450618
0.367537
0
0.349828
0.208761
139,734
2,813
114
49.674369
0.466223
0.005396
0
0.365415
0
0
0.000144
0
0
0
0
0
0.549121
1
0.094249
false
0
0.002796
0
0.097444
0
0
0
0
null
1
0
1
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
1
0
0
0
0
0
0
0
0
0
5
7078e8717fdd336a3cfbace8df7f1abd560884a6
47
py
Python
MergeSortedLinkLists/MergeKsortedlinkedlists00.py
tnkteja/notthisagain
85e2b2cbea1298a052986e9dfe5e73d022b537f3
[ "MIT" ]
null
null
null
MergeSortedLinkLists/MergeKsortedlinkedlists00.py
tnkteja/notthisagain
85e2b2cbea1298a052986e9dfe5e73d022b537f3
[ "MIT" ]
null
null
null
MergeSortedLinkLists/MergeKsortedlinkedlists00.py
tnkteja/notthisagain
85e2b2cbea1298a052986e9dfe5e73d022b537f3
[ "MIT" ]
null
null
null
from heapq import heappushpop def solution(A):
15.666667
29
0.808511
7
47
5.428571
1
0
0
0
0
0
0
0
0
0
0
0
0.12766
47
3
30
15.666667
0.926829
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.5
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
1
0
0
0
0
5
5616a94a62d2e2b41639cfb99c8bd17be9c433a2
53
py
Python
linkedin_jobs_scraper/query/__init__.py
magahet/py-linkedin-jobs-scraper
f0d69053455e68bd8a74ab2d79ab2c27b5e3f7d4
[ "MIT" ]
85
2020-10-21T04:09:23.000Z
2022-03-23T00:29:33.000Z
linkedin_jobs_scraper/query/__init__.py
magahet/py-linkedin-jobs-scraper
f0d69053455e68bd8a74ab2d79ab2c27b5e3f7d4
[ "MIT" ]
24
2020-11-18T10:10:32.000Z
2022-03-19T17:30:25.000Z
linkedin_jobs_scraper/query/__init__.py
magahet/py-linkedin-jobs-scraper
f0d69053455e68bd8a74ab2d79ab2c27b5e3f7d4
[ "MIT" ]
23
2020-11-18T09:31:13.000Z
2022-03-25T03:50:52.000Z
from .query import Query, QueryOptions, QueryFilters
26.5
52
0.830189
6
53
7.333333
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.113208
53
1
53
53
0.93617
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
1
0
0
5
56713b52bc3dd9b9b92ab8856d92caf06d75b040
652
py
Python
tests/test_util.py
opensanctions/nomenklatura
d845ff821a57beffb49b269b4d8c08f57bc588d7
[ "MIT" ]
4
2022-02-25T13:32:20.000Z
2022-03-15T23:35:42.000Z
tests/test_util.py
opensanctions/nomenklatura
d845ff821a57beffb49b269b4d8c08f57bc588d7
[ "MIT" ]
null
null
null
tests/test_util.py
opensanctions/nomenklatura
d845ff821a57beffb49b269b4d8c08f57bc588d7
[ "MIT" ]
1
2022-03-02T16:56:48.000Z
2022-03-02T16:56:48.000Z
from nomenklatura.util import is_qid, normalize_url def test_is_qid(): assert is_qid("Q7747") assert not is_qid("q7747") assert not is_qid("Q7747B") assert not is_qid("banana") def test_normalize_url(): assert normalize_url("http://pudo.org") == "http://pudo.org" assert normalize_url("http://pudo.org/blub") == "http://pudo.org/blub" assert normalize_url("http://pudo.org", {"q": "bla"}) == "http://pudo.org?q=bla" assert normalize_url("http://pudo.org", [("q", "bla")]) == "http://pudo.org?q=bla" assert ( normalize_url("http://pudo.org?t=1", {"q": "bla"}) == "http://pudo.org?t=1&q=bla" )
32.6
86
0.613497
98
652
3.928571
0.234694
0.207792
0.285714
0.285714
0.646753
0.646753
0.496104
0.324675
0.324675
0.324675
0
0.025735
0.165644
652
19
87
34.315789
0.681985
0
0
0
0
0
0.337423
0
0
0
0
0
0.6
1
0.133333
true
0
0.066667
0
0.2
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
1
0
0
1
0
0
0
0
0
0
5
56996dca0541939fc80483b25937d4e158c798b0
117
py
Python
znd4/tests/test_models.py
zdog234/personalWebsite
bc92910b06e698eb37d3733edf559e44ddf59bfb
[ "MIT" ]
null
null
null
znd4/tests/test_models.py
zdog234/personalWebsite
bc92910b06e698eb37d3733edf559e44ddf59bfb
[ "MIT" ]
1
2020-04-07T19:48:59.000Z
2020-04-07T19:48:59.000Z
znd4/tests/test_models.py
zdog234/personalWebsite
bc92910b06e698eb37d3733edf559e44ddf59bfb
[ "MIT" ]
null
null
null
"""Test the backend models module""" def test_foo(): """A fake test, because I just want to get nox to pass"""
19.5
61
0.649573
20
117
3.75
0.85
0
0
0
0
0
0
0
0
0
0
0
0.213675
117
5
62
23.4
0.815217
0.700855
0
0
0
0
0
0
0
0
0
0
0
1
1
true
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
1
0
0
0
1
0
0
5
3b3f59f8f2335e889d9633ab27e601ef41180f36
144
py
Python
Python Advanced/Advanced/Multidimensional Lists/Exercise - 2/Task01_02.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
1
2022-03-16T10:23:04.000Z
2022-03-16T10:23:04.000Z
Python Advanced/Advanced/Multidimensional Lists/Exercise - 2/Task01_02.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
null
null
null
Python Advanced/Advanced/Multidimensional Lists/Exercise - 2/Task01_02.py
IvanTodorovBG/SoftUni
7b667f6905d9f695ab1484efbb02b6715f6d569e
[ "MIT" ]
null
null
null
matrix = [sublist.split() for sublist in input().split("|")][::-1] print(' '.join([str(number) for sublist in matrix for number in sublist]))
28.8
74
0.659722
21
144
4.52381
0.52381
0.210526
0.252632
0
0
0
0
0
0
0
0
0.008
0.131944
144
4
75
36
0.752
0
0
0
0
0
0.014085
0
0
0
0
0
0
1
0
false
0
0
0
0
0.5
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
1
0
5
3b4cb3f4500daaa5b82538b0f39bf7bcee7699ef
2,577
py
Python
tests/cupy_tests/cuda_tests/test_device.py
themightyoarfish/cupy
8b8723568765abcbc5519297ffaeeafbf60e9bdf
[ "MIT" ]
1
2019-04-12T12:28:43.000Z
2019-04-12T12:28:43.000Z
tests/cupy_tests/cuda_tests/test_device.py
shreyasbapat/cupy
321ab5368ce6091bf7a4d86cfe1a63ff3352b1c4
[ "MIT" ]
null
null
null
tests/cupy_tests/cuda_tests/test_device.py
shreyasbapat/cupy
321ab5368ce6091bf7a4d86cfe1a63ff3352b1c4
[ "MIT" ]
null
null
null
import unittest import pytest import six from cupy import cuda class TestDeviceComparison(unittest.TestCase): def check_eq(self, result, obj1, obj2): if result: assert obj1 == obj2 assert obj2 == obj1 assert not (obj1 != obj2) assert not (obj2 != obj1) else: assert obj1 != obj2 assert obj2 != obj1 assert not (obj1 == obj2) assert not (obj2 == obj1) def test_equality(self): self.check_eq(True, cuda.Device(0), cuda.Device(0)) self.check_eq(True, cuda.Device(1), cuda.Device(1)) self.check_eq(False, cuda.Device(0), cuda.Device(1)) self.check_eq(False, cuda.Device(0), 0) self.check_eq(False, cuda.Device(0), None) self.check_eq(False, cuda.Device(0), object()) def test_lt_device(self): assert cuda.Device(0) < cuda.Device(1) assert not (cuda.Device(0) < cuda.Device(0)) assert not (cuda.Device(1) < cuda.Device(0)) def test_le_device(self): assert cuda.Device(0) <= cuda.Device(1) assert cuda.Device(0) <= cuda.Device(0) assert not (cuda.Device(1) <= cuda.Device(0)) def test_gt_device(self): assert not (cuda.Device(0) > cuda.Device(0)) assert not (cuda.Device(0) > cuda.Device(0)) assert cuda.Device(1) > cuda.Device(0) def test_ge_device(self): assert not (cuda.Device(0) >= cuda.Device(1)) assert cuda.Device(0) >= cuda.Device(0) assert cuda.Device(1) >= cuda.Device(0) def check_comparison_other_type(self, obj1, obj2): with pytest.raises(TypeError): obj1 < obj2 with pytest.raises(TypeError): obj1 <= obj2 with pytest.raises(TypeError): obj1 > obj2 with pytest.raises(TypeError): obj1 >= obj2 with pytest.raises(TypeError): obj2 < obj1 with pytest.raises(TypeError): obj2 <= obj1 with pytest.raises(TypeError): obj2 > obj1 with pytest.raises(TypeError): obj2 >= obj1 @unittest.skipIf( six.PY2, 'Python 2 comparison result of objects is arbitrary') def test_comparison_other_type(self): self.check_comparison_other_type(cuda.Device(0), 0) self.check_comparison_other_type(cuda.Device(0), 1) self.check_comparison_other_type(cuda.Device(1), 0) self.check_comparison_other_type(cuda.Device(1), None) self.check_comparison_other_type(cuda.Device(1), object())
33.467532
70
0.602251
339
2,577
4.469027
0.141593
0.250825
0.181518
0.09901
0.79538
0.794719
0.753135
0.717492
0.584818
0.565677
0
0.042988
0.277842
2,577
76
71
33.907895
0.771091
0
0
0.15625
0
0
0.019402
0
0
0
0
0
0.3125
1
0.125
false
0
0.0625
0
0.203125
0
0
0
0
null
1
1
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
0
0
0
0
0
0
0
0
0
5
3b5f55759aafa376cb6c7759635f34b65e631287
126
py
Python
telegram_logging/__init__.py
lbltavares/telegram-logging
7aa726fbdee09222623022c5136212ba1b7af55c
[ "MIT" ]
10
2021-11-16T15:34:03.000Z
2021-11-19T14:18:37.000Z
telegram_logging/__init__.py
lbltavares/telegram-logging
7aa726fbdee09222623022c5136212ba1b7af55c
[ "MIT" ]
null
null
null
telegram_logging/__init__.py
lbltavares/telegram-logging
7aa726fbdee09222623022c5136212ba1b7af55c
[ "MIT" ]
null
null
null
"""A simple Telegram logging module with Handler and Formatter. """ from .telegram import TelegramFormatter, TelegramHandler
25.2
63
0.801587
14
126
7.214286
0.928571
0
0
0
0
0
0
0
0
0
0
0
0.126984
126
4
64
31.5
0.918182
0.47619
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
1
0
0
5
8e7c0360106c9b7d1ec176cae6b39801d0eac5e0
158
py
Python
cryptography/rot13/__init__.py
BrianLusina/PyCharm
144dd4f6b2d254507237f46c8ee175c407fe053d
[ "Apache-2.0", "MIT" ]
null
null
null
cryptography/rot13/__init__.py
BrianLusina/PyCharm
144dd4f6b2d254507237f46c8ee175c407fe053d
[ "Apache-2.0", "MIT" ]
null
null
null
cryptography/rot13/__init__.py
BrianLusina/PyCharm
144dd4f6b2d254507237f46c8ee175c407fe053d
[ "Apache-2.0", "MIT" ]
null
null
null
import codecs def rot13(message: str) -> str: """ >>> rot13("Hello, World!") 'Uryyb, Jbeyq!' """ return codecs.encode(message, "rot13")
15.8
42
0.556962
17
158
5.176471
0.705882
0
0
0
0
0
0
0
0
0
0
0.05042
0.246835
158
9
43
17.555556
0.689076
0.265823
0
0
0
0
0.052083
0
0
0
0
0
0
1
0.333333
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
5
8ea1779725e4d34c62beffa616f9e331f4de1f73
168
py
Python
supabase_py/__init__.py
bariqhibat/supabase-py
b20703d3d4117c911092212a796e53eb2f5286ca
[ "MIT" ]
null
null
null
supabase_py/__init__.py
bariqhibat/supabase-py
b20703d3d4117c911092212a796e53eb2f5286ca
[ "MIT" ]
null
null
null
supabase_py/__init__.py
bariqhibat/supabase-py
b20703d3d4117c911092212a796e53eb2f5286ca
[ "MIT" ]
null
null
null
__version__ = "0.0.2" from supabase_py import client, lib from supabase_py.client import Client, create_client __all__ = ["client", "lib", "Client", "create_client"]
24
54
0.744048
24
168
4.708333
0.458333
0.212389
0.247788
0
0
0
0
0
0
0
0
0.020408
0.125
168
6
55
28
0.748299
0
0
0
0
0
0.196429
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
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
1
0
0
0
0
5
8ec35e004395531ed48ce8d63e45c91ccabc9d8c
92
py
Python
02-functions-as-objects/02_function_as_object.py
saidulislam/Functional-Programming-in-Python
27ae205f9cf0fa38e16e29089cf72981f8a51a78
[ "Apache-2.0" ]
null
null
null
02-functions-as-objects/02_function_as_object.py
saidulislam/Functional-Programming-in-Python
27ae205f9cf0fa38e16e29089cf72981f8a51a78
[ "Apache-2.0" ]
null
null
null
02-functions-as-objects/02_function_as_object.py
saidulislam/Functional-Programming-in-Python
27ae205f9cf0fa38e16e29089cf72981f8a51a78
[ "Apache-2.0" ]
null
null
null
def square(x): return x*x print(type(square)) print(id(square)) print(str(square))
15.333333
20
0.652174
15
92
4
0.533333
0.366667
0
0
0
0
0
0
0
0
0
0
0.173913
92
6
21
15.333333
0.789474
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0
0.2
0.4
0.6
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
0
1
0
5
8ee4b87adbb510cf4194d0f9066b8e2c7cba63b5
2,856
py
Python
venv/lib/python3.7/site-packages/rqdatac/services/orm/cash_flow_sql.py
CatTiger/vnpy
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
[ "MIT" ]
null
null
null
venv/lib/python3.7/site-packages/rqdatac/services/orm/cash_flow_sql.py
CatTiger/vnpy
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
[ "MIT" ]
1
2020-04-21T02:42:32.000Z
2020-04-21T02:42:32.000Z
venv/lib/python3.7/site-packages/rqdatac/services/orm/cash_flow_sql.py
CatTiger/vnpy
7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b
[ "MIT" ]
null
null
null
# coding: utf-8 from sqlalchemy import Numeric, Column from .fundamental_base_sql import FundamentalBase class StkCashGen(FundamentalBase): cash_received_from_sales_of_goods = Column(Numeric(18, 2)) rental_cash = Column(Numeric(18, 2)) refunds_of_vat = Column(Numeric(18, 2)) refunds_of_other_taxes = Column(Numeric(18, 2)) refunds_of_taxes = Column(Numeric(18, 2)) cash_from_other_operating_activities = Column(Numeric(18, 2)) cash_from_operating_activities = Column(Numeric(18, 2)) cash_paid_for_goods_and_services = Column(Numeric(18, 2)) cash_paid_for_rental = Column(Numeric(18, 2)) cash_paid_for_employee = Column(Numeric(18, 2)) cash_paid_for_taxes = Column(Numeric(18, 2)) cash_paid_for_other_operation_activities = Column(Numeric(18, 2)) cash_paid_for_operation_activities = Column(Numeric(18, 2)) cash_flow_from_operating_activities = Column(Numeric(18, 2)) cash_received_from_disposal_of_investment = Column(Numeric(18, 2)) cash_received_from_dividend = Column(Numeric(18, 2)) cash_received_from_interest = Column(Numeric(18, 2)) cash_received_from_disposal_of_asset = Column(Numeric(18, 2)) cash_received_from_other_investment_activities = Column(Numeric(18, 2)) cash_received_from_investment_activities = Column(Numeric(18, 2)) cash_paid_for_asset = Column(Numeric(18, 2)) cash_paid_to_acquire_investment = Column(Numeric(18, 2)) cash_paid_for_other_investment_activities = Column(Numeric(18, 2)) cash_paid_for_investment_activities = Column(Numeric(18, 2)) cash_flow_from_investing_activities = Column(Numeric(18, 2)) cash_received_from_equity_investors = Column(Numeric(18, 2)) cash_received_from_debt_investors = Column(Numeric(18, 2)) cash_received_from_investors = Column(Numeric(18, 2)) cash_received_from_financial_institution_borrows = Column(Numeric(18, 2)) cash_received_from_other_financing_activities = Column(Numeric(18, 2)) cash_received_from_financing_activities = Column(Numeric(18, 2)) cash_paid_for_debt = Column(Numeric(18, 2)) cash_paid_for_dividend_and_interest = Column(Numeric(18, 2)) cash_paid_for_other_financing_activities = Column(Numeric(18, 2)) cash_paid_to_financing_activities = Column(Numeric(18, 2)) cash_flow_from_financing_activities = Column(Numeric(18, 2)) assets_depreciation_reserves = Column(Numeric(18, 2)) fixed_asset_depreciation = Column(Numeric(18, 2)) intangible_asset_amortization = Column(Numeric(18, 2)) deferred_expense_amort = Column(Numeric(18, 2)) net_inc_cash_and_equivalents = Column(Numeric(19, 4)) exchange_rate_change_effect = Column(Numeric(19, 4)) cash_equivalent_increase = Column(Numeric(19, 4)) net_cash_deal_from_sub = Column(Numeric(19, 4)) net_cash_payment_from_sub = Column(Numeric(19, 4))
51
77
0.769608
405
2,856
5.019753
0.180247
0.287752
0.29513
0.314806
0.724053
0.721594
0.607969
0.454993
0.087555
0
0
0.054927
0.133053
2,856
55
78
51.927273
0.766155
0.004552
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.041667
0
1
0
0
0
0
null
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
5
d92ec87e9c23ab1bc746b9aa9daa64bbc47e9ba3
181
py
Python
Myboard/Board/admin.py
Chen1996-1/Django_Myboard
0f87ab5ebe8c7a98544bf0eccb7ada12b737ffd5
[ "Apache-2.0" ]
null
null
null
Myboard/Board/admin.py
Chen1996-1/Django_Myboard
0f87ab5ebe8c7a98544bf0eccb7ada12b737ffd5
[ "Apache-2.0" ]
null
null
null
Myboard/Board/admin.py
Chen1996-1/Django_Myboard
0f87ab5ebe8c7a98544bf0eccb7ada12b737ffd5
[ "Apache-2.0" ]
null
null
null
from django.contrib import admin from .models import Board,Topic,Post admin.site.register(Board) admin.site.register(Topic) admin.site.register(Post) # Register your models here.
20.111111
36
0.801105
27
181
5.37037
0.481481
0.186207
0.351724
0
0
0
0
0
0
0
0
0
0.099448
181
8
37
22.625
0.889571
0.143646
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
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
1
0
1
0
0
0
0
5
d9648768bacc20052057f16e8dde6dc84cdadea8
7,169
py
Python
migrations/versions/9c1435b5ebf2_.py
limvus/limbook-api
26c1c2493c4115532b3c8cdc8f6c79c16108ca20
[ "MIT" ]
null
null
null
migrations/versions/9c1435b5ebf2_.py
limvus/limbook-api
26c1c2493c4115532b3c8cdc8f6c79c16108ca20
[ "MIT" ]
32
2020-05-10T03:42:43.000Z
2022-01-13T02:40:25.000Z
migrations/versions/9c1435b5ebf2_.py
limvus/limbook-api
26c1c2493c4115532b3c8cdc8f6c79c16108ca20
[ "MIT" ]
null
null
null
"""empty message Revision ID: 9c1435b5ebf2 Revises: 77a61d457456 Create Date: 2020-05-25 00:01:29.210876 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = '9c1435b5ebf2' down_revision = '77a61d457456' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_table('role_permission') op.drop_table('friend') op.drop_table('user') op.drop_table('permission') op.drop_table('role') op.alter_column( 'comment', 'user_id', existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=False) op.alter_column( 'image', 'user_id', existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=False) op.alter_column( 'post', 'user_id', existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=False) op.alter_column( 'react', 'user_id', existing_type=sa.INTEGER(), type_=sa.String(), existing_nullable=False) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column( 'react', 'user_id', existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=False) op.alter_column( 'post', 'user_id', existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=False) op.alter_column( 'image', 'user_id', existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=False) op.alter_column( 'comment', 'user_id', existing_type=sa.String(), type_=sa.INTEGER(), existing_nullable=False) op.create_table( 'role', sa.Column('created_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('updated_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('id', sa.INTEGER(), server_default=sa.text( "nextval('role_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('slug', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('description', sa.VARCHAR(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='role_pkey'), sa.UniqueConstraint('slug', name='role_slug_key'), postgresql_ignore_search_path=False ) op.create_table( 'permission', sa.Column('created_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('updated_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('id', sa.INTEGER(), server_default=sa.text( "nextval('permission_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('slug', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('description', sa.VARCHAR(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='permission_pkey'), sa.UniqueConstraint('slug', name='permission_slug_key'), postgresql_ignore_search_path=False ) op.create_table( 'user', sa.Column('created_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('updated_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('first_name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('last_name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('email', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('email_verified', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('email_verif_code', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('email_verif_code_expires_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('password_reset_code', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('password_reset_code_expires_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('phone_number', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('profile_picture', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('cover_picture', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('password', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('role_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['role_id'], ['role.id'], name='user_role_id_fkey'), sa.PrimaryKeyConstraint('id', name='user_pkey'), sa.UniqueConstraint('email', name='user_email_key') ) op.create_table( 'friend', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('created_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('updated_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('requester_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('receiver_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('is_friend', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='friend_pkey') ) op.create_table( 'role_permission', sa.Column('role_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('permission_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['permission_id'], ['permission.id'], name='role_permission_permission_id_fkey'), sa.ForeignKeyConstraint(['role_id'], ['role.id'], name='role_permission_role_id_fkey', ondelete='CASCADE'), sa.PrimaryKeyConstraint('role_id', 'permission_id', name='role_permission_pkey') ) # ### end Alembic commands ###
39.39011
75
0.58474
715
7,169
5.685315
0.146853
0.070849
0.204674
0.129643
0.803198
0.784748
0.769004
0.740467
0.683395
0.524477
0
0.010504
0.282885
7,169
181
76
39.607735
0.780198
0.041149
0
0.646341
0
0
0.135147
0.027644
0
0
0
0
0
1
0.012195
false
0.018293
0.018293
0
0.030488
0
0
0
0
null
0
1
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
5