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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67345b00f508ae5ba3807db64792af962461e374 | 386 | py | Python | setup.py | ariarijp/redash-json-logger-destination | df36b0b6bca8bb4da173b84f84a8c8701a56cd95 | [
"MIT"
] | null | null | null | setup.py | ariarijp/redash-json-logger-destination | df36b0b6bca8bb4da173b84f84a8c8701a56cd95 | [
"MIT"
] | null | null | null | setup.py | ariarijp/redash-json-logger-destination | df36b0b6bca8bb4da173b84f84a8c8701a56cd95 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='redash_json_logger_destination',
version='0.1.0',
description='JSON Logger Alert Destination for Redash',
author='Takuya Arita',
author_email='takuya.arita@gmail.com',
url='https://github.com/ariarijp/redash-json-logger-destination',
packages=[
'redash_json_logger_destination',
],
license='MIT',
)
| 25.733333 | 69 | 0.694301 | 46 | 386 | 5.673913 | 0.608696 | 0.153257 | 0.183908 | 0.310345 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009404 | 0.173575 | 386 | 14 | 70 | 27.571429 | 0.808777 | 0 | 0 | 0 | 0 | 0 | 0.518135 | 0.212435 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.076923 | 0 | 0.076923 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
67417bdad11c4318663da4ebd72d33c5831a0b24 | 179 | py | Python | hibernia/server/run.py | diegojromerolopez/hibernia | f14da11616b292cd30b80d7464017874d869d91c | [
"MIT"
] | null | null | null | hibernia/server/run.py | diegojromerolopez/hibernia | f14da11616b292cd30b80d7464017874d869d91c | [
"MIT"
] | 1 | 2021-08-14T23:24:05.000Z | 2021-08-14T23:24:05.000Z | hibernia/server/run.py | diegojromerolopez/hibernia | f14da11616b292cd30b80d7464017874d869d91c | [
"MIT"
] | null | null | null | from aiohttp import web
from hibernia.server.kvstore.routes import ROUTES
if __name__ == '__main__':
app = web.Application()
app.add_routes(ROUTES)
web.run_app(app)
| 19.888889 | 49 | 0.726257 | 25 | 179 | 4.8 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173184 | 179 | 8 | 50 | 22.375 | 0.810811 | 0 | 0 | 0 | 0 | 0 | 0.044693 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
6748d1d92c7dda181bf1a6f60bbad385c0c269d5 | 344 | py | Python | docassemble/mnAssign2/mnLAAIndividual.py | moriahnoel/docassemble-mnAssign2 | 329beac76b4ad59fbe08a9e7ef293388113b4458 | [
"MIT"
] | null | null | null | docassemble/mnAssign2/mnLAAIndividual.py | moriahnoel/docassemble-mnAssign2 | 329beac76b4ad59fbe08a9e7ef293388113b4458 | [
"MIT"
] | null | null | null | docassemble/mnAssign2/mnLAAIndividual.py | moriahnoel/docassemble-mnAssign2 | 329beac76b4ad59fbe08a9e7ef293388113b4458 | [
"MIT"
] | null | null | null | from docassemble.base.util import Individual, DAObject, DAList, Value
class LAAIndividual(Individual):
def init(self, *pargs, **kwargs):
self.initializeAttribute('annualIncome', Value)
self.initializeAttribute('monthlyIncome', Value)
self.initializeAttribute('assets', Value)
super(LAAIndividual, self).init(*pargs, **kwargs) | 43 | 69 | 0.755814 | 35 | 344 | 7.428571 | 0.6 | 0.265385 | 0.215385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116279 | 344 | 8 | 70 | 43 | 0.855263 | 0 | 0 | 0 | 0 | 0 | 0.089855 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.142857 | 0 | 0.428571 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
675a27634897b0827120c168a072f899c1fd3332 | 125 | py | Python | reinvent_chemistry/library_design/reaction_definitions/building_block_pair_dto.py | MolecularAI/reinvent-chemistry | bf0235bc2b1168b1db54c1e04bdba04b166ab7bf | [
"MIT"
] | null | null | null | reinvent_chemistry/library_design/reaction_definitions/building_block_pair_dto.py | MolecularAI/reinvent-chemistry | bf0235bc2b1168b1db54c1e04bdba04b166ab7bf | [
"MIT"
] | null | null | null | reinvent_chemistry/library_design/reaction_definitions/building_block_pair_dto.py | MolecularAI/reinvent-chemistry | bf0235bc2b1168b1db54c1e04bdba04b166ab7bf | [
"MIT"
] | 1 | 2022-03-22T15:24:13.000Z | 2022-03-22T15:24:13.000Z | from dataclasses import dataclass
@dataclass
class BuildingBlockPairDTO:
scaffold_block: str
decoration_block: str
| 15.625 | 33 | 0.8 | 13 | 125 | 7.538462 | 0.769231 | 0.163265 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168 | 125 | 7 | 34 | 17.857143 | 0.942308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
676e296db27c75858c30a14993262aa517212f17 | 1,096 | py | Python | sb/Data/Packages/Default/Transform.py | luc4spas/SISGE-ACONCHEGO | 77096a81f09b286a3793c7cb9cee9941c1fae803 | [
"MIT"
] | null | null | null | sb/Data/Packages/Default/Transform.py | luc4spas/SISGE-ACONCHEGO | 77096a81f09b286a3793c7cb9cee9941c1fae803 | [
"MIT"
] | null | null | null | sb/Data/Packages/Default/Transform.py | luc4spas/SISGE-ACONCHEGO | 77096a81f09b286a3793c7cb9cee9941c1fae803 | [
"MIT"
] | null | null | null | import sublime, sublimeplugin
import string
import textwrap
import re
import functools
def transformSelectionText(f, v):
for s in v.sel():
if not s.empty():
txt = f(v.substr(s))
v.replace(s, txt)
class SwapCaseCommand(sublimeplugin.TextCommand):
def run(self, view, args):
transformSelectionText(string.swapcase, view)
def isEnabled(self, view, args):
return view.hasNonEmptySelectionRegion()
class UpperCaseCommand(sublimeplugin.TextCommand):
def run(self, view, args):
transformSelectionText(string.upper, view)
def isEnabled(self, view, args):
return view.hasNonEmptySelectionRegion()
class LowerCaseCommand(sublimeplugin.TextCommand):
def run(self, view, args):
transformSelectionText(string.lower, view)
def isEnabled(self, view, args):
return view.hasNonEmptySelectionRegion()
class TitleCaseCommand(sublimeplugin.TextCommand):
def title(self, s):
return string.capwords(s, " ")
def run(self, view, args):
transformSelectionText(functools.partial(self.title), view)
def isEnabled(self, view, args):
return view.hasNonEmptySelectionRegion()
| 23.319149 | 61 | 0.763686 | 127 | 1,096 | 6.590551 | 0.314961 | 0.076464 | 0.114695 | 0.066906 | 0.622461 | 0.622461 | 0.574671 | 0.574671 | 0.574671 | 0.247312 | 0 | 0 | 0.126825 | 1,096 | 46 | 62 | 23.826087 | 0.874608 | 0 | 0 | 0.375 | 0 | 0 | 0.000912 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3125 | false | 0 | 0.15625 | 0.15625 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
67721cef95d388c2f232819ec954af12ea21bd73 | 132 | py | Python | src/timeatlas/types/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 10 | 2020-08-25T09:23:02.000Z | 2021-01-12T14:00:35.000Z | src/timeatlas/types/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | 140 | 2020-06-30T11:59:47.000Z | 2021-08-23T20:58:43.000Z | src/timeatlas/types/__init__.py | fredmontet/timeatlas | 9a439a913ef9a8a1ef9833b42e5fb4e988d7e35e | [
"MIT"
] | null | null | null | from .coords import Coords
from .sensor import Sensor
from .unit import Unit
__all__ = [
"Coords",
"Sensor",
"Unit",
]
| 13.2 | 26 | 0.643939 | 16 | 132 | 5.0625 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.242424 | 132 | 9 | 27 | 14.666667 | 0.81 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.375 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
677bd5ad71b98eb088c785a9e91d5e45c731b042 | 128 | py | Python | chemml/data/__init__.py | ZHENTAN007/Chem-Graph-Kernel-Machine | 963fdad2d0d6f2bfd962778caee0591b44ecbdcd | [
"MIT"
] | 7 | 2021-02-28T11:44:12.000Z | 2021-12-13T07:17:05.000Z | chemml/data/__init__.py | ZHENTAN007/Chem-Graph-Kernel-Machine | 963fdad2d0d6f2bfd962778caee0591b44ecbdcd | [
"MIT"
] | 2 | 2021-05-13T14:08:48.000Z | 2021-06-14T12:28:20.000Z | chemml/data/__init__.py | ZHENTAN007/Chem-Graph-Kernel-Machine | 963fdad2d0d6f2bfd962778caee0591b44ecbdcd | [
"MIT"
] | 4 | 2021-03-05T08:20:47.000Z | 2021-12-13T07:17:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .data import Dataset, SubDataset
__all__ = [
'Dataset', 'SubDataset'
]
| 14.222222 | 37 | 0.625 | 15 | 128 | 5.066667 | 0.866667 | 0.447368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009615 | 0.1875 | 128 | 8 | 38 | 16 | 0.721154 | 0.328125 | 0 | 0 | 0 | 0 | 0.202381 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
67951bed8d15bddeb1c9597e284ce108daa51928 | 311 | py | Python | mlops/model_analysis/consts.py | colingwuyu/mlops | 56ba9b7169c183c1f89ead64670ebfe873f9694c | [
"Apache-2.0"
] | 1 | 2022-01-11T01:17:08.000Z | 2022-01-11T01:17:08.000Z | mlops/model_analysis/consts.py | colingwuyu/mlops | 56ba9b7169c183c1f89ead64670ebfe873f9694c | [
"Apache-2.0"
] | null | null | null | mlops/model_analysis/consts.py | colingwuyu/mlops | 56ba9b7169c183c1f89ead64670ebfe873f9694c | [
"Apache-2.0"
] | null | null | null | TIME_FORMAT = "%Y-%m-%d, %H:%M:%S"
FILE_TRAIN_DATA_STATS = "train_data_stats.txt"
FILE_EVAL_DATA_STATS = "eval_data_stats.txt"
FILE_PREV_EVAL_DATA_STATS = "prev_eval_data_stats.txt"
FILE_DATA_SCHEMA = "schema.txt"
FILE_EVAL_RESULT = "eval_result.txt"
VALIDATION_SUCCESS = "success"
VALIDATION_FAIL = "fail"
| 23.923077 | 54 | 0.778135 | 51 | 311 | 4.254902 | 0.372549 | 0.248848 | 0.239631 | 0.221198 | 0.184332 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093248 | 311 | 12 | 55 | 25.916667 | 0.769504 | 0 | 0 | 0 | 0 | 0 | 0.376206 | 0.07717 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
679b936221a5c45f04850a19ba530085334eb73b | 1,493 | py | Python | tests/test_atari.py | FragileTech/plangym | 9a1482bea099f12f82bae27f1c5d13393daa8032 | [
"MIT"
] | 3 | 2020-03-25T22:19:17.000Z | 2020-11-02T16:11:32.000Z | tests/test_atari.py | FragileTech/plangym | 9a1482bea099f12f82bae27f1c5d13393daa8032 | [
"MIT"
] | 44 | 2020-03-25T14:17:54.000Z | 2022-03-12T00:18:48.000Z | tests/test_atari.py | FragileTech/plangym | 9a1482bea099f12f82bae27f1c5d13393daa8032 | [
"MIT"
] | 2 | 2020-03-25T12:17:12.000Z | 2020-06-19T23:07:52.000Z | from gym.wrappers import TimeLimit
import numpy
import numpy as np
import pytest
from plangym.atari import ale_to_ram, AtariEnvironment
from tests import SKIP_ATARI_TESTS
if SKIP_ATARI_TESTS:
pytest.skip("Atari not installed, skipping", allow_module_level=True)
from tests.api_tests import batch_size, display, TestBaseEnvironment, TestGymEnvironment
def pacman_obs():
return AtariEnvironment(name="MsPacman-v0", clone_seeds=True, autoreset=True)
def qbert_ram():
return AtariEnvironment(name="Qbert-ram-v0", clone_seeds=False, autoreset=False)
def pong_obs_ram():
timelimit = [(TimeLimit, {"max_episode_steps": 1000})]
return AtariEnvironment(
name="PongDeterministic-v4",
remove_time_limit=True,
possible_to_win=True,
wrappers=timelimit,
)
def qbert_new_ale():
return AtariEnvironment(name="ALE/Qbert-v5")
environments = [pacman_obs, qbert_ram, pong_obs_ram, qbert_new_ale]
@pytest.fixture(params=environments, scope="class")
def env(request) -> AtariEnvironment:
return request.param()
class TestAtariEnv:
def test_ale_to_ram(self, env):
ram = ale_to_ram(env.ale)
assert isinstance(ram, numpy.ndarray)
assert (ram == env.get_ram()).all()
def test_get_image(self):
env = pacman_obs()
obs = env.get_image()
assert isinstance(obs, np.ndarray)
def test_n_actions(self, env):
n_actions = env.n_actions
assert isinstance(n_actions, int)
| 25.305085 | 88 | 0.717348 | 196 | 1,493 | 5.234694 | 0.392857 | 0.08577 | 0.101365 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006557 | 0.182853 | 1,493 | 58 | 89 | 25.741379 | 0.834426 | 0 | 0 | 0 | 0 | 0 | 0.070998 | 0 | 0 | 0 | 0 | 0 | 0.102564 | 1 | 0.205128 | false | 0 | 0.179487 | 0.102564 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
679bd0a2d9860ad291cef8dbd51753a60b1e0052 | 778 | py | Python | decharges/decharge/forms/__init__.py | Brndan/decharges-sudeducation | 6807b619f48b3c0b1dda4cd56d0a1cf46695e1f3 | [
"MIT"
] | null | null | null | decharges/decharge/forms/__init__.py | Brndan/decharges-sudeducation | 6807b619f48b3c0b1dda4cd56d0a1cf46695e1f3 | [
"MIT"
] | null | null | null | decharges/decharge/forms/__init__.py | Brndan/decharges-sudeducation | 6807b619f48b3c0b1dda4cd56d0a1cf46695e1f3 | [
"MIT"
] | null | null | null | from decharges.decharge.forms.import_temps_syndicats_form import (
ImportTempsSyndicatsForm,
)
from decharges.decharge.forms.renommer_beneficiaire_form import RenommerBeneficiaireForm
from decharges.decharge.forms.temps_de_decharge_form import (
QuotaETPFederationForm,
TempsDeDechargeForm,
)
from decharges.decharge.forms.utilisation_credit_de_temps_syndical_ponctuel_form import (
UtilisationCreditDeTempsSyndicalPonctuelForm,
)
from decharges.decharge.forms.utilisation_temps_decharge_form import (
UtilisationTempsDechargeForm,
)
__all__ = [
"QuotaETPFederationForm",
"UtilisationCreditDeTempsSyndicalPonctuelForm",
"UtilisationTempsDechargeForm",
"ImportTempsSyndicatsForm",
"RenommerBeneficiaireForm",
"TempsDeDechargeForm",
]
| 32.416667 | 89 | 0.829049 | 60 | 778 | 10.4 | 0.366667 | 0.104167 | 0.168269 | 0.208333 | 0.11859 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107969 | 778 | 23 | 90 | 33.826087 | 0.899135 | 0 | 0 | 0 | 0 | 0 | 0.206941 | 0.182519 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.318182 | 0 | 0.318182 | 0 | 0 | 0 | 1 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
679f37624cd6c282d387a66146f4723bbdc31957 | 117 | py | Python | python/ql/src/Statements/SysExitUsed.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 4,036 | 2020-04-29T00:09:57.000Z | 2022-03-31T14:16:38.000Z | python/ql/src/Statements/SysExitUsed.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 2,970 | 2020-04-28T17:24:18.000Z | 2022-03-31T22:40:46.000Z | python/ql/src/Statements/SysExitUsed.py | ScriptBox99/github-codeql | 2ecf0d3264db8fb4904b2056964da469372a235c | [
"MIT"
] | 794 | 2020-04-29T00:28:25.000Z | 2022-03-30T08:21:46.000Z | import sys
def main():
try:
process()
except Exception as ex:
print(ex)
sys.exit(1)
| 13 | 27 | 0.512821 | 15 | 117 | 4 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013889 | 0.384615 | 117 | 8 | 28 | 14.625 | 0.819444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | true | 0 | 0.142857 | 0 | 0.285714 | 0.142857 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
67b12ffe31740e30882b421595188501e49df330 | 336 | py | Python | def/2.py | janusnic/py-21v | 6c90bf2f144e4903cb2fa97b3b80c4b39852b93b | [
"MIT"
] | null | null | null | def/2.py | janusnic/py-21v | 6c90bf2f144e4903cb2fa97b3b80c4b39852b93b | [
"MIT"
] | null | null | null | def/2.py | janusnic/py-21v | 6c90bf2f144e4903cb2fa97b3b80c4b39852b93b | [
"MIT"
] | null | null | null | def add(x, y):
return x + y
print add(1, 10)
print add('abc', 'def')
def hello():
print "Hello"
def area(w, h):
return w * h
def print_welcome(name):
print "Welcome", name
hello()
hello()
print_welcome("Fred")
w = 4
h = 5
print "width =", w, "height =", h, "area =", area(w, h)
def func():
pass
print(func()) | 12.444444 | 55 | 0.568452 | 56 | 336 | 3.375 | 0.392857 | 0.031746 | 0.063492 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019531 | 0.238095 | 336 | 27 | 56 | 12.444444 | 0.71875 | 0 | 0 | 0.105263 | 0 | 0 | 0.127596 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.052632 | 0 | null | null | 0.421053 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 3 |
67b525cf102edd7e7fd68e13192122556f106b64 | 430 | py | Python | voting/ballot_maker/colors.py | dugan/pyvote | 2bf85327db49520fac194d19893aec7c31059650 | [
"MIT"
] | null | null | null | voting/ballot_maker/colors.py | dugan/pyvote | 2bf85327db49520fac194d19893aec7c31059650 | [
"MIT"
] | null | null | null | voting/ballot_maker/colors.py | dugan/pyvote | 2bf85327db49520fac194d19893aec7c31059650 | [
"MIT"
] | null | null | null |
class Color(object):
def __init__(self, r : float, g : float, b : float):
self.r = r
self.g = g
self.b = b
def tuple(self):
return (self.r, self.g, self.b)
class Gray(Color):
# intensity bet
def __init__(self, intensity : float):
self.r = self.g = self.b = intensity
self.intensity = intensity
def __repr__(self):
return "colors.Gray(%s)" % (self.intensity,)
Black = Gray(0)
White = Gray(1)
| 18.695652 | 54 | 0.618605 | 66 | 430 | 3.848485 | 0.333333 | 0.07874 | 0.070866 | 0.07874 | 0.11811 | 0.11811 | 0 | 0 | 0 | 0 | 0 | 0.006042 | 0.230233 | 430 | 22 | 55 | 19.545455 | 0.761329 | 0.030233 | 0 | 0 | 0 | 0 | 0.036232 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0 | 0.133333 | 0.533333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
67d7f23b7e49acd4dda586c78b8c749d82147ac3 | 278 | py | Python | src/slidelint/__init__.py | enkidulan/slidelint | ddc99831ce2129254deba580665842b0cdb05a17 | [
"Apache-2.0"
] | 7 | 2015-02-11T14:36:14.000Z | 2021-07-15T13:57:00.000Z | src/slidelint/__init__.py | timvideos/slidelint | 145a273fb188def19da3f57bbd0ab247f34d7c3f | [
"Apache-2.0"
] | null | null | null | src/slidelint/__init__.py | timvideos/slidelint | 145a273fb188def19da3f57bbd0ab247f34d7c3f | [
"Apache-2.0"
] | 1 | 2020-12-21T05:23:59.000Z | 2020-12-21T05:23:59.000Z | """ Reads in PDF of presentation slides and checks common problems,
outputs a summary report on the problems. """
import logging.config as _logging_config
import os.path
_logging_config.fileConfig(
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'logging.conf'))
| 30.888889 | 77 | 0.773381 | 41 | 278 | 5.04878 | 0.682927 | 0.115942 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122302 | 278 | 8 | 78 | 34.75 | 0.848361 | 0.377698 | 0 | 0 | 0 | 0 | 0.072727 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
67e012afcd9ee6c6461b09dafc913d1f435685b7 | 172 | py | Python | simprod-scripts/resources/scripts/jcorsika/corsika.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 1 | 2020-12-24T22:00:01.000Z | 2020-12-24T22:00:01.000Z | simprod-scripts/resources/scripts/jcorsika/corsika.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | null | null | null | simprod-scripts/resources/scripts/jcorsika/corsika.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 3 | 2020-07-17T09:20:29.000Z | 2021-03-30T16:44:18.000Z | #!/usr/bin/env python
from optparse import OptionParser
from icecube.simprod.jcorsika import Corsika
parser = OptionParser()
corsika = Corsika(parser)
corsika.Execute()
| 17.2 | 44 | 0.790698 | 21 | 172 | 6.47619 | 0.666667 | 0.191176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116279 | 172 | 9 | 45 | 19.111111 | 0.894737 | 0.116279 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 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 | 3 |
67e295c1bbbf29f39052d722b90fd7ca8755352d | 1,046 | py | Python | src/algorithms/factory.py | kristery/dmcontrol-generalization-benchmark | c732d3292e23ef70b9a5e1a9f573b51a5195d28d | [
"MIT"
] | null | null | null | src/algorithms/factory.py | kristery/dmcontrol-generalization-benchmark | c732d3292e23ef70b9a5e1a9f573b51a5195d28d | [
"MIT"
] | null | null | null | src/algorithms/factory.py | kristery/dmcontrol-generalization-benchmark | c732d3292e23ef70b9a5e1a9f573b51a5195d28d | [
"MIT"
] | null | null | null | from algorithms.curl import CURL
from algorithms.drq import DrQ
from algorithms.pad import PAD
from algorithms.rad import RAD
from algorithms.sac import SAC
from algorithms.sac_bc import SAC_BC
from algorithms.sac_exp import SAC_EXP
from algorithms.sac_feat import SAC_FEAT
from algorithms.sac_feat_exp import SAC_FEAT_EXP
from algorithms.sac_nsfp import SAC_NSFP
from algorithms.sac_offline_exp import SAC_OFFLINE_EXP
from algorithms.sac_rev import SAC_REV
from algorithms.soda import SODA
from algorithms.svea import SVEA
from algorithms.sac_fisher import SAC_FISHER
algorithm = {
"sac": SAC,
"rad": RAD,
"curl": CURL,
"pad": PAD,
"soda": SODA,
"drq": DrQ,
"svea": SVEA,
"sac_exp": SAC_EXP,
"sac_feat": SAC_FEAT,
"sac_feat_exp": SAC_FEAT_EXP,
"sac_bc": SAC_BC,
"sac_rev": SAC_REV,
"sac_nsfp": SAC_NSFP,
"sac_offline_exp": SAC_OFFLINE_EXP,
"sac_fisher": SAC_FISHER
}
def make_agent(obs_shape, action_shape, args):
return algorithm[args.algorithm](obs_shape, action_shape, args)
| 27.526316 | 67 | 0.753346 | 163 | 1,046 | 4.558282 | 0.159509 | 0.282638 | 0.205922 | 0.080754 | 0.061911 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.161568 | 1,046 | 37 | 68 | 28.27027 | 0.847206 | 0 | 0 | 0 | 0 | 0 | 0.092734 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.029412 | false | 0 | 0.441176 | 0.029412 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
db120370cbfd210ed137e54c5c747aa30ee56825 | 394 | py | Python | patient/urls.py | sajib-w3b-d3v/PACS_HIS_RIS | 4ced716734cc6704d4fdd0818c78ea540ab87085 | [
"MIT"
] | null | null | null | patient/urls.py | sajib-w3b-d3v/PACS_HIS_RIS | 4ced716734cc6704d4fdd0818c78ea540ab87085 | [
"MIT"
] | null | null | null | patient/urls.py | sajib-w3b-d3v/PACS_HIS_RIS | 4ced716734cc6704d4fdd0818c78ea540ab87085 | [
"MIT"
] | null | null | null |
from django.urls import path
from .views import patient_dashboard,patient_records,patient_rad_records
from django.contrib import admin
app_name = "patient"
urlpatterns = [
path("dashboard",patient_dashboard,name="patient_dashboard"),
path("patient_records",patient_records,name="patient_records"),
path("patient_rad_records",patient_rad_records,name="patient_rad_records"),
]
| 24.625 | 79 | 0.794416 | 50 | 394 | 5.94 | 0.3 | 0.188552 | 0.228956 | 0.161616 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101523 | 394 | 15 | 80 | 26.266667 | 0.838983 | 0 | 0 | 0 | 0 | 0 | 0.258312 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
db1528fb3acffc39b3b8da4d54b217f1a60ff950 | 1,040 | py | Python | credential.py | suzie254/Password-Locker | 8cbef83c89aa9c3be3a507ad6a2e5e6b3bd097a3 | [
"Unlicense"
] | 3 | 2020-01-28T17:36:32.000Z | 2020-04-26T21:15:08.000Z | credential.py | suzie254/Password-Locker | 8cbef83c89aa9c3be3a507ad6a2e5e6b3bd097a3 | [
"Unlicense"
] | null | null | null | credential.py | suzie254/Password-Locker | 8cbef83c89aa9c3be3a507ad6a2e5e6b3bd097a3 | [
"Unlicense"
] | 1 | 2021-09-05T06:09:51.000Z | 2021-09-05T06:09:51.000Z | class Credential:
"""
Class that generates new instances of users.
"""
credential_list = []
def __init__(self,credential_name,user_name,password,email):
self.credential_name = credential_name
self.user_name = user_name
self.password = password
self.email = email
def save_credential(self):
Credential.credential_list.append(self)
def delete_credential(self):
Credential.credential_list.remove(self)
@classmethod
def find_by_name(cls,name):
for credential in cls.credential_list:
if credential.credential_name == name:
return credential
@classmethod
def credential_exist(cls,name):
for credential in cls.credential_list:
if credential.password == name:
return credential
return False
@classmethod
def display_credential(cls):
return cls.credential_list
| 21.666667 | 64 | 0.594231 | 103 | 1,040 | 5.776699 | 0.300971 | 0.141176 | 0.085714 | 0.114286 | 0.29916 | 0.171429 | 0.171429 | 0.171429 | 0.171429 | 0.171429 | 0 | 0 | 0.341346 | 1,040 | 48 | 65 | 21.666667 | 0.868613 | 0.042308 | 0 | 0.28 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0.12 | 0 | 0.04 | 0.48 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
db1868ac78b2d26cda03c3b664748a6021babe46 | 193 | py | Python | Demo/liaoxf/mysorted.py | felix9064/PythonProject | bbe4607ba8bf6a188ab01cf16f8b39b5938079e4 | [
"MIT"
] | null | null | null | Demo/liaoxf/mysorted.py | felix9064/PythonProject | bbe4607ba8bf6a188ab01cf16f8b39b5938079e4 | [
"MIT"
] | null | null | null | Demo/liaoxf/mysorted.py | felix9064/PythonProject | bbe4607ba8bf6a188ab01cf16f8b39b5938079e4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 自定义一个排序函数
from functools import partial
my_sort = partial(sorted, key=lambda x: x.lower())
print(my_sort(['bob', 'about', 'Zoo', 'Credit']))
| 19.3 | 50 | 0.65285 | 28 | 193 | 4.428571 | 0.857143 | 0.096774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011976 | 0.134715 | 193 | 9 | 51 | 21.444444 | 0.730539 | 0.274611 | 0 | 0 | 0 | 0 | 0.124088 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
db36e75bbb19e88ff4b0e65a4af9cb3dce531361 | 1,242 | py | Python | huxley/core/admin/__init__.py | bmun/huxley | e75200cab21dd9edabb9d71578acb7054f875817 | [
"BSD-3-Clause"
] | 18 | 2015-07-12T00:55:51.000Z | 2021-12-13T15:41:06.000Z | huxley/core/admin/__init__.py | bmun/huxley | e75200cab21dd9edabb9d71578acb7054f875817 | [
"BSD-3-Clause"
] | 288 | 2015-01-13T23:05:09.000Z | 2022-03-25T17:35:36.000Z | huxley/core/admin/__init__.py | bmun/huxley | e75200cab21dd9edabb9d71578acb7054f875817 | [
"BSD-3-Clause"
] | 47 | 2015-05-12T15:39:57.000Z | 2022-03-30T09:12:48.000Z | # Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
from huxley.core.admin.notes import NotesAdmin
from django.contrib import admin
from huxley.core.models import *
from .assignment import AssignmentAdmin
from .committee import CommitteeAdmin
from .committee_feedback import CommitteeFeedbackAdmin
from .country import CountryAdmin
from .delegate import DelegateAdmin
from .schools import SchoolAdmin
from .registration import RegistrationAdmin
from .position_paper import PositionPaperAdmin
from .secretariat_member import SecretariatMemberAdmin
admin.site.register(Conference)
admin.site.register(Country, CountryAdmin)
admin.site.register(School, SchoolAdmin)
admin.site.register(Committee, CommitteeAdmin)
admin.site.register(CommitteeFeedback, CommitteeFeedbackAdmin)
admin.site.register(Assignment, AssignmentAdmin)
admin.site.register(CountryPreference)
admin.site.register(Delegate, DelegateAdmin)
admin.site.register(Registration, RegistrationAdmin)
admin.site.register(Rubric)
admin.site.register(PositionPaper, PositionPaperAdmin)
admin.site.register(SecretariatMember, SecretariatMemberAdmin)
admin.site.register(Note, NotesAdmin) | 40.064516 | 77 | 0.849436 | 142 | 1,242 | 7.408451 | 0.443662 | 0.111217 | 0.210076 | 0.074144 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006999 | 0.07971 | 1,242 | 31 | 78 | 40.064516 | 0.913386 | 0.115137 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.48 | 0 | 0.48 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
e1d3a2645ad2fbb0bec5343dde803785daf01385 | 314 | py | Python | yt_dlp/compat/re.py | olipfei/yt-dlp | 7879e79d11a2e5855167820518df49caf623fe48 | [
"Unlicense"
] | 11 | 2022-01-06T22:09:50.000Z | 2022-03-12T22:26:22.000Z | yt_dlp/compat/re.py | olipfei/yt-dlp | 7879e79d11a2e5855167820518df49caf623fe48 | [
"Unlicense"
] | 4 | 2022-02-25T08:20:18.000Z | 2022-03-17T16:16:20.000Z | yt_dlp/compat/re.py | olipfei/yt-dlp | 7879e79d11a2e5855167820518df49caf623fe48 | [
"Unlicense"
] | 3 | 2022-02-19T08:59:13.000Z | 2022-03-06T16:11:21.000Z | # flake8: noqa: F405
from re import * # F403
from .compat_utils import passthrough_module
passthrough_module(__name__, 're')
del passthrough_module
try:
Pattern # >= 3.7
except NameError:
Pattern = type(compile(''))
try:
Match # >= 3.7
except NameError:
Match = type(compile('').match(''))
| 16.526316 | 44 | 0.66879 | 39 | 314 | 5.179487 | 0.564103 | 0.252475 | 0.079208 | 0.168317 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043651 | 0.197452 | 314 | 18 | 45 | 17.444444 | 0.757937 | 0.117834 | 0 | 0.333333 | 0 | 0 | 0.007353 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0.166667 | 0 | 0.166667 | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
e1d77f8cca060201eb4ed3b5cf5a8fffa40bc76b | 429 | py | Python | configs/self6dpp/ssLM/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10_glue.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 33 | 2021-12-15T07:11:47.000Z | 2022-03-29T08:58:32.000Z | configs/self6dpp/ssLM/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10_glue.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 3 | 2021-12-15T11:39:54.000Z | 2022-03-29T07:24:23.000Z | configs/self6dpp/ssLM/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10_glue.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | null | null | null | _base_ = "./ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10_ape.py"
OUTPUT_DIR = "output/self6dpp/ssLM/ss_v1_dibr_mlBCE_FreezeBN_woCenter_refinePM10/glue"
DATASETS = dict(
TRAIN=("lm_real_glue_train",), TRAIN2=("lm_pbr_glue_train",), TRAIN2_RATIO=0.0, TEST=("lm_real_glue_test",)
)
MODEL = dict(
WEIGHTS="output/gdrn/lm_pbr/resnest50d_a6_AugCosyAAEGray_BG05_mlBCE_lm_pbr_100e/glue_Rsym/model_final_wo_optim-324d8f16.pth"
)
| 47.666667 | 128 | 0.815851 | 67 | 429 | 4.656716 | 0.58209 | 0.048077 | 0.051282 | 0.083333 | 0.25 | 0.25 | 0.25 | 0 | 0 | 0 | 0 | 0.062189 | 0.062937 | 429 | 8 | 129 | 53.625 | 0.71393 | 0 | 0 | 0 | 0 | 0 | 0.678322 | 0.55711 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e1eaa0f87debb1c99389798c1a7f1c978ae41fb5 | 14,925 | py | Python | geosoft/gxapi/GXMESH.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 25 | 2017-07-14T06:39:37.000Z | 2022-03-09T21:39:51.000Z | geosoft/gxapi/GXMESH.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 100 | 2016-12-13T17:30:41.000Z | 2021-08-01T20:21:13.000Z | geosoft/gxapi/GXMESH.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 28 | 2016-12-12T17:34:40.000Z | 2022-03-16T15:39:39.000Z | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### endblock Header
### block ClassImplementation
# NOTICE: Do not edit anything here, it is generated code
class GXMESH(gxapi_cy.WrapMESH):
"""
GXMESH class.
High Performance Surface API.
"""
def __init__(self, handle=0):
super(GXMESH, self).__init__(GXContext._get_tls_geo(), handle)
@classmethod
def null(cls):
"""
A null (undefined) instance of `GXMESH <geosoft.gxapi.GXMESH>`
:returns: A null `GXMESH <geosoft.gxapi.GXMESH>`
:rtype: GXMESH
"""
return GXMESH()
def is_null(self):
"""
Check if this is a null (undefined) instance
:returns: True if this is a null (undefined) instance, False otherwise.
:rtype: bool
"""
return self._internal_handle() == 0
# Miscellaneous
@classmethod
def create(cls, name):
"""
Creates a new Mesh
:param name: Mesh Name
:type name: str
:returns: `GXMESH <geosoft.gxapi.GXMESH>` handle, terminates if creation fails
:rtype: GXMESH
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = gxapi_cy.WrapMESH._create(GXContext._get_tls_geo(), name.encode())
return GXMESH(ret_val)
@classmethod
def open(cls, fileName, lstMeshNames):
"""
Opens an existing Mesh
:param fileName: File Name
:param lstMeshNames: `GXLST <geosoft.gxapi.GXLST>` to fill with Mesh Names
:type fileName: str
:type lstMeshNames: GXLST
:returns: `GXMESH <geosoft.gxapi.GXMESH>` handle, terminates if creation fails
:rtype: GXMESH
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = gxapi_cy.WrapMESH._open(GXContext._get_tls_geo(), fileName.encode(), lstMeshNames)
return GXMESH(ret_val)
def insert_patch(self, mesh_name):
"""
Inserts a new surface patch to the mesh specified by a unique ID
:param mesh_name: Mesh Name
:type mesh_name: str
:returns: Patch ID of the inserted patch
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._insert_patch(mesh_name.encode())
return ret_val
def delete_patch(self, mesh_name, patch_id):
"""
Deletes a patch specified by Patch ID from a mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:type mesh_name: str
:type patch_id: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._delete_patch(mesh_name.encode(), patch_id)
def patch_exists(self, mesh_name, patch_id):
"""
Checks if a patch specified by a patch ID exists in a mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:type mesh_name: str
:type patch_id: int
:returns: TRUE if patch exists
:rtype: bool
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._patch_exists(mesh_name.encode(), patch_id)
return ret_val
def num_patches(self, mesh_name):
"""
Returns the number of patches added to the mesh
:param mesh_name: Mesh Name
:type mesh_name: str
:returns: The number of patches added to the mesh
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._num_patches(mesh_name.encode())
return ret_val
def add_vertex(self, mesh_name, patch_id, x, y, z):
"""
Adds a vertex to a patch in a mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:param x: x coordinate of the vertex
:param y: y coordinate of the vertex
:param z: z coordinate of the vertex
:type mesh_name: str
:type patch_id: int
:type x: float
:type y: float
:type z: float
:returns: Returns the vertex index of the added vertex
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._add_vertex(mesh_name.encode(), patch_id, x, y, z)
return ret_val
def num_vertices(self, mesh_name, patch_id):
"""
Number of vertices in a patch in mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:type mesh_name: str
:type patch_id: int
:returns: Returns the number of vertices in a patch
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._num_vertices(mesh_name.encode(), patch_id)
return ret_val
def add_face(self, mesh_name, patch_id, v0, v1, v2):
"""
Adds a face to a patch in a mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:param v0: Vertex index 0 for the face
:param v1: Vertex index 1 for the face
:param v2: Vertex index 2 for the face
:type mesh_name: str
:type patch_id: int
:type v0: int
:type v1: int
:type v2: int
:returns: Returns the face index of the added face
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._add_face(mesh_name.encode(), patch_id, v0, v1, v2)
return ret_val
def num_faces(self, mesh_name, patch_id):
"""
Number of faces in a patch in mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:type mesh_name: str
:type patch_id: int
:returns: Returns the number of faces in a patch
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = self._num_faces(mesh_name.encode(), patch_id)
return ret_val
def get_vertex_point(self, mesh_name, patch_id, vertex_index, x_coordinate, y_coordinate, z_coordinate):
"""
Number of faces in a patch in mesh
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:param vertex_index: Vertex Index
:param x_coordinate: X coordinate
:param y_coordinate: Y coordinate
:param z_coordinate: Z coordinate
:type mesh_name: str
:type patch_id: int
:type vertex_index: int
:type x_coordinate: float_ref
:type y_coordinate: float_ref
:type z_coordinate: float_ref
:returns: Returns the number of faces in a patch
:rtype: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val, x_coordinate.value, y_coordinate.value, z_coordinate.value = self._get_vertex_point(mesh_name.encode(), patch_id, vertex_index, x_coordinate.value, y_coordinate.value, z_coordinate.value)
return ret_val
def get_vertices(self, mesh_name, patch_id, vert_v_vx, vert_v_vy, vert_v_vz):
"""
Returns all the vertices in a patch
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:param vert_v_vx: Vertices X
:param vert_v_vy: Vertices Y
:param vert_v_vz: Vertices Z
:type mesh_name: str
:type patch_id: int
:type vert_v_vx: GXVV
:type vert_v_vy: GXVV
:type vert_v_vz: GXVV
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._get_vertices(mesh_name.encode(), patch_id, vert_v_vx, vert_v_vy, vert_v_vz)
def get_faces(self, mesh_name, patch_id, face_v_1, face_v_2, face_v_3):
"""
Returns all the faces comprising of vertex indices in a patch
:param mesh_name: Mesh Name
:param patch_id: Patch ID
:param face_v_1: Face vertex 1
:param face_v_2: Face vertex 2
:param face_v_3: Face vertex 3
:type mesh_name: str
:type patch_id: int
:type face_v_1: GXVV
:type face_v_2: GXVV
:type face_v_3: GXVV
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._get_faces(mesh_name.encode(), patch_id, face_v_1, face_v_2, face_v_3)
def insert_attributes(self, mesh_name, attribute_name, data_type, attribute_type):
"""
Inserts an attribute set to a mesh
:param mesh_name: Mesh Name
:param attribute_name: Attribute Name
:param data_type: :ref:`ATTRIBUTE_DATA_TYPE`
:param attribute_type: :ref:`ATTRIBUTE_TYPE`
:type mesh_name: str
:type attribute_name: str
:type data_type: int
:type attribute_type: int
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._insert_attributes(mesh_name.encode(), attribute_name.encode(), data_type, attribute_type)
def set_attribute_values(self, mesh_name, attribute_name, data_type, attribute_type, patch_id, vv):
"""
Inserts an attribute set to a mesh
:param mesh_name: Mesh Name
:param attribute_name: Attribute Name
:param data_type: :ref:`ATTRIBUTE_DATA_TYPE`
:param attribute_type: :ref:`ATTRIBUTE_TYPE`
:param patch_id: Patch ID
:param vv: Attributes VV `GXVV <geosoft.gxapi.GXVV>`
:type mesh_name: str
:type attribute_name: str
:type data_type: int
:type attribute_type: int
:type patch_id: int
:type vv: GXVV
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._set_attribute_values(mesh_name.encode(), attribute_name.encode(), data_type, attribute_type, patch_id, vv)
def get_attribute_values(self, mesh_name, attribute_name, data_type, attribute_type, patch_id, vv):
"""
Inserts an attribute set to a mesh
:param mesh_name: Mesh Name
:param attribute_name: Attribute Name
:param data_type: :ref:`ATTRIBUTE_DATA_TYPE`
:param attribute_type: :ref:`ATTRIBUTE_TYPE`
:param patch_id: Patch ID
:param vv: Attributes VV `GXVV <geosoft.gxapi.GXVV>`
:type mesh_name: str
:type attribute_name: str
:type data_type: int
:type attribute_type: int
:type patch_id: int
:type vv: GXVV
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._get_attribute_values(mesh_name.encode(), attribute_name.encode(), data_type, attribute_type, patch_id, vv)
@classmethod
def import_grid_to_mesh(cls, grid_file_name, geosurface_filename, surface_name):
"""
Imports a Grid to a Surface. Creates a new Geosurface file for the surface
:param grid_file_name: Grid File Name
:param geosurface_filename: Surface File Name
:param surface_name: Surface Item Name within the file
:type grid_file_name: str
:type geosurface_filename: str
:type surface_name: str
:returns: `GXMESH <geosoft.gxapi.GXMESH>` handle, terminates if creation fails
:rtype: GXMESH
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
ret_val = gxapi_cy.WrapMESH._import_grid_to_mesh(GXContext._get_tls_geo(), grid_file_name.encode(), geosurface_filename.encode(), surface_name.encode())
return GXMESH(ret_val)
def save(self):
"""
Saves Mesh to the Project Cache and Geosurface file
.. versionadded:: 9.5
**License:** `Geosoft Open License <https://geosoftgxdev.atlassian.net/wiki/spaces/GD/pages/2359406/License#License-open-lic>`_
"""
self._save()
### endblock ClassImplementation
### block ClassExtend
# NOTICE: The code generator will not replace the code in this block
### endblock ClassExtend
### block Footer
# NOTICE: The code generator will not replace the code in this block
### endblock Footer | 31.158664 | 204 | 0.595846 | 1,848 | 14,925 | 4.616883 | 0.091991 | 0.066573 | 0.029536 | 0.044304 | 0.714838 | 0.676746 | 0.650609 | 0.631388 | 0.631388 | 0.574426 | 0 | 0.01884 | 0.310084 | 14,925 | 479 | 205 | 31.158664 | 0.80975 | 0.607236 | 0 | 0.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.35 | false | 0 | 0.066667 | 0 | 0.65 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e1f2d262639230803ca5a1591a8870a778e9efe8 | 127 | py | Python | build/lib/dml/__init__.py | dreadlord1984/dml | ac578594142ecfe11a5ab89f0985c8b0ef389f2a | [
"WTFPL"
] | 1 | 2017-11-27T04:08:37.000Z | 2017-11-27T04:08:37.000Z | build/lib/dml/__init__.py | dreadlord1984/dml | ac578594142ecfe11a5ab89f0985c8b0ef389f2a | [
"WTFPL"
] | null | null | null | build/lib/dml/__init__.py | dreadlord1984/dml | ac578594142ecfe11a5ab89f0985c8b0ef389f2a | [
"WTFPL"
] | null | null | null | """
"""
import numpy as np
import scipy as sp
import pylab as py
__all__ = ['LR','NN','CLUSTER','ADAB','DT','KNN','tool'
]
| 10.583333 | 55 | 0.598425 | 20 | 127 | 3.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173228 | 127 | 11 | 56 | 11.545455 | 0.685714 | 0 | 0 | 0 | 0 | 0 | 0.201681 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e1f2dad1b7f59cf8bc79f3095d56c7e6a0fa3337 | 5,816 | py | Python | orchestrator/plugins/landsat8/maja_landsat8_ascii_file_handler.py | spacebel/MAJA | 3e5d20bc9c744c610e608cfcf1f4c5c738d4de9e | [
"Apache-2.0"
] | 57 | 2020-09-30T08:51:22.000Z | 2021-12-19T20:28:30.000Z | orchestrator/plugins/landsat8/maja_landsat8_ascii_file_handler.py | spacebel/MAJA | 3e5d20bc9c744c610e608cfcf1f4c5c738d4de9e | [
"Apache-2.0"
] | 34 | 2020-09-29T21:27:22.000Z | 2022-02-03T09:56:45.000Z | orchestrator/plugins/landsat8/maja_landsat8_ascii_file_handler.py | spacebel/MAJA | 3e5d20bc9c744c610e608cfcf1f4c5c738d4de9e | [
"Apache-2.0"
] | 14 | 2020-10-11T13:17:59.000Z | 2022-03-09T15:58:19.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""
###################################################################################################
o o
oo oo oo o oo ,-.
o o o o o o o o o \_/
o o o o o o o o |||D
o o oooooo o oooooo / \
o o o o o o o o `-^
o o o o oooo o o
###################################################################################################
orchestrator.common.earth_explorer.gipp_l2_comm_earth_explorer_xml_file_handler -- shortdesc
orchestrator.common.earth_explorer.gipp_l2_comm_earth_explorer_xml_file_handler is a description
It defines classes_and_methods
###################################################################################################
"""
import orchestrator.common.xml_tools as xml_tools
import os
from orchestrator.common.logger.maja_logging import configure_logger
from orchestrator.common.maja_exceptions import MajaDriverException
LOGGER = configure_logger(__name__)
class Landsat8ASCIIFileHandler(object):
def __init__(self, main_txt_file):
"""
Constructor
"""
LOGGER.info("Loading " + main_txt_file)
self.main_txt_file = main_txt_file
self.l8ascii_values = {}
with open(self.main_txt_file) as f:
for line in f:
if (len(line.split("=")) > 1):
key, value = line.strip().split(' ', 1)
self.l8ascii_values[key] = value.split('= ')[1].replace('"','')
def _get_value(self, key):
if key in self.l8ascii_values:
return self.l8ascii_values[key]
else:
raise MajaDriverException("No " + key + " in Landsat8 ASCII dictionnary")
def get_platform(self):
return self._get_value("SPACECRAFT_ID")
def get_product_id(self):
return self._get_value("LANDSAT_SCENE_ID")
def get_qbi_image_filename(self):
filename = self._get_value("FILE_NAME_BAND_QUALITY")
return os.path.join(os.path.dirname(self.main_txt_file), filename)
def get_toa_image_filename_from_band_code(self, code):
filename = self._get_value("FILE_NAME_BAND_"+code[1:])
return os.path.join(os.path.dirname(self.main_txt_file), filename)
def get_ref_mutl_factor_from_band_code(self, code):
return float(self._get_value("REFLECTANCE_MULT_BAND_"+code[1:]))
def get_ref_add_factor_from_band_code(self, code):
return float(self._get_value("REFLECTANCE_ADD_BAND_"+code[1:]))
def get_sol_zenith(self):
value = 90-float(self._get_value("SUN_ELEVATION"))
return value
def get_sol_azitmuth(self):
return float(self._get_value("SUN_AZIMUTH"))
def get_acquisition_date(self):
return self._get_value("DATE_ACQUIRED").replace('-','')
def get_zone_geo(self):
return self._get_value("LANDSAT_SCENE_ID")
def get_date_pdv(self):
date = self._get_value("DATE_ACQUIRED")
time = self._get_value("SCENE_CENTER_TIME")
timesplit = time.split('.')
if len(timesplit) == 2:
if len(timesplit[1]) > 3:
time = timesplit[0] + '.' + timesplit[1][0:3] + 'Z'
utc_date = 'UTC='+date+'T'+time
return utc_date
def get_projection(self):
map = self._get_value("MAP_PROJECTION")
zone = self._get_value("UTM_ZONE")
return map+zone
def get_resolution(self):
return float(self._get_value("GRID_CELL_SIZE_REFLECTIVE"))
def get_absolute_coefficients(self):
return ""
def get_origin(self):
return (float(self._get_value("CORNER_UL_PROJECTION_X_PRODUCT")), float(self._get_value("CORNER_UL_PROJECTION_Y_PRODUCT")))
def get_pixel_size(self):
return (self.get_resolution(), -self.get_resolution())
def get_upper_left_corner(self):
return (float(self._get_value("CORNER_UL_LON_PRODUCT")), float(self._get_value("CORNER_UL_LAT_PRODUCT")))
def get_upper_right_corner(self):
return (float(self._get_value("CORNER_UR_LON_PRODUCT")), float(self._get_value("CORNER_UR_LAT_PRODUCT")))
def get_lower_left_corner(self):
return (float(self._get_value("CORNER_LL_LON_PRODUCT")), float(self._get_value("CORNER_LL_LAT_PRODUCT")))
def get_lower_right_corner(self):
return (float(self._get_value("CORNER_LR_LON_PRODUCT")), float(self._get_value("CORNER_LR_LAT_PRODUCT")))
def get_mean_view_angles(self):
return (0.0,0.0)
def get_mean_solar_angles(self):
return (self.get_sol_zenith(), self.get_sol_azitmuth())
def get_nick_name(self):
lpath = int(self._get_value("WRS_PATH"))
lrow = int(self._get_value("WRS_ROW"))
return '{:03d}-{:03d}'.format(lpath,lrow)
def get_generation_date(self):
return self._get_value("FILE_DATE")
def get_instrument(self):
return self._get_value("SENSOR_ID").replace("_","")
def get_orbit_number(self):
return self._get_value("WRS_PATH")
| 36.810127 | 131 | 0.616059 | 754 | 5,816 | 4.416446 | 0.289125 | 0.071471 | 0.108108 | 0.027628 | 0.398799 | 0.31952 | 0.284084 | 0.209009 | 0.197898 | 0.145646 | 0 | 0.008921 | 0.229023 | 5,816 | 157 | 132 | 37.044586 | 0.73372 | 0.264099 | 0 | 0.046512 | 0 | 0 | 0.136342 | 0.075142 | 0 | 0 | 0 | 0 | 0 | 1 | 0.325581 | false | 0 | 0.046512 | 0.232558 | 0.697674 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c02351e479b11f38513fbf67f26dc5561a93246e | 199 | py | Python | setup.py | TileDB-Inc/TileDB-ML | 704d920b1482ad5b7ceefcc8b1f8f4b69d572e6c | [
"MIT"
] | 21 | 2021-03-09T10:59:13.000Z | 2022-01-15T17:42:40.000Z | setup.py | TileDB-Inc/TileDB-ML | 704d920b1482ad5b7ceefcc8b1f8f4b69d572e6c | [
"MIT"
] | 52 | 2021-04-27T15:59:39.000Z | 2022-03-30T14:06:41.000Z | setup.py | TileDB-Inc/TileDB-ML | 704d920b1482ad5b7ceefcc8b1f8f4b69d572e6c | [
"MIT"
] | 3 | 2021-03-24T08:50:58.000Z | 2021-07-15T11:15:48.000Z | import setuptools
setuptools.setup(
use_scm_version={
"version_scheme": "guess-next-dev",
"local_scheme": "no-local-version",
"write_to": "tiledb/ml/version.py",
}
)
| 19.9 | 43 | 0.61809 | 23 | 199 | 5.130435 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.226131 | 199 | 9 | 44 | 22.111111 | 0.766234 | 0 | 0 | 0 | 0 | 0 | 0.422111 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.125 | 0 | 0.125 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c0256b3ce8204fb21f44df28a9549d4b7bd7948f | 842 | py | Python | MySqlCreateTableVectors.py | NielSalas/Integrated-system-for-measuring-water-quality-with-precision-supported-by-dual-GNSS-INS | 1e4dcd19ba1a411d0fba17d2cfca5d6b0e68407c | [
"Unlicense"
] | 2 | 2021-05-20T01:57:23.000Z | 2021-06-25T01:51:24.000Z | MySqlCreateTableVectors.py | NielSalas/Integrated-system-for-measuring-water-quality-with-precision-supported-by-dual-GNSS-INS | 1e4dcd19ba1a411d0fba17d2cfca5d6b0e68407c | [
"Unlicense"
] | null | null | null | MySqlCreateTableVectors.py | NielSalas/Integrated-system-for-measuring-water-quality-with-precision-supported-by-dual-GNSS-INS | 1e4dcd19ba1a411d0fba17d2cfca5d6b0e68407c | [
"Unlicense"
] | null | null | null | #-------------------------------------------------------------------------#
# Create Table
#-------------------------------------------------------------------------#
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="edsonj",
password="nvidia",
database="RemoteData"
)
mycursor = mydb.cursor()
'''Vectors Table'''
mycursor.execute("CREATE TABLE Vectors (id INT AUTO_INCREMENT PRIMARY KEY, yaw FLOAT(25), pitch FLOAT(25), roll FLOAT(25), latitude FLOAT(25), longitude FLOAT(25), altitude FLOAT(25), velocityx FLOAT(25), velocityy FLOAT(25), velocityz FLOAT(25), accelx FLOAT(25), accely FLOAT(25), accelz FLOAT(25), angularratex FLOAT(25), angularratey FLOAT(25), angularratez FLOAT(25), time DATETIME NOT NULL)")
mycursor.execute("ALTER TABLE Vectors ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY")
| 46.777778 | 398 | 0.611639 | 95 | 842 | 5.4 | 0.515789 | 0.204678 | 0.035088 | 0.070175 | 0.109162 | 0.109162 | 0 | 0 | 0 | 0 | 0 | 0.039735 | 0.103325 | 842 | 17 | 399 | 49.529412 | 0.639735 | 0.188836 | 0 | 0 | 0 | 0.1 | 0.719939 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.1 | 0.1 | 0 | 0.1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
c0332780820fcfe7203c851447c33d9dc259f74b | 393 | py | Python | examples/cls_svm_demo.py | msgi/nlp-tour | ffed8c32da69c2427c92a7043f47bfc91e7feb64 | [
"Apache-2.0"
] | 1,559 | 2019-05-27T03:43:29.000Z | 2022-03-31T05:35:04.000Z | examples/cls_svm_demo.py | msgi/nlp-tour | ffed8c32da69c2427c92a7043f47bfc91e7feb64 | [
"Apache-2.0"
] | 5 | 2019-07-10T11:55:05.000Z | 2020-05-08T12:01:31.000Z | examples/cls_svm_demo.py | msgi/nlp-tour | ffed8c32da69c2427c92a7043f47bfc91e7feb64 | [
"Apache-2.0"
] | 403 | 2019-06-14T03:36:17.000Z | 2022-03-30T08:09:08.000Z | from smartnlp.classfication.svm_classifier import SVMClassifier
if __name__ == '__main__':
svm_model = SVMClassifier('model/svm/model.pkl',
'./data/imdb/aclImdb.txt',
train=True)
# svm_model = SVMClassifier('model/svm/model.pkl')
svm_model.predict(['i like it ! its very interesting', 'I don\'t like it, it\'s boring'])
| 43.666667 | 93 | 0.610687 | 47 | 393 | 4.851064 | 0.617021 | 0.175439 | 0.184211 | 0.22807 | 0.324561 | 0.324561 | 0.324561 | 0 | 0 | 0 | 0 | 0 | 0.262087 | 393 | 8 | 94 | 49.125 | 0.786207 | 0.122137 | 0 | 0 | 0 | 0 | 0.279883 | 0.067055 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c046dcc698326e1a61092adeca2e2ee2bdb92f1b | 200 | py | Python | power_watcher/__init__.py | SamoKhod/PowerWatcher | 09673cc90469a242fe23a12aab973cb3c92d8720 | [
"MIT"
] | 1 | 2021-11-05T04:19:48.000Z | 2021-11-05T04:19:48.000Z | power_watcher/__init__.py | WGussev/PowerWatcher | 09673cc90469a242fe23a12aab973cb3c92d8720 | [
"MIT"
] | null | null | null | power_watcher/__init__.py | WGussev/PowerWatcher | 09673cc90469a242fe23a12aab973cb3c92d8720 | [
"MIT"
] | 1 | 2021-11-05T04:19:50.000Z | 2021-11-05T04:19:50.000Z | """
PowerWatcher -- python3 context manager to log power consumption of any ML-pipeline running on a Nvidia GPU.
"""
from power_watcher.power_watcher import PowerWatcher
__all__ = ["PowerWatcher", ]
| 28.571429 | 108 | 0.775 | 26 | 200 | 5.730769 | 0.807692 | 0.161074 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005814 | 0.14 | 200 | 6 | 109 | 33.333333 | 0.860465 | 0.54 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
c058c6594abe9966c4197934fafccc6e86b722cc | 2,101 | py | Python | hubcheck/pageobjects/po_hubucoursemanagemembership.py | codedsk/hubcheck | 2ff506eb56ba00f035300862f8848e4168452a17 | [
"MIT"
] | 1 | 2016-02-13T13:42:23.000Z | 2016-02-13T13:42:23.000Z | hubcheck/pageobjects/po_hubucoursemanagemembership.py | codedsk/hubcheck | 2ff506eb56ba00f035300862f8848e4168452a17 | [
"MIT"
] | null | null | null | hubcheck/pageobjects/po_hubucoursemanagemembership.py | codedsk/hubcheck | 2ff506eb56ba00f035300862f8848e4168452a17 | [
"MIT"
] | null | null | null | from hubcheck.pageobjects.po_hubucoursemanage import HubUCourseManagePage
class HubUCourseManageMembershipPage(HubUCourseManagePage):
"""hub u course manager membership page"""
def __init__(self,browser,catalog,groupid=''):
super(HubUCourseManageMembershipPage,self).__init__(browser,catalog,groupid)
# load hub's classes
HubUCourseManageMembershipPage_Locators = self.load_class('HubUCourseManageMembershipPage_Locators')
HubUCourseMembershipListing = self.load_class('HubUCourseMembershipListing')
# update this object's locator
self.locators.update(HubUCourseManageMembershipPage_Locators.locators)
# setup page object's components
self.course_listing = HubUCourseMembershipListing(self,{'base':'listing'})
def goto_page(self):
super(HubUCourseManageMembershipPage,self).goto_page()
self.tabs.membership.click()
def update_enrollment(self):
return self.course_listing.update_enrollment()
def select_imported(self):
return self.course_listing.select_imported()
def select_invited(self):
return self.course_listing.select_invited()
def select_members(self):
return self.course_listing.select_members()
def get_footer_members_count(self):
return self.course_listing.get_footer_members_count()
def get_footer_total_count(self):
return self.course_listing.get_footer_total_count()
def count_imported_rows(self):
return self.course_listing.count_imported_rows()
def count_invited_rows(self):
return self.course_listing.count_invited_rows()
def count_member_rows(self):
return self.course_listing.count_member_rows()
def count_total_rows(self):
return self.course_listing.count_total_rows()
def prepare_to_send_email(self):
return self.course_listing.prepare_to_send_email()
class HubUCourseManageMembershipPage_Locators_Base(object):
"""locators for HubUCourseManageMembershipPage object"""
locators = {
'listing' : "css=.course-listing",
}
| 33.887097 | 108 | 0.743931 | 225 | 2,101 | 6.626667 | 0.248889 | 0.113347 | 0.136821 | 0.147552 | 0.254192 | 0.217975 | 0.151576 | 0.054997 | 0 | 0 | 0 | 0 | 0.172775 | 2,101 | 61 | 109 | 34.442623 | 0.857883 | 0.079486 | 0 | 0 | 0 | 0 | 0.053618 | 0.034357 | 0 | 0 | 0 | 0 | 0 | 1 | 0.351351 | false | 0 | 0.135135 | 0.297297 | 0.864865 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
c05a8482b95820e10668f34300911fe029b35fdf | 2,664 | py | Python | python/kkvhash.py | damianzim/kkvhash | eaaef7c591084f2295afee090ae8cbb9bd2171d1 | [
"MIT"
] | null | null | null | python/kkvhash.py | damianzim/kkvhash | eaaef7c591084f2295afee090ae8cbb9bd2171d1 | [
"MIT"
] | null | null | null | python/kkvhash.py | damianzim/kkvhash | eaaef7c591084f2295afee090ae8cbb9bd2171d1 | [
"MIT"
] | null | null | null | def ROTRIGHT(i: int, bits: int) -> int:
return i >> bits | i << 32 - bits
# Two Extreme Bits (8 bits)
def TEB(i: int) -> int:
return ((i & 0x80) >> 6) | (i & 1)
# Two Extreme Bits Reversed (8 bits)
def TEBR(i: int) -> int:
return (i & 0xFF) >> 7 | (i & 1) << 1
# Middles Extreme Bits (32 bits)
def MEB(i: int) -> int:
return TEB(i >> 24) << 6 | TEB(i >> 16) << 4 | TEB(i >> 8) << 2 | TEB(i)
lookup_reversed_bytes = [
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
0x01, 0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, 0x81, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1,
0x02, 0x12, 0x22, 0x32, 0x42, 0x52, 0x62, 0x72, 0x82, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2,
0x03, 0x13, 0x23, 0x33, 0x43, 0x53, 0x63, 0x73, 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3,
0x04, 0x14, 0x24, 0x34, 0x44, 0x54, 0x64, 0x74, 0x84, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4,
0x05, 0x15, 0x25, 0x35, 0x45, 0x55, 0x65, 0x75, 0x85, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5,
0x06, 0x16, 0x26, 0x36, 0x46, 0x56, 0x66, 0x76, 0x86, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6,
0x07, 0x17, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7,
0x08, 0x18, 0x28, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8,
0x09, 0x19, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9,
0x0A, 0x1A, 0x2A, 0x3A, 0x4A, 0x5A, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA,
0x0B, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB,
0x0C, 0x1C, 0x2C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC, 0xBC, 0xCC, 0xDC, 0xEC, 0xFC,
0x0D, 0x1D, 0x2D, 0x3D, 0x4D, 0x5D, 0x6D, 0x7D, 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0xDD, 0xED, 0xFD,
0x0E, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0xDE, 0xEE, 0xFE,
0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xBF, 0xCF, 0xDF, 0xEF, 0xFF,
]
def kkv_hash(data: bytes) -> int:
length = len(data)
if length == 0 or (length == 1 and data[0] == 0):
return 0
hash, i = length, 0
hash ^= data[i] << 24
while i < length:
hash = (hash << 3) & 0xFFFFFFFF
hash ^= hash >> 2
hash |= 0x80000000
hash += lookup_reversed_bytes[data[i]]
hash &= 0xFFFFFFFF
hash ^= ROTRIGHT(hash, 17)
hash += ROTRIGHT(hash ^ MEB(hash), TEBR(data[i]))
hash &= 0xFFFFFFFF
hash >>= 1
i += 1
hash ^= (MEB(hash) << 23) & 0xFFFFFFFF | (MEB(hash) << 7) & 0xFFFFFFFF
return hash
| 40.363636 | 99 | 0.589339 | 409 | 2,664 | 3.826406 | 0.721271 | 0.01278 | 0.030671 | 0.02492 | 0.047284 | 0 | 0 | 0 | 0 | 0 | 0 | 0.313901 | 0.246622 | 2,664 | 65 | 100 | 40.984615 | 0.465869 | 0.034159 | 0 | 0.044444 | 0 | 0 | 0 | 0 | 0 | 0 | 0.425068 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0.088889 | 0.244444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fbf58406f522fb764c8b4b209a1d04afcb47ae4f | 317 | py | Python | String Detailer/stringDetailer.py | oshada97/Saf---Web | cc2de098126c68513be575d1594ca03359063050 | [
"MIT"
] | null | null | null | String Detailer/stringDetailer.py | oshada97/Saf---Web | cc2de098126c68513be575d1594ca03359063050 | [
"MIT"
] | 1 | 2021-02-07T16:41:05.000Z | 2021-02-07T16:41:05.000Z | String Detailer/stringDetailer.py | oshada97/Saf---Web | cc2de098126c68513be575d1594ca03359063050 | [
"MIT"
] | null | null | null | letters = ['o', 's', 'h', 'a', 'd', 'a']
print(letters.index('h'))
print(letters.index('d'))
print(max(letters))
print(min(letters))
print(letters.count('a'))
print(letters.remove('h'))
#after remove r from the list
print(letters)
#reverse the whole list
print(letters.reverse())
print(letters) | 17.611111 | 41 | 0.634069 | 46 | 317 | 4.369565 | 0.413043 | 0.41791 | 0.129353 | 0.228856 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154574 | 317 | 18 | 42 | 17.611111 | 0.75 | 0.157729 | 0 | 0.2 | 0 | 0 | 0.040161 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.9 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
2216872d96ef1f0a288e3c794a182c8211556abb | 743 | py | Python | toolsaurus/database/miniature_tools/pixel_comparator.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | null | null | null | toolsaurus/database/miniature_tools/pixel_comparator.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | 4 | 2021-08-13T14:03:02.000Z | 2022-03-05T16:02:45.000Z | toolsaurus/database/miniature_tools/pixel_comparator.py | notoraptor/pysaurus | 3bf5fe8c15e0e0e580e5edaea05b4a1298641367 | [
"MIT"
] | null | null | null | from typing import Tuple
from pysaurus.database.miniature_tools.pixel_comparator import AbstractPixelComparator
class ColorClassPixelComparator(AbstractPixelComparator):
def __init__(self, interval_length: int):
self.interval_length = interval_length
def _map_pixel(self, pixel: Tuple[int, int, int]) -> Tuple:
return tuple(
int(v // self.interval_length) * self.interval_length for v in pixel
)
def normalize_data(self, data, width):
return list(data)
def pixels_are_close(self, data, i, j, width):
return self._map_pixel(data[i]) == self._map_pixel(data[j])
def common_color(self, data, indices, width):
return self._map_pixel(data[next(iter(indices))])
| 32.304348 | 86 | 0.702557 | 95 | 743 | 5.252632 | 0.4 | 0.140281 | 0.144289 | 0.096192 | 0.108216 | 0.108216 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197847 | 743 | 22 | 87 | 33.772727 | 0.837248 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.133333 | 0.266667 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
22223b28d9b9ce6fdf4a9ad8f9704d010edbb1dd | 1,362 | py | Python | prombzex/config.py | cmsj/prometheus-bugzilla-exporter | 729be74bcf3b521163d663f08d4cb45e8057720a | [
"MIT"
] | 2 | 2020-03-25T08:34:33.000Z | 2020-07-20T08:32:57.000Z | prombzex/config.py | cmsj/prometheus-bugzilla-exporter | 729be74bcf3b521163d663f08d4cb45e8057720a | [
"MIT"
] | null | null | null | prombzex/config.py | cmsj/prometheus-bugzilla-exporter | 729be74bcf3b521163d663f08d4cb45e8057720a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Configuration for Prombzex"""
import json
class PromBZExConfig:
"""This class abstracts the json config file. Its format is:
TODO: document the format"""
data = None
def __init__(self, config_file_object):
"""Initialise the class and load the config"""
self.data = json.load(config_file_object)
def servers(self):
"""Return a list of configured BZ servers"""
return list(filter(lambda x: x != "default", self.data.keys()))
def server(self, name):
"""Return the data for a server"""
return self.data[name]
def get(self, key, server=None, allow_default=True):
"""Return a config value for a given key, optionally for a
specific server. If no server is specified, the default
value is returned. If a server is specified, its value is
returned, unless it defines no value, in which case the
default is returned.
If neither the specified server, nor the defaults, have a
value for the key, None will be returned"""
value = None
if allow_default and 'default' in self.data and \
key in self.data['default']:
value = self.data['default'][key]
if server and key in self.data[server]:
value = self.data[server][key]
return value
| 30.954545 | 71 | 0.629956 | 188 | 1,362 | 4.510638 | 0.361702 | 0.075472 | 0.035377 | 0.028302 | 0.037736 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001015 | 0.276799 | 1,362 | 43 | 72 | 31.674419 | 0.859898 | 0.430984 | 0 | 0 | 0 | 0 | 0.040462 | 0 | 0 | 0 | 0 | 0.023256 | 0 | 1 | 0.235294 | false | 0 | 0.058824 | 0 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2227d27e75c353b1f2ca05717e7702c63aa9a466 | 173 | py | Python | tkinter.py | manab531/tkinter_sample | 7db38500d8e04bfc69573bdd4ef497c03eee3241 | [
"MIT"
] | 1 | 2021-02-08T07:45:52.000Z | 2021-02-08T07:45:52.000Z | tkinter.py | manab531/tkinter_sample | 7db38500d8e04bfc69573bdd4ef497c03eee3241 | [
"MIT"
] | null | null | null | tkinter.py | manab531/tkinter_sample | 7db38500d8e04bfc69573bdd4ef497c03eee3241 | [
"MIT"
] | null | null | null | import tkinter as tk
root = tk.Tk()
root.mainloop()
"""import tkinter
root=tkinter.TK()
root.mainloop()"""
"""
def mainloop():
return'hello world'
Tk Version='0.11'
""" | 14.416667 | 23 | 0.65896 | 25 | 173 | 4.56 | 0.52 | 0.157895 | 0.245614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.020134 | 0.138728 | 173 | 12 | 24 | 14.416667 | 0.744966 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
222f963e012467d33be769f0398b6e8efc26b1b4 | 461 | py | Python | Special/Set.py | jakedoesgithub/prog_langs_project_scheme_interpreter | 87bc03ab291abd7691db067ab8d5c72282b13c1a | [
"MIT"
] | null | null | null | Special/Set.py | jakedoesgithub/prog_langs_project_scheme_interpreter | 87bc03ab291abd7691db067ab8d5c72282b13c1a | [
"MIT"
] | null | null | null | Special/Set.py | jakedoesgithub/prog_langs_project_scheme_interpreter | 87bc03ab291abd7691db067ab8d5c72282b13c1a | [
"MIT"
] | null | null | null | # Set -- Parse tree node strategy for printing the special form set!
from Tree import Nil
#from Tree import Unspecific
from Print import Printer
from Special import Special
class Set(Special):
def __init__(self):
pass
def print(self, t, n, p):
Printer.printSet(t, n, p)
def eval(self, t, env):
env.assign(t.getCdr().getCar(), t.getCdr().getCdr().getCar().eval(env))
return Nil.getInstance()
| 25.611111 | 81 | 0.626898 | 64 | 461 | 4.453125 | 0.5 | 0.05614 | 0.098246 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.260304 | 461 | 17 | 82 | 27.117647 | 0.835777 | 0.201735 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0.090909 | 0.272727 | 0 | 0.727273 | 0.181818 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
227a15732ef052d0733d2e1fb566acd6d8708ba3 | 346 | py | Python | games/necrowar/controllers/skyler_controller.py | firecannons/MMAI24 | 70f2ce463029e8d61bf18354ad2ce74da8d02702 | [
"MIT"
] | null | null | null | games/necrowar/controllers/skyler_controller.py | firecannons/MMAI24 | 70f2ce463029e8d61bf18354ad2ce74da8d02702 | [
"MIT"
] | null | null | null | games/necrowar/controllers/skyler_controller.py | firecannons/MMAI24 | 70f2ce463029e8d61bf18354ad2ce74da8d02702 | [
"MIT"
] | null | null | null | import logging
from ..game import Game
from ..player import Player
from .central_command import BaseController
class SkylerController(BaseController):
def __init__(self, logger: logging.Logger, game: Game, player: Player):
super().__init__(logger, game, player)
def run_turn(self):
self.logger.info('Hello from Skyler!') | 31.454545 | 75 | 0.734104 | 43 | 346 | 5.674419 | 0.465116 | 0.081967 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16474 | 346 | 11 | 76 | 31.454545 | 0.844291 | 0 | 0 | 0 | 0 | 0 | 0.051873 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.444444 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
97d516d638d9140a09fb7a82a1b84900f0340c28 | 125 | py | Python | upload/functions.py | neha-webllisto/file_upload | 877e9da88677e9ad73f3b2f85dcfab7dbdf49e45 | [
"Apache-2.0"
] | null | null | null | upload/functions.py | neha-webllisto/file_upload | 877e9da88677e9ad73f3b2f85dcfab7dbdf49e45 | [
"Apache-2.0"
] | null | null | null | upload/functions.py | neha-webllisto/file_upload | 877e9da88677e9ad73f3b2f85dcfab7dbdf49e45 | [
"Apache-2.0"
] | null | null | null | def file_upload(f):
with open('static/upload/'+f.name,'wb+') as destination:
for i in f.chunks():
destination.write(i)
| 25 | 57 | 0.68 | 21 | 125 | 4 | 0.761905 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136 | 125 | 4 | 58 | 31.25 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0.136 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
97eb1253743860d2b757ec50339e7e66c99cd999 | 63 | py | Python | heima/login.py | LogicDance/git_learning1 | 48480af7f5e83fb191e5077f4cace186878bd767 | [
"MIT"
] | null | null | null | heima/login.py | LogicDance/git_learning1 | 48480af7f5e83fb191e5077f4cace186878bd767 | [
"MIT"
] | null | null | null | heima/login.py | LogicDance/git_learning1 | 48480af7f5e83fb191e5077f4cace186878bd767 | [
"MIT"
] | null | null | null | lisi = 1
lisi1 = 1
lisi2 = 2
zhangsan3 = 3
lisi3 = 3
dev = 1
| 7 | 13 | 0.587302 | 12 | 63 | 3.083333 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.232558 | 0.31746 | 63 | 8 | 14 | 7.875 | 0.627907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 3 |
97f3570af0e3e6d4840f72160630f1d0fbebe783 | 109 | py | Python | src/mediaconversion/__init__.py | alfredo-milani/VideoConverter | d8b8ec1ffd93119fdb4f83e0e5252710a1ee1290 | [
"MIT"
] | null | null | null | src/mediaconversion/__init__.py | alfredo-milani/VideoConverter | d8b8ec1ffd93119fdb4f83e0e5252710a1ee1290 | [
"MIT"
] | null | null | null | src/mediaconversion/__init__.py | alfredo-milani/VideoConverter | d8b8ec1ffd93119fdb4f83e0e5252710a1ee1290 | [
"MIT"
] | 1 | 2020-01-04T15:50:39.000Z | 2020-01-04T15:50:39.000Z | from mediaconversion.MediaObserver import MediaObserver
__all__ = ["MediaEventHandler.py", "MediaObserver"]
| 27.25 | 55 | 0.825688 | 9 | 109 | 9.555556 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082569 | 109 | 3 | 56 | 36.333333 | 0.86 | 0 | 0 | 0 | 0 | 0 | 0.302752 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
97f4d293ac69230c871698429f2abe7af9f6a056 | 1,254 | py | Python | IronManFly/model_storage/young-pond/v1/db.py | leepand/IronManFly | ea29bf1415a51b23a0fbc95f2bae82013a0887a4 | [
"MIT"
] | null | null | null | IronManFly/model_storage/young-pond/v1/db.py | leepand/IronManFly | ea29bf1415a51b23a0fbc95f2bae82013a0887a4 | [
"MIT"
] | null | null | null | IronManFly/model_storage/young-pond/v1/db.py | leepand/IronManFly | ea29bf1415a51b23a0fbc95f2bae82013a0887a4 | [
"MIT"
] | null | null | null | import os
from tinydb import TinyDB, Query
from tinydb.operations import set
DB_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'olympus_db.json')
TABLE = 'models'
db = TinyDB(DB_PATH)
Model = Query()
def get_all_models():
return db.table(TABLE).all()
def create_new_model(model_object):
db.table(TABLE).insert(model_object)
def does_model_exist(name, version):
return db.table(TABLE).contains((Model.name == name) & (Model.version == version))
def update_model(name, version, updates):
for update_key, update_val in updates.items():
db.table(TABLE).update(
set(update_key, update_val),
(Model.name == name) & (Model.version == version))
def get_model(name, version=1):
if not does_model_exist(name, version):
return None
return db.table(TABLE).search((Model.name == name) & (Model.version == version))[0]
def validation_model(name, version=1):
#if not does_model_exist(name, version):
# return None
return db.table(TABLE).search((Model.name == name) & (Model.version == version))[0]
def delete_model_from_db(name, version=1):
if does_model_exist(name, version):
db.table(TABLE).remove((Model.name == name) & (Model.version == version)) | 33 | 87 | 0.688198 | 180 | 1,254 | 4.622222 | 0.261111 | 0.105769 | 0.100962 | 0.108173 | 0.471154 | 0.441106 | 0.365385 | 0.28125 | 0.28125 | 0.28125 | 0 | 0.004785 | 0.166667 | 1,254 | 38 | 88 | 33 | 0.791388 | 0.043062 | 0 | 0.074074 | 0 | 0 | 0.017515 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.259259 | false | 0 | 0.111111 | 0.111111 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3f083bf6110ef67c4df86abb57c9b39f6d5efbd7 | 101 | py | Python | tensorflow/test.py | cateto/python4NLP | 1d2d5086f907bf75be01762bf0b384c76d8f704e | [
"MIT"
] | 2 | 2021-12-16T22:38:27.000Z | 2021-12-17T13:09:49.000Z | tensorflow/test.py | cateto/python4NLP | 1d2d5086f907bf75be01762bf0b384c76d8f704e | [
"MIT"
] | null | null | null | tensorflow/test.py | cateto/python4NLP | 1d2d5086f907bf75be01762bf0b384c76d8f704e | [
"MIT"
] | null | null | null | import tensorflow as tf
print(tf.__version__)
import pandas as pd
x = pd.Series([1,2,3])
print(x) | 11.222222 | 23 | 0.712871 | 19 | 101 | 3.578947 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035294 | 0.158416 | 101 | 9 | 24 | 11.222222 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.4 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
3f17f539f21935456d45a92c75e80ddbf945a8dd | 374 | py | Python | moco_wrapper/util/objector/raw.py | nethad/moco-wrapper | 012f9aab6e9fa60e3ccdf7254f0366b108651899 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | moco_wrapper/util/objector/raw.py | nethad/moco-wrapper | 012f9aab6e9fa60e3ccdf7254f0366b108651899 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | moco_wrapper/util/objector/raw.py | nethad/moco-wrapper | 012f9aab6e9fa60e3ccdf7254f0366b108651899 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from .base import BaseObjector
class RawObjector(BaseObjector):
"""Objector class that does no conversion (for testing purposes)"""
def convert(self, response):
"""Returns the response object that was given
:param response: response object to convert
:returns: response object that was the parameter
"""
return response | 31.166667 | 71 | 0.676471 | 42 | 374 | 6.02381 | 0.642857 | 0.166008 | 0.142292 | 0.166008 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.254011 | 374 | 12 | 72 | 31.166667 | 0.90681 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3f3e99e5926dd9352384c124270a38224212ee70 | 967 | py | Python | tests/unit/clients/test_decorators.py | datavaluepeople/tentaclio | eb6920a0e115c6c08043063a8c1013d812ec34c8 | [
"MIT"
] | 12 | 2019-04-30T16:07:42.000Z | 2021-12-08T08:02:09.000Z | tests/unit/clients/test_decorators.py | octoenergy/tentaclio | eb6920a0e115c6c08043063a8c1013d812ec34c8 | [
"MIT"
] | 74 | 2019-04-25T11:18:22.000Z | 2022-01-18T11:31:14.000Z | tests/unit/clients/test_decorators.py | datavaluepeople/tentaclio | eb6920a0e115c6c08043063a8c1013d812ec34c8 | [
"MIT"
] | 4 | 2019-05-05T13:13:21.000Z | 2022-01-14T00:33:07.000Z | import pytest
from tentaclio.clients import base_client, decorators
class TestCheckConn:
def test_missing_connection_attribute(self):
class TestClient:
@decorators.check_conn
def func(self):
return True
def __enter__(self):
...
test_client = TestClient()
with pytest.raises(AttributeError):
test_client.func()
def test_inactive_client_connection(self):
url = "file:///path"
class TestClient(base_client.BaseClient):
allowed_schemes = ["file"]
def connect(self):
return True
@decorators.check_conn
def func(self):
return True
def _connect(self):
...
def __enter__(self):
...
test_client = TestClient(url)
with pytest.raises(ConnectionError):
test_client.func()
| 21.488889 | 53 | 0.542916 | 87 | 967 | 5.758621 | 0.402299 | 0.07984 | 0.083832 | 0.087824 | 0.293413 | 0.293413 | 0.171657 | 0.171657 | 0.171657 | 0 | 0 | 0 | 0.377456 | 967 | 44 | 54 | 21.977273 | 0.832226 | 0 | 0 | 0.482759 | 0 | 0 | 0.016546 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.275862 | false | 0 | 0.068966 | 0.103448 | 0.551724 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3f3ec53f990865e80f94911c46c848c7beddb7cc | 6,294 | py | Python | drop-boxes/register-iontorrent-data/pushXML2cxxRest.py | qbicsoftware/etl-scripts | e1cea11b5f55fb218e7d4c8d49bdd3c5fe6c62c6 | [
"MIT"
] | 2 | 2018-04-20T15:48:02.000Z | 2021-11-30T17:39:28.000Z | drop-boxes/register-iontorrent-data/pushXML2cxxRest.py | qbicsoftware/etl-scripts | e1cea11b5f55fb218e7d4c8d49bdd3c5fe6c62c6 | [
"MIT"
] | 41 | 2017-07-19T11:17:26.000Z | 2021-09-28T12:10:49.000Z | drop-boxes/register-iontorrent-data/pushXML2cxxRest.py | qbicsoftware/etl-scripts | e1cea11b5f55fb218e7d4c8d49bdd3c5fe6c62c6 | [
"MIT"
] | 2 | 2017-04-27T10:32:33.000Z | 2018-02-20T09:26:12.000Z | import os
import sys
import requests
from requests.auth import HTTPBasicAuth
import configparser
import codecs
authData = {}
class CxxRestApiError(Exception):
def __init__(self, value):
self.value = '[CxxRestApiError]: ' + value
def __str__(self):
return self.value
def loadConfigFile():
config = configparser.ConfigParser()
homedir = os.path.expanduser("~")
config.read(os.path.join(homedir, '.cxxrest/config.ini'))
#print config.sections()
authData['authuser'] = config['CXXSETUP']['authuser']
authData['password'] = config['CXXSETUP']['password']
authData['serveraddr'] = config['CXXSETUP']['serveraddr']
def checkRESTinterface():
response = requests.get(authData['serveraddr'] + '/centraxx/rest/info', verify=False)
return response
def fetchPatientByMPI(mpiCode):
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
restParams = {'psn': mpiCode, 'idType': 'mpi'}
queryUrl = authData['serveraddr'] + '/centraxx/rest/export/decisiveId/patient'
response = requests.get(queryUrl, params=restParams, auth=restAuth, verify=False)
return response
def pushXML2CxxREST(filepath):
filename = os.path.basename(filepath.strip())
importUrl = authData['serveraddr'] + '/centraxx/rest/import/queue/' + filename
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
headers = {'Content-Type': 'application/xml'}
#files = {'file': io.open(filepath, 'r', encoding='utf8')}
xmlContent = codecs.open(filepath, encoding='utf-8')
#xmlContent = open(filepath, 'rb')
response = requests.post(importUrl, data=xmlContent, auth=restAuth, headers=headers, verify=False)
return response
def fetchImportedXML(filepath):
filename = os.path.basename(filepath.strip())
importUrl = authData['serveraddr'] + '/centraxx/rest/import/queue/' + filename
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
headers = {'Content-Type': 'application/xml'}
response = requests.get(importUrl, auth=restAuth, headers=headers, verify=False)
return response
def triggerCxxImport(filepath):
filename = os.path.basename(filepath.strip())
importUrl = authData['serveraddr'] + '/centraxx/rest/import/queue/' + filename + '/start'
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
#headers = {'Content-Type': 'application/xml'}
headers = {}
response = requests.post(importUrl, headers=headers, auth=restAuth, verify=False)
return response
def triggerAllCxxImports():
importUrl = authData['serveraddr'] + '/centraxx/rest/import/queue/start'
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
#headers = {'Content-Type': 'application/xml'}
headers = {}
response = requests.post(importUrl, headers=headers, auth=restAuth, verify=False)
return response
def getSuccessfulImport(filepath):
filename = os.path.basename(filepath.strip())
importUrl = authData['serveraddr'] + '/centraxx/rest/import/successful/' + filename
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
response = requests.get(importUrl, auth=restAuth, verify=False)
return response
def getErroneousImport(filepath):
filename = os.path.basename(filepath.strip())
importUrl = authData['serveraddr'] + '/centraxx/rest/import/error/' + filename
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
response = requests.get(importUrl, auth=restAuth, verify=False)
return response
def showCxxImportQueue():
queueUrl = authData['serveraddr'] + '/centraxx/rest/import/queue'
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
headers = {}
response = requests.get(queueUrl, auth=restAuth, headers=headers, verify=False)
return response
def deleteSuccessfulImport(filepath):
filename = os.path.basename(filepath.strip())
importUrl = authData['serveraddr'] + '/centraxx/rest/import/successful/' + filename
restAuth = HTTPBasicAuth(authData['authuser'], authData['password'])
response = requests.delete(importUrl, auth=restAuth, verify=False)
return response
# load the username, password, server address etc.
loadConfigFile()
filepath = sys.argv[1]
filename = os.path.basename(filepath)
resp = pushXML2CxxREST(filepath)
# first, push XML file to REST as new resource
if resp.status_code != 201:
raise CxxRestApiError('[CxxRest]: pushXML2CxxREST failed with ' + str(resp.status_code))
else:
print '[CxxRest]:', filename, 'successfully pushed to Cxx REST import queue (' + str(resp.status_code) + ')'
resp = triggerAllCxxImports()
if resp.status_code != 202:
raise CxxRestApiError('[CxxRest]: triggerAllCxxImports failed with ' + str(resp.status_code))
else:
print '[CxxRest]: import was triggered successfully (' + str(resp.status_code) + ')'
resp = getSuccessfulImport(filepath)
if resp.status_code != 200:
raise CxxRestApiError('[CxxRest]: getSuccessfulImport failed with ' + str(resp.status_code))
else:
print '[CxxRest]:', filename, 'was marked as successfully imported (' + str(resp.status_code) + ')'
resp = showCxxImportQueue()
if resp.status_code != 200:
raise CxxRestApiError('[CxxRest]: showCxxImportQueue failed with ' + str(resp.status_code))
else:
print '[CxxRest]: showing contents of the import queue was successful (' + str(resp.status_code) + ')', resp.content
resp = deleteSuccessfulImport(filepath)
if resp.status_code != 200:
raise CxxRestApiError('[CxxRest]: deleteSuccessfulImport failed with ' + str(resp.status_code))
else:
print '[CxxRest]:', filename, 'was deleted from successful imports (' + str(resp.status_code) + ')'
#resp = getSuccessfulImport(filepath)
# if resp.status_code != 200:
# raise CxxRestApiError('[CxxRest]: getSuccessfulImport failed with ' + str(resp.status_code))
# else:
# print '[CxxRest]:', filename, 'was marked as successfully imported (' + str(resp.status_code) + ')'
#
# resp = getErroneousImport(sys.argv[1])
# print 'getError: ', resp.status_code, resp.content
#print authData
#checkRESTinterface()
#resp = fetchPatientByMPI('')
#outfile = open('result.xml', 'w')
#outfile.write(resp.text.encode('utf-8'))
#outfile.close()
| 33.83871 | 120 | 0.712901 | 666 | 6,294 | 6.696697 | 0.204204 | 0.042601 | 0.059641 | 0.04574 | 0.624888 | 0.595291 | 0.567937 | 0.523991 | 0.513677 | 0.445964 | 0 | 0.004833 | 0.145218 | 6,294 | 185 | 121 | 34.021622 | 0.824164 | 0.128376 | 0 | 0.425926 | 0 | 0 | 0.221775 | 0.054895 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.092593 | 0.37963 | null | null | 0.046296 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
3f550c3a2ee6ee3d40149ae4c1e00f3531dbc4b1 | 351 | py | Python | demo/demo_chunkator/manage.py | alpaca-technology/django-chunkator | 10c0b3ce63f6bcb1833ff1518725c68a3d452807 | [
"MIT"
] | 67 | 2017-11-25T10:53:45.000Z | 2021-11-28T15:22:59.000Z | demo/demo_chunkator/manage.py | alpaca-technology/django-chunkator | 10c0b3ce63f6bcb1833ff1518725c68a3d452807 | [
"MIT"
] | 17 | 2017-11-21T08:41:36.000Z | 2022-02-24T19:02:39.000Z | demo/demo_chunkator/manage.py | alpaca-technology/django-chunkator | 10c0b3ce63f6bcb1833ff1518725c68a3d452807 | [
"MIT"
] | 9 | 2017-11-20T17:13:47.000Z | 2022-02-24T19:08:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from django.core.management import execute_from_command_line
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"{package}.settings".format(package=__package__))
execute_from_command_line(sys.argv)
if __name__ == "__main__":
main()
| 20.647059 | 75 | 0.678063 | 43 | 351 | 5.069767 | 0.651163 | 0.100917 | 0.165138 | 0.201835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003534 | 0.193732 | 351 | 16 | 76 | 21.9375 | 0.766784 | 0.119658 | 0 | 0 | 0 | 0 | 0.156352 | 0.071661 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | true | 0 | 0.333333 | 0 | 0.444444 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
3f672ff829f07b7b8ef6ef2e9e347afd90a281c3 | 85 | py | Python | yt_shared/yt_shared/rabbit/__init__.py | tropicoo/yt-dlp-bot | d9d9b42ced8ef2eede453c659c9272078f8ab2eb | [
"BSD-3-Clause"
] | 2 | 2022-03-10T03:07:23.000Z | 2022-03-22T07:36:16.000Z | yt_shared/yt_shared/rabbit/__init__.py | tropicoo/yt-dlp-bot | d9d9b42ced8ef2eede453c659c9272078f8ab2eb | [
"BSD-3-Clause"
] | 1 | 2022-03-18T08:03:26.000Z | 2022-03-18T08:03:26.000Z | yt_shared/yt_shared/rabbit/__init__.py | tropicoo/yt-dlp-bot | d9d9b42ced8ef2eede453c659c9272078f8ab2eb | [
"BSD-3-Clause"
] | null | null | null | from yt_shared.rabbit.rabbit import get_rabbitmq
__all__ = [
'get_rabbitmq',
]
| 12.142857 | 48 | 0.729412 | 11 | 85 | 5 | 0.727273 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 85 | 6 | 49 | 14.166667 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0.141176 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
58c804d34e921331a8dca1ed3b39995aee382f40 | 428 | py | Python | first_steps_in_oop_exercise/project/main.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | first_steps_in_oop_exercise/project/main.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | first_steps_in_oop_exercise/project/main.py | Veselin-Stoilov/software-university-OOP | 452a77cabf2e7d93f30f629c67c6b22682eb255d | [
"MIT"
] | null | null | null | from pokemon import Pokemon
from trainer import Trainer
pokemon = Pokemon("Pikachu", 90)
print(pokemon.pokemon_details())
trainer = Trainer("Ash")
print(trainer.add_pokemon(pokemon))
second_pokemon = Pokemon("Charizard", 110)
print(trainer.add_pokemon(second_pokemon))
print(trainer.add_pokemon(second_pokemon))
print(trainer.release_pokemon("Pikachu"))
print(trainer.release_pokemon("Pikachu"))
print(trainer.trainer_data()) | 28.533333 | 42 | 0.803738 | 55 | 428 | 6.072727 | 0.272727 | 0.215569 | 0.134731 | 0.197605 | 0.443114 | 0.443114 | 0.443114 | 0.245509 | 0 | 0 | 0 | 0.0125 | 0.065421 | 428 | 15 | 43 | 28.533333 | 0.8225 | 0 | 0 | 0.333333 | 0 | 0 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.583333 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
58de1b358e322c6ec252c7baad5bf8da0d81b890 | 1,280 | py | Python | auth_backend/src/setup_test.py | cispa/bitahoy | ffc2004930a033cfb94d13671bc6068b473ce226 | [
"MIT"
] | null | null | null | auth_backend/src/setup_test.py | cispa/bitahoy | ffc2004930a033cfb94d13671bc6068b473ce226 | [
"MIT"
] | null | null | null | auth_backend/src/setup_test.py | cispa/bitahoy | ffc2004930a033cfb94d13671bc6068b473ce226 | [
"MIT"
] | 2 | 2021-12-30T16:48:15.000Z | 2022-01-14T14:21:15.000Z | from fastapi.testclient import TestClient
from app import app
import json
import psycopg2
import random
import string
import base64
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat.backends import default_backend
import sys
import bcrypt
testmail = "user@testing.bitahoy.com" #TODO fill in (This is where the test emails get send to)
conn = psycopg2.connect("dbname='auth_db' user='auth_db' host='auth_db' [redacted-2]")
cursor = conn.cursor()
if len(sys.argv) < 2:
print("Too few arguments. Try 'setup' or 'cleanup'!")
elif sys.argv[1] == "setup":
hashed = bcrypt.hashpw("password".encode('utf8'), bcrypt.gensalt()).decode("ascii")
cursor.execute("INSERT INTO users(uid,email,password,permissions) VALUES(9999,'"+testmail+"',%s,0)",(hashed,))
cursor.execute("INSERT INTO wdcodes(wdcode,uid,secret) VALUES('xxxxxxxxxxxxxxxx',9999,'[redacted-7]')")
conn.commit()
print("SUCCESS!")
elif sys.argv[1] == "cleanup":
cursor.execute("DELETE FROM users WHERE uid=9999")
cursor.execute("DELETE FROM wdcodes WHERE uid=9999")
conn.commit()
print("SUCCESS!")
else:
print("Possible commands:")
print("setup")
print("cleanup")
| 32 | 114 | 0.727344 | 172 | 1,280 | 5.389535 | 0.534884 | 0.056095 | 0.071197 | 0.06904 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024302 | 0.132031 | 1,280 | 39 | 115 | 32.820513 | 0.810081 | 0.04375 | 0 | 0.125 | 0 | 0 | 0.346154 | 0.108838 | 0 | 0 | 0 | 0.025641 | 0 | 1 | 0 | false | 0.0625 | 0.375 | 0 | 0.375 | 0.1875 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
451059e7b501c827006943d7637a57d5b9bd8ef1 | 137 | py | Python | Test.py | ShivaPrab/Drinks-MI | a32fced5ea480a209d11594f449c192bc305c32e | [
"MIT"
] | null | null | null | Test.py | ShivaPrab/Drinks-MI | a32fced5ea480a209d11594f449c192bc305c32e | [
"MIT"
] | null | null | null | Test.py | ShivaPrab/Drinks-MI | a32fced5ea480a209d11594f449c192bc305c32e | [
"MIT"
] | null | null | null | import math as math
import pandas as pd
import csv
import matplotlib as plt
data = pd.read_csv('data/data_cocktails.csv')
print(data)
| 17.125 | 45 | 0.773723 | 24 | 137 | 4.333333 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153285 | 137 | 7 | 46 | 19.571429 | 0.896552 | 0 | 0 | 0 | 0 | 0 | 0.167883 | 0.167883 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.166667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1885466470b13e001ac367bf77aedeb3c910578d | 603 | py | Python | lib/Config/settings.py | cedadev/mistamover | 37ad31c4c66658c4c77340efc783040f94df3f3f | [
"BSD-3-Clause-Clear"
] | null | null | null | lib/Config/settings.py | cedadev/mistamover | 37ad31c4c66658c4c77340efc783040f94df3f3f | [
"BSD-3-Clause-Clear"
] | null | null | null | lib/Config/settings.py | cedadev/mistamover | 37ad31c4c66658c4c77340efc783040f94df3f3f | [
"BSD-3-Clause-Clear"
] | null | null | null | global_default = {
'general_poll_interval': 3
}
incoming_default = {
'require_arrival_monitor': False,
'control_file_extension': 'stager-ctrl-bss',
'receipt_file_extension': 'stager-rcpt-bss',
'thankyou_file_extension': 'stager-thanks-bss',
'stop_file': '.stop'
}
outgoing_default = {
'target_uses_arrival_monitor': False,
'control_file_extension': 'stager-ctrl-bss',
'receipt_file_extension': 'stager-rcpt-bss',
'thankyou_file_extension': 'stager-thanks-bss',
'retry_count': 3,
'receipt_file_poll_count': 100,
'receipt_file_poll_interval': 5,
'stop_file': '.stop',
'stop_file_poll_interval': 600
}
| 24.12 | 47 | 0.764511 | 79 | 603 | 5.405063 | 0.379747 | 0.18267 | 0.266979 | 0.12178 | 0.566745 | 0.566745 | 0.566745 | 0.566745 | 0.566745 | 0.566745 | 0 | 0.016158 | 0.076285 | 603 | 24 | 48 | 25.125 | 0.750449 | 0 | 0 | 0.285714 | 0 | 0 | 0.681063 | 0.460133 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
18881503450fa40956f0ca68e86554a2f6e3cbc4 | 396 | py | Python | src/cms/views/feedback/__init__.py | mckinly/cms-django | c9995a3bfab6ee2d02f2406a7f83cf91b7ccfcca | [
"Apache-2.0"
] | 14 | 2020-12-03T07:56:30.000Z | 2021-10-30T13:09:50.000Z | integreat_cms/cms/views/feedback/__init__.py | Carlosbogo/integreat-cms | 066f188b138e105e72f5420bc36d25709f25402d | [
"Apache-2.0"
] | 367 | 2020-11-20T00:34:20.000Z | 2021-12-14T15:20:42.000Z | src/cms/views/feedback/__init__.py | mckinly/cms-django | c9995a3bfab6ee2d02f2406a7f83cf91b7ccfcca | [
"Apache-2.0"
] | 3 | 2021-02-09T18:46:52.000Z | 2021-12-07T10:41:39.000Z | from .admin_feedback_list_view import AdminFeedbackListView
from .region_feedback_list_view import RegionFeedbackListView
from .admin_feedback_actions import (
mark_admin_feedback_as_read,
mark_admin_feedback_as_unread,
delete_admin_feedback,
)
from .region_feedback_actions import (
mark_region_feedback_as_read,
mark_region_feedback_as_unread,
delete_region_feedback,
)
| 30.461538 | 61 | 0.843434 | 50 | 396 | 6.08 | 0.3 | 0.213816 | 0.111842 | 0.144737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 396 | 12 | 62 | 33 | 0.873563 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1892178d68cd1dfea7b2f690eac74f310d741b28 | 436 | py | Python | preprocessor.py | betoesquivel/onforums-application | 161320b4ad65692ca3b490c662e3003fe55f5bcc | [
"MIT"
] | null | null | null | preprocessor.py | betoesquivel/onforums-application | 161320b4ad65692ca3b490c662e3003fe55f5bcc | [
"MIT"
] | null | null | null | preprocessor.py | betoesquivel/onforums-application | 161320b4ad65692ca3b490c662e3003fe55f5bcc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
The article dictionary ends up in this mongo format
comment_id : [<e|"#comment-68330010">]
author : [<content>]
author_id : [<content>]
reply_count : [<content>]
timestamp : [<content>]
reply_to_author : [<content>]
reply_to_comment : [<content>]
content : [<content>]
'''
import pandas as pd
def reverse_comments(article):
comment_df = pd.DataFrame(article['comments'])
| 22.947368 | 51 | 0.651376 | 52 | 436 | 5.288462 | 0.615385 | 0.130909 | 0.101818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022792 | 0.194954 | 436 | 18 | 52 | 24.222222 | 0.760684 | 0.740826 | 0 | 0 | 0 | 0 | 0.07619 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
189a0c6c0eb09d9f12186c4a6580f0aa15e7dedf | 14,310 | py | Python | transformers/examples/control/train_run.py | jordiclive/ControlPrefixes | b647f68bf0c7e771f847c4a51e5f22af2ac95699 | [
"Apache-1.1"
] | 26 | 2021-11-23T09:01:32.000Z | 2022-03-25T11:34:15.000Z | transformers/examples/control/train_run.py | jordiclive/ControlPrefixes | b647f68bf0c7e771f847c4a51e5f22af2ac95699 | [
"Apache-1.1"
] | 3 | 2021-12-10T17:43:23.000Z | 2022-03-18T11:37:19.000Z | transformers/examples/control/train_run.py | jordiclive/ControlPrefixes | b647f68bf0c7e771f847c4a51e5f22af2ac95699 | [
"Apache-1.1"
] | 5 | 2021-12-19T03:22:08.000Z | 2022-02-14T04:41:04.000Z | import os, sys
# example: python train_run.py keyword temp_keyword _
if not sys.warnoptions:
import warnings
warnings.simplefilter("ignore")
if __name__ == '__main__':
mode = sys.argv[1]
model_file = sys.argv[2]
old_model = sys.argv[3]
bsz = sys.argv[4]
dataless = sys.argv[5]
load_prefix_model = sys.argv[6]
tuning_mode = sys.argv[7]
use_big = sys.argv[8]
assert tuning_mode in ['finetune', 'prefixtune', 'finetune-top']
if dataless == 'yes':
print('A BIG WARNING, dataless=True')
print('WARNING '*50 )
if mode == 'embMatch':
TRAIN_FILE='/u/scr/xlisali/contrast_LM/data_api/dataset/matching_train_small.txt'
TEST_FILE='/u/scr/xlisali/contrast_LM/data_api/dataset/matching_dev_small.txt'
# TRAIN_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
# TEST_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_matching"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
if mode == 'keyword':
# TRAIN_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
# TEST_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
TRAIN_FILE='/u/scr/xlisali/contrast_LM/data_api/dataset/matching_train_small.txt'
TEST_FILE='/u/scr/xlisali/contrast_LM/data_api/dataset/matching_dev_small.txt'
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_matching"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
if mode == 'multiple_keywords':
# TRAIN_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
# TEST_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
TRAIN_FILE='/u/scr/xlisali/contrast_LM/data_api/dataset/matching_train_small.txt'
TEST_FILE='/u/scr/xlisali/contrast_LM/data_api/dataset/matching_dev_small.txt'
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_matching"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
elif mode == 'topic':
TRAIN_FILE="/u/scr/xlisali/contrast_LM/transformers/examples/text-classification/glue_data/AG-news/train1.tsv"
TEST_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/text-classification/glue_data/AG-news/dev1.tsv"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_topic"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
elif mode == 'length':
# TRAIN_FILE = '/u/scr/xlisali/contrast_LM/data_api/dataset/matching_train_small.txt'
# TEST_FILE = '/u/scr/xlisali/contrast_LM/data_api/dataset/matching_dev_small.txt'
TRAIN_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
TEST_FILE = "/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_topic"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
elif mode == 'debug':
TRAIN_FILE="/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
TEST_FILE="/u/scr/xlisali/contrast_LM/data_api/dataset/matching_debug_0.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_debug"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
elif mode =='data2text':
TRAIN_FILE = "/u/scr/xlisali/e2e_data/src1_train.txt"
TEST_FILE = "/u/scr/xlisali/e2e_data/src1_valid.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_data2text"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
# when we have input-based AND activation level AND infix.
# app = "--optim_prefix {} --preseqlen {} --prefix_mode {} --format_mode {} " \
# "--gradient_accumulation_steps 1 ".format('no', 15, 'activation', 'infix')
# Try to replicate the best performing version of cat.
app = "--optim_prefix {} --preseqlen {} --prefix_mode {} --format_mode {} " \
"--gradient_accumulation_steps 1 ".format('no', 15, 'activation', 'cat')
# app = "--optim_prefix {} --preseqlen {} --prefix_mode {} --format_mode {} " \
# "--gradient_accumulation_steps 1 ".format('peek', 15, 'activation', 'cat')
# We have instruction based AND embedding AND peek.
# app = "--optim_prefix {} --preseqlen {} --prefix_mode {} --format_mode {}".format('yes', 20, 'embedding', 'peek')
# We have instruction based AND activation AND peek.
# app = "--optim_prefix {} --preseqlen {} --prefix_mode {} --format_mode {}".format('yes', 15, 'activation', 'peek')
elif mode =='lemma2text':
TRAIN_FILE = "/u/scr/xlisali/ud_en/gpt2-train.txt"
TEST_FILE = "/u/scr/xlisali/ud_en/gpt2-dev.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_data2text"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
elif mode =='text2data':
TRAIN_FILE = "/u/scr/xlisali/e2e_data/src1_train.txt"
TEST_FILE = "/u/scr/xlisali/e2e_data/src1_valid.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE="medium_text2data"
if old_model != '_':
OLD_MODEL=old_model
else:
OLD_MODEL="gpt2-medium"
elif mode == 'dataless':
TRAIN_FILE = None
TEST_FILE = None
if model_file:
Model_FILE = model_file
else:
Model_FILE = "medium_dataless"
if old_model != '_':
OLD_MODEL = old_model
else:
OLD_MODEL = "gpt2-medium"
elif mode == 'gen_data':
if 'topic' in model_file:
TRAIN_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial-data-topic/gptgen_sentiment_train.txt"
# TRAIN_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial-data-topic/gptgen_sentiment_valid.txt"
# TRAIN_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial-data/gptgen_sentiment.txt"
TEST_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial-data-topic/gptgen_sentiment_valid.txt"
elif 'sent' in model_file:
TRAIN_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial-data/gptgen_sentiment_train.txt"
TEST_FILE = "/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial-data/gptgen_sentiment_valid.txt"
if model_file:
Model_FILE = model_file
else:
Model_FILE = "medium_topic_gen"
if old_model != '_':
OLD_MODEL = old_model
else:
OLD_MODEL = "gpt2-medium"
elif mode == 'generate':
TRAIN_FILE = '_'
TEST_FILE = '_'
if model_file:
Model_FILE = model_file
else:
Model_FILE = "medium_topic_gen"
if old_model != '_':
OLD_MODEL = old_model
else:
OLD_MODEL = "gpt2-medium"
controlprefix = ('yes' if tuning_mode == 'prefixtune' else 'no')
COMMANDLINE="python run_language_modeling.py \
--output_dir={} \
--model_type=gpt2 \
--model_name_or_path={} \
--tokenizer_name=gpt2-medium \
--per_device_train_batch_size {} \
--per_device_eval_batch_size {} \
--save_steps 5000 \
--num_train_epochs 5 \
--do_train \
--train_data_file={} \
--do_eval \
--line_by_line \
--save_total_limit 0 \
--overwrite_output_dir \
--task_mode {} \
--eval_data_file={} \
--dataless {} --tuning_mode {} --controlprefix {} \
--train_embs no ".format(Model_FILE, OLD_MODEL, bsz, bsz, TRAIN_FILE, mode, TEST_FILE,
dataless, tuning_mode, controlprefix)
COMMANDLINE += app
# LOAD_TRAIN_PREFIX = None
# LOAD_TRAIN_PREFIX = '/u/scr/xlisali/contrast_LM/transformers/examples/control/len_trial/checkpoint-1000'
if load_prefix_model == 'yes':
LOAD_TRAIN_PREFIX = '/u/scr/xlisali/contrast_LM/transformers/examples/control/med_topic_gen'
COMMANDLINE += '--prefixModel_name_or_path {} '.format(LOAD_TRAIN_PREFIX)
DATALESS = (dataless =='yes')
if DATALESS:
# use gumbel
COMMANDLINE += '--dataless_sample_size {} ' \
'--dataless_sample_length {} ' \
'--dataless_usebaseline {} ' \
'--dataless_control_type {} ' \
'--gradient_accumulation_steps 1 ' \
'--gumbel {} ' \
'--replay_buffer {} ' \
'--training_obj {} ' \
'--dataless_discri_model_path {}'.format(5, 50, 'yes', 0, 'yes', 'yes', 0, 'textattack/roberta-base-imdb') # 2 for sentiment;; 3 for length.
# '--dataless_discri_model_path {}'.format(4, 60, 'yes', 2, 'no', 'yes', 0, 'textattack/roberta-base-ag-news') # 2 for sentiment;; 3 for length.
# '--dataless_discri_model_path {}'.format(8, 60, 'yes', 2, 'no', 'yes', 0, 'textattack/roberta-base-imdb') # 2 for sentiment;; 3 for length.
os.system(COMMANDLINE) # textattack/roberta-base-ag-news # textattack/roberta-base-imdb
# #
# print(use_big)
# if use_big == 'no':
# full_command = "nlprun -a lisa-base-torch -g 1 -n {} -x jagupard4,jagupard5,jagupard6,jagupard7,jagupard8 \'{}\'".format(Model_FILE, COMMANDLINE)
# elif True:
# full_command = "nlprun -p high -a lisa-base-torch -g 1 -n {} -x jagupard4,jagupard5,jagupard6,jagupard7,jagupard8," \
# "jagupard10,jagupard11,jagupard12,jagupard13,jagupard14,jagupard15,jagupard16,jagupard17,jagupard18," \
# "jagupard19,jagupard20,jagupard21,jagupard22,jagupard23," \
# "jagupard24,jagupard25 \'{}\'".format(Model_FILE, COMMANDLINE)
# else:
# full_command = "nlprun -a lisa-base-torch -m jagupard26 -p high -g 1 -n {} \'{}\'".format(Model_FILE, COMMANDLINE)
#
# print(full_command)
# os.system(full_command)
#
#nlprun -a lisa-base-torch -g 1 --p high -n 5top-finetune -x jagupard4,jagupard5,jagupard6,jagupard7,jagupard8,jagupard10,jagupard11,jagupard12,jagupard13,jagupard14,jagupard15,jagupard16,jagupard17,jagupard18,jagupard19,jagupard20,jagupard21,jagupard22,jagupard23,jagupard24,jagupard25 '$COMMANDLINE'
#nlprun -a lisa-base-torch -g 1 -n topk-medium-finetune -m jagupard26 '$COMMANDLINE'
################
# python train_run.py generate topichaha _ 10 no no _
##############
# keyword training.
# python train_run.py keyword keywordhaha _ 10 no no _
##############
# Embedding training.
# python train_run.py embMatch embMatchhaha _ 10 no no _
##############
# Selective Classifier training.
# python train_run.py gen_data topichaha_s _ 10 no no no
##############
# Finetune keyword training.
# python train_run.py keyword keywordfinetune _ 1 no no yes
# python train_run.py embMatch embMatchfinetune _ 10 no no no
###########
# FINETUNE Data2Text
# python train_run.py data2text data2textfinetune _ 10 no no finetune no
# python train_run.py data2text data2textprefixtune10 _ 10 no no prefixtune no
# python train_run.py dataless dataless2 _ 10 yes no prefixtune no
###############
# python train_run.py topic topicprefixtune _ 3 no no prefixtune no
# python train_run.py topic topicfinetune _ 2 no no finetune no
# python train_run.py keyword keywordfinetune _ 4 no no finetune no
# python train_run.py keyword keywordprefixtune _ 4 no no prefixtune no
###########################
## python train_run.py data2text data2textfinetune-top _ 10 no no finetune-top no
## python train_run.py data2text data2textprefixtune-emb _ 10 no no prefixtune no (cat)
## python train_run.py data2text data2textprefixtune-emb-peek _ 10 no no prefixtune no (peek)
# ## python train_run.py data2text data2textprefixtune-emb-nopeek _ 10 no no prefixtune no (nopeek)
# ## python train_run.py data2text data2textprefixtune-emb-para _ 10 no no prefixtune no (instruction)
## python train_run.py data2text data2textprefixtune15 _ 10 no no prefixtune no (instruction based activation)
# python train_run.py data2text data2textprefixtune-infix-emb-cat2 _ 10 no no prefixtune no (peek)
# python train_run.py data2text data2textprefixtune-infix-latent-cat2 _ 10 no no prefixtune no
###########################
# python train_run.py data2text data2textprefixtune-no-act-cat-rep _ 10 no no prefixtune no (cat, epoch=6)
# python train_run.py data2text data2textprefixtune-no-act-cat-rep2 _ 10 no no prefixtune no (cat, epoch=5)
#
#
# if False:
# COMMANDLINE += '--dataless_sample_size {} ' \
# '--dataless_sample_length {} ' \
# '--dataless_usebaseline {} ' \
# '--dataless_control_type {} ' \
# '--gradient_accumulation_steps 20 ' \
# '--gumbel {} ' \
# '--replay_buffer {} ' \
# '--training_obj {} ' \
# '--dataless_discri_model_path {}'.format(8, 60, 'yes', 2, 'no', 'yes', 0, 'textattack/roberta-base-imdb') # 2 for sentiment;; 3 for length.
# # '--dataless_discri_model_path {}'.format(4, 60, 'yes', 2, 'no', 'yes', 0, 'textattack/roberta-base-ag-news') # 2 for sentiment;; 3 for length.
| 37.265625 | 301 | 0.621314 | 1,741 | 14,310 | 4.838024 | 0.137277 | 0.058768 | 0.044402 | 0.056987 | 0.777158 | 0.737979 | 0.716016 | 0.665915 | 0.651074 | 0.611896 | 0 | 0.025964 | 0.251782 | 14,310 | 383 | 302 | 37.362924 | 0.760717 | 0.415584 | 0 | 0.557292 | 0 | 0.03125 | 0.30571 | 0.218893 | 0 | 0 | 0 | 0 | 0.005208 | 1 | 0 | false | 0 | 0.010417 | 0 | 0.010417 | 0.010417 | 0 | 0 | 0 | null | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
18cbcfa71f19ea5b49686cfe7a4b74ce4d6fcda3 | 115 | py | Python | {{cookiecutter.plugin_name}}/{{cookiecutter.module_name}}/__init__.py | ltalirz/aiida-plugin-cutter | 572522cc0dbe6aedc93ab83345e771d1e10cef6f | [
"MIT"
] | null | null | null | {{cookiecutter.plugin_name}}/{{cookiecutter.module_name}}/__init__.py | ltalirz/aiida-plugin-cutter | 572522cc0dbe6aedc93ab83345e771d1e10cef6f | [
"MIT"
] | null | null | null | {{cookiecutter.plugin_name}}/{{cookiecutter.module_name}}/__init__.py | ltalirz/aiida-plugin-cutter | 572522cc0dbe6aedc93ab83345e771d1e10cef6f | [
"MIT"
] | null | null | null | """
{{cookiecutter.module_name}}
{{cookiecutter.short_description}}
"""
__version__ = "{{cookiecutter.version}}"
| 14.375 | 40 | 0.713043 | 9 | 115 | 8.444444 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078261 | 115 | 7 | 41 | 16.428571 | 0.716981 | 0.556522 | 0 | 0 | 0 | 0 | 0.55814 | 0.55814 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
18de7a82e12762cf69a99d3c0b800c4dd7474a73 | 200 | py | Python | programming-laboratory-I/vkff/fatorial.py | MisaelAugusto/computer-science | d21335a2dc824b54ffe828370f0e6717fd0c7c27 | [
"MIT"
] | null | null | null | programming-laboratory-I/vkff/fatorial.py | MisaelAugusto/computer-science | d21335a2dc824b54ffe828370f0e6717fd0c7c27 | [
"MIT"
] | null | null | null | programming-laboratory-I/vkff/fatorial.py | MisaelAugusto/computer-science | d21335a2dc824b54ffe828370f0e6717fd0c7c27 | [
"MIT"
] | null | null | null | # coding: utf-8
# Aluno: Misael Augusto
# Matrícula: 117110525
# Problema: Fatorial
numero = int(raw_input())
fatorial = 1
for i in range(numero):
fatorial *= numero
numero -= 1
print fatorial
| 14.285714 | 25 | 0.7 | 27 | 200 | 5.148148 | 0.740741 | 0.201439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 0.19 | 200 | 13 | 26 | 15.384615 | 0.783951 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
18e8eead33b9102d21cf78e6cb26f08e6dba7d68 | 2,999 | py | Python | models/00_tables.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | 1 | 2021-11-08T16:38:22.000Z | 2021-11-08T16:38:22.000Z | models/00_tables.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | null | null | null | models/00_tables.py | himansu1997/eden | 1e2cf2b00f55da46b1ce3e6b7ad44b5345d7a1dc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Global tables and re-usable fields
"""
# =============================================================================
# Import models
#
from s3.s3model import S3Model
import s3db as models
current.models = models
# Explicit import statements to have them reload automatically in debug mode
# - still needed when not running debug
#import s3db.assess
import s3db.asset
import s3db.auth
import s3db.br
import s3db.budget
import s3db.cap
#import s3db.climate
import s3db.cms
import s3db.cr
import s3db.dc
#import s3db.delphi
#import s3db.deploy
import s3db.disease
import s3db.doc
import s3db.dvi
#import s3db.dvr
import s3db.edu
import s3db.event
import s3db.fin
import s3db.fire
import s3db.gis
import s3db.hrm
import s3db.inv
import s3db.med
import s3db.member
import s3db.msg
import s3db.ocr
import s3db.org
import s3db.patient
#import s3db.po
import s3db.police
import s3db.pr
import s3db.proc
import s3db.project
import s3db.req
import s3db.s3
import s3db.security
import s3db.setup
import s3db.sit
import s3db.stats
#import s3db.stdm
import s3db.supply
#import s3db.survey
import s3db.sync
#import s3db.tour
import s3db.translate
import s3db.transport
import s3db.vehicle
import s3db.vol
import s3db.vulnerability
import s3db.water
if debug:
# Also reload Custom Models
custom_models = settings.get_base_custom_models()
for prefix in custom_models:
parent = __import__("templates.%s" % custom_models[prefix], fromlist=[prefix])
current.s3db = s3db = S3Model()
# =============================================================================
# Configure the auth models
# - needed for admin/user, sync/sync & 1st_run, so could move to a fn called
# from those 3 if overhead grows
s3db.configure("auth_user",
# We don't want this for Sync, just in admin/user & 1st_run
#create_onaccept = lambda form: auth.s3_approve_user(form.vars),
# @ToDo: Consider moving these pseudo FKs into link tables with real FKs
references = {"organisation_id": "org_organisation",
"site_id": "org_site",
"org_group_id": "org_group",
},
)
s3db.add_components("auth_user",
auth_membership = "user_id",
pr_person_user = "user_id",
)
s3db.configure("auth_membership",
# @ToDo: Consider moving these pseudo FKs into link tables with real FKs
references = {"pe_id": "pr_pentity",
},
)
# =============================================================================
# Make available for S3Models
# - legacy for backwards compatibility w docs & custom modules
from s3.s3fields import S3ReusableField, s3_comments, s3_meta_fields
s3.comments = s3_comments
s3.meta_fields = s3_meta_fields
# END =========================================================================
| 27.768519 | 87 | 0.615539 | 370 | 2,999 | 4.881081 | 0.424324 | 0.287929 | 0.019934 | 0.025471 | 0.100775 | 0.100775 | 0.074197 | 0.074197 | 0.074197 | 0.074197 | 0 | 0.032613 | 0.212738 | 2,999 | 107 | 88 | 28.028037 | 0.732317 | 0.386796 | 0 | 0 | 0 | 0 | 0.078333 | 0 | 0 | 0 | 0 | 0.009346 | 0 | 1 | 0 | false | 0 | 0.686567 | 0 | 0.686567 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
18f2c2ecde4247fb78365dd0784ed9a821c1cb89 | 566 | py | Python | values.py | lechat/multiconf | c41cbe9ab3fb768a7d4dbd7b9f5d983b1306bde3 | [
"BSD-3-Clause"
] | null | null | null | values.py | lechat/multiconf | c41cbe9ab3fb768a7d4dbd7b9f5d983b1306bde3 | [
"BSD-3-Clause"
] | null | null | null | values.py | lechat/multiconf | c41cbe9ab3fb768a7d4dbd7b9f5d983b1306bde3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
class MCInvalidValue(object):
def __init__(self, name):
self.name = name
def __nonzero__(self):
return False
def __repr__(self):
return self.name
def json_equivalent(self):
return self.__repr__()
MC_REQUIRED = MCInvalidValue("MC_REQUIRED")
MC_TODO = MCInvalidValue("MC_TODO")
_MC_NO_VALUE = MCInvalidValue("_MC_NO_VALUE")
_mc_invalid_values = (MC_REQUIRED, MC_TODO, _MC_NO_VALUE)
| 23.583333 | 73 | 0.712014 | 76 | 566 | 4.842105 | 0.513158 | 0.065217 | 0.07337 | 0.086957 | 0.081522 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008811 | 0.19788 | 566 | 23 | 74 | 24.608696 | 0.801762 | 0.220848 | 0 | 0 | 0 | 0 | 0.068493 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0 | 0.230769 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e16b24eeb73beaf2ec45450aaa26afffb0e1464a | 240 | py | Python | korg/__init__.py | markfink/korg | 6a123031b69896f61fe0007f4a1d5f6f064b6ad9 | [
"MIT"
] | null | null | null | korg/__init__.py | markfink/korg | 6a123031b69896f61fe0007f4a1d5f6f064b6ad9 | [
"MIT"
] | 2 | 2020-01-18T10:32:13.000Z | 2020-01-18T10:34:17.000Z | korg/__init__.py | markfink/korg | 6a123031b69896f61fe0007f4a1d5f6f064b6ad9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
def here(p):
return os.path.abspath(os.path.join(os.path.dirname(__file__), p))
from .korg import LineGrokker
from .pattern import PatternRepo
| 21.818182 | 70 | 0.75 | 35 | 240 | 4.857143 | 0.685714 | 0.105882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004808 | 0.133333 | 240 | 10 | 71 | 24 | 0.8125 | 0.0875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.666667 | 0.166667 | 1 | 0.166667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
e17a6901829ca0ca3e913780516fbc9a0720ec6a | 6,348 | py | Python | b2ac/matrix/matrix_ref.py | hbldh/ellipse-fitting | 77a13ab29ae44b32238e754bff1d2cc6e20883dd | [
"MIT"
] | 16 | 2016-02-16T18:55:18.000Z | 2021-12-15T20:07:45.000Z | b2ac/matrix/matrix_ref.py | hbldh/ellipse-fitting | 77a13ab29ae44b32238e754bff1d2cc6e20883dd | [
"MIT"
] | 6 | 2015-10-18T22:28:20.000Z | 2016-05-17T22:07:38.000Z | b2ac/matrix/matrix_ref.py | hbldh/ellipse-fitting | 77a13ab29ae44b32238e754bff1d2cc6e20883dd | [
"MIT"
] | 7 | 2016-05-15T16:21:19.000Z | 2021-09-09T11:12:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: matrix
:platform: Unix, Windows
:synopsis: Operations on matrices.
.. moduleauthor:: hbldh <henrik.blidh@nedomull.com>
Created on 2013-05-15, 10:45
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import numpy as np
from b2ac.compat import *
def inverse_symmetric_3by3_double(M):
"""C style inverse of a symmetric, flattened 3 by 3 matrix.
Returns the adjoint matrix and the determinant, s.t.
.. math::
M^{-1} = \\frac{1}{\\det(M)} \\cdot \\text{adj}(M).
For integer matrices, this then returns exact results by avoiding
to apply the division.
:param M: The matrix to find inverse to. Assumes array with shape (6,).
:type M: :py:class:`numpy.ndarray`
:return: The inverse matrix, flattened.
:rtype: :py:class:`numpy.ndarray`
"""
determinant = 0
inverse = np.zeros((9,), dtype='float')
# First row of adjunct matrix
inverse[0] = (M[3] * M[5] - (M[4] ** 2)) # Det #0
inverse[1] = -(M[1] * M[5] - M[4] * M[2]) # Det #1
inverse[2] = (M[1] * M[4] - M[3] * M[2]) # Det #2
# Second row of adjunct matrix
inverse[3] = inverse[1]
inverse[4] = (M[0] * M[5] - (M[2] ** 2))
inverse[5] = -(M[0] * M[4] - M[1] * M[2])
# Third row of adjunct matrix
inverse[6] = inverse[2]
inverse[7] = inverse[5]
inverse[8] = (M[0] * M[3] - (M[1] ** 2))
determinant += M[0] * inverse[0]
determinant += M[1] * inverse[1] # Using addition since minus is integrated in adjunct matrix.
determinant += M[2] * inverse[2]
for i in xrange(len(inverse)):
inverse[i] /= determinant
return inverse
def inverse_symmetric_3by3_int(M):
"""C style inverse of a symmetric, flattened 3 by 3 matrix.
Returns the adjoint matrix and the determinant, s.t.
.. math::
M^{-1} = \\frac{1}{\\det(M)} \\cdot \\text{adj}(M).
For integer matrices, this then returns exact results by avoiding
to apply the division.
:param M: The matrix to find inverse to. Assumes array with shape (6,).
:type M: :py:class:`numpy.ndarray`
:return: The adjoint flattened matrix and the determinant.
:rtype: tuple
"""
determinant = 0
adj_M = np.zeros((9,), dtype='int32')
# First row of adjunct matrix
adj_M[0] = (M[3] * M[5] - (M[4] ** 2)) # Det #0
adj_M[1] = -(M[1] * M[5] - M[4] * M[2]) # Det #1
adj_M[2] = (M[1] * M[4] - M[3] * M[2]) # Det #2
# Second row of adjunct matrix
adj_M[3] = adj_M[1]
adj_M[4] = (M[0] * M[5] - (M[2] ** 2))
adj_M[5] = -(M[0] * M[4] - M[1] * M[2])
# Third row of adjunct matrix
adj_M[6] = adj_M[2]
adj_M[7] = adj_M[5]
adj_M[8] = (M[0] * M[3] - (M[1] ** 2))
determinant += np.int64(M[0]) * np.int64(adj_M[0])
determinant += np.int64(M[1]) * np.int64(adj_M[1]) # Using addition since minus is integrated in adjunct matrix.
determinant += np.int64(M[2]) * np.int64(adj_M[2])
return adj_M, determinant
def inverse_3by3_int(M):
"""C style inverse of a flattened 3 by 3 matrix.
Returns the adjoint matrix and the determinant, s.t.
.. math::
M^{-1} = \\frac{1}{\\det(M)} \\cdot \\text{adj}(M).
For integer matrices, this then returns exact results by avoiding
to apply the division.
:param M: The matrix to find inverse to.
:type M: :py:class:`numpy.ndarray`
:return: The adjoint flattened matrix and the determinant.
:rtype: tuple
"""
if len(M.shape) > 1:
M = M.flatten()
determinant = 0
adj_M = np.zeros((9,), 'int')
# First row of adjunct matrix
adj_M[0] = (M[4] * M[8] - M[7] * M[5]) # Det #0
adj_M[1] = -(M[1] * M[8] - M[7] * M[2])
adj_M[2] = (M[1] * M[5] - M[4] * M[2])
# Second row of adjunct matrix
adj_M[3] = -(M[3] * M[8] - M[6] * M[5]) # Det #1
adj_M[4] = (M[0] * M[8] - M[6] * M[2])
adj_M[5] = -(M[0] * M[5] - M[3] * M[2])
# Third row of adjunct matrix
adj_M[6] = (M[3] * M[7] - M[6] * M[4]) # Det #2
adj_M[7] = -(M[0] * M[7] - M[6] * M[1])
adj_M[8] = (M[0] * M[4] - M[3] * M[1])
determinant += np.int64(M[0]) * np.int64(adj_M[0])
determinant += np.int64(M[1]) * np.int64(adj_M[3]) # Using addition since minus is integrated in adjunct matrix.
determinant += np.int64(M[2]) * np.int64(adj_M[6])
return adj_M, determinant
def inverse_3by3_double(M):
"""C style inverse of a flattened 3 by 3 matrix.
.. math::
M^{-1} = \\frac{1}{\\det(M)} \\cdot \\text{adj}(M).
For integer matrices, this then returns exact results by avoiding
to apply the division.
:param M: The matrix to find inverse to.
:type M: :py:class:`numpy.ndarray`
:return: The inverse matrix.
:rtype: :py:class:`numpy.ndarray`
"""
if len(M.shape) > 1:
M = M.flatten()
determinant = 0
adj_M = np.zeros((9,), 'int')
# First row of adjunct matrix
adj_M[0] = (M[4] * M[8] - M[7] * M[5]) # Det #0
adj_M[1] = -(M[1] * M[8] - M[7] * M[2])
adj_M[2] = (M[1] * M[5] - M[4] * M[2])
# Second row of adjunct matrix
adj_M[3] = -(M[3] * M[8] - M[6] * M[5]) # Det #1
adj_M[4] = (M[0] * M[8] - M[6] * M[2])
adj_M[5] = -(M[0] * M[5] - M[3] * M[2])
# Third row of adjunct matrix
adj_M[6] = (M[3] * M[7] - M[6] * M[4]) # Det #2
adj_M[7] = -(M[0] * M[7] - M[6] * M[1])
adj_M[8] = (M[0] * M[4] - M[3] * M[1])
determinant += M[0] * adj_M[0]
determinant += M[1] * adj_M[3] # Using addition since minus is integrated in adjunct matrix.
determinant += M[2] * adj_M[6]
return adj_M / determinant
def add_symmetric_matrix(M, M_sym):
"""Add a regular matrix and a symmetric one.
:param M: A [3x3] matrix to add with symmetric matrix.
:type M: :py:class:`numpy.ndarray`
:param M_sym: A [6x1] array to add with M.
:type M_sym: :py:class:`numpy.ndarray`
:return: The sum of the two matrices.
:rtype: :py:class:`numpy.ndarray`
"""
M[0, 0] += M_sym[0]
M[0, 1] += M_sym[1]
M[1, 0] += M_sym[1]
M[0, 2] += M_sym[2]
M[2, 0] += M_sym[2]
M[1, 1] += M_sym[3]
M[1, 2] += M_sym[4]
M[2, 1] += M_sym[4]
M[2, 2] += M_sym[5]
return M
| 27.244635 | 117 | 0.558916 | 1,101 | 6,348 | 3.142598 | 0.117166 | 0.056647 | 0.01474 | 0.062428 | 0.76763 | 0.730058 | 0.712717 | 0.692197 | 0.660983 | 0.643931 | 0 | 0.064509 | 0.255198 | 6,348 | 232 | 118 | 27.362069 | 0.667301 | 0.439509 | 0 | 0.367816 | 0 | 0 | 0.004888 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.057471 | false | 0 | 0.068966 | 0 | 0.183908 | 0.011494 | 0 | 0 | 0 | null | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e185ae216466d9c7f507e1311ac5f8e9a8f7fbf0 | 331 | py | Python | comprehension/lab/filter_numbers.py | PetkoAndreev/Python-advanced | 94fd0fa69b366b978921ee8d4e214d3d3b4335d6 | [
"MIT"
] | null | null | null | comprehension/lab/filter_numbers.py | PetkoAndreev/Python-advanced | 94fd0fa69b366b978921ee8d4e214d3d3b4335d6 | [
"MIT"
] | null | null | null | comprehension/lab/filter_numbers.py | PetkoAndreev/Python-advanced | 94fd0fa69b366b978921ee8d4e214d3d3b4335d6 | [
"MIT"
] | null | null | null | start = int(input())
end = int(input())
def is_divide(number):
return any(number % i == 0 for i in range(2, 11))
def get_divise_numbers(start, end):
return [s for s in range(start, end + 1) if is_divide(s)]
def print_result(numbers):
print(numbers)
numbers = get_divise_numbers(start, end)
print_result(numbers) | 18.388889 | 61 | 0.685801 | 55 | 331 | 3.981818 | 0.454545 | 0.109589 | 0.146119 | 0.191781 | 0.219178 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01845 | 0.181269 | 331 | 18 | 62 | 18.388889 | 0.789668 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0 | 0.2 | 0.5 | 0.3 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
e1b1c3a3d7747850743eb0102fde3d112a59d4ff | 1,055 | py | Python | telethon/_events/filters/messages.py | udf/Telethon | 0bc598c1217818e62c3b4dd9e8a05c87109714f9 | [
"MIT"
] | 2 | 2022-01-17T13:08:34.000Z | 2022-01-20T05:33:43.000Z | telethon/_events/filters/messages.py | udf/Telethon | 0bc598c1217818e62c3b4dd9e8a05c87109714f9 | [
"MIT"
] | null | null | null | telethon/_events/filters/messages.py | udf/Telethon | 0bc598c1217818e62c3b4dd9e8a05c87109714f9 | [
"MIT"
] | null | null | null | import re
from .base import Filter
class Incoming:
"""
The update must be something the client received from another user,
and not something the current user sent.
"""
def __call__(self, event):
return not event.out
class Outgoing:
"""
The update must be something the current user sent,
and not something received from another user.
"""
def __call__(self, event):
return event.out
class Pattern:
"""
The update type must match the specified instances for the filter to return `True`.
This is most useful for raw API.
"""
def __init__(self, pattern):
self._pattern = re.compile(pattern).match
def __call__(self, event):
return self._pattern(event.text)
class Data:
"""
The update type must match the specified instances for the filter to return `True`.
This is most useful for raw API.
"""
def __init__(self, data):
self._data = re.compile(data).match
def __call__(self, event):
return self._data(event.data)
| 23.444444 | 87 | 0.654976 | 143 | 1,055 | 4.636364 | 0.314685 | 0.054299 | 0.066365 | 0.096531 | 0.615385 | 0.485671 | 0.404223 | 0.310709 | 0.310709 | 0.310709 | 0 | 0 | 0.262559 | 1,055 | 44 | 88 | 23.977273 | 0.852185 | 0.417062 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.111111 | 0.222222 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
e1b5dbd2f474244cca88d065923244cc2785b8e9 | 250 | py | Python | cell_tools/_multiome/__init__.py | mvinyard/cell-tools | 2482ccbe13c7a5cc06d575adefe0158026c8e03b | [
"MIT"
] | 1 | 2022-01-11T20:00:44.000Z | 2022-01-11T20:00:44.000Z | cell_tools/_multiome/__init__.py | mvinyard/cell-tools | 2482ccbe13c7a5cc06d575adefe0158026c8e03b | [
"MIT"
] | null | null | null | cell_tools/_multiome/__init__.py | mvinyard/cell-tools | 2482ccbe13c7a5cc06d575adefe0158026c8e03b | [
"MIT"
] | null | null | null |
# multiome __init__.py
__module_name__ = "__init__.py"
__author__ = ", ".join(["Michael E. Vinyard"])
__email__ = ", ".join(["vinyard@g.harvard.edu",])
from ._filter_features_multiomic import _filter_features_multiomic as filter_features_multiomic | 31.25 | 95 | 0.768 | 30 | 250 | 5.433333 | 0.666667 | 0.257669 | 0.423313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096 | 250 | 8 | 95 | 31.25 | 0.721239 | 0.08 | 0 | 0 | 0 | 0 | 0.236842 | 0.092105 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e1bebc1e714c547771435633cb932eca7c1acdad | 306 | py | Python | test_default_settings.py | vv-p/zealot | 8b3e32e1c083c079c354ed650bdb6a6a374d188f | [
"MIT"
] | 1 | 2020-03-09T05:56:54.000Z | 2020-03-09T05:56:54.000Z | test_default_settings.py | vv-p/zealot | 8b3e32e1c083c079c354ed650bdb6a6a374d188f | [
"MIT"
] | null | null | null | test_default_settings.py | vv-p/zealot | 8b3e32e1c083c079c354ed650bdb6a6a374d188f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.6
import unittest
from zealot.conf import settings
class TestWaitingFor(unittest.TestCase):
def test_default_timeout(self):
self.assertEqual(settings.DEFAULT_TIMEOUT, 1)
def test_default_timeout_enable(self):
self.assertTrue(settings.ENABLE_TIMEOUTS)
| 18 | 53 | 0.754902 | 38 | 306 | 5.894737 | 0.631579 | 0.1875 | 0.125 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011673 | 0.160131 | 306 | 16 | 54 | 19.125 | 0.859922 | 0.075163 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.285714 | false | 0 | 0.285714 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
e1c29f804a1d511033976434a95a3b21f4276c2d | 267 | py | Python | pmdp/__init__.py | dangoldin/poor-mans-data-pipeline | 6ddb95b5c600a7189461b70abf0cc236e4095211 | [
"MIT"
] | 13 | 2016-11-06T02:44:55.000Z | 2018-01-26T07:05:48.000Z | pmdp/__init__.py | dangoldin/poor-mans-data-pipeline | 6ddb95b5c600a7189461b70abf0cc236e4095211 | [
"MIT"
] | null | null | null | pmdp/__init__.py | dangoldin/poor-mans-data-pipeline | 6ddb95b5c600a7189461b70abf0cc236e4095211 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__title__ = 'pmdp'
__version__ = '0.3'
__author__ = 'Dan Goldin'
__license__ = 'MIT'
__copyright__ = 'Copyright 2016 Dan Goldin'
from . import parser
from . import writer
from . import parse_elb_log_local
from . import parse_elb_log_lambda
| 19.071429 | 43 | 0.730337 | 36 | 267 | 4.694444 | 0.666667 | 0.236686 | 0.177515 | 0.213018 | 0.248521 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03125 | 0.161049 | 267 | 13 | 44 | 20.538462 | 0.723214 | 0.078652 | 0 | 0 | 0 | 0 | 0.184426 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.444444 | 0 | 0.444444 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
bece48cb5cbcde2c10faa98c5b68b9de95574728 | 20,587 | py | Python | pyocd/target/builtin/target_musca_b1.py | juhhov/pyOCD | 0965f7f038622ef1d933af5c6916c482a28244ff | [
"Apache-2.0"
] | 1 | 2020-07-11T09:24:25.000Z | 2020-07-11T09:24:25.000Z | pyocd/target/builtin/target_musca_b1.py | ARMmbed/pyOCD-Samsung | 03242b6eb57d2170a4b531d00f1a0577e2b0abde | [
"Apache-2.0"
] | null | null | null | pyocd/target/builtin/target_musca_b1.py | ARMmbed/pyOCD-Samsung | 03242b6eb57d2170a4b531d00f1a0577e2b0abde | [
"Apache-2.0"
] | null | null | null | # pyOCD debugger
# Copyright (c) 2018-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ...flash.flash import Flash
from ...core.coresight_target import CoreSightTarget
from ...core.memory_map import (FlashRegion, RamRegion, MemoryMap)
from ...debug.svd.loader import SVDFile
FLASH_ALGO_QSPI = {
'load_address' : 0x20000000,
'instructions': [
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
0x4604b570, 0x4616460d, 0x44484867, 0xb9e86800, 0x44784866, 0x44494966, 0x46086008, 0x44494965,
0x46086008, 0x44494964, 0x68096008, 0xf0006808, 0x4961fc96, 0x68084449, 0xf0002101, 0xb108f9bb,
0xbd702001, 0x49582001, 0x60084449, 0xe7f82000, 0x4604b510, 0x4854b984, 0x68004448, 0xd10b2801,
0x44494955, 0xf0006808, 0xb108fa1f, 0xbd102001, 0x494d2000, 0x60084449, 0xe7f82000, 0x494eb510,
0x22004449, 0x46116808, 0xfba4f000, 0x2001b108, 0x2000bd10, 0xb510e7fc, 0xf0244604, 0x4604407f,
0x44494945, 0x3280f44f, 0x46216808, 0xfb92f000, 0x2001b108, 0x2000bd10, 0xe92de7fc, 0x460441f0,
0x4617460d, 0x407ff024, 0x493b4604, 0x462b4449, 0x6808463a, 0xf0004621, 0x4606faf2, 0x4630b116,
0x81f0e8bd, 0xe7fb2000, 0x43f8e92d, 0x46884607, 0xf0274615, 0xbf00467f, 0xe0232400, 0x4449492e,
0x466a2304, 0x46316808, 0xfa8bf000, 0x0000f89d, 0x42885d29, 0xf89dd111, 0x1c601001, 0x42815c28,
0xf89dd10b, 0x1ca01002, 0x42815c28, 0xf89dd105, 0x1ce01003, 0x42815c28, 0x1930d002, 0x83f8e8bd,
0x1d241d36, 0xd3d94544, 0xe7f72000, 0x43f8e92d, 0x460f4606, 0xf0264614, 0xbf00457f, 0x0800f04f,
0x4915e01d, 0x23044449, 0x6808466a, 0xf0004629, 0xf89dfa58, 0x42a00000, 0xf89dd10b, 0x42a00001,
0xf89dd107, 0x42a00002, 0xf89dd103, 0x42a00003, 0x2001d002, 0x83f8e8bd, 0xf1081d2d, 0x45b80804,
0x2000d3df, 0x0000e7f6, 0x00000004, 0x00000d9a, 0x00000008, 0x0000000c, 0x00000020, 0xb118b570,
0x2d2018d5, 0xb902d800, 0x2a20bd70, 0x6001d101, 0x2501e7fa, 0x1e6c4095, 0xfa046805, 0x43b5f603,
0x0604ea01, 0x4335409e, 0xbf006005, 0xb510e7ec, 0x21064604, 0xf0006820, 0xbd10fd7b, 0x4604b57f,
0x2000460d, 0x90009003, 0x90029001, 0xaa032301, 0x68202165, 0xfd7ef000, 0xb1164606, 0xb0044630,
0xb125bd70, 0xd00d2d01, 0xd1212d02, 0xf89de015, 0xf040000c, 0x90030040, 0x000cf89d, 0x0080f040,
0xe0179003, 0x000cf89d, 0x0040f020, 0xf89d9003, 0xf040000c, 0x90030080, 0xf89de00c, 0xf040000c,
0x90030040, 0x000cf89d, 0x0080f020, 0xe0019003, 0xe7d42001, 0x4620bf00, 0xffb9f7ff, 0x90002000,
0x90029001, 0xaa032301, 0x68202161, 0xfd5ff000, 0xb10e4606, 0xe7c24630, 0x462a462b, 0x68204629,
0xfb83f000, 0xb10e4606, 0xe7b84630, 0xe7b62000, 0x4604b57f, 0x2000460e, 0x90009003, 0x90029001,
0xaa032301, 0x68202185, 0xfd24f000, 0xb1154605, 0xb0044628, 0x2304bd70, 0x4631461a, 0xf7ffa803,
0x4620ff6d, 0xff83f7ff, 0x90002000, 0x90029001, 0xaa032301, 0x68202181, 0xfd29f000, 0xb10d4605,
0xe7e64628, 0xe7e42000, 0x4605b57f, 0x90032000, 0x2000e00e, 0x90019000, 0x23019002, 0x2170aa03,
0xf0006828, 0x4604fcf7, 0x4620b114, 0xbd70b004, 0x000cf89d, 0x280009c0, 0x2000d0eb, 0xe92de7f6,
0xb0844dff, 0x46924606, 0x9c10469b, 0xf5c0b2e0, 0xe9dd7580, 0xe9cd1011, 0x90024100, 0x4652462b,
0x99056830, 0xfcf3f000, 0xb11f4607, 0xb0084638, 0x8df0e8bd, 0x442c44aa, 0xf7ff4630, 0x4680ffc5,
0x0f00f1b8, 0x4640d001, 0x4630e7f1, 0xff2ff7ff, 0x1011e9dd, 0x0305ebab, 0x4100e9cd, 0x46529002,
0x99056830, 0xfcd3f000, 0xb10f4607, 0xe7de4638, 0xe7dc2000, 0x4df3e92d, 0x4604b082, 0xb1209803,
0xd00b2801, 0xd11b2802, 0x2700e011, 0x0a03f04f, 0xf04f2600, 0x20000b02, 0xe0159001, 0xf04f2700,
0x26080a0b, 0x0b02f04f, 0x90012000, 0x2702e00c, 0x0a6bf04f, 0xf04f2608, 0x20000b32, 0xe0039001,
0xb0042001, 0x8df0e8bd, 0x4639bf00, 0xf7ff4620, 0x4680fef5, 0x0f00f1b8, 0x4640d001, 0x4631e7f1,
0xf7ff4620, 0x4680ff45, 0x0f00f1b8, 0x4640d001, 0xbf00e7e7, 0xf0006820, 0x2800fa40, 0x6820d0fa,
0xfa85f000, 0x682068a1, 0xfa91f000, 0xb10d4605, 0xe7d64628, 0x46514632, 0xf0006820, 0x4605faff,
0x4628b10d, 0x6820e7cd, 0x9a014659, 0xfb01f000, 0xb10d4605, 0xe7c44628, 0x7180f44f, 0xf0006820,
0x4605fb03, 0x4628b10d, 0x2103e7bb, 0xf0006820, 0x4605fb14, 0x4628b10d, 0x6820e7b3, 0xfa5ff000,
0x74209803, 0xe7ac2000, 0x4604b570, 0x46202100, 0xfea4f7ff, 0xb10d4605, 0xbd704628, 0x46202100,
0xfef6f7ff, 0xb10d4605, 0xe7f64628, 0x6820bf00, 0xf9f3f000, 0xd0fa2800, 0xf0006820, 0x6820fa38,
0xfb30f000, 0xf0006820, 0x2000fa3a, 0xbf007420, 0xe92de7e3, 0x46044df0, 0x46174688, 0x6820461d,
0x68406800, 0xfbb51c46, 0xb107fbf6, 0x2001b915, 0x8df0e8bd, 0x0005eb08, 0x428868e1, 0x2006d301,
0xf04fe7f6, 0xe00d0a00, 0x68204641, 0xfadef000, 0x46384632, 0xf0006861, 0x1badfc29, 0x44b04437,
0x0a01f10a, 0xd3ef45da, 0x4641b145, 0xf0006820, 0x462afacd, 0x68614638, 0xfc18f000, 0xf0006820,
0x2000fadc, 0xe92de7d4, 0x46044dfc, 0x4692460f, 0x6820461e, 0x68406800, 0x0801f100, 0x0f00f1ba,
0xb916d000, 0xe8bd2001, 0x19b88dfc, 0x428868e1, 0x2006d301, 0xf007e7f7, 0x1b7f0503, 0xfbb01970,
0x9001f0f8, 0x90002000, 0x4639e01e, 0xf0006820, 0xeba8fa9d, 0x68610205, 0x46511948, 0xfbe6f000,
0x0005eba8, 0xeba81a36, 0x44820005, 0x25004447, 0xf7ff4620, 0x4683fe99, 0x0f00f1bb, 0x4658d001,
0x9800e7d1, 0x90001c40, 0x0100e9dd, 0xd3dc4288, 0x4639b196, 0xf0006820, 0x6861fa79, 0x46321948,
0xf0004651, 0x4620fbc3, 0xfe7ef7ff, 0xf1bb4683, 0xd0010f00, 0xe7b64658, 0xf0006820, 0x2000fa7e,
0xe92de7b1, 0xb0844dff, 0x460e4605, 0x08f8461f, 0x7c289003, 0x2801b160, 0x2802d005, 0xf04fd107,
0x24080a6b, 0xf04fe008, 0x24080a0b, 0xbf00e004, 0x0a03f04f, 0xbf002400, 0xf04fbf00, 0xe0180b00,
0xe9cd2003, 0x94026000, 0x68282308, 0x9a064651, 0xfb50f000, 0xf1b84680, 0xd0030f00, 0xb0084640,
0x8df0e8bd, 0x30089806, 0x36089006, 0xf10b3f08, 0x98030b01, 0xd3e34583, 0x2003b17f, 0x6000e9cd,
0x463b9402, 0x46516828, 0xf0009a06, 0x4680fb33, 0x0f00f1b8, 0x4640d001, 0x2000e7e1, 0xe92de7df,
0xb0864dff, 0x460c4680, 0x08f0461e, 0xf8989005, 0xb1480010, 0xd0062801, 0xd1032802, 0x0b32f04f,
0xe0052500, 0xbf00bf00, 0x0b02f04f, 0xbf002500, 0x2000bf00, 0xe0379004, 0xf7ff4640, 0x0a21fd78,
0xebb11de0, 0xd00f2f10, 0x23082003, 0x0501e9cd, 0x46599400, 0x9a084640, 0xfe11f7ff, 0xb1a74607,
0xb00a4638, 0x8df0e8bd, 0xe9cd2003, 0x94000501, 0xf8d82308, 0x46590000, 0xf0009a08, 0x4682fb08,
0x0f00f1ba, 0x4650d001, 0x4640e7eb, 0xfddcf7ff, 0xb10f4607, 0xe7e44638, 0x30089808, 0x34089008,
0x98043e08, 0x90041c40, 0x0104e9dd, 0xd3c34288, 0x4640b376, 0xfd3bf7ff, 0x19a00a21, 0xebb11e40,
0xd00d2f10, 0x46332003, 0x0501e9cd, 0x46599400, 0x9a084640, 0xfdd3f7ff, 0xb1974607, 0xe7c04638,
0xe9cd2003, 0x94000501, 0xf8d84633, 0x46590000, 0xf0009a08, 0x4682facc, 0x0f00f1ba, 0x4650d001,
0x4640e7af, 0xfda0f7ff, 0xb10f4607, 0xe7a84638, 0xe7a62000, 0x4df0e92d, 0x4607b086, 0x4693460c,
0xf7ff4638, 0xf1bbfd04, 0xd0090f00, 0x5f80f5bb, 0xf5bbd01d, 0xd0124f00, 0x3f80f5bb, 0xe007d11f,
0x2005b11c, 0xe8bdb006, 0x25c78df0, 0xe0182600, 0x260325d8, 0xb108b2a0, 0xe7f32005, 0x2552e011,
0xf3c42603, 0xb108000e, 0xe7eb2005, 0x2520e009, 0xf3c42603, 0xb108000b, 0xe7e32005, 0x2001e001,
0xbf00e7e0, 0x42a068f8, 0x2006d801, 0x2000e7da, 0xc151a901, 0x90009004, 0x461a2300, 0x68384629,
0xf986f000, 0xf1b84680, 0xd0010f00, 0xe7c94640, 0xf7ff4638, 0x4682fd49, 0x0f00f1ba, 0x4640d001,
0x2000e7c0, 0x0000e7be, 0xb118b570, 0x2d2018d5, 0xb902d800, 0x2a20bd70, 0x6001d101, 0x2501e7fa,
0x1e6c4095, 0xfa046805, 0x43b5f603, 0x0604ea01, 0x4335409e, 0xbf006005, 0x4601e7ec, 0x68026808,
0x0fc06810, 0xe92d4770, 0x460545f8, 0x4614468a, 0x6828461e, 0xb10e6807, 0xe0011d38, 0x0008f107,
0xf8d84680, 0x90000000, 0x4628bf00, 0xffe5f7ff, 0xd0fa2800, 0xd9022c1f, 0xe8bd2001, 0x230085f8,
0x46512208, 0xf7ff4668, 0x2318ffbf, 0x46212205, 0xf7ff4668, 0x9800ffb9, 0x0000f8c8, 0xe7ec2000,
0xb1214601, 0xd0042901, 0xd1062902, 0x2000e003, 0x20014770, 0x2002e7fc, 0xf04fe7fa, 0xe7f730ff,
0x68084601, 0x68106802, 0x0001f000, 0x46014770, 0x6810680a, 0xf0226802, 0x60020201, 0x46014770,
0x6810680a, 0xf0426802, 0x60020201, 0xb5704770, 0x460c4605, 0x68066828, 0x4628bf00, 0xff9df7ff,
0xd0fa2800, 0x0001f004, 0x2c02b918, 0x2c20d301, 0x2001d901, 0x2001bd70, 0x0154ebc0, 0x22042313,
0xf7ff4630, 0x2000ff71, 0xe92de7f4, 0xb0824dff, 0x460f4682, 0xf8da4693, 0x68040000, 0x90016860,
0x900068a0, 0x4650bf00, 0xff77f7ff, 0xd0fa2800, 0xf7ff4638, 0x4605ffa5, 0xb9181c68, 0xb0062001,
0x8df0e8bd, 0x2308b13f, 0x46292202, 0xf7ff1d20, 0x2000ff4b, 0x4658e7f3, 0xff92f7ff, 0x98054680,
0xff8ef7ff, 0xf1084606, 0xb1080001, 0xb9081c70, 0xe7e42001, 0x22022308, 0xa8014629, 0xff34f7ff,
0x2202230c, 0xa8014641, 0xff2ef7ff, 0x22022310, 0xa8014631, 0xff28f7ff, 0x2202230c, 0x46684641,
0xff22f7ff, 0x22022310, 0x46684631, 0xff1cf7ff, 0x60609801, 0x60a09800, 0xe7c02000, 0x4604b570,
0x4616460d, 0x46322301, 0x46204629, 0xff2bf7ff, 0xb570bd70, 0x460d4604, 0x23004616, 0x46294632,
0xf7ff4620, 0xbd70ff20, 0x4604b570, 0x6820460d, 0xbf006806, 0xf7ff4620, 0x2800ff10, 0xf5b5d0fa,
0xd3015f80, 0xbd702001, 0x220c2304, 0xf1064629, 0xf7ff0014, 0x2000fee9, 0xb570e7f5, 0x460c4605,
0x68066828, 0x4628bf00, 0xfef7f7ff, 0xd0fa2800, 0x2c10b10c, 0x2001d901, 0x1e61bd70, 0x22042300,
0x0014f106, 0xfed0f7ff, 0xe7f52000, 0x4604b570, 0x6820460d, 0x46206803, 0xff22f7ff, 0xb1164606,
0xf7ff4620, 0x625dff24, 0xf4406818, 0x60183080, 0x4620b116, 0xff23f7ff, 0xb530bd70, 0x68184603,
0x46186804, 0xff0cf7ff, 0xb1154605, 0xf7ff4618, 0x6820ff0e, 0x3080f420, 0xb1156020, 0xf7ff4618,
0xbd30ff0e, 0x680a4601, 0x4a8e6810, 0x22036002, 0x22026042, 0x4a8c6082, 0x22006142, 0xf8c06242,
0xf8c02090, 0xf8c02094, 0xf8c020a8, 0x477020ac, 0x4dffe92d, 0x4616b086, 0xf8dd461d, 0xe9dda054,
0x98068712, 0x68046800, 0x90052000, 0xb10db116, 0xe0002001, 0x46832000, 0x0f00f1b8, 0xb10fd002,
0xe0002001, 0x90042000, 0x0f00f1ba, 0x2001d001, 0x2000e000, 0x20009003, 0x90029001, 0xd9032d08,
0xb00a2001, 0x8df0e8bd, 0xd9012f08, 0xe7f82001, 0x0f04f1ba, 0x2001d901, 0x9816e7f3, 0xd901281f,
0xe7ee2001, 0x0f00f1bb, 0x9804d003, 0x2001b108, 0x2318e7e7, 0xa8052208, 0xf7ff9907, 0xf1bbfe45,
0xd0090f00, 0xf4409805, 0x90050000, 0x23141e69, 0xa8052203, 0xfe38f7ff, 0xb3289804, 0xf4409805,
0x90054000, 0x230c1e79, 0xa8052203, 0xfe2cf7ff, 0x0003f008, 0xf007b968, 0xb9500003, 0x0000f8d8,
0x00a8f8c4, 0xd10f2f08, 0x0004f8d8, 0x00acf8c4, 0x463ae00a, 0xa8014641, 0xf898f000, 0xf8c49801,
0x980200a8, 0x00acf8c4, 0xb1689803, 0xf4409805, 0x90052000, 0xf8c49814, 0xf1aa0094, 0x23100101,
0xa8052202, 0xfe00f7ff, 0x22052307, 0x9916a805, 0xfdfaf7ff, 0xf8449805, 0x68200f90, 0x0001f040,
0x0990f844, 0xf8d4bf00, 0xf3c00090, 0x28000040, 0xf1bbd1f9, 0xd0190f00, 0x0003f006, 0xf005b958,
0xb9400003, 0x00a0f8d4, 0x2d086030, 0xf8d4d10e, 0x607000a4, 0xf8d4e00a, 0x900100a0, 0x00a4f8d4,
0x462a9002, 0x4630a901, 0xf850f000, 0xe7682000, 0xb085b530, 0x460d4604, 0x90012000, 0x90039002,
0x46039004, 0x46294602, 0x46209000, 0xff30f7ff, 0xbd30b005, 0x4df0e92d, 0x4606b086, 0x4614460f,
0xe9dd461d, 0xf8ddab0f, 0xb1048038, 0x2001b91d, 0xe8bdb006, 0x20008df0, 0xe8a1a901, 0x462b0d01,
0x46394622, 0x46309000, 0xff12f7ff, 0xe92de7f0, 0xb0864df0, 0x460f4606, 0x461d4614, 0xab0fe9dd,
0x8038f8dd, 0xb91db104, 0xb0062001, 0x8df0e8bd, 0x461a2300, 0x46304639, 0x0d30e88d, 0xfef8f7ff,
0x0000e7f3, 0x80780081, 0x00101002, 0x0301ea40, 0xd003079b, 0xc908e009, 0xc0081f12, 0xd2fa2a04,
0xf811e003, 0xf8003b01, 0x1e523b01, 0x4770d2f9, 0x52800000, 0x0003ffff, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00800000, 0x00000000, 0x00000000
],
# Function addresses
'pc_init': 0x20000021,
'pc_unInit': 0x20000071,
'pc_program_page': 0x200000db,
'pc_erase_sector': 0x200000b7,
'pc_eraseAll': 0x2000009d,
'static_base' : 0x20000000 + 0x00000020 + 0x00000db8,
'begin_stack' : 0x20001000,
'begin_data' : 0x20000000 + 0x1000,
'page_size' : 0x100,
'analyzer_supported' : False,
'analyzer_address' : 0x00000000,
'page_buffers' : [0x20001000, 0x20001100], # Enable double buffering
'min_program_length' : 0x100,
# Flash information
'flash_start': 0x0,
'flash_size': 0x800000,
'sector_sizes': (
(0x0, 0x10000),
)
}
FLASH_ALGO_EFLASH = {
'load_address' : 0x20000000,
# Flash algorithm as a hex string
'instructions': [
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
0x4604b570, 0x4616460d, 0x44484866, 0xb9986800, 0x44484865, 0x44494965, 0x48656048, 0x60084448,
0x49644608, 0x60084449, 0x49636808, 0xf8dbf000, 0x495c2001, 0x60084449, 0xbd702000, 0xb9414601,
0x44484858, 0x28016800, 0x2000d103, 0x444a4a55, 0x20006010, 0xb5104770, 0x44494956, 0x68082202,
0xf0002100, 0xb108fa2b, 0xbd102001, 0xe7fc2000, 0x4604b510, 0x6020f1a4, 0x4449494b, 0x1e496849,
0x0401ea00, 0x4449494b, 0x68082200, 0xf0004621, 0xb108fa15, 0xbd102001, 0xe7fc2000, 0x43f8e92d,
0x460d4604, 0xf1a44616, 0x493f6020, 0x68494449, 0xea001e49, 0x20040401, 0xea4f9000, 0x27000895,
0x493ce00e, 0x466b4449, 0x68084632, 0xf0004621, 0xb110f94b, 0xe8bd2001, 0x1d3683f8, 0x1c7f1d24,
0xd3ee4547, 0xe7f62000, 0x41fce92d, 0x460f4604, 0xf1a44690, 0x492c6020, 0x68494449, 0xea001e49,
0x20040401, 0x25009001, 0x492ae01a, 0xab014449, 0x6808466a, 0xf0004621, 0x2600f8c1, 0xf81de00c,
0x19a90006, 0x1001f818, 0xd0044288, 0x6020f104, 0xe8bd4428, 0x1c7681fc, 0xd3f02e04, 0x1d2d1d24,
0xd3e242bd, 0xe7f42000, 0x41fce92d, 0x460e4604, 0xf1a44617, 0x49146020, 0x68494449, 0xea001e49,
0x20040401, 0xf04f9001, 0xe0160800, 0x44494911, 0x466aab01, 0x46216808, 0xf890f000, 0xe0072500,
0x0005f81d, 0xd00242b8, 0xe8bd2001, 0x1c6d81fc, 0xd3f52d04, 0xf1081d24, 0x45b00804, 0x2000d3e6,
0x0000e7f3, 0x00000004, 0x0000000c, 0x00000014, 0x00000008, 0x0000001c, 0x02710000, 0x6804b510,
0xb11a6823, 0x041ff001, 0xe002601c, 0x041ff001, 0xbd10605c, 0x4604b510, 0x68096821, 0x5080f501,
0xf9eaf000, 0xb570bd10, 0x460d4604, 0x211f2200, 0xf7ff4620, 0x6821ffe3, 0xf5016809, 0x46295080,
0xf9cef000, 0xf7ff4620, 0x6861ffe5, 0x20016048, 0x70086861, 0xb570bd70, 0x25004604, 0x69a0bf00,
0x001cf000, 0xd0fa1e05, 0x0010f005, 0x4620b140, 0xf9b3f000, 0x69a0bf00, 0x000cf000, 0xd0fa1e05,
0xbd704628, 0x4604b570, 0xbf00460d, 0xf00069a0, 0x28000001, 0x61e5d1fa, 0x61602001, 0xf7ff4620,
0xbd70ffda, 0x4604b5f0, 0x462e460d, 0x0020f104, 0x2a1018c7, 0x2010d901, 0x4610e000, 0x18d04602,
0xd9002810, 0x21001ad2, 0x7838e004, 0x1c7f7030, 0x1c491c76, 0xd3f84291, 0xbdf04610, 0x4dfce92d,
0x460f4604, 0x461d4692, 0x68006820, 0x682e9001, 0x0b00f04f, 0x200046d8, 0x68609000, 0xb9107800,
0xe8bd2001, 0x68288dfc, 0x68614438, 0x42886849, 0x2005d901, 0x9801e7f5, 0xb1086980, 0xe7f02002,
0x68096821, 0x5080f501, 0xf963f000, 0xd0012880, 0xe7e62003, 0x4639e015, 0xf7ff9801, 0x4683ffa3,
0x000ff007, 0x46329000, 0xe9dd4651, 0xf7ff3000, 0x4680ffa9, 0x0608eba6, 0x44c24447, 0xf0009801,
0xb11ef93c, 0x0008f00b, 0xd0e42800, 0x0008f00b, 0x4446b100, 0x1b806828, 0xf00b6028, 0xb1080008,
0xe7be2006, 0xe7bc2000, 0x41f0e92d, 0x460d4604, 0x61e54616, 0x20026226, 0x46206160, 0xff5bf7ff,
0x46384607, 0x81f0e8bd, 0x4df0e92d, 0x460e4605, 0x461c4690, 0xf8d06828, 0xf04fb000, 0x68270a00,
0x78006868, 0x2001b910, 0x8df0e8bd, 0x44306820, 0x68496869, 0xd9014288, 0xe7f52005, 0x0018f8db,
0x2002b108, 0xf006e7f0, 0xb9180003, 0xf0007820, 0xb1080003, 0xe7e72007, 0x4631e00d, 0xf8d84658,
0xf7ff2000, 0x4682ffc1, 0xf1081d36, 0x1f3f0804, 0xf0004658, 0xb11ff8e2, 0x0008f00a, 0xd0ec2800,
0x0008f00a, 0x1d3fb100, 0x1bc06820, 0xf00a6020, 0xb1080008, 0xe7c72006, 0xe7c52000, 0x4ff8e92d,
0x460e4607, 0x461c4692, 0x68056838, 0x90002000, 0x8000f8d4, 0x0b02f04f, 0x78006878, 0x2001b910,
0x8ff8e8bd, 0x44306820, 0x68496879, 0xd9014288, 0xe7f52005, 0xb10869a8, 0xe7f12002, 0x0003f006,
0x7820b918, 0x0003f000, 0x2007b108, 0xe023e7e8, 0xf8da61ee, 0x62280000, 0x61682003, 0x9800e00c,
0x0008f000, 0x6820b140, 0x0008eba0, 0x46286020, 0xf893f000, 0xe7d32006, 0x900069a8, 0x000bea00,
0xd1ec4558, 0x0b06f04f, 0xf10a1d36, 0xf1a80a04, 0x46280804, 0xf881f000, 0x0f00f1b8, 0xbf00d1d8,
0xf00069a8, 0x28000004, 0x6820d0fa, 0x0008eba0, 0x46286020, 0xf871f000, 0xe7b12000, 0x41f0e92d,
0x460e4605, 0x68284617, 0xf04f6804, 0x68680800, 0xb9107800, 0xe8bd2001, 0x69a081f0, 0x2002b108,
0xb127e7f9, 0xd0132f01, 0xd12a2f02, 0x6868e01c, 0x42b06840, 0x2005d201, 0x61e6e7ed, 0x61602004,
0xf7ff4620, 0x4680fe88, 0xf0004620, 0xe01af846, 0x61e02000, 0x61602007, 0xf7ff4620, 0x4680fe7c,
0xf0004620, 0xe00ef83a, 0x1000f44f, 0x200761e0, 0x46206160, 0xfe6ff7ff, 0x46204680, 0xf82df000,
0x2004e001, 0xbf00e7c7, 0x0f08f1b8, 0x2006d101, 0x2000e7c1, 0x4601e7bf, 0x68026808, 0xf3c06990,
0x47701040, 0x4604b510, 0x68096821, 0x5080f501, 0xf826f000, 0xb510bd10, 0x68214604, 0xf5016809,
0xf0005080, 0xbd10f821, 0x4604b510, 0x68096821, 0x5080f501, 0xf81bf000, 0x211fbd10, 0x477060c1,
0x4601460a, 0x600b4b0c, 0x604b4b0c, 0x608b4b0c, 0x46014770, 0x47702080, 0xf44f4601, 0x47701000,
0xf44f4601, 0x47704080, 0x20034601, 0x46014770, 0x6990460a, 0x00004770, 0x11082801, 0x64050208,
0x0a0a0a08, 0x00000000, 0x00000000, 0x52400000, 0x00000000, 0x00400000, 0x00000000, 0x00000000,
0x00000000
],
# Relative function addresses
'pc_init': 0x20000021,
'pc_unInit': 0x2000005d,
'pc_program_page': 0x200000bd,
'pc_erase_sector': 0x20000091,
'pc_eraseAll': 0x20000077,
'static_base' : 0x20000000 + 0x00000020 + 0x000005e4,
'begin_stack' : 0x20000900,
'begin_data' : 0x20000000 + 0x1000,
'page_size' : 0x4000,
'analyzer_supported' : False,
'analyzer_address' : 0x00000000,
'page_buffers' : [0x20001000, 0x20005000], # Enable double buffering
'min_program_length' : 0x4000,
# Flash information
'flash_start': 0xa000000,
'flash_size': 0x400000,
'sector_sizes': (
(0x0, 0x4000),
)
}
class MuscaB1(CoreSightTarget):
VENDOR = "Arm"
memoryMap = MemoryMap(
FlashRegion(name='neflash', start=0x0A000000, length=0x00200000, access='rx',
blocksize=0x4000,
page_size=0x4000,
is_boot_memory=False,
is_default=False,
algo=FLASH_ALGO_EFLASH),
FlashRegion(name='seflash', start=0x1A000000, length=0x00200000, access='rxs',
blocksize=0x4000,
page_size=0x4000,
is_boot_memory=False,
is_default=False,
algo=FLASH_ALGO_EFLASH,
alias='neflash'),
FlashRegion(name='nqspi', start=0x00000000, length=0x00800000, access='rx',
blocksize=0x10000,
page_size=0x10000,
is_boot_memory=True,
is_external=True,
algo=FLASH_ALGO_QSPI),
FlashRegion(name='sqspi', start=0x10000000, length=0x00800000, access='rxs',
blocksize=0x10000,
page_size=0x10000,
is_boot_memory=True,
is_external=True,
algo=FLASH_ALGO_QSPI,
alias='nqspi'),
RamRegion( name='ncoderam', start=0x0A400000, length=0x00080000, access='rwx'),
RamRegion( name='scoderam', start=0x1A400000, length=0x00080000, access='rwxs',
alias='ncoderam'),
# Due to an errata, the first 8 kB of sysram is not accessible to the debugger.
RamRegion( name='nsysram', start=0x20002000, length=0x0007e000, access='rwx'),
RamRegion( name='ssysram', start=0x30002000, length=0x0007e000, access='rwxs',
alias='nsysram'),
)
def __init__(self, link):
super(MuscaB1, self).__init__(link, self.memoryMap)
self._svd_location = SVDFile.from_builtin("Musca_B1.svd")
| 71.731707 | 99 | 0.757517 | 1,747 | 20,587 | 8.879794 | 0.701774 | 0.010314 | 0.007735 | 0.002063 | 0.073229 | 0.073229 | 0.064204 | 0.058918 | 0.058918 | 0.050151 | 0 | 0.558389 | 0.158109 | 20,587 | 286 | 100 | 71.982517 | 0.336661 | 0.04124 | 0 | 0.135458 | 0 | 0 | 0.028305 | 0 | 0 | 0 | 0.682408 | 0 | 0 | 1 | 0.003984 | false | 0 | 0.015936 | 0 | 0.031873 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
bee0ac9d16c1bf381ee61172b646252b558496e3 | 285 | py | Python | home/views.py | RJPM0/vss | 3b625d8c02b25af03954f2feb3820e8ca183b7af | [
"Apache-2.0"
] | null | null | null | home/views.py | RJPM0/vss | 3b625d8c02b25af03954f2feb3820e8ca183b7af | [
"Apache-2.0"
] | 1 | 2021-05-16T16:46:07.000Z | 2021-05-16T16:46:07.000Z | home/views.py | RJPM0/vss | 3b625d8c02b25af03954f2feb3820e8ca183b7af | [
"Apache-2.0"
] | 1 | 2021-05-16T16:37:44.000Z | 2021-05-16T16:37:44.000Z | from django.shortcuts import render
from django.template import RequestContext
from anuncios.models import Curso
#Llamamos al modelo para tenerlo tambiwen conectado la base de datos
# Create your views conection by URL
def home_init(request):
return render(request, "home.html")
| 31.666667 | 68 | 0.807018 | 41 | 285 | 5.585366 | 0.804878 | 0.087336 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14386 | 285 | 8 | 69 | 35.625 | 0.938525 | 0.357895 | 0 | 0 | 0 | 0 | 0.049724 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.6 | 0.2 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 3 |
830dab45cc1474c0733e457581d7d9196a7e9f31 | 2,730 | py | Python | fluentcheck/tests/tests_is/test_collections_is.py | jstoebel/fluentcheck | 9258dab4f46776b5df50528f5028ce2d11a443c5 | [
"MIT"
] | 83 | 2018-05-31T13:21:06.000Z | 2022-03-20T14:27:49.000Z | fluentcheck/tests/tests_is/test_collections_is.py | jstoebel/fluentcheck | 9258dab4f46776b5df50528f5028ce2d11a443c5 | [
"MIT"
] | 20 | 2019-02-10T15:07:44.000Z | 2021-04-02T13:18:52.000Z | fluentcheck/tests/tests_is/test_collections_is.py | jstoebel/fluentcheck | 9258dab4f46776b5df50528f5028ce2d11a443c5 | [
"MIT"
] | 11 | 2019-02-16T21:33:11.000Z | 2022-03-25T03:39:52.000Z | import unittest
from fluentcheck import Is
from fluentcheck.exceptions import CheckError
# noinspection PyStatementEffect
class TestIsCollectionsAssertions(unittest.TestCase):
def test_is_set_pass(self):
obj = set()
self.assertIsInstance(Is(obj).set, Is)
def test_is_set_fail(self):
with self.assertRaises(CheckError):
Is(42).set
def test_is_not_set_pass(self):
self.assertIsInstance(Is(42).not_set, Is)
def test_is_not_set_fail(self):
obj = set()
with self.assertRaises(CheckError):
Is(obj).not_set
def test_is_subset_of_pass(self):
obj = {1, 2, 3}
full_set = {1, 2, 3, 4, 5}
self.assertIsInstance(Is(obj).subset_of(full_set), Is)
def test_is_subset_of_fail(self):
obj = {1, 2, 100}
full_set = {1, 2, 3, 4, 5}
with self.assertRaises(CheckError):
Is(obj).subset_of(full_set)
def test_is_not_subset_of_pass(self):
obj = {1, 2, 3}
full_set = {1, 7}
self.assertIsInstance(Is(obj).not_subset_of(full_set), Is)
def test_is_not_subset_of_fail(self):
obj = {1, 2, 5}
full_set = {1, 2, 3, 4, 5}
with self.assertRaises(CheckError):
Is(obj).not_subset_of(full_set)
def test_is_superset_of_pass(self):
obj = {1, 2, 3, 4, 5}
subset = {1, 2, 3}
self.assertIsInstance(Is(obj).superset_of(subset), Is)
def test_is_superset_of_fail(self):
obj = {1, 2, 3, 4, 5}
subset = {1, 2, 100}
with self.assertRaises(CheckError):
Is(obj).superset_of(subset)
def test_is_not_superset_of_pass(self):
obj = {1, 2, 3, 4, 5}
subset = {1, 100, 3}
self.assertIsInstance(Is(obj).not_superset_of(subset), Is)
def test_is_not_superset_of_fail(self):
obj = {1, 2, 3, 4, 5}
subset = {1, 2, 5}
with self.assertRaises(CheckError):
Is(obj).not_superset_of(subset)
def test_is_intersects_pass(self):
obj = {1, 2, 3, 4, 5}
other_set = {1, 2, 3, 9, 100}
self.assertIsInstance(Is(obj).intersects(other_set), Is)
def test_is_intersects_fail(self):
obj = {1, 2, 3, 4, 5}
other_set = {-1, 100}
with self.assertRaises(CheckError):
Is(obj).intersects(other_set)
def test_is_not_intersects_pass(self):
obj = {1, 2, 3, 4, 5}
other_set = {-1, 100}
self.assertIsInstance(Is(obj).not_intersects(other_set), Is)
def test_is_not_intersects_fail(self):
obj = {1, 2, 3, 4, 5}
other_set = {1, 2, 3, 9, 100}
with self.assertRaises(CheckError):
Is(obj).not_intersects(other_set)
| 30 | 68 | 0.6 | 400 | 2,730 | 3.855 | 0.095 | 0.02594 | 0.093385 | 0.070039 | 0.806096 | 0.664721 | 0.586252 | 0.350843 | 0.289883 | 0.289883 | 0 | 0.0571 | 0.275092 | 2,730 | 90 | 69 | 30.333333 | 0.722082 | 0.010989 | 0 | 0.385714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.242857 | 1 | 0.228571 | false | 0.114286 | 0.042857 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
8310d33237cf5c2521330a7f43bbcd7a582c671f | 512 | py | Python | core/tt/error.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | core/tt/error.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | core/tt/error.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# TTSystem errors
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020, The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
class TTError(Exception):
"""
Base class for TT Errors
"""
class TemporaryTTError(TTError):
"""
TTSystem can raise TemporaryTTError for calls that can be restarted
later
"""
| 25.6 | 72 | 0.384766 | 35 | 512 | 5.628571 | 0.742857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018391 | 0.150391 | 512 | 19 | 73 | 26.947368 | 0.434483 | 0.767578 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
831d25e880103fe8d3338fe77880e3021b7859e3 | 917 | py | Python | app/routes/user_routes.py | Suspir0n/botTelegram | a37c7f06abc807a2f8221e1641e248e8989e3100 | [
"MIT"
] | null | null | null | app/routes/user_routes.py | Suspir0n/botTelegram | a37c7f06abc807a2f8221e1641e248e8989e3100 | [
"MIT"
] | null | null | null | app/routes/user_routes.py | Suspir0n/botTelegram | a37c7f06abc807a2f8221e1641e248e8989e3100 | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify
from ..controllers import user_controller
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
bp_users = Blueprint('users', __name__)
@bp_users.route('/', methods=['GET'])
def root():
return jsonify({'message': 'Hello Wold'})
@bp_users.route('/users', methods=['GET'])
def get_users():
return user_controller.get_users()
@bp_users.route('/users/<uid>', methods=['GET'])
def get_user(uid):
return user_controller.get_user(uid)
@bp_users.route('/users', methods=['POST'])
def post_user():
return user_controller.post_user()
@bp_users.route('/users/<uid>', methods=['DELETE'])
def delete_users(uid):
return user_controller.delete_user(uid)
@bp_users.route('/users/<uid>', methods=['PUT'])
def update_users(uid):
return user_controller.update_user(uid) | 25.472222 | 131 | 0.700109 | 129 | 917 | 4.767442 | 0.302326 | 0.079675 | 0.117073 | 0.138211 | 0.323577 | 0.182114 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107961 | 917 | 36 | 132 | 25.472222 | 0.751834 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.130435 | 0.26087 | 0.652174 | 0.086957 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
832ac4768a21d60e8b26a75989de50f7f69cd029 | 1,137 | py | Python | app/model/corporate_Info.py | G1NTOKI0522/WeChatterBot | 1a5377713fd3d6c7a6bca1c20e8fdcf70e8215f5 | [
"BSD-3-Clause"
] | 1 | 2020-04-03T02:54:18.000Z | 2020-04-03T02:54:18.000Z | app/model/corporate_Info.py | G1NTOKI0522/WeChatterBot | 1a5377713fd3d6c7a6bca1c20e8fdcf70e8215f5 | [
"BSD-3-Clause"
] | 7 | 2020-04-11T13:22:50.000Z | 2020-05-14T00:19:37.000Z | app/model/corporate_Info.py | G1NTOKI0522/WeChatterBot | 1a5377713fd3d6c7a6bca1c20e8fdcf70e8215f5 | [
"BSD-3-Clause"
] | 3 | 2020-04-11T12:09:56.000Z | 2020-12-16T13:26:20.000Z | # coding: utf-8
from sqlalchemy import Column, Integer, String, Sequence
from app.libs.db import db
class Info(db.Model):
id = Column(Integer, Sequence('info_id'), primary_key=True, autoincrement=True)
address = Column(String(100), nullable=False) # 联系地址
area = Column(String(100), nullable=False) # 所属地区
belong_to = Column(String(100), nullable=False) # 所属行业
code = Column(String(20), nullable=False) # 组织机构代码
contacts = Column(String(100), nullable=False) # 联系人
email = Column(String(50), nullable=True) # email
enterprise = Column(String(100), nullable=False) # 企业性质+企业规模
fax = Column(String(55), nullable=False) # 传真
main_business = Column(String(100), nullable=False) # 主营业务
name = Column(String(100), nullable=False) # 企业名称
phone = Column(String(100), nullable=False) # 联系电话
postal_code = Column(String(100), nullable=False) # 邮政编码
user_id = Column(Integer, nullable=False)
@classmethod
def is_exist(cls, user_id):
res = cls.query.filter_by(user_id=user_id).all()
if res:
return True
else:
return False
| 39.206897 | 83 | 0.664028 | 149 | 1,137 | 4.993289 | 0.449664 | 0.193548 | 0.181452 | 0.278226 | 0.33871 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037904 | 0.211082 | 1,137 | 28 | 84 | 40.607143 | 0.791527 | 0.068602 | 0 | 0 | 0 | 0 | 0.006705 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0.083333 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
832d3a12a0d9415b915bf8ece7ba8ae7b917e6e7 | 44 | py | Python | curator/_version.py | uzhinskiy/curator-opensearch | 5bc27874cb6caab67945cf0fe8f8ad9ce6aefbc8 | [
"Apache-2.0"
] | 8 | 2021-11-10T15:15:16.000Z | 2022-03-10T10:09:50.000Z | curator/_version.py | uzhinskiy/curator-opensearch | 5bc27874cb6caab67945cf0fe8f8ad9ce6aefbc8 | [
"Apache-2.0"
] | 1 | 2021-11-18T11:28:44.000Z | 2021-11-21T09:30:54.000Z | curator/_version.py | uzhinskiy/curator-opensearch | 5bc27874cb6caab67945cf0fe8f8ad9ce6aefbc8 | [
"Apache-2.0"
] | 3 | 2022-01-28T18:40:38.000Z | 2022-03-22T18:40:59.000Z | """Curator Version"""
__version__ = '0.0.5'
| 14.666667 | 21 | 0.636364 | 6 | 44 | 4 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 0.113636 | 44 | 2 | 22 | 22 | 0.538462 | 0.340909 | 0 | 0 | 0 | 0 | 0.217391 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
833584b0bd037e4bc290950d14c6d36678cdfe27 | 132 | py | Python | setup.py | tomi77/bizzfuzz | a7b123889fd3833c174b1fda3e0eb8b0617484e8 | [
"MIT"
] | null | null | null | setup.py | tomi77/bizzfuzz | a7b123889fd3833c174b1fda3e0eb8b0617484e8 | [
"MIT"
] | null | null | null | setup.py | tomi77/bizzfuzz | a7b123889fd3833c174b1fda3e0eb8b0617484e8 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name="bizzfuzz",
author="Tomasz Jakub Rup",
author_email="tomasz.rup@gmail.com",
)
| 16.5 | 40 | 0.689394 | 17 | 132 | 5.294118 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181818 | 132 | 7 | 41 | 18.857143 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
833bcd35a2f17d100014cb213fc5d7d3bf9b2de3 | 968 | py | Python | CI-Python-master/qa327_test/backend/test_backend.py | lia-mason/SeetGeek | 7be512c07af6fc42c57360f38db76f87825f3a44 | [
"MIT"
] | null | null | null | CI-Python-master/qa327_test/backend/test_backend.py | lia-mason/SeetGeek | 7be512c07af6fc42c57360f38db76f87825f3a44 | [
"MIT"
] | 6 | 2020-11-19T22:13:59.000Z | 2020-12-17T03:58:03.000Z | CI-Python-master/qa327_test/backend/test_backend.py | lia-mason/SeetGeek | 7be512c07af6fc42c57360f38db76f87825f3a44 | [
"MIT"
] | null | null | null | import pytest
from qa327.models import db, User
from werkzeug.security import generate_password_hash, check_password_hash
from qa327.backend import login_user
from qa327.backend import register_user
from qa327.backend import get_user
from qa327.backend import get_ticket
from qa327.backend import add_ticket
def test_login_user_method():
user = get_user("correct_email")
if not user:
register_user("correct_email", "test_name", "correct_password", "correct_password", 0)
assert login_user("correct_email", "correct_password") == get_user("correct_email")
assert login_user("correct_email", "incorrect_password") == None
assert login_user("unregistered_email", "test_password") == None
def test_get_ticket_method():#maybe test addticket
ticket = get_ticket("Correct Ticket")
if not ticket:
add_ticket("Correct Ticket", "11", "11","20210101")
assert get_ticket(" no") == None #test for incorrect ticket name
| 35.851852 | 94 | 0.752066 | 132 | 968 | 5.242424 | 0.287879 | 0.078035 | 0.115607 | 0.15896 | 0.199422 | 0.083815 | 0 | 0 | 0 | 0 | 0 | 0.037759 | 0.15186 | 968 | 26 | 95 | 37.230769 | 0.805116 | 0.051653 | 0 | 0 | 1 | 0 | 0.23388 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.1 | false | 0.25 | 0.4 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
835e907526f628b1819ff3b49b7d0d95fe00b15b | 525 | py | Python | django/contrib/gis/db/models/__init__.py | fizista/django | 16f3a6a4c7bab11644d11c2be029374e5095cb56 | [
"BSD-3-Clause"
] | 2 | 2016-09-27T09:30:19.000Z | 2016-10-17T01:47:43.000Z | env/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 10 | 2019-12-26T17:31:31.000Z | 2022-03-21T22:17:33.000Z | env/lib/python2.7/site-packages/django/contrib/gis/db/models/__init__.py | luiscarlosgph/nas | e5acee61e8bbf12c34785fe971ce7df8dee775d4 | [
"MIT"
] | 1 | 2020-12-24T01:28:30.000Z | 2020-12-24T01:28:30.000Z | # Want to get everything from the 'normal' models package.
from django.db.models import * # NOQA
# Geographic aggregate functions
from django.contrib.gis.db.models.aggregates import * # NOQA
# The GeoManager
from django.contrib.gis.db.models.manager import GeoManager # NOQA
# The geographic-enabled fields.
from django.contrib.gis.db.models.fields import ( # NOQA
GeometryField, PointField, LineStringField, PolygonField,
MultiPointField, MultiLineStringField, MultiPolygonField,
GeometryCollectionField)
| 35 | 67 | 0.784762 | 60 | 525 | 6.866667 | 0.516667 | 0.097087 | 0.123786 | 0.145631 | 0.203884 | 0.203884 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137143 | 525 | 14 | 68 | 37.5 | 0.909492 | 0.291429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
83676fb25dcd80b7e797c2d83e0220a13de35b45 | 136 | py | Python | src/funky_collections/__init__.py | erinxocon/funky-collections | 719ef32d818df1e3144b54bd1c0540c147f948d6 | [
"MIT"
] | null | null | null | src/funky_collections/__init__.py | erinxocon/funky-collections | 719ef32d818df1e3144b54bd1c0540c147f948d6 | [
"MIT"
] | null | null | null | src/funky_collections/__init__.py | erinxocon/funky-collections | 719ef32d818df1e3144b54bd1c0540c147f948d6 | [
"MIT"
] | null | null | null | from .immutable import ImmutableFixedList, ImmutableList
from .mutable import MutableFixedList, MutableList
__version__ = "0.1.0.dev0"
| 27.2 | 56 | 0.823529 | 15 | 136 | 7.2 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032787 | 0.102941 | 136 | 4 | 57 | 34 | 0.852459 | 0 | 0 | 0 | 0 | 0 | 0.073529 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
55cbf0bced4ab9beb31d4975ed594483f87e72a8 | 20 | py | Python | ABLIRC/bin/ablib/__init__.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:08:20.000Z | 2020-02-25T13:08:20.000Z | ABLIRC/bin/__init__.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:16:03.000Z | 2020-02-25T13:16:03.000Z | ABLIRC/bin/ablib/pipeline/__init__.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | null | null | null | __author__ = 'cheng' | 20 | 20 | 0.75 | 2 | 20 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 20 | 1 | 20 | 20 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
55cf645764b171e0f76241855b4f531e14759067 | 158 | py | Python | github_actions_test/__version__.py | esciara/github_actions_test | e5dc16ef2835893ea48f05ec0661a2594a08ea6c | [
"MIT"
] | null | null | null | github_actions_test/__version__.py | esciara/github_actions_test | e5dc16ef2835893ea48f05ec0661a2594a08ea6c | [
"MIT"
] | 16 | 2020-04-04T22:57:39.000Z | 2020-04-05T19:35:16.000Z | github_actions_test/__version__.py | esciara/github_actions_test | e5dc16ef2835893ea48f05ec0661a2594a08ea6c | [
"MIT"
] | null | null | null | # This file is automatically generated during the release process
# Do not edit manually
"""Version module for github_actions_test."""
__version__ = "0.2.0"
| 26.333333 | 65 | 0.765823 | 23 | 158 | 5 | 0.913043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0.14557 | 158 | 5 | 66 | 31.6 | 0.82963 | 0.791139 | 0 | 0 | 1 | 0 | 0.192308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3615c8cacd580951f55a5edff59b46b217b88e19 | 471 | py | Python | api/admin.py | cmput404-ahyyy/FriendZone2 | 617881b5776100e89a796f687bb084ee853db1a6 | [
"Apache-2.0"
] | null | null | null | api/admin.py | cmput404-ahyyy/FriendZone2 | 617881b5776100e89a796f687bb084ee853db1a6 | [
"Apache-2.0"
] | 7 | 2020-02-11T23:52:31.000Z | 2022-02-10T09:10:58.000Z | api/admin.py | cmput404-ahyyy/FriendZone2 | 617881b5776100e89a796f687bb084ee853db1a6 | [
"Apache-2.0"
] | 1 | 2019-03-26T00:23:02.000Z | 2019-03-26T00:23:02.000Z | from django.contrib import admin
from .models import Author, FriendRequest,Friends,Post, Comment,VisibleToPost,Categories, Following,Node,Image
# Register your models here.
admin.site.register(Author)
admin.site.register(FriendRequest)
admin.site.register(Friends)
admin.site.register(Post)
admin.site.register(Comment)
admin.site.register(VisibleToPost)
admin.site.register(Categories)
admin.site.register(Following)
admin.site.register(Image)
admin.site.register(Node)
| 33.642857 | 110 | 0.832272 | 62 | 471 | 6.322581 | 0.322581 | 0.229592 | 0.433673 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055202 | 471 | 13 | 111 | 36.230769 | 0.880899 | 0.055202 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
362eb5e06dc574265c31d4005d985e7e38591c21 | 50 | py | Python | corere/main/__init__.py | Xarthisius/dataverse-corere | 016b80445c7b226ae7fb44d34daa84399b9acab6 | [
"MIT"
] | 9 | 2019-06-18T20:11:27.000Z | 2021-02-10T19:20:08.000Z | corere/main/__init__.py | Xarthisius/dataverse-corere | 016b80445c7b226ae7fb44d34daa84399b9acab6 | [
"MIT"
] | 9 | 2020-01-10T22:11:56.000Z | 2021-07-28T18:19:53.000Z | corere/main/__init__.py | Xarthisius/dataverse-corere | 016b80445c7b226ae7fb44d34daa84399b9acab6 | [
"MIT"
] | 2 | 2021-09-17T15:48:28.000Z | 2021-10-07T13:32:38.000Z | default_app_config = "corere.main.apps.MainConfig" | 50 | 50 | 0.84 | 7 | 50 | 5.714286 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 50 | 1 | 50 | 50 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.529412 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
363d108183f6395f8b0e5d98815943aed75c5a26 | 4,204 | py | Python | stile/data_handler.py | EiffL/Stile | 9d5bab3ccb47d3fb1b8fc98db3c0e03605ff0169 | [
"BSD-3-Clause"
] | 12 | 2015-09-18T20:31:27.000Z | 2020-04-08T10:58:57.000Z | stile/data_handler.py | EiffL/Stile | 9d5bab3ccb47d3fb1b8fc98db3c0e03605ff0169 | [
"BSD-3-Clause"
] | 71 | 2015-01-05T21:53:04.000Z | 2018-11-05T18:47:27.000Z | stile/data_handler.py | EiffL/Stile | 9d5bab3ccb47d3fb1b8fc98db3c0e03605ff0169 | [
"BSD-3-Clause"
] | 6 | 2017-06-23T21:41:39.000Z | 2020-10-30T14:38:22.000Z | """
data_handler.py: defines the classes that serve data to the various Stile systematics tests in the
default drivers.
"""
import os
import glob
class DataHandler:
"""
.. warning::
The behavior of this class is still under development; we do not suggest using or relying
on ``DataHandler`` instances at this time.
A class which contains information about the data set Stile is to be run on. This is used for
the default drivers, not necessarily the pipeline-specific drivers (such as HSC/LSST).
The class needs to be able to do two things:
* List some data given a set of requirements (:func:`listData`). The
requirements generally follow the form:
* object_types: a list of strings such as ``"star"``, ``"PSF star"``, ``"galaxy"`` or
``"galaxy random"`` describing the objects that are needed for the tests.
* epoch: whether this is a single/summary catalog, or a multiepoch time series. (Coadded
catalogs with no per-epoch information count as a single/summary catalog!)
* extent: ``"CCD"``, ``"field"``, ``"patch"`` or ``"tract"``. This can be ignored if you
don't mind running some extra inappropriate tests! ``"CCD"`` should be a CCD-type
dataset, ``"field"`` a single pointing/field-of-view, ``"patch"`` an intermediate-size
area, and ``"tract"`` a large area. (These terms have specific meanings in the LSST
pipeline, but are used for convenience here.)
* data_format: ``"image"`` or ``"catalog"``. Right now no image-level tests are
implemented but we request this kwarg for future development.
* Take each element of the data list from :func:`DataHandler.listData` and retrieve it for use
(:func:`DataHandler.getData`), optionally with bins defined. (Bins can also be defined on a
test-by-test basis, depending on which format makes the most sense for your data setup.)
Additionally, the class can define a ``.getOutputPath()`` function to place the data in a more
complex system than the default (all in one directory with long output path names).
"""
def __init__(self):
raise NotImplementedError()
def listData(self, object_types, epoch, extent, data_format, required_fields=None):
raise NotImplementedError()
def getData(self, ident, object_types=None, epoch=None, extent=None, data_format=None,
bin_list=None):
"""
Return some data matching the ``ident`` for the given kwargs. This can be a numpy array, a
tuple ``(file_name, field_schema)`` for a file already existing on the filesystem, or a list
of either of those things.
If it's a tuple ``(file_name, field_schema)``, the assumption is that it can be read by a
simple FITS or ASCII reader. The format will be determined from the file extension.
"""
raise NotImplementedError()
def getOutputPath(self, extension='.dat', multi_file=False, *args):
"""
Return a path to an output file given a list of strings that should appear in the output
filename, taking care not to clobber other files (unless requested).
:param args: A list of strings to appear in the file name
:param extension: The file extension to be used
:param multi_file: Whether multiple files with the same args will be created within a single
run of Stile. This appends a number to the file name; if clobbering is
allowed, this argument also prevents Stile from writing over outputs from
the same systematics test during the same run.
:returns: A path to an output file meeting the input specifications.
"""
#TODO: no-clobbering case
sys_test_string = '_'.join(args)
if multi_file:
nfiles = glob.glob(os.path.join(self.output_path, sys_test_string)+'*'+extension)
return os.path.join(self.output_path, sys_test_string+'_'+str(nfiles)+extension)
else:
return os.path.join(self.output_path, sys_test_string+extension)
| 52.55 | 100 | 0.661751 | 587 | 4,204 | 4.683135 | 0.420784 | 0.007275 | 0.010186 | 0.015278 | 0.083303 | 0.083303 | 0.051291 | 0.051291 | 0.051291 | 0.051291 | 0 | 0 | 0.256422 | 4,204 | 79 | 101 | 53.21519 | 0.879399 | 0.74001 | 0 | 0.176471 | 0 | 0 | 0.008363 | 0 | 0 | 0 | 0 | 0.012658 | 0 | 1 | 0.235294 | false | 0 | 0.117647 | 0 | 0.529412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
364ae6bc088f1daab67fa08d5fffadf9c9d8fd7f | 1,914 | py | Python | tests/test_pascals_triangle.py | KATO-Hiro/Somen-Soupy | d9a3f44a3f4ab1a491b8fb2ef151966cce4804b1 | [
"CC0-1.0"
] | 1 | 2021-05-04T01:33:17.000Z | 2021-05-04T01:33:17.000Z | tests/test_pascals_triangle.py | KATO-Hiro/Somen-Soupy | d9a3f44a3f4ab1a491b8fb2ef151966cce4804b1 | [
"CC0-1.0"
] | 113 | 2019-06-08T11:50:10.000Z | 2022-03-24T04:49:55.000Z | tests/test_pascals_triangle.py | KATO-Hiro/Somen-Soupy | d9a3f44a3f4ab1a491b8fb2ef151966cce4804b1 | [
"CC0-1.0"
] | null | null | null | import pytest
from snippets.math.pascals_triangle import calc_pascals_triangle
class TestNAryNumber:
@pytest.mark.parametrize(
("n_max", "expected"),
[
(1, [[1, 0], [1, 1]]),
(2, [[1, 0, 0], [1, 1, 0], [1, 2, 1]]),
(3, [[1, 0, 0, 0], [1, 1, 0, 0], [1, 2, 1, 0], [1, 3, 3, 1]]),
(
4,
[
[1, 0, 0, 0, 0],
[1, 1, 0, 0, 0],
[1, 2, 1, 0, 0],
[1, 3, 3, 1, 0],
[1, 4, 6, 4, 1],
],
),
(
5,
[
[1, 0, 0, 0, 0, 0],
[1, 1, 0, 0, 0, 0],
[1, 2, 1, 0, 0, 0],
[1, 3, 3, 1, 0, 0],
[1, 4, 6, 4, 1, 0],
[1, 5, 10, 10, 5, 1],
],
),
(
6,
[
[1, 0, 0, 0, 0, 0, 0],
[1, 1, 0, 0, 0, 0, 0],
[1, 2, 1, 0, 0, 0, 0],
[1, 3, 3, 1, 0, 0, 0],
[1, 4, 6, 4, 1, 0, 0],
[1, 5, 10, 10, 5, 1, 0],
[1, 6, 15, 20, 15, 6, 1],
],
),
],
)
def test_calc_pascals_triangle(self, n_max, expected):
actual = calc_pascals_triangle(n_max)
assert actual == expected
@pytest.mark.parametrize(
("n", "r", "expected"),
[
(7, 0, 1),
(7, 1, 7),
(7, 2, 21),
(7, 3, 35),
(7, 4, 35),
(7, 5, 21),
(7, 6, 7),
(7, 7, 1),
],
)
def test_access_pascals_triangle(self, n, r, expected):
actual = calc_pascals_triangle(n_max=n)
assert actual[n][r] == expected # nCr
| 28.147059 | 74 | 0.280042 | 234 | 1,914 | 2.217949 | 0.153846 | 0.134875 | 0.115607 | 0.077071 | 0.39499 | 0.38343 | 0.344894 | 0.144509 | 0.109827 | 0.067437 | 0 | 0.206897 | 0.545455 | 1,914 | 67 | 75 | 28.567164 | 0.389655 | 0.001567 | 0 | 0.15873 | 0 | 0 | 0.012048 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 1 | 0.031746 | false | 0 | 0.031746 | 0 | 0.079365 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
368204ea04c7080d4d403fa4c27651121fdf4713 | 3,522 | py | Python | assemblyline/odm/models/service_delta.py | cccs-douglass/assemblyline-base | b5c7cdbfcb02e4d34036a8eee445845c9cbcf132 | [
"MIT"
] | null | null | null | assemblyline/odm/models/service_delta.py | cccs-douglass/assemblyline-base | b5c7cdbfcb02e4d34036a8eee445845c9cbcf132 | [
"MIT"
] | null | null | null | assemblyline/odm/models/service_delta.py | cccs-douglass/assemblyline-base | b5c7cdbfcb02e4d34036a8eee445845c9cbcf132 | [
"MIT"
] | null | null | null | from assemblyline import odm
@odm.model(index=False, store=False)
class EnvironmentVariable(odm.Model):
name = odm.Keyword()
value = odm.Keyword()
@odm.model(index=False, store=False)
class DockerConfigDelta(odm.Model):
allow_internet_access = odm.Optional(odm.Boolean())
command = odm.Optional(odm.List(odm.Keyword()))
cpu_cores = odm.Optional(odm.Float())
environment = odm.Optional(odm.List(odm.Compound(EnvironmentVariable)))
image = odm.Optional(odm.Keyword())
ports = odm.Optional(odm.List(odm.Keyword()))
ram_mb = odm.Optional(odm.Integer())
@odm.model(index=False, store=False)
class UpdateSourceDelta(odm.Model):
headers = odm.Optional(odm.List(odm.Compound(EnvironmentVariable)))
name = odm.Optional(odm.Keyword())
password = odm.Optional(odm.Keyword())
pattern = odm.Optional(odm.Keyword())
private_key = odm.Optional(odm.Keyword())
uri = odm.Optional(odm.Keyword())
username = odm.Optional(odm.Keyword())
default_classification = odm.Optional(odm.Classification())
@odm.model(index=False, store=False)
class PersistentVolumeDelta(odm.Model):
mount_path = odm.Optional(odm.Keyword())
capacity = odm.Optional(odm.Keyword())
storage_class = odm.Optional(odm.Keyword())
@odm.model(index=False, store=False)
class DependencyConfigDelta(odm.Model):
container = odm.Optional(odm.Compound(DockerConfigDelta))
volumes = odm.Mapping(odm.Compound(PersistentVolumeDelta), default={})
@odm.model(index=False, store=False)
class UpdateConfigDelta(odm.Model):
# build_options = odm.Optional(odm.Compound(DockerfileConfigDelta))
generates_signatures = odm.Optional(odm.Boolean(), index=True)
method = odm.Optional(odm.Enum(values=['run', 'build']))
run_options = odm.Optional(odm.Compound(DockerConfigDelta))
sources = odm.Optional(odm.List(odm.Compound(UpdateSourceDelta)))
update_interval_seconds = odm.Optional(odm.Integer())
wait_for_update = odm.Optional(odm.Boolean())
@odm.model(index=False, store=False)
class SubmissionParamsDelta(odm.Model):
default = odm.Optional(odm.Any())
name = odm.Optional(odm.Keyword())
type = odm.Optional(odm.Enum(values=['str', 'int', 'list', 'bool']))
value = odm.Optional(odm.Any())
@odm.model(index=True, store=False)
class ServiceDelta(odm.Model):
accepts = odm.Optional(odm.Keyword(), store=True)
rejects = odm.Optional(odm.Keyword(), store=True)
category = odm.Optional(odm.Keyword(), store=True, copyto="__text__")
config = odm.Optional(odm.Mapping(odm.Any()), index=False)
description = odm.Optional(odm.Text(), store=True, copyto="__text__")
default_result_classification = odm.Optional(odm.ClassificationString())
enabled = odm.Optional(odm.Boolean(), store=True)
is_external = odm.Optional(odm.Boolean())
licence_count = odm.Optional(odm.Integer())
name = odm.Optional(odm.Keyword(), store=True, copyto="__text__")
version = odm.Keyword(store=True)
disable_cache = odm.Optional(odm.Boolean())
stage = odm.Optional(odm.Keyword(), store=True, copyto="__text__")
submission_params = odm.Optional(odm.List(odm.Compound(SubmissionParamsDelta)), index=False)
timeout = odm.Optional(odm.Integer())
docker_config: DockerConfigDelta = odm.Optional(odm.Compound(DockerConfigDelta))
dependencies: DependencyConfigDelta = odm.Mapping(odm.Compound(DependencyConfigDelta), default={})
update_config: UpdateConfigDelta = odm.Optional(odm.Compound(UpdateConfigDelta))
| 38.703297 | 102 | 0.72544 | 424 | 3,522 | 5.933962 | 0.228774 | 0.201113 | 0.255962 | 0.133545 | 0.356121 | 0.254769 | 0.185612 | 0.081876 | 0.034181 | 0 | 0 | 0 | 0.124645 | 3,522 | 90 | 103 | 39.133333 | 0.816088 | 0.018455 | 0 | 0.134328 | 0 | 0 | 0.01563 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.014925 | 0.014925 | 0 | 0.880597 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
368c43418255f90d1d715c7e0598c26769650214 | 132 | py | Python | VideoExample.py | jovil210/lab2_logiciel | 0bc3e9279322c71bfa813a3e9c963d5cd7764b1a | [
"MIT"
] | null | null | null | VideoExample.py | jovil210/lab2_logiciel | 0bc3e9279322c71bfa813a3e9c963d5cd7764b1a | [
"MIT"
] | null | null | null | VideoExample.py | jovil210/lab2_logiciel | 0bc3e9279322c71bfa813a3e9c963d5cd7764b1a | [
"MIT"
] | null | null | null | from Playback.x64.Release import Playback
def main():
Playback.play_video("Example.avi")
if __name__ == "__main__":
main() | 18.857143 | 41 | 0.704545 | 17 | 132 | 4.941176 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018018 | 0.159091 | 132 | 7 | 42 | 18.857143 | 0.738739 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.2 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
369a40b23690fd5dc8eecd1366ebd003911857de | 125 | py | Python | plugins/event_examples/__init__.py | Someguy123/Cardinal | 10cd2f903670d5508a3824a4c8b0a36485ab9ef6 | [
"MIT"
] | null | null | null | plugins/event_examples/__init__.py | Someguy123/Cardinal | 10cd2f903670d5508a3824a4c8b0a36485ab9ef6 | [
"MIT"
] | null | null | null | plugins/event_examples/__init__.py | Someguy123/Cardinal | 10cd2f903670d5508a3824a4c8b0a36485ab9ef6 | [
"MIT"
] | null | null | null | # Plugin author
__author__ = 'John Maguire'
# Plugin homepage
__url__ = 'https://github.com/JohnMaguire2013/Cardinal/'
| 20.833333 | 57 | 0.728 | 13 | 125 | 6.384615 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037736 | 0.152 | 125 | 5 | 58 | 25 | 0.745283 | 0.232 | 0 | 0 | 0 | 0 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
36a5b1824ddf8b3d3464a89a0e3f625c076379c8 | 590 | py | Python | zcrmsdk/src/com/zoho/crm/api/send_mail/__init__.py | zoho/zohocrm-python-sdk-2.1 | cde6fcd1c5c8f7a572154ebb2b947ec697c24209 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/send_mail/__init__.py | zoho/zohocrm-python-sdk-2.1 | cde6fcd1c5c8f7a572154ebb2b947ec697c24209 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/send_mail/__init__.py | zoho/zohocrm-python-sdk-2.1 | cde6fcd1c5c8f7a572154ebb2b947ec697c24209 | [
"Apache-2.0"
] | null | null | null | from .template import Template
from .action_wrapper import ActionWrapper
from .data_subject_request import DataSubjectRequest
from .mail import Mail
from .send_mail_operations import SendMailOperations
from .user_address import UserAddress
from .body_wrapper import BodyWrapper
from .api_exception import APIException
from .action_response import ActionResponse
from .response_handler import ResponseHandler
from .success_response import SuccessResponse
from .inventory_details import InventoryDetails
from .response_wrapper import ResponseWrapper
from .action_handler import ActionHandler
| 39.333333 | 52 | 0.881356 | 70 | 590 | 7.228571 | 0.471429 | 0.059289 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094915 | 590 | 14 | 53 | 42.142857 | 0.947566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
36a713560786f2358dda080e76c19a583f7d7dac | 306 | py | Python | chapter-05/exercise002.py | krastin/pp-cs3.0 | 502be9aac2d84215db176864e443c219e5e26591 | [
"MIT"
] | null | null | null | chapter-05/exercise002.py | krastin/pp-cs3.0 | 502be9aac2d84215db176864e443c219e5e26591 | [
"MIT"
] | null | null | null | chapter-05/exercise002.py | krastin/pp-cs3.0 | 502be9aac2d84215db176864e443c219e5e26591 | [
"MIT"
] | null | null | null | x = False
y = True
# a. Write an expression that produces True iff both variables are True.
print((x and not y) or (y and not x))
# b. Write an expression that produces True iff x is False.
print(not x)
# c. Write an expression that produces True iff at least one of the variables is True.
print(x or y) | 27.818182 | 86 | 0.722222 | 60 | 306 | 3.683333 | 0.433333 | 0.095023 | 0.230769 | 0.285068 | 0.488688 | 0.488688 | 0.488688 | 0 | 0 | 0 | 0 | 0 | 0.20915 | 306 | 11 | 87 | 27.818182 | 0.913223 | 0.696078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.6 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
36b75809bff535e1115b7fa27eb7844eaf38fd9c | 371 | py | Python | src/utils/version.py | mazurwiktor/albion-online-stats | c582677329956026aef9aeeb973718cae646f22b | [
"Apache-2.0",
"MIT"
] | 156 | 2019-09-15T19:56:00.000Z | 2022-03-26T14:36:36.000Z | src/utils/version.py | mazurwiktor/albion-online-stats | c582677329956026aef9aeeb973718cae646f22b | [
"Apache-2.0",
"MIT"
] | 84 | 2019-09-15T20:02:26.000Z | 2022-03-16T21:15:01.000Z | src/utils/version.py | mazurwiktor/albion-online-stats | c582677329956026aef9aeeb973718cae646f22b | [
"Apache-2.0",
"MIT"
] | 60 | 2019-11-15T17:23:21.000Z | 2022-03-17T04:53:04.000Z | import os
import requests
from ..version import version
latest_url = "https://github.com/mazurwiktor/albion-online-stats/releases/latest"
def get_version():
return version
def latest_version():
req = requests.get(latest_url)
if req.status_code == 200:
return os.path.basename(req.url)
return None
def current_version():
return version
| 16.863636 | 81 | 0.716981 | 50 | 371 | 5.2 | 0.54 | 0.069231 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009901 | 0.183288 | 371 | 21 | 82 | 17.666667 | 0.848185 | 0 | 0 | 0.153846 | 0 | 0 | 0.177898 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.230769 | 0.153846 | 0.769231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
36bc41433868afa94a4fffcb916bae4aa378630f | 10,764 | py | Python | pypenelopetools/pencyl/results.py | pymontecarlo/pypenelopetools | ff19e2a9d46726f6044e6e6acbcc02b3abeffff1 | [
"Apache-2.0"
] | 3 | 2020-09-03T14:46:40.000Z | 2021-06-29T07:54:12.000Z | pypenelopetools/pencyl/results.py | pymontecarlo/pypenelopetools | ff19e2a9d46726f6044e6e6acbcc02b3abeffff1 | [
"Apache-2.0"
] | 4 | 2016-12-18T11:30:12.000Z | 2021-12-29T16:31:06.000Z | pypenelopetools/pencyl/results.py | pymontecarlo/pypenelopetools | ff19e2a9d46726f6044e6e6acbcc02b3abeffff1 | [
"Apache-2.0"
] | 1 | 2017-11-29T15:41:36.000Z | 2017-11-29T15:41:36.000Z | """
Results of PENEPMA simulation.
"""
# Standard library modules.
import os
# Third party modules.
from uncertainties import ufloat, unumpy
import numpy as np
import pyxray
# Local modules.
from pypenelopetools.penelope.result import PenelopeResultBase
from pypenelopetools.penelope.enums import KPAR
# Globals and constants variables.
class PencylResult(PenelopeResultBase):
"""
Results from ``pencyl-res.dat``.
.. note::
All results are expressed using the
`uncertainties <https://pythonhosted.org/uncertainties>`_ package.
The nominal value can be accessed with the property ``nominal_value`` or
the abbreviation ``n``, whereas the standard deviation (1-sigma), with
the property ``std_dev`` or ``s``.
For example::
result.simulation_time_s.n #-> 100.0
result.simulation_time_s.s #-> 0.0
Attributes:
simulation_time_s (ufloat):
Simulation time in seconds.
simulation_speed_1_per_s (ufloat):
Simulation speed in simulation per second.
simulated_primary_showers (ufloat):
Number of primary showers simulated.
upbound_primary_particles (ufloat):
Number of primary particles that exited the geometry upwards.
downbound_primary_particles (ufloat):
Number of primary particles that exited the geometry downwards.
absorbed_primary_particles (ufloat):
Number of primary particles that were absorbed within the geometry.
upbound_fraction (ufloat):
Fraction of primary particles that exited the geometry upwards.
downbound_fraction (ufloat):
Fraction of primary particles that exited the geometry downwards.
absorbed_fraction (ufloat):
Fraction of primary particles that were absorbed within the geometry.
upbound_secondary_electron_generation_probabilities (ufloat):
Probability of second generation electrons exited the geometry upwards.
downbound_secondary_electron_generation_probabilities (ufloat):
Probability of second generation electrons exited the geometry downwards.
absorbed_secondary_electron_generation_probabilities (ufloat):
Probability of second generation electrons absorbed within the geometry.
upbound_secondary_photon_generation_probabilities (ufloat):
Probability of second generation photons exited the geometry upwards.
downbound_secondary_photon_generation_probabilities (ufloat):
Probability of second generation photons exited the geometry downwards.
absorbed_secondary_photon_generation_probabilities (ufloat):
Probability of second generation photons absorbed within the geometry.
upbound_secondary_positron_generation_probabilities (ufloat):
Probability of second generation positrons exited the geometry upwards.
downbound_secondary_positron_generation_probabilities (ufloat):
Probability of second generation positrons exited the geometry downwards.
absorbed_secondary_positron_generation_probabilities (ufloat):
Probability of second generation positrons absorbed within the geometry.
average_body_deposited_energy_eV (dict(int, ufloat)):
Average deposited energy in each body.
Dictionary where keys are indexes of body and
values, the average deposited energy in eV.
average_detector_deposited_energy_eV (dict(int, ufloat)):
Average deposited energy in each energy detector.
Dictionary where keys are indexes of energy detector and
values, the average deposited energy in eV.
last_random_seed1 (ufloat):
Last first seed of the random number generator.
last_random_seed2 (ufloat):
Last second seed of the random number generator.
"""
_PARTICLE_LOOKUP = {
"electrons": KPAR.ELECTRON,
"photos": KPAR.PHOTON,
"positrons": KPAR.POSITRON,
}
def __init__(self):
super().__init__()
self.simulation_time_s = ufloat(0.0, 0.0)
self.simulation_speed_1_per_s = ufloat(0.0, 0.0)
self.simulated_primary_showers = ufloat(0.0, 0.0)
self.primary_particle = None
self.upbound_primary_particles = ufloat(0.0, 0.0)
self.downbound_primary_particles = ufloat(0.0, 0.0)
self.absorbed_primary_particles = ufloat(0.0, 0.0)
self.upbound_fraction = ufloat(0.0, 0.0)
self.downbound_fraction = ufloat(0.0, 0.0)
self.absorbed_fraction = ufloat(0.0, 0.0)
self.upbound_secondary_electron_generation_probabilities = ufloat(0.0, 0.0)
self.downbound_secondary_electron_generation_probabilities = ufloat(0.0, 0.0)
self.absorbed_secondary_electron_generation_probabilities = ufloat(0.0, 0.0)
self.upbound_secondary_photon_generation_probabilities = ufloat(0.0, 0.0)
self.downbound_secondary_photon_generation_probabilities = ufloat(0.0, 0.0)
self.absorbed_secondary_photon_generation_probabilities = ufloat(0.0, 0.0)
self.upbound_secondary_positron_generation_probabilities = ufloat(0.0, 0.0)
self.downbound_secondary_positron_generation_probabilities = ufloat(0.0, 0.0)
self.absorbed_secondary_positron_generation_probabilities = ufloat(0.0, 0.0)
self.average_body_deposited_energy_eV = {}
self.average_detector_deposited_energy_eV = {}
self.last_random_seed1 = ufloat(0.0, 0.0)
self.last_random_seed2 = ufloat(0.0, 0.0)
def read(self, fileobj):
line = self._read_until_line_startswith(fileobj, "Simulation time")
(val,) = self._read_all_values(line)
self.simulation_time_s = ufloat(val, 0.0)
line = self._read_until_line_startswith(fileobj, "Simulation speed")
(val,) = self._read_all_values(line)
self.simulation_speed_1_per_s = ufloat(val, 0.0)
line = self._read_until_line_startswith(fileobj, "Simulated primary particles")
(val,) = self._read_all_values(line)
self.simulated_primary_showers = ufloat(val, 0.0)
line = self._read_until_line_startswith(fileobj, "Primary particles")
particle = line.split(":")[1].strip()
self.primary_particle = self._PARTICLE_LOOKUP.get(particle)
line = self._read_until_line_startswith(fileobj, "Upbound primary particles")
(val,) = self._read_all_values(line)
self.upbound_primary_particles = ufloat(val, 0.0)
line = self._read_until_line_startswith(fileobj, "Downbound primary particles")
(val,) = self._read_all_values(line)
self.downbound_primary_particles = ufloat(val, 0.0)
line = self._read_until_line_startswith(fileobj, "Absorbed primary particles")
(val,) = self._read_all_values(line)
self.absorbed_primary_particles = ufloat(val, 0.0)
line = self._read_until_line_startswith(fileobj, "Upbound fraction")
val, unc = self._read_all_values(line)
self.upbound_fraction = ufloat(val, unc / 3)
line = self._read_until_line_startswith(fileobj, "Downbound fraction")
val, unc = self._read_all_values(line)
self.downbound_fraction = ufloat(val, unc / 3)
line = self._read_until_line_startswith(fileobj, "Absorption fraction")
val, unc = self._read_all_values(line)
self.absorbed_fraction = ufloat(val, unc / 3)
self._read_until_line_startswith(
fileobj, "Secondary-particle generation probabilities"
)
fileobj.readline() # skip header
fileobj.readline() # skip header
fileobj.readline() # skip header
val_el, val_ph, val_po = self._read_all_values(fileobj.readline())
unc_el, unc_ph, unc_po = self._read_all_values(fileobj.readline())
self.upbound_secondary_electron_generation_probabilities = ufloat(
val_el, unc_el / 3
)
self.upbound_secondary_photon_generation_probabilities = ufloat(
val_ph, unc_ph / 3
)
self.upbound_secondary_positron_generation_probabilities = ufloat(
val_po, unc_po / 3
)
fileobj.readline() # skip header
val_el, val_ph, val_po = self._read_all_values(fileobj.readline())
unc_el, unc_ph, unc_po = self._read_all_values(fileobj.readline())
self.downbound_secondary_electron_generation_probabilities = ufloat(
val_el, unc_el / 3
)
self.downbound_secondary_photon_generation_probabilities = ufloat(
val_ph, unc_ph / 3
)
self.downbound_secondary_positron_generation_probabilities = ufloat(
val_po, unc_po / 3
)
fileobj.readline() # skip header
val_el, val_ph, val_po = self._read_all_values(fileobj.readline())
unc_el, unc_ph, unc_po = self._read_all_values(fileobj.readline())
self.absorbed_secondary_electron_generation_probabilities = ufloat(
val_el, unc_el / 3
)
self.absorbed_secondary_photon_generation_probabilities = ufloat(
val_ph, unc_ph / 3
)
self.absorbed_secondary_positron_generation_probabilities = ufloat(
val_po, unc_po / 3
)
self.average_body_deposited_energy_eV.clear()
self._read_until_line_startswith(
fileobj, "Average deposited energies (per primary shower)"
)
fileobj.readline() # skip header
line = fileobj.readline().strip()
while line: # until empty line
body = int(line[:4])
val, unc, _effic = self._read_all_values(line)
self.average_body_deposited_energy_eV[body] = ufloat(val, unc / 3)
line = fileobj.readline().strip()
self.average_detector_deposited_energy_eV.clear()
self._read_until_line_startswith(
fileobj, "Average deposited energies (energy detectors)"
)
line = fileobj.readline().strip()
while line: # until empty line
body = int(line[11:13])
val, unc, _effic = self._read_all_values(line)
self.average_detector_deposited_energy_eV[body] = ufloat(val, unc / 3)
line = fileobj.readline().strip()
line = self._read_until_line_startswith(fileobj, "Last random seeds")
seed1, seed2 = map(int, line.split("=")[1].split(","))
self.last_random_seed1 = ufloat(seed1, 0.0)
self.last_random_seed2 = ufloat(seed2, 0.0)
def read_directory(self, dirpath):
filepath = os.path.join(dirpath, "pencyl-res.dat")
with open(filepath, "r") as fp:
self.read(fp)
| 43.578947 | 87 | 0.682553 | 1,280 | 10,764 | 5.450781 | 0.129688 | 0.019779 | 0.017199 | 0.025799 | 0.800201 | 0.775262 | 0.706894 | 0.651713 | 0.584492 | 0.533037 | 0 | 0.016693 | 0.237551 | 10,764 | 246 | 88 | 43.756098 | 0.833435 | 0.329246 | 0 | 0.297101 | 0 | 0 | 0.057521 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.021739 | false | 0 | 0.043478 | 0 | 0.07971 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
36c86a220315c93c4c9f4cb7d2f854e0cffe0c96 | 453 | py | Python | models/user.py | Zelipha/AirBnB_clone | 518894fdf738e722c24dad0d34f831b4bf7ba88d | [
"MIT"
] | null | null | null | models/user.py | Zelipha/AirBnB_clone | 518894fdf738e722c24dad0d34f831b4bf7ba88d | [
"MIT"
] | null | null | null | models/user.py | Zelipha/AirBnB_clone | 518894fdf738e722c24dad0d34f831b4bf7ba88d | [
"MIT"
] | 1 | 2022-02-03T08:31:44.000Z | 2022-02-03T08:31:44.000Z | #!/usr/bin/python3
"""Defines a class User"""
from models.base_model import BaseModel
class User(BaseModel):
"""Represents a class that inherits from BaseModel
Public class attributes:
email: string - empty string
password: string - empty string
first_name: string - empty string
last_name: string - empty string
"""
email = ""
password = ""
first_name = ""
last_name = ""
| 22.65 | 54 | 0.611479 | 50 | 453 | 5.44 | 0.5 | 0.161765 | 0.25 | 0.154412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003135 | 0.295806 | 453 | 19 | 55 | 23.842105 | 0.84953 | 0.556291 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.166667 | 0.166667 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
36cb8400cf534e0821f4560916efa5284d4d4121 | 261 | py | Python | new_test.py | kingsam91/Habari-zote | ab6e41bc37cfa86d319c1fd26e868c32e3712a26 | [
"Unlicense"
] | null | null | null | new_test.py | kingsam91/Habari-zote | ab6e41bc37cfa86d319c1fd26e868c32e3712a26 | [
"Unlicense"
] | null | null | null | new_test.py | kingsam91/Habari-zote | ab6e41bc37cfa86d319c1fd26e868c32e3712a26 | [
"Unlicense"
] | null | null | null | from news import News # Importing the contact class
class TestNews(unittest.TestCase):
'''
Test class that defines test cases for the news class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creating test cases
''' | 26.1 | 75 | 0.712644 | 34 | 261 | 5.470588 | 0.588235 | 0.172043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.229885 | 261 | 10 | 76 | 26.1 | 0.925373 | 0.662835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
36ed9cfc4b31a7c18724ed1f983e2b10eb7d5075 | 1,252 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NVX/linked_gpu_multicast.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NVX/linked_gpu_multicast.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NVX/linked_gpu_multicast.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_NVX_linked_gpu_multicast'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GL,'GL_NVX_linked_gpu_multicast',error_checker=_errors._error_checker)
GL_LGPU_SEPARATE_STORAGE_BIT_NVX=_C('GL_LGPU_SEPARATE_STORAGE_BIT_NVX',0x0800)
GL_MAX_LGPU_GPUS_NVX=_C('GL_MAX_LGPU_GPUS_NVX',0x92BA)
@_f
@_p.types(None,_cs.GLuint,_cs.GLbitfield,_cs.GLuint,_cs.GLenum,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLuint,_cs.GLenum,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLsizei,_cs.GLsizei,_cs.GLsizei)
def glLGPUCopyImageSubDataNVX(sourceGpu,destinationGpuMask,srcName,srcTarget,srcLevel,srcX,srxY,srcZ,dstName,dstTarget,dstLevel,dstX,dstY,dstZ,width,height,depth):pass
@_f
@_p.types(None,)
def glLGPUInterlockNVX():pass
@_f
@_p.types(None,_cs.GLbitfield,_cs.GLuint,_cs.GLintptr,_cs.GLsizeiptr,ctypes.c_void_p)
def glLGPUNamedBufferSubDataNVX(gpuMask,buffer,offset,size,data):pass
| 50.08 | 202 | 0.807508 | 194 | 1,252 | 4.835052 | 0.443299 | 0.059701 | 0.076759 | 0.089552 | 0.38806 | 0.153518 | 0.095949 | 0.095949 | 0.095949 | 0.095949 | 0 | 0.006938 | 0.079073 | 1,252 | 24 | 203 | 52.166667 | 0.806592 | 0.079872 | 0 | 0.15 | 1 | 0 | 0.094558 | 0.076717 | 0 | 0 | 0.010705 | 0 | 0 | 1 | 0.2 | false | 0.15 | 0.3 | 0.05 | 0.55 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
36fa6e34033509672f0242ac85f07054f7acd582 | 538 | py | Python | src/jobsbundle/job/Router.py | daipe-ai/jobs-bundle | f37459c2a7e52a2b9da0f192106a352df4fa777a | [
"MIT"
] | null | null | null | src/jobsbundle/job/Router.py | daipe-ai/jobs-bundle | f37459c2a7e52a2b9da0f192106a352df4fa777a | [
"MIT"
] | null | null | null | src/jobsbundle/job/Router.py | daipe-ai/jobs-bundle | f37459c2a7e52a2b9da0f192106a352df4fa777a | [
"MIT"
] | null | null | null | class Router:
def __init__(
self,
databricks_url: str,
routes: dict,
):
self.__databricks_url = databricks_url
self.__routes = routes
def generate_url(self, route_name: str, **kwargs):
if route_name not in self.__routes:
raise Exception(f"Route not defined: {route_name}")
databricks_url = self.__databricks_url if self.__databricks_url[-1] != "/" else self.__databricks_url[:-1]
return databricks_url + self.__routes[route_name].format(**kwargs)
| 31.647059 | 114 | 0.64684 | 65 | 538 | 4.876923 | 0.384615 | 0.328076 | 0.268139 | 0.14511 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004963 | 0.250929 | 538 | 16 | 115 | 33.625 | 0.781638 | 0 | 0 | 0 | 1 | 0 | 0.05948 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0 | 0 | 0.307692 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
36fc6e8ad2ae01f31c61a039701e70915a3df20e | 673 | py | Python | mercury_ml/tensorflow/model_loading.py | mercury-ml-team/mercury-ml | 8d27816490f0be46f871e889e4635e9223b7044c | [
"MIT"
] | 43 | 2019-02-01T15:22:09.000Z | 2020-02-21T12:51:42.000Z | mercury_ml/tensorflow/model_loading.py | mercury-ml-team/mercury-ml | 8d27816490f0be46f871e889e4635e9223b7044c | [
"MIT"
] | 17 | 2019-02-15T12:52:18.000Z | 2019-05-09T15:42:51.000Z | mercury_ml/tensorflow/model_loading.py | mercury-ml-team/mercury-ml | 8d27816490f0be46f871e889e4635e9223b7044c | [
"MIT"
] | 12 | 2019-02-02T16:48:10.000Z | 2019-12-16T15:40:15.000Z | def load_hdf5_model(local_dir, filename, extension=".h5", custom_objects=None):
"""
Loads a Keras model that was saved in ".h5" format
:param string local_dir: Local directory where the model is saved
:param string filename: Filename with which the model is saved
:param string extension: Extension to the filename with which the model is saved
:param dict custom_objects: Any custom objects (such as custom loss functions) that were included when the model was saved
:return: A Keras model
"""
from tensorflow.keras.models import load_model
return load_model(local_dir + "/" + filename + extension, custom_objects=custom_objects)
| 51.769231 | 127 | 0.744428 | 98 | 673 | 5 | 0.438776 | 0.132653 | 0.061224 | 0.091837 | 0.338776 | 0.216327 | 0.15102 | 0.15102 | 0 | 0 | 0 | 0.005505 | 0.190193 | 673 | 12 | 128 | 56.083333 | 0.893578 | 0.606241 | 0 | 0 | 0 | 0 | 0.017467 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
7fdc82f9f8d61f9dd8a2d66ef5428c46d82a3350 | 359 | py | Python | data/resources_list.py | mavrukin/CIJE_Base | 722d037fd659286c6295c2eea2f447a057315278 | [
"Apache-2.0"
] | null | null | null | data/resources_list.py | mavrukin/CIJE_Base | 722d037fd659286c6295c2eea2f447a057315278 | [
"Apache-2.0"
] | null | null | null | data/resources_list.py | mavrukin/CIJE_Base | 722d037fd659286c6295c2eea2f447a057315278 | [
"Apache-2.0"
] | 5 | 2018-03-05T18:42:31.000Z | 2018-03-18T15:51:31.000Z | from resource import Resource
jewish_resources = [
Resource("Feed Me Now", "restaurant", "123 1st Street, New York, NY - 555-5555", 123.123, -123.123, "stub"),
Resource("Daven Now", "shul", "234 2nd Street, New York, NY - 444-4444", 44.55, 44.55, "stub 2"),
Resource("Buy Now", "store", "345 3rd Street, New York, NY - 666-6666", 23.8, 15, "stub 3")]
| 44.875 | 110 | 0.643454 | 59 | 359 | 3.898305 | 0.627119 | 0.117391 | 0.169565 | 0.195652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200669 | 0.167131 | 359 | 7 | 111 | 51.285714 | 0.568562 | 0 | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 3 |
7fee7e6b122c3520dc258014cd009cc3cbc97453 | 2,698 | py | Python | Python/BowlingGame/test/test_tdd_bowling_game.py | wallezen/learn-tdd | 8705873c2f8d188ee9c98e0e4caf86c285843dc5 | [
"Apache-2.0"
] | null | null | null | Python/BowlingGame/test/test_tdd_bowling_game.py | wallezen/learn-tdd | 8705873c2f8d188ee9c98e0e4caf86c285843dc5 | [
"Apache-2.0"
] | null | null | null | Python/BowlingGame/test/test_tdd_bowling_game.py | wallezen/learn-tdd | 8705873c2f8d188ee9c98e0e4caf86c285843dc5 | [
"Apache-2.0"
] | null | null | null | '''
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
@File: test_tdd_bowling_game.py
@File Created: 2019-06-17 11:30:06
@Author: judezhang (judezhang@tencent.com)
@Last Modified: 2019-06-17 11:30:26
@Modified By: judezhang (judezhang@tencent.com)
@Brief: python -m unittest -v test_tdd_bowling_game.py
'''
'''
- 如果每次投球都没有击倒球瓶,则得分为 0
- 如果每次投球都击倒1个球瓶,则得分为 20
- 如果投球过程中有一局“补中”, 并且紧跟着的1次投球击倒3个球瓶,其他投球都没有击倒球瓶,则得分为 16
- 如果投球过程中有一局“全中”, 并且紧跟着的2次投球分贝击倒3个和4个球瓶,其他投球都没有击倒球瓶,则得分为 24
- 如果投球过程中每局都为“全中”,第10局第二、三次投球也都击倒了10个球瓶,则得分为 300
'''
import unittest
import sys
sys.path.append("../src")
from tdd_bowling_game import BowlingGame
class TestBowlingGame(unittest.TestCase):
def setUp(self):
self.__bowling_game = BowlingGame()
def __run_many(self, cnt, pins):
for i in range(cnt):
self.__bowling_game.roll(pins)
def __roll_spare(self):
self.__bowling_game.roll(5)
self.__bowling_game.roll(5)
def __roll_strike(self):
self.__bowling_game.roll(10)
def test_all_zero(self):
self.__run_many(20, 0)
self.assertEqual(self.__bowling_game.score(), 0)
def test_all_one(self):
self.__run_many(20, 1)
self.assertEqual(self.__bowling_game.score(), 20)
def test_one_spare(self):
self.__roll_spare()
self.__bowling_game.roll(3)
self.__run_many(17, 0)
self.assertEqual(self.__bowling_game.score(), 16)
def test_one_strike(self):
self.__roll_strike()
self.__bowling_game.roll(3)
self.__bowling_game.roll(4)
self.__run_many(16, 0)
self.assertEqual(self.__bowling_game.score(), 24)
def test_all_strike(self):
self.__run_many(10, 10)
self.__bowling_game.roll(10)
self.__bowling_game.roll(10)
self.assertEqual(self.__bowling_game.score(), 300)
def test_other_case(self):
self.__bowling_game.roll(1)
self.__bowling_game.roll(4)
self.__bowling_game.roll(4)
self.__bowling_game.roll(5)
self.__bowling_game.roll(6)
self.__bowling_game.roll(4)
self.__bowling_game.roll(5)
self.__bowling_game.roll(5)
self.__roll_strike()
self.__bowling_game.roll(0)
self.__bowling_game.roll(1)
self.__bowling_game.roll(7)
self.__bowling_game.roll(3)
self.__bowling_game.roll(6)
self.__bowling_game.roll(4)
self.__roll_strike()
self.__bowling_game.roll(2)
self.__bowling_game.roll(8)
self.__bowling_game.roll(6)
self.assertEqual(self.__bowling_game.score(), 133)
if __name__ == "__main__":
unittest.main()
| 25.45283 | 75 | 0.670497 | 367 | 2,698 | 4.485014 | 0.258856 | 0.240583 | 0.300729 | 0.300122 | 0.519441 | 0.439854 | 0.348724 | 0.207776 | 0.207776 | 0.123937 | 0 | 0.05226 | 0.21275 | 2,698 | 105 | 76 | 25.695238 | 0.722693 | 0.12046 | 0 | 0.4 | 0 | 0 | 0.006521 | 0 | 0 | 0 | 0 | 0 | 0.1 | 1 | 0.166667 | false | 0 | 0.05 | 0 | 0.233333 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d0394e85b72d1abb8d9f1baf0f9647381ab9e98 | 27,825 | gyp | Python | cc/cc.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | cc/cc.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | cc/cc.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //cc
'target_name': 'cc',
'type': '<(component)',
'dependencies': [
'cc_proto',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/gpu/gpu.gyp:gpu',
'<(DEPTH)/media/media.gyp:media',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
'<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
'<(DEPTH)/ui/gl/gl.gyp:gl',
],
'variables': {
'optimize': 'max',
},
'export_dependent_settings': [
'<(DEPTH)/skia/skia.gyp:skia',
],
'defines': [
'CC_IMPLEMENTATION=1',
],
'sources': [
# Note: file list duplicated in GN build.
'animation/animation.cc',
'animation/animation.h',
'animation/animation_curve.cc',
'animation/animation_curve.h',
'animation/animation_delegate.h',
'animation/animation_events.cc',
'animation/animation_events.h',
'animation/animation_host.cc',
'animation/animation_host.h',
'animation/animation_id_provider.cc',
'animation/animation_id_provider.h',
'animation/animation_player.cc',
'animation/animation_player.h',
'animation/animation_timeline.cc',
'animation/animation_timeline.h',
'animation/element_animations.cc',
'animation/element_animations.h',
'animation/element_id.cc',
'animation/element_id.h',
'animation/keyframed_animation_curve.cc',
'animation/keyframed_animation_curve.h',
'animation/scroll_offset_animation_curve.cc',
'animation/scroll_offset_animation_curve.h',
'animation/scroll_offset_animations_impl.cc',
'animation/scroll_offset_animations_impl.h',
'animation/scroll_offset_animations.cc',
'animation/scroll_offset_animations.h',
'animation/target_property.cc',
'animation/target_property.h',
'animation/timing_function.cc',
'animation/timing_function.h',
'animation/transform_operation.cc',
'animation/transform_operation.h',
'animation/transform_operations.cc',
'animation/transform_operations.h',
'base/completion_event.h',
'base/container_util.h',
'base/contiguous_container.cc',
'base/contiguous_container.h',
'base/delayed_unique_notifier.cc',
'base/delayed_unique_notifier.h',
'base/histograms.cc',
'base/histograms.h',
'base/invalidation_region.cc',
'base/invalidation_region.h',
'base/list_container.h',
'base/list_container_helper.cc',
'base/list_container_helper.h',
'base/math_util.cc',
'base/math_util.h',
'base/random_access_list_container.h',
'base/region.cc',
'base/region.h',
'base/resource_id.h',
'base/rolling_time_delta_history.cc',
'base/rolling_time_delta_history.h',
'base/rtree.cc',
'base/rtree.h',
'base/simple_enclosed_region.cc',
'base/simple_enclosed_region.h',
'base/switches.cc',
'base/switches.h',
'base/synced_property.h',
'base/tiling_data.cc',
'base/tiling_data.h',
'base/time_util.h',
'base/unique_notifier.cc',
'base/unique_notifier.h',
'blimp/client_picture_cache.h',
'blimp/engine_picture_cache.h',
'blimp/image_serialization_processor.h',
'blimp/picture_data.cc',
'blimp/picture_data.h',
'blimp/picture_data_conversions.cc',
'blimp/picture_data_conversions.h',
'debug/benchmark_instrumentation.cc',
'debug/benchmark_instrumentation.h',
'debug/debug_colors.cc',
'debug/debug_colors.h',
'debug/debug_rect_history.cc',
'debug/debug_rect_history.h',
'debug/devtools_instrumentation.h',
'debug/frame_rate_counter.cc',
'debug/frame_rate_counter.h',
'debug/frame_viewer_instrumentation.cc',
'debug/frame_viewer_instrumentation.h',
'debug/invalidation_benchmark.cc',
'debug/invalidation_benchmark.h',
'debug/lap_timer.cc',
'debug/lap_timer.h',
'debug/layer_tree_debug_state.cc',
'debug/layer_tree_debug_state.h',
'debug/micro_benchmark.cc',
'debug/micro_benchmark.h',
'debug/micro_benchmark_controller.cc',
'debug/micro_benchmark_controller.h',
'debug/micro_benchmark_controller_impl.cc',
'debug/micro_benchmark_controller_impl.h',
'debug/micro_benchmark_impl.cc',
'debug/micro_benchmark_impl.h',
'debug/picture_debug_util.cc',
'debug/picture_debug_util.h',
'debug/rasterize_and_record_benchmark.cc',
'debug/rasterize_and_record_benchmark.h',
'debug/rasterize_and_record_benchmark_impl.cc',
'debug/rasterize_and_record_benchmark_impl.h',
'debug/rendering_stats.cc',
'debug/rendering_stats.h',
'debug/rendering_stats_instrumentation.cc',
'debug/rendering_stats_instrumentation.h',
'debug/ring_buffer.h',
'debug/traced_display_item_list.cc',
'debug/traced_display_item_list.h',
'debug/traced_value.cc',
'debug/traced_value.h',
'debug/unittest_only_benchmark.cc',
'debug/unittest_only_benchmark.h',
'debug/unittest_only_benchmark_impl.cc',
'debug/unittest_only_benchmark_impl.h',
'input/input_handler.cc',
'input/input_handler.h',
'input/layer_selection_bound.cc',
'input/layer_selection_bound.h',
'input/page_scale_animation.cc',
'input/page_scale_animation.h',
'input/scroll_elasticity_helper.cc',
'input/scroll_elasticity_helper.h',
'input/scroll_state.cc',
'input/scroll_state.h',
'input/scroll_state_data.cc',
'input/scroll_state_data.h',
'input/scrollbar_animation_controller.cc',
'input/scrollbar_animation_controller.h',
'input/scrollbar_animation_controller_linear_fade.cc',
'input/scrollbar_animation_controller_linear_fade.h',
'input/scrollbar_animation_controller_thinning.cc',
'input/scrollbar_animation_controller_thinning.h',
'input/selection.h',
'input/top_controls_manager.cc',
'input/top_controls_manager.h',
'input/top_controls_manager_client.h',
'layers/append_quads_data.h',
'layers/content_layer_client.h',
'layers/draw_properties.cc',
'layers/draw_properties.h',
'layers/empty_content_layer_client.cc',
'layers/empty_content_layer_client.h',
'layers/heads_up_display_layer.cc',
'layers/heads_up_display_layer.h',
'layers/heads_up_display_layer_impl.cc',
'layers/heads_up_display_layer_impl.h',
'layers/layer.cc',
'layers/layer_client.h',
'layers/layer_collections.h',
'layers/layer.h',
'layers/layer_impl.cc',
'layers/layer_impl.h',
"layers/layer_impl_test_properties.cc",
"layers/layer_impl_test_properties.h",
'layers/layer_iterator.h',
'layers/layer_list_iterator.cc',
'layers/layer_list_iterator.h',
'layers/layer_position_constraint.cc',
'layers/layer_position_constraint.h',
'layers/layer_proto_converter.cc',
'layers/layer_proto_converter.h',
'layers/layer_utils.cc',
'layers/layer_utils.h',
'layers/nine_patch_layer.cc',
'layers/nine_patch_layer.h',
'layers/nine_patch_layer_impl.cc',
'layers/nine_patch_layer_impl.h',
'layers/paint_properties.h',
'layers/painted_scrollbar_layer.cc',
'layers/painted_scrollbar_layer.h',
'layers/painted_scrollbar_layer_impl.cc',
'layers/painted_scrollbar_layer_impl.h',
'layers/picture_image_layer.cc',
'layers/picture_image_layer.h',
'layers/picture_layer.cc',
'layers/picture_layer.h',
'layers/picture_layer_impl.cc',
'layers/picture_layer_impl.h',
'layers/render_pass_sink.h',
'layers/render_surface_impl.cc',
'layers/render_surface_impl.h',
'layers/scrollbar_layer_impl_base.cc',
'layers/scrollbar_layer_impl_base.h',
'layers/scrollbar_layer_interface.h',
'layers/solid_color_layer.cc',
'layers/solid_color_layer.h',
'layers/solid_color_layer_impl.cc',
'layers/solid_color_layer_impl.h',
'layers/solid_color_scrollbar_layer.cc',
'layers/solid_color_scrollbar_layer.h',
'layers/solid_color_scrollbar_layer_impl.cc',
'layers/solid_color_scrollbar_layer_impl.h',
'layers/surface_layer.cc',
'layers/surface_layer.h',
'layers/surface_layer_impl.cc',
'layers/surface_layer_impl.h',
'layers/texture_layer.cc',
'layers/texture_layer.h',
'layers/texture_layer_client.h',
'layers/texture_layer_impl.cc',
'layers/texture_layer_impl.h',
'layers/ui_resource_layer.cc',
'layers/ui_resource_layer.h',
'layers/ui_resource_layer_impl.cc',
'layers/ui_resource_layer_impl.h',
'layers/video_frame_provider.h',
'layers/video_frame_provider_client_impl.cc',
'layers/video_frame_provider_client_impl.h',
'layers/video_layer.cc',
'layers/video_layer.h',
'layers/video_layer_impl.cc',
'layers/video_layer_impl.h',
'layers/viewport.cc',
'layers/viewport.h',
'output/begin_frame_args.cc',
'output/begin_frame_args.h',
'output/bsp_tree.cc',
'output/bsp_tree.h',
'output/bsp_walk_action.cc',
'output/bsp_walk_action.h',
'output/ca_layer_overlay.cc',
'output/ca_layer_overlay.h',
'output/compositor_frame.cc',
'output/compositor_frame.h',
'output/compositor_frame_ack.cc',
'output/compositor_frame_ack.h',
'output/compositor_frame_metadata.cc',
'output/compositor_frame_metadata.h',
'output/context_provider.h',
'output/copy_output_request.cc',
'output/copy_output_request.h',
'output/copy_output_result.cc',
'output/copy_output_result.h',
'output/delegated_frame_data.cc',
'output/delegated_frame_data.h',
'output/delegating_renderer.cc',
'output/delegating_renderer.h',
'output/direct_renderer.cc',
'output/direct_renderer.h',
'output/dynamic_geometry_binding.cc',
'output/dynamic_geometry_binding.h',
'output/filter_operation.cc',
'output/filter_operation.h',
'output/filter_operations.cc',
'output/filter_operations.h',
'output/geometry_binding.cc',
'output/geometry_binding.h',
'output/gl_frame_data.cc',
'output/gl_frame_data.h',
'output/gl_renderer.cc',
'output/gl_renderer.h',
'output/gl_renderer_draw_cache.cc',
'output/gl_renderer_draw_cache.h',
'output/latency_info_swap_promise.cc',
'output/latency_info_swap_promise.h',
'output/layer_quad.cc',
'output/layer_quad.h',
'output/managed_memory_policy.cc',
'output/managed_memory_policy.h',
'output/output_surface.cc',
'output/output_surface.h',
'output/output_surface_client.h',
'output/overlay_candidate.cc',
'output/overlay_candidate.h',
'output/overlay_candidate_validator.h',
'output/overlay_processor.cc',
'output/overlay_processor.h',
'output/overlay_strategy_single_on_top.cc',
'output/overlay_strategy_single_on_top.h',
'output/overlay_strategy_underlay.cc',
'output/overlay_strategy_underlay.h',
'output/program_binding.cc',
'output/program_binding.h',
'output/render_surface_filters.cc',
'output/render_surface_filters.h',
'output/renderer.cc',
'output/renderer.h',
'output/renderer_capabilities.cc',
'output/renderer_capabilities.h',
'output/renderer_settings.cc',
'output/renderer_settings.h',
'output/shader.cc',
'output/shader.h',
'output/software_output_device.cc',
'output/software_output_device.h',
'output/software_renderer.cc',
'output/software_renderer.h',
'output/static_geometry_binding.cc',
'output/static_geometry_binding.h',
'output/swap_promise.h',
'output/texture_mailbox_deleter.cc',
'output/texture_mailbox_deleter.h',
'output/vulkan_context_provider.h',
'output/vulkan_in_process_context_provider.h',
'output/vulkan_in_process_context_provider.cc',
'playback/clip_display_item.cc',
'playback/clip_display_item.h',
'playback/clip_path_display_item.cc',
'playback/clip_path_display_item.h',
'playback/compositing_display_item.cc',
'playback/compositing_display_item.h',
'playback/decoded_draw_image.cc',
'playback/decoded_draw_image.h',
'playback/discardable_image_map.cc',
'playback/discardable_image_map.h',
'playback/display_item.cc',
'playback/display_item.h',
'playback/display_item_list.cc',
'playback/display_item_list.h',
'playback/display_item_list_settings.cc',
'playback/display_item_list_settings.h',
'playback/display_item_proto_factory.cc',
'playback/display_item_proto_factory.h',
'playback/draw_image.cc',
'playback/draw_image.h',
'playback/drawing_display_item.cc',
'playback/drawing_display_item.h',
'playback/filter_display_item.cc',
'playback/filter_display_item.h',
'playback/float_clip_display_item.cc',
'playback/float_clip_display_item.h',
'playback/image_hijack_canvas.cc',
'playback/image_hijack_canvas.h',
'playback/largest_display_item.cc',
'playback/largest_display_item.h',
'playback/raster_source.cc',
'playback/raster_source.h',
'playback/recording_source.cc',
'playback/recording_source.h',
'playback/skip_image_canvas.cc',
'playback/skip_image_canvas.h',
'playback/transform_display_item.cc',
'playback/transform_display_item.h',
'proto/base_conversions.cc',
'proto/base_conversions.h',
'proto/cc_conversions.cc',
'proto/cc_conversions.h',
'proto/gfx_conversions.cc',
'proto/gfx_conversions.h',
'proto/gpu_conversions.cc',
'proto/gpu_conversions.h',
'proto/skia_conversions.cc',
'proto/skia_conversions.h',
'proto/synced_property_conversions.cc',
'proto/synced_property_conversions.h',
'quads/content_draw_quad_base.cc',
'quads/content_draw_quad_base.h',
'quads/debug_border_draw_quad.cc',
'quads/debug_border_draw_quad.h',
'quads/draw_polygon.cc',
'quads/draw_polygon.h',
'quads/draw_quad.cc',
'quads/draw_quad.h',
'quads/largest_draw_quad.cc',
'quads/largest_draw_quad.h',
'quads/picture_draw_quad.cc',
'quads/picture_draw_quad.h',
'quads/render_pass.cc',
'quads/render_pass.h',
'quads/render_pass_draw_quad.cc',
'quads/render_pass_draw_quad.h',
'quads/render_pass_id.cc',
'quads/render_pass_id.h',
'quads/shared_quad_state.cc',
'quads/shared_quad_state.h',
'quads/solid_color_draw_quad.cc',
'quads/solid_color_draw_quad.h',
'quads/stream_video_draw_quad.cc',
'quads/stream_video_draw_quad.h',
'quads/surface_draw_quad.cc',
'quads/surface_draw_quad.h',
'quads/texture_draw_quad.cc',
'quads/texture_draw_quad.h',
'quads/tile_draw_quad.cc',
'quads/tile_draw_quad.h',
'quads/yuv_video_draw_quad.cc',
'quads/yuv_video_draw_quad.h',
'raster/bitmap_raster_buffer_provider.cc',
'raster/bitmap_raster_buffer_provider.h',
'raster/gpu_raster_buffer_provider.cc',
'raster/gpu_raster_buffer_provider.h',
'raster/one_copy_raster_buffer_provider.cc',
'raster/one_copy_raster_buffer_provider.h',
'raster/raster_buffer.cc',
'raster/raster_buffer.h',
'raster/raster_buffer_provider.cc',
'raster/raster_buffer_provider.h',
'raster/scoped_gpu_raster.cc',
'raster/scoped_gpu_raster.h',
'raster/single_thread_task_graph_runner.cc',
'raster/single_thread_task_graph_runner.h',
'raster/staging_buffer_pool.cc',
'raster/staging_buffer_pool.h',
'raster/synchronous_task_graph_runner.cc',
'raster/synchronous_task_graph_runner.h',
'raster/task.cc',
'raster/task.h',
'raster/task_category.h',
'raster/task_graph_runner.h',
'raster/task_graph_work_queue.cc',
'raster/task_graph_work_queue.h',
'raster/texture_compressor.cc',
'raster/texture_compressor.h',
'raster/texture_compressor_etc1.cc',
'raster/texture_compressor_etc1.h',
'raster/tile_task.cc',
'raster/tile_task.h',
'raster/zero_copy_raster_buffer_provider.cc',
'raster/zero_copy_raster_buffer_provider.h',
'resources/memory_history.cc',
'resources/memory_history.h',
'resources/platform_color.h',
'resources/release_callback.h',
'resources/resource.h',
'resources/resource_format.cc',
'resources/resource_format.h',
'resources/resource_format_utils.cc',
'resources/resource_format_utils.h',
'resources/resource_pool.cc',
'resources/resource_pool.h',
'resources/resource_provider.cc',
'resources/resource_provider.h',
'resources/resource_util.h',
'resources/returned_resource.h',
'resources/scoped_resource.cc',
'resources/scoped_resource.h',
'resources/scoped_ui_resource.cc',
'resources/scoped_ui_resource.h',
'resources/shared_bitmap.cc',
'resources/shared_bitmap.h',
'resources/shared_bitmap_manager.h',
'resources/single_release_callback.cc',
'resources/single_release_callback.h',
'resources/single_release_callback_impl.cc',
'resources/single_release_callback_impl.h',
'resources/texture_mailbox.cc',
'resources/texture_mailbox.h',
'resources/transferable_resource.cc',
'resources/transferable_resource.h',
'resources/ui_resource_bitmap.cc',
'resources/ui_resource_bitmap.h',
'resources/ui_resource_client.h',
'resources/ui_resource_request.cc',
'resources/ui_resource_request.h',
'resources/video_resource_updater.cc',
'resources/video_resource_updater.h',
'scheduler/begin_frame_source.cc',
'scheduler/begin_frame_source.h',
'scheduler/begin_frame_tracker.cc',
'scheduler/begin_frame_tracker.h',
'scheduler/commit_earlyout_reason.cc',
'scheduler/commit_earlyout_reason.h',
'scheduler/compositor_timing_history.cc',
'scheduler/compositor_timing_history.h',
'scheduler/delay_based_time_source.cc',
'scheduler/delay_based_time_source.h',
'scheduler/draw_result.h',
'scheduler/scheduler.cc',
'scheduler/scheduler.h',
'scheduler/scheduler_settings.cc',
'scheduler/scheduler_settings.h',
'scheduler/scheduler_state_machine.cc',
'scheduler/scheduler_state_machine.h',
'scheduler/video_frame_controller.h',
'tiles/eviction_tile_priority_queue.cc',
'tiles/eviction_tile_priority_queue.h',
'tiles/gpu_image_decode_controller.cc',
'tiles/gpu_image_decode_controller.h',
'tiles/image_decode_controller.h',
'tiles/mipmap_util.cc',
'tiles/mipmap_util.h',
'tiles/picture_layer_tiling.cc',
'tiles/picture_layer_tiling.h',
'tiles/picture_layer_tiling_set.cc',
'tiles/picture_layer_tiling_set.h',
'tiles/prioritized_tile.cc',
'tiles/prioritized_tile.h',
'tiles/raster_tile_priority_queue_all.cc',
'tiles/raster_tile_priority_queue_all.h',
'tiles/raster_tile_priority_queue.cc',
'tiles/raster_tile_priority_queue.h',
'tiles/raster_tile_priority_queue_required.cc',
'tiles/raster_tile_priority_queue_required.h',
'tiles/software_image_decode_controller.cc',
'tiles/software_image_decode_controller.h',
'tiles/tile.cc',
'tiles/tile_draw_info.cc',
'tiles/tile_draw_info.h',
'tiles/tile.h',
'tiles/tile_manager.cc',
'tiles/tile_manager.h',
'tiles/tile_priority.cc',
'tiles/tile_priority.h',
'tiles/tile_task_manager.cc',
'tiles/tile_task_manager.h',
'tiles/tiling_set_eviction_queue.cc',
'tiles/tiling_set_eviction_queue.h',
'tiles/tiling_set_raster_queue_all.cc',
'tiles/tiling_set_raster_queue_all.h',
'tiles/tiling_set_raster_queue_required.cc',
'tiles/tiling_set_raster_queue_required.h',
'trees/blocking_task_runner.cc',
'trees/blocking_task_runner.h',
'trees/channel_impl.h',
'trees/channel_main.h',
'trees/compositor_mode.h',
'trees/damage_tracker.cc',
'trees/damage_tracker.h',
'trees/draw_property_utils.cc',
'trees/draw_property_utils.h',
'trees/latency_info_swap_promise_monitor.cc',
'trees/latency_info_swap_promise_monitor.h',
'trees/layer_tree_host.cc',
'trees/layer_tree_host.h',
'trees/layer_tree_host_client.h',
'trees/layer_tree_host_common.cc',
'trees/layer_tree_host_common.h',
'trees/layer_tree_host_impl.cc',
'trees/layer_tree_host_impl.h',
'trees/layer_tree_host_single_thread_client.h',
'trees/layer_tree_impl.cc',
'trees/layer_tree_impl.h',
'trees/layer_tree_settings.cc',
'trees/layer_tree_settings.h',
'trees/mutator_host_client.h',
'trees/occlusion.cc',
'trees/occlusion.h',
'trees/occlusion_tracker.cc',
'trees/occlusion_tracker.h',
'trees/property_tree.cc',
'trees/property_tree.h',
'trees/property_tree_builder.cc',
'trees/property_tree_builder.h',
'trees/proxy.h',
'trees/proxy_common.cc',
'trees/proxy_common.h',
'trees/proxy_impl.cc',
'trees/proxy_impl.h',
'trees/proxy_main.cc',
'trees/proxy_main.h',
'trees/remote_channel_impl.cc',
'trees/remote_channel_impl.h',
'trees/remote_channel_main.cc',
'trees/remote_channel_main.h',
'trees/remote_proto_channel.h',
'trees/scoped_abort_remaining_swap_promises.h',
'trees/single_thread_proxy.cc',
'trees/single_thread_proxy.h',
'trees/swap_promise_monitor.cc',
'trees/swap_promise_monitor.h',
'trees/task_runner_provider.cc',
'trees/task_runner_provider.h',
'trees/threaded_channel.cc',
'trees/threaded_channel.h',
'trees/tree_synchronizer.cc',
'trees/tree_synchronizer.h',
],
'includes': [
'../build/android/increase_size_for_speed.gypi',
],
'conditions': [
['target_arch == "ia32" or target_arch == "x64"', {
'sources': [
'raster/texture_compressor_etc1_sse.cc',
'raster/texture_compressor_etc1_sse.h',
],
}],
],
},
{
# GN version: "//cc/proto"
'target_name': 'cc_proto',
'type': '<(component)',
'sources': [
'proto/begin_main_frame_and_commit_state.proto',
'proto/commit_earlyout_reason.proto',
'proto/compositor_message.proto',
'proto/compositor_message_to_impl.proto',
'proto/compositor_message_to_main.proto',
'proto/display_item.proto',
'proto/element_id.proto',
'proto/layer.proto',
'proto/layer_position_constraint.proto',
'proto/layer_tree_debug_state.proto',
'proto/layer_tree_host.proto',
'proto/layer_tree_settings.proto',
'proto/layer_selection_bound.proto',
'proto/managed_memory_policy.proto',
'proto/memory_allocation.proto',
'proto/point.proto',
'proto/point3f.proto',
'proto/pointf.proto',
'proto/property_tree.proto',
'proto/recording_source.proto',
'proto/rect.proto',
'proto/rectf.proto',
'proto/region.proto',
'proto/renderer_settings.proto',
'proto/scroll_offset.proto',
'proto/size.proto',
'proto/sizef.proto',
'proto/skregion.proto',
'proto/skrrect.proto',
'proto/skxfermode.proto',
'proto/synced_property.proto',
'proto/transform.proto',
'proto/vector2d.proto',
'proto/vector2df.proto',
],
'defines': [
'CC_PROTO_IMPLEMENTATION=1',
],
'variables': {
# Warn if clang creates exit destructors.
'enable_wexit_time_destructors': 1,
'proto_in_dir': 'proto',
'proto_out_dir': 'cc/proto',
'cc_generator_options': 'dllexport_decl=CC_PROTO_EXPORT:',
'cc_include': 'cc/proto/cc_proto_export.h',
},
'includes': [ '../build/protoc.gypi' ]
},
{
# GN version: //cc/surfaces
'target_name': 'cc_surfaces',
'type': '<(component)',
'dependencies': [
'cc',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/gpu/gpu.gyp:gpu',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
],
'defines': [
'CC_SURFACES_IMPLEMENTATION=1',
],
'sources': [
# Note: file list duplicated in GN build.
'surfaces/display.cc',
'surfaces/display.h',
'surfaces/display_client.h',
'surfaces/display_scheduler.cc',
'surfaces/display_scheduler.h',
'surfaces/surface.cc',
'surfaces/surface.h',
'surfaces/surface_aggregator.cc',
'surfaces/surface_aggregator.h',
'surfaces/surface_display_output_surface.cc',
'surfaces/surface_display_output_surface.h',
'surfaces/surface_factory.cc',
'surfaces/surface_factory.h',
'surfaces/surface_factory_client.h',
'surfaces/surface_hittest.cc',
'surfaces/surface_hittest.h',
'surfaces/surface_id.h',
'surfaces/surface_id_allocator.cc',
'surfaces/surface_id_allocator.h',
'surfaces/surface_manager.cc',
'surfaces/surface_manager.h',
'surfaces/surface_resource_holder.cc',
'surfaces/surface_resource_holder.h',
'surfaces/surface_sequence.h',
'surfaces/surfaces_export.h',
],
'includes': [
'../build/android/increase_size_for_speed.gypi',
],
},
],
}
| 38.861732 | 100 | 0.642228 | 3,249 | 27,825 | 5.146814 | 0.114805 | 0.018419 | 0.009329 | 0.011183 | 0.344935 | 0.126959 | 0.040486 | 0.040486 | 0.040486 | 0.029781 | 0 | 0.000931 | 0.228356 | 27,825 | 715 | 101 | 38.916084 | 0.777886 | 0.012471 | 0 | 0.068085 | 0 | 0 | 0.692879 | 0.626001 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.009929 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d1520540194e277b10cc0d120ef64d9a250ef00 | 441 | py | Python | triangles.py | amirh357/Python | 4fa2368cd74223bcae9a1f615de32523ea3be28c | [
"MIT"
] | null | null | null | triangles.py | amirh357/Python | 4fa2368cd74223bcae9a1f615de32523ea3be28c | [
"MIT"
] | null | null | null | triangles.py | amirh357/Python | 4fa2368cd74223bcae9a1f615de32523ea3be28c | [
"MIT"
] | null | null | null | max_size = 10
print(
"(a)" + " " * (max_size) +
"(b)" + " " * (max_size) +
"(c)" + " " * (max_size) +
"(d)" + " " * (max_size)
)
for i in range(1, max_size + 1):
print("*" * i, end = " " * (max_size - i + 3))
print("*" * (max_size - i + 1), end = " " * (i - 1 + 3))
print(" " * (i - 1) + "*" * (max_size - i + 1), end = " " * 3)
print(" " * (max_size - i) + "*" * i)
Print("test was successful")
| 19.173913 | 66 | 0.385488 | 58 | 441 | 2.758621 | 0.310345 | 0.4375 | 0.2 | 0.1625 | 0.275 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037415 | 0.333333 | 441 | 22 | 67 | 20.045455 | 0.506803 | 0 | 0 | 0 | 0 | 0 | 0.100228 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.384615 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d210f72ac74a0555d2bc9670020fd81fef8239f | 9,253 | py | Python | BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.py | changeworld/mu_basecore | 1a883ec85d8d2f49663c76e1a1bc5068333f5508 | [
"BSD-2-Clause"
] | 1 | 2019-03-19T04:11:31.000Z | 2019-03-19T04:11:31.000Z | BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.py | HouQiming/edk2 | ba07eef98ec49068d6453aba2aed73f6e7d7f600 | [
"BSD-2-Clause"
] | null | null | null | BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.py | HouQiming/edk2 | ba07eef98ec49068d6453aba2aed73f6e7d7f600 | [
"BSD-2-Clause"
] | 1 | 2021-11-01T19:33:11.000Z | 2021-11-01T19:33:11.000Z | ## @file
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
from ...basemodel import ini
import re, os
from ...basemodel.message import *
class DECFile(ini.BaseINIFile):
def GetSectionInstance(self, parent, name, isCombined=False):
return DECSection(parent, name, isCombined)
def GetComponents(self):
return self.GetSectionByName('Components')
def GetPackageRootPath(self):
return os.path.dirname(self.GetFilename()).strip()
def GetBaseName(self):
return self.GetDefine("PACKAGE_NAME").strip()
def GetVersion(self):
return self.GetDefine("PACKAGE_VERSION").strip()
def GetSectionObjectsByName(self, name, arch=None):
arr = []
sects = self.GetSectionByName(name)
for sect in sects:
# skip unmatched archtecture content
if not sect.IsArchMatch(arch):
continue
for obj in sect.GetObjects():
arr.append(obj)
return arr
class DECSection(ini.BaseINISection):
def GetSectionINIObject(self, parent):
type = self.GetType()
if type.lower().find('defines') != -1:
return DECDefineSectionObject(self)
if type.lower().find('includes') != -1:
return DECIncludeObject(self)
if type.lower().find('pcd') != -1:
return DECPcdObject(self)
if type.lower() == 'libraryclasses':
return DECLibraryClassObject(self)
if type.lower() == 'guids':
return DECGuidObject(self)
if type.lower() == 'ppis':
return DECPpiObject(self)
if type.lower() == 'protocols':
return DECProtocolObject(self)
return DECSectionObject(self)
def GetType(self):
arr = self._name.split('.')
return arr[0].strip()
def GetArch(self):
arr = self._name.split('.')
if len(arr) == 1:
return 'common'
return arr[1]
def IsArchMatch(self, arch):
if arch is None or self.GetArch() == 'common':
return True
if self.GetArch().lower() != arch.lower():
return False
return True
class DECSectionObject(ini.BaseINISectionObject):
def GetArch(self):
return self.GetParent().GetArch()
class DECDefineSectionObject(DECSectionObject):
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
self._key = None
self._value = None
def Parse(self):
assert (self._start == self._end), 'The object in define section must be in single line'
line = self.GetLineByOffset(self._start).strip()
line = line.split('#')[0]
arr = line.split('=')
if len(arr) != 2:
ErrorMsg('Invalid define section object',
self.GetFilename(),
self.GetParent().GetName()
)
return False
self._key = arr[0].strip()
self._value = arr[1].strip()
return True
def GetKey(self):
return self._key
def GetValue(self):
return self._value
class DECGuidObject(DECSectionObject):
_objs = {}
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
self._name = None
def Parse(self):
line = self.GetLineByOffset(self._start).strip().split('#')[0]
self._name = line.split('=')[0].strip()
self._guid = line.split('=')[1].strip()
objdict = DECGuidObject._objs
if self._name not in objdict.keys():
objdict[self._name] = [self]
else:
objdict[self._name].append(self)
return True
def GetName(self):
return self._name
def GetGuid(self):
return self._guid
def Destroy(self):
objdict = DECGuidObject._objs
objdict[self._name].remove(self)
if len(objdict[self._name]) == 0:
del objdict[self._name]
@staticmethod
def GetObjectDict():
return DECGuidObject._objs
class DECPpiObject(DECSectionObject):
_objs = {}
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
self._name = None
def Parse(self):
line = self.GetLineByOffset(self._start).strip().split('#')[0]
self._name = line.split('=')[0].strip()
self._guid = line.split('=')[1].strip()
objdict = DECPpiObject._objs
if self._name not in objdict.keys():
objdict[self._name] = [self]
else:
objdict[self._name].append(self)
return True
def GetName(self):
return self._name
def GetGuid(self):
return self._guid
def Destroy(self):
objdict = DECPpiObject._objs
objdict[self._name].remove(self)
if len(objdict[self._name]) == 0:
del objdict[self._name]
@staticmethod
def GetObjectDict():
return DECPpiObject._objs
class DECProtocolObject(DECSectionObject):
_objs = {}
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
self._name = None
def Parse(self):
line = self.GetLineByOffset(self._start).strip().split('#')[0]
self._name = line.split('=')[0].strip()
self._guid = line.split('=')[1].strip()
objdict = DECProtocolObject._objs
if self._name not in objdict.keys():
objdict[self._name] = [self]
else:
objdict[self._name].append(self)
return True
def GetName(self):
return self._name
def GetGuid(self):
return self._guid
def Destroy(self):
objdict = DECProtocolObject._objs
objdict[self._name].remove(self)
if len(objdict[self._name]) == 0:
del objdict[self._name]
@staticmethod
def GetObjectDict():
return DECProtocolObject._objs
class DECLibraryClassObject(DECSectionObject):
_objs = {}
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
self.mClassName = None
self.mHeaderFile = None
def Parse(self):
line = self.GetLineByOffset(self._start).strip().split('#')[0]
self.mClassName, self.mHeaderFile = line.split('|')
objdict = DECLibraryClassObject._objs
if self.mClassName not in objdict.keys():
objdict[self.mClassName] = [self]
else:
objdict[self.mClassName].append(self)
return True
def GetClassName(self):
return self.mClassName
def GetName(self):
return self.mClassName
def GetHeaderFile(self):
return self.mHeaderFile
def Destroy(self):
objdict = DECLibraryClassObject._objs
objdict[self.mClassName].remove(self)
if len(objdict[self.mClassName]) == 0:
del objdict[self.mClassName]
@staticmethod
def GetObjectDict():
return DECLibraryClassObject._objs
class DECIncludeObject(DECSectionObject):
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
def GetPath(self):
return self.GetLineByOffset(self._start).split('#')[0].strip()
class DECPcdObject(DECSectionObject):
_objs = {}
def __init__(self, parent):
DECSectionObject.__init__(self, parent)
self.mPcdName = None
self.mPcdDefaultValue = None
self.mPcdDataType = None
self.mPcdToken = None
def Parse(self):
line = self.GetLineByOffset(self._start).strip().split('#')[0]
(self.mPcdName, self.mPcdDefaultValue, self.mPcdDataType, self.mPcdToken) = line.split('|')
objdict = DECPcdObject._objs
if self.mPcdName not in objdict.keys():
objdict[self.mPcdName] = [self]
else:
objdict[self.mPcdName].append(self)
return True
def Destroy(self):
objdict = DECPcdObject._objs
objdict[self.mPcdName].remove(self)
if len(objdict[self.mPcdName]) == 0:
del objdict[self.mPcdName]
def GetPcdType(self):
return self.GetParent().GetType()
def GetPcdName(self):
return self.mPcdName
def GetPcdValue(self):
return self.mPcdDefaultValue
def GetPcdDataType(self):
return self.mPcdDataType
def GetPcdToken(self):
return self.mPcdToken
def GetName(self):
return self.GetPcdName().split('.')[1]
@staticmethod
def GetObjectDict():
return DECPcdObject._objs
| 28.915625 | 100 | 0.588782 | 946 | 9,253 | 5.623679 | 0.192389 | 0.045113 | 0.057895 | 0.022368 | 0.408271 | 0.357707 | 0.330827 | 0.330827 | 0.330827 | 0.306391 | 0 | 0.005568 | 0.301308 | 9,253 | 319 | 101 | 29.00627 | 0.817324 | 0.05555 | 0 | 0.502146 | 0 | 0 | 0.023557 | 0 | 0 | 0 | 0 | 0 | 0.004292 | 1 | 0.223176 | false | 0 | 0.012876 | 0.124464 | 0.519313 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3d2a6f23858740c36008f6f10a0678ca99592846 | 186 | py | Python | src/scene/common.py | Speterius/ray_tracing | 28fe3bd20ba312266e7802d456ab267135ffa28f | [
"MIT"
] | 3 | 2019-08-12T08:54:04.000Z | 2021-04-04T21:07:00.000Z | src/scene/common.py | Speterius/ray_tracing | 28fe3bd20ba312266e7802d456ab267135ffa28f | [
"MIT"
] | 4 | 2019-08-08T14:50:34.000Z | 2021-10-21T08:32:19.000Z | src/scene/common.py | Speterius/ray_tracing | 28fe3bd20ba312266e7802d456ab267135ffa28f | [
"MIT"
] | null | null | null | from typing import Union, List, Tuple
import numpy as np
# Typing aliases:
Vector3D = Union[np.ndarray, list, Tuple[float, float, float]]
Color = Union[List[int], Tuple[int, int, int]]
| 26.571429 | 62 | 0.725806 | 29 | 186 | 4.655172 | 0.517241 | 0.133333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006289 | 0.145161 | 186 | 6 | 63 | 31 | 0.842767 | 0.080645 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.