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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
753effef64eeb7cac63219c2fe98b6eeec746bb4 | 503 | py | Python | test/model/bannersexo.py | robertons/dbmodel | 628c4d6a2d0b23d9137015e5b0ea4551b20943bd | [
"MIT"
] | null | null | null | test/model/bannersexo.py | robertons/dbmodel | 628c4d6a2d0b23d9137015e5b0ea4551b20943bd | [
"MIT"
] | null | null | null | test/model/bannersexo.py | robertons/dbmodel | 628c4d6a2d0b23d9137015e5b0ea4551b20943bd | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
from dbmodel.entity import *
class BannerSexo(Entity):
__primary_key__ = ['id_banner', 'id_sexo']
# FIELDS
@Int(pk=True, not_null=True, precision = 10, scale=0)
def id_banner(self): pass
@Int(pk=True, not_null=True, precision = 10, scale=0)
def id_sexo(self): pass
# One-to-One
@Object(name="Banner", key="id", reference="id_banner", table="banners")
def banners(self):pass
@Object(name="Sexo", key="id", reference="id_sexo", table="sexos")
def sexos(self):pass | 22.863636 | 73 | 0.681909 | 78 | 503 | 4.230769 | 0.448718 | 0.09697 | 0.054545 | 0.072727 | 0.254545 | 0.254545 | 0.254545 | 0.254545 | 0.254545 | 0.254545 | 0 | 0.016018 | 0.131213 | 503 | 22 | 74 | 22.863636 | 0.73913 | 0.077535 | 0 | 0.181818 | 0 | 0 | 0.125541 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.363636 | false | 0.363636 | 0.090909 | 0 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
754a0fba2839c7c70a1d42743be26df1387ab735 | 22 | py | Python | BeeBot/config.py | yamozha/discord-bots | 3584e49c058575b575d50896cb1c7f6737ad1d69 | [
"MIT"
] | null | null | null | BeeBot/config.py | yamozha/discord-bots | 3584e49c058575b575d50896cb1c7f6737ad1d69 | [
"MIT"
] | null | null | null | BeeBot/config.py | yamozha/discord-bots | 3584e49c058575b575d50896cb1c7f6737ad1d69 | [
"MIT"
] | null | null | null | TOKEN = "enter-token"
| 11 | 21 | 0.681818 | 3 | 22 | 5 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 22 | 1 | 22 | 22 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
754c56d7a576f7b6a6da874ca2b6574d00d51a05 | 310 | py | Python | data_modeling/settings.py | jbj2505/dend_01_data_modelling | 58faf1ae5dacf4343a647c0233402be336d6a7c1 | [
"MIT"
] | null | null | null | data_modeling/settings.py | jbj2505/dend_01_data_modelling | 58faf1ae5dacf4343a647c0233402be336d6a7c1 | [
"MIT"
] | null | null | null | data_modeling/settings.py | jbj2505/dend_01_data_modelling | 58faf1ae5dacf4343a647c0233402be336d6a7c1 | [
"MIT"
] | null | null | null | """
This module provides access to the dotenv settings.
"""
import os
from os.path import join, dirname
from dotenv import load_dotenv
DOTENV_PATH = join(dirname(__file__), '.env')
load_dotenv(DOTENV_PATH)
DB_USER_NAME = os.environ.get("DB_USER_NAME")
DB_USER_PASSWORD = os.environ.get("DB_USER_PASSWORD")
| 20.666667 | 53 | 0.774194 | 49 | 310 | 4.571429 | 0.469388 | 0.107143 | 0.142857 | 0.178571 | 0.160714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116129 | 310 | 14 | 54 | 22.142857 | 0.817518 | 0.164516 | 0 | 0 | 0 | 0 | 0.12749 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.428571 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
756048782c31c9f08def9ae21613e2b4b7271fb7 | 1,296 | py | Python | pymikuvr/tests/test_color.py | beep39/pymikuvr | 03fc7d77babc0ab0f6444534ca7df522b3ac1de2 | [
"MIT"
] | 1 | 2021-11-16T16:18:31.000Z | 2021-11-16T16:18:31.000Z | pymikuvr/tests/test_color.py | beep39/pymikuvr | 03fc7d77babc0ab0f6444534ca7df522b3ac1de2 | [
"MIT"
] | null | null | null | pymikuvr/tests/test_color.py | beep39/pymikuvr | 03fc7d77babc0ab0f6444534ca7df522b3ac1de2 | [
"MIT"
] | null | null | null | import unittest
from api.color import color, color_o
class test_color(unittest.TestCase):
def assertAlmostEqual(self, a, b):
if isinstance(a, color):
unittest.TestCase.assertAlmostEqual(self, a.r, b.r)
unittest.TestCase.assertAlmostEqual(self, a.g, b.g)
unittest.TestCase.assertAlmostEqual(self, a.b, b.b)
unittest.TestCase.assertAlmostEqual(self, a.a, b.a)
else:
unittest.TestCase.assertAlmostEqual(self, a, b)
def test_eq(self):
a = color(1,2,3,4)
b = color(1,2,3,4)
c = color()
self.assertTrue(a==b)
self.assertFalse(b==c)
def test_arifmetic(self):
a = color(0.1,0.2,0.3,0.4)
a2 = color(a.r * 2, a.g * 2, a.b * 2, a.a * 2)
b = color(0.5,0.6,0.7,0.8)
zero = color(0,0,0,0)
self.assertAlmostEqual(a + b - a, b)
#self.assertAlmostEqual(a * b / a, b)
#self.assertAlmostEqual(a / 1, a)
#self.assertAlmostEqual(a / 2, color(a.r / 2, a.g / 2, a.b / 2, a.a / 2))
self.assertAlmostEqual(a * 1, a)
self.assertAlmostEqual(a * 0, zero)
self.assertAlmostEqual(a * 2, a2)
self.assertAlmostEqual(0 * a, zero)
self.assertEqual(1 * a, a)
self.assertEqual(2 * a, a2)
| 35.027027 | 81 | 0.566358 | 196 | 1,296 | 3.72449 | 0.183673 | 0.030137 | 0.210959 | 0.253425 | 0.528767 | 0.347945 | 0.241096 | 0.241096 | 0.145205 | 0.046575 | 0 | 0.050701 | 0.284722 | 1,296 | 36 | 82 | 36 | 0.736785 | 0.108025 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.517241 | 1 | 0.103448 | false | 0 | 0.068966 | 0 | 0.206897 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f32afa69d36409d22a4c5dcdfe84bf40b49ff1a1 | 132 | py | Python | scoring/urls.py | AltusN/rhythmeet | e42f264b6d1563b4821acfe6ada1fbc93dd895ac | [
"MIT"
] | null | null | null | scoring/urls.py | AltusN/rhythmeet | e42f264b6d1563b4821acfe6ada1fbc93dd895ac | [
"MIT"
] | null | null | null | scoring/urls.py | AltusN/rhythmeet | e42f264b6d1563b4821acfe6ada1fbc93dd895ac | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('gymnast/', views.view_all_gymnasts, name='Gymnasts'),
] | 18.857143 | 63 | 0.719697 | 17 | 132 | 5.470588 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151515 | 132 | 7 | 64 | 18.857143 | 0.830357 | 0 | 0 | 0 | 0 | 0 | 0.120301 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f349887cdf2b662ed396310585bbdd7afac220d6 | 5,861 | py | Python | akat_rust_pp_py/objects/calculator.py | RealistikDash/akat-rust-pp-py | d2aa82ea842497b0b78ed684e88dbd7108c6f570 | [
"MIT"
] | null | null | null | akat_rust_pp_py/objects/calculator.py | RealistikDash/akat-rust-pp-py | d2aa82ea842497b0b78ed684e88dbd7108c6f570 | [
"MIT"
] | null | null | null | akat_rust_pp_py/objects/calculator.py | RealistikDash/akat-rust-pp-py | d2aa82ea842497b0b78ed684e88dbd7108c6f570 | [
"MIT"
] | null | null | null | from .pp_result import CalcResult
from .beatmap import Beatmap
from ..utils import _mutable_property_generator
from ..types import NativeCalculator
from .._peace_performance import pp as _pp_rust
from typing import Any, Dict, Optional, Union
@_mutable_property_generator
class Calculator:
'''
Calculator for storing pp calculation configurations (mode, mods, combo, 300, miss, acc, etc.)
`mode`: `Optional[int]` # gamemode convert
`mods`: `Optional[int]`
`n50`: `Optional[int]` # Irrelevant for osu!mania
`n100`: `Optional[int]` # Irrelevant for osu!mania and osu!taiko
`n300`: `Optional[int]` # Irrelevant for osu!mania
`katu`: `Optional[int]` # Only relevant for osu!ctb
`acc`: `Optional[float]` # Irrelevant for osu!mania
`passed_obj`: `Optional[int]`
`combo`: `Optional[int]` # Irrelevant for osu!mania
`miss`: `Optional[int]` # Irrelevant for osu!mania
`score`: `Optional[int]` # Only relevant for osu!mania
### Examples:
```
beatmap = Beatmap('path_to_osu_file')
c = Calculator()
c.set_acc(98.8)
c.set_combo(727)
# or
c = Calculator({'acc': 98.8, 'combo': 727})
# then
result = c.calculate(beatmap)
```
'''
_raw_attrs = ('mode', 'mods', 'n50', 'n100', 'n300',
'katu', 'acc', 'passed_obj', 'combo', 'miss', 'score',)
_extra_attrs = ('_raw',)
__slots__ = _raw_attrs + _extra_attrs
_raw: NativeCalculator
mode: Optional[int]
mods: Optional[int]
n50: Optional[int] # Irrelevant for osu!mania
n100: Optional[int] # Irrelevant for osu!mania and osu!taiko
n300: Optional[int] # Irrelevant for osu!mania
katu: Optional[int] # Only relevant for osu!ctb
acc: Optional[float] # Irrelevant for osu!mania
passed_obj: Optional[int]
combo: Optional[int] # Irrelevant for osu!mania
miss: Optional[int] # Irrelevant for osu!mania
score: Optional[int] # Only relevant for osu!mania
def __init__(self, data: Optional[Dict[str, Union[int, float, None]]] = None, **kwargs) -> 'Calculator':
'''Create new Calculator'''
self._raw = _pp_rust.Calculator()
set = data or kwargs
if set:
self.set_with_dict(set)
def __repr__(self) -> str:
return f'<Calculator object ({self.attrs})>'
def getattr(self, attr) -> Any:
'''Set attr from _raw'''
return getattr(self._raw, attr)
def setattr(self, attr, value) -> None:
'''Get attr to _raw'''
return setattr(self._raw, attr, value)
@property
def attrs(self) -> str:
'''Get attrs as text'''
return self._raw.as_string
@property
def attrs_dict(self) -> Dict[str, Union[int, float, None]]:
'''Get attrs as dict'''
return self._raw.as_dict
def reset(self) -> None:
'''Set Calculator to the default state'''
self._raw.reset()
def set_with_dict(self, data: Dict[str, Any]) -> None:
'''
Set data with a dict.
### Examples:
```
data = {
'mode': 0,
'n50': 66,
'n100': 666
}
c = Calculator()
c.set_with_dict(data)
# or
c = Calculator(data)
```
'''
for attr, value in data.items():
self.setattr(attr, value)
def calculate(self, beatmap: 'Beatmap') -> 'CalcResult':
'''
Calculate pp with a Beatmap.
### Examples:
```
beatmap = Beatmap('path_to_osu_file')
c = Calculator()
c.set_acc(98.8)
c.set_combo(727)
# or
c = Calculator({'acc': 98.8, 'combo': 727})
# then
result = c.calculate(beatmap)
```
'''
return CalcResult(self._raw.calculate(beatmap._raw))
# Interfaces -----
def set_mode(val: Optional[int]) -> None: ...
def set_mods(val: Optional[int]) -> None: ...
def set_n50(val: Optional[int]) -> None:
'''### Irrelevant for osu!mania'''
...
def set_n100(val: Optional[int]) -> None:
'''### Irrelevant for osu!mania and osu!taiko'''
...
def set_n300(val: Optional[int]) -> None:
'''### Irrelevant for osu!mania'''
...
def set_katu(val: Optional[int]) -> None:
'''### Only relevant for osu!ctb'''
...
def set_acc(val: Optional[float]) -> None:
'''### Irrelevant for osu!mania'''
...
def set_passed_obj(val: Optional[int]) -> None: ...
def set_combo(val: Optional[int]) -> None:
'''### Irrelevant for osu!mania'''
...
def set_miss(val: Optional[int]) -> None:
'''### Irrelevant for osu!mania'''
...
def set_score(val: Optional[int]) -> None:
'''### Only relevant for osu!mania'''
...
def del_mode() -> None: ...
def del_mods() -> None: ...
def del_n50() -> None: ...
def del_n100() -> None: ...
def del_n300() -> None: ...
def del_katu() -> None: ...
def del_acc() -> None: ...
def del_passed_obj() -> None: ...
def del_combo() -> None: ...
def del_miss() -> None: ...
def del_score() -> None: ...
def get_mode(val: Optional[int]) -> Optional[int]: ...
def get_mods(val: Optional[int]) -> Optional[int]: ...
def get_n50(val: Optional[int]) -> Optional[int]: ...
def get_n100(val: Optional[int]) -> Optional[int]: ...
def get_n300(val: Optional[int]) -> Optional[int]: ...
def get_katu(val: Optional[int]) -> Optional[int]: ...
def get_acc(val: Optional[float]) -> Optional[float]: ...
def get_passed_obj(val: Optional[int]) -> Optional[int]: ...
def get_combo(val: Optional[int]) -> Optional[int]: ...
def get_miss(val: Optional[int]) -> Optional[int]: ...
def get_score(val: Optional[int]) -> Optional[int]: ...
| 29.305 | 108 | 0.569016 | 714 | 5,861 | 4.526611 | 0.145658 | 0.170173 | 0.071473 | 0.116955 | 0.528775 | 0.514542 | 0.47401 | 0.374691 | 0.340347 | 0.340347 | 0 | 0.019995 | 0.266166 | 5,861 | 199 | 109 | 29.452261 | 0.731458 | 0.313428 | 0 | 0.11236 | 0 | 0 | 0.031838 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.47191 | false | 0.05618 | 0.067416 | 0.011236 | 0.786517 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
f34dedc4df9e026b2801b11197edd28a6f30128f | 310 | py | Python | tests/components/kraken/conftest.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/kraken/conftest.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/kraken/conftest.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Provide common pytest fixtures for kraken tests."""
from unittest.mock import patch
import pytest
@pytest.fixture(autouse=True)
def mock_call_rate_limit_sleep():
"""Patch the call rate limit sleep time."""
with patch("homeassistant.components.kraken.CALL_RATE_LIMIT_SLEEP", new=0):
yield
| 25.833333 | 79 | 0.745161 | 43 | 310 | 5.209302 | 0.651163 | 0.107143 | 0.174107 | 0.241071 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003788 | 0.148387 | 310 | 11 | 80 | 28.181818 | 0.844697 | 0.277419 | 0 | 0 | 0 | 0 | 0.248826 | 0.248826 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | true | 0 | 0.333333 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f356006039e18089dbf912c1dd4e232db85deab3 | 3,195 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/invalidate_subdata.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/invalidate_subdata.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/GL/ARB/invalidate_subdata.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''OpenGL extension ARB.invalidate_subdata
This module customises the behaviour of the
OpenGL.raw.GL.ARB.invalidate_subdata to provide a more
Python-friendly API
Overview (from the spec)
This extension adds a mechanism for an application to tell the GL that
the previous contents of a subregion of an image or a range of a buffer
may be invalidated.
GL implementations often include several memory spaces, each with
distinct performance characteristics, and the implementations
transparently move allocations between memory spaces. With this
extension, an application can tell the GL that the contents of a texture
or buffer are no longer needed, and the implementation can avoid
transferring the data unnecessarily.
Examples of when this may be useful include:
(1) invalidating a multisample texture after resolving it into a non-
multisample texture.
(2) invalidating depth/stencil buffers after using them to generate a color
buffer.
(3) invalidating a subregion of a framebuffer rather than clearing it
before rendering to it, when the whole subregion will be overwritten.
(4) invalidating dynamically generated data (e.g. textures written by FBO
rendering or CopyTexSubImage, buffers written by transform feedback,
etc.) after it is no longer needed but before the end of the frame.
It is expected that the situations in which the GL will take advantage of
this knowledge and achieve increased performance as a result of its use
will be implementation-dependent. The first three examples may show
benefit on tiled renderers where some data won't need to be copied into
or out of on-chip memory. The fourth example may show a benefit in multi-
GPU systems where some data won't need to be copied between GPUs.
This extension is a superset of the EXT_discard_framebuffer extension
with the following additions:
- The parameters to InvalidateFramebufferEXT are extended for MRT support
and Desktop-GL-only buffer enums.
- New functions to invalidate a region of a texture image or buffer object
data store.
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/ARB/invalidate_subdata.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.ARB.invalidate_subdata import *
from OpenGL.raw.GL.ARB.invalidate_subdata import _EXTENSION_NAME
def glInitInvalidateSubdataARB():
'''Return boolean indicating whether this extension is available'''
from OpenGL import extensions
return extensions.hasGLExtension( _EXTENSION_NAME )
# INPUT glInvalidateFramebuffer.attachments size not checked against numAttachments
glInvalidateFramebuffer=wrapper.wrapper(glInvalidateFramebuffer).setInputArraySize(
'attachments', None
)
# INPUT glInvalidateSubFramebuffer.attachments size not checked against numAttachments
glInvalidateSubFramebuffer=wrapper.wrapper(glInvalidateSubFramebuffer).setInputArraySize(
'attachments', None
)
### END AUTOGENERATED SECTION | 42.6 | 90 | 0.777465 | 432 | 3,195 | 5.719907 | 0.476852 | 0.024282 | 0.040469 | 0.016997 | 0.121004 | 0.108053 | 0.058276 | 0.058276 | 0.025091 | 0 | 0 | 0.001534 | 0.183725 | 3,195 | 75 | 91 | 42.6 | 0.945936 | 0.872926 | 0 | 0.133333 | 0 | 0 | 0.035599 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.466667 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
f36667014ca5d62e7b0092421723e08aa0cddc63 | 585 | py | Python | versio9/special_class_methods.py | doubleO8/versionone-sdk-spoon | 7d6bded063a07e728e67d82e33ccd10d4f5d12eb | [
"BSD-3-Clause"
] | null | null | null | versio9/special_class_methods.py | doubleO8/versionone-sdk-spoon | 7d6bded063a07e728e67d82e33ccd10d4f5d12eb | [
"BSD-3-Clause"
] | null | null | null | versio9/special_class_methods.py | doubleO8/versionone-sdk-spoon | 7d6bded063a07e728e67d82e33ccd10d4f5d12eb | [
"BSD-3-Clause"
] | null | null | null | # objects here will be mixed into the dynamically created asset type classes
# based on name.
# This lets us extend certain asset types without having to give up the generic
# dynamic meta implementation
class Attachment(object):
def set_blob(self, blob):
return self._v1_v1meta.set_attachment_blob(self, blob)
def get_blob(self):
return self._v1_v1meta.get_attachment_blob(self)
file_data = property(get_blob, set_blob)
# the special_classes mapping will be used to lookup mixins by asset type name.
special_classes = locals()
| 29.25 | 81 | 0.728205 | 85 | 585 | 4.835294 | 0.6 | 0.077859 | 0.058394 | 0.087591 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008715 | 0.215385 | 585 | 19 | 82 | 30.789474 | 0.88671 | 0.470085 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0.285714 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
f3815d6d875aa8fc971d3ca3c2ab7194504701a2 | 182 | py | Python | ast_demo.py | domdfcoding/flake8-rst-docstrings | 5a8badf13c6696e23150c57e1cd4fe7f2edba355 | [
"MIT"
] | null | null | null | ast_demo.py | domdfcoding/flake8-rst-docstrings | 5a8badf13c6696e23150c57e1cd4fe7f2edba355 | [
"MIT"
] | null | null | null | ast_demo.py | domdfcoding/flake8-rst-docstrings | 5a8badf13c6696e23150c57e1cd4fe7f2edba355 | [
"MIT"
] | null | null | null | import ast
import pathlib
import pprint
from flake8_rst_docstrings import Plugin
s = pathlib.Path("tests/test_ast.py").read_text()
pprint.pprint(list(Plugin(ast.parse(s)).run()))
| 18.2 | 49 | 0.774725 | 29 | 182 | 4.724138 | 0.655172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006061 | 0.093407 | 182 | 9 | 50 | 20.222222 | 0.824242 | 0 | 0 | 0 | 0 | 0 | 0.093407 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f3a8b41727b32797475d1582dc07190059215e17 | 10,936 | py | Python | mapclientplugins/fieldworkmeshfittingstep/resources_rc.py | tsalemink/fieldworkmeshfittingstep | 49ae1a7506bf68c9a692b30e5dd8d3c9e8bc33a0 | [
"Apache-2.0"
] | null | null | null | mapclientplugins/fieldworkmeshfittingstep/resources_rc.py | tsalemink/fieldworkmeshfittingstep | 49ae1a7506bf68c9a692b30e5dd8d3c9e8bc33a0 | [
"Apache-2.0"
] | null | null | null | mapclientplugins/fieldworkmeshfittingstep/resources_rc.py | tsalemink/fieldworkmeshfittingstep | 49ae1a7506bf68c9a692b30e5dd8d3c9e8bc33a0 | [
"Apache-2.0"
] | 1 | 2021-06-07T21:54:08.000Z | 2021-06-07T21:54:08.000Z | # Resource object code (Python 3)
# Created by: object code
# Created by: The Resource Compiler for Qt version 5.15.2
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore
qt_resource_data = b"\
\x00\x00\x0c\x0d\
\x89\
PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\
\x00\x00@\x00\x00\x00@\x08\x06\x00\x00\x00\xaaiq\xde\
\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\
\x00\x00\x00\x09pHYs\x00\x00\x0d\xd7\x00\x00\x0d\xd7\
\x01B(\x9bx\x00\x00\x00\x19tEXtSof\
tware\x00www.inksca\
pe.org\x9b\xee<\x1a\x00\x00\x0b\x8aID\
ATx\x9c\xed\x9a]l\x5c\xd7q\xc7\x7fs\x97\x22\
\xed\xa0\x857\x89\x02K\x90j\xad\xe2HVR+]\
\x06\x90lZ\x96\xb5\xd7\xb2\x02\xa7\x86%n\x83<8\
\x05\xe2%\x92\xa7\x14\x85M\xe4\xa5/\x85H\xf4\xa5@\
\x81Jzh\xd1\xa7\x92n\xda:uQ\x93\x8eb\x1b\
\xb1\xea\xdc\xa5>-)\x01\xd7\x8db\xa9v\x1a\xdd \
\x89\xad$n\xbb\x86\xdb\xe8\x83{\xe7\xdf\x87{\x97\xa4\
h~-\xb9,\x01C\x7f\xe0`\xef\xce=3gf\
\xce9s\xe6\x9csM\x12\x1fF\x98Y'\xf01\xe0\
}I\xff;W\xbd`\x01!}f\xf6\xda\x8c\xf2'\
fvW\xf6\xfc\xa7Y\xbd.3;ef\xc7\xa6\xf1\
\x1e2\xb33f\xf6\xdb3dn\xccx\xfffy&\
.\x88\x87\x80w\x80\xa7\xe7\xab4\xaf\x03\x80\x8d\xc0}\
\xd9\xf3\xa5\xac\x5c\x01~\x0e\xdc\x03\xfca\xf6n\x07\xf0\
\x00\xf0\x88\x99m53\x03\xbe\x02\xac\x95\xf4\xfe\x0c\x99\
\xb7e2\x7fw\xaeF\xcd\xec\xb7\xcclV\xdd\xb2w\
\xb7\xcfB\xfb\xc8\x02\xb6\xcc\x8a\x85\x1c\xd0\xc4\xdfI\xaa\
deX\x92\x03\xa7\x81{\xcc\xecN`7\xf0o\xc0\
\x7f\x02\x0f\x92\x1a\xf71\xe0D+\xca\x98\xd9\xc3f\xf6\
\xef\xc0\xfb\xc0o\xcc\xeco\xcd\xac+{W6\xb3\xcb\
\xd9\xbb\xff1\xb3\xaff\xf4&\xed=3;nf\x8f\
\xb5\xd2\xe6b\x1d\xf0Wf\xa6\xac|=\xa35\x8d\xdb\
\x9d\x95\xe3\xc0\xc9\xecyO\xf6\xee\xe4b\x15\xc9z\xf0\
9R\xc7\xed\x07\xbe\x09\xf4\x01\xdf0\xb3\xbb\x80g\x81\
\xdb\x81/\x03{IG#\xc07\x80M\xc0v`=\
0\xb0\xd86\x01:\x16Y\xef[\xc0X\xf6\xdc4\xbc\
i\x5cH:\xfc\x87\x81\x0d\xc0\x1f\x01\x1f\x99Qg1\
\xb8\x07\xf88\xf0-IG\xcd\xec\x0d\xe0k\x99\xec\x8b\
@\x17\xf0\x8f\x92\x9e\x9d\xc1W\x02\xfe\x0c\xd8F\xd6\xa1\
f\xf6\xf1\xc56\xbaX\x07\x9c\x9043h\x9d\x07\xae\
\x93\xc6\x81;H\x8d]\x0f\xfc%\xb0\x16\xf8\x95\xa47\
\x17\xab\x08P\xcf~7\xcc\xf8\xadO{\xf7\xc9f\xe5\
,F<\x04\xfc1\xf0\x17\xc0\xfd\xc0\xab\xa4\xf1\xa8s\
\xb1\x8d.\xd6\x01\x1f\x80\xa4\xebfv\x9et\xce\xffD\
\xd2\xdbf\xf6K\xd2\xf9x\x07\xf0\xfc\x02\x22\xee3\xb3\
+\xd3\xfe\x7f\x128\x0a<nfU\xd28\xd2\x00\xfe\
\x1a8\x97\x95\x03fv\x16x\x9b\xd4\xd8j\xc6\xfb(\
p7\xe9(j\x09\x0b9`\x0c\x18$\xed\xed\xd9\xf0\
\xe7\xa4\x1e\xbf\x08 )1\xb3~\xe0w\x80h\x0e\x9e\
\xff\xcad\xce\xc4\x04\xf0\x07\xa4\xab\xc7}\xa4A\xf6\xef\
%\xbd\x01`f{\x80\x0a\xf09\xe0*0&\xe9B\
\x16\xf4\x1e#\x8dA\xcf\x01\x9f&\xed\x84\x9fd\xed\x1c\
\x9f\xcf@\xfb\xb0&B\x8b\xc5bW\x81\x0f-n9\
`\xb5\x15Xm,y\x15\x98\x0d\xf5\xaf\xf4T\x08\x82\
!A\x1dT\x03\x90l,\x90\xc7\xe4\xa8\xe6\x87\xce\xc4\
\xedl\xaf\x1dhK\x10\xac?\xd1S\xf0\x9c\x0ebV\
\x99\x14\x0cU\x99j&+\x0a\x15\xc1\xf2&U\x13\xb3\
\xc1\xb5\xdf<S]v\xa3m\xc2\xb2\x1d\xf0\xeb'v\
VL\x1c\x0a\xb0\xd8s\xbc`\xceA\x00\x0f\xd4\xfd\x89\
\x7f8Wk\xd6{\xf7\x89\x9e\x92\xa1'A\x15\xc9G\
;\xae7\xfa\xf2#\xe3\xf5\xb9%\xff\xff`Y\x0e\xf8\
\xd5\x97v\x0c\x98q\xd0\x8c\xc1\xb5\xfft~\x00\xe0\xdd\
/\xed(\xc9\x88\x92\x5cc\xf3\xbag\xc7\xe3\x99<\xef\
>\xb1\xa3\xa4DC\xe9\xbf\xa0\xfc\x89\xe7\xa6\x9c\xb4\x1a\
Xr\x10\xfc\xf5\x17wV\x10\x07I\xac\xafi<\xc0\
\xda\x7f>_\x95S\xb7\x1b\x1d\xbd\xb3\xf1\xad}\xf6|\
u\xcdD\xd2-\xb7\xba\x5cQ\xbd\xdc\x9d_\xaa\x0e\xed\
\xc0\x92F\xc0\x95rO\xc1\x82d\x1c4|\xe7\xbf\x9c\
\xef\x9f\xf9\xfe\x97_\xdc1\x82,/)\xcb\xf8:\xe2\
u#g\xe2\xe9u\xea\xe5\xee\xfc\xf5 7\x8e\x82\xf8\
\xce\xe7\xcf\x85K\xd2\xbe\x0dX\xa2\x03\xee\x1f\xc2\xbc\xb4\
\xee\xf9s\x9b\xa7\xd3\xe3rw\xfev\xd6\x1c\x94\xd9\x07\
Oa\xa4*\xe4\x06\xd7\x8dL\x05\xc0+\xe5\x1d%,\
\x88$\xca\xebG\xce\x8e\xb6\xae\xfe\xf2\xd1\xf2\x14\xb8R\
\xee)\x08U\xd0\xcd\xf9|\x5c\xee\xcew\xa93r\xec\
i\x09>P\xb0\x92\xf0\xe8\x9d\x03;\x0f5y\xd6\x8d\
\x9c\xaf\xbal\x18\xe9\xa9v\x18\xb3\x14\xb4\xec\x00%\xea\
\x95[}\xdd\xc8\xb9\xe1\xe9\xf4\xae\xa4kD\xb2\xa2\xdc\
p\xb7\xc3\xd7\xb9\xf1\xd1\xf5#gm\xfd\xc8Ys\x82\
>\xb9\xc5rC\x04O\xbf}\xa0g\xa0\xc9\xe7\xd83\
RP\xbaR\xee),\xdb\x9a%\xa0\xe5)\xf0\xf3\xfd\
\xf7\x8f\x18V\xdf\xf0\xed3}M\xda;\xfb\x1f\xe8u\
4\x92\x89\xec\xdf\xf0\xed\xd3\x87g\xf2\xc5\xe50\xdf\x91\
\x5c\x1d2\xac\x17 \x97c\xf3\xba\x913\xf1/\xf6\xf7\
\x0c\x01\x15L5W0\x18\xe0{\xc0\x8aBu#\x18\
\x93\xd2\x84j\xe3\xd1\x95\xc9\x1dZ\x1e\x01\xe6A\x11\xb7\
\xd7\xa7\xd3\x12\xf1\xa4dHV\x9d\xcdx\x80\xc2HT\
o\xe4n\xef\x93\xac.\x19\x13\x89=\x05 YE2\
\xe4A1p\x0e\xe1\xc1O%\x06\x91\x1d\x918\x00\x16\
\x81E?\xdb\xff\xc0\xa1\xd9\xe4.\x17-9\xe0g\x8f\
\xed\xaa8VH\xb0\xdf\x9bN\x97\xac75B\xcf\xcc\
\xc7_\x18\x89\xea\x12\xc3i\xddt$\xc8\x19\x95\x0c\x17\
\xb5\x895]\xdd\x1b\xbes\xfa\xf0\xc6\xa3g\xaa\x1b\x8f\
\x9e\xa9:6\x969\x16\xb9\xf5\xc6\xe5\xb0\xedKfK\
\x0e\x106$\x19\xc8*\xf1\xe3\xbbK\x00\xf1\xe3\xbbK\
M%\x93\xce\xdb\x16\x8c\xe4\x89\xe5^\xc8d\x14\x00\x9c\
\xa0 1|\xd7wNw\x17F\xa2\x9b2C'\xa8\
\xa6\xb2\xa9\x99+\xb6\xeb\x13#\xad\xe8\xbb\x18\xb4\x14\x03\
~\xfa\xfb\x0f\x8e\x03\xc5\xb9\xdeoz\xe9\xa4-$#\
\xfe\xc2\xee\x92\x99\x22\x00\x99\xbaM6.Sw\xe1\xc5\
S5\x80\xf8\xb1]\xa9\xfc\xce\xce\x98\xab\x13\x97-\xa0\
\xb6\xe9\xa5\x93a\x5c\x0e\xf3v}b\x5c\xb2g\x0a/\
\x9f\x18X\xb4\xd2\x0b\xa0\xb5\x11\xd0\xb5&\x94[M\xb2\
\xc1M/\x9d\xb4M/\x9d4\x99\xba\x9b# \xfeB\
XX\xb8E\xafO\x0e\xeb$\x88$b~\xd3\x19\xc7\
\x8f>\xf8\xf4\xe5G\x1f\xbc\x8c\x07\xe3x0\xce\xb5\xc6\
\x7fc\xd4\xd5\xb5\xa6\x0c\xcd\xe9c}\x12O\xc5a\xfb\
\xa6BK\x0e(\x8cDu\x97U\xdd\x83\x03\x93\xb4\x17\
O\xd5\xd2\xb4\xd6p%\x07\x17\x94\xf1\xe2\xa9\x9a\xbb\x8d\
\xca\x0ddy\xf7\x5c\xdd;\x93\xcbRp\x08\x05\x05\xb9\
\xd1,\xeeA\x9ei\x93\xa2\xf0\xf2\x89*\x0ab\xef\xf4\
y\xaf\xbbZA\xcb\xab@\xa2\xdc3\x12\xc5\x1f\xef\x0b\
K\x934\xec\x88\xa7\x81\xaa\xf2\x1f\x9f\x7f\xa8\xb2`\xa3\
7r}\x92\xd5<\x9d\xdfE\xc9\xf2.\xc3\x15\x0c'\
\x81B\x87\xb2\xa7\xabE>\xe9hn\x9cR\xb8tD\
\xa2m\x89S\xcb\x0e\xd8\xf2JT\x93T\x05M.K\
\x1d7\x82\xc3\x12\xb5th\x07C?\xde\x17\x0e\xcc'\
\xa3\x10E\xf5`\x22\x08q\x1b\x96\x0c\xdc\x86s\xb9`\
\xf3\xdd\xafT\xfb>\xf5\xf2\x89\xea\xdd\xdf=>*i\
P2\x04\xbdo}>\x9c\x8c;\xb9\x89\xdc\xa8d\xf9\
\xe9\x1d\xb0\x1c,i/p)\x0c\x0b\xb9\x9c\xc6\x81\xd1\
-\xffZ\xed\x03\x88\xc30?\x91S\xc4T\x90\xac\x99\
Y\xff\xa7\x8eE\xd5\xa5*\xf7\xd6#\xa5\xcb@\x01\xd3\
\xe1-\xc7\xc6\xfa\xa7\xd1#\x99\x8dm=\x16\x0d,U\
v\x13K\xda\x0eo\x8b\xa2\x18Y\xbfd\x957\xf7\x86\
C\x90\xf6\xea\x9a\xc4B\xc9F\xb3 Wt'z\xeb\
\xe1p\xae\xfb\x81\x85\xd1\x94\xe5A\xef\x0cz\xcd\x92\xc9\
\xfb\xc7ea\xc9\xe7\x01[^\x8d\x86\xcd\xe9K\x9d\xb0\
w(\x0e\xc3|!\x8a\xea[_\x8d\xca8e\xc9b\
\xc9p\xacti\xef\xde\x81\xa5\xb4\x918/d\xce,\
L\x8f\xfcNPp\xacx)\x0c+K\xd5\xbf\x89e\
\x9d\x0ao\x89\xa2aI\xa1\x9c\xdek\x04\xe3\x97\xc2}\
%\x80\xadQ4z\xcf\xf7\xbe\xb7\xb9\xd9\x838\x07/\
\x85a\xa1U\xf9\xb7\xd1\x8c+\xc65:\x8a\x00\x97\xc2\
}%9\xbd\x92\xe5!\x18ZH\xc6BX\xf6\xb1\xf8\
\xb6(\xaa^\xc57\xa7A\xd0\xa3\x8b\xa5\x87\xa3Z\xd6\
[\xee\xc4\xcd\xed\xb0+Xp\x89\x9c\x89B\x14\xd5\xa7\
\xb6\xd4\x1e],\xed\x95\xe4\xd1\x14\xcd\x96}\x9c\xd6\xd6\
\xab\xb1\xb4w4\x22\x88\x01\x0c\x8a\x88*F\x09\xc0\x82\
d\xf3\xb6(\x8a[\x91yq\xcf#i\xf6)\xf5\x7f\
\xfa\xf8\xab\x87\xd3v\xc2\x82<w\xd9\x02\x0b\xb7E\xc7\
\xaa\xcb\xd1\xb9\xad\x17#\xdb\xa2cU\xc9\xf2\xc8\x8ai\
\xa1|=\x97\x94\x9b;\xc0d\x22\xd7\xf2( \xe3\x95\
\x05\x931`[\x14\xc5\x92\xd1h,_\xe7\xb6\xdf\x0c\
M\xe5\x03\xd4-\xb7\xa6V\x8c\xa2\xba\xc8v\x80\x16\xcc\
zP:\x1f\xdc\xad \x19\xeeS\xaa\xd6\xc20/-\
\xb8\xedX\x14\xda\xee\x80\x89\x8eF(lP\xb2\xfc\xb5\
k\x19m\xa2\xe3\x88\x04\x88\xfc\x85\xddi\xa0\x5c\x0c.\
\xec\xda7 (H\x10\xb8&w\x9a\x1d\x8d\x8e\xa2\x04\
\x8d\x8e\xc6\xb2c@\xdb\x1dP\x8c\xa2\xfa\xbd'\xbe;\
\x80{}\x8d\xdd\xe8\x05(\x9ey96\xf7\x18w\xf0\
4\x1e,\x84\x1f\xf6\xec\xad \x1dLy|\xf43\xa7\
^\x994\xd6\xdc\x9f4\xf7\xb8\x18\xdd\xbc}^\x0aV\
\xecrT\xf2\x9aK\x93\x9b&w\xd5$G\x9e,\x98\
\xc0\xbc\xb13,\x82\x86$\xc7\xddk\x8d\xaed\xf2\xf8\
\xad\xd6\x1d\xe6=Qo\xa2\xf9\x0f_\x16\x8b\xb6^\x8e\
6Q\xeb\x09\x0b9\xa9\x84Y\xdf\xe4\x7fTb\x91\x0b\
N\x12\xe8\x10\xe9\xeaTw\xb3\xf2\xf4\x9e\xceui\x08\
\x84_\xb3Y\x8f\xdeZ\xc5\x8a8 h$\xbd\x04\xd4\
\xb7\xbfv|\x18 \x97$Oa\xe4\x81zN\xb9\x0f\
\x5c\xa4L\xc7\x1b;w\x15\xb1\x5c\x09\x001\xcaD\xae\
^\xeb\x0e\xf3t4\x8a9\xb3\x03\x18\xbd\x16\xe4\xc2\xe2\
\xf8\xf2\x87?\xac\x80\x03j;w\x15s\xd8\x01\x9cZ\
\xad\xa7\xa7\x104\xac\x17\x82J\xd6\xfb\xc3\x9f9\x7f|\
\xde\xc0\xd5\x90=\x89\x1c\xd2/\xc3z\x83\x0e\xaf b\
\xa0\xa0\xf4\x82\xa1\x7f\xfb\xd9\xe3\xd5v\xe9\xdbv\x07\x04\
\xaeH\x90\x07\x08&\x82\xcb\xa4\xdf\x0a\xd4\x81\xbc\xa19\
\x8f\xd3\x9a0yQ\x18\x82Q%\x9d\xfd\xb9\xe0F\xaf\
\x8c\xa1\xe6\xf4q\x0b\xdaz\x99\xda\xfe (\x9f,&\
\xef\xfb\xec\xf7O}\xd4P?r$\x95~\xd8\xddS\
\x99\x97]*!'\x90\x8f\x15\xc7\xa3\xfa\xf6\x1f\x9c\x1a\
F)?J\x0e\x17\xcf\x9f\xa8\xb6S\xdd\xb6;\xc0\xdd\
C\xb9\x8f\xca\x9d\xc4\xaf\x8d\x02l\xff\xfe\xe9QyR\
\x95;\x8e\x0f\xd5\xbag\xbf\x11\xaeu\xf7\x14\xe4N\xca\
\x9b\xd4\xa6d&y\xb9\xd7>\xfb\x83\xd7\xe6\x8d\x1fK\
A\xfb\xf3\x80\xf1s5q\xa3/\x9d\xc7k&3?\
\xa1\xc1\xe6\xc8(\x8e\xcf\xf5aD\xa30Ug\xea\xbb\
\x01\x93\xef1\xf7j\xbbu\x85\x15\xca\x03R\x03}\xd8\
\x92\xe4\xd0M\xbd\xdd\x9c\x1es\xc1\xbd\x94\xd5\x89g\xd0\
\x8b.\x7f}v\xa6\xe5a\xe5\x12\xa1\x86\x1f\x91<\xcf\
\x04\x05\x00\x1a\x8dR6\xbc\xe7\x0eb\xf2;\xb2:q\
\x93T\xbb\xb7\xbb(y\x9e\xdc\xca\x8c\x80\x15\xc9\x03\x00\
0\xf2\xc8)^x=3\xd8I#\xb9\xe6^\xbf=\
)\x82\x01Ls\x92\x97\x10\xf5\xe2\xf8\xeb\xf1J\xa8\xb9\
r\x0e\xa0\xc1M\x99_\xa2;01o6\xe8\x02\x13\
\xc0{S4\xdf\x83M~\x14\xddv\xac\xdc\x87\x92\x0d\
\x15\x94L\xf5\xb6\xe4E\xb9\xc05\xe7\x14\x90O\xd6\x89\
\xa7\xd1J.\x8d\xcd\xc5\xb3\x5c\xac\xd8\x08pT0\xa6\
\x19\x9b\x05?7{o.\x1eP\x1e\x09,u@m\
\xeb\xbdE\x02\xe5\x83\x86UWJ\xcf\x15\x1b\x01\x9f\xbb\
\xf8\xa3\x01\xf3\xc6\xe4\xbam\xd7\xaf\x96\xcd\x14\x06\xf8\xf0\
\x5c<f\xdal\xa6\x90k\xd7j\x00\xc57/\xd4\xcc\
\x14\x16\xdf\xbc\xb0b\x9f\xd2\xdd\xfa\x5c~\xb5\x15Xm\
\xdcr\xc0j+\xb0\xda\xb8\xe5\x80\xd5V`\xb5q\xcb\
\x01\xab\xad\xc0j\xe3\xff\x00dk\x04\xaa\xab\xfe\x09I\
\x00\x00\x00\x00IEND\xaeB`\x82\
"
qt_resource_name = b"\
\x00\x18\
\x04N' \
\x00f\
\x00i\x00e\x00l\x00d\x00w\x00o\x00r\x00k\x00m\x00e\x00s\x00h\x00f\x00i\x00t\x00t\
\x00i\x00n\x00g\x00s\x00t\x00e\x00p\
\x00\x06\
\x07\x03}\xc3\
\x00i\
\x00m\x00a\x00g\x00e\x00s\
\x00\x1c\
\x07\xc9\xcd\xa7\
\x00f\
\x00i\x00e\x00l\x00d\x00w\x00o\x00r\x00k\x00m\x00e\x00s\x00h\x00f\x00i\x00t\x00t\
\x00i\x00n\x00g\x00i\x00c\x00o\x00n\x00.\x00p\x00n\x00g\
"
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x006\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01y\xe8xF\xee\
"
def qInitResources():
QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| 45.377593 | 97 | 0.69861 | 2,350 | 10,936 | 3.239574 | 0.293617 | 0.059898 | 0.062656 | 0.053593 | 0.066334 | 0.065546 | 0.063181 | 0.062787 | 0.062787 | 0.059241 | 0 | 0.242249 | 0.050293 | 10,936 | 240 | 98 | 45.566667 | 0.490757 | 0.014996 | 0 | 0.030568 | 0 | 0.681223 | 0 | 0 | 0 | 0 | 0.00076 | 0 | 0 | 1 | 0.008734 | false | 0 | 0.004367 | 0 | 0.0131 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f3bd438a49fc760297a4c81abf86897a0353fecd | 110 | py | Python | docs/cookbook/simple-discovery/advertise_a_service_with_a_specific_port.py | tjguk/networkzero | 5b40e3a213f22dc82d2ce8d36925019eaaf2c06e | [
"MIT"
] | 39 | 2016-03-31T07:49:45.000Z | 2021-09-01T10:34:02.000Z | docs/cookbook/simple-discovery/advertise_a_service_with_a_specific_port.py | tjguk/networkzero | 5b40e3a213f22dc82d2ce8d36925019eaaf2c06e | [
"MIT"
] | 48 | 2016-04-07T20:22:44.000Z | 2021-09-26T18:12:01.000Z | docs/cookbook/simple-discovery/advertise_a_service_with_a_specific_port.py | tjguk/networkzero | 5b40e3a213f22dc82d2ce8d36925019eaaf2c06e | [
"MIT"
] | 15 | 2016-04-07T20:12:18.000Z | 2019-10-25T14:31:41.000Z | import networkzero as nw0
address = nw0.advertise("myservice3", 1234)
print("Service is at address", address) | 27.5 | 43 | 0.772727 | 15 | 110 | 5.666667 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.072165 | 0.118182 | 110 | 4 | 44 | 27.5 | 0.804124 | 0 | 0 | 0 | 0 | 0 | 0.279279 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
341cfe95b2095b86846ef75787b959baff4da4be | 432 | py | Python | docs/source/tutorials/advanced_usage/reduce_demo_1.demo.py | HansBug/treevalue | 6f2f5b2de00b04a06201a87ccee678ade9deff57 | [
"Apache-2.0"
] | null | null | null | docs/source/tutorials/advanced_usage/reduce_demo_1.demo.py | HansBug/treevalue | 6f2f5b2de00b04a06201a87ccee678ade9deff57 | [
"Apache-2.0"
] | 1 | 2021-07-24T13:30:14.000Z | 2021-07-24T13:30:14.000Z | docs/source/tutorials/advanced_usage/reduce_demo_1.demo.py | HansBug/treevalue | 6f2f5b2de00b04a06201a87ccee678ade9deff57 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
from operator import __mul__
from treevalue import reduce_, FastTreeValue
def multi(items):
return reduce(__mul__, items, 1)
if __name__ == '__main__':
t = FastTreeValue({'a': 1, 'b': 2, 'x': {'c': 3, 'd': 4}, 'y': {'e': 6, 'f': 8}})
print("Sum of t:", reduce_(t, lambda **kwargs: sum(kwargs.values())))
print("Multiply of t:", reduce_(t, lambda **kwargs: multi(kwargs.values())))
| 27 | 85 | 0.62963 | 62 | 432 | 4.080645 | 0.596774 | 0.094862 | 0.071146 | 0.079051 | 0.173913 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0.019608 | 0.173611 | 432 | 15 | 86 | 28.8 | 0.689076 | 0 | 0 | 0 | 0 | 0 | 0.090278 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0.111111 | 0.555556 | 0.222222 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
342605f39c67cf0a64987445124462eb7371e292 | 650 | py | Python | venv/Tests/test_Parsing_Data.py | byrpatrick/Pico_Placa | 40a6c3df8667758e481b9413be1f46a86d144091 | [
"CNRI-Python"
] | null | null | null | venv/Tests/test_Parsing_Data.py | byrpatrick/Pico_Placa | 40a6c3df8667758e481b9413be1f46a86d144091 | [
"CNRI-Python"
] | null | null | null | venv/Tests/test_Parsing_Data.py | byrpatrick/Pico_Placa | 40a6c3df8667758e481b9413be1f46a86d144091 | [
"CNRI-Python"
] | null | null | null | import Source.Parsing_Data as pd
import pytest
from datetime import datetime, time
def test_getTime():
assert pd.getTime("16:30") == time(16, 30)
def test_getTime_ValueError():
with pytest.raises(ValueError):
pd.getTime("25:30")
def test_getDate():
assert pd.getDate("07-10-2020") == datetime(2020, 10, 7)
def test_getDate_ValueError():
with pytest.raises(ValueError):
pd.getDate("13-13-2020")
def test_getLastDigitLicPlate():
assert pd.getLastDigitLicPlate("ABC5612") == 2
def test_getLastDigitLicPlate_ValueError():
with pytest.raises(ValueError):
pd.getLastDigitLicPlate("as23344") | 27.083333 | 60 | 0.703077 | 81 | 650 | 5.518519 | 0.37037 | 0.09396 | 0.134228 | 0.174497 | 0.255034 | 0.255034 | 0 | 0 | 0 | 0 | 0 | 0.083643 | 0.172308 | 650 | 24 | 61 | 27.083333 | 0.747212 | 0 | 0 | 0.166667 | 0 | 0 | 0.067588 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.333333 | true | 0 | 0.166667 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3432ff0f108e271e4e273410551a37b8fc766307 | 2,130 | py | Python | vmtconnect/versions.py | rayray221/vmt-connect | e69498a51b2cc21f6e4f9e428cafbb95a644a681 | [
"Apache-2.0"
] | 2 | 2021-03-04T03:54:00.000Z | 2021-08-19T17:06:59.000Z | vmtconnect/versions.py | rastern/vmt-connect | 0fec81f0011e3a005e9111d876ea1e6138016d08 | [
"Apache-2.0"
] | 4 | 2020-08-04T13:05:48.000Z | 2021-08-10T16:45:39.000Z | vmtconnect/versions.py | rayray221/vmt-connect | e69498a51b2cc21f6e4f9e428cafbb95a644a681 | [
"Apache-2.0"
] | 2 | 2020-08-04T13:10:28.000Z | 2021-11-16T17:22:52.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
names = {
'Cisco': 'cwom'
}
mappings = {
'cwom': {
'1.0': '5.8.3.1',
'1.1': '5.9.1',
'1.1.3': '5.9.3',
'1.2.0': '6.0.3',
'1.2.1': '6.0.6',
'1.2.2': '6.0.9',
'1.2.3': '6.0.11.1',
'2.0.0': '6.1.1',
'2.0.1': '6.1.6',
'2.0.2': '6.1.8',
'2.0.3': '6.1.12',
'2.1.0': '6.2.2',
'2.1.1': '6.2.7.1',
'2.1.2': '6.2.10',
'2.2': '6.3.2',
'2.2.1': '6.3.5.0.1',
'2.2.2': '6.3.7',
'2.2.3': '6.3.7.1',
'2.2.4': '6.3.10',
'2.2.5': '6.3.13',
'2.3.0': '6.4.2',
'2.3.1': '6.4.5',
'2.3.2': '6.4.6',
'2.3.3': '6.4.7',
'2.3.4': '6.4.8',
'2.3.5': '6.4.9',
'2.3.6': '6.4.10',
'2.3.7': '6.4.11',
'2.3.8': '6.4.12',
'2.3.9': '6.4.13',
'2.3.10': '6.4.14',
'2.3.11': '6.4.15',
'2.3.12': '6.4.16',
'2.3.13': '6.4.17',
'2.3.14': '6.4.18',
'2.3.15': '6.4.19',
'2.3.16': '6.4.20',
'2.3.17': '6.4.21',
'2.3.18': '6.4.22',
'2.3.19': '6.4.23',
'2.3.20': '6.4.24',
'2.3.21': '6.4.25',
'2.3.22': '6.4.26',
'2.3.23': '6.4.27',
'2.3.24': '6.4.28',
'2.3.25': '6.4.29',
'2.3.26': '6.4.30',
'2.3.27': '6.4.31',
'2.3.28': '6.4.32',
'2.3.29': '6.4.33',
'2.3.30': '6.4.34',
'2.3.31': '6.4.35',
'2.3.32': '6.4.36',
'2.3.33': '6.4.37',
'2.3.34': '6.4.38',
'3.0.1': '8.2.1'
}
}
| 27.662338 | 74 | 0.394366 | 430 | 2,130 | 1.953488 | 0.232558 | 0.088095 | 0.010714 | 0.038095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.276669 | 0.31784 | 2,130 | 76 | 75 | 28.026316 | 0.301445 | 0.242723 | 0 | 0 | 0 | 0 | 0.398501 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3434e82b4a409fd64a978d54517fd44e6cf11709 | 88 | py | Python | data/studio21_generated/interview/0281/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0281/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0281/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | class Solution:
def canConvertString(self, s: str, t: str, k: int) -> bool:
| 29.333333 | 63 | 0.590909 | 12 | 88 | 4.333333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 88 | 3 | 64 | 29.333333 | 0.8125 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
347cc2a71ad4194f24ea05a87d6a12e7aafdccce | 102 | py | Python | configs/_base_/backends/tensorrt-fp16.py | zhiqwang/mmdeploy | 997d111a6f4ca9624ab3b36717748e6ce002037d | [
"Apache-2.0"
] | 746 | 2021-12-27T10:50:28.000Z | 2022-03-31T13:34:14.000Z | configs/_base_/backends/tensorrt-fp16.py | zhiqwang/mmdeploy | 997d111a6f4ca9624ab3b36717748e6ce002037d | [
"Apache-2.0"
] | 253 | 2021-12-28T05:59:13.000Z | 2022-03-31T18:22:25.000Z | configs/_base_/backends/tensorrt-fp16.py | zhiqwang/mmdeploy | 997d111a6f4ca9624ab3b36717748e6ce002037d | [
"Apache-2.0"
] | 147 | 2021-12-27T10:50:33.000Z | 2022-03-30T10:44:20.000Z | backend_config = dict(
type='tensorrt', common_config=dict(fp16_mode=True, max_workspace_size=0))
| 34 | 78 | 0.77451 | 15 | 102 | 4.933333 | 0.866667 | 0.27027 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032609 | 0.098039 | 102 | 2 | 79 | 51 | 0.771739 | 0 | 0 | 0 | 0 | 0 | 0.078431 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
34804444b82aec6874044f51b6f559ed3572b288 | 212 | py | Python | scripts/test_session.py | BlockResearchGroup/compas_ui | 8b5a6121eee837d306bf20c44c91f94a5c185f90 | [
"MIT"
] | null | null | null | scripts/test_session.py | BlockResearchGroup/compas_ui | 8b5a6121eee837d306bf20c44c91f94a5c185f90 | [
"MIT"
] | 3 | 2022-02-24T17:56:30.000Z | 2022-03-31T09:48:40.000Z | scripts/test_session.py | BlockResearchGroup/compas_ui | 8b5a6121eee837d306bf20c44c91f94a5c185f90 | [
"MIT"
] | null | null | null | from compas_ui.session import Session
s = Session(name='test')
s['test'] = {}
s.record()
s['test']['a'] = 1
s.record()
s['test']['b'] = 2
s.record()
s.undo()
# s.undo()
# s.undo()
# s.record()
s.save()
| 8.833333 | 37 | 0.54717 | 36 | 212 | 3.194444 | 0.416667 | 0.243478 | 0.278261 | 0.208696 | 0.13913 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011429 | 0.174528 | 212 | 23 | 38 | 9.217391 | 0.645714 | 0.132075 | 0 | 0.3 | 0 | 0 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
cac161e0f857a3d0f211138bd41cbc5b307d2acf | 93 | py | Python | test.py | N3mT3nta/ExerciciosPython | 23451dd800ef0d73b75e9fa78d0dcfa0859206a0 | [
"MIT"
] | null | null | null | test.py | N3mT3nta/ExerciciosPython | 23451dd800ef0d73b75e9fa78d0dcfa0859206a0 | [
"MIT"
] | null | null | null | test.py | N3mT3nta/ExerciciosPython | 23451dd800ef0d73b75e9fa78d0dcfa0859206a0 | [
"MIT"
] | null | null | null | nome = input('Digite seu nome: ')
def saudar(x):
print(f'Bem-vindo, {x}!')
saudar(nome) | 15.5 | 33 | 0.612903 | 15 | 93 | 3.8 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172043 | 93 | 6 | 34 | 15.5 | 0.74026 | 0 | 0 | 0 | 0 | 0 | 0.340426 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
cac1d0a08a43b1233787335c4ca2dcbf19fb3e15 | 5,889 | py | Python | tenseal/tensors/abstract_tensor.py | rand0musername/TenSEAL | 395801624d228de3af00c0347305b81fbc04bcba | [
"Apache-2.0"
] | 410 | 2020-01-25T16:02:22.000Z | 2022-03-31T08:27:38.000Z | tenseal/tensors/abstract_tensor.py | rand0musername/TenSEAL | 395801624d228de3af00c0347305b81fbc04bcba | [
"Apache-2.0"
] | 192 | 2020-02-23T15:48:59.000Z | 2022-03-23T21:54:15.000Z | tenseal/tensors/abstract_tensor.py | rand0musername/TenSEAL | 395801624d228de3af00c0347305b81fbc04bcba | [
"Apache-2.0"
] | 87 | 2020-02-13T03:40:36.000Z | 2022-03-28T09:53:35.000Z | """Abstract tensor class that implements common tensor methods"""
from typing import List, Union
import tenseal as ts
from abc import ABC
class AbstractTensor(ABC):
@property
def data(self):
"""Get the wrapped low level tensor object"""
return self._data
@data.setter
def data(self, value):
"""Set the wrapped low level tensor object"""
native_type = getattr(ts._ts_cpp, self.__class__.__name__)
if not isinstance(value, native_type):
raise TypeError(f"value must be of type {native_type}")
self._data = value
def copy(self):
return self._wrap(data=self.data.copy())
def __copy__(self):
return self.copy()
def context(self) -> "ts.Context":
"""Get the context linked to this tensor"""
return ts.Context._wrap(self.data.context())
def link_context(self, ctx: "ts.Context"):
"""Set the context linked to this tensor"""
return self.data.link_context(ctx.data)
@property
def shape(self) -> List[int]:
return self.data.shape()
@classmethod
def load(cls, context: "ts.Context", data: bytes) -> "AbstractTensor":
"""
Constructor method for the tensor object from a serialized protobuffer.
Args:
context: a context, holding the encryption parameters and keys.
data: the serialized protobuffer.
Returns:
Tensor object.
"""
if isinstance(context, ts.Context) and isinstance(data, bytes):
native_type = getattr(ts._ts_cpp, cls.__name__)
return cls._wrap(native_type(context.data, data))
raise TypeError(
"Invalid input types context: {} and vector: {}".format(type(context), type(data))
)
@classmethod
def lazy_load(cls, data: bytes) -> "AbstractTensor":
"""
Constructor method for the tensor object from a serialized protobuffer, without a context.
Args:
data: the serialized protobuffer.
Returns:
Tensor object.
"""
if isinstance(data, bytes):
native_type = getattr(ts._ts_cpp, cls.__name__)
return cls._wrap(native_type(data))
raise TypeError("Invalid input types vector: {}".format(type(data)))
def serialize(self) -> bytes:
"""Serialize the tensor into a stream of bytes"""
return self.data.serialize()
@classmethod
def _wrap(cls, data) -> "AbstractTensor":
"""Return a new tensor object wrapping the low level tensor object"""
return cls(data=data)
def _decrypt(
self, secret_key: "ts.enc_context.SecretKey" = None
) -> Union[ts._ts_cpp.PlainTensorDouble, ts._ts_cpp.PlainTensorInt64, List[float], List[int]]:
if secret_key is None:
return self.data.decrypt()
elif isinstance(secret_key, ts.enc_context.SecretKey):
return self.data.decrypt(secret_key.data)
else:
raise TypeError(f"incorrect type: {type(secret_key)} != SecretKey")
@classmethod
def _get_operand(cls, other, dtype: str = "float") -> Union[int, float, "ts._ts_cpp.Tensor"]:
"""Extract the appropriate operand the tensor can operate with"""
if isinstance(other, (int, float)):
return other
elif isinstance(other, (cls, ts.PlainTensor)):
return other.data
else:
try:
other = ts.plain_tensor(other, dtype=dtype)
other = other.data
except TypeError:
raise TypeError(f"can't operate with object of type {type(other)}")
return other
def __add__(self, other) -> "AbstractTensor":
return self.add(other)
def __iadd__(self, other) -> "AbstractTensor":
return self.add_(other)
def __radd__(self, other) -> "AbstractTensor":
return self.add(other)
def __mul__(self, other) -> "AbstractTensor":
return self.mul(other)
def __imul__(self, other) -> "AbstractTensor":
return self.mul_(other)
def __rmul__(self, other) -> "AbstractTensor":
return self.mul(other)
def __sub__(self, other) -> "AbstractTensor":
return self.sub(other)
def __isub__(self, other) -> "AbstractTensor":
return self.sub_(other)
def __rsub__(self, other) -> "AbstractTensor":
copy = self.copy()
copy.neg_()
copy.add_(other)
return copy
def __pow__(self, power) -> "AbstractTensor":
return self.pow(power)
def __ipow__(self, power) -> "AbstractTensor":
return self.pow_(power)
def __neg__(self) -> "AbstractTensor":
return self.neg()
def neg(self) -> "AbstractTensor":
return self._wrap(self.data.neg())
def neg_(self) -> "AbstractTensor":
self.data.neg_()
return self
def sum(self, axis=0) -> "AbstractTensor":
return self._wrap(self.data.sum(axis))
def sum_(self, axis=0) -> "AbstractTensor":
self.data.sum_(axis)
return self
def square(self) -> "AbstractTensor":
return self._wrap(self.data.square())
def square_(self) -> "AbstractTensor":
self.data.square_()
return self
def pow(self, power) -> "AbstractTensor":
return self._wrap(self.data.pow(power))
def pow_(self, power) -> "AbstractTensor":
self.data.pow_(power)
return self
def polyval(self, coefficients: Union[List[float], List[int]]) -> "AbstractTensor":
"""Evaluate polynomial
`coefficients[0] + coefficients[1] * self + .... coefficients[n] * self ^ n`
"""
return self._wrap(self.data.polyval(coefficients))
def polyval_(self, coefficients: Union[List[float], List[int]]) -> "AbstractTensor":
self.data.polyval_(coefficients)
return self
| 32.357143 | 98 | 0.613177 | 681 | 5,889 | 5.113069 | 0.196769 | 0.083285 | 0.103389 | 0.066628 | 0.481045 | 0.436531 | 0.338024 | 0.282596 | 0.156232 | 0.125215 | 0 | 0.001392 | 0.268127 | 5,889 | 181 | 99 | 32.535912 | 0.806497 | 0.145186 | 0 | 0.179487 | 0 | 0 | 0.130023 | 0.004945 | 0 | 0 | 0 | 0 | 0 | 1 | 0.299145 | false | 0 | 0.025641 | 0.153846 | 0.649573 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
cad9e86516d668a4a02082ffd0ee0cd5cff3ee7a | 204 | py | Python | leetcode/square-sort.py | hyungilk/ProblemSolving | b1eb2d27c60e3281136f2052305ffbe3009dca7c | [
"MIT"
] | null | null | null | leetcode/square-sort.py | hyungilk/ProblemSolving | b1eb2d27c60e3281136f2052305ffbe3009dca7c | [
"MIT"
] | null | null | null | leetcode/square-sort.py | hyungilk/ProblemSolving | b1eb2d27c60e3281136f2052305ffbe3009dca7c | [
"MIT"
] | null | null | null | class Solution:
def sortedSquares(self, nums: List[int]) -> List[int]:
sq_nums = []
for num in nums:
sq_nums.append(num ** 2)
sq_nums.sort()
return sq_nums
| 25.5 | 58 | 0.544118 | 27 | 204 | 3.962963 | 0.592593 | 0.224299 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007407 | 0.338235 | 204 | 7 | 59 | 29.142857 | 0.785185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
cae44eec6b0366446876e192df48418e97cc45bd | 474 | py | Python | src/hyperka/hyperbolic/util.py | nju-websoft/HyperKA | cadaf824a739b55211997e73d9948ddbfbe7ce83 | [
"MIT"
] | 25 | 2020-10-04T06:10:41.000Z | 2021-10-21T13:21:47.000Z | src/hyperka/hyperbolic/util.py | nju-websoft/HyperKA | cadaf824a739b55211997e73d9948ddbfbe7ce83 | [
"MIT"
] | 1 | 2020-11-07T19:11:16.000Z | 2020-11-09T14:08:26.000Z | src/hyperka/hyperbolic/util.py | nju-websoft/HyperKA | cadaf824a739b55211997e73d9948ddbfbe7ce83 | [
"MIT"
] | 3 | 2021-01-25T02:47:08.000Z | 2021-06-01T07:13:26.000Z | import tensorflow as tf
import numpy as np
PROJ_EPS = 1e-5
EPS = 1e-15
MAX_TANH_ARG = 15.0
# Real x, not vector!
def tf_atanh(x):
return tf.atanh(tf.minimum(x, 1. - EPS)) # Only works for positive real x.
# Real x, not vector!
def tf_tanh(x):
return tf.tanh(tf.minimum(tf.maximum(x, -MAX_TANH_ARG), MAX_TANH_ARG))
def tf_dot(x, y):
return tf.reduce_sum(x * y, axis=1, keepdims=True)
def tf_norm(x):
return tf.norm(x, ord=2, axis=-1, keepdims=True) | 18.96 | 79 | 0.672996 | 93 | 474 | 3.301075 | 0.419355 | 0.065147 | 0.09772 | 0.091205 | 0.123779 | 0.123779 | 0 | 0 | 0 | 0 | 0 | 0.031169 | 0.187764 | 474 | 25 | 80 | 18.96 | 0.766234 | 0.149789 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.153846 | 0.307692 | 0.769231 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
caf537d731d117c23c1e287120f1e06ce4ca58b2 | 491 | py | Python | practice_problems/stacks_queues/stack_min.py | YazzyYaz/codinginterviews | b8115c43507d738bccd90366f2bc02867ba7f13f | [
"MIT"
] | null | null | null | practice_problems/stacks_queues/stack_min.py | YazzyYaz/codinginterviews | b8115c43507d738bccd90366f2bc02867ba7f13f | [
"MIT"
] | null | null | null | practice_problems/stacks_queues/stack_min.py | YazzyYaz/codinginterviews | b8115c43507d738bccd90366f2bc02867ba7f13f | [
"MIT"
] | null | null | null | class Stack(object):
def __init__(self):
self.items = []
self.min_value = None
def push(self, item):
if not self.min_value or self.min_value > item:
self.min_value = item
self.items.append(item)
def pop(self):
self.items.pop()
def get_min_value(self):
return self.min_value
stack = Stack()
stack.push(4)
stack.push(6)
stack.push(2)
print(stack.get_min_value())
stack.push(1)
print(stack.get_min_value())
| 20.458333 | 55 | 0.615071 | 73 | 491 | 3.931507 | 0.328767 | 0.222997 | 0.209059 | 0.111498 | 0.271777 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010989 | 0.258656 | 491 | 23 | 56 | 21.347826 | 0.777473 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.210526 | false | 0 | 0 | 0.052632 | 0.315789 | 0.105263 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1b260a46655b2ca358ceff6d4b6da6e88e3eeb26 | 52 | py | Python | pawan/lib/python3.6/random.py | pawannn29/projectdjango | a2c269b99676109a9a28f1ff3bc26b3d7779056c | [
"bzip2-1.0.6"
] | null | null | null | pawan/lib/python3.6/random.py | pawannn29/projectdjango | a2c269b99676109a9a28f1ff3bc26b3d7779056c | [
"bzip2-1.0.6"
] | null | null | null | pawan/lib/python3.6/random.py | pawannn29/projectdjango | a2c269b99676109a9a28f1ff3bc26b3d7779056c | [
"bzip2-1.0.6"
] | null | null | null | /Users/NikhilArora/anaconda3/lib/python3.6/random.py | 52 | 52 | 0.846154 | 8 | 52 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.057692 | 0 | 52 | 1 | 52 | 52 | 0.788462 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1b432895027211b62a59bd4210b744e699e90333 | 781 | py | Python | Level1/Lessons1845/yang_1834.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons1845/yang_1834.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | null | null | null | Level1/Lessons1845/yang_1834.py | StudyForCoding/ProgrammersLevel | dc957b1c02cc4383a93b8cbf3d739e6c4d88aa25 | [
"MIT"
] | 1 | 2021-04-05T07:35:59.000Z | 2021-04-05T07:35:59.000Z | # 폰켓몬
def solution(nums):
half = len(nums)/2
nums = list(set(nums))
diff = len(nums)
if half >= diff:
return int(diff)
else:
return int(half)
# 테스트 1 〉 통과 (0.01ms, 10.2MB)
# 테스트 2 〉 통과 (0.01ms, 10.1MB)
# 테스트 3 〉 통과 (0.01ms, 10.2MB)
# 테스트 4 〉 통과 (0.01ms, 10.2MB)
# 테스트 5 〉 통과 (0.01ms, 10.3MB)
# 테스트 6 〉 통과 (0.01ms, 10.1MB)
# 테스트 7 〉 통과 (0.01ms, 10MB)
# 테스트 8 〉 통과 (0.01ms, 10.2MB)
# 테스트 9 〉 통과 (0.01ms, 10.2MB)
# 테스트 10 〉 통과 (0.01ms, 10.2MB)
# 테스트 11 〉 통과 (0.01ms, 10.2MB)
# 테스트 12 〉 통과 (0.09ms, 10.3MB)
# 테스트 13 〉 통과 (0.09ms, 10.3MB)
# 테스트 14 〉 통과 (0.09ms, 10.2MB)
# 테스트 15 〉 통과 (0.05ms, 10.3MB)
# 테스트 16 〉 통과 (1.09ms, 11MB)
# 테스트 17 〉 통과 (0.60ms, 10.6MB)
# 테스트 18 〉 통과 (0.59ms, 10.5MB)
# 테스트 19 〉 통과 (0.39ms, 10.4MB)
# 테스트 20 〉 통과 (0.32ms, 10.3MB) | 26.033333 | 30 | 0.544174 | 183 | 781 | 2.431694 | 0.284153 | 0.134831 | 0.170787 | 0.197753 | 0.440449 | 0.395506 | 0.395506 | 0 | 0 | 0 | 0 | 0.255537 | 0.248399 | 781 | 30 | 31 | 26.033333 | 0.468484 | 0.729834 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1b51c40f1f0681104400ce5e7c5460a436cc5780 | 4,049 | py | Python | hitchstory/result.py | hitchtest/hitchstory | 9cd44ec1078c4e6b7fd8ca0a237159ef6257d302 | [
"MIT"
] | 24 | 2018-02-24T23:09:00.000Z | 2021-11-25T17:22:47.000Z | hitchstory/result.py | hitchtest/hitchstory | 9cd44ec1078c4e6b7fd8ca0a237159ef6257d302 | [
"MIT"
] | 3 | 2021-08-14T11:00:55.000Z | 2022-03-04T15:27:52.000Z | hitchstory/result.py | hitchtest/hitchstory | 9cd44ec1078c4e6b7fd8ca0a237159ef6257d302 | [
"MIT"
] | 2 | 2019-05-01T17:05:41.000Z | 2022-01-13T12:17:06.000Z | from hitchstory.utils import TEMPLATE_DIR
from jinja2.environment import Environment
from jinja2 import FileSystemLoader
import colorama
class FlakeResult(object):
def __init__(self):
self._results = []
def append(self, result):
self._results.append(result)
@property
def is_flaky(self):
return self.failure_count > 0 and self.failure_count < self.total_results
@property
def failure_count(self):
return len([result for result in self._results if not result.passed])
@property
def total_results(self):
return len(self._results)
@property
def percentage_failures(self):
return 100.0 * (float(self.failure_count) / float(self.total_results))
class ResultList(object):
def __init__(self):
self._results = []
def append(self, result):
self._results.append(result)
@property
def all_passed(self):
return all([result.passed for result in self._results])
def report(self):
return "\n".join([result.report() for result in self._results])
class Report(object):
pass
class Result(object):
def _template(self, template_name):
env = Environment()
env.loader = FileSystemLoader(TEMPLATE_DIR)
return env.get_template(
str(TEMPLATE_DIR.joinpath(template_name).basename())
).render(
result=self, Fore=colorama.Fore, Back=colorama.Back, Style=colorama.Style
)
@property
def exit_code(self):
return 0
@property
def passed(self):
return True
@property
def duration(self):
return self._duration
@property
def story(self):
return self._story
class Success(Result):
def __init__(self, story, duration):
self._story = story
self._duration = duration
def report(self):
return self._template("success.jinja2")
class FailureException(object):
def __init__(self, exception):
self._exception = exception
@property
def obj(self):
return self._exception
@property
def obj_type(self):
return str(self._exception.__class__.__name__)
@property
def docstring(self):
return str(self._exception.__doc__)
@property
def text(self):
return str(self._exception)
class Failure(Result):
def __init__(self, story, duration, exception, failing_step, stacktrace):
assert isinstance(exception, (Exception, RuntimeError))
self._story = story
self._duration = duration
self._exception = FailureException(exception)
self._failing_step = failing_step
self._stacktrace = stacktrace
@property
def exit_code(self):
return 1
@property
def passed(self):
return False
@property
def exception(self):
return self._exception
@property
def stacktrace(self):
return self._stacktrace
@property
def story_failure_snippet(self):
"""
Snippet of YAML highlighting the failing line.
"""
if self._failing_step is None:
return u""
else:
snippet = "{before}\n{bright}{lines}{normal}\n{after}".format(
before=self._failing_step.yaml.lines_before(2),
lines=self._failing_step.yaml.lines(),
after=self._failing_step.yaml.lines_after(2),
bright=colorama.Style.BRIGHT,
normal=colorama.Style.NORMAL,
)
indented_snippet = " " + snippet.replace("\n", "\n ")
return indented_snippet
def to_dict(self):
return {
"story": self.story.to_dict(),
"step": self.step.to_dict() if self.step else None,
"exception": str(self.exception),
"exception_type": "{}.{}".format(
type(self.exception).__module__, type(self.exception).__name__
),
}
def report(self):
return self._template("failure.jinja2")
| 24.993827 | 85 | 0.621141 | 446 | 4,049 | 5.399103 | 0.217489 | 0.087209 | 0.046512 | 0.021179 | 0.318937 | 0.248339 | 0.067276 | 0.067276 | 0.067276 | 0.067276 | 0 | 0.004449 | 0.27834 | 4,049 | 161 | 86 | 25.149068 | 0.819644 | 0.011361 | 0 | 0.325 | 0 | 0 | 0.03041 | 0.010555 | 0 | 0 | 0 | 0 | 0.008333 | 1 | 0.25 | false | 0.05 | 0.033333 | 0.175 | 0.541667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
1b55a8e9240889a8d97ed9b42e5e13e40d92dc9f | 561 | py | Python | anonymonkey_authority/schemas.py | hugoatease/anonymonkey-authority | aca8c1edc2b3a5a1bab5481a0a0c6e2e3099bb84 | [
"Apache-2.0"
] | null | null | null | anonymonkey_authority/schemas.py | hugoatease/anonymonkey-authority | aca8c1edc2b3a5a1bab5481a0a0c6e2e3099bb84 | [
"Apache-2.0"
] | null | null | null | anonymonkey_authority/schemas.py | hugoatease/anonymonkey-authority | aca8c1edc2b3a5a1bab5481a0a0c6e2e3099bb84 | [
"Apache-2.0"
] | null | null | null | from flask.ext.mongoengine import MongoEngine
db = MongoEngine()
class User(db.Document):
sub = db.StringField(required=True, primary_key=True)
class Survey(db.Document):
survey_id = db.StringField(required=True, primary_key=True)
name = db.StringField(required=True)
base_url = db.StringField(required=True)
owner = db.ReferenceField(User, required=True)
recipients = db.ListField(db.StringField())
class TokenBlacklist(db.Document):
survey = db.ReferenceField(Survey, required=True)
jtid = db.StringField(required=True)
| 26.714286 | 63 | 0.741533 | 70 | 561 | 5.885714 | 0.371429 | 0.203884 | 0.254854 | 0.303398 | 0.18932 | 0.18932 | 0.18932 | 0 | 0 | 0 | 0 | 0 | 0.142603 | 561 | 20 | 64 | 28.05 | 0.856549 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.076923 | 0 | 0.923077 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1b584042869515b97c32165fe9fd36a9aea11e6b | 95 | py | Python | plots/__main__.py | qftphys/-evansosenko_dichalcogenides-plots | 3674ec5b781084b87ccaf970a36d4c7d5355ff32 | [
"MIT"
] | null | null | null | plots/__main__.py | qftphys/-evansosenko_dichalcogenides-plots | 3674ec5b781084b87ccaf970a36d4c7d5355ff32 | [
"MIT"
] | null | null | null | plots/__main__.py | qftphys/-evansosenko_dichalcogenides-plots | 3674ec5b781084b87ccaf970a36d4c7d5355ff32 | [
"MIT"
] | null | null | null | from . import energy, optical
if __name__ == '__main__':
energy.main()
optical.main()
| 15.833333 | 29 | 0.652632 | 11 | 95 | 4.909091 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210526 | 95 | 5 | 30 | 19 | 0.72 | 0 | 0 | 0 | 0 | 0 | 0.084211 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1b7e8e3b1291b93295b5506b43b96aa0fa6a485f | 99 | py | Python | Program5/Program5.py | Mrcomputer1/SimplePythonPrograms | 224a3da330ed2d6227145a8f311957ffa375c37c | [
"MIT"
] | 1 | 2017-02-08T10:06:09.000Z | 2017-02-08T10:06:09.000Z | Program5/Program5.py | Mrcomputer1/SimplePythonPrograms | 224a3da330ed2d6227145a8f311957ffa375c37c | [
"MIT"
] | null | null | null | Program5/Program5.py | Mrcomputer1/SimplePythonPrograms | 224a3da330ed2d6227145a8f311957ffa375c37c | [
"MIT"
] | null | null | null | number = int(input("Pick a number? "))
for i in range(5):
number = number + number
print(number)
| 19.8 | 38 | 0.666667 | 16 | 99 | 4.125 | 0.6875 | 0.363636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012346 | 0.181818 | 99 | 4 | 39 | 24.75 | 0.802469 | 0 | 0 | 0 | 0 | 0 | 0.151515 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1bb0a615e8c2a89feeac19adfc63307afca726af | 326 | py | Python | members/views.py | ben21/projectisocbe | 75a0d2f00bd8eb2d42327b9e5df011abc43daff6 | [
"MIT"
] | null | null | null | members/views.py | ben21/projectisocbe | 75a0d2f00bd8eb2d42327b9e5df011abc43daff6 | [
"MIT"
] | null | null | null | members/views.py | ben21/projectisocbe | 75a0d2f00bd8eb2d42327b9e5df011abc43daff6 | [
"MIT"
] | 1 | 2019-07-01T07:37:18.000Z | 2019-07-01T07:37:18.000Z | from django.views.generic.edit import CreateView
from django.views.generic import TemplateView
from .models import Member
class MemberCreateView(CreateView):
model = Member
template_name = 'members/registration.html'
fields = '__all__'
class SuccessView(TemplateView):
template_name = 'members/success.html'
| 27.166667 | 48 | 0.779141 | 37 | 326 | 6.702703 | 0.594595 | 0.080645 | 0.120968 | 0.177419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141104 | 326 | 11 | 49 | 29.636364 | 0.885714 | 0 | 0 | 0 | 0 | 0 | 0.159509 | 0.076687 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1bbbb7301105d89a06adb7f692d2eacb12601ed5 | 336 | py | Python | MUNDO1/Ex005_Ant_Suc.py | KayDeVC/Python-CeV | ad65b5d35987475479795fa752f6bd1f79c9953a | [
"MIT"
] | null | null | null | MUNDO1/Ex005_Ant_Suc.py | KayDeVC/Python-CeV | ad65b5d35987475479795fa752f6bd1f79c9953a | [
"MIT"
] | null | null | null | MUNDO1/Ex005_Ant_Suc.py | KayDeVC/Python-CeV | ad65b5d35987475479795fa752f6bd1f79c9953a | [
"MIT"
] | null | null | null | print('<=== Antecessor e Sucessor ===>')
n = int(input('Digite um número:'))
na = n-1
ns = n+1
print('O número que antecede {} é {}.'.format(n, na))
print('O número que sucede {} é {}.'.format(n, ns))
print('')
print('Melhorado')
print('O número que antecede {} é {}'.format(n, n-1))
print('O número que sucede {} é {}'.format(n, n+1)) | 30.545455 | 53 | 0.60119 | 57 | 336 | 3.54386 | 0.350877 | 0.039604 | 0.237624 | 0.29703 | 0.623762 | 0.613861 | 0.594059 | 0.594059 | 0 | 0 | 0 | 0.013986 | 0.14881 | 336 | 11 | 54 | 30.545455 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0.507418 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.7 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
1bbe96b0a163e236b62e633ddbf6e0d0050e3153 | 291 | py | Python | pythonProject/026.py | MontanhaRio/python | 43ad6173d692ebeb153c23c893e4b8f0bf07afcc | [
"MIT"
] | null | null | null | pythonProject/026.py | MontanhaRio/python | 43ad6173d692ebeb153c23c893e4b8f0bf07afcc | [
"MIT"
] | null | null | null | pythonProject/026.py | MontanhaRio/python | 43ad6173d692ebeb153c23c893e4b8f0bf07afcc | [
"MIT"
] | null | null | null | #026 - Primeira e última ocorrência de uma string
frase = str(input('Digite uma frase: ')).upper().strip()
print(f'A letra A aparece {frase.count("A")}')
print(f'A primeira letra A apareeceu na posicao {frase.find("A")+1}')
print(f'A ultima letra A aparece na posicao {frase.rfind("A")+1}')
| 48.5 | 69 | 0.701031 | 51 | 291 | 4 | 0.529412 | 0.088235 | 0.102941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019608 | 0.123711 | 291 | 5 | 70 | 58.2 | 0.780392 | 0.164948 | 0 | 0 | 0 | 0 | 0.698347 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.75 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
940140db42a8d4a7e155e70b27bc5eec314f5a7b | 239 | py | Python | tests/test_sanity.py | dianakolusheva/indra_cogex | d149c6d4b7ffa5fb939badcc61684e016666153b | [
"BSD-2-Clause"
] | 2 | 2021-05-27T02:44:09.000Z | 2022-01-12T21:34:07.000Z | tests/test_sanity.py | dianakolusheva/indra_cogex | d149c6d4b7ffa5fb939badcc61684e016666153b | [
"BSD-2-Clause"
] | 33 | 2021-08-29T18:23:26.000Z | 2022-03-29T21:56:08.000Z | tests/test_sanity.py | dianakolusheva/indra_cogex | d149c6d4b7ffa5fb939badcc61684e016666153b | [
"BSD-2-Clause"
] | 5 | 2021-06-15T09:01:23.000Z | 2022-03-13T14:26:09.000Z | # -*- coding: utf-8 -*-
"""Sanity checks for testing."""
import unittest
class TestSanity(unittest.TestCase):
"""A trivial test case."""
def test_sanity(self):
"""Run a trivial test."""
self.assertIsNone(None)
| 17.071429 | 36 | 0.610879 | 28 | 239 | 5.178571 | 0.75 | 0.110345 | 0.165517 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005376 | 0.221757 | 239 | 13 | 37 | 18.384615 | 0.774194 | 0.376569 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
94086fa70a2053d3b4b9c409fe003d0cb04b9e89 | 1,912 | py | Python | monasca_analytics/ingestor/base.py | daisuke-fujita/monsaca-analytics_20181107 | 5809e66874d76bd9f102e7694197bd849210fa3b | [
"Apache-2.0"
] | 1 | 2021-03-19T04:09:04.000Z | 2021-03-19T04:09:04.000Z | monasca_analytics/ingestor/base.py | daisuke-fujita/monsaca-analytics_20181107 | 5809e66874d76bd9f102e7694197bd849210fa3b | [
"Apache-2.0"
] | 1 | 2019-01-21T09:44:29.000Z | 2019-01-21T09:44:29.000Z | monasca_analytics/ingestor/base.py | daisuke-fujita/monsaca-analytics_20181107 | 5809e66874d76bd9f102e7694197bd849210fa3b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import abc
import logging
from monasca_analytics.component import base
logger = logging.getLogger(__name__)
class BaseIngestor(base.BaseComponent):
"""Base class for all the Ingestor modules"""
def __init__(self, _id, _config):
"""Constructor with ID and configuration
:type _id: str
:param _id: ID assigned to this component
:type _config: dict
:param _config: configuration of this component
"""
self._features = None
super(BaseIngestor, self).__init__(_id, _config)
@abc.abstractmethod
def map_dstream(self, dstream):
"""Transforms the data provided by a dstream to another dstream
Abstract method to be implemented by BaseIngestor children.
The processed dstream should be returned.
:type dstream: pyspark.streaming.DStream
:param dstream: stream of data before being processed
:rtype: pyspark.streaming.DStream
:returns: stream of data after being processed
"""
pass
def set_feature_list(self, features):
"""Set the list of features
:type features: list[str]
:param features: List of features names (when extracted from the data)
"""
self._features = features
| 31.866667 | 78 | 0.697699 | 248 | 1,912 | 5.274194 | 0.544355 | 0.045872 | 0.019878 | 0.024465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005442 | 0.231172 | 1,912 | 59 | 79 | 32.40678 | 0.884354 | 0.66841 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0.076923 | 0.230769 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
940ec98ba5a83f131d711168d3c040f8b4b92cb9 | 1,251 | py | Python | tests/small/scripts/base.py | papaspiro/django-dms | 41e179e8f851c5ff6e31ec1c2ddfb1621ddf2e00 | [
"BSD-3-Clause"
] | null | null | null | tests/small/scripts/base.py | papaspiro/django-dms | 41e179e8f851c5ff6e31ec1c2ddfb1621ddf2e00 | [
"BSD-3-Clause"
] | null | null | null | tests/small/scripts/base.py | papaspiro/django-dms | 41e179e8f851c5ff6e31ec1c2ddfb1621ddf2e00 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file has been automatically generated, changes may be lost if you
# go and generate it again. It was generated with the following command:
# ./manage.py dumpscript auth
import datetime
def run():
from django.contrib.auth.models import User
auth_user_1 = User()
auth_user_1.username = u'dmsadmin'
auth_user_1.first_name = u''
auth_user_1.last_name = u''
auth_user_1.email = u''
auth_user_1.set_password('dmsadmin')
auth_user_1.is_staff = True
auth_user_1.is_active = True
auth_user_1.is_superuser = True
auth_user_1.date_joined = datetime.datetime.now()
auth_user_1.save()
auth_user_2 = User()
auth_user_2.username = u'dmsuser'
auth_user_2.first_name = u''
auth_user_2.last_name = u''
auth_user_2.email = u''
auth_user_1.set_password('dmsuser')
auth_user_2.is_staff = False
auth_user_2.is_active = True
auth_user_2.is_superuser = False
auth_user_2.date_joined = datetime.datetime.now()
auth_user_2.save()
from django.contrib.sites.models import Site
django_site_1 = Site()
django_site_1.domain = u'localhost:8000'
django_site_1.name = u'Development Server'
django_site_1.save()
| 27.8 | 72 | 0.709033 | 201 | 1,251 | 4.084577 | 0.353234 | 0.214373 | 0.131547 | 0.063337 | 0.311815 | 0.153471 | 0.153471 | 0 | 0 | 0 | 0 | 0.030632 | 0.191047 | 1,251 | 44 | 73 | 28.431818 | 0.780632 | 0.169464 | 0 | 0 | 1 | 0 | 0.060019 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.033333 | false | 0.066667 | 0.1 | 0 | 0.133333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
9436dd37c12ee9b05fe2ebf9e4a8ccbff4ac6b28 | 8,492 | py | Python | makwa/test.py | AntonKueltz/makwa | 255b37fe05a09785c86c03595586de3e9099f2f1 | [
"Unlicense"
] | 1 | 2019-03-09T06:36:05.000Z | 2019-03-09T06:36:05.000Z | makwa/test.py | AntonKueltz/makwa | 255b37fe05a09785c86c03595586de3e9099f2f1 | [
"Unlicense"
] | null | null | null | makwa/test.py | AntonKueltz/makwa | 255b37fe05a09785c86c03595586de3e9099f2f1 | [
"Unlicense"
] | null | null | null | from binascii import hexlify, unhexlify
from hashlib import sha512
from random import sample
from re import findall
from six import b
import unittest
from .makwa import Makwa, hashpw, checkpw
n = int(
'C22C40BBD056BB213AAD7C830519101AB926AE18E3E9FC9699C806E0AE5C2594'
'14A01AC1D52E873EC08046A68E344C8D74A508952842EF0F03F71A6EDC077FAA'
'14899A79F83C3AE136F774FA6EB88F1D1AEA5EA02FC0CCAF96E2CE86F3490F49'
'93B4B566C0079641472DEFC14BECCF48984A7946F1441EA144EA4C802A457550'
'BA3DF0F14C090A75FE9E6A77CF0BE98B71D56251A86943E719D27865A489566C'
'1DC57FCDEFACA6AB043F8E13F6C0BE7B39C92DA86E1D87477A189E73CE8E311D'
'3D51361F8B00249FB3D8435607B14A1E70170F9AF36784110A3F2E67428FC18F'
'B013B30FE6782AECB4428D7C8E354A0FBD061B01917C727ABEE0FE3FD3CEF761',
16
)
class MakwaTest(unittest.TestCase):
def test_spec_vector(self):
pi = unhexlify(
'4765676F206265736877616A692761616B656E20617765206D616B77613B206F6'
'E7A61616D206E616E69697A61616E697A692E'
)
sigma = unhexlify('C72703C22A96D9992F3DEA876497E392')
makwa = Makwa(work_factor=4096, pre_hashing=False)
digest = makwa._digest(pi, n, salt=sigma)
self.assertEqual(hexlify(digest), b'c9cea0e6ef09393ab1710a08')
h = makwa.hash(pi, n, salt=sigma)
self.assertEqual(h, '+RK3n5jz7gs_s211_xycDwiqW2ZkvPeqHZJfjkg_yc6g5u8JOTqxcQoI')
h = hashpw(pi, n, salt=sigma, work_factor=4096, pre_hash=False)
self.assertEqual(h, '+RK3n5jz7gs_s211_xycDwiqW2ZkvPeqHZJfjkg_yc6g5u8JOTqxcQoI')
self.assertEqual(h, '+RK3n5jz7gs_s211_xycDwiqW2ZkvPeqHZJfjkg_yc6g5u8JOTqxcQoI')
self.assertTrue(makwa.check(pi, h, n))
self.assertTrue(checkpw(pi, h, n))
self.assertFalse(makwa.check(b'password', h, n))
self.assertFalse(checkpw(b'password', h, n))
self.assertFalse(makwa.check(pi, h, 0xbadc0de))
self.assertFalse(checkpw(pi, h, 0xbadc0de))
def test_kdf_sha256(self):
m = Makwa()
matches = []
with open('kat.txt', 'r') as f:
pattern = r'KDF/SHA-256\n' \
'input: ([a-f0-9]*)\n' \
'output: ([a-f0-9]*)'
matches = findall(pattern, f.read())
for (input, output) in sample(matches, 100):
result = hexlify(m._kdf(unhexlify(input), 100))
self.assertEqual(result, b(output))
def test_kdf_sha512(self):
m = Makwa(h=sha512)
matches = []
with open('kat.txt', 'r') as f:
pattern = r'KDF/SHA-512\n' \
'input: ([a-f0-9]*)\n' \
'output: ([a-f0-9]*)'
matches = findall(pattern, f.read())
for (input, output) in sample(matches, 100):
result = hexlify(m._kdf(unhexlify(input), 100))
self.assertEqual(result, b(output))
def test_digest_sha256(self):
matches = []
with open('kat.txt', 'r') as f:
pattern = r'2048-bit modulus, SHA-256\n' \
'input: ([a-f0-9]*)\n' \
'salt: ([a-f0-9]*)\n' \
'pre-hashing: (.*)\n' \
'post-hashing: (.*)\n' \
'bin384: ([a-f0-9]*)\n' \
'bin4096: ([a-f0-9]*)'
matches = findall(pattern, f.read())
for (input, salt, pre_hashing, post_hashing, bin384, bin4096) in sample(matches, 100):
pre_hashing = (pre_hashing == 'true')
post_hashing = (None if post_hashing == 'false' else int(post_hashing))
m = Makwa(
work_factor=384,
pre_hashing=pre_hashing,
post_hashing_length=post_hashing
)
digest = m._digest(unhexlify(input), n, unhexlify(salt))
self.assertEqual(hexlify(digest), b(bin384))
m = Makwa(
work_factor=4096,
pre_hashing=pre_hashing,
post_hashing_length=post_hashing
)
digest = m._digest(unhexlify(input), n, unhexlify(salt))
self.assertEqual(hexlify(digest), b(bin4096))
def test_digest_sha512(self):
matches = []
with open('kat.txt', 'r') as f:
pattern = r'2048-bit modulus, SHA-512\n' \
'input: ([a-f0-9]*)\n' \
'salt: ([a-f0-9]*)\n' \
'pre-hashing: (.*)\n' \
'post-hashing: (.*)\n' \
'bin384: ([a-f0-9]*)\n' \
'bin4096: ([a-f0-9]*)'
matches = findall(pattern, f.read())
for (input, salt, pre_hashing, post_hashing, bin384, bin4096) in sample(matches, 100):
pre_hashing = (pre_hashing == 'true')
post_hashing = (None if post_hashing == 'false' else int(post_hashing))
m = Makwa(
h=sha512,
work_factor=384,
pre_hashing=pre_hashing,
post_hashing_length=post_hashing
)
digest = m._digest(unhexlify(input), n, unhexlify(salt))
self.assertEqual(hexlify(digest), b(bin384))
m = Makwa(
h=sha512,
work_factor=4096,
pre_hashing=pre_hashing,
post_hashing_length=post_hashing
)
digest = m._digest(unhexlify(input), n, unhexlify(salt))
self.assertEqual(hexlify(digest), b(bin4096))
def test_hashpw_sha256(self):
matches = []
with open('kat.txt', 'r') as f:
pattern = r'2048-bit modulus, SHA-256\n' \
'input: ([a-f0-9]*)\n' \
'salt: ([a-f0-9]*)\n' \
'pre-hashing: (.*)\n' \
'post-hashing: (.*)\n' \
'bin384: [a-f0-9]*\n' \
'bin4096: [a-f0-9]*\n' \
'str384: ([A-Za-z0-9\+\/\_]*)\n' \
'str4096: ([A-Za-z0-9\+\/\_]*)'
matches = findall(pattern, f.read())
for (input, salt, pre_hashing, post_hashing, str384, str4096) in sample(matches, 100):
pre_hashing = (pre_hashing == 'true')
post_hashing = (None if post_hashing == 'false' else int(post_hashing))
hashed = hashpw(
unhexlify(input),
n,
salt=unhexlify(salt),
work_factor=384,
pre_hash=pre_hashing,
post_hash=post_hashing
)
self.assertEqual(hashed, str384)
self.assertTrue(checkpw(unhexlify(input), hashed, n))
hashed = hashpw(
unhexlify(input),
n,
salt=unhexlify(salt),
work_factor=4096,
pre_hash=pre_hashing,
post_hash=post_hashing
)
self.assertEqual(hashed, str4096)
self.assertTrue(checkpw(unhexlify(input), hashed, n))
def test_hashpw_sha512(self):
matches = []
with open('kat.txt', 'r') as f:
pattern = r'2048-bit modulus, SHA-512\n' \
'input: ([a-f0-9]*)\n' \
'salt: ([a-f0-9]*)\n' \
'pre-hashing: (.*)\n' \
'post-hashing: (.*)\n' \
'bin384: [a-f0-9]*\n' \
'bin4096: [a-f0-9]*\n' \
'str384: ([A-Za-z0-9\+\/\_]*)\n' \
'str4096: ([A-Za-z0-9\+\/\_]*)'
matches = findall(pattern, f.read())
for (input, salt, pre_hashing, post_hashing, str384, str4096) in sample(matches, 100):
pre_hashing = (pre_hashing == 'true')
post_hashing = (None if post_hashing == 'false' else int(post_hashing))
hashed = hashpw(
unhexlify(input),
n,
salt=unhexlify(salt),
h=sha512,
work_factor=384,
pre_hash=pre_hashing,
post_hash=post_hashing
)
self.assertEqual(hashed, str384)
self.assertTrue(checkpw(unhexlify(input), hashed, n, h=sha512))
hashed = hashpw(
unhexlify(input),
n,
salt=unhexlify(salt),
h=sha512,
work_factor=4096,
pre_hash=pre_hashing,
post_hash=post_hashing
)
self.assertEqual(hashed, str4096)
self.assertTrue(checkpw(unhexlify(input), hashed, n, h=sha512))
if __name__ == '__main__':
unittest.main()
| 36.921739 | 94 | 0.53992 | 861 | 8,492 | 5.188153 | 0.123113 | 0.0788 | 0.017909 | 0.017909 | 0.736512 | 0.728677 | 0.690396 | 0.675173 | 0.642489 | 0.639355 | 0 | 0.133509 | 0.330546 | 8,492 | 229 | 95 | 37.082969 | 0.652243 | 0 | 0 | 0.712821 | 0 | 0 | 0.205841 | 0.103862 | 0 | 0 | 0.00212 | 0 | 0.123077 | 1 | 0.035897 | false | 0.010256 | 0.035897 | 0 | 0.076923 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 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 | 3 |
94386c96da41a9db0397204ede4d96379a8ef0b6 | 1,699 | py | Python | core/tests/test_models.py | shyam999/Django-blog | 8f59987f362be0edca4e1542f820eb0d82c7bf2c | [
"MIT"
] | 13 | 2020-04-16T14:34:07.000Z | 2021-06-22T04:27:02.000Z | core/tests/test_models.py | alexhan-sys/Django-blog | 563d1975d85b2c288d6d58b5af8d54f9ab16541e | [
"MIT"
] | 4 | 2021-03-30T13:00:21.000Z | 2022-01-13T02:30:26.000Z | core/tests/test_models.py | alexhan-sys/Django-blog | 563d1975d85b2c288d6d58b5af8d54f9ab16541e | [
"MIT"
] | 5 | 2020-04-09T18:01:45.000Z | 2021-09-06T12:47:17.000Z | from django.test import TestCase
from django.urls import reverse
from django.utils import timezone
from core.models import Category, Post
from users.models import UserProfile
from django.contrib.auth.models import User
import pytest
@pytest.mark.django_db
class CategoryTest(TestCase):
def create_category(self, title="test"):
return Category.objects.create(title=title)
def test_category_creation(self):
c = self.create_category()
self.assertTrue(isinstance(c, Category))
self.assertEqual(c.__str__(), c.title)
@pytest.mark.django_db
class PostTest(TestCase):
def setUp(self):
self.category = Category.objects.create(title='testcat', slug='testcat',)
self.user = User.objects.create_user(username="name", email="email@mail.com", password="Pass12345")
self.userprofile = UserProfile.objects.create(user=self.user, bio="great guy")
def create_post(self, title="product"):
return Post.objects.create(id=12, category=self.category, title=title, author=self.userprofile, created_date=timezone.now())
def test_post_creation(self):
p = self.create_post()
self.assertTrue(isinstance(p, Post))
self.assertEqual(p.__str__(), p.title)
@pytest.mark.django_db
class UserProfileTest(TestCase):
def setUp(self):
self.user = User.objects.create_user(username="name", email="email@mail.com", password="Pass12345")
def create_userprofile(self):
return UserProfile.objects.create(user=self.user, bio="great guy")
def test_userprofile_create(self):
u = self.create_userprofile()
self.assertTrue(isinstance(u, UserProfile))
| 35.395833 | 132 | 0.705121 | 214 | 1,699 | 5.476636 | 0.275701 | 0.077645 | 0.05802 | 0.046075 | 0.318259 | 0.261092 | 0.213311 | 0.213311 | 0.213311 | 0.213311 | 0 | 0.008571 | 0.175986 | 1,699 | 47 | 133 | 36.148936 | 0.828571 | 0 | 0 | 0.194444 | 0 | 0 | 0.057092 | 0 | 0 | 0 | 0 | 0 | 0.138889 | 1 | 0.222222 | false | 0.055556 | 0.194444 | 0.083333 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
94443729cc6ce5707eec9d93edb08c3f98c77cb5 | 3,521 | py | Python | src/api/services/event.py | massenergize/api | 0df3368cb763e9160229f48138b7706a9d0569aa | [
"MIT"
] | 2 | 2020-07-24T12:58:17.000Z | 2020-12-17T02:26:13.000Z | src/api/services/event.py | massenergize/api | 0df3368cb763e9160229f48138b7706a9d0569aa | [
"MIT"
] | 214 | 2019-06-26T17:33:54.000Z | 2022-03-26T00:02:34.000Z | src/api/services/event.py | massenergize/api | 0df3368cb763e9160229f48138b7706a9d0569aa | [
"MIT"
] | 6 | 2020-03-13T20:29:06.000Z | 2021-08-20T16:15:08.000Z | from _main_.utils.massenergize_errors import MassEnergizeAPIError
from _main_.utils.common import serialize, serialize_all
from api.store.event import EventStore
from typing import Tuple
class EventService:
"""
Service Layer for all the events
"""
def __init__(self):
self.store = EventStore()
def get_event_info(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.get_event_info(context, args)
if err:
return None, err
return serialize(event), None
def get_rsvp_list(self, context, args) -> Tuple[list, MassEnergizeAPIError]:
rsvps, err = self.store.get_rsvp_list(context, args)
if err:
return None, err
return serialize_all(rsvps), None
def get_rsvp_status(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.get_rsvp_status(context, args)
if err:
return None, err
return serialize(event), None
def rsvp_update(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.rsvp_update(context, args)
if err:
return None, err
return serialize(event), None
def rsvp_remove(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.rsvp_remove(context, args)
if err:
return None, err
return event, None
def copy_event(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.copy_event(context, args)
if err:
return None, err
return serialize(event), None
def list_recurring_event_exceptions(self, context, args) -> Tuple[list, MassEnergizeAPIError]:
exceptions, err = self.store.list_recurring_event_exceptions(context, args)
if err:
print(err)
return None, err
return exceptions, None
def update_recurring_event_date(self, context, args) -> Tuple[list, MassEnergizeAPIError]:
events, err = self.store.update_recurring_event_date(context, args)
if err:
return None, err
return serialize_all(events), None
def list_events(self, context, args) -> Tuple[list, MassEnergizeAPIError]:
events, err = self.store.list_events(context, args)
if err:
return None, err
return serialize_all(events), None
def create_event(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.create_event(context, args)
if err:
return None, err
return serialize(event), None
def update_event(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.update_event(context, args)
if err:
return None, err
return serialize(event), None
def rank_event(self, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.rank_event(args)
if err:
return None, err
return serialize(event), None
def delete_event(self, context, args) -> Tuple[dict, MassEnergizeAPIError]:
event, err = self.store.delete_event(context, args)
if err:
return None, err
return serialize(event), None
def list_events_for_community_admin(self, context, args) -> Tuple[list, MassEnergizeAPIError]:
events, err = self.store.list_events_for_community_admin(context, args)
if err:
return None, err
return serialize_all(events), None
def list_events_for_super_admin(self, context) -> Tuple[list, MassEnergizeAPIError]:
events, err = self.store.list_events_for_super_admin(context)
if err:
return None, err
return serialize_all(events), None
| 32.009091 | 96 | 0.70889 | 456 | 3,521 | 5.317982 | 0.114035 | 0.11134 | 0.074227 | 0.098969 | 0.758351 | 0.715052 | 0.678763 | 0.678763 | 0.643711 | 0.643711 | 0 | 0 | 0.193127 | 3,521 | 109 | 97 | 32.302752 | 0.853573 | 0.009088 | 0 | 0.506024 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.192771 | false | 0 | 0.048193 | 0 | 0.614458 | 0.012048 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
94467a5e7fe0e1856f3263ae2c3b47f68a350442 | 1,233 | py | Python | equipment/framework/Storage/StorageFactory.py | didacelgueta/equipment | 12cd86bfe4b70bce3e2578e3ec79fc4c0f76c322 | [
"MIT"
] | null | null | null | equipment/framework/Storage/StorageFactory.py | didacelgueta/equipment | 12cd86bfe4b70bce3e2578e3ec79fc4c0f76c322 | [
"MIT"
] | null | null | null | equipment/framework/Storage/StorageFactory.py | didacelgueta/equipment | 12cd86bfe4b70bce3e2578e3ec79fc4c0f76c322 | [
"MIT"
] | null | null | null | from equipment.framework.Config.AbstractConfig import AbstractConfig
from equipment.framework.Log.AbstractLog import AbstractLog
from equipment.framework.Storage.AbstractStorage import AbstractStorage
from equipment.framework.Storage.LocalStorage import LocalStorage
from equipment.framework.Storage.S3Storage import S3Storage
class StorageFactory(AbstractStorage):
def __init__(self, config: AbstractConfig, log: AbstractLog):
driver_name = config.get('STORAGE', 'driver')
if driver_name == 'local':
self.driver = LocalStorage(config, log)
elif driver_name == 's3':
self.driver = S3Storage(config, log)
else:
error = f'Storage driver "{driver_name}" is not supported'
log.error(error)
raise NotImplementedError(error)
def path(self, file: str) -> str:
return self.driver.path(file)
def write(self, file: str, data: str) -> bool:
return self.driver.write(file, data)
def read(self, file: str) -> str:
return self.driver.read(file)
def exists(self, file: str) -> bool:
return self.driver.exists(file)
def remove(self, file: str) -> bool:
return self.driver.remove(file)
| 35.228571 | 71 | 0.682076 | 143 | 1,233 | 5.825175 | 0.293706 | 0.084034 | 0.132053 | 0.104442 | 0.17407 | 0.146459 | 0.146459 | 0 | 0 | 0 | 0 | 0.004141 | 0.216545 | 1,233 | 34 | 72 | 36.264706 | 0.858178 | 0 | 0 | 0 | 0 | 0 | 0.054339 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.192308 | 0.192308 | 0.653846 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
9446b34dbf68519c0fc5dc82da51dad177511545 | 6,538 | py | Python | osc_lib/tests/utils/test_tags.py | dtroyer/osc-lib | 6db6492a7de5f7a3e09473c31e23e03d10f420b6 | [
"Apache-2.0"
] | null | null | null | osc_lib/tests/utils/test_tags.py | dtroyer/osc-lib | 6db6492a7de5f7a3e09473c31e23e03d10f420b6 | [
"Apache-2.0"
] | null | null | null | osc_lib/tests/utils/test_tags.py | dtroyer/osc-lib | 6db6492a7de5f7a3e09473c31e23e03d10f420b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Red Hat, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import argparse
import mock
from osc_lib.tests import utils as test_utils
from osc_lib.utils import tags
class TestTags(test_utils.TestCase):
def test_add_tag_filtering_option_to_parser(self):
parser = argparse.ArgumentParser()
tags.add_tag_filtering_option_to_parser(parser, 'test')
parsed_args = parser.parse_args(['--tags', 'tag1,tag2',
'--any-tags', 'tag4',
'--not-tags', 'tag5',
'--not-any-tags', 'tag6'])
actual = getattr(parsed_args, 'tags', [])
expected = ['tag1', 'tag2']
self.assertItemsEqual(expected, actual)
actual = getattr(parsed_args, 'any_tags', [])
expected = ['tag4']
self.assertItemsEqual(expected, actual)
actual = getattr(parsed_args, 'not_tags', [])
expected = ['tag5']
self.assertItemsEqual(expected, actual)
actual = getattr(parsed_args, 'not_any_tags', [])
expected = ['tag6']
self.assertItemsEqual(expected, actual)
def test_get_tag_filtering_args(self):
parser = argparse.ArgumentParser()
tags.add_tag_filtering_option_to_parser(parser, 'test')
parsed_args = parser.parse_args(['--tags', 'tag1,tag2',
'--any-tags', 'tag4',
'--not-tags', 'tag5',
'--not-any-tags', 'tag6'])
expected = {'tags': 'tag1,tag2', 'any_tags': 'tag4',
'not_tags': 'tag5', 'not_any_tags': 'tag6'}
args = {}
tags.get_tag_filtering_args(parsed_args, args)
self.assertEqual(expected, args)
def test_add_tag_option_to_parser_for_create(self):
parser = argparse.ArgumentParser()
tags.add_tag_option_to_parser_for_create(parser, 'test')
# Test that --tag and --no-tag are mutually exclusive
self.assertRaises(SystemExit, parser.parse_args,
['--tag', 'tag1', '--no-tag'])
parsed_args = parser.parse_args(['--tag', 'tag1'])
actual = getattr(parsed_args, 'tags', [])
expected = ['tag1']
self.assertItemsEqual(expected, actual)
parsed_args = parser.parse_args(['--no-tag'])
actual = getattr(parsed_args, 'no-tag', [])
expected = []
self.assertItemsEqual(expected, actual)
def test_add_tag_option_to_parser_for_set(self):
parser = argparse.ArgumentParser()
tags.add_tag_option_to_parser_for_set(parser, 'test')
parsed_args = parser.parse_args(['--tag', 'tag1'])
actual = getattr(parsed_args, 'tags', [])
expected = ['tag1']
self.assertItemsEqual(expected, actual)
parsed_args = parser.parse_args(['--no-tag'])
actual = getattr(parsed_args, 'no-tag', [])
expected = []
self.assertItemsEqual(expected, actual)
def test_add_tag_option_to_parser_for_unset(self):
parser = argparse.ArgumentParser()
tags.add_tag_option_to_parser_for_unset(parser, 'test')
# Test that --tag and --all-tag are mutually exclusive
self.assertRaises(SystemExit, parser.parse_args,
['--tag', 'tag1', '--all-tag'])
parsed_args = parser.parse_args(['--tag', 'tag1'])
actual = getattr(parsed_args, 'tags', [])
expected = ['tag1']
self.assertItemsEqual(expected, actual)
parsed_args = parser.parse_args(['--all-tag'])
actual = getattr(parsed_args, 'all-tag', [])
expected = []
self.assertItemsEqual(expected, actual)
def test_update_tags_for_set(self):
mock_client = mock.MagicMock()
mock_obj = mock.MagicMock()
mock_parsed_args = mock.MagicMock()
# no-tag True path
mock_parsed_args.no_tag = True
mock_parsed_args.tags = ['tag1']
mock_obj.tags = None
tags.update_tags_for_set(mock_client, mock_obj, mock_parsed_args)
mock_client.set_tags.assert_called_once_with(
mock_obj, list(mock_parsed_args.tags))
# no-tag False path
mock_client.set_tags.reset_mock()
mock_parsed_args.no_tag = False
mock_parsed_args.tags = ['tag1']
mock_obj.tags = ['tag2']
expected_list = ['tag1', 'tag2']
tags.update_tags_for_set(mock_client, mock_obj, mock_parsed_args)
mock_client.set_tags.assert_called_once_with(
mock_obj, expected_list)
# no new tags path
mock_client.set_tags.reset_mock()
mock_parsed_args.no_tag = False
mock_parsed_args.tags = None
mock_obj.tags = ['tag2']
tags.update_tags_for_set(mock_client, mock_obj, mock_parsed_args)
mock_client.set_tags.assert_not_called()
def test_update_tags_for_unset(self):
mock_client = mock.MagicMock()
mock_obj = mock.MagicMock()
mock_parsed_args = mock.MagicMock()
# No new tags
mock_obj.tags = ['tag1']
mock_parsed_args.all_tag = False
mock_parsed_args.tags = None
tags.update_tags_for_unset(mock_client, mock_obj, mock_parsed_args)
mock_client.set_tags.assert_not_called()
# Clear all tags
mock_obj.tags = ['tag1']
mock_parsed_args.all_tag = True
mock_parsed_args.tags = None
tags.update_tags_for_unset(mock_client, mock_obj, mock_parsed_args)
mock_client.set_tags.assert_called_once_with(
mock_obj, [])
# Remove one tag
mock_client.set_tags.reset_mock()
mock_obj.tags = ['tag1', 'tag2']
mock_parsed_args.all_tag = False
mock_parsed_args.tags = ['tag2']
tags.update_tags_for_unset(mock_client, mock_obj, mock_parsed_args)
mock_client.set_tags.assert_called_once_with(
mock_obj, ['tag1'])
| 38.011628 | 77 | 0.620832 | 793 | 6,538 | 4.813367 | 0.162673 | 0.104794 | 0.077024 | 0.060257 | 0.767357 | 0.747708 | 0.710768 | 0.681687 | 0.632696 | 0.601258 | 0 | 0.010013 | 0.266748 | 6,538 | 171 | 78 | 38.233918 | 0.786191 | 0.120679 | 0 | 0.655462 | 0 | 0 | 0.074236 | 0 | 0 | 0 | 0 | 0 | 0.159664 | 1 | 0.058824 | false | 0 | 0.033613 | 0 | 0.10084 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
946ea82ed582cb81b824dec3abb84ce69bba230f | 9,921 | py | Python | syncify/test_core.py | carlba/syncify | c8dfea9ca886c83fb11e1393b613276c67427cfe | [
"MIT"
] | 1 | 2020-02-26T14:44:23.000Z | 2020-02-26T14:44:23.000Z | syncify/test_core.py | carlba/syncify | c8dfea9ca886c83fb11e1393b613276c67427cfe | [
"MIT"
] | 5 | 2019-10-04T12:33:57.000Z | 2020-03-27T23:19:33.000Z | syncify/test_core.py | carlba/syncify | c8dfea9ca886c83fb11e1393b613276c67427cfe | [
"MIT"
] | null | null | null | import os
import pathlib
from click.testing import CliRunner
from syncify.core import rsync_to, rsync, store, load, extract_archive
import mock
settings = {"tarfile_output_path": "$HOME/transfer/syncify.tar.gz"}
applications = {
"transgui": {
"description": "Transmission Remote GUI",
"paths": [
{
"name": "config",
"type": "folder",
"platforms": {
"darwin": "$HOME/.config/Transmission Remote GUI"
}
}
]
},
"pycharm": {
"description": "PyCharm2020.2",
"paths": [
{
"name": "config",
"type": "folder",
"platforms": {
"darwin": "$HOME/Library/Application Support/JetBrains/PyCharm2020.2",
"linux2": None
}
}
]
},
"webstorm": {
"description": "WebStorm2020.2",
"url": "https://www.jetbrains.com/help/webstorm/directories-used-by-webstorm-to-store-settings-caches-plugins-and-logs.html",
"paths": [
{
"name": "config",
"type": "folder",
"platforms": {
"darwin": "$HOME/Library/Application Support/JetBrains/WebStorm2020.2",
"linux": None
}
}
]
},
"development": {
"description": "My development stuff",
"url": "https://github.com/carlba",
"paths": [
{
"name": "personal",
"type": "folder",
"platforms": {
"all": "$HOME/development"
}
},
{
"name": "work",
"type": "folder",
"platforms": {
"all": "$HOME/bsdev"
}
}
]
},
"iterm2": {
"description": "iTerm2",
"url": "https://https://www.iterm2.com/",
"paths": [
{
"name": "config",
"type": "file",
"platforms": {
"darwin": "$HOME/Library/Preferences/com.googlecode.iterm2.plist"
}
}
]
},
"calibre": {
"description": "Calibre",
"url": "https://manual.calibre-ebook.com/faq.html",
"paths": [
{
"name": "config",
"type": "folder",
"platforms": {
"darwin": "$HOME/Library/Preferences/calibre"
}
},
{
"name": "library",
"type": "folder",
"platforms": {
"darwin": "$HOME/Calibre Library"
}
}
]
},
"settings": {
"description": "MacOS Settings",
"url": "none",
"paths": [
{
"name": "config",
"type": "folder",
"platforms": {
"darwin": "$HOME/settings"
}
}
]
},
"hammerspoon": {
"description": "Hammerspoon settings",
"url": "none",
"paths": [
{
"name": "config",
"type": "folder",
"platforms": {
"darwin": "$HOME/.hammerspoon"
}
}
]
},
"vscode": {
"description": "VSCODE settings",
"url": "https://code.visualstudio.com/docs/getstarted/settings",
"paths": [
{
"name": "settings_file",
"type": "file",
"platforms": {
"darwin": "$HOME/Library/Application Support/Code/User/settings.json",
"linux2": "$HOME/.config/Code/User/settings.json"
}
},
{
"name": "workspace",
"type": "folder",
"platforms": {
"darwin": "$HOME/.vscode",
"linux2": "$HOME/.vscode"
}
}
]
}
}
settings = {
"tarfile_output_path": "$HOME/gdrive/transfer/syncify.tar.gz"
}
def test_folder_is_synced_properly(mocker):
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
rsync_to(pathlib.Path('/users/cbackstrom/.config/syncify/development_personal'),
pathlib.Path('/users/cbackstrom/development'), 'folder', False)
args, kwargs = patched_rsync.call_args
assert args[3] == '/users/cbackstrom/.config/syncify/development_personal/'
assert args[4] == '/users/cbackstrom/development'
def test_file_is_synced_properly(mocker):
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
rsync_to(pathlib.Path('/users/cbackstrom/.config/syncify/development_personal/settings.json'),
pathlib.Path('/users/cbackstrom/development/settings.json'), 'file', False)
args, kwargs = patched_rsync.call_args
assert args[3] == '/users/cbackstrom/.config/syncify/development_personal/settings.json'
assert args[4] == '/users/cbackstrom/development/'
def test_file_is_synced_properly_other_way(mocker):
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
rsync_to(pathlib.Path('/users/cbackstrom/development/settings.json'),
pathlib.Path('/users/cbackstrom/.config/syncify/development_personal/settings.json'), 'file', False)
args, kwargs = patched_rsync.call_args
assert args[3] == '/users/cbackstrom/development/settings.json'
assert args[4] == '/users/cbackstrom/.config/syncify/development_personal/'
def test_it_is_not_possible_to_store_non_defined_app(mocker):
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
mocker.patch('syncify.core.extract_archive', return_value=None)
mocker.patch('syncify.core.read_applications', return_value=applications)
runner = CliRunner()
result = runner.invoke(load, ['NonExistingApp'],
obj={'output_path': '$HOME/.config/syncify', 'dry_run': False})
assert f'Application NonExistingApp is not defined' in result.output
patched_rsync.assert_not_called()
def test_it_is_not_possible_to_load_non_defined_app(mocker):
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
mocker.patch('syncify.core.read_applications', return_value=applications)
mocker.patch('syncify.core.extract_archive', return_value=None)
runner = CliRunner()
result = runner.invoke(load, ['NonExistingApp'],
obj={'output_path': '$HOME/.config/syncify', 'dry_run': False})
assert f'Application NonExistingApp is not defined' in result.output
patched_rsync.assert_not_called()
def test_loading_folder(mocker):
application_name = 'pycharm'
application = applications[application_name]
application_path = application['paths'][0]
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
mocker.patch('syncify.core.read_applications', return_value=applications)
mocker.patch('syncify.core.extract_archive', return_value=None)
runner = CliRunner()
result = runner.invoke(load, [application_name],
obj={'output_path': '$HOME/.config/syncify', 'dry_run': False})
args, kwargs = patched_rsync.call_args
assert args[3] == os.path.expandvars(os.path.expanduser(f'$HOME/.config/syncify/{application_name}_{application_path["name"]}')) + '/'
assert args[4] == os.path.expandvars(os.path.expanduser(application_path['platforms']['darwin']))
def test_loading_file(mocker):
application_name = 'iterm2'
application = applications[application_name]
application_path = application['paths'][0]
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
mocker.patch('syncify.core.read_applications', return_value=applications)
mocker.patch('syncify.core.extract_archive', return_value=None)
runner = CliRunner()
result = runner.invoke(load, [application_name],
obj={'output_path': '$HOME/.config/syncify', 'dry_run': False})
args, kwargs = patched_rsync.call_args
assert args[3] == os.path.expandvars(os.path.expanduser(f'$HOME/.config/syncify/{application_name}_{application_path["name"]}/com.googlecode.iterm2.plist'))
assert args[4] == os.path.expandvars(os.path.expanduser(os.path.dirname(application_path['platforms']['darwin']))) + '/'
def test_storing_folder(mocker):
application_name = 'pycharm'
application = applications[application_name]
application_path = application['paths'][0]
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
mocker.patch('syncify.core.read_applications', return_value=applications)
mocker.patch('syncify.core.extract_archive', return_value=None)
mocker.patch('syncify.core.compress', return_value=None)
runner = CliRunner()
result = runner.invoke(store, [application_name],
obj={'output_path': '$HOME/.config/syncify', 'dry_run': False})
args, kwargs = patched_rsync.call_args
assert args[3] == os.path.expandvars(os.path.expanduser(application_path['platforms']['darwin'])) + '/'
assert args[4] == os.path.expandvars(os.path.expanduser(f'$HOME/.config/syncify/{application_name}_{application_path["name"]}'))
def test_storing_file(mocker):
application_name = 'iterm2'
application = applications[application_name]
application_path = application['paths'][0]
patched_rsync = mocker.patch('syncify.core.rsync', return_value=None)
mocker.patch('syncify.core.read_applications', return_value=applications)
mocker.patch('syncify.core.extract_archive', return_value=None)
mocker.patch('syncify.core.compress', return_value=None)
runner = CliRunner()
runner.invoke(store, [application_name],
obj={'output_path': '$HOME/.config/syncify', 'dry_run': False})
args, kwargs = patched_rsync.call_args
assert args[3] == os.path.expandvars(os.path.expanduser(application_path['platforms']['darwin']))
assert args[4] == os.path.expandvars(os.path.expanduser(f'$HOME/.config/syncify/{application_name}_{application_path["name"]}')) + '/'
def test_extracting_rar(mocker):
patched_tar: mock.Mock = mocker.patch('syncify.core.tar', return_value=None)
os_chdir: mock.Mock = mocker.patch('os.chdir', return_value=None)
extract_archive('/tmp/output', '/tmp/test.tar.gz')
os_chdir.assert_any_call('/tmp')
patched_tar.assert_called_once_with('-xzf', '/tmp/test.tar.gz')
| 31.100313 | 160 | 0.635924 | 1,067 | 9,921 | 5.746017 | 0.134958 | 0.044854 | 0.070462 | 0.08612 | 0.784538 | 0.745718 | 0.719295 | 0.696624 | 0.686511 | 0.677703 | 0 | 0.006093 | 0.205927 | 9,921 | 318 | 161 | 31.198113 | 0.77215 | 0 | 0 | 0.416 | 0 | 0.008 | 0.363407 | 0.179435 | 0 | 0 | 0 | 0 | 0.08 | 1 | 0.04 | false | 0 | 0.02 | 0 | 0.06 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
847ea61ad08afa80de05a6f08c80ba5877160653 | 237 | py | Python | smp_base/__init__.py | x75/smp_base | a5df0a37169ef5fc5fb9c08d140b8b1ee549022a | [
"MIT"
] | 7 | 2017-06-22T07:39:28.000Z | 2021-08-11T10:06:24.000Z | smp_base/__init__.py | x75/smp_base | a5df0a37169ef5fc5fb9c08d140b8b1ee549022a | [
"MIT"
] | 2 | 2017-06-25T16:59:04.000Z | 2019-04-08T13:31:17.000Z | smp_base/__init__.py | x75/smp_base | a5df0a37169ef5fc5fb9c08d140b8b1ee549022a | [
"MIT"
] | 4 | 2017-06-25T16:33:20.000Z | 2018-06-22T18:42:41.000Z | """smp_base/__init__.py
.. todo::
remove actinf tag from base learners
.. todo::
abstract class from andi / smp_control to check for api conformity?
.. todo::
for module in rlspy igmm kohonone otl ; do git submodule ...
"""
| 18.230769 | 70 | 0.679325 | 34 | 237 | 4.558824 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.21097 | 237 | 12 | 71 | 19.75 | 0.828877 | 0.966245 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.25 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8483b2e38eb24daa434831ab7b8ac9121ce466ee | 331 | py | Python | lib/evaluation/__init__.py | Alex1114/Zero-Shot-HOI | 09384260fc3d3df47bbd3ae0e2132e329f9186d4 | [
"MIT"
] | 37 | 2020-05-17T06:41:58.000Z | 2022-02-24T22:08:39.000Z | lib/evaluation/__init__.py | Alex1114/Zero-Shot-HOI | 09384260fc3d3df47bbd3ae0e2132e329f9186d4 | [
"MIT"
] | 12 | 2020-06-29T08:12:31.000Z | 2022-01-02T07:02:33.000Z | lib/evaluation/__init__.py | Alex1114/Zero-Shot-HOI | 09384260fc3d3df47bbd3ae0e2132e329f9186d4 | [
"MIT"
] | 9 | 2020-07-03T05:44:17.000Z | 2021-12-01T08:24:51.000Z | from .vcoco_evaluation import VCOCOEvaluator
from .hico_evaluation import HICOEvaluator
from detectron2.evaluation.evaluator import DatasetEvaluator, DatasetEvaluators, inference_on_dataset
from detectron2.evaluation.testing import print_csv_format, verify_results
__all__ = [k for k in globals().keys() if not k.startswith("_")]
| 47.285714 | 101 | 0.8429 | 41 | 331 | 6.512195 | 0.707317 | 0.11985 | 0.179775 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006645 | 0.090634 | 331 | 6 | 102 | 55.166667 | 0.880399 | 0 | 0 | 0 | 0 | 0 | 0.003021 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.8 | 0 | 0.8 | 0.2 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
848837b79db84cc5164466f468155b31ba48468a | 166 | py | Python | graphene_neo4j/rest_framework/models.py | Usama0121/graphene-neo4j | 8d8c5a106b3d41851516eb7334d4f9beb8bb301c | [
"MIT"
] | 8 | 2020-01-18T20:52:16.000Z | 2022-03-18T02:28:09.000Z | graphene_neo4j/rest_framework/models.py | Usama0121/graphene-neo4j | 8d8c5a106b3d41851516eb7334d4f9beb8bb301c | [
"MIT"
] | 6 | 2021-03-19T09:07:56.000Z | 2022-02-10T09:25:41.000Z | graphene_neo4j/rest_framework/models.py | Usama0121/graphene-neo4j | 8d8c5a106b3d41851516eb7334d4f9beb8bb301c | [
"MIT"
] | 4 | 2019-06-10T19:33:32.000Z | 2020-01-30T20:08:04.000Z | from django.db import models
class MyFakeModel(models.Model):
cool_name = models.CharField(max_length=50)
created = models.DateTimeField(auto_now_add=True)
| 23.714286 | 53 | 0.777108 | 23 | 166 | 5.434783 | 0.869565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013889 | 0.13253 | 166 | 6 | 54 | 27.666667 | 0.854167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8498c1a8be97753ad5dff5fb2016b86f18e96750 | 41 | py | Python | WebApp/controller/__init__.py | litrin/Tornado-Fram-Work | 0b88c2340f46a7b9a2a0bc5baaabe0d38d84553e | [
"BSD-3-Clause"
] | 1 | 2016-03-07T00:16:03.000Z | 2016-03-07T00:16:03.000Z | WebApp/controller/__init__.py | litrin/Tornado-Fram-Work | 0b88c2340f46a7b9a2a0bc5baaabe0d38d84553e | [
"BSD-3-Clause"
] | null | null | null | WebApp/controller/__init__.py | litrin/Tornado-Fram-Work | 0b88c2340f46a7b9a2a0bc5baaabe0d38d84553e | [
"BSD-3-Clause"
] | null | null | null |
__all__ = ['cFRIENDSEARCH', 'cDEFAULT']
| 41 | 41 | 0.682927 | 3 | 41 | 8 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121951 | 41 | 1 | 41 | 41 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0.525 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
84b95463e43af6615fe81e2b42e552ff8218e199 | 307 | py | Python | ML_CW1/assgn_1_part_2/1_logistic_regression/load_data_ex1.py | ShellySrivastava/Machine-Learning | bfdea30c06abe4228c103ae525adcf990015983f | [
"MIT"
] | null | null | null | ML_CW1/assgn_1_part_2/1_logistic_regression/load_data_ex1.py | ShellySrivastava/Machine-Learning | bfdea30c06abe4228c103ae525adcf990015983f | [
"MIT"
] | null | null | null | ML_CW1/assgn_1_part_2/1_logistic_regression/load_data_ex1.py | ShellySrivastava/Machine-Learning | bfdea30c06abe4228c103ae525adcf990015983f | [
"MIT"
] | null | null | null | import numpy as np
def load_data_ex1():
#loads data for exercise 2
# read our input data
X = np.loadtxt("ex4x.dat", comments="#", delimiter=",", unpack=False)
# read groundtruth labels
y = np.loadtxt("ex4y.dat", comments="#", delimiter=",", unpack=False)
return X, y
| 23.615385 | 73 | 0.609121 | 41 | 307 | 4.512195 | 0.682927 | 0.097297 | 0.216216 | 0.281081 | 0.335135 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017241 | 0.2443 | 307 | 12 | 74 | 25.583333 | 0.780172 | 0.224756 | 0 | 0 | 0 | 0 | 0.085106 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
84d158cf7eac1632f76d16bf261c9c8e748891cc | 166 | py | Python | src/python/doc/python3-sphinx-build.py | jmarino/gudhi-devel | b1824e4de6fd1d037af3c1341c3065731472ffc8 | [
"MIT"
] | 2 | 2020-01-27T03:32:18.000Z | 2021-03-14T21:14:14.000Z | src/python/doc/python3-sphinx-build.py | jmarino/gudhi-devel | b1824e4de6fd1d037af3c1341c3065731472ffc8 | [
"MIT"
] | 1 | 2020-08-25T16:03:23.000Z | 2020-08-28T07:36:21.000Z | src/python/doc/python3-sphinx-build.py | jmarino/gudhi-devel | b1824e4de6fd1d037af3c1341c3065731472ffc8 | [
"MIT"
] | 2 | 2019-11-06T12:36:23.000Z | 2020-08-25T14:53:13.000Z | #!/usr/bin/env python3
"""
Emulate sphinx-build for python3
"""
from sys import exit, argv
from sphinx import main
if __name__ == '__main__':
exit(main(argv))
| 13.833333 | 32 | 0.692771 | 24 | 166 | 4.458333 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014599 | 0.174699 | 166 | 11 | 33 | 15.090909 | 0.766423 | 0.325301 | 0 | 0 | 0 | 0 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
84f23916fcd27d2b2ff4e25588384340e8ccf557 | 350 | py | Python | api/migrations/versions/865b2e2d02ff_.py | cclauss/Baobab | e7aad3a63237be5f16e6441b89b3cc708ec19acd | [
"Apache-2.0"
] | 52 | 2019-01-10T16:04:26.000Z | 2022-02-10T00:55:59.000Z | api/migrations/versions/865b2e2d02ff_.py | cclauss/Baobab | e7aad3a63237be5f16e6441b89b3cc708ec19acd | [
"Apache-2.0"
] | 535 | 2019-01-08T21:24:01.000Z | 2022-02-27T15:24:06.000Z | api/migrations/versions/865b2e2d02ff_.py | cclauss/Baobab | e7aad3a63237be5f16e6441b89b3cc708ec19acd | [
"Apache-2.0"
] | 36 | 2019-01-10T16:09:15.000Z | 2021-06-28T21:02:47.000Z | """empty message
Revision ID: 865b2e2d02ff
Revises: ('866611669529', 'cb391b878586')
Create Date: 2019-07-03 18:44:00.470730
"""
# revision identifiers, used by Alembic.
revision = '865b2e2d02ff'
down_revision = ('866611669529', 'cb391b878586')
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
def downgrade():
pass
| 15.217391 | 48 | 0.722857 | 42 | 350 | 6 | 0.761905 | 0.190476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.258503 | 0.16 | 350 | 22 | 49 | 15.909091 | 0.598639 | 0.462857 | 0 | 0.25 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.25 | 0.25 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
84febcf8b229ebc8a8e433a595456cee480059d0 | 595 | py | Python | correlation/__init__.py | boldenth/correlation | aee2c5c9d36c65f8d60c10931ed2ffec66cf7f0f | [
"MIT"
] | null | null | null | correlation/__init__.py | boldenth/correlation | aee2c5c9d36c65f8d60c10931ed2ffec66cf7f0f | [
"MIT"
] | null | null | null | correlation/__init__.py | boldenth/correlation | aee2c5c9d36c65f8d60c10931ed2ffec66cf7f0f | [
"MIT"
] | null | null | null | """
correlation imports
"""
#=============================================================================#
#
#
#
#=============================================================================#
__version__ = "0.3"
import numpy
import pandas
import scipy
import sklearn
#import matplotlib.pyplot as plt
from correlation.container import Container
from correlation.io.converter import \
convert_file, \
convert_time
from correlation.io.conversions import \
_si_time, \
_si_len
from correlation.analysis.api import \
linear_regression, \
MakeDecision
| 15.25641 | 79 | 0.521008 | 49 | 595 | 6.102041 | 0.591837 | 0.200669 | 0.113712 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004008 | 0.161345 | 595 | 38 | 80 | 15.657895 | 0.59519 | 0.34958 | 0 | 0 | 0 | 0 | 0.008174 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.533333 | 0 | 0.533333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1700c366be6bae6bfda66c6c163088409d38d0dd | 7,291 | py | Python | examples/parking.py | MissMeriel/BeamNGpy | a8467c57537441802bc5b56f0012dfee2b5f5af0 | [
"MIT"
] | 1 | 2021-08-10T19:29:52.000Z | 2021-08-10T19:29:52.000Z | examples/parking.py | MissMeriel/BeamNGpy | a8467c57537441802bc5b56f0012dfee2b5f5af0 | [
"MIT"
] | null | null | null | examples/parking.py | MissMeriel/BeamNGpy | a8467c57537441802bc5b56f0012dfee2b5f5af0 | [
"MIT"
] | null | null | null | import mmap
import random
import sys
from time import sleep
import numpy as np
from beamngpy import BeamNGpy, Scenario, Vehicle, setup_logging, ScenarioObject
from beamngpy.sensors import Lidar
def generate_script():
# Create the script
script = list()
points = list()
point_colors = list()
spheres = list()
sphere_colors = list()
# Hardcoded traj
traj = [[-499.55,238.29,102.01], [-504.67,232.95,102.06], [-510.00,227.36,102.09], [-515.57,221.53,102.12], [-522.3,214.45,102.17], [-526.53,207.74,102.18], [-529.22,207.19,102.24], [-531.59,208.04,102.28], [-533.72,209.82,102.31], [-535.93, 211.59, 102.31], [-537.26,212.84, 102.4]]
t = 1
for p in traj:
node = {'x': p[0], 'y':p[1], 'z': p[2], 't': t}
t += 1
script.append(node)
points.append([node['x'], node['y'], node['z']])
point_colors.append([0, 1, 0, 0.1])
spheres.append([node['x'], node['y'], node['z'], 0.25])
sphere_colors.append([1, 0, 0, 0.8])
# Return data
return script, points, point_colors, spheres, sphere_colors
def load_locations(filename):
# Open the file
with open(filename) as f:
# Read the line
contents = f.read()
lines = contents.split()
# Holds the results
result = []
# Holds the individual location
individual_location = []
# For each line
line_count = 0
for line in lines:
# Ignore the count, only worry about x,y,z
if line_count % 4 != 0:
# Process the file to get the x,y and z co-oridinates
line = line[2:]
line = line.replace(',',"")
individual_location.append(float(line))
else:
# Save result and reset
if len(individual_location) > 0:
result.append(individual_location)
individual_location = []
# Increment line count
line_count += 1
# Return results
return result
def load_vehicle_types(filename):
# Open the file
with open(filename) as f:
# Read the line
contents = f.read()
lines = contents.split()
# Holds the results
result = []
# For each line
for line in lines:
result.append(line)
# Return results
return result
def create_lidar(viz="physcov"):
lidar = Lidar()
if viz == "physcov":
lidar.__init__(offset=(2.4, 1, 1), direction=(-0.707, -0.707, 0), vres=2,
vangle=0.1, rps=10000, hz=60, angle=180, max_dist=200,
visualized=True)
elif viz == "physcovthick":
lidar.__init__(offset=(2.4, 1, 1), direction=(-0.707, -0.707, 0), vres=2,
vangle=0.1, rps=2200000, hz=60, angle=180, max_dist=200,
visualized=True)
elif viz == "roof":
lidar.__init__(offset=(0, 0, 1.7), direction=(-0.707, -0.707, 0), vres=32,
vangle=0.01, rps=2200000, hz=20, angle=360, max_dist=200,
visualized=True)
elif viz == "default":
lidar.__init__(offset=(0, 0, 1.7), direction=(0, -1, 0), vres=32,
vangle=26.9, rps=2200000, hz=20, angle=360, max_dist=200,
visualized=True)
else: # no viz
lidar = Lidar(offset=(0, 0, 1.6), visualized=False)
return lidar
def main():
number_parked_vehicles = 5
# random.seed(1703)
setup_logging()
beamng = BeamNGpy('localhost', 64256, home='H:/BeamNG.research.v1.7.0.1clean')
bng = beamng.open(launch=True)
# Create a scenario in west_coast_usa
scenario = Scenario("west_coast_usa", 'tech_test', description='Random driving for research')
# https://documentation.beamng.com/vehicle_system/vehicles/index.html
vehicle = Vehicle('ego_vehicle', model='hatch', licence='Big C', color='Red')
# Create sensors
lidar = create_lidar("physcovthick") # physcov, physcovthick, default, no viz
vehicle.attach_sensor('lidar', lidar)
# Add the vehicle
scenario.add_vehicle(vehicle, pos=(-496.16, 241.5, 102), rot=None, rot_quat=(0, 0, 0.258819, 0.9659258))
# Compile the scenario and place it in BeamNG's map folder
scenario.make(bng)
# Get the parking locations and vehicle types
parking_locations = load_locations("all_parking_locations.txt")
vehicle_types = load_vehicle_types("car_types.txt")
orientations = [[0.423, -0.906], [0.940, 0.342]]
# Add the objects
if number_parked_vehicles > -1:
parking_locations = random.sample(parking_locations, number_parked_vehicles)
for i in range(len(parking_locations)):
# Randomly select a car type
vehicle_type = random.choice(vehicle_types)
# Get an orientation
orient = random.choice(orientations)
# Get the car position
x, y, z = parking_locations[i]
z += 0.1
# Create the object
scenario_obj = ScenarioObject(oid='car' + str(i), name=vehicle_type, otype='BeamNGVehicle', pos=(x, y, z), rot=None, rot_quat=(0, 0, orient[0], orient[1]), scale=(1, 1, 1), JBeam = vehicle_type, datablock="default_vehicle")
# Add an object
scenario.add_object(scenario_obj)
scenario.make(beamng)
# Start BeamNG and enter the main loop
try:
bng.hide_hud()
bng.set_deterministic() # Set simulator to be deterministic
bng.set_steps_per_second(60) # With 60hz temporal resolution
# Load and start the scenario
bng.load_scenario(scenario)
bng.start_scenario()
# file1 = open("parking_locations.txt","w")
# keep track of the number of parking spots checked
parking_counter = 1
was_pressed = False
# Generate a vehicle script
script, points, point_colors, spheres, sphere_colors = generate_script()
# bng.add_debug_line(points, point_colors, spheres=spheres, sphere_colors=sphere_colors, cling=True, offset=0.1)
vehicle.ai_set_script(script)
vehicle.ai_set_speed(100, mode='limit')
vehicle.ai_set_aggression(0.2)
while True:
# # Retrieve sensor data and show the camera data.
# vehicle.poll_sensors()
# sensors = vehicle.sensors
#
# # Get the current vehicle position
# current_x, current_y, current_z = np.round(sensors["state"].data["pos"], 4)
#
# # print("-----------------------------")
# # current_x, current_y, current_z = np.round(sensors["state"].data["pos"], 4)
# # print("Position {}, {}".format(current_x, current_y))
# # file1.write("x:{}, y:{}, z:{}\n".format(current_x, current_y, current_z))
# # print("-----------------------------")
vehicle.update_vehicle()
sensors = bng.poll_sensors(vehicle)
state = vehicle.state
print("-----------------------------")
print("SENSORS:\n{}".format(sensors))
print("VEHICLE STATE:\n{}".format(state))
print("-----------------------------")
finally:
bng.close()
# file1.close()
if __name__ == '__main__':
main() | 7,291 | 7,291 | 0.578796 | 943 | 7,291 | 4.342524 | 0.325557 | 0.004884 | 0.007326 | 0.019536 | 0.229792 | 0.20928 | 0.195604 | 0.160195 | 0.160195 | 0.146032 | 0 | 0.075104 | 0.274997 | 7,291 | 1 | 7,291 | 7,291 | 0.699584 | 0.225072 | 0 | 0.201681 | 0 | 0 | 0.062623 | 0.020576 | 0 | 0 | 0 | 0 | 0 | 1 | 0.042017 | false | 0 | 0.058824 | 0 | 0.134454 | 0.033613 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ca27fd990f211610d8b8b82e2eb57c25d110e2a8 | 89 | py | Python | saturpy/regressor/__init__.py | sciencedt/saturpy | 7edd20988ee550b4441053bbb6aae90dfbd80fb5 | [
"Apache-2.0"
] | 1 | 2020-05-30T16:12:43.000Z | 2020-05-30T16:12:43.000Z | saturpy/regressor/__init__.py | sciencedt/saturpy | 7edd20988ee550b4441053bbb6aae90dfbd80fb5 | [
"Apache-2.0"
] | null | null | null | saturpy/regressor/__init__.py | sciencedt/saturpy | 7edd20988ee550b4441053bbb6aae90dfbd80fb5 | [
"Apache-2.0"
] | null | null | null | """
Regressor init
"""
from .ols import LinearRegression
__all__ = ['LinearRegression']
| 12.714286 | 33 | 0.730337 | 8 | 89 | 7.625 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.134831 | 89 | 6 | 34 | 14.833333 | 0.792208 | 0.157303 | 0 | 0 | 0 | 0 | 0.238806 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ca3b905a4ae5275b60b3359f56881b2b9208baf5 | 936 | py | Python | setup.py | irvingleonard/simplifiedapp | aeb3353df1d5110f0cd4ae33465bc9a2f0190173 | [
"BSD-2-Clause"
] | null | null | null | setup.py | irvingleonard/simplifiedapp | aeb3353df1d5110f0cd4ae33465bc9a2f0190173 | [
"BSD-2-Clause"
] | 13 | 2020-07-03T20:09:05.000Z | 2022-02-28T23:35:56.000Z | setup.py | irvingleonard/simplifiedapp | aeb3353df1d5110f0cd4ae33465bc9a2f0190173 | [
"BSD-2-Clause"
] | 1 | 2021-08-30T22:19:02.000Z | 2021-08-30T22:19:02.000Z | #!python
"""A setuptools based setup module.
ToDo:
- Everything
"""
import setuptools
import simplifiedapp
setuptools.setup(
url = 'https://github.com/irvingleonard/simplifiedapp',
author = 'Irving Leonard',
author_email = 'irvingleonard@gmail.com',
license='BSD 2-Clause "Simplified" License',
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords = 'cli main setuptools',
python_requires = '>=3.6',
packages = setuptools.find_packages(),
**simplifiedapp.object_metadata(simplifiedapp)
) | 26.742857 | 65 | 0.699786 | 94 | 936 | 6.925532 | 0.638298 | 0.087558 | 0.115207 | 0.079877 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007585 | 0.154915 | 936 | 35 | 66 | 26.742857 | 0.815424 | 0.064103 | 0 | 0 | 0 | 0 | 0.611494 | 0.026437 | 0 | 0 | 0 | 0.028571 | 0 | 1 | 0 | true | 0 | 0.08 | 0 | 0.08 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ca49c16bfc0a980a3465baa1f87adb02fe7ede34 | 1,954 | py | Python | yuansfer/client.py | yuansfer/yuansfer-python-sdk | 4ec2b396ef093d79975dc8f86faeb48b274212da | [
"MIT"
] | null | null | null | yuansfer/client.py | yuansfer/yuansfer-python-sdk | 4ec2b396ef093d79975dc8f86faeb48b274212da | [
"MIT"
] | null | null | null | yuansfer/client.py | yuansfer/yuansfer-python-sdk | 4ec2b396ef093d79975dc8f86faeb48b274212da | [
"MIT"
] | 1 | 2021-05-17T13:40:39.000Z | 2021-05-17T13:40:39.000Z | from yuansfer.decorators import lazy_property
from yuansfer.configuration import Configuration
from yuansfer.api.online_api import OnlineApi
from yuansfer.api.offline_api import OfflineApi
from yuansfer.api.mobile_api import MobileApi
from yuansfer.api.data_search_api import DataSearchApi
from yuansfer.api.payout_api import PayoutApi
from yuansfer.api.recurring_api import RecurringApi
from yuansfer.api.customer_api import CustomerApi
from yuansfer.api.auth_api import AuthApi
from yuansfer.exception import RequireParamsError
class Client(object):
@staticmethod
def sdk_version():
return '3.0.1'
@staticmethod
def yuansfer_version():
return 'V3'
@lazy_property
def online(self):
return OnlineApi(self.config)
@lazy_property
def offline(self):
return OfflineApi(self.config)
@lazy_property
def auth(self):
return AuthApi(self.config)
@lazy_property
def recurring(self):
return RecurringApi(self.config)
@lazy_property
def mobile(self):
return MobileApi(self.config)
@lazy_property
def payout(self):
return PayoutApi(self.config)
@lazy_property
def customer(self):
return CustomerApi(self.config)
@lazy_property
def data_search(self):
return DataSearchApi(self.config)
def __init__(self, timeout=60, max_retries=3, merchantNo=None,
environment='production', storeNo=None, token=None):
if (merchantNo or storeNo or token) is None:
raise RequireParamsError('Configs')
else:
self.config = Configuration(timeout=timeout,
max_retries=max_retries,
environment=environment,
merchantNo=merchantNo,
storeNo=storeNo,
token=token) | 30.061538 | 69 | 0.648414 | 208 | 1,954 | 5.956731 | 0.278846 | 0.106538 | 0.096852 | 0.124294 | 0.141243 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005004 | 0.284033 | 1,954 | 65 | 70 | 30.061538 | 0.880629 | 0 | 0 | 0.188679 | 0 | 0 | 0.012276 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.207547 | false | 0 | 0.207547 | 0.188679 | 0.622642 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ca4e89c34ff1a6dc52c389d6a2eb20a185069771 | 6,352 | py | Python | TinyImagenet/data_load_storeu_multi.py | yjhuangcd/local-lipschitz | f3c109ab81def14f20c0fadd25bb5ac91d9f03c8 | [
"MIT"
] | 15 | 2021-11-02T08:09:53.000Z | 2022-03-26T09:56:15.000Z | TinyImagenet/data_load_storeu_multi.py | yjhuangcd/local-lipschitz | f3c109ab81def14f20c0fadd25bb5ac91d9f03c8 | [
"MIT"
] | 1 | 2021-12-06T23:21:39.000Z | 2021-12-10T21:47:42.000Z | TinyImagenet/data_load_storeu_multi.py | yjhuangcd/local-lipschitz | f3c109ab81def14f20c0fadd25bb5ac91d9f03c8 | [
"MIT"
] | 2 | 2022-02-24T02:22:27.000Z | 2022-02-24T08:18:41.000Z | ### basic modules
import numpy as np
import time, pickle, os, sys, json, PIL, tempfile, warnings, importlib, math, copy, shutil, setproctitle
### torch modules
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR, MultiStepLR
import torch.nn.functional as F
from torch import autograd
from torch.utils.data import Dataset, DataLoader, TensorDataset
from torch.optim.lr_scheduler import StepLR, MultiStepLR
import torch.utils.data.distributed
# data loader that returns indices of images
class MyDataset(Dataset):
def __init__(self, trainset):
self.set = trainset
def __getitem__(self, index):
data, target = self.set[index]
return data, target, index
def __len__(self):
return len(self.set)
def data_loaders(data, batch_size, test_batch_size, augmentation=False, normalization=False, drop_last=False, shuffle=True):
if not os.path.exists('data/'):
os.makedirs('data/')
if data == 'cifar10':
if augmentation and normalization:
trainset_transforms = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.485, 0.456, 0.406), (0.225, 0.225, 0.225))])
trainset = datasets.CIFAR10(root='data/', train=True, download=True, transform=trainset_transforms)
testset = datasets.CIFAR10(root='data/', train=False, download=True, transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.485, 0.456, 0.406), (0.225, 0.225, 0.225))]))
elif augmentation and not(normalization):
trainset_transforms = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor()])
trainset = datasets.CIFAR10(root='data/', train=True, download=True, transform=trainset_transforms)
testset = datasets.CIFAR10(root='data/', train=False, download=True, transform=transforms.Compose([
transforms.ToTensor()]))
else:
trainset = datasets.CIFAR10(root='data/', train=True, download=True, transform=transforms.ToTensor())
testset = datasets.CIFAR10(root='data/', train=False, download=True, transform=transforms.ToTensor())
if data == 'mnist':
trainset = datasets.MNIST(root='data/', train=True, download=True, transform=transforms.ToTensor())
testset = datasets.MNIST(root='data/', train=False, download=True, transform=transforms.ToTensor())
if data == 'tinyimagenet':
if augmentation and normalization:
trainset_transforms = transforms.Compose([
transforms.RandomCrop(64, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])])
trainset = datasets.ImageFolder(root='data/tiny-imagenet-200/train', transform=trainset_transforms)
testset = datasets.ImageFolder(root='data/tiny-imagenet-200/val', transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])]))
elif not augmentation and normalization:
trainset_transforms = transforms.Compose([
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])])
testset_transforms = transforms.Compose([
transforms.ToTensor()])
trainset = datasets.ImageFolder(root='data/tiny-imagenet-200/train', transform=trainset_transforms)
testset = datasets.ImageFolder(root='data/tiny-imagenet-200/val', transform=testset_transforms)
elif augmentation and not normalization:
trainset_transforms = transforms.Compose([
transforms.RandomCrop(64, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor()])
testset_transforms = transforms.Compose([
transforms.ToTensor()])
trainset = datasets.ImageFolder(root='data/tiny-imagenet-200/train', transform=trainset_transforms)
testset = datasets.ImageFolder(root='data/tiny-imagenet-200/val', transform=testset_transforms)
elif not augmentation and not normalization:
trainset_transforms = transforms.Compose([
transforms.RandomHorizontalFlip(),
transforms.ToTensor()])
testset_transforms = transforms.Compose([
transforms.ToTensor()])
trainset = datasets.ImageFolder(root='data/tiny-imagenet-200/train', transform=trainset_transforms)
testset = datasets.ImageFolder(root='data/tiny-imagenet-200/val', transform=testset_transforms)
##### Distributed Training #####
train_sampler = None
val_sampler = None
train_data = MyDataset(trainset)
test_data = MyDataset(testset)
train_sampler = torch.utils.data.distributed.DistributedSampler(train_data)
val_sampler = torch.utils.data.distributed.DistributedSampler(test_data)
data_loader = torch.utils.data.DataLoader(dataset=train_data,
batch_size=batch_size,
shuffle=(train_sampler is None),
drop_last = drop_last,
num_workers=4, pin_memory=True, sampler=train_sampler)
test_data_loader = torch.utils.data.DataLoader(dataset=test_data,
batch_size=test_batch_size,
shuffle=False,
num_workers=4, pin_memory=True, sampler=val_sampler)
return data_loader, test_data_loader
| 50.412698 | 124 | 0.618073 | 643 | 6,352 | 6.001555 | 0.180404 | 0.009329 | 0.08396 | 0.012438 | 0.752786 | 0.748121 | 0.708733 | 0.667012 | 0.663125 | 0.633584 | 0 | 0.029604 | 0.276763 | 6,352 | 125 | 125 | 50.816 | 0.810405 | 0.014326 | 0 | 0.460784 | 0 | 0 | 0.046459 | 0.034604 | 0 | 0 | 0 | 0 | 0 | 1 | 0.039216 | false | 0 | 0.127451 | 0.009804 | 0.205882 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ca549085e9eca0eb603220bcc1e9fc5a9fd74de4 | 340 | py | Python | kbcr/optimizers.py | nagendra20001414/ctp | ee237653939f4b743b10ae9954169aa7076d4ce1 | [
"MIT"
] | null | null | null | kbcr/optimizers.py | nagendra20001414/ctp | ee237653939f4b743b10ae9954169aa7076d4ce1 | [
"MIT"
] | null | null | null | kbcr/optimizers.py | nagendra20001414/ctp | ee237653939f4b743b10ae9954169aa7076d4ce1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from torch.optim.optimizer import Optimizer
class Optimizers:
def __init__(self, *op: Optimizer):
self.optimizers = op
def zero_grad(self):
for op in self.optimizers:
op.zero_grad()
def step(self):
for op in self.optimizers:
op.step()
| 20 | 44 | 0.561765 | 41 | 340 | 4.512195 | 0.463415 | 0.227027 | 0.259459 | 0.118919 | 0.291892 | 0.291892 | 0.291892 | 0 | 0 | 0 | 0 | 0.004405 | 0.332353 | 340 | 16 | 45 | 21.25 | 0.810573 | 0.061765 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ca9004f8dc338c270711a1e0a965b08868fdfff3 | 267 | py | Python | src/cart/models.py | dawidhubicki97/BookMaker | d5975a19b3da8269e1e7d2191eb2f1db3da9acc4 | [
"bzip2-1.0.6"
] | null | null | null | src/cart/models.py | dawidhubicki97/BookMaker | d5975a19b3da8269e1e7d2191eb2f1db3da9acc4 | [
"bzip2-1.0.6"
] | null | null | null | src/cart/models.py | dawidhubicki97/BookMaker | d5975a19b3da8269e1e7d2191eb2f1db3da9acc4 | [
"bzip2-1.0.6"
] | null | null | null | from django.db import models
from bets.models import Bet
from account.models import User
# Create your models here.
class Cart(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE,related_name="user")
bets=models.ManyToManyField(Bet,blank=True)
| 29.666667 | 77 | 0.808989 | 40 | 267 | 5.35 | 0.6 | 0.093458 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.093633 | 267 | 8 | 78 | 33.375 | 0.884298 | 0.089888 | 0 | 0 | 0 | 0 | 0.016598 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
ca9876c4dd2c94b82fd8ed520ece2716d93a1cf4 | 561 | py | Python | exercises/exercise108.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | exercises/exercise108.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | exercises/exercise108.py | djangojeng-e/TIL | bdbe1dfb6ebc48b89067fddda195227cca64b8dc | [
"MIT"
] | null | null | null | string = "abcdefgabc"
string_list = []
for letter in string:
string_list.append(letter)
print(string_list)
string_list_no_duplicate = set(string_list)
string_list_no_duplicate = list(string_list_no_duplicate)
string_list_no_duplicate.sort()
print(string_list_no_duplicate)
for letters in string_list_no_duplicate:
string_count = string_list.count(letters)
print(f'{letters}, {string_count}')
# Suggested Solution
# dict = {}
# for s in string:
# dict[s] = dict.get(s,0)+1
#
# print('\n'.join.[f'{k}, {v}' for k, v in dict.items()])
#
| 18.096774 | 57 | 0.71836 | 85 | 561 | 4.447059 | 0.317647 | 0.291005 | 0.190476 | 0.333333 | 0.31746 | 0.164021 | 0 | 0 | 0 | 0 | 0 | 0.004175 | 0.146168 | 561 | 30 | 58 | 18.7 | 0.784969 | 0.233512 | 0 | 0 | 0 | 0 | 0.083732 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0479014a5ffeb8718feb2dc0d45d0e1eee4a8422 | 94 | py | Python | config.py | HezyCB/JARVIS-2 | aa3ba0aa2f4595c48e0bd18211c65a0569684eb4 | [
"MIT"
] | null | null | null | config.py | HezyCB/JARVIS-2 | aa3ba0aa2f4595c48e0bd18211c65a0569684eb4 | [
"MIT"
] | null | null | null | config.py | HezyCB/JARVIS-2 | aa3ba0aa2f4595c48e0bd18211c65a0569684eb4 | [
"MIT"
] | null | null | null | email = "hezycb@gmail.com"
email_password = "Booees123"
wolframalpha_id = "H7VHX3-UKW9R4G7P5"
| 23.5 | 37 | 0.776596 | 11 | 94 | 6.454545 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105882 | 0.095745 | 94 | 3 | 38 | 31.333333 | 0.729412 | 0 | 0 | 0 | 0 | 0 | 0.446809 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.333333 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
04799fce438e317a9f8cc0ac57a2c89e4d6e6a36 | 1,189 | py | Python | codegen/python/fixtures/sanic/server/congo/deliveries_api.py | feeltheajf/go-raml | 57ce1f4c47bca464efee03cb4a7a28efcd00bea2 | [
"BSD-2-Clause"
] | null | null | null | codegen/python/fixtures/sanic/server/congo/deliveries_api.py | feeltheajf/go-raml | 57ce1f4c47bca464efee03cb4a7a28efcd00bea2 | [
"BSD-2-Clause"
] | null | null | null | codegen/python/fixtures/sanic/server/congo/deliveries_api.py | feeltheajf/go-raml | 57ce1f4c47bca464efee03cb4a7a28efcd00bea2 | [
"BSD-2-Clause"
] | null | null | null | # DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml.
import handlers
async def deliveries_get(request):
"""
Get a list of deliveries
It is handler for GET /deliveries
"""
return handlers.deliveries_getHandler(request)
async def deliveries_post(request):
"""
Create/request a new delivery
It is handler for POST /deliveries
"""
return handlers.deliveries_postHandler(request)
async def deliveries_deliveryId_get(request, deliveryId):
"""
Get information on a specific delivery
It is handler for GET /deliveries/<deliveryId>
"""
return handlers.deliveries_deliveryId_getHandler(request, deliveryId)
async def deliveries_deliveryId_patch(request, deliveryId):
"""
Update the information on a specific delivery
It is handler for PATCH /deliveries/<deliveryId>
"""
return handlers.deliveries_deliveryId_patchHandler(request, deliveryId)
async def deliveries_deliveryId_delete(request, deliveryId):
"""
Cancel a specific delivery
It is handler for DELETE /deliveries/<deliveryId>
"""
return handlers.deliveries_deliveryId_deleteHandler(request, deliveryId)
| 27.022727 | 79 | 0.739277 | 139 | 1,189 | 6.208633 | 0.323741 | 0.208575 | 0.104287 | 0.081112 | 0.490151 | 0.464658 | 0.137891 | 0.10197 | 0.10197 | 0 | 0 | 0 | 0.188394 | 1,189 | 43 | 80 | 27.651163 | 0.894301 | 0.06476 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.090909 | 0 | 0.545455 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
04bf6e59d70d2fdd84a6fb043931ac7c3a624e8c | 14,067 | py | Python | protocol/communication_pb2_grpc.py | Kausta/dp-fl-sc-client | 453c39980865b9cabbc46f938f465f4597651a4c | [
"Apache-2.0"
] | 2 | 2021-11-16T02:17:36.000Z | 2021-12-03T13:57:12.000Z | protocol/communication_pb2_grpc.py | Kausta/dp-fl-sc-client | 453c39980865b9cabbc46f938f465f4597651a4c | [
"Apache-2.0"
] | null | null | null | protocol/communication_pb2_grpc.py | Kausta/dp-fl-sc-client | 453c39980865b9cabbc46f938f465f4597651a4c | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from protocol import communication_pb2 as protocol_dot_communication__pb2
class ServerStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.RegisterClient = channel.unary_stream(
'/Server/RegisterClient',
request_serializer=protocol_dot_communication__pb2.RegisterRequest.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.RegisterResponse.FromString,
)
self.GetSystemSize = channel.unary_unary(
'/Server/GetSystemSize',
request_serializer=protocol_dot_communication__pb2.VoidMsg.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.SystemSizeResponse.FromString,
)
self.ForwardNoiseContributions = channel.stream_stream(
'/Server/ForwardNoiseContributions',
request_serializer=protocol_dot_communication__pb2.NoiseContribution.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.NoiseContribution.FromString,
)
self.ShouldContribute = channel.unary_stream(
'/Server/ShouldContribute',
request_serializer=protocol_dot_communication__pb2.ShouldContributeRequest.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.ShouldContributeResponse.FromString,
)
self.CommitUpdate = channel.unary_unary(
'/Server/CommitUpdate',
request_serializer=protocol_dot_communication__pb2.CommitUpdateRequest.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.Ack.FromString,
)
self.TpShouldPartialDecrypt = channel.unary_stream(
'/Server/TpShouldPartialDecrypt',
request_serializer=protocol_dot_communication__pb2.ShouldDecryptRequest.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.ShouldDecryptResponse.FromString,
)
self.TpPartialDecrypt = channel.unary_unary(
'/Server/TpPartialDecrypt',
request_serializer=protocol_dot_communication__pb2.CommitUpdateRequest.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.Ack.FromString,
)
self.GetGlobalUpdate = channel.unary_stream(
'/Server/GetGlobalUpdate',
request_serializer=protocol_dot_communication__pb2.VoidMsg.SerializeToString,
response_deserializer=protocol_dot_communication__pb2.Model.FromString,
)
class ServerServicer(object):
"""Missing associated documentation comment in .proto file."""
def RegisterClient(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetSystemSize(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ForwardNoiseContributions(self, request_iterator, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ShouldContribute(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def CommitUpdate(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TpShouldPartialDecrypt(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TpPartialDecrypt(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def GetGlobalUpdate(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_ServerServicer_to_server(servicer, server):
rpc_method_handlers = {
'RegisterClient': grpc.unary_stream_rpc_method_handler(
servicer.RegisterClient,
request_deserializer=protocol_dot_communication__pb2.RegisterRequest.FromString,
response_serializer=protocol_dot_communication__pb2.RegisterResponse.SerializeToString,
),
'GetSystemSize': grpc.unary_unary_rpc_method_handler(
servicer.GetSystemSize,
request_deserializer=protocol_dot_communication__pb2.VoidMsg.FromString,
response_serializer=protocol_dot_communication__pb2.SystemSizeResponse.SerializeToString,
),
'ForwardNoiseContributions': grpc.stream_stream_rpc_method_handler(
servicer.ForwardNoiseContributions,
request_deserializer=protocol_dot_communication__pb2.NoiseContribution.FromString,
response_serializer=protocol_dot_communication__pb2.NoiseContribution.SerializeToString,
),
'ShouldContribute': grpc.unary_stream_rpc_method_handler(
servicer.ShouldContribute,
request_deserializer=protocol_dot_communication__pb2.ShouldContributeRequest.FromString,
response_serializer=protocol_dot_communication__pb2.ShouldContributeResponse.SerializeToString,
),
'CommitUpdate': grpc.unary_unary_rpc_method_handler(
servicer.CommitUpdate,
request_deserializer=protocol_dot_communication__pb2.CommitUpdateRequest.FromString,
response_serializer=protocol_dot_communication__pb2.Ack.SerializeToString,
),
'TpShouldPartialDecrypt': grpc.unary_stream_rpc_method_handler(
servicer.TpShouldPartialDecrypt,
request_deserializer=protocol_dot_communication__pb2.ShouldDecryptRequest.FromString,
response_serializer=protocol_dot_communication__pb2.ShouldDecryptResponse.SerializeToString,
),
'TpPartialDecrypt': grpc.unary_unary_rpc_method_handler(
servicer.TpPartialDecrypt,
request_deserializer=protocol_dot_communication__pb2.CommitUpdateRequest.FromString,
response_serializer=protocol_dot_communication__pb2.Ack.SerializeToString,
),
'GetGlobalUpdate': grpc.unary_stream_rpc_method_handler(
servicer.GetGlobalUpdate,
request_deserializer=protocol_dot_communication__pb2.VoidMsg.FromString,
response_serializer=protocol_dot_communication__pb2.Model.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'Server', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class Server(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def RegisterClient(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/Server/RegisterClient',
protocol_dot_communication__pb2.RegisterRequest.SerializeToString,
protocol_dot_communication__pb2.RegisterResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetSystemSize(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/Server/GetSystemSize',
protocol_dot_communication__pb2.VoidMsg.SerializeToString,
protocol_dot_communication__pb2.SystemSizeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ForwardNoiseContributions(request_iterator,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.stream_stream(request_iterator, target, '/Server/ForwardNoiseContributions',
protocol_dot_communication__pb2.NoiseContribution.SerializeToString,
protocol_dot_communication__pb2.NoiseContribution.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ShouldContribute(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/Server/ShouldContribute',
protocol_dot_communication__pb2.ShouldContributeRequest.SerializeToString,
protocol_dot_communication__pb2.ShouldContributeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def CommitUpdate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/Server/CommitUpdate',
protocol_dot_communication__pb2.CommitUpdateRequest.SerializeToString,
protocol_dot_communication__pb2.Ack.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TpShouldPartialDecrypt(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/Server/TpShouldPartialDecrypt',
protocol_dot_communication__pb2.ShouldDecryptRequest.SerializeToString,
protocol_dot_communication__pb2.ShouldDecryptResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TpPartialDecrypt(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/Server/TpPartialDecrypt',
protocol_dot_communication__pb2.CommitUpdateRequest.SerializeToString,
protocol_dot_communication__pb2.Ack.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def GetGlobalUpdate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/Server/GetGlobalUpdate',
protocol_dot_communication__pb2.VoidMsg.SerializeToString,
protocol_dot_communication__pb2.Model.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
| 47.204698 | 115 | 0.67733 | 1,183 | 14,067 | 7.733728 | 0.093829 | 0.087441 | 0.128539 | 0.144606 | 0.802164 | 0.783364 | 0.681058 | 0.580829 | 0.574926 | 0.562466 | 0 | 0.004763 | 0.253785 | 14,067 | 297 | 116 | 47.363636 | 0.866819 | 0.060923 | 0 | 0.579365 | 1 | 0 | 0.068684 | 0.030569 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.007937 | 0.031746 | 0.123016 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
04d9bf9f84d76475b55ab37ef17bc1958d2fe0a0 | 201 | py | Python | courses/python/cursoemvideo/exercicios/ex007.py | bdpcampos/public | dda57c265718f3e1cc0d6bce73f149051f5647ef | [
"MIT"
] | 3 | 2020-04-28T01:42:09.000Z | 2020-05-03T12:05:23.000Z | courses/python/cursoemvideo/exercicios/ex007.py | bdpcampos/public | dda57c265718f3e1cc0d6bce73f149051f5647ef | [
"MIT"
] | null | null | null | courses/python/cursoemvideo/exercicios/ex007.py | bdpcampos/public | dda57c265718f3e1cc0d6bce73f149051f5647ef | [
"MIT"
] | null | null | null | n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
print('A primeira nota é {}.\nA segunda nota é {}.\nA média do aluno é {:.2f}.'.format(n1, n2, (n1 + n2) / 2)) | 67 | 110 | 0.626866 | 35 | 201 | 3.6 | 0.514286 | 0.15873 | 0.253968 | 0.269841 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.047619 | 0.164179 | 201 | 3 | 110 | 67 | 0.702381 | 0 | 0 | 0 | 0 | 0 | 0.584158 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
04ee53eef8dc4ce56fa7f4302f105e91da862698 | 139 | py | Python | Python/16. Creating multiplication table using while loop.py | bhoomika909/Hacktoberfest2021-1 | d36792245ec00336ce68b582f0279b23c2cd26a9 | [
"MIT"
] | 1 | 2022-01-02T11:14:32.000Z | 2022-01-02T11:14:32.000Z | Python/16. Creating multiplication table using while loop.py | bhoomika909/Hacktoberfest2021-1 | d36792245ec00336ce68b582f0279b23c2cd26a9 | [
"MIT"
] | null | null | null | Python/16. Creating multiplication table using while loop.py | bhoomika909/Hacktoberfest2021-1 | d36792245ec00336ce68b582f0279b23c2cd26a9 | [
"MIT"
] | 9 | 2021-10-16T07:31:54.000Z | 2021-10-31T18:02:34.000Z | x = 1
while x < 10:
y = 1
while y < 10:
print("%4d" % (x*y), end="")
y += 1
print()
x += 1
| 10.692308 | 37 | 0.294964 | 20 | 139 | 2.05 | 0.4 | 0.097561 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 0.52518 | 139 | 12 | 38 | 11.583333 | 0.484848 | 0 | 0 | 0 | 0 | 0 | 0.024194 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
04eea64e17c5c2f1607ea32ffdbc1683f96d3b87 | 1,905 | py | Python | quantum/plugins/cisco/extensions/_credential_view.py | yamt/neutron | f94126739a48993efaf1d1439dcd3dadb0c69742 | [
"Apache-2.0"
] | null | null | null | quantum/plugins/cisco/extensions/_credential_view.py | yamt/neutron | f94126739a48993efaf1d1439dcd3dadb0c69742 | [
"Apache-2.0"
] | null | null | null | quantum/plugins/cisco/extensions/_credential_view.py | yamt/neutron | f94126739a48993efaf1d1439dcd3dadb0c69742 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# @author: Ying Liu, Cisco Systems, Inc.
#
def get_view_builder(req):
base_url = req.application_url
return ViewBuilder(base_url)
class ViewBuilder(object):
"""ViewBuilder for Credential, derived from quantum.views.networks."""
def __init__(self, base_url):
"""Initialize builder.
:param base_url: url of the root wsgi application
"""
self.base_url = base_url
def build(self, credential_data, is_detail=False):
"""Generic method used to generate a credential entity."""
if is_detail:
credential = self._build_detail(credential_data)
else:
credential = self._build_simple(credential_data)
return credential
def _build_simple(self, credential_data):
"""Return a simple description of credential."""
return dict(credential=dict(id=credential_data['credential_id']))
def _build_detail(self, credential_data):
"""Return a detailed description of credential."""
return dict(credential=dict(id=credential_data['credential_id'],
name=credential_data['user_name'],
password=credential_data['password']))
| 35.943396 | 78 | 0.674016 | 238 | 1,905 | 5.247899 | 0.495798 | 0.100881 | 0.043235 | 0.025621 | 0.160128 | 0.120096 | 0.120096 | 0.120096 | 0.120096 | 0.120096 | 0 | 0.007586 | 0.238845 | 1,905 | 52 | 79 | 36.634615 | 0.853793 | 0.506562 | 0 | 0 | 0 | 0 | 0.048864 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0.055556 | 0 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
04f75329912978faf4de3b37779f63394c0762b7 | 174 | py | Python | easy_FirstFactorial.py | GabrielGhe/CoderbyteChallenges | 5601dbc24c95a65fed04896de2f534417c2e730d | [
"MIT"
] | 1 | 2020-11-04T15:30:18.000Z | 2020-11-04T15:30:18.000Z | easy_FirstFactorial.py | GabrielGhe/CoderbyteChallenges | 5601dbc24c95a65fed04896de2f534417c2e730d | [
"MIT"
] | null | null | null | easy_FirstFactorial.py | GabrielGhe/CoderbyteChallenges | 5601dbc24c95a65fed04896de2f534417c2e730d | [
"MIT"
] | null | null | null | #Gets the factorial of a number
def FirstFactorial(num):
result = 1
for x in range(1, num + 1):
result *= x
return result
print FirstFactorial(raw_input())
| 19.333333 | 35 | 0.66092 | 26 | 174 | 4.384615 | 0.730769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022901 | 0.247126 | 174 | 8 | 36 | 21.75 | 0.847328 | 0.172414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.166667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b6baf5ec88fbea1e89c624a525147cf79d2edb2c | 165 | py | Python | config/data_authenticate.py | wdangelo/file-collector-afd | 068078c5dc224f86035da0fefb75e09745255023 | [
"MIT"
] | 1 | 2021-12-08T13:58:55.000Z | 2021-12-08T13:58:55.000Z | config/data_authenticate.py | wdangelo/file-collector-afd | 068078c5dc224f86035da0fefb75e09745255023 | [
"MIT"
] | null | null | null | config/data_authenticate.py | wdangelo/file-collector-afd | 068078c5dc224f86035da0fefb75e09745255023 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
load_dotenv()
controll_id = {
"user": os.getenv('USER_CONTROLL_ID'),
"password": os.getenv('PASS_CONTROLL_ID')
}
| 15 | 45 | 0.709091 | 23 | 165 | 4.782609 | 0.478261 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157576 | 165 | 10 | 46 | 16.5 | 0.791367 | 0 | 0 | 0 | 0 | 0 | 0.269939 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
b6e4f688b18d8707f5b1ec9e19968ce37c80c4a6 | 69 | py | Python | Screenshot.py | kishore-droid/Screenshot-Code-in-PC | b9a6652684203315062b169d1d071de056e69b7d | [
"Apache-2.0"
] | 1 | 2021-08-08T17:26:11.000Z | 2021-08-08T17:26:11.000Z | Screenshot.py | kishore-droid/Screenshot-Code-in-PC | b9a6652684203315062b169d1d071de056e69b7d | [
"Apache-2.0"
] | null | null | null | Screenshot.py | kishore-droid/Screenshot-Code-in-PC | b9a6652684203315062b169d1d071de056e69b7d | [
"Apache-2.0"
] | null | null | null | import pyautogui as p
ss = p.screenshot()
ss.save("desktop\\ss.png")
| 17.25 | 26 | 0.710145 | 12 | 69 | 4.083333 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115942 | 69 | 3 | 27 | 23 | 0.803279 | 0 | 0 | 0 | 0 | 0 | 0.217391 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b6e7a7f92b5c537e304d3d73a1f01143db3ee1e6 | 130 | py | Python | Port_Scanner_MultiThread/video_4/utils.py | pymike00/youtube-scripts | 98ebf71a74b7fc9ea710d9d2c49cb191f27073cb | [
"MIT"
] | 19 | 2020-12-30T01:19:55.000Z | 2022-03-13T19:12:27.000Z | Port_Scanner_MultiThread/video_4/utils.py | pymike00/youtube-scripts | 98ebf71a74b7fc9ea710d9d2c49cb191f27073cb | [
"MIT"
] | null | null | null | Port_Scanner_MultiThread/video_4/utils.py | pymike00/youtube-scripts | 98ebf71a74b7fc9ea710d9d2c49cb191f27073cb | [
"MIT"
] | 14 | 2020-09-25T19:33:59.000Z | 2022-03-07T21:38:21.000Z | import json
def extract_json_data(filename):
with open(filename, "r") as file:
data = json.load(file)
return data | 21.666667 | 37 | 0.669231 | 19 | 130 | 4.473684 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.230769 | 130 | 6 | 38 | 21.666667 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0.007634 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
8e4fb040a55686d8fef6146c3cf06737cfd6c7d0 | 118 | py | Python | BeamColumnNode/Untitled-1.py | jpcoding/OpenSeesModel | 104cb010a20d7abfb744a624a38643e856fe5f25 | [
"MIT"
] | null | null | null | BeamColumnNode/Untitled-1.py | jpcoding/OpenSeesModel | 104cb010a20d7abfb744a624a38643e856fe5f25 | [
"MIT"
] | null | null | null | BeamColumnNode/Untitled-1.py | jpcoding/OpenSeesModel | 104cb010a20d7abfb744a624a38643e856fe5f25 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
x=np.loadtxt('XYdisp.txt')
plt.plot(x[10:,1],x[10:,2])
plt.show()
| 19.666667 | 31 | 0.70339 | 24 | 118 | 3.458333 | 0.666667 | 0.072289 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.056604 | 0.101695 | 118 | 5 | 32 | 23.6 | 0.726415 | 0 | 0 | 0 | 0 | 0 | 0.084746 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f3cdd8bd3032f59271cb643b971f71e2adf840ba | 251 | py | Python | seeds/management/commands/hello.py | xeroz/crud-django | 185da22ea0a6368fd7c802d60972f2c8f6d9fde9 | [
"MIT"
] | 1 | 2017-05-01T10:02:32.000Z | 2017-05-01T10:02:32.000Z | seeds/management/commands/hello.py | xeroz/crud-django | 185da22ea0a6368fd7c802d60972f2c8f6d9fde9 | [
"MIT"
] | null | null | null | seeds/management/commands/hello.py | xeroz/crud-django | 185da22ea0a6368fd7c802d60972f2c8f6d9fde9 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from posts.seeds import PostTableSeeder
class Command(BaseCommand):
def handle(self, *args, **options):
test = 'hello'
PostTableSeeder().run()
return test
| 25.1 | 65 | 0.701195 | 27 | 251 | 6.518519 | 0.814815 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.203187 | 251 | 9 | 66 | 27.888889 | 0.88 | 0 | 0 | 0 | 0 | 0 | 0.01992 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.714286 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
6d5fd55957545ba0b2468e2914204c1d925e0c97 | 351 | py | Python | collatorx/common/ledger.py | cjburgos/collator-x | c38cd25ca2c3d8da47db35180fef0f9a53bc4cd3 | [
"MIT-0"
] | null | null | null | collatorx/common/ledger.py | cjburgos/collator-x | c38cd25ca2c3d8da47db35180fef0f9a53bc4cd3 | [
"MIT-0"
] | null | null | null | collatorx/common/ledger.py | cjburgos/collator-x | c38cd25ca2c3d8da47db35180fef0f9a53bc4cd3 | [
"MIT-0"
] | null | null | null | from datetime import datetime
from uuid import uuid4
class Ledger():
LEDGER_TYPE = "default"
def __init__(self):
self._id = uuid4()
self._dob = datetime.datetime.today()
@property
def ledger_id(self):
return str(self._id)
@property
def genesis_date(self):
return self._dob.isoformat()
| 17.55 | 45 | 0.626781 | 42 | 351 | 4.97619 | 0.5 | 0.057416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007874 | 0.276353 | 351 | 19 | 46 | 18.473684 | 0.814961 | 0 | 0 | 0.153846 | 0 | 0 | 0.02 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.153846 | 0.153846 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ed9e96933ae1e37f6c906b28deccede560c3d55f | 5,894 | py | Python | helpers/formatter.py | dkalaxdk/IssueTableGenerator | a2999e3417c2514292b1197d8cfe83435f6f1b8d | [
"MIT"
] | null | null | null | helpers/formatter.py | dkalaxdk/IssueTableGenerator | a2999e3417c2514292b1197d8cfe83435f6f1b8d | [
"MIT"
] | null | null | null | helpers/formatter.py | dkalaxdk/IssueTableGenerator | a2999e3417c2514292b1197d8cfe83435f6f1b8d | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
# Abstract base class that provides a common interface
class AbstractFormatter(ABC):
def __init__(self):
super().__init__()
@abstractmethod
def format(self, output_string, repository, config):
pass
# The concrete classes could and probably should be moved to files of their own
# but I didn't feel like it
class MarkdownFormatter(AbstractFormatter):
def format(self, output_string, repository, config):
output_string += f"# {repository.name} \n"
issues = repository.issues
pull_requests = repository.pull_requests
if config['issues_or_pr'] == "Issues" or config['issues_or_pr'] == "Both":
# If there are issues, write this:
if len(issues) > 0:
output_string += "## Issues \n"
output_string = markdown_header_creation(output_string, config['issue_headers'])
output_string = markdown_table_creation(output_string, config['issue_headers'],
config['issue_table_content'], issues, repository.name)
output_string += "\n \n \n"
if config['issues_or_pr'] == "Pull requests" or config['issues_or_pr'] == "Both":
if len(pull_requests) > 0:
output_string += "## Pull requests \n"
output_string = markdown_header_creation(output_string, config['pr_headers'])
output_string = markdown_table_creation(output_string, config['pr_headers'],
config['pr_table_content'], pull_requests, repository.name)
output_string += "\n \n \n"
return output_string
class LatexFormatter(AbstractFormatter):
def format(self, output_string, repository, config):
output_string += f"# {repository.name} \n"
issues = repository.issues
pull_requests = repository.pull_requests
# If there are issues, write this:
if config['issues_or_pr'] == "Issues" or config['issues_or_pr'] == "Both":
if len(issues) > 0:
output_string += "\\section{Issues} \n"
output_string = latex_header_creation(output_string, config['issue_headers'])
output_string = latex_table_creation(output_string, config['issue_headers'], config['issue_table_content'],
issues, repository.name)
output_string += "\\caption{Text} \n\\label{tab:my_tab} \n\\end{longtable} \n \n"
if config['issues_or_pr'] == "Pull requests" or config['issues_or_pr'] == "Both":
# If there are pull requests, write this:
if len(pull_requests) > 0:
output_string += "\\section{Pull requests} \n"
output_string = latex_header_creation(output_string, config['pr_headers'])
output_string = latex_table_creation(output_string, config['pr_headers'], config['pr_table_content'],
pull_requests, repository.name)
output_string += "\\caption{Text} \n\\label{tab:my_tab} \n\\end{longtable} \n \n"
return output_string
def latex_header_creation(input_string, headers):
input_string += '\\begin{longtable}[H]{'
# Creates appropriate amount of |l| for the table
for _ in headers:
input_string += '|l|'
input_string += '} \n \\hline \\endfirsthead \\\\ '
# Add the headers defined in the config
for item in headers:
input_string += f' \\textbf{{{item}}} &'
input_string = input_string[:-1]
input_string += '\\\\ \\hline\n '
return input_string
def latex_table_creation(input_string, headers, table_content, items, repository):
# Table content creator:
extra_table_markers = len(headers) - len(table_content)
for item in items:
for content_key in table_content:
content = item.return_key(key=content_key)
if isinstance(content, dict):
if len(content) > 0:
for element in content.items():
input_string += f"\\href{{https://github.com/aau-giraf/" \
f"{element[1]}/issues/{element[0]}}}{{{element[0]}}}"
input_string += "&"
else:
input_string += f"{content} &"
input_string = input_string[:-1]
for _ in range(extra_table_markers):
input_string += " & "
input_string += "\\\\ \\hline \n"
return input_string
def markdown_header_creation(input_string, headers):
# Add the headers defined in the config
input_string += "|"
for item in headers:
input_string += f'{item} |'
input_string += " \n |"
for _ in headers:
input_string += ':---------:|'
input_string += "\n"
return input_string
def markdown_table_creation(input_string, headers, table_content, items, repository):
extra_table_markers = len(headers) - len(table_content)
for item in items:
for content_key in table_content:
content = item.return_key(key=content_key)
if isinstance(content, dict):
if len(content) > 0:
for element in content.items():
input_string += f"[{element[0]}](https://github.com/aau-giraf/" \
f"{element[1]}/issues/{element[0]}) "
elif content_key == "number":
input_string += f"[{content}](https://github.com/aau-giraf/" \
f"{repository}/issues/{content}) |"
else:
input_string += f"{content} |"
for _ in range(extra_table_markers):
input_string += " |"
input_string += " \n"
return input_string
| 44.651515 | 123 | 0.581608 | 654 | 5,894 | 4.993884 | 0.172783 | 0.107777 | 0.034293 | 0.039192 | 0.827006 | 0.750153 | 0.72474 | 0.645744 | 0.606859 | 0.467851 | 0 | 0.003403 | 0.302002 | 5,894 | 131 | 124 | 44.992366 | 0.790472 | 0.069393 | 0 | 0.553398 | 0 | 0.019417 | 0.181403 | 0.032335 | 0 | 0 | 0 | 0 | 0 | 1 | 0.07767 | false | 0.009709 | 0.009709 | 0 | 0.174757 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
edc2483a58ce4dcbe57c5e81f8201d6cb4b1755c | 250 | py | Python | Escola/views.py | JoaoGuilhermeBNascimento/DjangoAPI | 196ecbe96d9483f93087550f68ada346dc13e37c | [
"MIT"
] | null | null | null | Escola/views.py | JoaoGuilhermeBNascimento/DjangoAPI | 196ecbe96d9483f93087550f68ada346dc13e37c | [
"MIT"
] | null | null | null | Escola/views.py | JoaoGuilhermeBNascimento/DjangoAPI | 196ecbe96d9483f93087550f68ada346dc13e37c | [
"MIT"
] | null | null | null | from rest_framework import serializers, viewsets
from Escola.models import Aluno
from Escola.serializer import AlunoSerializer
class AlunosViewSet(viewsets.ModelViewSet):
queryset = Aluno.objects.all()
serializer_class = AlunoSerializer
| 31.25 | 48 | 0.812 | 27 | 250 | 7.444444 | 0.62963 | 0.099502 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136 | 250 | 8 | 49 | 31.25 | 0.930556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
edce0981b5bf6160b01bf44fb4ead94b2536bc79 | 262 | py | Python | src/sanic_jsonrpc/_middleware/__init__.py | mon4ter/sanic-jsonrpc | 21f9067cf17ecceb042abf38c4bdfd7bec05a543 | [
"MIT"
] | 9 | 2019-08-22T08:25:09.000Z | 2021-11-23T16:46:23.000Z | src/sanic_jsonrpc/_middleware/__init__.py | mon4ter/sanic-jsonrpc | 21f9067cf17ecceb042abf38c4bdfd7bec05a543 | [
"MIT"
] | 13 | 2020-02-26T11:05:36.000Z | 2021-12-01T02:57:28.000Z | src/sanic_jsonrpc/_middleware/__init__.py | mon4ter/sanic-jsonrpc | 21f9067cf17ecceb042abf38c4bdfd7bec05a543 | [
"MIT"
] | 1 | 2019-12-16T08:56:33.000Z | 2019-12-16T08:56:33.000Z | from .directions import *
from .objects import *
from .predicate import *
from .predicates import *
from .transports import *
__all__ = [
*directions.__all__,
*objects.__all__,
*predicate.__all__,
*predicates.__all__,
*transports.__all__,
]
| 18.714286 | 25 | 0.70229 | 26 | 262 | 6.153846 | 0.307692 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.19084 | 262 | 13 | 26 | 20.153846 | 0.754717 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.416667 | 0 | 0.416667 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
eddcce8c9283caf0d9250b099057717684d297f7 | 551 | py | Python | gtfo/gtfo_filters/test/unit/test_Random_RandFrom.py | OmegaDroid/gtfo | b75a820bcb94136fb6bbc49c125970dde755c839 | [
"MIT"
] | null | null | null | gtfo/gtfo_filters/test/unit/test_Random_RandFrom.py | OmegaDroid/gtfo | b75a820bcb94136fb6bbc49c125970dde755c839 | [
"MIT"
] | null | null | null | gtfo/gtfo_filters/test/unit/test_Random_RandFrom.py | OmegaDroid/gtfo | b75a820bcb94136fb6bbc49c125970dde755c839 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch, Mock
from gtfo.gtfo_filters.templatetags.random import rand_from
class Random_RandFrom(TestCase):
def test_NoArgumentsGiven_ValueErrorIsRaised(self):
self.assertRaises(ValueError, rand_from)
@patch("gtfo.gtfo_filters.templatetags.random.random.choice", Mock(side_effect=lambda args: {"chose_from": args}))
def test_ArgumentsGiven_ReturnValueIsRandomChosenFromArgs(self):
self.assertEqual({"chose_from": (1, 2, "foo", "bar")}, rand_from(1, 2, "foo", "bar")) | 42.384615 | 118 | 0.76225 | 68 | 551 | 5.985294 | 0.485294 | 0.058968 | 0.07371 | 0.132678 | 0.22113 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008247 | 0.119782 | 551 | 13 | 119 | 42.384615 | 0.830928 | 0 | 0 | 0 | 0 | 0 | 0.150362 | 0.092391 | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0.222222 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
edede2b2770ad7c2d5d1107dda10167280a8d22c | 454 | py | Python | src/darjeeling/filters.py | yxliang01/Darjeeling | 60a6d55a618b5d1cef3312904baaf11099293e54 | [
"Apache-2.0"
] | null | null | null | src/darjeeling/filters.py | yxliang01/Darjeeling | 60a6d55a618b5d1cef3312904baaf11099293e54 | [
"Apache-2.0"
] | null | null | null | src/darjeeling/filters.py | yxliang01/Darjeeling | 60a6d55a618b5d1cef3312904baaf11099293e54 | [
"Apache-2.0"
] | null | null | null | from bugzoo.core.fileline import FileLine
def ends_with_semi_colon(contents: str) -> bool:
"""
Returns `True` if a given line ends with a semi-colon.
"""
# FIXME add "is_statement"
contents = contents.strip()
return contents.endswith(';') and not contents == '};'
def has_balanced_delimiters(contents: str) -> bool:
"""
Checks whether all delimiters that occur in a given snippet are balanced.
"""
return True
| 25.222222 | 77 | 0.669604 | 59 | 454 | 5.050847 | 0.661017 | 0.053691 | 0.100671 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.220264 | 454 | 17 | 78 | 26.705882 | 0.841808 | 0.339207 | 0 | 0 | 0 | 0 | 0.011152 | 0 | 0 | 0 | 0 | 0.058824 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
edf88f4eddb9c1e586a73179c8a22c6516724e7d | 477 | py | Python | genmod/errors/warning.py | Varstation/genmod | 991a0fca36936b5dde49a95e8ea1d4336288c7c0 | [
"MIT"
] | 46 | 2015-01-15T17:53:22.000Z | 2021-08-09T09:35:29.000Z | genmod/errors/warning.py | Varstation/genmod | 991a0fca36936b5dde49a95e8ea1d4336288c7c0 | [
"MIT"
] | 55 | 2015-06-04T09:09:29.000Z | 2021-05-20T10:48:18.000Z | genmod/errors/warning.py | moonso/genmod | 99b6c9510ffc67fd54c07eab24de5db7345ef95d | [
"MIT"
] | 15 | 2015-02-06T04:08:23.000Z | 2021-05-04T10:06:58.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
warning.py
Prints a warning message to stderr
Created by Måns Magnusson on 2014-08-22.
Copyright (c) 2014 __MoonsoInc__. All rights reserved.
"""
from __future__ import print_function, unicode_literals
import sys
import os
def warning(*objs):
"""Prints the warning messages to std err"""
print("WARNING: ", *objs, file=sys.stderr)
def main():
print('This is a warning!')
if __name__ == '__main__':
main()
| 17.666667 | 55 | 0.69392 | 68 | 477 | 4.602941 | 0.720588 | 0.051118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033419 | 0.184486 | 477 | 26 | 56 | 18.346154 | 0.771208 | 0.45912 | 0 | 0 | 0 | 0 | 0.144033 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | true | 0 | 0.333333 | 0 | 0.555556 | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
6120403dfed8b654a56275a57e9db7f91ff6bad8 | 275 | py | Python | opyapi/schema/errors/invalid_length_error.py | dkraczkowski/opyapi | 93f9ca4a39ec3dc0622e3248b96f2efad8323827 | [
"MIT"
] | 5 | 2019-06-05T19:06:56.000Z | 2020-05-02T07:57:51.000Z | opyapi/schema/errors/invalid_length_error.py | dkraczkowski/opyapi | 93f9ca4a39ec3dc0622e3248b96f2efad8323827 | [
"MIT"
] | 12 | 2019-06-05T19:34:09.000Z | 2019-09-08T18:50:48.000Z | opyapi/schema/errors/invalid_length_error.py | dkraczkowski/opyapi | 93f9ca4a39ec3dc0622e3248b96f2efad8323827 | [
"MIT"
] | 1 | 2019-06-05T20:03:26.000Z | 2019-06-05T20:03:26.000Z | from .validation_error import ValidationError
class InvalidLengthError(ValidationError):
pass
class OverflowError(InvalidLengthError):
pass
class UnderflowError(InvalidLengthError):
pass
__all__ = ["InvalidLengthError", "OverflowError", "UnderflowError"]
| 16.176471 | 67 | 0.785455 | 21 | 275 | 10.047619 | 0.52381 | 0.085308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138182 | 275 | 16 | 68 | 17.1875 | 0.890295 | 0 | 0 | 0.375 | 0 | 0 | 0.163636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.375 | 0.125 | 0 | 0.5 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
612d9d38133b9d26ee272392bed86e7ce9da6798 | 148 | py | Python | web/reports/templatetags/filters.py | chosak/fdic-call-reports | 1b2147ed2ab7cde99db620d6d769f32c39c8abf2 | [
"MIT"
] | 26 | 2015-10-17T21:38:50.000Z | 2022-01-14T04:17:18.000Z | web/reports/templatetags/filters.py | lydiakirakira/fdic-call-reports | 1b2147ed2ab7cde99db620d6d769f32c39c8abf2 | [
"MIT"
] | null | null | null | web/reports/templatetags/filters.py | lydiakirakira/fdic-call-reports | 1b2147ed2ab7cde99db620d6d769f32c39c8abf2 | [
"MIT"
] | 12 | 2017-03-08T21:33:31.000Z | 2021-08-20T23:21:46.000Z | from django import template
register = template.Library()
@register.filter
def money(value, scale):
return '${:,d}'.format(value / scale)
| 12.333333 | 41 | 0.689189 | 18 | 148 | 5.666667 | 0.777778 | 0.196078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168919 | 148 | 11 | 42 | 13.454545 | 0.829268 | 0 | 0 | 0 | 0 | 0 | 0.040541 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
b640c33cb2683f2f519af07a2a41d7e5ca29963d | 26 | py | Python | Warm-up/C.py | CristianLazoQuispe/UniXtreme | da5c535b3ff00962398b7d1bf8b5e7e3b169f8ab | [
"MIT"
] | null | null | null | Warm-up/C.py | CristianLazoQuispe/UniXtreme | da5c535b3ff00962398b7d1bf8b5e7e3b169f8ab | [
"MIT"
] | null | null | null | Warm-up/C.py | CristianLazoQuispe/UniXtreme | da5c535b3ff00962398b7d1bf8b5e7e3b169f8ab | [
"MIT"
] | null | null | null | letras = input().split()
| 8.666667 | 24 | 0.615385 | 3 | 26 | 5.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 26 | 2 | 25 | 13 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b652e71cc4ea0397bfb9f4da9fbb56cee53ec43d | 96 | py | Python | src/lime_python/protocol/constants/session_encryption.py | mirlarof/lime-python | 9961379562bd9d362b16c0ee66f3bde652070b22 | [
"Apache-2.0"
] | 2 | 2019-09-10T15:10:11.000Z | 2021-02-05T21:44:38.000Z | src/lime_python/protocol/constants/session_encryption.py | mirlarof/lime-python | 9961379562bd9d362b16c0ee66f3bde652070b22 | [
"Apache-2.0"
] | 9 | 2021-05-19T21:08:15.000Z | 2021-05-31T20:43:26.000Z | src/lime_python/protocol/constants/session_encryption.py | mirlarof/lime-python | 9961379562bd9d362b16c0ee66f3bde652070b22 | [
"Apache-2.0"
] | 3 | 2019-09-10T15:10:32.000Z | 2022-01-24T13:36:46.000Z | class SessionEncryption:
"""Session Encryption types."""
NONE = 'none'
TLS = 'tls'
| 16 | 35 | 0.604167 | 9 | 96 | 6.444444 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 96 | 5 | 36 | 19.2 | 0.805556 | 0.260417 | 0 | 0 | 0 | 0 | 0.107692 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
b65677c0f818f2204278e7f1f85e98c8afb1cada | 813 | py | Python | servidor/entorno_virtual.py | JPGarzonE/curso-de-python | 37acfebffa3f6944ee2aa88c64567efe1471f968 | [
"MIT"
] | null | null | null | servidor/entorno_virtual.py | JPGarzonE/curso-de-python | 37acfebffa3f6944ee2aa88c64567efe1471f968 | [
"MIT"
] | 1 | 2020-01-26T18:51:08.000Z | 2020-01-26T18:51:08.000Z | servidor/entorno_virtual.py | JPGarzonE/curso-de-python | 37acfebffa3f6944ee2aa88c64567efe1471f968 | [
"MIT"
] | null | null | null | # Entorno virtual en Python
# En Python la comunidad comparte su código usando PyPi (python package index),
# es un repositorio para instalar módulos de la comunidad.
# Con pip install [nombre] se puede instalar el paquete que deseas.
# Podemos utilizar requirements.txt para ordenar los paquetes que requiere tu proyecto.
# Ambiente virtual
# Nos permite encapsular un proyecto para poder instalar las versiones de los paquetes que se requieran sin tenerlos que instalar en todo el sistema operativo.
# Crear un entorno virtual
# Dentro de la carpeta de tu proyecto ejecutas
# virtualenv venv
# Encender un entorno virtual
# source venv/bin/activate
# Ver las dependencias instaladas en el entorno virtual
# pip freeze
# Instalar dependencias del archivo requirements
# pip install -r requirements.txt
| 30.111111 | 159 | 0.792128 | 117 | 813 | 5.504274 | 0.598291 | 0.086957 | 0.043478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170972 | 813 | 26 | 160 | 31.269231 | 0.95549 | 0.947109 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.038462 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b679c32b7af28db8d06f036d31fafb3fb8015ba0 | 248 | py | Python | test/support/dt.py | ankane/tomoto | b38811d21f5fa025aeaed4caf0dfe33d1ecea73b | [
"MIT"
] | 41 | 2020-10-09T23:01:41.000Z | 2021-09-17T15:26:02.000Z | test/support/dt.py | ankane/tomoto-ruby | 664a427f28c211278f5a4359d7a19ba27a933c50 | [
"MIT"
] | 3 | 2020-10-09T23:53:33.000Z | 2021-08-18T21:41:28.000Z | test/support/dt.py | ankane/tomoto-ruby | 664a427f28c211278f5a4359d7a19ba27a933c50 | [
"MIT"
] | 1 | 2021-04-20T04:22:16.000Z | 2021-04-20T04:22:16.000Z | import tomotopy as tp
model = tp.DTModel()
print(model.alpha)
# print(model.eta)
print(model.lr_a)
print(model.lr_b)
print(model.lr_c)
print(model.num_timepoints)
print(model.num_docs_by_timepoint)
model.add_doc(["new", "document"], timepoint=0)
| 19.076923 | 47 | 0.766129 | 42 | 248 | 4.333333 | 0.547619 | 0.384615 | 0.197802 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004386 | 0.080645 | 248 | 12 | 48 | 20.666667 | 0.79386 | 0.064516 | 0 | 0 | 0 | 0 | 0.047826 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 0.666667 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
b6a4e42f7aab145d029dcae03fa06a2ba23a3525 | 86 | py | Python | x2paddle/__init__.py | wangnaa/X2Paddle | 57e500f8279048fb8fa89c291358c92a1c36914f | [
"Apache-2.0"
] | null | null | null | x2paddle/__init__.py | wangnaa/X2Paddle | 57e500f8279048fb8fa89c291358c92a1c36914f | [
"Apache-2.0"
] | null | null | null | x2paddle/__init__.py | wangnaa/X2Paddle | 57e500f8279048fb8fa89c291358c92a1c36914f | [
"Apache-2.0"
] | 1 | 2021-02-22T09:05:44.000Z | 2021-02-22T09:05:44.000Z | __version__ = "1.0.1"
from .core.program import PaddleGraph
program = PaddleGraph()
| 14.333333 | 37 | 0.744186 | 11 | 86 | 5.454545 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040541 | 0.139535 | 86 | 5 | 38 | 17.2 | 0.77027 | 0 | 0 | 0 | 0 | 0 | 0.05814 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
b6ab98a91b4b84a7252e4debcf798fd568be935b | 237 | py | Python | home/processors.py | saqlainrasheed/iogt | 4bebfe4cd2f1d4ff9cab50d1126756c162a30b89 | [
"BSD-2-Clause"
] | 20 | 2021-04-29T12:36:25.000Z | 2022-03-27T12:17:41.000Z | home/processors.py | mbilalhameed/iogt | 9c12f0be29f1eea0097ec43f692c77ba65673610 | [
"BSD-2-Clause"
] | 892 | 2021-02-02T13:56:06.000Z | 2022-03-31T11:25:44.000Z | home/processors.py | mbilalhameed/iogt | 9c12f0be29f1eea0097ec43f692c77ba65673610 | [
"BSD-2-Clause"
] | 28 | 2021-02-19T19:28:37.000Z | 2022-03-11T11:46:00.000Z | from django.conf import settings
def show_welcome_banner(request):
return {
"first_time_user": request.session.get("first_time_user", True)
}
def commit_hash(request):
return {'commit_hash': settings.COMMIT_HASH}
| 19.75 | 71 | 0.721519 | 31 | 237 | 5.225806 | 0.612903 | 0.185185 | 0.160494 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172996 | 237 | 11 | 72 | 21.545455 | 0.826531 | 0 | 0 | 0 | 0 | 0 | 0.172996 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.285714 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
b6acb9a099ff272a1ad0be79dde50f196a5da993 | 651 | py | Python | py-src/Fluid.py | appmonster007/project-megraphs | 7e32af817f49804a17dbfd729e5afaef50fa95f7 | [
"MIT"
] | null | null | null | py-src/Fluid.py | appmonster007/project-megraphs | 7e32af817f49804a17dbfd729e5afaef50fa95f7 | [
"MIT"
] | 2 | 2021-09-05T05:41:42.000Z | 2021-09-05T07:12:49.000Z | py-src/Fluid.py | appmonster007/project-megraphs | 7e32af817f49804a17dbfd729e5afaef50fa95f7 | [
"MIT"
] | null | null | null | from Base import graphIO
import networkx as nx
def fluidsim(graph: graphIO, iters=100):
for node in graph.graph:
if graph.graph.degree[node] < 2:
graph.graph.nodes[node]['pressure'] = 1.0
else:
graph.graph.nodes[node]['pressure'] = 0.0
for _ in range(iters):
for node in graph.graph:
for neighbour in graph.graph.neighbors(node):
deltaP = graph.graph.nodes[node]['pressure'] - graph.graph.nodes[neighbour]['pressure']
graph.graph.nodes[node]['pressure'] -= deltaP * 0.01
graph.graph.nodes[neighbour]['pressure'] += deltaP * 0.01
| 38.294118 | 103 | 0.596006 | 83 | 651 | 4.662651 | 0.337349 | 0.258398 | 0.232558 | 0.196382 | 0.542636 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029474 | 0.270353 | 651 | 17 | 104 | 38.294118 | 0.785263 | 0 | 0 | 0.142857 | 0 | 0 | 0.07362 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.142857 | 0 | 0.214286 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b6b7b3af0e1bcb6a620943b054ddd3483ac6aa17 | 62,458 | py | Python | daily_temperature_data_V3a.py | ErikaWarnatzsch/Maize-Aflatoxin-Risk | 1fa48e57d3ef84ac3435eaf9edd1437bfa707a5f | [
"MIT"
] | null | null | null | daily_temperature_data_V3a.py | ErikaWarnatzsch/Maize-Aflatoxin-Risk | 1fa48e57d3ef84ac3435eaf9edd1437bfa707a5f | [
"MIT"
] | null | null | null | daily_temperature_data_V3a.py | ErikaWarnatzsch/Maize-Aflatoxin-Risk | 1fa48e57d3ef84ac3435eaf9edd1437bfa707a5f | [
"MIT"
] | null | null | null | """
Created on Monday June 27th 2019
@author: s0899345
"""
import numpy as np
import iris
import iris.coord_categorisation as iriscc
import iris.analysis.cartography
import cf_units
from cf_units import Unit
#this file is split into parts as follows:
#PART 1: Load and Format all Past Models
#PART 2: Load and Format all Future Models
#PART 3: Load and Format Observed Data
#PART 4: Format Data General
#PART 5: Format Data to be Geographically Specific and Re-Baseline
#PART 6: print data
def main():
#promote iris.FUTURE to true to fix cube
iris.FUTURE.netcdf_promote = True
#PART 1: LOAD and FORMAT PAST MODELS
CCCmaCanRCM_past = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/Historical_daily/tas_AFR-44_CCCma-CanESM2_historical_r1i1p1_CCCma-CanRCM4_r2_day_19710101-20001231.nc'
CCCmaSMHI_past = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/Historical_daily/tas_AFR-44_CCCma-CanESM2_historical_r1i1p1_SMHI-RCA4_v1_day_19710101-20001231.nc'
CNRM_past = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/Historical_daily/tas_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19710101-20001231.nc'
CNRMSMHI_past = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/Historical_daily/tas_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_SMHI-RCA4_v1_day_19710101-20001231.nc'
CSIRO_past = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/Historical_daily/tas_AFR-44_CSIRO-QCCCE-CSIRO-Mk3-6-0_historical_r1i1p1_SMHI-RCA4_v1_day_19710101-20001231.nc'
#Load exactly one cube from given file
CCCmaCanRCM_past = iris.load_cube(CCCmaCanRCM_past)
CCCmaSMHI_past = iris.load_cube(CCCmaSMHI_past)
CNRM_past = iris.load_cube(CNRM_past)
CNRMSMHI_past = iris.load_cube(CNRMSMHI_past)
CSIRO_past = iris.load_cube(CSIRO_past)
#remove flat latitude and longitude and only use grid latitude and grid longitude to make consistent with the observed data, also make sure all of the longitudes are monotonic.
lats = iris.coords.DimCoord(CCCmaCanRCM_past.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CCCmaCanRCM_past.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CCCmaCanRCM_past.remove_coord('latitude')
CCCmaCanRCM_past.remove_coord('longitude')
CCCmaCanRCM_past.remove_coord('grid_latitude')
CCCmaCanRCM_past.remove_coord('grid_longitude')
CCCmaCanRCM_past.add_dim_coord(lats, 1)
CCCmaCanRCM_past.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CCCmaSMHI_past.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CCCmaSMHI_past.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CCCmaSMHI_past.remove_coord('latitude')
CCCmaSMHI_past.remove_coord('longitude')
CCCmaSMHI_past.remove_coord('grid_latitude')
CCCmaSMHI_past.remove_coord('grid_longitude')
CCCmaSMHI_past.add_dim_coord(lats, 1)
CCCmaSMHI_past.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CNRM_past.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CNRM_past.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CNRM_past.remove_coord('latitude')
CNRM_past.remove_coord('longitude')
CNRM_past.remove_coord('grid_latitude')
CNRM_past.remove_coord('grid_longitude')
CNRM_past.add_dim_coord(lats, 1)
CNRM_past.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CNRMSMHI_past.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CNRMSMHI_past.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CNRMSMHI_past.remove_coord('latitude')
CNRMSMHI_past.remove_coord('longitude')
CNRMSMHI_past.remove_coord('grid_latitude')
CNRMSMHI_past.remove_coord('grid_longitude')
CNRMSMHI_past.add_dim_coord(lats, 1)
CNRMSMHI_past.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CSIRO_past.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CSIRO_past.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CSIRO_past.remove_coord('latitude')
CSIRO_past.remove_coord('longitude')
CSIRO_past.remove_coord('grid_latitude')
CSIRO_past.remove_coord('grid_longitude')
CSIRO_past.add_dim_coord(lats, 1)
CSIRO_past.add_dim_coord(lons, 2)
#guess bounds
CCCmaCanRCM_past.coord('latitude').guess_bounds()
CCCmaSMHI_past.coord('latitude').guess_bounds()
CNRM_past.coord('latitude').guess_bounds()
CNRMSMHI_past.coord('latitude').guess_bounds()
CSIRO_past.coord('latitude').guess_bounds()
CCCmaCanRCM_past.coord('longitude').guess_bounds()
CCCmaSMHI_past.coord('longitude').guess_bounds()
CNRM_past.coord('longitude').guess_bounds()
CNRMSMHI_past.coord('longitude').guess_bounds()
CSIRO_past.coord('longitude').guess_bounds()
#-------------------------------------------------------------------------
#PART 2: LOAD and FORMAT PROJECTED MODELS
CCCmaCanRCM= '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/4.5/tas_AFR-44_CCCma-CanESM2_rcp45_r1i1p1_CCCma-CanRCM4_r2_day_20060101-20701231.nc'
CCCmaSMHI= '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/4.5/tas_AFR-44_CCCma-CanESM2_rcp45_r1i1p1_SMHI-RCA4_v1_day_20060101-20701231.nc'
CNRM= '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/4.5/tas_AFR-44_CNRM-CERFACS-CNRM-CM5_rcp45_r1i1p1_CLMcom-CCLM4-8-17_v1_day_20060101-20701231.nc'
CNRMSMHI= '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/4.5/tas_AFR-44_CNRM-CERFACS-CNRM-CM5_rcp45_r1i1p1_SMHI-RCA4_v1_day_20060101-20701231.nc'
CSIRO = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/4.5/tas_AFR-44_CSIRO-QCCCE-CSIRO-Mk3-6-0_rcp45_r1i1p1_SMHI-RCA4_v1_day_20060101-20701231.nc'
CCCmaCanRCM85 = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/8.5/tas_AFR-44_CCCma-CanESM2_rcp85_r1i1p1_CCCma-CanRCM4_r2_day_20060101-20701231.nc'
CCCmaSMHI85 = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/8.5/tas_AFR-44_CCCma-CanESM2_rcp85_r1i1p1_SMHI-RCA4_v1_day_20060101-20701231.nc'
CNRM85 = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/8.5/tas_AFR-44_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_CLMcom-CCLM4-8-17_v1_day_20060101-20701231.nc'
CNRMSMHI85 = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/8.5/tas_AFR-44_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_SMHI-RCA4_v1_day_20060101-20701231.nc'
CSIRO85 = '/exports/csce/datastore/geos/users/s0899345/AFR_44_tas/8.5/tas_AFR-44_CSIRO-QCCCE-CSIRO-Mk3-6-0_rcp85_r1i1p1_SMHI-RCA4_v1_day_20060101-20701231.nc'
#Load exactly one cube from given file
CCCmaCanRCM = iris.load_cube(CCCmaCanRCM)
CCCmaSMHI = iris.load_cube(CCCmaSMHI)
CNRM = iris.load_cube(CNRM)
CNRMSMHI = iris.load_cube(CNRMSMHI)
CSIRO = iris.load_cube(CSIRO)
CCCmaCanRCM85 = iris.load_cube(CCCmaCanRCM85)
CCCmaSMHI85 = iris.load_cube(CCCmaSMHI85)
CNRM85 = iris.load_cube(CNRM85)
CNRMSMHI85 = iris.load_cube(CNRMSMHI85)
CSIRO85 = iris.load_cube(CSIRO85)
#remove flat latitude and longitude and only use grid latitude and grid longitude to make consistent with the observed data, also make sure all of the longitudes are monotonic.
lats = iris.coords.DimCoord(CCCmaCanRCM.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CCCmaCanRCM.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CCCmaCanRCM.remove_coord('latitude')
CCCmaCanRCM.remove_coord('longitude')
CCCmaCanRCM.remove_coord('grid_latitude')
CCCmaCanRCM.remove_coord('grid_longitude')
CCCmaCanRCM.add_dim_coord(lats, 1)
CCCmaCanRCM.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CCCmaSMHI.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CCCmaSMHI.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CCCmaSMHI.remove_coord('latitude')
CCCmaSMHI.remove_coord('longitude')
CCCmaSMHI.remove_coord('grid_latitude')
CCCmaSMHI.remove_coord('grid_longitude')
CCCmaSMHI.add_dim_coord(lats, 1)
CCCmaSMHI.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CNRM.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CNRM.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CNRM.remove_coord('latitude')
CNRM.remove_coord('longitude')
CNRM.remove_coord('grid_latitude')
CNRM.remove_coord('grid_longitude')
CNRM.add_dim_coord(lats, 1)
CNRM.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CNRMSMHI.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CNRMSMHI.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CNRMSMHI.remove_coord('latitude')
CNRMSMHI.remove_coord('longitude')
CNRMSMHI.remove_coord('grid_latitude')
CNRMSMHI.remove_coord('grid_longitude')
CNRMSMHI.add_dim_coord(lats, 1)
CNRMSMHI.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CSIRO.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CSIRO.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CSIRO.remove_coord('latitude')
CSIRO.remove_coord('longitude')
CSIRO.remove_coord('grid_latitude')
CSIRO.remove_coord('grid_longitude')
CSIRO.add_dim_coord(lats, 1)
CSIRO.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CCCmaCanRCM85.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CCCmaCanRCM85.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CCCmaCanRCM85.remove_coord('latitude')
CCCmaCanRCM85.remove_coord('longitude')
CCCmaCanRCM85.remove_coord('grid_latitude')
CCCmaCanRCM85.remove_coord('grid_longitude')
CCCmaCanRCM85.add_dim_coord(lats, 1)
CCCmaCanRCM85.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CCCmaSMHI85.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CCCmaSMHI85.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CCCmaSMHI85.remove_coord('latitude')
CCCmaSMHI85.remove_coord('longitude')
CCCmaSMHI85.remove_coord('grid_latitude')
CCCmaSMHI85.remove_coord('grid_longitude')
CCCmaSMHI85.add_dim_coord(lats, 1)
CCCmaSMHI85.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CNRM85.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CNRM85.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CNRM85.remove_coord('latitude')
CNRM85.remove_coord('longitude')
CNRM85.remove_coord('grid_latitude')
CNRM85.remove_coord('grid_longitude')
CNRM85.add_dim_coord(lats, 1)
CNRM85.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CNRMSMHI85.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CNRMSMHI85.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CNRMSMHI85.remove_coord('latitude')
CNRMSMHI85.remove_coord('longitude')
CNRMSMHI85.remove_coord('grid_latitude')
CNRMSMHI85.remove_coord('grid_longitude')
CNRMSMHI85.add_dim_coord(lats, 1)
CNRMSMHI85.add_dim_coord(lons, 2)
lats = iris.coords.DimCoord(CSIRO85.coord('latitude').points[:,0], standard_name='latitude', units='degrees')
lons = CSIRO85.coord('longitude').points[0]
for i in range(len(lons)):
if lons[i]>100.:
lons[i] = lons[i]-360.
lons = iris.coords.DimCoord(lons, standard_name='longitude', units='degrees')
CSIRO85.remove_coord('latitude')
CSIRO85.remove_coord('longitude')
CSIRO85.remove_coord('grid_latitude')
CSIRO85.remove_coord('grid_longitude')
CSIRO85.add_dim_coord(lats, 1)
CSIRO85.add_dim_coord(lons, 2)
#guess bounds
CCCmaCanRCM.coord('latitude').guess_bounds()
CCCmaSMHI.coord('latitude').guess_bounds()
CNRM.coord('latitude').guess_bounds()
CNRMSMHI.coord('latitude').guess_bounds()
CSIRO.coord('latitude').guess_bounds()
CCCmaCanRCM85.coord('latitude').guess_bounds()
CCCmaSMHI85.coord('latitude').guess_bounds()
CNRM85.coord('latitude').guess_bounds()
CNRMSMHI85.coord('latitude').guess_bounds()
CSIRO85.coord('latitude').guess_bounds()
CCCmaCanRCM.coord('longitude').guess_bounds()
CCCmaSMHI.coord('longitude').guess_bounds()
CNRM.coord('longitude').guess_bounds()
CNRMSMHI.coord('longitude').guess_bounds()
CSIRO.coord('longitude').guess_bounds()
CCCmaCanRCM85.coord('longitude').guess_bounds()
CCCmaSMHI85.coord('longitude').guess_bounds()
CNRM85.coord('longitude').guess_bounds()
CNRMSMHI85.coord('longitude').guess_bounds()
CSIRO85.coord('longitude').guess_bounds()
#-------------------------------------------------------------------------
#PART 3: LOAD AND FORMAT OBSERVED DATA
#bring in all the files we need and give them a name
CRU= '/exports/csce/datastore/geos/users/s0899345/Actual_Data/cru_ts4.00.1901.2015.tmp.dat.nc'
UDel= '/exports/csce/datastore/geos/users/s0899345/Actual_Data/UDel_air.mon.mean.v401.nc'
#Load exactly one cube from given file
CRU = iris.load_cube(CRU, 'near-surface temperature')
UDel = iris.load_cube(UDel)
#guess bounds
CRU.coord('latitude').guess_bounds()
UDel.coord('latitude').guess_bounds()
CRU.coord('longitude').guess_bounds()
UDel.coord('longitude').guess_bounds()
#-------------------------------------------------------------------------
#PART 4: FORMAT DATA GENERAL
#Convert units to match, CORDEX data is in Kelvin but Observed data in Celsius, we would like to show all data in Celsius
CCCmaCanRCM_past.convert_units('Celsius')
CCCmaSMHI_past.convert_units('Celsius')
CNRM_past.convert_units('Celsius')
CNRMSMHI_past.convert_units('Celsius')
CSIRO_past.convert_units('Celsius')
CCCmaCanRCM.convert_units('Celsius')
CCCmaSMHI.convert_units('Celsius')
CNRM.convert_units('Celsius')
CNRMSMHI.convert_units('Celsius')
CSIRO.convert_units('Celsius')
CCCmaCanRCM85.convert_units('Celsius')
CCCmaSMHI85.convert_units('Celsius')
CNRM85.convert_units('Celsius')
CNRMSMHI85.convert_units('Celsius')
CSIRO85.convert_units('Celsius')
#rename units to match
CRU.units = Unit('Celsius')
UDel.units = Unit('Celsius')
#limit time series of data
#time constraint to make past and obsered data only from 1971-2000
iris.FUTURE.cell_datetime_objects = True
t_constraint_past = iris.Constraint(time=lambda cell: 1971 <= cell.point.year <= 2000)
CCCmaCanRCM_past = CCCmaCanRCM_past.extract(t_constraint_past)
CCCmaSMHI_past = CCCmaSMHI_past.extract(t_constraint_past)
CNRM_past = CNRM_past.extract(t_constraint_past)
CNRMSMHI_past = CNRMSMHI_past.extract(t_constraint_past)
CSIRO_past = CSIRO_past.extract(t_constraint_past)
CRU = CRU.extract(t_constraint_past)
UDel = UDel.extract(t_constraint_past)
#time constraint to make future data only from 2020-2049
iris.FUTURE.cell_datetime_objects = True
t_constraint_future = iris.Constraint(time=lambda cell: 2020 <= cell.point.year <= 2049)
CCCmaCanRCM_30 = CCCmaCanRCM.extract(t_constraint_future)
CCCmaSMHI_30 = CCCmaSMHI.extract(t_constraint_future)
CNRM_30 = CNRM.extract(t_constraint_future)
CNRMSMHI_30 = CNRMSMHI.extract(t_constraint_future)
CSIRO_30 = CSIRO.extract(t_constraint_future)
CCCmaCanRCM85_30 = CCCmaCanRCM85.extract(t_constraint_future)
CCCmaSMHI85_30 = CCCmaSMHI85.extract(t_constraint_future)
CNRM85_30 = CNRM85.extract(t_constraint_future)
CNRMSMHI85_30 = CNRMSMHI85.extract(t_constraint_future)
CSIRO85_30 = CSIRO85.extract(t_constraint_future)
#time constraint to make future data only from 2040-2069
iris.FUTURE.cell_datetime_objects = True
t_constraint_future = iris.Constraint(time=lambda cell: 2040 <= cell.point.year <= 2069)
CCCmaCanRCM_50 = CCCmaCanRCM.extract(t_constraint_future)
CCCmaSMHI_50 = CCCmaSMHI.extract(t_constraint_future)
CNRM_50 = CNRM.extract(t_constraint_future)
CNRMSMHI_50 = CNRMSMHI.extract(t_constraint_future)
CSIRO_50 = CSIRO.extract(t_constraint_future)
CCCmaCanRCM85_50 = CCCmaCanRCM85.extract(t_constraint_future)
CCCmaSMHI85_50 = CCCmaSMHI85.extract(t_constraint_future)
CNRM85_50 = CNRM85.extract(t_constraint_future)
CNRMSMHI85_50 = CNRMSMHI85.extract(t_constraint_future)
CSIRO85_50 = CSIRO85.extract(t_constraint_future)
#-------------------------------------------------------------------------
#PART 5: FORMAT DATA TO GEOGRAPHICALLY SPECIFIC AND RE-BASELINE
#PART 5A: NORTHERN MALAWI
#we are only interested in the latitude and longitude relevant to Central Malawi
Northern_Malawi = iris.Constraint(longitude=lambda v: 32.5 <= v <= 35, latitude=lambda v: -12.5 <= v <= -8.5)
CCCmaCanRCM_past_N = CCCmaCanRCM_past.extract(Northern_Malawi)
CCCmaSMHI_past_N = CCCmaSMHI_past.extract(Northern_Malawi)
CNRM_past_N = CNRM_past.extract(Northern_Malawi)
CNRMSMHI_past_N = CNRMSMHI_past.extract(Northern_Malawi)
CSIRO_past_N = CSIRO_past.extract(Northern_Malawi)
CCCmaCanRCM_30_N = CCCmaCanRCM_30.extract(Northern_Malawi)
CCCmaSMHI_30_N = CCCmaSMHI_30.extract(Northern_Malawi)
CNRM_30_N = CNRM_30.extract(Northern_Malawi)
CNRMSMHI_30_N = CNRMSMHI_30.extract(Northern_Malawi)
CSIRO_30_N = CSIRO_30.extract(Northern_Malawi)
CCCmaCanRCM85_30_N = CCCmaCanRCM85_30.extract(Northern_Malawi)
CCCmaSMHI85_30_N = CCCmaSMHI85_30.extract(Northern_Malawi)
CNRM85_30_N = CNRM85_30.extract(Northern_Malawi)
CNRMSMHI85_30_N = CNRMSMHI85_30.extract(Northern_Malawi)
CSIRO85_30_N = CSIRO85_30.extract(Northern_Malawi)
CCCmaCanRCM_50_N = CCCmaCanRCM_50.extract(Northern_Malawi)
CCCmaSMHI_50_N = CCCmaSMHI_50.extract(Northern_Malawi)
CNRM_50_N = CNRM_50.extract(Northern_Malawi)
CNRMSMHI_50_N = CNRMSMHI_50.extract(Northern_Malawi)
CSIRO_50_N = CSIRO_50.extract(Northern_Malawi)
CCCmaCanRCM85_50_N = CCCmaCanRCM85_50.extract(Northern_Malawi)
CCCmaSMHI85_50_N = CCCmaSMHI85_50.extract(Northern_Malawi)
CNRM85_50_N = CNRM85_50.extract(Northern_Malawi)
CNRMSMHI85_50_N = CNRMSMHI85_50.extract(Northern_Malawi)
CSIRO85_50_N = CSIRO85_50.extract(Northern_Malawi)
CRU_N = CRU.extract(Northern_Malawi)
UDel_N = UDel.extract(Northern_Malawi)
#Returns an array of area weights, with the same dimensions as the cube
CCCmaCanRCM_past_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_past_N)
CCCmaSMHI_past_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_past_N)
CNRM_past_N_grid_areas = iris.analysis.cartography.area_weights(CNRM_past_N)
CNRMSMHI_past_N_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_past_N)
CSIRO_past_N_grid_areas = iris.analysis.cartography.area_weights(CSIRO_past_N)
CCCmaCanRCM_30_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_30_N)
CCCmaSMHI_30_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_30_N)
CNRM_30_N_grid_areas = iris.analysis.cartography.area_weights(CNRM_30_N)
CNRMSMHI_30_N_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_30_N)
CSIRO_30_N_grid_areas = iris.analysis.cartography.area_weights(CSIRO_30_N)
CCCmaCanRCM85_30_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM85_30_N)
CCCmaSMHI85_30_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI85_30_N)
CNRM85_30_N_grid_areas = iris.analysis.cartography.area_weights(CNRM85_30_N)
CNRMSMHI85_30_N_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI85_30_N)
CSIRO85_30_N_grid_areas = iris.analysis.cartography.area_weights(CSIRO85_30_N)
CCCmaCanRCM_50_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_50_N)
CCCmaSMHI_50_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_50_N)
CNRM_50_N_grid_areas = iris.analysis.cartography.area_weights(CNRM_50_N)
CNRMSMHI_50_N_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_50_N)
CSIRO_50_N_grid_areas = iris.analysis.cartography.area_weights(CSIRO_50_N)
CCCmaCanRCM85_50_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM85_50_N)
CCCmaSMHI85_50_N_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI85_50_N)
CNRM85_50_N_grid_areas = iris.analysis.cartography.area_weights(CNRM85_50_N)
CNRMSMHI85_50_N_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI85_50_N)
CSIRO85_50_N_grid_areas = iris.analysis.cartography.area_weights(CSIRO85_50_N)
CRU_N_grid_areas = iris.analysis.cartography.area_weights(CRU_N)
UDel_N_grid_areas = iris.analysis.cartography.area_weights (UDel_N)
#We want to plot the mean for the whole region so we need a mean of all the lats and lons
CCCmaCanRCM_past_N_mean = CCCmaCanRCM_past_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_past_N_grid_areas)
CCCmaSMHI_past_N_mean = CCCmaSMHI_past_N.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_past_N_grid_areas)
CNRM_past_N_mean = CNRM_past_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_past_N_grid_areas)
CNRMSMHI_past_N_mean = CNRMSMHI_past_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_past_N_grid_areas)
CSIRO_past_N_mean = CSIRO_past_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_past_N_grid_areas)
CCCmaCanRCM_30_N_mean = CCCmaCanRCM_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_30_N_grid_areas)
CCCmaSMHI_30_N_mean = CCCmaSMHI_30_N.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_30_N_grid_areas)
CNRM_30_N_mean = CNRM_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_30_N_grid_areas)
CNRMSMHI_30_N_mean = CNRMSMHI_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_30_N_grid_areas)
CSIRO_30_N_mean = CSIRO_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_30_N_grid_areas)
CCCmaCanRCM85_30_N_mean = CCCmaCanRCM85_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM85_30_N_grid_areas)
CCCmaSMHI85_30_N_mean = CCCmaSMHI85_30_N.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI85_30_N_grid_areas)
CNRM85_30_N_mean = CNRM85_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM85_30_N_grid_areas)
CNRMSMHI85_30_N_mean = CNRMSMHI85_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI85_30_N_grid_areas)
CSIRO85_30_N_mean = CSIRO85_30_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO85_30_N_grid_areas)
CCCmaCanRCM_50_N_mean = CCCmaCanRCM_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_50_N_grid_areas)
CCCmaSMHI_50_N_mean = CCCmaSMHI_50_N.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_50_N_grid_areas)
CNRM_50_N_mean = CNRM_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_50_N_grid_areas)
CNRMSMHI_50_N_mean = CNRMSMHI_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_50_N_grid_areas)
CSIRO_50_N_mean = CSIRO_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_50_N_grid_areas)
CCCmaCanRCM85_50_N_mean = CCCmaCanRCM85_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM85_50_N_grid_areas)
CCCmaSMHI85_50_N_mean = CCCmaSMHI85_50_N.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI85_50_N_grid_areas)
CNRM85_50_N_mean = CNRM85_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM85_50_N_grid_areas)
CNRMSMHI85_50_N_mean = CNRMSMHI85_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI85_50_N_grid_areas)
CSIRO85_50_N_mean = CSIRO85_50_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO85_50_N_grid_areas)
CRU_N_mean = CRU_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CRU_N_grid_areas)
UDel_N_mean = UDel_N.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=UDel_N_grid_areas)
#for the baseline we don't need to average for each year, but the average for the whole time period, so collapse by time
CCCmaCanRCM_b_N_mean = CCCmaCanRCM_past_N_mean.collapsed(['time'], iris.analysis.MEAN)
CCCmaSMHI_b_N_mean = CCCmaSMHI_past_N_mean.collapsed(['time'], iris.analysis.MEAN)
CNRM_b_N_mean = CNRM_past_N_mean.collapsed(['time'], iris.analysis.MEAN)
CNRMSMHI_b_N_mean = CNRMSMHI_past_N_mean.collapsed(['time'], iris.analysis.MEAN)
CSIRO_b_N_mean = CSIRO_past_N_mean.collapsed(['time'], iris.analysis.MEAN)
CRU_N_mean = CRU_N_mean.collapsed(['time'], iris.analysis.MEAN)
UDel_N_mean = UDel_N_mean.collapsed(['time'], iris.analysis.MEAN)
#create average of observed baseline data
Obs_N = (CRU_N_mean + UDel_N_mean)/2
#We want to see the change in temperature from the baseline
CCCmaCanRCM_past_N_mean = (CCCmaCanRCM_past_N_mean.data - CCCmaCanRCM_b_N_mean.data + Obs_N.data)
CCCmaSMHI_past_N_mean = (CCCmaSMHI_past_N_mean.data - CCCmaSMHI_b_N_mean.data + Obs_N.data)
CNRM_past_N_mean = (CNRM_past_N_mean.data - CNRM_b_N_mean.data + Obs_N.data)
CNRMSMHI_past_N_mean = (CNRMSMHI_past_N_mean.data - CNRMSMHI_b_N_mean.data + Obs_N.data)
CSIRO_past_N_mean = (CSIRO_past_N_mean.data - CSIRO_b_N_mean.data + Obs_N.data)
CCCmaCanRCM_30_N_mean = (CCCmaCanRCM_30_N_mean.data - CCCmaCanRCM_b_N_mean.data + Obs_N.data)
CCCmaSMHI_30_N_mean = (CCCmaSMHI_30_N_mean.data - CCCmaSMHI_b_N_mean.data + Obs_N.data)
CNRM_30_N_mean = (CNRM_30_N_mean.data - CNRM_b_N_mean.data + Obs_N.data)
CNRMSMHI_30_N_mean = (CNRMSMHI_30_N_mean.data - CNRMSMHI_b_N_mean.data + Obs_N.data)
CSIRO_30_N_mean = (CSIRO_30_N_mean.data - CSIRO_b_N_mean.data + Obs_N.data)
CCCmaCanRCM85_30_N_mean = (CCCmaCanRCM85_30_N_mean.data - CCCmaCanRCM_b_N_mean.data + Obs_N.data)
CCCmaSMHI85_30_N_mean = (CCCmaSMHI85_30_N_mean.data - CCCmaSMHI_b_N_mean.data + Obs_N.data)
CNRM85_30_N_mean = (CNRM85_30_N_mean.data - CNRM_b_N_mean.data + Obs_N.data)
CNRMSMHI85_30_N_mean = (CNRMSMHI85_30_N_mean.data - CNRMSMHI_b_N_mean.data + Obs_N.data)
CSIRO85_30_N_mean = (CSIRO85_30_N_mean.data - CSIRO_b_N_mean.data + Obs_N.data)
CCCmaCanRCM_50_N_mean = (CCCmaCanRCM_50_N_mean.data - CCCmaCanRCM_b_N_mean.data + Obs_N.data)
CCCmaSMHI_50_N_mean = (CCCmaSMHI_50_N_mean.data - CCCmaSMHI_b_N_mean.data + Obs_N.data)
CNRM_50_N_mean = (CNRM_50_N_mean.data - CNRM_b_N_mean.data + Obs_N.data)
CNRMSMHI_50_N_mean = (CNRMSMHI_50_N_mean.data - CNRMSMHI_b_N_mean.data + Obs_N.data)
CSIRO_50_N_mean = (CSIRO_50_N_mean.data - CSIRO_b_N_mean.data + Obs_N.data)
CCCmaCanRCM85_50_N_mean = (CCCmaCanRCM85_50_N_mean.data - CCCmaCanRCM_b_N_mean.data + Obs_N.data)
CCCmaSMHI85_50_N_mean = (CCCmaSMHI85_50_N_mean.data - CCCmaSMHI_b_N_mean.data + Obs_N.data)
CNRM85_50_N_mean = (CNRM85_50_N_mean.data - CNRM_b_N_mean.data + Obs_N.data)
CNRMSMHI85_50_N_mean = (CNRMSMHI85_50_N_mean.data - CNRMSMHI_b_N_mean.data + Obs_N.data)
CSIRO85_50_N_mean = (CSIRO85_50_N_mean.data - CSIRO_b_N_mean.data + Obs_N.data)
#PART 5B: CENTRAL MALAWI
#we are only interested in the latitude and longitude relevant to Central Malawi
Central_Malawi = iris.Constraint(longitude=lambda v: 32.5 <= v <= 35.5, latitude=lambda v: -15 <= v <= -11.5)
CCCmaCanRCM_past_C = CCCmaCanRCM_past.extract(Central_Malawi)
CCCmaSMHI_past_C = CCCmaSMHI_past.extract(Central_Malawi)
CNRM_past_C = CNRM_past.extract(Central_Malawi)
CNRMSMHI_past_C = CNRMSMHI_past.extract(Central_Malawi)
CSIRO_past_C = CSIRO_past.extract(Central_Malawi)
CCCmaCanRCM_30_C = CCCmaCanRCM_30.extract(Central_Malawi)
CCCmaSMHI_30_C = CCCmaSMHI_30.extract(Central_Malawi)
CNRM_30_C = CNRM_30.extract(Central_Malawi)
CNRMSMHI_30_C = CNRMSMHI_30.extract(Central_Malawi)
CSIRO_30_C = CSIRO_30.extract(Central_Malawi)
CCCmaCanRCM85_30_C = CCCmaCanRCM85_30.extract(Central_Malawi)
CCCmaSMHI85_30_C = CCCmaSMHI85_30.extract(Central_Malawi)
CNRM85_30_C = CNRM85_30.extract(Central_Malawi)
CNRMSMHI85_30_C = CNRMSMHI85_30.extract(Central_Malawi)
CSIRO85_30_C = CSIRO85_30.extract(Central_Malawi)
CCCmaCanRCM_50_C = CCCmaCanRCM_50.extract(Central_Malawi)
CCCmaSMHI_50_C = CCCmaSMHI_50.extract(Central_Malawi)
CNRM_50_C = CNRM_50.extract(Central_Malawi)
CNRMSMHI_50_C = CNRMSMHI_50.extract(Central_Malawi)
CSIRO_50_C = CSIRO_50.extract(Central_Malawi)
CCCmaCanRCM85_50_C = CCCmaCanRCM85_50.extract(Central_Malawi)
CCCmaSMHI85_50_C = CCCmaSMHI85_50.extract(Central_Malawi)
CNRM85_50_C = CNRM85_50.extract(Central_Malawi)
CNRMSMHI85_50_C = CNRMSMHI85_50.extract(Central_Malawi)
CSIRO85_50_C = CSIRO85_50.extract(Central_Malawi)
CRU_C = CRU.extract(Central_Malawi)
UDel_C = UDel.extract(Central_Malawi)
#Returns an array of area weights, with the same dimensions as the cube
CCCmaCanRCM_past_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_past_C)
CCCmaSMHI_past_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_past_C)
CNRM_past_C_grid_areas = iris.analysis.cartography.area_weights(CNRM_past_C)
CNRMSMHI_past_C_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_past_C)
CSIRO_past_C_grid_areas = iris.analysis.cartography.area_weights(CSIRO_past_C)
CCCmaCanRCM_30_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_30_C)
CCCmaSMHI_30_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_30_C)
CNRM_30_C_grid_areas = iris.analysis.cartography.area_weights(CNRM_30_C)
CNRMSMHI_30_C_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_30_C)
CSIRO_30_C_grid_areas = iris.analysis.cartography.area_weights(CSIRO_30_C)
CCCmaCanRCM85_30_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM85_30_C)
CCCmaSMHI85_30_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI85_30_C)
CNRM85_30_C_grid_areas = iris.analysis.cartography.area_weights(CNRM85_30_C)
CNRMSMHI85_30_C_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI85_30_C)
CSIRO85_30_C_grid_areas = iris.analysis.cartography.area_weights(CSIRO85_30_C)
CCCmaCanRCM_50_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_50_C)
CCCmaSMHI_50_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_50_C)
CNRM_50_C_grid_areas = iris.analysis.cartography.area_weights(CNRM_50_C)
CNRMSMHI_50_C_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_50_C)
CSIRO_50_C_grid_areas = iris.analysis.cartography.area_weights(CSIRO_50_C)
CCCmaCanRCM85_50_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM85_50_C)
CCCmaSMHI85_50_C_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI85_50_C)
CNRM85_50_C_grid_areas = iris.analysis.cartography.area_weights(CNRM85_50_C)
CNRMSMHI85_50_C_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI85_50_C)
CSIRO85_50_C_grid_areas = iris.analysis.cartography.area_weights(CSIRO85_50_C)
CRU_C_grid_areas = iris.analysis.cartography.area_weights(CRU_C)
UDel_C_grid_areas = iris.analysis.cartography.area_weights (UDel_C)
#We want to plot the mean for the whole region so we need a mean of all the lats and lons
CCCmaCanRCM_past_C_mean = CCCmaCanRCM_past_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_past_C_grid_areas)
CCCmaSMHI_past_C_mean = CCCmaSMHI_past_C.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_past_C_grid_areas)
CNRM_past_C_mean = CNRM_past_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_past_C_grid_areas)
CNRMSMHI_past_C_mean = CNRMSMHI_past_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_past_C_grid_areas)
CSIRO_past_C_mean = CSIRO_past_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_past_C_grid_areas)
CCCmaCanRCM_30_C_mean = CCCmaCanRCM_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_30_C_grid_areas)
CCCmaSMHI_30_C_mean = CCCmaSMHI_30_C.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_30_C_grid_areas)
CNRM_30_C_mean = CNRM_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_30_C_grid_areas)
CNRMSMHI_30_C_mean = CNRMSMHI_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_30_C_grid_areas)
CSIRO_30_C_mean = CSIRO_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_30_C_grid_areas)
CCCmaCanRCM85_30_C_mean = CCCmaCanRCM85_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM85_30_C_grid_areas)
CCCmaSMHI85_30_C_mean = CCCmaSMHI85_30_C.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI85_30_C_grid_areas)
CNRM85_30_C_mean = CNRM85_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM85_30_C_grid_areas)
CNRMSMHI85_30_C_mean = CNRMSMHI85_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI85_30_C_grid_areas)
CSIRO85_30_C_mean = CSIRO85_30_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO85_30_C_grid_areas)
CCCmaCanRCM_50_C_mean = CCCmaCanRCM_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_50_C_grid_areas)
CCCmaSMHI_50_C_mean = CCCmaSMHI_50_C.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_50_C_grid_areas)
CNRM_50_C_mean = CNRM_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_50_C_grid_areas)
CNRMSMHI_50_C_mean = CNRMSMHI_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_50_C_grid_areas)
CSIRO_50_C_mean = CSIRO_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_50_C_grid_areas)
CCCmaCanRCM85_50_C_mean = CCCmaCanRCM85_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM85_50_C_grid_areas)
CCCmaSMHI85_50_C_mean = CCCmaSMHI85_50_C.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI85_50_C_grid_areas)
CNRM85_50_C_mean = CNRM85_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM85_50_C_grid_areas)
CNRMSMHI85_50_C_mean = CNRMSMHI85_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI85_50_C_grid_areas)
CSIRO85_50_C_mean = CSIRO85_50_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO85_50_C_grid_areas)
CRU_C_mean = CRU_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CRU_C_grid_areas)
UDel_C_mean = UDel_C.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=UDel_C_grid_areas)
#for the baseline we don't need to average for each year, but the average for the whole time period, so collapse by time
CCCmaCanRCM_b_C_mean = CCCmaCanRCM_past_C_mean.collapsed(['time'], iris.analysis.MEAN)
CCCmaSMHI_b_C_mean = CCCmaSMHI_past_C_mean.collapsed(['time'], iris.analysis.MEAN)
CNRM_b_C_mean = CNRM_past_C_mean.collapsed(['time'], iris.analysis.MEAN)
CNRMSMHI_b_C_mean = CNRMSMHI_past_C_mean.collapsed(['time'], iris.analysis.MEAN)
CSIRO_b_C_mean = CSIRO_past_C_mean.collapsed(['time'], iris.analysis.MEAN)
CRU_C_mean = CRU_C_mean.collapsed(['time'], iris.analysis.MEAN)
UDel_C_mean = UDel_C_mean.collapsed(['time'], iris.analysis.MEAN)
#create average of observed baseline data
Obs_C = (CRU_C_mean + UDel_C_mean)/2
#We want to see the change in temperature from the baseline
CCCmaCanRCM_past_C_mean = (CCCmaCanRCM_past_C_mean.data - CCCmaCanRCM_b_C_mean.data + Obs_C.data)
CCCmaSMHI_past_C_mean = (CCCmaSMHI_past_C_mean.data - CCCmaSMHI_b_C_mean.data + Obs_C.data)
CNRM_past_C_mean = (CNRM_past_C_mean.data - CNRM_b_C_mean.data + Obs_C.data)
CNRMSMHI_past_C_mean = (CNRMSMHI_past_C_mean.data - CNRMSMHI_b_C_mean.data + Obs_C.data)
CSIRO_past_C_mean = (CSIRO_past_C_mean.data - CSIRO_b_C_mean.data + Obs_C.data)
CCCmaCanRCM_30_C_mean = (CCCmaCanRCM_30_C_mean.data - CCCmaCanRCM_b_C_mean.data + Obs_C.data)
CCCmaSMHI_30_C_mean = (CCCmaSMHI_30_C_mean.data - CCCmaSMHI_b_C_mean.data + Obs_C.data)
CNRM_30_C_mean = (CNRM_30_C_mean.data - CNRM_b_C_mean.data + Obs_C.data)
CNRMSMHI_30_C_mean = (CNRMSMHI_30_C_mean.data - CNRMSMHI_b_C_mean.data + Obs_C.data)
CSIRO_30_C_mean = (CSIRO_30_C_mean.data - CSIRO_b_C_mean.data + Obs_C.data)
CCCmaCanRCM85_30_C_mean = (CCCmaCanRCM85_30_C_mean.data - CCCmaCanRCM_b_C_mean.data + Obs_C.data)
CCCmaSMHI85_30_C_mean = (CCCmaSMHI85_30_C_mean.data - CCCmaSMHI_b_C_mean.data + Obs_C.data)
CNRM85_30_C_mean = (CNRM85_30_C_mean.data - CNRM_b_C_mean.data + Obs_C.data)
CNRMSMHI85_30_C_mean = (CNRMSMHI85_30_C_mean.data - CNRMSMHI_b_C_mean.data + Obs_C.data)
CSIRO85_30_C_mean = (CSIRO85_30_C_mean.data - CSIRO_b_C_mean.data + Obs_C.data)
CCCmaCanRCM_50_C_mean = (CCCmaCanRCM_50_C_mean.data - CCCmaCanRCM_b_C_mean.data + Obs_C.data)
CCCmaSMHI_50_C_mean = (CCCmaSMHI_50_C_mean.data - CCCmaSMHI_b_C_mean.data + Obs_C.data)
CNRM_50_C_mean = (CNRM_50_C_mean.data - CNRM_b_C_mean.data + Obs_C.data)
CNRMSMHI_50_C_mean = (CNRMSMHI_50_C_mean.data - CNRMSMHI_b_C_mean.data + Obs_C.data)
CSIRO_50_C_mean = (CSIRO_50_C_mean.data - CSIRO_b_C_mean.data + Obs_C.data)
CCCmaCanRCM85_50_C_mean = (CCCmaCanRCM85_50_C_mean.data - CCCmaCanRCM_b_C_mean.data + Obs_C.data)
CCCmaSMHI85_50_C_mean = (CCCmaSMHI85_50_C_mean.data - CCCmaSMHI_b_C_mean.data + Obs_C.data)
CNRM85_50_C_mean = (CNRM85_50_C_mean.data - CNRM_b_C_mean.data + Obs_C.data)
CNRMSMHI85_50_C_mean = (CNRMSMHI85_50_C_mean.data - CNRMSMHI_b_C_mean.data + Obs_C.data)
CSIRO85_50_C_mean = (CSIRO85_50_C_mean.data - CSIRO_b_C_mean.data + Obs_C.data)
#PART 5C: SOUTHERN MALAWI
#we are only interested in the latitude and longitude relevant to Southern Malawi
Southern_Malawi = iris.Constraint(longitude=lambda v: 34 <= v <= 36.5, latitude=lambda v: -17.5 <= v <= -14)
CCCmaCanRCM_past_S = CCCmaCanRCM_past.extract(Southern_Malawi)
CCCmaSMHI_past_S = CCCmaSMHI_past.extract(Southern_Malawi)
CNRM_past_S = CNRM_past.extract(Southern_Malawi)
CNRMSMHI_past_S = CNRMSMHI_past.extract(Southern_Malawi)
CSIRO_past_S = CSIRO_past.extract(Southern_Malawi)
CCCmaCanRCM_30_S = CCCmaCanRCM_30.extract(Southern_Malawi)
CCCmaSMHI_30_S = CCCmaSMHI_30.extract(Southern_Malawi)
CNRM_30_S = CNRM_30.extract(Southern_Malawi)
CNRMSMHI_30_S = CNRMSMHI_30.extract(Southern_Malawi)
CSIRO_30_S = CSIRO_30.extract(Southern_Malawi)
CCCmaCanRCM85_30_S = CCCmaCanRCM85_30.extract(Southern_Malawi)
CCCmaSMHI85_30_S = CCCmaSMHI85_30.extract(Southern_Malawi)
CNRM85_30_S = CNRM85_30.extract(Southern_Malawi)
CNRMSMHI85_30_S = CNRMSMHI85_30.extract(Southern_Malawi)
CSIRO85_30_S = CSIRO85_30.extract(Southern_Malawi)
CCCmaCanRCM_50_S = CCCmaCanRCM_50.extract(Southern_Malawi)
CCCmaSMHI_50_S = CCCmaSMHI_50.extract(Southern_Malawi)
CNRM_50_S = CNRM_50.extract(Southern_Malawi)
CNRMSMHI_50_S = CNRMSMHI_50.extract(Southern_Malawi)
CSIRO_50_S = CSIRO_50.extract(Southern_Malawi)
CCCmaCanRCM85_50_S = CCCmaCanRCM85_50.extract(Southern_Malawi)
CCCmaSMHI85_50_S = CCCmaSMHI85_50.extract(Southern_Malawi)
CNRM85_50_S = CNRM85_50.extract(Southern_Malawi)
CNRMSMHI85_50_S = CNRMSMHI85_50.extract(Southern_Malawi)
CSIRO85_50_S = CSIRO85_50.extract(Southern_Malawi)
CRU_S = CRU.extract(Southern_Malawi)
UDel_S = UDel.extract(Southern_Malawi)
#Returns an array of area weights, with the same dimensions as the cube
CCCmaCanRCM_past_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_past_S)
CCCmaSMHI_past_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_past_S)
CNRM_past_S_grid_areas = iris.analysis.cartography.area_weights(CNRM_past_S)
CNRMSMHI_past_S_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_past_S)
CSIRO_past_S_grid_areas = iris.analysis.cartography.area_weights(CSIRO_past_S)
CCCmaCanRCM_30_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_30_S)
CCCmaSMHI_30_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_30_S)
CNRM_30_S_grid_areas = iris.analysis.cartography.area_weights(CNRM_30_S)
CNRMSMHI_30_S_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_30_S)
CSIRO_30_S_grid_areas = iris.analysis.cartography.area_weights(CSIRO_30_S)
CCCmaCanRCM85_30_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM85_30_S)
CCCmaSMHI85_30_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI85_30_S)
CNRM85_30_S_grid_areas = iris.analysis.cartography.area_weights(CNRM85_30_S)
CNRMSMHI85_30_S_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI85_30_S)
CSIRO85_30_S_grid_areas = iris.analysis.cartography.area_weights(CSIRO85_30_S)
CCCmaCanRCM_50_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM_50_S)
CCCmaSMHI_50_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI_50_S)
CNRM_50_S_grid_areas = iris.analysis.cartography.area_weights(CNRM_50_S)
CNRMSMHI_50_S_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI_50_S)
CSIRO_50_S_grid_areas = iris.analysis.cartography.area_weights(CSIRO_50_S)
CCCmaCanRCM85_50_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaCanRCM85_50_S)
CCCmaSMHI85_50_S_grid_areas = iris.analysis.cartography.area_weights(CCCmaSMHI85_50_S)
CNRM85_50_S_grid_areas = iris.analysis.cartography.area_weights(CNRM85_50_S)
CNRMSMHI85_50_S_grid_areas = iris.analysis.cartography.area_weights(CNRMSMHI85_50_S)
CSIRO85_50_S_grid_areas = iris.analysis.cartography.area_weights(CSIRO85_50_S)
CRU_S_grid_areas = iris.analysis.cartography.area_weights(CRU_S)
UDel_S_grid_areas = iris.analysis.cartography.area_weights (UDel_S)
#We want to plot the mean for the whole region so we need a mean of all the lats and lons
CCCmaCanRCM_past_S_mean = CCCmaCanRCM_past_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_past_S_grid_areas)
CCCmaSMHI_past_S_mean = CCCmaSMHI_past_S.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_past_S_grid_areas)
CNRM_past_S_mean = CNRM_past_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_past_S_grid_areas)
CNRMSMHI_past_S_mean = CNRMSMHI_past_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_past_S_grid_areas)
CSIRO_past_S_mean = CSIRO_past_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_past_S_grid_areas)
CCCmaCanRCM_30_S_mean = CCCmaCanRCM_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_30_S_grid_areas)
CCCmaSMHI_30_S_mean = CCCmaSMHI_30_S.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_30_S_grid_areas)
CNRM_30_S_mean = CNRM_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_30_S_grid_areas)
CNRMSMHI_30_S_mean = CNRMSMHI_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_30_S_grid_areas)
CSIRO_30_S_mean = CSIRO_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_30_S_grid_areas)
CCCmaCanRCM85_30_S_mean = CCCmaCanRCM85_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM85_30_S_grid_areas)
CCCmaSMHI85_30_S_mean = CCCmaSMHI85_30_S.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI85_30_S_grid_areas)
CNRM85_30_S_mean = CNRM85_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM85_30_S_grid_areas)
CNRMSMHI85_30_S_mean = CNRMSMHI85_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI85_30_S_grid_areas)
CSIRO85_30_S_mean = CSIRO85_30_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO85_30_S_grid_areas)
CCCmaCanRCM_50_S_mean = CCCmaCanRCM_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM_50_S_grid_areas)
CCCmaSMHI_50_S_mean = CCCmaSMHI_50_S.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI_50_S_grid_areas)
CNRM_50_S_mean = CNRM_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM_50_S_grid_areas)
CNRMSMHI_50_S_mean = CNRMSMHI_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI_50_S_grid_areas)
CSIRO_50_S_mean = CSIRO_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO_50_S_grid_areas)
CCCmaCanRCM85_50_S_mean = CCCmaCanRCM85_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CCCmaCanRCM85_50_S_grid_areas)
CCCmaSMHI85_50_S_mean = CCCmaSMHI85_50_S.collapsed(['latitude', 'longitude'],iris.analysis.MEAN, weights=CCCmaSMHI85_50_S_grid_areas)
CNRM85_50_S_mean = CNRM85_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRM85_50_S_grid_areas)
CNRMSMHI85_50_S_mean = CNRMSMHI85_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CNRMSMHI85_50_S_grid_areas)
CSIRO85_50_S_mean = CSIRO85_50_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CSIRO85_50_S_grid_areas)
CRU_S_mean = CRU_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=CRU_S_grid_areas)
UDel_S_mean = UDel_S.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=UDel_S_grid_areas)
#for the baseline we don't need to average for each year, but the average for the whole time period, so collapse by time
CCCmaCanRCM_b_S_mean = CCCmaCanRCM_past_S_mean.collapsed(['time'], iris.analysis.MEAN)
CCCmaSMHI_b_S_mean = CCCmaSMHI_past_S_mean.collapsed(['time'], iris.analysis.MEAN)
CNRM_b_S_mean = CNRM_past_S_mean.collapsed(['time'], iris.analysis.MEAN)
CNRMSMHI_b_S_mean = CNRMSMHI_past_S_mean.collapsed(['time'], iris.analysis.MEAN)
CSIRO_b_S_mean = CSIRO_past_S_mean.collapsed(['time'], iris.analysis.MEAN)
CRU_S_mean = CRU_S_mean.collapsed(['time'], iris.analysis.MEAN)
UDel_S_mean = UDel_S_mean.collapsed(['time'], iris.analysis.MEAN)
#create average of observed baseline data
Obs_S = (CRU_S_mean + UDel_S_mean)/2
#We want to see the change in temperature from the baseline
CCCmaCanRCM_past_S_mean = (CCCmaCanRCM_past_S_mean.data - CCCmaCanRCM_b_S_mean.data + Obs_S.data)
CCCmaSMHI_past_S_mean = (CCCmaSMHI_past_S_mean.data - CCCmaSMHI_b_S_mean.data + Obs_S.data)
CNRM_past_S_mean = (CNRM_past_S_mean.data - CNRM_b_S_mean.data + Obs_S.data)
CNRMSMHI_past_S_mean = (CNRMSMHI_past_S_mean.data - CNRMSMHI_b_S_mean.data + Obs_S.data)
CSIRO_past_S_mean = (CSIRO_past_S_mean.data - CSIRO_b_S_mean.data + Obs_S.data)
CCCmaCanRCM_30_S_mean = (CCCmaCanRCM_30_S_mean.data - CCCmaCanRCM_b_S_mean.data + Obs_S.data)
CCCmaSMHI_30_S_mean = (CCCmaSMHI_30_S_mean.data - CCCmaSMHI_b_S_mean.data + Obs_S.data)
CNRM_30_S_mean = (CNRM_30_S_mean.data - CNRM_b_S_mean.data + Obs_S.data)
CNRMSMHI_30_S_mean = (CNRMSMHI_30_S_mean.data - CNRMSMHI_b_S_mean.data + Obs_S.data)
CSIRO_30_S_mean = (CSIRO_30_S_mean.data - CSIRO_b_S_mean.data + Obs_S.data)
CCCmaCanRCM85_30_S_mean = (CCCmaCanRCM85_30_S_mean.data - CCCmaCanRCM_b_S_mean.data + Obs_S.data)
CCCmaSMHI85_30_S_mean = (CCCmaSMHI85_30_S_mean.data - CCCmaSMHI_b_S_mean.data + Obs_S.data)
CNRM85_30_S_mean = (CNRM85_30_S_mean.data - CNRM_b_S_mean.data + Obs_S.data)
CNRMSMHI85_30_S_mean = (CNRMSMHI85_30_S_mean.data - CNRMSMHI_b_S_mean.data + Obs_S.data)
CSIRO85_30_S_mean = (CSIRO85_30_S_mean.data - CSIRO_b_S_mean.data + Obs_S.data)
CCCmaCanRCM_50_S_mean = (CCCmaCanRCM_50_S_mean.data - CCCmaCanRCM_b_S_mean.data + Obs_S.data)
CCCmaSMHI_50_S_mean = (CCCmaSMHI_50_S_mean.data - CCCmaSMHI_b_S_mean.data + Obs_S.data)
CNRM_50_S_mean = (CNRM_50_S_mean.data - CNRM_b_S_mean.data + Obs_S.data)
CNRMSMHI_50_S_mean = (CNRMSMHI_50_S_mean.data - CNRMSMHI_b_S_mean.data + Obs_S.data)
CSIRO_50_S_mean = (CSIRO_50_S_mean.data - CSIRO_b_S_mean.data + Obs_S.data)
CCCmaCanRCM85_50_S_mean = (CCCmaCanRCM85_50_S_mean.data - CCCmaCanRCM_b_S_mean.data + Obs_S.data)
CCCmaSMHI85_50_S_mean = (CCCmaSMHI85_50_S_mean.data - CCCmaSMHI_b_S_mean.data + Obs_S.data)
CNRM85_50_S_mean = (CNRM85_50_S_mean.data - CNRM_b_S_mean.data + Obs_S.data)
CNRMSMHI85_50_S_mean = (CNRMSMHI85_50_S_mean.data - CNRMSMHI_b_S_mean.data + Obs_S.data)
CSIRO85_50_S_mean = (CSIRO85_50_S_mean.data - CSIRO_b_S_mean.data + Obs_S.data)
#-------------------------------------------------------------------------
#PART 6: PRINT DATAtasmi
import csv
with open('output_DailyTasdataV3a.csv', 'wb') as csvfile:
writer = csv.writer(csvfile, delimiter=',')
writer.writerow(['Parameter', 'Means'])
#PART 6A: WRITE NORTHERN DATA
writer.writerow(["CCCmaCanRCM_past_N_mean"] + CCCmaCanRCM_past_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_past_N_mean"] + CCCmaSMHI_past_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_past_N_mean"] + CNRM_past_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_past_N_mean"] +CNRMSMHI_past_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_past_N_mean"] +CSIRO_past_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM_30_N_mean"] + CCCmaCanRCM_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_30_N_mean"] + CCCmaSMHI_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_30_N_mean"] + CNRM_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_30_N_mean"] +CNRMSMHI_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_30_N_mean"] +CSIRO_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM85_30_N_mean"] + CCCmaCanRCM85_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI85_30_N_mean"] + CCCmaSMHI85_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM85_30_N_mean"] + CNRM85_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI85_30_N_mean"] +CNRMSMHI85_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO85_30_N_mean"] +CSIRO85_30_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM_50_N_mean"] + CCCmaCanRCM_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_50_N_mean"] + CCCmaSMHI_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_50_N_mean"] + CNRM_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_50_N_mean"] +CNRMSMHI_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_50_N_mean"] +CSIRO_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM85_50_N_mean"] + CCCmaCanRCM85_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI85_50_N_mean"] + CCCmaSMHI85_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM85_50_N_mean"] + CNRM85_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI85_50_N_mean"] +CNRMSMHI85_50_N_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO85_50_N_mean"] +CSIRO85_50_N_mean.data.flatten().astype(np.str).tolist())
#PART 6B: WRITE CENTRAL DATA
writer.writerow(["CCCmaCanRCM_past_C_mean"] + CCCmaCanRCM_past_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_past_C_mean"] + CCCmaSMHI_past_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_past_C_mean"] + CNRM_past_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_past_C_mean"] +CNRMSMHI_past_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_past_C_mean"] +CSIRO_past_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM_30_C_mean"] + CCCmaCanRCM_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_30_C_mean"] + CCCmaSMHI_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_30_C_mean"] + CNRM_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_30_C_mean"] +CNRMSMHI_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_30_C_mean"] +CSIRO_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM85_30_C_mean"] + CCCmaCanRCM85_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI85_30_C_mean"] + CCCmaSMHI85_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM85_30_C_mean"] + CNRM85_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI85_30_C_mean"] +CNRMSMHI85_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO85_30_C_mean"] +CSIRO85_30_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM_50_C_mean"] + CCCmaCanRCM_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_50_C_mean"] + CCCmaSMHI_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_50_C_mean"] + CNRM_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_50_C_mean"] +CNRMSMHI_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_50_C_mean"] +CSIRO_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM85_50_C_mean"] + CCCmaCanRCM85_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI85_50_C_mean"] + CCCmaSMHI85_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM85_50_C_mean"] + CNRM85_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI85_50_C_mean"] +CNRMSMHI85_50_C_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO85_50_C_mean"] +CSIRO85_50_C_mean.data.flatten().astype(np.str).tolist())
#PART 6C: WRITE SOUTHERN DATA
writer.writerow(["CCCmaCanRCM_past_S_mean"] + CCCmaCanRCM_past_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_past_S_mean"] + CCCmaSMHI_past_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_past_S_mean"] + CNRM_past_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_past_S_mean"] +CNRMSMHI_past_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_past_S_mean"] +CSIRO_past_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM_30_S_mean"] + CCCmaCanRCM_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_30_S_mean"] + CCCmaSMHI_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_30_S_mean"] + CNRM_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_30_S_mean"] +CNRMSMHI_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_30_S_mean"] +CSIRO_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM85_30_S_mean"] + CCCmaCanRCM85_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI85_30_S_mean"] + CCCmaSMHI85_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM85_30_S_mean"] + CNRM85_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI85_30_S_mean"] +CNRMSMHI85_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO85_30_S_mean"] +CSIRO85_30_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM_50_S_mean"] + CCCmaCanRCM_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI_50_S_mean"] + CCCmaSMHI_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM_50_S_mean"] + CNRM_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI_50_S_mean"] +CNRMSMHI_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO_50_S_mean"] +CSIRO_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaCanRCM85_50_S_mean"] + CCCmaCanRCM85_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CCCmaSMHI85_50_S_mean"] + CCCmaSMHI85_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRM85_50_S_mean"] + CNRM85_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CNRMSMHI85_50_S_mean"] +CNRMSMHI85_50_S_mean.data.flatten().astype(np.str).tolist())
writer.writerow(["CSIRO85_50_S_mean"] +CSIRO85_50_S_mean.data.flatten().astype(np.str).tolist())
if __name__ == '__main__':
main()
| 64.656315 | 187 | 0.730187 | 8,852 | 62,458 | 4.757343 | 0.03005 | 0.042743 | 0.038754 | 0.040392 | 0.82207 | 0.737723 | 0.707091 | 0.660904 | 0.621319 | 0.337386 | 0 | 0.057584 | 0.1542 | 62,458 | 966 | 188 | 64.656315 | 0.739584 | 0.054004 | 0 | 0.086066 | 0 | 0.023224 | 0.122416 | 0.050572 | 0 | 0 | 0 | 0 | 0 | 1 | 0.001366 | false | 0 | 0.009563 | 0 | 0.010929 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fcafd5727239c4c514dd2f164dd9b6cf896ea4da | 865 | py | Python | db/base_redis/base.py | liuansen/python-utils-class | 7f5371ab09b433f555f732dd35350581701e16f0 | [
"Apache-2.0"
] | 3 | 2019-05-09T08:15:29.000Z | 2021-10-12T06:24:49.000Z | db/base_redis/base.py | liuansen/python-utils-class | 7f5371ab09b433f555f732dd35350581701e16f0 | [
"Apache-2.0"
] | 3 | 2020-03-24T06:22:02.000Z | 2021-06-10T21:28:35.000Z | db/base_redis/base.py | liuansen/python-utils-class | 7f5371ab09b433f555f732dd35350581701e16f0 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# author:Anson
from __future__ import unicode_literals
import settings
import redis
class RedisPool(object):
def __init__(self, conf='default'):
redis_config = settings.REDIS_CONNECTION[conf]
print redis_config
self.pool = redis.ConnectionPool(host=redis_config['HOST'],
port=redis_config['PORT'],
password=redis_config['PASSWD'])
def get_pool(self):
return self.pool
def get_redis(self):
return redis.Redis(connection_pool=self.pool)
def get_pipeline(self):
redis_config = settings.REDIS_CONNECTION['default']
return redis.Redis(
host=redis_config['HOST'], port=redis_config['PORT'],
password=redis_config['PASSWD']).pipeline()
| 29.827586 | 74 | 0.59422 | 91 | 865 | 5.384615 | 0.351648 | 0.202041 | 0.077551 | 0.097959 | 0.395918 | 0.257143 | 0.257143 | 0.257143 | 0.257143 | 0.257143 | 0 | 0.001653 | 0.300578 | 865 | 28 | 75 | 30.892857 | 0.808264 | 0.03815 | 0 | 0 | 0 | 0 | 0.052434 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.105263 | 0.157895 | null | null | 0.052632 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
fcb59e206519aae34d68aaab0e2fd8f3edd7b69c | 63,101 | py | Python | cryptowatch/stream/proto/public/markets/market_pb2.py | hikarubw/cw-sdk-python | 1b72a85b3b2f5fc8003677a68a26e1b349bea2f1 | [
"BSD-2-Clause"
] | null | null | null | cryptowatch/stream/proto/public/markets/market_pb2.py | hikarubw/cw-sdk-python | 1b72a85b3b2f5fc8003677a68a26e1b349bea2f1 | [
"BSD-2-Clause"
] | null | null | null | cryptowatch/stream/proto/public/markets/market_pb2.py | hikarubw/cw-sdk-python | 1b72a85b3b2f5fc8003677a68a26e1b349bea2f1 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: public/markets/market.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='public/markets/market.proto',
package='ProtobufMarkets',
syntax='proto3',
serialized_options=None,
serialized_pb=b'\n\x1bpublic/markets/market.proto\x12\x0fProtobufMarkets\"n\n\x06Market\x12\x12\n\nexchangeId\x18\x03 \x01(\x04\x12\x16\n\x0e\x63urrencyPairId\x18\x04 \x01(\x04\x12\x10\n\x08marketId\x18\x05 \x01(\x04\x12\x10\n\x08\x65xchange\x18\x01 \x01(\t\x12\x14\n\x0c\x63urrencyPair\x18\x02 \x01(\t\"K\n\x05Order\x12\x10\n\x08priceStr\x18\x03 \x01(\t\x12\x11\n\tamountStr\x18\x04 \x01(\t\x12\r\n\x05price\x18\x01 \x01(\x02\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x02\"\xdd\x01\n\x05Trade\x12\x12\n\nexternalId\x18\x0b \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x03\x12\x1b\n\x0ftimestampMillis\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x15\n\rtimestampNano\x18\n \x01(\x03\x12\x10\n\x08priceStr\x18\x08 \x01(\t\x12\x11\n\tamountStr\x18\t \x01(\t\x12\r\n\x05price\x18\x03 \x01(\x02\x12\x0e\n\x06\x61mount\x18\x04 \x01(\x02\x12\x13\n\x0bpriceDouble\x18\x06 \x01(\x01\x12\x14\n\x0c\x61mountDouble\x18\x07 \x01(\x01\x12\n\n\x02id\x18\x01 \x01(\x03\"\xd4\x04\n\x13MarketUpdateMessage\x12\'\n\x06market\x18\t \x01(\x0b\x32\x17.ProtobufMarkets.Market\x12;\n\x0forderBookUpdate\x18\x02 \x01(\x0b\x32 .ProtobufMarkets.OrderBookUpdateH\x00\x12\x45\n\x14orderBookDeltaUpdate\x18\x03 \x01(\x0b\x32%.ProtobufMarkets.OrderBookDeltaUpdateH\x00\x12G\n\x15orderBookSpreadUpdate\x18\x0b \x01(\x0b\x32&.ProtobufMarkets.OrderBookSpreadUpdateH\x00\x12M\n\x18orderBookLiquidityUpdate\x18\x0c \x01(\x0b\x32).ProtobufMarkets.OrderBookLiquidityUpdateH\x00\x12\x35\n\x0ctradesUpdate\x18\x04 \x01(\x0b\x32\x1d.ProtobufMarkets.TradesUpdateH\x00\x12;\n\x0fintervalsUpdate\x18\x05 \x01(\x0b\x32 .ProtobufMarkets.IntervalsUpdateH\x00\x12\x37\n\rsummaryUpdate\x18\x06 \x01(\x0b\x32\x1e.ProtobufMarkets.SummaryUpdateH\x00\x12;\n\x0fsparklineUpdate\x18\x07 \x01(\x0b\x32 .ProtobufMarkets.SparklineUpdateH\x00\x42\x08\n\x06UpdateJ\x04\x08\x08\x10\t\"\xa8\x01\n\x0fOrderBookUpdate\x12\x1d\n\x15\x61ggregationModulusStr\x18\x04 \x01(\t\x12\x0e\n\x06seqNum\x18\x05 \x01(\x05\x12$\n\x04\x62ids\x18\x01 \x03(\x0b\x32\x16.ProtobufMarkets.Order\x12$\n\x04\x61sks\x18\x02 \x03(\x0b\x32\x16.ProtobufMarkets.Order\x12\x1a\n\x12\x61ggregationModulus\x18\x03 \x01(\x02\"\xe6\x02\n\x14OrderBookDeltaUpdate\x12\x1a\n\x12\x61ggregationModulus\x18\x03 \x01(\x02\x12\x1d\n\x15\x61ggregationModulusStr\x18\x04 \x01(\t\x12\x0e\n\x06seqNum\x18\x05 \x01(\x05\x12?\n\x04\x62ids\x18\x01 \x01(\x0b\x32\x31.ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas\x12?\n\x04\x61sks\x18\x02 \x01(\x0b\x32\x31.ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas\x1a\x80\x01\n\x0bOrderDeltas\x12#\n\x03set\x18\x01 \x03(\x0b\x32\x16.ProtobufMarkets.Order\x12%\n\x05\x64\x65lta\x18\x02 \x03(\x0b\x32\x16.ProtobufMarkets.Order\x12\x12\n\x06remove\x18\x03 \x03(\x02\x42\x02\x10\x00\x12\x11\n\tremoveStr\x18\x04 \x03(\t\"t\n\x15OrderBookSpreadUpdate\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12#\n\x03\x62id\x18\x02 \x01(\x0b\x32\x16.ProtobufMarkets.Order\x12#\n\x03\x61sk\x18\x03 \x01(\x0b\x32\x16.ProtobufMarkets.Order\"\xea\x08\n\x18OrderBookLiquidityUpdate\x12\x11\n\ttimestamp\x18\x01 \x01(\x03\x12S\n\x03\x62id\x18\x02 \x01(\x0b\x32\x46.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide\x12S\n\x03\x61sk\x18\x03 \x01(\x0b\x32\x46.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide\x1a?\n\x16OrderBookLiquiditySums\x12\x11\n\ttotalBase\x18\x01 \x01(\t\x12\x12\n\ntotalQuote\x18\x02 \x01(\t\x1a\xcf\x06\n\x1cOrderBookLiquidityUpdateSide\x12O\n\x05\x62ip25\x18\x01 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12O\n\x05\x62ip50\x18\x02 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12O\n\x05\x62ip75\x18\x03 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip100\x18\x04 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip150\x18\x05 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip200\x18\x06 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip250\x18\x07 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip300\x18\x08 \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip400\x18\t \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\x12P\n\x06\x62ip500\x18\n \x01(\x0b\x32@.ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums\"6\n\x0cTradesUpdate\x12&\n\x06trades\x18\x01 \x03(\x0b\x32\x16.ProtobufMarkets.Trade\"\xb8\x02\n\x08Interval\x12\x11\n\tclosetime\x18\x01 \x01(\x03\x12\x0e\n\x06period\x18\x04 \x01(\x05\x12,\n\x04ohlc\x18\x02 \x01(\x0b\x32\x1e.ProtobufMarkets.Interval.OHLC\x12\x15\n\rvolumeBaseStr\x18\x06 \x01(\t\x12\x16\n\x0evolumeQuoteStr\x18\x07 \x01(\t\x12\x12\n\nvolumeBase\x18\x03 \x01(\x02\x12\x13\n\x0bvolumeQuote\x18\x05 \x01(\x02\x1a\x82\x01\n\x04OHLC\x12\x0f\n\x07openStr\x18\x05 \x01(\t\x12\x0f\n\x07highStr\x18\x06 \x01(\t\x12\x0e\n\x06lowStr\x18\x07 \x01(\t\x12\x10\n\x08\x63loseStr\x18\x08 \x01(\t\x12\x0c\n\x04open\x18\x01 \x01(\x02\x12\x0c\n\x04high\x18\x02 \x01(\x02\x12\x0b\n\x03low\x18\x03 \x01(\x02\x12\r\n\x05\x63lose\x18\x04 \x01(\x02\"?\n\x0fIntervalsUpdate\x12,\n\tintervals\x18\x01 \x03(\x0b\x32\x19.ProtobufMarkets.Interval\"\xbf\x02\n\rSummaryUpdate\x12\x0f\n\x07lastStr\x18\n \x01(\t\x12\x0f\n\x07highStr\x18\x0b \x01(\t\x12\x0e\n\x06lowStr\x18\x0c \x01(\t\x12\x15\n\rvolumeBaseStr\x18\r \x01(\t\x12\x16\n\x0evolumeQuoteStr\x18\x0e \x01(\t\x12\x19\n\x11\x63hangeAbsoluteStr\x18\x0f \x01(\t\x12\x18\n\x10\x63hangePercentStr\x18\x10 \x01(\t\x12\x11\n\tnumTrades\x18\x08 \x01(\x05\x12\x0c\n\x04last\x18\x02 \x01(\x02\x12\x0c\n\x04high\x18\x03 \x01(\x02\x12\x0b\n\x03low\x18\x04 \x01(\x02\x12\x12\n\nvolumeBase\x18\x05 \x01(\x02\x12\x13\n\x0bvolumeQuote\x18\t \x01(\x02\x12\x16\n\x0e\x63hangeAbsolute\x18\x06 \x01(\x02\x12\x15\n\rchangePercent\x18\x07 \x01(\x02J\x04\x08\x01\x10\x02\"F\n\x0fSparklineUpdate\x12\x0c\n\x04time\x18\x02 \x01(\x03\x12\r\n\x05price\x18\x03 \x01(\x02\x12\x10\n\x08priceStr\x18\x04 \x01(\tJ\x04\x08\x01\x10\x02\x62\x06proto3'
)
_MARKET = _descriptor.Descriptor(
name='Market',
full_name='ProtobufMarkets.Market',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='exchangeId', full_name='ProtobufMarkets.Market.exchangeId', index=0,
number=3, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='currencyPairId', full_name='ProtobufMarkets.Market.currencyPairId', index=1,
number=4, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='marketId', full_name='ProtobufMarkets.Market.marketId', index=2,
number=5, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='exchange', full_name='ProtobufMarkets.Market.exchange', index=3,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='currencyPair', full_name='ProtobufMarkets.Market.currencyPair', index=4,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=48,
serialized_end=158,
)
_ORDER = _descriptor.Descriptor(
name='Order',
full_name='ProtobufMarkets.Order',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='priceStr', full_name='ProtobufMarkets.Order.priceStr', index=0,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='amountStr', full_name='ProtobufMarkets.Order.amountStr', index=1,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='price', full_name='ProtobufMarkets.Order.price', index=2,
number=1, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='amount', full_name='ProtobufMarkets.Order.amount', index=3,
number=2, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=160,
serialized_end=235,
)
_TRADE = _descriptor.Descriptor(
name='Trade',
full_name='ProtobufMarkets.Trade',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='externalId', full_name='ProtobufMarkets.Trade.externalId', index=0,
number=11, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timestamp', full_name='ProtobufMarkets.Trade.timestamp', index=1,
number=2, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timestampMillis', full_name='ProtobufMarkets.Trade.timestampMillis', index=2,
number=5, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=b'\030\001', file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='timestampNano', full_name='ProtobufMarkets.Trade.timestampNano', index=3,
number=10, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='priceStr', full_name='ProtobufMarkets.Trade.priceStr', index=4,
number=8, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='amountStr', full_name='ProtobufMarkets.Trade.amountStr', index=5,
number=9, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='price', full_name='ProtobufMarkets.Trade.price', index=6,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='amount', full_name='ProtobufMarkets.Trade.amount', index=7,
number=4, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='priceDouble', full_name='ProtobufMarkets.Trade.priceDouble', index=8,
number=6, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='amountDouble', full_name='ProtobufMarkets.Trade.amountDouble', index=9,
number=7, type=1, cpp_type=5, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='id', full_name='ProtobufMarkets.Trade.id', index=10,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=238,
serialized_end=459,
)
_MARKETUPDATEMESSAGE = _descriptor.Descriptor(
name='MarketUpdateMessage',
full_name='ProtobufMarkets.MarketUpdateMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='market', full_name='ProtobufMarkets.MarketUpdateMessage.market', index=0,
number=9, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='orderBookUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.orderBookUpdate', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='orderBookDeltaUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.orderBookDeltaUpdate', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='orderBookSpreadUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.orderBookSpreadUpdate', index=3,
number=11, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='orderBookLiquidityUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.orderBookLiquidityUpdate', index=4,
number=12, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='tradesUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.tradesUpdate', index=5,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='intervalsUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.intervalsUpdate', index=6,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='summaryUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.summaryUpdate', index=7,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='sparklineUpdate', full_name='ProtobufMarkets.MarketUpdateMessage.sparklineUpdate', index=8,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='Update', full_name='ProtobufMarkets.MarketUpdateMessage.Update',
index=0, containing_type=None, fields=[]),
],
serialized_start=462,
serialized_end=1058,
)
_ORDERBOOKUPDATE = _descriptor.Descriptor(
name='OrderBookUpdate',
full_name='ProtobufMarkets.OrderBookUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='aggregationModulusStr', full_name='ProtobufMarkets.OrderBookUpdate.aggregationModulusStr', index=0,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='seqNum', full_name='ProtobufMarkets.OrderBookUpdate.seqNum', index=1,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bids', full_name='ProtobufMarkets.OrderBookUpdate.bids', index=2,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='asks', full_name='ProtobufMarkets.OrderBookUpdate.asks', index=3,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='aggregationModulus', full_name='ProtobufMarkets.OrderBookUpdate.aggregationModulus', index=4,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1061,
serialized_end=1229,
)
_ORDERBOOKDELTAUPDATE_ORDERDELTAS = _descriptor.Descriptor(
name='OrderDeltas',
full_name='ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='set', full_name='ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas.set', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='delta', full_name='ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas.delta', index=1,
number=2, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='remove', full_name='ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas.remove', index=2,
number=3, type=2, cpp_type=6, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=b'\020\000', file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='removeStr', full_name='ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas.removeStr', index=3,
number=4, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1462,
serialized_end=1590,
)
_ORDERBOOKDELTAUPDATE = _descriptor.Descriptor(
name='OrderBookDeltaUpdate',
full_name='ProtobufMarkets.OrderBookDeltaUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='aggregationModulus', full_name='ProtobufMarkets.OrderBookDeltaUpdate.aggregationModulus', index=0,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='aggregationModulusStr', full_name='ProtobufMarkets.OrderBookDeltaUpdate.aggregationModulusStr', index=1,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='seqNum', full_name='ProtobufMarkets.OrderBookDeltaUpdate.seqNum', index=2,
number=5, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bids', full_name='ProtobufMarkets.OrderBookDeltaUpdate.bids', index=3,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='asks', full_name='ProtobufMarkets.OrderBookDeltaUpdate.asks', index=4,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_ORDERBOOKDELTAUPDATE_ORDERDELTAS, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1232,
serialized_end=1590,
)
_ORDERBOOKSPREADUPDATE = _descriptor.Descriptor(
name='OrderBookSpreadUpdate',
full_name='ProtobufMarkets.OrderBookSpreadUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='timestamp', full_name='ProtobufMarkets.OrderBookSpreadUpdate.timestamp', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bid', full_name='ProtobufMarkets.OrderBookSpreadUpdate.bid', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='ask', full_name='ProtobufMarkets.OrderBookSpreadUpdate.ask', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1592,
serialized_end=1708,
)
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS = _descriptor.Descriptor(
name='OrderBookLiquiditySums',
full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='totalBase', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums.totalBase', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='totalQuote', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums.totalQuote', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1928,
serialized_end=1991,
)
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE = _descriptor.Descriptor(
name='OrderBookLiquidityUpdateSide',
full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='bip25', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip25', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip50', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip50', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip75', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip75', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip100', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip100', index=3,
number=4, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip150', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip150', index=4,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip200', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip200', index=5,
number=6, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip250', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip250', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip300', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip300', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip400', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip400', index=8,
number=9, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bip500', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide.bip500', index=9,
number=10, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1994,
serialized_end=2841,
)
_ORDERBOOKLIQUIDITYUPDATE = _descriptor.Descriptor(
name='OrderBookLiquidityUpdate',
full_name='ProtobufMarkets.OrderBookLiquidityUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='timestamp', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.timestamp', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='bid', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.bid', index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='ask', full_name='ProtobufMarkets.OrderBookLiquidityUpdate.ask', index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS, _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1711,
serialized_end=2841,
)
_TRADESUPDATE = _descriptor.Descriptor(
name='TradesUpdate',
full_name='ProtobufMarkets.TradesUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='trades', full_name='ProtobufMarkets.TradesUpdate.trades', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2843,
serialized_end=2897,
)
_INTERVAL_OHLC = _descriptor.Descriptor(
name='OHLC',
full_name='ProtobufMarkets.Interval.OHLC',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='openStr', full_name='ProtobufMarkets.Interval.OHLC.openStr', index=0,
number=5, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='highStr', full_name='ProtobufMarkets.Interval.OHLC.highStr', index=1,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='lowStr', full_name='ProtobufMarkets.Interval.OHLC.lowStr', index=2,
number=7, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='closeStr', full_name='ProtobufMarkets.Interval.OHLC.closeStr', index=3,
number=8, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='open', full_name='ProtobufMarkets.Interval.OHLC.open', index=4,
number=1, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='high', full_name='ProtobufMarkets.Interval.OHLC.high', index=5,
number=2, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='low', full_name='ProtobufMarkets.Interval.OHLC.low', index=6,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='close', full_name='ProtobufMarkets.Interval.OHLC.close', index=7,
number=4, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3082,
serialized_end=3212,
)
_INTERVAL = _descriptor.Descriptor(
name='Interval',
full_name='ProtobufMarkets.Interval',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='closetime', full_name='ProtobufMarkets.Interval.closetime', index=0,
number=1, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='period', full_name='ProtobufMarkets.Interval.period', index=1,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='ohlc', full_name='ProtobufMarkets.Interval.ohlc', index=2,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeBaseStr', full_name='ProtobufMarkets.Interval.volumeBaseStr', index=3,
number=6, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeQuoteStr', full_name='ProtobufMarkets.Interval.volumeQuoteStr', index=4,
number=7, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeBase', full_name='ProtobufMarkets.Interval.volumeBase', index=5,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeQuote', full_name='ProtobufMarkets.Interval.volumeQuote', index=6,
number=5, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[_INTERVAL_OHLC, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2900,
serialized_end=3212,
)
_INTERVALSUPDATE = _descriptor.Descriptor(
name='IntervalsUpdate',
full_name='ProtobufMarkets.IntervalsUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='intervals', full_name='ProtobufMarkets.IntervalsUpdate.intervals', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3214,
serialized_end=3277,
)
_SUMMARYUPDATE = _descriptor.Descriptor(
name='SummaryUpdate',
full_name='ProtobufMarkets.SummaryUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='lastStr', full_name='ProtobufMarkets.SummaryUpdate.lastStr', index=0,
number=10, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='highStr', full_name='ProtobufMarkets.SummaryUpdate.highStr', index=1,
number=11, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='lowStr', full_name='ProtobufMarkets.SummaryUpdate.lowStr', index=2,
number=12, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeBaseStr', full_name='ProtobufMarkets.SummaryUpdate.volumeBaseStr', index=3,
number=13, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeQuoteStr', full_name='ProtobufMarkets.SummaryUpdate.volumeQuoteStr', index=4,
number=14, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='changeAbsoluteStr', full_name='ProtobufMarkets.SummaryUpdate.changeAbsoluteStr', index=5,
number=15, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='changePercentStr', full_name='ProtobufMarkets.SummaryUpdate.changePercentStr', index=6,
number=16, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='numTrades', full_name='ProtobufMarkets.SummaryUpdate.numTrades', index=7,
number=8, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='last', full_name='ProtobufMarkets.SummaryUpdate.last', index=8,
number=2, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='high', full_name='ProtobufMarkets.SummaryUpdate.high', index=9,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='low', full_name='ProtobufMarkets.SummaryUpdate.low', index=10,
number=4, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeBase', full_name='ProtobufMarkets.SummaryUpdate.volumeBase', index=11,
number=5, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='volumeQuote', full_name='ProtobufMarkets.SummaryUpdate.volumeQuote', index=12,
number=9, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='changeAbsolute', full_name='ProtobufMarkets.SummaryUpdate.changeAbsolute', index=13,
number=6, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='changePercent', full_name='ProtobufMarkets.SummaryUpdate.changePercent', index=14,
number=7, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3280,
serialized_end=3599,
)
_SPARKLINEUPDATE = _descriptor.Descriptor(
name='SparklineUpdate',
full_name='ProtobufMarkets.SparklineUpdate',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='time', full_name='ProtobufMarkets.SparklineUpdate.time', index=0,
number=2, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='price', full_name='ProtobufMarkets.SparklineUpdate.price', index=1,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='priceStr', full_name='ProtobufMarkets.SparklineUpdate.priceStr', index=2,
number=4, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=3601,
serialized_end=3671,
)
_MARKETUPDATEMESSAGE.fields_by_name['market'].message_type = _MARKET
_MARKETUPDATEMESSAGE.fields_by_name['orderBookUpdate'].message_type = _ORDERBOOKUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['orderBookDeltaUpdate'].message_type = _ORDERBOOKDELTAUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['orderBookSpreadUpdate'].message_type = _ORDERBOOKSPREADUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['orderBookLiquidityUpdate'].message_type = _ORDERBOOKLIQUIDITYUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['tradesUpdate'].message_type = _TRADESUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['intervalsUpdate'].message_type = _INTERVALSUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['summaryUpdate'].message_type = _SUMMARYUPDATE
_MARKETUPDATEMESSAGE.fields_by_name['sparklineUpdate'].message_type = _SPARKLINEUPDATE
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['orderBookUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['orderBookUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['orderBookDeltaUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['orderBookDeltaUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['orderBookSpreadUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['orderBookSpreadUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['orderBookLiquidityUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['orderBookLiquidityUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['tradesUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['tradesUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['intervalsUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['intervalsUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['summaryUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['summaryUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_MARKETUPDATEMESSAGE.oneofs_by_name['Update'].fields.append(
_MARKETUPDATEMESSAGE.fields_by_name['sparklineUpdate'])
_MARKETUPDATEMESSAGE.fields_by_name['sparklineUpdate'].containing_oneof = _MARKETUPDATEMESSAGE.oneofs_by_name['Update']
_ORDERBOOKUPDATE.fields_by_name['bids'].message_type = _ORDER
_ORDERBOOKUPDATE.fields_by_name['asks'].message_type = _ORDER
_ORDERBOOKDELTAUPDATE_ORDERDELTAS.fields_by_name['set'].message_type = _ORDER
_ORDERBOOKDELTAUPDATE_ORDERDELTAS.fields_by_name['delta'].message_type = _ORDER
_ORDERBOOKDELTAUPDATE_ORDERDELTAS.containing_type = _ORDERBOOKDELTAUPDATE
_ORDERBOOKDELTAUPDATE.fields_by_name['bids'].message_type = _ORDERBOOKDELTAUPDATE_ORDERDELTAS
_ORDERBOOKDELTAUPDATE.fields_by_name['asks'].message_type = _ORDERBOOKDELTAUPDATE_ORDERDELTAS
_ORDERBOOKSPREADUPDATE.fields_by_name['bid'].message_type = _ORDER
_ORDERBOOKSPREADUPDATE.fields_by_name['ask'].message_type = _ORDER
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS.containing_type = _ORDERBOOKLIQUIDITYUPDATE
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip25'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip50'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip75'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip100'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip150'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip200'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip250'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip300'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip400'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.fields_by_name['bip500'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS
_ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE.containing_type = _ORDERBOOKLIQUIDITYUPDATE
_ORDERBOOKLIQUIDITYUPDATE.fields_by_name['bid'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE
_ORDERBOOKLIQUIDITYUPDATE.fields_by_name['ask'].message_type = _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE
_TRADESUPDATE.fields_by_name['trades'].message_type = _TRADE
_INTERVAL_OHLC.containing_type = _INTERVAL
_INTERVAL.fields_by_name['ohlc'].message_type = _INTERVAL_OHLC
_INTERVALSUPDATE.fields_by_name['intervals'].message_type = _INTERVAL
DESCRIPTOR.message_types_by_name['Market'] = _MARKET
DESCRIPTOR.message_types_by_name['Order'] = _ORDER
DESCRIPTOR.message_types_by_name['Trade'] = _TRADE
DESCRIPTOR.message_types_by_name['MarketUpdateMessage'] = _MARKETUPDATEMESSAGE
DESCRIPTOR.message_types_by_name['OrderBookUpdate'] = _ORDERBOOKUPDATE
DESCRIPTOR.message_types_by_name['OrderBookDeltaUpdate'] = _ORDERBOOKDELTAUPDATE
DESCRIPTOR.message_types_by_name['OrderBookSpreadUpdate'] = _ORDERBOOKSPREADUPDATE
DESCRIPTOR.message_types_by_name['OrderBookLiquidityUpdate'] = _ORDERBOOKLIQUIDITYUPDATE
DESCRIPTOR.message_types_by_name['TradesUpdate'] = _TRADESUPDATE
DESCRIPTOR.message_types_by_name['Interval'] = _INTERVAL
DESCRIPTOR.message_types_by_name['IntervalsUpdate'] = _INTERVALSUPDATE
DESCRIPTOR.message_types_by_name['SummaryUpdate'] = _SUMMARYUPDATE
DESCRIPTOR.message_types_by_name['SparklineUpdate'] = _SPARKLINEUPDATE
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Market = _reflection.GeneratedProtocolMessageType('Market', (_message.Message,), {
'DESCRIPTOR' : _MARKET,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.Market)
})
_sym_db.RegisterMessage(Market)
Order = _reflection.GeneratedProtocolMessageType('Order', (_message.Message,), {
'DESCRIPTOR' : _ORDER,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.Order)
})
_sym_db.RegisterMessage(Order)
Trade = _reflection.GeneratedProtocolMessageType('Trade', (_message.Message,), {
'DESCRIPTOR' : _TRADE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.Trade)
})
_sym_db.RegisterMessage(Trade)
MarketUpdateMessage = _reflection.GeneratedProtocolMessageType('MarketUpdateMessage', (_message.Message,), {
'DESCRIPTOR' : _MARKETUPDATEMESSAGE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.MarketUpdateMessage)
})
_sym_db.RegisterMessage(MarketUpdateMessage)
OrderBookUpdate = _reflection.GeneratedProtocolMessageType('OrderBookUpdate', (_message.Message,), {
'DESCRIPTOR' : _ORDERBOOKUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookUpdate)
})
_sym_db.RegisterMessage(OrderBookUpdate)
OrderBookDeltaUpdate = _reflection.GeneratedProtocolMessageType('OrderBookDeltaUpdate', (_message.Message,), {
'OrderDeltas' : _reflection.GeneratedProtocolMessageType('OrderDeltas', (_message.Message,), {
'DESCRIPTOR' : _ORDERBOOKDELTAUPDATE_ORDERDELTAS,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookDeltaUpdate.OrderDeltas)
})
,
'DESCRIPTOR' : _ORDERBOOKDELTAUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookDeltaUpdate)
})
_sym_db.RegisterMessage(OrderBookDeltaUpdate)
_sym_db.RegisterMessage(OrderBookDeltaUpdate.OrderDeltas)
OrderBookSpreadUpdate = _reflection.GeneratedProtocolMessageType('OrderBookSpreadUpdate', (_message.Message,), {
'DESCRIPTOR' : _ORDERBOOKSPREADUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookSpreadUpdate)
})
_sym_db.RegisterMessage(OrderBookSpreadUpdate)
OrderBookLiquidityUpdate = _reflection.GeneratedProtocolMessageType('OrderBookLiquidityUpdate', (_message.Message,), {
'OrderBookLiquiditySums' : _reflection.GeneratedProtocolMessageType('OrderBookLiquiditySums', (_message.Message,), {
'DESCRIPTOR' : _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYSUMS,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquiditySums)
})
,
'OrderBookLiquidityUpdateSide' : _reflection.GeneratedProtocolMessageType('OrderBookLiquidityUpdateSide', (_message.Message,), {
'DESCRIPTOR' : _ORDERBOOKLIQUIDITYUPDATE_ORDERBOOKLIQUIDITYUPDATESIDE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide)
})
,
'DESCRIPTOR' : _ORDERBOOKLIQUIDITYUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.OrderBookLiquidityUpdate)
})
_sym_db.RegisterMessage(OrderBookLiquidityUpdate)
_sym_db.RegisterMessage(OrderBookLiquidityUpdate.OrderBookLiquiditySums)
_sym_db.RegisterMessage(OrderBookLiquidityUpdate.OrderBookLiquidityUpdateSide)
TradesUpdate = _reflection.GeneratedProtocolMessageType('TradesUpdate', (_message.Message,), {
'DESCRIPTOR' : _TRADESUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.TradesUpdate)
})
_sym_db.RegisterMessage(TradesUpdate)
Interval = _reflection.GeneratedProtocolMessageType('Interval', (_message.Message,), {
'OHLC' : _reflection.GeneratedProtocolMessageType('OHLC', (_message.Message,), {
'DESCRIPTOR' : _INTERVAL_OHLC,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.Interval.OHLC)
})
,
'DESCRIPTOR' : _INTERVAL,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.Interval)
})
_sym_db.RegisterMessage(Interval)
_sym_db.RegisterMessage(Interval.OHLC)
IntervalsUpdate = _reflection.GeneratedProtocolMessageType('IntervalsUpdate', (_message.Message,), {
'DESCRIPTOR' : _INTERVALSUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.IntervalsUpdate)
})
_sym_db.RegisterMessage(IntervalsUpdate)
SummaryUpdate = _reflection.GeneratedProtocolMessageType('SummaryUpdate', (_message.Message,), {
'DESCRIPTOR' : _SUMMARYUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.SummaryUpdate)
})
_sym_db.RegisterMessage(SummaryUpdate)
SparklineUpdate = _reflection.GeneratedProtocolMessageType('SparklineUpdate', (_message.Message,), {
'DESCRIPTOR' : _SPARKLINEUPDATE,
'__module__' : 'public.markets.market_pb2'
# @@protoc_insertion_point(class_scope:ProtobufMarkets.SparklineUpdate)
})
_sym_db.RegisterMessage(SparklineUpdate)
_TRADE.fields_by_name['timestampMillis']._options = None
_ORDERBOOKDELTAUPDATE_ORDERDELTAS.fields_by_name['remove']._options = None
# @@protoc_insertion_point(module_scope)
| 48.279265 | 6,123 | 0.761937 | 7,435 | 63,101 | 6.202017 | 0.048823 | 0.053088 | 0.056862 | 0.041638 | 0.762144 | 0.658419 | 0.644388 | 0.6214 | 0.613658 | 0.570069 | 0 | 0.041304 | 0.118302 | 63,101 | 1,306 | 6,124 | 48.316233 | 0.787512 | 0.0229 | 0 | 0.706362 | 1 | 0.004894 | 0.159087 | 0.120812 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.003263 | 0 | 0.003263 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
fcb988a4da2d7eefc2fb4919a5d804863f0b78aa | 561 | py | Python | pybemt/analysis.py | Team-Peryton/pyBEMT2 | cfe83f709f616489c0df817641d54f2877e680bc | [
"MIT"
] | 1 | 2021-07-26T17:57:23.000Z | 2021-07-26T17:57:23.000Z | pybemt/analysis.py | Team-Peryton/pyBEMT2 | cfe83f709f616489c0df817641d54f2877e680bc | [
"MIT"
] | null | null | null | pybemt/analysis.py | Team-Peryton/pyBEMT2 | cfe83f709f616489c0df817641d54f2877e680bc | [
"MIT"
] | 1 | 2021-09-05T18:41:12.000Z | 2021-09-05T18:41:12.000Z | import math
def speed_of_sound(gamma, pressure, density):
return math.sqrt(gamma*(pressure/density))
def tip_speed(rpm, diameter):
"""
Assumes standard atmosphere sea level conditions
rpm
diameter: meters
returns: Mach speed at tip
"""
return ( (diameter * math.pi * rpm) / 60 ) / speed_of_sound(1.4,101325,1.225)
def max_rpm_from_tip_speed(diameter):
"""
for a given diameter, return the max RPM to stay within 0.7 mach tip speed
"""
return (0.7 * speed_of_sound(1.4,101325,1.225) * 60)/(math.pi * diameter) | 26.714286 | 81 | 0.672014 | 86 | 561 | 4.255814 | 0.476744 | 0.057377 | 0.098361 | 0.071038 | 0.131148 | 0.131148 | 0.131148 | 0.131148 | 0 | 0 | 0 | 0.072235 | 0.210339 | 561 | 21 | 82 | 26.714286 | 0.75395 | 0.304813 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0 | 0.142857 | 0.142857 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
fcccdd33d5044fab71fa609cab44d50b89380ef7 | 267 | py | Python | BridgePython/client.py | barberj/bridge-python | 1c33df5fa1d92ac6c54bbb6d868c71e1f883e8fe | [
"MIT"
] | null | null | null | BridgePython/client.py | barberj/bridge-python | 1c33df5fa1d92ac6c54bbb6d868c71e1f883e8fe | [
"MIT"
] | null | null | null | BridgePython/client.py | barberj/bridge-python | 1c33df5fa1d92ac6c54bbb6d868c71e1f883e8fe | [
"MIT"
] | null | null | null | from BridgePython import serializer, reference
class Client(object):
def __init__(self, bridge, id):
self.bridge, self.clientId = bridge, id;
def get_service(self, svc):
return reference.Reference(self.bridge, ['client', self.clientId, svc])
| 33.375 | 79 | 0.700375 | 33 | 267 | 5.515152 | 0.545455 | 0.164835 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183521 | 267 | 7 | 80 | 38.142857 | 0.834862 | 0 | 0 | 0 | 0 | 0 | 0.022472 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.166667 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
fcf2b82b52b1d10f7aab14e5bd1cc1a9bfa7deaa | 2,625 | py | Python | npyscreen/widget/__init__.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 2 | 2015-01-12T14:47:19.000Z | 2018-10-03T09:27:22.000Z | npyscreen/widget/__init__.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | null | null | null | npyscreen/widget/__init__.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 1 | 2020-03-20T20:19:33.000Z | 2020-03-20T20:19:33.000Z | # encoding: utf-8
"""
The npyscreen.widget package provides tools for Widgets and Widget classes.
"""
import copy
import sys
import curses
import curses.ascii
import weakref
from .. import global_options
import locale
#import warnings # unused
#import curses.wrapper #unused
#import codecs # unused
from ..globals import DEBUG
from .constants import *
from .widget import Widget, DummyWidget
from .button import MiniButton, MiniButtonPress
Button, ButtonPress = MiniButton, MiniButtonPress # Alias MiniButton[Press]
from .textbox import Textfield, FixedText
from .titlefield import TitleText, TitleFixedText
from .password import PasswordEntry, TitlePassword
from .slider import Slider, TitleSlider
from .multiline import MultiLine, Pager, TitleMultiLine, TitlePager,\
MultiLineAction, BufferPager, TitleBufferPager
from .multiselect import MultiSelect, TitleMultiSelect, MultiSelectFixed,\
TitleMultiSelectFixed, MultiSelectAction
from .editmultiline import MultiLineEdit
from .combobox import ComboBox, TitleCombo
from .checkbox import Checkbox, RoundCheckBox, CheckBoxMultiline,\
RoundCheckBoxMultiline, CheckBox, CheckboxBare
from .formcontrolcheckbox import FormControlCheckbox
from .autocomplete import TitleFilename, Filename, Autocomplete
#from .Menu import Menu # Is this appropriate
from .select import SelectOne, TitleSelectOne
from .datecombo import DateCombo, TitleDateCombo
from .multilinetree import MultiLineTree, SelectOneTree, MultiLineTreeNew,\
MultiLineTreeNewAction, TreeLine, MLTree,\
MLTreeAnnotated, MLTreeAction,\
TreeLineAnnotated, MultiLineTreeNewAnnotatedAction,\
MultiLineTreeNewAnnotated, MLTreeAnnotatedAction
#Experimental Widgets (take care and report issues!)
from .multilinetreeselectable import MLTreeMultiSelect, TreeLineSelectable
from .multilinetreeselectable import MLTreeMultiSelectAnnotated,\
TreeLineSelectableAnnotated
from .filenamecombo import FilenameCombo, TitleFilenameCombo
from .annotatetextbox import AnnotateTextboxBaseRight
from .multiline import MultiLineActionWithShortcuts
from .multilineeditable import MultiLineEditable, MultiLineEditableTitle,\
MultiLineEditableBoxed
from .monthbox import MonthBox
from .grid import SimpleGrid
from .gridcoltitles import GridColTitles
from .boxwidget import BoxBasic, BoxTitle
from .NewMenu import NewMenu, MenuItem
from .NMenuDisplay import MenuDisplay, MenuDisplayScreen
| 41.015625 | 79 | 0.768381 | 226 | 2,625 | 8.920354 | 0.548673 | 0.017857 | 0.018849 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000468 | 0.185905 | 2,625 | 63 | 80 | 41.666667 | 0.942911 | 0.108952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.021277 | 0.787234 | 0 | 0.787234 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1e014d4da6593d59abb35c952bbe61faa5584d8b | 340,297 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from msrest.serialization import Model
from msrest.exceptions import HttpOperationError
class AccessInformationContract(Model):
"""Tenant access information contract of the API Management service.
:param id: Identifier.
:type id: str
:param primary_key: Primary access key. This property will not be filled
on 'GET' operations! Use '/listSecrets' POST request to get the value.
:type primary_key: str
:param secondary_key: Secondary access key. This property will not be
filled on 'GET' operations! Use '/listSecrets' POST request to get the
value.
:type secondary_key: str
:param enabled: Determines whether direct access is enabled.
:type enabled: bool
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'primary_key': {'key': 'primaryKey', 'type': 'str'},
'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
'enabled': {'key': 'enabled', 'type': 'bool'},
}
def __init__(self, *, id: str=None, primary_key: str=None, secondary_key: str=None, enabled: bool=None, **kwargs) -> None:
super(AccessInformationContract, self).__init__(**kwargs)
self.id = id
self.primary_key = primary_key
self.secondary_key = secondary_key
self.enabled = enabled
class AccessInformationUpdateParameters(Model):
"""Tenant access information update parameters.
:param enabled: Determines whether direct access is enabled.
:type enabled: bool
"""
_attribute_map = {
'enabled': {'key': 'properties.enabled', 'type': 'bool'},
}
def __init__(self, *, enabled: bool=None, **kwargs) -> None:
super(AccessInformationUpdateParameters, self).__init__(**kwargs)
self.enabled = enabled
class AdditionalLocation(Model):
"""Description of an additional API Management resource location.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param location: Required. The location name of the additional region
among Azure Data center regions.
:type location: str
:param sku: Required. SKU properties of the API Management service.
:type sku:
~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties
:ivar public_ip_addresses: Public Static Load Balanced IP addresses of the
API Management service in the additional location. Available only for
Basic, Standard and Premium SKU.
:vartype public_ip_addresses: list[str]
:ivar private_ip_addresses: Private Static Load Balanced IP addresses of
the API Management service which is deployed in an Internal Virtual
Network in a particular additional location. Available only for Basic,
Standard and Premium SKU.
:vartype private_ip_addresses: list[str]
:param virtual_network_configuration: Virtual network configuration for
the location.
:type virtual_network_configuration:
~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration
:ivar gateway_regional_url: Gateway URL of the API Management service in
the Region.
:vartype gateway_regional_url: str
:param disable_gateway: Property only valid for an Api Management service
deployed in multiple locations. This can be used to disable the gateway in
this additional location. Default value: False .
:type disable_gateway: bool
"""
_validation = {
'location': {'required': True},
'sku': {'required': True},
'public_ip_addresses': {'readonly': True},
'private_ip_addresses': {'readonly': True},
'gateway_regional_url': {'readonly': True},
}
_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'},
'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'},
'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'},
'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'},
'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'},
'disable_gateway': {'key': 'disableGateway', 'type': 'bool'},
}
def __init__(self, *, location: str, sku, virtual_network_configuration=None, disable_gateway: bool=False, **kwargs) -> None:
super(AdditionalLocation, self).__init__(**kwargs)
self.location = location
self.sku = sku
self.public_ip_addresses = None
self.private_ip_addresses = None
self.virtual_network_configuration = virtual_network_configuration
self.gateway_regional_url = None
self.disable_gateway = disable_gateway
class Resource(Model):
"""The Resource definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
class ApiContract(Resource):
"""Api details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Description of the API. May include HTML formatting
tags.
:type description: str
:param authentication_settings: Collection of authentication settings
included into this API.
:type authentication_settings:
~azure.mgmt.apimanagement.models.AuthenticationSettingsContract
:param subscription_key_parameter_names: Protocols over which API is made
available.
:type subscription_key_parameter_names:
~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract
:param api_type: Type of API. Possible values include: 'http', 'soap'
:type api_type: str or ~azure.mgmt.apimanagement.models.ApiType
:param api_revision: Describes the Revision of the Api. If no value is
provided, default revision 1 is created
:type api_revision: str
:param api_version: Indicates the Version identifier of the API if the API
is versioned
:type api_version: str
:param is_current: Indicates if API revision is current api revision.
:type is_current: bool
:ivar is_online: Indicates if API revision is accessible via the gateway.
:vartype is_online: bool
:param api_revision_description: Description of the Api Revision.
:type api_revision_description: str
:param api_version_description: Description of the Api Version.
:type api_version_description: str
:param api_version_set_id: A resource identifier for the related
ApiVersionSet.
:type api_version_set_id: str
:param subscription_required: Specifies whether an API or Product
subscription is required for accessing the API.
:type subscription_required: bool
:param source_api_id: API identifier of the source API.
:type source_api_id: str
:param display_name: API name. Must be 1 to 300 characters long.
:type display_name: str
:param service_url: Absolute URL of the backend service implementing this
API. Cannot be more than 2000 characters long.
:type service_url: str
:param path: Required. Relative URL uniquely identifying this API and all
of its resource paths within the API Management service instance. It is
appended to the API endpoint base URL specified during the service
instance creation to form a public URL for this API.
:type path: str
:param protocols: Describes on which protocols the operations in this API
can be invoked.
:type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol]
:param api_version_set: Version set details
:type api_version_set:
~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'api_revision': {'max_length': 100, 'min_length': 1},
'api_version': {'max_length': 100},
'is_online': {'readonly': True},
'api_revision_description': {'max_length': 256},
'api_version_description': {'max_length': 256},
'display_name': {'max_length': 300, 'min_length': 1},
'service_url': {'max_length': 2000, 'min_length': 0},
'path': {'required': True, 'max_length': 400, 'min_length': 0},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'},
'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'},
'api_type': {'key': 'properties.type', 'type': 'str'},
'api_revision': {'key': 'properties.apiRevision', 'type': 'str'},
'api_version': {'key': 'properties.apiVersion', 'type': 'str'},
'is_current': {'key': 'properties.isCurrent', 'type': 'bool'},
'is_online': {'key': 'properties.isOnline', 'type': 'bool'},
'api_revision_description': {'key': 'properties.apiRevisionDescription', 'type': 'str'},
'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'},
'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'},
'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'},
'source_api_id': {'key': 'properties.sourceApiId', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'service_url': {'key': 'properties.serviceUrl', 'type': 'str'},
'path': {'key': 'properties.path', 'type': 'str'},
'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'},
'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'},
}
def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None:
super(ApiContract, self).__init__(**kwargs)
self.description = description
self.authentication_settings = authentication_settings
self.subscription_key_parameter_names = subscription_key_parameter_names
self.api_type = api_type
self.api_revision = api_revision
self.api_version = api_version
self.is_current = is_current
self.is_online = None
self.api_revision_description = api_revision_description
self.api_version_description = api_version_description
self.api_version_set_id = api_version_set_id
self.subscription_required = subscription_required
self.source_api_id = source_api_id
self.display_name = display_name
self.service_url = service_url
self.path = path
self.protocols = protocols
self.api_version_set = api_version_set
class ApiEntityBaseContract(Model):
"""API base contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
:param description: Description of the API. May include HTML formatting
tags.
:type description: str
:param authentication_settings: Collection of authentication settings
included into this API.
:type authentication_settings:
~azure.mgmt.apimanagement.models.AuthenticationSettingsContract
:param subscription_key_parameter_names: Protocols over which API is made
available.
:type subscription_key_parameter_names:
~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract
:param api_type: Type of API. Possible values include: 'http', 'soap'
:type api_type: str or ~azure.mgmt.apimanagement.models.ApiType
:param api_revision: Describes the Revision of the Api. If no value is
provided, default revision 1 is created
:type api_revision: str
:param api_version: Indicates the Version identifier of the API if the API
is versioned
:type api_version: str
:param is_current: Indicates if API revision is current api revision.
:type is_current: bool
:ivar is_online: Indicates if API revision is accessible via the gateway.
:vartype is_online: bool
:param api_revision_description: Description of the Api Revision.
:type api_revision_description: str
:param api_version_description: Description of the Api Version.
:type api_version_description: str
:param api_version_set_id: A resource identifier for the related
ApiVersionSet.
:type api_version_set_id: str
:param subscription_required: Specifies whether an API or Product
subscription is required for accessing the API.
:type subscription_required: bool
"""
_validation = {
'api_revision': {'max_length': 100, 'min_length': 1},
'api_version': {'max_length': 100},
'is_online': {'readonly': True},
'api_revision_description': {'max_length': 256},
'api_version_description': {'max_length': 256},
}
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'},
'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'},
'api_type': {'key': 'type', 'type': 'str'},
'api_revision': {'key': 'apiRevision', 'type': 'str'},
'api_version': {'key': 'apiVersion', 'type': 'str'},
'is_current': {'key': 'isCurrent', 'type': 'bool'},
'is_online': {'key': 'isOnline', 'type': 'bool'},
'api_revision_description': {'key': 'apiRevisionDescription', 'type': 'str'},
'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'},
'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'},
'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'},
}
def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, **kwargs) -> None:
super(ApiEntityBaseContract, self).__init__(**kwargs)
self.description = description
self.authentication_settings = authentication_settings
self.subscription_key_parameter_names = subscription_key_parameter_names
self.api_type = api_type
self.api_revision = api_revision
self.api_version = api_version
self.is_current = is_current
self.is_online = None
self.api_revision_description = api_revision_description
self.api_version_description = api_version_description
self.api_version_set_id = api_version_set_id
self.subscription_required = subscription_required
class ApiContractProperties(ApiEntityBaseContract):
"""Api Entity Properties.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param description: Description of the API. May include HTML formatting
tags.
:type description: str
:param authentication_settings: Collection of authentication settings
included into this API.
:type authentication_settings:
~azure.mgmt.apimanagement.models.AuthenticationSettingsContract
:param subscription_key_parameter_names: Protocols over which API is made
available.
:type subscription_key_parameter_names:
~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract
:param api_type: Type of API. Possible values include: 'http', 'soap'
:type api_type: str or ~azure.mgmt.apimanagement.models.ApiType
:param api_revision: Describes the Revision of the Api. If no value is
provided, default revision 1 is created
:type api_revision: str
:param api_version: Indicates the Version identifier of the API if the API
is versioned
:type api_version: str
:param is_current: Indicates if API revision is current api revision.
:type is_current: bool
:ivar is_online: Indicates if API revision is accessible via the gateway.
:vartype is_online: bool
:param api_revision_description: Description of the Api Revision.
:type api_revision_description: str
:param api_version_description: Description of the Api Version.
:type api_version_description: str
:param api_version_set_id: A resource identifier for the related
ApiVersionSet.
:type api_version_set_id: str
:param subscription_required: Specifies whether an API or Product
subscription is required for accessing the API.
:type subscription_required: bool
:param source_api_id: API identifier of the source API.
:type source_api_id: str
:param display_name: API name. Must be 1 to 300 characters long.
:type display_name: str
:param service_url: Absolute URL of the backend service implementing this
API. Cannot be more than 2000 characters long.
:type service_url: str
:param path: Required. Relative URL uniquely identifying this API and all
of its resource paths within the API Management service instance. It is
appended to the API endpoint base URL specified during the service
instance creation to form a public URL for this API.
:type path: str
:param protocols: Describes on which protocols the operations in this API
can be invoked.
:type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol]
:param api_version_set: Version set details
:type api_version_set:
~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails
"""
_validation = {
'api_revision': {'max_length': 100, 'min_length': 1},
'api_version': {'max_length': 100},
'is_online': {'readonly': True},
'api_revision_description': {'max_length': 256},
'api_version_description': {'max_length': 256},
'display_name': {'max_length': 300, 'min_length': 1},
'service_url': {'max_length': 2000, 'min_length': 0},
'path': {'required': True, 'max_length': 400, 'min_length': 0},
}
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'},
'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'},
'api_type': {'key': 'type', 'type': 'str'},
'api_revision': {'key': 'apiRevision', 'type': 'str'},
'api_version': {'key': 'apiVersion', 'type': 'str'},
'is_current': {'key': 'isCurrent', 'type': 'bool'},
'is_online': {'key': 'isOnline', 'type': 'bool'},
'api_revision_description': {'key': 'apiRevisionDescription', 'type': 'str'},
'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'},
'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'},
'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'},
'source_api_id': {'key': 'sourceApiId', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'service_url': {'key': 'serviceUrl', 'type': 'str'},
'path': {'key': 'path', 'type': 'str'},
'protocols': {'key': 'protocols', 'type': '[Protocol]'},
'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'},
}
def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None:
super(ApiContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, **kwargs)
self.source_api_id = source_api_id
self.display_name = display_name
self.service_url = service_url
self.path = path
self.protocols = protocols
self.api_version_set = api_version_set
class ApiCreateOrUpdateParameter(Model):
"""API Create or Update Parameters.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param description: Description of the API. May include HTML formatting
tags.
:type description: str
:param authentication_settings: Collection of authentication settings
included into this API.
:type authentication_settings:
~azure.mgmt.apimanagement.models.AuthenticationSettingsContract
:param subscription_key_parameter_names: Protocols over which API is made
available.
:type subscription_key_parameter_names:
~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract
:param api_type: Type of API. Possible values include: 'http', 'soap'
:type api_type: str or ~azure.mgmt.apimanagement.models.ApiType
:param api_revision: Describes the Revision of the Api. If no value is
provided, default revision 1 is created
:type api_revision: str
:param api_version: Indicates the Version identifier of the API if the API
is versioned
:type api_version: str
:param is_current: Indicates if API revision is current api revision.
:type is_current: bool
:ivar is_online: Indicates if API revision is accessible via the gateway.
:vartype is_online: bool
:param api_revision_description: Description of the Api Revision.
:type api_revision_description: str
:param api_version_description: Description of the Api Version.
:type api_version_description: str
:param api_version_set_id: A resource identifier for the related
ApiVersionSet.
:type api_version_set_id: str
:param subscription_required: Specifies whether an API or Product
subscription is required for accessing the API.
:type subscription_required: bool
:param source_api_id: API identifier of the source API.
:type source_api_id: str
:param display_name: API name. Must be 1 to 300 characters long.
:type display_name: str
:param service_url: Absolute URL of the backend service implementing this
API. Cannot be more than 2000 characters long.
:type service_url: str
:param path: Required. Relative URL uniquely identifying this API and all
of its resource paths within the API Management service instance. It is
appended to the API endpoint base URL specified during the service
instance creation to form a public URL for this API.
:type path: str
:param protocols: Describes on which protocols the operations in this API
can be invoked.
:type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol]
:param api_version_set: Version set details
:type api_version_set:
~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails
:param value: Content value when Importing an API.
:type value: str
:param format: Format of the Content in which the API is getting imported.
Possible values include: 'wadl-xml', 'wadl-link-json', 'swagger-json',
'swagger-link-json', 'wsdl', 'wsdl-link', 'openapi', 'openapi+json',
'openapi-link', 'openapi+json-link'
:type format: str or ~azure.mgmt.apimanagement.models.ContentFormat
:param wsdl_selector: Criteria to limit import of WSDL to a subset of the
document.
:type wsdl_selector:
~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector
:param soap_api_type: Type of Api to create.
* `http` creates a SOAP to REST API
* `soap` creates a SOAP pass-through API. Possible values include:
'SoapToRest', 'SoapPassThrough'
:type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType
"""
_validation = {
'api_revision': {'max_length': 100, 'min_length': 1},
'api_version': {'max_length': 100},
'is_online': {'readonly': True},
'api_revision_description': {'max_length': 256},
'api_version_description': {'max_length': 256},
'display_name': {'max_length': 300, 'min_length': 1},
'service_url': {'max_length': 2000, 'min_length': 0},
'path': {'required': True, 'max_length': 400, 'min_length': 0},
}
_attribute_map = {
'description': {'key': 'properties.description', 'type': 'str'},
'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'},
'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'},
'api_type': {'key': 'properties.type', 'type': 'str'},
'api_revision': {'key': 'properties.apiRevision', 'type': 'str'},
'api_version': {'key': 'properties.apiVersion', 'type': 'str'},
'is_current': {'key': 'properties.isCurrent', 'type': 'bool'},
'is_online': {'key': 'properties.isOnline', 'type': 'bool'},
'api_revision_description': {'key': 'properties.apiRevisionDescription', 'type': 'str'},
'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'},
'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'},
'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'},
'source_api_id': {'key': 'properties.sourceApiId', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'service_url': {'key': 'properties.serviceUrl', 'type': 'str'},
'path': {'key': 'properties.path', 'type': 'str'},
'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'},
'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'},
'value': {'key': 'properties.value', 'type': 'str'},
'format': {'key': 'properties.format', 'type': 'str'},
'wsdl_selector': {'key': 'properties.wsdlSelector', 'type': 'ApiCreateOrUpdatePropertiesWsdlSelector'},
'soap_api_type': {'key': 'properties.apiType', 'type': 'str'},
}
def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, value: str=None, format=None, wsdl_selector=None, soap_api_type=None, **kwargs) -> None:
super(ApiCreateOrUpdateParameter, self).__init__(**kwargs)
self.description = description
self.authentication_settings = authentication_settings
self.subscription_key_parameter_names = subscription_key_parameter_names
self.api_type = api_type
self.api_revision = api_revision
self.api_version = api_version
self.is_current = is_current
self.is_online = None
self.api_revision_description = api_revision_description
self.api_version_description = api_version_description
self.api_version_set_id = api_version_set_id
self.subscription_required = subscription_required
self.source_api_id = source_api_id
self.display_name = display_name
self.service_url = service_url
self.path = path
self.protocols = protocols
self.api_version_set = api_version_set
self.value = value
self.format = format
self.wsdl_selector = wsdl_selector
self.soap_api_type = soap_api_type
class ApiCreateOrUpdatePropertiesWsdlSelector(Model):
"""Criteria to limit import of WSDL to a subset of the document.
:param wsdl_service_name: Name of service to import from WSDL
:type wsdl_service_name: str
:param wsdl_endpoint_name: Name of endpoint(port) to import from WSDL
:type wsdl_endpoint_name: str
"""
_attribute_map = {
'wsdl_service_name': {'key': 'wsdlServiceName', 'type': 'str'},
'wsdl_endpoint_name': {'key': 'wsdlEndpointName', 'type': 'str'},
}
def __init__(self, *, wsdl_service_name: str=None, wsdl_endpoint_name: str=None, **kwargs) -> None:
super(ApiCreateOrUpdatePropertiesWsdlSelector, self).__init__(**kwargs)
self.wsdl_service_name = wsdl_service_name
self.wsdl_endpoint_name = wsdl_endpoint_name
class ApiExportResult(Model):
"""API Export result.
:param id: ResourceId of the API which was exported.
:type id: str
:param export_result_format: Format in which the Api Details are exported
to the Storage Blob with Sas Key valid for 5 minutes. Possible values
include: 'Swagger', 'Wsdl', 'Wadl', 'OpenApi'
:type export_result_format: str or
~azure.mgmt.apimanagement.models.ExportResultFormat
:param value: The object defining the schema of the exported Api Detail
:type value: ~azure.mgmt.apimanagement.models.ApiExportResultValue
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'export_result_format': {'key': 'format', 'type': 'str'},
'value': {'key': 'value', 'type': 'ApiExportResultValue'},
}
def __init__(self, *, id: str=None, export_result_format=None, value=None, **kwargs) -> None:
super(ApiExportResult, self).__init__(**kwargs)
self.id = id
self.export_result_format = export_result_format
self.value = value
class ApiExportResultValue(Model):
"""The object defining the schema of the exported Api Detail.
:param link: Link to the Storage Blob containing the result of the export
operation. The Blob Uri is only valid for 5 minutes.
:type link: str
"""
_attribute_map = {
'link': {'key': 'link', 'type': 'str'},
}
def __init__(self, *, link: str=None, **kwargs) -> None:
super(ApiExportResultValue, self).__init__(**kwargs)
self.link = link
class ApiManagementServiceApplyNetworkConfigurationParameters(Model):
"""Parameter supplied to the Apply Network configuration operation.
:param location: Location of the Api Management service to update for a
multi-region service. For a service deployed in a single region, this
parameter is not required.
:type location: str
"""
_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
}
def __init__(self, *, location: str=None, **kwargs) -> None:
super(ApiManagementServiceApplyNetworkConfigurationParameters, self).__init__(**kwargs)
self.location = location
class ApiManagementServiceBackupRestoreParameters(Model):
"""Parameters supplied to the Backup/Restore of an API Management service
operation.
All required parameters must be populated in order to send to Azure.
:param storage_account: Required. Azure Cloud Storage account (used to
place/retrieve the backup) name.
:type storage_account: str
:param access_key: Required. Azure Cloud Storage account (used to
place/retrieve the backup) access key.
:type access_key: str
:param container_name: Required. Azure Cloud Storage blob container name
used to place/retrieve the backup.
:type container_name: str
:param backup_name: Required. The name of the backup file to create.
:type backup_name: str
"""
_validation = {
'storage_account': {'required': True},
'access_key': {'required': True},
'container_name': {'required': True},
'backup_name': {'required': True},
}
_attribute_map = {
'storage_account': {'key': 'storageAccount', 'type': 'str'},
'access_key': {'key': 'accessKey', 'type': 'str'},
'container_name': {'key': 'containerName', 'type': 'str'},
'backup_name': {'key': 'backupName', 'type': 'str'},
}
def __init__(self, *, storage_account: str, access_key: str, container_name: str, backup_name: str, **kwargs) -> None:
super(ApiManagementServiceBackupRestoreParameters, self).__init__(**kwargs)
self.storage_account = storage_account
self.access_key = access_key
self.container_name = container_name
self.backup_name = backup_name
class ApiManagementServiceBaseProperties(Model):
"""Base Properties of an API Management service resource description.
Variables are only populated by the server, and will be ignored when
sending a request.
:param notification_sender_email: Email address from which the
notification will be sent.
:type notification_sender_email: str
:ivar provisioning_state: The current provisioning state of the API
Management service which can be one of the following:
Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
:vartype provisioning_state: str
:ivar target_provisioning_state: The provisioning state of the API
Management service, which is targeted by the long running operation
started on the service.
:vartype target_provisioning_state: str
:ivar created_at_utc: Creation UTC date of the API Management service.The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:vartype created_at_utc: datetime
:ivar gateway_url: Gateway URL of the API Management service.
:vartype gateway_url: str
:ivar gateway_regional_url: Gateway URL of the API Management service in
the Default Region.
:vartype gateway_regional_url: str
:ivar portal_url: Publisher portal endpoint Url of the API Management
service.
:vartype portal_url: str
:ivar management_api_url: Management API endpoint URL of the API
Management service.
:vartype management_api_url: str
:ivar scm_url: SCM endpoint URL of the API Management service.
:vartype scm_url: str
:ivar developer_portal_url: DEveloper Portal endpoint URL of the API
Management service.
:vartype developer_portal_url: str
:param hostname_configurations: Custom hostname configuration of the API
Management service.
:type hostname_configurations:
list[~azure.mgmt.apimanagement.models.HostnameConfiguration]
:ivar public_ip_addresses: Public Static Load Balanced IP addresses of the
API Management service in Primary region. Available only for Basic,
Standard and Premium SKU.
:vartype public_ip_addresses: list[str]
:ivar private_ip_addresses: Private Static Load Balanced IP addresses of
the API Management service in Primary region which is deployed in an
Internal Virtual Network. Available only for Basic, Standard and Premium
SKU.
:vartype private_ip_addresses: list[str]
:param virtual_network_configuration: Virtual network configuration of the
API Management service.
:type virtual_network_configuration:
~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration
:param additional_locations: Additional datacenter locations of the API
Management service.
:type additional_locations:
list[~azure.mgmt.apimanagement.models.AdditionalLocation]
:param custom_properties: Custom properties of the API Management
service.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`
will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1
and 1.2).</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11`
can be used to disable just TLS 1.1.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10`
can be used to disable TLS 1.0 on an API Management service.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11`
can be used to disable just TLS 1.1 for communications with
backends.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10`
can be used to disable TLS 1.0 for communications with
backends.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can
be used to enable HTTP2 protocol on an API Management service.</br>Not
specifying any of these properties on PATCH operation will reset omitted
properties' values to their defaults. For all the settings except Http2
the default value is `True` if the service was created on or before April
1st 2018 and `False` otherwise. Http2 setting's default value is
`False`.</br></br>You can disable any of next ciphers by using settings
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example,
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`.
The default value is `true` for them. Note: next ciphers can't be
disabled since they are required by Azure CloudService internal
components:
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
:type custom_properties: dict[str, str]
:param certificates: List of Certificates that need to be installed in the
API Management service. Max supported certificates that can be installed
is 10.
:type certificates:
list[~azure.mgmt.apimanagement.models.CertificateConfiguration]
:param enable_client_certificate: Property only meant to be used for
Consumption SKU Service. This enforces a client certificate to be
presented on each request to the gateway. This also enables the ability to
authenticate the certificate in the policy on the gateway. Default value:
False .
:type enable_client_certificate: bool
:param disable_gateway: Property only valid for an Api Management service
deployed in multiple locations. This can be used to disable the gateway in
master region. Default value: False .
:type disable_gateway: bool
:param virtual_network_type: The type of VPN in which API Management
service needs to be configured in. None (Default Value) means the API
Management service is not part of any Virtual Network, External means the
API Management deployment is set up inside a Virtual Network having an
Internet Facing Endpoint, and Internal means that API Management
deployment is setup inside a Virtual Network having an Intranet Facing
Endpoint only. Possible values include: 'None', 'External', 'Internal'.
Default value: "None" .
:type virtual_network_type: str or
~azure.mgmt.apimanagement.models.VirtualNetworkType
:param api_version_constraint: Control Plane Apis version constraint for
the API Management service.
:type api_version_constraint:
~azure.mgmt.apimanagement.models.ApiVersionConstraint
"""
_validation = {
'notification_sender_email': {'max_length': 100},
'provisioning_state': {'readonly': True},
'target_provisioning_state': {'readonly': True},
'created_at_utc': {'readonly': True},
'gateway_url': {'readonly': True},
'gateway_regional_url': {'readonly': True},
'portal_url': {'readonly': True},
'management_api_url': {'readonly': True},
'scm_url': {'readonly': True},
'developer_portal_url': {'readonly': True},
'public_ip_addresses': {'readonly': True},
'private_ip_addresses': {'readonly': True},
}
_attribute_map = {
'notification_sender_email': {'key': 'notificationSenderEmail', 'type': 'str'},
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'target_provisioning_state': {'key': 'targetProvisioningState', 'type': 'str'},
'created_at_utc': {'key': 'createdAtUtc', 'type': 'iso-8601'},
'gateway_url': {'key': 'gatewayUrl', 'type': 'str'},
'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'},
'portal_url': {'key': 'portalUrl', 'type': 'str'},
'management_api_url': {'key': 'managementApiUrl', 'type': 'str'},
'scm_url': {'key': 'scmUrl', 'type': 'str'},
'developer_portal_url': {'key': 'developerPortalUrl', 'type': 'str'},
'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'},
'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'},
'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'},
'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'},
'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'},
'custom_properties': {'key': 'customProperties', 'type': '{str}'},
'certificates': {'key': 'certificates', 'type': '[CertificateConfiguration]'},
'enable_client_certificate': {'key': 'enableClientCertificate', 'type': 'bool'},
'disable_gateway': {'key': 'disableGateway', 'type': 'bool'},
'virtual_network_type': {'key': 'virtualNetworkType', 'type': 'str'},
'api_version_constraint': {'key': 'apiVersionConstraint', 'type': 'ApiVersionConstraint'},
}
def __init__(self, *, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, **kwargs) -> None:
super(ApiManagementServiceBaseProperties, self).__init__(**kwargs)
self.notification_sender_email = notification_sender_email
self.provisioning_state = None
self.target_provisioning_state = None
self.created_at_utc = None
self.gateway_url = None
self.gateway_regional_url = None
self.portal_url = None
self.management_api_url = None
self.scm_url = None
self.developer_portal_url = None
self.hostname_configurations = hostname_configurations
self.public_ip_addresses = None
self.private_ip_addresses = None
self.virtual_network_configuration = virtual_network_configuration
self.additional_locations = additional_locations
self.custom_properties = custom_properties
self.certificates = certificates
self.enable_client_certificate = enable_client_certificate
self.disable_gateway = disable_gateway
self.virtual_network_type = virtual_network_type
self.api_version_constraint = api_version_constraint
class ApiManagementServiceCheckNameAvailabilityParameters(Model):
"""Parameters supplied to the CheckNameAvailability operation.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name to check for availability.
:type name: str
"""
_validation = {
'name': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, *, name: str, **kwargs) -> None:
super(ApiManagementServiceCheckNameAvailabilityParameters, self).__init__(**kwargs)
self.name = name
class ApiManagementServiceGetSsoTokenResult(Model):
"""The response of the GetSsoToken operation.
:param redirect_uri: Redirect URL to the Publisher Portal containing the
SSO token.
:type redirect_uri: str
"""
_attribute_map = {
'redirect_uri': {'key': 'redirectUri', 'type': 'str'},
}
def __init__(self, *, redirect_uri: str=None, **kwargs) -> None:
super(ApiManagementServiceGetSsoTokenResult, self).__init__(**kwargs)
self.redirect_uri = redirect_uri
class ApiManagementServiceIdentity(Model):
"""Identity properties of the Api Management service resource.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param type: Required. The type of identity used for the resource. The
type 'SystemAssigned, UserAssigned' includes both an implicitly created
identity and a set of user assigned identities. The type 'None' will
remove any identities from the service. Possible values include:
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or ~azure.mgmt.apimanagement.models.ApimIdentityType
:ivar principal_id: The principal id of the identity.
:vartype principal_id: str
:ivar tenant_id: The client tenant id of the identity.
:vartype tenant_id: str
:param user_assigned_identities: The list of user identities associated
with the resource. The user identity
dictionary key references will be ARM resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.apimanagement.models.UserIdentityProperties]
"""
_validation = {
'type': {'required': True},
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentityProperties}'},
}
def __init__(self, *, type, user_assigned_identities=None, **kwargs) -> None:
super(ApiManagementServiceIdentity, self).__init__(**kwargs)
self.type = type
self.principal_id = None
self.tenant_id = None
self.user_assigned_identities = user_assigned_identities
class ApiManagementServiceNameAvailabilityResult(Model):
"""Response of the CheckNameAvailability operation.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name_available: True if the name is available and can be used to
create a new API Management service; otherwise false.
:vartype name_available: bool
:ivar message: If reason == invalid, provide the user with the reason why
the given name is invalid, and provide the resource naming requirements so
that the user can select a valid name. If reason == AlreadyExists, explain
that <resourceName> is already in use, and direct them to select a
different name.
:vartype message: str
:param reason: Invalid indicates the name provided does not match the
resource provider’s naming requirements (incorrect length, unsupported
characters, etc.) AlreadyExists indicates that the name is already in use
and is therefore unavailable. Possible values include: 'Valid', 'Invalid',
'AlreadyExists'
:type reason: str or
~azure.mgmt.apimanagement.models.NameAvailabilityReason
"""
_validation = {
'name_available': {'readonly': True},
'message': {'readonly': True},
}
_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'message': {'key': 'message', 'type': 'str'},
'reason': {'key': 'reason', 'type': 'NameAvailabilityReason'},
}
def __init__(self, *, reason=None, **kwargs) -> None:
super(ApiManagementServiceNameAvailabilityResult, self).__init__(**kwargs)
self.name_available = None
self.message = None
self.reason = reason
class ApimResource(Model):
"""The Resource definition.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource is set to
Microsoft.ApiManagement.
:vartype type: str
:param tags: Resource tags.
:type tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}
def __init__(self, *, tags=None, **kwargs) -> None:
super(ApimResource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.tags = tags
class ApiManagementServiceResource(ApimResource):
"""A single API Management service resource in List or Get response.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource is set to
Microsoft.ApiManagement.
:vartype type: str
:param tags: Resource tags.
:type tags: dict[str, str]
:param notification_sender_email: Email address from which the
notification will be sent.
:type notification_sender_email: str
:ivar provisioning_state: The current provisioning state of the API
Management service which can be one of the following:
Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
:vartype provisioning_state: str
:ivar target_provisioning_state: The provisioning state of the API
Management service, which is targeted by the long running operation
started on the service.
:vartype target_provisioning_state: str
:ivar created_at_utc: Creation UTC date of the API Management service.The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:vartype created_at_utc: datetime
:ivar gateway_url: Gateway URL of the API Management service.
:vartype gateway_url: str
:ivar gateway_regional_url: Gateway URL of the API Management service in
the Default Region.
:vartype gateway_regional_url: str
:ivar portal_url: Publisher portal endpoint Url of the API Management
service.
:vartype portal_url: str
:ivar management_api_url: Management API endpoint URL of the API
Management service.
:vartype management_api_url: str
:ivar scm_url: SCM endpoint URL of the API Management service.
:vartype scm_url: str
:ivar developer_portal_url: DEveloper Portal endpoint URL of the API
Management service.
:vartype developer_portal_url: str
:param hostname_configurations: Custom hostname configuration of the API
Management service.
:type hostname_configurations:
list[~azure.mgmt.apimanagement.models.HostnameConfiguration]
:ivar public_ip_addresses: Public Static Load Balanced IP addresses of the
API Management service in Primary region. Available only for Basic,
Standard and Premium SKU.
:vartype public_ip_addresses: list[str]
:ivar private_ip_addresses: Private Static Load Balanced IP addresses of
the API Management service in Primary region which is deployed in an
Internal Virtual Network. Available only for Basic, Standard and Premium
SKU.
:vartype private_ip_addresses: list[str]
:param virtual_network_configuration: Virtual network configuration of the
API Management service.
:type virtual_network_configuration:
~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration
:param additional_locations: Additional datacenter locations of the API
Management service.
:type additional_locations:
list[~azure.mgmt.apimanagement.models.AdditionalLocation]
:param custom_properties: Custom properties of the API Management
service.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`
will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1
and 1.2).</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11`
can be used to disable just TLS 1.1.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10`
can be used to disable TLS 1.0 on an API Management service.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11`
can be used to disable just TLS 1.1 for communications with
backends.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10`
can be used to disable TLS 1.0 for communications with
backends.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can
be used to enable HTTP2 protocol on an API Management service.</br>Not
specifying any of these properties on PATCH operation will reset omitted
properties' values to their defaults. For all the settings except Http2
the default value is `True` if the service was created on or before April
1st 2018 and `False` otherwise. Http2 setting's default value is
`False`.</br></br>You can disable any of next ciphers by using settings
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example,
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`.
The default value is `true` for them. Note: next ciphers can't be
disabled since they are required by Azure CloudService internal
components:
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
:type custom_properties: dict[str, str]
:param certificates: List of Certificates that need to be installed in the
API Management service. Max supported certificates that can be installed
is 10.
:type certificates:
list[~azure.mgmt.apimanagement.models.CertificateConfiguration]
:param enable_client_certificate: Property only meant to be used for
Consumption SKU Service. This enforces a client certificate to be
presented on each request to the gateway. This also enables the ability to
authenticate the certificate in the policy on the gateway. Default value:
False .
:type enable_client_certificate: bool
:param disable_gateway: Property only valid for an Api Management service
deployed in multiple locations. This can be used to disable the gateway in
master region. Default value: False .
:type disable_gateway: bool
:param virtual_network_type: The type of VPN in which API Management
service needs to be configured in. None (Default Value) means the API
Management service is not part of any Virtual Network, External means the
API Management deployment is set up inside a Virtual Network having an
Internet Facing Endpoint, and Internal means that API Management
deployment is setup inside a Virtual Network having an Intranet Facing
Endpoint only. Possible values include: 'None', 'External', 'Internal'.
Default value: "None" .
:type virtual_network_type: str or
~azure.mgmt.apimanagement.models.VirtualNetworkType
:param api_version_constraint: Control Plane Apis version constraint for
the API Management service.
:type api_version_constraint:
~azure.mgmt.apimanagement.models.ApiVersionConstraint
:param publisher_email: Required. Publisher email.
:type publisher_email: str
:param publisher_name: Required. Publisher name.
:type publisher_name: str
:param sku: Required. SKU properties of the API Management service.
:type sku:
~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties
:param identity: Managed service identity of the Api Management service.
:type identity:
~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity
:param location: Required. Resource location.
:type location: str
:ivar etag: ETag of the resource.
:vartype etag: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'notification_sender_email': {'max_length': 100},
'provisioning_state': {'readonly': True},
'target_provisioning_state': {'readonly': True},
'created_at_utc': {'readonly': True},
'gateway_url': {'readonly': True},
'gateway_regional_url': {'readonly': True},
'portal_url': {'readonly': True},
'management_api_url': {'readonly': True},
'scm_url': {'readonly': True},
'developer_portal_url': {'readonly': True},
'public_ip_addresses': {'readonly': True},
'private_ip_addresses': {'readonly': True},
'publisher_email': {'required': True, 'max_length': 100},
'publisher_name': {'required': True, 'max_length': 100},
'sku': {'required': True},
'location': {'required': True},
'etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'notification_sender_email': {'key': 'properties.notificationSenderEmail', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'target_provisioning_state': {'key': 'properties.targetProvisioningState', 'type': 'str'},
'created_at_utc': {'key': 'properties.createdAtUtc', 'type': 'iso-8601'},
'gateway_url': {'key': 'properties.gatewayUrl', 'type': 'str'},
'gateway_regional_url': {'key': 'properties.gatewayRegionalUrl', 'type': 'str'},
'portal_url': {'key': 'properties.portalUrl', 'type': 'str'},
'management_api_url': {'key': 'properties.managementApiUrl', 'type': 'str'},
'scm_url': {'key': 'properties.scmUrl', 'type': 'str'},
'developer_portal_url': {'key': 'properties.developerPortalUrl', 'type': 'str'},
'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'},
'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'},
'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'},
'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'},
'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'},
'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'},
'certificates': {'key': 'properties.certificates', 'type': '[CertificateConfiguration]'},
'enable_client_certificate': {'key': 'properties.enableClientCertificate', 'type': 'bool'},
'disable_gateway': {'key': 'properties.disableGateway', 'type': 'bool'},
'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'},
'api_version_constraint': {'key': 'properties.apiVersionConstraint', 'type': 'ApiVersionConstraint'},
'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'},
'publisher_name': {'key': 'properties.publisherName', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'},
'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'},
'location': {'key': 'location', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
}
def __init__(self, *, publisher_email: str, publisher_name: str, sku, location: str, tags=None, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, identity=None, **kwargs) -> None:
super(ApiManagementServiceResource, self).__init__(tags=tags, **kwargs)
self.notification_sender_email = notification_sender_email
self.provisioning_state = None
self.target_provisioning_state = None
self.created_at_utc = None
self.gateway_url = None
self.gateway_regional_url = None
self.portal_url = None
self.management_api_url = None
self.scm_url = None
self.developer_portal_url = None
self.hostname_configurations = hostname_configurations
self.public_ip_addresses = None
self.private_ip_addresses = None
self.virtual_network_configuration = virtual_network_configuration
self.additional_locations = additional_locations
self.custom_properties = custom_properties
self.certificates = certificates
self.enable_client_certificate = enable_client_certificate
self.disable_gateway = disable_gateway
self.virtual_network_type = virtual_network_type
self.api_version_constraint = api_version_constraint
self.publisher_email = publisher_email
self.publisher_name = publisher_name
self.sku = sku
self.identity = identity
self.location = location
self.etag = None
class ApiManagementServiceSkuProperties(Model):
"""API Management service resource SKU properties.
All required parameters must be populated in order to send to Azure.
:param name: Required. Name of the Sku. Possible values include:
'Developer', 'Standard', 'Premium', 'Basic', 'Consumption'
:type name: str or ~azure.mgmt.apimanagement.models.SkuType
:param capacity: Required. Capacity of the SKU (number of deployed units
of the SKU). For Consumption SKU capacity must be specified as 0.
:type capacity: int
"""
_validation = {
'name': {'required': True},
'capacity': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'capacity': {'key': 'capacity', 'type': 'int'},
}
def __init__(self, *, name, capacity: int, **kwargs) -> None:
super(ApiManagementServiceSkuProperties, self).__init__(**kwargs)
self.name = name
self.capacity = capacity
class ApiManagementServiceUpdateParameters(ApimResource):
"""Parameter supplied to Update Api Management Service.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource is set to
Microsoft.ApiManagement.
:vartype type: str
:param tags: Resource tags.
:type tags: dict[str, str]
:param notification_sender_email: Email address from which the
notification will be sent.
:type notification_sender_email: str
:ivar provisioning_state: The current provisioning state of the API
Management service which can be one of the following:
Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
:vartype provisioning_state: str
:ivar target_provisioning_state: The provisioning state of the API
Management service, which is targeted by the long running operation
started on the service.
:vartype target_provisioning_state: str
:ivar created_at_utc: Creation UTC date of the API Management service.The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:vartype created_at_utc: datetime
:ivar gateway_url: Gateway URL of the API Management service.
:vartype gateway_url: str
:ivar gateway_regional_url: Gateway URL of the API Management service in
the Default Region.
:vartype gateway_regional_url: str
:ivar portal_url: Publisher portal endpoint Url of the API Management
service.
:vartype portal_url: str
:ivar management_api_url: Management API endpoint URL of the API
Management service.
:vartype management_api_url: str
:ivar scm_url: SCM endpoint URL of the API Management service.
:vartype scm_url: str
:ivar developer_portal_url: DEveloper Portal endpoint URL of the API
Management service.
:vartype developer_portal_url: str
:param hostname_configurations: Custom hostname configuration of the API
Management service.
:type hostname_configurations:
list[~azure.mgmt.apimanagement.models.HostnameConfiguration]
:ivar public_ip_addresses: Public Static Load Balanced IP addresses of the
API Management service in Primary region. Available only for Basic,
Standard and Premium SKU.
:vartype public_ip_addresses: list[str]
:ivar private_ip_addresses: Private Static Load Balanced IP addresses of
the API Management service in Primary region which is deployed in an
Internal Virtual Network. Available only for Basic, Standard and Premium
SKU.
:vartype private_ip_addresses: list[str]
:param virtual_network_configuration: Virtual network configuration of the
API Management service.
:type virtual_network_configuration:
~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration
:param additional_locations: Additional datacenter locations of the API
Management service.
:type additional_locations:
list[~azure.mgmt.apimanagement.models.AdditionalLocation]
:param custom_properties: Custom properties of the API Management
service.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`
will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1
and 1.2).</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11`
can be used to disable just TLS 1.1.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10`
can be used to disable TLS 1.0 on an API Management service.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11`
can be used to disable just TLS 1.1 for communications with
backends.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10`
can be used to disable TLS 1.0 for communications with
backends.</br>Setting
`Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can
be used to enable HTTP2 protocol on an API Management service.</br>Not
specifying any of these properties on PATCH operation will reset omitted
properties' values to their defaults. For all the settings except Http2
the default value is `True` if the service was created on or before April
1st 2018 and `False` otherwise. Http2 setting's default value is
`False`.</br></br>You can disable any of next ciphers by using settings
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`:
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256,
TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example,
`Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`.
The default value is `true` for them. Note: next ciphers can't be
disabled since they are required by Azure CloudService internal
components:
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
:type custom_properties: dict[str, str]
:param certificates: List of Certificates that need to be installed in the
API Management service. Max supported certificates that can be installed
is 10.
:type certificates:
list[~azure.mgmt.apimanagement.models.CertificateConfiguration]
:param enable_client_certificate: Property only meant to be used for
Consumption SKU Service. This enforces a client certificate to be
presented on each request to the gateway. This also enables the ability to
authenticate the certificate in the policy on the gateway. Default value:
False .
:type enable_client_certificate: bool
:param disable_gateway: Property only valid for an Api Management service
deployed in multiple locations. This can be used to disable the gateway in
master region. Default value: False .
:type disable_gateway: bool
:param virtual_network_type: The type of VPN in which API Management
service needs to be configured in. None (Default Value) means the API
Management service is not part of any Virtual Network, External means the
API Management deployment is set up inside a Virtual Network having an
Internet Facing Endpoint, and Internal means that API Management
deployment is setup inside a Virtual Network having an Intranet Facing
Endpoint only. Possible values include: 'None', 'External', 'Internal'.
Default value: "None" .
:type virtual_network_type: str or
~azure.mgmt.apimanagement.models.VirtualNetworkType
:param api_version_constraint: Control Plane Apis version constraint for
the API Management service.
:type api_version_constraint:
~azure.mgmt.apimanagement.models.ApiVersionConstraint
:param publisher_email: Publisher email.
:type publisher_email: str
:param publisher_name: Publisher name.
:type publisher_name: str
:param sku: SKU properties of the API Management service.
:type sku:
~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties
:param identity: Managed service identity of the Api Management service.
:type identity:
~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity
:ivar etag: ETag of the resource.
:vartype etag: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'notification_sender_email': {'max_length': 100},
'provisioning_state': {'readonly': True},
'target_provisioning_state': {'readonly': True},
'created_at_utc': {'readonly': True},
'gateway_url': {'readonly': True},
'gateway_regional_url': {'readonly': True},
'portal_url': {'readonly': True},
'management_api_url': {'readonly': True},
'scm_url': {'readonly': True},
'developer_portal_url': {'readonly': True},
'public_ip_addresses': {'readonly': True},
'private_ip_addresses': {'readonly': True},
'publisher_email': {'max_length': 100},
'publisher_name': {'max_length': 100},
'etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'notification_sender_email': {'key': 'properties.notificationSenderEmail', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'target_provisioning_state': {'key': 'properties.targetProvisioningState', 'type': 'str'},
'created_at_utc': {'key': 'properties.createdAtUtc', 'type': 'iso-8601'},
'gateway_url': {'key': 'properties.gatewayUrl', 'type': 'str'},
'gateway_regional_url': {'key': 'properties.gatewayRegionalUrl', 'type': 'str'},
'portal_url': {'key': 'properties.portalUrl', 'type': 'str'},
'management_api_url': {'key': 'properties.managementApiUrl', 'type': 'str'},
'scm_url': {'key': 'properties.scmUrl', 'type': 'str'},
'developer_portal_url': {'key': 'properties.developerPortalUrl', 'type': 'str'},
'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'},
'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'},
'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'},
'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'},
'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'},
'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'},
'certificates': {'key': 'properties.certificates', 'type': '[CertificateConfiguration]'},
'enable_client_certificate': {'key': 'properties.enableClientCertificate', 'type': 'bool'},
'disable_gateway': {'key': 'properties.disableGateway', 'type': 'bool'},
'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'},
'api_version_constraint': {'key': 'properties.apiVersionConstraint', 'type': 'ApiVersionConstraint'},
'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'},
'publisher_name': {'key': 'properties.publisherName', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'},
'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'},
'etag': {'key': 'etag', 'type': 'str'},
}
def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, publisher_email: str=None, publisher_name: str=None, sku=None, identity=None, **kwargs) -> None:
super(ApiManagementServiceUpdateParameters, self).__init__(tags=tags, **kwargs)
self.notification_sender_email = notification_sender_email
self.provisioning_state = None
self.target_provisioning_state = None
self.created_at_utc = None
self.gateway_url = None
self.gateway_regional_url = None
self.portal_url = None
self.management_api_url = None
self.scm_url = None
self.developer_portal_url = None
self.hostname_configurations = hostname_configurations
self.public_ip_addresses = None
self.private_ip_addresses = None
self.virtual_network_configuration = virtual_network_configuration
self.additional_locations = additional_locations
self.custom_properties = custom_properties
self.certificates = certificates
self.enable_client_certificate = enable_client_certificate
self.disable_gateway = disable_gateway
self.virtual_network_type = virtual_network_type
self.api_version_constraint = api_version_constraint
self.publisher_email = publisher_email
self.publisher_name = publisher_name
self.sku = sku
self.identity = identity
self.etag = None
class ApiReleaseContract(Resource):
"""ApiRelease details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param api_id: Identifier of the API the release belongs to.
:type api_id: str
:ivar created_date_time: The time the API was released. The date conforms
to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601
standard.
:vartype created_date_time: datetime
:ivar updated_date_time: The time the API release was updated.
:vartype updated_date_time: datetime
:param notes: Release Notes
:type notes: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'created_date_time': {'readonly': True},
'updated_date_time': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'api_id': {'key': 'properties.apiId', 'type': 'str'},
'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'},
'updated_date_time': {'key': 'properties.updatedDateTime', 'type': 'iso-8601'},
'notes': {'key': 'properties.notes', 'type': 'str'},
}
def __init__(self, *, api_id: str=None, notes: str=None, **kwargs) -> None:
super(ApiReleaseContract, self).__init__(**kwargs)
self.api_id = api_id
self.created_date_time = None
self.updated_date_time = None
self.notes = notes
class ApiRevisionContract(Model):
"""Summary of revision metadata.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar api_id: Identifier of the API Revision.
:vartype api_id: str
:ivar api_revision: Revision number of API.
:vartype api_revision: str
:ivar created_date_time: The time the API Revision was created. The date
conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the
ISO 8601 standard.
:vartype created_date_time: datetime
:ivar updated_date_time: The time the API Revision were updated. The date
conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the
ISO 8601 standard.
:vartype updated_date_time: datetime
:ivar description: Description of the API Revision.
:vartype description: str
:ivar private_url: Gateway URL for accessing the non-current API Revision.
:vartype private_url: str
:ivar is_online: Indicates if API revision is the current api revision.
:vartype is_online: bool
:ivar is_current: Indicates if API revision is accessible via the gateway.
:vartype is_current: bool
"""
_validation = {
'api_id': {'readonly': True},
'api_revision': {'readonly': True, 'max_length': 100, 'min_length': 1},
'created_date_time': {'readonly': True},
'updated_date_time': {'readonly': True},
'description': {'readonly': True, 'max_length': 256},
'private_url': {'readonly': True},
'is_online': {'readonly': True},
'is_current': {'readonly': True},
}
_attribute_map = {
'api_id': {'key': 'apiId', 'type': 'str'},
'api_revision': {'key': 'apiRevision', 'type': 'str'},
'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'},
'updated_date_time': {'key': 'updatedDateTime', 'type': 'iso-8601'},
'description': {'key': 'description', 'type': 'str'},
'private_url': {'key': 'privateUrl', 'type': 'str'},
'is_online': {'key': 'isOnline', 'type': 'bool'},
'is_current': {'key': 'isCurrent', 'type': 'bool'},
}
def __init__(self, **kwargs) -> None:
super(ApiRevisionContract, self).__init__(**kwargs)
self.api_id = None
self.api_revision = None
self.created_date_time = None
self.updated_date_time = None
self.description = None
self.private_url = None
self.is_online = None
self.is_current = None
class ApiRevisionInfoContract(Model):
"""Object used to create an API Revision or Version based on an existing API
Revision.
:param source_api_id: Resource identifier of API to be used to create the
revision from.
:type source_api_id: str
:param api_version_name: Version identifier for the new API Version.
:type api_version_name: str
:param api_revision_description: Description of new API Revision.
:type api_revision_description: str
:param api_version_set: Version set details
:type api_version_set:
~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails
"""
_validation = {
'api_version_name': {'max_length': 100},
'api_revision_description': {'max_length': 256},
}
_attribute_map = {
'source_api_id': {'key': 'sourceApiId', 'type': 'str'},
'api_version_name': {'key': 'apiVersionName', 'type': 'str'},
'api_revision_description': {'key': 'apiRevisionDescription', 'type': 'str'},
'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'},
}
def __init__(self, *, source_api_id: str=None, api_version_name: str=None, api_revision_description: str=None, api_version_set=None, **kwargs) -> None:
super(ApiRevisionInfoContract, self).__init__(**kwargs)
self.source_api_id = source_api_id
self.api_version_name = api_version_name
self.api_revision_description = api_revision_description
self.api_version_set = api_version_set
class ApiTagResourceContractProperties(ApiEntityBaseContract):
"""API contract properties for the Tag Resources.
Variables are only populated by the server, and will be ignored when
sending a request.
:param description: Description of the API. May include HTML formatting
tags.
:type description: str
:param authentication_settings: Collection of authentication settings
included into this API.
:type authentication_settings:
~azure.mgmt.apimanagement.models.AuthenticationSettingsContract
:param subscription_key_parameter_names: Protocols over which API is made
available.
:type subscription_key_parameter_names:
~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract
:param api_type: Type of API. Possible values include: 'http', 'soap'
:type api_type: str or ~azure.mgmt.apimanagement.models.ApiType
:param api_revision: Describes the Revision of the Api. If no value is
provided, default revision 1 is created
:type api_revision: str
:param api_version: Indicates the Version identifier of the API if the API
is versioned
:type api_version: str
:param is_current: Indicates if API revision is current api revision.
:type is_current: bool
:ivar is_online: Indicates if API revision is accessible via the gateway.
:vartype is_online: bool
:param api_revision_description: Description of the Api Revision.
:type api_revision_description: str
:param api_version_description: Description of the Api Version.
:type api_version_description: str
:param api_version_set_id: A resource identifier for the related
ApiVersionSet.
:type api_version_set_id: str
:param subscription_required: Specifies whether an API or Product
subscription is required for accessing the API.
:type subscription_required: bool
:param id: API identifier in the form /apis/{apiId}.
:type id: str
:param name: API name.
:type name: str
:param service_url: Absolute URL of the backend service implementing this
API.
:type service_url: str
:param path: Relative URL uniquely identifying this API and all of its
resource paths within the API Management service instance. It is appended
to the API endpoint base URL specified during the service instance
creation to form a public URL for this API.
:type path: str
:param protocols: Describes on which protocols the operations in this API
can be invoked.
:type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol]
"""
_validation = {
'api_revision': {'max_length': 100, 'min_length': 1},
'api_version': {'max_length': 100},
'is_online': {'readonly': True},
'api_revision_description': {'max_length': 256},
'api_version_description': {'max_length': 256},
'name': {'max_length': 300, 'min_length': 1},
'service_url': {'max_length': 2000, 'min_length': 1},
'path': {'max_length': 400, 'min_length': 0},
}
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'authentication_settings': {'key': 'authenticationSettings', 'type': 'AuthenticationSettingsContract'},
'subscription_key_parameter_names': {'key': 'subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'},
'api_type': {'key': 'type', 'type': 'str'},
'api_revision': {'key': 'apiRevision', 'type': 'str'},
'api_version': {'key': 'apiVersion', 'type': 'str'},
'is_current': {'key': 'isCurrent', 'type': 'bool'},
'is_online': {'key': 'isOnline', 'type': 'bool'},
'api_revision_description': {'key': 'apiRevisionDescription', 'type': 'str'},
'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'},
'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'},
'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'},
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'service_url': {'key': 'serviceUrl', 'type': 'str'},
'path': {'key': 'path', 'type': 'str'},
'protocols': {'key': 'protocols', 'type': '[Protocol]'},
}
def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, id: str=None, name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None:
super(ApiTagResourceContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, **kwargs)
self.id = id
self.name = name
self.service_url = service_url
self.path = path
self.protocols = protocols
class ApiUpdateContract(Model):
"""API update contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
:param description: Description of the API. May include HTML formatting
tags.
:type description: str
:param authentication_settings: Collection of authentication settings
included into this API.
:type authentication_settings:
~azure.mgmt.apimanagement.models.AuthenticationSettingsContract
:param subscription_key_parameter_names: Protocols over which API is made
available.
:type subscription_key_parameter_names:
~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract
:param api_type: Type of API. Possible values include: 'http', 'soap'
:type api_type: str or ~azure.mgmt.apimanagement.models.ApiType
:param api_revision: Describes the Revision of the Api. If no value is
provided, default revision 1 is created
:type api_revision: str
:param api_version: Indicates the Version identifier of the API if the API
is versioned
:type api_version: str
:param is_current: Indicates if API revision is current api revision.
:type is_current: bool
:ivar is_online: Indicates if API revision is accessible via the gateway.
:vartype is_online: bool
:param api_revision_description: Description of the Api Revision.
:type api_revision_description: str
:param api_version_description: Description of the Api Version.
:type api_version_description: str
:param api_version_set_id: A resource identifier for the related
ApiVersionSet.
:type api_version_set_id: str
:param subscription_required: Specifies whether an API or Product
subscription is required for accessing the API.
:type subscription_required: bool
:param display_name: API name.
:type display_name: str
:param service_url: Absolute URL of the backend service implementing this
API.
:type service_url: str
:param path: Relative URL uniquely identifying this API and all of its
resource paths within the API Management service instance. It is appended
to the API endpoint base URL specified during the service instance
creation to form a public URL for this API.
:type path: str
:param protocols: Describes on which protocols the operations in this API
can be invoked.
:type protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol]
"""
_validation = {
'api_revision': {'max_length': 100, 'min_length': 1},
'api_version': {'max_length': 100},
'is_online': {'readonly': True},
'api_revision_description': {'max_length': 256},
'api_version_description': {'max_length': 256},
'display_name': {'max_length': 300, 'min_length': 1},
'service_url': {'max_length': 2000, 'min_length': 1},
'path': {'max_length': 400, 'min_length': 0},
}
_attribute_map = {
'description': {'key': 'properties.description', 'type': 'str'},
'authentication_settings': {'key': 'properties.authenticationSettings', 'type': 'AuthenticationSettingsContract'},
'subscription_key_parameter_names': {'key': 'properties.subscriptionKeyParameterNames', 'type': 'SubscriptionKeyParameterNamesContract'},
'api_type': {'key': 'properties.type', 'type': 'str'},
'api_revision': {'key': 'properties.apiRevision', 'type': 'str'},
'api_version': {'key': 'properties.apiVersion', 'type': 'str'},
'is_current': {'key': 'properties.isCurrent', 'type': 'bool'},
'is_online': {'key': 'properties.isOnline', 'type': 'bool'},
'api_revision_description': {'key': 'properties.apiRevisionDescription', 'type': 'str'},
'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'},
'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'},
'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'service_url': {'key': 'properties.serviceUrl', 'type': 'str'},
'path': {'key': 'properties.path', 'type': 'str'},
'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'},
}
def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, display_name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None:
super(ApiUpdateContract, self).__init__(**kwargs)
self.description = description
self.authentication_settings = authentication_settings
self.subscription_key_parameter_names = subscription_key_parameter_names
self.api_type = api_type
self.api_revision = api_revision
self.api_version = api_version
self.is_current = is_current
self.is_online = None
self.api_revision_description = api_revision_description
self.api_version_description = api_version_description
self.api_version_set_id = api_version_set_id
self.subscription_required = subscription_required
self.display_name = display_name
self.service_url = service_url
self.path = path
self.protocols = protocols
class ApiVersionConstraint(Model):
"""Control Plane Apis version constraint for the API Management service.
:param min_api_version: Limit control plane API calls to API Management
service with version equal to or newer than this value.
:type min_api_version: str
"""
_attribute_map = {
'min_api_version': {'key': 'minApiVersion', 'type': 'str'},
}
def __init__(self, *, min_api_version: str=None, **kwargs) -> None:
super(ApiVersionConstraint, self).__init__(**kwargs)
self.min_api_version = min_api_version
class ApiVersionSetContract(Resource):
"""Api Version Set Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Description of API Version Set.
:type description: str
:param version_query_name: Name of query parameter that indicates the API
Version if versioningScheme is set to `query`.
:type version_query_name: str
:param version_header_name: Name of HTTP header parameter that indicates
the API Version if versioningScheme is set to `header`.
:type version_header_name: str
:param display_name: Required. Name of API Version Set
:type display_name: str
:param versioning_scheme: Required. An value that determines where the API
Version identifer will be located in a HTTP request. Possible values
include: 'Segment', 'Query', 'Header'
:type versioning_scheme: str or
~azure.mgmt.apimanagement.models.VersioningScheme
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'version_query_name': {'max_length': 100, 'min_length': 1},
'version_header_name': {'max_length': 100, 'min_length': 1},
'display_name': {'required': True, 'max_length': 100, 'min_length': 1},
'versioning_scheme': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'version_query_name': {'key': 'properties.versionQueryName', 'type': 'str'},
'version_header_name': {'key': 'properties.versionHeaderName', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'versioning_scheme': {'key': 'properties.versioningScheme', 'type': 'str'},
}
def __init__(self, *, display_name: str, versioning_scheme, description: str=None, version_query_name: str=None, version_header_name: str=None, **kwargs) -> None:
super(ApiVersionSetContract, self).__init__(**kwargs)
self.description = description
self.version_query_name = version_query_name
self.version_header_name = version_header_name
self.display_name = display_name
self.versioning_scheme = versioning_scheme
class ApiVersionSetContractDetails(Model):
"""An API Version Set contains the common configuration for a set of API
Versions relating .
:param id: Identifier for existing API Version Set. Omit this value to
create a new Version Set.
:type id: str
:param name: The display Name of the API Version Set.
:type name: str
:param description: Description of API Version Set.
:type description: str
:param versioning_scheme: An value that determines where the API Version
identifer will be located in a HTTP request. Possible values include:
'Segment', 'Query', 'Header'
:type versioning_scheme: str or ~azure.mgmt.apimanagement.models.enum
:param version_query_name: Name of query parameter that indicates the API
Version if versioningScheme is set to `query`.
:type version_query_name: str
:param version_header_name: Name of HTTP header parameter that indicates
the API Version if versioningScheme is set to `header`.
:type version_header_name: str
"""
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'versioning_scheme': {'key': 'versioningScheme', 'type': 'str'},
'version_query_name': {'key': 'versionQueryName', 'type': 'str'},
'version_header_name': {'key': 'versionHeaderName', 'type': 'str'},
}
def __init__(self, *, id: str=None, name: str=None, description: str=None, versioning_scheme=None, version_query_name: str=None, version_header_name: str=None, **kwargs) -> None:
super(ApiVersionSetContractDetails, self).__init__(**kwargs)
self.id = id
self.name = name
self.description = description
self.versioning_scheme = versioning_scheme
self.version_query_name = version_query_name
self.version_header_name = version_header_name
class ApiVersionSetEntityBase(Model):
"""Api Version set base parameters.
:param description: Description of API Version Set.
:type description: str
:param version_query_name: Name of query parameter that indicates the API
Version if versioningScheme is set to `query`.
:type version_query_name: str
:param version_header_name: Name of HTTP header parameter that indicates
the API Version if versioningScheme is set to `header`.
:type version_header_name: str
"""
_validation = {
'version_query_name': {'max_length': 100, 'min_length': 1},
'version_header_name': {'max_length': 100, 'min_length': 1},
}
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'version_query_name': {'key': 'versionQueryName', 'type': 'str'},
'version_header_name': {'key': 'versionHeaderName', 'type': 'str'},
}
def __init__(self, *, description: str=None, version_query_name: str=None, version_header_name: str=None, **kwargs) -> None:
super(ApiVersionSetEntityBase, self).__init__(**kwargs)
self.description = description
self.version_query_name = version_query_name
self.version_header_name = version_header_name
class ApiVersionSetUpdateParameters(Model):
"""Parameters to update or create an Api Version Set Contract.
:param description: Description of API Version Set.
:type description: str
:param version_query_name: Name of query parameter that indicates the API
Version if versioningScheme is set to `query`.
:type version_query_name: str
:param version_header_name: Name of HTTP header parameter that indicates
the API Version if versioningScheme is set to `header`.
:type version_header_name: str
:param display_name: Name of API Version Set
:type display_name: str
:param versioning_scheme: An value that determines where the API Version
identifer will be located in a HTTP request. Possible values include:
'Segment', 'Query', 'Header'
:type versioning_scheme: str or
~azure.mgmt.apimanagement.models.VersioningScheme
"""
_validation = {
'version_query_name': {'max_length': 100, 'min_length': 1},
'version_header_name': {'max_length': 100, 'min_length': 1},
'display_name': {'max_length': 100, 'min_length': 1},
}
_attribute_map = {
'description': {'key': 'properties.description', 'type': 'str'},
'version_query_name': {'key': 'properties.versionQueryName', 'type': 'str'},
'version_header_name': {'key': 'properties.versionHeaderName', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'versioning_scheme': {'key': 'properties.versioningScheme', 'type': 'str'},
}
def __init__(self, *, description: str=None, version_query_name: str=None, version_header_name: str=None, display_name: str=None, versioning_scheme=None, **kwargs) -> None:
super(ApiVersionSetUpdateParameters, self).__init__(**kwargs)
self.description = description
self.version_query_name = version_query_name
self.version_header_name = version_header_name
self.display_name = display_name
self.versioning_scheme = versioning_scheme
class AssociationContract(Resource):
"""Association entity details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param provisioning_state: Provisioning state. Possible values include:
'created'
:type provisioning_state: str or
~azure.mgmt.apimanagement.models.ProvisioningState
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'},
}
def __init__(self, *, provisioning_state=None, **kwargs) -> None:
super(AssociationContract, self).__init__(**kwargs)
self.provisioning_state = provisioning_state
class AuthenticationSettingsContract(Model):
"""API Authentication Settings.
:param o_auth2: OAuth2 Authentication settings
:type o_auth2:
~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract
:param openid: OpenID Connect Authentication Settings
:type openid:
~azure.mgmt.apimanagement.models.OpenIdAuthenticationSettingsContract
"""
_attribute_map = {
'o_auth2': {'key': 'oAuth2', 'type': 'OAuth2AuthenticationSettingsContract'},
'openid': {'key': 'openid', 'type': 'OpenIdAuthenticationSettingsContract'},
}
def __init__(self, *, o_auth2=None, openid=None, **kwargs) -> None:
super(AuthenticationSettingsContract, self).__init__(**kwargs)
self.o_auth2 = o_auth2
self.openid = openid
class AuthorizationServerContract(Resource):
"""External OAuth authorization server settings.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Description of the authorization server. Can contain
HTML formatting tags.
:type description: str
:param authorization_methods: HTTP verbs supported by the authorization
endpoint. GET must be always present. POST is optional.
:type authorization_methods: list[str or
~azure.mgmt.apimanagement.models.AuthorizationMethod]
:param client_authentication_method: Method of authentication supported by
the token endpoint of this authorization server. Possible values are Basic
and/or Body. When Body is specified, client credentials and other
parameters are passed within the request body in the
application/x-www-form-urlencoded format.
:type client_authentication_method: list[str or
~azure.mgmt.apimanagement.models.ClientAuthenticationMethod]
:param token_body_parameters: Additional parameters required by the token
endpoint of this authorization server represented as an array of JSON
objects with name and value string properties, i.e. {"name" : "name
value", "value": "a value"}.
:type token_body_parameters:
list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract]
:param token_endpoint: OAuth token endpoint. Contains absolute URI to
entity being referenced.
:type token_endpoint: str
:param support_state: If true, authorization server will include state
parameter from the authorization request to its response. Client may use
state parameter to raise protocol security.
:type support_state: bool
:param default_scope: Access token scope that is going to be requested by
default. Can be overridden at the API level. Should be provided in the
form of a string containing space-delimited values.
:type default_scope: str
:param bearer_token_sending_methods: Specifies the mechanism by which
access token is passed to the API.
:type bearer_token_sending_methods: list[str or
~azure.mgmt.apimanagement.models.BearerTokenSendingMethod]
:param resource_owner_username: Can be optionally specified when resource
owner password grant type is supported by this authorization server.
Default resource owner username.
:type resource_owner_username: str
:param resource_owner_password: Can be optionally specified when resource
owner password grant type is supported by this authorization server.
Default resource owner password.
:type resource_owner_password: str
:param display_name: Required. User-friendly authorization server name.
:type display_name: str
:param client_registration_endpoint: Required. Optional reference to a
page where client or app registration for this authorization server is
performed. Contains absolute URL to entity being referenced.
:type client_registration_endpoint: str
:param authorization_endpoint: Required. OAuth authorization endpoint. See
http://tools.ietf.org/html/rfc6749#section-3.2.
:type authorization_endpoint: str
:param grant_types: Required. Form of an authorization grant, which the
client uses to request the access token.
:type grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType]
:param client_id: Required. Client or app id registered with this
authorization server.
:type client_id: str
:param client_secret: Client or app secret registered with this
authorization server. This property will not be filled on 'GET'
operations! Use '/listSecrets' POST request to get the value.
:type client_secret: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'display_name': {'required': True, 'max_length': 50, 'min_length': 1},
'client_registration_endpoint': {'required': True},
'authorization_endpoint': {'required': True},
'grant_types': {'required': True},
'client_id': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'authorization_methods': {'key': 'properties.authorizationMethods', 'type': '[AuthorizationMethod]'},
'client_authentication_method': {'key': 'properties.clientAuthenticationMethod', 'type': '[str]'},
'token_body_parameters': {'key': 'properties.tokenBodyParameters', 'type': '[TokenBodyParameterContract]'},
'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'},
'support_state': {'key': 'properties.supportState', 'type': 'bool'},
'default_scope': {'key': 'properties.defaultScope', 'type': 'str'},
'bearer_token_sending_methods': {'key': 'properties.bearerTokenSendingMethods', 'type': '[str]'},
'resource_owner_username': {'key': 'properties.resourceOwnerUsername', 'type': 'str'},
'resource_owner_password': {'key': 'properties.resourceOwnerPassword', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'client_registration_endpoint': {'key': 'properties.clientRegistrationEndpoint', 'type': 'str'},
'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'},
'grant_types': {'key': 'properties.grantTypes', 'type': '[str]'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, display_name: str, client_registration_endpoint: str, authorization_endpoint: str, grant_types, client_id: str, description: str=None, authorization_methods=None, client_authentication_method=None, token_body_parameters=None, token_endpoint: str=None, support_state: bool=None, default_scope: str=None, bearer_token_sending_methods=None, resource_owner_username: str=None, resource_owner_password: str=None, client_secret: str=None, **kwargs) -> None:
super(AuthorizationServerContract, self).__init__(**kwargs)
self.description = description
self.authorization_methods = authorization_methods
self.client_authentication_method = client_authentication_method
self.token_body_parameters = token_body_parameters
self.token_endpoint = token_endpoint
self.support_state = support_state
self.default_scope = default_scope
self.bearer_token_sending_methods = bearer_token_sending_methods
self.resource_owner_username = resource_owner_username
self.resource_owner_password = resource_owner_password
self.display_name = display_name
self.client_registration_endpoint = client_registration_endpoint
self.authorization_endpoint = authorization_endpoint
self.grant_types = grant_types
self.client_id = client_id
self.client_secret = client_secret
class AuthorizationServerContractBaseProperties(Model):
"""External OAuth authorization server Update settings contract.
:param description: Description of the authorization server. Can contain
HTML formatting tags.
:type description: str
:param authorization_methods: HTTP verbs supported by the authorization
endpoint. GET must be always present. POST is optional.
:type authorization_methods: list[str or
~azure.mgmt.apimanagement.models.AuthorizationMethod]
:param client_authentication_method: Method of authentication supported by
the token endpoint of this authorization server. Possible values are Basic
and/or Body. When Body is specified, client credentials and other
parameters are passed within the request body in the
application/x-www-form-urlencoded format.
:type client_authentication_method: list[str or
~azure.mgmt.apimanagement.models.ClientAuthenticationMethod]
:param token_body_parameters: Additional parameters required by the token
endpoint of this authorization server represented as an array of JSON
objects with name and value string properties, i.e. {"name" : "name
value", "value": "a value"}.
:type token_body_parameters:
list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract]
:param token_endpoint: OAuth token endpoint. Contains absolute URI to
entity being referenced.
:type token_endpoint: str
:param support_state: If true, authorization server will include state
parameter from the authorization request to its response. Client may use
state parameter to raise protocol security.
:type support_state: bool
:param default_scope: Access token scope that is going to be requested by
default. Can be overridden at the API level. Should be provided in the
form of a string containing space-delimited values.
:type default_scope: str
:param bearer_token_sending_methods: Specifies the mechanism by which
access token is passed to the API.
:type bearer_token_sending_methods: list[str or
~azure.mgmt.apimanagement.models.BearerTokenSendingMethod]
:param resource_owner_username: Can be optionally specified when resource
owner password grant type is supported by this authorization server.
Default resource owner username.
:type resource_owner_username: str
:param resource_owner_password: Can be optionally specified when resource
owner password grant type is supported by this authorization server.
Default resource owner password.
:type resource_owner_password: str
"""
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'authorization_methods': {'key': 'authorizationMethods', 'type': '[AuthorizationMethod]'},
'client_authentication_method': {'key': 'clientAuthenticationMethod', 'type': '[str]'},
'token_body_parameters': {'key': 'tokenBodyParameters', 'type': '[TokenBodyParameterContract]'},
'token_endpoint': {'key': 'tokenEndpoint', 'type': 'str'},
'support_state': {'key': 'supportState', 'type': 'bool'},
'default_scope': {'key': 'defaultScope', 'type': 'str'},
'bearer_token_sending_methods': {'key': 'bearerTokenSendingMethods', 'type': '[str]'},
'resource_owner_username': {'key': 'resourceOwnerUsername', 'type': 'str'},
'resource_owner_password': {'key': 'resourceOwnerPassword', 'type': 'str'},
}
def __init__(self, *, description: str=None, authorization_methods=None, client_authentication_method=None, token_body_parameters=None, token_endpoint: str=None, support_state: bool=None, default_scope: str=None, bearer_token_sending_methods=None, resource_owner_username: str=None, resource_owner_password: str=None, **kwargs) -> None:
super(AuthorizationServerContractBaseProperties, self).__init__(**kwargs)
self.description = description
self.authorization_methods = authorization_methods
self.client_authentication_method = client_authentication_method
self.token_body_parameters = token_body_parameters
self.token_endpoint = token_endpoint
self.support_state = support_state
self.default_scope = default_scope
self.bearer_token_sending_methods = bearer_token_sending_methods
self.resource_owner_username = resource_owner_username
self.resource_owner_password = resource_owner_password
class AuthorizationServerUpdateContract(Resource):
"""External OAuth authorization server settings.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Description of the authorization server. Can contain
HTML formatting tags.
:type description: str
:param authorization_methods: HTTP verbs supported by the authorization
endpoint. GET must be always present. POST is optional.
:type authorization_methods: list[str or
~azure.mgmt.apimanagement.models.AuthorizationMethod]
:param client_authentication_method: Method of authentication supported by
the token endpoint of this authorization server. Possible values are Basic
and/or Body. When Body is specified, client credentials and other
parameters are passed within the request body in the
application/x-www-form-urlencoded format.
:type client_authentication_method: list[str or
~azure.mgmt.apimanagement.models.ClientAuthenticationMethod]
:param token_body_parameters: Additional parameters required by the token
endpoint of this authorization server represented as an array of JSON
objects with name and value string properties, i.e. {"name" : "name
value", "value": "a value"}.
:type token_body_parameters:
list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract]
:param token_endpoint: OAuth token endpoint. Contains absolute URI to
entity being referenced.
:type token_endpoint: str
:param support_state: If true, authorization server will include state
parameter from the authorization request to its response. Client may use
state parameter to raise protocol security.
:type support_state: bool
:param default_scope: Access token scope that is going to be requested by
default. Can be overridden at the API level. Should be provided in the
form of a string containing space-delimited values.
:type default_scope: str
:param bearer_token_sending_methods: Specifies the mechanism by which
access token is passed to the API.
:type bearer_token_sending_methods: list[str or
~azure.mgmt.apimanagement.models.BearerTokenSendingMethod]
:param resource_owner_username: Can be optionally specified when resource
owner password grant type is supported by this authorization server.
Default resource owner username.
:type resource_owner_username: str
:param resource_owner_password: Can be optionally specified when resource
owner password grant type is supported by this authorization server.
Default resource owner password.
:type resource_owner_password: str
:param display_name: User-friendly authorization server name.
:type display_name: str
:param client_registration_endpoint: Optional reference to a page where
client or app registration for this authorization server is performed.
Contains absolute URL to entity being referenced.
:type client_registration_endpoint: str
:param authorization_endpoint: OAuth authorization endpoint. See
http://tools.ietf.org/html/rfc6749#section-3.2.
:type authorization_endpoint: str
:param grant_types: Form of an authorization grant, which the client uses
to request the access token.
:type grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType]
:param client_id: Client or app id registered with this authorization
server.
:type client_id: str
:param client_secret: Client or app secret registered with this
authorization server. This property will not be filled on 'GET'
operations! Use '/listSecrets' POST request to get the value.
:type client_secret: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'display_name': {'max_length': 50, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'authorization_methods': {'key': 'properties.authorizationMethods', 'type': '[AuthorizationMethod]'},
'client_authentication_method': {'key': 'properties.clientAuthenticationMethod', 'type': '[str]'},
'token_body_parameters': {'key': 'properties.tokenBodyParameters', 'type': '[TokenBodyParameterContract]'},
'token_endpoint': {'key': 'properties.tokenEndpoint', 'type': 'str'},
'support_state': {'key': 'properties.supportState', 'type': 'bool'},
'default_scope': {'key': 'properties.defaultScope', 'type': 'str'},
'bearer_token_sending_methods': {'key': 'properties.bearerTokenSendingMethods', 'type': '[str]'},
'resource_owner_username': {'key': 'properties.resourceOwnerUsername', 'type': 'str'},
'resource_owner_password': {'key': 'properties.resourceOwnerPassword', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'client_registration_endpoint': {'key': 'properties.clientRegistrationEndpoint', 'type': 'str'},
'authorization_endpoint': {'key': 'properties.authorizationEndpoint', 'type': 'str'},
'grant_types': {'key': 'properties.grantTypes', 'type': '[str]'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, description: str=None, authorization_methods=None, client_authentication_method=None, token_body_parameters=None, token_endpoint: str=None, support_state: bool=None, default_scope: str=None, bearer_token_sending_methods=None, resource_owner_username: str=None, resource_owner_password: str=None, display_name: str=None, client_registration_endpoint: str=None, authorization_endpoint: str=None, grant_types=None, client_id: str=None, client_secret: str=None, **kwargs) -> None:
super(AuthorizationServerUpdateContract, self).__init__(**kwargs)
self.description = description
self.authorization_methods = authorization_methods
self.client_authentication_method = client_authentication_method
self.token_body_parameters = token_body_parameters
self.token_endpoint = token_endpoint
self.support_state = support_state
self.default_scope = default_scope
self.bearer_token_sending_methods = bearer_token_sending_methods
self.resource_owner_username = resource_owner_username
self.resource_owner_password = resource_owner_password
self.display_name = display_name
self.client_registration_endpoint = client_registration_endpoint
self.authorization_endpoint = authorization_endpoint
self.grant_types = grant_types
self.client_id = client_id
self.client_secret = client_secret
class BackendAuthorizationHeaderCredentials(Model):
"""Authorization header information.
All required parameters must be populated in order to send to Azure.
:param scheme: Required. Authentication Scheme name.
:type scheme: str
:param parameter: Required. Authentication Parameter value.
:type parameter: str
"""
_validation = {
'scheme': {'required': True, 'max_length': 100, 'min_length': 1},
'parameter': {'required': True, 'max_length': 300, 'min_length': 1},
}
_attribute_map = {
'scheme': {'key': 'scheme', 'type': 'str'},
'parameter': {'key': 'parameter', 'type': 'str'},
}
def __init__(self, *, scheme: str, parameter: str, **kwargs) -> None:
super(BackendAuthorizationHeaderCredentials, self).__init__(**kwargs)
self.scheme = scheme
self.parameter = parameter
class BackendBaseParameters(Model):
"""Backend entity base Parameter set.
:param title: Backend Title.
:type title: str
:param description: Backend Description.
:type description: str
:param resource_id: Management Uri of the Resource in External System.
This url can be the Arm Resource Id of Logic Apps, Function Apps or Api
Apps.
:type resource_id: str
:param properties: Backend Properties contract
:type properties: ~azure.mgmt.apimanagement.models.BackendProperties
:param credentials: Backend Credentials Contract Properties
:type credentials:
~azure.mgmt.apimanagement.models.BackendCredentialsContract
:param proxy: Backend Proxy Contract Properties
:type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract
:param tls: Backend TLS Properties
:type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties
"""
_validation = {
'title': {'max_length': 300, 'min_length': 1},
'description': {'max_length': 2000, 'min_length': 1},
'resource_id': {'max_length': 2000, 'min_length': 1},
}
_attribute_map = {
'title': {'key': 'title', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'resource_id': {'key': 'resourceId', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'BackendProperties'},
'credentials': {'key': 'credentials', 'type': 'BackendCredentialsContract'},
'proxy': {'key': 'proxy', 'type': 'BackendProxyContract'},
'tls': {'key': 'tls', 'type': 'BackendTlsProperties'},
}
def __init__(self, *, title: str=None, description: str=None, resource_id: str=None, properties=None, credentials=None, proxy=None, tls=None, **kwargs) -> None:
super(BackendBaseParameters, self).__init__(**kwargs)
self.title = title
self.description = description
self.resource_id = resource_id
self.properties = properties
self.credentials = credentials
self.proxy = proxy
self.tls = tls
class BackendContract(Resource):
"""Backend details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param title: Backend Title.
:type title: str
:param description: Backend Description.
:type description: str
:param resource_id: Management Uri of the Resource in External System.
This url can be the Arm Resource Id of Logic Apps, Function Apps or Api
Apps.
:type resource_id: str
:param properties: Backend Properties contract
:type properties: ~azure.mgmt.apimanagement.models.BackendProperties
:param credentials: Backend Credentials Contract Properties
:type credentials:
~azure.mgmt.apimanagement.models.BackendCredentialsContract
:param proxy: Backend Proxy Contract Properties
:type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract
:param tls: Backend TLS Properties
:type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties
:param url: Required. Runtime Url of the Backend.
:type url: str
:param protocol: Required. Backend communication protocol. Possible values
include: 'http', 'soap'
:type protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'title': {'max_length': 300, 'min_length': 1},
'description': {'max_length': 2000, 'min_length': 1},
'resource_id': {'max_length': 2000, 'min_length': 1},
'url': {'required': True, 'max_length': 2000, 'min_length': 1},
'protocol': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'resource_id': {'key': 'properties.resourceId', 'type': 'str'},
'properties': {'key': 'properties.properties', 'type': 'BackendProperties'},
'credentials': {'key': 'properties.credentials', 'type': 'BackendCredentialsContract'},
'proxy': {'key': 'properties.proxy', 'type': 'BackendProxyContract'},
'tls': {'key': 'properties.tls', 'type': 'BackendTlsProperties'},
'url': {'key': 'properties.url', 'type': 'str'},
'protocol': {'key': 'properties.protocol', 'type': 'str'},
}
def __init__(self, *, url: str, protocol, title: str=None, description: str=None, resource_id: str=None, properties=None, credentials=None, proxy=None, tls=None, **kwargs) -> None:
super(BackendContract, self).__init__(**kwargs)
self.title = title
self.description = description
self.resource_id = resource_id
self.properties = properties
self.credentials = credentials
self.proxy = proxy
self.tls = tls
self.url = url
self.protocol = protocol
class BackendCredentialsContract(Model):
"""Details of the Credentials used to connect to Backend.
:param certificate: List of Client Certificate Thumbprint.
:type certificate: list[str]
:param query: Query Parameter description.
:type query: dict[str, list[str]]
:param header: Header Parameter description.
:type header: dict[str, list[str]]
:param authorization: Authorization header authentication
:type authorization:
~azure.mgmt.apimanagement.models.BackendAuthorizationHeaderCredentials
"""
_validation = {
'certificate': {'max_items': 32},
}
_attribute_map = {
'certificate': {'key': 'certificate', 'type': '[str]'},
'query': {'key': 'query', 'type': '{[str]}'},
'header': {'key': 'header', 'type': '{[str]}'},
'authorization': {'key': 'authorization', 'type': 'BackendAuthorizationHeaderCredentials'},
}
def __init__(self, *, certificate=None, query=None, header=None, authorization=None, **kwargs) -> None:
super(BackendCredentialsContract, self).__init__(**kwargs)
self.certificate = certificate
self.query = query
self.header = header
self.authorization = authorization
class BackendProperties(Model):
"""Properties specific to the Backend Type.
:param service_fabric_cluster: Backend Service Fabric Cluster Properties
:type service_fabric_cluster:
~azure.mgmt.apimanagement.models.BackendServiceFabricClusterProperties
"""
_attribute_map = {
'service_fabric_cluster': {'key': 'serviceFabricCluster', 'type': 'BackendServiceFabricClusterProperties'},
}
def __init__(self, *, service_fabric_cluster=None, **kwargs) -> None:
super(BackendProperties, self).__init__(**kwargs)
self.service_fabric_cluster = service_fabric_cluster
class BackendProxyContract(Model):
"""Details of the Backend WebProxy Server to use in the Request to Backend.
All required parameters must be populated in order to send to Azure.
:param url: Required. WebProxy Server AbsoluteUri property which includes
the entire URI stored in the Uri instance, including all fragments and
query strings.
:type url: str
:param username: Username to connect to the WebProxy server
:type username: str
:param password: Password to connect to the WebProxy Server
:type password: str
"""
_validation = {
'url': {'required': True, 'max_length': 2000, 'min_length': 1},
}
_attribute_map = {
'url': {'key': 'url', 'type': 'str'},
'username': {'key': 'username', 'type': 'str'},
'password': {'key': 'password', 'type': 'str'},
}
def __init__(self, *, url: str, username: str=None, password: str=None, **kwargs) -> None:
super(BackendProxyContract, self).__init__(**kwargs)
self.url = url
self.username = username
self.password = password
class BackendReconnectContract(Resource):
"""Reconnect request parameters.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param after: Duration in ISO8601 format after which reconnect will be
initiated. Minimum duration of the Reconnect is PT2M.
:type after: timedelta
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'after': {'key': 'properties.after', 'type': 'duration'},
}
def __init__(self, *, after=None, **kwargs) -> None:
super(BackendReconnectContract, self).__init__(**kwargs)
self.after = after
class BackendServiceFabricClusterProperties(Model):
"""Properties of the Service Fabric Type Backend.
All required parameters must be populated in order to send to Azure.
:param client_certificatethumbprint: Required. The client certificate
thumbprint for the management endpoint.
:type client_certificatethumbprint: str
:param max_partition_resolution_retries: Maximum number of retries while
attempting resolve the partition.
:type max_partition_resolution_retries: int
:param management_endpoints: Required. The cluster management endpoint.
:type management_endpoints: list[str]
:param server_certificate_thumbprints: Thumbprints of certificates cluster
management service uses for tls communication
:type server_certificate_thumbprints: list[str]
:param server_x509_names: Server X509 Certificate Names Collection
:type server_x509_names:
list[~azure.mgmt.apimanagement.models.X509CertificateName]
"""
_validation = {
'client_certificatethumbprint': {'required': True},
'management_endpoints': {'required': True},
}
_attribute_map = {
'client_certificatethumbprint': {'key': 'clientCertificatethumbprint', 'type': 'str'},
'max_partition_resolution_retries': {'key': 'maxPartitionResolutionRetries', 'type': 'int'},
'management_endpoints': {'key': 'managementEndpoints', 'type': '[str]'},
'server_certificate_thumbprints': {'key': 'serverCertificateThumbprints', 'type': '[str]'},
'server_x509_names': {'key': 'serverX509Names', 'type': '[X509CertificateName]'},
}
def __init__(self, *, client_certificatethumbprint: str, management_endpoints, max_partition_resolution_retries: int=None, server_certificate_thumbprints=None, server_x509_names=None, **kwargs) -> None:
super(BackendServiceFabricClusterProperties, self).__init__(**kwargs)
self.client_certificatethumbprint = client_certificatethumbprint
self.max_partition_resolution_retries = max_partition_resolution_retries
self.management_endpoints = management_endpoints
self.server_certificate_thumbprints = server_certificate_thumbprints
self.server_x509_names = server_x509_names
class BackendTlsProperties(Model):
"""Properties controlling TLS Certificate Validation.
:param validate_certificate_chain: Flag indicating whether SSL certificate
chain validation should be done when using self-signed certificates for
this backend host. Default value: True .
:type validate_certificate_chain: bool
:param validate_certificate_name: Flag indicating whether SSL certificate
name validation should be done when using self-signed certificates for
this backend host. Default value: True .
:type validate_certificate_name: bool
"""
_attribute_map = {
'validate_certificate_chain': {'key': 'validateCertificateChain', 'type': 'bool'},
'validate_certificate_name': {'key': 'validateCertificateName', 'type': 'bool'},
}
def __init__(self, *, validate_certificate_chain: bool=True, validate_certificate_name: bool=True, **kwargs) -> None:
super(BackendTlsProperties, self).__init__(**kwargs)
self.validate_certificate_chain = validate_certificate_chain
self.validate_certificate_name = validate_certificate_name
class BackendUpdateParameters(Model):
"""Backend update parameters.
:param title: Backend Title.
:type title: str
:param description: Backend Description.
:type description: str
:param resource_id: Management Uri of the Resource in External System.
This url can be the Arm Resource Id of Logic Apps, Function Apps or Api
Apps.
:type resource_id: str
:param properties: Backend Properties contract
:type properties: ~azure.mgmt.apimanagement.models.BackendProperties
:param credentials: Backend Credentials Contract Properties
:type credentials:
~azure.mgmt.apimanagement.models.BackendCredentialsContract
:param proxy: Backend Proxy Contract Properties
:type proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract
:param tls: Backend TLS Properties
:type tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties
:param url: Runtime Url of the Backend.
:type url: str
:param protocol: Backend communication protocol. Possible values include:
'http', 'soap'
:type protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol
"""
_validation = {
'title': {'max_length': 300, 'min_length': 1},
'description': {'max_length': 2000, 'min_length': 1},
'resource_id': {'max_length': 2000, 'min_length': 1},
'url': {'max_length': 2000, 'min_length': 1},
}
_attribute_map = {
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'resource_id': {'key': 'properties.resourceId', 'type': 'str'},
'properties': {'key': 'properties.properties', 'type': 'BackendProperties'},
'credentials': {'key': 'properties.credentials', 'type': 'BackendCredentialsContract'},
'proxy': {'key': 'properties.proxy', 'type': 'BackendProxyContract'},
'tls': {'key': 'properties.tls', 'type': 'BackendTlsProperties'},
'url': {'key': 'properties.url', 'type': 'str'},
'protocol': {'key': 'properties.protocol', 'type': 'str'},
}
def __init__(self, *, title: str=None, description: str=None, resource_id: str=None, properties=None, credentials=None, proxy=None, tls=None, url: str=None, protocol=None, **kwargs) -> None:
super(BackendUpdateParameters, self).__init__(**kwargs)
self.title = title
self.description = description
self.resource_id = resource_id
self.properties = properties
self.credentials = credentials
self.proxy = proxy
self.tls = tls
self.url = url
self.protocol = protocol
class BodyDiagnosticSettings(Model):
"""Body logging settings.
:param bytes: Number of request body bytes to log.
:type bytes: int
"""
_validation = {
'bytes': {'maximum': 8192},
}
_attribute_map = {
'bytes': {'key': 'bytes', 'type': 'int'},
}
def __init__(self, *, bytes: int=None, **kwargs) -> None:
super(BodyDiagnosticSettings, self).__init__(**kwargs)
self.bytes = bytes
class CacheContract(Resource):
"""Cache details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Cache description
:type description: str
:param connection_string: Required. Runtime connection string to cache
:type connection_string: str
:param resource_id: Original uri of entity in external system cache points
to
:type resource_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'max_length': 2000},
'connection_string': {'required': True, 'max_length': 300},
'resource_id': {'max_length': 2000},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'connection_string': {'key': 'properties.connectionString', 'type': 'str'},
'resource_id': {'key': 'properties.resourceId', 'type': 'str'},
}
def __init__(self, *, connection_string: str, description: str=None, resource_id: str=None, **kwargs) -> None:
super(CacheContract, self).__init__(**kwargs)
self.description = description
self.connection_string = connection_string
self.resource_id = resource_id
class CacheUpdateParameters(Model):
"""Cache update details.
:param description: Cache description
:type description: str
:param connection_string: Runtime connection string to cache
:type connection_string: str
:param resource_id: Original uri of entity in external system cache points
to
:type resource_id: str
"""
_validation = {
'description': {'max_length': 2000},
'connection_string': {'max_length': 300},
'resource_id': {'max_length': 2000},
}
_attribute_map = {
'description': {'key': 'properties.description', 'type': 'str'},
'connection_string': {'key': 'properties.connectionString', 'type': 'str'},
'resource_id': {'key': 'properties.resourceId', 'type': 'str'},
}
def __init__(self, *, description: str=None, connection_string: str=None, resource_id: str=None, **kwargs) -> None:
super(CacheUpdateParameters, self).__init__(**kwargs)
self.description = description
self.connection_string = connection_string
self.resource_id = resource_id
class CertificateConfiguration(Model):
"""Certificate configuration which consist of non-trusted intermediates and
root certificates.
All required parameters must be populated in order to send to Azure.
:param encoded_certificate: Base64 Encoded certificate.
:type encoded_certificate: str
:param certificate_password: Certificate Password.
:type certificate_password: str
:param store_name: Required. The
System.Security.Cryptography.x509certificates.StoreName certificate store
location. Only Root and CertificateAuthority are valid locations. Possible
values include: 'CertificateAuthority', 'Root'
:type store_name: str or ~azure.mgmt.apimanagement.models.enum
:param certificate: Certificate information.
:type certificate: ~azure.mgmt.apimanagement.models.CertificateInformation
"""
_validation = {
'store_name': {'required': True},
}
_attribute_map = {
'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'},
'certificate_password': {'key': 'certificatePassword', 'type': 'str'},
'store_name': {'key': 'storeName', 'type': 'str'},
'certificate': {'key': 'certificate', 'type': 'CertificateInformation'},
}
def __init__(self, *, store_name, encoded_certificate: str=None, certificate_password: str=None, certificate=None, **kwargs) -> None:
super(CertificateConfiguration, self).__init__(**kwargs)
self.encoded_certificate = encoded_certificate
self.certificate_password = certificate_password
self.store_name = store_name
self.certificate = certificate
class CertificateContract(Resource):
"""Certificate details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param subject: Required. Subject attribute of the certificate.
:type subject: str
:param thumbprint: Required. Thumbprint of the certificate.
:type thumbprint: str
:param expiration_date: Required. Expiration date of the certificate. The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:type expiration_date: datetime
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'subject': {'required': True},
'thumbprint': {'required': True},
'expiration_date': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'subject': {'key': 'properties.subject', 'type': 'str'},
'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'},
'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'},
}
def __init__(self, *, subject: str, thumbprint: str, expiration_date, **kwargs) -> None:
super(CertificateContract, self).__init__(**kwargs)
self.subject = subject
self.thumbprint = thumbprint
self.expiration_date = expiration_date
class CertificateCreateOrUpdateParameters(Model):
"""Certificate create or update details.
All required parameters must be populated in order to send to Azure.
:param data: Required. Base 64 encoded certificate using the
application/x-pkcs12 representation.
:type data: str
:param password: Required. Password for the Certificate
:type password: str
"""
_validation = {
'data': {'required': True},
'password': {'required': True},
}
_attribute_map = {
'data': {'key': 'properties.data', 'type': 'str'},
'password': {'key': 'properties.password', 'type': 'str'},
}
def __init__(self, *, data: str, password: str, **kwargs) -> None:
super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs)
self.data = data
self.password = password
class CertificateInformation(Model):
"""SSL certificate information.
All required parameters must be populated in order to send to Azure.
:param expiry: Required. Expiration date of the certificate. The date
conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by
the ISO 8601 standard.
:type expiry: datetime
:param thumbprint: Required. Thumbprint of the certificate.
:type thumbprint: str
:param subject: Required. Subject of the certificate.
:type subject: str
"""
_validation = {
'expiry': {'required': True},
'thumbprint': {'required': True},
'subject': {'required': True},
}
_attribute_map = {
'expiry': {'key': 'expiry', 'type': 'iso-8601'},
'thumbprint': {'key': 'thumbprint', 'type': 'str'},
'subject': {'key': 'subject', 'type': 'str'},
}
def __init__(self, *, expiry, thumbprint: str, subject: str, **kwargs) -> None:
super(CertificateInformation, self).__init__(**kwargs)
self.expiry = expiry
self.thumbprint = thumbprint
self.subject = subject
class ClientSecretContract(Model):
"""Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
:param client_secret: Client or app secret used in IdentityProviders, Aad,
OpenID or OAuth.
:type client_secret: str
"""
_attribute_map = {
'client_secret': {'key': 'clientSecret', 'type': 'str'},
}
def __init__(self, *, client_secret: str=None, **kwargs) -> None:
super(ClientSecretContract, self).__init__(**kwargs)
self.client_secret = client_secret
class CloudError(Model):
"""CloudError.
"""
_attribute_map = {
}
class ConnectivityStatusContract(Model):
"""Details about connectivity to a resource.
All required parameters must be populated in order to send to Azure.
:param name: Required. The hostname of the resource which the service
depends on. This can be the database, storage or any other azure resource
on which the service depends upon.
:type name: str
:param status: Required. Resource Connectivity Status Type identifier.
Possible values include: 'initializing', 'success', 'failure'
:type status: str or
~azure.mgmt.apimanagement.models.ConnectivityStatusType
:param error: Error details of the connectivity to the resource.
:type error: str
:param last_updated: Required. The date when the resource connectivity
status was last updated. This status should be updated every 15 minutes.
If this status has not been updated, then it means that the service has
lost network connectivity to the resource, from inside the Virtual
Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ`
as specified by the ISO 8601 standard.
:type last_updated: datetime
:param last_status_change: Required. The date when the resource
connectivity status last Changed from success to failure or vice-versa.
The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as
specified by the ISO 8601 standard.
:type last_status_change: datetime
"""
_validation = {
'name': {'required': True, 'min_length': 1},
'status': {'required': True},
'last_updated': {'required': True},
'last_status_change': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'status': {'key': 'status', 'type': 'str'},
'error': {'key': 'error', 'type': 'str'},
'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'},
'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'},
}
def __init__(self, *, name: str, status, last_updated, last_status_change, error: str=None, **kwargs) -> None:
super(ConnectivityStatusContract, self).__init__(**kwargs)
self.name = name
self.status = status
self.error = error
self.last_updated = last_updated
self.last_status_change = last_status_change
class DeployConfigurationParameters(Model):
"""Deploy Tenant Configuration Contract.
All required parameters must be populated in order to send to Azure.
:param branch: Required. The name of the Git branch from which the
configuration is to be deployed to the configuration database.
:type branch: str
:param force: The value enforcing deleting subscriptions to products that
are deleted in this update.
:type force: bool
"""
_validation = {
'branch': {'required': True},
}
_attribute_map = {
'branch': {'key': 'properties.branch', 'type': 'str'},
'force': {'key': 'properties.force', 'type': 'bool'},
}
def __init__(self, *, branch: str, force: bool=None, **kwargs) -> None:
super(DeployConfigurationParameters, self).__init__(**kwargs)
self.branch = branch
self.force = force
class DiagnosticContract(Resource):
"""Diagnostic details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param always_log: Specifies for what type of messages sampling settings
should not apply. Possible values include: 'allErrors'
:type always_log: str or ~azure.mgmt.apimanagement.models.AlwaysLog
:param logger_id: Required. Resource Id of a target logger.
:type logger_id: str
:param sampling: Sampling settings for Diagnostic.
:type sampling: ~azure.mgmt.apimanagement.models.SamplingSettings
:param frontend: Diagnostic settings for incoming/outgoing HTTP messages
to the Gateway.
:type frontend:
~azure.mgmt.apimanagement.models.PipelineDiagnosticSettings
:param backend: Diagnostic settings for incoming/outgoing HTTP messages to
the Backend
:type backend: ~azure.mgmt.apimanagement.models.PipelineDiagnosticSettings
:param log_client_ip: Log the ClientIP. Default is false.
:type log_client_ip: bool
:param http_correlation_protocol: Sets correlation protocol to use for
Application Insights diagnostics. Possible values include: 'None',
'Legacy', 'W3C'
:type http_correlation_protocol: str or
~azure.mgmt.apimanagement.models.HttpCorrelationProtocol
:param verbosity: The verbosity level applied to traces emitted by trace
policies. Possible values include: 'verbose', 'information', 'error'
:type verbosity: str or ~azure.mgmt.apimanagement.models.Verbosity
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'logger_id': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'always_log': {'key': 'properties.alwaysLog', 'type': 'str'},
'logger_id': {'key': 'properties.loggerId', 'type': 'str'},
'sampling': {'key': 'properties.sampling', 'type': 'SamplingSettings'},
'frontend': {'key': 'properties.frontend', 'type': 'PipelineDiagnosticSettings'},
'backend': {'key': 'properties.backend', 'type': 'PipelineDiagnosticSettings'},
'log_client_ip': {'key': 'properties.logClientIp', 'type': 'bool'},
'http_correlation_protocol': {'key': 'properties.httpCorrelationProtocol', 'type': 'str'},
'verbosity': {'key': 'properties.verbosity', 'type': 'str'},
}
def __init__(self, *, logger_id: str, always_log=None, sampling=None, frontend=None, backend=None, log_client_ip: bool=None, http_correlation_protocol=None, verbosity=None, **kwargs) -> None:
super(DiagnosticContract, self).__init__(**kwargs)
self.always_log = always_log
self.logger_id = logger_id
self.sampling = sampling
self.frontend = frontend
self.backend = backend
self.log_client_ip = log_client_ip
self.http_correlation_protocol = http_correlation_protocol
self.verbosity = verbosity
class EmailTemplateContract(Resource):
"""Email Template details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param subject: Required. Subject of the Template.
:type subject: str
:param body: Required. Email Template Body. This should be a valid
XDocument
:type body: str
:param title: Title of the Template.
:type title: str
:param description: Description of the Email Template.
:type description: str
:ivar is_default: Whether the template is the default template provided by
Api Management or has been edited.
:vartype is_default: bool
:param parameters: Email Template Parameter values.
:type parameters:
list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'subject': {'required': True, 'max_length': 1000, 'min_length': 1},
'body': {'required': True, 'min_length': 1},
'is_default': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'subject': {'key': 'properties.subject', 'type': 'str'},
'body': {'key': 'properties.body', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'is_default': {'key': 'properties.isDefault', 'type': 'bool'},
'parameters': {'key': 'properties.parameters', 'type': '[EmailTemplateParametersContractProperties]'},
}
def __init__(self, *, subject: str, body: str, title: str=None, description: str=None, parameters=None, **kwargs) -> None:
super(EmailTemplateContract, self).__init__(**kwargs)
self.subject = subject
self.body = body
self.title = title
self.description = description
self.is_default = None
self.parameters = parameters
class EmailTemplateParametersContractProperties(Model):
"""Email Template Parameter contract.
:param name: Template parameter name.
:type name: str
:param title: Template parameter title.
:type title: str
:param description: Template parameter description.
:type description: str
"""
_validation = {
'name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'},
'title': {'max_length': 4096, 'min_length': 1},
'description': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'title': {'key': 'title', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self, *, name: str=None, title: str=None, description: str=None, **kwargs) -> None:
super(EmailTemplateParametersContractProperties, self).__init__(**kwargs)
self.name = name
self.title = title
self.description = description
class EmailTemplateUpdateParameters(Model):
"""Email Template update Parameters.
:param subject: Subject of the Template.
:type subject: str
:param title: Title of the Template.
:type title: str
:param description: Description of the Email Template.
:type description: str
:param body: Email Template Body. This should be a valid XDocument
:type body: str
:param parameters: Email Template Parameter values.
:type parameters:
list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties]
"""
_validation = {
'subject': {'max_length': 1000, 'min_length': 1},
'body': {'min_length': 1},
}
_attribute_map = {
'subject': {'key': 'properties.subject', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'body': {'key': 'properties.body', 'type': 'str'},
'parameters': {'key': 'properties.parameters', 'type': '[EmailTemplateParametersContractProperties]'},
}
def __init__(self, *, subject: str=None, title: str=None, description: str=None, body: str=None, parameters=None, **kwargs) -> None:
super(EmailTemplateUpdateParameters, self).__init__(**kwargs)
self.subject = subject
self.title = title
self.description = description
self.body = body
self.parameters = parameters
class ErrorFieldContract(Model):
"""Error Field contract.
:param code: Property level error code.
:type code: str
:param message: Human-readable representation of property-level error.
:type message: str
:param target: Property name.
:type target: str
"""
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
}
def __init__(self, *, code: str=None, message: str=None, target: str=None, **kwargs) -> None:
super(ErrorFieldContract, self).__init__(**kwargs)
self.code = code
self.message = message
self.target = target
class ErrorResponse(Model):
"""Error Response.
:param code: Service-defined error code. This code serves as a sub-status
for the HTTP error code specified in the response.
:type code: str
:param message: Human-readable representation of the error.
:type message: str
:param details: The list of invalid fields send in request, in case of
validation error.
:type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract]
"""
_attribute_map = {
'code': {'key': 'error.code', 'type': 'str'},
'message': {'key': 'error.message', 'type': 'str'},
'details': {'key': 'error.details', 'type': '[ErrorFieldContract]'},
}
def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.code = code
self.message = message
self.details = details
class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""
def __init__(self, deserialize, response, *args):
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
class ErrorResponseBody(Model):
"""Error Body contract.
:param code: Service-defined error code. This code serves as a sub-status
for the HTTP error code specified in the response.
:type code: str
:param message: Human-readable representation of the error.
:type message: str
:param details: The list of invalid fields send in request, in case of
validation error.
:type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract]
"""
_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorFieldContract]'},
}
def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None:
super(ErrorResponseBody, self).__init__(**kwargs)
self.code = code
self.message = message
self.details = details
class GatewayContract(Resource):
"""Gateway details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param location_data: Gateway location.
:type location_data:
~azure.mgmt.apimanagement.models.ResourceLocationDataContract
:param description: Gateway description
:type description: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'max_length': 1000},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location_data': {'key': 'properties.locationData', 'type': 'ResourceLocationDataContract'},
'description': {'key': 'properties.description', 'type': 'str'},
}
def __init__(self, *, location_data=None, description: str=None, **kwargs) -> None:
super(GatewayContract, self).__init__(**kwargs)
self.location_data = location_data
self.description = description
class GatewayHostnameConfigurationContract(Resource):
"""Gateway hostname configuration details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param hostname: Hostname value. Supports valid domain name, partial or
full wildcard
:type hostname: str
:param certificate_id: Identifier of Certificate entity that will be used
for TLS connection establishment
:type certificate_id: str
:param negotiate_client_certificate: Determines whether gateway requests
client certificate
:type negotiate_client_certificate: bool
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'hostname': {'key': 'properties.hostname', 'type': 'str'},
'certificate_id': {'key': 'properties.certificateId', 'type': 'str'},
'negotiate_client_certificate': {'key': 'properties.negotiateClientCertificate', 'type': 'bool'},
}
def __init__(self, *, hostname: str=None, certificate_id: str=None, negotiate_client_certificate: bool=None, **kwargs) -> None:
super(GatewayHostnameConfigurationContract, self).__init__(**kwargs)
self.hostname = hostname
self.certificate_id = certificate_id
self.negotiate_client_certificate = negotiate_client_certificate
class GatewayKeyRegenerationRequestContract(Model):
"""Gateway key regeneration request contract properties.
All required parameters must be populated in order to send to Azure.
:param key_type: Required. The Key being regenerated. Possible values
include: 'primary', 'secondary'
:type key_type: str or ~azure.mgmt.apimanagement.models.KeyType
"""
_validation = {
'key_type': {'required': True},
}
_attribute_map = {
'key_type': {'key': 'keyType', 'type': 'KeyType'},
}
def __init__(self, *, key_type, **kwargs) -> None:
super(GatewayKeyRegenerationRequestContract, self).__init__(**kwargs)
self.key_type = key_type
class GatewayKeysContract(Model):
"""Gateway authentication keys.
:param primary: Primary gateway key.
:type primary: str
:param secondary: Secondary gateway key.
:type secondary: str
"""
_attribute_map = {
'primary': {'key': 'primary', 'type': 'str'},
'secondary': {'key': 'secondary', 'type': 'str'},
}
def __init__(self, *, primary: str=None, secondary: str=None, **kwargs) -> None:
super(GatewayKeysContract, self).__init__(**kwargs)
self.primary = primary
self.secondary = secondary
class GatewayTokenContract(Model):
"""Gateway access token.
:param value: Shared Access Authentication token value for the Gateway.
:type value: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': 'str'},
}
def __init__(self, *, value: str=None, **kwargs) -> None:
super(GatewayTokenContract, self).__init__(**kwargs)
self.value = value
class GatewayTokenRequestContract(Model):
"""Gateway token request contract properties.
All required parameters must be populated in order to send to Azure.
:param key_type: Required. The Key to be used to generate gateway token.
Possible values include: 'primary', 'secondary'. Default value: "primary"
.
:type key_type: str or ~azure.mgmt.apimanagement.models.KeyType
:param expiry: Required. The Expiry time of the Token. Maximum token
expiry time is set to 30 days. The date conforms to the following format:
`yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
:type expiry: datetime
"""
_validation = {
'key_type': {'required': True},
'expiry': {'required': True},
}
_attribute_map = {
'key_type': {'key': 'keyType', 'type': 'KeyType'},
'expiry': {'key': 'expiry', 'type': 'iso-8601'},
}
def __init__(self, *, expiry, key_type="primary", **kwargs) -> None:
super(GatewayTokenRequestContract, self).__init__(**kwargs)
self.key_type = key_type
self.expiry = expiry
class GenerateSsoUrlResult(Model):
"""Generate SSO Url operations response details.
:param value: Redirect Url containing the SSO URL value.
:type value: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': 'str'},
}
def __init__(self, *, value: str=None, **kwargs) -> None:
super(GenerateSsoUrlResult, self).__init__(**kwargs)
self.value = value
class GroupContract(Resource):
"""Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param display_name: Required. Group name.
:type display_name: str
:param description: Group description. Can contain HTML formatting tags.
:type description: str
:ivar built_in: true if the group is one of the three system groups
(Administrators, Developers, or Guests); otherwise false.
:vartype built_in: bool
:param group_contract_type: Group type. Possible values include: 'custom',
'system', 'external'
:type group_contract_type: str or
~azure.mgmt.apimanagement.models.GroupType
:param external_id: For external groups, this property contains the id of
the group from the external identity provider, e.g. for Azure Active
Directory `aad://<tenant>.onmicrosoft.com/groups/<group object id>`;
otherwise the value is null.
:type external_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'display_name': {'required': True, 'max_length': 300, 'min_length': 1},
'description': {'max_length': 1000},
'built_in': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'built_in': {'key': 'properties.builtIn', 'type': 'bool'},
'group_contract_type': {'key': 'properties.type', 'type': 'GroupType'},
'external_id': {'key': 'properties.externalId', 'type': 'str'},
}
def __init__(self, *, display_name: str, description: str=None, group_contract_type=None, external_id: str=None, **kwargs) -> None:
super(GroupContract, self).__init__(**kwargs)
self.display_name = display_name
self.description = description
self.built_in = None
self.group_contract_type = group_contract_type
self.external_id = external_id
class GroupContractProperties(Model):
"""Group contract Properties.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:param display_name: Required. Group name.
:type display_name: str
:param description: Group description. Can contain HTML formatting tags.
:type description: str
:ivar built_in: true if the group is one of the three system groups
(Administrators, Developers, or Guests); otherwise false.
:vartype built_in: bool
:param type: Group type. Possible values include: 'custom', 'system',
'external'
:type type: str or ~azure.mgmt.apimanagement.models.GroupType
:param external_id: For external groups, this property contains the id of
the group from the external identity provider, e.g. for Azure Active
Directory `aad://<tenant>.onmicrosoft.com/groups/<group object id>`;
otherwise the value is null.
:type external_id: str
"""
_validation = {
'display_name': {'required': True, 'max_length': 300, 'min_length': 1},
'description': {'max_length': 1000},
'built_in': {'readonly': True},
}
_attribute_map = {
'display_name': {'key': 'displayName', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'built_in': {'key': 'builtIn', 'type': 'bool'},
'type': {'key': 'type', 'type': 'GroupType'},
'external_id': {'key': 'externalId', 'type': 'str'},
}
def __init__(self, *, display_name: str, description: str=None, type=None, external_id: str=None, **kwargs) -> None:
super(GroupContractProperties, self).__init__(**kwargs)
self.display_name = display_name
self.description = description
self.built_in = None
self.type = type
self.external_id = external_id
class GroupCreateParameters(Model):
"""Parameters supplied to the Create Group operation.
All required parameters must be populated in order to send to Azure.
:param display_name: Required. Group name.
:type display_name: str
:param description: Group description.
:type description: str
:param type: Group type. Possible values include: 'custom', 'system',
'external'
:type type: str or ~azure.mgmt.apimanagement.models.GroupType
:param external_id: Identifier of the external groups, this property
contains the id of the group from the external identity provider, e.g. for
Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group
object id>`; otherwise the value is null.
:type external_id: str
"""
_validation = {
'display_name': {'required': True, 'max_length': 300, 'min_length': 1},
}
_attribute_map = {
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'type': {'key': 'properties.type', 'type': 'GroupType'},
'external_id': {'key': 'properties.externalId', 'type': 'str'},
}
def __init__(self, *, display_name: str, description: str=None, type=None, external_id: str=None, **kwargs) -> None:
super(GroupCreateParameters, self).__init__(**kwargs)
self.display_name = display_name
self.description = description
self.type = type
self.external_id = external_id
class GroupUpdateParameters(Model):
"""Parameters supplied to the Update Group operation.
:param display_name: Group name.
:type display_name: str
:param description: Group description.
:type description: str
:param type: Group type. Possible values include: 'custom', 'system',
'external'
:type type: str or ~azure.mgmt.apimanagement.models.GroupType
:param external_id: Identifier of the external groups, this property
contains the id of the group from the external identity provider, e.g. for
Azure Active Directory `aad://<tenant>.onmicrosoft.com/groups/<group
object id>`; otherwise the value is null.
:type external_id: str
"""
_validation = {
'display_name': {'max_length': 300, 'min_length': 1},
}
_attribute_map = {
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'type': {'key': 'properties.type', 'type': 'GroupType'},
'external_id': {'key': 'properties.externalId', 'type': 'str'},
}
def __init__(self, *, display_name: str=None, description: str=None, type=None, external_id: str=None, **kwargs) -> None:
super(GroupUpdateParameters, self).__init__(**kwargs)
self.display_name = display_name
self.description = description
self.type = type
self.external_id = external_id
class HostnameConfiguration(Model):
"""Custom hostname configuration.
All required parameters must be populated in order to send to Azure.
:param type: Required. Hostname type. Possible values include: 'Proxy',
'Portal', 'Management', 'Scm', 'DeveloperPortal'
:type type: str or ~azure.mgmt.apimanagement.models.HostnameType
:param host_name: Required. Hostname to configure on the Api Management
service.
:type host_name: str
:param key_vault_id: Url to the KeyVault Secret containing the Ssl
Certificate. If absolute Url containing version is provided, auto-update
of ssl certificate will not work. This requires Api Management service to
be configured with MSI. The secret should be of type
*application/x-pkcs12*
:type key_vault_id: str
:param encoded_certificate: Base64 Encoded certificate.
:type encoded_certificate: str
:param certificate_password: Certificate Password.
:type certificate_password: str
:param default_ssl_binding: Specify true to setup the certificate
associated with this Hostname as the Default SSL Certificate. If a client
does not send the SNI header, then this will be the certificate that will
be challenged. The property is useful if a service has multiple custom
hostname enabled and it needs to decide on the default ssl certificate.
The setting only applied to Proxy Hostname Type. Default value: False .
:type default_ssl_binding: bool
:param negotiate_client_certificate: Specify true to always negotiate
client certificate on the hostname. Default Value is false. Default value:
False .
:type negotiate_client_certificate: bool
:param certificate: Certificate information.
:type certificate: ~azure.mgmt.apimanagement.models.CertificateInformation
"""
_validation = {
'type': {'required': True},
'host_name': {'required': True},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'host_name': {'key': 'hostName', 'type': 'str'},
'key_vault_id': {'key': 'keyVaultId', 'type': 'str'},
'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'},
'certificate_password': {'key': 'certificatePassword', 'type': 'str'},
'default_ssl_binding': {'key': 'defaultSslBinding', 'type': 'bool'},
'negotiate_client_certificate': {'key': 'negotiateClientCertificate', 'type': 'bool'},
'certificate': {'key': 'certificate', 'type': 'CertificateInformation'},
}
def __init__(self, *, type, host_name: str, key_vault_id: str=None, encoded_certificate: str=None, certificate_password: str=None, default_ssl_binding: bool=False, negotiate_client_certificate: bool=False, certificate=None, **kwargs) -> None:
super(HostnameConfiguration, self).__init__(**kwargs)
self.type = type
self.host_name = host_name
self.key_vault_id = key_vault_id
self.encoded_certificate = encoded_certificate
self.certificate_password = certificate_password
self.default_ssl_binding = default_ssl_binding
self.negotiate_client_certificate = negotiate_client_certificate
self.certificate = certificate
class HttpMessageDiagnostic(Model):
"""Http message diagnostic settings.
:param headers: Array of HTTP Headers to log.
:type headers: list[str]
:param body: Body logging settings.
:type body: ~azure.mgmt.apimanagement.models.BodyDiagnosticSettings
"""
_attribute_map = {
'headers': {'key': 'headers', 'type': '[str]'},
'body': {'key': 'body', 'type': 'BodyDiagnosticSettings'},
}
def __init__(self, *, headers=None, body=None, **kwargs) -> None:
super(HttpMessageDiagnostic, self).__init__(**kwargs)
self.headers = headers
self.body = body
class IdentityProviderBaseParameters(Model):
"""Identity Provider Base Parameter Properties.
:param type: Identity Provider Type identifier. Possible values include:
'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C'
:type type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType
:param signin_tenant: The TenantId to use instead of Common when logging
into Active Directory
:type signin_tenant: str
:param allowed_tenants: List of Allowed Tenants when configuring Azure
Active Directory login.
:type allowed_tenants: list[str]
:param authority: OpenID Connect discovery endpoint hostname for AAD or
AAD B2C.
:type authority: str
:param signup_policy_name: Signup Policy Name. Only applies to AAD B2C
Identity Provider.
:type signup_policy_name: str
:param signin_policy_name: Signin Policy Name. Only applies to AAD B2C
Identity Provider.
:type signin_policy_name: str
:param profile_editing_policy_name: Profile Editing Policy Name. Only
applies to AAD B2C Identity Provider.
:type profile_editing_policy_name: str
:param password_reset_policy_name: Password Reset Policy Name. Only
applies to AAD B2C Identity Provider.
:type password_reset_policy_name: str
"""
_validation = {
'allowed_tenants': {'max_items': 32},
'signup_policy_name': {'min_length': 1},
'signin_policy_name': {'min_length': 1},
'profile_editing_policy_name': {'min_length': 1},
'password_reset_policy_name': {'min_length': 1},
}
_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'signin_tenant': {'key': 'signinTenant', 'type': 'str'},
'allowed_tenants': {'key': 'allowedTenants', 'type': '[str]'},
'authority': {'key': 'authority', 'type': 'str'},
'signup_policy_name': {'key': 'signupPolicyName', 'type': 'str'},
'signin_policy_name': {'key': 'signinPolicyName', 'type': 'str'},
'profile_editing_policy_name': {'key': 'profileEditingPolicyName', 'type': 'str'},
'password_reset_policy_name': {'key': 'passwordResetPolicyName', 'type': 'str'},
}
def __init__(self, *, type=None, signin_tenant: str=None, allowed_tenants=None, authority: str=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, **kwargs) -> None:
super(IdentityProviderBaseParameters, self).__init__(**kwargs)
self.type = type
self.signin_tenant = signin_tenant
self.allowed_tenants = allowed_tenants
self.authority = authority
self.signup_policy_name = signup_policy_name
self.signin_policy_name = signin_policy_name
self.profile_editing_policy_name = profile_editing_policy_name
self.password_reset_policy_name = password_reset_policy_name
class IdentityProviderContract(Resource):
"""Identity Provider details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param identity_provider_contract_type: Identity Provider Type identifier.
Possible values include: 'facebook', 'google', 'microsoft', 'twitter',
'aad', 'aadB2C'
:type identity_provider_contract_type: str or
~azure.mgmt.apimanagement.models.IdentityProviderType
:param signin_tenant: The TenantId to use instead of Common when logging
into Active Directory
:type signin_tenant: str
:param allowed_tenants: List of Allowed Tenants when configuring Azure
Active Directory login.
:type allowed_tenants: list[str]
:param authority: OpenID Connect discovery endpoint hostname for AAD or
AAD B2C.
:type authority: str
:param signup_policy_name: Signup Policy Name. Only applies to AAD B2C
Identity Provider.
:type signup_policy_name: str
:param signin_policy_name: Signin Policy Name. Only applies to AAD B2C
Identity Provider.
:type signin_policy_name: str
:param profile_editing_policy_name: Profile Editing Policy Name. Only
applies to AAD B2C Identity Provider.
:type profile_editing_policy_name: str
:param password_reset_policy_name: Password Reset Policy Name. Only
applies to AAD B2C Identity Provider.
:type password_reset_policy_name: str
:param client_id: Required. Client Id of the Application in the external
Identity Provider. It is App ID for Facebook login, Client ID for Google
login, App ID for Microsoft.
:type client_id: str
:param client_secret: Client secret of the Application in external
Identity Provider, used to authenticate login request. For example, it is
App Secret for Facebook login, API Key for Google login, Public Key for
Microsoft. This property will not be filled on 'GET' operations! Use
'/listSecrets' POST request to get the value.
:type client_secret: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'allowed_tenants': {'max_items': 32},
'signup_policy_name': {'min_length': 1},
'signin_policy_name': {'min_length': 1},
'profile_editing_policy_name': {'min_length': 1},
'password_reset_policy_name': {'min_length': 1},
'client_id': {'required': True, 'min_length': 1},
'client_secret': {'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'identity_provider_contract_type': {'key': 'properties.type', 'type': 'str'},
'signin_tenant': {'key': 'properties.signinTenant', 'type': 'str'},
'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'},
'authority': {'key': 'properties.authority', 'type': 'str'},
'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'},
'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'},
'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'},
'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, client_id: str, identity_provider_contract_type=None, signin_tenant: str=None, allowed_tenants=None, authority: str=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, client_secret: str=None, **kwargs) -> None:
super(IdentityProviderContract, self).__init__(**kwargs)
self.identity_provider_contract_type = identity_provider_contract_type
self.signin_tenant = signin_tenant
self.allowed_tenants = allowed_tenants
self.authority = authority
self.signup_policy_name = signup_policy_name
self.signin_policy_name = signin_policy_name
self.profile_editing_policy_name = profile_editing_policy_name
self.password_reset_policy_name = password_reset_policy_name
self.client_id = client_id
self.client_secret = client_secret
class IdentityProviderCreateContract(Resource):
"""Identity Provider details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param identity_provider_create_contract_type: Identity Provider Type
identifier. Possible values include: 'facebook', 'google', 'microsoft',
'twitter', 'aad', 'aadB2C'
:type identity_provider_create_contract_type: str or
~azure.mgmt.apimanagement.models.IdentityProviderType
:param signin_tenant: The TenantId to use instead of Common when logging
into Active Directory
:type signin_tenant: str
:param allowed_tenants: List of Allowed Tenants when configuring Azure
Active Directory login.
:type allowed_tenants: list[str]
:param authority: OpenID Connect discovery endpoint hostname for AAD or
AAD B2C.
:type authority: str
:param signup_policy_name: Signup Policy Name. Only applies to AAD B2C
Identity Provider.
:type signup_policy_name: str
:param signin_policy_name: Signin Policy Name. Only applies to AAD B2C
Identity Provider.
:type signin_policy_name: str
:param profile_editing_policy_name: Profile Editing Policy Name. Only
applies to AAD B2C Identity Provider.
:type profile_editing_policy_name: str
:param password_reset_policy_name: Password Reset Policy Name. Only
applies to AAD B2C Identity Provider.
:type password_reset_policy_name: str
:param client_id: Required. Client Id of the Application in the external
Identity Provider. It is App ID for Facebook login, Client ID for Google
login, App ID for Microsoft.
:type client_id: str
:param client_secret: Required. Client secret of the Application in
external Identity Provider, used to authenticate login request. For
example, it is App Secret for Facebook login, API Key for Google login,
Public Key for Microsoft. This property will not be filled on 'GET'
operations! Use '/listSecrets' POST request to get the value.
:type client_secret: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'allowed_tenants': {'max_items': 32},
'signup_policy_name': {'min_length': 1},
'signin_policy_name': {'min_length': 1},
'profile_editing_policy_name': {'min_length': 1},
'password_reset_policy_name': {'min_length': 1},
'client_id': {'required': True, 'min_length': 1},
'client_secret': {'required': True, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'identity_provider_create_contract_type': {'key': 'properties.type', 'type': 'str'},
'signin_tenant': {'key': 'properties.signinTenant', 'type': 'str'},
'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'},
'authority': {'key': 'properties.authority', 'type': 'str'},
'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'},
'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'},
'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'},
'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, client_id: str, client_secret: str, identity_provider_create_contract_type=None, signin_tenant: str=None, allowed_tenants=None, authority: str=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, **kwargs) -> None:
super(IdentityProviderCreateContract, self).__init__(**kwargs)
self.identity_provider_create_contract_type = identity_provider_create_contract_type
self.signin_tenant = signin_tenant
self.allowed_tenants = allowed_tenants
self.authority = authority
self.signup_policy_name = signup_policy_name
self.signin_policy_name = signin_policy_name
self.profile_editing_policy_name = profile_editing_policy_name
self.password_reset_policy_name = password_reset_policy_name
self.client_id = client_id
self.client_secret = client_secret
class IdentityProviderUpdateParameters(Model):
"""Parameters supplied to update Identity Provider.
:param type: Identity Provider Type identifier. Possible values include:
'facebook', 'google', 'microsoft', 'twitter', 'aad', 'aadB2C'
:type type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType
:param signin_tenant: The TenantId to use instead of Common when logging
into Active Directory
:type signin_tenant: str
:param allowed_tenants: List of Allowed Tenants when configuring Azure
Active Directory login.
:type allowed_tenants: list[str]
:param authority: OpenID Connect discovery endpoint hostname for AAD or
AAD B2C.
:type authority: str
:param signup_policy_name: Signup Policy Name. Only applies to AAD B2C
Identity Provider.
:type signup_policy_name: str
:param signin_policy_name: Signin Policy Name. Only applies to AAD B2C
Identity Provider.
:type signin_policy_name: str
:param profile_editing_policy_name: Profile Editing Policy Name. Only
applies to AAD B2C Identity Provider.
:type profile_editing_policy_name: str
:param password_reset_policy_name: Password Reset Policy Name. Only
applies to AAD B2C Identity Provider.
:type password_reset_policy_name: str
:param client_id: Client Id of the Application in the external Identity
Provider. It is App ID for Facebook login, Client ID for Google login, App
ID for Microsoft.
:type client_id: str
:param client_secret: Client secret of the Application in external
Identity Provider, used to authenticate login request. For example, it is
App Secret for Facebook login, API Key for Google login, Public Key for
Microsoft.
:type client_secret: str
"""
_validation = {
'allowed_tenants': {'max_items': 32},
'signup_policy_name': {'min_length': 1},
'signin_policy_name': {'min_length': 1},
'profile_editing_policy_name': {'min_length': 1},
'password_reset_policy_name': {'min_length': 1},
'client_id': {'min_length': 1},
'client_secret': {'min_length': 1},
}
_attribute_map = {
'type': {'key': 'properties.type', 'type': 'str'},
'signin_tenant': {'key': 'properties.signinTenant', 'type': 'str'},
'allowed_tenants': {'key': 'properties.allowedTenants', 'type': '[str]'},
'authority': {'key': 'properties.authority', 'type': 'str'},
'signup_policy_name': {'key': 'properties.signupPolicyName', 'type': 'str'},
'signin_policy_name': {'key': 'properties.signinPolicyName', 'type': 'str'},
'profile_editing_policy_name': {'key': 'properties.profileEditingPolicyName', 'type': 'str'},
'password_reset_policy_name': {'key': 'properties.passwordResetPolicyName', 'type': 'str'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, type=None, signin_tenant: str=None, allowed_tenants=None, authority: str=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, client_id: str=None, client_secret: str=None, **kwargs) -> None:
super(IdentityProviderUpdateParameters, self).__init__(**kwargs)
self.type = type
self.signin_tenant = signin_tenant
self.allowed_tenants = allowed_tenants
self.authority = authority
self.signup_policy_name = signup_policy_name
self.signin_policy_name = signin_policy_name
self.profile_editing_policy_name = profile_editing_policy_name
self.password_reset_policy_name = password_reset_policy_name
self.client_id = client_id
self.client_secret = client_secret
class IssueAttachmentContract(Resource):
"""Issue Attachment Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param title: Required. Filename by which the binary data will be saved.
:type title: str
:param content_format: Required. Either 'link' if content is provided via
an HTTP link or the MIME type of the Base64-encoded binary data provided
in the 'content' property.
:type content_format: str
:param content: Required. An HTTP link or Base64-encoded binary data.
:type content: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'title': {'required': True},
'content_format': {'required': True},
'content': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'content_format': {'key': 'properties.contentFormat', 'type': 'str'},
'content': {'key': 'properties.content', 'type': 'str'},
}
def __init__(self, *, title: str, content_format: str, content: str, **kwargs) -> None:
super(IssueAttachmentContract, self).__init__(**kwargs)
self.title = title
self.content_format = content_format
self.content = content
class IssueCommentContract(Resource):
"""Issue Comment Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param text: Required. Comment text.
:type text: str
:param created_date: Date and time when the comment was created.
:type created_date: datetime
:param user_id: Required. A resource identifier for the user who left the
comment.
:type user_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'text': {'required': True},
'user_id': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'text': {'key': 'properties.text', 'type': 'str'},
'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'},
'user_id': {'key': 'properties.userId', 'type': 'str'},
}
def __init__(self, *, text: str, user_id: str, created_date=None, **kwargs) -> None:
super(IssueCommentContract, self).__init__(**kwargs)
self.text = text
self.created_date = created_date
self.user_id = user_id
class IssueContract(Resource):
"""Issue Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param created_date: Date and time when the issue was created.
:type created_date: datetime
:param state: Status of the issue. Possible values include: 'proposed',
'open', 'removed', 'resolved', 'closed'
:type state: str or ~azure.mgmt.apimanagement.models.State
:param api_id: A resource identifier for the API the issue was created
for.
:type api_id: str
:param title: Required. The issue title.
:type title: str
:param description: Required. Text describing the issue.
:type description: str
:param user_id: Required. A resource identifier for the user created the
issue.
:type user_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'title': {'required': True},
'description': {'required': True},
'user_id': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'},
'state': {'key': 'properties.state', 'type': 'str'},
'api_id': {'key': 'properties.apiId', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'user_id': {'key': 'properties.userId', 'type': 'str'},
}
def __init__(self, *, title: str, description: str, user_id: str, created_date=None, state=None, api_id: str=None, **kwargs) -> None:
super(IssueContract, self).__init__(**kwargs)
self.created_date = created_date
self.state = state
self.api_id = api_id
self.title = title
self.description = description
self.user_id = user_id
class IssueContractBaseProperties(Model):
"""Issue contract Base Properties.
:param created_date: Date and time when the issue was created.
:type created_date: datetime
:param state: Status of the issue. Possible values include: 'proposed',
'open', 'removed', 'resolved', 'closed'
:type state: str or ~azure.mgmt.apimanagement.models.State
:param api_id: A resource identifier for the API the issue was created
for.
:type api_id: str
"""
_attribute_map = {
'created_date': {'key': 'createdDate', 'type': 'iso-8601'},
'state': {'key': 'state', 'type': 'str'},
'api_id': {'key': 'apiId', 'type': 'str'},
}
def __init__(self, *, created_date=None, state=None, api_id: str=None, **kwargs) -> None:
super(IssueContractBaseProperties, self).__init__(**kwargs)
self.created_date = created_date
self.state = state
self.api_id = api_id
class IssueUpdateContract(Model):
"""Issue update Parameters.
:param created_date: Date and time when the issue was created.
:type created_date: datetime
:param state: Status of the issue. Possible values include: 'proposed',
'open', 'removed', 'resolved', 'closed'
:type state: str or ~azure.mgmt.apimanagement.models.State
:param api_id: A resource identifier for the API the issue was created
for.
:type api_id: str
:param title: The issue title.
:type title: str
:param description: Text describing the issue.
:type description: str
:param user_id: A resource identifier for the user created the issue.
:type user_id: str
"""
_attribute_map = {
'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'},
'state': {'key': 'properties.state', 'type': 'str'},
'api_id': {'key': 'properties.apiId', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'user_id': {'key': 'properties.userId', 'type': 'str'},
}
def __init__(self, *, created_date=None, state=None, api_id: str=None, title: str=None, description: str=None, user_id: str=None, **kwargs) -> None:
super(IssueUpdateContract, self).__init__(**kwargs)
self.created_date = created_date
self.state = state
self.api_id = api_id
self.title = title
self.description = description
self.user_id = user_id
class LoggerContract(Resource):
"""Logger details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param logger_type: Required. Logger type. Possible values include:
'azureEventHub', 'applicationInsights'
:type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType
:param description: Logger description.
:type description: str
:param credentials: Required. The name and SendRule connection string of
the event hub for azureEventHub logger.
Instrumentation key for applicationInsights logger.
:type credentials: dict[str, str]
:param is_buffered: Whether records are buffered in the logger before
publishing. Default is assumed to be true.
:type is_buffered: bool
:param resource_id: Azure Resource Id of a log target (either Azure Event
Hub resource or Azure Application Insights resource).
:type resource_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'logger_type': {'required': True},
'description': {'max_length': 256},
'credentials': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'logger_type': {'key': 'properties.loggerType', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'credentials': {'key': 'properties.credentials', 'type': '{str}'},
'is_buffered': {'key': 'properties.isBuffered', 'type': 'bool'},
'resource_id': {'key': 'properties.resourceId', 'type': 'str'},
}
def __init__(self, *, logger_type, credentials, description: str=None, is_buffered: bool=None, resource_id: str=None, **kwargs) -> None:
super(LoggerContract, self).__init__(**kwargs)
self.logger_type = logger_type
self.description = description
self.credentials = credentials
self.is_buffered = is_buffered
self.resource_id = resource_id
class LoggerUpdateContract(Model):
"""Logger update contract.
:param logger_type: Logger type. Possible values include: 'azureEventHub',
'applicationInsights'
:type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType
:param description: Logger description.
:type description: str
:param credentials: Logger credentials.
:type credentials: dict[str, str]
:param is_buffered: Whether records are buffered in the logger before
publishing. Default is assumed to be true.
:type is_buffered: bool
"""
_attribute_map = {
'logger_type': {'key': 'properties.loggerType', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'credentials': {'key': 'properties.credentials', 'type': '{str}'},
'is_buffered': {'key': 'properties.isBuffered', 'type': 'bool'},
}
def __init__(self, *, logger_type=None, description: str=None, credentials=None, is_buffered: bool=None, **kwargs) -> None:
super(LoggerUpdateContract, self).__init__(**kwargs)
self.logger_type = logger_type
self.description = description
self.credentials = credentials
self.is_buffered = is_buffered
class NamedValueContract(Resource):
"""NamedValue details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param tags: Optional tags that when provided can be used to filter the
NamedValue list.
:type tags: list[str]
:param secret: Determines whether the value is a secret and should be
encrypted or not. Default value is false.
:type secret: bool
:param display_name: Required. Unique name of NamedValue. It may contain
only letters, digits, period, dash, and underscore characters.
:type display_name: str
:param value: Value of the NamedValue. Can contain policy expressions. It
may not be empty or consist only of whitespace. This property will not be
filled on 'GET' operations! Use '/listSecrets' POST request to get the
value.
:type value: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'max_items': 32},
'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'},
'value': {'max_length': 4096, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'properties.tags', 'type': '[str]'},
'secret': {'key': 'properties.secret', 'type': 'bool'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
}
def __init__(self, *, display_name: str, tags=None, secret: bool=None, value: str=None, **kwargs) -> None:
super(NamedValueContract, self).__init__(**kwargs)
self.tags = tags
self.secret = secret
self.display_name = display_name
self.value = value
class NamedValueCreateContract(Resource):
"""NamedValue details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param tags: Optional tags that when provided can be used to filter the
NamedValue list.
:type tags: list[str]
:param secret: Determines whether the value is a secret and should be
encrypted or not. Default value is false.
:type secret: bool
:param display_name: Required. Unique name of NamedValue. It may contain
only letters, digits, period, dash, and underscore characters.
:type display_name: str
:param value: Required. Value of the NamedValue. Can contain policy
expressions. It may not be empty or consist only of whitespace. This
property will not be filled on 'GET' operations! Use '/listSecrets' POST
request to get the value.
:type value: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'tags': {'max_items': 32},
'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'},
'value': {'required': True, 'max_length': 4096, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'tags': {'key': 'properties.tags', 'type': '[str]'},
'secret': {'key': 'properties.secret', 'type': 'bool'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
}
def __init__(self, *, display_name: str, value: str, tags=None, secret: bool=None, **kwargs) -> None:
super(NamedValueCreateContract, self).__init__(**kwargs)
self.tags = tags
self.secret = secret
self.display_name = display_name
self.value = value
class NamedValueEntityBaseParameters(Model):
"""NamedValue Entity Base Parameters set.
:param tags: Optional tags that when provided can be used to filter the
NamedValue list.
:type tags: list[str]
:param secret: Determines whether the value is a secret and should be
encrypted or not. Default value is false.
:type secret: bool
"""
_validation = {
'tags': {'max_items': 32},
}
_attribute_map = {
'tags': {'key': 'tags', 'type': '[str]'},
'secret': {'key': 'secret', 'type': 'bool'},
}
def __init__(self, *, tags=None, secret: bool=None, **kwargs) -> None:
super(NamedValueEntityBaseParameters, self).__init__(**kwargs)
self.tags = tags
self.secret = secret
class NamedValueUpdateParameters(Model):
"""NamedValue update Parameters.
:param tags: Optional tags that when provided can be used to filter the
NamedValue list.
:type tags: list[str]
:param secret: Determines whether the value is a secret and should be
encrypted or not. Default value is false.
:type secret: bool
:param display_name: Unique name of NamedValue. It may contain only
letters, digits, period, dash, and underscore characters.
:type display_name: str
:param value: Value of the NamedValue. Can contain policy expressions. It
may not be empty or consist only of whitespace.
:type value: str
"""
_validation = {
'tags': {'max_items': 32},
'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'},
'value': {'max_length': 4096, 'min_length': 1},
}
_attribute_map = {
'tags': {'key': 'properties.tags', 'type': '[str]'},
'secret': {'key': 'properties.secret', 'type': 'bool'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
}
def __init__(self, *, tags=None, secret: bool=None, display_name: str=None, value: str=None, **kwargs) -> None:
super(NamedValueUpdateParameters, self).__init__(**kwargs)
self.tags = tags
self.secret = secret
self.display_name = display_name
self.value = value
class NetworkStatusContract(Model):
"""Network Status details.
All required parameters must be populated in order to send to Azure.
:param dns_servers: Required. Gets the list of DNS servers IPV4 addresses.
:type dns_servers: list[str]
:param connectivity_status: Required. Gets the list of Connectivity Status
to the Resources on which the service depends upon.
:type connectivity_status:
list[~azure.mgmt.apimanagement.models.ConnectivityStatusContract]
"""
_validation = {
'dns_servers': {'required': True},
'connectivity_status': {'required': True},
}
_attribute_map = {
'dns_servers': {'key': 'dnsServers', 'type': '[str]'},
'connectivity_status': {'key': 'connectivityStatus', 'type': '[ConnectivityStatusContract]'},
}
def __init__(self, *, dns_servers, connectivity_status, **kwargs) -> None:
super(NetworkStatusContract, self).__init__(**kwargs)
self.dns_servers = dns_servers
self.connectivity_status = connectivity_status
class NetworkStatusContractByLocation(Model):
"""Network Status in the Location.
:param location: Location of service
:type location: str
:param network_status: Network status in Location
:type network_status:
~azure.mgmt.apimanagement.models.NetworkStatusContract
"""
_validation = {
'location': {'min_length': 1},
}
_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'network_status': {'key': 'networkStatus', 'type': 'NetworkStatusContract'},
}
def __init__(self, *, location: str=None, network_status=None, **kwargs) -> None:
super(NetworkStatusContractByLocation, self).__init__(**kwargs)
self.location = location
self.network_status = network_status
class NotificationContract(Resource):
"""Notification details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param title: Required. Title of the Notification.
:type title: str
:param description: Description of the Notification.
:type description: str
:param recipients: Recipient Parameter values.
:type recipients:
~azure.mgmt.apimanagement.models.RecipientsContractProperties
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'title': {'required': True, 'max_length': 1000, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'title': {'key': 'properties.title', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'recipients': {'key': 'properties.recipients', 'type': 'RecipientsContractProperties'},
}
def __init__(self, *, title: str, description: str=None, recipients=None, **kwargs) -> None:
super(NotificationContract, self).__init__(**kwargs)
self.title = title
self.description = description
self.recipients = recipients
class OAuth2AuthenticationSettingsContract(Model):
"""API OAuth2 Authentication settings details.
:param authorization_server_id: OAuth authorization server identifier.
:type authorization_server_id: str
:param scope: operations scope.
:type scope: str
"""
_attribute_map = {
'authorization_server_id': {'key': 'authorizationServerId', 'type': 'str'},
'scope': {'key': 'scope', 'type': 'str'},
}
def __init__(self, *, authorization_server_id: str=None, scope: str=None, **kwargs) -> None:
super(OAuth2AuthenticationSettingsContract, self).__init__(**kwargs)
self.authorization_server_id = authorization_server_id
self.scope = scope
class OpenIdAuthenticationSettingsContract(Model):
"""API OAuth2 Authentication settings details.
:param openid_provider_id: OAuth authorization server identifier.
:type openid_provider_id: str
:param bearer_token_sending_methods: How to send token to the server.
:type bearer_token_sending_methods: list[str or
~azure.mgmt.apimanagement.models.BearerTokenSendingMethods]
"""
_attribute_map = {
'openid_provider_id': {'key': 'openidProviderId', 'type': 'str'},
'bearer_token_sending_methods': {'key': 'bearerTokenSendingMethods', 'type': '[str]'},
}
def __init__(self, *, openid_provider_id: str=None, bearer_token_sending_methods=None, **kwargs) -> None:
super(OpenIdAuthenticationSettingsContract, self).__init__(**kwargs)
self.openid_provider_id = openid_provider_id
self.bearer_token_sending_methods = bearer_token_sending_methods
class OpenidConnectProviderContract(Resource):
"""OpenId Connect Provider details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param display_name: Required. User-friendly OpenID Connect Provider name.
:type display_name: str
:param description: User-friendly description of OpenID Connect Provider.
:type description: str
:param metadata_endpoint: Required. Metadata endpoint URI.
:type metadata_endpoint: str
:param client_id: Required. Client ID of developer console which is the
client application.
:type client_id: str
:param client_secret: Client Secret of developer console which is the
client application.
:type client_secret: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'display_name': {'required': True, 'max_length': 50},
'metadata_endpoint': {'required': True},
'client_id': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'metadata_endpoint': {'key': 'properties.metadataEndpoint', 'type': 'str'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, display_name: str, metadata_endpoint: str, client_id: str, description: str=None, client_secret: str=None, **kwargs) -> None:
super(OpenidConnectProviderContract, self).__init__(**kwargs)
self.display_name = display_name
self.description = description
self.metadata_endpoint = metadata_endpoint
self.client_id = client_id
self.client_secret = client_secret
class OpenidConnectProviderUpdateContract(Model):
"""Parameters supplied to the Update OpenID Connect Provider operation.
:param display_name: User-friendly OpenID Connect Provider name.
:type display_name: str
:param description: User-friendly description of OpenID Connect Provider.
:type description: str
:param metadata_endpoint: Metadata endpoint URI.
:type metadata_endpoint: str
:param client_id: Client ID of developer console which is the client
application.
:type client_id: str
:param client_secret: Client Secret of developer console which is the
client application.
:type client_secret: str
"""
_validation = {
'display_name': {'max_length': 50},
}
_attribute_map = {
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'metadata_endpoint': {'key': 'properties.metadataEndpoint', 'type': 'str'},
'client_id': {'key': 'properties.clientId', 'type': 'str'},
'client_secret': {'key': 'properties.clientSecret', 'type': 'str'},
}
def __init__(self, *, display_name: str=None, description: str=None, metadata_endpoint: str=None, client_id: str=None, client_secret: str=None, **kwargs) -> None:
super(OpenidConnectProviderUpdateContract, self).__init__(**kwargs)
self.display_name = display_name
self.description = description
self.metadata_endpoint = metadata_endpoint
self.client_id = client_id
self.client_secret = client_secret
class Operation(Model):
"""REST API operation.
:param name: Operation name: {provider}/{resource}/{operation}
:type name: str
:param display: The object that describes the operation.
:type display: ~azure.mgmt.apimanagement.models.OperationDisplay
:param origin: The operation origin.
:type origin: str
:param properties: The operation properties.
:type properties: object
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
'origin': {'key': 'origin', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'object'},
}
def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None:
super(Operation, self).__init__(**kwargs)
self.name = name
self.display = display
self.origin = origin
self.properties = properties
class OperationContract(Resource):
"""Api Operation details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param template_parameters: Collection of URL template parameters.
:type template_parameters:
list[~azure.mgmt.apimanagement.models.ParameterContract]
:param description: Description of the operation. May include HTML
formatting tags.
:type description: str
:param request: An entity containing request details.
:type request: ~azure.mgmt.apimanagement.models.RequestContract
:param responses: Array of Operation responses.
:type responses: list[~azure.mgmt.apimanagement.models.ResponseContract]
:param policies: Operation Policies
:type policies: str
:param display_name: Required. Operation Name.
:type display_name: str
:param method: Required. A Valid HTTP Operation Method. Typical Http
Methods like GET, PUT, POST but not limited by only them.
:type method: str
:param url_template: Required. Relative URL template identifying the
target resource for this operation. May include parameters. Example:
/customers/{cid}/orders/{oid}/?date={date}
:type url_template: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'max_length': 1000},
'display_name': {'required': True, 'max_length': 300, 'min_length': 1},
'method': {'required': True},
'url_template': {'required': True, 'max_length': 1000, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'template_parameters': {'key': 'properties.templateParameters', 'type': '[ParameterContract]'},
'description': {'key': 'properties.description', 'type': 'str'},
'request': {'key': 'properties.request', 'type': 'RequestContract'},
'responses': {'key': 'properties.responses', 'type': '[ResponseContract]'},
'policies': {'key': 'properties.policies', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'method': {'key': 'properties.method', 'type': 'str'},
'url_template': {'key': 'properties.urlTemplate', 'type': 'str'},
}
def __init__(self, *, display_name: str, method: str, url_template: str, template_parameters=None, description: str=None, request=None, responses=None, policies: str=None, **kwargs) -> None:
super(OperationContract, self).__init__(**kwargs)
self.template_parameters = template_parameters
self.description = description
self.request = request
self.responses = responses
self.policies = policies
self.display_name = display_name
self.method = method
self.url_template = url_template
class OperationDisplay(Model):
"""The object that describes the operation.
:param provider: Friendly name of the resource provider
:type provider: str
:param operation: Operation type: read, write, delete, listKeys/action,
etc.
:type operation: str
:param resource: Resource type on which the operation is performed.
:type resource: str
:param description: Friendly name of the operation
:type description: str
"""
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}
def __init__(self, *, provider: str=None, operation: str=None, resource: str=None, description: str=None, **kwargs) -> None:
super(OperationDisplay, self).__init__(**kwargs)
self.provider = provider
self.operation = operation
self.resource = resource
self.description = description
class OperationEntityBaseContract(Model):
"""Api Operation Entity Base Contract details.
:param template_parameters: Collection of URL template parameters.
:type template_parameters:
list[~azure.mgmt.apimanagement.models.ParameterContract]
:param description: Description of the operation. May include HTML
formatting tags.
:type description: str
:param request: An entity containing request details.
:type request: ~azure.mgmt.apimanagement.models.RequestContract
:param responses: Array of Operation responses.
:type responses: list[~azure.mgmt.apimanagement.models.ResponseContract]
:param policies: Operation Policies
:type policies: str
"""
_validation = {
'description': {'max_length': 1000},
}
_attribute_map = {
'template_parameters': {'key': 'templateParameters', 'type': '[ParameterContract]'},
'description': {'key': 'description', 'type': 'str'},
'request': {'key': 'request', 'type': 'RequestContract'},
'responses': {'key': 'responses', 'type': '[ResponseContract]'},
'policies': {'key': 'policies', 'type': 'str'},
}
def __init__(self, *, template_parameters=None, description: str=None, request=None, responses=None, policies: str=None, **kwargs) -> None:
super(OperationEntityBaseContract, self).__init__(**kwargs)
self.template_parameters = template_parameters
self.description = description
self.request = request
self.responses = responses
self.policies = policies
class OperationResultContract(Model):
"""Operation Result.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Operation result identifier.
:type id: str
:param status: Status of an async operation. Possible values include:
'Started', 'InProgress', 'Succeeded', 'Failed'
:type status: str or ~azure.mgmt.apimanagement.models.AsyncOperationStatus
:param started: Start time of an async operation. The date conforms to the
following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
standard.
:type started: datetime
:param updated: Last update time of an async operation. The date conforms
to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO
8601 standard.
:type updated: datetime
:param result_info: Optional result info.
:type result_info: str
:param error: Error Body Contract
:type error: ~azure.mgmt.apimanagement.models.ErrorResponseBody
:ivar action_log: This property if only provided as part of the
TenantConfiguration_Validate operation. It contains the log the entities
which will be updated/created/deleted as part of the
TenantConfiguration_Deploy operation.
:vartype action_log:
list[~azure.mgmt.apimanagement.models.OperationResultLogItemContract]
"""
_validation = {
'action_log': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'status': {'key': 'status', 'type': 'AsyncOperationStatus'},
'started': {'key': 'started', 'type': 'iso-8601'},
'updated': {'key': 'updated', 'type': 'iso-8601'},
'result_info': {'key': 'resultInfo', 'type': 'str'},
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
'action_log': {'key': 'actionLog', 'type': '[OperationResultLogItemContract]'},
}
def __init__(self, *, id: str=None, status=None, started=None, updated=None, result_info: str=None, error=None, **kwargs) -> None:
super(OperationResultContract, self).__init__(**kwargs)
self.id = id
self.status = status
self.started = started
self.updated = updated
self.result_info = result_info
self.error = error
self.action_log = None
class OperationResultLogItemContract(Model):
"""Log of the entity being created, updated or deleted.
:param object_type: The type of entity contract.
:type object_type: str
:param action: Action like create/update/delete.
:type action: str
:param object_key: Identifier of the entity being created/updated/deleted.
:type object_key: str
"""
_attribute_map = {
'object_type': {'key': 'objectType', 'type': 'str'},
'action': {'key': 'action', 'type': 'str'},
'object_key': {'key': 'objectKey', 'type': 'str'},
}
def __init__(self, *, object_type: str=None, action: str=None, object_key: str=None, **kwargs) -> None:
super(OperationResultLogItemContract, self).__init__(**kwargs)
self.object_type = object_type
self.action = action
self.object_key = object_key
class OperationTagResourceContractProperties(Model):
"""Operation Entity contract Properties.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Identifier of the operation in form /operations/{operationId}.
:type id: str
:ivar name: Operation name.
:vartype name: str
:ivar api_name: Api Name.
:vartype api_name: str
:ivar api_revision: Api Revision.
:vartype api_revision: str
:ivar api_version: Api Version.
:vartype api_version: str
:ivar description: Operation Description.
:vartype description: str
:ivar method: A Valid HTTP Operation Method. Typical Http Methods like
GET, PUT, POST but not limited by only them.
:vartype method: str
:ivar url_template: Relative URL template identifying the target resource
for this operation. May include parameters. Example:
/customers/{cid}/orders/{oid}/?date={date}
:vartype url_template: str
"""
_validation = {
'name': {'readonly': True},
'api_name': {'readonly': True},
'api_revision': {'readonly': True},
'api_version': {'readonly': True},
'description': {'readonly': True},
'method': {'readonly': True},
'url_template': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'api_name': {'key': 'apiName', 'type': 'str'},
'api_revision': {'key': 'apiRevision', 'type': 'str'},
'api_version': {'key': 'apiVersion', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'method': {'key': 'method', 'type': 'str'},
'url_template': {'key': 'urlTemplate', 'type': 'str'},
}
def __init__(self, *, id: str=None, **kwargs) -> None:
super(OperationTagResourceContractProperties, self).__init__(**kwargs)
self.id = id
self.name = None
self.api_name = None
self.api_revision = None
self.api_version = None
self.description = None
self.method = None
self.url_template = None
class OperationUpdateContract(Model):
"""Api Operation Update Contract details.
:param template_parameters: Collection of URL template parameters.
:type template_parameters:
list[~azure.mgmt.apimanagement.models.ParameterContract]
:param description: Description of the operation. May include HTML
formatting tags.
:type description: str
:param request: An entity containing request details.
:type request: ~azure.mgmt.apimanagement.models.RequestContract
:param responses: Array of Operation responses.
:type responses: list[~azure.mgmt.apimanagement.models.ResponseContract]
:param policies: Operation Policies
:type policies: str
:param display_name: Operation Name.
:type display_name: str
:param method: A Valid HTTP Operation Method. Typical Http Methods like
GET, PUT, POST but not limited by only them.
:type method: str
:param url_template: Relative URL template identifying the target resource
for this operation. May include parameters. Example:
/customers/{cid}/orders/{oid}/?date={date}
:type url_template: str
"""
_validation = {
'description': {'max_length': 1000},
'display_name': {'max_length': 300, 'min_length': 1},
'url_template': {'max_length': 1000, 'min_length': 1},
}
_attribute_map = {
'template_parameters': {'key': 'properties.templateParameters', 'type': '[ParameterContract]'},
'description': {'key': 'properties.description', 'type': 'str'},
'request': {'key': 'properties.request', 'type': 'RequestContract'},
'responses': {'key': 'properties.responses', 'type': '[ResponseContract]'},
'policies': {'key': 'properties.policies', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'method': {'key': 'properties.method', 'type': 'str'},
'url_template': {'key': 'properties.urlTemplate', 'type': 'str'},
}
def __init__(self, *, template_parameters=None, description: str=None, request=None, responses=None, policies: str=None, display_name: str=None, method: str=None, url_template: str=None, **kwargs) -> None:
super(OperationUpdateContract, self).__init__(**kwargs)
self.template_parameters = template_parameters
self.description = description
self.request = request
self.responses = responses
self.policies = policies
self.display_name = display_name
self.method = method
self.url_template = url_template
class ParameterContract(Model):
"""Operation parameters details.
All required parameters must be populated in order to send to Azure.
:param name: Required. Parameter name.
:type name: str
:param description: Parameter description.
:type description: str
:param type: Required. Parameter type.
:type type: str
:param default_value: Default parameter value.
:type default_value: str
:param required: Specifies whether parameter is required or not.
:type required: bool
:param values: Parameter values.
:type values: list[str]
"""
_validation = {
'name': {'required': True},
'type': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'default_value': {'key': 'defaultValue', 'type': 'str'},
'required': {'key': 'required', 'type': 'bool'},
'values': {'key': 'values', 'type': '[str]'},
}
def __init__(self, *, name: str, type: str, description: str=None, default_value: str=None, required: bool=None, values=None, **kwargs) -> None:
super(ParameterContract, self).__init__(**kwargs)
self.name = name
self.description = description
self.type = type
self.default_value = default_value
self.required = required
self.values = values
class PipelineDiagnosticSettings(Model):
"""Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
:param request: Diagnostic settings for request.
:type request: ~azure.mgmt.apimanagement.models.HttpMessageDiagnostic
:param response: Diagnostic settings for response.
:type response: ~azure.mgmt.apimanagement.models.HttpMessageDiagnostic
"""
_attribute_map = {
'request': {'key': 'request', 'type': 'HttpMessageDiagnostic'},
'response': {'key': 'response', 'type': 'HttpMessageDiagnostic'},
}
def __init__(self, *, request=None, response=None, **kwargs) -> None:
super(PipelineDiagnosticSettings, self).__init__(**kwargs)
self.request = request
self.response = response
class PolicyCollection(Model):
"""The response of the list policy operation.
:param value: Policy Contract value.
:type value: list[~azure.mgmt.apimanagement.models.PolicyContract]
:param next_link: Next page link if any.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[PolicyContract]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None:
super(PolicyCollection, self).__init__(**kwargs)
self.value = value
self.next_link = next_link
class PolicyContract(Resource):
"""Policy Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param value: Required. Contents of the Policy as defined by the format.
:type value: str
:param format: Format of the policyContent. Possible values include:
'xml', 'xml-link', 'rawxml', 'rawxml-link'. Default value: "xml" .
:type format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'value': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'value': {'key': 'properties.value', 'type': 'str'},
'format': {'key': 'properties.format', 'type': 'str'},
}
def __init__(self, *, value: str, format="xml", **kwargs) -> None:
super(PolicyContract, self).__init__(**kwargs)
self.value = value
self.format = format
class PolicyDescriptionCollection(Model):
"""Descriptions of APIM policies.
:param value: Descriptions of APIM policies.
:type value:
list[~azure.mgmt.apimanagement.models.PolicyDescriptionContract]
:param count: Total record count number.
:type count: long
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[PolicyDescriptionContract]'},
'count': {'key': 'count', 'type': 'long'},
}
def __init__(self, *, value=None, count: int=None, **kwargs) -> None:
super(PolicyDescriptionCollection, self).__init__(**kwargs)
self.value = value
self.count = count
class PolicyDescriptionContract(Resource):
"""Policy description details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:ivar description: Policy description.
:vartype description: str
:ivar scope: Binary OR value of the Snippet scope.
:vartype scope: int
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'readonly': True},
'scope': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'scope': {'key': 'properties.scope', 'type': 'int'},
}
def __init__(self, **kwargs) -> None:
super(PolicyDescriptionContract, self).__init__(**kwargs)
self.description = None
self.scope = None
class PortalDelegationSettings(Resource):
"""Delegation settings for a developer portal.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param url: A delegation Url.
:type url: str
:param validation_key: A base64-encoded validation key to validate, that a
request is coming from Azure API Management.
:type validation_key: str
:param subscriptions: Subscriptions delegation settings.
:type subscriptions:
~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties
:param user_registration: User registration delegation settings.
:type user_registration:
~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'url': {'key': 'properties.url', 'type': 'str'},
'validation_key': {'key': 'properties.validationKey', 'type': 'str'},
'subscriptions': {'key': 'properties.subscriptions', 'type': 'SubscriptionsDelegationSettingsProperties'},
'user_registration': {'key': 'properties.userRegistration', 'type': 'RegistrationDelegationSettingsProperties'},
}
def __init__(self, *, url: str=None, validation_key: str=None, subscriptions=None, user_registration=None, **kwargs) -> None:
super(PortalDelegationSettings, self).__init__(**kwargs)
self.url = url
self.validation_key = validation_key
self.subscriptions = subscriptions
self.user_registration = user_registration
class PortalSettingValidationKeyContract(Model):
"""Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
:param validation_key: This is secret value of the validation key in
portal settings.
:type validation_key: str
"""
_attribute_map = {
'validation_key': {'key': 'validationKey', 'type': 'str'},
}
def __init__(self, *, validation_key: str=None, **kwargs) -> None:
super(PortalSettingValidationKeyContract, self).__init__(**kwargs)
self.validation_key = validation_key
class PortalSigninSettings(Resource):
"""Sign-In settings for the Developer Portal.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param enabled: Redirect Anonymous users to the Sign-In page.
:type enabled: bool
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'enabled': {'key': 'properties.enabled', 'type': 'bool'},
}
def __init__(self, *, enabled: bool=None, **kwargs) -> None:
super(PortalSigninSettings, self).__init__(**kwargs)
self.enabled = enabled
class PortalSignupSettings(Resource):
"""Sign-Up settings for a developer portal.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param enabled: Allow users to sign up on a developer portal.
:type enabled: bool
:param terms_of_service: Terms of service contract properties.
:type terms_of_service:
~azure.mgmt.apimanagement.models.TermsOfServiceProperties
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'enabled': {'key': 'properties.enabled', 'type': 'bool'},
'terms_of_service': {'key': 'properties.termsOfService', 'type': 'TermsOfServiceProperties'},
}
def __init__(self, *, enabled: bool=None, terms_of_service=None, **kwargs) -> None:
super(PortalSignupSettings, self).__init__(**kwargs)
self.enabled = enabled
self.terms_of_service = terms_of_service
class ProductContract(Resource):
"""Product details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Product description. May include HTML formatting tags.
:type description: str
:param terms: Product terms of use. Developers trying to subscribe to the
product will be presented and required to accept these terms before they
can complete the subscription process.
:type terms: str
:param subscription_required: Whether a product subscription is required
for accessing APIs included in this product. If true, the product is
referred to as "protected" and a valid subscription key is required for a
request to an API included in the product to succeed. If false, the
product is referred to as "open" and requests to an API included in the
product can be made without a subscription key. If property is omitted
when creating a new product it's value is assumed to be true.
:type subscription_required: bool
:param approval_required: whether subscription approval is required. If
false, new subscriptions will be approved automatically enabling
developers to call the product’s APIs immediately after subscribing. If
true, administrators must manually approve the subscription before the
developer can any of the product’s APIs. Can be present only if
subscriptionRequired property is present and has a value of false.
:type approval_required: bool
:param subscriptions_limit: Whether the number of subscriptions a user can
have to this product at the same time. Set to null or omit to allow
unlimited per user subscriptions. Can be present only if
subscriptionRequired property is present and has a value of false.
:type subscriptions_limit: int
:param state: whether product is published or not. Published products are
discoverable by users of developer portal. Non published products are
visible only to administrators. Default state of Product is notPublished.
Possible values include: 'notPublished', 'published'
:type state: str or ~azure.mgmt.apimanagement.models.ProductState
:param display_name: Required. Product name.
:type display_name: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'description': {'max_length': 1000, 'min_length': 1},
'display_name': {'required': True, 'max_length': 300, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'terms': {'key': 'properties.terms', 'type': 'str'},
'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'},
'approval_required': {'key': 'properties.approvalRequired', 'type': 'bool'},
'subscriptions_limit': {'key': 'properties.subscriptionsLimit', 'type': 'int'},
'state': {'key': 'properties.state', 'type': 'ProductState'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
}
def __init__(self, *, display_name: str, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, **kwargs) -> None:
super(ProductContract, self).__init__(**kwargs)
self.description = description
self.terms = terms
self.subscription_required = subscription_required
self.approval_required = approval_required
self.subscriptions_limit = subscriptions_limit
self.state = state
self.display_name = display_name
class ProductEntityBaseParameters(Model):
"""Product Entity Base Parameters.
:param description: Product description. May include HTML formatting tags.
:type description: str
:param terms: Product terms of use. Developers trying to subscribe to the
product will be presented and required to accept these terms before they
can complete the subscription process.
:type terms: str
:param subscription_required: Whether a product subscription is required
for accessing APIs included in this product. If true, the product is
referred to as "protected" and a valid subscription key is required for a
request to an API included in the product to succeed. If false, the
product is referred to as "open" and requests to an API included in the
product can be made without a subscription key. If property is omitted
when creating a new product it's value is assumed to be true.
:type subscription_required: bool
:param approval_required: whether subscription approval is required. If
false, new subscriptions will be approved automatically enabling
developers to call the product’s APIs immediately after subscribing. If
true, administrators must manually approve the subscription before the
developer can any of the product’s APIs. Can be present only if
subscriptionRequired property is present and has a value of false.
:type approval_required: bool
:param subscriptions_limit: Whether the number of subscriptions a user can
have to this product at the same time. Set to null or omit to allow
unlimited per user subscriptions. Can be present only if
subscriptionRequired property is present and has a value of false.
:type subscriptions_limit: int
:param state: whether product is published or not. Published products are
discoverable by users of developer portal. Non published products are
visible only to administrators. Default state of Product is notPublished.
Possible values include: 'notPublished', 'published'
:type state: str or ~azure.mgmt.apimanagement.models.ProductState
"""
_validation = {
'description': {'max_length': 1000, 'min_length': 1},
}
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'terms': {'key': 'terms', 'type': 'str'},
'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'},
'approval_required': {'key': 'approvalRequired', 'type': 'bool'},
'subscriptions_limit': {'key': 'subscriptionsLimit', 'type': 'int'},
'state': {'key': 'state', 'type': 'ProductState'},
}
def __init__(self, *, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, **kwargs) -> None:
super(ProductEntityBaseParameters, self).__init__(**kwargs)
self.description = description
self.terms = terms
self.subscription_required = subscription_required
self.approval_required = approval_required
self.subscriptions_limit = subscriptions_limit
self.state = state
class ProductTagResourceContractProperties(ProductEntityBaseParameters):
"""Product profile.
All required parameters must be populated in order to send to Azure.
:param description: Product description. May include HTML formatting tags.
:type description: str
:param terms: Product terms of use. Developers trying to subscribe to the
product will be presented and required to accept these terms before they
can complete the subscription process.
:type terms: str
:param subscription_required: Whether a product subscription is required
for accessing APIs included in this product. If true, the product is
referred to as "protected" and a valid subscription key is required for a
request to an API included in the product to succeed. If false, the
product is referred to as "open" and requests to an API included in the
product can be made without a subscription key. If property is omitted
when creating a new product it's value is assumed to be true.
:type subscription_required: bool
:param approval_required: whether subscription approval is required. If
false, new subscriptions will be approved automatically enabling
developers to call the product’s APIs immediately after subscribing. If
true, administrators must manually approve the subscription before the
developer can any of the product’s APIs. Can be present only if
subscriptionRequired property is present and has a value of false.
:type approval_required: bool
:param subscriptions_limit: Whether the number of subscriptions a user can
have to this product at the same time. Set to null or omit to allow
unlimited per user subscriptions. Can be present only if
subscriptionRequired property is present and has a value of false.
:type subscriptions_limit: int
:param state: whether product is published or not. Published products are
discoverable by users of developer portal. Non published products are
visible only to administrators. Default state of Product is notPublished.
Possible values include: 'notPublished', 'published'
:type state: str or ~azure.mgmt.apimanagement.models.ProductState
:param id: Identifier of the product in the form of /products/{productId}
:type id: str
:param name: Required. Product name.
:type name: str
"""
_validation = {
'description': {'max_length': 1000, 'min_length': 1},
'name': {'required': True, 'max_length': 300, 'min_length': 1},
}
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'terms': {'key': 'terms', 'type': 'str'},
'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'},
'approval_required': {'key': 'approvalRequired', 'type': 'bool'},
'subscriptions_limit': {'key': 'subscriptionsLimit', 'type': 'int'},
'state': {'key': 'state', 'type': 'ProductState'},
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, *, name: str, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, id: str=None, **kwargs) -> None:
super(ProductTagResourceContractProperties, self).__init__(description=description, terms=terms, subscription_required=subscription_required, approval_required=approval_required, subscriptions_limit=subscriptions_limit, state=state, **kwargs)
self.id = id
self.name = name
class ProductUpdateParameters(Model):
"""Product Update parameters.
:param description: Product description. May include HTML formatting tags.
:type description: str
:param terms: Product terms of use. Developers trying to subscribe to the
product will be presented and required to accept these terms before they
can complete the subscription process.
:type terms: str
:param subscription_required: Whether a product subscription is required
for accessing APIs included in this product. If true, the product is
referred to as "protected" and a valid subscription key is required for a
request to an API included in the product to succeed. If false, the
product is referred to as "open" and requests to an API included in the
product can be made without a subscription key. If property is omitted
when creating a new product it's value is assumed to be true.
:type subscription_required: bool
:param approval_required: whether subscription approval is required. If
false, new subscriptions will be approved automatically enabling
developers to call the product’s APIs immediately after subscribing. If
true, administrators must manually approve the subscription before the
developer can any of the product’s APIs. Can be present only if
subscriptionRequired property is present and has a value of false.
:type approval_required: bool
:param subscriptions_limit: Whether the number of subscriptions a user can
have to this product at the same time. Set to null or omit to allow
unlimited per user subscriptions. Can be present only if
subscriptionRequired property is present and has a value of false.
:type subscriptions_limit: int
:param state: whether product is published or not. Published products are
discoverable by users of developer portal. Non published products are
visible only to administrators. Default state of Product is notPublished.
Possible values include: 'notPublished', 'published'
:type state: str or ~azure.mgmt.apimanagement.models.ProductState
:param display_name: Product name.
:type display_name: str
"""
_validation = {
'description': {'max_length': 1000, 'min_length': 1},
'display_name': {'max_length': 300, 'min_length': 1},
}
_attribute_map = {
'description': {'key': 'properties.description', 'type': 'str'},
'terms': {'key': 'properties.terms', 'type': 'str'},
'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'},
'approval_required': {'key': 'properties.approvalRequired', 'type': 'bool'},
'subscriptions_limit': {'key': 'properties.subscriptionsLimit', 'type': 'int'},
'state': {'key': 'properties.state', 'type': 'ProductState'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
}
def __init__(self, *, description: str=None, terms: str=None, subscription_required: bool=None, approval_required: bool=None, subscriptions_limit: int=None, state=None, display_name: str=None, **kwargs) -> None:
super(ProductUpdateParameters, self).__init__(**kwargs)
self.description = description
self.terms = terms
self.subscription_required = subscription_required
self.approval_required = approval_required
self.subscriptions_limit = subscriptions_limit
self.state = state
self.display_name = display_name
class PropertyValueContract(Model):
"""Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
:param value: This is secret value of the NamedValue entity.
:type value: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': 'str'},
}
def __init__(self, *, value: str=None, **kwargs) -> None:
super(PropertyValueContract, self).__init__(**kwargs)
self.value = value
class QuotaCounterCollection(Model):
"""Paged Quota Counter list representation.
:param value: Quota counter values.
:type value: list[~azure.mgmt.apimanagement.models.QuotaCounterContract]
:param count: Total record count number across all pages.
:type count: long
:param next_link: Next page link if any.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[QuotaCounterContract]'},
'count': {'key': 'count', 'type': 'long'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(self, *, value=None, count: int=None, next_link: str=None, **kwargs) -> None:
super(QuotaCounterCollection, self).__init__(**kwargs)
self.value = value
self.count = count
self.next_link = next_link
class QuotaCounterContract(Model):
"""Quota counter details.
All required parameters must be populated in order to send to Azure.
:param counter_key: Required. The Key value of the Counter. Must not be
empty.
:type counter_key: str
:param period_key: Required. Identifier of the Period for which the
counter was collected. Must not be empty.
:type period_key: str
:param period_start_time: Required. The date of the start of Counter
Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ`
as specified by the ISO 8601 standard.
:type period_start_time: datetime
:param period_end_time: Required. The date of the end of Counter Period.
The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as
specified by the ISO 8601 standard.
:type period_end_time: datetime
:param value: Quota Value Properties
:type value:
~azure.mgmt.apimanagement.models.QuotaCounterValueContractProperties
"""
_validation = {
'counter_key': {'required': True, 'min_length': 1},
'period_key': {'required': True, 'min_length': 1},
'period_start_time': {'required': True},
'period_end_time': {'required': True},
}
_attribute_map = {
'counter_key': {'key': 'counterKey', 'type': 'str'},
'period_key': {'key': 'periodKey', 'type': 'str'},
'period_start_time': {'key': 'periodStartTime', 'type': 'iso-8601'},
'period_end_time': {'key': 'periodEndTime', 'type': 'iso-8601'},
'value': {'key': 'value', 'type': 'QuotaCounterValueContractProperties'},
}
def __init__(self, *, counter_key: str, period_key: str, period_start_time, period_end_time, value=None, **kwargs) -> None:
super(QuotaCounterContract, self).__init__(**kwargs)
self.counter_key = counter_key
self.period_key = period_key
self.period_start_time = period_start_time
self.period_end_time = period_end_time
self.value = value
class QuotaCounterValueContract(Model):
"""Quota counter value details.
:param calls_count: Number of times Counter was called.
:type calls_count: int
:param kb_transferred: Data Transferred in KiloBytes.
:type kb_transferred: float
"""
_attribute_map = {
'calls_count': {'key': 'value.callsCount', 'type': 'int'},
'kb_transferred': {'key': 'value.kbTransferred', 'type': 'float'},
}
def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None:
super(QuotaCounterValueContract, self).__init__(**kwargs)
self.calls_count = calls_count
self.kb_transferred = kb_transferred
class QuotaCounterValueContractProperties(Model):
"""Quota counter value details.
:param calls_count: Number of times Counter was called.
:type calls_count: int
:param kb_transferred: Data Transferred in KiloBytes.
:type kb_transferred: float
"""
_attribute_map = {
'calls_count': {'key': 'callsCount', 'type': 'int'},
'kb_transferred': {'key': 'kbTransferred', 'type': 'float'},
}
def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None:
super(QuotaCounterValueContractProperties, self).__init__(**kwargs)
self.calls_count = calls_count
self.kb_transferred = kb_transferred
class RecipientEmailCollection(Model):
"""Paged Recipient User list representation.
:param value: Page values.
:type value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract]
:param next_link: Next page link if any.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[RecipientEmailContract]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None:
super(RecipientEmailCollection, self).__init__(**kwargs)
self.value = value
self.next_link = next_link
class RecipientEmailContract(Resource):
"""Recipient Email details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param email: User Email subscribed to notification.
:type email: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'email': {'key': 'properties.email', 'type': 'str'},
}
def __init__(self, *, email: str=None, **kwargs) -> None:
super(RecipientEmailContract, self).__init__(**kwargs)
self.email = email
class RecipientsContractProperties(Model):
"""Notification Parameter contract.
:param emails: List of Emails subscribed for the notification.
:type emails: list[str]
:param users: List of Users subscribed for the notification.
:type users: list[str]
"""
_attribute_map = {
'emails': {'key': 'emails', 'type': '[str]'},
'users': {'key': 'users', 'type': '[str]'},
}
def __init__(self, *, emails=None, users=None, **kwargs) -> None:
super(RecipientsContractProperties, self).__init__(**kwargs)
self.emails = emails
self.users = users
class RecipientUserCollection(Model):
"""Paged Recipient User list representation.
:param value: Page values.
:type value: list[~azure.mgmt.apimanagement.models.RecipientUserContract]
:param next_link: Next page link if any.
:type next_link: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[RecipientUserContract]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}
def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None:
super(RecipientUserCollection, self).__init__(**kwargs)
self.value = value
self.next_link = next_link
class RecipientUserContract(Resource):
"""Recipient User details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param user_id: API Management UserId subscribed to notification.
:type user_id: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'user_id': {'key': 'properties.userId', 'type': 'str'},
}
def __init__(self, *, user_id: str=None, **kwargs) -> None:
super(RecipientUserContract, self).__init__(**kwargs)
self.user_id = user_id
class RegionContract(Model):
"""Region profile.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: Region name.
:vartype name: str
:param is_master_region: whether Region is the master region.
:type is_master_region: bool
:param is_deleted: whether Region is deleted.
:type is_deleted: bool
"""
_validation = {
'name': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'is_master_region': {'key': 'isMasterRegion', 'type': 'bool'},
'is_deleted': {'key': 'isDeleted', 'type': 'bool'},
}
def __init__(self, *, is_master_region: bool=None, is_deleted: bool=None, **kwargs) -> None:
super(RegionContract, self).__init__(**kwargs)
self.name = None
self.is_master_region = is_master_region
self.is_deleted = is_deleted
class RegistrationDelegationSettingsProperties(Model):
"""User registration delegation settings properties.
:param enabled: Enable or disable delegation for user registration.
:type enabled: bool
"""
_attribute_map = {
'enabled': {'key': 'enabled', 'type': 'bool'},
}
def __init__(self, *, enabled: bool=None, **kwargs) -> None:
super(RegistrationDelegationSettingsProperties, self).__init__(**kwargs)
self.enabled = enabled
class ReportRecordContract(Model):
"""Report data.
Variables are only populated by the server, and will be ignored when
sending a request.
:param name: Name depending on report endpoint specifies product, API,
operation or developer name.
:type name: str
:param timestamp: Start of aggregation period. The date conforms to the
following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
standard.
:type timestamp: datetime
:param interval: Length of aggregation period. Interval must be multiple
of 15 minutes and may not be zero. The value should be in ISO 8601 format
(http://en.wikipedia.org/wiki/ISO_8601#Durations).
:type interval: str
:param country: Country to which this record data is related.
:type country: str
:param region: Country region to which this record data is related.
:type region: str
:param zip: Zip code to which this record data is related.
:type zip: str
:ivar user_id: User identifier path. /users/{userId}
:vartype user_id: str
:ivar product_id: Product identifier path. /products/{productId}
:vartype product_id: str
:param api_id: API identifier path. /apis/{apiId}
:type api_id: str
:param operation_id: Operation identifier path.
/apis/{apiId}/operations/{operationId}
:type operation_id: str
:param api_region: API region identifier.
:type api_region: str
:param subscription_id: Subscription identifier path.
/subscriptions/{subscriptionId}
:type subscription_id: str
:param call_count_success: Number of successful calls. This includes calls
returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and
HttpStatusCode.TemporaryRedirect
:type call_count_success: int
:param call_count_blocked: Number of calls blocked due to invalid
credentials. This includes calls returning HttpStatusCode.Unauthorized and
HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests
:type call_count_blocked: int
:param call_count_failed: Number of calls failed due to proxy or backend
errors. This includes calls returning HttpStatusCode.BadRequest(400) and
any Code between HttpStatusCode.InternalServerError (500) and 600
:type call_count_failed: int
:param call_count_other: Number of other calls.
:type call_count_other: int
:param call_count_total: Total number of calls.
:type call_count_total: int
:param bandwidth: Bandwidth consumed.
:type bandwidth: long
:param cache_hit_count: Number of times when content was served from cache
policy.
:type cache_hit_count: int
:param cache_miss_count: Number of times content was fetched from backend.
:type cache_miss_count: int
:param api_time_avg: Average time it took to process request.
:type api_time_avg: float
:param api_time_min: Minimum time it took to process request.
:type api_time_min: float
:param api_time_max: Maximum time it took to process request.
:type api_time_max: float
:param service_time_avg: Average time it took to process request on
backend.
:type service_time_avg: float
:param service_time_min: Minimum time it took to process request on
backend.
:type service_time_min: float
:param service_time_max: Maximum time it took to process request on
backend.
:type service_time_max: float
"""
_validation = {
'user_id': {'readonly': True},
'product_id': {'readonly': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'interval': {'key': 'interval', 'type': 'str'},
'country': {'key': 'country', 'type': 'str'},
'region': {'key': 'region', 'type': 'str'},
'zip': {'key': 'zip', 'type': 'str'},
'user_id': {'key': 'userId', 'type': 'str'},
'product_id': {'key': 'productId', 'type': 'str'},
'api_id': {'key': 'apiId', 'type': 'str'},
'operation_id': {'key': 'operationId', 'type': 'str'},
'api_region': {'key': 'apiRegion', 'type': 'str'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'call_count_success': {'key': 'callCountSuccess', 'type': 'int'},
'call_count_blocked': {'key': 'callCountBlocked', 'type': 'int'},
'call_count_failed': {'key': 'callCountFailed', 'type': 'int'},
'call_count_other': {'key': 'callCountOther', 'type': 'int'},
'call_count_total': {'key': 'callCountTotal', 'type': 'int'},
'bandwidth': {'key': 'bandwidth', 'type': 'long'},
'cache_hit_count': {'key': 'cacheHitCount', 'type': 'int'},
'cache_miss_count': {'key': 'cacheMissCount', 'type': 'int'},
'api_time_avg': {'key': 'apiTimeAvg', 'type': 'float'},
'api_time_min': {'key': 'apiTimeMin', 'type': 'float'},
'api_time_max': {'key': 'apiTimeMax', 'type': 'float'},
'service_time_avg': {'key': 'serviceTimeAvg', 'type': 'float'},
'service_time_min': {'key': 'serviceTimeMin', 'type': 'float'},
'service_time_max': {'key': 'serviceTimeMax', 'type': 'float'},
}
def __init__(self, *, name: str=None, timestamp=None, interval: str=None, country: str=None, region: str=None, zip: str=None, api_id: str=None, operation_id: str=None, api_region: str=None, subscription_id: str=None, call_count_success: int=None, call_count_blocked: int=None, call_count_failed: int=None, call_count_other: int=None, call_count_total: int=None, bandwidth: int=None, cache_hit_count: int=None, cache_miss_count: int=None, api_time_avg: float=None, api_time_min: float=None, api_time_max: float=None, service_time_avg: float=None, service_time_min: float=None, service_time_max: float=None, **kwargs) -> None:
super(ReportRecordContract, self).__init__(**kwargs)
self.name = name
self.timestamp = timestamp
self.interval = interval
self.country = country
self.region = region
self.zip = zip
self.user_id = None
self.product_id = None
self.api_id = api_id
self.operation_id = operation_id
self.api_region = api_region
self.subscription_id = subscription_id
self.call_count_success = call_count_success
self.call_count_blocked = call_count_blocked
self.call_count_failed = call_count_failed
self.call_count_other = call_count_other
self.call_count_total = call_count_total
self.bandwidth = bandwidth
self.cache_hit_count = cache_hit_count
self.cache_miss_count = cache_miss_count
self.api_time_avg = api_time_avg
self.api_time_min = api_time_min
self.api_time_max = api_time_max
self.service_time_avg = service_time_avg
self.service_time_min = service_time_min
self.service_time_max = service_time_max
class RepresentationContract(Model):
"""Operation request/response representation details.
All required parameters must be populated in order to send to Azure.
:param content_type: Required. Specifies a registered or custom content
type for this representation, e.g. application/xml.
:type content_type: str
:param sample: An example of the representation.
:type sample: str
:param schema_id: Schema identifier. Applicable only if 'contentType'
value is neither 'application/x-www-form-urlencoded' nor
'multipart/form-data'.
:type schema_id: str
:param type_name: Type name defined by the schema. Applicable only if
'contentType' value is neither 'application/x-www-form-urlencoded' nor
'multipart/form-data'.
:type type_name: str
:param form_parameters: Collection of form parameters. Required if
'contentType' value is either 'application/x-www-form-urlencoded' or
'multipart/form-data'..
:type form_parameters:
list[~azure.mgmt.apimanagement.models.ParameterContract]
"""
_validation = {
'content_type': {'required': True},
}
_attribute_map = {
'content_type': {'key': 'contentType', 'type': 'str'},
'sample': {'key': 'sample', 'type': 'str'},
'schema_id': {'key': 'schemaId', 'type': 'str'},
'type_name': {'key': 'typeName', 'type': 'str'},
'form_parameters': {'key': 'formParameters', 'type': '[ParameterContract]'},
}
def __init__(self, *, content_type: str, sample: str=None, schema_id: str=None, type_name: str=None, form_parameters=None, **kwargs) -> None:
super(RepresentationContract, self).__init__(**kwargs)
self.content_type = content_type
self.sample = sample
self.schema_id = schema_id
self.type_name = type_name
self.form_parameters = form_parameters
class RequestContract(Model):
"""Operation request details.
:param description: Operation request description.
:type description: str
:param query_parameters: Collection of operation request query parameters.
:type query_parameters:
list[~azure.mgmt.apimanagement.models.ParameterContract]
:param headers: Collection of operation request headers.
:type headers: list[~azure.mgmt.apimanagement.models.ParameterContract]
:param representations: Collection of operation request representations.
:type representations:
list[~azure.mgmt.apimanagement.models.RepresentationContract]
"""
_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'query_parameters': {'key': 'queryParameters', 'type': '[ParameterContract]'},
'headers': {'key': 'headers', 'type': '[ParameterContract]'},
'representations': {'key': 'representations', 'type': '[RepresentationContract]'},
}
def __init__(self, *, description: str=None, query_parameters=None, headers=None, representations=None, **kwargs) -> None:
super(RequestContract, self).__init__(**kwargs)
self.description = description
self.query_parameters = query_parameters
self.headers = headers
self.representations = representations
class RequestReportRecordContract(Model):
"""Request Report data.
Variables are only populated by the server, and will be ignored when
sending a request.
:param api_id: API identifier path. /apis/{apiId}
:type api_id: str
:param operation_id: Operation identifier path.
/apis/{apiId}/operations/{operationId}
:type operation_id: str
:ivar product_id: Product identifier path. /products/{productId}
:vartype product_id: str
:ivar user_id: User identifier path. /users/{userId}
:vartype user_id: str
:param method: The HTTP method associated with this request..
:type method: str
:param url: The full URL associated with this request.
:type url: str
:param ip_address: The client IP address associated with this request.
:type ip_address: str
:param backend_response_code: The HTTP status code received by the gateway
as a result of forwarding this request to the backend.
:type backend_response_code: str
:param response_code: The HTTP status code returned by the gateway.
:type response_code: int
:param response_size: The size of the response returned by the gateway.
:type response_size: int
:param timestamp: The date and time when this request was received by the
gateway in ISO 8601 format.
:type timestamp: datetime
:param cache: Specifies if response cache was involved in generating the
response. If the value is none, the cache was not used. If the value is
hit, cached response was returned. If the value is miss, the cache was
used but lookup resulted in a miss and request was fulfilled by the
backend.
:type cache: str
:param api_time: The total time it took to process this request.
:type api_time: float
:param service_time: he time it took to forward this request to the
backend and get the response back.
:type service_time: float
:param api_region: Azure region where the gateway that processed this
request is located.
:type api_region: str
:param subscription_id: Subscription identifier path.
/subscriptions/{subscriptionId}
:type subscription_id: str
:param request_id: Request Identifier.
:type request_id: str
:param request_size: The size of this request..
:type request_size: int
"""
_validation = {
'product_id': {'readonly': True},
'user_id': {'readonly': True},
}
_attribute_map = {
'api_id': {'key': 'apiId', 'type': 'str'},
'operation_id': {'key': 'operationId', 'type': 'str'},
'product_id': {'key': 'productId', 'type': 'str'},
'user_id': {'key': 'userId', 'type': 'str'},
'method': {'key': 'method', 'type': 'str'},
'url': {'key': 'url', 'type': 'str'},
'ip_address': {'key': 'ipAddress', 'type': 'str'},
'backend_response_code': {'key': 'backendResponseCode', 'type': 'str'},
'response_code': {'key': 'responseCode', 'type': 'int'},
'response_size': {'key': 'responseSize', 'type': 'int'},
'timestamp': {'key': 'timestamp', 'type': 'iso-8601'},
'cache': {'key': 'cache', 'type': 'str'},
'api_time': {'key': 'apiTime', 'type': 'float'},
'service_time': {'key': 'serviceTime', 'type': 'float'},
'api_region': {'key': 'apiRegion', 'type': 'str'},
'subscription_id': {'key': 'subscriptionId', 'type': 'str'},
'request_id': {'key': 'requestId', 'type': 'str'},
'request_size': {'key': 'requestSize', 'type': 'int'},
}
def __init__(self, *, api_id: str=None, operation_id: str=None, method: str=None, url: str=None, ip_address: str=None, backend_response_code: str=None, response_code: int=None, response_size: int=None, timestamp=None, cache: str=None, api_time: float=None, service_time: float=None, api_region: str=None, subscription_id: str=None, request_id: str=None, request_size: int=None, **kwargs) -> None:
super(RequestReportRecordContract, self).__init__(**kwargs)
self.api_id = api_id
self.operation_id = operation_id
self.product_id = None
self.user_id = None
self.method = method
self.url = url
self.ip_address = ip_address
self.backend_response_code = backend_response_code
self.response_code = response_code
self.response_size = response_size
self.timestamp = timestamp
self.cache = cache
self.api_time = api_time
self.service_time = service_time
self.api_region = api_region
self.subscription_id = subscription_id
self.request_id = request_id
self.request_size = request_size
class ResourceLocationDataContract(Model):
"""Resource location data properties.
All required parameters must be populated in order to send to Azure.
:param name: Required. A canonical name for the geographic or physical
location.
:type name: str
:param city: The city or locality where the resource is located.
:type city: str
:param district: The district, state, or province where the resource is
located.
:type district: str
:param country_or_region: The country or region where the resource is
located.
:type country_or_region: str
"""
_validation = {
'name': {'required': True, 'max_length': 256},
'city': {'max_length': 256},
'district': {'max_length': 256},
'country_or_region': {'max_length': 256},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'city': {'key': 'city', 'type': 'str'},
'district': {'key': 'district', 'type': 'str'},
'country_or_region': {'key': 'countryOrRegion', 'type': 'str'},
}
def __init__(self, *, name: str, city: str=None, district: str=None, country_or_region: str=None, **kwargs) -> None:
super(ResourceLocationDataContract, self).__init__(**kwargs)
self.name = name
self.city = city
self.district = district
self.country_or_region = country_or_region
class ResourceSku(Model):
"""Describes an available API Management SKU.
:param name: Name of the Sku. Possible values include: 'Developer',
'Standard', 'Premium', 'Basic', 'Consumption'
:type name: str or ~azure.mgmt.apimanagement.models.SkuType
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, *, name=None, **kwargs) -> None:
super(ResourceSku, self).__init__(**kwargs)
self.name = name
class ResourceSkuCapacity(Model):
"""Describes scaling information of a SKU.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar minimum: The minimum capacity.
:vartype minimum: int
:ivar maximum: The maximum capacity that can be set.
:vartype maximum: int
:ivar default: The default capacity.
:vartype default: int
:ivar scale_type: The scale type applicable to the sku. Possible values
include: 'automatic', 'manual', 'none'
:vartype scale_type: str or
~azure.mgmt.apimanagement.models.ResourceSkuCapacityScaleType
"""
_validation = {
'minimum': {'readonly': True},
'maximum': {'readonly': True},
'default': {'readonly': True},
'scale_type': {'readonly': True},
}
_attribute_map = {
'minimum': {'key': 'minimum', 'type': 'int'},
'maximum': {'key': 'maximum', 'type': 'int'},
'default': {'key': 'default', 'type': 'int'},
'scale_type': {'key': 'scaleType', 'type': 'str'},
}
def __init__(self, **kwargs) -> None:
super(ResourceSkuCapacity, self).__init__(**kwargs)
self.minimum = None
self.maximum = None
self.default = None
self.scale_type = None
class ResourceSkuResult(Model):
"""Describes an available API Management service SKU.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar resource_type: The type of resource the SKU applies to.
:vartype resource_type: str
:ivar sku: Specifies API Management SKU.
:vartype sku: ~azure.mgmt.apimanagement.models.ResourceSku
:ivar capacity: Specifies the number of API Management units.
:vartype capacity: ~azure.mgmt.apimanagement.models.ResourceSkuCapacity
"""
_validation = {
'resource_type': {'readonly': True},
'sku': {'readonly': True},
'capacity': {'readonly': True},
}
_attribute_map = {
'resource_type': {'key': 'resourceType', 'type': 'str'},
'sku': {'key': 'sku', 'type': 'ResourceSku'},
'capacity': {'key': 'capacity', 'type': 'ResourceSkuCapacity'},
}
def __init__(self, **kwargs) -> None:
super(ResourceSkuResult, self).__init__(**kwargs)
self.resource_type = None
self.sku = None
self.capacity = None
class ResponseContract(Model):
"""Operation response details.
All required parameters must be populated in order to send to Azure.
:param status_code: Required. Operation response HTTP status code.
:type status_code: int
:param description: Operation response description.
:type description: str
:param representations: Collection of operation response representations.
:type representations:
list[~azure.mgmt.apimanagement.models.RepresentationContract]
:param headers: Collection of operation response headers.
:type headers: list[~azure.mgmt.apimanagement.models.ParameterContract]
"""
_validation = {
'status_code': {'required': True},
}
_attribute_map = {
'status_code': {'key': 'statusCode', 'type': 'int'},
'description': {'key': 'description', 'type': 'str'},
'representations': {'key': 'representations', 'type': '[RepresentationContract]'},
'headers': {'key': 'headers', 'type': '[ParameterContract]'},
}
def __init__(self, *, status_code: int, description: str=None, representations=None, headers=None, **kwargs) -> None:
super(ResponseContract, self).__init__(**kwargs)
self.status_code = status_code
self.description = description
self.representations = representations
self.headers = headers
class SamplingSettings(Model):
"""Sampling settings for Diagnostic.
:param sampling_type: Sampling type. Possible values include: 'fixed'
:type sampling_type: str or ~azure.mgmt.apimanagement.models.SamplingType
:param percentage: Rate of sampling for fixed-rate sampling.
:type percentage: float
"""
_validation = {
'percentage': {'maximum': 100, 'minimum': 0},
}
_attribute_map = {
'sampling_type': {'key': 'samplingType', 'type': 'str'},
'percentage': {'key': 'percentage', 'type': 'float'},
}
def __init__(self, *, sampling_type=None, percentage: float=None, **kwargs) -> None:
super(SamplingSettings, self).__init__(**kwargs)
self.sampling_type = sampling_type
self.percentage = percentage
class SaveConfigurationParameter(Model):
"""Save Tenant Configuration Contract details.
All required parameters must be populated in order to send to Azure.
:param branch: Required. The name of the Git branch in which to commit the
current configuration snapshot.
:type branch: str
:param force: The value if true, the current configuration database is
committed to the Git repository, even if the Git repository has newer
changes that would be overwritten.
:type force: bool
"""
_validation = {
'branch': {'required': True},
}
_attribute_map = {
'branch': {'key': 'properties.branch', 'type': 'str'},
'force': {'key': 'properties.force', 'type': 'bool'},
}
def __init__(self, *, branch: str, force: bool=None, **kwargs) -> None:
super(SaveConfigurationParameter, self).__init__(**kwargs)
self.branch = branch
self.force = force
class SchemaContract(Resource):
"""Schema Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param content_type: Required. Must be a valid a media type used in a
Content-Type header as defined in the RFC 2616. Media type of the schema
document (e.g. application/json, application/xml). </br> - `Swagger`
Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br>
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> -
`OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> -
`WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`.
:type content_type: str
:param value: Json escaped string defining the document representing the
Schema. Used for schemas other than Swagger/OpenAPI.
:type value: str
:param definitions: Types definitions. Used for Swagger/OpenAPI schemas
only, null otherwise.
:type definitions: object
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'content_type': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'content_type': {'key': 'properties.contentType', 'type': 'str'},
'value': {'key': 'properties.document.value', 'type': 'str'},
'definitions': {'key': 'properties.document.definitions', 'type': 'object'},
}
def __init__(self, *, content_type: str, value: str=None, definitions=None, **kwargs) -> None:
super(SchemaContract, self).__init__(**kwargs)
self.content_type = content_type
self.value = value
self.definitions = definitions
class SubscriptionContract(Resource):
"""Subscription details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param owner_id: The user resource identifier of the subscription owner.
The value is a valid relative URL in the format of /users/{userId} where
{userId} is a user identifier.
:type owner_id: str
:param scope: Required. Scope like /products/{productId} or /apis or
/apis/{apiId}.
:type scope: str
:param display_name: The name of the subscription, or null if the
subscription has no name.
:type display_name: str
:param state: Required. Subscription state. Possible states are * active –
the subscription is active, * suspended – the subscription is blocked, and
the subscriber cannot call any APIs of the product, * submitted – the
subscription request has been made by the developer, but has not yet been
approved or rejected, * rejected – the subscription request has been
denied by an administrator, * cancelled – the subscription has been
cancelled by the developer or administrator, * expired – the subscription
reached its expiration date and was deactivated. Possible values include:
'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled'
:type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState
:ivar created_date: Subscription creation date. The date conforms to the
following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
standard.
:vartype created_date: datetime
:param start_date: Subscription activation date. The setting is for audit
purposes only and the subscription is not automatically activated. The
subscription lifecycle can be managed by using the `state` property. The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:type start_date: datetime
:param expiration_date: Subscription expiration date. The setting is for
audit purposes only and the subscription is not automatically expired. The
subscription lifecycle can be managed by using the `state` property. The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:type expiration_date: datetime
:param end_date: Date when subscription was cancelled or expired. The
setting is for audit purposes only and the subscription is not
automatically cancelled. The subscription lifecycle can be managed by
using the `state` property. The date conforms to the following format:
`yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
:type end_date: datetime
:param notification_date: Upcoming subscription expiration notification
date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as
specified by the ISO 8601 standard.
:type notification_date: datetime
:param primary_key: Subscription primary key. This property will not be
filled on 'GET' operations! Use '/listSecrets' POST request to get the
value.
:type primary_key: str
:param secondary_key: Subscription secondary key. This property will not
be filled on 'GET' operations! Use '/listSecrets' POST request to get the
value.
:type secondary_key: str
:param state_comment: Optional subscription comment added by an
administrator.
:type state_comment: str
:param allow_tracing: Determines whether tracing is enabled
:type allow_tracing: bool
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'scope': {'required': True},
'display_name': {'max_length': 100, 'min_length': 0},
'state': {'required': True},
'created_date': {'readonly': True},
'primary_key': {'max_length': 256, 'min_length': 1},
'secondary_key': {'max_length': 256, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'owner_id': {'key': 'properties.ownerId', 'type': 'str'},
'scope': {'key': 'properties.scope', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'SubscriptionState'},
'created_date': {'key': 'properties.createdDate', 'type': 'iso-8601'},
'start_date': {'key': 'properties.startDate', 'type': 'iso-8601'},
'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'},
'end_date': {'key': 'properties.endDate', 'type': 'iso-8601'},
'notification_date': {'key': 'properties.notificationDate', 'type': 'iso-8601'},
'primary_key': {'key': 'properties.primaryKey', 'type': 'str'},
'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'},
'state_comment': {'key': 'properties.stateComment', 'type': 'str'},
'allow_tracing': {'key': 'properties.allowTracing', 'type': 'bool'},
}
def __init__(self, *, scope: str, state, owner_id: str=None, display_name: str=None, start_date=None, expiration_date=None, end_date=None, notification_date=None, primary_key: str=None, secondary_key: str=None, state_comment: str=None, allow_tracing: bool=None, **kwargs) -> None:
super(SubscriptionContract, self).__init__(**kwargs)
self.owner_id = owner_id
self.scope = scope
self.display_name = display_name
self.state = state
self.created_date = None
self.start_date = start_date
self.expiration_date = expiration_date
self.end_date = end_date
self.notification_date = notification_date
self.primary_key = primary_key
self.secondary_key = secondary_key
self.state_comment = state_comment
self.allow_tracing = allow_tracing
class SubscriptionCreateParameters(Model):
"""Subscription create details.
All required parameters must be populated in order to send to Azure.
:param owner_id: User (user id path) for whom subscription is being
created in form /users/{userId}
:type owner_id: str
:param scope: Required. Scope like /products/{productId} or /apis or
/apis/{apiId}.
:type scope: str
:param display_name: Required. Subscription name.
:type display_name: str
:param primary_key: Primary subscription key. If not specified during
request key will be generated automatically.
:type primary_key: str
:param secondary_key: Secondary subscription key. If not specified during
request key will be generated automatically.
:type secondary_key: str
:param state: Initial subscription state. If no value is specified,
subscription is created with Submitted state. Possible states are * active
– the subscription is active, * suspended – the subscription is blocked,
and the subscriber cannot call any APIs of the product, * submitted – the
subscription request has been made by the developer, but has not yet been
approved or rejected, * rejected – the subscription request has been
denied by an administrator, * cancelled – the subscription has been
cancelled by the developer or administrator, * expired – the subscription
reached its expiration date and was deactivated. Possible values include:
'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled'
:type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState
:param allow_tracing: Determines whether tracing can be enabled
:type allow_tracing: bool
"""
_validation = {
'scope': {'required': True},
'display_name': {'required': True, 'max_length': 100, 'min_length': 1},
'primary_key': {'max_length': 256, 'min_length': 1},
'secondary_key': {'max_length': 256, 'min_length': 1},
}
_attribute_map = {
'owner_id': {'key': 'properties.ownerId', 'type': 'str'},
'scope': {'key': 'properties.scope', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'primary_key': {'key': 'properties.primaryKey', 'type': 'str'},
'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'SubscriptionState'},
'allow_tracing': {'key': 'properties.allowTracing', 'type': 'bool'},
}
def __init__(self, *, scope: str, display_name: str, owner_id: str=None, primary_key: str=None, secondary_key: str=None, state=None, allow_tracing: bool=None, **kwargs) -> None:
super(SubscriptionCreateParameters, self).__init__(**kwargs)
self.owner_id = owner_id
self.scope = scope
self.display_name = display_name
self.primary_key = primary_key
self.secondary_key = secondary_key
self.state = state
self.allow_tracing = allow_tracing
class SubscriptionKeyParameterNamesContract(Model):
"""Subscription key parameter names details.
:param header: Subscription key header name.
:type header: str
:param query: Subscription key query string parameter name.
:type query: str
"""
_attribute_map = {
'header': {'key': 'header', 'type': 'str'},
'query': {'key': 'query', 'type': 'str'},
}
def __init__(self, *, header: str=None, query: str=None, **kwargs) -> None:
super(SubscriptionKeyParameterNamesContract, self).__init__(**kwargs)
self.header = header
self.query = query
class SubscriptionKeysContract(Model):
"""Subscription keys.
:param primary_key: Subscription primary key.
:type primary_key: str
:param secondary_key: Subscription secondary key.
:type secondary_key: str
"""
_validation = {
'primary_key': {'max_length': 256, 'min_length': 1},
'secondary_key': {'max_length': 256, 'min_length': 1},
}
_attribute_map = {
'primary_key': {'key': 'primaryKey', 'type': 'str'},
'secondary_key': {'key': 'secondaryKey', 'type': 'str'},
}
def __init__(self, *, primary_key: str=None, secondary_key: str=None, **kwargs) -> None:
super(SubscriptionKeysContract, self).__init__(**kwargs)
self.primary_key = primary_key
self.secondary_key = secondary_key
class SubscriptionsDelegationSettingsProperties(Model):
"""Subscriptions delegation settings properties.
:param enabled: Enable or disable delegation for subscriptions.
:type enabled: bool
"""
_attribute_map = {
'enabled': {'key': 'enabled', 'type': 'bool'},
}
def __init__(self, *, enabled: bool=None, **kwargs) -> None:
super(SubscriptionsDelegationSettingsProperties, self).__init__(**kwargs)
self.enabled = enabled
class SubscriptionUpdateParameters(Model):
"""Subscription update details.
:param owner_id: User identifier path: /users/{userId}
:type owner_id: str
:param scope: Scope like /products/{productId} or /apis or /apis/{apiId}
:type scope: str
:param expiration_date: Subscription expiration date. The setting is for
audit purposes only and the subscription is not automatically expired. The
subscription lifecycle can be managed by using the `state` property. The
date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified
by the ISO 8601 standard.
:type expiration_date: datetime
:param display_name: Subscription name.
:type display_name: str
:param primary_key: Primary subscription key.
:type primary_key: str
:param secondary_key: Secondary subscription key.
:type secondary_key: str
:param state: Subscription state. Possible states are * active – the
subscription is active, * suspended – the subscription is blocked, and the
subscriber cannot call any APIs of the product, * submitted – the
subscription request has been made by the developer, but has not yet been
approved or rejected, * rejected – the subscription request has been
denied by an administrator, * cancelled – the subscription has been
cancelled by the developer or administrator, * expired – the subscription
reached its expiration date and was deactivated. Possible values include:
'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled'
:type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState
:param state_comment: Comments describing subscription state change by the
administrator.
:type state_comment: str
:param allow_tracing: Determines whether tracing can be enabled
:type allow_tracing: bool
"""
_validation = {
'primary_key': {'max_length': 256, 'min_length': 1},
'secondary_key': {'max_length': 256, 'min_length': 1},
}
_attribute_map = {
'owner_id': {'key': 'properties.ownerId', 'type': 'str'},
'scope': {'key': 'properties.scope', 'type': 'str'},
'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
'primary_key': {'key': 'properties.primaryKey', 'type': 'str'},
'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'SubscriptionState'},
'state_comment': {'key': 'properties.stateComment', 'type': 'str'},
'allow_tracing': {'key': 'properties.allowTracing', 'type': 'bool'},
}
def __init__(self, *, owner_id: str=None, scope: str=None, expiration_date=None, display_name: str=None, primary_key: str=None, secondary_key: str=None, state=None, state_comment: str=None, allow_tracing: bool=None, **kwargs) -> None:
super(SubscriptionUpdateParameters, self).__init__(**kwargs)
self.owner_id = owner_id
self.scope = scope
self.expiration_date = expiration_date
self.display_name = display_name
self.primary_key = primary_key
self.secondary_key = secondary_key
self.state = state
self.state_comment = state_comment
self.allow_tracing = allow_tracing
class TagContract(Resource):
"""Tag Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param display_name: Required. Tag name.
:type display_name: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'display_name': {'required': True, 'max_length': 160, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
}
def __init__(self, *, display_name: str, **kwargs) -> None:
super(TagContract, self).__init__(**kwargs)
self.display_name = display_name
class TagCreateUpdateParameters(Model):
"""Parameters supplied to Create/Update Tag operations.
All required parameters must be populated in order to send to Azure.
:param display_name: Required. Tag name.
:type display_name: str
"""
_validation = {
'display_name': {'required': True, 'max_length': 160, 'min_length': 1},
}
_attribute_map = {
'display_name': {'key': 'properties.displayName', 'type': 'str'},
}
def __init__(self, *, display_name: str, **kwargs) -> None:
super(TagCreateUpdateParameters, self).__init__(**kwargs)
self.display_name = display_name
class TagDescriptionContract(Resource):
"""Contract details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param description: Description of the Tag.
:type description: str
:param external_docs_url: Absolute URL of external resources describing
the tag.
:type external_docs_url: str
:param external_docs_description: Description of the external resources
describing the tag.
:type external_docs_description: str
:param tag_id: Identifier of the tag in the form of /tags/{tagId}
:type tag_id: str
:param display_name: Tag name.
:type display_name: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'external_docs_url': {'max_length': 2000},
'display_name': {'max_length': 160, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'external_docs_url': {'key': 'properties.externalDocsUrl', 'type': 'str'},
'external_docs_description': {'key': 'properties.externalDocsDescription', 'type': 'str'},
'tag_id': {'key': 'properties.tagId', 'type': 'str'},
'display_name': {'key': 'properties.displayName', 'type': 'str'},
}
def __init__(self, *, description: str=None, external_docs_url: str=None, external_docs_description: str=None, tag_id: str=None, display_name: str=None, **kwargs) -> None:
super(TagDescriptionContract, self).__init__(**kwargs)
self.description = description
self.external_docs_url = external_docs_url
self.external_docs_description = external_docs_description
self.tag_id = tag_id
self.display_name = display_name
class TagDescriptionCreateParameters(Model):
"""Parameters supplied to the Create TagDescription operation.
:param description: Description of the Tag.
:type description: str
:param external_docs_url: Absolute URL of external resources describing
the tag.
:type external_docs_url: str
:param external_docs_description: Description of the external resources
describing the tag.
:type external_docs_description: str
"""
_validation = {
'external_docs_url': {'max_length': 2000},
}
_attribute_map = {
'description': {'key': 'properties.description', 'type': 'str'},
'external_docs_url': {'key': 'properties.externalDocsUrl', 'type': 'str'},
'external_docs_description': {'key': 'properties.externalDocsDescription', 'type': 'str'},
}
def __init__(self, *, description: str=None, external_docs_url: str=None, external_docs_description: str=None, **kwargs) -> None:
super(TagDescriptionCreateParameters, self).__init__(**kwargs)
self.description = description
self.external_docs_url = external_docs_url
self.external_docs_description = external_docs_description
class TagResourceContract(Model):
"""TagResource contract properties.
All required parameters must be populated in order to send to Azure.
:param tag: Required. Tag associated with the resource.
:type tag:
~azure.mgmt.apimanagement.models.TagTagResourceContractProperties
:param api: Api associated with the tag.
:type api:
~azure.mgmt.apimanagement.models.ApiTagResourceContractProperties
:param operation: Operation associated with the tag.
:type operation:
~azure.mgmt.apimanagement.models.OperationTagResourceContractProperties
:param product: Product associated with the tag.
:type product:
~azure.mgmt.apimanagement.models.ProductTagResourceContractProperties
"""
_validation = {
'tag': {'required': True},
}
_attribute_map = {
'tag': {'key': 'tag', 'type': 'TagTagResourceContractProperties'},
'api': {'key': 'api', 'type': 'ApiTagResourceContractProperties'},
'operation': {'key': 'operation', 'type': 'OperationTagResourceContractProperties'},
'product': {'key': 'product', 'type': 'ProductTagResourceContractProperties'},
}
def __init__(self, *, tag, api=None, operation=None, product=None, **kwargs) -> None:
super(TagResourceContract, self).__init__(**kwargs)
self.tag = tag
self.api = api
self.operation = operation
self.product = product
class TagTagResourceContractProperties(Model):
"""Contract defining the Tag property in the Tag Resource Contract.
:param id: Tag identifier
:type id: str
:param name: Tag Name
:type name: str
"""
_validation = {
'name': {'max_length': 160, 'min_length': 1},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, *, id: str=None, name: str=None, **kwargs) -> None:
super(TagTagResourceContractProperties, self).__init__(**kwargs)
self.id = id
self.name = name
class TenantConfigurationSyncStateContract(Model):
"""Tenant Configuration Synchronization State.
:param branch: The name of Git branch.
:type branch: str
:param commit_id: The latest commit Id.
:type commit_id: str
:param is_export: value indicating if last sync was save (true) or deploy
(false) operation.
:type is_export: bool
:param is_synced: value indicating if last synchronization was later than
the configuration change.
:type is_synced: bool
:param is_git_enabled: value indicating whether Git configuration access
is enabled.
:type is_git_enabled: bool
:param sync_date: The date of the latest synchronization. The date
conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by
the ISO 8601 standard.
:type sync_date: datetime
:param configuration_change_date: The date of the latest configuration
change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ`
as specified by the ISO 8601 standard.
:type configuration_change_date: datetime
"""
_attribute_map = {
'branch': {'key': 'branch', 'type': 'str'},
'commit_id': {'key': 'commitId', 'type': 'str'},
'is_export': {'key': 'isExport', 'type': 'bool'},
'is_synced': {'key': 'isSynced', 'type': 'bool'},
'is_git_enabled': {'key': 'isGitEnabled', 'type': 'bool'},
'sync_date': {'key': 'syncDate', 'type': 'iso-8601'},
'configuration_change_date': {'key': 'configurationChangeDate', 'type': 'iso-8601'},
}
def __init__(self, *, branch: str=None, commit_id: str=None, is_export: bool=None, is_synced: bool=None, is_git_enabled: bool=None, sync_date=None, configuration_change_date=None, **kwargs) -> None:
super(TenantConfigurationSyncStateContract, self).__init__(**kwargs)
self.branch = branch
self.commit_id = commit_id
self.is_export = is_export
self.is_synced = is_synced
self.is_git_enabled = is_git_enabled
self.sync_date = sync_date
self.configuration_change_date = configuration_change_date
class TermsOfServiceProperties(Model):
"""Terms of service contract properties.
:param text: A terms of service text.
:type text: str
:param enabled: Display terms of service during a sign-up process.
:type enabled: bool
:param consent_required: Ask user for consent to the terms of service.
:type consent_required: bool
"""
_attribute_map = {
'text': {'key': 'text', 'type': 'str'},
'enabled': {'key': 'enabled', 'type': 'bool'},
'consent_required': {'key': 'consentRequired', 'type': 'bool'},
}
def __init__(self, *, text: str=None, enabled: bool=None, consent_required: bool=None, **kwargs) -> None:
super(TermsOfServiceProperties, self).__init__(**kwargs)
self.text = text
self.enabled = enabled
self.consent_required = consent_required
class TokenBodyParameterContract(Model):
"""OAuth acquire token request body parameter (www-url-form-encoded).
All required parameters must be populated in order to send to Azure.
:param name: Required. body parameter name.
:type name: str
:param value: Required. body parameter value.
:type value: str
"""
_validation = {
'name': {'required': True},
'value': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}
def __init__(self, *, name: str, value: str, **kwargs) -> None:
super(TokenBodyParameterContract, self).__init__(**kwargs)
self.name = name
self.value = value
class UserContract(Resource):
"""User details.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Resource ID.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type for API Management resource.
:vartype type: str
:param state: Account state. Specifies whether the user is active or not.
Blocked users are unable to sign into the developer portal or call any
APIs of subscribed products. Default state is Active. Possible values
include: 'active', 'blocked', 'pending', 'deleted'. Default value:
"active" .
:type state: str or ~azure.mgmt.apimanagement.models.UserState
:param note: Optional note about a user set by the administrator.
:type note: str
:param identities: Collection of user identities.
:type identities:
list[~azure.mgmt.apimanagement.models.UserIdentityContract]
:param first_name: First name.
:type first_name: str
:param last_name: Last name.
:type last_name: str
:param email: Email address.
:type email: str
:param registration_date: Date of user registration. The date conforms to
the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601
standard.
:type registration_date: datetime
:ivar groups: Collection of groups user is part of.
:vartype groups:
list[~azure.mgmt.apimanagement.models.GroupContractProperties]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'groups': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'str'},
'note': {'key': 'properties.note', 'type': 'str'},
'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'},
'first_name': {'key': 'properties.firstName', 'type': 'str'},
'last_name': {'key': 'properties.lastName', 'type': 'str'},
'email': {'key': 'properties.email', 'type': 'str'},
'registration_date': {'key': 'properties.registrationDate', 'type': 'iso-8601'},
'groups': {'key': 'properties.groups', 'type': '[GroupContractProperties]'},
}
def __init__(self, *, state="active", note: str=None, identities=None, first_name: str=None, last_name: str=None, email: str=None, registration_date=None, **kwargs) -> None:
super(UserContract, self).__init__(**kwargs)
self.state = state
self.note = note
self.identities = identities
self.first_name = first_name
self.last_name = last_name
self.email = email
self.registration_date = registration_date
self.groups = None
class UserCreateParameters(Model):
"""User create details.
All required parameters must be populated in order to send to Azure.
:param state: Account state. Specifies whether the user is active or not.
Blocked users are unable to sign into the developer portal or call any
APIs of subscribed products. Default state is Active. Possible values
include: 'active', 'blocked', 'pending', 'deleted'. Default value:
"active" .
:type state: str or ~azure.mgmt.apimanagement.models.UserState
:param note: Optional note about a user set by the administrator.
:type note: str
:param identities: Collection of user identities.
:type identities:
list[~azure.mgmt.apimanagement.models.UserIdentityContract]
:param email: Required. Email address. Must not be empty and must be
unique within the service instance.
:type email: str
:param first_name: Required. First name.
:type first_name: str
:param last_name: Required. Last name.
:type last_name: str
:param password: User Password. If no value is provided, a default
password is generated.
:type password: str
:param app_type: Determines the type of application which send the create
user request. Default is old publisher portal. Possible values include:
'developerPortal'
:type app_type: str or ~azure.mgmt.apimanagement.models.AppType
:param confirmation: Determines the type of confirmation e-mail that will
be sent to the newly created user. Possible values include: 'signup',
'invite'
:type confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation
"""
_validation = {
'email': {'required': True, 'max_length': 254, 'min_length': 1},
'first_name': {'required': True, 'max_length': 100, 'min_length': 1},
'last_name': {'required': True, 'max_length': 100, 'min_length': 1},
}
_attribute_map = {
'state': {'key': 'properties.state', 'type': 'str'},
'note': {'key': 'properties.note', 'type': 'str'},
'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'},
'email': {'key': 'properties.email', 'type': 'str'},
'first_name': {'key': 'properties.firstName', 'type': 'str'},
'last_name': {'key': 'properties.lastName', 'type': 'str'},
'password': {'key': 'properties.password', 'type': 'str'},
'app_type': {'key': 'properties.appType', 'type': 'str'},
'confirmation': {'key': 'properties.confirmation', 'type': 'str'},
}
def __init__(self, *, email: str, first_name: str, last_name: str, state="active", note: str=None, identities=None, password: str=None, app_type=None, confirmation=None, **kwargs) -> None:
super(UserCreateParameters, self).__init__(**kwargs)
self.state = state
self.note = note
self.identities = identities
self.email = email
self.first_name = first_name
self.last_name = last_name
self.password = password
self.app_type = app_type
self.confirmation = confirmation
class UserEntityBaseParameters(Model):
"""User Entity Base Parameters set.
:param state: Account state. Specifies whether the user is active or not.
Blocked users are unable to sign into the developer portal or call any
APIs of subscribed products. Default state is Active. Possible values
include: 'active', 'blocked', 'pending', 'deleted'. Default value:
"active" .
:type state: str or ~azure.mgmt.apimanagement.models.UserState
:param note: Optional note about a user set by the administrator.
:type note: str
:param identities: Collection of user identities.
:type identities:
list[~azure.mgmt.apimanagement.models.UserIdentityContract]
"""
_attribute_map = {
'state': {'key': 'state', 'type': 'str'},
'note': {'key': 'note', 'type': 'str'},
'identities': {'key': 'identities', 'type': '[UserIdentityContract]'},
}
def __init__(self, *, state="active", note: str=None, identities=None, **kwargs) -> None:
super(UserEntityBaseParameters, self).__init__(**kwargs)
self.state = state
self.note = note
self.identities = identities
class UserIdentityContract(Model):
"""User identity details.
:param provider: Identity provider name.
:type provider: str
:param id: Identifier value within provider.
:type id: str
"""
_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
}
def __init__(self, *, provider: str=None, id: str=None, **kwargs) -> None:
super(UserIdentityContract, self).__init__(**kwargs)
self.provider = provider
self.id = id
class UserIdentityProperties(Model):
"""UserIdentityProperties.
:param principal_id: The principal id of user assigned identity.
:type principal_id: str
:param client_id: The client id of user assigned identity.
:type client_id: str
"""
_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'client_id': {'key': 'clientId', 'type': 'str'},
}
def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None:
super(UserIdentityProperties, self).__init__(**kwargs)
self.principal_id = principal_id
self.client_id = client_id
class UserTokenParameters(Model):
"""Get User Token parameters.
All required parameters must be populated in order to send to Azure.
:param key_type: Required. The Key to be used to generate token for user.
Possible values include: 'primary', 'secondary'. Default value: "primary"
.
:type key_type: str or ~azure.mgmt.apimanagement.models.KeyType
:param expiry: Required. The Expiry time of the Token. Maximum token
expiry time is set to 30 days. The date conforms to the following format:
`yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
:type expiry: datetime
"""
_validation = {
'key_type': {'required': True},
'expiry': {'required': True},
}
_attribute_map = {
'key_type': {'key': 'properties.keyType', 'type': 'KeyType'},
'expiry': {'key': 'properties.expiry', 'type': 'iso-8601'},
}
def __init__(self, *, expiry, key_type="primary", **kwargs) -> None:
super(UserTokenParameters, self).__init__(**kwargs)
self.key_type = key_type
self.expiry = expiry
class UserTokenResult(Model):
"""Get User Token response details.
:param value: Shared Access Authorization token for the User.
:type value: str
"""
_attribute_map = {
'value': {'key': 'value', 'type': 'str'},
}
def __init__(self, *, value: str=None, **kwargs) -> None:
super(UserTokenResult, self).__init__(**kwargs)
self.value = value
class UserUpdateParameters(Model):
"""User update parameters.
:param state: Account state. Specifies whether the user is active or not.
Blocked users are unable to sign into the developer portal or call any
APIs of subscribed products. Default state is Active. Possible values
include: 'active', 'blocked', 'pending', 'deleted'. Default value:
"active" .
:type state: str or ~azure.mgmt.apimanagement.models.UserState
:param note: Optional note about a user set by the administrator.
:type note: str
:param identities: Collection of user identities.
:type identities:
list[~azure.mgmt.apimanagement.models.UserIdentityContract]
:param email: Email address. Must not be empty and must be unique within
the service instance.
:type email: str
:param password: User Password.
:type password: str
:param first_name: First name.
:type first_name: str
:param last_name: Last name.
:type last_name: str
"""
_validation = {
'email': {'max_length': 254, 'min_length': 1},
'first_name': {'max_length': 100, 'min_length': 1},
'last_name': {'max_length': 100, 'min_length': 1},
}
_attribute_map = {
'state': {'key': 'properties.state', 'type': 'str'},
'note': {'key': 'properties.note', 'type': 'str'},
'identities': {'key': 'properties.identities', 'type': '[UserIdentityContract]'},
'email': {'key': 'properties.email', 'type': 'str'},
'password': {'key': 'properties.password', 'type': 'str'},
'first_name': {'key': 'properties.firstName', 'type': 'str'},
'last_name': {'key': 'properties.lastName', 'type': 'str'},
}
def __init__(self, *, state="active", note: str=None, identities=None, email: str=None, password: str=None, first_name: str=None, last_name: str=None, **kwargs) -> None:
super(UserUpdateParameters, self).__init__(**kwargs)
self.state = state
self.note = note
self.identities = identities
self.email = email
self.password = password
self.first_name = first_name
self.last_name = last_name
class VirtualNetworkConfiguration(Model):
"""Configuration of a virtual network to which API Management service is
deployed.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar vnetid: The virtual network ID. This is typically a GUID. Expect a
null GUID by default.
:vartype vnetid: str
:ivar subnetname: The name of the subnet.
:vartype subnetname: str
:param subnet_resource_id: The full resource ID of a subnet in a virtual
network to deploy the API Management service in.
:type subnet_resource_id: str
"""
_validation = {
'vnetid': {'readonly': True},
'subnetname': {'readonly': True},
'subnet_resource_id': {'pattern': r'^/subscriptions/[^/]*/resourceGroups/[^/]*/providers/Microsoft.(ClassicNetwork|Network)/virtualNetworks/[^/]*/subnets/[^/]*$'},
}
_attribute_map = {
'vnetid': {'key': 'vnetid', 'type': 'str'},
'subnetname': {'key': 'subnetname', 'type': 'str'},
'subnet_resource_id': {'key': 'subnetResourceId', 'type': 'str'},
}
def __init__(self, *, subnet_resource_id: str=None, **kwargs) -> None:
super(VirtualNetworkConfiguration, self).__init__(**kwargs)
self.vnetid = None
self.subnetname = None
self.subnet_resource_id = subnet_resource_id
class X509CertificateName(Model):
"""Properties of server X509Names.
:param name: Common Name of the Certificate.
:type name: str
:param issuer_certificate_thumbprint: Thumbprint for the Issuer of the
Certificate.
:type issuer_certificate_thumbprint: str
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'issuer_certificate_thumbprint': {'key': 'issuerCertificateThumbprint', 'type': 'str'},
}
def __init__(self, *, name: str=None, issuer_certificate_thumbprint: str=None, **kwargs) -> None:
super(X509CertificateName, self).__init__(**kwargs)
self.name = name
self.issuer_certificate_thumbprint = issuer_certificate_thumbprint
| 43.152042 | 628 | 0.674863 | 39,514 | 340,297 | 5.64076 | 0.036569 | 0.023994 | 0.018951 | 0.02412 | 0.757547 | 0.728578 | 0.702776 | 0.679971 | 0.662819 | 0.652006 | 0 | 0.005314 | 0.207028 | 340,297 | 7,885 | 629 | 43.157514 | 0.820605 | 0.445849 | 0 | 0.600478 | 0 | 0 | 0.274357 | 0.077101 | 0 | 0 | 0 | 0 | 0 | 1 | 0.051136 | false | 0.013158 | 0.000598 | 0 | 0.189593 | 0.005084 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1e181b8be3f9d7c9823895d4a475cbe805b0b1de | 509 | py | Python | pylspm/__init__.py | lseman/pyplspm | 136e1ac3ac88655442ef66a5914efe10c0797561 | [
"MIT"
] | 12 | 2017-05-04T11:21:45.000Z | 2022-03-24T02:30:22.000Z | pylspm/__init__.py | lseman/pyplspm | 136e1ac3ac88655442ef66a5914efe10c0797561 | [
"MIT"
] | 5 | 2017-03-30T14:52:21.000Z | 2018-01-17T16:08:44.000Z | pylspm/__init__.py | lseman/pyplspm | 136e1ac3ac88655442ef66a5914efe10c0797561 | [
"MIT"
] | 2 | 2019-07-18T01:57:29.000Z | 2021-04-10T09:44:20.000Z | from .pylspm import PyLSpm
from .results import PyLSpmHTML
from .boot import PyLSboot
from .rebus import rebus
from .blindfolding import blindfolding
from .bootstraping import bootstrap
from .mga import mga
from .gac import gac
from .pso import pso
from .tabu2 import tabu
from .permuta import permuta
from .plsr2 import plsr2, HOCcat
from .monteCholesky import monteCholesky
from .adequacy import *
from .test_heuristic import *
from .fimix import fimixPLS
from .imputation import Imputer | 26.789474 | 41 | 0.787819 | 68 | 509 | 5.882353 | 0.397059 | 0.05 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007126 | 0.172888 | 509 | 19 | 42 | 26.789474 | 0.942993 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1e1b240df6c494b3873849a67646f06adf44a04b | 626 | py | Python | activations.py | award28/Diabetic_Retinopathy_Detection | 079a7af791f3442853577c0731c9a797433bbcda | [
"MIT"
] | 2 | 2018-08-04T21:47:39.000Z | 2019-03-23T02:56:59.000Z | activations.py | award28/Diabetic_Retinopathy_Detection | 079a7af791f3442853577c0731c9a797433bbcda | [
"MIT"
] | null | null | null | activations.py | award28/Diabetic_Retinopathy_Detection | 079a7af791f3442853577c0731c9a797433bbcda | [
"MIT"
] | null | null | null | import math
import numpy as np
def relu(pixel_vals, bias=0):
'''Takes tuple (r,g,b) and returns the relu transformation.
For use within each individual node in a dense layer before being passed onto the next layer
bias 0'ed out by default
'''
return (pixel_vals * (pixel_vals > 0) + bias,)
def sigmoid(pixel_vals, bias=0):
'''returns sigmoid activation of a pixel
bias 0'ed out by default'''
return (1/(1+np.exp(-pixel_vals) + bias))
def tanh(pixel_vals, bias=0):
'''returns hyperbolic tan of a tuple of pixel_vals
bias 0'ed out by default'''
return (np.tanh(pixel_vals) + bias)
| 31.3 | 96 | 0.682109 | 105 | 626 | 3.990476 | 0.457143 | 0.171838 | 0.186158 | 0.133652 | 0.279236 | 0.178998 | 0.178998 | 0 | 0 | 0 | 0 | 0.018256 | 0.21246 | 626 | 19 | 97 | 32.947368 | 0.831643 | 0.495208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0.25 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
1e21027e056e44942c5d571e7146f8e789845705 | 2,295 | py | Python | tests/data23/recipe-473784.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-06-05T08:53:26.000Z | 2020-06-05T08:53:26.000Z | tests/data23/recipe-473784.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-06-04T13:47:19.000Z | 2020-06-04T13:47:57.000Z | tests/data23/recipe-473784.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-11-07T17:02:46.000Z | 2020-11-07T17:02:46.000Z | ################################################################################
#
#
#
#===============================================================================
class CustomDict( dict ):
#---------------------------------------------------------------------------
defaultValue = 'THIS ITEM NOT AVAILABLE'
#---------------------------------------------------------------------------
def __getitem__( self, name ):
try:
return super( CustomDict, self ).__getitem__( name )
except KeyError:
return self.defaultValue
#---------------------------------------------------------------------------
def __contains__( self, name ):
return True
#---------------------------------------------------------------------------
def has_key( self, name ):
return True
################################################################################
#
#
#
#===============================================================================
class X( object ):
#---------------------------------------------------------------------------
def __init__( self ):
self._dict = CustomDict( foo = 'bar' )
#---------------------------------------------------------------------------
@property
def __dict__( self ):
#print 'X.__dict__ ( get() )'
return self._dict
#---------------------------------------------------------------------------
def __getattr__( self, name ):
return self.__dict__[ name ]
#---------------------------------------------------------------------------
def __setattr__( self, name, value ):
if name == '_dict':
return super( X, self ).__setattr__( name, value )
self._dict[ name ] = value
################################################################################
#
#
#
#===============================================================================
if __name__ == '__main__':
x = X()
print(x.__dict__[ 'foo' ])
print(x.__dict__[ 'bar' ])
print(x.foo)
print(x.bar)
print(x.__dict__)
x.oops = 42
print(x.__dict__)
# Output:
# bar
# THIS ITEM NOT AVAILABLE
# bar
# THIS ITEM NOT AVAILABLE
# {'foo': 'bar'}
# {'foo': 'bar', 'oops': 42}
| 29.805195 | 80 | 0.275817 | 131 | 2,295 | 4.305344 | 0.282443 | 0.074468 | 0.088652 | 0.106383 | 0.08156 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002136 | 0.183878 | 2,295 | 76 | 81 | 30.197368 | 0.298986 | 0.434423 | 0 | 0.125 | 0 | 0 | 0.043689 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.21875 | false | 0 | 0 | 0.125 | 0.53125 | 0.1875 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
1e2db8265d3a5d7415fa2f0c78530376361179bf | 15 | py | Python | eleanor/maxsector.py | benmontet/eleanor | 0d3644172638b350c8213d07224cd9c86b69d473 | [
"MIT"
] | null | null | null | eleanor/maxsector.py | benmontet/eleanor | 0d3644172638b350c8213d07224cd9c86b69d473 | [
"MIT"
] | null | null | null | eleanor/maxsector.py | benmontet/eleanor | 0d3644172638b350c8213d07224cd9c86b69d473 | [
"MIT"
] | null | null | null | maxsector = 38
| 7.5 | 14 | 0.733333 | 2 | 15 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 0.2 | 15 | 1 | 15 | 15 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1e41b4605330545d3fb704bf4c179870f3a981f0 | 552 | py | Python | objects/goal.py | Drako/Snake | ae54519d2f92a27bd073b848f004ca036bd38b4f | [
"MIT"
] | 1 | 2019-10-22T15:34:43.000Z | 2019-10-22T15:34:43.000Z | objects/goal.py | Drako/Snake | ae54519d2f92a27bd073b848f004ca036bd38b4f | [
"MIT"
] | null | null | null | objects/goal.py | Drako/Snake | ae54519d2f92a27bd073b848f004ca036bd38b4f | [
"MIT"
] | null | null | null | import pygame
from pygame.surface import Surface
from util import Rect, Point
from util.collisions import rect_contains_point
from util.colors import WHITE
from . import GameObject
class Goal(GameObject):
_area: Rect
def __init__(self, *, area: Rect):
self._area = area
def draw_to(self, draw_target: Surface):
pygame.draw.rect(draw_target, WHITE, self._area)
def __contains__(self, point: Point):
return rect_contains_point(self._area, point)
def move_to(self, area: Rect):
self._area = area
| 23 | 56 | 0.708333 | 76 | 552 | 4.868421 | 0.302632 | 0.12973 | 0.07027 | 0.086486 | 0.12973 | 0.12973 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208333 | 552 | 23 | 57 | 24 | 0.846682 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.375 | 0.0625 | 0.8125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1e51cb4ab739c91fdd05eacf673885d5dfa69987 | 98 | py | Python | misc/signals.py | ilblackdragon/django-misc | 0accd2dc97de656a1c9e275be81e817f78a2eb9d | [
"MIT"
] | 6 | 2015-05-13T14:56:30.000Z | 2019-06-27T13:24:04.000Z | misc/signals.py | ilblackdragon/django-misc | 0accd2dc97de656a1c9e275be81e817f78a2eb9d | [
"MIT"
] | null | null | null | misc/signals.py | ilblackdragon/django-misc | 0accd2dc97de656a1c9e275be81e817f78a2eb9d | [
"MIT"
] | null | null | null | from django.dispatch import Signal
language_changed = Signal(providing_args=['request', 'lang'])
| 24.5 | 61 | 0.785714 | 12 | 98 | 6.25 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091837 | 98 | 3 | 62 | 32.666667 | 0.842697 | 0 | 0 | 0 | 0 | 0 | 0.112245 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1e676843535d3d2f58287407ea3c39fef5a6f6b0 | 220 | py | Python | doc/python/client/hello-world-async-wait.py | cnangel/HyperDex | b272e85b08d232993baf6105a4beba833deadfe3 | [
"BSD-3-Clause"
] | 1 | 2016-08-10T07:53:58.000Z | 2016-08-10T07:53:58.000Z | doc/python/client/hello-world-async-wait.py | cnangel/HyperDex | b272e85b08d232993baf6105a4beba833deadfe3 | [
"BSD-3-Clause"
] | null | null | null | doc/python/client/hello-world-async-wait.py | cnangel/HyperDex | b272e85b08d232993baf6105a4beba833deadfe3 | [
"BSD-3-Clause"
] | null | null | null | import hyperdex.client
c = hyperdex.client.Client("127.0.0.1", 1982)
p = c.async_put("kv", "some key", {"v": "Hello World!"})
p.wait()
print 'put "Hello World!"'
g = c.async_get("kv", "some key")
print 'got:', g.wait()
| 24.444444 | 56 | 0.627273 | 39 | 220 | 3.487179 | 0.564103 | 0.205882 | 0.132353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052083 | 0.127273 | 220 | 8 | 57 | 27.5 | 0.65625 | 0 | 0 | 0 | 0 | 0 | 0.290909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.142857 | null | null | 0.285714 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1e6dfe20bde4bacb2a7d766f9dcc5b8c4f97cf97 | 74 | py | Python | python/testData/codeInsight/controlflow/typesinandbooleanexpression.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/codeInsight/controlflow/typesinandbooleanexpression.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/codeInsight/controlflow/typesinandbooleanexpression.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class A:
pass
var = object()
if isinstance(var, A) and var:
pass | 10.571429 | 30 | 0.608108 | 12 | 74 | 3.75 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.283784 | 74 | 7 | 31 | 10.571429 | 0.849057 | 0 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.4 | 0 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.