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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eabb21d1966ce74869f30e3f2e3446bf01b5f6df | 45 | py | Python | model/__init__.py | yuranusduke/CMT-Convolutional-NN-Meets-ViT | dfc6654956a0defba7b7d8bb9e4a6f219cdb9ad5 | [
"MIT"
] | 13 | 2021-07-16T02:57:17.000Z | 2021-09-02T10:19:14.000Z | model/__init__.py | yuranusduke/CMT-Convolutional-NN-Meets-ViT | dfc6654956a0defba7b7d8bb9e4a6f219cdb9ad5 | [
"MIT"
] | 2 | 2021-07-24T22:39:36.000Z | 2021-08-05T11:19:47.000Z | model/__init__.py | yuranusduke/CMT-Convolutional-NN-Meets-ViT | dfc6654956a0defba7b7d8bb9e4a6f219cdb9ad5 | [
"MIT"
] | 3 | 2021-07-24T18:48:44.000Z | 2021-09-02T10:19:16.000Z | from .cmt import CMT_Ti, CMT_XS, CMT_S, CMT_B | 45 | 45 | 0.777778 | 11 | 45 | 2.818182 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 45 | 1 | 45 | 45 | 0.794872 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
eae4403beedf5600ca039d8db9cc72f33782ab65 | 96 | py | Python | bitmovin_api_sdk/encoding/inputs/generic_s3/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/encoding/inputs/generic_s3/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/encoding/inputs/generic_s3/customdata/__init__.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | from bitmovin_api_sdk.encoding.inputs.generic_s3.customdata.customdata_api import CustomdataApi
| 48 | 95 | 0.90625 | 13 | 96 | 6.384615 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.041667 | 96 | 1 | 96 | 96 | 0.891304 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
d8002bd5ab8ea9d83f6bdb5195b4e12a023770bd | 69 | py | Python | digitgenerator/__init__.py | kutvonenaki/python-handwritten-digit-gen | fff19cb187beac3f1e2927a325661fe3de8b4acb | [
"MIT"
] | null | null | null | digitgenerator/__init__.py | kutvonenaki/python-handwritten-digit-gen | fff19cb187beac3f1e2927a325661fe3de8b4acb | [
"MIT"
] | null | null | null | digitgenerator/__init__.py | kutvonenaki/python-handwritten-digit-gen | fff19cb187beac3f1e2927a325661fe3de8b4acb | [
"MIT"
] | null | null | null | from .digitgenerator_main import Digitgenerator
from .VAE import Vae
| 23 | 47 | 0.855072 | 9 | 69 | 6.444444 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115942 | 69 | 2 | 48 | 34.5 | 0.95082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
d821e00d7afef158af284991512d88c38669904b | 169 | py | Python | ex007.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex007.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | ex007.py | LeoWshington/Exercicios_CursoEmVideo_Python | 294d14d9aaab5e32aaf39d70b0cd1266f0b55a02 | [
"MIT"
] | null | null | null | nota1 = float(input('Primeira nota do aluno: '))
nota2 = float(input('Segunda nota do aluno: '))
print(f'A média entre {nota1} e {nota2} é {(nota1 + nota2) / 2 :.1f}.')
| 42.25 | 71 | 0.64497 | 27 | 169 | 4.037037 | 0.666667 | 0.183486 | 0.201835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.056338 | 0.159763 | 169 | 3 | 72 | 56.333333 | 0.711268 | 0 | 0 | 0 | 0 | 0.333333 | 0.639053 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dc2f0854f51ceba7f37e92f3de3f3350fe848c93 | 10,237 | py | Python | tests/tune/test_tune_IC_grid.py | mtcrawshaw/meta-world | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | 4 | 2021-09-21T07:24:26.000Z | 2022-03-25T00:28:33.000Z | tests/tune/test_tune_IC_grid.py | mtcrawshaw/meta | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | null | null | null | tests/tune/test_tune_IC_grid.py | mtcrawshaw/meta | b511885af4405715c7b35f8295cef88021a926be | [
"MIT"
] | null | null | null | """
Unit tests for IC grid search in meta/tune/tune.py.
"""
import os
import json
from typing import Dict, Any, Tuple
from meta.tune.tune import tune
from tests.tune.templates import resume_template
IC_GRID_CONFIG_PATH = os.path.join("configs", "tune_IC_grid.json")
def test_tune_IC_grid_values() -> None:
"""
Runs hyperparameter IC grid search and makes sure that the correct parameter
combinations are used for training.
"""
# Load hyperparameter search config.
with open(IC_GRID_CONFIG_PATH, "r") as config_file:
config = json.load(config_file)
# Construct expected param value intervals.
param_intervals = {
"initial_lr": [1e-5, 1e-3],
"num_layers": [1, 8],
"recurrent": [True, False],
}
# Run training and extract actual configs from results.
results = tune(config)
actual_configs = [
config_results["config"] for config_results in results["iterations"]
]
# Verify configs from training.
iteration = 0
best_param_vals: Dict[str, float] = {}
for param_name, param_values in param_intervals.items():
param_fitnesses = {}
for param_val in param_values:
# Check values.
for best_param_name, best_param_val in best_param_vals.items():
found, result = dict_search(actual_configs[iteration], best_param_name)
assert found
assert result == best_param_val
# Store fitnesses for comparison.
param_fitnesses[param_val] = results["iterations"][iteration]["fitness"]
iteration += 1
best_param_val = dict_argmax(param_fitnesses)
best_param_vals[param_name] = best_param_val
def test_tune_IC_grid_metrics() -> None:
"""
Runs hyperparameter IC grid search and compares metrics against a saved baseline.
"""
# Load hyperparameter search config.
with open(IC_GRID_CONFIG_PATH, "r") as config_file:
config = json.load(config_file)
# Modify default training config.
config["base_train_config"]["baseline_metrics_filename"] = "tune_IC_grid"
# Run training.
tune(config)
def test_tune_IC_grid_early_stop_param() -> None:
"""
Runs hyperparameter IC grid search until an early stop point between params.
"""
# Load hyperparameter search config.
with open(IC_GRID_CONFIG_PATH, "r") as config_file:
config = json.load(config_file)
# Modify default training config to stop early.
config["early_stop"] = {"param_num": 2, "val_num": 0, "trials": 0}
# Run training.
results = tune(config)
# Check results.
param_iterations = (
lambda p: p["num_values"] if "num_values" in p else len(p["choices"])
)
expected_iterations = 0
param_names = list(config["search_params"].keys())
for i in range(config["early_stop"]["param_num"]):
expected_iterations += param_iterations(config["search_params"][param_names[i]])
assert len(results["iterations"]) == expected_iterations
for config_results in results["iterations"]:
assert len(config_results["trials"]) == config["trials_per_config"]
def test_tune_IC_grid_early_stop_iteration() -> None:
"""
Runs hyperparameter IC grid search until an early stop point between iterations.
"""
# Load hyperparameter search config.
with open(IC_GRID_CONFIG_PATH, "r") as config_file:
config = json.load(config_file)
# Modify default training config to stop early.
config["early_stop"] = {"param_num": 1, "val_num": 1, "trials": 0}
# Run training.
results = tune(config)
# Check results.
param_iterations = (
lambda p: p["num_values"] if "num_values" in p else len(p["choices"])
)
expected_iterations = 0
param_names = list(config["search_params"].keys())
for i in range(config["early_stop"]["param_num"]):
expected_iterations += param_iterations(config["search_params"][param_names[i]])
expected_iterations += config["early_stop"]["val_num"]
assert len(results["iterations"]) == expected_iterations
for config_results in results["iterations"]:
assert len(config_results["trials"]) == config["trials_per_config"]
def test_tune_IC_grid_early_stop_trial() -> None:
"""
Runs hyperparameter IC grid search until an early stop point between trials of an
iteration.
"""
# Load hyperparameter search config.
with open(IC_GRID_CONFIG_PATH, "r") as config_file:
config = json.load(config_file)
# Modify default training config to stop early.
config["early_stop"] = {"param_num": 2, "val_num": 1, "trials": 1}
# Run training.
results = tune(config)
# Check results.
param_iterations = (
lambda p: p["num_values"] if "num_values" in p else len(p["choices"])
)
expected_iterations = 0
param_names = list(config["search_params"].keys())
for i in range(config["early_stop"]["param_num"]):
expected_iterations += param_iterations(config["search_params"][param_names[i]])
expected_iterations += config["early_stop"]["val_num"]
assert len(results["iterations"]) == expected_iterations
for config_results in results["iterations"]:
assert len(config_results["trials"]) == config["trials_per_config"]
def test_tune_IC_grid_resume_iteration() -> None:
"""
Runs partial training, saves a checkpoint between iterations, then resumes from
checkpoint and finishes training, comparing results against a non-interrupted
version.
"""
# Set up case.
save_name = "test_tune_IC_grid_resume_iteration"
config_path = IC_GRID_CONFIG_PATH
early_stops = [{"param_num": 1, "val_num": 1, "trials": 0}]
baseline_name = "tune_IC_grid"
results_name = "tune_IC_grid"
# Call template.
resume_template(save_name, config_path, early_stops, baseline_name, results_name)
def test_tune_IC_grid_resume_trial() -> None:
"""
Runs partial training, saves a checkpoint between trials, then resumes from
checkpoint and finishes training, comparing results against a non-interrupted
version.
"""
# Set up case.
save_name = "test_tune_IC_grid_resume_trial"
config_path = IC_GRID_CONFIG_PATH
early_stops = [{"param_num": 2, "val_num": 1, "trials": 1}]
baseline_name = "tune_IC_grid"
results_name = "tune_IC_grid"
# Call template.
resume_template(save_name, config_path, early_stops, baseline_name, results_name)
def test_tune_IC_grid_resume_x2_iteration_x2() -> None:
"""
Runs partial training, saves checkpoint between iterations, resumes from checkpoint,
runs more training, saves checkpoint between iterations, resumes from checkpoint and
finishes training. Then compares results against a non-interrupted version.
"""
# Set up case.
save_name = "test_tune_IC_grid_resume_x2_iteration_x2"
config_path = IC_GRID_CONFIG_PATH
early_stops = [
{"param_num": 1, "val_num": 0, "trials": 0},
{"param_num": 2, "val_num": 1, "trials": 0},
]
baseline_name = "tune_IC_grid"
results_name = "tune_IC_grid"
# Call template.
resume_template(save_name, config_path, early_stops, baseline_name, results_name)
def test_tune_IC_grid_resume_x2_trial_x2() -> None:
"""
Runs partial training, saves checkpoint between trials, resumes from checkpoint,
runs more training, saves checkpoint between trials, resumes from checkpoint and
finishes training. Then compares results against a non-interrupted version.
"""
# Set up case.
save_name = "test_tune_IC_grid_resume_x2_trial_x2"
config_path = IC_GRID_CONFIG_PATH
early_stops = [
{"param_num": 0, "val_num": 1, "trials": 1},
{"param_num": 1, "val_num": 0, "trials": 1},
]
baseline_name = "tune_IC_grid"
results_name = "tune_IC_grid"
# Call template.
resume_template(save_name, config_path, early_stops, baseline_name, results_name)
def test_tune_IC_grid_resume_x2_iteration_trial() -> None:
"""
Runs partial training, saves checkpoint between iterations, resumes from checkpoint,
runs more training, saves checkpoint between trials, resumes from checkpoint and
finishes training. Then compares results against a non-interrupted version.
"""
# Set up case.
save_name = "test_tune_IC_grid_resume_x2_iteration_trial"
config_path = IC_GRID_CONFIG_PATH
early_stops = [
{"param_num": 1, "val_num": 0, "trials": 0},
{"param_num": 2, "val_num": 0, "trials": 1},
]
baseline_name = "tune_IC_grid"
results_name = "tune_IC_grid"
# Call template.
resume_template(save_name, config_path, early_stops, baseline_name, results_name)
def test_tune_IC_grid_resume_x2_trial_iteration() -> None:
"""
Runs partial training, saves checkpoint between trials, resumes from checkpoint,
runs more training, saves checkpoint between iterations, resumes from checkpoint and
finishes training. Then compares results against a non-interrupted version.
"""
# Set up case.
save_name = "test_tune_IC_grid_resume_x2_trial_iteration"
config_path = IC_GRID_CONFIG_PATH
early_stops = [
{"param_num": 0, "val_num": 1, "trials": 1},
{"param_num": 2, "val_num": 0, "trials": 0},
]
baseline_name = "tune_IC_grid"
results_name = "tune_IC_grid"
# Call template.
resume_template(save_name, config_path, early_stops, baseline_name, results_name)
def dict_argmax(d: Dict[Any, Any]) -> Any:
""" Compute argmax for a dictionary with numerical values. """
argmax = None
best_val = None
for arg, val in d.items():
if argmax is None or val > best_val:
argmax = arg
best_val = val
return argmax
def dict_search(d: Dict[str, Any], key: str) -> Tuple[bool, Any]:
"""
Recursively search through a dictionary to find the value corresponding to ``key``.
"""
for k, v in d.items():
if k == key:
return True, v
elif isinstance(v, dict):
found, result = dict_search(v, key)
if found:
return True, result
return False, None
| 32.810897 | 88 | 0.68018 | 1,352 | 10,237 | 4.872041 | 0.118343 | 0.044633 | 0.047062 | 0.036132 | 0.781843 | 0.770305 | 0.761955 | 0.750569 | 0.724002 | 0.724002 | 0 | 0.007738 | 0.217349 | 10,237 | 311 | 89 | 32.916399 | 0.814403 | 0.265898 | 0 | 0.487013 | 0 | 0 | 0.167289 | 0.034702 | 0 | 0 | 0 | 0 | 0.051948 | 1 | 0.084416 | false | 0 | 0.032468 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dc39e808967c7cc1679fc3017b5929b1087076a9 | 843 | py | Python | addons/odoo_view_advanced/controllers/controllers.py | stivenramireza/advanced-odoo-views | dc51ae8fdd622b1307a15d2f4ed65d8aff20abd8 | [
"MIT"
] | null | null | null | addons/odoo_view_advanced/controllers/controllers.py | stivenramireza/advanced-odoo-views | dc51ae8fdd622b1307a15d2f4ed65d8aff20abd8 | [
"MIT"
] | null | null | null | addons/odoo_view_advanced/controllers/controllers.py | stivenramireza/advanced-odoo-views | dc51ae8fdd622b1307a15d2f4ed65d8aff20abd8 | [
"MIT"
] | 1 | 2021-05-09T07:25:12.000Z | 2021-05-09T07:25:12.000Z | # from odoo import http
# class OdooModelAdvanced(http.Controller):
# @http.route('/odoo_view_advanced/odoo_view_advanced/', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/odoo_view_advanced/odoo_view_advanced/objects/', auth='public')
# def list(self, **kw):
# return http.request.render('odoo_view_advanced.listing', {
# 'root': '/odoo_view_advanced/odoo_view_advanced',
# 'objects': http.request.env['odoo_view_advanced.odoo_view_advanced'].search([]),
# })
# @http.route('/odoo_view_advanced/odoo_view_advanced/objects/<model("odoo_view_advanced.odoo_view_advanced"):obj>/', auth='public')
# def object(self, obj, **kw):
# return http.request.render('odoo_view_advanced.object', {
# 'object': obj
# })
| 40.142857 | 136 | 0.646501 | 100 | 843 | 5.17 | 0.3 | 0.216634 | 0.433269 | 0.232108 | 0.622824 | 0.622824 | 0.499033 | 0.423598 | 0.185687 | 0 | 0 | 0 | 0.188612 | 843 | 20 | 137 | 42.15 | 0.755848 | 0.956109 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dc41afe0d1238d2b51c4843c38a0ef05ac4012a9 | 38 | py | Python | onmt/ape/models/__init__.py | aeceou/OpenNAPE-py | 9ee9126f85be40b3e83c58ebd58ea56aeaa06a4d | [
"MIT"
] | 1 | 2021-09-17T05:33:37.000Z | 2021-09-17T05:33:37.000Z | onmt/ape/models/__init__.py | aeceou/OpenNAPE-py | 9ee9126f85be40b3e83c58ebd58ea56aeaa06a4d | [
"MIT"
] | null | null | null | onmt/ape/models/__init__.py | aeceou/OpenNAPE-py | 9ee9126f85be40b3e83c58ebd58ea56aeaa06a4d | [
"MIT"
] | null | null | null | """Module defining models for APE."""
| 19 | 37 | 0.684211 | 5 | 38 | 5.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131579 | 38 | 1 | 38 | 38 | 0.787879 | 0.815789 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dc629357cb9f51d3438da1eb261219f75df7766f | 10,827 | py | Python | flask_tutorial/tests/test_rummikub.py | nadbot/rummikubSolver | c4aab6e6a3ba2ee50b01e57a818a489ed09e50ce | [
"MIT"
] | null | null | null | flask_tutorial/tests/test_rummikub.py | nadbot/rummikubSolver | c4aab6e6a3ba2ee50b01e57a818a489ed09e50ce | [
"MIT"
] | null | null | null | flask_tutorial/tests/test_rummikub.py | nadbot/rummikubSolver | c4aab6e6a3ba2ee50b01e57a818a489ed09e50ce | [
"MIT"
] | null | null | null | # import flask_tutorial.rummikub.rummikub as r
from flask_tutorial.rummikub.Player import Player
import flask_tutorial.rummikub.rummikub_functions as rf
import pytest
def test_piece_stack():
"""
Test that tests whether the piece stack is working properly
"""
piece_stack = rf.create_piece_stack()
items = []
for i in range(0, 106):
item = rf.get_random_chip(piece_stack)
# test that each item is different
assert item not in items
items.append(item)
assert len(piece_stack) == 105 - i
assert len(piece_stack) == 0
def test_draw():
piece_stack = rf.create_piece_stack()
player = Player(0, 'Player0', [])
player.draw(rf.get_random_chip(piece_stack))
assert len(player.hand) == 1
player.draw(rf.get_random_chip(piece_stack))
assert len(player.hand) == 2
def test_correct_move():
gameboard = [[(1, 'black', 0), (1, 'yellow', 0), (1, 'blue', 0)]]
new_gameboard = [[(1, 'black', 0), (1, 'yellow', 0), (1, 'blue', 0), (1, 'red', 0)]]
correct = rf.correct_move(gameboard, new_gameboard, [(1, 'red', 0)])
assert correct
gameboard = [[(1, 'black', 0), (1, 'yellow', 0), (1, 'blue', 0)], [(2, 'blue', 0), (3, 'blue', 1), (4, 'blue', 0)]]
new_gameboard = [[(1, 'black', 0), (1, 'yellow', 0), (1, 'blue', 0), (1, 'red', 0)],
[(2, 'blue', 0), (3, 'blue', 1), (4, 'blue', 0)]]
correct = rf.correct_move(gameboard, new_gameboard, [(1, 'red', 0)])
assert correct
gameboard = []
new_gameboard = [[(2, 'blue', 0), (3, 'blue', 1), (4, 'blue', 0)]]
correct = rf.correct_move(gameboard, new_gameboard, [(2, 'blue', 0), (3, 'blue', 1), (4, 'blue', 0)])
assert correct
# testcases that should be failing
# adding less than 3 items
gameboard = []
new_gameboard = [[(2, 'blue', 0), (3, 'blue', 1)]]
correct = rf.correct_move(gameboard, new_gameboard, [(2, 'blue', 0), (3, 'blue', 1)])
assert not correct
# adding more items than new one
gameboard = []
new_gameboard = [[(2, 'blue', 0), (3, 'blue', 1), (4, 'blue', 0)]]
correct = rf.correct_move(gameboard, new_gameboard, [(2, 'blue', 0), (3, 'blue', 1)])
assert not correct
def test_move_go_out():
# TODO
pass
def test_move_add_single_chip_to_three_of_kind():
player = Player(0, 'Player_test', [(1, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'black', 0), (1, 'yellow', 0), (1, 'blue', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'black', 0), (1, 'blue', 0), (1, 'yellow', 0), (1, 'red', 0)]])
def test_move_add_single_chip_to_street():
player = Player(0, 'Player_test', [(4, 'red', 0)])
player.entered_game = True
gameboard = [[(5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(4, 'red', 0), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]])
# check that it does not work if color is different
player = Player(0, 'Player_test', [(4, 'blue', 0)])
player.entered_game = True
gameboard = [[(5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert not modified_gameboard
# check that it works when other chip with same value is used
player = Player(0, 'Player_test', [(4, 'red', 1)])
player.entered_game = True
gameboard = [[(5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(4, 'red', 1), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]])
# check different street
player = Player(0, 'Player_test', [(1, 'red', 0)])
player.entered_game = True
gameboard = [[(2, 'red', 0), (3, 'red', 0), (4, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0)]])
# check appending at end
player = Player(0, 'Player_test', [(4, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0)]])
def test_splitting_street():
# does not work if exactly same chip is used twice
player = Player(0, 'Player_test', [(4, 'red', 1)])
player.entered_game = True
gameboard = [[(2, 'red', 0), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(2, 'red', 0), (3, 'red', 0), (4, 'red', 0)],
[(4, 'red', 1), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]]) \
or equals(street, [[(2, 'red', 0), (3, 'red', 0), (4, 'red', 1)],
[(4, 'red', 0), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0)]])
def test_street_from_three_of_kinds():
player = Player(0, 'Player_test', [(4, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (1, 'black', 0), (1, 'blue', 0)],
[(2, 'red', 0), (2, 'black', 0), (2, 'blue', 0)],
[(3, 'red', 0), (3, 'black', 0), (3, 'blue', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0)],
[(1, 'black', 0), (2, 'black', 0), (3, 'black', 0)],
[(1, 'blue', 0), (2, 'blue', 0), (3, 'blue', 0)]])
# having 4 three of a kind
player = Player(0, 'Player_test', [(4, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (1, 'black', 0), (1, 'blue', 0), (1, 'yellow', 0)],
[(2, 'red', 0), (2, 'black', 0), (2, 'blue', 0), (2, 'yellow', 0)],
[(3, 'red', 0), (3, 'black', 0), (3, 'blue', 0), (3, 'yellow', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0)],
[(1, 'black', 0), (2, 'black', 0), (3, 'black', 0)],
[(1, 'blue', 0), (2, 'blue', 0), (3, 'blue', 0)],
[(1, 'yellow', 0), (2, 'yellow', 0), (3, 'yellow', 0)]])
def test_three_of_kinds_from_streets():
player = Player(0, 'Player_test', [(3, 'yellow', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0)],
[(1, 'black', 0), (2, 'black', 0), (3, 'black', 0)],
[(1, 'blue', 0), (2, 'blue', 0), (3, 'blue', 0)],
[(1, 'yellow', 0), (2, 'yellow', 0), (3, 'yellow', 1)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (1, 'black', 0), (1, 'blue', 0)],
[(2, 'red', 0), (2, 'black', 0), (2, 'blue', 0)],
[(3, 'red', 0), (3, 'black', 0), (3, 'blue', 0), (3, 'yellow', 0)],
[(1, 'yellow', 0), (2, 'yellow', 0), (3, 'yellow', 1)]])
def test_add_two_chips():
player = Player(0, 'Player_test', [(4, 'red', 0), (5, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0)]])
player = Player(0, 'Player_test', [(5, 'red', 0), (4, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0)]])
def test_add_two_chips_extra_items():
player = Player(0, 'Player_test', [(5, 'red', 0), (8, 'red', 0), (4, 'red', 0), (11, 'red', 0)])
player.entered_game = True
gameboard = [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0)]]
street, modified_gameboard, added = rf.move(player, gameboard)
assert equals(street, [[(1, 'red', 0), (2, 'red', 0), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0)]])
def test_move():
# TODO
# TODO test the following: Why is there no 2,3,4,5???
# [[(9, 'black', 1), (9, 'blue', 0), (9, 'red', 0), (9, 'yellow', 1)],
# [(9, 'red', 1), (9, 'black', 1), (9, 'blue', 0), (9, 'yellow', 1)],
# [(9, 'blue', 0), (9, 'red', 0), (9, 'yellow', 1)],
# [(9, 'black', 1), (9, 'red', 0), (9, 'yellow', 1)],
# [(9, 'black', 1), (9, 'blue', 0), (9, 'yellow', 1)],
# [(9, 'black', 1), (9, 'blue', 0), (9, 'red', 0)],
# [(9, 'red', 1), (9, 'blue', 0), (9, 'yellow', 1)],
# [(9, 'red', 1), (9, 'black', 1), (9, 'yellow', 1)],
# [(9, 'red', 1), (9, 'black', 1), (9, 'blue', 0)],
# [(1, 'red', 1), (2, 'red', 1), (3, 'red', 0), (4, 'red', 0),
# (5, 'red', 0), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0), (9, 'red', 0)],
# [(4, 'red', 0), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0), (9, 'red', 0)],
# [(5, 'red', 0), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0), (9, 'red', 0)],
# [(5, 'red', 1), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0), (9, 'red', 0)],
# [(1, 'red', 1), (2, 'red', 1), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0),
# (6, 'red', 0), (7, 'red', 0), (8, 'red', 0)],
# [(4, 'red', 0), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0)],
# [(5, 'red', 0), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0)],
# [(5, 'red', 1), (6, 'red', 0), (7, 'red', 0), (8, 'red', 0)],
# [(4, 'red', 0), (5, 'red', 0), (6, 'red', 0), (7, 'red', 0)],
# [(5, 'red', 1), (6, 'red', 0), (7, 'red', 0)],
# [(1, 'red', 1), (2, 'red', 1), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0), (6, 'red', 0)],
# [(4, 'red', 0), (5, 'red', 0), (6, 'red', 0)],
# [(1, 'red', 1), (2, 'red', 1), (3, 'red', 0), (4, 'red', 0), (5, 'red', 0)],
# [(1, 'red', 1), (2, 'red', 1), (3, 'red', 0), (4, 'red', 0)],
# [(1, 'red', 1), (2, 'red', 1), (3, 'red', 0)]]
pass
def equals(a, b):
a.sort()
b.sort()
if len(a) != len(b):
return False
for element_a, element_b in zip(a, b):
if type(element_a) == list and type(element_b) == list:
element_a.sort()
element_b.sort()
if len(element_a) != len(element_b):
return False
for item_a, item_b in zip(element_a, element_b):
if item_a != item_b:
return False
else:
if element_a != element_b:
return False
return True
| 47.073913 | 119 | 0.481574 | 1,602 | 10,827 | 3.170412 | 0.080524 | 0.137035 | 0.027564 | 0.036228 | 0.795629 | 0.768261 | 0.74365 | 0.733215 | 0.713526 | 0.701516 | 0 | 0.080237 | 0.251778 | 10,827 | 229 | 120 | 47.279476 | 0.546723 | 0.201441 | 0 | 0.529412 | 0 | 0 | 0.107322 | 0 | 0 | 0 | 0 | 0.004367 | 0.150327 | 1 | 0.084967 | false | 0.013072 | 0.019608 | 0 | 0.137255 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
dc8ff3d602fcbbb1e4062a77c99adb027ecf2668 | 155 | py | Python | project/urls.py | CONABIO-audio/irekua-autocomplete | fc8b31f86d8b51f172d25e7987af4d70cdf22e2c | [
"BSD-4-Clause"
] | null | null | null | project/urls.py | CONABIO-audio/irekua-autocomplete | fc8b31f86d8b51f172d25e7987af4d70cdf22e2c | [
"BSD-4-Clause"
] | 11 | 2020-04-26T23:56:07.000Z | 2022-03-12T00:03:40.000Z | project/urls.py | CONABIO-audio/irekua-autocomplete | fc8b31f86d8b51f172d25e7987af4d70cdf22e2c | [
"BSD-4-Clause"
] | null | null | null | from django.conf.urls import url
from django.conf.urls import include
urlpatterns = [
url(r'^autocomplete/', include('irekua_autocomplete.urls')),
]
| 19.375 | 64 | 0.741935 | 20 | 155 | 5.7 | 0.55 | 0.175439 | 0.245614 | 0.315789 | 0.421053 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129032 | 155 | 7 | 65 | 22.142857 | 0.844444 | 0 | 0 | 0 | 0 | 0 | 0.245161 | 0.154839 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
dcadf524b968fac3b9c7200f822cdb0665735b9c | 129 | py | Python | codebase/sys.argv.py | 0sifr/comparachecksum | 2ea51a1457779bfbbb239f0b8a7576ce762bd738 | [
"MIT"
] | null | null | null | codebase/sys.argv.py | 0sifr/comparachecksum | 2ea51a1457779bfbbb239f0b8a7576ce762bd738 | [
"MIT"
] | null | null | null | codebase/sys.argv.py | 0sifr/comparachecksum | 2ea51a1457779bfbbb239f0b8a7576ce762bd738 | [
"MIT"
] | null | null | null | from pprint import pprint
import sys
folder = [sys.argv[1], sys.argv[2]]
print(len(sys.argv))
print(folder[0])
print(folder[1])
| 18.428571 | 36 | 0.713178 | 23 | 129 | 4 | 0.478261 | 0.228261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034783 | 0.108527 | 129 | 6 | 37 | 21.5 | 0.765217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.666667 | 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 | 1 | 0 | 5 |
f4986b038f4a7e145b2e2b608cea0f58ed9ff88c | 86 | py | Python | Formatters/__init__.py | Tamilarasan-Aruchamy/stream-bms-data-AkshayUHegde | 040070eab4fdf4ffb800212005d3ffa17fcfd74f | [
"MIT"
] | null | null | null | Formatters/__init__.py | Tamilarasan-Aruchamy/stream-bms-data-AkshayUHegde | 040070eab4fdf4ffb800212005d3ffa17fcfd74f | [
"MIT"
] | null | null | null | Formatters/__init__.py | Tamilarasan-Aruchamy/stream-bms-data-AkshayUHegde | 040070eab4fdf4ffb800212005d3ffa17fcfd74f | [
"MIT"
] | 1 | 2021-06-13T16:54:06.000Z | 2021-06-13T16:54:06.000Z | from .CustomFormatter import CustomFormatter
from .JSONFormatter import JSONFormatter
| 28.666667 | 44 | 0.883721 | 8 | 86 | 9.5 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093023 | 86 | 2 | 45 | 43 | 0.974359 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
f49baba8d37fc058af033c6db83b0c43db8354b9 | 81 | py | Python | honeywell_hpma115s0/__init__.py | FEEprojects/honeywell-hpma115s0 | 917a51834e06cf61514afd53be75839c97ee4f06 | [
"MIT"
] | 6 | 2019-01-24T10:57:59.000Z | 2021-03-16T20:25:41.000Z | honeywell_hpma115s0/__init__.py | FEEprojects/honeywell-hpma115s0 | 917a51834e06cf61514afd53be75839c97ee4f06 | [
"MIT"
] | null | null | null | honeywell_hpma115s0/__init__.py | FEEprojects/honeywell-hpma115s0 | 917a51834e06cf61514afd53be75839c97ee4f06 | [
"MIT"
] | 3 | 2019-05-16T08:49:14.000Z | 2019-12-18T16:09:55.000Z | from .honeywell_hpma115s0 import HoneywellReading, Honeywell, HoneywellException
| 40.5 | 80 | 0.888889 | 7 | 81 | 10.142857 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053333 | 0.074074 | 81 | 1 | 81 | 81 | 0.893333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
7605c442ec6d3bb08fc83d78127cc809e9dcfa59 | 281 | py | Python | gcloud/rest/core/__init__.py | gunjanswitchco/gcloud-rest | bf6af906880c25500d8e76b5ce3f807968185780 | [
"MIT"
] | null | null | null | gcloud/rest/core/__init__.py | gunjanswitchco/gcloud-rest | bf6af906880c25500d8e76b5ce3f807968185780 | [
"MIT"
] | null | null | null | gcloud/rest/core/__init__.py | gunjanswitchco/gcloud-rest | bf6af906880c25500d8e76b5ce3f807968185780 | [
"MIT"
] | null | null | null | from pkg_resources import get_distribution
__version__ = get_distribution('gcloud-rest').version
from gcloud.rest.core.util import backoff
from gcloud.rest.core.util import decode
from gcloud.rest.core.util import encode
__all__ = ['__version__', 'backoff', 'decode', 'encode']
| 28.1 | 56 | 0.793594 | 38 | 281 | 5.473684 | 0.394737 | 0.192308 | 0.201923 | 0.259615 | 0.403846 | 0.403846 | 0 | 0 | 0 | 0 | 0 | 0 | 0.099644 | 281 | 9 | 57 | 31.222222 | 0.822134 | 0 | 0 | 0 | 0 | 0 | 0.145907 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
bfe46ad1e1fb5564cdc88728d108c88b0e4a3944 | 42 | py | Python | Test.py | JMoraza/TodayILearned | b65c6ad5046f76cd3fa0e611bce8e03b4881aff7 | [
"MIT"
] | null | null | null | Test.py | JMoraza/TodayILearned | b65c6ad5046f76cd3fa0e611bce8e03b4881aff7 | [
"MIT"
] | null | null | null | Test.py | JMoraza/TodayILearned | b65c6ad5046f76cd3fa0e611bce8e03b4881aff7 | [
"MIT"
] | null | null | null | print('Hello!')
print('I am new here!')
| 8.4 | 23 | 0.595238 | 7 | 42 | 3.571429 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 42 | 4 | 24 | 10.5 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0.487805 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
bffd8c59a7afac46612d69a928454349044ef015 | 37 | py | Python | botx/bots/mixins/__init__.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 13 | 2021-01-21T12:43:10.000Z | 2022-03-23T11:11:59.000Z | botx/bots/mixins/__init__.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 259 | 2020-02-26T08:51:03.000Z | 2022-03-23T11:08:36.000Z | botx/bots/mixins/__init__.py | ExpressApp/pybotx | 97c8b1ce5d45a05567ed01d545cb43174a2dcbb9 | [
"MIT"
] | 5 | 2019-12-02T16:19:22.000Z | 2021-11-22T20:33:34.000Z | """Definition for mixins for bot."""
| 18.5 | 36 | 0.675676 | 5 | 37 | 5 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135135 | 37 | 1 | 37 | 37 | 0.78125 | 0.810811 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
871fdb7ccf5381d973382b6b194bf536e157c5f4 | 131 | py | Python | scrach.py | ecoresystems/distributed_system_course_project | aabce71861bb6ce19c7f3f280fa73d2fa90160b3 | [
"MIT"
] | null | null | null | scrach.py | ecoresystems/distributed_system_course_project | aabce71861bb6ce19c7f3f280fa73d2fa90160b3 | [
"MIT"
] | 2 | 2020-07-19T12:21:06.000Z | 2021-03-10T06:54:55.000Z | scrach.py | ecoresystems/distributed_system_course_project | aabce71861bb6ce19c7f3f280fa73d2fa90160b3 | [
"MIT"
] | null | null | null | import time
start_time = time.time()
for i in range(10000):
print(i)
eof = time.time()-start_time
print(eof)
print(type(eof)) | 14.555556 | 28 | 0.694656 | 23 | 131 | 3.869565 | 0.478261 | 0.269663 | 0.292135 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045045 | 0.152672 | 131 | 9 | 29 | 14.555556 | 0.756757 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0.428571 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
874d4b1d14d4d89360351b7cb6f00a96c7833570 | 90 | py | Python | python/compat/PaxHeaders.47482/argparse.py | xiaobinglu/openvswitch | b206a49997a51909d73fd5c11784c17aa885f76b | [
"Apache-2.0"
] | null | null | null | python/compat/PaxHeaders.47482/argparse.py | xiaobinglu/openvswitch | b206a49997a51909d73fd5c11784c17aa885f76b | [
"Apache-2.0"
] | null | null | null | python/compat/PaxHeaders.47482/argparse.py | xiaobinglu/openvswitch | b206a49997a51909d73fd5c11784c17aa885f76b | [
"Apache-2.0"
] | null | null | null | 30 mtime=1440116301.986479262
30 atime=1440176559.433245607
30 ctime=1440177385.097311129
| 22.5 | 29 | 0.866667 | 12 | 90 | 6.5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.75 | 0.066667 | 90 | 3 | 30 | 30 | 0.178571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
5e897d27da8ea9a88bd3d5c136b2eb844f650ad2 | 302 | py | Python | src/tf_restore_helper/__init__.py | dogfish182/tf-restore-helper | 51b5c45d5c9e012bcce33db3f4c0355010113f55 | [
"MIT"
] | null | null | null | src/tf_restore_helper/__init__.py | dogfish182/tf-restore-helper | 51b5c45d5c9e012bcce33db3f4c0355010113f55 | [
"MIT"
] | 191 | 2021-05-03T18:29:39.000Z | 2022-03-29T10:18:33.000Z | src/tf_restore_helper/__init__.py | dogfish182/tf-restore-helper | 51b5c45d5c9e012bcce33db3f4c0355010113f55 | [
"MIT"
] | null | null | null | """Tf Restore Helper."""
from .tf_restore_helper import get_aws_client
from .tf_restore_helper import TerraformImportData
from .tf_restore_helper import Workload
# This is to 'use' the module(s), so lint doesn't complain
__all__ = ["get_aws_client", "setup_logger", "TerraformImportData", "Workload"]
| 37.75 | 79 | 0.788079 | 43 | 302 | 5.186047 | 0.581395 | 0.161435 | 0.269058 | 0.255605 | 0.336323 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109272 | 302 | 7 | 80 | 43.142857 | 0.828996 | 0.251656 | 0 | 0 | 0 | 0 | 0.240909 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0d7f670af7b8c0980815d8cd4a6159b6ff57d028 | 1,758 | py | Python | tests/test_waitgroup.py | juv-shun/py-waitgroup | aec39bed8faab30339a4b826235ba4dec1052e6e | [
"MIT"
] | null | null | null | tests/test_waitgroup.py | juv-shun/py-waitgroup | aec39bed8faab30339a4b826235ba4dec1052e6e | [
"MIT"
] | null | null | null | tests/test_waitgroup.py | juv-shun/py-waitgroup | aec39bed8faab30339a4b826235ba4dec1052e6e | [
"MIT"
] | null | null | null | import multiprocessing as multi
import threading
import unittest
import waitgroup
class WaitGroupProcessTest(unittest.TestCase):
def setUp(self):
self.wg = waitgroup.WaitGroupProcess()
def test_add(self):
self.wg.add()
self.assertEqual(self.wg.count.value, 1)
self.wg.add()
self.assertEqual(self.wg.count.value, 2)
def test_done(self):
self.wg.count.value = 10
self.wg.done()
self.assertEqual(self.wg.count.value, 9)
self.wg.done()
self.assertEqual(self.wg.count.value, 8)
def test_wait(self):
self.wg.count.value = 3
multi.Process(target=self._decrease_count).start()
self.wg.wait()
self.assertEqual(self.wg.count.value, 0)
def _decrease_count(self):
import time
time.sleep(2)
with self.wg.condition:
self.wg.count.value = 0
self.wg.condition.notify_all()
class WaitGroupThreadTest(unittest.TestCase):
def setUp(self):
self.wg = waitgroup.WaitGroupThread()
def test_add(self):
self.wg.add()
self.assertEqual(self.wg.count, 1)
self.wg.add()
self.assertEqual(self.wg.count, 2)
def test_done(self):
self.wg.count = 10
self.wg.done()
self.assertEqual(self.wg.count, 9)
self.wg.done()
self.assertEqual(self.wg.count, 8)
def test_wait(self):
self.wg.count = 3
threading.Thread(target=self._decrease_count).start()
self.wg.wait()
self.assertEqual(self.wg.count, 0)
def _decrease_count(self):
import time
time.sleep(2)
with self.wg.condition:
self.wg.count = 0
self.wg.condition.notify_all()
| 25.852941 | 61 | 0.609215 | 228 | 1,758 | 4.627193 | 0.184211 | 0.181991 | 0.166825 | 0.199052 | 0.828436 | 0.814218 | 0.762085 | 0.762085 | 0.578199 | 0.348815 | 0 | 0.015588 | 0.270193 | 1,758 | 67 | 62 | 26.238806 | 0.806703 | 0 | 0 | 0.518519 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185185 | 1 | 0.185185 | false | 0 | 0.111111 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
0d82e0795ccaa1d275f69aaa1c0133be3e15b820 | 143 | py | Python | app_odoo_customize/models/__init__.py | masami10/centron_addons | e0fe82965cce285868d84c8ad698634e1478c399 | [
"MIT"
] | 1 | 2021-03-03T07:00:14.000Z | 2021-03-03T07:00:14.000Z | app_odoo_customize/models/__init__.py | masami10/centron_addons | e0fe82965cce285868d84c8ad698634e1478c399 | [
"MIT"
] | null | null | null | app_odoo_customize/models/__init__.py | masami10/centron_addons | e0fe82965cce285868d84c8ad698634e1478c399 | [
"MIT"
] | 1 | 2020-06-30T03:31:07.000Z | 2020-06-30T03:31:07.000Z | # -*- coding: utf-8 -*-
import ir_ui_view
import app_theme_config_settings
import base_language_install
import mail_thread
import res_company
| 17.875 | 32 | 0.825175 | 22 | 143 | 4.954545 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007874 | 0.111888 | 143 | 7 | 33 | 20.428571 | 0.850394 | 0.146853 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
0da9f645c72e0b170f4b09ffc6188adcd35f8e7e | 248 | py | Python | src/back/model/admin.py | circleTreeF/2020_GRP_Team17 | e29bac4f5de54d34049da6549c82fefab3c016f5 | [
"MIT"
] | null | null | null | src/back/model/admin.py | circleTreeF/2020_GRP_Team17 | e29bac4f5de54d34049da6549c82fefab3c016f5 | [
"MIT"
] | null | null | null | src/back/model/admin.py | circleTreeF/2020_GRP_Team17 | e29bac4f5de54d34049da6549c82fefab3c016f5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import NormalRoadTemplate, AbnormalRoadTemplate
# Register your models here.
admin.site.register(NormalRoadTemplate)
admin.site.register(AbnormalRoadTemplate)
# admin.site.register(BadPointsTemplates)
| 31 | 60 | 0.850806 | 26 | 248 | 8.115385 | 0.5 | 0.127962 | 0.241706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076613 | 248 | 7 | 61 | 35.428571 | 0.921397 | 0.266129 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
218ab5cc842968d7e5133cd6497a40e2045761d3 | 332 | py | Python | flask/test/data/box_state.py | spaudanjo/boxtribute | c29311a38721277a07b5e1dbcf36cf12bcd8b727 | [
"Apache-2.0"
] | 3 | 2020-10-17T06:37:10.000Z | 2021-06-08T16:58:38.000Z | flask/test/data/box_state.py | spaudanjo/boxtribute | c29311a38721277a07b5e1dbcf36cf12bcd8b727 | [
"Apache-2.0"
] | 166 | 2020-10-25T20:45:32.000Z | 2022-03-28T08:18:26.000Z | flask/test/data/box_state.py | spaudanjo/boxtribute | c29311a38721277a07b5e1dbcf36cf12bcd8b727 | [
"Apache-2.0"
] | 4 | 2021-01-01T18:03:57.000Z | 2022-03-10T08:43:23.000Z | import pytest
from boxwise_flask.models.box_state import BoxState
def default_box_state_data():
mock_box_state = {"id": 1, "label": "1"}
return mock_box_state
@pytest.fixture()
def default_box_state():
return default_box_state_data()
def create_default_box_state():
BoxState.create(**default_box_state_data())
| 19.529412 | 51 | 0.753012 | 48 | 332 | 4.791667 | 0.395833 | 0.278261 | 0.326087 | 0.247826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006993 | 0.138554 | 332 | 16 | 52 | 20.75 | 0.797203 | 0 | 0 | 0 | 0 | 0 | 0.024096 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.2 | 0.1 | 0.7 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
219075796b3ea5307a3fe4c99d597c8d615f5d2a | 42 | py | Python | tests/__init__.py | Daem0n-th/videofy | 73dadb1ef25a5515dd9db94bc4fd7a45fa0fe4dd | [
"MIT"
] | 1 | 2021-08-03T17:00:42.000Z | 2021-08-03T17:00:42.000Z | tests/__init__.py | Daem0n-th/videofy | 73dadb1ef25a5515dd9db94bc4fd7a45fa0fe4dd | [
"MIT"
] | 59 | 2021-08-09T15:26:52.000Z | 2022-03-30T12:21:40.000Z | tests/__init__.py | Daem0n-th/videofy | 73dadb1ef25a5515dd9db94bc4fd7a45fa0fe4dd | [
"MIT"
] | 1 | 2021-08-08T16:29:30.000Z | 2021-08-08T16:29:30.000Z | """Test suite for the videofy package."""
| 21 | 41 | 0.690476 | 6 | 42 | 4.833333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 42 | 1 | 42 | 42 | 0.805556 | 0.833333 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
21a71c25782a4d2393b82d4461aca08f22757104 | 450 | py | Python | __init__.py | bambu/binaryninja-machosymbols | 8f9e127eae903c39abe3a92b862c057a203ab6e2 | [
"MIT"
] | 7 | 2017-05-21T16:49:31.000Z | 2021-04-06T04:17:37.000Z | __init__.py | bambu/binaryninja-machosymbols | 8f9e127eae903c39abe3a92b862c057a203ab6e2 | [
"MIT"
] | 1 | 2019-07-04T20:12:09.000Z | 2019-07-04T20:12:09.000Z | __init__.py | bambu/binaryninja-machosymbols | 8f9e127eae903c39abe3a92b862c057a203ab6e2 | [
"MIT"
] | 2 | 2017-05-19T18:52:27.000Z | 2017-06-21T04:18:28.000Z | from binaryninja import PluginCommand
import macho_symbols
PluginCommand.register(
'Mach-O Bind symbols',
'Generate bind symbols',
macho_symbols.generate_bind_symbols
)
PluginCommand.register(
'Mach-O Selrefs symbols',
'Generate selrefs symbols',
macho_symbols.generate_selrefs
)
PluginCommand.register(
'Mach-O Objc function symbols',
'Generate objc function symbols',
macho_symbols.generate_function_names
)
| 20.454545 | 41 | 0.76 | 50 | 450 | 6.66 | 0.3 | 0.27027 | 0.225225 | 0.234234 | 0.198198 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 450 | 21 | 42 | 21.428571 | 0.888 | 0 | 0 | 0.176471 | 1 | 0 | 0.32 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.117647 | 0 | 0.117647 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
21b54727fb1956393be9be8a91c2c14cc75bd954 | 51 | py | Python | heaphopper/analysis/__init__.py | angr/heaphopper | fa0efa8e71908bd05cd07a2ac0c73dbc5d445ae1 | [
"BSD-2-Clause"
] | 185 | 2018-08-05T03:03:47.000Z | 2022-02-15T06:32:22.000Z | heaphopper/analysis/__init__.py | angr/heaphopper | fa0efa8e71908bd05cd07a2ac0c73dbc5d445ae1 | [
"BSD-2-Clause"
] | 11 | 2018-08-06T11:09:07.000Z | 2020-07-14T05:26:23.000Z | heaphopper/analysis/__init__.py | angr/heaphopper | fa0efa8e71908bd05cd07a2ac0c73dbc5d445ae1 | [
"BSD-2-Clause"
] | 19 | 2018-08-05T03:03:50.000Z | 2022-02-24T10:44:00.000Z | from .tracer import *
from .identify_bins import *
| 17 | 28 | 0.764706 | 7 | 51 | 5.428571 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156863 | 51 | 2 | 29 | 25.5 | 0.883721 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
21dd5052fd31f18713d48426c0b2a133d6cd4db3 | 77 | py | Python | python/joinPath.py | mattiasholm/powershell | 41212c9e0fbf81dbae3e39751d593be46662e098 | [
"MIT"
] | 2 | 2018-06-15T16:16:41.000Z | 2018-08-29T09:40:20.000Z | python/joinPath.py | mattiasholm/powershell | 41212c9e0fbf81dbae3e39751d593be46662e098 | [
"MIT"
] | null | null | null | python/joinPath.py | mattiasholm/powershell | 41212c9e0fbf81dbae3e39751d593be46662e098 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
print(os.path.join('~', 'repos', 'code'))
| 12.833333 | 41 | 0.623377 | 12 | 77 | 4 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014706 | 0.116883 | 77 | 5 | 42 | 15.4 | 0.691176 | 0.272727 | 0 | 0 | 0 | 0 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 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 | 1 | 0 | 0 | 1 | 0 | 5 |
0dfbb9dc57d1d68b8e3a8ca46ead3bd4e27503ed | 126 | py | Python | src/engine/SCons/__main__.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 171 | 2019-11-08T07:24:03.000Z | 2022-03-31T13:06:03.000Z | src/engine/SCons/__main__.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 702 | 2019-11-12T11:23:37.000Z | 2022-03-31T11:04:26.000Z | src/engine/SCons/__main__.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 43 | 2019-11-12T22:04:24.000Z | 2022-02-27T14:32:48.000Z | import SCons.Script
# this does all the work, and calls sys.exit
# with the proper exit status when done.
SCons.Script.main()
| 25.2 | 44 | 0.761905 | 22 | 126 | 4.363636 | 0.818182 | 0.229167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15873 | 126 | 4 | 45 | 31.5 | 0.90566 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
df00b433b11f21a2aeeb0a6d15402f50c0a54d33 | 159 | py | Python | TheAttendance/attendanceApp/admin.py | cmadisonne/AttendanceTracker | 885f14d6bc2bc21b7c9f568c6e6fe6f6daf6d75e | [
"Apache-2.0"
] | null | null | null | TheAttendance/attendanceApp/admin.py | cmadisonne/AttendanceTracker | 885f14d6bc2bc21b7c9f568c6e6fe6f6daf6d75e | [
"Apache-2.0"
] | null | null | null | TheAttendance/attendanceApp/admin.py | cmadisonne/AttendanceTracker | 885f14d6bc2bc21b7c9f568c6e6fe6f6daf6d75e | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# Register your models here.
from .models import clockIn,clockOut
admin.site.register(clockIn)
admin.site.register(clockOut) | 22.714286 | 36 | 0.81761 | 22 | 159 | 5.909091 | 0.545455 | 0.138462 | 0.261538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.100629 | 159 | 7 | 37 | 22.714286 | 0.909091 | 0.163522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
df6bc129f34589ef55c92880d7d39f89311b5bd2 | 108 | py | Python | src/demo/demo.py | synxlin/Chinese_speech_recognition | 035f87ffbb7de4eb0b35ce247ff20fa52132b8ff | [
"MIT"
] | 10 | 2018-08-16T09:06:19.000Z | 2021-10-14T07:39:08.000Z | src/demo/demo.py | synxlin/Chinese_speech_recognition | 035f87ffbb7de4eb0b35ce247ff20fa52132b8ff | [
"MIT"
] | 2 | 2018-05-24T07:30:57.000Z | 2018-07-14T01:40:49.000Z | src/demo/demo.py | synxlin/Chinese_speech_recognition | 035f87ffbb7de4eb0b35ce247ff20fa52132b8ff | [
"MIT"
] | 1 | 2019-03-12T01:39:33.000Z | 2019-03-12T01:39:33.000Z | #/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
import ui.main
ui.main.app.run()
| 12 | 23 | 0.611111 | 18 | 108 | 3.666667 | 0.777778 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011765 | 0.212963 | 108 | 8 | 24 | 13.5 | 0.764706 | 0.37037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
10bf05d356b0b36b5b545e62dda4bc169fa8f288 | 3,350 | py | Python | old_algs/agentv6_alg.py | tomarbeiter/yahtzee-rl | 51b09ca059740e798061fdeb31cda2b56255ca07 | [
"Apache-2.0"
] | null | null | null | old_algs/agentv6_alg.py | tomarbeiter/yahtzee-rl | 51b09ca059740e798061fdeb31cda2b56255ca07 | [
"Apache-2.0"
] | null | null | null | old_algs/agentv6_alg.py | tomarbeiter/yahtzee-rl | 51b09ca059740e798061fdeb31cda2b56255ca07 | [
"Apache-2.0"
] | null | null | null | from yahtzee_singleV5 import YahtzeeSinglePlayerV5
import math
from agentv6 import AgentV6
import time
env = YahtzeeSinglePlayerV5()
agent = AgentV6(1, 0.99, 0.99)
# Main algorithm
for i in range(1, 10001):
if i < 1000:
agent.eps = 1
else:
# eps decay
agent.eps = math.exp(-0.00025 * i + 0.25)
if i >= 9900:
agent.eps = 0.05
done = False
first_roll = True
time1 = time.perf_counter()
while done is False:
turns_left = env.ytz.remaining_turns
# Player must roll all 5 dice on first roll of each turn
if first_roll:
new_state, possible_actions, reward, done, debug = env.step(76, agent.action_space, agent.state_space)
new_action = agent.get_action(env.ytz, new_state, possible_actions)
agent.update_q(76, 516096, new_action, new_state, reward)
action = new_action
state = new_state
first_roll = False
else:
new_state, possible_actions, reward, done, debug = env.step(action, agent.action_space, agent.state_space)
new_action = agent.get_action(env.ytz, new_state, possible_actions)
# if it isn't scoring, update as usual
if action >= 13:
agent.update_q(action, state, new_action, new_state, reward)
action = new_action
state = new_state
# If it is scoring, new_state and new_action are junk
else:
agent.update_q(action, state, 76, 516096, reward)
if turns_left > env.ytz.remaining_turns:
first_roll = True
time2 = time.perf_counter()
print(time2 - time1)
agent.scores.append(env.ytz.c_player.score)
agent.iterations.append(i)
env.reset()
# Data output
agent.max_score = max(agent.scores)
agent.games_played = agent.iterations[-1]
agent.avg_score = sum(agent.scores) / agent.games_played
agent.last_avg_score = sum(agent.scores[-100:]) / 100
agent.write_data("./data/agentv6/envV5/100kv1.txt")
agent.generate_plot("./data/agentv6/envV5/100kv1.png")
agent.eps = 0
done = False
first_roll = True
while done is False:
turns_left = env.ytz.remaining_turns
# Player must roll all 5 dice on first roll of each turn
if first_roll:
new_state, possible_actions, reward, done, debug = env.step(76, agent.action_space, agent.state_space)
new_action = agent.get_action(env.ytz, new_state, possible_actions)
agent.update_q(76, 946176, new_action, new_state, reward)
action = new_action
state = new_state
first_roll = False
else:
new_state, possible_actions, reward, done, debug = env.step(agent.action_space[action], agent.action_space, agent.state_space)
new_action = agent.get_action(env.ytz, new_state, possible_actions)
# if it isn't scoring, update as usual
if action >= 13:
agent.update_q(action, state, new_action, new_state, reward)
action = new_action
state = new_state
# If it is scoring, new_state and new_action are junk
else:
agent.update_q(action, state, 76, 516096, reward)
if turns_left > env.ytz.remaining_turns:
first_roll = True
agent.scores.append(env.ytz.c_player.score)
agent.iterations.append(i)
env.reset() | 38.068182 | 134 | 0.65194 | 470 | 3,350 | 4.459574 | 0.217021 | 0.068702 | 0.061069 | 0.087786 | 0.781011 | 0.744275 | 0.71374 | 0.71374 | 0.71374 | 0.71374 | 0 | 0.04257 | 0.256716 | 3,350 | 88 | 135 | 38.068182 | 0.799197 | 0.096716 | 0 | 0.643836 | 0 | 0 | 0.02055 | 0.02055 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.054795 | 0 | 0.054795 | 0.013699 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
10f799d276892bb3a0572f7e1c3782922396aac3 | 17 | py | Python | Python Programs/helloAll.py | fe2o3Akshay/letshack | a72a29f8916731765efa518ba9cf54f102e2bc97 | [
"MIT"
] | 8 | 2020-10-02T15:20:45.000Z | 2020-10-13T07:00:05.000Z | Python Programs/helloAll.py | fe2o3Akshay/letshack | a72a29f8916731765efa518ba9cf54f102e2bc97 | [
"MIT"
] | 6 | 2020-10-04T05:39:31.000Z | 2020-10-17T12:32:51.000Z | Python Programs/helloAll.py | fe2o3Akshay/letshack | a72a29f8916731765efa518ba9cf54f102e2bc97 | [
"MIT"
] | 96 | 2020-10-04T04:55:56.000Z | 2020-10-30T09:56:05.000Z | print("helloAll") | 17 | 17 | 0.764706 | 2 | 17 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 1 | 17 | 17 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
10fe304fcfb91af06d9e571f30c27cb0c3ebcbf8 | 242 | py | Python | bandit/algorithms/BaseBanditAlgorithm.py | MarcoAlmada/bandit-panda | 787b8f8ea41e318a54c5c1db160801e4ff201383 | [
"MIT"
] | 6 | 2016-04-09T14:46:51.000Z | 2019-04-16T21:46:58.000Z | bandit/algorithms/BaseBanditAlgorithm.py | MarcoAlmada/bandit-panda | 787b8f8ea41e318a54c5c1db160801e4ff201383 | [
"MIT"
] | null | null | null | bandit/algorithms/BaseBanditAlgorithm.py | MarcoAlmada/bandit-panda | 787b8f8ea41e318a54c5c1db160801e4ff201383 | [
"MIT"
] | 1 | 2019-11-16T17:34:12.000Z | 2019-11-16T17:34:12.000Z | class BaseBanditAlgorithm():
def initialize(self, n_arms):
raise NotImplementedError()
def select_arm(self):
raise NotImplementedError()
def update(self, chosen_arm, reward):
raise NotImplementedError()
| 22 | 41 | 0.681818 | 23 | 242 | 7.043478 | 0.608696 | 0.444444 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.231405 | 242 | 10 | 42 | 24.2 | 0.870968 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
800570638e12579e43230fa844b27361d3290ae7 | 23 | py | Python | aict_tools/scripts/__init__.py | LukasBeiske/aict-tools | ccf61c051c58040cf4b676180ae7184021d1b81b | [
"MIT"
] | 4 | 2018-10-05T14:34:47.000Z | 2021-01-22T11:57:26.000Z | aict_tools/scripts/__init__.py | LukasBeiske/aict-tools | ccf61c051c58040cf4b676180ae7184021d1b81b | [
"MIT"
] | 48 | 2018-05-14T12:48:12.000Z | 2021-05-24T10:58:46.000Z | aict_tools/scripts/__init__.py | fact-project/classifier-tools | ee091fc933110ff008e32df02ee12a97e412e8b3 | [
"MIT"
] | 7 | 2018-08-20T13:45:44.000Z | 2021-07-14T13:13:59.000Z | # put executables here
| 11.5 | 22 | 0.782609 | 3 | 23 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173913 | 23 | 1 | 23 | 23 | 0.947368 | 0.869565 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
8026dc3542fabc9e1ddf46ca9fa5822f3836ba89 | 395 | py | Python | class coding itc255/item.py | cagunning/itc255_class_coding1 | 81364b80886afdf771c1938493dc9eed8b412452 | [
"Apache-2.0"
] | null | null | null | class coding itc255/item.py | cagunning/itc255_class_coding1 | 81364b80886afdf771c1938493dc9eed8b412452 | [
"Apache-2.0"
] | null | null | null | class coding itc255/item.py | cagunning/itc255_class_coding1 | 81364b80886afdf771c1938493dc9eed8b412452 | [
"Apache-2.0"
] | null | null | null | class Item():
def __init__(self, itemnum, itemname, itemprice):
self.itemnum=itemnum
self.itemname=itemname
self.itemprice=itemprice
def getItemNumber(self):
return self.itemnum
def getItemName(self):
return self.itemname
def getItemPrice(self):
return self.itemprice
def __str__(self):
return self.itemname | 23.235294 | 53 | 0.635443 | 41 | 395 | 5.926829 | 0.317073 | 0.164609 | 0.230453 | 0.18107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.286076 | 395 | 17 | 54 | 23.235294 | 0.861702 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.384615 | false | 0 | 0 | 0.307692 | 0.769231 | 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 | 1 | 0 | 0 | 5 |
803133a491aa861836482043b41326370aaa097e | 347 | py | Python | ipython/startup/import_statsmodels.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | ipython/startup/import_statsmodels.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | ipython/startup/import_statsmodels.py | dycw/dotfiles2 | 9e23c4989e9813080da3658a8f98dbb1e03776f2 | [
"MIT"
] | null | null | null | from contextlib import suppress
with suppress(ModuleNotFoundError):
import statsmodels # noqa: F401
import statsmodels.api as sm # noqa: F401
from statsmodels.regression.linear_model import OLS # noqa: F401
from statsmodels.tsa.ar_model import AutoReg # noqa: F401
from statsmodels.tsa.stattools import acf # noqa: F401
| 34.7 | 69 | 0.752161 | 44 | 347 | 5.886364 | 0.477273 | 0.15444 | 0.138996 | 0.266409 | 0.200772 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053381 | 0.190202 | 347 | 9 | 70 | 38.555556 | 0.868327 | 0.15562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.857143 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
803b8cb9bbd20d5f1280c9e7a9d67ee9f3172ac2 | 95 | py | Python | colors.py | compmonk/playlister | 5dac6ec9108cb2f2f4e960cabe6a8cb4f10d9931 | [
"MIT"
] | 1 | 2017-09-16T05:00:08.000Z | 2017-09-16T05:00:08.000Z | colors.py | compmonk/playlister | 5dac6ec9108cb2f2f4e960cabe6a8cb4f10d9931 | [
"MIT"
] | null | null | null | colors.py | compmonk/playlister | 5dac6ec9108cb2f2f4e960cabe6a8cb4f10d9931 | [
"MIT"
] | null | null | null | class bcolors:
INFO = '\033[92m'
WARNING = '\033[93m'
ERROR = '\033[91m'
RESET = '\033[0m'
| 15.833333 | 21 | 0.589474 | 14 | 95 | 4 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.246753 | 0.189474 | 95 | 5 | 22 | 19 | 0.480519 | 0 | 0 | 0 | 0 | 0 | 0.326316 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 5 |
804b67d0cf2be4b1446d37eea6c11638ebbb03ec | 3,615 | py | Python | src/frontend/views/contributions_view.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | null | null | null | src/frontend/views/contributions_view.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | null | null | null | src/frontend/views/contributions_view.py | sanderland/katago-server | 6414fab080d007c05068a06ff4f25907b92848bd | [
"MIT"
] | null | null | null | from django.views.generic import ListView
from django.shortcuts import get_object_or_404
from django.db.models import Sum
from src.apps.games.models import GameCountByUser, RecentGameCountByUser, DayGameCountByUser
from src.apps.runs.models import Run
from . import view_utils
class ContributionsView(ListView):
template_name = "pages/contributions.html"
context_object_name = "all_time_user_list"
def get_queryset(self):
return \
GameCountByUser \
.objects \
.all() \
.values("username") \
.annotate(
total_num_training_rows=Sum("total_num_training_rows"),
total_num_training_games=Sum("total_num_training_games"),
total_num_rating_games=Sum("total_num_rating_games"),
) \
.order_by("-total_num_training_rows")
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["has_multiple_runs"] = Run.objects.count() > 1
context["top_recent_user_list"] = (
RecentGameCountByUser \
.objects \
.all() \
.values("username") \
.annotate(
total_num_training_rows=Sum("total_num_training_rows"),
total_num_training_games=Sum("total_num_training_games"),
total_num_rating_games=Sum("total_num_rating_games"),
) \
.order_by("-total_num_training_rows")
.all()[:30]
)
context["top_day_user_list"] = (
DayGameCountByUser \
.objects \
.all() \
.values("username") \
.annotate(
total_num_training_rows=Sum("total_num_training_rows"),
total_num_training_games=Sum("total_num_training_games"),
total_num_rating_games=Sum("total_num_rating_games"),
) \
.order_by("-total_num_training_rows")
.all()[:30]
)
return context
class ContributionsByRunView(ListView):
template_name = "pages/contributions_by_run.html"
context_object_name = "all_time_user_list"
def get_queryset(self):
self.run = get_object_or_404(Run, name=self.kwargs["run"])
self.current_run = Run.objects.select_current_or_latest()
return \
GameCountByUser \
.objects \
.filter(run=self.run) \
.values("username") \
.annotate(
total_num_training_rows=Sum("total_num_training_rows"),
total_num_training_games=Sum("total_num_training_games"),
total_num_rating_games=Sum("total_num_rating_games"),
) \
.order_by("-total_num_training_rows")
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["top_recent_user_list"] = (
RecentGameCountByUser \
.objects \
.filter(run=self.run) \
.values("username") \
.annotate(
total_num_training_rows=Sum("total_num_training_rows"),
total_num_training_games=Sum("total_num_training_games"),
total_num_rating_games=Sum("total_num_rating_games"),
) \
.order_by("-total_num_training_rows")
.all()[:30]
)
context["top_day_user_list"] = (
DayGameCountByUser \
.objects \
.filter(run=self.run) \
.values("username") \
.annotate(
total_num_training_rows=Sum("total_num_training_rows"),
total_num_training_games=Sum("total_num_training_games"),
total_num_rating_games=Sum("total_num_rating_games"),
) \
.order_by("-total_num_training_rows")
.all()[:30]
)
context["run"] = self.run
context["current_run"] = self.current_run
context["is_older_run"] = self.run != self.current_run
context["show_older_runs"] = Run.objects.count() > 1
return context
| 31.99115 | 92 | 0.676625 | 436 | 3,615 | 5.178899 | 0.16055 | 0.148804 | 0.212578 | 0.159433 | 0.779008 | 0.706377 | 0.706377 | 0.669619 | 0.669619 | 0.669619 | 0 | 0.005556 | 0.20332 | 3,615 | 112 | 93 | 32.276786 | 0.778472 | 0 | 0 | 0.792079 | 0 | 0 | 0.230152 | 0.169571 | 0 | 0 | 0 | 0 | 0 | 1 | 0.039604 | false | 0 | 0.059406 | 0.009901 | 0.19802 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
33c2d50474eaa0e6654d9405407f66bdd735515e | 169 | py | Python | tracker/app/api/__init__.py | JelteF/bottor | 3a6a1ba7fe90c0989c585e9cd01fcc0393b726ae | [
"MIT"
] | 4 | 2015-05-24T17:30:30.000Z | 2017-11-27T20:25:53.000Z | tracker/app/api/__init__.py | JelteF/bottor | 3a6a1ba7fe90c0989c585e9cd01fcc0393b726ae | [
"MIT"
] | null | null | null | tracker/app/api/__init__.py | JelteF/bottor | 3a6a1ba7fe90c0989c585e9cd01fcc0393b726ae | [
"MIT"
] | null | null | null | """__init__.py - API's."""
from .peer import peer_api
from .matrix import matrix_api
from .upload import upload_api
from .task import task_api
from .job import job_api
| 21.125 | 30 | 0.769231 | 29 | 169 | 4.172414 | 0.37931 | 0.231405 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142012 | 169 | 7 | 31 | 24.142857 | 0.834483 | 0.118343 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
33d235667371e2e55707741b00e4183b1b985c4f | 39 | py | Python | pyxa/cli/commands/project_template/__init__.py | xames3/pyxa | 7d15b403c5f71efe4fba5bbeb5666bd7f44db3c6 | [
"Apache-2.0"
] | 1 | 2019-05-12T14:29:55.000Z | 2019-05-12T14:29:55.000Z | charlotte/__init__.py | xames3/charlotte | 6df0a20824ab228fcce748842c4a570d29d39d74 | [
"Apache-2.0"
] | 1 | 2019-12-12T16:29:52.000Z | 2019-12-13T07:20:07.000Z | charlotte/utils/__init__.py | xames3/charlotte | 6df0a20824ab228fcce748842c4a570d29d39d74 | [
"Apache-2.0"
] | 2 | 2019-11-10T11:17:05.000Z | 2020-06-25T12:31:19.000Z | # Wow. You're too curious, aren't you?
| 19.5 | 38 | 0.666667 | 8 | 39 | 3.25 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179487 | 39 | 1 | 39 | 39 | 0.8125 | 0.923077 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
33ed8db6a7c94a6376b4e68a76330e6bcc7caa2e | 28,857 | py | Python | fairseq_ext/amr_spec/old_action_info_binarize.py | IBM/transition-amr-parser | dfd8352ea2ee3ff153b691edb6cd7ee541d53b2e | [
"Apache-2.0"
] | 76 | 2019-11-25T04:00:15.000Z | 2022-03-31T00:33:44.000Z | fairseq_ext/amr_spec/old_action_info_binarize.py | IBM/transition-amr-parser | dfd8352ea2ee3ff153b691edb6cd7ee541d53b2e | [
"Apache-2.0"
] | 22 | 2019-10-10T09:39:24.000Z | 2022-03-28T06:39:06.000Z | fairseq_ext/amr_spec/old_action_info_binarize.py | IBM/transition-amr-parser | dfd8352ea2ee3ff153b691edb6cd7ee541d53b2e | [
"Apache-2.0"
] | 20 | 2019-10-08T17:02:17.000Z | 2022-03-20T01:43:42.000Z | import os
import itertools
from multiprocessing import Pool
import time
import torch
import numpy as np
from tqdm import tqdm
from transition_amr_parser.action_pointer.o8_state_machine import AMRStateMachine
from .action_info import get_actions_states
from ..tokenizer import tokenize_line_tab
from ..binarize import make_builder # TODO move this to data folder
from ..data.data_utils import load_indexed_dataset
from ..utils import time_since
# reference: fairseq binarizer.py
def safe_readline(f):
pos = f.tell()
while True:
try:
return f.readline()
except UnicodeDecodeError:
pos -= 1
f.seek(pos) # search where this character begins
# a class implementation to allow for multiprocessing
class ActionStatesBinarizer:
def __init__(self, actions_dict):
self.actions_dict = actions_dict
self.canonical_actions = AMRStateMachine.canonical_actions
self.canonical_act_ids = AMRStateMachine.canonical_action_to_dict(actions_dict)
def binarize(self, en_file, actions_file, consumer, tokenize=tokenize_line_tab,
en_offset=0, en_end=-1,
actions_offset=0, actions_end=-1):
# NOTE here we scan two files, and their sizes are different, thus we need to have different offsets for them
# (and make sure the file positions match) when we process part of files in multiprocessing
if tokenize is None:
tokenize = tokenize_line_tab
with open(en_file, 'r', encoding='utf-8') as f, open(actions_file, 'r', encoding='utf-8') as g:
f.seek(en_offset)
# next(f) breaks f.tell(), hence readline() must be used
line = safe_readline(f)
g.seek(actions_offset)
actions = safe_readline(g)
count = 0
start = time.time()
while line:
if en_end > 0 and f.tell() > en_end:
assert actions_end > 0 and g.tell() > actions_end
break
actions_states = get_actions_states(tokens=tokenize(line), actions=tokenize(actions))
# construct actions states tensors
allowed_cano_actions = actions_states['allowed_cano_actions']
vocab_mask = torch.zeros(len(allowed_cano_actions), len(self.actions_dict), dtype=torch.uint8)
for i, act_allowed in enumerate(allowed_cano_actions):
# vocab_ids_allowed = list(set().union(*[set(canonical_act_ids[act]) for act in act_allowed]))
# this is a bit faster than above
vocab_ids_allowed = list(
itertools.chain.from_iterable(
[self.canonical_act_ids[act] for act in act_allowed]
)
)
vocab_mask[i][vocab_ids_allowed] = 1
actions_nodemask = torch.tensor(actions_states['actions_nodemask'], dtype=torch.uint8)
token_cursors = torch.tensor(actions_states['token_cursors'])
# graph structure information
actions_edge_mask = torch.tensor(actions_states['actions_edge_mask'], dtype=torch.uint8)
actions_edge_cur_node = torch.tensor(actions_states['actions_edge_cur_node'])
actions_edge_pre_node = torch.tensor(actions_states['actions_edge_pre_node'])
actions_edge_direction = torch.tensor(actions_states['actions_edge_direction'])
consumer(vocab_mask, actions_nodemask, token_cursors,
actions_edge_mask, actions_edge_cur_node, actions_edge_pre_node, actions_edge_direction)
count += 1
if count % 1000 == 0:
print(f'\r processed {count} en-actions pairs (time: {time_since(start)})', end='')
line = f.readline()
actions = g.readline()
print('')
# return any useful statistics
return {}
@staticmethod
def find_offsets_paired(en_filename, actions_filename, num_chunks):
"""Find the file offsets of two files which are paired line by line; the offsets must match."""
with open(en_filename, 'r', encoding='utf-8') as f, open(actions_filename, 'r', encoding='utf-8') as g:
nlines_en = sum(1 for line in f)
nlines_actions = sum(1 for line in g)
assert nlines_en == nlines_actions
chunk_nlines = nlines_en // num_chunks
en_offsets = [0 for _ in range(num_chunks + 1)]
actions_offsets = [0 for _ in range(num_chunks + 1)]
f.seek(0)
g.seek(0)
for i in range(1, num_chunks):
for j in range(chunk_nlines):
safe_readline(f)
safe_readline(g)
en_offsets[i] = f.tell()
actions_offsets[i] = g.tell()
return en_offsets, actions_offsets
@staticmethod
def find_offsets(filename, num_chunks):
"""Only works for a single file; chunks are divided by file size (#bytes)."""
with open(filename, 'r', encoding='utf-8') as f:
size = os.fstat(f.fileno()).st_size
chunk_size = size // num_chunks
offsets = [0 for _ in range(num_chunks + 1)]
for i in range(1, num_chunks):
f.seek(chunk_size * i)
safe_readline(f)
offsets[i] = f.tell()
return offsets
# same functionality as above, but without design for multiprocessing
def get_actions_states_file(en_file, actions_file, actions_dict, consumer=None, canonical_act_ids=None, tokenize=None):
"""Build actions information such as masks for restricted action space, masks for node generating actions,
token cursor positions, etc.
Save them into binary files.
Args:
en_file (str): English sentence file path.
actions_file (str): actions file path.
actions_dict (fairseq.data.Dict): action word dictionary.
canonical_act_ids (dict): a dictionary mapping from canonical action names to ids in the action word vocabulary.
tokenize (callable): a function to tokenize a line of string to a list of tokens.
Note:
- the states for each action sequence include the last CLOSE action, which will be removed if eos token is not
appended at the end of each sequence.
"""
tgt_vocab_masks = [] # a list of 2-D tensors of size (seq_len, tgt_vocab_size)
tgt_actnode_masks = [] # a list of 1-D tensors of size (seq_len,)
tgt_src_cursors = [] # a list of 1-D tensors of size (seq_len,)
# graph structure
tgt_actedge_masks = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_cur_nodes = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_pre_nodes = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_directions = [] # a list of 1-D tensors of size (seq_len,)
if canonical_act_ids is None:
assert actions_dict is not None
canonical_act_ids = AMRStateMachine.canonical_action_to_dict(actions_dict)
if tokenize is None:
def tokenize(line):
return line.strip().split('\t')
with open(en_file, 'r') as f, open(actions_file, 'r') as g:
for tokens, actions in tqdm(zip(f, g)):
if tokens.strip():
tokens = tokenize(tokens)
actions = tokenize(actions)
assert tokens[-1] == '<ROOT>'
actions_states = get_actions_states(tokens=tokens, actions=actions)
# construct actions states tensors
allowed_cano_actions = actions_states['allowed_cano_actions']
vocab_mask = torch.zeros(len(allowed_cano_actions), len(actions_dict), dtype=torch.uint8)
for i, act_allowed in enumerate(allowed_cano_actions):
# vocab_ids_allowed = list(set().union(*[set(canonical_act_ids[act]) for act in act_allowed]))
# this is a bit faster than above
vocab_ids_allowed = list(
itertools.chain.from_iterable(
[canonical_act_ids[act] for act in act_allowed]
)
)
vocab_mask[i][vocab_ids_allowed] = 1
tgt_vocab_masks.append(vocab_mask)
actions_nodemask = torch.tensor(actions_states['actions_nodemask'], dtype=torch.uint8)
tgt_actnode_masks.append(actions_nodemask)
token_cursors = torch.tensor(actions_states['token_cursors'])
tgt_src_cursors.append(token_cursors)
# graph structure information
actions_edge_mask = torch.tensor(actions_states['actions_edge_mask'], dtype=torch.uint8)
actions_edge_cur_node = torch.tensor(actions_states['actions_edge_cur_node'])
actions_edge_pre_node = torch.tensor(actions_states['actions_edge_pre_node'])
actions_edge_direction = torch.tensor(actions_states['actions_edge_direction'])
tgt_actedge_masks.append(actions_edge_mask)
tgt_actedge_cur_nodes.append(actions_edge_cur_node)
tgt_actedge_pre_nodes.append(actions_edge_pre_node)
tgt_actedge_directions.append(actions_edge_direction)
if consumer is not None:
consumer(vocab_mask, actions_nodemask, token_cursors,
actions_edge_mask, actions_edge_cur_node, actions_edge_pre_node, actions_edge_direction)
return tgt_vocab_masks, tgt_actnode_masks, tgt_src_cursors, \
tgt_actedge_masks, tgt_actedge_cur_nodes, tgt_actedge_pre_nodes, tgt_actedge_directions
def binarize_actstates_tolist(en_file, actions_file, actions_dict=None, tokenize=tokenize_line_tab,
action_state_binarizer=None,
en_offset=0, en_end=-1,
actions_offset=0, actions_end=-1):
"""Get the action states and save to lists."""
tgt_vocab_masks = [] # a list of 2-D tensors of size (seq_len, tgt_vocab_size)
tgt_actnode_masks = [] # a list of 1-D tensors of size (seq_len,)
tgt_src_cursors = [] # a list of 1-D tensors of size (seq_len,)
# graph structure
tgt_actedge_masks = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_cur_nodes = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_pre_nodes = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_directions = [] # a list of 1-D tensors of size (seq_len,)
def consumer(vocab_mask, actions_nodemask, token_cursors,
actions_edge_mask, actions_edge_cur_node, actions_edge_pre_node, actions_edge_direction):
tgt_vocab_masks.append(vocab_mask)
tgt_actnode_masks.append(actions_nodemask)
tgt_src_cursors.append(token_cursors)
# graph structure
tgt_actedge_masks.append(actions_edge_mask)
tgt_actedge_cur_nodes.append(actions_edge_cur_node)
tgt_actedge_pre_nodes.append(actions_edge_pre_node)
tgt_actedge_directions.append(actions_edge_direction)
return
if action_state_binarizer is None:
assert actions_dict is not None
action_state_binarizer = ActionStatesBinarizer(actions_dict)
action_state_binarizer.binarize(en_file, actions_file, consumer, tokenize=tokenize,
en_offset=en_offset, en_end=en_end,
actions_offset=actions_offset, actions_end=actions_end)
# OR (for the same results, but should not be used when the function is called for multiprocessing)
# _ = get_actions_states_file(en_file, actions_file, actions_dict, consumer=consumer, tokenize=tokenize)
return tgt_vocab_masks, tgt_actnode_masks, tgt_src_cursors, \
tgt_actedge_masks, tgt_actedge_cur_nodes, tgt_actedge_pre_nodes, tgt_actedge_directions
# TODO not working for num_workers > 1: need to figure out how to properly return tensor values from Pool
def binarize_actstates_tolist_workers(en_file, actions_file, actions_dict=None,
action_state_binarizer=None,
tokenize=tokenize_line_tab, num_workers=1):
"""Get the action states and save to binary files, allowing multiprocessing to speed up."""
print('-' * 100)
print(f'Generate and process action states information (number of workers: {num_workers}):')
print(f'[English sentence file: {en_file}]')
print(f'[AMR actions file: {actions_file}]')
print('processing ...', end=' ')
start = time.time()
en_offsets, actions_offsets = ActionStatesBinarizer.find_offsets_paired(en_file, actions_file, num_workers)
if action_state_binarizer is None:
assert actions_dict is not None
action_state_binarizer = ActionStatesBinarizer(actions_dict)
pool = None
# multiprocessing
if num_workers > 1:
pool = Pool(processes=num_workers - 1)
res = []
for worker_id in range(1, num_workers):
res.append(pool.apply_async(
binarize_actstates_tolist,
(
en_file,
actions_file,
actions_dict,
tokenize,
action_state_binarizer,
en_offsets[worker_id],
en_offsets[worker_id + 1],
actions_offsets[worker_id],
actions_offsets[worker_id + 1]
),
))
pool.close()
# main process
tgt_vocab_masks = [] # a list of 2-D tensors of size (seq_len, tgt_vocab_size)
tgt_actnode_masks = [] # a list of 1-D tensors of size (seq_len,)
tgt_src_cursors = [] # a list of 1-D tensors of size (seq_len,)
# graph structure
tgt_actedge_masks = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_cur_nodes = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_pre_nodes = [] # a list of 1-D tensors of size (seq_len,)
tgt_actedge_directions = [] # a list of 1-D tensors of size (seq_len,)
def consumer(vocab_mask, actions_nodemask, token_cursors,
actions_edge_mask, actions_edge_cur_node, actions_edge_pre_node, actions_edge_direction):
tgt_vocab_masks.append(vocab_mask)
tgt_actnode_masks.append(actions_nodemask)
tgt_src_cursors.append(token_cursors)
# graph structure
tgt_actedge_masks.append(actions_edge_mask)
tgt_actedge_cur_nodes.append(actions_edge_cur_node)
tgt_actedge_pre_nodes.append(actions_edge_pre_node)
tgt_actedge_directions.append(actions_edge_direction)
return
action_state_binarizer.binarize(en_file, actions_file, consumer, tokenize=tokenize,
en_offset=0, en_end=en_offsets[1],
actions_offset=0, actions_end=actions_offsets[1])
# merge the files from multiple workers to the main process
if num_workers > 1:
pool.join()
for worker_id in range(1, num_workers):
import pdb
pdb.set_trace()
# tgt_vocab_masks += res[worker_id - 1].get()[0]
# tgt_actnode_masks += res[worker_id - 1].get()[1]
# tgt_src_cursors += res[worker_id - 1].get()[2]
# tgt_actedge_masks += res[worker_id - 1].get()[3]
# tgt_actedge_cur_nodes += res[worker_id - 1].get()[4]
# tgt_actedge_pre_nodes += res[worker_id - 1].get()[5]
# tgt_actedge_directions += res[worker_id - 1].get()[6]
print('finished !')
print(f'Processed data saved to lists.')
print(f'Total time elapsed: {time_since(start)}')
print('-' * 100)
return tgt_vocab_masks, tgt_actnode_masks, tgt_src_cursors, \
tgt_actedge_masks, tgt_actedge_cur_nodes, tgt_actedge_pre_nodes, tgt_actedge_directions
def binarize_actstates_tofile(en_file, actions_file, out_file_pref,
actions_dict=None,
impl='mmap',
tokenize=tokenize_line_tab,
action_state_binarizer=None,
en_offset=0, en_end=-1,
actions_offset=0, actions_end=-1):
"""Get the action states and save to binary files."""
out_file_tgt_vocab_masks = out_file_pref + '.vocab_masks' + '.bin'
index_file_tgt_vocab_masks = out_file_pref + '.vocab_masks' + '.idx'
out_file_tgt_actnode_masks = out_file_pref + '.actnode_masks' + '.bin'
index_file_tgt_actnode_masks = out_file_pref + '.actnode_masks' + '.idx'
out_file_tgt_src_cursors = out_file_pref + '.src_cursors' + '.bin'
index_file_tgt_src_cursors = out_file_pref + '.src_cursors' + '.idx'
# graph structure
out_file_tgt_actedge_masks = out_file_pref + '.actedge_masks' + '.bin'
index_file_tgt_actedge_masks = out_file_pref + '.actedge_masks' + '.idx'
out_file_tgt_actedge_cur_nodes = out_file_pref + '.actedge_cur_nodes' + '.bin'
index_file_tgt_actedge_cur_nodes = out_file_pref + '.actedge_cur_nodes' + '.idx'
out_file_tgt_actedge_pre_nodes = out_file_pref + '.actedge_pre_nodes' + '.bin'
index_file_tgt_actedge_pre_nodes = out_file_pref + '.actedge_pre_nodes' + '.idx'
out_file_tgt_actedge_directions = out_file_pref + '.actedge_directions' + '.bin'
index_file_tgt_actedge_directions = out_file_pref + '.actedge_directions' + '.idx'
ds_tgt_vocab_masks = make_builder(out_file_tgt_vocab_masks, impl=impl, dtype=np.uint8)
ds_tgt_actnode_masks = make_builder(out_file_tgt_actnode_masks, impl=impl, dtype=np.uint8)
ds_tgt_src_cursors = make_builder(out_file_tgt_src_cursors, impl=impl, dtype=np.int64)
# graph structure
ds_tgt_actedge_masks = make_builder(out_file_tgt_actedge_masks, impl=impl, dtype=np.uint8)
ds_tgt_actedge_cur_nodes = make_builder(out_file_tgt_actedge_cur_nodes, impl=impl, dtype=np.int64)
ds_tgt_actedge_pre_nodes = make_builder(out_file_tgt_actedge_pre_nodes, impl=impl, dtype=np.int64)
ds_tgt_actedge_directions = make_builder(out_file_tgt_actedge_directions, impl=impl, dtype=np.int64)
def consumer(vocab_mask, actions_nodemask, token_cursors,
actions_edge_mask, actions_edge_cur_node, actions_edge_pre_node, actions_edge_direction):
ds_tgt_vocab_masks.add_item(vocab_mask.view(-1)) # NOTE here we flatten the 2-D tensor
ds_tgt_actnode_masks.add_item(actions_nodemask)
ds_tgt_src_cursors.add_item(token_cursors)
# graph structure
ds_tgt_actedge_masks.add_item(actions_edge_mask)
ds_tgt_actedge_cur_nodes.add_item(actions_edge_cur_node)
ds_tgt_actedge_pre_nodes.add_item(actions_edge_pre_node)
ds_tgt_actedge_directions.add_item(actions_edge_direction)
return
if action_state_binarizer is None:
assert actions_dict is not None
action_state_binarizer = ActionStatesBinarizer(actions_dict)
action_state_binarizer.binarize(en_file, actions_file, consumer, tokenize=tokenize,
en_offset=en_offset, en_end=en_end,
actions_offset=actions_offset, actions_end=actions_end)
# OR (for the same results, but should not be used when the function is called for multiprocessing)
# _ = get_actions_states_file(en_file, actions_file, actions_dict, consumer=consumer, tokenize=tokenize)
ds_tgt_vocab_masks.finalize(index_file_tgt_vocab_masks)
ds_tgt_actnode_masks.finalize(index_file_tgt_actnode_masks)
ds_tgt_src_cursors.finalize(index_file_tgt_src_cursors)
# graph structure
ds_tgt_actedge_masks.finalize(index_file_tgt_actedge_masks)
ds_tgt_actedge_cur_nodes.finalize(index_file_tgt_actedge_cur_nodes)
ds_tgt_actedge_pre_nodes.finalize(index_file_tgt_actedge_pre_nodes)
ds_tgt_actedge_directions.finalize(index_file_tgt_actedge_directions)
return
def binarize_actstates_tofile_workers(en_file, actions_file, out_file_pref,
actions_dict=None,
action_state_binarizer=None,
impl='mmap',
tokenize=tokenize_line_tab,
num_workers=1):
"""Get the action states and save to binary files, allowing multiprocessing to speed up."""
print('-' * 100)
print(f'Generate and process action states information (number of workers: {num_workers}):')
print(f'[English sentence file: {en_file}]')
print(f'[AMR actions file: {actions_file}]')
print('processing ...', end=' ')
start = time.time()
en_offsets, actions_offsets = ActionStatesBinarizer.find_offsets_paired(en_file, actions_file, num_workers)
if action_state_binarizer is None:
assert actions_dict is not None
action_state_binarizer = ActionStatesBinarizer(actions_dict)
pool = None
# multiprocessing
if num_workers > 1:
pool = Pool(processes=num_workers - 1)
for worker_id in range(1, num_workers):
out_file_pref_temp = out_file_pref + f'{worker_id}'
pool.apply_async(
binarize_actstates_tofile,
(
en_file,
actions_file,
out_file_pref_temp,
actions_dict,
impl,
tokenize,
action_state_binarizer,
en_offsets[worker_id],
en_offsets[worker_id + 1],
actions_offsets[worker_id],
actions_offsets[worker_id + 1]
),
callback=None
)
pool.close()
# main process
out_file_tgt_vocab_masks = out_file_pref + '.vocab_masks' + '.bin'
index_file_tgt_vocab_masks = out_file_pref + '.vocab_masks' + '.idx'
out_file_tgt_actnode_masks = out_file_pref + '.actnode_masks' + '.bin'
index_file_tgt_actnode_masks = out_file_pref + '.actnode_masks' + '.idx'
out_file_tgt_src_cursors = out_file_pref + '.src_cursors' + '.bin'
index_file_tgt_src_cursors = out_file_pref + '.src_cursors' + '.idx'
# graph structure
out_file_tgt_actedge_masks = out_file_pref + '.actedge_masks' + '.bin'
index_file_tgt_actedge_masks = out_file_pref + '.actedge_masks' + '.idx'
out_file_tgt_actedge_cur_nodes = out_file_pref + '.actedge_cur_nodes' + '.bin'
index_file_tgt_actedge_cur_nodes = out_file_pref + '.actedge_cur_nodes' + '.idx'
out_file_tgt_actedge_pre_nodes = out_file_pref + '.actedge_pre_nodes' + '.bin'
index_file_tgt_actedge_pre_nodes = out_file_pref + '.actedge_pre_nodes' + '.idx'
out_file_tgt_actedge_directions = out_file_pref + '.actedge_directions' + '.bin'
index_file_tgt_actedge_directions = out_file_pref + '.actedge_directions' + '.idx'
ds_tgt_vocab_masks = make_builder(out_file_tgt_vocab_masks, impl=impl, dtype=np.uint8)
ds_tgt_actnode_masks = make_builder(out_file_tgt_actnode_masks, impl=impl, dtype=np.uint8)
ds_tgt_src_cursors = make_builder(out_file_tgt_src_cursors, impl=impl, dtype=np.int64)
# graph structure
ds_tgt_actedge_masks = make_builder(out_file_tgt_actedge_masks, impl=impl, dtype=np.uint8)
ds_tgt_actedge_cur_nodes = make_builder(out_file_tgt_actedge_cur_nodes, impl=impl, dtype=np.int64)
ds_tgt_actedge_pre_nodes = make_builder(out_file_tgt_actedge_pre_nodes, impl=impl, dtype=np.int64)
ds_tgt_actedge_directions = make_builder(out_file_tgt_actedge_directions, impl=impl, dtype=np.int64)
def consumer(vocab_mask, actions_nodemask, token_cursors,
actions_edge_mask, actions_edge_cur_node, actions_edge_pre_node, actions_edge_direction):
ds_tgt_vocab_masks.add_item(vocab_mask.view(-1)) # NOTE here we flatten the 2-D tensor
ds_tgt_actnode_masks.add_item(actions_nodemask)
ds_tgt_src_cursors.add_item(token_cursors)
# graph structure
ds_tgt_actedge_masks.add_item(actions_edge_mask)
ds_tgt_actedge_cur_nodes.add_item(actions_edge_cur_node)
ds_tgt_actedge_pre_nodes.add_item(actions_edge_pre_node)
ds_tgt_actedge_directions.add_item(actions_edge_direction)
return
action_state_binarizer.binarize(en_file, actions_file, consumer, tokenize=tokenize,
en_offset=0, en_end=en_offsets[1],
actions_offset=0, actions_end=actions_offsets[1])
# merge the files from multiple workers to the main process
if num_workers > 1:
pool.join()
for worker_id in range(1, num_workers):
out_file_pref_temp = out_file_pref + f'{worker_id}'
ds_tgt_vocab_masks.merge_file_(out_file_pref_temp + '.vocab_masks')
ds_tgt_actnode_masks.merge_file_(out_file_pref_temp + '.actnode_masks')
ds_tgt_src_cursors.merge_file_(out_file_pref_temp + '.src_cursors')
# graph structure
ds_tgt_actedge_masks.merge_file_(out_file_pref_temp + '.actedge_masks')
ds_tgt_actedge_cur_nodes.merge_file_(out_file_pref_temp + '.actedge_cur_nodes')
ds_tgt_actedge_pre_nodes.merge_file_(out_file_pref_temp + '.actedge_pre_nodes')
ds_tgt_actedge_directions.merge_file_(out_file_pref_temp + '.actedge_directions')
os.remove(out_file_pref_temp + '.vocab_masks' + '.bin')
os.remove(out_file_pref_temp + '.vocab_masks' + '.idx')
os.remove(out_file_pref_temp + '.actnode_masks' + '.bin')
os.remove(out_file_pref_temp + '.actnode_masks' + '.idx')
os.remove(out_file_pref_temp + '.src_cursors' + '.bin')
os.remove(out_file_pref_temp + '.src_cursors' + '.idx')
# graph structure
os.remove(out_file_pref_temp + '.actedge_masks' + '.bin')
os.remove(out_file_pref_temp + '.actedge_masks' + '.idx')
os.remove(out_file_pref_temp + '.actedge_cur_nodes' + '.bin')
os.remove(out_file_pref_temp + '.actedge_cur_nodes' + '.idx')
os.remove(out_file_pref_temp + '.actedge_pre_nodes' + '.bin')
os.remove(out_file_pref_temp + '.actedge_pre_nodes' + '.idx')
os.remove(out_file_pref_temp + '.actedge_directions' + '.bin')
os.remove(out_file_pref_temp + '.actedge_directions' + '.idx')
# finalize to save the dtype and size and index info
ds_tgt_vocab_masks.finalize(index_file_tgt_vocab_masks)
ds_tgt_actnode_masks.finalize(index_file_tgt_actnode_masks)
ds_tgt_src_cursors.finalize(index_file_tgt_src_cursors)
# graph structure
ds_tgt_actedge_masks.finalize(index_file_tgt_actedge_masks)
ds_tgt_actedge_cur_nodes.finalize(index_file_tgt_actedge_cur_nodes)
ds_tgt_actedge_pre_nodes.finalize(index_file_tgt_actedge_pre_nodes)
ds_tgt_actedge_directions.finalize(index_file_tgt_actedge_directions)
print('finished !')
print(f'Processed data saved to path with prefix: {out_file_pref}')
print(f'Total time elapsed: {time_since(start)}')
print('-' * 100)
return
def load_actstates_fromfile(file_pref, actions_dict, impl='mmap'):
"""Load the action states from binary files"""
file_pref_tgt_vocab_masks = file_pref + '.vocab_masks'
file_pref_tgt_actnode_masks = file_pref + '.actnode_masks'
file_pref_tgt_src_cursors = file_pref + '.src_cursors'
# graph structure
file_pref_tgt_actedge_masks = file_pref + '.actedge_masks'
file_pref_tgt_actedge_cur_nodes = file_pref + '.actedge_cur_nodes'
file_pref_tgt_actedge_pre_nodes = file_pref + '.actedge_pre_nodes'
file_pref_tgt_actedge_directions = file_pref + '.actedge_directions'
tgt_vocab_masks = load_indexed_dataset(file_pref_tgt_vocab_masks, actions_dict, impl)
tgt_actnode_masks = load_indexed_dataset(file_pref_tgt_actnode_masks, None, impl)
tgt_src_cursors = load_indexed_dataset(file_pref_tgt_src_cursors, None, impl)
# graph structure
tgt_actedge_masks = load_indexed_dataset(file_pref_tgt_actedge_masks, None, impl)
tgt_actedge_cur_nodes = load_indexed_dataset(file_pref_tgt_actedge_cur_nodes, None, impl)
tgt_actedge_pre_nodes = load_indexed_dataset(file_pref_tgt_actedge_pre_nodes, None, impl)
tgt_actedge_directions = load_indexed_dataset(file_pref_tgt_actedge_directions, None, impl)
return tgt_vocab_masks, tgt_actnode_masks, tgt_src_cursors, \
tgt_actedge_masks, tgt_actedge_cur_nodes, tgt_actedge_pre_nodes, tgt_actedge_directions
| 50.449301 | 120 | 0.668018 | 3,831 | 28,857 | 4.62934 | 0.079875 | 0.065407 | 0.035354 | 0.029433 | 0.810882 | 0.786073 | 0.758951 | 0.728898 | 0.675839 | 0.660107 | 0 | 0.006801 | 0.251031 | 28,857 | 571 | 121 | 50.537653 | 0.813769 | 0.151055 | 0 | 0.644231 | 0 | 0 | 0.079809 | 0.00526 | 0 | 0 | 0 | 0.003503 | 0.019231 | 1 | 0.038462 | false | 0 | 0.033654 | 0.002404 | 0.110577 | 0.048077 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d50f434b6d70731db143e5ee022731d0ee156bee | 108 | py | Python | gpt/config.py | wyu-du/formality_emnlp19 | 8f55e71138f14e5c26d1a63fce6e4b42f318f53b | [
"MIT"
] | 1 | 2021-06-10T14:54:37.000Z | 2021-06-10T14:54:37.000Z | gpt/config.py | wyu-du/formality_emnlp19 | 8f55e71138f14e5c26d1a63fce6e4b42f318f53b | [
"MIT"
] | null | null | null | gpt/config.py | wyu-du/formality_emnlp19 | 8f55e71138f14e5c26d1a63fce6e4b42f318f53b | [
"MIT"
] | null | null | null | from gpt.src import encoder
text_enc = encoder.get_encoder('gpt/models/117M')
config_path='gpt/models/117M'
| 27 | 49 | 0.796296 | 18 | 108 | 4.611111 | 0.666667 | 0.216867 | 0.313253 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.06 | 0.074074 | 108 | 3 | 50 | 36 | 0.77 | 0 | 0 | 0 | 0 | 0 | 0.277778 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
1d207130603ada17ede5b92d6a68c5ee74c45e31 | 79 | py | Python | v4/evaluate/extractor/__init__.py | windszzlang/CBCP_End2End_Causality_Extraction | c0fb7f09d3138698efb1fc389eba7ea9547a5193 | [
"Apache-2.0"
] | null | null | null | v4/evaluate/extractor/__init__.py | windszzlang/CBCP_End2End_Causality_Extraction | c0fb7f09d3138698efb1fc389eba7ea9547a5193 | [
"Apache-2.0"
] | null | null | null | v4/evaluate/extractor/__init__.py | windszzlang/CBCP_End2End_Causality_Extraction | c0fb7f09d3138698efb1fc389eba7ea9547a5193 | [
"Apache-2.0"
] | null | null | null | # must use . to change path
from .causality_extractor import CausalityExtractor | 39.5 | 51 | 0.835443 | 10 | 79 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126582 | 79 | 2 | 51 | 39.5 | 0.942029 | 0.316456 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
1d54ea74143ee72842c1ce1894f057e4622124fa | 215 | py | Python | tests/test_settings.py | Icheka/django-stripe-api-integration | 2c26fdc4d4b85786fa933063f6eda2c81a8fd045 | [
"MIT"
] | 5 | 2017-07-01T22:28:58.000Z | 2018-05-26T01:14:01.000Z | tests/test_settings.py | Icheka/django-stripe-api-integration | 2c26fdc4d4b85786fa933063f6eda2c81a8fd045 | [
"MIT"
] | 55 | 2017-06-06T09:21:01.000Z | 2019-07-10T11:18:31.000Z | tests/test_settings.py | Icheka/django-stripe-api-integration | 2c26fdc4d4b85786fa933063f6eda2c81a8fd045 | [
"MIT"
] | 3 | 2017-11-03T14:40:30.000Z | 2019-02-26T05:19:30.000Z | from django.test import TestCase
from aa_stripe.settings import stripe_settings
class TestSettings(TestCase):
def test_defaults(self):
self.assertEqual(stripe_settings.PENDING_WEBHOOKS_THRESHOLD, 20)
| 23.888889 | 72 | 0.804651 | 27 | 215 | 6.185185 | 0.666667 | 0.251497 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010753 | 0.134884 | 215 | 8 | 73 | 26.875 | 0.887097 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
1d54fb42693f356502c01def06a57c2add922aad | 69 | py | Python | Bonus.py | S0obi/SnakesAndLadders | 7ba40668f5fc9d2ed13e4361ca13bd9735e44ae6 | [
"MIT"
] | null | null | null | Bonus.py | S0obi/SnakesAndLadders | 7ba40668f5fc9d2ed13e4361ca13bd9735e44ae6 | [
"MIT"
] | null | null | null | Bonus.py | S0obi/SnakesAndLadders | 7ba40668f5fc9d2ed13e4361ca13bd9735e44ae6 | [
"MIT"
] | null | null | null | class Bonus:
def __init__(self, type):
self.type = type
| 13.8 | 29 | 0.594203 | 9 | 69 | 4.111111 | 0.666667 | 0.432432 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.304348 | 69 | 4 | 30 | 17.25 | 0.770833 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 5 |
1d5718cdd187fda653a17cdabd2f2fd9cfaf7102 | 43 | py | Python | examples/example_mkdir.py | juancarlospaco/thatlib | 37403983c228521b992ad592231957a1c7af01f2 | [
"MIT"
] | 31 | 2021-05-12T16:54:34.000Z | 2022-02-17T12:36:52.000Z | examples/example_mkdir.py | juancarlospaco/thatlib | 37403983c228521b992ad592231957a1c7af01f2 | [
"MIT"
] | 1 | 2021-07-23T02:58:07.000Z | 2021-09-03T21:53:29.000Z | examples/example_mkdir.py | juancarlospaco/thatlib | 37403983c228521b992ad592231957a1c7af01f2 | [
"MIT"
] | 1 | 2021-05-12T22:12:20.000Z | 2021-05-12T22:12:20.000Z | from thatlib import mkdir
mkdir("example")
| 14.333333 | 25 | 0.790698 | 6 | 43 | 5.666667 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116279 | 43 | 2 | 26 | 21.5 | 0.894737 | 0 | 0 | 0 | 0 | 0 | 0.162791 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
1d64eb3189f99f3ae60c0aa000496a01f244c30c | 4,797 | py | Python | epytope/Data/pssms/arb/mat/A_0219_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/arb/mat/A_0219_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/arb/mat/A_0219_9.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | A_0219_9 = {0: {'A': 0.2420334938061355, 'C': -0.12964532145406094, 'E': -0.30716253311729963, 'D': -0.20136070573849837, 'G': 0.09315559829464488, 'F': 0.414085377622071, 'I': -0.11091042509341746, 'H': -0.40154576951031906, 'K': -0.11190222068525454, 'M': -0.16860437072777687, 'L': 0.20901824078912526, 'N': 0.032287878091663676, 'Q': 0.11764813950492131, 'P': -0.4510381206036012, 'S': -0.2651472265026922, 'R': -0.4731550123861466, 'T': -0.28413749083180867, 'W': 0.2955906501791419, 'V': -0.09635304020464032, 'Y': 0.7408657058985775}, 1: {'A': -0.41943263805417924, 'C': -0.6061935504333876, 'E': -0.6076150068101372, 'D': -0.607213243223602, 'G': -0.42689370995900866, 'F': -0.26210331331656417, 'I': -0.10967350782637802, 'H': -0.6288986336633852, 'K': -0.6139266374902476, 'M': 1.190384146568963, 'L': 1.4017298248353962, 'N': -0.6067032731427604, 'Q': 0.05055904458391644, 'P': -0.6281390090418096, 'S': -0.607352492311383, 'R': -0.6344244536958641, 'T': -0.4094068917461391, 'W': -0.607724675232467, 'V': -0.3341434179358044, 'Y': -0.5821559530728522}, 2: {'A': 0.03151441917923293, 'C': -0.5230670093085569, 'E': -0.43100928136539085, 'D': 0.09133983002015222, 'G': -0.10854506054292079, 'F': -0.039475930714978576, 'I': -0.25845810564074134, 'H': 0.05885721963591881, 'K': -0.3618581378273778, 'M': 0.9018137470311799, 'L': 0.2321708275679429, 'N': 0.07831164228003454, 'Q': 0.22144506774368122, 'P': 0.05214050830759903, 'S': 0.08094336297852421, 'R': -0.558514130048989, 'T': -0.15441584094409533, 'W': 0.18996836396566266, 'V': -0.5017537954964252, 'Y': 0.369764095683107}, 3: {'A': -0.28626087976730247, 'C': -0.025125042713760825, 'E': 0.47178602649403406, 'D': 0.7623297880080667, 'G': 0.3136472556573316, 'F': -0.3657171680025016, 'I': -0.21747542126833005, 'H': -0.5194043975409929, 'K': -0.293285801247425, 'M': -0.22636485330335548, 'L': -0.1553118171029022, 'N': -0.0979392609940178, 'Q': 0.17191291166213873, 'P': 0.05158066081625252, 'S': 0.10243891992817417, 'R': -0.3305725976478324, 'T': -0.2792916406115506, 'W': -0.31829212874127993, 'V': -0.47387241520285656, 'Y': -0.40070222297241603}, 4: {'A': -0.0664630090303782, 'C': 0.08906413209160546, 'E': -0.01631783995225214, 'D': 0.2811505654670672, 'G': 0.2699699503925373, 'F': -0.23462556888397043, 'I': -0.29073835177154284, 'H': -0.3009509959974252, 'K': -0.14121867364784013, 'M': 0.0678370240476132, 'L': -0.24882748064831306, 'N': 0.18968866265159356, 'Q': -0.37324808981501906, 'P': -0.09042667420234526, 'S': 0.09594153430999246, 'R': -0.5370676695087087, 'T': 0.18691516307466047, 'W': 0.7048833323442629, 'V': 0.08399414782445343, 'Y': 0.5009958670368024}, 5: {'A': 0.07878350356281144, 'C': 0.2795393513032944, 'E': -0.09436084459364735, 'D': -0.009535790747915907, 'G': -0.03321434575342667, 'F': -0.25484921353296797, 'I': 0.35957002643872255, 'H': -0.06394434795697493, 'K': -0.1414000989242711, 'M': -0.028836961840174796, 'L': 0.1073770390964023, 'N': -0.12028478909114225, 'Q': 0.07539197454994266, 'P': -0.1708262132646714, 'S': 0.2049606141156023, 'R': -0.5078537547759676, 'T': 0.07290481680957006, 'W': -0.29945826510496754, 'V': 0.1495075300850585, 'Y': 0.013283264778613241}, 6: {'A': 0.01411226130059054, 'C': 0.06692290277721402, 'E': -0.06340146779041687, 'D': 0.1746866532150916, 'G': -0.25992464000755505, 'F': 0.5009868235293345, 'I': 0.06355712998714634, 'H': 0.35077213192757506, 'K': -0.26925800741860245, 'M': -0.013849751311046675, 'L': -0.32758688479932485, 'N': -0.22385598526874687, 'Q': -0.06336166705835866, 'P': 0.47510097331107193, 'S': -0.2906131684624784, 'R': -0.47252967044892613, 'T': -0.11343812404340384, 'W': 0.221827025663051, 'V': -0.2039985639445891, 'Y': 0.29109835352637226}, 7: {'A': -0.2214844136003379, 'C': 0.253972043605802, 'E': -0.11180878646892282, 'D': 0.04866386625383542, 'G': 0.21129609322137066, 'F': 0.09675763577527521, 'I': -0.478466495950241, 'H': -0.22278119575014163, 'K': 0.0024895662503172412, 'M': -0.08637762364986003, 'L': -0.16451622726927184, 'N': 0.14658405355475607, 'Q': -0.22460008840640644, 'P': 0.06863736746483798, 'S': 0.02806708910872769, 'R': 0.17046998008080952, 'T': 0.12640810468428135, 'W': -0.325349814172603, 'V': -0.051103104718504995, 'Y': 0.4213757307211304}, 8: {'A': 0.48788428252771016, 'C': -0.02730369832594655, 'E': -0.6113264720739239, 'D': -0.6061935504333876, 'G': -4.0, 'F': -0.553306353566414, 'I': 0.3385355359756546, 'H': -0.612884043508607, 'K': -0.6261305872802506, 'M': 0.006175759526607426, 'L': 0.1606962734073028, 'N': -0.5384273463457844, 'Q': -0.530233857024553, 'P': -4.0, 'S': -0.22209665774387793, 'R': -0.6118447637583928, 'T': 0.3905794756125614, 'W': -0.6207885684222972, 'V': 1.2769558604632072, 'Y': -0.6997587692314469}, -1: {'slope': 0.10404992803361, 'intercept': -0.3897501239679909}} | 4,797 | 4,797 | 0.702731 | 559 | 4,797 | 6.026834 | 0.379249 | 0.005343 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.717775 | 0.078174 | 4,797 | 1 | 4,797 | 4,797 | 0.044098 | 0 | 0 | 0 | 0 | 0 | 0.040434 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1d9b27389fb8302675e8ee2f398066b71819484d | 179 | py | Python | moneydog/lib/util.py | Falldog/moneydog | 86e7cab1c0b35f07d1fe42e699e1159f57f1bef5 | [
"Apache-2.0"
] | null | null | null | moneydog/lib/util.py | Falldog/moneydog | 86e7cab1c0b35f07d1fe42e699e1159f57f1bef5 | [
"Apache-2.0"
] | null | null | null | moneydog/lib/util.py | Falldog/moneydog | 86e7cab1c0b35f07d1fe42e699e1159f57f1bef5 | [
"Apache-2.0"
] | null | null | null | from datetime import date, datetime
def str2datetime(s):
return datetime.strptime(s, '%Y-%m-%d')
def str2date(s):
return datetime.strptime(s[:10], '%Y-%m-%d').date()
| 16.272727 | 55 | 0.648045 | 27 | 179 | 4.296296 | 0.518519 | 0.12069 | 0.258621 | 0.396552 | 0.413793 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02649 | 0.156425 | 179 | 10 | 56 | 17.9 | 0.741722 | 0 | 0 | 0 | 0 | 0 | 0.089888 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.4 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 5 |
d53d79f82aad288e4198342930d91c1398f4ae2e | 13,031 | py | Python | tests/registry_searcher.py | joachimmetz/dfwinreg | 1b7f552f48f54e7b2d259c73b91b1d9980129544 | [
"Apache-2.0"
] | 3 | 2019-12-16T14:59:54.000Z | 2020-05-22T12:20:06.000Z | tests/registry_searcher.py | nwoolr20/dfwinreg | 3cae45c90501b2f5663a041bf29edbbb3bb5c73b | [
"Apache-2.0"
] | null | null | null | tests/registry_searcher.py | nwoolr20/dfwinreg | 3cae45c90501b2f5663a041bf29edbbb3bb5c73b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Windows Registry searcher."""
import unittest
from dfwinreg import fake
from dfwinreg import registry
from dfwinreg import registry_searcher
from tests import registry as test_registry
from tests import test_lib
class FindSpecTest(test_lib.BaseTestCase):
"""Tests for the find specification."""
# pylint: disable=protected-access
def testInitialize(self):
"""Tests the __init__ function."""
find_spec = registry_searcher.FindSpec()
self.assertIsNotNone(find_spec)
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
self.assertIsNotNone(find_spec)
find_spec = registry_searcher.FindSpec(
key_path=['HKEY_CURRENT_USER', 'Software', 'Microsoft'])
self.assertIsNotNone(find_spec)
find_spec = registry_searcher.FindSpec(
key_path_glob='HKEY_CURRENT_USER\\*\\Microsoft')
self.assertIsNotNone(find_spec)
find_spec = registry_searcher.FindSpec(
key_path_glob=['HKEY_CURRENT_USER', '*', 'Microsoft'])
self.assertIsNotNone(find_spec)
find_spec = registry_searcher.FindSpec(
key_path_regex='HKEY_CURRENT_USER\\.*\\Microsoft')
self.assertIsNotNone(find_spec)
find_spec = registry_searcher.FindSpec(
key_path_regex=['HKEY_CURRENT_USER', '.*', 'Microsoft'])
self.assertIsNotNone(find_spec)
with self.assertRaises(TypeError):
registry_searcher.FindSpec(key_path=('bogus', 0))
with self.assertRaises(TypeError):
registry_searcher.FindSpec(key_path_glob=('bogus', 0))
with self.assertRaises(TypeError):
registry_searcher.FindSpec(key_path_regex=('bogus', 0))
with self.assertRaises(ValueError):
registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft',
key_path_glob='HKEY_CURRENT_USER\\*\\Microsoft')
def testCheckKeyPath(self):
"""Tests the _CheckKeyPath function."""
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
registry_key = fake.FakeWinRegistryKey(
'Microsoft', key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec._CheckKeyPath(registry_key, 3)
self.assertTrue(result)
result = find_spec._CheckKeyPath(registry_key, 0)
self.assertTrue(result)
# Test incorrect search depth.
result = find_spec._CheckKeyPath(registry_key, 1)
self.assertFalse(result)
# Test invalid search depth.
result = find_spec._CheckKeyPath(registry_key, -1)
self.assertFalse(result)
result = find_spec._CheckKeyPath(registry_key, 99)
self.assertFalse(result)
# Test find specification with regular expression.
find_spec = registry_searcher.FindSpec(
key_path_regex=['HKEY_CURRENT_USER', 'Software', 'Microsoft'])
registry_key = fake.FakeWinRegistryKey(
'Microsoft', key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec._CheckKeyPath(registry_key, 3)
self.assertTrue(result)
# Test find specification without key_path_segments.
find_spec._key_path_segments = None
result = find_spec._CheckKeyPath(registry_key, 3)
self.assertFalse(result)
# Test find specification with invalid regular expression.
find_spec = registry_searcher.FindSpec(
key_path_regex=['HKEY_CURRENT_USER', 'Software', 'Mi(rosoft'])
registry_key = fake.FakeWinRegistryKey(
'Microsoft', key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec._CheckKeyPath(registry_key, 3)
self.assertFalse(result)
def testCompareWithKeyPathSegment(self):
"""Test the _CompareWithKeyPathSegment function."""
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec._CompareWithKeyPathSegment('Microsoft', 2)
self.assertTrue(result)
result = find_spec._CompareWithKeyPathSegment('Microsoft', 1)
self.assertFalse(result)
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Bogus')
result = find_spec._CompareWithKeyPathSegment('Microsoft', 2)
self.assertFalse(result)
def testAtLastKeyPathSegment(self):
"""Test the AtLastKeyPathSegment function."""
find_spec = registry_searcher.FindSpec()
result = find_spec.AtLastKeyPathSegment(2)
self.assertFalse(result)
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.AtLastKeyPathSegment(0)
self.assertFalse(result)
result = find_spec.AtLastKeyPathSegment(2)
self.assertTrue(result)
result = find_spec.AtLastKeyPathSegment(5)
self.assertTrue(result)
def testAtMaximumDepth(self):
"""Tests the AtMaximumDepth function."""
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.AtMaximumDepth(1)
self.assertFalse(result)
result = find_spec.AtMaximumDepth(5)
self.assertTrue(result)
def testCompareKeyPath(self):
"""Test the CompareKeyPath function."""
registry_key = fake.FakeWinRegistryKey(
'Microsoft', key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.CompareKeyPath(registry_key)
self.assertTrue(result)
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Bogus')
result = find_spec.CompareKeyPath(registry_key)
self.assertFalse(result)
def testCompareNameWithKeyPathSegment(self):
"""Test the CompareNameWithKeyPathSegment function."""
registry_key = fake.FakeWinRegistryKey(
'Microsoft', key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.CompareNameWithKeyPathSegment(registry_key, 2)
self.assertTrue(result)
result = find_spec.CompareNameWithKeyPathSegment(registry_key, 1)
self.assertFalse(result)
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Bogus')
result = find_spec.CompareNameWithKeyPathSegment(registry_key, 2)
self.assertFalse(result)
def testHasKeyPath(self):
"""Test the HasKeyPath function."""
find_spec = registry_searcher.FindSpec()
result = find_spec.HasKeyPath()
self.assertFalse(result)
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.HasKeyPath()
self.assertTrue(result)
def testIsLastKeyPathSegment(self):
"""Test the IsLastKeyPathSegment function."""
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.IsLastKeyPathSegment(0)
self.assertFalse(result)
result = find_spec.IsLastKeyPathSegment(2)
self.assertTrue(result)
result = find_spec.IsLastKeyPathSegment(5)
self.assertFalse(result)
def testMatches(self):
"""Tests the Matches function."""
find_spec = registry_searcher.FindSpec(
key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
registry_key = fake.FakeWinRegistryKey(
'Microsoft', key_path='HKEY_CURRENT_USER\\Software\\Microsoft')
result = find_spec.Matches(registry_key, 3)
self.assertEqual(result, (True, True))
result = find_spec.Matches(registry_key, 1)
self.assertEqual(result, (False, False))
result = find_spec.Matches(registry_key, 0)
self.assertEqual(result, (False, True))
# Test find specification without key_path_segments.
find_spec._key_path_segments = None
result = find_spec.Matches(registry_key, 3)
self.assertEqual(result, (True, None))
class WinRegistrySearcherTest(test_lib.BaseTestCase):
"""Tests for the Windows Registry searcher."""
# pylint: disable=protected-access
def testInitialize(self):
"""Tests the __init__ function."""
with self.assertRaises(ValueError):
registry_searcher.WinRegistrySearcher(None)
# TODO: add tests for _FindInKey
def testFind(self):
"""Tests the Find function."""
test_path = self._GetTestFilePath(['SYSTEM'])
self._SkipIfPathNotExists(test_path)
win_registry = registry.WinRegistry(
registry_file_reader=test_registry.TestREGFWinRegistryFileReader())
registry_file = win_registry._OpenFile(test_path)
key_path_prefix = win_registry.GetRegistryFileMapping(registry_file)
win_registry.MapFile(key_path_prefix, registry_file)
searcher = registry_searcher.WinRegistrySearcher(win_registry)
# Test with key path.
find_spec = registry_searcher.FindSpec(
key_path='HKEY_LOCAL_MACHINE\\System\\ControlSet001')
expected_key_paths = ['HKEY_LOCAL_MACHINE\\System\\ControlSet001']
key_paths = list(searcher.Find(find_specs=[find_spec]))
self.assertEqual(key_paths, expected_key_paths)
# Test with key path glob.
find_spec = registry_searcher.FindSpec(
key_path_glob='HKEY_LOCAL_MACHINE\\System\\ControlSet001\\*')
expected_key_paths = [
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Control',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Enum',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Hardware Profiles',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Policies',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Services']
key_paths = list(searcher.Find(find_specs=[find_spec]))
self.assertEqual(key_paths, expected_key_paths)
# Test with key path regular expression.
find_spec = registry_searcher.FindSpec(
key_path_regex=[
'HKEY_LOCAL_MACHINE', 'System', 'ControlSet001', '.*'])
expected_key_paths = [
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Control',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Enum',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Hardware Profiles',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Policies',
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Services']
key_paths = list(searcher.Find(find_specs=[find_spec]))
self.assertEqual(key_paths, expected_key_paths)
# Test with CurrentControlSet.
find_spec = registry_searcher.FindSpec(
key_path_glob='HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\*')
expected_key_paths = [
'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control',
'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Enum',
'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Hardware Profiles',
'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Policies',
'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services']
key_paths = list(searcher.Find(find_specs=[find_spec]))
self.assertEqual(key_paths, expected_key_paths)
# Test without find specifications.
win_registry = registry.WinRegistry(
registry_file_reader=test_registry.TestREGFWinRegistryFileReader(
emulate_virtual_keys=False))
registry_file = win_registry._OpenFile(test_path)
key_path_prefix = win_registry.GetRegistryFileMapping(registry_file)
win_registry.MapFile(key_path_prefix, registry_file)
searcher = registry_searcher.WinRegistrySearcher(win_registry)
key_paths = list(searcher.Find())
self.assertEqual(len(key_paths), 21512)
def testGetKeyByPath(self):
"""Tests the GetKeyByPath function."""
test_path = self._GetTestFilePath(['SYSTEM'])
self._SkipIfPathNotExists(test_path)
win_registry = registry.WinRegistry(
registry_file_reader=test_registry.TestREGFWinRegistryFileReader())
registry_file = win_registry._OpenFile(test_path)
key_path_prefix = win_registry.GetRegistryFileMapping(registry_file)
win_registry.MapFile(key_path_prefix, registry_file)
searcher = registry_searcher.WinRegistrySearcher(win_registry)
registry_key = searcher.GetKeyByPath(
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Control')
self.assertIsNotNone(registry_key)
registry_key = searcher.GetKeyByPath(
'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control')
self.assertIsNotNone(registry_key)
def testSplitKeyPath(self):
"""Tests the SplitKeyPath function."""
test_path = self._GetTestFilePath(['SYSTEM'])
self._SkipIfPathNotExists(test_path)
win_registry = registry.WinRegistry(
registry_file_reader=test_registry.TestREGFWinRegistryFileReader())
registry_file = win_registry._OpenFile(test_path)
key_path_prefix = win_registry.GetRegistryFileMapping(registry_file)
win_registry.MapFile(key_path_prefix, registry_file)
searcher = registry_searcher.WinRegistrySearcher(win_registry)
path_segments = searcher.SplitKeyPath(
'HKEY_LOCAL_MACHINE\\System\\ControlSet001\\Control')
self.assertEqual(len(path_segments), 4)
if __name__ == '__main__':
unittest.main()
| 34.2021 | 75 | 0.737626 | 1,424 | 13,031 | 6.439607 | 0.098315 | 0.061941 | 0.054962 | 0.082443 | 0.856161 | 0.806543 | 0.755834 | 0.683642 | 0.658015 | 0.639695 | 0 | 0.007832 | 0.157317 | 13,031 | 380 | 76 | 34.292105 | 0.827247 | 0.088328 | 0 | 0.704167 | 0 | 0 | 0.193989 | 0.1647 | 0 | 0 | 0 | 0.002632 | 0.2125 | 1 | 0.058333 | false | 0 | 0.025 | 0 | 0.091667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d57d020325ac0e79a9ccfe60fcfd10914cc0cfcc | 143 | py | Python | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-ogoj01 | 7d5ae9cc2698d8203e0f223d36b1c5dd75f6ab8d | [
"Apache-2.0"
] | null | null | null | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-ogoj01 | 7d5ae9cc2698d8203e0f223d36b1c5dd75f6ab8d | [
"Apache-2.0"
] | null | null | null | lib/solutions/SUM/sum_solution.py | DPNT-Sourcecode/CHK-ogoj01 | 7d5ae9cc2698d8203e0f223d36b1c5dd75f6ab8d | [
"Apache-2.0"
] | null | null | null | # noinspection PyShadowingBuiltins,PyUnusedLocal
def compute(value1: int, value2: int) -> int:
return int(value1 + value2)
| 23.833333 | 48 | 0.671329 | 14 | 143 | 6.857143 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036697 | 0.237762 | 143 | 5 | 49 | 28.6 | 0.844037 | 0.321678 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
d59a27eeeea6ddfb58b46ba1cd5abac84af191eb | 451 | py | Python | webapp/libs/backends/errors.py | sangwonl/stage34 | 03b0b25ba843a781d059c33b4df9824636876853 | [
"MIT"
] | 9 | 2016-08-01T05:13:59.000Z | 2020-05-12T04:35:13.000Z | webapp/libs/backends/errors.py | sangwonl/stage34 | 03b0b25ba843a781d059c33b4df9824636876853 | [
"MIT"
] | 38 | 2016-08-14T01:07:14.000Z | 2021-06-10T21:05:25.000Z | webapp/libs/backends/errors.py | sangwonl/stage34 | 03b0b25ba843a781d059c33b4df9824636876853 | [
"MIT"
] | 3 | 2016-11-24T00:05:56.000Z | 2018-11-28T04:34:25.000Z | class GitRepoCloneError(Exception):
pass
class GitRepoPullError(Exception):
pass
class DockerComposeExecError(Exception):
pass
class DockerInspectExecError(Exception):
pass
class UpdateLocalHostError(Exception):
pass
class NginxReloadError(Exception):
pass
class StageConfigNotFoundError(Exception):
pass
class InvalidStageConfigError(Exception):
pass
class InvalidStageConfigError(Exception):
pass
| 12.885714 | 42 | 0.764967 | 36 | 451 | 9.583333 | 0.305556 | 0.33913 | 0.417391 | 0.237681 | 0.275362 | 0.275362 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175166 | 451 | 34 | 43 | 13.264706 | 0.927419 | 0 | 0 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
d5a3bedd97f996adda9f2731f6a80199176164bc | 213 | py | Python | src/error_handlers.py | develamove/courier-api | 8a946178ece9b563d8dafdc8ef9277898d7bb041 | [
"MIT"
] | null | null | null | src/error_handlers.py | develamove/courier-api | 8a946178ece9b563d8dafdc8ef9277898d7bb041 | [
"MIT"
] | null | null | null | src/error_handlers.py | develamove/courier-api | 8a946178ece9b563d8dafdc8ef9277898d7bb041 | [
"MIT"
] | null | null | null | from src.utils import response_creator, SERVER_ERROR
@response_creator
def handle_db_error(error):
return 'Can\'t connect to main database', dict(database=['Can\'t connect to main database']), SERVER_ERROR
| 30.428571 | 111 | 0.774648 | 32 | 213 | 4.96875 | 0.59375 | 0.188679 | 0.138365 | 0.163522 | 0.314465 | 0.314465 | 0 | 0 | 0 | 0 | 0 | 0 | 0.126761 | 213 | 6 | 112 | 35.5 | 0.854839 | 0 | 0 | 0 | 0 | 0 | 0.220657 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
6342c122790879e063b8332b5871c5e65601d335 | 459 | py | Python | python全栈/day47/day47-5 匹配开头和结尾.py | Ringo-li/python_exercise_100 | 2c6c42b84a88ffbbac30c67ffbd7bad3418eda14 | [
"MIT"
] | null | null | null | python全栈/day47/day47-5 匹配开头和结尾.py | Ringo-li/python_exercise_100 | 2c6c42b84a88ffbbac30c67ffbd7bad3418eda14 | [
"MIT"
] | null | null | null | python全栈/day47/day47-5 匹配开头和结尾.py | Ringo-li/python_exercise_100 | 2c6c42b84a88ffbbac30c67ffbd7bad3418eda14 | [
"MIT"
] | null | null | null | import re
# ^ 匹配开头
match_obj = re.match("^n.{3,}", "node")
if match_obj:
result = match_obj.group()
print(result)
else:
print("fail to match")
# $ 匹配结尾
match_obj = re.match("n.{3,}\d$", "nodes2")
if match_obj:
result = match_obj.group()
print(result)
else:
print("fail to match")
# [^] 除了指定字符外都匹配
match_obj = re.match("c[^eft]o", "coo")
if match_obj:
result = match_obj.group()
print(result)
else:
print("fail to match") | 18.36 | 43 | 0.616558 | 70 | 459 | 3.914286 | 0.328571 | 0.262774 | 0.109489 | 0.164234 | 0.781022 | 0.781022 | 0.656934 | 0.656934 | 0.656934 | 0.656934 | 0 | 0.008152 | 0.198257 | 459 | 25 | 44 | 18.36 | 0.736413 | 0.061002 | 0 | 0.789474 | 0 | 0 | 0.17757 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.052632 | 0.315789 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 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 | 5 |
636f47eeb823ef550b329acfab1b248729007d3d | 426 | py | Python | ChromProcess/Writers/__init__.py | thijsdejong10/ChromProcess | aba9c261824d0f29e0a92d7ca7c4a78e03249d62 | [
"BSD-3-Clause"
] | null | null | null | ChromProcess/Writers/__init__.py | thijsdejong10/ChromProcess | aba9c261824d0f29e0a92d7ca7c4a78e03249d62 | [
"BSD-3-Clause"
] | null | null | null | ChromProcess/Writers/__init__.py | thijsdejong10/ChromProcess | aba9c261824d0f29e0a92d7ca7c4a78e03249d62 | [
"BSD-3-Clause"
] | null | null | null | from .chromatogram import chromatogram_to_csv
from .chromatogram import chromatogram_to_peak_collection
from .peak import peak_to_entry_text
from .peak_collection import peak_collection_to_csv
from .peak_collection_series import peak_collection_series_to_data_report
from .mass_spectra import mass_spectrum_to_string_cols
from .mass_spectra import mass_spectrum_to_string_rows
from .data_report import data_report_to_csv
| 30.428571 | 73 | 0.894366 | 65 | 426 | 5.353846 | 0.276923 | 0.201149 | 0.126437 | 0.195402 | 0.442529 | 0.235632 | 0.235632 | 0.235632 | 0 | 0 | 0 | 0 | 0.086854 | 426 | 13 | 74 | 32.769231 | 0.894602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
63a0b2170eab4190459b70babda4f1316b9ada95 | 196 | py | Python | glue/viewers/image/qt/__init__.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | 550 | 2015-01-08T13:51:06.000Z | 2022-03-31T11:54:47.000Z | glue/viewers/image/qt/__init__.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | 1,362 | 2015-01-03T19:15:52.000Z | 2022-03-30T13:23:11.000Z | glue/viewers/image/qt/__init__.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | 142 | 2015-01-08T13:08:00.000Z | 2022-03-18T13:25:57.000Z | from .data_viewer import ImageViewer # noqa
from .standalone_image_viewer import StandaloneImageViewer # noqa
def setup():
from glue.config import qt_client
qt_client.add(ImageViewer)
| 24.5 | 66 | 0.785714 | 25 | 196 | 5.96 | 0.64 | 0.161074 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158163 | 196 | 7 | 67 | 28 | 0.90303 | 0.045918 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.6 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
63bc3063d6e020ab6b09156a20dc8491d43b5641 | 125 | py | Python | office365/sharepoint/fields/field_choice.py | rikeshtailor/Office365-REST-Python-Client | ca7bfa1b22212137bb4e984c0457632163e89a43 | [
"MIT"
] | 544 | 2016-08-04T17:10:16.000Z | 2022-03-31T07:17:20.000Z | office365/sharepoint/fields/field_choice.py | rikeshtailor/Office365-REST-Python-Client | ca7bfa1b22212137bb4e984c0457632163e89a43 | [
"MIT"
] | 438 | 2016-10-11T12:24:22.000Z | 2022-03-31T19:30:35.000Z | office365/sharepoint/fields/field_choice.py | rikeshtailor/Office365-REST-Python-Client | ca7bfa1b22212137bb4e984c0457632163e89a43 | [
"MIT"
] | 202 | 2016-08-22T19:29:40.000Z | 2022-03-30T20:26:15.000Z | from office365.sharepoint.fields.field import Field
class FieldChoice(Field):
"""Represents a choice field control."""
| 20.833333 | 51 | 0.76 | 15 | 125 | 6.333333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027778 | 0.136 | 125 | 5 | 52 | 25 | 0.851852 | 0.272 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
89627eb77769348c33eb4a104e9589cbc7f63b54 | 159,556 | py | Python | rknn/rknn_api/examples/rknn_ssd_demo/model/rockrobo_box_priors.py | ronjian/rknpu | f6dd30f8d4d33b85905349cf980ddceaacb3d3cf | [
"BSD-3-Clause"
] | null | null | null | rknn/rknn_api/examples/rknn_ssd_demo/model/rockrobo_box_priors.py | ronjian/rknpu | f6dd30f8d4d33b85905349cf980ddceaacb3d3cf | [
"BSD-3-Clause"
] | null | null | null | rknn/rknn_api/examples/rknn_ssd_demo/model/rockrobo_box_priors.py | ronjian/rknpu | f6dd30f8d4d33b85905349cf980ddceaacb3d3cf | [
"BSD-3-Clause"
] | null | null | null | #%%
anchors = (
( 0.02631578966975212, 0.02631578966975212, 0.10000000149011612, 0.10000000149011612 ),
( 0.02631578966975212, 0.02631579339504242, 0.1414213627576828, 0.2828427255153656 ),
( 0.02631579339504242, 0.02631578966975212, 0.2828427255153656, 0.1414213627576828 ),
( 0.02631578966975212, 0.07894736528396606, 0.10000000149011612, 0.09999999403953552 ),
( 0.02631578966975212, 0.07894736528396606, 0.1414213627576828, 0.2828427255153656 ),
( 0.02631579339504242, 0.07894737273454666, 0.2828427255153656, 0.141421377658844 ),
( 0.02631578966975212, 0.1315789520740509, 0.10000000149011612, 0.09999999403953552 ),
( 0.02631578966975212, 0.1315789371728897, 0.1414213627576828, 0.2828426957130432 ),
( 0.02631579339504242, 0.1315789520740509, 0.2828427255153656, 0.141421377658844 ),
( 0.02631578966975212, 0.18421052396297455, 0.10000000149011612, 0.09999999403953552 ),
( 0.02631578966975212, 0.18421052396297455, 0.1414213627576828, 0.2828427255153656 ),
( 0.02631579339504242, 0.18421050906181335, 0.2828427255153656, 0.1414213478565216 ),
( 0.02631578966975212, 0.2368421107530594, 0.10000000149011612, 0.09999999403953552 ),
( 0.02631578966975212, 0.2368421107530594, 0.1414213627576828, 0.2828427255153656 ),
( 0.02631579339504242, 0.2368421107530594, 0.2828427255153656, 0.1414213478565216 ),
( 0.02631578966975212, 0.28947368264198303, 0.10000000149011612, 0.10000000894069672 ),
( 0.02631578966975212, 0.28947365283966064, 0.1414213627576828, 0.2828426957130432 ),
( 0.02631579339504242, 0.28947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.02631578966975212, 0.3421052396297455, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.3421052098274231, 0.1414213627576828, 0.2828426957130432 ),
( 0.02631579339504242, 0.3421052396297455, 0.2828427255153656, 0.141421377658844 ),
( 0.02631578966975212, 0.3947368264198303, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.3947368264198303, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.3947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.02631578966975212, 0.44736841320991516, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.44736841320991516, 0.1414213627576828, 0.2828426957130432 ),
( 0.02631579339504242, 0.44736841320991516, 0.2828427255153656, 0.141421377658844 ),
( 0.02631578966975212, 0.5, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.5, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.5, 0.2828427255153656, 0.1414213478565216 ),
( 0.02631578966975212, 0.5526316165924072, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.5526316165924072, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.5526316165924072, 0.2828427255153656, 0.1414213478565216 ),
( 0.02631578966975212, 0.6052631735801697, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.6052631735801697, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.6052631735801697, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.6578947305679321, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.6578947305679321, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.6578947305679321, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.7105263471603394, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.7105263471603394, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.7105263471603394, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.7631579041481018, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.7631579041481018, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.7631579041481018, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.815789520740509, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.815789520740509, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.815789520740509, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.8684210777282715, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.8684210777282715, 0.1414213627576828, 0.2828426957130432 ),
( 0.02631579339504242, 0.8684210777282715, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.9210526347160339, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.9210526347160339, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.9210526347160339, 0.2828427255153656, 0.14142131805419922 ),
( 0.02631578966975212, 0.9736842513084412, 0.10000000149011612, 0.10000002384185791 ),
( 0.02631578966975212, 0.9736842513084412, 0.1414213627576828, 0.282842755317688 ),
( 0.02631579339504242, 0.9736843109130859, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.02631578966975212, 0.09999999403953552, 0.10000000149011612 ),
( 0.07894737273454666, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.07894736528396606, 0.02631578966975212, 0.2828427255153656, 0.1414213627576828 ),
( 0.07894736528396606, 0.07894736528396606, 0.09999999403953552, 0.09999999403953552 ),
( 0.07894737273454666, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.07894736528396606, 0.07894737273454666, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.1315789520740509, 0.09999999403953552, 0.09999999403953552 ),
( 0.07894737273454666, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.07894736528396606, 0.1315789520740509, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.18421052396297455, 0.09999999403953552, 0.09999999403953552 ),
( 0.07894737273454666, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.07894736528396606, 0.18421050906181335, 0.2828427255153656, 0.1414213478565216 ),
( 0.07894736528396606, 0.2368421107530594, 0.09999999403953552, 0.09999999403953552 ),
( 0.07894737273454666, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.07894736528396606, 0.2368421107530594, 0.2828427255153656, 0.1414213478565216 ),
( 0.07894736528396606, 0.28947368264198303, 0.09999999403953552, 0.10000000894069672 ),
( 0.07894737273454666, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.07894736528396606, 0.28947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.3421052396297455, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.07894736528396606, 0.3421052396297455, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.3947368264198303, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.3947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.44736841320991516, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.07894736528396606, 0.44736841320991516, 0.2828427255153656, 0.141421377658844 ),
( 0.07894736528396606, 0.5, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.5, 0.2828427255153656, 0.1414213478565216 ),
( 0.07894736528396606, 0.5526316165924072, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.5526316165924072, 0.2828427255153656, 0.1414213478565216 ),
( 0.07894736528396606, 0.6052631735801697, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.6052631735801697, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.6578947305679321, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.6578947305679321, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.7105263471603394, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.7105263471603394, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.7631579041481018, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.7631579041481018, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.815789520740509, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.815789520740509, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.8684210777282715, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.07894736528396606, 0.8684210777282715, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.9210526347160339, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.9210526347160339, 0.2828427255153656, 0.14142131805419922 ),
( 0.07894736528396606, 0.9736842513084412, 0.09999999403953552, 0.10000002384185791 ),
( 0.07894737273454666, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.07894736528396606, 0.9736843109130859, 0.2828427255153656, 0.141421377658844 ),
( 0.1315789520740509, 0.02631578966975212, 0.09999999403953552, 0.10000000149011612 ),
( 0.1315789520740509, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.1315789371728897, 0.02631578966975212, 0.2828426957130432, 0.1414213627576828 ),
( 0.1315789520740509, 0.07894736528396606, 0.09999999403953552, 0.09999999403953552 ),
( 0.1315789520740509, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.1315789371728897, 0.07894737273454666, 0.2828426957130432, 0.141421377658844 ),
( 0.1315789520740509, 0.1315789520740509, 0.09999999403953552, 0.09999999403953552 ),
( 0.1315789520740509, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.1315789371728897, 0.1315789520740509, 0.2828426957130432, 0.141421377658844 ),
( 0.1315789520740509, 0.18421052396297455, 0.09999999403953552, 0.09999999403953552 ),
( 0.1315789520740509, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.1315789371728897, 0.18421050906181335, 0.2828426957130432, 0.1414213478565216 ),
( 0.1315789520740509, 0.2368421107530594, 0.09999999403953552, 0.09999999403953552 ),
( 0.1315789520740509, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.1315789371728897, 0.2368421107530594, 0.2828426957130432, 0.1414213478565216 ),
( 0.1315789520740509, 0.28947368264198303, 0.09999999403953552, 0.10000000894069672 ),
( 0.1315789520740509, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.1315789371728897, 0.28947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.1315789520740509, 0.3421052396297455, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.1315789371728897, 0.3421052396297455, 0.2828426957130432, 0.141421377658844 ),
( 0.1315789520740509, 0.3947368264198303, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.3947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.1315789520740509, 0.44736841320991516, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.1315789371728897, 0.44736841320991516, 0.2828426957130432, 0.141421377658844 ),
( 0.1315789520740509, 0.5, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.5, 0.2828426957130432, 0.1414213478565216 ),
( 0.1315789520740509, 0.5526316165924072, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.5526316165924072, 0.2828426957130432, 0.1414213478565216 ),
( 0.1315789520740509, 0.6052631735801697, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.6052631735801697, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.6578947305679321, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.6578947305679321, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.7105263471603394, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.7105263471603394, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.7631579041481018, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.7631579041481018, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.815789520740509, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.815789520740509, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.8684210777282715, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.1315789371728897, 0.8684210777282715, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.9210526347160339, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.9210526347160339, 0.2828426957130432, 0.14142131805419922 ),
( 0.1315789520740509, 0.9736842513084412, 0.09999999403953552, 0.10000002384185791 ),
( 0.1315789520740509, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.1315789371728897, 0.9736843109130859, 0.2828426957130432, 0.141421377658844 ),
( 0.18421052396297455, 0.02631578966975212, 0.09999999403953552, 0.10000000149011612 ),
( 0.18421050906181335, 0.02631579339504242, 0.1414213478565216, 0.2828427255153656 ),
( 0.18421052396297455, 0.02631578966975212, 0.2828427255153656, 0.1414213627576828 ),
( 0.18421052396297455, 0.07894736528396606, 0.09999999403953552, 0.09999999403953552 ),
( 0.18421050906181335, 0.07894736528396606, 0.1414213478565216, 0.2828427255153656 ),
( 0.18421052396297455, 0.07894737273454666, 0.2828427255153656, 0.141421377658844 ),
( 0.18421052396297455, 0.1315789520740509, 0.09999999403953552, 0.09999999403953552 ),
( 0.18421050906181335, 0.1315789371728897, 0.1414213478565216, 0.2828426957130432 ),
( 0.18421052396297455, 0.1315789520740509, 0.2828427255153656, 0.141421377658844 ),
( 0.18421052396297455, 0.18421052396297455, 0.09999999403953552, 0.09999999403953552 ),
( 0.18421050906181335, 0.18421052396297455, 0.1414213478565216, 0.2828427255153656 ),
( 0.18421052396297455, 0.18421050906181335, 0.2828427255153656, 0.1414213478565216 ),
( 0.18421052396297455, 0.2368421107530594, 0.09999999403953552, 0.09999999403953552 ),
( 0.18421050906181335, 0.2368421107530594, 0.1414213478565216, 0.2828427255153656 ),
( 0.18421052396297455, 0.2368421107530594, 0.2828427255153656, 0.1414213478565216 ),
( 0.18421052396297455, 0.28947368264198303, 0.09999999403953552, 0.10000000894069672 ),
( 0.18421050906181335, 0.28947365283966064, 0.1414213478565216, 0.2828426957130432 ),
( 0.18421052396297455, 0.28947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.18421052396297455, 0.3421052396297455, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.3421052098274231, 0.1414213478565216, 0.2828426957130432 ),
( 0.18421052396297455, 0.3421052396297455, 0.2828427255153656, 0.141421377658844 ),
( 0.18421052396297455, 0.3947368264198303, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.3947368264198303, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.3947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.18421052396297455, 0.44736841320991516, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.44736841320991516, 0.1414213478565216, 0.2828426957130432 ),
( 0.18421052396297455, 0.44736841320991516, 0.2828427255153656, 0.141421377658844 ),
( 0.18421052396297455, 0.5, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.5, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.5, 0.2828427255153656, 0.1414213478565216 ),
( 0.18421052396297455, 0.5526316165924072, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.5526316165924072, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.5526316165924072, 0.2828427255153656, 0.1414213478565216 ),
( 0.18421052396297455, 0.6052631735801697, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.6052631735801697, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.6052631735801697, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.6578947305679321, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.6578947305679321, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.6578947305679321, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.7105263471603394, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.7105263471603394, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.7105263471603394, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.7631579041481018, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.7631579041481018, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.7631579041481018, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.815789520740509, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.815789520740509, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.815789520740509, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.8684210777282715, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.8684210777282715, 0.1414213478565216, 0.2828426957130432 ),
( 0.18421052396297455, 0.8684210777282715, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.9210526347160339, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.9210526347160339, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.9210526347160339, 0.2828427255153656, 0.14142131805419922 ),
( 0.18421052396297455, 0.9736842513084412, 0.09999999403953552, 0.10000002384185791 ),
( 0.18421050906181335, 0.9736842513084412, 0.1414213478565216, 0.282842755317688 ),
( 0.18421052396297455, 0.9736843109130859, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.02631578966975212, 0.09999999403953552, 0.10000000149011612 ),
( 0.2368421107530594, 0.02631579339504242, 0.1414213478565216, 0.2828427255153656 ),
( 0.2368421107530594, 0.02631578966975212, 0.2828427255153656, 0.1414213627576828 ),
( 0.2368421107530594, 0.07894736528396606, 0.09999999403953552, 0.09999999403953552 ),
( 0.2368421107530594, 0.07894736528396606, 0.1414213478565216, 0.2828427255153656 ),
( 0.2368421107530594, 0.07894737273454666, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.1315789520740509, 0.09999999403953552, 0.09999999403953552 ),
( 0.2368421107530594, 0.1315789371728897, 0.1414213478565216, 0.2828426957130432 ),
( 0.2368421107530594, 0.1315789520740509, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.18421052396297455, 0.09999999403953552, 0.09999999403953552 ),
( 0.2368421107530594, 0.18421052396297455, 0.1414213478565216, 0.2828427255153656 ),
( 0.2368421107530594, 0.18421050906181335, 0.2828427255153656, 0.1414213478565216 ),
( 0.2368421107530594, 0.2368421107530594, 0.09999999403953552, 0.09999999403953552 ),
( 0.2368421107530594, 0.2368421107530594, 0.1414213478565216, 0.2828427255153656 ),
( 0.2368421107530594, 0.2368421107530594, 0.2828427255153656, 0.1414213478565216 ),
( 0.2368421107530594, 0.28947368264198303, 0.09999999403953552, 0.10000000894069672 ),
( 0.2368421107530594, 0.28947365283966064, 0.1414213478565216, 0.2828426957130432 ),
( 0.2368421107530594, 0.28947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.3421052396297455, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.3421052098274231, 0.1414213478565216, 0.2828426957130432 ),
( 0.2368421107530594, 0.3421052396297455, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.3947368264198303, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.3947368264198303, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.3947368264198303, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.44736841320991516, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.44736841320991516, 0.1414213478565216, 0.2828426957130432 ),
( 0.2368421107530594, 0.44736841320991516, 0.2828427255153656, 0.141421377658844 ),
( 0.2368421107530594, 0.5, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.5, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.5, 0.2828427255153656, 0.1414213478565216 ),
( 0.2368421107530594, 0.5526316165924072, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.5526316165924072, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.5526316165924072, 0.2828427255153656, 0.1414213478565216 ),
( 0.2368421107530594, 0.6052631735801697, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.6052631735801697, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.6052631735801697, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.6578947305679321, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.6578947305679321, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.6578947305679321, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.7105263471603394, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.7105263471603394, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.7105263471603394, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.7631579041481018, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.7631579041481018, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.7631579041481018, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.815789520740509, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.815789520740509, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.815789520740509, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.8684210777282715, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.8684210777282715, 0.1414213478565216, 0.2828426957130432 ),
( 0.2368421107530594, 0.8684210777282715, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.9210526347160339, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.9210526347160339, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.9210526347160339, 0.2828427255153656, 0.14142131805419922 ),
( 0.2368421107530594, 0.9736842513084412, 0.09999999403953552, 0.10000002384185791 ),
( 0.2368421107530594, 0.9736842513084412, 0.1414213478565216, 0.282842755317688 ),
( 0.2368421107530594, 0.9736843109130859, 0.2828427255153656, 0.141421377658844 ),
( 0.28947368264198303, 0.02631578966975212, 0.10000000894069672, 0.10000000149011612 ),
( 0.28947368264198303, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.28947365283966064, 0.02631578966975212, 0.2828426957130432, 0.1414213627576828 ),
( 0.28947368264198303, 0.07894736528396606, 0.10000000894069672, 0.09999999403953552 ),
( 0.28947368264198303, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.28947365283966064, 0.07894737273454666, 0.2828426957130432, 0.141421377658844 ),
( 0.28947368264198303, 0.1315789520740509, 0.10000000894069672, 0.09999999403953552 ),
( 0.28947368264198303, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.28947365283966064, 0.1315789520740509, 0.2828426957130432, 0.141421377658844 ),
( 0.28947368264198303, 0.18421052396297455, 0.10000000894069672, 0.09999999403953552 ),
( 0.28947368264198303, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.28947365283966064, 0.18421050906181335, 0.2828426957130432, 0.1414213478565216 ),
( 0.28947368264198303, 0.2368421107530594, 0.10000000894069672, 0.09999999403953552 ),
( 0.28947368264198303, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.28947365283966064, 0.2368421107530594, 0.2828426957130432, 0.1414213478565216 ),
( 0.28947368264198303, 0.28947368264198303, 0.10000000894069672, 0.10000000894069672 ),
( 0.28947368264198303, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.28947365283966064, 0.28947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.28947368264198303, 0.3421052396297455, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.28947365283966064, 0.3421052396297455, 0.2828426957130432, 0.141421377658844 ),
( 0.28947368264198303, 0.3947368264198303, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.3947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.28947368264198303, 0.44736841320991516, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.28947365283966064, 0.44736841320991516, 0.2828426957130432, 0.141421377658844 ),
( 0.28947368264198303, 0.5, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.5, 0.2828426957130432, 0.1414213478565216 ),
( 0.28947368264198303, 0.5526316165924072, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.5526316165924072, 0.2828426957130432, 0.1414213478565216 ),
( 0.28947368264198303, 0.6052631735801697, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.6052631735801697, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.6578947305679321, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.6578947305679321, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.7105263471603394, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.7105263471603394, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.7631579041481018, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.7631579041481018, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.815789520740509, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.815789520740509, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.8684210777282715, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.28947365283966064, 0.8684210777282715, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.9210526347160339, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.9210526347160339, 0.2828426957130432, 0.14142131805419922 ),
( 0.28947368264198303, 0.9736842513084412, 0.10000000894069672, 0.10000002384185791 ),
( 0.28947368264198303, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.28947365283966064, 0.9736843109130859, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.3421052396297455, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.3421052098274231, 0.02631578966975212, 0.2828426957130432, 0.1414213627576828 ),
( 0.3421052396297455, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.3421052396297455, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.3421052098274231, 0.07894737273454666, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.3421052396297455, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.3421052098274231, 0.1315789520740509, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.3421052396297455, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.3421052098274231, 0.18421050906181335, 0.2828426957130432, 0.1414213478565216 ),
( 0.3421052396297455, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.3421052396297455, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.3421052098274231, 0.2368421107530594, 0.2828426957130432, 0.1414213478565216 ),
( 0.3421052396297455, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.3421052396297455, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.3421052098274231, 0.28947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.3421052098274231, 0.3421052396297455, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.3947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.3421052098274231, 0.44736841320991516, 0.2828426957130432, 0.141421377658844 ),
( 0.3421052396297455, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.5, 0.2828426957130432, 0.1414213478565216 ),
( 0.3421052396297455, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.5526316165924072, 0.2828426957130432, 0.1414213478565216 ),
( 0.3421052396297455, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.6052631735801697, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.6578947305679321, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.7105263471603394, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.7631579041481018, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.815789520740509, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.3421052098274231, 0.8684210777282715, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.9210526347160339, 0.2828426957130432, 0.14142131805419922 ),
( 0.3421052396297455, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.3421052396297455, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.3421052098274231, 0.9736843109130859, 0.2828426957130432, 0.141421377658844 ),
( 0.3947368264198303, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.3947368264198303, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.3947368264198303, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.3947368264198303, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.3947368264198303, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.3947368264198303, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.3947368264198303, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.3947368264198303, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.3947368264198303, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.3947368264198303, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.3947368264198303, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.3947368264198303, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.3947368264198303, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.3947368264198303, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.3947368264198303, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.3947368264198303, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.3947368264198303, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.3947368264198303, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.3947368264198303, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.3947368264198303, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.3947368264198303, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.3947368264198303, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.3947368264198303, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.3947368264198303, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.3947368264198303, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.3947368264198303, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.3947368264198303, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.3947368264198303, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.3947368264198303, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.3947368264198303, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.44736841320991516, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.44736841320991516, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.44736841320991516, 0.02631578966975212, 0.2828426957130432, 0.1414213627576828 ),
( 0.44736841320991516, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.44736841320991516, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.44736841320991516, 0.07894737273454666, 0.2828426957130432, 0.141421377658844 ),
( 0.44736841320991516, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.44736841320991516, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.44736841320991516, 0.1315789520740509, 0.2828426957130432, 0.141421377658844 ),
( 0.44736841320991516, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.44736841320991516, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.44736841320991516, 0.18421050906181335, 0.2828426957130432, 0.1414213478565216 ),
( 0.44736841320991516, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.44736841320991516, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.44736841320991516, 0.2368421107530594, 0.2828426957130432, 0.1414213478565216 ),
( 0.44736841320991516, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.44736841320991516, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.44736841320991516, 0.28947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.44736841320991516, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.44736841320991516, 0.3421052396297455, 0.2828426957130432, 0.141421377658844 ),
( 0.44736841320991516, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.3947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.44736841320991516, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.44736841320991516, 0.44736841320991516, 0.2828426957130432, 0.141421377658844 ),
( 0.44736841320991516, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.5, 0.2828426957130432, 0.1414213478565216 ),
( 0.44736841320991516, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.5526316165924072, 0.2828426957130432, 0.1414213478565216 ),
( 0.44736841320991516, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.6052631735801697, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.6578947305679321, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.7105263471603394, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.7631579041481018, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.815789520740509, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.44736841320991516, 0.8684210777282715, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.9210526347160339, 0.2828426957130432, 0.14142131805419922 ),
( 0.44736841320991516, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.44736841320991516, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.44736841320991516, 0.9736843109130859, 0.2828426957130432, 0.141421377658844 ),
( 0.5, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.5, 0.02631579339504242, 0.1414213478565216, 0.2828427255153656 ),
( 0.5, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.5, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.5, 0.07894736528396606, 0.1414213478565216, 0.2828427255153656 ),
( 0.5, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.5, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.5, 0.1315789371728897, 0.1414213478565216, 0.2828426957130432 ),
( 0.5, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.5, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.5, 0.18421052396297455, 0.1414213478565216, 0.2828427255153656 ),
( 0.5, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.5, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.5, 0.2368421107530594, 0.1414213478565216, 0.2828427255153656 ),
( 0.5, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.5, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.5, 0.28947365283966064, 0.1414213478565216, 0.2828426957130432 ),
( 0.5, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.5, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.3421052098274231, 0.1414213478565216, 0.2828426957130432 ),
( 0.5, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.5, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.3947368264198303, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.5, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.44736841320991516, 0.1414213478565216, 0.2828426957130432 ),
( 0.5, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.5, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.5, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.5, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.5526316165924072, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.5, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.6052631735801697, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.6578947305679321, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.7105263471603394, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.7631579041481018, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.815789520740509, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.8684210777282715, 0.1414213478565216, 0.2828426957130432 ),
( 0.5, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.9210526347160339, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.5, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.5, 0.9736842513084412, 0.1414213478565216, 0.282842755317688 ),
( 0.5, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.5526316165924072, 0.02631579339504242, 0.1414213478565216, 0.2828427255153656 ),
( 0.5526316165924072, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.5526316165924072, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.5526316165924072, 0.07894736528396606, 0.1414213478565216, 0.2828427255153656 ),
( 0.5526316165924072, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.5526316165924072, 0.1315789371728897, 0.1414213478565216, 0.2828426957130432 ),
( 0.5526316165924072, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.5526316165924072, 0.18421052396297455, 0.1414213478565216, 0.2828427255153656 ),
( 0.5526316165924072, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.5526316165924072, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.5526316165924072, 0.2368421107530594, 0.1414213478565216, 0.2828427255153656 ),
( 0.5526316165924072, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.5526316165924072, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.5526316165924072, 0.28947365283966064, 0.1414213478565216, 0.2828426957130432 ),
( 0.5526316165924072, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.3421052098274231, 0.1414213478565216, 0.2828426957130432 ),
( 0.5526316165924072, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.3947368264198303, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.44736841320991516, 0.1414213478565216, 0.2828426957130432 ),
( 0.5526316165924072, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.5526316165924072, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.5, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.5526316165924072, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.5526316165924072, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.5526316165924072, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.6052631735801697, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.6578947305679321, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.7105263471603394, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.7631579041481018, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.815789520740509, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.8684210777282715, 0.1414213478565216, 0.2828426957130432 ),
( 0.5526316165924072, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.9210526347160339, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.5526316165924072, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.5526316165924072, 0.9736842513084412, 0.1414213478565216, 0.282842755317688 ),
( 0.5526316165924072, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.6052631735801697, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.6052631735801697, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.6052631735801697, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.6052631735801697, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.6052631735801697, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.6052631735801697, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.6052631735801697, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.6052631735801697, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.6052631735801697, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.6052631735801697, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.6052631735801697, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.6052631735801697, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.6052631735801697, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.6052631735801697, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.6052631735801697, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.6052631735801697, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.6052631735801697, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.6052631735801697, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.6052631735801697, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.6052631735801697, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.6052631735801697, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.6052631735801697, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.6052631735801697, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.6052631735801697, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.6578947305679321, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.6578947305679321, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.6578947305679321, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.6578947305679321, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.6578947305679321, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.6578947305679321, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.6578947305679321, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.6578947305679321, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.6578947305679321, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.6578947305679321, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.6578947305679321, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.6578947305679321, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.6578947305679321, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.6578947305679321, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.6578947305679321, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.6578947305679321, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.6578947305679321, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.6578947305679321, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.6578947305679321, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.6578947305679321, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.6578947305679321, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.6578947305679321, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.6578947305679321, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.6578947305679321, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.7105263471603394, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.7105263471603394, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.7105263471603394, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.7105263471603394, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.7105263471603394, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.7105263471603394, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.7105263471603394, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.7105263471603394, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.7105263471603394, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.7105263471603394, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.7105263471603394, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.7105263471603394, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.7105263471603394, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.7105263471603394, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.7105263471603394, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.7105263471603394, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.7105263471603394, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.7105263471603394, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.7105263471603394, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.7105263471603394, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.7105263471603394, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.7105263471603394, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.7105263471603394, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.7105263471603394, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.7631579041481018, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.7631579041481018, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.7631579041481018, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.7631579041481018, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.7631579041481018, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.7631579041481018, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.7631579041481018, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.7631579041481018, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.7631579041481018, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.7631579041481018, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.7631579041481018, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.7631579041481018, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.7631579041481018, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.7631579041481018, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.7631579041481018, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.7631579041481018, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.7631579041481018, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.7631579041481018, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.7631579041481018, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.7631579041481018, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.7631579041481018, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.7631579041481018, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.7631579041481018, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.7631579041481018, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.815789520740509, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.815789520740509, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.815789520740509, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.815789520740509, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.815789520740509, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.815789520740509, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.815789520740509, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.815789520740509, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.815789520740509, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.815789520740509, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.815789520740509, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.815789520740509, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.815789520740509, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.815789520740509, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.815789520740509, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.815789520740509, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.815789520740509, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.815789520740509, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.815789520740509, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.815789520740509, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.815789520740509, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.815789520740509, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.815789520740509, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.815789520740509, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.8684210777282715, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.8684210777282715, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.8684210777282715, 0.02631578966975212, 0.2828426957130432, 0.1414213627576828 ),
( 0.8684210777282715, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.8684210777282715, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.8684210777282715, 0.07894737273454666, 0.2828426957130432, 0.141421377658844 ),
( 0.8684210777282715, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.8684210777282715, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.8684210777282715, 0.1315789520740509, 0.2828426957130432, 0.141421377658844 ),
( 0.8684210777282715, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.8684210777282715, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.8684210777282715, 0.18421050906181335, 0.2828426957130432, 0.1414213478565216 ),
( 0.8684210777282715, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.8684210777282715, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.8684210777282715, 0.2368421107530594, 0.2828426957130432, 0.1414213478565216 ),
( 0.8684210777282715, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.8684210777282715, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.8684210777282715, 0.28947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.8684210777282715, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.8684210777282715, 0.3421052396297455, 0.2828426957130432, 0.141421377658844 ),
( 0.8684210777282715, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.3947368264198303, 0.2828426957130432, 0.141421377658844 ),
( 0.8684210777282715, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.8684210777282715, 0.44736841320991516, 0.2828426957130432, 0.141421377658844 ),
( 0.8684210777282715, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.5, 0.2828426957130432, 0.1414213478565216 ),
( 0.8684210777282715, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.5526316165924072, 0.2828426957130432, 0.1414213478565216 ),
( 0.8684210777282715, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.6052631735801697, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.6578947305679321, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.7105263471603394, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.7631579041481018, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.815789520740509, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.8684210777282715, 0.8684210777282715, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.9210526347160339, 0.2828426957130432, 0.14142131805419922 ),
( 0.8684210777282715, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.8684210777282715, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.8684210777282715, 0.9736843109130859, 0.2828426957130432, 0.141421377658844 ),
( 0.9210526347160339, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.9210526347160339, 0.02631579339504242, 0.14142131805419922, 0.2828427255153656 ),
( 0.9210526347160339, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.9210526347160339, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.9210526347160339, 0.07894736528396606, 0.14142131805419922, 0.2828427255153656 ),
( 0.9210526347160339, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.9210526347160339, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.9210526347160339, 0.1315789371728897, 0.14142131805419922, 0.2828426957130432 ),
( 0.9210526347160339, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.9210526347160339, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.9210526347160339, 0.18421052396297455, 0.14142131805419922, 0.2828427255153656 ),
( 0.9210526347160339, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.9210526347160339, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.9210526347160339, 0.2368421107530594, 0.14142131805419922, 0.2828427255153656 ),
( 0.9210526347160339, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.9210526347160339, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.9210526347160339, 0.28947365283966064, 0.14142131805419922, 0.2828426957130432 ),
( 0.9210526347160339, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.9210526347160339, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.3421052098274231, 0.14142131805419922, 0.2828426957130432 ),
( 0.9210526347160339, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.9210526347160339, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.3947368264198303, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.9210526347160339, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.44736841320991516, 0.14142131805419922, 0.2828426957130432 ),
( 0.9210526347160339, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.9210526347160339, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.5, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.9210526347160339, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.5526316165924072, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.9210526347160339, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.6052631735801697, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.6578947305679321, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.7105263471603394, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.7631579041481018, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.815789520740509, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.8684210777282715, 0.14142131805419922, 0.2828426957130432 ),
( 0.9210526347160339, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.9210526347160339, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.9210526347160339, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.9210526347160339, 0.9736842513084412, 0.14142131805419922, 0.282842755317688 ),
( 0.9210526347160339, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.02631578966975212, 0.10000002384185791, 0.10000000149011612 ),
( 0.9736843109130859, 0.02631579339504242, 0.141421377658844, 0.2828427255153656 ),
( 0.9736842513084412, 0.02631578966975212, 0.282842755317688, 0.1414213627576828 ),
( 0.9736842513084412, 0.07894736528396606, 0.10000002384185791, 0.09999999403953552 ),
( 0.9736843109130859, 0.07894736528396606, 0.141421377658844, 0.2828427255153656 ),
( 0.9736842513084412, 0.07894737273454666, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.1315789520740509, 0.10000002384185791, 0.09999999403953552 ),
( 0.9736843109130859, 0.1315789371728897, 0.141421377658844, 0.2828426957130432 ),
( 0.9736842513084412, 0.1315789520740509, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.18421052396297455, 0.10000002384185791, 0.09999999403953552 ),
( 0.9736843109130859, 0.18421052396297455, 0.141421377658844, 0.2828427255153656 ),
( 0.9736842513084412, 0.18421050906181335, 0.282842755317688, 0.1414213478565216 ),
( 0.9736842513084412, 0.2368421107530594, 0.10000002384185791, 0.09999999403953552 ),
( 0.9736843109130859, 0.2368421107530594, 0.141421377658844, 0.2828427255153656 ),
( 0.9736842513084412, 0.2368421107530594, 0.282842755317688, 0.1414213478565216 ),
( 0.9736842513084412, 0.28947368264198303, 0.10000002384185791, 0.10000000894069672 ),
( 0.9736843109130859, 0.28947365283966064, 0.141421377658844, 0.2828426957130432 ),
( 0.9736842513084412, 0.28947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.3421052396297455, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.3421052098274231, 0.141421377658844, 0.2828426957130432 ),
( 0.9736842513084412, 0.3421052396297455, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.3947368264198303, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.3947368264198303, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.3947368264198303, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.44736841320991516, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.44736841320991516, 0.141421377658844, 0.2828426957130432 ),
( 0.9736842513084412, 0.44736841320991516, 0.282842755317688, 0.141421377658844 ),
( 0.9736842513084412, 0.5, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.5, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.5, 0.282842755317688, 0.1414213478565216 ),
( 0.9736842513084412, 0.5526316165924072, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.5526316165924072, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.5526316165924072, 0.282842755317688, 0.1414213478565216 ),
( 0.9736842513084412, 0.6052631735801697, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.6052631735801697, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.6052631735801697, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.6578947305679321, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.6578947305679321, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.6578947305679321, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.7105263471603394, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.7105263471603394, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.7105263471603394, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.7631579041481018, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.7631579041481018, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.7631579041481018, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.815789520740509, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.815789520740509, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.815789520740509, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.8684210777282715, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.8684210777282715, 0.141421377658844, 0.2828426957130432 ),
( 0.9736842513084412, 0.8684210777282715, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.9210526347160339, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.9210526347160339, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.9210526347160339, 0.282842755317688, 0.14142131805419922 ),
( 0.9736842513084412, 0.9736842513084412, 0.10000002384185791, 0.10000002384185791 ),
( 0.9736843109130859, 0.9736842513084412, 0.141421377658844, 0.282842755317688 ),
( 0.9736842513084412, 0.9736843109130859, 0.282842755317688, 0.141421377658844 ),
( 0.04999999701976776, 0.04999999701976776, 0.3499999940395355, 0.3499999940395355 ),
( 0.04999999701976776, 0.04999999701976776, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.05000000074505806, 0.050000011920928955, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.05000000074505806, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.04999999701976776, 0.41833001375198364, 0.41833001375198364 ),
( 0.04999999701976776, 0.14999999105930328, 0.3499999940395355, 0.34999996423721313 ),
( 0.04999999701976776, 0.15000000596046448, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.05000000074505806, 0.15000000596046448, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.15000000596046448, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.15000000596046448, 0.41833001375198364, 0.41833001375198364 ),
( 0.04999999701976776, 0.25, 0.3499999940395355, 0.3500000238418579 ),
( 0.04999999701976776, 0.25, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.05000000074505806, 0.25, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.25, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.25, 0.41833001375198364, 0.41833001375198364 ),
( 0.04999999701976776, 0.3500000238418579, 0.3499999940395355, 0.3500000238418579 ),
( 0.04999999701976776, 0.3500000238418579, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.05000000074505806, 0.3500000238418579, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.3500000238418579, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.3500000238418579, 0.41833001375198364, 0.41832998394966125 ),
( 0.04999999701976776, 0.45000001788139343, 0.3499999940395355, 0.34999996423721313 ),
( 0.04999999701976776, 0.44999998807907104, 0.2474873661994934, 0.49497470259666443 ),
( 0.04999999701976776, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.05000000074505806, 0.45000001788139343, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.44999998807907104, 0.6062480807304382, 0.2020624577999115 ),
( 0.04999999701976776, 0.45000001788139343, 0.41833001375198364, 0.41833001375198364 ),
( 0.04999999701976776, 0.550000011920929, 0.3499999940395355, 0.3500000238418579 ),
( 0.04999999701976776, 0.550000011920929, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.05000000074505806, 0.550000011920929, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.550000011920929, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.550000011920929, 0.41833001375198364, 0.41833004355430603 ),
( 0.04999999701976776, 0.6500000357627869, 0.3499999940395355, 0.3500000238418579 ),
( 0.04999999701976776, 0.6500000357627869, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.05000000074505806, 0.6500000357627869, 0.20207259058952332, 0.6062177419662476 ),
( 0.050000011920928955, 0.6500000357627869, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.6500000357627869, 0.41833001375198364, 0.41833004355430603 ),
( 0.04999999701976776, 0.75, 0.3499999940395355, 0.3500000238418579 ),
( 0.04999999701976776, 0.75, 0.2474873661994934, 0.4949747323989868 ),
( 0.04999999701976776, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.05000000074505806, 0.75, 0.20207259058952332, 0.6062178015708923 ),
( 0.050000011920928955, 0.75, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.75, 0.41833001375198364, 0.41832995414733887 ),
( 0.04999999701976776, 0.8500000238418579, 0.3499999940395355, 0.34999996423721313 ),
( 0.04999999701976776, 0.8500000238418579, 0.2474873661994934, 0.4949747920036316 ),
( 0.04999999701976776, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.05000000074505806, 0.8500000238418579, 0.20207259058952332, 0.6062176823616028 ),
( 0.050000011920928955, 0.8500000238418579, 0.6062480807304382, 0.2020624876022339 ),
( 0.04999999701976776, 0.8500000238418579, 0.41833001375198364, 0.41832995414733887 ),
( 0.04999999701976776, 0.9500000476837158, 0.3499999940395355, 0.34999996423721313 ),
( 0.04999999701976776, 0.9500000476837158, 0.2474873661994934, 0.49497467279434204 ),
( 0.04999999701976776, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.05000000074505806, 0.9500000476837158, 0.20207259058952332, 0.6062178015708923 ),
( 0.050000011920928955, 0.9500000476837158, 0.6062480807304382, 0.20206254720687866 ),
( 0.04999999701976776, 0.9500000476837158, 0.41833001375198364, 0.41832995414733887 ),
( 0.14999999105930328, 0.04999999701976776, 0.34999996423721313, 0.3499999940395355 ),
( 0.15000000596046448, 0.04999999701976776, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.15000000596046448, 0.050000011920928955, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.05000000074505806, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.04999999701976776, 0.41833001375198364, 0.41833001375198364 ),
( 0.14999999105930328, 0.14999999105930328, 0.34999996423721313, 0.34999996423721313 ),
( 0.15000000596046448, 0.15000000596046448, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.15000000596046448, 0.15000000596046448, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.15000000596046448, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.15000000596046448, 0.41833001375198364, 0.41833001375198364 ),
( 0.14999999105930328, 0.25, 0.34999996423721313, 0.3500000238418579 ),
( 0.15000000596046448, 0.25, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.15000000596046448, 0.25, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.25, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.25, 0.41833001375198364, 0.41833001375198364 ),
( 0.14999999105930328, 0.3500000238418579, 0.34999996423721313, 0.3500000238418579 ),
( 0.15000000596046448, 0.3500000238418579, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.15000000596046448, 0.3500000238418579, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.3500000238418579, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.3500000238418579, 0.41833001375198364, 0.41832998394966125 ),
( 0.14999999105930328, 0.45000001788139343, 0.34999996423721313, 0.34999996423721313 ),
( 0.15000000596046448, 0.44999998807907104, 0.2474873661994934, 0.49497470259666443 ),
( 0.15000000596046448, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.15000000596046448, 0.45000001788139343, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.44999998807907104, 0.6062480807304382, 0.2020624577999115 ),
( 0.15000000596046448, 0.45000001788139343, 0.41833001375198364, 0.41833001375198364 ),
( 0.14999999105930328, 0.550000011920929, 0.34999996423721313, 0.3500000238418579 ),
( 0.15000000596046448, 0.550000011920929, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.15000000596046448, 0.550000011920929, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.550000011920929, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.550000011920929, 0.41833001375198364, 0.41833004355430603 ),
( 0.14999999105930328, 0.6500000357627869, 0.34999996423721313, 0.3500000238418579 ),
( 0.15000000596046448, 0.6500000357627869, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.15000000596046448, 0.6500000357627869, 0.20207257568836212, 0.6062177419662476 ),
( 0.15000000596046448, 0.6500000357627869, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.6500000357627869, 0.41833001375198364, 0.41833004355430603 ),
( 0.14999999105930328, 0.75, 0.34999996423721313, 0.3500000238418579 ),
( 0.15000000596046448, 0.75, 0.2474873661994934, 0.4949747323989868 ),
( 0.15000000596046448, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.15000000596046448, 0.75, 0.20207257568836212, 0.6062178015708923 ),
( 0.15000000596046448, 0.75, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.75, 0.41833001375198364, 0.41832995414733887 ),
( 0.14999999105930328, 0.8500000238418579, 0.34999996423721313, 0.34999996423721313 ),
( 0.15000000596046448, 0.8500000238418579, 0.2474873661994934, 0.4949747920036316 ),
( 0.15000000596046448, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.15000000596046448, 0.8500000238418579, 0.20207257568836212, 0.6062176823616028 ),
( 0.15000000596046448, 0.8500000238418579, 0.6062480807304382, 0.2020624876022339 ),
( 0.15000000596046448, 0.8500000238418579, 0.41833001375198364, 0.41832995414733887 ),
( 0.14999999105930328, 0.9500000476837158, 0.34999996423721313, 0.34999996423721313 ),
( 0.15000000596046448, 0.9500000476837158, 0.2474873661994934, 0.49497467279434204 ),
( 0.15000000596046448, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.15000000596046448, 0.9500000476837158, 0.20207257568836212, 0.6062178015708923 ),
( 0.15000000596046448, 0.9500000476837158, 0.6062480807304382, 0.20206254720687866 ),
( 0.15000000596046448, 0.9500000476837158, 0.41833001375198364, 0.41832995414733887 ),
( 0.25, 0.04999999701976776, 0.3500000238418579, 0.3499999940395355 ),
( 0.25, 0.04999999701976776, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.25, 0.050000011920928955, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.05000000074505806, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.04999999701976776, 0.41833001375198364, 0.41833001375198364 ),
( 0.25, 0.14999999105930328, 0.3500000238418579, 0.34999996423721313 ),
( 0.25, 0.15000000596046448, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.25, 0.15000000596046448, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.15000000596046448, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.15000000596046448, 0.41833001375198364, 0.41833001375198364 ),
( 0.25, 0.25, 0.3500000238418579, 0.3500000238418579 ),
( 0.25, 0.25, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.25, 0.25, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.25, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.25, 0.41833001375198364, 0.41833001375198364 ),
( 0.25, 0.3500000238418579, 0.3500000238418579, 0.3500000238418579 ),
( 0.25, 0.3500000238418579, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.25, 0.3500000238418579, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.3500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.3500000238418579, 0.41833001375198364, 0.41832998394966125 ),
( 0.25, 0.45000001788139343, 0.3500000238418579, 0.34999996423721313 ),
( 0.25, 0.44999998807907104, 0.2474873661994934, 0.49497470259666443 ),
( 0.25, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.25, 0.45000001788139343, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.44999998807907104, 0.606248140335083, 0.2020624577999115 ),
( 0.25, 0.45000001788139343, 0.41833001375198364, 0.41833001375198364 ),
( 0.25, 0.550000011920929, 0.3500000238418579, 0.3500000238418579 ),
( 0.25, 0.550000011920929, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.25, 0.550000011920929, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.550000011920929, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.550000011920929, 0.41833001375198364, 0.41833004355430603 ),
( 0.25, 0.6500000357627869, 0.3500000238418579, 0.3500000238418579 ),
( 0.25, 0.6500000357627869, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.25, 0.6500000357627869, 0.2020726054906845, 0.6062177419662476 ),
( 0.2500000298023224, 0.6500000357627869, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.6500000357627869, 0.41833001375198364, 0.41833004355430603 ),
( 0.25, 0.75, 0.3500000238418579, 0.3500000238418579 ),
( 0.25, 0.75, 0.2474873661994934, 0.4949747323989868 ),
( 0.25, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.25, 0.75, 0.2020726054906845, 0.6062178015708923 ),
( 0.2500000298023224, 0.75, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.75, 0.41833001375198364, 0.41832995414733887 ),
( 0.25, 0.8500000238418579, 0.3500000238418579, 0.34999996423721313 ),
( 0.25, 0.8500000238418579, 0.2474873661994934, 0.4949747920036316 ),
( 0.25, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.25, 0.8500000238418579, 0.2020726054906845, 0.6062176823616028 ),
( 0.2500000298023224, 0.8500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.25, 0.8500000238418579, 0.41833001375198364, 0.41832995414733887 ),
( 0.25, 0.9500000476837158, 0.3500000238418579, 0.34999996423721313 ),
( 0.25, 0.9500000476837158, 0.2474873661994934, 0.49497467279434204 ),
( 0.25, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.25, 0.9500000476837158, 0.2020726054906845, 0.6062178015708923 ),
( 0.2500000298023224, 0.9500000476837158, 0.606248140335083, 0.20206254720687866 ),
( 0.25, 0.9500000476837158, 0.41833001375198364, 0.41832995414733887 ),
( 0.3500000238418579, 0.04999999701976776, 0.3500000238418579, 0.3499999940395355 ),
( 0.3500000238418579, 0.04999999701976776, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.3500000238418579, 0.050000011920928955, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.05000000074505806, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.04999999701976776, 0.41832998394966125, 0.41833001375198364 ),
( 0.3500000238418579, 0.14999999105930328, 0.3500000238418579, 0.34999996423721313 ),
( 0.3500000238418579, 0.15000000596046448, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.3500000238418579, 0.15000000596046448, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.15000000596046448, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.15000000596046448, 0.41832998394966125, 0.41833001375198364 ),
( 0.3500000238418579, 0.25, 0.3500000238418579, 0.3500000238418579 ),
( 0.3500000238418579, 0.25, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.3500000238418579, 0.25, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.25, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.25, 0.41832998394966125, 0.41833001375198364 ),
( 0.3500000238418579, 0.3500000238418579, 0.3500000238418579, 0.3500000238418579 ),
( 0.3500000238418579, 0.3500000238418579, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.3500000238418579, 0.3500000238418579, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.3500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.3500000238418579, 0.41832998394966125, 0.41832998394966125 ),
( 0.3500000238418579, 0.45000001788139343, 0.3500000238418579, 0.34999996423721313 ),
( 0.3500000238418579, 0.44999998807907104, 0.2474873661994934, 0.49497470259666443 ),
( 0.3500000238418579, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.3500000238418579, 0.45000001788139343, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.44999998807907104, 0.606248140335083, 0.2020624577999115 ),
( 0.3500000238418579, 0.45000001788139343, 0.41832998394966125, 0.41833001375198364 ),
( 0.3500000238418579, 0.550000011920929, 0.3500000238418579, 0.3500000238418579 ),
( 0.3500000238418579, 0.550000011920929, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.3500000238418579, 0.550000011920929, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.550000011920929, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.550000011920929, 0.41832998394966125, 0.41833004355430603 ),
( 0.3500000238418579, 0.6500000357627869, 0.3500000238418579, 0.3500000238418579 ),
( 0.3500000238418579, 0.6500000357627869, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.3500000238418579, 0.6500000357627869, 0.2020726054906845, 0.6062177419662476 ),
( 0.3500000536441803, 0.6500000357627869, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.6500000357627869, 0.41832998394966125, 0.41833004355430603 ),
( 0.3500000238418579, 0.75, 0.3500000238418579, 0.3500000238418579 ),
( 0.3500000238418579, 0.75, 0.2474873661994934, 0.4949747323989868 ),
( 0.3500000238418579, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.3500000238418579, 0.75, 0.2020726054906845, 0.6062178015708923 ),
( 0.3500000536441803, 0.75, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.75, 0.41832998394966125, 0.41832995414733887 ),
( 0.3500000238418579, 0.8500000238418579, 0.3500000238418579, 0.34999996423721313 ),
( 0.3500000238418579, 0.8500000238418579, 0.2474873661994934, 0.4949747920036316 ),
( 0.3500000238418579, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.3500000238418579, 0.8500000238418579, 0.2020726054906845, 0.6062176823616028 ),
( 0.3500000536441803, 0.8500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.3500000238418579, 0.8500000238418579, 0.41832998394966125, 0.41832995414733887 ),
( 0.3500000238418579, 0.9500000476837158, 0.3500000238418579, 0.34999996423721313 ),
( 0.3500000238418579, 0.9500000476837158, 0.2474873661994934, 0.49497467279434204 ),
( 0.3500000238418579, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.3500000238418579, 0.9500000476837158, 0.2020726054906845, 0.6062178015708923 ),
( 0.3500000536441803, 0.9500000476837158, 0.606248140335083, 0.20206254720687866 ),
( 0.3500000238418579, 0.9500000476837158, 0.41832998394966125, 0.41832995414733887 ),
( 0.45000001788139343, 0.04999999701976776, 0.34999996423721313, 0.3499999940395355 ),
( 0.45000001788139343, 0.04999999701976776, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.04999999701976776, 0.49497470259666443, 0.2474873661994934 ),
( 0.45000001788139343, 0.050000011920928955, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.05000000074505806, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.04999999701976776, 0.41833001375198364, 0.41833001375198364 ),
( 0.45000001788139343, 0.14999999105930328, 0.34999996423721313, 0.34999996423721313 ),
( 0.45000001788139343, 0.15000000596046448, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.15000000596046448, 0.49497470259666443, 0.2474873661994934 ),
( 0.45000001788139343, 0.15000000596046448, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.15000000596046448, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.15000000596046448, 0.41833001375198364, 0.41833001375198364 ),
( 0.45000001788139343, 0.25, 0.34999996423721313, 0.3500000238418579 ),
( 0.45000001788139343, 0.25, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.25, 0.49497470259666443, 0.2474873661994934 ),
( 0.45000001788139343, 0.25, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.25, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.25, 0.41833001375198364, 0.41833001375198364 ),
( 0.45000001788139343, 0.3500000238418579, 0.34999996423721313, 0.3500000238418579 ),
( 0.45000001788139343, 0.3500000238418579, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.3500000238418579, 0.49497470259666443, 0.2474873661994934 ),
( 0.45000001788139343, 0.3500000238418579, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.3500000238418579, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.3500000238418579, 0.41833001375198364, 0.41832998394966125 ),
( 0.45000001788139343, 0.45000001788139343, 0.34999996423721313, 0.34999996423721313 ),
( 0.45000001788139343, 0.44999998807907104, 0.2474873661994934, 0.49497470259666443 ),
( 0.44999998807907104, 0.45000001788139343, 0.49497470259666443, 0.2474873661994934 ),
( 0.45000001788139343, 0.45000001788139343, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.44999998807907104, 0.6062480807304382, 0.2020624577999115 ),
( 0.45000001788139343, 0.45000001788139343, 0.41833001375198364, 0.41833001375198364 ),
( 0.45000001788139343, 0.550000011920929, 0.34999996423721313, 0.3500000238418579 ),
( 0.45000001788139343, 0.550000011920929, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.550000011920929, 0.49497470259666443, 0.2474873960018158 ),
( 0.45000001788139343, 0.550000011920929, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.550000011920929, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.550000011920929, 0.41833001375198364, 0.41833004355430603 ),
( 0.45000001788139343, 0.6500000357627869, 0.34999996423721313, 0.3500000238418579 ),
( 0.45000001788139343, 0.6500000357627869, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.6500000357627869, 0.49497470259666443, 0.24748742580413818 ),
( 0.45000001788139343, 0.6500000357627869, 0.20207256078720093, 0.6062177419662476 ),
( 0.45000001788139343, 0.6500000357627869, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.6500000357627869, 0.41833001375198364, 0.41833004355430603 ),
( 0.45000001788139343, 0.75, 0.34999996423721313, 0.3500000238418579 ),
( 0.45000001788139343, 0.75, 0.2474873661994934, 0.4949747323989868 ),
( 0.44999998807907104, 0.75, 0.49497470259666443, 0.24748730659484863 ),
( 0.45000001788139343, 0.75, 0.20207256078720093, 0.6062178015708923 ),
( 0.45000001788139343, 0.75, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.75, 0.41833001375198364, 0.41832995414733887 ),
( 0.45000001788139343, 0.8500000238418579, 0.34999996423721313, 0.34999996423721313 ),
( 0.45000001788139343, 0.8500000238418579, 0.2474873661994934, 0.4949747920036316 ),
( 0.44999998807907104, 0.8500000238418579, 0.49497470259666443, 0.24748730659484863 ),
( 0.45000001788139343, 0.8500000238418579, 0.20207256078720093, 0.6062176823616028 ),
( 0.45000001788139343, 0.8500000238418579, 0.6062480807304382, 0.2020624876022339 ),
( 0.45000001788139343, 0.8500000238418579, 0.41833001375198364, 0.41832995414733887 ),
( 0.45000001788139343, 0.9500000476837158, 0.34999996423721313, 0.34999996423721313 ),
( 0.45000001788139343, 0.9500000476837158, 0.2474873661994934, 0.49497467279434204 ),
( 0.44999998807907104, 0.9500000476837158, 0.49497470259666443, 0.24748730659484863 ),
( 0.45000001788139343, 0.9500000476837158, 0.20207256078720093, 0.6062178015708923 ),
( 0.45000001788139343, 0.9500000476837158, 0.6062480807304382, 0.20206254720687866 ),
( 0.45000001788139343, 0.9500000476837158, 0.41833001375198364, 0.41832995414733887 ),
( 0.550000011920929, 0.04999999701976776, 0.3500000238418579, 0.3499999940395355 ),
( 0.550000011920929, 0.04999999701976776, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.550000011920929, 0.050000011920928955, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.05000000074505806, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.04999999701976776, 0.41833004355430603, 0.41833001375198364 ),
( 0.550000011920929, 0.14999999105930328, 0.3500000238418579, 0.34999996423721313 ),
( 0.550000011920929, 0.15000000596046448, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.550000011920929, 0.15000000596046448, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.15000000596046448, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.15000000596046448, 0.41833004355430603, 0.41833001375198364 ),
( 0.550000011920929, 0.25, 0.3500000238418579, 0.3500000238418579 ),
( 0.550000011920929, 0.25, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.550000011920929, 0.25, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.25, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.25, 0.41833004355430603, 0.41833001375198364 ),
( 0.550000011920929, 0.3500000238418579, 0.3500000238418579, 0.3500000238418579 ),
( 0.550000011920929, 0.3500000238418579, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.550000011920929, 0.3500000238418579, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.3500000238418579, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.3500000238418579, 0.41833004355430603, 0.41832998394966125 ),
( 0.550000011920929, 0.45000001788139343, 0.3500000238418579, 0.34999996423721313 ),
( 0.550000011920929, 0.44999998807907104, 0.2474873960018158, 0.49497470259666443 ),
( 0.550000011920929, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.550000011920929, 0.45000001788139343, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.44999998807907104, 0.6062480211257935, 0.2020624577999115 ),
( 0.550000011920929, 0.45000001788139343, 0.41833004355430603, 0.41833001375198364 ),
( 0.550000011920929, 0.550000011920929, 0.3500000238418579, 0.3500000238418579 ),
( 0.550000011920929, 0.550000011920929, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.550000011920929, 0.550000011920929, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.550000011920929, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.550000011920929, 0.41833004355430603, 0.41833004355430603 ),
( 0.550000011920929, 0.6500000357627869, 0.3500000238418579, 0.3500000238418579 ),
( 0.550000011920929, 0.6500000357627869, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.550000011920929, 0.6500000357627869, 0.2020726203918457, 0.6062177419662476 ),
( 0.5499999523162842, 0.6500000357627869, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.6500000357627869, 0.41833004355430603, 0.41833004355430603 ),
( 0.550000011920929, 0.75, 0.3500000238418579, 0.3500000238418579 ),
( 0.550000011920929, 0.75, 0.2474873960018158, 0.4949747323989868 ),
( 0.550000011920929, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.550000011920929, 0.75, 0.2020726203918457, 0.6062178015708923 ),
( 0.5499999523162842, 0.75, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.75, 0.41833004355430603, 0.41832995414733887 ),
( 0.550000011920929, 0.8500000238418579, 0.3500000238418579, 0.34999996423721313 ),
( 0.550000011920929, 0.8500000238418579, 0.2474873960018158, 0.4949747920036316 ),
( 0.550000011920929, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.550000011920929, 0.8500000238418579, 0.2020726203918457, 0.6062176823616028 ),
( 0.5499999523162842, 0.8500000238418579, 0.6062480211257935, 0.2020624876022339 ),
( 0.550000011920929, 0.8500000238418579, 0.41833004355430603, 0.41832995414733887 ),
( 0.550000011920929, 0.9500000476837158, 0.3500000238418579, 0.34999996423721313 ),
( 0.550000011920929, 0.9500000476837158, 0.2474873960018158, 0.49497467279434204 ),
( 0.550000011920929, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.550000011920929, 0.9500000476837158, 0.2020726203918457, 0.6062178015708923 ),
( 0.5499999523162842, 0.9500000476837158, 0.6062480211257935, 0.20206254720687866 ),
( 0.550000011920929, 0.9500000476837158, 0.41833004355430603, 0.41832995414733887 ),
( 0.6500000357627869, 0.04999999701976776, 0.3500000238418579, 0.3499999940395355 ),
( 0.6500000357627869, 0.04999999701976776, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.6500000357627869, 0.050000011920928955, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.05000000074505806, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.04999999701976776, 0.41833004355430603, 0.41833001375198364 ),
( 0.6500000357627869, 0.14999999105930328, 0.3500000238418579, 0.34999996423721313 ),
( 0.6500000357627869, 0.15000000596046448, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.6500000357627869, 0.15000000596046448, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.15000000596046448, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.15000000596046448, 0.41833004355430603, 0.41833001375198364 ),
( 0.6500000357627869, 0.25, 0.3500000238418579, 0.3500000238418579 ),
( 0.6500000357627869, 0.25, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.6500000357627869, 0.25, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.25, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.25, 0.41833004355430603, 0.41833001375198364 ),
( 0.6500000357627869, 0.3500000238418579, 0.3500000238418579, 0.3500000238418579 ),
( 0.6500000357627869, 0.3500000238418579, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.6500000357627869, 0.3500000238418579, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.3500000238418579, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.3500000238418579, 0.41833004355430603, 0.41832998394966125 ),
( 0.6500000357627869, 0.45000001788139343, 0.3500000238418579, 0.34999996423721313 ),
( 0.6500000357627869, 0.44999998807907104, 0.24748742580413818, 0.49497470259666443 ),
( 0.6500000357627869, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.6500000357627869, 0.45000001788139343, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.44999998807907104, 0.6062480211257935, 0.2020624577999115 ),
( 0.6500000357627869, 0.45000001788139343, 0.41833004355430603, 0.41833001375198364 ),
( 0.6500000357627869, 0.550000011920929, 0.3500000238418579, 0.3500000238418579 ),
( 0.6500000357627869, 0.550000011920929, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.6500000357627869, 0.550000011920929, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.550000011920929, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.550000011920929, 0.41833004355430603, 0.41833004355430603 ),
( 0.6500000357627869, 0.6500000357627869, 0.3500000238418579, 0.3500000238418579 ),
( 0.6500000357627869, 0.6500000357627869, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.6500000357627869, 0.6500000357627869, 0.2020726203918457, 0.6062177419662476 ),
( 0.6499999761581421, 0.6500000357627869, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.6500000357627869, 0.41833004355430603, 0.41833004355430603 ),
( 0.6500000357627869, 0.75, 0.3500000238418579, 0.3500000238418579 ),
( 0.6500000357627869, 0.75, 0.24748742580413818, 0.4949747323989868 ),
( 0.6500000357627869, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.6500000357627869, 0.75, 0.2020726203918457, 0.6062178015708923 ),
( 0.6499999761581421, 0.75, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.75, 0.41833004355430603, 0.41832995414733887 ),
( 0.6500000357627869, 0.8500000238418579, 0.3500000238418579, 0.34999996423721313 ),
( 0.6500000357627869, 0.8500000238418579, 0.24748742580413818, 0.4949747920036316 ),
( 0.6500000357627869, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.6500000357627869, 0.8500000238418579, 0.2020726203918457, 0.6062176823616028 ),
( 0.6499999761581421, 0.8500000238418579, 0.6062480211257935, 0.2020624876022339 ),
( 0.6500000357627869, 0.8500000238418579, 0.41833004355430603, 0.41832995414733887 ),
( 0.6500000357627869, 0.9500000476837158, 0.3500000238418579, 0.34999996423721313 ),
( 0.6500000357627869, 0.9500000476837158, 0.24748742580413818, 0.49497467279434204 ),
( 0.6500000357627869, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.6500000357627869, 0.9500000476837158, 0.2020726203918457, 0.6062178015708923 ),
( 0.6499999761581421, 0.9500000476837158, 0.6062480211257935, 0.20206254720687866 ),
( 0.6500000357627869, 0.9500000476837158, 0.41833004355430603, 0.41832995414733887 ),
( 0.75, 0.04999999701976776, 0.3500000238418579, 0.3499999940395355 ),
( 0.75, 0.04999999701976776, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.04999999701976776, 0.4949747323989868, 0.2474873661994934 ),
( 0.75, 0.050000011920928955, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.05000000074505806, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.04999999701976776, 0.41832995414733887, 0.41833001375198364 ),
( 0.75, 0.14999999105930328, 0.3500000238418579, 0.34999996423721313 ),
( 0.75, 0.15000000596046448, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.15000000596046448, 0.4949747323989868, 0.2474873661994934 ),
( 0.75, 0.15000000596046448, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.15000000596046448, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.15000000596046448, 0.41832995414733887, 0.41833001375198364 ),
( 0.75, 0.25, 0.3500000238418579, 0.3500000238418579 ),
( 0.75, 0.25, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.25, 0.4949747323989868, 0.2474873661994934 ),
( 0.75, 0.25, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.25, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.25, 0.41832995414733887, 0.41833001375198364 ),
( 0.75, 0.3500000238418579, 0.3500000238418579, 0.3500000238418579 ),
( 0.75, 0.3500000238418579, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.3500000238418579, 0.4949747323989868, 0.2474873661994934 ),
( 0.75, 0.3500000238418579, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.3500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.3500000238418579, 0.41832995414733887, 0.41832998394966125 ),
( 0.75, 0.45000001788139343, 0.3500000238418579, 0.34999996423721313 ),
( 0.75, 0.44999998807907104, 0.24748730659484863, 0.49497470259666443 ),
( 0.75, 0.45000001788139343, 0.4949747323989868, 0.2474873661994934 ),
( 0.75, 0.45000001788139343, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.44999998807907104, 0.606248140335083, 0.2020624577999115 ),
( 0.75, 0.45000001788139343, 0.41832995414733887, 0.41833001375198364 ),
( 0.75, 0.550000011920929, 0.3500000238418579, 0.3500000238418579 ),
( 0.75, 0.550000011920929, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.550000011920929, 0.4949747323989868, 0.2474873960018158 ),
( 0.75, 0.550000011920929, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.550000011920929, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.550000011920929, 0.41832995414733887, 0.41833004355430603 ),
( 0.75, 0.6500000357627869, 0.3500000238418579, 0.3500000238418579 ),
( 0.75, 0.6500000357627869, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.6500000357627869, 0.4949747323989868, 0.24748742580413818 ),
( 0.75, 0.6500000357627869, 0.2020726203918457, 0.6062177419662476 ),
( 0.75, 0.6500000357627869, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.6500000357627869, 0.41832995414733887, 0.41833004355430603 ),
( 0.75, 0.75, 0.3500000238418579, 0.3500000238418579 ),
( 0.75, 0.75, 0.24748730659484863, 0.4949747323989868 ),
( 0.75, 0.75, 0.4949747323989868, 0.24748730659484863 ),
( 0.75, 0.75, 0.2020726203918457, 0.6062178015708923 ),
( 0.75, 0.75, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.75, 0.41832995414733887, 0.41832995414733887 ),
( 0.75, 0.8500000238418579, 0.3500000238418579, 0.34999996423721313 ),
( 0.75, 0.8500000238418579, 0.24748730659484863, 0.4949747920036316 ),
( 0.75, 0.8500000238418579, 0.4949747323989868, 0.24748730659484863 ),
( 0.75, 0.8500000238418579, 0.2020726203918457, 0.6062176823616028 ),
( 0.75, 0.8500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.75, 0.8500000238418579, 0.41832995414733887, 0.41832995414733887 ),
( 0.75, 0.9500000476837158, 0.3500000238418579, 0.34999996423721313 ),
( 0.75, 0.9500000476837158, 0.24748730659484863, 0.49497467279434204 ),
( 0.75, 0.9500000476837158, 0.4949747323989868, 0.24748730659484863 ),
( 0.75, 0.9500000476837158, 0.2020726203918457, 0.6062178015708923 ),
( 0.75, 0.9500000476837158, 0.606248140335083, 0.20206254720687866 ),
( 0.75, 0.9500000476837158, 0.41832995414733887, 0.41832995414733887 ),
( 0.8500000238418579, 0.04999999701976776, 0.34999996423721313, 0.3499999940395355 ),
( 0.8500000238418579, 0.04999999701976776, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.04999999701976776, 0.4949747920036316, 0.2474873661994934 ),
( 0.8500000238418579, 0.050000011920928955, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.05000000074505806, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.04999999701976776, 0.41832995414733887, 0.41833001375198364 ),
( 0.8500000238418579, 0.14999999105930328, 0.34999996423721313, 0.34999996423721313 ),
( 0.8500000238418579, 0.15000000596046448, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.15000000596046448, 0.4949747920036316, 0.2474873661994934 ),
( 0.8500000238418579, 0.15000000596046448, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.15000000596046448, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.15000000596046448, 0.41832995414733887, 0.41833001375198364 ),
( 0.8500000238418579, 0.25, 0.34999996423721313, 0.3500000238418579 ),
( 0.8500000238418579, 0.25, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.25, 0.4949747920036316, 0.2474873661994934 ),
( 0.8500000238418579, 0.25, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.25, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.25, 0.41832995414733887, 0.41833001375198364 ),
( 0.8500000238418579, 0.3500000238418579, 0.34999996423721313, 0.3500000238418579 ),
( 0.8500000238418579, 0.3500000238418579, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.3500000238418579, 0.4949747920036316, 0.2474873661994934 ),
( 0.8500000238418579, 0.3500000238418579, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.3500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.3500000238418579, 0.41832995414733887, 0.41832998394966125 ),
( 0.8500000238418579, 0.45000001788139343, 0.34999996423721313, 0.34999996423721313 ),
( 0.8500000238418579, 0.44999998807907104, 0.24748730659484863, 0.49497470259666443 ),
( 0.8500000238418579, 0.45000001788139343, 0.4949747920036316, 0.2474873661994934 ),
( 0.8500000238418579, 0.45000001788139343, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.44999998807907104, 0.606248140335083, 0.2020624577999115 ),
( 0.8500000238418579, 0.45000001788139343, 0.41832995414733887, 0.41833001375198364 ),
( 0.8500000238418579, 0.550000011920929, 0.34999996423721313, 0.3500000238418579 ),
( 0.8500000238418579, 0.550000011920929, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.550000011920929, 0.4949747920036316, 0.2474873960018158 ),
( 0.8500000238418579, 0.550000011920929, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.550000011920929, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.550000011920929, 0.41832995414733887, 0.41833004355430603 ),
( 0.8500000238418579, 0.6500000357627869, 0.34999996423721313, 0.3500000238418579 ),
( 0.8500000238418579, 0.6500000357627869, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.6500000357627869, 0.4949747920036316, 0.24748742580413818 ),
( 0.8500000238418579, 0.6500000357627869, 0.2020726203918457, 0.6062177419662476 ),
( 0.8500000238418579, 0.6500000357627869, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.6500000357627869, 0.41832995414733887, 0.41833004355430603 ),
( 0.8500000238418579, 0.75, 0.34999996423721313, 0.3500000238418579 ),
( 0.8500000238418579, 0.75, 0.24748730659484863, 0.4949747323989868 ),
( 0.8500000238418579, 0.75, 0.4949747920036316, 0.24748730659484863 ),
( 0.8500000238418579, 0.75, 0.2020726203918457, 0.6062178015708923 ),
( 0.8500000238418579, 0.75, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.75, 0.41832995414733887, 0.41832995414733887 ),
( 0.8500000238418579, 0.8500000238418579, 0.34999996423721313, 0.34999996423721313 ),
( 0.8500000238418579, 0.8500000238418579, 0.24748730659484863, 0.4949747920036316 ),
( 0.8500000238418579, 0.8500000238418579, 0.4949747920036316, 0.24748730659484863 ),
( 0.8500000238418579, 0.8500000238418579, 0.2020726203918457, 0.6062176823616028 ),
( 0.8500000238418579, 0.8500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.8500000238418579, 0.8500000238418579, 0.41832995414733887, 0.41832995414733887 ),
( 0.8500000238418579, 0.9500000476837158, 0.34999996423721313, 0.34999996423721313 ),
( 0.8500000238418579, 0.9500000476837158, 0.24748730659484863, 0.49497467279434204 ),
( 0.8500000238418579, 0.9500000476837158, 0.4949747920036316, 0.24748730659484863 ),
( 0.8500000238418579, 0.9500000476837158, 0.2020726203918457, 0.6062178015708923 ),
( 0.8500000238418579, 0.9500000476837158, 0.606248140335083, 0.20206254720687866 ),
( 0.8500000238418579, 0.9500000476837158, 0.41832995414733887, 0.41832995414733887 ),
( 0.9500000476837158, 0.04999999701976776, 0.34999996423721313, 0.3499999940395355 ),
( 0.9500000476837158, 0.04999999701976776, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.04999999701976776, 0.49497467279434204, 0.2474873661994934 ),
( 0.9500000476837158, 0.050000011920928955, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.05000000074505806, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.04999999701976776, 0.41832995414733887, 0.41833001375198364 ),
( 0.9500000476837158, 0.14999999105930328, 0.34999996423721313, 0.34999996423721313 ),
( 0.9500000476837158, 0.15000000596046448, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.15000000596046448, 0.49497467279434204, 0.2474873661994934 ),
( 0.9500000476837158, 0.15000000596046448, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.15000000596046448, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.15000000596046448, 0.41832995414733887, 0.41833001375198364 ),
( 0.9500000476837158, 0.25, 0.34999996423721313, 0.3500000238418579 ),
( 0.9500000476837158, 0.25, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.25, 0.49497467279434204, 0.2474873661994934 ),
( 0.9500000476837158, 0.25, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.25, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.25, 0.41832995414733887, 0.41833001375198364 ),
( 0.9500000476837158, 0.3500000238418579, 0.34999996423721313, 0.3500000238418579 ),
( 0.9500000476837158, 0.3500000238418579, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.3500000238418579, 0.49497467279434204, 0.2474873661994934 ),
( 0.9500000476837158, 0.3500000238418579, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.3500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.3500000238418579, 0.41832995414733887, 0.41832998394966125 ),
( 0.9500000476837158, 0.45000001788139343, 0.34999996423721313, 0.34999996423721313 ),
( 0.9500000476837158, 0.44999998807907104, 0.24748730659484863, 0.49497470259666443 ),
( 0.9500000476837158, 0.45000001788139343, 0.49497467279434204, 0.2474873661994934 ),
( 0.9500000476837158, 0.45000001788139343, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.44999998807907104, 0.606248140335083, 0.2020624577999115 ),
( 0.9500000476837158, 0.45000001788139343, 0.41832995414733887, 0.41833001375198364 ),
( 0.9500000476837158, 0.550000011920929, 0.34999996423721313, 0.3500000238418579 ),
( 0.9500000476837158, 0.550000011920929, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.550000011920929, 0.49497467279434204, 0.2474873960018158 ),
( 0.9500000476837158, 0.550000011920929, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.550000011920929, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.550000011920929, 0.41832995414733887, 0.41833004355430603 ),
( 0.9500000476837158, 0.6500000357627869, 0.34999996423721313, 0.3500000238418579 ),
( 0.9500000476837158, 0.6500000357627869, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.6500000357627869, 0.49497467279434204, 0.24748742580413818 ),
( 0.9500000476837158, 0.6500000357627869, 0.2020726203918457, 0.6062177419662476 ),
( 0.9500000476837158, 0.6500000357627869, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.6500000357627869, 0.41832995414733887, 0.41833004355430603 ),
( 0.9500000476837158, 0.75, 0.34999996423721313, 0.3500000238418579 ),
( 0.9500000476837158, 0.75, 0.24748730659484863, 0.4949747323989868 ),
( 0.9500000476837158, 0.75, 0.49497467279434204, 0.24748730659484863 ),
( 0.9500000476837158, 0.75, 0.2020726203918457, 0.6062178015708923 ),
( 0.9500000476837158, 0.75, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.75, 0.41832995414733887, 0.41832995414733887 ),
( 0.9500000476837158, 0.8500000238418579, 0.34999996423721313, 0.34999996423721313 ),
( 0.9500000476837158, 0.8500000238418579, 0.24748730659484863, 0.4949747920036316 ),
( 0.9500000476837158, 0.8500000238418579, 0.49497467279434204, 0.24748730659484863 ),
( 0.9500000476837158, 0.8500000238418579, 0.2020726203918457, 0.6062176823616028 ),
( 0.9500000476837158, 0.8500000238418579, 0.606248140335083, 0.2020624876022339 ),
( 0.9500000476837158, 0.8500000238418579, 0.41832995414733887, 0.41832995414733887 ),
( 0.9500000476837158, 0.9500000476837158, 0.34999996423721313, 0.34999996423721313 ),
( 0.9500000476837158, 0.9500000476837158, 0.24748730659484863, 0.49497467279434204 ),
( 0.9500000476837158, 0.9500000476837158, 0.49497467279434204, 0.24748730659484863 ),
( 0.9500000476837158, 0.9500000476837158, 0.2020726203918457, 0.6062178015708923 ),
( 0.9500000476837158, 0.9500000476837158, 0.606248140335083, 0.20206254720687866 ),
( 0.9500000476837158, 0.9500000476837158, 0.41832995414733887, 0.41832995414733887 ),
( 0.09999999403953552, 0.09999999403953552, 0.5, 0.5 ),
( 0.10000000149011612, 0.09999999403953552, 0.3535533845424652, 0.7071067690849304 ),
( 0.09999999403953552, 0.10000000149011612, 0.7071067690849304, 0.3535533845424652 ),
( 0.10000000149011612, 0.09999999403953552, 0.28867512941360474, 0.8660253882408142 ),
( 0.09999999403953552, 0.10000000149011612, 0.8660687208175659, 0.2886607050895691 ),
( 0.09999999403953552, 0.09999999403953552, 0.570087730884552, 0.570087730884552 ),
( 0.09999999403953552, 0.30000001192092896, 0.5, 0.5 ),
( 0.10000000149011612, 0.29999998211860657, 0.3535533845424652, 0.7071067094802856 ),
( 0.09999999403953552, 0.30000001192092896, 0.7071067690849304, 0.3535534143447876 ),
( 0.10000000149011612, 0.29999998211860657, 0.28867512941360474, 0.8660253286361694 ),
( 0.09999999403953552, 0.30000001192092896, 0.8660687208175659, 0.2886607050895691 ),
( 0.09999999403953552, 0.30000004172325134, 0.570087730884552, 0.5700877904891968 ),
( 0.09999999403953552, 0.5, 0.5, 0.5 ),
( 0.10000000149011612, 0.5, 0.3535533845424652, 0.7071068286895752 ),
( 0.09999999403953552, 0.5, 0.7071067690849304, 0.3535534143447876 ),
( 0.10000000149011612, 0.5, 0.28867512941360474, 0.866025447845459 ),
( 0.09999999403953552, 0.5, 0.8660687208175659, 0.2886607348918915 ),
( 0.09999999403953552, 0.4999999701976776, 0.570087730884552, 0.5700876712799072 ),
( 0.09999999403953552, 0.7000000476837158, 0.5, 0.5 ),
( 0.10000000149011612, 0.7000000476837158, 0.3535533845424652, 0.7071068286895752 ),
( 0.09999999403953552, 0.7000000476837158, 0.7071067690849304, 0.3535534143447876 ),
( 0.10000000149011612, 0.7000000476837158, 0.28867512941360474, 0.866025447845459 ),
( 0.09999999403953552, 0.7000000476837158, 0.8660687208175659, 0.28866076469421387 ),
( 0.09999999403953552, 0.7000000476837158, 0.570087730884552, 0.5700876712799072 ),
( 0.09999999403953552, 0.9000000953674316, 0.5, 0.5000000596046448 ),
( 0.10000000149011612, 0.9000000357627869, 0.3535533845424652, 0.7071067094802856 ),
( 0.09999999403953552, 0.9000000357627869, 0.7071067690849304, 0.3535534143447876 ),
( 0.10000000149011612, 0.8999999761581421, 0.28867512941360474, 0.8660253286361694 ),
( 0.09999999403953552, 0.9000000357627869, 0.8660687208175659, 0.2886606454849243 ),
( 0.09999999403953552, 0.9000000357627869, 0.570087730884552, 0.5700877904891968 ),
( 0.30000001192092896, 0.09999999403953552, 0.5, 0.5 ),
( 0.30000001192092896, 0.09999999403953552, 0.3535534143447876, 0.7071067690849304 ),
( 0.29999998211860657, 0.10000000149011612, 0.7071067094802856, 0.3535533845424652 ),
( 0.30000001192092896, 0.09999999403953552, 0.28867512941360474, 0.8660253882408142 ),
( 0.30000001192092896, 0.10000000149011612, 0.8660687208175659, 0.2886607050895691 ),
( 0.30000004172325134, 0.09999999403953552, 0.5700877904891968, 0.570087730884552 ),
( 0.30000001192092896, 0.30000001192092896, 0.5, 0.5 ),
( 0.30000001192092896, 0.29999998211860657, 0.3535534143447876, 0.7071067094802856 ),
( 0.29999998211860657, 0.30000001192092896, 0.7071067094802856, 0.3535534143447876 ),
( 0.30000001192092896, 0.29999998211860657, 0.28867512941360474, 0.8660253286361694 ),
( 0.30000001192092896, 0.30000001192092896, 0.8660687208175659, 0.2886607050895691 ),
( 0.30000004172325134, 0.30000004172325134, 0.5700877904891968, 0.5700877904891968 ),
( 0.30000001192092896, 0.5, 0.5, 0.5 ),
( 0.30000001192092896, 0.5, 0.3535534143447876, 0.7071068286895752 ),
( 0.29999998211860657, 0.5, 0.7071067094802856, 0.3535534143447876 ),
( 0.30000001192092896, 0.5, 0.28867512941360474, 0.866025447845459 ),
( 0.30000001192092896, 0.5, 0.8660687208175659, 0.2886607348918915 ),
( 0.30000004172325134, 0.4999999701976776, 0.5700877904891968, 0.5700876712799072 ),
( 0.30000001192092896, 0.7000000476837158, 0.5, 0.5 ),
( 0.30000001192092896, 0.7000000476837158, 0.3535534143447876, 0.7071068286895752 ),
( 0.29999998211860657, 0.7000000476837158, 0.7071067094802856, 0.3535534143447876 ),
( 0.30000001192092896, 0.7000000476837158, 0.28867512941360474, 0.866025447845459 ),
( 0.30000001192092896, 0.7000000476837158, 0.8660687208175659, 0.28866076469421387 ),
( 0.30000004172325134, 0.7000000476837158, 0.5700877904891968, 0.5700876712799072 ),
( 0.30000001192092896, 0.9000000953674316, 0.5, 0.5000000596046448 ),
( 0.30000001192092896, 0.9000000357627869, 0.3535534143447876, 0.7071067094802856 ),
( 0.29999998211860657, 0.9000000357627869, 0.7071067094802856, 0.3535534143447876 ),
( 0.30000001192092896, 0.8999999761581421, 0.28867512941360474, 0.8660253286361694 ),
( 0.30000001192092896, 0.9000000357627869, 0.8660687208175659, 0.2886606454849243 ),
( 0.30000004172325134, 0.9000000357627869, 0.5700877904891968, 0.5700877904891968 ),
( 0.5, 0.09999999403953552, 0.5, 0.5 ),
( 0.5, 0.09999999403953552, 0.3535534143447876, 0.7071067690849304 ),
( 0.5, 0.10000000149011612, 0.7071068286895752, 0.3535533845424652 ),
( 0.5, 0.09999999403953552, 0.28867509961128235, 0.8660253882408142 ),
( 0.5, 0.10000000149011612, 0.8660687208175659, 0.2886607050895691 ),
( 0.4999999701976776, 0.09999999403953552, 0.5700876712799072, 0.570087730884552 ),
( 0.5, 0.30000001192092896, 0.5, 0.5 ),
( 0.5, 0.29999998211860657, 0.3535534143447876, 0.7071067094802856 ),
( 0.5, 0.30000001192092896, 0.7071068286895752, 0.3535534143447876 ),
( 0.5, 0.29999998211860657, 0.28867509961128235, 0.8660253286361694 ),
( 0.5, 0.30000001192092896, 0.8660687208175659, 0.2886607050895691 ),
( 0.4999999701976776, 0.30000004172325134, 0.5700876712799072, 0.5700877904891968 ),
( 0.5, 0.5, 0.5, 0.5 ),
( 0.5, 0.5, 0.3535534143447876, 0.7071068286895752 ),
( 0.5, 0.5, 0.7071068286895752, 0.3535534143447876 ),
( 0.5, 0.5, 0.28867509961128235, 0.866025447845459 ),
( 0.5, 0.5, 0.8660687208175659, 0.2886607348918915 ),
( 0.4999999701976776, 0.4999999701976776, 0.5700876712799072, 0.5700876712799072 ),
( 0.5, 0.7000000476837158, 0.5, 0.5 ),
( 0.5, 0.7000000476837158, 0.3535534143447876, 0.7071068286895752 ),
( 0.5, 0.7000000476837158, 0.7071068286895752, 0.3535534143447876 ),
( 0.5, 0.7000000476837158, 0.28867509961128235, 0.866025447845459 ),
( 0.5, 0.7000000476837158, 0.8660687208175659, 0.28866076469421387 ),
( 0.4999999701976776, 0.7000000476837158, 0.5700876712799072, 0.5700876712799072 ),
( 0.5, 0.9000000953674316, 0.5, 0.5000000596046448 ),
( 0.5, 0.9000000357627869, 0.3535534143447876, 0.7071067094802856 ),
( 0.5, 0.9000000357627869, 0.7071068286895752, 0.3535534143447876 ),
( 0.5, 0.8999999761581421, 0.28867509961128235, 0.8660253286361694 ),
( 0.5, 0.9000000357627869, 0.8660687208175659, 0.2886606454849243 ),
( 0.4999999701976776, 0.9000000357627869, 0.5700876712799072, 0.5700877904891968 ),
( 0.7000000476837158, 0.09999999403953552, 0.5, 0.5 ),
( 0.7000000476837158, 0.09999999403953552, 0.3535534143447876, 0.7071067690849304 ),
( 0.7000000476837158, 0.10000000149011612, 0.7071068286895752, 0.3535533845424652 ),
( 0.7000000476837158, 0.09999999403953552, 0.28867506980895996, 0.8660253882408142 ),
( 0.7000000476837158, 0.10000000149011612, 0.8660687804222107, 0.2886607050895691 ),
( 0.7000000476837158, 0.09999999403953552, 0.5700876712799072, 0.570087730884552 ),
( 0.7000000476837158, 0.30000001192092896, 0.5, 0.5 ),
( 0.7000000476837158, 0.29999998211860657, 0.3535534143447876, 0.7071067094802856 ),
( 0.7000000476837158, 0.30000001192092896, 0.7071068286895752, 0.3535534143447876 ),
( 0.7000000476837158, 0.29999998211860657, 0.28867506980895996, 0.8660253286361694 ),
( 0.7000000476837158, 0.30000001192092896, 0.8660687804222107, 0.2886607050895691 ),
( 0.7000000476837158, 0.30000004172325134, 0.5700876712799072, 0.5700877904891968 ),
( 0.7000000476837158, 0.5, 0.5, 0.5 ),
( 0.7000000476837158, 0.5, 0.3535534143447876, 0.7071068286895752 ),
( 0.7000000476837158, 0.5, 0.7071068286895752, 0.3535534143447876 ),
( 0.7000000476837158, 0.5, 0.28867506980895996, 0.866025447845459 ),
( 0.7000000476837158, 0.5, 0.8660687804222107, 0.2886607348918915 ),
( 0.7000000476837158, 0.4999999701976776, 0.5700876712799072, 0.5700876712799072 ),
( 0.7000000476837158, 0.7000000476837158, 0.5, 0.5 ),
( 0.7000000476837158, 0.7000000476837158, 0.3535534143447876, 0.7071068286895752 ),
( 0.7000000476837158, 0.7000000476837158, 0.7071068286895752, 0.3535534143447876 ),
( 0.7000000476837158, 0.7000000476837158, 0.28867506980895996, 0.866025447845459 ),
( 0.7000000476837158, 0.7000000476837158, 0.8660687804222107, 0.28866076469421387 ),
( 0.7000000476837158, 0.7000000476837158, 0.5700876712799072, 0.5700876712799072 ),
( 0.7000000476837158, 0.9000000953674316, 0.5, 0.5000000596046448 ),
( 0.7000000476837158, 0.9000000357627869, 0.3535534143447876, 0.7071067094802856 ),
( 0.7000000476837158, 0.9000000357627869, 0.7071068286895752, 0.3535534143447876 ),
( 0.7000000476837158, 0.8999999761581421, 0.28867506980895996, 0.8660253286361694 ),
( 0.7000000476837158, 0.9000000357627869, 0.8660687804222107, 0.2886606454849243 ),
( 0.7000000476837158, 0.9000000357627869, 0.5700876712799072, 0.5700877904891968 ),
( 0.9000000953674316, 0.09999999403953552, 0.5000000596046448, 0.5 ),
( 0.9000000357627869, 0.09999999403953552, 0.3535534143447876, 0.7071067690849304 ),
( 0.9000000357627869, 0.10000000149011612, 0.7071067094802856, 0.3535533845424652 ),
( 0.9000000357627869, 0.09999999403953552, 0.2886751890182495, 0.8660253882408142 ),
( 0.9000000357627869, 0.10000000149011612, 0.8660687208175659, 0.2886607050895691 ),
( 0.9000000357627869, 0.09999999403953552, 0.5700877904891968, 0.570087730884552 ),
( 0.9000000953674316, 0.30000001192092896, 0.5000000596046448, 0.5 ),
( 0.9000000357627869, 0.29999998211860657, 0.3535534143447876, 0.7071067094802856 ),
( 0.9000000357627869, 0.30000001192092896, 0.7071067094802856, 0.3535534143447876 ),
( 0.9000000357627869, 0.29999998211860657, 0.2886751890182495, 0.8660253286361694 ),
( 0.9000000357627869, 0.30000001192092896, 0.8660687208175659, 0.2886607050895691 ),
( 0.9000000357627869, 0.30000004172325134, 0.5700877904891968, 0.5700877904891968 ),
( 0.9000000953674316, 0.5, 0.5000000596046448, 0.5 ),
( 0.9000000357627869, 0.5, 0.3535534143447876, 0.7071068286895752 ),
( 0.9000000357627869, 0.5, 0.7071067094802856, 0.3535534143447876 ),
( 0.9000000357627869, 0.5, 0.2886751890182495, 0.866025447845459 ),
( 0.9000000357627869, 0.5, 0.8660687208175659, 0.2886607348918915 ),
( 0.9000000357627869, 0.4999999701976776, 0.5700877904891968, 0.5700876712799072 ),
( 0.9000000953674316, 0.7000000476837158, 0.5000000596046448, 0.5 ),
( 0.9000000357627869, 0.7000000476837158, 0.3535534143447876, 0.7071068286895752 ),
( 0.9000000357627869, 0.7000000476837158, 0.7071067094802856, 0.3535534143447876 ),
( 0.9000000357627869, 0.7000000476837158, 0.2886751890182495, 0.866025447845459 ),
( 0.9000000357627869, 0.7000000476837158, 0.8660687208175659, 0.28866076469421387 ),
( 0.9000000357627869, 0.7000000476837158, 0.5700877904891968, 0.5700876712799072 ),
( 0.9000000953674316, 0.9000000953674316, 0.5000000596046448, 0.5000000596046448 ),
( 0.9000000357627869, 0.9000000357627869, 0.3535534143447876, 0.7071067094802856 ),
( 0.9000000357627869, 0.9000000357627869, 0.7071067094802856, 0.3535534143447876 ),
( 0.9000000357627869, 0.8999999761581421, 0.2886751890182495, 0.8660253286361694 ),
( 0.9000000357627869, 0.9000000357627869, 0.8660687208175659, 0.2886606454849243 ),
( 0.9000000357627869, 0.9000000357627869, 0.5700877904891968, 0.5700877904891968 ),
( 0.1666666716337204, 0.1666666716337204, 0.6499999761581421, 0.6499999761581421 ),
( 0.1666666716337204, 0.1666666567325592, 0.459619402885437, 0.9192387461662292 ),
( 0.1666666865348816, 0.1666666716337204, 0.919238805770874, 0.4596193730831146 ),
( 0.1666666716337204, 0.1666666865348816, 0.37527766823768616, 1.1258329153060913 ),
( 0.1666666865348816, 0.1666666716337204, 1.1258893013000488, 0.3752588927745819 ),
( 0.1666666716337204, 0.1666666716337204, 0.7211102247238159, 0.7211102247238159 ),
( 0.1666666716337204, 0.5, 0.6499999761581421, 0.6499999761581421 ),
( 0.1666666716337204, 0.5, 0.459619402885437, 0.919238805770874 ),
( 0.1666666865348816, 0.5, 0.919238805770874, 0.459619402885437 ),
( 0.1666666716337204, 0.5000000596046448, 0.37527766823768616, 1.1258330345153809 ),
( 0.1666666865348816, 0.5, 1.1258893013000488, 0.3752589225769043 ),
( 0.1666666716337204, 0.5, 0.7211102247238159, 0.7211102247238159 ),
( 0.1666666716337204, 0.8333333730697632, 0.6499999761581421, 0.6499999165534973 ),
( 0.1666666716337204, 0.8333333730697632, 0.459619402885437, 0.919238805770874 ),
( 0.1666666865348816, 0.8333333730697632, 0.919238805770874, 0.45961934328079224 ),
( 0.1666666716337204, 0.8333333134651184, 0.37527766823768616, 1.1258327960968018 ),
( 0.1666666865348816, 0.8333333730697632, 1.1258893013000488, 0.3752589225769043 ),
( 0.1666666716337204, 0.8333333730697632, 0.7211102247238159, 0.7211101651191711 ),
( 0.5, 0.1666666716337204, 0.6499999761581421, 0.6499999761581421 ),
( 0.5, 0.1666666567325592, 0.459619402885437, 0.9192387461662292 ),
( 0.5, 0.1666666716337204, 0.919238805770874, 0.4596193730831146 ),
( 0.5, 0.1666666865348816, 0.37527763843536377, 1.1258329153060913 ),
( 0.5, 0.1666666716337204, 1.1258893013000488, 0.3752588927745819 ),
( 0.5, 0.1666666716337204, 0.7211102247238159, 0.7211102247238159 ),
( 0.5, 0.5, 0.6499999761581421, 0.6499999761581421 ),
( 0.5, 0.5, 0.459619402885437, 0.919238805770874 ),
( 0.5, 0.5, 0.919238805770874, 0.459619402885437 ),
( 0.5, 0.5000000596046448, 0.37527763843536377, 1.1258330345153809 ),
( 0.5, 0.5, 1.1258893013000488, 0.3752589225769043 ),
( 0.5, 0.5, 0.7211102247238159, 0.7211102247238159 ),
( 0.5, 0.8333333730697632, 0.6499999761581421, 0.6499999165534973 ),
( 0.5, 0.8333333730697632, 0.459619402885437, 0.919238805770874 ),
( 0.5, 0.8333333730697632, 0.919238805770874, 0.45961934328079224 ),
( 0.5, 0.8333333134651184, 0.37527763843536377, 1.1258327960968018 ),
( 0.5, 0.8333333730697632, 1.1258893013000488, 0.3752589225769043 ),
( 0.5, 0.8333333730697632, 0.7211102247238159, 0.7211101651191711 ),
( 0.8333333730697632, 0.1666666716337204, 0.6499999165534973, 0.6499999761581421 ),
( 0.8333333730697632, 0.1666666567325592, 0.45961934328079224, 0.9192387461662292 ),
( 0.8333333730697632, 0.1666666716337204, 0.919238805770874, 0.4596193730831146 ),
( 0.8333333730697632, 0.1666666865348816, 0.37527769804000854, 1.1258329153060913 ),
( 0.8333333730697632, 0.1666666716337204, 1.1258893013000488, 0.3752588927745819 ),
( 0.8333333730697632, 0.1666666716337204, 0.7211101651191711, 0.7211102247238159 ),
( 0.8333333730697632, 0.5, 0.6499999165534973, 0.6499999761581421 ),
( 0.8333333730697632, 0.5, 0.45961934328079224, 0.919238805770874 ),
( 0.8333333730697632, 0.5, 0.919238805770874, 0.459619402885437 ),
( 0.8333333730697632, 0.5000000596046448, 0.37527769804000854, 1.1258330345153809 ),
( 0.8333333730697632, 0.5, 1.1258893013000488, 0.3752589225769043 ),
( 0.8333333730697632, 0.5, 0.7211101651191711, 0.7211102247238159 ),
( 0.8333333730697632, 0.8333333730697632, 0.6499999165534973, 0.6499999165534973 ),
( 0.8333333730697632, 0.8333333730697632, 0.45961934328079224, 0.919238805770874 ),
( 0.8333333730697632, 0.8333333730697632, 0.919238805770874, 0.45961934328079224 ),
( 0.8333333730697632, 0.8333333134651184, 0.37527769804000854, 1.1258327960968018 ),
( 0.8333333730697632, 0.8333333730697632, 1.1258893013000488, 0.3752589225769043 ),
( 0.8333333730697632, 0.8333333730697632, 0.7211101651191711, 0.7211101651191711 ),
( 0.2499999701976776, 0.2499999701976776, 0.7999999523162842, 0.7999999523162842 ),
( 0.2500000298023224, 0.25, 0.565685510635376, 1.1313709020614624 ),
( 0.25, 0.2500000298023224, 1.1313709020614624, 0.565685510635376 ),
( 0.2499999850988388, 0.25, 0.4618802070617676, 1.3856406211853027 ),
( 0.25, 0.25, 1.3857098817825317, 0.4618571400642395 ),
( 0.25, 0.25, 0.8717797994613647, 0.8717797994613647 ),
( 0.2499999701976776, 0.75, 0.7999999523162842, 0.7999999523162842 ),
( 0.2500000298023224, 0.7500000596046448, 0.565685510635376, 1.131371021270752 ),
( 0.25, 0.75, 1.1313709020614624, 0.565685510635376 ),
( 0.2499999850988388, 0.75, 0.4618802070617676, 1.3856406211853027 ),
( 0.25, 0.75, 1.3857098817825317, 0.4618570804595947 ),
( 0.25, 0.75, 0.8717797994613647, 0.8717798590660095 ),
( 0.75, 0.2499999701976776, 0.7999999523162842, 0.7999999523162842 ),
( 0.75, 0.25, 0.565685510635376, 1.1313709020614624 ),
( 0.7500000596046448, 0.2500000298023224, 1.131371021270752, 0.565685510635376 ),
( 0.75, 0.25, 0.4618802070617676, 1.3856406211853027 ),
( 0.7499999403953552, 0.25, 1.3857097625732422, 0.4618571400642395 ),
( 0.75, 0.25, 0.8717798590660095, 0.8717797994613647 ),
( 0.75, 0.75, 0.7999999523162842, 0.7999999523162842 ),
( 0.75, 0.7500000596046448, 0.565685510635376, 1.131371021270752 ),
( 0.7500000596046448, 0.75, 1.131371021270752, 0.565685510635376 ),
( 0.75, 0.75, 0.4618802070617676, 1.3856406211853027 ),
( 0.7499999403953552, 0.75, 1.3857097625732422, 0.4618570804595947 ),
( 0.75, 0.75, 0.8717798590660095, 0.8717798590660095 ),
( 0.5, 0.5, 0.9500000476837158, 0.9500000476837158 ),
( 0.5, 0.5000000596046448, 0.6717514991760254, 1.3435029983520508 ),
( 0.5000000596046448, 0.5, 1.3435029983520508, 0.6717514991760254 ),
( 0.5, 0.5, 0.5484827756881714, 1.6454482078552246 ),
( 0.5, 0.5, 1.6455304622650146, 0.5484553575515747 ),
( 0.5, 0.5, 0.9746794700622559, 0.9746794700622559 ),
)
# %%
line1 = " "
line2 = " "
line3 = " "
line4 = " "
for anchor in anchors:
e1, e2, e3, e4 = anchor
e1, e2, e3, e4 = str(e1), str(e2), str(e3), str(e4)
line1 += e1
line1 += " "
line2 += e2
line2 += " "
line3 += e3
line3 += " "
line4 += e4
line4 += " "
with open("rockrobo_box_priors.txt", 'w') as wf:
wf.write(line1 + "\n")
wf.write(line2 + "\n")
wf.write(line3 + "\n")
wf.write(line4 + "\n")
# %%
| 81.907598 | 89 | 0.781964 | 15,399 | 159,556 | 8.102149 | 0.011949 | 0.07127 | 0.075229 | 0.048764 | 0.964573 | 0.928602 | 0.928602 | 0.014636 | 0.014636 | 0.012696 | 0 | 0.864866 | 0.097232 | 159,556 | 1,947 | 90 | 81.949666 | 0.001305 | 0.00005 | 0 | 0 | 0 | 0 | 0.000426 | 0.000144 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
899fce9f863d549533bed961b01e25110f213b6c | 2,310 | py | Python | app/server.py | LandRegistry/lr-styleguide-website | a0f4c449f1c7b2d54d7f022c3dd4ec2f8024a7b5 | [
"MIT"
] | 1 | 2016-10-10T09:38:23.000Z | 2016-10-10T09:38:23.000Z | app/server.py | LandRegistry/lr-styleguide-website | a0f4c449f1c7b2d54d7f022c3dd4ec2f8024a7b5 | [
"MIT"
] | null | null | null | app/server.py | LandRegistry/lr-styleguide-website | a0f4c449f1c7b2d54d7f022c3dd4ec2f8024a7b5 | [
"MIT"
] | 1 | 2021-04-11T06:05:59.000Z | 2021-04-11T06:05:59.000Z | import os
from flask import Flask, render_template
from flask.ext import assets
app = Flask(__name__)
env = assets.Environment(app)
env.register(
'styleguide_website',
assets.Bundle(
'demo/sass/styleguide-examples.scss',
filters='scss',
output='demo/css/styleguide-examples.css'
)
)
# Small thing to allow source code examples in a template
app.jinja_env.globals['include_raw'] = lambda filename : app.jinja_loader.get_source(app.jinja_env, filename)[0]
# General base styles
@app.route('/')
def home():
return render_template('styleguide/index.html')
@app.route('/typography')
def typography():
return render_template('styleguide/typography.html')
@app.route('/icons')
def icons():
return render_template('styleguide/icons.html')
@app.route('/layout')
def layout():
return render_template('styleguide/layout.html')
@app.route('/forms')
def forms():
return render_template('styleguide/forms.html')
@app.route('/buttons-and-similar-controls')
def buttons_and_similar_controls():
return render_template('styleguide/buttons_and_similar_controls.html')
@app.route('/tables-and-data-display')
def tables_and_data_display():
return render_template('styleguide/tables_and_data_display.html')
@app.route('/panels-and-callouts')
def panels_and_callouts():
return render_template('styleguide/panels_and_callouts.html')
@app.route('/sticky-panel')
def sticky_panel():
return render_template('styleguide/sticky_panel.html')
@app.route('/dividers')
def dividers():
return render_template('styleguide/dividers.html')
@app.route('/utilities')
def utilities():
return render_template('styleguide/utilities.html')
# Components
@app.route('/breadcrumbs')
def breadcrumbs():
return render_template('styleguide/breadcrumbs.html')
@app.route('/case-list')
def case_list():
return render_template('styleguide/case_list.html')
@app.route('/pagination')
def pagination():
return render_template('styleguide/pagination.html')
@app.route('/search-results')
def search_results():
return render_template('styleguide/search_results.html')
if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
app.run(host='0.0.0.0', port=port, debug=True)
| 25.666667 | 112 | 0.734632 | 298 | 2,310 | 5.506711 | 0.291946 | 0.136502 | 0.182815 | 0.274223 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006391 | 0.119481 | 2,310 | 89 | 113 | 25.955056 | 0.800393 | 0.05974 | 0 | 0 | 0 | 0 | 0.330411 | 0.245962 | 0 | 0 | 0 | 0 | 0 | 1 | 0.241935 | false | 0 | 0.048387 | 0.241935 | 0.532258 | 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 | 1 | 0 | 0 | 5 |
89a73308280c422712abdc545a4b5ff98effa0c0 | 102,074 | py | Python | calfem/core.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | calfem/core.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | calfem/core.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | # -*- coding: iso-8859-15 -*-
"""
CALFEM Core module
Contains all the functions implementing CALFEM standard functionality
"""
from scipy.sparse.linalg import dsolve
import numpy as np
import logging as cflog
def error(msg):
"""Write ``msg`` to error log."""
cflog.error(" calfem.core: "+msg)
def info(msg):
"""Write ``msg`` to info log."""
cflog.info(" calfem.core: "+msg)
def spring1e(ep):
"""
Compute element stiffness matrix for spring element.
:param float ep: spring stiffness or analog quantity (ep = k).
:return mat Ke: stiffness matrix, dim(Ke)= 2 x 2
"""
k = ep
return np.mat([[k,-k],[-k,k]],'d')
def spring1s(ep,ed):
"""
Compute element force in spring element (spring1e).
:param float ep: spring stiffness or analog quantity
:param list ed: element displacements [d0, d1]
:return float es: element force [N]
"""
k = ep
return k*(ed[1]-ed[0]);
def bar1e(ep):
"""
Compute element stiffness matrix for spring element.
:param ep float: spring stiffness or analog quantity
:return mat Ke: stiffness matrix, dim(Ke)= 2 x 2
"""
k = ep
return np.mat([[k,-k],[-k,k]],'d')
def bar1s(ep,ed):
"""
Compute element force in spring element (spring1e).
:param float ep: spring stiffness or analog quantity
:param list ed: element displacements [d0, d1]
:return float es: element force
"""
k = ep
return k*(ed[1]-ed[0]);
def bar2e(ex,ey,ep):
"""
Compute the element stiffness matrix for two dimensional bar element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ep: [E, A]: E - Young's modulus, A - Cross section area
:return mat Ke: stiffness matrix, [4 x 4]
"""
E=ep[0]
A=ep[1]
b = np.mat([[ex[1]-ex[0]],[ey[1]-ey[0]]])
L = np.asscalar(np.sqrt(b.T*b))
Kle = np.mat([[1.,-1.],[-1.,1.]])*E*A/L
n = np.asarray(b.T/L).reshape(2,)
G = np.mat([
[n[0],n[1],0.,0.],
[0.,0.,n[0],n[1]]
])
return G.T*Kle*G
def bar2g(ex,ey,ep,N):
"""
Compute element stiffness matrix for two dimensional geometric
nonlinear bar element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ep: element properties [E, A], E - Young's modulus, A - Cross section area
:param float N: normal force
:return mat Ke: stiffness matrix [4 x 4]
"""
E = ep[0]
A = ep[1]
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(2,)
G = np.mat([
[ n[0], n[1], 0., 0. ],
[-n[1], n[0], 0., 0. ],
[ 0., 0., n[0], n[1]],
[ 0., 0., -n[1], n[0]]
])
Kle = E*A/L*np.mat([
[ 1, 0,-1, 0],
[ 0, 0, 0, 0],
[-1, 0, 1, 0],
[ 0, 0, 0, 0]
])+N/L*np.mat([
[ 0, 0, 0, 0],
[ 0, 1, 0,-1],
[ 0, 0, 0, 0],
[ 0,-1, 0, 1]
])
return G.T*Kle*G
def bar2s(ex,ey,ep,ed):
"""
Compute normal force in two dimensional bar element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ep: element properties [E, A], E - Young's modulus, A - Cross section area
:param list ed: element displacements [u1, u2, u3, u4]
:return float N: element foce [N]
"""
E=ep[0]
A=ep[1]
b = np.mat([[ex[1]-ex[0]],[ey[1]-ey[0]]])
L = np.asscalar(np.sqrt(b.T*b))
#Kle = np.mat([[1.,-1.],[-1.,1.]])*E*A/L
n = np.asarray(b.T/L).reshape(2,)
G = np.mat([
[n[0],n[1],0.,0.],
[0.,0.,n[0],n[1]]
])
u=np.asmatrix(ed).T
N=E*A/L*np.mat([[-1.,1.]])*G*u
return np.asscalar(N)
def bar3e(ex,ey,ez,ep):
"""
Compute element stiffness matrix for three dimensional bar element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ez: element z coordinates [z1, z2]
:param list ep: element properties [E, A], E - Young's modulus, A - Cross section area
:return mat Ke: stiffness matrix, [6 x 6]
"""
E = ep[0]
A = ep[1]
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]],
[ez[1]-ez[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(3)
G = np.mat([
[ n[0], n[1], n[2], 0., 0., 0. ],
[ 0., 0., 0., n[0], n[1], n[2]]
])
Kle = E*A/L*np.mat([
[ 1,-1],
[-1, 1]
])
return G.T*Kle*G
def bar3s(ex,ey,ez,ep,ed):
"""
Compute normal force in three dimensional bar element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ez: element z coordinates [z1, z2]
:param list ep: element properties [E, A], E - Young's modulus, A - Cross section area
:param list ed: element displacements [u1, ..., u6]
:return float N: normal force
"""
E = ep[0]
A = ep[1]
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]],
[ez[1]-ez[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(3)
G = np.mat([
[ n[0], n[1], n[2], 0. , 0. , 0. ],
[ 0. , 0. , 0. , n[0], n[1], n[2]]
])
#Kle = E*A/L*np.mat([
# [ 1,-1],
# [-1, 1]
#])
u = np.asmatrix(ed).T
N = E*A/L*np.mat([[-1.,1.]])*G*u
return np.asscalar(N)
def beam2e(ex,ey,ep,eq=None):
"""
Compute the stiffness matrix for a two dimensional beam element.
:param list ex: element x coordinates [x1, x2]
:param list ey: element y coordinates [y1, y2]
:param list ep: element properties [E, A, I], E - Young's modulus, A - Cross section area, I - Moment of inertia
:param list eq: distributed loads, local directions [qx, qy]
:return mat Ke: element stiffness matrix [6 x 6]
:return mat fe: element stiffness matrix [6 x 1] (if eq!=None)
"""
b=np.mat([[ex[1]-ex[0]],[ey[1]-ey[0]]])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(2,)
E=ep[0]
A=ep[1]
I=ep[2]
qx=0.
qy=0.
if not eq is None:
qx=eq[0]
qy=eq[1]
Kle = np.mat([
[E*A/L, 0., 0., -E*A/L, 0., 0. ],
[ 0., 12*E*I/L**3., 6*E*I/L**2., 0., -12*E*I/L**3., 6*E*I/L**2. ],
[ 0., 6*E*I/L**2., 4*E*I/L, 0., -6*E*I/L**2., 2*E*I/L ],
[-E*A/L, 0., 0., E*A/L, 0., 0. ],
[ 0., -12*E*I/L**3.,-6*E*I/L**2., 0., 12*E*I/L**3.,-6*E*I/L**2. ],
[ 0., 6*E*I/L**2., 2*E*I/L, 0., -6*E*I/L**2., 4*E*I/L ]
])
fle=L*np.mat([qx/2, qy/2, qy*L/12, qx/2, qy/2, -qy*L/12]).T
G=np.mat([
[ n[0], n[1], 0., 0., 0., 0.],
[-n[1], n[0], 0., 0., 0., 0.],
[0., 0., 1., 0., 0., 0.],
[0., 0., 0., n[0], n[1], 0.],
[0., 0., 0., -n[1], n[0], 0.],
[0., 0., 0., 0., 0., 1.]
])
Ke=G.T*Kle*G
fe=G.T*fle
if eq is None:
return Ke
else:
return Ke,fe
def beam2s(ex,ey,ep,ed,eq=None,nep=None):
"""
Compute section forces in two dimensional beam element (beam2e).
Parameters:
ex = [x1 x2]
ey = [y1 y2] element node coordinates
ep = [E A I] element properties,
E: Young's modulus
A: cross section area
I: moment of inertia
ed = [u1 ... u6] element displacements
eq = [qx qy] distributed loads, local directions
nep number of evaluation points ( default=2 )
Returns:
es = [ N1 V1 M1 section forces, local directions, in
N2 V2 M2 n points along the beam, dim(es)= n x 3
.........]
edi = [ u1 v1 element displacements, local directions,
u2 v2 in n points along the beam, dim(es)= n x 2
.......]
eci = [ x1 local x-coordinates of the evaluation
x2 points, (x1=0 and xn=L)
...]
"""
EA=ep[0]*ep[1]
EI=ep[0]*ep[2]
b=np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(2,)
qx=0.
qy=0.
if not eq is None:
qx=eq[0]
qy=eq[1]
ne=2
if nep!=None:
ne = nep
C=np.mat([
[0., 0., 0., 1., 0., 0.],
[0., 0., 0., 0., 0., 1.],
[0., 0., 0., 0., 1., 0.],
[L, 0., 0., 1., 0., 0.],
[0., L**3, L**2, 0., L, 1.],
[0., 3*L**2, 2*L, 0., 1., 0.]
])
G=np.mat([
[ n[0], n[1], 0., 0., 0., 0.],
[-n[1], n[0], 0., 0., 0., 0.],
[0., 0., 1., 0., 0., 0.],
[0., 0., 0., n[0], n[1], 0.],
[0., 0., 0., -n[1], n[0], 0.],
[0., 0., 0., 0., 0., 1.]
])
M=np.ravel(C.I*(G*np.asmatrix(ed).T-np.matrix([0., 0., 0., -qx*L**2/(2*EA), qy*L**4/(24*EI), qy*L**3/(6*EI)]).T))
A=np.matrix([M[0],M[3]]).T
B=np.matrix([M[1],M[2],M[4],M[5]]).T
x=np.asmatrix(np.arange(0.,L+L/(ne-1),L/(ne-1))).T
zero=np.asmatrix(np.zeros([len(x)])).T
one=np.asmatrix(np.ones([len(x)])).T
u=np.concatenate((x,one),1)*A-np.power(x,2)*qx/(2*EA)
du=np.concatenate((one,zero),1)*A-x*qx/EA
v=np.concatenate((np.power(x,3),np.power(x,2),x,one),1)*B+np.power(x,4)*qy/(24*EI)
d2v=np.concatenate((6*x,2*one,zero,zero),1)*B+np.power(x,2)*qy/(2*EI)
d3v=np.concatenate((6*one,zero,zero,zero),1)*B+x*qy/EI
N=EA*du
M=EI*d2v
V=-EI*d3v
edi=np.concatenate((u,v),1)
eci=x
es=np.concatenate((N,V,M),1)
return (es,edi,eci)
def beam2t(ex,ey,ep,eq=None):
"""
Compute the stiffness matrix for a two dimensional elastic
Timoshenko beam element.
Parameters:
ex = [x1 x2]
ey = [y1 y2] element node coordinates
ep = [E G A I ks] element properties
E: Young's modulus
G: Shear modulus
A: Cross section area
I: Moment of inertia
ks: Shear correction factor
eq = [qx qy] distributed loads, local directions
Returns:
Ke element stiffness matrix (6 x 6)
fe element load vector (6 x 1)
"""
b = np.mat([[ex[1]-ex[0]],[ey[1]-ey[0]]])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(2)
E = ep[0]
Gm = ep[1]
A = ep[2]
I = ep[3]
ks = ep[4]
qx = 0.
qy = 0.
if eq != None:
qx = eq[0]
qy = eq[1]
m = (12/L**2)*(E*I/(Gm*A*ks))
Kle = E/(1+m)*np.mat([
[A*(1+m)/L, 0., 0., -A*(1+m)/L, 0., 0. ],
[0., 12*I/L**3., 6*I/L**2., 0., -12*I/L**3., 6*I/L**2. ],
[0., 6*I/L**2., 4*I*(1+m/4.)/L, 0., -6*I/L**2., 2*I*(1-m/2)/L],
[-A*(1+m)/L, 0., 0., A*(1+m)/L, 0., 0. ],
[0., -12*I/L**3.,-6*I/L**2., 0., 12*I/L**3.,-6*I/L**2. ],
[0., 6*I/L**2., 2*I*(1-m/2)/L, 0., -6*I/L**2., 4*I*(1+m/4)/L]
])
fle = L*np.mat([qx/2, qy/2, qy*L/12, qx/2, qy/2, -qy*L/12]).T
G = np.mat([
[ n[0], n[1], 0., 0., 0., 0.],
[-n[1], n[0], 0., 0., 0., 0.],
[ 0., 0., 1., 0., 0., 0.],
[ 0., 0., 0., n[0], n[1], 0.],
[ 0., 0., 0., -n[1], n[0], 0.],
[ 0., 0., 0., 0., 0., 1.]
])
Ke = G.T*Kle*G
fe = G.T*fle
if eq == None:
return Ke
else:
return Ke,fe
def beam2ts(ex,ey,ep,ed,eq=None,np=None):
"""
Compute section forces in two dimensional beam element (beam2e).
Parameters:
ex = [x1, x2]
ey = [y1, y2] element node coordinates
ep = [E,G,A,I,ks] element properties,
E: Young's modulus
G: shear modulus
A: cross section area
I: moment of inertia
ed = [u1, ... ,u6] element displacements
eq = [qx, qy] distributed loads, local directions
n number of evaluation points ( default=2 )
Returns:
es = [[N1,V1,M1], section forces, local directions, in
[N2,V2,M2], n points along the beam, dim(es)= n x 3
..........]
edi = [[u1,v1,teta1], element displacements, local directions,
[u2,v2,teta2], and rotation of cross section at
.............] in n points along the beam, dim(es)= n x 2
(Note! Rotation of the cross section is not equal to dv/dx for Timoshenko beam element)
eci = [[x1], local x-coordinates of the evaluation
[x2], points, (x1=0 and xn=L)
....]
"""
EA = ep[0]*ep[2]
EI = ep[0]*ep[3]
GAK = ep[1]*ep[2]*ep[4]
alfa = EI/GAK
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b.T/L).reshape(2)
qx = 0.
qy = 0.
if eq != None:
qx = eq[0]
qy = eq[1]
ne = 2
if np != None:
ne = np
C = np.mat([
[ 0., 0., 0., 1., 0., 0.],
[ 0., 0., 0., 0., 0., 1.],
[ 0., 6*alfa, 0., 0., 1., 0.],
[ L, 0., 0., 1., 0., 0.],
[ 0., L**3, L**2, 0., L, 1.],
[ 0., 3*(L**2+2*alfa), 2*L, 0., 1., 0.]
])
G = np.mat([
[ n[0], n[1], 0., 0., 0., 0.],
[-n[1], n[0], 0., 0., 0., 0.],
[ 0., 0., 1., 0., 0., 0.],
[ 0., 0., 0., n[0], n[1], 0.],
[ 0., 0., 0.,-n[1], n[0], 0.],
[ 0., 0., 0., 0., 0., 1.]
])
M = np.ravel(C.I*(G*np.asmatrix(ed).T-np.mat([0., 0., 0., -qx*L**2/(2*EA), qy*L**4/(24*EI)-qy*L**2/(2*GAK), qy*L**3/(6*EI)]).T))
C2 = np.mat([M[0], M[3]]).T
C4 = np.mat([M[1], M[2], M[4], M[5]]).T
x = np.asmatrix(np.arange(0., L+L/(ne-1), L/(ne-1))).T
zero = np.asmatrix(np.zeros([len(x)])).T
one = np.asmatrix(np.ones([len(x)])).T
u = np.concatenate((x,one),1)*C2-qx/(2*EA)*np.power(x,2)
du = np.concatenate((one,zero),1)*C2-qx*x/EA
v = np.concatenate((np.power(x,3),np.power(x,2),x,one),1)*C4+qy/(24*EI)*np.np.power(x,4)-qy/(2*GAK)*np.power(x,2)
dv = np.concatenate((3*np.power(x,2),2*x,one,zero),1)*C4+qy*np.power(x,3)/(6*EI)-qy*x/GAK
teta = np.concatenate((3*(np.power(x,2)+2*alfa*one),2*x,one,zero),1)*C4+qy*np.power(x,3)/(6*EI)
dteta = np.concatenate((6*x,2*one,zero,zero),1)*C4+qy*np.power(x,2)/(2*EI)
N = EA*du
M = EI*dteta
V = GAK*(dv-teta)
es = np.concatenate((N,V,M),1)
edi = np.concatenate((u,v,teta),1)
eci = x
if np != None:
return es,edi,eci
else:
return es
def beam2w(ex,ey,ep,eq=None):
"""
Compute the stiffness matrix for a two dimensional beam element
on elastic foundation.
Parameters:
ex = [x1, x2]
ey = [y1, y2] element node coordinates
ep = [E,A,I,ka,kt] element properties,
E: Young's modulus
A: cross section area
I: moment of inertia
ka: axial foundation stiffness
kt: transversal foundation stiffness
eq = [qx, qy] distributed loads, local directions
Returns:
Ke beam stiffness matrix (6 x 6)
fe element load vector (6 x 1)
"""
b = np.mat([[ex[1]-ex[0]],[ey[1]-ey[0]]])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b/L).reshape(2)
E,A,I,ka,kt = ep
qx = 0
qy = 0
if eq != None:
qx,qy = eq
K1 = np.mat([
[ E*A/L, 0, 0, -E*A/L, 0, 0 ],
[ 0, 12*E*I/L**3, 6*E*I/L**2, 0, -12*E*I/L**3, 6*E*I/L**2],
[ 0, 6*E*I/L**2, 4*E*I/L, 0, -6*E*I/L**2, 2*E*I/L ],
[-E*A/L, 0, 0, E*A/L, 0, 0 ],
[ 0, -12*E*I/L**3,-6*E*I/L**2, 0, 12*E*I/L**3,-6*E*I/L**2],
[ 0, 6*E*I/L**2, 2*E*I/L, 0, -6*E*I/L**2, 4*E*I/L ]
])
K2 = L/420*np.mat([
[ 140*ka, 0, 0, 70*ka, 0, 0 ],
[ 0, 156*kt, 22*kt*L, 0, 54*kt, -13*kt*L ],
[ 0, 22*kt*L, 4*kt*L**2, 0, 13*kt*L,-3*kt*L**2],
[ 70*ka, 0, 0, 140*ka, 0, 0 ],
[ 0, 54*kt, 13*kt*L, 0, 156*kt, -22*kt*L ],
[ 0, -13*kt*L,-3*kt*L**2, 0, -22*kt*L, 4*kt*L**2]
])
Kle = K1+K2
fle = L*np.mat([qx/2, qy/2, qy*L/12, qx/2, qy/2, -qy*L/12]).T
G = np.mat([
[ n[0], n[1], 0, 0, 0, 0],
[-n[1], n[0], 0, 0, 0, 0],
[ 0, 0, 1, 0, 0, 0],
[ 0, 0, 0, n[0], n[1], 0],
[ 0, 0, 0,-n[1], n[0], 0],
[ 0, 0, 0, 0, 0, 1]
])
Ke = G.T*Kle*G
fe = G.T*fle
if eq != None:
return Ke,fe
else:
return Ke
def beam2ws(ex,ey,ep,ed,eq=None):
"""
Compute section forces in a two dimensional beam element
on elastic foundation.
Parameters:
ex = [x1, x2]
ey = [y1, y2] element node coordinates
ep = [E,A,I,ka,kt] element properties,
E: Young's modulus
A: cross section area
I: moment of inertia
ka: axial foundation stiffness
kt: transversal foundation stiffness
ed = [u1, ... ,u6] element displacement vector
eq = [qx, qy] distributed loads, local directions
Returns:
es = [[N1, V1, M1],
[N2, V2, M2]] element forces, local direction
"""
if np.asmatrix(ed).shape[0] > 1:
cferror("Only one row is allowed in the ed matrix !!!")
return
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b/L).reshape(2,)
E,A,I,ka,kt = ep
qx = 0
qy = 0
if eq != None:
qx,qy = eq
K1 = np.mat([
[ E*A/L, 0, 0, -E*A/L, 0, 0 ],
[ 0, 12*E*I/L**3, 6*E*I/L**2, 0, -12*E*I/L**3, 6*E*I/L**2],
[ 0, 6*E*I/L**2, 4*E*I/L, 0, -6*E*I/L**2, 2*E*I/L ],
[-E*A/L, 0, 0, E*A/L, 0, 0 ],
[ 0, -12*E*I/L**3,-6*E*I/L**2, 0, 12*E*I/L**3,-6*E*I/L**2],
[ 0, 6*E*I/L**2, 2*E*I/L, 0, -6*E*I/L**2, 4*E*I/L ]
])
K2 = L/420*np.mat([
[ 140*ka, 0, 0, 70*ka, 0, 0 ],
[ 0, 156*kt, 22*kt*L, 0, 54*kt, -13*kt*L ],
[ 0, 22*kt*L, 4*kt*L**2, 0, 13*kt*L,-3*kt*L**2],
[ 70*ka, 0, 0, 140*ka, 0, 0 ],
[ 0, 54*kt, 13*kt*L, 0, 156*kt, -22*kt*L ],
[ 0, -13*kt*L,-3*kt*L**2, 0, -22*kt*L, 4*kt*L**2]
])
Kle = K1+K2
fle = L*np.mat([qx/2, qy/2, qy*L/12, qx/2, qy/2, -qy*L/12]).T
G = np.mat([
[ n[0], n[1], 0, 0, 0, 0],
[-n[1], n[0], 0, 0, 0, 0],
[ 0, 0, 1, 0, 0, 0],
[ 0, 0, 0, n[0], n[1], 0],
[ 0, 0, 0,-n[1], n[0], 0],
[ 0, 0, 0, 0, 0, 1]
])
P = Kle*G*np.asmatrix(ed).T-fle
es = np.mat([
[-P[0,0],-P[1,0],-P[2,0]],
[ P[3,0], P[4,0], P[5,0]]
])
return es
def beam2g(ex,ey,ep,N,eq=None):
"""
Compute the element stiffness matrix for a two dimensional
beam element with respect to geometric nonlinearity.
Parameters:
ex = [x1, x2]
ey = [y1, y2] element node coordinates
ep = [E,A,I] element properties;
E: Young's modulus
A: cross section area
I: moment of inertia
N axial force in the beam
eq distributed transverse load
Returns:
Ke element stiffness matrix (6 x 6)
fe element load vector (6 x 1)
"""
if eq != None:
if np.size(eq) > 1:
cferror("eq should be a scalar !!!")
return
else:
q = eq[0]
else:
q = 0
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b/L).reshape(2,)
E,A,I = ep
rho = -N*L**2/(np.pi**2*E*I)
kL = np.pi*np.sqrt(abs(rho))+np.finfo(float).eps
if rho > 0:
f1 = (kL/2)/np.tan(kL/2)
f2 = (1/12.)*kL**2/(1-f1)
f3 = f1/4+3*f2/4
f4 = -f1/2+3*f2/2
f5 = f1*f2
h = 6*(2/kL**2-(1+np.cos(kL))/(kL*np.sin(kL)))
elif rho < 0:
f1 = (kL/2)/np.tanh(kL/2)
f2 = -(1/12.)*kL**2/(1-f1)
f3 = f1/4+3*f2/4
f4 = -f1/2+3*f2/2
f5 = f1*f2
h = -6*(2/kL**2-(1+np.cosh(kL))/(kL*np.sinh(kL)))
else:
f1 = f2 = f3 = f4 = f5 = h = 1
Kle = np.mat([
[ E*A/L, 0., 0., -E*A/L, 0., 0. ],
[ 0., 12*E*I*f5/L**3., 6*E*I*f2/L**2., 0., -12*E*I*f5/L**3., 6*E*I*f2/L**2.],
[ 0., 6*E*I*f2/L**2., 4*E*I*f3/L, 0., -6*E*I*f2/L**2., 2*E*I*f4/L ],
[-E*A/L, 0., 0., E*A/L, 0., 0. ],
[ 0., -12*E*I*f5/L**3.,-6*E*I*f2/L**2., 0., 12*E*I*f5/L**3.,-6*E*I*f2/L**2.],
[ 0., 6*E*I*f2/L**2., 2*E*I*f4/L, 0., -6*E*I*f2/L**2., 4*E*I*f3/L ]
])
fle = q*L*np.mat([0.,1/2.,L*h/12,0.,1/2.,-L*h/12]).T
G = np.mat([
[ n[0], n[1], 0, 0, 0, 0],
[-n[1], n[0], 0, 0, 0, 0],
[ 0, 0, 1, 0, 0, 0],
[ 0, 0, 0, n[0], n[1], 0],
[ 0, 0, 0,-n[1], n[0], 0],
[ 0, 0, 0, 0, 0, 1]
])
Ke = G.T*Kle*G
fe = G.T*fle
if eq != None:
return Ke,fe
else:
return Ke
def beam2gs(ex,ey,ep,ed,N,eq=None):
"""
Calculate section forces in a two dimensional nonlinear
beam element.
Parameters:
ex = [x1, x2]
ey = [y1, y2] element node coordinates
ep = [E,A,I] element properties;
E: Young's modulus
A: cross section area
I: moment of inertia
ed = [u1, ... ,u6] element displacement vector
N axial force
eq = [qy] distributed transverse load
Returns:
es = [[N1,V1,M1], element forces, local directions
[N2,V2,M2]]
"""
if eq != None:
eq = eq[0]
else:
eq = 0
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b/L).reshape(2,)
E,A,I = ep
rho = -N*L**2/(np.pi**2*E*I)
eps = 2.2204e-16
kL = np.pi*np.sqrt(abs(rho))+eps
if rho > 0:
f1 = (kL/2)/np.tan(kL/2)
f2 = (1/12.)*kL**2/(1-f1)
f3 = f1/4+3*f2/4
f4 = -f1/2+3*f2/2
f5 = f1*f2
h = 6*(2/kL**2-(1+np.cos(kL))/(kL*np.sin(kL)))
elif rho < 0:
f1 = (kL/2)/np.tanh(kL/2)
f2 = -(1/12.)*kL**2/(1-f1)
f3 = f1/4+3*f2/4
f4 = -f1/2+3*f2/2
f5 = f1*f2
h = -6*(2/kL**2-(1+np.cosh(kL))/(kL*np.sinh(kL)))
else:
f1 = f2 = f3 = f4 = f5 = h = 1
Kle = np.mat([
[ E*A/L, 0, 0, -E*A/L, 0, 0 ],
[ 0, 12*E*I*f5/L**3, 6*E*I*f2/L**2, 0, -12*E*I*f5/L**3, 6*E*I*f2/L**2],
[ 0, 6*E*I*f2/L**2, 4*E*I*f3/L, 0, -6*E*I*f2/L**2, 2*E*I*f4/L ],
[-E*A/L, 0, 0, E*A/L, 0, 0 ],
[ 0, -12*E*I*f5/L**3,-6*E*I*f2/L**2, 0, 12*E*I*f5/L**3,-6*E*I*f2/L**2],
[ 0, 6*E*I*f2/L**2, 2*E*I*f4/L, 0, -6*E*I*f2/L**2, 4*E*I*f3/L ]
])
fle = eq*L*np.mat([0,1/2.,L*h/12,0,1/2.,-L*h/12]).T
G = np.mat([
[ n[0], n[1], 0, 0, 0, 0],
[-n[1], n[0], 0, 0, 0, 0],
[ 0, 0, 1, 0, 0, 0],
[ 0, 0, 0, n[0], n[1], 0],
[ 0, 0, 0,-n[1], n[0], 0],
[ 0, 0, 0, 0, 0, 1]
])
u = np.asmatrix(ed).T
P = Kle*G*u-fle
es = np.mat([
[-P[0,0],-P[1,0],-P[2,0]],
[ P[3,0], P[4,0], P[5,0]]
])
return es
def beam2d(ex,ey,ep):
"""
Calculate the stiffness matrix Ke, the mass matrix Me
and the damping matrix Ce for a 2D elastic Bernoulli
beam element.
Parameters:
ex = [x1, x2]
ey = [y1, y2] element node coordinates
ep = [E,A,I,m,(a,b)] element properties;
E: Young's modulus
A: cross section area
I: moment of inertia
m: mass per unit length
a,b: damping coefficients,
Ce=aMe+bKe
Returns:
Ke element stiffness matrix (6 x 6)
Me element mass martix
Ce element damping matrix, optional
"""
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n = np.asarray(b/L).reshape(2,)
a = 0
b = 0
if np.size(ep) == 4:
E,A,I,m = ep
elif np.size(ep) == 6:
E,A,I,m,a,b = ep
Kle = np.mat([
[ E*A/L, 0, 0, -E*A/L, 0, 0 ],
[ 0, 12*E*I/L**3, 6*E*I/L**2, 0, -12*E*I/L**3, 6*E*I/L**2],
[ 0, 6*E*I/L**2, 4*E*I/L, 0, -6*E*I/L**2, 2*E*I/L ],
[-E*A/L, 0, 0, E*A/L, 0, 0 ],
[ 0, -12*E*I/L**3,-6*E*I/L**2, 0, 12*E*I/L**3,-6*E*I/L**2],
[ 0, 6*E*I/L**2, 2*E*I/L, 0, -6*E*I/L**2, 4*E*I/L ]
])
Mle = m*L/420*np.mat([
[ 140, 0, 0, 70, 0, 0 ],
[ 0, 156, 22*L, 0, 54, -13*L ],
[ 0, 22*L, 4*L**2, 0, 13*L,-3*L**2],
[ 70, 0, 0, 140, 0, 0 ],
[ 0, 54, 13*L, 0, 156, -22*L ],
[ 0, -13*L,-3*L**2, 0, -22*L, 4*L**2]
])
Cle = a*Mle+b*Kle
G = np.mat([
[ n[0], n[1], 0, 0, 0, 0],
[-n[1], n[0], 0, 0, 0, 0],
[ 0, 0, 1, 0, 0, 0],
[ 0, 0, 0, n[0], n[1], 0],
[ 0, 0, 0,-n[1], n[0], 0],
[ 0, 0, 0, 0, 0, 1]
])
Ke = G.T*Kle*G
Me = G.T*Mle*G
Ce = G.T*Cle*G
if np.size(ep) == 4:
return Ke,Me
elif np.size(ep) == 6:
return Ke,Me,Ce
def beam3e(ex,ey,ez,eo,ep,eq=None):
"""
Calculate the stiffness matrix for a 3D elastic Bernoulli
beam element.
Parameters:
ex = [x1 x2]
ey = [y1 y2]
ez = [z1 z2] element node coordinates
eo = [xz yz zz] orientation of local z axis
ep = [E G A Iy Iz Kv] element properties
E: Young's modulus
G: Shear modulus
A: Cross section area
Iy: Moment of inertia, local y-axis
Iz: Moment of inertia, local z-axis
Kv: Saint-Venant's torsion constant
eq = [qx qy qz qw] distributed loads
Returns:
Ke beam stiffness matrix (12 x 12)
fe equivalent nodal forces (12 x 1)
"""
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]],
[ez[1]-ez[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n1 = np.asarray(b.T/L).reshape(3,)
eo = np.asmatrix(eo)
lc = np.asscalar(np.sqrt(eo*eo.T))
n3 = np.asarray(eo/lc).reshape(3,)
E,Gs,A,Iy,Iz,Kv = ep
qx = 0.
qy = 0.
qz = 0.
qw = 0.
if eq != None:
qx,qy,qz,qw = eq
a = E*A/L
b = 12*E*Iz/L**3
c = 6*E*Iz/L**2
d = 12*E*Iy/L**3
e = 6*E*Iy/L**2
f = Gs*Kv/L
g = 2*E*Iy/L
h = 2*E*Iz/L
Kle = np.mat([
[ a, 0, 0, 0, 0, 0, -a, 0, 0, 0, 0, 0 ],
[ 0, b, 0, 0, 0, c, 0,-b, 0, 0, 0, c ],
[ 0, 0, d, 0,-e, 0, 0, 0,-d, 0,-e, 0 ],
[ 0, 0, 0, f, 0, 0, 0, 0, 0,-f, 0, 0 ],
[ 0, 0,-e, 0, 2*g, 0, 0, 0, e, 0, g, 0 ],
[ 0, c, 0, 0, 0, 2*h, 0,-c, 0, 0, 0, h ],
[-a, 0, 0, 0, 0, 0, a, 0, 0, 0, 0, 0 ],
[ 0,-b, 0, 0, 0, -c, 0, b, 0, 0, 0, -c ],
[ 0, 0,-d, 0, e, 0, 0, 0, d, 0, e, 0 ],
[ 0, 0, 0,-f, 0, 0, 0, 0, 0, f, 0, 0 ],
[ 0, 0,-e, 0, g, 0, 0, 0, e, 0, 2*g, 0 ],
[ 0, c, 0, 0, 0, h, 0,-c, 0, 0, 0, 2*h]
])
fle = L/2*np.mat([qx, qy, qz, qw, -qz*L/6, qy*L/6, qx, qy, qz, qw, qz*L/6, -qy*L/6]).T
n2 = np.array([0.,0.,0.])
n2[0] = n3[1]*n1[2]-n3[2]*n1[1]
n2[1] = -n1[2]*n3[0]+n1[0]*n3[2]
n2[2] = n3[0]*n1[1]-n1[0]*n3[1]
#An = np.append([n1,n2],[n3],0)
G = np.mat([
[ n1[0], n1[1], n1[2], 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ n2[0], n2[1], n2[2], 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ n3[0], n3[1], n3[2], 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, n1[0], n1[1], n1[2], 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, n2[0], n2[1], n2[2], 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, n3[0], n3[1], n3[2], 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, n1[0], n1[1], n1[2], 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, n2[0], n2[1], n2[2], 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, n3[0], n3[1], n3[2], 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, n1[0], n1[1], n1[2]],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, n2[0], n2[1], n2[2]],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, n3[0], n3[1], n3[2]]
])
Ke = G.T*Kle*G
fe = G.T*fle
if eq == None:
return Ke
else:
return Ke,fe
def beam3s(ex,ey,ez,eo,ep,ed,eq=None,n=None):
"""
Calculate the variation of the section forces and displacements
along a three-dimensional beam element.
Parameters:
ex = [x1 x2] element node coordinates
ey = [y1 y2]
ez = [z1 z2]
eo = [xz yz zz] orientation of local z axis
ep = [E G A Iy Iz Kv] element properties
E: Young's modulus
G: Shear modulus
A: Cross section area
Iy: Moment of inertia, local y-axis
Iz: Moment of inertia, local z-axis
Kv: Saint-Venant's torsion constant
ed the element displacement vector from the
global coordinate system
eq = [qx qy qz qw] the disibuted axial, transversal and
torsional loads
n the number of point in which displacements
and section forces are to be computed
Returns:
es = [[N1,Vy1,Vz1,T1,My1,Mz1], section forces in n points along
[N2,Vy2,Vz2,T2,My2,Mz2], the local x-axis
[..,...,...,..,...,...],
[Nn,Vyn,Vzn,Tn,Myn,Mzn]]
edi = [[u1,v1,w1,fi1], displacements in n points along
[u2,v2,w2,fi2], the local x-axis
[..,..,..,...],
[un,vn,wn,fin]]
eci = [[x1], local x-coordinates of the evaluation
[x2], points
[..],
[xn]]
"""
b = np.mat([
[ex[1]-ex[0]],
[ey[1]-ey[0]],
[ez[1]-ez[0]]
])
L = np.asscalar(np.sqrt(b.T*b))
n1 = np.asarray(b.T/L).reshape(3,)
eo = np.asmatrix(eo)
lc = np.asscalar(np.sqrt(eo*eo.T))
n3 = np.asarray(eo/lc).reshape(3,)
EA = ep[0]*ep[2]
EIy = ep[0]*ep[3]
EIz = ep[0]*ep[4]
GKv = ep[1]*ep[5]
qx = 0.
qy = 0.
qz = 0.
qw = 0.
if eq != None:
qx,qy,qz,qw = eq
ne = 2
if n != None:
ne = n
n2 = np.array([0.,0.,0.])
n2[0] = n3[1]*n1[2]-n3[2]*n1[1]
n2[1] = -n1[2]*n3[0]+n1[0]*n3[2]
n2[2] = n3[0]*n1[1]-n1[0]*n3[1]
G = np.mat([
[ n1[0], n1[1], n1[2], 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ n2[0], n2[1], n2[2], 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ n3[0], n3[1], n3[2], 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, n1[0], n1[1], n1[2], 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, n2[0], n2[1], n2[2], 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, n3[0], n3[1], n3[2], 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, n1[0], n1[1], n1[2], 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, n2[0], n2[1], n2[2], 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, n3[0], n3[1], n3[2], 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, n1[0], n1[1], n1[2]],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, n2[0], n2[1], n2[2]],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, n3[0], n3[1], n3[2]]
])
u = G*np.asmatrix(ed).T-np.array([ # u is the local element displacement
[ 0 ], # vector minus the particular solution
[ 0 ], # to the beam's diff.eq:s
[ 0 ],
[ 0 ],
[ 0 ],
[ 0 ],
[-qx*L**2/(2*EA) ],
[ qy*L**4/(24*EIz)],
[ qz*L**4/(24*EIy)],
[-qw*L**2/(2*GKv) ],
[-qz*L**3/(6*EIy) ],
[ qy*L**3/(6*EIz) ]
])
C = np.mat([
[ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[ 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0],
[ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
[ L, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
[ 0, 0, L**3, L**2, L, 1, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, L**3, L**2, L, 1, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L, 1],
[ 0, 0, 0, 0, 0, 0,-3*L**2,-2*L, -1, 0, 0, 0],
[ 0, 0, 3*L**2, 2*L, 1, 0, 0, 0, 0, 0, 0, 0],
])
m = np.linalg.inv(C)*u
eci = np.zeros((ne,1))
es = np.zeros((ne,6))
edi = np.zeros((ne,4))
for i in np.arange(ne):
x = i*L/(ne-1)
eci[i,0] = x
es[i,:] = (np.mat([
[ EA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0,-6*EIz, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0,-6*EIy, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, GKv, 0],
[ 0, 0, 0, 0, 0, 0,-6*EIy*x,-2*EIy, 0, 0, 0, 0],
[ 0, 0, 6*EIz*x, 2*EIz, 0, 0, 0, 0, 0, 0, 0, 0]
])*m+np.array([-qx*x,-qy*x,-qz*x,-qw*x,-qz*x**2/2,qy*x**2/2]).reshape(6,1)).T
edi[i,:] = (np.mat([
[ x, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, x**3, x**2, x, 1, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, x**3, x**2, x, 1, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, x, 1]
])*m+np.array([-qx*x**2/(2*EA),qy*x**4/(24*EIz),qz*x**4/(24*EIy),-qw*x**2/(2*GKv)]).reshape(4,1)).T
if n == None:
return es
else:
return es,edi,eci
def flw2te(ex,ey,ep,D,eq=None):
"""
Compute element stiffness (conductivity) matrix for a triangular field element.
Parameters:
ex = [x1 x2 x3]
ey = [y1 y2 y3] element coordinates
ep = [t] element thickness
D = [kxx kxy;
kyx kyy] constitutive matrix
eq heat supply per unit volume
Returns:
Ke element 'stiffness' matrix (3 x 3)
fe element load vector (3 x 1)
"""
t=ep[0];
if eq==None:
eq=0.
exm = np.asmatrix(ex)
eym = np.asmatrix(ey)
C=np.asmatrix(np.hstack([np.ones((3,1)),exm.T,eym.T]))
B=np.matrix([
[0.,1.,0.],
[0.,0.,1.]
])*C.I
A=0.5*np.linalg.det(C)
Ke=B.T*D*B*t*A
fe=np.matrix([[1.,1.,1.]]).T*eq*A*t/3
if eq==0.:
return Ke
else:
return Ke, fe
def flw2ts(ex,ey,D,ed):
"""
Compute flows or corresponding quantities in the triangular field element.
Parameters:
ex = [x1 x2 x3]
ey = [y1 y2 y3] element coordinates
D = [kxx kxy
kyx kyy] constitutive matrix
ed =[u1 u2 u3] u1,u2,u3: nodal values
.. .. ..;
Returns:
es=[ qx qy ]
... ..] element flows
et=[ gx gy ]
... ..] element gradients
"""
if len(ex.shape)>1:
qs = np.zeros([ex.shape[0],2])
qt = np.zeros([ex.shape[0],2])
row = 0
for exr, eyr, edr in zip(ex, ey, ed):
exm = np.asmatrix(exr)
eym = np.asmatrix(eyr)
edm = np.asmatrix(edr)
C=np.asmatrix(np.hstack([np.ones((3,1)),exm.T,eym.T]))
B=np.matrix([
[0.,1.,0.],
[0.,0.,1.]
])*C.I
qs[row,:]=(-D*B*edm.T).T
qt[row,:]=(B*edm.T).T
row += 1
return qs, qt
else:
exm = np.asmatrix(ex)
eym = np.asmatrix(ey)
edm = np.asmatrix(ed)
C=np.asmatrix(np.hstack([np.ones((3,1)),exm.T,eym.T]))
B=np.matrix([
[0.,1.,0.],
[0.,0.,1.]
])*C.I
qs=-D*B*edm.T
qt=B*edm.T
return qs.T, qt.T
def flw2qe(ex,ey,ep,D,eq=None):
"""
Compute element stiffness (conductivity) matrix for a triangular field element.
Parameters:
ex = [x1, x2, x3, x4]
ey = [y1, y2, y3, y4] element coordinates
ep = [t] element thickness
D = [[kxx, kxy],
[kyx, kyy]] constitutive matrix
eq heat supply per unit volume
Returns:
Ke element 'stiffness' matrix (4 x 4)
fe element load vector (4 x 1)
"""
xc = sum(ex)/4.
yc = sum(ey)/4.
K = np.zeros((5,5))
f = np.zeros((5,1))
if eq == None:
k1 = flw2te([ex[0],ex[1],xc],[ey[0],ey[1],yc],ep,D)
K = assem(np.array([1,2,5]),K,k1)
k1 = flw2te([ex[1],ex[2],xc],[ey[1],ey[2],yc],ep,D)
K = assem(np.array([2,3,5]),K,k1)
k1 = flw2te([ex[2],ex[3],xc],[ey[2],ey[3],yc],ep,D)
K = assem(np.array([3,4,5]),K,k1)
k1 = flw2te([ex[3],ex[0],xc],[ey[3],ey[0],yc],ep,D)
K = assem(np.array([4,1,5]),K,k1)
else:
k1,f1 = flw2te([ex[0],ex[1],xc],[ey[0],ey[1],yc],ep,D,eq)
K,f = assem(np.array([1,2,5]),K,k1,f,f1)
k1,f1 = flw2te([ex[1],ex[2],xc],[ey[1],ey[2],yc],ep,D,eq)
K,f = assem(np.array([2,3,5]),K,k1,f,f1)
k1,f1 = flw2te([ex[2],ex[3],xc],[ey[2],ey[3],yc],ep,D,eq)
K,f = assem(np.array([3,4,5]),K,k1,f,f1)
k1,f1 = flw2te([ex[3],ex[0],xc],[ey[3],ey[0],yc],ep,D,eq)
K,f = assem(np.array([4,1,5]),K,k1,f,f1)
Ke1,fe1 = statcon(K,f,np.array([5]));
Ke = Ke1
fe = fe1
if eq == None:
return Ke
else:
return Ke,fe
def flw2qs(ex,ey,ep,D,ed,eq=None):
"""
Compute flows or corresponding quantities in the
quadrilateral field element.
Parameters:
ex = [x1, x2, x3, x4]
ey = [y1, y2, y3, y4] element coordinates
ep = [t] element thickness
D = [[kxx, kxy],
[kyx, kyy]] constitutive matrix
ed = [[u1, u2, u3, u4],
[.., .., .., ..]] u1,u2,u3,u4: nodal values
eq heat supply per unit volume
Returns:
es = [[qx, qy],
[.., ..]] element flows
et = [[gx, gy],
[.., ..]] element gradients
"""
K = np.zeros((5,5))
f = np.zeros((5,1))
xm = sum(ex)/4
ym = sum(ey)/4
if eq == None:
q = 0
else:
q = eq
En = np.array([
[1,2,5],
[2,3,5],
[3,4,5],
[4,1,5]
])
ex1 = np.array([ex[0],ex[1],xm])
ey1 = np.array([ey[0],ey[1],ym])
ex2 = np.array([ex[1],ex[2],xm])
ey2 = np.array([ey[1],ey[2],ym])
ex3 = np.array([ex[2],ex[3],xm])
ey3 = np.array([ey[2],ey[3],ym])
ex4 = np.array([ex[3],ex[0],xm])
ey4 = np.array([ey[3],ey[0],ym])
if eq == None:
k1 = flw2te(ex1,ey1,ep,D)
K = assem(En[0],K,k1)
k1 = flw2te(ex2,ey2,ep,D)
K = assem(En[1],K,k1)
k1 = flw2te(ex3,ey3,ep,D)
K = assem(En[2],K,k1)
k1 = flw2te(ex4,ey4,ep,D)
K = assem(En[3],K,k1)
else:
k1,f1 = flw2te(ex1,ey1,ep,D,q)
K,f = assem(En[0],K,k1,f,f1)
k1,f1 = flw2te(ex2,ey2,ep,D,q)
K,f = assem(En[1],K,k1,f,f1)
k1,f1 = flw2te(ex3,ey3,ep,D,q)
K,f = assem(En[2],K,k1,f,f1)
k1,f1 = flw2te(ex4,ey4,ep,D,q)
K,f = assem(En[3],K,k1,f,f1)
if ed.ndim==1:
ed = np.array([ed])
ni,nj = np.shape(ed)
a = np.zeros((5,ni))
for i in range(ni):
a[np.ix_(range(5),[i])],r = np.asarray(solveq(K,f,np.arange(1,5),ed[i]))
s1,t1 = flw2ts(ex1,ey1,D,a[np.ix_(En[0,:]-1,np.arange(ni))].T)
s2,t2 = flw2ts(ex2,ey2,D,a[np.ix_(En[1,:]-1,np.arange(ni))].T)
s3,t3 = flw2ts(ex3,ey3,D,a[np.ix_(En[2,:]-1,np.arange(ni))].T)
s4,t4 = flw2ts(ex4,ey4,D,a[np.ix_(En[3,:]-1,np.arange(ni))].T)
es = (s1+s2+s3+s4)/4.
et = (t1+t2+t3+t4)/4.
return es,et
def flw2i4e(ex,ey,ep,D,eq=None):
"""
Compute element stiffness (conductivity)
matrix for 4 node isoparametric field element
Parameters:
ex = [x1 x2 x3 x4] element coordinates
ey = [y1 y2 y3 y4]
ep = [t ir] thickness and integration rule
D = [[kxx kxy],
[kyx kyy]] constitutive matrix
eq heat supply per unit volume
Returns:
Ke element 'stiffness' matrix (4 x 4)
fe element load vector (4 x 1)
"""
t = ep[0]
ir = ep[1]
ngp = ir*ir
if eq == None:
q = 0
else:
q = eq
if ir == 1:
g1 = 0.0
w1 = 2.0
gp = np.mat([g1,g1])
w = np.mat([w1,w1])
elif ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-g1,-g1],
[ g1,-g1],
[-g1, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w1, w1],
[ w1, w1],
[ w1, w1]
])
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat([
[-g1,-g1],
[-g2,-g1],
[ g1,-g1],
[-g1, g2],
[ g2, g2],
[ g1, g2],
[-g1, g1],
[ g2, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w2, w1],
[ w1, w1],
[ w1, w2],
[ w2, w2],
[ w1, w2],
[ w1, w1],
[ w2, w1],
[ w1, w1]
])
else:
cfinfo("Used number of integration points not implemented")
wp = np.multiply(w[:,0],w[:,1])
xsi = gp[:,0]
eta = gp[:,1]
r2 = ngp*2
N = np.multiply((1-xsi),(1-eta))/4.
N = np.append(N,np.multiply((1+xsi),(1-eta))/4.,axis=1)
N = np.append(N,np.multiply((1+xsi),(1+eta))/4.,axis=1)
N = np.append(N,np.multiply((1-xsi),(1+eta))/4.,axis=1)
dNr = np.mat(np.zeros((r2,4)))
dNr[0:r2:2,0] = -(1-eta)/4.
dNr[0:r2:2,1] = (1-eta)/4.
dNr[0:r2:2,2] = (1+eta)/4.
dNr[0:r2:2,3] = -(1+eta)/4.
dNr[1:r2+1:2,0] = -(1-xsi)/4.
dNr[1:r2+1:2,1] = -(1+xsi)/4.
dNr[1:r2+1:2,2] = (1+xsi)/4.
dNr[1:r2+1:2,3] = (1-xsi)/4.
Ke1 = np.mat(np.zeros((4,4)))
fe1 = np.mat(np.zeros((4,1)))
JT = dNr*np.mat([ex,ey]).T
for i in range(ngp):
indx = np.array([2*(i+1)-1,2*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobi determinant == 0")
JTinv = np.linalg.inv(JT[indx-1,:])
B = JTinv*dNr[indx-1,:]
Ke1 = Ke1+B.T*D*B*detJ*np.asscalar(wp[i])
fe1 = fe1+N[i,:].T*detJ*wp[i]
if eq == None:
return Ke1*t
else:
return Ke1*t,fe1*t*eq
def flw2i4s(ex,ey,ep,D,ed):
"""
Compute flows or corresponding quantities in the
4 node isoparametric element.
Parameters:
ex = [x1 x2 x3 x4] element coordinates
ey = [y1 y2 y3 y4]
ep = [t ir] thickness and integration rule
D = [[kxx kxy],
[kyx kyy]] constitutive matrix
ed = [u1, u2, u3, u4] u1,u2,u3,u4: nodal values
Returns:
es = [[qx, qy],
[.., ..]] element flows
et = [[qx, qy],
[... ..]] element gradients
eci=[[ix1, iy1], Gauss point location vector
[... ...], nint: number of integration points
[ix(nint), iy(nint)]
"""
t = ep[0]
ir = ep[1]
ngp = ir*ir
if ir == 1:
g1 = 0.0
w1 = 2.0
gp = np.mat([g1,g1])
w = np.mat([w1,w1])
elif ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-g1,-g1],
[ g1,-g1],
[-g1, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w1, w1],
[ w1, w1],
[ w1, w1]
])
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat([
[-g1,-g1],
[-g2,-g1],
[ g1,-g1],
[-g1, g2],
[ g2, g2],
[ g1, g2],
[-g1, g1],
[ g2, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w2, w1],
[ w1, w1],
[ w1, w2],
[ w2, w2],
[ w1, w2],
[ w1, w1],
[ w2, w1],
[ w1, w1]
])
else:
cfinfo("Used number of integration points not implemented")
wp = np.multiply(w[:,0],w[:,1])
xsi = gp[:,0]
eta = gp[:,1]
r2 = ngp*2
N = np.multiply((1-xsi),(1-eta))/4.
N = np.append(N,np.multiply((1+xsi),(1-eta))/4.,axis=1)
N = np.append(N,np.multiply((1+xsi),(1+eta))/4.,axis=1)
N = np.append(N,np.multiply((1-xsi),(1+eta))/4.,axis=1)
dNr = np.mat(np.zeros((r2,4)))
dNr[0:r2:2,0] = -(1-eta)/4.
dNr[0:r2:2,1] = (1-eta)/4.
dNr[0:r2:2,2] = (1+eta)/4.
dNr[0:r2:2,3] = -(1+eta)/4.
dNr[1:r2+1:2,0] = -(1-xsi)/4.
dNr[1:r2+1:2,1] = -(1+xsi)/4.
dNr[1:r2+1:2,2] = (1+xsi)/4.
dNr[1:r2+1:2,3] = (1-xsi)/4.
eci = N*np.mat([ex,ey]).T
if ed.ndim == 1:
ed = np.array([ed])
red,ced = np.shape(ed)
JT = dNr*np.mat([ex,ey]).T
es = np.mat(np.zeros((ngp*red,2)))
et = np.mat(np.zeros((ngp*red,2)))
for i in range(ngp):
indx = np.array([2*(i+1)-1,2*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobi determinatn == 0")
JTinv = np.linalg.inv(JT[indx-1,:])
B = JTinv*dNr[indx-1,:]
p1 = -D*B*ed.T
p2 = B*ed.T
es[i:ngp*red:ngp,:] = p1.T
et[i:ngp*red:ngp,:] = p2.T
return es,et,eci
def flw2i8e(ex,ey,ep,D,eq=None):
"""
Compute element stiffness (conductivity)
matrix for 8 node isoparametric field element.
Parameters:
ex = [x1, ..., x8] element coordinates
ey = [y1, ..., y8]
ep = [t, ir] thickness and integration rule
D = [[kxx, kxy],
[kyx, kyy]] constitutive matrix
eq heat supply per unit volume
Returns:
Ke element 'stiffness' matrix (8 x 8)
fe element load vector (8 x 1)
"""
t = ep[0]
ir = ep[1]
ngp = ir*ir
if eq == None:
q = 0
else:
q = eq
if ir == 1:
g1 = 0.0
w1 = 2.0
gp = np.mat([g1,g1])
w = np.mat([w1,w1])
elif ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-g1,-g1],
[ g1,-g1],
[-g1, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w1, w1],
[ w1, w1],
[ w1, w1]
])
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat([
[-g1,-g1],
[-g2,-g1],
[ g1,-g1],
[-g1, g2],
[ g2, g2],
[ g1, g2],
[-g1, g1],
[ g2, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w2, w1],
[ w1, w1],
[ w1, w2],
[ w2, w2],
[ w1, w2],
[ w1, w1],
[ w2, w1],
[ w1, w1]
])
else:
cfinfo("Used number of integration points not implemented")
wp = np.multiply(w[:,0],w[:,1])
xsi = gp[:,0]
eta = gp[:,1]
r2 = ngp*2
N = np.multiply(np.multiply(-(1-xsi),(1-eta)),(1+xsi+eta))/4.
N = np.append(N,np.multiply(np.multiply(-(1+xsi),(1-eta)),(1-xsi+eta))/4.,axis=1)
N = np.append(N,np.multiply(np.multiply(-(1+xsi),(1+eta)),(1-xsi-eta))/4.,axis=1)
N = np.append(N,np.multiply(np.multiply(-(1-xsi),(1+eta)),(1+xsi-eta))/4.,axis=1)
N = np.append(N,np.multiply((1-np.multiply(xsi,xsi)),(1-eta))/2.,axis=1)
N = np.append(N,np.multiply((1+xsi),(1-np.multiply(eta,eta)))/2.,axis=1)
N = np.append(N,np.multiply((1-np.multiply(xsi,xsi)),(1+eta))/2.,axis=1)
N = np.append(N,np.multiply((1-xsi),(1-np.multiply(eta,eta)))/2.,axis=1)
dNr = np.mat(np.zeros((r2,8)))
dNr[0:r2:2,0] = -(-np.multiply((1-eta),(1+xsi+eta))+np.multiply((1-xsi),(1-eta)))/4.
dNr[0:r2:2,1] = -(np.multiply((1-eta),(1-xsi+eta))-np.multiply((1+xsi),(1-eta)))/4.
dNr[0:r2:2,2] = -(np.multiply((1+eta),(1-xsi-eta))-np.multiply((1+xsi),(1+eta)))/4.
dNr[0:r2:2,3] = -(-np.multiply((1+eta),(1+xsi-eta))+np.multiply((1-xsi),(1+eta)))/4.
dNr[0:r2:2,4] = -np.multiply(xsi,(1-eta))
dNr[0:r2:2,5] = (1-np.multiply(eta,eta))/2.
dNr[0:r2:2,6] = -np.multiply(xsi,(1+eta))
dNr[0:r2:2,7] = -(1-np.multiply(eta,eta))/2.
dNr[1:r2+1:2,0] = -(-np.multiply((1-xsi),(1+xsi+eta))+np.multiply((1-xsi),(1-eta)))/4.
dNr[1:r2+1:2,1] = -(-np.multiply((1+xsi),(1-xsi+eta))+np.multiply((1+xsi),(1-eta)))/4.
dNr[1:r2+1:2,2] = -(np.multiply((1+xsi),(1-xsi-eta))-np.multiply((1+xsi),(1+eta)))/4.
dNr[1:r2+1:2,3] = -(np.multiply((1-xsi),(1+xsi-eta))-np.multiply((1-xsi),(1+eta)))/4.
dNr[1:r2+1:2,4] = -(1-np.multiply(xsi,xsi))/2.
dNr[1:r2+1:2,5] = -np.multiply(eta,(1+xsi))
dNr[1:r2+1:2,6] = (1-np.multiply(xsi,xsi))/2.
dNr[1:r2+1:2,7] = -np.multiply(eta,(1-xsi))
Ke1 = np.mat(np.zeros((8,8)))
fe1 = np.mat(np.zeros((8,1)))
JT = dNr*np.mat([ex,ey]).T
for i in range(ngp):
indx = np.array([2*(i+1)-1,2*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobideterminanten lika med noll!")
JTinv = np.linalg.inv(JT[indx-1,:])
B = JTinv*dNr[indx-1,:]
Ke1 = Ke1+B.T*D*B*detJ*np.asscalar(wp[i])
fe1 = fe1+N[i,:].T*detJ*wp[i]
if eq != None:
return Ke1*t,fe1*t*q
else:
return Ke1*t
def flw2i8s(ex,ey,ep,D,ed):
"""
Compute flows or corresponding quantities in the
8 node isoparametric element.
Parameters:
ex = [x1,x2,x3....,x8] element coordinates
ey = [y1,y2,y3....,y8]
ep = [t,ir] thickness and integration rule
D = [[kxx,kxy],
[kyx,kyy]] constitutive matrix
ed = [u1,....,u8] u1,....,u8: nodal values
Returns:
es = [[qx,qy],
[..,..]] element flows
et = [[qx,qy],
[..,..]] element gradients
eci=[[ix1,iy1], Gauss point location vector
[...,...], nint: number of integration points
[ix(nint),iy(nint)]]
"""
t = ep[0]
ir = ep[1]
ngp = ir*ir
if ir == 1:
g1 = 0.0
w1 = 2.0
gp = np.mat([g1,g1])
w = np.mat([w1,w1])
elif ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-g1,-g1],
[ g1,-g1],
[-g1, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w1, w1],
[ w1, w1],
[ w1, w1]
])
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat([
[-g1,-g1],
[-g2,-g1],
[ g1,-g1],
[-g1, g2],
[ g2, g2],
[ g1, g2],
[-g1, g1],
[ g2, g1],
[ g1, g1]
])
w = np.mat([
[ w1, w1],
[ w2, w1],
[ w1, w1],
[ w1, w2],
[ w2, w2],
[ w1, w2],
[ w1, w1],
[ w2, w1],
[ w1, w1]
])
else:
cfinfo("Used number of integration points not implemented")
wp = np.multiply(w[:,0],w[:,1])
xsi = gp[:,0]
eta = gp[:,1]
r2 = ngp*2
N = np.multiply(np.multiply(-(1-xsi),(1-eta)),(1+xsi+eta))/4.
N = np.append(N,np.multiply(np.multiply(-(1+xsi),(1-eta)),(1-xsi+eta))/4.,axis=1)
N = np.append(N,np.multiply(np.multiply(-(1+xsi),(1+eta)),(1-xsi-eta))/4.,axis=1)
N = np.append(N,np.multiply(np.multiply(-(1-xsi),(1+eta)),(1+xsi-eta))/4.,axis=1)
N = np.append(N,np.multiply((1-np.multiply(xsi,xsi)),(1-eta))/2.,axis=1)
N = np.append(N,np.multiply((1+xsi),(1-np.multiply(eta,eta)))/2.,axis=1)
N = np.append(N,np.multiply((1-np.multiply(xsi,xsi)),(1+eta))/2.,axis=1)
N = np.append(N,np.multiply((1-xsi),(1-np.multiply(eta,eta)))/2.,axis=1)
dNr = np.mat(np.zeros((r2,8)))
dNr[0:r2:2,0] = -(-np.multiply((1-eta),(1+xsi+eta))+np.multiply((1-xsi),(1-eta)))/4.
dNr[0:r2:2,1] = -(np.multiply((1-eta),(1-xsi+eta))-np.multiply((1+xsi),(1-eta)))/4.
dNr[0:r2:2,2] = -(np.multiply((1+eta),(1-xsi-eta))-np.multiply((1+xsi),(1+eta)))/4.
dNr[0:r2:2,3] = -(-np.multiply((1+eta),(1+xsi-eta))+np.multiply((1-xsi),(1+eta)))/4.
dNr[0:r2:2,4] = -np.multiply(xsi,(1-eta))
dNr[0:r2:2,5] = (1-np.multiply(eta,eta))/2.
dNr[0:r2:2,6] = -np.multiply(xsi,(1+eta))
dNr[0:r2:2,7] = -(1-np.multiply(eta,eta))/2.
dNr[1:r2+1:2,0] = -(-np.multiply((1-xsi),(1+xsi+eta))+np.multiply((1-xsi),(1-eta)))/4.
dNr[1:r2+1:2,1] = -(-np.multiply((1+xsi),(1-xsi+eta))+np.multiply((1+xsi),(1-eta)))/4.
dNr[1:r2+1:2,2] = -(np.multiply((1+xsi),(1-xsi-eta))-np.multiply((1+xsi),(1+eta)))/4.
dNr[1:r2+1:2,3] = -(np.multiply((1-xsi),(1+xsi-eta))-np.multiply((1-xsi),(1+eta)))/4.
dNr[1:r2+1:2,4] = -(1-np.multiply(xsi,xsi))/2.
dNr[1:r2+1:2,5] = -np.multiply(eta,(1+xsi))
dNr[1:r2+1:2,6] = (1-np.multiply(xsi,xsi))/2.
dNr[1:r2+1:2,7] = -np.multiply(eta,(1-xsi))
eci = N*np.mat([ex,ey]).T
if ed.ndim == 1:
ed = np.array([ed])
red,ced = np.shape(ed)
JT = dNr*np.mat([ex,ey]).T
es = np.mat(np.zeros((ngp*red,2)))
et = np.mat(np.zeros((ngp*red,2)))
for i in range(ngp):
indx = np.array([2*(i+1)-1,2*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobi determinant == 0")
JTinv = np.linalg.inv(JT[indx-1,:])
B = JTinv*dNr[indx-1,:]
p1 = -D*B*ed.T
p2 = B*ed.T
es[i:ngp*red:ngp,:] = p1.T
et[i:ngp*red:ngp,:] = p2.T
return es,et,eci
def flw3i8e(ex,ey,ez,ep,D,eq=None):
"""
Compute element stiffness (conductivity)
matrix for 8 node isoparametric field element.
Parameters:
ex = [x1,x2,x3,...,x8]
ey = [y1,y2,y3,...,y8] element coordinates
ez = [z1,z2,z3,...,z8]
ep = [ir] Ir: Integration rule
D = [[kxx,kxy,kxz],
[kyx,kyy,kyz],
[kzx,kzy,kzz]] constitutive matrix
eq heat supply per unit volume
Output:
Ke element 'stiffness' matrix (8 x 8)
fe element load vector (8 x 1)
"""
ir = ep[0]
ngp = ir*ir*ir
if eq == None:
q = 0
else:
q = eq
if ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-1,-1,-1],
[ 1,-1,-1],
[ 1, 1,-1],
[-1, 1,-1],
[-1,-1, 1],
[ 1,-1, 1],
[ 1, 1, 1],
[-1, 1, 1]
])*g1
w = np.mat(np.ones((8,3)))*w1
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat(np.zeros((27,3)))
w = np.mat(np.zeros((27,3)))
I1 = np.array([-1,0,1,-1,0,1,-1,0,1])
I2 = np.array([0,-1,0,0,1,0,0,1,0])
gp[:,0] = np.mat([I1,I1,I1]).reshape(27,1)*g1
gp[:,0] = np.mat([I2,I2,I2]).reshape(27,1)*g2+gp[:,0]
I1 = abs(I1)
I2 = abs(I2)
w[:,0] = np.mat([I1,I1,I1]).reshape(27,1)*w1
w[:,0] = np.mat([I2,I2,I2]).reshape(27,1)*w2+w[:,0]
I1 = np.array([-1,-1,-1,0,0,0,1,1,1])
I2 = np.array([0,0,0,1,1,1,0,0,0])
gp[:,1] = np.mat([I1,I1,I1]).reshape(27,1)*g1
gp[:,1] = np.mat([I2,I2,I2]).reshape(27,1)*g2+gp[:,1]
I1 = abs(I1)
I2 = abs(I2)
w[:,1] = np.mat([I1,I1,I1]).reshape(27,1)*w1
w[:,1] = np.mat([I2,I2,I2]).reshape(27,1)*w2+w[:,1]
I1 = np.array([-1,-1,-1,-1,-1,-1,-1,-1,-1])
I2 = np.array([0,0,0,0,0,0,0,0,0])
I3 = abs(I1)
gp[:,2] = np.mat([I1,I2,I3]).reshape(27,1)*g1
gp[:,2] = np.mat([I2,I3,I2]).reshape(27,1)*g2+gp[:,2]
w[:,2] = np.mat([I3,I2,I3]).reshape(27,1)*w1
w[:,2] = np.mat([I2,I3,I2]).reshape(27,1)*w2+w[:,2]
else:
cfinfo("Used number of integration points not implemented")
return
wp = np.multiply(np.multiply(w[:,0],w[:,1]),w[:,2])
xsi = gp[:,0]
eta = gp[:,1]
zet = gp[:,2]
r2 = ngp*3
N = np.multiply(np.multiply((1-xsi),(1-eta)),(1-zet))/8.
N = np.append(N,np.multiply(np.multiply((1+xsi),(1-eta)),(1-zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1+xsi),(1+eta)),(1-zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1-xsi),(1+eta)),(1-zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1-xsi),(1-eta)),(1+zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1+xsi),(1-eta)),(1+zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1+xsi),(1+eta)),(1+zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1-xsi),(1+eta)),(1+zet))/8.,axis=1)
dNr = np.mat(np.zeros((r2,8)))
dNr[0:r2:3,0]= np.multiply(-(1-eta),(1-zet))
dNr[0:r2:3,1]= np.multiply((1-eta),(1-zet))
dNr[0:r2:3,2]= np.multiply((1+eta),(1-zet))
dNr[0:r2:3,3]= np.multiply(-(1+eta),(1-zet))
dNr[0:r2:3,4]= np.multiply(-(1-eta),(1+zet))
dNr[0:r2:3,5]= np.multiply((1-eta),(1+zet))
dNr[0:r2:3,6]= np.multiply((1+eta),(1+zet))
dNr[0:r2:3,7]= np.multiply(-(1+eta),(1+zet))
dNr[1:r2+1:3,0] = np.multiply(-(1-xsi),(1-zet))
dNr[1:r2+1:3,1] = np.multiply(-(1+xsi),(1-zet))
dNr[1:r2+1:3,2] = np.multiply((1+xsi),(1-zet))
dNr[1:r2+1:3,3] = np.multiply((1-xsi),(1-zet))
dNr[1:r2+1:3,4] = np.multiply(-(1-xsi),(1+zet))
dNr[1:r2+1:3,5] = np.multiply(-(1+xsi),(1+zet))
dNr[1:r2+1:3,6] = np.multiply((1+xsi),(1+zet))
dNr[1:r2+1:3,7] = np.multiply((1-xsi),(1+zet))
dNr[2:r2+2:3,0] = np.multiply(-(1-xsi),(1-eta))
dNr[2:r2+2:3,1] = np.multiply(-(1+xsi),(1-eta))
dNr[2:r2+2:3,2] = np.multiply(-(1+xsi),(1+eta))
dNr[2:r2+2:3,3] = np.multiply(-(1-xsi),(1+eta))
dNr[2:r2+2:3,4] = np.multiply((1-xsi),(1-eta))
dNr[2:r2+2:3,5] = np.multiply((1+xsi),(1-eta))
dNr[2:r2+2:3,6] = np.multiply((1+xsi),(1+eta))
dNr[2:r2+2:3,7] = np.multiply((1-xsi),(1+eta))
dNr = dNr/8.
Ke1 = np.mat(np.zeros((8,8)))
fe1 = np.mat(np.zeros((8,1)))
JT = dNr*np.mat([ex,ey,ez]).T
for i in range(ngp):
indx = np.array([3*(i+1)-2,3*(i+1)-1,3*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobi determinant == 0")
JTinv = np.linalg.inv(JT[indx-1,:])
B = JTinv*dNr[indx-1,:]
Ke1 = Ke1+B.T*D*B*detJ*np.asscalar(wp[i])
fe1 = fe1+N[i,:].T*detJ*wp[i]
if eq != None:
return Ke1,fe1*q
else:
return Ke1
def flw3i8s(ex,ey,ez,ep,D,ed):
"""
Compute flows or corresponding quantities in the
8 node (3-dim) isoparametric field element.
Parameters:
ex = [x1,x2,x3,...,x8]
ey = [y1,y2,y3,...,y8] element coordinates
ez = [z1,z2,z3,...,z8]
ep = [ir] Ir: Integration rule
D = [[kxx,kxy,kxz],
[kyx,kyy,kyz],
[kzx,kzy,kzz]] constitutive matrix
ed = [[u1,....,u8], element nodal values
[..,....,..]]
Output:
es = [[qx,qy,qz],
[..,..,..]] element flows(s)
et = [[qx,qy,qz], element gradients(s)
[..,..,..]]
eci = [[ix1,ix1,iz1], location vector
[...,...,...], nint: number of integration points
[ix(nint),iy(nint),iz(nint)]]
"""
ir = ep[0]
ngp = ir*ir*ir
if ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-1,-1,-1],
[ 1,-1,-1],
[ 1, 1,-1],
[-1, 1,-1],
[-1,-1, 1],
[ 1,-1, 1],
[ 1, 1, 1],
[-1, 1, 1]
])*g1
w = np.mat(np.ones((8,3)))*w1
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat(np.zeros((27,3)))
w = np.mat(np.zeros((27,3)))
I1 = np.array([-1,0,1,-1,0,1,-1,0,1])
I2 = np.array([0,-1,0,0,1,0,0,1,0])
gp[:,0] = np.mat([I1,I1,I1]).reshape(27,1)*g1
gp[:,0] = np.mat([I2,I2,I2]).reshape(27,1)*g2+gp[:,0]
I1 = abs(I1)
I2 = abs(I2)
w[:,0] = np.mat([I1,I1,I1]).reshape(27,1)*w1
w[:,0] = np.mat([I2,I2,I2]).reshape(27,1)*w2+w[:,0]
I1 = np.array([-1,-1,-1,0,0,0,1,1,1])
I2 = np.array([0,0,0,1,1,1,0,0,0])
gp[:,1] = np.mat([I1,I1,I1]).reshape(27,1)*g1
gp[:,1] = np.mat([I2,I2,I2]).reshape(27,1)*g2+gp[:,1]
I1 = abs(I1)
I2 = abs(I2)
w[:,1] = np.mat([I1,I1,I1]).reshape(27,1)*w1
w[:,1] = np.mat([I2,I2,I2]).reshape(27,1)*w2+w[:,1]
I1 = np.array([-1,-1,-1,-1,-1,-1,-1,-1,-1])
I2 = np.array([0,0,0,0,0,0,0,0,0])
I3 = abs(I1)
gp[:,2] = np.mat([I1,I2,I3]).reshape(27,1)*g1
gp[:,2] = np.mat([I2,I3,I2]).reshape(27,1)*g2+gp[:,2]
w[:,2] = np.mat([I3,I2,I3]).reshape(27,1)*w1
w[:,2] = np.mat([I2,I3,I2]).reshape(27,1)*w2+w[:,2]
else:
cfinfo("Used number of integration points not implemented")
return
wp = np.multiply(np.multiply(w[:,0],w[:,1]),w[:,2])
xsi = gp[:,0]
eta = gp[:,1]
zet = gp[:,2]
r2 = ngp*3
N = np.multiply(np.multiply((1-xsi),(1-eta)),(1-zet))/8.
N = np.append(N,np.multiply(np.multiply((1+xsi),(1-eta)),(1-zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1+xsi),(1+eta)),(1-zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1-xsi),(1+eta)),(1-zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1-xsi),(1-eta)),(1+zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1+xsi),(1-eta)),(1+zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1+xsi),(1+eta)),(1+zet))/8.,axis=1)
N = np.append(N,np.multiply(np.multiply((1-xsi),(1+eta)),(1+zet))/8.,axis=1)
dNr = np.mat(np.zeros((r2,8)))
dNr[0:r2:3,0]= np.multiply(-(1-eta),(1-zet))
dNr[0:r2:3,1]= np.multiply((1-eta),(1-zet))
dNr[0:r2:3,2]= np.multiply((1+eta),(1-zet))
dNr[0:r2:3,3]= np.multiply(-(1+eta),(1-zet))
dNr[0:r2:3,4]= np.multiply(-(1-eta),(1+zet))
dNr[0:r2:3,5]= np.multiply((1-eta),(1+zet))
dNr[0:r2:3,6]= np.multiply((1+eta),(1+zet))
dNr[0:r2:3,7]= np.multiply(-(1+eta),(1+zet))
dNr[1:r2+1:3,0] = np.multiply(-(1-xsi),(1-zet))
dNr[1:r2+1:3,1] = np.multiply(-(1+xsi),(1-zet))
dNr[1:r2+1:3,2] = np.multiply((1+xsi),(1-zet))
dNr[1:r2+1:3,3] = np.multiply((1-xsi),(1-zet))
dNr[1:r2+1:3,4] = np.multiply(-(1-xsi),(1+zet))
dNr[1:r2+1:3,5] = np.multiply(-(1+xsi),(1+zet))
dNr[1:r2+1:3,6] = np.multiply((1+xsi),(1+zet))
dNr[1:r2+1:3,7] = np.multiply((1-xsi),(1+zet))
dNr[2:r2+2:3,0] = np.multiply(-(1-xsi),(1-eta))
dNr[2:r2+2:3,1] = np.multiply(-(1+xsi),(1-eta))
dNr[2:r2+2:3,2] = np.multiply(-(1+xsi),(1+eta))
dNr[2:r2+2:3,3] = np.multiply(-(1-xsi),(1+eta))
dNr[2:r2+2:3,4] = np.multiply((1-xsi),(1-eta))
dNr[2:r2+2:3,5] = np.multiply((1+xsi),(1-eta))
dNr[2:r2+2:3,6] = np.multiply((1+xsi),(1+eta))
dNr[2:r2+2:3,7] = np.multiply((1-xsi),(1+eta))
dNr = dNr/8.
eci = N*np.mat([ex,ey,ez]).T
if ed.ndim == 1:
ed = np.array([ed])
red,ced = np.shape(ed)
JT = dNr*np.mat([ex,ey,ez]).T
es = np.mat(np.zeros((ngp*red,3)))
et = np.mat(np.zeros((ngp*red,3)))
for i in range(ngp):
indx = np.array([3*(i+1)-2,3*(i+1)-1,3*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobideterminanten lika med noll!")
JTinv = np.linalg.inv(JT[indx-1,:])
B = JTinv*dNr[indx-1,:]
p1 = -D*B*ed.T
p2 = B*ed.T
es[i:ngp*red:ngp,:] = p1.T
et[i:ngp*red:ngp,:] = p2.T
return es,et,eci
def plante(ex,ey,ep,D,eq=None):
"""
Calculate the stiffness matrix for a triangular plane stress or plane strain element.
Parameters:
ex = [x1,x2,x3] element coordinates
ey = [y1,y2,y3]
ep = [ptype,t] ptype: analysis type
t: thickness
D constitutive matrix
eq = [[bx], bx: body force x-dir
[by]] by: body force y-dir
Returns:
Ke element stiffness matrix (6 x 6)
fe equivalent nodal forces (6 x 1) (if eq is given)
"""
ptype,t = ep
bx = 0.0
by = 0.0
if not eq is None:
bx = eq[0]
by = eq[1]
C = np.mat([
[1, ex[0], ey[0], 0, 0, 0],
[0, 0, 0, 1, ex[0], ey[0]],
[1, ex[1], ey[1], 0, 0, 0],
[0, 0, 0, 1, ex[1], ey[1]],
[1, ex[2], ey[2], 0, 0, 0],
[0, 0, 0, 1, ex[2], ey[2]]
])
A = 0.5*np.linalg.det(np.mat([
[1, ex[0], ey[0]],
[1, ex[1], ey[1]],
[1, ex[2], ey[2]]
]))
# --------- plane stress --------------------------------------
if ptype == 1:
B = np.mat([
[0, 1, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1],
[0, 0, 1, 0, 1, 0]
])*np.linalg.inv(C)
colD = D.shape[1]
if colD > 3:
Cm = np.linalg.inv(D)
Dm = np.linalg.inv(Cm[np.ix_((0,1,3),(0,1,3))])
else:
Dm = D
Ke = B.T*Dm*B*A*t
fe = A/3*np.mat([bx,by,bx,by,bx,by]).T*t
if eq is None:
return Ke
else:
return Ke,fe.T
#--------- plane strain --------------------------------------
elif ptype == 2:
B = np.mat([
[0, 1, 0, 0, 0, 0,],
[0, 0, 0, 0, 0, 1,],
[0, 0, 1, 0, 1, 0,]
])*np.linalg.inv(C)
colD = D.shape[1]
if colD > 3:
Dm = D[np.ix_((0,1,3),(0,1,3))]
else:
Dm = D
Ke = B.T*Dm*B*A*t
fe = A/3*np.mat([bx,by,bx,by,bx,by]).T*t
if eq == None:
return Ke
else:
return Ke,fe.T
else:
cfinfo("Error ! Check first argument, ptype=1 or 2 allowed")
if eq == None:
return None
else:
return None,None
def plants(ex,ey,ep,D,ed):
"""
Calculate element normal and shear stress for a
triangular plane stress or plane strain element.
INPUT: ex = [x1 x2 x3] element coordinates
ey = [y1 y2 y3]
ep = [ptype t ] ptype: analysis type
t: thickness
D constitutive matrix
ed =[u1 u2 ...u6 element displacement vector
...... ] one row for each element
OUTPUT: es = [ sigx sigy [sigz] tauxy element stress matrix
...... ] one row for each element
et = [ epsx epsy [epsz] gamxy element strain matrix
...... ] one row for each element
"""
ptype=ep[0]
if np.ndim(ex) == 1:
ex = np.array([ex])
if np.ndim(ey) == 1:
ey = np.array([ey])
if np.ndim(ed) == 1:
ed = np.array([ed])
rowed=ed.shape[0]
rowex=ex.shape[0]
# --------- plane stress --------------------------------------
if ptype==1:
colD = D.shape[1]
if colD>3:
Cm = np.linalg.inv(D)
Dm = np.linalg.inv(Cm[np.ix_((0,1,3),(0,1,3))])
else:
Dm = D
incie=0
if rowex==1:
incie=0
else:
incie=1
et=np.zeros([rowed,colD])
es=np.zeros([rowed,colD])
ie=0
for i in range(rowed):
C = np.matrix(
[[1, ex[ie,0], ey[ie,0], 0, 0, 0 ],
[0, 0, 0, 1, ex[ie,0], ey[ie,0] ],
[1, ex[ie,1], ey[ie,1], 0, 0, 0 ],
[0, 0, 0, 1, ex[ie,1], ey[ie,1] ],
[1, ex[ie,2], ey[ie,2], 0, 0, 0 ],
[0, 0, 0, 1, ex[ie,2], ey[ie,2] ]]
)
B = np.matrix([
[0,1,0,0,0,0],
[0,0,0,0,0,1],
[0,0,1,0,1,0]])*np.linalg.inv(C)
ee=B*np.asmatrix(ed[ie,:]).T
if colD>3:
ss=np.zeros([colD,1])
ss[[0,1,3]]=Dm*ee
ee=Cm*ss
else:
ss=Dm*ee
et[ie,:] = ee.T
es[ie,:] = ss.T
ie = ie + incie
return es, et
def plantf(ex,ey,ep,es):
"""
Compute internal element force vector in a triangular element
in plane stress or plane strain.
Parameters:
ex = [x1,x2,x3] node coordinates
ey = [y1,y2,y3]
ep = [ptype,t] ptype: analysis type
t: thickness
es = [[sigx,sigy,[sigz],tauxy] element stress matrix
[ ...... ]] one row for each element
OUTPUT:
fe = [[f1],[f2],...,[f8]] internal force vector
"""
ptype,t = ep
colD = es.shape[1]
#--------- plane stress --------------------------------------
if ptype == 1:
C = np.mat([
[ 1, ex[0], ey[0], 0, 0, 0 ],
[ 0, 0, 0, 1, ex[0], ey[0]],
[ 1, ex[1], ey[1], 0, 0, 0 ],
[ 0, 0, 0, 1, ex[1], ey[1]],
[ 1, ex[2], ey[2], 0, 0, 0 ],
[ 0, 0, 0, 1, ex[2], ey[2]]
])
A = 0.5*np.linalg.det(np.mat([
[ 1, ex[0], ey[0]],
[ 1, ex[1], ey[1]],
[ 1, ex[2], ey[2]]
]))
B = np.mat([
[ 0, 1, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 1],
[ 0, 0, 1, 0, 1, 0]
])*np.linalg.inv(C)
if colD > 3:
stress = np.asmatrix(es[np.ix_((0,1,3))])
else:
stress = np.asmatrix(es)
ef = (A*t*B.T*stress.T).T
return np.reshape(np.asarray(ef),6)
#--------- plane strain --------------------------------------
elif ptype == 2:
C = np.mat([
[ 1, ex[0], ey[0], 0, 0, 0 ],
[ 0, 0, 0, 1, ex[0], ey[0]],
[ 1, ex[1], ey[1], 0, 0, 0 ],
[ 0, 0, 0, 1, ex[1], ey[1]],
[ 1, ex[2], ey[2], 0, 0, 0 ],
[ 0, 0, 0, 1, ex[2], ey[2]]
])
A = 0.5*np.linalg.det(np.mat([
[ 1, ex[0], ey[0]],
[ 1, ex[1], ey[1]],
[ 1, ex[2], ey[2]]
]))
B = np.mat([
[ 0, 1, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 1],
[ 0, 0, 1, 0, 1, 0]
])*np.linalg.inv(C)
if colD > 3:
stress = np.asmatrix(es[np.ix_((1,2,4))])
else:
stress = np.asmatrix(es)
ef = (A*t*B.T*stress.T).T
return np.reshape(np.asarray(ef),6)
else:
cfinfo("Error ! Check first argument, ptype=1 or 2 allowed")
return None
def platre(ex,ey,ep,D,eq=None):
"""
Calculate the stiffness matrix for a rectangular plate element.
NOTE! Element sides must be parallel to the coordinate axis.
Parameters:
ex = [x1,x2,x3,x4] element coordinates
ey = [y1,y2,y3,y4]
ep = [t] thicknes
D constitutive matrix for
plane stress
eq = [qz] load/unit area
Returns:
Ke element stiffness matrix (12 x 12)
fe equivalent nodal forces (12 x 1)
"""
Lx = (ex[2]-ex[0]).astype(float)
Ly = (ey[2]-ey[0]).astype(float)
t = ep[0]
D = t**3/12.*D
A1 = Ly/(Lx**3)
A2 = Lx/(Ly**3)
A3 = 1/Lx/Ly
A4 = Ly/(Lx**2)
A5 = Lx/(Ly**2)
A6 = 1/Lx
A7 = 1/Ly
A8 = Ly/Lx
A9 = Lx/Ly
C1 = 4*A1*D[0,0]+4*A2*D[1,1]+2*A3*D[0,1]+5.6*A3*D[2,2]
C2 = -4*A1*D[0,0]+2*A2*D[1,1]-2*A3*D[0,1]-5.6*A3*D[2,2]
C3 = 2*A1*D[0,0]-4*A2*D[1,1]-2*A3*D[0,1]-5.6*A3*D[2,2]
C4 = -2*A1*D[0,0]-2*A2*D[1,1]+2*A3*D[0,1]+5.6*A3*D[2,2]
C5 = 2*A5*D[1,1]+A6*D[0,1]+0.4*A6*D[2,2]
C6 = 2*A4*D[0,0]+A7*D[0,1]+0.4*A7*D[2,2]
C7 = 2*A5*D[1,1]+0.4*A6*D[2,2]
C8 = 2*A4*D[0,0]+0.4*A7*D[2,2]
C9 = A5*D[1,1]-A6*D[0,1]-0.4*A6*D[2,2]
C10 = A4*D[0,0]-A7*D[0,1]-0.4*A7*D[2,2]
C11 = A5*D[1,1]-0.4*A6*D[2,2]
C12 = A4*D[0,0]-0.4*A7*D[2,2]
C13 = 4/3.*A9*D[1,1]+8/15.*A8*D[2,2]
C14 = 4/3.*A8*D[0,0]+8/15.*A9*D[2,2]
C15 = 2/3.*A9*D[1,1]-8/15.*A8*D[2,2]
C16 = 2/3.*A8*D[0,0]-8/15.*A9*D[2,2]
C17 = 2/3.*A9*D[1,1]-2/15.*A8*D[2,2]
C18 = 2/3.*A8*D[0,0]-2/15.*A9*D[2,2]
C19 = 1/3.*A9*D[1,1]+2/15.*A8*D[2,2]
C20 = 1/3.*A8*D[0,0]+2/15.*A9*D[2,2]
C21 = D[0,1]
Keq = np.mat(np.zeros((12,12)))
Keq[0,0:13] = C1,C5,-C6,C2,C9,-C8,C4,C11,-C12,C3,C7,-C10
Keq[1,1:13] = C13,-C21,C9,C15,0,-C11,C19,0,-C7,C17,0
Keq[2,2:13] = C14,C8,0,C18,C12,0,C20,-C10,0,C16
Keq[3,3:13] = C1,C5,C6,C3,C7,C10,C4,C11,C12
Keq[4,4:13] = C13,C21,-C7,C17,0,-C11,C19,0
Keq[5,5:13] = C14,C10,0,C16,-C12,0,C20
Keq[6,6:13] = C1,-C5,C6,C2,-C9,C8
Keq[7,7:13] = C13,-C21,-C9,C15,0
Keq[8,8:13] = C14,-C8,0,C18
Keq[9,9:13] = C1,-C5,-C6
Keq[10,10:13] = C13,C21
Keq[11,11] = C14
Keq = Keq.T+Keq-np.diag(np.diag(Keq))
if eq != None:
q = eq
R1 = q*Lx*Ly/4
R2 = q*Lx*Ly**2/24
R3 = q*Ly*Lx**2/24
feq = np.mat([R1,R2,-R3,R1,R2,R3,R1,-R2,R3,R1,-R2,-R3])
if eq != None:
return Keq,feq
else:
return Keq
def planqe(ex,ey,ep,D,eq=None):
"""
Calculate the stiffness matrix for a quadrilateral
plane stress or plane strain element.
Parameters:
ex=[x1 x2 x3 x4] element coordinates
ey=[y1 y2 y3 y4]
ep = [ptype, t] ptype: analysis type
t: element thickness
D constitutive matrix
eq = [bx; bx: body force in x direction
by] by: body force in y direction
OUTPUT: Ke : element stiffness matrix (8 x 8)
fe : equivalent nodal forces (row array)
"""
K=np.zeros((10,10))
f=np.zeros((10,1))
xm=sum(ex)/4.
ym=sum(ey)/4.
b1 = eq if eq is not None else np.array([[0],[0]])
ke1, fe1 = plante(np.array([ex[0], ex[1], xm]), np.array([ey[0], ey[1], ym]), ep, D, b1)
K, f = assem(np.array([1, 2, 3, 4, 9, 10]), K, ke1, f, fe1)
ke1, fe1 = plante(np.array([ex[1], ex[2], xm]), np.array([ey[1], ey[2], ym]), ep, D, b1)
K, f = assem(np.array([3, 4, 5, 6, 9, 10]), K, ke1, f, fe1)
ke1, fe1 = plante(np.array([ex[2], ex[3], xm]), np.array([ey[2], ey[3], ym]), ep, D, b1)
K, f = assem(np.array([5, 6, 7, 8, 9, 10]), K, ke1, f, fe1)
ke1, fe1 = plante(np.array([ex[3], ex[0], xm]), np.array([ey[3], ey[0], ym]), ep, D, b1)
K, f = assem(np.array([7, 8, 1, 2, 9, 10]), K, ke1, f, fe1)
Ke, fe = statcon(K, f, np.array([[9],[10]]))
if eq == None:
return Ke
else:
return Ke,fe
def planqs(ex,ey,ep,D,ed,eq=None):
"""
Calculate element normal and shear stress for a quadrilateral
plane stress or plane strain element.
Parameters:
ex = [x1 x2 x3 x4] element coordinates
ey = [y1 y2 y3 y4]
ep = [ptype, t] ptype: analysis type
t: thickness
D constitutive matrix
ed = [u1 u2 ..u8] element displacement vector
eq = [[bx] bx: body force in x direction
[by]] by: body force in y direction
OUTPUT: es = [ sigx sigy (sigz) tauxy] element stress array
et = [ epsx epsy (epsz) gamxy] element strain array
"""
if ex.shape != (4,) or ey.shape != (4,) or ed.shape != (8,):
raise ValueError('Error ! PLANQS: only one element at the time (ex, ey, ed must be a row arrays)')
K = np.zeros((10,10))
f = np.zeros((10,1))
xm = sum(ex)/4.
ym = sum(ey)/4.
b1 = eq if eq is not None else np.array([[0],[0]])
ex1 = np.array([ex[0], ex[1], xm])
ey1 = np.array([ey[0], ey[1], ym])
ex2 = np.array([ex[1], ex[2], xm])
ey2 = np.array([ey[1], ey[2], ym])
ex3 = np.array([ex[2], ex[3], xm])
ey3 = np.array([ey[2], ey[3], ym])
ex4 = np.array([ex[3], ex[0], xm])
ey4 = np.array([ey[3], ey[0], ym])
ke1, fe1 = plante(ex1, ey1, ep, D, b1)
K, f = assem(np.array([1, 2, 3, 4, 9, 10]), K, ke1, f, fe1)
ke1,fe1 = plante(ex2, ey2, ep, D, b1)
K, f = assem(np.array([3, 4, 5, 6, 9, 10]), K, ke1, f, fe1)
ke1, fe1 = plante(ex3, ey3, ep, D, b1)
K, f = assem(np.array([5, 6, 7, 8, 9, 10]), K, ke1, f, fe1)
ke1, fe1 = plante(ex4, ey4, ep, D, b1)
K, f = assem(np.array([7, 8, 1, 2, 9, 10]), K, ke1, f, fe1)
A1 = 0.5 * np.linalg.det( np.hstack([np.ones((3,1)), np.mat(ex1).T, np.mat(ey1).T]) )
A2 = 0.5 * np.linalg.det( np.hstack([np.ones((3,1)), np.mat(ex2).T, np.mat(ey2).T]) )
A3 = 0.5 * np.linalg.det( np.hstack([np.ones((3,1)), np.mat(ex3).T, np.mat(ey3).T]) )
A4 = 0.5 * np.linalg.det( np.hstack([np.ones((3,1)), np.mat(ex4).T, np.mat(ey4).T]) )
Atot = A1+A2+A3+A4;
a, _ = solveq(K, f, np.array(range(1,9)), ed)
# ni = ed.shape[0]
# a = np.mat(empty((10,ni)))
# for i in range(ni):
# a[:,i] = solveq(K, f, np.array(range(1,9)), ed[i,:])[0]
# #a = np.hstack([a, solveq(K, f, np.hstack([matrix(range(1,9)).T, ed[i,:].T]) ) ])
s1, t1 = plants(ex1, ey1, ep, D, np.hstack([a[[0, 1, 2, 3, 8, 9], :].T]) );
s2, t2 = plants(ex2, ey2, ep, D, np.hstack([a[[2, 3, 4, 5, 8, 9], :].T]) );
s3, t3 = plants(ex3, ey3, ep, D, np.hstack([a[[4, 5, 6, 7, 8, 9], :].T]) );
s4, t4 = plants(ex4, ey4, ep, D, np.hstack([a[[6, 7, 0, 1, 8, 9], :].T]) );
es = (s1*A1+s2*A2+s3*A3+s4*A4)/Atot;
et = (t1*A1+t2*A2+t3*A3+t4*A4)/Atot;
return es[0], et[0] #[0] because these are 1-by-3 arrays and we want row arrays out.
def plani4e(ex,ey,ep,D,eq=None):
"""
Calculate the stiffness matrix for a 4 node isoparametric
element in plane strain or plane stress.
Parameters:
ex = [x1 ... x4] element coordinates. Row array
ey = [y1 ... y4]
ep =[ptype, t, ir] ptype: analysis type
t : thickness
ir: integration rule
D constitutive matrix
eq = [bx; by] bx: body force in x direction
by: body force in y direction
Any array with 2 elements acceptable
Returns:
Ke : element stiffness matrix (8 x 8)
fe : equivalent nodal forces (8 x 1)
"""
ptype=ep[0]
t=ep[1]
ir=ep[2]
ngp=ir*ir
if eq is None:
q = np.zeros((2,1))
else:
q = np.reshape(eq, (2,1))
#--------- gauss points --------------------------------------
if ir == 1:
g1 = 0.0
w1 = 2.0
gp = np.mat([g1,g1])
w = np.mat([w1,w1])
elif ir == 2:
g1 = 0.577350269189626
w1 = 1
gp = np.mat([
[-g1,-g1],
[ g1,-g1],
[-g1, g1],
[ g1, g1]])
w = np.mat([
[ w1, w1],
[ w1, w1],
[ w1, w1],
[ w1, w1]])
elif ir == 3:
g1 = 0.774596669241483
g2 = 0.
w1 = 0.555555555555555
w2 = 0.888888888888888
gp = np.mat([
[-g1,-g1],
[-g2,-g1],
[ g1,-g1],
[-g1, g2],
[ g2, g2],
[ g1, g2],
[-g1, g1],
[ g2, g1],
[ g1, g1]])
w = np.mat([
[ w1, w1],
[ w2, w1],
[ w1, w1],
[ w1, w2],
[ w2, w2],
[ w1, w2],
[ w1, w1],
[ w2, w1],
[ w1, w1]])
else:
cfinfo("Used number of integration points not implemented")
wp = np.multiply(w[:,0],w[:,1])
xsi = gp[:,0]
eta = gp[:,1]
r2 = ngp*2
# Shape Functions
N = np.multiply((1-xsi),(1-eta))/4.
N = np.append(N,np.multiply((1+xsi),(1-eta))/4.,axis=1)
N = np.append(N,np.multiply((1+xsi),(1+eta))/4.,axis=1)
N = np.append(N,np.multiply((1-xsi),(1+eta))/4.,axis=1)
dNr = np.mat(np.zeros((r2,4)))
dNr[0:r2:2,0] = -(1-eta)/4.
dNr[0:r2:2,1] = (1-eta)/4.
dNr[0:r2:2,2] = (1+eta)/4.
dNr[0:r2:2,3] = -(1+eta)/4.
dNr[1:r2+1:2,0] = -(1-xsi)/4.
dNr[1:r2+1:2,1] = -(1+xsi)/4.
dNr[1:r2+1:2,2] = (1+xsi)/4.
dNr[1:r2+1:2,3] = (1-xsi)/4.
#
Ke1 = np.mat(np.zeros((8,8)))
fe1 = np.mat(np.zeros((8,1)))
JT = dNr*np.mat([ex,ey]).T
# --------- plane stress --------------------------------------
if ptype==1:
colD=np.shape(D)[0]
if colD>3:
Cm=np.linalg.inv(D)
Dm=np.linalg.inv(Cm[ np.ix_([0,1,3],[0,1,3]) ])
else:
Dm=D
#
B=np.matrix(np.zeros((3,8)))
N2=np.matrix(np.zeros((2,8)))
for i in range(ngp):
indx = np.array([2*(i+1)-1,2*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobi determinant equal or less than zero!")
JTinv = np.linalg.inv(JT[indx-1,:])
dNx=JTinv*dNr[indx-1,:]
#
index_array_even=np.array([0,2,4,6])
index_array_odd=np.array([1,3,5,7])
#
counter=0
for index in index_array_even:
B[0,index] = dNx[0,counter]
B[2,index] = dNx[1,counter]
N2[0,index]=N[i,counter]
counter=counter+1
#
counter=0
for index in index_array_odd:
B[1,index] = dNx[1,counter]
B[2,index] = dNx[0,counter]
N2[1,index] =N[i,counter]
counter=counter+1
#
Ke1 = Ke1+B.T*Dm*B*detJ*np.asscalar(wp[i])*t
fe1 = fe1 + N2.T * q * detJ * np.asscalar(wp[i]) * t
return Ke1,fe1
#--------- plane strain --------------------------------------
elif ptype==2:
#
colD=np.shape(D)[0]
if colD>3:
Dm = D[np.ix_([0,1,3],[0,1,3])]
else:
Dm = D
#
B=np.matrix(np.zeros((3,8)))
N2=np.matrix(np.zeros((2,8)))
for i in range(ngp):
indx = np.array([2*(i+1)-1,2*(i+1)])
detJ = np.linalg.det(JT[indx-1,:])
if detJ < 10*np.finfo(float).eps:
cfinfo("Jacobideterminant equal or less than zero!")
JTinv = np.linalg.inv(JT[indx-1,:])
dNx=JTinv*dNr[indx-1,:]
#
index_array_even=np.array([0,2,4,6])
index_array_odd=np.array([1,3,5,7])
#
counter=0
for index in index_array_even:
#
B[0,index] = dNx[0,counter]
B[2,index] = dNx[1,counter]
N2[0,index]=N[i,counter]
#
counter=counter+1
#
counter=0
for index in index_array_odd:
B[1,index] = dNx[1,counter]
B[2,index] = dNx[0,counter]
N2[1,index] =N[i,counter]
counter=counter+1
#
Ke1 = Ke1 + B.T * Dm * B * detJ * np.asscalar(wp[i]) * t
fe1 = fe1+N2.T*q*detJ*np.asscalar(wp[i])*t
return Ke1,fe1
else:
cfinfo("Error ! Check first argument, ptype=1 or 2 allowed")
def assem(edof,K,Ke,f=None,fe=None):
"""
Assemble element matrices Ke ( and fe ) into the global
stiffness matrix K ( and the global force vector f )
according to the topology matrix edof.
Parameters:
edof dof topology array
K the global stiffness matrix
Ke element stiffness matrix
f the global force vector
fe element force vector
Output parameters:
K the new global stiffness matrix
f the new global force vector
fe element force vector
"""
if edof.ndim == 1:
idx = edof-1
K[np.ix_(idx,idx)] = K[np.ix_(idx,idx)] + Ke
if (not f is None) and (not fe is None):
f[np.ix_(idx)] = f[np.ix_(idx)] + fe
else:
for row in edof:
idx = row-1
K[np.ix_(idx,idx)] = K[np.ix_(idx,idx)] + Ke
if (not f is None) and (not fe is None):
f[np.ix_(idx)] = f[np.ix_(idx)] + fe
if f is None:
return K
else:
return K,f
def solveq(K,f,bcPrescr,bcVal=None):
"""
Solve static FE-equations considering boundary conditions.
Parameters:
K global stiffness matrix, dim(K)= nd x nd
f global load vector, dim(f)= nd x 1
bcPrescr 1-dim integer array containing prescribed dofs.
bcVal 1-dim float array containing prescribed values.
If not given all prescribed dofs are assumed 0.
Returns:
a solution including boundary values
Q reaction force vector
dim(a)=dim(Q)= nd x 1, nd : number of dof's
"""
nDofs = K.shape[0]
nPdofs = bcPrescr.shape[0]
if bcVal is None:
bcVal = np.zeros([nPdofs],'d')
bc = np.ones(nDofs, 'bool')
bcDofs = np.arange(nDofs)
bc[np.ix_(bcPrescr-1)] = False
bcDofs = bcDofs[bc]
fsys = f[bcDofs]-K[np.ix_((bcDofs),(bcPrescr-1))]*np.asmatrix(bcVal).reshape(nPdofs,1)
asys = np.linalg.solve(K[np.ix_((bcDofs),(bcDofs))], fsys);
a = np.zeros([nDofs,1])
a[np.ix_(bcPrescr-1)] = np.asmatrix(bcVal).reshape(nPdofs,1)
a[np.ix_(bcDofs)] = asys
Q=K*np.asmatrix(a)-f
return (np.asmatrix(a),Q)
def spsolveq(K,f,bcPrescr,bcVal=None):
"""
Solve static FE-equations considering boundary conditions.
Parameters:
K global stiffness matrix, dim(K)= nd x nd
f global load vector, dim(f)= nd x 1
bcPrescr 1-dim integer array containing prescribed dofs.
bcVal 1-dim float array containing prescribed values.
If not given all prescribed dofs are assumed 0.
Returns:
a solution including boundary values
Q reaction force vector
dim(a)=dim(Q)= nd x 1, nd : number of dof's
"""
nDofs = K.shape[0]
nPdofs = bcPrescr.shape[0]
if bcVal is None:
bcVal = np.zeros([nPdofs],'d')
bc = np.ones(nDofs, 'bool')
bcDofs = np.arange(nDofs)
bc[np.ix_(bcPrescr-1)] = False
bcDofs = bcDofs[bc]
bcVal_m = np.asmatrix(bcVal).reshape(nPdofs,1)
info("Preparing system matrix...")
mask = np.ones(K.shape[0], dtype=bool)
mask[bcDofs] = False
info("step 1... converting K->CSR")
Kcsr = K.asformat("csr")
info("step 2... Kt")
#Kt1 = K[bcDofs]
#Kt = Kt1[:,bcPrescr]
Kt = K[np.ix_((bcDofs),(bcPrescr-1))]
info("step 3... fsys")
fsys = f[bcDofs]-Kt*bcVal_m
info("step 4... Ksys")
Ksys1 = Kcsr[bcDofs]
Ksys = Ksys1[:,bcDofs]
#Ksys = Kcsr[np.ix_((bcDofs),(bcDofs))]
info ("done...")
info("Solving system...")
asys = dsolve.spsolve(Ksys, fsys);
info("Reconstructing full a...")
a = np.zeros([nDofs,1])
a[np.ix_(bcPrescr-1)] = bcVal_m
a[np.ix_(bcDofs)] = np.asmatrix(asys).transpose()
a_m = np.asmatrix(a)
Q=K*a_m-f
info("done...")
return (a_m,Q)
def extractEldisp(edof,a):
"""
Extract element displacements from the global displacement
vector according to the topology matrix edof.
Parameters:
a the global displacement vector
edof dof topology array
Returns:
ed: element displacement array
"""
ed = None
if edof.ndim==1:
nDofs = len(edof)
ed = np.zeros([nDofs])
idx = edof-1
ed[:] = a[np.ix_(idx)].T
else:
nElements = edof.shape[0]
nDofs = edof.shape[1]
ed = np.zeros([nElements,nDofs])
i=0
for row in edof:
idx = row-1
ed[i,:]=a[np.ix_(idx)].T
i+=1
return ed
def statcon(K,f,cd):
"""
Condensation of static FE-equations according to the vector cd.
Parameters:
K global stiffness matrix, dim(K) = nd x nd
f global load vector, dim(f)= nd x 1
cd vector containing dof's to be eliminated
dim(cd)= nc x 1, nc: number of condensed dof's
Returns:
K1 condensed stiffness matrix,
dim(K1)= (nd-nc) x (nd-nc)
f1 condensed load vector, dim(f1)= (nd-nc) x 1
"""
nd,nd = np.shape(K)
cd = (cd-1).flatten()
aindx = np.arange(nd)
aindx = np.delete(aindx,cd,0)
bindx = cd
Kaa = np.mat(K[np.ix_(aindx,aindx)])
Kab = np.mat(K[np.ix_(aindx,bindx)])
Kbb = np.mat(K[np.ix_(bindx,bindx)])
fa = np.mat(f[aindx])
fb = np.mat(f[bindx])
K1 = Kaa-Kab*Kbb.I*Kab.T
f1 = fa-Kab*Kbb.I*fb
return K1,f1
def c_mul(a, b):
return eval(hex((np.long(a) * b) & 0xFFFFFFFF)[:-1])
def dofHash(dof):
if len(dof)==1:
return dof[0]
value = 0x345678
for item in dof:
value = c_mul(1000003, value) ^ hash(item)
value = value ^ len(dof)
if value == -1:
value = -2
return value
def createdofs(nCoords,nDof):
"""
Create dof array [nCoords x nDof]
"""
return np.arange(nCoords*nDof).reshape(nCoords,nDof)+1
def coordxtr(edof,coords,dofs):
"""
Create element coordinate matrices ex, ey, ez from edof
coord and dofs matrices.
Parameters:
edof [nel x (nen * nnd)], nnd = number of node dofs
coords [ncoords x ndims], ndims = node dimensions
dofs [ncoords x nnd]
Returns:
ex if ndims = 1
ex, ey if ndims = 2
ex, ey, ez if ndims = 3
"""
# Create dictionary with dof indices
dofDict = {}
nDofs = np.size(dofs,1)
nElements = np.size(edof,0)
nDimensions = np.size(coords,1)
nElementDofs = np.size(edof,1)
nElementNodes = int(nElementDofs/nDofs)
idx = 0
for dof in dofs:
dofDict[dofHash(dof)] = idx
idx += 1
# Loop over edof and extract element coords
ex = np.zeros((nElements,nElementNodes))
ey = np.zeros((nElements,nElementNodes))
ez = np.zeros((nElements,nElementNodes))
elementIdx = 0
for etopo in edof:
for i in range(nElementNodes):
i0 = i*nDofs
i1 = i*nDofs+nDofs-1
dof = []
if i0==i1:
dof = [etopo[i*nDofs]]
else:
dof = etopo[i*nDofs:(i*nDofs+nDofs)]
nodeCoord = coords[dofDict[dofHash(dof)]]
if nDimensions>=1:
ex[elementIdx,i] = nodeCoord[0]
if nDimensions>=2:
ey[elementIdx,i] = nodeCoord[1]
if nDimensions>=3:
ez[elementIdx,i] = nodeCoord[2]
elementIdx += 1
if nDimensions==1:
return ex
if nDimensions==2:
return ex, ey
if nDimensions==3:
return ex, ey, ez
def hooke(ptype,E,v):
"""
Calculate the material matrix for a linear
elastic and isotropic material.
Parameters:
ptype= 1: plane stress
2: plane strain
3: axisymmetry
4: three dimensional
E Young's modulus
v Poissons const.
Returns:
D material matrix
"""
if ptype == 1:
D = E*np.matrix(
[[1, v, 0],
[v, 1, 0],
[0, 0, (1-v)/2]]
)/(1-v**2);
elif ptype == 2:
D = E/(1+v)*np.matrix(
[[1-v, v, v, 0],
[v, 1-v, v, 0],
[v, v, 1-v, 0],
[0, 0, 0, (1-2*v)/2]]
)/(1-2*v)
elif ptype == 3:
D = E/(1+v)*np.matrix(
[[1-v, v, v, 0],
[v, 1-v, v, 0],
[v, v, 1-v, 0],
[0, 0, 0, (1-2*v)/2]]
)/(1-2*v)
elif ptype == 4:
D = E*np.matrix(
[[1-v, v, v, 0, 0, 0],
[v, 1-v, v, 0, 0, 0],
[v, v, 1-v, 0, 0, 0],
[0, 0, 0, (1-2*v)/2, 0, 0],
[0, 0, 0, 0, (1-2*v)/2, 0],
[0, 0, 0, 0, 0, (1-2*v)/2]]
)/(1+v)/(1-2*v)
else:
cfinfo("ptype not supported.")
return D
def effmises(es,ptype):
"""
Calculate effective von mises stresses.
Parameters:
es
ptype= 1: plane stress
2: plane strain
3: axisymmetry
4: three dimensional
es = [[sigx,sigy,[sigz],tauxy] element stress matrix
[ ...... ]] one row for each element
Returns:
eseff = [eseff_0 .. eseff_nel-1]
"""
nel = np.size(es,0)
escomps = np.size(es, 1)
eseff = np.zeros([nel])
if ptype == 1:
sigxx = es[:,0]
sigyy = es[:,1]
sigxy = es[:,2]
eseff = np.sqrt(sigxx*sigxx+sigyy*sigyy-sigxx*sigyy+3*sigxy*sigxy)
return eseff
def stress2nodal(eseff, edof):
"""
Convert element effective stresses to nodal effective
stresses.
Parameters:
eseff = [eseff_0 .. eseff_nel-1]
edof = [dof topology array]
Returns:
ev: element value array [[ev_0_0 ev_0_1 ev_0_nen-1 ]
..
ev_nel-1_0 ev_nel-1_1 ev_nel-1_nen-1]
"""
values = np.zeros(edof.max())
elnodes = int(np.size(edof,1) / 2)
for etopo, eleseff in zip(edof, eseff):
values[etopo-1] = values[etopo-1] + eleseff / elnodes
evtemp = extractEldisp(edof,values)
ev = evtemp[:,range(0,elnodes*2,2)]
return ev
| 29.802628 | 132 | 0.413524 | 16,272 | 102,074 | 2.589356 | 0.044801 | 0.047563 | 0.053472 | 0.053354 | 0.793279 | 0.764371 | 0.739498 | 0.717853 | 0.698747 | 0.679404 | 0 | 0.111697 | 0.386386 | 102,074 | 3,424 | 133 | 29.811332 | 0.561005 | 0.259057 | 0 | 0.721271 | 0 | 0.000489 | 0.015194 | 0 | 0 | 0 | 0.00025 | 0 | 0 | 1 | 0.024939 | false | 0 | 0.001467 | 0.000489 | 0.066015 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 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 | 5 |
982832f42fe8df21a279f8ca2affe9a7ac5c88b3 | 158 | py | Python | backend/equipment_control/admin.py | MeherajUlMahmmud/11th-Hour-Assistance | 9084636b914d72f89ca972bd0edfdad54548a344 | [
"MIT"
] | 1 | 2021-09-15T19:08:09.000Z | 2021-09-15T19:08:09.000Z | backend/equipment_control/admin.py | MeherajUlMahmmud/CSE412-Project | 9084636b914d72f89ca972bd0edfdad54548a344 | [
"MIT"
] | null | null | null | backend/equipment_control/admin.py | MeherajUlMahmmud/CSE412-Project | 9084636b914d72f89ca972bd0edfdad54548a344 | [
"MIT"
] | null | null | null | from django.contrib import admin
from equipment_control.models import *
admin.site.register(EquipmentRequestModel)
admin.site.register(EquipmentPostModel)
| 19.75 | 42 | 0.848101 | 18 | 158 | 7.388889 | 0.666667 | 0.165414 | 0.255639 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082278 | 158 | 7 | 43 | 22.571429 | 0.917241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
982cd02a4dff54ede22d32d8da7b97a98283f03c | 65 | py | Python | Game26/modules/__init__.py | ttkaixin1998/pikachupythongames | 609a3a5a2be3f5a187c332c7980bb5bb14548f02 | [
"MIT"
] | 4,013 | 2018-06-16T08:00:02.000Z | 2022-03-30T11:48:14.000Z | Game26/modules/__init__.py | pigbearcat/Games | b8c47ef1bcce9a9db3f3730c162e6e8e08b508a2 | [
"MIT"
] | 22 | 2018-10-18T00:15:50.000Z | 2022-01-13T08:16:15.000Z | Game26/modules/__init__.py | pigbearcat/Games | b8c47ef1bcce9a9db3f3730c162e6e8e08b508a2 | [
"MIT"
] | 2,172 | 2018-07-20T04:03:14.000Z | 2022-03-31T14:18:29.000Z | '''initialize'''
from .sprites import *
from .gamelevels import * | 21.666667 | 25 | 0.723077 | 7 | 65 | 6.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123077 | 65 | 3 | 25 | 21.666667 | 0.824561 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
985b71b16db350c747ee4df023f23f46c69725b1 | 78 | py | Python | revolt/plugins/commands/__init__.py | ppotatoo/revolt.py | 56d09b050e26898c6051eaee3fdd268a5b16bc22 | [
"MIT"
] | null | null | null | revolt/plugins/commands/__init__.py | ppotatoo/revolt.py | 56d09b050e26898c6051eaee3fdd268a5b16bc22 | [
"MIT"
] | null | null | null | revolt/plugins/commands/__init__.py | ppotatoo/revolt.py | 56d09b050e26898c6051eaee3fdd268a5b16bc22 | [
"MIT"
] | null | null | null | from .bot import Bot
from .command import Command
from .context import Context | 26 | 28 | 0.820513 | 12 | 78 | 5.333333 | 0.416667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141026 | 78 | 3 | 29 | 26 | 0.955224 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
98657470bc0179a77327ae6c03e55176772d0d0a | 8,595 | py | Python | k2/python/tests/numerical_gradient_check_test.py | BuildJet/k2 | 9b21fc4b97cd3e746b6526cd47359bb024d06b15 | [
"Apache-2.0"
] | 1 | 2021-03-03T03:30:40.000Z | 2021-03-03T03:30:40.000Z | k2/python/tests/numerical_gradient_check_test.py | BuildJet/k2 | 9b21fc4b97cd3e746b6526cd47359bb024d06b15 | [
"Apache-2.0"
] | 1 | 2021-03-27T15:52:06.000Z | 2021-03-27T15:52:06.000Z | k2/python/tests/numerical_gradient_check_test.py | BuildJet/k2 | 9b21fc4b97cd3e746b6526cd47359bb024d06b15 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2020 Xiaomi Corporation (authors: Fangjun Kuang)
#
# See ../../../LICENSE for clarification regarding multiple authors
# To run this single test, use
#
# ctest --verbose -R numerical_gradient_check_test_py
import unittest
import k2
import torch
class TestNumericalGradientCheck(unittest.TestCase):
def test_get_tot_scores(self):
def my_func(scores: torch.Tensor,
switch: torch.Tensor) -> torch.Tensor:
s = '''
0 4 1 0
0 1 1 0
1 2 1 0
1 3 1 0
2 7 1 0
3 7 1 0
4 6 1 0
4 8 1 0
5 9 -1 0
6 9 -1 0
7 9 -1 0
8 9 -1 0
9
'''
fsa = k2.Fsa.from_str(s).to(scores.device)
fsa_vec = k2.create_fsa_vec([fsa])
assert scores.requires_grad is True
fsa_vec.scores = scores.to(torch.float32)
log_semiring = switch[0].item() == 1
log_like = fsa_vec.get_tot_scores(log_semiring=log_semiring,
use_double_scores=True)
return -2 * log_like
devices = [torch.device('cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda'))
for device in devices:
s = torch.randn(12)
s.requires_grad_(True)
s = s.to(torch.float64)
torch.autograd.gradcheck(my_func, (s, torch.tensor([1])), eps=1e-2)
torch.autograd.gradcheck(my_func, (s, torch.tensor([0])), eps=1e-2)
def test_get_tot_scores_multiple_fsas(self):
def my_func(scores: torch.Tensor,
switch: torch.Tensor) -> torch.Tensor:
s1 = '''
0 4 1 0
0 1 1 0
1 2 1 0
1 3 1 0
2 7 1 0
3 7 1 0
4 6 1 0
4 8 1 0
5 9 -1 0
6 9 -1 0
7 9 -1 0
8 9 -1 0
9
'''
s2 = '''
0 1 1 0
0 2 2 0
1 2 3 0
1 3 4 0
2 3 5 0
3 4 6 0
3 5 -1 0
4 5 -1 0
5
'''
s3 = '''
0 1 1 0
0 2 2 0
1 3 -1 0
2 3 -1 0
3
'''
fsa1 = k2.Fsa.from_str(s1).to(scores.device)
fsa2 = k2.Fsa.from_str(s2).to(scores.device)
fsa3 = k2.Fsa.from_str(s3).to(scores.device)
fsa_vec = k2.create_fsa_vec([fsa1, fsa2, fsa3])
assert scores.requires_grad is True
fsa_vec.scores = scores.to(torch.float32)
log_semiring = switch[0].item() == 1
log_like = fsa_vec.get_tot_scores(log_semiring=log_semiring,
use_double_scores=True)
return -1.25 * log_like
devices = [torch.device('cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda'))
for device in devices:
s = torch.randn(24)
s.requires_grad_(True)
s = s.to(torch.float64)
torch.autograd.gradcheck(my_func, (s, torch.tensor([1])), eps=1e-2)
torch.autograd.gradcheck(my_func, (s, torch.tensor([0])), eps=1e-2)
def test_index_add_contiguous(self):
def my_func(index: torch.Tensor, value: torch.Tensor,
src: torch.Tensor) -> torch.Tensor:
saved = torch.zeros_like(src).to(torch.float32)
k2.index_add(index, value, saved)
return src + saved
devices = [torch.device('cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda', 0))
for device in devices:
num_elements = torch.randint(10, 100, (1,)).item()
src = torch.rand(num_elements, dtype=torch.float32).to(device)
src.requires_grad_(True)
src = src.to(torch.float64)
num_indexes = num_elements * torch.randint(2, 10, (1,)).item()
index = torch.randint(-1,
num_elements, (num_indexes,),
dtype=torch.int32).to(device)
value = torch.rand(num_indexes, dtype=torch.float32).to(device)
torch.autograd.gradcheck(my_func, (index, value, src),
eps=1e-3,
atol=1e-3,
rtol=1e-3)
def test_index_add_non_contiguous(self):
def my_func(index: torch.Tensor, value: torch.Tensor,
src: torch.Tensor) -> torch.Tensor:
saved = torch.zeros_like(src).to(torch.float32)
k2.index_add(index, value, saved)
return src + saved
devices = [torch.device('cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda', 0))
for device in devices:
num_elements = torch.randint(100, 10000, (1,)).item()
src = torch.rand(num_elements, dtype=torch.float32).to(device)
src.requires_grad_(True)
src = src.to(torch.float64)
src_stride = torch.randint(2, 8, (1,)).item()
src = src[::src_stride]
num_elements = src.numel()
num_indexes = num_elements * torch.randint(2, 10, (1,)).item()
index = torch.randint(0,
num_elements, (num_indexes,),
dtype=torch.int32).to(device)
value_stride = torch.randint(2, 6, (1,)).item()
value = torch.rand(num_indexes * value_stride,
dtype=torch.float32).to(device)
value = value[::value_stride]
assert src.is_contiguous() is False
assert index.is_contiguous()
assert value.is_contiguous() is False
torch.autograd.gradcheck(my_func, (index, value, src),
eps=1e-2,
atol=1e-2,
rtol=1e-2)
def test_index_select_1d(self):
def my_func(src: torch.Tensor, index: torch.Tensor) -> torch.Tensor:
return k2.index_select(src.to(torch.float32), index)
devices = [torch.device('cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda', 0))
for device in devices:
num_elements = torch.randint(10, 100, (1,)).item()
src = torch.rand(num_elements, dtype=torch.float32).to(device)
src.requires_grad_(True)
src = src.to(torch.float64)
num_indexes = num_elements * torch.randint(2, 10, (1,)).item()
index = torch.randint(-1,
num_elements, (num_indexes,),
dtype=torch.int32).to(device)
torch.autograd.gradcheck(my_func, (src, index),
eps=1e-3,
atol=1e-3,
rtol=1e-3)
def test_index_select_2d(self):
def my_func(src: torch.Tensor, index: torch.Tensor) -> torch.Tensor:
return k2.index_select(src.to(torch.float32), index)
devices = [torch.device('cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda', 0))
for device in devices:
num_rows = torch.randint(1, 20, size=(1,)).item()
num_cols = torch.randint(1, 20, size=(1,)).item()
a = torch.rand((num_rows, num_cols),
dtype=torch.float64,
device=device).contiguous()
a.requires_grad_(True)
b = torch.randint(-1,
num_rows,
size=(100,),
device=device,
dtype=torch.int32)
assert a.is_contiguous()
torch.autograd.gradcheck(my_func, (a, b),
eps=1e-3,
atol=1e-3,
rtol=1e-3)
if __name__ == '__main__':
torch.manual_seed(20210109)
unittest.main()
| 34.797571 | 79 | 0.475742 | 1,016 | 8,595 | 3.885827 | 0.133858 | 0.015198 | 0.006079 | 0.048632 | 0.77381 | 0.73227 | 0.731256 | 0.70998 | 0.70998 | 0.683131 | 0 | 0.066693 | 0.417336 | 8,595 | 246 | 80 | 34.939024 | 0.721645 | 0.027225 | 0 | 0.64433 | 0 | 0 | 0.125703 | 0 | 0 | 0 | 0 | 0 | 0.030928 | 1 | 0.061856 | false | 0 | 0.015464 | 0.010309 | 0.113402 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
989c84c6051f8eeaa492e687fff370f80b5f96b7 | 170 | py | Python | gettingstarted/python/ex2/producer.py | crossbario/idma-examples | abfef1a5885365d4480bca6258f6f6bc6d57b1e4 | [
"Apache-2.0"
] | null | null | null | gettingstarted/python/ex2/producer.py | crossbario/idma-examples | abfef1a5885365d4480bca6258f6f6bc6d57b1e4 | [
"Apache-2.0"
] | 2 | 2020-06-23T20:22:19.000Z | 2020-09-23T17:33:45.000Z | gettingstarted/python/ex2/producer.py | isabella232/idma-examples | abfef1a5885365d4480bca6258f6f6bc6d57b1e4 | [
"Apache-2.0"
] | 2 | 2020-06-23T17:25:02.000Z | 2021-05-15T18:44:17.000Z | # coding=utf8
# connect to WAMP router, join a realm (no authentication), publish (non-XBR, plain WAMP) events to topic
# and register a procedure (non-XBR, plain WAMP)
| 34 | 105 | 0.741176 | 27 | 170 | 4.666667 | 0.740741 | 0.095238 | 0.174603 | 0.238095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007042 | 0.164706 | 170 | 4 | 106 | 42.5 | 0.880282 | 0.952941 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
7f28d9f844e66d4e08786d03eec84e5038e8725a | 580 | py | Python | validator/credit_card.py | gpmarchi/credit-card-validator | 01d02e9fd50e76e88e3d13aa71a0350f6b69615c | [
"MIT"
] | null | null | null | validator/credit_card.py | gpmarchi/credit-card-validator | 01d02e9fd50e76e88e3d13aa71a0350f6b69615c | [
"MIT"
] | null | null | null | validator/credit_card.py | gpmarchi/credit-card-validator | 01d02e9fd50e76e88e3d13aa71a0350f6b69615c | [
"MIT"
] | null | null | null | import validator.common_functions as commons
class CreditCard:
def __init__(self, card_number=""):
commons.is_valid_number_in_string(card_number)
self.__card_number = card_number
def get_major_industry_identifier(self):
return self.__card_number[0]
def get_issuer_identification_number(self):
return self.__card_number[0:6]
def get_account_number(self):
return self.__card_number[6:-1]
def get_checksum(self):
return self.__card_number[-1]
def get_card_number(self):
return self.__card_number
| 25.217391 | 54 | 0.713793 | 78 | 580 | 4.782051 | 0.371795 | 0.268097 | 0.262735 | 0.241287 | 0.375335 | 0.310992 | 0 | 0 | 0 | 0 | 0 | 0.013043 | 0.206897 | 580 | 22 | 55 | 26.363636 | 0.797826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.066667 | 0.333333 | 0.866667 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 5 |
7f2d05cebf3a52b8c4cb8339d44baae6fef0c4bf | 69 | py | Python | gpflow/covariances/__init__.py | antonykamp/GPflow | 1831a5d19a50ff525af0ce931c8b82f6306d8196 | [
"Apache-2.0"
] | 1,724 | 2016-01-21T18:10:26.000Z | 2022-03-22T20:03:57.000Z | gpflow/covariances/__init__.py | antonykamp/GPflow | 1831a5d19a50ff525af0ce931c8b82f6306d8196 | [
"Apache-2.0"
] | 1,713 | 2016-02-26T13:09:35.000Z | 2022-03-31T14:39:30.000Z | gpflow/covariances/__init__.py | antonykamp/GPflow | 1831a5d19a50ff525af0ce931c8b82f6306d8196 | [
"Apache-2.0"
] | 519 | 2016-02-17T19:04:45.000Z | 2022-03-26T00:13:13.000Z | from . import kufs, kuus, multioutput
from .dispatch import Kuf, Kuu
| 23 | 37 | 0.768116 | 10 | 69 | 5.3 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15942 | 69 | 2 | 38 | 34.5 | 0.913793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
7f2ec43d3b9e55bf35fb2b453776f35ac4a4ac5e | 64 | py | Python | eksmigrator/__main__.py | ahrizvi/eks-node-migrator | 2972c3011f81cda9c78dabb13ec6449ce70506ab | [
"Apache-2.0"
] | 1 | 2021-11-23T22:34:23.000Z | 2021-11-23T22:34:23.000Z | eksmigrator/__main__.py | ahrizvi/eks-node-migrator | 2972c3011f81cda9c78dabb13ec6449ce70506ab | [
"Apache-2.0"
] | null | null | null | eksmigrator/__main__.py | ahrizvi/eks-node-migrator | 2972c3011f81cda9c78dabb13ec6449ce70506ab | [
"Apache-2.0"
] | null | null | null | import sys
from eksmigrator.cli import main
main(sys.argv[1:])
| 12.8 | 32 | 0.765625 | 11 | 64 | 4.454545 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017857 | 0.125 | 64 | 4 | 33 | 16 | 0.857143 | 0 | 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 | 1 | 0 | 0 | 5 |
7f8367a7b851ffa484783adb70286ffaf3ac28ce | 184 | py | Python | Workshops/25.11.2017 - Python. The Basics - Volume 1 -/Python Codes/4/1_variables.py | Act862/PyLam-Edu | c53114a56da8e5803495acc3c82da1b36ddd452b | [
"MIT"
] | null | null | null | Workshops/25.11.2017 - Python. The Basics - Volume 1 -/Python Codes/4/1_variables.py | Act862/PyLam-Edu | c53114a56da8e5803495acc3c82da1b36ddd452b | [
"MIT"
] | 3 | 2018-11-30T08:30:49.000Z | 2018-11-30T08:38:02.000Z | Workshops/25.11.2017 - Python. The Basics - Volume 1 -/Python Codes/4/1_variables.py | Act862/PyLam-Edu | c53114a56da8e5803495acc3c82da1b36ddd452b | [
"MIT"
] | 2 | 2018-07-01T14:11:47.000Z | 2018-11-04T01:06:55.000Z | x = 5
y = 3.15
name = "George"
flag = True
print("The value of x is: ", x)
print("The value of y is: ", y)
print("The value of name is: ", name)
print("The value of flag is: ", flag)
| 18.4 | 37 | 0.608696 | 37 | 184 | 3.027027 | 0.378378 | 0.285714 | 0.464286 | 0.535714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027972 | 0.222826 | 184 | 9 | 38 | 20.444444 | 0.755245 | 0 | 0 | 0 | 0 | 0 | 0.478261 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 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 | 1 | 0 | 5 |
7fb0b611cdea9c6a4938f3ca255eb9a919021e8f | 218 | py | Python | todolist/todolist/urls.py | khan-asim/TodoList-App | 86f3b0b0859f28100278ca1c305d6a61287f157f | [
"MIT"
] | null | null | null | todolist/todolist/urls.py | khan-asim/TodoList-App | 86f3b0b0859f28100278ca1c305d6a61287f157f | [
"MIT"
] | null | null | null | todolist/todolist/urls.py | khan-asim/TodoList-App | 86f3b0b0859f28100278ca1c305d6a61287f157f | [
"MIT"
] | null | null | null |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
# url(r'^$', include('todos.urls')),
url(r'^todos/', include('todos.urls')),
url(r'^admin/', admin.site.urls),
]
| 21.8 | 43 | 0.642202 | 30 | 218 | 4.666667 | 0.433333 | 0.085714 | 0.228571 | 0.271429 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.155963 | 218 | 9 | 44 | 24.222222 | 0.76087 | 0.155963 | 0 | 0 | 0 | 0 | 0.132597 | 0 | 0 | 0 | 0 | 0.111111 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
7fb29cb7ea108786257b8da60a2b8f5a79f7285c | 160 | py | Python | authors/apps/article_rating/admin.py | andela/ah-backend-dojo | f2b14f15c4af906da846cafe722f13868d58371f | [
"BSD-3-Clause"
] | 3 | 2019-05-01T10:41:09.000Z | 2021-04-25T22:17:20.000Z | authors/apps/article_rating/admin.py | andela/ah-backend-dojo | f2b14f15c4af906da846cafe722f13868d58371f | [
"BSD-3-Clause"
] | 24 | 2019-04-23T14:56:21.000Z | 2021-12-13T19:58:37.000Z | authors/apps/article_rating/admin.py | andela/ah-backend-dojo | f2b14f15c4af906da846cafe722f13868d58371f | [
"BSD-3-Clause"
] | 4 | 2019-06-29T10:40:32.000Z | 2022-01-04T11:44:53.000Z |
from django.contrib import admin
from authors.apps.article_rating.models import ArticleRating
# Register your models here.
admin.site.register(ArticleRating)
| 22.857143 | 60 | 0.8375 | 21 | 160 | 6.333333 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 160 | 6 | 61 | 26.666667 | 0.923611 | 0.1625 | 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 | 1 | 0 | 0 | 5 |
f6bb3754b700dec9c2e39e70d0506efc52382ae6 | 5,144 | py | Python | course_catalog/migrations/0066_podcast_podcastepisode.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 12 | 2017-09-27T21:23:27.000Z | 2020-12-25T04:31:30.000Z | course_catalog/migrations/0066_podcast_podcastepisode.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 3,293 | 2017-06-30T18:16:01.000Z | 2022-03-31T18:01:34.000Z | course_catalog/migrations/0066_podcast_podcastepisode.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T12:19:57.000Z | 2020-04-13T12:19:57.000Z | # Generated by Django 2.2.10 on 2020-04-06 16:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("course_catalog", "0065_higher_prices")]
operations = [
migrations.CreateModel(
name="Podcast",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_on", models.DateTimeField(auto_now_add=True)),
("updated_on", models.DateTimeField(auto_now=True)),
("title", models.CharField(max_length=256)),
("short_description", models.TextField(blank=True, null=True)),
("podcast_id", models.CharField(max_length=80, unique=True)),
("full_description", models.TextField(blank=True, null=True)),
("image_src", models.URLField(blank=True, max_length=400, null=True)),
("published", models.BooleanField(default=True)),
("url", models.URLField(max_length=2048, null=True)),
("searchable", models.BooleanField(default=True)),
(
"offered_by",
models.ManyToManyField(
blank=True, to="course_catalog.LearningResourceOfferor"
),
),
(
"topics",
models.ManyToManyField(blank=True, to="course_catalog.CourseTopic"),
),
],
options={"abstract": False},
),
migrations.AlterField(
model_name="favoriteitem",
name="content_type",
field=models.ForeignKey(
limit_choices_to={
"model__in": (
"course",
"bootcamp",
"userlist",
"program",
"video",
"podcast",
"podcastepisode",
)
},
on_delete=django.db.models.deletion.CASCADE,
to="contenttypes.ContentType",
),
),
migrations.AlterField(
model_name="userlistitem",
name="content_type",
field=models.ForeignKey(
limit_choices_to={
"model__in": (
"course",
"bootcamp",
"program",
"video",
"podcast",
"podcastepisode",
)
},
on_delete=django.db.models.deletion.CASCADE,
to="contenttypes.ContentType",
),
),
migrations.CreateModel(
name="PodcastEpisode",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_on", models.DateTimeField(auto_now_add=True)),
("updated_on", models.DateTimeField(auto_now=True)),
("title", models.CharField(max_length=256)),
("short_description", models.TextField(blank=True, null=True)),
("episode_id", models.CharField(max_length=80)),
("full_description", models.TextField(blank=True, null=True)),
("image_src", models.URLField(blank=True, max_length=400, null=True)),
("last_modified", models.DateTimeField(blank=True, null=True)),
("published", models.BooleanField(default=True)),
("transcript", models.TextField(blank=True, default="")),
("url", models.URLField(max_length=2048, null=True)),
("searchable", models.BooleanField(default=True)),
("duration", models.CharField(blank=True, max_length=10, null=True)),
(
"offered_by",
models.ManyToManyField(
blank=True, to="course_catalog.LearningResourceOfferor"
),
),
(
"podcast",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="episodes",
to="course_catalog.Podcast",
),
),
(
"topics",
models.ManyToManyField(blank=True, to="course_catalog.CourseTopic"),
),
],
options={"unique_together": {("podcast", "episode_id")}},
),
]
| 39.267176 | 88 | 0.446734 | 373 | 5,144 | 5.994638 | 0.276139 | 0.052326 | 0.044723 | 0.053667 | 0.740161 | 0.740161 | 0.715116 | 0.661002 | 0.661002 | 0.661002 | 0 | 0.015989 | 0.440708 | 5,144 | 130 | 89 | 39.569231 | 0.76121 | 0.008942 | 0 | 0.741935 | 1 | 0 | 0.145801 | 0.038854 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.016129 | 0 | 0.040323 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
f6bc24ce04f78862dc8ecfd91502348da4f386a8 | 137 | py | Python | app/core/apps.py | MaiLyLe/appreciateu-backend-code | e498dc4070ae3f6e8650cdff750ee82816d60919 | [
"MIT"
] | null | null | null | app/core/apps.py | MaiLyLe/appreciateu-backend-code | e498dc4070ae3f6e8650cdff750ee82816d60919 | [
"MIT"
] | null | null | null | app/core/apps.py | MaiLyLe/appreciateu-backend-code | e498dc4070ae3f6e8650cdff750ee82816d60919 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CoreConfig(AppConfig):
"""Auto-generated AppConfig class for Core app"""
name = 'core'
| 19.571429 | 53 | 0.715328 | 17 | 137 | 5.764706 | 0.764706 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.182482 | 137 | 6 | 54 | 22.833333 | 0.875 | 0.313869 | 0 | 0 | 1 | 0 | 0.045455 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
1004d0bc22c522f1ad6e64c37bc5aed0b54c3ff2 | 177 | py | Python | scenarios/bank_account_verification_show/executable.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 12 | 2015-04-12T06:18:33.000Z | 2021-03-03T23:54:19.000Z | scenarios/bank_account_verification_show/executable.py | takwas/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 1 | 2021-11-24T20:10:19.000Z | 2021-11-24T20:10:19.000Z | scenarios/bank_account_verification_show/executable.py | takwas/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 14 | 2015-03-23T17:52:06.000Z | 2021-11-24T11:04:15.000Z | import balanced
balanced.configure('ak-test-2eKlj1ZDfAcZSARMf3NMhBHywDej0avSY')
verification = balanced.BankAccountVerification.fetch('/verifications/BZ3SVvXTx85CrYo8045tr2cU') | 44.25 | 96 | 0.875706 | 13 | 177 | 11.923077 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.070175 | 0.033898 | 177 | 4 | 96 | 44.25 | 0.836257 | 0 | 0 | 0 | 0 | 0 | 0.449438 | 0.449438 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
63e4a998efe8bc1cecbe6f00e4f0ce4b48da2da5 | 23 | py | Python | Aulas/a19/a16.py | rafaelbhcosta/Python_para_iniciantes | f6b750b71e3a9d6701b29cc6e8b09aad2649c700 | [
"MIT"
] | null | null | null | Aulas/a19/a16.py | rafaelbhcosta/Python_para_iniciantes | f6b750b71e3a9d6701b29cc6e8b09aad2649c700 | [
"MIT"
] | null | null | null | Aulas/a19/a16.py | rafaelbhcosta/Python_para_iniciantes | f6b750b71e3a9d6701b29cc6e8b09aad2649c700 | [
"MIT"
] | null | null | null | # Condições e repetição | 23 | 23 | 0.826087 | 3 | 23 | 6.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 23 | 1 | 23 | 23 | 0.95 | 0.913043 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
63ea14a9994ae5b5e3b115878dfe9c00dfaee5ce | 64 | py | Python | main.py | oleglpts/swig-example | 98f8f1b93a0f52ec478b1590ea17d507f9eb423c | [
"MIT"
] | null | null | null | main.py | oleglpts/swig-example | 98f8f1b93a0f52ec478b1590ea17d507f9eb423c | [
"MIT"
] | null | null | null | main.py | oleglpts/swig-example | 98f8f1b93a0f52ec478b1590ea17d507f9eb423c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from test_wget import test_wget
test_wget()
| 12.8 | 31 | 0.78125 | 11 | 64 | 4.272727 | 0.636364 | 0.510638 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017544 | 0.109375 | 64 | 4 | 32 | 16 | 0.807018 | 0.265625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
63f80555d84235c2257bcff12ba80da01ca4f53e | 7,373 | py | Python | lcp_video/benchmarks/real_time_data_analysis.py | vstadnytskyi/lcp-video | a65f9c8ecd370d975128af67427f3dd8141bf667 | [
"BSD-3-Clause"
] | null | null | null | lcp_video/benchmarks/real_time_data_analysis.py | vstadnytskyi/lcp-video | a65f9c8ecd370d975128af67427f3dd8141bf667 | [
"BSD-3-Clause"
] | null | null | null | lcp_video/benchmarks/real_time_data_analysis.py | vstadnytskyi/lcp-video | a65f9c8ecd370d975128af67427f3dd8141bf667 | [
"BSD-3-Clause"
] | null | null | null | """
benchmark file to test conversion of raw byte stream to image format
"""
def save_frame_to_hdf5_file(fsrc, key = 'images', compression = 0):
"""
a benchmark function that would test the write speed from an hdf5 file
"""
preparation = ""
preparation += "from h5py import File;"
preparation += "from tempfile import gettempdir;"
preparation += "import os;"
preparation += "root = gettempdir()"
preparation += "filename_dst = os.path.join(root,'test_destination.hdf5')"
preparation += "filename_dst = os.path.join(root,'test_destination.hdf5')"
testcode = ''
def hits_1():
"""
"""
pass
def benchmark_get_mono12packed_conversion_mask():
from lcp_video.analysis import get_mono12packed_conversion_mask
from ubcs_auxiliary.save_load_object import load_from_file
from time import time
import timeit
from numpy import array
preparation= ''
preparation += "from lcp_video.analysis import get_mono12packed_conversion_mask;"
preparation += "length=1,height = 2048; width = 2448;"
testcode = 'mask = get_mono12packed_conversion_mask(int(width*height*length*1.5))'
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"{round(temp.mean(),3)} +- {round(temp.std(),3)}")
def benchmark_mono12packed_to_image():
#mono12packed_to_image(rawdata, height, width, mask)
from lcp_video.analysis import get_mono12packed_conversion_mask
from ubcs_auxiliary.save_load_object import load_from_file
from time import time
import timeit
from numpy import array
preparation = ""
testcode = 'data = mono12packed_to_image(rawdata,height,width,mask)'
preparation += "from ubcs_auxiliary.save_load_object import load_from_file;"
preparation += "from lcp_video.analysis import get_mono12packed_conversion_mask;"
preparation += "from lcp_video.analysis import mono12packed_to_image;"
preparation += "rawdata = load_from_file('lcp_video/test_data/flir_rawdata_mono12packed.pkl');"
preparation += "length=1,height = 2048; width = 2448;"
preparation += "mask = get_mono12packed_conversion_mask(int(width*height*1.5));"
preparation += 'from numpy import vstack, tile, hstack, arange,reshape,vstack, tile, hstack, arange,reshape;'
print('tested code')
print("l1: data_Nx8 = ((rawdata.reshape((-1,1)) & (2**arange(8))) != 0)")
print("l2: data_N8x1 = data_Nx8.flatten()")
print("l3: data_Mx12 = data_N8x1.reshape((int(rawdata.shape[0]/1.5),12))")
print("l4: data = (data_Mx12*mask).sum(axis=1)")
print("l5: data.reshape((length,height,width)).astype('int16')")
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"full code: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
testcode = "data_Nx8 = ((rawdata.reshape((-1,1)) & (2**arange(8))) != 0);"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line1: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
preparation +=testcode
testcode = "data_N8x1 = data_Nx8.flatten();"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line2: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
preparation +=testcode
testcode = "data_Mx12 = data_N8x1.reshape((int(rawdata.shape[0]/1.5),12)).astype('int16');"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line3: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
preparation +=testcode
testcode = "data = (data_Mx12*mask).sum(axis=1);"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line4: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
preparation +=testcode
testcode = "data.reshape((height,width)).astype('int16');"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line5: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
preparation +=testcode
def benchmark_mono12p_to_image(N = 2):
#mono12packed_to_image(rawdata, height, width, mask)
from ubcs_auxiliary.save_load_object import load_from_file
from time import time
import timeit
from numpy import array
preparation = ""
testcode = 'data = mono12p_to_image(rawdata,length,height,width,mask,mask8)'
preparation += "from ubcs_auxiliary.save_load_object import load_from_file;"
preparation += 'from numpy import vstack, tile, hstack, arange,reshape, vstack, tile, hstack, arange,reshape, packbits, reshape, int16, concatenate, array;'
preparation += "from lcp_video.analysis import mono12p_to_image;"
preparation += "from lcp_video.analysis import get_mono12p_conversion_mask,get_mono12p_conversion_mask_8bit;"
preparation += f"length = {int(N)};height = 2048; width = 2448;"
preparation += "rawdata = load_from_file('lcp_video/test_data/flir_rawdata_mono12p.pkl'); rawdata = array([rawdata]*length);"
preparation += "mask = get_mono12p_conversion_mask(int(width*height*length*1.5));"
preparation += "mask8 = get_mono12p_conversion_mask_8bit(int(width*height*length*1.5));"
t_full = timeit.Timer(testcode,preparation)
print('tested code')
print("1: data_Nx8 = ((rawdata.reshape((-1,1)) & (mask8)) != 0)")
print("2: data_N8x1 = data_Nx8.flatten()")
print("3: data_Mx12 = data_N8x1.reshape((int(rawdata.shape[-1]*length/1.5),12)).astype('int16')")
print("4: data = (data_Mx12 * mask)).T.sum(axis=0)")
print("5: data.reshape((length,height,width)).astype('int16')')")
temp = array(t_full.repeat(4,20))/20
print(f"Full function: {round(temp.mean(),3)} +- {round(temp.std(),3)}")
testcode = 'data_Nx8 = ((rawdata.reshape((-1,1)) & (mask8)) != 0);'
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line1: {round(temp.mean(),3)} +- {round(temp.std(),3)} with min of {round(temp.min(),3)} ")
preparation +=testcode
testcode = 'data_N8x1 = data_Nx8.flatten();'
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line2: {round(temp.mean(),3)} +- {round(temp.std(),3)} with min of {round(temp.min(),3)} ")
preparation +=testcode
testcode = "data_Mx12 = data_N8x1.reshape((int(rawdata.shape[-1]*length/1.5),12));"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line3: {round(temp.mean(),3)} +- {round(temp.std(),3)} with min of {round(temp.min(),3)} ")
preparation +=testcode
testcode = "data = (data_Mx12*mask).T.sum(axis=0);"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line4: {round(temp.mean(),3)} +- {round(temp.std(),3)} with min of {round(temp.min(),3)} ")
preparation +=testcode
testcode = "data.reshape((length,height,width)).astype('int16');"
t = timeit.Timer(testcode,preparation)
temp = array(t.repeat(4,20))/20
print(f"line5: {round(temp.mean(),3)} +- {round(temp.std(),3)} with min of {round(temp.min(),3)} ")
def profile_mono12p_to_image():
from ubcs_auxiliary.save_load_object import load_from_file
from lcp_video.analysis import mono12p_to_image
mono12p = load_from_file('lcp_video/test_data/flir_rawdata_mono12p.pkl')
height = 2048
width = 2448
data = mono12p_to_image(mono12p,height,width)
| 43.886905 | 160 | 0.679371 | 1,024 | 7,373 | 4.743164 | 0.118164 | 0.057443 | 0.050854 | 0.080296 | 0.830142 | 0.801318 | 0.781141 | 0.726992 | 0.643401 | 0.643401 | 0 | 0.051331 | 0.154483 | 7,373 | 167 | 161 | 44.149701 | 0.727783 | 0.032822 | 0 | 0.476563 | 0 | 0.15625 | 0.499154 | 0.304115 | 0 | 0 | 0 | 0 | 0 | 1 | 0.046875 | false | 0.007813 | 0.21875 | 0 | 0.265625 | 0.195313 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1209fd715290099bd761eefae18a8340332ab121 | 264 | py | Python | src/wai/bynning/extraction/__init__.py | waikato-datamining/bynning | 01b7368d4dc1094651d7cbe067576dfb3756a1d3 | [
"MIT"
] | null | null | null | src/wai/bynning/extraction/__init__.py | waikato-datamining/bynning | 01b7368d4dc1094651d7cbe067576dfb3756a1d3 | [
"MIT"
] | null | null | null | src/wai/bynning/extraction/__init__.py | waikato-datamining/bynning | 01b7368d4dc1094651d7cbe067576dfb3756a1d3 | [
"MIT"
] | null | null | null | from ._ConstantExtractor import ConstantExtractor
from ._Extractor import Extractor
from ._IdentityExtractor import IdentityExtractor
from ._IndexExtractor import IndexExtractor
from ._LabelExtractor import LabelExtractor
from ._SizeExtractor import SizeExtractor
| 37.714286 | 49 | 0.886364 | 24 | 264 | 9.5 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 264 | 6 | 50 | 44 | 0.95 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
120df784a1da64073a642e72d49d0afdcc5b0ea7 | 17,038 | py | Python | test/test_space_handler.py | TiddlySpace/tiddlyspace | 5f2139340d2d9e3a37068b5c58ecb2e599d798b8 | [
"BSD-3-Clause"
] | 32 | 2015-01-04T10:54:29.000Z | 2022-01-22T16:45:24.000Z | test/test_space_handler.py | TiddlySpace/tiddlyspace | 5f2139340d2d9e3a37068b5c58ecb2e599d798b8 | [
"BSD-3-Clause"
] | 4 | 2016-12-08T14:04:26.000Z | 2018-02-20T10:23:33.000Z | test/test_space_handler.py | TiddlySpace/tiddlyspace | 5f2139340d2d9e3a37068b5c58ecb2e599d798b8 | [
"BSD-3-Clause"
] | 14 | 2015-01-19T23:18:20.000Z | 2021-06-22T01:10:08.000Z | """
Test and flesh a /spaces handler-space.
GET /spaces: list all spaces
GET /spaces/{space_name}: 204 if exist
GET /spaces/{space_name}/members: list all members
PUT /spaces/{space_name}: create a space
PUT /spaces/{space_name}/members/{member_name}: add a member
DELETE /spaces/{space_name}/members/{member_name}: remove a member
POST /spaces/{space_name}: Handle subscription, the data package is
JSON as {"subscriptions": ["space1", "space2", "space3"]}
"""
import simplejson
import httplib2
import wsgi_intercept
import py.test
from wsgi_intercept import httplib2_intercept
from httpexceptor import HTTP409
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.recipe import Recipe
from tiddlyweb.model.user import User
from tiddlywebplugins.tiddlyspace.spaces import _update_policy, _make_policy
from test.fixtures import make_test_env, make_fake_space, get_auth
SYSTEM_SPACES = ['system-plugins', 'system-info', 'system-images',
'system-theme', 'system-applications']
SYSTEM_URLS = ['http://system-plugins.0.0.0.0:8080/',
'http://system-info.0.0.0.0:8080/', 'http://system-applications.0.0.0.0:8080/',
'http://system-images.0.0.0.0:8080/', 'http://system-theme.0.0.0.0:8080/']
def setup_module(module):
make_test_env(module)
httplib2_intercept.install()
from tiddlyweb.config import config
config['blacklisted_spaces'] = ['scrappy']
wsgi_intercept.add_wsgi_intercept('0.0.0.0', 8080, app_fn)
wsgi_intercept.add_wsgi_intercept('cdent.0.0.0.0', 8080, app_fn)
wsgi_intercept.add_wsgi_intercept('extra.0.0.0.0', 8080, app_fn)
make_fake_space(module.store, 'cdent')
user = User('cdent')
user.set_password('cow')
module.store.put(user)
user = User('fnd')
user.set_password('bird')
module.store.put(user)
user = User('psd')
user.set_password('cat')
module.store.put(user)
def test_spaces_list():
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces',
method='GET')
assert response['status'] == '200'
assert response['cache-control'] == 'no-cache, no-transform'
info = simplejson.loads(content)
uris = [uri for _, uri in [item.values() for item in info]]
names = [name for name, _ in [item.values() for item in info]]
expected_uris = ['http://0.0.0.0:8080/', 'http://cdent.0.0.0.0:8080/']
expected_uris.extend(SYSTEM_URLS)
expected_names = ['cdent', 'frontpage']
expected_names.extend(SYSTEM_SPACES)
assert sorted(uris) == sorted(expected_uris)
assert sorted(names) == sorted(expected_names)
make_fake_space(store, 'fnd')
response, content = http.request('http://0.0.0.0:8080/spaces',
method='GET')
assert response['status'] == '200'
info = simplejson.loads(content)
uris = [uri for _, uri in [item.values() for item in info]]
assert 'http://cdent.0.0.0.0:8080/' in uris
assert 'http://fnd.0.0.0.0:8080/' in uris
def test_space_exist():
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/cdent',
method='GET')
assert response['status'] == '204'
assert content == ''
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/nancy',
method='GET')
assert response['status'] == '404'
assert 'There is nothing at this address.' in content
def test_space_members():
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/cdent/members',
method='GET')
assert response['status'] == '401'
cookie = get_auth('cdent', 'cow')
response, content = http.request('http://0.0.0.0:8080/spaces/cdent/members',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='GET')
assert response['status'] == '200'
assert response['cache-control'] == 'no-cache, no-transform'
info = simplejson.loads(content)
assert info == ['cdent']
response, content = http.request('http://0.0.0.0:8080/spaces/nancy/members',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='GET')
response['status'] == '404'
def test_create_space():
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/cdent',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='PUT')
assert response['status'] == '409'
response, content = http.request('http://0.0.0.0:8080/spaces/extra',
method='GET')
assert response['status'] == '404'
response, content = http.request('http://0.0.0.0:8080/spaces/extra',
method='PUT')
assert response['status'] == '403'
response, content = http.request('http://0.0.0.0:8080/spaces/extra',
method='PUT',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
)
assert response['status'] == '201'
assert response['location'] == 'http://extra.0.0.0.0:8080/'
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='GET')
response['status'] == '200'
info = simplejson.loads(content)
assert info == ['cdent'], content
response, content = http.request('http://extra.0.0.0.0:8080/bags/extra_public/tiddlers/SiteInfo.json')
assert response['status'] == '200'
info = simplejson.loads(content)
assert 'Space extra' in info['text']
response, content = http.request(
'http://extra.0.0.0.0:8080/GettingStarted.json')
assert response['status'] == '200'
info = simplejson.loads(content)
assert info['bag'] == 'extra_public'
bag = store.get(Bag('extra_public'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == []
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent']
assert bag.policy.write == ['cdent']
assert bag.policy.create == ['cdent']
assert bag.policy.delete == ['cdent']
bag = store.get(Bag('extra_private'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == ['cdent']
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent']
assert bag.policy.write == ['cdent']
assert bag.policy.create == ['cdent']
assert bag.policy.delete == ['cdent']
bag = store.get(Bag('extra_archive'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == ['cdent']
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent']
assert bag.policy.write == ['cdent']
assert bag.policy.create == ['cdent']
assert bag.policy.delete == ['cdent']
recipe = store.get(Recipe('extra_public'))
assert recipe.policy.owner == 'cdent'
assert recipe.policy.read == []
assert recipe.policy.accept == ['NONE']
assert recipe.policy.manage == ['cdent']
assert recipe.policy.write == ['cdent']
assert recipe.policy.create == ['cdent']
assert recipe.policy.delete == ['cdent']
recipe_list = recipe.get_recipe()
assert len(recipe_list) == 7
assert recipe_list[0][0] == 'system'
assert recipe_list[1][0] == 'tiddlyspace'
assert recipe_list[2][0] == 'system-plugins_public'
assert recipe_list[3][0] == 'system-info_public'
assert recipe_list[4][0] == 'system-images_public'
assert recipe_list[5][0] == 'system-theme_public'
assert recipe_list[6][0] == 'extra_public'
recipe = store.get(Recipe('extra_private'))
recipe_list = recipe.get_recipe()
assert recipe.policy.owner == 'cdent'
assert recipe.policy.read == ['cdent']
assert recipe.policy.accept == ['NONE']
assert recipe.policy.manage == ['cdent']
assert recipe.policy.write == ['cdent']
assert recipe.policy.create == ['cdent']
assert recipe.policy.delete == ['cdent']
assert len(recipe_list) == 8
assert recipe_list[0][0] == 'system'
assert recipe_list[1][0] == 'tiddlyspace'
assert recipe_list[2][0] == 'system-plugins_public'
assert recipe_list[3][0] == 'system-info_public'
assert recipe_list[4][0] == 'system-images_public'
assert recipe_list[5][0] == 'system-theme_public'
assert recipe_list[6][0] == 'extra_public'
assert recipe_list[7][0] == 'extra_private'
def test_reserved_space_name():
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/www',
method='PUT',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
)
assert response['status'] == '409'
assert 'Invalid space name: www' in content
def test_case_in_space():
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/CeXtRa',
method='PUT',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
)
assert response['status'] == '409'
def test_chars_in_space():
testcases = [
('foo', '201'),
('bAr', '409'),
('f0o', '201'),
('fo0', '201'),
('0foo', '201'),
('foo-bar', '201'),
('foo-bar-baz', '201'),
('-foo', '409'),
('foo-', '409'),
]
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
for name, status in testcases:
response, content = http.request('http://0.0.0.0:8080/spaces/%s' % name,
method='PUT',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
)
assert response['status'] == status
def test_add_a_member():
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members/fnd',
method='PUT',
)
assert response['status'] == '403', content
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/fnd',
method='PUT',
)
assert response['status'] == '403', content
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members/fnd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='PUT',
)
assert response['status'] == '403'
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/fnd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='PUT',
)
assert response['status'] == '204'
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='GET')
assert response['status'] == '200', content
info = simplejson.loads(content)
assert info == ['cdent', 'fnd']
bag = store.get(Bag('extra_private'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == ['cdent', 'fnd']
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent', 'fnd']
assert bag.policy.write == ['cdent', 'fnd']
assert bag.policy.create == ['cdent', 'fnd']
assert bag.policy.delete == ['cdent', 'fnd']
bag = store.get(Bag('extra_archive'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == ['cdent', 'fnd']
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent', 'fnd']
assert bag.policy.write == ['cdent', 'fnd']
assert bag.policy.create == ['cdent', 'fnd']
assert bag.policy.delete == ['cdent', 'fnd']
bag = store.get(Bag('extra_public'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == []
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent', 'fnd']
assert bag.policy.write == ['cdent', 'fnd']
assert bag.policy.create == ['cdent', 'fnd']
assert bag.policy.delete == ['cdent', 'fnd']
# authed user not in space may not add people
cookie = get_auth('psd', 'cat')
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members/psd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='PUT',
)
assert response['status'] == '403'
cookie = get_auth('fnd', 'bird')
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/psd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='PUT',
)
assert response['status'] == '204'
cookie = get_auth('fnd', 'bird')
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/mary',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='PUT',
)
assert response['status'] == '409'
def test_update_policy_nonstandard():
policy = _make_policy('jon')
setattr(policy, 'write', ['ANY'])
setattr(policy, 'read', ['fnd'])
py.test.raises(HTTP409, '_update_policy(policy, add="jon")')
setattr(policy, 'write', [])
setattr(policy, 'create', ['NONE'])
py.test.raises(HTTP409, '_update_policy(policy, add="jon")')
def test_delete_member():
cookie = get_auth('fnd', 'bird')
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members/psd',
method='DELETE',
)
assert response['status'] == '403'
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/psd',
method='DELETE',
)
assert response['status'] == '403'
response, content = http.request('http://0.0.0.0:8080/spaces/extra/members/psd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='DELETE',
)
assert response['status'] == '403'
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/psd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='DELETE',
)
assert response['status'] == '204'
# delete self
response, content = http.request('http://extra.0.0.0.0:8080/spaces/extra/members/fnd',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
method='DELETE',
)
assert response['status'] == '204'
bag = store.get(Bag('extra_private'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == ['cdent']
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent']
assert bag.policy.write == ['cdent']
assert bag.policy.create == ['cdent']
assert bag.policy.delete == ['cdent']
bag = store.get(Bag('extra_archive'))
assert bag.policy.owner == 'cdent'
assert bag.policy.read == ['cdent']
assert bag.policy.accept == ['NONE']
assert bag.policy.manage == ['cdent']
assert bag.policy.write == ['cdent']
assert bag.policy.create == ['cdent']
assert bag.policy.delete == ['cdent']
def test_subscription():
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
subscriptions = simplejson.dumps({'subscriptions': ['extra']})
response, content = http.request('http://0.0.0.0:8080/spaces/cdent',
method='POST',
headers={
'Content-Type': 'application/json',
},
body=subscriptions)
assert response['status'] == '403'
response, content = http.request('http://0.0.0.0:8080/spaces/cdent',
method='POST',
headers={
'Content-Type': 'application/json',
'Cookie': 'tiddlyweb_user="%s"' % cookie,
},
body='')
assert response['status'] == '409'
response, content = http.request('http://0.0.0.0:8080/spaces/cdent',
method='POST',
headers={
'Content-Type': 'application/json',
'Cookie': 'tiddlyweb_user="%s"' % cookie,
},
body=subscriptions)
assert response['status'] == '204'
def test_blacklisted_subscription():
cookie = get_auth('cdent', 'cow')
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces/scrappy',
method='PUT',
headers={'Cookie': 'tiddlyweb_user="%s"' % cookie},
)
assert response['status'] == '201'
subscriptions = simplejson.dumps({'subscriptions': ['scrappy']})
response, content = http.request('http://0.0.0.0:8080/spaces/cdent',
method='POST',
headers={
'Content-Type': 'application/json',
'Cookie': 'tiddlyweb_user="%s"' % cookie,
},
body=subscriptions)
assert response['status'] == '409'
assert 'Subscription not allowed to space: scrappy' in content
def test_list_my_spaces():
http = httplib2.Http()
response, content = http.request('http://0.0.0.0:8080/spaces?mine=1',
method='GET')
assert response['status'] == '200'
info = simplejson.loads(content)
assert 'fnd' not in info
| 35.945148 | 106 | 0.605353 | 2,119 | 17,038 | 4.786692 | 0.084474 | 0.02938 | 0.028986 | 0.019324 | 0.786355 | 0.765454 | 0.739229 | 0.715074 | 0.711427 | 0.682244 | 0 | 0.044177 | 0.214814 | 17,038 | 473 | 107 | 36.021142 | 0.714008 | 0.030109 | 0 | 0.663212 | 0 | 0.020725 | 0.254481 | 0.005207 | 0 | 0 | 0 | 0 | 0.357513 | 1 | 0.036269 | false | 0.007772 | 0.031088 | 0 | 0.067358 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1243e7ca7a643469bdc0666fc8afeea65d35cc40 | 15,558 | py | Python | app/lpd/tests/alphabet.py | stfc-aeg/lpd-detector | 7bc0d9700a3d3992a4541f05e1434aba0d056dcc | [
"Apache-2.0"
] | null | null | null | app/lpd/tests/alphabet.py | stfc-aeg/lpd-detector | 7bc0d9700a3d3992a4541f05e1434aba0d056dcc | [
"Apache-2.0"
] | 20 | 2018-10-04T07:36:22.000Z | 2020-05-18T13:10:42.000Z | app/lpd/tests/alphabet.py | stfc-aeg/lpd-detector | 7bc0d9700a3d3992a4541f05e1434aba0d056dcc | [
"Apache-2.0"
] | null | null | null | '''
Alphabet.py - A collection of functions to help draw letters on an ASIC
'''
import argparse, sys
from datetime import datetime
class Alphabet():
def __init__(self, fileName=None):
if fileName == None:
raise Exception("Alphabet Object created without fileName argument!")
else:
self.file = open(fileName, "w")
def horizontalLine(self, tile, asic, start, stop):
'''
Draws a straight line from 'start' until 'stop', targeting 'asic' and 'tile'
Note: stop must be greater than start
'''
if not stop >= start:
raise Exception("stop (%s) must be greater than start (%s) " % (stop, start))
for index in range(0, 512, 16):
lowerLimit = index
upperLimit = index +16
if (start >= lowerLimit and start < upperLimit) and (stop < lowerLimit or stop >= upperLimit):
raise Exception("start (%s) not on same horizontal line as stop (%s) " % (start, stop))
xmlString = ' <!-- Draw horizontal line between pixels %3s and %3s in tile: %2s asic: %s -->\n' % (start, stop, tile, asic)
for pixel in range(start, stop+1):
# xmlString += ' <mux_decoder tile="%s" asic="%s" pixel="%s" value="4"/>\n' % (tile, asic, pixel)
#
#
xmlString += ' <mux_decoder '
if tile != None:
xmlString += 'tile="%s" ' % tile
if asic != None:
xmlString += 'asic="%s" ' % asic
xmlString += 'pixel="%s" value="4"/>\n' % pixel
self.file.write( xmlString)
def verticalLine(self, tile, asic, start, stop):
'''
Draws a straight line from 'start' until 'stop', targeting 'asic' and 'tile'
Note: stop must be greater than start
'''
if not stop >= start:
raise Exception("stop (%s) must be greater than start (%s) " % (stop, start))
if not (start % 16 and stop % 16):
raise Exception("start (%s) not on same vertical line as stop (%s) " % (start, stop))
xmlString = ' <!-- Draw vertical line between pixels %3s and %3s in tile: %2s asic: %s -->\n' % (start, stop, tile, asic)
for pixel in range(start, stop+1, 16):
xmlString += ' <mux_decoder '
if tile != None:
xmlString += 'tile="%s" ' % tile
if asic != None:
xmlString += 'asic="%s" ' % asic
xmlString += 'pixel="%s" value="4"/>\n' % pixel
self.file.write( xmlString)
def singlePixel(self, tile, asic, pixel):
'''
Place a single pixel within a specified tile and ASIC
'''
if not ( -1 < pixel < 512):
raise Exception("singlePixel() pixel (%s) outside valid range " % ( pixel))
xmlString = ' <mux_decoder tile="%s" asic="%s" pixel="%s" value="4"/>\n' % (tile, asic, pixel)
self.file.write( xmlString)
def insertComment(self, comment):
xmlString = '\n\n <!-- COMMENT: %s -->\n' % (comment)
self.file.write( xmlString)
def __del__(self):
self.file.close()
if __name__ == '__main__':
a = Alphabet(fileName = "test.xml")
a.insertComment( " This is the file generated by Alphabet.py and does not constitute a full, valid XML Setup Params XML file.")
currentTime = str( datetime.now())
a.insertComment( " This file generated on: %s" % currentTime)
# Draw 10 - On eight ASICs within one tile
(tile, asic) = (10, None)
a.insertComment( "TILE 10, Labelled Numeral 10")
(start, stop) = (115, 227)
a.verticalLine( tile, asic, start, stop)
(start, stop) = (119, 231)
a.verticalLine( tile, asic, start, stop)
(start, stop) = (132, 148)
a.verticalLine( tile, asic, start, stop)
(start, stop) = (165, 181)
a.verticalLine( tile, asic, start, stop)
(start, stop) = (198, 214)
a.verticalLine( tile, asic, start, stop)
(start, stop) = (100, 102)
a.horizontalLine( tile, asic, start, stop)
(start, stop) = (244, 246)
a.horizontalLine( tile, asic, start, stop)
number = 15
(tile, asic) = (number, None)
a.insertComment( "TILE %s, Labelled Numeral %s" % (number, number))
(start, stop) = (33, 241)
a.verticalLine( tile, asic, start, stop)
(start, stop) = (34, 36)
a.horizontalLine( tile, asic, start, stop)
(start, stop) = (50, 52)
a.horizontalLine( tile, asic, start, stop)
# # Draw 0 - On one ASIC of every tile
# (tile, asic) = (None, 0)
# a.insertComment( "Numeral 0")
# (start, stop) = (339, 451) #115, 227)
# a.verticalLine( tile, asic, start, stop)
# (start, stop) = (343, 455) #119, 231)
# a.verticalLine( tile, asic, start, stop)
# (start, stop) = (356, 372)#132, 148)
# a.verticalLine( tile, asic, start, stop)
# (start, stop) = (389, 405) #165, 181)
# a.verticalLine( tile, asic, start, stop)
# (start, stop) = (422, 438) #198, 214)
# a.verticalLine( tile, asic, start, stop)
# (start, stop) = (324, 326) #100, 102)
# a.horizontalLine( tile, asic, start, stop)
# (start, stop) = (468, 470) #244, 246)
# a.horizontalLine( tile, asic, start, stop)
# if False: #True = "XFEL SUPE" False = "R KLASSE !"
# # Draw F
# asic = 6
# a.insertComment( "Letter F")
# (start, stop) = (466, 476)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (258, 264)
# a.horizontalLine( 0, asic, start, stop)
#
# # Draw E
# asic=5
# a.insertComment( "Letter E")
# (start, stop) = (34, 45)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (466, 476)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (258, 263)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# # Draw L
# asic=4
# a.insertComment( "Letter L")
# (start, stop) = (34, 45)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# # Draw S
# asic=3
# a.insertComment( "Letter S")
# (start, stop) = (34, 45)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=61, tile=0, asic=asic)
#
# (start, stop) = (77, 237)
# a.verticalLine( 0, asic, start, stop)
# a.singlePixel(pixel=252, tile=0, asic=asic)
#
# (start, stop) = (260, 267)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=275, tile=0, asic=asic)
#
# (start, stop) = (290, 434)
# a.verticalLine( 0, asic, start, stop)
# a.singlePixel(pixel=451, tile=0, asic=asic)
#
# (start, stop) = (468, 476)
# a.horizontalLine( 0, asic, start, stop)
#
# # Draw U
# asic=2
# a.insertComment( "Letter U")
# a.singlePixel(pixel=51, tile=0, asic=asic)
# (start, stop) = (36, 44)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=61, tile=0, asic=asic)
#
# (start, stop) = (66, 466)
# a.verticalLine( 0, asic, start, stop)
#
# (start, stop) = (78, 478)
# a.verticalLine( 0, asic, start, stop)
#
# # Draw P
# asic=1
# a.insertComment( "Letter P")
# (start, stop) = (466, 474)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=459, tile=0, asic=asic)
# (start, stop) = (300, 444)
# a.verticalLine( 0, asic, start, stop)
#
# a.singlePixel(pixel=283, tile=0, asic=asic)
# (start, stop) = (258, 266)
# a.horizontalLine( 0, asic, start, stop)
#
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# # Draw E
# asic=0
# a.insertComment( "Letter E")
# (start, stop) = (34, 45)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (466, 476)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (258, 263)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# else:
#
# # Draw R
# asic=7
# a.insertComment( "Letter R")
# (start, stop) = (466, 474)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=459, tile=0, asic=asic)
# (start, stop) = (300, 444)
# a.verticalLine( 0, asic, start, stop)
#
# a.singlePixel(pixel=283, tile=0, asic=asic)
# (start, stop) = (258, 266)
# a.horizontalLine( 0, asic, start, stop)
#
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# a.singlePixel(pixel=46, tile=0, asic=asic)
# a.singlePixel(pixel=62, tile=0, asic=asic)
# a.singlePixel(pixel=77, tile=0, asic=asic)
# a.singlePixel(pixel=93, tile=0, asic=asic)
# a.singlePixel(pixel=109, tile=0, asic=asic)
# a.singlePixel(pixel=108, tile=0, asic=asic)
# a.singlePixel(pixel=124, tile=0, asic=asic)
# a.singlePixel(pixel=140, tile=0, asic=asic)
# a.singlePixel(pixel=139, tile=0, asic=asic)
# a.singlePixel(pixel=155, tile=0, asic=asic)
# a.singlePixel(pixel=171, tile=0, asic=asic)
# a.singlePixel(pixel=170, tile=0, asic=asic)
# a.singlePixel(pixel=186, tile=0, asic=asic)
# a.singlePixel(pixel=202, tile=0, asic=asic)
# a.singlePixel(pixel=201, tile=0, asic=asic)
# a.singlePixel(pixel=217, tile=0, asic=asic)
# a.singlePixel(pixel=233, tile=0, asic=asic)
# a.singlePixel(pixel=249, tile=0, asic=asic)
#
#
# # Draw K
# asic=6
# a.insertComment( "Letter K")
# (start, stop) = (258, 264)
# a.horizontalLine( 0, asic, start, stop)
#
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# a.singlePixel(pixel=46, tile=0, asic=asic)
# a.singlePixel(pixel=62, tile=0, asic=asic)
# a.singlePixel(pixel=77, tile=0, asic=asic)
# a.singlePixel(pixel=93, tile=0, asic=asic)
# a.singlePixel(pixel=109, tile=0, asic=asic)
# a.singlePixel(pixel=108, tile=0, asic=asic)
# a.singlePixel(pixel=124, tile=0, asic=asic)
# a.singlePixel(pixel=140, tile=0, asic=asic)
# a.singlePixel(pixel=139, tile=0, asic=asic)
# a.singlePixel(pixel=155, tile=0, asic=asic)
# a.singlePixel(pixel=171, tile=0, asic=asic)
# a.singlePixel(pixel=170, tile=0, asic=asic)
# a.singlePixel(pixel=186, tile=0, asic=asic)
# a.singlePixel(pixel=202, tile=0, asic=asic)
# a.singlePixel(pixel=201, tile=0, asic=asic)
# a.singlePixel(pixel=217, tile=0, asic=asic)
# a.singlePixel(pixel=233, tile=0, asic=asic)
#
# a.singlePixel(pixel=478, tile=0, asic=asic)
# a.singlePixel(pixel=462, tile=0, asic=asic)
# a.singlePixel(pixel=445, tile=0, asic=asic)
# a.singlePixel(pixel=429, tile=0, asic=asic)
# a.singlePixel(pixel=413, tile=0, asic=asic)
# a.singlePixel(pixel=396, tile=0, asic=asic)
# a.singlePixel(pixel=380, tile=0, asic=asic)
# a.singlePixel(pixel=363, tile=0, asic=asic)
# a.singlePixel(pixel=347, tile=0, asic=asic)
# a.singlePixel(pixel=330, tile=0, asic=asic)
# a.singlePixel(pixel=314, tile=0, asic=asic)
# a.singlePixel(pixel=298, tile=0, asic=asic)
# a.singlePixel(pixel=281, tile=0, asic=asic)
# a.singlePixel(pixel=265, tile=0, asic=asic)
# a.singlePixel(pixel=249, tile=0, asic=asic)
#
# # Draw L
# asic=5
# a.insertComment( "Letter L")
# (start, stop) = (34, 45)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
# # Draw A
# asic=4
# a.insertComment( "Letter A")
# a.singlePixel(pixel=34, tile=0, asic=asic)
# a.singlePixel(pixel=45, tile=0, asic=asic)
# (start, stop) = (51, 147)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (164, 260)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (277, 373)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (390, 454)
# a.verticalLine( 0, asic, start, stop)
#
# (start, stop) = (471, 472)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (262, 265)
# a.horizontalLine( 0, asic, start, stop)
#
# (start, stop) = (60, 156)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (171, 267)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (282, 378)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (393, 457)
# a.verticalLine( 0, asic, start, stop)
#
# # Draw S
# asic=3
# a.insertComment( "Letter S")
# (start, stop) = (34, 44)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=61, tile=0, asic=asic)
#
# (start, stop) = (77, 237)
# a.verticalLine( 0, asic, start, stop)
# a.singlePixel(pixel=252, tile=0, asic=asic)
#
# (start, stop) = (260, 267)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=275, tile=0, asic=asic)
#
# (start, stop) = (290, 434)
# a.verticalLine( 0, asic, start, stop)
# a.singlePixel(pixel=451, tile=0, asic=asic)
#
# (start, stop) = (468, 476)
# a.horizontalLine( 0, asic, start, stop)
#
# # Draw S
# asic=2
# a.insertComment( "Letter S")
# (start, stop) = (34, 44)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=61, tile=0, asic=asic)
#
# (start, stop) = (77, 237)
# a.verticalLine( 0, asic, start, stop)
# a.singlePixel(pixel=252, tile=0, asic=asic)
#
# (start, stop) = (260, 267)
# a.horizontalLine( 0, asic, start, stop)
# a.singlePixel(pixel=275, tile=0, asic=asic)
#
# (start, stop) = (290, 434)
# a.verticalLine( 0, asic, start, stop)
# a.singlePixel(pixel=451, tile=0, asic=asic)
#
# (start, stop) = (468, 476)
# a.horizontalLine( 0, asic, start, stop)
#
# # Draw E
# asic=1
# a.insertComment( "Letter E")
# (start, stop) = (34, 45)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (466, 476)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (258, 263)
# a.horizontalLine( 0, asic, start, stop)
# (start, stop) = (34, 466)
# a.verticalLine( 0, asic, start, stop)
#
#
# # Draw "!"
# asic=0
# a.insertComment( "Letter '!'")
# (start, stop) = (104, 472)
# a.verticalLine( 0, asic, start, stop)
# (start, stop) = (105, 473)
# a.verticalLine( 0, asic, start, stop)
#
# a.singlePixel(pixel=40, tile=0, asic=asic)
# a.singlePixel(pixel=41, tile=0, asic=asic)
# a.singlePixel(pixel=57, tile=0, asic=asic)
# a.singlePixel(pixel=56, tile=0, asic=asic)
| 36.097448 | 133 | 0.538051 | 1,966 | 15,558 | 4.247711 | 0.125636 | 0.172434 | 0.151 | 0.115196 | 0.829601 | 0.806969 | 0.794635 | 0.72171 | 0.651539 | 0.639923 | 0 | 0.078135 | 0.298303 | 15,558 | 430 | 134 | 36.181395 | 0.686819 | 0.697133 | 0 | 0.379747 | 0 | 0.037975 | 0.201828 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.075949 | false | 0 | 0.025316 | 0 | 0.113924 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
1264ece0586dfcb3fab7b990e8912b744e097dd2 | 65 | py | Python | aiohttp_auth/__init__.py | gnarlychicken/aiohttp_auth | 3d55236889fb14b662279b050de18d43842bb886 | [
"MIT"
] | 12 | 2016-02-27T21:57:51.000Z | 2020-10-26T13:57:47.000Z | aiohttp_auth/__init__.py | gnarlychicken/aiohttp_auth | 3d55236889fb14b662279b050de18d43842bb886 | [
"MIT"
] | 5 | 2016-07-22T15:51:48.000Z | 2021-09-07T21:48:01.000Z | aiohttp_auth/__init__.py | gnarlychicken/aiohttp_auth | 3d55236889fb14b662279b050de18d43842bb886 | [
"MIT"
] | 8 | 2016-02-15T04:58:31.000Z | 2019-01-21T14:17:16.000Z | from .auth import auth_middleware
from .acl import acl_middleware | 32.5 | 33 | 0.861538 | 10 | 65 | 5.4 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107692 | 65 | 2 | 34 | 32.5 | 0.931034 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
89cb4e28be0c31ba4a3eb24af9e21c6bb7d0a53d | 79 | py | Python | gui/buttons/createtable.py | tonymorony/DiceCC-GUI | 89dbdcf9fe762fe673a0c8c90d461efc10ab31e4 | [
"MIT"
] | null | null | null | gui/buttons/createtable.py | tonymorony/DiceCC-GUI | 89dbdcf9fe762fe673a0c8c90d461efc10ab31e4 | [
"MIT"
] | null | null | null | gui/buttons/createtable.py | tonymorony/DiceCC-GUI | 89dbdcf9fe762fe673a0c8c90d461efc10ab31e4 | [
"MIT"
] | 1 | 2019-01-04T05:52:38.000Z | 2019-01-04T05:52:38.000Z | from kivy.uix.button import Button
class CreateTableButton(Button):
pass
| 13.166667 | 34 | 0.772152 | 10 | 79 | 6.1 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164557 | 79 | 5 | 35 | 15.8 | 0.924242 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.333333 | 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 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 5 |
89e467b5fa2ce70405beb15ab10090f03bdad4e8 | 136 | py | Python | cover_letter/urls.py | radoslawdabrowski/personal-website-framework | c33f16811caa2aafdfd84c22af8c37ee0ab97720 | [
"Apache-2.0"
] | 1 | 2021-11-06T15:22:15.000Z | 2021-11-06T15:22:15.000Z | cover_letter/urls.py | radoslawdabrowski/personal-website-framework | c33f16811caa2aafdfd84c22af8c37ee0ab97720 | [
"Apache-2.0"
] | 92 | 2019-12-04T22:24:35.000Z | 2022-03-12T00:11:21.000Z | cover_letter/urls.py | radoslawdabrowski/personal-website | b3d4f92ea51b40b104449259a376134aeb11766b | [
"MIT"
] | 1 | 2019-05-07T21:23:57.000Z | 2019-05-07T21:23:57.000Z | from django.urls import path
from .views import cover_main_view
urlpatterns = [
path('', cover_main_view, name="cover_main_view")
] | 22.666667 | 53 | 0.757353 | 20 | 136 | 4.85 | 0.55 | 0.278351 | 0.402062 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139706 | 136 | 6 | 54 | 22.666667 | 0.82906 | 0 | 0 | 0 | 0 | 0 | 0.109489 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
89f5b7cf35fc6480927c7ae4f3257017b0366e1a | 212 | py | Python | graphenemodeling/experiments/transport.py | gholdman1/Graphene-Modeling | 61fdf5941f4c43866e846902a21e58e5e1b2a47e | [
"MIT"
] | 1 | 2020-06-16T01:35:26.000Z | 2020-06-16T01:35:26.000Z | graphenemodeling/experiments/transport.py | gholdman1/Graphene-Modeling | 61fdf5941f4c43866e846902a21e58e5e1b2a47e | [
"MIT"
] | null | null | null | graphenemodeling/experiments/transport.py | gholdman1/Graphene-Modeling | 61fdf5941f4c43866e846902a21e58e5e1b2a47e | [
"MIT"
] | 2 | 2020-03-25T19:37:09.000Z | 2020-07-24T13:23:45.000Z | """
==================================================
Transport (:mod:`experiments.transport`)
==================================================
"""
class TransportExperiment:
def __init__(self):
pass
| 14.133333 | 50 | 0.353774 | 10 | 212 | 7.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09434 | 212 | 14 | 51 | 15.142857 | 0.369792 | 0.669811 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.333333 | 0 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
d6055f3a571d0959f9040bbb2a9e4da4f2729fd6 | 66 | py | Python | SloppyCell/Vandermonde/__init__.py | robertvsiii/sloppycell | caf6daa09f2202acccf26ad31890fddaf4af82e8 | [
"BSD-3-Clause"
] | null | null | null | SloppyCell/Vandermonde/__init__.py | robertvsiii/sloppycell | caf6daa09f2202acccf26ad31890fddaf4af82e8 | [
"BSD-3-Clause"
] | 1 | 2019-04-15T21:08:12.000Z | 2019-04-15T21:08:12.000Z | SloppyCell/Vandermonde/__init__.py | jurquiza/SloppyCellUrquiza2019 | a9f64d9d4172c82735813f09e48f36777a714e9c | [
"BSD-3-Clause"
] | null | null | null | import decompHess
import clusterScripts
import VdmPairwise as Vdm
| 16.5 | 25 | 0.878788 | 8 | 66 | 7.25 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121212 | 66 | 3 | 26 | 22 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
d61cf09187561965053f638f27d1629a7b6616a0 | 261 | py | Python | ossreport/cmd/banner.py | craftslab/ossreport | 7c60963af28e9cc22a4c107c58b697e02261d105 | [
"Apache-2.0"
] | null | null | null | ossreport/cmd/banner.py | craftslab/ossreport | 7c60963af28e9cc22a4c107c58b697e02261d105 | [
"Apache-2.0"
] | null | null | null | ossreport/cmd/banner.py | craftslab/ossreport | 7c60963af28e9cc22a4c107c58b697e02261d105 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""figlet -f smslant <message>"""
BANNER = """
____ ___________ _______ ____ ___ ______
/ __ \/ __/ __/ _ \/ __/ _ \/ __ \/ _ \/_ __/
/ /_/ /\ \_\ \/ , _/ _// ___/ /_/ / , _/ / /
\____/___/___/_/|_/___/_/ \____/_/|_| /_/
"""
| 26.1 | 47 | 0.45977 | 8 | 261 | 4.625 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005076 | 0.245211 | 261 | 9 | 48 | 29 | 0.182741 | 0.191571 | 0 | 0 | 0 | 0.333333 | 0.907317 | 0.121951 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d6205b7099ccea98e9ca4fde1ecf67879c06b7bc | 428 | py | Python | nfv/nfv-common/nfv_common/tasks/__init__.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | 2 | 2020-02-07T19:01:36.000Z | 2022-02-23T01:41:46.000Z | nfv/nfv-common/nfv_common/tasks/__init__.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | 1 | 2021-01-14T12:02:25.000Z | 2021-01-14T12:02:25.000Z | nfv/nfv-common/nfv_common/tasks/__init__.py | SidneyAn/nfv | 5f0262a5b6ea4be59f977b9c587c483cbe0e373d | [
"Apache-2.0"
] | 2 | 2021-01-13T08:39:21.000Z | 2022-02-09T00:21:55.000Z | #
# Copyright (c) 2015-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from nfv_common.tasks._task import Task # noqa: F401
from nfv_common.tasks._task import TASK_PRIORITY # noqa: F401
from nfv_common.tasks._task_future import TaskFuture # noqa: F401
from nfv_common.tasks._task_scheduler import TaskScheduler # noqa: F401
from nfv_common.tasks._task_worker_pool import TaskWorkerPool # noqa: F401
| 38.909091 | 75 | 0.792056 | 64 | 428 | 5.0625 | 0.46875 | 0.108025 | 0.200617 | 0.277778 | 0.5 | 0.5 | 0.5 | 0 | 0 | 0 | 0 | 0.066845 | 0.126168 | 428 | 10 | 76 | 42.8 | 0.799465 | 0.324766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
d62bf8e7f57002916487dc3f81e4148ad7b1ed02 | 2,152 | py | Python | atlas/foundations_events/src/test/consumers/jobs/failed/test_error_data.py | DeepLearnI/atlas | 8aca652d7e647b4e88530b93e265b536de7055ed | [
"Apache-2.0"
] | 296 | 2020-03-16T19:55:00.000Z | 2022-01-10T19:46:05.000Z | atlas/foundations_events/src/test/consumers/jobs/failed/test_error_data.py | DeepLearnI/atlas | 8aca652d7e647b4e88530b93e265b536de7055ed | [
"Apache-2.0"
] | 57 | 2020-03-17T11:15:57.000Z | 2021-07-10T14:42:27.000Z | atlas/foundations_events/src/test/consumers/jobs/failed/test_error_data.py | DeepLearnI/atlas | 8aca652d7e647b4e88530b93e265b536de7055ed | [
"Apache-2.0"
] | 38 | 2020-03-17T21:06:05.000Z | 2022-02-08T03:19:34.000Z |
import unittest
from mock import Mock
from foundations_events.consumers.jobs.failed.error_data import ErrorData
class TestErrorData(unittest.TestCase):
def setUp(self):
import json
self._redis = Mock()
self._serializer = Mock()
self._serializer.dumps.side_effect = json.dumps
self._consumer = ErrorData(self._redis, self._serializer)
def test_call_saved_json_job_error_data(self):
input_data = {'job_id': 'my really big net',
'error_information': {'exception_type': 'The really bad kind'}
}
self._consumer.call(input_data, None, None)
self._redis.set.assert_called_with('jobs:my really big net:error_information', '{"exception_type": "The really bad kind"}')
def test_call_saved_json_job_error_data_different_job(self):
input_data = {'job_id': 'my really massive net',
'error_information': {'exception_type': 'The really bad kind'}
}
self._consumer.call(input_data, None, None)
self._redis.set.assert_called_with('jobs:my really massive net:error_information', '{"exception_type": "The really bad kind"}')
def test_call_saved_json_job_error_data_different_error_data(self):
input_data = {'job_id': 'my really massive net',
'error_information': {'trace': 'A really long trace'}
}
self._consumer.call(input_data, None, None)
self._redis.set.assert_called_with('jobs:my really massive net:error_information', '{"trace": "A really long trace"}')
def test_call_saved_json_job_error_data_different_serializer(self):
import yaml
self._serializer.dumps.side_effect = lambda value: yaml.dump(
value, default_flow_style=False)
input_data = {'job_id': 'my really big net',
'error_information': {'exception_type': 'The really bad kind'}
}
self._consumer.call(input_data, None, None)
self._redis.set.assert_called_with('jobs:my really big net:error_information', 'exception_type: The really bad kind\n')
| 42.196078 | 135 | 0.658457 | 271 | 2,152 | 4.911439 | 0.221402 | 0.054095 | 0.1142 | 0.126221 | 0.767844 | 0.724267 | 0.724267 | 0.724267 | 0.706987 | 0.659654 | 0 | 0 | 0.237454 | 2,152 | 50 | 136 | 43.04 | 0.811091 | 0 | 0 | 0.297297 | 0 | 0 | 0.283589 | 0.039052 | 0 | 0 | 0 | 0 | 0.108108 | 1 | 0.135135 | false | 0 | 0.135135 | 0 | 0.297297 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d63f669eb70401fded7bf7353874b3554bf290d2 | 126,093 | py | Python | nova/virt/vmwareapi/vm_util.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/vm_util.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/virt/vmwareapi/vm_util.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.'
nl|'\n'
comment|'# Copyright (c) 2012 VMware, Inc.'
nl|'\n'
comment|'# Copyright (c) 2011 Citrix Systems, Inc.'
nl|'\n'
comment|'# Copyright 2011 OpenStack Foundation'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
string|'"""\nThe VMware API VM utility module to build SOAP object specs.\n"""'
newline|'\n'
nl|'\n'
name|'import'
name|'collections'
newline|'\n'
name|'import'
name|'copy'
newline|'\n'
name|'import'
name|'functools'
newline|'\n'
nl|'\n'
name|'from'
name|'oslo_log'
name|'import'
name|'log'
name|'as'
name|'logging'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'excutils'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'units'
newline|'\n'
name|'from'
name|'oslo_vmware'
name|'import'
name|'exceptions'
name|'as'
name|'vexc'
newline|'\n'
name|'from'
name|'oslo_vmware'
op|'.'
name|'objects'
name|'import'
name|'datastore'
name|'as'
name|'ds_obj'
newline|'\n'
name|'from'
name|'oslo_vmware'
name|'import'
name|'pbm'
newline|'\n'
name|'from'
name|'oslo_vmware'
name|'import'
name|'vim_util'
name|'as'
name|'vutil'
newline|'\n'
name|'import'
name|'six'
newline|'\n'
nl|'\n'
name|'import'
name|'nova'
op|'.'
name|'conf'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'exception'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'i18n'
name|'import'
name|'_'
op|','
name|'_LE'
op|','
name|'_LI'
op|','
name|'_LW'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'network'
name|'import'
name|'model'
name|'as'
name|'network_model'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'virt'
op|'.'
name|'vmwareapi'
name|'import'
name|'constants'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'virt'
op|'.'
name|'vmwareapi'
name|'import'
name|'vim_util'
newline|'\n'
nl|'\n'
DECL|variable|LOG
name|'LOG'
op|'='
name|'logging'
op|'.'
name|'getLogger'
op|'('
name|'__name__'
op|')'
newline|'\n'
nl|'\n'
DECL|variable|CONF
name|'CONF'
op|'='
name|'nova'
op|'.'
name|'conf'
op|'.'
name|'CONF'
newline|'\n'
nl|'\n'
DECL|variable|ALL_SUPPORTED_NETWORK_DEVICES
name|'ALL_SUPPORTED_NETWORK_DEVICES'
op|'='
op|'['
string|"'VirtualE1000'"
op|','
string|"'VirtualE1000e'"
op|','
nl|'\n'
string|"'VirtualPCNet32'"
op|','
string|"'VirtualSriovEthernetCard'"
op|','
nl|'\n'
string|"'VirtualVmxnet'"
op|','
string|"'VirtualVmxnet3'"
op|']'
newline|'\n'
nl|'\n'
comment|'# A simple cache for storing inventory folder references.'
nl|'\n'
comment|'# Format: {inventory_path: folder_ref}'
nl|'\n'
DECL|variable|_FOLDER_PATH_REF_MAPPING
name|'_FOLDER_PATH_REF_MAPPING'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
comment|'# A cache for VM references. The key will be the VM name'
nl|'\n'
comment|'# and the value is the VM reference. The VM name is unique. This'
nl|'\n'
comment|'# is either the UUID of the instance or UUID-rescue in the case'
nl|'\n'
comment|'# that this is a rescue VM. This is in order to prevent'
nl|'\n'
comment|'# unnecessary communication with the backend.'
nl|'\n'
DECL|variable|_VM_REFS_CACHE
name|'_VM_REFS_CACHE'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|Limits
name|'class'
name|'Limits'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
nl|'\n'
DECL|member|__init__
indent|' '
name|'def'
name|'__init__'
op|'('
name|'self'
op|','
name|'limit'
op|'='
name|'None'
op|','
name|'reservation'
op|'='
name|'None'
op|','
nl|'\n'
name|'shares_level'
op|'='
name|'None'
op|','
name|'shares_share'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""imits object holds instance limits for convenience."""'
newline|'\n'
name|'self'
op|'.'
name|'limit'
op|'='
name|'limit'
newline|'\n'
name|'self'
op|'.'
name|'reservation'
op|'='
name|'reservation'
newline|'\n'
name|'self'
op|'.'
name|'shares_level'
op|'='
name|'shares_level'
newline|'\n'
name|'self'
op|'.'
name|'shares_share'
op|'='
name|'shares_share'
newline|'\n'
nl|'\n'
DECL|member|validate
dedent|''
name|'def'
name|'validate'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'self'
op|'.'
name|'shares_level'
name|'in'
op|'('
string|"'high'"
op|','
string|"'normal'"
op|','
string|"'low'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'self'
op|'.'
name|'shares_share'
op|':'
newline|'\n'
indent|' '
name|'reason'
op|'='
name|'_'
op|'('
string|'"Share level \'%s\' cannot have share "'
nl|'\n'
string|'"configured"'
op|')'
op|'%'
name|'self'
op|'.'
name|'shares_level'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'InvalidInput'
op|'('
name|'reason'
op|'='
name|'reason'
op|')'
newline|'\n'
dedent|''
name|'return'
newline|'\n'
dedent|''
name|'if'
name|'self'
op|'.'
name|'shares_level'
op|'=='
string|"'custom'"
op|':'
newline|'\n'
indent|' '
name|'return'
newline|'\n'
dedent|''
name|'if'
name|'self'
op|'.'
name|'shares_level'
op|':'
newline|'\n'
indent|' '
name|'reason'
op|'='
name|'_'
op|'('
string|'"Share \'%s\' is not supported"'
op|')'
op|'%'
name|'self'
op|'.'
name|'shares_level'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'InvalidInput'
op|'('
name|'reason'
op|'='
name|'reason'
op|')'
newline|'\n'
nl|'\n'
DECL|member|has_limits
dedent|''
dedent|''
name|'def'
name|'has_limits'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'bool'
op|'('
name|'self'
op|'.'
name|'limit'
name|'or'
nl|'\n'
name|'self'
op|'.'
name|'reservation'
name|'or'
nl|'\n'
name|'self'
op|'.'
name|'shares_level'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|ExtraSpecs
dedent|''
dedent|''
name|'class'
name|'ExtraSpecs'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
nl|'\n'
DECL|member|__init__
indent|' '
name|'def'
name|'__init__'
op|'('
name|'self'
op|','
name|'cpu_limits'
op|'='
name|'None'
op|','
name|'hw_version'
op|'='
name|'None'
op|','
nl|'\n'
name|'storage_policy'
op|'='
name|'None'
op|','
name|'cores_per_socket'
op|'='
name|'None'
op|','
nl|'\n'
name|'memory_limits'
op|'='
name|'None'
op|','
name|'disk_io_limits'
op|'='
name|'None'
op|','
nl|'\n'
name|'vif_limits'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""ExtraSpecs object holds extra_specs for the instance."""'
newline|'\n'
name|'self'
op|'.'
name|'cpu_limits'
op|'='
name|'cpu_limits'
name|'or'
name|'Limits'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'memory_limits'
op|'='
name|'memory_limits'
name|'or'
name|'Limits'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'disk_io_limits'
op|'='
name|'disk_io_limits'
name|'or'
name|'Limits'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'vif_limits'
op|'='
name|'vif_limits'
name|'or'
name|'Limits'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'hw_version'
op|'='
name|'hw_version'
newline|'\n'
name|'self'
op|'.'
name|'storage_policy'
op|'='
name|'storage_policy'
newline|'\n'
name|'self'
op|'.'
name|'cores_per_socket'
op|'='
name|'cores_per_socket'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|vm_refs_cache_reset
dedent|''
dedent|''
name|'def'
name|'vm_refs_cache_reset'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'global'
name|'_VM_REFS_CACHE'
newline|'\n'
name|'_VM_REFS_CACHE'
op|'='
op|'{'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|vm_ref_cache_delete
dedent|''
name|'def'
name|'vm_ref_cache_delete'
op|'('
name|'id'
op|')'
op|':'
newline|'\n'
indent|' '
name|'_VM_REFS_CACHE'
op|'.'
name|'pop'
op|'('
name|'id'
op|','
name|'None'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|vm_ref_cache_update
dedent|''
name|'def'
name|'vm_ref_cache_update'
op|'('
name|'id'
op|','
name|'vm_ref'
op|')'
op|':'
newline|'\n'
indent|' '
name|'_VM_REFS_CACHE'
op|'['
name|'id'
op|']'
op|'='
name|'vm_ref'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|vm_ref_cache_get
dedent|''
name|'def'
name|'vm_ref_cache_get'
op|'('
name|'id'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'_VM_REFS_CACHE'
op|'.'
name|'get'
op|'('
name|'id'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_vm_ref_cache
dedent|''
name|'def'
name|'_vm_ref_cache'
op|'('
name|'id'
op|','
name|'func'
op|','
name|'session'
op|','
name|'data'
op|')'
op|':'
newline|'\n'
indent|' '
name|'vm_ref'
op|'='
name|'vm_ref_cache_get'
op|'('
name|'id'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'vm_ref'
op|':'
newline|'\n'
indent|' '
name|'vm_ref'
op|'='
name|'func'
op|'('
name|'session'
op|','
name|'data'
op|')'
newline|'\n'
name|'vm_ref_cache_update'
op|'('
name|'id'
op|','
name|'vm_ref'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'vm_ref'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|vm_ref_cache_from_instance
dedent|''
name|'def'
name|'vm_ref_cache_from_instance'
op|'('
name|'func'
op|')'
op|':'
newline|'\n'
indent|' '
op|'@'
name|'functools'
op|'.'
name|'wraps'
op|'('
name|'func'
op|')'
newline|'\n'
DECL|function|wrapper
name|'def'
name|'wrapper'
op|'('
name|'session'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
name|'id'
op|'='
name|'instance'
op|'.'
name|'uuid'
newline|'\n'
name|'return'
name|'_vm_ref_cache'
op|'('
name|'id'
op|','
name|'func'
op|','
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'wrapper'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|vm_ref_cache_from_name
dedent|''
name|'def'
name|'vm_ref_cache_from_name'
op|'('
name|'func'
op|')'
op|':'
newline|'\n'
indent|' '
op|'@'
name|'functools'
op|'.'
name|'wraps'
op|'('
name|'func'
op|')'
newline|'\n'
DECL|function|wrapper
name|'def'
name|'wrapper'
op|'('
name|'session'
op|','
name|'name'
op|')'
op|':'
newline|'\n'
indent|' '
name|'id'
op|'='
name|'name'
newline|'\n'
name|'return'
name|'_vm_ref_cache'
op|'('
name|'id'
op|','
name|'func'
op|','
name|'session'
op|','
name|'name'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'wrapper'
newline|'\n'
nl|'\n'
comment|'# the config key which stores the VNC port'
nl|'\n'
DECL|variable|VNC_CONFIG_KEY
dedent|''
name|'VNC_CONFIG_KEY'
op|'='
string|'\'config.extraConfig["RemoteDisplay.vnc.port"]\''
newline|'\n'
nl|'\n'
DECL|variable|VmdkInfo
name|'VmdkInfo'
op|'='
name|'collections'
op|'.'
name|'namedtuple'
op|'('
string|"'VmdkInfo'"
op|','
op|'['
string|"'path'"
op|','
string|"'adapter_type'"
op|','
nl|'\n'
string|"'disk_type'"
op|','
nl|'\n'
string|"'capacity_in_bytes'"
op|','
nl|'\n'
string|"'device'"
op|']'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_iface_id_option_value
name|'def'
name|'_iface_id_option_value'
op|'('
name|'client_factory'
op|','
name|'iface_id'
op|','
name|'port_index'
op|')'
op|':'
newline|'\n'
indent|' '
name|'opt'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt'
op|'.'
name|'key'
op|'='
string|'"nvp.iface-id.%d"'
op|'%'
name|'port_index'
newline|'\n'
name|'opt'
op|'.'
name|'value'
op|'='
name|'iface_id'
newline|'\n'
name|'return'
name|'opt'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_allocation_info
dedent|''
name|'def'
name|'_get_allocation_info'
op|'('
name|'client_factory'
op|','
name|'limits'
op|','
name|'allocation_type'
op|')'
op|':'
newline|'\n'
indent|' '
name|'allocation'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
name|'allocation_type'
op|')'
newline|'\n'
name|'if'
name|'limits'
op|'.'
name|'limit'
op|':'
newline|'\n'
indent|' '
name|'allocation'
op|'.'
name|'limit'
op|'='
name|'limits'
op|'.'
name|'limit'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
comment|"# Set as 'umlimited'"
nl|'\n'
indent|' '
name|'allocation'
op|'.'
name|'limit'
op|'='
op|'-'
number|'1'
newline|'\n'
dedent|''
name|'if'
name|'limits'
op|'.'
name|'reservation'
op|':'
newline|'\n'
indent|' '
name|'allocation'
op|'.'
name|'reservation'
op|'='
name|'limits'
op|'.'
name|'reservation'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'allocation'
op|'.'
name|'reservation'
op|'='
number|'0'
newline|'\n'
dedent|''
name|'shares'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:SharesInfo'"
op|')'
newline|'\n'
name|'if'
name|'limits'
op|'.'
name|'shares_level'
op|':'
newline|'\n'
indent|' '
name|'shares'
op|'.'
name|'level'
op|'='
name|'limits'
op|'.'
name|'shares_level'
newline|'\n'
name|'if'
op|'('
name|'shares'
op|'.'
name|'level'
op|'=='
string|"'custom'"
name|'and'
nl|'\n'
name|'limits'
op|'.'
name|'shares_share'
op|')'
op|':'
newline|'\n'
indent|' '
name|'shares'
op|'.'
name|'shares'
op|'='
name|'limits'
op|'.'
name|'shares_share'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'shares'
op|'.'
name|'shares'
op|'='
number|'0'
newline|'\n'
dedent|''
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'shares'
op|'.'
name|'level'
op|'='
string|"'normal'"
newline|'\n'
name|'shares'
op|'.'
name|'shares'
op|'='
number|'0'
newline|'\n'
comment|"# The VirtualEthernetCardResourceAllocation has 'share' instead of"
nl|'\n'
comment|"# 'shares'."
nl|'\n'
dedent|''
name|'if'
name|'hasattr'
op|'('
name|'allocation'
op|','
string|"'share'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'allocation'
op|'.'
name|'share'
op|'='
name|'shares'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'allocation'
op|'.'
name|'shares'
op|'='
name|'shares'
newline|'\n'
dedent|''
name|'return'
name|'allocation'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vm_create_spec
dedent|''
name|'def'
name|'get_vm_create_spec'
op|'('
name|'client_factory'
op|','
name|'instance'
op|','
name|'data_store_name'
op|','
nl|'\n'
name|'vif_infos'
op|','
name|'extra_specs'
op|','
nl|'\n'
name|'os_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_OS_TYPE'
op|','
nl|'\n'
name|'profile_spec'
op|'='
name|'None'
op|','
name|'metadata'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the VM Create spec."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
name|'config_spec'
op|'.'
name|'name'
op|'='
name|'instance'
op|'.'
name|'uuid'
newline|'\n'
name|'config_spec'
op|'.'
name|'guestId'
op|'='
name|'os_type'
newline|'\n'
comment|'# The name is the unique identifier for the VM.'
nl|'\n'
name|'config_spec'
op|'.'
name|'instanceUuid'
op|'='
name|'instance'
op|'.'
name|'uuid'
newline|'\n'
name|'if'
name|'metadata'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'annotation'
op|'='
name|'metadata'
newline|'\n'
comment|'# set the Hardware version'
nl|'\n'
dedent|''
name|'config_spec'
op|'.'
name|'version'
op|'='
name|'extra_specs'
op|'.'
name|'hw_version'
newline|'\n'
nl|'\n'
comment|'# Allow nested hypervisor instances to host 64 bit VMs.'
nl|'\n'
name|'if'
name|'os_type'
name|'in'
op|'('
string|'"vmkernel5Guest"'
op|','
string|'"vmkernel6Guest"'
op|','
string|'"windowsHyperVGuest"'
op|')'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'nestedHVEnabled'
op|'='
string|'"True"'
newline|'\n'
nl|'\n'
comment|'# Append the profile spec'
nl|'\n'
dedent|''
name|'if'
name|'profile_spec'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'vmProfile'
op|'='
op|'['
name|'profile_spec'
op|']'
newline|'\n'
nl|'\n'
dedent|''
name|'vm_file_info'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineFileInfo'"
op|')'
newline|'\n'
name|'vm_file_info'
op|'.'
name|'vmPathName'
op|'='
string|'"["'
op|'+'
name|'data_store_name'
op|'+'
string|'"]"'
newline|'\n'
name|'config_spec'
op|'.'
name|'files'
op|'='
name|'vm_file_info'
newline|'\n'
nl|'\n'
name|'tools_info'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:ToolsConfigInfo'"
op|')'
newline|'\n'
name|'tools_info'
op|'.'
name|'afterPowerOn'
op|'='
name|'True'
newline|'\n'
name|'tools_info'
op|'.'
name|'afterResume'
op|'='
name|'True'
newline|'\n'
name|'tools_info'
op|'.'
name|'beforeGuestStandby'
op|'='
name|'True'
newline|'\n'
name|'tools_info'
op|'.'
name|'beforeGuestShutdown'
op|'='
name|'True'
newline|'\n'
name|'tools_info'
op|'.'
name|'beforeGuestReboot'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'config_spec'
op|'.'
name|'tools'
op|'='
name|'tools_info'
newline|'\n'
name|'config_spec'
op|'.'
name|'numCPUs'
op|'='
name|'int'
op|'('
name|'instance'
op|'.'
name|'vcpus'
op|')'
newline|'\n'
name|'if'
name|'extra_specs'
op|'.'
name|'cores_per_socket'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'numCoresPerSocket'
op|'='
name|'int'
op|'('
name|'extra_specs'
op|'.'
name|'cores_per_socket'
op|')'
newline|'\n'
dedent|''
name|'config_spec'
op|'.'
name|'memoryMB'
op|'='
name|'int'
op|'('
name|'instance'
op|'.'
name|'memory_mb'
op|')'
newline|'\n'
nl|'\n'
comment|'# Configure cpu information'
nl|'\n'
name|'if'
name|'extra_specs'
op|'.'
name|'cpu_limits'
op|'.'
name|'has_limits'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'cpuAllocation'
op|'='
name|'_get_allocation_info'
op|'('
nl|'\n'
name|'client_factory'
op|','
name|'extra_specs'
op|'.'
name|'cpu_limits'
op|','
nl|'\n'
string|"'ns0:ResourceAllocationInfo'"
op|')'
newline|'\n'
nl|'\n'
comment|'# Configure memory information'
nl|'\n'
dedent|''
name|'if'
name|'extra_specs'
op|'.'
name|'memory_limits'
op|'.'
name|'has_limits'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'memoryAllocation'
op|'='
name|'_get_allocation_info'
op|'('
nl|'\n'
name|'client_factory'
op|','
name|'extra_specs'
op|'.'
name|'memory_limits'
op|','
nl|'\n'
string|"'ns0:ResourceAllocationInfo'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'devices'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'vif_info'
name|'in'
name|'vif_infos'
op|':'
newline|'\n'
indent|' '
name|'vif_spec'
op|'='
name|'_create_vif_spec'
op|'('
name|'client_factory'
op|','
name|'vif_info'
op|','
nl|'\n'
name|'extra_specs'
op|'.'
name|'vif_limits'
op|')'
newline|'\n'
name|'devices'
op|'.'
name|'append'
op|'('
name|'vif_spec'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'serial_port_spec'
op|'='
name|'create_serial_port_spec'
op|'('
name|'client_factory'
op|')'
newline|'\n'
name|'if'
name|'serial_port_spec'
op|':'
newline|'\n'
indent|' '
name|'devices'
op|'.'
name|'append'
op|'('
name|'serial_port_spec'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
name|'devices'
newline|'\n'
nl|'\n'
comment|'# add vm-uuid and iface-id.x values for Neutron'
nl|'\n'
name|'extra_config'
op|'='
op|'['
op|']'
newline|'\n'
name|'opt'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt'
op|'.'
name|'key'
op|'='
string|'"nvp.vm-uuid"'
newline|'\n'
name|'opt'
op|'.'
name|'value'
op|'='
name|'instance'
op|'.'
name|'uuid'
newline|'\n'
name|'extra_config'
op|'.'
name|'append'
op|'('
name|'opt'
op|')'
newline|'\n'
nl|'\n'
name|'port_index'
op|'='
number|'0'
newline|'\n'
name|'for'
name|'vif_info'
name|'in'
name|'vif_infos'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'vif_info'
op|'['
string|"'iface_id'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'extra_config'
op|'.'
name|'append'
op|'('
name|'_iface_id_option_value'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'vif_info'
op|'['
string|"'iface_id'"
op|']'
op|','
nl|'\n'
name|'port_index'
op|')'
op|')'
newline|'\n'
name|'port_index'
op|'+='
number|'1'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'if'
op|'('
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'console_delay_seconds'
name|'and'
nl|'\n'
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'console_delay_seconds'
op|'>'
number|'0'
op|')'
op|':'
newline|'\n'
indent|' '
name|'opt'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt'
op|'.'
name|'key'
op|'='
string|"'keyboard.typematicMinDelay'"
newline|'\n'
name|'opt'
op|'.'
name|'value'
op|'='
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'console_delay_seconds'
op|'*'
number|'1000000'
newline|'\n'
name|'extra_config'
op|'.'
name|'append'
op|'('
name|'opt'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'config_spec'
op|'.'
name|'extraConfig'
op|'='
name|'extra_config'
newline|'\n'
nl|'\n'
comment|"# Set the VM to be 'managed' by 'OpenStack'"
nl|'\n'
name|'managed_by'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:ManagedByInfo'"
op|')'
newline|'\n'
name|'managed_by'
op|'.'
name|'extensionKey'
op|'='
name|'constants'
op|'.'
name|'EXTENSION_KEY'
newline|'\n'
name|'managed_by'
op|'.'
name|'type'
op|'='
name|'constants'
op|'.'
name|'EXTENSION_TYPE_INSTANCE'
newline|'\n'
name|'config_spec'
op|'.'
name|'managedBy'
op|'='
name|'managed_by'
newline|'\n'
nl|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_serial_port_spec
dedent|''
name|'def'
name|'create_serial_port_spec'
op|'('
name|'client_factory'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Creates config spec for serial port."""'
newline|'\n'
name|'if'
name|'not'
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'serial_port_service_uri'
op|':'
newline|'\n'
indent|' '
name|'return'
newline|'\n'
nl|'\n'
dedent|''
name|'backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualSerialPortURIBackingInfo'"
op|')'
newline|'\n'
name|'backing'
op|'.'
name|'direction'
op|'='
string|'"server"'
newline|'\n'
name|'backing'
op|'.'
name|'serviceURI'
op|'='
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'serial_port_service_uri'
newline|'\n'
name|'backing'
op|'.'
name|'proxyURI'
op|'='
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'serial_port_proxy_uri'
newline|'\n'
nl|'\n'
name|'connectable_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDeviceConnectInfo'"
op|')'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'startConnected'
op|'='
name|'True'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'allowGuestControl'
op|'='
name|'True'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'connected'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'serial_port'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualSerialPort'"
op|')'
newline|'\n'
name|'serial_port'
op|'.'
name|'connectable'
op|'='
name|'connectable_spec'
newline|'\n'
name|'serial_port'
op|'.'
name|'backing'
op|'='
name|'backing'
newline|'\n'
comment|'# we are using unique negative integers as temporary keys'
nl|'\n'
name|'serial_port'
op|'.'
name|'key'
op|'='
op|'-'
number|'2'
newline|'\n'
name|'serial_port'
op|'.'
name|'yieldOnPoll'
op|'='
name|'True'
newline|'\n'
name|'dev_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'dev_spec'
op|'.'
name|'operation'
op|'='
string|'"add"'
newline|'\n'
name|'dev_spec'
op|'.'
name|'device'
op|'='
name|'serial_port'
newline|'\n'
name|'return'
name|'dev_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vm_boot_spec
dedent|''
name|'def'
name|'get_vm_boot_spec'
op|'('
name|'client_factory'
op|','
name|'device'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns updated boot settings for the instance.\n\n The boot order for the instance will be changed to have the\n input device as the boot disk.\n """'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
name|'boot_disk'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualMachineBootOptionsBootableDiskDevice'"
op|')'
newline|'\n'
name|'boot_disk'
op|'.'
name|'deviceKey'
op|'='
name|'device'
op|'.'
name|'key'
newline|'\n'
name|'boot_options'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineBootOptions'"
op|')'
newline|'\n'
name|'boot_options'
op|'.'
name|'bootOrder'
op|'='
op|'['
name|'boot_disk'
op|']'
newline|'\n'
name|'config_spec'
op|'.'
name|'bootOptions'
op|'='
name|'boot_options'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vm_resize_spec
dedent|''
name|'def'
name|'get_vm_resize_spec'
op|'('
name|'client_factory'
op|','
name|'vcpus'
op|','
name|'memory_mb'
op|','
name|'extra_specs'
op|','
nl|'\n'
name|'metadata'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Provides updates for a VM spec."""'
newline|'\n'
name|'resize_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
name|'resize_spec'
op|'.'
name|'numCPUs'
op|'='
name|'vcpus'
newline|'\n'
name|'resize_spec'
op|'.'
name|'memoryMB'
op|'='
name|'memory_mb'
newline|'\n'
name|'resize_spec'
op|'.'
name|'cpuAllocation'
op|'='
name|'_get_allocation_info'
op|'('
nl|'\n'
name|'client_factory'
op|','
name|'extra_specs'
op|'.'
name|'cpu_limits'
op|','
nl|'\n'
string|"'ns0:ResourceAllocationInfo'"
op|')'
newline|'\n'
name|'if'
name|'metadata'
op|':'
newline|'\n'
indent|' '
name|'resize_spec'
op|'.'
name|'annotation'
op|'='
name|'metadata'
newline|'\n'
dedent|''
name|'return'
name|'resize_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_controller_spec
dedent|''
name|'def'
name|'create_controller_spec'
op|'('
name|'client_factory'
op|','
name|'key'
op|','
nl|'\n'
name|'adapter_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_ADAPTER_TYPE'
op|','
nl|'\n'
name|'bus_number'
op|'='
number|'0'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds a Config Spec for the LSI or Bus Logic Controller\'s addition\n which acts as the controller for the virtual hard disk to be attached\n to the VM.\n """'
newline|'\n'
comment|'# Create a controller for the Virtual Hard Disk'
nl|'\n'
name|'virtual_device_config'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'operation'
op|'='
string|'"add"'
newline|'\n'
name|'if'
name|'adapter_type'
op|'=='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_BUSLOGIC'
op|':'
newline|'\n'
indent|' '
name|'virtual_controller'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualBusLogicController'"
op|')'
newline|'\n'
dedent|''
name|'elif'
name|'adapter_type'
op|'=='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_LSILOGICSAS'
op|':'
newline|'\n'
indent|' '
name|'virtual_controller'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualLsiLogicSASController'"
op|')'
newline|'\n'
dedent|''
name|'elif'
name|'adapter_type'
op|'=='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_PARAVIRTUAL'
op|':'
newline|'\n'
indent|' '
name|'virtual_controller'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:ParaVirtualSCSIController'"
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'virtual_controller'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualLsiLogicController'"
op|')'
newline|'\n'
dedent|''
name|'virtual_controller'
op|'.'
name|'key'
op|'='
name|'key'
newline|'\n'
name|'virtual_controller'
op|'.'
name|'busNumber'
op|'='
name|'bus_number'
newline|'\n'
name|'virtual_controller'
op|'.'
name|'sharedBus'
op|'='
string|'"noSharing"'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'device'
op|'='
name|'virtual_controller'
newline|'\n'
name|'return'
name|'virtual_device_config'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|convert_vif_model
dedent|''
name|'def'
name|'convert_vif_model'
op|'('
name|'name'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Converts standard VIF_MODEL types to the internal VMware ones."""'
newline|'\n'
name|'if'
name|'name'
op|'=='
name|'network_model'
op|'.'
name|'VIF_MODEL_E1000'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'VirtualE1000'"
newline|'\n'
dedent|''
name|'if'
name|'name'
op|'=='
name|'network_model'
op|'.'
name|'VIF_MODEL_E1000E'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'VirtualE1000e'"
newline|'\n'
dedent|''
name|'if'
name|'name'
op|'=='
name|'network_model'
op|'.'
name|'VIF_MODEL_PCNET'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'VirtualPCNet32'"
newline|'\n'
dedent|''
name|'if'
name|'name'
op|'=='
name|'network_model'
op|'.'
name|'VIF_MODEL_SRIOV'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'VirtualSriovEthernetCard'"
newline|'\n'
dedent|''
name|'if'
name|'name'
op|'=='
name|'network_model'
op|'.'
name|'VIF_MODEL_VMXNET'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'VirtualVmxnet'"
newline|'\n'
dedent|''
name|'if'
name|'name'
op|'=='
name|'network_model'
op|'.'
name|'VIF_MODEL_VMXNET3'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'VirtualVmxnet3'"
newline|'\n'
dedent|''
name|'if'
name|'name'
name|'not'
name|'in'
name|'ALL_SUPPORTED_NETWORK_DEVICES'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'%s is not supported.'"
op|')'
op|'%'
name|'name'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'Invalid'
op|'('
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'name'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_create_vif_spec
dedent|''
name|'def'
name|'_create_vif_spec'
op|'('
name|'client_factory'
op|','
name|'vif_info'
op|','
name|'vif_limits'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds a config spec for the addition of a new network\n adapter to the VM.\n """'
newline|'\n'
name|'network_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'network_spec'
op|'.'
name|'operation'
op|'='
string|'"add"'
newline|'\n'
nl|'\n'
comment|'# Keep compatible with other Hyper vif model parameter.'
nl|'\n'
name|'vif_info'
op|'['
string|"'vif_model'"
op|']'
op|'='
name|'convert_vif_model'
op|'('
name|'vif_info'
op|'['
string|"'vif_model'"
op|']'
op|')'
newline|'\n'
nl|'\n'
name|'vif'
op|'='
string|"'ns0:'"
op|'+'
name|'vif_info'
op|'['
string|"'vif_model'"
op|']'
newline|'\n'
name|'net_device'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
name|'vif'
op|')'
newline|'\n'
nl|'\n'
comment|'# NOTE(asomya): Only works on ESXi if the portgroup binding is set to'
nl|'\n'
comment|'# ephemeral. Invalid configuration if set to static and the NIC does'
nl|'\n'
comment|'# not come up on boot if set to dynamic.'
nl|'\n'
name|'network_ref'
op|'='
name|'vif_info'
op|'['
string|"'network_ref'"
op|']'
newline|'\n'
name|'network_name'
op|'='
name|'vif_info'
op|'['
string|"'network_name'"
op|']'
newline|'\n'
name|'mac_address'
op|'='
name|'vif_info'
op|'['
string|"'mac_address'"
op|']'
newline|'\n'
name|'backing'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'network_ref'
name|'and'
name|'network_ref'
op|'['
string|"'type'"
op|']'
op|'=='
string|"'OpaqueNetwork'"
op|':'
newline|'\n'
indent|' '
name|'backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualEthernetCardOpaqueNetworkBackingInfo'"
op|')'
newline|'\n'
name|'backing'
op|'.'
name|'opaqueNetworkId'
op|'='
name|'network_ref'
op|'['
string|"'network-id'"
op|']'
newline|'\n'
name|'backing'
op|'.'
name|'opaqueNetworkType'
op|'='
name|'network_ref'
op|'['
string|"'network-type'"
op|']'
newline|'\n'
comment|'# Configure externalId'
nl|'\n'
name|'if'
name|'network_ref'
op|'['
string|"'use-external-id'"
op|']'
op|':'
newline|'\n'
comment|'# externalId is only supported from vCenter 6.0 onwards'
nl|'\n'
indent|' '
name|'if'
name|'hasattr'
op|'('
name|'net_device'
op|','
string|"'externalId'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'net_device'
op|'.'
name|'externalId'
op|'='
name|'vif_info'
op|'['
string|"'iface_id'"
op|']'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'dp'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:DynamicProperty'"
op|')'
newline|'\n'
name|'dp'
op|'.'
name|'name'
op|'='
string|'"__externalId__"'
newline|'\n'
name|'dp'
op|'.'
name|'val'
op|'='
name|'vif_info'
op|'['
string|"'iface_id'"
op|']'
newline|'\n'
name|'net_device'
op|'.'
name|'dynamicProperty'
op|'='
op|'['
name|'dp'
op|']'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'elif'
op|'('
name|'network_ref'
name|'and'
nl|'\n'
name|'network_ref'
op|'['
string|"'type'"
op|']'
op|'=='
string|'"DistributedVirtualPortgroup"'
op|')'
op|':'
newline|'\n'
indent|' '
name|'backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualEthernetCardDistributedVirtualPortBackingInfo'"
op|')'
newline|'\n'
name|'portgroup'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:DistributedVirtualSwitchPortConnection'"
op|')'
newline|'\n'
name|'portgroup'
op|'.'
name|'switchUuid'
op|'='
name|'network_ref'
op|'['
string|"'dvsw'"
op|']'
newline|'\n'
name|'portgroup'
op|'.'
name|'portgroupKey'
op|'='
name|'network_ref'
op|'['
string|"'dvpg'"
op|']'
newline|'\n'
name|'if'
string|"'dvs_port_key'"
name|'in'
name|'network_ref'
op|':'
newline|'\n'
indent|' '
name|'portgroup'
op|'.'
name|'portKey'
op|'='
name|'network_ref'
op|'['
string|"'dvs_port_key'"
op|']'
newline|'\n'
dedent|''
name|'backing'
op|'.'
name|'port'
op|'='
name|'portgroup'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualEthernetCardNetworkBackingInfo'"
op|')'
newline|'\n'
name|'backing'
op|'.'
name|'deviceName'
op|'='
name|'network_name'
newline|'\n'
nl|'\n'
dedent|''
name|'connectable_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDeviceConnectInfo'"
op|')'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'startConnected'
op|'='
name|'True'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'allowGuestControl'
op|'='
name|'True'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'connected'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'net_device'
op|'.'
name|'connectable'
op|'='
name|'connectable_spec'
newline|'\n'
name|'net_device'
op|'.'
name|'backing'
op|'='
name|'backing'
newline|'\n'
nl|'\n'
comment|'# The Server assigns a Key to the device. Here we pass a -ve temporary key.'
nl|'\n'
comment|"# -ve because actual keys are +ve numbers and we don't"
nl|'\n'
comment|'# want a clash with the key that server might associate with the device'
nl|'\n'
name|'net_device'
op|'.'
name|'key'
op|'='
op|'-'
number|'47'
newline|'\n'
name|'net_device'
op|'.'
name|'addressType'
op|'='
string|'"manual"'
newline|'\n'
name|'net_device'
op|'.'
name|'macAddress'
op|'='
name|'mac_address'
newline|'\n'
name|'net_device'
op|'.'
name|'wakeOnLanEnabled'
op|'='
name|'True'
newline|'\n'
nl|'\n'
comment|'# vnic limits are only supported from version 6.0'
nl|'\n'
name|'if'
name|'vif_limits'
name|'and'
name|'vif_limits'
op|'.'
name|'has_limits'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'hasattr'
op|'('
name|'net_device'
op|','
string|"'resourceAllocation'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'net_device'
op|'.'
name|'resourceAllocation'
op|'='
name|'_get_allocation_info'
op|'('
nl|'\n'
name|'client_factory'
op|','
name|'vif_limits'
op|','
nl|'\n'
string|"'ns0:VirtualEthernetCardResourceAllocation'"
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'Limits only supported from vCenter 6.0 and above'"
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'Invalid'
op|'('
name|'msg'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'network_spec'
op|'.'
name|'device'
op|'='
name|'net_device'
newline|'\n'
name|'return'
name|'network_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_network_attach_config_spec
dedent|''
name|'def'
name|'get_network_attach_config_spec'
op|'('
name|'client_factory'
op|','
name|'vif_info'
op|','
name|'index'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the vif attach config spec."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
name|'vif_spec'
op|'='
name|'_create_vif_spec'
op|'('
name|'client_factory'
op|','
name|'vif_info'
op|')'
newline|'\n'
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
op|'['
name|'vif_spec'
op|']'
newline|'\n'
name|'if'
name|'vif_info'
op|'['
string|"'iface_id'"
op|']'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'.'
name|'extraConfig'
op|'='
op|'['
name|'_iface_id_option_value'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'vif_info'
op|'['
string|"'iface_id'"
op|']'
op|','
nl|'\n'
name|'index'
op|')'
op|']'
newline|'\n'
dedent|''
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_network_detach_config_spec
dedent|''
name|'def'
name|'get_network_detach_config_spec'
op|'('
name|'client_factory'
op|','
name|'device'
op|','
name|'port_index'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the vif detach config spec."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
name|'virtual_device_config'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'operation'
op|'='
string|'"remove"'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'device'
op|'='
name|'device'
newline|'\n'
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
op|'['
name|'virtual_device_config'
op|']'
newline|'\n'
comment|'# If a key is already present then it cannot be deleted, only updated.'
nl|'\n'
comment|'# This enables us to reuse this key if there is an additional'
nl|'\n'
comment|'# attachment. The keys need to be preserved. This is due to the fact'
nl|'\n'
comment|'# that there is logic on the ESX that does the network wiring'
nl|'\n'
comment|'# according to these values. If they are changed then this will'
nl|'\n'
comment|'# break networking to and from the interface.'
nl|'\n'
name|'config_spec'
op|'.'
name|'extraConfig'
op|'='
op|'['
name|'_iface_id_option_value'
op|'('
name|'client_factory'
op|','
nl|'\n'
string|"'free'"
op|','
nl|'\n'
name|'port_index'
op|')'
op|']'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_storage_profile_spec
dedent|''
name|'def'
name|'get_storage_profile_spec'
op|'('
name|'session'
op|','
name|'storage_policy'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Gets the vm profile spec configured for storage policy."""'
newline|'\n'
name|'profile_id'
op|'='
name|'pbm'
op|'.'
name|'get_profile_id_by_name'
op|'('
name|'session'
op|','
name|'storage_policy'
op|')'
newline|'\n'
name|'if'
name|'profile_id'
op|':'
newline|'\n'
indent|' '
name|'client_factory'
op|'='
name|'session'
op|'.'
name|'vim'
op|'.'
name|'client'
op|'.'
name|'factory'
newline|'\n'
name|'storage_profile_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualMachineDefinedProfileSpec'"
op|')'
newline|'\n'
name|'storage_profile_spec'
op|'.'
name|'profileId'
op|'='
name|'profile_id'
op|'.'
name|'uniqueId'
newline|'\n'
name|'return'
name|'storage_profile_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_attach_config_spec
dedent|''
dedent|''
name|'def'
name|'get_vmdk_attach_config_spec'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'disk_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_DISK_TYPE'
op|','
nl|'\n'
name|'file_path'
op|'='
name|'None'
op|','
nl|'\n'
name|'disk_size'
op|'='
name|'None'
op|','
nl|'\n'
name|'linked_clone'
op|'='
name|'False'
op|','
nl|'\n'
name|'controller_key'
op|'='
name|'None'
op|','
nl|'\n'
name|'unit_number'
op|'='
name|'None'
op|','
nl|'\n'
name|'device_name'
op|'='
name|'None'
op|','
nl|'\n'
name|'disk_io_limits'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the vmdk attach config spec."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
nl|'\n'
name|'device_config_spec'
op|'='
op|'['
op|']'
newline|'\n'
name|'virtual_device_config_spec'
op|'='
name|'_create_virtual_disk_spec'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'controller_key'
op|','
name|'disk_type'
op|','
name|'file_path'
op|','
nl|'\n'
name|'disk_size'
op|','
name|'linked_clone'
op|','
nl|'\n'
name|'unit_number'
op|','
name|'device_name'
op|','
name|'disk_io_limits'
op|')'
newline|'\n'
nl|'\n'
name|'device_config_spec'
op|'.'
name|'append'
op|'('
name|'virtual_device_config_spec'
op|')'
newline|'\n'
nl|'\n'
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
name|'device_config_spec'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_cdrom_attach_config_spec
dedent|''
name|'def'
name|'get_cdrom_attach_config_spec'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'datastore'
op|','
nl|'\n'
name|'file_path'
op|','
nl|'\n'
name|'controller_key'
op|','
nl|'\n'
name|'cdrom_unit_number'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds and returns the cdrom attach config spec."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
nl|'\n'
name|'device_config_spec'
op|'='
op|'['
op|']'
newline|'\n'
name|'virtual_device_config_spec'
op|'='
name|'create_virtual_cdrom_spec'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'datastore'
op|','
nl|'\n'
name|'controller_key'
op|','
nl|'\n'
name|'file_path'
op|','
nl|'\n'
name|'cdrom_unit_number'
op|')'
newline|'\n'
nl|'\n'
name|'device_config_spec'
op|'.'
name|'append'
op|'('
name|'virtual_device_config_spec'
op|')'
newline|'\n'
nl|'\n'
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
name|'device_config_spec'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_detach_config_spec
dedent|''
name|'def'
name|'get_vmdk_detach_config_spec'
op|'('
name|'client_factory'
op|','
name|'device'
op|','
nl|'\n'
name|'destroy_disk'
op|'='
name|'False'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the vmdk detach config spec."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
nl|'\n'
name|'device_config_spec'
op|'='
op|'['
op|']'
newline|'\n'
name|'virtual_device_config_spec'
op|'='
name|'detach_virtual_disk_spec'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'device'
op|','
nl|'\n'
name|'destroy_disk'
op|')'
newline|'\n'
nl|'\n'
name|'device_config_spec'
op|'.'
name|'append'
op|'('
name|'virtual_device_config_spec'
op|')'
newline|'\n'
nl|'\n'
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
name|'device_config_spec'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vm_extra_config_spec
dedent|''
name|'def'
name|'get_vm_extra_config_spec'
op|'('
name|'client_factory'
op|','
name|'extra_opts'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds extra spec fields from a dictionary."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
comment|'# add the key value pairs'
nl|'\n'
name|'extra_config'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'key'
op|','
name|'value'
name|'in'
name|'six'
op|'.'
name|'iteritems'
op|'('
name|'extra_opts'
op|')'
op|':'
newline|'\n'
indent|' '
name|'opt'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt'
op|'.'
name|'key'
op|'='
name|'key'
newline|'\n'
name|'opt'
op|'.'
name|'value'
op|'='
name|'value'
newline|'\n'
name|'extra_config'
op|'.'
name|'append'
op|'('
name|'opt'
op|')'
newline|'\n'
name|'config_spec'
op|'.'
name|'extraConfig'
op|'='
name|'extra_config'
newline|'\n'
dedent|''
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_device_capacity
dedent|''
name|'def'
name|'_get_device_capacity'
op|'('
name|'device'
op|')'
op|':'
newline|'\n'
comment|'# Devices pre-vSphere-5.5 only reports capacityInKB, which has'
nl|'\n'
comment|'# rounding inaccuracies. Use that only if the more accurate'
nl|'\n'
comment|'# attribute is absent.'
nl|'\n'
indent|' '
name|'if'
name|'hasattr'
op|'('
name|'device'
op|','
string|"'capacityInBytes'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
op|'.'
name|'capacityInBytes'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
op|'.'
name|'capacityInKB'
op|'*'
name|'units'
op|'.'
name|'Ki'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_device_disk_type
dedent|''
dedent|''
name|'def'
name|'_get_device_disk_type'
op|'('
name|'device'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'getattr'
op|'('
name|'device'
op|'.'
name|'backing'
op|','
string|"'thinProvisioned'"
op|','
name|'False'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'constants'
op|'.'
name|'DISK_TYPE_THIN'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'getattr'
op|'('
name|'device'
op|'.'
name|'backing'
op|','
string|"'eagerlyScrub'"
op|','
name|'False'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'constants'
op|'.'
name|'DISK_TYPE_EAGER_ZEROED_THICK'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'constants'
op|'.'
name|'DEFAULT_DISK_TYPE'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_info
dedent|''
dedent|''
dedent|''
name|'def'
name|'get_vmdk_info'
op|'('
name|'session'
op|','
name|'vm_ref'
op|','
name|'uuid'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns information for the primary VMDK attached to the given VM."""'
newline|'\n'
name|'hardware_devices'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
nl|'\n'
string|'"get_object_property"'
op|','
nl|'\n'
name|'vm_ref'
op|','
nl|'\n'
string|'"config.hardware.device"'
op|')'
newline|'\n'
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
dedent|''
name|'vmdk_file_path'
op|'='
name|'None'
newline|'\n'
name|'vmdk_controller_key'
op|'='
name|'None'
newline|'\n'
name|'disk_type'
op|'='
name|'None'
newline|'\n'
name|'capacity_in_bytes'
op|'='
number|'0'
newline|'\n'
nl|'\n'
comment|'# Determine if we need to get the details of the root disk'
nl|'\n'
name|'root_disk'
op|'='
name|'None'
newline|'\n'
name|'root_device'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'uuid'
op|':'
newline|'\n'
indent|' '
name|'root_disk'
op|'='
string|"'%s.vmdk'"
op|'%'
name|'uuid'
newline|'\n'
dedent|''
name|'vmdk_device'
op|'='
name|'None'
newline|'\n'
nl|'\n'
name|'adapter_type_dict'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDiskFlatVer2BackingInfo"'
op|':'
newline|'\n'
indent|' '
name|'path'
op|'='
name|'ds_obj'
op|'.'
name|'DatastorePath'
op|'.'
name|'parse'
op|'('
name|'device'
op|'.'
name|'backing'
op|'.'
name|'fileName'
op|')'
newline|'\n'
name|'if'
name|'root_disk'
name|'and'
name|'path'
op|'.'
name|'basename'
op|'=='
name|'root_disk'
op|':'
newline|'\n'
indent|' '
name|'root_device'
op|'='
name|'device'
newline|'\n'
dedent|''
name|'vmdk_device'
op|'='
name|'device'
newline|'\n'
dedent|''
dedent|''
name|'elif'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualLsiLogicController"'
op|':'
newline|'\n'
indent|' '
name|'adapter_type_dict'
op|'['
name|'device'
op|'.'
name|'key'
op|']'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_ADAPTER_TYPE'
newline|'\n'
dedent|''
name|'elif'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualBusLogicController"'
op|':'
newline|'\n'
indent|' '
name|'adapter_type_dict'
op|'['
name|'device'
op|'.'
name|'key'
op|']'
op|'='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_BUSLOGIC'
newline|'\n'
dedent|''
name|'elif'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualIDEController"'
op|':'
newline|'\n'
indent|' '
name|'adapter_type_dict'
op|'['
name|'device'
op|'.'
name|'key'
op|']'
op|'='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_IDE'
newline|'\n'
dedent|''
name|'elif'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualLsiLogicSASController"'
op|':'
newline|'\n'
indent|' '
name|'adapter_type_dict'
op|'['
name|'device'
op|'.'
name|'key'
op|']'
op|'='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_LSILOGICSAS'
newline|'\n'
dedent|''
name|'elif'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ParaVirtualSCSIController"'
op|':'
newline|'\n'
indent|' '
name|'adapter_type_dict'
op|'['
name|'device'
op|'.'
name|'key'
op|']'
op|'='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_PARAVIRTUAL'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'if'
name|'root_disk'
op|':'
newline|'\n'
indent|' '
name|'vmdk_device'
op|'='
name|'root_device'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'vmdk_device'
op|':'
newline|'\n'
indent|' '
name|'vmdk_file_path'
op|'='
name|'vmdk_device'
op|'.'
name|'backing'
op|'.'
name|'fileName'
newline|'\n'
name|'capacity_in_bytes'
op|'='
name|'_get_device_capacity'
op|'('
name|'vmdk_device'
op|')'
newline|'\n'
name|'vmdk_controller_key'
op|'='
name|'vmdk_device'
op|'.'
name|'controllerKey'
newline|'\n'
name|'disk_type'
op|'='
name|'_get_device_disk_type'
op|'('
name|'vmdk_device'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'adapter_type'
op|'='
name|'adapter_type_dict'
op|'.'
name|'get'
op|'('
name|'vmdk_controller_key'
op|')'
newline|'\n'
name|'return'
name|'VmdkInfo'
op|'('
name|'vmdk_file_path'
op|','
name|'adapter_type'
op|','
name|'disk_type'
op|','
nl|'\n'
name|'capacity_in_bytes'
op|','
name|'vmdk_device'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|variable|scsi_controller_classes
dedent|''
name|'scsi_controller_classes'
op|'='
op|'{'
nl|'\n'
string|"'ParaVirtualSCSIController'"
op|':'
name|'constants'
op|'.'
name|'ADAPTER_TYPE_PARAVIRTUAL'
op|','
nl|'\n'
string|"'VirtualLsiLogicController'"
op|':'
name|'constants'
op|'.'
name|'DEFAULT_ADAPTER_TYPE'
op|','
nl|'\n'
string|"'VirtualLsiLogicSASController'"
op|':'
name|'constants'
op|'.'
name|'ADAPTER_TYPE_LSILOGICSAS'
op|','
nl|'\n'
string|"'VirtualBusLogicController'"
op|':'
name|'constants'
op|'.'
name|'ADAPTER_TYPE_PARAVIRTUAL'
op|','
nl|'\n'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_scsi_adapter_type
name|'def'
name|'get_scsi_adapter_type'
op|'('
name|'hardware_devices'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Selects a proper iscsi adapter type from the existing\n hardware devices\n """'
newline|'\n'
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
name|'in'
name|'scsi_controller_classes'
op|':'
newline|'\n'
comment|'# find the controllers which still have available slots'
nl|'\n'
indent|' '
name|'if'
name|'len'
op|'('
name|'device'
op|'.'
name|'device'
op|')'
op|'<'
name|'constants'
op|'.'
name|'SCSI_MAX_CONNECT_NUMBER'
op|':'
newline|'\n'
comment|'# return the first match one'
nl|'\n'
indent|' '
name|'return'
name|'scsi_controller_classes'
op|'['
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|']'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'raise'
name|'exception'
op|'.'
name|'StorageError'
op|'('
nl|'\n'
name|'reason'
op|'='
name|'_'
op|'('
string|'"Unable to find iSCSI Target"'
op|')'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_find_controller_slot
dedent|''
name|'def'
name|'_find_controller_slot'
op|'('
name|'controller_keys'
op|','
name|'taken'
op|','
name|'max_unit_number'
op|')'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'controller_key'
name|'in'
name|'controller_keys'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'unit_number'
name|'in'
name|'range'
op|'('
name|'max_unit_number'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'unit_number'
name|'not'
name|'in'
name|'taken'
op|'.'
name|'get'
op|'('
name|'controller_key'
op|','
op|'['
op|']'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'controller_key'
op|','
name|'unit_number'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_is_ide_controller
dedent|''
dedent|''
dedent|''
dedent|''
name|'def'
name|'_is_ide_controller'
op|'('
name|'device'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|"'VirtualIDEController'"
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_is_scsi_controller
dedent|''
name|'def'
name|'_is_scsi_controller'
op|'('
name|'device'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
name|'in'
op|'['
string|"'VirtualLsiLogicController'"
op|','
nl|'\n'
string|"'VirtualLsiLogicSASController'"
op|','
nl|'\n'
string|"'VirtualBusLogicController'"
op|','
nl|'\n'
string|"'ParaVirtualSCSIController'"
op|']'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_find_allocated_slots
dedent|''
name|'def'
name|'_find_allocated_slots'
op|'('
name|'devices'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Return dictionary which maps controller_key to list of allocated unit\n numbers for that controller_key.\n """'
newline|'\n'
name|'taken'
op|'='
op|'{'
op|'}'
newline|'\n'
name|'for'
name|'device'
name|'in'
name|'devices'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'hasattr'
op|'('
name|'device'
op|','
string|"'controllerKey'"
op|')'
name|'and'
name|'hasattr'
op|'('
name|'device'
op|','
string|"'unitNumber'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'unit_numbers'
op|'='
name|'taken'
op|'.'
name|'setdefault'
op|'('
name|'device'
op|'.'
name|'controllerKey'
op|','
op|'['
op|']'
op|')'
newline|'\n'
name|'unit_numbers'
op|'.'
name|'append'
op|'('
name|'device'
op|'.'
name|'unitNumber'
op|')'
newline|'\n'
dedent|''
name|'if'
name|'_is_scsi_controller'
op|'('
name|'device'
op|')'
op|':'
newline|'\n'
comment|'# the SCSI controller sits on its own bus'
nl|'\n'
indent|' '
name|'unit_numbers'
op|'='
name|'taken'
op|'.'
name|'setdefault'
op|'('
name|'device'
op|'.'
name|'key'
op|','
op|'['
op|']'
op|')'
newline|'\n'
name|'unit_numbers'
op|'.'
name|'append'
op|'('
name|'device'
op|'.'
name|'scsiCtlrUnitNumber'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'return'
name|'taken'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_bus_number_for_scsi_controller
dedent|''
name|'def'
name|'_get_bus_number_for_scsi_controller'
op|'('
name|'devices'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Return usable bus number when create new SCSI controller."""'
newline|'\n'
comment|'# Every SCSI controller will take a unique bus number'
nl|'\n'
name|'taken'
op|'='
op|'['
name|'dev'
op|'.'
name|'busNumber'
name|'for'
name|'dev'
name|'in'
name|'devices'
name|'if'
name|'_is_scsi_controller'
op|'('
name|'dev'
op|')'
op|']'
newline|'\n'
comment|'# The max bus number for SCSI controllers is 3'
nl|'\n'
name|'for'
name|'i'
name|'in'
name|'range'
op|'('
name|'constants'
op|'.'
name|'SCSI_MAX_CONTROLLER_NUMBER'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'i'
name|'not'
name|'in'
name|'taken'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'i'
newline|'\n'
dedent|''
dedent|''
name|'msg'
op|'='
name|'_'
op|'('
string|"'Only %d SCSI controllers are allowed to be '"
nl|'\n'
string|"'created on this instance.'"
op|')'
op|'%'
name|'constants'
op|'.'
name|'SCSI_MAX_CONTROLLER_NUMBER'
newline|'\n'
name|'raise'
name|'vexc'
op|'.'
name|'VMwareDriverException'
op|'('
name|'msg'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|allocate_controller_key_and_unit_number
dedent|''
name|'def'
name|'allocate_controller_key_and_unit_number'
op|'('
name|'client_factory'
op|','
name|'devices'
op|','
nl|'\n'
name|'adapter_type'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""This function inspects the current set of hardware devices and returns\n controller_key and unit_number that can be used for attaching a new virtual\n disk to adapter with the given adapter_type.\n """'
newline|'\n'
name|'if'
name|'devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'devices'
op|'='
name|'devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'taken'
op|'='
name|'_find_allocated_slots'
op|'('
name|'devices'
op|')'
newline|'\n'
nl|'\n'
name|'ret'
op|'='
name|'None'
newline|'\n'
name|'if'
name|'adapter_type'
op|'=='
name|'constants'
op|'.'
name|'ADAPTER_TYPE_IDE'
op|':'
newline|'\n'
indent|' '
name|'ide_keys'
op|'='
op|'['
name|'dev'
op|'.'
name|'key'
name|'for'
name|'dev'
name|'in'
name|'devices'
name|'if'
name|'_is_ide_controller'
op|'('
name|'dev'
op|')'
op|']'
newline|'\n'
name|'ret'
op|'='
name|'_find_controller_slot'
op|'('
name|'ide_keys'
op|','
name|'taken'
op|','
number|'2'
op|')'
newline|'\n'
dedent|''
name|'elif'
name|'adapter_type'
name|'in'
name|'constants'
op|'.'
name|'SCSI_ADAPTER_TYPES'
op|':'
newline|'\n'
indent|' '
name|'scsi_keys'
op|'='
op|'['
name|'dev'
op|'.'
name|'key'
name|'for'
name|'dev'
name|'in'
name|'devices'
name|'if'
name|'_is_scsi_controller'
op|'('
name|'dev'
op|')'
op|']'
newline|'\n'
name|'ret'
op|'='
name|'_find_controller_slot'
op|'('
name|'scsi_keys'
op|','
name|'taken'
op|','
number|'16'
op|')'
newline|'\n'
dedent|''
name|'if'
name|'ret'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'ret'
op|'['
number|'0'
op|']'
op|','
name|'ret'
op|'['
number|'1'
op|']'
op|','
name|'None'
newline|'\n'
nl|'\n'
comment|'# create new controller with the specified type and return its spec'
nl|'\n'
dedent|''
name|'controller_key'
op|'='
op|'-'
number|'101'
newline|'\n'
nl|'\n'
comment|'# Get free bus number for new SCSI controller.'
nl|'\n'
name|'bus_number'
op|'='
number|'0'
newline|'\n'
name|'if'
name|'adapter_type'
name|'in'
name|'constants'
op|'.'
name|'SCSI_ADAPTER_TYPES'
op|':'
newline|'\n'
indent|' '
name|'bus_number'
op|'='
name|'_get_bus_number_for_scsi_controller'
op|'('
name|'devices'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'controller_spec'
op|'='
name|'create_controller_spec'
op|'('
name|'client_factory'
op|','
name|'controller_key'
op|','
nl|'\n'
name|'adapter_type'
op|','
name|'bus_number'
op|')'
newline|'\n'
name|'return'
name|'controller_key'
op|','
number|'0'
op|','
name|'controller_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_rdm_disk
dedent|''
name|'def'
name|'get_rdm_disk'
op|'('
name|'hardware_devices'
op|','
name|'uuid'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Gets the RDM disk key."""'
newline|'\n'
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
nl|'\n'
string|'"VirtualDiskRawDiskMappingVer1BackingInfo"'
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'lunUuid'
op|'=='
name|'uuid'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_create_spec
dedent|''
dedent|''
dedent|''
name|'def'
name|'get_vmdk_create_spec'
op|'('
name|'client_factory'
op|','
name|'size_in_kb'
op|','
nl|'\n'
name|'adapter_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_ADAPTER_TYPE'
op|','
nl|'\n'
name|'disk_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_DISK_TYPE'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the virtual disk create spec."""'
newline|'\n'
name|'create_vmdk_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:FileBackedVirtualDiskSpec'"
op|')'
newline|'\n'
name|'create_vmdk_spec'
op|'.'
name|'adapterType'
op|'='
name|'get_vmdk_adapter_type'
op|'('
name|'adapter_type'
op|')'
newline|'\n'
name|'create_vmdk_spec'
op|'.'
name|'diskType'
op|'='
name|'disk_type'
newline|'\n'
name|'create_vmdk_spec'
op|'.'
name|'capacityKb'
op|'='
name|'size_in_kb'
newline|'\n'
name|'return'
name|'create_vmdk_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_virtual_cdrom_spec
dedent|''
name|'def'
name|'create_virtual_cdrom_spec'
op|'('
name|'client_factory'
op|','
nl|'\n'
name|'datastore'
op|','
nl|'\n'
name|'controller_key'
op|','
nl|'\n'
name|'file_path'
op|','
nl|'\n'
name|'cdrom_unit_number'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds spec for the creation of a new Virtual CDROM to the VM."""'
newline|'\n'
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'config_spec'
op|'.'
name|'operation'
op|'='
string|'"add"'
newline|'\n'
nl|'\n'
name|'cdrom'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualCdrom'"
op|')'
newline|'\n'
nl|'\n'
name|'cdrom_device_backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualCdromIsoBackingInfo'"
op|')'
newline|'\n'
name|'cdrom_device_backing'
op|'.'
name|'datastore'
op|'='
name|'datastore'
newline|'\n'
name|'cdrom_device_backing'
op|'.'
name|'fileName'
op|'='
name|'file_path'
newline|'\n'
nl|'\n'
name|'cdrom'
op|'.'
name|'backing'
op|'='
name|'cdrom_device_backing'
newline|'\n'
name|'cdrom'
op|'.'
name|'controllerKey'
op|'='
name|'controller_key'
newline|'\n'
name|'cdrom'
op|'.'
name|'unitNumber'
op|'='
name|'cdrom_unit_number'
newline|'\n'
name|'cdrom'
op|'.'
name|'key'
op|'='
op|'-'
number|'1'
newline|'\n'
nl|'\n'
name|'connectable_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDeviceConnectInfo'"
op|')'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'startConnected'
op|'='
name|'True'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'allowGuestControl'
op|'='
name|'False'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'connected'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'cdrom'
op|'.'
name|'connectable'
op|'='
name|'connectable_spec'
newline|'\n'
nl|'\n'
name|'config_spec'
op|'.'
name|'device'
op|'='
name|'cdrom'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_create_virtual_disk_spec
dedent|''
name|'def'
name|'_create_virtual_disk_spec'
op|'('
name|'client_factory'
op|','
name|'controller_key'
op|','
nl|'\n'
name|'disk_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_DISK_TYPE'
op|','
nl|'\n'
name|'file_path'
op|'='
name|'None'
op|','
nl|'\n'
name|'disk_size'
op|'='
name|'None'
op|','
nl|'\n'
name|'linked_clone'
op|'='
name|'False'
op|','
nl|'\n'
name|'unit_number'
op|'='
name|'None'
op|','
nl|'\n'
name|'device_name'
op|'='
name|'None'
op|','
nl|'\n'
name|'disk_io_limits'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds spec for the creation of a new/ attaching of an already existing\n Virtual Disk to the VM.\n """'
newline|'\n'
name|'virtual_device_config'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'operation'
op|'='
string|'"add"'
newline|'\n'
name|'if'
op|'('
name|'file_path'
name|'is'
name|'None'
op|')'
name|'or'
name|'linked_clone'
op|':'
newline|'\n'
indent|' '
name|'virtual_device_config'
op|'.'
name|'fileOperation'
op|'='
string|'"create"'
newline|'\n'
nl|'\n'
dedent|''
name|'virtual_disk'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDisk'"
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'disk_type'
op|'=='
string|'"rdm"'
name|'or'
name|'disk_type'
op|'=='
string|'"rdmp"'
op|':'
newline|'\n'
indent|' '
name|'disk_file_backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDiskRawDiskMappingVer1BackingInfo'"
op|')'
newline|'\n'
name|'disk_file_backing'
op|'.'
name|'compatibilityMode'
op|'='
string|'"virtualMode"'
name|'if'
name|'disk_type'
op|'=='
string|'"rdm"'
name|'else'
string|'"physicalMode"'
newline|'\n'
name|'disk_file_backing'
op|'.'
name|'diskMode'
op|'='
string|'"independent_persistent"'
newline|'\n'
name|'disk_file_backing'
op|'.'
name|'deviceName'
op|'='
name|'device_name'
name|'or'
string|'""'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'disk_file_backing'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDiskFlatVer2BackingInfo'"
op|')'
newline|'\n'
name|'disk_file_backing'
op|'.'
name|'diskMode'
op|'='
string|'"persistent"'
newline|'\n'
name|'if'
name|'disk_type'
op|'=='
name|'constants'
op|'.'
name|'DISK_TYPE_THIN'
op|':'
newline|'\n'
indent|' '
name|'disk_file_backing'
op|'.'
name|'thinProvisioned'
op|'='
name|'True'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'disk_type'
op|'=='
name|'constants'
op|'.'
name|'DISK_TYPE_EAGER_ZEROED_THICK'
op|':'
newline|'\n'
indent|' '
name|'disk_file_backing'
op|'.'
name|'eagerlyScrub'
op|'='
name|'True'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'disk_file_backing'
op|'.'
name|'fileName'
op|'='
name|'file_path'
name|'or'
string|'""'
newline|'\n'
nl|'\n'
name|'connectable_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualDeviceConnectInfo'"
op|')'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'startConnected'
op|'='
name|'True'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'allowGuestControl'
op|'='
name|'False'
newline|'\n'
name|'connectable_spec'
op|'.'
name|'connected'
op|'='
name|'True'
newline|'\n'
nl|'\n'
name|'if'
name|'not'
name|'linked_clone'
op|':'
newline|'\n'
indent|' '
name|'virtual_disk'
op|'.'
name|'backing'
op|'='
name|'disk_file_backing'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'virtual_disk'
op|'.'
name|'backing'
op|'='
name|'copy'
op|'.'
name|'copy'
op|'('
name|'disk_file_backing'
op|')'
newline|'\n'
name|'virtual_disk'
op|'.'
name|'backing'
op|'.'
name|'fileName'
op|'='
string|'""'
newline|'\n'
name|'virtual_disk'
op|'.'
name|'backing'
op|'.'
name|'parent'
op|'='
name|'disk_file_backing'
newline|'\n'
dedent|''
name|'virtual_disk'
op|'.'
name|'connectable'
op|'='
name|'connectable_spec'
newline|'\n'
nl|'\n'
comment|'# The Server assigns a Key to the device. Here we pass a -ve random key.'
nl|'\n'
comment|"# -ve because actual keys are +ve numbers and we don't"
nl|'\n'
comment|'# want a clash with the key that server might associate with the device'
nl|'\n'
name|'virtual_disk'
op|'.'
name|'key'
op|'='
op|'-'
number|'100'
newline|'\n'
name|'virtual_disk'
op|'.'
name|'controllerKey'
op|'='
name|'controller_key'
newline|'\n'
name|'virtual_disk'
op|'.'
name|'unitNumber'
op|'='
name|'unit_number'
name|'or'
number|'0'
newline|'\n'
name|'virtual_disk'
op|'.'
name|'capacityInKB'
op|'='
name|'disk_size'
name|'or'
number|'0'
newline|'\n'
nl|'\n'
name|'if'
name|'disk_io_limits'
name|'and'
name|'disk_io_limits'
op|'.'
name|'has_limits'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'virtual_disk'
op|'.'
name|'storageIOAllocation'
op|'='
name|'_get_allocation_info'
op|'('
nl|'\n'
name|'client_factory'
op|','
name|'disk_io_limits'
op|','
nl|'\n'
string|"'ns0:StorageIOAllocationInfo'"
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'virtual_device_config'
op|'.'
name|'device'
op|'='
name|'virtual_disk'
newline|'\n'
nl|'\n'
name|'return'
name|'virtual_device_config'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|detach_virtual_disk_spec
dedent|''
name|'def'
name|'detach_virtual_disk_spec'
op|'('
name|'client_factory'
op|','
name|'device'
op|','
name|'destroy_disk'
op|'='
name|'False'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds spec for the detach of an already existing Virtual Disk from VM.\n """'
newline|'\n'
name|'virtual_device_config'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'operation'
op|'='
string|'"remove"'
newline|'\n'
name|'if'
name|'destroy_disk'
op|':'
newline|'\n'
indent|' '
name|'virtual_device_config'
op|'.'
name|'fileOperation'
op|'='
string|'"destroy"'
newline|'\n'
dedent|''
name|'virtual_device_config'
op|'.'
name|'device'
op|'='
name|'device'
newline|'\n'
nl|'\n'
name|'return'
name|'virtual_device_config'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|clone_vm_spec
dedent|''
name|'def'
name|'clone_vm_spec'
op|'('
name|'client_factory'
op|','
name|'location'
op|','
nl|'\n'
name|'power_on'
op|'='
name|'False'
op|','
name|'snapshot'
op|'='
name|'None'
op|','
name|'template'
op|'='
name|'False'
op|','
name|'config'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the VM clone spec."""'
newline|'\n'
name|'clone_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineCloneSpec'"
op|')'
newline|'\n'
name|'clone_spec'
op|'.'
name|'location'
op|'='
name|'location'
newline|'\n'
name|'clone_spec'
op|'.'
name|'powerOn'
op|'='
name|'power_on'
newline|'\n'
name|'if'
name|'snapshot'
op|':'
newline|'\n'
indent|' '
name|'clone_spec'
op|'.'
name|'snapshot'
op|'='
name|'snapshot'
newline|'\n'
dedent|''
name|'if'
name|'config'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'clone_spec'
op|'.'
name|'config'
op|'='
name|'config'
newline|'\n'
dedent|''
name|'clone_spec'
op|'.'
name|'template'
op|'='
name|'template'
newline|'\n'
name|'return'
name|'clone_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|relocate_vm_spec
dedent|''
name|'def'
name|'relocate_vm_spec'
op|'('
name|'client_factory'
op|','
name|'datastore'
op|'='
name|'None'
op|','
name|'host'
op|'='
name|'None'
op|','
nl|'\n'
name|'disk_move_type'
op|'='
string|'"moveAllDiskBackingsAndAllowSharing"'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the VM relocation spec."""'
newline|'\n'
name|'rel_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineRelocateSpec'"
op|')'
newline|'\n'
name|'rel_spec'
op|'.'
name|'datastore'
op|'='
name|'datastore'
newline|'\n'
name|'rel_spec'
op|'.'
name|'diskMoveType'
op|'='
name|'disk_move_type'
newline|'\n'
name|'if'
name|'host'
op|':'
newline|'\n'
indent|' '
name|'rel_spec'
op|'.'
name|'host'
op|'='
name|'host'
newline|'\n'
dedent|''
name|'return'
name|'rel_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_machine_id_change_spec
dedent|''
name|'def'
name|'get_machine_id_change_spec'
op|'('
name|'client_factory'
op|','
name|'machine_id_str'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the machine id change config spec."""'
newline|'\n'
name|'virtual_machine_config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
nl|'\n'
name|'opt'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt'
op|'.'
name|'key'
op|'='
string|'"machine.id"'
newline|'\n'
name|'opt'
op|'.'
name|'value'
op|'='
name|'machine_id_str'
newline|'\n'
name|'virtual_machine_config_spec'
op|'.'
name|'extraConfig'
op|'='
op|'['
name|'opt'
op|']'
newline|'\n'
name|'return'
name|'virtual_machine_config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_add_vswitch_port_group_spec
dedent|''
name|'def'
name|'get_add_vswitch_port_group_spec'
op|'('
name|'client_factory'
op|','
name|'vswitch_name'
op|','
nl|'\n'
name|'port_group_name'
op|','
name|'vlan_id'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the virtual switch port group add spec."""'
newline|'\n'
name|'vswitch_port_group_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:HostPortGroupSpec'"
op|')'
newline|'\n'
name|'vswitch_port_group_spec'
op|'.'
name|'name'
op|'='
name|'port_group_name'
newline|'\n'
name|'vswitch_port_group_spec'
op|'.'
name|'vswitchName'
op|'='
name|'vswitch_name'
newline|'\n'
nl|'\n'
comment|'# VLAN ID of 0 means that VLAN tagging is not to be done for the network.'
nl|'\n'
name|'vswitch_port_group_spec'
op|'.'
name|'vlanId'
op|'='
name|'int'
op|'('
name|'vlan_id'
op|')'
newline|'\n'
nl|'\n'
name|'policy'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:HostNetworkPolicy'"
op|')'
newline|'\n'
name|'nicteaming'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:HostNicTeamingPolicy'"
op|')'
newline|'\n'
name|'nicteaming'
op|'.'
name|'notifySwitches'
op|'='
name|'True'
newline|'\n'
name|'policy'
op|'.'
name|'nicTeaming'
op|'='
name|'nicteaming'
newline|'\n'
nl|'\n'
name|'vswitch_port_group_spec'
op|'.'
name|'policy'
op|'='
name|'policy'
newline|'\n'
name|'return'
name|'vswitch_port_group_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vnc_config_spec
dedent|''
name|'def'
name|'get_vnc_config_spec'
op|'('
name|'client_factory'
op|','
name|'port'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Builds the vnc config spec."""'
newline|'\n'
name|'virtual_machine_config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
nl|'\n'
name|'opt_enabled'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt_enabled'
op|'.'
name|'key'
op|'='
string|'"RemoteDisplay.vnc.enabled"'
newline|'\n'
name|'opt_enabled'
op|'.'
name|'value'
op|'='
string|'"true"'
newline|'\n'
name|'opt_port'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt_port'
op|'.'
name|'key'
op|'='
string|'"RemoteDisplay.vnc.port"'
newline|'\n'
name|'opt_port'
op|'.'
name|'value'
op|'='
name|'port'
newline|'\n'
name|'opt_keymap'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:OptionValue'"
op|')'
newline|'\n'
name|'opt_keymap'
op|'.'
name|'key'
op|'='
string|'"RemoteDisplay.vnc.keyMap"'
newline|'\n'
name|'opt_keymap'
op|'.'
name|'value'
op|'='
name|'CONF'
op|'.'
name|'vnc'
op|'.'
name|'keymap'
newline|'\n'
nl|'\n'
name|'extras'
op|'='
op|'['
name|'opt_enabled'
op|','
name|'opt_port'
op|','
name|'opt_keymap'
op|']'
newline|'\n'
nl|'\n'
name|'virtual_machine_config_spec'
op|'.'
name|'extraConfig'
op|'='
name|'extras'
newline|'\n'
name|'return'
name|'virtual_machine_config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vnc_port
dedent|''
name|'def'
name|'get_vnc_port'
op|'('
name|'session'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Return VNC port for an VM or None if there is no available port."""'
newline|'\n'
name|'min_port'
op|'='
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'vnc_port'
newline|'\n'
name|'port_total'
op|'='
name|'CONF'
op|'.'
name|'vmware'
op|'.'
name|'vnc_port_total'
newline|'\n'
name|'allocated_ports'
op|'='
name|'_get_allocated_vnc_ports'
op|'('
name|'session'
op|')'
newline|'\n'
name|'max_port'
op|'='
name|'min_port'
op|'+'
name|'port_total'
newline|'\n'
name|'for'
name|'port'
name|'in'
name|'range'
op|'('
name|'min_port'
op|','
name|'max_port'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'port'
name|'not'
name|'in'
name|'allocated_ports'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'port'
newline|'\n'
dedent|''
dedent|''
name|'raise'
name|'exception'
op|'.'
name|'ConsolePortRangeExhausted'
op|'('
name|'min_port'
op|'='
name|'min_port'
op|','
nl|'\n'
name|'max_port'
op|'='
name|'max_port'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_allocated_vnc_ports
dedent|''
name|'def'
name|'_get_allocated_vnc_ports'
op|'('
name|'session'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Return an integer set of all allocated VNC ports."""'
newline|'\n'
comment|'# TODO(rgerganov): bug #1256944'
nl|'\n'
comment|'# The VNC port should be unique per host, not per vCenter'
nl|'\n'
name|'vnc_ports'
op|'='
name|'set'
op|'('
op|')'
newline|'\n'
name|'result'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
string|'"get_objects"'
op|','
nl|'\n'
string|'"VirtualMachine"'
op|','
op|'['
name|'VNC_CONFIG_KEY'
op|']'
op|')'
newline|'\n'
name|'while'
name|'result'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'obj'
name|'in'
name|'result'
op|'.'
name|'objects'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'hasattr'
op|'('
name|'obj'
op|','
string|"'propSet'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'continue'
newline|'\n'
dedent|''
name|'dynamic_prop'
op|'='
name|'obj'
op|'.'
name|'propSet'
op|'['
number|'0'
op|']'
newline|'\n'
name|'option_value'
op|'='
name|'dynamic_prop'
op|'.'
name|'val'
newline|'\n'
name|'vnc_port'
op|'='
name|'option_value'
op|'.'
name|'value'
newline|'\n'
name|'vnc_ports'
op|'.'
name|'add'
op|'('
name|'int'
op|'('
name|'vnc_port'
op|')'
op|')'
newline|'\n'
dedent|''
name|'result'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|"'continue_retrieval'"
op|','
nl|'\n'
name|'result'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'vnc_ports'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_object_for_value
dedent|''
name|'def'
name|'_get_object_for_value'
op|'('
name|'results'
op|','
name|'value'
op|')'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'object'
name|'in'
name|'results'
op|'.'
name|'objects'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'object'
op|'.'
name|'propSet'
op|'['
number|'0'
op|']'
op|'.'
name|'val'
op|'=='
name|'value'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'object'
op|'.'
name|'obj'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_object_for_optionvalue
dedent|''
dedent|''
dedent|''
name|'def'
name|'_get_object_for_optionvalue'
op|'('
name|'results'
op|','
name|'value'
op|')'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'object'
name|'in'
name|'results'
op|'.'
name|'objects'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'hasattr'
op|'('
name|'object'
op|','
string|'"propSet"'
op|')'
name|'and'
name|'object'
op|'.'
name|'propSet'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'object'
op|'.'
name|'propSet'
op|'['
number|'0'
op|']'
op|'.'
name|'val'
op|'.'
name|'value'
op|'=='
name|'value'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'object'
op|'.'
name|'obj'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_object_from_results
dedent|''
dedent|''
dedent|''
dedent|''
name|'def'
name|'_get_object_from_results'
op|'('
name|'session'
op|','
name|'results'
op|','
name|'value'
op|','
name|'func'
op|')'
op|':'
newline|'\n'
indent|' '
name|'while'
name|'results'
op|':'
newline|'\n'
indent|' '
name|'object'
op|'='
name|'func'
op|'('
name|'results'
op|','
name|'value'
op|')'
newline|'\n'
name|'if'
name|'object'
op|':'
newline|'\n'
indent|' '
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|"'cancel_retrieval'"
op|','
nl|'\n'
name|'results'
op|')'
newline|'\n'
name|'return'
name|'object'
newline|'\n'
dedent|''
name|'results'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|"'continue_retrieval'"
op|','
nl|'\n'
name|'results'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_vm_ref_from_name
dedent|''
dedent|''
name|'def'
name|'_get_vm_ref_from_name'
op|'('
name|'session'
op|','
name|'vm_name'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to the VM with the name specified."""'
newline|'\n'
name|'vms'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
string|'"get_objects"'
op|','
nl|'\n'
string|'"VirtualMachine"'
op|','
op|'['
string|'"name"'
op|']'
op|')'
newline|'\n'
name|'return'
name|'_get_object_from_results'
op|'('
name|'session'
op|','
name|'vms'
op|','
name|'vm_name'
op|','
nl|'\n'
name|'_get_object_for_value'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
dedent|''
op|'@'
name|'vm_ref_cache_from_name'
newline|'\n'
DECL|function|get_vm_ref_from_name
name|'def'
name|'get_vm_ref_from_name'
op|'('
name|'session'
op|','
name|'vm_name'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
op|'('
name|'_get_vm_ref_from_vm_uuid'
op|'('
name|'session'
op|','
name|'vm_name'
op|')'
name|'or'
nl|'\n'
name|'_get_vm_ref_from_name'
op|'('
name|'session'
op|','
name|'vm_name'
op|')'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_vm_ref_from_uuid
dedent|''
name|'def'
name|'_get_vm_ref_from_uuid'
op|'('
name|'session'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to the VM with the uuid specified.\n\n This method reads all of the names of the VM\'s that are running\n on the backend, then it filters locally the matching\n instance_uuid. It is far more optimal to use\n _get_vm_ref_from_vm_uuid.\n """'
newline|'\n'
name|'vms'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
string|'"get_objects"'
op|','
nl|'\n'
string|'"VirtualMachine"'
op|','
op|'['
string|'"name"'
op|']'
op|')'
newline|'\n'
name|'return'
name|'_get_object_from_results'
op|'('
name|'session'
op|','
name|'vms'
op|','
name|'instance_uuid'
op|','
nl|'\n'
name|'_get_object_for_value'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_vm_ref_from_vm_uuid
dedent|''
name|'def'
name|'_get_vm_ref_from_vm_uuid'
op|'('
name|'session'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to the VM.\n\n The method will make use of FindAllByUuid to get the VM reference.\n This method finds all VM\'s on the backend that match the\n instance_uuid, more specifically all VM\'s on the backend that have\n \'config_spec.instanceUuid\' set to \'instance_uuid\'.\n """'
newline|'\n'
name|'vm_refs'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|','
nl|'\n'
string|'"FindAllByUuid"'
op|','
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|'.'
name|'service_content'
op|'.'
name|'searchIndex'
op|','
nl|'\n'
name|'uuid'
op|'='
name|'instance_uuid'
op|','
nl|'\n'
name|'vmSearch'
op|'='
name|'True'
op|','
nl|'\n'
name|'instanceUuid'
op|'='
name|'True'
op|')'
newline|'\n'
name|'if'
name|'vm_refs'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'vm_refs'
op|'['
number|'0'
op|']'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_vm_ref_from_extraconfig
dedent|''
dedent|''
name|'def'
name|'_get_vm_ref_from_extraconfig'
op|'('
name|'session'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to the VM with the uuid specified."""'
newline|'\n'
name|'vms'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
string|'"get_objects"'
op|','
nl|'\n'
string|'"VirtualMachine"'
op|','
op|'['
string|'\'config.extraConfig["nvp.vm-uuid"]\''
op|']'
op|')'
newline|'\n'
name|'return'
name|'_get_object_from_results'
op|'('
name|'session'
op|','
name|'vms'
op|','
name|'instance_uuid'
op|','
nl|'\n'
name|'_get_object_for_optionvalue'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
dedent|''
op|'@'
name|'vm_ref_cache_from_instance'
newline|'\n'
DECL|function|get_vm_ref
name|'def'
name|'get_vm_ref'
op|'('
name|'session'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to the VM through uuid or vm name."""'
newline|'\n'
name|'uuid'
op|'='
name|'instance'
op|'.'
name|'uuid'
newline|'\n'
name|'vm_ref'
op|'='
op|'('
name|'search_vm_ref_by_identifier'
op|'('
name|'session'
op|','
name|'uuid'
op|')'
name|'or'
nl|'\n'
name|'_get_vm_ref_from_name'
op|'('
name|'session'
op|','
name|'instance'
op|'.'
name|'name'
op|')'
op|')'
newline|'\n'
name|'if'
name|'vm_ref'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'raise'
name|'exception'
op|'.'
name|'InstanceNotFound'
op|'('
name|'instance_id'
op|'='
name|'uuid'
op|')'
newline|'\n'
dedent|''
name|'return'
name|'vm_ref'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|search_vm_ref_by_identifier
dedent|''
name|'def'
name|'search_vm_ref_by_identifier'
op|'('
name|'session'
op|','
name|'identifier'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Searches VM reference using the identifier.\n\n This method is primarily meant to separate out part of the logic for\n vm_ref search that could be use directly in the special case of\n migrating the instance. For querying VM linked to an instance always\n use get_vm_ref instead.\n """'
newline|'\n'
name|'vm_ref'
op|'='
op|'('
name|'_get_vm_ref_from_vm_uuid'
op|'('
name|'session'
op|','
name|'identifier'
op|')'
name|'or'
nl|'\n'
name|'_get_vm_ref_from_extraconfig'
op|'('
name|'session'
op|','
name|'identifier'
op|')'
name|'or'
nl|'\n'
name|'_get_vm_ref_from_uuid'
op|'('
name|'session'
op|','
name|'identifier'
op|')'
op|')'
newline|'\n'
name|'return'
name|'vm_ref'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_host_ref_for_vm
dedent|''
name|'def'
name|'get_host_ref_for_vm'
op|'('
name|'session'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get a MoRef to the ESXi host currently running an instance."""'
newline|'\n'
nl|'\n'
name|'vm_ref'
op|'='
name|'get_vm_ref'
op|'('
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
name|'return'
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|'"get_object_property"'
op|','
nl|'\n'
name|'vm_ref'
op|','
string|'"runtime.host"'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_host_name_for_vm
dedent|''
name|'def'
name|'get_host_name_for_vm'
op|'('
name|'session'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get the hostname of the ESXi host currently running an instance."""'
newline|'\n'
nl|'\n'
name|'host_ref'
op|'='
name|'get_host_ref_for_vm'
op|'('
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
name|'return'
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|'"get_object_property"'
op|','
nl|'\n'
name|'host_ref'
op|','
string|'"name"'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vm_state
dedent|''
name|'def'
name|'get_vm_state'
op|'('
name|'session'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
name|'vm_ref'
op|'='
name|'get_vm_ref'
op|'('
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
name|'vm_state'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|'"get_object_property"'
op|','
nl|'\n'
name|'vm_ref'
op|','
string|'"runtime.powerState"'
op|')'
newline|'\n'
name|'return'
name|'vm_state'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_stats_from_cluster
dedent|''
name|'def'
name|'get_stats_from_cluster'
op|'('
name|'session'
op|','
name|'cluster'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get the aggregate resource stats of a cluster."""'
newline|'\n'
name|'vcpus'
op|'='
number|'0'
newline|'\n'
name|'mem_info'
op|'='
op|'{'
string|"'total'"
op|':'
number|'0'
op|','
string|"'free'"
op|':'
number|'0'
op|'}'
newline|'\n'
comment|'# Get the Host and Resource Pool Managed Object Refs'
nl|'\n'
name|'prop_dict'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
nl|'\n'
string|'"get_object_properties_dict"'
op|','
nl|'\n'
name|'cluster'
op|','
nl|'\n'
op|'['
string|'"host"'
op|','
string|'"resourcePool"'
op|']'
op|')'
newline|'\n'
name|'if'
name|'prop_dict'
op|':'
newline|'\n'
indent|' '
name|'host_ret'
op|'='
name|'prop_dict'
op|'.'
name|'get'
op|'('
string|"'host'"
op|')'
newline|'\n'
name|'if'
name|'host_ret'
op|':'
newline|'\n'
indent|' '
name|'host_mors'
op|'='
name|'host_ret'
op|'.'
name|'ManagedObjectReference'
newline|'\n'
name|'result'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
nl|'\n'
string|'"get_properties_for_a_collection_of_objects"'
op|','
nl|'\n'
string|'"HostSystem"'
op|','
name|'host_mors'
op|','
nl|'\n'
op|'['
string|'"summary.hardware"'
op|','
string|'"summary.runtime"'
op|']'
op|')'
newline|'\n'
name|'for'
name|'obj'
name|'in'
name|'result'
op|'.'
name|'objects'
op|':'
newline|'\n'
indent|' '
name|'hardware_summary'
op|'='
name|'obj'
op|'.'
name|'propSet'
op|'['
number|'0'
op|']'
op|'.'
name|'val'
newline|'\n'
name|'runtime_summary'
op|'='
name|'obj'
op|'.'
name|'propSet'
op|'['
number|'1'
op|']'
op|'.'
name|'val'
newline|'\n'
name|'if'
op|'('
name|'runtime_summary'
op|'.'
name|'inMaintenanceMode'
name|'is'
name|'False'
name|'and'
nl|'\n'
name|'runtime_summary'
op|'.'
name|'connectionState'
op|'=='
string|'"connected"'
op|')'
op|':'
newline|'\n'
comment|'# Total vcpus is the sum of all pCPUs of individual hosts'
nl|'\n'
comment|'# The overcommitment ratio is factored in by the scheduler'
nl|'\n'
indent|' '
name|'vcpus'
op|'+='
name|'hardware_summary'
op|'.'
name|'numCpuThreads'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
dedent|''
name|'res_mor'
op|'='
name|'prop_dict'
op|'.'
name|'get'
op|'('
string|"'resourcePool'"
op|')'
newline|'\n'
name|'if'
name|'res_mor'
op|':'
newline|'\n'
indent|' '
name|'res_usage'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|'"get_object_property"'
op|','
nl|'\n'
name|'res_mor'
op|','
string|'"summary.runtime.memory"'
op|')'
newline|'\n'
name|'if'
name|'res_usage'
op|':'
newline|'\n'
comment|"# maxUsage is the memory limit of the cluster available to VM's"
nl|'\n'
indent|' '
name|'mem_info'
op|'['
string|"'total'"
op|']'
op|'='
name|'int'
op|'('
name|'res_usage'
op|'.'
name|'maxUsage'
op|'/'
name|'units'
op|'.'
name|'Mi'
op|')'
newline|'\n'
comment|"# overallUsage is the hypervisor's view of memory usage by VM's"
nl|'\n'
name|'consumed'
op|'='
name|'int'
op|'('
name|'res_usage'
op|'.'
name|'overallUsage'
op|'/'
name|'units'
op|'.'
name|'Mi'
op|')'
newline|'\n'
name|'mem_info'
op|'['
string|"'free'"
op|']'
op|'='
name|'mem_info'
op|'['
string|"'total'"
op|']'
op|'-'
name|'consumed'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'stats'
op|'='
op|'{'
string|"'vcpus'"
op|':'
name|'vcpus'
op|','
string|"'mem'"
op|':'
name|'mem_info'
op|'}'
newline|'\n'
name|'return'
name|'stats'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_host_ref
dedent|''
name|'def'
name|'get_host_ref'
op|'('
name|'session'
op|','
name|'cluster'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to a host within the cluster specified."""'
newline|'\n'
name|'if'
name|'cluster'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'results'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
string|'"get_objects"'
op|','
nl|'\n'
string|'"HostSystem"'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|"'cancel_retrieval'"
op|','
nl|'\n'
name|'results'
op|')'
newline|'\n'
name|'host_mor'
op|'='
name|'results'
op|'.'
name|'objects'
op|'['
number|'0'
op|']'
op|'.'
name|'obj'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'host_ret'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|'"get_object_property"'
op|','
nl|'\n'
name|'cluster'
op|','
string|'"host"'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'host_ret'
name|'or'
name|'not'
name|'host_ret'
op|'.'
name|'ManagedObjectReference'
op|':'
newline|'\n'
indent|' '
name|'msg'
op|'='
name|'_'
op|'('
string|"'No host available on cluster'"
op|')'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'NoValidHost'
op|'('
name|'reason'
op|'='
name|'msg'
op|')'
newline|'\n'
dedent|''
name|'host_mor'
op|'='
name|'host_ret'
op|'.'
name|'ManagedObjectReference'
op|'['
number|'0'
op|']'
newline|'\n'
nl|'\n'
dedent|''
name|'return'
name|'host_mor'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|propset_dict
dedent|''
name|'def'
name|'propset_dict'
op|'('
name|'propset'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Turn a propset list into a dictionary\n\n PropSet is an optional attribute on ObjectContent objects\n that are returned by the VMware API.\n\n You can read more about these at:\n | http://pubs.vmware.com/vsphere-51/index.jsp\n | #com.vmware.wssdk.apiref.doc/\n | vmodl.query.PropertyCollector.ObjectContent.html\n\n :param propset: a property "set" from ObjectContent\n :return: dictionary representing property set\n """'
newline|'\n'
name|'if'
name|'propset'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'return'
op|'{'
op|'}'
newline|'\n'
nl|'\n'
dedent|''
name|'return'
op|'{'
name|'prop'
op|'.'
name|'name'
op|':'
name|'prop'
op|'.'
name|'val'
name|'for'
name|'prop'
name|'in'
name|'propset'
op|'}'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_backed_disk_device
dedent|''
name|'def'
name|'get_vmdk_backed_disk_device'
op|'('
name|'hardware_devices'
op|','
name|'uuid'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
nl|'\n'
string|'"VirtualDiskFlatVer2BackingInfo"'
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'uuid'
op|'=='
name|'uuid'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_volume_disk
dedent|''
dedent|''
dedent|''
name|'def'
name|'get_vmdk_volume_disk'
op|'('
name|'hardware_devices'
op|','
name|'path'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'path'
name|'or'
name|'path'
op|'=='
name|'device'
op|'.'
name|'backing'
op|'.'
name|'fileName'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_res_pool_ref
dedent|''
dedent|''
dedent|''
dedent|''
name|'def'
name|'get_res_pool_ref'
op|'('
name|'session'
op|','
name|'cluster'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get the resource pool."""'
newline|'\n'
comment|'# Get the root resource pool of the cluster'
nl|'\n'
name|'res_pool_ref'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
nl|'\n'
string|'"get_object_property"'
op|','
nl|'\n'
name|'cluster'
op|','
nl|'\n'
string|'"resourcePool"'
op|')'
newline|'\n'
name|'return'
name|'res_pool_ref'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_all_cluster_mors
dedent|''
name|'def'
name|'get_all_cluster_mors'
op|'('
name|'session'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get all the clusters in the vCenter."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'results'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vim_util'
op|','
string|'"get_objects"'
op|','
nl|'\n'
string|'"ClusterComputeResource"'
op|','
op|'['
string|'"name"'
op|']'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|"'cancel_retrieval'"
op|','
nl|'\n'
name|'results'
op|')'
newline|'\n'
name|'return'
name|'results'
op|'.'
name|'objects'
newline|'\n'
nl|'\n'
dedent|''
name|'except'
name|'Exception'
name|'as'
name|'excep'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
string|'"Failed to get cluster references %s"'
op|')'
op|','
name|'excep'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_cluster_ref_by_name
dedent|''
dedent|''
name|'def'
name|'get_cluster_ref_by_name'
op|'('
name|'session'
op|','
name|'cluster_name'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get reference to the vCenter cluster with the specified name."""'
newline|'\n'
name|'all_clusters'
op|'='
name|'get_all_cluster_mors'
op|'('
name|'session'
op|')'
newline|'\n'
name|'for'
name|'cluster'
name|'in'
name|'all_clusters'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'hasattr'
op|'('
name|'cluster'
op|','
string|"'propSet'"
op|')'
name|'and'
nl|'\n'
name|'cluster'
op|'.'
name|'propSet'
op|'['
number|'0'
op|']'
op|'.'
name|'val'
op|'=='
name|'cluster_name'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'cluster'
op|'.'
name|'obj'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vmdk_adapter_type
dedent|''
dedent|''
dedent|''
name|'def'
name|'get_vmdk_adapter_type'
op|'('
name|'adapter_type'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Return the adapter type to be used in vmdk descriptor.\n\n Adapter type in vmdk descriptor is same for LSI-SAS, LSILogic & ParaVirtual\n because Virtual Disk Manager API does not recognize the newer controller\n types.\n """'
newline|'\n'
name|'if'
name|'adapter_type'
name|'in'
op|'['
name|'constants'
op|'.'
name|'ADAPTER_TYPE_LSILOGICSAS'
op|','
nl|'\n'
name|'constants'
op|'.'
name|'ADAPTER_TYPE_PARAVIRTUAL'
op|']'
op|':'
newline|'\n'
indent|' '
name|'vmdk_adapter_type'
op|'='
name|'constants'
op|'.'
name|'DEFAULT_ADAPTER_TYPE'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'vmdk_adapter_type'
op|'='
name|'adapter_type'
newline|'\n'
dedent|''
name|'return'
name|'vmdk_adapter_type'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_vm
dedent|''
name|'def'
name|'create_vm'
op|'('
name|'session'
op|','
name|'instance'
op|','
name|'vm_folder'
op|','
name|'config_spec'
op|','
name|'res_pool_ref'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Create VM on ESX host."""'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Creating VM on the ESX host"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'vm_create_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|','
nl|'\n'
string|'"CreateVM_Task"'
op|','
name|'vm_folder'
op|','
nl|'\n'
name|'config'
op|'='
name|'config_spec'
op|','
name|'pool'
op|'='
name|'res_pool_ref'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'task_info'
op|'='
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'vm_create_task'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'vexc'
op|'.'
name|'VMwareDriverException'
op|':'
newline|'\n'
comment|'# An invalid guestId will result in an error with no specific fault'
nl|'\n'
comment|"# type and the generic error 'A specified parameter was not correct'."
nl|'\n'
comment|'# As guestId is user-editable, we try to help the user out with some'
nl|'\n'
comment|"# additional information if we notice that guestId isn't in our list of"
nl|'\n'
comment|'# known-good values.'
nl|'\n'
comment|"# We don't check this in advance or do anything more than warn because"
nl|'\n'
comment|"# we can't guarantee that our list of known-good guestIds is complete."
nl|'\n'
comment|"# Consequently, a value which we don't recognise may in fact be valid."
nl|'\n'
indent|' '
name|'with'
name|'excutils'
op|'.'
name|'save_and_reraise_exception'
op|'('
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'config_spec'
op|'.'
name|'guestId'
name|'not'
name|'in'
name|'constants'
op|'.'
name|'VALID_OS_TYPES'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
string|"'vmware_ostype from image is not recognised: '"
nl|'\n'
string|"'\\'%(ostype)s\\'. An invalid os type may be '"
nl|'\n'
string|"'one cause of this instance creation failure'"
op|')'
op|','
nl|'\n'
op|'{'
string|"'ostype'"
op|':'
name|'config_spec'
op|'.'
name|'guestId'
op|'}'
op|')'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Created VM on the ESX host"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'return'
name|'task_info'
op|'.'
name|'result'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|destroy_vm
dedent|''
name|'def'
name|'destroy_vm'
op|'('
name|'session'
op|','
name|'instance'
op|','
name|'vm_ref'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Destroy a VM instance. Assumes VM is powered off."""'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'vm_ref'
op|':'
newline|'\n'
indent|' '
name|'vm_ref'
op|'='
name|'get_vm_ref'
op|'('
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Destroying the VM"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'destroy_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'session'
op|'.'
name|'vim'
op|','
string|'"Destroy_Task"'
op|','
nl|'\n'
name|'vm_ref'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'destroy_task'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'info'
op|'('
name|'_LI'
op|'('
string|'"Destroyed the VM"'
op|')'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'Exception'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'exception'
op|'('
name|'_LE'
op|'('
string|"'Destroy VM failed'"
op|')'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_virtual_disk
dedent|''
dedent|''
name|'def'
name|'create_virtual_disk'
op|'('
name|'session'
op|','
name|'dc_ref'
op|','
name|'adapter_type'
op|','
name|'disk_type'
op|','
nl|'\n'
name|'virtual_disk_path'
op|','
name|'size_in_kb'
op|')'
op|':'
newline|'\n'
comment|'# Create a Virtual Disk of the size of the flat vmdk file. This is'
nl|'\n'
comment|'# done just to generate the meta-data file whose specifics'
nl|'\n'
comment|'# depend on the size of the disk, thin/thick provisioning and the'
nl|'\n'
comment|'# storage adapter type.'
nl|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Creating Virtual Disk of size "'
nl|'\n'
string|'"%(vmdk_file_size_in_kb)s KB and adapter type "'
nl|'\n'
string|'"%(adapter_type)s on the data store"'
op|','
nl|'\n'
op|'{'
string|'"vmdk_file_size_in_kb"'
op|':'
name|'size_in_kb'
op|','
nl|'\n'
string|'"adapter_type"'
op|':'
name|'adapter_type'
op|'}'
op|')'
newline|'\n'
nl|'\n'
name|'vmdk_create_spec'
op|'='
name|'get_vmdk_create_spec'
op|'('
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|'.'
name|'client'
op|'.'
name|'factory'
op|','
nl|'\n'
name|'size_in_kb'
op|','
nl|'\n'
name|'adapter_type'
op|','
nl|'\n'
name|'disk_type'
op|')'
newline|'\n'
nl|'\n'
name|'vmdk_create_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|','
nl|'\n'
string|'"CreateVirtualDisk_Task"'
op|','
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|'.'
name|'service_content'
op|'.'
name|'virtualDiskManager'
op|','
nl|'\n'
name|'name'
op|'='
name|'virtual_disk_path'
op|','
nl|'\n'
name|'datacenter'
op|'='
name|'dc_ref'
op|','
nl|'\n'
name|'spec'
op|'='
name|'vmdk_create_spec'
op|')'
newline|'\n'
nl|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'vmdk_create_task'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Created Virtual Disk of size %(vmdk_file_size_in_kb)s"'
nl|'\n'
string|'" KB and type %(disk_type)s"'
op|','
nl|'\n'
op|'{'
string|'"vmdk_file_size_in_kb"'
op|':'
name|'size_in_kb'
op|','
nl|'\n'
string|'"disk_type"'
op|':'
name|'disk_type'
op|'}'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|copy_virtual_disk
dedent|''
name|'def'
name|'copy_virtual_disk'
op|'('
name|'session'
op|','
name|'dc_ref'
op|','
name|'source'
op|','
name|'dest'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Copy a sparse virtual disk to a thin virtual disk.\n\n This is also done to generate the meta-data file whose specifics\n depend on the size of the disk, thin/thick provisioning and the\n storage adapter type.\n\n :param session: - session for connection\n :param dc_ref: - data center reference object\n :param source: - source datastore path\n :param dest: - destination datastore path\n :returns: None\n """'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Copying Virtual Disk %(source)s to %(dest)s"'
op|','
nl|'\n'
op|'{'
string|"'source'"
op|':'
name|'source'
op|','
string|"'dest'"
op|':'
name|'dest'
op|'}'
op|')'
newline|'\n'
name|'vim'
op|'='
name|'session'
op|'.'
name|'vim'
newline|'\n'
name|'vmdk_copy_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
nl|'\n'
name|'vim'
op|','
nl|'\n'
string|'"CopyVirtualDisk_Task"'
op|','
nl|'\n'
name|'vim'
op|'.'
name|'service_content'
op|'.'
name|'virtualDiskManager'
op|','
nl|'\n'
name|'sourceName'
op|'='
name|'source'
op|','
nl|'\n'
name|'sourceDatacenter'
op|'='
name|'dc_ref'
op|','
nl|'\n'
name|'destName'
op|'='
name|'dest'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'vmdk_copy_task'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Copied Virtual Disk %(source)s to %(dest)s"'
op|','
nl|'\n'
op|'{'
string|"'source'"
op|':'
name|'source'
op|','
string|"'dest'"
op|':'
name|'dest'
op|'}'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|reconfigure_vm
dedent|''
name|'def'
name|'reconfigure_vm'
op|'('
name|'session'
op|','
name|'vm_ref'
op|','
name|'config_spec'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Reconfigure a VM according to the config spec."""'
newline|'\n'
name|'reconfig_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'session'
op|'.'
name|'vim'
op|','
nl|'\n'
string|'"ReconfigVM_Task"'
op|','
name|'vm_ref'
op|','
nl|'\n'
name|'spec'
op|'='
name|'config_spec'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'reconfig_task'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|power_on_instance
dedent|''
name|'def'
name|'power_on_instance'
op|'('
name|'session'
op|','
name|'instance'
op|','
name|'vm_ref'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Power on the specified instance."""'
newline|'\n'
nl|'\n'
name|'if'
name|'vm_ref'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'vm_ref'
op|'='
name|'get_vm_ref'
op|'('
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Powering on the VM"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'poweron_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
nl|'\n'
name|'session'
op|'.'
name|'vim'
op|','
nl|'\n'
string|'"PowerOnVM_Task"'
op|','
name|'vm_ref'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'poweron_task'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Powered on the VM"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'vexc'
op|'.'
name|'InvalidPowerStateException'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"VM already powered on"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_vm_port_indices
dedent|''
dedent|''
name|'def'
name|'_get_vm_port_indices'
op|'('
name|'session'
op|','
name|'vm_ref'
op|')'
op|':'
newline|'\n'
indent|' '
name|'extra_config'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
nl|'\n'
string|"'get_object_property'"
op|','
nl|'\n'
name|'vm_ref'
op|','
nl|'\n'
string|"'config.extraConfig'"
op|')'
newline|'\n'
name|'ports'
op|'='
op|'['
op|']'
newline|'\n'
name|'if'
name|'extra_config'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'options'
op|'='
name|'extra_config'
op|'.'
name|'OptionValue'
newline|'\n'
name|'for'
name|'option'
name|'in'
name|'options'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'option'
op|'.'
name|'key'
op|'.'
name|'startswith'
op|'('
string|"'nvp.iface-id.'"
op|')'
name|'and'
nl|'\n'
name|'option'
op|'.'
name|'value'
op|'!='
string|"'free'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'ports'
op|'.'
name|'append'
op|'('
name|'int'
op|'('
name|'option'
op|'.'
name|'key'
op|'.'
name|'split'
op|'('
string|"'.'"
op|')'
op|'['
number|'2'
op|']'
op|')'
op|')'
newline|'\n'
dedent|''
dedent|''
dedent|''
name|'return'
name|'ports'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_attach_port_index
dedent|''
name|'def'
name|'get_attach_port_index'
op|'('
name|'session'
op|','
name|'vm_ref'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Get the first free port index."""'
newline|'\n'
name|'ports'
op|'='
name|'_get_vm_port_indices'
op|'('
name|'session'
op|','
name|'vm_ref'
op|')'
newline|'\n'
comment|'# No ports are configured on the VM'
nl|'\n'
name|'if'
name|'not'
name|'ports'
op|':'
newline|'\n'
indent|' '
name|'return'
number|'0'
newline|'\n'
dedent|''
name|'ports'
op|'.'
name|'sort'
op|'('
op|')'
newline|'\n'
name|'configured_ports_len'
op|'='
name|'len'
op|'('
name|'ports'
op|')'
newline|'\n'
comment|'# Find the first free port index'
nl|'\n'
name|'for'
name|'port_index'
name|'in'
name|'range'
op|'('
name|'configured_ports_len'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'port_index'
op|'!='
name|'ports'
op|'['
name|'port_index'
op|']'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'port_index'
newline|'\n'
dedent|''
dedent|''
name|'return'
name|'configured_ports_len'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_vm_detach_port_index
dedent|''
name|'def'
name|'get_vm_detach_port_index'
op|'('
name|'session'
op|','
name|'vm_ref'
op|','
name|'iface_id'
op|')'
op|':'
newline|'\n'
indent|' '
name|'extra_config'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
nl|'\n'
string|"'get_object_property'"
op|','
nl|'\n'
name|'vm_ref'
op|','
nl|'\n'
string|"'config.extraConfig'"
op|')'
newline|'\n'
name|'if'
name|'extra_config'
name|'is'
name|'not'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'options'
op|'='
name|'extra_config'
op|'.'
name|'OptionValue'
newline|'\n'
name|'for'
name|'option'
name|'in'
name|'options'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'option'
op|'.'
name|'key'
op|'.'
name|'startswith'
op|'('
string|"'nvp.iface-id.'"
op|')'
name|'and'
nl|'\n'
name|'option'
op|'.'
name|'value'
op|'=='
name|'iface_id'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'int'
op|'('
name|'option'
op|'.'
name|'key'
op|'.'
name|'split'
op|'('
string|"'.'"
op|')'
op|'['
number|'2'
op|']'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|power_off_instance
dedent|''
dedent|''
dedent|''
dedent|''
name|'def'
name|'power_off_instance'
op|'('
name|'session'
op|','
name|'instance'
op|','
name|'vm_ref'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Power off the specified instance."""'
newline|'\n'
nl|'\n'
name|'if'
name|'vm_ref'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'vm_ref'
op|'='
name|'get_vm_ref'
op|'('
name|'session'
op|','
name|'instance'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Powering off the VM"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'poweroff_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'session'
op|'.'
name|'vim'
op|','
nl|'\n'
string|'"PowerOffVM_Task"'
op|','
name|'vm_ref'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'poweroff_task'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Powered off the VM"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'vexc'
op|'.'
name|'InvalidPowerStateException'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"VM already powered off"'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|find_rescue_device
dedent|''
dedent|''
name|'def'
name|'find_rescue_device'
op|'('
name|'hardware_devices'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Returns the rescue device.\n\n The method will raise an exception if the rescue device does not\n exist. The resuce device has suffix \'-rescue.vmdk\'.\n :param hardware_devices: the hardware devices for the instance\n :param instance: nova.objects.instance.Instance object\n :return: the rescue disk device object\n """'
newline|'\n'
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
nl|'\n'
string|"'VirtualDiskFlatVer2BackingInfo'"
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'fileName'
op|'.'
name|'endswith'
op|'('
string|"'-rescue.vmdk'"
op|')'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
name|'msg'
op|'='
name|'_'
op|'('
string|"'Rescue device does not exist for instance %s'"
op|')'
op|'%'
name|'instance'
op|'.'
name|'uuid'
newline|'\n'
name|'raise'
name|'exception'
op|'.'
name|'NotFound'
op|'('
name|'msg'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_ephemeral_name
dedent|''
name|'def'
name|'get_ephemeral_name'
op|'('
name|'id'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'ephemeral_%d.vmdk'"
op|'%'
name|'id'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_detach_and_delete_devices_config_spec
dedent|''
name|'def'
name|'_detach_and_delete_devices_config_spec'
op|'('
name|'client_factory'
op|','
name|'devices'
op|')'
op|':'
newline|'\n'
indent|' '
name|'config_spec'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
string|"'ns0:VirtualMachineConfigSpec'"
op|')'
newline|'\n'
name|'device_config_spec'
op|'='
op|'['
op|']'
newline|'\n'
name|'for'
name|'device'
name|'in'
name|'devices'
op|':'
newline|'\n'
indent|' '
name|'virtual_device_config'
op|'='
name|'client_factory'
op|'.'
name|'create'
op|'('
nl|'\n'
string|"'ns0:VirtualDeviceConfigSpec'"
op|')'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'operation'
op|'='
string|'"remove"'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'device'
op|'='
name|'device'
newline|'\n'
name|'virtual_device_config'
op|'.'
name|'fileOperation'
op|'='
string|'"destroy"'
newline|'\n'
name|'device_config_spec'
op|'.'
name|'append'
op|'('
name|'virtual_device_config'
op|')'
newline|'\n'
dedent|''
name|'config_spec'
op|'.'
name|'deviceChange'
op|'='
name|'device_config_spec'
newline|'\n'
name|'return'
name|'config_spec'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|detach_devices_from_vm
dedent|''
name|'def'
name|'detach_devices_from_vm'
op|'('
name|'session'
op|','
name|'vm_ref'
op|','
name|'devices'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Detach specified devices from VM."""'
newline|'\n'
name|'client_factory'
op|'='
name|'session'
op|'.'
name|'vim'
op|'.'
name|'client'
op|'.'
name|'factory'
newline|'\n'
name|'config_spec'
op|'='
name|'_detach_and_delete_devices_config_spec'
op|'('
nl|'\n'
name|'client_factory'
op|','
name|'devices'
op|')'
newline|'\n'
name|'reconfigure_vm'
op|'('
name|'session'
op|','
name|'vm_ref'
op|','
name|'config_spec'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_ephemerals
dedent|''
name|'def'
name|'get_ephemerals'
op|'('
name|'session'
op|','
name|'vm_ref'
op|')'
op|':'
newline|'\n'
indent|' '
name|'devices'
op|'='
op|'['
op|']'
newline|'\n'
name|'hardware_devices'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
nl|'\n'
string|'"get_object_property"'
op|','
nl|'\n'
name|'vm_ref'
op|','
nl|'\n'
string|'"config.hardware.device"'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'device'
op|'.'
name|'backing'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
nl|'\n'
string|'"VirtualDiskFlatVer2BackingInfo"'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
string|"'ephemeral'"
name|'in'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'fileName'
op|':'
newline|'\n'
indent|' '
name|'devices'
op|'.'
name|'append'
op|'('
name|'device'
op|')'
newline|'\n'
dedent|''
dedent|''
dedent|''
dedent|''
name|'return'
name|'devices'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|get_swap
dedent|''
name|'def'
name|'get_swap'
op|'('
name|'session'
op|','
name|'vm_ref'
op|')'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|'"get_object_property"'
op|','
nl|'\n'
name|'vm_ref'
op|','
string|'"config.hardware.device"'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'hardware_devices'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"ArrayOfVirtualDevice"'
op|':'
newline|'\n'
indent|' '
name|'hardware_devices'
op|'='
name|'hardware_devices'
op|'.'
name|'VirtualDevice'
newline|'\n'
nl|'\n'
dedent|''
name|'for'
name|'device'
name|'in'
name|'hardware_devices'
op|':'
newline|'\n'
indent|' '
name|'if'
op|'('
name|'device'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
string|'"VirtualDisk"'
name|'and'
nl|'\n'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'__class__'
op|'.'
name|'__name__'
op|'=='
nl|'\n'
string|'"VirtualDiskFlatVer2BackingInfo"'
name|'and'
nl|'\n'
string|"'swap'"
name|'in'
name|'device'
op|'.'
name|'backing'
op|'.'
name|'fileName'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'device'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_folder
dedent|''
dedent|''
dedent|''
name|'def'
name|'_get_folder'
op|'('
name|'session'
op|','
name|'parent_folder_ref'
op|','
name|'name'
op|')'
op|':'
newline|'\n'
comment|'# Get list of child entities for the parent folder'
nl|'\n'
indent|' '
name|'prop_val'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'vutil'
op|','
string|"'get_object_property'"
op|','
nl|'\n'
name|'parent_folder_ref'
op|','
nl|'\n'
string|"'childEntity'"
op|')'
newline|'\n'
name|'if'
name|'prop_val'
op|':'
newline|'\n'
indent|' '
name|'child_entities'
op|'='
name|'prop_val'
op|'.'
name|'ManagedObjectReference'
newline|'\n'
nl|'\n'
comment|'# Return if the child folder with input name is already present'
nl|'\n'
name|'for'
name|'child_entity'
name|'in'
name|'child_entities'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'child_entity'
op|'.'
name|'_type'
op|'!='
string|"'Folder'"
op|':'
newline|'\n'
indent|' '
name|'continue'
newline|'\n'
dedent|''
name|'child_entity_name'
op|'='
name|'vim_util'
op|'.'
name|'get_entity_name'
op|'('
name|'session'
op|','
name|'child_entity'
op|')'
newline|'\n'
name|'if'
name|'child_entity_name'
op|'=='
name|'name'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'child_entity'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|create_folder
dedent|''
dedent|''
dedent|''
dedent|''
name|'def'
name|'create_folder'
op|'('
name|'session'
op|','
name|'parent_folder_ref'
op|','
name|'name'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Creates a folder in vCenter\n\n A folder of \'name\' will be created under the parent folder.\n The moref of the folder is returned.\n """'
newline|'\n'
nl|'\n'
name|'folder'
op|'='
name|'_get_folder'
op|'('
name|'session'
op|','
name|'parent_folder_ref'
op|','
name|'name'
op|')'
newline|'\n'
name|'if'
name|'folder'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'folder'
newline|'\n'
dedent|''
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Creating folder: %(name)s. Parent ref: %(parent)s."'
op|','
nl|'\n'
op|'{'
string|"'name'"
op|':'
name|'name'
op|','
string|"'parent'"
op|':'
name|'parent_folder_ref'
op|'.'
name|'value'
op|'}'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'folder'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'session'
op|'.'
name|'vim'
op|','
string|'"CreateFolder"'
op|','
nl|'\n'
name|'parent_folder_ref'
op|','
name|'name'
op|'='
name|'name'
op|')'
newline|'\n'
name|'LOG'
op|'.'
name|'info'
op|'('
name|'_LI'
op|'('
string|'"Created folder: %(name)s in parent %(parent)s."'
op|')'
op|','
nl|'\n'
op|'{'
string|"'name'"
op|':'
name|'name'
op|','
string|"'parent'"
op|':'
name|'parent_folder_ref'
op|'.'
name|'value'
op|'}'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'vexc'
op|'.'
name|'DuplicateName'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"Folder already exists: %(name)s. Parent ref: %(parent)s."'
op|','
nl|'\n'
op|'{'
string|"'name'"
op|':'
name|'name'
op|','
string|"'parent'"
op|':'
name|'parent_folder_ref'
op|'.'
name|'value'
op|'}'
op|')'
newline|'\n'
name|'val'
op|'='
name|'e'
op|'.'
name|'details'
op|'['
string|"'object'"
op|']'
newline|'\n'
name|'folder'
op|'='
name|'vutil'
op|'.'
name|'get_moref'
op|'('
name|'val'
op|','
string|"'Folder'"
op|')'
newline|'\n'
dedent|''
name|'return'
name|'folder'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|folder_ref_cache_update
dedent|''
name|'def'
name|'folder_ref_cache_update'
op|'('
name|'path'
op|','
name|'folder_ref'
op|')'
op|':'
newline|'\n'
indent|' '
name|'_FOLDER_PATH_REF_MAPPING'
op|'['
name|'path'
op|']'
op|'='
name|'folder_ref'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|folder_ref_cache_get
dedent|''
name|'def'
name|'folder_ref_cache_get'
op|'('
name|'path'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'_FOLDER_PATH_REF_MAPPING'
op|'.'
name|'get'
op|'('
name|'path'
op|')'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|_get_vm_name
dedent|''
name|'def'
name|'_get_vm_name'
op|'('
name|'display_name'
op|','
name|'id'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'display_name'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'%s (%s)'"
op|'%'
op|'('
name|'display_name'
op|'['
op|':'
number|'41'
op|']'
op|','
name|'id'
op|'['
op|':'
number|'36'
op|']'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'id'
op|'['
op|':'
number|'36'
op|']'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|function|rename_vm
dedent|''
dedent|''
name|'def'
name|'rename_vm'
op|'('
name|'session'
op|','
name|'vm_ref'
op|','
name|'instance'
op|')'
op|':'
newline|'\n'
indent|' '
name|'vm_name'
op|'='
name|'_get_vm_name'
op|'('
name|'instance'
op|'.'
name|'display_name'
op|','
name|'instance'
op|'.'
name|'uuid'
op|')'
newline|'\n'
name|'rename_task'
op|'='
name|'session'
op|'.'
name|'_call_method'
op|'('
name|'session'
op|'.'
name|'vim'
op|','
string|'"Rename_Task"'
op|','
name|'vm_ref'
op|','
nl|'\n'
name|'newName'
op|'='
name|'vm_name'
op|')'
newline|'\n'
name|'session'
op|'.'
name|'_wait_for_task'
op|'('
name|'rename_task'
op|')'
newline|'\n'
dedent|''
endmarker|''
end_unit
| 14.005665 | 470 | 0.631994 | 18,508 | 126,093 | 4.167927 | 0.048087 | 0.129894 | 0.072984 | 0.05538 | 0.815673 | 0.756093 | 0.686116 | 0.615427 | 0.560747 | 0.503876 | 0 | 0.001833 | 0.104629 | 126,093 | 9,002 | 471 | 14.007221 | 0.681426 | 0 | 0 | 0.934681 | 0 | 0.001 | 0.662329 | 0.132371 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.000222 | 0.001888 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d641267f1da2f161fcc3ad9b70e4224131cfb7f9 | 17 | py | Python | reddit2telegram/channels/r_wholesomememes/__init__.py | mainyordle/reddit2telegram | 1163e15aed3b6ff0fba65b222d3d9798f644c386 | [
"MIT"
] | 187 | 2016-09-20T09:15:54.000Z | 2022-03-29T12:22:33.000Z | reddit2telegram/channels/r_wholesomememes/__init__.py | mainyordle/reddit2telegram | 1163e15aed3b6ff0fba65b222d3d9798f644c386 | [
"MIT"
] | 84 | 2016-09-22T14:25:07.000Z | 2022-03-19T01:26:17.000Z | reddit2telegram/channels/r_wholesomememes/__init__.py | mainyordle/reddit2telegram | 1163e15aed3b6ff0fba65b222d3d9798f644c386 | [
"MIT"
] | 172 | 2016-09-21T15:39:39.000Z | 2022-03-16T15:15:58.000Z | # Just empty file | 17 | 17 | 0.764706 | 3 | 17 | 4.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 17 | 1 | 17 | 17 | 0.928571 | 0.882353 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
d658802a5d1fbddcb60df662bb239b9e03f9b686 | 35 | py | Python | modules/2.79/bpy/types/TextureNodeTree.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/TextureNodeTree.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | modules/2.79/bpy/types/TextureNodeTree.py | cmbasnett/fake-bpy-module | acb8b0f102751a9563e5b5e5c7cd69a4e8aa2a55 | [
"MIT"
] | null | null | null | class TextureNodeTree:
pass
| 5.833333 | 22 | 0.685714 | 3 | 35 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 35 | 5 | 23 | 7 | 0.96 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 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 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 5 |
c399048bce7f8156df7d8bb7911313dfca4f5794 | 1,647 | py | Python | functions.py | oza75/Hangman-game-python | 6f7c48d02eaea38a4103c28b1f1479c36093ee0d | [
"MIT"
] | null | null | null | functions.py | oza75/Hangman-game-python | 6f7c48d02eaea38a4103c28b1f1479c36093ee0d | [
"MIT"
] | null | null | null | functions.py | oza75/Hangman-game-python | 6f7c48d02eaea38a4103c28b1f1479c36093ee0d | [
"MIT"
] | null | null | null | """
Cet module contiendra toutes les fonctions dont nous aurons besoin
"""
#------------------------------------------------------------
# @author Aboubacar Ouattara
# @copyright All rights reserved
#------------------------------------------------------------
from colored import fg,bg,attr
import os
#------------------------------------------------------------
# Cette fonction permet d'afficher un message avec couleur
#------------------------------------------------------------
def printMessage(message,color="white",background=0,reset=0):
if background != 0:
print("%s%s %s %s" %(fg(color), bg(background), message,attr(reset)))
else:
print("%s %s %s" %(fg(color), message,attr(reset)))
#------------------------------------------------------------
# Cette fonction permet de nettoyer le terminal
#------------------------------------------------------------
def clearTerminal():
os.system("cls" if os.name=="nt" else "clear")
#------------------------------------------------------------
# Cette fonction affiche le PENDU
#------------------------------------------------------------
def hanged():
printMessage("\n PENDU! ",196)
printMessage("\n ____________", 196);
printMessage(" | // |",196);
printMessage(" |// |",196);
printMessage(" |/ (_)",196);
printMessage(" | |",196);
printMessage(" | /|\\",196);
printMessage(" | |",196);
printMessage(" | / \\",196);
printMessage(" /|\\",196);
printMessage(" / | \\",196);
printMessage("#####################\n",196);
| 37.431818 | 77 | 0.394657 | 121 | 1,647 | 5.264463 | 0.487603 | 0.259027 | 0.254317 | 0.423862 | 0.266876 | 0.235479 | 0.235479 | 0.235479 | 0.235479 | 0.235479 | 0 | 0.028846 | 0.179114 | 1,647 | 43 | 78 | 38.302326 | 0.442308 | 0.452338 | 0 | 0.272727 | 0 | 0 | 0.249431 | 0.026196 | 0 | 0 | 0 | 0 | 0 | 1 | 0.136364 | false | 0 | 0.090909 | 0 | 0.227273 | 0.681818 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 5 |
c3b190e6e472ff9772d1f729e8b64aace10f62ba | 207 | py | Python | pysm/models/__init__.py | NicolettaK/pysm | a0eb491c221507f484f496179c2c56e8e89dfaa5 | [
"BSD-3-Clause"
] | null | null | null | pysm/models/__init__.py | NicolettaK/pysm | a0eb491c221507f484f496179c2c56e8e89dfaa5 | [
"BSD-3-Clause"
] | 1 | 2021-07-14T20:48:15.000Z | 2021-07-14T20:48:15.000Z | pysm/models/__init__.py | NicolettaK/pysm | a0eb491c221507f484f496179c2c56e8e89dfaa5 | [
"BSD-3-Clause"
] | 1 | 2021-07-15T11:38:38.000Z | 2021-07-15T11:38:38.000Z | from .dust import ModifiedBlackBody, DecorrelatedModifiedBlackBody
from .power_law import PowerLaw
from .template import Model, read_map, apply_smoothing, mpi_smoothing
from .spdust import SpDust, SpDustPol
| 41.4 | 69 | 0.855072 | 25 | 207 | 6.92 | 0.68 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101449 | 207 | 4 | 70 | 51.75 | 0.930108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
c3c06267bf04bebd535d820b0e991244e5b54a1a | 174 | py | Python | maestral/config/__init__.py | LyzardKing/maestral-dropbox | c1b030de85b69f8867b6a8a6564921f5e851aa1c | [
"MIT"
] | 1 | 2021-02-06T11:26:01.000Z | 2021-02-06T11:26:01.000Z | maestral/config/__init__.py | LyzardKing/maestral-dropbox | c1b030de85b69f8867b6a8a6564921f5e851aa1c | [
"MIT"
] | null | null | null | maestral/config/__init__.py | LyzardKing/maestral-dropbox | c1b030de85b69f8867b6a8a6564921f5e851aa1c | [
"MIT"
] | null | null | null | from .base import get_conf_path, list_configs
from .main import MaestralConfig, MaestralState
__all__ = ['get_conf_path', 'list_configs', 'MaestralConfig', 'MaestralState']
| 34.8 | 78 | 0.798851 | 21 | 174 | 6.142857 | 0.571429 | 0.108527 | 0.170543 | 0.232558 | 0.341085 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097701 | 174 | 4 | 79 | 43.5 | 0.821656 | 0 | 0 | 0 | 0 | 0 | 0.298851 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
4ee436498816a747403ea92be6538e09f8e449d1 | 200 | py | Python | tikzpy/tikz_environments/tikz_command.py | ltrujello/Tikz-Python | 2fddcbde5f94074cb9c492f0f721c99a7fc6c2a4 | [
"MIT"
] | 4 | 2021-04-19T09:00:02.000Z | 2022-03-20T09:39:04.000Z | tikzpy/tikz_environments/tikz_command.py | ltrujello/Tikz-Python | 2fddcbde5f94074cb9c492f0f721c99a7fc6c2a4 | [
"MIT"
] | null | null | null | tikzpy/tikz_environments/tikz_command.py | ltrujello/Tikz-Python | 2fddcbde5f94074cb9c492f0f721c99a7fc6c2a4 | [
"MIT"
] | null | null | null | class TikzCommand:
"""A class to handle manually typed Tikz code. """
def __init__(self, code: str) -> None:
self.code = code
def __repr__(self) -> str:
return self.code
| 22.222222 | 54 | 0.605 | 26 | 200 | 4.346154 | 0.615385 | 0.212389 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.28 | 200 | 8 | 55 | 25 | 0.784722 | 0.215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.2 | 0.8 | 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 | 1 | 0 | 0 | 0 | 5 |
f6166fa67b80444b97017b2b0d27d2da7e5d43e9 | 142 | py | Python | django_inventory/apps/photos/admin.py | alka653/inventory | b8fc944962666652189ff73ae53b1c2194553e02 | [
"Apache-2.0"
] | null | null | null | django_inventory/apps/photos/admin.py | alka653/inventory | b8fc944962666652189ff73ae53b1c2194553e02 | [
"Apache-2.0"
] | null | null | null | django_inventory/apps/photos/admin.py | alka653/inventory | b8fc944962666652189ff73ae53b1c2194553e02 | [
"Apache-2.0"
] | 1 | 2020-06-08T11:57:08.000Z | 2020-06-08T11:57:08.000Z | from __future__ import absolute_import
from django.contrib import admin
from .models import GenericPhoto
admin.site.register(GenericPhoto)
| 17.75 | 38 | 0.84507 | 18 | 142 | 6.388889 | 0.611111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112676 | 142 | 7 | 39 | 20.285714 | 0.912698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.75 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
f65d5e6d6e047c247d56ca6c8f223ae24d7cf2c2 | 2,740 | py | Python | MNIST/neural_test.py | necoleman/DataProjects | 54ed57ef1bcef3749969cbbdf5aa5b4b4675ab34 | [
"MIT"
] | null | null | null | MNIST/neural_test.py | necoleman/DataProjects | 54ed57ef1bcef3749969cbbdf5aa5b4b4675ab34 | [
"MIT"
] | null | null | null | MNIST/neural_test.py | necoleman/DataProjects | 54ed57ef1bcef3749969cbbdf5aa5b4b4675ab34 | [
"MIT"
] | null | null | null | import numpy as np
import neural_net
def initializeTraining():
zero = np.array([1.,1.,1.,1.,1.,
1.,0.,0.,0.,1.,
1.,0.,0.,0.,1.,
1.,0.,0.,0.,1.,
1.,1.,1.,1.,1.])
one = np.array([0.,0.,1.,0.,0.,
0.,0.,1.,0.,0.,
0.,0.,1.,0.,0.,
0.,0.,1.,0.,0.,
0.,0.,1.,0.,0.])
two = np.array([1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
1.,1.,1.,1.,1.,
1.,0.,0.,0.,0.,
1.,1.,1.,1.,1.])
three = np.array([1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
1.,1.,1.,1.,1.])
four = np.array([1.,0.,0.,0.,1.,
1.,0.,0.,0.,1.,
1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
0.,0.,0.,0.,1.])
five = np.array([1.,1.,1.,1.,1.,
1.,0.,0.,0.,0.,
1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
1.,1.,1.,1.,1.])
six = np.array([1.,1.,1.,1.,1.,
1.,0.,0.,0.,0.,
1.,1.,1.,1.,1.,
1.,0.,0.,0.,1.,
1.,1.,1.,1.,1.])
seven = np.array([1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
0.,0.,0.,0.,1.,
0.,0.,0.,0.,1.,
0.,0.,0.,0.,1.])
eight = np.array([1.,1.,1.,1.,1.,
1.,0.,0.,0.,1.,
1.,1.,1.,1.,1.,
1.,0.,0.,0.,1.,
1.,1.,1.,1.,1.])
nine = np.array([1.,1.,1.,1.,1.,
1.,0.,0.,0.,1.,
1.,1.,1.,1.,1.,
0.,0.,0.,0.,1.,
1.,1.,1.,1.,1.])
return [zero,one,two,three,four,five,six,seven,eight,nine]
def initializeTesting():
three = np.array([0.5,1.,1.,1.,0.7,
0.,0.,0.,0.5,1.,
0.,1.,1.,1.,1.,
0.,0.,0.,0.3,1.,
1.,1.,1.,1.,0.6])
return three
if __name__ == '__main__':
print "This is a test of the neural_net.py classes."
numlist = initializeTraining()
test = initializeTesting()
training_data = []
#print numlist
for k in range(len(numlist)):
train = numlist[k]
output = np.zeros(10)
output[k] = 1.
training_data.append( (train,output) )
N = neural_net.Network(3,25,10,0.1)
print N.predict( training_data[0][1] )
#N.train(training_data)
test_data = test
print test.shape
print test
print N.predict(test_data)
| 31.136364 | 62 | 0.320073 | 413 | 2,740 | 2.082324 | 0.138015 | 0.276744 | 0.317442 | 0.306977 | 0.373256 | 0.372093 | 0.365116 | 0.365116 | 0.355814 | 0.355814 | 0 | 0.186701 | 0.429197 | 2,740 | 87 | 63 | 31.494253 | 0.363171 | 0.012774 | 0 | 0.506494 | 0 | 0 | 0.019238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.025974 | null | null | 0.064935 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
9cab8be4076e7e1465fcae80cfe6390f959a38ac | 168 | py | Python | anime/admin.py | AniLite/API-v1.2 | 261625eb5918707f1a7ce74ae87b4db29fc002cc | [
"MIT"
] | 2 | 2021-09-29T17:37:58.000Z | 2021-09-29T18:10:14.000Z | anime/admin.py | AniLite/AniLite-API-v1.2 | 261625eb5918707f1a7ce74ae87b4db29fc002cc | [
"MIT"
] | null | null | null | anime/admin.py | AniLite/AniLite-API-v1.2 | 261625eb5918707f1a7ce74ae87b4db29fc002cc | [
"MIT"
] | null | null | null | from anime.models import Anime, Character, Genre
from django.contrib import admin
admin.site.register(Genre)
admin.site.register(Anime)
admin.site.register(Character)
| 24 | 48 | 0.821429 | 24 | 168 | 5.75 | 0.458333 | 0.195652 | 0.369565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 168 | 6 | 49 | 28 | 0.896104 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 5 |
141f3bea2facfc4ee8b6312c1df5bcb0f48d271d | 113 | py | Python | tests/parser/choice.19.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/choice.19.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/choice.19.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
x | a | b | y.
:- not a.
:- not b.
"""
output = """
x | a | b | y.
:- not a.
:- not b.
"""
| 8.692308 | 15 | 0.309735 | 18 | 113 | 1.944444 | 0.388889 | 0.114286 | 0.171429 | 0.228571 | 0.685714 | 0.685714 | 0.685714 | 0.685714 | 0 | 0 | 0 | 0 | 0.389381 | 113 | 12 | 16 | 9.416667 | 0.507246 | 0 | 0 | 0.8 | 0 | 0 | 0.704762 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
143db5c4f92a6788364e35173f2a5c926a797bad | 183 | py | Python | widgets/__init__.py | WilfriedMercier/Sphere | 69f2df96cbd6d887c029ff54a81e2db8b014450f | [
"MIT"
] | 2 | 2020-10-18T19:57:38.000Z | 2020-10-19T16:16:40.000Z | widgets/__init__.py | WilfriedMercier/Sphere | 69f2df96cbd6d887c029ff54a81e2db8b014450f | [
"MIT"
] | 1 | 2020-10-19T12:06:46.000Z | 2020-10-19T12:17:42.000Z | widgets/__init__.py | WilfriedMercier/Sphere | 69f2df96cbd6d887c029ff54a81e2db8b014450f | [
"MIT"
] | 1 | 2020-10-18T21:41:54.000Z | 2020-10-18T21:41:54.000Z | from .tab import Tab
from .plotWindow import PlotWindow
from .configWindow import ConfigWindow
from .validate import Validate
from .entry import Entry
| 30.5 | 40 | 0.688525 | 20 | 183 | 6.3 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.284153 | 183 | 5 | 41 | 36.6 | 0.961832 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 5 |
14411653000976cb8910a0330678028107147db8 | 701 | py | Python | tests/decisions/k13_test.py | benoitc/pywebmachine | ee32a61e0dbcd89bc04391554968bd0b43f4c1cd | [
"MIT"
] | 5 | 2015-03-29T03:20:10.000Z | 2020-01-21T11:07:47.000Z | tests/decisions/k13_test.py | benoitc/pywebmachine | ee32a61e0dbcd89bc04391554968bd0b43f4c1cd | [
"MIT"
] | null | null | null | tests/decisions/k13_test.py | benoitc/pywebmachine | ee32a61e0dbcd89bc04391554968bd0b43f4c1cd | [
"MIT"
] | 1 | 2015-07-18T03:26:39.000Z | 2015-07-18T03:26:39.000Z | import t
class k13(t.Test):
class TestResource(t.Resource):
def generate_etag(self, req, rsp):
return 'foo'
def resource_exists(self, req, rsp):
return True
def to_html(self, req, rsp):
return 'bar'
def test_etag_match(self):
self.req.headers['if-none-match'] = 'foo'
self.go()
t.eq(self.rsp.status, '304 Not Modified')
t.eq(self.rsp.etag, 'foo')
t.eq(self.rsp.body, '')
def test_modified(self):
self.req.headers['if-none-match'] = 'bar'
self.go()
t.eq(self.rsp.status, '200 OK')
t.eq(self.rsp.etag, 'foo')
t.eq(self.rsp.body, 'bar')
| 24.172414 | 49 | 0.533524 | 99 | 701 | 3.717172 | 0.333333 | 0.048913 | 0.11413 | 0.163043 | 0.445652 | 0.445652 | 0.445652 | 0.168478 | 0.168478 | 0.168478 | 0 | 0.016563 | 0.310984 | 701 | 28 | 50 | 25.035714 | 0.745342 | 0 | 0 | 0.190476 | 1 | 0 | 0.098431 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.238095 | false | 0 | 0.047619 | 0.142857 | 0.52381 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 5 |
1488c9968924529c312b5b742c0383944a69dcd8 | 94 | py | Python | tests/test_noop.py | chartbeat/django-two-factor-auth | 5d52f6d221fc7a3353cd8cbaf4d057387f88e029 | [
"MIT"
] | null | null | null | tests/test_noop.py | chartbeat/django-two-factor-auth | 5d52f6d221fc7a3353cd8cbaf4d057387f88e029 | [
"MIT"
] | null | null | null | tests/test_noop.py | chartbeat/django-two-factor-auth | 5d52f6d221fc7a3353cd8cbaf4d057387f88e029 | [
"MIT"
] | null | null | null | from django.test import TestCase
class TestNoop(TestCase):
def test(self):
pass
| 13.428571 | 32 | 0.680851 | 12 | 94 | 5.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.244681 | 94 | 6 | 33 | 15.666667 | 0.901408 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.