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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c2a2f10d86c8295de96e4e61b198dff0dbdbee99
| 171
|
py
|
Python
|
sila_cetoni/core/sila/core_service/generated/batteryprovider/batteryprovider_feature.py
|
CETONI-Software/sila_cetoni_core
|
01395abc6e434d66ba2da56c90c81d3ecb805113
|
[
"BSD-3-Clause"
] | 1
|
2022-03-08T13:40:00.000Z
|
2022-03-08T13:40:00.000Z
|
sila_cetoni/core/sila/core_service/generated/batteryprovider/batteryprovider_feature.py
|
CETONI-Software/sila_cetoni_core
|
01395abc6e434d66ba2da56c90c81d3ecb805113
|
[
"BSD-3-Clause"
] | null | null | null |
sila_cetoni/core/sila/core_service/generated/batteryprovider/batteryprovider_feature.py
|
CETONI-Software/sila_cetoni_core
|
01395abc6e434d66ba2da56c90c81d3ecb805113
|
[
"BSD-3-Clause"
] | null | null | null |
from os.path import dirname, join
from sila2.framework import Feature
BatteryProviderFeature = Feature(open(join(dirname(__file__), "BatteryProvider.sila.xml")).read())
| 28.5
| 98
| 0.795322
| 21
| 171
| 6.285714
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00641
| 0.087719
| 171
| 5
| 99
| 34.2
| 0.839744
| 0
| 0
| 0
| 0
| 0
| 0.140351
| 0.140351
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c2a690172b2f4feb4b78c1a1dae1eb7357bf0ccb
| 788
|
py
|
Python
|
Lib/site-packages/django_static_fontawesome/utils.py
|
raghulnarayanasami/python
|
5caa6317458275ef3afbf3e16bef396b0f3c27b9
|
[
"bzip2-1.0.6"
] | null | null | null |
Lib/site-packages/django_static_fontawesome/utils.py
|
raghulnarayanasami/python
|
5caa6317458275ef3afbf3e16bef396b0f3c27b9
|
[
"bzip2-1.0.6"
] | null | null | null |
Lib/site-packages/django_static_fontawesome/utils.py
|
raghulnarayanasami/python
|
5caa6317458275ef3afbf3e16bef396b0f3c27b9
|
[
"bzip2-1.0.6"
] | null | null | null |
import os
import glob
app_root = os.path.dirname(__file__)
brand_icons_folder = os.path.abspath(os.path.join(app_root, "./static/fontawesome/svgs/brands/"))
regular_icons_folder = os.path.abspath(os.path.join(app_root, "./static/fontawesome/svgs/regular/"))
solid_icons_folder = os.path.abspath(os.path.join(app_root, "./static/fontawesome/svgs/solid/"))
def get_solid_icons():
return sorted(["fa-" + os.path.splitext(os.path.basename(x))[0] for x in glob.glob(solid_icons_folder+"/*.svg")])
def get_brand_icons():
return sorted(["fa-" + os.path.splitext(os.path.basename(x))[0] for x in glob.glob(brand_icons_folder+"/*.svg")])
def get_regular_icons():
return sorted(["fa-" + os.path.splitext(os.path.basename(x))[0] for x in glob.glob(regular_icons_folder+"/*.svg")])
| 41.473684
| 119
| 0.725888
| 127
| 788
| 4.299213
| 0.244094
| 0.142857
| 0.071429
| 0.093407
| 0.760073
| 0.686813
| 0.686813
| 0.686813
| 0.686813
| 0.686813
| 0
| 0.004161
| 0.085025
| 788
| 18
| 120
| 43.777778
| 0.753121
| 0
| 0
| 0
| 0
| 0
| 0.160102
| 0.125794
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.166667
| 0.25
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
c2b03f16d000c1e2d81319c21205a09016bd02c2
| 45
|
py
|
Python
|
encrypted_field/__init__.py
|
patowc/django-encrypted-field
|
ffe02eab39a85dc988d1330e673ff7b22c4056b1
|
[
"MIT"
] | null | null | null |
encrypted_field/__init__.py
|
patowc/django-encrypted-field
|
ffe02eab39a85dc988d1330e673ff7b22c4056b1
|
[
"MIT"
] | null | null | null |
encrypted_field/__init__.py
|
patowc/django-encrypted-field
|
ffe02eab39a85dc988d1330e673ff7b22c4056b1
|
[
"MIT"
] | null | null | null |
from .fields import *
__version__ = '1.0.4'
| 11.25
| 21
| 0.666667
| 7
| 45
| 3.714286
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 0.177778
| 45
| 3
| 22
| 15
| 0.621622
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
6c0ca516c84f5a5d10d127561e7d1d826e4b53a2
| 89
|
py
|
Python
|
djaffar/apps.py
|
arnaudrenaud/djaffar
|
068851951729d4a1de0b8beca4fbde510517ac59
|
[
"0BSD"
] | 1
|
2018-05-24T11:09:28.000Z
|
2018-05-24T11:09:28.000Z
|
djaffar/apps.py
|
arnaudrenaud/django-djaffar
|
068851951729d4a1de0b8beca4fbde510517ac59
|
[
"ISC"
] | null | null | null |
djaffar/apps.py
|
arnaudrenaud/django-djaffar
|
068851951729d4a1de0b8beca4fbde510517ac59
|
[
"ISC"
] | null | null | null |
from django.apps import AppConfig
class DjaffarConfig(AppConfig):
name = 'djaffar'
| 14.833333
| 33
| 0.752809
| 10
| 89
| 6.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6c24f3a176a6ad30a1e6edc1825eb30017a38216
| 85
|
py
|
Python
|
casos/apps.py
|
mmzepedab/carpoint
|
89cebeca878fe67b43748652609bd6a3527fd77a
|
[
"MIT"
] | null | null | null |
casos/apps.py
|
mmzepedab/carpoint
|
89cebeca878fe67b43748652609bd6a3527fd77a
|
[
"MIT"
] | 4
|
2021-04-08T21:42:43.000Z
|
2021-06-10T19:55:08.000Z
|
seamges/casos/apps.py
|
jaramosperez/seamges
|
8bb522de5a3b73ffc29572d73de898462f76b644
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class CasosConfig(AppConfig):
name = 'casos'
| 14.166667
| 33
| 0.741176
| 10
| 85
| 6.3
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.176471
| 85
| 5
| 34
| 17
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
6c7cba46f39baf11874356a9ba0cd0370d8930c1
| 483
|
py
|
Python
|
app/config.py
|
Kizito-Alberrt/e-kazi
|
a45da7a309d8d7fad39fac32a3955e9ff6a6366a
|
[
"MIT"
] | null | null | null |
app/config.py
|
Kizito-Alberrt/e-kazi
|
a45da7a309d8d7fad39fac32a3955e9ff6a6366a
|
[
"MIT"
] | null | null | null |
app/config.py
|
Kizito-Alberrt/e-kazi
|
a45da7a309d8d7fad39fac32a3955e9ff6a6366a
|
[
"MIT"
] | null | null | null |
class Config:
'''
General configuration parent class
'''
pass
class ProdConfig(Config):
'''
Production configuration child class
Args:
config:The parent configuration class
with general configuration settings
'''
pass
class DevConfig(Config):
'''
Development configuration child class
Args:
Config:The parent configuration class with General configuration
settings.
'''
DEBUG = True
| 19.32
| 72
| 0.63147
| 44
| 483
| 6.931818
| 0.386364
| 0.196721
| 0.15082
| 0.177049
| 0.603279
| 0.603279
| 0.603279
| 0.603279
| 0.603279
| 0.603279
| 0
| 0
| 0.304348
| 483
| 25
| 73
| 19.32
| 0.907738
| 0.598344
| 0
| 0.333333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.333333
| 0
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
668b863f6231b269ca84176f369614986d58ad46
| 186
|
py
|
Python
|
PnfChartGen/__init__.py
|
kncsolutions/dhelm-pnf-chart-generator
|
86011dadd8451551c802ab45ae4031834dec973c
|
[
"Apache-2.0"
] | 4
|
2019-09-11T08:14:33.000Z
|
2022-02-28T17:51:51.000Z
|
PnfChartGen/__init__.py
|
kncsolutions/dhelm-pnf-chart-generator
|
86011dadd8451551c802ab45ae4031834dec973c
|
[
"Apache-2.0"
] | null | null | null |
PnfChartGen/__init__.py
|
kncsolutions/dhelm-pnf-chart-generator
|
86011dadd8451551c802ab45ae4031834dec973c
|
[
"Apache-2.0"
] | 5
|
2020-05-02T18:33:32.000Z
|
2022-01-17T04:17:57.000Z
|
# -*- coding: utf-8 -*-
"""
**Gen_Pnf_With__int__.py**
- Copyright (c) 2019, KNC Solutions Private Limited.
- License: 'Apache License, Version 2.0'.
- version: 1.0.0
"""
| 26.571429
| 56
| 0.591398
| 25
| 186
| 4.16
| 0.84
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068493
| 0.215054
| 186
| 7
| 57
| 26.571429
| 0.643836
| 0.865591
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
668bb75fe3c432e0f27fe4e3aedbc18bbe9b913c
| 141
|
py
|
Python
|
1401-1500/1426-Counting Elements/1426-Counting Elements.py
|
jiadaizhao/LeetCode
|
4ddea0a532fe7c5d053ffbd6870174ec99fc2d60
|
[
"MIT"
] | 49
|
2018-05-05T02:53:10.000Z
|
2022-03-30T12:08:09.000Z
|
1401-1500/1426-Counting Elements/1426-Counting Elements.py
|
jolly-fellow/LeetCode
|
ab20b3ec137ed05fad1edda1c30db04ab355486f
|
[
"MIT"
] | 11
|
2017-12-15T22:31:44.000Z
|
2020-10-02T12:42:49.000Z
|
1401-1500/1426-Counting Elements/1426-Counting Elements.py
|
jolly-fellow/LeetCode
|
ab20b3ec137ed05fad1edda1c30db04ab355486f
|
[
"MIT"
] | 28
|
2017-12-05T10:56:51.000Z
|
2022-01-26T18:18:27.000Z
|
class Solution:
def countElements(self, arr: List[int]) -> int:
table = set(arr)
return sum(x + 1 in table for x in arr)
| 28.2
| 51
| 0.595745
| 22
| 141
| 3.818182
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01
| 0.29078
| 141
| 4
| 52
| 35.25
| 0.83
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
dd27f92b57e92c5f8a0a27adb4354e81345586eb
| 178
|
py
|
Python
|
sdk2-src/src/cli/src/machinelearningservices/azext_ml/manual/custom/print_error.py
|
DamovisaOrg/azureml-v2-preview
|
9c5ed1003c19f4d5b19dbea4a7c507e101149139
|
[
"MIT"
] | 1
|
2021-09-27T07:54:40.000Z
|
2021-09-27T07:54:40.000Z
|
sdk2-src/src/cli/src/machinelearningservices/azext_ml/manual/custom/print_error.py
|
DamovisaOrg/azureml-v2-preview
|
9c5ed1003c19f4d5b19dbea4a7c507e101149139
|
[
"MIT"
] | null | null | null |
sdk2-src/src/cli/src/machinelearningservices/azext_ml/manual/custom/print_error.py
|
DamovisaOrg/azureml-v2-preview
|
9c5ed1003c19f4d5b19dbea4a7c507e101149139
|
[
"MIT"
] | null | null | null |
from colorama import init, Fore
init()
def print_error_and_exit(text):
print(Fore.RED + text)
exit(1)
def print_warning(text):
print(Fore.LIGHTYELLOW_EX + text)
| 13.692308
| 37
| 0.702247
| 27
| 178
| 4.444444
| 0.592593
| 0.133333
| 0.216667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006944
| 0.191011
| 178
| 12
| 38
| 14.833333
| 0.826389
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0
| 0.428571
| 0.571429
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
dd3bc9a2a0cdfb7b2f23178bfd5fa6fa05e232e3
| 101
|
py
|
Python
|
scripts/mlp/wholebody/croccodyl.py
|
stonneau/multicontact-locomotion-planning
|
a2c5dd35955a44c5a454d114c9dcaf0fec19424f
|
[
"BSD-2-Clause"
] | null | null | null |
scripts/mlp/wholebody/croccodyl.py
|
stonneau/multicontact-locomotion-planning
|
a2c5dd35955a44c5a454d114c9dcaf0fec19424f
|
[
"BSD-2-Clause"
] | null | null | null |
scripts/mlp/wholebody/croccodyl.py
|
stonneau/multicontact-locomotion-planning
|
a2c5dd35955a44c5a454d114c9dcaf0fec19424f
|
[
"BSD-2-Clause"
] | null | null | null |
def generateWholeBodyMotion(cs, cfg, fullBody=None, viewer=None):
raise NotImplemented("TODO")
| 20.2
| 65
| 0.752475
| 11
| 101
| 6.909091
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.128713
| 101
| 4
| 66
| 25.25
| 0.863636
| 0
| 0
| 0
| 1
| 0
| 0.040404
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
dd6a4ee247644028d1e813c01b06d5abdd450483
| 74
|
py
|
Python
|
chocopy-rs/test/original/pa2/strings.py
|
wwylele/chocopy-wwylele
|
ef60c94cc9c2d7c8ac11cf2761b724a717ac36aa
|
[
"MIT"
] | 7
|
2021-08-28T18:20:45.000Z
|
2022-02-01T07:35:59.000Z
|
chocopy-rs/test/original/pa2/strings.py
|
wwylele/chocopy-wwylele
|
ef60c94cc9c2d7c8ac11cf2761b724a717ac36aa
|
[
"MIT"
] | 5
|
2020-03-04T23:49:17.000Z
|
2021-12-09T21:42:55.000Z
|
tests/typecheck/strings.py
|
yangdanny97/chocopy-python-frontend
|
d0fb63fc744771640fa4d06076743f42089899c1
|
[
"MIT"
] | 3
|
2019-11-07T23:54:49.000Z
|
2021-06-21T20:45:54.000Z
|
x:str = "Hello"
y:str = "World"
z:str = ""
z = x + y
z = x[0]
x = y = z
| 8.222222
| 15
| 0.418919
| 17
| 74
| 1.823529
| 0.411765
| 0.129032
| 0.193548
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02
| 0.324324
| 74
| 8
| 16
| 9.25
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0.136986
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
06c4b9da26d78fc0fb602689dcba229209af59a7
| 126
|
py
|
Python
|
py_tdlib/constructors/get_scope_notification_settings.py
|
Mr-TelegramBot/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 24
|
2018-10-05T13:04:30.000Z
|
2020-05-12T08:45:34.000Z
|
py_tdlib/constructors/get_scope_notification_settings.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 3
|
2019-06-26T07:20:20.000Z
|
2021-05-24T13:06:56.000Z
|
py_tdlib/constructors/get_scope_notification_settings.py
|
MrMahdi313/python-tdlib
|
2e2d21a742ebcd439971a32357f2d0abd0ce61eb
|
[
"MIT"
] | 5
|
2018-10-05T14:29:28.000Z
|
2020-08-11T15:04:10.000Z
|
from ..factory import Method
class getScopeNotificationSettings(Method):
scope = None # type: "NotificationSettingsScope"
| 21
| 50
| 0.793651
| 11
| 126
| 9.090909
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.126984
| 126
| 5
| 51
| 25.2
| 0.909091
| 0.261905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
06e8736194e5541036244d6262bf49df98a960af
| 183
|
py
|
Python
|
custom_components/govee_ble/const.py
|
natekspencer/hacs-govee_ble
|
63b3c64634878016e187ef43f8f923c40bd2ccaf
|
[
"MIT"
] | 10
|
2021-04-12T16:59:43.000Z
|
2022-01-24T20:33:54.000Z
|
custom_components/govee_ble/const.py
|
natekspencer/hacs-govee_ble
|
63b3c64634878016e187ef43f8f923c40bd2ccaf
|
[
"MIT"
] | 5
|
2021-04-15T21:52:42.000Z
|
2022-03-29T03:37:23.000Z
|
custom_components/govee_ble/const.py
|
natekspencer/hacs-govee_ble
|
63b3c64634878016e187ef43f8f923c40bd2ccaf
|
[
"MIT"
] | 1
|
2021-07-06T12:20:29.000Z
|
2021-07-06T12:20:29.000Z
|
"""Constants for the Govee BLE HCI monitor sensor integration."""
DOMAIN = "govee_ble"
SCANNER = "scanner"
EVENT_DEVICE_ADDED_TO_REGISTRY = f"{DOMAIN}_device_added_to_registry"
| 30.5
| 70
| 0.770492
| 25
| 183
| 5.28
| 0.68
| 0.121212
| 0.19697
| 0.318182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131148
| 183
| 5
| 71
| 36.6
| 0.830189
| 0.322404
| 0
| 0
| 0
| 0
| 0.433628
| 0.292035
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b0b70421a26ea771d8542ee7b7e7dc5dcdc8f337
| 131
|
py
|
Python
|
spinup/algos/tf1/lsac/lsac.py
|
monoclecat/latent-conditioned-SAC
|
3f5d0642778edc7fe7013850eb6251c729e1545b
|
[
"CNRI-Python"
] | 1
|
2021-11-26T11:38:46.000Z
|
2021-11-26T11:38:46.000Z
|
spinup/algos/tf1/lsac/lsac.py
|
monoclecat/latent-conditioned-SAC
|
3f5d0642778edc7fe7013850eb6251c729e1545b
|
[
"CNRI-Python"
] | null | null | null |
spinup/algos/tf1/lsac/lsac.py
|
monoclecat/latent-conditioned-SAC
|
3f5d0642778edc7fe7013850eb6251c729e1545b
|
[
"CNRI-Python"
] | null | null | null |
def lsac(*args, **kwargs):
print('\n\nUnfortunately, LSAC is not implemented in Tensorflow\n\n')
raise NotImplementedError
| 32.75
| 73
| 0.725191
| 17
| 131
| 5.588235
| 0.823529
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152672
| 131
| 3
| 74
| 43.666667
| 0.855856
| 0
| 0
| 0
| 0
| 0
| 0.458015
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| true
| 0
| 0
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b0ceeff45623ec78174df7fae2d8dfbfee58b7bb
| 66
|
py
|
Python
|
lib/tool_shed/util/basic_util.py
|
rikeshi/galaxy
|
c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a
|
[
"CC-BY-3.0"
] | 1,085
|
2015-02-18T16:14:38.000Z
|
2022-03-30T23:52:07.000Z
|
lib/tool_shed/util/basic_util.py
|
rikeshi/galaxy
|
c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a
|
[
"CC-BY-3.0"
] | 11,253
|
2015-02-18T17:47:32.000Z
|
2022-03-31T21:47:03.000Z
|
lib/tool_shed/util/basic_util.py
|
rikeshi/galaxy
|
c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a
|
[
"CC-BY-3.0"
] | 1,000
|
2015-02-18T16:18:10.000Z
|
2022-03-29T08:22:56.000Z
|
from galaxy.tool_shed.util.basic_util import * # noqa: F401,F403
| 33
| 65
| 0.772727
| 11
| 66
| 4.454545
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.103448
| 0.121212
| 66
| 1
| 66
| 66
| 0.741379
| 0.227273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b0e61bbc606f93fdc147ab096f5b5b8c11de5ed2
| 185
|
py
|
Python
|
openmdao.lib/src/openmdao/lib/datatypes/api.py
|
mjfwest/OpenMDAO-Framework
|
a5521f47ad7686c25b203de74e1c7dff5fd7a52b
|
[
"Apache-2.0"
] | 69
|
2015-01-02T19:10:08.000Z
|
2021-11-14T04:42:28.000Z
|
openmdao.lib/src/openmdao/lib/datatypes/api.py
|
jcchin/OpenMDAO-Framework
|
038e89b06da1c74f00918f4c6fbd8bd365e25657
|
[
"Apache-2.0"
] | 3
|
2015-01-15T23:08:18.000Z
|
2015-03-11T16:57:35.000Z
|
openmdao.lib/src/openmdao/lib/datatypes/api.py
|
jcchin/OpenMDAO-Framework
|
038e89b06da1c74f00918f4c6fbd8bd365e25657
|
[
"Apache-2.0"
] | 31
|
2015-09-16T00:37:35.000Z
|
2022-01-10T06:27:55.000Z
|
"""Pseudo package providing a central place to access all of the
OpenMDAO datatypes in the standard library."""
# Traits that we've modified
from openmdao.main.datatypes.api import *
| 26.428571
| 64
| 0.778378
| 28
| 185
| 5.142857
| 0.892857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151351
| 185
| 6
| 65
| 30.833333
| 0.917197
| 0.718919
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
9fd102bdbb9b53eee9320ed0fffd417bd77510d0
| 653
|
py
|
Python
|
exif/tests/modify_exif_baselines/__init__.py
|
ArgiesDario/exif
|
62082954e9f7596f0911041b33d835e3df76e306
|
[
"MIT"
] | null | null | null |
exif/tests/modify_exif_baselines/__init__.py
|
ArgiesDario/exif
|
62082954e9f7596f0911041b33d835e3df76e306
|
[
"MIT"
] | null | null | null |
exif/tests/modify_exif_baselines/__init__.py
|
ArgiesDario/exif
|
62082954e9f7596f0911041b33d835e3df76e306
|
[
"MIT"
] | null | null | null |
"""Baseline strings for test_modify_exif tests."""
from exif.tests.modify_exif_baselines.modify_ascii_same_len_hex import (
MODIFY_ASCII_SAME_LEN_HEX_BASELINE)
from exif.tests.modify_exif_baselines.modify_ascii_shorter_hex import (
MODIFY_ASCII_SHORTER_HEX_BASELINE)
from exif.tests.modify_exif_baselines.modify_orientation_hex import ROTATED_GRAND_CANYON_HEX
from exif.tests.modify_exif_baselines.modify_rational_hex import MODIFY_RATIONAL_HEX_BASELINE
from exif.tests.modify_exif_baselines.modify_srational_hex import MODIFY_SRATIONAL_HEX_BASELINE
from exif.tests.modify_exif_baselines.modify_user_comment import MODIFY_USER_COMMENT_BASELINE
| 59.363636
| 95
| 0.894334
| 97
| 653
| 5.505155
| 0.237113
| 0.131086
| 0.146067
| 0.213483
| 0.580524
| 0.52809
| 0.52809
| 0.456929
| 0.367041
| 0
| 0
| 0
| 0.061256
| 653
| 10
| 96
| 65.3
| 0.871126
| 0.067381
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.75
| 0
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
9ff7800fd43488fb9535a7aef21cca142fb4a455
| 14,123
|
py
|
Python
|
pyexphys/anthropometry.py
|
dpfens/PyExPhys
|
08483993b81e8c6c8ab76219b245508c5fe82df0
|
[
"MIT"
] | 2
|
2020-04-15T21:57:10.000Z
|
2020-06-22T23:18:28.000Z
|
pyexphys/anthropometry.py
|
dpfens/PyFit
|
08483993b81e8c6c8ab76219b245508c5fe82df0
|
[
"MIT"
] | null | null | null |
pyexphys/anthropometry.py
|
dpfens/PyFit
|
08483993b81e8c6c8ab76219b245508c5fe82df0
|
[
"MIT"
] | 1
|
2020-04-15T22:00:13.000Z
|
2020-04-15T22:00:13.000Z
|
"""
Anthropometry formulas for determining heights of the body and its parts
Winter, David A. Biomechanics and Motor Control of Human Movement. New York, N.Y.: Wiley, 2009. Print.
"""
def height_from_height_eyes(segment_length):
"""
Calculates body height based on the height of the eyes from the ground
args:
segment_length (float): height of the eyes from the ground
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.936
def height_from_height_head(segment_length):
"""
Calculates body height based on the height of the head (up to the bottom of the chin) from the ground
args:
segment_length (float): height of the head (up to the bottom of the chin)
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.870
def height_from_height_shoulders(segment_length):
"""
Calculates body height based on the height of the shoulders from the ground
args:
segment_length (float): height of the shoulders
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.818
def height_from_height_chest(segment_length):
"""
Calculates body height based on the height of the chest (equal to the nipples) from the ground
args:
segment_length (float): height of the chest (equal to the nipples)
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.720
def height_from_height_elbow(segment_length):
"""
Calculates body height based on the height of the elbows from the ground
args:
segment_length (float): height of the elbows
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.630
def height_from_height_wrist(segment_length):
"""
Calculates body height based on the height of the elbows from the ground
args:
segment_length (float): height of the wrists
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.485
def height_from_height_fingertip(segment_length):
"""
Calculates body height based on the height of the fingertips from the ground
args:
segment_length (float): height of the fingertips
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.377
def height_from_height_hips(segment_length):
"""
Calculates body height based on the height of the hips from the ground
args:
segment_length (float): height of the hips
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.530
def height_from_height_buttocks(segment_length):
"""
Calculates body height based on the height of the buttocks from the ground
args:
segment_length (float): height of the buttocks
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.485
def height_from_height_knee(segment_length):
"""
Calculates body height based on the height of the knees from the ground
args:
segment_length (float): height of the knees
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.285
def height_from_height_ankle(segment_length):
"""
Calculates body height based on the height of the ankles from the ground
args:
segment_length (float): height of the ankles
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.039
def height_from_head_length(segment_length):
"""
Calculates body height based on the height of the head
args:
segment_length (float): vertical length of head
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.130
def height_from_shoulder_distance(segment_length):
"""
Calculates body height based on the horizontal distance from the center of the chest to the shoulder
args:
segment_length (float): horizontal distance from the center of the chest to the shoulder
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.129
def height_from_shoulder_width(segment_length):
"""
Calculates body height based on the width of the shoulders
args:
segment_length (float): width of the shoulders
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.259
def height_from_hips_width(segment_length):
"""
Calculates body height based on the horizontal width of the hips
args:
segment_length (float): width of the hips
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.191
def height_from_nipple_width(segment_length):
"""
Calculates body height based on the horizontal distance between nipples
args:
segment_length (float): horizontal distance between nipples
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.174
def height_from_foot_width(segment_length):
"""
Calculates body height based on the foot breadth
args:
segment_length (float): breadth of the foot
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.055
def height_from_foot_length(segment_length):
"""
Calculates body height based on the foot length
args:
segment_length (float): length of foot
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.152
def height_from_humerus_length(segment_length):
"""
Calculates body height based on the humerus (shoulder to elbow) length
args:
segment_length (float): length of humerus (shoulder to end of elbow)
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.186
def height_from_forearm_length(segment_length):
"""
Calculates body height based on the forearm length (elbow to wrist)
args:
segment_length (float): length of forearm
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.146
def height_from_hand_length(segment_length):
"""
Calculates body height based on the hand length (wrist to fingertips)
args:
segment_length (float): length of length of hand
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.108
def height_from_upperbody_length(segment_length):
"""
Calculates body height based on the upper body length (top of head to bottom of torso)
args:
segment_length (float): length of upper body
Returns:
float: total body height
"""
if segment_length <= 0:
raise ValueError('segment_length must be > 0')
return segment_length / 0.520
class Segment(object):
def __init__(self, body_height):
if body_height <= 0:
raise ValueError('body_height must be > 0')
self.body_height = body_height
def height_eyes(self):
"""
Calculates the height of the eyes from the ground based on the body height
Returns:
float: height of the eyes from the ground
"""
return 0.936 * self.body_height
def height_head(self):
"""
Calculates the height of the head (up to the bottom of the chin) from the ground based on the body height
Returns:
float: height of the head (bottom of chin) from the ground
"""
return 0.870 * self.body_height
def height_shoulders(self):
"""
Calculates the height of the shoulders from the ground based on the body height
Returns:
float: height of the shoulders from the ground
"""
return 0.818 * self.body_height
def height_chest(self):
"""
Calculates the height of the chest (equal to the nipples) from the ground based on the body height
Returns:
float: height of the chest (equal to nipples) from the ground
"""
return 0.720 * self.body_height
def height_elbow(self):
"""
Calculates the height of the elbows from the ground based on the body height
Returns:
float: height of the elbow from the ground
"""
return 0.630 * self.body_height
def height_wrist(self):
"""
Calculates the height of the wrists from the ground based on the body height
Returns:
float: height of the wrists from the ground
"""
return 0.485 * self.body_height
def height_fingertip(self):
"""
Calculates the height of the fingertips from the ground based on the body height
Returns:
float: height of the fingertips from the ground
"""
return 0.377 * self.body_height
def height_hips(self):
"""
Calculates the height of the hips from the ground based on the body height
Returns:
float: height of the hips from the ground
"""
return 0.530 * self.body_height
def height_buttocks(self):
"""
Calculates the height of the buttocks from the ground based on the body height
Returns:
float: height of the buttocks from the ground
"""
return 0.485 * self.body_height
def height_knee(self):
"""
Calculates the height of the knees from the ground based on the body height
Returns:
float: height of the knees from the ground
"""
return 0.285 * self.body_height
def height_ankle(self):
"""
Calculates the height of the ankles from the ground based on the body height
Returns:
float: height of theankles from the ground
"""
return 0.039 * self.body_height
def head_height(self):
"""
Calculates the height of the head based on the body height
Returns:
float: vertical height of the head
"""
return 0.130 * self.body_height
def shoulder_distance(self):
"""
Calculates the horizontal distance from the center of the chest to the shoulder based on the body height
Returns:
float: horizontal distance from the center of the chest to the shoulder
"""
return 0.129 * self.body_height
def shoulder_width(self):
"""
Calculates the width of the shoulders based on the body height
Returns:
float: shoulder width
"""
return 0.259 * self.body_height
def hips_width(self):
"""
Calculates the horizontal width of the hips based on the body height
Returns:
float: width of the hips
"""
return 0.191 * self.body_height
def nipple_width(self):
"""
Calculates the horizontal distance between nipples based on the body height
Returns:
float: horizontal distance between nipples
"""
return 0.174 * self.body_height
def foot_width(self):
"""
Calculates the foot breadth based on the body height
Returns:
float: width of the foot
"""
return 0.055 * self.body_height
def foot_length(self):
"""
Calculates the foot length based on the body height
Returns:
float: length of the foot
"""
return 0.152 * self.body_height
def humerus_length(self):
"""
Calculates the humerus (shoulder to elbow) length based on the body height
Returns:
float: length of the humerus
"""
return 0.186 * self.body_height
def forearm_length(self):
"""
Calculates the forearm length (elbow to wrist) based on the body height
Returns:
float: length of the forearm
"""
return 0.146 * self.body_height
def hand_length(self):
"""
Calculates the hand length (wrist to fingertips) based on the body height
Returns:
float: length of the hand
"""
return 0.108 * self.body_height
def upperbody_length(self):
"""
Calculates the upper body length (top of head to bottom of torso) based on the body height
Returns:
float: length of the upper body
"""
return 0.520 * self.body_height
| 26.057196
| 113
| 0.636834
| 1,841
| 14,123
| 4.760999
| 0.060837
| 0.163149
| 0.05773
| 0.038334
| 0.823959
| 0.754022
| 0.698346
| 0.657387
| 0.627838
| 0.578893
| 0
| 0.022785
| 0.29767
| 14,123
| 541
| 114
| 26.10536
| 0.860873
| 0.488636
| 0
| 0.350365
| 0
| 0
| 0.104864
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.328467
| false
| 0
| 0
| 0
| 0.656934
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
b025840bc3b5748d2e6ce762d05578831d3029fd
| 270
|
py
|
Python
|
dl85/__init__.py
|
BynaryCobweb/dl8.5
|
566fd61ecb94fa5a02cf67a901ba889da3c54fe2
|
[
"MIT"
] | 1
|
2022-03-16T10:30:52.000Z
|
2022-03-16T10:30:52.000Z
|
dl85/__init__.py
|
ubc-systopia/pydl8.5-lbguess
|
23a3b84bc632c04b5d5093909ea046f0b7902b48
|
[
"MIT"
] | null | null | null |
dl85/__init__.py
|
ubc-systopia/pydl8.5-lbguess
|
23a3b84bc632c04b5d5093909ea046f0b7902b48
|
[
"MIT"
] | 1
|
2022-01-18T21:12:33.000Z
|
2022-01-18T21:12:33.000Z
|
from .supervised.classifiers.classifier import DL85Classifier
from .predictors.predictor import DL85Predictor
from .unsupervised.clustering import DL85Cluster
from ._version import __version__
__all__ = ['__version__', 'DL85Predictor', 'DL85Classifier', 'DL85Cluster']
| 38.571429
| 75
| 0.833333
| 25
| 270
| 8.48
| 0.56
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.048583
| 0.085185
| 270
| 6
| 76
| 45
| 0.809717
| 0
| 0
| 0
| 0
| 0
| 0.181481
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.8
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c6a2cc2f9de9b75863a0c993498d3e24c5392e60
| 1,829
|
py
|
Python
|
AI/others/FaceRecognition/test.py
|
honchardev/Fun
|
ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc
|
[
"MIT"
] | null | null | null |
AI/others/FaceRecognition/test.py
|
honchardev/Fun
|
ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc
|
[
"MIT"
] | 3
|
2020-03-24T16:26:35.000Z
|
2020-04-15T19:40:41.000Z
|
AI/others/FaceRecognition/test.py
|
honchardev/Fun
|
ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc
|
[
"MIT"
] | null | null | null |
from PIL import Image
import face_recognition
import cv2.data
# image = face_recognition.load_image_file('data/1/1.jpg')
# face_locations = face_recognition.face_locations(image)
# print(face_locations)
# known_image = face_recognition.load_image_file("data/1/1.jpg")
# unknown_image = face_recognition.load_image_file("data/1/3.jpg")
# biden_encoding = face_recognition.face_encodings(known_image)[0]
# unknown_encoding = face_recognition.face_encodings(unknown_image)[0]
# results = face_recognition.compare_faces([biden_encoding], unknown_encoding)
# print(results)
# image = face_recognition.load_image_file("data/1/1.jpg")
# face_locations = face_recognition.face_locations(image)
# print("I found {} face(s) in this photograph.".format(len(face_locations)))
# for face_location in face_locations:
# top, right, bottom, left = face_location
# print("A face is located at pixel location Top: {}, Left: {}, Bottom: {}, Right: {}".format(top, left, bottom,
# right))
# face_image = image[top: bottom, left: right]
# pil_image = Image.fromarray(face_image)
# pil_image.show()
# video_capture = cv2.VideoCapture(0)
# face_locations = []
# while True:
# ret, frame = video_capture.read()
# small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25)
# face_locations = face_recognition.face_locations(small_frame, model="cnn")
# for top, right, bottom, left in face_locations:
# top *= 4
# right *= 4
# bottom *= 4
# left *= 4
# face_image = frame[top:bottom, left:right]
# face_image = cv2.GaussianBlur(face_image, (99, 99), 30)
# frame[top:bottom, left:right] = face_image
# cv2.imshow('Video', frame)
# if cv2.waitKey(1) & 0xFF == ord('q'):
# break
# video_capture.release()
# cv2.destroyAllWindows()
| 38.104167
| 116
| 0.688354
| 248
| 1,829
| 4.850806
| 0.294355
| 0.137157
| 0.078969
| 0.079801
| 0.373234
| 0.313383
| 0.279302
| 0.279302
| 0.189526
| 0.189526
| 0
| 0.025116
| 0.172772
| 1,829
| 47
| 117
| 38.914894
| 0.769993
| 0.920722
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c6bf26e3deb02a38be93e6dd3b3d39158470f97e
| 548
|
py
|
Python
|
tests/test_plugin.py
|
gitter-badger/wepy-1
|
9bc619aeae178ad5d10f658fae2abfd2c7aeb18a
|
[
"MIT"
] | 35
|
2017-08-22T15:39:06.000Z
|
2022-03-20T15:17:52.000Z
|
tests/test_plugin.py
|
gitter-badger/wepy-1
|
9bc619aeae178ad5d10f658fae2abfd2c7aeb18a
|
[
"MIT"
] | 33
|
2017-10-02T22:04:45.000Z
|
2022-03-02T22:19:08.000Z
|
tests/test_plugin.py
|
stxinsite/wepy
|
352d4c1316b20e839aae8824eedd66f0f2d0b456
|
[
"MIT"
] | 17
|
2018-07-14T15:33:30.000Z
|
2022-01-18T16:30:55.000Z
|
"""Testing that the plugin for wepy tests actually works."""
import pytest
fixtures = [
'lj_sanity_test',
]
def test_lj_plugin(
lj_sanity_test,
):
# sanity test to make sure its even on the path
assert lj_sanity_test == "sanity"
@pytest.mark.usefixtures(*fixtures)
class TestPlugin():
def test_fixtures(self):
pass
def test_lj_plugin(self,
lj_sanity_test,
):
# sanity test to make sure its even on the path
assert lj_sanity_test == "sanity"
| 18.896552
| 60
| 0.614964
| 71
| 548
| 4.535211
| 0.422535
| 0.217391
| 0.186335
| 0.223602
| 0.447205
| 0.447205
| 0.447205
| 0.447205
| 0.447205
| 0.447205
| 0
| 0
| 0.304745
| 548
| 28
| 61
| 19.571429
| 0.845144
| 0.268248
| 0
| 0.375
| 0
| 0
| 0.066158
| 0
| 0
| 0
| 0
| 0
| 0.125
| 1
| 0.1875
| false
| 0.0625
| 0.0625
| 0
| 0.3125
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
c6cc927836f1574a6ef5dcf386b934e470de27dc
| 802
|
py
|
Python
|
ImageProcessing.py
|
merlzbert/SkinScan
|
684129c20b671db0a338ab832fa512c095f0cb60
|
[
"MIT"
] | 9
|
2021-07-23T07:57:39.000Z
|
2022-02-18T17:43:24.000Z
|
GhostScan/ImageProcessing.py
|
clkimsdu/GhostScan
|
5694df4532132be5e916bd72a46dc907eb108bf9
|
[
"MIT"
] | null | null | null |
GhostScan/ImageProcessing.py
|
clkimsdu/GhostScan
|
5694df4532132be5e916bd72a46dc907eb108bf9
|
[
"MIT"
] | 5
|
2021-04-08T14:40:42.000Z
|
2022-02-18T17:41:49.000Z
|
from abc import abstractmethod
class ImageProcessing:
def __init__(self, capture_path):
# Path to first dataset
self.path = capture_path
@abstractmethod
def loadData(self):
# To override: Load captured data
pass
@abstractmethod
def computePhaseMaps(self):
# To override: If applicable
pass
@abstractmethod
def computeNormalMap(self, exposure):
# To override: Compute normals
pass
@abstractmethod
def computeDepthMap(self, exposure):
# To override: Compute normals
pass
@abstractmethod
def computePointCloud(self):
# To override: Compute depth map - point cloud
pass
@abstractmethod
def highPassFilter(self):
# To override
pass
| 19.560976
| 54
| 0.629676
| 77
| 802
| 6.480519
| 0.441558
| 0.204409
| 0.210421
| 0.088176
| 0.228457
| 0.228457
| 0.228457
| 0.228457
| 0.228457
| 0
| 0
| 0
| 0.312968
| 802
| 40
| 55
| 20.05
| 0.905626
| 0.243142
| 0
| 0.545455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.318182
| false
| 0.318182
| 0.045455
| 0
| 0.409091
| 0
| 0
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
c6de530fbef5628b204f020a15f23705f7dc2ff9
| 118
|
py
|
Python
|
cumulus2/actions.py
|
peterkh/cumulus2
|
11352ce469acb0c319ba9cfb8691d80f4ae5048e
|
[
"Apache-2.0"
] | 1
|
2016-02-12T11:54:07.000Z
|
2016-02-12T11:54:07.000Z
|
cumulus2/actions.py
|
peterkh/cumulus2
|
11352ce469acb0c319ba9cfb8691d80f4ae5048e
|
[
"Apache-2.0"
] | null | null | null |
cumulus2/actions.py
|
peterkh/cumulus2
|
11352ce469acb0c319ba9cfb8691d80f4ae5048e
|
[
"Apache-2.0"
] | null | null | null |
"""
Actions module for cumulus.
Will be responsible for running the different actions,
create, update and delete.
"""
| 19.666667
| 54
| 0.762712
| 16
| 118
| 5.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152542
| 118
| 5
| 55
| 23.6
| 0.9
| 0.923729
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
05d926daec75d4731907392138b7d0a71761ecf7
| 211
|
py
|
Python
|
app/main/service/index.py
|
Wason1797/RestAPIExample
|
7a28d724e6f4baaedc55d6c306d7a519f2580ebe
|
[
"MIT"
] | null | null | null |
app/main/service/index.py
|
Wason1797/RestAPIExample
|
7a28d724e6f4baaedc55d6c306d7a519f2580ebe
|
[
"MIT"
] | null | null | null |
app/main/service/index.py
|
Wason1797/RestAPIExample
|
7a28d724e6f4baaedc55d6c306d7a519f2580ebe
|
[
"MIT"
] | null | null | null |
from app.http_methods import GET
from flask import Blueprint, jsonify
index = Blueprint('index', __name__)
@index.route('/', methods=GET)
def _index():
return jsonify({'message': 'hello from mock api'})
| 19.181818
| 54
| 0.71564
| 28
| 211
| 5.178571
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146919
| 211
| 10
| 55
| 21.1
| 0.805556
| 0
| 0
| 0
| 0
| 0
| 0.151659
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0.166667
| 0.666667
| 0.333333
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
af0a8dfb35a04a007fec1fdd21da50c3def2a0ba
| 171
|
py
|
Python
|
preprocess.py
|
abhishekyana/SentimenNet-for-Sentiment-Detection
|
1e8256175693af62197facaa9c3cabe9197429de
|
[
"MIT"
] | null | null | null |
preprocess.py
|
abhishekyana/SentimenNet-for-Sentiment-Detection
|
1e8256175693af62197facaa9c3cabe9197429de
|
[
"MIT"
] | null | null | null |
preprocess.py
|
abhishekyana/SentimenNet-for-Sentiment-Detection
|
1e8256175693af62197facaa9c3cabe9197429de
|
[
"MIT"
] | 1
|
2021-03-11T10:45:14.000Z
|
2021-03-11T10:45:14.000Z
|
# This file will make sure all the pre-requisites are met.
# Download the GloVe Model and Extract the pickle object locally.
# These will enable the code to run smoothly.
| 42.75
| 65
| 0.777778
| 29
| 171
| 4.586207
| 0.862069
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181287
| 171
| 3
| 66
| 57
| 0.95
| 0.959064
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
af4a02ab246e3d3666c119df737b562e94a50dd0
| 363
|
py
|
Python
|
device_monitor.py
|
jpollock/akka-serverless-demo-python-device-monitor
|
ea216a390a3bd107633590c0e93fd9c04eab8731
|
[
"MIT"
] | 1
|
2021-02-22T13:44:08.000Z
|
2021-02-22T13:44:08.000Z
|
device_monitor.py
|
jpollock/akka-serverless-demo-python-device-monitor
|
ea216a390a3bd107633590c0e93fd9c04eab8731
|
[
"MIT"
] | null | null | null |
device_monitor.py
|
jpollock/akka-serverless-demo-python-device-monitor
|
ea216a390a3bd107633590c0e93fd9c04eab8731
|
[
"MIT"
] | null | null | null |
"""
Copyright 2020 Lightbend Inc.
Licensed under the Apache License, Version 2.0.
"""
from cloudstate.cloudstate import CloudState
from device_monitor_entity import entity as device_monitor_entity
import logging
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
CloudState().register_event_sourced_entity(device_monitor_entity).start()
| 30.25
| 77
| 0.809917
| 46
| 363
| 6.021739
| 0.652174
| 0.140794
| 0.205776
| 0.180505
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018576
| 0.110193
| 363
| 12
| 77
| 30.25
| 0.839009
| 0.212121
| 0
| 0
| 0
| 0
| 0.028674
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
af4c01edb42379a0793af5dbb8c949c854bee351
| 509
|
py
|
Python
|
krules_core/subject/empty_storage.py
|
Zenzo42/krules-core
|
0de9a706bad92dbb33291cd038ac418e994a014e
|
[
"Apache-2.0"
] | 10
|
2021-02-26T13:00:22.000Z
|
2022-03-31T11:38:28.000Z
|
krules_core/subject/empty_storage.py
|
Zenzo42/krules-core
|
0de9a706bad92dbb33291cd038ac418e994a014e
|
[
"Apache-2.0"
] | 1
|
2021-08-03T10:21:12.000Z
|
2021-08-03T10:21:12.000Z
|
libs/krules-core/krules_core/subject/empty_storage.py
|
airspot-dev/krules
|
0e402feef51c6189a163a62912480cfac0c438bb
|
[
"Apache-2.0"
] | 2
|
2020-11-02T17:42:29.000Z
|
2020-11-03T09:11:44.000Z
|
class EmptySubjectStorage:
def is_concurrency_safe(self):
return False
def is_persistent(self):
return False
def load(self):
return {}, {}
def store(self, inserts=[], updates=[], deletes=[]):
pass
def set(self, prop, old_value_default=None):
return None, None
def get(self, prop):
return None
def delete(self, prop):
pass
def get_ext_props(self):
return {}
def flush(self):
return self
| 14.542857
| 56
| 0.565815
| 59
| 509
| 4.762712
| 0.457627
| 0.177936
| 0.106762
| 0.128114
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.330059
| 509
| 34
| 57
| 14.970588
| 0.824047
| 0
| 0
| 0.210526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.473684
| false
| 0.105263
| 0
| 0.368421
| 0.894737
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
|
0
| 4
|
af6c5ebb6c14178879360f1a9ef43f066c548c1d
| 429
|
py
|
Python
|
amazon/view.py
|
sudiptakarmakar/amazon-invoice-scraper
|
084b060a841e8a7540e54a1f697260e96d17e524
|
[
"Apache-2.0"
] | 17
|
2017-05-13T16:09:35.000Z
|
2022-02-02T11:59:47.000Z
|
amazon/view.py
|
sudiptakarmakar/amazon-invoice-scraper
|
084b060a841e8a7540e54a1f697260e96d17e524
|
[
"Apache-2.0"
] | null | null | null |
amazon/view.py
|
sudiptakarmakar/amazon-invoice-scraper
|
084b060a841e8a7540e54a1f697260e96d17e524
|
[
"Apache-2.0"
] | 1
|
2020-09-26T23:14:39.000Z
|
2020-09-26T23:14:39.000Z
|
from __future__ import print_function
import flask
from . import invoice
from . import app
@app.route('/')
def index():
return flask.render_template('index.html', title='Home')
@app.errorhandler(404)
def page_not_found(e):
return flask.render_template('404.html'), 404
@app.route('/<key>', methods=["GET", "POST"])
def search_shelves(key=None):
data = flask.request.data
return flask.jsonify(products=data)
| 20.428571
| 60
| 0.713287
| 60
| 429
| 4.933333
| 0.566667
| 0.111486
| 0.114865
| 0.168919
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024259
| 0.135198
| 429
| 20
| 61
| 21.45
| 0.773585
| 0
| 0
| 0
| 0
| 0
| 0.083916
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.214286
| false
| 0
| 0.285714
| 0.142857
| 0.714286
| 0.071429
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
af7b586d0af2b3ee91ef6b7d5f946b59bb719fc1
| 159
|
py
|
Python
|
openbadge_analysis/visualization/__init__.py
|
Finale21/openbadge
|
48990b73185c76a35b08963c03447b06dfe2727d
|
[
"MIT"
] | null | null | null |
openbadge_analysis/visualization/__init__.py
|
Finale21/openbadge
|
48990b73185c76a35b08963c03447b06dfe2727d
|
[
"MIT"
] | null | null | null |
openbadge_analysis/visualization/__init__.py
|
Finale21/openbadge
|
48990b73185c76a35b08963c03447b06dfe2727d
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from .embedding import rssi_to_distance, members_2d_embedding, members_2d_embedding_with_beacons
__all__ = ["audio_visualization" ]
| 22.714286
| 96
| 0.779874
| 20
| 159
| 5.55
| 0.8
| 0.162162
| 0.324324
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.021277
| 0.113208
| 159
| 7
| 97
| 22.714286
| 0.765957
| 0.132075
| 0
| 0
| 0
| 0
| 0.138686
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
af80fbf087d20d1f2c84853c2cd2f6094d1b992d
| 127
|
py
|
Python
|
scripts/portal/q57104portal.py
|
G00dBye/YYMS
|
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
|
[
"MIT"
] | 54
|
2019-04-16T23:24:48.000Z
|
2021-12-18T11:41:50.000Z
|
scripts/portal/q57104portal.py
|
G00dBye/YYMS
|
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
|
[
"MIT"
] | 3
|
2019-05-19T15:19:41.000Z
|
2020-04-27T16:29:16.000Z
|
scripts/portal/q57104portal.py
|
G00dBye/YYMS
|
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
|
[
"MIT"
] | 49
|
2020-11-25T23:29:16.000Z
|
2022-03-26T16:20:24.000Z
|
# Momijigaoka | Unfamiliar Hillside
if sm.getFieldID() == 807040100:
sm.warp(807000000, 1)
else:
sm.warp(807040100, 0)
| 21.166667
| 35
| 0.692913
| 16
| 127
| 5.5
| 0.75
| 0.136364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.27619
| 0.173228
| 127
| 6
| 36
| 21.166667
| 0.561905
| 0.259843
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
af9a8e310ef0af19a1e184a52bd85420d6fca652
| 121
|
py
|
Python
|
price/cli/token.py
|
byegates/ark
|
55bee6181be9d94e2d47b719a4206ca53316133e
|
[
"MIT"
] | 3
|
2021-02-17T19:34:03.000Z
|
2021-05-03T16:28:47.000Z
|
price/cli/token.py
|
byegates/ark
|
55bee6181be9d94e2d47b719a4206ca53316133e
|
[
"MIT"
] | null | null | null |
price/cli/token.py
|
byegates/ark
|
55bee6181be9d94e2d47b719a4206ca53316133e
|
[
"MIT"
] | null | null | null |
def get_token(fi='dont.mess.with.me'):
with open(fi, 'r') as f:
return f.readline().strip()
t = get_token()
| 20.166667
| 38
| 0.595041
| 21
| 121
| 3.333333
| 0.761905
| 0.228571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.206612
| 121
| 6
| 39
| 20.166667
| 0.729167
| 0
| 0
| 0
| 0
| 0
| 0.147541
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
afb103ac896648f4ff4de94b62192e64b0557d99
| 4,698
|
py
|
Python
|
tests/test_upload.py
|
quwac/cloud-storage-for-firebase-utils
|
de296fa51d9515e4d23cc1fe0e7043bce55526ca
|
[
"MIT"
] | 2
|
2021-04-13T21:53:26.000Z
|
2021-12-17T11:40:02.000Z
|
tests/test_upload.py
|
quwac/cloud-storage-for-firebase-utils
|
de296fa51d9515e4d23cc1fe0e7043bce55526ca
|
[
"MIT"
] | null | null | null |
tests/test_upload.py
|
quwac/cloud-storage-for-firebase-utils
|
de296fa51d9515e4d23cc1fe0e7043bce55526ca
|
[
"MIT"
] | null | null | null |
from typing import Optional
import uuid
from google.cloud.storage import Blob, Client
import pytest
from testconfig import TEST_ARG
from csfutils import (
get_access_token,
init_storage,
ref_from_url,
upload_from_file_for_firebase,
upload_from_filename_for_firebase,
upload_from_string_for_firebase,
)
class TestUploadForFirebase(object):
def _get_path(self, child: Optional[str]):
if child is not None:
path = f"upload/item1/item2/{child}"
else:
path = "upload/item1/item2"
return path
def _blob(self, child: Optional[str]) -> Blob:
storage = init_storage(TEST_ARG.service_account_json_path)
return storage.bucket(TEST_ARG.bucket_name).blob(self._get_path(child))
def _get_blob(self, child: Optional[str]) -> Optional[Blob]:
storage = init_storage(TEST_ARG.service_account_json_path)
return storage.bucket(TEST_ARG.bucket_name).get_blob(self._get_path(child))
def _delete_file(self):
blob = self._get_blob("📔file📓.txt")
if blob is not None:
blob.delete()
def setup_method(self):
self._delete_file()
def teardown_method(self):
self._delete_file()
def _check(self, client: Client, url: str):
blob = ref_from_url(client, url)
assert blob.exists()
assert type(get_access_token(blob)) is str
assert (
blob.content_disposition == "inline; filename*=utf-8''%F0%9F%93%94file%F0%9F%93%93.txt"
)
# ========== file ==========
def test_upload_from_file_for_firebase(self):
blob = self._blob("📔file📓.txt")
with open("./test_resources/📔file📓.txt") as f:
url = upload_from_file_for_firebase(blob, f)
self._check(blob.client, url)
def test_upload_from_file_for_firebase_access_token(self):
blob = self._blob("📔file📓.txt")
with open("./test_resources/📔file📓.txt") as f:
expected_access_token = str(uuid.uuid4())
url = upload_from_file_for_firebase(blob, f, expected_access_token)
self._check(blob.client, url)
assert get_access_token(blob) == expected_access_token
def test_upload_from_file_for_firebase_error_illegal_access_token(self):
blob = self._blob("📔file📓.txt")
with pytest.raises(Exception):
with open("./test_resources/📔file📓.txt") as f:
expected_access_token = "aaa"
_ = upload_from_file_for_firebase(blob, f, expected_access_token)
assert self._get_blob("📔file📓.txt") is None
assert get_access_token(blob) is None
# ========== filename ==========
def test_upload_from_filename_for_firebase(self):
blob = self._blob("📔file📓.txt")
url = upload_from_filename_for_firebase(blob, "./test_resources/📔file📓.txt")
self._check(blob.client, url)
def test_upload_from_filename_for_firebase_access_token(self):
blob = self._blob("📔file📓.txt")
expected_access_token = str(uuid.uuid4())
url = upload_from_filename_for_firebase(
blob, "./test_resources/📔file📓.txt", expected_access_token
)
self._check(blob.client, url)
assert get_access_token(blob) == expected_access_token
def test_upload_from_filename_for_firebase_error_illegal_access_token(self):
blob = self._blob("📔file📓.txt")
with pytest.raises(Exception):
expected_access_token = "aaa"
_ = upload_from_filename_for_firebase(
blob, "./test_resources/📔file📓.txt", expected_access_token
)
assert self._get_blob("📔file📓.txt") is None
assert get_access_token(blob) is None
# ========== string ==========
def test_upload_from_string_for_firebase(self):
blob = self._blob("📔file📓.txt")
url = upload_from_string_for_firebase(blob, "string")
self._check(blob.client, url)
def test_upload_from_string_for_firebase_access_token(self):
blob = self._blob("📔file📓.txt")
expected_access_token = str(uuid.uuid4())
url = upload_from_string_for_firebase(blob, "string", expected_access_token)
self._check(blob.client, url)
assert get_access_token(blob) == expected_access_token
def test_upload_from_string_for_firebase_error_illegal_access_token(self):
blob = self._blob("📔file📓.txt")
with pytest.raises(Exception):
expected_access_token = "aaa"
_ = upload_from_string_for_firebase(blob, "string", expected_access_token)
assert self._get_blob("📔file📓.txt") is None
assert get_access_token(blob) is None
| 32.625
| 99
| 0.657514
| 642
| 4,698
| 4.514019
| 0.124611
| 0.110076
| 0.039337
| 0.059006
| 0.81332
| 0.770531
| 0.725328
| 0.682195
| 0.661491
| 0.615942
| 0
| 0.005513
| 0.227756
| 4,698
| 143
| 100
| 32.853147
| 0.7828
| 0.018306
| 0
| 0.424242
| 0
| 0.010101
| 0.091146
| 0.051432
| 0
| 0
| 0
| 0
| 0.121212
| 1
| 0.161616
| false
| 0
| 0.060606
| 0
| 0.262626
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
afb6b95c0ea15c639c1adce90ccd336c5f379e42
| 30
|
py
|
Python
|
basic/big_mod.py
|
jspw/Basic_Python
|
aa159f576a471c6deebdf1e5f462dfc9ffb4930b
|
[
"Unlicense"
] | 6
|
2020-06-25T14:52:09.000Z
|
2021-08-05T20:54:15.000Z
|
basic/big_mod.py
|
jspw/Basic_Python
|
aa159f576a471c6deebdf1e5f462dfc9ffb4930b
|
[
"Unlicense"
] | null | null | null |
basic/big_mod.py
|
jspw/Basic_Python
|
aa159f576a471c6deebdf1e5f462dfc9ffb4930b
|
[
"Unlicense"
] | null | null | null |
n=int(input())
p=int(input())
| 10
| 14
| 0.6
| 6
| 30
| 3
| 0.666667
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.066667
| 30
| 2
| 15
| 15
| 0.642857
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 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
| 4
|
bb83eb84d7e4e6862a51ae013fabc7213541503e
| 1,217
|
py
|
Python
|
211.py
|
thirtiseven/projecteuler
|
57ad70beae39ff82191cf37e71acade0c63a62f5
|
[
"MIT"
] | null | null | null |
211.py
|
thirtiseven/projecteuler
|
57ad70beae39ff82191cf37e71acade0c63a62f5
|
[
"MIT"
] | null | null | null |
211.py
|
thirtiseven/projecteuler
|
57ad70beae39ff82191cf37e71acade0c63a62f5
|
[
"MIT"
] | 1
|
2019-12-27T23:30:51.000Z
|
2019-12-27T23:30:51.000Z
|
print(1+42
+246
+287
+728
+1434
+1673
+1880
+4264
+6237
+9799
+9855
+18330
+21352
+21385
+24856
+36531
+39990
+46655
+57270
+66815
+92664
+125255
+156570
+182665
+208182
+212949
+242879
+273265
+380511
+391345
+411558
+539560
+627215
+693160
+730145
+741096
+773224
+814463
+931722
+992680
+1069895
+1087009
+1143477
+1166399
+1422577
+1592935
+1815073
+2281255
+2544697
+2713880
+2722005
+2828385
+3054232
+3132935
+3145240
+3188809
+3508456
+4026280
+4647985
+4730879
+5024488
+5054015
+5143945
+5260710
+5938515
+6128024
+6236705
+6366767
+6956927
+6996904
+7133672
+7174440+7538934
+7736646
+7818776
+8292583
+8429967
+8504595
+8795423+9026087
+9963071
+11477130
+11538505
+11725560
+12158135
+12939480
+12948776
+13495720
+13592118
+13736408
+15203889
+15857471
+16149848
+16436490
+16487415
+16909849
+18391401
+18422120
+20549528
+20813976
+20871649
+21251412
+22713455
+23250645
+23630711
+24738935
+26338473
+26343030
+26594568
+28113048
+29429144
+29778762
+29973414
+30666090
+30915027
+34207446
+34741889
+34968983
+35721896
+37113593
+37343065
+38598255
+39256230
+42021720
+44935590
+45795688
+45798935
+48988758
+49375521
+51516049
+51912289
+52867081
+56215914
+59748234
+61116363
+62158134
+63286535)
| 9.014815
| 16
| 0.775678
| 139
| 1,217
| 6.791367
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.867036
| 0.110107
| 1,217
| 135
| 17
| 9.014815
| 0.004617
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.007407
| 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 | 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
bba01cd77c03a34888a0b7c3ba759f1ee8742a21
| 172
|
py
|
Python
|
features.py
|
MalcolmM2/waifubot
|
8a3645e16c2ef4fc0eb0789c2574d2c4f02ef3c9
|
[
"MIT"
] | 1
|
2021-04-22T18:30:31.000Z
|
2021-04-22T18:30:31.000Z
|
features.py
|
MalcolmM2/waifubot
|
8a3645e16c2ef4fc0eb0789c2574d2c4f02ef3c9
|
[
"MIT"
] | null | null | null |
features.py
|
MalcolmM2/waifubot
|
8a3645e16c2ef4fc0eb0789c2574d2c4f02ef3c9
|
[
"MIT"
] | 5
|
2021-03-24T05:00:06.000Z
|
2021-10-06T18:24:58.000Z
|
import discord
def make_uwu(message):
if "uwu" in message.content.lower():
await message.channel.send(message.author + ":", message.content.replaceAll("r", w))
| 34.4
| 92
| 0.69186
| 23
| 172
| 5.130435
| 0.73913
| 0.237288
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.151163
| 172
| 5
| 92
| 34.4
| 0.808219
| 0
| 0
| 0
| 0
| 0
| 0.028902
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
bba0c6738c3a4e1083b42ab809aebf81a2fb227d
| 142
|
py
|
Python
|
tests/unit/mock/config/compliance/config_section_not_parsed/cisco_nxos/nxos_basic_feature.py
|
vivekvashist/netutils
|
c2d75178d2613a44f070f55ef94e11866eef8f36
|
[
"Apache-2.0"
] | 91
|
2021-05-13T18:14:57.000Z
|
2022-03-22T14:36:38.000Z
|
tests/unit/mock/config/compliance/config_section_not_parsed/cisco_nxos/nxos_basic_feature.py
|
vivekvashist/netutils
|
c2d75178d2613a44f070f55ef94e11866eef8f36
|
[
"Apache-2.0"
] | 61
|
2021-05-15T00:49:31.000Z
|
2022-03-28T06:08:52.000Z
|
tests/unit/mock/config/compliance/config_section_not_parsed/cisco_nxos/nxos_basic_feature.py
|
vivekvashist/netutils
|
c2d75178d2613a44f070f55ef94e11866eef8f36
|
[
"Apache-2.0"
] | 26
|
2021-05-13T23:51:40.000Z
|
2022-03-31T12:30:11.000Z
|
features = [
{"name": "ntp", "ordered": True, "section": ["ntp server "]},
{"name": "vlan", "ordered": True, "section": ["vlan "]},
]
| 28.4
| 65
| 0.507042
| 14
| 142
| 5.142857
| 0.571429
| 0.305556
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.190141
| 142
| 4
| 66
| 35.5
| 0.626087
| 0
| 0
| 0
| 0
| 0
| 0.415493
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
bba208f131385a07ebf30b4e82d6096e75cb78d2
| 8,533
|
py
|
Python
|
backend/tests/test_apps_admin_clients.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | 1
|
2022-02-13T17:39:42.000Z
|
2022-02-13T17:39:42.000Z
|
backend/tests/test_apps_admin_clients.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | 1
|
2022-02-13T14:46:24.000Z
|
2022-02-13T14:46:24.000Z
|
backend/tests/test_apps_admin_clients.py
|
fief-dev/fief
|
cbfeec11da7a03aa345cb7ceb088b5d8ec9d6ab1
|
[
"MIT"
] | null | null | null |
import uuid
from typing import List
import httpx
import pytest
from fastapi import status
from jwcrypto import jwk
from fief.db import AsyncSession
from fief.errors import APIErrorCode
from fief.managers import ClientManager
from tests.data import TestData
@pytest.mark.asyncio
@pytest.mark.workspace_host
class TestListClients:
async def test_unauthorized(self, test_client_admin: httpx.AsyncClient):
response = await test_client_admin.get("/clients/")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin
async def test_valid(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
response = await test_client_admin.get("/clients/")
assert response.status_code == status.HTTP_200_OK
json = response.json()
assert json["count"] == len(test_data["clients"])
for result in json["results"]:
assert "tenant" in result
assert result["encrypt_jwk"] in [None, "**********"]
@pytest.mark.asyncio
@pytest.mark.workspace_host
class TestCreateClient:
async def test_unauthorized(self, test_client_admin: httpx.AsyncClient):
response = await test_client_admin.post("/clients/", json={})
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin
async def test_empty_redirect_uris(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
tenant = test_data["tenants"]["default"]
response = await test_client_admin.post(
"/clients/",
json={
"name": "New client",
"first_party": True,
"client_type": "confidential",
"redirect_uris": [],
"tenant_id": str(tenant.id),
},
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
json = response.json()
assert json["detail"][0]["loc"] == ["body", "redirect_uris"]
@pytest.mark.authenticated_admin
async def test_redirect_uris_not_https(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
tenant = test_data["tenants"]["default"]
response = await test_client_admin.post(
"/clients/",
json={
"name": "New client",
"first_party": True,
"client_type": "confidential",
"redirect_uris": ["http://nantes.city/callback"],
"tenant_id": str(tenant.id),
},
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
json = response.json()
assert json["detail"][0]["loc"] == ["body", "redirect_uris", 0]
assert (
json["detail"][0]["msg"]
== APIErrorCode.CLIENT_HTTPS_REQUIRED_ON_REDIRECT_URIS
)
@pytest.mark.authenticated_admin
async def test_unknown_tenant(
self, test_client_admin: httpx.AsyncClient, not_existing_uuid: uuid.UUID
):
response = await test_client_admin.post(
"/clients/",
json={
"name": "New client",
"first_party": True,
"client_type": "confidential",
"redirect_uris": ["https://nantes.city/callback"],
"tenant_id": str(not_existing_uuid),
},
)
assert response.status_code == status.HTTP_400_BAD_REQUEST
json = response.json()
assert json["detail"] == APIErrorCode.CLIENT_CREATE_UNKNOWN_TENANT
@pytest.mark.authenticated_admin
@pytest.mark.parametrize(
"redirect_uris",
[
["https://nantes.city/callback"],
["http://localhost:8000/callback"],
["http://test.localhost:8000/callback"],
],
)
async def test_valid(
self,
redirect_uris: List[str],
test_client_admin: httpx.AsyncClient,
test_data: TestData,
):
tenant = test_data["tenants"]["default"]
response = await test_client_admin.post(
"/clients/",
json={
"name": "New client",
"first_party": True,
"client_type": "confidential",
"redirect_uris": redirect_uris,
"tenant_id": str(tenant.id),
},
)
assert response.status_code == status.HTTP_201_CREATED
json = response.json()
assert json["name"] == "New client"
assert json["first_party"] is True
assert json["redirect_uris"] == redirect_uris
assert json["client_id"] is not None
assert json["client_secret"] is not None
assert json["tenant_id"] == str(tenant.id)
@pytest.mark.asyncio
@pytest.mark.workspace_host
class TestUpdateClient:
async def test_unauthorized(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
client = test_data["clients"]["default_tenant"]
response = await test_client_admin.patch(f"/clients/{client.id}", json={})
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin
async def test_not_existing(
self, test_client_admin: httpx.AsyncClient, not_existing_uuid: uuid.UUID
):
response = await test_client_admin.patch(
f"/clients/{not_existing_uuid}", json={}
)
assert response.status_code == status.HTTP_404_NOT_FOUND
@pytest.mark.authenticated_admin
async def test_redirect_uris_not_https(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
client = test_data["clients"]["default_tenant"]
response = await test_client_admin.patch(
f"/clients/{client.id}",
json={"redirect_uris": ["http://nantes.city/callback"]},
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
json = response.json()
assert json["detail"][0]["loc"] == ["body", "redirect_uris", 0]
assert (
json["detail"][0]["msg"]
== APIErrorCode.CLIENT_HTTPS_REQUIRED_ON_REDIRECT_URIS
)
@pytest.mark.authenticated_admin
async def test_cant_update_tenant(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
client = test_data["clients"]["default_tenant"]
response = await test_client_admin.patch(
f"/clients/{client.id}",
json={"tenant_id": str(test_data["tenants"]["secondary"])},
)
assert response.status_code == status.HTTP_200_OK
json = response.json()
assert json["tenant_id"] == str(client.tenant_id)
@pytest.mark.authenticated_admin
async def test_valid(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
client = test_data["clients"]["default_tenant"]
response = await test_client_admin.patch(
f"/clients/{client.id}",
json={"name": "Updated name"},
)
assert response.status_code == status.HTTP_200_OK
json = response.json()
assert json["name"] == "Updated name"
@pytest.mark.asyncio
@pytest.mark.workspace_host
class TestCreateEncryptionKey:
async def test_unauthorized(
self, test_client_admin: httpx.AsyncClient, test_data: TestData
):
client = test_data["clients"]["default_tenant"]
response = await test_client_admin.post(f"/clients/{client.id}/encryption-key")
assert response.status_code == status.HTTP_401_UNAUTHORIZED
@pytest.mark.authenticated_admin
async def test_success(
self,
test_client_admin: httpx.AsyncClient,
test_data: TestData,
workspace_session: AsyncSession,
):
client = test_data["clients"]["default_tenant"]
response = await test_client_admin.post(f"/clients/{client.id}/encryption-key")
assert response.status_code == status.HTTP_201_CREATED
key = jwk.JWK.from_json(response.text)
assert key.has_private == True
assert key.has_public == True
manager = ClientManager(workspace_session)
updated_client = await manager.get_by_id(client.id)
assert updated_client is not None
assert updated_client.encrypt_jwk is not None
tenant_key = jwk.JWK.from_json(updated_client.encrypt_jwk)
assert tenant_key.has_private == False
assert tenant_key.has_public == True
| 33.073643
| 87
| 0.627681
| 945
| 8,533
| 5.410582
| 0.129101
| 0.054762
| 0.082144
| 0.054762
| 0.778017
| 0.75396
| 0.709955
| 0.700176
| 0.656366
| 0.646392
| 0
| 0.009039
| 0.260987
| 8,533
| 257
| 88
| 33.202335
| 0.801776
| 0
| 0
| 0.619048
| 0
| 0
| 0.137466
| 0.011485
| 0
| 0
| 0
| 0
| 0.17619
| 1
| 0
| false
| 0
| 0.047619
| 0
| 0.066667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
bbba6f258120ed2242bf11f1161737f42de17ad3
| 44
|
py
|
Python
|
Programs/ASCIIValue.py
|
GopinathBalaji/Basic-Programs-Python
|
8993e73428f1b6d4e2e601983c9c0f1bd0f92935
|
[
"MIT"
] | 5
|
2021-07-20T08:12:29.000Z
|
2022-01-18T20:00:50.000Z
|
Programs/ascii_value.py
|
Janhavi-2001/Basic-Programs-Python
|
1bba988d77e962ddd4c78fb1beb9bf00798423c9
|
[
"MIT"
] | 26
|
2020-12-26T14:42:05.000Z
|
2021-12-04T09:23:41.000Z
|
Programs/ascii_value.py
|
Janhavi-2001/Basic-Programs-Python
|
1bba988d77e962ddd4c78fb1beb9bf00798423c9
|
[
"MIT"
] | 14
|
2021-04-01T19:24:35.000Z
|
2022-01-10T11:29:28.000Z
|
c = 'p'
print("The ASCII value is ", ord(c))
| 22
| 36
| 0.590909
| 9
| 44
| 2.888889
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 44
| 2
| 36
| 22
| 0.722222
| 0
| 0
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 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
| 1
|
0
| 4
|
bbbfb207d6bd4c1e52d81399bed05321b047afda
| 551
|
py
|
Python
|
eventsourcing/application/popo.py
|
HanhThong/eventsourcing
|
99c560cca7c6e9d59855bcd82c371794e1a8bfb9
|
[
"BSD-3-Clause"
] | 1
|
2020-07-31T10:15:33.000Z
|
2020-07-31T10:15:33.000Z
|
eventsourcing/application/popo.py
|
HanhThong/eventsourcing
|
99c560cca7c6e9d59855bcd82c371794e1a8bfb9
|
[
"BSD-3-Clause"
] | null | null | null |
eventsourcing/application/popo.py
|
HanhThong/eventsourcing
|
99c560cca7c6e9d59855bcd82c371794e1a8bfb9
|
[
"BSD-3-Clause"
] | null | null | null |
from eventsourcing.application.simple import ApplicationWithConcreteInfrastructure
from eventsourcing.infrastructure.popo.factory import PopoInfrastructureFactory
from eventsourcing.infrastructure.popo.mapper import SequencedItemMapperForPopo
from eventsourcing.infrastructure.popo.records import StoredEventRecord
class PopoApplication(ApplicationWithConcreteInfrastructure):
infrastructure_factory_class = PopoInfrastructureFactory
sequenced_item_mapper_class = SequencedItemMapperForPopo
stored_event_record_class = StoredEventRecord
| 50.090909
| 82
| 0.894737
| 44
| 551
| 11.022727
| 0.477273
| 0.140206
| 0.191753
| 0.216495
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.07441
| 551
| 10
| 83
| 55.1
| 0.95098
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 1
| 0
| 0
| 0
| 1
| 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
| 4
|
bbc7e00ecbf4f12b5dc642d09dafb5fef28a2cd0
| 4,180
|
py
|
Python
|
tests/test_validators.py
|
KnowledgeLinks/rdfframework
|
c6b6408b6e90dd166b4981aeaf3a768e46c22ce0
|
[
"MIT"
] | 7
|
2016-11-09T07:59:43.000Z
|
2019-02-19T01:34:29.000Z
|
tests/test_validators.py
|
KnowledgeLinks/rdfframework
|
c6b6408b6e90dd166b4981aeaf3a768e46c22ce0
|
[
"MIT"
] | 22
|
2018-01-10T15:03:22.000Z
|
2019-12-17T12:00:10.000Z
|
tests/test_validators.py
|
KnowledgeLinks/rdfframework
|
c6b6408b6e90dd166b4981aeaf3a768e46c22ce0
|
[
"MIT"
] | null | null | null |
__author__ = "Jeremy Nelson, Mike Stabile"
import os
import sys
import unittest
from rdfframework.validators import *
from rdfframework.processors import csv_to_multi_prop_processor, \
email_verification_processor, password_processor, run_processor,\
salt_processor
##
##
##
##class Test_email_verification_processor(unittest.TestCase):
##
## def setUp(self):
## self.email = {
## "propertyProcessing": "http://knowledgelinks.io/ns/data-resources/EmailVerificationProcessor",
## "propUri": "https://schema.org/email",
## "comment": "email address.",
## "requiredByDomain": "https://schema.org/Person",
## "range": [
## {
## "storageType": "literal",
## "rangeClass": "http://www.w3.org/2001/XMLSchema#string"
## }
## ],
## "type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"
## }
##
## def test_load_mode(self):
## self.email["dataValue"] = "testuser@kl.io"
## #result = email_verification_processor(self.email, "load")
## #self.assertEqual(result, "testuser@kl.io")
##
## def test_save_mode(self):
## pass
## #self.assertEqual(
## # self.email,
## # email_verification_processor(self.email, "save"))
##
## def test_unknown_mode(self):
## pass
## #self.assertEqual(
## # self.email,
## # email_verification_processor(self.email, "unknown"))
##
##class Test_password_processor(unittest.TestCase):
##
## def setUp(self):
## self.has_password = {
## "subPropertyOf": "http://knowledgelinks.io/ns/data-structures/securityProperty",
## "storageType": "object",
## "propUri": "http://knowledgelinks.io/ns/data-structures/hasPassword",
## "comment": "User's account password object",
## "requiredByDomain": "http://knowledgelinks.io/ns/data-structures/UserClass",
## "label": "User's password",
## "range": [
## {
## "storageType": "object",
## "rangeClass": "http://knowledgelinks.io/ns/data-structures/PasswordClass"
## }
## ],
## "type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"
## }
##
##
## def test_load_mode(self):
## fake_password = str(os.urandom(15))
## self.has_password["dataValue"] = fake_password
## #self.assertEqual(
## # password_processor(self.has_password, "load"),
## # fake_password)
##
## def test_unknown_mode(self):
## pass
## #self.assertEqual(
## # self.has_password,
## # password_processor(self.has_password, "unknown"))
##
##
## def test_verify_mode(self):
## pass
##
##class Test_salt_processor(unittest.TestCase):
##
## def setUp(self):
## pass
##
## def test_load_mode(self):
## loaded_object = {"dataValue": 3456}
## #self.assertEqual(
## # salt_processor(loaded_object, "load"),
## # 3456)
##
##
## def test_salt_property(self):
## form = {"processedData": {},
## "prop": {"calcValue": None}}
## #result = salt_processor(form, None, "sha1")
## #self.assertIn(
## # "sha1",
## # result["processedData"])
## #self.assertTrue(result['prop']['calcValue'])
##
##
## def test_salt_already_exists(self):
## form = {"processedData": {"https://schema.org/salt": 1234},
## "prop": {"calcValue": None},
## "propUri": "https://schema.org/salt"}
## #self.assertEqual(
## # salt_processor(form, None),
## # form)
##
##
## def test_find_password_property(self):
## form = {"processedData": {},
## "propUri": "https://schema.org/salt",
## "prop": {"calcValue": None, "className": "Organization"}}
## #self.assertRaises(AttributeError, salt_processor, obj=form, mode=None)
##
##
##
##class Test_run_processor(unittest.TestCase):
##
## def test_default(self):
## self.assertIsNone(run_processor(
## "kdr:UnknownProcessor",
## None,
## None))
| 31.428571
| 104
| 0.565072
| 392
| 4,180
| 5.852041
| 0.280612
| 0.033566
| 0.05667
| 0.047951
| 0.340889
| 0.256321
| 0.177419
| 0.141674
| 0.141674
| 0.115955
| 0
| 0.01244
| 0.25
| 4,180
| 132
| 105
| 31.666667
| 0.719298
| 0.839474
| 0
| 0
| 0
| 0
| 0.067164
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.125
| 0.625
| 0
| 0.625
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
bbe7ef594d6be455aeafb34f7d604a444a608f2f
| 563
|
py
|
Python
|
bigchaindb/backend/firestore/__init__.py
|
Bloombox/bigchaindb
|
dd2c03250464c73d9b5f57eb3d1d1b62e63694bf
|
[
"Apache-2.0"
] | null | null | null |
bigchaindb/backend/firestore/__init__.py
|
Bloombox/bigchaindb
|
dd2c03250464c73d9b5f57eb3d1d1b62e63694bf
|
[
"Apache-2.0"
] | null | null | null |
bigchaindb/backend/firestore/__init__.py
|
Bloombox/bigchaindb
|
dd2c03250464c73d9b5f57eb3d1d1b62e63694bf
|
[
"Apache-2.0"
] | null | null | null |
"""Cloud Firestore adapter backend implementation.
Contains a Google Cloud Firestore implementation for BigchainDB's
:mod:`~bigchaindb.backend.schema` and :mod:`~bigchaindb.backend.query` interfaces.
You can specify BigchainDB to use Firestore as its database backend by either
setting ``database.backend`` to ``'firestore'`` in your configuration file, or
setting the ``BIGCHAINDB_DATABASE_BACKEND`` environment variable to
``'firestore'``.
"""
# Register the single dispatched modules on import.
from bigchaindb.backend.firestore import schema, query # noqa
| 40.214286
| 82
| 0.792185
| 71
| 563
| 6.253521
| 0.605634
| 0.114865
| 0.09009
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.115453
| 563
| 13
| 83
| 43.307692
| 0.891566
| 0.880995
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
a5417f1f0c285c582227c89127432a814a0feddf
| 43
|
py
|
Python
|
atcoder/corp/codefes2014relay_a.py
|
knuu/competitive-programming
|
16bc68fdaedd6f96ae24310d697585ca8836ab6e
|
[
"MIT"
] | 1
|
2018-11-12T15:18:55.000Z
|
2018-11-12T15:18:55.000Z
|
atcoder/corp/codefes2014relay_a.py
|
knuu/competitive-programming
|
16bc68fdaedd6f96ae24310d697585ca8836ab6e
|
[
"MIT"
] | null | null | null |
atcoder/corp/codefes2014relay_a.py
|
knuu/competitive-programming
|
16bc68fdaedd6f96ae24310d697585ca8836ab6e
|
[
"MIT"
] | null | null | null |
n = int(input())
print(0 if n == 1 else 1)
| 14.333333
| 25
| 0.55814
| 10
| 43
| 2.4
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 0.232558
| 43
| 2
| 26
| 21.5
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 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
| 1
|
0
| 4
|
a54ca6ce9a557ddbed9228b73210d5459bad2465
| 1,121
|
py
|
Python
|
hcl_translator/dynamodb2/__init__.py
|
clearcare/cc_hcl_translator
|
2515356fc75fe6adfa6ac0b1ceb51f588e0ee2a8
|
[
"Apache-2.0"
] | null | null | null |
hcl_translator/dynamodb2/__init__.py
|
clearcare/cc_hcl_translator
|
2515356fc75fe6adfa6ac0b1ceb51f588e0ee2a8
|
[
"Apache-2.0"
] | 1
|
2018-12-06T15:34:12.000Z
|
2018-12-06T15:34:13.000Z
|
hcl_translator/dynamodb2/__init__.py
|
clearcare/cc_hcl_translator
|
2515356fc75fe6adfa6ac0b1ceb51f588e0ee2a8
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import absolute_import
from .create_table import dynamodb2_create_table_translator
from .table import dynamodb2_table_translator
class Dynamodb2Translator(object):
"""
Just thin wrapper to combine dynamodb2_table_translator and
dynamodb2_create_table_translator.
"""
def __init__(self, dynamodb_tf, logger):
self.dynamodb_tf = dynamodb_tf
self.logger = logger
self.create_table_translator = dynamodb2_create_table_translator(self.dynamodb_tf, self.logger)
self.table_translator = dynamodb2_table_translator(self.dynamodb_tf, self.logger)
def create_table_args(self, table_name, namespace):
return self.create_table_translator.create_table_args(table_name, namespace)
def table_kwargs(self, table_name):
return self.table_translator.table_kwargs(table_name)
def get_table_index(self, table_name, index_name):
return self.table_translator.get_table_index(table_name, index_name)
def list_table_names(self):
return self.table_translator.list_table_names()
dynamodb2_translator = Dynamodb2Translator
| 35.03125
| 103
| 0.778769
| 141
| 1,121
| 5.758865
| 0.22695
| 0.221675
| 0.12931
| 0.110837
| 0.167488
| 0.096059
| 0.096059
| 0
| 0
| 0
| 0
| 0.009534
| 0.157895
| 1,121
| 31
| 104
| 36.16129
| 0.850636
| 0.083854
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.277778
| false
| 0
| 0.166667
| 0.222222
| 0.722222
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
a5ac3fa6a8a55aa8afe2b2f0175c52da36c60761
| 19
|
py
|
Python
|
rnn_model_init/init.py
|
brucegai/jd_text_analysis
|
48e2593c51026b48e7289e4b37af3ccb2ec552eb
|
[
"Apache-2.0"
] | 2
|
2018-04-05T15:41:06.000Z
|
2018-05-07T11:51:57.000Z
|
rnn_model_init/init.py
|
brucegai/jd_text_analysis
|
48e2593c51026b48e7289e4b37af3ccb2ec552eb
|
[
"Apache-2.0"
] | null | null | null |
rnn_model_init/init.py
|
brucegai/jd_text_analysis
|
48e2593c51026b48e7289e4b37af3ccb2ec552eb
|
[
"Apache-2.0"
] | null | null | null |
# RNN model init
| 6.333333
| 17
| 0.631579
| 3
| 19
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.315789
| 19
| 2
| 18
| 9.5
| 0.923077
| 0.736842
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3c1ceea9b1cf0d174632b5bc0949a46c6c8d3105
| 59
|
py
|
Python
|
src/test/resources/python-code-examples/import_from_var/pkg/core.py
|
florayym/depends
|
6c437a78268d91d54059b560c0273ae3c9253452
|
[
"BSD-3-Clause",
"MIT"
] | 146
|
2019-03-09T03:02:59.000Z
|
2022-03-28T11:28:41.000Z
|
src/test/resources/python-code-examples/import_from_var/pkg/core.py
|
florayym/depends
|
6c437a78268d91d54059b560c0273ae3c9253452
|
[
"BSD-3-Clause",
"MIT"
] | 27
|
2019-03-11T02:12:54.000Z
|
2021-12-21T00:24:13.000Z
|
src/test/resources/python-code-examples/import_from_var/pkg/core.py
|
florayym/depends
|
6c437a78268d91d54059b560c0273ae3c9253452
|
[
"BSD-3-Clause",
"MIT"
] | 41
|
2019-03-09T03:04:50.000Z
|
2022-01-14T06:53:14.000Z
|
class Core(object):
def foo(self):
pass
c = Core()
| 8.428571
| 19
| 0.576271
| 9
| 59
| 3.777778
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.271186
| 59
| 6
| 20
| 9.833333
| 0.790698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.25
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
3c3f23399982cc798dd8e548248c6ffe0573d1ba
| 201
|
py
|
Python
|
Aula 08.1 - Exercício 16 - Quebrando um número/ex016_.py
|
Guilherme-Artigas/Python-inicio
|
2d08cd53afa38435a75053459523b8187f6d52e6
|
[
"MIT"
] | null | null | null |
Aula 08.1 - Exercício 16 - Quebrando um número/ex016_.py
|
Guilherme-Artigas/Python-inicio
|
2d08cd53afa38435a75053459523b8187f6d52e6
|
[
"MIT"
] | null | null | null |
Aula 08.1 - Exercício 16 - Quebrando um número/ex016_.py
|
Guilherme-Artigas/Python-inicio
|
2d08cd53afa38435a75053459523b8187f6d52e6
|
[
"MIT"
] | null | null | null |
from math import floor
n = float(input('Digite qualquer número real/flutuante: '))
print('A parte inteira de {} é {} (nesse caso estamos considerando arredondamento para baixo!)'.format(n, floor(n)))
| 40.2
| 116
| 0.736318
| 29
| 201
| 5.103448
| 0.896552
| 0.081081
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.134328
| 201
| 4
| 117
| 50.25
| 0.850575
| 0
| 0
| 0
| 0
| 0
| 0.626866
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3c762ae772566c4ab0cfce464bbb51f468cebafd
| 695
|
py
|
Python
|
util/test/test_Constants.py
|
fxfactorial/tokenspice2
|
775ea00385c9057ce70660883d6d41879c13ab44
|
[
"Apache-2.0"
] | 3
|
2020-12-18T23:20:15.000Z
|
2021-05-22T12:10:18.000Z
|
util/test/test_Constants.py
|
marc4gov/tokenspice2
|
1993383674f35b20e11e54606b3dac8e4c05c0f9
|
[
"Apache-2.0"
] | 3
|
2021-01-06T21:58:59.000Z
|
2021-02-19T01:17:27.000Z
|
util/test/test_Constants.py
|
marc4gov/tokenspice2
|
1993383674f35b20e11e54606b3dac8e4c05c0f9
|
[
"Apache-2.0"
] | 5
|
2020-12-19T07:14:41.000Z
|
2021-02-16T19:56:06.000Z
|
from util.constants import *
def testINF():
assert (INF > 1.0)
def testSeconds():
assert (0 <
S_PER_MIN <
S_PER_HOUR <
S_PER_DAY <
S_PER_WEEK <
S_PER_MONTH <
S_PER_YEAR)
assert S_PER_HOUR == (60 * 60)
assert S_PER_WEEK == (60 * 60 * 24 * 7)
assert S_PER_YEAR == (60 * 60 * 24 * 365)
assert isinstance(S_PER_HOUR, int)
assert isinstance(S_PER_DAY, int)
assert isinstance(S_PER_WEEK, int)
assert isinstance(S_PER_MONTH, int)
assert isinstance(S_PER_YEAR, int)
def testTotalOceanSupply():
assert 1e6 < TOTAL_OCEAN_SUPPLY < 2e9
assert isinstance(TOTAL_OCEAN_SUPPLY, float)
| 24.821429
| 48
| 0.617266
| 98
| 695
| 4.05102
| 0.326531
| 0.141058
| 0.214106
| 0.251889
| 0.231738
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05499
| 0.293525
| 695
| 27
| 49
| 25.740741
| 0.753564
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.545455
| 1
| 0.136364
| true
| 0
| 0.045455
| 0
| 0.181818
| 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b1bcb78887d2d7499c1401afafc39867ef6c0090
| 87
|
py
|
Python
|
blobtest/blobui/apps.py
|
falinwang/dj4e-samples
|
f55f021a2901195975a7375000e9f2b7564f82ad
|
[
"MIT"
] | null | null | null |
blobtest/blobui/apps.py
|
falinwang/dj4e-samples
|
f55f021a2901195975a7375000e9f2b7564f82ad
|
[
"MIT"
] | null | null | null |
blobtest/blobui/apps.py
|
falinwang/dj4e-samples
|
f55f021a2901195975a7375000e9f2b7564f82ad
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class BlobuiConfig(AppConfig):
name = 'blobui'
| 14.5
| 33
| 0.747126
| 10
| 87
| 6.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 87
| 5
| 34
| 17.4
| 0.902778
| 0
| 0
| 0
| 0
| 0
| 0.068966
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b1bcba14256ea900f261dfc0ee1ade4d7cb83f25
| 585
|
py
|
Python
|
access/privileges.py
|
con2/kompassi
|
4938059b8f239ad5ecf06a526adf8b62bce52263
|
[
"CC-BY-3.0"
] | 13
|
2015-11-29T12:19:12.000Z
|
2021-02-21T15:42:11.000Z
|
access/privileges.py
|
con2/kompassi
|
4938059b8f239ad5ecf06a526adf8b62bce52263
|
[
"CC-BY-3.0"
] | 23
|
2015-04-29T19:43:34.000Z
|
2021-02-10T05:50:17.000Z
|
access/privileges.py
|
con2/kompassi
|
4938059b8f239ad5ecf06a526adf8b62bce52263
|
[
"CC-BY-3.0"
] | 11
|
2015-09-20T18:59:00.000Z
|
2020-02-07T08:47:34.000Z
|
from django.conf import settings
from django.contrib.auth.models import Group
from core.utils import ensure_user_group_membership
def invite_to_slack(privilege, person):
"""
Invites the user to Slack.
NOTE: Nowadays done via invite link, so the server-side invite method is noop.
"""
pass
def add_to_group(privilege, person):
"""
Generic "add person to group" privilege. The group to add is taken from the privilege slug.
"""
group = Group.objects.get(name=privilege.slug)
ensure_user_group_membership(person.user, groups_to_add=[group])
| 25.434783
| 95
| 0.731624
| 85
| 585
| 4.894118
| 0.494118
| 0.048077
| 0.072115
| 0.120192
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186325
| 585
| 22
| 96
| 26.590909
| 0.87395
| 0.338462
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0.125
| 0.375
| 0
| 0.625
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
b1bf60ebcd914cf23f8203ac3d42ad492fa65864
| 245
|
py
|
Python
|
real_estate_agency/address/admin.py
|
Dybov/real_estate_agency
|
a4392b18c5169ff89c3c7b63afe017f6ede0b431
|
[
"MIT"
] | 1
|
2017-09-24T18:53:59.000Z
|
2017-09-24T18:53:59.000Z
|
real_estate_agency/address/admin.py
|
Dybov/real_estate_agency
|
a4392b18c5169ff89c3c7b63afe017f6ede0b431
|
[
"MIT"
] | null | null | null |
real_estate_agency/address/admin.py
|
Dybov/real_estate_agency
|
a4392b18c5169ff89c3c7b63afe017f6ede0b431
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from .models import NeighbourhoodModel, StreetModel
@admin.register(StreetModel)
class StreetModelAdmin(admin.ModelAdmin):
pass
admin.site.register(NeighbourhoodModel)
# admin.site.register(StreetModel)
| 18.846154
| 51
| 0.816327
| 26
| 245
| 7.692308
| 0.538462
| 0.19
| 0.17
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.102041
| 245
| 12
| 52
| 20.416667
| 0.909091
| 0.130612
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 0.333333
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
b1f04c1327483626a64870b3f216f65924db7ac3
| 92
|
py
|
Python
|
2014/04/table-subminimum-wages/graphic_config.py
|
nprapps/graphics-archive
|
97b0ef326b46a959df930f5522d325e537f7a655
|
[
"FSFAP"
] | 14
|
2015-05-08T13:41:51.000Z
|
2021-02-24T12:34:55.000Z
|
2014/04/table-subminimum-wages/graphic_config.py
|
nprapps/graphics-archive
|
97b0ef326b46a959df930f5522d325e537f7a655
|
[
"FSFAP"
] | null | null | null |
2014/04/table-subminimum-wages/graphic_config.py
|
nprapps/graphics-archive
|
97b0ef326b46a959df930f5522d325e537f7a655
|
[
"FSFAP"
] | 7
|
2015-04-04T04:45:54.000Z
|
2021-02-18T11:12:48.000Z
|
#!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1DTjU8IM4rryCHOKXHAzz06egQV7jVVCJgpKoCXJyB18'
| 23
| 68
| 0.847826
| 9
| 92
| 8.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.093023
| 0.065217
| 92
| 3
| 69
| 30.666667
| 0.77907
| 0.217391
| 0
| 0
| 0
| 0
| 0.619718
| 0.619718
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
590066f1f6ba09f479469aa163e5adac778fb878
| 1,517
|
py
|
Python
|
camera.py
|
Cre8tion/Human-Tetris
|
eb8732778a44876a94c09d082b0d9930f0c1246e
|
[
"MIT"
] | null | null | null |
camera.py
|
Cre8tion/Human-Tetris
|
eb8732778a44876a94c09d082b0d9930f0c1246e
|
[
"MIT"
] | null | null | null |
camera.py
|
Cre8tion/Human-Tetris
|
eb8732778a44876a94c09d082b0d9930f0c1246e
|
[
"MIT"
] | null | null | null |
import cv2
import numpy as np
import backend
class VideoCamera(object):
def __init__(self):
# Using OpenCV to capture from device 0. If you have trouble capturing
# from a webcam, comment the line below out and use a video file
# instead.
self.video = cv2.VideoCapture(0)
# If you decide to use video.mp4, you must have this file in the folder
# as the main.py.
# self.video = cv2.VideoCapture('video.mp4')
def __del__(self):
self.video.release()
def get_frame(self):
return backend.load(self, imagename="Template1", save="webcam1")
def get_frame2(self):
return backend.load(self, imagename="Template2", save="webcam2")
def get_frame3(self):
return backend.load(self, imagename="Template3", save="webcam3")
def get_frame4(self):
return backend.load(self, imagename="Template4", save="webcam4")
def get_frame5(self):
return backend.load(self, imagename="Template5", save="webcam5")
def get_image(self):
return backend.loadpic(self, imagename="goodjob")
def get_default(self):
return backend.default(self)
def get_start(self):
return backend.loadpic(self, imagename="Hello")
def get_starting(self):
return backend.loadpic(self, imagename="Starting")
def get_end(self):
return backend.loadpic(self, imagename="End")
def get_saygoodbye(self):
return backend.loadpic(self, imagename="Saygoodbye")
| 28.622642
| 79
| 0.657877
| 194
| 1,517
| 5.046392
| 0.391753
| 0.067416
| 0.191011
| 0.107252
| 0.362615
| 0.362615
| 0
| 0
| 0
| 0
| 0
| 0.018057
| 0.233355
| 1,517
| 52
| 80
| 29.173077
| 0.823732
| 0.177324
| 0
| 0
| 0
| 0
| 0.091276
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.433333
| false
| 0
| 0.1
| 0.366667
| 0.933333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
593facf50df245ef340aad77bdacbb766e31a800
| 90
|
py
|
Python
|
batch_tr/__init__.py
|
ffreemt/batch-tr
|
071c3a2a1882fbce182b7b957b564090fbc4e4bd
|
[
"MIT"
] | 1
|
2021-07-22T08:41:48.000Z
|
2021-07-22T08:41:48.000Z
|
batch_tr/__init__.py
|
ffreemt/batch-tr
|
071c3a2a1882fbce182b7b957b564090fbc4e4bd
|
[
"MIT"
] | null | null | null |
batch_tr/__init__.py
|
ffreemt/batch-tr
|
071c3a2a1882fbce182b7b957b564090fbc4e4bd
|
[
"MIT"
] | null | null | null |
"""Init."""
__version__ = "0.1.0"
from .batch_tr import batch_tr
__all__ = ("batch_tr",)
| 15
| 30
| 0.655556
| 14
| 90
| 3.428571
| 0.642857
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038462
| 0.133333
| 90
| 5
| 31
| 18
| 0.576923
| 0.055556
| 0
| 0
| 0
| 0
| 0.164557
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3cac31a9d87ba9c4f873782de56ccb9bb2c9b52a
| 215
|
py
|
Python
|
nebula_sniffer/nebula_sniffer/befilteredexception.py
|
imAkaka/sniffer
|
d2c3f67e7cabc43ccad0e2b76861b12bd6c49553
|
[
"Apache-2.0"
] | 18
|
2019-03-11T08:01:17.000Z
|
2021-12-01T16:31:56.000Z
|
nebula_sniffer/nebula_sniffer/befilteredexception.py
|
imAkaka/sniffer
|
d2c3f67e7cabc43ccad0e2b76861b12bd6c49553
|
[
"Apache-2.0"
] | 5
|
2019-05-15T06:29:43.000Z
|
2021-12-13T19:56:31.000Z
|
nebula_sniffer/nebula_sniffer/befilteredexception.py
|
imAkaka/sniffer
|
d2c3f67e7cabc43ccad0e2b76861b12bd6c49553
|
[
"Apache-2.0"
] | 28
|
2019-03-11T11:21:51.000Z
|
2020-11-15T15:22:55.000Z
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "nebula"
class BeFilteredException(Exception):
def __init__(self, t):
self._t = t
@property
def type(self):
return self._t
| 14.333333
| 37
| 0.595349
| 26
| 215
| 4.538462
| 0.730769
| 0.127119
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006289
| 0.260465
| 215
| 14
| 38
| 15.357143
| 0.735849
| 0.195349
| 0
| 0
| 0
| 0
| 0.035088
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0
| 0.142857
| 0.571429
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
3cb39a7903c2dbade9bee63dc94d22b4f1093942
| 93
|
py
|
Python
|
foodalert/apps.py
|
uw-it-aca/uw-foodalert
|
14b56fa305310b81c2a526edda5e19b105cd64a1
|
[
"Apache-2.0"
] | 4
|
2018-08-15T18:38:45.000Z
|
2022-02-24T16:58:17.000Z
|
foodalert/apps.py
|
uw-it-aca/uw-foodalert
|
14b56fa305310b81c2a526edda5e19b105cd64a1
|
[
"Apache-2.0"
] | 202
|
2018-08-15T17:08:41.000Z
|
2022-03-03T22:24:53.000Z
|
foodalert/apps.py
|
uw-it-aca/uw-foodalert
|
14b56fa305310b81c2a526edda5e19b105cd64a1
|
[
"Apache-2.0"
] | null | null | null |
from django.apps import AppConfig
class FoodalertConfig(AppConfig):
name = 'foodalert'
| 15.5
| 33
| 0.763441
| 10
| 93
| 7.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.16129
| 93
| 5
| 34
| 18.6
| 0.910256
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3cb41382b9e06840c983def8ec89d6dda92fc306
| 116
|
py
|
Python
|
tagout/__init__.py
|
gesslerpd/tagout
|
dc3ce15e9b2bf0f44ffb72e0d105b491badecccd
|
[
"MIT"
] | 1
|
2021-02-04T08:14:01.000Z
|
2021-02-04T08:14:01.000Z
|
tagout/__init__.py
|
gesslerpd/tagout
|
dc3ce15e9b2bf0f44ffb72e0d105b491badecccd
|
[
"MIT"
] | null | null | null |
tagout/__init__.py
|
gesslerpd/tagout
|
dc3ce15e9b2bf0f44ffb72e0d105b491badecccd
|
[
"MIT"
] | null | null | null |
"""tagout - A small, pythonic, HTML/XML writer."""
from ._document import Document
from ._utils import class_names
| 23.2
| 50
| 0.75
| 16
| 116
| 5.25
| 0.8125
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137931
| 116
| 4
| 51
| 29
| 0.84
| 0.37931
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3cb5083b148fbed3b197c0475c85d2bc4665ce97
| 75
|
py
|
Python
|
lang/Python/greatest-common-divisor-3.py
|
ethansaxenian/RosettaDecode
|
8ea1a42a5f792280b50193ad47545d14ee371fb7
|
[
"MIT"
] | 5
|
2021-01-29T20:08:05.000Z
|
2022-03-22T06:16:05.000Z
|
lang/Python/greatest-common-divisor-3.py
|
ethansaxenian/RosettaDecode
|
8ea1a42a5f792280b50193ad47545d14ee371fb7
|
[
"MIT"
] | null | null | null |
lang/Python/greatest-common-divisor-3.py
|
ethansaxenian/RosettaDecode
|
8ea1a42a5f792280b50193ad47545d14ee371fb7
|
[
"MIT"
] | 1
|
2021-04-13T04:19:31.000Z
|
2021-04-13T04:19:31.000Z
|
def gcd_iter(u, v):
while v:
u, v = v, u % v
return abs(u)
| 15
| 23
| 0.453333
| 15
| 75
| 2.2
| 0.533333
| 0.181818
| 0.181818
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.4
| 75
| 4
| 24
| 18.75
| 0.733333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.5
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3ccb401b9ed8aaebb7e667d84e93c41a8fa8496f
| 109
|
py
|
Python
|
baselines/pgpe/iw_pgpe.py
|
T3p/baselines
|
5623c9160d1e86ebca3e673f142fe6b14a1db06c
|
[
"MIT"
] | 2
|
2020-08-01T18:19:05.000Z
|
2021-06-30T06:37:23.000Z
|
baselines/pgpe/iw_pgpe.py
|
T3p/baselines
|
5623c9160d1e86ebca3e673f142fe6b14a1db06c
|
[
"MIT"
] | null | null | null |
baselines/pgpe/iw_pgpe.py
|
T3p/baselines
|
5623c9160d1e86ebca3e673f142fe6b14a1db06c
|
[
"MIT"
] | 5
|
2018-11-24T16:29:39.000Z
|
2021-12-10T03:07:07.000Z
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 5 16:02:48 2018
@author: matteo
"""
| 12.111111
| 35
| 0.587156
| 18
| 109
| 3.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147727
| 0.192661
| 109
| 8
| 36
| 13.625
| 0.579545
| 0.880734
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3ccc3cad5b8d9f9074e488e2eb0f985cd200872d
| 12,219
|
py
|
Python
|
src/async_spotify/api/_endpoints/playlists.py
|
wackazong/AsyncSpotify
|
2789331bac471327738a4fec13e3d106c1da0ea1
|
[
"MIT"
] | 26
|
2020-04-01T14:16:28.000Z
|
2022-02-23T18:28:23.000Z
|
src/async_spotify/api/_endpoints/playlists.py
|
wackazong/AsyncSpotify
|
2789331bac471327738a4fec13e3d106c1da0ea1
|
[
"MIT"
] | 18
|
2020-05-11T09:55:18.000Z
|
2022-03-15T15:58:51.000Z
|
src/async_spotify/api/_endpoints/playlists.py
|
wackazong/AsyncSpotify
|
2789331bac471327738a4fec13e3d106c1da0ea1
|
[
"MIT"
] | 10
|
2020-04-02T13:11:55.000Z
|
2022-02-16T14:34:36.000Z
|
"""
Module with the playlists endpoint
"""
# ##################################################################################################
# Copyright (c) 2020. HuiiBuh #
# This file (playlist.py) is part of AsyncSpotify which is released under MIT. #
# You are not allowed to use this code or this file for another project without #
# linking to the original source. #
# ##################################################################################################
import base64
from typing import List, Dict, Any, Union
from .endpoint import Endpoint
from .urls import URLS
from ...authentification.spotify_authorization_token import SpotifyAuthorisationToken
class Playlists(Endpoint):
"""
Playlist endpoint
"""
async def add_tracks(self, playlist_id: str, spotify_uris: List[str], position: int = None,
auth_token: SpotifyAuthorisationToken = None) -> None:
"""
Add one or more tracks to a user’s playlist.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/add-tracks-to-playlist/](https://developer.spotify.com/documentation/web-api/reference/playlists/add-tracks-to-playlist/)
Args:
position: The position to insert the items, a zero-based index. Appended if omitted
spotify_uris: A list of spotify uris
playlist_id: The id of the playlist
auth_token: The auth token if you set the api class not to keep the token in memory
"""
body = {
'uris': spotify_uris
}
if position is not None:
body['position'] = position
url, _ = self._add_url_params(URLS.PLAYLIST.ADD_TRACKS, {'playlist_id': playlist_id})
await self.api_request_handler.make_request('POST', url, {}, auth_token, body=body)
async def change_details(self, playlist_id: str, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> None:
"""
Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/change-playlist-details/](https://developer.spotify.com/documentation/web-api/reference/playlists/change-playlist-details/)
Args:
playlist_id: The id of the playlist
auth_token: The auth token if you set the api class not to keep the token in memory
kwargs: Optional arguments as keyword args
"""
url, _ = self._add_url_params(URLS.PLAYLIST.ONE, {'playlist_id': playlist_id})
await self.api_request_handler.make_request('PUT', url, {}, auth_token, body=kwargs)
async def create_playlist(self, user_id: str, playlist_name: str, auth_token: SpotifyAuthorisationToken = None,
**kwargs) -> dict:
"""
Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/create-playlist/](https://developer.spotify.com/documentation/web-api/reference/playlists/create-playlist/)
Args:
user_id: The id of the user
playlist_name: THe name of the playlist
auth_token: The auth token if you set the api class not to keep the token in memory
kwargs: Optional arguments as keyword args
"""
url, _ = self._add_url_params(URLS.PLAYLIST.CREATE, {'user_id': user_id})
return await self.api_request_handler.make_request('POST', url, {}, auth_token,
body={**{'name': playlist_name}, **kwargs})
async def current_get_all(self, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> dict:
"""
Get a list of the playlists owned or followed by the current Spotify user.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/get-a-list-of-current-users-playlists/](https://developer.spotify.com/documentation/web-api/reference/playlists/get-a-list-of-current-users-playlists/)
Args:
auth_token: The auth token if you set the api class not to keep the token in memory
kwargs: Optional arguments as keyword args
Returns:
A List of Current User's Playlists
"""
return await self.api_request_handler.make_request('GET', URLS.PLAYLIST.ME, kwargs, auth_token)
async def get_user_all(self, user_id: str, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> dict:
"""
Get a list of the playlists owned or followed by a Spotify user.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/get-list-users-playlists/](https://developer.spotify.com/documentation/web-api/reference/playlists/get-list-users-playlists/)
Args:
user_id: The id of the spotify user
auth_token: The auth token if you set the api class not to keep the token in memory
kwargs: Optional arguments as keyword args
Returns:
A List of a User's Playlists
"""
url, _ = self._add_url_params(URLS.PLAYLIST.USER, {'user_id': user_id})
return await self.api_request_handler.make_request('GET', url, kwargs, auth_token)
async def get_one(self, playlist_id: str, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> dict:
"""
Get a playlist owned by a Spotify user.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist/](https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist/)
Args:
playlist_id: The id of the Playlist
auth_token: The auth token if you set the api class not to keep the token in memory
kwargs: Optional arguments as keyword args
Returns:
A Playlist
"""
url, _ = self._add_url_params(URLS.PLAYLIST.ONE, {'playlist_id': playlist_id})
return await self.api_request_handler.make_request('GET', url, kwargs, auth_token)
async def get_cover(self, playlist_id: str, auth_token: SpotifyAuthorisationToken = None) -> dict:
"""
Get the current image associated with a specific playlist.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist-cover/](https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlist-cover/)
Args:
playlist_id: The id of the Playlist
auth_token: The auth token if you set the api class not to keep the token in memory
Returns:
The cover image
"""
url, _ = self._add_url_params(URLS.PLAYLIST.COVER, {'playlist_id': playlist_id})
return await self.api_request_handler.make_request('GET', url, {}, auth_token)
async def get_tracks(self, playlist_id: str, auth_token: SpotifyAuthorisationToken = None, **kwargs) -> dict:
"""
Get full details of the tracks or episodes of a playlist owned by a Spotify user.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlists-tracks/](https://developer.spotify.com/documentation/web-api/reference/playlists/get-playlists-tracks/)
Args:
playlist_id: The id of the Playlist
auth_token: The auth token if you set the api class not to keep the token in memory
kwargs: Optional arguments as keyword args
Returns:
The cover image
"""
args = {**{'playlist_id': playlist_id}, **kwargs}
url, args = self._add_url_params(URLS.PLAYLIST.TRACKS, args)
return await self.api_request_handler.make_request('GET', url, args, auth_token)
async def remove_tracks(self, playlist_id: str, spotify_uris: Dict[str, List[Dict[str, Any]]],
auth_token: SpotifyAuthorisationToken = None) -> None:
"""
Remove one or more items from a user’s playlist.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/remove-tracks-playlist/](https://developer.spotify.com/documentation/web-api/reference/playlists/remove-tracks-playlist/)
Args:
playlist_id: The id of the playlist
spotify_uris: A dict with a list of spotify uris in the tracks key
auth_token: The auth token if you set the api class not to keep the token in memory
"""
url, _ = self._add_url_params(URLS.PLAYLIST.ADD_TRACKS, {'playlist_id': playlist_id})
await self.api_request_handler.make_request('DELETE', url, {}, auth_token, body=spotify_uris)
async def reorder_tracks(self, playlist_id: str, position_dict: Dict[str, Union[int, str]], snapshot_id: str = None,
auth_token: SpotifyAuthorisationToken = None) -> dict:
"""
Reorder an item or a group of items in a playlist.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/reorder-playlists-tracks/](https://developer.spotify.com/documentation/web-api/reference/playlists/reorder-playlists-tracks/)
Args:
playlist_id: The playlist id
position_dict: The dict which reorders the tracks
snapshot_id: The playlist’s snapshot ID against which you want to make the changes.
auth_token: The auth token if you set the api class not to keep the token in memory
Returns:
A json with the snapshot_id
"""
url, _ = self._add_url_params(URLS.PLAYLIST.TRACKS, {'playlist_id': playlist_id})
body = position_dict
if snapshot_id:
body['snapshot_id'] = snapshot_id
return await self.api_request_handler.make_request('PUT', url, {}, auth_token, body=body)
async def replace_tracks(self, playlist_id: str, spotify_uris: List[str],
auth_token: SpotifyAuthorisationToken = None) -> None:
"""
Replace all the items in a playlist, overwriting its existing items. This powerful request can be useful for
replacing items, re-ordering existing items, or clearing the playlist.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/replace-playlists-tracks/](https://developer.spotify.com/documentation/web-api/reference/playlists/replace-playlists-tracks/)
Args:
spotify_uris: A list of spotify uris
playlist_id: The id of the playlist
auth_token: The auth token if you set the api class not to keep the token in memory
"""
body = {
'uris': spotify_uris
}
url, _ = self._add_url_params(URLS.PLAYLIST.ADD_TRACKS, {'playlist_id': playlist_id})
await self.api_request_handler.make_request('PUT', url, {}, auth_token, body=body)
async def upload_cover(self, playlist_id: str, base_64_image: base64,
auth_token: SpotifyAuthorisationToken = None) -> None:
"""
Replace the image used to represent a specific playlist.
Notes:
[https://developer.spotify.com/documentation/web-api/reference/playlists/upload-custom-playlist-cover/](https://developer.spotify.com/documentation/web-api/reference/playlists/upload-custom-playlist-cover/)
Args:
playlist_id: The id of the playlist
base_64_image: Base64 encoded JPEG image data, maximum payload size is 256 KB
auth_token: The auth token if you set the api class not to keep the token in memory
"""
url, _ = self._add_url_params(URLS.PLAYLIST.COVER, {'playlist_id': playlist_id})
await self.api_request_handler.make_request('PUT', url, {}, auth_token, base_64_image)
| 46.460076
| 236
| 0.642115
| 1,531
| 12,219
| 4.990856
| 0.110385
| 0.056537
| 0.06596
| 0.075383
| 0.788509
| 0.755529
| 0.737076
| 0.705798
| 0.6986
| 0.66863
| 0
| 0.002075
| 0.250593
| 12,219
| 262
| 237
| 46.637405
| 0.832369
| 0.031181
| 0
| 0.283333
| 0
| 0
| 0.040087
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.083333
| 0
| 0.216667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3cfde3cb4b659d1345704759036c2fc19106f936
| 331
|
py
|
Python
|
omni_cv_rules/place_holder/torch_proxy.py
|
proboscis/omni-cv-rules
|
0a3d4763c0c50bc32974a16531b3d0a1d396c05a
|
[
"MIT"
] | 2
|
2022-01-28T13:37:08.000Z
|
2022-03-03T20:29:20.000Z
|
omni_cv_rules/place_holder/torch_proxy.py
|
proboscis/omni-cv-rules
|
0a3d4763c0c50bc32974a16531b3d0a1d396c05a
|
[
"MIT"
] | null | null | null |
omni_cv_rules/place_holder/torch_proxy.py
|
proboscis/omni-cv-rules
|
0a3d4763c0c50bc32974a16531b3d0a1d396c05a
|
[
"MIT"
] | null | null | null |
class RealTorchProxy:
@property
def torch(self):
import torch
return torch
def from_numpy(self, ary):
return self.torch.from_numpy(ary)
def cat(self,ary,dim):
return self.torch.cat(ary,dim)
def tensor(self,ary):
return self.torch.tensor(ary)
torch = RealTorchProxy()
| 19.470588
| 41
| 0.628399
| 43
| 331
| 4.790698
| 0.325581
| 0.101942
| 0.218447
| 0.165049
| 0.213592
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.268882
| 331
| 16
| 42
| 20.6875
| 0.85124
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.083333
| 0.25
| 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
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
a70a0593e6e4e2a2014cf0a77e26261b23b76c66
| 22,384
|
py
|
Python
|
diana/object_update.py
|
djeebus/libdiana
|
c1c8f9caf5b53740f6946633b1c9e876ec7c72a5
|
[
"MIT"
] | 4
|
2015-01-06T02:14:48.000Z
|
2021-04-12T00:10:31.000Z
|
diana/object_update.py
|
djeebus/libdiana
|
c1c8f9caf5b53740f6946633b1c9e876ec7c72a5
|
[
"MIT"
] | null | null | null |
diana/object_update.py
|
djeebus/libdiana
|
c1c8f9caf5b53740f6946633b1c9e876ec7c72a5
|
[
"MIT"
] | 5
|
2015-05-29T20:14:23.000Z
|
2019-12-25T07:15:07.000Z
|
from .encoding import decode as unpack
from .enumerations import *
def unscramble_elites(field):
return {ability for ability in EliteAbility
if ability.value & field}
def decode_obj_update_packet(packet):
entries = []
while packet:
update_type = packet[0]
obj = {}
if update_type == 0x00:
break
elif update_type == 0x01:
_id, oid, fields_1, fields_2, fields_3, fields_4, fields_5, packet = unpack('BIBBBBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.player_vessel
if fields_1 & 0x01:
obj['tgt-weapons'], packet = unpack('I*', packet)
if fields_1 & 0x02:
obj['impulse'], packet = unpack('f*', packet)
if fields_1 & 0x04:
obj['rudder'], packet = unpack('f*', packet)
if fields_1 & 0x08:
obj['top-speed'], packet = unpack('f*', packet)
if fields_1 & 0x10:
obj['turn-rate'], packet = unpack('f*', packet)
if fields_1 & 0x20:
ab, packet = unpack('B*', packet)
obj['auto-beams'] = bool(ab)
if fields_1 & 0x40:
obj['warp'], packet = unpack('B*', packet)
if fields_1 & 0x80:
obj['energy'], packet = unpack('f*', packet)
if fields_2 & 0x01:
obj['shields-state'], packet = unpack('s*', packet)
if fields_2 & 0x02:
obj['index'], packet = unpack('I*', packet)
if fields_2 & 0x04:
obj['vtype'], packet = unpack('I*', packet)
if fields_2 & 0x08:
obj['x'], packet = unpack('f*', packet)
if fields_2 & 0x10:
obj['y'], packet = unpack('f*', packet)
if fields_2 & 0x20:
obj['z'], packet = unpack('f*', packet)
if fields_2 & 0x40:
obj['pitch'], packet = unpack('f*', packet)
if fields_2 & 0x80:
obj['roll'], packet = unpack('f*', packet)
if fields_3 & 0x01:
obj['heading'], packet = unpack('f*', packet)
if fields_3 & 0x02:
obj['speed'], packet = unpack('f*', packet)
if fields_3 & 0x04:
_unk, packet = unpack('S*', packet)
if fields_3 & 0x08:
obj['name'], packet = unpack('u*', packet)
if fields_3 & 0x10:
obj['shields'], packet = unpack('f*', packet)
if fields_3 & 0x20:
obj['shields-max'], packet = unpack('f*', packet)
if fields_3 & 0x40:
obj['shields-aft'], packet = unpack('f*', packet)
if fields_3 & 0x80:
obj['shields-aft-max'], packet = unpack('f*', packet)
if fields_4 & 0x01:
obj['docked'], packet = unpack('I*', packet)
if fields_4 & 0x02:
red_alert, packet = unpack('B*', packet)
obj['red-alert'] = bool(red_alert)
if fields_4 & 0x04:
packet = packet[4:]
if fields_4 & 0x08:
ms, packet = unpack('B*', packet)
obj['main-view'] = MainView(ms)
if fields_4 & 0x10:
obj['beam-frequency'], packet = unpack('B*', packet)
if fields_4 & 0x20:
obj['coolant-avail'], packet = unpack('B*', packet)
if fields_4 & 0x40:
obj['tgt-science'], packet = unpack('I*', packet)
if fields_4 & 0x80:
obj['tgt-captain'], packet = unpack('I*', packet)
if fields_5 & 0x01:
dt, packet = unpack('B*', packet)
obj['drive-type'] = DriveType(dt)
if fields_5 & 0x02:
obj['tgt-scan'], packet = unpack('I*', packet)
if fields_5 & 0x04:
obj['scan-progress'], packet = unpack('f*', packet)
if fields_5 & 0x08:
rv, packet = unpack('B*', packet)
obj['reverse'] = bool(rv)
if fields_5 & 0x10:
packet = packet[4:]
if fields_5 & 0x20:
packet = packet[1:]
if fields_5 & 0x40:
packet = packet[4:]
if fields_5 & 0x80:
raise ValueError('Unknown data keys for player vessel')
elif update_type == 0x02:
_id, oid, fields_1, fields_2, fields_3, packet = unpack('BIBBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.weapons_console
if fields_1 & 0x01: # TODO: use the enum here
obj['store-missile'], packet = unpack('B*', packet)
if fields_1 & 0x02:
obj['store-nuke'], packet = unpack('B*', packet)
if fields_1 & 0x04:
obj['store-mine'], packet = unpack('B*', packet)
if fields_1 & 0x08:
obj['store-emp'], packet = unpack('B*', packet)
if fields_1 & 0x10:
packet = packet[1:]
if fields_1 & 0x20:
obj['load-time-0'], packet = unpack('f*', packet)
if fields_1 & 0x40:
obj['load-time-1'], packet = unpack('f*', packet)
if fields_1 & 0x80:
obj['load-time-2'], packet = unpack('f*', packet)
if fields_2 & 0x01:
obj['load-time-3'], packet = unpack('f*', packet)
if fields_2 & 0x02:
obj['load-time-4'], packet = unpack('f*', packet)
if fields_2 & 0x04:
obj['load-time-5'], packet = unpack('f*', packet)
if fields_2 & 0x08:
ts, packet = unpack('B*', packet)
obj['status-0'] = TubeStatus(ts)
if fields_2 & 0x10:
ts, packet = unpack('B*', packet)
obj['status-1'] = TubeStatus(ts)
if fields_2 & 0x20:
ts, packet = unpack('B*', packet)
obj['status-2'] = TubeStatus(ts)
if fields_2 & 0x40:
ts, packet = unpack('B*', packet)
obj['status-3'] = TubeStatus(ts)
if fields_2 & 0x80:
ts, packet = unpack('B*', packet)
obj['status-4'] = TubeStatus(ts)
if fields_3 & 0x01:
ts, packet = unpack('B*', packet)
obj['status-5'] = TubeStatus(ts)
if fields_3 & 0x02:
ot, packet = unpack('B*', packet)
obj['contents-0'] = OrdnanceType(ot)
if fields_3 & 0x04:
ot, packet = unpack('B*', packet)
obj['contents-1'] = OrdnanceType(ot)
if fields_3 & 0x08:
ot, packet = unpack('B*', packet)
obj['contents-2'] = OrdnanceType(ot)
if fields_3 & 0x10:
ot, packet = unpack('B*', packet)
obj['contents-3'] = OrdnanceType(ot)
if fields_3 & 0x20:
ot, packet = unpack('B*', packet)
obj['contents-4'] = OrdnanceType(ot)
if fields_3 & 0x40:
ot, packet = unpack('B*', packet)
obj['contents-5'] = OrdnanceType(ot)
if fields_3 & 0x80:
raise ValueError('Unknown fields for weapons console')
elif update_type == 0x03:
_id, oid, fields_heat, fields_enrg, fields_coolant, fields_unk, packet = unpack('BIBBBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.engineering_console
if fields_unk:
raise ValueError('Undecodable fields in engineering status')
systems = (('beams', 0x01),
('torps', 0x02),
('sensors', 0x04),
('maneuvering', 0x08),
('impulse', 0x10),
('warp', 0x20),
('shields', 0x40),
('shields-aft', 0x80))
types = (('heat', fields_heat, 'f'),
('energy', fields_enrg, 'f'),
('coolant', fields_coolant, 'B'))
for status, mask, fmt in types:
for syst, flag in systems:
if fields_heat & flag:
obj['{}-{}'.format(status, syst)], packet = unpack(fmt + '*', packet)
elif update_type == 0x04:
_id, oid, fields_1, fields_2, fields_3, fields_4, fields_5, fields_6, packet = unpack('BIBBBBBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.other_ship
if fields_1 & 0x01:
obj['name'], packet = unpack('u*', packet)
if fields_1 & 0x02:
packet = packet[4:]
if fields_1 & 0x04:
obj['rudder'], packet = unpack('f*', packet)
if fields_1 & 0x08:
obj['max-impulse'], packet = unpack('f*', packet)
if fields_1 & 0x10:
obj['max-turn-rate'], packet = unpack('f*', packet)
if fields_1 & 0x20:
fef, packet = unpack('I*', packet)
obj['iff-friendly'] = not bool(fef)
if fields_1 & 0x40:
obj['vtype'], packet = unpack('I*', packet)
if fields_1 & 0x80:
obj['x'], packet = unpack('f*', packet)
if fields_2 & 0x01:
obj['y'], packet = unpack('f*', packet)
if fields_2 & 0x02:
obj['z'], packet = unpack('f*', packet)
if fields_2 & 0x04:
obj['pitch'], packet = unpack('f*', packet)
if fields_2 & 0x08:
obj['roll'], packet = unpack('f*', packet)
if fields_2 & 0x10:
obj['heading'], packet = unpack('f*', packet)
if fields_2 & 0x20:
obj['speed'], packet = unpack('f*', packet)
if fields_2 & 0x40:
surr, packet = unpack('B*', packet)
obj['surrender'] = bool(surr)
if fields_2 & 0x80:
packet = packet[2:]
if fields_3 & 0x01:
obj['shields'], packet = unpack('f*', packet)
if fields_3 & 0x02:
obj['shields-max'], packet = unpack('f*', packet)
if fields_3 & 0x04:
obj['shields-aft'], packet = unpack('f*', packet)
if fields_3 & 0x08:
obj['shields-aft-max'], packet = unpack('f*', packet)
if fields_3 & 0x10:
packet = packet[2:]
if fields_3 & 0x20:
packet = packet[1:]
if fields_3 & 0x40:
elt, packet = unpack('I*', packet)
obj['elite'] = unscramble_elites(elt)
if fields_3 & 0x80:
elt, packet = unpack('I*', packet)
obj['elite-active'] = unscramble_elites(elt)
if fields_4 & 0x01:
scn, packet = unpack('I*', packet)
obj['scanned'] = bool(scn)
if fields_4 & 0x02:
obj['iff-side'], packet = unpack('I*', packet)
if fields_4 & 0x04:
packet = packet[4:]
if fields_4 & 0x08:
packet = packet[1:]
if fields_4 & 0x10:
packet = packet[1:]
if fields_4 & 0x20:
packet = packet[1:]
if fields_4 & 0x40:
packet = packet[1:]
if fields_4 & 0x80:
packet = packet[4:]
if fields_5 & 0x01:
packet = packet[4:]
if fields_5 & 0x02:
packet = packet[4:]
if fields_5 & 0x04:
obj['damage-beams'], packet = unpack('f*', packet)
if fields_5 & 0x08:
obj['damage-tubes'], packet = unpack('f*', packet)
if fields_5 & 0x10:
obj['damage-sensors'], packet = unpack('f*', packet)
if fields_5 & 0x20:
obj['damage-maneuvering'], packet = unpack('f*', packet)
if fields_5 & 0x40:
obj['damage-impulse'], packet = unpack('f*', packet)
if fields_5 & 0x80:
obj['damage-warp'], packet = unpack('f*', packet)
if fields_6 & 0x01:
obj['damage-shields'], packet = unpack('f*', packet)
if fields_6 & 0x02:
obj['damage-shields'], packet = unpack('f*', packet)
if fields_6 & 0x04:
obj['shields-0'], packet = unpack('f*', packet)
if fields_6 & 0x08:
obj['shields-1'], packet = unpack('f*', packet)
if fields_6 & 0x10:
obj['shields-2'], packet = unpack('f*', packet)
if fields_6 & 0x20:
obj['shields-3'], packet = unpack('f*', packet)
if fields_6 & 0x40:
obj['shields-4'], packet = unpack('f*', packet)
if fields_6 & 0x80:
raise ValueError('Unknown data key for NPC')
elif update_type == 0x05:
_id, oid, fields_1, fields_2, packet = unpack('BIBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.base
if fields_1 & 0x01:
obj['name'], packet = unpack('u*', packet)
if fields_1 & 0x02:
obj['shields'], packet = unpack('f*', packet)
if fields_1 & 0x04:
obj['shields-aft'], packet = unpack('f*', packet)
if fields_1 & 0x08:
obj['index'], packet = unpack('I*', packet)
if fields_1 & 0x10:
obj['vtype'], packet = unpack('I*', packet)
if fields_1 & 0x20:
obj['x'], packet = unpack('f*', packet)
if fields_1 & 0x40:
obj['y'], packet = unpack('f*', packet)
if fields_1 & 0x80:
obj['z'], packet = unpack('f*', packet)
if fields_2 & 0x01:
packet = packet[4:]
if fields_2 & 0x02:
packet = packet[4:]
if fields_2 & 0x04:
packet = packet[4:]
if fields_2 & 0x08:
packet = packet[4:]
if fields_2 & 0x10:
packet = packet[1:]
if fields_2 & 0x20:
packet = packet[1:]
if fields_2 & 0xc0:
raise ValueError('Unknown data keys for base')
elif update_type == 0x06:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.mine
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
packet = packet[4:]
if fields & 0x10:
packet = packet[4:]
if fields & 0x20:
packet = packet[4:]
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x07:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.anomaly
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
obj['name'], packet = unpack('u*', packet)
if fields & 0x10:
packet = packet[4:]
if fields & 0x20:
packet = packet[4:]
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x09:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.nebula
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
obj['red'], packet = unpack('f*', packet)
if fields & 0x10:
obj['green'], packet = unpack('f*', packet)
if fields & 0x20:
obj['blue'], packet = unpack('f*', packet)
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x0a:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.torpedo
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
packet = packet[4:]
if fields & 0x10:
packet = packet[4:]
if fields & 0x20:
packet = packet[4:]
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x0b:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.blackhole
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
packet = packet[4:]
if fields & 0x10:
packet = packet[4:]
if fields & 0x20:
packet = packet[4:]
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x0c:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.asteroid
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
packet = packet[4:]
if fields & 0x10:
packet = packet[4:]
if fields & 0x20:
packet = packet[4:]
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x0e:
_id, oid, fields, packet = unpack('BIB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.monster
if fields & 0x01:
obj['x'], packet = unpack('f*', packet)
if fields & 0x02:
obj['y'], packet = unpack('f*', packet)
if fields & 0x04:
obj['z'], packet = unpack('f*', packet)
if fields & 0x08:
obj['name'], packet = unpack('u*', packet)
if fields & 0x10:
packet = packet[4:]
if fields & 0x20:
packet = packet[4:]
if fields & 0x40:
packet = packet[4:]
if fields & 0x80:
packet = packet[4:]
elif update_type == 0x0f:
_id, oid, fields_1, fields_2, packet = unpack('BIBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.whale
if fields_1 & 0x01:
obj['name'], packet = unpack('u*', packet)
if fields_1 & 0x02:
packet = packet[4:]
if fields_1 & 0x04:
packet = packet[4:]
if fields_1 & 0x08:
obj['x'], packet = unpack('f*', packet)
if fields_1 & 0x10:
obj['y'], packet = unpack('f*', packet)
if fields_1 & 0x20:
obj['z'], packet = unpack('f*', packet)
if fields_1 & 0x40:
obj['pitch'], packet = unpack('f*', packet)
if fields_1 & 0x80:
obj['roll'], packet = unpack('f*', packet)
if fields_2 & 0x01:
obj['heading'], packet = unpack('f*', packet)
if fields_2 & 0x02:
packet = packet[4:]
if fields_2 & 0x04:
packet = packet[4:]
if fields_2 & 0x08:
packet = packet[4:]
if fields_2 & 0x10:
packet = packet[4:]
if fields_2 & 0xe0:
raise ValueError('Unknown data keys for whale')
elif update_type == 0x10:
_id, oid, fields_1, fields_2, packet = unpack('BIBB*', packet)
obj['object'] = oid
obj['type'] = ObjectType.drone
if fields_1 & 0x01:
packet = packet[4:]
if fields_1 & 0x02:
obj['x'], packet = unpack('f*', packet)
if fields_1 & 0x04:
packet = packet[4:]
if fields_1 & 0x08:
obj['z'], packet = unpack('f*', packet)
if fields_1 & 0x10:
packet = packet[4:]
if fields_1 & 0x20:
obj['y'], packet = unpack('f*', packet)
if fields_1 & 0x40:
obj['heading'], packet = unpack('f*', packet)
if fields_1 & 0x80:
packet = packet[4:]
if fields_2:
raise ValueError('Unknown data keys for drone')
else:
raise ValueError('Unknown object type {}'.format(update_type))
entries.append(obj)
return entries
| 42.474383
| 118
| 0.450456
| 2,383
| 22,384
| 4.137642
| 0.079312
| 0.168763
| 0.163286
| 0.171501
| 0.804665
| 0.742191
| 0.664503
| 0.536613
| 0.498682
| 0.357099
| 0
| 0.071549
| 0.416816
| 22,384
| 526
| 119
| 42.555133
| 0.683775
| 0.001028
| 0
| 0.705545
| 0
| 0
| 0.076572
| 0
| 0
| 0
| 0.040791
| 0.001901
| 0
| 1
| 0.003824
| false
| 0
| 0.003824
| 0.001912
| 0.011472
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a71626e646cb0eee220270db08c1d91ce5d0ddac
| 2,318
|
py
|
Python
|
tests/test_helper.py
|
Bolinooo/hint-parser
|
f688ba80320e690c3e05cf6c68bfba94533bd6a2
|
[
"MIT"
] | null | null | null |
tests/test_helper.py
|
Bolinooo/hint-parser
|
f688ba80320e690c3e05cf6c68bfba94533bd6a2
|
[
"MIT"
] | null | null | null |
tests/test_helper.py
|
Bolinooo/hint-parser
|
f688ba80320e690c3e05cf6c68bfba94533bd6a2
|
[
"MIT"
] | null | null | null |
from src import helper
from src import url
import calendar
import time
import unittest
class MyHelperTest(unittest.TestCase):
timestamp = calendar.timegm(time.gmtime())
def setUp(self):
print("Testing method: {0}".format(self._testMethodName))
def tearDown(self):
print("Succesfully tested: {0}".format(self._testMethodName))
def test_apply_format(self):
self.assertNotEqual(url.apply_format(3), "000003")
self.assertEqual(url.apply_format(3), "00003")
self.assertNotEqual(url.apply_format(3), "0003")
def test_build_filename_teacher(self):
self.assertNotEqual(helper.build_filename(option="teacher", quarter="1"), 'teacher_q2_' + str(self.__class__.timestamp))
self.assertEqual(helper.build_filename(option="teacher", quarter="2"), 'teacher_q2_' + str(self.__class__.timestamp))
self.assertNotEqual(helper.build_filename(option="teacher", quarter="3"), 'teacher_q2_' + str(self.__class__.timestamp))
def test_build_filename_rooms(self):
self.assertNotEqual(helper.build_filename(option="rooms", quarter="1"), 'rooms_q2_' + str(self.__class__.timestamp))
self.assertEqual(helper.build_filename(option="rooms", quarter="2"), 'rooms_q2_' + str(self.__class__.timestamp))
self.assertNotEqual(helper.build_filename(option="rooms", quarter="3"), 'rooms_q2_' + str(self.__class__.timestamp))
def test_build_filename_schedule(self):
self.assertNotEqual(helper.build_filename(option="schedule", quarter="1"), 'schedule_q2_' + str(self.__class__.timestamp))
self.assertEqual(helper.build_filename(option="schedule", quarter="2"), 'schedule_q2_' + str(self.__class__.timestamp))
self.assertNotEqual(helper.build_filename(option="schedule", quarter="3"), 'schedule_q2_' + str(self.__class__.timestamp))
def test_build_filename_classes(self):
self.assertNotEqual(helper.build_filename(option="classes", quarter="1"), 'classes_q2_' + str(self.__class__.timestamp))
self.assertEqual(helper.build_filename(option="classes", quarter="2"), 'classes_q2_' + str(self.__class__.timestamp))
self.assertNotEqual(helper.build_filename(option="classes", quarter="3"), 'classes_q2_' + str(self.__class__.timestamp))
if __name__ == "__main__":
unittest.main()
| 50.391304
| 130
| 0.726057
| 278
| 2,318
| 5.654676
| 0.176259
| 0.132316
| 0.145038
| 0.19084
| 0.778626
| 0.743003
| 0.634224
| 0.589695
| 0.410305
| 0.328244
| 0
| 0.021739
| 0.126833
| 2,318
| 45
| 131
| 51.511111
| 0.754941
| 0
| 0
| 0
| 0
| 0
| 0.123814
| 0
| 0
| 0
| 0
| 0
| 0.454545
| 1
| 0.212121
| false
| 0
| 0.151515
| 0
| 0.424242
| 0.060606
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
595c45a9cc502c7ed37915c771983c5f06ee29a7
| 222
|
py
|
Python
|
app/forms/delete_shopping_list_form.py
|
jon-wehner/MyPantry
|
01f833b99d4318b4676abd542272dce61d0b8c61
|
[
"MIT"
] | 9
|
2021-03-02T16:52:40.000Z
|
2021-03-03T16:51:46.000Z
|
app/forms/delete_shopping_list_form.py
|
jon-wehner/PantryStock
|
01f833b99d4318b4676abd542272dce61d0b8c61
|
[
"MIT"
] | 50
|
2021-03-12T16:04:49.000Z
|
2022-03-17T20:47:00.000Z
|
app/forms/delete_shopping_list_form.py
|
jon-wehner/PantryStock
|
01f833b99d4318b4676abd542272dce61d0b8c61
|
[
"MIT"
] | null | null | null |
from flask_wtf import FlaskForm
from wtforms import IntegerField, SubmitField
from wtforms.validators import DataRequired
class DeleteShoppingListForm(FlaskForm):
id = IntegerField('id', validators=[DataRequired()])
| 27.75
| 56
| 0.815315
| 23
| 222
| 7.826087
| 0.565217
| 0.122222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112613
| 222
| 7
| 57
| 31.714286
| 0.913706
| 0
| 0
| 0
| 0
| 0
| 0.009009
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.6
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
59a52497aa4c756657d939821177d4b0365fc9cb
| 45
|
py
|
Python
|
data/studio21_generated/introductory/3803/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3803/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
data/studio21_generated/introductory/3803/starter_code.py
|
vijaykumawat256/Prompt-Summarization
|
614f5911e2acd2933440d909de2b4f86653dc214
|
[
"Apache-2.0"
] | null | null | null |
def update_inventory(cur_stock, new_stock):
| 22.5
| 43
| 0.822222
| 7
| 45
| 4.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088889
| 45
| 2
| 44
| 22.5
| 0.829268
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
59b17fd4ee629ab3b6de1d543a64ca2223007189
| 89
|
py
|
Python
|
labmain/apps.py
|
likit/overdue
|
1a8e1f3245dadbcb5e17c457b91c6331bcb57ba7
|
[
"MIT"
] | null | null | null |
labmain/apps.py
|
likit/overdue
|
1a8e1f3245dadbcb5e17c457b91c6331bcb57ba7
|
[
"MIT"
] | null | null | null |
labmain/apps.py
|
likit/overdue
|
1a8e1f3245dadbcb5e17c457b91c6331bcb57ba7
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
class LabmainConfig(AppConfig):
name = 'labmain'
| 14.833333
| 33
| 0.752809
| 10
| 89
| 6.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.168539
| 89
| 5
| 34
| 17.8
| 0.905405
| 0
| 0
| 0
| 0
| 0
| 0.078652
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
59bd4c365d16530af4ded83d443b4a97d5286f44
| 30
|
py
|
Python
|
test/__init__.py
|
kjelljorner/libconeangle
|
52ef8f38d41a8d6feea0869f457a85598cf6e59b
|
[
"MIT"
] | 8
|
2022-03-21T07:02:14.000Z
|
2022-03-31T22:58:32.000Z
|
test/__init__.py
|
kjelljorner/libconeangle
|
52ef8f38d41a8d6feea0869f457a85598cf6e59b
|
[
"MIT"
] | 1
|
2022-03-26T10:24:32.000Z
|
2022-03-26T14:12:02.000Z
|
test/__init__.py
|
kjelljorner/libconeangle
|
52ef8f38d41a8d6feea0869f457a85598cf6e59b
|
[
"MIT"
] | null | null | null |
"""Tests for libconeangle."""
| 15
| 29
| 0.666667
| 3
| 30
| 6.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 30
| 1
| 30
| 30
| 0.740741
| 0.766667
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
abb2ae911d37b0ee4a258a6185d8fb939a7cdb82
| 14
|
py
|
Python
|
__init__.py
|
weiwei11/wind
|
4322125ec7c66b33884b0886a98e52afdeda0ec9
|
[
"MIT"
] | null | null | null |
__init__.py
|
weiwei11/wind
|
4322125ec7c66b33884b0886a98e52afdeda0ec9
|
[
"MIT"
] | null | null | null |
__init__.py
|
weiwei11/wind
|
4322125ec7c66b33884b0886a98e52afdeda0ec9
|
[
"MIT"
] | null | null | null |
# @author: ww
| 7
| 13
| 0.571429
| 2
| 14
| 4
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.214286
| 14
| 1
| 14
| 14
| 0.727273
| 0.785714
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
abe3e6d63c27d8de664086de6412357e317a1d5f
| 114
|
py
|
Python
|
python/testData/quickdoc/NotArgumentList.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2019-04-28T07:48:50.000Z
|
2020-12-11T14:18:08.000Z
|
python/testData/quickdoc/NotArgumentList.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 173
|
2018-07-05T13:59:39.000Z
|
2018-08-09T01:12:03.000Z
|
python/testData/quickdoc/NotArgumentList.py
|
jnthn/intellij-community
|
8fa7c8a3ace62400c838e0d5926a7be106aa8557
|
[
"Apache-2.0"
] | 2
|
2020-03-15T08:57:37.000Z
|
2020-04-07T04:48:14.000Z
|
# directly in function
def foo():
"<the_doc>Doc of foo."
pass
def bar(param):
pass
bar((1, foo<the_ref>))
| 11.4
| 24
| 0.631579
| 20
| 114
| 3.5
| 0.65
| 0.171429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010989
| 0.201754
| 114
| 9
| 25
| 12.666667
| 0.758242
| 0.175439
| 0
| 0.333333
| 0
| 0
| 0.217391
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0.333333
| 0
| null | null | 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
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
2804c0a4ae5b90b2104d720be477486cc2787642
| 158
|
py
|
Python
|
Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex025.py
|
Jhonattan-rocha/Meus-primeiros-programas
|
f5971b66c0afd049b5d0493e8b7a116b391d058e
|
[
"MIT"
] | null | null | null |
Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex025.py
|
Jhonattan-rocha/Meus-primeiros-programas
|
f5971b66c0afd049b5d0493e8b7a116b391d058e
|
[
"MIT"
] | null | null | null |
Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex025.py
|
Jhonattan-rocha/Meus-primeiros-programas
|
f5971b66c0afd049b5d0493e8b7a116b391d058e
|
[
"MIT"
] | null | null | null |
nome = input("Digite seu nome: ")
nome = nome.strip().title()
print("No seu nome tem silva? {}".format("Silva" in nome))
print("O seu nome: {}".format(nome))
| 31.6
| 58
| 0.64557
| 25
| 158
| 4.08
| 0.52
| 0.205882
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.132911
| 158
| 4
| 59
| 39.5
| 0.744526
| 0
| 0
| 0
| 0
| 0
| 0.386076
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 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
| 1
|
0
| 4
|
f9fa3ccdebc9fa997809bdc25d7183d7ad5dcca1
| 50
|
py
|
Python
|
test.py
|
qinweizhang-1/yolov3-tiny-pb-nms
|
e35cd0ab7dd2769d12a32340f4de244ad52c2cde
|
[
"Apache-2.0"
] | 2
|
2021-04-13T06:02:14.000Z
|
2021-05-24T03:29:20.000Z
|
test.py
|
qinweizhang-1/yolov3-tiny-pb-nms
|
e35cd0ab7dd2769d12a32340f4de244ad52c2cde
|
[
"Apache-2.0"
] | null | null | null |
test.py
|
qinweizhang-1/yolov3-tiny-pb-nms
|
e35cd0ab7dd2769d12a32340f4de244ad52c2cde
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding:utf-8 -*-
# -*- author:ZuoJianHao -*-
| 25
| 27
| 0.52
| 5
| 50
| 5.2
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.023256
| 0.14
| 50
| 2
| 27
| 25
| 0.581395
| 0.92
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0504385e8bcb833007635bcddd9667ed8c758b91
| 556
|
py
|
Python
|
catkin_ws/src/visual_odometry_line/include/visual_odometry_line/LaneFilter.py
|
DiegoOrtegoP/Software
|
4a07dd2dab29db910ca2e26848fa6b53b7ab00cd
|
[
"CC-BY-2.0"
] | 12
|
2016-04-14T12:21:46.000Z
|
2021-06-18T07:51:40.000Z
|
catkin_ws/src/visual_odometry_line/include/visual_odometry_line/LaneFilter.py
|
DiegoOrtegoP/Software
|
4a07dd2dab29db910ca2e26848fa6b53b7ab00cd
|
[
"CC-BY-2.0"
] | 14
|
2017-03-03T23:33:05.000Z
|
2018-04-03T18:07:53.000Z
|
catkin_ws/src/visual_odometry_line/include/visual_odometry_line/LaneFilter.py
|
DiegoOrtegoP/Software
|
4a07dd2dab29db910ca2e26848fa6b53b7ab00cd
|
[
"CC-BY-2.0"
] | 113
|
2016-05-03T06:11:42.000Z
|
2019-06-01T14:37:38.000Z
|
import numpy as np
import cv2
import sys
class LaneFilter(object):
pass
"""
def _main():
if len(sys.argv)!=2:
print 'Error reading filename...'
return -1
cap = cv2.VideoCapture(sys.argv[1])
if not cap.isOpened():
print 'Error opening file...'
return -1
while True:
ret, bgr = cap.read()
print ret
if bgr.empty():
break
gray = cv2.cvtColor(bgr, cv2.COLOR_BGR2GRAY)
cv2.imshow('bgr',gray)
cv2.waitKey(30)
lineDetector(bgr)
cv2.imshow('Lane Detector', bgr)
cv2.waitKey(30)
if __name__ == '__main__':
_main()
"""
| 15.444444
| 46
| 0.652878
| 81
| 556
| 4.345679
| 0.567901
| 0.051136
| 0.068182
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.038031
| 0.196043
| 556
| 35
| 47
| 15.885714
| 0.749441
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.2
| 0.6
| 0
| 0.8
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 4
|
0509adf1bf0e3eff481233b40c0d71db53d5a6f3
| 1,865
|
py
|
Python
|
scr/analytic/laplace.py
|
zmoitier/Scattering_BIE_QPAX
|
a4f9660f570c618f7a14585ab943b0f16c712632
|
[
"MIT"
] | null | null | null |
scr/analytic/laplace.py
|
zmoitier/Scattering_BIE_QPAX
|
a4f9660f570c618f7a14585ab943b0f16c712632
|
[
"MIT"
] | null | null | null |
scr/analytic/laplace.py
|
zmoitier/Scattering_BIE_QPAX
|
a4f9660f570c618f7a14585ab943b0f16c712632
|
[
"MIT"
] | null | null | null |
""" Compute analytic solution for laplace
Author: Zoïs Moitier
Karlsruhe Institute of Technology, Germany
"""
from numpy import cos, sin
from sympy import lambdify, symbols
def laplace_sol_eve(m, ε):
"""
scr, sol = laplace_sol_eve(m, ε)
Return the even source term and solution to the Laplace problem.
Parameters
----------
m : int
number of oscillations
ε : float
semi-minor axis of the ellipse
Returns
-------
scr : Function
cos(m θ) or sin(m θ)
sol : Function
a_ε cos(m θ) or b_ε sin(m θ)
"""
if (not float(m).is_integer()) or (m < 0):
raise ValueError("m should be a non-negative interger")
e = symbols("e", real=True, positive=True)
ρ = (e - 1) / (e + 1)
if m % 2:
c = (-2 / (1 - ρ ** m)).factor()
cossin = sin
else:
c = (-2 / (1 + ρ ** m)).factor()
cossin = cos
fct = lambdify(e, c)
return (lambda θ: cossin(m * θ), lambda θ: fct(ε) * cossin(m * θ))
def laplace_sol_odd(m, ε):
"""
scr, sol = laplace_sol_odd(m, ε)
Return the odd source term and solution to the Laplace problem.
Parameters
----------
m : int
number of oscillations
ε : float
semi-minor axis of the ellipse
Returns
-------
scr : Function
cos(m θ) or sin(m θ)
sol : Function
a_ε cos(m θ) or b_ε sin(m θ)
"""
if (not float(m).is_integer()) or (m < 1):
raise ValueError("m should be a positive interger")
e = symbols("e", real=True, positive=True)
ρ = (e - 1) / (e + 1)
if m % 2:
c = (-2 / (1 + ρ ** m)).factor()
cossin = cos
else:
c = (-2 / (1 - ρ ** m)).factor()
cossin = sin
fct = lambdify(e, c)
return (lambda θ: cossin(m * θ), lambda θ: fct(ε) * cossin(m * θ))
| 22.202381
| 70
| 0.526542
| 278
| 1,865
| 3.482014
| 0.273381
| 0.024793
| 0.020661
| 0.028926
| 0.803719
| 0.766529
| 0.677686
| 0.677686
| 0.621901
| 0.621901
| 0
| 0.012831
| 0.331367
| 1,865
| 83
| 71
| 22.46988
| 0.763432
| 0.387668
| 0
| 0.714286
| 0
| 0
| 0.068548
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.071429
| false
| 0
| 0.071429
| 0
| 0.214286
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
050a5556c378b044274437c2149bb355b99540f7
| 201
|
py
|
Python
|
tests/src/year2018/test_day08a.py
|
lancelote/advent_of_code
|
06dda6ca034bc1e86addee7798bb9b2a34ff565b
|
[
"Unlicense"
] | 10
|
2017-12-11T17:54:52.000Z
|
2021-12-09T20:16:30.000Z
|
tests/src/year2018/test_day08a.py
|
lancelote/advent_of_code
|
06dda6ca034bc1e86addee7798bb9b2a34ff565b
|
[
"Unlicense"
] | 260
|
2015-12-09T11:03:03.000Z
|
2021-12-12T14:32:23.000Z
|
tests/src/year2018/test_day08a.py
|
lancelote/advent_of_code
|
06dda6ca034bc1e86addee7798bb9b2a34ff565b
|
[
"Unlicense"
] | null | null | null |
"""2018 - Day 8 Part 1: Memory Maneuver tests."""
from src.year2018.day08a import solve
def test_solve():
sample_task = "2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2"
assert solve(sample_task) == 138
| 25.125
| 55
| 0.661692
| 40
| 201
| 3.25
| 0.675
| 0.169231
| 0.230769
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.227273
| 0.233831
| 201
| 7
| 56
| 28.714286
| 0.616883
| 0.21393
| 0
| 0
| 0
| 0
| 0.230263
| 0
| 0
| 0
| 0
| 0
| 0.25
| 1
| 0.25
| false
| 0
| 0.25
| 0
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 1
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
0523402ea0d93e47abdfb6c74220acde2c6ba4f6
| 7,266
|
py
|
Python
|
eval_distribution.py
|
WeustiS/filter_similarity
|
b7e99b119be589d077b4e96f904aaa48ff3c7e54
|
[
"MIT"
] | null | null | null |
eval_distribution.py
|
WeustiS/filter_similarity
|
b7e99b119be589d077b4e96f904aaa48ff3c7e54
|
[
"MIT"
] | null | null | null |
eval_distribution.py
|
WeustiS/filter_similarity
|
b7e99b119be589d077b4e96f904aaa48ff3c7e54
|
[
"MIT"
] | null | null | null |
from filter_sim import *
def main():
for i in [0, 2, 5, 7, 10]:
dist_mat_2 = generate_dist_mat(
compare_encodings_cuda(
encode_filters(
get_filters('vgg', i),
get_frames(2, 'randomNumberPermutation')
)))
dist_mat_3 = generate_dist_mat(
compare_encodings_cuda(
encode_filters(
get_filters('vgg', i),
get_frames(3, 'randomNumberPermutation')
)))
dist_mat_4 = generate_dist_mat(
compare_encodings_cuda(
encode_filters(
get_filters('vgg', i),
get_frames(4, 'randomNumberPermutation')
)))
# that was a fun line to write
score_2, stddev_2 = eval_dist_mat(dist_mat_2)
score_3, stddev_3 = eval_dist_mat(dist_mat_3)
score_4, stddev_4 = eval_dist_mat(dist_mat_4)
l1_error_23, l2_error_23 = compare_dist_mat(dist_mat_2, dist_mat_3)
l1_error_34, l2_error_34 = compare_dist_mat(dist_mat_3, dist_mat_4)
l1_error_24, l2_error_24 = compare_dist_mat(dist_mat_2, dist_mat_4)
print(f"LAYER {i}")
print(score_2, stddev_2)
print(score_3, stddev_3)
print(score_4, stddev_4)
print(l1_error_23, l2_error_23)
print(l1_error_34, l2_error_34)
print(l1_error_24, l2_error_24)
'''
number permutations, 2, 3, 4
LAYER 0
tensor(0.6097, device='cuda:0') tensor(0.3147, device='cuda:0')
tensor(0.6016, device='cuda:0') tensor(0.3296, device='cuda:0')
tensor(0.5999, device='cuda:0') tensor(0.3325, device='cuda:0')
tensor(565.9182, device='cuda:0') tensor(6.1710, device='cuda:0')
tensor(111.4100, device='cuda:0') tensor(1.2116, device='cuda:0')
tensor(673.4180, device='cuda:0') tensor(7.3454, device='cuda:0')
LAYER 2
tensor(0.5253, device='cuda:0') tensor(0.2913, device='cuda:0')
tensor(0.3032, device='cuda:0') tensor(0.2899, device='cuda:0')
tensor(0.4668, device='cuda:0') tensor(0.3017, device='cuda:0')
tensor(4468.6479, device='cuda:0') tensor(38.7206, device='cuda:0')
tensor(3277.7424, device='cuda:0') tensor(28.7491, device='cuda:0')
tensor(1352.5439, device='cuda:0') tensor(11.8438, device='cuda:0')
LAYER 5
tensor(0.5026, device='cuda:0') tensor(0.2794, device='cuda:0')
tensor(0.4528, device='cuda:0') tensor(0.2871, device='cuda:0')
tensor(0.4397, device='cuda:0') tensor(0.2883, device='cuda:0')
tensor(4618.8853, device='cuda:0') tensor(19.9665, device='cuda:0')
tensor(1184.1735, device='cuda:0') tensor(5.1083, device='cuda:0')
tensor(5752.3047, device='cuda:0') tensor(24.8552, device='cuda:0')
LAYER 7
tensor(0.4799, device='cuda:0') tensor(0.2798, device='cuda:0')
tensor(0.4012, device='cuda:0') tensor(0.2851, device='cuda:0')
tensor(0.4118, device='cuda:0') tensor(0.2850, device='cuda:0')
tensor(6679.6455, device='cuda:0') tensor(28.5184, device='cuda:0')
tensor(890.4374, device='cuda:0') tensor(3.8101, device='cuda:0')
tensor(5824.1519, device='cuda:0') tensor(24.8666, device='cuda:0')
LAYER 10
tensor(0.4227, device='cuda:0') tensor(0.2850, device='cuda:0')
tensor(0.4183, device='cuda:0') tensor(0.2852, device='cuda:0')
tensor(0.3568, device='cuda:0') tensor(0.2855, device='cuda:0')
tensor(1523.7008, device='cuda:0') tensor(3.2613, device='cuda:0')
tensor(20552.5039, device='cuda:0') tensor(44.2601, device='cuda:0')
tensor(22026.6133, device='cuda:0') tensor(47.4062, device='cuda:0')
'''
'''
random number permutations, 2, 3, 4 (running)
LAYER 0
tensor(0.4710, device='cuda:0') tensor(0.3579, device='cuda:0')
tensor(0.5923, device='cuda:0') tensor(0.3437, device='cuda:0')
tensor(0.5922, device='cuda:0') tensor(0.3439, device='cuda:0')
tensor(3330.1567, device='cuda:0') tensor(33.4956, device='cuda:0')
tensor(7.6849, device='cuda:0') tensor(0.0833, device='cuda:0')
tensor(3325.0862, device='cuda:0') tensor(33.4475, device='cuda:0')
LAYER 2
tensor(0.3186, device='cuda:0') tensor(0.2933, device='cuda:0')
tensor(0.3124, device='cuda:0') tensor(0.2920, device='cuda:0')
tensor(0.3682, device='cuda:0') tensor(0.3013, device='cuda:0')
tensor(122.0569, device='cuda:0') tensor(1.1106, device='cuda:0')
tensor(1115.2152, device='cuda:0') tensor(10.0155, device='cuda:0')
tensor(995.6165, device='cuda:0') tensor(8.9311, device='cuda:0')
LAYER 5
tensor(0.1836, device='cuda:0') tensor(0.2436, device='cuda:0')
tensor(0.3530, device='cuda:0') tensor(0.2878, device='cuda:0')
tensor(0.3345, device='cuda:0') tensor(0.2859, device='cuda:0')
tensor(13097.7832, device='cuda:0') tensor(59.5313, device='cuda:0')
tensor(1536.7844, device='cuda:0') tensor(6.7658, device='cuda:0')
tensor(11661.5381, device='cuda:0') tensor(53.4924, device='cuda:0')
LAYER 7
tensor(0.2013, device='cuda:0') tensor(0.2501, device='cuda:0')
tensor(0.3034, device='cuda:0') tensor(0.2773, device='cuda:0')
tensor(0.2562, device='cuda:0') tensor(0.2673, device='cuda:0')
tensor(7880.4165, device='cuda:0') tensor(36.0252, device='cuda:0')
tensor(3702.4109, device='cuda:0') tensor(16.6058, device='cuda:0')
tensor(4234.2725, device='cuda:0') tensor(19.8365, device='cuda:0')
'''
'''
n^^9 random matrices (console)
LAYER 0
tensor(0.5503, device='cuda:0') tensor(0.3698, device='cuda:0')
tensor(0.5832, device='cuda:0') tensor(0.3544, device='cuda:0')
tensor(0.5769, device='cuda:0') tensor(0.3599, device='cuda:0')
tensor(1190.1285, device='cuda:0') tensor(12.6842, device='cuda:0')
tensor(289.3646, device='cuda:0') tensor(3.1148, device='cuda:0')
tensor(928.1562, device='cuda:0') tensor(9.8708, device='cuda:0')
LAYER 2
tensor(0.1776, device='cuda:0') tensor(0.2435, device='cuda:0')
tensor(0.5177, device='cuda:0') tensor(0.2931, device='cuda:0')
tensor(0.4161, device='cuda:0') tensor(0.3043, device='cuda:0')
tensor(6495.0225, device='cuda:0') tensor(55.9000, device='cuda:0')
tensor(2222.9636, device='cuda:0') tensor(19.4022, device='cuda:0')
tensor(4545.6309, device='cuda:0') tensor(40.9399, device='cuda:0')
'''
def eval_dist_mat(dist_mat):
total_distance = 0
total_items = 0
for i in range(len(dist_mat)):
for j in range(i): # fine bc symmetrical mat
total_distance += dist_mat[i][j]
total_items += 1
avg = total_distance/total_items
total_error = 0
for i in range(len(dist_mat)):
for j in range(i): # fine bc symmetrical mat
total_error+=(dist_mat[i][j] - avg)**2
total_error = (total_error/total_items)**.5
return avg, total_error
def compare_dist_mat(dist_mat_0, dist_mat_1):
# we do L2
assert len(dist_mat_0) == len(dist_mat_1), "Distance matrices are of different size"
assert len(dist_mat_0[0]) == len(dist_mat_1[0]), "Distance matrices are of different size"
l1_error = 0 # more resistant to outliers
l2_error = 0
for i in range(len(dist_mat_0)):
for j in range(i): # fine bc symmetrical
l1_error += abs(dist_mat_0[i][j] - dist_mat_1[i][j])
l2_error += (dist_mat_0[i][j] - dist_mat_1[i][j])**2
l2_error = l2_error**.5
return l1_error, l2_error
if __name__ == "__main__":
main()
| 42
| 94
| 0.64905
| 1,215
| 7,266
| 3.755556
| 0.213992
| 0.289283
| 0.318212
| 0.4508
| 0.531449
| 0.199869
| 0.161297
| 0.12448
| 0.105413
| 0.0984
| 0
| 0.169393
| 0.167217
| 7,266
| 173
| 95
| 42
| 0.584697
| 0.018167
| 0
| 0.278689
| 1
| 0
| 0.067473
| 0.026911
| 0
| 0
| 0
| 0
| 0.032787
| 1
| 0.04918
| false
| 0
| 0.016393
| 0
| 0.098361
| 0.114754
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
054de34ecefe75d5838fe14c4b6c0ef229b8de66
| 111
|
py
|
Python
|
make-your-own-text-adventure-with-python/homework/hello_name.py
|
learning-game-development/learning-python-game-development
|
326b72eadab0bfb14f70f295b492f76d139dde33
|
[
"Unlicense"
] | null | null | null |
make-your-own-text-adventure-with-python/homework/hello_name.py
|
learning-game-development/learning-python-game-development
|
326b72eadab0bfb14f70f295b492f76d139dde33
|
[
"Unlicense"
] | null | null | null |
make-your-own-text-adventure-with-python/homework/hello_name.py
|
learning-game-development/learning-python-game-development
|
326b72eadab0bfb14f70f295b492f76d139dde33
|
[
"Unlicense"
] | null | null | null |
def say_hello(name):
print("Hello,", name)
user_name = input("What is your name? ")
say_hello(user_name)
| 15.857143
| 40
| 0.684685
| 18
| 111
| 4
| 0.555556
| 0.222222
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.162162
| 111
| 6
| 41
| 18.5
| 0.774194
| 0
| 0
| 0
| 0
| 0
| 0.225225
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.25
| 0.25
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
057705f49cc9e7db961b6eeae9d1b6ad779b8833
| 549
|
py
|
Python
|
House/preprocess.py
|
xdr940/iKaggle
|
cc0210e089e5f1af228f02bf67bb9a4459336722
|
[
"MIT"
] | null | null | null |
House/preprocess.py
|
xdr940/iKaggle
|
cc0210e089e5f1af228f02bf67bb9a4459336722
|
[
"MIT"
] | null | null | null |
House/preprocess.py
|
xdr940/iKaggle
|
cc0210e089e5f1af228f02bf67bb9a4459336722
|
[
"MIT"
] | null | null | null |
from sklearn.datasets import load_digits
from sklearn.datasets import load_iris
from sklearn.datasets import load_diabetes
from sklearn.datasets import load_breast_cancer
import numpy as np
import matplotlib.pyplot as plt
#X,y = load_digits(return_X_y=True)
#iris_dat= load_iris()
#X3,y3 = load_diabetes(return_X_y=True)
#bc_dat = load_breast_cancer()
#db_dat = load_diabetes()
from sklearn.datasets import load_wine
dat_wine = load_wine()
#X5,y5 = load_iris(return_X_y=True)
#test = np.concatenate([bc_dat.data,bc_dat.target])
print('ok')
| 21.96
| 51
| 0.79235
| 92
| 549
| 4.445652
| 0.369565
| 0.134474
| 0.232274
| 0.305623
| 0.403423
| 0.200489
| 0.200489
| 0
| 0
| 0
| 0
| 0.008197
| 0.111111
| 549
| 25
| 52
| 21.96
| 0.829918
| 0.418944
| 0
| 0
| 0
| 0
| 0.00639
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.777778
| 0
| 0.777778
| 0.111111
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
057d1e3bb2daab2395de2d6e2fe929d23ffe956f
| 69
|
py
|
Python
|
shanshan-django/5/shan/urls.py
|
hujiaweibujidao/XingShan
|
6e423c1d4cd90ddd766244006b7a4a0449a7d2cb
|
[
"Apache-2.0"
] | 6
|
2015-03-04T08:17:13.000Z
|
2018-10-01T06:58:29.000Z
|
shanshan-django/5/shan/urls.py
|
hujiaweibujidao/XingShan
|
6e423c1d4cd90ddd766244006b7a4a0449a7d2cb
|
[
"Apache-2.0"
] | null | null | null |
shanshan-django/5/shan/urls.py
|
hujiaweibujidao/XingShan
|
6e423c1d4cd90ddd766244006b7a4a0449a7d2cb
|
[
"Apache-2.0"
] | 1
|
2018-10-01T06:58:30.000Z
|
2018-10-01T06:58:30.000Z
|
from django.conf.urls import patterns, include, url
# hujiawei urls
| 17.25
| 51
| 0.782609
| 10
| 69
| 5.4
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144928
| 69
| 3
| 52
| 23
| 0.915254
| 0.188406
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
05810f73ab983fd993e117f3f65240e20bb07b66
| 1,010
|
py
|
Python
|
Course2/Week1/1_brackets_in_code.py
|
sinhars/Data-Structures-And-Algorithms
|
92f42ac347a69260a28cfb37d3013bfe9b045448
|
[
"MIT"
] | null | null | null |
Course2/Week1/1_brackets_in_code.py
|
sinhars/Data-Structures-And-Algorithms
|
92f42ac347a69260a28cfb37d3013bfe9b045448
|
[
"MIT"
] | null | null | null |
Course2/Week1/1_brackets_in_code.py
|
sinhars/Data-Structures-And-Algorithms
|
92f42ac347a69260a28cfb37d3013bfe9b045448
|
[
"MIT"
] | null | null | null |
# python3
from collections import namedtuple
Bracket = namedtuple("Bracket", ["char", "position"])
def are_matching(left, right):
return (left + right) in ["()", "[]", "{}"]
def find_mismatch(text):
opening_brackets_stack = []
for i, next in enumerate(text):
if next in "([{":
opening_brackets_stack.append(Bracket(next, i))
pass
if next in ")]}":
if len(opening_brackets_stack) > 0:
prev = opening_brackets_stack[len(opening_brackets_stack) - 1]
if are_matching(prev.char, next):
opening_brackets_stack.pop()
else:
return (i + 1)
else:
return(i + 1)
pass
if len(opening_brackets_stack) > 0:
return (opening_brackets_stack[len(opening_brackets_stack) - 1].position + 1)
return ("Success")
if __name__ == "__main__":
text = input()
mismatch = find_mismatch(text)
print(mismatch)
| 27.297297
| 85
| 0.562376
| 110
| 1,010
| 4.890909
| 0.354545
| 0.250929
| 0.334572
| 0.171004
| 0.260223
| 0.260223
| 0.163569
| 0.163569
| 0
| 0
| 0
| 0.011611
| 0.317822
| 1,010
| 36
| 86
| 28.055556
| 0.769231
| 0.006931
| 0
| 0.296296
| 0
| 0
| 0.045954
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.074074
| false
| 0.074074
| 0.037037
| 0.037037
| 0.259259
| 0.037037
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
0595d906543886ed033e28b4c9b9cde978957f31
| 150
|
py
|
Python
|
bin/project_structure.py
|
bgmoshe/viral-mutation
|
e12adc945aa2f241820541c84998eb7a75aefd83
|
[
"MIT"
] | null | null | null |
bin/project_structure.py
|
bgmoshe/viral-mutation
|
e12adc945aa2f241820541c84998eb7a75aefd83
|
[
"MIT"
] | null | null | null |
bin/project_structure.py
|
bgmoshe/viral-mutation
|
e12adc945aa2f241820541c84998eb7a75aefd83
|
[
"MIT"
] | null | null | null |
from pathlib import Path
CODE_DIR = Path(__file__).parent
PROJ_DIR = CODE_DIR.parent
DATA_DIR = PROJ_DIR / "data"
RESULTS_DIR = PROJ_DIR / "results"
| 21.428571
| 34
| 0.766667
| 24
| 150
| 4.333333
| 0.458333
| 0.201923
| 0.192308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14
| 150
| 6
| 35
| 25
| 0.806202
| 0
| 0
| 0
| 0
| 0
| 0.073333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.2
| 0
| 0.2
| 0
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
55491889362dbdf9e057c97622d861d952329b9d
| 281
|
py
|
Python
|
zinnia_hashids/settings.py
|
django-blog-zinnia/zinnia-url-shortener-hashids
|
e8d5f4d33c52ac44f5688b89405671d494df99fb
|
[
"BSD-3-Clause"
] | 1
|
2016-02-07T12:42:12.000Z
|
2016-02-07T12:42:12.000Z
|
zinnia_hashids/settings.py
|
django-blog-zinnia/zinnia-url-shortener-hashids
|
e8d5f4d33c52ac44f5688b89405671d494df99fb
|
[
"BSD-3-Clause"
] | null | null | null |
zinnia_hashids/settings.py
|
django-blog-zinnia/zinnia-url-shortener-hashids
|
e8d5f4d33c52ac44f5688b89405671d494df99fb
|
[
"BSD-3-Clause"
] | null | null | null |
"""Settings for Zinnia Hashids"""
from django.conf import settings
HASHIDS_SALT = getattr(settings, 'ZINNIA_HASHIDS_SALT', 'Zinnia rocks')
HASHIDS_MIN_LENGTH = getattr(settings, 'ZINNIA_HASHIDS_MIN_LENGTH', 6)
HASHIDS_ALPHABET = getattr(settings, 'ZINNIA_HASHIDS_ALPHABET', '')
| 31.222222
| 71
| 0.790036
| 35
| 281
| 6.028571
| 0.428571
| 0.246446
| 0.298578
| 0.398104
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003937
| 0.096085
| 281
| 8
| 72
| 35.125
| 0.826772
| 0.096085
| 0
| 0
| 0
| 0
| 0.318548
| 0.193548
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 0
| 0.25
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
557f55117f94b9fb81b8666dec310975148c1bdc
| 92
|
py
|
Python
|
students/K33401/Kunal_Shubham/lab3/hotel_project/hotel_app/apps.py
|
ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021
|
bb91c91a56d21cec2b12ae4cc722eaa652a88420
|
[
"MIT"
] | 10
|
2020-03-20T09:06:12.000Z
|
2021-07-27T13:06:02.000Z
|
students/K33401/Kunal_Shubham/lab3/hotel_project/hotel_app/apps.py
|
ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021
|
bb91c91a56d21cec2b12ae4cc722eaa652a88420
|
[
"MIT"
] | 134
|
2020-03-23T09:47:48.000Z
|
2022-03-12T01:05:19.000Z
|
students/K33401/Kunal_Shubham/lab3/hotel_project/hotel_app/apps.py
|
ShubhamKunal/ITMO_ICT_WebDevelopment_2020-2021
|
bb91c91a56d21cec2b12ae4cc722eaa652a88420
|
[
"MIT"
] | 71
|
2020-03-20T12:45:56.000Z
|
2021-10-31T19:22:25.000Z
|
from django.apps import AppConfig
class HotelAppConfig(AppConfig):
name = 'hotel_app'
| 15.333333
| 33
| 0.76087
| 11
| 92
| 6.272727
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163043
| 92
| 5
| 34
| 18.4
| 0.896104
| 0
| 0
| 0
| 0
| 0
| 0.097826
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
559ffe462fd1f9f5f8bc2e079d7279d2ff9f94fe
| 222
|
py
|
Python
|
Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/007.py
|
rafaelvizu/Estudos
|
eef5e3e3706ff99959226c51b9907b6af4377bfe
|
[
"MIT"
] | null | null | null |
Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/007.py
|
rafaelvizu/Estudos
|
eef5e3e3706ff99959226c51b9907b6af4377bfe
|
[
"MIT"
] | null | null | null |
Linguagens/Python/Exercicios/cursos_em_video/aulas-01_a_21/007.py
|
rafaelvizu/Estudos
|
eef5e3e3706ff99959226c51b9907b6af4377bfe
|
[
"MIT"
] | null | null | null |
print('\033[31;40mExercício Python #007 - Média Aritmética\033[m')
a2 = float(input('\033[31mNota 1 = \033[m'))
b2 = float(input('\033[32mNota 2 = \033[m'))
c2 = (a2 + b2) / 2
print('\033[4;36mA média é {:.1f}'.format(c2))
| 44.4
| 66
| 0.630631
| 39
| 222
| 3.589744
| 0.589744
| 0.085714
| 0.185714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.231959
| 0.126126
| 222
| 5
| 67
| 44.4
| 0.489691
| 0
| 0
| 0
| 0
| 0
| 0.578475
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.4
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
55ada1d7a3b17e5f1ffb11717da84dc9a4248194
| 138
|
py
|
Python
|
codeforces/math数学/800/851A人浪.py
|
yofn/pyacm
|
e573f8fdeea77513711f00c42f128795cbba65a6
|
[
"Apache-2.0"
] | null | null | null |
codeforces/math数学/800/851A人浪.py
|
yofn/pyacm
|
e573f8fdeea77513711f00c42f128795cbba65a6
|
[
"Apache-2.0"
] | null | null | null |
codeforces/math数学/800/851A人浪.py
|
yofn/pyacm
|
e573f8fdeea77513711f00c42f128795cbba65a6
|
[
"Apache-2.0"
] | null | null | null |
#!/usr/bin/env python3
# https://codeforces.com/problemset/problem/851/A
n,k,t = list(map(int,input().split()))
print(min(t,n+k-t,k))
| 19.714286
| 49
| 0.65942
| 26
| 138
| 3.5
| 0.807692
| 0.043956
| 0.065934
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.031746
| 0.086957
| 138
| 6
| 50
| 23
| 0.690476
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
e94d36f55ecf36d508fb44d22daeed78345d2310
| 92
|
py
|
Python
|
starboard/hardcoded_values.py
|
AviKav/Trusty-cogs
|
0e805c9f6339323d2d0ea139c648abf5e41ef8f4
|
[
"MIT"
] | null | null | null |
starboard/hardcoded_values.py
|
AviKav/Trusty-cogs
|
0e805c9f6339323d2d0ea139c648abf5e41ef8f4
|
[
"MIT"
] | null | null | null |
starboard/hardcoded_values.py
|
AviKav/Trusty-cogs
|
0e805c9f6339323d2d0ea139c648abf5e41ef8f4
|
[
"MIT"
] | null | null | null |
from datetime import timedelta
MAX_AGE = timedelta(hours=4)
SERVER_ID = 305980946664914947
| 18.4
| 30
| 0.826087
| 12
| 92
| 6.166667
| 0.916667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.234568
| 0.119565
| 92
| 4
| 31
| 23
| 0.679012
| 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
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
e95e8b6d57377c9dfd5ad86456961ad6cadcf8e8
| 145
|
py
|
Python
|
pyrgg/__init__.py
|
sepandhaghighi/pyggen
|
7d98b2ac7ad0b4767a5c68bc5febefd0e7af32c4
|
[
"MIT"
] | 164
|
2017-04-26T00:17:06.000Z
|
2022-02-10T17:26:37.000Z
|
pyrgg/__init__.py
|
sepandhaghighi/pyggen
|
7d98b2ac7ad0b4767a5c68bc5febefd0e7af32c4
|
[
"MIT"
] | 103
|
2017-07-29T03:05:44.000Z
|
2022-03-07T01:26:51.000Z
|
pyrgg/__init__.py
|
sepandhaghighi/pyggen
|
7d98b2ac7ad0b4767a5c68bc5febefd0e7af32c4
|
[
"MIT"
] | 29
|
2017-05-27T11:08:47.000Z
|
2021-11-13T01:35:42.000Z
|
# -*- coding: utf-8 -*-
"""Pyrgg modules."""
from .functions import *
from .graph_gen import *
from .params import *
__version__ = PYRGG_VERSION
| 20.714286
| 27
| 0.689655
| 18
| 145
| 5.222222
| 0.666667
| 0.212766
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.00813
| 0.151724
| 145
| 6
| 28
| 24.166667
| 0.756098
| 0.255172
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e974ab1ae93b34f677e9da9c35e7a50db9e247e6
| 212
|
py
|
Python
|
ClassroomPlus2/Home/models.py
|
abrohit/Hackathon
|
f5abfa884b50a52c8285f5d4c2a7c15b27575ad5
|
[
"MIT"
] | 4
|
2020-08-08T21:58:24.000Z
|
2020-08-11T20:16:53.000Z
|
ClassroomPlus2/Home/models.py
|
abrohit/Hackathon
|
f5abfa884b50a52c8285f5d4c2a7c15b27575ad5
|
[
"MIT"
] | null | null | null |
ClassroomPlus2/Home/models.py
|
abrohit/Hackathon
|
f5abfa884b50a52c8285f5d4c2a7c15b27575ad5
|
[
"MIT"
] | 4
|
2020-08-11T21:42:25.000Z
|
2020-09-17T13:24:05.000Z
|
from django.db import models
from django.contrib.auth.models import User
class Sessions(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
sessions = models.TextField(blank=True)
| 30.285714
| 63
| 0.783019
| 29
| 212
| 5.689655
| 0.62069
| 0.121212
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122642
| 212
| 6
| 64
| 35.333333
| 0.887097
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e99ca4971a40879793d26bfe42a41077ea5b811b
| 22,659
|
py
|
Python
|
src/xbase/layout/mos/primitives.py
|
skyworksinc/xbase
|
fde050e928d5d89b5507c818b41f5ef3253f38cd
|
[
"Apache-2.0"
] | 3
|
2020-10-15T04:33:57.000Z
|
2021-12-22T07:42:30.000Z
|
src/xbase/layout/mos/primitives.py
|
skyworksinc/xbase
|
fde050e928d5d89b5507c818b41f5ef3253f38cd
|
[
"Apache-2.0"
] | null | null | null |
src/xbase/layout/mos/primitives.py
|
skyworksinc/xbase
|
fde050e928d5d89b5507c818b41f5ef3253f38cd
|
[
"Apache-2.0"
] | 4
|
2020-04-27T16:42:57.000Z
|
2021-10-19T15:25:59.000Z
|
# SPDX-License-Identifier: Apache-2.0
# Copyright 2019 Blue Cheetah Analog Design Inc.
#
# 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 typing import Dict, Any, Optional, Tuple
from bag.util.immutable import Param, ImmutableList, ImmutableSortedDict
from bag.layout.template import TemplateBase, TemplateDB
from ..enum import MOSPortType, MOSType
from ..data import draw_layout_in_template
from .tech import MOSTech
from .data import MOSEdgeInfo, RowExtInfo, BlkExtInfo, MOSRowInfo
class MOSConn(TemplateBase):
"""Transistor connection primitive.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self._left_info: Optional[MOSEdgeInfo] = None
self._right_info: Optional[MOSEdgeInfo] = None
self._top_info: Optional[BlkExtInfo] = None
self._bottom_info: Optional[BlkExtInfo] = None
self._shorted_ports: Optional[ImmutableList[MOSPortType]] = None
@property
def left_info(self) -> Optional[MOSEdgeInfo]:
return self._left_info
@property
def right_info(self) -> Optional[MOSEdgeInfo]:
return self._right_info
@property
def top_info(self) -> Optional[BlkExtInfo]:
return self._top_info
@property
def bottom_info(self) -> Optional[BlkExtInfo]:
return self._bottom_info
@property
def shorted_ports(self) -> ImmutableList[MOSPortType]:
return self._shorted_ports
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
row_info='transistor row information dictionary.',
conn_layer='connection layer ID.',
seg='number of segments.',
w='transistor width, in resolution units or fins.',
stack='number of transistors in a stack.',
g_on_s='True if gate is aligned with source.',
options='Optional process-specific parameters.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
row_info: MOSRowInfo = self.params['row_info']
conn_layer: int = self.params['conn_layer']
seg: int = self.params['seg']
w: int = self.params['w']
stack: int = self.params['stack']
g_on_s: bool = self.params['g_on_s']
options: Param = self.params['options']
arr_options: Param = self.params['arr_options']
grid = self.grid
tech_cls: MOSTech = grid.tech_info.get_device_tech('mos', lch=row_info.lch,
arr_options=arr_options)
mos_info = tech_cls.get_mos_conn_info(row_info, conn_layer, seg, w, stack, g_on_s, options)
draw_layout_in_template(self, mos_info.lay_info)
g_conn_y = row_info.g_conn_y
if g_on_s:
if (stack & 1) == 0:
d_conn_y = row_info.ds_g_conn_y
else:
d_conn_y = row_info.ds_conn_y
s_conn_y = row_info.ds_g_conn_y
else:
d_conn_y = row_info.ds_g_conn_y
s_conn_y = row_info.ds_conn_y
g_xc, num_g, g_pitch = mos_info.g_info
d_xc, num_d, d_pitch = mos_info.d_info
s_xc, num_s, s_pitch = mos_info.s_info
pitch = grid.get_track_pitch(conn_layer)
g_tr = grid.coord_to_track(conn_layer, g_xc)
d_tr = grid.coord_to_track(conn_layer, d_xc)
s_tr = grid.coord_to_track(conn_layer, s_xc)
g_tr_p = g_pitch // pitch
d_tr_p = d_pitch // pitch
s_tr_p = s_pitch // pitch
gw = self.add_wires(conn_layer, g_tr, g_conn_y[0], g_conn_y[1], num=num_g, pitch=g_tr_p)
dw = self.add_wires(conn_layer, d_tr, d_conn_y[0], d_conn_y[1], num=num_d, pitch=d_tr_p)
sw = self.add_wires(conn_layer, s_tr, s_conn_y[0], s_conn_y[1], num=num_s, pitch=s_tr_p)
self.add_pin('g', gw)
self.add_pin('d', dw)
self.add_pin('s', sw)
if mos_info.m_info is not None:
m_xc, num_m, m_pitch = mos_info.m_info
m_tr = grid.coord_to_track(conn_layer, m_xc)
m_tr_p = m_pitch // pitch
m_conn_y = row_info.ds_conn_y
self.add_pin('m', self.add_wires(conn_layer, m_tr, m_conn_y[0], m_conn_y[1],
num=num_m, pitch=m_tr_p))
self.prim_top_layer = conn_layer
self._left_info = mos_info.left_info
self._right_info = mos_info.right_info
self._top_info = mos_info.top_info
self._bottom_info = mos_info.bottom_info
self._shorted_ports = mos_info.shorted_ports
class MOSTap(TemplateBase):
"""Transistor substrate tap primitive.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self._left_info: Optional[MOSEdgeInfo] = None
self._right_info: Optional[MOSEdgeInfo] = None
self._top_info: Optional[BlkExtInfo] = None
self._bottom_info: Optional[BlkExtInfo] = None
@property
def left_info(self) -> Optional[MOSEdgeInfo]:
return self._left_info
@property
def right_info(self) -> Optional[MOSEdgeInfo]:
return self._right_info
@property
def top_info(self) -> Optional[BlkExtInfo]:
return self._top_info
@property
def bottom_info(self) -> Optional[BlkExtInfo]:
return self._bottom_info
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
row_info='transistor row information dictionary.',
conn_layer='connection layer ID.',
seg='number of segments.',
options='Optional process-specific parameters.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
row_info: MOSRowInfo = self.params['row_info']
conn_layer: int = self.params['conn_layer']
seg: int = self.params['seg']
options: Param = self.params['options']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=row_info.lch,
arr_options=arr_options)
mos_info = tech_cls.get_mos_tap_info(row_info, conn_layer, seg, options)
draw_layout_in_template(self, mos_info.lay_info)
conn_y = row_info.sub_conn_y
sup = self.add_wires(conn_layer, -0.5, conn_y[0], conn_y[1], num=seg + 1, pitch=1)
self.add_pin('sup', sup, show=False)
self.prim_top_layer = conn_layer
self._left_info = mos_info.left_info
self._right_info = mos_info.right_info
self._top_info = mos_info.top_info
self._bottom_info = mos_info.bottom_info
class MOSAbut(TemplateBase):
"""An empty space in a transistor row.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
row_info='transistor row information dictionary.',
edgel='edge info of the block to the left.',
edger='edge info of the block to the right.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
row_info: MOSRowInfo = self.params['row_info']
edgel: MOSEdgeInfo = self.params['edgel']
edger: MOSEdgeInfo = self.params['edger']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=row_info.lch,
arr_options=arr_options)
lay_info = tech_cls.get_mos_abut_info(row_info, edgel, edger)
draw_layout_in_template(self, lay_info)
self.disable_cell_boundary()
class MOSSpace(TemplateBase):
"""An empty space in a transistor row.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
self._left_info: Optional[MOSEdgeInfo] = None
self._right_info: Optional[MOSEdgeInfo] = None
self._top_info: Optional[BlkExtInfo] = None
self._bottom_info: Optional[BlkExtInfo] = None
@property
def left_info(self) -> Optional[MOSEdgeInfo]:
return self._left_info
@property
def right_info(self) -> Optional[MOSEdgeInfo]:
return self._right_info
@property
def top_info(self) -> Optional[BlkExtInfo]:
return self._top_info
@property
def bottom_info(self) -> Optional[BlkExtInfo]:
return self._bottom_info
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
row_info='transistor row information dictionary.',
num_cols='number of columns.',
left_info='edge info of the block to the left.',
right_info='edge info of the block to the right.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
row_info: MOSRowInfo = self.params['row_info']
num_cols: int = self.params['num_cols']
left_info: MOSEdgeInfo = self.params['left_info']
right_info: MOSEdgeInfo = self.params['right_info']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=row_info.lch,
arr_options=arr_options)
mos_info = tech_cls.get_mos_space_info(row_info, num_cols, left_info, right_info)
draw_layout_in_template(self, mos_info.lay_info)
self._left_info = mos_info.left_info
self._right_info = mos_info.right_info
self._top_info = mos_info.top_info
self._bottom_info = mos_info.bottom_info
class MOSExt(TemplateBase):
"""An extension block between transistor rows
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
self._edge_info: Optional[MOSEdgeInfo] = None
@property
def edge_info(self) -> Optional[MOSEdgeInfo]:
return self._edge_info
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
lch='channel length in resolution units.',
num_cols='number of columns.',
height='extension height in resolution unit.',
bot_info='RowExtInfo object of bottom row.',
top_info='RowExtInfo object of top row.',
gr_info='Tuple of guard ring edge tap fingers and total guard ring edge fingers.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
lch: int = self.params['lch']
num_cols: int = self.params['num_cols']
height: int = self.params['height']
bot_info: RowExtInfo = self.params['bot_info']
top_info: RowExtInfo = self.params['top_info']
gr_info: Tuple[int, int] = self.params['gr_info']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=lch,
arr_options=arr_options)
ext_info = tech_cls.get_mos_ext_info(num_cols, height, bot_info, top_info, gr_info)
draw_layout_in_template(self, ext_info.lay_info)
self._edge_info = ext_info.edge_info
class MOSExtGR(TemplateBase):
"""An extension block between transistor rows
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
self._edge_info: Optional[MOSEdgeInfo] = None
@property
def edge_info(self) -> Optional[MOSEdgeInfo]:
return self._edge_info
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
lch='channel length in resolution units.',
num_cols='number of columns.',
edge_cols='number of guard ring edge columns.',
height='extension height in resolution unit.',
bot_info='RowExtInfo object of bottom row.',
top_info='RowExtInfo object of top row.',
sub_type='guard ring substrate type.',
einfo='MOSEdgeInfo object of adjacent MOSExt block.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
params = self.params
lch: int = params['lch']
num_cols: int = params['num_cols']
edge_cols: int = params['edge_cols']
height: int = params['height']
bot_info: RowExtInfo = params['bot_info']
top_info: RowExtInfo = params['top_info']
sub_type: MOSType = params['sub_type']
einfo: MOSEdgeInfo = params['einfo']
arr_options: Param = params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=lch,
arr_options=arr_options)
ext_info = tech_cls.get_mos_ext_gr_info(num_cols, edge_cols, height,
bot_info, top_info, sub_type, einfo)
draw_layout_in_template(self, ext_info.lay_info)
self._edge_info = ext_info.edge_info
class MOSEnd(TemplateBase):
"""An end row block of transistor array.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
self._einfo: Optional[MOSEdgeInfo] = None
@property
def edge_info(self) -> Optional[MOSEdgeInfo]:
return self._einfo
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
lch='channel length in resolution units.',
blk_h='end height in resolution units.',
num_cols='number of columns.',
einfo='RowExtInfo object of adjacent row.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
params = self.params
lch: int = params['lch']
blk_h: int = params['blk_h']
num_cols: int = params['num_cols']
einfo: RowExtInfo = params['einfo']
arr_options: Param = params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=lch,
arr_options=arr_options)
end_info = tech_cls.get_mos_end_info(blk_h, num_cols, einfo)
draw_layout_in_template(self, end_info.lay_info)
self._einfo = end_info.edge_info
class MOSRowEdge(TemplateBase):
"""The edge block of a transistor row.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
blk_w='edge width in resolution units.',
rinfo='MOSRowInfo object of adjacent row.',
einfo='MOSEdgeInfo object of adjacent MOSConn block.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
blk_w: int = self.params['blk_w']
rinfo: MOSRowInfo = self.params['rinfo']
einfo: MOSEdgeInfo = self.params['einfo']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=rinfo.lch,
arr_options=arr_options)
lay_info = tech_cls.get_mos_row_edge_info(blk_w, rinfo, einfo)
draw_layout_in_template(self, lay_info)
class MOSExtEdge(TemplateBase):
"""The edge block of the transistor extension region.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
lch='channel length in resolution units.',
blk_w='edge width in resolution units.',
einfo='MOSEdgeInfo object of adjacent MOSExt or MOSExtGR block.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
lch: int = self.params['lch']
blk_w: int = self.params['blk_w']
einfo: MOSEdgeInfo = self.params['einfo']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=lch,
arr_options=arr_options)
lay_info = tech_cls.get_mos_ext_edge_info(blk_w, einfo)
draw_layout_in_template(self, lay_info)
class MOSCorner(TemplateBase):
"""The corner block of transistor array.
Parameters
----------
temp_db : TemplateDB
the template database.
params : Param
the parameter values.
kwargs :
dictionary of optional parameters. See documentation of
:class:`bag.layout.template.TemplateBase` for details.
"""
def __init__(self, temp_db: TemplateDB, params: Param, **kwargs: Any) -> None:
TemplateBase.__init__(self, temp_db, params, **kwargs)
self.prim_top_layer = self.grid.bot_layer
self._corner: Optional[Tuple[int, int]] = None
self._edgel = self._edgeb = ImmutableSortedDict()
@property
def corner(self) -> Tuple[int, int]:
return self._corner
@property
def left_edge(self) -> Param:
return self._edgel
@property
def bottom_edge(self) -> Param:
return self._edgeb
@classmethod
def get_params_info(cls) -> Dict[str, str]:
return dict(
lch='channel length in resolution units.',
blk_w='edge width in resolution units.',
blk_h='end height in resolution units.',
einfo='MOSEdgeInfo object of adjacent MOSEnd block.',
arr_options='Optional process-specific parameters for the array.',
)
def draw_layout(self) -> None:
lch: int = self.params['lch']
blk_w: int = self.params['blk_w']
blk_h: int = self.params['blk_h']
einfo: MOSEdgeInfo = self.params['einfo']
arr_options: Param = self.params['arr_options']
tech_cls: MOSTech = self.grid.tech_info.get_device_tech('mos', lch=lch,
arr_options=arr_options)
corner_info = tech_cls.get_mos_corner_info(blk_w, blk_h, einfo)
draw_layout_in_template(self, corner_info.lay_info)
self._corner = corner_info.corner
self._edgel = corner_info.edgel
self._edgeb = corner_info.edgeb
| 35.683465
| 99
| 0.629551
| 2,855
| 22,659
| 4.723993
| 0.081961
| 0.037073
| 0.023727
| 0.020761
| 0.781938
| 0.752206
| 0.728628
| 0.708757
| 0.696226
| 0.68681
| 0
| 0.001575
| 0.271504
| 22,659
| 634
| 100
| 35.739748
| 0.815472
| 0.150271
| 0
| 0.658854
| 0
| 0
| 0.132322
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.127604
| false
| 0
| 0.018229
| 0.075521
| 0.247396
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7573973ada8967fe75943ed2b98fb6a5c895ef69
| 120
|
py
|
Python
|
OthelloAI/main.py
|
mario31274/Othello-AI
|
e3ca177a4e9167f67286fe6a0075a2f51e1ab836
|
[
"MIT"
] | null | null | null |
OthelloAI/main.py
|
mario31274/Othello-AI
|
e3ca177a4e9167f67286fe6a0075a2f51e1ab836
|
[
"MIT"
] | null | null | null |
OthelloAI/main.py
|
mario31274/Othello-AI
|
e3ca177a4e9167f67286fe6a0075a2f51e1ab836
|
[
"MIT"
] | null | null | null |
from src.ui import mainFrame
import argparse
# parser = argparse.ArgumentParser(description=)
mainFrame.root.mainloop()
| 24
| 48
| 0.816667
| 14
| 120
| 7
| 0.785714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.091667
| 120
| 5
| 49
| 24
| 0.899083
| 0.383333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
75bc3f9efef90647dc5f76935e1be5ec0f0cd290
| 101
|
py
|
Python
|
src/pybel_tools/validators/__init__.py
|
cthoyt/pybel-tools
|
0bc9f9267178d164dab210f24255793cf4e32ab0
|
[
"MIT"
] | 6
|
2017-03-09T14:28:19.000Z
|
2019-11-21T00:00:15.000Z
|
src/pybel_tools/validators/__init__.py
|
pybel/pybel-tools
|
0bc9f9267178d164dab210f24255793cf4e32ab0
|
[
"MIT"
] | 134
|
2016-11-24T11:10:03.000Z
|
2020-09-10T17:03:13.000Z
|
src/pybel_tools/validators/__init__.py
|
cthoyt/pybel-tools
|
0bc9f9267178d164dab210f24255793cf4e32ab0
|
[
"MIT"
] | 5
|
2017-03-08T13:28:02.000Z
|
2020-04-05T02:23:17.000Z
|
# -*- coding: utf-8 -*-
"""Additional validators and checkers for the correctness of BEL graphs."""
| 25.25
| 75
| 0.683168
| 13
| 101
| 5.307692
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011765
| 0.158416
| 101
| 3
| 76
| 33.666667
| 0.8
| 0.910891
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
75cb352a5be02cd571a13dc240c3307f53fe0ecd
| 210
|
py
|
Python
|
sweeps/config/hyperopt/__init__.py
|
dannygoldstein/sweeps
|
9afd1eb87af59a2b8e1020587876fe944b8e41ad
|
[
"MIT"
] | null | null | null |
sweeps/config/hyperopt/__init__.py
|
dannygoldstein/sweeps
|
9afd1eb87af59a2b8e1020587876fe944b8e41ad
|
[
"MIT"
] | null | null | null |
sweeps/config/hyperopt/__init__.py
|
dannygoldstein/sweeps
|
9afd1eb87af59a2b8e1020587876fe944b8e41ad
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Hyperopt objects
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# import .config.hyperopt
__all__ = [
"hp",
]
| 15
| 38
| 0.719048
| 24
| 210
| 5.541667
| 0.625
| 0.225564
| 0.360902
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005714
| 0.166667
| 210
| 13
| 39
| 16.153846
| 0.754286
| 0.3
| 0
| 0
| 0
| 0
| 0.014388
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0.166667
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
75d92b93e95a89c8bc123d6f9bfa2279cabb8b14
| 206
|
py
|
Python
|
notification_app/serializers.py
|
GDGVIT/hestia-requests
|
666a8b818cccbf968ac8d43d9ced6dba8fd458d5
|
[
"MIT"
] | null | null | null |
notification_app/serializers.py
|
GDGVIT/hestia-requests
|
666a8b818cccbf968ac8d43d9ced6dba8fd458d5
|
[
"MIT"
] | null | null | null |
notification_app/serializers.py
|
GDGVIT/hestia-requests
|
666a8b818cccbf968ac8d43d9ced6dba8fd458d5
|
[
"MIT"
] | null | null | null |
from .models import UserFCMDevice
from rest_framework import serializers
class UserFCMDeviceSerializer(serializers.ModelSerializer):
class Meta:
model = UserFCMDevice
fields = "__all__"
| 29.428571
| 59
| 0.76699
| 19
| 206
| 8.052632
| 0.736842
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184466
| 206
| 7
| 60
| 29.428571
| 0.910714
| 0
| 0
| 0
| 0
| 0
| 0.033816
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
2f002b4cc0a562db1ab0ad5d367cf009428d5ec5
| 12,433
|
py
|
Python
|
tests/unit/test_predicate.py
|
Geeks-Trident-LLC/dlquery
|
1f1b2fa0d25d0ecbdd68691f317cfee0d6b4c8f1
|
[
"BSD-3-Clause"
] | null | null | null |
tests/unit/test_predicate.py
|
Geeks-Trident-LLC/dlquery
|
1f1b2fa0d25d0ecbdd68691f317cfee0d6b4c8f1
|
[
"BSD-3-Clause"
] | null | null | null |
tests/unit/test_predicate.py
|
Geeks-Trident-LLC/dlquery
|
1f1b2fa0d25d0ecbdd68691f317cfee0d6b4c8f1
|
[
"BSD-3-Clause"
] | null | null | null |
from dlapp.predicate import Predicate
import pytest
class TestPredicateRegex:
"""Test class for validating Regex."""
@pytest.mark.parametrize(
"data,key,pattern",
[(dict(key1='Value 1'), 'key1', '[Vv]alue [0-9]+')]
)
def test_match(self, data, key, pattern):
"""Test matching regex."""
chk = Predicate.match(data, key=key, pattern=pattern)
assert chk is True
@pytest.mark.parametrize(
"data,key,pattern",
[(dict(key1='Value 1'), 'key1', '[Vv]alue [a-z]+')]
)
def test_match(self, data, key, pattern):
"""Test matching regex."""
chk = Predicate.notmatch(data, key=key, pattern=pattern)
assert chk is True
class TestPredicateOperator:
"""Test class for validating Operator."""
@pytest.mark.parametrize(
"data,key,op,other",
[
# greater than
(dict(key1=5), 'key1', '>', 3), # compare number a > b
(dict(key1=5), 'key1', 'gt', 3), # compare number a > b
(dict(key1='5.0'), 'key1', 'gt', 3.5), # compare number a > b
(dict(key1='5'), 'key1', 'gt', '-3.3'), # compare number a > b
(dict(key1=True), 'key1', 'gt', False), # compare number a > b
(dict(key1=True), 'key1', 'gt', 'false'), # compare number a > b
(dict(key1='True'), 'key1', 'gt', -1), # compare number a > b
# greater or equal
(dict(key1=5), 'key1', '>=', 3), # compare number a >= b
(dict(key1=5), 'key1', 'ge', 3), # compare number a >= b
(dict(key1='5.0'), 'key1', 'ge', 5), # compare number a >= b
(dict(key1='5'), 'key1', 'ge', '5.0'), # compare number a >= b
(dict(key1=True), 'key1', 'ge', True), # compare number a >= b
(dict(key1=True), 'key1', 'ge', '1'), # compare number a >= b
# less than
(dict(key1=2), 'key1', '<', 3), # compare number a < b
(dict(key1=2), 'key1', 'lt', 3), # compare number a < b
(dict(key1='2.0'), 'key1', 'lt', 3.5), # compare number a < b
(dict(key1='2'), 'key1', 'lt', '3.3'), # compare number a < b
(dict(key1=False), 'key1', 'lt', True), # compare number a < b
(dict(key1='false'), 'key1', 'lt', True), # compare number a < b
(dict(key1='false'), 'key1', 'lt', 2), # compare number a < b
# less than or equal
(dict(key1=2), 'key1', '<=', 3), # compare number a <= b
(dict(key1=2), 'key1', 'le', 3), # compare number a <= b
(dict(key1=2), 'key1', 'le', '2.0'), # compare number a <= b
(dict(key1='2'), 'key1', 'le', '2.0'), # compare number a <= b
(dict(key1=True), 'key1', 'le', '1'), # compare number a <= b
(dict(key1=0), 'key1', 'le', 'false'), # compare number a <= b
# equal
(dict(key1=2), 'key1', '==', 2.0), # compare number a == b
(dict(key1=2), 'key1', 'eq', 2.0), # compare number a == b
(dict(key1=2.0), 'key1', 'eq', '2'), # compare number a == b
(dict(key1='2'), 'key1', 'eq', '2.0'), # compare number a == b
(dict(key1='true'), 'key1', 'eq', 'True'), # compare number a == b
(dict(key1=True), 'key1', 'eq', 1), # compare number a == b
# not equal
(dict(key1=2), 'key1', '!=', 2.5), # compare number a != b
(dict(key1=2), 'key1', 'ne', 2.5), # compare number a != b
(dict(key1=2.5), 'key1', 'ne', '2'), # compare number a != b
(dict(key1='2'), 'key1', 'ne', '2.5'), # compare number a != b
(dict(key1='true'), 'key1', 'ne', 'false'), # compare number a != b
(dict(key1='false'), 'key1', 'ne', '1'), # compare number a != b
]
)
def test_compare_number(self, data, key, op, other):
"""Test comparing number a vs number b."""
chk = Predicate.compare_number(data, key=key, op=op, other=other)
assert chk is True
@pytest.mark.parametrize(
"data,key,op,other",
[
# equal
(dict(key1='abc'), 'key1', '==', 'abc'), # compare string a == string b
(dict(key1='abc'), 'key1', 'eq', 'abc'), # compare string a == string b
(dict(key1='1.0'), 'key1', 'eq', '1.0'), # compare string a == string b
(dict(key1='True'), 'key1', 'eq', 'True'), # compare string a == string b
# not equal
(dict(key1='abc'), 'key1', '!=', 'xyz'), # compare string a != string b
(dict(key1='abc'), 'key1', 'ne', 'xyz'), # compare string a != string b
(dict(key1='1.0'), 'key1', 'ne', '1'), # compare string a != string b
(dict(key1='True'), 'key1', 'ne', 'true'), # compare string a != string b
]
)
def test_compare(self, data, key, op, other):
"""Test comparing string a vs string b."""
chk = Predicate.compare(data, key=key, op=op, other=other)
assert chk is True
class TestPredicateVersion:
"""Test class for validating Version Comparison."""
@pytest.mark.parametrize(
"data,key,op,other",
[
(dict(key='b'), 'key', '>', 'a'), # version a > version b
(dict(key='b'), 'key', 'gt', 'a'), # version a > version b
(dict(key='b'), 'key', 'gt', 'a.b.c.d'), # version a > version b
(dict(key='3'), 'key', 'gt', '2'), # version a > version b
(dict(key='6.4'), 'key', 'gt', '6.3.9-a'), # version a > version b
(dict(key='3.1'), 'key', '>=', '2.9'), # version a >= version b
(dict(key='3.1'), 'key', 'ge', '2.9'), # version a >= version b
(dict(key='6.3.9'), 'key', '<', '6.4'), # version a < version b
(dict(key='6.3.9'), 'key', 'lt', '6.4'), # version a < version b
(dict(key='6.3.9'), 'key', '<=', '6.4'), # version a <= version b
(dict(key='6.3.9'), 'key', 'le', '6.4'), # version a <= version b
(dict(key='5.3.5'), 'key', '==', '5.3.5'), # version a == version b
(dict(key='5.3.5'), 'key', 'eq', '5.3.5'), # version a == version b
(dict(key='1.0.1.a'), 'key', 'eq', '1.0.1.a'), # version a == version b
(dict(key='6.3.9'), 'key', '!=', '6.4.1'), # version a != version b
(dict(key='6.3.9'), 'key', 'ne', '6.4.1'), # version a != version b
]
)
def test_compare_version(self, data, key, op, other):
"""Test comparing version a vs version b."""
chk = Predicate.compare_version(data, key=key, op=op, other=other)
assert chk is True
@pytest.mark.parametrize(
"data,key,op,other",
[
(dict(key='6.4.0'), 'key', '>', '6.3.9-a'), # semantic version a > semantic version b
(dict(key='6.4.0'), 'key', 'gt', '6.3.9-a'), # semantic version a > semantic version b
(dict(key='3.1.0'), 'key', '>=', '2.9.9'), # semantic version a >= semantic version b
(dict(key='3.1.0'), 'key', 'ge', '2.9.9'), # semantic version a >= semantic version b
(dict(key='6.3.9'), 'key', '<', '6.4.0'), # semantic version a < semantic version b
(dict(key='6.3.9'), 'key', 'lt', '6.4.0'), # semantic version a < semantic version b
(dict(key='6.3.9'), 'key', '<=', '6.4.0'), # semantic version a <= semantic version b
(dict(key='6.3.9'), 'key', 'le', '6.4.0'), # semantic version a <= semantic version b
(dict(key='1.0.1-a'), 'key', '==', '1.0.1-a'), # semantic version a == semantic version b
(dict(key='1.0.1-a'), 'key', 'eq', '1.0.1-a'), # semantic version a == semantic version b
(dict(key='6.3.9'), 'key', '!=', '6.4.1'), # semantic version a != semantic version b
(dict(key='6.3.9'), 'key', 'ne', '6.4.1'), # semantic version a != semantic version b
]
)
def test_compare_semantic_version(self, data, key, op, other):
"""Test comparing semantic version a vs semantic version b."""
chk = Predicate.compare_version(data, key=key, op=op, other=other)
assert chk is True
class TestPredicateDate:
"""Test class for validating Date Comparison."""
@pytest.mark.parametrize(
"data,key,op,other",
[
####################### DATETIME COMPARISON ########################
#################################################
# compare regular DATETIME #
#################################################
(dict(key='06/06/2021 13:30:10'), 'key', '>', '01/01/2021 11:20:10'),
(dict(key='06/06/2021 13:30:10.111222'), 'key', 'gt', '01/01/2021 11:20:10.111222'),
(dict(key='06/06/2021 11:30:10 PM'), 'key', 'gt', '06/06/2021 11:30:10 AM'),
(dict(key='06/06/2021 11:30:10.111222 PM'), 'key', 'gt', '06/06/2021 11:30:10.111222 AM'),
(dict(key='06-06-2021 11:30:10.111222 PM'), 'key', 'gt', '06-06-2021 11:30:10.111222 AM'),
(dict(key='Jun 6 11:30:10.111222 PM 2021'), 'key', 'gt', 'Jun 6 2021 11:30:10.111222 AM'),
(dict(key='Sun Jun 6 11:30:10.111222 PM 2021'), 'key', 'gt', 'Jun 6 2021 11:30:10.111222 AM'),
(dict(key='Sun Jun 6 11:30 PM 2021'), 'key', 'gt', 'Jun 6 2021 11:30:10.111222 AM'),
(dict(key='Jun 14 11:30 PM 2021'), 'key', '==', '06/14/2021 23:30:00'),
(dict(key='Jun 14 2021'), 'key', '==', '06/14/2021'),
(dict(key='11:30 PM'), 'key', '==', '23:30:00'),
#################################################
# compare ISO DATETIME #
#################################################
(dict(key='2021-06-14T08:30:00+00:00'), 'key', 'gt', '2021-06-14T07:30:00+00:00 iso=True'),
#################################################
# compare DATETIME with timezone option #
#################################################
(
dict(key='Sun Mar 14 00:30:30 AM 2021'), 'key',
'<', # less than
'Sunday March 2021 02:10:30 AM PDT timezone=PST: -28800, PDT: -25200'
),
(
dict(key='Sun Mar 14 00:30:30 AM PST 2021'), 'key',
'<', # less than
'Sunday March 2021 02:10:30 AM PDT timezone=PST: -28800, PDT: -25200'
),
(
dict(key='Sun Mar 14 00:30:30 AM PST 2021'), 'key',
'<', # less than
'Sunday March 2021 02:10:30 AM PDT timezone=PST: -28800, PDT: America/Los_Angeles'
),
#################################################
# compare DATETIME with dayfirst option #
#################################################
(
dict(key='14/03/21 01:30:30 AM PST'), 'key',
'>', # greater than
'14/03/21 02:10:30 AM PDT timezone=PST: -28800, PDT: -25200 dayfirst=True'
),
(
dict(key='21/03/14 01:30:30 AM PST'), 'key',
'>', # greater than
'21/03/14 02:10:30 AM PDT timezone=PST: -28800, PDT: -25200 dayfirst=False'
),
#################################################
# compare DATETIME with fuzzy option #
#################################################
(
dict(key='today is Mon Jun 14 03:00:00 PM 2021'), 'key',
'==', # equal
'today is 2021-06-14 15:00:00 fuzzy=True'
),
]
)
def test_compare_datetime(self, data, key, op, other):
"""Test comparing a datetime vs other datetime."""
chk = Predicate.compare_datetime(data, key=key, op=op, other=other)
assert chk is True
| 54.056522
| 107
| 0.441567
| 1,580
| 12,433
| 3.463924
| 0.072785
| 0.058469
| 0.097204
| 0.104148
| 0.821853
| 0.786954
| 0.750777
| 0.714599
| 0.656678
| 0.54577
| 0
| 0.102319
| 0.327113
| 12,433
| 229
| 108
| 54.292576
| 0.551877
| 0.219336
| 0
| 0.25
| 0
| 0.028409
| 0.242347
| 0.005546
| 0
| 0
| 0
| 0
| 0.039773
| 1
| 0.039773
| false
| 0
| 0.011364
| 0
| 0.073864
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f93d14ec9cf2f97f49b08c5f140aba20b2914eb2
| 168
|
py
|
Python
|
tweepy/utils.py
|
itsMo07/tweepy
|
6d3512b9cf3ebeabeb816d402fcda2a83ef51863
|
[
"MIT"
] | 7,201
|
2015-01-01T05:26:25.000Z
|
2022-03-31T18:13:39.000Z
|
tweepy/utils.py
|
itsMo07/tweepy
|
6d3512b9cf3ebeabeb816d402fcda2a83ef51863
|
[
"MIT"
] | 1,111
|
2015-01-01T18:38:34.000Z
|
2022-03-31T18:10:39.000Z
|
tweepy/utils.py
|
itsMo07/tweepy
|
6d3512b9cf3ebeabeb816d402fcda2a83ef51863
|
[
"MIT"
] | 4,042
|
2015-01-01T03:21:24.000Z
|
2022-03-31T10:31:40.000Z
|
# Tweepy
# Copyright 2010-2021 Joshua Roesslein
# See LICENSE for details.
def list_to_csv(item_list):
if item_list:
return ','.join(map(str, item_list))
| 18.666667
| 44
| 0.696429
| 25
| 168
| 4.48
| 0.8
| 0.214286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.059259
| 0.196429
| 168
| 8
| 45
| 21
| 0.77037
| 0.404762
| 0
| 0
| 0
| 0
| 0.010417
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f9510d999f14395ff16c5d7b2a53d37867f707e8
| 31
|
py
|
Python
|
thermo-env/lib/python3.5/reprlib.py
|
ndebuhr/thermoModelingAlpha
|
9e1a0f9ac4caabf386c1e3103ec69f269131a6b9
|
[
"MIT"
] | 4
|
2017-09-24T21:30:46.000Z
|
2019-06-01T13:37:44.000Z
|
thermo-env/lib/python3.5/reprlib.py
|
ndebuhr/thermo-state-solver
|
9e1a0f9ac4caabf386c1e3103ec69f269131a6b9
|
[
"MIT"
] | 19
|
2020-01-28T21:41:50.000Z
|
2022-03-11T23:17:39.000Z
|
thermo-env/lib/python3.5/reprlib.py
|
ndebuhr/thermo-state-solver
|
9e1a0f9ac4caabf386c1e3103ec69f269131a6b9
|
[
"MIT"
] | null | null | null |
/usr/lib64/python3.5/reprlib.py
| 31
| 31
| 0.806452
| 6
| 31
| 4.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.129032
| 0
| 31
| 1
| 31
| 31
| 0.677419
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f967e2236f8d01b9716502b37e800032831fdcd1
| 682
|
py
|
Python
|
app/forms.py
|
seanziegler/GatorLF
|
9a05c5cb7df349be04de2d94adc061a9d09cc4f5
|
[
"MIT"
] | null | null | null |
app/forms.py
|
seanziegler/GatorLF
|
9a05c5cb7df349be04de2d94adc061a9d09cc4f5
|
[
"MIT"
] | null | null | null |
app/forms.py
|
seanziegler/GatorLF
|
9a05c5cb7df349be04de2d94adc061a9d09cc4f5
|
[
"MIT"
] | null | null | null |
from flask_wtf import Form
from wtforms import TextField, DateTimeField, SubmitField
from flask_wtf.file import FileField, FileAllowed
import wtforms.validators as validators
class LostForm(Form):
title = TextField('What did you find?', validators = [validators.DataRequired(), validators.length(10)])
date = DateTimeField('When did you find it?', validators = [validators.DataRequired()])
email = TextField('Enter your email.', validators = [validators.DataRequired(), validators.Email()])
image = FileField('Upload a picture.', validators = [FileAllowed(['.jpg', '.jpeg', '.png', '.gif'], "Image formats only!")])
submit = SubmitField()
| 52.461538
| 132
| 0.705279
| 74
| 682
| 6.472973
| 0.554054
| 0.125261
| 0.200418
| 0.175365
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003497
| 0.16129
| 682
| 12
| 133
| 56.833333
| 0.833916
| 0
| 0
| 0
| 0
| 0
| 0.159824
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
f9691f804195a8e45d3f9accb833a8b53062e4a6
| 249
|
py
|
Python
|
prettyqt/widgets/styleoptiongraphicsitem.py
|
phil65/PrettyQt
|
26327670c46caa039c9bd15cb17a35ef5ad72e6c
|
[
"MIT"
] | 7
|
2019-05-01T01:34:36.000Z
|
2022-03-08T02:24:14.000Z
|
prettyqt/widgets/styleoptiongraphicsitem.py
|
phil65/PrettyQt
|
26327670c46caa039c9bd15cb17a35ef5ad72e6c
|
[
"MIT"
] | 141
|
2019-04-16T11:22:01.000Z
|
2021-04-14T15:12:36.000Z
|
prettyqt/widgets/styleoptiongraphicsitem.py
|
phil65/PrettyQt
|
26327670c46caa039c9bd15cb17a35ef5ad72e6c
|
[
"MIT"
] | 5
|
2019-04-17T11:48:19.000Z
|
2021-11-21T10:30:19.000Z
|
from __future__ import annotations
from prettyqt import widgets
from prettyqt.qt import QtWidgets
QtWidgets.QStyleOptionGraphicsItem.__bases__ = (widgets.StyleOption,)
class StyleOptionGraphicsItem(QtWidgets.QStyleOptionGraphicsItem):
pass
| 20.75
| 69
| 0.843373
| 23
| 249
| 8.782609
| 0.608696
| 0.118812
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 249
| 11
| 70
| 22.636364
| 0.90991
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.166667
| 0.5
| 0
| 0.666667
| 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
| 1
| 1
| 1
| 0
| 0
| 0
|
0
| 4
|
f973ff1dc5b28115bb8fb2a9d37c24ff23cb7eb8
| 136
|
py
|
Python
|
automation_engine/mqtt/__init__.py
|
trickeydan/automation-engine
|
aa9663219704f922ff5a4e3a3841cd8c131e931c
|
[
"MIT"
] | null | null | null |
automation_engine/mqtt/__init__.py
|
trickeydan/automation-engine
|
aa9663219704f922ff5a4e3a3841cd8c131e931c
|
[
"MIT"
] | 9
|
2022-03-26T20:06:35.000Z
|
2022-03-30T19:59:14.000Z
|
automation_engine/mqtt/__init__.py
|
trickeydan/automation-engine
|
aa9663219704f922ff5a4e3a3841cd8c131e931c
|
[
"MIT"
] | null | null | null |
"""MQTT Helper Functions and Classes."""
from .topic import Topic
from .wrapper import MQTTWrapper
__all__ = ["Topic", "MQTTWrapper"]
| 19.428571
| 40
| 0.735294
| 16
| 136
| 6
| 0.6875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.139706
| 136
| 6
| 41
| 22.666667
| 0.820513
| 0.25
| 0
| 0
| 0
| 0
| 0.166667
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
f97d1f912d3a0659576aa2e237c07e3cc9080ac3
| 339
|
py
|
Python
|
inet/admin.py
|
MartorSkull/serverinet
|
d9bed0b732136321654f4a4e14b00c61640366ea
|
[
"MIT"
] | null | null | null |
inet/admin.py
|
MartorSkull/serverinet
|
d9bed0b732136321654f4a4e14b00c61640366ea
|
[
"MIT"
] | null | null | null |
inet/admin.py
|
MartorSkull/serverinet
|
d9bed0b732136321654f4a4e14b00c61640366ea
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from . import models
# Register your models here.
admin.site.register(models.Boya)
admin.site.register(models.Categoria)
admin.site.register(models.Competidor)
admin.site.register(models.Participante)
admin.site.register(models.Registro)
| 22.6
| 40
| 0.79646
| 45
| 339
| 5.888889
| 0.466667
| 0.169811
| 0.320755
| 0.433962
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.003247
| 0.091445
| 339
| 14
| 41
| 24.214286
| 0.857143
| 0.141593
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.375
| 0
| 0.375
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
f9815e015534a67848d3a31375a22f8e6daafab4
| 10,275
|
py
|
Python
|
databases/seeds/recipe_table_seeder.py
|
tazmancooks/masonite_recipes_backend_project_4
|
722f7c62bac0f1570cba39ea2c89ddc53a2c7145
|
[
"MIT"
] | null | null | null |
databases/seeds/recipe_table_seeder.py
|
tazmancooks/masonite_recipes_backend_project_4
|
722f7c62bac0f1570cba39ea2c89ddc53a2c7145
|
[
"MIT"
] | null | null | null |
databases/seeds/recipe_table_seeder.py
|
tazmancooks/masonite_recipes_backend_project_4
|
722f7c62bac0f1570cba39ea2c89ddc53a2c7145
|
[
"MIT"
] | null | null | null |
"""RecipeTableSeeder Seeder."""
from masoniteorm.seeds import Seeder
from app.Recipe import Recipe
class RecipeTableSeeder(Seeder):
def run(self):
Recipe.create({"name": "Air Fryer Salmon", "description": "A quick and delicious air fryer recipe for salmon filets", "image": "https://simplyhomecooked.com/wp-content/uploads/2021/04/air-fryer-salmon-recipe-12-683x1024.jpg", "instructions": "Rub the salmon filet with the oil and pressed garlic\ Mix ¼ cup of each seasoning and rub on salmon filet\ Oil your fryer basket\sheet\ Cook for 15 minutes at 400°F (If using a basket fryer flip filet half way through cooking.)", "ingredients": "Salmon Filet\ Olive Oil (or oil of preference)\ Pressed Garlic\ Paprika\ Thyme\ Brown Sugar\ Salt\ Pepper", "author": "Simply Home Cooked", "url": "https://simplyhomecooked.com/air-fryer-salmon/"})
Recipe.create({"name": "Chocolate Chunk Brownies", "description": "A chocolate lovers dream! Delicious brownies with chocolate chunks throughout", "image": "https://www.modernhoney.com/wp-content/uploads/2016/01/DSC_0199ed.jpg", "instructions": "Preheat oven to 350 degrees.\ In a large mixing bowl - cream together butter sugar and brown sugar for 3-4 minutes or until light and fluffy. Add eggs one at a time mixing well after each addition. Add vanilla.\ Stir in remaining dry ingredients until mixed together.\ Fold in chocolate chips.\ Pour into 9 x 13 pan and spread evenly.\ Bake for 28-36 minutes.", "ingredients": "1 cup Butter softened\ 2 cups Sugar\ 1 cup Brown Sugar\ 4 Eggs\ 1 Tablespoon Vanilla\ 1 cup Flour\ 1/2 cup Cake Flour\ 1 cup Cocoa Powder\ 1/2 teaspoon Salt\ 1 1/2 cups Semi-Sweet Chocolate Chunks or Chips\ *Optional: add 8-ounce jar Dulce de Leche. Carefully heat in the microwave. Swirl in 4 ounces into the batter. Bake. Top brownies with remaining Dulce de Leche.", "author": "Modern Honey", "url": "https://www.modernhoney.com/better-than-a-boyfriend-brownies/"})
Recipe.create({"name": "Chicken Teriyaki", "description": "A clasic teriyaki chicken recipe", "image": "https://cdn.discordapp.com/attachments/668856899503915047/919743208991367168/Screen_Shot_2021-12-12_at_4.09.59_PM.png", "instructions": "In a small saucepan\ combine all ingredients except cornstarch and chicken. Bring to boil over high heat. Reduce heat to low and stir until sugar is dissolved - about 3 minutes. Remove from heat and let cool. Discard cinnamon stick and mix in 1/2 cup water.\ Place chicken in a heavy-duty sealable plastic bag. Add soy sauce mixture - seal bag - and turn to coat chicken. Refrigerate for at least an hour - ideally overnight.\ Remove chicken and set aside. Pour mixture into a small saucepan. Bring to a boil over high heat\ then reduce heat to low. Mix cornstarch with 2 tablespoons water and add to pan. Stir until mixture begins to thicken - and gradually stir in enough water (about 1/2 cup) until sauce is the consistency of heavy cream. Remove from heat and set aside.\ Preheat a broiler or grill. Lightly brush chicken pieces on all sides with sauce and broil or grill about 3 minutes per side. While chicken is cooking place sauce over high heat and bring to a boil - then reduce heat to a bare simmer adding water a bit at a time to keep mixture at a pourable consistency. To serve\ slice chicken into strips\ arrange on plates\ and drizzle with sauce.", "ingredients": "1 Cup Soy Sauce\ 1 Cup Granulated Sugar\ 1 ½ teaspoons brown sugar\ 6 cloves garlic\ crushed in a press\ 2 tablespoons grated fresh ginger\ ¼ teaspoon freshly ground black pepper\ 1 3-inch cinnamon stick\ 1 tablespoon pineapple juice\ 8 skinless\ boneless chicken thighs\ 2 tablespoons cornstarch", "author": "NY Times", "url": "https://cooking.nytimes.com/recipes/1012984-chicken-teriyaki"})
Recipe.create({"name": "Fetuccine Alfredo", "description": "A creamy and delicious fetuccine alfredo recipe", "image": "https://www.modernhoney.com/wp-content/uploads/2018/08/Fettuccine-Alfredo-Recipe-1.jpg", "instructions": "In a large pot\ heat water over high heat until boiling. Add salt to season the water. Once it is boiling add fettuccine and cook according to package instructions.\ In a large skillet or pan heat butter over medium heat. Add minced garlic and cook for 1 to 2 minutes. Stir in heavy cream.\ Let heavy cream reduce and cook for 5 to 8 minutes. Add half of the parmesan cheese to the mixture and whisk well until smooth. Keep over heat and whisk well until cheese is melted.\ Save some pasta water. The pasta water is full of flavor and can be used to thin out the sauce\ Toss alfredo sauce with fettuccine pasta and add half of the parmesan cheese. Once it is tossed garnish with the remaining parmesan cheese. Add a little pasta water if it needs to be thinned out\ Garnish with Italian parsley.", "ingredients": "1 lb Fettuccine Pasta\ 6 Tablespoons Butter\ 1 Garlic Clove (minced)\ 1 1/2 cups Heavy Cream\ 1/4 teaspoon Salt\ 1 1/4 cup Shredded Parmesan Cheese\ 1/4 teaspoon Pepper\ 2 Tablespoons Italian Parsley (optional)", "author": "Modern Honey", "url": "https://www.modernhoney.com/fettuccine-alfredo/"})
Recipe.create({"name": "Quick and Easy Sausage Rolls", "description": "A fast sausage roll recipe that only requires 5 ingredients!", "image": "https://img.taste.com.au/q5tyDCvL/w720-h480-cfill-q80/taste/2020/07/august20_5-ingredient-sausage-rolls-163613-1.jpg", "instructions": "Preheat oven to 200°C. Line a baking tray with baking paper. Heat a non-stick frying pan over medium heat. Add onion and 1 tsp fennel seeds. Cook while stirring for 5 mins or until the onion softens. Cool slightly. Transfer to a bowl with the sausage. Use your hands to mix until combined. Divide into 3 portions.\ Cut the whole pastry sheet in half. Place 1 pastry half on a clean work surface. Shape 1 portion of sausage mixture into a 3cm x 24cm log. Place along 1 long edge of pastry half. Brush edges of pastry with a little egg. Roll up to enclose the filling. Cut into 4 pieces and place seam-side down on lined tray. Repeat with remaining pastry halves and sausage mixture. Brush with the remaining egg and sprinkle with the remaining 1 tsp fennel seeds.\ Bake for 25 mins or until the pastry is puffed and golden and the filling is cooked through.", "ingredients": "1 brown onion, coarsely grated\ 2 tsp fennel seeds\ 500g pkt Garlic & Herb Pork Sausages, casings removed\ 1 1/2 sheets frozen puff pastry, thawed\ 1 Egg, lightly whisked", "author": "Taste.com.au", "url": "https://www.taste.com.au/recipes/5-ingredient-sausage-rolls-recipe/9iw05lvv"})
Recipe.create({"name": "Japanese Fluffy Pancakes", "description": "The trendy fluffy pancakes you've always wanted to try!", "image": "https://food.fnr.sndimg.com/content/dam/images/food/fullset/2017/4/7/0/FNK_Fluffy-Japanese-Pancakes-H_s4x3.jpg.rend.hgtvcom.826.620.suffix/1491598033896.jpeg", "instructions": "Whisk together the flour, confectioners' sugar, baking powder and salt in a large bowl.\Whisk together the milk, melted butter, vanilla and egg yolk in a medium bowl until combined.\Beat the egg whites and cream of tartar in another large bowl with an electric mixer on medium-high speed until stiff peaks form, about 2 minutes.\Stir the milk mixture into the flour mixture until just combined (it's OK if there are a few lumps). Stir one-third of the beaten egg whites into the flour-milk mixture. Then gently fold in the remaining egg whites until just combined (take care not to overmix).\Lightly spray the inside of four 3-inch-wide-by-2 1/2-inch-high ring molds with nonstick cooking spray\Coat a large nonstick skillet with nonstick cooking spray and heat over medium-low heat. Put the prepared ring molds in the middle of the skillet and fill each with 1/2 cup of batter (it should fill each ring mold about halfway). Cover the skillet with the lid and cook until the batter rises to the tops of the ring molds and is golden on the bottom, about 5 minutes. Release the bottom of the pancakes with a spatula. Grasp the sides of the ring molds with tongs to stabilize them and then carefully flip. Cover and cook until golden on the other side, about 5 minutes more. Transfer to a plate and remove the mold. Serve with butter and maple syrup. The pancakes should be eaten before they deflate.\Lightly spray the ring molds and coat the skillet with nonstick cooking spray and repeat the cooking method with the remaining batter.", "ingredients": "1 1/2 cups all-purpose flour (see Cook's Note)\ 3 tablespoons confectioners' sugar\ 2 teaspoons baking powder\ 2 teaspoons baking powder\ 1/2 teaspoon kosher salt\ 1 1/4 cups milk\ 4 tablespoons unsalted butter, melted and cooled, plus more for serving\ 1/2 teaspoon pure vanilla extract\ 1 large egg yolk plus 3 large egg whites\ 1/4 teaspoon cream of tartar", "author": "Food Network Kitchen", "url": "https://www.foodnetwork.com/recipes/food-network-kitchen/fluffy-japanese-pancakes-3686850"})
Recipe.create({"name": "Crockpot Sloppy Joe Sliders", "description": "A set it and forget it sloppy joe slider recipe", "image": "https://food.fnr.sndimg.com/content/dam/images/food/fullset/2016/9/16/0/VB0403H_Slow-Cooker-Sloppy-Joe-Sliders_s4x3.jpg.rend.hgtvcom.826.620.suffix/1475265657494.jpeg", "instructions": "In a 4- to 6-quart slow cooker, combine the ground beef, garlic, celery, peppers, onions, tomato sauce, ketchup, chili powder, dry mustard, onion powder, sugar, Worcestershire sauce, 1 teaspoon salt and 1/4 teaspoon pepper. Mix together with a wooden spoon, making sure to break up the ground beef. Set the machine to high and cook for 4 hours.\ Assemble your sloppy joe sliders and serve!", "ingredients": "1 1/2 pounds ground beef (80 percent lean)\ 2 cloves garlic, grated\ 1 inner stalk celery (with leaves), finely chopped\ 1 red bell pepper, finely chopped\ 1/2 onion, finely chopped\ One 14.5-ounce can tomato sauce, such as Pomi\ 1/2 cup ketchup\ 1 tablespoon chili powder\ 1 tablespoon dry mustard\ 1 tablespoon onion powder\ 1 tablespoon sugar\ 1 tablespoon Worcestershire sauce\ Kosher salt and freshly ground black pepper\ 16 slider buns or mini potato rolls, split", "author": "Valerie Bertinelli", "url": "https://www.foodnetwork.com/recipes/valerie-bertinelli/slow-cooker-sloppy-joe-sliders-3497618"})
| 685
| 2,367
| 0.770998
| 1,711
| 10,275
| 4.628288
| 0.32671
| 0.003788
| 0.014143
| 0.011113
| 0.079303
| 0.065665
| 0.04243
| 0.034853
| 0.013386
| 0.013386
| 0
| 0.0389
| 0.146861
| 10,275
| 15
| 2,368
| 685
| 0.863222
| 0.002433
| 0
| 0
| 0
| 2.181818
| 0.933333
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.090909
| false
| 0
| 0.181818
| 0
| 0.363636
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
f98202397d2de27b4bce8545c588ee231f12902c
| 113
|
py
|
Python
|
Python_Basics/Conditional/conditional_exec.py
|
samyumobi/A-Complete-Python-Guide-For-Beginners
|
6ee3d73ebb481dbb5788cb0e615efdaf09079a18
|
[
"MIT"
] | 7
|
2019-06-04T13:44:27.000Z
|
2021-01-05T22:42:15.000Z
|
Python_Basics/Conditional/conditional_exec.py
|
samyumobi/A-Complete-Python-Guide-For-Beginners
|
6ee3d73ebb481dbb5788cb0e615efdaf09079a18
|
[
"MIT"
] | null | null | null |
Python_Basics/Conditional/conditional_exec.py
|
samyumobi/A-Complete-Python-Guide-For-Beginners
|
6ee3d73ebb481dbb5788cb0e615efdaf09079a18
|
[
"MIT"
] | 5
|
2019-09-14T11:37:47.000Z
|
2021-07-26T19:49:24.000Z
|
x = int(input("Please enter a number: "))
if x % 2 == 0 :
print(x, "is even")
else :
print(x, "is odd")
| 16.142857
| 41
| 0.522124
| 20
| 113
| 2.95
| 0.75
| 0.20339
| 0.271186
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.02439
| 0.274336
| 113
| 6
| 42
| 18.833333
| 0.695122
| 0
| 0
| 0
| 0
| 0
| 0.318584
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.4
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.