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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
44b3cebd337c6f32ed6e99a3bf2d657fcab0b105 | 24,317 | py | Python | pysnmp-with-texts/Wellfleet-DS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Wellfleet-DS1-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Wellfleet-DS1-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 Wellfleet-DS1-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Wellfleet-DS1-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:39:54 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, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
iso, Gauge32, Counter64, MibIdentifier, Unsigned32, Integer32, ModuleIdentity, NotificationType, ObjectIdentity, Counter32, mgmt, MibScalar, MibTable, MibTableRow, MibTableColumn, mib_2, NotificationType, IpAddress, Bits, enterprises, Opaque, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Gauge32", "Counter64", "MibIdentifier", "Unsigned32", "Integer32", "ModuleIdentity", "NotificationType", "ObjectIdentity", "Counter32", "mgmt", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "mib-2", "NotificationType", "IpAddress", "Bits", "enterprises", "Opaque", "TimeTicks")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
wfDs1Group, = mibBuilder.importSymbols("Wellfleet-COMMON-MIB", "wfDs1Group")
wfDs1Config = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1), )
if mibBuilder.loadTexts: wfDs1Config.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1Config.setDescription('The DS1 Configuration table')
wfDs1ConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1LineIndex"))
if mibBuilder.loadTexts: wfDs1ConfigEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1ConfigEntry.setDescription('per circuit DS1 configuration objects; wfDs1LineIndex corresponds to Wellfleet circuit number')
wfDs1LineIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1LineIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1LineIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1TimeElapsed = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TimeElapsed.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TimeElapsed.setDescription('1..900 seconds within the current 15-minute interval')
wfDs1ValidIntervals = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1ValidIntervals.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1ValidIntervals.setDescription('0..96 previous intervals that valid data were collected. This is 96 unless the CSU device was brought on line within the last 24 hours.')
wfDs1LineType = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4))).clone(namedValues=NamedValues(("ds1ansi-esf", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1LineType.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1LineType.setDescription('the variety of DS1 implementing this circuit')
wfDs1ZeroCoding = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 5))).clone(namedValues=NamedValues(("ds1b8zs", 2), ("ds1zbtsi", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1ZeroCoding.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1ZeroCoding.setDescription('the variety of Zero Code Suppression used on the link')
wfDs1SendCode = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2))).clone(namedValues=NamedValues(("ds1sendnocode", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1SendCode.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1SendCode.setDescription('the type of code being sent across the DS1 circuit by the CSU')
wfDs1CircuitIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CircuitIdentifier.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CircuitIdentifier.setDescription("the transmission vendor's circuit identifier")
wfDs1LoopbackConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ds1noloop", 1), ("ds1mgrpayloadloop", 2), ("ds1mgrlineloop", 3), ("ds1netreqpayloadloop", 4), ("ds1netreqlineloop", 5), ("ds1otherloop", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1LoopbackConfig.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1LoopbackConfig.setDescription('the loopback state of the CSU')
wfDs1LineStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16, 32))).clone(namedValues=NamedValues(("ds1noalarm", 1), ("ds1farendalarm", 2), ("ds1alarmindicationsignal", 4), ("ds1lossofframe", 8), ("ds1lossofsignal", 16), ("ds1loopbackstate", 32)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1LineStatus.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1LineStatus.setDescription('the state of the DS1 line')
wfDs1Current = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2), )
if mibBuilder.loadTexts: wfDs1Current.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1Current.setDescription('The DS1 Current table')
wfDs1CurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1CurrentIndex"))
if mibBuilder.loadTexts: wfDs1CurrentEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentEntry.setDescription('per circuit DS1 current objects - wfDs1CurrentIndex corresponds to Wellfleet circuit number')
wfDs1CurrentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1CurrentESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentESs.setDescription('the count of errored seconds in the current interval')
wfDs1CurrentSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentSESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentSESs.setDescription('the count of severely errored seconds in the current interval')
wfDs1CurrentSEFs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentSEFs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentSEFs.setDescription('the count of severely errored framing seconds in the current interval')
wfDs1CurrentUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentUASs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentUASs.setDescription('the number of unavailable seconds in the current interval')
wfDs1CurrentBPVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentBPVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentBPVs.setDescription('the count of bipolar violations in the current interval')
wfDs1CurrentCVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 2, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1CurrentCVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1CurrentCVs.setDescription('the count of code violation error events in the current interval')
wfDs1Interval = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3), )
if mibBuilder.loadTexts: wfDs1Interval.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1Interval.setDescription('The DS1 Interval table')
wfDs1IntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1IntervalIndex"), (0, "Wellfleet-DS1-MIB", "wfDs1IntervalNumber"))
if mibBuilder.loadTexts: wfDs1IntervalEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalEntry.setDescription('per circuit DS1 interval objects - wfDs1IntervalIndex corresponds to Wellfleet circuit number, wfDs1IntervalNumber is the numbered previous 15-minute interval')
wfDs1IntervalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1IntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalNumber.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalNumber.setDescription('1..96 where 1 is the most recent 15-minute interval and 96 is the least')
wfDs1IntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalESs.setDescription('the count of errored seconds in the specified interval')
wfDs1IntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalSESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalSESs.setDescription('the count of severely errored seconds in the specified interval')
wfDs1IntervalSEFs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalSEFs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalSEFs.setDescription('the count of severely errored framing seconds in the specified interval')
wfDs1IntervalUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalUASs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalUASs.setDescription('the number of unavailable seconds in the specified interval')
wfDs1IntervalBPVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalBPVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalBPVs.setDescription('the count of bipolar violations in the specified interval')
wfDs1IntervalCVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 3, 1, 8), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1IntervalCVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1IntervalCVs.setDescription('the count of code violation error events in the specified interval')
wfDs1Total = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4), )
if mibBuilder.loadTexts: wfDs1Total.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1Total.setDescription('The DS1 Total table')
wfDs1TotalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1TotalIndex"))
if mibBuilder.loadTexts: wfDs1TotalEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalEntry.setDescription('per circuit DS1 total objects - wfDs1TotalIndex corresponds to Wellfleet circuit number')
wfDs1TotalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1TotalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 2), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalESs.setDescription('total count of errored seconds')
wfDs1TotalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalSESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalSESs.setDescription('total count of severely errored seconds')
wfDs1TotalSEFs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalSEFs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalSEFs.setDescription('total count of severely errored framing seconds')
wfDs1TotalUASs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalUASs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalUASs.setDescription('total number of unavailable seconds')
wfDs1TotalBPVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalBPVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalBPVs.setDescription('total count of bipolar violations')
wfDs1TotalCVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 4, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1TotalCVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1TotalCVs.setDescription('total count of code violation error events')
wfDs1FeCurrent = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5), )
if mibBuilder.loadTexts: wfDs1FeCurrent.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrent.setDescription('The DS1 Far End Current table')
wfDs1FeCurrentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1FeCurrentIndex"))
if mibBuilder.loadTexts: wfDs1FeCurrentEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentEntry.setDescription('per circuit DS1 far end current objects wfDs1CurrentIndex corresponds to Wellfleet circuit number')
wfDs1FeCurrentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeCurrentIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1FeCurrentESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeCurrentESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentESs.setDescription('the count of errored seconds in the current interval')
wfDs1FeCurrentSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeCurrentSESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentSESs.setDescription('the count of severely errored seconds in the current interval')
wfDs1FeCurrentSEFs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeCurrentSEFs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentSEFs.setDescription('the count of severely errored framing seconds in the current interval')
wfDs1FeCurrentBPVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeCurrentBPVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentBPVs.setDescription('the count of bipolar violations in the current interval')
wfDs1FeCurrentCVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 5, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeCurrentCVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeCurrentCVs.setDescription('the count of code violation error events in the current interval')
wfDs1FeInterval = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6), )
if mibBuilder.loadTexts: wfDs1FeInterval.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeInterval.setDescription('The DS1 Far End Interval table')
wfDs1FeIntervalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1FeIntervalIndex"), (0, "Wellfleet-DS1-MIB", "wfDs1FeIntervalNumber"))
if mibBuilder.loadTexts: wfDs1FeIntervalEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalEntry.setDescription('per circuit DS1 far end interval objects - wfDs1FeIntervalIndex corresponds to Wellfleet circuit number, wfDs1FeIntervalNumber is the numbered previous 15-minute interval')
wfDs1FeIntervalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1FeIntervalNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 96))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalNumber.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalNumber.setDescription('1..96 where 1 is the most recent 15-minute interval and 96 is the least')
wfDs1FeIntervalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalESs.setDescription('the count of errored seconds in the specified interval')
wfDs1FeIntervalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalSESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalSESs.setDescription('the count of severely errored seconds in the specified interval')
wfDs1FeIntervalSEFs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalSEFs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalSEFs.setDescription('the count of severely errored framing seconds in the specified interval')
wfDs1FeIntervalBPVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalBPVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalBPVs.setDescription('the count of bipolar violations in the specified interval')
wfDs1FeIntervalCVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 6, 1, 7), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeIntervalCVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeIntervalCVs.setDescription('the count of code violation error events in the specified interval')
wfDs1FeTotal = MibTable((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7), )
if mibBuilder.loadTexts: wfDs1FeTotal.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotal.setDescription('The DS1 Far End Total table')
wfDs1FeTotalEntry = MibTableRow((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1), ).setIndexNames((0, "Wellfleet-DS1-MIB", "wfDs1FeTotalIndex"))
if mibBuilder.loadTexts: wfDs1FeTotalEntry.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalEntry.setDescription('per circuit DS1 far end total objects - wfDs1FeTotalIndex corresponds to Wellfleet circuit number')
wfDs1FeTotalIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeTotalIndex.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalIndex.setDescription('this corresponds to the Wellfleet circuit number')
wfDs1FeTotalESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1, 2), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeTotalESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalESs.setDescription('total count of errored seconds')
wfDs1FeTotalSESs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeTotalSESs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalSESs.setDescription('total count of severely errored seconds')
wfDs1FeTotalSEFs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeTotalSEFs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalSEFs.setDescription('total count of severely errored framing seconds')
wfDs1FeTotalBPVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeTotalBPVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalBPVs.setDescription('total count of bipolar violations')
wfDs1FeTotalCVs = MibTableColumn((1, 3, 6, 1, 4, 1, 18, 3, 4, 12, 7, 1, 6), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: wfDs1FeTotalCVs.setStatus('mandatory')
if mibBuilder.loadTexts: wfDs1FeTotalCVs.setDescription('total count of code violation error events')
mibBuilder.exportSymbols("Wellfleet-DS1-MIB", wfDs1FeIntervalNumber=wfDs1FeIntervalNumber, wfDs1Config=wfDs1Config, wfDs1CurrentIndex=wfDs1CurrentIndex, wfDs1TotalSESs=wfDs1TotalSESs, wfDs1FeIntervalIndex=wfDs1FeIntervalIndex, wfDs1IntervalUASs=wfDs1IntervalUASs, wfDs1FeTotalIndex=wfDs1FeTotalIndex, wfDs1FeTotalEntry=wfDs1FeTotalEntry, wfDs1IntervalESs=wfDs1IntervalESs, wfDs1CurrentEntry=wfDs1CurrentEntry, wfDs1CurrentCVs=wfDs1CurrentCVs, wfDs1FeTotalESs=wfDs1FeTotalESs, wfDs1LineStatus=wfDs1LineStatus, wfDs1CurrentBPVs=wfDs1CurrentBPVs, wfDs1FeIntervalSEFs=wfDs1FeIntervalSEFs, wfDs1TotalEntry=wfDs1TotalEntry, wfDs1ValidIntervals=wfDs1ValidIntervals, wfDs1IntervalCVs=wfDs1IntervalCVs, wfDs1FeCurrentEntry=wfDs1FeCurrentEntry, wfDs1IntervalNumber=wfDs1IntervalNumber, wfDs1Interval=wfDs1Interval, wfDs1TotalCVs=wfDs1TotalCVs, wfDs1FeTotal=wfDs1FeTotal, wfDs1CurrentSEFs=wfDs1CurrentSEFs, wfDs1TotalSEFs=wfDs1TotalSEFs, wfDs1CurrentESs=wfDs1CurrentESs, wfDs1LineIndex=wfDs1LineIndex, wfDs1SendCode=wfDs1SendCode, wfDs1IntervalIndex=wfDs1IntervalIndex, wfDs1ZeroCoding=wfDs1ZeroCoding, wfDs1IntervalSESs=wfDs1IntervalSESs, wfDs1CircuitIdentifier=wfDs1CircuitIdentifier, wfDs1FeTotalCVs=wfDs1FeTotalCVs, wfDs1Total=wfDs1Total, wfDs1FeCurrentESs=wfDs1FeCurrentESs, wfDs1FeInterval=wfDs1FeInterval, wfDs1FeTotalSESs=wfDs1FeTotalSESs, wfDs1FeCurrent=wfDs1FeCurrent, wfDs1FeCurrentBPVs=wfDs1FeCurrentBPVs, wfDs1FeTotalSEFs=wfDs1FeTotalSEFs, wfDs1CurrentSESs=wfDs1CurrentSESs, wfDs1IntervalBPVs=wfDs1IntervalBPVs, wfDs1FeIntervalSESs=wfDs1FeIntervalSESs, wfDs1FeIntervalBPVs=wfDs1FeIntervalBPVs, wfDs1FeIntervalCVs=wfDs1FeIntervalCVs, wfDs1FeIntervalEntry=wfDs1FeIntervalEntry, wfDs1ConfigEntry=wfDs1ConfigEntry, wfDs1TimeElapsed=wfDs1TimeElapsed, wfDs1FeTotalBPVs=wfDs1FeTotalBPVs, wfDs1FeCurrentIndex=wfDs1FeCurrentIndex, wfDs1Current=wfDs1Current, wfDs1TotalESs=wfDs1TotalESs, wfDs1CurrentUASs=wfDs1CurrentUASs, wfDs1FeIntervalESs=wfDs1FeIntervalESs, wfDs1FeCurrentSESs=wfDs1FeCurrentSESs, wfDs1LineType=wfDs1LineType, wfDs1TotalUASs=wfDs1TotalUASs, wfDs1TotalIndex=wfDs1TotalIndex, wfDs1IntervalSEFs=wfDs1IntervalSEFs, wfDs1IntervalEntry=wfDs1IntervalEntry, wfDs1FeCurrentSEFs=wfDs1FeCurrentSEFs, wfDs1FeCurrentCVs=wfDs1FeCurrentCVs, wfDs1LoopbackConfig=wfDs1LoopbackConfig, wfDs1TotalBPVs=wfDs1TotalBPVs)
| 116.908654 | 2,309 | 0.782827 | 2,853 | 24,317 | 6.671924 | 0.092885 | 0.080693 | 0.141214 | 0.013449 | 0.58839 | 0.415603 | 0.373785 | 0.35792 | 0.233465 | 0.233465 | 0 | 0.072754 | 0.088827 | 24,317 | 207 | 2,310 | 117.47343 | 0.786343 | 0.013489 | 0 | 0 | 0 | 0.015 | 0.237073 | 0.004587 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.035 | 0 | 0.035 | 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 |
44dea66fc60c0479bc3d1350dae80457f29dfb93 | 1,247 | py | Python | TicTacToe/player.py | Eberhofer/TicTacToe | 6b7c9c49a153499b4c85aa36db1d98ec4a188f2f | [
"MIT"
] | null | null | null | TicTacToe/player.py | Eberhofer/TicTacToe | 6b7c9c49a153499b4c85aa36db1d98ec4a188f2f | [
"MIT"
] | null | null | null | TicTacToe/player.py | Eberhofer/TicTacToe | 6b7c9c49a153499b4c85aa36db1d98ec4a188f2f | [
"MIT"
] | null | null | null | """
player.py - the Player class
------------------------
"""
import TicTacToe.tictactoe as tictactoe
class Player:
""""
Defines a TicTacToe game with an AI opponent.
"""
def __init__(self):
self._winners = tictactoe.winners()
self._state = set()
def play_field(self, field_number):
"""
Alters the state for the player to add the played field_number.
"""
self._state.add(field_number)
def reduce_winners(self, opponent_state):
"""
Recalculates the remaining set of winners based on the opponent_state.
"""
self._winners = tictactoe.reduce_winners(self._winners, opponent_state)
@property
def winners(self):
"""
Returns the set of winners for the player.
"""
return self._winners
@property
def state(self):
"""
Returns the state, i.e. the set of field_numbers played,
for the player.
"""
return self._state
@property
def is_winner(self):
"""
Returns True, if the player has a winning combination and False
otherwise.
"""
return tictactoe.check_win(self._state)
| 24.94 | 82 | 0.567763 | 138 | 1,247 | 4.956522 | 0.376812 | 0.065789 | 0.052632 | 0.052632 | 0.064327 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.327185 | 1,247 | 49 | 83 | 25.44898 | 0.815256 | 0.342422 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.055556 | 0 | 0.611111 | 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 |
44e7d70e593b39a0b1ada7134396318656908dab | 663 | py | Python | solutions/solved008.py | pedraodeveloper66/Najma | f95cf99ac9ef313ba51be35ab5abb6865e7d4efc | [
"MIT"
] | null | null | null | solutions/solved008.py | pedraodeveloper66/Najma | f95cf99ac9ef313ba51be35ab5abb6865e7d4efc | [
"MIT"
] | null | null | null | solutions/solved008.py | pedraodeveloper66/Najma | f95cf99ac9ef313ba51be35ab5abb6865e7d4efc | [
"MIT"
] | null | null | null | """
Write a program that reads a value in meters and displays it converted to centimeters and millimeters
"""
m = float(input('Uma distância em metros: '))
"""Kilometre --> Divide the length value by 1000"""
km = m / 1000
"""Hectometre --> Divide the length value by 100"""
hm = m / 100
"""Decametre --> Divide the length value by 10"""
dam = m / 10
"""Decimetre --> Multiply the length value by 10"""
dm = m * 10
"""Centimetre --> Multiply the length value by 100"""
cm = m * 100
"""Millimetre --> Multiply the length value by 1000"""
mm = m * 1000
print('A medida de {}m corresponde a\n{}km\n{}hm\n{}dam\n{}dm\n{}cm\n{}mm'.format(m, km, hm, dam, dm, cm, mm))
| 33.15 | 110 | 0.651584 | 111 | 663 | 3.891892 | 0.432432 | 0.125 | 0.194444 | 0.222222 | 0.361111 | 0 | 0 | 0 | 0 | 0 | 0 | 0.066055 | 0.177979 | 663 | 19 | 111 | 34.894737 | 0.726606 | 0.152338 | 0 | 0 | 0 | 0.125 | 0.371429 | 0.155102 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.125 | 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 |
44f4455f7b1c431872869b5254723282ae1ed661 | 352 | py | Python | driver.py | sreedom/rabbit-pipeline | 0de713832b5fe89622d8b04509dc52a09ed4fc0c | [
"MIT"
] | 3 | 2017-04-03T07:41:25.000Z | 2022-02-09T18:53:46.000Z | driver.py | sreedom/rabbit-pipeline | 0de713832b5fe89622d8b04509dc52a09ed4fc0c | [
"MIT"
] | null | null | null | driver.py | sreedom/rabbit-pipeline | 0de713832b5fe89622d8b04509dc52a09ed4fc0c | [
"MIT"
] | 1 | 2022-02-09T18:53:39.000Z | 2022-02-09T18:53:39.000Z | ### fake driver
from pipeline import Pipeline
from components import C1, C2, C3
# TODO ^^ or should we use a registry ?
#http://en.wikipedia.org/wiki/Newick_format
# representing pipeline of format C1-C2-C4
# |- C3
pipeline = 'C1(C2(C4),C3)'
leadgen_pipeline = Pipeline.from_newick(pipeline)
leadgen_pipeline.run()
| 23.466667 | 49 | 0.673295 | 48 | 352 | 4.854167 | 0.583333 | 0.051502 | 0.051502 | 0.06867 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0.21875 | 352 | 14 | 50 | 25.142857 | 0.807273 | 0.485795 | 0 | 0 | 0 | 0 | 0.075145 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
780641fe84d0169d12334b7923a0d4f40a7fefb7 | 676 | py | Python | bash/cleanup.py | LaudateCorpus1/Aruba-FlaskwithNetworking | 9af1e626e782ed38d1d58858edaece88e1f76208 | [
"MIT"
] | null | null | null | bash/cleanup.py | LaudateCorpus1/Aruba-FlaskwithNetworking | 9af1e626e782ed38d1d58858edaece88e1f76208 | [
"MIT"
] | null | null | null | bash/cleanup.py | LaudateCorpus1/Aruba-FlaskwithNetworking | 9af1e626e782ed38d1d58858edaece88e1f76208 | [
"MIT"
] | null | null | null | # (C) Copyright 2021 Hewlett Packard Enterprise Development LP.
#!/usr/bin/python3
import schedule
from datetime import date, datetime, time, timedelta
import time
from cleanupclasses import cleanupTrackers as cleanupTrackers
from cleanupclasses import cleanupafcAudit as cleanupafcAudit
from cleanupclasses import cleanupLogging as cleanupLogging
from cleanupclasses import checkSocketserver as checkSocketserver
schedule.every(5).minutes.do(cleanupTrackers)
schedule.every(5).minutes.do(cleanupLogging)
schedule.every(10).seconds.do(checkSocketserver)
schedule.every(5).minutes.do(cleanupafcAudit)
while 1:
schedule.run_pending()
time.sleep(1)
| 33.8 | 66 | 0.807692 | 78 | 676 | 6.987179 | 0.448718 | 0.13211 | 0.176147 | 0.115596 | 0.188991 | 0.146789 | 0 | 0 | 0 | 0 | 0 | 0.020236 | 0.122781 | 676 | 19 | 67 | 35.578947 | 0.89882 | 0.115385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
780a68b29119d46c377be1da43a843e4efdc7887 | 1,251 | py | Python | Exercises/Week4/pexpect_tests.py | netkidd/py-ne | d609b4feeb98deed3d6b5216e73cab2883232693 | [
"Apache-2.0"
] | null | null | null | Exercises/Week4/pexpect_tests.py | netkidd/py-ne | d609b4feeb98deed3d6b5216e73cab2883232693 | [
"Apache-2.0"
] | null | null | null | Exercises/Week4/pexpect_tests.py | netkidd/py-ne | d609b4feeb98deed3d6b5216e73cab2883232693 | [
"Apache-2.0"
] | null | null | null |
import pexpect
from getpass import getpass
'''
3. Use Pexpect to retrieve the output of 'show ip int brief' from pynet-rtr2.
4. Use PExpect to change the logging buffer size (logging buffered <size>) on pynet-rtr2. Verify this change by examining the output of 'show run'.
'''
rtr2_ip = '184.105.247.71'
rtr2_username = 'pyclass'
rtr2_password = getpass()
ssh_conn = pexpect.spawn('ssh -l {} {}'.format(rtr2_username, rtr2_ip))
ssh_conn.timeout = 5
try:
ssh_conn.expect('ssword:')
ssh_conn.sendline(rtr2_password)
ssh_conn.expect('#')
ssh_conn.sendline('terminal length 0')
ssh_conn.expect('#')
ssh_conn.sendline('show ip int brief')
ssh_conn.expect('#')
print ssh_conn.before
except pexpect.TIMEOUT:
print "One pattern was not found and the connection timed out."
print "\n\n!! And now we change the buffer size !!\n\n"
try:
ssh_conn.sendline('configure terminal')
ssh_conn.expect('#')
ssh_conn.sendline('logging buffered 64000')
ssh_conn.expect('#')
ssh_conn.sendline('end')
ssh_conn.expect('#')
ssh_conn.sendline('show run')
ssh_conn.expect('#')
print ssh_conn.before
except pexpect.TIMEOUT:
print "One pattern was not found and the connection timed out."
| 24.057692 | 147 | 0.697842 | 186 | 1,251 | 4.55914 | 0.365591 | 0.15684 | 0.122642 | 0.09434 | 0.412736 | 0.412736 | 0.313679 | 0.238208 | 0.238208 | 0.238208 | 0 | 0.027237 | 0.178257 | 1,251 | 51 | 148 | 24.529412 | 0.797665 | 0 | 0 | 0.483871 | 0 | 0 | 0.284169 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.096774 | 0.064516 | null | null | 0.16129 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
780b542f720112fd50e4308fda987d84f19b0059 | 987 | py | Python | smart_open/tests/test_package.py | sivchand/smart_open | 35d80d3bec5324c19427ce49fa8284f5b1c2c112 | [
"MIT"
] | 2,047 | 2016-06-16T15:35:45.000Z | 2022-03-31T04:32:57.000Z | smart_open/tests/test_package.py | MateLabs/smart-open | 7774087eb979db74f3f61ba5d512f0cc96607d5e | [
"MIT"
] | 524 | 2016-06-16T09:48:14.000Z | 2022-03-30T13:21:25.000Z | smart_open/tests/test_package.py | MateLabs/smart-open | 7774087eb979db74f3f61ba5d512f0cc96607d5e | [
"MIT"
] | 308 | 2016-06-16T09:02:51.000Z | 2022-03-24T20:57:52.000Z | # -*- coding: utf-8 -*-
import os
import unittest
import pytest
from smart_open import open
skip_tests = "SMART_OPEN_TEST_MISSING_DEPS" not in os.environ
class PackageTests(unittest.TestCase):
@pytest.mark.skipif(skip_tests, reason="requires missing dependencies")
def test_azure_raises_helpful_error_with_missing_deps(self):
with pytest.raises(ImportError, match=r"pip install smart_open\[azure\]"):
open("azure://foo/bar")
@pytest.mark.skipif(skip_tests, reason="requires missing dependencies")
def test_aws_raises_helpful_error_with_missing_deps(self):
match = r"pip install smart_open\[s3\]"
with pytest.raises(ImportError, match=match):
open("s3://foo/bar")
@pytest.mark.skipif(skip_tests, reason="requires missing dependencies")
def test_gcs_raises_helpful_error_with_missing_deps(self):
with pytest.raises(ImportError, match=r"pip install smart_open\[gcs\]"):
open("gs://foo/bar")
| 35.25 | 82 | 0.721378 | 133 | 987 | 5.105263 | 0.330827 | 0.066274 | 0.070692 | 0.088365 | 0.705449 | 0.658321 | 0.621502 | 0.56701 | 0.56701 | 0.56701 | 0 | 0.003632 | 0.163121 | 987 | 27 | 83 | 36.555556 | 0.818402 | 0.021277 | 0 | 0.157895 | 0 | 0 | 0.251037 | 0.029046 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157895 | false | 0 | 0.368421 | 0 | 0.578947 | 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 |
7819a57e7f8c80daa178f6ebdb4724fef6140cf9 | 509 | py | Python | sshub_middleware/settings/__init__.py | muhfajar/sshub-middleware | a0f68dafc1bc963998a86fe992ea88f394d89f61 | [
"MIT"
] | null | null | null | sshub_middleware/settings/__init__.py | muhfajar/sshub-middleware | a0f68dafc1bc963998a86fe992ea88f394d89f61 | [
"MIT"
] | null | null | null | sshub_middleware/settings/__init__.py | muhfajar/sshub-middleware | a0f68dafc1bc963998a86fe992ea88f394d89f61 | [
"MIT"
] | null | null | null | import random
from .base import *
try:
from .private import *
except ImportError:
raise ImportError("""
Please create private.py file
with contain configuration for
====================================
SECRET_KEY = '{}'
DEBUG = False
ALLOWED_HOSTS = []
SSHUB_API = 'api-key'
====================================
""".format(''.join([random.SystemRandom().
choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])))
| 26.789474 | 106 | 0.516699 | 43 | 509 | 6.023256 | 0.790698 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030303 | 0.222004 | 509 | 18 | 107 | 28.277778 | 0.623737 | 0 | 0 | 0.125 | 0 | 0 | 0.581532 | 0.239686 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.3125 | 0 | 0.3125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
781af811a56b408c71d1f19a70f24f52c71bcc21 | 612 | py | Python | dvc/remote/gdrive/utils.py | Baranowski/dvc | f91aa0665f6898991af0d617373ed99623b60c4a | [
"Apache-2.0"
] | null | null | null | dvc/remote/gdrive/utils.py | Baranowski/dvc | f91aa0665f6898991af0d617373ed99623b60c4a | [
"Apache-2.0"
] | null | null | null | dvc/remote/gdrive/utils.py | Baranowski/dvc | f91aa0665f6898991af0d617373ed99623b60c4a | [
"Apache-2.0"
] | null | null | null | import os
from dvc.progress import Tqdm
FOLDER_MIME_TYPE = "application/vnd.google-apps.folder"
class TrackFileReadProgress(object):
def __init__(self, progress_name, fobj):
self.progress_name = progress_name
self.fobj = fobj
file_size = os.fstat(fobj.fileno()).st_size
self.tqdm = Tqdm(desc=self.progress_name, total=file_size)
def read(self, size):
self.tqdm.update(size)
return self.fobj.read(size)
def close(self):
self.fobj.close()
self.tqdm.close()
def __getattr__(self, attr):
return getattr(self.fobj, attr)
| 23.538462 | 66 | 0.661765 | 81 | 612 | 4.790123 | 0.419753 | 0.123711 | 0.123711 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.228758 | 612 | 25 | 67 | 24.48 | 0.822034 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 0.055556 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0 | 0.117647 | 0.058824 | 0.529412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
78228c408e9db4c18cd9a997d51a696b806143be | 878 | py | Python | src/commands/jsdoc/generate_jsdoc.py | PranjalPansuriya/JavaScriptEnhancements | 14af4162e86585153cbd4614ad96dff64a0d3192 | [
"MIT"
] | 690 | 2017-04-11T06:45:01.000Z | 2022-03-21T23:20:29.000Z | src/commands/jsdoc/generate_jsdoc.py | PranjalPansuriya/JavaScriptEnhancements | 14af4162e86585153cbd4614ad96dff64a0d3192 | [
"MIT"
] | 74 | 2017-11-22T18:05:26.000Z | 2021-05-05T16:25:31.000Z | src/commands/jsdoc/generate_jsdoc.py | PranjalPansuriya/JavaScriptEnhancements | 14af4162e86585153cbd4614ad96dff64a0d3192 | [
"MIT"
] | 42 | 2017-04-13T10:22:40.000Z | 2021-05-27T19:19:04.000Z | import sublime, sublime_plugin
import os
from ...libs import util
from ...libs import JavascriptEnhancementsExecuteOnTerminalCommand
class JavascriptEnhancementsGenerateJsdocCommand(JavascriptEnhancementsExecuteOnTerminalCommand, sublime_plugin.WindowCommand):
is_node = True
is_bin_path = True
def prepare_command(self):
jsdoc_conf_file = os.path.join(self.settings['project_dir_name'], self.settings['project_settings']['jsdoc']['conf_file'])
if os.path.isfile(jsdoc_conf_file) :
self.command = ["jsdoc", "-c", jsdoc_conf_file]
else :
sublime.error_message("JSDOC ERROR: Can't load "+jsdoc_conf_file+" file!\nConfiguration file REQUIRED!")
return
self._run()
def _run(self):
super(JavascriptEnhancementsGenerateJsdocCommand, self)._run()
def is_enabled(self):
return True if util.is_javascript_project() else False | 32.518519 | 127 | 0.759681 | 102 | 878 | 6.294118 | 0.441176 | 0.070093 | 0.101246 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.137813 | 878 | 27 | 128 | 32.518519 | 0.848085 | 0 | 0 | 0 | 1 | 0 | 0.128555 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157895 | false | 0 | 0.210526 | 0.052632 | 0.631579 | 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 | 0 | 0 | 1 | 0 | 0 | 2 |
7826ee3e13a3ebc6892bfde3e43069172e7d7551 | 451 | py | Python | hg/res/loaders/image_loader.py | V0idExp/mercury | 50cfa6f09c69fd0509d5d549679b56b91720bb73 | [
"MIT"
] | null | null | null | hg/res/loaders/image_loader.py | V0idExp/mercury | 50cfa6f09c69fd0509d5d549679b56b91720bb73 | [
"MIT"
] | 2 | 2021-03-31T19:33:16.000Z | 2021-12-13T20:33:49.000Z | hg/res/loaders/image_loader.py | V0idExp/mercury | 50cfa6f09c69fd0509d5d549679b56b91720bb73 | [
"MIT"
] | null | null | null | import os
import sdl2
from hg.gfx.sprite_renderer.sprite import Image
from .loader import Loader
class ImageLoader(Loader):
def __init__(self, sdl_renderer: sdl2.SDL_Renderer):
self.__renderer = sdl_renderer
def load(self, path):
surface = sdl2.ext.load_image(path)
texture = sdl2.SDL_CreateTextureFromSurface(self.__renderer, surface)
return Image(os.path.basename(path), surface.w, surface.h, texture)
| 23.736842 | 77 | 0.725055 | 59 | 451 | 5.305085 | 0.440678 | 0.105431 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01087 | 0.184035 | 451 | 18 | 78 | 25.055556 | 0.839674 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.181818 | false | 0 | 0.363636 | 0 | 0.727273 | 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 |
7828f97f55e8ef2cb46292bfb5a90355034d3be4 | 5,223 | py | Python | utils/test/expected_values.py | DanielSola/bitcoin-analysis | 1d86ebdc91984403b1dedb99cb74641cd8367066 | [
"MIT"
] | null | null | null | utils/test/expected_values.py | DanielSola/bitcoin-analysis | 1d86ebdc91984403b1dedb99cb74641cd8367066 | [
"MIT"
] | null | null | null | utils/test/expected_values.py | DanielSola/bitcoin-analysis | 1d86ebdc91984403b1dedb99cb74641cd8367066 | [
"MIT"
] | null | null | null | expected_number_of_transactions = [
2650, 2543, 1395, 2751, 2398, 2827, 2737, 3084, 1998, 2997, 976,
1929, 3268, 1904, 1772, 776, 2553, 2547, 2581, 2226, 2307, 2812,
2618, 177, 1538, 1990, 2323, 2613, 2503, 2140, 2542, 2291, 2782,
1994, 2513, 2773, 1359, 1744, 868, 896, 2228, 2300, 2349, 2440,
2562, 2123, 3150, 2564, 1590, 349, 2049, 1978, 2687, 2330, 1492,
1968, 2610, 2228, 1581, 2204, 1837, 2565, 2375, 2422, 1808, 2662,
2760, 1507, 2753, 2067, 2786, 1677, 2622, 2319, 17, 2144, 922, 2123,
2379, 2798, 2197, 2060, 2081, 2257, 2728, 2689, 2103, 2218, 960,
1397, 479, 913, 87, 1682, 2032, 2307, 2579, 229, 817, 1457, 1822,
1353, 907, 912, 1413, 2469, 2293, 2396, 1087, 970, 1363, 2305,
2319, 2192, 2320, 2804, 2936, 2627, 2242, 2068, 2630, 2366, 2494,
2191, 2598, 1933, 1236, 1380, 985, 2507, 2003, 586, 1223, 1120,
2119, 2401, 1706, 739, 1378, 960, 1751, 2553, 2312, 2392
]
expected_block_sizes = [
1340282.0, 1171564.8, 1290236.0, 1374338.4, 1306336.8333333333,
1114189.7272727273, 1334556.3333333333, 1072760.4, 1190087.0,
1316951.0, 1258290.5, 1263454.6666666667, 1261141.25, 1350125.8,
1387607.0, 1215300.1666666667, 828290.3333333334, 1227950.5,
1287358.3333333333, 925557.1666666666, 1215318.111111111,
1523156.4444444445, 1278528.75, 1411428.0, 1315790.6666666667,
1019578.3, 990839.5
]
expected_hourly_transactions = [
2650, 11914, 7819, 11074, 12455,
23563, 7067, 9257, 18048, 2564,
10983, 6070, 7850, 11832, 2760,
13412, 4480, 12479, 14076, 5518,
13503, 15208, 19508, 7490, 6722,
15560, 13791
]
expected_times_between_blocks = [
1612, 93, 242, 1294, 1704, 586, 789, 1969, 403, 228, 116, 23, 2398, 850,
864, 340, 185, 24, 1802, 812, 203, 887, 677, 45, 194, 73, 366, 125, 76,
456, 1035, 236, 1450, 1123, 872, 1669, 110, 725, 186, 10, 85, 291, 252,
279, 1380, 180, 3919, 1201, 218, 102, 791, 257, 233, 1721, 773, 433, 2865,
343, 410, 2042, 285, 121, 1515, 851, 135, 977, 4108, 43, 1585, 177, 249,
759, 1361, 2200, 2, 530, 23, 496, 626, 459, 1125, 1305, 639, 45, 884, 47,
1069, 813, 158, 1963, 122, 239, 21, 443, 158, 1002, 807, 65, 66, 525, 461,
284, 170, 63, 172, 714, 1043, 815, 259, 184, 98, 521, 582, 922, 40, 430, 181,
431, 526, 1225, 829, 1015, 1220, 2161, 175, 1224, 347, 372, 253, 224, 699,
152, 388, 204, 162, 1277, 483, 178, 337, 68, 452, 75, 701
]
expected_transaction_values = [
11383.94878785999, 17308.05367398, 3622.7728769900023, 9633.670801730033,
14826.62779696996, 7259.995884540011, 11203.150786679953, 29506.748038190017,
16576.26348286996, 13175.761536749957, 8641.552318090005, 4003.4319120199984,
25662.060170189954, 10444.260513739988, 7554.059845370009, 4268.25902016,
2472.864963509989, 4077.0395888499947, 12750.97627863001, 12355.883847110006,
2393.240527540009, 8622.960466979994, 5447.26763365, 87.38996292999992,
2605.2993410000067, 1471.356488039999, 3053.277851210003, 2625.0749443800064,
1072.1113604599975, 5041.109816149992, 9713.188765789986, 3266.108440949993,
11768.000924819953, 13569.830664560017, 7538.576938960003, 13569.767463059985,
844.6543596399998, 5331.023938179994, 848.165141919999, 967.1358015199999,
1010.1064013400085, 5567.299901390007, 1625.9675534700016, 2253.125553860004,
7658.386822249995, 8384.54668757001, 19206.147882259953, 4469.351264000007,
1315.0544174199972, 432.19316666, 6127.310503930018, 2066.3867831300004,
1872.9193954999962, 8815.472050029986, 2843.420696440003, 4687.6417044999835,
16042.92928003998, 1382.5175280100018, 8815.100493969989, 14234.330114909988,
1557.5183457699975, 685.3837385100013, 8590.53198090003, 4053.731241960002,
4720.6605097500005, 9639.943570420017, 11608.579181260073, 988.918982430001,
6871.058338240004, 989.8308203200012, 1580.3052625199962, 10245.606500710022,
5184.384621690003, 11088.598342719983, 8.966610300000001, 3152.560446030012,
194.15356827999992, 1916.1249402400003, 2332.781637169996, 1904.5502168199978,
4478.237747329994, 3766.84221378, 2647.122554909998, 1194.9242250000002,
3695.6209336000006, 1154.9818379700005, 9400.906267190016, 6496.324190000008,
1501.6140470199998, 19201.642837140032, 1197.2633540199993, 1833.1202640199983,
78.32123893999999, 1376.2240791900024, 976.7801730400008, 3321.5335948599977,
3486.9283997099947, 129.03544430000005, 1922.221544139999, 2939.189555250006,
5593.631477060008, 2429.757580759996, 2298.759065579999, 703.1883488999998,
1117.6024098399996, 5161.379796689989, 5459.422803130007, 4495.1067846999795,
4045.725931109999, 1516.9282807899995, 854.3813730699983, 1992.721841120003,
4143.047950169987, 5249.556289420004, 1518.8253502700004, 4252.785797819985,
1540.4489411699933, 3430.193032909998, 4144.407905429995, 6595.714538640011,
6396.9363644500345, 9235.605561159991, 8098.343213619993, 11370.341906110016,
1631.5964133900047, 7494.17682190998, 1991.0408088299973, 1646.4867985599997,
5561.463178049983, 1584.26847222, 4428.548573870004, 510.3291968700005,
1558.24513197, 2942.867825329997, 1391.3934453300005, 7026.66253513999,
3573.887328660006, 1833.9685547500019, 4669.513988809994, 587.4164939700005,
2331.6464144200054, 1765.9344505200047, 6876.602656040003, 11012.55110367002
]
| 60.034483 | 81 | 0.745166 | 673 | 5,223 | 5.76523 | 0.937593 | 0.008247 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.824265 | 0.127321 | 5,223 | 86 | 82 | 60.732558 | 0.026986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 |
7833a0aa700f4e72281df682196f90aaade80458 | 282 | py | Python | flask_api_server/conf.py | SaraHan774/NaverDevfestAndroid | 4d01d9612df76216ae4e753ce620b9be04743892 | [
"MIT"
] | null | null | null | flask_api_server/conf.py | SaraHan774/NaverDevfestAndroid | 4d01d9612df76216ae4e753ce620b9be04743892 | [
"MIT"
] | 1 | 2021-06-02T00:02:26.000Z | 2021-06-02T00:02:26.000Z | flask_api_server/conf.py | SaraHan774/NaverFest | aafbcde663de2614e660e651a6cbe31b887663dc | [
"MIT"
] | null | null | null | import json
with open('config.json', 'r') as f:
config = json.load(f)
n_thread = config["DEFAULT"]["THREAD_NUM"]
base_dir = config["DEFAULT"]["BASE_DIR"]
ip = config["DEFAULT"]["SERVER_IP"]
port = config["DEFAULT"]["SERVER_PORT"]
log_path = config["DEFAULT"]["LOGGING_PATH"]
| 23.5 | 44 | 0.680851 | 41 | 282 | 4.487805 | 0.512195 | 0.353261 | 0.206522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113475 | 282 | 11 | 45 | 25.636364 | 0.736 | 0 | 0 | 0 | 0 | 0 | 0.343972 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 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 |
783693de85093969592c5e60bd4509c7753a045e | 5,687 | py | Python | server/scripts/tracking_markers_class2.py | stoddabr/chairbot_ui_rework | 01419e004e37c5a33d5cdbf32fffcacfaea3952c | [
"Apache-2.0"
] | null | null | null | server/scripts/tracking_markers_class2.py | stoddabr/chairbot_ui_rework | 01419e004e37c5a33d5cdbf32fffcacfaea3952c | [
"Apache-2.0"
] | null | null | null | server/scripts/tracking_markers_class2.py | stoddabr/chairbot_ui_rework | 01419e004e37c5a33d5cdbf32fffcacfaea3952c | [
"Apache-2.0"
] | null | null | null | '''
tracking_markers_class
version: 2
changed from version 1/0 to allow for an arbitrary
number of chairs. Instead of verbosely declaring every
chair as a variable in the class, now there is an array
of filenames saved in the self.filenames variable
TODO write a full description of the class
TODO understand the gemoetry used
'''
import cv2
import time
import math
# import socket
# HOST = "127.0.0.1"
# PORT = "9600"
# variables that enable/disable features
WRITE_TO_FILE = False
STREAM_TO_ROBOT = False # stream movement data to the robot
class TrackingCamera(object):
def __init__(self):
# USB-Connected Camera
self.cap = cv2.VideoCapture(0) # 1 for usb camera
# Fiducial Marker Dictionary
self.dictionary = cv2.aruco.getPredefinedDictionary(
cv2.aruco.DICT_4X4_50
)
# Constant relative file path to main.py
self.filePath = './static/chairbot/py/'
# Initialize files using list comprehension
self.numTrackers = 8 # default 8, higher fiducial numbers will be ignored
self.filenames = [
"{}CB0{}.txt".format(self.filePath, str(i))
for i in xrange(self.numTrackers)
]
# test write to all initialized files
columnLabelHeader = "x/ll[0] \t y/ll[1] \t degree \t time"
for filepath in self.filenames:
# Open and Write
with open(filepath, 'w') as f:
f.write(filepath)
f.write('\n')
f.write(columnLabelHeader)
f.write('\n')
return;
# Closing Process
def __del__(self):
self.cap.release()
cv2.destroyAllWindows()
import sys
sys.exit()
return;
# Start a
# def socket_send(self, data):
# s = socket()
# s.bind((HOST, PORT))
# s.send("Hello ")
# with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
# bind server to specific HOST and PORT
# s.bind((HOST, PORT))
# send the payload data to the client
# s.send(data)
# Returns an modified video image with tracking id markers
def process(self):
ret, frame = self.cap.read()
gray = frame
# detectMarkers returns: (corners, ids, rejectedImgPoints)
corners, ids, _ = cv2.aruco.detectMarkers(gray,self.dictionary)
# Checks all fiducials in ditionary
if len(corners) > 0:
# fids corners, findex fiducial index
for (fids, index) in zip(corners, ids):
for corner in fids: # pt => point number
try:
fid = int(index[0]) # defined fiducial id number
# exclude fiducial ids outside of expected range
if (fid >= 0 and fid <= self.numTrackers):
# ll contains (x, y) coordinate of the middle of fiducial
midcords = (corner[0] + corner[1] +corner[2] +corner[3]) \
/4 # average sum of 4 corners
# calculate angle from origin to fiducial center
# average of the top two fiducial corners
topcords = (corner[0] + corner[3]) / 2
# average of the bottome two fiducial corners
botcords = (corner[1] + corner[2]) / 2
# Difference between top and bottom
ydeltacords = topcords - botcords
# Tangent of the y and the x
theta = math.atan2(ydeltacords[1], ydeltacords[0])
# Changes theta from radians to positive degrees (0 to 360 rotating counter-clockwise)
degree = theta * (180 / math.pi) + 180
# draw circle on video stream to mark fiducial as processed
circlesize = 15
cv2.circle(gray,(midcords[0],midcords[1]), circlesize, (0,0,255), -1)
if WRITE_TO_FILE:
# Append data onto corresponding file
filename = self.filenames[int(index[0])]
with open(filename, 'a') as f:
f.write(str(midcords[0])) # x
f.write('\t')
f.write(str(midcords[1])) # y
f.write('\t')
f.write(str(degree)) # angle
f.write('\t')
f.write(str(time.time())) # time
f.write('\t\n')
if STREAM_TO_ROBOT:
# Stream movement commands to robot
# based on localization data
self.robotController.updateRobotLocation(
int(index[0]), # fiducial id
(midcords[0], midcords[1], degree), # x,y,angle location
)
# robotController will send commands to the robot
except IndexError:
pass
# if no corners
if len(corners) > 0:
cv2.aruco.drawDetectedMarkers(gray,corners,ids)
pass
# Turns into image
ret, jpeg = cv2.imencode('.jpg', frame)
return jpeg.tobytes()
| 38.167785 | 114 | 0.497802 | 601 | 5,687 | 4.670549 | 0.392679 | 0.02565 | 0.012825 | 0.00855 | 0.0171 | 0.0171 | 0 | 0 | 0 | 0 | 0 | 0.023715 | 0.421663 | 5,687 | 148 | 115 | 38.425676 | 0.829735 | 0 | 0 | 0.150685 | 0 | 0 | 0.02358 | 0.005627 | 0 | 0 | 0 | 0.013514 | 0 | 0 | null | null | 0.027397 | 0.054795 | 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 |
783abddbbaac7a5863b31798d5073653260d0536 | 589 | py | Python | course_code/section2/1_variables_methods.py | KhrulSergey/AutomatedTesting_233 | f1341cc0370cae5dd40230c4955695937478353d | [
"Apache-2.0"
] | 2 | 2019-10-03T17:26:17.000Z | 2021-05-09T01:00:55.000Z | course_code/section2/1_variables_methods.py | KhrulSergey/AutomatedTesting_233 | f1341cc0370cae5dd40230c4955695937478353d | [
"Apache-2.0"
] | null | null | null | course_code/section2/1_variables_methods.py | KhrulSergey/AutomatedTesting_233 | f1341cc0370cae5dd40230c4955695937478353d | [
"Apache-2.0"
] | null | null | null | a = 5
b = 10
my_variable = 56
any_variable_name = 100
string_variable = "hello"
single_quotes = 'strings can have single quotes'
print(string_variable)
print(my_variable)
# print is a method with one parameter—what we want to print
def my_print_method(my_parameter):
print(my_parameter)
my_print_method(string_variable)
def my_multiplication_method(number_one, number_two):
return number_one * number_two
result = my_multiplication_method(a, b)
print(result)
print(my_multiplication_method(56, 75))
my_print_method(my_multiplication_method('b', 5)) # What would this do?
| 21.035714 | 72 | 0.78438 | 93 | 589 | 4.677419 | 0.408602 | 0.147126 | 0.202299 | 0.068966 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02549 | 0.134126 | 589 | 27 | 73 | 21.814815 | 0.82549 | 0.132428 | 0 | 0 | 0 | 0 | 0.070866 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.117647 | false | 0 | 0 | 0.058824 | 0.176471 | 0.470588 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
7854857e6da56084723ed21419513481babd9d16 | 427 | py | Python | turnero/turnero_app/task.py | Juannauta/Turnero | 4af8186cf95508713ec9bcc076740ffbc40b2bb8 | [
"MIT"
] | null | null | null | turnero/turnero_app/task.py | Juannauta/Turnero | 4af8186cf95508713ec9bcc076740ffbc40b2bb8 | [
"MIT"
] | null | null | null | turnero/turnero_app/task.py | Juannauta/Turnero | 4af8186cf95508713ec9bcc076740ffbc40b2bb8 | [
"MIT"
] | null | null | null |
import time
import redis
import os
import json
from config import celery_app
redis_client = redis.StrictRedis(host=os.environ.get('REDIS_SERVER_HOST'), port=6379, db=0)
@celery_app.task()
def task_notification(pk=None):
"""
the request is very fast and the database does not send answer for this is used sleep
"""
data = json.dumps({"recargar":"{}".format(pk)})
redis_client.publish('nuevo_turno', data) | 25.117647 | 91 | 0.723653 | 65 | 427 | 4.630769 | 0.707692 | 0.059801 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013889 | 0.156909 | 427 | 17 | 92 | 25.117647 | 0.822222 | 0.199063 | 0 | 0 | 0 | 0 | 0.116564 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.5 | 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 |
785b44ee72513401a18215620824fd50461c56e5 | 403 | py | Python | environments/var_voltage_control/voltage_barrier/bowl.py | eddie-atkinson/MAPDN | 8f39b387c5b83825a5747bafc3ab89176313ab32 | [
"MIT"
] | 30 | 2021-10-31T13:23:52.000Z | 2022-03-12T09:06:53.000Z | environments/var_voltage_control/voltage_barrier/bowl.py | eddie-atkinson/MAPDN | 8f39b387c5b83825a5747bafc3ab89176313ab32 | [
"MIT"
] | 9 | 2021-11-15T09:40:08.000Z | 2022-03-17T09:11:04.000Z | environments/var_voltage_control/voltage_barrier/bowl.py | eddie-atkinson/MAPDN | 8f39b387c5b83825a5747bafc3ab89176313ab32 | [
"MIT"
] | 18 | 2021-11-12T03:10:17.000Z | 2022-03-20T18:39:05.000Z | import numpy as np
def bowl(vs, v_ref=1.0, scale=.1):
def normal(v, loc, scale):
return 1 / np.sqrt(2 * np.pi * scale**2) * np.exp( - 0.5 * np.square(v - loc) / scale**2 )
def _bowl(v):
if np.abs(v-v_ref) > 0.05:
return 2 * np.abs(v-v_ref) - 0.095
else:
return - 0.01 * normal(v, v_ref, scale) + 0.04
return np.array([_bowl(v) for v in vs]) | 31 | 98 | 0.523573 | 77 | 403 | 2.662338 | 0.402597 | 0.078049 | 0.073171 | 0.068293 | 0.107317 | 0.107317 | 0 | 0 | 0 | 0 | 0 | 0.08156 | 0.300248 | 403 | 13 | 99 | 31 | 0.64539 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.1 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
7876f195f30152532f5ba50ae1565d9501d01d21 | 273 | py | Python | falmer/schema/middleware.py | sussexstudent/services-api | ae735bd9d6177002c3d986e5c19a78102233308f | [
"MIT"
] | 2 | 2017-04-27T19:35:59.000Z | 2017-06-13T16:19:33.000Z | falmer/schema/middleware.py | sussexstudent/falmer | ae735bd9d6177002c3d986e5c19a78102233308f | [
"MIT"
] | 975 | 2017-04-13T11:31:07.000Z | 2022-02-10T07:46:18.000Z | falmer/schema/middleware.py | sussexstudent/services-api | ae735bd9d6177002c3d986e5c19a78102233308f | [
"MIT"
] | 3 | 2018-05-09T06:42:25.000Z | 2020-12-10T18:29:30.000Z |
import sys
import logging
class SentryMiddleware(object):
def resolve(self, next, root, info, **args):
try:
return next(root, info, **args)
except:
err = sys.exc_info()
logging.error(err)
return err[1]
| 19.5 | 48 | 0.545788 | 31 | 273 | 4.774194 | 0.645161 | 0.108108 | 0.162162 | 0.216216 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005618 | 0.347985 | 273 | 13 | 49 | 21 | 0.825843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.2 | 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 |
788109953bb66958ad0787c84167a89358fe0751 | 453 | py | Python | myapp/decorators.py | menghao2015/MyBlog | 8cc7b74295bfbdfc0f825665c915bf36bbf772fe | [
"MIT"
] | null | null | null | myapp/decorators.py | menghao2015/MyBlog | 8cc7b74295bfbdfc0f825665c915bf36bbf772fe | [
"MIT"
] | null | null | null | myapp/decorators.py | menghao2015/MyBlog | 8cc7b74295bfbdfc0f825665c915bf36bbf772fe | [
"MIT"
] | null | null | null | from functools import wraps
from flask import abort
from flask.ext.login import current_user
from .models import Permission
def permission_required(permission):
def decorators(f):
@wraps(f)
def decorators_function(*args, **kwargs):
if not current_user.can(permission):
abort(403)
return f(*args, **kwargs)
return decorators_function
return decorators
def admin_required(f):
return permission_required(Permission.ADMINISTER)(f)
| 21.571429 | 53 | 0.770419 | 60 | 453 | 5.7 | 0.433333 | 0.052632 | 0.163743 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007732 | 0.143488 | 453 | 20 | 54 | 22.65 | 0.873711 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.266667 | 0.066667 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
7882f7aae1f9a3efd0f9219f4cbaba99eaa426b8 | 232 | py | Python | Taller de Estrucuras de Control Repeticion/Punto01.py | Ricardoppp/Talleres_De_Algoritmos_Ricardo | 784efd97701b640bf8a5168c46ce3c4810ecb3d4 | [
"MIT"
] | null | null | null | Taller de Estrucuras de Control Repeticion/Punto01.py | Ricardoppp/Talleres_De_Algoritmos_Ricardo | 784efd97701b640bf8a5168c46ce3c4810ecb3d4 | [
"MIT"
] | null | null | null | Taller de Estrucuras de Control Repeticion/Punto01.py | Ricardoppp/Talleres_De_Algoritmos_Ricardo | 784efd97701b640bf8a5168c46ce3c4810ecb3d4 | [
"MIT"
] | null | null | null | #punto 1
#entradas
n=int(input("Escriba el primer digito "))
k=int(input("Escriba el primer digito "))
#caja negra y salidas
while True:
n=0
if(k<n):
n=n-1
print(n)
elif(n==k):
print(k)
break | 17.846154 | 41 | 0.568966 | 39 | 232 | 3.384615 | 0.564103 | 0.121212 | 0.227273 | 0.257576 | 0.439394 | 0.439394 | 0 | 0 | 0 | 0 | 0 | 0.018072 | 0.284483 | 232 | 13 | 42 | 17.846154 | 0.777108 | 0.155172 | 0 | 0 | 0 | 0 | 0.257732 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.2 | 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 |
788466dc50026cba1153493f413a98170ae13869 | 11,775 | py | Python | Pinto Python/Cog/nsfw.py | KaroDC/Pinto-Bot-Discord | 2e30fafc8f71969ca062fcd9c27fe9f513da021f | [
"CC0-1.0"
] | null | null | null | Pinto Python/Cog/nsfw.py | KaroDC/Pinto-Bot-Discord | 2e30fafc8f71969ca062fcd9c27fe9f513da021f | [
"CC0-1.0"
] | null | null | null | Pinto Python/Cog/nsfw.py | KaroDC/Pinto-Bot-Discord | 2e30fafc8f71969ca062fcd9c27fe9f513da021f | [
"CC0-1.0"
] | null | null | null | import asyncio
import discord
from discord.ext import commands
import random
import time
from discord \
import Member, Guild
import datetime
from datetime import datetime
from datetime import date
import configparser
import os, os.path
import json
from discord.ext.commands import *
from discord.voice_client import VoiceClient
from discord.utils import get
import youtube_dl
import pytz
import sys
from discord.ext import tasks
import requests
from PIL import Image, ImageDraw, ImageFont, ImageOps, ImageFilter
import sys
import re
import PIL
from io import BytesIO
import urllib3
import urllib.request
import mysql
import re
from mysql import connector
from operator import pow, truediv, mul, add, sub
import aiohttp
import shlex
from discord import Intents
import math
operators = {
'+': add,
'-': sub,
'*': mul,
'/': truediv,
':': truediv
}
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from xml.etree import cElementTree
from packages.all import *
from packages.p_mysql import *
class LEWD(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def help_nsfw(self, ctx):
embed=discord.Embed(title="Help Menu - LEWD", color=0xff0000)
embed.add_field(name="p!fuck <member>",
value="ehm yes...",
inline=False)
embed.add_field(name="p!neko",
value="Meow",
inline=False)
embed.add_field(name="p!yuri",
value="2 girls",
inline=False)
embed.add_field(name="p!yaoi",
value="2 dudes",
inline=False)
embed.add_field(name="p!furry",
value="Hairy stuff",
inline=False)
embed.add_field(name="p!loli",
value="Are you sure you wanna do this?",
inline=False)
embed.add_field(name="p!ass",
value="try it yourself...",
inline=False)
embed.add_field(name="p!tits",
value="try it yourself...",
inline=False)
embed.add_field(name="p!gay",
value="try it yourself...",
inline=False)
embed.add_field(name="p!porn",
value="try it yourself...",
inline=False)
embed.add_field(name="p!bdsm",
value="try it yourself...",
inline=False)
await ctx.send(embed=embed)
@commands.command()
async def fuck(self, ctx, member:discord.Member, *, reason:str="no reason"):
if member is None:
member = ctx.author
embed = discord.Embed(description=f"**{ctx.author.name} does lewd things to {member.name}**", color=0xffc585)
embed.set_image(url="https://i.imgur.com/8Dq3XYt.gif")
embed.timestamp=datetime.utcnow()
await ctx.send(embed=embed)
@commands.command()
async def neko(self, ctx, *, reason:str="no reason"):
embed = discord.Embed(description=f"**{ctx.author.name} rawr**", color=0xffc585)
embed.set_image(url="https://i.pinimg.com/originals/f5/91/1b/f5911b6b69ca9a114372a5cf890807a6.gif")
embed.timestamp=datetime.utcnow()
await ctx.send(embed=embed)
@commands.command()
async def yuri(self, ctx, *, reason:str="no reason"):
embed = discord.Embed(description=f"**Some yuri stuff for {ctx.author.name}**", color=0xffc585)
embed.set_image(url="https://cutewallpaper.org/21/yuri-anime-kiss/Anime-Yuri-GIF-Anime-Yuri-Kissing-Discover-and-Share-GIFs.gif")
embed.timestamp=datetime.utcnow()
await ctx.send(embed=embed)
@commands.command()
async def yaoi(self, ctx, *, reason:str="no reason"):
embed = discord.Embed(description=f"**Some yaoi stuff for {ctx.author.name}**", color=0xffc585)
embed.set_image(url="https://cdn60.picsart.com/184925822000202.gif")
embed.timestamp=datetime.utcnow()
await ctx.send(embed=embed)
@commands.command()
async def furry(self, ctx, *, reason:str="no reason"):
embed = discord.Embed(description=f"**{ctx.author.name} is a furry**", color=0xffc585)
embed.set_image(url="https://i.kym-cdn.com/photos/images/newsfeed/000/803/142/d06.gif")
embed.timestamp=datetime.utcnow()
await ctx.send(embed=embed)
@commands.command()
async def loli(self, ctx, *, reason:str="no reason"):
embed = discord.Embed(description=f"**Are you sure, {ctx.author.name}?**", color=0xffc585)
embed.set_image(url="https://i.makeagif.com/media/7-22-2018/xaUFWn.gif")
embed.timestamp=datetime.utcnow()
await ctx.send(embed=embed)
@commands.command()
async def nudes(self, ctx):
if ctx.channel.is_nsfw():
picture = ["https://cdn.boob.bot/ass/4E39.JPG", "https://cdn.boob.bot/ass/4E1B.JPG", "https://cdn.boob.bot/ass/4C65.JPG", "https://cdn.boob.bot/ass/50A0.JPG", "https://cdn.boob.bot/boobs/4CEF.JPG", "https://cdn.boob.bot/boobs/8000CDDB.gif", "https://cdn.boob.bot/boobs/8000231D.gif", "https://cdn.boob.bot/boobs/8000D5BA.gif", "https://cdn.boob.bot/boobs/80004334.gif", "https://cdn.boob.bot/boobs/80004FEB.gif", "https://cdn.boob.bot/boobs/80011BF6.jpg", "https://cdn.boob.bot/boobs/80004771.gif"]
ranpunch = random.choice(picture)
punch1 = embed = discord.Embed(description=f"**Here You Go!**", color=0xffc585)
embed.set_image(url=ranpunch)
embed.timestamp=datetime.utcnow()
punch1 = await ctx.send(embed=embed)
else:
embed = discord.Embed(title="NSFW ONLY", value=f"Bitte benutze diesen Command in einem NSFW Channel", color=0xff0000)
embed.set_image(url="https://cdn.discordapp.com/attachments/706129830441386074/783737666902294579/oe4iK5i.gif")
await ctx.send(embed=embed)
@commands.command()
async def gay(self, ctx):
if ctx.channel.is_nsfw():
picture = ["https://cdn.boob.bot/gay/EBE6.jpg", "https://cdn.boob.bot/gay/844E.jpg", "https://cdn.boob.bot/gay/844E.jpg", "https://cdn.boob.bot/gay/844E.jpg", "https://cdn.boob.bot/gay/201BE.jpeg", "https://cdn.boob.bot/gay/350F6.jpg", "https://cdn.boob.bot/gay/30498.jpg", "https://cdn.boob.bot/gay/2B086.jpg", "https://cdn.boob.bot/gay/1C94C.JPG", "https://cdn.boob.bot/gay/160E8.jpg", "https://cdn.boob.bot/gay/334CE.jpg", "https://cdn.boob.bot/gay/1BB5A.png", "https://cdn.boob.bot/gay/3414A.jpg", "https://cdn.boob.bot/gay/2D2CA.jpg"]
ranpunch = random.choice(picture)
punch1 = embed = discord.Embed(description=f"**{ctx.author.mention}, here are your Pics**", color=0xffc585)
embed.set_image(url=ranpunch)
embed.timestamp=datetime.utcnow()
punch1 = await ctx.send(embed=embed)
else:
embed = discord.Embed(title="NSFW ONLY", value=f"Bitte benutze diesen Command in einem NSFW Channel", color=0xff0000)
embed.set_image(url="https://cdn.discordapp.com/attachments/706129830441386074/783737666902294579/oe4iK5i.gif")
await ctx.send(embed=embed)
@commands.command()
async def porn(self, ctx):
if ctx.channel.is_nsfw():
picture = ["https://cdn.boob.bot/Gifs/15DC.gif", "https://cdn.discordapp.com/attachments/815017955375972362/815020598618226698/22631947.gif", "https://cdn.discordapp.com/attachments/815017955375972362/815020577315880980/01f00a2b8bae7a62431eb6bbe6d74de4.gif", "https://cdn.discordapp.com/attachments/815017955375972362/815020614837862460/aurielee-summers-and-malena-morgan-rimjob.gif", "https://cdn.discordapp.com/attachments/815017955375972362/815020636778135572/unnamed.gif", "https://cdn.discordapp.com/attachments/815017955375972362/815020933626069002/ezgif-4-e45259496796.gif", "https://cdn.discordapp.com/attachments/815017955375972362/815020965733203998/ezgif-7-d9aaa925c435.gif", "https://cdn.boob.bot/Gifs/195D.gif", "https://cdn.boob.bot/Gifs/165A.gif", "https://cdn.boob.bot/Gifs/194F.gif", "https://cdn.boob.bot/Gifs/199F.gif", "https://cdn.boob.bot/Gifs/195A.gif", "https://cdn.boob.bot/Gifs/16ED.gif", "https://cdn.boob.bot/Gifs/17EE.gif", "https://cdn.boob.bot/Gifs/196C.gif", "https://cdn.boob.bot/Gifs/1615.gif", "https://cdn.boob.bot/Gifs/15C0.gif", "https://cdn.boob.bot/Gifs/16F3.gif", "https://cdn.boob.bot/Gifs/15F6.gif", "https://cdn.boob.bot/Gifs/16EA.gif", "https://cdn.boob.bot/Gifs/18D1.gif", "https://cdn.boob.bot/Gifs/176F.gif", "https://cdn.boob.bot/Gifs/16AC.gif", "https://cdn.boob.bot/Gifs/1772.gif", "https://cdn.boob.bot/Gifs/1772.gif", "https://cdn.boob.bot/Gifs/18A4.gif", "https://cdn.boob.bot/Gifs/1982.gif", "https://cdn.boob.bot/Gifs/17E2.gif", "https://cdn.boob.bot/Gifs/17BC.gif", "https://cdn.boob.bot/Gifs/16CD.gif", "https://cdn.boob.bot/Gifs/1866.gif", "https://cdn.boob.bot/Gifs/16A6.gif", "https://cdn.boob.bot/Gifs/1959.gif", "https://cdn.boob.bot/Gifs/16BA.gif", "https://cdn.boob.bot/Gifs/19B4.gif", "https://cdn.boob.bot/Gifs/15F9.gif", "https://cdn.boob.bot/Gifs/15C3.gif", "https://cdn.boob.bot/Gifs/1889.gif", "https://cdn.boob.bot/Gifs/18FB.gif", "https://cdn.boob.bot/Gifs/1849.gif", "https://cdn.boob.bot/Gifs/166D.gif", "https://cdn.boob.bot/Gifs/15F8.gif", "https://cdn.boob.bot/Gifs/17AE.gif", "https://cdn.boob.bot/Gifs/1896.gif", "https://cdn.boob.bot/Gifs/15E6.gif"]
ranpunch = random.choice(picture)
punch1 = embed = discord.Embed(description=f"**The usual shit**", color=0xffc585)
embed.set_image(url=ranpunch)
embed.timestamp=datetime.utcnow()
punch1 = await ctx.send(embed=embed)
else:
embed = discord.Embed(title="NSFW ONLY", value=f"Bitte benutze diesen Command in einem NSFW Channel", color=0xff0000)
embed.set_image(url="https://cdn.discordapp.com/attachments/706129830441386074/783737666902294579/oe4iK5i.gif")
await ctx.send(embed=embed)
@commands.command()
async def bdsm(self, ctx):
if ctx.channel.is_nsfw():
picture = ["https://cdn.boob.bot/Gifs/160F.gif", "https://cdn.boob.bot/bdsm/8EAD.jpg", "https://cdn.boob.bot/bdsm/4542.JPG", "https://cdn.boob.bot/bdsm/5D2F.jpg", "https://cdn.boob.bot/bdsm/BEAA.gif", "https://cdn.boob.bot/bdsm/8CA0.png", "https://cdn.boob.bot/bdsm/D4AD.jpg", "https://cdn.boob.bot/bdsm/45CE.jpg", "https://cdn.boob.bot/bdsm/9BAA.jpg", "https://cdn.boob.bot/bdsm/9BAA.jpg", "https://cdn.boob.bot/bdsm/78CD.gif", "https://cdn.boob.bot/bdsm/CF35.jpg", "https://cdn.boob.bot/bdsm/7CA1.jpg", "https://cdn.boob.bot/bdsm/4358.JPG", "https://cdn.boob.bot/bdsm/C2E7.jpg", "https://cdn.boob.bot/bdsm/BF36.jpg"]
ranpunch = random.choice(picture)
punch1 = embed = discord.Embed(description=f"**{ctx.author.mention} MASTER!!!!**", color=0xffc585)
embed.set_image(url=ranpunch)
embed.timestamp=datetime.utcnow()
punch1 = await ctx.send(embed=embed)
else:
embed = discord.Embed(title="NSFW ONLY", value="Bitte benutze diesen Command in einem NSFW Channel", color=0xff0000)
embed.set_image(url="https://cdn.discordapp.com/attachments/706129830441386074/783737666902294579/oe4iK5i.gif")
await ctx.send(embed=embed)
def setup(client):
client.add_cog(LEWD(client))
| 60.076531 | 2,143 | 0.639745 | 1,573 | 11,775 | 4.764781 | 0.195168 | 0.097131 | 0.129686 | 0.162108 | 0.718746 | 0.699666 | 0.508205 | 0.442562 | 0.427618 | 0.416278 | 0 | 0.084468 | 0.195669 | 11,775 | 195 | 2,144 | 60.384615 | 0.706895 | 0 | 0 | 0.436464 | 0 | 0.027624 | 0.432556 | 0.003886 | 0 | 0 | 0.010363 | 0 | 0 | 1 | 0.01105 | false | 0 | 0.226519 | 0 | 0.243094 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7886def95476186404819508e08c26b97962162b | 285 | py | Python | test/linkage-agent/manual/run_small_test_with_matches-single-schema.py | greshje/linkage-agent-tools | bc3a041c74cfe96950a0e3c011dd6a0185ad912d | [
"Apache-2.0"
] | 1 | 2020-06-25T19:57:56.000Z | 2020-06-25T19:57:56.000Z | test/linkage-agent/manual/run_small_test_with_matches-single-schema.py | greshje/linkage-agent-tools | bc3a041c74cfe96950a0e3c011dd6a0185ad912d | [
"Apache-2.0"
] | null | null | null | test/linkage-agent/manual/run_small_test_with_matches-single-schema.py | greshje/linkage-agent-tools | bc3a041c74cfe96950a0e3c011dd6a0185ad912d | [
"Apache-2.0"
] | null | null | null | import test_util.linkage.run_full_linkage_test as flt
def run_test():
print("Starting test...")
flt.run_full_linkage_test("test-data/envs/small-no-households-with-matches-single-schema/config.json")
print("Done with test")
if __name__ == "__main__":
run_test()
| 17.8125 | 106 | 0.719298 | 42 | 285 | 4.47619 | 0.619048 | 0.074468 | 0.148936 | 0.191489 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14386 | 285 | 15 | 107 | 19 | 0.770492 | 0 | 0 | 0 | 0 | 0.142857 | 0.395018 | 0.259786 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | true | 0 | 0.142857 | 0 | 0.285714 | 0.285714 | 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 |
789851294dd8964c382766b8bcbe878892ade4a7 | 2,030 | py | Python | dogs/migrations/0004_event_owner.py | Shovatandukar/dog-meetup-backend | 3ee3bf3dcf8c2f2debd7f65daffdd04ed8b4f0e2 | [
"MIT"
] | null | null | null | dogs/migrations/0004_event_owner.py | Shovatandukar/dog-meetup-backend | 3ee3bf3dcf8c2f2debd7f65daffdd04ed8b4f0e2 | [
"MIT"
] | null | null | null | dogs/migrations/0004_event_owner.py | Shovatandukar/dog-meetup-backend | 3ee3bf3dcf8c2f2debd7f65daffdd04ed8b4f0e2 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.8 on 2021-10-31 02:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('dogs', '0003_auto_20210928_2058'),
]
operations = [
migrations.CreateModel(
name='Owner',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_name', models.CharField(max_length=100)),
('last_name', models.CharField(max_length=100)),
('address', models.CharField(max_length=100)),
('email', models.CharField(max_length=100)),
('phone', models.CharField(max_length=100)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owners', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-id'],
},
),
migrations.CreateModel(
name='Event',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('activity', models.CharField(max_length=100)),
('location', models.CharField(max_length=100)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-id'],
},
),
]
| 41.428571 | 144 | 0.580296 | 206 | 2,030 | 5.524272 | 0.364078 | 0.105448 | 0.126538 | 0.168717 | 0.673111 | 0.578207 | 0.523726 | 0.523726 | 0.453427 | 0.453427 | 0 | 0.037645 | 0.280296 | 2,030 | 48 | 145 | 42.291667 | 0.741273 | 0.022167 | 0 | 0.428571 | 1 | 0 | 0.095814 | 0.011599 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.142857 | 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 |
78b1c9766b7e64ef672c2a82990fc34ee71a9182 | 1,896 | py | Python | src/modules/database.py | HorizonKinen/YoutubeToBilibili | 3203741ef29cd3ef56b4e86d88b41d02da9c405b | [
"WTFPL"
] | 22 | 2021-04-01T03:25:45.000Z | 2021-11-07T12:21:01.000Z | src/modules/database.py | HarukaKinen/YoutubeToBilibili | f980f24a4a641016d888658bfba509c4d80be155 | [
"WTFPL"
] | 3 | 2021-01-30T08:21:22.000Z | 2021-01-31T11:14:47.000Z | src/modules/database.py | HorizonKinen/YoutubeToBilibili | 3203741ef29cd3ef56b4e86d88b41d02da9c405b | [
"WTFPL"
] | 8 | 2021-04-02T10:54:56.000Z | 2021-11-18T19:48:44.000Z | import enum
from sqlalchemy import Column, String, Integer, create_engine, insert
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.ext.declarative import declarative_base
from .config import config
config.read()
base = declarative_base()
def create_session(user, password, host, database_name):
try:
engine = create_engine(f"mysql+mysqlconnector://{user}:{password}@{host}:3306/{database_name}")
se = sessionmaker(bind=engine, autocommit=True, autoflush=True)
# https://farer.org/2017/10/28/sqlalchemy_scoped_session
session = scoped_session(se)
return session
except:
pass
@enum.unique
class status(enum.IntEnum):
new, downloaded, uploaded, error = range(1, 5)
class channel(base):
__tablename__ = "channel"
channel_id = Column(String(255), primary_key=True)
subscribe_mode = Column(String(255))
type = Column(Integer)
@classmethod
def add_channel(cls, **kwargs):
channel = cls(**kwargs)
se.add(channel)
class task(base):
__tablename__ = "task"
id = Column(String(255), primary_key=True)
status = Column(Integer, default=status.new.value)
@classmethod
def add_task(cls, **kwargs):
task = cls(**kwargs)
se.add(task)
@classmethod
def get_task_status(cls, status):
return se.query(cls).filter(cls.status == status).all()
def get_video_id(self):
return self.id
def get_video_status(self):
return self.status
class channel_type(base):
__tablename__ = "channel_type"
row_ = Column(Integer, primary_key=True, autoincrement=True, default=1)
tag = Column(String(255))
category_id = Column(Integer, default=0)
description_length = Column(Integer, default=2000)
se = create_session(config.database_user, config.database_password, config.database_host, config.database_name) | 29.625 | 111 | 0.699367 | 237 | 1,896 | 5.400844 | 0.35865 | 0.046875 | 0.046875 | 0.026563 | 0.048438 | 0.048438 | 0.048438 | 0 | 0 | 0 | 0 | 0.020793 | 0.188291 | 1,896 | 64 | 111 | 29.625 | 0.810916 | 0.028481 | 0 | 0.061224 | 0 | 0 | 0.04943 | 0.036936 | 0 | 0 | 0 | 0 | 0 | 1 | 0.122449 | false | 0.081633 | 0.102041 | 0.061224 | 0.632653 | 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 |
78b9348b92d0ea4267dcf99bdf1ee4caa57ef2c3 | 1,452 | py | Python | main.py | luozhaoyu/poc-aws | f0f83a52ab28db785f855adbceadd96ded1ad64e | [
"MIT"
] | null | null | null | main.py | luozhaoyu/poc-aws | f0f83a52ab28db785f855adbceadd96ded1ad64e | [
"MIT"
] | null | null | null | main.py | luozhaoyu/poc-aws | f0f83a52ab28db785f855adbceadd96ded1ad64e | [
"MIT"
] | null | null | null | import socket
import MySQLdb
import config
def do_mysql(host, user, passwd, dbname):
print host, user, passwd, dbname
content = ""
try:
# connect
db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname)
cursor = db.cursor()
# execute SQL select statement
cursor.execute("show databases")
# commit your changes
db.commit()
# get the number of rows in the resultset
numrows = int(cursor.rowcount)
# get and display one row at a time.
for x in range(0,numrows):
row = cursor.fetchone()
content += "%s\n" % row
except MySQLdb.OperationalError as e:
return "%s: AWS RDS may not set up correctly, check host %s" % (e, host)
return content
def main():
HOST, PORT = '', 8888
listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listen_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listen_socket.bind((HOST, PORT))
listen_socket.listen(1)
print 'Serving HTTP on port %s ...' % PORT
basic = do_mysql(**config.mysql_config)
print basic
while True:
client_connection, client_address = listen_socket.accept()
request = client_connection.recv(1024)
print request
http_response = do_mysql(**config.mysql_config)
client_connection.sendall(http_response)
client_connection.close()
main()
| 26.888889 | 80 | 0.637052 | 183 | 1,452 | 4.939891 | 0.508197 | 0.066372 | 0.030973 | 0.044248 | 0.053097 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010319 | 0.26584 | 1,452 | 53 | 81 | 27.396226 | 0.837711 | 0.09022 | 0 | 0 | 0 | 0 | 0.073004 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.085714 | 0.085714 | null | null | 0.114286 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
78baaa23dc63dd326173e40105e3cda865d11d80 | 525 | py | Python | tplogtools/timetools.py | Travelport-Czech/tplogtools | c649001929760d11aadaaf713793f01e48c31e80 | [
"MIT"
] | null | null | null | tplogtools/timetools.py | Travelport-Czech/tplogtools | c649001929760d11aadaaf713793f01e48c31e80 | [
"MIT"
] | null | null | null | tplogtools/timetools.py | Travelport-Czech/tplogtools | c649001929760d11aadaaf713793f01e48c31e80 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Extended tools for datetime"""
import datetime
def how_many_seconds_to_time(now, hour, minute):
"""Return amount seconds from now to given hour and minute"""
target_time = now.replace(hour=hour, minute=minute, second=0)
if now >= target_time:
target_time += datetime.timedelta(days=1)
return int((target_time - now).total_seconds())
def local_tz_now():
"""Return current time with local timezone"""
return datetime.datetime.now(datetime.timezone.utc).astimezone()
| 32.8125 | 68 | 0.71619 | 74 | 525 | 4.932432 | 0.540541 | 0.109589 | 0.071233 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006787 | 0.158095 | 525 | 15 | 69 | 35 | 0.819005 | 0.27619 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
78c8e742fe95e9b7db7d7168d536b80e816955f9 | 719 | py | Python | staff/views.py | kamiswin/body | 70d8df770bab372ab6b1cb0bd96b1cbe2a03816f | [
"BSD-3-Clause"
] | null | null | null | staff/views.py | kamiswin/body | 70d8df770bab372ab6b1cb0bd96b1cbe2a03816f | [
"BSD-3-Clause"
] | null | null | null | staff/views.py | kamiswin/body | 70d8df770bab372ab6b1cb0bd96b1cbe2a03816f | [
"BSD-3-Clause"
] | null | null | null | # coding:utf-8
from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import models
from django.contrib.auth.models import User
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django import forms
from django.template import RequestContext
from django.http import HttpResponseRedirect,HttpResponse,Http404
from django.db import models
from django.shortcuts import render_to_response,HttpResponse,render
from django.core.mail import send_mail
from staff.models import Staff
def show_staff(req):
staffs = Staff.objects.all()
return render_to_response('staff/show_staff.html',{'staffs':staffs}) | 31.26087 | 72 | 0.826147 | 101 | 719 | 5.80198 | 0.405941 | 0.204778 | 0.116041 | 0.107509 | 0.112628 | 0.112628 | 0 | 0 | 0 | 0 | 0 | 0.00624 | 0.108484 | 719 | 23 | 72 | 31.26087 | 0.907956 | 0.01669 | 0 | 0 | 0 | 0 | 0.038244 | 0.029745 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0 | 0.8125 | 0 | 0.9375 | 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 |
78c915234305db0bbc2e4f726adf2a0d2c6d50ef | 2,119 | py | Python | datacollector/gasMassFlow.py | IKKUengine/EtaNetPythonClients | 509e37fc4592f5f52f880b62f7034f46afca1384 | [
"MIT"
] | 2 | 2020-02-11T11:51:38.000Z | 2020-02-11T11:51:40.000Z | datacollector/gasMassFlow.py | IKKUengine/EtaNetPythonClients | 509e37fc4592f5f52f880b62f7034f46afca1384 | [
"MIT"
] | 1 | 2020-02-11T11:49:46.000Z | 2020-02-11T11:49:46.000Z | datacollector/gasMassFlow.py | IKKUengine/CHPefficiency | 509e37fc4592f5f52f880b62f7034f46afca1384 | [
"MIT"
] | 1 | 2021-07-06T07:41:50.000Z | 2021-07-06T07:41:50.000Z |
from connections import i2cAdafruitConnection
from observer import observe
import parameter
import datetime
class MassFlow(i2cAdafruitConnection.I2cAdafruitConnection, observe.Observer):
dataStr = "'NaN'"
headerStr = "'Gas Mass Flow [kg/h]'"
def __init__(self, observable):
# rs232Connection.Rs232Connection.__init__()
#observe.Observer.__init__(observable)
i2cAdafruitConnection.I2cAdafruitConnection.__init__(self)
observe.Observer.__init__(self, observable)
def notifyData(self):
return self.dataStr
def notifyHeader(self):
return self.headerStr
def request(self):
try:
# Read all the ADC channel values in a list.
values = [0] * 4
# for i in range(4):
# Read the specified ADC channel using the previously set gain value.
values[0] = self.adc.read_adc(0, gain=self.GAIN)
powerTs = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
# values[1] = adc.read_adc(1, gain=GAIN)
# values[2] = adc.read_adc(2, gain=GAIN)
# values[3] = adc.read_adc(3, gain=GAIN)
# Note you can also pass in an optional data_rate parameter that controls
# the ADC conversion time (in samples/second). Each chip has a different
# set of allowed data rate values, see datasheet Table 9 config register
# DR bit values.
# values[i] = adc.read_adc(i, gain=GAIN, data_rate=128)
# Each value will be a 16 bit signed integer value depending on the
# ADC (ADS1115 = 16-bit).
# Calculation and calibration of the gas fuel flow
fuelflow = (values[0]) / (3276.8) * 4.2 * 0.046166667 * 0.82615
#print (fuelflow)
except:
print ("Gas Mass Flow Sensor is switched off!")
try:
self.dataStr = "{:8.6f}".format(fuelflow)
except:
pass
def getHeader(self):
return self.headerStr
def getData(self):
return self.dataStr
| 36.534483 | 85 | 0.600283 | 254 | 2,119 | 4.901575 | 0.452756 | 0.028112 | 0.040161 | 0.033735 | 0.041767 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040844 | 0.306748 | 2,119 | 58 | 86 | 36.534483 | 0.806671 | 0.360547 | 0 | 0.266667 | 0 | 0 | 0.065819 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.033333 | 0.133333 | 0.133333 | 0.566667 | 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 | 0 | 1 | 1 | 0 | 0 | 2 |
78ccbde6924e77a681ffb84db3b66ae7153e8b8a | 2,626 | py | Python | course.py | edunham/classes | 6dd190d6231a7251f2f83175ea71f0700a899289 | [
"MIT"
] | null | null | null | course.py | edunham/classes | 6dd190d6231a7251f2f83175ea71f0700a899289 | [
"MIT"
] | null | null | null | course.py | edunham/classes | 6dd190d6231a7251f2f83175ea71f0700a899289 | [
"MIT"
] | null | null | null | class course(Object):
def __init__(self, subject, number, prereqs, credits):
self.subject = subject
self.number = number
self.priority = 1
self.prereqs = prereqs
self.credits = credits
self.terms = [fall, winter, spring]
def display(self):
print(self.subject + str(self.number) + " for " + str(self.credits) +" credits with weight "+str(self.priority)+ " \n")
def weight(self, num):
w = self.priority
self.priority = w+num
print "i am "+self.subject+str(self.number)+" and my initial weight is "+str(self.priority)+"\n"
for c in self.prereqs:
c.weight(self.priority)
def get_weight(self):
return self.priority
class term(Object):
def __init__(self, cr_min, cr_max, season, year):
self.classes = []
self.cr_min = cr_min
self.cr_max = cr_max
self.season = season
self.year = year
self.cr_sum = 0
def can_take(self, course):
if (self.season in course.terms) and (self.cr_sum+course.credits<=self.cr_max):
for p in course.prereqs:
if (p in ranked_courses) or (p in self.classes):
return False
return True
return False
def schedule(self, course):
self.classes.append(course)
self.cr_sum = self.cr_sum + course.credits
class Scheduler(Object):
# TODO: pick interface with rest of world; get data in; split out printing
def __init__(self):
pass
def schedule(self):
# WEIGHTING
heaviest = 0
i = len(schedule_these)-1
print "i= "+str(i)+"\n"
while(i>=0):
schedule_these[i].display()
schedule_these[i].weight(0)
if schedule_these[i].priority > heaviest:
heaviest = schedule_these[i].priority
i=i-1
print("---------------------------\n")
for c in schedule_these:
c.display()
# SORTING... there's probably a more Pythonic way to do this
j = len(schedule_these)-1
ranked_courses = []
while (j>=0):
for c in schedule_these:
if c.priority == heaviest:
ranked_course.append(c)
heaviest = heaviest-1
#SCHEDULING
for t in terms_available:
for c in ranked_courses:
if t.can_take(c):
t.schedule(c)
ranked_courses.remove(c)
if t.credit_sum==t.credit_max:
break
def print(self):
pass
| 35.013333 | 127 | 0.546078 | 328 | 2,626 | 4.243902 | 0.27439 | 0.034483 | 0.017241 | 0.024425 | 0.093391 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00579 | 0.342346 | 2,626 | 74 | 128 | 35.486486 | 0.800232 | 0.057502 | 0 | 0.088235 | 0 | 0 | 0.038866 | 0.011741 | 0 | 0 | 0 | 0.013514 | 0 | 0 | null | null | 0.029412 | 0 | null | null | 0.073529 | 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 |
78d65d7fce864b07f49cabf258f8bf48115d34f3 | 1,411 | py | Python | dungeon/levels/stacking.py | tipishev/python_debugging_workshop | 92ccc7b2e71ed38bcabdf6f0ced206ab4956a1cf | [
"Unlicense"
] | 13 | 2019-11-01T09:24:01.000Z | 2021-11-03T18:37:06.000Z | dungeon/levels/stacking.py | tipishev/python_debugging_workshop | 92ccc7b2e71ed38bcabdf6f0ced206ab4956a1cf | [
"Unlicense"
] | null | null | null | dungeon/levels/stacking.py | tipishev/python_debugging_workshop | 92ccc7b2e71ed38bcabdf6f0ced206ab4956a1cf | [
"Unlicense"
] | 1 | 2021-05-12T04:28:01.000Z | 2021-05-12T04:28:01.000Z | from mechanics import check_password
_ = None
class LostInLegacyCode(Exception):
''' and another one bites the dust of this ancient code '''
MAYBE_HINT_1 = "When lazy and don't know go to Stack O......."
MAYBE_HINT_2 = "Hints' wording is a silly whim, my favourite editor is V.."
MAYBE_HINT_3 = "Could it be a real hint? When debugging don't use p...."
def check_stacking_password(player):
return check_password(player, '129e8109f319870e328cc7a1d5b5cae3')
def that_one_module(player, hint): # unwillingly (s)tep in..
_ # check (w)here you are
_ # this is the rock bottom
_ # but you can still go (u)p and (d)own
_ #
_ # the real hint is `(u)p 2` levels, just (a)sk `locals()`
return player # put the hint in your inventory before goi(n)g up!
def legacy_from_3_years_ago(player, hint):
# it gets only wor(s)e
return that_one_module(player, MAYBE_HINT_3)
def your_last_summer_code(player, hint):
# it doe(s)n't end here!
return legacy_from_3_years_ago(player, hint=MAYBE_HINT_2)
def stacking_corridor(player): # you (s)tep in
# and (s)lip into...
player = your_last_summer_code(player, hint=MAYBE_HINT_1)
if check_stacking_password(player): # what's (n)ext?
# Excellent!
player.inventory.append('amulet of stacking')
return player # press q to (q)uit
raise LostInLegacyCode('Your mind overflows')
| 28.795918 | 75 | 0.691708 | 223 | 1,411 | 4.183857 | 0.497758 | 0.057878 | 0.021436 | 0.057878 | 0.122187 | 0.122187 | 0.062165 | 0 | 0 | 0 | 0 | 0.02681 | 0.206945 | 1,411 | 48 | 76 | 29.395833 | 0.806971 | 0.274274 | 0 | 0.08 | 0 | 0 | 0.226096 | 0.031873 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.16 | 0.04 | 0.12 | 0.48 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 |
1529a475c71647ffe54fb8b937d4b12c9992baed | 5,475 | py | Python | release/src-rt-6.x.4708/router/samba3/source4/auth/credentials/tests/bind.py | zaion520/ATtomato | 4d48bb79f8d147f89a568cf18da9e0edc41f93fb | [
"FSFAP"
] | 2 | 2019-01-13T09:19:10.000Z | 2019-02-15T01:21:02.000Z | release/src-rt-6.x.4708/router/samba3/source4/auth/credentials/tests/bind.py | zaion520/ATtomato | 4d48bb79f8d147f89a568cf18da9e0edc41f93fb | [
"FSFAP"
] | null | null | null | release/src-rt-6.x.4708/router/samba3/source4/auth/credentials/tests/bind.py | zaion520/ATtomato | 4d48bb79f8d147f89a568cf18da9e0edc41f93fb | [
"FSFAP"
] | 2 | 2020-03-08T01:58:25.000Z | 2020-12-20T10:34:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is unit with tests for LDAP access checks
import optparse
import sys
import base64
import re
import os
import copy
import time
sys.path.insert(0, "bin/python")
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/python")
import samba.getopt as options
from ldb import (
SCOPE_BASE, SCOPE_SUBTREE, LdbError, ERR_NO_SUCH_OBJECT)
from samba.dcerpc import security
from samba.auth import system_session
from samba import gensec
from samba.samdb import SamDB
from samba.credentials import Credentials
import samba.tests
from samba.tests import delete_force
from subunit.run import SubunitTestRunner
import unittest
parser = optparse.OptionParser("ldap [options] <host>")
sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
# use command line creds if available
credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
opts, args = parser.parse_args()
if len(args) < 1:
parser.print_usage()
sys.exit(1)
host = args[0]
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
creds_machine = copy.deepcopy(creds)
creds_user1 = copy.deepcopy(creds)
creds_user2 = copy.deepcopy(creds)
creds_user3 = copy.deepcopy(creds)
class BindTests(samba.tests.TestCase):
info_dc = None
def setUp(self):
super(BindTests, self).setUp()
# fetch rootDSEs
if self.info_dc is None:
res = ldb.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
self.assertEquals(len(res), 1)
BindTests.info_dc = res[0]
# cache some of RootDSE props
self.schema_dn = self.info_dc["schemaNamingContext"][0]
self.domain_dn = self.info_dc["defaultNamingContext"][0]
self.config_dn = self.info_dc["configurationNamingContext"][0]
self.computer_dn = "CN=centos53,CN=Computers,%s" % self.domain_dn
self.password = "P@ssw0rd"
self.username = "BindTestUser_" + time.strftime("%s", time.gmtime())
def tearDown(self):
super(BindTests, self).tearDown()
def test_computer_account_bind(self):
# create a computer acocount for the test
delete_force(ldb, self.computer_dn)
ldb.add_ldif("""
dn: """ + self.computer_dn + """
cn: CENTOS53
displayName: CENTOS53$
name: CENTOS53
sAMAccountName: CENTOS53$
countryCode: 0
objectClass: computer
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: user
codePage: 0
userAccountControl: 4096
dNSHostName: centos53.alabala.test
operatingSystemVersion: 5.2 (3790)
operatingSystem: Windows Server 2003
""")
ldb.modify_ldif("""
dn: """ + self.computer_dn + """
changetype: modify
replace: unicodePwd
unicodePwd:: """ + base64.b64encode("\"P@ssw0rd\"".encode('utf-16-le')) + """
""")
# do a simple bind and search with the machine account
creds_machine.set_bind_dn(self.computer_dn)
creds_machine.set_password(self.password)
print "BindTest with: " + creds_machine.get_bind_dn()
ldb_machine = samba.tests.connect_samdb(host, credentials=creds_machine,
lp=lp, ldap_only=True)
res = ldb_machine.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
def test_user_account_bind(self):
# create user
ldb.newuser(username=self.username, password=self.password)
ldb_res = ldb.search(base=self.domain_dn,
scope=SCOPE_SUBTREE,
expression="(samAccountName=%s)" % self.username)
self.assertEquals(len(ldb_res), 1)
user_dn = ldb_res[0]["dn"]
# do a simple bind and search with the user account in format user@realm
creds_user1.set_bind_dn(self.username + "@" + creds.get_realm())
creds_user1.set_password(self.password)
print "BindTest with: " + creds_user1.get_bind_dn()
ldb_user1 = samba.tests.connect_samdb(host, credentials=creds_user1,
lp=lp, ldap_only=True)
res = ldb_user1.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
# do a simple bind and search with the user account in format domain\user
creds_user2.set_bind_dn(creds.get_domain() + "\\" + self.username)
creds_user2.set_password(self.password)
print "BindTest with: " + creds_user2.get_bind_dn()
ldb_user2 = samba.tests.connect_samdb(host, credentials=creds_user2,
lp=lp, ldap_only=True)
res = ldb_user2.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
# do a simple bind and search with the user account DN
creds_user3.set_bind_dn(str(user_dn))
creds_user3.set_password(self.password)
print "BindTest with: " + creds_user3.get_bind_dn()
ldb_user3 = samba.tests.connect_samdb(host, credentials=creds_user3,
lp=lp, ldap_only=True)
res = ldb_user3.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
ldb = samba.tests.connect_samdb(host, credentials=creds, lp=lp, ldap_only=True)
runner = SubunitTestRunner()
rc = 0
if not runner.run(unittest.makeSuite(BindTests)).wasSuccessful():
rc = 1
sys.exit(rc)
| 35.322581 | 87 | 0.675799 | 695 | 5,475 | 5.14964 | 0.276259 | 0.022353 | 0.027941 | 0.034926 | 0.27382 | 0.234144 | 0.234144 | 0.118189 | 0.059793 | 0.059793 | 0 | 0.016894 | 0.210776 | 5,475 | 154 | 88 | 35.551948 | 0.811386 | 0.085662 | 0 | 0.067227 | 0 | 0 | 0.139367 | 0.019423 | 0 | 0 | 0 | 0 | 0.016807 | 0 | null | null | 0.05042 | 0.159664 | null | null | 0.042017 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
152d912b2e5f9f15cc867a175d937b12195d7065 | 1,396 | py | Python | rl/backup/policy_model.py | qbetterk/user-simulator | 77caca30ff67b9112b1fe5e65e191c6b5e25532c | [
"Apache-2.0"
] | 20 | 2019-11-08T02:28:28.000Z | 2022-02-07T09:20:21.000Z | rl/backup/policy_model.py | qbetterk/user-simulator | 77caca30ff67b9112b1fe5e65e191c6b5e25532c | [
"Apache-2.0"
] | 21 | 2019-11-08T02:27:40.000Z | 2022-03-12T00:02:54.000Z | rl/backup/policy_model.py | qbetterk/user-simulator | 77caca30ff67b9112b1fe5e65e191c6b5e25532c | [
"Apache-2.0"
] | 8 | 2020-02-10T07:28:37.000Z | 2021-09-23T09:42:14.000Z | import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from config import Config
def cuda_(var):
return var.cuda() if Config.use_gpu else var
class Net(nn.Module):
def __init__(self, state_dim, num_actions):
super(Net, self).__init__()
self.linear1 = nn.Linear(state_dim, 20)
self.linear2 = nn.Linear(20, num_actions)
# self.W1 = nn.Parameter(torch.randn(state_dim, 20))
# self.b1 = nn.Parameter(torch.randn(20))
# self.W2 = nn.Parameter(torch.randn(20, num_actions))
# self.b2 = nn.Parameter(torch.randn(num_actions))
# self.myparameters = nn.ParameterList([nn.Parameter(self.W1), nn.Parameter(self.W2),
# nn.Parameter(self.b1), nn.Parameter(self.b2)])
def forward(self, states, bit_vecs=None):
h1 = torch.tanh(self.linear1(states))
p = self.linear2(h1)
import pdb
# pdb.set_trace()
p = F.log_softmax(p, dim=1)
# if bit_vecs :
# if not isinstance(bit_vecs, torch.Tensor):
# bit_vecs = torch.tensor(bit_vecs, dtype=torch.float32, device=Config.device)
# bit_vecs.detach_()
# p = p * bit_vecs
# h1 = F.tanh((torch.matmul(states, self.W1) + self.b1))
# p = torch.matmul(h1, self.W2) + self.b2
return p
| 35.794872 | 94 | 0.598138 | 194 | 1,396 | 4.164948 | 0.314433 | 0.108911 | 0.079208 | 0.10396 | 0.110149 | 0.053218 | 0 | 0 | 0 | 0 | 0 | 0.032512 | 0.272923 | 1,396 | 38 | 95 | 36.736842 | 0.763547 | 0.477077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0.055556 | 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 |
154b9d15193c940131ff334d9b2981b990d3c08e | 494 | py | Python | examples/quickhowto2/app/forms.py | ezeev/Flask-AppBuilder | d95f0ed934272629ee44ad3241646fa7ba09cdf8 | [
"BSD-3-Clause"
] | 71 | 2016-11-02T06:45:42.000Z | 2021-11-15T12:33:48.000Z | examples/quickhowto2/app/forms.py | ezeev/Flask-AppBuilder | d95f0ed934272629ee44ad3241646fa7ba09cdf8 | [
"BSD-3-Clause"
] | 3 | 2021-06-08T23:39:54.000Z | 2022-03-12T00:50:13.000Z | examples/quickhowto2/app/forms.py | ezeev/Flask-AppBuilder | d95f0ed934272629ee44ad3241646fa7ba09cdf8 | [
"BSD-3-Clause"
] | 23 | 2016-11-02T06:45:44.000Z | 2022-02-08T14:55:13.000Z | from wtforms import StringField
from flask_babel import lazy_gettext
from wtforms.validators import DataRequired
from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
from flask_appbuilder.forms import DynamicForm
class TestForm(DynamicForm):
TestFieldOne = StringField(lazy_gettext('Test Field One'), validators=[DataRequired()], widget=BS3TextFieldWidget())
TestFieldTwo = StringField(lazy_gettext('Test Field One'), validators=[DataRequired()], widget=BS3TextFieldWidget())
| 44.909091 | 120 | 0.825911 | 52 | 494 | 7.730769 | 0.442308 | 0.067164 | 0.094527 | 0.129353 | 0.39801 | 0.39801 | 0.39801 | 0.39801 | 0.39801 | 0.39801 | 0 | 0.006696 | 0.093117 | 494 | 10 | 121 | 49.4 | 0.890625 | 0 | 0 | 0 | 0 | 0 | 0.05668 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.625 | 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 |
155074a3ccef54a4d20221e50f3372b850c3fcd9 | 1,508 | py | Python | popdata_sources/barbieri2012/process.py | ryanraaum/african-mtdna | c2d210cd16708396f08bad0266ba815285b386d2 | [
"CC0-1.0"
] | null | null | null | popdata_sources/barbieri2012/process.py | ryanraaum/african-mtdna | c2d210cd16708396f08bad0266ba815285b386d2 | [
"CC0-1.0"
] | null | null | null | popdata_sources/barbieri2012/process.py | ryanraaum/african-mtdna | c2d210cd16708396f08bad0266ba815285b386d2 | [
"CC0-1.0"
] | null | null | null | from oldowan.mtconvert import seq2sites, sites2seq, str2sites
from oldowan.fasta import fasta
from string import translate
import pandas as pd
import sys
import re
sys.path.append('../../scripts')
from utils import *
## load metadata
metadata = pd.read_csv('metadata.csv', index_col=0)
region = range2region(metadata.ix[0, 'SeqRange'])
ff = fasta('barbieri2012.fasta', 'r')
data = ff.readentries()
ff.close()
hids = []
groups = []
sites = []
sequences = []
for entry in data:
words = entry['name'].split()
if entry['sequence'].count('N') > 10:
print "Too many Ns in %s (%s), skipping" % (words[0], words[1])
else:
hids.append(words[0])
groups.append(words[1])
sites.append(seq2sites(entry['sequence']))
sequences.append(entry['sequence'])
# validate
passed_validation = True
for i in range(len(sites)):
seq1 = sequences[i]
seq2 = translate(sites2seq(sites[i], region), None, '-')
if not seq1 == seq2:
# some sequences have an N in the poly-C region around 309.
if seq1[:305] == seq2[:305] and seq1[-16254:] == seq2[-16254:]:
pass
else:
passed_validation = False
print i, hids[i]
counter = {}
for k in metadata.index:
counter[k] = 0
if passed_validation:
with open('processed.csv', 'w') as f:
for i in range(len(sites)):
hid = hids[i]
key = groups[i]
prefix = metadata.ix[key,'NewPrefix']
counter[key] += 1
newid = prefix + str(counter[key]).zfill(3)
mysites = ' '.join([str(x) for x in sites[i]])
f.write('%s,%s,%s\n' % (newid, hid, mysites)) | 24.721311 | 65 | 0.662467 | 225 | 1,508 | 4.417778 | 0.453333 | 0.039235 | 0.012072 | 0.022133 | 0.038229 | 0.038229 | 0 | 0 | 0 | 0 | 0 | 0.038217 | 0.167109 | 1,508 | 61 | 66 | 24.721311 | 0.753185 | 0.05305 | 0 | 0.081633 | 0 | 0 | 0.103933 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.081633 | 0.142857 | null | null | 0.040816 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
1563dbafae83ddb8b923f51711ee6a19bcbb9c71 | 3,477 | py | Python | rosidl_runtime_py/utilities.py | fujitatomoya/rosidl_runtime_py | f1bfe509c457e4693f8c1e85a5cecdd8483bd7d2 | [
"Apache-2.0"
] | 3 | 2019-09-19T17:58:06.000Z | 2022-03-07T15:47:20.000Z | rosidl_runtime_py/utilities.py | fujitatomoya/rosidl_runtime_py | f1bfe509c457e4693f8c1e85a5cecdd8483bd7d2 | [
"Apache-2.0"
] | 12 | 2019-09-19T17:57:56.000Z | 2022-03-15T21:48:33.000Z | rosidl_runtime_py/utilities.py | fujitatomoya/rosidl_runtime_py | f1bfe509c457e4693f8c1e85a5cecdd8483bd7d2 | [
"Apache-2.0"
] | 10 | 2019-10-21T20:47:42.000Z | 2022-03-29T15:01:34.000Z | # Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Text
from rosidl_parser.definition import NamespacedType
from rosidl_runtime_py.import_message import import_message_from_namespaced_type
def get_interface(identifier: Text):
"""Get an interface from its full name."""
return import_message_from_namespaced_type(get_namespaced_type(identifier))
def get_message(identifier: Text):
"""Get a message from its full name."""
interface = import_message_from_namespaced_type(get_message_namespaced_type(identifier))
if not is_message(interface):
raise ValueError("Expected the full name of a message, got '{}'".format(identifier))
return interface
def get_service(identifier: Text):
"""Get a service from its full name."""
interface = import_message_from_namespaced_type(get_service_namespaced_type(identifier))
if not is_service(interface):
raise ValueError("Expected the full name of a service, got '{}'".format(identifier))
return interface
def get_action(identifier: Text):
"""Get a message from its full name."""
interface = import_message_from_namespaced_type(get_action_namespaced_type(identifier))
if not is_action(interface):
raise ValueError("Expected the full name of an action, got '{}'".format(identifier))
return interface
def get_namespaced_type(identifier: Text):
"""Create a `NamespacedType` object from the full name of an interface."""
return _get_namespaced_type(identifier)
def get_message_namespaced_type(identifier: Text):
"""Create a `NamespacedType` object from the full name of a message."""
return _get_namespaced_type(identifier, default_namespace='msg')
def get_service_namespaced_type(identifier: Text):
"""Create a `NamespacedType` object from the full name of a service."""
return _get_namespaced_type(identifier, default_namespace='srv')
def get_action_namespaced_type(identifier: Text):
"""Create a `NamespacedType` object from the full name of an action."""
return _get_namespaced_type(identifier, default_namespace='action')
def is_message(interface):
"""Return `True` if `interface` is a message."""
return hasattr(interface, 'SLOT_TYPES')
def is_service(interface):
"""Return `True` if `interface` is a service."""
return hasattr(interface, 'Request') and hasattr(interface, 'Response')
def is_action(interface):
"""Return `True` if `interface` is an action."""
return (
hasattr(interface, 'Goal') and
hasattr(interface, 'Result') and
hasattr(interface, 'Feedback')
)
def _get_namespaced_type(identifier: Text, *, default_namespace=None):
namespace = identifier.split(sep='/')
name = namespace[-1]
namespace = namespace[0:-1]
if len(namespace) == 1 and default_namespace is not None:
namespace.append(default_namespace)
return NamespacedType(namespace, name)
| 36.21875 | 92 | 0.741156 | 459 | 3,477 | 5.444444 | 0.252723 | 0.10084 | 0.12485 | 0.07563 | 0.55062 | 0.520208 | 0.427371 | 0.262105 | 0.244098 | 0.207283 | 0 | 0.004127 | 0.163647 | 3,477 | 95 | 93 | 36.6 | 0.855227 | 0.319241 | 0 | 0.066667 | 0 | 0 | 0.08308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.155556 | 0 | 0.688889 | 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 |
156ebf640409ae77f16602cba4dfad2b843f1f73 | 553 | py | Python | biserici_inlemnite/app/migrations/0020_auto_20210924_1110.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | biserici_inlemnite/app/migrations/0020_auto_20210924_1110.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | biserici_inlemnite/app/migrations/0020_auto_20210924_1110.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-09-24 08:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0019_auto_20210924_1106'),
]
operations = [
migrations.RemoveField(
model_name='descrierepage',
name='turn_decor',
),
migrations.AddField(
model_name='descrierepage',
name='turn_numar_stalpi',
field=models.IntegerField(blank=True, null=True, verbose_name='Număr stâlpi'),
),
]
| 24.043478 | 90 | 0.60217 | 57 | 553 | 5.684211 | 0.754386 | 0.055556 | 0.135802 | 0.160494 | 0.185185 | 0 | 0 | 0 | 0 | 0 | 0 | 0.081013 | 0.285714 | 553 | 22 | 91 | 25.136364 | 0.739241 | 0.083183 | 0 | 0.25 | 1 | 0 | 0.180198 | 0.045545 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.0625 | 0 | 0.25 | 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 |
159404c2056221e60f609b4d146aa57fd40b1573 | 1,716 | py | Python | test/magicmind/op_test/test_size.py | Cambricon/catch | 2625da389f25a67066d20fb6b0c38250ef98f8ab | [
"BSD-2-Clause"
] | 20 | 2022-03-01T11:40:51.000Z | 2022-03-30T08:17:47.000Z | test/magicmind/op_test/test_size.py | Cambricon/catch | 2625da389f25a67066d20fb6b0c38250ef98f8ab | [
"BSD-2-Clause"
] | null | null | null | test/magicmind/op_test/test_size.py | Cambricon/catch | 2625da389f25a67066d20fb6b0c38250ef98f8ab | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function
from itertools import product
import torch
import torch.nn as nn
import torch_mlu
from torch.nn import Parameter
import torch.nn.functional as F
import numpy as np
import sys
import os
import copy
import random
import time
import unittest
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(cur_dir+"/../../")
from common_utils import testinfo, TestCase
import logging
logging.basicConfig(level=logging.DEBUG)
torch.set_grad_enabled(False)
class TestSizeModel(nn.Module):
def __init__(self, dim):
super(TestSizeModel, self).__init__()
self.dim = dim
def forward(self, x, y):
z = x.size(self.dim)
# TODO(wangyan): test when mm fixed
return z + y
class TestSizeOp(TestCase):
@testinfo()
def test_size(self):
dim_l = [0, 3]
for dim in dim_l:
for element_type in [torch.half, torch.float, torch.int, torch.short, \
torch.long, torch.uint8, torch.int8, torch.bool]:
model = TestSizeModel(dim)
input_x = torch.rand((3,6,8,12)).to(dtype=element_type)
input_y = torch.randn((3,6,8,12))
traced_model = torch.jit.trace(model, (input_x, input_y), check_trace=False)
out_cpu = model(input_x, input_y)
input_x = input_x.to(dtype=element_type)
input_x_mlu = input_x.to('mlu')
input_y_mlu = input_y.to('mlu')
out_mlu = traced_model(input_x_mlu, input_y_mlu)
self.assertTensorsEqual(out_cpu, out_mlu.cpu(), 0.003, use_MSE = True)
if __name__ == '__main__':
unittest.main() | 31.777778 | 92 | 0.631702 | 241 | 1,716 | 4.236515 | 0.414938 | 0.047013 | 0.032321 | 0.009794 | 0.078355 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014241 | 0.263403 | 1,716 | 54 | 93 | 31.777778 | 0.793513 | 0.019231 | 0 | 0 | 0 | 0 | 0.012485 | 0 | 0 | 0 | 0 | 0.018519 | 0.021739 | 1 | 0.065217 | false | 0 | 0.347826 | 0 | 0.478261 | 0.021739 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
159e4d49c26008b7c32a461ba8e387fa0453f373 | 409 | py | Python | apps/jobs/migrations/0014_rename_job_id_field_in_submission_model_to_job_name.py | kaustubh-s1/EvalAI | 1884811e7759e0d095f7afb68188a7f010fa65dc | [
"BSD-3-Clause"
] | 1,470 | 2016-10-21T01:21:45.000Z | 2022-03-30T14:08:29.000Z | apps/jobs/migrations/0014_rename_job_id_field_in_submission_model_to_job_name.py | kaustubh-s1/EvalAI | 1884811e7759e0d095f7afb68188a7f010fa65dc | [
"BSD-3-Clause"
] | 2,594 | 2016-11-02T03:36:01.000Z | 2022-03-31T15:30:04.000Z | apps/jobs/migrations/0014_rename_job_id_field_in_submission_model_to_job_name.py | kaustubh-s1/EvalAI | 1884811e7759e0d095f7afb68188a7f010fa65dc | [
"BSD-3-Clause"
] | 865 | 2016-11-09T17:46:32.000Z | 2022-03-30T13:06:52.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-01-20 05:23
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("jobs", "0013_add_job_id_field_in_submission_model")]
operations = [
migrations.RenameField(
model_name="submission", old_name="job_id", new_name="job_name"
)
]
| 24.058824 | 75 | 0.687042 | 53 | 409 | 4.981132 | 0.716981 | 0.037879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.067073 | 0.198044 | 409 | 16 | 76 | 25.5625 | 0.737805 | 0.168704 | 0 | 0 | 1 | 0 | 0.204748 | 0.121662 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
15a007d1d3d27f2cff85f82f76e0c955ba30f2bf | 1,305 | py | Python | pyy.py | eieio/pyy | dface9d5c8914bb74ef1ee4df112269b65e62bec | [
"Apache-2.0"
] | null | null | null | pyy.py | eieio/pyy | dface9d5c8914bb74ef1ee4df112269b65e62bec | [
"Apache-2.0"
] | 1 | 2020-09-29T22:20:49.000Z | 2020-09-29T22:20:49.000Z | pyy.py | eieio/pyy | dface9d5c8914bb74ef1ee4df112269b65e62bec | [
"Apache-2.0"
] | null | null | null | ''' IRCBot.py
Copyright 2008 Corey Tabaka
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
import sys
import socket
import random
from irclib import *
import modules.admin
# TODO: move this to a config file at some point
HOST = 'irc.freenode.net'
PORT = 6667
NICK = 'pyy_%04x' % random.getrandbits(16) # bot nick, change it
PASS = '' # password used to identify to services
MASTER = '' # default admin nick, set it to your own nick
CHANNELS = ('#pyy', ) # channels to join at startup
if __name__ == '__main__':
logfile = file('logfile.txt', 'wb')
so = socket.socket()
so.connect((HOST, PORT))
bot = CommandProcessor(so, NICK, HOST, CHANNELS, logfile,
password=PASS, autorejoin=True, master=MASTER)
bot.cmdloop()
| 30.348837 | 76 | 0.68659 | 184 | 1,305 | 4.820652 | 0.63587 | 0.067644 | 0.029312 | 0.036077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015936 | 0.230651 | 1,305 | 42 | 77 | 31.071429 | 0.86753 | 0.571648 | 0 | 0 | 0 | 0 | 0.102296 | 0 | 0 | 0 | 0 | 0.02381 | 0 | 1 | 0 | false | 0.111111 | 0.277778 | 0 | 0.277778 | 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 |
15a0ab7dba9e5d7839b7b9a443a71a2444bf7c79 | 637 | py | Python | microcosm_flask/metrics.py | KensoDev/microcosm-flask | 3618333f4a0f45e673a33986877157208c9eac5f | [
"Apache-2.0"
] | null | null | null | microcosm_flask/metrics.py | KensoDev/microcosm-flask | 3618333f4a0f45e673a33986877157208c9eac5f | [
"Apache-2.0"
] | null | null | null | microcosm_flask/metrics.py | KensoDev/microcosm-flask | 3618333f4a0f45e673a33986877157208c9eac5f | [
"Apache-2.0"
] | null | null | null | """
Metrics extensions for routes.
"""
try:
from microcosm_metrics.classifier import Classifier
except ImportError:
raise Exception("Route metrics require 'microcosm-metrics'")
from microcosm_flask.audit import parse_response
from microcosm_flask.errors import extract_status_code
class StatusCodeClassifier(Classifier):
"""
Label route result/error with its status code.
"""
def label_result(self, result):
_, status_code, _ = parse_response(result)
return str(status_code)
def label_error(self, error):
status_code = extract_status_code(error)
return str(status_code)
| 23.592593 | 64 | 0.729984 | 75 | 637 | 5.973333 | 0.453333 | 0.15625 | 0.080357 | 0.080357 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.191523 | 637 | 26 | 65 | 24.5 | 0.869903 | 0.120879 | 0 | 0.153846 | 0 | 0 | 0.076636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.307692 | 0 | 0.692308 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
15a5ccceb89002ab5bd79c1465925b612b0995c5 | 282 | py | Python | payment/tests.py | mohsenamoon1160417237/ECommerce-app | 4cca492214b04b56f625aef2a2979956a8256710 | [
"MIT"
] | null | null | null | payment/tests.py | mohsenamoon1160417237/ECommerce-app | 4cca492214b04b56f625aef2a2979956a8256710 | [
"MIT"
] | null | null | null | payment/tests.py | mohsenamoon1160417237/ECommerce-app | 4cca492214b04b56f625aef2a2979956a8256710 | [
"MIT"
] | null | null | null | from django.test import TestCase
class PaymentPageViewTest(TestCase):
def setUp(self):
self.url = '/payment/stripe/'
def test_url_ok(self):
response = self.client.post(self.url)
self.assertEqual(response.status_code , 200)
| 17.625 | 53 | 0.624113 | 32 | 282 | 5.40625 | 0.65625 | 0.080925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014706 | 0.276596 | 282 | 15 | 54 | 18.8 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0.06015 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
15a88f6fd51f8962fffbc732478191a199896b17 | 208 | py | Python | src/traditional/segment/config.py | jakexie/LearnDeepLearning | fd434081e052bebf1df51b5a0bf2745ab8a6c9bc | [
"Apache-2.0"
] | null | null | null | src/traditional/segment/config.py | jakexie/LearnDeepLearning | fd434081e052bebf1df51b5a0bf2745ab8a6c9bc | [
"Apache-2.0"
] | null | null | null | src/traditional/segment/config.py | jakexie/LearnDeepLearning | fd434081e052bebf1df51b5a0bf2745ab8a6c9bc | [
"Apache-2.0"
] | 1 | 2021-03-31T02:11:24.000Z | 2021-03-31T02:11:24.000Z | class Config:
# image size
image_min_dims = 512
image_max_dims = 512
steps_per_epoch = 50
validation_steps = 20
batch_size = 16
epochs = 10
shuffle = True
num_classes = 21
| 18.909091 | 25 | 0.639423 | 29 | 208 | 4.275862 | 0.793103 | 0.112903 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111888 | 0.3125 | 208 | 10 | 26 | 20.8 | 0.755245 | 0.048077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
15acc18a667042c699fb4b82581fb85d9cd9fe63 | 267 | py | Python | common/framework_excuter/keras_excute.py | wavelet2008/rknn-v5 | 16288a88844e887634f74df8f43fff9b82f4ba62 | [
"Apache-2.0"
] | 11 | 2022-02-24T10:44:54.000Z | 2022-03-31T03:40:21.000Z | common/framework_excuter/keras_excute.py | wavelet2008/rknn-v5 | 16288a88844e887634f74df8f43fff9b82f4ba62 | [
"Apache-2.0"
] | 1 | 2022-03-01T07:21:04.000Z | 2022-03-31T11:03:47.000Z | common/framework_excuter/keras_excute.py | wavelet2008/rknn-v5 | 16288a88844e887634f74df8f43fff9b82f4ba62 | [
"Apache-2.0"
] | 5 | 2022-03-18T09:05:50.000Z | 2022-03-30T07:35:55.000Z | from tensorflow.keras.models import load_model
class Keras_model_container:
def __init__(self, model_path) -> None:
self.net = load_model(model_path)
def run(self, input_datas):
outputs = self.net.predict(input_datas)
return outputs | 26.7 | 47 | 0.707865 | 36 | 267 | 4.916667 | 0.583333 | 0.101695 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209738 | 267 | 10 | 48 | 26.7 | 0.838863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
ec612ea8c9b27919bfa7c84475a7d439392a80f1 | 430 | py | Python | feet/admin.py | yun-mh/uniwalk | f5307f6970b24736d13b56b4792c580398c35b3a | [
"Apache-2.0"
] | null | null | null | feet/admin.py | yun-mh/uniwalk | f5307f6970b24736d13b56b4792c580398c35b3a | [
"Apache-2.0"
] | 9 | 2020-01-10T14:10:02.000Z | 2022-03-12T00:08:19.000Z | feet/admin.py | yun-mh/uniwalk | f5307f6970b24736d13b56b4792c580398c35b3a | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from . import models
@admin.register(models.Footsize)
class FootsizeAdmin(admin.ModelAdmin):
""" アドミンに足サイズテーブルを定義する """
pass
@admin.register(models.FootImage)
class FootImageAdmin(admin.ModelAdmin):
""" アドミンに足イメージテーブルを定義する """
pass
@admin.register(models.ProcessedFootImage)
class ProcessedFootImageAdmin(admin.ModelAdmin):
""" アドミンに処理済み足イメージテーブルを定義する """
pass
| 15.925926 | 48 | 0.739535 | 38 | 430 | 8.368421 | 0.5 | 0.122642 | 0.179245 | 0.144654 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151163 | 430 | 26 | 49 | 16.538462 | 0.871233 | 0.148837 | 0 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.272727 | 0.181818 | 0 | 0.454545 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ec6c7c4836c5301deffa88bbb3af5bfa60403f02 | 282 | py | Python | timedata/ui/switch_button.py | timedata-org/controly | 3faac7450678aaccd4a283d0d41ca3e7f113f51b | [
"MIT"
] | null | null | null | timedata/ui/switch_button.py | timedata-org/controly | 3faac7450678aaccd4a283d0d41ca3e7f113f51b | [
"MIT"
] | 1 | 2018-08-02T12:07:17.000Z | 2018-08-02T12:07:17.000Z | timedata/ui/switch_button.py | timedata-org/controly | 3faac7450678aaccd4a283d0d41ca3e7f113f51b | [
"MIT"
] | null | null | null | from kivy.uix import togglebutton
class SwitchButton(togglebutton.ToggleButton):
def __init__(self, off, on='', **kwds):
super().__init__(text=off, **kwds)
self.texts = off, on
def on_state(self, _, value):
self.text = self.texts[value == 'down']
| 25.636364 | 47 | 0.634752 | 35 | 282 | 4.828571 | 0.542857 | 0.059172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216312 | 282 | 10 | 48 | 28.2 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0.014184 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
ec7c4c8dba497c0db4304432000ba5cc4019dfd9 | 466 | py | Python | BOJ/11000~11999/11200~11299/11285.py | shinkeonkim/today-ps | f3e5e38c5215f19579bb0422f303a9c18c626afa | [
"Apache-2.0"
] | 2 | 2020-01-29T06:54:41.000Z | 2021-11-07T13:23:27.000Z | BOJ/11000~11999/11200~11299/11285.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | BOJ/11000~11999/11200~11299/11285.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | 초성 = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']
중성 = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ', 'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ']
종성 = ['', 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ', 'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ', 'ㄿ', 'ㅀ', 'ㅁ', 'ㅂ', 'ㅄ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']
a=input()
b=input()
c=input()
a = 초성.index(a)
b = 중성.index(b)
c = 종성.index(c)
print(chr(44032 +a*588+b*28+c)) | 46.6 | 144 | 0.298283 | 96 | 466 | 1.447917 | 0.666667 | 0.028777 | 0.043165 | 0.057554 | 0.071942 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026385 | 0.186695 | 466 | 10 | 145 | 46.6 | 0.340369 | 0 | 0 | 0 | 0 | 0 | 0.143469 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.1 | 0 | 0 | 1 | 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 | 0 | 0 | 0 | 2 |
ec8ffe9bef411027daa99fd070d9ff79cf0b1a00 | 310 | py | Python | spider_learn/spider_learn01/urllib_learn/urllib19_urlerror.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | spider_learn/spider_learn01/urllib_learn/urllib19_urlerror.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | spider_learn/spider_learn01/urllib_learn/urllib19_urlerror.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | import urllib.request
request = urllib.request.Request("http://aa.bb.cc.com/")
try:
response = urllib.request.urlopen(request,timeout=5)
response.close()
except urllib.request.URLError as err:
print(err.reason())
except ConnectionResetError as connErr:
print(connErr)
print("----line------") | 23.846154 | 56 | 0.709677 | 39 | 310 | 5.641026 | 0.589744 | 0.236364 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00369 | 0.125806 | 310 | 13 | 57 | 23.846154 | 0.808118 | 0 | 0 | 0 | 0 | 0 | 0.109325 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.1 | 0.3 | 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 |
ecb252d17aef08a5b8cd20fdb4e94a59ef4d37a0 | 11,253 | py | Python | temboo/core/choreography.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/choreography.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/choreography.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | ###############################################################################
#
# temboo.core.choreography.Choreography
# temboo.core.choreography.InputSet
# temboo.coreo.choreography.ResultSet
# temboo.core.choreography.ChoreographyExecution
#
# Interface classes for calling and manipulating choreographies.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
#
###############################################################################
import datetime
import json
import pprint
from temboo.core.resource import _TembooResource
from temboo.core.util import ExecutionStatus
from temboo.core.session import TembooSession
class Choreography(_TembooResource):
resource_path = '/choreos'
def __init__(self, temboo_session, temboo_path):
""" Create a Choreography instance.
temboo_session -- an instance of TembooSession.
temboo_path -- a string (or an object that can be converted
into a string) that represents the location
of this choreo on the Temboo server. For example
/Choreos/MyStore/RunReport
"""
super(Choreography, self).__init__(temboo_session, temboo_path)
# For proxied executions from the JS SDK
self._jsClientVersion = None
def execute_with_results(self, choreo_inputs=None):
"""Runs the choreography and waits for it to complete.
This method will run this choreography with the supplied
inputs, block while waiting for it to complete,
and return the results as a dict with keys of
'output' and 'execution'.
choreo_inputs -- an optional instance of InputSet (default = None)
Returns a ResultSet instance.
"""
choreo_inputs = choreo_inputs if choreo_inputs else InputSet()
body = choreo_inputs.format_inputs();
# Append JS client version string if present
params = {"source_id": TembooSession.SOURCE_ID + (('-' + self._jsClientVersion) if self._jsClientVersion else '')}
return self._make_result_set(self._temboo_session.post(self.get_session_path(), body, params), self._temboo_path)
def _make_result_set(self, result, path):
return ResultSet(result, path)
def execute_async(self, choreo_inputs=None, store_results=False):
"""Runs the choreography asynchronously, without waiting for results.
This method will run this choreography with the supplied
inputs. It does not wait for the choreography to complete.
choreo_inputs -- an optional instance of InputSet (default = None)
store_results -- a boolean that determines whether choreo results
are saved for later retrieval or discarded immediately
on choreo completion. (default = False)
Returns a ChoreographyExecution instance that can be used to poll
for status or get the results when the choreography is complete
(if store_results is True)
"""
choreo_inputs = choreo_inputs if choreo_inputs else InputSet()
body = choreo_inputs.format_inputs();
params = {'mode': 'async', 'store_results':bool(store_results),
"source_id":TembooSession.SOURCE_ID}
result = self._temboo_session.post(self.get_session_path(), body, params)
exec_id = result.get('id', None)
if exec_id:
return self._make_execution(self._temboo_session, exec_id, self._temboo_path)
return None
def _make_execution(self, session, exec_id, path):
return ChoreographyExecution(session, exec_id, path)
def _get_resource_path(self):
return self.resource_path
def _set_js_client_version(self, jsClientVersion):
"""Used to specify the version of Temboo JS SDK used for a proxied choreo execution
jsClientVersion -- the client version string
"""
self._jsClientVersion = jsClientVersion
class InputSet(object):
def __init__(self):
self.inputs = {}
self.preset_uri = None
self.outputs = []
def _set_input(self, name, value):
"""Adds (or replaces) an input variable value in the InputSet
name -- the name of the input variable.
value -- the value of the input variable. If not already a string,
will be converted to a string before sending to the server.
"""
self.inputs[name] = value
def _set_inputs(self, inputs):
"""Adds (or replaces) the names and values passed in to this InputSet
inputs -- can be a dictionary of name/value pairs
or an iterable of key/value pairs as a
tuple or other iterable of length two.
"""
self.inputs.update(inputs)
def add_output_filter(self, filterName, path, outputVariableName):
"""
Add an output filter to this result set.
"""
self.outputs.append((filterName, path, outputVariableName))
def set_profile(self, name):
"""Adds (or replaces) the name of the credential to be used as an input
to the Choreo execution
"""
self.preset_uri = name
set_credential = set_profile # Support legacy method name
def format_inputs(self):
"""Formats the JSON body of a choreography execution POST request.
"""
all_inputs ={}
if self.inputs:
all_inputs['inputs'] = [{'name':name, 'value':self.inputs[name]} for name in self.inputs]
if self.outputs:
all_inputs['outputFilters'] = [
{'name':name, 'path':path, 'variable':varname}
for name, path, varname in self.outputs
]
if self.preset_uri:
all_inputs['preset'] = str(self.preset_uri)
return json.dumps(all_inputs)
class ResultSet(object):
def __init__(self, result, path=None):
"""
Makes a result set from the JSON result returned
from a choreo execution.
result -- may be either a dictionary containing choreo execution
results or another ResultSet instance. Giving another
ResultSet instance is useful for converting a generic
ResultSet returned by ChoreographyExecution.get_results
into a choreo-specific result set.
path -- the temboo path of the choreo that generated these results.
(ignored if result is a ResultSet)
"""
if isinstance(result, ResultSet):
self._result = result._result
self._path = result._path
else:
self._result = result
self._path = path
self._exec_data = self._result.get("execution", {})
self._output = self._result.get("output", {})
@property
def path(self):
return self._path
@property
def exec_id(self):
return self._exec_data.get('id', None)
@property
def status(self):
return self._exec_data.get('status', ExecutionStatus.ERROR)
@property
def start_time(self):
return self._exec_data.get('starttime', None)
@property
def start_time_UTC(self):
return self._time_to_UTC(self.start_time)
@property
def end_time(self):
return self._exec_data.get('endtime', None)
@property
def end_time_UTC(self):
return self._time_to_UTC(self.end_time)
@property
def error_time(self):
return self._exec_data.get('errortime', None)
@property
def error_time_UTC(self):
return self._time_to_UTC(self.error_time)
@property
def last_error(self):
return self._exec_data.get('lasterror', None)
@property
def outputs(self):
return self._output
def _time_to_UTC(self, millis):
if millis:
#Server gives us time in milliseconds.
#We need that as a floating point value in seconds.
t = float(millis)/1000.0
return datetime.datetime.utcfromtimestamp(t)
return None
def __str__(self):
msg = []
msg.append("Choreo Execution Results")
msg.append("Path: " + str(self.path))
msg.append("Execution ID: " + str(self.exec_id))
msg.append("Status: " + str(self.status))
msg.append("Start Time: " + str(self.start_time_UTC) + " UTC")
msg.append("End Time: " + str(self.end_time_UTC) + " UTC")
msg.append("Error Time: " + str(self.error_time_UTC) + " UTC")
msg.append("Last Error: " + str(self.last_error))
msg.append("Outputs:")
msg.append(pprint.pformat(self._output, width=1))
return "\n".join(msg)
class ChoreographyExecution(_TembooResource):
resource_path = "/choreo-executions"
def __init__(self, temboo_session, exec_id, choreo_uri=None):
""" Create a ChoreographyExecution instance.
ChoreographyExecution objects are normally created and
returned by Choreography.execute_async.
temboo_session -- an instance of TembooSession.
exec_id -- the execution id of the executing choreo
"""
super(ChoreographyExecution, self).__init__(temboo_session, exec_id)
self._result_set = None
self._status = None
self.choreo_uri = choreo_uri
self.exec_id = exec_id
@property
def status(self):
if not self._status or self._status == ExecutionStatus.RUNNING:
response = self._temboo_session.get_content(self.get_session_path())
if response:
exec_info = response['execution']
self._status = exec_info['status']
return self._status
def _get_resource_path(self):
return self.resource_path
@property
def result_set(self):
"""
Return result set, if it has been populated yet.
"""
if self.status != ExecutionStatus.RUNNING and self._result_set is None:
response = self._temboo_session.get_content(self.get_session_path(), {'view':'outputs'})
self._result_set = self._make_result_set(response, self._temboo_path)
return self._result_set
def _make_result_set(self, response, path):
return ResultSet(response, path)
def __str__(self):
msg = []
msg.append("Choreo Execution")
msg.append("Path: " + str(self.choreo_uri))
msg.append("Execution ID: " + str(self.exec_id))
msg.append("Status: " + str(self.status))
return "\n".join(msg)
| 33.691617 | 122 | 0.630143 | 1,348 | 11,253 | 5.080861 | 0.20549 | 0.024821 | 0.026573 | 0.015769 | 0.217988 | 0.174332 | 0.152285 | 0.139582 | 0.128778 | 0.086144 | 0 | 0.00232 | 0.272105 | 11,253 | 333 | 123 | 33.792793 | 0.833842 | 0.337599 | 0 | 0.227273 | 0 | 0 | 0.054876 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.038961 | 0.103896 | 0.467532 | 0.012987 | 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 |
ecb4a4cc91c249110abcd8cdf99331da552cb920 | 151 | py | Python | ex032.py | ranierelm/Python_exercise | db143d2dc019bbd479397dc64efbe4fe0aa1abab | [
"MIT"
] | null | null | null | ex032.py | ranierelm/Python_exercise | db143d2dc019bbd479397dc64efbe4fe0aa1abab | [
"MIT"
] | null | null | null | ex032.py | ranierelm/Python_exercise | db143d2dc019bbd479397dc64efbe4fe0aa1abab | [
"MIT"
] | null | null | null | ano = int(input('Ano que você nasceu: '))
if ano%4==0 and ano%100!=0 or ano%400==0:
print('Ano Bissexto')
else:
print('Não foi Bissexto')
| 25.166667 | 42 | 0.609272 | 27 | 151 | 3.407407 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.084034 | 0.211921 | 151 | 5 | 43 | 30.2 | 0.689076 | 0 | 0 | 0 | 0 | 0 | 0.335616 | 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 |
ecc1ed8079e3bba5c3fca50dc3bf7933932611ec | 3,261 | py | Python | JAPL/meta/statement.py | japl-lang/japl-python | fb9a769d07f1528b846a0ccefd3e782ab3d9b473 | [
"Apache-2.0"
] | 3 | 2020-10-21T19:18:58.000Z | 2020-10-22T06:13:29.000Z | JAPL/meta/statement.py | japl-lang/japl-python | fb9a769d07f1528b846a0ccefd3e782ab3d9b473 | [
"Apache-2.0"
] | null | null | null | JAPL/meta/statement.py | japl-lang/japl-python | fb9a769d07f1528b846a0ccefd3e782ab3d9b473 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from dataclasses import dataclass
from .expression import Expression, Variable
from .tokenobject import Token
from typing import List, Any
class Statement(object):
"""
A Base Class representing JAPL statements
"""
def accept(self, visitor):
raise NotImplementedError
class Visitor(ABC):
"""Wrapper to implement the Visitor Pattern"""
@abstractmethod
def visit_statement_expr(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_var_stmt(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_del(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_block(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_if(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_while(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_break(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_function(self, visitor):
raise NotImplementedError
@abstractmethod
def visit_return(self, visitor):
raise NotImplementedError
@staticmethod
def visit_class(self, visitor):
raise NotImplementedError
@dataclass
class StatementExpr(Statement):
"""
An expression statement
"""
expression: Expression
def accept(self, visitor):
visitor.visit_statement_expr(self)
@dataclass
class Var(Statement):
"""
A var statement
"""
name: Token
init: Expression = None
def accept(self, visitor):
visitor.visit_var_stmt(self)
@dataclass
class Del(Statement):
"""
A del statement
"""
name: Any
def accept(self, visitor):
visitor.visit_del(self)
@dataclass
class Block(Statement):
"""A block statement"""
statements: List[Statement]
def accept(self, visitor):
visitor.visit_block(self)
@dataclass
class If(Statement):
"""An if statement"""
condition: Expression
then_branch: Statement
else_branch: Statement
def accept(self, visitor):
visitor.visit_if(self)
@dataclass
class While(Statement):
"""A while statement"""
condition: Expression
body: Statement
def accept(self, visitor):
visitor.visit_while(self)
@dataclass
class Break(Statement):
"""A break statement"""
token: Token
def accept(self, visitor):
visitor.visit_break(self)
@dataclass
class Function(Statement):
"""A function statement"""
name: Token
params: List[Token]
body: List[Statement]
def accept(self, visitor):
visitor.visit_function(self)
@dataclass
class Return(Statement, BaseException):
"""A return statement"""
keyword: Token
value: Expression
def accept(self, visitor):
visitor.visit_return(self)
@dataclass
class Class(Statement):
"""A class statement"""
name: Token
methods: list
superclass: Variable
def accept(self, visitor):
visitor.visit_class(self)
| 18.741379 | 54 | 0.644894 | 326 | 3,261 | 6.371166 | 0.184049 | 0.111218 | 0.068849 | 0.105922 | 0.404429 | 0.404429 | 0.342802 | 0.043332 | 0 | 0 | 0 | 0 | 0.271082 | 3,261 | 173 | 55 | 18.849711 | 0.87379 | 0.08157 | 0 | 0.469388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.05102 | 0 | 0.581633 | 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 |
ecef17eae566a1c7f1fbdc99b800abb5d8a86222 | 18,694 | py | Python | google/cloud/securitycenter_v1beta1/proto/asset_pb2.py | tmatsuo/python-securitycenter | dbb9311676003f452295848c49cbe97cb22c47b5 | [
"Apache-2.0"
] | null | null | null | google/cloud/securitycenter_v1beta1/proto/asset_pb2.py | tmatsuo/python-securitycenter | dbb9311676003f452295848c49cbe97cb22c47b5 | [
"Apache-2.0"
] | null | null | null | google/cloud/securitycenter_v1beta1/proto/asset_pb2.py | tmatsuo/python-securitycenter | dbb9311676003f452295848c49cbe97cb22c47b5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/securitycenter_v1beta1/proto/asset.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2
from google.api import resource_pb2 as google_dot_api_dot_resource__pb2
from google.cloud.securitycenter_v1beta1.proto import (
security_marks_pb2 as google_dot_cloud_dot_securitycenter__v1beta1_dot_proto_dot_security__marks__pb2,
)
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
name="google/cloud/securitycenter_v1beta1/proto/asset.proto",
package="google.cloud.securitycenter.v1beta1",
syntax="proto3",
serialized_options=b"\n'com.google.cloud.securitycenter.v1beta1P\001ZQgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenter",
create_key=_descriptor._internal_create_key,
serialized_pb=b"\n5google/cloud/securitycenter_v1beta1/proto/asset.proto\x12#google.cloud.securitycenter.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a>google/cloud/securitycenter_v1beta1/proto/security_marks.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto\"\xd3\x05\n\x05\x41sset\x12\x0c\n\x04name\x18\x01 \x01(\t\x12g\n\x1asecurity_center_properties\x18\x02 \x01(\x0b\x32\x43.google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties\x12_\n\x13resource_properties\x18\x07 \x03(\x0b\x32\x42.google.cloud.securitycenter.v1beta1.Asset.ResourcePropertiesEntry\x12J\n\x0esecurity_marks\x18\x08 \x01(\x0b\x32\x32.google.cloud.securitycenter.v1beta1.SecurityMarks\x12/\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x99\x01\n\x18SecurityCenterProperties\x12\x1a\n\rresource_name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fresource_parent\x18\x03 \x01(\t\x12\x18\n\x10resource_project\x18\x04 \x01(\t\x12\x17\n\x0fresource_owners\x18\x05 \x03(\t\x1aQ\n\x17ResourcePropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value:\x02\x38\x01:U\xea\x41R\n#securitycenter.googleapis.com/Asset\x12+organizations/{organization}/assets/{asset}B~\n'com.google.cloud.securitycenter.v1beta1P\x01ZQgoogle.golang.org/genproto/googleapis/cloud/securitycenter/v1beta1;securitycenterb\x06proto3",
dependencies=[
google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,
google_dot_api_dot_resource__pb2.DESCRIPTOR,
google_dot_cloud_dot_securitycenter__v1beta1_dot_proto_dot_security__marks__pb2.DESCRIPTOR,
google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,
google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,
google_dot_api_dot_annotations__pb2.DESCRIPTOR,
],
)
_ASSET_SECURITYCENTERPROPERTIES = _descriptor.Descriptor(
name="SecurityCenterProperties",
full_name="google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="resource_name",
full_name="google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resource_name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=b"\340A\005",
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="resource_type",
full_name="google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resource_type",
index=1,
number=2,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="resource_parent",
full_name="google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resource_parent",
index=2,
number=3,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="resource_project",
full_name="google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resource_project",
index=3,
number=4,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="resource_owners",
full_name="google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties.resource_owners",
index=4,
number=5,
type=9,
cpp_type=9,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=None,
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=712,
serialized_end=865,
)
_ASSET_RESOURCEPROPERTIESENTRY = _descriptor.Descriptor(
name="ResourcePropertiesEntry",
full_name="google.cloud.securitycenter.v1beta1.Asset.ResourcePropertiesEntry",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="key",
full_name="google.cloud.securitycenter.v1beta1.Asset.ResourcePropertiesEntry.key",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="value",
full_name="google.cloud.securitycenter.v1beta1.Asset.ResourcePropertiesEntry.value",
index=1,
number=2,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[],
enum_types=[],
serialized_options=b"8\001",
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=867,
serialized_end=948,
)
_ASSET = _descriptor.Descriptor(
name="Asset",
full_name="google.cloud.securitycenter.v1beta1.Asset",
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name="name",
full_name="google.cloud.securitycenter.v1beta1.Asset.name",
index=0,
number=1,
type=9,
cpp_type=9,
label=1,
has_default_value=False,
default_value=b"".decode("utf-8"),
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="security_center_properties",
full_name="google.cloud.securitycenter.v1beta1.Asset.security_center_properties",
index=1,
number=2,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="resource_properties",
full_name="google.cloud.securitycenter.v1beta1.Asset.resource_properties",
index=2,
number=7,
type=11,
cpp_type=10,
label=3,
has_default_value=False,
default_value=[],
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="security_marks",
full_name="google.cloud.securitycenter.v1beta1.Asset.security_marks",
index=3,
number=8,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="create_time",
full_name="google.cloud.securitycenter.v1beta1.Asset.create_time",
index=4,
number=9,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
_descriptor.FieldDescriptor(
name="update_time",
full_name="google.cloud.securitycenter.v1beta1.Asset.update_time",
index=5,
number=10,
type=11,
cpp_type=10,
label=1,
has_default_value=False,
default_value=None,
message_type=None,
enum_type=None,
containing_type=None,
is_extension=False,
extension_scope=None,
serialized_options=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
),
],
extensions=[],
nested_types=[_ASSET_SECURITYCENTERPROPERTIES, _ASSET_RESOURCEPROPERTIESENTRY,],
enum_types=[],
serialized_options=b"\352AR\n#securitycenter.googleapis.com/Asset\022+organizations/{organization}/assets/{asset}",
is_extendable=False,
syntax="proto3",
extension_ranges=[],
oneofs=[],
serialized_start=312,
serialized_end=1035,
)
_ASSET_SECURITYCENTERPROPERTIES.containing_type = _ASSET
_ASSET_RESOURCEPROPERTIESENTRY.fields_by_name[
"value"
].message_type = google_dot_protobuf_dot_struct__pb2._VALUE
_ASSET_RESOURCEPROPERTIESENTRY.containing_type = _ASSET
_ASSET.fields_by_name[
"security_center_properties"
].message_type = _ASSET_SECURITYCENTERPROPERTIES
_ASSET.fields_by_name[
"resource_properties"
].message_type = _ASSET_RESOURCEPROPERTIESENTRY
_ASSET.fields_by_name[
"security_marks"
].message_type = (
google_dot_cloud_dot_securitycenter__v1beta1_dot_proto_dot_security__marks__pb2._SECURITYMARKS
)
_ASSET.fields_by_name[
"create_time"
].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP
_ASSET.fields_by_name[
"update_time"
].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP
DESCRIPTOR.message_types_by_name["Asset"] = _ASSET
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
Asset = _reflection.GeneratedProtocolMessageType(
"Asset",
(_message.Message,),
{
"SecurityCenterProperties": _reflection.GeneratedProtocolMessageType(
"SecurityCenterProperties",
(_message.Message,),
{
"DESCRIPTOR": _ASSET_SECURITYCENTERPROPERTIES,
"__module__": "google.cloud.securitycenter_v1beta1.proto.asset_pb2",
"__doc__": """Security Command Center managed properties. These properties are
managed by Security Command Center and cannot be modified by the user.
Attributes:
resource_name:
Immutable. The full resource name of the Google Cloud resource
this asset represents. This field is immutable after create
time. See: https://cloud.google.com/apis/design/resource_names
#full_resource_name
resource_type:
The type of the Google Cloud resource. Examples include:
APPLICATION, PROJECT, and ORGANIZATION. This is a case
insensitive field defined by Security Command Center and/or
the producer of the resource and is immutable after create
time.
resource_parent:
The full resource name of the immediate parent of the
resource. See: https://cloud.google.com/apis/design/resource_n
ames#full_resource_name
resource_project:
The full resource name of the project the resource belongs to.
See: https://cloud.google.com/apis/design/resource_names#full_
resource_name
resource_owners:
Owners of the Google Cloud resource.
""",
# @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Asset.SecurityCenterProperties)
},
),
"ResourcePropertiesEntry": _reflection.GeneratedProtocolMessageType(
"ResourcePropertiesEntry",
(_message.Message,),
{
"DESCRIPTOR": _ASSET_RESOURCEPROPERTIESENTRY,
"__module__": "google.cloud.securitycenter_v1beta1.proto.asset_pb2"
# @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Asset.ResourcePropertiesEntry)
},
),
"DESCRIPTOR": _ASSET,
"__module__": "google.cloud.securitycenter_v1beta1.proto.asset_pb2",
"__doc__": """Security Command Center representation of a Google Cloud resource.
The Asset is a Security Command Center resource that captures
information about a single Google Cloud resource. All modifications to
an Asset are only within the context of Security Command Center and
don’t affect the referenced Google Cloud resource.
Attributes:
name:
The relative resource name of this asset. See: https://cloud.g
oogle.com/apis/design/resource_names#relative_resource_name
Example: “organizations/{organization_id}/assets/{asset_id}”.
security_center_properties:
Security Command Center managed properties. These properties
are managed by Security Command Center and cannot be modified
by the user.
resource_properties:
Resource managed properties. These properties are managed and
defined by the Google Cloud resource and cannot be modified by
the user.
security_marks:
User specified security marks. These marks are entirely
managed by the user and come from the SecurityMarks resource
that belongs to the asset.
create_time:
The time at which the asset was created in Security Command
Center.
update_time:
The time at which the asset was last updated, added, or
deleted in Security Command Center.
""",
# @@protoc_insertion_point(class_scope:google.cloud.securitycenter.v1beta1.Asset)
},
)
_sym_db.RegisterMessage(Asset)
_sym_db.RegisterMessage(Asset.SecurityCenterProperties)
_sym_db.RegisterMessage(Asset.ResourcePropertiesEntry)
DESCRIPTOR._options = None
_ASSET_SECURITYCENTERPROPERTIES.fields_by_name["resource_name"]._options = None
_ASSET_RESOURCEPROPERTIESENTRY._options = None
_ASSET._options = None
# @@protoc_insertion_point(module_scope)
| 39.690021 | 1,587 | 0.659944 | 1,997 | 18,694 | 5.870806 | 0.12669 | 0.028659 | 0.075401 | 0.084613 | 0.65899 | 0.610201 | 0.549642 | 0.501962 | 0.438502 | 0.405664 | 0 | 0.031663 | 0.254948 | 18,694 | 470 | 1,588 | 39.774468 | 0.810095 | 0.028619 | 0 | 0.611236 | 1 | 0.004494 | 0.279235 | 0.122341 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.022472 | 0 | 0.022472 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ecf33c984ec4a562c7c83ec6b980f882d91e5038 | 80 | py | Python | Complier_Design/countlines/countlines.py | mayank-gubba/Compiler-Design | 2a8cc0ea04df90f4739db5a0f389daccc8788c63 | [
"MIT"
] | null | null | null | Complier_Design/countlines/countlines.py | mayank-gubba/Compiler-Design | 2a8cc0ea04df90f4739db5a0f389daccc8788c63 | [
"MIT"
] | null | null | null | Complier_Design/countlines/countlines.py | mayank-gubba/Compiler-Design | 2a8cc0ea04df90f4739db5a0f389daccc8788c63 | [
"MIT"
] | null | null | null | f=open('countlines.txt','rt')
n=0
for i in f:
n+=1
print(n)
f.close()
| 11.428571 | 30 | 0.5375 | 17 | 80 | 2.529412 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032787 | 0.2375 | 80 | 6 | 31 | 13.333333 | 0.672131 | 0 | 0 | 0 | 0 | 0 | 0.216216 | 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 |
01b1fb7fed838fdf7a7026298f0d7c45a668d3cc | 21,118 | py | Python | twitter-analytics/code/3-model_evaluation/precision/results.py | worldbank/SDG-big-data | 7349cffde3c32bb5a7abc99d910a40e1ba611916 | [
"MIT"
] | 2 | 2022-02-03T16:50:00.000Z | 2022-02-03T16:50:20.000Z | twitter-analytics/code/3-model_evaluation/precision/results.py | worldbank/SDG-big-data | 7349cffde3c32bb5a7abc99d910a40e1ba611916 | [
"MIT"
] | null | null | null | twitter-analytics/code/3-model_evaluation/precision/results.py | worldbank/SDG-big-data | 7349cffde3c32bb5a7abc99d910a40e1ba611916 | [
"MIT"
] | null | null | null | our_method_top50_dict = {
2: {
'is_hired_1mo': 0.98,
'is_unemployed': 0.98,
'lost_job_1mo': 0.74,
'job_search': 0.12,
'job_offer': 1.0},
0: {
'is_hired_1mo': 0.92,
'is_unemployed': 0.06,
'lost_job_1mo': 0.3,
'job_search': 1.0,
'job_offer': 1.0},
1: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.72,
'lost_job_1mo': 0.88,
'job_search': 1.0,
'job_offer': 1.0},
3: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.88,
'lost_job_1mo': 0.06,
'job_search': 1.0,
'job_offer': 1.0},
4: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.96,
'lost_job_1mo': 0.72,
'job_search': 1.0,
'job_offer': 1.0}}
adaptive_top50_dict = {
0: {
'is_hired_1mo': 0.92,
'is_unemployed': 0.06,
'lost_job_1mo': 0.3,
'job_search': 1.0,
'job_offer': 1.0},
3: {
'is_hired_1mo': 1.0,
'is_unemployed': 1.0,
'lost_job_1mo': 0.8,
'job_search': 1.0,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.96,
'is_unemployed': 0.92,
'lost_job_1mo': 0.4,
'job_search': 0.44,
'job_offer': 1.0},
2: {
'is_hired_1mo': 1.0,
'is_unemployed': 1.0,
'lost_job_1mo': 0.14,
'job_search': 1.0,
'job_offer': 0.98},
4: {
'is_hired_1mo': 1.0,
'is_unemployed': 1.0,
'lost_job_1mo': 1.0,
'job_search': 1.0,
'job_offer': 1.0}}
uncertainty_top50_dict = {
0: {
'is_hired_1mo': 0.92,
'is_unemployed': 0.06,
'lost_job_1mo': 0.3,
'job_search': 1.0,
'job_offer': 1.0},
3: {
'is_hired_1mo': 0.98,
'is_unemployed': 0.9,
'lost_job_1mo': 0.82,
'job_search': 1.0,
'job_offer': 1.0},
2: {
'is_hired_1mo': 0.64,
'is_unemployed': 1.0,
'lost_job_1mo': 0.92,
'job_search': 1.0,
'job_offer': 1.0},
1: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.98,
'lost_job_1mo': 0.12,
'job_search': 1.0,
'job_offer': 1.0},
4: {
'is_hired_1mo': 1.0,
'is_unemployed': 1.0,
'lost_job_1mo': 1.0,
'job_search': 1.0,
'job_offer': 1.0}}
uncertainty_uncalibrated_top50_dict = {
0: {
'is_hired_1mo': 0.92,
'is_unemployed': 0.06,
'lost_job_1mo': 0.3,
'job_search': 1.0,
'job_offer': 1.0},
3: {
'is_hired_1mo': 0.94,
'is_unemployed': 0.36,
'lost_job_1mo': 0.86,
'job_search': 1.0,
'job_offer': 0.28},
4: {
'is_hired_1mo': 0.54,
'is_unemployed': 0.98,
'lost_job_1mo': 0.02,
'job_search': 0.26,
'job_offer': 1.0},
2: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.78,
'lost_job_1mo': 0.94,
'job_search': 1.0,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.94,
'is_unemployed': 0.36,
'lost_job_1mo': 0.66,
'job_search': 1.0,
'job_offer': 0.98}}
our_method_top10K_dict = {
2: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.9285714285714286,
'lost_job_1mo': 0.32857142857142857,
'job_search': 0.5285714285714286,
'job_offer': 1.0},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.07142857142857142,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.9571428571428572,
'is_unemployed': 0.6285714285714286,
'lost_job_1mo': 0.5285714285714286,
'job_search': 0.8571428571428571,
'job_offer': 1.0},
3: {
'is_hired_1mo': 0.9714285714285714,
'is_unemployed': 0.5428571428571428,
'lost_job_1mo': 0.1,
'job_search': 1.0,
'job_offer': 1.0},
4: {
'is_hired_1mo': 0.9857142857142858,
'is_unemployed': 0.9285714285714286,
'lost_job_1mo': 0.5,
'job_search': 1.0,
'job_offer': 1.0}}
adaptive_top10K_dict = {
3: {
'is_hired_1mo': 0.8857142857142857,
'is_unemployed': 0.5857142857142857,
'lost_job_1mo': 0.5714285714285714,
'job_search': 1.0,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.9428571428571428,
'is_unemployed': 0.7142857142857143,
'lost_job_1mo': 0.14285714285714285,
'job_search': 0.38571428571428573,
'job_offer': 1.0},
2: {
'is_hired_1mo': 0.9285714285714286,
'is_unemployed': 0.8571428571428571,
'lost_job_1mo': 0.05714285714285714,
'job_search': 0.9571428571428572,
'job_offer': 1.0},
4: {
'is_hired_1mo': 0.8571428571428571,
'is_unemployed': 0.9714285714285714,
'lost_job_1mo': 0.5571428571428572,
'job_search': 0.9857142857142858,
'job_offer': 1.0},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.07142857142857142,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
}
uncertainty_top10K_dict = {
3: {
'is_hired_1mo': 0.9857142857142858,
'is_unemployed': 0.9,
'lost_job_1mo': 0.5571428571428572,
'job_search': 1.0,
'job_offer': 1.0},
2: {
'is_hired_1mo': 0.6571428571428571,
'is_unemployed': 0.9,
'lost_job_1mo': 0.4714285714285714,
'job_search': 0.9714285714285714,
'job_offer': 1.0},
1: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.6428571428571429,
'lost_job_1mo': 0.11428571428571428,
'job_search': 1.0,
'job_offer': 1.0},
4: {
'is_hired_1mo': 0.8571428571428571,
'is_unemployed': 0.8714285714285714,
'lost_job_1mo': 0.5571428571428572,
'job_search': 0.9857142857142858,
'job_offer': 1.0},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.07142857142857142,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
}
uncertainty_uncalibrated_top10k_dict = {
3: {
'is_hired_1mo': 1.0,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.45714285714285713,
'job_search': 0.9857142857142858,
'job_offer': 0.0},
4: {
'is_hired_1mo': 0.6857142857142857,
'is_unemployed': 0.6714285714285714,
'lost_job_1mo': 0.07142857142857142,
'job_search': 0.5714285714285714,
'job_offer': 1.0},
2: {
'is_hired_1mo': 0.9857142857142858,
'is_unemployed': 0.5428571428571428,
'lost_job_1mo': 0.6142857142857143,
'job_search': 0.9857142857142858,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.9571428571428572,
'is_unemployed': 0.21428571428571427,
'lost_job_1mo': 0.22857142857142856,
'job_search': 0.6857142857142857,
'job_offer': 0.9428571428571428},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.07142857142857142,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
}
our_method_topP_dict = {
2: {
'is_hired_1mo': 0.8666666666666667,
'is_unemployed': 1.0,
'lost_job_1mo': 0.55,
'job_search': 0.6,
'job_offer': 1.0},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.1724137931034483,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.7,
'lost_job_1mo': 0.85,
'job_search': 0.8375,
'job_offer': 1.0},
3: {
'is_hired_1mo': 0.77,
'is_unemployed': 0.5222222222222223,
'lost_job_1mo': 0.1,
'job_search': 0.96,
'job_offer': 0.98},
4: {
'is_hired_1mo': 0.9375,
'is_unemployed': 0.8111111111111111,
'lost_job_1mo': 0.5833333333333334,
'job_search': 0.7142857142857143,
'job_offer': 0.9866666666666667}}
adaptive_topP_dict = {
3: {
'is_hired_1mo': 0.8857142857142857,
'is_unemployed': 0.9512195121951219,
'lost_job_1mo': 0.8,
'job_search': 0.91,
'job_offer': 0.98},
1: {
'is_hired_1mo': 0.875,
'is_unemployed': 0.6875,
'lost_job_1mo': 0.3,
'job_search': 0.4,
'job_offer': 0.9733333333333334},
2: {
'is_hired_1mo': 0.8875,
'is_unemployed': 0.9666666666666667,
'lost_job_1mo': 0.1,
'job_search': 0.9166666666666666,
'job_offer': 0.94},
4: {
'is_hired_1mo': 0.8571428571428571,
'is_unemployed': 0.9,
'lost_job_1mo': 0.76,
'job_search': 0.95,
'job_offer': 0.98},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.1724137931034483,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
}
uncertainty_topP_dict = {
3: {
'is_hired_1mo': 0.9333333333333333,
'is_unemployed': 0.7555555555555555,
'lost_job_1mo': 0.78,
'job_search': 0.9,
'job_offer': 0.9533333333333334},
2: {
'is_hired_1mo': 0.6444444444444445,
'is_unemployed': 0.825,
'lost_job_1mo': 0.75,
'job_search': 0.95,
'job_offer': 1.0},
1: {
'is_hired_1mo': 0.7454545454545455,
'is_unemployed': 0.7333333333333333,
'lost_job_1mo': 0.175,
'job_search': 0.89,
'job_offer': 0.94},
4: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.8,
'lost_job_1mo': 0.6333333333333333,
'job_search': 0.8,
'job_offer': 0.9666666666666667},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.1724137931034483,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
}
uncertainty_uncalibrated_topP_dict = {
3: {
'is_hired_1mo': 0.9555555555555556,
'is_unemployed': 0.1,
'lost_job_1mo': 0.85,
'job_search': 0.9666666666666667,
'job_offer': 0.0},
4: {
'is_hired_1mo': 0.7,
'is_unemployed': 0.6714285714285714,
'lost_job_1mo': 0.07142857142857142,
'job_search': 0.59,
'job_offer': 0.9666666666666667},
2: {
'is_hired_1mo': 0.8777777777777778,
'is_unemployed': 0.43333333333333335,
'lost_job_1mo': 0.7,
'job_search': 0.9333333333333333,
'job_offer': 0.9857142857142858},
1: {
'is_hired_1mo': 0.6727272727272727,
'is_unemployed': 0.358974358974359,
'lost_job_1mo': 0.5333333333333333,
'job_search': 0.7166666666666667,
'job_offer': 0.94},
0: {
'is_hired_1mo': 0.8,
'is_unemployed': 0.08571428571428572,
'lost_job_1mo': 0.1724137931034483,
'job_search': 0.8714285714285714,
'job_offer': 1.0},
}
our_method_new_dict = {
4: {
'job_search': {
'numerator': 273734,
'sem': 17108.4445409312},
'is_hired_1mo': {
'numerator': 14419,
'sem': 366.99671598899175},
'lost_job_1mo': {
'numerator': 2227,
'sem': 539.6417202779419},
'is_unemployed': {
'numerator': 21711,
'sem': 12857.60055036169},
'job_offer': {
'numerator': 398140,
'sem': 44551.92694544843}},
0: {
'is_unemployed': {
'numerator': 5363,
'sem': 16693273.716407115},
'job_search': {
'numerator': 9955,
'sem': 4007.9818390547352},
'lost_job_1mo': {
'numerator': 110,
'sem': 2507.0304745155704},
'is_hired_1mo': {
'numerator': 5876,
'sem': 1440.5507101946998},
'job_offer': {
'numerator': 397551,
'sem': 21053.672213431728}},
3: {
'is_hired_1mo': {
'numerator': 32170,
'sem': 15120.377307912013},
'lost_job_1mo': {
'numerator': 6611,
'sem': 2235705.395599921},
'is_unemployed': {
'numerator': 25741,
'sem': 7611.7323763009435},
'job_offer': {
'numerator': 603974,
'sem': 68313.02689650582},
'job_search': {
'numerator': 53456,
'sem': 7483.790444209734}},
2: {
'is_unemployed': {
'numerator': 4646,
'sem': 626.9208018618386},
'is_hired_1mo': {
'numerator': 18584,
'sem': 3451.8503622544213},
'job_offer': {
'numerator': 398040,
'sem': 11364.921234701022},
'job_search': {
'numerator': 63723,
'sem': 10846.197020221041},
'lost_job_1mo': {
'numerator': 413,
'sem': 306.64505669819584}},
1: {
'is_hired_1mo': {
'numerator': 22382,
'sem': 11409.994092103772},
'job_offer': {
'numerator': 388810,
'sem': 14451.582794272697},
'lost_job_1mo': {
'numerator': 437,
'sem': 175.86948118261208},
'is_unemployed': {
'numerator': 2813,
'sem': 948.9439720005547},
'job_search': {
'numerator': 16140,
'sem': 4210.272625790964}}}
adaptive_new_dict = {
0: {
'is_unemployed': {
'numerator': 5363,
'sem': 16693273.716407115},
'job_search': {
'numerator': 9955,
'sem': 4007.9818390547352},
'lost_job_1mo': {
'numerator': 110,
'sem': 2507.0304745155704},
'is_hired_1mo': {
'numerator': 5876,
'sem': 1440.5507101946998},
'job_offer': {
'numerator': 397551,
'sem': 21053.672213431728}},
1: {
'is_unemployed': {
'numerator': 12031,
'sem': 7726.799776019945},
'lost_job_1mo': {
'numerator': 111,
'sem': 515.2125927164042},
'job_search': {
'numerator': 13663,
'sem': 5549.774344602734},
'is_hired_1mo': {
'numerator': 13799,
'sem': 5795.455532339655},
'job_offer': {
'numerator': 452457,
'sem': 62954.13118906742}},
2: {
'job_search': {
'numerator': 153855,
'sem': 11781.304215985185},
'is_unemployed': {
'numerator': 4371,
'sem': 1269.4789663340573},
'job_offer': {
'numerator': 573631,
'sem': 56246.765267860545},
'lost_job_1mo': {
'numerator': 418,
'sem': 5649172.944711616},
'is_hired_1mo': {
'numerator': 16584,
'sem': 3087.7931741284956}},
4: {
'is_unemployed': {
'numerator': 16014,
'sem': 6253.689632372853},
'is_hired_1mo': {
'numerator': 8766,
'sem': 2875.0965294760767},
'lost_job_1mo': {
'numerator': 1238,
'sem': 480.9785550015688},
'job_search': {
'numerator': 17117,
'sem': 1808.3838577036793},
'job_offer': {
'numerator': 502520,
'sem': 41362.28738283996}},
3: {
'is_unemployed': {
'numerator': 1002,
'sem': 418.159029977143},
'is_hired_1mo': {
'numerator': 7953,
'sem': 1637.1488788134022},
'job_search': {
'numerator': 46384,
'sem': 3869.1915428802877},
'lost_job_1mo': {
'numerator': 1047,
'sem': 266.4834153426912},
'job_offer': {
'numerator': 512423,
'sem': 41770.65447128737}}}
uncertainty_new_dict = {
4: {
'lost_job_1mo': {
'numerator': 2340,
'sem': 1014.7282972059196},
'job_search': {
'numerator': 78380,
'sem': 97346.85658409167},
'is_unemployed': {
'numerator': 14536,
'sem': 6791.858226085842},
'is_hired_1mo': {
'numerator': 10119,
'sem': 2972.5758399128595},
'job_offer': {
'numerator': 401625,
'sem': 21081.31529751928}},
1: {
'is_unemployed': {
'numerator': 3228,
'sem': 1228.0100832225278},
'lost_job_1mo': {
'numerator': 552,
'sem': 4469674.866698298},
'job_offer': {
'numerator': 612708,
'sem': 57112.29214399502},
'job_search': {
'numerator': 42962,
'sem': 27601.546048149256},
'is_hired_1mo': {
'numerator': 97768,
'sem': 47307.47888641291}},
3: {
'job_search': {
'numerator': 93841,
'sem': 31369.23556608593},
'job_offer': {
'numerator': 516548,
'sem': 88235.57752764622},
'is_unemployed': {
'numerator': 20132,
'sem': 5044.345309986642},
'lost_job_1mo': {
'numerator': 1070,
'sem': 214.21570463056867},
'is_hired_1mo': {
'numerator': 27930,
'sem': 3577.721669440321}},
2: {
'is_hired_1mo': {
'numerator': 20810,
'sem': 2861.0333260285565},
'is_unemployed': {
'numerator': 12728,
'sem': 1700.1869141976804},
'job_offer': {
'numerator': 398092,
'sem': 10243.721819469301},
'lost_job_1mo': {
'numerator': 637,
'sem': 241.20102291602242},
'job_search': {
'numerator': 51418,
'sem': 2575.3470007528185}},
0: {
'is_unemployed': {
'numerator': 5363,
'sem': 16693273.716407115},
'job_search': {
'numerator': 9955,
'sem': 4007.9818390547352},
'lost_job_1mo': {
'numerator': 110,
'sem': 2507.0304745155704},
'is_hired_1mo': {
'numerator': 5876,
'sem': 1440.5507101946998},
'job_offer': {
'numerator': 397551,
'sem': 21053.672213431728}},
}
uncertainty_uncalibrated_new_dict = {
0: {
'is_unemployed': {
'numerator': 5363,
'sem': 16693273.716407115},
'job_search': {
'numerator': 9955,
'sem': 4007.9818390547352},
'lost_job_1mo': {
'numerator': 110,
'sem': 2507.0304745155704},
'is_hired_1mo': {
'numerator': 5876,
'sem': 1440.5507101946998},
'job_offer': {
'numerator': 397551,
'sem': 21053.672213431728}},
4: {
'lost_job_1mo': {
'numerator': 8916,
'sem': 11036527.93587803},
'is_unemployed': {
'numerator': 7001,
'sem': 21549.54012277195},
'is_hired_1mo': {
'numerator': 27676,
'sem': 2636.147839352088},
'job_offer': {
'numerator': 625859,
'sem': 29576.835392492},
'job_search': {
'numerator': 50729,
'sem': 9656.648068224675}},
3: {
'job_search': {
'numerator': 29614,
'sem': 2545.5133076343727},
'is_unemployed': {
'numerator': 1031,
'sem': 2525.835113127583},
'is_hired_1mo': {
'numerator': 21080,
'sem': 2532.796165703048},
'lost_job_1mo': {
'numerator': 738,
'sem': 250.86318309712837},
'job_offer': {
'numerator': 10,
'sem': 0}},
2: {
'is_hired_1mo': {
'numerator': 28655,
'sem': 2430.142652865983},
'lost_job_1mo': {
'numerator': 2937,
'sem': 831.243117876841},
'job_search': {
'numerator': 23071,
'sem': 3054.9995697587638},
'job_offer': {
'numerator': 376527,
'sem': 28485.961558385043},
'is_unemployed': {
'numerator': 25294,
'sem': 6380.589292580216}},
1: {
'job_search': {
'numerator': 2863,
'sem': 1345.1047321110705},
'lost_job_1mo': {
'numerator': 131,
'sem': 105.74747007400558},
'is_unemployed': {
'numerator': 326,
'sem': 762.636610213694},
'job_offer': {
'numerator': 437090,
'sem': 29739.845930574476},
'is_hired_1mo': {
'numerator': 76054,
'sem': 24013.321646355937}}}
| 29.371349 | 45 | 0.501468 | 2,195 | 21,118 | 4.551253 | 0.169932 | 0.042442 | 0.08008 | 0.063864 | 0.485886 | 0.47007 | 0.45996 | 0.445846 | 0.37958 | 0.344444 | 0 | 0.341807 | 0.348044 | 21,118 | 718 | 46 | 29.412256 | 0.383789 | 0 | 0 | 0.583215 | 0 | 0 | 0.268965 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 |
01b72b0593884ff384b5d1980a8c8e4c10c0d986 | 3,271 | py | Python | tests/starkex/test_helpers.py | clifton/dydx-v3-python | 974ffc8f3512aa48171ef8dc2e623d6df3536812 | [
"Apache-2.0"
] | 109 | 2021-01-07T02:19:24.000Z | 2022-03-27T21:56:36.000Z | tests/starkex/test_helpers.py | clifton/dydx-v3-python | 974ffc8f3512aa48171ef8dc2e623d6df3536812 | [
"Apache-2.0"
] | 73 | 2021-01-14T23:29:58.000Z | 2022-03-30T09:27:54.000Z | tests/starkex/test_helpers.py | clifton/dydx-v3-python | 974ffc8f3512aa48171ef8dc2e623d6df3536812 | [
"Apache-2.0"
] | 60 | 2021-01-13T04:34:12.000Z | 2022-03-26T10:14:35.000Z | from dydx3.starkex.helpers import fact_to_condition
from dydx3.starkex.helpers import generate_private_key_hex_unsafe
from dydx3.starkex.helpers import get_transfer_erc20_fact
from dydx3.starkex.helpers import nonce_from_client_id
from dydx3.starkex.helpers import private_key_from_bytes
from dydx3.starkex.helpers import private_key_to_public_hex
from dydx3.starkex.helpers import private_key_to_public_key_pair_hex
class TestHelpers():
def test_nonce_from_client_id(self):
assert nonce_from_client_id('') == 2018687061
assert nonce_from_client_id('1') == 3079101259
assert nonce_from_client_id('a') == 2951628987
assert nonce_from_client_id(
'A really long client ID used to identify an order or withdrawal',
) == 2913863714
assert nonce_from_client_id(
'A really long client ID used to identify an order or withdrawal!',
) == 230317226
def test_get_transfer_erc20_fact(self):
assert get_transfer_erc20_fact(
recipient='0x1234567890123456789012345678901234567890',
token_decimals=3,
human_amount=123.456,
token_address='0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
salt=int('0x1234567890abcdef', 16),
).hex() == (
'34052387b5efb6132a42b244cff52a85a507ab319c414564d7a89207d4473672'
)
def test_fact_to_condition(self):
fact = bytes.fromhex(
'cf9492ae0554c642b57f5d9cabee36fb512dd6b6629bdc51e60efb3118b8c2d8'
)
condition = fact_to_condition(
'0xe4a295420b58a4a7aa5c98920d6e8a0ef875b17a',
fact,
)
assert hex(condition) == (
'0x4d794792504b063843afdf759534f5ed510a3ca52e7baba2e999e02349dd24'
)
def test_generate_private_key_hex_unsafe(self):
assert (
generate_private_key_hex_unsafe() !=
generate_private_key_hex_unsafe()
)
def test_private_key_from_bytes(self):
assert (
private_key_from_bytes(b'0') ==
'0x2242959533856f2a03f3c7d9431e28ef4fe5cb2a15038c37f1d76d35dc508b'
)
assert (
private_key_from_bytes(b'a') ==
'0x1d61128b46faa109512e0e00fe9adf5ff52047ed61718eeeb7c0525dfcd2f8e'
)
assert (
private_key_from_bytes(
b'really long input data for key generation with the '
b'keyPairFromData() function'
) ==
'0x7c4946831bde597b73f1d5721af9c67731eafeb75c1b8e92ac457a61819a29'
)
def test_private_key_to_public_hex(self):
assert private_key_to_public_hex(
'0x2242959533856f2a03f3c7d9431e28ef4fe5cb2a15038c37f1d76d35dc508b',
) == (
'0x69a33d37101d7089b606f92e4b41553c237a474ad9d6f62eeb6708415f98f4d'
)
def test_private_key_to_public_key_pair_hex(self):
x, y = private_key_to_public_key_pair_hex(
'0x2242959533856f2a03f3c7d9431e28ef4fe5cb2a15038c37f1d76d35dc508b',
)
assert x == (
'0x69a33d37101d7089b606f92e4b41553c237a474ad9d6f62eeb6708415f98f4d'
)
assert y == (
'0x717e78b98a53888aa7685b91137fa01b9336ce7d25f874dbfb8d752c6ac610d'
)
| 38.034884 | 79 | 0.687252 | 285 | 3,271 | 7.512281 | 0.280702 | 0.070061 | 0.052312 | 0.075199 | 0.364316 | 0.225596 | 0.163008 | 0.113965 | 0.113965 | 0.070061 | 0 | 0.252149 | 0.253134 | 3,271 | 85 | 80 | 38.482353 | 0.624233 | 0 | 0 | 0.131579 | 1 | 0 | 0.32406 | 0.254968 | 0 | 0 | 0.221339 | 0 | 0.184211 | 1 | 0.092105 | false | 0 | 0.092105 | 0 | 0.197368 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
01b9fb0dcb34ad54ce72e603cada3bbd96533d47 | 886 | py | Python | docs/src/tutorial/doctest_setup.py | franzinc/agraph-python | 9186f19094af0be1daec273270888eadf9a68300 | [
"MIT"
] | 25 | 2015-11-05T03:43:30.000Z | 2022-03-09T07:19:09.000Z | docs/src/tutorial/doctest_setup.py | franzinc/agraph-python | 9186f19094af0be1daec273270888eadf9a68300 | [
"MIT"
] | 14 | 2017-07-18T20:41:26.000Z | 2021-10-13T04:57:36.000Z | docs/src/tutorial/doctest_setup.py | franzinc/agraph-python | 9186f19094af0be1daec273270888eadf9a68300 | [
"MIT"
] | 8 | 2016-12-09T02:38:45.000Z | 2020-10-12T07:59:17.000Z | # This document contains definitions of functions and variables used
# in multiple tutorial examples. Each code fragment is actually passed to Sphinx
# twice:
# - This whole file is imported in a hidden, global setup block
# - The example in which the function is defined included its code from this
# file.
#
# The reason for all this is that definitions in one document, even if contained
# in a 'testsetup:: *' block, are not visible in other documents. The global
# setup block is the only way of sharing definitions, but we still want them
# presented in the appropriate part of the tutorial.
#
# Each fragment is surrounded by START-<NAME> and END-<NAME> markers to allow
# easy inclusions through the literalinclude directive.
# BEGIN-CONNECT
from franz.openrdf.connect import ag_connect
conn = ag_connect('python-tutorial', create=True, clear=True)
# END-CONNECT
| 40.272727 | 81 | 0.76298 | 134 | 886 | 5.029851 | 0.641791 | 0.029674 | 0.047478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177201 | 886 | 21 | 82 | 42.190476 | 0.924554 | 0.8386 | 0 | 0 | 0 | 0 | 0.12 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
01cf0cf013ad1e38898303cfa29c46f532ab41aa | 322 | py | Python | exercinpt2.py | fabianocardosodev/exercicios-Python-cursoIntens | aae9f334007afe5e5210c19f092bb35659db1332 | [
"MIT"
] | null | null | null | exercinpt2.py | fabianocardosodev/exercicios-Python-cursoIntens | aae9f334007afe5e5210c19f092bb35659db1332 | [
"MIT"
] | null | null | null | exercinpt2.py | fabianocardosodev/exercicios-Python-cursoIntens | aae9f334007afe5e5210c19f092bb35659db1332 | [
"MIT"
] | null | null | null | pessoas_jantar = input("Boa noite,quantas pessoas estão para jantar?:")
pessoas_jantar = int(pessoas_jantar)
if pessoas_jantar >= 8:
print("Desculpe como vocês estão em " + str(pessoas_jantar)
+ " pessoas,precisarão aguardar termos mesas disponiveis.")
else:
print("Ok! Por favor me acompanhe até sua mesa!")
| 35.777778 | 71 | 0.736025 | 44 | 322 | 5.272727 | 0.704545 | 0.280172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003704 | 0.161491 | 322 | 8 | 72 | 40.25 | 0.855556 | 0 | 0 | 0 | 0 | 0 | 0.521739 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
01d2cd9268ce30dc27e2254547374724c8e953ed | 1,487 | py | Python | tests/test_either.py | hellerve/hawkweed | 0cdb378f7dac5ab76ad53d6c1917f0ac5687793c | [
"MIT"
] | 20 | 2016-06-13T19:24:20.000Z | 2022-01-26T14:08:11.000Z | tests/test_either.py | hellerve/hawkweed | 0cdb378f7dac5ab76ad53d6c1917f0ac5687793c | [
"MIT"
] | null | null | null | tests/test_either.py | hellerve/hawkweed | 0cdb378f7dac5ab76ad53d6c1917f0ac5687793c | [
"MIT"
] | null | null | null | from itertools import chain
from nose.tools import *
from hawkweed.monads.either import Either, Left, Right, is_right,\
is_left, is_either, either, lefts, rights, partition_eithers
from hawkweed.functional.primitives import identity
def test_right():
assert_equal(Right(10).bind(identity), 10)
def test_nothing():
l = Left("failure")
assert_equal(l.bind(lambda _: "lol"), l)
def test_is_right():
assert_true(is_right(Right(10)))
assert_false(is_right(Left("no")))
assert_false(is_right(10))
def test_is_left():
assert_true(is_left(Left("yes")))
assert_false(is_left(Right(10)))
assert_false(is_left(10))
def test_is_either():
assert_true(is_either(Right(10)))
assert_true(is_either(Left("yes")))
assert_false(is_either(10))
def test_either():
v = "val"
either(lambda x: assert_equal(Left(v), x), None, Left(v))
either(None, lambda x: assert_equal(v, x), Right(v))
with assert_raises(ValueError):
either(None, None, 10)
def test_lefts():
l = [Left("failure"), Left("i died"), Left("noes")]
lr = l + [Right(1)]
assert_equal(list(lefts(lr)), l)
def test_rights():
r = [Right(x) for x in range(4)]
rl = [Left("moo")] + r
assert_equal(list(rights(rl)), r)
def test_partition_eithers():
r = [Right(x) for x in range(4)]
l = [Left(x) for x in ["failure"] * 4]
rl = list(chain.from_iterable(zip(r, l)))
assert_equal([list(x) for x in partition_eithers(rl)], [l, r])
| 29.156863 | 68 | 0.66039 | 235 | 1,487 | 3.982979 | 0.238298 | 0.067308 | 0.048077 | 0.029915 | 0.126068 | 0.040598 | 0.040598 | 0.040598 | 0 | 0 | 0 | 0.017989 | 0.177539 | 1,487 | 50 | 69 | 29.74 | 0.747343 | 0 | 0 | 0.04878 | 0 | 0 | 0.03228 | 0 | 0 | 0 | 0 | 0 | 0.414634 | 1 | 0.219512 | false | 0 | 0.097561 | 0 | 0.317073 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
01d38ff57509a295667c3e8d6da376bdaf58020c | 497 | py | Python | plugins/custom_resolver/run_test/custom_resolver.py | jingtaoh/USD-Cookbook | 544a149407146f9a3e13c53348818579c679168b | [
"MIT"
] | 332 | 2019-06-11T01:26:05.000Z | 2022-03-29T10:09:46.000Z | plugins/custom_resolver/run_test/custom_resolver.py | jingtaoh/USD-Cookbook | 544a149407146f9a3e13c53348818579c679168b | [
"MIT"
] | 5 | 2019-07-30T15:10:51.000Z | 2021-03-14T18:55:18.000Z | plugins/custom_resolver/run_test/custom_resolver.py | jingtaoh/USD-Cookbook | 544a149407146f9a3e13c53348818579c679168b | [
"MIT"
] | 63 | 2019-06-24T16:31:19.000Z | 2022-02-13T01:09:56.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module tests if the custom resolver works."""
# IMPORT FUTURE LIBRARIES
from __future__ import print_function
# IMPORT THIRD-PARTY LIBRARIES
from pxr import Ar
def main():
"""Run the main execution of the current script."""
print("This should still print an empty string", Ar.GetResolver().Resolve("this_wont_resolve"))
print("This should print /bar", Ar.GetResolver().Resolve("/foo"))
if __name__ == "__main__":
main()
| 23.666667 | 99 | 0.696177 | 68 | 497 | 4.867647 | 0.632353 | 0.07855 | 0.090634 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00241 | 0.16499 | 497 | 20 | 100 | 24.85 | 0.795181 | 0.380282 | 0 | 0 | 0 | 0 | 0.306122 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | true | 0 | 0.285714 | 0 | 0.428571 | 0.428571 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
01d7082fd7f836454b618da99522a7ac4d194f3d | 239 | py | Python | Semana03Atividade1/Questao04_S3.py | Marvingms7/IFPI | 0f6d50e4a7e1016e58cd227b477b3ce08e19c61a | [
"MIT"
] | null | null | null | Semana03Atividade1/Questao04_S3.py | Marvingms7/IFPI | 0f6d50e4a7e1016e58cd227b477b3ce08e19c61a | [
"MIT"
] | null | null | null | Semana03Atividade1/Questao04_S3.py | Marvingms7/IFPI | 0f6d50e4a7e1016e58cd227b477b3ce08e19c61a | [
"MIT"
] | null | null | null | def total(n):
return n <= 9 and n >= 0
def main():
n = int(input("Digite um numero entre 0 e 9, caso contrario será falso: "))
resultado = total(n)
print(f' o numero é {resultado}')
if __name__ == '__main__':
main() | 19.916667 | 79 | 0.594142 | 38 | 239 | 3.526316 | 0.684211 | 0.089552 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022599 | 0.259414 | 239 | 12 | 80 | 19.916667 | 0.734463 | 0 | 0 | 0 | 0 | 0 | 0.366667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.125 | 0.375 | 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 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
01e9f4be4d320ba23c0c303bca3640fbb9868169 | 912 | py | Python | models.py | Fernan1122/BusinessWork_Back | 41dd2351fce84a8f27a3309919fa9a3782a36581 | [
"CC0-1.0"
] | null | null | null | models.py | Fernan1122/BusinessWork_Back | 41dd2351fce84a8f27a3309919fa9a3782a36581 | [
"CC0-1.0"
] | null | null | null | models.py | Fernan1122/BusinessWork_Back | 41dd2351fce84a8f27a3309919fa9a3782a36581 | [
"CC0-1.0"
] | null | null | null | from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, DATE
from sqlalchemy.orm import relationship
from database import Base
class User(Base):
__tablename__ = "users"
username = Column(String, primary_key=True, index=True)
email = Column(String, unique=True, index=True)
name = Column(String, index=True)
last_name = Column(String, index=True)
celular = Column(String, index=True)
user_password = Column(String)
documents = relationship("Documents", back_populates="owner")
class Documents(Base):
__tablename__ = "documents"
id = Column(Integer, primary_key=True, index=True)
name_doc = Column(String, index=True)
exp = Column(DATE, index=True)
notif = Column(Integer)
descrip = Column(String, index=True)
owner_username = Column(String, ForeignKey("users.username"))
owner = relationship("User", back_populates="documents") | 30.4 | 73 | 0.717105 | 109 | 912 | 5.853211 | 0.33945 | 0.169279 | 0.133229 | 0.164577 | 0.15047 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171053 | 912 | 30 | 74 | 30.4 | 0.843915 | 0 | 0 | 0 | 0 | 0 | 0.060241 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.047619 | 0.142857 | 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 |
bf0e66a445373f2adf94f414be7ffb5262153960 | 347 | py | Python | src/dp/rest_api/v1/handlers/user/__init__.py | Michalesko/DP_API | 73e27bf0bb06330d7903977d8cd4d1fdb57afaec | [
"MIT"
] | null | null | null | src/dp/rest_api/v1/handlers/user/__init__.py | Michalesko/DP_API | 73e27bf0bb06330d7903977d8cd4d1fdb57afaec | [
"MIT"
] | null | null | null | src/dp/rest_api/v1/handlers/user/__init__.py | Michalesko/DP_API | 73e27bf0bb06330d7903977d8cd4d1fdb57afaec | [
"MIT"
] | null | null | null | # coding: utf-8
__author__ = 'Miso'
from users import UsersHandlerOne
from users import UsersHandler
from userGoal import UserHandlerGoal
from userEvalInit import UserHandlerInitialEval
from userEvalPage import UserHandlerRuntimeEval
from usersPages import UserPages
from userPageRating import UserPageRating
from userTime import UserHandlerTime
| 28.916667 | 47 | 0.870317 | 37 | 347 | 8.054054 | 0.567568 | 0.060403 | 0.100671 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003247 | 0.112392 | 347 | 11 | 48 | 31.545455 | 0.964286 | 0.037464 | 0 | 0 | 0 | 0 | 0.012048 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.888889 | 0 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
bf177089627f5ddc4e51c39b1edceeffd57fa2df | 448 | py | Python | user/models.py | yangfeiffei/Dsystem | 8c4b677151d8a9777c265b0a8744c068d122e780 | [
"MIT"
] | null | null | null | user/models.py | yangfeiffei/Dsystem | 8c4b677151d8a9777c265b0a8744c068d122e780 | [
"MIT"
] | null | null | null | user/models.py | yangfeiffei/Dsystem | 8c4b677151d8a9777c265b0a8744c068d122e780 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import Permission, User
# Create your models here.
class UserProfile(models.Model):
'''
用户相关
'''
user = models.OneToOneField(User)
name = models.CharField(u'姓名', max_length=16, )
signature = models.CharField(u'个性签名', max_length=255,
blank=True, null=True)
def __str__(self):
return self.user.username
| 14.451613 | 57 | 0.620536 | 53 | 448 | 5.132075 | 0.660377 | 0.073529 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015385 | 0.274554 | 448 | 30 | 58 | 14.933333 | 0.821538 | 0.066964 | 0 | 0 | 0 | 0 | 0.015385 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.222222 | 0.111111 | 0.888889 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
bf263358cca6a5023f37c9389d03052cb032d44a | 5,338 | py | Python | tests/test.py | Marselliy/tf-aug | 478a632e1822722a74397a169b0b63bd0c5692e7 | [
"MIT"
] | 1 | 2019-01-11T15:36:24.000Z | 2019-01-11T15:36:24.000Z | tests/test.py | Marselliy/tf-aug | 478a632e1822722a74397a169b0b63bd0c5692e7 | [
"MIT"
] | null | null | null | tests/test.py | Marselliy/tf-aug | 478a632e1822722a74397a169b0b63bd0c5692e7 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'src'))
import tensorflow as tf
from tf_imgaug.sequential import Sequential
from tf_imgaug.augments import *
import unittest
class TestAugments(unittest.TestCase):
def _abstract_shape_test(self, aug=None):
if aug is None:
return
tf.reset_default_graph()
img = tf.random.uniform((1, 64, 64, 3), 0., 1., dtype=tf.float32)
kpts = tf.random.uniform((1, 1, 2), 0., 64., dtype=tf.float32)
bboxes = tf.random.uniform((1, 1, 4), 0., 64., dtype=tf.float32)
segmaps = tf.random.uniform((1, 64, 64, 2), 0., 1., dtype=tf.float32)
if type(aug) != list:
aug = [aug]
img_aug, kpts_aug, bboxes_aug, segmaps_aug = Sequential(aug, n_augments=1)(img, kpts, bboxes, segmaps)
self.assertEqual(img.shape, img_aug.shape)
self.assertEqual(kpts.shape, kpts_aug.shape)
self.assertEqual(bboxes.shape, bboxes_aug.shape)
self.assertEqual(segmaps.shape, segmaps_aug.shape)
def test_translate(self):
self._abstract_shape_test(Translate(dict(x=(-0.1, 0.1), y=(-0.1, 0.1))))
def test_rotate(self):
self._abstract_shape_test(Rotate((-30, 30)))
def test_cropandpad(self):
self._abstract_shape_test(CropAndPad((-0.1, 0.1)))
def test_fliplr(self):
self._abstract_shape_test(Fliplr())
def test_flipud(self):
self._abstract_shape_test(Flipud())
def test_sometimes(self):
self._abstract_shape_test(Sometimes(0.5, Rotate((-30, 30))))
def test_someof(self):
self._abstract_shape_test(SomeOf((0, None), [Rotate((-30, 30)), Fliplr()]))
def test_oneof(self):
self._abstract_shape_test(OneOf([Rotate((-30, 30)), Fliplr()]))
def test_jpegcompression(self):
self._abstract_shape_test(JpegCompression(20, 80))
def test_salt(self):
self._abstract_shape_test(Salt())
def test_pepper(self):
self._abstract_shape_test(Pepper())
def test_coarsesalt(self):
self._abstract_shape_test(CoarseSalt())
def test_coarsepepper(self):
self._abstract_shape_test(CoarsePepper())
def test_dropout(self):
self._abstract_shape_test(Dropout())
def test_additivegaussiannoise(self):
self._abstract_shape_test(AdditiveGaussianNoise((0.1, 0.4)))
def test_grayscale(self):
self._abstract_shape_test(Grayscale((0, 1)))
def test_add(self):
self._abstract_shape_test(Add((-0.5, 0.5)))
def test_multiply(self):
self._abstract_shape_test(Multiply((0.5, 2.)))
def test_randomresize(self):
self._abstract_shape_test(RandomResize((0.25, 0.9)))
def test_linearcontrast(self):
self._abstract_shape_test(LinearContrast((0.5, 2.)))
def test_gammacontrast(self):
self._abstract_shape_test(GammaContrast((0., 1.)))
def test_sigmoidcontrast(self):
self._abstract_shape_test(SigmoidContrast(2, 10))
def test_elastictransform(self):
self._abstract_shape_test(ElasticTransform((0.001, 0.1)))
def test_elasticwarp(self):
self._abstract_shape_test(ElasticWarp((2, 5), (0.01, 0.06), 'bicubic'))
def test_hard(self):
aug = [
Fliplr(0.5),
Sometimes(0.5,
SomeOf(
(1, None),
[
OneOf([
AdditiveGaussianNoise((0.05, 0.1), per_channel=False),
AdditiveGaussianNoise((0.05, 0.1), per_channel=True),
]),
OneOf([
Add((-0.3, 0.3), per_channel=False),
Add((-0.3, 0.3), per_channel=True),
Multiply((0.6, 1.4), per_channel=False),
Multiply((0.6, 1.4), per_channel=True),
LinearContrast((0.5, 2.0), per_channel=False),
LinearContrast((0.5, 2.0), per_channel=True)
]),
Grayscale((0.5, 1)),
OneOf([
CoarseDropout((0.1, 0.3), size_percent=(0.02, 0.06), per_channel=False),
CoarseDropout((0.1, 0.3), size_percent=(0.02, 0.06), per_channel=True),
CoarseSalt((0.1, 0.3), size_percent=(0.02, 0.06)),
CoarsePepper((0.1, 0.3), size_percent=(0.02, 0.06)),
CoarseSaltAndPepper((0.1, 0.3), size_percent=(0.02, 0.06)),
]),
SomeOf(
(0, None),
[
Rotate((-45, 45)),
CropAndPad((-0.3, 0.3), pad_cval=(0, 255)),
Translate(dict(x=(-0.1, 0.1), y=(-0.1, 0.1))),
]
),
RandomResize((0.5, 0.9))
],
random_order=True
)
),
Sometimes(0.5, JpegCompression(quality=(20, 80)))
]
self._abstract_shape_test(aug)
if __name__ == '__main__':
unittest.main()
| 34.662338 | 110 | 0.540277 | 639 | 5,338 | 4.286385 | 0.172144 | 0.123403 | 0.161373 | 0.191676 | 0.460387 | 0.185104 | 0.147134 | 0.071924 | 0.071924 | 0.071924 | 0 | 0.06481 | 0.320719 | 5,338 | 153 | 111 | 34.888889 | 0.690568 | 0 | 0 | 0.086207 | 0 | 0 | 0.003747 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 1 | 0.224138 | false | 0 | 0.051724 | 0 | 0.293103 | 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 |
bf2e53e4fc686c4fa157c9f1d49a64a1d32b4721 | 1,088 | py | Python | eventz/immutable_sequence.py | danballance/eventz | b30ec56ffb6e3c6d6ad4b023f30f8f2da56ca175 | [
"MIT"
] | 1 | 2021-05-20T09:52:25.000Z | 2021-05-20T09:52:25.000Z | eventz/immutable_sequence.py | Eventz-Framework/eventz | b30ec56ffb6e3c6d6ad4b023f30f8f2da56ca175 | [
"MIT"
] | null | null | null | eventz/immutable_sequence.py | Eventz-Framework/eventz | b30ec56ffb6e3c6d6ad4b023f30f8f2da56ca175 | [
"MIT"
] | null | null | null | from typing import TypeVar, Generic, Iterable, Tuple
T = TypeVar('T')
class ImmutableSequence(Generic[T]):
def __init__(self, items: Iterable[T]):
self._items: Tuple[T] = tuple(items)
def __eq__(self, other) -> bool:
if not isinstance(other, ImmutableSequence):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other) -> bool:
if not isinstance(other, ImmutableSequence):
return True
return self.__dict__ != other.__dict__
def __repr__(self) -> str:
class_name = self.__class__.__name__
attrs = {k: getattr(self, k) for k in vars(self)}
if "__immutable__" in attrs: # pragma: no cover
del attrs["__immutable__"]
attrs_string = " ".join([f"{k}={v}" for k, v in attrs.items()])
return f"{class_name}({attrs_string})"
def __len__(self) -> int:
return len(self._items)
def __iter__(self):
for item in self._items:
yield item
def __getitem__(self, key) -> T:
return self._items[key]
| 29.405405 | 71 | 0.606618 | 134 | 1,088 | 4.41791 | 0.373134 | 0.076014 | 0.043919 | 0.050676 | 0.277027 | 0.277027 | 0.189189 | 0.189189 | 0.189189 | 0 | 0 | 0 | 0.273897 | 1,088 | 36 | 72 | 30.222222 | 0.749367 | 0.014706 | 0 | 0.074074 | 0 | 0 | 0.058879 | 0.026168 | 0 | 0 | 0 | 0 | 0 | 1 | 0.259259 | false | 0 | 0.037037 | 0.074074 | 0.592593 | 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 |
bf2ef3f67dfe9b3a6db2f8fef2c3a6c13c87130f | 1,326 | py | Python | module/logger.py | Xetera/IreneBot | e768bb3a0d2517ecb00d50da89d66ac0dd1498d0 | [
"MIT"
] | 1 | 2021-10-02T16:05:11.000Z | 2021-10-02T16:05:11.000Z | module/logger.py | Xetera/IreneBot | e768bb3a0d2517ecb00d50da89d66ac0dd1498d0 | [
"MIT"
] | null | null | null | module/logger.py | Xetera/IreneBot | e768bb3a0d2517ecb00d50da89d66ac0dd1498d0 | [
"MIT"
] | null | null | null | import logging
import datetime
from concurrent.futures import ThreadPoolExecutor
thread_pool = ThreadPoolExecutor()
def debug():
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename=f'Logs/{datetime.date.today()}-debug.log', encoding='utf-8')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)
def info():
logger = logging.getLogger('discord')
logger.setLevel(logging.INFO)
handler = logging.FileHandler(filename=f'Logs/{datetime.date.today()}-info.log', encoding='utf-8')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)
def print_to_console(message):
print(message)
with open(f"Logs/{datetime.date.today()}-console.log", "a+", encoding='utf-8') as file:
output = f"{datetime.datetime.now()} -- {message}\n"
file.write(output)
def console(message):
# run in a separate thread to avoid blocking.
(thread_pool.submit(print_to_console, message)).result()
def logfile(message):
with open(f"Logs/{datetime.date.today()}-info.log", "a+", encoding='utf-8') as file:
output = f"{datetime.datetime.now()} -- {message}\n"
file.write(output)
| 33.15 | 103 | 0.692308 | 169 | 1,326 | 5.39645 | 0.325444 | 0.02193 | 0.057018 | 0.074561 | 0.710526 | 0.710526 | 0.710526 | 0.592105 | 0.510965 | 0.390351 | 0 | 0.003497 | 0.137255 | 1,326 | 39 | 104 | 34 | 0.793706 | 0.032428 | 0 | 0.37037 | 0 | 0 | 0.284153 | 0.212334 | 0 | 0 | 0 | 0 | 0 | 1 | 0.185185 | false | 0 | 0.111111 | 0 | 0.296296 | 0.111111 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bf37500b020baac90802c8f59ea5b4212581b6e2 | 774 | py | Python | Client/App/UI/Helper/ClassList.py | Dragon-KK/ComputerProject2021 | 669431f3f2d41bda822931e6fffe661c99736dfe | [
"MIT"
] | null | null | null | Client/App/UI/Helper/ClassList.py | Dragon-KK/ComputerProject2021 | 669431f3f2d41bda822931e6fffe661c99736dfe | [
"MIT"
] | null | null | null | Client/App/UI/Helper/ClassList.py | Dragon-KK/ComputerProject2021 | 669431f3f2d41bda822931e6fffe661c99736dfe | [
"MIT"
] | null | null | null | class ClassList(list):
def __init__(self):
self.OnClassListChange = lambda *args,**kwargs:0
def AddClass(self,Cls, notify = True):
if Cls not in self:
self.append(Cls)
if notify:self.OnClassListChange(added = self[-1])
def RemoveClass(self, Cls, notify = True):
if Cls in self:
self.remove(Cls)
if notify:self.OnClassListChange(removed = Cls)
return self
def __add__(self, other):
self.AddClass(other)
return self
def __sub__(self,other):
self.RemoveClass(other)
return self
def __iadd__(self, other):
self.AddClass(other)
return self
def __isub__(self,other):
self.RemoveClass(other)
return self | 25.8 | 62 | 0.595607 | 90 | 774 | 4.9 | 0.333333 | 0.113379 | 0.117914 | 0.122449 | 0.598639 | 0.453515 | 0.353742 | 0.176871 | 0 | 0 | 0 | 0.003738 | 0.308786 | 774 | 30 | 63 | 25.8 | 0.820561 | 0 | 0 | 0.375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.291667 | false | 0 | 0 | 0 | 0.541667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
17121677aa57618192acf47db39a5e720b0e6f5e | 1,111 | py | Python | src/pylendingclub/wrapper/resource.py | bbarney213/PyLendingClub-Wrapper | 7f2ef823a56bc87b7f88abf86498805c2c9ce3d3 | [
"BSD-3-Clause"
] | 2 | 2018-06-06T20:04:04.000Z | 2018-06-13T12:17:37.000Z | src/pylendingclub/wrapper/resource.py | bbarney213/PyLendingClub | 7f2ef823a56bc87b7f88abf86498805c2c9ce3d3 | [
"BSD-3-Clause"
] | 4 | 2018-10-18T13:59:14.000Z | 2018-10-23T16:08:51.000Z | src/pylendingclub/wrapper/resource.py | bbarney213/PyLendingClub | 7f2ef823a56bc87b7f88abf86498805c2c9ce3d3 | [
"BSD-3-Clause"
] | null | null | null | from .base import Base
from .request import GetRequest
from .request import PostRequest
class Resource(Base):
"""
Base class for all resources within the API.
"""
def _get_request(self, sub_url):
"""
Constructor for a new GetRequest.
Handles constructing the URL for the request, as well as providing the headers.
Using the default constructor by creating a new class will not cause issues, as long as the
headers, and url, are properly provided.
"""
return GetRequest(self.join_url(self._url, sub_url), self._headers)
def _post_request(self, sub_url):
"""
Constructor for a new PostRequest.
Handles constructing the URL for the request, as well as providing the headers.
Using the default constructor by creating a new class will not cause issues, as long as the
headers, and url, are properly provided.
"""
return PostRequest(self.join_url(self._url, sub_url), self._headers)
def __init__(self, url, headers):
self._url = url
self._headers = headers
| 32.676471 | 99 | 0.669667 | 150 | 1,111 | 4.826667 | 0.3 | 0.048343 | 0.058011 | 0.046961 | 0.690608 | 0.690608 | 0.690608 | 0.690608 | 0.593923 | 0.593923 | 0 | 0 | 0.263726 | 1,111 | 33 | 100 | 33.666667 | 0.885086 | 0.486949 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.272727 | 0 | 0.818182 | 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 |
1718001e0904bfefe359d48d6c35beb0656e1e1f | 15,463 | py | Python | pysnmp-with-texts/Fore-J2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/Fore-J2-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/Fore-J2-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 Fore-J2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Fore-J2-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:17:14 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)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection")
asx, = mibBuilder.importSymbols("Fore-Common-MIB", "asx")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
Bits, Counter32, Counter64, ObjectIdentity, IpAddress, TimeTicks, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType, Integer32, ModuleIdentity, Unsigned32, MibIdentifier, iso = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Counter32", "Counter64", "ObjectIdentity", "IpAddress", "TimeTicks", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType", "Integer32", "ModuleIdentity", "Unsigned32", "MibIdentifier", "iso")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
foreJ2 = ModuleIdentity((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6))
if mibBuilder.loadTexts: foreJ2.setLastUpdated('9911050000Z')
if mibBuilder.loadTexts: foreJ2.setOrganization('FORE')
if mibBuilder.loadTexts: foreJ2.setContactInfo(' Postal: FORE Systems Inc. 1000 FORE Drive Warrendale, PA 15086-7502 Tel: +1 724 742 6900 Email: nm_mibs@fore.com Web: http://www.fore.com')
if mibBuilder.loadTexts: foreJ2.setDescription('write something interesting here')
j2ConfGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1))
j2StatsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2))
j2ConfTable = MibTable((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1), )
if mibBuilder.loadTexts: j2ConfTable.setStatus('current')
if mibBuilder.loadTexts: j2ConfTable.setDescription('A table of J2 switch port configuration information.')
j2ConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1), ).setIndexNames((0, "Fore-J2-MIB", "j2ConfBoard"), (0, "Fore-J2-MIB", "j2ConfModule"), (0, "Fore-J2-MIB", "j2ConfPort"))
if mibBuilder.loadTexts: j2ConfEntry.setStatus('current')
if mibBuilder.loadTexts: j2ConfEntry.setDescription('A table entry containing J2 configuration information for each port.')
j2ConfBoard = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2ConfBoard.setStatus('current')
if mibBuilder.loadTexts: j2ConfBoard.setDescription("The index of this port's switch board.")
j2ConfModule = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2ConfModule.setStatus('current')
if mibBuilder.loadTexts: j2ConfModule.setDescription('The network module of this port.')
j2ConfPort = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2ConfPort.setStatus('current')
if mibBuilder.loadTexts: j2ConfPort.setDescription('The number of this port.')
j2LineLength = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("j2ShortLine", 1), ("j2LongLine", 2))).clone('j2ShortLine')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: j2LineLength.setStatus('current')
if mibBuilder.loadTexts: j2LineLength.setDescription('This variable represents the length of the physical medium connected to the J2 interface: j2ShortLine (1) means the line is a short line with less than 4db of attenuation from the transmitting source. j2LongLine (2) means the line is a long line, with greater than 4db of attenuation from the transmitting source.')
j2LoopbackConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("j2NoLoop", 1), ("j2LineLoop", 2), ("j2DiagLoop", 3), ("j2OtherLoop", 4))).clone('j2NoLoop')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: j2LoopbackConfig.setStatus('current')
if mibBuilder.loadTexts: j2LoopbackConfig.setDescription("This variable represents the loopback configuration of the J2 interface. j2NoLoop (1) means that the interface is not in a loopback state. j2LineLoop (2) means that receive signal is looped back for retransmission without passing through the port's reframing function. j2DiagLoop (3) means that the transmit data stream is looped back to the receiver. j2OtherLoop (4) means that the interface is in a loopback that is not defined here.")
j2TxClockSource = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("rxTiming", 1), ("localTiming", 2))).clone('localTiming')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: j2TxClockSource.setStatus('current')
if mibBuilder.loadTexts: j2TxClockSource.setDescription('The source of the transmit clock.')
j2LineStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65534)).clone(1)).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2LineStatus.setStatus('current')
if mibBuilder.loadTexts: j2LineStatus.setDescription('This variable indicates the Line Status of the interface. The variable contains loopback state information and failure state information. It is a bit map represented as a sum. The j2NoAlarm should be set if and only if no other flag is set. The various bit positions are: 1 j2NoAlarm 2 j2RxLOF Receive Loss of Frame 4 j2RxLOC Receive Loss of Clock (Not used anymore) 8 j2RxAIS Receive Alarm Indication Signal 16 j2TxLOC Transmit Loss of Clock (Not used anymore) 32 j2RxRAIS Receive Remote Alarm Indication Signal 64 j2RxLOS Receive Loss of Signal 128 j2TxRAIS Transmit Yellow ( Remote Alarm Indication Signal) 256 j2Other any line status not defined here 32768 j2RxLCD Receiving LCD failure indication.')
j2IdleUnassignedCells = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("unassigned", 1), ("idle", 2))).clone('unassigned')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: j2IdleUnassignedCells.setStatus('current')
if mibBuilder.loadTexts: j2IdleUnassignedCells.setDescription("This variable indicates the types of cells that should be sent in case there is no real data to send. According to the ATM Forum, Unassigned cells should be sent (octet 1-3 are 0's, octet 4 is 0000xxx0, where x is 'don't care'). According to the CCITT specifications, Idle cells should be sent (everything is '0' except for the CLP bit which is '1'). By default, unassigned cells are transmitted in case there is no data to send.")
j2ErrorTable = MibTable((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1), )
if mibBuilder.loadTexts: j2ErrorTable.setStatus('current')
if mibBuilder.loadTexts: j2ErrorTable.setDescription('A table of J2 error counters.')
j2ErrorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1), ).setIndexNames((0, "Fore-J2-MIB", "j2ErrorBoard"), (0, "Fore-J2-MIB", "j2ErrorModule"), (0, "Fore-J2-MIB", "j2ErrorPort"))
if mibBuilder.loadTexts: j2ErrorEntry.setStatus('current')
if mibBuilder.loadTexts: j2ErrorEntry.setDescription('A table entry containing J2 error counters.')
j2ErrorBoard = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2ErrorBoard.setStatus('current')
if mibBuilder.loadTexts: j2ErrorBoard.setDescription("The index of this port's switch board.")
j2ErrorModule = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2ErrorModule.setStatus('current')
if mibBuilder.loadTexts: j2ErrorModule.setDescription('The network module of this port.')
j2ErrorPort = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2ErrorPort.setStatus('current')
if mibBuilder.loadTexts: j2ErrorPort.setDescription('The number of this port.')
j2B8ZSCodingErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2B8ZSCodingErrors.setStatus('current')
if mibBuilder.loadTexts: j2B8ZSCodingErrors.setDescription('The number of B8ZS coding violation errors.')
j2CRC5Errors = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2CRC5Errors.setStatus('current')
if mibBuilder.loadTexts: j2CRC5Errors.setDescription('The number of CRC-5 received errors.')
j2FramingErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2FramingErrors.setStatus('current')
if mibBuilder.loadTexts: j2FramingErrors.setDescription('The number of framing patterns received in error.')
j2RxLossOfFrame = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2RxLossOfFrame.setStatus('current')
if mibBuilder.loadTexts: j2RxLossOfFrame.setDescription('The number of seconds during which the receiver was experiencing Loss Of Frame.')
j2RxLossOfClock = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2RxLossOfClock.setStatus('current')
if mibBuilder.loadTexts: j2RxLossOfClock.setDescription('The number of seconds during which the receiver was not observing transitions on the received clock signal.')
j2RxAIS = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2RxAIS.setStatus('current')
if mibBuilder.loadTexts: j2RxAIS.setDescription('The number of seconds during which the receiver detected an Alarm Indication Signal.')
j2TxLossOfClock = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2TxLossOfClock.setStatus('current')
if mibBuilder.loadTexts: j2TxLossOfClock.setDescription('The number of seconds during which the transmitter was experiencing Loss Of Clock.')
j2RxRemoteAIS = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2RxRemoteAIS.setStatus('current')
if mibBuilder.loadTexts: j2RxRemoteAIS.setDescription('The number of seconds during which the receiver observed the Alarm Indication Signal in the m-bits channel.')
j2RxLossOfSignal = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 1, 1, 12), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2RxLossOfSignal.setStatus('current')
if mibBuilder.loadTexts: j2RxLossOfSignal.setDescription('The number of seconds during which the transmitter was experien cing Loss Of Signal.')
j2AtmTable = MibTable((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2), )
if mibBuilder.loadTexts: j2AtmTable.setStatus('current')
if mibBuilder.loadTexts: j2AtmTable.setDescription('A table of J2 ATM statistics information.')
j2AtmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1), ).setIndexNames((0, "Fore-J2-MIB", "j2AtmBoard"), (0, "Fore-J2-MIB", "j2AtmModule"), (0, "Fore-J2-MIB", "j2AtmPort"))
if mibBuilder.loadTexts: j2AtmEntry.setStatus('current')
if mibBuilder.loadTexts: j2AtmEntry.setDescription('A table entry containing J2 ATM statistics information.')
j2AtmBoard = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmBoard.setStatus('current')
if mibBuilder.loadTexts: j2AtmBoard.setDescription("The index of this port's switch board.")
j2AtmModule = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmModule.setStatus('current')
if mibBuilder.loadTexts: j2AtmModule.setDescription('The network module of this port.')
j2AtmPort = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmPort.setStatus('current')
if mibBuilder.loadTexts: j2AtmPort.setDescription('The number of this port.')
j2AtmHCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmHCSs.setStatus('current')
if mibBuilder.loadTexts: j2AtmHCSs.setDescription('Number of header check sequence (HCS) error events. The HCS is a CRC-8 calculation over the first 4 octets of the ATM cell header.')
j2AtmRxCells = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmRxCells.setStatus('current')
if mibBuilder.loadTexts: j2AtmRxCells.setDescription('Number of ATM cells that were received.')
j2AtmTxCells = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmTxCells.setStatus('current')
if mibBuilder.loadTexts: j2AtmTxCells.setDescription('Number of non-null ATM cells that were transmitted.')
j2AtmLCDs = MibTableColumn((1, 3, 6, 1, 4, 1, 326, 2, 2, 1, 1, 6, 2, 2, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: j2AtmLCDs.setStatus('current')
if mibBuilder.loadTexts: j2AtmLCDs.setDescription('The number of seconds in which Loss of Cell Delineation (LCD) has occurred. An LCD defect is detected when an out of cell delination state has persisted for 4ms. An LCD defect is cleared when the sync state has been maintained for 4ms.')
mibBuilder.exportSymbols("Fore-J2-MIB", j2RxAIS=j2RxAIS, j2RxRemoteAIS=j2RxRemoteAIS, j2AtmRxCells=j2AtmRxCells, j2FramingErrors=j2FramingErrors, j2LineStatus=j2LineStatus, j2RxLossOfClock=j2RxLossOfClock, j2LineLength=j2LineLength, j2LoopbackConfig=j2LoopbackConfig, j2AtmEntry=j2AtmEntry, j2IdleUnassignedCells=j2IdleUnassignedCells, PYSNMP_MODULE_ID=foreJ2, j2ErrorPort=j2ErrorPort, j2AtmModule=j2AtmModule, j2AtmTxCells=j2AtmTxCells, j2ErrorBoard=j2ErrorBoard, j2ConfModule=j2ConfModule, j2ConfEntry=j2ConfEntry, j2AtmBoard=j2AtmBoard, j2ConfTable=j2ConfTable, foreJ2=foreJ2, j2ErrorModule=j2ErrorModule, j2ConfGroup=j2ConfGroup, j2AtmLCDs=j2AtmLCDs, j2RxLossOfFrame=j2RxLossOfFrame, j2B8ZSCodingErrors=j2B8ZSCodingErrors, j2ConfBoard=j2ConfBoard, j2ConfPort=j2ConfPort, j2AtmPort=j2AtmPort, j2TxClockSource=j2TxClockSource, j2ErrorTable=j2ErrorTable, j2StatsGroup=j2StatsGroup, j2RxLossOfSignal=j2RxLossOfSignal, j2CRC5Errors=j2CRC5Errors, j2AtmHCSs=j2AtmHCSs, j2AtmTable=j2AtmTable, j2TxLossOfClock=j2TxLossOfClock, j2ErrorEntry=j2ErrorEntry)
| 126.745902 | 1,048 | 0.757292 | 2,102 | 15,463 | 5.569458 | 0.173168 | 0.01213 | 0.125566 | 0.012642 | 0.501068 | 0.330913 | 0.285385 | 0.265568 | 0.20996 | 0.163321 | 0 | 0.080734 | 0.108452 | 15,463 | 121 | 1,049 | 127.793388 | 0.768461 | 0.020436 | 0 | 0 | 0 | 0.061404 | 0.333201 | 0.002907 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.008772 | 0.061404 | 0 | 0.061404 | 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 |
17228e1c64f4eaf31b5d7c6cd86af2b08d098a71 | 534 | py | Python | garlic_pear/path.py | mtao/garlic_pear | 207762df8997fcca67dc4ef4d1a7ddca28b1d4fb | [
"MIT"
] | null | null | null | garlic_pear/path.py | mtao/garlic_pear | 207762df8997fcca67dc4ef4d1a7ddca28b1d4fb | [
"MIT"
] | null | null | null | garlic_pear/path.py | mtao/garlic_pear | 207762df8997fcca67dc4ef4d1a7ddca28b1d4fb | [
"MIT"
] | null | null | null |
import pathlib
# a file
class Path:
@staticmethod
def __get_path(pathlike) -> pathlib.Path :
if type(pathlike) is pathlib.Path:
return path_or_file
elif issubclass(pathlike, Path):
return other_file.path()
else:
return pathlib.Path(pathlike)
def path(self) -> pathlib.Path:
raise NotImplementedError()
def last_modified(self):
raise NotImplementedError()
def __lt__(self, other):
return str(self) < str(other)
| 16.181818 | 46 | 0.599251 | 58 | 534 | 5.327586 | 0.448276 | 0.142395 | 0.174757 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.314607 | 534 | 32 | 47 | 16.6875 | 0.844262 | 0.011236 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.0625 | 0.0625 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
1732b3c237a9939a05fce7305cf7b8eaf1d26f28 | 1,346 | py | Python | api/migrations/versions/7bce3314f2d8_chg_assignment_test_output_types.py | jepst/Anubis | 45f08b8057e295fcf5a3bf25b1947337444dca84 | [
"MIT"
] | 87 | 2021-11-08T10:58:26.000Z | 2022-03-31T19:02:47.000Z | api/migrations/versions/7bce3314f2d8_chg_assignment_test_output_types.py | jepst/Anubis | 45f08b8057e295fcf5a3bf25b1947337444dca84 | [
"MIT"
] | 114 | 2021-06-27T08:37:43.000Z | 2021-10-24T00:51:01.000Z | api/migrations/versions/7bce3314f2d8_chg_assignment_test_output_types.py | jepst/Anubis | 45f08b8057e295fcf5a3bf25b1947337444dca84 | [
"MIT"
] | 15 | 2021-06-27T07:26:51.000Z | 2021-10-06T18:42:39.000Z | """CHG assignment test output types
Revision ID: 7bce3314f2d8
Revises: 28971042fc9c
Create Date: 2022-01-15 19:53:48.734288
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = "7bce3314f2d8"
down_revision = "28971042fc9c"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"submission_test_result",
sa.Column("output_type", sa.String(length=128), nullable=True),
)
op.add_column(
"submission_test_result",
sa.Column("output", sa.Text(length=65536), nullable=True),
)
conn = op.get_bind()
with conn.begin():
conn.execute('update submission_test_result set `output` = `stdout`;')
conn.execute('update submission_test_result set `output_type` = \'text\';')
op.drop_column("submission_test_result", "stdout")
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"submission_test_result",
sa.Column("stdout", mysql.TEXT(), nullable=True),
)
op.drop_column("submission_test_result", "output")
op.drop_column("submission_test_result", "output_type")
# ### end Alembic commands ###
| 29.26087 | 83 | 0.679792 | 164 | 1,346 | 5.402439 | 0.414634 | 0.126411 | 0.180587 | 0.176072 | 0.46614 | 0.46614 | 0.430023 | 0.344244 | 0.240406 | 0.182844 | 0 | 0.054995 | 0.18945 | 1,346 | 45 | 84 | 29.911111 | 0.757104 | 0.233284 | 0 | 0.214286 | 0 | 0 | 0.309548 | 0.176884 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.107143 | 0 | 0.178571 | 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 |
17422a65cf12e103357c4e5779750d72d2d4e266 | 555 | py | Python | src/inception/__init__.py | jercytryn/inception | f7489cccdd308b5bb2d6ea04588dc67113e995b5 | [
"MIT"
] | 6 | 2015-06-02T02:41:12.000Z | 2021-08-16T11:15:58.000Z | src/inception/__init__.py | jercytryn/inception | f7489cccdd308b5bb2d6ea04588dc67113e995b5 | [
"MIT"
] | 2 | 2015-05-20T08:13:07.000Z | 2015-05-20T08:13:07.000Z | src/inception/__init__.py | jercytryn/inception | f7489cccdd308b5bb2d6ea04588dc67113e995b5 | [
"MIT"
] | 2 | 2015-09-11T02:03:11.000Z | 2016-07-05T21:13:56.000Z | """
Inception api for semi-automaed 2D object insertion into indoor scenery
>>> import inception
>>> inception.magic_insert('http://my/awesome/foreground.jpg', '/Users/mrayder/background.png', (30, 40, 300, 500))
"""
# expose the top level api methods up the very top level of the package
# e.g. so that can just do
# >>> import inception
# >>> inception.magic_insert()
# for instance
from .base import inception, magic_insert, floodfill, scale, poissonblend, shadow, statadjust
from .generate import generate_magic_composite
from .image import Image
| 32.647059 | 115 | 0.751351 | 78 | 555 | 5.282051 | 0.692308 | 0.109223 | 0.145631 | 0.140777 | 0.169903 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022965 | 0.136937 | 555 | 16 | 116 | 34.6875 | 0.837161 | 0.664865 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
174e0c13b9f454a071a3bbac842f25fa6034ff6f | 6,760 | py | Python | tests/test_hyp_search.py | PFLeget/treegp | cf9384d5f70d1998f4ec0032c3e4d23ab4e34bf8 | [
"BSD-3-Clause"
] | 6 | 2021-02-07T19:59:49.000Z | 2022-01-06T15:46:33.000Z | tests/test_hyp_search.py | PFLeget/treegp | cf9384d5f70d1998f4ec0032c3e4d23ab4e34bf8 | [
"BSD-3-Clause"
] | 9 | 2020-07-03T21:21:42.000Z | 2021-08-19T00:20:30.000Z | tests/test_hyp_search.py | PFLeget/treegp | cf9384d5f70d1998f4ec0032c3e4d23ab4e34bf8 | [
"BSD-3-Clause"
] | 1 | 2021-02-05T23:07:30.000Z | 2021-02-05T23:07:30.000Z | from __future__ import print_function
import numpy as np
import treegp
from treegp_test_helper import timer
from treegp_test_helper import get_correlation_length_matrix
from treegp_test_helper import make_1d_grf
from treegp_test_helper import make_2d_grf
@timer
def test_hyperparameter_search_1d():
optimizer = ['log-likelihood', 'two-pcf']
npoints = [100, 2000]
noise = 0.01
sigma = [1., 2., 1., 2.]
l = [0.5, 0.8, 8., 10.]
kernels = ['RBF', 'RBF', 'VonKarman', 'VonKarman']
max_sep = [1.75, 1.75, 1.25, 1.25]
for n, opt in enumerate(optimizer):
for i, ker in enumerate(kernels):
# Generate 1D gaussian random fields.
kernel = "%f**2 * %s(%f)"%((sigma[i], ker, l[i]))
kernel_skl = treegp.eval_kernel(kernel)
x, y, y_err = make_1d_grf(kernel_skl,
noise=noise,
seed=42, npoints=npoints[n])
# Do gp interpolation without hyperparameters
# fitting (truth is put initially).
gp = treegp.GPInterpolation(kernel=kernel, optimizer=opt,
normalize=True, nbins=15, min_sep=0.1,
max_sep=max_sep[i])
gp.initialize(x, y, y_err=y_err)
gp.solve()
# test if found hyperparameters are close the true hyperparameters.
np.testing.assert_allclose(kernel_skl.theta, gp.kernel.theta, atol=7e-1)
if opt == "two-pcf":
xi, xi_weight, distance, coord, mask = gp.return_2pcf()
np.testing.assert_allclose(xi, gp._optimizer._2pcf, atol=1e-10)
if opt == "log-likelihood":
logL = gp.return_log_likelihood()
np.testing.assert_allclose(logL, gp._optimizer._logL, atol=1e-10)
# Predict at same position as the simulated data.
# Predictions are strictily equal to the input data
# in the case of no noise. With noise you should expect
# to have a pull distribution with mean function arround 0
# with a std<1 (you use the same data to train and validate, and
# the data are well sample compared to the input correlation
# length).
y_predict, y_cov = gp.predict(x, return_cov=True)
y_std = np.sqrt(np.diag(y_cov))
pull = y - y_predict
mean_pull = np.mean(pull)
std_pull = np.std(pull)
# Test that mean of the pull is close to zeros and std of the pull bellow 1.
np.testing.assert_allclose(0., mean_pull, atol=3.*(std_pull)/np.sqrt(npoints[n]))
if std_pull > 1.:
raise ValueError("std_pull is > 1. Current value std_pull = %f"%(std_pull))
# Test that for extrapolation, interpolation is the mean function (0 here)
# and the diagonal of the covariance matrix is close to the hyperameters is
# link to the amplitudes of the fluctuation of the gaussian random fields.
new_x = np.linspace(np.max(x)+6.*l[i], np.max(x)+7.*l[i], npoints[n]).reshape((npoints[n],1))
y_predict, y_cov = gp.predict(new_x, return_cov=True)
y_std = np.sqrt(np.diag(y_cov))
np.testing.assert_allclose(np.mean(y)*np.ones_like(y_std), y_predict, atol=1e-5)
sig = np.sqrt(np.exp(gp.kernel.theta[0]))
np.testing.assert_allclose(sig*np.ones_like(y_std), y_std, atol=1e-5)
@timer
def test_hyperparameter_search_2d():
optimizer = ['log-likelihood', 'anisotropic', 'anisotropic']
npoints = [600, 2000, 2000]
noise = 0.01
sigma = 2.
size = [0.5, 0.5, 1.5]
g1 = 0.2
g2 = 0.2
ker = ['AnisotropicRBF', 'AnisotropicRBF', 'AnisotropicVonKarman']
for n, opt in enumerate(optimizer):
# Generate 2D gaussian random fields.
L = get_correlation_length_matrix(size[n], g1, g2)
invL = np.linalg.inv(L)
kernel = "%f**2*%s"%((sigma, ker[n]))
kernel += "(invLam={0!r})".format(invL)
kernel_skl = treegp.eval_kernel(kernel)
x, y, y_err = make_2d_grf(kernel_skl,
noise=noise,
seed=42, npoints=npoints[n])
# Do gp interpolation without hyperparameters
# fitting (truth is put initially).
gp = treegp.GPInterpolation(kernel=kernel, optimizer=opt,
normalize=True, nbins=21, min_sep=0.,
max_sep=1., p0=[0.3, 0.,0.])
gp.initialize(x, y, y_err=y_err)
gp.solve()
# test if found hyperparameters are close the true hyperparameters.
np.testing.assert_allclose(kernel_skl.theta, gp.kernel.theta, atol=5e-1)
# Predict at same position as the simulated data.
# Predictions are strictily equal to the input data
# in the case of no noise. With noise you should expect
# to have a pull distribution with mean function arround 0
# with a std<1 (you use the same data to train and validate, and
# the data are well sample compared to the input correlation
# length).
y_predict, y_cov = gp.predict(x, return_cov=True)
y_std = np.sqrt(np.diag(y_cov))
pull = y - y_predict
pull /= np.sqrt(y_err**2 + y_std**2)
mean_pull = np.mean(pull)
std_pull = np.std(pull)
# Test that mean of the pull is close to zeros and std of the pull bellow 1.
np.testing.assert_allclose(0., mean_pull, atol=3.*(std_pull)/np.sqrt(npoints[n]))
if std_pull > 1.:
raise ValueError("std_pull is > 1. Current value std_pull = %f"%(std_pull))
# Test that for extrapolation, interpolation is the mean function (0 here)
# and the diagonal of the covariance matrix is close to the hyperameters is
# link to the amplitudes of the fluctuation of the gaussian random fields.
np.random.seed(42)
x1 = np.random.uniform(np.max(x)+6.*size[n],
np.max(x)+6.*size[n], npoints[n])
x2 = np.random.uniform(np.max(x)+6.*size[n],
np.max(x)+6.*size[n], npoints[n])
new_x = np.array([x1, x2]).T
y_predict, y_cov = gp.predict(new_x, return_cov=True)
y_std = np.sqrt(np.diag(y_cov))
np.testing.assert_allclose(np.mean(y), y_predict, atol=1e-5)
sig = np.sqrt(np.exp(gp.kernel.theta[0]))
np.testing.assert_allclose(sig*np.ones_like(y_std), y_std, atol=1e-5)
if __name__ == "__main__":
test_hyperparameter_search_1d()
test_hyperparameter_search_2d()
| 44.473684 | 105 | 0.590089 | 964 | 6,760 | 3.993776 | 0.197095 | 0.025455 | 0.038961 | 0.05974 | 0.754286 | 0.715325 | 0.682078 | 0.682078 | 0.682078 | 0.682078 | 0 | 0.030675 | 0.30074 | 6,760 | 151 | 106 | 44.768212 | 0.783795 | 0.240976 | 0 | 0.453608 | 0 | 0 | 0.055294 | 0 | 0 | 0 | 0 | 0 | 0.103093 | 1 | 0.020619 | false | 0 | 0.072165 | 0 | 0.092784 | 0.010309 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
17500719e579f065e6de2eae2bcb41d36a44ff4d | 77 | py | Python | EpisodeType.py | Morasiu/VideoDownloader | 626a1a9f83218066834f0aae6fa37e57aa777e71 | [
"MIT"
] | null | null | null | EpisodeType.py | Morasiu/VideoDownloader | 626a1a9f83218066834f0aae6fa37e57aa777e71 | [
"MIT"
] | null | null | null | EpisodeType.py | Morasiu/VideoDownloader | 626a1a9f83218066834f0aae6fa37e57aa777e71 | [
"MIT"
] | null | null | null | from enum import Enum
class EpisodeType(Enum):
Normal = 1,
Filler = 2 | 19.25 | 24 | 0.675325 | 11 | 77 | 4.727273 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 0.246753 | 77 | 4 | 25 | 19.25 | 0.862069 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
17520e9ecda50297726a3765b416641cb62ab495 | 289 | py | Python | estraven/__about__.py | enpaul/genly | 21b69e8b2486a8eb91f4e33eee2ff498065d085b | [
"MIT"
] | null | null | null | estraven/__about__.py | enpaul/genly | 21b69e8b2486a8eb91f4e33eee2ff498065d085b | [
"MIT"
] | null | null | null | estraven/__about__.py | enpaul/genly | 21b69e8b2486a8eb91f4e33eee2ff498065d085b | [
"MIT"
] | null | null | null | # pylint: disable=missing-docstring
__title__ = "estraven"
__summary__ = "An opinionated YAML formatter for Ansible playbooks"
__version__ = "0.0.0"
__url__ = "https://github.com/enpaul/estraven/"
__license__ = "MIT"
__authors__ = ["Ethan Paul <24588726+enpaul@users.noreply.github.com>"]
| 36.125 | 71 | 0.761246 | 35 | 289 | 5.6 | 0.828571 | 0.020408 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042308 | 0.100346 | 289 | 7 | 72 | 41.285714 | 0.711538 | 0.114187 | 0 | 0 | 0 | 0 | 0.610236 | 0.165354 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
1765e4f689926df9fbf25a123355a58a88819d9a | 716 | py | Python | test/unit/00.nop-commit.py | rescrv/Consus | bb05df2f314b1dc7510a3fb73604491227ebc516 | [
"BSD-3-Clause"
] | 239 | 2016-12-13T16:27:52.000Z | 2021-09-19T20:46:38.000Z | test/unit/00.nop-commit.py | ngaut/Consus | bb05df2f314b1dc7510a3fb73604491227ebc516 | [
"BSD-3-Clause"
] | 6 | 2016-12-19T02:11:28.000Z | 2017-09-07T02:44:47.000Z | test/unit/00.nop-commit.py | ngaut/Consus | bb05df2f314b1dc7510a3fb73604491227ebc516 | [
"BSD-3-Clause"
] | 16 | 2016-12-18T09:48:28.000Z | 2019-01-27T08:51:34.000Z | import consus
c1 = consus.Client()
t1 = c1.begin_transaction()
t1.commit()
c2 = consus.Client(b'127.0.0.1')
t2 = c1.begin_transaction()
t2.commit()
c3 = consus.Client('127.0.0.1')
t3 = c1.begin_transaction()
t3.commit()
c4 = consus.Client(b'127.0.0.1', 1982)
t4 = c1.begin_transaction()
t4.commit()
c5 = consus.Client('127.0.0.1', 1982)
t5 = c1.begin_transaction()
t5.commit()
c6 = consus.Client(b'127.0.0.1:1982')
t6 = c1.begin_transaction()
t6.commit()
c7 = consus.Client('127.0.0.1:1982')
t7 = c1.begin_transaction()
t7.commit()
c8 = consus.Client(b'[::]:1982,127.0.0.1:1982')
t8 = c1.begin_transaction()
t8.commit()
c9 = consus.Client('[::]:1982,127.0.0.1:1982')
t9 = c1.begin_transaction()
t9.commit()
| 18.842105 | 47 | 0.674581 | 127 | 716 | 3.732283 | 0.228346 | 0.227848 | 0.341772 | 0.101266 | 0.327004 | 0.327004 | 0.229958 | 0.097046 | 0 | 0 | 0 | 0.18125 | 0.106145 | 716 | 37 | 48 | 19.351351 | 0.559375 | 0 | 0 | 0 | 0 | 0 | 0.156425 | 0.067039 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.035714 | 0 | 0.035714 | 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 |
177c3992f4db7ee7705443dc9f22eab9249c2930 | 5,607 | py | Python | deps/lib/python3.5/site-packages/openzwave/group.py | jfarmer08/hassio | 792a6071a97bb33857c14c9937946233c620035c | [
"MIT"
] | null | null | null | deps/lib/python3.5/site-packages/openzwave/group.py | jfarmer08/hassio | 792a6071a97bb33857c14c9937946233c620035c | [
"MIT"
] | null | null | null | deps/lib/python3.5/site-packages/openzwave/group.py | jfarmer08/hassio | 792a6071a97bb33857c14c9937946233c620035c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
.. module:: openzwave.group
This file is part of **python-openzwave** project https://github.com/OpenZWave/python-openzwave.
:platform: Unix, Windows, MacOS X
:sinopsis: openzwave API
.. moduleauthor: bibi21000 aka Sébastien GALLET <bibi21000@gmail.com>
License : GPL(v3)
**python-openzwave** is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
**python-openzwave** is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with python-openzwave. If not, see http://www.gnu.org/licenses.
"""
from openzwave.object import ZWaveObject
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
"""NullHandler logger for python 2.6"""
def emit(self, record):
pass
logger = logging.getLogger('openzwave')
logger.addHandler(NullHandler())
class ZWaveGroup(ZWaveObject):
"""
The driver object.
Hold options of the manager
Also used to retrieve information about the library, ...
"""
def __init__(self, group_index, network=None, node_id=None):
"""
Initialize driver object
:param group_index: index of the group
:type group_index: int
:param network: The network object to access the manager
:type network: ZWaveNetwork
:param node_id: ID of node
:type node_id: int
"""
ZWaveObject.__init__(self, group_index, network)
self._node_id = node_id
self._index = group_index
def __str__(self):
"""
The string representation of the group.
:rtype: str
"""
return 'index: [%s] label: [%s]' % (self.index, self.label)
@property
def index(self):
"""
The index of the group.
:rtype: int
"""
return self._index
@property
def label(self):
"""
The label of the group.
:rtype: int
"""
return self._network.manager.getGroupLabel(self.home_id, self._node_id, self.index)
@property
def max_associations(self):
"""
The number of associations.
:rtype: int
"""
return self._network.manager.getMaxAssociations(self.home_id, self._node_id, self.index)
@property
def associations(self):
"""
The members of associations.
:rtype: set()
"""
return self._network.manager.getAssociations(self.home_id, self._node_id, self.index)
@property
def associations_instances(self):
"""
The members of associations with theirs instances.
Nodes that does not support multi-instances have an instanceid equal to 0.
:rtype: set() of tuples (nodeid,instanceid)
"""
return self._network.manager.getAssociationsInstances(self.home_id, self._node_id, self.index)
def add_association(self, target_node_id, instance=0x00):
"""
Adds a node to an association group.
Due to the possibility of a device being asleep, the command is assumed to
complete with success, and the association data held in this class is updated directly. This
will be reverted by a future Association message from the device if the Z-Wave
message actually failed to get through. Notification callbacks will be sent in
both cases.
:param target_node_id: Identifier for the node that will be added to the association group.
:type target_node_id: int
:param instance: The instance that will be added to the association group.
:type instance: int
"""
self._network.manager.addAssociation(self.home_id, self._node_id, self.index, target_node_id, instance)
def remove_association(self, target_node_id, instance=0x00):
"""
Removes a node from an association group.
Due to the possibility of a device being asleep, the command is assumed to
succeed, and the association data held in this class is updated directly. This
will be reverted by a future Association message from the device if the Z-Wave
message actually failed to get through. Notification callbacks will be sent
in both cases.
:param target_node_id: Identifier for the node that will be removed from the association group.
:type target_node_id: int
:param instance: The instance that will be added to the association group.
:type instance: int
"""
self._network.manager.removeAssociation(self._network.home_id, self._node_id, self.index, target_node_id, instance)
def to_dict(self, extras=['all']):
"""
Return a dict representation of the group.
:param extras: The extra inforamtions to add
:type extras: []
:returns: A dict
:rtype: dict()
"""
if 'all' in extras:
extras = ['associations']
ret = {}
ret['label'] = self.label
if 'associations' in extras:
ret['associations'] = dict.fromkeys(self.associations, 0)
return ret
| 31.5 | 123 | 0.659176 | 723 | 5,607 | 5.013831 | 0.307054 | 0.031448 | 0.026483 | 0.028966 | 0.428138 | 0.391724 | 0.363586 | 0.326621 | 0.317517 | 0.315586 | 0 | 0.006031 | 0.260746 | 5,607 | 177 | 124 | 31.677966 | 0.868516 | 0.547173 | 0 | 0.113636 | 0 | 0 | 0.039899 | 0 | 0 | 0 | 0.00404 | 0 | 0 | 1 | 0.25 | false | 0.022727 | 0.090909 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
177cb81205a8ea2383beab85a085a6f3adc81c37 | 2,440 | py | Python | plugin.video.vstream/resources/hosters/vidzi.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | 2 | 2018-11-02T19:55:30.000Z | 2020-08-14T02:22:20.000Z | plugin.video.vstream/resources/hosters/vidzi.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | null | null | null | plugin.video.vstream/resources/hosters/vidzi.py | akuala/REPO.KUALA | ea9a157025530d2ce8fa0d88431c46c5352e89d4 | [
"Apache-2.0"
] | 3 | 2019-12-17T20:47:00.000Z | 2021-02-11T19:03:59.000Z | #-*- coding: utf-8 -*-
#https://vidzi.tv/xxx.html
#Vstream https://github.com/Kodi-vStream/venom-xbmc-addons
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.parser import cParser
from resources.hosters.hoster import iHoster
from resources.lib.packer import cPacker
import re
class cHoster(iHoster):
def __init__(self):
self.__sDisplayName = 'Vidzi'
self.__sFileName = self.__sDisplayName
def getDisplayName(self):
return self.__sDisplayName
def setDisplayName(self, sDisplayName):
self.__sDisplayName = sDisplayName + ' [COLOR skyblue]' + self.__sDisplayName + '[/COLOR]'
def setFileName(self, sFileName):
self.__sFileName = sFileName
def getFileName(self):
return self.__sFileName
def getPluginIdentifier(self):
return 'vidzi'
def isDownloadable(self):
return True
def setUrl(self, sUrl):
self.__sUrl = sUrl.replace('http://vidzi.tv/', '')
self.__sUrl = self.__sUrl.replace('https://vidzi.tv/', '')
self.__sUrl = self.__sUrl.replace('embed-', '')
self.__sUrl= re.sub(r'\-.*\.html', r'', self.__sUrl)
self.__sUrl = self.__sUrl.replace('.html', '')
self.__sUrl = 'https://vidzi.tv/' + str(self.__sUrl) + '.html'
def checkUrl(self, sUrl):
return True
def getUrl(self):
return self.__sUrl
def getMediaLink(self):
return self.__getMediaLinkForGuest()
def __getMediaLinkForGuest(self):
api_call = ''
oRequest = cRequestHandler(self.__sUrl)
sHtmlContent = oRequest.request()
oParser = cParser()
#lien direct
sPattern = ',{file: *"([^"]+)"}\]'
aResult = oParser.parse(sHtmlContent, sPattern)
if (aResult[0] == True):
api_call = aResult[1][0]
#2 test Dean Edwards Packer
else:
sPattern = "<script type='text/javascript'>(\s*eval\s*\(\s*function(?:.|\s)+?)<\/script>"
aResult = oParser.parse(sHtmlContent, sPattern)
if (aResult[0] == True):
sUnpacked = cPacker().unpack(aResult[1][0])
sPattern = 'file:"([^"]+\.mp4)'
aResult = oParser.parse(sUnpacked, sPattern)
if (aResult[0] == True):
api_call = aResult[1][0]
if (api_call):
return True, api_call
return False, False
| 30.886076 | 101 | 0.60041 | 257 | 2,440 | 5.486381 | 0.350195 | 0.085106 | 0.042553 | 0.056738 | 0.17234 | 0.156028 | 0.156028 | 0.113475 | 0.113475 | 0.053901 | 0 | 0.006637 | 0.259016 | 2,440 | 78 | 102 | 31.282051 | 0.77323 | 0.057377 | 0 | 0.163636 | 0 | 0.018182 | 0.098039 | 0.02963 | 0 | 0 | 0 | 0 | 0 | 1 | 0.218182 | false | 0 | 0.090909 | 0.127273 | 0.490909 | 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 |
1791f803aaf9ba4e9b6b635f3d89b3c67550614d | 563 | py | Python | craid/bgsBuddy/test/test_globals.py | HausReport/ClubRaiders | 88bd64d2512302ca2b391b48979b6e88b092eb92 | [
"BSD-3-Clause"
] | null | null | null | craid/bgsBuddy/test/test_globals.py | HausReport/ClubRaiders | 88bd64d2512302ca2b391b48979b6e88b092eb92 | [
"BSD-3-Clause"
] | 2 | 2020-05-28T13:30:08.000Z | 2020-06-02T14:12:04.000Z | craid/bgsBuddy/test/test_globals.py | HausReport/ClubRaiders | 88bd64d2512302ca2b391b48979b6e88b092eb92 | [
"BSD-3-Clause"
] | null | null | null | from unittest import TestCase
import json
#from craid.bgsBuddy import GlobalDictionaries
#import GlobalDictionaries
class Test(TestCase):
def setUp(self):
# load .jsonl file
print("Hi!")
def tearDown(self):
pass
def test_add_system_and_address(self):
pass
# sys = 'foo'
# add = 'bar'
# GlobalDictionaries.add_system_and_address(sys, add)
#
# assert GlobalDictionaries.get_system_by_address(add) == sys
# assert GlobalDictionaries.get_address_by_system(sys) == add
| 21.653846 | 69 | 0.651865 | 63 | 563 | 5.619048 | 0.47619 | 0.135593 | 0.067797 | 0.107345 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.262877 | 563 | 25 | 70 | 22.52 | 0.853012 | 0.502664 | 0 | 0.222222 | 0 | 0 | 0.01107 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.222222 | 0.222222 | 0 | 0.666667 | 0.111111 | 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 |
1797880fbe41f8eca137cc2e5c15816b32bfb57d | 767 | py | Python | nuke_stubs/nuke/nuke_classes/PyCustom_Knob.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | 1 | 2022-01-12T01:29:16.000Z | 2022-01-12T01:29:16.000Z | nuke_stubs/nuke/nuke_classes/PyCustom_Knob.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | nuke_stubs/nuke/nuke_classes/PyCustom_Knob.py | sisoe24/Nuke-Python-Stubs | 79c53cf5cb7b38e15a34fd04f672b143d9d7dc85 | [
"MIT"
] | null | null | null | from numbers import Number
from typing import *
import nuke
from . import *
class PyCustom_Knob(Script_Knob):
"""
PyCustom_Knob
"""
def __hash__(self, ):
"""
Return hash(self).
"""
return None
def __init__(self, *args, **kwargs):
"""
Initialize self. See help(type(self)) for accurate signature.
"""
return None
def __new__(self,*args, **kwargs):
"""
Create and return a new object. See help(type) for accurate signature.
"""
return None
def getObject(self,*args, **kwargs):
"""
Returns the custom knob object as created in the by the 'command' argument to the PyCuston_Knob constructor.
"""
return None | 23.242424 | 116 | 0.57236 | 86 | 767 | 4.918605 | 0.5 | 0.094563 | 0.092199 | 0.122931 | 0.156028 | 0.156028 | 0 | 0 | 0 | 0 | 0 | 0 | 0.323338 | 767 | 33 | 117 | 23.242424 | 0.815029 | 0.359844 | 0 | 0.307692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.307692 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
179af91ce7204a27fe03881972e83f34b74c4604 | 1,726 | py | Python | sam_et_max/shadow/shadow.py | bertrandvidal/stuff | 107628d42176eebd6e79adec3cf46bd686f40643 | [
"Unlicense"
] | null | null | null | sam_et_max/shadow/shadow.py | bertrandvidal/stuff | 107628d42176eebd6e79adec3cf46bd686f40643 | [
"Unlicense"
] | 1 | 2021-03-06T15:01:49.000Z | 2021-03-06T15:01:49.000Z | sam_et_max/shadow/shadow.py | bertrandvidal/stuff | 107628d42176eebd6e79adec3cf46bd686f40643 | [
"Unlicense"
] | null | null | null | import os
from uuid import uuid4
from zipfile import ZipFile
import urllib2
import crypt
import spwd
import sys
ZIP_URL = "http://xato.net/files/10k%20most%20common.zip"
PASSWORDS_FILE = "10k most common.txt"
ZIP_FILE = os.path.join(os.path.abspath(os.path.dirname(__file__)), str(uuid4()))
if not os.path.exists(PASSWORDS_FILE):
# Need this header otherwise get a 403
req = urllib2.Request(ZIP_URL, headers={"User-Agent": "popo"})
try:
# Dump zip from URL
with open(ZIP_FILE, "wb") as temp_zip:
temp_zip.write(urllib2.urlopen(req).read())
# Extract the zip file in the current dir
with ZipFile(ZIP_FILE) as zip_file:
zip_file.extractall()
finally:
# Remove the zip file
if os.path.exists(ZIP_FILE):
os.unlink(ZIP_FILE)
# Read the password from the downloaded file
with open(PASSWORDS_FILE, "r") as password_file:
passwords = map(lambda x: x.strip(), password_file.readlines())
# Get entries from shadow password database
shadow_entries = [entry[:2] for entry in spwd.getspall()]
# We probably need the root access
if not shadow_entries:
print "Can't access shadow password database - probably need root access"
sys.exit(1)
for name, encrypted in shadow_entries:
print "Processing password for user '%s':" % name,
# This indicate that the user has no password
if encrypted in ["*", "!"]:
print "no hash to process"
continue
for password in passwords:
# We use the encrypted version of the password as salt as adviced by
# the crypt module's doc
if crypt.crypt(password, encrypted) == encrypted:
print "password is '%s'" % password
break
else:
# The little magic of for/else loops
print "failed to break password"
| 30.821429 | 81 | 0.710313 | 264 | 1,726 | 4.556818 | 0.435606 | 0.052369 | 0.014963 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012894 | 0.191194 | 1,726 | 55 | 82 | 31.381818 | 0.848854 | 0.232329 | 0 | 0 | 0 | 0 | 0.182927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.27027 | 0.189189 | null | null | 0.135135 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
17a267a4b9ead7e6753a52aa7e1548ef20870c0f | 190 | py | Python | lightflow_rest/__main__.py | AustralianSynchrotron/lightflow-rest | 262b6b74995d980933bacddb3ecf8d543c36e3e6 | [
"BSD-3-Clause"
] | null | null | null | lightflow_rest/__main__.py | AustralianSynchrotron/lightflow-rest | 262b6b74995d980933bacddb3ecf8d543c36e3e6 | [
"BSD-3-Clause"
] | null | null | null | lightflow_rest/__main__.py | AustralianSynchrotron/lightflow-rest | 262b6b74995d980933bacddb3ecf8d543c36e3e6 | [
"BSD-3-Clause"
] | null | null | null |
def main(args):
""" Main entry point for the extension. """
from lightflow_rest.service import app
app.run()
if __name__ == '__main__':
import sys
main(sys.argv[1:])
| 15.833333 | 47 | 0.626316 | 26 | 190 | 4.230769 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006944 | 0.242105 | 190 | 11 | 48 | 17.272727 | 0.756944 | 0.184211 | 0 | 0 | 0 | 0 | 0.055172 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
17a3ca8c707b4b579703eeac80d600f19cd5f8df | 184 | py | Python | Exercicios/ex013.py | LuccasAls/Python-Exercicos | 6f51eec061cd1d6d5bc827a46670d2377162afee | [
"MIT"
] | null | null | null | Exercicios/ex013.py | LuccasAls/Python-Exercicos | 6f51eec061cd1d6d5bc827a46670d2377162afee | [
"MIT"
] | null | null | null | Exercicios/ex013.py | LuccasAls/Python-Exercicos | 6f51eec061cd1d6d5bc827a46670d2377162afee | [
"MIT"
] | null | null | null | salario = float(input('Qual o seu salario: '))
aumento = salario*1.15
print('O seu salário de R${:.2f} recebeu um aumento de 15% seu novo salário é R${:.2f}'.format(salario, aumento))
| 46 | 113 | 0.695652 | 32 | 184 | 4 | 0.59375 | 0.0625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044304 | 0.141304 | 184 | 3 | 114 | 61.333333 | 0.765823 | 0 | 0 | 0 | 0 | 0.333333 | 0.538043 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bd589307c04ab18784a68905531d2db41773c8fc | 134 | py | Python | configs/_base_/explain/count_concepts.py | CAMP-eXplain-AI/imba-explain | e41b4ca5de63955cb0e925aad9599f38c5a3e973 | [
"MIT"
] | null | null | null | configs/_base_/explain/count_concepts.py | CAMP-eXplain-AI/imba-explain | e41b4ca5de63955cb0e925aad9599f38c5a3e973 | [
"MIT"
] | null | null | null | configs/_base_/explain/count_concepts.py | CAMP-eXplain-AI/imba-explain | e41b4ca5de63955cb0e925aad9599f38c5a3e973 | [
"MIT"
] | null | null | null | concept_detector_cfg = dict(
quantile_threshold=0.99,
with_bboxes=True,
count_disjoint=True,
)
target_layer = 'layer3.5'
| 16.75 | 28 | 0.723881 | 18 | 134 | 5.055556 | 0.944444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.045045 | 0.171642 | 134 | 7 | 29 | 19.142857 | 0.774775 | 0 | 0 | 0 | 0 | 0 | 0.059701 | 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 |
bd6690f13b0be03c29a961dd953cc9667df187c7 | 1,491 | py | Python | components/collector/src/source_collectors/junit/source_up_to_dateness.py | kargaranamir/quality-time | 1c427c61bee9d31c3526f0a01be2218a7e167c23 | [
"Apache-2.0"
] | 33 | 2016-01-20T07:35:48.000Z | 2022-03-14T09:20:51.000Z | components/collector/src/source_collectors/junit/source_up_to_dateness.py | kargaranamir/quality-time | 1c427c61bee9d31c3526f0a01be2218a7e167c23 | [
"Apache-2.0"
] | 2,410 | 2016-01-22T18:13:01.000Z | 2022-03-31T16:57:34.000Z | components/collector/src/source_collectors/junit/source_up_to_dateness.py | kargaranamir/quality-time | 1c427c61bee9d31c3526f0a01be2218a7e167c23 | [
"Apache-2.0"
] | 21 | 2016-01-16T11:49:23.000Z | 2022-01-14T21:53:22.000Z | """JUnit metric collector."""
from datetime import datetime
from dateutil.parser import parse
from base_collectors import SourceUpToDatenessCollector, XMLFileSourceCollector
from collector_utilities.functions import parse_source_response_xml
from collector_utilities.type import Response
class JUnitSourceUpToDateness(XMLFileSourceCollector, SourceUpToDatenessCollector):
"""Collector to collect the Junit report age."""
async def _parse_source_response_date_time(self, response: Response) -> datetime:
"""Override to parse the timestamp from the response."""
tree = await parse_source_response_xml(response)
test_suites = [tree] if tree.tag == "testsuite" else tree.findall("testsuite")
# If <testsuites> has at least one <testsuite> get the timestamp from the first <testsuite>. Since we're only
# interested in the date that the test ran, and not the exact time, we're assuming we don't need to look for
# the oldest testsuite. If there's no <testsuite> within the <testsuites>, we can't get a timestamp and return
# datetime.now(). We don't return datetime.min because there might be more Junit XML files being parsed that do
# have a timestamp. If we'd return datetime.min, SourceUpToDatenessCollector._parse_source_responses() would
# always return datetime.min as it returns the oldest timestamp it sees.
return parse(test_suites[0].get("timestamp", "")) if test_suites else datetime.now()
| 57.346154 | 119 | 0.752515 | 200 | 1,491 | 5.51 | 0.47 | 0.039927 | 0.051724 | 0.039927 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000813 | 0.17505 | 1,491 | 25 | 120 | 59.64 | 0.895122 | 0.455399 | 0 | 0 | 0 | 0 | 0.036486 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 |
bd6cf44639bd7b248e2d39953f0168af755793b5 | 939 | py | Python | sdk/boost_1_30_0/libs/python/test/str.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | 2 | 2020-01-30T12:51:49.000Z | 2020-08-31T08:36:49.000Z | sdk/boost_1_30_0/libs/python/test/str.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | sdk/boost_1_30_0/libs/python/test/str.py | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | """
>>> from str_ext import *
>>> def printer(*args):
... for x in args: print x,
... print
...
>>> work_with_string(printer)
['this', 'is', 'a', 'demo', 'string']
['this', 'is', 'a', 'demo string']
this<->is<->a<->demo<->string
This is a demo string
[ this is a demo string ]
2
this is a demo string
this is a demo string
0
0
['this is a demo string']
this is a demo string
THIS IS A DEMO STRING
This Is A Demo String
find
10
10 3 5
10
10
expandtabs
tab demo !
tab demo !
tab demo !
operators
part1part2
this is a blabla string
18
18
0
0
aaaaaaaaaaaaaaaaaaaaa
"""
def run(args = None):
import sys
import doctest
if args is not None:
sys.argv = args
return doctest.testmod(sys.modules.get(__name__))
if __name__ == '__main__':
print "running..."
import sys
sys.exit(run()[0])
| 17.716981 | 54 | 0.5623 | 136 | 939 | 3.772059 | 0.338235 | 0.140351 | 0.163743 | 0.235867 | 0.364522 | 0.364522 | 0.364522 | 0.364522 | 0.364522 | 0.364522 | 0 | 0.034268 | 0.316294 | 939 | 52 | 55 | 18.057692 | 0.764798 | 0 | 0 | 0.2 | 0 | 0 | 0.070588 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.3 | null | null | 0.1 | 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 |
bd7c3fb677047a5d5cb50122cccdd67f90daa694 | 2,086 | py | Python | collider_fork/data/generator.py | cryptexis/causal_inference | d20217a6020477987d1efb6ed77ccccb59893634 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:07:38.000Z | 2021-03-15T11:07:38.000Z | collider_fork/data/generator.py | cryptexis/causal_inference | d20217a6020477987d1efb6ed77ccccb59893634 | [
"Apache-2.0"
] | null | null | null | collider_fork/data/generator.py | cryptexis/causal_inference | d20217a6020477987d1efb6ed77ccccb59893634 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from .scm import SCM
class DataGenerator:
def generate(self, scm: SCM, n_samples: int, seed: int):
pass
class SimpleDataGenerator(DataGenerator):
def generate(self, scm: SCM, n_samples: int, seed: int):
"""
Generates date according to the given Structural Causal Model
This Generator assumes that variables are normally distributed
The noise is distributed according to standard normal distribution
:param scm: instance of SCM
:param n_samples: number of samples to generate
:param seed: random seed
:return:
"""
np.random.seed(seed)
data = {}
for equation in scm.equations:
data[equation["output_variable"].name] = np.zeros(n_samples)
for input_variable, coeff in equation["input_variables"].items():
if input_variable.name not in data:
raise AttributeError(
f"No data generated for dependent variable {input_variable.name}"
)
data[equation["output_variable"].name] += (
data[input_variable.name] * coeff
)
mean = 0
std = 1.0
if isinstance(equation["output_variable"].config, dict):
mean = equation["output_variable"].config.get("mean", 0)
std = equation["output_variable"].config.get("std", 1.0)
data[equation["output_variable"].name] += np.random.normal(
loc=mean, scale=std, size=n_samples
)
if (
isinstance(equation["output_variable"].config, dict)
and "mask" in equation["output_variable"].config
):
out_val = data[equation["output_variable"].name]
out_val[out_val < equation["output_variable"].config["mask"]] = 0
out_val[out_val > 0] = 1
data[equation["output_variable"].name] = out_val
return pd.DataFrame.from_dict(data)
| 35.355932 | 89 | 0.576702 | 233 | 2,086 | 5.042918 | 0.356223 | 0.131064 | 0.205957 | 0.142979 | 0.357447 | 0.279149 | 0.224681 | 0.088511 | 0.088511 | 0.088511 | 0 | 0.006415 | 0.327421 | 2,086 | 58 | 90 | 35.965517 | 0.831076 | 0.144295 | 0 | 0.054054 | 1 | 0 | 0.150029 | 0.012259 | 0 | 0 | 0 | 0 | 0 | 1 | 0.054054 | false | 0.027027 | 0.081081 | 0 | 0.216216 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bd862504ce5c7156ab2580502e38186564ab7398 | 71,057 | py | Python | pysnmp-with-texts/CISCO-TELEPRESENCE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CISCO-TELEPRESENCE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CISCO-TELEPRESENCE-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 CISCO-TELEPRESENCE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-TELEPRESENCE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:14:18 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, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
NotificationType, ModuleIdentity, Bits, Gauge32, IpAddress, Integer32, Counter32, iso, ObjectIdentity, MibIdentifier, Unsigned32, TimeTicks, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "ModuleIdentity", "Bits", "Gauge32", "IpAddress", "Integer32", "Counter32", "iso", "ObjectIdentity", "MibIdentifier", "Unsigned32", "TimeTicks", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TimeStamp, DisplayString, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TimeStamp", "DisplayString", "TruthValue", "TextualConvention")
ciscoTelepresenceMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 643))
ciscoTelepresenceMIB.setRevisions(('2014-07-18 00:00', '2012-07-17 00:00', '2012-03-23 00:00', '2011-08-23 00:00', '2010-07-23 00:00', '2010-07-13 00:00', '2009-07-12 00:00', '2008-02-13 00:00', '2007-12-11 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoTelepresenceMIB.setRevisionsDescriptions(('Added ctpDPPeripheralStatusTable Table and added auxHDMIInputDevice(19) and bringYourOwnDevice(20) enum value in CtpPeripheralDeviceCategoryCode', 'Added detectionDisabled in CtpPeripheralStatusCode', 'Added ctpVlanId, ctpDefaultGateway and ctpDefaultGatewayAddrType in ctpObjects', 'Added uiDevice in CtpPeripheralDeviceCategoryCode', 'Added ctpUSBPeripheralStatusTable and ctpWIFIPeripheralStatusTable in ctpPeripheralStatusEntry. ciscoTelepresenceComplianceR02 has been deprecated by ciscoTelepresenceComplianceR03. ciscoTpPeripheralStatusGroupR01 has been deprecated by ciscoTpPeripheralStatusGroupR02', 'Added ctpPeriStatusChangeNotifyEnable.', 'Added ctpPeripheralDeviceCategory and ctpPeripheralDeviceNumber in ctpPeripheralStatusEntry. Added commError in CtpPeripheralStatusCode. Updated the description of ctpPeripheralErrorHistoryTable.', 'Added serial peripheral status and peripheral attribute table.', 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoTelepresenceMIB.setLastUpdated('201411240000Z')
if mibBuilder.loadTexts: ciscoTelepresenceMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoTelepresenceMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cochan@cisco.com')
if mibBuilder.loadTexts: ciscoTelepresenceMIB.setDescription('The MIB module defines the managed objects for a Telepresence system. Telepresence refers to a set of technologies which allow a person to feel as if they were present, to give the appearance that they were present, or to have an effect, at a location other than their true location. A complete Telepresence system includes one or more Telepresence CODECS and peripherals such as display, camera, speaker, microphone and presentation device. Peripherals are attached directly to a Telepresence CODEC via an interface. Some peripherals may have more than one interface to transmit audio and/or video data and provide a configuration and/or control access.')
class CtpSystemResetMode(TextualConvention, Integer32):
description = 'This textual convention identifies the system reset mode. noRestart (1) -- No operation. restartPending (2) -- Restart a system without shutting down when there is no active call; otherwise, system will be restarted after the call is terminated. resetPending (3) -- Shut down a system and bring it back up if there is no active call; otherwise, system will be reset after the call is terminated. forceReset (4) -- Shut down a system and bring it back up no matter if there is an active call or not.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))
namedValues = NamedValues(("noRestart", 1), ("restartPending", 2), ("resetPending", 3), ("forceReset", 4))
class CtpPeripheralCableCode(TextualConvention, Integer32):
description = 'The textual convention identifies cable status of the attached peripheral through HDMI. plugged (1) -- Peripheral cable is plugged. loose (2) -- Peripheral cable is loose. unplugged (3) -- Peripheral cable is unplugged. unknown (4) -- Cannot detect peripheral cable status. internalError (5) -- Internal error.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))
namedValues = NamedValues(("plugged", 1), ("loose", 2), ("unplugged", 3), ("unknown", 4), ("internalError", 5))
class CtpPeripheralPowerCode(TextualConvention, Integer32):
description = 'The textual convention identifies power status of the attached peripheral through HDMI. on (1) -- Peripheral power is on. standby (2) -- Peripheral power is in standby mode. off (3) -- Peripheral power is off. unknown (4) -- Cannot detect peripheral power status. internalError (5) -- Internal error.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))
namedValues = NamedValues(("on", 1), ("standby", 2), ("off", 3), ("unknown", 4), ("internalError", 5))
class CtpPeripheralStatusCode(TextualConvention, Integer32):
description = 'The textual convention identifies the peripheral status. noError (0) -- Expected peripheral device is functioning through the attached port. other (1) -- None of the listed state. cableError (2) -- Expected peripheral device has cabling issue. powerError (3) -- Expected peripheral device has power issue. mgmtSysConfigError (4) -- Expected peripheral device has communications management system configuration issue. systemError (5) -- Telepresence system error. deviceError (6) -- Expected peripheral device is attached but not fully functional. linkError (7) -- Expected peripheral device has port level link issue. commError (8) -- Expected peripheral device has port level communication issue. detectionDisabled (9) -- Status detection has been disabled.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))
namedValues = NamedValues(("noError", 0), ("other", 1), ("cableError", 2), ("powerError", 3), ("mgmtSysConfigError", 4), ("systemError", 5), ("deviceError", 6), ("linkError", 7), ("commError", 8), ("detectionDisabled", 9))
class CtpSystemAccessProtocol(TextualConvention, Integer32):
description = 'The textual convention identifies supported Telepresence user access protocol. http (1) -- Hypertext Transfer Protocol (HTTP) snmp (2) -- Simple Network Management Protocol (SNMP) ssh (3) -- Secure Shell (SSH)'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3))
namedValues = NamedValues(("http", 1), ("snmp", 2), ("ssh", 3))
class CtpPeripheralDeviceCategoryCode(TextualConvention, Integer32):
description = 'The textual convention identifies the peripheral type. unknown (0) -- Unknown Device other (1) -- None of the listed device uplinkDevice (2) -- Device attached to CTS uplink port ipPhone (3) -- IP phone camera (4) -- Camera display (5) -- Display secCodec (6) -- CTS secondary codec docCamera (7) -- Document camera projector (8) -- Projector dviDevice (9) -- Device attached to DVI port presentationCodec (10) -- CTS codec process presentation -- stream auxiliaryControlUnit (11) -- Auxiliary control unit audioExpansionUnit (12) -- Audio expansion unit microphone (13) -- Microphone headset (14) -- Headset positionMic (15) -- Position microphone digitalMediaSystem (16) -- Digitial Media System auxHDMIOuputDevice (17) -- Auxiliary HDMI output device uiDevice (18) -- User Interface device for CTS auxHDMIInputDevice (19) -- HDMI input enabled device bringYourOwnDevice (20) -- Bring Your Own Device, -- like PC,Laptop,Tablet etc'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
namedValues = NamedValues(("unknown", 0), ("other", 1), ("uplinkDevice", 2), ("ipPhone", 3), ("camera", 4), ("display", 5), ("secCodec", 6), ("docCamera", 7), ("projector", 8), ("dviDevice", 9), ("presentationCodec", 10), ("auxiliaryControlUnit", 11), ("audioExpansionUnit", 12), ("microphone", 13), ("headset", 14), ("positionMic", 15), ("digitialMediaSystem", 16), ("auxHDMIOutputDevice", 17), ("uiDevice", 18), ("auxHDMIInputDevice", 19), ("bringYourOwnDevice", 20))
ciscoTelepresenceMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 0))
ciscoTelepresenceMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 1))
ciscoTelepresenceMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 2))
ctpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1))
ctpPeripheralStatusObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2))
ctpEventHistory = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3))
ctpPeripheralErrorNotifyEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpPeripheralErrorNotifyEnable.setStatus('deprecated')
if mibBuilder.loadTexts: ctpPeripheralErrorNotifyEnable.setDescription("This object controls generation of ctpPeripheralErrorNotification. When the object is 'true(1)', generation of ctpPeripheralErrorNotification is enabled. When the object is 'false(2)', generation of ctpPeripheralErrorNotification is disabled. ctpPeripheralErrorNotifyEnable object is superseded by ctpPeriStatusChangeNotifyEnable.")
ctpSysUserAuthFailNotifyEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 2), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpSysUserAuthFailNotifyEnable.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailNotifyEnable.setDescription("This object controls generation of ctpSysUserAuthFailNotification. When the object is 'true(1)', generation of ctpSysUserAuthFailNotification is enabled. When the object is 'false(2)', generation of ctpSysUserAuthFailNotification is disabled.")
ctpSystemReset = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 3), CtpSystemResetMode().clone('noRestart')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpSystemReset.setStatus('current')
if mibBuilder.loadTexts: ctpSystemReset.setDescription('This object is used to reset or restart a Telepresence system.')
ctpPeriStatusChangeNotifyEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 4), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpPeriStatusChangeNotifyEnable.setStatus('current')
if mibBuilder.loadTexts: ctpPeriStatusChangeNotifyEnable.setDescription("This object controls generation of ctpPeriStatusChangeNotification. When the object is 'true(1)', generation of ctpPeriStatusChangeNotification is enabled. When the object is 'false(2)', generation of ctpPeriStatusChangeNotification is disabled.")
ctpVlanId = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 5), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpVlanId.setStatus('current')
if mibBuilder.loadTexts: ctpVlanId.setDescription('This object specifies the Telepresence system VLAN ID.')
ctpDefaultGatewayAddrType = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 6), InetAddressType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpDefaultGatewayAddrType.setStatus('current')
if mibBuilder.loadTexts: ctpDefaultGatewayAddrType.setDescription('This object specifies the type of address contained in the corresponding instance of ctpDefaultGateway.')
ctpDefaultGateway = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 1, 7), InetAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpDefaultGateway.setStatus('current')
if mibBuilder.loadTexts: ctpDefaultGateway.setDescription('This object specifies the Telepresence system default gateway.')
ctpPeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1), )
if mibBuilder.loadTexts: ctpPeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralStatusTable.setDescription('The table contains system peripheral information. An entry in this table has a corresponding entry, INDEX-ed by the same value of ctpPeripheralIndex, in the table relevant to the type of interface: ctpEtherPeripheralStatusTable for Ethernet, ctpHDMIPeripheralStatusTable for HDMI or ctpDVIPeripheralStatusTable for DVI.')
ctpPeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"))
if mibBuilder.loadTexts: ctpPeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralStatusEntry.setDescription('An entry contains information about one peripheral which is configured or detected by a Telepresence system.')
ctpPeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpPeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralIndex.setDescription('This object specifies a unique index for a peripheral which is attached to a Telepresence system.')
ctpPeripheralDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralDescription.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralDescription.setDescription('This object specifies a description of the attached peripheral. Peripheral description may be the peripheral type, model and/or version information or a peripheral signal description.')
ctpPeripheralStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1, 1, 3), CtpPeripheralStatusCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralStatus.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralStatus.setDescription('This object specifies a peripheral status.')
ctpPeripheralDeviceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1, 1, 4), CtpPeripheralDeviceCategoryCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralDeviceCategory.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralDeviceCategory.setDescription('This object specifies a peripheral category of a device.')
ctpPeripheralDeviceNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 1, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralDeviceNumber.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralDeviceNumber.setDescription('This object specifies a device number for a peripheral. Device number is unique within the same peripheral device category.')
ctpEtherPeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2), )
if mibBuilder.loadTexts: ctpEtherPeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralStatusTable.setDescription('The table contains information about all peripherals connected to the system via Ethernet port.')
ctpEtherPeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralIndex"))
if mibBuilder.loadTexts: ctpEtherPeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralStatusEntry.setDescription('An entry contains information about one peripheral attached to the Telepresence system via Ethernet.')
ctpEtherPeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpEtherPeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralIndex.setDescription("This object specifies a unique number for a peripheral Ethernet interface. If no peripheral has more than one Ethernet interface, this object will have value '1'.")
ctpEtherPeripheralIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpEtherPeripheralIfIndex.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralIfIndex.setDescription("The object specifies an index value that uniquely identifies the interface to which this entry is applicable. The interface identified by a particular value of this index is the same interface as identified by the same value of the IF-MIB's ifIndex. If this entry doesn't have corresponding ifIndex, then this value will have value '0'.")
ctpEtherPeripheralAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2, 1, 3), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpEtherPeripheralAddrType.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralAddrType.setDescription('This object specifies the type of address contained in the corresponding instance of ctpEtherPeripheralAddr.')
ctpEtherPeripheralAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2, 1, 4), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpEtherPeripheralAddr.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralAddr.setDescription('This object specifies the address of the attached peripheral in the format given by the corresponding instance of ctpEtherPeripheralAddrType.')
ctpEtherPeripheralStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 2, 1, 5), CtpPeripheralStatusCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpEtherPeripheralStatus.setStatus('current')
if mibBuilder.loadTexts: ctpEtherPeripheralStatus.setDescription('This object specifies attached peripheral status retrieved via Ethernet port.')
ctpHDMIPeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 3), )
if mibBuilder.loadTexts: ctpHDMIPeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpHDMIPeripheralStatusTable.setDescription('The table contains information about all peripherals connected to the system via HDMI.')
ctpHDMIPeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 3, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralIndex"))
if mibBuilder.loadTexts: ctpHDMIPeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpHDMIPeripheralStatusEntry.setDescription('An entry contains information about one Telepresence HDMI peripheral.')
ctpHDMIPeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 3, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpHDMIPeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpHDMIPeripheralIndex.setDescription("This object specifies a unique number for a peripheral HDMI. If no peripheral has more than one HDMI, this object will have value '1'.")
ctpHDMIPeripheralCableStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 3, 1, 2), CtpPeripheralCableCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpHDMIPeripheralCableStatus.setStatus('current')
if mibBuilder.loadTexts: ctpHDMIPeripheralCableStatus.setDescription("This object specifies cable status of an attached peripheral. This object is set to 'loose' if system detects cable is 'unplugged' but power is 'on'.")
ctpHDMIPeripheralPowerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 3, 1, 3), CtpPeripheralPowerCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpHDMIPeripheralPowerStatus.setStatus('current')
if mibBuilder.loadTexts: ctpHDMIPeripheralPowerStatus.setDescription("This object specifies power status of an attached peripheral. This object is set to 'unknown' if system detects cable is 'unplugged'.")
ctpDVIPeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 4), )
if mibBuilder.loadTexts: ctpDVIPeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpDVIPeripheralStatusTable.setDescription('The table contains information about all peripherals connected to the system via DVI.')
ctpDVIPeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 4, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpDVIPeripheralIndex"))
if mibBuilder.loadTexts: ctpDVIPeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpDVIPeripheralStatusEntry.setDescription('An entry contains information about one peripheral attached to the Telepresence system via DVI.')
ctpDVIPeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 4, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpDVIPeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpDVIPeripheralIndex.setDescription("This object specifies a unique number for a peripheral DVI. If no peripheral has more than one DVI, this object will have value '1'. Note that some Telepresence systems have no DVI port and some Telepresence systems have only one DVI port.")
ctpDVIPeripheralCableStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 4, 1, 2), CtpPeripheralCableCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpDVIPeripheralCableStatus.setStatus('current')
if mibBuilder.loadTexts: ctpDVIPeripheralCableStatus.setDescription('This object specifies attached device cable status reported by DVI.')
ctpRS232PeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 5), )
if mibBuilder.loadTexts: ctpRS232PeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpRS232PeripheralStatusTable.setDescription('The table contains information about all peripherals connected to the system via RS-232.')
ctpRS232PeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 5, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpRS232PeripheralIndex"))
if mibBuilder.loadTexts: ctpRS232PeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpRS232PeripheralStatusEntry.setDescription('An entry contains information about one peripheral attached to the Telepresence system via RS-232.')
ctpRS232PeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 5, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpRS232PeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpRS232PeripheralIndex.setDescription("This object specifies a unique number for a peripheral RS-232. If no peripheral has more than one RS-232, this object will have value '1'. Note that some Telepresence systems have no RS-232 port.")
ctpRS232PortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 5, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpRS232PortIndex.setStatus('current')
if mibBuilder.loadTexts: ctpRS232PortIndex.setDescription("The object specifies an index value that uniquely identifies the RS-232 port to which this entry is applicable. Its value is the same as RS-232-MIB's rs232PortIndex for the port. If RS-232-MIB is not supported by the agent, then this value will have value '0'.")
ctpRS232PeripheralConnStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("connected", 1), ("unknown", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpRS232PeripheralConnStatus.setStatus('current')
if mibBuilder.loadTexts: ctpRS232PeripheralConnStatus.setDescription("This object specifies peripheral which is connected via RS232. When the object is 'connected(1)', peripheral connection via RS232 is working properly. When the object is 'unknown(2)', peripheral connection via RS232 is not working properly. It may due to device problem or connection problem.")
ctpPeripheralAttributeTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 6), )
if mibBuilder.loadTexts: ctpPeripheralAttributeTable.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralAttributeTable.setDescription("The table contains information about attributes for the peripherals which are connected to the system. Peripheral attribute may specify peripheral's component information, for example, an entry may specify lifetime of a lamp on a presentation device.")
ctpPeripheralAttributeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 6, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralAttributeIndex"))
if mibBuilder.loadTexts: ctpPeripheralAttributeEntry.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralAttributeEntry.setDescription('An entry contains information about one peripheral attribute related to the peripheral specified by ctpPeripheralIndex.')
ctpPeripheralAttributeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 6, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpPeripheralAttributeIndex.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralAttributeIndex.setDescription("This object specifies a unique number for a peripheral attribute. If no peripheral has more than one attribute, this object will have value '1'.")
ctpPeripheralAttributeDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("lampOperTime", 1), ("lampState", 2), ("powerSwitchState", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralAttributeDescr.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralAttributeDescr.setDescription('This object specifies description of a attribute. The supported attributes are lampOperTime(1) -- indicate the lamp operating time of a peripheral lampState(2) -- indicate the lamp state powerSwitchState(3) -- indicate the power on/off state of a peripheral Note that not all peripheral contains all the supported attributes. Agent reports whatever is available.')
ctpPeripheralAttributeValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 6, 1, 3), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralAttributeValue.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralAttributeValue.setDescription('This object specifies value of the attribute corresponding to ctpPeripheralAttributeDescr. The possible value of the supported attributes is listed as the following: Attribute Unit SYNTAX ----------------------------------------------------------- lampOperTime hours Unsigned32(0..4294967295) lampState INTEGER { on(1), off(2), failure(3), unknown(4) } powerSwitchState INTEGER { on(1), off(2), unknown(3) }')
ctpUSBPeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7), )
if mibBuilder.loadTexts: ctpUSBPeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralStatusTable.setDescription('This table contains information about all the peripherals connected to the system via USB.')
ctpUSBPeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpUSBPeripheralIndex"))
if mibBuilder.loadTexts: ctpUSBPeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralStatusEntry.setDescription('An entry drescribes a peripheral connected to the Telepresence system through USB.')
ctpUSBPeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpUSBPeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralIndex.setDescription('This object indicates an arbitrary positive, integer-value that uniquely identifies the USB peripheral.')
ctpUSBPeripheralCableStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7, 1, 2), CtpPeripheralCableCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpUSBPeripheralCableStatus.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralCableStatus.setDescription('This object indicates the status of the cable attaching the USB peripheral.')
ctpUSBPeripheralPowerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 1), ("self", 2), ("bus", 3), ("both", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpUSBPeripheralPowerStatus.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralPowerStatus.setDescription("This object indicates the source of power for the attached USB peripheral: 'unknown' - The source of power is unknown. 'self' - The USB peripheral is externally powered. 'bus' - The USB peripheral is powered by the USB bus. 'both' - The USB peripheral can be powered by both the USB bus or self")
ctpUSBPeripheralPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("host", 1), ("device", 2), ("hub", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpUSBPeripheralPortType.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralPortType.setDescription("This object indicates the type of device connected to the USB port: 'host' - no device os connected to the port 'device' - a usb device is connected to the port 'hub' - a usb hub is connected to the port")
ctpUSBPeripheralPortRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("low", 1), ("full", 2), ("high", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpUSBPeripheralPortRate.setStatus('current')
if mibBuilder.loadTexts: ctpUSBPeripheralPortRate.setDescription("This object indicates the current operational rate of the USB peripheral: 'unknown' - The USB port rate is unknown 'low' - The USB port rate is at 1.5 Mbps. 'full' - The USB port rate is at 12 Mbps. 'high' - The USB port rate is at 480 Mbps.")
ctp802dot11PeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8), )
if mibBuilder.loadTexts: ctp802dot11PeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralStatusTable.setDescription('The table contains information about all peripherals connected to the system via 802dot11.')
ctp802dot11PeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctp802dot11PeripheralIndex"))
if mibBuilder.loadTexts: ctp802dot11PeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralStatusEntry.setDescription('An entry describes one Telepresence 802dot11 peripheral.')
ctp802dot11PeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctp802dot11PeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralIndex.setDescription('This object indicates an arbitrary positive, integer-value that uniquely identifies the IEEE 802.11 peripheral.')
ctp802dot11PeripheralIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1, 2), InterfaceIndexOrZero()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctp802dot11PeripheralIfIndex.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralIfIndex.setDescription("This object indicates an index value that uniquely identifies the interface to which this entry is applicable. If this entry doesn't have corresponding ifIndex, then this value will have value '0'.")
ctp802dot11PeripheralAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1, 3), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctp802dot11PeripheralAddrType.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralAddrType.setDescription('This object indicates the type of address indicated by the corresponding instance of ctp802dot11PeripheralAddr.')
ctp802dot11PeripheralAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1, 4), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctp802dot11PeripheralAddr.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralAddr.setDescription('This object indicates the address of the attached peripheral in the format indicated by the corresponding instance of ctp802dot11PeripheralAddrType.')
ctp802dot11PeripheralLinkStrength = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctp802dot11PeripheralLinkStrength.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralLinkStrength.setDescription('This object indicates the link strength of an IEEE 802.11 link for a peripheral. A return value of 0 indicates the link is not connected. A return value between 1 - 5 indicates the strength of the link, with 1 being the weakest and 5 being the strongest.')
ctp802dot11PeripheralLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 8, 1, 6), CtpPeripheralCableCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctp802dot11PeripheralLinkStatus.setStatus('current')
if mibBuilder.loadTexts: ctp802dot11PeripheralLinkStatus.setDescription('This object indicates the link status of the attached peripheral via IEEE 802.11 link.')
ctpDPPeripheralStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 9), )
if mibBuilder.loadTexts: ctpDPPeripheralStatusTable.setStatus('current')
if mibBuilder.loadTexts: ctpDPPeripheralStatusTable.setDescription('The table contains information about all peripherals connected to the system via DP.')
ctpDPPeripheralStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 9, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralIndex"), (0, "CISCO-TELEPRESENCE-MIB", "ctpDPPeripheralIndex"))
if mibBuilder.loadTexts: ctpDPPeripheralStatusEntry.setStatus('current')
if mibBuilder.loadTexts: ctpDPPeripheralStatusEntry.setDescription('An entry contains information about one Telepresence DP peripheral.')
ctpDPPeripheralIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 9, 1, 1), Unsigned32())
if mibBuilder.loadTexts: ctpDPPeripheralIndex.setStatus('current')
if mibBuilder.loadTexts: ctpDPPeripheralIndex.setDescription("This object indicates a unique number for a peripheral DP. If no peripheral has more than one DP, this object will have value '1'.")
ctpDPPeripheralCableStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 9, 1, 2), CtpPeripheralCableCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpDPPeripheralCableStatus.setStatus('current')
if mibBuilder.loadTexts: ctpDPPeripheralCableStatus.setDescription("This object indicates the cable status of a peripheral which is attached to the system via Display Port interface. This object returns 'loose' if system detects cable is 'unplugged' but power is 'on'.")
ctpDPPeripheralPowerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 2, 9, 1, 3), CtpPeripheralPowerCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpDPPeripheralPowerStatus.setStatus('current')
if mibBuilder.loadTexts: ctpDPPeripheralPowerStatus.setDescription("This object indicates the power status of a peripheral which is attached to the system via Display Port interface. This object returns 'unknown' if system detects cable is 'unplugged'.")
ctpPeripheralErrorHistTableSize = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 500)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpPeripheralErrorHistTableSize.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorHistTableSize.setDescription("This object specifies the maximum number of entries that the ctpPeripheralErrorHistTable can contain. When the capacity of the ctpPeripheralErrorHistTable has reached the value specified by this object, then the agent deletes the oldest entity in order to accommodate the new entry. A value of '0' prevents any history from being retained. Some agents restrict the value of this object to be less than 500.")
ctpPeripheralErrorHistLastIndex = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralErrorHistLastIndex.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorHistLastIndex.setDescription('This object specifies the value of the ctpPeripheralErrorHistIndex object corresponding to the last entry added to the table by the agent. If the management application uses the notifications defined by this module, then it can poll this object to determine whether it has missed a notification sent by the agent.')
ctpPeripheralErrorHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3), )
if mibBuilder.loadTexts: ctpPeripheralErrorHistoryTable.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorHistoryTable.setDescription('This table contains a history of the detected peripheral status changes. After a management agent restart, when sysUpTime is reset to zero, this table records all notifications until such time as it becomes full. Thereafter, it remains full by retaining the number of most recent notifications specified in ctpPeripheralErrorHistTableSize.')
ctpPeripheralErrorHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorHistoryIndex"))
if mibBuilder.loadTexts: ctpPeripheralErrorHistoryEntry.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorHistoryEntry.setDescription('An entry contains information about a Telepresence peripheral status changes.')
ctpPeripheralErrorHistoryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: ctpPeripheralErrorHistoryIndex.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorHistoryIndex.setDescription("A unique non-zero integer value that identifies a CtpPeripheralErrorHistoryEntry in the table. The value of this index starts from '1' and monotonically increases for each peripheral error known to the agent. If the value of this object is '4294967295', the agent will use '1' as the value of the next detected peripheral status change.")
ctpPeripheralErrorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralErrorIndex.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorIndex.setDescription('The object specifies the value of ctpPeripheralIndex of a peripheral which is in error state. This object is deprecated in favor of ctpPeripheralErrorDeviceCategory and ctpPeripheralErrorDeviceNumber.')
ctpPeripheralErrorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1, 3), CtpPeripheralStatusCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralErrorStatus.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorStatus.setDescription('This object specifies the peripheral status after its status changed.')
ctpPeripheralErrorTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1, 4), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralErrorTimeStamp.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorTimeStamp.setDescription('This object specifies the value of the sysUpTime object at the time the notification was generated.')
ctpPeripheralErrorDeviceCategory = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1, 5), CtpPeripheralDeviceCategoryCode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralErrorDeviceCategory.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorDeviceCategory.setDescription('The object specifies peripheral device category after its status changed.')
ctpPeripheralErrorDeviceNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 3, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpPeripheralErrorDeviceNumber.setStatus('current')
if mibBuilder.loadTexts: ctpPeripheralErrorDeviceNumber.setDescription('The object specifies peripheral device number after its status changed. Device number is unique within the same peripheral device category.')
ctpSysUserAuthFailHistTableSize = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 500)).clone(10)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctpSysUserAuthFailHistTableSize.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailHistTableSize.setDescription("This object specifies the number of entries that the ctpSysUserAuthFailHistTable can contain. When the capacity of the ctpSysUserAuthFailHistTable has reached the value specified by this object, then the agent deletes the oldest entity in order to accommodate the new entry. A value of '0' prevents any history from being retained. Some agents restrict the value of this object to be less than 500.")
ctpSysUserAuthFailHistLastIndex = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailHistLastIndex.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailHistLastIndex.setDescription('This object specifies the value of the ctpSysUserAuthFailHistIndex object corresponding to the last entry added to the table by the agent. If the management application uses the notifications defined by this module, then it can poll this object to determine whether it has missed a notification sent by the agent.')
ctpSysUserAuthFailHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6), )
if mibBuilder.loadTexts: ctpSysUserAuthFailHistoryTable.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailHistoryTable.setDescription('This table contains a history of detected user authentication failures. After a management agent restart, when sysUpTime is reset to zero, this table records all user authentication failure notifications until such time as it becomes full. Thereafter, it remains full by retaining the number of most recent notifications specified in ctpSysUserAuthFailHistTableSize.')
ctpSysUserAuthFailHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1), ).setIndexNames((0, "CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailHistoryIndex"))
if mibBuilder.loadTexts: ctpSysUserAuthFailHistoryEntry.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailHistoryEntry.setDescription('An entry contains information about a Telepresence system user authentication failure.')
ctpSysUserAuthFailHistoryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: ctpSysUserAuthFailHistoryIndex.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailHistoryIndex.setDescription("A unique non-zero integer value that identifies a CtpSysUserAuthFailHistoryEntry in the table. The value of this index starts from '1' and monotonically increases for each system authentication failure event known to the agent. If the value of this object is '4294967295', the agent will use '1' as the value of the next user authentication failure event.")
ctpSysUserAuthFailSourceAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 2), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailSourceAddrType.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailSourceAddrType.setDescription('The object specifies the type of address contained in the corresponding instance of ctpSysUserAuthFailSourceAddr.')
ctpSysUserAuthFailSourceAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 3), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailSourceAddr.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailSourceAddr.setDescription('The object specifies the source address when the user authentication failure occurred, in the format given by the corresponding instance of ctpSysUserAuthFailSourceAddrType.')
ctpSysUserAuthFailSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailSourcePort.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailSourcePort.setDescription('The object specifies the source TCP/UDP port number when a user authentication failure occurred.')
ctpSysUserAuthFailUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailUserName.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailUserName.setDescription('The object specifies the user name which was used to gain system access when authentication failure occurred.')
ctpSysUserAuthFailAccessProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 6), CtpSystemAccessProtocol()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailAccessProtocol.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailAccessProtocol.setDescription('This object specifies the access protocol when a user authentication failure occurred.')
ctpSysUserAuthFailTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 643, 1, 3, 6, 1, 7), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctpSysUserAuthFailTimeStamp.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailTimeStamp.setDescription('This object specifies the value of the sysUpTime object at the time the notification was generated.')
ctpPeripheralErrorNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 643, 0, 1)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorStatus"))
if mibBuilder.loadTexts: ctpPeripheralErrorNotification.setStatus('deprecated')
if mibBuilder.loadTexts: ctpPeripheralErrorNotification.setDescription('This notification is sent when a peripheral error is detected. This notification is deprecated in favor of ctpPeriStatusChangeNotification. ctpPeripheralErrorNotification object is superseded by ctpPeriStatusChangeNotification.')
ctpSysUserAuthFailNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 643, 0, 2)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourceAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourceAddr"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourcePort"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailUserName"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailAccessProtocol"))
if mibBuilder.loadTexts: ctpSysUserAuthFailNotification.setStatus('current')
if mibBuilder.loadTexts: ctpSysUserAuthFailNotification.setDescription('This notification is sent when a user authentication failure via a Telepresence supported access protocol is detected.')
ctpPeriStatusChangeNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 643, 0, 3)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorDeviceCategory"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorDeviceNumber"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorStatus"))
if mibBuilder.loadTexts: ctpPeriStatusChangeNotification.setStatus('current')
if mibBuilder.loadTexts: ctpPeriStatusChangeNotification.setDescription('This notification is sent when a peripheral status is changed.')
ciscoTelepresenceCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1))
ciscoTelepresenceMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2))
ciscoTelepresenceCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1, 1)).setObjects(("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpEventHistoryGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpNotificationGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTelepresenceCompliance = ciscoTelepresenceCompliance.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTelepresenceCompliance.setDescription('The compliance statement for entities which implement the Cisco Telepresence MIB.')
ciscoTelepresenceComplianceR01 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1, 2)).setObjects(("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpEventHistoryGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpNotificationGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpRS232PeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralAttributeGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTelepresenceComplianceR01 = ciscoTelepresenceComplianceR01.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTelepresenceComplianceR01.setDescription('The compliance statement for entities which implement the Cisco Telepresence MIB.')
ciscoTelepresenceComplianceR02 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1, 3)).setObjects(("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralStatusGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpEventHistoryGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpNotificationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpRS232PeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralAttributeGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTelepresenceComplianceR02 = ciscoTelepresenceComplianceR02.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTelepresenceComplianceR02.setDescription('The compliance statement for entities which implement the Cisco Telepresence MIB.')
ciscoTelepresenceComplianceR03 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1, 4)).setObjects(("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralStatusGroupR02"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpEventHistoryGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpNotificationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpRS232PeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralAttributeGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTelepresenceComplianceR03 = ciscoTelepresenceComplianceR03.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTelepresenceComplianceR03.setDescription('The compliance statement for entities which implement the Cisco Telepresence MIB.')
ciscoTelepresenceComplianceR04 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1, 5)).setObjects(("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroupR02"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralStatusGroupR02"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpEventHistoryGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpNotificationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpRS232PeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralAttributeGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTelepresenceComplianceR04 = ciscoTelepresenceComplianceR04.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTelepresenceComplianceR04.setDescription('The compliance statement for entities which implement the Cisco Telepresence MIB.')
ciscoTelepresenceComplianceR05 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 1, 6)).setObjects(("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpConfigurationGroupR02"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralStatusGroupR02"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpEventHistoryGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpNotificationGroupR01"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpDPPeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpRS232PeripheralStatusGroup"), ("CISCO-TELEPRESENCE-MIB", "ciscoTpPeripheralAttributeGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTelepresenceComplianceR05 = ciscoTelepresenceComplianceR05.setStatus('current')
if mibBuilder.loadTexts: ciscoTelepresenceComplianceR05.setDescription('The compliance statement for entities which implement the Cisco Telepresence MIB.')
ciscoTpConfigurationGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 1)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorNotifyEnable"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailNotifyEnable"), ("CISCO-TELEPRESENCE-MIB", "ctpSystemReset"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpConfigurationGroup = ciscoTpConfigurationGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTpConfigurationGroup.setDescription('A collection of objects providing the notification configuration and system reset. ciscoTpConfigurationGroup object is superseded by ciscoTpConfigurationGroupR01.')
ciscoTpPeripheralStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 2)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDescription"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralIfIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralAddr"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralCableStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralPowerStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpDVIPeripheralCableStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpPeripheralStatusGroup = ciscoTpPeripheralStatusGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTpPeripheralStatusGroup.setDescription('A collection of objects providing the Telepresence peripheral information. ciscoTpPeripheralStatusGroup object is superseded by ciscoTpPeripheralStatusGroupR01.')
ciscoTpEventHistoryGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 3)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorHistTableSize"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorHistLastIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorTimeStamp"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailHistTableSize"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailHistLastIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourceAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourceAddr"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourcePort"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailUserName"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailAccessProtocol"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailTimeStamp"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpEventHistoryGroup = ciscoTpEventHistoryGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTpEventHistoryGroup.setDescription('A collection of managed objects providing notification event history information. ciscoTpEventHistoryGroup object is superseded by ciscoTpEventHistoryGroupR01.')
ciscoTpNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 4)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorNotification"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailNotification"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpNotificationGroup = ciscoTpNotificationGroup.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTpNotificationGroup.setDescription('A collection of Telepresence system notifications. ciscoTpNotificationGroup object is superseded by ciscoTpNotificationGroupR01.')
ciscoTpRS232PeripheralStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 5)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpRS232PortIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpRS232PeripheralConnStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpRS232PeripheralStatusGroup = ciscoTpRS232PeripheralStatusGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoTpRS232PeripheralStatusGroup.setDescription('A collection of objects providing the information about Telepresence peripheral which is connected via RS232.')
ciscoTpPeripheralAttributeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 6)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralAttributeDescr"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralAttributeValue"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpPeripheralAttributeGroup = ciscoTpPeripheralAttributeGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoTpPeripheralAttributeGroup.setDescription('A collection of managed objects providing peripheral attribute information.')
ciscoTpPeripheralStatusGroupR01 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 7)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDescription"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDeviceCategory"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDeviceNumber"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralIfIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralAddr"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralCableStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralPowerStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpDVIPeripheralCableStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpPeripheralStatusGroupR01 = ciscoTpPeripheralStatusGroupR01.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTpPeripheralStatusGroupR01.setDescription('A collection of objects providing the Telepresence peripheral information. ciscoTpPeripheralStatusGroupR01 object is superseded by ciscoTpPeripheralStatusGroupR02.')
ciscoTpEventHistoryGroupR01 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 8)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorHistTableSize"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorHistLastIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorTimeStamp"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorDeviceCategory"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralErrorDeviceNumber"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailHistTableSize"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailHistLastIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourceAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourceAddr"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailSourcePort"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailUserName"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailAccessProtocol"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailTimeStamp"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpEventHistoryGroupR01 = ciscoTpEventHistoryGroupR01.setStatus('current')
if mibBuilder.loadTexts: ciscoTpEventHistoryGroupR01.setDescription('A collection of managed objects providing notification event history information.')
ciscoTpNotificationGroupR01 = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 9)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeriStatusChangeNotification"), ("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailNotification"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpNotificationGroupR01 = ciscoTpNotificationGroupR01.setStatus('current')
if mibBuilder.loadTexts: ciscoTpNotificationGroupR01.setDescription('A collection of Telepresence system notifications.')
ciscoTpConfigurationGroupR01 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 10)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpSysUserAuthFailNotifyEnable"), ("CISCO-TELEPRESENCE-MIB", "ctpSystemReset"), ("CISCO-TELEPRESENCE-MIB", "ctpPeriStatusChangeNotifyEnable"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpConfigurationGroupR01 = ciscoTpConfigurationGroupR01.setStatus('current')
if mibBuilder.loadTexts: ciscoTpConfigurationGroupR01.setDescription('A collection of objects providing the notification configuration and system reset.')
ciscoTpPeripheralStatusGroupR02 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 11)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDescription"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDeviceCategory"), ("CISCO-TELEPRESENCE-MIB", "ctpPeripheralDeviceNumber"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralIfIndex"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralAddr"), ("CISCO-TELEPRESENCE-MIB", "ctpEtherPeripheralStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralCableStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpHDMIPeripheralPowerStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpDVIPeripheralCableStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpUSBPeripheralCableStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpUSBPeripheralPowerStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpUSBPeripheralPortType"), ("CISCO-TELEPRESENCE-MIB", "ctpUSBPeripheralPortRate"), ("CISCO-TELEPRESENCE-MIB", "ctp802dot11PeripheralIfIndex"), ("CISCO-TELEPRESENCE-MIB", "ctp802dot11PeripheralAddrType"), ("CISCO-TELEPRESENCE-MIB", "ctp802dot11PeripheralAddr"), ("CISCO-TELEPRESENCE-MIB", "ctp802dot11PeripheralLinkStrength"), ("CISCO-TELEPRESENCE-MIB", "ctp802dot11PeripheralLinkStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpPeripheralStatusGroupR02 = ciscoTpPeripheralStatusGroupR02.setStatus('current')
if mibBuilder.loadTexts: ciscoTpPeripheralStatusGroupR02.setDescription('A collection of objects providing the Telepresence peripheral information.')
ciscoTpConfigurationGroupR02 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 12)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpVlanId"), ("CISCO-TELEPRESENCE-MIB", "ctpDefaultGateway"), ("CISCO-TELEPRESENCE-MIB", "ctpDefaultGatewayAddrType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpConfigurationGroupR02 = ciscoTpConfigurationGroupR02.setStatus('current')
if mibBuilder.loadTexts: ciscoTpConfigurationGroupR02.setDescription('A collection of objects providing network configurations.')
ciscoTpDPPeripheralStatusGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 643, 2, 2, 13)).setObjects(("CISCO-TELEPRESENCE-MIB", "ctpDPPeripheralCableStatus"), ("CISCO-TELEPRESENCE-MIB", "ctpDPPeripheralPowerStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTpDPPeripheralStatusGroup = ciscoTpDPPeripheralStatusGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoTpDPPeripheralStatusGroup.setDescription('A collection of objects providing the information about Telepresence peripheral which is connected via Display Port.')
mibBuilder.exportSymbols("CISCO-TELEPRESENCE-MIB", ciscoTpRS232PeripheralStatusGroup=ciscoTpRS232PeripheralStatusGroup, ctpSystemReset=ctpSystemReset, CtpPeripheralCableCode=CtpPeripheralCableCode, CtpSystemResetMode=CtpSystemResetMode, ctpDPPeripheralCableStatus=ctpDPPeripheralCableStatus, ctpDPPeripheralPowerStatus=ctpDPPeripheralPowerStatus, ctpPeriStatusChangeNotification=ctpPeriStatusChangeNotification, ctpRS232PeripheralIndex=ctpRS232PeripheralIndex, ctpDPPeripheralStatusTable=ctpDPPeripheralStatusTable, ctpPeripheralIndex=ctpPeripheralIndex, ctpPeripheralErrorNotifyEnable=ctpPeripheralErrorNotifyEnable, ciscoTelepresenceMIBGroups=ciscoTelepresenceMIBGroups, ctpPeripheralErrorIndex=ctpPeripheralErrorIndex, ctpRS232PeripheralStatusTable=ctpRS232PeripheralStatusTable, ctpUSBPeripheralPortRate=ctpUSBPeripheralPortRate, ctpPeripheralErrorNotification=ctpPeripheralErrorNotification, ctpDVIPeripheralCableStatus=ctpDVIPeripheralCableStatus, ctpPeripheralStatusTable=ctpPeripheralStatusTable, ctp802dot11PeripheralIfIndex=ctp802dot11PeripheralIfIndex, ctp802dot11PeripheralLinkStrength=ctp802dot11PeripheralLinkStrength, ctpPeripheralStatusObjects=ctpPeripheralStatusObjects, ctpHDMIPeripheralCableStatus=ctpHDMIPeripheralCableStatus, ctpHDMIPeripheralStatusEntry=ctpHDMIPeripheralStatusEntry, ctpHDMIPeripheralStatusTable=ctpHDMIPeripheralStatusTable, ctpPeripheralAttributeTable=ctpPeripheralAttributeTable, ctpSysUserAuthFailHistoryEntry=ctpSysUserAuthFailHistoryEntry, ciscoTpPeripheralAttributeGroup=ciscoTpPeripheralAttributeGroup, ctpEtherPeripheralIfIndex=ctpEtherPeripheralIfIndex, ctpPeripheralErrorDeviceNumber=ctpPeripheralErrorDeviceNumber, ctpEtherPeripheralStatusTable=ctpEtherPeripheralStatusTable, ctpUSBPeripheralPortType=ctpUSBPeripheralPortType, ciscoTelepresenceComplianceR02=ciscoTelepresenceComplianceR02, ctpRS232PeripheralConnStatus=ctpRS232PeripheralConnStatus, ctpSysUserAuthFailNotification=ctpSysUserAuthFailNotification, ctpUSBPeripheralStatusTable=ctpUSBPeripheralStatusTable, ctpPeripheralStatusEntry=ctpPeripheralStatusEntry, ciscoTelepresenceCompliances=ciscoTelepresenceCompliances, ctpPeripheralAttributeValue=ctpPeripheralAttributeValue, ctpDPPeripheralIndex=ctpDPPeripheralIndex, ctpUSBPeripheralStatusEntry=ctpUSBPeripheralStatusEntry, ctpDefaultGateway=ctpDefaultGateway, ctp802dot11PeripheralStatusTable=ctp802dot11PeripheralStatusTable, ctpEtherPeripheralStatusEntry=ctpEtherPeripheralStatusEntry, ctpSysUserAuthFailHistoryIndex=ctpSysUserAuthFailHistoryIndex, ciscoTpNotificationGroup=ciscoTpNotificationGroup, ctpPeripheralAttributeEntry=ctpPeripheralAttributeEntry, ctpRS232PeripheralStatusEntry=ctpRS232PeripheralStatusEntry, ctpPeripheralErrorDeviceCategory=ctpPeripheralErrorDeviceCategory, ctpSysUserAuthFailNotifyEnable=ctpSysUserAuthFailNotifyEnable, ciscoTpDPPeripheralStatusGroup=ciscoTpDPPeripheralStatusGroup, ctpSysUserAuthFailAccessProtocol=ctpSysUserAuthFailAccessProtocol, ctpDefaultGatewayAddrType=ctpDefaultGatewayAddrType, ciscoTelepresenceComplianceR01=ciscoTelepresenceComplianceR01, ctpEventHistory=ctpEventHistory, ctpDVIPeripheralStatusEntry=ctpDVIPeripheralStatusEntry, ctpSysUserAuthFailTimeStamp=ctpSysUserAuthFailTimeStamp, ciscoTelepresenceCompliance=ciscoTelepresenceCompliance, ctp802dot11PeripheralLinkStatus=ctp802dot11PeripheralLinkStatus, ciscoTpConfigurationGroupR01=ciscoTpConfigurationGroupR01, ciscoTpPeripheralStatusGroup=ciscoTpPeripheralStatusGroup, ctpPeripheralAttributeIndex=ctpPeripheralAttributeIndex, ciscoTelepresenceMIB=ciscoTelepresenceMIB, ctpDVIPeripheralIndex=ctpDVIPeripheralIndex, ctpEtherPeripheralIndex=ctpEtherPeripheralIndex, ctpHDMIPeripheralPowerStatus=ctpHDMIPeripheralPowerStatus, ctpPeripheralErrorHistoryEntry=ctpPeripheralErrorHistoryEntry, ctpSysUserAuthFailHistoryTable=ctpSysUserAuthFailHistoryTable, ctpRS232PortIndex=ctpRS232PortIndex, ctpSysUserAuthFailHistTableSize=ctpSysUserAuthFailHistTableSize, ctpVlanId=ctpVlanId, ctpPeripheralStatus=ctpPeripheralStatus, ciscoTelepresenceComplianceR05=ciscoTelepresenceComplianceR05, ciscoTelepresenceComplianceR04=ciscoTelepresenceComplianceR04, ctpUSBPeripheralIndex=ctpUSBPeripheralIndex, ciscoTpConfigurationGroupR02=ciscoTpConfigurationGroupR02, ciscoTelepresenceMIBNotifs=ciscoTelepresenceMIBNotifs, ctpDVIPeripheralStatusTable=ctpDVIPeripheralStatusTable, ctpPeripheralErrorHistoryTable=ctpPeripheralErrorHistoryTable, ctpPeripheralErrorStatus=ctpPeripheralErrorStatus, ciscoTpEventHistoryGroupR01=ciscoTpEventHistoryGroupR01, ctpPeripheralErrorHistTableSize=ctpPeripheralErrorHistTableSize, CtpPeripheralStatusCode=CtpPeripheralStatusCode, ctpEtherPeripheralStatus=ctpEtherPeripheralStatus, ciscoTpNotificationGroupR01=ciscoTpNotificationGroupR01, CtpPeripheralDeviceCategoryCode=CtpPeripheralDeviceCategoryCode, ciscoTpPeripheralStatusGroupR01=ciscoTpPeripheralStatusGroupR01, CtpSystemAccessProtocol=CtpSystemAccessProtocol, ctpSysUserAuthFailSourceAddrType=ctpSysUserAuthFailSourceAddrType, ctpObjects=ctpObjects, ctpPeripheralDeviceCategory=ctpPeripheralDeviceCategory, ctpPeripheralErrorHistoryIndex=ctpPeripheralErrorHistoryIndex, ctpPeripheralErrorTimeStamp=ctpPeripheralErrorTimeStamp, ctpSysUserAuthFailSourceAddr=ctpSysUserAuthFailSourceAddr, ctpUSBPeripheralCableStatus=ctpUSBPeripheralCableStatus, ctp802dot11PeripheralIndex=ctp802dot11PeripheralIndex, ctpHDMIPeripheralIndex=ctpHDMIPeripheralIndex, ciscoTpEventHistoryGroup=ciscoTpEventHistoryGroup, ctpPeripheralDeviceNumber=ctpPeripheralDeviceNumber, ciscoTpPeripheralStatusGroupR02=ciscoTpPeripheralStatusGroupR02, ciscoTpConfigurationGroup=ciscoTpConfigurationGroup, ctpPeriStatusChangeNotifyEnable=ctpPeriStatusChangeNotifyEnable, PYSNMP_MODULE_ID=ciscoTelepresenceMIB, ctpSysUserAuthFailHistLastIndex=ctpSysUserAuthFailHistLastIndex, ciscoTelepresenceComplianceR03=ciscoTelepresenceComplianceR03, ctp802dot11PeripheralStatusEntry=ctp802dot11PeripheralStatusEntry, ctpUSBPeripheralPowerStatus=ctpUSBPeripheralPowerStatus, ciscoTelepresenceMIBConform=ciscoTelepresenceMIBConform, ciscoTelepresenceMIBObjects=ciscoTelepresenceMIBObjects, ctpSysUserAuthFailSourcePort=ctpSysUserAuthFailSourcePort, ctp802dot11PeripheralAddrType=ctp802dot11PeripheralAddrType, CtpPeripheralPowerCode=CtpPeripheralPowerCode, ctpEtherPeripheralAddrType=ctpEtherPeripheralAddrType, ctpPeripheralErrorHistLastIndex=ctpPeripheralErrorHistLastIndex, ctpDPPeripheralStatusEntry=ctpDPPeripheralStatusEntry, ctpSysUserAuthFailUserName=ctpSysUserAuthFailUserName, ctpEtherPeripheralAddr=ctpEtherPeripheralAddr, ctpPeripheralDescription=ctpPeripheralDescription, ctp802dot11PeripheralAddr=ctp802dot11PeripheralAddr, ctpPeripheralAttributeDescr=ctpPeripheralAttributeDescr)
| 175.017241 | 6,685 | 0.800625 | 7,551 | 71,057 | 7.533837 | 0.090319 | 0.040501 | 0.070876 | 0.008438 | 0.507805 | 0.406852 | 0.365894 | 0.343394 | 0.302841 | 0.292083 | 0 | 0.047175 | 0.09042 | 71,057 | 405 | 6,686 | 175.449383 | 0.833008 | 0.004757 | 0 | 0.072727 | 0 | 0.122078 | 0.432089 | 0.12984 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.025974 | 0 | 0.103896 | 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 |
bd87e5118853b7af46b50bc79022e6b55f8e9618 | 70 | py | Python | clash-of-code/reverse/number_pyramid.py | jonasnic/codingame | f1a7fe8007b9ca63bdf30cd72f4d6ac41a5ac721 | [
"MIT"
] | 30 | 2016-04-30T01:56:05.000Z | 2022-03-09T22:19:12.000Z | clash-of-code/reverse/number_pyramid.py | jonasnic/codingame | f1a7fe8007b9ca63bdf30cd72f4d6ac41a5ac721 | [
"MIT"
] | 1 | 2021-05-19T19:36:45.000Z | 2021-05-19T19:36:45.000Z | clash-of-code/reverse/number_pyramid.py | jonasnic/codingame | f1a7fe8007b9ca63bdf30cd72f4d6ac41a5ac721 | [
"MIT"
] | 17 | 2020-01-28T13:54:06.000Z | 2022-03-26T09:49:27.000Z | n = int(input())
for i in range(0, n):
print(str(n) * (i + 1))
| 17.5 | 28 | 0.471429 | 14 | 70 | 2.357143 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0.285714 | 70 | 3 | 29 | 23.333333 | 0.62 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bd990d0abd0390853c206f72899814a8ffeeb6c6 | 2,357 | py | Python | augment_features.py | Ads2020Group6/gender-pay-gap-modelling | 9c6ffbc022ab0dffd7ac9dcaeafb511da21121fe | [
"MIT"
] | null | null | null | augment_features.py | Ads2020Group6/gender-pay-gap-modelling | 9c6ffbc022ab0dffd7ac9dcaeafb511da21121fe | [
"MIT"
] | null | null | null | augment_features.py | Ads2020Group6/gender-pay-gap-modelling | 9c6ffbc022ab0dffd7ac9dcaeafb511da21121fe | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
def augment(data):
data['MalePercent'] = (data['MaleLowerQuartile'] +
data['MaleLowerMiddleQuartile'] + data['MaleUpperMiddleQuartile'] +
data['MaleTopQuartile']) * .25
data['FemalePercent'] = (data['FemaleLowerQuartile'] + data['FemaleLowerMiddleQuartile'] +
data['FemaleUpperMiddleQuartile'] + data['FemaleTopQuartile']
) * .25
data['WorkforceGenderSkew'] = data['MalePercent'] - data['FemalePercent']
data['PercMaleWorkforceInTopQuartile'] = data['MaleTopQuartile'] / data['MalePercent'] * .25
data['PercMaleWorkforceInUpperMiddleQuartile'] = data['MaleUpperMiddleQuartile'] / data['MalePercent'] * .25
data['PercMaleWorkforceInLowerMiddleQuartile'] = data['MaleLowerMiddleQuartile'] / data['MalePercent'] * .25
data['PercMaleWorkforceInLowerQuartile'] = data['MaleLowerQuartile'] / data['MalePercent'] * .25
data['PercFemaleWorkforceInTopQuartile'] = data['FemaleTopQuartile'] / data['FemalePercent'] * .25
data['PercFemaleWorkforceInUpperMiddleQuartile'] = data['FemaleUpperMiddleQuartile'] / data['FemalePercent'] * .25
data['PercFemaleWorkforceInLowerMiddleQuartile'] = data['FemaleLowerMiddleQuartile'] / data['FemalePercent'] * .25
data['PercFemaleWorkforceInLowerQuartile'] = data['FemaleLowerQuartile'] / data['FemalePercent'] * .25
data['RepresentationInTopQuartileSkew'] = data['PercMaleWorkforceInTopQuartile'] - data[
'PercFemaleWorkforceInTopQuartile']
data['RepresentationInUpperMiddleQuartileSkew'] = data['PercMaleWorkforceInUpperMiddleQuartile'] - data[
'PercFemaleWorkforceInUpperMiddleQuartile']
data['RepresentationInLowerMiddleQuartileSkew'] = data['PercMaleWorkforceInLowerMiddleQuartile'] - data[
'PercFemaleWorkforceInLowerMiddleQuartile']
data['RepresentationInLowerQuartileSkew'] = data['PercMaleWorkforceInLowerQuartile'] - data[
'PercFemaleWorkforceInLowerQuartile']
data['BonusGenderSkew'] = data['MaleBonusPercent'] - data['FemaleBonusPercent']
return data
def main():
df = pd.read_csv('data/ukgov-gpg-full-section-split.csv')
df = augment(df)
df.to_csv('data/ukgov-gpg-all-clean-with-features.csv', index=False)
if __name__ == "__main__":
main()
| 52.377778 | 118 | 0.708104 | 160 | 2,357 | 10.36875 | 0.34375 | 0.036166 | 0.040989 | 0.050633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010106 | 0.160373 | 2,357 | 44 | 119 | 53.568182 | 0.828196 | 0 | 0 | 0 | 0 | 0 | 0.567247 | 0.416207 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0.058824 | 0 | 0.147059 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bda07f1bfa8b9f9ad5ee2e11e116aecbb8270292 | 1,062 | py | Python | apps/user/views.py | AlexFire-Dev/OnlineChat | 2411baffeee2abd90931e66e736081b23411082b | [
"MIT"
] | null | null | null | apps/user/views.py | AlexFire-Dev/OnlineChat | 2411baffeee2abd90931e66e736081b23411082b | [
"MIT"
] | null | null | null | apps/user/views.py | AlexFire-Dev/OnlineChat | 2411baffeee2abd90931e66e736081b23411082b | [
"MIT"
] | null | null | null | import json
import channels.layers
from asgiref.sync import async_to_sync
from django.conf import settings
from django.core.paginator import Paginator
from django.http import HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.urls import reverse, reverse_lazy
from django.views.generic import TemplateView, CreateView, UpdateView, RedirectView
from .models import *
from .forms import *
def AccountView(request):
context = {
'accountuser': request.user,
}
return render(request, 'user/profile.html', context=context)
class ProfileChangeView(UpdateView):
form_class = ProfileChangeForm
template_name = 'user/profile-change.html'
def get_object(self, queryset=None):
return self.request.user
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context.update({
'accountuser': self.request.user,
})
return context
def get_success_url(self):
url = reverse('profile')
return url
| 24.697674 | 83 | 0.719397 | 126 | 1,062 | 5.944444 | 0.460317 | 0.080107 | 0.045394 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003517 | 0.196798 | 1,062 | 42 | 84 | 25.285714 | 0.87456 | 0 | 0 | 0 | 0 | 0 | 0.065913 | 0.022599 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0 | 0.366667 | 0.033333 | 0.733333 | 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 |
bda1edb67c862833c2ca17bb17ea3e65c2c9e56c | 170 | py | Python | Foundation/magic_method/del_method.py | youaresherlock/PythonPractice | 2e22d3fdcb26353cb0d8215c150e84d11bc9a022 | [
"Apache-2.0"
] | null | null | null | Foundation/magic_method/del_method.py | youaresherlock/PythonPractice | 2e22d3fdcb26353cb0d8215c150e84d11bc9a022 | [
"Apache-2.0"
] | null | null | null | Foundation/magic_method/del_method.py | youaresherlock/PythonPractice | 2e22d3fdcb26353cb0d8215c150e84d11bc9a022 | [
"Apache-2.0"
] | 1 | 2019-11-05T01:10:15.000Z | 2019-11-05T01:10:15.000Z | #!usr/bin/python
# -*- coding:utf8 -*-
"""
__del__:析构方法, 当对象在内存中被释放时,自动触发此方法
"""
class Foo:
def __del__(self):
print("__del__")
obj = Foo() # 程序结束自动会被回收
| 12.142857 | 33 | 0.594118 | 19 | 170 | 4.684211 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007463 | 0.211765 | 170 | 13 | 34 | 13.076923 | 0.656716 | 0.470588 | 0 | 0 | 0 | 0 | 0.0875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0.25 | 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 |
bdaaab0b38435da46661a7869ffacac2fe1a2fba | 1,706 | py | Python | django/views/defaults.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | django/views/defaults.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | django/views/defaults.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | from django import http
from django.views.decorators.csrf import requires_csrf_token
from django.template import Context, RequestContext, loader
# This can be called when CsrfViewMiddleware.process_view has not run, therefore
# need @requires_csrf_token in case the template needs {% csrf_token %}.
@requires_csrf_token
def page_not_found(request, template_name='404.html'):
"""
Default 404 handler.
Templates: `404.html`
Context:
request_path
The path of the requested URL (e.g., '/app/pages/bad_page/')
"""
t = loader.get_template(template_name) # You need to create a 404.html template.
return http.HttpResponseNotFound(t.render(RequestContext(request, {'request_path': request.path})))
@requires_csrf_token
def server_error(request, template_name='500.html'):
"""
500 error handler.
Templates: `500.html`
Context: None
"""
t = loader.get_template(template_name) # You need to create a 500.html template.
return http.HttpResponseServerError(t.render(Context({})))
def shortcut(request, content_type_id, object_id):
# TODO: Remove this in Django 2.0.
# This is a legacy view that depends on the contenttypes framework.
# The core logic was moved to django.contrib.contenttypes.views after
# Django 1.0, but this remains here for backwards compatibility.
# Note that the import is *within* this function, rather than being at
# module level, because we don't want to assume people have contenttypes
# installed.
from django.contrib.contenttypes.views import shortcut as real_shortcut
return real_shortcut(request, content_type_id, object_id)
| 38.772727 | 104 | 0.716882 | 231 | 1,706 | 5.164502 | 0.480519 | 0.03772 | 0.056999 | 0.033529 | 0.137469 | 0.137469 | 0.137469 | 0.077117 | 0.077117 | 0.077117 | 0 | 0.020498 | 0.199297 | 1,706 | 43 | 105 | 39.674419 | 0.852855 | 0.47245 | 0 | 0.285714 | 0 | 0 | 0.035354 | 0 | 0 | 0 | 0 | 0.023256 | 0 | 1 | 0.214286 | false | 0 | 0.285714 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bdaf20850eee3665959dc54f480d2cf615d57be3 | 5,654 | py | Python | grail/app.py | farwydi/animated-octo-robot | 37fa5ad25152dd1de2a87c6e62c6ce0e7588955d | [
"MIT"
] | null | null | null | grail/app.py | farwydi/animated-octo-robot | 37fa5ad25152dd1de2a87c6e62c6ce0e7588955d | [
"MIT"
] | null | null | null | grail/app.py | farwydi/animated-octo-robot | 37fa5ad25152dd1de2a87c6e62c6ce0e7588955d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import wx
from grail import Grail
from pages import LoginPage, MainFrame
from protocol import GrailProtocol
class MainFrameLogic(MainFrame):
def __init__(self, login, password):
super().__init__(None)
# self.m_notebook1.SetBackgroundColour(wx.NullColour)
self.grail = Grail()
self.grail.open(login, password)
self._change_counter = 0
self._push_counter = 0
self.grail_text_ctrl.SetLabelText(self.grail.get())
self.commit_btn.Disable()
self.push_btn.Disable()
self.data_list.InsertColumn(0, 'ID')
self.data_list.InsertColumn(1, 'Hash', width=300)
self.push_row(self.grail.get_header_hash())
for chain in self.grail.get_hash_list():
self.push_row(chain)
self.grail_text_ctrl.SetValue(self.grail.get())
self._selected = 0
try:
self.diff_text.SetLabel(self.grail.get_diff(self._selected))
except ValueError:
pass
def grail_update(self, e):
diff = e.GetString()
self._change_counter = 0
match = len(self.grail.get()) >= len(diff)
max_diff = self.grail.get() if match else diff
watch_diff = diff if match else self.grail.get()
for i, litter in enumerate(max_diff):
try:
if watch_diff[i] != litter:
self._change_counter += 1
except IndexError:
self._change_counter += 1
if self._change_counter > 0:
self.commit_btn.Enable()
else:
self.commit_btn.Disable()
self.commit_btn.SetLabelText(f"Commit ({self._change_counter})")
def selected(self, event):
self._selected = int(self.data_list.GetItemText(event.Index))
self.grail_text_ctrl.SetValue(self.grail.get(self._selected + 1))
self.diff_text.SetLabel(self.grail.get_diff(self._selected))
def commit(self, event):
self.grail.update(self.grail_text_ctrl.GetValue())
<<<<<<< Updated upstream
chain = self.grail.get_last_hash()
id = self.push_row(chain)
=======
chain = self.grail.get_last_hash()
id = self.push_row(chain)
>>>>>>> Stashed changes
self.status_bar.SetStatusText(f'Запись #{id} добавлена, ожидается подтверждение клиентом.')
self.commit_btn.Disable()
self.commit_btn.SetLabelText("Commit (0)")
self._push_counter += 1
self.push_btn.Enable()
self.push_btn.SetLabelText(f"Push ({self._push_counter})")
def push(self, event):
self.grail.save()
self._push_counter = 0
self.push_btn.Disable()
self.push_btn.SetLabelText("Push (0)")
def push_row(self, item):
index = self.data_list.GetItemCount()
index = self.data_list.InsertItem(self.data_list.GetItemCount(), str(index))
self.data_list.SetItem(index, 1, item.hex())
return index
class LoginPageLogic(LoginPage):
M_LABEL_NEW = u"Регистрация в сети"
M_LABEL_LOGIN = u"Авторизация"
M_LABEL_UNLOCK = u"Для расшифровки введите пароль:"
M_BTN_REG = u"Регистрация"
M_BTN_UNLOCK = u"Расшифровать"
M_BTN_REG_PROC = u"Запрос принят..."
M_ERROR_FIELD = u"Не все поля заполнены"
M_ERROR_REG = u"Вы не зарегистрированы"
M_ERROR_PWD = u"Не верный пароль"
def __init__(self):
super().__init__(None)
self.page = None
self.page_login()
self.__protocol = GrailProtocol()
def on_reg(self, event):
if self.page == 1:
# PAGE CREATE
self.page_login()
self.reg_btn.SetLabelText(self.M_BTN_REG)
pass
elif self.page == 2:
# PAGE LOGIN
self.page_create()
self.reg_btn.SetLabelText(self.M_LABEL_LOGIN)
def on_unlock(self, event):
self.status_bar.SetStatusText(wx.EmptyString)
if self.page == 1:
# PAGE CREATE
password = self.password_field.GetValue()
login = self.login_field.GetValue()
if len(password) == 0 or len(login) == 0:
self.status_bar.SetStatusText(self.M_ERROR_FIELD)
else:
form = MainFrameLogic(login, password)
form.Show()
self.Close()
elif self.page == 2:
# PAGE LOGIN
login = self.login_field.GetValue()
password = self.password_field.GetValue()
if len(password) == 0 and len(login) == 0:
self.status_bar.SetStatusText(self.M_ERROR_FIELD)
else:
if not self.__protocol.check(login, password):
self.status_bar.SetStatusText(self.M_ERROR_PWD)
else:
form = MainFrameLogic(login, password)
form.Show()
self.Close()
def passwd_no_eq(self):
pass
# self.m_staticText3.SetLabel(u"Неверный пароль")
def page_create(self):
self.page = 1
self.title_text.SetLabelText(self.M_LABEL_NEW)
self.lock_btn.SetLabelText(self.M_BTN_REG)
self.login_field.Enable()
self.password_field.Enable()
self.Layout()
def page_login(self):
self.page = 2
self.title_text.SetLabelText(self.M_LABEL_LOGIN)
self.lock_btn.SetLabelText(self.M_BTN_UNLOCK)
self.login_field.Enable()
self.password_field.Enable()
self.Layout()
if __name__ == "__main__":
app = wx.App()
wnd = LoginPageLogic()
wnd.Show()
app.MainLoop()
| 27.580488 | 99 | 0.600814 | 688 | 5,654 | 4.693314 | 0.222384 | 0.055745 | 0.044596 | 0.04026 | 0.406008 | 0.326727 | 0.263859 | 0.21183 | 0.183958 | 0.152989 | 0 | 0.007719 | 0.289706 | 5,654 | 204 | 100 | 27.715686 | 0.796315 | 0 | 0 | 0.376812 | 0 | 0 | 0.055667 | 0.008396 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.108696 | 0.028986 | 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 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
bdc6a21df96948967bd912d69f2b58d22c52640e | 6,647 | bzl | Python | xunit/repo.bzl | tomaszstrejczek/rules_dotnet_3rd_party | 09f29f062d5250fe7cdc45be872ce9bd1562c60b | [
"Apache-2.0"
] | 1 | 2021-10-10T17:17:27.000Z | 2021-10-10T17:17:27.000Z | xunit/repo.bzl | tomaszstrejczek/rules_dotnet_3rd_party | 09f29f062d5250fe7cdc45be872ce9bd1562c60b | [
"Apache-2.0"
] | null | null | null | xunit/repo.bzl | tomaszstrejczek/rules_dotnet_3rd_party | 09f29f062d5250fe7cdc45be872ce9bd1562c60b | [
"Apache-2.0"
] | null | null | null | load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library", "core_resource")
filegroup(
name = "core_common",
srcs = [
":src/common/ExceptionExtensions.cs",
":src/common/Guard.cs",
":src/common/TestMethodDisplay.cs",
":src/common/TestMethodDisplayOptions.cs",
] + ["@xunit_assert//:common_files"],
)
core_resource(
name = "xunit_core_resource",
src = "src/xunit.core/Resources/xunit.core.rd.xml",
identifier = "Xunit.Resources.xunit.core.rd.xml",
)
core_library(
name = "xunit.core.dll",
srcs = [":core_common"] + glob(["src/xunit.core/**/*.cs"]),
data = [
":src/xunit.core/xunit.core.dll.tdnet",
],
defines = [
"XUNIT_FRAMEWORK",
],
resources = [":xunit_core_resource"],
visibility = ["//visibility:public"],
deps = [
"@core_sdk_stdlib//:libraryset",
"@xunit_abstractions//:abstractions.xunit.dll",
],
)
filegroup(
name = "execution_common",
srcs = [
":src/common/AssemblyExtensions.cs",
":src/common/CommonTasks.cs",
":src/common/DictionaryExtensions.cs",
":src/common/ExceptionExtensions.cs",
":src/common/ExceptionUtility.cs",
":src/common/ExecutionHelper.cs",
":src/common/Guard.cs",
":src/common/LongLivedMarshalByRefObject.cs",
":src/common/NewReflectionExtensions.cs",
":src/common/NullMessageSink.cs",
":src/common/SerializationHelper.cs",
":src/common/SourceInformation.cs",
":src/common/TestOptionsNames.cs",
":src/common/XunitSerializationInfo.cs",
":src/common/XunitWorkerThread.cs",
] + glob(["src/messages/**/*.cs"]) + ["@xunit_assert//:common_files"],
)
core_library(
name = "xunit.execution.dll",
srcs = [":execution_common"] + glob(["src/xunit.execution/**/*.cs"]),
defines = [
"XUNIT_FRAMEWORK",
"NETSTANDARD",
],
visibility = ["//visibility:public"],
deps = [
":xunit.core.dll",
"@core_sdk_stdlib//:libraryset",
],
)
filegroup(
name = "runner_utility_common",
srcs = [
":src/common/AssemblyExtensions.cs",
":src/common/CommonTasks.cs",
":src/common/ConcurrentDictionary.cs",
":src/common/ConsoleHelper.cs",
":src/common/DictionaryExtensions.cs",
":src/common/ExceptionExtensions.cs",
":src/common/ExceptionUtility.cs",
":src/common/Guard.cs",
":src/common/Json.cs",
":src/common/LongLivedMarshalByRefObject.cs",
":src/common/NewReflectionExtensions.cs",
":src/common/NullMessageSink.cs",
":src/common/SerializationHelper.cs",
":src/common/SourceInformation.cs",
":src/common/TestMethodDisplay.cs",
":src/common/TestMethodDisplayOptions.cs",
":src/common/TestOptionsNames.cs",
":src/common/XunitSerializationInfo.cs",
":src/common/XunitWorkerThread.cs",
":src/common/AssemblyResolution/AssemblyHelper_Desktop.cs",
":src/common/AssemblyResolution/_DiagnosticMessage.cs",
] + glob(["src/messages/**/*.cs"]),
)
core_library(
name = "xunit.runner.utility.dll",
srcs = [":runner_utility_common"] + glob(["src/xunit.runner.utility/**/*.cs"]),
defines = [
"NETSTANDARD2_0",
"NETSTANDARD",
"NETCOREAPP",
],
visibility = ["//visibility:public"],
deps = [
"@core_sdk_stdlib//:libraryset",
"@xunit_abstractions//:abstractions.xunit.dll",
],
)
filegroup(
name = "runner_reporters_common",
srcs = [
":src/common/Json.cs",
":src/common/XunitWorkerThread.cs",
],
)
core_library(
name = "xunit.runner.reporters.dll",
srcs = [":runner_reporters_common"] + glob(["src/xunit.runner.reporters/**/*.cs"]),
defines = [
"NETSTANDARD2_0",
"NETSTANDARD",
],
visibility = ["//visibility:public"],
deps = [
":xunit.runner.utility.dll",
"@core_sdk_stdlib//:libraryset",
"@xunit_abstractions//:abstractions.xunit.dll",
],
)
filegroup(
name = "console_common",
srcs = [
":src/common/AssemblyExtensions.cs",
":src/common/ConsoleHelper.cs",
":src/common/DictionaryExtensions.cs",
":src/common/Guard.cs",
":src/common/Json.cs",
] + glob(["src/common/AssemblyResolution/**/*.cs"]),
)
core_resource(
name = "HTML_xslt",
src = "src/xunit.console/HTML.xslt",
identifier = "Xunit.ConsoleClient.HTML.xslt",
)
core_resource(
name = "NUnitXml_xslt",
src = "src/xunit.console/NUnitXml.xslt",
identifier = "Xunit.ConsoleClient.NUnitXml.xslt",
)
core_resource(
name = "xUnit1_xslt",
src = "src/xunit.console/xUnit1.xslt",
identifier = "Xunit.ConsoleClient.xUnit1.xslt",
)
core_resource(
name = "JUnitXml_xslt",
src = "src/xunit.console/JUnitXml.xslt",
identifier = "Xunit.ConsoleClient.JUnitXml.xslt",
)
core_library(
name = "xunit.console.dll",
srcs = [":console_common"] + glob(["src/xunit.console/**/*.cs"]),
defines = [
"NETSTANDARD2_0",
"NETSTANDARD",
"NETCOREAPP",
"NETCOREAPP2_0",
],
resources = [
":HTML_xslt",
":JUnitXml_xslt",
":NUnitXml_xslt",
":xUnit1_xslt",
],
unsafe = True,
visibility = ["//visibility:public"],
deps = [
":xunit.runner.reporters.dll",
],
)
filegroup(
name = "test_utility_common",
srcs = [
":src/common/AssemblyExtensions.cs",
":src/common/DictionaryExtensions.cs",
":src/common/ExceptionExtensions.cs",
":src/common/ExecutionHelper.cs",
":src/common/TestOptionsNames.cs",
],
)
# core_library(
# name = "xunit.test.utility.dll",
# srcs = [":test_utility_common"] + glob(["xunit/test/test.utility/**/*.cs"]),
# defines = [
# "NETSTANDARD2_0",
# "NETSTANDARD",
# ],
# visibility = ["//visibility:public"],
# deps = [
# ":xunit.core.dll",
# "@core_sdk_stdlib//:libraryset",
# "@xunit_abstractions//:abstractions.xunit.dll",
# ],
# )
#core_xunit_test(
# name = "test.xunit.assert",
# srcs = ["@xunit_assert//:test_files"] + glob(["xunit/test/test.xunit.assert/**/*.cs"]),
# defines = [
# "XUNIT_FRAMEWORK",
# ],
# visibility = ["//visibility:public"],
# deps = [
# "@core_sdk_stdlib//:libraryset",
# "@xunit_abstractions//:abstractions.xunit",
# "@xunit_assert//:assert.xunit",
# ":xunit.core",
# ":xunit.test.utility",
# ],
# testlauncher=":xunit.console"
#)
| 28.285106 | 92 | 0.595607 | 630 | 6,647 | 6.153968 | 0.128571 | 0.123033 | 0.130513 | 0.054166 | 0.65463 | 0.585246 | 0.505546 | 0.486717 | 0.477173 | 0.423007 | 0 | 0.002711 | 0.222958 | 6,647 | 234 | 93 | 28.405983 | 0.747919 | 0.128028 | 0 | 0.634409 | 0 | 0 | 0.58196 | 0.451865 | 0 | 0 | 0 | 0 | 0.010753 | 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 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
bdd11ff80932a282699920a25ee271c0f0edc2ad | 181 | py | Python | __init__.py | benjaoming/sushi-chef-elejandria-libros | 02b7518985805e8ddd2f3ae1985e6321216946f7 | [
"MIT"
] | null | null | null | __init__.py | benjaoming/sushi-chef-elejandria-libros | 02b7518985805e8ddd2f3ae1985e6321216946f7 | [
"MIT"
] | 1 | 2020-04-13T14:37:10.000Z | 2020-04-23T15:23:09.000Z | __init__.py | benjaoming/sushi-chef-elejandria-libros | 02b7518985805e8ddd2f3ae1985e6321216946f7 | [
"MIT"
] | 1 | 2020-04-23T14:52:02.000Z | 2020-04-23T14:52:02.000Z | # -*- coding: utf-8 -*-
"""Top-level package for Elejandria Libros chef."""
__author__ = """Learning Equality"""
__email__ = 'benjamin@learningequality.org'
__version__ = '0.1.0'
| 22.625 | 51 | 0.685083 | 21 | 181 | 5.333333 | 0.952381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025316 | 0.127072 | 181 | 7 | 52 | 25.857143 | 0.683544 | 0.375691 | 0 | 0 | 0 | 0 | 0.476636 | 0.271028 | 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 |
bddb7f4a0ba96bba53445caadd940ad99757da27 | 83 | py | Python | codetest.py | Shannon-NJIT/PyCharmsHW | a2f97c0298bc0c52ea4c44e4aa0eed8add1dd546 | [
"MIT"
] | null | null | null | codetest.py | Shannon-NJIT/PyCharmsHW | a2f97c0298bc0c52ea4c44e4aa0eed8add1dd546 | [
"MIT"
] | null | null | null | codetest.py | Shannon-NJIT/PyCharmsHW | a2f97c0298bc0c52ea4c44e4aa0eed8add1dd546 | [
"MIT"
] | null | null | null | #adding two numbers
num1 = 2
num2 = 3
sum = num1 + num2
print("The sum is:", sum) | 11.857143 | 25 | 0.638554 | 15 | 83 | 3.533333 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09375 | 0.228916 | 83 | 7 | 25 | 11.857143 | 0.734375 | 0.216867 | 0 | 0 | 0 | 0 | 0.169231 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
bdf5bee97baaa9733230a42c37c0bd9bbaeb04da | 670 | py | Python | moai/validation/metrics/object_pose/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 10 | 2021-04-02T11:21:33.000Z | 2022-01-18T18:32:32.000Z | moai/validation/metrics/object_pose/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 1 | 2022-03-22T20:10:55.000Z | 2022-03-24T13:11:02.000Z | moai/validation/metrics/object_pose/__init__.py | tzole1155/moai | d1afb3aaf8ddcd7a1c98b84d6365afb846ae3180 | [
"Apache-2.0"
] | 3 | 2021-05-16T20:47:40.000Z | 2021-12-01T21:15:36.000Z | from moai.validation.metrics.object_pose.position import NormalizedPositionError
from moai.validation.metrics.object_pose.rotation import AngleError
from moai.validation.metrics.object_pose.accuracy import (
Accuracy2,
Accuracy5,
Accuracy10
)
from moai.validation.metrics.object_pose.add import (
SixD2,
SixD5,
SixD10
)
from moai.validation.metrics.object_pose.projection import (
Projection2,
Projection5,
Projection10
)
__all__ = [
"NormalizedPositionError",
"AngleError",
"Accuracy2",
"Accuracy5",
"Accuracy10",
"SixD2",
"SixD5",
"SixD10",
"Projection",
"Projection",
"Projection10",
] | 20.9375 | 80 | 0.707463 | 63 | 670 | 7.380952 | 0.380952 | 0.086022 | 0.193548 | 0.268817 | 0.376344 | 0.376344 | 0 | 0 | 0 | 0 | 0 | 0.04059 | 0.191045 | 670 | 32 | 81 | 20.9375 | 0.817343 | 0 | 0 | 0.066667 | 0 | 0 | 0.162444 | 0.034277 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
da071c11ced2f82cfca867e0a4c3bae66e009f34 | 983 | py | Python | 4_binary_tree/node.py | PythonPostgreSQLDeveloperCourse/Section13 | 8129a5d81b8afda924b42eb39b246eda26bbeb65 | [
"MIT"
] | null | null | null | 4_binary_tree/node.py | PythonPostgreSQLDeveloperCourse/Section13 | 8129a5d81b8afda924b42eb39b246eda26bbeb65 | [
"MIT"
] | null | null | null | 4_binary_tree/node.py | PythonPostgreSQLDeveloperCourse/Section13 | 8129a5d81b8afda924b42eb39b246eda26bbeb65 | [
"MIT"
] | null | null | null | class Node:
"""
This Node class has been created for you.
It contains the necessary properties for the solution, which are:
- text
- next
"""
def __init__(self, data, value):
self.data = data
self.value = value
self.__left = None
self.__right = None
def __repr__(self):
return '<Node {}>'.format(self.value)
def set_right(self, node):
if isinstance(node, Node) or node is None:
self.__right = node
else:
raise TypeError("The 'right' node must be of type Node or None.")
def set_left(self, node):
if isinstance(node, Node) or node is None:
self.__left = node
else:
raise TypeError("The 'left' node must be of type Node or None.")
def get_right(self):
return self.__right
def get_left(self):
return self.__left
def print_details(self):
print("{}: {}".format(self.value, self.data))
| 25.868421 | 77 | 0.579858 | 129 | 983 | 4.224806 | 0.341085 | 0.044037 | 0.047706 | 0.073395 | 0.359633 | 0.26789 | 0.26789 | 0.26789 | 0.26789 | 0.161468 | 0 | 0 | 0.318413 | 983 | 37 | 78 | 26.567568 | 0.813433 | 0.123093 | 0 | 0.166667 | 0 | 0 | 0.127098 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.291667 | false | 0 | 0 | 0.125 | 0.458333 | 0.083333 | 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 |
da108785ec400e2f34fe21a8445d93c8956186e7 | 981 | py | Python | exercises/en/test_02_21b.py | betatim/MCL-DSCI-011-programming-in-python | b51f43a6bb1bedf0db028613d48d6566309ec44a | [
"MIT"
] | null | null | null | exercises/en/test_02_21b.py | betatim/MCL-DSCI-011-programming-in-python | b51f43a6bb1bedf0db028613d48d6566309ec44a | [
"MIT"
] | null | null | null | exercises/en/test_02_21b.py | betatim/MCL-DSCI-011-programming-in-python | b51f43a6bb1bedf0db028613d48d6566309ec44a | [
"MIT"
] | null | null | null | def test():
# Here we can either check objects created in the solution code, or the
# string value of the solution, available as __solution__. A helper for
# printing formatted messages is available as __msg__. See the testTemplate
# in the meta.json for details.
# If an assertion fails, the message will be displayed
assert set(bs_column.values) == {'strong', 'weak'}, "Have you selected the 'base_score' column?"
assert set(score_freq) == set([573, 228]), "You count values are incorrect. Are you using the 'count' function?"
assert "plot.bar" in __solution__ , "Are you using the 'plot.bar' function?"
assert list(score_plot.get_ylim()) == [0.0, 601.65], "The y-axis labels are incorrect, are you using the 'count' function?"
assert str(list(score_plot.get_xticklabels())) == "[Text(0, 0, 'weak'), Text(0, 0, 'strong')]", "\nThe x-axis labels are incorrect. Are you using the 'count' function?"
__msg__.good("Nice work, well done!") | 75.461538 | 172 | 0.696228 | 150 | 981 | 4.4 | 0.54 | 0.036364 | 0.066667 | 0.084848 | 0.225758 | 0.225758 | 0.225758 | 0.225758 | 0.225758 | 0.148485 | 0 | 0.021144 | 0.180428 | 981 | 13 | 173 | 75.461538 | 0.799751 | 0.301733 | 0 | 0 | 0 | 0 | 0.538235 | 0 | 0 | 0 | 0 | 0 | 0.714286 | 1 | 0.142857 | true | 0 | 0 | 0 | 0.142857 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
da1f5b9b790528394b8f7269a75ca6a805a3a729 | 329 | py | Python | app-2/application/routes.py | sc18kg/QA-PROJECT-2 | 210aa32f637b7fe8f10f74bbc5429c5093101b8e | [
"Unlicense"
] | null | null | null | app-2/application/routes.py | sc18kg/QA-PROJECT-2 | 210aa32f637b7fe8f10f74bbc5429c5093101b8e | [
"Unlicense"
] | null | null | null | app-2/application/routes.py | sc18kg/QA-PROJECT-2 | 210aa32f637b7fe8f10f74bbc5429c5093101b8e | [
"Unlicense"
] | null | null | null | from flask import Flask, Response, request
import random
from application import app
@app.route('/race', methods=['GET'])
def race():
race = ['Altmer', 'Argonian', 'Bosmer', 'Breton', 'Dunmer', 'Imperial', 'Khajiit', 'Nord', 'Orc', 'Redguard']
race = random.choice(race)
return Response(race, mimetype='text/plain') | 32.9 | 113 | 0.671733 | 40 | 329 | 5.525 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 329 | 10 | 114 | 32.9 | 0.783688 | 0 | 0 | 0 | 0 | 0 | 0.242424 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.