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
e20bf47ab8e2dbee6e9efd39685eed89d9f254e4
355
py
Python
Homework/week7/Base/Predict.py
zhufyaxel/ML_SaltyFish
84b839fa236c471e1fa8600093f0096ff79e4097
[ "MIT" ]
null
null
null
Homework/week7/Base/Predict.py
zhufyaxel/ML_SaltyFish
84b839fa236c471e1fa8600093f0096ff79e4097
[ "MIT" ]
null
null
null
Homework/week7/Base/Predict.py
zhufyaxel/ML_SaltyFish
84b839fa236c471e1fa8600093f0096ff79e4097
[ "MIT" ]
null
null
null
import os import numpy as np from keras.models import load_model def makePredict(arrayTest, strOutputFolder): strModelPath = os.path.join(strOutputFolder, "model.h5") model = load_model(strModelPath) predictions = model.predict(arrayTest[0], batch_size=256) predictions = (predictions > 0.5).astype(np.int) return predictions
23.666667
61
0.735211
44
355
5.863636
0.636364
0.069767
0
0
0
0
0
0
0
0
0
0.023729
0.169014
355
15
62
23.666667
0.850847
0
0
0
0
0
0.022472
0
0
0
0
0
0
1
0.111111
false
0
0.333333
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
0
0
0
1
0
1
0
0
2
35595d46cdc5f85893c3eef28f6d9f86bd21026c
2,197
py
Python
mf_analysis/financial_service.py
anardana/mf-analysis
23fdc4cf5d6751c6c6ace99a41bf2b14b3911a8c
[ "MIT" ]
null
null
null
mf_analysis/financial_service.py
anardana/mf-analysis
23fdc4cf5d6751c6c6ace99a41bf2b14b3911a8c
[ "MIT" ]
2
2017-09-20T04:54:14.000Z
2017-09-20T04:55:34.000Z
mf_analysis/financial_service.py
anardana/mf-analysis
23fdc4cf5d6751c6c6ace99a41bf2b14b3911a8c
[ "MIT" ]
null
null
null
from datetime import datetime from pprint import pprint from mf_analysis.coin_file_parse_service import parse, read_file from mf_analysis.financial import xirr from mf_analysis.headers import CoinExportHeaders def xirr_zerodha(transactions, final_date, final_amount): cashflow = [] for log in transactions: if log[CoinExportHeaders.status] == "Allotted": trade_date = datetime.strptime(log[CoinExportHeaders.trade_date], "%d/%m/%y") trade_amount = log[CoinExportHeaders.amount] cashflow.append((trade_date, 0 - float(trade_amount))) elif log[CoinExportHeaders.status] == "Redeemed": trade_date = datetime.strptime(log[CoinExportHeaders.trade_date], "%d/%m/%y") trade_amount = log[CoinExportHeaders.amount] cashflow.append((trade_date, float(trade_amount))) cashflow.append((datetime.strptime(final_date, "%d/%m/%y"), final_amount)) return xirr(cashflow) def xirr_zerodha_scheme_wise(isin, transactions, final_date, final_nav): cashflow = [] count = 0 for log in transactions: if log[CoinExportHeaders.isin] == isin: if log[CoinExportHeaders.status] == "Allotted": trade_date = datetime.strptime(log[CoinExportHeaders.trade_date], "%Y-%m-%d") trade_amount = log[CoinExportHeaders.amount] cashflow.append((trade_date, 0 - float(trade_amount))) count = count + float(log[CoinExportHeaders.units]) elif log[CoinExportHeaders.status] == "Redeemed": trade_date = datetime.strptime(log[CoinExportHeaders.trade_date], "%Y-%m-%d") trade_amount = log[CoinExportHeaders.amount] cashflow.append((trade_date, float(trade_amount))) count = count - float(log[CoinExportHeaders.units]) cashflow.append((datetime.strptime(final_date, "%Y-%m-%d"), (final_nav * count))) return xirr(cashflow) def zerodha_get_all_isin(transactions): isin = set() for transaction in transactions: isin.add(transaction[CoinExportHeaders.isin]) return isin pprint(xirr_zerodha(parse(read_file("<>")), "10/03/19", <>))
39.232143
93
0.67137
250
2,197
5.724
0.212
0.209644
0.069881
0.069881
0.630328
0.630328
0.575821
0.532495
0.532495
0.47659
0
0.005187
0.210287
2,197
55
94
39.945455
0.819597
0
0
0.536585
0
0
0.040965
0
0
0
0
0
0
0
null
null
0
0.121951
null
null
0.04878
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
0
0
0
0
0
0
2
35681b3722c9db7543167346fbd9f178620aaef4
570
py
Python
rltime/policies/torch/distributions/distribution_layer.py
frederikschubert/rltime
d1722ffd4cf7b4599655b8d9c64abc243919afc9
[ "Apache-2.0" ]
147
2019-09-05T10:41:15.000Z
2021-12-28T23:41:54.000Z
rltime/policies/torch/distributions/distribution_layer.py
frederikschubert/rltime
d1722ffd4cf7b4599655b8d9c64abc243919afc9
[ "Apache-2.0" ]
1
2020-10-18T14:55:53.000Z
2021-11-18T10:41:36.000Z
rltime/policies/torch/distributions/distribution_layer.py
frederikschubert/rltime
d1722ffd4cf7b4599655b8d9c64abc243919afc9
[ "Apache-2.0" ]
11
2019-09-08T09:18:28.000Z
2020-11-30T12:41:37.000Z
import torch class DistributionLayer(torch.nn.Module): """A distribution layer for action selection (e.g. for actor-critic)""" def __init__(self, action_space, input_size): """Initializes the distribution layer for the given action space and input_size (i.e. the output size of the model) """ super().__init__() def forward(self, x): """Returns the relevant pytorch distribution output for input x, which can be used for action selection and distribution data """ raise NotImplementedError
31.666667
76
0.668421
72
570
5.138889
0.597222
0.091892
0.108108
0
0
0
0
0
0
0
0
0
0.249123
570
17
77
33.529412
0.864486
0.52807
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
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
0
0
1
0
0
2
3582327548890280ef8aab72108c363bd7da1c89
1,902
py
Python
emr/emr/doctype/comisiones_doctores/comisiones_doctores.py
chabito79/EMR_ERP
6cc4f6592ef9962bece93d9cacbeef71fe26562a
[ "MIT" ]
null
null
null
emr/emr/doctype/comisiones_doctores/comisiones_doctores.py
chabito79/EMR_ERP
6cc4f6592ef9962bece93d9cacbeef71fe26562a
[ "MIT" ]
null
null
null
emr/emr/doctype/comisiones_doctores/comisiones_doctores.py
chabito79/EMR_ERP
6cc4f6592ef9962bece93d9cacbeef71fe26562a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Copyright (c) 2015, C0D1G0 B1NAR10 and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class ComisionesDoctores(Document): pass @frappe.whitelist() def corte(docname): fecha = frappe.get_doc("Comisiones Doctores", docname) # fecha_final = fecha.fecha_final frappe.db.sql(""" update `tabActual` a, `tabTreatment Plan` tp set a.comision_pagada = 1, a.comision_date= (%s) where tp.name = a.parent AND tp.paid = 1 AND a.status = "Finished" AND a.finished_date < (%s) AND tp.date_paid < (%s) AND a.comision_pagada = 0 """, (fecha.fecha_final, fecha.fecha_final, fecha.fecha_final)) # frappe.db.sql(""" update `tabActual` a, `tabTreatment Plan` tp set a.comision_pagada = 1, a.comision_date= %(fecha_final)s # where tp.name = a.parent AND tp.paid = 1 AND a.status = "Finished" AND a.finished_date < %(fecha_final)s AND tp.date_paid < %(fecha_final)s AND a.comision_pagada = 0 """) frappe.db.commit() frappe.db.sql(""" update `tabActual` a, `tabTreatment Plan` tp set a.comision_pagada = 1, a.comision_date= (%s) where tp.name = a.parent AND a.warranty = 1 AND a.status = "Finished" AND a.finished_date < (%s) AND a.comision_pagada = 0 """, (fecha.fecha_final, fecha.fecha_final)) frappe.db.commit() frappe.msgprint("Nomina Cerrada") # cosa = frappe.db.sql(""" update tabActual set comision_pagada = 1, comision_date="2016-12-08" where # (select actual.parent, # tp.patient_name, # actual.status, # actual.finished_date # from `tabActual` actual, `tabTreatment Plan` tp # where tp.name = "TP00301") # """, as_dict=True) # frappe.msgprint(cosa) # frappe.db.sql("""Update `tabItem` as item set default_bom = NULL where # not exists(select name from `tabBOM` as bom where item.default_bom = bom.name and bom.docstatus =1 )""")
52.833333
211
0.71346
288
1,902
4.583333
0.288194
0.075758
0.068182
0.064394
0.500758
0.443939
0.428788
0.428788
0.422727
0.422727
0
0.021538
0.145636
1,902
36
212
52.833333
0.790769
0.488959
0
0.266667
0
0.266667
0.522513
0
0
0
0
0
0
1
0.066667
false
0.066667
0.2
0
0.333333
0.066667
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
1
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
358ea14f1d003f4df0e95e419cdbc10c5b23c5a9
298
py
Python
tests/testapp/jobs/hourly/test_hourly_job.py
kaozdl/django-extensions
bbc3ae686d2cba9c0bb0a6b88f5e71ddf1a6af36
[ "MIT" ]
1
2019-12-22T23:37:28.000Z
2019-12-22T23:37:28.000Z
tests/testapp/jobs/hourly/test_hourly_job.py
kaozdl/django-extensions
bbc3ae686d2cba9c0bb0a6b88f5e71ddf1a6af36
[ "MIT" ]
2
2020-07-15T10:51:52.000Z
2020-07-15T12:52:28.000Z
tests/testapp/jobs/hourly/test_hourly_job.py
kaozdl/django-extensions
bbc3ae686d2cba9c0bb0a6b88f5e71ddf1a6af36
[ "MIT" ]
3
2020-08-07T16:16:54.000Z
2020-10-12T18:06:35.000Z
# -*- coding: utf-8 -*- from django_extensions.management.jobs import HourlyJob try: from unittest import mock except ImportError: import mock HOURLY_JOB_MOCK = mock.MagicMock() class Job(HourlyJob): help = "My sample hourly job." def execute(self): HOURLY_JOB_MOCK()
16.555556
55
0.694631
38
298
5.315789
0.657895
0.133663
0.128713
0
0
0
0
0
0
0
0
0.004237
0.208054
298
17
56
17.529412
0.851695
0.07047
0
0
0
0
0.076364
0
0
0
0
0
0
1
0.1
false
0
0.4
0
0.7
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
0
0
1
0
1
0
0
2
359bf62789e8fc6f25281d954b1059feb860912a
225
py
Python
util/inputReader.py
sree-cfa/adventOfCode
0dffcf2b6668a37505afeedd0869f7ae2b5b93cf
[ "BSD-3-Clause" ]
null
null
null
util/inputReader.py
sree-cfa/adventOfCode
0dffcf2b6668a37505afeedd0869f7ae2b5b93cf
[ "BSD-3-Clause" ]
null
null
null
util/inputReader.py
sree-cfa/adventOfCode
0dffcf2b6668a37505afeedd0869f7ae2b5b93cf
[ "BSD-3-Clause" ]
null
null
null
def read_as_strings(filename): f = open(filename, "r") res = f.read().split("\n") return res def read_as_ints(filename): f = open(filename, "r") res = map(int, f.read().split("\n")) return list(res)
20.454545
40
0.591111
35
225
3.685714
0.457143
0.108527
0.139535
0.325581
0.651163
0.387597
0
0
0
0
0
0
0.217778
225
10
41
22.5
0.732955
0
0
0.25
0
0
0.026667
0
0
0
0
0
0
1
0.25
false
0
0
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
0
0
0
0
0
0
0
2
35b001e1a976a44a7bdb9f0ced58239879a732bd
517
py
Python
curso em video/python/mundo 2/ex 067.py
KenzoDezotti/cursoemvideo
6eba03e67192f7384092192ed2cc1a8e59efd9b9
[ "MIT" ]
null
null
null
curso em video/python/mundo 2/ex 067.py
KenzoDezotti/cursoemvideo
6eba03e67192f7384092192ed2cc1a8e59efd9b9
[ "MIT" ]
null
null
null
curso em video/python/mundo 2/ex 067.py
KenzoDezotti/cursoemvideo
6eba03e67192f7384092192ed2cc1a8e59efd9b9
[ "MIT" ]
null
null
null
#num1 = int(input('qual tabuada você deseja?')) #num2 = 1 #while True: # if num1 <= 0: # break # print(f'{num2} X {num1} ={num2*num1}') # num2 += 1 # if num2>=11: # num1 = int(input('qual tabuada você deseja?')) # num2 = 1 #print('programa encerrado!') while True: num1 = int(input('qual tabuada você deseja?')) if num1 < 0: break print(30 * '-') for c in range(1,11): print(f'{num1} X {c} = {c*num1}') print(30*'-') print('programa encerrado')
25.85
55
0.533849
72
517
3.833333
0.347222
0.076087
0.130435
0.173913
0.518116
0.394928
0.394928
0.275362
0.275362
0
0
0.07754
0.276596
517
20
56
25.85
0.660428
0.510638
0
0.222222
0
0
0.279835
0
0
0
0
0
0
1
0
false
0
0
0
0
0.444444
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
0
0
0
1
0
2
35b9dae75fa67670875f1d37fc818d54438b90ed
15,330
py
Python
celltk/utils/utils.py
sjeknic/CellST
1c57789f9deccca62b3f0aaad07c5a006801b1fd
[ "MIT" ]
null
null
null
celltk/utils/utils.py
sjeknic/CellST
1c57789f9deccca62b3f0aaad07c5a006801b1fd
[ "MIT" ]
32
2022-01-23T19:47:29.000Z
2022-03-16T16:04:11.000Z
celltk/utils/utils.py
sjeknic/CellTK
205e2c14a7647703247d24b1b68c97fc9b3494d5
[ "MIT" ]
null
null
null
import sys import os import functools import itertools import contextlib import warnings import logging import inspect import typing from copy import deepcopy from typing import Tuple, Generator, Dict from collections import Counter import numpy as np from celltk.utils._types import (Image, Mask, Track, ImageContainer, INPT, INPT_NAMES) from celltk.core.arrays import ConditionArray, ExperimentArray from celltk.utils.operation_utils import sliding_window_generator from celltk.utils.log_utils import get_null_logger # Functions to block output to Terminal def fileno(file_or_fd): fd = getattr(file_or_fd, 'fileno', lambda: file_or_fd)() if not isinstance(fd, int): raise ValueError("Expected a file (`.fileno()`) or a file descriptor") return fd @contextlib.contextmanager def stdout_redirected(to=os.devnull, stdout=None): """ https://stackoverflow.com/a/22434262/190597 (J.F. Sebastian) Context manager to redirect outputs from non-CellST funcs to os.devnull """ if stdout is None: stdout = sys.stdout stdout_fd = fileno(stdout) # copy stdout_fd before it is overwritten with os.fdopen(os.dup(stdout_fd), 'wb') as copied: stdout.flush() # flush library buffers that dup2 knows nothing about try: os.dup2(fileno(to), stdout_fd) # $ exec >&to except ValueError: # filename with open(to, 'wb') as to_file: os.dup2(to_file.fileno(), stdout_fd) # $ exec > to try: yield stdout # allow code to be run with the redirected stdout finally: # restore stdout to its previous value # NOTE: dup2 makes stdout_fd inheritable unconditionally stdout.flush() os.dup2(copied.fileno(), stdout_fd) # $ exec >&copied class ImageHelper(): """ Decorator to help with passing only the correct image stacks to functions TODO: - Pass default args if no user input. See: https://stackoverflow.com/questions/12627118/get-a-function-arguments-default-value - Remove self.expected_types, self.expected_names, self.expected_numbers """ __name__ = 'ImageHelper' def __init__(self, *, by_frame: bool = False, as_tuple: bool = False, dtype: type = None, ) -> None: """ """ # Save inputs self.by_frame = by_frame self.dtype = dtype self.as_tuple = as_tuple def __call__(self, func): # Save information about the function from the signature self.func = func try: self._parse_type_hints() except KeyError: raise KeyError(f'Type hints are missing for function {self.func}') @functools.wraps(self.func) def wrapper(*args, **kwargs): # Sort args and kwargs into the respective values if isinstance(args[0], ImageContainer): # If first value is not self or class, then staticmethod img_container = deepcopy(args[0]) calling_cls = [] else: calling_cls = [args[0]] img_container = deepcopy(args[1]) self.logger = self._get_calling_logger(calling_cls) self.logger.info(f'ImageHelper called for {self.func.__name__}') self.logger.info(f'by_frame: {self.by_frame}, ' f'as_tuple: {self.as_tuple}, dtype: {self.dtype}') # Sort the inputs and keep only those that are relevant keys, pass_to_func, nkwargs = self._type_helper(img_container, **kwargs) # Function expects and returns a stack. if not self.by_frame or not pass_to_func: # Pass all inputs together stack = self.func(*calling_cls, **pass_to_func, **nkwargs) else: # Pass inputs individually stack = self._pass_by_frames(pass_to_func, calling_cls, **nkwargs) # Get the correct outputs and keys before returning keys, stack = self._correct_outputs(keys, stack, calling_cls) return keys, stack return wrapper def _parse_type_hints(self): """ TODO: - This whole type checker has turned a bit unweildly. I don't like using both inspect and typing.get_type_hints. Seems a little redundant. However, I'm doing it now to mark whether a parameter is optional. """ # NOTE: self/cls is not included in these type hints self.type_hints = typing.get_type_hints(self.func) # Save as type object, not __name__ self.output_type = self.type_hints.pop('return') # Expected names and types are for CellTK types only self.expected_names = [] self.expected_types = [] # Go through type hints and see if CellTK type for key, val in self.type_hints.items(): arg_types = typing.get_args(val) # returns () if not Union if not arg_types: arg_types = (val,) for a in arg_types: if a in INPT: self.expected_names.append(key) self.expected_types.append(a.__name__) # If it was a union type, then self.type_hints should # also get overwritten for _type_helper self.type_hints[key] = a # Skip all remaining in Union break # Mark optional parameters. Don't get loaded unless user specifies # to load something. _signature = inspect.signature(self.func).parameters self.expected_optional = [param.default is not param.empty for param in _signature.values() if param.name in self.expected_names] # Update the number of each Stack type that is expected self.expected_numbers = dict(Counter(self.expected_types)) self.expected_numbers.update({k: 0 for k in INPT_NAMES if k not in self.expected_types}) def _type_helper(self, img_container, **kwargs): """ This func is for sorting the input types and selecting the correct types that should get passed to the function. """ # Check for what the function expects. Include plurals for the name inpt_bools = [(i in self.expected_types) for i in INPT_NAMES] self.logger.info('Function accepts: ' f'{[i for i, b in zip(INPT_NAMES, inpt_bools) if b]}') # Assign images from img_container to kwargs kwargs = self._name_helper(img_container, **kwargs) # Sort stacks into pass_to_func and save expected keys/sizes/types pass_to_func = {} keys = [] inpt_size_type = [] for kw, val in kwargs.items(): # Check that this kw is for a Stack try: assert self.type_hints[kw].__name__ in INPT_NAMES except (AttributeError, AssertionError): # Indicates not CellTK type continue except KeyError as e: raise KeyError(f'Invalid keyword arg for {self.func}: {e}') if self.as_tuple: # No trimming of inputs is done if as_tuple if val: key, stack = zip(*val) pass_to_func[kw] = tuple(stack) keys.extend(key) inpt_size_type.extend([(s.shape, s.dtype) for s in stack]) else: # NOTE: This will overwrite default args. see TODO pass_to_func[kw] = tuple([]) else: if val: # Pass only one stack, last one in list is newest key, stack = val.pop() pass_to_func[kw] = stack keys.append(key) inpt_size_type.append((stack.shape, stack.dtype)) self.logger.info(f'Selected inputs: {list(zip(keys, inpt_size_type))} ' f'for kwargs: {list(pass_to_func.keys())}') # Remove inputs that are in pass_to_func so they don't get passed twice kwargs = {k: v for k, v in kwargs.items() if k not in pass_to_func} return keys, pass_to_func, kwargs def _name_helper(self, img_container, **kwargs): """ Finds images the user specified using kwargs """ # Load any names the user supplied in kwargs kwargs_to_load = [(n, t) for n, t in zip(self.expected_names, self.expected_types) if t in INPT_NAMES and n in kwargs] for kw, exp_typ in kwargs_to_load: # Get the user input names = kwargs[kw] if names is None: # User does not want any image passed names = [] elif isinstance(names, str): # Append the expected type to the name names = [(names, exp_typ)] else: # First image given is first image passed names = [(nm, exp_typ) for nm in names] if not self.as_tuple: warnings.warn('Multiple stacks for a single keyword ' f'argument is not supported for {self.func}.' f'Only {names[0]} will get passed.', UserWarning) # Load the stacks from img_container and add to kwargs try: # Keep key with image for tracking purposes kwargs[kw] = [] for n in names: kwargs[kw].append((n, img_container.pop(n))) except KeyError: raise KeyError(f'Could not find input {n}.') # For unspecified args, load a single list for each type # Oldest stack is first, newest is last img_lists = {i: [(k, v) for k, v in img_container.items() if k[1] == i] for i in INPT_NAMES} # Load stack lists to kwargs _zip = zip(self.expected_names, self.expected_types, self.expected_optional) for exp_name, exp_typ, opt in _zip: if (not opt) * (exp_typ in INPT_NAMES) * (exp_name not in kwargs): if img_lists[exp_typ]: kwargs[exp_name] = img_lists[exp_typ] return kwargs def _correct_outputs(self, keys, stack, calling_cls=[]): """Ensures keys and stack match and are in expected format""" # Store keys as list if not already if isinstance(keys[0], str): keys = [keys] # If output_type is "same" out_type = in_type, else defined by function if self.output_type.__name__ != 'same': keys = [(k[0], self.output_type.__name__) for k in keys] # Store stack as list if not already if isinstance(stack, np.ndarray): stack = [stack] elif isinstance(stack, tuple): stack = list(stack) elif isinstance(stack, (ConditionArray, ExperimentArray)): stack = [stack] # Assume only one output key - set to output id try: keys = [calling_cls[0].output_id] except IndexError: # The method was a staticmethod use first key and warn user keys = [keys[0]] warnings.warn('Possible mismatch with keys for ', f'for {self.func.__name__}.') # Check that length matches if len(stack) < len(keys): # TODO: This doesn't work with Same type output yet # If fewer images than keys, try to match by type same_type_keys = [k for k in keys if k[1] == self.output_type.__name__] same_type_keys = same_type_keys[:len(stack)] if len(same_type_keys) < len(stack): # Not enough of same type keys = keys[:len(stack)] else: keys = same_type_keys elif len(stack) > len(keys): # Returned more images than inpupts... Will deal with if it happens raise ValueError(f'Length of outputs ({len(stack)}) longer ' f'than length of keys ({len(keys)}).') # Adjust array dimensions if needed for n, (k, st) in enumerate(zip(keys, stack)): while st.ndim < 3 and any([i in k for i in (Image, Mask, Track)]): st = np.expand_dims(st, axis=-1) stack[n] = st return keys, stack def _get_calling_logger(self, calling_cls): """ Gets the operation logger to record info about inputs and outputs """ if calling_cls: try: logger = calling_cls[0].logger return logging.getLogger(f'{logger.name}.{self.__name__}') except AttributeError: return get_null_logger() def _pass_by_frames(self, pass_to_func: Dict, calling_cls: Tuple, **kwargs ) -> np.ndarray: """ Creates output array and passes individual frames to func TODO: - Is it okay to convert float64 -> float32? or int32 -> int16 """ # Get window generators for each array in pass_to_func if self.as_tuple: out_shape = next(iter(pass_to_func.values()))[0].shape windows = {p: self._multiple_sliding_windows(v) for p, v in pass_to_func.items()} _fv = tuple([]) else: out_shape = next(iter(pass_to_func.values())).shape windows = {p: sliding_window_generator(v) for p, v in pass_to_func.items()} _fv = None # zip_longest in case some stacks aren't found # wrapped function should raise an error if this is a problem for fr, win in enumerate(itertools.zip_longest(*windows.values(), fillvalue=_fv)): new_win = dict(zip(pass_to_func.keys(), win)) res = self.func(*calling_cls, **new_win, **kwargs) if not fr: # If first frame, make the output array out_shape = (out_shape[0], *res.shape) out = np.empty(out_shape, dtype=res.dtype) out[fr, ...] = res return out def _multiple_sliding_windows(self, arrs: Tuple[np.ndarray]) -> Generator: """ Generates tuple with single frames from each np.ndarray """ # Make generator for each window windows = [] for arr in arrs: windows.append(sliding_window_generator(arr)) # Yield from all generators simultaneously yield from zip(*windows)
39.715026
91
0.557665
1,877
15,330
4.396377
0.214172
0.015269
0.024237
0.007271
0.078405
0.036355
0.030053
0.013815
0.006059
0.006059
0
0.005324
0.362883
15,330
385
92
39.818182
0.839562
0.252577
0
0.119658
0
0
0.06626
0.006913
0
0
0
0.012987
0.008547
1
0.051282
false
0.081197
0.07265
0
0.17094
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
0
0
1
0
0
0
0
0
2
35bfc52e2432009638337048a3b37232a52bde1e
5,337
py
Python
messari/blockexplorers/optimisticetherscan/optimisticetherscan.py
messari/messari-python-api-private
b027b691b570bc804e4b55a95cf1046ed1dbde86
[ "MIT" ]
2
2022-03-16T06:28:57.000Z
2022-03-22T19:48:22.000Z
messari/blockexplorers/optimisticetherscan/optimisticetherscan.py
messari/messari-python-api-private
b027b691b570bc804e4b55a95cf1046ed1dbde86
[ "MIT" ]
2
2022-01-06T07:28:23.000Z
2022-01-31T03:55:20.000Z
messari/blockexplorers/optimisticetherscan/optimisticetherscan.py
messari/messari-python-api-private
b027b691b570bc804e4b55a95cf1046ed1dbde86
[ "MIT" ]
2
2022-03-16T06:29:00.000Z
2022-03-25T09:03:20.000Z
"""This module is meant to contain the OptimisticEtherscan class""" from typing import Union, List import pandas as pd from messari.blockexplorers import Scanner from messari.utils import validate_input BASE_URL='https://api-optimistic.etherscan.io/api' # Reference: https://optimistic.etherscan.io/apis class OptimisticEtherscan(Scanner): """This class is a wrapper around the OptimisticEtherscan API """ def __init__(self, api_key: str=None): Scanner.__init__(self, base_url=BASE_URL, api_key=api_key) ##### Accounts def get_account_l1_deposits(self, accounts_in: Union[str, List], ascending:bool=True) -> pd.DataFrame: accounts = validate_input(accounts_in) sort = 'asc' if ascending else 'desc' df_list=[] for account in accounts: params = {'module': 'account', 'action': 'getdeposittx', 'address': account, 'sortorder': sort} params.update(self.api_dict) response = self.get_response(self.BASE_URL, params=params)['result'] tmp_df = pd.DataFrame(response) df_list.append(tmp_df) deposits_df = pd.concat(df_list, keys=accounts, axis=1) return deposits_df def get_account_l2_withdrawals(self, accounts_in: Union[str, List], ascending:bool=True) -> pd.DataFrame: accounts = validate_input(accounts_in) # NOTE: sort may not be an argument sort = 'asc' if ascending else 'desc' df_list=[] for account in accounts: params = {'module': 'account', 'action': 'getwithdrawaltx', 'address': account, 'sortorder': sort} params.update(self.api_dict) response = self.get_response(self.BASE_URL, params=params)['result'] tmp_df = pd.DataFrame(response) df_list.append(tmp_df) deposits_df = pd.concat(df_list, keys=accounts, axis=1) return deposits_df #TODO: missing a lot? ##### Contracts # NOTE: no changes ##### Transactions def get_contract_execution_status(self, transactions_in: Union[str, List]) -> pd.DataFrame: """Override: return None """ return None def get_transaction_execution_status(self, transactions_in: Union[str, List]) -> pd.DataFrame: """Override: return None """ return None ##### Blocks def get_block_reward(self, blocks_in: Union[int, List]) -> pd.DataFrame: """Override: return None """ return None def get_block_countdown(self, blocks_in: Union[int, List]) -> pd.DataFrame: """Override: return None """ return None def get_block_by_timestamp(self, times_in: Union[int, List], before: bool=True) -> pd.DataFrame: """Override: return None """ return None ##### Logs def get_logs(self, address: str, from_block: Union[int, str], to_block: Union[int, str]='latest', topic0: str=None, topic1: str=None, topic2: str=None, topic3: str=None, topic0_1_opr: str=None, topic1_2_opr: str=None, topic2_3_opr: str=None, topic0_2_opr: str=None, topic0_3_opr: str=None, topic1_3_opr: str=None) -> pd.DataFrame: """Override: return None """ return None ##### Geth/Parity Proxy def get_eth_block_number(self): """Override: return None """ return None def get_eth_block(self, blocks_in: Union[int, List]): """Override: return None """ return None def get_eth_uncle(self, block: int, index: int): """Override: return None """ return None def get_eth_block_transaction_count(self, blocks_in: Union[int, List]): """Override: return None """ return None def get_eth_transaction_by_hash(self, transactions_in: Union[str, List]): """Override: return None """ return None def get_eth_transaction_by_block_index(self, block: int, index: int): """Override: return None """ return None def get_eth_account_transaction_count(self, accounts_in: Union[str, List]): """Override: return None """ return None def get_eth_transaction_receipt(self, transactions_in: Union[str, List]): """Override: return None """ return None def get_eth_gas_price(self): """Override: return None """ return None ##### Tokens # NOTE: no changes ##### Gas Tracker def get_est_confirmation(self, gas_price: int): """Override: return None """ return None def get_gas_oracle(self): """Override: return None """ return None ##### Stats def get_total_eth_supply(self) -> int: """Returns the current amount of ETH (Wei) in circulation on optimism """ params = {'module': 'stats', 'action': 'optimismsupply'} params.update(self.api_dict) response = self.get_response(self.BASE_URL, params=params)['result'] return int(response)
31.958084
109
0.589657
618
5,337
4.88835
0.229773
0.112546
0.101291
0.135055
0.602781
0.602781
0.576299
0.55048
0.538232
0.522675
0
0.005338
0.29792
5,337
166
110
32.150602
0.800907
0.178377
0
0.523256
0
0
0.048406
0
0
0
0
0.006024
0
1
0.244186
false
0
0.046512
0
0.534884
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
0
1
0
0
2
35c19c0a977eae05ce38f237600c4c2baee780ed
1,957
py
Python
demisto_sdk/commands/common/content/objects/abstract_objects/dictionary_based_object.py
SergeBakharev/demisto-sdk
17d00942a1bd33039a8aba9ddffecfd81008d275
[ "MIT" ]
null
null
null
demisto_sdk/commands/common/content/objects/abstract_objects/dictionary_based_object.py
SergeBakharev/demisto-sdk
17d00942a1bd33039a8aba9ddffecfd81008d275
[ "MIT" ]
null
null
null
demisto_sdk/commands/common/content/objects/abstract_objects/dictionary_based_object.py
SergeBakharev/demisto-sdk
17d00942a1bd33039a8aba9ddffecfd81008d275
[ "MIT" ]
null
null
null
from abc import abstractmethod from typing import Any, Dict, Optional, Union from wcmatch.pathlib import Path import demisto_sdk.commands.common.content.errors as exc from .general_object import GeneralObject class DictionaryBasedObject(GeneralObject): def __init__(self, path: Union[Path, str], file_name_prefix: str = ""): super().__init__(path, file_name_prefix) self._as_dict: Dict[str, Any] = {} @abstractmethod def _unserialize(self): pass def to_dict(self) -> dict: """Parse object file content to dictionary.""" if not self._as_dict: self._unserialize() return self._as_dict def __getitem__(self, key: str) -> Any: """Get value by key from object file. Args: key: Key in file to retrieve. Returns: object: key value. Raises: ContentKeyError: If key not exists. """ try: value = self.to_dict()[key] except KeyError: raise exc.ContentKeyError(self, self.path, key=key) return value def __setitem__(self, key: str, value: Any) -> None: self.to_dict()[key] = value def get(self, key: str, default: Optional[Any] = None) -> Any: """Safe get value by key from object file. Args: key: Key in file to retrieve. default: Deafult value to return if key not exists - If not specified return None. Returns: object: key value. """ try: value = self.__getitem__(key) except exc.ContentKeyError: value = default return value def get_id(self): as_dict = self.to_dict() if 'commonfields' in as_dict.keys(): return as_dict.get('commonfields', {}).get('id') else: return as_dict.get('id') def __contains__(self, item): return item in self._as_dict
26.093333
94
0.591211
237
1,957
4.675105
0.291139
0.043321
0.045126
0.025271
0.095668
0.095668
0.095668
0.095668
0.095668
0.095668
0
0
0.313235
1,957
74
95
26.445946
0.824405
0.203884
0
0.105263
0
0
0.019499
0
0
0
0
0
0
1
0.210526
false
0.026316
0.131579
0.026316
0.526316
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
0
1
0
0
2
ea001e44efe18f06c7050ab4e088cd0abdf23129
4,932
py
Python
analysis/tensorflow/fast_em.py
LinziJay/rappor
d524e2059947657198f1a232e13efd59f2047dae
[ "Apache-2.0" ]
797
2015-01-11T12:16:14.000Z
2022-03-20T08:47:06.000Z
analysis/tensorflow/fast_em.py
Jason-Cooke/rappor
a13fa964edb7c576366c83f40ff58d7c8c1db759
[ "Apache-2.0" ]
56
2015-01-15T23:06:37.000Z
2022-01-24T07:31:58.000Z
analysis/tensorflow/fast_em.py
Jason-Cooke/rappor
a13fa964edb7c576366c83f40ff58d7c8c1db759
[ "Apache-2.0" ]
174
2015-01-10T16:00:18.000Z
2022-03-20T08:47:01.000Z
#!/usr/bin/python """ fast_em.py: Tensorflow implementation of expectation maximization for RAPPOR association analysis. TODO: - Use TensorFlow ops for reading input (so that reading input can be distributed) - Reduce the number of ops (currently proportional to the number of reports). May require new TensorFlow ops. - Fix performance bug (v_split is probably being recomputed on every iteration): bin$ ./test.sh decode-assoc-cpp - 1.1 seconds (single-threaded C++) bin$ ./test.sh decode-assoc-tensorflow - 226 seconds on GPU """ import sys import numpy as np import tensorflow as tf def log(msg, *args): if args: msg = msg % args print >>sys.stderr, msg def ExpectTag(f, expected): """Read and consume a 4 byte tag from the given file.""" b = f.read(4) if b != expected: raise RuntimeError('Expected %r, got %r' % (expected, b)) def ReadListOfMatrices(f): """ Read a big list of conditional probability matrices from a binary file. """ ExpectTag(f, 'ne \0') num_entries = np.fromfile(f, np.uint32, count=1)[0] log('Number of entries: %d', num_entries) ExpectTag(f, 'es \0') entry_size = np.fromfile(f, np.uint32, count=1)[0] log('Entry size: %d', entry_size) ExpectTag(f, 'dat\0') vec_length = num_entries * entry_size v = np.fromfile(f, np.float64, count=vec_length) log('Values read: %d', len(v)) log('v: %s', v[:10]) #print 'SUM', sum(v) # NOTE: We're not reshaping because we're using one TensorFlow tensor object # per matrix, since it makes the algorithm expressible with current # TensorFlow ops. #v = v.reshape((num_entries, entry_size)) return num_entries, entry_size, v def WriteTag(f, tag): if len(tag) != 3: raise AssertionError("Tags should be 3 bytes. Got %r" % tag) f.write(tag + '\0') # NUL terminated def WriteResult(f, num_em_iters, pij): WriteTag(f, 'emi') emi = np.array([num_em_iters], np.uint32) emi.tofile(f) WriteTag(f, 'pij') pij.tofile(f) def DebugSum(num_entries, entry_size, v): """Sum the entries as a sanity check.""" cond_prob = tf.placeholder(tf.float64, shape=(num_entries * entry_size,)) debug_sum = tf.reduce_sum(cond_prob) with tf.Session() as sess: s = sess.run(debug_sum, feed_dict={cond_prob: v}) log('Debug sum: %f', s) def BuildEmIter(num_entries, entry_size, v): # Placeholder for the value from the previous iteration. pij_in = tf.placeholder(tf.float64, shape=(entry_size,)) # split along dimension 0 # TODO: # - make sure this doesn't get run for every EM iteration # - investigate using tf.tile() instead? (this may cost more memory) v_split = tf.split(0, num_entries, v) z_numerator = [report * pij_in for report in v_split] sum_z = [tf.reduce_sum(report) for report in z_numerator] z = [z_numerator[i] / sum_z[i] for i in xrange(num_entries)] # Concat per-report tensors and reshape. This is probably inefficient? z_concat = tf.concat(0, z) z_concat = tf.reshape(z_concat, [num_entries, entry_size]) # This whole expression represents an EM iteration. Bind the pij_in # placeholder, and get a new estimation of Pij. em_iter_expr = tf.reduce_sum(z_concat, 0) / num_entries return pij_in, em_iter_expr def RunEm(pij_in, entry_size, em_iter_expr, max_em_iters, epsilon=1e-6): """Run the iterative EM algorithm (using the TensorFlow API). Args: num_entries: number of matrices (one per report) entry_size: total number of cells in each matrix v: numpy.ndarray (e.g. 7000 x 8 matrix) max_em_iters: maximum number of EM iterations Returns: pij: numpy.ndarray (e.g. vector of length 8) """ # Initial value is the uniform distribution pij = np.ones(entry_size) / entry_size i = 0 # visible outside loop # Do EM iterations. with tf.Session() as sess: for i in xrange(max_em_iters): print 'PIJ', pij new_pij = sess.run(em_iter_expr, feed_dict={pij_in: pij}) dif = max(abs(new_pij - pij)) log('EM iteration %d, dif = %e', i, dif) pij = new_pij if dif < epsilon: log('Early EM termination: %e < %e', max_dif, epsilon) break # If i = 9, then we did 10 iteratinos. return i + 1, pij def sep(): print '-' * 80 def main(argv): input_path = argv[1] output_path = argv[2] max_em_iters = int(argv[3]) sep() with open(input_path) as f: num_entries, entry_size, cond_prob = ReadListOfMatrices(f) sep() DebugSum(num_entries, entry_size, cond_prob) sep() pij_in, em_iter_expr = BuildEmIter(num_entries, entry_size, cond_prob) num_em_iters, pij = RunEm(pij_in, entry_size, em_iter_expr, max_em_iters) sep() log('Final Pij: %s', pij) with open(output_path, 'wb') as f: WriteResult(f, num_em_iters, pij) log('Wrote %s', output_path) if __name__ == '__main__': try: main(sys.argv) except RuntimeError, e: print >>sys.stderr, 'FATAL: %s' % e sys.exit(1)
27.248619
79
0.680454
792
4,932
4.089646
0.320707
0.052794
0.046311
0.05866
0.168879
0.082433
0.041988
0.041988
0.041988
0.024082
0
0.013685
0.199919
4,932
180
80
27.4
0.807146
0.153487
0
0.067416
0
0
0.077097
0
0
0
0
0.011111
0.011236
0
null
null
0
0.033708
null
null
0.044944
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
1
0
0
0
0
0
0
0
0
2
ea0d7fe0f7bc8761e696d3f189cd92cd7f9fc862
160
py
Python
samples/tutorial/05_getting_results/hello_output.py
crest-cassia/caravan
0a8e606e31d2d36a9379bdc00fafe55cf9144da6
[ "MIT" ]
4
2017-12-27T06:04:46.000Z
2018-04-27T04:07:49.000Z
samples/tutorial/05_getting_results/hello_output.py
crest-cassia/caravan
0a8e606e31d2d36a9379bdc00fafe55cf9144da6
[ "MIT" ]
null
null
null
samples/tutorial/05_getting_results/hello_output.py
crest-cassia/caravan
0a8e606e31d2d36a9379bdc00fafe55cf9144da6
[ "MIT" ]
null
null
null
from caravan import Server,Task with Server.start(): t = Task.create("echo '[1.0,2.0,3.0]' > _output.json") Server.await_task(t) print(t.output())
22.857143
58
0.64375
27
160
3.740741
0.666667
0
0
0
0
0
0
0
0
0
0
0.045113
0.16875
160
6
59
26.666667
0.714286
0
0
0
0
0
0.21875
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.2
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
0
0
0
2
ea1050a4129346efe906b6e66c6ca278778c4bba
3,027
py
Python
beacon/nn/init.py
dusanerdeljan/beacon
be0bfc324ed2def9fb5d39be39f346b914b73686
[ "MIT" ]
10
2020-04-17T20:26:22.000Z
2021-10-14T03:17:53.000Z
beacon/nn/init.py
dusanerdeljan/beacon
be0bfc324ed2def9fb5d39be39f346b914b73686
[ "MIT" ]
null
null
null
beacon/nn/init.py
dusanerdeljan/beacon
be0bfc324ed2def9fb5d39be39f346b914b73686
[ "MIT" ]
2
2020-10-15T12:05:08.000Z
2022-01-23T15:42:36.000Z
import numpy as np def normal(shape: tuple): """ Normal initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import normal t = Tensor(data=normal(shape=(5, 3))) ``` """ return np.random.normal(size=shape) def uniform(shape: tuple): """ Uniform initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import uniform t = Tensor(data=uniform(shape=(5, 3))) ``` """ return np.random.uniform(size=shape) def xavier_normal(shape: tuple): """ Xavier normal initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import xavier_normal t = Tensor(data=xavier_normal(shape=(5, 3))) ``` """ factor = 2.0 * np.sqrt(6.0 / (shape[0]*shape[1])) return factor * normal(shape) def xavier_uniform(shape: tuple): """ Xavier uniform initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import xavier_uniform t = Tensor(data=xavier_uniform(shape=(5, 3))) ``` """ factor = 2.0 * np.sqrt(6.0 / (shape[0]*shape[1])) return factor * uniform(shape) def lecun_normal(shape: tuple): """ LeCun normal initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import lecun_normal t = Tensor(data=lecun_normal(shape=(5, 3))) ``` """ factor = 1.0 / np.sqrt(shape[1]) return factor * normal(shape) def lecun_uniform(shape: tuple): """ LeCun uniform initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import lecun_uniform t = Tensor(data=lecun_uniform(shape=(5, 3))) ``` """ factor = 2.0 * np.sqrt(3.0 / shape[1]) return factor * uniform(shape) def he_normal(shape: tuple): """ He normal initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import he_normal t = Tensor(data=he_normal(shape=(5, 3))) ``` """ factor = np.sqrt(2.0 / shape[1]) return factor * normal(shape) def he_uniform(shape: tuple): """ He uniform initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import he_uniform t = Tensor(data=he_uniform(shape=(5, 3))) ``` """ factor = 2.0 * np.sqrt(6.0 / shape[1]) return factor * uniform(shape) def zeros(shape: tuple): """ Zeros initializer. ## Parameters shape: `tuple` - shape of inputs tensor ## Example usage ```python from beacon.nn.init import zeros t = Tensor(data=zeros(shape=(5, 3))) ``` """ return np.zeros(shape)
21.316901
53
0.598612
383
3,027
4.684073
0.099217
0.100334
0.130435
0.155518
0.729654
0.696767
0.673356
0.655518
0.586399
0.570792
0
0.020517
0.259333
3,027
142
54
21.316901
0.779661
0.566568
0
0.32
0
0
0
0
0
0
0
0
0
1
0.36
false
0
0.04
0
0.76
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
0
1
0
0
2
ea1c71389b2dee6b678bbc3b8357e490aaae0f4c
204
py
Python
Raspberry code for recieving data from Arduino and sending to Firebase/serial_test.py
Naman1997/tarp-serial-connection-code
fbe9e079b4016c980d86e8f42dba804cd95d02e8
[ "MIT" ]
5
2019-07-15T13:09:18.000Z
2021-01-31T22:50:16.000Z
Raspberry code for recieving data from Arduino and sending to Firebase/serial_test.py
Naman1997/VAAK-firebase-arduino-python-serial-comunication
fbe9e079b4016c980d86e8f42dba804cd95d02e8
[ "MIT" ]
3
2019-03-27T13:13:32.000Z
2019-03-27T14:45:23.000Z
Raspberry code for recieving data from Arduino and sending to Firebase/serial_test.py
Naman1997/VAAK-firebase-arduino-python-serial-comunication
fbe9e079b4016c980d86e8f42dba804cd95d02e8
[ "MIT" ]
3
2019-03-27T12:59:46.000Z
2019-03-27T13:52:22.000Z
# This file is to test if your arduino is able to send data to your RPi serially import serial ser = serial.Serial('/dev/ttyACM0',9600) while True: read_serial=ser.readline() print read_serial
20.4
80
0.735294
34
204
4.352941
0.705882
0.121622
0
0
0
0
0
0
0
0
0
0.030303
0.191176
204
9
81
22.666667
0.866667
0.382353
0
0
0
0
0.096774
0
0
0
0
0
0
0
null
null
0
0.2
null
null
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
1
0
0
0
0
0
0
0
0
2
ea1eacedd91a0e87dac1e0574e709791bb2c8897
393
py
Python
app/models/Movie.py
samousli/ikiru
4a4a002db398dd7ba1b112ea406c92b0a8cb6c37
[ "MIT" ]
null
null
null
app/models/Movie.py
samousli/ikiru
4a4a002db398dd7ba1b112ea406c92b0a8cb6c37
[ "MIT" ]
null
null
null
app/models/Movie.py
samousli/ikiru
4a4a002db398dd7ba1b112ea406c92b0a8cb6c37
[ "MIT" ]
null
null
null
from .Base import Base from . import db class Movie(Base): title = db.Column(db.String(256), nullable=False) language = db.Column(db.String(8), default='en') imdb_id = db.Column(db.String(10)) release_year = db.Column(db.Integer) rentals = db.relationship('Rental', back_populates='movie', lazy=True) genres = db.relationship('Genre', secondary='movie_genre_xref')
30.230769
74
0.694656
56
393
4.785714
0.589286
0.119403
0.149254
0.179104
0
0
0
0
0
0
0
0.018072
0.155216
393
12
75
32.75
0.789157
0
0
0
0
0
0.086514
0
0
0
0
0
0
1
0
false
0
0.222222
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
0
0
1
0
0
2
ea2786a5629ec57e654f0aeeae32e11b695eb63f
385
py
Python
Django/SemiRestful_Users/apps/users/urls.py
justnclrk/Python
0922961cbd94694a69ae8132a5c33baf552d8d89
[ "MIT" ]
null
null
null
Django/SemiRestful_Users/apps/users/urls.py
justnclrk/Python
0922961cbd94694a69ae8132a5c33baf552d8d89
[ "MIT" ]
8
2020-06-06T01:02:06.000Z
2022-03-12T00:24:13.000Z
Django/SemiRestful_Users/apps/users/urls.py
justnclrk/Python
0922961cbd94694a69ae8132a5c33baf552d8d89
[ "MIT" ]
null
null
null
from django.conf.urls import url from . import views urlpatterns = [ url(r'^users$', views.index), url(r'^users/(?P<id>\d+)$', views.show), url(r'^users/new$', views.new), url(r'^users/create$', views.create), url(r'^users/(?P<id>\d+)/edit$', views.edit), url(r'^users/(?P<id>\d+)/delete$', views.delete), url(r'^users/(?P<id>\d+)/update$', views.update), ]
35
53
0.587013
62
385
3.645161
0.322581
0.123894
0.278761
0.176991
0.230089
0.230089
0
0
0
0
0
0
0.137662
385
11
54
35
0.680723
0
0
0
0
0
0.329016
0.196891
0
0
0
0
0
1
0
false
0
0.181818
0
0.181818
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ea3a1bc9989544e1629dd0052b9552ab2ca0c5cf
333
py
Python
birthday_multiparam.py
ISE2012/ch7
6c6444b6b44adb6f45a9123f6a33bda388241fad
[ "MIT" ]
null
null
null
birthday_multiparam.py
ISE2012/ch7
6c6444b6b44adb6f45a9123f6a33bda388241fad
[ "MIT" ]
null
null
null
birthday_multiparam.py
ISE2012/ch7
6c6444b6b44adb6f45a9123f6a33bda388241fad
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Wed Oct 28 06:33:05 2020 @author: ucobiz """ def happy(): print("Happy Bday to you!") def sing(person, age): happy() happy() print("Happy Bday,", person) print("You're already", age, "years old") happy() def main(): sing("Fred", 30) main()
15.136364
46
0.528529
45
333
3.911111
0.666667
0.113636
0.170455
0.215909
0
0
0
0
0
0
0
0.063025
0.285285
333
21
47
15.857143
0.676471
0.225225
0
0.272727
0
0
0.244541
0
0
0
0
0
0
1
0.272727
false
0
0
0
0.272727
0.272727
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
ea44b1b32f4c6c7e1009e6222f6894f5fab6d251
1,205
py
Python
SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Flight_Dynamics/Dynamic_Stability/Full_Linearized_Equations/Supporting_Functions/cy_psi.py
Vinicius-Tanigawa/Undergraduate-Research-Project
e92372f07882484b127d7affe305eeec2238b8a9
[ "MIT" ]
null
null
null
SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Flight_Dynamics/Dynamic_Stability/Full_Linearized_Equations/Supporting_Functions/cy_psi.py
Vinicius-Tanigawa/Undergraduate-Research-Project
e92372f07882484b127d7affe305eeec2238b8a9
[ "MIT" ]
null
null
null
SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Flight_Dynamics/Dynamic_Stability/Full_Linearized_Equations/Supporting_Functions/cy_psi.py
Vinicius-Tanigawa/Undergraduate-Research-Project
e92372f07882484b127d7affe305eeec2238b8a9
[ "MIT" ]
null
null
null
## @ingroup Methods-Flight_Dynamics-Dynamic_Stability-Full_Linearized_Equations-Supporting_Functions # cy_psi.py # # Created: Jun 2014, A. Wendorff # Modified: Jan 2016, E. Botero # ---------------------------------------------------------------------- # Imports # ---------------------------------------------------------------------- ## @ingroup Methods-Flight_Dynamics-Dynamic_Stability-Full_Linearized_Equations-Supporting_Functions import numpy as np # ---------------------------------------------------------------------- # Method # ---------------------------------------------------------------------- def cy_psi(cL,theta): """ This calculates the force coefficient in the y direction with respect to the yaw angle of the aircraft Assumptions: None Source: J.H. Blakelock, "Automatic Control of Aircraft and Missiles" Wiley & Sons, Inc. New York, 1991, (pg 23) Inputs: theta [radians] cL [dimensionless] Outputs: cy_psi [dimensionless] Properties Used: N/A """ # Generating Stability derivative cy_psi = cL * np.tan(theta) return cy_psi
28.023256
100
0.492946
109
1,205
5.311927
0.706422
0.043178
0.069085
0.096718
0.297064
0.297064
0.297064
0.297064
0.297064
0.297064
0
0.014815
0.215768
1,205
43
101
28.023256
0.597884
0.834025
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
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
1
0
0
0
0
0
0
0
2
ea4962156bd9f8e6a35a22850972461df61a1fea
332
py
Python
python/bottle/server.py
krishnaTORQUE/web-frameworks
ff0252dc2184d18b7b586fee01cba3d09d946468
[ "MIT" ]
null
null
null
python/bottle/server.py
krishnaTORQUE/web-frameworks
ff0252dc2184d18b7b586fee01cba3d09d946468
[ "MIT" ]
187
2020-03-03T20:23:29.000Z
2020-06-08T11:33:50.000Z
python/bottle/server.py
krishnaTORQUE/web-frameworks
ff0252dc2184d18b7b586fee01cba3d09d946468
[ "MIT" ]
null
null
null
# Disable all logging features import logging logging.disable() from meinheld import patch patch.patch_all() from bottle import Bottle app = Bottle() @app.route("/") def index(): return "" @app.route("/user/<id:int>") def user_info(id): return str(id) @app.route("/user", method="POST") def user(): return ""
11.857143
34
0.659639
46
332
4.717391
0.456522
0.110599
0.110599
0
0
0
0
0
0
0
0
0
0.177711
332
27
35
12.296296
0.794872
0.084337
0
0.133333
0
0
0.07947
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
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
0
0
0
1
1
0
0
2
ea502e3052203813abad550fb8c346f40e749d70
1,833
py
Python
src/openmovement/load/base_data.py
digitalinteraction/openmovement-python
d07dcd66d5c402436ee1113ed2862f6c41aa61b1
[ "BSD-2-Clause" ]
null
null
null
src/openmovement/load/base_data.py
digitalinteraction/openmovement-python
d07dcd66d5c402436ee1113ed2862f6c41aa61b1
[ "BSD-2-Clause" ]
null
null
null
src/openmovement/load/base_data.py
digitalinteraction/openmovement-python
d07dcd66d5c402436ee1113ed2862f6c41aa61b1
[ "BSD-2-Clause" ]
null
null
null
""" Base class for timeseries data loader """ from abc import ABC, abstractmethod class BaseData(ABC): def __init__(self, filename, verbose=False): """ Construct a data object from a file. :param filename: The path to the source file. :param verbose: Output more detailed information. """ self.filename = filename self.verbose = verbose pass # Nothing to do at start of 'with' def __enter__(self): return self # Close handle at end of 'with' def __exit__(self, exc_type, exc_value, traceback): self.close() # Close handle when destructed def __del__(self): self.close() # Iterate def __iter__(self): return iter(self.get_sample_values()) @abstractmethod def close(self): pass @abstractmethod def get_sample_values(self): """ Get the sample values as a single ndarray. :returns: An ndarray of (time, accel_x, accel_y, accel_z) or (time, accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z) where 'time' is in seconds since the epoch. """ pass @abstractmethod def get_samples(self, use_datetime64=True): """ Return an DataFrame for (time, accel_x, accel_y, accel_z) or (time, accel_x, accel_y, accel_z, gyro_x, gyro_y, gyro_z) :param use_datetime64: (Default) time is in datetime64[ns]; otherwise in seconds since the epoch. """ pass # Time of first sample (seconds since epoch) @abstractmethod def get_start_time(self): pass @abstractmethod def get_sample_rate(self): pass # The total number of samples (only an estimate if not all loaded) @abstractmethod def get_num_samples(self): pass
24.77027
126
0.619203
237
1,833
4.565401
0.388186
0.09427
0.092421
0.055453
0.22366
0.22366
0.112754
0.112754
0.112754
0.112754
0
0.004666
0.298418
1,833
73
127
25.109589
0.836703
0.444626
0
0.46875
0
0
0
0
0
0
0
0
0
1
0.34375
false
0.21875
0.03125
0.0625
0.46875
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
0
0
0
2
ea52b02a8489b15a73e913288783397cda0b4ef9
547
py
Python
students/k3343/laboratory_works/Suzdaltseva_Margarita/laboratory_work_2/marketing/luchapp/migrations/0004_auto_20200620_1902.py
TonikX/ITMO_ICT_-WebProgramming_2020
ba566c1b3ab04585665c69860b713741906935a0
[ "MIT" ]
10
2020-03-20T09:06:12.000Z
2021-07-27T13:06:02.000Z
students/k3343/laboratory_works/Suzdaltseva_Margarita/laboratory_work_2/marketing/luchapp/migrations/0004_auto_20200620_1902.py
TonikX/ITMO_ICT_-WebProgramming_2020
ba566c1b3ab04585665c69860b713741906935a0
[ "MIT" ]
134
2020-03-23T09:47:48.000Z
2022-03-12T01:05:19.000Z
students/k3343/laboratory_works/Suzdaltseva_Margarita/laboratory_work_2/marketing/luchapp/migrations/0004_auto_20200620_1902.py
TonikX/ITMO_ICT_-WebProgramming_2020
ba566c1b3ab04585665c69860b713741906935a0
[ "MIT" ]
71
2020-03-20T12:45:56.000Z
2021-10-31T19:22:25.000Z
# Generated by Django 3.0.6 on 2020-06-20 19:02 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('luchapp', '0003_product'), ] operations = [ migrations.AlterField( model_name='payment', name='day_paid', field=models.DateTimeField(null=True), ), migrations.AlterField( model_name='payment', name='day_requested', field=models.DateTimeField(auto_now_add=True), ), ]
22.791667
58
0.579525
55
547
5.636364
0.690909
0.129032
0.16129
0.187097
0.277419
0.277419
0.277419
0
0
0
0
0.050132
0.30713
547
23
59
23.782609
0.76781
0.082267
0
0.352941
1
0
0.108
0
0
0
0
0
0
1
0
false
0
0.058824
0
0.235294
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ea5c28748e52dc9d676e59534df765530975eb97
185
py
Python
Randomizer/random_tools.py
Zirgzar/ShowdownLoadoutRandomizer
54dc978eb42bfd4f5096e602d9b1ed6e20f0e537
[ "MIT" ]
null
null
null
Randomizer/random_tools.py
Zirgzar/ShowdownLoadoutRandomizer
54dc978eb42bfd4f5096e602d9b1ed6e20f0e537
[ "MIT" ]
null
null
null
Randomizer/random_tools.py
Zirgzar/ShowdownLoadoutRandomizer
54dc978eb42bfd4f5096e602d9b1ed6e20f0e537
[ "MIT" ]
null
null
null
import random def randomly_pick_tools(tools: list): """ Randomly picks out a tool """ random_index = random.randint(0, len(tools) - 1) return tools[random_index]
16.818182
52
0.659459
25
185
4.72
0.68
0.186441
0
0
0
0
0
0
0
0
0
0.014085
0.232432
185
10
53
18.5
0.816901
0.135135
0
0
0
0
0
0
0
0
0
0
0
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
0
0
0
2
ea67622547d994c0e60a3fe0462591cfafb2ef9d
2,593
py
Python
application/migrations/0002_auto_20200730_1432.py
AhmadTariqAlflahat/Web-Project-Django
80d8ba5cd04df9781e94a65122aa703999c1bdb8
[ "MIT" ]
null
null
null
application/migrations/0002_auto_20200730_1432.py
AhmadTariqAlflahat/Web-Project-Django
80d8ba5cd04df9781e94a65122aa703999c1bdb8
[ "MIT" ]
7
2021-04-08T21:31:50.000Z
2022-01-13T03:05:02.000Z
application/migrations/0002_auto_20200730_1432.py
AhmadTariqAlflahat/Web-Project-Django
80d8ba5cd04df9781e94a65122aa703999c1bdb8
[ "MIT" ]
null
null
null
# Generated by Django 3.0.8 on 2020-07-30 11:32 import account.models_addon import django.core.validators from django.db import migrations, models import django.utils.timezone import stdimage.models import stdimage.validators class Migration(migrations.Migration): dependencies = [ ('application', '0001_initial'), ] operations = [ migrations.AddField( model_name='applicationfile', name='created_at', field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), preserve_default=False, ), migrations.AddField( model_name='applicationfile', name='is_active', field=models.BooleanField(default=True), ), migrations.AddField( model_name='applicationfile', name='real_name', field=models.CharField(default=django.utils.timezone.now, max_length=255, verbose_name='Real Name'), preserve_default=False, ), migrations.AddField( model_name='applicationfile', name='updated_at', field=models.DateTimeField(auto_now=True), ), migrations.AddField( model_name='applicationimage', name='created_at', field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), preserve_default=False, ), migrations.AddField( model_name='applicationimage', name='is_active', field=models.BooleanField(default=True), ), migrations.AddField( model_name='applicationimage', name='real_name', field=models.CharField(default=django.utils.timezone.now, max_length=255, verbose_name='Real Name'), preserve_default=False, ), migrations.AddField( model_name='applicationimage', name='updated_at', field=models.DateTimeField(auto_now=True), ), migrations.AlterField( model_name='applicationimage', name='image', field=stdimage.models.StdImageField(help_text='Make sure to add only supported extension: png, jpg and jpeg', max_length=255, upload_to=account.models_addon.UploadToPathAndRename('upload/img/application_cover'), validators=[django.core.validators.FileExtensionValidator(['png', 'jpg', 'jpeg']), stdimage.validators.MinSizeValidator(400, 400), stdimage.validators.MaxSizeValidator(2600, 2600)], verbose_name='Application Cover'), ), ]
38.132353
440
0.6371
256
2,593
6.300781
0.316406
0.050217
0.114073
0.133912
0.596404
0.596404
0.561066
0.530688
0.530688
0.49225
0
0.021705
0.25376
2,593
67
441
38.701493
0.811886
0.017354
0
0.754098
1
0
0.148075
0.010998
0
0
0
0
0
1
0
false
0
0.098361
0
0.147541
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ea79e132c32efd79a13d423fd76baf5512de96e5
723
py
Python
cogs/Info.py
paulranshaw/Discord-Bot
82a6837c3753bb1dfb8f5c4c2f5f02edf0309f89
[ "Apache-2.0" ]
null
null
null
cogs/Info.py
paulranshaw/Discord-Bot
82a6837c3753bb1dfb8f5c4c2f5f02edf0309f89
[ "Apache-2.0" ]
null
null
null
cogs/Info.py
paulranshaw/Discord-Bot
82a6837c3753bb1dfb8f5c4c2f5f02edf0309f89
[ "Apache-2.0" ]
null
null
null
import discord import os from discord import client import dotenv import logging import asyncio from discord.ext import commands, tasks from dotenv import load_dotenv from itertools import cycle class Info(commands.Cog): def __init__(self, client): self.client = client # Commands @commands.command() async def ping(self, ctx): await ctx.channel.trigger_typing() await ctx.send(f'Pong! {round(self.client.latency * 1000)}ms') @commands.command() async def dev(self, ctx): await ctx.channel.trigger_typing() await ctx.channel.send("Developed by NiightAP: https://ngyt.tk") def setup(client): client.add_cog(Info(client))
24.1
73
0.673582
94
723
5.095745
0.468085
0.066806
0.093946
0.096033
0.179541
0.179541
0.179541
0.179541
0.179541
0
0
0.007194
0.230982
723
29
74
24.931034
0.854317
0.011065
0
0.181818
0
0
0.118943
0.038179
0
0
0
0
0
1
0.090909
false
0
0.409091
0
0.545455
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
0
0
1
0
1
0
0
2
ea7b1e9b9c8a84dce442167fcab0afcfbce82d4c
248
py
Python
7/confirmed_users.py
liuhanyu200/pygame
38a68e779e6b0a63edb1758fca98ebbf40bb0444
[ "BSD-3-Clause" ]
null
null
null
7/confirmed_users.py
liuhanyu200/pygame
38a68e779e6b0a63edb1758fca98ebbf40bb0444
[ "BSD-3-Clause" ]
null
null
null
7/confirmed_users.py
liuhanyu200/pygame
38a68e779e6b0a63edb1758fca98ebbf40bb0444
[ "BSD-3-Clause" ]
null
null
null
# coding:utf-8 unconfirmed_users = ['liuhanyu', 'luoliuzhou', 'wangyue', 'xiaolizi'] confirmed_users = [] while unconfirmed_users: user = unconfirmed_users.pop() confirmed_users.append(user) print(confirmed_users) print(unconfirmed_users)
24.8
69
0.758065
28
248
6.464286
0.535714
0.353591
0
0
0
0
0
0
0
0
0
0.004545
0.112903
248
10
70
24.8
0.818182
0.048387
0
0
0
0
0.140426
0
0
0
0
0
0
1
0
false
0
0
0
0
0.285714
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
0
0
0
0
0
2
ea885f565f183ec13332a01d2ec6b76cf4f1d2b9
466
py
Python
Tests/Test_videocourses_access_to_TT_without_autorization.py
AllaZhulyanova/Autotests_for_ADUKAR
ba45b09e2cc859fc10542eb4dc1792ea6e296b08
[ "Apache-2.0" ]
null
null
null
Tests/Test_videocourses_access_to_TT_without_autorization.py
AllaZhulyanova/Autotests_for_ADUKAR
ba45b09e2cc859fc10542eb4dc1792ea6e296b08
[ "Apache-2.0" ]
null
null
null
Tests/Test_videocourses_access_to_TT_without_autorization.py
AllaZhulyanova/Autotests_for_ADUKAR
ba45b09e2cc859fc10542eb4dc1792ea6e296b08
[ "Apache-2.0" ]
null
null
null
# Доступ к тренировочным тестам урока без авторизации def test_opening_TT_without_authorization (app): app.Button_menu.Test_Button_Videocourses() # кнопка "Видеокурсы" result = app.List_items_before_autorization.Test_list_of_all_items_for_TT(TEXT='УРОК') # нажимает на тренировочные тесты в предмете по порядку total_number_tests = result[0] total_number_tests_with_access = result[1] assert total_number_tests == total_number_tests_with_access
51.777778
146
0.815451
66
466
5.333333
0.681818
0.125
0.181818
0.113636
0.147727
0
0
0
0
0
0
0.004902
0.124464
466
9
147
51.777778
0.857843
0.26824
0
0
0
0
0.011869
0
0
0
0
0
0.166667
1
0.166667
false
0
0
0
0.166667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ea995e6e0edf67f8984767eb8c99c526a48c876f
645
py
Python
assin.py
ruanchaves/assin
f8ed74afb10dbc9e588e66c764ca66b002a50fc5
[ "MIT" ]
6
2019-10-23T02:02:57.000Z
2020-06-04T06:19:14.000Z
assin.py
ruanchaves/assin
f8ed74afb10dbc9e588e66c764ca66b002a50fc5
[ "MIT" ]
null
null
null
assin.py
ruanchaves/assin
f8ed74afb10dbc9e588e66c764ca66b002a50fc5
[ "MIT" ]
2
2019-10-23T02:03:01.000Z
2019-10-23T04:57:16.000Z
from utils_conv import AssinReader, assin_json_reader from run_train import parallel_train from ensemble import load_ensemble from utils_submission import assin_json_writer from report import generate_report import sys import json if __name__ == '__main__': with open(sys.argv[1]) as f: data = json.load(f) WORKERS = data['workers'] conv_data = data['conv'] train_data = data['train'] ensemble_data = data['ensemble'] submission_data = data['submission'] assin_json_reader(conv_data) parallel_train(train_data, workers=WORKERS) load_ensemble(ensemble_data) assin_json_writer(submission_data)
26.875
53
0.751938
88
645
5.147727
0.329545
0.07947
0.066225
0
0
0
0
0
0
0
0
0.001866
0.168992
645
24
54
26.875
0.843284
0
0
0
1
0
0.065015
0
0
0
0
0
0
1
0
false
0
0.368421
0
0.368421
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
eaa15496d55ee91553ee44c87ea65d037034e368
105
py
Python
typecats/__about__.py
xoeye/typecats
0b97262bdef0e36232b7849187586c9bb7e82198
[ "MIT" ]
14
2019-08-15T02:19:28.000Z
2021-12-28T19:44:56.000Z
typecats/__about__.py
xoeye/typecats
0b97262bdef0e36232b7849187586c9bb7e82198
[ "MIT" ]
4
2019-08-22T21:11:37.000Z
2022-02-17T15:42:12.000Z
typecats/__about__.py
xoeye/typecats
0b97262bdef0e36232b7849187586c9bb7e82198
[ "MIT" ]
2
2019-12-31T08:53:23.000Z
2021-09-03T20:26:21.000Z
"""typecats""" __version__ = "1.7.0" __author__ = "Peter Gaultney" __author_email__ = "pgaultney@xoi.io"
21
37
0.714286
13
105
4.769231
0.923077
0
0
0
0
0
0
0
0
0
0
0.031915
0.104762
105
4
38
26.25
0.62766
0.07619
0
0
0
0
0.384615
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
575e4902d461babd38cf629176a406b09583ef18
154
py
Python
Class 5/Operators with Conditions.py
teenage-coder/Introduction-to-Python
fee751071bdac27b4644279c44eb8f008271fcd1
[ "Apache-2.0" ]
1
2021-09-16T03:17:19.000Z
2021-09-16T03:17:19.000Z
Operators in Python/Operators with Conditions.py
teenage-coder/Data-Analysis-with-Python
5b4cd1277fd0ab6db9f8953087070fc30b0e293f
[ "Apache-2.0" ]
null
null
null
Operators in Python/Operators with Conditions.py
teenage-coder/Data-Analysis-with-Python
5b4cd1277fd0ab6db9f8953087070fc30b0e293f
[ "Apache-2.0" ]
null
null
null
num = int(input("Enter a number: ")) if ((num % 2 == 0) and (num % 3 == 0) and (num % 5 == 0)): print("Divisible") else: print("Not Divisible")
19.25
58
0.525974
24
154
3.375
0.666667
0.098765
0.17284
0
0
0
0
0
0
0
0
0.051724
0.246753
154
7
59
22
0.646552
0
0
0
0
0
0.246753
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
577132c5a924884f2c243cde302ab45e7bc61249
331
py
Python
cloudconvert/environment_vars.py
claudep/cloudconvert-python
9c0e8705fe2c208eef87cf121300ea691d1dc03a
[ "MIT" ]
153
2015-11-27T12:29:55.000Z
2022-03-30T15:12:38.000Z
cloudconvert/environment_vars.py
claudep/cloudconvert-python
9c0e8705fe2c208eef87cf121300ea691d1dc03a
[ "MIT" ]
20
2016-01-07T11:18:18.000Z
2022-01-29T15:19:28.000Z
packages/cloudconvert/environment_vars.py
YariKartoshe4ka/sublime-svg-viewer
bb4c7d9df6e41ec68341e51aec77b5afd1964376
[ "MIT" ]
49
2015-12-28T13:37:22.000Z
2022-03-27T03:03:24.000Z
"""Environment Variables to be used inside the CloudConvert-Python-REST-SDK""" CLOUDCONVERT_API_KEY = "API_KEY" """Environment variable defining the Cloud Convert REST API default credentials as Access Token.""" CLOUDCONVERT_SANDBOX = "true" """Environment variable defining if the sandbox API is used instead of the live API"""
36.777778
86
0.785498
46
331
5.565217
0.630435
0.046875
0.210938
0
0
0
0
0
0
0
0
0
0.129909
331
8
87
41.375
0.888889
0.217523
0
0
0
0
0.161765
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
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
2
57794102118178b2f81fc05f5a33a34e7ec316aa
490
py
Python
dojo/unittests/test_blackduck_component_risk_parser.py
krbalag/django-DefectDojo
f93e24ef97cd06e426e60e708602eb8fc797ec80
[ "BSD-3-Clause" ]
3
2020-07-15T12:57:14.000Z
2020-10-14T14:32:40.000Z
dojo/unittests/test_blackduck_component_risk_parser.py
viral-sangani/django-DefectDojo
e0fa585ee770bd0b15ba4a73bd81e6cc043650fd
[ "BSD-3-Clause" ]
173
2020-12-17T20:29:09.000Z
2022-03-23T12:54:32.000Z
dojo/unittests/test_blackduck_component_risk_parser.py
viral-sangani/django-DefectDojo
e0fa585ee770bd0b15ba4a73bd81e6cc043650fd
[ "BSD-3-Clause" ]
2
2022-02-07T09:57:28.000Z
2022-03-11T08:42:59.000Z
from django.test import TestCase from dojo.tools.blackduck_component_risk.parser import BlackduckHubParser from dojo.models import Test from pathlib import Path class TestBlackduckHubCRParser(TestCase): def test_blackduck_enhanced_zip_upload(self): testfile = Path("dojo/unittests/scans/blackduck_component_risk/" "blackduck_hub_component_risk.zip") parser = BlackduckHubParser(testfile, Test()) self.assertEqual(12, len(parser.items))
37.692308
73
0.755102
56
490
6.410714
0.535714
0.108635
0.122563
0
0
0
0
0
0
0
0
0.004926
0.171429
490
12
74
40.833333
0.87931
0
0
0
0
0
0.159184
0.159184
0
0
0
0
0.1
1
0.1
false
0
0.4
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
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
577a470ba11fe32482058ffcf2cb479048bf1edd
225
py
Python
pytest_wiremock/client/_endpoints_recordings.py
symonk/pytest-wiremock
372956418174adafadcb33ad38db121a049f7f2b
[ "MIT" ]
null
null
null
pytest_wiremock/client/_endpoints_recordings.py
symonk/pytest-wiremock
372956418174adafadcb33ad38db121a049f7f2b
[ "MIT" ]
7
2022-03-14T08:41:55.000Z
2022-03-28T18:01:22.000Z
pytest_wiremock/client/_endpoints_recordings.py
symonk/pytest-wiremock
372956418174adafadcb33ad38db121a049f7f2b
[ "MIT" ]
null
null
null
from pytest_wiremock.client._protocols import Requestable class RecordingsEndpoint: """ Facade into recordings. """ def __init__(self, dispatcher: Requestable) -> None: self.dispatcher = dispatcher
20.454545
57
0.706667
21
225
7.285714
0.809524
0.183007
0
0
0
0
0
0
0
0
0
0
0.208889
225
10
58
22.5
0.859551
0.102222
0
0
0
0
0
0
0
0
0
0
0
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
0
0
0
2
577bb57396f514053e074102a881fd95850ffb10
2,421
py
Python
cattledb/restserver/__init__.py
reiterd/cattledb
015214afa5c3b1e94b555b138334163068aaf982
[ "MIT" ]
1
2021-02-26T14:52:40.000Z
2021-02-26T14:52:40.000Z
cattledb/restserver/__init__.py
reiterd/cattledb
015214afa5c3b1e94b555b138334163068aaf982
[ "MIT" ]
6
2020-04-30T19:20:28.000Z
2021-03-09T15:10:50.000Z
cattledb/restserver/__init__.py
reiterd/cattledb
015214afa5c3b1e94b555b138334163068aaf982
[ "MIT" ]
5
2020-05-04T09:10:33.000Z
2021-07-20T15:04:50.000Z
#!/usr/bin/python # coding: utf-8 import logging import logging.config import os # def init_s_db(app, loop): # from ..directclient import AsyncCDBClient # config = app.cdb_config # # Setup DB # engine = config.ENGINE # engine_options = config.ENGINE_OPTIONS # read_only = config.READ_ONLY # pool_size = config.POOL_SIZE # admin = config.ADMIN # table_prefix = config.TABLE_PREFIX # app.cdb = AsyncCDBClient(engine=engine, engine_options=engine_options, table_prefix=table_prefix, # pool_size=pool_size, read_only=read_only, admin=admin) # app.cdb.service_init() # logging.getLogger().warning("DB Setup finished") def _create_app(config): from ..core.helper import setup_logging from flask import Flask app = Flask("cattledb") # Setting Hostname import socket host_name = str(socket.gethostname()) logging.getLogger().warning("Creating App on %s", host_name) # setup from .ext import FlaskCDB db_ext = FlaskCDB(engine=config.ENGINE, engine_options=config.ENGINE_OPTIONS, read_only=config.READ_ONLY, admin=config.ADMIN, table_prefix=config.TABLE_PREFIX, app=app) # warmup db_ext.warmup(app) app.cdb = db_ext from .services import bp app.register_blueprint(bp) return app def create_app_by_configfile(configfile=None): from ..core.helper import import_config_file from ..settings import default as _default_config if configfile: _imported = import_config_file(configfile) click.echo("Using Config: {}".format(configfile)) config = _imported else: config = _default_config click.echo("Using Default Config") return _create_app(config) # def create_sanic_app_by_config(config_name=None): # if config_name is None: # config_name = os.getenv('CATTLEDB_CONFIGURATION', 'default') # config_name = config_name.strip() # from ..settings import available_configs # selected_config = available_configs[config_name] # logging.getLogger().warning("Using Config: {}".format(selected_config)) # setup_logging(selected_config) # from sanic import Sanic # app = Sanic() # from .s_services import bp # app.blueprint(bp) # app.cdb_config = selected_config # app.listener('before_server_start')(init_s_db) # return app
28.482353
103
0.683189
300
2,421
5.266667
0.273333
0.049367
0.036076
0.03038
0.150633
0.150633
0.150633
0.150633
0.150633
0.091139
0
0.00053
0.220157
2,421
84
104
28.821429
0.836335
0.51012
0
0
0
0
0.053866
0
0
0
0
0
0
1
0.066667
false
0
0.4
0
0.533333
0.033333
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
0
1
0
0
2
577fd47b965937888726f733f3cb624153e8ca94
903
py
Python
controllers/db_index/db_index.py
gbf-labs/rh-api
317a812164ad8943ab638c06f61723cb928bfd12
[ "Apache-2.0" ]
null
null
null
controllers/db_index/db_index.py
gbf-labs/rh-api
317a812164ad8943ab638c06f61723cb928bfd12
[ "Apache-2.0" ]
6
2020-03-30T23:11:27.000Z
2022-03-12T00:21:45.000Z
controllers/db_index/db_index.py
gbf-labs/rh-api
317a812164ad8943ab638c06f61723cb928bfd12
[ "Apache-2.0" ]
null
null
null
# #====================================# # # AUTHOR: KRISFEN DUCAO # # #====================================# # # pylint: disable=too-few-public-methods # """DB Index""" # # from flask import jsonify, request # from library.MySQLDatabase import MySQLDatabase # from library.common import Common # class DBIndex(Common, MySQLDatabase): # """Class for DBIndex""" # def index(self): # """Return DB Index""" # # return None # # CONNECT TO DATABASE # self.open_connection() # # INCREASE THE BUFFER SIZE IN MYSQL # sql_str = "SET @newsize = 1024 * 1024 * 256" # self.query_commit(sql_str) # sql_str = "SET GLOBAL key_buffer_size = @newsize;" # self.query_commit(sql_str) # # CLOSE DB CONNECTION # self.close_connection() # # RETURN # return 1
27.363636
61
0.51495
87
903
5.229885
0.563218
0.052747
0.03956
0.079121
0.092308
0
0
0
0
0
0
0.018957
0.299003
903
32
62
28.21875
0.699842
0.887043
0
null
0
null
0
0
null
0
0
0
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
0
0
0
0
1
0
0
0
0
0
0
2
57923b460aac6fd777787b768d515643c8929f1a
4,727
py
Python
tests/test_colt.py
altescy/colt
934a129f97043614d163c8b22d45360564082818
[ "MIT" ]
18
2020-05-02T05:52:38.000Z
2022-01-04T05:18:54.000Z
tests/test_colt.py
altescy/colt
934a129f97043614d163c8b22d45360564082818
[ "MIT" ]
null
null
null
tests/test_colt.py
altescy/colt
934a129f97043614d163c8b22d45360564082818
[ "MIT" ]
null
null
null
from typing import Any, Dict, List, Optional, Set, Tuple, Union import colt @colt.register("foo") class Foo: def __init__(self, x: str) -> None: self.x = x @colt.register("bar") class Bar: def __init__(self, foos: List[Foo]) -> None: self.foos = foos @colt.register("baz") class Baz(Foo): def __init__(self, x: str, y: Optional[int] = None) -> None: super().__init__(x) self.y = y @colt.register("qux") class Qux: def __init__(self, x: Set[int]) -> None: self.x = x @colt.register("corge") class Corge: def __init__(self, x) -> None: # type: ignore self.x = x @colt.register("grault") class Grault: def __init__(self, x: Tuple[Foo, Qux]) -> None: self.x = x @colt.register("garply") class Garply: def __init__(self, x: Dict[str, Foo]) -> None: self.x = x @colt.register("waldo") class Waldo: def __init__(self, x: Union[str, Foo]) -> None: self.x = x @colt.register("fred") class Fred: def __init__(self, x: Any) -> None: self.x = x def test_colt_with_type() -> None: config = { "bar": { "@type": "bar", "foos": [ {"@type": "foo", "x": "hello"}, {"@type": "foo", "x": "world"}, ], }, "foos": [ {"@type": "foo", "x": "hoge"}, {"@type": "foo", "x": "fuga"}, ], } obj = colt.build(config) assert isinstance(obj["bar"], Bar) assert isinstance(obj["bar"].foos, list) assert isinstance(obj["bar"].foos[0], Foo) assert isinstance(obj["foos"], list) assert isinstance(obj["foos"][0], Foo) def test_colt_with_less_type() -> None: config = { "@type": "bar", "foos": [ {"x": "hello"}, {"x": "world"}, ], } obj = colt.build(config) assert isinstance(obj, Bar) assert isinstance(obj.foos, list) assert isinstance(obj.foos[0], Foo) def test_colt_with_optional() -> None: config = { "@type": "baz", "x": "hello", } obj = colt.build(config) assert isinstance(obj, Baz) assert obj.x == "hello" assert obj.y is None config = { "@type": "baz", "x": "hello", "y": 123, # type: ignore } obj = colt.build(config) assert obj.y == 123 def test_colt_with_subclass() -> None: config = { "@type": "bar", "foos": [ {"x": "hello"}, {"@type": "baz", "x": "world", "y": 123}, ], } obj = colt.build(config) assert isinstance(obj, Bar) assert isinstance(obj.foos[0], Foo) assert isinstance(obj.foos[1], Baz) def test_type_conversion() -> None: config = { "@type": "qux", "x": [1, 2, 3, 3], } obj = colt.build(config) assert isinstance(obj, Qux) assert isinstance(obj.x, set) assert len(obj.x) == 3 def test_colt_without_annotation() -> None: config = { "@type": "corge", "x": ["a", "b"], } obj = colt.build(config) assert isinstance(obj, Corge) assert isinstance(obj.x, list) assert isinstance(obj.x[0], str) def test_colt_tuple(): config = { "@type": "grault", "x": [ {"x": "hello"}, {"x": [1, 2, 3]}, ], } obj = colt.build(config) assert isinstance(obj, Grault) assert isinstance(obj.x, tuple) assert isinstance(obj.x[0], Foo) assert isinstance(obj.x[1], Qux) def test_colt_dict() -> None: config = { "@type": "garply", "x": { "a": {"x": "hello"}, "b": {"x": "world"}, }, } obj = colt.build(config) assert isinstance(obj, Garply) assert isinstance(obj.x, dict) assert isinstance(obj.x["a"], Foo) assert isinstance(obj.x["b"], Foo) assert obj.x["a"].x == "hello" assert obj.x["b"].x == "world" def test_colt_union() -> None: config = { "@type": "waldo", "x": "hello", } obj = colt.build(config) assert isinstance(obj, Waldo) assert isinstance(obj.x, str) assert obj.x == "hello" config = { "@type": "waldo", "x": {"x": "hello"}, # type: ignore } obj = colt.build(config) assert isinstance(obj, Waldo) assert isinstance(obj.x, Foo) assert obj.x.x == "hello" def test_colt_any() -> None: config = {"@type": "fred", "x": {"@type": "foo", "x": "hello"}} obj = colt.build(config) assert isinstance(obj.x, Foo) def test_build_with_type() -> None: config = {"x": "abc"} obj = colt.build(config, Foo) assert isinstance(obj, Foo) assert obj.x == "abc"
19.614108
67
0.51428
583
4,727
4.051458
0.102916
0.209992
0.249365
0.099069
0.488992
0.419136
0.359018
0.287045
0.214225
0.15453
0
0.007564
0.300825
4,727
240
68
19.695833
0.70711
0.008039
0
0.362573
0
0
0.079829
0
0
0
0
0
0.233918
1
0.116959
false
0
0.011696
0
0.181287
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
579e8b38e0fc3e88676dfde71b352a1aab9d9400
1,485
py
Python
tests/modules/matrix_attention/cosine_matrix_attention_test.py
MSLars/allennlp
2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475
[ "Apache-2.0" ]
11,433
2017-06-27T03:08:46.000Z
2022-03-31T18:14:33.000Z
tests/modules/matrix_attention/cosine_matrix_attention_test.py
MSLars/allennlp
2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475
[ "Apache-2.0" ]
4,006
2017-06-26T21:45:43.000Z
2022-03-31T02:11:10.000Z
tests/modules/matrix_attention/cosine_matrix_attention_test.py
MSLars/allennlp
2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475
[ "Apache-2.0" ]
2,560
2017-06-26T21:16:53.000Z
2022-03-30T07:55:46.000Z
import torch from numpy.testing import assert_almost_equal import numpy from allennlp.common import Params from allennlp.common.testing.test_case import AllenNlpTestCase from allennlp.modules.matrix_attention import CosineMatrixAttention from allennlp.modules.matrix_attention.matrix_attention import MatrixAttention class TestCosineMatrixAttention(AllenNlpTestCase): def test_can_init_cosine(self): legacy_attention = MatrixAttention.from_params(Params({"type": "cosine"})) isinstance(legacy_attention, CosineMatrixAttention) def test_cosine_similarity(self): # example use case: a batch of size 2. # With a time element component (e.g. sentences of length 2) each word is a vector of length 3. # It is comparing this with another input of the same type output = CosineMatrixAttention()( torch.FloatTensor([[[0, 0, 0], [4, 5, 6]], [[-7, -8, -9], [10, 11, 12]]]), torch.FloatTensor([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]), ) # For the first batch there is # no correlation between the first words of the input matrix # but perfect correlation for the second word # For the second batch there is # negative correlation for the first words # correlation for the second word assert_almost_equal( output.numpy(), numpy.array([[[0, 0], [0.97, 1]], [[-1, -0.99], [0.99, 1]]]), decimal=2 )
43.676471
103
0.659933
194
1,485
4.969072
0.438144
0.03112
0.052905
0.051867
0.151452
0.024896
0.024896
0.024896
0.024896
0
0
0.042328
0.236364
1,485
33
104
45
0.80776
0.297643
0
0
0
0
0.009681
0
0
0
0
0
0.105263
1
0.105263
false
0
0.368421
0
0.526316
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
0
0
1
0
1
0
0
2
57abba9535da6ecc8806129afaaca112ee93836a
1,066
py
Python
pythonlib/randc_m.py
johnkerl/scripts-math
71b6c6617728290ce9643c80a75a402707ad1134
[ "BSD-2-Clause" ]
3
2019-01-11T20:56:22.000Z
2020-02-22T10:32:59.000Z
pythonlib/randc_m.py
johnkerl/scripts-math
71b6c6617728290ce9643c80a75a402707ad1134
[ "BSD-2-Clause" ]
null
null
null
pythonlib/randc_m.py
johnkerl/scripts-math
71b6c6617728290ce9643c80a75a402707ad1134
[ "BSD-2-Clause" ]
3
2018-01-12T00:55:16.000Z
2020-02-22T10:33:03.000Z
#!/usr/bin/python -Wall # ================================================================ # John Kerl # kerl.john.r@gmail.com # 2008-02-06 # # Pseudorandom scalar-complex routines layered on top of Python's (real) # random module. # ================================================================ from __future__ import division # 1/2 = 0.5, not 0. import random import math from cplxreal_m import * # ---------------------------------------------------------------- def randc_unit(): phz = random.uniform(0.0, 2.0*math.pi) return complex(math.cos(phz), math.sin(phz)) # ---------------------------------------------------------------- def randc_mean_sq_1(): s = 0.70710678118654746 # 1.0/math.sqrt(2.0) re = random.gauss(0.0, s) im = random.gauss(0.0, s) return complex(re, im) # ---------------------------------------------------------------- def randc_normal(mu, sigma_squared): s = 0.70710678118654746 # 1.0/math.sqrt(2.0) scale = sigma_squared * s re = random.gauss(real(mu), scale) im = random.gauss(imag(mu), scale) return complex(re, im)
28.810811
72
0.4803
130
1,066
3.846154
0.446154
0.016
0.076
0.08
0.18
0.124
0.124
0.124
0.124
0
0
0.069694
0.111632
1,066
36
73
29.611111
0.458289
0.499062
0
0.222222
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.222222
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
57b0076f6c21256a7ae8cf2e33572cc08199bebf
668
py
Python
Python/07 - Collections/Piling Up!.py
sohammanjrekar/HackerRank
1f5010133a1ac1e765e855a086053c97d9e958be
[ "MIT" ]
null
null
null
Python/07 - Collections/Piling Up!.py
sohammanjrekar/HackerRank
1f5010133a1ac1e765e855a086053c97d9e958be
[ "MIT" ]
null
null
null
Python/07 - Collections/Piling Up!.py
sohammanjrekar/HackerRank
1f5010133a1ac1e765e855a086053c97d9e958be
[ "MIT" ]
null
null
null
""" Author: Eda AYDIN """ T = int(input()) answer = [] for i in range(T): size = int(input()) blocks = list(map(int, input().split())) for j in range(size - 1): if blocks[0] >= blocks[len(blocks) - 1]: a = blocks[0] blocks.pop(0) elif blocks[0] < blocks[len(blocks) - 1]: a = blocks[len(blocks) - 1] blocks.pop(len(blocks) - 1) else: pass if len(blocks) == 1: answer.append("Yes") if (blocks[0] > a) or (blocks[len(blocks) - 1] > a): answer.append("No") break print("\n".join(answer))
22.266667
61
0.449102
84
668
3.571429
0.404762
0.18
0.2
0.213333
0.256667
0.2
0.2
0.2
0
0
0
0.029056
0.381737
668
29
62
23.034483
0.697337
0.025449
0
0
0
0
0.011401
0
0
0
0
0
0
1
0
false
0.05
0
0
0
0.05
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
0
0
2
57b189cda242ff754e1ef4ccfda9cfc632d9cd6f
3,807
py
Python
src/libs/core/register/test.py
VirtualVFix/AndroidTestFramework
1feb769c6aca39a78e6daefd6face0a1e4d62cd4
[ "MIT" ]
null
null
null
src/libs/core/register/test.py
VirtualVFix/AndroidTestFramework
1feb769c6aca39a78e6daefd6face0a1e4d62cd4
[ "MIT" ]
null
null
null
src/libs/core/register/test.py
VirtualVFix/AndroidTestFramework
1feb769c6aca39a78e6daefd6face0a1e4d62cd4
[ "MIT" ]
null
null
null
# All rights reserved by forest fairy. # You cannot modify or share anything without sacrifice. # If you don't agree, keep calm and don't look at code bellow! __author__ = "VirtualV <https://github.com/virtualvfix>" __date__ = "09/27/17 14:58" from .base import Base class Test(Base): """ Test default config. This config is part of :class:`src.libs.core.register.Register` """ #: Current test state. Updates automatically during testing CURRENT_STATE = '' #: Current TestSuite name. Updates automatically during testing CURRENT_SUITE = '' #: Current Test name. Updates automatically during testing CURRENT_TEST = '' #: Current TestCase name. Updates automatically during testing CURRENT_CASE = '' #: Current TestCase index. Updates automatically during testing CURRENT_CASE_INDEX = -1 #: Test name configured by code TEST_NAME = '' #: Total cycles of current Test. #: Changes automatically for each Test and depends of ***_cycles** variable in Test class. TOTAL_CYCLES = 1 #: Current cycle of current Test. #: May changes automatically (by default) or directly from Test implementation (@OwnCycle decorator in use) CURRENT_CYCLE = 0 #: Test failed. Used to calculate pass rate when it not depend of test cycle. #: Pass rate will be calculate according to complete cycles if == 0 FAILED_CYCLES = 0 #: Test pass rate. #: May changes automatically (by default) or directly from Test implementation. #: Pass rate may be affected by @OwnCycle(use_total_cycle=True) decorator or FAILED_CYCLES variable PASS_RATE = 0 #: ADB implementation by default DEFAULT_ADB_IMPLEMENTATION = 'base' #: ADB shell implementation by default DEFAULT_SHELL_IMPLEMENTATION = 'base' #: Fastboot implementation by default DEFAULT_FASTBOOT_IMPLEMENTATION = 'base' #: CMD implementation by default DEFAULT_CMD_IMPLEMENTATION = 'base' #: Email address used to send notify NOTIFICATION_EMAIL = 'somenotifybot@gmail.com' #: Main host. Adds to Email addresses if host not specified NOTIFICATION_HOST = '@gmail.com' #: Email password. Should be encode in base64 NOTIFICATION_PWD = b'' #: Email subject tag NOTIFICATION_TAG = '[FRAMEWORK]' #: Email addresses list NOTIFICATION_MAIL_LIST = [] #: Additional comment in Email subject NOTIFICATION_COMMENT = '' #: Email class to send notify NOTIFICATION_CLASS = None #: Path to build specified in "--build" option. (Variable changes automatically). BUILD_PATH = '' #: build name tag like "nash_oem" BUILD_TAGNAME = None #: build job name on Jenkins or Artifactory BUILD_JOBNAME = None #: Build folder. This variable used in flash tests if path to build is not specified. BUILD_FOLDER = '/BUILDS/' #: Time limit for build downloading in seconds. BUILD_DOWNLOAD_WAIT_TIME = 2 * 60 * 60 #: List of available wifi points. #[(point name, point password or None)] WIFI_POINTS = [('POINT', 'PASSWD')] #: List of IP address for ping internet connection PING_ADDRESS_LIST = ['google.com', '216.58.216.238'] #: Ping timeout in seconds for check internet connection PING_TIMEOUT = 30 #: GOOGLE spreadsheet settings for benchmarks full automate mode #: May be selected by device name or device platform BENCHMARK_AUTO = {'NAME': {'SheetID': None, 'SheetTab': None, 'MasterCR': None}} #: GOOGLE spreadsheet for iozone STORAGE_AUTO = {'NAME': {'SheetID': None, 'SheetTab': None, 'MasterCR': None}} #: GOOGLE spreadsheet for stress tests STRESS_AUTO = {'NAME': {'SheetID': None, 'SheetTab': None, 'SuspendMasterCR': None, 'PUPDMasterCR': None}} def __init__(self): super(Test, self).__init__()
39.65625
111
0.697662
481
3,807
5.392931
0.39501
0.020817
0.050116
0.063608
0.19468
0.17926
0.097918
0.097918
0.097918
0.097918
0
0.012032
0.214079
3,807
95
112
40.073684
0.854947
0.572629
0
0
0
0
0.164331
0.01465
0
0
0
0
0
1
0.026316
false
0.052632
0.026316
0
0.921053
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
0
1
0
0
1
0
0
2
57c5301117d21c5f8fe448d32008528e7bc9ce5e
1,146
py
Python
api/controllers/blogs.py
rwolande/site_api
6de42936789c75ffc3896f1fd3f2cb3e91e02862
[ "MIT" ]
null
null
null
api/controllers/blogs.py
rwolande/site_api
6de42936789c75ffc3896f1fd3f2cb3e91e02862
[ "MIT" ]
null
null
null
api/controllers/blogs.py
rwolande/site_api
6de42936789c75ffc3896f1fd3f2cb3e91e02862
[ "MIT" ]
null
null
null
import datetime from flask import Flask, current_app from flask import request from flask import jsonify from flask_restful import Resource, Api, reqparse, HTTPException from flask_mysqldb import MySQL from flask import g import hashlib import uuid #import db_query_select, db_query_update from api.controllers.base import BaseController from api import constants from api.status_codes import Status from api.controllers import db_query_select, db_query_insert class BlogsController(BaseController): def __init__(self): super(BaseController, self) # @protected def get(self, *args, **kwargs): sql = 'SELECT * FROM' + constants.BLOG_POST_TABLE + "ORDER BY creation_time DESC LIMIT 10" params = () res = db_query_select(sql,params) if len(res) == 0: return super(BlogsController,self).error_response(Status.MISSING_PARAMETERS) sql = 'SELECT * FROM' + constants.BLOG_TAG_TABLE params = () tags_res = db_query_select(sql,params) if len(tags_res) == 0: return super(BlogsController,self).error_response(Status.MISSING_PARAMETERS) return super(BlogsController,self).success_response({'posts':res,'tags':tags_res})
28.65
92
0.782723
159
1,146
5.433962
0.402516
0.0625
0.069444
0.104167
0.351852
0.291667
0.231481
0.231481
0.162037
0.162037
0
0.00402
0.131763
1,146
40
93
28.65
0.864322
0.04363
0
0.142857
0
0
0.06484
0
0
0
0
0
0
1
0.071429
false
0
0.464286
0
0.678571
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
0
0
1
0
1
0
0
2
57d5e116a70b9e13387063235117c56f8a3403a8
195
py
Python
Python/OOP/InitClass.py
piovezan/SOpt
a5ec90796b7bdf98f0675457fc4bb99c8695bc40
[ "MIT" ]
148
2017-08-03T01:49:27.000Z
2022-03-26T10:39:30.000Z
Python/OOP/InitClass.py
piovezan/SOpt
a5ec90796b7bdf98f0675457fc4bb99c8695bc40
[ "MIT" ]
3
2017-11-23T19:52:05.000Z
2020-04-01T00:44:40.000Z
Python/OOP/InitClass.py
piovezan/SOpt
a5ec90796b7bdf98f0675457fc4bb99c8695bc40
[ "MIT" ]
59
2017-08-03T01:49:19.000Z
2022-03-31T23:24:38.000Z
class A(object): def __init__(self): print("init") def __call__(self): print("call ") a = A() #imprime init A() #imprime call #https://pt.stackoverflow.com/q/109813/101
17.727273
42
0.605128
27
195
4.074074
0.592593
0.163636
0
0
0
0
0
0
0
0
0
0.059603
0.225641
195
10
43
19.5
0.668874
0.333333
0
0
0
0
0.070866
0
0
0
0
0
0
1
0.285714
false
0
0
0
0.428571
0.285714
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
0
0
0
2
57d70e7b5662a64f5e7b588dd5794a90a3b9b81b
216
py
Python
lang/py/cookbook/v2/source/cb2_1_17_exm_4.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
lang/py/cookbook/v2/source/cb2_1_17_exm_4.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
lang/py/cookbook/v2/source/cb2_1_17_exm_4.py
ch1huizong/learning
632267634a9fd84a5f5116de09ff1e2681a6cc85
[ "MIT" ]
null
null
null
Dear Fred Smith, I hope you are having a great time. If you do not find Room 307 to your satisfaction, let us know. Please accept this $5 coupon. Sincerely, Barney Mills SleepyInn
27
49
0.648148
33
216
4.242424
0.969697
0
0
0
0
0
0
0
0
0
0
0.027211
0.319444
216
7
50
30.857143
0.92517
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
0
0
2
57f3e82c06de4b980109c7355cd576f406587f76
765
py
Python
tutorial/tables.py
VladyslavHnatchenko/django-locallibrary-tutorial
948088d18331383d34481874360eb22ae3dd3ac4
[ "CC0-1.0" ]
null
null
null
tutorial/tables.py
VladyslavHnatchenko/django-locallibrary-tutorial
948088d18331383d34481874360eb22ae3dd3ac4
[ "CC0-1.0" ]
null
null
null
tutorial/tables.py
VladyslavHnatchenko/django-locallibrary-tutorial
948088d18331383d34481874360eb22ae3dd3ac4
[ "CC0-1.0" ]
null
null
null
import django_tables2 as tables from catalog.models import Book, Genre, Language, Author from .models import Person class PersonTable(tables.Table): class Meta: model = Person template_name = "django_tables2/bootstrap.html" class BookTable(tables.Table): class Meta: model = Book template_name = "django_tables2/bootstrap.html" class GenreTable(tables.Table): class Meta: model = Genre template_name = "django_tables2/bootstrap.html" class LanguageTable(tables.Table): class Meta: model = Language template_name = "django_tables2/bootstrap.html" class AuthorTable(tables.Table): class Meta: model = Author template_name = "django_tables2/bootstrap.html"
21.857143
56
0.691503
87
765
5.954023
0.298851
0.150579
0.15444
0.19305
0.646718
0.405405
0.332046
0
0
0
0
0.010187
0.230065
765
34
57
22.5
0.86927
0
0
0.434783
0
0
0.189542
0.189542
0
0
0
0
0
1
0
false
0
0.130435
0
0.565217
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
0
0
1
0
0
2
17aad1ccef84917ec85e6e01fc123f1392cabcc4
1,858
py
Python
src/gallery/models.py
pfskiev/lisbon
c756d0cd2f8fd2405c7123dab029748da75b6e5b
[ "MIT" ]
null
null
null
src/gallery/models.py
pfskiev/lisbon
c756d0cd2f8fd2405c7123dab029748da75b6e5b
[ "MIT" ]
1
2017-11-07T09:09:28.000Z
2017-11-07T09:09:28.000Z
src/gallery/models.py
pfskiev/lisbon
c756d0cd2f8fd2405c7123dab029748da75b6e5b
[ "MIT" ]
null
null
null
from django.db import models from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse class Gallery(models.Model): title_PT = models.CharField(_('Title PT'), max_length=100, blank=True, null=False) title_EN = models.CharField(_('Title EN'), max_length=100, blank=True, null=False) title_DE = models.CharField(_('Title DE'), max_length=100, blank=True, null=False) description_PT = models.TextField(_('Description PT'), max_length=5000, blank=True, null=False) description_EN = models.TextField(_('Description EN'), max_length=5000, blank=True, null=False) description_DE = models.TextField(_('Description DE'), max_length=5000, blank=True, null=False) img = models.ImageField(_('Photo # 1'), null=True, blank=True) img_1 = models.ImageField(_('Photo # 2'), null=True, blank=True) img_2 = models.ImageField(_('Photo # 3'), null=True, blank=True) img_3 = models.ImageField(_('Photo # 4'), null=True, blank=True) img_4 = models.ImageField(_('Photo # 5'), null=True, blank=True) img_5 = models.ImageField(_('Photo # 5'), null=True, blank=True) video = models.URLField(_('Video url'), max_length=100, blank=True, null=False) keywords_SEO = models.TextField(_('Keywords SEO'), max_length=5000, blank=True, null=False) description_SEO = models.TextField(_('Description SEO'), max_length=5000, blank=True, null=False) class Meta: verbose_name_plural = _('Gallery') def get_absolute_url(self): return reverse('gallery:detail', args=[str(self.id)]) def get_edit_url(self): return reverse('gallery:edit', args=[str(self.id)]) def get_delete_url(self): return reverse('gallery:delete', args=[str(self.id)]) def __str__(self): return self.title_EN def __unicode__(self): return self.title_EN
46.45
101
0.698062
256
1,858
4.84375
0.230469
0.108871
0.094355
0.130645
0.542742
0.354839
0.324194
0.250806
0
0
0
0.027406
0.155544
1,858
39
102
47.641026
0.762906
0
0
0.064516
0
0
0.109257
0
0
0
0
0
0
1
0.16129
false
0
0.096774
0.16129
0.967742
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
0
0
0
1
1
0
0
2
17c5063a81cc8f6a2536a35b326364ce7821faf8
252
py
Python
fs/expose/wsgi/serve_home.py
jwilk-forks/pyfilesystem
44573f70e72b2cf378ee20d1c8bc2084ba975e16
[ "BSD-3-Clause" ]
314
2015-04-11T10:52:26.000Z
2022-01-26T07:00:30.000Z
fs/expose/wsgi/serve_home.py
jwilk-forks/pyfilesystem
44573f70e72b2cf378ee20d1c8bc2084ba975e16
[ "BSD-3-Clause" ]
94
2015-04-11T10:43:16.000Z
2021-10-06T11:21:26.000Z
fs/expose/wsgi/serve_home.py
jwilk-forks/pyfilesystem
44573f70e72b2cf378ee20d1c8bc2084ba975e16
[ "BSD-3-Clause" ]
95
2015-04-21T02:13:20.000Z
2021-11-26T05:07:59.000Z
from wsgiref.simple_server import make_server from fs.osfs import OSFS from wsgi import serve_fs osfs = OSFS('~/') application = serve_fs(osfs) httpd = make_server('', 8000, application) print "Serving on http://127.0.0.1:8000" httpd.serve_forever()
22.909091
45
0.757937
40
252
4.625
0.525
0.097297
0.118919
0
0
0
0
0
0
0
0
0.063063
0.119048
252
10
46
25.2
0.77027
0
0
0
0
0
0.134921
0
0
0
0
0
0
0
null
null
0
0.375
null
null
0.125
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
17cd8a2c1d841b0f6183ee1b877076e54ecbc5ac
1,161
py
Python
cornflow-server/cornflow/endpoints/token.py
ggsdc/corn
4c17c46a70f95b8882bcb6a55ef7daa1f69e0456
[ "MIT" ]
2
2020-07-09T20:58:47.000Z
2020-07-20T20:40:46.000Z
cornflow-server/cornflow/endpoints/token.py
baobabsoluciones/cornflow
bd7cae22107e5fe148704d5f41d4f58f9c410b40
[ "Apache-2.0" ]
2
2022-03-31T08:42:10.000Z
2022-03-31T12:05:23.000Z
cornflow-server/cornflow/endpoints/token.py
ggsdc/corn
4c17c46a70f95b8882bcb6a55ef7daa1f69e0456
[ "MIT" ]
null
null
null
# Import from libraries from cornflow_core.resources import BaseMetaResource from flask import request from flask_apispec import marshal_with, doc # Import from internal modules from ..schemas.user import TokenEndpointResponse from cornflow_core.exceptions import InvalidCredentials, ObjectDoesNotExist from ..shared.authentication import Auth from ..shared.const import ALL_DEFAULT_ROLES class TokenEndpoint(BaseMetaResource): ROLES_WITH_ACCESS = ALL_DEFAULT_ROLES def __init__(self): super().__init__() self.auth_class = Auth() @doc(description="Check token", tags=["Users"]) @marshal_with(TokenEndpointResponse) def get(self): """ API method to check if a token is valid. :return: A dictionary (containing the token and a boolean 'valid') and an integer with the HTTP status code. :rtype: Tuple(dict, integer) """ token = Auth().get_token_from_header(request.headers) try: self.get_user() except (InvalidCredentials, ObjectDoesNotExist): return {"token": token, "valid": 0}, 200 return {"token": token, "valid": 1}, 200
33.171429
116
0.699397
136
1,161
5.794118
0.507353
0.025381
0.040609
0.053299
0
0
0
0
0
0
0
0.008743
0.211886
1,161
34
117
34.147059
0.852459
0.198966
0
0
0
0
0.040495
0
0
0
0
0
0
1
0.095238
false
0
0.333333
0
0.619048
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
0
0
1
0
1
0
0
2
17d02881a63ce6e2bc4387798ca8fdada32ab815
1,043
py
Python
graph.py
gaagusac/Descendente
04203c59e552f53bc9b6decba7deaf926b77487b
[ "MIT" ]
null
null
null
graph.py
gaagusac/Descendente
04203c59e552f53bc9b6decba7deaf926b77487b
[ "MIT" ]
null
null
null
graph.py
gaagusac/Descendente
04203c59e552f53bc9b6decba7deaf926b77487b
[ "MIT" ]
null
null
null
import node import graphviz dot = graphviz.Graph(format="png") def create_gv(root: node.Node): if not root: return # print(root.token) label = '' if root.token == '+' \ or root.token == '-' \ or root.token == '*' \ or root.token == '/' \ or root.token == '(' \ or root.token == ')' \ or root.token == 'ε' \ or root.token == 'n': label = f'{root.token}' elif root.token == "T'" or root.token == "E'": label = f'{root.token}.inh = {root.inh} \\n {root.token}.syn = {root.syn}' else: label = f'{root.token}.val = {root.value}' dot.node(str(hash(root)), label, shape='plaintext') if not root.children: return for ch in root.children: dot.edge(str(hash(root)), str(hash(ch))) for child in root.children: create_gv(child) def view_gv(title="title goes here"): dot.attr(label=title) dot.attr(labelloc="top") dot.attr(labeljust="left") dot.view() dot.clear()
29.8
83
0.53116
139
1,043
3.964029
0.352518
0.245009
0.15971
0.163339
0.136116
0.136116
0.136116
0.136116
0.136116
0.136116
0
0
0.290508
1,043
35
84
29.8
0.744595
0.016299
0
0
0
0.032258
0.15338
0
0
0
0
0
0
1
0.064516
false
0
0.064516
0
0.129032
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
17de285b79f7ce5889ee49d69849e9ed170c16b4
2,825
py
Python
ven2/lib/python2.7/site-packages/zope/container/sample.py
manliu1225/Facebook_crawler
0f75a1c4382dd4effc3178d84b99b0cad97337cd
[ "Apache-2.0" ]
3
2019-03-29T19:49:05.000Z
2021-02-05T07:27:16.000Z
ven2/lib/python2.7/site-packages/zope/container/sample.py
manliu1225/Facebook_crawler
0f75a1c4382dd4effc3178d84b99b0cad97337cd
[ "Apache-2.0" ]
32
2015-05-20T07:21:45.000Z
2021-11-19T16:01:16.000Z
ven2/lib/python2.7/site-packages/zope/container/sample.py
manliu1225/Facebook_crawler
0f75a1c4382dd4effc3178d84b99b0cad97337cd
[ "Apache-2.0" ]
8
2015-04-03T08:28:25.000Z
2021-09-14T08:33:21.000Z
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """Sample container implementation. This is primarily for testing purposes. It might be useful as a mix-in for some classes, but many classes will need a very different implementation. """ __docformat__ = 'restructuredtext' from zope.container.interfaces import IContainer from zope.interface import implementer from zope.container.contained import Contained, setitem, uncontained @implementer(IContainer) class SampleContainer(Contained): """Sample container implementation suitable for testing. It is not suitable, directly as a base class unless the subclass overrides `_newContainerData` to return a persistent mapping object. """ def __init__(self): self.__data = self._newContainerData() def _newContainerData(self): """Construct an item-data container Subclasses should override this if they want different data. The value returned is a mapping object that also has `get`, `has_key`, `keys`, `items`, and `values` methods. """ return {} def keys(self): '''See interface `IReadContainer`''' return self.__data.keys() def __iter__(self): return iter(self.__data) def __getitem__(self, key): '''See interface `IReadContainer`''' return self.__data[key] def get(self, key, default=None): '''See interface `IReadContainer`''' return self.__data.get(key, default) def values(self): '''See interface `IReadContainer`''' return self.__data.values() def __len__(self): '''See interface `IReadContainer`''' return len(self.__data) def items(self): '''See interface `IReadContainer`''' return self.__data.items() def __contains__(self, key): '''See interface `IReadContainer`''' return key in self.__data has_key = __contains__ def __setitem__(self, key, object): '''See interface `IWriteContainer`''' setitem(self, self.__data.__setitem__, key, object) def __delitem__(self, key): '''See interface `IWriteContainer`''' uncontained(self.__data[key], self, key) del self.__data[key]
31.388889
78
0.643894
315
2,825
5.555556
0.406349
0.054857
0.104
0.128
0.168
0.147429
0.075429
0
0
0
0
0.004474
0.20885
2,825
89
79
31.741573
0.778523
0.467965
0
0
0
0
0.013019
0
0
0
0
0
0
1
0.375
false
0
0.09375
0.03125
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
0
0
1
0
0
2
aa17bb97b5f1a95b555df6adaee73c4b45594580
514
py
Python
draugr/torch_utilities/tensors/__init__.py
cnHeider/draugr
b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6
[ "Apache-2.0" ]
3
2019-09-27T08:04:59.000Z
2020-12-02T06:14:45.000Z
draugr/torch_utilities/tensors/__init__.py
cnHeider/draugr
b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6
[ "Apache-2.0" ]
64
2019-09-27T08:03:42.000Z
2022-03-28T15:07:30.000Z
draugr/torch_utilities/tensors/__init__.py
cnHeider/draugr
b95e0bb1fa5efa581bfb28ff604f296ed2e6b7d6
[ "Apache-2.0" ]
1
2020-10-01T00:18:57.000Z
2020-10-01T00:18:57.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Christian Heider Nielsen" __doc__ = r""" Created on 21/02/2020 """ from pathlib import Path with open(Path(__file__).parent / "README.md", "r") as this_init_file: __doc__ += this_init_file.read() from .info import * from .mixins import * from .normalise import * from .reshaping import * from .tensor_container import * from .to_scalar import * from .to_tensor import * from .dimension_order import * from .types import *
21.416667
70
0.684825
70
514
4.685714
0.614286
0.243902
0.073171
0
0
0
0
0
0
0
0
0.024155
0.194553
514
23
71
22.347826
0.768116
0.083658
0
0
0
0
0.170576
0
0
0
0
0
0
1
0
false
0
0.625
0
0.625
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
0
0
0
2
aa1c1d4629d64a70b5f6a286f9f65ffb187c40f2
1,699
py
Python
x-archive-temp/hw10/tests/q2.py
UCBerkeley-SCET/DataX-Berkeley
f912d22c838b511d3ada4ecfa3548afd80437b74
[ "Apache-2.0" ]
28
2020-06-15T23:53:36.000Z
2022-03-19T09:27:02.000Z
x-archive-temp/hw10/tests/q2.py
UCBerkeley-SCET/DataX-Berkeley
f912d22c838b511d3ada4ecfa3548afd80437b74
[ "Apache-2.0" ]
4
2020-06-24T22:20:31.000Z
2022-02-28T01:37:36.000Z
x-archive-temp/hw10/tests/q2.py
UCBerkeley-SCET/DataX-Berkeley
f912d22c838b511d3ada4ecfa3548afd80437b74
[ "Apache-2.0" ]
78
2020-06-19T09:41:01.000Z
2022-02-05T00:13:29.000Z
test = { 'name': 'q2', 'points': 6, 'suites': [ { 'cases': [ {'code': ">>> model.get_layer(index=0).output_shape[1] \n" '300', 'hidden': False, 'locked': False}, {'code': ">>> model.get_layer(index=1).output_shape[1] \n" '200', 'hidden': False, 'locked': False}, {'code': ">>> model.get_layer(index=2).output_shape[1] \n" '100', 'hidden': False, 'locked': False}, {'code': ">>> model.get_layer(index=3).output_shape[1] \n" '10', 'hidden': False, 'locked': False}, {'code': ">>> model.get_layer(index=3).get_config()['activation'] \n" '\'softmax\'', 'hidden': False, 'locked': False}, {'code': ">>> model.get_layer(index=1).get_config()['activation'] \n" '\'relu\'', 'hidden': False, 'locked': False}, ], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
51.484848
139
0.26957
103
1,699
4.330097
0.349515
0.121076
0.161435
0.2287
0.55157
0.502242
0.502242
0.502242
0.502242
0.403587
0
0.033094
0.590936
1,699
32
140
53.09375
0.608633
0
0
0.387097
0
0
0.274279
0.154208
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
1
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
2
aa2b15a620300734ab6b405a475d9c4850f39849
3,589
py
Python
matrix.py
aashish2000/object_det_3d_server
dfda7ad9725b9f39afdeb49791051b15a9282089
[ "MIT" ]
null
null
null
matrix.py
aashish2000/object_det_3d_server
dfda7ad9725b9f39afdeb49791051b15a9282089
[ "MIT" ]
null
null
null
matrix.py
aashish2000/object_det_3d_server
dfda7ad9725b9f39afdeb49791051b15a9282089
[ "MIT" ]
null
null
null
import numpy as np def projection_mat(file_path): with open(file_path,"r") as f: content = f.readlines() extrinsic = np.transpose(np.reshape(np.fromstring(content[1].strip()[2:-2], sep=", ").astype(np.float32),(-1,4))) extrinsic *= np.array([ [ 1.0, -1.0, -1.0, 1.0], [-1.0, 1.0, 1.0, -1.0], [-1.0, 1.0, 1.0, -1.0], [ 1.0, 1.0, 1.0, 1.0]], dtype = np.float32) final_extrinsic = extrinsic[0:3][0:4] intrinsic_mama = np.array([[4.76464003e+03, 1.49280856e+01, 5.16860724e+02], [0.00000000e+00, 4.30386310e+03, 3.04258145e+03], [0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) # intrinsic = np.array([[ 1.30609801e+03, -1.70266591e+00, 5.11800168e+02], [ 0.00000000e+00, 1.31574036e+03, 1.10658204e+03], [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) intrinsic_sourav = np.array([[ 3.97876660e+03, -4.87895214e+01, 2.54230438e+01], [ 0.00000000e+00, 3.97931790e+03, 2.82905708e+02], [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) # intrinsic = np.array([[4.28627017e+03, 1.47725457e+02, 1.80509276e+02], # [0.00000000e+00, 4.00600618e+03, 2.57364938e+03], # [0.00000000e+00, 0.00000000e+00, 1.00000000e+00]], dtype=np.float32) intrinsic = intrinsic_sourav # intrinsic = np.array([[5.74906597e+03, 2.72691688e+01, 5.30390810e+02], # [0.00000000e+00, 4.88537018e+03, 3.97510802e+03], # [0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) # intrinsic = np.array([[1.01957428e+03, 0.00000000e+00, 5.82486145e+02], # [0.00000000e+00, 1.03348171e+03, 1.08826508e+03], # [0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) projection_matrix = np.matmul(intrinsic,final_extrinsic) # print(projection_matrix) return(projection_matrix) def pose_to_projection(file_path): with open(file_path,"r") as f: content = f.readlines() out_pose = np.transpose(np.reshape(np.fromstring(content[2].strip()[2:-2], sep=", ").astype(np.float32),(-1,4))) rotation_transpose = np.delete(np.delete(np.transpose(out_pose), 3, 1), 3, 0) # rotation_transpose[0][3] = 0 # rotation_transpose[1][3] = 0 # rotation_transpose[2][3] = 0 # print(rotation_transpose) intrinsic_mama = np.array([[4.76464003e+03, 1.49280856e+01, 5.16860724e+02], [0.00000000e+00, 4.30386310e+03, 3.04258145e+03], [0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) # intrinsic = np.array([[ 1.30609801e+03, -1.70266591e+00, 5.11800168e+02], [ 0.00000000e+00, 1.31574036e+03, 1.10658204e+03], [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) intrinsic_sourav = np.array([[ 3.97876660e+03, -4.87895214e+01, 2.54230438e+01], [ 0.00000000e+00, 3.97931790e+03, 2.82905708e+02], [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) column = np.transpose([out_pose[:,3]*-1])[:3] # identity = np.delete(np.identity(4),3,1) # print("Column: ",column) rotation_column = np.matmul(rotation_transpose,column) extrinsic_matrix = np.concatenate((rotation_transpose,rotation_column), axis = 1) # print("Identity: ", identity) # column_identity = np.concatenate((identity,column),axis = 1) # column_identity[3][3] *= -1 # print(column_identity) # extrinsic_matrix = np.matmul(rotation_transpose,column_identity) # print(extrinsic_matrix) # intrinsic_matrix = np.array([[ 1.30609801e+03, -1.70266591e+00, 5.11800168e+02], [ 0.00000000e+00, 1.31574036e+03, 1.10658204e+03], [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]]) intrinsic_matrix = intrinsic_sourav projection_matrix = np.matmul(intrinsic_matrix,extrinsic_matrix) return(projection_matrix)
42.72619
190
0.674004
554
3,589
4.287004
0.148014
0.189895
0.156632
0.025263
0.649263
0.560421
0.560421
0.509895
0.509895
0.487158
0
0.343408
0.133463
3,589
83
191
43.240964
0.420257
0.424631
0
0.555556
0
0
0.002943
0
0
0
0
0
0
1
0.055556
false
0
0.027778
0
0.083333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
aa323e1eb4195e117a74365893fd92ac49aa70ef
513
py
Python
tests/tests/test_conditions.py
TodWell/ButtonBob
486816d59f1e698306c611d44a8e8bff1432a81f
[ "MIT" ]
null
null
null
tests/tests/test_conditions.py
TodWell/ButtonBob
486816d59f1e698306c611d44a8e8bff1432a81f
[ "MIT" ]
null
null
null
tests/tests/test_conditions.py
TodWell/ButtonBob
486816d59f1e698306c611d44a8e8bff1432a81f
[ "MIT" ]
null
null
null
import unittest from BobsConditions import FooEqual, FooDifference class MyTestCase(unittest.TestCase): def test_something(self): condition_1 = FooEqual('test_foo_equal', None, 12) condition_2 = FooDifference('test_foo_difference', None, 10) conditions = [ condition_1, condition_2, condition_1 + condition_2, condition_1 * condition_2 ] self.assertEqual(True, False) if __name__ == '__main__': unittest.main()
23.318182
68
0.641326
53
513
5.811321
0.54717
0.12987
0.185065
0.194805
0.194805
0.194805
0.194805
0.194805
0
0
0
0.032345
0.276803
513
21
69
24.428571
0.797844
0
0
0
0
0
0.079922
0
0
0
0
0
0.066667
1
0.066667
false
0
0.133333
0
0.266667
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
0
0
0
2
aa46e36e66d835ded2518d58345d3ae0f71e335a
5,967
py
Python
hatsploit/core/db/importer.py
enty8080/HatSplo
57ea81c2bc73838cbf7d7062d7e665eda1143d18
[ "MIT" ]
null
null
null
hatsploit/core/db/importer.py
enty8080/HatSplo
57ea81c2bc73838cbf7d7062d7e665eda1143d18
[ "MIT" ]
null
null
null
hatsploit/core/db/importer.py
enty8080/HatSplo
57ea81c2bc73838cbf7d7062d7e665eda1143d18
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2021 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # import importlib.util import json import os import string import sys import threading import time from hatsploit.core.base.exceptions import Exceptions from hatsploit.core.cli.badges import Badges from hatsploit.core.db.db import DB from hatsploit.lib.config import Config from hatsploit.lib.storage import LocalStorage class Importer: db = DB() badges = Badges() local_storage = LocalStorage() config = Config() exceptions = Exceptions() @staticmethod def import_check(module_name): try: __import__(module_name) except ModuleNotFoundError: return False except Exception: return True return True def import_command(self, command_path): try: if not command_path.endswith('.py'): command_path = command_path + '.py' spec = importlib.util.spec_from_file_location(command_path, command_path) command = importlib.util.module_from_spec(spec) spec.loader.exec_module(command) command = command.HatSploitCommand() except Exception as e: self.badges.print_information('Reason: ' + str(e)) raise self.exceptions.GlobalException return command def import_payload(self, payload_path): try: if not payload_path.endswith('.py'): payload_path = payload_path + '.py' spec = importlib.util.spec_from_file_location(payload_path, payload_path) payload = importlib.util.module_from_spec(spec) spec.loader.exec_module(payload) payload = payload.HatSploitPayload() except Exception as e: self.badges.print_information('Reason: ' + str(e)) raise self.exceptions.GlobalException return payload def import_module(self, module_path): try: if not module_path.endswith('.py'): module_path = module_path + '.py' spec = importlib.util.spec_from_file_location(module_path, module_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) module = module.HatSploitModule() except Exception as e: self.badges.print_information('Reason: ' + str(e)) raise self.exceptions.GlobalException return module def import_plugin(self, plugin_path): try: if not plugin_path.endswith('.py'): plugin_path = plugin_path + '.py' spec = importlib.util.spec_from_file_location(plugin_path, plugin_path) plugin = importlib.util.module_from_spec(spec) spec.loader.exec_module(plugin) plugin = plugin.HatSploitPlugin() except Exception as e: self.badges.print_information('Reason: ' + str(e)) raise self.exceptions.GlobalException return plugin def import_main_commands(self): commands = self.import_commands(self.config.path_config['commands_path']) self.local_storage.set("commands", commands) def import_commands(self, path): if not path.endswith('/'): path += '/' commands = {} command_path = os.path.split(path)[0] try: for file in os.listdir(command_path): if file.endswith('py'): try: command_object = self.import_command(command_path + '/' + file[:-3]) command_name = command_object.details['Name'] commands[command_name] = command_object except Exception: self.badges.print_error(f"Failed to load {file[:-3]} command!") except Exception: pass return commands def import_database(self): self.db.connect_module_database(self.config.db_config['base_dbs']['module_database_name'], self.config.path_config['db_path'] + self.config.db_config['base_dbs'][ 'module_database']) self.db.connect_payload_database(self.config.db_config['base_dbs']['payload_database_name'], self.config.path_config['db_path'] + self.config.db_config['base_dbs'][ 'payload_database']) self.db.connect_plugin_database(self.config.db_config['base_dbs']['plugin_database_name'], self.config.path_config['db_path'] + self.config.db_config['base_dbs'][ 'plugin_database']) def import_all(self, import_database): self.import_main_commands() if import_database: self.import_database()
40.04698
113
0.633819
693
5,967
5.282828
0.255411
0.027315
0.019667
0.0295
0.301011
0.301011
0.301011
0.294455
0.257034
0.210052
0
0.0028
0.281716
5,967
148
114
40.317568
0.851377
0.182001
0
0.247706
0
0
0.061149
0.004324
0
0
0
0
0
1
0.082569
false
0.009174
0.330275
0
0.541284
0.045872
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
0
1
0
0
2
a4ac10dae975b9164d133594e1fce752a2a9f29c
95
py
Python
tests/prueba_multyield.py
ADCenterNetwork/discern
29188cc12d00319d6687d853e0f361ac3661f920
[ "Apache-2.0" ]
1
2021-02-17T09:55:32.000Z
2021-02-17T09:55:32.000Z
tests/prueba_multyield.py
ADCenterNetwork/discern
29188cc12d00319d6687d853e0f361ac3661f920
[ "Apache-2.0" ]
4
2020-11-17T10:31:26.000Z
2020-12-01T09:06:46.000Z
tests/prueba_multyield.py
ADCenterNetwork/discern
29188cc12d00319d6687d853e0f361ac3661f920
[ "Apache-2.0" ]
2
2020-11-17T07:05:02.000Z
2020-11-17T09:44:22.000Z
def generator(num): if num < 0: yield 'negativo' else: yield 'positivo'
19
24
0.536842
11
95
4.636364
0.818182
0
0
0
0
0
0
0
0
0
0
0.016393
0.357895
95
5
25
19
0.819672
0
0
0
0
0
0.166667
0
0
0
0
0
0
1
0.2
false
0
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
0
0
0
0
0
0
2
a4ae315bb6a936f2e1127ead3a61bc04eb8068f0
2,293
py
Python
rl_bolts/_nbdev.py
jfpettit/rl_bolts
c3c3b3f91ee192048912fd48f2655b46526918a7
[ "Apache-2.0" ]
2
2020-11-11T13:40:30.000Z
2021-03-16T01:38:01.000Z
rl_bolts/_nbdev.py
jfpettit/rl_bolts
c3c3b3f91ee192048912fd48f2655b46526918a7
[ "Apache-2.0" ]
null
null
null
rl_bolts/_nbdev.py
jfpettit/rl_bolts
c3c3b3f91ee192048912fd48f2655b46526918a7
[ "Apache-2.0" ]
null
null
null
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"color2num": "00_utils.ipynb", "colorize": "00_utils.ipynb", "calc_logstd_anneal": "00_utils.ipynb", "save_frames_as_gif": "00_utils.ipynb", "conv2d_output_size": "00_utils.ipynb", "num2tuple": "00_utils.ipynb", "conv2d_output_shape": "00_utils.ipynb", "convtransp2d_output_shape": "00_utils.ipynb", "Saver": "00_utils.ipynb", "printdict": "00_utils.ipynb", "PolicyGradientRLDataset": "01_datasets.ipynb", "QPolicyGradientRLDataset": "01_datasets.ipynb", "PGBuffer": "02_buffers.ipynb", "ReplayBuffer": "02_buffers.ipynb", "MLP": "03_neuralnets.ipynb", "CNN": "03_neuralnets.ipynb", "Actor": "03_neuralnets.ipynb", "CategoricalPolicy": "03_neuralnets.ipynb", "GaussianPolicy": "03_neuralnets.ipynb", "ActorCritic": "03_neuralnets.ipynb", "MLPQActor": "03_neuralnets.ipynb", "MLPQFunction": "03_neuralnets.ipynb", "actor_critic_value_loss": "04_losses.ipynb", "reinforce_policy_loss": "04_losses.ipynb", "a2c_policy_loss": "04_losses.ipynb", "ppo_clip_policy_loss": "04_losses.ipynb", "ddpg_policy_loss": "04_losses.ipynb", "ddpg_qfunc_loss": "04_losses.ipynb", "td3_policy_loss": "04_losses.ipynb", "td3_qfunc_loss": "04_losses.ipynb", "sac_policy_loss": "04_losses.ipynb", "sac_qfunc_loss": "04_losses.ipynb", "ToTorchWrapper": "05_env_wrappers.ipynb", "StateNormalizeWrapper": "05_env_wrappers.ipynb", "RewardScalerWrapper": "05_env_wrappers.ipynb", "BestPracticesWrapper": "05_env_wrappers.ipynb", "polgrad_interaction_loop": "06_loops.ipynb", "PPO": "07_algorithms.ipynb"} modules = ["utils.py", "datasets.py", "buffers.py", "neuralnets.py", "losses.py", "env_wrappers.py", "loops.py", "algorithms.py"] doc_url = "https://jfpettit.github.io/rl_bolts/rl_bolts/" git_url = "https://github.com/jfpettit/rl_bolts/tree/master/" def custom_doc_links(name): return None
39.534483
61
0.619712
251
2,293
5.294821
0.374502
0.052671
0.090293
0.127916
0.234763
0.040632
0
0
0
0
0
0.047565
0.22983
2,293
57
62
40.22807
0.704983
0.0157
0
0
1
0
0.615965
0.108647
0
0
0
0
0
1
0.02
false
0
0
0.02
0.02
0.02
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
a4b317444b88bb7d10e5414597351e5d5549945f
191
py
Python
digit_sum.py
jyoti140220/function_logical_quetion_python
50e3da10e0cc02cb78e5d429f2c87c0a171bd693
[ "MIT" ]
null
null
null
digit_sum.py
jyoti140220/function_logical_quetion_python
50e3da10e0cc02cb78e5d429f2c87c0a171bd693
[ "MIT" ]
null
null
null
digit_sum.py
jyoti140220/function_logical_quetion_python
50e3da10e0cc02cb78e5d429f2c87c0a171bd693
[ "MIT" ]
null
null
null
def sumofdigits(number): sum = 0 modulus = 0 while number!=0 : modulus = number%10 sum+=modulus number/=10 return sum print(sumofdigits(123))
19.1
28
0.549738
22
191
4.772727
0.5
0.152381
0.285714
0
0
0
0
0
0
0
0
0.081301
0.356021
191
10
29
19.1
0.772358
0
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
false
0
0
0
0.222222
0.111111
1
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
a4b60b62cd1ef8d8caa730049e1b6fc6a42405b4
1,791
py
Python
NewYorkTimesHeadlineScaper.py
PatelProjects/New-York-Times-Headline-Scaper
14b3af102990d056a57e39cd8e3bf7512ff7d707
[ "MIT" ]
null
null
null
NewYorkTimesHeadlineScaper.py
PatelProjects/New-York-Times-Headline-Scaper
14b3af102990d056a57e39cd8e3bf7512ff7d707
[ "MIT" ]
null
null
null
NewYorkTimesHeadlineScaper.py
PatelProjects/New-York-Times-Headline-Scaper
14b3af102990d056a57e39cd8e3bf7512ff7d707
[ "MIT" ]
null
null
null
import requests from bs4 import BeautifulSoup print("Running...") base_url = 'http://www.nytimes.com' r = requests.get(base_url) soup = BeautifulSoup(r.text.encode("utf-8", "ignore"), "lxml") def replaceIt(string1): string2 = string1.replace('\\xe2\\x80\\x99', "'"). \ replace('\\xc3\\xa9', 'e'). \ replace('\\xe2\\x80\\x90', '-'). \ replace('\\xe2\\x80\\x91', '-'). \ replace('\\xe2\\x80\\x92', '-'). \ replace('\\xe2\\x80\\x93', '-'). \ replace('\\xe2\\x80\\x94', '-'). \ replace('\\xe2\\x80\\x94', '-'). \ replace('\\xe2\\x80\\x98', "'"). \ replace('\\xe2\\x80\\x9b', "'"). \ replace('\\xe2\\x80\\x9c', '"'). \ replace('\\xe2\\x80\\x9c', '"'). \ replace('\\xe2\\x80\\x9d', '"'). \ replace('\\xe2\\x80\\x9e', '"'). \ replace('\\xe2\\x80\\x9f', '"'). \ replace('\\xe2\\x80\\xa6', '...'). \ replace('\\xe2\\x80\\xb2', "'"). \ replace('\\xe2\\x80\\xb3', "'"). \ replace('\\xe2\\x80\\xb4', "'"). \ replace('\\xe2\\x80\\xb5', "'"). \ replace('\\xe2\\x80\\xb6', "'"). \ replace('\\xe2\\x80\\xb7', "'"). \ replace('\\xe2\\x81\\xba', "+"). \ replace('\\xe2\\x81\\xbb', "-"). \ replace('\\xe2\\x81\\xbc', "="). \ replace('\\xe2\\x81\\xbd', "("). \ replace('\\xe2\\x81\\xbe', ")") return string2 print("\n"+"*"*40+"\n"+"HEADLINES") for story_heading in soup.find_all(class_="story-heading"): if story_heading.a: print(replaceIt(str(story_heading.a.text.replace("\n", " ").encode("utf-8").strip())).strip('b').strip("'")) else: print(replaceIt(str(story_heading.contents[0].encode("utf-8").strip())).strip('b').strip("'"))
34.442308
116
0.46622
193
1,791
4.284974
0.393782
0.314389
0.330109
0.038694
0.241838
0.171705
0.171705
0
0
0
0
0.085837
0.21943
1,791
52
117
34.442308
0.505722
0
0
0.097561
0
0
0.290341
0
0
0
0
0
0
1
0.02439
false
0
0.04878
0
0.097561
0.097561
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
0
0
2
a4c0e0a59c799e55b0a5a36676c153f4228eb181
1,536
py
Python
cbuild/core/paths.py
ismith/cports
9fe76e231872e0b03b425252b5fc5e1d9af2a6d8
[ "BSD-2-Clause" ]
null
null
null
cbuild/core/paths.py
ismith/cports
9fe76e231872e0b03b425252b5fc5e1d9af2a6d8
[ "BSD-2-Clause" ]
null
null
null
cbuild/core/paths.py
ismith/cports
9fe76e231872e0b03b425252b5fc5e1d9af2a6d8
[ "BSD-2-Clause" ]
null
null
null
# Provides current locations of all the global paths. import pathlib _stage = 2 def init(distdir, masterdir, hostdir): global _ddir, _mdir, _hdir, _srcs, _cbdir cwd = pathlib.Path.cwd() _ddir = pathlib.Path(distdir) _mdir = (cwd / masterdir).resolve() _hdir = (cwd / hostdir).resolve() _srcs = _hdir / "sources" _cbdir = _ddir / "cbuild" def reinit_masterdir(masterdir, stage): global _mdir if stage == 2: _mdir = masterdir else: oname = masterdir.name _mdir = masterdir.with_name(f"{oname}-stage{stage}") def set_stage(stage): global _stage _stage = stage def distdir(): return _ddir def masterdir(): return _mdir def hostdir(): return _hdir def repository(): if _stage == 2: return hostdir() / "binpkgs" else: return hostdir() / f"binpkgs-stage{_stage}" def sources(): return _srcs def cbuild(): return _cbdir def prepare(): hostdir().mkdir(parents = True, exist_ok = True) sources().mkdir(parents = True, exist_ok = True) (masterdir() / "builddir").mkdir(parents = True, exist_ok = True) (masterdir() / "destdir").mkdir(parents = True, exist_ok = True) repository().mkdir(parents = True, exist_ok = True) (hostdir() / "ccache").mkdir(exist_ok = True) # prepare masterdir for f in [ "builddir", "destdir", "binpkgs", "sources", "ccache", "dev", "sys", "tmp", "proc", "host", "boot", ]: (masterdir() / f).mkdir(parents = True, exist_ok = True)
23.630769
69
0.61849
181
1,536
5.055249
0.303867
0.053552
0.084153
0.137705
0.196721
0.196721
0.078689
0
0
0
0
0.002573
0.240885
1,536
64
70
24
0.782161
0.044922
0
0.042553
0
0
0.094262
0.014344
0
0
0
0
0
1
0.212766
false
0
0.021277
0.106383
0.382979
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
0
0
0
2
a4ca928bce026d448fb501c5dd5bc18187cb7a98
378
py
Python
118-Pascals-Triangle/solution.py
alfmunny/leetcode
e35d2164c7e6e66410309fe1667ceab5a7689bef
[ "MIT" ]
null
null
null
118-Pascals-Triangle/solution.py
alfmunny/leetcode
e35d2164c7e6e66410309fe1667ceab5a7689bef
[ "MIT" ]
null
null
null
118-Pascals-Triangle/solution.py
alfmunny/leetcode
e35d2164c7e6e66410309fe1667ceab5a7689bef
[ "MIT" ]
null
null
null
class Solution: def generate(self, numRows: int) -> List[List[int]]: ans = [] for i in range(1, numRows+1): level = [1] * i if ans: for j in range(1, i-1): level[j] = ans[-1][j-1] + ans[-1][j] ans.append(level) return ans
25.2
56
0.365079
44
378
3.136364
0.431818
0.086957
0.115942
0
0
0
0
0
0
0
0
0.043011
0.507937
378
14
57
27
0.698925
0
0
0
1
0
0
0
0
0
0
0
0
1
0.1
false
0
0
0
0.3
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
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
2
a4d2ecad6e68546c31cce7a32128bf2585a472b3
1,273
py
Python
datalite3/constraints.py
afdaniele/datalite3
7a9eec56c42078001f141862e4e9fef5a9785374
[ "MIT" ]
null
null
null
datalite3/constraints.py
afdaniele/datalite3
7a9eec56c42078001f141862e4e9fef5a9785374
[ "MIT" ]
null
null
null
datalite3/constraints.py
afdaniele/datalite3
7a9eec56c42078001f141862e4e9fef5a9785374
[ "MIT" ]
null
null
null
""" datalite3.constraints module introduces constraint types that can be used to hint field variables, that can be used to signal datalite decorator constraints in the database. """ from typing import TypeVar, Union, Tuple, List T = TypeVar('T') # TODO: starting with Python 3.9 the Annotated type is available. # This is a good replacement for the Generic classes used for Unique and Primary. # Docs says: # Specifically, a type T can be annotated with metadata x via the typehint # Annotated[T, x]. This metadata can be used for either static analysis or at runtime. # If a library (or tool) encounters a typehint Annotated[T, x] and has no special # logic for metadata x, it should ignore it and simply treat the type as T. class ConstraintFailedError(Exception): """ This exception is raised when a Constraint fails. """ pass """ Dataclass fields hinted with this type signals datalite that the bound column of this field in the table is NOT NULL and UNIQUE. """ Unique = Union[T, Tuple[T]] """ Dataclass fields hinted with this type signals datalite that the bound column of this field in the table is part of the PRIMARY KEY. """ Primary = Union[T, List[T]]
30.309524
97
0.697565
190
1,273
4.673684
0.494737
0.022523
0.030405
0.029279
0.234234
0.20045
0.20045
0.20045
0.20045
0.20045
0
0.003106
0.241163
1,273
41
98
31.04878
0.916149
0.596229
0
0
0
0
0.005181
0
0
0
0
0.02439
0
1
0
false
0.166667
0.166667
0
0.333333
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
0
0
1
0
0
0
0
0
2
a4d7c88c351a81b03d8a29817f3249ff44c4bf51
894
py
Python
cleaning/partition_domains_fixed_block_size.py
AGLDWG/ld-link-harvester
64f33cc7ddb36069d0e0e3f3c9529aab88ef9ddc
[ "Apache-2.0" ]
null
null
null
cleaning/partition_domains_fixed_block_size.py
AGLDWG/ld-link-harvester
64f33cc7ddb36069d0e0e3f3c9529aab88ef9ddc
[ "Apache-2.0" ]
null
null
null
cleaning/partition_domains_fixed_block_size.py
AGLDWG/ld-link-harvester
64f33cc7ddb36069d0e0e3f3c9529aab88ef9ddc
[ "Apache-2.0" ]
null
null
null
import pandas as pd IN_FILE = 'aus-domain-urls.txt' START_IDX = 1186 BLOCK_SIZE = 100 OUT_FILE_PREFIX = 'partition_data/aus-domain-urls' data = pd.read_csv(IN_FILE) data_length = len(data) for i in range(int(data_length - START_IDX / BLOCK_SIZE)): if i == 0: lower_bound = START_IDX else: lower_bound = upper_bound upper_bound = lower_bound + BLOCK_SIZE if upper_bound >= data_length: upper_bound = data_length - 1 out_file = '{}_{}_{}_{}.txt'.format(OUT_FILE_PREFIX, lower_bound, upper_bound, upper_bound - lower_bound) (data.iloc[lower_bound:upper_bound, :]).to_csv(out_file, header=False, index=None, sep=" ") break out_file = '{}_{}_{}_{}.txt'.format(OUT_FILE_PREFIX, lower_bound, upper_bound, upper_bound - lower_bound) (data.iloc[ lower_bound:upper_bound, : ]).to_csv(out_file, header=False, index=None, sep=" ")
37.25
113
0.689038
134
894
4.216418
0.328358
0.176991
0.212389
0.176991
0.538053
0.538053
0.538053
0.538053
0.467257
0.467257
0
0.012278
0.180089
894
23
114
38.869565
0.758527
0
0
0.2
0
0
0.090705
0.033595
0
0
0
0
0
1
0
false
0
0.05
0
0.05
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
0
0
0
2
a4e7e26830d75cfeb916ab899e5f6822a76298bc
456
py
Python
commerce/auctions/admin.py
CM-MORRIS/commerce
440814944bd1ed410bd47a8ef95a620b05571e95
[ "MIT" ]
null
null
null
commerce/auctions/admin.py
CM-MORRIS/commerce
440814944bd1ed410bd47a8ef95a620b05571e95
[ "MIT" ]
null
null
null
commerce/auctions/admin.py
CM-MORRIS/commerce
440814944bd1ed410bd47a8ef95a620b05571e95
[ "MIT" ]
1
2020-11-23T10:46:48.000Z
2020-11-23T10:46:48.000Z
from django.contrib import admin from .models import User, Listings, Bids, Comments, Watchlist # admin user interface can be used to view, add, edit, delete from tables # Use 'python manage.py createsuperuser' to create a superuser logged_in_user # access admin page using '/admin' # Register your models here. admin.site.register(User) admin.site.register(Listings) admin.site.register(Bids) admin.site.register(Comments) admin.site.register(Watchlist)
32.571429
77
0.79386
67
456
5.373134
0.567164
0.125
0.236111
0
0
0
0
0
0
0
0
0
0.118421
456
13
78
35.076923
0.895522
0.453947
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.285714
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
a4ec58e5c69ce3036ff25ef5cd79b200eead7b8d
16,829
py
Python
tr/books/volumes/V_20000LeaguesUnderTheSea.py
hegistva/sync-reader
2eceba5b1fd572b077a039ca20fac5c2da4d8a26
[ "MIT" ]
null
null
null
tr/books/volumes/V_20000LeaguesUnderTheSea.py
hegistva/sync-reader
2eceba5b1fd572b077a039ca20fac5c2da4d8a26
[ "MIT" ]
null
null
null
tr/books/volumes/V_20000LeaguesUnderTheSea.py
hegistva/sync-reader
2eceba5b1fd572b077a039ca20fac5c2da4d8a26
[ "MIT" ]
null
null
null
from tr.libs.trans import utils from tr.books.books import AUDIO_FILE, AUDIO_START, AUDIO_STOP, AUTHOR, TRANSLATIONS, CHAPTERS, FIRST_LINE, LAST_LINE, TITLE, URL, IDX VOLUME = { '20000LeaguesUnderTheSea': { AUTHOR: 'Jules Verne', TRANSLATIONS: { utils.Lang.FRA: { TITLE: '20000 Lieues sous les mers', URL: 'http://www.gutenberg.org/cache/epub/5097/pg5097.txt', CHAPTERS: [ { IDX: 1, FIRST_LINE: 111, LAST_LINE: 365, AUDIO_FILE: '20000lieues_1_01_verne_64kb.mp3', AUDIO_START: '00:00:28', AUDIO_STOP:'00:16:42' }, { IDX: 2, FIRST_LINE: 369, LAST_LINE: 604, AUDIO_FILE: '20000lieues_1_02_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:13:11' }, { IDX: 3, FIRST_LINE: 608, LAST_LINE: 844, AUDIO_FILE: '20000lieues_1_03_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:11:56' }, { IDX: 4, FIRST_LINE: 848, LAST_LINE: 1138, AUDIO_FILE: '20000lieues_1_04_verne_64kb.mp3', AUDIO_START: '00:00:29', AUDIO_STOP:'00:15:31' }, { IDX: 5, FIRST_LINE: 1142, LAST_LINE: 1392, AUDIO_FILE: '20000lieues_1_05_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:14:11' }, { IDX: 6, FIRST_LINE: 1396, LAST_LINE: 1798, AUDIO_FILE: '20000lieues_1_06_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:20:21' }, { IDX: 7, FIRST_LINE: 1802, LAST_LINE: 2154, AUDIO_FILE: '20000lieues_1_07_verne_64kb.mp3', AUDIO_START: '00:00:24', AUDIO_STOP:'00:17:22' }, { IDX: 8, FIRST_LINE: 2158, LAST_LINE: 2488, AUDIO_FILE: '20000lieues_1_08_verne_64kb.mp3', AUDIO_START: '00:00:24.5', AUDIO_STOP:'00:19:06' }, { IDX: 9, FIRST_LINE: 2492, LAST_LINE: 2797, AUDIO_FILE: '20000lieues_1_09_verne_64kb.mp3', AUDIO_START: '00:00:19', AUDIO_STOP:'00:14:41' }, { IDX: 10, FIRST_LINE: 2801, LAST_LINE: 3191, AUDIO_FILE: '20000lieues_1_10_verne_64kb.mp3', AUDIO_START: '00:00:18.5', AUDIO_STOP:'00:19:15' }, { IDX: 11, FIRST_LINE: 3195, LAST_LINE: 3512, AUDIO_FILE: '20000lieues_1_11_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:20:00' }, { IDX: 12, FIRST_LINE: 3516, LAST_LINE: 3809, AUDIO_FILE: '20000lieues_1_12_verne_64kb.mp3', AUDIO_START: '00:00:26.5', AUDIO_STOP:'00:16:41' }, { IDX: 13, FIRST_LINE: 3813, LAST_LINE: 4107, AUDIO_FILE: '20000lieues_1_13_verne_64kb.mp3', AUDIO_START: '00:00:28', AUDIO_STOP:'00:15:23' }, { IDX: 14, FIRST_LINE: 4111, LAST_LINE: 4606, AUDIO_FILE: '20000lieues_1_14_verne_64kb.mp3', AUDIO_START: '00:00:26', AUDIO_STOP:'00:25:53' }, { IDX: 15, FIRST_LINE: 4610, LAST_LINE: 4981, AUDIO_FILE: '20000lieues_1_15_verne_64kb.mp3', AUDIO_START: '00:00:23', AUDIO_STOP:'00:16:07' }, { IDX: 16, FIRST_LINE: 4985, LAST_LINE: 5242, AUDIO_FILE: '20000lieues_1_16_verne_64kb.mp3', AUDIO_START: '00:00:23', AUDIO_STOP:'00:15:57' }, { IDX: 17, FIRST_LINE: 5246, LAST_LINE: 5512, AUDIO_FILE: '20000lieues_1_17_verne_64kb.mp3', AUDIO_START: '00:00:19', AUDIO_STOP:'00:13:56' }, { IDX: 18, FIRST_LINE: 5516, LAST_LINE: 5844, AUDIO_FILE: '20000lieues_1_18_verne_64kb.mp3', AUDIO_START: '00:00:23', AUDIO_STOP:'00:18:08' }, { IDX: 19, FIRST_LINE: 5848, LAST_LINE: 6256, AUDIO_FILE: '20000lieues_1_19_verne_64kb.mp3', AUDIO_START: '00:00:21.5', AUDIO_STOP:'00:21:42' }, { IDX: 20, FIRST_LINE: 6260, LAST_LINE: 6616, AUDIO_FILE: '20000lieues_1_20_verne_64kb.mp3', AUDIO_START: '00:00:23.5', AUDIO_STOP:'00:18:05' }, { IDX: 21, FIRST_LINE: 6620, LAST_LINE: 7125, AUDIO_FILE: '20000lieues_1_21_verne_64kb.mp3', AUDIO_START: '00:00:25.5', AUDIO_STOP:'00:24:16' }, { IDX: 22, FIRST_LINE: 7129, LAST_LINE: 7660, AUDIO_FILE: '20000lieues_1_22_verne_64kb.mp3', AUDIO_START: '00:00:24.0', AUDIO_STOP:'00:23:42' }, { IDX: 23, FIRST_LINE: 7664, LAST_LINE: 8033, AUDIO_FILE: '20000lieues_1_23_verne_64kb.mp3', AUDIO_START: '00:00:24.5', AUDIO_STOP:'00:20:32' }, { IDX: 24, FIRST_LINE: 8037, LAST_LINE: 8359, AUDIO_FILE: '20000lieues_1_24_verne_64kb.mp3', AUDIO_START: '00:00:27.0', AUDIO_STOP:'00:18:17' }, { IDX: 25, FIRST_LINE: 8471, LAST_LINE: 8876, AUDIO_FILE: '20000lieues_2_01_verne_64kb.mp3', AUDIO_START: '00:00:21.0', AUDIO_STOP:'00:22:04' }, { IDX: 26, FIRST_LINE: 8880, LAST_LINE: 9330, AUDIO_FILE: '20000lieues_2_02_verne_64kb.mp3', AUDIO_START: '00:00:22.5', AUDIO_STOP:'00:19:22' }, { IDX: 27, FIRST_LINE: 9334, LAST_LINE: 9816, AUDIO_FILE: '20000lieues_2_03_verne_64kb.mp3', AUDIO_START: '00:00:22.5', AUDIO_STOP:'00:27:01' }, { IDX: 28, FIRST_LINE: 9820, LAST_LINE: 10357, AUDIO_FILE: '20000lieues_2_04_verne_64kb.mp3', AUDIO_START: '00:00:22.5', AUDIO_STOP:'00:29:10' }, { IDX: 29, FIRST_LINE: 10361, LAST_LINE: 10764, AUDIO_FILE: '20000lieues_2_05_verne_64kb.mp3', AUDIO_START: '00:00:23.5', AUDIO_STOP:'00:19:16' }, { IDX: 30, FIRST_LINE: 10768, LAST_LINE: 11266, AUDIO_FILE: '20000lieues_2_06_verne_64kb.mp3', AUDIO_START: '00:00:23.0', AUDIO_STOP:'00:22:25' }, { IDX: 31, FIRST_LINE: 11270, LAST_LINE: 11655, AUDIO_FILE: '20000lieues_2_07_verne_64kb.mp3', AUDIO_START: '00:00:24.0', AUDIO_STOP:'00:24:00' }, { IDX: 32, FIRST_LINE: 11659, LAST_LINE: 12093, AUDIO_FILE: '20000lieues_2_08_verne_64kb.mp3', AUDIO_START: '00:00:24.0', AUDIO_STOP:'00:21:25' }, { IDX: 33, FIRST_LINE: 12097, LAST_LINE: 12512, AUDIO_FILE: '20000lieues_2_09_verne_64kb.mp3', AUDIO_START: '00:00:21.0', AUDIO_STOP:'00:22:32' }, { IDX: 34, FIRST_LINE: 12516, LAST_LINE: 12965, AUDIO_FILE: '20000lieues_2_10_verne_64kb.mp3', AUDIO_START: '00:00:24.5', AUDIO_STOP:'00:21:20' }, { IDX: 35, FIRST_LINE: 12969, LAST_LINE: 13336, AUDIO_FILE: '20000lieues_2_11_verne_64kb.mp3', AUDIO_START: '00:00:28.5', AUDIO_STOP:'00:21:05' }, { IDX: 36, FIRST_LINE: 13340, LAST_LINE: 13861, AUDIO_FILE: '20000lieues_2_12_verne_64kb.mp3', AUDIO_START: '00:00:25.0', AUDIO_STOP:'00:23:53' }, { IDX: 37, FIRST_LINE: 13865, LAST_LINE: 14362, AUDIO_FILE: '20000lieues_2_13_verne_64kb.mp3', AUDIO_START: '00:00:25.0', AUDIO_STOP:'00:27:55' }, { IDX: 38, FIRST_LINE: 14366, LAST_LINE: 14901, AUDIO_FILE: '20000lieues_2_14_verne_64kb.mp3', AUDIO_START: '00:00:20.0', AUDIO_STOP:'00:30:09' }, { IDX: 39, FIRST_LINE: 14905, LAST_LINE: 15263, AUDIO_FILE: '20000lieues_2_15_verne_64kb.mp3', AUDIO_START: '00:00:22.0', AUDIO_STOP:'00:15:19' }, { IDX: 40, FIRST_LINE: 15267, LAST_LINE: 15700, AUDIO_FILE: '20000lieues_2_16_verne_64kb.mp3', AUDIO_START: '00:00:21.5', AUDIO_STOP:'00:19:26' }, { IDX: 41, FIRST_LINE: 15704, LAST_LINE: 16114, AUDIO_FILE: '20000lieues_2_17_verne_64kb.mp3', AUDIO_START: '00:00:24.0', AUDIO_STOP:'00:23:57' }, { IDX: 42, FIRST_LINE: 16118, LAST_LINE: 16602, AUDIO_FILE: '20000lieues_2_18_verne_64kb.mp3', AUDIO_START: '00:00:22.0', AUDIO_STOP:'00:22:14' }, { IDX: 43, FIRST_LINE: 16606, LAST_LINE: 17059, AUDIO_FILE: '20000lieues_2_19_verne_64kb.mp3', AUDIO_START: '00:00:24.0', AUDIO_STOP:'00:26:55' }, { IDX: 44, FIRST_LINE: 17063, LAST_LINE: 17388, AUDIO_FILE: '20000lieues_2_20_verne_64kb.mp3', AUDIO_START: '00:00:19.5', AUDIO_STOP:'00:16:36' }, { IDX: 45, FIRST_LINE: 17392, LAST_LINE: 17787, AUDIO_FILE: '20000lieues_2_21_verne_64kb.mp3', AUDIO_START: '00:00:23.0', AUDIO_STOP:'00:19:06' }, { IDX: 46, FIRST_LINE: 17791, LAST_LINE: 18094, AUDIO_FILE: '20000lieues_2_22_verne_64kb.mp3', AUDIO_START: '00:00:23.0', AUDIO_STOP:'00:15:58' }, { IDX: 47, FIRST_LINE: 18098, LAST_LINE: 18146, AUDIO_FILE: '20000lieues_2_23_verne_64kb.mp3', AUDIO_START: '00:00:29.0', AUDIO_STOP:'00:03:36' } ] }, utils.Lang.ENG: { TITLE: '20000 Leagues Under the Seas', URL: 'http://www.gutenberg.org/cache/epub/2488/pg2488.txt', CHAPTERS: [ { IDX: 1, FIRST_LINE: 696, LAST_LINE: 958, AUDIO_FILE: '20000leaguesundertheseas_1-01_verne_64kb.mp3', AUDIO_START: '00:00:35', AUDIO_STOP:'00:19:23' }, { IDX: 2, FIRST_LINE: 969, LAST_LINE: 1215, AUDIO_FILE: '20000leaguesundertheseas_1-02_verne_64kb.mp3', AUDIO_START: '00:00:26.5', AUDIO_STOP:'00:13:50' }, { IDX: 3, FIRST_LINE: 1227, LAST_LINE: 1472, AUDIO_FILE: '20000leaguesundertheseas_1-03_verne_64kb.mp3', AUDIO_START: '00:00:26.5', AUDIO_STOP:'00:11:49' }, { IDX: 4, FIRST_LINE: 1482, LAST_LINE: 1770, AUDIO_FILE: '20000leaguesundertheseas_1-04_verne_64kb.mp3', AUDIO_START: '00:00:28.5', AUDIO_STOP:'00:16:48' }, { IDX: 5, FIRST_LINE: 1782, LAST_LINE: 2036, AUDIO_FILE: '20000leaguesundertheseas_1-05_verne_64kb.mp3', AUDIO_START: '00:00:26.5', AUDIO_STOP:'00:15:31' }, { IDX: 6, FIRST_LINE: 2046, LAST_LINE: 2450, AUDIO_FILE: '20000leaguesundertheseas_1-06_verne_64kb.mp3', AUDIO_START: '00:00:28', AUDIO_STOP:'00:20:14' }, { IDX: 7, FIRST_LINE: 2462, LAST_LINE: 2805, AUDIO_FILE: '20000leaguesundertheseas_1-07_verne_64kb.mp3', AUDIO_START: '00:00:36', AUDIO_STOP:'00:19:02' }, { IDX: 8, FIRST_LINE: 2817, LAST_LINE: 3170, AUDIO_FILE: '20000leaguesundertheseas_1-08_verne_64kb.mp3', AUDIO_START: '00:00:27', AUDIO_STOP:'00:20:26.5' }, { IDX: 9, FIRST_LINE: 3182, LAST_LINE: 3495, AUDIO_FILE: '20000leaguesundertheseas_1-09_verne_64kb.mp3', AUDIO_START: '00:00:26', AUDIO_STOP:'00:16:09' }, { IDX: 10, FIRST_LINE: 3507, LAST_LINE: 3899, AUDIO_FILE: '20000leaguesundertheseas_1-10_verne_64kb.mp3', AUDIO_START: '00:00:28', AUDIO_STOP:'00:20:44.5' }, { IDX: 11, FIRST_LINE: 3920, LAST_LINE: 4240, AUDIO_FILE: '20000leaguesundertheseas_1-11_verne_64kb.mp3', AUDIO_START: '00:00:36', AUDIO_STOP:'00:20:20' }, { IDX: 12, FIRST_LINE: 4250, LAST_LINE: 4546, AUDIO_FILE: '20000leaguesundertheseas_1-12_verne_64kb.mp3', AUDIO_START: '00:00:24', AUDIO_STOP:'00:15:44' }, { IDX: 13, FIRST_LINE: 4560, LAST_LINE: 4846, AUDIO_FILE: '20000leaguesundertheseas_1-13_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:15:01' }, { IDX: 14, FIRST_LINE: 4859, LAST_LINE: 5349, AUDIO_FILE: '20000leaguesundertheseas_1-14_verne_64kb.mp3', AUDIO_START: '00:00:19.5', AUDIO_STOP:'00:13:57' }, { IDX: 15, FIRST_LINE: 5378, LAST_LINE: 5761, AUDIO_FILE: '20000leaguesundertheseas_1-15_verne_64kb.mp3', AUDIO_START: '00:00:32', AUDIO_STOP:'00:17:07' }, { IDX: 16, FIRST_LINE: 5772, LAST_LINE: 6029, AUDIO_FILE: '20000leaguesundertheseas_1-16_verne_64kb.mp3', AUDIO_START: '00:00:24', AUDIO_STOP:'00:17:20' }, { IDX: 17, FIRST_LINE: 6039, LAST_LINE: 6307, AUDIO_FILE: '20000leaguesundertheseas_1-17_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:18:06' }, { IDX: 18, FIRST_LINE: 6326, LAST_LINE: 6655, AUDIO_FILE: '20000leaguesundertheseas_1-18_verne_64kb.mp3', AUDIO_START: '00:00:21', AUDIO_STOP:'00:16:46' }, { IDX: 19, FIRST_LINE: 6669, LAST_LINE: 7087, AUDIO_FILE: '20000leaguesundertheseas_1-19_verne_64kb.mp3', AUDIO_START: '00:00:20', AUDIO_STOP:'00:26:50' }, { IDX: 20, FIRST_LINE: 7101, LAST_LINE: 7456, AUDIO_FILE: '20000leaguesundertheseas_1-20_verne_64kb.mp3', AUDIO_START: '00:00:35', AUDIO_STOP:'00:22:42' }, { IDX: 21, FIRST_LINE: 7466, LAST_LINE: 7982, AUDIO_FILE: '20000leaguesundertheseas_1-21_verne_64kb.mp3', AUDIO_START: '00:00:35', AUDIO_STOP:'00:26:04' }, { IDX: 22, FIRST_LINE: 7996, LAST_LINE: 8523, AUDIO_FILE: '20000leaguesundertheseas_1-22_verne_64kb.mp3', AUDIO_START: '00:00:24.5', AUDIO_STOP:'00:23:02' }, { IDX: 23, FIRST_LINE: 8528, LAST_LINE: 8894, AUDIO_FILE: '20000leaguesundertheseas_1-23_verne_64kb.mp3', AUDIO_START: '00:00:19', AUDIO_STOP:'00:18:06' }, { IDX: 24, FIRST_LINE: 8911, LAST_LINE: 9271, AUDIO_FILE: '20000leaguesundertheseas_1-24_verne_64kb.mp3', AUDIO_START: '00:00:25', AUDIO_STOP:'00:18:50' }, { IDX: 25, FIRST_LINE: 9750, LAST_LINE: 10137, AUDIO_FILE: '20000leaguesundertheseas_2-01_verne_64kb.mp3', AUDIO_START: '00:00:31.5', AUDIO_STOP:'00:23:53' }, { IDX: 26, FIRST_LINE: 10149, LAST_LINE: 10593, AUDIO_FILE: '20000leaguesundertheseas_2-02_verne_64kb.mp3', AUDIO_START: '00:00:44', AUDIO_STOP:'00:23:13' }, { IDX: 27, FIRST_LINE: 10603, LAST_LINE: 11082, AUDIO_FILE: '20000leaguesundertheseas_2-03_verne_64kb.mp3', AUDIO_START: '00:00:32', AUDIO_STOP:'00:24:23' }, { IDX: 28, FIRST_LINE: 11094, LAST_LINE: 11623, AUDIO_FILE: '20000leaguesundertheseas_2-04_verne_64kb.mp3', AUDIO_START: '00:00:24.5', AUDIO_STOP:'00:29:47' }, { IDX: 29, FIRST_LINE: 11633, LAST_LINE: 12026, AUDIO_FILE: '20000leaguesundertheseas_2-05_verne_64kb.mp3', AUDIO_START: '00:00:21', AUDIO_STOP:'00:16:41' }, { IDX: 30, FIRST_LINE: 12034, LAST_LINE: 12538, AUDIO_FILE: '20000leaguesundertheseas_2-06_verne_64kb.mp3', AUDIO_START: '00:00:24.5', AUDIO_STOP:'00:21:47' }, { IDX: 31, FIRST_LINE: 12546, LAST_LINE: 12927, AUDIO_FILE: '20000leaguesundertheseas_2-07_verne_64kb.mp3', AUDIO_START: '00:00:17.5', AUDIO_STOP:'00:21:22' }, { IDX: 32, FIRST_LINE: 12937, LAST_LINE: 13367, AUDIO_FILE: '20000leaguesundertheseas_2-08_verne_64kb.mp3', AUDIO_START: '00:00:29', AUDIO_STOP:'00:23:55' }, { IDX: 33, FIRST_LINE: 13379, LAST_LINE: 13797, AUDIO_FILE: '20000leaguesundertheseas_2-09_verne_64kb.mp3', AUDIO_START: '00:00:19', AUDIO_STOP:'00:22:19' }, { IDX: 34, FIRST_LINE: 13807, LAST_LINE: 14251, AUDIO_FILE: '20000leaguesundertheseas_2-10_verne_64kb.mp3', AUDIO_START: '00:00:20', AUDIO_STOP:'00:27:21' }, { IDX: 35, FIRST_LINE: 14261, LAST_LINE: 14618, AUDIO_FILE: '20000leaguesundertheseas_2-11_verne_64kb.mp3', AUDIO_START: '00:00:24', AUDIO_STOP:'00:23:02' }, { IDX: 36, FIRST_LINE: 14628, LAST_LINE: 15137, AUDIO_FILE: '20000leaguesundertheseas_2-12_verne_64kb.mp3', AUDIO_START: '00:00:21', AUDIO_STOP:'00:24:51' }, { IDX: 37, FIRST_LINE: 15145, LAST_LINE: 15639, AUDIO_FILE: '20000leaguesundertheseas_2-13_verne_64kb.mp3', AUDIO_START: '00:00:29', AUDIO_STOP:'00:28:19' }, { IDX: 38, FIRST_LINE: 15649, LAST_LINE: 16185, AUDIO_FILE: '20000leaguesundertheseas_2-14_verne_64kb.mp3', AUDIO_START: '00:00:27.5', AUDIO_STOP:'00:29:31' }, { IDX: 39, FIRST_LINE: 16195, LAST_LINE: 16550, AUDIO_FILE: '20000leaguesundertheseas_2-15_verne_64kb.mp3', AUDIO_START: '00:00:23', AUDIO_STOP:'00:17:20' }, { IDX: 40, FIRST_LINE: 16569, LAST_LINE: 16996, AUDIO_FILE: '20000leaguesundertheseas_2-16_verne_64kb.mp3', AUDIO_START: '00:00:23', AUDIO_STOP:'00:22:53' }, { IDX: 41, FIRST_LINE: 17008, LAST_LINE: 17416, AUDIO_FILE: '20000leaguesundertheseas_2-17_verne_64kb.mp3', AUDIO_START: '00:00:20', AUDIO_STOP:'00:25:12' }, { IDX: 42, FIRST_LINE: 17426, LAST_LINE: 17897, AUDIO_FILE: '20000leaguesundertheseas_2-18_verne_64kb.mp3', AUDIO_START: '00:00:28', AUDIO_STOP:'00:26:29' }, { IDX: 43, FIRST_LINE: 17905, LAST_LINE: 18357, AUDIO_FILE: '20000leaguesundertheseas_2-19_verne_64kb.mp3', AUDIO_START: '00:00:19', AUDIO_STOP:'00:26:02' }, { IDX: 44, FIRST_LINE: 18379, LAST_LINE: 18703, AUDIO_FILE: '20000leaguesundertheseas_2-20_verne_64kb.mp3', AUDIO_START: '00:00:22', AUDIO_STOP:'00:23:23' }, { IDX: 45, FIRST_LINE: 18713, LAST_LINE: 19110, AUDIO_FILE: '20000leaguesundertheseas_2-21_verne_64kb.mp3', AUDIO_START: '00:00:27', AUDIO_STOP:'00:21:28' }, { IDX: 46, FIRST_LINE: 19122, LAST_LINE: 19427, AUDIO_FILE: '20000leaguesundertheseas_2-22_verne_64kb.mp3', AUDIO_START: '00:00:26.5', AUDIO_STOP:'00:17:56' }, { IDX: 47, FIRST_LINE: 19437, LAST_LINE: 19489, AUDIO_FILE: '20000leaguesundertheseas_2-23_verne_64kb.mp3', AUDIO_START: '00:00:29.5', AUDIO_STOP:'00:03:59' }, ] }, } } }
145.077586
186
0.648464
2,564
16,829
3.942668
0.119345
0.084578
0.111584
0.158077
0.415966
0.405579
0.390642
0.384509
0.38352
0.33485
0
0.240792
0.201438
16,829
116
187
145.077586
0.511422
0
0
0.017391
0
0
0.315686
0.210814
0
0
0
0
0
1
0
false
0
0.017391
0
0.017391
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
35137028de5afc78e98164bb5b3455f0ed46f77b
848
py
Python
tests/unit/test_path_resolver.py
verdimrc/aws-lambda-builders
67f42dd936fd4f0c517c38acb8b6a170156549ec
[ "Apache-2.0" ]
1
2020-07-21T20:16:12.000Z
2020-07-21T20:16:12.000Z
tests/unit/test_path_resolver.py
verdimrc/aws-lambda-builders
67f42dd936fd4f0c517c38acb8b6a170156549ec
[ "Apache-2.0" ]
1
2020-06-26T12:36:39.000Z
2020-06-26T12:36:39.000Z
tests/unit/test_path_resolver.py
verdimrc/aws-lambda-builders
67f42dd936fd4f0c517c38acb8b6a170156549ec
[ "Apache-2.0" ]
1
2020-06-22T23:28:24.000Z
2020-06-22T23:28:24.000Z
from unittest import TestCase import os import mock from aws_lambda_builders import utils from aws_lambda_builders.path_resolver import PathResolver class TestPathResolver(TestCase): def setUp(self): self.path_resolver = PathResolver(runtime="chitti2.0", binary="chitti") def test_inits(self): self.assertEquals(self.path_resolver.runtime, "chitti2.0") self.assertEquals(self.path_resolver.binary, "chitti") def test_which_fails(self): with self.assertRaises(ValueError): utils.which = lambda x: None self.path_resolver._which() def test_which_success_immediate(self): with mock.patch.object(self.path_resolver, "_which") as which_mock: which_mock.return_value = os.getcwd() self.assertEquals(self.path_resolver.exec_paths, os.getcwd())
31.407407
79
0.714623
106
848
5.5
0.40566
0.144082
0.164666
0.123499
0.164666
0
0
0
0
0
0
0.005839
0.192217
848
26
80
32.615385
0.845255
0
0
0
0
0
0.042453
0
0
0
0
0
0.210526
1
0.210526
false
0
0.263158
0
0.526316
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
0
1
0
0
2
351a11fa19556bbbcde3efa3b0e667c48ec964c9
136
py
Python
spydr/__init__.py
nkpydev/SimpleWebCrawler
e634cb2710633295559aed0e22d57211b22a359f
[ "MIT" ]
null
null
null
spydr/__init__.py
nkpydev/SimpleWebCrawler
e634cb2710633295559aed0e22d57211b22a359f
[ "MIT" ]
null
null
null
spydr/__init__.py
nkpydev/SimpleWebCrawler
e634cb2710633295559aed0e22d57211b22a359f
[ "MIT" ]
null
null
null
__version__ = "1.0.1" __author__ = "nkpydev" __program__ = "SimpleWebCrawler" __desc__ = "Simple Pythonic implementation of Web Crawler"
34
58
0.779412
15
136
6
0.933333
0
0
0
0
0
0
0
0
0
0
0.025
0.117647
136
4
58
34
0.725
0
0
0
0
0
0.532847
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
351eba827fa79043f2784d6a27fb01097750da16
3,272
py
Python
src/location/migrations/0001_initial.py
ApetEat/Public-Holidays-API
01fb19a1c2d48fa572bf42eae3712e417e32643c
[ "Apache-2.0" ]
null
null
null
src/location/migrations/0001_initial.py
ApetEat/Public-Holidays-API
01fb19a1c2d48fa572bf42eae3712e417e32643c
[ "Apache-2.0" ]
null
null
null
src/location/migrations/0001_initial.py
ApetEat/Public-Holidays-API
01fb19a1c2d48fa572bf42eae3712e417e32643c
[ "Apache-2.0" ]
1
2018-02-06T19:19:17.000Z
2018-02-06T19:19:17.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-08-14 11:24 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='City', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('code', models.CharField(max_length=3, unique=True, verbose_name='Official code')), ('name', models.CharField(max_length=200, verbose_name='City')), ], options={ 'verbose_name_plural': 'Cities', }, ), migrations.CreateModel( name='Country', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('code', models.CharField(max_length=3, unique=True, verbose_name='Official code')), ('name', models.CharField(max_length=50, unique=True, verbose_name='Country')), ], options={ 'verbose_name_plural': 'Countries', }, ), migrations.CreateModel( name='Province', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('code', models.CharField(max_length=3, unique=True, verbose_name='Official code')), ('name', models.CharField(max_length=100, verbose_name='Province')), ], ), migrations.CreateModel( name='Region', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('created', models.DateTimeField(auto_now_add=True)), ('updated', models.DateTimeField(auto_now=True)), ('code', models.CharField(max_length=3, unique=True, verbose_name='Official code')), ('name', models.CharField(max_length=100, verbose_name='Region')), ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Country')), ], options={ 'verbose_name_plural': 'Regions', }, ), migrations.AddField( model_name='province', name='region', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Region'), ), migrations.AddField( model_name='city', name='province', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='location.Province'), ), ]
41.948718
115
0.57121
321
3,272
5.647975
0.224299
0.091009
0.101489
0.114727
0.702151
0.667954
0.667954
0.667954
0.667954
0.667954
0
0.014194
0.289425
3,272
77
116
42.493506
0.765591
0.021088
0
0.565217
1
0
0.114375
0
0
0
0
0
0
1
0
false
0
0.043478
0
0.101449
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3529e7cbaf349fa2683948c6045bbaf3c3d7ae71
32,699
py
Python
data/descr_stats.py
psychoinformatics-de/paper-f1000_gumpemotions
fb51348a8e12e5680da5053b1b42f02f3cd56178
[ "CC0-1.0" ]
1
2020-10-28T14:40:13.000Z
2020-10-28T14:40:13.000Z
data/descr_stats.py
psychoinformatics-de/paper-f1000_gumpemotions
fb51348a8e12e5680da5053b1b42f02f3cd56178
[ "CC0-1.0" ]
null
null
null
data/descr_stats.py
psychoinformatics-de/paper-f1000_gumpemotions
fb51348a8e12e5680da5053b1b42f02f3cd56178
[ "CC0-1.0" ]
1
2017-05-13T12:47:04.000Z
2017-05-13T12:47:04.000Z
#!/usr/bin/python # # This script generates summary statistics and raw plots for the data note # associated with the annotations of portrayed emotions in the movie # Forrest Gump. It is intended to serve as a more detailed description # of the employed analysis and aggregation procedures than what is possible # to convey in a manuscript. # # In order to reproduce the results, the script needs to be executed in the # root of the extracted dataset. Summary statistics are printed with LaTeX # markup and were directly included into the LaTeX sources of the associated # Data note publication. # # Required arguments: # 1. path to store the generated inter-observer agreement times series # 2. path to store the generated figures # # The following python packages are required: # - NumPy # - SciPy # - seaborn # # Example: # $ python descr_stats.py /tmp /tmp # # This source code is (C) by Michael Hanke <michael.hanke@gmail.com> and # made available under the terms of the Creative Common Attribution-ShareAlike # 4.0 International (CC BY-SA 4.0) license. # import numpy as np from scipy.stats import spearmanr # hard code the max duration of the movie stimulus maxmovietime = 7085.28 # # Helpers from PyMVPA # def plot_bars(data, labels=None, title=None, ylim=None, ylabel=None, width=0.2, offset=0.2, color='0.6', distance=1.0, yerr='ste', xloc=None, **kwargs): """Make bar plots with automatically computed error bars. Candlestick plot (multiple interleaved barplots) can be done, by calling this function multiple time with appropriatly modified `offset` argument. Parameters ---------- data : array (nbars x nobservations) or other sequence type Source data for the barplot. Error measure is computed along the second axis. labels : list or None If not None, a label from this list is placed on each bar. title : str An optional title of the barplot. ylim : 2-tuple Y-axis range. ylabel : str An optional label for the y-axis. width : float Width of a bar. The value should be in a reasonable relation to `distance`. offset : float Constant offset of all bar along the x-axis. Can be used to create candlestick plots. color : matplotlib color spec Color of the bars. distance : float Distance of two adjacent bars. yerr : {'ste', 'std', None} Type of error for the errorbars. If `None` no errorbars are plotted. xloc : sequence Locations of the bars on the x axis. **kwargs Any additional arguments are passed to matplotlib's `bar()` function. """ import pylab as pl # determine location of bars if xloc is None: xloc = (np.arange(len(data)) * distance) + offset if yerr == 'ste': yerr = [np.std(d) / np.sqrt(len(d)) for d in data] elif yerr == 'std': yerr = [np.std(d) for d in data] else: # if something that we do not know just pass on pass # plot bars plot = pl.bar(xloc, [np.mean(d) for d in data], yerr=yerr, width=width, color=color, ecolor='black', **kwargs) if ylim: pl.ylim(*(ylim)) if title: pl.title(title) if labels: pl.xticks(xloc + width / 2, labels) if ylabel: pl.ylabel(ylabel) # leave some space after last bar pl.xlim(0, xloc[-1] + width + offset) return plot def unique_combinations(L, n, sort=False): """Return unique combinations form a list L of objects in groups of size n. Parameters ---------- L : list list of unique ids n : int length of the subsets to return sort : bool, optional if True -- result is sorted before returning If you are intended to use only a small subset of possible combinations, it is advised to use a generator `xunique_combinations`. """ res = list(xunique_combinations(L, n)) if sort: res = sorted(res) return res def xunique_combinations(L, n): """Generator of unique combinations form a list L of objects in groups of size n. Parameters ---------- L : list list of unique ids n : int grouping size Adopted from Li Daobing http://code.activestate.com/recipes/190465/ (MIT license, according to activestate.com's policy) Also good discussions on combinations/variations/permutations with various implementations are available at http://mail.python.org/pipermail/python-list/2004-October/286054.html """ if n == 0: yield [] else: for i in range(len(L) - n + 1): for cc in xunique_combinations(L[i + 1:], n - 1): yield [L[i]] + cc # # Load data # def get_shots(): starts = np.loadtxt('movie_shots.csv') segments = np.array((starts, np.concatenate((starts[1:], (maxmovietime,))))).T return segments def get_scenes(): starts = np.recfromcsv('movie_scenes.csv', names=('start', 'title', 'tod', 'set'))['start'] segments = np.array((starts, np.concatenate((starts[1:], (maxmovietime,))))).T return segments def get_nsecond_segments(n=1): max = get_scenes()[-1, 1] return np.array((np.arange(0, max - n, n), np.arange(n, max, n))).T def get_av_ratings(): import glob return [np.recfromcsv(f) for f in glob.glob('raw/av*.csv')] def get_ao_ratings(): import glob return [np.recfromcsv(f) for f in glob.glob('raw/ao*.csv')] def get_all_ratings(): return get_av_ratings() + get_ao_ratings() # # Stats # def get_labeled_fraction(rat, col): # what fraction of the annotations carry values in a specific column tot = np.sum([len(r) for r in rat]) lbl = np.sum([len(r) for r in get_labeled_ratings(rat, col)]) return float(lbl) / tot def get_agreed_labels(ratings, col, segments, athresh=0.5, nseg_thresh=0): # determine values for a particular column that show a minimum # inter-observer agreement for a minimum number of time segments # anywhere in the movie from scipy.ndimage.measurements import label labels = \ np.unique( np.concatenate( [np.unique( np.concatenate( [d.split() for d in r[col]])) for r in ratings])) found = [] for l in labels: match = slice2segments(ratings, {col: l}, segments) > athresh nseg = np.sum(match) nblobs = label(match)[1] if nblobs > nseg_thresh: found.append((l, nseg, nblobs)) return found def calc_bootstrapped_intercorrelation(ratings, cond1, cond2, segments): # split the set of observers into all possible ~halves and # compute the time series correlations of inter-oberserver # agreement wrt annotation matching particular criteria across # both groups from mvpa2.misc.support import unique_combinations N = len(ratings) corr = [] for combo in unique_combinations(range(N), N / 2): half1 = [ratings[i] for i in combo] half2 = [ratings[i] for i in xrange(N) if not i in combo] c1 = slice2segments(half1, cond1, segments) \ - slice2segments(half1, cond2, segments) c2 = slice2segments(half2, cond1, segments) \ - slice2segments(half2, cond2, segments) corr.append(spearmanr(c1, c2)[0]) return corr def get_ci_stats(arr): # convert an array of correlation scores into a LaTeX # markup with mean and CI m = np.mean(arr) sem = np.std(arr) / np.sqrt(len(arr)) if np.isnan(m): return 'n/a' else: if m >= 0.5: return '\\textbf{%.3f} $\\pm$%.3f' % (m, 1.96 * sem) else: return '%.3f $\\pm$%.3f' % (m, 1.96 * sem) def get_corr_ci(v1, v2): # take to time series, compute the correlation, and yield a # LaTeX markup of the value plus a CI (via Fisher transform.) c = spearmanr(v1, v2)[0] # fisher transform fc = np.arctanh(c) se = 1. / np.sqrt(len(v1) - 3) # back to correlation ci = np.tanh(fc + 1.96 * se) if np.isnan(c): return 'n/a' else: if c >= 0.5: return '\\textbf{%.3f} $\\pm$%.3f' % (c, ci - c) else: return '%.3f $\\pm$%.3f' % (c, ci - c) def print_stats(rat, rat_label, all_rat): # compute various annotation statistics print '\\newcommand{\\%sTotalRaters}{%i}' % (rat_label, len(rat)) athresh = 0.5 print '\\newcommand{\\%sAggThresh}{%i\\%%}' % (rat_label, athresh * 100) segments = get_nsecond_segments() print '\\newcommand{\\%sFracWithLabeledChar}{%.1f\\%%}' \ % (rat_label, get_labeled_fraction(rat, 'character') * 100) e = get_agreed_labels(rat, 'character', segments, athresh=-1) print '%% %s total character labels' % (rat_label,) print '%% %s' % [v[0] for v in e] print '\\newcommand{\\%sTotalCharLabels}{%i}' % (rat_label, len(e)) e = get_agreed_labels(rat, 'character', segments, athresh=athresh, nseg_thresh=5) print '%% %s character labels AGG > %.2f' % (rat_label, athresh) print '%% %s' % e print '\\newcommand{\\%sThreshCharLabels}{%i}' % (rat_label, len(e)) print '\\newcommand{\\%sFracWithLabeledEmotions}{%.1f\\%%}' \ % (rat_label, get_labeled_fraction(rat, 'emotion') * 100) e = get_agreed_labels(rat, 'emotion', segments, athresh=athresh) print '%% %s emotion labels AGG > %.2f' % (rat_label, athresh) print '%% %s' % e print '\\newcommand{\\%sThreshEmoLabels}{%i}' % (rat_label, len(e)) print '\\newcommand{\\%sFracWithLabeledOncue}{%.1f\\%%}' \ % (rat_label, get_labeled_fraction(rat, 'oncue') * 100) e = get_agreed_labels(rat, 'oncue', segments, athresh=athresh) print '%% %s oncue labels AGG > %.2f' % (rat_label, athresh) print '%% %s' % e print '\\newcommand{\\%sThreshOncueLabels}{%i}' % (rat_label, len(e)) print '\\newcommand{\\%sFracWithLabeledOffcue}{%.1f\\%%}' \ % (rat_label, get_labeled_fraction(rat, 'offcue') * 100) e = get_agreed_labels(rat, 'offcue', segments, athresh=athresh) print '%% %s offcue labels AGG > %.2f' % (rat_label, athresh) print '%% %s' % e print '\\newcommand{\\%sThreshOffcueLabels}{%i}' % (rat_label, len(e)) # per character stats for char, clabel in (('*', 'AllChar'), ('FORREST', 'Forrest'), ('JENNY', 'Jenny')): print '\\newcommand{\\%sCorrArousalValence%s}{%s}' \ % (rat_label, clabel, get_corr_ci(get_arousal_modulation(rat, segments, char=char), get_valence_modulation(rat, segments, char=char))) print '\\newcommand{\\%sCorrValenceDirection%s}{%s}' \ % (rat_label, clabel, get_corr_ci(get_valence_modulation(rat, segments, char=char), get_direction_modulation(rat, segments, char=char))) print '\\newcommand{\\%sCorrArousalDirection%s}{%s}' \ % (rat_label, clabel, get_corr_ci(get_arousal_modulation(rat, segments, char=char), get_direction_modulation(rat, segments, char=char))) s = get_ci_stats( calc_bootstrapped_intercorrelation( rat, {'arousal': 'HIGH', 'character': char}, {'arousal': 'LOW', 'character': char}, segments)) print '\\newcommand{\\%sInterRaterConsistArousal%s}{%s}' \ % (rat_label, clabel, s) s = get_ci_stats( calc_bootstrapped_intercorrelation( rat, {'valence': 'POS', 'character': char}, {'valence': 'NEG', 'character': char}, segments)) print '\\newcommand{\\%sInterRaterConsistValence%s}{%s}' \ % (rat_label, clabel, s) s = get_ci_stats( calc_bootstrapped_intercorrelation( rat, {'direction': 'SELF', 'character': char}, {'direction': 'OTHER', 'character': char}, segments)) print '\\newcommand{\\%sInterRaterConsistDirection%s}{%s}' \ % (rat_label, clabel, s) for emo in get_unique_emotions(all_rat): s = get_ci_stats( calc_bootstrapped_intercorrelation( rat, {'emotion': emo, 'character': char}, {'emotion': None, 'character': char}, segments)) print '\\newcommand{\\%sInterRaterConsist%s%s}{%s}' \ % (rat_label, emo, clabel, s) for cue in get_unique_oncues(all_rat): s = get_ci_stats( calc_bootstrapped_intercorrelation( rat, {'oncue': cue, 'character': char}, {'oncue': None, 'character': char}, segments)) print '\\newcommand{\\%sInterRaterConsist%s%s}{%s}' \ % (rat_label, cue, clabel, s) # # Plots # def comp_barplot(av, ao, col, ylabel): # helper for all bar plots import pylab as pl from mvpa2.misc.plot import plot_bars avd = {e[0]: e[col] for e in av} aod = {e[0]: e[col] for e in ao} joind = {k: 0 for k in avd.keys() + aod.keys()} for k, v in avd.iteritems(): joind[k] = v p = plot_bars([joind[k] for k in sorted(joind.keys())], yerr=None, offset=-.15, width=.3) p.set_label("audio-visual") joind = {k: 0 for k in avd.keys() + aod.keys()} for k, v in aod.iteritems(): joind[k] = v p = plot_bars([joind[k] for k in sorted(joind.keys())], yerr=None, color='0.2', offset=.15, width=.3, labels=[bn(n) for n in sorted(joind.keys())]) p.set_label("audio-only") pl.xlim((-1, len(joind))) pl.ylabel(ylabel) pl.legend() def bipolar_tsplot(av, ao, col, colx_labels, ylabels, segments, char='*'): # helper for all time series plot for bipolar variables ts = slice2segments(ao, {col: colx_labels[0], 'character': char}, segments) \ - slice2segments(ao, {col: colx_labels[1], 'character': char}, segments) pl.plot(segments.T[0], ts, label='audio-only', color='blue', alpha=.5) pl.fill_between(segments.T[0], ts, color='blue', alpha=.5) ts = slice2segments(av, {col: colx_labels[0], 'character': char}, segments) \ - slice2segments(av, {col: colx_labels[1], 'character': char}, segments) pl.plot(segments.T[0], ts, label='audio-visual', color='green', alpha=.5) pl.fill_between(segments.T[0], ts, color='green', alpha=.5) pl.ylabel('%s' % (bn(col))) pl.xlabel('movie time in seconds') pl.xlim((segments[0, 0], segments[-1, 1])) pl.yticks(np.array((-1, 0, 1)), ylabels) pl.ylim((-1, 1)) pl.legend() def unipolar_tsplot(av, ao, col, colx_label, segments, char='*'): # helper for all time series plot for unipolar variables pl.fill_between( segments.T[0], slice2segments(ao, {col: colx_label, 'character': char}, segments), label='audio-only', zorder=0, color='blue', alpha=.5) pl.fill_between( segments.T[0], slice2segments(av, {col: colx_label, 'character': char}, segments), label='audio-visual', zorder=1, color='green', alpha=.5) pl.ylabel('%s' % (bn(colx_label))) pl.xlabel('movie time in seconds') pl.xlim((segments[0, 0], segments[-1, 1])) pl.ylim((0, 1)) pl.yticks(np.array((0, 1)), ('absent (0)', 'present (1)')) def mkplot_indicator_ts(avr, aor, character, segments, figpath): # demo plot with time series of various properties across the movie fig = pl.figure(figsize=(10, 8), dpi=300) _ = pl.subplot(811) bipolar_tsplot(avr, aor, 'arousal', ('HIGH', 'LOW'), ('low (-1)', 'neutral (0)', 'high (+1)'), segments, char=character) _ = pl.subplot(812) bipolar_tsplot(avr, aor, 'valence', ('POS', 'NEG'), ('neg (-1)', 'neutral (0)', 'pos (+1)'), segments, char=character) _ = pl.subplot(813) unipolar_tsplot(avr, aor, 'emotion', 'HAPPINESS', segments, char=character) _ = pl.subplot(814) unipolar_tsplot(avr, aor, 'emotion', 'LOVE', segments, char=character) _ = pl.subplot(815) unipolar_tsplot(avr, aor, 'emotion', 'FEAR', segments, char=character) _ = pl.subplot(816) unipolar_tsplot(avr, aor, 'emotion', 'SADNESS', segments, char=character) _ = pl.subplot(817) unipolar_tsplot(avr, aor, 'emotion', 'ANGERRAGE', segments, char=character) _ = pl.subplot(818) unipolar_tsplot(avr, aor, 'oncue', 'VERBAL', segments, char=character) fig.autofmt_xdate() if character == '*': character = 'allchar' pl.savefig(opj(figpath, 'indicator_ts_%s.svg' % character.lower())) def print_combstats(avr, aor): # various stats computed across stimulus types segments = get_nsecond_segments() for char, clabel in (('*', 'AllChar'), ('FORREST', 'Forrest'), ('JENNY', 'Jenny')): print '\\newcommand{\\InterModCorrArousal%s}{%s}' \ % (clabel, get_corr_ci(get_arousal_modulation(avr, segments, char=char), get_arousal_modulation(aor, segments, char=char))) print '\\newcommand{\\InterModCorrValence%s}{%s}' \ % (clabel, get_corr_ci(get_valence_modulation(avr, segments, char=char), get_valence_modulation(aor, segments, char=char))) print '\\newcommand{\\InterModCorrDirection%s}{%s}' \ % (clabel, get_corr_ci(get_direction_modulation(avr, segments, char=char), get_direction_modulation(aor, segments, char=char))) for emo in get_unique_emotions(avr + aor): print '\\newcommand{\\InterModCorr%s%s}{%s}' \ % (emo, clabel, get_corr_ci(_get_modulation(avr, segments, emotion=emo, character=char), _get_modulation(aor, segments, emotion=emo, character=char))) for cue in get_unique_oncues(avr + aor): print '\\newcommand{\\InterModCorr%s%s}{%s}' \ % (cue, clabel, get_corr_ci(_get_modulation(avr, segments, oncue=cue, character=char), _get_modulation(aor, segments, oncue=cue, character=char))) # # Segmentation # def mk_thresh_emotion_episodes(rat, thresh, segments): # yield per character list of emotion episodes with a minimum inter-observer # agreement wrt any emotion attribute chars = get_unique_characters(rat) episodes = {} def _postprocess(e): return {k: np.median(v) for k, v in e.iteritems()} for char in chars: ep = episodes.get(char, []) ind = [get_arousal_modulation(rat, segments, char=char)] labels = ['arousal'] for l, d in (('v_pos', dict(valence='POS')), ('v_neg', dict(valence='NEG')), ('d_self', dict(direction='SELF')), ('d_other', dict(direction='OTHER')), ('e_admiration', dict(emotion='ADMIRATION')), ('e_anger/rage', dict(emotion='ANGER/RAGE')), ('e_contempt', dict(emotion='CONTEMPT')), ('e_disappointment', dict(emotion='DISAPPOINTMENT')), ('e_fear', dict(emotion='FEAR')), ('e_fears_confirmed', dict(emotion='FEARS_CONFIRMED')), ('e_gloating', dict(emotion='GLOATING')), ('e_gratification', dict(emotion='GRATIFICATION')), ('e_gratitude', dict(emotion='GRATITUDE')), ('e_happiness', dict(emotion='HAPPINESS')), ('e_happy-for', dict(emotion='HAPPY-FOR')), ('e_hate', dict(emotion='HATE')), ('e_hope', dict(emotion='HOPE')), ('e_love', dict(emotion='LOVE')), ('e_pity/compassion', dict(emotion='PITY/COMPASSION')), ('e_pride', dict(emotion='PRIDE')), ('e_relief', dict(emotion='RELIEF')), ('e_remorse', dict(emotion='REMORSE')), ('e_resent', dict(emotion='RESENTMENT')), ('e_sadness', dict(emotion='SADNESS')), ('e_satisfaction', dict(emotion='SATISFACTION')), ('e_shame', dict(emotion='SHAME')), ('c_audio', dict(oncue='AUDIO')), ('c_context', dict(oncue='CONTEXT')), ('c_face', dict(oncue='FACE')), ('c_gesture', dict(oncue='GESTURE')), ('c_narrator', dict(oncue='NARRATOR')), ('c_verbal', dict(oncue='VERBAL')), ): ind.append(_get_modulation(rat, segments, character=char, **d)) labels.append(l) ind = np.array(ind) # where is any above threshold agreement flags = np.abs(ind) >= thresh staging = None last_ind = np.array([False] * len(ind)) # for each segment for i, f in enumerate(flags.T): # print i, f, if not np.sum(f): if staging: ep.append(_postprocess(staging)) staging = None # print 'commit', last_ind = f # print 'skip' continue # continuing episode? if np.all(f == last_ind): # end of annotation is end of current segment staging['end'] = segments[i, 1] for nl, l in enumerate(labels): staging[l].append(ind[nl, i]) # print 'extend' else: # new episode if staging: # print 'commit', ep.append(_postprocess(staging)) # print 'new' staging = dict(start=segments[i, 0], end=segments[i, 1]) last_ind = f for nl, l in enumerate(labels): staging[l] = [ind[nl, i]] episodes[char] = ep return episodes, labels def emo2advene(data, labels, thresh=0.5): # format output of `mk_thresh_emotion_episodes()` into a format that is # importable by Advene, while merging all episodes of all characters # into a single file episodes = [] s = '' for char, ep in data.iteritems(): for e in ep: e['character'] = char episodes.append(e) episodes = sorted(episodes, cmp=lambda x, y: cmp(x['start'], y['start'])) for e in episodes: tags = [] if e['arousal'] > thresh: tags.append('ha') elif e['arousal'] < (-1 * thresh): tags.append('la') for l in labels: if l == 'arousal': continue if e[l] > thresh: tags.append(l[2:]) e['tags'] = ','.join(tags) s += "%(start).1f\t%(end).1f\tchar=%(character)s tags=%(tags)s arousal=%(arousal).2f val_pos=%(v_pos).2f val_neg=%(v_neg).2f\n" % e return s # # Helpers # def bn(n): # beautify names n = n.lower() if n == 'forrestvo': return 'Forrest (VO)' elif n == 'mrsgump': return 'Mrs. Gump' elif n == 'disappointment': return 'Disappoint.' elif n == 'angerrage': return 'Anger/Rage' return n.capitalize() def get_unique_characters(rat): return np.unique( np.concatenate( [np.unique([a['character'] for a in an]) for an in rat])) def get_unique_emotions(rat): return [e for e in np.unique( np.concatenate( [np.unique( np.concatenate([a['emotion'].split() for a in an])) for an in rat])) if not '?' in e] def get_unique_oncues(rat): return [e for e in np.unique( np.concatenate( [np.unique( np.concatenate([a['oncue'].split() for a in an])) for an in rat])) if not '?' in e] def slice2segments(ratings, cond, segments): # compute a time series of inter-observer agreement wrt a particular # emotion property (or combinations thereof) # annotations given with start and stop time, are converted into a # timeseries with data point locations given by the sequence of # `segments`. Segments intersecting with a given annotation from an # individual observer are set to one, the rest to zero. The mean # across observers for any segment is returned slicer = np.zeros(len(segments)) for rat in ratings: rslicer = np.zeros(len(segments)) for e in rat: use = True for k, v in cond.iteritems(): if v == '*': continue if k in ('oncue', 'offcue', 'emotion'): if not v in e[k].split(): use = False else: if not v == e[k]: use = False if not use: continue select = np.logical_and(segments.T[1] > e['start'], segments.T[0] < e['end']) rslicer[select] += 1 slicer += rslicer > 0 slicer = slicer.astype(float) / len(ratings) return slicer def get_labeled_ratings(rat, col): return [r[r[col] != ''] for r in rat] def get_timeseries(rat, urat, segments, char='*'): # yield time series representations of all relevant emotion attributes # from raw annotations vars = [get_arousal_modulation(rat, segments, char=char), get_valence_modulation(rat, segments, char=char), get_direction_modulation(rat, segments, char=char)] labels = ['arousal', 'valence', 'direction'] for emo in get_unique_emotions(urat): vars.append(_get_modulation(rat, segments, emotion=emo, character=char)) labels.append(emo.lower()) for oc in get_unique_oncues(urat): vars.append(_get_modulation(rat, segments, oncue=oc, character=char)) labels.append(oc.lower()) return np.array(vars).T, labels def _get_modulation(ratings, segments, **kwargs): return slice2segments(ratings, kwargs, segments) def get_arousal_modulation(ratings, segments, char='*'): ts = _get_modulation(ratings, segments, character=char, arousal='HIGH') \ - _get_modulation(ratings, segments, character=char, arousal='LOW') return ts def get_valence_modulation(ratings, segments, char='*'): ts = _get_modulation(ratings, segments, character=char, valence='POS') \ - _get_modulation(ratings, segments, character=char, valence='NEG') return ts def get_direction_modulation(ratings, segments, char='*'): ts = _get_modulation(ratings, segments, character=char, direction='SELF') \ - _get_modulation(ratings, segments, character=char, direction='OTHER') return ts if __name__ == '__main__': # main function: compute stats, generate derived data, make figures import sys import pylab as pl import os from os.path import join as opj if len(sys.argv) < 3: print "insufficient number of arguments" print "usage: descr_stats.py <stats export path> <figure export path>" sys.exit(1) statspath = sys.argv[1] figpath = sys.argv[2] for p in (opj(statspath, 'timeseries'), opj(statspath, 'segmentation')): if not os.path.exists(p): os.makedirs(p) second_segments = get_nsecond_segments() avr = get_av_ratings() aor = get_ao_ratings() open(opj(statspath, 'segmentation', 'emotions_av_1s_thr50.tsv'), 'w').write( emo2advene( *mk_thresh_emotion_episodes(avr, .5, get_nsecond_segments(1)), thresh=.5)) open(opj(statspath, 'segmentation', 'emotions_ao_1s_thr50.tsv'), 'w').write( emo2advene( *mk_thresh_emotion_episodes(aor, .5, get_nsecond_segments(1)), thresh=.5)) open(opj(statspath, 'segmentation', 'emotions_av_shots_thr50.tsv'), 'w').write( emo2advene( *mk_thresh_emotion_episodes(avr, .5, get_shots()), thresh=.5)) open(opj(statspath, 'segmentation', 'emotions_ao_shots_thr50.tsv'), 'w').write( emo2advene( *mk_thresh_emotion_episodes(aor, .5, get_shots()), thresh=.5)) # export inter-observer agreement timeseries # for stim type for rat, ratlabel in ((avr, 'av'), (aor, 'ao')): # for segment type for seg, seglabel in ((get_nsecond_segments(1), '1s'), (get_nsecond_segments(2), '2s'), (get_shots(), 'shots')): # for all characters for char in ('*',) + tuple(get_unique_characters(rat)): arr, l = get_timeseries(rat, rat, seg, char=char) if char == '*': char = 'allchar' np.savetxt( opj(statspath, 'timeseries', 'ioats_%s_%s_%s.csv' % (seglabel, ratlabel, char.lower())), arr, fmt='%.2f', delimiter=',', comments='', header=','.join(l)) # export summary stats for the data paper print_stats(avr, 'AV', avr + aor) print_stats(aor, 'AO', avr + aor) print_combstats(avr, aor) # IOA time series demo plot mkplot_indicator_ts(avr, aor, '*', get_nsecond_segments(n=10), figpath) # episodes per character plot fig = pl.figure(figsize=(10, 6)) pl.subplot(121) comp_barplot( get_agreed_labels(avr, 'character', second_segments, athresh=.5, nseg_thresh=5), get_agreed_labels(aor, 'character', second_segments, athresh=.5, nseg_thresh=5), 2, 'Total number of emotion episodes') ax = pl.subplot(122) comp_barplot( get_agreed_labels(avr, 'character', second_segments, athresh=.5, nseg_thresh=5), get_agreed_labels(aor, 'character', second_segments, athresh=.5, nseg_thresh=5), 1, 'Total time of portrayed emotions (in sec)') ax.yaxis.tick_right() ax.yaxis.set_label_position("right") fig.autofmt_xdate() pl.savefig(opj(figpath, 'character_episodes.svg')) # episodes per emotion catgeory plot fig = pl.figure(figsize=(10, 6)) pl.subplot(121) comp_barplot( get_agreed_labels(avr, 'emotion', second_segments, athresh=.5, nseg_thresh=5), get_agreed_labels(aor, 'emotion', second_segments, athresh=.5, nseg_thresh=5), 2, 'Total number of emotion episodes') ax = pl.subplot(122) comp_barplot( get_agreed_labels(avr, 'emotion', second_segments, athresh=.5, nseg_thresh=5), get_agreed_labels(aor, 'emotion', second_segments, athresh=.5, nseg_thresh=5), 1, 'Total number of emotion episodes') ax.yaxis.tick_right() ax.yaxis.set_label_position("right") fig.autofmt_xdate() pl.savefig(opj(figpath, 'labeledemotion_episodes.svg')) # episodes per onset cue type plot fig = pl.figure(figsize=(5, 5)) comp_barplot( get_agreed_labels(avr, 'oncue', second_segments, athresh=.5, nseg_thresh=5), get_agreed_labels(aor, 'oncue', second_segments, athresh=.5, nseg_thresh=5), 2, 'Total number of emotion episodes') fig.autofmt_xdate() pl.savefig(opj(figpath, 'labeledoncue_episodes.svg')) # intra-stimulus IOA time series correlation plot import seaborn as sns fig = pl.figure() cmap_range = (-.6, .6) pl.subplot(121) m, l = get_timeseries(avr, avr + aor, second_segments) l = [bn(i) for i in l] sns.corrplot( m, annot=False, method='spearman', names=l, diag_names=False, cmap_range=cmap_range) pl.subplot(122) m, l = get_timeseries(aor, avr + aor, second_segments) l = [bn(i) for i in l] sns.corrplot( m, annot=False, method='spearman', names=l, diag_names=False, cmap_range=cmap_range) # fig.autofmt_xdate() pl.savefig(opj(figpath, 'intercorr_indicators.svg')) # pl.show()
37.498853
139
0.57858
4,019
32,699
4.596417
0.167455
0.019488
0.012992
0.013533
0.40616
0.345098
0.310561
0.258431
0.220863
0.214421
0
0.014397
0.288419
32,699
871
140
37.541906
0.779526
0.1093
0
0.292724
1
0.001692
0.137472
0.048359
0
0
0
0
0
0
null
null
0.003384
0.023689
null
null
0.069374
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
35389b1dda431883462d43a53b81c827ace9b7c6
1,470
py
Python
setup.py
lazy-scrivener-games/libris
1e791da2a876076d390aa1e7281ad4324b0bb3f4
[ "MIT" ]
null
null
null
setup.py
lazy-scrivener-games/libris
1e791da2a876076d390aa1e7281ad4324b0bb3f4
[ "MIT" ]
2
2021-11-18T14:08:17.000Z
2022-01-03T19:51:53.000Z
setup.py
lazy-scrivener-games/libris
1e791da2a876076d390aa1e7281ad4324b0bb3f4
[ "MIT" ]
null
null
null
from setuptools import setup setup( name='libris', version='1.1.0', description='PDF generator that uses Markdown sources.', url='https://github.com/lazy-scrivener-games/libris', download_url='https://github.com/lazy-scrivener-games/libris/archive/refs/tags/v1.1.tar.gz', author='Chris Muller', author_email='chris@lazyscrivenergames.com', keywords=[ 'utility', 'pdf', 'html', 'css', 'markdown', 'conversion', 'assembly', 'book' ], license='MIT', packages=[ 'libris', 'libris.lib' ], package_data={ 'libris': ['json-schemas/*'], }, scripts=[ 'scripts/libris' ], install_requires=[ 'beautifulsoup4 == 4.10.0', 'idna == 2.6', 'Jinja2 == 3.0.2', 'jsonpointer == 1.10', 'jsonschema == 4.0.0', 'markdown2 == 2.4.1', 'watchdog == 2.1.6', 'weasyprint == 52.5' ], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: End Users/Desktop', 'Topic :: Text Processing :: Markup :: Markdown', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9' ], )
27.735849
96
0.534014
149
1,470
5.241611
0.604027
0.121639
0.160051
0.166453
0.104994
0.104994
0.104994
0.104994
0
0
0
0.040658
0.297279
1,470
52
97
28.269231
0.715392
0
0
0.096154
0
0.019231
0.546259
0.019048
0
0
0
0
0
1
0
true
0
0.019231
0
0.019231
0.019231
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
0
0
0
0
0
2
3544cd77439e096291255d9ae822ea8626902259
364
py
Python
lib/python2.7/site-packages/braintree/coinbase_account.py
ervinpepic/E-commerce
2c15255d1730728cf35c166b9f88cffcb99f5323
[ "MIT" ]
2
2019-12-06T15:40:14.000Z
2020-07-29T21:30:35.000Z
lib/python2.7/site-packages/braintree/coinbase_account.py
ervinpepic/E-commerce
2c15255d1730728cf35c166b9f88cffcb99f5323
[ "MIT" ]
13
2020-03-24T17:53:51.000Z
2022-02-10T20:01:14.000Z
lib/python2.7/site-packages/braintree/coinbase_account.py
ervinpepic/E-commerce
2c15255d1730728cf35c166b9f88cffcb99f5323
[ "MIT" ]
2
2019-04-29T14:16:10.000Z
2020-07-23T12:04:17.000Z
import braintree from braintree.resource import Resource class CoinbaseAccount(Resource): def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "subscriptions" in attributes: self.subscriptions = [braintree.subscription.Subscription(gateway, subscription) for subscription in self.subscriptions]
40.444444
132
0.760989
36
364
7.472222
0.444444
0.05948
0.111524
0.185874
0
0
0
0
0
0
0
0
0.164835
364
8
133
45.5
0.884868
0
0
0
0
0
0.035714
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0
0.571429
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3545b0af996f2bab834bba341f06bea49a35176a
575
py
Python
fastapi_csrf/__init__.py
TheLazzziest/fastapi-csrf
11499aaf2f343e96071d5836da911cec335af4bf
[ "MIT" ]
null
null
null
fastapi_csrf/__init__.py
TheLazzziest/fastapi-csrf
11499aaf2f343e96071d5836da911cec335af4bf
[ "MIT" ]
null
null
null
fastapi_csrf/__init__.py
TheLazzziest/fastapi-csrf
11499aaf2f343e96071d5836da911cec335af4bf
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (C) 2019-2020 All rights reserved. # FILENAME: __init__.py # VERSION: 0.0.1 # CREATED: 2020-11-25 14:35 # AUTHOR: Aekasitt Guruvanich <aekazitt@gmail.com> # DESCRIPTION: # # HISTORY: #************************************************************* ''' FastAPI extension that provides Csrf Protection Token support ''' __version__ = '0.3.2' from .csrf import CSRF from .settings import CSRFSettings, get_settings from .exceptions import CSRFError, MissingTokenError, TokenValidationError from .utils import encode_token, decode_token
27.380952
74
0.676522
67
575
5.641791
0.776119
0.042328
0
0
0
0
0
0
0
0
0
0.053678
0.125217
575
20
75
28.75
0.697813
0.573913
0
0
0
0
0.02193
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
1020607eb3344c46ee1556a2a91d6be5181cce30
9,206
py
Python
src/sentinel/azext_sentinel/vendored_sdks/security_insights/_security_insights.py
hpsan/azure-cli-extensions
be1589bb6dd23837796e088d28e65e873050171e
[ "MIT" ]
null
null
null
src/sentinel/azext_sentinel/vendored_sdks/security_insights/_security_insights.py
hpsan/azure-cli-extensions
be1589bb6dd23837796e088d28e65e873050171e
[ "MIT" ]
null
null
null
src/sentinel/azext_sentinel/vendored_sdks/security_insights/_security_insights.py
hpsan/azure-cli-extensions
be1589bb6dd23837796e088d28e65e873050171e
[ "MIT" ]
1
2020-07-16T23:49:49.000Z
2020-07-16T23:49:49.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from .operations.operations import Operations from .operations.alert_rules_operations import AlertRulesOperations from .operations.actions_operations import ActionsOperations from .operations.alert_rule_templates_operations import AlertRuleTemplatesOperations from .operations.cases_operations import CasesOperations from .operations.comments_operations import CommentsOperations from .operations.case_comments_operations import CaseCommentsOperations from .operations.bookmarks_operations import BookmarksOperations from .operations.case_relations_operations import CaseRelationsOperations from .operations.bookmark_relations_operations import BookmarkRelationsOperations from .operations.bookmark_operations import BookmarkOperations from .operations.data_connectors_operations import DataConnectorsOperations from .operations.data_connectors_check_requirements_operations import DataConnectorsCheckRequirementsOperations from .operations.entities_operations import EntitiesOperations from .operations.entities_relations_operations import EntitiesRelationsOperations from .operations.entity_relations_operations import EntityRelationsOperations from .operations.office_consents_operations import OfficeConsentsOperations from .operations.product_settings_operations import ProductSettingsOperations from .operations.cases_aggregations_operations import CasesAggregationsOperations from .operations.entity_queries_operations import EntityQueriesOperations from .operations.incidents_operations import IncidentsOperations from .operations.incident_comments_operations import IncidentCommentsOperations from .operations.incident_relations_operations import IncidentRelationsOperations from . import models from ._configuration import SecurityInsightsConfiguration class SecurityInsights(SDKClient): """API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider :ivar config: Configuration for client. :vartype config: SecurityInsightsConfiguration :ivar operations: Operations operations :vartype operations: securityinsights.operations.Operations :ivar alert_rules: AlertRules operations :vartype alert_rules: securityinsights.operations.AlertRulesOperations :ivar actions: Actions operations :vartype actions: securityinsights.operations.ActionsOperations :ivar alert_rule_templates: AlertRuleTemplates operations :vartype alert_rule_templates: securityinsights.operations.AlertRuleTemplatesOperations :ivar cases: Cases operations :vartype cases: securityinsights.operations.CasesOperations :ivar comments: Comments operations :vartype comments: securityinsights.operations.CommentsOperations :ivar case_comments: CaseComments operations :vartype case_comments: securityinsights.operations.CaseCommentsOperations :ivar bookmarks: Bookmarks operations :vartype bookmarks: securityinsights.operations.BookmarksOperations :ivar case_relations: CaseRelations operations :vartype case_relations: securityinsights.operations.CaseRelationsOperations :ivar bookmark_relations: BookmarkRelations operations :vartype bookmark_relations: securityinsights.operations.BookmarkRelationsOperations :ivar bookmark: Bookmark operations :vartype bookmark: securityinsights.operations.BookmarkOperations :ivar data_connectors: DataConnectors operations :vartype data_connectors: securityinsights.operations.DataConnectorsOperations :ivar data_connectors_check_requirements: DataConnectorsCheckRequirements operations :vartype data_connectors_check_requirements: securityinsights.operations.DataConnectorsCheckRequirementsOperations :ivar entities: Entities operations :vartype entities: securityinsights.operations.EntitiesOperations :ivar entities_relations: EntitiesRelations operations :vartype entities_relations: securityinsights.operations.EntitiesRelationsOperations :ivar entity_relations: EntityRelations operations :vartype entity_relations: securityinsights.operations.EntityRelationsOperations :ivar office_consents: OfficeConsents operations :vartype office_consents: securityinsights.operations.OfficeConsentsOperations :ivar product_settings: ProductSettings operations :vartype product_settings: securityinsights.operations.ProductSettingsOperations :ivar cases_aggregations: CasesAggregations operations :vartype cases_aggregations: securityinsights.operations.CasesAggregationsOperations :ivar entity_queries: EntityQueries operations :vartype entity_queries: securityinsights.operations.EntityQueriesOperations :ivar incidents: Incidents operations :vartype incidents: securityinsights.operations.IncidentsOperations :ivar incident_comments: IncidentComments operations :vartype incident_comments: securityinsights.operations.IncidentCommentsOperations :ivar incident_relations: IncidentRelations operations :vartype incident_relations: securityinsights.operations.IncidentRelationsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object<msrestazure.azure_active_directory>` :param subscription_id: Azure subscription ID :type subscription_id: str :param str base_url: Service URL """ def __init__( self, credentials, subscription_id, base_url=None): self.config = SecurityInsightsConfiguration(credentials, subscription_id, base_url) super(SecurityInsights, self).__init__(None, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self.api_version = '2019-01-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.alert_rules = AlertRulesOperations( self._client, self.config, self._serialize, self._deserialize) self.actions = ActionsOperations( self._client, self.config, self._serialize, self._deserialize) self.alert_rule_templates = AlertRuleTemplatesOperations( self._client, self.config, self._serialize, self._deserialize) self.cases = CasesOperations( self._client, self.config, self._serialize, self._deserialize) self.comments = CommentsOperations( self._client, self.config, self._serialize, self._deserialize) self.case_comments = CaseCommentsOperations( self._client, self.config, self._serialize, self._deserialize) self.bookmarks = BookmarksOperations( self._client, self.config, self._serialize, self._deserialize) self.case_relations = CaseRelationsOperations( self._client, self.config, self._serialize, self._deserialize) self.bookmark_relations = BookmarkRelationsOperations( self._client, self.config, self._serialize, self._deserialize) self.bookmark = BookmarkOperations( self._client, self.config, self._serialize, self._deserialize) self.data_connectors = DataConnectorsOperations( self._client, self.config, self._serialize, self._deserialize) self.data_connectors_check_requirements = DataConnectorsCheckRequirementsOperations( self._client, self.config, self._serialize, self._deserialize) self.entities = EntitiesOperations( self._client, self.config, self._serialize, self._deserialize) self.entities_relations = EntitiesRelationsOperations( self._client, self.config, self._serialize, self._deserialize) self.entity_relations = EntityRelationsOperations( self._client, self.config, self._serialize, self._deserialize) self.office_consents = OfficeConsentsOperations( self._client, self.config, self._serialize, self._deserialize) self.product_settings = ProductSettingsOperations( self._client, self.config, self._serialize, self._deserialize) self.cases_aggregations = CasesAggregationsOperations( self._client, self.config, self._serialize, self._deserialize) self.entity_queries = EntityQueriesOperations( self._client, self.config, self._serialize, self._deserialize) self.incidents = IncidentsOperations( self._client, self.config, self._serialize, self._deserialize) self.incident_comments = IncidentCommentsOperations( self._client, self.config, self._serialize, self._deserialize) self.incident_relations = IncidentRelationsOperations( self._client, self.config, self._serialize, self._deserialize)
59.393548
118
0.783837
827
9,206
8.493349
0.174123
0.035592
0.045843
0.06549
0.19533
0.186219
0.186219
0.186219
0.179385
0.134966
0
0.001139
0.141864
9,206
154
119
59.779221
0.887975
0.391158
0
0.280488
1
0
0.00335
0
0
0
0
0
0
1
0.012195
false
0
0.329268
0
0.353659
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
102473a32f8acee21899128791e05433ccc614ee
1,579
py
Python
tests/unit/test_structure_sets.py
juvilius/atomium
9613bee3444042c1eceb570f762efe0a98f6384e
[ "MIT" ]
2
2016-05-05T10:51:25.000Z
2017-03-23T20:45:44.000Z
tests/unit/test_structure_sets.py
juvilius/atomium
9613bee3444042c1eceb570f762efe0a98f6384e
[ "MIT" ]
null
null
null
tests/unit/test_structure_sets.py
juvilius/atomium
9613bee3444042c1eceb570f762efe0a98f6384e
[ "MIT" ]
null
null
null
from unittest import TestCase from unittest.mock import Mock, patch, PropertyMock, MagicMock from atomium.base import StructureSet class StructureSetTest(TestCase): def setUp(self): self.structures = [Mock(_id=1), Mock(_id=2), Mock(_id=2)] class StructureSetCreationTests(StructureSetTest): def test_can_create_structure_set(self): s = StructureSet(*self.structures) self.assertEqual(s._d, {1: {self.structures[0]}, 2: set(self.structures[1:])}) class StructureSetAdditionTests(StructureSetTest): def test_can_add_structure_sets(self): s1 = StructureSet(*self.structures[:2]) s2 = StructureSet(self.structures[2]) s = s1 + s2 self.assertEqual(s._d, {1: {self.structures[0]}, 2: set(self.structures[1:])}) class StructureSetLengthTests(StructureSetTest): def test_can_get_structure_set_len(self): s = StructureSet(*self.structures) self.assertEqual(len(s), 3) class StructureSetIdsTests(StructureSetTest): def test_can_get_ids(self): s = StructureSet(*self.structures) self.assertEqual(s.ids, {1, 2}) class StructureSetStructuresTests(StructureSetTest): def test_can_get_structures(self): s = StructureSet(*self.structures) self.assertEqual(set(s.structures), set(self.structures)) class StructureSetGettingTests(StructureSetTest): def test_can_get_structure_by_id(self): s = StructureSet(*self.structures) self.assertEqual(s.get(1), self.structures[0]) self.assertIn(s.get(2), self.structures[1:])
26.762712
86
0.704877
188
1,579
5.765957
0.239362
0.193727
0.167897
0.143911
0.428967
0.375461
0.305351
0.22048
0.105166
0.105166
0
0.018419
0.174794
1,579
59
87
26.762712
0.813507
0
0
0.212121
0
0
0
0
0
0
0
0
0.212121
1
0.212121
false
0
0.090909
0
0.515152
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
0
1
0
0
2
1027adaa268c7cfd3c8ab5ad76434dddf638bfef
280
py
Python
0x00-python_variable_annotations/2-floor.py
JoseAVallejo12/holbertonschool-web_back_end
eb514784772352b8e4873d1f648726815ab69592
[ "MIT" ]
null
null
null
0x00-python_variable_annotations/2-floor.py
JoseAVallejo12/holbertonschool-web_back_end
eb514784772352b8e4873d1f648726815ab69592
[ "MIT" ]
null
null
null
0x00-python_variable_annotations/2-floor.py
JoseAVallejo12/holbertonschool-web_back_end
eb514784772352b8e4873d1f648726815ab69592
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """Write a function which takes a float n as argument and returns the floor of the float""" def floor(n: float) -> int: """return int part of n Args: n (float): arg Returns: int: value int of np """ return int(n)
17.5
50
0.582143
44
280
3.704545
0.590909
0.07362
0
0
0
0
0
0
0
0
0
0.005155
0.307143
280
15
51
18.666667
0.835052
0.675
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1033474b5f7434ce4647090c2adec2814c595d0b
769
py
Python
swagger_server/controllers/host_controller.py
BlueLens/bl-db-product
b6d82ed6407a511185dac0d5e22dd45929d76852
[ "Apache-2.0" ]
null
null
null
swagger_server/controllers/host_controller.py
BlueLens/bl-db-product
b6d82ed6407a511185dac0d5e22dd45929d76852
[ "Apache-2.0" ]
null
null
null
swagger_server/controllers/host_controller.py
BlueLens/bl-db-product
b6d82ed6407a511185dac0d5e22dd45929d76852
[ "Apache-2.0" ]
null
null
null
import connexion from swagger_server.models.add_host_response import AddHostResponse from swagger_server.models.host import Host from datetime import date, datetime from typing import List, Dict from six import iteritems from ..util import deserialize_date, deserialize_datetime from orm.hosts import Hosts def add_host(body): """ Add a new HOst :param body: Host object that needs to be added to the db. :type body: dict | bytes :rtype: AddHostResponse """ return Hosts.add_host(connexion) def get_hosts(offset=0, limit=1000): """ Get all hosts Returns Hosts :param offset: :type offset: int :param limit: :type limit: int :rtype: GetHostsResponse """ return Hosts.get_hosts(offset, limit)
22.617647
67
0.712614
105
769
5.12381
0.447619
0.039033
0.063197
0.085502
0
0
0
0
0
0
0
0.008278
0.214564
769
33
68
23.30303
0.88245
0.314694
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.666667
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
0
0
1
0
1
0
0
2
103662e2f1c32d914a502a85553eda3108c12a77
338
py
Python
src/x_mlps/_types.py
PyriteAI/x-mlps
fcbba196384f16b742fccb8e82bd2adc467b1ef2
[ "MIT" ]
4
2021-12-29T03:04:58.000Z
2022-01-13T13:07:43.000Z
src/x_mlps/_types.py
PyriteAI/x-mlps
fcbba196384f16b742fccb8e82bd2adc467b1ef2
[ "MIT" ]
1
2022-01-24T00:06:46.000Z
2022-01-24T00:06:46.000Z
src/x_mlps/_types.py
PyriteAI/x-mlps
fcbba196384f16b742fccb8e82bd2adc467b1ef2
[ "MIT" ]
1
2022-02-24T10:17:17.000Z
2022-02-24T10:17:17.000Z
from typing import Any, Optional, Protocol import haiku as hk class XModuleFactory(Protocol): """Defines a common factory function interface for all X-MLP modules.""" def __call__(self, num_patches: int, dim: int, depth: int, name: Optional[str] = None, **kwargs: Any) -> hk.Module: ... __all__ = ["XModuleFactory"]
24.142857
119
0.686391
44
338
5.068182
0.795455
0
0
0
0
0
0
0
0
0
0
0
0.189349
338
13
120
26
0.813869
0.195266
0
0
0
0
0.052632
0
0
0
0
0
0
1
0.166667
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
0
0
0
1
0
1
0
0
2
103d421d9e7a788769f572e3441c46e43761c020
2,998
py
Python
backend/radar/tests/engine/test_directions.py
me-anton/radar-app
cc7d1e876e0ce9b6173b6d7b484d5553e247166e
[ "MIT" ]
null
null
null
backend/radar/tests/engine/test_directions.py
me-anton/radar-app
cc7d1e876e0ce9b6173b6d7b484d5553e247166e
[ "MIT" ]
null
null
null
backend/radar/tests/engine/test_directions.py
me-anton/radar-app
cc7d1e876e0ce9b6173b6d7b484d5553e247166e
[ "MIT" ]
null
null
null
import pytest from radar.engine.directions_meta import Position from radar.engine.directions import DirectionPool from radar.tests.engine.share import make_positions start_pos = Position(5, 5) width = 4 height = 6 occupy_when_moving_left = make_positions((4, 5), (4, 6), (4, 7), (4, 8), (4, 9), (4, 10)) occupy_when_moving_right = make_positions((9, 5), (9, 6), (9, 7), (9, 8), (9, 9), (9, 10)) occupy_when_moving_up = make_positions((5, 4), (6, 4), (7, 4), (8, 4)) occupy_when_moving_down = make_positions((5, 11), (6, 11), (7, 11), (8, 11)) occupy_when_moving_top_left = occupy_when_moving_left + occupy_when_moving_up + [Position(4, 4)] occupy_when_moving_top_right = occupy_when_moving_right + occupy_when_moving_up + [Position(9, 4)] occupy_when_moving_bottom_left = occupy_when_moving_left + occupy_when_moving_down + [Position(4, 11)] occupy_when_moving_bottom_right = occupy_when_moving_right + occupy_when_moving_down + [Position(9, 11)] @pytest.mark.parametrize("direction, expected_output", [ [DirectionPool.left, occupy_when_moving_left], [DirectionPool.right, occupy_when_moving_right], [DirectionPool.up, occupy_when_moving_up], [DirectionPool.down, occupy_when_moving_down], [DirectionPool.top_left, occupy_when_moving_top_left], [DirectionPool.top_right, occupy_when_moving_top_right], [DirectionPool.bottom_left, occupy_when_moving_bottom_left], [DirectionPool.bottom_right, occupy_when_moving_bottom_right] ]) def test_positions_to_occupy_by_movement(direction, expected_output): assert direction.positions_to_occupy_by_movement(start_pos, width, height) \ == set(expected_output), \ 'Incorrect prediction for positions occupied by moving ' \ f'{direction.name} from {start_pos}' free_when_moving_left = occupy_when_moving_right free_when_moving_right = occupy_when_moving_left free_when_moving_up = occupy_when_moving_down free_when_moving_down = occupy_when_moving_up free_when_moving_top_left = occupy_when_moving_bottom_right free_when_moving_top_right = occupy_when_moving_bottom_left free_when_moving_bottom_left = occupy_when_moving_top_right free_when_moving_bottom_right = occupy_when_moving_top_left @pytest.mark.parametrize('direction, expected_output', [ [DirectionPool.left, free_when_moving_left], [DirectionPool.right, free_when_moving_right], [DirectionPool.up, free_when_moving_up], [DirectionPool.down, free_when_moving_down], [DirectionPool.top_left, free_when_moving_top_left], [DirectionPool.top_right, free_when_moving_top_right], [DirectionPool.bottom_left, free_when_moving_bottom_left], [DirectionPool.bottom_right, free_when_moving_bottom_right] ]) def test_positions_freed_by_movement(direction, expected_output): assert direction.positions_freed_by_movement(start_pos, width, height) \ == set(expected_output), \ 'Incorrect prediction for positions freed by moving ' \ f'{direction.name} from {start_pos}'
48.354839
104
0.782188
428
2,998
5
0.126168
0.224299
0.239252
0.093458
0.791589
0.621028
0.548598
0.298131
0.071963
0.071963
0
0.022745
0.12008
2,998
61
105
49.147541
0.788476
0
0
0.113208
0
0
0.074383
0
0
0
0
0
0.037736
1
0.037736
false
0
0.075472
0
0.113208
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
103daf4ed416c14f821a4beeb3f883ba6356a46e
501
py
Python
backend/api/serializers/sales_submission_content_reason.py
kuanfan99/zeva
57b506a108fe57438506569d5503c90c52216b2f
[ "Apache-2.0" ]
3
2020-03-25T03:06:20.000Z
2021-01-20T23:36:03.000Z
backend/api/serializers/sales_submission_content_reason.py
kuanfan99/zeva
57b506a108fe57438506569d5503c90c52216b2f
[ "Apache-2.0" ]
740
2019-12-16T15:53:39.000Z
2022-03-26T08:25:10.000Z
backend/api/serializers/sales_submission_content_reason.py
kuanfan99/zeva
57b506a108fe57438506569d5503c90c52216b2f
[ "Apache-2.0" ]
11
2019-11-28T20:39:15.000Z
2022-01-31T17:53:31.000Z
""" Sales Submission Content Reason Serializer """ from rest_framework.serializers import ModelSerializer from api.models.sales_submission_content_reason import \ SalesSubmissionContentReason class SalesSubmissionContentReasonSerializer(ModelSerializer): """ Serializer for sales submission content reasons """ class Meta: model = SalesSubmissionContentReason fields = ( 'reason', ) read_only_fields = ( 'reason', )
22.772727
62
0.682635
39
501
8.615385
0.589744
0.133929
0.196429
0.166667
0
0
0
0
0
0
0
0
0.251497
501
21
63
23.857143
0.896
0.179641
0
0.166667
0
0
0.030928
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1040698960d5a7b813dcd3322776e784cf2b1015
64
py
Python
memsource/__init__.py
zepellin/memsource-wrap
49694129b26e4c32a07d10cdca3af80b344fee3d
[ "MIT" ]
null
null
null
memsource/__init__.py
zepellin/memsource-wrap
49694129b26e4c32a07d10cdca3af80b344fee3d
[ "MIT" ]
null
null
null
memsource/__init__.py
zepellin/memsource-wrap
49694129b26e4c32a07d10cdca3af80b344fee3d
[ "MIT" ]
null
null
null
__author__ = 'Gengo' __version__ = '0.4.11' __license__ = 'MIT'
16
22
0.6875
8
64
4
1
0
0
0
0
0
0
0
0
0
0
0.072727
0.140625
64
3
23
21.333333
0.509091
0
0
0
0
0
0.21875
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1047a19c9eb5ae4766b29b30024ddec7e8072afb
251
py
Python
pyoaz/cache/simple_cache/__init__.py
ameroueh/oaz
7cf192b02adaa373b7b93bedae3ef67886ea53af
[ "MIT" ]
8
2021-03-18T16:06:42.000Z
2022-03-09T10:42:44.000Z
pyoaz/cache/simple_cache/__init__.py
ameroueh/oaz
7cf192b02adaa373b7b93bedae3ef67886ea53af
[ "MIT" ]
null
null
null
pyoaz/cache/simple_cache/__init__.py
ameroueh/oaz
7cf192b02adaa373b7b93bedae3ef67886ea53af
[ "MIT" ]
null
null
null
from ..cache import * from .simple_cache import SimpleCache as SimpleCacheCore class SimpleCache: def __init__(self, game, size): self._core = SimpleCacheCore(game.core, size) @property def core(self): return self._core
20.916667
56
0.693227
30
251
5.566667
0.533333
0.131737
0
0
0
0
0
0
0
0
0
0
0.223108
251
11
57
22.818182
0.85641
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0.125
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
104f11e40180dde7994628cb3acb5e2cfa492764
1,159
py
Python
setup.py
d34ddr34m3r/python-magic
5fa21cad9bec648c700b223d6222f5d601db50da
[ "MIT" ]
21
2018-02-14T18:51:49.000Z
2022-01-15T06:59:16.000Z
setup.py
d34ddr34m3r/python-magic
5fa21cad9bec648c700b223d6222f5d601db50da
[ "MIT" ]
1
2019-01-30T19:55:22.000Z
2020-05-16T21:31:58.000Z
setup.py
d34ddr34m3r/python-magic
5fa21cad9bec648c700b223d6222f5d601db50da
[ "MIT" ]
7
2017-10-02T16:14:16.000Z
2022-03-16T14:27:32.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup setup(name='python-magic-bin', description='File type identification using libmagic binary package', author='Adam Hupp, Julian David Rath, Spencer Hanson', author_email='adam@hupp.org, julian.rath@gmail.com, spencer.hanson@swimlane.com', url="http://github.com/julian-r/python-magic", version='0.4.14', package_data={ 'magic': ['libmagic/*.dll', 'libmagic/*.dylib', 'libmagic/*.mgc', 'libmagic/*.so*', 'libmagic/*.la'] }, zip_safe=False, packages=['magic'], long_description="""This module uses ctypes to access the libmagic file type identification library. It makes use of the local magic database and supports both textual and MIME-type output. """, keywords="mime magic file binary", license="MIT", test_suite='test', classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', ], )
37.387097
112
0.630716
135
1,159
5.377778
0.651852
0.078512
0.103306
0
0
0
0
0
0
0
0
0.007778
0.223469
1,159
31
113
37.387097
0.798889
0.036238
0
0
0
0.037037
0.603943
0.043907
0
0
0
0
0
1
0
true
0
0.037037
0
0.037037
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
0
0
0
0
1
0
0
0
0
0
0
2
105cb3ddf04ae26471a7d62ef8e5f06993ff1778
140
py
Python
src/shared/constants.py
CaliberAI/neutralizing-bias
03b57794fb9438ab0392ba8aceea857988ff5f60
[ "MIT" ]
169
2019-11-20T05:20:05.000Z
2022-03-25T11:56:26.000Z
src/shared/constants.py
gsajko/neutralizing-bias
b4774ac088e269644ec65372fee78f1adde4c5f4
[ "MIT" ]
10
2020-02-10T21:41:10.000Z
2022-02-05T10:37:52.000Z
src/shared/constants.py
gsajko/neutralizing-bias
b4774ac088e269644ec65372fee78f1adde4c5f4
[ "MIT" ]
44
2019-11-26T11:54:45.000Z
2022-03-03T23:16:04.000Z
""" just a lil global variable so everybody knows whether we have a gpu or not """ import torch CUDA = (torch.cuda.device_count() > 0)
11.666667
53
0.692857
23
140
4.173913
0.869565
0.1875
0
0
0
0
0
0
0
0
0
0.009009
0.207143
140
11
54
12.727273
0.855856
0.528571
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
2
1069b032c23405f5db455a2d7fa48816205bb575
543
py
Python
example/tests/test_transform_record.py
prodmodel/prodmodel
83aad9a2e3f07b182a8e90ea0d92580cb2e949fe
[ "Apache-2.0" ]
53
2019-04-28T03:50:05.000Z
2022-02-04T21:52:51.000Z
example/tests/test_transform_record.py
prodmodel/prodmodel
83aad9a2e3f07b182a8e90ea0d92580cb2e949fe
[ "Apache-2.0" ]
17
2019-04-25T01:46:46.000Z
2019-07-15T02:58:02.000Z
example/tests/test_transform_record.py
prodmodel/prodmodel
83aad9a2e3f07b182a8e90ea0d92580cb2e949fe
[ "Apache-2.0" ]
3
2019-06-20T07:47:23.000Z
2021-09-06T07:21:51.000Z
import transform_record import feature_definitions import unittest class TestTransformRecord(unittest.TestCase): def test_transform_record(self): self.assertEqual(transform_record.transform_record( {'marital': 'single', 'balance': 600, 'education': 'primary'}, {'primary': 100}), {'marital': 'single', 'balance': 600, 'education': 'primary', 'education_score': 100, 'rich': True}) def test_rich(self): self.assertEqual(feature_definitions.rich({'marital': 'single', 'balance': 600}), True)
33.9375
112
0.683241
56
543
6.464286
0.410714
0.165746
0.165746
0.190608
0.21547
0.21547
0
0
0
0
0
0.03304
0.163904
543
15
113
36.2
0.764317
0
0
0
0
0
0.217311
0
0
0
0
0
0.2
1
0.2
false
0
0.3
0
0.6
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
0
0
1
0
0
2
107ffc374cf13152bb40d18c06e73d9fc20f17e1
1,462
py
Python
support/check_python_prereqs.py
kishorerv93/spinnaker-terraform
a86164c7a66ab9c7ec81551add53c00a59610aca
[ "Apache-2.0" ]
116
2016-02-08T21:17:31.000Z
2020-08-19T08:00:18.000Z
support/check_python_prereqs.py
kishorerv93/spinnaker-terraform
a86164c7a66ab9c7ec81551add53c00a59610aca
[ "Apache-2.0" ]
12
2016-03-12T22:54:57.000Z
2019-03-28T16:48:01.000Z
support/check_python_prereqs.py
kishorerv93/spinnaker-terraform
a86164c7a66ab9c7ec81551add53c00a59610aca
[ "Apache-2.0" ]
66
2015-11-24T19:30:46.000Z
2022-03-27T16:50:58.000Z
#!/usr/bin/env python import sys import imp import re def main(argv): cloud_provider = sys.argv[1] reqd_module_names_and_versions = {} reqd_module_names_and_versions['requests'] = '2.2.1' reqd_module_names_and_versions['json'] = '2.0.9' reqd_module_names_and_versions['docopt'] = '0.6.2' if cloud_provider.lower() == 'aws': reqd_module_names_and_versions['boto'] = '2.38.0' #elif cloud_provider.lower() == 'gcp': # reqd_module_names_and_versions['libcloud'] = '0.20.0' ret_val = 0 for module_name in reqd_module_names_and_versions: try: __import__(module_name) installed_version = str(__import__(module_name).__version__) installed_version_formatted = int(re.sub( "\.", '', str(__import__(module_name).__version__))) reqd_version = int(re.sub( "\.", '', reqd_module_names_and_versions[module_name])) if installed_version_formatted < reqd_version: print "ERROR: Module " + module_name + " is not of high enough version. You need: v" + reqd_module_names_and_versions[module_name] + ", you have: " + installed_version ret_val = 1 except ImportError: print "ERROR: Could not import required python module '" + module_name + "'. Please install it with pip." ret_val = 1 sys.exit(ret_val) if __name__ == "__main__": main(sys.argv)
31.106383
183
0.636115
188
1,462
4.484043
0.361702
0.106762
0.160142
0.192171
0.365362
0.149466
0.085409
0
0
0
0
0.019108
0.24829
1,462
46
184
31.782609
0.747953
0.077975
0
0.068966
0
0
0.152416
0
0
0
0
0
0
0
null
null
0
0.275862
null
null
0.068966
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
1
0
0
0
0
0
0
0
0
2
1082978a22e95c0fe901caae136fcc55cde02847
225
py
Python
readfile.py
qubard/deepq-collision-avoidance
2d6cc3d494482e0b7a3e38f825bcb6eae103c453
[ "MIT" ]
3
2020-01-07T14:44:30.000Z
2020-11-10T04:16:17.000Z
readfile.py
qubard/deepq-collision-avoidance
2d6cc3d494482e0b7a3e38f825bcb6eae103c453
[ "MIT" ]
1
2021-01-11T03:51:47.000Z
2021-01-11T03:51:47.000Z
readfile.py
qubard/deepq-collision-avoidance
2d6cc3d494482e0b7a3e38f825bcb6eae103c453
[ "MIT" ]
null
null
null
with open('mar27') as f: content = f.readlines() for line in content: split = line.split(' ') if split[0] == 'Episode:': print("("+str(int(split[1])) + "," + split[3].split("\n")[0] + ")")
32.142857
79
0.48
29
225
3.724138
0.689655
0
0
0
0
0
0
0
0
0
0
0.03681
0.275556
225
6
80
37.5
0.625767
0
0
0
0
0
0.084444
0
0
0
0
0
0
1
0
false
0
0
0
0
0.166667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1084223963fafab9b17b69220c1aa68166545785
468
py
Python
Strings_example.py
lokichinni12/python
b41de2d0f99b355c6d2d626f6121abf25e41a6e7
[ "Apache-2.0" ]
null
null
null
Strings_example.py
lokichinni12/python
b41de2d0f99b355c6d2d626f6121abf25e41a6e7
[ "Apache-2.0" ]
null
null
null
Strings_example.py
lokichinni12/python
b41de2d0f99b355c6d2d626f6121abf25e41a6e7
[ "Apache-2.0" ]
null
null
null
mystring="hello world" #Print Complete string print(mystring) print(mystring[::]) #indexing of string print(mystring[0]) print(mystring[4]) #slicing print(mystring[1:7]) print(mystring[0:10:2]) # Methods print(mystring.upper()) print(mystring.split()) #formatting print("hello world {},".format("Loki")) print("hello world {}, {}, {}".format("Loki", "INSERTING", "NEWFORMATTING")) print("hello world {1}, {2}, {0}".format("By Loki", "INSERTING", "NEWFORMATTING"))
21.272727
82
0.690171
60
468
5.383333
0.4
0.321981
0.139319
0.130031
0.154799
0
0
0
0
0
0
0.025822
0.089744
468
21
83
22.285714
0.732394
0.136752
0
0
0
0
0.330827
0
0
0
0
0
0
1
0
false
0
0
0
0
0.916667
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
0
0
0
1
0
2
108686718d83ec67d715e658e5f1e08a9c537e3a
410
py
Python
sense_hat/pitch_roll_yaw.py
g-grilli/station
8a26da6318c2b1fbc8129ea7224907c4798ae3be
[ "MIT" ]
null
null
null
sense_hat/pitch_roll_yaw.py
g-grilli/station
8a26da6318c2b1fbc8129ea7224907c4798ae3be
[ "MIT" ]
null
null
null
sense_hat/pitch_roll_yaw.py
g-grilli/station
8a26da6318c2b1fbc8129ea7224907c4798ae3be
[ "MIT" ]
null
null
null
from sense_hat import SenseHat sense = SenseHat() sense.show_letter("G") while True: x = sense.get_accelerometer_raw()['x'] y = sense.get_accelerometer_raw()['y'] z = sense.get_accelerometer_raw()['z'] x = round(x, 0) y = round(y, 0) if x == -1: sense.set_rotation(180) elif y == 1: sense.set_rotation(90) elif y == -1: sense.set_rotation(270) else: sense.set_rotation(0)
18.636364
40
0.641463
65
410
3.861538
0.415385
0.12749
0.25498
0.286853
0.175299
0.175299
0
0
0
0
0
0.042683
0.2
410
22
41
18.636364
0.722561
0
0
0
0
0
0.009732
0
0
0
0
0
0
1
0
false
0
0.058824
0
0.058824
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
0
0
0
2
109c5d77ca6eace01905f595c8747c38e6987617
89
py
Python
detectem/__init__.py
kelar86/detectem
b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1
[ "MIT" ]
null
null
null
detectem/__init__.py
kelar86/detectem
b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1
[ "MIT" ]
1
2021-03-26T00:23:57.000Z
2021-03-26T00:23:57.000Z
detectem/__init__.py
kelar86/detectem
b1ecc3543b7c44ee76c4cac0d3896a7747bf86c1
[ "MIT" ]
null
null
null
__author__ = """Claudio Salazar""" __email__ = 'csalazar@spect.cl' __version__ = '0.7.0'
22.25
34
0.696629
11
89
4.545455
0.909091
0
0
0
0
0
0
0
0
0
0
0.037975
0.11236
89
3
35
29.666667
0.594937
0
0
0
0
0
0.41573
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
10b3ffc095102fa1f687c9b862878cd194ae7382
387
py
Python
webchat.py
Tony2h/Xhome_bjtu
4fb98cf71896d3441106a48213c61678a0271fc4
[ "Apache-2.0" ]
2
2018-09-28T07:12:09.000Z
2018-09-28T07:12:16.000Z
webchat.py
Tony2h/Xhome_bjtu
4fb98cf71896d3441106a48213c61678a0271fc4
[ "Apache-2.0" ]
null
null
null
webchat.py
Tony2h/Xhome_bjtu
4fb98cf71896d3441106a48213c61678a0271fc4
[ "Apache-2.0" ]
1
2018-09-28T07:13:08.000Z
2018-09-28T07:13:08.000Z
import os from rasa_addons.webchat import WebChatInput, SocketInputChannel from rasa_core.agent import Agent current_path = os.path.dirname(os.path.realpath(__file__)) agent = Agent.load("models/dialogue", "models/default/current") input_channel = WebChatInput(static_assets_path=os.path.join(current_path, 'static')) agent.handle_channel(SocketInputChannel(5002, "/", input_channel))
38.7
85
0.813953
51
387
5.921569
0.509804
0.059603
0.066225
0
0
0
0
0
0
0
0
0.011111
0.069767
387
9
86
43
0.827778
0
0
0
0
0
0.113695
0.056848
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
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
0
0
0
2
10b7e09dde28dead7e1b8f772fb59317db5b79d8
305
py
Python
textprivacy/__init__.py
KennethEnevoldsen/DaAnonymization
bf0056505c850bf468f537117a10c7ea66077781
[ "Apache-2.0" ]
12
2021-03-31T08:36:06.000Z
2022-02-08T09:38:03.000Z
textprivacy/__init__.py
KennethEnevoldsen/DaAnonymization
bf0056505c850bf468f537117a10c7ea66077781
[ "Apache-2.0" ]
null
null
null
textprivacy/__init__.py
KennethEnevoldsen/DaAnonymization
bf0056505c850bf468f537117a10c7ea66077781
[ "Apache-2.0" ]
3
2021-08-05T07:54:54.000Z
2021-11-25T09:39:45.000Z
"""Top-level package for TextAnonymization.""" __author__ = """Martin Closter Jespersen""" __email__ = "martincjespersen@gmail.com" __version__ = "0.1.0" from textprivacy import utils from textprivacy.textanonymization import TextAnonymizer from textprivacy.textpseudonymization import TextPseudonymizer
33.888889
62
0.819672
31
305
7.677419
0.741935
0.189076
0
0
0
0
0
0
0
0
0
0.01083
0.091803
305
8
63
38.125
0.848375
0.131148
0
0
0
0
0.212355
0.100386
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
10ba1796a8bd8d15084e4890fc71c60921ba0fc2
1,882
py
Python
craneui/crane/inspect.py
newrelic/shipyard
e4e990583a646b77e7e1767682e1ecf94c278fb8
[ "Apache-2.0" ]
3
2015-04-29T05:45:23.000Z
2017-02-04T13:57:36.000Z
craneui/crane/inspect.py
newrelic/shipyard
e4e990583a646b77e7e1767682e1ecf94c278fb8
[ "Apache-2.0" ]
null
null
null
craneui/crane/inspect.py
newrelic/shipyard
e4e990583a646b77e7e1767682e1ecf94c278fb8
[ "Apache-2.0" ]
1
2015-12-24T04:10:11.000Z
2015-12-24T04:10:11.000Z
import os from data import versions, extensions, HOST_DATABASE_FOLDER from base import crane_path def list_oses(): oses_raw = os.listdir(crane_path('templates/os/')) oses_raw.remove('os.tpl') oses = [] for os_ in oses_raw: if os_[0] != '.': oses.append((os_[:-4], os_[:-4])) return oses # FIXME : return simple lists? !list(tuple())? def list_interpreters(): interpreters_raw = os.listdir(crane_path('templates/interpreter/')) interpreters_raw.remove('interpreter.tpl') # Make python first in the list interpreters = [('python', 'python')] for interpreter in interpreters_raw: if interpreter != 'python': interpreters.append((interpreter, interpreter)) return interpreters def list_third_party_softwares(): third_party_raw = os.listdir(crane_path('templates/third_party')) third_party_raw.remove('third_party.tpl') third_party_softwares = [] for third_party in third_party_raw: if third_party.find('.') == -1: third_party_softwares.append((third_party, third_party)) return third_party_softwares def list_versions(interpreter): if interpreter not in versions: raise Exception("This interpreter is not currently supported.") interpreters_versions = [] for version in versions[interpreter]: interpreters_versions.append((version, version)) return interpreters_versions def interpreter_extension(interpreter): if interpreter not in extensions: raise Exception("This interpreter is not currently supported.") return extensions[interpreter] def list_existing_databases(software, application_name): databases_path = os.path.join(HOST_DATABASE_FOLDER, software, application_name) databases_raw = [] if os.path.exists(databases_path): databases_raw = os.listdir(databases_path) return databases_raw
34.851852
83
0.717853
229
1,882
5.655022
0.253275
0.100386
0.037066
0.039382
0.194595
0.149807
0.080309
0.080309
0
0
0
0.002594
0.180659
1,882
53
84
35.509434
0.837224
0.03932
0
0.045455
0
0
0.110803
0.023823
0
0
0
0.018868
0
0
null
null
0
0.068182
null
null
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
1
0
0
0
0
0
0
0
0
2
529acc72221f18fd5cdb6dcd7e78b6ec93af3673
189
py
Python
katas/beta/dinner_plans.py
the-zebulan/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
40
2016-03-09T12:26:20.000Z
2022-03-23T08:44:51.000Z
katas/beta/dinner_plans.py
akalynych/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
null
null
null
katas/beta/dinner_plans.py
akalynych/CodeWars
1eafd1247d60955a5dfb63e4882e8ce86019f43a
[ "MIT" ]
36
2016-11-07T19:59:58.000Z
2022-03-31T11:18:27.000Z
def common_ground(s1,s2): words = s2.split() return ' '.join(sorted((a for a in set(s1.split()) if a in words), key=lambda b: words.index(b))) or 'death'
37.8
70
0.544974
30
189
3.4
0.7
0.058824
0
0
0
0
0
0
0
0
0
0.030075
0.296296
189
4
71
47.25
0.736842
0
0
0
0
0
0.031746
0
0
0
0
0
0
1
0.25
false
0
0
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
52ba7d12dbd36a00286c0c67cb57dda7f28cddf3
647
py
Python
tests/test_config_middleware.py
cjwatson/pastedeploy
596ec6804b1ad649542da3d8d8fe0cabcf22123f
[ "MIT" ]
18
2018-11-22T05:45:57.000Z
2022-03-06T08:58:07.000Z
tests/test_config_middleware.py
cjwatson/pastedeploy
596ec6804b1ad649542da3d8d8fe0cabcf22123f
[ "MIT" ]
26
2018-11-22T18:38:07.000Z
2020-10-12T18:35:11.000Z
tests/test_config_middleware.py
cjwatson/pastedeploy
596ec6804b1ad649542da3d8d8fe0cabcf22123f
[ "MIT" ]
10
2018-11-22T19:52:32.000Z
2022-03-06T08:58:11.000Z
import pytest from paste.deploy.config import ConfigMiddleware class Bug(Exception): pass def app_with_exception(environ, start_response): def cont(): yield b"something" raise Bug start_response('200 OK', [('Content-type', 'text/html')]) return cont() def test_error(): # This import is conditional due to Paste not yet working on py3k try: from paste.fixture import TestApp except ImportError: raise pytest.skip('unable to import TestApp') wrapped = ConfigMiddleware(app_with_exception, {'test': 1}) test_app = TestApp(wrapped) pytest.raises(Bug, test_app.get, '/')
23.107143
69
0.680062
83
647
5.192771
0.626506
0.041763
0.074246
0
0
0
0
0
0
0
0
0.009901
0.219475
647
27
70
23.962963
0.843564
0.097372
0
0
0
0
0.111684
0
0
0
0
0
0
1
0.166667
false
0.055556
0.277778
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
0
0
1
0
0
1
0
0
2
52be32a9cb45b224f06b6a3928e05101fc16cf3f
519
py
Python
remi/command/core/prefix/__init__.py
Qu4n7r01d/remi
6ba6c9cbc5121e00d849ff385966ac7e72e1409f
[ "MIT" ]
1
2021-12-31T08:35:59.000Z
2021-12-31T08:35:59.000Z
remi/command/core/prefix/__init__.py
Qu4n7r01d/remi
6ba6c9cbc5121e00d849ff385966ac7e72e1409f
[ "MIT" ]
7
2021-12-19T17:49:58.000Z
2022-02-17T06:52:30.000Z
remi/command/core/prefix/__init__.py
Qu4n7r01d/remi
6ba6c9cbc5121e00d849ff385966ac7e72e1409f
[ "MIT" ]
null
null
null
import lightbulb from remi.core.constant import Client from remi.core.exceptions import ProtectedPlugin from .prefix import prefix_manager __plugin_name__ = prefix_manager.name __plugin_description__ = prefix_manager.description def load(bot: lightbulb.BotApp) -> None: bot.add_plugin(prefix_manager) def unload(bot: lightbulb.BotApp) -> None: if Client.DEV_MODE: bot.remove_plugin(prefix_manager) else: raise ProtectedPlugin(f"Cannot unload protected plugin {prefix_manager.name}!")
24.714286
87
0.776493
66
519
5.818182
0.454545
0.203125
0.148438
0.114583
0
0
0
0
0
0
0
0
0.146435
519
20
88
25.95
0.866817
0
0
0
0
0
0.102119
0.042389
0
0
0
0
0
1
0.153846
false
0
0.307692
0
0.461538
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
0
0
0
2
52c9971d37d126013add8c51fa3884308c24a3b6
5,210
py
Python
portsfallout/settings_dev.py
dbaio/portsfallout
2512036a9983b833f4ece2a0801541dca4d8d58c
[ "BSD-2-Clause" ]
6
2020-10-11T07:54:50.000Z
2022-01-25T22:03:18.000Z
portsfallout/settings_dev.py
dbaio/portsfallout
2512036a9983b833f4ece2a0801541dca4d8d58c
[ "BSD-2-Clause" ]
null
null
null
portsfallout/settings_dev.py
dbaio/portsfallout
2512036a9983b833f4ece2a0801541dca4d8d58c
[ "BSD-2-Clause" ]
null
null
null
# Copyright (c) 2020-2021 Danilo G. Baio <dbaio@bsd.com.br> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ Django settings for portsfallout project. Generated by 'django-admin startproject' using Django 3.0.8. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! # SECRET_KEY = '' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'rest_framework', 'debug_toolbar', 'bootstrap_pagination', 'ports', ] MIDDLEWARE = [ 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', ] ROOT_URLCONF = 'portsfallout.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ TEMPLATE_DIR, ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'portsfallout.wsgi.application' # Database # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Password validation # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.0/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] INTERNAL_IPS = [ '127.0.0.1', ] REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', 'PAGE_SIZE': 50 } CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', 'LOCATION': '/tmp/portsfallout_cache', 'TIMEOUT': 3600, 'OPTIONS': { 'MAX_ENTRIES': 10000 } } }
29.435028
91
0.714012
609
5,210
6.031199
0.43514
0.056629
0.041928
0.047645
0.192486
0.152192
0.10972
0.10972
0.069698
0.037027
0
0.012068
0.172937
5,210
176
92
29.602273
0.840334
0.441267
0
0.043011
0
0
0.550436
0.448866
0
0
0
0
0
1
0
false
0.053763
0.010753
0
0.010753
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
1
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
52fa9b2fade239b930813ebac6c7b0374cb9b0c5
2,249
py
Python
test_projects/Number/main.py
ynsnf/apysc
b10ffaf76ec6beb187477d0a744fca00e3efc3fb
[ "MIT" ]
16
2021-04-16T02:01:29.000Z
2022-01-01T08:53:49.000Z
test_projects/Number/main.py
ynsnf/apysc
b10ffaf76ec6beb187477d0a744fca00e3efc3fb
[ "MIT" ]
613
2021-03-24T03:37:38.000Z
2022-03-26T10:58:37.000Z
test_projects/Number/main.py
simon-ritchie/apyscript
c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279
[ "MIT" ]
2
2021-06-20T07:32:58.000Z
2021-12-26T08:22:11.000Z
"""Test project for `Number` class. Command examples: $ python test_projects/Number/main.py """ import sys sys.path.append('./') import os from types import ModuleType import apysc as ap from apysc._file import file_util this_module: ModuleType = sys.modules[__name__] _DEST_DIR_PATH: str = os.path.join( file_util.get_abs_module_dir_path(module=this_module), 'test_output/' ) def main() -> None: """Entry point of this test project. """ _: ap.Stage = ap.Stage(background_color='#333') number_1: ap.Number = ap.Number(value=10.5) ap.assert_equal(left=10.5, right=number_1) number_2: ap.Number = number_1 + 20.6 ap.assert_equal(left=31.1, right=number_2) number_3: ap.Number = number_1 + number_2 ap.assert_equal(left=41.6, right=number_3) number_4: ap.Number = ap.Number(value=30.5) - 10.2 ap.assert_equal(left=20.3, right=number_4) number_5: ap.Number = number_4 - number_1 ap.assert_equal(left=9.8, right=number_5) number_6: ap.Number = ap.Number(value=10) / 4 ap.assert_equal(left=2.5, right=number_6) number_7: ap.Number = number_6 / ap.Number(value=10) ap.assert_equal(left=0.25, right=number_7) int_1: ap.Int = ap.Number(10.5) // 3 ap.assert_equal(left=3, right=int_1) int_2: ap.Int = ap.Number(10.5) // ap.Number(3.1) ap.assert_equal(left=3, right=int_2) number_8: ap.Number = ap.Number(value=10.5) number_8 += 3.3 ap.assert_equal(left=13.8, right=number_8) number_9: ap.Number = ap.Number(value=10.5) number_9 -= 3.2 ap.assert_equal(left=7.3, right=number_9) number_10: ap.Number = ap.Number(value=10.5) number_10 *= 3 ap.assert_equal(left=31.5, right=number_10) number_11: ap.Number = ap.Number(value=10.6) number_11 /= 2 ap.assert_equal(left=5.3, right=number_11) number_12: ap.Number = ap.Number(value=10.5) number_13: ap.Number = number_12 % 3 ap.assert_equal(left=number_13, right=1.5) number_14: ap.Number = number_12 % ap.Int(3) ap.assert_equal(left=number_14, right=1.5) ap.save_overall_html(dest_dir_path=_DEST_DIR_PATH) if __name__ == '__main__': main()
26.77381
59
0.657181
381
2,249
3.635171
0.194226
0.150181
0.140794
0.184116
0.376173
0.232491
0.141516
0.086643
0
0
0
0.080067
0.205869
2,249
83
60
27.096386
0.695409
0.056914
0
0
0
0
0.012833
0
0
0
0
0
0.294118
1
0.019608
true
0
0.098039
0
0.117647
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
0
0
0
0
0
2
5e02edd0a2906304c7bae0e21692481c48e4676f
307
py
Python
1_wordcount/myproject/urls.py
LIkelion-at-KOREATECH/LikeLion_Django_Study_Summary
c788182af5bcfd16bdd4b57235a48659758e494b
[ "MIT" ]
28
2019-10-15T13:15:26.000Z
2021-11-08T08:23:45.000Z
1_wordcount/myproject/urls.py
jhleed/LikeLion_Django_Study_Summary
c788182af5bcfd16bdd4b57235a48659758e494b
[ "MIT" ]
null
null
null
1_wordcount/myproject/urls.py
jhleed/LikeLion_Django_Study_Summary
c788182af5bcfd16bdd4b57235a48659758e494b
[ "MIT" ]
17
2019-09-09T00:15:36.000Z
2021-01-28T13:08:51.000Z
from django.contrib import admin from django.urls import path import wordcount.views urlpatterns = [ path('admin/', admin.site.urls), path('', wordcount.views.home, name="home"), path('about/', wordcount.views.about, name='about'), path('result/', wordcount.views.result, name='result'), ]
27.909091
59
0.690554
39
307
5.435897
0.384615
0.264151
0
0
0
0
0
0
0
0
0
0
0.136808
307
10
60
30.7
0.8
0
0
0
0
0
0.110749
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
5e06f1fcc65be37abdab941ad46d2284712fe674
378
py
Python
spirl/data/block_stacking/src/robosuite/models/arenas/empty_arena.py
kouroshHakha/fist
328c098789239fd892e17edefd799fc1957ab637
[ "BSD-3-Clause" ]
8
2021-10-14T03:14:23.000Z
2022-03-15T21:31:17.000Z
spirl/data/block_stacking/src/robosuite/models/arenas/empty_arena.py
kouroshHakha/fist
328c098789239fd892e17edefd799fc1957ab637
[ "BSD-3-Clause" ]
null
null
null
spirl/data/block_stacking/src/robosuite/models/arenas/empty_arena.py
kouroshHakha/fist
328c098789239fd892e17edefd799fc1957ab637
[ "BSD-3-Clause" ]
1
2021-09-13T20:42:28.000Z
2021-09-13T20:42:28.000Z
from spirl.data.block_stacking.src.robosuite.models.arenas import Arena from spirl.data.block_stacking.src.robosuite.utils.mjcf_utils import xml_path_completion class EmptyArena(Arena): """Empty workspace.""" def __init__(self): super().__init__(xml_path_completion("arenas/empty_arena.xml")) self.floor = self.worldbody.find("./geom[@name='floor']")
34.363636
88
0.743386
50
378
5.3
0.58
0.067925
0.098113
0.135849
0.286792
0.286792
0.286792
0
0
0
0
0
0.119048
378
10
89
37.8
0.795796
0.042328
0
0
0
0
0.120787
0.120787
0
0
0
0
0
1
0.166667
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
0
0
0
1
0
1
0
0
2
5e1fc66f9bb95f58ec81b8175aa90c3a37a27e55
3,432
py
Python
data/kids/number_density/ngal_to_area.py
KiDS-WL/Cat_to_Obs_K1000_P1
0de7f79cab150416859ffe58ac2d0f5659aedb5d
[ "MIT" ]
7
2020-11-18T12:58:03.000Z
2021-07-01T08:54:29.000Z
data/kids/number_density/ngal_to_area.py
KiDS-WL/Cat_to_Obs_K1000_P1
0de7f79cab150416859ffe58ac2d0f5659aedb5d
[ "MIT" ]
null
null
null
data/kids/number_density/ngal_to_area.py
KiDS-WL/Cat_to_Obs_K1000_P1
0de7f79cab150416859ffe58ac2d0f5659aedb5d
[ "MIT" ]
3
2020-12-09T13:30:22.000Z
2022-03-02T01:40:13.000Z
import numpy as np # # blind A # # Z_Bbin sigma_e neff # # Flag_SOM_Fid # 0.1<ZB<=0.3 0.27085526185463465 0.6141903412434272 # 0.3<ZB<=0.5 0.260789170603278 1.1714443526924525 # 0.5<ZB<=0.7 0.27664489739710685 1.8306617593091257 # 0.7<ZB<=0.9 0.2616226704859973 1.2340324684694277 # 0.9<ZB<=1.2 0.2818628832701304 1.2777696421274052 # # blind B # # Z_Bbin sigma_e neff # # Flag_SOM_Fid # 0.1<ZB<=0.3 0.26842505878253875 0.6187082608962824 # 0.3<ZB<=0.5 0.25501768080905934 1.1942152882679087 # 0.5<ZB<=0.7 0.2684949317660632 1.8820489105766731 # 0.7<ZB<=0.9 0.24635057301164487 1.2898847904777375 # 0.9<ZB<=1.2 0.2588042476903187 1.3531528640732855 # # blind C # # Z_Bbin sigma_e neff # # Flag_SOM_Fid # 0.1<ZB<=0.3 0.2696215956290229 0.6163756250182619 # 0.3<ZB<=0.5 0.25788498381059144 1.1821211132939125 # 0.5<ZB<=0.7 0.2725868234515691 1.8541025952232577 # 0.7<ZB<=0.9 0.25393725942022516 1.259196379102648 # 0.9<ZB<=1.2 0.2702738432562588 1.3108755093653546 ngal_A_in=np.asarray([0.6141903412434272, 1.1714443526924525, 1.8306617593091257, 1.2340324684694277, 1.2777696421274052]) ngal_B_in=np.asarray([0.6187082608962824, 1.1942152882679087, 1.8820489105766731, 1.2898847904777375, 1.3531528640732855]) ngal_C_in=np.asarray([0.6163756250182619, 1.1821211132939125, 1.8541025952232577, 1.259196379102648, 1.3108755093653546]) area_omegacam = 777.406 area_healpix4096 = 866.924 ngal_A = ngal_A_in*area_omegacam/area_healpix4096 ngal_B = ngal_B_in*area_omegacam/area_healpix4096 ngal_C = ngal_C_in*area_omegacam/area_healpix4096 np.savetxt('ngal_blindA.ascii',ngal_A.reshape(1,len(ngal_A)),fmt='%1.8f') np.savetxt('ngal_blindB.ascii',ngal_B.reshape(1,len(ngal_B)),fmt='%1.8f') np.savetxt('ngal_blindC.ascii',ngal_C.reshape(1,len(ngal_C)),fmt='%1.8f') sigma_e_A=np.asarray([0.27085526185463465, 0.260789170603278, 0.27664489739710685, 0.2616226704859973, 0.2818628832701304]) sigma_e_B=np.asarray([0.26842505878253875, 0.25501768080905934, 0.2684949317660632, 0.24635057301164487, 0.2588042476903187]) sigma_e_C=np.asarray([0.2696215956290229, 0.25788498381059144, 0.2725868234515691, 0.25393725942022516, 0.2702738432562588]) np.savetxt('../ellipticity_dispersion/sigma_e_blindA.ascii',sigma_e_A.reshape(1,len(sigma_e_A)),fmt='%1.8f') np.savetxt('../ellipticity_dispersion/sigma_e_blindB.ascii',sigma_e_B.reshape(1,len(sigma_e_B)),fmt='%1.8f') np.savetxt('../ellipticity_dispersion/sigma_e_blindC.ascii',sigma_e_C.reshape(1,len(sigma_e_C)),fmt='%1.8f') # old values with wrong zbin edges # ngal_A_in=np.asarray([0.5696062756935643, 1.1420051774183186, 1.820071990524645, 1.257355966105446, 1.3150376529887304]) # ngal_B_in=np.asarray([0.5738808446605536, 1.1635165129209137, 1.870408698085444, 1.312215197103098, 1.3923624557726593]) # ngal_C_in=np.asarray([0.5716711629725594, 1.1520993491907465, 1.843051137595057, 1.282128974674171, 1.3490061651057792]) # old values with wrong zbin edges: # sigma_e_a=[ 0.271501816130848, 0.2615574190604257, 0.2754555314207977, 0.2625519982871117, 0.2812947994992024] # sigma_e_b=[ 0.269029592008083, 0.2559736564818429, 0.2674527764112131, 0.2480196700309332, 0.2583321479620859] # sigma_e_c=[ 0.270247406769942, 0.2587478515919105, 0.2714697072625222, 0.2552422429840755, 0.2697528938767397]
34.666667
122
0.75
495
3,432
5.032323
0.224242
0.043356
0.03613
0.028904
0.258531
0.226415
0.07226
0.07226
0.07226
0.038539
0
0.540086
0.116841
3,432
98
123
35.020408
0.281755
0.480478
0
0
0
0
0.126079
0.079447
0
0
0
0
0
1
0
false
0
0.02381
0
0.02381
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
eaab5f38c8c17da18b0c06ab17ce192aa22c9da5
88,678
py
Python
pysnmp/HUAWEI-PWE3-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/HUAWEI-PWE3-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/HUAWEI-PWE3-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module HUAWEI-PWE3-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-PWE3-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:34:00 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection") hwDatacomm, = mibBuilder.importSymbols("HUAWEI-MIB", "hwDatacomm") HWL2VpnVcEncapsType, HWEnableValue, HWL2VpnStateChangeReason = mibBuilder.importSymbols("HUAWEI-VPLS-EXT-MIB", "HWL2VpnVcEncapsType", "HWEnableValue", "HWL2VpnStateChangeReason") ifName, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "ifName", "InterfaceIndexOrZero") InetAddressType, = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType") EnabledStatus, = mibBuilder.importSymbols("P-BRIDGE-MIB", "EnabledStatus") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") sysUpTime, = mibBuilder.importSymbols("SNMPv2-MIB", "sysUpTime") Counter32, Counter64, IpAddress, iso, ModuleIdentity, NotificationType, Gauge32, Integer32, ObjectIdentity, MibIdentifier, Unsigned32, Bits, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "IpAddress", "iso", "ModuleIdentity", "NotificationType", "Gauge32", "Integer32", "ObjectIdentity", "MibIdentifier", "Unsigned32", "Bits", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, RowStatus, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "DisplayString", "TruthValue") hwL2VpnPwe3 = ModuleIdentity((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4)) if mibBuilder.loadTexts: hwL2VpnPwe3.setLastUpdated('200704120900Z') if mibBuilder.loadTexts: hwL2VpnPwe3.setOrganization('Huawei Technologies Co., Ltd.') class HWLdpPwStateChangeReason(TextualConvention, Integer32): status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6)) namedValues = NamedValues(("ldpSessionDown", 1), ("interfaceDown", 2), ("tunnelDown", 3), ("receivedNoMapping", 4), ("paraUnMatched", 5), ("notifiNotForward", 6)) hwL2Vpn = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119)) hwPwe3MIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1)) hwPwe3Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1)) hwPWVcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1), ) if mibBuilder.loadTexts: hwPWVcTable.setStatus('current') hwPWVcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType")) if mibBuilder.loadTexts: hwPWVcEntry.setStatus('current') hwPWVcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: hwPWVcID.setStatus('current') hwPWVcType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 2), HWL2VpnVcEncapsType()) if mibBuilder.loadTexts: hwPWVcType.setStatus('current') hwPWVcPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 3), InetAddressType().clone('ipv4')).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPeerAddrType.setStatus('current') hwPWVcPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPeerAddr.setStatus('current') hwPWVcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3), ("backup", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcStatus.setStatus('current') hwPWVcInboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcInboundLabel.setStatus('current') hwPWVcOutboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 7), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcOutboundLabel.setStatus('current') hwPWVcSwitchSign = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("staticTostatic", 1), ("ldpTostatic", 2), ("ldpToldp", 3), ("upe", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcSwitchSign.setStatus('current') hwPWVcSwitchID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 9), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchID.setStatus('current') hwPWVcSwitchPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 10), InetAddressType().clone('ipv4')).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchPeerAddrType.setStatus('current') hwPWVcSwitchPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 11), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchPeerAddr.setStatus('current') hwPWVcSwitchInboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 12), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchInboundLabel.setStatus('current') hwPWVcSwitchOutboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 13), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchOutboundLabel.setStatus('current') hwPWVcGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 14), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcGroupID.setStatus('current') hwPWVcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 15), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcIfIndex.setStatus('current') hwPWVcAcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3), ("notify", 4), ("notifyDown", 5), ("downNotify", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcAcStatus.setStatus('current') hwPWVcACOAMStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcACOAMStatus.setStatus('current') hwPWVcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(46, 9600), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcMtu.setStatus('current') hwPWVcCtrlWord = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 19), HWEnableValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcCtrlWord.setStatus('current') hwPWVcVCCV = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 20), Bits().clone(namedValues=NamedValues(("ccCw", 0), ("ccAlert", 1), ("ccLabel", 2), ("cvIcmpping", 3), ("cvLspping", 4), ("cvBfd", 5), ("ccTtl", 6)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcVCCV.setStatus('current') hwPWVcBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 21), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 32000000))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcBandWidth.setStatus('current') hwPWVcMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 22), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 28))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcMaxAtmCells.setStatus('current') hwPWVcTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 23), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcTnlPolicyName.setStatus('current') hwPWVcQoSBehaviorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 24), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcQoSBehaviorIndex.setStatus('current') hwPWVcExplicitPathName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 25), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcExplicitPathName.setStatus('current') hwPWVcTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 26), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcTemplateName.setStatus('current') hwPWVcSecondary = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 27), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSecondary.setStatus('current') hwPWVcUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 28), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcUpTime.setStatus('current') hwPWOAMSync = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 29), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWOAMSync.setStatus('current') hwPWVCForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 30), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVCForBfdIndex.setStatus('current') hwPWVcDelayTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 31), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcDelayTime.setStatus('current') hwPWVcReroutePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("delay", 1), ("immediately", 2), ("never", 3), ("none", 4), ("err", 5), ("invalid", 6), ("immediatelySwitch", 7)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcReroutePolicy.setStatus('current') hwPWVcResumeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 33), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcResumeTime.setStatus('current') hwPWVcRerouteReason = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 34), HWL2VpnStateChangeReason()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcRerouteReason.setStatus('current') hwPWVcLastRerouteTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 35), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcLastRerouteTime.setStatus('current') hwPWVcManualSetFault = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 36), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcManualSetFault.setStatus('current') hwPWVcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 37), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcActive.setStatus('current') hwPWVcVrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 38), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcVrIfIndex.setStatus('current') hwPWVcVrID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 39), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcVrID.setStatus('current') hwPWBFDDetectMultiplier = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 40), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 50), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWBFDDetectMultiplier.setStatus('current') hwPWBFDMinReceiveInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 41), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWBFDMinReceiveInterval.setStatus('current') hwPWBFDMinTransmitInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 42), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWBFDMinTransmitInterval.setStatus('current') hwPWDynamicBFDDetect = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 43), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWDynamicBFDDetect.setStatus('current') hwPWBFDRemoteVcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 44), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWBFDRemoteVcID.setStatus('current') hwPWEthOamType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 45), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ethOam1ag", 1), ("ethOam3ah", 2), ("noEthOamCfg", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWEthOamType.setStatus('current') hwPWCfmMaIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 46), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 4095), ValueRangeConstraint(4294967295, 4294967295), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWCfmMaIndex.setStatus('current') hwPWVcUpStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 47), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcUpStartTime.setStatus('current') hwPWVcUpSumTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 48), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcUpSumTime.setStatus('current') hwPWVcIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 49), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcIfName.setStatus('current') hwPWVcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 51), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcRowStatus.setStatus('current') hwPWVcAtmPackOvertime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 52), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(100, 50000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcAtmPackOvertime.setStatus('current') hwPWVcPwJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 53), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPwJitterBufferDepth.setStatus('current') hwPWVcPwTdmEncapsulationNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 54), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPwTdmEncapsulationNum.setStatus('current') hwPWVcPwIdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 55), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 255), ValueRangeConstraint(65535, 65535), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPwIdleCode.setStatus('current') hwPWVcPwRtpHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 56), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPwRtpHeader.setStatus('current') hwPWVcSwitchTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 57), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchTnlPolicyName.setStatus('current') hwPWVcCfmMdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 58), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 4095), ValueRangeConstraint(4294967295, 4294967295), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcCfmMdIndex.setStatus('current') hwPWVcCfmMaName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 59), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 43))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcCfmMaName.setStatus('current') hwPWVcCfmMdName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 60), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 43))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcCfmMdName.setStatus('current') hwPWVcRawOrTagged = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 61), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("raw", 1), ("tagged", 2), ("rawTagNotConfiged", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcRawOrTagged.setStatus('current') hwPWVcInterworkingType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 62), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ipInterWorking", 1), ("ipLayer2", 2), ("ipUnknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcInterworkingType.setStatus('current') hwPWVcCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 63), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcCir.setStatus('current') hwPWVcPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 64), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcPir.setStatus('current') hwPWVcQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 65), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcQosProfile.setStatus('current') hwPWVcSwitchCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 66), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchCir.setStatus('current') hwPWVcSwitchPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 67), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchPir.setStatus('current') hwPWVcSwitchQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 68), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchQosProfile.setStatus('current') hwPWVcTrigger = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 69), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcTrigger.setStatus('current') hwPWVcEnableACOAM = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 70), EnabledStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcEnableACOAM.setStatus('current') hwPWVcSwitchVrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 71), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchVrIfIndex.setStatus('current') hwPWVcSwitchVrID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 72), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWVcSwitchVrID.setStatus('current') hwPWVcQosParaFromPWT = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 73), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cliOrMib", 1), ("pwTemplate", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcQosParaFromPWT.setStatus('current') hwPWVcBfdParaFromPWT = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 74), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cliOrMib", 1), ("pwTemplate", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcBfdParaFromPWT.setStatus('current') hwPwVcNegotiateMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 75), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("slaveOrMaster", 1), ("independent", 2), ("unknown", 3), ("frr", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcNegotiateMode.setStatus('current') hwPwVcIsBypass = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 76), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcIsBypass.setStatus('current') hwPwVcIsAdmin = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 77), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcIsAdmin.setStatus('current') hwPwVcAdminPwIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 78), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcAdminPwIfIndex.setStatus('current') hwPwVcAdminPwLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 79), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcAdminPwLinkStatus.setStatus('current') hwPwVcSwitchAdminPwIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 80), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchAdminPwIfIndex.setStatus('current') hwPwVcSwitchAdminPwLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 81), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchAdminPwLinkStatus.setStatus('current') hwPwVcSwitchBackupAdminPwIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 82), InterfaceIndexOrZero()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupAdminPwIfIndex.setStatus('current') hwPwVcSwitchBackupAdminPwLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 83), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchBackupAdminPwLinkStatus.setStatus('current') hwPwVcSwitchBackupVcId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 84), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcId.setStatus('current') hwPwVcSwitchBackupVcPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 85), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcPeerAddrType.setStatus('current') hwPwVcSwitchBackupVcPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 86), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcPeerAddr.setStatus('current') hwPwVcSwitchBackupVcReceiveLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 87), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcReceiveLabel.setStatus('current') hwPwVcSwitchBackupVcSendLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 88), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcSendLabel.setStatus('current') hwPwVcSwitchBackupVcTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 89), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcTnlPolicyName.setStatus('current') hwPwVcSwitchBackupVcCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 90), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcCir.setStatus('current') hwPwVcSwitchBackupVcPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 91), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcPir.setStatus('current') hwPwVcSwitchBackupVcQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 92), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcQosProfile.setStatus('current') hwPwVcSlaveMasterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 93), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("unknown", 3), ("bypass", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSlaveMasterMode.setStatus('current') hwPwVcSwitchVcSlaveMasterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 94), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchVcSlaveMasterMode.setStatus('current') hwPwVcSwitchBackupVcSlaveMasterMode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 95), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("slave", 1), ("master", 2), ("unknown", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcSlaveMasterMode.setStatus('current') hwPwVcSwitchVcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 96), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchVcActive.setStatus('current') hwPwVcSwitchBackupVcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 97), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcActive.setStatus('current') hwPwVcSwitchCwTrans = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 98), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchCwTrans.setStatus('current') hwPwVcSwitchVcServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 99), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 100))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchVcServiceName.setStatus('current') hwPwVcSwitchBackupVcServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 1, 1, 100), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 100))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPwVcSwitchBackupVcServiceName.setStatus('current') hwPWVcTnlTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2), ) if mibBuilder.loadTexts: hwPWVcTnlTable.setStatus('current') hwPWVcTnlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType"), (0, "HUAWEI-PWE3-MIB", "hwPWVcTnlIndex")) if mibBuilder.loadTexts: hwPWVcTnlEntry.setStatus('current') hwPWVcTnlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1, 1), Unsigned32()) if mibBuilder.loadTexts: hwPWVcTnlIndex.setStatus('current') hwPWVcTnlType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("lsp", 1), ("gre", 2), ("ipsec", 3), ("crLsp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTnlType.setStatus('current') hwPWTnlForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWTnlForBfdIndex.setStatus('current') hwPWVcStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3), ) if mibBuilder.loadTexts: hwPWVcStatisticsTable.setStatus('current') hwPWVcStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType")) if mibBuilder.loadTexts: hwPWVcStatisticsEntry.setStatus('current') hwPWVcStatisticsRcvPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcStatisticsRcvPkts.setStatus('current') hwPWVcStatisticsRcvBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcStatisticsRcvBytes.setStatus('current') hwPWVcStatisticsSndPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcStatisticsSndPkts.setStatus('current') hwPWVcStatisticsSndBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 3, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcStatisticsSndBytes.setStatus('current') hwPWRemoteVcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4), ) if mibBuilder.loadTexts: hwPWRemoteVcTable.setStatus('current') hwPWRemoteVcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType")) if mibBuilder.loadTexts: hwPWRemoteVcEntry.setStatus('current') hwPWRemoteVcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcID.setStatus('current') hwPWRemoteVcType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 2), HWL2VpnVcEncapsType()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcType.setStatus('current') hwPWRemoteVcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcStatus.setStatus('current') hwPWRemoteVcGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcGroupID.setStatus('current') hwPWRemoteVcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 5), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(46, 9600), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcMtu.setStatus('current') hwPWRemoteVcCtrlword = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 6), HWEnableValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcCtrlword.setStatus('current') hwPWRemoteVcMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcMaxAtmCells.setStatus('current') hwPWRemoteVcNotif = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 4, 1, 8), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWRemoteVcNotif.setStatus('current') hwPWVcSwitchNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 5), HWEnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwPWVcSwitchNotifEnable.setStatus('current') hwPWVcUpDownNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 6), HWEnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwPWVcUpDownNotifEnable.setStatus('current') hwPWVcDeletedNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 7), HWEnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwPWVcDeletedNotifEnable.setStatus('current') hwPWVcStateChangeReason = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 8), HWL2VpnStateChangeReason()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwPWVcStateChangeReason.setStatus('current') hwPWVcSwitchRmtID = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 9), Unsigned32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwPWVcSwitchRmtID.setStatus('current') hwLdpPWStateChangeReason = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 10), HWLdpPwStateChangeReason()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwLdpPWStateChangeReason.setStatus('current') hwPWVcTDMPerfCurrentTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11), ) if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentTable.setStatus('current') hwPWVcTDMPerfCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWVcID"), (0, "HUAWEI-PWE3-MIB", "hwPWVcType")) if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentEntry.setStatus('current') hwPWVcTDMPerfCurrentMissingPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentMissingPkts.setStatus('current') hwPWVcTDMPerfCurrentJtrBfrOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentJtrBfrOverruns.setStatus('current') hwPWVcTDMPerfCurrentJtrBfrUnderruns = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentJtrBfrUnderruns.setStatus('current') hwPWVcTDMPerfCurrentMisOrderDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 4), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentMisOrderDropped.setStatus('current') hwPWVcTDMPerfCurrentMalformedPkt = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentMalformedPkt.setStatus('current') hwPWVcTDMPerfCurrentESs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentESs.setStatus('current') hwPWVcTDMPerfCurrentSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentSESs.setStatus('current') hwPWVcTDMPerfCurrentUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 1, 11, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWVcTDMPerfCurrentUASs.setStatus('current') hwPwe3MIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2)) hwPWVcSwitchWtoP = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchRmtID"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName")) if mibBuilder.loadTexts: hwPWVcSwitchWtoP.setStatus('current') hwPWVcSwitchPtoW = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchRmtID"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName")) if mibBuilder.loadTexts: hwPWVcSwitchPtoW.setStatus('current') hwPWVcDown = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("SNMPv2-MIB", "sysUpTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlPolicyName")) if mibBuilder.loadTexts: hwPWVcDown.setStatus('current') hwPWVcUp = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("SNMPv2-MIB", "sysUpTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlPolicyName")) if mibBuilder.loadTexts: hwPWVcUp.setStatus('current') hwPWVcDeleted = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID")) if mibBuilder.loadTexts: hwPWVcDeleted.setStatus('current') hwPWVcBackup = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 6)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("SNMPv2-MIB", "sysUpTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID")) if mibBuilder.loadTexts: hwPWVcBackup.setStatus('current') hwLdpPWVcDown = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 7)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwLdpPWStateChangeReason")) if mibBuilder.loadTexts: hwLdpPWVcDown.setStatus('current') hwLdpPWVcUp = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 2, 8)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwLdpPWStateChangeReason")) if mibBuilder.loadTexts: hwLdpPWVcUp.setStatus('current') hwSvcObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3)) hwSvcTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1), ) if mibBuilder.loadTexts: hwSvcTable.setStatus('current') hwSvcEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwSvcIfIndex")) if mibBuilder.loadTexts: hwSvcEntry.setStatus('current') hwSvcIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 1), InterfaceIndexOrZero()) if mibBuilder.loadTexts: hwSvcIfIndex.setStatus('current') hwSvcID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 2), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcID.setStatus('current') hwSvcType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 3), HWL2VpnVcEncapsType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcType.setStatus('current') hwSvcPeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 4), InetAddressType().clone('ipv4')).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPeerAddrType.setStatus('current') hwSvcPeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPeerAddr.setStatus('current') hwSvcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcStatus.setStatus('current') hwSvcInboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 7), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcInboundLabel.setStatus('current') hwSvcOutboundLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 8), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcOutboundLabel.setStatus('current') hwSvcGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 9), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcGroupID.setStatus('current') hwSvcAcStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("plugout", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcAcStatus.setStatus('current') hwSvcACOAMStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcACOAMStatus.setStatus('current') hwSvcMtu = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(46, 9600), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcMtu.setStatus('current') hwSvcCtrlWord = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 13), HWEnableValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcCtrlWord.setStatus('current') hwSvcVCCV = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 14), Bits().clone(namedValues=NamedValues(("ccCw", 0), ("ccAlert", 1), ("ccLabel", 2), ("cvIcmpping", 3), ("cvLspping", 4), ("cvBfd", 5)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcVCCV.setStatus('current') hwSvcBandWidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 32000000))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcBandWidth.setStatus('current') hwSvcMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 16), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 28))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcMaxAtmCells.setStatus('current') hwSvcTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcTnlPolicyName.setStatus('current') hwSvcQoSBehaviorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 18), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcQoSBehaviorIndex.setStatus('current') hwSvcPWTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 19), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPWTemplateName.setStatus('current') hwSvcUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 20), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcUpTime.setStatus('current') hwSvcOAMSync = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 21), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcOAMSync.setStatus('current') hwSvcForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 22), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcForBfdIndex.setStatus('current') hwSvcSecondary = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 23), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcSecondary.setStatus('current') hwSvcDelayTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 24), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcDelayTime.setStatus('current') hwSvcReroutePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("delay", 1), ("immediately", 2), ("never", 3), ("none", 4), ("err", 5), ("invalid", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcReroutePolicy.setStatus('current') hwSvcResumeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 26), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcResumeTime.setStatus('current') hwSvcRerouteReason = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 27), HWL2VpnStateChangeReason()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcRerouteReason.setStatus('current') hwSvcLastRerouteTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 28), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcLastRerouteTime.setStatus('current') hwSvcManualSetFault = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 29), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcManualSetFault.setStatus('current') hwSvcActive = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 30), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcActive.setStatus('current') hwSvcUpStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 31), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcUpStartTime.setStatus('current') hwSvcUpSumTime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 32), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcUpSumTime.setStatus('current') hwSvcAtmPackOvertime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 33), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(100, 50000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcAtmPackOvertime.setStatus('current') hwSvcPwJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 34), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPwJitterBufferDepth.setStatus('current') hwSvcPwTdmEncapsulationNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 35), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPwTdmEncapsulationNum.setStatus('current') hwSvcPwIdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 36), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 255), ValueRangeConstraint(65535, 65535), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPwIdleCode.setStatus('current') hwSvcPwRtpHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 37), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPwRtpHeader.setStatus('current') hwSvcRawOrTagged = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("raw", 1), ("tagged", 2), ("rawTagNotConfiged", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcRawOrTagged.setStatus('current') hwSvcInterworkingType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("ipInterWorking", 1), ("ipLayer2", 2), ("ipUnknown", 3)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcInterworkingType.setStatus('current') hwSvcCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 40), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcCir.setStatus('current') hwSvcPir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 41), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcPir.setStatus('current') hwSvcQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 42), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcQosProfile.setStatus('current') hwSvcRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 1, 1, 51), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwSvcRowStatus.setStatus('current') hwSvcTnlTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2), ) if mibBuilder.loadTexts: hwSvcTnlTable.setStatus('current') hwSvcTnlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwSvcIfIndex"), (0, "HUAWEI-PWE3-MIB", "hwSvcTnlIndex")) if mibBuilder.loadTexts: hwSvcTnlEntry.setStatus('current') hwSvcTnlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1, 1), Unsigned32()) if mibBuilder.loadTexts: hwSvcTnlIndex.setStatus('current') hwSvcTnlType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("lsp", 1), ("gre", 2), ("ipsec", 3), ("crLsp", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcTnlType.setStatus('current') hwSvcTnlForBfdIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 2, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcTnlForBfdIndex.setStatus('current') hwSvcStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3), ) if mibBuilder.loadTexts: hwSvcStatisticsTable.setStatus('current') hwSvcStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwSvcIfIndex")) if mibBuilder.loadTexts: hwSvcStatisticsEntry.setStatus('current') hwSvcStatisticsRcvPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 1), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcStatisticsRcvPkts.setStatus('current') hwSvcStatisticsRcvBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 2), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcStatisticsRcvBytes.setStatus('current') hwSvcStatisticsSndPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 3), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcStatisticsSndPkts.setStatus('current') hwSvcStatisticsSndBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 3, 1, 4), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwSvcStatisticsSndBytes.setStatus('current') hwSvcSwitchNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 4), HWEnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwSvcSwitchNotifEnable.setStatus('current') hwSvcUpDownNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 5), HWEnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwSvcUpDownNotifEnable.setStatus('current') hwSvcDeletedNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 6), HWEnableValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hwSvcDeletedNotifEnable.setStatus('current') hwSvcStateChangeReason = MibScalar((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 3, 7), HWL2VpnStateChangeReason()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: hwSvcStateChangeReason.setStatus('current') hwL2vpnSvcMIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4)) hwSvcSwitchWtoP = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName")) if mibBuilder.loadTexts: hwSvcSwitchWtoP.setStatus('current') hwSvcSwitchPtoW = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName")) if mibBuilder.loadTexts: hwSvcSwitchPtoW.setStatus('current') hwSvcDown = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName"), ("HUAWEI-PWE3-MIB", "hwSvcTnlPolicyName")) if mibBuilder.loadTexts: hwSvcDown.setStatus('current') hwSvcUp = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason"), ("IF-MIB", "ifName"), ("HUAWEI-PWE3-MIB", "hwSvcTnlPolicyName")) if mibBuilder.loadTexts: hwSvcUp.setStatus('current') hwSvcDeleted = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 4, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel")) if mibBuilder.loadTexts: hwSvcDeleted.setStatus('current') hwPWTemplateTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5), ) if mibBuilder.loadTexts: hwPWTemplateTable.setStatus('current') hwPWTemplateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWTemplateName")) if mibBuilder.loadTexts: hwPWTemplateEntry.setStatus('current') hwPWTemplateName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 19))) if mibBuilder.loadTexts: hwPWTemplateName.setStatus('current') hwPWTemplatePeerAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 2), InetAddressType().clone('ipv4')).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePeerAddrType.setStatus('current') hwPWTemplatePeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 3), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePeerAddr.setStatus('current') hwPWTemplateCtrlword = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 4), HWEnableValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateCtrlword.setStatus('current') hwPWTemplateVCCV = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 5), Bits().clone(namedValues=NamedValues(("ccCw", 0), ("ccAlert", 1), ("ccLabel", 2), ("cvIcmpping", 3), ("cvLspping", 4), ("cvBfd", 5), ("ccTtl", 6)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateVCCV.setStatus('current') hwPWTemplateFrag = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 6), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateFrag.setStatus('current') hwPWTemplateBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 32000000))).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWTemplateBandwidth.setStatus('current') hwPWTemplateTnlPolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 39))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateTnlPolicyName.setStatus('current') hwPWTemplateQoSBehaviorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 9), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateQoSBehaviorIndex.setStatus('current') hwPWTemplateExplicitPathName = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateExplicitPathName.setStatus('current') hwPWTemplateBFDDetectMultiplier = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 11), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 50), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateBFDDetectMultiplier.setStatus('current') hwPWTemplateBFDMinReceiveInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 12), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateBFDMinReceiveInterval.setStatus('current') hwPWTemplateBFDMinTransmitInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 13), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(3, 1000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateBFDMinTransmitInterval.setStatus('current') hwPWTemplateDynamicBFDDetect = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 14), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateDynamicBFDDetect.setStatus('current') hwPWTemplateMaxAtmCells = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 28))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateMaxAtmCells.setStatus('current') hwPWTemplateAtmPackOvertime = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 16), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(100, 50000), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateAtmPackOvertime.setStatus('current') hwPWTemplatePwJitterBufferDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePwJitterBufferDepth.setStatus('current') hwPWTemplatePwTdmEncapsulationNum = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 18), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePwTdmEncapsulationNum.setStatus('current') hwPWTemplatePwIdleCode = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 19), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 255), ValueRangeConstraint(65535, 65535), ))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePwIdleCode.setStatus('current') hwPWTemplatePwRtpHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 20), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePwRtpHeader.setStatus('current') hwPWTemplatePwCCSeqEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 21), HWEnableValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePwCCSeqEnable.setStatus('current') hwPWTemplateCir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 22), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateCir.setStatus('current') hwPWTemplatePir = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 23), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplatePir.setStatus('current') hwPWTemplateQosProfile = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 24), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 31))).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateQosProfile.setStatus('current') hwPWTemplateFlowLabel = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 25), EnabledStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateFlowLabel.setStatus('current') hwPWTemplateRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 5, 1, 51), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: hwPWTemplateRowStatus.setStatus('current') hwPWTemplateMIBTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 6)) hwPWTemplateCannotDeleted = NotificationType((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 6, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWTemplateName")) if mibBuilder.loadTexts: hwPWTemplateCannotDeleted.setStatus('current') hwPWTableObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7)) hwPWTable = MibTable((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1), ) if mibBuilder.loadTexts: hwPWTable.setStatus('current') hwPWEntry = MibTableRow((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1), ).setIndexNames((0, "HUAWEI-PWE3-MIB", "hwPWId"), (0, "HUAWEI-PWE3-MIB", "hwPWType"), (0, "HUAWEI-PWE3-MIB", "hwPWPeerIp")) if mibBuilder.loadTexts: hwPWEntry.setStatus('current') hwPWId = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: hwPWId.setStatus('current') hwPWType = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 2), HWL2VpnVcEncapsType()) if mibBuilder.loadTexts: hwPWType.setStatus('current') hwPWPeerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 3), IpAddress()) if mibBuilder.loadTexts: hwPWPeerIp.setStatus('current') hwPWInterfaceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 1, 7, 1, 1, 4), InterfaceIndexOrZero()).setMaxAccess("readonly") if mibBuilder.loadTexts: hwPWInterfaceIndex.setStatus('current') hwPwe3MIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3)) hwPwe3MIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 1)) hwPwe3MIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 1, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsGroup"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcGroup"), ("HUAWEI-PWE3-MIB", "hwPWTemplateGroup"), ("HUAWEI-PWE3-MIB", "hwPWNotificationControlGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReasonGroup"), ("HUAWEI-PWE3-MIB", "hwPWVcNotificationGroup"), ("HUAWEI-PWE3-MIB", "hwPWTableGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPwe3MIBCompliance = hwPwe3MIBCompliance.setStatus('current') hwPwe3MIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2)) hwPWVcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPWVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchSign"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchID"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchInboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwPWVcGroupID"), ("HUAWEI-PWE3-MIB", "hwPWVcIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcAcStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcACOAMStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcMtu"), ("HUAWEI-PWE3-MIB", "hwPWVcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwPWVcVCCV"), ("HUAWEI-PWE3-MIB", "hwPWVcBandWidth"), ("HUAWEI-PWE3-MIB", "hwPWVcMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwPWVcTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPWVcQoSBehaviorIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcExplicitPathName"), ("HUAWEI-PWE3-MIB", "hwPWVcTemplateName"), ("HUAWEI-PWE3-MIB", "hwPWVcSecondary"), ("HUAWEI-PWE3-MIB", "hwPWVcUpTime"), ("HUAWEI-PWE3-MIB", "hwPWOAMSync"), ("HUAWEI-PWE3-MIB", "hwPWVCForBfdIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcDelayTime"), ("HUAWEI-PWE3-MIB", "hwPWVcReroutePolicy"), ("HUAWEI-PWE3-MIB", "hwPWVcResumeTime"), ("HUAWEI-PWE3-MIB", "hwPWVcRerouteReason"), ("HUAWEI-PWE3-MIB", "hwPWVcLastRerouteTime"), ("HUAWEI-PWE3-MIB", "hwPWVcManualSetFault"), ("HUAWEI-PWE3-MIB", "hwPWVcActive"), ("HUAWEI-PWE3-MIB", "hwPWVcVrIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcVrID"), ("HUAWEI-PWE3-MIB", "hwPWBFDDetectMultiplier"), ("HUAWEI-PWE3-MIB", "hwPWBFDMinReceiveInterval"), ("HUAWEI-PWE3-MIB", "hwPWBFDMinTransmitInterval"), ("HUAWEI-PWE3-MIB", "hwPWDynamicBFDDetect"), ("HUAWEI-PWE3-MIB", "hwPWBFDRemoteVcID"), ("HUAWEI-PWE3-MIB", "hwPWEthOamType"), ("HUAWEI-PWE3-MIB", "hwPWCfmMaIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcUpStartTime"), ("HUAWEI-PWE3-MIB", "hwPWVcUpSumTime"), ("HUAWEI-PWE3-MIB", "hwPWVcIfName"), ("HUAWEI-PWE3-MIB", "hwPWVcRowStatus"), ("HUAWEI-PWE3-MIB", "hwPWVcAtmPackOvertime"), ("HUAWEI-PWE3-MIB", "hwPWVcPwJitterBufferDepth"), ("HUAWEI-PWE3-MIB", "hwPWVcPwTdmEncapsulationNum"), ("HUAWEI-PWE3-MIB", "hwPWVcPwIdleCode"), ("HUAWEI-PWE3-MIB", "hwPWVcPwRtpHeader"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPWVcCfmMdIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcCfmMaName"), ("HUAWEI-PWE3-MIB", "hwPWVcCfmMdName"), ("HUAWEI-PWE3-MIB", "hwPWVcRawOrTagged"), ("HUAWEI-PWE3-MIB", "hwPWVcInterworkingType"), ("HUAWEI-PWE3-MIB", "hwPWVcCir"), ("HUAWEI-PWE3-MIB", "hwPWVcPir"), ("HUAWEI-PWE3-MIB", "hwPWVcQosProfile"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchCir"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPir"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchQosProfile"), ("HUAWEI-PWE3-MIB", "hwPWVcTrigger"), ("HUAWEI-PWE3-MIB", "hwPWVcEnableACOAM"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchVrIfIndex"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchVrID"), ("HUAWEI-PWE3-MIB", "hwPWVcQosParaFromPWT"), ("HUAWEI-PWE3-MIB", "hwPWVcBfdParaFromPWT"), ("HUAWEI-PWE3-MIB", "hwPwVcNegotiateMode"), ("HUAWEI-PWE3-MIB", "hwPwVcIsBypass"), ("HUAWEI-PWE3-MIB", "hwPwVcIsAdmin"), ("HUAWEI-PWE3-MIB", "hwPwVcAdminPwIfIndex"), ("HUAWEI-PWE3-MIB", "hwPwVcAdminPwLinkStatus"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchAdminPwIfIndex"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchAdminPwLinkStatus"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupAdminPwIfIndex"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupAdminPwLinkStatus"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcId"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcReceiveLabel"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcSendLabel"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcCir"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcPir"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcQosProfile"), ("HUAWEI-PWE3-MIB", "hwPwVcSlaveMasterMode"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchVcSlaveMasterMode"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcSlaveMasterMode"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchVcActive"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcActive"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchCwTrans"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchVcServiceName"), ("HUAWEI-PWE3-MIB", "hwPwVcSwitchBackupVcServiceName")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWVcGroup = hwPWVcGroup.setStatus('current') hwPWVcTnlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcTnlType"), ("HUAWEI-PWE3-MIB", "hwPWTnlForBfdIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWVcTnlGroup = hwPWVcTnlGroup.setStatus('current') hwPWVcStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcStatisticsRcvPkts"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsRcvBytes"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsSndPkts"), ("HUAWEI-PWE3-MIB", "hwPWVcStatisticsSndBytes")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWVcStatisticsGroup = hwPWVcStatisticsGroup.setStatus('current') hwPWRemoteVcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwPWRemoteVcID"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcType"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcStatus"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcGroupID"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcMtu"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcCtrlword"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwPWRemoteVcNotif")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWRemoteVcGroup = hwPWRemoteVcGroup.setStatus('current') hwPWTemplateGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwPWTemplatePeerAddrType"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePeerAddr"), ("HUAWEI-PWE3-MIB", "hwPWTemplateCtrlword"), ("HUAWEI-PWE3-MIB", "hwPWTemplateVCCV"), ("HUAWEI-PWE3-MIB", "hwPWTemplateFrag"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBandwidth"), ("HUAWEI-PWE3-MIB", "hwPWTemplateTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwPWTemplateQoSBehaviorIndex"), ("HUAWEI-PWE3-MIB", "hwPWTemplateExplicitPathName"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBFDDetectMultiplier"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBFDMinReceiveInterval"), ("HUAWEI-PWE3-MIB", "hwPWTemplateBFDMinTransmitInterval"), ("HUAWEI-PWE3-MIB", "hwPWTemplateDynamicBFDDetect"), ("HUAWEI-PWE3-MIB", "hwPWTemplateMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwPWTemplateAtmPackOvertime"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwJitterBufferDepth"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwTdmEncapsulationNum"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwIdleCode"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwRtpHeader"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePwCCSeqEnable"), ("HUAWEI-PWE3-MIB", "hwPWTemplateCir"), ("HUAWEI-PWE3-MIB", "hwPWTemplatePir"), ("HUAWEI-PWE3-MIB", "hwPWTemplateQosProfile"), ("HUAWEI-PWE3-MIB", "hwPWTemplateFlowLabel"), ("HUAWEI-PWE3-MIB", "hwPWTemplateRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWTemplateGroup = hwPWTemplateGroup.setStatus('current') hwPWNotificationControlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 6)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcSwitchNotifEnable"), ("HUAWEI-PWE3-MIB", "hwPWVcUpDownNotifEnable"), ("HUAWEI-PWE3-MIB", "hwPWVcDeletedNotifEnable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWNotificationControlGroup = hwPWNotificationControlGroup.setStatus('current') hwPWVcStateChangeReasonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 7)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcStateChangeReason"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchRmtID")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWVcStateChangeReasonGroup = hwPWVcStateChangeReasonGroup.setStatus('current') hwPWVcNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 8)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcSwitchWtoP"), ("HUAWEI-PWE3-MIB", "hwPWVcSwitchPtoW"), ("HUAWEI-PWE3-MIB", "hwPWVcDown"), ("HUAWEI-PWE3-MIB", "hwPWVcUp"), ("HUAWEI-PWE3-MIB", "hwPWVcDeleted"), ("HUAWEI-PWE3-MIB", "hwPWVcBackup"), ("HUAWEI-PWE3-MIB", "hwLdpPWVcDown"), ("HUAWEI-PWE3-MIB", "hwLdpPWVcUp")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWVcNotificationGroup = hwPWVcNotificationGroup.setStatus('current') hwLdpPWStateChangeReasonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 9)).setObjects(("HUAWEI-PWE3-MIB", "hwLdpPWStateChangeReason")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwLdpPWStateChangeReasonGroup = hwLdpPWStateChangeReasonGroup.setStatus('current') hwPWVcTDMPerfCurrentGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 2, 10)).setObjects(("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentMissingPkts"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentJtrBfrOverruns"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentJtrBfrUnderruns"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentMisOrderDropped"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentMalformedPkt"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentESs"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentSESs"), ("HUAWEI-PWE3-MIB", "hwPWVcTDMPerfCurrentUASs")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWVcTDMPerfCurrentGroup = hwPWVcTDMPerfCurrentGroup.setStatus('current') hwL2vpnSvcMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3)) hwSvcGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcID"), ("HUAWEI-PWE3-MIB", "hwSvcType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddrType"), ("HUAWEI-PWE3-MIB", "hwSvcPeerAddr"), ("HUAWEI-PWE3-MIB", "hwSvcStatus"), ("HUAWEI-PWE3-MIB", "hwSvcInboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcOutboundLabel"), ("HUAWEI-PWE3-MIB", "hwSvcGroupID"), ("HUAWEI-PWE3-MIB", "hwSvcAcStatus"), ("HUAWEI-PWE3-MIB", "hwSvcACOAMStatus"), ("HUAWEI-PWE3-MIB", "hwSvcMtu"), ("HUAWEI-PWE3-MIB", "hwSvcCtrlWord"), ("HUAWEI-PWE3-MIB", "hwSvcVCCV"), ("HUAWEI-PWE3-MIB", "hwSvcBandWidth"), ("HUAWEI-PWE3-MIB", "hwSvcMaxAtmCells"), ("HUAWEI-PWE3-MIB", "hwSvcTnlPolicyName"), ("HUAWEI-PWE3-MIB", "hwSvcQoSBehaviorIndex"), ("HUAWEI-PWE3-MIB", "hwSvcPWTemplateName"), ("HUAWEI-PWE3-MIB", "hwSvcUpTime"), ("HUAWEI-PWE3-MIB", "hwSvcOAMSync"), ("HUAWEI-PWE3-MIB", "hwSvcForBfdIndex"), ("HUAWEI-PWE3-MIB", "hwSvcSecondary"), ("HUAWEI-PWE3-MIB", "hwSvcDelayTime"), ("HUAWEI-PWE3-MIB", "hwSvcReroutePolicy"), ("HUAWEI-PWE3-MIB", "hwSvcResumeTime"), ("HUAWEI-PWE3-MIB", "hwSvcRerouteReason"), ("HUAWEI-PWE3-MIB", "hwSvcLastRerouteTime"), ("HUAWEI-PWE3-MIB", "hwSvcManualSetFault"), ("HUAWEI-PWE3-MIB", "hwSvcActive"), ("HUAWEI-PWE3-MIB", "hwSvcUpStartTime"), ("HUAWEI-PWE3-MIB", "hwSvcUpSumTime"), ("HUAWEI-PWE3-MIB", "hwSvcAtmPackOvertime"), ("HUAWEI-PWE3-MIB", "hwSvcPwJitterBufferDepth"), ("HUAWEI-PWE3-MIB", "hwSvcPwTdmEncapsulationNum"), ("HUAWEI-PWE3-MIB", "hwSvcPwIdleCode"), ("HUAWEI-PWE3-MIB", "hwSvcPwRtpHeader"), ("HUAWEI-PWE3-MIB", "hwSvcRawOrTagged"), ("HUAWEI-PWE3-MIB", "hwSvcInterworkingType"), ("HUAWEI-PWE3-MIB", "hwSvcCir"), ("HUAWEI-PWE3-MIB", "hwSvcPir"), ("HUAWEI-PWE3-MIB", "hwSvcQosProfile"), ("HUAWEI-PWE3-MIB", "hwSvcRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSvcGroup = hwSvcGroup.setStatus('current') hwSvcTnlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 2)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcTnlType"), ("HUAWEI-PWE3-MIB", "hwSvcTnlForBfdIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSvcTnlGroup = hwSvcTnlGroup.setStatus('current') hwSvcStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 3)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcStatisticsRcvPkts"), ("HUAWEI-PWE3-MIB", "hwSvcStatisticsRcvBytes"), ("HUAWEI-PWE3-MIB", "hwSvcStatisticsSndPkts"), ("HUAWEI-PWE3-MIB", "hwSvcStatisticsSndBytes")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSvcStatisticsGroup = hwSvcStatisticsGroup.setStatus('current') hwSvcNotificationControlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 4)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcSwitchNotifEnable"), ("HUAWEI-PWE3-MIB", "hwSvcUpDownNotifEnable"), ("HUAWEI-PWE3-MIB", "hwSvcDeletedNotifEnable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSvcNotificationControlGroup = hwSvcNotificationControlGroup.setStatus('current') hwSvcStateChangeReasonGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 5)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcStateChangeReason")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSvcStateChangeReasonGroup = hwSvcStateChangeReasonGroup.setStatus('current') hwSvcNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 3, 6)).setObjects(("HUAWEI-PWE3-MIB", "hwSvcSwitchWtoP"), ("HUAWEI-PWE3-MIB", "hwSvcSwitchPtoW"), ("HUAWEI-PWE3-MIB", "hwSvcDown"), ("HUAWEI-PWE3-MIB", "hwSvcUp"), ("HUAWEI-PWE3-MIB", "hwSvcDeleted")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwSvcNotificationGroup = hwSvcNotificationGroup.setStatus('current') hwL2vpnPWTableMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 4)) hwPWTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 2011, 5, 25, 119, 4, 3, 4, 1)).setObjects(("HUAWEI-PWE3-MIB", "hwPWInterfaceIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hwPWTableGroup = hwPWTableGroup.setStatus('current') mibBuilder.exportSymbols("HUAWEI-PWE3-MIB", hwPWVcAcStatus=hwPWVcAcStatus, hwPWVcPwRtpHeader=hwPWVcPwRtpHeader, hwPWVcManualSetFault=hwPWVcManualSetFault, hwPWVcSwitchPeerAddr=hwPWVcSwitchPeerAddr, hwPWVcOutboundLabel=hwPWVcOutboundLabel, hwPWVcUpTime=hwPWVcUpTime, hwPWBFDRemoteVcID=hwPWBFDRemoteVcID, hwPWVcTnlIndex=hwPWVcTnlIndex, hwPwVcAdminPwLinkStatus=hwPwVcAdminPwLinkStatus, hwPWVcDown=hwPWVcDown, hwSvcSecondary=hwSvcSecondary, hwSvcTnlIndex=hwSvcTnlIndex, hwPWVcGroupID=hwPWVcGroupID, hwPwVcSwitchAdminPwLinkStatus=hwPwVcSwitchAdminPwLinkStatus, hwSvcReroutePolicy=hwSvcReroutePolicy, hwSvcACOAMStatus=hwSvcACOAMStatus, hwL2VpnPwe3=hwL2VpnPwe3, hwPWVcUpDownNotifEnable=hwPWVcUpDownNotifEnable, hwPWTableGroup=hwPWTableGroup, hwSvcStatisticsTable=hwSvcStatisticsTable, hwPWVcDeletedNotifEnable=hwPWVcDeletedNotifEnable, hwPWVcIfName=hwPWVcIfName, hwPWVcACOAMStatus=hwPWVcACOAMStatus, hwPWTemplatePir=hwPWTemplatePir, hwPWVcLastRerouteTime=hwPWVcLastRerouteTime, hwPwVcNegotiateMode=hwPwVcNegotiateMode, hwPWVcTnlPolicyName=hwPWVcTnlPolicyName, hwPWVcQosParaFromPWT=hwPWVcQosParaFromPWT, hwPwVcSwitchBackupVcQosProfile=hwPwVcSwitchBackupVcQosProfile, hwSvcMaxAtmCells=hwSvcMaxAtmCells, hwSvcVCCV=hwSvcVCCV, hwPWVcBandWidth=hwPWVcBandWidth, hwPWVcSwitchQosProfile=hwPWVcSwitchQosProfile, hwPWVcEntry=hwPWVcEntry, hwSvcStateChangeReasonGroup=hwSvcStateChangeReasonGroup, hwSvcManualSetFault=hwSvcManualSetFault, hwPwe3MIBCompliances=hwPwe3MIBCompliances, hwSvcStatisticsGroup=hwSvcStatisticsGroup, hwSvcUpTime=hwSvcUpTime, hwPWVcType=hwPWVcType, hwPWVcBfdParaFromPWT=hwPWVcBfdParaFromPWT, hwPWVcTDMPerfCurrentMisOrderDropped=hwPWVcTDMPerfCurrentMisOrderDropped, hwSvcDeleted=hwSvcDeleted, hwPWVcTDMPerfCurrentJtrBfrUnderruns=hwPWVcTDMPerfCurrentJtrBfrUnderruns, hwSvcStatisticsSndPkts=hwSvcStatisticsSndPkts, hwSvcSwitchPtoW=hwSvcSwitchPtoW, hwPWVcGroup=hwPWVcGroup, hwPWVcTrigger=hwPWVcTrigger, hwPwe3MIBConformance=hwPwe3MIBConformance, hwSvcMtu=hwSvcMtu, hwPwVcSwitchBackupVcServiceName=hwPwVcSwitchBackupVcServiceName, hwPwVcSwitchBackupAdminPwLinkStatus=hwPwVcSwitchBackupAdminPwLinkStatus, hwPWVcSwitchID=hwPWVcSwitchID, hwPWOAMSync=hwPWOAMSync, hwPwVcSwitchBackupAdminPwIfIndex=hwPwVcSwitchBackupAdminPwIfIndex, hwPWInterfaceIndex=hwPWInterfaceIndex, hwPWEntry=hwPWEntry, hwPWPeerIp=hwPWPeerIp, hwPWVcCtrlWord=hwPWVcCtrlWord, hwPwVcSwitchBackupVcActive=hwPwVcSwitchBackupVcActive, hwPWTemplateCir=hwPWTemplateCir, hwSvcInterworkingType=hwSvcInterworkingType, hwPWVcPwJitterBufferDepth=hwPWVcPwJitterBufferDepth, hwPWVcSwitchPtoW=hwPWVcSwitchPtoW, hwSvcQoSBehaviorIndex=hwSvcQoSBehaviorIndex, hwPWVcSwitchTnlPolicyName=hwPWVcSwitchTnlPolicyName, hwPWVcTnlTable=hwPWVcTnlTable, hwPWTemplateFlowLabel=hwPWTemplateFlowLabel, hwPWVcPeerAddrType=hwPWVcPeerAddrType, hwPwVcAdminPwIfIndex=hwPwVcAdminPwIfIndex, hwPWVcStatisticsSndPkts=hwPWVcStatisticsSndPkts, hwPwVcSlaveMasterMode=hwPwVcSlaveMasterMode, hwPWTemplateEntry=hwPWTemplateEntry, hwLdpPWVcUp=hwLdpPWVcUp, hwPWTemplateMIBTraps=hwPWTemplateMIBTraps, hwPWVcTDMPerfCurrentUASs=hwPWVcTDMPerfCurrentUASs, hwPwVcSwitchVcServiceName=hwPwVcSwitchVcServiceName, hwPWTemplateQoSBehaviorIndex=hwPWTemplateQoSBehaviorIndex, hwPWRemoteVcGroup=hwPWRemoteVcGroup, hwPWVcPwIdleCode=hwPWVcPwIdleCode, hwPWVcInboundLabel=hwPWVcInboundLabel, hwPWVcQoSBehaviorIndex=hwPWVcQoSBehaviorIndex, hwPWTemplateExplicitPathName=hwPWTemplateExplicitPathName, hwPWVcStatisticsRcvPkts=hwPWVcStatisticsRcvPkts, hwPWRemoteVcCtrlword=hwPWRemoteVcCtrlword, hwPWVcCfmMdIndex=hwPWVcCfmMdIndex, hwSvcOutboundLabel=hwSvcOutboundLabel, hwPWVcAtmPackOvertime=hwPWVcAtmPackOvertime, hwSvcIfIndex=hwSvcIfIndex, hwPWVcTnlEntry=hwPWVcTnlEntry, hwSvcAcStatus=hwSvcAcStatus, hwSvcCtrlWord=hwSvcCtrlWord, hwPWVcEnableACOAM=hwPWVcEnableACOAM, hwSvcDown=hwSvcDown, hwPWTemplatePeerAddr=hwPWTemplatePeerAddr, hwPWTemplateRowStatus=hwPWTemplateRowStatus, hwSvcSwitchNotifEnable=hwSvcSwitchNotifEnable, hwPwVcSwitchBackupVcCir=hwPwVcSwitchBackupVcCir, hwSvcCir=hwSvcCir, hwSvcID=hwSvcID, hwPWVcSwitchOutboundLabel=hwPWVcSwitchOutboundLabel, hwPWVcSwitchVrIfIndex=hwPWVcSwitchVrIfIndex, hwPwVcSwitchBackupVcPeerAddr=hwPwVcSwitchBackupVcPeerAddr, hwPWVcNotificationGroup=hwPWVcNotificationGroup, hwPWVcID=hwPWVcID, hwPWRemoteVcNotif=hwPWRemoteVcNotif, hwPWTable=hwPWTable, hwSvcPwIdleCode=hwSvcPwIdleCode, hwPWVcDelayTime=hwPWVcDelayTime, hwSvcTnlForBfdIndex=hwSvcTnlForBfdIndex, hwPWVcRerouteReason=hwPWVcRerouteReason, hwPWVcReroutePolicy=hwPWVcReroutePolicy, hwPWVcSecondary=hwPWVcSecondary, hwPWVcTDMPerfCurrentMissingPkts=hwPWVcTDMPerfCurrentMissingPkts, hwPWVcDeleted=hwPWVcDeleted, hwPWVcStateChangeReasonGroup=hwPWVcStateChangeReasonGroup, hwPWVcPwTdmEncapsulationNum=hwPWVcPwTdmEncapsulationNum, hwSvcResumeTime=hwSvcResumeTime, hwSvcLastRerouteTime=hwSvcLastRerouteTime, hwL2vpnSvcMIBTraps=hwL2vpnSvcMIBTraps, hwPWTemplatePwTdmEncapsulationNum=hwPWTemplatePwTdmEncapsulationNum, hwPWVcUpSumTime=hwPWVcUpSumTime, hwPWVcTemplateName=hwPWVcTemplateName, hwSvcStatus=hwSvcStatus, hwSvcStatisticsRcvBytes=hwSvcStatisticsRcvBytes, hwPWTemplateBFDMinTransmitInterval=hwPWTemplateBFDMinTransmitInterval, hwLdpPWVcDown=hwLdpPWVcDown, hwPWType=hwPWType, hwPwe3MIBTraps=hwPwe3MIBTraps, hwSvcUpDownNotifEnable=hwSvcUpDownNotifEnable, hwPWTemplateTable=hwPWTemplateTable, hwPWVcMtu=hwPWVcMtu, hwPWCfmMaIndex=hwPWCfmMaIndex, hwPWVcQosProfile=hwPWVcQosProfile, hwSvcStatisticsEntry=hwSvcStatisticsEntry, hwPwVcIsBypass=hwPwVcIsBypass, hwPWTemplatePeerAddrType=hwPWTemplatePeerAddrType, hwPWRemoteVcMtu=hwPWRemoteVcMtu, hwSvcGroup=hwSvcGroup, hwSvcDelayTime=hwSvcDelayTime, hwPwe3MIBGroups=hwPwe3MIBGroups, hwSvcObjects=hwSvcObjects, hwPwe3MIBObjects=hwPwe3MIBObjects, hwPWVcIfIndex=hwPWVcIfIndex, hwPWVcTDMPerfCurrentSESs=hwPWVcTDMPerfCurrentSESs, hwPwVcSwitchBackupVcTnlPolicyName=hwPwVcSwitchBackupVcTnlPolicyName, hwL2vpnSvcMIBGroups=hwL2vpnSvcMIBGroups, hwPWVcTDMPerfCurrentJtrBfrOverruns=hwPWVcTDMPerfCurrentJtrBfrOverruns, hwPWVCForBfdIndex=hwPWVCForBfdIndex, hwSvcPwJitterBufferDepth=hwSvcPwJitterBufferDepth, hwPWVcStatisticsEntry=hwPWVcStatisticsEntry, hwPWVcStatisticsSndBytes=hwPWVcStatisticsSndBytes, hwPWVcTnlType=hwPWVcTnlType, hwPWVcPeerAddr=hwPWVcPeerAddr, hwPWTemplateBandwidth=hwPWTemplateBandwidth, hwPWVcTDMPerfCurrentGroup=hwPWVcTDMPerfCurrentGroup, hwPWVcSwitchVrID=hwPWVcSwitchVrID, hwPWVcSwitchInboundLabel=hwPWVcSwitchInboundLabel, hwPWVcUp=hwPWVcUp, hwPWVcPir=hwPWVcPir, hwPWId=hwPWId, hwPWVcSwitchWtoP=hwPWVcSwitchWtoP, hwSvcQosProfile=hwSvcQosProfile, hwPwe3Objects=hwPwe3Objects, hwPWBFDMinReceiveInterval=hwPWBFDMinReceiveInterval, hwPwVcIsAdmin=hwPwVcIsAdmin, hwPWNotificationControlGroup=hwPWNotificationControlGroup, hwPWVcVCCV=hwPWVcVCCV, hwSvcNotificationGroup=hwSvcNotificationGroup, hwPWVcTDMPerfCurrentESs=hwPWVcTDMPerfCurrentESs, hwSvcTnlGroup=hwSvcTnlGroup, hwPWVcCfmMdName=hwPWVcCfmMdName, hwSvcForBfdIndex=hwSvcForBfdIndex, hwPWRemoteVcType=hwPWRemoteVcType, hwPWTemplateGroup=hwPWTemplateGroup, hwPWVcStatus=hwPWVcStatus, hwPWRemoteVcMaxAtmCells=hwPWRemoteVcMaxAtmCells, hwSvcActive=hwSvcActive, hwSvcUpStartTime=hwSvcUpStartTime, hwPWVcSwitchCir=hwPWVcSwitchCir, hwPWTemplatePwJitterBufferDepth=hwPWTemplatePwJitterBufferDepth, hwPwVcSwitchBackupVcSendLabel=hwPwVcSwitchBackupVcSendLabel, hwPWVcTDMPerfCurrentTable=hwPWVcTDMPerfCurrentTable, hwPWTemplateVCCV=hwPWTemplateVCCV, hwPWTemplateDynamicBFDDetect=hwPWTemplateDynamicBFDDetect, hwPWTemplateName=hwPWTemplateName, hwPWTemplateBFDMinReceiveInterval=hwPWTemplateBFDMinReceiveInterval, hwPwe3MIBCompliance=hwPwe3MIBCompliance, hwPWVcStatisticsGroup=hwPWVcStatisticsGroup, hwPWVcCir=hwPWVcCir, hwSvcSwitchWtoP=hwSvcSwitchWtoP, hwPWRemoteVcEntry=hwPWRemoteVcEntry, hwSvcStateChangeReason=hwSvcStateChangeReason, hwPWTemplateMaxAtmCells=hwPWTemplateMaxAtmCells, hwPwVcSwitchVcActive=hwPwVcSwitchVcActive, hwSvcPeerAddr=hwSvcPeerAddr, hwPwVcSwitchBackupVcPir=hwPwVcSwitchBackupVcPir, hwPWVcActive=hwPWVcActive, hwPWRemoteVcGroupID=hwPWRemoteVcGroupID, hwPWVcStatisticsRcvBytes=hwPWVcStatisticsRcvBytes, hwPWVcResumeTime=hwPWVcResumeTime, hwSvcTable=hwSvcTable, hwPWRemoteVcStatus=hwPWRemoteVcStatus, hwPWVcBackup=hwPWVcBackup, hwPWTemplateCtrlword=hwPWTemplateCtrlword, hwPWVcInterworkingType=hwPWVcInterworkingType, hwL2Vpn=hwL2Vpn, hwPWVcTable=hwPWVcTable, hwSvcBandWidth=hwSvcBandWidth, hwPWVcVrIfIndex=hwPWVcVrIfIndex, hwSvcStatisticsRcvPkts=hwSvcStatisticsRcvPkts, hwPWTemplateBFDDetectMultiplier=hwPWTemplateBFDDetectMultiplier, hwLdpPWStateChangeReasonGroup=hwLdpPWStateChangeReasonGroup, hwL2vpnPWTableMIBGroups=hwL2vpnPWTableMIBGroups, hwSvcTnlTable=hwSvcTnlTable, hwPWVcTnlGroup=hwPWVcTnlGroup, hwPWVcUpStartTime=hwPWVcUpStartTime, hwSvcPwTdmEncapsulationNum=hwSvcPwTdmEncapsulationNum, hwPwVcSwitchAdminPwIfIndex=hwPwVcSwitchAdminPwIfIndex, hwPwVcSwitchBackupVcSlaveMasterMode=hwPwVcSwitchBackupVcSlaveMasterMode, HWLdpPwStateChangeReason=HWLdpPwStateChangeReason, hwSvcPwRtpHeader=hwSvcPwRtpHeader, hwPWRemoteVcID=hwPWRemoteVcID, hwSvcTnlEntry=hwSvcTnlEntry, hwPWVcStatisticsTable=hwPWVcStatisticsTable, hwPwVcSwitchBackupVcPeerAddrType=hwPwVcSwitchBackupVcPeerAddrType, hwPWVcTDMPerfCurrentMalformedPkt=hwPWVcTDMPerfCurrentMalformedPkt, hwSvcTnlPolicyName=hwSvcTnlPolicyName, hwSvcUp=hwSvcUp, hwSvcAtmPackOvertime=hwSvcAtmPackOvertime, hwSvcPeerAddrType=hwSvcPeerAddrType, hwSvcPWTemplateName=hwSvcPWTemplateName, hwPWBFDMinTransmitInterval=hwPWBFDMinTransmitInterval, hwPWVcMaxAtmCells=hwPWVcMaxAtmCells, hwSvcRowStatus=hwSvcRowStatus, hwSvcStatisticsSndBytes=hwSvcStatisticsSndBytes, hwPWVcSwitchPeerAddrType=hwPWVcSwitchPeerAddrType, hwSvcType=hwSvcType, hwSvcUpSumTime=hwSvcUpSumTime, hwPWRemoteVcTable=hwPWRemoteVcTable, hwPWVcStateChangeReason=hwPWVcStateChangeReason, hwPwVcSwitchVcSlaveMasterMode=hwPwVcSwitchVcSlaveMasterMode, hwPWVcSwitchSign=hwPWVcSwitchSign, hwSvcEntry=hwSvcEntry, PYSNMP_MODULE_ID=hwL2VpnPwe3, hwPWTnlForBfdIndex=hwPWTnlForBfdIndex, hwSvcInboundLabel=hwSvcInboundLabel, hwSvcRerouteReason=hwSvcRerouteReason, hwSvcTnlType=hwSvcTnlType, hwPWVcCfmMaName=hwPWVcCfmMaName, hwPWTemplateAtmPackOvertime=hwPWTemplateAtmPackOvertime, hwPWVcSwitchPir=hwPWVcSwitchPir, hwPWTemplateQosProfile=hwPWTemplateQosProfile, hwSvcDeletedNotifEnable=hwSvcDeletedNotifEnable) mibBuilder.exportSymbols("HUAWEI-PWE3-MIB", hwPWTemplateFrag=hwPWTemplateFrag, hwPwVcSwitchBackupVcId=hwPwVcSwitchBackupVcId, hwPWEthOamType=hwPWEthOamType, hwPWVcSwitchRmtID=hwPWVcSwitchRmtID, hwSvcOAMSync=hwSvcOAMSync, hwPwVcSwitchCwTrans=hwPwVcSwitchCwTrans, hwPWBFDDetectMultiplier=hwPWBFDDetectMultiplier, hwSvcPir=hwSvcPir, hwPWTableObjects=hwPWTableObjects, hwPwVcSwitchBackupVcReceiveLabel=hwPwVcSwitchBackupVcReceiveLabel, hwSvcRawOrTagged=hwSvcRawOrTagged, hwPWTemplatePwRtpHeader=hwPWTemplatePwRtpHeader, hwPWTemplatePwCCSeqEnable=hwPWTemplatePwCCSeqEnable, hwPWVcRawOrTagged=hwPWVcRawOrTagged, hwLdpPWStateChangeReason=hwLdpPWStateChangeReason, hwPWVcVrID=hwPWVcVrID, hwPWTemplateTnlPolicyName=hwPWTemplateTnlPolicyName, hwPWTemplatePwIdleCode=hwPWTemplatePwIdleCode, hwPWTemplateCannotDeleted=hwPWTemplateCannotDeleted, hwSvcNotificationControlGroup=hwSvcNotificationControlGroup, hwSvcGroupID=hwSvcGroupID, hwPWVcSwitchNotifEnable=hwPWVcSwitchNotifEnable, hwPWVcRowStatus=hwPWVcRowStatus, hwPWVcTDMPerfCurrentEntry=hwPWVcTDMPerfCurrentEntry, hwPWVcExplicitPathName=hwPWVcExplicitPathName, hwPWDynamicBFDDetect=hwPWDynamicBFDDetect)
150.301695
10,196
0.744852
10,187
88,678
6.483754
0.05507
0.016412
0.063179
0.016836
0.482014
0.463104
0.385057
0.370386
0.361423
0.347176
0
0.092223
0.085365
88,678
589
10,197
150.556876
0.722124
0.003654
0
0.031034
0
0
0.18061
0.029441
0
0
0
0
0
1
0
false
0.008621
0.02069
0
0.027586
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
eabf8410c7e3c18f912f519d0b1c8ed86f92b8c2
14,590
py
Python
config/qutebrowser/config.py
anmolmathias/dotfiles
d66b553346fe8fa54e5a49f284163507f37f8407
[ "MIT" ]
null
null
null
config/qutebrowser/config.py
anmolmathias/dotfiles
d66b553346fe8fa54e5a49f284163507f37f8407
[ "MIT" ]
null
null
null
config/qutebrowser/config.py
anmolmathias/dotfiles
d66b553346fe8fa54e5a49f284163507f37f8407
[ "MIT" ]
null
null
null
# Autogenerated config.py # # NOTE: config.py is intended for advanced users who are comfortable # with manually migrating the config file on qutebrowser upgrades. If # you prefer, you can also configure qutebrowser using the # :set/:bind/:config-* commands without having to write a config.py # file. # # Documentation: # qute://help/configuring.html # qute://help/settings.html # Change the argument to True to still load settings configured via autoconfig.yml config.load_autoconfig(False) # Always restore open sites when qutebrowser is reopened. Without this # option set, `:wq` (`:quit --save`) needs to be used to save open tabs # (and restore them), while quitting qutebrowser in any other way will # not save/restore the session. By default, this will save to the # session which was last loaded. This behavior can be customized via the # `session.default_name` setting. # Type: Bool c.auto_save.session = True # Which cookies to accept. With QtWebEngine, this setting also controls # other features with tracking capabilities similar to those of cookies; # including IndexedDB, DOM storage, filesystem API, service workers, and # AppCache. Note that with QtWebKit, only `all` and `never` are # supported as per-domain values. Setting `no-3rdparty` or `no- # unknown-3rdparty` per-domain on QtWebKit will have the same effect as # `all`. If this setting is used with URL patterns, the pattern gets # applied to the origin/first party URL of the page making the request, # not the request URL. With QtWebEngine 5.15.0+, paths will be stripped # from URLs, so URL patterns using paths will not match. With # QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so # you will typically need to set this setting for `example.com` when the # cookie is set on `somesubdomain.example.com` for it to work properly. # To debug issues with this setting, start qutebrowser with `--debug # --logfilter network --debug-flag log-cookies` which will show all # cookies being set. # Type: String # Valid values: # - all: Accept all cookies. # - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail. # - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty. # - never: Don't accept cookies at all. config.set('content.cookies.accept', 'all', 'chrome-devtools://*') # Which cookies to accept. With QtWebEngine, this setting also controls # other features with tracking capabilities similar to those of cookies; # including IndexedDB, DOM storage, filesystem API, service workers, and # AppCache. Note that with QtWebKit, only `all` and `never` are # supported as per-domain values. Setting `no-3rdparty` or `no- # unknown-3rdparty` per-domain on QtWebKit will have the same effect as # `all`. If this setting is used with URL patterns, the pattern gets # applied to the origin/first party URL of the page making the request, # not the request URL. With QtWebEngine 5.15.0+, paths will be stripped # from URLs, so URL patterns using paths will not match. With # QtWebEngine 5.15.2+, subdomains are additionally stripped as well, so # you will typically need to set this setting for `example.com` when the # cookie is set on `somesubdomain.example.com` for it to work properly. # To debug issues with this setting, start qutebrowser with `--debug # --logfilter network --debug-flag log-cookies` which will show all # cookies being set. # Type: String # Valid values: # - all: Accept all cookies. # - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail. # - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty. # - never: Don't accept cookies at all. config.set('content.cookies.accept', 'all', 'devtools://*') # Allow websites to request geolocations. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.geolocation', False, 'https://www.google.com.ar') # Allow websites to request geolocations. # Type: BoolAsk # Valid values: # - true # - false # - ask # Value to send in the `Accept-Language` header. Note that the value # read from JavaScript is always the global value. # Type: String config.set('content.headers.accept_language', '', 'https://matchmaker.krunker.io/*') # User agent to send. The following placeholders are defined: * # `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`: # The underlying WebKit version (set to a fixed value with # QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for # QtWebEngine. * `{qt_version}`: The underlying Qt version. * # `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for # QtWebEngine. * `{upstream_browser_version}`: The corresponding # Safari/Chrome version. * `{qutebrowser_version}`: The currently # running qutebrowser version. The default value is equal to the # unchanged user agent of QtWebKit/QtWebEngine. Note that the value # read from JavaScript is always the global value. With QtWebEngine # between 5.12 and 5.14 (inclusive), changing the value exposed to # JavaScript requires a restart. # Type: FormatString config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/') # User agent to send. The following placeholders are defined: * # `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`: # The underlying WebKit version (set to a fixed value with # QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for # QtWebEngine. * `{qt_version}`: The underlying Qt version. * # `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for # QtWebEngine. * `{upstream_browser_version}`: The corresponding # Safari/Chrome version. * `{qutebrowser_version}`: The currently # running qutebrowser version. The default value is equal to the # unchanged user agent of QtWebKit/QtWebEngine. Note that the value # read from JavaScript is always the global value. With QtWebEngine # between 5.12 and 5.14 (inclusive), changing the value exposed to # JavaScript requires a restart. # Type: FormatString config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version} Edg/{upstream_browser_version}', 'https://accounts.google.com/*') # User agent to send. The following placeholders are defined: * # `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`: # The underlying WebKit version (set to a fixed value with # QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for # QtWebEngine. * `{qt_version}`: The underlying Qt version. * # `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for # QtWebEngine. * `{upstream_browser_version}`: The corresponding # Safari/Chrome version. * `{qutebrowser_version}`: The currently # running qutebrowser version. The default value is equal to the # unchanged user agent of QtWebKit/QtWebEngine. Note that the value # read from JavaScript is always the global value. With QtWebEngine # between 5.12 and 5.14 (inclusive), changing the value exposed to # JavaScript requires a restart. # Type: FormatString config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*') # Load images automatically in web pages. # Type: Bool config.set('content.images', True, 'chrome-devtools://*') # Load images automatically in web pages. # Type: Bool config.set('content.images', True, 'devtools://*') # Enable JavaScript. # Type: Bool config.set('content.javascript.enabled', True, 'chrome-devtools://*') # Enable JavaScript. # Type: Bool config.set('content.javascript.enabled', True, 'devtools://*') # Enable JavaScript. # Type: Bool config.set('content.javascript.enabled', True, 'chrome://*/*') # Enable JavaScript. # Type: Bool config.set('content.javascript.enabled', True, 'qute://*/*') # Allow websites to record audio. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.media.audio_capture', True, 'https://discord.com') # Allow websites to record audio and video. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.media.audio_video_capture', True, 'https://hangouts.google.com') # Allow websites to show notifications. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.notifications.enabled', False, 'https://www.facebook.com') # Allow websites to show notifications. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.notifications.enabled', False, 'https://www.netflix.com') # Allow websites to show notifications. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.notifications.enabled', False, 'https://www.nokia.com') # Allow websites to show notifications. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.notifications.enabled', False, 'https://www.reddit.com') # Allow websites to show notifications. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.notifications.enabled', False, 'https://www.samsung.com') # Allow websites to show notifications. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.notifications.enabled', False, 'https://www.youtube.com') # Allow websites to register protocol handlers via # `navigator.registerProtocolHandler`. # Type: BoolAsk # Valid values: # - true # - false # - ask config.set('content.register_protocol_handler', False, 'https://mail.google.com?extsrc=mailto&url=%25s') # Duration (in milliseconds) to wait before removing finished downloads. # If set to -1, downloads are never removed. # Type: Int c.downloads.remove_finished = 4000 # When to show the statusbar. # Type: String # Valid values: # - always: Always show the statusbar. # - never: Always hide the statusbar. # - in-mode: Show the statusbar when in modes other than normal mode. c.statusbar.show = 'in-mode' # How to behave when the last tab is closed. If the # `tabs.tabs_are_windows` setting is set, this is ignored and the # behavior is always identical to the `close` value. # Type: String # Valid values: # - ignore: Don't do anything. # - blank: Load a blank page. # - startpage: Load the start page. # - default-page: Load the default page. # - close: Close the window. c.tabs.last_close = 'startpage' # When to show the tab bar. # Type: String # Valid values: # - always: Always show the tab bar. # - never: Always hide the tab bar. # - multiple: Hide the tab bar if only one tab is open. # - switching: Show the tab bar when switching tabs. c.tabs.show = 'never' # Open a new window for every tab. # Type: Bool c.tabs.tabs_are_windows = True # Search engines which can be used via the address bar. Maps a search # engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}` # placeholder. The placeholder will be replaced by the search term, use # `{{` and `}}` for literal `{`/`}` braces. The following further # placeholds are defined to configure how special characters in the # search terms are replaced by safe characters (called 'quoting'): * # `{}` and `{semiquoted}` quote everything except slashes; this is the # most sensible choice for almost all search engines (for the search # term `slash/and&amp` this placeholder expands to `slash/and%26amp`). # * `{quoted}` quotes all characters (for `slash/and&amp` this # placeholder expands to `slash%2Fand%26amp`). * `{unquoted}` quotes # nothing (for `slash/and&amp` this placeholder expands to # `slash/and&amp`). * `{0}` means the same as `{}`, but can be used # multiple times. The search engine named `DEFAULT` is used when # `url.auto_search` is turned on and something else than a URL was # entered to be opened. Other search engines can be used by prepending # the search engine name to the search term, e.g. `:open google # qutebrowser`. # Type: Dict c.url.searchengines = {'DEFAULT': 'https://www.google.com/search?q={}', 'am': 'https://www.amazon.co.in/s?k={}', 'aw': 'https://wiki.archlinux.org/?search={}', 'g': 'https://www.google.com/search?q={}', 're': 'https://www.reddit.com/r/{}', 'wiki': 'https://en.wikipedia.org/wiki/{}', 'yt': 'https://www.youtube.com/results?search_query={}'} # Page(s) to open at the start. # Type: List of FuzzyUrl, or FuzzyUrl c.url.start_pages = '/home/nml/.config/qutebrowser/startpage/index.html' # Default font families to use. Whenever "default_family" is used in a # font setting, it's replaced with the fonts listed here. If set to an # empty value, a system-specific monospace default is used. # Type: List of Font, or Font c.fonts.default_family = 'Inter' # Default font size to use. Whenever "default_size" is used in a font # setting, it's replaced with the size listed here. Valid values are # either a float value with a "pt" suffix, or an integer value with a # "px" suffix. # Type: String c.fonts.default_size = '16px' # Font used in the completion widget. # Type: Font c.fonts.completion.entry = '12pt "Inter"' # Font used in the completion categories. # Type: Font c.fonts.completion.category = '12pt "Inter"' # Font used for the context menu. If set to null, the Qt default is # used. # Type: Font c.fonts.contextmenu = '12pt "Inter"' # Font used for the debugging console. # Type: Font c.fonts.debug_console = '12pt "Inter"' # Font used for the downloadbar. # Type: Font c.fonts.downloads = '12pt "Inter"' # Font used for the hints. # Type: Font c.fonts.hints = '12pt "Inter"' # Font used in the keyhint widget. # Type: Font c.fonts.keyhint = '12pt "Inter"' # Font used for info messages. # Type: Font c.fonts.messages.info = '12pt "Inter"' # Font used for prompts. # Type: Font c.fonts.prompts = '12pt "Inter"' # Font used in the statusbar. # Type: Font c.fonts.statusbar = '12pt "Inter"' # Font family for standard fonts. # Type: FontFamily c.fonts.web.family.standard = 'Inter' # Font family for sans-serif fonts. # Type: FontFamily c.fonts.web.family.sans_serif = 'Inter' config.source('gruvbox.py') # Bindings for normal mode config.bind(',M', 'hint links spawn mpv {hint-url}') config.bind(',m', 'spawn mpv {url}')
39.646739
340
0.724195
2,119
14,590
4.951392
0.209061
0.018872
0.033549
0.023065
0.641727
0.62276
0.603126
0.596645
0.58902
0.576439
0
0.009335
0.155655
14,590
367
341
39.754768
0.842357
0.736463
0
0
1
0.0625
0.557515
0.225021
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2