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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a38102a04999ca03c7de3e2fb856408c54aa8349 | 231 | py | Python | database.py | grimadas/mof-stats | 72ae21fa37c5dd1e77a401499c3dda5235988d2d | [
"Apache-2.0"
] | null | null | null | database.py | grimadas/mof-stats | 72ae21fa37c5dd1e77a401499c3dda5235988d2d | [
"Apache-2.0"
] | null | null | null | database.py | grimadas/mof-stats | 72ae21fa37c5dd1e77a401499c3dda5235988d2d | [
"Apache-2.0"
] | 1 | 2021-06-03T09:44:59.000Z | 2021-06-03T09:44:59.000Z | from walrus import *
def open_db():
return Database(host='localhost', port=6379, db=0)
# TODO: add interaction with redis
#
if __name__ == '__main__':
db = open_db()
db['walrus'] = 'tusk'
print(db['walrus'])
| 13.588235 | 54 | 0.619048 | 31 | 231 | 4.290323 | 0.741935 | 0.090226 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027778 | 0.220779 | 231 | 16 | 55 | 14.4375 | 0.711111 | 0.138528 | 0 | 0 | 0 | 0 | 0.170103 | 0 | 0 | 0 | 0 | 0.0625 | 0 | 1 | 0.142857 | false | 0 | 0.142857 | 0.142857 | 0.428571 | 0.142857 | 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 | 0 | 1 | 0 | 0 | 0 | 2 |
a38399cb9cb8233e159738b8fa2715dd0d118729 | 7,156 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/impairment/profile/fixedclassifier/pattern/pattern.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/impairment/profile/fixedclassifier/pattern/pattern.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/impairment/profile/fixedclassifier/pattern/pattern.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Pattern(Base):
"""The Pattern class encapsulates a user managed pattern node in the ixnetwork hierarchy.
An instance of the class can be obtained by accessing the Pattern property from a parent instance.
The internal properties list will be empty when the property is accessed and is populated from the server using the find method.
The internal properties list can be managed by the user by using the add and remove methods.
"""
_SDM_NAME = 'pattern'
def __init__(self, parent):
super(Pattern, self).__init__(parent)
@property
def BitOffset(self):
"""Bit offset within a byte. Starting point of the mask.
Returns:
number
"""
return self._get_attribute('bitOffset')
@BitOffset.setter
def BitOffset(self, value):
self._set_attribute('bitOffset', value)
@property
def Enabled(self):
"""If true, match incoming packets against this pattern.
Returns:
bool
"""
return self._get_attribute('enabled')
@Enabled.setter
def Enabled(self, value):
self._set_attribute('enabled', value)
@property
def Mask(self):
"""Bitmask to match against. Same format as value.
Returns:
str
"""
return self._get_attribute('mask')
@Mask.setter
def Mask(self, value):
self._set_attribute('mask', value)
@property
def Name(self):
"""Name of pattern.
Returns:
str
"""
return self._get_attribute('name')
@Name.setter
def Name(self, value):
self._set_attribute('name', value)
@property
def Offset(self):
"""Byte offset from start of L2 frame.
Returns:
number
"""
return self._get_attribute('offset')
@Offset.setter
def Offset(self, value):
self._set_attribute('offset', value)
@property
def Value(self):
"""The field value to match. For MAC, IPv4, and IPv6 addresses, the value is a formatted address. For all other fields, the value is encoded as a string of hex bytes, most significant byte first, and most significant bit first within each byte. Each hex byte must be exactly two hex digits; A-F and a-f are both accepted. The hex bytes must be separated by a single white space. Example: 00 01 02 FF.
Returns:
str
"""
return self._get_attribute('value')
@Value.setter
def Value(self, value):
self._set_attribute('value', value)
@property
def Width(self):
"""Width of field, in bits.
Returns:
number
"""
return self._get_attribute('width')
@Width.setter
def Width(self, value):
self._set_attribute('width', value)
def add(self, BitOffset=None, Enabled=None, Mask=None, Name=None, Offset=None, Value=None, Width=None):
"""Adds a new pattern node on the server and retrieves it in this instance.
Args:
BitOffset (number): Bit offset within a byte. Starting point of the mask.
Enabled (bool): If true, match incoming packets against this pattern.
Mask (str): Bitmask to match against. Same format as value.
Name (str): Name of pattern.
Offset (number): Byte offset from start of L2 frame.
Value (str): The field value to match. For MAC, IPv4, and IPv6 addresses, the value is a formatted address. For all other fields, the value is encoded as a string of hex bytes, most significant byte first, and most significant bit first within each byte. Each hex byte must be exactly two hex digits; A-F and a-f are both accepted. The hex bytes must be separated by a single white space. Example: 00 01 02 FF.
Width (number): Width of field, in bits.
Returns:
self: This instance with all currently retrieved pattern data using find and the newly added pattern data available through an iterator or index
Raises:
ServerError: The server has encountered an uncategorized error condition
"""
return self._create(locals())
def remove(self):
"""Deletes all the pattern data in this instance from server.
Raises:
NotFoundError: The requested resource does not exist on the server
ServerError: The server has encountered an uncategorized error condition
"""
self._delete()
def find(self, BitOffset=None, Enabled=None, Mask=None, Name=None, Offset=None, Value=None, Width=None):
"""Finds and retrieves pattern data from the server.
All named parameters support regex and can be used to selectively retrieve pattern data from the server.
By default the find method takes no parameters and will retrieve all pattern data from the server.
Args:
BitOffset (number): Bit offset within a byte. Starting point of the mask.
Enabled (bool): If true, match incoming packets against this pattern.
Mask (str): Bitmask to match against. Same format as value.
Name (str): Name of pattern.
Offset (number): Byte offset from start of L2 frame.
Value (str): The field value to match. For MAC, IPv4, and IPv6 addresses, the value is a formatted address. For all other fields, the value is encoded as a string of hex bytes, most significant byte first, and most significant bit first within each byte. Each hex byte must be exactly two hex digits; A-F and a-f are both accepted. The hex bytes must be separated by a single white space. Example: 00 01 02 FF.
Width (number): Width of field, in bits.
Returns:
self: This instance with matching pattern data retrieved from the server available through an iterator or index
Raises:
ServerError: The server has encountered an uncategorized error condition
"""
return self._select(locals())
def read(self, href):
"""Retrieves a single instance of pattern data from the server.
Args:
href (str): An href to the instance to be retrieved
Returns:
self: This instance with the pattern data from the server available through an iterator or index
Raises:
NotFoundError: The requested resource does not exist on the server
ServerError: The server has encountered an uncategorized error condition
"""
return self._read(href)
| 37.862434 | 414 | 0.724008 | 1,061 | 7,156 | 4.841659 | 0.231857 | 0.024528 | 0.017715 | 0.029979 | 0.557719 | 0.506911 | 0.454156 | 0.448705 | 0.432743 | 0.432743 | 0 | 0.006154 | 0.205282 | 7,156 | 188 | 415 | 38.06383 | 0.897134 | 0.740637 | 0 | 0.125 | 0 | 0 | 0.05219 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.339286 | false | 0 | 0.035714 | 0 | 0.589286 | 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 |
a399a8ecc01f2edaa622882aeb6015e9c0e72509 | 425 | py | Python | backend/plugins/google_slides/cms_plugins.py | marksweb/django-cms-60min-demo-2021 | d9ca83538d6c5c7a0b0e1a18ae1a15bda4c296e4 | [
"MIT"
] | null | null | null | backend/plugins/google_slides/cms_plugins.py | marksweb/django-cms-60min-demo-2021 | d9ca83538d6c5c7a0b0e1a18ae1a15bda4c296e4 | [
"MIT"
] | 1 | 2022-01-15T11:29:16.000Z | 2022-01-15T22:11:45.000Z | backend/plugins/google_slides/cms_plugins.py | marksweb/django-cms-60min-demo-2021 | d9ca83538d6c5c7a0b0e1a18ae1a15bda4c296e4 | [
"MIT"
] | 3 | 2022-01-14T15:55:00.000Z | 2022-01-23T23:46:56.000Z | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from backend.plugins.google_slides.models import GoogleSlidesPluginModel
from backend.plugins.module_name import MODULE_NAME
@plugin_pool.register_plugin
class GoogleSlidesPlugin(CMSPluginBase):
module = MODULE_NAME
model = GoogleSlidesPluginModel
name = "Google slides"
render_template = 'google_slides/google_slides.html'
| 30.357143 | 72 | 0.828235 | 51 | 425 | 6.666667 | 0.431373 | 0.141176 | 0.076471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 425 | 13 | 73 | 32.692308 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0.105882 | 0.075294 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.9 | 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 |
6e5a6a056e3752358f592511fa328ceb20240b7c | 1,940 | py | Python | 2018/advent-of-code/19.py | duelafn/challenge-problems | 84cc56d5786da03a9fa1af513f9ecd2439a6c3b4 | [
"MIT"
] | 2 | 2016-12-25T02:48:31.000Z | 2017-01-06T01:05:15.000Z | 2018/advent-of-code/19.py | duelafn/challenge-problems | 84cc56d5786da03a9fa1af513f9ecd2439a6c3b4 | [
"MIT"
] | null | null | null | 2018/advent-of-code/19.py | duelafn/challenge-problems | 84cc56d5786da03a9fa1af513f9ecd2439a6c3b4 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse
class VM(object):
def __init__(self, ip):
self.ip = ip
self.reg = [0, 0, 0, 0, 0, 0]
self.reg[self.ip] -= 1
def run(self, prog):
while -1 <= self.reg[self.ip] < len(prog)-1:
self.reg[self.ip] += 1
op, a, b, c = prog[self.reg[self.ip]]
VM.__dict__[op](self.reg, a, b, c)
print(self.reg)
return self.reg
def addr(R, a, b, c): R[c] = R[a] + R[b]
def addi(R, a, b, c): R[c] = R[a] + b
def mulr(R, a, b, c): R[c] = R[a] * R[b]
def muli(R, a, b, c): R[c] = R[a] * b
def banr(R, a, b, c): R[c] = R[a] & R[b]
def bani(R, a, b, c): R[c] = R[a] & b
def borr(R, a, b, c): R[c] = R[a] | R[b]
def bori(R, a, b, c): R[c] = R[a] | b
def setr(R, a, b, c): R[c] = R[a]
def seti(R, a, b, c): R[c] = a
def gtir(R, a, b, c): R[c] = 1 if a > R[b] else 0
def gtri(R, a, b, c): R[c] = 1 if R[a] > b else 0
def gtrr(R, a, b, c): R[c] = 1 if R[a] > R[b] else 0
def eqir(R, a, b, c): R[c] = 1 if a == R[b] else 0
def eqri(R, a, b, c): R[c] = 1 if R[a] == b else 0
def eqrr(R, a, b, c): R[c] = 1 if R[a] == R[b] else 0
def MAIN(argv):
with open(argv.fname, 'r', encoding='UTF-8') as fh:
prog = []
for line in fh.readlines():
if line.startswith("#ip "):
vm = VM(int(line[4]))
else:
l = line.split()
prog.append([ l[0], int(l[1]), int(l[2]), int(l[3]) ])
# print("Part 1:", vm.run(prog))
vm.reg = [1, 0, 0, 0, 0, 0]
vm.reg[vm.ip] -= 1
print("Part 2:", vm.run(prog))
def getopts():
parser = argparse.ArgumentParser(description="""Advent of code day 19""")
parser.add_argument('fname', type=str, nargs='?', default="19.in", help='File name')
return parser.parse_args()
if __name__ == '__main__':
MAIN(getopts())
| 28.955224 | 88 | 0.467526 | 378 | 1,940 | 2.351852 | 0.23545 | 0.065242 | 0.074241 | 0.071991 | 0.326209 | 0.265467 | 0.258718 | 0.258718 | 0.249719 | 0.249719 | 0 | 0.032162 | 0.310825 | 1,940 | 66 | 89 | 29.393939 | 0.63276 | 0.038144 | 0 | 0 | 0 | 0 | 0.035427 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.425532 | false | 0 | 0.021277 | 0 | 0.510638 | 0.042553 | 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 |
6e771fddd9a83ac134ea163fa30b818380609ec3 | 419 | py | Python | fileoutput.py | kojish/tweet-to-azure-output | 85218b8fbd61aed3f92a44c612e944b111a47aae | [
"MIT"
] | null | null | null | fileoutput.py | kojish/tweet-to-azure-output | 85218b8fbd61aed3f92a44c612e944b111a47aae | [
"MIT"
] | null | null | null | fileoutput.py | kojish/tweet-to-azure-output | 85218b8fbd61aed3f92a44c612e944b111a47aae | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from abstractoutput import AbstractOutput
import codecs
#import json
class LocalFileOutput(AbstractOutput):
def __init__(self, path):
self.__path = path
def setFilePath(self, path):
self.__path = path
def getFilePath(self):
return self.__path
def send(self, data):
with codecs.open(self.__path, 'a', 'utf-8') as fp:
fp.write(data)
| 20.95 | 58 | 0.634845 | 51 | 419 | 4.980392 | 0.490196 | 0.188976 | 0.094488 | 0.125984 | 0.181102 | 0.181102 | 0 | 0 | 0 | 0 | 0 | 0.006369 | 0.250597 | 419 | 19 | 59 | 22.052632 | 0.802548 | 0.073986 | 0 | 0.166667 | 0 | 0 | 0.015584 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.166667 | 0.083333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
6e78b2da23c0d6b1402d245970d932f2461a885f | 2,839 | py | Python | src/scs_osio/cmd/cmd_device.py | south-coast-science/scs_osio | d1675a03efb8e5d003f659862dda0aeaefece401 | [
"MIT"
] | 1 | 2017-04-24T14:58:31.000Z | 2017-04-24T14:58:31.000Z | src/scs_osio/cmd/cmd_device.py | south-coast-science/scs_osio | d1675a03efb8e5d003f659862dda0aeaefece401 | [
"MIT"
] | null | null | null | src/scs_osio/cmd/cmd_device.py | south-coast-science/scs_osio | d1675a03efb8e5d003f659862dda0aeaefece401 | [
"MIT"
] | 3 | 2017-12-05T12:41:31.000Z | 2018-11-05T15:29:15.000Z | """
Created on 19 Feb 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import optparse
# --------------------------------------------------------------------------------------------------------------------
class CmdDevice(object):
"""
unix command line handler
"""
def __init__(self):
"""
Constructor
"""
self.__parser = optparse.OptionParser(usage="%prog CLIENT_ID [-l LAT LNG POSTCODE] [-d DESCRIPTION] [-v]",
version="%prog 1.0")
# optional...
self.__parser.add_option("--loc", "-l", type="string", nargs=3, action="store", dest="lat_lng_postcode",
help="set device location")
self.__parser.add_option("--desc", "-d", type="string", nargs=1, action="store", dest="description",
help="set device description")
self.__parser.add_option("--verbose", "-v", action="store_true", dest="verbose", default=False,
help="report narrative to stderr")
self.__opts, self.__args = self.__parser.parse_args()
# ----------------------------------------------------------------------------------------------------------------
def is_valid(self):
if self.client_id is None:
return False
return True
# ----------------------------------------------------------------------------------------------------------------
def set(self):
return self.__opts.lat_lng_postcode is not None or self.description is not None
# ----------------------------------------------------------------------------------------------------------------
@property
def client_id(self):
return self.__args[0] if len(self.__args) > 0 else None
@property
def lat(self):
return None if self.__opts.lat_lng_postcode is None else self.__opts.lat_lng_postcode[0]
@property
def lng(self):
return None if self.__opts.lat_lng_postcode is None else self.__opts.lat_lng_postcode[1]
@property
def postcode(self):
return None if self.__opts.lat_lng_postcode is None else self.__opts.lat_lng_postcode[2]
@property
def description(self):
return self.__opts.description
@property
def verbose(self):
return self.__opts.verbose
# ----------------------------------------------------------------------------------------------------------------
def print_help(self, file):
self.__parser.print_help(file)
def __str__(self, *args, **kwargs):
return "CmdDevice:{client_id:%s, lat:%s, lng:%s, postcode:%s, description:%s, verbose:%s}" % \
(self.client_id, self.lat, self.lng, self.postcode, self.description, self.verbose)
| 30.526882 | 118 | 0.475872 | 279 | 2,839 | 4.573477 | 0.293907 | 0.062696 | 0.098746 | 0.076803 | 0.183386 | 0.183386 | 0.164577 | 0.164577 | 0.164577 | 0.164577 | 0 | 0.006849 | 0.228602 | 2,839 | 92 | 119 | 30.858696 | 0.575799 | 0.24727 | 0 | 0.146341 | 0 | 0.02439 | 0.147651 | 0.011505 | 0 | 0 | 0 | 0 | 0 | 1 | 0.268293 | false | 0 | 0.02439 | 0.195122 | 0.560976 | 0.04878 | 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 |
6e7fac908e2a1f8d962be33a573c7278dca4a757 | 884 | py | Python | 191_Number_of_1_Bits.py | joshlyman/Josh-LeetCode | cc9e2cc406d2cbd5a90ee579efbcaeffb842c5ed | [
"MIT"
] | null | null | null | 191_Number_of_1_Bits.py | joshlyman/Josh-LeetCode | cc9e2cc406d2cbd5a90ee579efbcaeffb842c5ed | [
"MIT"
] | null | null | null | 191_Number_of_1_Bits.py | joshlyman/Josh-LeetCode | cc9e2cc406d2cbd5a90ee579efbcaeffb842c5ed | [
"MIT"
] | null | null | null | # built in
def hammingWeight(self, n):
"""
:type n: int
:rtype: int
"""
return bin(n).count('1')
# Using bit operation to cancel a 1 in each round
# Think of a number in binary n = XXXXXX1000, n - 1 is XXXXXX0111. n & (n - 1) will be XXXXXX0000
# which is just remove the last significant 1
def hammingWeight(self, n):
"""
:type n: int
:rtype: int
"""
c = 0
while n:
n &= n - 1
c += 1
return c
class Solution:
def hammingWeight(self, n: int) -> int:
ans=0
while n>0:
if n%2==1:
ans+=1
n=n//2
return ans
# Time: O(1)
# Space:O(1)
# use bit manipulation
def hammingWeight(self, n: int) -> int:
out = 0
while n > 0:
# n & 1 means n%2
if n & 1:
out += 1
# n>>=1 means n//2
n >>= 1
return out
| 17.68 | 98 | 0.492081 | 135 | 884 | 3.222222 | 0.385185 | 0.032184 | 0.183908 | 0.193103 | 0.335632 | 0.294253 | 0.170115 | 0.170115 | 0.170115 | 0 | 0 | 0.068015 | 0.384615 | 884 | 49 | 99 | 18.040816 | 0.731618 | 0.367647 | 0 | 0.26087 | 0 | 0 | 0.001953 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.173913 | false | 0 | 0 | 0 | 0.391304 | 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 |
6e8bf3b49ac7ebd72a5f0a5bf684d6c17c3cfbe6 | 281 | py | Python | src/the_pitch/domain/simulation_dataset.py | dpasse/the_pitch | 8b36cf9a4c798fc22feda55d23ed06218be30965 | [
"MIT"
] | null | null | null | src/the_pitch/domain/simulation_dataset.py | dpasse/the_pitch | 8b36cf9a4c798fc22feda55d23ed06218be30965 | [
"MIT"
] | null | null | null | src/the_pitch/domain/simulation_dataset.py | dpasse/the_pitch | 8b36cf9a4c798fc22feda55d23ed06218be30965 | [
"MIT"
] | null | null | null | from typing import List, Dict
from datetime import datetime
from . import StockPrice
class SimulationDataset(object):
def __init__(self, data: List[StockPrice], test_data: Dict[datetime, List[StockPrice]]) -> None:
self.data = data
self.test_data = test_data
| 28.1 | 100 | 0.725979 | 36 | 281 | 5.472222 | 0.444444 | 0.121827 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.185053 | 281 | 9 | 101 | 31.222222 | 0.860262 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
6e8c53d581b23980d7d7579f438036da4041ade2 | 1,505 | py | Python | tests/test_color.py | eskilop/TgThemer-py | 3ebb7d1c3c78c32754cee82aa92a6c97ac18f27f | [
"MIT"
] | 1 | 2020-05-12T21:33:56.000Z | 2020-05-12T21:33:56.000Z | tests/test_color.py | eskilop/TgThemer-py | 3ebb7d1c3c78c32754cee82aa92a6c97ac18f27f | [
"MIT"
] | null | null | null | tests/test_color.py | eskilop/TgThemer-py | 3ebb7d1c3c78c32754cee82aa92a6c97ac18f27f | [
"MIT"
] | null | null | null | from tgthemer import Color
colorgroup = {
"base": '#FF18181F',
"result": '#FF30303E',
"alpha": '#8018181F',
"s_int": -15198177,
"argb": (255, 24, 24, 31)
}
colorgroup24 = {
"base": '#18181F',
"result": '#30303E',
"s_int": 1579039,
"argb": (24, 24, 31)
}
class TestColor(object):
def test_hex_prop(self):
assert Color(colorgroup["base"]).hex == colorgroup["base"]
def test_sint_prop(self):
assert Color(colorgroup["base"]).sint == colorgroup["s_int"]
def test_argb_prop(self):
assert Color(colorgroup["base"]).argb == colorgroup["argb"]
def test_alpha(self):
assert Color(colorgroup["base"]).alpha(-0.5).hex == "#8018181F"
def test_lighten(self):
assert Color(colorgroup["base"]).lighten(1) == Color("#FF30303E")
def test_darken(self):
assert Color(colorgroup["result"]).lighten(-0.5) == Color(colorgroup["base"])
# tests for 24bit
def test_hex_prop24(self):
assert Color(colorgroup24["base"]).hex == colorgroup24["base"]
def test_sint_prop24(self):
assert Color(colorgroup24["base"]).sint == colorgroup24["s_int"]
def test_argb_prop24(self):
assert Color(colorgroup24["base"]).argb == colorgroup24["argb"]
def test_lighten24(self):
assert Color(colorgroup24["base"]).lighten(1) == Color(colorgroup24["result"])
def test_darken24(self):
assert Color(colorgroup24["result"]).lighten(-0.5) == Color(colorgroup24["base"]) | 27.87037 | 89 | 0.626578 | 177 | 1,505 | 5.20904 | 0.242938 | 0.083514 | 0.178959 | 0.16269 | 0.400217 | 0.227766 | 0 | 0 | 0 | 0 | 0 | 0.09166 | 0.195349 | 1,505 | 54 | 89 | 27.87037 | 0.669694 | 0.009967 | 0 | 0 | 0 | 0 | 0.127602 | 0 | 0 | 0 | 0 | 0 | 0.297297 | 1 | 0.297297 | false | 0 | 0.027027 | 0 | 0.351351 | 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 |
6e8f5667417f841d37df59426f190cbe6130ae04 | 2,211 | py | Python | src/change_name.py | jordanbull23/Icourses-Videos-and-PPTs-Download | bd69a2eedbdc1c2e86b4df2eba8c15a6492c8b0a | [
"MIT"
] | 204 | 2018-10-17T11:42:56.000Z | 2022-03-14T11:09:49.000Z | src/change_name.py | jordanbull23/Icourses-Videos-and-PPTs-Download | bd69a2eedbdc1c2e86b4df2eba8c15a6492c8b0a | [
"MIT"
] | 15 | 2018-11-07T09:00:06.000Z | 2021-12-16T08:48:36.000Z | src/change_name.py | jordanbull23/Icourses-Videos-and-PPTs-Download | bd69a2eedbdc1c2e86b4df2eba8c15a6492c8b0a | [
"MIT"
] | 50 | 2018-10-24T10:49:20.000Z | 2021-07-27T04:34:44.000Z | # -*- coding: utf-8 -*-
"""生成改名文件"""
def change_name_windows(name_dict, loc):
with open(loc + '\\change_name.cmd', 'w') as f:
loc = loc.replace('\\', r'\\') + r'\\'
i = 0
for key in name_dict:
i = i+1
old_name = str(key).split(r'/')[-1]
tailor = old_name.split('.')[-1]
new_name = str(i) + '-' + name_dict[key] + '.' + tailor
if(r'/' in new_name):
new_name = new_name.replace(r'/', ' ')
try:
f.write(r'ren "%s" "%s"&' % (old_name, new_name))
f.write('\n')
except:
continue
finally:
pass
f.close()
def change_name_linux(name_dict, loc):
with open(loc + '/change_name.sh', 'w') as f:
i = 0
for key in name_dict:
i = i+1
old_name = str(key).split(r'/')[-1]
tailor = old_name.split('.')[-1]
new_name = str(i) + '-' + name_dict[key] + '.' + tailor
if(r'/' in new_name):
new_name = new_name.replace(r'/', ' ')
try:
f.write(r'mv "%s" "%s"' % (old_name, new_name))
f.write('\n')
except:
continue
finally:
pass
f.close()
def get_name_dict(mp4_list, pdf_list, source_list, homework_list, exampaper_list):
name_dict = {}
for key in mp4_list:
name_dict[(key.split('/')[-1])] = mp4_list[key]
for key in pdf_list:
name_dict[(key.split('/')[-1])] = pdf_list[key]
for key in source_list:
name_dict[(key.split('/')[-1])] = source_list[key]
for key in homework_list:
name_dict[(key.split('/')[-1])] = homework_list[key]
for key in exampaper_list:
name_dict[(key.split('/')[-1])] = exampaper_list[key]
return name_dict
def change_name(mp4_list, pdf_list, source_list, homework_list, exampaper_list, loc, mode):
name_dict = get_name_dict(
mp4_list, pdf_list, source_list, homework_list, exampaper_list)
if(mode == 0):
change_name_windows(name_dict, loc)
if(mode == 1):
change_name_linux(name_dict, loc)
| 32.514706 | 91 | 0.507915 | 295 | 2,211 | 3.562712 | 0.176271 | 0.137012 | 0.053283 | 0.071361 | 0.820171 | 0.763083 | 0.581351 | 0.581351 | 0.520457 | 0.520457 | 0 | 0.01416 | 0.329263 | 2,211 | 67 | 92 | 33 | 0.694538 | 0.013116 | 0 | 0.526316 | 0 | 0 | 0.040901 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.070175 | false | 0.035088 | 0 | 0 | 0.087719 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6e936c4f063b1a50f3b6f73322510848462cd043 | 280 | py | Python | mayan/apps/common/permissions.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/common/permissions.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/common/permissions.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | from django.utils.translation import ugettext_lazy as _
from mayan.apps.permissions import PermissionNamespace
namespace = PermissionNamespace(label=_('Common'), name='common')
permission_object_copy = namespace.add_permission(
label=_('Copy object'), name='object_copy'
)
| 28 | 65 | 0.796429 | 32 | 280 | 6.71875 | 0.625 | 0.093023 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 280 | 9 | 66 | 31.111111 | 0.853175 | 0 | 0 | 0 | 0 | 0 | 0.121429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
6eca22eba08f522fb1cb07da684e8e8c2bbd2667 | 499 | py | Python | odin/networks_torch/util_modules.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 7 | 2020-12-29T19:35:58.000Z | 2022-01-31T21:01:30.000Z | odin/networks_torch/util_modules.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 3 | 2020-02-06T16:44:17.000Z | 2020-09-26T05:26:14.000Z | odin/networks_torch/util_modules.py | tirkarthi/odin-ai | 7900bef82ad8801d0c73880330d5b24d9ff7cd06 | [
"MIT"
] | 6 | 2019-02-14T01:36:28.000Z | 2020-10-30T13:16:32.000Z | from __future__ import absolute_import, division, print_function
from itertools import chain
import numpy as np
import torch
from odin.utils import as_tuple
class SequentialNetwork(torch.nn.Sequential):
def __init__(self, *args):
args = list(chain(*[as_tuple(a) for a in args]))
super().__init__(*args)
class ParallelNetwork(Sequential):
def forward(self, input):
outputs = []
for module in self._modules.values():
outputs.append(module(input))
return outputs
| 19.96 | 64 | 0.727455 | 66 | 499 | 5.242424 | 0.575758 | 0.040462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.174349 | 499 | 24 | 65 | 20.791667 | 0.839806 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0 | 0.333333 | 0 | 0.666667 | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
6eda7a19399aa884d6e67c0ad196f00c3b0de25b | 1,176 | py | Python | app/infrastructure/database/repositories/access_level.py | AnViSe/cost_confirmation_bot | f8eaa39c3df742bef0fc79b8b7ce0231f1b18749 | [
"MIT"
] | 13 | 2021-12-27T19:46:19.000Z | 2022-03-19T07:55:25.000Z | app/infrastructure/database/repositories/access_level.py | AnViSe/cost_confirmation_bot | f8eaa39c3df742bef0fc79b8b7ce0231f1b18749 | [
"MIT"
] | null | null | null | app/infrastructure/database/repositories/access_level.py | AnViSe/cost_confirmation_bot | f8eaa39c3df742bef0fc79b8b7ce0231f1b18749 | [
"MIT"
] | 1 | 2022-02-07T10:48:18.000Z | 2022-02-07T10:48:18.000Z | from typing import List
from pydantic import parse_obj_as
from sqlalchemy import select
from app.domain.access_levels import dto
from app.domain.access_levels.interfaces.persistence import IAccessLevelReader
from app.domain.access_levels.models.access_level import AccessLevel
from app.domain.user.exceptions.user import UserNotExists
from app.domain.user.models.user import TelegramUser
from app.infrastructure.database.exception_mapper import exception_mapper
from app.infrastructure.database.repositories.repo import SQLAlchemyRepo
class AccessLevelReader(SQLAlchemyRepo, IAccessLevelReader):
@exception_mapper
async def all_access_levels(self) -> List[dto.AccessLevel]:
query = select(AccessLevel)
result = await self.session.execute(query)
access_levels = result.scalars().all()
return parse_obj_as(List[dto.AccessLevel], access_levels)
@exception_mapper
async def user_access_levels(self, user_id: int) -> List[dto.AccessLevel]:
user = await self.session.get(TelegramUser, user_id)
if not user:
raise UserNotExists
return parse_obj_as(List[dto.AccessLevel], user.access_levels)
| 36.75 | 78 | 0.779762 | 148 | 1,176 | 6.040541 | 0.344595 | 0.107383 | 0.072707 | 0.063758 | 0.159955 | 0.076063 | 0.076063 | 0 | 0 | 0 | 0 | 0 | 0.14881 | 1,176 | 31 | 79 | 37.935484 | 0.893107 | 0 | 0 | 0.086957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.434783 | 0 | 0.565217 | 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 |
42bb9354674be4f4b44a818944a6b357c1b4df1d | 542 | py | Python | code/test.py | rajivranjanbuff/Online-Deep-Learning-for-Crisis-Response-using-Tweets | b46c8331bf0fa359b5613f43186830da8d97d4d2 | [
"MIT"
] | null | null | null | code/test.py | rajivranjanbuff/Online-Deep-Learning-for-Crisis-Response-using-Tweets | b46c8331bf0fa359b5613f43186830da8d97d4d2 | [
"MIT"
] | null | null | null | code/test.py | rajivranjanbuff/Online-Deep-Learning-for-Crisis-Response-using-Tweets | b46c8331bf0fa359b5613f43186830da8d97d4d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 2 17:05:44 2018
@author: rajivranjan
"""
import re, os
import string
import sys
#import twokenize
import csv
from collections import defaultdict
from os.path import basename
import ntpath
import codecs
import unicodedata
prccd_folder = "../data" #no backslashes in front of special characters like spaces
#prccd_folder = "/Users/Imran/Dropbox/AIDR-DA-ALT-SC/sigir2016/data/out-domain/gold_silver/"
prccd_folder = os.path.expanduser(prccd_folder)
print(prccd_folder)
| 21.68 | 92 | 0.767528 | 81 | 542 | 5.061728 | 0.728395 | 0.134146 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035865 | 0.125461 | 542 | 24 | 93 | 22.583333 | 0.829114 | 0.48893 | 0 | 0 | 0 | 0 | 0.026415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.75 | 0 | 0.75 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
42c6f2aa58253a8ce1817d857238d9ef2aa69447 | 69 | py | Python | python_settings/tests/settings/base_settings.py | fsboehme/python-settings | 71a4388a983f5cf88ef3223877427260dde98d9c | [
"MIT"
] | 7 | 2019-05-01T20:08:57.000Z | 2022-01-20T09:42:28.000Z | python_settings/tests/settings/base_settings.py | fsboehme/python-settings | 71a4388a983f5cf88ef3223877427260dde98d9c | [
"MIT"
] | 1 | 2020-05-07T18:35:45.000Z | 2020-05-09T19:54:26.000Z | python_settings/tests/settings/base_settings.py | fsboehme/python-settings | 71a4388a983f5cf88ef3223877427260dde98d9c | [
"MIT"
] | 3 | 2020-05-07T14:50:33.000Z | 2021-11-25T15:02:24.000Z | URL_CONFIG ="www.python.org"
DEFAULT_VALUE = 1
DEFAULT_CONSTANT = 0
| 13.8 | 28 | 0.768116 | 11 | 69 | 4.545455 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033333 | 0.130435 | 69 | 4 | 29 | 17.25 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.205882 | 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 |
42cfb56647c7a23626b8d46dc6bb2cd52af20c41 | 8,826 | py | Python | mat2py/core/specgraph.py | mat2py/mat2py | 2776fbe9ca4ad2aaa3eac6aa79d17747a9ec24a8 | [
"MIT"
] | null | null | null | mat2py/core/specgraph.py | mat2py/mat2py | 2776fbe9ca4ad2aaa3eac6aa79d17747a9ec24a8 | [
"MIT"
] | 37 | 2021-12-23T03:22:20.000Z | 2022-02-16T15:40:47.000Z | mat2py/core/specgraph.py | mat2py/mat2py | 2776fbe9ca4ad2aaa3eac6aa79d17747a9ec24a8 | [
"MIT"
] | 2 | 2022-01-23T07:59:10.000Z | 2022-02-03T09:15:54.000Z | # type: ignore
__all__ = [
"meshc",
"barh",
"trisurf",
"compass",
"isonormals",
"plotutils",
"ezcontour",
"streamslice",
"scatter",
"rgb2ind",
"usev6plotapi",
"quiver",
"streamline",
"triplot",
"tetramesh",
"rose",
"patch",
"comet",
"voronoi",
"contourslice",
"histogram",
"errorbar",
"reducepatch",
"ezgraph3",
"interpstreamspeed",
"shrinkfaces",
"ezplot3",
"ezpolar",
"curl",
"stream3",
"contour",
"contours",
"coneplot",
"rotate",
"isosurface",
"pie3",
"specgraphhelper",
"stem",
"frame2im",
"comet3",
"ezmeshc",
"contourf",
"fplot",
"quiver3",
"isocolors",
"soundview",
"ellipsoid",
"parseplotapi",
"streamtube",
"changeseriestype",
"makebars",
"bar3h",
"image",
"trimesh",
"clabel",
"fill",
"spinmap",
"plotmatrix",
"ezsurf",
"divergence",
"ind2rgb",
"pareto",
"isocaps",
"moviein",
"pie",
"contourc",
"feather",
"hgline2lineseries",
"ezcontourf",
"stairs",
"surfc",
"im2java",
"ezplot",
"im2frame",
"colstyle",
"movieview",
"contour3",
"rgbplot",
"surf2patch",
"dither",
"contrast",
"waterfall",
"cylinder",
"bar",
"slice",
"histogram2",
"streamribbon",
"pcolor",
"ribbon",
"isplotchild",
"sphere",
"reducevolume",
"ezsurfc",
"imagesc",
"subvolume",
"streamparticles",
"volumebounds",
"plotchild",
"area",
"meshz",
"imageview",
"stem3",
"scatter3",
"ezmesh",
"plotdoneevent",
"stream2",
"vissuite",
"bar3",
"smooth3",
]
def meshc(*args):
raise NotImplementedError("meshc")
def barh(*args):
raise NotImplementedError("barh")
def trisurf(*args):
raise NotImplementedError("trisurf")
def compass(*args):
raise NotImplementedError("compass")
def isonormals(*args):
raise NotImplementedError("isonormals")
def plotutils(*args):
raise NotImplementedError("plotutils")
def ezcontour(*args):
raise NotImplementedError("ezcontour")
def streamslice(*args):
raise NotImplementedError("streamslice")
def scatter(*args):
raise NotImplementedError("scatter")
def rgb2ind(*args):
raise NotImplementedError("rgb2ind")
def usev6plotapi(*args):
raise NotImplementedError("usev6plotapi")
def quiver(*args):
raise NotImplementedError("quiver")
def streamline(*args):
raise NotImplementedError("streamline")
def triplot(*args):
raise NotImplementedError("triplot")
def tetramesh(*args):
raise NotImplementedError("tetramesh")
def rose(*args):
raise NotImplementedError("rose")
def patch(*args):
raise NotImplementedError("patch")
def comet(*args):
raise NotImplementedError("comet")
def voronoi(*args):
raise NotImplementedError("voronoi")
def contourslice(*args):
raise NotImplementedError("contourslice")
def histogram(*args):
raise NotImplementedError("histogram")
def errorbar(*args):
raise NotImplementedError("errorbar")
def reducepatch(*args):
raise NotImplementedError("reducepatch")
def ezgraph3(*args):
raise NotImplementedError("ezgraph3")
def interpstreamspeed(*args):
raise NotImplementedError("interpstreamspeed")
def shrinkfaces(*args):
raise NotImplementedError("shrinkfaces")
def ezplot3(*args):
raise NotImplementedError("ezplot3")
def ezpolar(*args):
raise NotImplementedError("ezpolar")
def curl(*args):
raise NotImplementedError("curl")
def stream3(*args):
raise NotImplementedError("stream3")
def contour(*args):
raise NotImplementedError("contour")
def contours(*args):
raise NotImplementedError("contours")
def coneplot(*args):
raise NotImplementedError("coneplot")
def rotate(*args):
raise NotImplementedError("rotate")
def isosurface(*args):
raise NotImplementedError("isosurface")
def pie3(*args):
raise NotImplementedError("pie3")
def specgraphhelper(*args):
raise NotImplementedError("specgraphhelper")
def stem(*args):
raise NotImplementedError("stem")
def frame2im(*args):
raise NotImplementedError("frame2im")
def comet3(*args):
raise NotImplementedError("comet3")
def ezmeshc(*args):
raise NotImplementedError("ezmeshc")
def contourf(*args):
raise NotImplementedError("contourf")
def fplot(*args):
raise NotImplementedError("fplot")
def quiver3(*args):
raise NotImplementedError("quiver3")
def isocolors(*args):
raise NotImplementedError("isocolors")
def soundview(*args):
raise NotImplementedError("soundview")
def ellipsoid(*args):
raise NotImplementedError("ellipsoid")
def parseplotapi(*args):
raise NotImplementedError("parseplotapi")
def streamtube(*args):
raise NotImplementedError("streamtube")
def changeseriestype(*args):
raise NotImplementedError("changeseriestype")
def makebars(*args):
raise NotImplementedError("makebars")
def bar3h(*args):
raise NotImplementedError("bar3h")
def image(*args):
raise NotImplementedError("image")
def trimesh(*args):
raise NotImplementedError("trimesh")
def clabel(*args):
raise NotImplementedError("clabel")
def fill(*args):
raise NotImplementedError("fill")
def spinmap(*args):
raise NotImplementedError("spinmap")
def plotmatrix(*args):
raise NotImplementedError("plotmatrix")
def ezsurf(*args):
raise NotImplementedError("ezsurf")
def divergence(*args):
raise NotImplementedError("divergence")
def ind2rgb(*args):
raise NotImplementedError("ind2rgb")
def pareto(*args):
raise NotImplementedError("pareto")
def isocaps(*args):
raise NotImplementedError("isocaps")
def moviein(*args):
raise NotImplementedError("moviein")
def pie(*args):
raise NotImplementedError("pie")
def contourc(*args):
raise NotImplementedError("contourc")
def feather(*args):
raise NotImplementedError("feather")
def hgline2lineseries(*args):
raise NotImplementedError("hgline2lineseries")
def ezcontourf(*args):
raise NotImplementedError("ezcontourf")
def stairs(*args):
raise NotImplementedError("stairs")
def surfc(*args):
raise NotImplementedError("surfc")
def im2java(*args):
raise NotImplementedError("im2java")
def ezplot(*args):
raise NotImplementedError("ezplot")
def im2frame(*args):
raise NotImplementedError("im2frame")
def colstyle(*args):
raise NotImplementedError("colstyle")
def movieview(*args):
raise NotImplementedError("movieview")
def contour3(*args):
raise NotImplementedError("contour3")
def rgbplot(*args):
raise NotImplementedError("rgbplot")
def surf2patch(*args):
raise NotImplementedError("surf2patch")
def dither(*args):
raise NotImplementedError("dither")
def contrast(*args):
raise NotImplementedError("contrast")
def waterfall(*args):
raise NotImplementedError("waterfall")
def cylinder(*args):
raise NotImplementedError("cylinder")
def bar(*args):
raise NotImplementedError("bar")
def slice(*args):
raise NotImplementedError("slice")
def histogram2(*args):
raise NotImplementedError("histogram2")
def streamribbon(*args):
raise NotImplementedError("streamribbon")
def pcolor(*args):
raise NotImplementedError("pcolor")
def ribbon(*args):
raise NotImplementedError("ribbon")
def isplotchild(*args):
raise NotImplementedError("isplotchild")
def sphere(*args):
raise NotImplementedError("sphere")
def reducevolume(*args):
raise NotImplementedError("reducevolume")
def ezsurfc(*args):
raise NotImplementedError("ezsurfc")
def imagesc(*args):
raise NotImplementedError("imagesc")
def subvolume(*args):
raise NotImplementedError("subvolume")
def streamparticles(*args):
raise NotImplementedError("streamparticles")
def volumebounds(*args):
raise NotImplementedError("volumebounds")
def plotchild(*args):
raise NotImplementedError("plotchild")
def area(*args):
raise NotImplementedError("area")
def meshz(*args):
raise NotImplementedError("meshz")
def imageview(*args):
raise NotImplementedError("imageview")
def stem3(*args):
raise NotImplementedError("stem3")
def scatter3(*args):
raise NotImplementedError("scatter3")
def ezmesh(*args):
raise NotImplementedError("ezmesh")
def plotdoneevent(*args):
raise NotImplementedError("plotdoneevent")
def stream2(*args):
raise NotImplementedError("stream2")
def vissuite(*args):
raise NotImplementedError("vissuite")
def bar3(*args):
raise NotImplementedError("bar3")
def smooth3(*args):
raise NotImplementedError("smooth3")
| 16.047273 | 50 | 0.67743 | 766 | 8,826 | 7.800261 | 0.151436 | 0.164184 | 0.510795 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009188 | 0.186155 | 8,826 | 549 | 51 | 16.076503 | 0.822637 | 0.00136 | 0 | 0 | 0 | 0 | 0.195415 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.331307 | false | 0.009119 | 0 | 0 | 0.331307 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
42e036b0d845823f95618aab8bf175b91cf40a9b | 1,278 | py | Python | arc/091/e.py | wotsushi/competitive-programming | 17ec8fd5e1c23aee626aee70b1c0da8d7f8b8c86 | [
"MIT"
] | 3 | 2019-06-25T06:17:38.000Z | 2019-07-13T15:18:51.000Z | arc/091/e.py | wotsushi/competitive-programming | 17ec8fd5e1c23aee626aee70b1c0da8d7f8b8c86 | [
"MIT"
] | null | null | null | arc/091/e.py | wotsushi/competitive-programming | 17ec8fd5e1c23aee626aee70b1c0da8d7f8b8c86 | [
"MIT"
] | null | null | null | N, A, B = map(int, input().split())
def f(a, b):
return [
p
for p in [
N - i * a + j
for i in range(
1,
N // a + 1 if N % a > b - N // a else
N // a
)
for j in range(1, a + 1)
] +
[
j
for j in range(
b - N // a if N % a > b - N // a else
b - N // a + 1,
N - (N // a) * a + 1 if N % a > b - N // a else
N - (N // a - 1) * a + 1
)
] +
[
j
for j in reversed(
range(
1,
b - N // a if N % a > b - N // a else
b - N // a + 1
)
)
]
]
# N - A + 1, N - A + 2, ..., N,
# N - 2A + 1, N - 2A + 2, ..., N - A,
# ...,
# N - floor(N / A)A + 1, N - floor(N / A)A + 2, ..., N - (floor(N / A) + 1)A,
# B - floor(N / A), B - floor(N / A) + 1, ..., N - floor(N / A)A
# B - floor(N / A) - 1, B - floor(N / A) - 2, ..., 1
# と構築する
ans = (
-1 if A * B < N or A + B > N + 1 else
' '.join(
str(p) if A >= B else
str(N - p + 1)
for p in f(max(A, B), min(A, B))
)
)
print(ans)
| 23.236364 | 77 | 0.264476 | 196 | 1,278 | 1.72449 | 0.158163 | 0.16568 | 0.071006 | 0.059172 | 0.428994 | 0.369822 | 0.319527 | 0.195266 | 0.195266 | 0.195266 | 0 | 0.046346 | 0.561033 | 1,278 | 54 | 78 | 23.666667 | 0.55615 | 0.208138 | 0 | 0.142857 | 0 | 0 | 0.000996 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.02381 | false | 0 | 0 | 0.02381 | 0.047619 | 0.02381 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6e0bd179d46d8eaefceedbad509007e3c0b871c3 | 192 | py | Python | models/Tamas.py | marios8543/TamaBot | 516149d115ba3fe2300a62bbea3e9e48134d274d | [
"MIT"
] | null | null | null | models/Tamas.py | marios8543/TamaBot | 516149d115ba3fe2300a62bbea3e9e48134d274d | [
"MIT"
] | null | null | null | models/Tamas.py | marios8543/TamaBot | 516149d115ba3fe2300a62bbea3e9e48134d274d | [
"MIT"
] | null | null | null | from enum import Enum
class Gender(Enum):
Male = 1
Female = 2
class LifeCycle(Enum):
Baby = 1
Child = 2
Teen = 3
Adult = 4
Senior = 5
class Varieties(Enum):
| 12.8 | 22 | 0.572917 | 27 | 192 | 4.074074 | 0.703704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 0.34375 | 192 | 15 | 23 | 12.8 | 0.81746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.090909 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6e1bbc5831f8ad85b7876d37799881f53a81f175 | 72 | py | Python | binary.py | angellbelger/utility | 445b3d2ed115ca968cf81216d4227a63cf9f2440 | [
"MIT"
] | null | null | null | binary.py | angellbelger/utility | 445b3d2ed115ca968cf81216d4227a63cf9f2440 | [
"MIT"
] | null | null | null | binary.py | angellbelger/utility | 445b3d2ed115ca968cf81216d4227a63cf9f2440 | [
"MIT"
] | null | null | null | x = y = 0
x = int(input('number: '))
y = bin(x)
print('Binary: ', y[2:]) | 18 | 26 | 0.5 | 14 | 72 | 2.571429 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 0.194444 | 72 | 4 | 27 | 18 | 0.586207 | 0 | 0 | 0 | 0 | 0 | 0.219178 | 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 |
6e1e40ccc7c2caec5bc26cfc013a5acb971091f1 | 866 | py | Python | python_colas/tipos_primitivos.py | LuccaBiasoli/python-cola | 459607cdc88692fd18fd21a1da495d5ff37f1c51 | [
"MIT"
] | null | null | null | python_colas/tipos_primitivos.py | LuccaBiasoli/python-cola | 459607cdc88692fd18fd21a1da495d5ff37f1c51 | [
"MIT"
] | null | null | null | python_colas/tipos_primitivos.py | LuccaBiasoli/python-cola | 459607cdc88692fd18fd21a1da495d5ff37f1c51 | [
"MIT"
] | null | null | null | #tipo primitivos e saida de dados
#int sao : numeros inteiros ex 7 -4 0 82139
estrutura do int para testar:
n1 = int(input('Digite um valor: '))
print(type(n1))
print(n1)
#float sao: numeros reais ex 4.5 0.076 -15.25
estrutura do float para testar:
n = float(input('Digite um valor: '))
print(type(n))
print(n)
#bool sao: True ou False
n = input("Digite qualquer coisa : ")
print(bool(n))
n = input('digite um valor : ')
print(n.isnumeric()) # para ver se é numerico
n = input('digite um valor : ')
print(n.isalpha()) #para ver se é palavra
#str sao : palavras entre aspas ex : 'ola' '7.5' ''
n1= str(input('Fale um nome : '))
print(type(n1))
#exemplo de codigo usando int e str
dia = int(input('Qual dia?'))
mes = str(input('qual mes?'))
ano = int(input('Qual ano?'))
print(f'Voce nasceu no dia {dia}, de {mes} do ano {ano} ') | 19.681818 | 58 | 0.642032 | 149 | 866 | 3.731544 | 0.42953 | 0.098921 | 0.093525 | 0.129496 | 0.18705 | 0.18705 | 0.089928 | 0 | 0 | 0 | 0 | 0.036232 | 0.203233 | 866 | 44 | 58 | 19.681818 | 0.769565 | 0.330254 | 0 | 0.2 | 0 | 0 | 0.321117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.45 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
6e2cde17edca63c48a4bc5fb0497c08d428f2238 | 28,522 | py | Python | pysnmp/MYLEXDAC960SCSIRAIDCONTROLLER-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/MYLEXDAC960SCSIRAIDCONTROLLER-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/MYLEXDAC960SCSIRAIDCONTROLLER-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 MYLEXDAC960SCSIRAIDCONTROLLER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/MYLEXDAC960SCSIRAIDCONTROLLER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:06: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)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Counter32, NotificationType, ModuleIdentity, iso, TimeTicks, Counter64, ObjectIdentity, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, Integer32, Bits, Gauge32, enterprises, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "NotificationType", "ModuleIdentity", "iso", "TimeTicks", "Counter64", "ObjectIdentity", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "Integer32", "Bits", "Gauge32", "enterprises", "Unsigned32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
class DmiCounter(Counter32):
pass
class DmiInteger(Integer32):
pass
class DmiDisplaystring(DisplayString):
pass
class DmiDateX(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(28, 28)
fixedLength = 28
class DmiComponentIndex(Integer32):
pass
mylex = MibIdentifier((1, 3, 6, 1, 4, 1, 1608))
mib = MibIdentifier((1, 3, 6, 1, 4, 1, 1608, 3))
v2 = MibIdentifier((1, 3, 6, 1, 4, 1, 1608, 3, 2))
dmtfGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1))
tComponentid = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1), )
if mibBuilder.loadTexts: tComponentid.setStatus('mandatory')
eComponentid = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"))
if mibBuilder.loadTexts: eComponentid.setStatus('mandatory')
a1Manufacturer = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1, 1), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a1Manufacturer.setStatus('mandatory')
a1Product = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1, 2), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a1Product.setStatus('mandatory')
a1Version = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1, 3), DmiDisplaystring())
if mibBuilder.loadTexts: a1Version.setStatus('mandatory')
a1SerialNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1, 4), DmiDisplaystring())
if mibBuilder.loadTexts: a1SerialNumber.setStatus('mandatory')
a1Installation = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1, 5), DmiDateX())
if mibBuilder.loadTexts: a1Installation.setStatus('mandatory')
a1Verify = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 1, 1, 6), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a1Verify.setStatus('mandatory')
tControllerInformation = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2), )
if mibBuilder.loadTexts: tControllerInformation.setStatus('mandatory')
eControllerInformation = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a2ControllerNumber"))
if mibBuilder.loadTexts: eControllerInformation.setStatus('mandatory')
a2ControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 1), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2ControllerNumber.setStatus('mandatory')
a2OperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2OperationalState.setStatus('mandatory')
a2FirmwareRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 3), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2FirmwareRevision.setStatus('mandatory')
a2ConfiguredChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 4), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2ConfiguredChannels.setStatus('mandatory')
a2ActualChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 5), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2ActualChannels.setStatus('mandatory')
a2MaximumLogicalDrives = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 6), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2MaximumLogicalDrives.setStatus('mandatory')
a2MaximumTargetsPerChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 7), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2MaximumTargetsPerChannel.setStatus('mandatory')
a2MaximumTaggedRequests = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 8), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2MaximumTaggedRequests.setStatus('mandatory')
a2MaximumDataTransferSizePerIoRequestInK = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 9), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2MaximumDataTransferSizePerIoRequestInK.setStatus('mandatory')
a2MaximumConcurrentCommands = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 10), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2MaximumConcurrentCommands.setStatus('mandatory')
a2RebuildRate = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 11), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2RebuildRate.setStatus('mandatory')
a2LogicalSectorSizeInBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 12), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2LogicalSectorSizeInBytes.setStatus('mandatory')
a2PhysicalSectorSizeInBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 13), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2PhysicalSectorSizeInBytes.setStatus('mandatory')
a2CacheLineSizeInBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 14), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2CacheLineSizeInBytes.setStatus('mandatory')
a2DramSizeInMb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 15), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2DramSizeInMb.setStatus('mandatory')
a2EpromSizeInKb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 16), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2EpromSizeInKb.setStatus('mandatory')
a2BusType = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 17), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2BusType.setStatus('mandatory')
a2SystemBusNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 18), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2SystemBusNumber.setStatus('mandatory')
a2SlotNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 19), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2SlotNumber.setStatus('mandatory')
a2InterruptVectorNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 20), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2InterruptVectorNumber.setStatus('mandatory')
a2InterruptMode = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 2, 1, 21), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a2InterruptMode.setStatus('mandatory')
tLogicalDriveInformation = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3), )
if mibBuilder.loadTexts: tLogicalDriveInformation.setStatus('mandatory')
eLogicalDriveInformation = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a3ControllerNumber"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a3LogicalDriveNumber"))
if mibBuilder.loadTexts: eLogicalDriveInformation.setStatus('mandatory')
a3ControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 1), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3ControllerNumber.setStatus('mandatory')
a3LogicalDriveNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3LogicalDriveNumber.setStatus('mandatory')
a3OperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 3), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3OperationalState.setStatus('mandatory')
a3RaidLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 4), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3RaidLevel.setStatus('mandatory')
a3WritePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 5), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3WritePolicy.setStatus('mandatory')
a3SizeInMb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 6), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3SizeInMb.setStatus('mandatory')
a3StripeSizeInBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 7), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3StripeSizeInBytes.setStatus('mandatory')
a3PhysicalDriveMap = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 3, 1, 8), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a3PhysicalDriveMap.setStatus('mandatory')
tPhyicalDeviceInformation = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4), )
if mibBuilder.loadTexts: tPhyicalDeviceInformation.setStatus('mandatory')
ePhyicalDeviceInformation = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a4ControllerNumber"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a4ScsiBusId"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a4ScsiTargetId"))
if mibBuilder.loadTexts: ePhyicalDeviceInformation.setStatus('mandatory')
a4ControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 1), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4ControllerNumber.setStatus('mandatory')
a4ScsiBusId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4ScsiBusId.setStatus('mandatory')
a4ScsiTargetId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 3), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4ScsiTargetId.setStatus('mandatory')
a4OperationalState = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 4), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4OperationalState.setStatus('mandatory')
a4VendorId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 5), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4VendorId.setStatus('mandatory')
a4ProductId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 6), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4ProductId.setStatus('mandatory')
a4ProductRevisionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 7), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4ProductRevisionLevel.setStatus('mandatory')
a4SizeInMb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 8), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4SizeInMb.setStatus('mandatory')
a4DeviceType = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 9), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4DeviceType.setStatus('mandatory')
a4SoftErrorsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 10), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4SoftErrorsCount.setStatus('mandatory')
a4HardErrorsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 11), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4HardErrorsCount.setStatus('mandatory')
a4ParityErrorsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 12), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4ParityErrorsCount.setStatus('mandatory')
a4MiscErrorsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 4, 1, 13), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a4MiscErrorsCount.setStatus('mandatory')
tMylexDac960ComponentInstrumentationInfo = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 5), )
if mibBuilder.loadTexts: tMylexDac960ComponentInstrumentationInfo.setStatus('mandatory')
eMylexDac960ComponentInstrumentationInfo = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 5, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"))
if mibBuilder.loadTexts: eMylexDac960ComponentInstrumentationInfo.setStatus('mandatory')
a5CiRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 5, 1, 1), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a5CiRevision.setStatus('mandatory')
a5CiBuildDate = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 5, 1, 2), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a5CiBuildDate.setStatus('mandatory')
a5MdacDeviceDriverRevision = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 5, 1, 3), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a5MdacDeviceDriverRevision.setStatus('mandatory')
a5MdacDeviceDriverBuildDate = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 5, 1, 4), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a5MdacDeviceDriverBuildDate.setStatus('mandatory')
tLogicalDriveStatistics = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6), )
if mibBuilder.loadTexts: tLogicalDriveStatistics.setStatus('mandatory')
eLogicalDriveStatistics = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a6ControllerNumber"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a6LogicalDriveNumber"))
if mibBuilder.loadTexts: eLogicalDriveStatistics.setStatus('mandatory')
a6ControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 1), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6ControllerNumber.setStatus('mandatory')
a6LogicalDriveNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6LogicalDriveNumber.setStatus('mandatory')
a6ReadRequestsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 3), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6ReadRequestsCount.setStatus('mandatory')
a6AmountOfDataReadInMb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 4), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6AmountOfDataReadInMb.setStatus('mandatory')
a6WriteRequestsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 5), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6WriteRequestsCount.setStatus('mandatory')
a6AmountOfDataWrittenInMb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 6), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6AmountOfDataWrittenInMb.setStatus('mandatory')
a6ReadCacheHit = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 6, 1, 7), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a6ReadCacheHit.setStatus('mandatory')
tPhysicalDriveStatistics = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7), )
if mibBuilder.loadTexts: tPhysicalDriveStatistics.setStatus('mandatory')
ePhysicalDriveStatistics = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a7ControllerNumber"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a7ScsiBusId"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a7ScsiTargetId"))
if mibBuilder.loadTexts: ePhysicalDriveStatistics.setStatus('mandatory')
a7ControllerNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 1), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7ControllerNumber.setStatus('mandatory')
a7ScsiBusId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7ScsiBusId.setStatus('mandatory')
a7ScsiTargetId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 3), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7ScsiTargetId.setStatus('mandatory')
a7ReadRequestsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 4), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7ReadRequestsCount.setStatus('mandatory')
a7AmountOfDataReadInKb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 5), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7AmountOfDataReadInKb.setStatus('mandatory')
a7WriteRequestsCount = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 6), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7WriteRequestsCount.setStatus('mandatory')
a7AmountOfDataWrittenInKb = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 7, 1, 7), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a7AmountOfDataWrittenInKb.setStatus('mandatory')
tErrorControl = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98), )
if mibBuilder.loadTexts: tErrorControl.setStatus('mandatory')
eErrorControl = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"), (0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a98Selfid"))
if mibBuilder.loadTexts: eErrorControl.setStatus('mandatory')
a98Selfid = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 1), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98Selfid.setStatus('mandatory')
a98NumberOfFatalErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 2), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98NumberOfFatalErrors.setStatus('mandatory')
a98NumberOfMajorErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 3), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98NumberOfMajorErrors.setStatus('mandatory')
a98NumberOfWarnings = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 4), DmiCounter()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98NumberOfWarnings.setStatus('mandatory')
a98ErrorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("vOk", 0), ("vWarning", 1), ("vMajor", 2), ("vFatal", 3), ("vInformational", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98ErrorStatus.setStatus('mandatory')
a98ErrorStatusType = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("vPost", 0), ("vRuntime", 1), ("vDiagnosticTest", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98ErrorStatusType.setStatus('mandatory')
a98AlarmGeneration = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 98, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("vOff", 0), ("vOn", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: a98AlarmGeneration.setStatus('mandatory')
tMiftomib = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 99), )
if mibBuilder.loadTexts: tMiftomib.setStatus('mandatory')
eMiftomib = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 99, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"))
if mibBuilder.loadTexts: eMiftomib.setStatus('mandatory')
a99MibName = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 99, 1, 1), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a99MibName.setStatus('mandatory')
a99MibOid = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 99, 1, 2), DmiDisplaystring()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a99MibOid.setStatus('mandatory')
a99DisableTrap = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 99, 1, 3), DmiInteger()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: a99DisableTrap.setStatus('mandatory')
tTrapGroup = MibTable((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999), )
if mibBuilder.loadTexts: tTrapGroup.setStatus('mandatory')
eTrapGroup = MibTableRow((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1), ).setIndexNames((0, "MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "DmiComponentIndex"))
if mibBuilder.loadTexts: eTrapGroup.setStatus('mandatory')
a9999ErrorTime = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ErrorTime.setStatus('mandatory')
a9999ErrorStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 2), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ErrorStatus.setStatus('mandatory')
a9999ErrorGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 3), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ErrorGroupId.setStatus('mandatory')
a9999ErrorInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 4), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ErrorInstanceId.setStatus('mandatory')
a9999ComponentId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 5), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ComponentId.setStatus('mandatory')
a9999GroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 6), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999GroupId.setStatus('mandatory')
a9999InstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 7), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999InstanceId.setStatus('mandatory')
a9999VendorCode1 = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 8), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999VendorCode1.setStatus('mandatory')
a9999VendorCode2 = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 9), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999VendorCode2.setStatus('mandatory')
a9999VendorText = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 10), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999VendorText.setStatus('mandatory')
a9999ParentGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 11), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ParentGroupId.setStatus('mandatory')
a9999ParentInstanceId = MibTableColumn((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1, 12), DmiInteger()).setMaxAccess("readonly")
if mibBuilder.loadTexts: a9999ParentInstanceId.setStatus('mandatory')
mdacEventError = NotificationType((1, 3, 6, 1, 4, 1, 1608, 3, 2, 1, 9999, 1) + (0,1)).setObjects(("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ErrorTime"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ErrorStatus"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ErrorGroupId"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ErrorInstanceId"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ComponentId"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999GroupId"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999InstanceId"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999VendorCode1"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999VendorCode2"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999VendorText"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ParentGroupId"), ("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", "a9999ParentInstanceId"))
mibBuilder.exportSymbols("MYLEXDAC960SCSIRAIDCONTROLLER-MIB", eErrorControl=eErrorControl, a3OperationalState=a3OperationalState, a2MaximumConcurrentCommands=a2MaximumConcurrentCommands, a2SlotNumber=a2SlotNumber, a6ReadRequestsCount=a6ReadRequestsCount, a9999GroupId=a9999GroupId, a9999ParentInstanceId=a9999ParentInstanceId, tErrorControl=tErrorControl, a9999ErrorGroupId=a9999ErrorGroupId, a98ErrorStatus=a98ErrorStatus, a2OperationalState=a2OperationalState, a3SizeInMb=a3SizeInMb, a98NumberOfFatalErrors=a98NumberOfFatalErrors, DmiInteger=DmiInteger, a4HardErrorsCount=a4HardErrorsCount, dmtfGroups=dmtfGroups, mdacEventError=mdacEventError, a4DeviceType=a4DeviceType, a6ReadCacheHit=a6ReadCacheHit, a98Selfid=a98Selfid, a2MaximumLogicalDrives=a2MaximumLogicalDrives, a5CiRevision=a5CiRevision, a5MdacDeviceDriverBuildDate=a5MdacDeviceDriverBuildDate, a9999ErrorStatus=a9999ErrorStatus, a2PhysicalSectorSizeInBytes=a2PhysicalSectorSizeInBytes, a3LogicalDriveNumber=a3LogicalDriveNumber, a7AmountOfDataWrittenInKb=a7AmountOfDataWrittenInKb, eLogicalDriveStatistics=eLogicalDriveStatistics, v2=v2, a6AmountOfDataReadInMb=a6AmountOfDataReadInMb, DmiComponentIndex=DmiComponentIndex, a9999VendorCode2=a9999VendorCode2, tLogicalDriveInformation=tLogicalDriveInformation, a98NumberOfMajorErrors=a98NumberOfMajorErrors, a6ControllerNumber=a6ControllerNumber, eControllerInformation=eControllerInformation, a1Version=a1Version, a7ReadRequestsCount=a7ReadRequestsCount, tMiftomib=tMiftomib, ePhysicalDriveStatistics=ePhysicalDriveStatistics, a2BusType=a2BusType, a1Installation=a1Installation, a3RaidLevel=a3RaidLevel, a2InterruptMode=a2InterruptMode, a3ControllerNumber=a3ControllerNumber, a7ScsiTargetId=a7ScsiTargetId, a4ScsiBusId=a4ScsiBusId, a5CiBuildDate=a5CiBuildDate, a5MdacDeviceDriverRevision=a5MdacDeviceDriverRevision, a9999InstanceId=a9999InstanceId, a2RebuildRate=a2RebuildRate, a4VendorId=a4VendorId, a6AmountOfDataWrittenInMb=a6AmountOfDataWrittenInMb, tPhysicalDriveStatistics=tPhysicalDriveStatistics, a99MibOid=a99MibOid, a4SoftErrorsCount=a4SoftErrorsCount, tPhyicalDeviceInformation=tPhyicalDeviceInformation, a2MaximumDataTransferSizePerIoRequestInK=a2MaximumDataTransferSizePerIoRequestInK, a1Verify=a1Verify, a99MibName=a99MibName, a1SerialNumber=a1SerialNumber, a4ProductRevisionLevel=a4ProductRevisionLevel, a6LogicalDriveNumber=a6LogicalDriveNumber, a9999ParentGroupId=a9999ParentGroupId, tTrapGroup=tTrapGroup, a2InterruptVectorNumber=a2InterruptVectorNumber, a1Manufacturer=a1Manufacturer, a2SystemBusNumber=a2SystemBusNumber, a4OperationalState=a4OperationalState, a2CacheLineSizeInBytes=a2CacheLineSizeInBytes, DmiDateX=DmiDateX, a2ActualChannels=a2ActualChannels, a1Product=a1Product, mib=mib, DmiCounter=DmiCounter, eLogicalDriveInformation=eLogicalDriveInformation, a7AmountOfDataReadInKb=a7AmountOfDataReadInKb, a98NumberOfWarnings=a98NumberOfWarnings, a3PhysicalDriveMap=a3PhysicalDriveMap, a7ControllerNumber=a7ControllerNumber, ePhyicalDeviceInformation=ePhyicalDeviceInformation, a9999VendorText=a9999VendorText, a4ControllerNumber=a4ControllerNumber, a4SizeInMb=a4SizeInMb, a98AlarmGeneration=a98AlarmGeneration, tComponentid=tComponentid, a2LogicalSectorSizeInBytes=a2LogicalSectorSizeInBytes, eMiftomib=eMiftomib, a2MaximumTargetsPerChannel=a2MaximumTargetsPerChannel, a3StripeSizeInBytes=a3StripeSizeInBytes, a9999ErrorTime=a9999ErrorTime, a98ErrorStatusType=a98ErrorStatusType, a2ControllerNumber=a2ControllerNumber, tControllerInformation=tControllerInformation, eComponentid=eComponentid, a4ProductId=a4ProductId, a4MiscErrorsCount=a4MiscErrorsCount, eTrapGroup=eTrapGroup, tLogicalDriveStatistics=tLogicalDriveStatistics, a2MaximumTaggedRequests=a2MaximumTaggedRequests, a99DisableTrap=a99DisableTrap, a9999ComponentId=a9999ComponentId, a2ConfiguredChannels=a2ConfiguredChannels, tMylexDac960ComponentInstrumentationInfo=tMylexDac960ComponentInstrumentationInfo, DmiDisplaystring=DmiDisplaystring, a2FirmwareRevision=a2FirmwareRevision, a9999VendorCode1=a9999VendorCode1, eMylexDac960ComponentInstrumentationInfo=eMylexDac960ComponentInstrumentationInfo, a7WriteRequestsCount=a7WriteRequestsCount, a4ScsiTargetId=a4ScsiTargetId, a7ScsiBusId=a7ScsiBusId, a3WritePolicy=a3WritePolicy, a2DramSizeInMb=a2DramSizeInMb, a9999ErrorInstanceId=a9999ErrorInstanceId, a6WriteRequestsCount=a6WriteRequestsCount, a2EpromSizeInKb=a2EpromSizeInKb, a4ParityErrorsCount=a4ParityErrorsCount, mylex=mylex)
| 113.18254 | 4,429 | 0.763761 | 3,155 | 28,522 | 6.904596 | 0.078922 | 0.012578 | 0.01749 | 0.020749 | 0.425588 | 0.407088 | 0.358336 | 0.355307 | 0.204324 | 0.161357 | 0 | 0.104146 | 0.08667 | 28,522 | 251 | 4,430 | 113.633466 | 0.732092 | 0.012622 | 0 | 0.016736 | 0 | 0 | 0.138031 | 0.043335 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.016736 | 0.025105 | 0 | 0.054393 | 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 |
6e2d95c8de50c7217c323ed32c6a95c6f654b258 | 427 | py | Python | rl/environments/demo.py | minhquang4334/mfeaii-ann-rl | d954ef4fdb3c39a4d3f3eb57d445c99bee46f7cc | [
"MIT"
] | 2 | 2020-04-07T04:48:45.000Z | 2020-04-21T07:12:41.000Z | rl/environments/demo.py | minhquang4334/mfeaii-ann-rl | d954ef4fdb3c39a4d3f3eb57d445c99bee46f7cc | [
"MIT"
] | null | null | null | rl/environments/demo.py | minhquang4334/mfeaii-ann-rl | d954ef4fdb3c39a4d3f3eb57d445c99bee46f7cc | [
"MIT"
] | null | null | null | import gym
from cartpole import CartPoleEnv
env = CartPoleEnv()
observation = env.reset()
total_reward = 0
print(env.observation_space)
print(env.observation_space.high)
print(env.observation_space.low)
for t in range(200):
env.render()
action = env.action_space.sample()
observation, reward, done, info = env.step(action)
total_reward += reward
if done:
break
env.close()
print(total_reward) | 17.791667 | 54 | 0.721311 | 58 | 427 | 5.189655 | 0.5 | 0.109635 | 0.189369 | 0.239203 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011331 | 0.173302 | 427 | 24 | 55 | 17.791667 | 0.84136 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.117647 | 0 | 0.117647 | 0.235294 | 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 |
6e4f138956cbe8df5fe33531563a9b206fa8ad40 | 89 | py | Python | processor/AutoReplyDict.py | wodo2008/myWxbot | 1a92a5479e9f7412eb8cf222689b8f13b0307d67 | [
"Apache-2.0"
] | null | null | null | processor/AutoReplyDict.py | wodo2008/myWxbot | 1a92a5479e9f7412eb8cf222689b8f13b0307d67 | [
"Apache-2.0"
] | null | null | null | processor/AutoReplyDict.py | wodo2008/myWxbot | 1a92a5479e9f7412eb8cf222689b8f13b0307d67 | [
"Apache-2.0"
] | null | null | null | StageDict = {
"welcome":"welcome",
"hasImg":"hasImg",
"registed":"registed"
} | 17.8 | 25 | 0.573034 | 7 | 89 | 7.285714 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.202247 | 89 | 5 | 26 | 17.8 | 0.71831 | 0 | 0 | 0 | 0 | 0 | 0.466667 | 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 |
282705e4cb48eb816f234ffa6e7c9afc3ac3fb26 | 1,330 | gyp | Python | modules/remote_bitrate_estimator/remote_bitrate_estimator_components.gyp | PersonifyInc/chromium_webrtc | cbe631e63f00ff1b2860891e06793f23244e8ae5 | [
"DOC",
"BSD-3-Clause"
] | null | null | null | modules/remote_bitrate_estimator/remote_bitrate_estimator_components.gyp | PersonifyInc/chromium_webrtc | cbe631e63f00ff1b2860891e06793f23244e8ae5 | [
"DOC",
"BSD-3-Clause"
] | null | null | null | modules/remote_bitrate_estimator/remote_bitrate_estimator_components.gyp | PersonifyInc/chromium_webrtc | cbe631e63f00ff1b2860891e06793f23244e8ae5 | [
"DOC",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'includes': [
'../../../webrtc/build/common.gypi',
],
'targets': [
{
'target_name': 'rbe_components',
'type': 'static_library',
'include_dirs': [
'<(webrtc_root)/modules/remote_bitrate_estimator',
],
'sources': [
'<(webrtc_root)/modules/remote_bitrate_estimator/test/bwe_test_logging.cc',
'<(webrtc_root)/modules/remote_bitrate_estimator/test/bwe_test_logging.h',
'aimd_rate_control.cc',
'aimd_rate_control.h',
'inter_arrival.cc',
'inter_arrival.h',
'mimd_rate_control.cc',
'mimd_rate_control.h',
'overuse_detector.cc',
'overuse_detector.h',
'overuse_estimator.cc',
'overuse_estimator.h',
'remote_bitrate_estimator_abs_send_time.cc',
'remote_bitrate_estimator_single_stream.cc',
'remote_rate_control.cc',
'remote_rate_control.h',
],
},
],
}
| 31.666667 | 83 | 0.651128 | 167 | 1,330 | 4.922156 | 0.449102 | 0.080292 | 0.13382 | 0.043796 | 0.290754 | 0.254258 | 0.206813 | 0.206813 | 0.138686 | 0.138686 | 0 | 0.00391 | 0.230827 | 1,330 | 41 | 84 | 32.439024 | 0.799609 | 0.284211 | 0 | 0.125 | 0 | 0 | 0.646186 | 0.368644 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
28293ab6b0fe1a042d7c9996569fcc65b2ead5d6 | 931 | py | Python | 2018-robot/robot/components/winch.py | NathanielHorne/2018-tank | 57f64ab52c1dd641ea78aabfde388a32d3b51bbf | [
"MIT"
] | null | null | null | 2018-robot/robot/components/winch.py | NathanielHorne/2018-tank | 57f64ab52c1dd641ea78aabfde388a32d3b51bbf | [
"MIT"
] | null | null | null | 2018-robot/robot/components/winch.py | NathanielHorne/2018-tank | 57f64ab52c1dd641ea78aabfde388a32d3b51bbf | [
"MIT"
] | null | null | null | import wpilib
from magicbot import will_reset_to
class Winch:
"""
Operate robot winch.
"""
winch_motors: wpilib.SpeedControllerGroup
winch_lock: wpilib.Solenoid
_climb_speed = will_reset_to(0)
def run(self, speed: float=1):
"""
Set the motor speed of each climbing motor.
:param speed: The requested speed, between -1 and 1.
"""
self._climb_speed = speed
# TODO: Check that these states aren't inverted.
def unlock(self):
"""
Release dog.
"""
self.winch_lock.set(False)
def lock(self):
"""
Hold dog.
"""
self.winch_lock.set(True)
def actuate(self):
"""
Actuate dog.
"""
self.winch_lock.set(not self.winch_lock.get())
def execute(self):
"""
Run climbing motors.
"""
self.winch_motors.set(self._climb_speed)
| 20.23913 | 60 | 0.560687 | 109 | 931 | 4.633028 | 0.46789 | 0.089109 | 0.10297 | 0.09505 | 0.112871 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006431 | 0.331901 | 931 | 45 | 61 | 20.688889 | 0.805466 | 0.239527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022222 | 0 | 1 | 0.3125 | false | 0 | 0.125 | 0 | 0.6875 | 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 |
282a4035267ecfb0e506c1c8c2788ea6af08a0c2 | 178 | py | Python | curso-python/exercicios/exercicio-005.py | thiagoAlexandre3/cursos-auto-didata | 2afb4f4bfe4a5622f2b5a9a5adbdc7e495ddf772 | [
"MIT"
] | null | null | null | curso-python/exercicios/exercicio-005.py | thiagoAlexandre3/cursos-auto-didata | 2afb4f4bfe4a5622f2b5a9a5adbdc7e495ddf772 | [
"MIT"
] | null | null | null | curso-python/exercicios/exercicio-005.py | thiagoAlexandre3/cursos-auto-didata | 2afb4f4bfe4a5622f2b5a9a5adbdc7e495ddf772 | [
"MIT"
] | null | null | null | n1 = int(input('Digite um número: '));
antecessor = n1 - 1;
sucessor = n1 + 1;
print('O antecessor do número {}, é: {}, e seu sucessor é: {}.'.format(n1, antecessor, sucessor));
| 35.6 | 98 | 0.629213 | 26 | 178 | 4.307692 | 0.615385 | 0.053571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040541 | 0.168539 | 178 | 4 | 99 | 44.5 | 0.716216 | 0 | 0 | 0 | 0 | 0 | 0.410112 | 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 |
284414b3ff7fe8b2d27a94bd6dfd902d38b458a0 | 63 | py | Python | vendor/separatedvaluesfield/__init__.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 18 | 2017-04-16T15:15:22.000Z | 2022-01-31T05:05:57.000Z | vendor/separatedvaluesfield/__init__.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 85 | 2019-04-24T10:39:35.000Z | 2022-03-21T14:52:12.000Z | vendor/separatedvaluesfield/__init__.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 10 | 2017-08-30T09:06:30.000Z | 2021-07-23T10:40:46.000Z | version = (0, 6, 0)
__version__ = '.'.join(map(str, version))
| 15.75 | 41 | 0.603175 | 9 | 63 | 3.777778 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.056604 | 0.15873 | 63 | 3 | 42 | 21 | 0.584906 | 0 | 0 | 0 | 0 | 0 | 0.015873 | 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 |
284762452ca3f34831d00917510895007a45a306 | 811 | py | Python | adapters/file_adapter.py | pjkostrzewski/kanonierzy | 9b5cc95d5a6ddcb7fc647b16373f54f9c0bca21d | [
"MIT"
] | null | null | null | adapters/file_adapter.py | pjkostrzewski/kanonierzy | 9b5cc95d5a6ddcb7fc647b16373f54f9c0bca21d | [
"MIT"
] | null | null | null | adapters/file_adapter.py | pjkostrzewski/kanonierzy | 9b5cc95d5a6ddcb7fc647b16373f54f9c0bca21d | [
"MIT"
] | null | null | null | import json
import datetime
class FileAdapter:
encoding = "utf-8"
def __init__(self, filename="results.json"):
self.filename = filename
@staticmethod
def datetime_converter(something):
if isinstance(something, datetime.datetime):
return something.timestamp()
def save(self, data):
self._save_to_file(data=data, mode='w')
def append(self, data):
self._save_to_file(data=data, mode='a')
def read_file(self):
with open(self.filename, 'r') as json_file:
data = json.load(json_file)
return data
def _save_to_file(self, data, mode='w'):
with open(self.filename, mode, encoding=self.encoding) as outfile:
json.dump(data, outfile, default=self.datetime_converter, ensure_ascii=False) | 27.965517 | 89 | 0.649815 | 103 | 811 | 4.932039 | 0.38835 | 0.094488 | 0.059055 | 0.062992 | 0.133858 | 0.133858 | 0.133858 | 0.133858 | 0.133858 | 0 | 0 | 0.001621 | 0.239211 | 811 | 29 | 89 | 27.965517 | 0.821718 | 0 | 0 | 0 | 0 | 0 | 0.025862 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.095238 | 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 |
2866b65a57868200d0cdf39220a2821bad098dec | 1,245 | py | Python | Variants/Base.py | abhinav-mk/War-Game | d18a9f9a44f987cba3fe3f93fe8cec2afe950db4 | [
"MIT"
] | null | null | null | Variants/Base.py | abhinav-mk/War-Game | d18a9f9a44f987cba3fe3f93fe8cec2afe950db4 | [
"MIT"
] | null | null | null | Variants/Base.py | abhinav-mk/War-Game | d18a9f9a44f987cba3fe3f93fe8cec2afe950db4 | [
"MIT"
] | null | null | null | class Base():
"""
This class represents the base variation of the game upon which other variations can be
built, utilizing the functionalities of this class.
If the superclass does not override all of these functions in this class, an error is
thrown.
"""
def __init__(self, players):
raise NotImplementedError
def play_a_round(self, players=None):
"""
Override this function in the superclass implementing a round of the game with players
and deck
"""
raise NotImplementedError
def end_game_reached(self):
"""
Override this function in the superclass to define the condition which states that the
game is over and the winner is declared
"""
raise NotImplementedError
def get_winner(self):
"""
Override this function in the superclass to return the winner of the game when called
"""
raise NotImplementedError
def remove_players_lost(self):
"""
Override this function in the superclass to cleanup the players who lose the game either
by losing all the cards or the losing condition defined in the variation
"""
raise NotImplementedError | 34.583333 | 96 | 0.66506 | 157 | 1,245 | 5.203822 | 0.44586 | 0.04284 | 0.132191 | 0.107711 | 0.19339 | 0.19339 | 0.150551 | 0.150551 | 0 | 0 | 0 | 0 | 0.290763 | 1,245 | 36 | 97 | 34.583333 | 0.925255 | 0.566265 | 0 | 0.454545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.454545 | false | 0 | 0 | 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 |
28721df4b73e2e7cf00954b58c0bc1a809dc89db | 217 | py | Python | deuce/tests/test_health.py | BenjamenMeyer/deuce | fbca31cb5248a808a85bfc24af10119453359276 | [
"Apache-2.0"
] | null | null | null | deuce/tests/test_health.py | BenjamenMeyer/deuce | fbca31cb5248a808a85bfc24af10119453359276 | [
"Apache-2.0"
] | null | null | null | deuce/tests/test_health.py | BenjamenMeyer/deuce | fbca31cb5248a808a85bfc24af10119453359276 | [
"Apache-2.0"
] | null | null | null | import falcon
from deuce.tests import V1Base
class TestHealth(V1Base):
def test_health(self):
response = self.simulate_get('/v1.0/health')
self.assertEqual(self.srmock.status, falcon.HTTP_200)
| 19.727273 | 61 | 0.714286 | 29 | 217 | 5.241379 | 0.758621 | 0.131579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039326 | 0.179724 | 217 | 10 | 62 | 21.7 | 0.814607 | 0 | 0 | 0 | 0 | 0 | 0.0553 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
2877563c7abd68d7102403d762b46bf85fb669a2 | 189 | py | Python | cvat/apps/opencv/urls.py | gitibharatibiswal/cvat-adas-team | a33c1ae38d79ed6e35a61a97b74cd2978853e4c2 | [
"Intel",
"MIT"
] | 4,197 | 2018-06-30T05:47:50.000Z | 2020-09-08T07:34:22.000Z | cvat/apps/opencv/urls.py | nav13n/cvat | 9bdcc7f8f2d86a763ab5f306ea049ce1432da557 | [
"Intel",
"MIT"
] | 2,049 | 2020-09-08T10:01:10.000Z | 2022-03-31T19:08:15.000Z | cvat/apps/opencv/urls.py | nav13n/cvat | 9bdcc7f8f2d86a763ab5f306ea049ce1432da557 | [
"Intel",
"MIT"
] | 1,253 | 2018-06-30T05:47:58.000Z | 2020-09-08T02:19:52.000Z |
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
from django.urls import path
from . import views
urlpatterns = [
path('opencv.js', views.OpenCVLibrary)
]
| 17.181818 | 43 | 0.730159 | 24 | 189 | 5.75 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050314 | 0.15873 | 189 | 10 | 44 | 18.9 | 0.81761 | 0.37037 | 0 | 0 | 0 | 0 | 0.078947 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
288dd0465591f32ee16b06e0841df663525d7b2c | 827 | py | Python | ae5_tools/cli/commands/pod.py | Anaconda-Platform/ae5-tools | 35b5ce1c8add16954c3c3a723e54f1ac9cec10dc | [
"BSD-3-Clause"
] | 8 | 2019-07-21T09:07:03.000Z | 2022-01-24T15:13:00.000Z | ae5_tools/cli/commands/pod.py | Anaconda-Platform/ae5-tools | 35b5ce1c8add16954c3c3a723e54f1ac9cec10dc | [
"BSD-3-Clause"
] | 82 | 2019-06-18T14:12:43.000Z | 2022-01-25T18:52:29.000Z | ae5_tools/cli/commands/pod.py | Anaconda-Platform/ae5-tools | 35b5ce1c8add16954c3c3a723e54f1ac9cec10dc | [
"BSD-3-Clause"
] | 4 | 2019-06-20T20:36:12.000Z | 2021-06-02T17:06:46.000Z | import sys
import click
from ..login import cluster_call
from ..utils import add_param, ident_filter, global_options
@click.group(short_help='info, list',
epilog='Type "ae5 user <command> --help" for help on a specific command.')
@global_options
def pod():
'''Commands related to the AE5 pods (sessions, deployments, runs).
These commands require that either K8S deployment to be live on the platform,
or the --k8s-ssh-user option be supplied with a valid username.
'''
pass
@pod.command()
@ident_filter('pod')
@global_options
def list(**kwargs):
'''List all nodes.'''
cluster_call('pod_list', **kwargs)
@pod.command()
@ident_filter('pod', required=True)
@global_options
def info(**kwargs):
'''Get information about a specific pod.'''
cluster_call('pod_info', **kwargs)
| 24.323529 | 87 | 0.696493 | 116 | 827 | 4.844828 | 0.543103 | 0.092527 | 0.085409 | 0.074733 | 0.085409 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005865 | 0.175333 | 827 | 33 | 88 | 25.060606 | 0.818182 | 0.314389 | 0 | 0.263158 | 0 | 0 | 0.178439 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157895 | true | 0.052632 | 0.210526 | 0 | 0.368421 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
28a16a0b938d5a91da4022a373dfdf422c11cd3b | 203 | py | Python | scripts/run_tests.py | bozhnyukAlex/high-performance-graph-analysis-course | 13d4de4257a59d03c585896ee89011d6a4adc58f | [
"Apache-2.0"
] | 1 | 2021-11-14T01:04:17.000Z | 2021-11-14T01:04:17.000Z | scripts/run_tests.py | bozhnyukAlex/high-performance-graph-analysis-course | 13d4de4257a59d03c585896ee89011d6a4adc58f | [
"Apache-2.0"
] | 9 | 2021-09-01T12:01:23.000Z | 2021-11-25T12:25:10.000Z | scripts/run_tests.py | miloserdova-l/formal-lang-course | 042e1b381a8ea96a7602fb876e20cdb6506044ac | [
"Apache-2.0"
] | 12 | 2021-08-30T11:40:04.000Z | 2022-03-04T07:06:15.000Z | import subprocess
import shared
def main():
shared.configure_python_path()
subprocess.check_call(["python", "-m", "py.test", "-vv", "-s", shared.TESTS])
if __name__ == "__main__":
main()
| 16.916667 | 81 | 0.64532 | 25 | 203 | 4.8 | 0.72 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.167488 | 203 | 11 | 82 | 18.454545 | 0.710059 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | true | 0 | 0.285714 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9544e6747daa8a581c7a3cf339a051025a4cb4dc | 603 | py | Python | tests/basic_stages/test_freq_drop.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 438 | 2017-03-02T16:55:34.000Z | 2019-12-20T03:29:36.000Z | tests/basic_stages/test_freq_drop.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 68 | 2019-12-21T12:51:51.000Z | 2022-03-13T13:06:14.000Z | tests/basic_stages/test_freq_drop.py | DavidKatz-il/pdpipe | 5ddd066425d99886bfc51cf19ab78b2bf8c7791a | [
"MIT"
] | 30 | 2019-12-21T12:18:18.000Z | 2022-03-17T05:53:19.000Z | """Testing basic pipeline stages."""
import pandas as pd
from pdpipe.basic_stages import FreqDrop
DF1 = pd.DataFrame([[1, 4], [4, 5], [1, 11]], [1, 2, 3], ['a', 'b'])
def test_freqdrop_basic():
"""Testing the FreqDrop pipeline stage."""
res_df = FreqDrop(2, 'a').apply(DF1)
assert 1 in res_df.index
assert 2 not in res_df.index
assert 3 in res_df.index
def test_freqdrop_verbose():
"""Testing the FreqDrop pipeline stage."""
res_df = FreqDrop(2, 'a').apply(DF1, verbose=True)
assert 1 in res_df.index
assert 2 not in res_df.index
assert 3 in res_df.index
| 24.12 | 68 | 0.658375 | 100 | 603 | 3.84 | 0.34 | 0.104167 | 0.109375 | 0.1875 | 0.59375 | 0.59375 | 0.59375 | 0.59375 | 0.59375 | 0.59375 | 0 | 0.043659 | 0.202322 | 603 | 24 | 69 | 25.125 | 0.754678 | 0.172471 | 0 | 0.461538 | 0 | 0 | 0.008282 | 0 | 0 | 0 | 0 | 0 | 0.461538 | 1 | 0.153846 | false | 0 | 0.153846 | 0 | 0.307692 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
954b374e2d7ffa7c2ea9bd5a9fa7c3e20441f551 | 1,382 | gyp | Python | binding.gyp | LabTIC/ftdi | 7ab6c73b4f8b3fc8469b926555907c39e794a297 | [
"MIT"
] | null | null | null | binding.gyp | LabTIC/ftdi | 7ab6c73b4f8b3fc8469b926555907c39e794a297 | [
"MIT"
] | null | null | null | binding.gyp | LabTIC/ftdi | 7ab6c73b4f8b3fc8469b926555907c39e794a297 | [
"MIT"
] | null | null | null | {
'targets': [
{
'target_name': 'ftdi_labtic',
'sources':
[
'src/ftdi_device.cc',
'src/ftdi_driver.cc'
],
'include_dirs+':
[
'src/',
],
'conditions':
[
['OS == "win"',
{
'include_dirs+':
[
'lib/'
],
'link_settings':
{
"conditions" :
[
["target_arch=='ia32'",
{
'libraries':
[
'-l<(module_root_dir)/lib/i386/ftd2xx.lib',
'-l<(module_root_dir)/lib/i386/FTChipID.lib'
]
}
],
["target_arch=='x64'", {
'libraries': [
'-l<(module_root_dir)/lib/amd64/ftd2xx.lib',
'-l<(module_root_dir)/lib/amd64/FTChipID.lib'
]
}]
]
}
}],
['OS != "win"',
{
'include_dirs+': [
'/usr/local/include/libftd2xx/'
],
'ldflags': [
'-Wl,-Map=output.map',
],
'link_settings': {
'libraries': [
'-lftd2xx'
]
}
}
]
],
}
]
}
| 21.936508 | 64 | 0.295224 | 83 | 1,382 | 4.686747 | 0.457831 | 0.071979 | 0.113111 | 0.143959 | 0.313625 | 0.313625 | 0.133676 | 0 | 0 | 0 | 0 | 0.029316 | 0.555716 | 1,382 | 62 | 65 | 22.290323 | 0.604235 | 0 | 0 | 0.177419 | 0 | 0 | 0.347323 | 0.1411 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
954e7c0450822475108975e6dc4d19144a41c46b | 3,826 | py | Python | group-project/main.py | cesarrodrig/data-mining | b072a6469a548de122b3bac833f8bcb6c0940b03 | [
"MIT"
] | null | null | null | group-project/main.py | cesarrodrig/data-mining | b072a6469a548de122b3bac833f8bcb6c0940b03 | [
"MIT"
] | null | null | null | group-project/main.py | cesarrodrig/data-mining | b072a6469a548de122b3bac833f8bcb6c0940b03 | [
"MIT"
] | null | null | null | import csv
from collections import defaultdict
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.colors as colors
class Student(object):
def __init__(self, id, registration_year):
self.id = id
super(Student, self).__init__()
self.registration_year = registration_year
self.course_records = {}
def add_course(self, course):
if course.code not in self.course_records or course.final_grade > self.course_records[course.code].final_grade:
self.course_records[course.code] = course
def all_courses(self):
return [ course.code for course in self.course_records.values() ]
class CourseRecord(object):
def __init__(self, strings):
super(CourseRecord, self).__init__()
self.start_date = datetime.strptime(strings[0], "%Y-%m")
self.code = int(strings[1])
self.name = strings[2]
self.credits = strings[3]
self.final_grade = int(strings[4])
FILE_NAME = "data-2016.csv"
students = []
course_code_to_name = {}
inverted_index = defaultdict(set) # course to student ids
with open(FILE_NAME, "rb") as csvfile:
reader = csv.reader(csvfile, delimiter=" ")
r = 0
for row in reader:
student = Student(r, row[0])
for i in range(1, len(row), 5):
course = CourseRecord(row[i:i+5])
student.add_course(course)
course_code_to_name[course.code] = course.name
inverted_index[course.code].add(r)
r += 1
students.append(student)
def get_courses_taken_before(course_records, datetime):
return filter(lambda c: c.start_date < datetime and c.final_grade > 0, course_records)
def get_support_counts(students, target_course_code):
# we get all pairs (x, target_course)
# where target_course.date > x.date
passed_support_count = defaultdict(int)
failed_support_count = defaultdict(int)
total_count = 0
for student in students:
# if student took the target course
if target_course_code not in student.course_records:
continue
total_count += 1
course_record = student.course_records[target_course_code]
courses_taken_before = get_courses_taken_before(student.course_records.values(), course_record.start_date)
course_pairs = [course.code for course in courses_taken_before]
if course_record.final_grade > 0:
for pair in course_pairs:
passed_support_count[pair] += 1
else:
for pair in course_pairs:
failed_support_count[pair] += 1
return passed_support_count, failed_support_count, total_count
def courses_that_help(students, target_course_code, min_support=0.0):
# we get all pairs (x, target_course)
# where target_course.date > x.date and target_course.grade > 0
passed, failed, n = get_support_counts(students, target_course_code)
passed_support = []
failed_support = []
n = float(len(students))
for course_code, count in passed.items():
if count/n > min_support:
passed_support.append((course_code, count/n))
for course_code, count in failed.items():
if count/n > min_support:
failed_support.append((course_code, count/n))
passed_support = sorted(passed_support, key=lambda x: x[1], reverse=True)
failed_support = sorted(failed_support, key=lambda x: x[1], reverse=True)
return passed_support, failed_support
target_course_code = 581259
passed_support, failed_support = courses_that_help(students, target_course_code, 0.05)
print "Top ten courses to pass", course_code_to_name[target_course_code]
for course_code, support in passed_support[:10]:
print course_code_to_name[course_code], support
| 34.781818 | 119 | 0.692368 | 524 | 3,826 | 4.791985 | 0.223282 | 0.099562 | 0.050976 | 0.025488 | 0.268419 | 0.219833 | 0.157706 | 0.065313 | 0.041418 | 0.041418 | 0 | 0.012354 | 0.217198 | 3,826 | 109 | 120 | 35.100917 | 0.826043 | 0.058285 | 0 | 0.049383 | 0 | 0 | 0.012236 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.148148 | 0.08642 | null | null | 0.024691 | 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 |
95534394430408e34297333fef63be6d361ed6cd | 3,400 | py | Python | src/servicenow/ServiceNow.py | theabgupta/python-servicenow | 1a966ddf7f017c188e4c193b54884009a832bb22 | [
"Apache-2.0"
] | 76 | 2015-02-04T17:49:49.000Z | 2021-08-06T15:45:04.000Z | src/servicenow/ServiceNow.py | dbreddyAI/python-servicenow | a5b8c172ff481147e020c1a76afad65d89c414bb | [
"Apache-2.0"
] | 23 | 2015-01-26T21:43:26.000Z | 2020-07-13T12:26:01.000Z | src/servicenow/ServiceNow.py | dbreddyAI/python-servicenow | a5b8c172ff481147e020c1a76afad65d89c414bb | [
"Apache-2.0"
] | 41 | 2015-01-23T15:36:55.000Z | 2022-03-10T12:23:20.000Z | from servicenow import Utils
ttl_cache=0
class Base(object):
__table__ = None
def __init__(self, Connection):
self.Connection = Connection
@Utils.cached(ttl=ttl_cache)
def list_by_query(self, query, **kwargs):
return self.format(self.Connection._list_by_query(self.__table__, query, **kwargs))
@Utils.cached(ttl=ttl_cache)
def list(self, meta, **kwargs):
return self.format(self.Connection._list(self.__table__, meta, **kwargs))
@Utils.cached(ttl=ttl_cache)
def fetch_all(self, meta, **kwargs):
return self.format(self.Connection._get(self.__table__, meta, **kwargs))
@Utils.cached(ttl=ttl_cache)
def fetch_all_by_query(self, query, **kwargs):
return self.format(self.Connection._get_by_query(self.__table__, query, **kwargs))
@Utils.cached(ttl=ttl_cache)
def fetch_one(self, meta, **kwargs):
response = self.fetch_all(meta, **kwargs)
if 'records' in response:
if len(response['records']) > 0:
return response['records'][0]
else:
if len(response) > 0:
return response[0]
return {}
def create(self, data, **kwargs):
return self.format(self.Connection._post(
self.__table__, data, **kwargs))
def create_multiple(self, data, **kwargs):
return self.format(self.Connection._post_multiple(
self.__table__, data, **kwargs))
def update(self, where, data, **kwargs):
return self.format(self.Connection._update(
self.__table__, where, data, **kwargs))
def delete(self, id, **kwargs):
return self.format(self.Connection._delete(
self.__table__, id, **kwargs))
def delete_multiple(self, query, **kwargs):
return self.format(self.Connection._delete_multiple(
self.__table__, query, **kwargs))
def format(self, response):
return self.Connection._format(response)
def last_updated(self, minutes, meta={}, **kwargs):
metaon = {'sys_updated_on':
'Last {0} minutes@javascript:gs.minutesAgoStart({1})@'
'javascript:gs.minutesAgoEnd(0)'.format(minutes, minutes)}
return self.format(self.Connection._get(
self.__table__, meta, metaon=metaon, **kwargs))
class Call(Base):
__table__ = 'u_new_call.do'
class Change(Base):
__table__ = 'change_request.do'
class Group(Base):
__table__ = 'sys_user_group.do'
class Incident(Base):
__table__ = 'incident.do'
class Journal(Base):
__table__ = 'sys_journal_field.do'
class Problem(Base):
__table__ = 'problem.do'
class Request(Base):
__table__ = 'sc_request.do'
class Rtask(Base):
__table__ = 'sc_task.do'
class Server(Base):
__table__ = 'cmdb_ci_server.do'
class Ticket(Base):
__table__ = 'u_service_desk.do'
class Task(Base):
__table__ = 'task_ci_list.do'
class User(Base):
__table__ = 'sys_user.do'
class Customer(Base):
__table__ = 'core_company.do'
class Router(Base):
__table__ = 'cmdb_ci_ip_router.do'
class Switch(Base):
__table__ = 'cmdb_ci_ip_switch.do'
class Cluster(Base):
__table__ = 'cmdb_ci_cluster.do'
class Firewall(Base):
__table__ = 'u_firewall.do'
class VPN(Base):
__table__ = 'cmdb_ci_vpn.do'
class ConfigurationItem(Base):
__table__ = 'cmdb_ci.do'
| 23.943662 | 91 | 0.646765 | 418 | 3,400 | 4.808612 | 0.200957 | 0.085075 | 0.079602 | 0.099502 | 0.400498 | 0.361692 | 0.361692 | 0.29602 | 0.242289 | 0.155224 | 0 | 0.003028 | 0.222941 | 3,400 | 141 | 92 | 24.113475 | 0.757759 | 0 | 0 | 0.078652 | 0 | 0 | 0.117059 | 0.021471 | 0 | 0 | 0 | 0 | 0 | 1 | 0.146067 | false | 0 | 0.011236 | 0.11236 | 0.764045 | 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 |
956905a571f027caca88ae4f63d25ecf1b3fc10a | 601 | py | Python | bot/triggers/__init__.py | elihschiff/Rubber-Duck-Python | 24dea3b64a8a46368cd8dd995c800375f355b55e | [
"MIT"
] | 7 | 2020-07-07T20:58:14.000Z | 2021-12-23T02:51:20.000Z | bot/triggers/__init__.py | elihschiff/Rubber-Duck-Python | 24dea3b64a8a46368cd8dd995c800375f355b55e | [
"MIT"
] | null | null | null | bot/triggers/__init__.py | elihschiff/Rubber-Duck-Python | 24dea3b64a8a46368cd8dd995c800375f355b55e | [
"MIT"
] | 1 | 2020-03-29T13:36:43.000Z | 2020-03-29T13:36:43.000Z | from .commands.help import Help
from .commands import all_commands
from .commands.delete import Delete
from .commands.merge import Merge
from .welcome import Welcome
from .commands.class_management import AddClass, RemoveClass
from .commands.connectfour import ConnectFour
from .commands.tictactoe import TicTacToe
from .commands.rps import RockPaperScissors
msg_triggers = [Help()]
msg_triggers.extend(all_commands)
new_member_triggers = [Welcome()]
reaction_triggers = [
AddClass(),
ConnectFour(),
Delete(),
Merge(),
RockPaperScissors(),
TicTacToe(),
RemoveClass(),
]
| 24.04 | 60 | 0.767055 | 67 | 601 | 6.761194 | 0.328358 | 0.211921 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.143095 | 601 | 24 | 61 | 25.041667 | 0.879612 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.428571 | 0 | 0.428571 | 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 |
956d7c4b34af97cc3019f98b0a5ac2b85c6c140c | 1,137 | py | Python | domain/recurso/filtro.py | ESEGroup/Paraguai | 42de0a15b7a31d470803e5f88d15e83f93c0a467 | [
"Apache-2.0"
] | 6 | 2016-11-08T16:08:48.000Z | 2017-03-05T20:48:41.000Z | domain/recurso/filtro.py | bamorim/eel873-final-assignment | 42de0a15b7a31d470803e5f88d15e83f93c0a467 | [
"Apache-2.0"
] | 39 | 2016-11-13T00:36:49.000Z | 2018-05-20T16:40:15.000Z | domain/recurso/filtro.py | bamorim/eel873-final-assignment | 42de0a15b7a31d470803e5f88d15e83f93c0a467 | [
"Apache-2.0"
] | 3 | 2016-11-08T22:33:54.000Z | 2017-07-23T21:07:14.000Z | class FiltroRecurso():
""" Representa um filtro de recurso que pode conter:
Nome, Tipo, Localização e Intervalos
"""
def __init__(self, nome, tipo, local, intervalos):
self.nome = nome
self.tipo = tipo
self.local = local
self.intervalos = intervalos
def atende(self, recurso):
""" Diz se um recurso atende aos critérios do filtro ou não """
return (
self.atende_nome(recurso) and
self.atende_tipo(recurso) and
self.atende_local(recurso) and
self.atende_intervalos(recurso)
)
def atende_nome(self, recurso):
if not self.nome:
return True
return recurso.nome == self.nome
def atende_tipo(self, recurso):
if not self.tipo:
return True
return recurso.tipo == self.tipo
def atende_local(self, recurso):
if not self.local:
return True
return recurso.local == self.local
def atende_intervalos(self, recurso):
return not any( a.intervalo.intercede(i) for a in recurso.agendamentos for i in self.intervalos)
| 29.921053 | 104 | 0.610378 | 139 | 1,137 | 4.906475 | 0.28777 | 0.065982 | 0.061584 | 0.087977 | 0.087977 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.307828 | 1,137 | 37 | 105 | 30.72973 | 0.866582 | 0.124011 | 0 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0.037037 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
957f246f9c43d458be3d97e714e7fc2a90ea74c7 | 506 | py | Python | regression/main.py | MichalisLazarou/cavia | ce476f2e1bc7899ae309c9ae9f23d236eca12555 | [
"MIT"
] | null | null | null | regression/main.py | MichalisLazarou/cavia | ce476f2e1bc7899ae309c9ae9f23d236eca12555 | [
"MIT"
] | null | null | null | regression/main.py | MichalisLazarou/cavia | ce476f2e1bc7899ae309c9ae9f23d236eca12555 | [
"MIT"
] | null | null | null | import arguments
import cavia
import maml
import trans_maml
import torch
if __name__ == '__main__':
args = arguments.parse_args()
print(args)
if args.method == 'maml' :
logger = maml.run(args, log_interval=100, rerun=True)
elif args.method == 'transformer':
#print("transformer")
with torch.autograd.detect_anomaly():
logger = trans_maml.run(args, log_interval=100, rerun=True)
else:
logger = cavia.run(args, log_interval=100, rerun=True)
| 25.3 | 71 | 0.662055 | 64 | 506 | 5 | 0.421875 | 0.065625 | 0.09375 | 0.16875 | 0.30625 | 0.30625 | 0.30625 | 0.2125 | 0 | 0 | 0 | 0.022901 | 0.22332 | 506 | 19 | 72 | 26.631579 | 0.791349 | 0.039526 | 0 | 0 | 0 | 0 | 0.047423 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
9582b7c7d9be780fbb6d6d247c56b4bd70b1a513 | 638 | py | Python | sendcloud/views/address.py | edison7500/django-sendcloud | 7d500bf134591ea0e192edd98fd4d04800fa0caf | [
"MIT"
] | 2 | 2018-03-07T06:06:03.000Z | 2019-11-01T01:24:39.000Z | sendcloud/views/address.py | edison7500/django-sendcloud | 7d500bf134591ea0e192edd98fd4d04800fa0caf | [
"MIT"
] | null | null | null | sendcloud/views/address.py | edison7500/django-sendcloud | 7d500bf134591ea0e192edd98fd4d04800fa0caf | [
"MIT"
] | 2 | 2018-03-16T06:19:03.000Z | 2019-11-01T08:45:06.000Z | import logging
from django.urls import reverse, reverse_lazy
from django.views import generic
from sendcloud.core.address_list import AddressListAPI
from sendcloud.forms.address import AddressListForm
logger = logging.getLogger('django')
class AddressListView(generic.ListView):
template_name = "sendcloud/address/list.html"
def get_queryset(self):
ad = AddressListAPI()
r = ad.list()
return r["info"]["dataList"]
class AddressCreateView(generic.CreateView):
template_name = "sendcloud/address/add.html"
form_class = AddressListForm
success_url = reverse_lazy('send_cloud_address_list')
| 26.583333 | 57 | 0.755486 | 75 | 638 | 6.28 | 0.546667 | 0.070064 | 0.089172 | 0.118896 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.155172 | 638 | 23 | 58 | 27.73913 | 0.87384 | 0 | 0 | 0 | 0 | 0 | 0.147335 | 0.119122 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | false | 0 | 0.3125 | 0 | 0.8125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
959a806f96d177883c07640b4f61897fd63b8883 | 105 | py | Python | mo/day19.py | montukv/Coding-problem-solutions | 973009c00038cc57500d965871376a60f8c4e0d1 | [
"MIT"
] | null | null | null | mo/day19.py | montukv/Coding-problem-solutions | 973009c00038cc57500d965871376a60f8c4e0d1 | [
"MIT"
] | null | null | null | mo/day19.py | montukv/Coding-problem-solutions | 973009c00038cc57500d965871376a60f8c4e0d1 | [
"MIT"
] | null | null | null | arr = list(map(int,input().split()))
i = 1
while True:
if i not in arr:
print(i)
break
i+=1
| 13.125 | 37 | 0.552381 | 20 | 105 | 2.9 | 0.75 | 0.068966 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 0.27619 | 105 | 7 | 38 | 15 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 |
95b6125cd6ffc2c3613821ead38fa6810cda14ec | 1,319 | py | Python | training_v1_backup/training/SAC/replayBuffer.py | prasoonpatidar/multiagentRL-resource-sharing | e63ba7fc3c7ab019e9fd109cd45b739e3322152f | [
"MIT"
] | null | null | null | training_v1_backup/training/SAC/replayBuffer.py | prasoonpatidar/multiagentRL-resource-sharing | e63ba7fc3c7ab019e9fd109cd45b739e3322152f | [
"MIT"
] | null | null | null | training_v1_backup/training/SAC/replayBuffer.py | prasoonpatidar/multiagentRL-resource-sharing | e63ba7fc3c7ab019e9fd109cd45b739e3322152f | [
"MIT"
] | null | null | null | '''
Buffer to store historical experiences
'''
import math
import random
import argparse
import gym
import numpy as np
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.distributions import Normal
class ReplayBuffer:
def __init__(self, capacity):
self.capacity = capacity
self.buffer = []
self.position = 0
def push(self, state, action, reward, next_state, done):
if len(self.buffer) < self.capacity:
self.buffer.append(None)
self.buffer[self.position] = (state, action, reward, next_state, done)
self.position = int((self.position + 1) % self.capacity) # as a ring buffer
def sample(self, batch_size):
batch = random.sample(self.buffer, batch_size)
state, action, reward, next_state, done = map(np.stack, zip(*batch)) # stack for each element
'''
the * serves as unpack: sum(a,b) <=> batch=(a,b), sum(*batch) ;
zip: a=[1,2], b=[2,3], zip(a,b) => [(1, 2), (2, 3)] ;
the map serves as mapping the function on each list element: map(square, [2,3]) => [4,9] ;
np.stack((1,2)) => array([1, 2])
'''
return state, action, reward, next_state, done
def __len__(self):
return len(self.buffer)
| 29.311111 | 102 | 0.624716 | 188 | 1,319 | 4.308511 | 0.367021 | 0.074074 | 0.083951 | 0.103704 | 0.148148 | 0.148148 | 0 | 0 | 0 | 0 | 0 | 0.018072 | 0.244882 | 1,319 | 44 | 103 | 29.977273 | 0.795181 | 0.059894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.148148 | false | 0 | 0.407407 | 0.037037 | 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 |
95d1cf86b5d81ce9fa53b0fb16f1e182a14b3181 | 590 | py | Python | code/044.py | cndrip/sklearn100 | bfaa54f7fe8e16ea66655159ccacbcb61086a434 | [
"MIT"
] | null | null | null | code/044.py | cndrip/sklearn100 | bfaa54f7fe8e16ea66655159ccacbcb61086a434 | [
"MIT"
] | null | null | null | code/044.py | cndrip/sklearn100 | bfaa54f7fe8e16ea66655159ccacbcb61086a434 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
df=pd.DataFrame(
{
"var_1":np.arange(0.01,1,0.1),
"var_2":1-np.arange(0.01,1,0.1)
}
)
def entropy(x):
return -np.sum(x*np.log2(x))
df["entropy"]=df.apply(
lambda x: entropy([x["var_1"],x["var_2"]]),
axis=1
)
print(df)
'''
var_1 var_2 entropy
0 0.01 0.99 0.080793
1 0.11 0.89 0.499916
2 0.21 0.79 0.741483
3 0.31 0.69 0.893173
4 0.41 0.59 0.976500
5 0.51 0.49 0.999711
6 0.61 0.39 0.964800
7 0.71 0.29 0.868721
8 0.81 0.19 0.701471
9 0.91 0.09 0.436470
'''
| 18.4375 | 47 | 0.549153 | 132 | 590 | 2.409091 | 0.454545 | 0.037736 | 0.056604 | 0.062893 | 0.09434 | 0.09434 | 0.09434 | 0.09434 | 0 | 0 | 0 | 0.378824 | 0.279661 | 590 | 31 | 48 | 19.032258 | 0.369412 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.133333 | 0.066667 | 0.266667 | 0.066667 | 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 |
95fda297212449dfd56e341330be530bd8ebb06e | 915 | py | Python | PythonClient/carla/benchmarks/experiment.py | madan96/carla | adae643546c8154a1c0b0936378baca1c527901a | [
"MIT"
] | 1 | 2018-03-09T10:17:23.000Z | 2018-03-09T10:17:23.000Z | PythonClient/carla/benchmarks/experiment.py | VincentCheungM/carla | adae643546c8154a1c0b0936378baca1c527901a | [
"MIT"
] | null | null | null | PythonClient/carla/benchmarks/experiment.py | VincentCheungM/carla | adae643546c8154a1c0b0936378baca1c527901a | [
"MIT"
] | 1 | 2018-04-21T10:37:58.000Z | 2018-04-21T10:37:58.000Z | # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
from carla.settings import CarlaSettings
class Experiment(object):
def __init__(self):
self.Id = ''
self.Conditions = CarlaSettings()
self.Poses = [[]]
self.Repetitions = 1
def set(self, **kwargs):
for key, value in kwargs.items():
if not hasattr(self, key):
raise ValueError('Experiment: no key named %r' % key)
setattr(self, key, value)
@property
def id(self):
return self.Id
@property
def conditions(self):
return self.Conditions
@property
def poses(self):
return self.Poses
@property
def repetitions(self):
return self.Repetitions
| 23.461538 | 80 | 0.616393 | 110 | 915 | 5.090909 | 0.581818 | 0.078571 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007622 | 0.28306 | 915 | 38 | 81 | 24.078947 | 0.846037 | 0.227322 | 0 | 0.166667 | 0 | 0 | 0.038516 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.041667 | 0.166667 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
250189a8bf04287a87f9223664e9192c2d3bf8f4 | 1,400 | py | Python | osiris/connector/__init__.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | 4 | 2020-04-23T18:43:27.000Z | 2022-02-22T03:57:06.000Z | osiris/connector/__init__.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | 1 | 2021-06-02T00:47:12.000Z | 2021-06-02T00:47:12.000Z | osiris/connector/__init__.py | skadyan/aws-glue-python-kickstart | 5e3228a0793188d248f801a2b5a522210048ccde | [
"Apache-2.0"
] | null | null | null | import abc
import enum
from typing import Any
from osiris.base import logutils
from osiris.base.environments import env
from osiris.exceptions import IllegalArgumentException
class ConnectorException(Exception):
pass
class ConnectorFailedException(ConnectorException):
pass
class ConnectorExitState(enum.Enum):
"""
Generic exit status return by connector to indicate the success or failure state
"""
SUCCESS = 0
TIMEOUT = 5
ERROR = 6
log = logutils.get_logger(__name__)
def load_connector_settings(key: str) -> dict:
log.info(f"Loading connector settings for: {key}")
settings = env.get_section(key)
if not settings:
raise IllegalArgumentException(f"no settings defined for key: {key}")
secret_name = settings.pop("secure_settings_aws_secret_name", None)
if secret_name:
log.info(f"....... and loading secure settings")
secure = env.get_property(f"vault.{secret_name}")
return {**settings, **secure}
class Connector(abc.ABC):
def __init__(self, name: str):
self.name = name
self.settings = load_connector_settings(f"connector.{name}")
def get_setting(self, name: str, fallback: Any = None) -> Any:
return self.settings.get(name, fallback)
def log_event(self, event, detail=None):
# simplest implementation of logging events
log.info(f"[{event}] {detail}")
| 25.925926 | 84 | 0.701429 | 176 | 1,400 | 5.443182 | 0.431818 | 0.041754 | 0.025052 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002669 | 0.197143 | 1,400 | 53 | 85 | 26.415094 | 0.849644 | 0.087857 | 0 | 0.060606 | 0 | 0 | 0.150674 | 0.024584 | 0 | 0 | 0 | 0 | 0 | 1 | 0.121212 | false | 0.060606 | 0.181818 | 0.030303 | 0.575758 | 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 |
25033aed0eac4a0f773dbe687a6f9da56e3a39a9 | 1,227 | py | Python | devilry/devilry_import_v2database/modelimporters/__init__.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | 29 | 2015-01-18T22:56:23.000Z | 2020-11-10T21:28:27.000Z | devilry/devilry_import_v2database/modelimporters/__init__.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | 786 | 2015-01-06T16:10:18.000Z | 2022-03-16T11:10:50.000Z | devilry/devilry_import_v2database/modelimporters/__init__.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | 15 | 2015-04-06T06:18:43.000Z | 2021-02-24T12:28:30.000Z | from .user_importer import UserImporter # noqa
from .node_importer import NodeImporter # noqa
from .subject_importer import SubjectImporter # noqa
from .period_importer import PeriodImporter # noqa
from .assignment_importer import AssignmentImporter # noqa
from .assignmentgroup_importer import AssignmentGroupImporter # noqa
from .pointrange_to_grade_importer import PointToGradeMapImporter # noqa
from .pointrange_to_grade_importer import PointRangeToGradeImporter # noqa
from .relateduser_importer import RelatedExaminerImporter # noqa
from .relateduser_importer import RelatedStudentImporter # noqa
from .candidate_examiner_importer import CandidateImporter # noqa
from .candidate_examiner_importer import ExaminerImporter # noqa
from .feedbackset_importer import FeedbackSetImporter # noqa
from .delivery_feedback_importers import DeliveryImporter # noqa
from .delivery_feedback_importers import StaticFeedbackImporter # noqa
from .delivery_feedback_importers import FileMetaImporter # noqa
from .delivery_feedback_importers import CommentFileContentImporter # noqa
from .qualifiesforexam_importer import StatusImporter # noqa
from .qualifiesforexam_importer import QualifiesForFinalExamImporter # noqa
| 61.35 | 76 | 0.860636 | 124 | 1,227 | 8.282258 | 0.322581 | 0.140214 | 0.062317 | 0.093476 | 0.442064 | 0.303797 | 0.075949 | 0 | 0 | 0 | 0 | 0 | 0.108394 | 1,227 | 19 | 77 | 64.578947 | 0.938757 | 0.07661 | 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 |
2505415fb95387aea315df6c8eff97cc7f860355 | 4,506 | py | Python | snake/objects/snake.py | TeamSerpentine/retro-baselines | 9b2c725604496aca9c382a53f456d31fdbcaa5b1 | [
"BSD-3-Clause"
] | 2 | 2019-12-09T08:41:13.000Z | 2020-10-22T02:29:22.000Z | snake/objects/snake.py | TeamSerpentine/retro-baselines | 9b2c725604496aca9c382a53f456d31fdbcaa5b1 | [
"BSD-3-Clause"
] | null | null | null | snake/objects/snake.py | TeamSerpentine/retro-baselines | 9b2c725604496aca9c382a53f456d31fdbcaa5b1 | [
"BSD-3-Clause"
] | null | null | null |
from collections import deque
from snake.objects import constants
from .base_object import Object
class Snake(Object):
"""
Snake, object that can move over the board and interact with other objects.
:param position: utils.Point
The start position of the snake.
"""
rgb = constants.GREEN_SERPENTINE
ansi_fancy = constants.SQUARE_BLACK
ansi = "0"
APPLE_TIME = constants.APPLE_TIME
LIFE_MAX = constants.LIFE_MAX
LEN_SNAKE_START = constants.LEN_SNAKE_START
LEN_SNAKE_MAX = constants.LEN_SNAKE_MAX
def __init__(self, position):
self.position = position
# Define start direction and timers
self._direction = constants.DIRECTION_START
self.life_left = constants.LIFE_START # Time until snake dies
self.life_time = 0 # Time snake lives
self.alive = True
# Create the snake body
self.body = deque(maxlen=self.LEN_SNAKE_MAX)
self.body.append(self.position)
for _ in range(1, self.LEN_SNAKE_START):
self.increase_length()
def __contains__(self, item):
""" Check if a snake is colliding with another snake. """
return bool(set(item.body) & set(self.body))
def __eq__(self, other):
""" Check if the snake is the same one, by checking all body positions. """
if hasattr(other, "body"):
return not (set(self.body) - set(other.body))
return False
def __ne__(self, other):
""" Check if the snake is not the same one, by checking all body positions. """
if hasattr(other, "body"):
return bool(set(self.body) - set(other.body))
return False
def __len__(self):
return len(self.body)
def __str__(self):
return f"<class {self.__class__.__name__}"
def __repr__(self):
return f"<class {self.__class__.__name__} (x={self.position.x}, y={self.position.y})>"
def specifics(self):
""" Returns a lot of information about the snake. """
return dict(alive=self.alive, facing=self.direction,
length=len(self), body=self.body,
head=self.get_head(), tail=self.get_tail(),
time_left=self.life_left, time_alive=self.life_time)
@property
def direction(self):
return self._direction
@direction.setter
def direction(self, value):
"""
Only set the value if it is a valid direction and
you do not try to return in the opposite direction(against the body)
:param value: int
New direction of the snake
"""
if value in constants.DIRECTION_VALID:
value_current = constants.DIRECTION_VALUE.get(self.direction)
value_new = constants.DIRECTION_VALUE.get(value)
if value_current != -value_new:
self._direction = value
def get_head(self):
""" Returns the head position of the snake. """
return self.body[0]
def get_tail(self):
""" Returns the tail position of the snake. """
return self.body[-1]
def increase_length(self):
"""
Will increase the length of the snake on the next step.
"""
self.body.append(self.body[-1])
self.life_left = min(self.life_left + self.APPLE_TIME, self.LIFE_MAX)
def step(self):
"""
Updates the snake position to the new head location
"""
new_head = self.next_step_head()
self.body.pop()
self.body.appendleft(new_head)
self.position = self.get_head()
self.life_time += 1
self.life_left -= 1
def next_step_head(self):
"""
Calculates the position of the snake after a step
:return: Point
New location of the head
"""
new_head = self.body[0].clone()
if self.direction in ["LEFT", "RIGHT"]:
new_head.x += 1 if self.direction == "RIGHT" else -1
if self.direction in ["UP", "DOWN"]:
new_head.y += 1 if self.direction != "UP" else -1
return new_head
def collide(self, other):
"""
Check if a point collide with the snakes body
:param other: Point
"""
for body in self.body:
if body == other.position:
return True
return False
def location(self):
return self.body
| 30.653061 | 94 | 0.591656 | 574 | 4,506 | 4.45993 | 0.229965 | 0.053125 | 0.023438 | 0.028125 | 0.14375 | 0.14375 | 0.14375 | 0.075781 | 0.075781 | 0.046875 | 0 | 0.004203 | 0.313582 | 4,506 | 146 | 95 | 30.863014 | 0.823472 | 0.223036 | 0 | 0.0625 | 0 | 0.0125 | 0.043195 | 0.028589 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2125 | false | 0 | 0.0375 | 0.0625 | 0.55 | 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 |
25062d5072de68c1b8e9c02a730c77e63e55c0bc | 211 | py | Python | settings.py | AndrewD-107/OneMoreEmailReader | 8dda123525c4311e3ea577cfa6087ec31aae68c2 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T15:29:24.000Z | 2019-06-11T13:29:29.000Z | settings.py | AndrewD-107/OneMoreEmailReader | 8dda123525c4311e3ea577cfa6087ec31aae68c2 | [
"BSD-3-Clause"
] | null | null | null | settings.py | AndrewD-107/OneMoreEmailReader | 8dda123525c4311e3ea577cfa6087ec31aae68c2 | [
"BSD-3-Clause"
] | null | null | null | CONNECTION = {
'server': 'example@mail.com',
'user': 'user',
'password': 'password',
'port': 993
}
CONTENT_TYPES = ['text/plain', 'text/html']
ATTACHMENT_DIR = ''
ALLOWED_EXTENSIONS = ['csv']
| 16.230769 | 43 | 0.597156 | 22 | 211 | 5.590909 | 0.863636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017647 | 0.194313 | 211 | 12 | 44 | 17.583333 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0.341232 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.111111 | 0 | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
25197756691829ad45f5a43a9970803fb2f26be6 | 449 | py | Python | sensor/sensor_ads.py | cionicwear/vent | 00fcf2db1cd0c1bb5383fe7aa1c8dd34a0619a50 | [
"MIT"
] | 3 | 2020-05-05T22:32:34.000Z | 2020-11-18T20:59:52.000Z | sensor/sensor_ads.py | cionicwear/vent | 00fcf2db1cd0c1bb5383fe7aa1c8dd34a0619a50 | [
"MIT"
] | 1 | 2020-05-02T03:24:52.000Z | 2020-05-02T03:24:52.000Z | sensor/sensor_ads.py | cionicwear/vent | 00fcf2db1cd0c1bb5383fe7aa1c8dd34a0619a50 | [
"MIT"
] | 2 | 2020-08-02T04:44:45.000Z | 2020-08-17T22:47:41.000Z | import board
import busio
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn
class FlowSensorADS:
class Data:
def __init__(self):
self.rate = 0
def __init__(self, channel=ADS.P0):
self.adc = ADS.ADS1115(i2c)
self.chan = AnalogIn(self.adc, channel)
self.data = self.Data()
def read(self):
self.data.rate = self.chan.voltage
| 21.380952 | 47 | 0.625835 | 57 | 449 | 4.736842 | 0.473684 | 0.088889 | 0.081481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.053125 | 0.287305 | 449 | 20 | 48 | 22.45 | 0.790625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.285714 | 0 | 0.642857 | 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 |
2520a6e91a4aa0552003a33d7b01540f12c73a23 | 523 | py | Python | scripts/list_ports.py | nnarain/ftl | 18cb39b8214bab76e42f5fea48810279114b7e70 | [
"MIT"
] | null | null | null | scripts/list_ports.py | nnarain/ftl | 18cb39b8214bab76e42f5fea48810279114b7e70 | [
"MIT"
] | 23 | 2021-02-14T21:26:27.000Z | 2021-06-29T23:53:51.000Z | scripts/list_ports.py | nnarain/ftl | 18cb39b8214bab76e42f5fea48810279114b7e70 | [
"MIT"
] | null | null | null | import os
import serial
def get_serial_port_iterator():
try:
if os.name == 'nt':
from serial.tools.list_ports_windows import comports
return comports
elif os.name == 'posix':
from serial.tools.list_ports_posix import comports
return comports
else:
raise ImportError('No serial implementation for this platform found')
except ImportError as e:
return None
for (port, _, _) in get_serial_port_iterator()():
print(port)
| 27.526316 | 81 | 0.632887 | 63 | 523 | 5.063492 | 0.555556 | 0.056426 | 0.081505 | 0.131661 | 0.15047 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.296367 | 523 | 18 | 82 | 29.055556 | 0.866848 | 0 | 0 | 0.125 | 0 | 0 | 0.105163 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.0625 | true | 0 | 0.375 | 0 | 0.625 | 0.0625 | 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 |
2523cb6dba00ea6f7937f0a1c3b11bc26aaf8e2e | 669 | py | Python | appengine_config.py | bravoclaire/05839-byte2 | 58fd44e2d4d48594f3e1d87f92618b5a5c7868eb | [
"Apache-2.0"
] | null | null | null | appengine_config.py | bravoclaire/05839-byte2 | 58fd44e2d4d48594f3e1d87f92618b5a5c7868eb | [
"Apache-2.0"
] | null | null | null | appengine_config.py | bravoclaire/05839-byte2 | 58fd44e2d4d48594f3e1d87f92618b5a5c7868eb | [
"Apache-2.0"
] | null | null | null | <<<<<<< HEAD
"""
`appengine_config.py` is automatically loaded when Google App Engine
starts a new instance of your application. This runs before any
WSGI applications specified in app.yaml are loaded.
"""
from google.appengine.ext import vendor
# Third-party libraries are stored in "lib", vendoring will make
# sure that they are importable by the application.
=======
"""`appengine_config` gets loaded when starting a new application instance."""
import vendor
# insert `lib` as a site directory so our `main` module can load
# third-party libraries, and override built-ins with newer
# versions.
>>>>>>> 2c062edc8dd53b019a957e9fd3cf44e87c16123a
vendor.add('lib')
| 33.45 | 78 | 0.760837 | 92 | 669 | 5.51087 | 0.728261 | 0.059172 | 0.074951 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.139013 | 669 | 19 | 79 | 35.210526 | 0.838542 | 0.361734 | 0 | 0 | 0 | 0 | 0.019868 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
252af44c9358c416e55e9d7ba54d63dd258babe7 | 306 | py | Python | tests/test_codon_rtd.py | Benjamin-Lee/krtd | af4620c89e17a0ad8e97fb8783090546a16a450c | [
"Apache-2.0"
] | null | null | null | tests/test_codon_rtd.py | Benjamin-Lee/krtd | af4620c89e17a0ad8e97fb8783090546a16a450c | [
"Apache-2.0"
] | null | null | null | tests/test_codon_rtd.py | Benjamin-Lee/krtd | af4620c89e17a0ad8e97fb8783090546a16a450c | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pytest
from hypothesis import given, assume, strategies as st
from skbio import DNA, Sequence
from krtd import codon_rtd
@given(st.text(alphabet=["A", "T", "G", "C"]))
def test_invalid_seq(x):
assume(len(x) % 3 != 0)
with pytest.raises(ValueError):
codon_rtd(x)
| 23.538462 | 54 | 0.69281 | 49 | 306 | 4.244898 | 0.693878 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007968 | 0.179739 | 306 | 12 | 55 | 25.5 | 0.820717 | 0 | 0 | 0 | 0 | 0 | 0.013072 | 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 |
25394f1fafa58debcedf9859bee9aaac4841cd00 | 2,640 | py | Python | u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/test/py/tests/test_pinmux.py | rlourette/TI_SDK_u-boot-2019.01 | 3000a07c021e84d717e6792a74efcf895a7d7188 | [
"MIT"
] | 8 | 2020-09-06T12:49:00.000Z | 2022-03-09T04:02:06.000Z | u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/test/py/tests/test_pinmux.py | rlourette/TI_SDK_u-boot-2019.01 | 3000a07c021e84d717e6792a74efcf895a7d7188 | [
"MIT"
] | null | null | null | u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/test/py/tests/test_pinmux.py | rlourette/TI_SDK_u-boot-2019.01 | 3000a07c021e84d717e6792a74efcf895a7d7188 | [
"MIT"
] | 7 | 2020-09-08T15:14:34.000Z | 2021-06-24T18:03:49.000Z | # SPDX-License-Identifier: GPL-2.0
import pytest
import u_boot_utils
@pytest.mark.buildconfigspec('cmd_pinmux')
def test_pinmux_usage_1(u_boot_console):
"""Test that 'pinmux' command without parameters displays
pinmux usage."""
output = u_boot_console.run_command('pinmux')
assert 'Usage:' in output
@pytest.mark.buildconfigspec('cmd_pinmux')
def test_pinmux_usage_2(u_boot_console):
"""Test that 'pinmux status' executed without previous "pinmux dev"
command displays pinmux usage."""
output = u_boot_console.run_command('pinmux status')
assert 'Usage:' in output
@pytest.mark.buildconfigspec('cmd_pinmux')
@pytest.mark.boardspec('sandbox')
def test_pinmux_status_all(u_boot_console):
"""Test that 'pinmux status -a' displays pin's muxing."""
output = u_boot_console.run_command('pinmux status -a')
assert ('SCL : I2C SCL' in output)
assert ('SDA : I2C SDA' in output)
assert ('TX : Uart TX' in output)
assert ('RX : Uart RX' in output)
assert ('W1 : 1-wire gpio' in output)
@pytest.mark.buildconfigspec('cmd_pinmux')
@pytest.mark.boardspec('sandbox')
def test_pinmux_list(u_boot_console):
"""Test that 'pinmux list' returns the pin-controller list."""
output = u_boot_console.run_command('pinmux list')
assert 'sandbox_pinctrl' in output
@pytest.mark.buildconfigspec('cmd_pinmux')
def test_pinmux_dev_bad(u_boot_console):
"""Test that 'pinmux dev' returns an error when trying to select a
wrong pin controller."""
pincontroller = 'bad_pin_controller_name'
output = u_boot_console.run_command('pinmux dev ' + pincontroller)
expected_output = 'Can\'t get the pin-controller: ' + pincontroller + '!'
assert (expected_output in output)
@pytest.mark.buildconfigspec('cmd_pinmux')
@pytest.mark.boardspec('sandbox')
def test_pinmux_dev(u_boot_console):
"""Test that 'pinmux dev' select the wanted pin controller."""
pincontroller = 'pinctrl'
output = u_boot_console.run_command('pinmux dev ' + pincontroller)
expected_output = 'dev: ' + pincontroller
assert (expected_output in output)
@pytest.mark.buildconfigspec('cmd_pinmux')
@pytest.mark.boardspec('sandbox')
def test_pinmux_status(u_boot_console):
"""Test that 'pinmux status' displays selected pincontroller's pin
muxing descriptions."""
output = u_boot_console.run_command('pinmux status')
assert ('SCL : I2C SCL' in output)
assert ('SDA : I2C SDA' in output)
assert ('TX : Uart TX' in output)
assert ('RX : Uart RX' in output)
assert ('W1 : 1-wire gpio' in output)
| 39.402985 | 77 | 0.705303 | 354 | 2,640 | 5.062147 | 0.200565 | 0.041853 | 0.09375 | 0.109375 | 0.766183 | 0.766183 | 0.737165 | 0.632254 | 0.609933 | 0.540179 | 0 | 0.005538 | 0.179167 | 2,640 | 66 | 78 | 40 | 0.821412 | 0.202652 | 0 | 0.630435 | 0 | 0 | 0.225037 | 0.011203 | 0 | 0 | 0 | 0 | 0.326087 | 1 | 0.152174 | false | 0 | 0.043478 | 0 | 0.195652 | 0 | 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 |
254750d4031da88b0dae4252bf92c1b42b3536cb | 2,500 | py | Python | helpers/rosdistro_adapter.py | fmauch/arch_ros_package_monitor | 4185ef7896df1a2f1e31f34bb7279fdf07cf0362 | [
"BSD-3-Clause"
] | 2 | 2020-05-28T19:57:28.000Z | 2020-05-29T01:57:22.000Z | helpers/rosdistro_adapter.py | fmauch/arch_ros_package_monitor | 4185ef7896df1a2f1e31f34bb7279fdf07cf0362 | [
"BSD-3-Clause"
] | null | null | null | helpers/rosdistro_adapter.py | fmauch/arch_ros_package_monitor | 4185ef7896df1a2f1e31f34bb7279fdf07cf0362 | [
"BSD-3-Clause"
] | 1 | 2020-06-27T06:28:04.000Z | 2020-06-27T06:28:04.000Z | # Copyright © 2020 Felix Exner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the organization nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY Felix Exner ''AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Felix Exner BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import rosdistro
from catkin_pkg import package
class RosdistroAdapter(object):
"""Small python wrapper to quickly query package information out of a rosdistro"""
def __init__(self, distro_name):
super(RosdistroAdapter, self).__init__()
self._index = None
self._distro_name = distro_name
self._distro = self.get_distro()
def get_distro(self):
"""Get a rosdistro object from the distro name configured in this object"""
self._index = rosdistro.get_index(rosdistro.get_index_url())
return rosdistro.get_cached_distribution(self._index, self._distro_name)
def get_package_by_name(self, package_name):
"""Get a package representation from a package name"""
manifest = self._distro.get_release_package_xml(package_name)
return package.parse_package_string(manifest)
def get_package_list(self):
distr_file = rosdistro.get_distribution_file(self._index, self._distro_name)
return distr_file.release_packages.keys()
| 47.169811 | 86 | 0.7632 | 350 | 2,500 | 5.32 | 0.46 | 0.032223 | 0.030075 | 0.024705 | 0.123523 | 0.07304 | 0.07304 | 0.07304 | 0.07304 | 0.07304 | 0 | 0.003403 | 0.1772 | 2,500 | 52 | 87 | 48.076923 | 0.901313 | 0.6464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.235294 | false | 0 | 0.117647 | 0 | 0.588235 | 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 |
255fb87bb53e2eacd6797081fafde69e3eb2bc6b | 185 | py | Python | DSA Coding/Patterns/Full_Pyramid.py | prathimacode-hub/WIE-WoC | f412f297a57249af98213bf4a747c897f2d4c035 | [
"MIT"
] | 8 | 2022-03-01T09:09:20.000Z | 2022-03-03T05:36:01.000Z | DSA Coding/Patterns/Full_Pyramid.py | prathimacode-hub/WIE-WoC | f412f297a57249af98213bf4a747c897f2d4c035 | [
"MIT"
] | 52 | 2022-03-02T13:52:46.000Z | 2022-03-04T03:03:17.000Z | DSA Coding/Patterns/Full_Pyramid.py | prathimacode-hub/WIE-WoC | f412f297a57249af98213bf4a747c897f2d4c035 | [
"MIT"
] | 23 | 2022-03-01T06:39:34.000Z | 2022-03-03T09:24:40.000Z | n = int(input())
space = n-1
for i in range(n):
for k in range(space):
print(" ",end="")
for j in range(i+1):
print("* ",end="")
print()
space -= 1
| 12.333333 | 26 | 0.454054 | 29 | 185 | 2.896552 | 0.448276 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02459 | 0.340541 | 185 | 14 | 27 | 13.214286 | 0.663934 | 0 | 0 | 0 | 0 | 0 | 0.016484 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c2545d9a3efe2a968cf4982d8f63de238854307e | 2,184 | py | Python | python/lcmtypes/mbot_encoder_t.py | levymp/MBOT | 66b1cb12a5867853df2e01915a269309b67560c3 | [
"MIT"
] | null | null | null | python/lcmtypes/mbot_encoder_t.py | levymp/MBOT | 66b1cb12a5867853df2e01915a269309b67560c3 | [
"MIT"
] | 5 | 2020-09-27T05:09:56.000Z | 2020-10-12T00:46:44.000Z | python/lcmtypes/mbot_encoder_t.py | levymp/MBOT | 66b1cb12a5867853df2e01915a269309b67560c3 | [
"MIT"
] | null | null | null | """LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
try:
import cStringIO.StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
class mbot_encoder_t(object):
__slots__ = ["utime", "leftticks", "rightticks", "left_delta", "right_delta"]
__typenames__ = ["int64_t", "int64_t", "int64_t", "int16_t", "int16_t"]
__dimensions__ = [None, None, None, None, None]
def __init__(self):
self.utime = 0
self.leftticks = 0
self.rightticks = 0
self.left_delta = 0
self.right_delta = 0
def encode(self):
buf = BytesIO()
buf.write(mbot_encoder_t._get_packed_fingerprint())
self._encode_one(buf)
return buf.getvalue()
def _encode_one(self, buf):
buf.write(struct.pack(">qqqhh", self.utime, self.leftticks, self.rightticks, self.left_delta, self.right_delta))
def decode(data):
if hasattr(data, 'read'):
buf = data
else:
buf = BytesIO(data)
if buf.read(8) != mbot_encoder_t._get_packed_fingerprint():
raise ValueError("Decode error")
return mbot_encoder_t._decode_one(buf)
decode = staticmethod(decode)
def _decode_one(buf):
self = mbot_encoder_t()
self.utime, self.leftticks, self.rightticks, self.left_delta, self.right_delta = struct.unpack(">qqqhh", buf.read(28))
return self
_decode_one = staticmethod(_decode_one)
_hash = None
def _get_hash_recursive(parents):
if mbot_encoder_t in parents: return 0
tmphash = (0xd4582742ffd4e8e8) & 0xffffffffffffffff
tmphash = (((tmphash<<1)&0xffffffffffffffff) + (tmphash>>63)) & 0xffffffffffffffff
return tmphash
_get_hash_recursive = staticmethod(_get_hash_recursive)
_packed_fingerprint = None
def _get_packed_fingerprint():
if mbot_encoder_t._packed_fingerprint is None:
mbot_encoder_t._packed_fingerprint = struct.pack(">Q", mbot_encoder_t._get_hash_recursive([]))
return mbot_encoder_t._packed_fingerprint
_get_packed_fingerprint = staticmethod(_get_packed_fingerprint)
| 33.090909 | 126 | 0.671703 | 266 | 2,184 | 5.150376 | 0.296992 | 0.080292 | 0.087591 | 0.032847 | 0.20219 | 0.138686 | 0.091971 | 0.091971 | 0.091971 | 0.091971 | 0 | 0.021264 | 0.224817 | 2,184 | 65 | 127 | 33.6 | 0.78795 | 0.040293 | 0 | 0 | 1 | 0 | 0.052682 | 0 | 0 | 0 | 0.034483 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.081633 | 0 | 0.530612 | 0.163265 | 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 |
c25def9bedfdea02ce749c59a9df2037fac9ac4d | 323 | py | Python | basics/ch8__FUNCTIONS/2_pets.py | bedoyama/python-crash-course | 39101237c478cd9c97f1a47f866408d2754c849f | [
"Apache-2.0"
] | null | null | null | basics/ch8__FUNCTIONS/2_pets.py | bedoyama/python-crash-course | 39101237c478cd9c97f1a47f866408d2754c849f | [
"Apache-2.0"
] | null | null | null | basics/ch8__FUNCTIONS/2_pets.py | bedoyama/python-crash-course | 39101237c478cd9c97f1a47f866408d2754c849f | [
"Apache-2.0"
] | null | null | null | def describe_pet(animal_type, pet_name='virgil'):
"""Display info about Virgil"""
print(f"\nI have a {animal_type}.")
print(f"My {animal_type}'s name is {pet_name.title()}")
describe_pet('dog', 'virgil')
describe_pet('hamster', 'harry')
describe_pet(pet_name='garfield', animal_type='cat')
describe_pet('dog')
| 32.3 | 59 | 0.702786 | 49 | 323 | 4.387755 | 0.489796 | 0.255814 | 0.130233 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111455 | 323 | 9 | 60 | 35.888889 | 0.749129 | 0.077399 | 0 | 0 | 0 | 0 | 0.380137 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.142857 | 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 |
c2674449f3af6e138bab9ad1e4080222cbbedbf3 | 1,354 | py | Python | exams/2018-06-28/testo-esame/esercizio2.py | CNardin/learning-python | 407b35c3bb045477b823fb0fd8cf7ae05d92ef77 | [
"MIT"
] | null | null | null | exams/2018-06-28/testo-esame/esercizio2.py | CNardin/learning-python | 407b35c3bb045477b823fb0fd8cf7ae05d92ef77 | [
"MIT"
] | null | null | null | exams/2018-06-28/testo-esame/esercizio2.py | CNardin/learning-python | 407b35c3bb045477b823fb0fd8cf7ae05d92ef77 | [
"MIT"
] | null | null | null | """
Quando si analizza una frase, può essere utile processarla per rimuovere parole molto comuni,
come articoli e le preposizioni:
Per esempio:
"un libro su Python per principianti"
si può semplificare in
"libro Python principianti"
Le parole 'poco utili' vengono chiamate 'stopwords'. Questo processo è per esempio eseguito dai motori di ricerca per ridurre la complessità della stringa di input fornita dall'utente.
Implementare una funzione che prende una stringa e RITORNA la stringa di input senza le stopwords
SUGGERIMENTO 1: le stringhe in Python sono *immutabili* ! Per rimuovere le parole dovete creare una
_nuova_ stringa a partire dalla stringa di partenza.
SUGGERIMENTO 2: create una lista di parole così:
lista = stringa.split(" ")
SUGGERIMENTO 3: operate le opportune trasformazioni su lista, e poi costruite la stringa da restituire con
" ".join(lista)
"""
def nostop(stringa, stopwords):
# scrivi qui
# INIZIO TEST - NON TOCCARE !
assert nostop("un", ["un"]) == ""
assert nostop("un", []) == "un"
assert nostop("", []) == ""
assert nostop("", ["un"]) == ""
assert nostop("un libro", ["un"]) == "libro"
assert nostop("un libro su Python", ["un","su"]) == "libro Python"
assert nostop("un libro su Python per principianti", ["un","uno","il","su","per"]) == "libro Python principianti"
# FINE TEST | 35.631579 | 184 | 0.711226 | 187 | 1,354 | 5.139037 | 0.502674 | 0.087409 | 0.087409 | 0.046826 | 0.148803 | 0.148803 | 0 | 0 | 0 | 0 | 0 | 0.002691 | 0.176514 | 1,354 | 38 | 185 | 35.631579 | 0.859193 | 0.035451 | 0 | 0 | 0 | 0 | 0.332487 | 0 | 0 | 0 | 0 | 0 | 0.875 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c26cb3a76e59fba6adeab3c3014a594b23510512 | 860 | py | Python | podenco/domain/podcast.py | cristobalcl/podenco | 848213e40e3d418f1d8913720ae7dc0f0d0e873c | [
"MIT"
] | null | null | null | podenco/domain/podcast.py | cristobalcl/podenco | 848213e40e3d418f1d8913720ae7dc0f0d0e873c | [
"MIT"
] | null | null | null | podenco/domain/podcast.py | cristobalcl/podenco | 848213e40e3d418f1d8913720ae7dc0f0d0e873c | [
"MIT"
] | null | null | null | import typing
import attr
@attr.s(auto_attribs=True)
class Author:
name: str
email: str
def to_dict(self):
return attr.asdict(self)
@attr.s(auto_attribs=True)
class Episode:
id: int
title: str
description: str
audio_file: str
@attr.s(auto_attribs=True)
class Podcast:
title: str
subtitle: str
description: str
author: Author
base_url: str
episodes: typing.List[Episode] = attr.Factory(list)
@property
def atom_url(self) -> str:
return self.base_url + "/podcast.atom"
@property
def rss_url(self) -> str:
return self.base_url + "/podcast.rss"
@property
def logo_url(self) -> str:
return self.base_url + "/podcast.jpg"
def episode_audio_url(self, episode: Episode) -> str:
return "{}/{}/audio.mp3".format(self.base_url, episode.id)
| 19.111111 | 66 | 0.638372 | 117 | 860 | 4.564103 | 0.333333 | 0.065543 | 0.082397 | 0.089888 | 0.331461 | 0.331461 | 0.191011 | 0.191011 | 0 | 0 | 0 | 0.001538 | 0.244186 | 860 | 44 | 67 | 19.545455 | 0.82 | 0 | 0 | 0.30303 | 0 | 0 | 0.060465 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.151515 | false | 0 | 0.060606 | 0.151515 | 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 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
c29f199450316964603960993fe6b577532883e9 | 2,012 | py | Python | image_related.py | zaqwes8811/ip-cores | 767842f4feef69f57c2d5a859b6860ab060efea4 | [
"MIT"
] | null | null | null | image_related.py | zaqwes8811/ip-cores | 767842f4feef69f57c2d5a859b6860ab060efea4 | [
"MIT"
] | 2 | 2015-10-17T19:51:53.000Z | 2015-11-06T08:21:09.000Z | image_related.py | zaqwes8811/spec-emb | 767842f4feef69f57c2d5a859b6860ab060efea4 | [
"MIT"
] | null | null | null | # encoding: utf-8
import sys
# sys.path.append("./deModel-0.2")
import deModel
import numpy as np
import cv2
if __name__ == '__main__':
if 0:
fn = '/home/zaqwes/Dropbox/Pictures/the_composer_by_stellarstatelogic-d5srz6u.png'
img = cv2.imread(fn, 0)
dim = np.array(np.array(img.shape) * 0.5, dtype=np.int32)
tmp = dim[0]
dim[0] = dim[1]
dim[1] = tmp
img = cv2.resize(img, tuple(dim))
y_end, x_end = img.shape
print "(y_end, x_end)", y_end, x_end
# to mif
for j in range(y_end):
for i in range(x_end):
px_val = img[j, i]
if 1:
# in [0, 48] prec 0.01
# out [-100, 100] prec 0.01
print np.ceil(np.log2(48))
print np.ceil(np.abs(np.log2(0.01))) # np.abs last is wrong
print np.ceil(np.log2(100)) + 1 # +1 signed
# Sum if f is equal
# 2**f - move point left
#x + y = (x * 2*f + y * 2 * f) / 2**f
# Attention!!!
# "One issue we need to be aware of is that a design might represent dif-
# ferent signals as fixed-point numbers of different lengths or with the binary
# point in different positions"
# Rules:
'''
Unsigned Wordlength:
U(a, b) is a + b
Signed Wordlength:
A(a, b) is a + b + 1
Unsigned range:
U(a, b) is 0 <= x <= 2**a - 2**-b
Signed range:
A(a, b) -2**a <= alpha <= 2**a - 2**-b
Addition res:
X(e, f) is X(e+1, f)
Unsigned Multiplication
U(a 1 , b 1 ) × U(a 2 , b 2 ) = U(a 1 + a 2 , b 1 + b 2 ).
Signed Multiplication
A(a 1 , b 1 ) × A(a 2 , b 2 ) = A(a 1 + a 2 + 1, b 1 + b 2 ).
Wordlength reduction:
HIn(A(a, b)) = A(a, n − a − 1) and
LOn(A(a, b)) = A(n − b − 1, b). fixme: ???
Similarly, for unsigned values,
HIn(U(a, b)) = U(a, n − a) and
LOn(U(a, b)) = U(n − b, b).
'''
| 25.15 | 90 | 0.484095 | 344 | 2,012 | 2.796512 | 0.334302 | 0.02079 | 0.015593 | 0.024948 | 0.058212 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061563 | 0.370278 | 2,012 | 79 | 91 | 25.468354 | 0.691397 | 0.203777 | 0 | 0 | 0 | 0 | 0.117576 | 0.090909 | 0 | 0 | 0 | 0.012658 | 0 | 0 | null | null | 0 | 0.181818 | null | null | 0.181818 | 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 |
c2af0b5eae9d4c4b4215dd69e08af9ea1c50241f | 251 | py | Python | Python/Numpy/Eye and Identity.py | pavstar619/HackerRank | 697ee46b6e621ad884a064047461d7707b1413cd | [
"MIT"
] | 61 | 2017-04-27T13:45:12.000Z | 2022-01-27T11:40:15.000Z | Python/Numpy/Eye and Identity.py | fahad0193/HackerRank | eb6c95e16688c02921c1df6b6ea613667a251457 | [
"MIT"
] | 1 | 2017-06-24T14:16:06.000Z | 2017-06-24T14:16:28.000Z | Python/Numpy/Eye and Identity.py | fahad0193/HackerRank | eb6c95e16688c02921c1df6b6ea613667a251457 | [
"MIT"
] | 78 | 2017-07-05T11:48:20.000Z | 2022-02-08T08:04:22.000Z | import numpy as np
class Main:
def __init__(self):
self.n, self.m = map(int, input().split())
def output(self):
print(np.eye(self.n, self.m, k=0))
if __name__ == '__main__':
obj = Main()
obj.output()
| 19.307692 | 50 | 0.533865 | 36 | 251 | 3.388889 | 0.638889 | 0.081967 | 0.147541 | 0.163934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005747 | 0.306773 | 251 | 12 | 51 | 20.916667 | 0.695402 | 0 | 0 | 0 | 0 | 0 | 0.031873 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0 | 0.444444 | 0.111111 | 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 |
c2cbf601a49130dfe608c81a8e2804a24112c260 | 2,277 | py | Python | nlp_tasks/absa/aspect_category_detection_and_sentiment_classification/allennlp_callback.py | l294265421/AC-MIMLLN | f62e71a1d7f3f6a6d2c3ec469570a171db4300a4 | [
"MIT"
] | 21 | 2020-12-12T01:54:56.000Z | 2021-12-14T12:26:51.000Z | nlp_tasks/absa/aspect_category_detection_and_sentiment_classification/allennlp_callback.py | l294265421/AC-MIMLLN | f62e71a1d7f3f6a6d2c3ec469570a171db4300a4 | [
"MIT"
] | 1 | 2021-09-27T03:07:22.000Z | 2021-09-28T08:22:59.000Z | nlp_tasks/absa/aspect_category_detection_and_sentiment_classification/allennlp_callback.py | l294265421/AC-MIMLLN | f62e71a1d7f3f6a6d2c3ec469570a171db4300a4 | [
"MIT"
] | 4 | 2020-12-30T13:40:37.000Z | 2021-12-05T09:30:50.000Z | # -*- coding: utf-8 -*-
from allennlp.models import Model
from nlp_tasks.absa.aspect_category_detection_and_sentiment_classification import pytorch_models
class Callback(object):
"""Abstract base class used to build new callbacks.
"""
def __init__(self):
pass
def on_epoch_end(self, epoch: int):
pass
def on_epoch_begin(self, epoch: int):
pass
def on_batch_end(self, batch: int):
pass
def on_train_begin(self):
pass
class EstimateCallback(Callback):
def __init__(self, data_type_and_data: dict, estimator: pytorch_models.Estimator, logger):
self.data_type_and_data = data_type_and_data
self.estimator = estimator
self.logger = logger
def on_epoch_end(self, epoch):
for data_type, data in self.data_type_and_data.items():
result = self.estimator.estimate(data)
self.logger.info('epoch: %d data_type: %s result: %s' % (epoch, data_type, str(result)))
def on_batch_end(self, batch: int):
for data_type, data in self.data_type_and_data.items():
result = self.estimator.estimate(data)
self.logger.info('batch: %d data_type: %s result: %s' % (batch, data_type, str(result)))
class SetLossWeightCallback(Callback):
def __init__(self, model: pytorch_models.TextInAllAspectSentimentOutModel, logger, acd_warmup_epoch_num=0):
self.model = model
self.acd_warmup_epoch_num = acd_warmup_epoch_num
self.logger = logger
def on_epoch_begin(self, epoch: int):
if epoch < self.acd_warmup_epoch_num:
self.model.sentiment_loss_weight = 0
else:
self.model.category_loss_weight = 1
self.model.sentiment_loss_weight = 1
class FixedLossWeightCallback(Callback):
def __init__(self, model: pytorch_models.TextInAllAspectSentimentOutModel, logger, category_loss_weight=1,
sentiment_loss_weight=1):
self.model = model
self.category_loss_weight = category_loss_weight
self.sentiment_loss_weight = sentiment_loss_weight
def on_train_begin(self):
self.model.category_loss_weight = self.category_loss_weight
self.model.sentiment_loss_weight = self.sentiment_loss_weight
| 31.625 | 111 | 0.69126 | 295 | 2,277 | 4.99322 | 0.223729 | 0.088255 | 0.090292 | 0.050917 | 0.608961 | 0.416158 | 0.289206 | 0.218601 | 0.218601 | 0.116769 | 0 | 0.003953 | 0.222222 | 2,277 | 71 | 112 | 32.070423 | 0.827781 | 0.033377 | 0 | 0.413043 | 0 | 0 | 0.03098 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0.108696 | 0.043478 | 0 | 0.391304 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
c2da5f8a6899b8882b9de74441d9331fa4f7fecc | 26,157 | py | Python | hackathon/mBrainAligner/src/3D_U-Net/model/DS_model.py | zzhmark/vaa3d_tools | 3ca418add85a59ac7e805d55a600b78330d7e53d | [
"MIT"
] | 1 | 2021-12-27T19:14:03.000Z | 2021-12-27T19:14:03.000Z | hackathon/mBrainAligner/src/3D_U-Net/model/DS_model.py | zzhmark/vaa3d_tools | 3ca418add85a59ac7e805d55a600b78330d7e53d | [
"MIT"
] | null | null | null | hackathon/mBrainAligner/src/3D_U-Net/model/DS_model.py | zzhmark/vaa3d_tools | 3ca418add85a59ac7e805d55a600b78330d7e53d | [
"MIT"
] | null | null | null | import numpy as np
import keras
from keras import backend as K
from keras.engine import Input, Model
from keras.layers import Conv3D, MaxPooling3D, AveragePooling3D, UpSampling3D, Activation, \
BatchNormalization, PReLU, Deconvolution3D, LeakyReLU, add, Dense, Flatten, GlobalAveragePooling3D, Reshape, Multiply
from keras.optimizers import Adam,SGD
from keras.layers.core import Lambda
from metrics import dice_coefficient_loss, dice_coefficient,dice_coefficient1,\
Mean_weighted_dice_coef, Mean_weighted_dice_loss,dice_coefficient_loss1
from model.class_block import Refining_Block,DS_Block,NNet_Block,class_supervised_block,class_seg_block
from model.base_block import create_convolution_block,\
get_up_convolution,ChannelSep
K.set_image_data_format("channels_last")
keras.initializers.TruncatedNormal(mean=0.0, stddev=0.05, seed=None)
try:
from keras.engine import merge
except ImportError:
from keras.layers.merge import concatenate
# -------------------- DS -------------------- #
def DS_model(input_shape, pool_size=(2, 2, 2), n_labels=1, initial_learning_rate=0.00001, deconvolution=False,
depth=4,batch_normalization=False, instance_normalization=True, activation_name="softmax",WeightLoss = 0):
print('the shape of the input : ', input_shape)
level_filters = [32,64,128,256,512]
inputs = Input(input_shape)
current_layer = inputs
levels = list()
up_layers = list()
# add levels with max pooling
for layer_depth in range(depth): # 01234
if layer_depth > -1:
layer2 = create_convolution_block(input_layer=current_layer,
n_filters=level_filters[layer_depth],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='conv1_' + str(layer_depth))
layer2 = create_convolution_block(input_layer=layer2,
n_filters=level_filters[layer_depth],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='conv2_' + str(layer_depth))
print("#", layer2._keras_shape)
levels.append(layer2)
if layer_depth < depth - 1:
current_layer = MaxPooling3D(pool_size=pool_size, name='maxpool' + str(layer_depth))(layer2)
else:
current_layer = layer2
# add levels with up-convolution or up-sampling
for layer_depth in range(depth - 2, -1, -1):
up_convolution = get_up_convolution(pool_size=pool_size,
deconvolution=deconvolution,
n_filters=level_filters[layer_depth],
name='Upsample' + str(layer_depth))(current_layer)
print("#", up_convolution._keras_shape)
print("#", levels[layer_depth]._keras_shape)
concat = concatenate([up_convolution, levels[layer_depth]], axis=4)
current_layer = create_convolution_block(n_filters=level_filters[layer_depth],
input_layer=concat,
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='Up_conv1_' + str(layer_depth))
current_layer = create_convolution_block(n_filters=level_filters[layer_depth],
input_layer=current_layer,
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='Up_conv2_' + str(layer_depth))
up_layers.append(current_layer)
layer_up0,layer_up1 = DS_Block(up_layers, BaseFilters=n_labels,n_labels = n_labels,name='DS') # DS
final_convolution = Conv3D(n_labels, (1, 1, 1),name = 'final')(current_layer)
final_convolution1 = Conv3D(n_labels, (1, 1, 1),name = 'final1')(layer_up0)
final_convolution2 = Conv3D(n_labels, (1, 1, 1),name = 'final2')(layer_up1)
# final_convolution3 = Conv3D(n_labels, (1, 1, 1),name = 'final3')(layer_up2)
# print("#", layer_up0._keras_shape)
print(final_convolution1.shape,final_convolution2.shape)
act = Activation(activation_name, name='cat')(final_convolution)
act1 = Activation(activation_name, name='cat1')(final_convolution1)
act2 = Activation(activation_name, name='cat2')(final_convolution2)
# act3 = Activation(activation_name, name='cat3')(final_convolution3)
model = Model(inputs=inputs, outputs=[act,act1,act2])
metrics = dice_coefficient
Loss = dice_coefficient_loss
model.compile(optimizer=Adam(lr=initial_learning_rate),
loss=Loss,
loss_weights = {'cat':1.0,
'cat1' : 0.6,
'cat2' : 0.8},
metrics=[metrics])
return model
# -------------------- DS + C -------------------- #
def DS_C_model(input_shape, pool_size=(2, 2, 2), n_labels=1, initial_learning_rate=0.00001, deconvolution=False,TrainOP = 'Adam',
depth=4, metrics=dice_coefficient,batch_normalization=False, instance_normalization=True, activation_name="softmax"):
print('the shape of the input : ', input_shape)
level_filters =[32,64,128,256,512]
inputs = Input(input_shape)
current_layer = inputs
levels = list()
up_layers = list()
# add levels with max pooling
for layer_depth in range(depth): # 01234
if layer_depth > -1:
layer2 = create_convolution_block(input_layer=current_layer,
n_filters=level_filters[layer_depth],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='conv1_' + str(layer_depth))
layer2 = create_convolution_block(input_layer=layer2,
n_filters=level_filters[layer_depth],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='conv2_' + str(layer_depth))
print("#", layer2._keras_shape)
levels.append(layer2)
if layer_depth < depth - 1:
current_layer = MaxPooling3D(pool_size=pool_size, name='maxpool' + str(layer_depth))(layer2)
else:
current_layer = layer2
# add levels with up-convolution or up-sampling
for layer_depth in range(depth - 2, -1, -1):
up_convolution = get_up_convolution(pool_size=pool_size,
deconvolution=deconvolution,
n_filters=level_filters[layer_depth],
name='Upsample' + str(layer_depth))(current_layer)
print("###", up_convolution._keras_shape)
print("###", levels[layer_depth]._keras_shape)
concat = concatenate([up_convolution, levels[layer_depth]], axis=4)
current_layer = create_convolution_block(n_filters=level_filters[layer_depth],
input_layer=concat,
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='Up_conv1_' + str(layer_depth))
current_layer = create_convolution_block(n_filters=level_filters[layer_depth],
input_layer=current_layer,
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='Up_conv2_' + str(layer_depth))
up_layers.append(current_layer)
layer_up0,layer_up1 = DS_Block(up_layers, BaseFilters=n_labels,n_labels = n_labels,name='DS') # DS
final_convolution = Conv3D(n_labels, (1, 1, 1),name = 'final')(current_layer)
final_convolution1 = Conv3D(n_labels, (1, 1, 1),name = 'final1')(layer_up0)
final_convolution2 = Conv3D(n_labels, (1, 1, 1),name = 'final2')(layer_up1)
# final_convolution3 = Conv3D(n_labels, (1, 1, 1),name = 'final3')(layer_up2)
print('final conv :',final_convolution1.shape, final_convolution2.shape)
# ---------- classification ---------- #
layer7_1, layer7_2, layer7_3 = class_supervised_block(final_convolution,nbasefilters=n_labels,name = 'class01')
# layer8_1, layer8_2, layer8_3 = class_supervised_block(final_convolution1,nbasefilters=n_labels,name = 'class11')
# layer9_1, layer9_2, layer9_3 = class_supervised_block(final_convolution2,nbasefilters=n_labels,name = 'class21')
# layer10_1, layer10_2, layer10_3 = class_supervised_block(final_convolution3,nbasefilters=n_labels,name = 'class31')
act = Activation(activation_name,name = 'cat')(final_convolution)
act1 = Activation(activation_name,name = 'cat1')(layer7_1)
act2 = Activation(activation_name,name = 'cat2')(layer7_2)
act3 = Activation(activation_name,name = 'cat3')(layer7_3)
# act4 = Activation(activation_name,name = 'cat4')(layer8_1)
# act5 = Activation(activation_name,name = 'cat5')(layer8_2)
# act6 = Activation(activation_name,name = 'cat6')(layer8_3)
# act7 = Activation(activation_name,name = 'cat7')(layer9_1)
# act8 = Activation(activation_name,name = 'cat8')(layer9_2)
# act9 = Activation(activation_name,name = 'cat9')(layer9_3)
# act10 = Activation(activation_name,name = 'cat10')(layer10_1)
# act11 = Activation(activation_name,name = 'cat11')(layer10_2)
# act12 = Activation(activation_name,name = 'cat12')(layer10_3)
act13 = Activation(activation_name, name='cat13')(final_convolution1)
act14 = Activation(activation_name, name='cat14')(final_convolution2)
# act15 = Activation(activation_name, name='cat15')(final_convolution3)
model = Model(inputs=inputs, outputs=[act,act13,act14,
act1,act2,act3])
# model = Model(inputs=inputs, outputs=[act,act13,act14,act15,
# act1,act2,act3,act4,act5,act6,act7,act8,act9,act10,act11,act12])
beishu = 0.5
if TrainOP == 'Adam':
model.compile(optimizer=Adam(lr=initial_learning_rate),
loss={'cat': dice_coefficient_loss,
'cat1': dice_coefficient_loss,
'cat2': dice_coefficient_loss,
'cat3': dice_coefficient_loss,
'cat13': dice_coefficient_loss,
'cat14': dice_coefficient_loss},
loss_weights={'cat': 1.,
'cat1': 1.0*beishu,
'cat2': 1.0*beishu,
'cat3': 1.0*beishu,
'cat13': 0.6,
'cat14': 0.8},
metrics=[metrics])
else:
model.compile(optimizer=SGD(lr=initial_learning_rate),
loss={'cat': dice_coefficient_loss,
'cat1': dice_coefficient_loss,
'cat2': dice_coefficient_loss,
'cat3': dice_coefficient_loss,
'cat13': dice_coefficient_loss,
'cat14': dice_coefficient_loss},
loss_weights={'cat': 1.,
'cat1': 1.0*beishu,
'cat2': 1.0*beishu,
'cat3': 1.0*beishu,
'cat13': 0.6,
'cat14': 0.8},
metrics=[metrics])
# if TrainOP == 'Adam':
#
# model.compile(optimizer=Adam(lr=initial_learning_rate),
# loss={'cat': dice_coefficient_loss,
# 'cat1': dice_coefficient_loss,
# 'cat2': dice_coefficient_loss,
# 'cat3': dice_coefficient_loss,
# 'cat4': dice_coefficient_loss,
# 'cat5': dice_coefficient_loss,
# 'cat6': dice_coefficient_loss,
# 'cat7': dice_coefficient_loss,
# 'cat8': dice_coefficient_loss,
# 'cat9': dice_coefficient_loss,
# 'cat10': dice_coefficient_loss,
# 'cat11': dice_coefficient_loss,
# 'cat12': dice_coefficient_loss,
# 'cat13': dice_coefficient_loss,
# 'cat14': dice_coefficient_loss,
# 'cat15': dice_coefficient_loss},
# loss_weights={'cat': 1.,
# 'cat1': 1.0 * beishu,
# 'cat2': 1.0 * beishu,
# 'cat3': 1.0 * beishu,
# 'cat4': 0.4 * beishu,
# 'cat5': 0.4 * beishu,
# 'cat6': 0.4 * beishu,
# 'cat7': 0.6 * beishu,
# 'cat8': 0.6 * beishu,
# 'cat9': 0.6 * beishu,
# 'cat10': 0.8 * beishu,
# 'cat11': 0.8 * beishu,
# 'cat12': 0.8 * beishu,
# 'cat13': 0.4,
# 'cat14': 0.6,
# 'cat15': 0.8},
# metrics=[metrics])
# else:
# model.compile(optimizer=SGD(lr=initial_learning_rate),
# loss={'cat': dice_coefficient_loss,
# 'cat1': dice_coefficient_loss,
# 'cat2': dice_coefficient_loss,
# 'cat3': dice_coefficient_loss,
# 'cat4': dice_coefficient_loss,
# 'cat5': dice_coefficient_loss,
# 'cat6': dice_coefficient_loss,
# 'cat7': dice_coefficient_loss,
# 'cat8': dice_coefficient_loss,
# 'cat9': dice_coefficient_loss,
# 'cat10': dice_coefficient_loss,
# 'cat11': dice_coefficient_loss,
# 'cat12': dice_coefficient_loss,
# 'cat13': dice_coefficient_loss,
# 'cat14': dice_coefficient_loss,
# 'cat15': dice_coefficient_loss},
# loss_weights={'cat': 1.,
# 'cat1': 1.0 * beishu,
# 'cat2': 1.0 * beishu,
# 'cat3': 1.0 * beishu,
# 'cat4': 0.4 * beishu,
# 'cat5': 0.4 * beishu,
# 'cat6': 0.4 * beishu,
# 'cat7': 0.6 * beishu,
# 'cat8': 0.6 * beishu,
# 'cat9': 0.6 * beishu,
# 'cat10': 0.8 * beishu,
# 'cat11': 0.8 * beishu,
# 'cat12': 0.8 * beishu,
# 'cat13': 0.4,
# 'cat14': 0.6,
# 'cat15': 0.8},
# metrics=[metrics])
return model
# -------------------- 改进DS -------------------- #
def UpdateDS_model_block( pool_size=(2, 2, 2), n_labels=1,deconvolution=False,
depth=5,batch_normalization=False, instance_normalization=True):
inputs0 = Input(shape = (64, 64, 64, 30),name = 'twoinput')
print('the shape of the input : ', inputs0._keras_shape)
level_filters = [32,64,128,256,512]
levels = list()
up_layers = list()
# add levels with max pooling
current_layer = inputs0
for layer_depth in range(depth): # 01234
if layer_depth > -1:
layer2 = create_convolution_block(input_layer=current_layer,
n_filters=level_filters[layer_depth],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='conv1_' + str(layer_depth))
layer2 = create_convolution_block(input_layer=layer2,
n_filters=level_filters[layer_depth],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='conv2_' + str(layer_depth))
print("#", layer2._keras_shape)
levels.append(layer2)
if layer_depth < depth - 1:
current_layer = MaxPooling3D(pool_size=pool_size, name='maxpool' + str(layer_depth))(layer2)
else:
current_layer = layer2
# add levels with up-convolution or up-sampling
for layer_depth in range(depth - 2, -1, -1):
up_convolution = get_up_convolution(pool_size=pool_size,
deconvolution=deconvolution,
n_filters=level_filters[layer_depth],
name='Upsample' + str(layer_depth))(current_layer)
print("#", up_convolution._keras_shape)
print("#", levels[layer_depth]._keras_shape)
concat = concatenate([up_convolution, levels[layer_depth]], axis=4)
current_layer = create_convolution_block(n_filters=level_filters[layer_depth],
input_layer=concat,
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='Up_conv1_' + str(layer_depth))
current_layer = create_convolution_block(n_filters=level_filters[layer_depth],
input_layer=current_layer,
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='Up_conv2_' + str(layer_depth))
up_layers.append(current_layer)
layer_up0, layer_up1, layer_up2 = DS_Block(up_layers, BaseFilters=level_filters[0], n_labels=n_labels,
name='DS') # DS
feature = Conv3D(n_labels, (1, 1, 1), name='final')(current_layer)
feature1 = Conv3D(n_labels, (1, 1, 1), name='final1')(layer_up0)
feature2 = Conv3D(n_labels, (1, 1, 1), name='final2')(layer_up1)
feature3 = Conv3D(n_labels, (1, 1, 1), name='final3')(layer_up2)
model = Model(inputs=inputs0, outputs=[feature,feature1,feature2,feature3])
return model
def UpdateDS_model(input_shape,input_shape1, pool_size=(2, 2, 2), n_labels=1, initial_learning_rate=0.00001, deconvolution=False,
depth=5,batch_normalization=False, instance_normalization=True, activation_name="softmax",WeightLoss = 0):
level_filters = [32,64,128,256,512]
inputs = Input(input_shape)
inputs1 = Input(input_shape1)
print(' input1 : ',inputs._keras_shape)
print(' input2 : ', inputs1._keras_shape)
inputs_0 = create_convolution_block(input_layer=inputs,
n_filters=level_filters[0],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='newconv1_' + str(0))
inputs1_1 = create_convolution_block(input_layer=inputs1,
n_filters=level_filters[0],
batch_normalization=batch_normalization,
instance_normalization=instance_normalization,
activation=LeakyReLU,
name='newconv2_' + str(0))
print(' conv1 of input1 : ',inputs_0._keras_shape)
print(' conv2 of input2 : ',inputs1_1._keras_shape)
model = UpdateDS_model_block(pool_size=pool_size, n_labels=n_labels,deconvolution=deconvolution,
depth=depth,batch_normalization=batch_normalization, instance_normalization=instance_normalization)
final_convolution,final_convolution1,\
final_convolution2,final_convolution3 = model(inputs_0)
final_convolution4,final_convolution5,\
final_convolution6,final_convolution7 = model(inputs1_1)
print(final_convolution.shape,final_convolution1.shape,final_convolution2.shape,final_convolution3.shape)
print(final_convolution4.shape, final_convolution5.shape, final_convolution6.shape, final_convolution7.shape)
act = Activation(activation_name, name='cat')(final_convolution)
act1 = Activation(activation_name, name='cat1')(final_convolution1)
act2 = Activation(activation_name, name='cat2')(final_convolution2)
act3 = Activation(activation_name, name='cat3')(final_convolution3)
act4 = Activation(activation_name, name='cat4')(final_convolution4)
act5 = Activation(activation_name, name='cat5')(final_convolution5)
act6 = Activation(activation_name, name='cat6')(final_convolution6)
act7 = Activation(activation_name, name='cat7')(final_convolution7)
concat = concatenate([act,act4], axis=4,name = 'concate')
concat1 = concatenate([act1, act5], axis=4, name='concate1')
concat2 = concatenate([act2, act6], axis=4, name='concate2')
concat3 = concatenate([act3, act7], axis=4, name='concate3')
model = Model(inputs=[inputs,inputs1], outputs=[act,act1,act2,act3,concat,concat1,concat2,concat3])
model.compile(optimizer=Adam(lr=initial_learning_rate),
loss={'cat':dice_coefficient_loss,
'cat1' : dice_coefficient_loss,
'cat2' : dice_coefficient_loss,
'cat3' : dice_coefficient_loss,
'concate': dice_coefficient_loss1,
'concate1': dice_coefficient_loss1,
'concate2': dice_coefficient_loss1,
'concate3': dice_coefficient_loss1},
loss_weights = {'cat':1.0,
'cat1' : 0.8,
'cat2' : 0.8,
'cat3' : 0.8,
'concate': 1.0,
'concate1': 0.8,
'concate2': 0.8,
'concate3': 0.8
},
metrics={'cat':dice_coefficient,
'cat1' : dice_coefficient,
'cat2' : dice_coefficient,
'cat3' : dice_coefficient,
'concate': dice_coefficient1,
'concate1': dice_coefficient1,
'concate2': dice_coefficient1,
'concate3': dice_coefficient1
})
return model
| 53.490798 | 135 | 0.50885 | 2,332 | 26,157 | 5.417667 | 0.095626 | 0.073611 | 0.076698 | 0.062055 | 0.756847 | 0.73231 | 0.688935 | 0.683869 | 0.669463 | 0.653475 | 0 | 0.048114 | 0.396911 | 26,157 | 488 | 136 | 53.60041 | 0.752773 | 0.210154 | 0 | 0.655844 | 0 | 0 | 0.037888 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.012987 | false | 0 | 0.042208 | 0 | 0.068182 | 0.064935 | 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 |
c2e9d9cfe98c896ec99eccb500f7cfb5901df2c6 | 474 | py | Python | schema.py | daria33/hackbright.project | d44ff2361dafacfb9f275b71f8c7b246ecc61526 | [
"Unlicense",
"MIT"
] | 7 | 2015-03-10T17:11:04.000Z | 2019-11-11T21:48:26.000Z | schema.py | daria33/hackbright.project | d44ff2361dafacfb9f275b71f8c7b246ecc61526 | [
"Unlicense",
"MIT"
] | null | null | null | schema.py | daria33/hackbright.project | d44ff2361dafacfb9f275b71f8c7b246ecc61526 | [
"Unlicense",
"MIT"
] | null | null | null | """This is the script you should run to set up the database from scratch"""
from model import Base, engine, session, addgeo
from seed import load_doctors
# Re-create the database from scratch with blank tables according to the schema
# defined in model.py
Base.metadata.drop_all(engine)
Base.metadata.create_all(engine)
# Load the seed data from seed_data.csv
load_doctors(session)
# Geocode all of the doctor records so that we have lat/lng coordinates for 'em
addgeo() | 31.6 | 79 | 0.78692 | 80 | 474 | 4.6 | 0.625 | 0.059783 | 0.081522 | 0.119565 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149789 | 474 | 15 | 80 | 31.6 | 0.913151 | 0.599156 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
c2fa2b08f50b651450408e29fc4d68ace1498804 | 1,044 | py | Python | teste.py | renatopcamara/TCC | 7a2a2cb0843a741ecce982f45a8977960bcbbc68 | [
"MIT"
] | null | null | null | teste.py | renatopcamara/TCC | 7a2a2cb0843a741ecce982f45a8977960bcbbc68 | [
"MIT"
] | null | null | null | teste.py | renatopcamara/TCC | 7a2a2cb0843a741ecce982f45a8977960bcbbc68 | [
"MIT"
] | null | null | null | # coding: utf-8
import time
import datetime
def ataque():
antes =0
agora = datetime.datetime.now().strftime("%S")
while True:
if antes == 0:
antes = datetime.datetime.now().strftime("%S")
#print("Antes:", antes)
if agora == antes: # nesse caso deve fazer append na lista
agora = datetime.datetime.now().strftime("%S")
#print("Agora = Antes == Agora:",agora ,"antes",antes)
else: # nesse caso deve sair com o MAX da lista e zerar a lista
antes = datetime.datetime.now().strftime("%S")
#print("Agora <> Anter == Agora:",agora ,"antes",antes)
#print( str(datetime.datetime.now().strftime("%H:%M:%S")))
print(int(time.time()))
time.sleep(0.5)
antes =0
agora = int(time.time())
intervalo = 4 # intervalo em segundos + 1
while True:
if antes == 0:
antes = int(time.time())
if antes >= agora - intervalo: # nesse caso deve fazer append na lista
agora = int(time.time())
else: # nesse caso deve sair com o MAX da lista e zerar a lista
antes = int(time.time())
print(int(time.time()))
#time.sleep(0.5) | 29.828571 | 71 | 0.652299 | 160 | 1,044 | 4.25625 | 0.2875 | 0.093979 | 0.096916 | 0.198238 | 0.610866 | 0.610866 | 0.50514 | 0.337739 | 0.152717 | 0.152717 | 0 | 0.012806 | 0.177203 | 1,044 | 35 | 72 | 29.828571 | 0.779977 | 0.409962 | 0 | 0.72 | 0 | 0 | 0.013223 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.04 | false | 0 | 0.08 | 0 | 0.12 | 0.08 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
c2fd855648bd9373d38d28a844dbee34e6699af1 | 371 | py | Python | rt/rt/__version__.py | bildzeitung/raytracerchallenge | 325c9c1346a6c29688794fbf50aa85efd9e976f1 | [
"MIT"
] | 1 | 2021-06-06T03:37:50.000Z | 2021-06-06T03:37:50.000Z | rt/rt/__version__.py | bildzeitung/raytracerchallenge | 325c9c1346a6c29688794fbf50aa85efd9e976f1 | [
"MIT"
] | null | null | null | rt/rt/__version__.py | bildzeitung/raytracerchallenge | 325c9c1346a6c29688794fbf50aa85efd9e976f1 | [
"MIT"
] | null | null | null | # ____ _____
# | _ \ __ _ _ |_ _| __ __ _ ___ ___ _ __
# | |_) / _` | | | || || '__/ _` |/ __/ _ \ '__|
# | _ < (_| | |_| || || | | (_| | (_| __/ |
# |_| \_\__,_|\__, ||_||_| \__,_|\___\___|_|
# |___/
#
VERSION = (0, 0, 1)
__version__ = '.'.join(map(str, VERSION))
| 33.727273 | 50 | 0.28841 | 9 | 371 | 3.777778 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015306 | 0.471698 | 371 | 10 | 51 | 37.1 | 0.158163 | 0.703504 | 0 | 0 | 0 | 0 | 0.014286 | 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 | 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 |
6c014b5999e6a7a34c5327d261218e36700f2850 | 756 | py | Python | awardsApp/migrations/0012_auto_20210920_0000.py | MutuaFranklin/App-Awards | 020c85db144156ec02f12815cd675245d4ad9db3 | [
"MIT"
] | null | null | null | awardsApp/migrations/0012_auto_20210920_0000.py | MutuaFranklin/App-Awards | 020c85db144156ec02f12815cd675245d4ad9db3 | [
"MIT"
] | null | null | null | awardsApp/migrations/0012_auto_20210920_0000.py | MutuaFranklin/App-Awards | 020c85db144156ec02f12815cd675245d4ad9db3 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-19 21:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awardsApp', '0011_alter_project_description'),
]
operations = [
migrations.AddField(
model_name='rating',
name='average_content',
field=models.IntegerField(blank=True, default=0),
),
migrations.AddField(
model_name='rating',
name='average_design',
field=models.IntegerField(blank=True, default=0),
),
migrations.AddField(
model_name='rating',
name='average_usability',
field=models.IntegerField(blank=True, default=0),
),
]
| 26.068966 | 61 | 0.584656 | 74 | 756 | 5.851351 | 0.540541 | 0.124711 | 0.159353 | 0.187067 | 0.581986 | 0.581986 | 0.581986 | 0.387991 | 0.387991 | 0.387991 | 0 | 0.041667 | 0.301587 | 756 | 28 | 62 | 27 | 0.778409 | 0.059524 | 0 | 0.545455 | 1 | 0 | 0.145275 | 0.042313 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.045455 | 0 | 0.181818 | 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 |
6c0887a4aa5d4f378b677d1b19d1085881a4568e | 1,111 | py | Python | Step1-PythonBasic/Practices/yuxq/24-25/ex25.py | Jumpers/MysoftAutoTest | 50efc385a96532fc0777061d6c5e7201a4991f04 | [
"Apache-2.0"
] | null | null | null | Step1-PythonBasic/Practices/yuxq/24-25/ex25.py | Jumpers/MysoftAutoTest | 50efc385a96532fc0777061d6c5e7201a4991f04 | [
"Apache-2.0"
] | null | null | null | Step1-PythonBasic/Practices/yuxq/24-25/ex25.py | Jumpers/MysoftAutoTest | 50efc385a96532fc0777061d6c5e7201a4991f04 | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
def break_words(stuff):
"""This function will break up words for us."""
words=stuff.split(' ')#拆分字符串stuff,分割符为空格
return words
def sort_words(words):#将字符串中的字符进行排查,排序规则是转换成ascll码排序
"""sorts the words"""
return sorted(words)
def print_first_word(words):#words必须是序列
"""Prints the first word after popping it off."""
word=words.pop(0)
print word
def print_last_word(words):
"""Print the last word after popping it off."""
word=words.pop(-1)#words.pop()也是指的序列中最后一个值
print word
def sort_sentence(sentence):
"""Takes in a full sentence and returns the sorted words."""
words=break_words(sentence)
return sort_words(words)
def print_first_and_last(sentence):
"""Prints the first and last word of the sentence."""
words=break_words(sentence)
print_first_word(words)
print_last_word(words)
def print_first_and_last_sorted(sentence):
"""Sorts the words then prints the first and last one."""
words=sort_sentence(sentence)
print_first_word(words)
print_last_word(words) | 30.861111 | 65 | 0.685869 | 154 | 1,111 | 4.779221 | 0.305195 | 0.097826 | 0.065217 | 0.07337 | 0.330163 | 0.273098 | 0.211957 | 0.211957 | 0.122283 | 0 | 0 | 0.003413 | 0.208821 | 1,111 | 36 | 66 | 30.861111 | 0.833902 | 0.081908 | 0 | 0.363636 | 0 | 0 | 0.001546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.454545 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
6c0bd09c638eb253b3e3519563888871286dd5df | 134 | py | Python | yc190/682.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc190/682.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc190/682.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | A, B = map(int, input().split())
result = 0
for i in range(A, B + 1):
if (A + B + i) % 3 == 0:
result += 1
print(result)
| 16.75 | 32 | 0.477612 | 25 | 134 | 2.56 | 0.64 | 0.09375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054348 | 0.313433 | 134 | 7 | 33 | 19.142857 | 0.641304 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
6c13599d68760fcb3502ec60f3226bec494a3db7 | 1,052 | py | Python | pyrobolearn/utils/data_structures/graph.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 2 | 2021-01-21T21:08:30.000Z | 2022-03-29T16:45:49.000Z | pyrobolearn/utils/data_structures/graph.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | null | null | null | pyrobolearn/utils/data_structures/graph.py | Pandinosaurus/pyrobolearn | 9cd7c060723fda7d2779fa255ac998c2c82b8436 | [
"Apache-2.0"
] | 1 | 2020-09-29T21:25:39.000Z | 2020-09-29T21:25:39.000Z |
# -*- coding: utf-8 -*-
class Graph(object):
r"""Graph.
This class described the graph data structure.
"""
pass
class DirectedGraph(Graph):
r"""Directed Graph.
This class described the directed graph data structure.
The graph is described using a dictionary.
graph = {node: [[parent nodes], [child nodes]]}
"""
class Root(object):
pass
def __init__(self):
self._root = self.Root()
self._graph = {self._root: []}
def addNode(self, parent, node):
"""
Add a node to the graph.
"""
pass
def getParents(self, node):
"""
Return the parent nodes of the given node.
"""
pass
def getChildren(self, node):
"""
Return the child nodes of the given node.
"""
pass
class DirectedAcyclicGraph(DirectedGraph):
"""Directed Acyclic Graph.
In this data structure, cycles are not allowed.
"""
def __init__(self):
super(DirectedAcyclicGraph, self).__init__()
| 19.849057 | 59 | 0.576046 | 117 | 1,052 | 5.051282 | 0.367521 | 0.040609 | 0.047377 | 0.077834 | 0.165821 | 0.077834 | 0 | 0 | 0 | 0 | 0 | 0.001383 | 0.312738 | 1,052 | 52 | 60 | 20.230769 | 0.816044 | 0.403992 | 0 | 0.368421 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0.263158 | 0 | 0 | 0.473684 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
6c13c49ec9c34744d6bf8a8c704df4e024c76c82 | 4,656 | py | Python | pubchem_soap_interface/pubchemdl.py | gitanna/chemminetools | 1cfef18bcd773421c95f8662857f31e363211cdc | [
"BSD-4-Clause-UC"
] | 2 | 2017-12-11T23:17:40.000Z | 2020-08-17T08:35:01.000Z | pubchem_soap_interface/pubchemdl.py | gitanna/chemminetools | 1cfef18bcd773421c95f8662857f31e363211cdc | [
"BSD-4-Clause-UC"
] | null | null | null | pubchem_soap_interface/pubchemdl.py | gitanna/chemminetools | 1cfef18bcd773421c95f8662857f31e363211cdc | [
"BSD-4-Clause-UC"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# bring in the ZSI-generated interface
from django.utils.daemonize import become_daemon
import os
import sys
sys.path.append('/srv/chemminetools')
sys.path.append('/srv/chemminetools/pubchem_soap_interface')
from django.core.management import setup_environ
import chemminetools.settings
setup_environ(chemminetools.settings)
from pubchem_soap_interface.PUG_services import *
# other modules/functions
from time import sleep, time
from urllib import urlopen
def asynced(_f):
def func(*args, **kargs):
try:
outfile = kargs.pop('asynced_outfile')
except:
return _f(*args, **kargs)
# the following is only executed when in async mode
try:
if os.path.exists(outfile):
t = os.stat(outfile).st_mtime
if time() - t < 3600:
f = file(outfile)
c = f.read()
f.close()
if c and not c.startswith('Error'):
return
except:
pass
try:
if os.path.exists(outfile):
os.unlink(outfile)
f = file(outfile, 'w')
f.close()
except Exception, e:
sys.stderr.write('Cannot write to output %s\n' % outfile)
sys.stderr.write(e.message)
# try:
# if os.fork() > 0:
# return
# except Exception, e:
# sys.stderr.write('Cannot fork!')
# sys.stderr.write(e.message)
# become_daemon()
try:
out = _f(*args, **kargs)
err = None
except Exception, e:
raise
err = e.message
try:
f = file(outfile, 'w')
if err:
f.write('Error:' + err)
else:
f.write(out)
f.close()
except Exception, e:
sys.stderr.write('Cannot write to output %s\n' % outfile)
sys.stderr.write(e.message)
return func
@asynced
def download(cids, format='sdf'):
"""download SDF/SMILES from PubChem website given the CIDS. If async is
set, it gives a path to a file to write the output URL"""
if format == 'sdf':
_format = 'eFormat_SDF'
_compress = 'eCompress_GZip'
elif format == 'smiles':
_format = 'eFormat_SMILES'
_compress = 'eCompress_None'
elif format == 'webtools':
_format = 'eFormat_SMILES'
_compress = 'eCompress_None'
else:
raise Exception('Unknown format: %s' % format)
# get a PUG SOAP port instance
loc = PUGLocator()
port = loc.getPUGSoap()
# start with a list of CIDs
req = InputListSoapIn()
req.set_element_ids(req.new_ids())
req.get_element_ids().set_element_int(cids)
req.set_element_idType('eID_CID')
listKey = port.InputList(req).get_element_ListKey()
# request download
req = DownloadSoapIn()
req.set_element_ListKey(listKey)
req.set_element_eFormat(_format)
req.set_element_eCompress(_compress)
downloadKey = port.Download(req).get_element_DownloadKey()
# call GetOperationStatus until the operation is finished
req = GetOperationStatusSoapIn()
req.set_element_AnyKey(downloadKey)
status = port.GetOperationStatus(req).get_element_status()
while status == 'eStatus_Queued' or status == 'eStatus_Running':
sleep(5)
status = port.GetOperationStatus(req).get_element_status()
# check status
if status == 'eStatus_Success':
# get the url of the prepared file
req = GetDownloadUrlSoapIn()
req.set_element_DownloadKey(downloadKey)
url = port.GetDownloadUrl(req).get_element_url()
if format == 'webtools':
try:
f = urlopen(url)
content = f.read()
f.close()
return content
except:
raise Exception('Error: download %s failed' % url)
return url
else:
# status indicates error
# see if there's some explanatory message
req = GetStatusMessageSoapIn()
req.set_element_AnyKey(downloadKey)
err = 'Error:' \
+ port.GetStatusMessage(req).get_element_message()
raise Exception(err)
if __name__ == '__main__':
f = file(sys.argv[1])
cids = [int(i) for i in f.read().splitlines()]
f.close()
if sys.argv[1].startswith('tmp'):
os.unlink(sys.argv[1])
download(cids, asynced_outfile=sys.argv[2], format=sys.argv[3])
# vim: noai:ts=4:sw=4:expandtab
| 27.88024 | 75 | 0.582689 | 539 | 4,656 | 4.896104 | 0.335807 | 0.034104 | 0.039409 | 0.021599 | 0.215991 | 0.162941 | 0.114437 | 0.065176 | 0.065176 | 0.065176 | 0 | 0.00437 | 0.311856 | 4,656 | 166 | 76 | 28.048193 | 0.819288 | 0.121993 | 0 | 0.327273 | 1 | 0 | 0.091671 | 0.010411 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.009091 | 0.072727 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6c4c54259a7090f96d2d05186bf83df6d10726b8 | 503 | py | Python | odoo-13.0/addons/website_crm_sms/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/website_crm_sms/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/website_crm_sms/__manifest__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Send SMS to Visitor with leads',
'category': 'Website/Website',
'sequence': 54,
'summary': 'Allows to send sms to website visitor that have lead',
'version': '1.0',
'description': """Allows to send sms to website visitor if the visitor is linked to a lead.""",
'depends': ['website_sms', 'crm'],
'data': [],
'installable': True,
'auto_install': True,
}
| 33.533333 | 99 | 0.624254 | 67 | 503 | 4.656716 | 0.701493 | 0.067308 | 0.086538 | 0.096154 | 0.198718 | 0.198718 | 0.198718 | 0 | 0 | 0 | 0 | 0.01269 | 0.2167 | 503 | 14 | 100 | 35.928571 | 0.779188 | 0.186879 | 0 | 0 | 0 | 0 | 0.655172 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6c5c6baac524408e39c9ee0ae23206b991c94411 | 283 | py | Python | rtc_app/rtc/doctype/bus_location/bus_location.py | VishDroid-dev/rtc | 0feb16165ed06b5ea6aeec181c36253fcc5ad5aa | [
"MIT"
] | null | null | null | rtc_app/rtc/doctype/bus_location/bus_location.py | VishDroid-dev/rtc | 0feb16165ed06b5ea6aeec181c36253fcc5ad5aa | [
"MIT"
] | null | null | null | rtc_app/rtc/doctype/bus_location/bus_location.py | VishDroid-dev/rtc | 0feb16165ed06b5ea6aeec181c36253fcc5ad5aa | [
"MIT"
] | 1 | 2022-01-19T15:31:21.000Z | 2022-01-19T15:31:21.000Z | # Copyright (c) 2021, Foo Fighters and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class BusLocation(Document):
def before_save(self):
self.bus_id = frappe.get_value("Bus",{"bus_name":self.bus_name})
| 23.583333 | 66 | 0.773852 | 41 | 283 | 5.219512 | 0.707317 | 0.065421 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016129 | 0.123675 | 283 | 11 | 67 | 25.727273 | 0.846774 | 0.342756 | 0 | 0 | 0 | 0 | 0.060773 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
6c65104523f6190c825194ee4c113b8e74641379 | 287 | py | Python | test.py | gnsalok/algo-ds-python | 6e37f9a536c634673451d9acaeb4968536fb0b8b | [
"MIT"
] | 3 | 2021-12-17T17:12:23.000Z | 2022-03-29T13:41:21.000Z | test.py | gnsalok/algo-ds-python | 6e37f9a536c634673451d9acaeb4968536fb0b8b | [
"MIT"
] | null | null | null | test.py | gnsalok/algo-ds-python | 6e37f9a536c634673451d9acaeb4968536fb0b8b | [
"MIT"
] | null | null | null | # 5
# / \
# 3 7
# / \ / \
# 2 4 6 8
tree = Node(5)
insert(tree, Node(3))
insert(tree, Node(2))
insert(tree, Node(4))
insert(tree, Node(7))
insert(tree, Node(6))
insert(tree, Node(8))
# 5 3 2 4 7 6 8
preorder(tree)
| 16.882353 | 26 | 0.43554 | 43 | 287 | 2.906977 | 0.255814 | 0.448 | 0.672 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122093 | 0.400697 | 287 | 16 | 27 | 17.9375 | 0.604651 | 0.351916 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 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 |
6c7d07bd14c3bf94de9e9bbc0455edaf3434261c | 1,925 | py | Python | src/game/main.py | totaki/rock-band-tour | 5e83b8286b4ed1f9ce101d310b735a133b4131cc | [
"Apache-2.0"
] | null | null | null | src/game/main.py | totaki/rock-band-tour | 5e83b8286b4ed1f9ce101d310b735a133b4131cc | [
"Apache-2.0"
] | null | null | null | src/game/main.py | totaki/rock-band-tour | 5e83b8286b4ed1f9ce101d310b735a133b4131cc | [
"Apache-2.0"
] | null | null | null | from initial import groups
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.factory import Factory
from kivy.storage.jsonstore import JsonStore
from kivy.uix.screenmanager import Screen
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.properties import NumericProperty, ObjectProperty, StringProperty
from kivy.uix.gridlayout import GridLayout
from buttons import main_button
from kivy.metrics import dp
from kivy.graphics import Rectangle, Color, Line
_store = JsonStore('data.json')
class GroupLayout(BoxLayout):
group_index = NumericProperty(0)
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.add_widget(Label(text=groups[self.group_index].name))
with self.canvas:
Color(1, 0, 0, 1)
self.line = Line(width=1)
self.line.rectangle = (self.x, self.y, self.width, self.height)
class ChoiceGroupScreen(Screen):
def __init__(self, **kwargs):
super().__init__(**kwargs)
main = BoxLayout(orientation='vertical')
# Header
main.add_widget(Label(text='Выберите группу', size_hint=(1, .2), bold=True, font_size=dp(24)))
# Groups
group_box = BoxLayout(orientation='horizontal')
group_box.add_widget(GroupLayout(group_index=0))
group_box.add_widget(GroupLayout(group_index=1))
# Main control button
main.add_widget(group_box)
main.add_widget(main_button(
text='START',
size_hint=(.5, .3),
))
self.add_widget(main)
class GameApp(App):
def build(self):
state = _store.get('sys:state')
if state == 'choice_group':
return ChoiceGroupScreen()
Factory.register('GroupLayout', cls=GroupLayout)
GameApp().run()
| 29.166667 | 102 | 0.68987 | 245 | 1,925 | 5.261224 | 0.346939 | 0.086889 | 0.059736 | 0.026377 | 0.108611 | 0.108611 | 0.108611 | 0 | 0 | 0 | 0 | 0.009144 | 0.204675 | 1,925 | 65 | 103 | 29.615385 | 0.832789 | 0.017143 | 0 | 0.085106 | 0 | 0 | 0.041843 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.06383 | false | 0 | 0.340426 | 0 | 0.510638 | 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 |
6c7eef59fc73c51ed5cb16764e184e1af485a3b8 | 10,094 | py | Python | fraud_detection_domain_pb2.py | sean-walsh/akkaserverless-frauddetection-python | eaa483458116fef0fa2df2634b633636dfbc15c6 | [
"MIT"
] | 1 | 2021-11-02T12:54:25.000Z | 2021-11-02T12:54:25.000Z | fraud_detection_domain_pb2.py | sean-walsh/akkaserverless-frauddetection-python | eaa483458116fef0fa2df2634b633636dfbc15c6 | [
"MIT"
] | null | null | null | fraud_detection_domain_pb2.py | sean-walsh/akkaserverless-frauddetection-python | eaa483458116fef0fa2df2634b633636dfbc15c6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fraud_detection_domain.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()
DESCRIPTOR = _descriptor.FileDescriptor(
name='fraud_detection_domain.proto',
package='frauddetection.domain',
syntax='proto3',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\x1c\x66raud_detection_domain.proto\x12\x15\x66rauddetection.domain\"W\n\x15\x46raudDetectionCreated\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x01(\t\x12\x0f\n\x07rule_id\x18\x02 \x01(\t\x12\x18\n\x10max_amount_cents\x18\x03 \x01(\x05\"\xac\x01\n\x16ScoredTransactionAdded\x12\x13\n\x0b\x63ustomer_id\x18\x01 \x01(\t\x12\x16\n\x0etransaction_id\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\x03\x12\x14\n\x0c\x61mount_cents\x18\x04 \x01(\x05\x12\x17\n\x0fpotential_fraud\x18\x05 \x01(\x08\x12\x12\n\nrisk_score\x18\x06 \x01(\x05\x12\x0f\n\x07rule_id\x18\x07 \x01(\t\"Z\n\x19\x46raudDetectionRuleUpdated\x12\x12\n\ncustomerId\x18\x01 \x01(\t\x12\x0f\n\x07rule_id\x18\x02 \x01(\t\x12\x18\n\x10max_amount_cents\x18\x03 \x01(\x05\x62\x06proto3'
)
_FRAUDDETECTIONCREATED = _descriptor.Descriptor(
name='FraudDetectionCreated',
full_name='frauddetection.domain.FraudDetectionCreated',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='customer_id', full_name='frauddetection.domain.FraudDetectionCreated.customer_id', 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='rule_id', full_name='frauddetection.domain.FraudDetectionCreated.rule_id', 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='max_amount_cents', full_name='frauddetection.domain.FraudDetectionCreated.max_amount_cents', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=55,
serialized_end=142,
)
_SCOREDTRANSACTIONADDED = _descriptor.Descriptor(
name='ScoredTransactionAdded',
full_name='frauddetection.domain.ScoredTransactionAdded',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='customer_id', full_name='frauddetection.domain.ScoredTransactionAdded.customer_id', 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='transaction_id', full_name='frauddetection.domain.ScoredTransactionAdded.transaction_id', 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='timestamp', full_name='frauddetection.domain.ScoredTransactionAdded.timestamp', index=2,
number=3, type=3, cpp_type=2, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='amount_cents', full_name='frauddetection.domain.ScoredTransactionAdded.amount_cents', index=3,
number=4, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='potential_fraud', full_name='frauddetection.domain.ScoredTransactionAdded.potential_fraud', index=4,
number=5, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
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='risk_score', full_name='frauddetection.domain.ScoredTransactionAdded.risk_score', index=5,
number=6, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='rule_id', full_name='frauddetection.domain.ScoredTransactionAdded.rule_id', index=6,
number=7, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=145,
serialized_end=317,
)
_FRAUDDETECTIONRULEUPDATED = _descriptor.Descriptor(
name='FraudDetectionRuleUpdated',
full_name='frauddetection.domain.FraudDetectionRuleUpdated',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='customerId', full_name='frauddetection.domain.FraudDetectionRuleUpdated.customerId', 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='rule_id', full_name='frauddetection.domain.FraudDetectionRuleUpdated.rule_id', 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='max_amount_cents', full_name='frauddetection.domain.FraudDetectionRuleUpdated.max_amount_cents', index=2,
number=3, type=5, cpp_type=1, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=319,
serialized_end=409,
)
DESCRIPTOR.message_types_by_name['FraudDetectionCreated'] = _FRAUDDETECTIONCREATED
DESCRIPTOR.message_types_by_name['ScoredTransactionAdded'] = _SCOREDTRANSACTIONADDED
DESCRIPTOR.message_types_by_name['FraudDetectionRuleUpdated'] = _FRAUDDETECTIONRULEUPDATED
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
FraudDetectionCreated = _reflection.GeneratedProtocolMessageType('FraudDetectionCreated', (_message.Message,), {
'DESCRIPTOR' : _FRAUDDETECTIONCREATED,
'__module__' : 'fraud_detection_domain_pb2'
# @@protoc_insertion_point(class_scope:frauddetection.domain.FraudDetectionCreated)
})
_sym_db.RegisterMessage(FraudDetectionCreated)
ScoredTransactionAdded = _reflection.GeneratedProtocolMessageType('ScoredTransactionAdded', (_message.Message,), {
'DESCRIPTOR' : _SCOREDTRANSACTIONADDED,
'__module__' : 'fraud_detection_domain_pb2'
# @@protoc_insertion_point(class_scope:frauddetection.domain.ScoredTransactionAdded)
})
_sym_db.RegisterMessage(ScoredTransactionAdded)
FraudDetectionRuleUpdated = _reflection.GeneratedProtocolMessageType('FraudDetectionRuleUpdated', (_message.Message,), {
'DESCRIPTOR' : _FRAUDDETECTIONRULEUPDATED,
'__module__' : 'fraud_detection_domain_pb2'
# @@protoc_insertion_point(class_scope:frauddetection.domain.FraudDetectionRuleUpdated)
})
_sym_db.RegisterMessage(FraudDetectionRuleUpdated)
# @@protoc_insertion_point(module_scope)
| 45.674208 | 760 | 0.771349 | 1,221 | 10,094 | 6.052416 | 0.126126 | 0.045467 | 0.069418 | 0.062111 | 0.719621 | 0.645332 | 0.616779 | 0.611367 | 0.606225 | 0.606225 | 0 | 0.032218 | 0.114424 | 10,094 | 220 | 761 | 45.881818 | 0.794496 | 0.04676 | 0 | 0.6875 | 1 | 0.005208 | 0.229576 | 0.200749 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.020833 | 0 | 0.020833 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6c80406099fe24116ee597d120b6983e4c241f4c | 270 | py | Python | RollOver/RollOver.py | DDQQddq/GameGuaBi | ca5d4fcac2dfd8cd5505f873d556dc1d44c31e5a | [
"MIT"
] | null | null | null | RollOver/RollOver.py | DDQQddq/GameGuaBi | ca5d4fcac2dfd8cd5505f873d556dc1d44c31e5a | [
"MIT"
] | null | null | null | RollOver/RollOver.py | DDQQddq/GameGuaBi | ca5d4fcac2dfd8cd5505f873d556dc1d44c31e5a | [
"MIT"
] | null | null | null | import pyautogui
import time
# Game_Link:http://game2.baifumeiba.com/minigame/ydygdy/
time.sleep(0.2)
pyautogui.click(1500, 640)
pyautogui.moveTo(1500, 1090, 0.05)
pyautogui.mouseDown()
pyautogui.moveTo(1500, -1080, 0.01)
time.sleep(1)
pyautogui.mouseUp()
| 20.769231 | 57 | 0.733333 | 39 | 270 | 5.051282 | 0.641026 | 0.091371 | 0.192893 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138655 | 0.118519 | 270 | 12 | 58 | 22.5 | 0.689076 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.222222 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
665eb4d4f5237b1ca1b17bc44f4bc66e3966d268 | 3,475 | py | Python | festival/models.py | eubr-bigsea/festival | aa121d319769d9a414ba4e4c5b4e21879e95951e | [
"Apache-2.0"
] | null | null | null | festival/models.py | eubr-bigsea/festival | aa121d319769d9a414ba4e4c5b4e21879e95951e | [
"Apache-2.0"
] | null | null | null | festival/models.py | eubr-bigsea/festival | aa121d319769d9a414ba4e4c5b4e21879e95951e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import json
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, Float, \
Enum, DateTime, Numeric, Text, Unicode, UnicodeText
from sqlalchemy import event
from sqlalchemy.sql import func
from sqlalchemy.orm import relationship, backref
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy_i18n import make_translatable, translation_base, Translatable
make_translatable(options={'locales': ['pt', 'en', 'es'],
'auto_create_locales': True,
'fallback_locale': 'en'})
db = SQLAlchemy()
# noinspection PyClassHasNoInit
class ResultType:
TOPIC = 'TOPIC'
TRAFFIC_JAM = 'TRAFFIC_JAM'
SENTIMENT = 'SENTIMENT'
@staticmethod
def values():
return [n for n in ResultType.__dict__.keys()
if n[0] != '_' and n != 'values']
class City(db.Model):
""" City """
__tablename__ = 'city'
# Fields
id = Column(Integer, primary_key=True)
name = Column(String(200), nullable=False)
slug = Column(String(50), nullable=False)
def __unicode__(self):
return self.name
def __repr__(self):
return '<Instance {}: {}>'.format(self.__class__, self.id)
class Experiment(db.Model):
""" Experiment """
__tablename__ = 'experiment'
# Fields
id = Column(Integer, primary_key=True)
date = Column(DateTime, nullable=False)
type = Column(Enum(*ResultType.values(),
name='ResultTypeEnumType'), nullable=False)
# Associations
city_id = Column(Integer,
ForeignKey("city.id"), nullable=False)
city = relationship(
"City",
foreign_keys=[city_id])
def __unicode__(self):
return self.date
def __repr__(self):
return '<Instance {}: {}>'.format(self.__class__, self.id)
class GridCell(db.Model):
""" A grid cell for displaying results for EUBra-BIGSEA """
__tablename__ = 'grid_cell'
# Fields
id = Column(Integer, primary_key=True)
north_latitude = Column(Numeric(12, 8), nullable=False)
south_latitude = Column(Numeric(12, 8), nullable=False)
east_longitude = Column(Numeric(12, 8), nullable=False)
west_longitude = Column(Numeric(12, 8), nullable=False)
# Associations
city_id = Column(Integer,
ForeignKey("city.id"), nullable=False)
city = relationship(
"City",
foreign_keys=[city_id])
def __unicode__(self):
return self.north_latitude
def __repr__(self):
return '<Instance {}: {}>'.format(self.__class__, self.id)
class Result(db.Model):
""" Result """
__tablename__ = 'result'
# Fields
id = Column(Integer, primary_key=True)
date = Column(DateTime, nullable=False)
updated = Column(DateTime, nullable=False)
value = Column(Float)
# Associations
grid_cell_id = Column(Integer,
ForeignKey("grid_cell.id"), nullable=False)
grid_cell = relationship(
"GridCell",
foreign_keys=[grid_cell_id])
experiment_id = Column(Integer,
ForeignKey("experiment.id"), nullable=False)
experiment = relationship(
"Experiment",
foreign_keys=[experiment_id])
def __unicode__(self):
return self.date
def __repr__(self):
return '<Instance {}: {}>'.format(self.__class__, self.id)
| 27.8 | 77 | 0.633957 | 373 | 3,475 | 5.624665 | 0.281501 | 0.086749 | 0.057197 | 0.040038 | 0.411821 | 0.400381 | 0.400381 | 0.301716 | 0.301716 | 0.301716 | 0 | 0.008018 | 0.246331 | 3,475 | 124 | 78 | 28.024194 | 0.793051 | 0.056978 | 0 | 0.365854 | 0 | 0 | 0.080481 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.109756 | false | 0 | 0.109756 | 0.109756 | 0.756098 | 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 |
665ecb872c137197bb77982242f35a40d520ec8d | 136 | py | Python | week2/opcionais/dezenas.py | jotavev/usp-computer-science-python | 82aaa410f245e339c25e4a2b1a61e410259d0f8c | [
"MIT"
] | 1 | 2020-06-10T03:39:07.000Z | 2020-06-10T03:39:07.000Z | week2/opcionais/dezenas.py | jotavev/usp-computer-science-python | 82aaa410f245e339c25e4a2b1a61e410259d0f8c | [
"MIT"
] | null | null | null | week2/opcionais/dezenas.py | jotavev/usp-computer-science-python | 82aaa410f245e339c25e4a2b1a61e410259d0f8c | [
"MIT"
] | null | null | null | numero = int(input('Digite um número inteiro: '))
dezena = numero // 10
dezena = dezena % 10
print(f'O dígito das dezenas é {dezena}')
| 22.666667 | 49 | 0.683824 | 21 | 136 | 4.428571 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035714 | 0.176471 | 136 | 5 | 50 | 27.2 | 0.794643 | 0 | 0 | 0 | 0 | 0 | 0.419118 | 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 |
666d6f2f59af8f05dfd2b439570ed35238d2db45 | 1,342 | py | Python | 12 - Grep and Python/exerciseSample.py | igorceridorio/CyberCampUNK2016 | f18275a2b1ebdb1c2fa18bb298f7d3cb7e2afb8c | [
"MIT"
] | 1 | 2018-07-18T16:57:28.000Z | 2018-07-18T16:57:28.000Z | 12 - Grep and Python/exerciseSample.py | igorceridorio/CyberCampUNK2016 | f18275a2b1ebdb1c2fa18bb298f7d3cb7e2afb8c | [
"MIT"
] | null | null | null | 12 - Grep and Python/exerciseSample.py | igorceridorio/CyberCampUNK2016 | f18275a2b1ebdb1c2fa18bb298f7d3cb7e2afb8c | [
"MIT"
] | null | null | null | import subprocess
def main():
print("= Retrieving hidden message with Grep and Python =\n")
print "\nRetrieving the message...\n"
message = ""
fileName = "hiddenMessageSample.txt"
#-------------------------------------
command = "grep -e \"OTY33NVL1BRCC000SBZNP817TOR5I6 \" " + fileName
proc = subprocess.Popen([command], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
words = out.split("---");
message += words[1]
#-------------------------------------
command = "grep -e \"B05P9LHVGDX994LV168YOHDRQW11GU \" " + fileName
proc = subprocess.Popen([command], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
words = out.split("---");
message += words[1]
#------------------------------------
command = "grep -e \"G97TVIBZUE7WE1D4GQRAAS0NWYAZRE \" " + fileName
proc = subprocess.Popen([command], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
words = out.split("---");
message += words[1]
#------------------------------------
command = "grep -e \"NVD34FU5L59OML7VW95PJG1158V2A5 \" " + fileName
proc = subprocess.Popen([command], stdout=subprocess.PIPE, shell=True)
(out, err) = proc.communicate()
words = out.split("---");
message += words[1]
#------------------------------------
print "Final message: " + message
main()
| 22 | 71 | 0.573025 | 123 | 1,342 | 6.252033 | 0.300813 | 0.057217 | 0.062419 | 0.140442 | 0.618986 | 0.618986 | 0.618986 | 0.618986 | 0.618986 | 0.618986 | 0 | 0.04 | 0.14307 | 1,342 | 60 | 72 | 22.366667 | 0.628696 | 0.135618 | 0 | 0.571429 | 0 | 0 | 0.14818 | 0.019931 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.035714 | null | null | 0.107143 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
668388f1204cde5595b61fceda660c16c86c66f4 | 542 | py | Python | app/errors.py | indigo-dc/deep-training-dashboard | 1c07341e74a74422fad082d01f5bc3caf85d054f | [
"Apache-2.0"
] | 1 | 2020-02-03T16:53:19.000Z | 2020-02-03T16:53:19.000Z | app/errors.py | indigo-dc/deep-training-dashboard | 1c07341e74a74422fad082d01f5bc3caf85d054f | [
"Apache-2.0"
] | null | null | null | app/errors.py | indigo-dc/deep-training-dashboard | 1c07341e74a74422fad082d01f5bc3caf85d054f | [
"Apache-2.0"
] | 3 | 2019-10-28T17:33:02.000Z | 2020-03-09T11:37:24.000Z | from flask import render_template, request
from app import app
@app.errorhandler(403)
def forbidden(error):
return render_template('403.html', message=error.description)
@app.errorhandler(404)
def page_not_found(error):
app.logger.error('Page not found: {}'.format(request.path))
return render_template('404.html'), 404
@app.errorhandler(500)
def internal_server_error(error):
app.logger.error('Server Error: {}'.format(error))
return render_template('500.html', support_email=app.config.get('SUPPORT_EMAIL')), 500
| 25.809524 | 90 | 0.747232 | 75 | 542 | 5.266667 | 0.4 | 0.141772 | 0.151899 | 0.126582 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0.114391 | 542 | 20 | 91 | 27.1 | 0.772917 | 0 | 0 | 0 | 0 | 0 | 0.130996 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.153846 | 0.076923 | 0.615385 | 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 |
668ab22794b282e54fb7ec44dae88b75d488bc94 | 28,072 | py | Python | nova/virt/libvirt/firewall.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/firewall.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/firewall.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Copyright 2010 United States Government as represented by the'
nl|'\n'
comment|'# Administrator of the National Aeronautics and Space Administration.'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'# Copyright (c) 2010 Citrix Systems, Inc.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
nl|'\n'
name|'import'
name|'uuid'
newline|'\n'
nl|'\n'
name|'from'
name|'eventlet'
name|'import'
name|'greenthread'
newline|'\n'
name|'from'
name|'lxml'
name|'import'
name|'etree'
newline|'\n'
name|'from'
name|'oslo_log'
name|'import'
name|'log'
name|'as'
name|'logging'
newline|'\n'
name|'from'
name|'oslo_utils'
name|'import'
name|'importutils'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'cloudpipe'
name|'import'
name|'pipelib'
newline|'\n'
name|'import'
name|'nova'
op|'.'
name|'conf'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'i18n'
name|'import'
name|'_LI'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'i18n'
name|'import'
name|'_LW'
newline|'\n'
name|'import'
name|'nova'
op|'.'
name|'virt'
op|'.'
name|'firewall'
name|'as'
name|'base_firewall'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'virt'
name|'import'
name|'netutils'
newline|'\n'
nl|'\n'
DECL|variable|LOG
name|'LOG'
op|'='
name|'logging'
op|'.'
name|'getLogger'
op|'('
name|'__name__'
op|')'
newline|'\n'
DECL|variable|CONF
name|'CONF'
op|'='
name|'nova'
op|'.'
name|'conf'
op|'.'
name|'CONF'
newline|'\n'
nl|'\n'
DECL|variable|libvirt
name|'libvirt'
op|'='
name|'None'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|NWFilterFirewall
name|'class'
name|'NWFilterFirewall'
op|'('
name|'base_firewall'
op|'.'
name|'FirewallDriver'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""This class implements a network filtering mechanism by using\n libvirt\'s nwfilter.\n all instances get a filter ("nova-base") applied. This filter\n provides some basic security such as protection against MAC\n spoofing, IP spoofing, and ARP spoofing.\n """'
newline|'\n'
nl|'\n'
DECL|member|__init__
name|'def'
name|'__init__'
op|'('
name|'self'
op|','
name|'host'
op|','
op|'**'
name|'kwargs'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Create an NWFilter firewall driver\n\n :param host: nova.virt.libvirt.host.Host instance\n :param kwargs: currently unused\n """'
newline|'\n'
nl|'\n'
name|'global'
name|'libvirt'
newline|'\n'
name|'if'
name|'libvirt'
name|'is'
name|'None'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'libvirt'
op|'='
name|'importutils'
op|'.'
name|'import_module'
op|'('
string|"'libvirt'"
op|')'
newline|'\n'
dedent|''
name|'except'
name|'ImportError'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'warning'
op|'('
name|'_LW'
op|'('
string|'"Libvirt module could not be loaded. "'
nl|'\n'
string|'"NWFilterFirewall will not work correctly."'
op|')'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'self'
op|'.'
name|'_host'
op|'='
name|'host'
newline|'\n'
name|'self'
op|'.'
name|'static_filters_configured'
op|'='
name|'False'
newline|'\n'
name|'self'
op|'.'
name|'handle_security_groups'
op|'='
name|'False'
newline|'\n'
nl|'\n'
DECL|member|apply_instance_filter
dedent|''
name|'def'
name|'apply_instance_filter'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""No-op. Everything is done in prepare_instance_filter."""'
newline|'\n'
name|'pass'
newline|'\n'
nl|'\n'
DECL|member|_get_connection
dedent|''
name|'def'
name|'_get_connection'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'self'
op|'.'
name|'_host'
op|'.'
name|'get_connection'
op|'('
op|')'
newline|'\n'
DECL|variable|_conn
dedent|''
name|'_conn'
op|'='
name|'property'
op|'('
name|'_get_connection'
op|')'
newline|'\n'
nl|'\n'
DECL|member|nova_no_nd_reflection_filter
name|'def'
name|'nova_no_nd_reflection_filter'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""This filter protects false positives on IPv6 Duplicate Address\n Detection(DAD).\n """'
newline|'\n'
name|'uuid'
op|'='
name|'self'
op|'.'
name|'_get_filter_uuid'
op|'('
string|"'nova-no-nd-reflection'"
op|')'
newline|'\n'
name|'return'
string|"'''<filter name='nova-no-nd-reflection' chain='ipv6'>\n <!-- no nd reflection -->\n <!-- drop if destination mac is v6 mcast mac addr and\n we sent it. -->\n <uuid>%s</uuid>\n <rule action='drop' direction='in'>\n <mac dstmacaddr='33:33:00:00:00:00'\n dstmacmask='ff:ff:00:00:00:00' srcmacaddr='$MAC'/>\n </rule>\n </filter>'''"
op|'%'
name|'uuid'
newline|'\n'
nl|'\n'
DECL|member|nova_dhcp_filter
dedent|''
name|'def'
name|'nova_dhcp_filter'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""The standard allow-dhcp-server filter is an <ip> one, so it uses\n ebtables to allow traffic through. Without a corresponding rule in\n iptables, it\'ll get blocked anyway.\n """'
newline|'\n'
name|'uuid'
op|'='
name|'self'
op|'.'
name|'_get_filter_uuid'
op|'('
string|"'nova-allow-dhcp-server'"
op|')'
newline|'\n'
name|'return'
string|"'''<filter name='nova-allow-dhcp-server' chain='ipv4'>\n <uuid>%s</uuid>\n <rule action='accept' direction='out'\n priority='100'>\n <udp srcipaddr='0.0.0.0'\n dstipaddr='255.255.255.255'\n srcportstart='68'\n dstportstart='67'/>\n </rule>\n <rule action='accept' direction='in'\n priority='100'>\n <udp srcipaddr='$DHCPSERVER'\n srcportstart='67'\n dstportstart='68'/>\n </rule>\n </filter>'''"
op|'%'
name|'uuid'
newline|'\n'
nl|'\n'
DECL|member|setup_basic_filtering
dedent|''
name|'def'
name|'setup_basic_filtering'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Set up basic filtering (MAC, IP, and ARP spoofing protection)."""'
newline|'\n'
name|'LOG'
op|'.'
name|'info'
op|'('
name|'_LI'
op|'('
string|"'Called setup_basic_filtering in nwfilter'"
op|')'
op|','
nl|'\n'
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
nl|'\n'
name|'if'
name|'self'
op|'.'
name|'handle_security_groups'
op|':'
newline|'\n'
comment|"# No point in setting up a filter set that we'll be overriding"
nl|'\n'
comment|'# anyway.'
nl|'\n'
indent|' '
name|'return'
newline|'\n'
nl|'\n'
dedent|''
name|'LOG'
op|'.'
name|'info'
op|'('
name|'_LI'
op|'('
string|"'Ensuring static filters'"
op|')'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'_ensure_static_filters'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'nodhcp_base_filter'
op|'='
name|'self'
op|'.'
name|'get_base_filter_list'
op|'('
name|'instance'
op|','
name|'False'
op|')'
newline|'\n'
name|'dhcp_base_filter'
op|'='
name|'self'
op|'.'
name|'get_base_filter_list'
op|'('
name|'instance'
op|','
name|'True'
op|')'
newline|'\n'
nl|'\n'
name|'for'
name|'vif'
name|'in'
name|'network_info'
op|':'
newline|'\n'
indent|' '
name|'_base_filter'
op|'='
name|'nodhcp_base_filter'
newline|'\n'
name|'for'
name|'subnet'
name|'in'
name|'vif'
op|'['
string|"'network'"
op|']'
op|'['
string|"'subnets'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'subnet'
op|'.'
name|'get_meta'
op|'('
string|"'dhcp_server'"
op|')'
op|':'
newline|'\n'
indent|' '
name|'_base_filter'
op|'='
name|'dhcp_base_filter'
newline|'\n'
name|'break'
newline|'\n'
dedent|''
dedent|''
name|'self'
op|'.'
name|'_define_filter'
op|'('
name|'self'
op|'.'
name|'_get_instance_filter_xml'
op|'('
name|'instance'
op|','
nl|'\n'
name|'_base_filter'
op|','
nl|'\n'
name|'vif'
op|')'
op|')'
newline|'\n'
nl|'\n'
DECL|member|_get_instance_filter_parameters
dedent|''
dedent|''
name|'def'
name|'_get_instance_filter_parameters'
op|'('
name|'self'
op|','
name|'vif'
op|')'
op|':'
newline|'\n'
indent|' '
name|'parameters'
op|'='
op|'['
op|']'
newline|'\n'
nl|'\n'
DECL|function|format_parameter
name|'def'
name|'format_parameter'
op|'('
name|'parameter'
op|','
name|'value'
op|')'
op|':'
newline|'\n'
indent|' '
name|'return'
op|'('
string|'"<parameter name=\'%s\' value=\'%s\'/>"'
op|'%'
op|'('
name|'parameter'
op|','
name|'value'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'network'
op|'='
name|'vif'
op|'['
string|"'network'"
op|']'
newline|'\n'
name|'if'
name|'not'
name|'vif'
op|'['
string|"'network'"
op|']'
name|'or'
name|'not'
name|'vif'
op|'['
string|"'network'"
op|']'
op|'['
string|"'subnets'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'return'
name|'parameters'
newline|'\n'
nl|'\n'
dedent|''
name|'v4_subnets'
op|'='
op|'['
name|'s'
name|'for'
name|'s'
name|'in'
name|'network'
op|'['
string|"'subnets'"
op|']'
name|'if'
name|'s'
op|'['
string|"'version'"
op|']'
op|'=='
number|'4'
op|']'
newline|'\n'
name|'v6_subnets'
op|'='
op|'['
name|'s'
name|'for'
name|'s'
name|'in'
name|'network'
op|'['
string|"'subnets'"
op|']'
name|'if'
name|'s'
op|'['
string|"'version'"
op|']'
op|'=='
number|'6'
op|']'
newline|'\n'
nl|'\n'
name|'for'
name|'subnet'
name|'in'
name|'v4_subnets'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'ip'
name|'in'
name|'subnet'
op|'['
string|"'ips'"
op|']'
op|':'
newline|'\n'
indent|' '
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'IP'"
op|','
name|'ip'
op|'['
string|"'address'"
op|']'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'dhcp_server'
op|'='
name|'subnet'
op|'.'
name|'get_meta'
op|'('
string|"'dhcp_server'"
op|')'
newline|'\n'
name|'if'
name|'dhcp_server'
op|':'
newline|'\n'
indent|' '
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'DHCPSERVER'"
op|','
name|'dhcp_server'
op|')'
op|')'
newline|'\n'
dedent|''
dedent|''
name|'if'
name|'CONF'
op|'.'
name|'use_ipv6'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'subnet'
name|'in'
name|'v6_subnets'
op|':'
newline|'\n'
indent|' '
name|'gateway'
op|'='
name|'subnet'
op|'.'
name|'get'
op|'('
string|"'gateway'"
op|')'
newline|'\n'
name|'if'
name|'gateway'
op|':'
newline|'\n'
indent|' '
name|'ra_server'
op|'='
name|'gateway'
op|'['
string|"'address'"
op|']'
op|'+'
string|'"/128"'
newline|'\n'
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'RASERVER'"
op|','
name|'ra_server'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
dedent|''
name|'if'
name|'CONF'
op|'.'
name|'allow_same_net_traffic'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'subnet'
name|'in'
name|'v4_subnets'
op|':'
newline|'\n'
indent|' '
name|'ipv4_cidr'
op|'='
name|'subnet'
op|'['
string|"'cidr'"
op|']'
newline|'\n'
name|'net'
op|','
name|'mask'
op|'='
name|'netutils'
op|'.'
name|'get_net_and_mask'
op|'('
name|'ipv4_cidr'
op|')'
newline|'\n'
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'PROJNET'"
op|','
name|'net'
op|')'
op|')'
newline|'\n'
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'PROJMASK'"
op|','
name|'mask'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'if'
name|'CONF'
op|'.'
name|'use_ipv6'
op|':'
newline|'\n'
indent|' '
name|'for'
name|'subnet'
name|'in'
name|'v6_subnets'
op|':'
newline|'\n'
indent|' '
name|'ipv6_cidr'
op|'='
name|'subnet'
op|'['
string|"'cidr'"
op|']'
newline|'\n'
name|'net'
op|','
name|'prefix'
op|'='
name|'netutils'
op|'.'
name|'get_net_and_prefixlen'
op|'('
name|'ipv6_cidr'
op|')'
newline|'\n'
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'PROJNET6'"
op|','
name|'net'
op|')'
op|')'
newline|'\n'
name|'parameters'
op|'.'
name|'append'
op|'('
name|'format_parameter'
op|'('
string|"'PROJMASK6'"
op|','
name|'prefix'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
dedent|''
name|'return'
name|'parameters'
newline|'\n'
nl|'\n'
DECL|member|_get_instance_filter_xml
dedent|''
name|'def'
name|'_get_instance_filter_xml'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'filters'
op|','
name|'vif'
op|')'
op|':'
newline|'\n'
indent|' '
name|'nic_id'
op|'='
name|'vif'
op|'['
string|"'address'"
op|']'
op|'.'
name|'replace'
op|'('
string|"':'"
op|','
string|"''"
op|')'
newline|'\n'
name|'instance_filter_name'
op|'='
name|'self'
op|'.'
name|'_instance_filter_name'
op|'('
name|'instance'
op|','
name|'nic_id'
op|')'
newline|'\n'
name|'parameters'
op|'='
name|'self'
op|'.'
name|'_get_instance_filter_parameters'
op|'('
name|'vif'
op|')'
newline|'\n'
name|'uuid'
op|'='
name|'self'
op|'.'
name|'_get_filter_uuid'
op|'('
name|'instance_filter_name'
op|')'
newline|'\n'
name|'xml'
op|'='
string|"'''<filter name='%s' chain='root'>'''"
op|'%'
name|'instance_filter_name'
newline|'\n'
name|'xml'
op|'+='
string|"'<uuid>%s</uuid>'"
op|'%'
name|'uuid'
newline|'\n'
name|'for'
name|'f'
name|'in'
name|'filters'
op|':'
newline|'\n'
indent|' '
name|'xml'
op|'+='
string|"'''<filterref filter='%s'>'''"
op|'%'
name|'f'
newline|'\n'
name|'xml'
op|'+='
string|"''"
op|'.'
name|'join'
op|'('
name|'parameters'
op|')'
newline|'\n'
name|'xml'
op|'+='
string|"'</filterref>'"
newline|'\n'
dedent|''
name|'xml'
op|'+='
string|"'</filter>'"
newline|'\n'
name|'return'
name|'xml'
newline|'\n'
nl|'\n'
DECL|member|get_base_filter_list
dedent|''
name|'def'
name|'get_base_filter_list'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'allow_dhcp'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Obtain a list of base filters to apply to an instance.\n The return value should be a list of strings, each\n specifying a filter name. Subclasses can override this\n function to add additional filters as needed. Additional\n filters added to the list must also be correctly defined\n within the subclass.\n """'
newline|'\n'
name|'if'
name|'pipelib'
op|'.'
name|'is_vpn_image'
op|'('
name|'instance'
op|'.'
name|'image_ref'
op|')'
op|':'
newline|'\n'
indent|' '
name|'base_filter'
op|'='
string|"'nova-vpn'"
newline|'\n'
dedent|''
name|'elif'
name|'allow_dhcp'
op|':'
newline|'\n'
indent|' '
name|'base_filter'
op|'='
string|"'nova-base'"
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'base_filter'
op|'='
string|"'nova-nodhcp'"
newline|'\n'
dedent|''
name|'return'
op|'['
name|'base_filter'
op|']'
newline|'\n'
nl|'\n'
DECL|member|_ensure_static_filters
dedent|''
name|'def'
name|'_ensure_static_filters'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Static filters are filters that have no need to be IP aware.\n\n There is no configuration or tuneability of these filters, so they\n can be set up once and forgotten about.\n\n """'
newline|'\n'
nl|'\n'
name|'if'
name|'self'
op|'.'
name|'static_filters_configured'
op|':'
newline|'\n'
indent|' '
name|'return'
newline|'\n'
nl|'\n'
dedent|''
name|'filter_set'
op|'='
op|'['
string|"'no-mac-spoofing'"
op|','
nl|'\n'
string|"'no-ip-spoofing'"
op|','
nl|'\n'
string|"'no-arp-spoofing'"
op|']'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'_define_filter'
op|'('
name|'self'
op|'.'
name|'nova_no_nd_reflection_filter'
op|'('
op|')'
op|')'
newline|'\n'
name|'filter_set'
op|'.'
name|'append'
op|'('
string|"'nova-no-nd-reflection'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'_define_filter'
op|'('
name|'self'
op|'.'
name|'_filter_container'
op|'('
string|"'nova-nodhcp'"
op|','
name|'filter_set'
op|')'
op|')'
newline|'\n'
name|'filter_set'
op|'.'
name|'append'
op|'('
string|"'allow-dhcp-server'"
op|')'
newline|'\n'
name|'self'
op|'.'
name|'_define_filter'
op|'('
name|'self'
op|'.'
name|'_filter_container'
op|'('
string|"'nova-base'"
op|','
name|'filter_set'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'_define_filter'
op|'('
name|'self'
op|'.'
name|'_filter_container'
op|'('
string|"'nova-vpn'"
op|','
nl|'\n'
op|'['
string|"'allow-dhcp-server'"
op|']'
op|')'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'_define_filter'
op|'('
name|'self'
op|'.'
name|'nova_dhcp_filter'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'static_filters_configured'
op|'='
name|'True'
newline|'\n'
nl|'\n'
DECL|member|_filter_container
dedent|''
name|'def'
name|'_filter_container'
op|'('
name|'self'
op|','
name|'name'
op|','
name|'filters'
op|')'
op|':'
newline|'\n'
indent|' '
name|'uuid'
op|'='
name|'self'
op|'.'
name|'_get_filter_uuid'
op|'('
name|'name'
op|')'
newline|'\n'
name|'xml'
op|'='
string|"'''<filter name='%s' chain='root'>\n <uuid>%s</uuid>\n %s\n </filter>'''"
op|'%'
op|'('
name|'name'
op|','
name|'uuid'
op|','
nl|'\n'
string|"''"
op|'.'
name|'join'
op|'('
op|'['
string|'"<filterref filter=\'%s\'/>"'
op|'%'
op|'('
name|'f'
op|','
op|')'
name|'for'
name|'f'
name|'in'
name|'filters'
op|']'
op|')'
op|')'
newline|'\n'
name|'return'
name|'xml'
newline|'\n'
nl|'\n'
DECL|member|_get_filter_uuid
dedent|''
name|'def'
name|'_get_filter_uuid'
op|'('
name|'self'
op|','
name|'name'
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'flt'
op|'='
name|'self'
op|'.'
name|'_conn'
op|'.'
name|'nwfilterLookupByName'
op|'('
name|'name'
op|')'
newline|'\n'
name|'xml'
op|'='
name|'flt'
op|'.'
name|'XMLDesc'
op|'('
number|'0'
op|')'
newline|'\n'
name|'doc'
op|'='
name|'etree'
op|'.'
name|'fromstring'
op|'('
name|'xml'
op|')'
newline|'\n'
name|'u'
op|'='
name|'doc'
op|'.'
name|'find'
op|'('
string|'"./uuid"'
op|')'
op|'.'
name|'text'
newline|'\n'
dedent|''
name|'except'
name|'Exception'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'u"Cannot find UUID for filter \'%(name)s\': \'%(e)s\'"'
op|','
nl|'\n'
op|'{'
string|"'name'"
op|':'
name|'name'
op|','
string|"'e'"
op|':'
name|'e'
op|'}'
op|')'
newline|'\n'
name|'u'
op|'='
name|'uuid'
op|'.'
name|'uuid4'
op|'('
op|')'
op|'.'
name|'hex'
newline|'\n'
nl|'\n'
dedent|''
name|'LOG'
op|'.'
name|'debug'
op|'('
string|'"UUID for filter \'%s\' is \'%s\'"'
op|','
name|'name'
op|','
name|'u'
op|')'
newline|'\n'
name|'return'
name|'u'
newline|'\n'
nl|'\n'
DECL|member|_define_filter
dedent|''
name|'def'
name|'_define_filter'
op|'('
name|'self'
op|','
name|'xml'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'callable'
op|'('
name|'xml'
op|')'
op|':'
newline|'\n'
indent|' '
name|'xml'
op|'='
name|'xml'
op|'('
op|')'
newline|'\n'
dedent|''
name|'self'
op|'.'
name|'_conn'
op|'.'
name|'nwfilterDefineXML'
op|'('
name|'xml'
op|')'
newline|'\n'
nl|'\n'
DECL|member|unfilter_instance
dedent|''
name|'def'
name|'unfilter_instance'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Clear out the nwfilter rules."""'
newline|'\n'
name|'for'
name|'vif'
name|'in'
name|'network_info'
op|':'
newline|'\n'
indent|' '
name|'nic_id'
op|'='
name|'vif'
op|'['
string|"'address'"
op|']'
op|'.'
name|'replace'
op|'('
string|"':'"
op|','
string|"''"
op|')'
newline|'\n'
name|'instance_filter_name'
op|'='
name|'self'
op|'.'
name|'_instance_filter_name'
op|'('
name|'instance'
op|','
name|'nic_id'
op|')'
newline|'\n'
nl|'\n'
comment|'# nwfilters may be defined in a separate thread in the case'
nl|'\n'
comment|'# of libvirt non-blocking mode, so we wait for completion'
nl|'\n'
name|'max_retry'
op|'='
name|'CONF'
op|'.'
name|'live_migration_retry_count'
newline|'\n'
name|'for'
name|'cnt'
name|'in'
name|'range'
op|'('
name|'max_retry'
op|')'
op|':'
newline|'\n'
indent|' '
name|'try'
op|':'
newline|'\n'
indent|' '
name|'_nw'
op|'='
name|'self'
op|'.'
name|'_conn'
op|'.'
name|'nwfilterLookupByName'
op|'('
name|'instance_filter_name'
op|')'
newline|'\n'
name|'_nw'
op|'.'
name|'undefine'
op|'('
op|')'
newline|'\n'
name|'break'
newline|'\n'
dedent|''
name|'except'
name|'libvirt'
op|'.'
name|'libvirtError'
name|'as'
name|'e'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'cnt'
op|'=='
name|'max_retry'
op|'-'
number|'1'
op|':'
newline|'\n'
indent|' '
name|'raise'
newline|'\n'
dedent|''
name|'errcode'
op|'='
name|'e'
op|'.'
name|'get_error_code'
op|'('
op|')'
newline|'\n'
name|'if'
name|'errcode'
op|'=='
name|'libvirt'
op|'.'
name|'VIR_ERR_OPERATION_INVALID'
op|':'
newline|'\n'
comment|'# This happens when the instance filter is still in use'
nl|'\n'
comment|'# (ie. when the instance has not terminated properly)'
nl|'\n'
indent|' '
name|'LOG'
op|'.'
name|'info'
op|'('
name|'_LI'
op|'('
string|"'Failed to undefine network filter '"
nl|'\n'
string|"'%(name)s. Try %(cnt)d of '"
nl|'\n'
string|"'%(max_retry)d.'"
op|')'
op|','
nl|'\n'
op|'{'
string|"'name'"
op|':'
name|'instance_filter_name'
op|','
nl|'\n'
string|"'cnt'"
op|':'
name|'cnt'
op|'+'
number|'1'
op|','
nl|'\n'
string|"'max_retry'"
op|':'
name|'max_retry'
op|'}'
op|','
nl|'\n'
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'greenthread'
op|'.'
name|'sleep'
op|'('
number|'1'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'debug'
op|'('
string|"'The nwfilter(%s) is not found.'"
op|','
nl|'\n'
name|'instance_filter_name'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'break'
newline|'\n'
nl|'\n'
dedent|''
dedent|''
dedent|''
dedent|''
dedent|''
op|'@'
name|'staticmethod'
newline|'\n'
DECL|member|_instance_filter_name
name|'def'
name|'_instance_filter_name'
op|'('
name|'instance'
op|','
name|'nic_id'
op|'='
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
name|'if'
name|'not'
name|'nic_id'
op|':'
newline|'\n'
indent|' '
name|'return'
string|"'nova-instance-%s'"
op|'%'
op|'('
name|'instance'
op|'.'
name|'name'
op|')'
newline|'\n'
dedent|''
name|'return'
string|"'nova-instance-%s-%s'"
op|'%'
op|'('
name|'instance'
op|'.'
name|'name'
op|','
name|'nic_id'
op|')'
newline|'\n'
nl|'\n'
DECL|member|instance_filter_exists
dedent|''
name|'def'
name|'instance_filter_exists'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Check nova-instance-instance-xxx exists."""'
newline|'\n'
name|'for'
name|'vif'
name|'in'
name|'network_info'
op|':'
newline|'\n'
indent|' '
name|'nic_id'
op|'='
name|'vif'
op|'['
string|"'address'"
op|']'
op|'.'
name|'replace'
op|'('
string|"':'"
op|','
string|"''"
op|')'
newline|'\n'
name|'instance_filter_name'
op|'='
name|'self'
op|'.'
name|'_instance_filter_name'
op|'('
name|'instance'
op|','
name|'nic_id'
op|')'
newline|'\n'
name|'try'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'_conn'
op|'.'
name|'nwfilterLookupByName'
op|'('
name|'instance_filter_name'
op|')'
newline|'\n'
dedent|''
name|'except'
name|'libvirt'
op|'.'
name|'libvirtError'
op|':'
newline|'\n'
indent|' '
name|'name'
op|'='
name|'instance'
op|'.'
name|'name'
newline|'\n'
name|'LOG'
op|'.'
name|'debug'
op|'('
string|"'The nwfilter(%(instance_filter_name)s) for'"
nl|'\n'
string|"'%(name)s is not found.'"
op|','
nl|'\n'
op|'{'
string|"'instance_filter_name'"
op|':'
name|'instance_filter_name'
op|','
nl|'\n'
string|"'name'"
op|':'
name|'name'
op|'}'
op|','
nl|'\n'
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
name|'return'
name|'False'
newline|'\n'
dedent|''
dedent|''
name|'return'
name|'True'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|IptablesFirewallDriver
dedent|''
dedent|''
name|'class'
name|'IptablesFirewallDriver'
op|'('
name|'base_firewall'
op|'.'
name|'IptablesFirewallDriver'
op|')'
op|':'
newline|'\n'
DECL|member|__init__
indent|' '
name|'def'
name|'__init__'
op|'('
name|'self'
op|','
name|'execute'
op|'='
name|'None'
op|','
op|'**'
name|'kwargs'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Create an IP tables firewall driver instance\n\n :param execute: unused, pass None\n :param kwargs: extra arguments\n\n The @kwargs parameter must contain a key \'host\' that\n maps to an instance of the nova.virt.libvirt.host.Host\n class.\n """'
newline|'\n'
nl|'\n'
name|'super'
op|'('
name|'IptablesFirewallDriver'
op|','
name|'self'
op|')'
op|'.'
name|'__init__'
op|'('
op|'**'
name|'kwargs'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'nwfilter'
op|'='
name|'NWFilterFirewall'
op|'('
name|'kwargs'
op|'['
string|"'host'"
op|']'
op|')'
newline|'\n'
nl|'\n'
DECL|member|setup_basic_filtering
dedent|''
name|'def'
name|'setup_basic_filtering'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Set up basic NWFilter."""'
newline|'\n'
name|'self'
op|'.'
name|'nwfilter'
op|'.'
name|'setup_basic_filtering'
op|'('
name|'instance'
op|','
name|'network_info'
op|')'
newline|'\n'
nl|'\n'
DECL|member|apply_instance_filter
dedent|''
name|'def'
name|'apply_instance_filter'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""No-op. Everything is done in prepare_instance_filter."""'
newline|'\n'
name|'pass'
newline|'\n'
nl|'\n'
DECL|member|unfilter_instance
dedent|''
name|'def'
name|'unfilter_instance'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
comment|'# NOTE(salvatore-orlando):'
nl|'\n'
comment|'# Overriding base class method for applying nwfilter operation'
nl|'\n'
indent|' '
name|'if'
name|'self'
op|'.'
name|'instance_info'
op|'.'
name|'pop'
op|'('
name|'instance'
op|'.'
name|'id'
op|','
name|'None'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'remove_filters_for_instance'
op|'('
name|'instance'
op|')'
newline|'\n'
name|'self'
op|'.'
name|'iptables'
op|'.'
name|'apply'
op|'('
op|')'
newline|'\n'
name|'self'
op|'.'
name|'nwfilter'
op|'.'
name|'unfilter_instance'
op|'('
name|'instance'
op|','
name|'network_info'
op|')'
newline|'\n'
dedent|''
name|'else'
op|':'
newline|'\n'
indent|' '
name|'LOG'
op|'.'
name|'info'
op|'('
name|'_LI'
op|'('
string|"'Attempted to unfilter instance which is not '"
nl|'\n'
string|"'filtered'"
op|')'
op|','
name|'instance'
op|'='
name|'instance'
op|')'
newline|'\n'
nl|'\n'
DECL|member|instance_filter_exists
dedent|''
dedent|''
name|'def'
name|'instance_filter_exists'
op|'('
name|'self'
op|','
name|'instance'
op|','
name|'network_info'
op|')'
op|':'
newline|'\n'
indent|' '
string|'"""Check nova-instance-instance-xxx exists."""'
newline|'\n'
name|'return'
name|'self'
op|'.'
name|'nwfilter'
op|'.'
name|'instance_filter_exists'
op|'('
name|'instance'
op|','
name|'network_info'
op|')'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit
| 14.751445 | 737 | 0.5944 | 3,985 | 28,072 | 4.097114 | 0.102133 | 0.119802 | 0.085135 | 0.057818 | 0.70509 | 0.637655 | 0.565934 | 0.511974 | 0.459607 | 0.410547 | 0 | 0.003898 | 0.141066 | 28,072 | 1,902 | 738 | 14.759201 | 0.673233 | 0 | 0 | 0.919033 | 0 | 0.00368 | 0.473639 | 0.058029 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.001577 | 0.007886 | 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 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
6691dea5c5e5f500c9a0845034255135806c9286 | 607 | py | Python | Taiyun/test.py | seucs/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 4 | 2018-03-07T07:59:58.000Z | 2019-10-19T09:31:44.000Z | Taiyun/test.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | null | null | null | Taiyun/test.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 2 | 2018-11-05T16:09:07.000Z | 2019-11-07T00:22:37.000Z | #coding=utf8
import re
import MySQLdb
from MySQLdb import cursors
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from numpy import *
from sklearn.datasets import load_iris # import datasets
# load the dataset: iris
samples = [[1,2],[2,4]]
#print samples
target = [0,1]
# import the LogisticRegression
from sklearn.linear_model import LogisticRegression
classifier = LogisticRegression() # 使用类,参数全是默认的
classifier.fit(samples, target) # 训练数据来学习,不需要返回值
print target
x = classifier.predict([5, 3]) # 测试数据,分类返回标记
print classifier.predict_proba([5, 3])
print x
| 21.678571 | 62 | 0.721582 | 78 | 607 | 5.576923 | 0.512821 | 0.050575 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024242 | 0.184514 | 607 | 27 | 63 | 22.481481 | 0.854545 | 0.23888 | 0 | 0 | 0 | 0 | 0.008869 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.411765 | null | null | 0.176471 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
669b7c11e1f04a9840740f7b44d1be48ae2fc30f | 3,155 | py | Python | notebook/book/python/head-first-python/Chapter-6/kelly.py | JMwill/note | 30e931f18c9ba942f5e5040b524047a996cf0c6c | [
"MIT"
] | null | null | null | notebook/book/python/head-first-python/Chapter-6/kelly.py | JMwill/note | 30e931f18c9ba942f5e5040b524047a996cf0c6c | [
"MIT"
] | 2 | 2018-11-27T10:45:45.000Z | 2018-12-13T14:44:54.000Z | notebook/book/python/head-first-python/Chapter-6/kelly.py | JMwill/note | 30e931f18c9ba942f5e5040b524047a996cf0c6c | [
"MIT"
] | null | null | null | def sanitize(time_string):
if '-' in time_string:
spliter = '-'
elif ':' in time_string:
spliter = ':'
else:
return time_string
(mins, secs) = time_string.split(spliter)
return mins + '.' + secs
def get_coach_data(filepath):
try:
with open(filepath) as f:
data = f.readline()
data = data.strip().split(',')
return {
'name': data.pop(0),
'dob': data.pop(0),
'times': sorted(set([sanitize(time) for time in data]))[:3]
}
except IOError as err:
print('File error: ' + str(err))
return None
sarah = get_coach_data('hfpy_ch6_data/sarah2.txt')
james = get_coach_data('hfpy_ch6_data/james2.txt')
julie = get_coach_data('hfpy_ch6_data/julie2.txt')
mikey = get_coach_data('hfpy_ch6_data/mikey2.txt')
print(sarah['name'] + "'s fastest times are: " + str(sarah['times']))
print(james['name'] + "'s fastest times are: " + str(james['times']))
print(julie['name'] + "'s fastest times are: " + str(julie['times']))
print(mikey['name'] + "'s fastest times are: " + str(mikey['times']))
print('\n==========================> line break <============================\n')
# 改进2
class Athlete():
def __init__(self, name, dob=None, times=[]):
self.name = name
self.dob = dob
self.times = times
def top3(self):
return sorted(set([sanitize(time) for time in self.times]))[:3]
def add_time(self, data):
self.times.append(data)
def add_times(self, data_arr=[]):
self.times.extend(data_arr)
def get_coach_data(filepath):
try:
with open(filepath) as f:
data = f.readline().strip().split(',')
return Athlete(data.pop(0), data.pop(0), data)
except IOError as err:
print('File error: ' + str(err))
return None
james = get_coach_data('hfpy_ch6_data/james2.txt')
julie = get_coach_data('hfpy_ch6_data/julie2.txt')
mikey = get_coach_data('hfpy_ch6_data/mikey2.txt')
sarah = get_coach_data('hfpy_ch6_data/sarah2.txt')
print(james.name + "'s fastest times are: " + str(james.top3()))
print(julie.name + "'s fastest times are: " + str(julie.top3()))
print(mikey.name + "'s fastest times are: " + str(mikey.top3()))
print(sarah.name + "'s fastest times are: " + str(sarah.top3()))
# 改进3
print('\n==========================> line break <============================\n')
class Athlete(list):
def __init__(self, name, dob=None, times=[]):
list.__init__([])
self.name = name
self.dob = dob
self.extend(times)
def top3(self):
return sorted(set([sanitize(time) for time in self]))[:3]
james = get_coach_data('hfpy_ch6_data/james2.txt')
julie = get_coach_data('hfpy_ch6_data/julie2.txt')
mikey = get_coach_data('hfpy_ch6_data/mikey2.txt')
sarah = get_coach_data('hfpy_ch6_data/sarah2.txt')
print(james.name + "'s fastest times are: " + str(james.top3()))
print(julie.name + "'s fastest times are: " + str(julie.top3()))
print(mikey.name + "'s fastest times are: " + str(mikey.top3()))
print(sarah.name + "'s fastest times are: " + str(sarah.top3()))
| 33.210526 | 81 | 0.598098 | 437 | 3,155 | 4.15103 | 0.160183 | 0.061742 | 0.092613 | 0.105843 | 0.785006 | 0.767365 | 0.767365 | 0.692393 | 0.692393 | 0.588203 | 0 | 0.017173 | 0.206339 | 3,155 | 94 | 82 | 33.56383 | 0.707268 | 0.002219 | 0 | 0.56 | 0 | 0 | 0.246423 | 0.12973 | 0 | 0 | 0 | 0 | 0 | 1 | 0.12 | false | 0 | 0 | 0.026667 | 0.253333 | 0.213333 | 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 |
66b0eabc2ae74cf2d079942ec05820b702f43ecd | 1,006 | py | Python | 18_Working with Dates and Times in Python/01_Dates and Calendars/05_Putting a list of dates in order.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 5 | 2021-02-03T14:36:58.000Z | 2022-01-01T10:29:26.000Z | 18_Working with Dates and Times in Python/01_Dates and Calendars/05_Putting a list of dates in order.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | null | null | null | 18_Working with Dates and Times in Python/01_Dates and Calendars/05_Putting a list of dates in order.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 3 | 2021-02-08T00:31:16.000Z | 2022-03-17T13:52:32.000Z | '''
05 - Putting a list of dates in order
Much like numbers and strings, date objects in Python can be put
in order. Earlier dates come before later ones, and so we can sort
a list of date objects from earliest to latest.
What if our Florida hurricane dates had been scrambled? We've gone
ahead and shuffled them so they're in random order and saved the
results as dates_scrambled. Your job is to put them back in chronological
order, and then print the first and last dates from this sorted list.
Instructions:
- Print the first and last dates in dates_scrambled.
- Sort dates_scrambled using Python's built-in sorted() method, and save the
results to dates_ordered.
- Print the first and last dates in dates_ordered.
'''
# Print the first and last scrambled dates
print(dates_scrambled[0])
print(dates_scrambled[-1])
# Put the dates in order
dates_ordered = sorted(dates_scrambled)
# Print the first and last ordered dates
print(dates_ordered[0])
print(dates_ordered[-1])
| 33.533333 | 77 | 0.761431 | 169 | 1,006 | 4.467456 | 0.420118 | 0.111258 | 0.086093 | 0.10596 | 0.196026 | 0.169536 | 0.136424 | 0.084768 | 0 | 0 | 0 | 0.007326 | 0.185885 | 1,006 | 29 | 78 | 34.689655 | 0.91453 | 0.842942 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.8 | 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 | 0 | 0 | 0 | 1 | 0 | 2 |
66e0e1003cf17a2f2767544a2a28c252e18f3ccb | 24,277 | py | Python | pysnmp/ZHONE-DISMAN-TRACEROUTE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ZHONE-DISMAN-TRACEROUTE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ZHONE-DISMAN-TRACEROUTE-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 ZHONE-DISMAN-TRACEROUTE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-DISMAN-TRACEROUTE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:41: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)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup")
MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, IpAddress, mib_2, TimeTicks, Unsigned32, ModuleIdentity, ObjectIdentity, Counter32, NotificationType, Integer32, iso, Bits, Counter64, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "IpAddress", "mib-2", "TimeTicks", "Unsigned32", "ModuleIdentity", "ObjectIdentity", "Counter32", "NotificationType", "Integer32", "iso", "Bits", "Counter64", "MibIdentifier")
RowStatus, StorageType, DisplayString, TextualConvention, TruthValue, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "StorageType", "DisplayString", "TextualConvention", "TruthValue", "DateAndTime")
OperationResponseStatus, = mibBuilder.importSymbols("ZHONE-DISMAN-PING-MIB", "OperationResponseStatus")
zhoneIp, = mibBuilder.importSymbols("Zhone", "zhoneIp")
zhoneTraceRouteMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20))
zhoneTraceRouteMIB.setRevisions(('2000-09-21 00:00',))
if mibBuilder.loadTexts: zhoneTraceRouteMIB.setLastUpdated('200009210000Z')
if mibBuilder.loadTexts: zhoneTraceRouteMIB.setOrganization('IETF Distributed Management Working Group')
zhoneTraceRouteNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 0))
zhoneTraceRouteObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1))
zhoneTraceRouteConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 2))
zhoneTraceRouteImplementationTypeDomains = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 3))
zhoneTraceRouteUsingUdpProbes = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 3, 1))
if mibBuilder.loadTexts: zhoneTraceRouteUsingUdpProbes.setStatus('current')
zhoneTraceRouteMaxConcurrentRequests = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 1), Unsigned32().clone(10)).setUnits('requests').setMaxAccess("readwrite")
if mibBuilder.loadTexts: zhoneTraceRouteMaxConcurrentRequests.setStatus('current')
zhoneTraceRouteCtlIndexNext = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteCtlIndexNext.setStatus('current')
zhoneTraceRouteCtlTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3), )
if mibBuilder.loadTexts: zhoneTraceRouteCtlTable.setStatus('current')
zhoneTraceRouteCtlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1), ).setIndexNames((0, "ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlIndex"))
if mibBuilder.loadTexts: zhoneTraceRouteCtlEntry.setStatus('current')
zhoneTraceRouteCtlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteCtlIndex.setStatus('current')
zhoneTraceRouteCtlTargetAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 2), InetAddressType().clone('ipv4')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlTargetAddressType.setStatus('current')
zhoneTraceRouteCtlTargetAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 3), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlTargetAddress.setStatus('current')
zhoneTraceRouteCtlByPassRouteTable = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 4), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlByPassRouteTable.setStatus('current')
zhoneTraceRouteCtlDataSize = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65507))).setUnits('octets').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlDataSize.setStatus('current')
zhoneTraceRouteCtlTimeOut = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 60)).clone(3)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlTimeOut.setStatus('current')
zhoneTraceRouteCtlProbesPerHop = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setUnits('probes').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlProbesPerHop.setStatus('current')
zhoneTraceRouteCtlPort = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(33434)).setUnits('UDP Port').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlPort.setStatus('current')
zhoneTraceRouteCtlMaxTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(30)).setUnits('time-to-live value').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlMaxTtl.setStatus('current')
zhoneTraceRouteCtlDSField = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 10), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlDSField.setStatus('current')
zhoneTraceRouteCtlSourceAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 11), InetAddressType().clone('unknown')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlSourceAddressType.setStatus('current')
zhoneTraceRouteCtlSourceAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 12), InetAddress().clone(hexValue="0")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlSourceAddress.setStatus('current')
zhoneTraceRouteCtlIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 13), InterfaceIndexOrZero()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlIfIndex.setStatus('current')
zhoneTraceRouteCtlMiscOptions = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 14), SnmpAdminString().clone(hexValue="0")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlMiscOptions.setStatus('current')
zhoneTraceRouteCtlMaxFailures = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 15), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(5)).setUnits('timeouts').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlMaxFailures.setStatus('current')
zhoneTraceRouteCtlDontFragment = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 16), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlDontFragment.setStatus('current')
zhoneTraceRouteCtlInitialTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 17), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlInitialTtl.setStatus('current')
zhoneTraceRouteCtlFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 18), Unsigned32()).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlFrequency.setStatus('current')
zhoneTraceRouteCtlStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 19), StorageType().clone('nonVolatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlStorageType.setStatus('current')
zhoneTraceRouteCtlAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlAdminStatus.setStatus('current')
zhoneTraceRouteCtlDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 21), SnmpAdminString().clone(hexValue="0")).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlDescr.setStatus('current')
zhoneTraceRouteCtlMaxRows = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 22), Unsigned32().clone(50)).setUnits('rows').setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlMaxRows.setStatus('current')
zhoneTraceRouteCtlTrapGeneration = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 23), Bits().clone(namedValues=NamedValues(("pathChange", 0), ("testFailure", 1), ("testCompletion", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlTrapGeneration.setStatus('current')
zhoneTraceRouteCtlCreateHopsEntries = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 24), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlCreateHopsEntries.setStatus('current')
zhoneTraceRouteCtlType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 25), ObjectIdentifier().clone((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 3, 1))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlType.setStatus('current')
zhoneTraceRouteCtlRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 3, 1, 26), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: zhoneTraceRouteCtlRowStatus.setStatus('current')
zhoneTraceRouteResultsTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4), )
if mibBuilder.loadTexts: zhoneTraceRouteResultsTable.setStatus('current')
zhoneTraceRouteResultsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1), ).setIndexNames((0, "ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlIndex"))
if mibBuilder.loadTexts: zhoneTraceRouteResultsEntry.setStatus('current')
zhoneTraceRouteResultsOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsOperStatus.setStatus('current')
zhoneTraceRouteResultsCurHopCount = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 2), Gauge32()).setUnits('hops').setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsCurHopCount.setStatus('current')
zhoneTraceRouteResultsCurProbeCount = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 3), Gauge32()).setUnits('probes').setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsCurProbeCount.setStatus('current')
zhoneTraceRouteResultsIpTgtAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 4), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsIpTgtAddrType.setStatus('current')
zhoneTraceRouteResultsIpTgtAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 5), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsIpTgtAddr.setStatus('current')
zhoneTraceRouteResultsTestAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 6), Unsigned32()).setUnits('tests').setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsTestAttempts.setStatus('current')
zhoneTraceRouteResultsTestSuccesses = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 7), Unsigned32()).setUnits('tests').setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsTestSuccesses.setStatus('current')
zhoneTraceRouteResultsLastGoodPath = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 4, 1, 8), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteResultsLastGoodPath.setStatus('current')
zhoneTraceRouteHopsTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5), )
if mibBuilder.loadTexts: zhoneTraceRouteHopsTable.setStatus('current')
zhoneTraceRouteHopsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1), ).setIndexNames((0, "ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlIndex"), (0, "ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsHopIndex"))
if mibBuilder.loadTexts: zhoneTraceRouteHopsEntry.setStatus('current')
zhoneTraceRouteHopsHopIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 1), Unsigned32())
if mibBuilder.loadTexts: zhoneTraceRouteHopsHopIndex.setStatus('current')
zhoneTraceRouteHopsIpTgtAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 2), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsIpTgtAddressType.setStatus('current')
zhoneTraceRouteHopsIpTgtAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 3), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsIpTgtAddress.setStatus('current')
zhoneTraceRouteHopsMinRtt = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsMinRtt.setStatus('current')
zhoneTraceRouteHopsMaxRtt = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsMaxRtt.setStatus('current')
zhoneTraceRouteHopsAverageRtt = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsAverageRtt.setStatus('current')
zhoneTraceRouteHopsRttSumOfSquares = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsRttSumOfSquares.setStatus('current')
zhoneTraceRouteHopsSentProbes = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsSentProbes.setStatus('current')
zhoneTraceRouteHopsProbeResponses = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsProbeResponses.setStatus('current')
zhoneTraceRouteHopsLastGoodProbe = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 1, 5, 1, 10), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: zhoneTraceRouteHopsLastGoodProbe.setStatus('current')
zhoneTraceRoutePathChange = NotificationType((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 0, 1)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsIpTgtAddr"))
if mibBuilder.loadTexts: zhoneTraceRoutePathChange.setStatus('current')
zhoneTraceRouteTestFailed = NotificationType((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 0, 2)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsIpTgtAddr"))
if mibBuilder.loadTexts: zhoneTraceRouteTestFailed.setStatus('current')
zhoneTraceRouteTestCompleted = NotificationType((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 0, 3)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsIpTgtAddr"))
if mibBuilder.loadTexts: zhoneTraceRouteTestCompleted.setStatus('current')
zhoneTraceRouteGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 2, 1))
zhoneTraceRouteGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 2, 1, 1)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteMaxConcurrentRequests"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlTargetAddressType"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlTargetAddress"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlByPassRouteTable"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlDataSize"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlTimeOut"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlProbesPerHop"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlPort"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlMaxTtl"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlDSField"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlSourceAddressType"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlSourceAddress"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlIfIndex"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlMiscOptions"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlMaxFailures"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlDontFragment"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlInitialTtl"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlFrequency"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlStorageType"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlAdminStatus"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlMaxRows"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlTrapGeneration"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlDescr"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlCreateHopsEntries"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlType"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteCtlRowStatus"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsOperStatus"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsCurHopCount"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsCurProbeCount"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsIpTgtAddrType"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsIpTgtAddr"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsTestAttempts"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsTestSuccesses"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
zhoneTraceRouteGroup = zhoneTraceRouteGroup.setStatus('current')
zhoneTraceRouteTimeStampGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 2, 1, 2)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteResultsLastGoodPath"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
zhoneTraceRouteTimeStampGroup = zhoneTraceRouteTimeStampGroup.setStatus('current')
zhoneTraceRouteNotificationsGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 2, 1, 3)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRoutePathChange"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteTestFailed"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteTestCompleted"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
zhoneTraceRouteNotificationsGroup = zhoneTraceRouteNotificationsGroup.setStatus('current')
zhoneTraceRouteHopsTableGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 4, 1, 20, 2, 1, 4)).setObjects(("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsIpTgtAddressType"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsIpTgtAddress"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsMinRtt"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsMaxRtt"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsAverageRtt"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsRttSumOfSquares"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsSentProbes"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsProbeResponses"), ("ZHONE-DISMAN-TRACEROUTE-MIB", "zhoneTraceRouteHopsLastGoodProbe"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
zhoneTraceRouteHopsTableGroup = zhoneTraceRouteHopsTableGroup.setStatus('current')
mibBuilder.exportSymbols("ZHONE-DISMAN-TRACEROUTE-MIB", zhoneTraceRouteMaxConcurrentRequests=zhoneTraceRouteMaxConcurrentRequests, zhoneTraceRouteResultsLastGoodPath=zhoneTraceRouteResultsLastGoodPath, zhoneTraceRouteResultsIpTgtAddrType=zhoneTraceRouteResultsIpTgtAddrType, zhoneTraceRouteHopsTable=zhoneTraceRouteHopsTable, zhoneTraceRouteCtlDataSize=zhoneTraceRouteCtlDataSize, zhoneTraceRouteCtlIfIndex=zhoneTraceRouteCtlIfIndex, zhoneTraceRouteCtlDescr=zhoneTraceRouteCtlDescr, zhoneTraceRouteCtlSourceAddress=zhoneTraceRouteCtlSourceAddress, zhoneTraceRouteHopsHopIndex=zhoneTraceRouteHopsHopIndex, zhoneTraceRouteHopsEntry=zhoneTraceRouteHopsEntry, zhoneTraceRouteResultsIpTgtAddr=zhoneTraceRouteResultsIpTgtAddr, zhoneTraceRouteHopsProbeResponses=zhoneTraceRouteHopsProbeResponses, zhoneTraceRouteNotificationsGroup=zhoneTraceRouteNotificationsGroup, zhoneTraceRouteCtlDSField=zhoneTraceRouteCtlDSField, zhoneTraceRouteHopsTableGroup=zhoneTraceRouteHopsTableGroup, zhoneTraceRouteImplementationTypeDomains=zhoneTraceRouteImplementationTypeDomains, zhoneTraceRouteCtlType=zhoneTraceRouteCtlType, zhoneTraceRouteHopsSentProbes=zhoneTraceRouteHopsSentProbes, zhoneTraceRouteCtlSourceAddressType=zhoneTraceRouteCtlSourceAddressType, zhoneTraceRouteResultsEntry=zhoneTraceRouteResultsEntry, zhoneTraceRouteCtlTrapGeneration=zhoneTraceRouteCtlTrapGeneration, zhoneTraceRouteCtlTimeOut=zhoneTraceRouteCtlTimeOut, zhoneTraceRouteCtlTable=zhoneTraceRouteCtlTable, zhoneTraceRouteResultsCurHopCount=zhoneTraceRouteResultsCurHopCount, zhoneTraceRouteTimeStampGroup=zhoneTraceRouteTimeStampGroup, zhoneTraceRouteHopsLastGoodProbe=zhoneTraceRouteHopsLastGoodProbe, zhoneTraceRouteCtlFrequency=zhoneTraceRouteCtlFrequency, PYSNMP_MODULE_ID=zhoneTraceRouteMIB, zhoneTraceRouteHopsMinRtt=zhoneTraceRouteHopsMinRtt, zhoneTraceRouteHopsIpTgtAddressType=zhoneTraceRouteHopsIpTgtAddressType, zhoneTraceRouteHopsMaxRtt=zhoneTraceRouteHopsMaxRtt, zhoneTraceRouteObjects=zhoneTraceRouteObjects, zhoneTraceRouteCtlMaxFailures=zhoneTraceRouteCtlMaxFailures, zhoneTraceRouteCtlAdminStatus=zhoneTraceRouteCtlAdminStatus, zhoneTraceRouteCtlByPassRouteTable=zhoneTraceRouteCtlByPassRouteTable, zhoneTraceRouteCtlInitialTtl=zhoneTraceRouteCtlInitialTtl, zhoneTraceRouteCtlTargetAddressType=zhoneTraceRouteCtlTargetAddressType, zhoneTraceRouteCtlMaxTtl=zhoneTraceRouteCtlMaxTtl, zhoneTraceRouteCtlMiscOptions=zhoneTraceRouteCtlMiscOptions, zhoneTraceRouteResultsOperStatus=zhoneTraceRouteResultsOperStatus, zhoneTraceRouteResultsTestSuccesses=zhoneTraceRouteResultsTestSuccesses, zhoneTraceRouteHopsAverageRtt=zhoneTraceRouteHopsAverageRtt, zhoneTraceRouteConformance=zhoneTraceRouteConformance, zhoneTraceRouteCtlProbesPerHop=zhoneTraceRouteCtlProbesPerHop, zhoneTraceRouteTestFailed=zhoneTraceRouteTestFailed, zhoneTraceRouteMIB=zhoneTraceRouteMIB, zhoneTraceRouteGroups=zhoneTraceRouteGroups, zhoneTraceRouteTestCompleted=zhoneTraceRouteTestCompleted, zhoneTraceRouteResultsTestAttempts=zhoneTraceRouteResultsTestAttempts, zhoneTraceRouteCtlTargetAddress=zhoneTraceRouteCtlTargetAddress, zhoneTraceRouteCtlStorageType=zhoneTraceRouteCtlStorageType, zhoneTraceRouteUsingUdpProbes=zhoneTraceRouteUsingUdpProbes, zhoneTraceRouteResultsCurProbeCount=zhoneTraceRouteResultsCurProbeCount, zhoneTraceRouteCtlEntry=zhoneTraceRouteCtlEntry, zhoneTraceRouteCtlIndex=zhoneTraceRouteCtlIndex, zhoneTraceRouteGroup=zhoneTraceRouteGroup, zhoneTraceRoutePathChange=zhoneTraceRoutePathChange, zhoneTraceRouteNotifications=zhoneTraceRouteNotifications, zhoneTraceRouteCtlPort=zhoneTraceRouteCtlPort, zhoneTraceRouteCtlMaxRows=zhoneTraceRouteCtlMaxRows, zhoneTraceRouteHopsRttSumOfSquares=zhoneTraceRouteHopsRttSumOfSquares, zhoneTraceRouteCtlIndexNext=zhoneTraceRouteCtlIndexNext, zhoneTraceRouteCtlDontFragment=zhoneTraceRouteCtlDontFragment, zhoneTraceRouteCtlRowStatus=zhoneTraceRouteCtlRowStatus, zhoneTraceRouteHopsIpTgtAddress=zhoneTraceRouteHopsIpTgtAddress, zhoneTraceRouteResultsTable=zhoneTraceRouteResultsTable, zhoneTraceRouteCtlCreateHopsEntries=zhoneTraceRouteCtlCreateHopsEntries)
| 158.673203 | 4,058 | 0.792767 | 2,351 | 24,277 | 8.185028 | 0.105487 | 0.014863 | 0.011848 | 0.013927 | 0.337993 | 0.264044 | 0.211298 | 0.199345 | 0.17674 | 0.155849 | 0 | 0.063689 | 0.068666 | 24,277 | 152 | 4,059 | 159.717105 | 0.787395 | 0.014335 | 0 | 0.027586 | 0 | 0 | 0.200627 | 0.129557 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.027586 | 0.075862 | 0 | 0.075862 | 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 |
dd0e4d0b67d569ed515e9f7e74c5269b50fc5095 | 57 | py | Python | flask_utils/__init__.py | zalew/flask-utils | aed0aa680072869814fff4f6e3dc56050944d3ee | [
"MIT"
] | 1 | 2019-05-06T06:36:13.000Z | 2019-05-06T06:36:13.000Z | flask_utils/__init__.py | zalew/flask-utils | aed0aa680072869814fff4f6e3dc56050944d3ee | [
"MIT"
] | null | null | null | flask_utils/__init__.py | zalew/flask-utils | aed0aa680072869814fff4f6e3dc56050944d3ee | [
"MIT"
] | null | null | null | VERSION = (0, 1, 1)
DEV_STATUS = '5 - Production/Stable'
| 19 | 36 | 0.649123 | 9 | 57 | 4 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.085106 | 0.175439 | 57 | 2 | 37 | 28.5 | 0.680851 | 0 | 0 | 0 | 0 | 0 | 0.368421 | 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 |
dd3084da8b6036d304e56697b4d7263823dad235 | 17,576 | py | Python | pysnmp-with-texts/HPN-ICF-L4RDT-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/HPN-ICF-L4RDT-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/HPN-ICF-L4RDT-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 HPN-ICF-L4RDT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-L4RDT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:39:34 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, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
hpnicfCommon, = mibBuilder.importSymbols("HPN-ICF-OID-MIB", "hpnicfCommon")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, NotificationType, Gauge32, MibIdentifier, Unsigned32, IpAddress, Integer32, iso, ModuleIdentity, Counter32, TimeTicks, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "NotificationType", "Gauge32", "MibIdentifier", "Unsigned32", "IpAddress", "Integer32", "iso", "ModuleIdentity", "Counter32", "TimeTicks", "ObjectIdentity")
MacAddress, RowStatus, DisplayString, TextualConvention, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "RowStatus", "DisplayString", "TextualConvention", "TruthValue")
hpnicfL4Redirect = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10))
if mibBuilder.loadTexts: hpnicfL4Redirect.setLastUpdated('200409210000Z')
if mibBuilder.loadTexts: hpnicfL4Redirect.setOrganization('')
if mibBuilder.loadTexts: hpnicfL4Redirect.setContactInfo('')
if mibBuilder.loadTexts: hpnicfL4Redirect.setDescription('See description above')
hpnicfL4RedirectCacheTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1), )
if mibBuilder.loadTexts: hpnicfL4RedirectCacheTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheTable.setDescription('This table contains an entry for each Web Cache device that this unit is aware of.')
hpnicfL4RedirectCacheEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1), ).setIndexNames((0, "HPN-ICF-L4RDT-MIB", "hpnicfL4RedirectCacheIpAddress"))
if mibBuilder.loadTexts: hpnicfL4RedirectCacheEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheEntry.setDescription('Each row specifies a known Web Cache device.')
hpnicfL4RedirectCacheIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 1), IpAddress())
if mibBuilder.loadTexts: hpnicfL4RedirectCacheIpAddress.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheIpAddress.setDescription('This object specifies the IP address of the Web Cache device.')
hpnicfL4RedirectCacheRedirectionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("disabledNotRedirecting", 1), ("enabledNoHealthChecker", 2), ("enabledHealthChecking", 3), ("enabledHealthCheckOKNotRedirecting", 4), ("enabledHealthCheckFailed", 5), ("enabledRedirecting", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfL4RedirectCacheRedirectionStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheRedirectionStatus.setDescription('This object returns the current state of traffic redirection to the cache. If redirection is disabled, this object shall return disabledNotRedirecting(1). If a unit cannot be selected to perform the cache health check, this object shall return enabledNoHealthChecker(2). If the software is determining if the cache is able to do redirection(this will happen when the redirection state transitions from disabled to enabled), this object shall return enabledHealthChecking(3). If the cache health check succeeded but the hardware is unable to support redirection to the cache port, this object shall return enabledHealthCheckOKNotRedirecting(4). If the latest health check of the cache has failed, this object shall return enabledHealthCheckFailed(5). If the cache is in use and traffic is being redirected to it, this object shall return enabledRedirecting(6). The default value is disabledNotRedirecting(1).')
hpnicfL4RedirectCachePort = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 3), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectCachePort.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCachePort.setDescription('This object stores the ifIndex that identifies the port or link aggregation which provides the connection that leads to the cache. If only manual cache configuration is supported, this value must be supplied. The method of cache configuration can be ascertained by the presence or absence of the L4 manual cache configuration id within the 3com-352 MIB. The default value is 0.')
hpnicfL4RedirectCacheRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectCacheRowStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheRowStatus.setDescription('This object is used to create and remove Web Cache entries. The following are the valid values that may be written to RowStatus: Writing createAndGo(4) to the RowStatus of a non-existent row shall create a row with default values and shall set the row to active(1). If the row already exists, it shall be an error. Writing createAndWait(5) to the RowStatus of a non-existent row shall create a row with default values and shall set the row to notInService(2). If the row already exists, it shall be an error. Writing active(1) to the RowStatus of an existing row shall change the value of that row to active(1). Writing active(1) to the RowStatus of an existing row that is already active(1) shall not cause an error, the row shall remain active(1). If the row does not exist, it shall be an error. Writing notInService(2) to the RowStatus of an existing row shall change the value of that row to notInService(2). Writing notInService(2) to the RowStatus of an existing row that is already notInService(2) shall not cause an error, the row shall remain notInService(2). If the row does not exist, it shall be an error. Writing destroy(6) to the RowStatus of a non-existent row shall be an error. If the row exists, it shall be removed. Writing notReady(3) to the RowStatus of a non-existent row or to an existent row shall be an error. If the user does not supply values for the necessary objects, default values will be supplied. Attempts to create more entries than the hardware can support shall be rejected.')
hpnicfL4RedirectCacheMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 5), MacAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectCacheMacAddress.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheMacAddress.setDescription('This object defines the MAC address of the attached Web cache device. If only manual configuration of the cache is supported, this value must be supplied. The method of cache configuration can be ascertained by the presence or absence of the L4 manual cache configuration id within the 3com-352 MIB. The default value is 0.')
hpnicfL4RedirectCacheVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 6), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectCacheVlan.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheVlan.setDescription('This object specifies the VLAN which the cache port belongs to.')
hpnicfL4RedirectCacheTcpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 1, 1, 7), Integer32()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectCacheTcpPort.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectCacheTcpPort.setDescription('This object specifies the TCP port number that is being redirected ')
hpnicfL4RedirectIpExclusionTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 2), )
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionTable.setDescription('This table lists the IP addresses and subnetworks that Web Cache redirection is not supported for. Some devices may not support addition to this table.')
hpnicfL4RedirectIpExclusionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 2, 1), ).setIndexNames((0, "HPN-ICF-L4RDT-MIB", "hpnicfL4RedirectIpExclusionIpAddress"))
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionEntry.setDescription('Each row contains an IP address or a IP subnetwork that is being excluded from the redirection.')
hpnicfL4RedirectIpExclusionIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 2, 1, 1), IpAddress())
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionIpAddress.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionIpAddress.setDescription('This object specifies the IP address or the subnetwork address that is to be excluded.')
hpnicfL4RedirectIpExclusionMaskLen = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionMaskLen.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionMaskLen.setDescription('This object provides the number of bits in the subnetwork mask. This mask shall be applied to the excludeIP address to determine the subnetwork that is to be excluded. A value of 32 implies that the excludeIP address refers to an individual host. The default value is 32.')
hpnicfL4RedirectIpExclusionRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 2, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionRowStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectIpExclusionRowStatus.setDescription('This object is used to add rows to the Exclusion Table. The following are the valid values that may be written to RowStatus: Writing createAndGo(4) to the RowStatus of a non-existent row shall create a new row. The new row shall be active(1). If the row exists, it shall be an error. Writing createAndWait(5) to the RowStatus of a non-existent row or to an existent row shall be an error. Writing active(1) to the RowStatus of an existing row shall change the value of that row to active(1). Writing active(1) to the RowStatus of an existing row that is already active(1) shall not cause an error, the row shall remain active(1). If the row does not exist, it shall be an error. Writing notInService(2) to the RowStatus of an existing row shall change the value of that row to notInService(2). Writing notInService(2) to the RowStatus of an existing row that is already notInService(2) shall not cause an error, the row shall remain notInService(2). If the row does not exist, it shall be an error. Writing destroy(6) to the RowStatus of a non-existent row shall be an error. If the row exists, it shall be removed. Writing notReady(3) to the RowStatus of a non-existent row or to an existent row shall be an error. Attempts to create more entries than the hardware can support shall be rejected.')
hpnicfL4RedirectVlanTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 3), )
if mibBuilder.loadTexts: hpnicfL4RedirectVlanTable.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectVlanTable.setDescription('This table contains a row for each VLAN of the packet which need to be redirected to the Web cache.')
hpnicfL4RedirectVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 3, 1), ).setIndexNames((0, "HPN-ICF-L4RDT-MIB", "hpnicfL4RedirectVlanID"))
if mibBuilder.loadTexts: hpnicfL4RedirectVlanEntry.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectVlanEntry.setDescription('Each row specifies a VLAN of the packet which need to be redirected to the Web cache.')
hpnicfL4RedirectVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 3, 1, 1), Integer32())
if mibBuilder.loadTexts: hpnicfL4RedirectVlanID.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectVlanID.setDescription('This object specifies the VLAN ID of the packet which need to be redirected to the Web cache.')
hpnicfL4RedirectVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 3, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: hpnicfL4RedirectVlanRowStatus.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectVlanRowStatus.setDescription('This object allows ports to be added and removed from the table. The following are the valid values that may be written to RowStatus: Writing createAndGo(4) to the RowStatus of a non-existent row shall create a new row. The new row shall be active(1). If the row exists, it shall be an error. Writing createAndWait(5) to the RowStatus of a non-existent row or to an existent row shall be an error. Writing active(1) to the RowStatus of an existing row shall change the value of that row to active(1). Writing active(1) to the RowStatus of an existing row that is already active(1) shall not cause an error, the row shall remain active(1). If the row does not exist, it shall be an error. Writing notInService(2) to the RowStatus of a non-existent row or to an existent row shall be an error. Writing destroy(6) to the RowStatus of a non-existent row shall be an error. If the row exists, it shall be removed. Writing notReady(3) to the RowStatus of a non-existent row or to an existent row shall be an error. Attempts to create more entries than the hardware can support shall be rejected.')
hpnicfL4RedirectInformationString = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 80))).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfL4RedirectInformationString.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectInformationString.setDescription('This object shall contain the string generated as a result of a Layer 4 Redirection configuration. It shall contain either a string describing successful configuration or a string describing unsuccessful configuration. This length of this string shall be no longer than 80 characters.')
hpnicfL4RedirectFreeCacheEntries = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 5), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfL4RedirectFreeCacheEntries.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectFreeCacheEntries.setDescription('This object indicates the number of entries that may still be added to the hpnicfL4RedirectCacheTable.')
hpnicfL4RedirectFreeIpExclusionEntries = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 6), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfL4RedirectFreeIpExclusionEntries.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectFreeIpExclusionEntries.setDescription('This object indicates the number of entries that may still be added to the hpnicfL4RedirectIpExclusionTable.')
hpnicfL4RedirectFreeVlanEntries = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 15, 2, 10, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hpnicfL4RedirectFreeVlanEntries.setStatus('current')
if mibBuilder.loadTexts: hpnicfL4RedirectFreeVlanEntries.setDescription('This object indicates the number of entries that may still be added to the hpnicfL4RedirectVlanTable.')
mibBuilder.exportSymbols("HPN-ICF-L4RDT-MIB", hpnicfL4RedirectCacheEntry=hpnicfL4RedirectCacheEntry, hpnicfL4RedirectVlanEntry=hpnicfL4RedirectVlanEntry, hpnicfL4RedirectFreeVlanEntries=hpnicfL4RedirectFreeVlanEntries, hpnicfL4RedirectFreeCacheEntries=hpnicfL4RedirectFreeCacheEntries, hpnicfL4RedirectIpExclusionMaskLen=hpnicfL4RedirectIpExclusionMaskLen, hpnicfL4RedirectCacheTcpPort=hpnicfL4RedirectCacheTcpPort, hpnicfL4RedirectFreeIpExclusionEntries=hpnicfL4RedirectFreeIpExclusionEntries, hpnicfL4RedirectIpExclusionRowStatus=hpnicfL4RedirectIpExclusionRowStatus, PYSNMP_MODULE_ID=hpnicfL4Redirect, hpnicfL4RedirectCachePort=hpnicfL4RedirectCachePort, hpnicfL4RedirectCacheRedirectionStatus=hpnicfL4RedirectCacheRedirectionStatus, hpnicfL4RedirectIpExclusionEntry=hpnicfL4RedirectIpExclusionEntry, hpnicfL4RedirectCacheIpAddress=hpnicfL4RedirectCacheIpAddress, hpnicfL4RedirectCacheTable=hpnicfL4RedirectCacheTable, hpnicfL4Redirect=hpnicfL4Redirect, hpnicfL4RedirectCacheRowStatus=hpnicfL4RedirectCacheRowStatus, hpnicfL4RedirectVlanID=hpnicfL4RedirectVlanID, hpnicfL4RedirectInformationString=hpnicfL4RedirectInformationString, hpnicfL4RedirectIpExclusionTable=hpnicfL4RedirectIpExclusionTable, hpnicfL4RedirectCacheVlan=hpnicfL4RedirectCacheVlan, hpnicfL4RedirectIpExclusionIpAddress=hpnicfL4RedirectIpExclusionIpAddress, hpnicfL4RedirectVlanTable=hpnicfL4RedirectVlanTable, hpnicfL4RedirectVlanRowStatus=hpnicfL4RedirectVlanRowStatus, hpnicfL4RedirectCacheMacAddress=hpnicfL4RedirectCacheMacAddress)
| 202.022989 | 1,585 | 0.802629 | 2,275 | 17,576 | 6.2 | 0.142418 | 0.040837 | 0.071464 | 0.006523 | 0.492095 | 0.385183 | 0.337823 | 0.325487 | 0.325133 | 0.325133 | 0 | 0.049914 | 0.11089 | 17,576 | 86 | 1,586 | 204.372093 | 0.852691 | 0.018662 | 0 | 0 | 0 | 0.126582 | 0.487673 | 0.03086 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.088608 | 0 | 0.088608 | 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 |
dd33f46fd33b58edd37792bccce519c9cfdd35de | 478 | py | Python | ctpbee/log.py | walter211/ctpbee | 0cb45f7a3822ab6040286a6eb0d3240fb347fad3 | [
"MIT"
] | 3 | 2019-09-17T01:06:22.000Z | 2019-11-04T02:04:19.000Z | ctpbee/log.py | walter211/ctpbee | 0cb45f7a3822ab6040286a6eb0d3240fb347fad3 | [
"MIT"
] | 1 | 2019-11-06T05:36:01.000Z | 2019-11-06T05:36:01.000Z | ctpbee/log.py | walter211/ctpbee | 0cb45f7a3822ab6040286a6eb0d3240fb347fad3 | [
"MIT"
] | 1 | 2019-12-06T01:38:22.000Z | 2019-12-06T01:38:22.000Z | from colour_printing.custom import PrintMe
VLogger = PrintMe
"""
实现一个默认的LoggerClass<<<<<<< dev
log格式
时间 ---- 执行者 ---- 等级 ---- 信息
"""
if __name__ == '__main__':
from ctpbee.cprint_config import CP
logger_me = VLogger(CP)
# logger_me.set_formatter("handler")
logger_me.warning("这里发生了警告", owner="somewheve")
logger_me.error("这里发生了错误", owner="somewheve")
logger_me.info("这里发生了信息输出", owner="somewheve")
logger_me.debug("这里发生了调试", owner="somewheve")
| 21.727273 | 51 | 0.682008 | 57 | 478 | 5.421053 | 0.631579 | 0.15534 | 0.194175 | 0.213592 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.154812 | 478 | 21 | 52 | 22.761905 | 0.764851 | 0.07113 | 0 | 0 | 0 | 0 | 0.201087 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.222222 | 0 | 0.222222 | 0.222222 | 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 |
dd4e105a4cee6c3d4d3b6b905ad9edd9c73dce13 | 1,702 | py | Python | data/assets/paths.py | YangG-Morph/Self_Regulation | ab87ba1afc1cf40552c2eb5bb5f46ec37d81c00d | [
"MIT"
] | 1 | 2021-09-06T01:45:03.000Z | 2021-09-06T01:45:03.000Z | data/assets/paths.py | YangG-Morph/Self_Regulation | ab87ba1afc1cf40552c2eb5bb5f46ec37d81c00d | [
"MIT"
] | null | null | null | data/assets/paths.py | YangG-Morph/Self_Regulation | ab87ba1afc1cf40552c2eb5bb5f46ec37d81c00d | [
"MIT"
] | null | null | null | import os
import sys
import pygame
def real_path(relative_path):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, os.path.join(ASSETS_DIR, relative_path))
return os.path.join(ASSETS_DIR, relative_path)
def get_parent_dir(path, directories=1):
path_result = None
for i in range(directories):
path_result = get_parent_dir(path.rpartition(os.sep)[0], i)
return path_result or path
def font_path(filename):
return real_path(os.path.join("fonts", filename))
def image_path(filename):
return real_path(os.path.join("images", filename))
def music_path(filename):
return real_path(os.path.join("music", filename))
def sound_path(filename):
return real_path(os.path.join("sound", filename))
ASSETS_DIR = os.path.abspath(os.path.dirname(__file__))
DATA_DIR = get_parent_dir(ASSETS_DIR)
DEBUG_DIR = os.path.join(DATA_DIR, "debug")
FONTS_DIR = os.path.join(ASSETS_DIR, "fonts")
MUSIC_DIR = os.path.join(ASSETS_DIR, "music")
SOUND_DIR = os.path.join(DATA_DIR, "sound")
""" FONT """
QUICKSAND_LIGHT = font_path("Quicksand-Light.otf")
QUICKSAND_BOLD = font_path("Quicksand-Bold.otf")
""" MUSIC """
BG_MUSIC = [music_path(music) for music in os.listdir(real_path(MUSIC_DIR))]
BG_MUSIC.sort()
""" SOUND """
FEMALE = "karen"
GET_READY_SOUND = sound_path(os.path.join(FEMALE, "get_ready.wav"))
COUNTDOWN_SOUND = sound_path(os.path.join(FEMALE, "3_2_1.wav"))
FINISHED_SOUND = sound_path(os.path.join(FEMALE, "finished.wav"))
""" IMAGES """
BG = pygame.image.load(image_path("bg.jpg")).convert_alpha()
#debug_filename = "debug.txt"
#with open('debug_filename', 'w') as f:
# f.write(f"{QUICKSAND_LIGHT}\n"
# f"{QUICKSAND_BOLD}")
| 28.847458 | 82 | 0.718566 | 264 | 1,702 | 4.386364 | 0.257576 | 0.082902 | 0.120898 | 0.084629 | 0.328152 | 0.328152 | 0.255613 | 0.124352 | 0 | 0 | 0 | 0.003362 | 0.126322 | 1,702 | 58 | 83 | 29.344828 | 0.775387 | 0.077556 | 0 | 0 | 0 | 0 | 0.086526 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.171429 | false | 0.057143 | 0.085714 | 0.114286 | 0.457143 | 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 |
dd529409b28df79aa7faa6084db62aa7426d23b2 | 277 | py | Python | tests/test_comic.py | joanwanjiku/marvel-comics | 78a28eda28f3d13a3db4c562a0de58347a8fc1fc | [
"MIT"
] | 1 | 2021-12-14T23:40:02.000Z | 2021-12-14T23:40:02.000Z | tests/test_comic.py | joanwanjiku/marvel-comics | 78a28eda28f3d13a3db4c562a0de58347a8fc1fc | [
"MIT"
] | null | null | null | tests/test_comic.py | joanwanjiku/marvel-comics | 78a28eda28f3d13a3db4c562a0de58347a8fc1fc | [
"MIT"
] | 1 | 2020-07-23T23:30:37.000Z | 2020-07-23T23:30:37.000Z | import unittest
from app.models import Comic
class TestComic(unittest.Testcase):
def setUp(self):
self.new_comic = Comic(1, 'marvel 2020', 'amazing looks',20, '/hsfhdhgd')
def test_instance(self)
self.assertTrue(isinstance(self.new_comic, Comic)) | 27.7 | 81 | 0.696751 | 36 | 277 | 5.277778 | 0.666667 | 0.084211 | 0.126316 | 0.178947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031111 | 0.187726 | 277 | 10 | 82 | 27.7 | 0.813333 | 0 | 0 | 0 | 0 | 0 | 0.118705 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | null | null | 0 | 0.285714 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
dd5826a0d04a9112fa3e9d20ad57e5f2217535fa | 678 | py | Python | test_tiles.py | gaebor/CnC_PCG | 7fe891a1e7224946d4dde82bd0072a92abb9f783 | [
"MIT"
] | null | null | null | test_tiles.py | gaebor/CnC_PCG | 7fe891a1e7224946d4dde82bd0072a92abb9f783 | [
"MIT"
] | 1 | 2020-09-05T20:10:51.000Z | 2020-09-05T20:10:51.000Z | test_tiles.py | gaebor/CnC_PCG | 7fe891a1e7224946d4dde82bd0072a92abb9f783 | [
"MIT"
] | null | null | null | import pytest
import generate
@pytest.mark.parametrize("filename", ['ra1_tiles.json', 'td_tiles.json'], ids=["RA1", "TD"])
def test_tiles_json(filename):
for level in generate.import_tiles_file(filename):
pattern_size = level[0][0].shape[1:]
template_size = level[0][1].shape[1:]
for pattern, template, icon in level:
assert template.shape == icon.shape
assert template.ndim == 3
assert pattern.ndim == 3
assert pattern.shape[1] > template.shape[1] and pattern.shape[2] > template.shape[2]
assert pattern_size == pattern.shape[1:]
assert template_size == template.shape[1:]
| 35.684211 | 96 | 0.632743 | 89 | 678 | 4.707865 | 0.325843 | 0.085919 | 0.047733 | 0.085919 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030829 | 0.234513 | 678 | 18 | 97 | 37.666667 | 0.776493 | 0 | 0 | 0 | 1 | 0 | 0.058997 | 0 | 0 | 0 | 0 | 0 | 0.428571 | 1 | 0.071429 | false | 0 | 0.214286 | 0 | 0.285714 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
dd5a721321a176ade8c1523e128bb492f54a0a8b | 825 | py | Python | windows/winproxy/apis/shlwapi.py | IMULMUL/PythonForWindows | 61e027a678d5b87aa64fcf8a37a6661a86236589 | [
"BSD-3-Clause"
] | 479 | 2016-01-08T00:53:34.000Z | 2022-03-22T10:28:19.000Z | windows/winproxy/apis/shlwapi.py | IMULMUL/PythonForWindows | 61e027a678d5b87aa64fcf8a37a6661a86236589 | [
"BSD-3-Clause"
] | 38 | 2017-12-29T17:09:04.000Z | 2022-01-31T08:27:47.000Z | windows/winproxy/apis/shlwapi.py | IMULMUL/PythonForWindows | 61e027a678d5b87aa64fcf8a37a6661a86236589 | [
"BSD-3-Clause"
] | 103 | 2016-01-10T01:32:17.000Z | 2021-12-24T17:21:06.000Z | import ctypes
import windows
import windows.generated_def as gdef
from ..apiproxy import ApiProxy, NeededParameter, is_implemented
from ..error import fail_on_zero
class ShlwapiProxy(ApiProxy):
APIDLL = "Shlwapi"
default_error_check = staticmethod(fail_on_zero)
@ShlwapiProxy()
def StrStrIW(pszFirst, pszSrch):
return StrStrIW.ctypes_function(pszFirst, pszSrch)
@ShlwapiProxy()
def StrStrIA(pszFirst, pszSrch):
return StrStrIA.ctypes_function(pszFirst, pszSrch)
@ShlwapiProxy()
def IsOS(dwOS):
if not is_implemented(IsOS) and windows.system.version[0] < 6:
# Before Vista:
# If so use ordinal 437 from DOCUMENTATION
# https://docs.microsoft.com/en-us/windows/desktop/api/shlwapi/nf-shlwapi-isos#remarks
IsOS.proxy.func_name = 437
return IsOS.ctypes_function(dwOS)
| 29.464286 | 94 | 0.750303 | 105 | 825 | 5.771429 | 0.552381 | 0.09901 | 0.033003 | 0.09571 | 0.145215 | 0.145215 | 0 | 0 | 0 | 0 | 0 | 0.011494 | 0.156364 | 825 | 27 | 95 | 30.555556 | 0.859195 | 0.167273 | 0 | 0.157895 | 1 | 0 | 0.010264 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.157895 | false | 0 | 0.263158 | 0.105263 | 0.736842 | 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 | 1 | 0 | 0 | 0 | 2 |
dd6df59e07c025f5d17a4884c99a9dd77da75e6d | 1,486 | py | Python | MoinMoin/config/_tests/test_multiconfig.py | RealTimeWeb/wikisite | 66a22c68c172f0ebb3c88a9885ccd33e2d59c3c5 | [
"Apache-2.0"
] | null | null | null | MoinMoin/config/_tests/test_multiconfig.py | RealTimeWeb/wikisite | 66a22c68c172f0ebb3c88a9885ccd33e2d59c3c5 | [
"Apache-2.0"
] | null | null | null | MoinMoin/config/_tests/test_multiconfig.py | RealTimeWeb/wikisite | 66a22c68c172f0ebb3c88a9885ccd33e2d59c3c5 | [
"Apache-2.0"
] | 1 | 2020-01-09T04:53:32.000Z | 2020-01-09T04:53:32.000Z | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - MoinMoin.config.multiconfig Tests
@copyright: 2007 by MoinMoin:ThomasWaldmann
@license: GNU GPL, see COPYING for details.
"""
import py
from MoinMoin.support.python_compatibility import set
class TestPasswordChecker:
username = u"SomeUser"
tests_builtin = [
(u'', False), # empty
(u'1966', False), # too short
(u'asdfghjk', False), # keyboard sequence
(u'QwertZuiop', False), # german keyboard sequence, with uppercase
(u'mnbvcx', False), # reverse keyboard sequence
(u'12345678', False), # keyboard sequence, too easy
(u'aaaaaaaa', False), # not enough different chars
(u'BBBaaaddd', False), # not enough different chars
(username, False), # username == password
(username[1:-1], False), # password in username
(u"XXX%sXXX" % username, False), # username in password
(u'Moin-2007', True), # this should be OK
]
def testBuiltinPasswordChecker(self):
pw_checker = self.request.cfg.password_checker
if not pw_checker:
py.test.skip("password_checker is disabled in the configuration, not testing it")
else:
for pw, result in self.tests_builtin:
pw_error = pw_checker(self.request, self.username, pw)
print "%r: %s" % (pw, pw_error)
assert result == (pw_error is None)
coverage_modules = ['MoinMoin.config.multiconfig']
| 36.243902 | 93 | 0.627187 | 173 | 1,486 | 5.317919 | 0.520231 | 0.069565 | 0.054348 | 0.05 | 0.06087 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024457 | 0.257066 | 1,486 | 40 | 94 | 37.15 | 0.808877 | 0.195155 | 0 | 0 | 0 | 0 | 0.171206 | 0.026265 | 0 | 0 | 0 | 0 | 0.035714 | 0 | null | null | 0.142857 | 0.071429 | null | null | 0.035714 | 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 |
dd8a00e92cbc9c7e198f46d08d51040f035ba1fc | 1,919 | py | Python | mdformat/plugins.py | gaige/mdformat | 3a9eb2507505c70a6d3e8842eb29788114a0a48f | [
"MIT"
] | null | null | null | mdformat/plugins.py | gaige/mdformat | 3a9eb2507505c70a6d3e8842eb29788114a0a48f | [
"MIT"
] | null | null | null | mdformat/plugins.py | gaige/mdformat | 3a9eb2507505c70a6d3e8842eb29788114a0a48f | [
"MIT"
] | null | null | null | import argparse
import sys
from typing import Callable, Dict, Mapping
from markdown_it import MarkdownIt
from mdformat.renderer.typing import RendererFunc
if sys.version_info >= (3, 8):
from importlib import metadata as importlib_metadata
from typing import Protocol
else:
import importlib_metadata
from typing_extensions import Protocol
def _load_codeformatters() -> Dict[str, Callable[[str, str], str]]:
codeformatter_entrypoints = importlib_metadata.entry_points().get( # type: ignore
"mdformat.codeformatter", ()
)
return {ep.name: ep.load() for ep in codeformatter_entrypoints}
CODEFORMATTERS: Mapping[str, Callable[[str, str], str]] = _load_codeformatters()
class ParserExtensionInterface(Protocol):
"""A interface for parser extension plugins."""
# Does the plugin's formatting change Markdown AST or not?
# (optional, default: False)
CHANGES_AST: bool = False
# A mapping from `RenderTreeNode.type` to a `RendererFunc` that can
# render the given `RenderTreeNode` type. These override the default
# `RendererFunc`s defined in `mdformat.renderer.DEFAULT_RENDERER_FUNCS`.
RENDERER_FUNCS: Mapping[str, RendererFunc]
@staticmethod
def add_cli_options(parser: argparse.ArgumentParser) -> None:
"""Add options to the mdformat CLI, to be stored in
mdit.options["mdformat"] (optional)"""
@staticmethod
def update_mdit(mdit: MarkdownIt) -> None:
"""Update the parser, e.g. by adding a plugin: `mdit.use(myplugin)`"""
def _load_parser_extensions() -> Dict[str, ParserExtensionInterface]:
parser_extension_entrypoints = importlib_metadata.entry_points().get( # type: ignore # noqa: E501
"mdformat.parser_extension", ()
)
return {ep.name: ep.load() for ep in parser_extension_entrypoints}
PARSER_EXTENSIONS: Mapping[str, ParserExtensionInterface] = _load_parser_extensions()
| 33.666667 | 103 | 0.729026 | 228 | 1,919 | 5.986842 | 0.394737 | 0.049817 | 0.023443 | 0.03956 | 0.142125 | 0.112821 | 0.112821 | 0.112821 | 0 | 0 | 0 | 0.003155 | 0.174049 | 1,919 | 56 | 104 | 34.267857 | 0.858044 | 0.270453 | 0 | 0.066667 | 0 | 0 | 0.034332 | 0.034332 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0 | 0.366667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
06cf33ab66415b57a802f9563c68de6fd0aadbd3 | 1,162 | py | Python | singlet/io/csv/__init__.py | iosonofabio/singlet | 66d3b13581f571450c9551e99d86845cce992d32 | [
"MIT"
] | 11 | 2017-09-12T02:45:33.000Z | 2021-05-18T13:04:12.000Z | singlet/io/csv/__init__.py | Takshan/singlet | 66d3b13581f571450c9551e99d86845cce992d32 | [
"MIT"
] | 6 | 2017-10-03T22:14:42.000Z | 2019-02-02T05:12:20.000Z | singlet/io/csv/__init__.py | Takshan/singlet | 66d3b13581f571450c9551e99d86845cce992d32 | [
"MIT"
] | 4 | 2018-02-15T12:00:04.000Z | 2021-03-25T12:26:04.000Z | # vim: fdm=indent
# author: Fabio Zanini
# date: 02/08/17
# content: Support module for filenames related to CSV/TSV files.
# Modules
import numpy as np
from singlet.config import config
csv_formats = ['csv', 'tsv', 'csv.gz', 'tsv.gz']
# Parser
def parse_samplesheet(path, fmt):
import pandas as pd
if fmt in ('tsv', 'tsv.gz'):
sep = '\t'
elif fmt in ('csv', 'csv.gz'):
sep = ','
else:
raise ValueError('Format not understood')
table = pd.read_csv(path, sep=sep, index_col=False)
return table
def parse_featuresheet(path, fmt):
import pandas as pd
if fmt in ('tsv', 'tsv.gz'):
sep = '\t'
elif fmt in ('csv', 'csv.gz'):
sep = ','
else:
raise ValueError('Format not understood')
table = pd.read_csv(path, sep=sep, index_col=False)
return table
def parse_counts_table(path, fmt):
import pandas as pd
if fmt in ('tsv', 'tsv.gz'):
sep = '\t'
elif fmt in ('csv', 'csv.gz'):
sep = ','
else:
raise ValueError('Format not understood')
table = pd.read_csv(path, sep=sep, index_col=False)
return table
| 21.518519 | 68 | 0.591222 | 166 | 1,162 | 4.072289 | 0.343373 | 0.044379 | 0.057692 | 0.08432 | 0.680473 | 0.680473 | 0.680473 | 0.680473 | 0.680473 | 0.680473 | 0 | 0.007075 | 0.270224 | 1,162 | 53 | 69 | 21.924528 | 0.790094 | 0.123064 | 0 | 0.818182 | 0 | 0 | 0.142292 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.151515 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
06d1f472d306fdbbe0f65a90e1b99616a1afd01e | 1,379 | py | Python | geo2_pipeline/preproc8/40_useragg/usersample_messages.py | brendano/twitter_geo_preproc | 7466afe6df45c6cae0c22e55a321cb79dc7bf3da | [
"MIT"
] | 4 | 2015-01-30T01:27:29.000Z | 2019-01-15T18:37:58.000Z | geo2_pipeline/preproc8/40_useragg/usersample_messages.py | brendano/twitter_geo_preproc | 7466afe6df45c6cae0c22e55a321cb79dc7bf3da | [
"MIT"
] | null | null | null | geo2_pipeline/preproc8/40_useragg/usersample_messages.py | brendano/twitter_geo_preproc | 7466afe6df45c6cae0c22e55a321cb79dc7bf3da | [
"MIT"
] | 1 | 2021-07-02T19:13:51.000Z | 2021-07-02T19:13:51.000Z | # this may be broken
from mrjob.job import MRJob
import mrjob.util
from mrjob.protocol import JSONValueProtocol, PickleProtocol, RawValueProtocol
import re,os,sys
# import simplejson as json
from collections import defaultdict
import json
sys.path.insert(0,'..')
from hose_util import lookup
import textproc
class UserSample(MRJob):
OUTPUT_PROTOCOL = RawValueProtocol
def mapper(self, _, line):
toks,date,geo_s,tweet_s = line.split('\t')
tweet = json.loads(tweet_s)
if not mrjob.util.hash_object(tweet['user']['id']).startswith('000'): return
yield None, line
# def reducer(self, userid, infos): #tweet_tokenizations):
# ntok = 0
# ntweet = 0
# counts = defaultdict(int)
# max_ntweet = 1e5
# toksample = []
# usernames = set()
# for username,toks in infos: # tweet_tokenizations:
# ntweet += 1
# ntok += len(toks)
# for tok in toks:
# counts[tok] += 1
# if ntweet < 10: toksample.append(toks)
# if ntweet > max_ntweet: break
# usernames.add(username)
# meta = {'ntok':ntok, 'ntype':len(counts), 'ntweet':ntweet, 'usernames':list(usernames)}
# yield userid, [meta, {'word_counts':dict(counts), 'tweet_sample': toksample}]
if __name__=='__main__':
UserSample.run()
| 30.644444 | 97 | 0.617839 | 162 | 1,379 | 5.12963 | 0.524691 | 0.021661 | 0.055355 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011776 | 0.261059 | 1,379 | 44 | 98 | 31.340909 | 0.803729 | 0.482959 | 0 | 0 | 0 | 0 | 0.030435 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.055556 | false | 0 | 0.444444 | 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 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
06d7298424246a81e9d0832bc337f68a707f857a | 635 | py | Python | services/burnurl.py | joshthecoder/shorty-python | 35687d010683944d75e3f0dce7799903296172c5 | [
"MIT"
] | 11 | 2015-05-29T04:58:28.000Z | 2020-05-31T17:07:52.000Z | services/burnurl.py | joshthecoder/shorty-python | 35687d010683944d75e3f0dce7799903296172c5 | [
"MIT"
] | null | null | null | services/burnurl.py | joshthecoder/shorty-python | 35687d010683944d75e3f0dce7799903296172c5 | [
"MIT"
] | 2 | 2015-03-10T06:22:31.000Z | 2018-06-18T18:20:59.000Z | ## Shorty
## Copyright 2009 Joshua Roesslein
## See LICENSE
## @url burnurl.com
class Burnurl(Service):
def _test(self):
# all we can test is shrink
turl = self.shrink('http://test.com')
if turl.startswith('http://burnurl.com'):
return True
else:
return False
def shrink(self, bigurl):
resp = request('http://burnurl.com/', {'url': bigurl, 'output': 'plain'})
return resp.read()
def expand(self, tinyurl):
# burnurl uses iframes for displaying original url
# so we cannot expand them using the 301 redirect :(
return None
| 25.4 | 81 | 0.593701 | 77 | 635 | 4.883117 | 0.636364 | 0.079787 | 0.074468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015487 | 0.288189 | 635 | 24 | 82 | 26.458333 | 0.816372 | 0.303937 | 0 | 0 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.083333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
06e4b81fd7614fe2fdc62827698b6fb720e62e6f | 72 | py | Python | {{cookiecutter.dist_name}}/{{cookiecutter.package_name}}/__init__.py | frankie567/cookiecutter-hipster-pypackage | 501d358e318c4ea8c3e569552f541709ebb3e8cb | [
"MIT"
] | 5 | 2020-06-08T01:41:52.000Z | 2022-02-04T21:29:33.000Z | {{cookiecutter.dist_name}}/{{cookiecutter.package_name}}/__init__.py | frankie567/cookiecutter-hipster-pypackage | 501d358e318c4ea8c3e569552f541709ebb3e8cb | [
"MIT"
] | null | null | null | {{cookiecutter.dist_name}}/{{cookiecutter.package_name}}/__init__.py | frankie567/cookiecutter-hipster-pypackage | 501d358e318c4ea8c3e569552f541709ebb3e8cb | [
"MIT"
] | 2 | 2020-05-15T16:39:30.000Z | 2021-05-16T03:28:53.000Z | """{{cookiecutter.project_short_description}}"""
__version__ = "0.0.0"
| 18 | 48 | 0.708333 | 8 | 72 | 5.625 | 0.75 | 0.088889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044776 | 0.069444 | 72 | 3 | 49 | 24 | 0.626866 | 0.583333 | 0 | 0 | 0 | 0 | 0.208333 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.