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
f78b86d747c672620428e6bd3b8435d4dd3f3512
5,608
py
Python
src/pyrobot/vrep_locobot/camera.py
gujralsanyam22/pyrobot
a0448714857b684d8b280f710e9304988524d2e0
[ "MIT" ]
2,150
2019-06-12T20:55:41.000Z
2022-03-21T07:14:51.000Z
src/pyrobot/vrep_locobot/camera.py
gujralsanyam22/pyrobot
a0448714857b684d8b280f710e9304988524d2e0
[ "MIT" ]
124
2019-06-22T17:12:27.000Z
2022-02-26T11:43:13.000Z
src/pyrobot/vrep_locobot/camera.py
gujralsanyam22/pyrobot
a0448714857b684d8b280f710e9304988524d2e0
[ "MIT" ]
329
2019-06-13T03:03:54.000Z
2022-03-30T07:04:55.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np import pyrobot.utils.util as prutil from pyrobot.core import Camera from pyrobot.utils.util import try_cv2_import cv2 = try_cv2_import() from cv_bridge import CvBridge, CvBridgeError from pyrep.objects.vision_sensor import VisionSensor from pyrep.const import ObjectType, PerspectiveMode, RenderMode from pyrep.objects.joint import Joint class LoCoBotCamera(Camera): """docstring for SimpleCamera""" def __init__(self, configs, simulator): self.sim = simulator.sim self.rgb_cam = VisionSensor("kinect_rgb") self.depth_cam = VisionSensor("kinect_depth") self.rgb_cam.set_render_mode(RenderMode.OPENGL3) self.depth_cam.set_render_mode(RenderMode.OPENGL3) # Pan and tilt related variables. self.pan_joint = Joint("LoCoBot_head_pan_joint") self.tilt_joint = Joint("LoCoBot_head_tilt_joint") def get_rgb(self): return self.rgb_cam.capture_rgb() def get_depth(self): return self.depth_cam.capture_depth() def get_rgb_depth(self): return self.get_rgb(), self.get_depth() def get_intrinsics(self): # Todo: Remove this after we fix intrinsics raise NotImplementedError """ Returns the instrinsic matrix of the camera :return: the intrinsic matrix (shape: :math:`[3, 3]`) :rtype: np.ndarray """ # fx = self.configs['Camera.fx'] # fy = self.configs['Camera.fy'] # cx = self.configs['Camera.cx'] # cy = self.configs['Camera.cy'] Itc = np.array([[fx, 0, cx], [0, fy, cy], [0, 0, 1]]) return Itc def pix_to_3dpt(self, rs, cs, in_cam=False): """ Get the 3D points of the pixels in RGB images. :param rs: rows of interest in the RGB image. It can be a list or 1D numpy array which contains the row indices. The default value is None, which means all rows. :param cs: columns of interest in the RGB image. It can be a list or 1D numpy array which contains the column indices. The default value is None, which means all columns. :param in_cam: return points in camera frame, otherwise, return points in base frame :type rs: list or np.ndarray :type cs: list or np.ndarray :type in_cam: bool :returns: tuple (pts, colors) pts: point coordinates in world frame (shape: :math:`[N, 3]`) colors: rgb values for pts_in_cam (shape: :math:`[N, 3]`) :rtype: tuple(np.ndarray, np.ndarray) """ raise NotImplementedError def get_current_pcd(self, in_cam=True): """ Return the point cloud at current time step (one frame only) :param in_cam: return points in camera frame, otherwise, return points in base frame :type in_cam: bool :returns: tuple (pts, colors) pts: point coordinates in world frame (shape: :math:`[N, 3]`) colors: rgb values for pts_in_cam (shape: :math:`[N, 3]`) :rtype: tuple(np.ndarray, np.ndarray) """ raise NotImplementedError @property def state(self): """ Return the current pan and tilt joint angles of the robot camera. :return: pan_tilt: A list the form [pan angle, tilt angle] :rtype: list """ return self.get_state() def get_state(self): """ Return the current pan and tilt joint angles of the robot camera. :return: pan_tilt: A list the form [pan angle, tilt angle] :rtype: list """ return [self.get_pan(), self.get_tilt()] def get_pan(self): """ Return the current pan joint angle of the robot camera. :return: pan: Pan joint angle :rtype: float """ return self.pan_joint.get_joint_position() def get_tilt(self): """ Return the current tilt joint angle of the robot camera. :return: tilt: Tilt joint angle :rtype: float """ return self.tilt_joint.get_joint_position() def set_pan(self, pan, wait=True): """ Sets the pan joint angle to the specified value. :param pan: value to be set for pan joint :param wait: wait until the pan angle is set to the target angle. :type pan: float :type wait: bool """ self.pan_joint.set_joint_position(pan) # [self.sim.step() for _ in range(50)] def set_tilt(self, tilt, wait=True): """ Sets the tilt joint angle to the specified value. :param tilt: value to be set for the tilt joint :param wait: wait until the tilt angle is set to the target angle. :type tilt: float :type wait: bool """ self.tilt_joint.set_joint_position(tilt) def set_pan_tilt(self, pan, tilt, wait=True): """ Sets both the pan and tilt joint angles to the specified values. :param pan: value to be set for pan joint :param tilt: value to be set for the tilt joint :param wait: wait until the pan and tilt angles are set to the target angles. :type pan: float :type tilt: float :type wait: bool """ self.set_pan(pan) self.set_tilt(tilt) def reset(self): """ This function resets the pan and tilt joints by actuating them to their home configuration. """ self.set_pan_tilt(self.configs.CAMERA.RESET_PAN, self.configs.CAMERA.RESET_TILT)
26.578199
88
0.63766
799
5,608
4.370463
0.230288
0.030928
0.017182
0.0126
0.471649
0.429553
0.392612
0.335911
0.318729
0.295246
0
0.00539
0.272111
5,608
210
89
26.704762
0.850073
0.5403
0
0.06
0
0
0.030399
0.020417
0
0
0
0.004762
0
1
0.3
false
0
0.18
0.06
0.66
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
f78c09a2c8173da1710410d85fa882bb6b674769
105
py
Python
main.py
lmkhkm/SerialMonitor
05b00e7a05e2a71ddfc9b0e30e42a83b073f88e1
[ "MIT" ]
null
null
null
main.py
lmkhkm/SerialMonitor
05b00e7a05e2a71ddfc9b0e30e42a83b073f88e1
[ "MIT" ]
1
2021-05-08T20:52:27.000Z
2021-05-08T20:52:27.000Z
main.py
lmkhkm/SerialMonitor
05b00e7a05e2a71ddfc9b0e30e42a83b073f88e1
[ "MIT" ]
null
null
null
import serial ser = serial.Serial('COM7',115200, timeout=1) while True: print("R: ", ser.readline())
21
45
0.67619
15
105
4.733333
0.8
0
0
0
0
0
0
0
0
0
0
0.088889
0.142857
105
5
46
21
0.7
0
0
0
0
0
0.066038
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
f79fdffacf758f6c9d435f6cbf7feae5c9594ded
1,295
py
Python
py2neo/timing.py
VitalyRomanov/py2neo
2d0683cf2ab8b77b0c5bbba4eade0003c68d5905
[ "Apache-2.0" ]
null
null
null
py2neo/timing.py
VitalyRomanov/py2neo
2d0683cf2ab8b77b0c5bbba4eade0003c68d5905
[ "Apache-2.0" ]
null
null
null
py2neo/timing.py
VitalyRomanov/py2neo
2d0683cf2ab8b77b0c5bbba4eade0003c68d5905
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2021, Nigel Small # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from monotonic import monotonic class Timer(object): def __init__(self, seconds): self.__t0 = t0 = monotonic() self.__t1 = t0 + (seconds or 0) def __bool__(self): return self.remaining() > 0 __nonzero__ = __bool__ def remaining(self): diff = self.__t1 - monotonic() return diff if diff > 0 else 0.0 def repeater(at_least, timeout): """ Yield an incrementing number at least `at_least` times, thereafter continuing until the timeout has been reached. """ timer = Timer(timeout) repeat = 0 while repeat < at_least or timer.remaining(): yield repeat repeat += 1
27.553191
74
0.68417
181
1,295
4.756906
0.585635
0.069686
0.030197
0.037166
0
0
0
0
0
0
0
0.025025
0.228571
1,295
46
75
28.152174
0.836837
0.550579
0
0
0
0
0
0
0
0
0
0
0
1
0.235294
false
0
0.058824
0.058824
0.529412
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
e38a4870c5f8e88d0175c33a20658010577ed3a2
824
py
Python
packages/pyright-internal/src/tests/samples/match7.py
Strum355/pyright
01f15ce31f8f6cd9a054e21fc48cb762923ae25d
[ "MIT" ]
null
null
null
packages/pyright-internal/src/tests/samples/match7.py
Strum355/pyright
01f15ce31f8f6cd9a054e21fc48cb762923ae25d
[ "MIT" ]
null
null
null
packages/pyright-internal/src/tests/samples/match7.py
Strum355/pyright
01f15ce31f8f6cd9a054e21fc48cb762923ae25d
[ "MIT" ]
null
null
null
# This sample tests type narrowing of subject expressions for # match statements. from typing import Literal def func1(subj: int | dict[str, str] | tuple[int] | str, cond: bool): match subj: case (3 | "hi"): t_v1: Literal["Literal[3, 'hi']"] = reveal_type(subj) return case int(y) if cond: t_v2: Literal["int"] = reveal_type(subj) return case int(y): t_v3: Literal["int"] = reveal_type(subj) return case int(): t_v4: Literal["Never"] = reveal_type(subj) return case str(z): t_v5: Literal["str"] = reveal_type(subj) return case z: t_v6: Literal["dict[str, str] | tuple[int]"] = reveal_type(subj) return return subj
23.542857
76
0.527913
103
824
4.106796
0.38835
0.141844
0.198582
0.283688
0.489362
0.243499
0.243499
0.174941
0
0
0
0.016949
0.355583
824
34
77
24.235294
0.779661
0.093447
0
0.272727
0
0
0.079408
0
0
0
0
0
0
1
0.045455
false
0
0.045455
0
0.363636
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
e39343d1ccb1c9771b5f47a5eb48d8ff84409b31
2,591
py
Python
server/twitter.py
abijith-kp/Emolytics
00e94798ab20621b51f6ce2a058e0dd8dec1cdba
[ "BSD-3-Clause" ]
null
null
null
server/twitter.py
abijith-kp/Emolytics
00e94798ab20621b51f6ce2a058e0dd8dec1cdba
[ "BSD-3-Clause" ]
null
null
null
server/twitter.py
abijith-kp/Emolytics
00e94798ab20621b51f6ce2a058e0dd8dec1cdba
[ "BSD-3-Clause" ]
null
null
null
from server import db, auth, emolytics from server.models import Tweet from classifier import create_classifier from tweepy import Stream from tweepy.streaming import StreamListener from flask.ext.rq import job import json import random from multiprocessing import Process from sqlalchemy.exc import IntegrityError def get_document(status): status = json.loads(status) lat = 0.0 lon = 0.0 try: lon, lat = status["place"]["bounding_box"]["coordinates"][0][0] except: pass return {"tweet": status["text"], "pos": [lat, lon]} class StdOutListener(StreamListener): def on_data(self, status): with emolytics.app_context(): try: doc = get_document(status) loc = doc["pos"] if loc != [0, 0]: t = Tweet(doc['tweet'], loc[0], loc[1]) db.session.add(t) db.session.commit() except IntegrityError, ie: pass except Exception, e: pass return True def on_error(self, error_code): pass @job('emolytics') def start_streaming(track=[""], locations=[-180,-90,180,90], languages=["en"]): print "Starting streaming" l = StdOutListener() stream = Stream(auth, l) while True: try: stream.disconnect() stream.filter(track=track, locations=locations, languages=languages) except Exception, e: pass @job('emolytics') def classify(): print "Starting classification" with emolytics.app_context(): CLF = create_classifier() c = {0: "green", 1: "red"} while True: result = Tweet.query.filter((Tweet.flag == False)).all() try: for t in result: r = CLF.predict(t.tweet.encode('utf-8')) t.color = c[int(r)] db.session.commit() except IntegrityError, ie: pass db.session.rollback() except Exception, e: pass ''' def start_thread(track): global process if process != None and process.is_alive(): process.terminate() process = Process(target=start_streaming, kwargs={"track": track}) process.start() print "Started the thread" def start_classification(): global clf_process if clf_process != None and clf_process.is_alive(): clf_process.terminate() clf_process = Process(target=classify) clf_process.start() print "Started classification" '''
27.56383
80
0.580857
291
2,591
5.09622
0.378007
0.040459
0.032367
0.040459
0.055293
0.055293
0.055293
0
0
0
0
0.012828
0.307989
2,591
93
81
27.860215
0.814278
0
0
0.369231
0
0
0.058068
0
0
0
0
0
0
0
null
null
0.107692
0.153846
null
null
0.030769
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
e39aa6632ad08319c28262297573d3c36b620844
670
py
Python
users/models.py
tanmayag8958/upes-fipi-jigyasa
e05e41e7624175ae64216a54cc546bbb74b2df61
[ "MIT" ]
8
2019-03-08T10:28:38.000Z
2019-10-17T00:04:44.000Z
users/models.py
tanmayag8958/upes-fipi-jigyasa
e05e41e7624175ae64216a54cc546bbb74b2df61
[ "MIT" ]
124
2020-02-11T23:51:09.000Z
2022-01-13T01:06:09.000Z
users/models.py
tanmayag8958/upes-fipi-jigyasa
e05e41e7624175ae64216a54cc546bbb74b2df61
[ "MIT" ]
3
2019-03-07T18:44:55.000Z
2019-03-08T10:36:50.000Z
from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver class User_details(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) team_count = models.IntegerField(default=1) date_registered = models.DateTimeField(default=timezone.now) contact_no = models.BigIntegerField(default=91) status = models.CharField('STATUS', max_length=12, default='Not Paid') referral = models.CharField('REFERRAL', max_length=30, null=True, blank=True) def __str__(self): return self.user.username
39.411765
81
0.770149
90
670
5.6
0.577778
0.099206
0.047619
0
0
0
0
0
0
0
0
0.012048
0.132836
670
16
82
41.875
0.855422
0
0
0
0
0
0.032836
0
0
0
0
0
0
1
0.071429
false
0
0.357143
0.071429
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
e39bbfc2ad38c9bcb6507c0a41b528d361682009
224
py
Python
packs/hue/actions/rgb.py
jonico/st2contrib
149c9c553f24360d91a14fef7ea6146707de75fd
[ "Apache-2.0" ]
164
2015-01-17T16:08:33.000Z
2021-08-03T02:34:07.000Z
packs/hue/actions/rgb.py
jonico/st2contrib
149c9c553f24360d91a14fef7ea6146707de75fd
[ "Apache-2.0" ]
442
2015-01-01T11:19:01.000Z
2017-09-06T23:26:17.000Z
packs/hue/actions/rgb.py
jonico/st2contrib
149c9c553f24360d91a14fef7ea6146707de75fd
[ "Apache-2.0" ]
202
2015-01-13T00:37:40.000Z
2020-11-07T11:30:10.000Z
from lib import action class RGBAction(action.BaseAction): def run(self, light_id, red, green, blue, transition_time): light = self.hue.lights.get(light_id) light.rgb(red, green, blue, transition_time)
28
63
0.705357
32
224
4.8125
0.65625
0.090909
0.155844
0.285714
0.337662
0
0
0
0
0
0
0
0.1875
224
7
64
32
0.846154
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.6
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
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
e39de89d4940f42750569f7100f7133d1493a932
1,755
py
Python
test/test_math_challenge.py
nikett/math_challenge_eval
bafe9f6d30fc5ffd97492ce5e42716f839c29c4f
[ "Apache-2.0" ]
null
null
null
test/test_math_challenge.py
nikett/math_challenge_eval
bafe9f6d30fc5ffd97492ce5e42716f839c29c4f
[ "Apache-2.0" ]
null
null
null
test/test_math_challenge.py
nikett/math_challenge_eval
bafe9f6d30fc5ffd97492ce5e42716f839c29c4f
[ "Apache-2.0" ]
null
null
null
import unittest from typing import Dict, List from src.math_challenge import Challenge, DEFAULT_EMPTY_ANS from src.student_info import StudentInfo class TestChallenge(unittest.TestCase): def test_preprocess(self): self.assertEqual(Challenge.preprocess_ans("a. 37th floor, b. 42nd floor, c. 39th floor, d. 40th floor"), 37423940) self.assertEqual(Challenge.preprocess_ans("answer is 25 ducklings"), 25) self.assertEqual(Challenge.preprocess_ans("4 c.1"), 41) self.assertEqual(Challenge.preprocess_ans(a="abcd efgh. ij"), DEFAULT_EMPTY_ANS) self.assertEqual(Challenge.preprocess_ans(a="5 blue. ", text_retain_dict={"blue":1}), 51) self.assertEqual(Challenge.preprocess_ans(a="5 {blue}. __OR__ 6 {brown}", text_retain_dict={"blue":0, "brown":1}), 5061) self.assertEqual(Challenge.preprocess_ans(a="5 blue. ", text_retain_dict={"blue":1}), 51) def test_gold_loading(self): g, challenge_wise_retaining = Challenge.load_gold_answers(fp="test_data/test_correct_answers.csv") assert len(g) == 2 assert g["MC2"].challenge_name == "MC2" assert not g["MC2"].student # Gold has no student name. # We did not pass any retaining text (i.e., usually all text # except numbers is removed, except the special retaining strings) assert challenge_wise_retaining["MC2"][8] == {"blue":0, "red":1} def test_student_ans_loading(self): s: Dict[StudentInfo, List["Challenge"]] = Challenge.load_student_answers(fp="test_data/test_student_answers.csv", challenge_wise_retaining={}) assert len(s) == 5, f"There should be 5 student entries, assuming no repeated entries in the test file." if __name__ == '__main__': unittest.main()
51.617647
150
0.707123
246
1,755
4.825203
0.406504
0.088458
0.141533
0.200505
0.305813
0.208088
0.144061
0.144061
0.107835
0.107835
0
0.03427
0.168661
1,755
33
151
53.181818
0.779301
0.0849
0
0.083333
0
0
0.213483
0.042447
0
0
0
0
0.5
1
0.125
false
0
0.166667
0
0.333333
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
e3c6cfd741e8bd9adaeac0bf0d16ec2396131aa6
636
py
Python
setup.py
mluciarr/McComplex
e83b5d11ab772a6bdc6233d318f7da5f67b3c5ce
[ "MIT" ]
null
null
null
setup.py
mluciarr/McComplex
e83b5d11ab772a6bdc6233d318f7da5f67b3c5ce
[ "MIT" ]
null
null
null
setup.py
mluciarr/McComplex
e83b5d11ab772a6bdc6233d318f7da5f67b3c5ce
[ "MIT" ]
1
2021-04-14T22:43:33.000Z
2021-04-14T22:43:33.000Z
#!/usr/bin/env python from distutils.core import setup import setuptools setup(name='McComplex', version='1.0', description="""This program reconstructs macrocomplexes of protein-protein and protein-(DNA/RNA) from a list of files of binary interactions of its chains""", author='Maria Lucía Romero, Ferran Pegenaute, Ipek Yaren', author_email='ferran.pegenaute01@estudiant.upf.edu', long_description=open('README.md').read(), install_requires=['biopython >= 1.73.0','argparse >= 1.1.0', 'pysimplelog'], packages=['McComplex', 'McComplex.functions'], license='LICENSE.txt', url='https://github.com/ferranpgp/McCrocomplex')
37.411765
84
0.748428
85
636
5.564706
0.776471
0.008457
0
0
0
0
0
0
0
0
0
0.019164
0.097484
636
16
85
39.75
0.804878
0.031447
0
0
0
0
0.606504
0.058537
0
0
0
0
0
1
0
true
0
0.153846
0
0.153846
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
e3c83e726d786e7b9f87a1f14f06ff2aa47d4a9b
1,277
py
Python
pymitools/girder/metadataPresets.py
chapmanbe/pymitools
be0f4a3f56dd6c8bb89678368c49e09b3333232c
[ "Apache-2.0" ]
null
null
null
pymitools/girder/metadataPresets.py
chapmanbe/pymitools
be0f4a3f56dd6c8bb89678368c49e09b3333232c
[ "Apache-2.0" ]
null
null
null
pymitools/girder/metadataPresets.py
chapmanbe/pymitools
be0f4a3f56dd6c8bb89678368c49e09b3333232c
[ "Apache-2.0" ]
null
null
null
"""Metadata presets for commonly used keywords.""" presets = { chest : {"Anatomical Region": {"ID": "0001443", "Name": "chest", "Ontology Acronym": "UBERON", "Ontology Name": "Uber Anatomy Ontology", "Resource URL": "http://purl.obolibrary.org/obo/UBERON_0001443"}}, abdomen : {"Anatomical Region": {"ID": "0000916", "Name": "abdomen", "Ontology Acronym": "UBERON", "Ontology Name": "Uber Anatomy Ontology", "Resource URL": "http://purl.obolibrary.org/obo/UBERON_0000916"}}, neck : {"Anatomical Region": {"ID": "0000974", "Name": "neck", "Ontology Acronym": "UBERON", "Ontology Name": "Uber Anatomy Ontology", "Resource URL": "http://purl.obolibrary.org/obo/UBERON_0000974"}}, head : {"Anatomical Region": {"ID": "0000033", "Name": "head", "Ontology Acronym": "UBERON", "Ontology Name": "Uber Anatomy Ontology", "Resource URL": "http://purl.obolibrary.org/obo/UBERON_0000033"}}}
29.697674
66
0.473767
103
1,277
5.834951
0.291262
0.106489
0.1198
0.193012
0.618968
0.618968
0.618968
0.618968
0.618968
0.618968
0
0.070529
0.37823
1,277
42
67
30.404762
0.686398
0.034456
0
0.413793
0
0
0.482478
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
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
e3cac54ed59276bd1cf21b47cfa19280c29a0b7c
20,168
py
Python
colorpy/colorpy-0.1.0/illuminants.py
gmweir/QuasiOptics
0974178984f845597c5209217613c26edf931ed0
[ "MIT" ]
1
2020-11-06T18:16:00.000Z
2020-11-06T18:16:00.000Z
colorpy/colorpy-0.1.1/illuminants.py
gmweir/QuasiOptics
0974178984f845597c5209217613c26edf931ed0
[ "MIT" ]
null
null
null
colorpy/colorpy-0.1.1/illuminants.py
gmweir/QuasiOptics
0974178984f845597c5209217613c26edf931ed0
[ "MIT" ]
null
null
null
''' illuminants.py - Definitions of some standard illuminants. Description: Illuminants are spectrums, normalized so that Y = 1.0. Spectrums are 2D numpy arrays, with one row for each wavelength, with the first column holding the wavelength in nm, and the second column the intensity. The spectrums have a wavelength increment of 1 nm. Functions: init () - Initialize CIE Illuminant D65. This runs on module startup. get_illuminant_D65 () - Get CIE Illuminant D65, as a spectrum, normalized to Y = 1.0. CIE standard illuminant D65 represents a phase of natural daylight with a correlated color temperature of approximately 6504 K. (Wyszecki, p. 144) In the interest of standardization the CIE recommends that D65 be used whenever possible. Otherwise, D55 or D75 are recommended. (Wyszecki, p. 145) (ColorPy does not currently provide D55 or D75, however.) get_illuminant_A () - Get CIE Illuminant A, as a spectrum, normalized to Y = 1.0. This is actually a blackbody illuminant for T = 2856 K. (Wyszecki, p. 143) get_blackbody_illuminant (T_K) - Get the spectrum of a blackbody at the given temperature, normalized to Y = 1.0. get_constant_illuminant () - Get an illuminant, with spectrum constant over wavelength, normalized to Y = 1.0. scale_illuminant (illuminant, scaling) - Scale the illuminant intensity by the specfied factor. References: Wyszecki and Stiles, Color Science: Concepts and Methods, Quantitative Data and Formulae, 2nd edition, John Wiley, 1982. Wiley Classics Library Edition 2000. ISBN 0-471-39918-3. CVRL Color and Vision Database - http://cvrl.ioo.ucl.ac.uk/index.htm - (accessed 17 Sep 2008) Color and Vision Research Laboratories. Provides a set of data sets related to color vision. ColorPy uses the tables from this site for the 1931 CIE XYZ matching functions, and for Illuminant D65, both at 1 nm wavelength increments. CIE Standards - http://cvrl.ioo.ucl.ac.uk/cie.htm - (accessed 17 Sep 2008) CIE standards as maintained by CVRL. The 1931 CIE XYZ and D65 tables that ColorPy uses were obtained from the following files, linked here: http://cvrl.ioo.ucl.ac.uk/database/data/cmfs/ciexyz31_1.txt http://cvrl.ioo.ucl.ac.uk/database/data/cie/Illuminantd65.txt CIE International Commission on Illumination - http://www.cie.co.at/ - (accessed 17 Sep 2008) Official website of the CIE. There are tables of the standard functions (matching functions, illuminants) here: http://www.cie.co.at/main/freepubs.html http://www.cie.co.at/publ/abst/datatables15_2004/x2.txt http://www.cie.co.at/publ/abst/datatables15_2004/y2.txt http://www.cie.co.at/publ/abst/datatables15_2004/z2.txt http://www.cie.co.at/publ/abst/datatables15_2004/sid65.txt ColorPy does not use these specific files. License: Copyright (C) 2008 Mark Kness Author - Mark Kness - mkness@alumni.utexas.net This file is part of ColorPy. ColorPy is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ColorPy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with ColorPy. If not, see <http://www.gnu.org/licenses/>. ''' import math, numpy import colormodels import ciexyz import blackbody import plots # table of CIE Illuminant D65 spectrum. # data from: http://cvrl.ioo.ucl.ac.uk/database/data/cie/Illuminantd65.txt # massaged into this format. _Illuminant_D65_table = [ [ 300, 0.034100 ], [ 301, 0.360140 ], [ 302, 0.686180 ], [ 303, 1.012220 ], [ 304, 1.338260 ], [ 305, 1.664300 ], [ 306, 1.990340 ], [ 307, 2.316380 ], [ 308, 2.642420 ], [ 309, 2.968460 ], [ 310, 3.294500 ], [ 311, 4.988650 ], [ 312, 6.682800 ], [ 313, 8.376950 ], [ 314, 10.071100 ], [ 315, 11.765200 ], [ 316, 13.459400 ], [ 317, 15.153500 ], [ 318, 16.847700 ], [ 319, 18.541800 ], [ 320, 20.236000 ], [ 321, 21.917700 ], [ 322, 23.599500 ], [ 323, 25.281200 ], [ 324, 26.963000 ], [ 325, 28.644700 ], [ 326, 30.326500 ], [ 327, 32.008200 ], [ 328, 33.690000 ], [ 329, 35.371700 ], [ 330, 37.053500 ], [ 331, 37.343000 ], [ 332, 37.632600 ], [ 333, 37.922100 ], [ 334, 38.211600 ], [ 335, 38.501100 ], [ 336, 38.790700 ], [ 337, 39.080200 ], [ 338, 39.369700 ], [ 339, 39.659300 ], [ 340, 39.948800 ], [ 341, 40.445100 ], [ 342, 40.941400 ], [ 343, 41.437700 ], [ 344, 41.934000 ], [ 345, 42.430200 ], [ 346, 42.926500 ], [ 347, 43.422800 ], [ 348, 43.919100 ], [ 349, 44.415400 ], [ 350, 44.911700 ], [ 351, 45.084400 ], [ 352, 45.257000 ], [ 353, 45.429700 ], [ 354, 45.602300 ], [ 355, 45.775000 ], [ 356, 45.947700 ], [ 357, 46.120300 ], [ 358, 46.293000 ], [ 359, 46.465600 ], [ 360, 46.638300 ], [ 361, 47.183400 ], [ 362, 47.728500 ], [ 363, 48.273500 ], [ 364, 48.818600 ], [ 365, 49.363700 ], [ 366, 49.908800 ], [ 367, 50.453900 ], [ 368, 50.998900 ], [ 369, 51.544000 ], [ 370, 52.089100 ], [ 371, 51.877700 ], [ 372, 51.666400 ], [ 373, 51.455000 ], [ 374, 51.243700 ], [ 375, 51.032300 ], [ 376, 50.820900 ], [ 377, 50.609600 ], [ 378, 50.398200 ], [ 379, 50.186900 ], [ 380, 49.975500 ], [ 381, 50.442800 ], [ 382, 50.910000 ], [ 383, 51.377300 ], [ 384, 51.844600 ], [ 385, 52.311800 ], [ 386, 52.779100 ], [ 387, 53.246400 ], [ 388, 53.713700 ], [ 389, 54.180900 ], [ 390, 54.648200 ], [ 391, 57.458900 ], [ 392, 60.269500 ], [ 393, 63.080200 ], [ 394, 65.890900 ], [ 395, 68.701500 ], [ 396, 71.512200 ], [ 397, 74.322900 ], [ 398, 77.133600 ], [ 399, 79.944200 ], [ 400, 82.754900 ], [ 401, 83.628000 ], [ 402, 84.501100 ], [ 403, 85.374200 ], [ 404, 86.247300 ], [ 405, 87.120400 ], [ 406, 87.993600 ], [ 407, 88.866700 ], [ 408, 89.739800 ], [ 409, 90.612900 ], [ 410, 91.486000 ], [ 411, 91.680600 ], [ 412, 91.875200 ], [ 413, 92.069700 ], [ 414, 92.264300 ], [ 415, 92.458900 ], [ 416, 92.653500 ], [ 417, 92.848100 ], [ 418, 93.042600 ], [ 419, 93.237200 ], [ 420, 93.431800 ], [ 421, 92.756800 ], [ 422, 92.081900 ], [ 423, 91.406900 ], [ 424, 90.732000 ], [ 425, 90.057000 ], [ 426, 89.382100 ], [ 427, 88.707100 ], [ 428, 88.032200 ], [ 429, 87.357200 ], [ 430, 86.682300 ], [ 431, 88.500600 ], [ 432, 90.318800 ], [ 433, 92.137100 ], [ 434, 93.955400 ], [ 435, 95.773600 ], [ 436, 97.591900 ], [ 437, 99.410200 ], [ 438, 101.228000 ], [ 439, 103.047000 ], [ 440, 104.865000 ], [ 441, 106.079000 ], [ 442, 107.294000 ], [ 443, 108.508000 ], [ 444, 109.722000 ], [ 445, 110.936000 ], [ 446, 112.151000 ], [ 447, 113.365000 ], [ 448, 114.579000 ], [ 449, 115.794000 ], [ 450, 117.008000 ], [ 451, 117.088000 ], [ 452, 117.169000 ], [ 453, 117.249000 ], [ 454, 117.330000 ], [ 455, 117.410000 ], [ 456, 117.490000 ], [ 457, 117.571000 ], [ 458, 117.651000 ], [ 459, 117.732000 ], [ 460, 117.812000 ], [ 461, 117.517000 ], [ 462, 117.222000 ], [ 463, 116.927000 ], [ 464, 116.632000 ], [ 465, 116.336000 ], [ 466, 116.041000 ], [ 467, 115.746000 ], [ 468, 115.451000 ], [ 469, 115.156000 ], [ 470, 114.861000 ], [ 471, 114.967000 ], [ 472, 115.073000 ], [ 473, 115.180000 ], [ 474, 115.286000 ], [ 475, 115.392000 ], [ 476, 115.498000 ], [ 477, 115.604000 ], [ 478, 115.711000 ], [ 479, 115.817000 ], [ 480, 115.923000 ], [ 481, 115.212000 ], [ 482, 114.501000 ], [ 483, 113.789000 ], [ 484, 113.078000 ], [ 485, 112.367000 ], [ 486, 111.656000 ], [ 487, 110.945000 ], [ 488, 110.233000 ], [ 489, 109.522000 ], [ 490, 108.811000 ], [ 491, 108.865000 ], [ 492, 108.920000 ], [ 493, 108.974000 ], [ 494, 109.028000 ], [ 495, 109.082000 ], [ 496, 109.137000 ], [ 497, 109.191000 ], [ 498, 109.245000 ], [ 499, 109.300000 ], [ 500, 109.354000 ], [ 501, 109.199000 ], [ 502, 109.044000 ], [ 503, 108.888000 ], [ 504, 108.733000 ], [ 505, 108.578000 ], [ 506, 108.423000 ], [ 507, 108.268000 ], [ 508, 108.112000 ], [ 509, 107.957000 ], [ 510, 107.802000 ], [ 511, 107.501000 ], [ 512, 107.200000 ], [ 513, 106.898000 ], [ 514, 106.597000 ], [ 515, 106.296000 ], [ 516, 105.995000 ], [ 517, 105.694000 ], [ 518, 105.392000 ], [ 519, 105.091000 ], [ 520, 104.790000 ], [ 521, 105.080000 ], [ 522, 105.370000 ], [ 523, 105.660000 ], [ 524, 105.950000 ], [ 525, 106.239000 ], [ 526, 106.529000 ], [ 527, 106.819000 ], [ 528, 107.109000 ], [ 529, 107.399000 ], [ 530, 107.689000 ], [ 531, 107.361000 ], [ 532, 107.032000 ], [ 533, 106.704000 ], [ 534, 106.375000 ], [ 535, 106.047000 ], [ 536, 105.719000 ], [ 537, 105.390000 ], [ 538, 105.062000 ], [ 539, 104.733000 ], [ 540, 104.405000 ], [ 541, 104.369000 ], [ 542, 104.333000 ], [ 543, 104.297000 ], [ 544, 104.261000 ], [ 545, 104.225000 ], [ 546, 104.190000 ], [ 547, 104.154000 ], [ 548, 104.118000 ], [ 549, 104.082000 ], [ 550, 104.046000 ], [ 551, 103.641000 ], [ 552, 103.237000 ], [ 553, 102.832000 ], [ 554, 102.428000 ], [ 555, 102.023000 ], [ 556, 101.618000 ], [ 557, 101.214000 ], [ 558, 100.809000 ], [ 559, 100.405000 ], [ 560, 100.000000 ], [ 561, 99.633400 ], [ 562, 99.266800 ], [ 563, 98.900300 ], [ 564, 98.533700 ], [ 565, 98.167100 ], [ 566, 97.800500 ], [ 567, 97.433900 ], [ 568, 97.067400 ], [ 569, 96.700800 ], [ 570, 96.334200 ], [ 571, 96.279600 ], [ 572, 96.225000 ], [ 573, 96.170300 ], [ 574, 96.115700 ], [ 575, 96.061100 ], [ 576, 96.006500 ], [ 577, 95.951900 ], [ 578, 95.897200 ], [ 579, 95.842600 ], [ 580, 95.788000 ], [ 581, 95.077800 ], [ 582, 94.367500 ], [ 583, 93.657300 ], [ 584, 92.947000 ], [ 585, 92.236800 ], [ 586, 91.526600 ], [ 587, 90.816300 ], [ 588, 90.106100 ], [ 589, 89.395800 ], [ 590, 88.685600 ], [ 591, 88.817700 ], [ 592, 88.949700 ], [ 593, 89.081800 ], [ 594, 89.213800 ], [ 595, 89.345900 ], [ 596, 89.478000 ], [ 597, 89.610000 ], [ 598, 89.742100 ], [ 599, 89.874100 ], [ 600, 90.006200 ], [ 601, 89.965500 ], [ 602, 89.924800 ], [ 603, 89.884100 ], [ 604, 89.843400 ], [ 605, 89.802600 ], [ 606, 89.761900 ], [ 607, 89.721200 ], [ 608, 89.680500 ], [ 609, 89.639800 ], [ 610, 89.599100 ], [ 611, 89.409100 ], [ 612, 89.219000 ], [ 613, 89.029000 ], [ 614, 88.838900 ], [ 615, 88.648900 ], [ 616, 88.458900 ], [ 617, 88.268800 ], [ 618, 88.078800 ], [ 619, 87.888700 ], [ 620, 87.698700 ], [ 621, 87.257700 ], [ 622, 86.816700 ], [ 623, 86.375700 ], [ 624, 85.934700 ], [ 625, 85.493600 ], [ 626, 85.052600 ], [ 627, 84.611600 ], [ 628, 84.170600 ], [ 629, 83.729600 ], [ 630, 83.288600 ], [ 631, 83.329700 ], [ 632, 83.370700 ], [ 633, 83.411800 ], [ 634, 83.452800 ], [ 635, 83.493900 ], [ 636, 83.535000 ], [ 637, 83.576000 ], [ 638, 83.617100 ], [ 639, 83.658100 ], [ 640, 83.699200 ], [ 641, 83.332000 ], [ 642, 82.964700 ], [ 643, 82.597500 ], [ 644, 82.230200 ], [ 645, 81.863000 ], [ 646, 81.495800 ], [ 647, 81.128500 ], [ 648, 80.761300 ], [ 649, 80.394000 ], [ 650, 80.026800 ], [ 651, 80.045600 ], [ 652, 80.064400 ], [ 653, 80.083100 ], [ 654, 80.101900 ], [ 655, 80.120700 ], [ 656, 80.139500 ], [ 657, 80.158300 ], [ 658, 80.177000 ], [ 659, 80.195800 ], [ 660, 80.214600 ], [ 661, 80.420900 ], [ 662, 80.627200 ], [ 663, 80.833600 ], [ 664, 81.039900 ], [ 665, 81.246200 ], [ 666, 81.452500 ], [ 667, 81.658800 ], [ 668, 81.865200 ], [ 669, 82.071500 ], [ 670, 82.277800 ], [ 671, 81.878400 ], [ 672, 81.479100 ], [ 673, 81.079700 ], [ 674, 80.680400 ], [ 675, 80.281000 ], [ 676, 79.881600 ], [ 677, 79.482300 ], [ 678, 79.082900 ], [ 679, 78.683600 ], [ 680, 78.284200 ], [ 681, 77.427900 ], [ 682, 76.571600 ], [ 683, 75.715300 ], [ 684, 74.859000 ], [ 685, 74.002700 ], [ 686, 73.146500 ], [ 687, 72.290200 ], [ 688, 71.433900 ], [ 689, 70.577600 ], [ 690, 69.721300 ], [ 691, 69.910100 ], [ 692, 70.098900 ], [ 693, 70.287600 ], [ 694, 70.476400 ], [ 695, 70.665200 ], [ 696, 70.854000 ], [ 697, 71.042800 ], [ 698, 71.231500 ], [ 699, 71.420300 ], [ 700, 71.609100 ], [ 701, 71.883100 ], [ 702, 72.157100 ], [ 703, 72.431100 ], [ 704, 72.705100 ], [ 705, 72.979000 ], [ 706, 73.253000 ], [ 707, 73.527000 ], [ 708, 73.801000 ], [ 709, 74.075000 ], [ 710, 74.349000 ], [ 711, 73.074500 ], [ 712, 71.800000 ], [ 713, 70.525500 ], [ 714, 69.251000 ], [ 715, 67.976500 ], [ 716, 66.702000 ], [ 717, 65.427500 ], [ 718, 64.153000 ], [ 719, 62.878500 ], [ 720, 61.604000 ], [ 721, 62.432200 ], [ 722, 63.260300 ], [ 723, 64.088500 ], [ 724, 64.916600 ], [ 725, 65.744800 ], [ 726, 66.573000 ], [ 727, 67.401100 ], [ 728, 68.229300 ], [ 729, 69.057400 ], [ 730, 69.885600 ], [ 731, 70.405700 ], [ 732, 70.925900 ], [ 733, 71.446000 ], [ 734, 71.966200 ], [ 735, 72.486300 ], [ 736, 73.006400 ], [ 737, 73.526600 ], [ 738, 74.046700 ], [ 739, 74.566900 ], [ 740, 75.087000 ], [ 741, 73.937600 ], [ 742, 72.788100 ], [ 743, 71.638700 ], [ 744, 70.489300 ], [ 745, 69.339800 ], [ 746, 68.190400 ], [ 747, 67.041000 ], [ 748, 65.891600 ], [ 749, 64.742100 ], [ 750, 63.592700 ], [ 751, 61.875200 ], [ 752, 60.157800 ], [ 753, 58.440300 ], [ 754, 56.722900 ], [ 755, 55.005400 ], [ 756, 53.288000 ], [ 757, 51.570500 ], [ 758, 49.853100 ], [ 759, 48.135600 ], [ 760, 46.418200 ], [ 761, 48.456900 ], [ 762, 50.495600 ], [ 763, 52.534400 ], [ 764, 54.573100 ], [ 765, 56.611800 ], [ 766, 58.650500 ], [ 767, 60.689200 ], [ 768, 62.728000 ], [ 769, 64.766700 ], [ 770, 66.805400 ], [ 771, 66.463100 ], [ 772, 66.120900 ], [ 773, 65.778600 ], [ 774, 65.436400 ], [ 775, 65.094100 ], [ 776, 64.751800 ], [ 777, 64.409600 ], [ 778, 64.067300 ], [ 779, 63.725100 ], [ 780, 63.382800 ], [ 781, 63.474900 ], [ 782, 63.567000 ], [ 783, 63.659200 ], [ 784, 63.751300 ], [ 785, 63.843400 ], [ 786, 63.935500 ], [ 787, 64.027600 ], [ 788, 64.119800 ], [ 789, 64.211900 ], [ 790, 64.304000 ], [ 791, 63.818800 ], [ 792, 63.333600 ], [ 793, 62.848400 ], [ 794, 62.363200 ], [ 795, 61.877900 ], [ 796, 61.392700 ], [ 797, 60.907500 ], [ 798, 60.422300 ], [ 799, 59.937100 ], [ 800, 59.451900 ], [ 801, 58.702600 ], [ 802, 57.953300 ], [ 803, 57.204000 ], [ 804, 56.454700 ], [ 805, 55.705400 ], [ 806, 54.956200 ], [ 807, 54.206900 ], [ 808, 53.457600 ], [ 809, 52.708300 ], [ 810, 51.959000 ], [ 811, 52.507200 ], [ 812, 53.055300 ], [ 813, 53.603500 ], [ 814, 54.151600 ], [ 815, 54.699800 ], [ 816, 55.248000 ], [ 817, 55.796100 ], [ 818, 56.344300 ], [ 819, 56.892400 ], [ 820, 57.440600 ], [ 821, 57.727800 ], [ 822, 58.015000 ], [ 823, 58.302200 ], [ 824, 58.589400 ], [ 825, 58.876500 ], [ 826, 59.163700 ], [ 827, 59.450900 ], [ 828, 59.738100 ], [ 829, 60.025300 ], [ 830, 60.312500 ] ] _Illuminant_D65 = None def init (): '''Initialize CIE Illuminant D65. This runs on module startup.''' table_size = len (_Illuminant_D65_table) first_wl = _Illuminant_D65_table [0][0] last_wl = _Illuminant_D65_table [-1][0] # for now, only consider the part in the normal visible range (360-830 nm) first_index = ciexyz.start_wl_nm - first_wl table_first = _Illuminant_D65_table [first_index][0] assert (table_first == 360), 'Mismatch finding 360 nm entry in D65 table' global _Illuminant_D65 _Illuminant_D65 = ciexyz.empty_spectrum() (num_wl, num_cols) = _Illuminant_D65.shape for i in xrange (0, num_wl): _Illuminant_D65 [i][1] = _Illuminant_D65_table [first_index + i][1] # normalization - illuminant is scaled so that Y = 1.0 xyz = ciexyz.xyz_from_spectrum (_Illuminant_D65) scaling = 1.0 / xyz [1] _Illuminant_D65 [:,1] *= scaling # # Get any of the available illuminants - D65, A, any blackbody, or a constant spectrum. # ColorPy does not currently provide D55 or D75. # def get_illuminant_D65 (): '''Get CIE Illuminant D65, as a spectrum, normalized to Y = 1.0. CIE standard illuminant D65 represents a phase of natural daylight with a correlated color temperature of approximately 6504 K. (Wyszecki, p. 144) In the interest of standardization the CIE recommends that D65 be used whenever possible. Otherwise, D55 or D75 are recommended. (Wyszecki, p. 145) (ColorPy does not currently provide D55 or D75, however.)''' illuminant = _Illuminant_D65.copy() return illuminant def get_illuminant_A (): '''Get CIE Illuminant A, as a spectrum, normalized to Y = 1.0. This is actually a blackbody illuminant for T = 2856 K. (Wyszecki, p. 143)''' illuminant = get_blackbody_illuminant (2856.0) return illuminant def get_blackbody_illuminant (T_K): '''Get the spectrum of a blackbody at the given temperature, normalized to Y = 1.0.''' illuminant = blackbody.blackbody_spectrum (T_K) xyz = ciexyz.xyz_from_spectrum (illuminant) if xyz [1] != 0.0: scaling = 1.0 / xyz [1] illuminant [:,1] *= scaling return illuminant def get_constant_illuminant (): '''Get an illuminant, with spectrum constant over wavelength, normalized to Y = 1.0.''' illuminant = ciexyz.empty_spectrum() (num_wl, num_cols) = illuminant.shape for i in xrange (0, num_wl): illuminant [i][1] = 1.0 xyz = ciexyz.xyz_from_spectrum (illuminant) if xyz [1] != 0.0: scaling = 1.0 / xyz [1] illuminant [:,1] *= scaling return illuminant # Scale an illuminant by an arbitrary factor def scale_illuminant (illuminant, scaling): '''Scale the illuminant intensity by the specfied factor.''' illuminant [:,1] *= scaling return illuminant # Initialize at module startup init() # Figures - Plot some of the illuminants def figures (): '''Plot spectra for several illuminants.''' # D65 plots.spectrum_plot ( get_illuminant_D65(), 'CIE Illuminant D65', 'Illuminant-D65') # A plots.spectrum_plot ( get_illuminant_A(), 'CIE Illuminant A', 'Illuminant-A') # Constant plots.spectrum_plot ( get_constant_illuminant(), 'Constant Illuminant', 'Illuminant-Const') # Blackbody (5778) plots.spectrum_plot ( get_blackbody_illuminant (5778.0), '5778 K Illuminant', 'Illuminant-5778')
27.741403
106
0.555881
2,665
20,168
4.169231
0.534334
0.03159
0.0027
0.01008
0.235802
0.214742
0.204752
0.198632
0.181712
0.172352
0
0.431245
0.282081
20,168
726
107
27.779614
0.336142
0.249554
0
0.035593
0
0
0.01123
0
0
0
0
0
0.001695
1
0.011864
false
0
0.008475
0
0.028814
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e3d079b0ac366654644d7bfe8c3c51abdf0bef18
308
py
Python
Afvaldienst/__init__.py
xirixiz/python-afvalwijzer-afvalstoffendienst
ef76b07033848a6f7092e941c6c4a3ec214f2842
[ "MIT" ]
1
2019-10-28T12:26:14.000Z
2019-10-28T12:26:14.000Z
Afvaldienst/__init__.py
xirixiz/afvaldienst
ef76b07033848a6f7092e941c6c4a3ec214f2842
[ "MIT" ]
3
2020-09-11T08:38:50.000Z
2020-09-23T07:08:44.000Z
Afvaldienst/__init__.py
xirixiz/python-afvalwijzer-afvalstoffendienst
ef76b07033848a6f7092e941c6c4a3ec214f2842
[ "MIT" ]
null
null
null
__author__ = 'Bram van Dartel - xirixiz' __author_email__ = 'spam@rootrulez.com' __license__ = 'MIT' __maintainer_email__ = 'spam@rootrulez.com' __url__ = 'https://github.com/xirixiz/afvaldienst', __version__ = '1.1.4' from .Afvaldienst import Afvaldienst from .AfvaldienstScraper import AfvaldienstScraper
30.8
51
0.788961
35
308
6.2
0.628571
0.082949
0.165899
0.193548
0
0
0
0
0
0
0
0.01083
0.100649
308
9
52
34.222222
0.772563
0
0
0
0
0
0.347403
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e3e5cb6c2267ca3e81be3aad88376455fe125b55
14,828
py
Python
nnef_tools/conversion/tensorflow/tf_pb_to_tf_py.py
rgiduthuri/NNEF-Tools
8a9971f897fb5a110dd254e0c20077213f257700
[ "Apache-2.0" ]
null
null
null
nnef_tools/conversion/tensorflow/tf_pb_to_tf_py.py
rgiduthuri/NNEF-Tools
8a9971f897fb5a110dd254e0c20077213f257700
[ "Apache-2.0" ]
null
null
null
nnef_tools/conversion/tensorflow/tf_pb_to_tf_py.py
rgiduthuri/NNEF-Tools
8a9971f897fb5a110dd254e0c20077213f257700
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2017 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import division, print_function, absolute_import import typing from functools import partial import numpy as np import six from nnef_tools.conversion import shape_fixer from nnef_tools.core import utils from nnef_tools.io.tensorflow.tf_graph import * from nnef_tools.io.tensorflow.tf_pb import tf_pb_eval, tf_pb_shape_inference _tf_py_dtype_by_tf_pb_dtype = { 'DT_INVALID': None, 'DT_HALF': 'float16', 'DT_FLOAT': 'float32', 'DT_DOUBLE': 'float64', 'DT_INT8': 'int8', 'DT_INT16': 'int16', 'DT_INT32': 'int32', 'DT_INT64': 'int64', 'DT_UINT8': 'uint8', 'DT_UINT16': 'uint16', 'DT_UINT32': 'uint32', 'DT_UINT64': 'uint64', 'DT_BOOL': 'bool', 'DT_STRING': 'string', 'DT_COMPLEX64': 'complex64', 'DT_COMPLEX128': 'complex128', } def _evaluate_constant(tf_tensor): # type: (TFTensor)->np.ndarray # noinspection PySimplifyBooleanCheck if tf_tensor.data == []: return np.array([], dtype=np.dtype(tf_tensor.dtype)) value = np.array(tf_tensor.data, dtype=np.dtype(tf_tensor.dtype)) last_val = value.flat[-1] value2 = np.full(shape=tf_tensor.shape, fill_value=last_val, dtype=np.dtype(tf_tensor.dtype)) value2.flat[:value.size] = value.flat return value2 # noinspection PyProtectedMember def evaluate_and_convert(tf_graph, source_shapes=None): # type: (TFGraph, typing.Union[typing.Dict[str, typing.List[int]], typing.List[int], int, None])->None tf_graph.sort() if isinstance(source_shapes, dict): source_shapes = {(k + ':0' if ':' not in k else k): v for k, v in six.iteritems(source_shapes)} shape_fixer.fix_input_shapes(tf_graph, source_shapes) const_value_by_tensor = {} for tensor in tf_graph.tensors: if tensor.is_constant: const_value_by_tensor[tensor] = tf_pb_eval._evaluate_constant(tensor) elif tensor.is_variable: const_value_by_tensor[tensor] = tensor.data for op in tf_graph.operations: # Shape prop if op.name not in tf_pb_shape_inference._DefaultPropagators: raise utils.NNEFToolsException("Operation '{}' is not supported".format(op.name)) propagated_shapes, propagated_dtypes = \ tf_pb_shape_inference._DefaultPropagators[op.name](op, const_value_by_tensor) assert not utils.has_le_0(propagated_shapes) assert len(propagated_shapes) == len(propagated_dtypes) == len(op.outputs) for new_shape, new_dtype, tensor in zip(propagated_shapes, propagated_dtypes, op.outputs): assert utils.compatible_shapes(tensor.shape, new_shape) tensor.shape = new_shape assert tensor.dtype is None or tensor.dtype == new_dtype tensor.dtype = new_dtype # Evaluation if op.name in tf_pb_eval._DefaultOpEvaluators: tf_pb_eval._DefaultOpEvaluators[op.name](op, const_value_by_tensor) # Conversion assert op.name in DefaultConverters, "No tf_pb_to_tf_py converter for {}".format(op.name) DefaultConverters[op.name](op, const_value_by_tensor) for tensor in tf_graph.tensors: tensor.dtype = _tf_py_dtype_by_tf_pb_dtype.get(tensor.dtype, None) for tensor in tf_graph.tensors: if tensor.is_variable: label = tensor.name if label is not None: if label.endswith(':0'): label = label[:-2] label = label.replace(':', '_') tensor.label = label def fix_types(list_): # type: (typing.Any)->typing.Any if isinstance(list_, list) and len(list_) >= 1 and utils.is_anyint(list_[0]): list_ = [utils.anyint_to_int(i) for i in list_] return list_ def generic_converter(op, # type: TFOperation const_value_by_tensor, # type: typing.Dict[TFTensor, np.ndarray] target_name, # type: str attrib_name_dict=None, # type: typing.Optional[typing.Dict[str, str]] input_to_attrib_dict=None, # type: typing.Optional[typing.Dict[int, str]] revert_inputs=False, # type: bool new_attribs=None, # type: typing.Optional[typing.Dict[str, typing.Any]] list_attribs=None, # type: typing.List[str] ): # type: (...)->None op.name = target_name if attrib_name_dict: attribs = {} for k, v in six.iteritems(op.attribs): if k in attrib_name_dict: attribs[attrib_name_dict[k]] = v else: attribs[k] = v op.attribs = attribs if input_to_attrib_dict: inputs = [] for i in range(len(op.inputs)): if i in input_to_attrib_dict: assert "{}.{} not evaluated to constant".format(op.name, input_to_attrib_dict[i]) op.attribs[input_to_attrib_dict[i]] = fix_types(const_value_by_tensor[op.inputs[i]].tolist()) elif (i - len(op.inputs)) in input_to_attrib_dict: assert "{}.{} not evaluated to constant".format(op.name, input_to_attrib_dict[i - len(op.inputs)]) op.attribs[input_to_attrib_dict[i - len(op.inputs)]] = fix_types( const_value_by_tensor[op.inputs[i]].tolist()) else: inputs.append(op.inputs[i]) op.inputs = tuple(inputs) if revert_inputs: op.inputs = tuple(reversed(op.inputs)) if new_attribs: op.attribs.update(new_attribs) if list_attribs: op.attribs = {k: [v] if k in list_attribs and not isinstance(v, (list, tuple)) else v for k, v in six.iteritems(op.attribs)} def convert_cast(op, const_value_by_tensor): # type: (TFOperation, typing.Dict[TFTensor, np.ndarray])->None op.name = "tf.cast" op.attribs['dtype'] = _tf_py_dtype_by_tf_pb_dtype[op.attribs['DstT']] # See: https://www.tensorflow.org/api_docs/cc/ DefaultConverters = { # attribless: "Abs": partial(generic_converter, target_name="tf.abs"), "Add": partial(generic_converter, target_name="tf.add"), "BatchToSpaceND": partial(generic_converter, target_name="tf.batch_to_space"), "BiasAdd": partial(generic_converter, target_name="tf.nn.bias_add"), "Ceil": partial(generic_converter, target_name="tf.ceil"), "Elu": partial(generic_converter, target_name="tf.nn.elu"), "Equal": partial(generic_converter, target_name="tf.equal"), "Exp": partial(generic_converter, target_name="tf.exp"), "Floor": partial(generic_converter, target_name="tf.floor"), "Greater": partial(generic_converter, target_name="tf.greater"), "GreaterEqual": partial(generic_converter, target_name="tf.greater_equal"), "Identity": partial(generic_converter, target_name="tf.identity"), "LeakyRelu": partial(generic_converter, target_name="tf.nn.leaky_relu"), "Less": partial(generic_converter, target_name="tf.less"), "LessEqual": partial(generic_converter, target_name="tf.less_equal"), "Log": partial(generic_converter, target_name="tf.log"), "LogicalAnd": partial(generic_converter, target_name="tf.logical_and"), "LogicalNot": partial(generic_converter, target_name="tf.logical_not"), "LogicalOr": partial(generic_converter, target_name="tf.logical_or"), "Maximum": partial(generic_converter, target_name="tf.maximum"), "Minimum": partial(generic_converter, target_name="tf.minimum"), "Mul": partial(generic_converter, target_name="tf.multiply"), "Neg": partial(generic_converter, target_name="tf.negative"), "NotEqual": partial(generic_converter, target_name="tf.not_equal"), "Pow": partial(generic_converter, target_name="tf.pow"), "RealDiv": partial(generic_converter, target_name="tf.divide"), "Relu": partial(generic_converter, target_name="tf.nn.relu"), "Relu6": partial(generic_converter, target_name="tf.nn.relu6"), "Round": partial(generic_converter, target_name="tf.round"), "Rsqrt": partial(generic_converter, target_name="tf.rsqrt"), "Sigmoid": partial(generic_converter, target_name="tf.nn.sigmoid"), "Sign": partial(generic_converter, target_name="tf.sign"), "Softmax": partial(generic_converter, target_name="tf.nn.softmax", new_attribs={'axis': -1}), "Softplus": partial(generic_converter, target_name="tf.nn.softplus"), "Softsign": partial(generic_converter, target_name="tf.nn.softsign"), "Sqrt": partial(generic_converter, target_name="tf.sqrt"), "Square": partial(generic_converter, target_name="tf.square"), "Sub": partial(generic_converter, target_name="tf.subtract"), "Tanh": partial(generic_converter, target_name="tf.nn.tanh"), "Select": partial(generic_converter, target_name="tf.where"), 'ClipByValue': partial(generic_converter, target_name='tf.clip_by_value'), # more complex: "AvgPool": partial(generic_converter, target_name="tf.nn.avg_pool"), "Conv2D": partial(generic_converter, target_name="tf.nn.conv2d"), "Conv3D": partial(generic_converter, target_name="tf.nn.conv3d"), "Conv2DBackpropInput": partial(generic_converter, target_name="tf.nn.conv2d_transpose", input_to_attrib_dict={0: "output_shape"}, revert_inputs=True), "Conv3DBackpropInputV2": partial(generic_converter, target_name="tf.nn.conv3d_transpose", input_to_attrib_dict={0: "output_shape"}, revert_inputs=True), # "CudnnRNN": None, "DepthwiseConv2dNative": partial(generic_converter, target_name="tf.nn.depthwise_conv2d_native"), "FusedBatchNorm": partial(generic_converter, target_name="tf.nn.fused_batch_norm"), "LRN": partial(generic_converter, target_name="tf.nn.lrn"), "MatMul": partial(generic_converter, target_name="tf.matmul"), "MaxPool": partial(generic_converter, target_name="tf.nn.max_pool"), "MaxPoolWithArgmax": partial(generic_converter, target_name="tf.nn.max_pool_with_argmax"), "Pack": partial(generic_converter, target_name="tf.stack"), # "Placeholder": None, # "PlaceholderWithDefault": None, "Shape": partial(generic_converter, target_name="tf.shape"), "Squeeze": partial(generic_converter, target_name="tf.squeeze", attrib_name_dict={"squeeze_dims": "axis"}), # even more complex: "ExpandDims": partial(generic_converter, target_name="tf.expand_dims", input_to_attrib_dict={1: "axis"}), "ArgMin": partial(generic_converter, target_name="tf.argmin", input_to_attrib_dict={1: "axis"}), "ArgMax": partial(generic_converter, target_name="tf.argmax", input_to_attrib_dict={1: "axis"}), "Max": partial(generic_converter, target_name="tf.reduce_max", attrib_name_dict={"keep_dims": "keepdims"}, input_to_attrib_dict={1: "axis"}, list_attribs=['axis']), "Min": partial(generic_converter, target_name="tf.reduce_min", attrib_name_dict={"keep_dims": "keepdims"}, input_to_attrib_dict={1: "axis"}, list_attribs=['axis']), "Mean": partial(generic_converter, target_name="tf.reduce_mean", attrib_name_dict={"keep_dims": "keepdims"}, input_to_attrib_dict={1: "axis"}, list_attribs=['axis']), "ConcatV2": partial(generic_converter, target_name="tf.concat", input_to_attrib_dict={-1: "axis"}), "Pad": partial(generic_converter, target_name="tf.pad", input_to_attrib_dict={1: "paddings"}, new_attribs={'mode': 'CONSTANT', 'constant_values': 0.0}), "MirrorPad": partial(generic_converter, target_name="tf.pad", input_to_attrib_dict={1: "paddings"}, new_attribs={'constant_values': 0.0}), "Reshape": partial(generic_converter, target_name="tf.reshape", input_to_attrib_dict={1: "shape"}), "ResizeArea": partial(generic_converter, target_name="tf.image.resize_area", input_to_attrib_dict={1: "size"}), "ResizeBilinear": partial(generic_converter, target_name="tf.image.resize_bilinear", input_to_attrib_dict={1: "size"}), "ResizeNearestNeighbor": partial(generic_converter, target_name="tf.image.resize_nearest_neighbor", input_to_attrib_dict={1: "size"}), "Slice": partial(generic_converter, target_name="tf.slice", input_to_attrib_dict={1: "begin", 2: "size"}), "SpaceToBatchND": partial(generic_converter, target_name="tf.space_to_batch"), "Split": partial(generic_converter, target_name="tf.split", attrib_name_dict={'num_split': 'num_or_size_splits'}, input_to_attrib_dict={0: "axis"}), "SplitV": partial(generic_converter, target_name="tf.split", input_to_attrib_dict={1: "num_or_size_splits", 2: "axis"}), "StridedSlice": partial(generic_converter, target_name="tf.strided_slice", input_to_attrib_dict={1: "begin", 2: "end", 3: "strides"}), "Sum": partial(generic_converter, target_name="tf.reduce_sum", input_to_attrib_dict={1: "axis"}, attrib_name_dict={"keep_dims": "keepdims"}, list_attribs=['axis']), "Transpose": partial(generic_converter, target_name="tf.transpose", input_to_attrib_dict={1: "perm"}), "Tile": partial(generic_converter, target_name="tf.tile", input_to_attrib_dict={1: "multiples"}), "Cast": convert_cast, "Sin": partial(generic_converter, target_name="tf.sin"), "Cos": partial(generic_converter, target_name="tf.cos"), "Any": partial(generic_converter, target_name="tf.reduce_any", attrib_name_dict={"keep_dims": "keepdims"}, input_to_attrib_dict={1: "axis"}, list_attribs=['axis']), "All": partial(generic_converter, target_name="tf.reduce_all", attrib_name_dict={"keep_dims": "keepdims"}, input_to_attrib_dict={1: "axis"}, list_attribs=['axis']), }
50.435374
115
0.658956
1,863
14,828
4.960816
0.184648
0.088725
0.199091
0.251028
0.540251
0.505735
0.318005
0.168795
0.113179
0.098788
0
0.009277
0.207648
14,828
293
116
50.607509
0.777343
0.088211
0
0.095652
0
0
0.169424
0.017803
0
0
0
0
0.030435
1
0.021739
false
0
0.03913
0
0.073913
0.004348
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
e3edc74364411dacd749db536296fed60fe22954
26,799
py
Python
django/docs/ref/contrib/auth.txt.py
roshanba/mangal
f7b428811dc07214009cc33f0beb665ead402038
[ "bzip2-1.0.6", "MIT" ]
null
null
null
django/docs/ref/contrib/auth.txt.py
roshanba/mangal
f7b428811dc07214009cc33f0beb665ead402038
[ "bzip2-1.0.6", "MIT" ]
null
null
null
django/docs/ref/contrib/auth.txt.py
roshanba/mangal
f7b428811dc07214009cc33f0beb665ead402038
[ "bzip2-1.0.6", "MIT" ]
null
null
null
XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXXXX XXXXXXXX XXX XXXXXXXXX XXXXXXXX XXX XXX XXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXX XXXX XXXXXXX XX XXX XXXXX XX XXXXX XXXXXXXXXX XX XXX XX XXXXXXXXX XXXXXXXXXXXXXX XXX XXXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXX XXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXX XXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXX XXXXXX XXXXXX XX XXXXXXX XXXXXXXXXXX XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXX XXX XXXXXXXXX XXXXXXX XX XXXXXXXXXXX XXXXXXXX XXXXXXXXX XXX XXXXXXXXXX XX XXXXXX XXXXXXXXX XXX XXXXXXX XXXXXXXXXXXXX XXXXXX XXXXXX XXXXXX XXXXX XXX XXXXX XXXXXXXXXXX XXX XXXXXXXXXXXXXX XXXXXX XX XXXXXXXXXX XXX XXXX XXX XXXXXX XX XXX XXXX X XXXXXX XXXXXXX XXXXXX XXX X XXXXXXXXXXXX XXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XXX XXXXX XXXX XXX XXXXXXXXXXX XXXXXXXX XXXXXXXXXXXX XXX XXXXXX XXXXXXX XXXXXXXXX XXXXXXX XX XXXX XXXXXXXXXXXXXXXXXX XXXXXXX XXXXX XXX XXXX XXXXXX XXXXXX XXXXXXX XXXX XXX XXXXXXXXXX XX XXXX XXXX XX XXXXXXXX XX XXXXXXXXXXX XXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXX XX XXXXXX XX XXXXXXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXX XXXXXXXXX XXXX XX XX XXX XXXXXXXXXXX XX XXXXXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXX XX XXXXXX XX XXXXXXXXXXX XXXXX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXX XX XXXXXXXXXXX XXXXXXXX XXXXXXXXX X XXXX XXX XXX XXXXXXXX XXXXXX XXX XXXXXXXXX XXXXXXX XXXXXXX XXXXX XXX XXX XXXXXXXXXX XXX XXXXXXXXX XXX XX XXXXXXXXXXX XXXX XXX XXX XXXXXXX XXX XXXXXXXXXX XXX XXX XXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXX XXXXXX XXXXXXXXXXXX XXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXXXX XXXXXXX XXXX XXXX XXX XXXXXX XXX XXXXX XXXXX XX XXXXXXXXXXX XXXXXXXXX XXXXXXXX XXXXXXXXXX XXXXXXX XXXX XXXX XXXXXXX XXXXXX XX XXXXXXXXXX XXXXXXX XX XXXXXXXXX XXXX XXX XXX XXXX XXXX XX XXXXXXXXX XXXXXXX XX XXXXXXXX XXXXXXXXX XXXX XXXX XX XXXX XXXXXXXXXXXX XXXX XXX XXXXXXX XXXX XX XXXXXX XXX XXXXXXX XXXX XXXXX XXXXXX XXXX XXXXXXX XXXXXXXXXXX XXXXXXX XXXXXXX XX XXX XXX XXXX XXX XXX XXX XXXXXXXXXXXXXX XXXXXXXX XXXXXX XXXXXXXX XX XXXXX XXX XXX XXXXXXXXXXXXX XXXX XXX XXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XXXX XX XXXXX XXXXXXXX XXXXX XX XXXXXX XX XXXX XXXXX XXXXXX XXXX XXXX XX XXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XX XXXXXXX XXXXXXXX XXXXXX XX XXXXX XXXX XXX XXXXXXXXXXXXXXXXXXX XXXXXXX XXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXX XX XXX XXXXXX XXXXX XXX XXXXXX XXXXXXXXX XXX XXXXXXXX XXXXXX XX XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXX XXXXXXXXXX XXXX XXXX XXXX XXX XXX XXXXXXXXXXX XXXXXXX XXXXXXXXXX XXXXXXXXX XXXXX XX XXXXXXXXXXX XXXXXXXXXX X XXXXXXXX XX XXX XXXXXX XXXX XXXXXX XX XXXXXXXXXXX XXXXXXXXXXX X XXXXXXXX XXXXXXXXXXX XXXX XXX XXXXXXX XXX XXXXXXXX XX XXX XX XXX XXXXXXX XXXXXXXXX XX XXXXXXX XXXX XXX XXXXXXX XX XXXXXXXX XXXXXXXXXX XXXXXXXXXX XX XXXXXXX XXXXXXXXXXX XXXXXXXXX XX XXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXX XX XXXXXX XXXXXXXX XXX XXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XX XXXXXX XXXXXXXXXXX XXXX XX X XXX XX XXXX XX XXX XXXX XXX XXXX XXXXXXXXXXXXXX XXXX XXXX XXX XXXXX XXX XXXXXXXXXXX XXX XXXXXXX XXXXX XX XXX XXXX XX XXXXXX XX XXX X XXXXX XXXXXXXX XXXX XXXXXX XXXXXXXX XXX XXXX XXXXX XXXX XXXXXXXXX XX XXXXXXXXXXXXXXXX XX XXXX XXX XXXXXXX XX XXX XXXX XXXXXXXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXX XXXXXXXXX XXXXXXXXX XXXXXX XXX XXXXXX XXXX XXXX XXXXXXXXX XX XXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XX XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXX XX XXXXXX XXXXXXXXXX XXXX XX X XXX XX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXX XXX XXXXXX XXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXX XXXXXXXXXX XXXXXXX XXXXXXX XX XXXXXXX XXXXXXXXXXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXX XXXXXXXX XXX XXX XXXXX XXXXX XXX XXXXXXXX XXXXX XXX XX XXXXXXX XXXX XXX XXXXXX XXX XXXX XXXXXX XXXXXXX XX XXXXXXXXXXX XXX XXXXXXXX XXXXXXXXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX X XXXXX XX XXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXX XXXXXX XXXXXXXX XX XXX XXXXX XXX XXXXXXX XXXXXX XXXX XX XXX XXXXXXXX XXXXXXXX XXXXXXX XXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXX XXX XXXXXXXXXXXXXXXX XX XXXXXXXXX XXX XXXXXXXX XXXX XX XXX XX XX XXXXXXXX XXXXXXXXX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXXX XX XXX XXXXX XXX XXXXXX XX XXX XXXXXXX XXXXXXXX XXX XXX XXXXX XXXXX XXXXX XXXX XX XXX XXXXXXXX XXXXXXX XX XXXXXX XXX XXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXX XXX XXXX XX XXXXXX XX XXXXXXXX XXXX XXXX XXXXX XXX XXXX XX XXXXXX X XXXXX XXXXXX XXX X XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXX XXXX XXXX XXXXX XXXXXX XXXXXXXXX XXXXXXX XXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXX XXX XXXX XXXX XX XXXXXXXXXXXXXX XXX XXXX XXXXXXXXXXX XXXXX XXXXX XXXXXXX XX XXXXXXXX XXXXXXXX XXXXXX XXXX XX XX XXXX XXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXX XXXXXX XXX XXXX XXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX X XXX XX XXXXXXXXXX XXXXXXX XXXX XXX XXXX XXX XXXXXXXXX XX XXXXXXX XX XXXXXX XXX XXXX XXXXXXX XXX XXXX XXXXXXXXXXX XXX XXXX XXXXXXXX XXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX X XXX XX XXXXXXXXXX XXXXXXX XXXX XXX XXXX XXXX XXXXXXX XXXXX XXXXXXX XX XXXXXXX XX XXXXXX XXX XXXX XXXXXXX XXX XXXXX XXXXXXXXXXX XXX XXXX XXXXXXXX XXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX X XXX XX XXXXXXXXXX XXXXXXX XXXX XXX XXXX XXXX XXXX XXXXXXX XXXXX XXX XXXX XXXXXXXXXXXX XX XXXXXXX XX XXXXXX XXX XXXX XXXXXXX XXX XXXXXXXXXXX XXX XXXX XXXXXXXX XXXXXXX XX XXXXXXXX XXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXXXXXXX XX XXX XXXX XXX XXX XXXXXXXXX XXXXXXXXXXX XXXXX XXXX XX XX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXX XXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XX XXX XXXX XX XXXXXXXXX XXXX XXXXXX XXXX XXXXXX XXXXXX XXXXXXXXXX XXX XX XXXXXX XXXXXXXXXX XXXX XXXXXX XXXX XXXXXX XXXXXX XXXXXXXXX XX XXXXXXX XX XXXXXX XXX XXXX XXXXXX XXXXX XXXXX XXX X XXXXXXXXXX XXX XXX XXXXXX XXX XXX XXXX XXXXXXXX XXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXXXXXXX XX XXX XXXX XXX XXXX XX XXX XXXXXXXXX XXXXXXXXXXXX XXXXX XXXX XXXX XX XX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XX XXX XXXX XX XXXXXXXXX XXXX XXXXXX XXXX XXXXXX XXXXXX XXXXXXXXXX XXX XX XXXXXX XXXXXXXXXX XXXX XXXXXX XXXX XXXXXX XXXXXX XXXXXXXXX XX XXXXXXX XX XXXXXX XXX XXXX XXXXXX XXXXX XXXXX XXX XXXXXXXXXXX XXX XXX XXXXXX XXX XXX XXX XXXXXXXX XXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXXX XX XXX XXXX XXX XXX XXXXXXXXXXX XX XXX XXXXX XXXXXXX XXXX XXXXXX XXX XXXXXXX XX XXX XXXX XX XXXXXXXXX XXXX XXXXXX XXXX XXXXXX XXXXXX XXXXXXXXXX XXX XX XXXXXX XXXXXXXXXX XXXX XXXXXX XXXX XXXXXX XXXXXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXX XXXXX XX XXXXX XX XXX XXXXX XX XXXXXXXXXXXXXX XX XXXXXXXXX XXXXXX XXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXX XXX XXXXXX XX XXX XXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXX X XXXXXX XXXXXXX XXXX XXX XXX XXXXXXXXX XXXXXX XXXXXXX XXX XXXXXXXX XX XXX XXXXXXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXX XXXXX XXX XXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XX XXXXXX XXX XXXXXX XXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXX XXXXXXXXX XX XXXXXXXXXX XXX XXX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XX XXXXXXXXX XX XX XXXXXXXX XX XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXXXXXX XXX XXXXXXXXXXXXXXXX XXXXXXX XXXXXXXXX XXX XXXXXX XXXXXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXX XXXXXX XX XXXXX XXXXXXX XXXXXXXXX XXXXXX XX X XXXXXXXXXXXX XXXX XXXXX XXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXX XXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXX XX XXXXXXXXXXXXXXXXXXXX XXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXXXX XXXX XXXX XXX XXXXX XXXXXXXXXX XXXXXXXX XXXXXX XX XXX XXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXX XXXXXX XX XX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXXXX XX XX XXXXX XXX XXXX XXX XXXXXXXX XXXXXX XX XXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXX XXXXXXX XXXX XXXXXX XXXXXX XX XX XXXXXXXXXX XXXXXXX XXXX XXXXXXXX XXXXXX XXX XXXXXXXX XX XXXXXX XXX XXXXX XXXXXXXXXXXX XX XXXXXX XXXXXX XX XXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXX XXX XXXXXX XXXX XXXXXXX XXXXXXXXXXX XX XXXXXXXXXXX XX XXXXXX XX XXX XXXX XXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXX XXXXXX XXXX XXX XXX XXXXXXXXXX XX XXXX XXX XXX XXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XX XXXX XXXX XX XXXXX XX XXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX X XXXXX XXXX XXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXX XXXXX XXXXXXXXXXXX X XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXX XXXXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXX XXX XXXXX XXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXXX XXX XXXXX XXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXX XX XXXXXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXX XXXXXXX XX XXXXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXX XXXXXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXX XXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXX XXX XXXXXXXX XXXXX XXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XX XXXX XXXX XXX XXXXXXX XXXX XX XXX XXXXXXXXX XX XXXXXXXXX XX XXX XXXX XXXXXXXX XXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXX XXXXXX XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXX XXX XXXXXXXXX XXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXX XX XXXXXXXXXXX XXXX XXXXXXXXX XXX XXXXXXXXXX XX XXXXXX XXXXXXXX XXXXXX XXXXXXXX XX XXXXXXXXXXX XXXXXXXXXXXX XXXXXXXXX X XXXXXXXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXX XXXXX XXXXXXXX X XXXXXX XXX XXXX XXXXXXXXX XXXXXX XX XXXXXXXXXXX XXXXXXXX XXXXXXXXX XXX XXXXXXXXXX XX XXXXXX XXXXXXXX XXXXXXXXXXXXXXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXX XXX XXXXXXXX XXXXXXXXXXX XXXXXXX XXXX XXX XXXXX XXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXX XXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXXX XXXXXX XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXX XXX XXXXXXXXX XXXXXXX XX XXXXXXX XXXXXXXXXXXX XXXXXXXXX XX XXXXXXXXXXX XXXX XXXXXXXXX XXX XXXXXXXXXX XX XXXXXX XXX XXXXXXXXXX XXX XXXXXXXXXX XXXXXXXX XXXXXXXXXX XXXXXXXXX XX XXXXXXXXXXX XXXXXXXXXXX XXXXXXXXXXXX XXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X XXXXX XXXXXXXXX XXXXXXXX XXXX XXXXX XXXXXXX XXX XXXXXXXX XX XXXXXXXX XX XXXXXX XXXXXX XXXXXX XXXXXX XXX XXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X XXXXX XXXXXXXXX XXXXXXXX XXXXXXX XXXXXXXXXXX XX XXXXXXXX XX XXXXXX XXXXXX XXXXXX XXXXXX XXX XXXXXX XXX XXXXXXX XXXXXXXXX XXX XXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXX XXXXX XXX XXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXX XXXXXXXXX XXXX XXX XXXXXXXXX XXXXXXXXXXXXX XXXXXXXXXXXXXXXXXX XXXX XXX XX XXXX XXX XXXXXXXXXXXX XXXX X XXXX XXXX XX XX XXXX XX XXXXXXXXXX XXXXXXXXXXXXXX XXXX XXXX X XXXX XXXX XX XXXXXXXXXXXXX XXXXXXXXX XXXX XXXX XXXX XXXXXXX XXXXXXXXXX XXX XXXXX XX XXX XXXX XXXX XXXX XXXXXX XXX XXXXXXXXXXX XXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXXX XXX XXXX XXXXXXXX XXXX XXXX XXXXXX XXX XX XXXXXXXXXX XXXXXXXXXXXXXXX XXXX XXXX XXX XXXXXX XXXXXX XX XXXXXXX XXXXXXXXXX XX XXXXXX XXX XXXXX XX XXX XXXX XXXX XXXX XXXXXX XXX XX XXXXXXXX XX XXX XXXX XXX XXX XXXXXXXXXXXXXX XXXXXXXXXXX XXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXXX XXX XXXX XXXXXXXX XXXX XXXX XXXXXX XXX XX XXXXXXXX XX XXX XXXX XXX XXX XXXXXXXXXXXXXX XX XXXXXXXXXX XXXXXXXXXXXXXXXXX XXXX XXXX XXX XXXX XXXXXX XX XXXXX XXXXXXXXXXXX XXXXXXXXXX XXX XXXX XX XXX XXXXXX XXXX XXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX X XXXXXXXXXX XX XXXXXXX XXXXXXXXX XXXXXXXXXX XXX XXXX XXXXXXXXXXX XXXX XXXX XXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXX XXX XXXXXX XXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXX XXXXXXXX X XXX XX XXXXXXXXXXX XXXXXXXXX XXXXXXXXXX XXXXXXXXX XXXX XXX XX XXXX XX XXX XXXXX XX XXXX XX XXX XXXXXXX XXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XX XXX XXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXXXXXXX XXXX XXXXXXX XXXXXXX XXX XXXXXXXXXXXXXX XXXXXXXX XXXX XXXX XXXX XXXXXXX XXX XXXXXXXXXXX XX XXX XX XXX XXXX XXX XXX XX XXXXX XXXX XXX XXXXXXXXXXXXXX XXXXXXXXX XXX XXX XXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XXXXXXXXXX XXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXXXXXXXXX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXX XXXXXXXX XXX XXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXX X XXXX XXXXX XXXX XXXXXXXX XXXXXXX XXXXXXXXXXXXXXX XXX XXX XXXXXXXX XXXXXXXX XX XXXXXXXX XX XXXX XXXXXX XXX XXXX XXX XXXXXXX XX XXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XXX XXX XX XXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXX XXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XX XXXXXXXXXXXX XXX XXX XXXXXXXXXX XXXXXX XXXXXXXXX XX XXXXXXX XXXXXXXXXXXX XXXX XX XXX XXXXXXX XXXXXXXXXXXXXX XXXXXXX XXXX XX XXXXXXX XX XXXXXXXXXXXXX XXXXX XXXXXXXXXXX XXXXXXXXXX XX X XXXX XXXXXXXXXX XXX XXXXXXXXX XXX XXXXXXXX XXXXXXX XXXX XXXXXX XXX XXXX XXXXXXXXXX XX XXX XXXXXXXXX XXX XXXXXX XXXX XXXXXX XX XX XXX XXXXX XXXXXXXXX XX XXXXXXXXXXXXXX XXXX XXXXXXXXXXXXXXXXX XXXXX XXX XXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXX XXXXXXX XXX XXXXXXX XXXXXXXXXXX XXXXX XX XXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XX XXXXXX XX XX XXXXXX XX X XXXXXXXXX XXX XXXXXXXXXXXXXXX XXXXXXXXXXXX XXX XXXX XXXXXXX XXXX XXX XXXXXXXXX XXXX XXXXX XXXX XXXXXXXXX XX XXXXX XXX XX XXXXXXXXXXX XX XXXXX XX XXX XXXXXXX XXXXXXXXXXXXXXXXX XXXX XXXXXX XX XXXXXX XX XX XXXXXX XX X XXXXXXXXXX XXX XXXXXX XXXXXX XXXXXXX XX XXXXXXX XX XXXXX XXXXXXXX XX XXXXX XX XXX XXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXXXXXXX XXXXXXXXX XXXXX XX XXXXXXXXXXXX XXXXXXXXXXXX XXXX XXXXXXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XX XXXXXXXXXXXX XX XXXXXXXXX XX XXXXX XX XXXXX X XXXXXXXX XXXX XXXXXXXXXX XXXXX XXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XX XXXXXXXXXXXXX XXXX XX XXXXXXXXX XXXXXXXXXXX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XX XXXXXXXX XX XX XXXXXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXX XX XX XX XXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXX XXX XX XXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXX XXX XXXX XXXXX XXX XXXX XXXXXXXXXXXX XXXXXXX XX XXXXX XXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXX XXX XX XXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXX XXX XXXX XXX XXXXXXXXXXX XX XXX XXXXXX XXXX XXXXXXX XXXXXXX XX XXXXX XXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXX XXX XX XXXXXXXXXX XXXXXXX XXX XXXXXXXXXXXX XXXX XXXXXXXXX XXXX XXXX XXXXXXXXXXX XXX XXXXX XXXXXXXXXXXX XXXXXXX XX XXXXX XXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXX XX XXXXXXXXXXXX XXX XXX XXXXXXXXXX XXXXXX XXXXXXXXX XXXXXXX XXXXXXXXX XX XXX XXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXX XXXXXXX XXXXXXX XXX XXXXXXXXXXXX XXX XXX XXXXXXXXXXX XX XXX XXX XXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXX XXX XXXX XX XXXXXXX XX XXXXXXXXXXXXX XX XXXXX XXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXXXXXXXX XXXXXXXX XXXXX XXXX XXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXX XXXXXXX XXXXXXXXX XXX XXXXX XXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXX XXXXXX XXXX XXXXX XXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXX XXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XXX XXXXXX XXXXX XXX XXXX XXX XXXXXXXXXX XXXXXXXX XXXXXX XX XXX XXXX XX XXXXXXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXX XX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXXX XX XXXXX XXXXXXXX XX XX XXXXX XXX XXXX XXX XXXXXXXX XXXXXX XX XXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXX XXXXXXX XXXX XXXXXX XXXXXX XX XX XXXXXXXXXX XXXXXXX XXXX XXXXXXXX XXXXXX XXX XXXXXXXX XX XXXXXX XXX XXXXX XXXXXXXXXXXX XX XXXXXX XXXXXX XX XXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXX XXXXXXXXXX XXX XXXXXX XXXX XXXXXXX XXXXXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXXXXXXXXXXXXXXXXXXXX XXXXXX XXXX XX XXXXXXX XXXXXX XXXXXXXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXXX XXXXXXXXX XXXX XXXXX XXXX XXXXXXXX XXXXXX XXXXXX XXXX XX XXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XX XX XXXXXXX XXXXXXXX XXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXX XXX XXXX XXXXXXX XX XXXX XXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XX XXXXXXXXXXXXX XXXXX XXXXXXXXX XXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXX XX XXX XXXX XXXX XXXXXXXX XXX XXX XXXXXX XXXX XXX XXXXXXXXXXXXXX XXXXXXX XXXX XXXXXXXX XXXX XXXX XXXXX XXX XXXXXXXX XXXXX XXXXXXXXXX XX XXXXXXXX XX XXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXX XX XXXXXXXXXX XXXXXXXXXX XXXXXXX XX XXX X XXXX XXXXXX XX XXXXXXX XX XXX XXXXXXX XX XXX XXXXXXXX XXXXXXXX XX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXX XXX XXXXXXXX XXXXXX XX XXXXXXXXXXXXXXX XX XXXXXXXXXX XXXXXXXX XXXX XXXXXX XXXXXXX XXX XXXX XXXXXX XXXX XXX XXXXX XXXXXXXXX XXXXXXXX X XXX XXXX XXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXX XXXXXXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXXXXXXXX XXX X XXXXXXXX XXXXXX XXXX XXX XXXXX XXXXXXXX XX XXX XXXXX XX XXX XXXXXXXXX XXXXXXXXXXX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XX XXXXXXXX XX XX XXXXXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXX XX XX XX XXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXX XXX XXXXXXXX XX XXX XXXXXXXXXXXX XXXXX XXXXXXXXX XXXX XX XXXXXXXXXXXX XXXXX XX XXXXX XX XX XXX XX XXXXXX X XXXX XXXXXXX XXXXXXX XXX XXXXXXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXXXXXXX X XXXXX XXXXXXX XXXXX XXXX XXXXXX XX XXXXXX XXXXXXXXXXX XXXXX X XXX XXXX XX XXXXXXXX XXX XXX XX XXXX XX XXXXXXX XXXXXX XXXXX XXXXXXXX XXXX XX XXXXXXX XXX XXXXXX XXXXXX XXXXX XX XXXXXXXXXX XX XX XXXX XXXXXXXXXX XXXXXXX XXX XXXX XXXXXXX XXXXXXXXXXX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX XXX XX XXXXXXXX XX XX XXXXXX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXX XX XX XX XXX XXXXXXXXX XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXX XXX XXXX XX XXXXXXX XX XXXXXXXXXXXXX XXXX XXXXXX XXXXXXX XXXXXXXXX XXX XXXXX XXXX XXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXX XXXXXX XXXX XXXXX XXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXX XXXXXXXX XX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXX XX XXXXXXX XXXXXX XXXXXXXX XXXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXX XXXXXXX XXXXXXXXX XXXXXXX XXXXXXXXX XXXXXXXXXXXXXXXXX XX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XX XXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXX XXX XXXX XXXXX XXXXXXXX XXXXXXXXXX XXXX XXX XXXXX XXXXXXXXXXXXX XXXXXXXX XX XXXXXX XX XXX XXXXXXXXXXXXXX XXXXXXX XXXXXX XX XXX XXXXXXX XX XXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XX XXXX XXX XXXXXXXXX XXXXXXXXXXXXXX XXXXXX XX XXXXXXXX XXX XXXX XXXXX XXXXXXXX XXX XXXX XXXXXXXX XXX XXXXXXX XX XXXXXXX XXX XXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX XXXXXXX XX XXXXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX XXX XXXXXXXXXXXXXX XXXXXXX XXXXXX XX XXX XXXXXXX XX XX XXXXXX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX X XXXX XXXXX XXXXXXXX XX XXX XXXXXXXXX XXXXXXXXXXXXXX XXXXXXX XX XX XXX XXXXXXX XXXX XXXX XXXXXXX XXXXXXXXX
38.12091
96
0.79044
2,713
26,799
7.807962
0.022484
0.019827
0.008922
0.003635
0.318746
0.252136
0.245999
0.225369
0.196289
0.175424
0
0
0.20956
26,799
702
97
38.175214
1
0
0
0.987705
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
e3f5aaf3ddf858989f83bcba1743ef73978162e1
2,411
py
Python
upgrade-insecure-requests/support/generate.py
Thezone1975/wpt
9e201113cf36aefe07fe9c14caa47705d541e141
[ "BSD-3-Clause" ]
1
2019-09-10T22:45:24.000Z
2019-09-10T22:45:24.000Z
upgrade-insecure-requests/support/generate.py
Thezone1975/wpt
9e201113cf36aefe07fe9c14caa47705d541e141
[ "BSD-3-Clause" ]
3
2017-10-06T15:45:34.000Z
2018-09-11T12:49:57.000Z
upgrade-insecure-requests/support/generate.py
Thezone1975/wpt
9e201113cf36aefe07fe9c14caa47705d541e141
[ "BSD-3-Clause" ]
null
null
null
# Usage: execute # $ python support/generate.py # at wpt/upgrade-insecure-requests/. # # Note: Some tests (link-upgrade.sub.https.html and # websocket-upgrade.https.html) are not covered by this generator script. template = '''<!DOCTYPE html> <html> <head> <!-- Generated by wpt/upgrade-insecure-requests/support/generate.py -->%(additionalMeta)s <title>Upgrade Insecure Requests: %(name)s.</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="./support/testharness-helper.sub.js"></script> <script src="/common/security-features/resources/common.sub.js"></script> <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> </head> <body> <script> const tests = %(generatorName)s(ResourceType.%(resourceType)s, %(sameOriginOnly)s); tests.forEach(test => testMap['%(name)s'](test)); </script> </body> </html> ''' def getLong(file): testsThatNeedMoreTime = [ "worker-subresource-fetch-redirect-upgrade.https.html" ] if any(file in item for item in testsThatNeedMoreTime ): return '\n<meta name="timeout" content="long">' return "" # resourceType is |ResourceType| in testharness-helper.sub.js. for name, resourceType in [ ('image', 'IMAGE'), ('iframe', 'FRAME'), ('animation-worklet', 'WORKLET'), ('audio-worklet', 'WORKLET'), ('layout-worklet', 'WORKLET'), ('paint-worklet', 'WORKLET'), ('worker', 'WORKER'), ('module-worker', 'WORKER'), ('worker-subresource-xhr', 'FETCH'), ('worker-subresource-fetch', 'FETCH'), ('shared-worker', 'SHARED_WORKER')]: # TODO(https://crbug.com/989399): Add tests for subresource requests on shared # workers, and main/subresource requests on service workers. sameOriginOnly = 'false' if resourceType == 'WORKER' or resourceType == 'SHARED_WORKER': sameOriginOnly = 'true' types = [('', 'generateTests'), ('-redirect', 'generateRedirectTests')] if name == 'module-worker' or resourceType == 'WORKLET': types.append(('-import', 'generateModuleImportTests')) for typeName, generatorName in types: filename = '%s%s-upgrade.https.html' % (name, typeName) with open(filename, 'w') as html_file: html_file.write(template % { 'name': name, 'additionalMeta': getLong(filename), 'resourceType': resourceType, 'generatorName': generatorName, 'sameOriginOnly': sameOriginOnly})
37.092308
89
0.690585
270
2,411
6.151852
0.411111
0.036123
0.055388
0.030704
0
0
0
0
0
0
0
0.002865
0.131481
2,411
64
90
37.671875
0.790353
0.164662
0
0
1
0
0.593812
0.293413
0
0
0
0.015625
0
1
0.020833
false
0
0.020833
0
0.083333
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
1
0
0
0
0
0
0
0
0
0
0
2
e3f5cd033fa43c92ae4a7eb4ce55f52eab4be962
424
py
Python
model_constructor/mxresnet.py
ayasyrev/model_constructor
3759a02dd9f7aa1ca3e6a4a5aefe72380886207e
[ "Apache-2.0" ]
3
2020-08-02T09:18:27.000Z
2021-12-22T07:43:37.000Z
model_constructor/mxresnet.py
ayasyrev/model_constructor
3759a02dd9f7aa1ca3e6a4a5aefe72380886207e
[ "Apache-2.0" ]
16
2020-11-09T11:35:13.000Z
2021-12-23T13:04:54.000Z
model_constructor/mxresnet.py
ayasyrev/model_constructor
3759a02dd9f7aa1ca3e6a4a5aefe72380886207e
[ "Apache-2.0" ]
2
2020-04-08T20:56:48.000Z
2021-01-20T13:37:52.000Z
from functools import partial from .activations import Mish from .net import Net __all__ = ['mxresnet_parameters', 'mxresnet34', 'mxresnet50'] mxresnet_parameters = {'stem_sizes': [3, 32, 64, 64], 'act_fn': Mish()} mxresnet34 = partial(Net, name='MXResnet32', expansion=1, layers=[3, 4, 6, 3], **mxresnet_parameters) mxresnet50 = partial(Net, name='MXResnet50', expansion=4, layers=[3, 4, 6, 3], **mxresnet_parameters)
32.615385
101
0.71934
56
424
5.267857
0.464286
0.244068
0.094915
0.061017
0.189831
0.189831
0.189831
0
0
0
0
0.077748
0.120283
424
12
102
35.333333
0.713137
0
0
0
0
0
0.176887
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
5419a767eec4a75f25fccde0e39c22e20a25e3d6
486
py
Python
setup.py
datamachines/classification-banner
53ae7ea1104000e60474955f7603c46024a1d06f
[ "Apache-2.0" ]
null
null
null
setup.py
datamachines/classification-banner
53ae7ea1104000e60474955f7603c46024a1d06f
[ "Apache-2.0" ]
1
2021-06-11T15:30:31.000Z
2021-06-14T12:58:21.000Z
setup.py
datamachines/classification-banner
53ae7ea1104000e60474955f7603c46024a1d06f
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='classification-banner', version='1.0.0', description='Classification banner compatable with GTK3 and X11.', author='Mike May', author_email='mikemay@datamachines.io', url='https://www.github.com/datamachines/classification-banner', packages=find_packages(), scripts=["bin/classification-banner"], data_files=[("classification-banner", ["style.css"])] )
32.4
72
0.687243
55
486
6
0.709091
0.30303
0
0
0
0
0
0
0
0
0
0.014778
0.164609
486
14
73
34.714286
0.79803
0.041152
0
0
0
0
0.473118
0.193548
0
0
0
0
0
1
0
true
0
0.090909
0
0.090909
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
1
0
0
0
0
0
0
2
54286060601c97e4e84de6381203dae2af8365e8
1,184
py
Python
predict_form.py
HuginnM/UsedCarsUA
aa871c1bc6cdc1a84810db265c732b04cb4935f0
[ "Apache-2.0" ]
null
null
null
predict_form.py
HuginnM/UsedCarsUA
aa871c1bc6cdc1a84810db265c732b04cb4935f0
[ "Apache-2.0" ]
null
null
null
predict_form.py
HuginnM/UsedCarsUA
aa871c1bc6cdc1a84810db265c732b04cb4935f0
[ "Apache-2.0" ]
null
null
null
from flask_wtf import FlaskForm from wtforms import SubmitField, SelectField, IntegerField, FloatField, StringField from wtforms.validators import DataRequired import pandas as pd uniq_vals = pd.read_csv("data/unique_cat_vals.csv", index_col=0) class InputData(FlaskForm): car = SelectField(label="Car", choices=uniq_vals.car.dropna().sort_values(), validators=[DataRequired()]) model = SelectField("Model", choices=uniq_vals.model.dropna().sort_values(), validators=[DataRequired()]) body = SelectField(label="Body", choices=uniq_vals.body.dropna().sort_values(), validators=[DataRequired()]) drive = SelectField("Drive", choices=uniq_vals.drive.dropna().sort_values(), validators=[DataRequired()]) engType = SelectField("Engine type: ", choices=uniq_vals.engType.dropna().sort_values(), validators=[DataRequired()]) engV = FloatField("Engine Volume", validators=[DataRequired()]) year = IntegerField("Year", validators=[DataRequired()]) mileage = IntegerField(label="Mileage", validators=[DataRequired()]) registration = SelectField(label="Registration", choices=uniq_vals.registration.dropna()) submit = SubmitField("Predict the price")
56.380952
121
0.754223
132
1,184
6.636364
0.371212
0.200913
0.10274
0.148402
0.216895
0
0
0
0
0
0
0.000939
0.100507
1,184
20
122
59.2
0.821596
0
0
0
0
0
0.090372
0.02027
0
0
0
0
0
1
0
false
0
0.25
0
0.9375
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
5429177713786c59d64d5d6d11764c591147502b
2,764
py
Python
color.py
laplacetw/color-codes-bot
e7afb5b09e7c4a5dde6608917781cc6a0ea05287
[ "MIT" ]
1
2020-10-21T01:26:09.000Z
2020-10-21T01:26:09.000Z
color.py
laplacetw/color-codes-bot
e7afb5b09e7c4a5dde6608917781cc6a0ea05287
[ "MIT" ]
null
null
null
color.py
laplacetw/color-codes-bot
e7afb5b09e7c4a5dde6608917781cc6a0ea05287
[ "MIT" ]
null
null
null
#!usr/bin/env python3 color_chart = { '1C1':[13.24, 88.89, 228.98, 0.], '1N1':[14.2, 95.37, 233.82, 0.], '1N2':[12.95, 91.79, 219.5, 0.], '1W1':[14.67, 103.64, 229.41, 0.], '1W2':[14.69, 106.34, 227.28, 0.], '2C0':[15.73, 134.68, 222.32, 0.], '2C1':[14.57, 125.89, 220.69, 0.], '2C3':[13.7, 103.72, 199.46, 0.], '2N1':[15., 104.25, 225.8, 0.], '2W0':[15., 110.11, 224.22, 0.], '2W1':[14.42, 125.06, 224.55, 0.], '2W2':[17.13, 141.58, 209.99, 0.], '3C1':[15.7, 118.18, 212.01, 0.], '3C2':[15.7, 118.18, 212.01, 0.], '3N1':[16.1, 150.1, 189.09, 0.], '3N2':[15.18, 140.68, 202.63, 0.], '3W1':[15.66, 129.81, 209.44, 0.], '3W2':[17.05, 161.56, 184.85, 0.], '4C3':[14.23, 148.1, 198.74, 0.], '4N1':[15.92, 159.35, 190.71, 0.], '4N2':[17.29, 166.95, 195.76, 0.], '4W1':[14.67, 143.61, 208.85, 0.], '4W2':[17.76, 162.02, 189.44, 0.], '5C1':[13.09, 179.49, 160.58, 0.], '5N1':[15.43, 187.36, 180.34, 0.], '5N2':[16.66, 207.88, 147.84, 0.], '5W1':[15.66, 163.85, 182.07, 0.], '5W2':[14.95, 160.63, 189.17, 0.], '6C2':[12.85, 179.52, 131.66, 0.], '6N1':[14.94, 185.61, 162.16, 0.], '6N2':[15.7, 183.46, 138.37, 0.], '6W1':[14.76, 166.57, 166.78, 0.], '6W2':[13.79, 176.99, 142.22, 0.], '7C1':[12.2, 191.5, 121.34, 0.], '7N1':[12.7, 162.67, 109.41, 0.], '7W1':[13.25, 165.64, 126.03, 0.], '8N1':[12.5, 191.83, 95.43, 0.], 'CR1':[14.09, 173.14, 163.66, 0.]} color_chart_new = { '1C1':[14.63, 79.35, 239.58, 0.], '1N1':[16.89, 77.75, 243.46, 0.], '1N2':[13.27, 104.13, 231.18, 0.], '1W1':[17.78, 104.99, 236.54, 0.], '1W2':[16., 117.24, 234.86, 0.], '2C0':[17.16, 80.90, 240.48, 0.], '2C1':[14., 116.60, 237.21, 0.], '2C3':[13.36, 94.80, 231.17, 0.], '2N1':[16., 115.65, 238.19, 0.], '2W0':[15.79, 108.95, 237.93, 0.], '2W1':[15.01, 120.45, 240.01, 0.], '2W2':[17.97, 125.56, 243.83, 0.], '3C1':[10.99, 115.63, 226.18, 0.], '3C2':[10.84, 117.73, 219.17, 0.], '3N1':[11.9, 126.73, 228.04, 0.], '3N2':[11.43, 126.97, 224.13, 0.], '3W1':[13.14, 148.12, 229.10, 0.], '3W2':[14.01, 133.06, 234.48, 0.], '4C3':[11.68, 150.85, 219.34, 0.], '4N1':[12., 151.75, 190.41, 0.], '4N2':[12.24, 138.18, 206.75, 0.], '4W1':[12., 151.31, 224.04, 0.], '4W2':[12., 165.62, 201.74, 0.], '5C1':[10.4, 184.48, 176.72, 0.], '5N1':[11.68, 188.46, 210.23, 0.], '5N2':[10.98, 183.80, 195.04, 0.], '5W1':[12.73, 185.75, 221.30, 0.], '5W2':[10.83, 162.54, 211.10, 0.], '6C2':[9.29, 217.70, 111.99, 0.], '6N1':[11.24, 180.30, 156.76, 0.], '6N2':[11., 173.55, 145.55, 0.], '6W1':[11.09, 188.43, 171.41, 0.], '6W2':[11., 182.77, 151.02, 0.], '7C1':[8.07, 199.37, 115.59, 0.], '7N1':[9.93, 187.51, 122.57, 0.], '7W1':[9.86, 192.48, 135.62, 0.], '8N1':[8.64, 181.83, 109.53, 0.]}
86.375
109
0.48589
599
2,764
2.237062
0.380634
0.008955
0.008955
0.01194
0.020896
0.020896
0.020896
0
0
0
0
0.527085
0.158466
2,764
32
110
86.375
0.049011
0.007236
0
0
0
0
0.081997
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
5429df166b3efe8e9b12e537d9c5a2b68d7af8f7
235
py
Python
leetCode/algorithms/easy/occurrences_after_bigram.py
ferhatelmas/algo
a7149c7a605708bc01a5cd30bf5455644cefd04d
[ "WTFPL" ]
25
2015-01-21T16:39:18.000Z
2021-05-24T07:01:24.000Z
leetCode/algorithms/easy/occurrences_after_bigram.py
gauravsingh58/algo
397859a53429e7a585e5f6964ad24146c6261326
[ "WTFPL" ]
2
2020-09-30T19:39:36.000Z
2020-10-01T17:15:16.000Z
leetCode/algorithms/easy/occurrences_after_bigram.py
ferhatelmas/algo
a7149c7a605708bc01a5cd30bf5455644cefd04d
[ "WTFPL" ]
15
2015-01-21T16:39:27.000Z
2020-10-01T17:00:22.000Z
from typing import List class Solution: def findOcurrences(self, text: str, first: str, second: str) -> List[str]: ls = text.split() return [c for a, b, c in zip(ls, ls[1:], ls[2:]) if a == first and b == second]
29.375
87
0.595745
39
235
3.589744
0.666667
0
0
0
0
0
0
0
0
0
0
0.011364
0.251064
235
7
88
33.571429
0.784091
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.8
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
0
0
1
0
0
2
5820f326461279dab8c970a64d716534511d2f87
2,478
py
Python
python/zdl/error_logger/error_logger/url_rules/report.py
wjiec/packages
4ccaf8f717265a1f8a9af533f9a998b935efb32a
[ "MIT" ]
null
null
null
python/zdl/error_logger/error_logger/url_rules/report.py
wjiec/packages
4ccaf8f717265a1f8a9af533f9a998b935efb32a
[ "MIT" ]
1
2016-09-15T07:06:15.000Z
2016-09-15T07:06:15.000Z
python/zdl/error_logger/error_logger/url_rules/report.py
wjiec/packages
4ccaf8f717265a1f8a9af533f9a998b935efb32a
[ "MIT" ]
null
null
null
#!/usr/bin/env python # # Copyright (C) 2017 import json import time from error_logger.url_rules import _base_url_rule # from error_logger.net import sms_notification, email_notification from error_logger.utils import generic class Report(_base_url_rule.BaseUrlRule): __url__ = '/report' __methods__ = ['POST'] def __init__(self, config, *args, **kwargs): super(Report, self).__init__(config) def callback(self): adapter = self.get_adapter() source = self.get_url_parameter('source') # type: str json_data = self.get_body_dict() # type: dict for error in json_data.get('errors', []): _level = int(error.pop('level')) _time = int(error.pop('time', self.get_current_timestamp())) _module = generic.to_string(error.pop('module')) _type = generic.to_string(error.pop('type')) _msg = error.pop('msg') _other_data = json.dumps(error) _ip = generic.to_string(self.get_remote_ip()) # TODO. modify this self._notification(source, _level) if not _level or not _time or not _module or not _type or not _msg: return self.jsonify(1, 'report data format invalid, ' 'may be loss some fields') source.replace('\'', '\'\'') sql = 'INSERT INTO "{source}"'.format(source=source) with adapter.cursor() as cursor: sql = cursor.mogrify( ''' INSERT INTO "{source}" ("level", "time", "module", "type", "msg", "ip", "other_data") VALUES (%s, %s, %s, %s, %s, %s, %s) '''.format(source=source), (_level, time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(_time)), _module, _type, _msg, _ip, _other_data ) ) try: adapter.execute(sql) except Exception as e: print e return self.jsonify(2, 'insert error data error occurs, may be' ' error data invalid or server error') else: return self.jsonify(0, 'success') def _notification(self, source, error_level): pass
36.441176
84
0.506053
263
2,478
4.509506
0.403042
0.010118
0.012648
0.013491
0.091906
0.05312
0.047218
0
0
0
0
0.00456
0.380549
2,478
67
85
36.985075
0.768078
0.058111
0
0
0
0
0.104635
0
0
0
0
0.014925
0
0
null
null
0.020833
0.083333
null
null
0.020833
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
58252e686b16a8b93824251a6782b7d24afd2761
267
py
Python
project/wsgi.py
devluci/django-rest-base-boilerplate
0cf512e00aca66ebf9908351527d701cd421ccd4
[ "MIT" ]
null
null
null
project/wsgi.py
devluci/django-rest-base-boilerplate
0cf512e00aca66ebf9908351527d701cd421ccd4
[ "MIT" ]
null
null
null
project/wsgi.py
devluci/django-rest-base-boilerplate
0cf512e00aca66ebf9908351527d701cd421ccd4
[ "MIT" ]
null
null
null
import os from django.core.wsgi import get_wsgi_application from rest_base.utils import dotenv os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings') dotenv.load(os.path.join(os.path.dirname(__file__), '../.env')) application = get_wsgi_application()
26.7
67
0.797753
38
267
5.315789
0.605263
0.069307
0.178218
0
0
0
0
0
0
0
0
0
0.074906
267
9
68
29.666667
0.817814
0
0
0
0
0
0.168539
0.082397
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
583f4f6dd761e12a8aa4ad8d387f0bdd2b82f1de
9,545
py
Python
users/models.py
scoremaza/church_alive_backend
2ee7260aea51ec39972588dc4a346aa152356aa3
[ "MIT" ]
null
null
null
users/models.py
scoremaza/church_alive_backend
2ee7260aea51ec39972588dc4a346aa152356aa3
[ "MIT" ]
null
null
null
users/models.py
scoremaza/church_alive_backend
2ee7260aea51ec39972588dc4a346aa152356aa3
[ "MIT" ]
null
null
null
import os import uuid from django.db import models from django.contrib.auth.models import User from django.db.models.base import Model from django.db.models.enums import Choices, ChoicesMeta from django.db.models.fields.related import ForeignKey from django.utils.deconstruct import deconstructible @deconstructible class GenerateProfileImagePath(object): ''' This will allow naming convention for the files and up loaded as images in profiles. Image will have this assigned to its upload_to property ''' def __init__(self) -> None: pass def __call__(self, instance, filename): ext = filename.split('.')[-1] path = f'media/accounts/{instance.user.id}/images' name = f'profile_image.ext' return os.path.join(path, name) user_profile_image_path = GenerateProfileImagePath() class PositionType(models.Model): ''' Model definition for PositionType Here the user is assign a position within the organization allowing access and assignment capabilities enabling allocation throughout the system. ''' position_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) position = models.CharField(max_length=150) sort_order = models.IntegerField(default=-1) timestamp = models.DateTimeField(auto_now_add=True) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "Position" verbose_name_plural = "Positions" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.position}' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class Profile (models.Model): ''' Model definition for Profile Here the user will create its existence in the appplication with features to set privacy and adding friends will be controlled by this profile. Using User from the internal structure of Django as the manager to keep things together. ''' profile_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) user = models.OneToOneField(User, on_delete=models.CASCADE) image = models.FileField(upload_to=user_profile_image_path, blank=True, null=True) profile_name = models.CharField(max_length=200, null=True) date_of_birth = models.DateField(null=True) create_date = models.DateTimeField(auto_now_add=True) last_update = models.DateTimeField(auto_now=True) position_type = models.ForeignKey(PositionType, on_delete=models.CASCADE) timestamp = models.DateTimeField(auto_now_add=True) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "Profile" verbose_name_plural = "Profiles" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.user.username}\'s Profile' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class VisibilityLevel(models.Model): """ Model definition for VisibilityLevel. Here the user will give wether a friend could have the capabilities to view or send information. """ visibility_level_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=150) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = 'VisibilityLevel' verbose_name_plural = 'VisibilityLevels' def __str__(self): """Unicode representation of VisibilityLevel.""" return self.name def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class PrivacyFlagType(models.Model): ''' Model definition for PrivacyFlagType. Here we have the values of information such as questions asked to the user and the user answers will be stored in PrivacyFlag ''' privacy_flag_type_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) field_name = models.CharField(max_length=150,blank=True, null=True) timestamp = models.DateTimeField(auto_now_add=True) sort_order = models.IntegerField(default=-1) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "PrivacyFlagType" verbose_name_plural = "PrivacyFlagTypes" def __str__(self): """Unicode representation of VisibilityLevel.""" return self.field_name def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class PrivacyFlag(models.Model): ''' Model definition for PrivacyFlag Here we will allocate the values and controling what could be seen and by whom. ''' privacy_flag_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) profile = models.ForeignKey(Profile, on_delete=models.CASCADE) privacyflagtype = models.ForeignKey(PrivacyFlagType, on_delete=models.CASCADE) visibility_level = models.ForeignKey(VisibilityLevel, on_delete=models.CASCADE) timestamp = models.DateTimeField(auto_now_add=True) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "PrivacyFlag" verbose_name_plural = "PrivacyFlags" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.profile.user.username} has {self.privacyflagtype.field_name} privacy' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class ProfileAttributeType(models.Model): ''' Model definition for ProfileAttributeType Here we have the type of values enter by the user ''' profile_attribute_type_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) attribute_type = models.CharField(max_length=500) sort_order = models.IntegerField(default=-1) privacy_flag_type = models.ForeignKey(PrivacyFlagType, on_delete=models.CASCADE) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "ProfileAttributeType" verbose_name_plural = "ProfileAttributeTypes" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.profile.user.username} has {self.privacyflagtype.field_name} privacy' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class ProfileAttribute(models.Model): ''' Model definition for ProfileAttribute. Here we have the values themselves given by the user ''' profile_attribute_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) profile = models.ForeignKey(Profile, on_delete=models.CASCADE) profile_attribute_type = models.ForeignKey(ProfileAttributeType, on_delete=models.CASCADE) response = models.CharField(max_length=250) createDate = models.DateField(auto_now_add=True) timestamp = models.DateTimeField(auto_now_add=True) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "ProfileAttribute" verbose_name_plural = "ProfileAttributes" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.profile.user.username} response {self.response}' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class AlertType(models.Model): ''' Model definition for AlertType. Here we have the user with the capability to have alerts from different news form their friends ''' alert_type_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) name = models.CharField(max_length=150) class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "AlertType" verbose_name_plural = "AlertTypes" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.name}' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass class Alert(models.Model): ''' Model definition for Alert. Here we have the whole set completion for the Alerts. Allow the system to use the functionality of hidding and allowing users to manage the completion of there news feed, with notifications. ''' alert_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) user = models.ForeignKey(User, on_delete=models.CASCADE) create_date = models.DateTimeField(auto_now_add=True) timestamp = models.DateTimeField(auto_now_add=True) alert_type = models.ForeignKey(AlertType, on_delete=models.CASCADE) is_hidden = models.BooleanField(default=False) message = models.TextField() class Meta: """Meta definition for VisibilityLevel.""" verbose_name = "Alert" verbose_name_plural = "Alerts" def __str__(self): """Unicode representation of VisibilityLevel.""" return f'{self.alert_type.name} has this {self.message}' def get_absolute_url(self): """Return absolute url for VisibilityLevel.""" pass
32.355932
103
0.683394
1,085
9,545
5.843318
0.198157
0.053943
0.044164
0.033123
0.559937
0.488328
0.466877
0.450473
0.407256
0.38959
0
0.004623
0.22944
9,545
295
104
32.355932
0.857376
0.27627
0
0.406015
0
0
0.08791
0.038969
0
0
0
0
0
1
0.150376
false
0.075188
0.06015
0
0.75188
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
5856c891983edcd6b2efc2d720455bfccf0cdf79
1,491
py
Python
llist_gameboard/urls.py
Plongesam/data-structures-game
a47c849ea97763eff1005273a58aa3d8ab663ff2
[ "Apache-2.0" ]
2
2021-03-02T20:06:34.000Z
2021-03-31T02:51:35.000Z
llist_gameboard/urls.py
Plongesam/data-structures-game
a47c849ea97763eff1005273a58aa3d8ab663ff2
[ "Apache-2.0" ]
68
2021-03-02T20:20:21.000Z
2021-05-13T02:21:57.000Z
llist_gameboard/urls.py
Plongesam/data-structures-game
a47c849ea97763eff1005273a58aa3d8ab663ff2
[ "Apache-2.0" ]
null
null
null
""" URL's for the LList Game Board app. """ from django.urls import path from llist_gameboard.api import llist_api from . import views urlpatterns = [ # Views path('', views.llist_game_board, name='llist-game-board'), #Game Play API Calls For Linked List path('llist_api', llist_api.api_overview, name='llist-game-board-api_overview'), path('llist_api/start_game/<str:difficulty>/<str:player_ids>/<str:data_structures>', llist_api.start_game, name='llist-game-board-start_game'), path('llist_api/board/<str:game_id>', llist_api.board, name='llist-game-board-game_status'), path('llist_api/dig_tunnel/<str:game_id>/<str:origin>/<str:destination>', llist_api.dig_tunnel, name='llist-game-board-dig_tunnel'), path('llist_api/dig_chamber/<str:game_id>/<str:origin>/<str:move_ant>/<str:ant>', llist_api.dig_chamber, name='llist-game-board-dig_chamber'), path('llist_api/fill_chamber/<str:game_id>/<str:to_fill>', llist_api.fill_chamber, name='llist-game-board-fill_chamber'), path('llist_api/spawn_ant/<str:game_id>', llist_api.spawn_ant, name='llist-game-board-spawn_ant'), path('llist_api/forage/<str:game_id>/<str:difficulty>/<str:dest>', llist_api.forage, name='llist-game-board-forage'), path('llist_api/move_food/<str:game_id>/<str:start>/<str:dest>', llist_api.move_food, name='llist-game-board-move_food'), path('llist_api/move_ant/<str:game_id>/<str:start>/<str:dest>', llist_api.move_ant, name='llist-game-board-move_ant'), ]
59.64
147
0.733736
242
1,491
4.272727
0.18595
0.162476
0.176015
0.191489
0.357834
0.162476
0.069633
0.069633
0.069633
0.069633
0
0
0.085178
1,491
25
148
59.64
0.758065
0.052314
0
0
0
0
0.562455
0.544611
0
0
0
0
0
1
0
false
0
0.1875
0
0.1875
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
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
585b570f1181a34255df0bd7a81ffc1c67034916
5,311
py
Python
csl-tracking-dependents.py
Marcool04/utilities
d9bf0aae7decdad111fc0c8cefacf10c230ce9ee
[ "MIT" ]
10
2015-04-14T16:49:43.000Z
2020-06-01T14:31:04.000Z
csl-tracking-dependents.py
Marcool04/utilities
d9bf0aae7decdad111fc0c8cefacf10c230ce9ee
[ "MIT" ]
23
2015-01-20T04:13:35.000Z
2021-09-07T18:36:00.000Z
csl-tracking-dependents.py
Marcool04/utilities
d9bf0aae7decdad111fc0c8cefacf10c230ce9ee
[ "MIT" ]
6
2015-01-10T13:00:37.000Z
2021-09-19T09:25:22.000Z
# -*- coding: utf-8 -*- # Python script to manage automatically generated dependents # Author: Rintze M. Zelle # Version: 2014-04-17 # * Requires lxml library (http://lxml.de/) import os, glob, re, inspect, shutil from lxml import etree # http://stackoverflow.com/questions/50499 folderPath = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentFolderPath = os.path.dirname (folderPath) path = os.path.join(parentFolderPath, 'styles') pathGeneratedStyles = os.path.join(parentFolderPath, 'utilities', 'generate_dependent_styles', 'generated_styles', 'aacr') pathRemovedStyles = os.path.join(parentFolderPath, 'removed-styles') dependentStyles = [] commentMatchingStyles = [] parentMatchingStyles = [] timestampMatchingStyles = [] generatedStyles = [] for stylepath in glob.glob( os.path.join(path, 'dependent', '*.csl') ): dependentStyles.append(os.path.join(stylepath)) for stylepath in glob.glob( os.path.join(pathGeneratedStyles, '*.csl') ): generatedStyles.append(os.path.basename(stylepath)) #Filter dependent styles by their parent (set A), print number #Of set A, print style ID if XML comment doesn't match that of dependent style template #Of set A, print style ID if timestamp doesn't match that of dependent style template #Have a toggle to move remaining styles out of root folder #(it would be better to filter by the XML comment on the first pass, since styles from #a set may have different parents, but XML comments aren't currently unique to a set) for style in dependentStyles: parser = etree.XMLParser(remove_blank_text=True) parsedStyle = etree.parse(style, parser) styleElement = parsedStyle.getroot() parentLink = styleElement.find(".//{http://purl.org/net/xbiblio/csl}link[@rel='independent-parent']") if(parentLink.attrib.get("href") == "http://www.zotero.org/styles/american-association-for-cancer-research"): parentMatchingStyles.append(os.path.basename(style)) comments = styleElement.xpath("//comment()", namespaces={"cs": "http://purl.org/net/xbiblio/csl"}) for comment in comments: if(comment.text == " Generated with https://github.com/citation-style-language/utilities/tree/master/generate_dependent_styles/data/aacr "): commentMatchingStyles.append(os.path.basename(style)) timestamp = styleElement.find(".//{http://purl.org/net/xbiblio/csl}updated") if(timestamp.text == "2014-04-23T12:00:00+00:00"): timestampMatchingStyles.append(os.path.basename(style)) print("Number of dependent styles with selected parent: " + str(len(parentMatchingStyles))) print("Number of generated styles: " + str(len(generatedStyles))) for style in parentMatchingStyles: badStyle = False if not (style in commentMatchingStyles): print "bad comment!: " + style badStyle = True if not (style in timestampMatchingStyles): print "bad timestamp!: " + style badStyle = True if not (style in generatedStyles): print "not generated!: " + style badStyle = True if badStyle: parentMatchingStyles.remove(style) print("Number of consistent styles: " + str(len(parentMatchingStyles))) moveStyles = False if moveStyles == True: #move styles out of "styles/dependent" folder if not os.path.exists(pathRemovedStyles): os.makedirs(pathRemovedStyles) for style in parentMatchingStyles: shutil.move(os.path.join(path, 'dependent', style), os.path.join(pathRemovedStyles, style)) # counter = [] # for infoNodeIndex, infoNode in enumerate(csInfo): # # check if node is an element # if isinstance(infoNode.tag, basestring): # # get rid of namespace # infoElement = infoNode.tag.replace("{http://purl.org/net/xbiblio/csl}","") # if(infoElement == "link"): # infoElement += "[@" + infoNode.get("rel") + "]" # if((infoElement == "category") & (infoNode.get("citation-format") is not None)): # infoElement += "[@citation-format]" # if((infoElement == "category") & (infoNode.get("field") is not None)): # infoElement += "[@field]" # # check if node is a comment # elif (etree.tostring(infoNode, encoding='UTF-8', xml_declaration=False) == ("<!--" + infoNode.text.encode("utf-8") + "-->")): # # keep comments that precede any element at the top # if(sum(counter) == 0): # counter.append(desiredOrder.index("preceding-comment")) # # keep a comment at the end at the end # elif(len(counter) == (len(csInfo) - 1)): # counter.append(desiredOrder.index("end-comment")) # # keep other comments with preceding element # else: # counter.append(counter[-1]) # # # Possible improvements: # # * exceptions for recognizable comments (issn, category) # else: # print(infoNode) # # # Reorder attributes on cs:link # try: # links = styleElement.findall(".//{http://purl.org/net/xbiblio/csl}link") # for link in links: # rel = link.get("rel") # del link.attrib["rel"] # link.set("rel",rel) # except: # pass
44.630252
148
0.656562
614
5,311
5.666124
0.343648
0.027594
0.022995
0.020121
0.165277
0.114976
0.101179
0.063811
0
0
0
0.00882
0.21013
5,311
118
149
45.008475
0.820501
0.45434
0
0.096154
1
0.038462
0.219598
0.017624
0
0
0
0
0
0
null
null
0
0.038462
null
null
0.115385
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
585f06a860286b312d33973ef25ef2866dfc0808
642
py
Python
selenium_browser/__resources/constants.py
kkristof200/selenium_browser
b8144fe935073367911e90b50f078bfa985d6c0f
[ "MIT" ]
1
2021-06-25T06:55:43.000Z
2021-06-25T06:55:43.000Z
selenium_browser/__resources/constants.py
kkristof200/selenium_browser
b8144fe935073367911e90b50f078bfa985d6c0f
[ "MIT" ]
null
null
null
selenium_browser/__resources/constants.py
kkristof200/selenium_browser
b8144fe935073367911e90b50f078bfa985d6c0f
[ "MIT" ]
null
null
null
# ------------------------------------------------------- class: Constants ------------------------------------------------------- # class Constants: # --------------------------------------------------- Public properties -------------------------------------------------- # USER_AGENT_FILE_NAME = 'ua.txt' GENERAL_COOKIES_FOLDER_NAME = 'cookies' GENERAL_PROFILE_FOLDER_NAME = 'selenium-python-profile' DEFAULT_PROFILE_ID = 'test' DEFAULT_FIND_FUNC_TIMEOUT = 2.5 # -------------------------------------------------------------------------------------------------------------------------------- #
45.857143
132
0.311526
34
642
5.470588
0.705882
0.150538
0
0
0
0
0
0
0
0
0
0.003546
0.121495
642
14
133
45.857143
0.326241
0.5919
0
0
0
0
0.156863
0.090196
0
0
0
0
0
1
0
false
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
5861890f40c195d9d9cd8464fdd3da892466f679
8,080
py
Python
python/mxnet/context.py
feevos/incubator-mxnet
275378a49a6035fd5bdead4a74ac36b6070295a7
[ "Apache-2.0" ]
null
null
null
python/mxnet/context.py
feevos/incubator-mxnet
275378a49a6035fd5bdead4a74ac36b6070295a7
[ "Apache-2.0" ]
null
null
null
python/mxnet/context.py
feevos/incubator-mxnet
275378a49a6035fd5bdead4a74ac36b6070295a7
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # coding: utf-8 """Context management API of mxnet.""" from __future__ import absolute_import import threading import warnings from .base import classproperty, with_metaclass, _MXClassPropertyMetaClass class Context(with_metaclass(_MXClassPropertyMetaClass, object)): """Constructs a context. MXNet can run operations on CPU and different GPUs. A context describes the device type and ID on which computation should be carried on. One can use mx.cpu and mx.gpu for short. See also ---------- `How to run MXNet on multiple CPU/GPUs <http://mxnet.io/faq/multi_devices.html>` for more details. Parameters ---------- device_type : {'cpu', 'gpu'} or Context. String representing the device type. device_id : int (default=0) The device id of the device, needed for GPU. Note ---- Context can also be used as a way to change the default context. Examples -------- >>> # array on cpu >>> cpu_array = mx.nd.ones((2, 3)) >>> # switch default context to GPU(2) >>> with mx.Context(mx.gpu(2)): ... gpu_array = mx.nd.ones((2, 3)) >>> gpu_array.context gpu(2) One can also explicitly specify the context when creating an array. >>> gpu_array = mx.nd.ones((2, 3), mx.gpu(1)) >>> gpu_array.context gpu(1) """ # static class variable _default_ctx = threading.local() devtype2str = {1: 'cpu', 2: 'gpu', 3: 'cpu_pinned', 5: 'cpu_shared'} devstr2type = {'cpu': 1, 'gpu': 2, 'cpu_pinned': 3, 'cpu_shared': 5} def __init__(self, device_type, device_id=0): if isinstance(device_type, Context): self.device_typeid = device_type.device_typeid self.device_id = device_type.device_id else: self.device_typeid = Context.devstr2type[device_type] self.device_id = device_id self._old_ctx = None @property def device_type(self): """Returns the device type of current context. Examples ------- >>> mx.context.current_context().device_type 'cpu' >>> mx.current_context().device_type 'cpu' Returns ------- device_type : str """ return Context.devtype2str[self.device_typeid] def __hash__(self): """Compute hash value of context for dictionary lookup""" return hash((self.device_typeid, self.device_id)) def __eq__(self, other): """Compares two contexts. Two contexts are equal if they have the same device type and device id. """ return isinstance(other, Context) and \ self.device_typeid == other.device_typeid and \ self.device_id == other.device_id def __str__(self): return '%s(%d)' % (self.device_type, self.device_id) def __repr__(self): return self.__str__() def __enter__(self): if not hasattr(Context._default_ctx, "value"): Context._default_ctx.value = Context('cpu', 0) self._old_ctx = Context._default_ctx.value Context._default_ctx.value = self return self def __exit__(self, ptype, value, trace): Context._default_ctx.value = self._old_ctx #pylint: disable=no-self-argument @classproperty def default_ctx(cls): warnings.warn("Context.default_ctx has been deprecated. " "Please use Context.current_context() instead. " "Please use test_utils.set_default_context to set a default context", DeprecationWarning) if not hasattr(Context._default_ctx, "value"): cls._default_ctx.value = Context('cpu', 0) return cls._default_ctx.value @default_ctx.setter def default_ctx(cls, val): warnings.warn("Context.default_ctx has been deprecated. " "Please use Context.current_context() instead. " "Please use test_utils.set_default_context to set a default context", DeprecationWarning) cls._default_ctx.value = val #pylint: enable=no-self-argument # initialize the default context in Context Context._default_ctx.value = Context('cpu', 0) def cpu(device_id=0): """Returns a CPU context. This function is a short cut for ``Context('cpu', device_id)``. For most operations, when no context is specified, the default context is `cpu()`. Examples ---------- >>> with mx.cpu(): ... cpu_array = mx.nd.ones((2, 3)) >>> cpu_array.context cpu(0) >>> cpu_array = mx.nd.ones((2, 3), ctx=mx.cpu()) >>> cpu_array.context cpu(0) Parameters ---------- device_id : int, optional The device id of the device. `device_id` is not needed for CPU. This is included to make interface compatible with GPU. Returns ------- context : Context The corresponding CPU context. """ return Context('cpu', device_id) def cpu_pinned(device_id=0): """Returns a CPU pinned memory context. Copying from CPU pinned memory to GPU is faster than from normal CPU memory. This function is a short cut for ``Context('cpu_pinned', device_id)``. Examples ---------- >>> with mx.cpu_pinned(): ... cpu_array = mx.nd.ones((2, 3)) >>> cpu_array.context cpu_pinned(0) >>> cpu_array = mx.nd.ones((2, 3), ctx=mx.cpu_pinned()) >>> cpu_array.context cpu_pinned(0) Parameters ---------- device_id : int, optional The device id of the device. `device_id` is not needed for CPU. This is included to make interface compatible with GPU. Returns ------- context : Context The corresponding CPU pinned memory context. """ return Context('cpu_pinned', device_id) def gpu(device_id=0): """Returns a GPU context. This function is a short cut for Context('gpu', device_id). The K GPUs on a node are typically numbered as 0,...,K-1. Examples ---------- >>> cpu_array = mx.nd.ones((2, 3)) >>> cpu_array.context cpu(0) >>> with mx.gpu(1): ... gpu_array = mx.nd.ones((2, 3)) >>> gpu_array.context gpu(1) >>> gpu_array = mx.nd.ones((2, 3), ctx=mx.gpu(1)) >>> gpu_array.context gpu(1) Parameters ---------- device_id : int, optional The device id of the device, needed for GPU. Returns ------- context : Context The corresponding GPU context. """ return Context('gpu', device_id) def current_context(): """Returns the current context. By default, `mx.cpu()` is used for all the computations and it can be overridden by using `with mx.Context(x)` statement where x can be cpu(device_id) or gpu(device_id). Examples ------- >>> mx.current_context() cpu(0) >>> with mx.Context('gpu', 1): # Context changed in `with` block. ... mx.current_context() # Computation done here will be on gpu(1). ... gpu(1) >>> mx.current_context() # Back to default context. cpu(0) Returns ------- default_ctx : Context """ if not hasattr(Context._default_ctx, "value"): Context._default_ctx.value = Context('cpu', 0) return Context._default_ctx.value
30.490566
91
0.627104
1,074
8,080
4.55959
0.221601
0.050643
0.03982
0.026547
0.385134
0.326118
0.304268
0.279151
0.254441
0.216051
0
0.011122
0.254455
8,080
264
92
30.606061
0.801793
0.56052
0
0.21875
0
0
0.138718
0.037491
0
0
0
0
0
1
0.21875
false
0
0.0625
0.03125
0.515625
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
58618a4465a15f955aaa88fd0bac8fbce9ce5c48
3,422
py
Python
theory/model/tconfig.py
ralfonso/theory
41684969313cfc545d74b306e409fd5bf21387b3
[ "MIT" ]
4
2015-07-03T19:53:59.000Z
2016-04-25T03:03:56.000Z
theory/model/tconfig.py
ralfonso/theory
41684969313cfc545d74b306e409fd5bf21387b3
[ "MIT" ]
null
null
null
theory/model/tconfig.py
ralfonso/theory
41684969313cfc545d74b306e409fd5bf21387b3
[ "MIT" ]
2
2020-03-29T22:02:29.000Z
2021-07-13T07:17:19.000Z
# theory MPD client # Copyright (C) 2008 Ryan Roemmich <ralfonso@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import ConfigParser import pickle from pylons import config from pylons import app_globals as g class ConfigFileError(Exception): pass class TConfig: """ handles the global configuration. loaded into app globals at application startup also handles committing the configuration to disk to maintain across app restarts """ def __init__(self): """ try to read the configuration from disk """ self.server = None self.port = None self.password = None self.webpassword = '' self.timeout = False self.awskey = None self.aws_secret = None self.streams = [] self.default_search = 'Any' conf = ConfigParser.ConfigParser() conf.read(config['localconf']) try: self.server = conf.get('mpd','server') self.port = conf.get('mpd','port') self.password = conf.get('mpd','password') self.awskey = conf.get('services','awskey') self.aws_secret = conf.get('services','aws_secret') self.webpassword = conf.get('main','webpassword') self.timeout = conf.getboolean('main','timeout') self.default_search = conf.get('main','default_search') conf_stream = conf.get('ext','streams') except (ConfigParser.NoSectionError,ConfigParser.NoOptionError): pass try: self.streams = pickle.loads(eval(conf_stream)) except: # we don't really care what happened, the user must have messed with the magic pickled string :) pass def commit_config(self): """ commit the configuration to disk """ conf = ConfigParser.ConfigParser() conf.add_section("mpd") conf.set("mpd", "server",self.server) conf.set("mpd", "port",self.port) conf.set("mpd", "password",self.password) conf.add_section("services") conf.set('services','awskey',self.awskey) conf.set('services','aws_secret',self.aws_secret) conf.add_section('main') conf.set('main','webpassword',self.webpassword) conf.set('main','timeout',self.timeout) conf.set('main','default_search',self.default_search) conf.add_section('ext') conf.set('ext','streams',repr(pickle.dumps(self.streams))) try: conffile = open(config['localconf'],"w") conf.write(conffile) except IOError,e: raise ConfigFileErro def get_stream_name(self,url): """ search the list of streams for a particular name """ for s in self.streams: if s[1] == url: return s[0]
34.918367
108
0.630333
425
3,422
5.018824
0.397647
0.029536
0.026254
0.026723
0.038444
0.026254
0
0
0
0
0
0.002768
0.260959
3,422
97
109
35.278351
0.840648
0.22706
0
0.135593
0
0
0.115552
0
0
0
0
0
0
0
null
null
0.152542
0.067797
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
586f8df02b72779b1db755aeb20b5f85e4d788d2
350
py
Python
app/models/methods/set_device_info_method.py
luisalvesmartins/TAPO-P100
02bc929a87bbe4681739b14a716f6cef2b159fd1
[ "MIT" ]
null
null
null
app/models/methods/set_device_info_method.py
luisalvesmartins/TAPO-P100
02bc929a87bbe4681739b14a716f6cef2b159fd1
[ "MIT" ]
1
2021-06-23T09:21:40.000Z
2021-07-02T17:21:12.000Z
app/models/methods/set_device_info_method.py
luisalvesmartins/TAPO-P100
02bc929a87bbe4681739b14a716f6cef2b159fd1
[ "MIT" ]
null
null
null
from models.methods import method from typing import Any class SetDeviceInfoMethod(method.Method): def __init__(self, params: Any): super().__init__("set_device_info", params) def set_request_time_milis(self, t: float): self.requestTimeMils = t def set_terminal_uuid(self, uuid: str): self.terminalUUID = uuid
25
51
0.708571
45
350
5.177778
0.6
0.051502
0
0
0
0
0
0
0
0
0
0
0.2
350
13
52
26.923077
0.832143
0
0
0
0
0
0.042857
0
0
0
0
0
0
1
0.333333
false
0
0.222222
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
58731f101956f7789a536c381812a3703830d466
262
py
Python
m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py
CCI-MOC/ABMI
955c12ae9d2dc7afe7323f6c25f2af120f5b281a
[ "Apache-2.0" ]
108
2015-07-21T10:40:36.000Z
2021-07-01T06:54:51.000Z
m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py
CCI-MOC/ABMI
955c12ae9d2dc7afe7323f6c25f2af120f5b281a
[ "Apache-2.0" ]
320
2015-07-21T01:33:20.000Z
2020-07-21T15:57:02.000Z
m2-modified/ims/common/agentless-system-crawler/crawler/plugins/emitters/http_emitter.py
CCI-MOC/ABMI
955c12ae9d2dc7afe7323f6c25f2af120f5b281a
[ "Apache-2.0" ]
61
2015-07-20T18:26:37.000Z
2021-03-17T01:18:54.000Z
import logging from iemit_plugin import IEmitter from plugins.emitters.base_http_emitter import BaseHttpEmitter logger = logging.getLogger('crawlutils') class HttpEmitter(BaseHttpEmitter, IEmitter): def get_emitter_protocol(self): return 'http'
20.153846
62
0.793893
30
262
6.766667
0.733333
0
0
0
0
0
0
0
0
0
0
0
0.141221
262
12
63
21.833333
0.902222
0
0
0
0
0
0.053435
0
0
0
0
0
0
1
0.142857
false
0
0.428571
0.142857
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
0
0
0
2
5883b253d513cb80bd2362de5b0a8311d18ca8c7
3,305
py
Python
blog/models.py
Libor03/django-final
e29dc3237252c7b0fcfea13d948ed54ffe6d0339
[ "CC0-1.0" ]
null
null
null
blog/models.py
Libor03/django-final
e29dc3237252c7b0fcfea13d948ed54ffe6d0339
[ "CC0-1.0" ]
null
null
null
blog/models.py
Libor03/django-final
e29dc3237252c7b0fcfea13d948ed54ffe6d0339
[ "CC0-1.0" ]
null
null
null
from django.core.files.storage import FileSystemStorage from django.db import models # Create your models here. from datetime import date from django.urls import reverse #Used to generate URLs by reversing the URL patterns from django.contrib.auth.models import User #Blog author or commenter def attachment_path(instance, filename): return "media/animal/" + str(instance.animal.id) + "/attachments/" + filename """ Metoda vrací cestu k uploadovanému plakátu. """ def poster_path(instance, filename): return "animals/" + str(instance.name) +"/foto/"+ filename class Type(models.Model): name = models.CharField(max_length=50, unique=True, verbose_name="Type of animal", help_text='Enter a type of animal (e.g. Savec)') class Meta: ordering = ["name"] def __str__(self): return self.name class Animal(models.Model): name = models.CharField(max_length=50, unique=True, verbose_name="Name of animal") poster = models.ImageField(upload_to=poster_path, verbose_name="Poster") latin = models.CharField(max_length=50, unique=True, verbose_name="Latin name for animal") description = models.CharField(max_length=5000, verbose_name="Description of animal") # Metadata class Meta: ordering = ["name"] # Methods def __str__(self): """Součástí textové reprezentace filmu bude jeho název, rok uvedení a hodnocení""" return f"{self.name}, {str(self.poster)}, {str(self.latin)}" def get_absolute_url(self): """Metoda vrací URL stránky, na které se vypisují podrobné informace o filmu""" return reverse('animal-detail', args=[str(self.id)]) class Attachment(models.Model): # Fields # Povinný titulek přílohy - text do délky 200 znaků title = models.CharField(max_length=200, verbose_name="Title") # Časový údaj o poslední aktualizaci přílohy - automaticky se ukládá aktuální čas last_update = models.DateTimeField(auto_now=True) # Pole pro upload souboru # Parametr upload_to zajistí uložení souboru do složky specifikované v návratové hodnotě metody attachment_path file = models.FileField(upload_to=attachment_path, null=True, verbose_name="File") # Konstanta, v níž jsou ve formě n-tic (tuples) předdefinovány různé typy příloh TYPE_OF_ATTACHMENT = ( ('audio', 'Audio'), ('image', 'Image'), ('text', 'Text'), ('video', 'Video'), ('other', 'Other'), ) # Pole s definovanými předvolbami pro uložení typu přílohy #type = models.CharField(max_length=5, choices=TYPE_OF_ATTACHMENT, blank=True, default='image', # help_text='Select allowed attachment type', verbose_name="Attachment type") # Cizí klíč, který zajišťuje propojení přílohy s daným filmem (vztah N:1) # Parametr on_delete slouží k zajištění tzv. referenční integrity - v případě odstranění filmu # budou odstraněny i všechny jeho přílohy (models.CASCADE) film = models.ForeignKey(Animal, on_delete=models.CASCADE) # Metadata class Meta: # Primární seřazeno podle poslední aktualizace souborů, sekundárně podle typu přílohy ordering = ["-last_update"] # Methods def __str__(self): """ Textová reprezentace objektu """ return f"{self.title})"
36.722222
135
0.698033
418
3,305
5.406699
0.478469
0.038938
0.047788
0.063717
0.075664
0.075664
0.075664
0.075664
0.075664
0.054867
0
0.006795
0.198487
3,305
90
136
36.722222
0.846357
0.36944
0
0.190476
1
0
0.152152
0
0
0
0
0
0
1
0.142857
false
0
0.119048
0.071429
0.785714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
588c8d695d5770a68e19da667343fb316670eec3
195
py
Python
tests/commands/types/test_flag_param.py
cicdenv/cicdenv
5b72fd9ef000bf07c2052471b59edaa91af18778
[ "MIT" ]
8
2020-08-10T20:57:24.000Z
2021-08-08T10:46:20.000Z
tests/commands/types/test_flag_param.py
cicdenv/cicdenv
5b72fd9ef000bf07c2052471b59edaa91af18778
[ "MIT" ]
null
null
null
tests/commands/types/test_flag_param.py
cicdenv/cicdenv
5b72fd9ef000bf07c2052471b59edaa91af18778
[ "MIT" ]
1
2020-08-10T20:42:09.000Z
2020-08-10T20:42:09.000Z
from cicdctl.commands.types.flag import FlagParamType def test_flag(): flag = '-no-color' parsed = FlagParamType().convert(value=flag, param=None, context={}) assert flag == parsed
24.375
72
0.702564
24
195
5.666667
0.75
0
0
0
0
0
0
0
0
0
0
0
0.164103
195
7
73
27.857143
0.834356
0
0
0
0
0
0.046154
0
0
0
0
0
0.2
1
0.2
false
0
0.2
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
589f45393545cfab296cec7cb3f2cc4a519dd5d0
570
py
Python
vaccine_tracker/email.py
Shishir-Bondre/content-alerts
37be34c781338ef3968e1257f5c0d1148bb022e5
[ "Apache-2.0" ]
null
null
null
vaccine_tracker/email.py
Shishir-Bondre/content-alerts
37be34c781338ef3968e1257f5c0d1148bb022e5
[ "Apache-2.0" ]
null
null
null
vaccine_tracker/email.py
Shishir-Bondre/content-alerts
37be34c781338ef3968e1257f5c0d1148bb022e5
[ "Apache-2.0" ]
null
null
null
def email_subject(center_name): return f"[Urgent Reminder] Vaccine slot is now available at {center_name}" def email_body(email_data): return f"Hi, \n" \ f"Vaccine slot is available for below centers \n " \ f"Center name and available data \n {email_data} \n" \ f"Please register at cowin website https://cowin.gov.in \n" \ f"Have a lovely day ahead! :) \n" \ f"Thanks, \n" \ f"Shishir Bondre \n" \ f"To unsubscribe click here http://3.6.160.147:8000/vaccine_tracker/unsubscribe/"
38
92
0.615789
84
570
4.095238
0.583333
0.040698
0.075581
0
0
0
0
0
0
0
0
0.028846
0.270175
570
14
93
40.714286
0.798077
0
0
0
0
0
0.629174
0
0
0
0
0
0
1
0.181818
false
0
0
0.181818
0.363636
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
0
0
0
1
0
0
0
2
58a1f761a8b86a42b461b76e20b0ebb5fa21fa7a
4,098
py
Python
src/sage/modules/vector_symbolic_dense.py
sloebrich/sage
b8f53f72e817e78722ad1b40d70aa9071426700b
[ "BSL-1.0" ]
1
2020-05-19T22:34:03.000Z
2020-05-19T22:34:03.000Z
src/sage/modules/vector_symbolic_dense.py
sbt4104/sage
2cbd93e0b78dec701f4b7ad9271d3b1e967bcd6c
[ "BSL-1.0" ]
null
null
null
src/sage/modules/vector_symbolic_dense.py
sbt4104/sage
2cbd93e0b78dec701f4b7ad9271d3b1e967bcd6c
[ "BSL-1.0" ]
3
2020-03-29T17:13:36.000Z
2021-05-03T18:11:28.000Z
""" Vectors over the symbolic ring. Implements vectors over the symbolic ring. AUTHORS: - Robert Bradshaw (2011-05-25): Added more element-wise simplification methods - Joris Vankerschaver (2011-05-15): Initial version EXAMPLES:: sage: x, y = var('x, y') sage: u = vector([sin(x)^2 + cos(x)^2, log(2*y) + log(3*y)]); u (cos(x)^2 + sin(x)^2, log(3*y) + log(2*y)) sage: type(u) <class 'sage.modules.free_module.FreeModule_ambient_field_with_category.element_class'> sage: u.simplify_full() (1, log(3*y) + log(2*y)) TESTS: Check that the outcome of arithmetic with symbolic vectors is again a symbolic vector (:trac:`11549`):: sage: v = vector(SR, [1, 2]) sage: w = vector(SR, [sin(x), 0]) sage: type(v) <class 'sage.modules.free_module.FreeModule_ambient_field_with_category.element_class'> sage: type(w) <class 'sage.modules.free_module.FreeModule_ambient_field_with_category.element_class'> sage: type(v + w) <class 'sage.modules.free_module.FreeModule_ambient_field_with_category.element_class'> sage: type(-v) <class 'sage.modules.free_module.FreeModule_ambient_field_with_category.element_class'> sage: type(5*w) <class 'sage.modules.free_module.FreeModule_ambient_field_with_category.element_class'> Test pickling/unpickling:: sage: u = vector(SR, [sin(x^2)]) sage: loads(dumps(u)) == u True """ from __future__ import absolute_import #***************************************************************************** # Copyright (C) 2011 Joris Vankerschaver (jv@caltech.edu) # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** from . import free_module_element from sage.symbolic.all import Expression def apply_map(phi): """ Returns a function that applies phi to its argument. EXAMPLES:: sage: from sage.modules.vector_symbolic_dense import apply_map sage: v = vector([1,2,3]) sage: f = apply_map(lambda x: x+1) sage: f(v) (2, 3, 4) """ def apply(self, *args, **kwds): """ Generic function used to implement common symbolic operations elementwise as methods of a vector. EXAMPLES:: sage: var('x,y') (x, y) sage: v = vector([sin(x)^2 + cos(x)^2, log(x*y), sin(x/(x^2 + x)), factorial(x+1)/factorial(x)]) sage: v.simplify_trig() (1, log(x*y), sin(1/(x + 1)), factorial(x + 1)/factorial(x)) sage: v.canonicalize_radical() (cos(x)^2 + sin(x)^2, log(x) + log(y), sin(1/(x + 1)), factorial(x + 1)/factorial(x)) sage: v.simplify_rational() (cos(x)^2 + sin(x)^2, log(x*y), sin(1/(x + 1)), factorial(x + 1)/factorial(x)) sage: v.simplify_factorial() (cos(x)^2 + sin(x)^2, log(x*y), sin(x/(x^2 + x)), x + 1) sage: v.simplify_full() (1, log(x*y), sin(1/(x + 1)), x + 1) sage: v = vector([sin(2*x), sin(3*x)]) sage: v.simplify_trig() (2*cos(x)*sin(x), (4*cos(x)^2 - 1)*sin(x)) sage: v.simplify_trig(False) (sin(2*x), sin(3*x)) sage: v.simplify_trig(expand=False) (sin(2*x), sin(3*x)) """ return self.apply_map(lambda x: phi(x, *args, **kwds)) apply.__doc__ += "\nSee Expression." + phi.__name__ + "() for optional arguments." return apply class Vector_symbolic_dense(free_module_element.FreeModuleElement_generic_dense): pass # Add elementwise methods. for method in ['simplify', 'simplify_factorial', 'simplify_log', 'simplify_rational', 'simplify_trig', 'simplify_full', 'trig_expand', 'canonicalize_radical', 'trig_reduce']: setattr(Vector_symbolic_dense, method, apply_map(getattr(Expression, method)))
34.728814
108
0.59346
575
4,098
4.085217
0.26087
0.013623
0.0149
0.03576
0.392933
0.36143
0.354193
0.340145
0.300128
0.300128
0
0.026738
0.224256
4,098
117
109
35.025641
0.712174
0.751586
0
0
0
0
0.217848
0
0
0
0
0
0
1
0.133333
false
0.066667
0.2
0
0.533333
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
58a66b1c1e9cbe9103fe7260fec4a45f53280f13
495
py
Python
baya/tests/models.py
hrichards/baya
f319cef5e95cd6a166265d51ae0ea236b6f65be3
[ "MIT" ]
null
null
null
baya/tests/models.py
hrichards/baya
f319cef5e95cd6a166265d51ae0ea236b6f65be3
[ "MIT" ]
1
2018-12-28T16:53:42.000Z
2018-12-28T16:53:42.000Z
baya/tests/models.py
hrichards/baya
f319cef5e95cd6a166265d51ae0ea236b6f65be3
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class Blag(models.Model): name = models.CharField(max_length=128) class BlagEntry(models.Model): blag = models.ForeignKey(Blag) title = models.CharField(max_length=255) body = models.TextField() class Meta: verbose_name_plural = "Entries" class PhotoBlagEntry(models.Model): blag = models.ForeignKey(Blag) title = models.CharField(max_length=255) # and a file field for a photo but whatever
21.521739
47
0.711111
65
495
5.338462
0.538462
0.086455
0.15562
0.207493
0.386167
0.386167
0.386167
0.386167
0.386167
0.386167
0
0.022556
0.193939
495
22
48
22.5
0.847118
0.133333
0
0.333333
0
0
0.016432
0
0
0
0
0
0
1
0
false
0
0.083333
0
0.916667
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
58a742e0b8ad8aa4381262e4194d124ffb86733b
6,241
py
Python
version/v 4.0/spider/config.py
zhong-yan/neteasenews
4dda8ef13d44f08e90e3869f4a7d972fb4b9feed
[ "Apache-2.0" ]
null
null
null
version/v 4.0/spider/config.py
zhong-yan/neteasenews
4dda8ef13d44f08e90e3869f4a7d972fb4b9feed
[ "Apache-2.0" ]
null
null
null
version/v 4.0/spider/config.py
zhong-yan/neteasenews
4dda8ef13d44f08e90e3869f4a7d972fb4b9feed
[ "Apache-2.0" ]
null
null
null
from selenium import webdriver BASE_URL = 'http://news.163.com/' # 首页ajax内容,无人机ajax,其实后面?callback=data_callback'可以省略 # 如何快速找到json链接?现在只能手工完成..添加每一个json文档 JSON_INDEX_URLS = [ 'http://temp.163.com/special/00804KVA/cm_yaowen.js?callback=data_callback', 'http://house.163.com/special/00078GU7/guangzhou_xw_news_v1.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_shehui.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_guonei.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_guoji.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_dujia.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_war.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_money.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_tech.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_sports.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_ent.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_lady.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_auto.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_houseguangzhou.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_hangkong.js?callback=data_callback', 'http://temp.163.com/special/00804KVA/cm_jiankang.js?callback=data_callback', # 无人机标签 'http://news.163.com/uav/special/000189N0/uav_index.js?callback=data_callback', # 体育 'http://sports.163.com/special/000587PR/newsdata_n_index.js?callback=data_callback', 'http://sports.163.com/special/000587PR/newsdata_n_world.js?callback=data_callback', 'http://sports.163.com/special/000587PR/newsdata_n_china.js?callback=data_callback', 'http://sports.163.com/special/000587PR/newsdata_n_cba.js?callback=data_callback', 'http://sports.163.com/special/000587PR/newsdata_n_allsports.js?callback=data_callback', # NBA 'http://sports.163.com/special/000587PK/newsdata_nba_hj.js?callback=data_callback', 'http://sports.163.com/special/000587PK/newsdata_nba_qsh.js?callback=data_callback', 'http://sports.163.com/special/000587PK/newsdata_nba_ysh.js?callback=data_callback', 'http://sports.163.com/special/000587PK/newsdata_nba_ketr.js?callback=data_callback', 'http://sports.163.com/special/000587PK/newsdata_nba_okc.js?callback=data_callback', 'http://sports.163.com/special/000587PK/newsdata_nba_huren.js?callback=data_callback', 'http://sports.163.com/special/000587PK/newsdata_nba_mc.js?callback=data_callback', # 娱乐 'http://ent.163.com/special/000380VU/newsdata_index.js?callback=data_callback', 'http://ent.163.com/special/000380VU/newsdata_music.js?callback=data_callback', 'http://ent.163.com/special/000380VU/newsdata_star.js?callback=data_callback', 'http://ent.163.com/special/000380VU/newsdata_movie.js?callback=data_callback', 'http://ent.163.com/special/000380VU/newsdata_tv.js?callback=data_callback', 'http://ent.163.com/special/000380VU/newsdata_show.js?callback=data_callback', # 财经 'http://money.163.com/special/002557S5/newsdata_idx_index.js?callback=data_callback', 'http://money.163.com/special/002557S5/newsdata_idx_stock.js?callback=data_callback', 'http://money.163.com/special/002557S5/newsdata_idx_finance.js?callback=data_callback', 'http://money.163.com/special/002557S5/newsdata_idx_fund.js?callback=data_callback', 'http://money.163.com/special/002557S5/newsdata_idx_licai.js?callback=data_callback', 'http://money.163.com/special/002557S5/newsdata_idx_biz.js?callback=data_callback', 'http://money.163.com/special/002557S5/newsdata_idx_bitcoin.js?callback=data_callback', # 股票 'http://money.163.com/special/002557S6/newsdata_gp_index.js?callback=data_callback', 'http://money.163.com/special/002557S6/newsdata_gp_hkstock.js?callback=data_callback', 'http://money.163.com/special/002557S6/newsdata_gp_usstock.js?callback=data_callback', 'http://money.163.com/special/002557S6/newsdata_gp_ipo.js?callback=data_callback', 'http://money.163.com/special/002557S6/newsdata_gp_bitcoin.js?callback=data_callback', 'http://money.163.com/special/002557S6/newsdata_gp_dy.js?callback=data_callback', # 科技 'http://tech.163.com/special/00097UHL/tech_datalist.js?callback=data_callback', # 全国,找不到规律,不想copy了 烦 'http://bendi.news.163.com/beijing/special/04388GGG/bjxinxiliu.js', 'http://bendi.news.163.com/shanghai/special/04188GP4/shxinxiliu.js', 'http://tj.news.163.com/special/04208F5D/tjxxl.js', 'http://bendi.news.163.com/jiangsu/special/04248H8U/njxxl.js', 'http://bendi.news.163.com/zhejiang/special/04098FBT/xinxiliu.js', 'http://sc.news.163.com/special/04268EVT/xinxiliu.js', 'http://bendi.news.163.com/heilongjiang/special/04238DR5/haerbin.js', 'http://bendi.news.163.com/jilin/special/04118E6D/center_news_cc.js', 'http://bendi.news.163.com/liaoning/special/04228EED/xinxiliu.js', 'http://bendi.news.163.com/neimengu/special/04138EHT/nmgxxl.js' ] URLs = ['http://news.163.com/', 'http://news.163.com/rank/', 'http://news.163.com/photo/#Current', 'http://news.163.com/domestic/', 'http://news.163.com/world/', 'http://news.163.com/shehui/', 'http://data.163.com/special/datablog/', 'http://war.163.com/', 'http://news.163.com/air/', 'http://news.163.com/uav/', 'http://news.163.com/college', 'http://gov.163.com/', 'http://gongyi.163.com/', 'http://media.163.com/'] # config mongoDB MONGODB_HOST = 'localhost' MONGODB_PORT = 27017 MONGODB_DBNAME = 'neteasenews' # 存储热更新的内容, 即更新频率快的 MONGODB_TABLE_1 = 'article' # 存储新闻排行榜内容, 即更新频率中等 MONGODB_TABLE_2 = 'newsrank' # 存储冷更新的内容,即更新时间长的 MONGODB_TABLE_3 = 'coldpage' # 存储图片数据 MONGODB_TABLE_4 = 'picture' # config chromedriver: prefs = { 'profile.default_content_setting_values': { 'images': 2, # 'javascript': 2 # 'User-Agent': ua } } options = webdriver.ChromeOptions() options.add_experimental_option('prefs', prefs) # 开启无界面模式 options.add_argument('--headless')
54.745614
92
0.737863
881
6,241
5.059024
0.205448
0.099619
0.148755
0.241867
0.661207
0.629347
0.59457
0.566525
0.529953
0.529953
0
0.102505
0.091812
6,241
114
93
54.745614
0.683839
0.042621
0
0
0
0.01087
0.821021
0.00638
0
0
0
0
0
1
0
false
0
0.01087
0
0.01087
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
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
5438824c4ced393aa643d5e74bfabb01555d5d5c
2,037
py
Python
components/siren.py
TalaoDAO/ecole42
2236f24527966195c953f222f9715ee967348b0f
[ "Apache-2.0" ]
1
2021-09-22T16:30:57.000Z
2021-09-22T16:30:57.000Z
components/siren.py
TalaoDAO/credential-repository
d36c694d9e90ead8a35bd8cc5be47c6d951474ba
[ "Apache-2.0" ]
null
null
null
components/siren.py
TalaoDAO/credential-repository
d36c694d9e90ead8a35bd8cc5be47c6d951474ba
[ "Apache-2.0" ]
null
null
null
import requests def company(SIREN): r = requests.get('https://entreprise.data.gouv.fr/api/sirene/v2/siren/'+SIREN+'') json_object = r.json() settings = dict() if json_object['sirene']['status'] == 404: return None if json_object['sirene']['data']['siege_social']['nom_raison_sociale'] != None : settings['name'] = json_object['sirene']['data']['siege_social']['nom_raison_sociale'] else : settings['name'] = '' try : settings['address'] = json_object['sirene']['data']['siege_social']['numero_voie'] + ' ' + json_object['sirene']['data']['siege_social']['type_voie'] + ' ' + json_object['sirene']['data']['siege_social']['libelle_voie'] + ' ' + json_object['sirene']['data']['siege_social']['code_postal'] + ' ' + json_object['sirene']['data']['siege_social']['libelle_commune'] except : settings['address'] = '' if json_object['sirene']['data']['total_results'] != None : settings['group'] = json_object['sirene']['data']['total_results'] else : settings['group'] = '' Dictionnaire_effectifs = {'NN': "No staff members", '00': '0', '01': "1-2", '02': "3-5", '03': "6-9", '11': "10-19", '12': "20-49", '21': "50-99", '22': "100-199", '31': "200-249", '32': "250-499", '41': "500-999", '42': "1000-1999", '51': "2000-4999", '52': "5000-9999", '53': "+10 000"} if json_object['sirene']['data']['siege_social']['tranche_effectif_salarie'] != None : settings['staff'] = Dictionnaire_effectifs[json_object['sirene']['data']['siege_social']['tranche_effectif_salarie']] else : settings['staff'] = '' if json_object['sirene']['data']['siege_social']['libelle_activite_principale_entreprise'] != None : settings['activity'] = json_object['sirene']['data']['siege_social']['libelle_activite_principale_entreprise'] else : settings['activity'] = '' return settings
55.054054
370
0.571919
228
2,037
4.894737
0.434211
0.134409
0.200717
0.232975
0.524194
0.522401
0.437276
0.297491
0.297491
0.11828
0
0.065635
0.207167
2,037
36
371
56.583333
0.625387
0
0
0.125
0
0
0.383308
0.061969
0
0
0
0
0
1
0.03125
false
0
0.03125
0
0.125
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
543dd03030508ee683df7a6d3985dc5051235db5
277
py
Python
tests/test_learner.py
luksurious/faster-teaching
1493311d5b723ca3f216f537bda8db5907196443
[ "MIT" ]
2
2020-08-06T13:21:51.000Z
2021-04-15T04:29:03.000Z
tests/test_learner.py
luksurious/faster-teaching
1493311d5b723ca3f216f537bda8db5907196443
[ "MIT" ]
null
null
null
tests/test_learner.py
luksurious/faster-teaching
1493311d5b723ca3f216f537bda8db5907196443
[ "MIT" ]
null
null
null
from concepts.letter_addition import LetterAddition from learners.sim_memoryless_learner import SimMemorylessLearner def test_see_example(): concept = LetterAddition(6) learner = SimMemorylessLearner(concept, list(range(0, 7))) learner.see_example(((0, 1), 10))
27.7
64
0.776173
33
277
6.333333
0.69697
0.095694
0
0
0
0
0
0
0
0
0
0.029046
0.129964
277
9
65
30.777778
0.838174
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
543ed68a45e19a13dd2f2c914498c100fd410df9
784
py
Python
src/homework/i_dictionaries_sets/dictionary.py
acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-WillCapo
426db13aa4d5f6005d7079007ff5fdf114ef649e
[ "MIT" ]
null
null
null
src/homework/i_dictionaries_sets/dictionary.py
acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-WillCapo
426db13aa4d5f6005d7079007ff5fdf114ef649e
[ "MIT" ]
null
null
null
src/homework/i_dictionaries_sets/dictionary.py
acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-WillCapo
426db13aa4d5f6005d7079007ff5fdf114ef649e
[ "MIT" ]
1
2022-02-09T02:28:56.000Z
2022-02-09T02:28:56.000Z
def get_p_distance(list1, list2): count = 0 i = 0 while i < len(list1): if (list1[i] != list2[i]): count += .1 i += 1 return count def get_p_distance_matrix(list1, list2, list3, list4): dna1 = get_p_distance(list1, list1), get_p_distance(list1, list2), get_p_distance(list1, list3), get_p_distance(list1, list4) dna2 = get_p_distance(list2, list1), get_p_distance(list2, list2), get_p_distance(list2, list3), get_p_distance(list2, list4) dna3 = get_p_distance(list3, list1), get_p_distance(list3, list2), get_p_distance(list3, list3), get_p_distance(list3, list4) dna4 = get_p_distance(list4, list1), get_p_distance(list4, list2), get_p_distance(list4, list3), get_p_distance(list4, list4) return dna1, dna2, dna3, dna4
52.266667
129
0.69898
123
784
4.154472
0.170732
0.1409
0.422701
0.166341
0.086106
0
0
0
0
0
0
0.082171
0.177296
784
15
130
52.266667
0.710078
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0
0
0.285714
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
543fd7e53080b049a8ec4e7ace7dac2f370068e8
38,634
py
Python
pysnmp-with-texts/ZHONE-COM-IP-FILTER-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/ZHONE-COM-IP-FILTER-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/ZHONE-COM-IP-FILTER-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-COM-IP-FILTER-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-COM-IP-FILTER-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:47:04 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) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Gauge32, Counter64, iso, Integer32, ModuleIdentity, ObjectIdentity, IpAddress, Unsigned32, MibIdentifier, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, NotificationType, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "Counter64", "iso", "Integer32", "ModuleIdentity", "ObjectIdentity", "IpAddress", "Unsigned32", "MibIdentifier", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "NotificationType", "Counter32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") zhoneModules, zhoneIp = mibBuilder.importSymbols("Zhone", "zhoneModules", "zhoneIp") ZhoneRowStatus, ZhoneAdminString = mibBuilder.importSymbols("Zhone-TC", "ZhoneRowStatus", "ZhoneAdminString") comIpFilter = ModuleIdentity((1, 3, 6, 1, 4, 1, 5504, 6, 58)) comIpFilter.setRevisions(('2005-01-10 10:16', '2005-01-03 09:24', '2004-12-21 09:25', '2004-08-30 11:00', '2004-04-06 00:17', '2001-01-17 08:48', '2000-09-11 16:22',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: comIpFilter.setRevisionsDescriptions(('changed portAccessArg1, portAccessArg2 to more intuitive names.', 'changed portArg1, portArg2 to IP addresses', 'added Port_Access', 'V01.01.02 - Add type field to mcastControlList.', 'V01.01.01 - Implementation of multicast-control-list.', 'V01.01.00 - Added keyword markup, updated SMI, Added the filterStmtRenumTable and filterStatsTable', 'V01.00.00 - Initial Release',)) if mibBuilder.loadTexts: comIpFilter.setLastUpdated('200501100015Z') if mibBuilder.loadTexts: comIpFilter.setOrganization('Zhone Technologies, Inc.') if mibBuilder.loadTexts: comIpFilter.setContactInfo(' Postal: Zhone Technologies, Inc. @ Zhone Way 7001 Oakport Street Oakland, CA 94621 USA Toll-Free: +1 877-ZHONE20 (+1 877-946-6320) Tel: +1-510-777-7000 Fax: +1-510-777-7001 E-mail: support@zhone.com') if mibBuilder.loadTexts: comIpFilter.setDescription('Zhone IP Filter MIB Module. IP Software Minneapolis, MN') filter = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8)) if mibBuilder.loadTexts: filter.setStatus('current') if mibBuilder.loadTexts: filter.setDescription('The MIB module representing IP filter specifications in Zhone Technologies products. IP filtering is typically performed to enhance network security by limiting what access is allowed between two networks. Filtering is also effective in eliminating certain denial-of-service attacks. Packet filtering also provides a framework for sanity checking packet headers, and rejecting packets that are unlikely (or that should be impossible). In this way, packet filtering can prevent certain unfortunate mistakes from shutting a network down.') if mibBuilder.loadTexts: filter.setReference("RFC1812, 'Requirements for IP Version 4 Routers,' ftp://ftp.isi.edu/in-notes/rfc1812.txt. RFC2267, 'Network Ingress Filtering: Defeating Denial of Service Attacks which employ IP Source Address Spoofing,' ftp://ftp.isi.edu/in-notes/rfc2267.txt. RFC2474, 'Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers', ftp://ftp.isi.edu/in-notes/rfc2474.txt. D. Brent Chapman, 'Network (In)Security Through IP Packet Filtering,' Proceedings of the 3rd USENIX Security Symposium, Sept. 1992. Andrew Molitor, 'An Architecture for Advanced Packet Filtering,' Proceedings of the 5th USENIX Security Symposium, June. 1995. Paul Russell, 'Linux IPCHAINS-HOWTO,' http://www.rustcorp.com/linux/ipchains/HOWTO.html, v1.0.7, Mar. 1999.") filterGlobal = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 1)) if mibBuilder.loadTexts: filterGlobal.setStatus('current') if mibBuilder.loadTexts: filterGlobal.setDescription('Global filter provisioning information.') fltGlobalIndexNext = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: fltGlobalIndexNext.setStatus('current') if mibBuilder.loadTexts: fltGlobalIndexNext.setDescription('The next available filter spec table index (filterSpecIndex). A GET on this object increments the value by one. A GETNEXT on this object will always return zero.') fltGlobalTimeout = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: fltGlobalTimeout.setStatus('current') if mibBuilder.loadTexts: fltGlobalTimeout.setDescription('Filter inconsistency timeout in seconds. A filter spec is considered to be in an inconsistent state when the value of the objects fltSpecVersion1 and fltSpecVersion2 are not equal. This timeout indicates the minimum number of seconds a filter may be in an inconsistent state before the filter spec becomes invalid and the default action for a filter is used as the filter. Provided fltGlobalTimeout is long enough, it should ensure that both an old modification is permanently stalled (ensuring exclusive access) as well as enough time to repair a filter. Default is five seconds.') filterSpecTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2), ) if mibBuilder.loadTexts: filterSpecTable.setStatus('current') if mibBuilder.loadTexts: filterSpecTable.setDescription("The filter specification table contains specifications for the IP filtering module. Rows are indexed by a single integer index (filterSpecIndex). The fltGlobalIndexNext object is used to determine the next index value. Each row points to a sequence of rows (statements) in the filterStatementTable. When any row in that sequence is modified, created, or removed, the fltSpecVersion1 and fltSpecVersion2 objects must be incremented. Rows are created by assigning fltSpecIndex and setting fltSpecRowStatus to 'createAndGo'. All columnar objects in this table have default values, so no objects other than the index value need be set to create a row. Rows are removed by setting fltSpecRowStatus to 'destroy'. When a row is removed, each row in filterStatementTable with the same fltSpecIndex is automatically removed.") filterSpecEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1), ).setIndexNames((0, "ZHONE-COM-IP-FILTER-MIB", "fltSpecIndex")) if mibBuilder.loadTexts: filterSpecEntry.setStatus('current') if mibBuilder.loadTexts: filterSpecEntry.setDescription('An entry in the filterSpecTable.') fltSpecIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: fltSpecIndex.setStatus('current') if mibBuilder.loadTexts: fltSpecIndex.setDescription('The index that identifies an entry in the filterSpecTable. The fltGlobalIndexNext object is used to determine the next value of this object.') fltSpecName = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 2), ZhoneAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltSpecName.setStatus('current') if mibBuilder.loadTexts: fltSpecName.setDescription('The filter name associated with this filter specification. This name should indicate the nature of the filter. The default value is an empty string.') fltSpecDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 3), SnmpAdminString()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltSpecDesc.setStatus('current') if mibBuilder.loadTexts: fltSpecDesc.setDescription('Textual description of the filter specification. This should briefly describe the nature of the filter defined by the associated filter statements. The default value is an empty string.') fltSpecVersion1 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 4), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltSpecVersion1.setStatus('current') if mibBuilder.loadTexts: fltSpecVersion1.setDescription('The version number of the filter specification. This is used to flag any changes in the statements that comprise a filter. Each time a modification occurs to an object in a filter spec (including the the list of filter statements of the same fltSpecIndex in filterStatementTable), the value of this object, and fltSpecVersion2 must be incremented. The manager adding, deleting, or modifying a filter statement or statements must increment this version number in the following manner. A read of fltSpecVersion1 returns its current value. A write to fltSpecVersion1 must be one greater than its current value. A successful write of this object transfers ownership to the manager, where the manager must subsequently perform any desired modifications to the filter spec and then write the new value of fltSpecVersion1 to the fltSpecVersion2 object to release ownership. When fltSpecVersion1 does not equal to fltSpecVersion2, the filter spec is in an inconsistent state. If the filter spec remains in an inconsistent state longer than the time specified in fltGlobalTimeout, the filter spec is declared invalid and the filter spec does not become active. The previously provisioned filter spec will remain active. If no previous filter spec was provisioned for this interface, a default action is used. It is up to the manager to fix the invalid filter spec and bring it into a consistent state.') fltSpecVersion2 = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 5), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltSpecVersion2.setStatus('current') if mibBuilder.loadTexts: fltSpecVersion2.setDescription('The version number of the filter specification. The value of this object must be equal to fltSpecVersion1, otherwise the filter spec is inconsistent. See fltSpecVersion1 for details.') fltSpecLanguageVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 6), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltSpecLanguageVersion.setStatus('current') if mibBuilder.loadTexts: fltSpecLanguageVersion.setDescription('The language version of the filter. The language version further details the meaning and use of the objects in filterStatmentTable. The definitions of the filter languages is beyond the scope of this description.') fltSpecRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 2, 1, 7), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltSpecRowStatus.setStatus('current') if mibBuilder.loadTexts: fltSpecRowStatus.setDescription('Zhone convention to support row creation and deletion. This is the only object required to create or destroy a row in this table.') filterStatementTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3), ) if mibBuilder.loadTexts: filterStatementTable.setStatus('current') if mibBuilder.loadTexts: filterStatementTable.setDescription("This table contains the filter specification statements for the IP filtering module. A complete filter specification is comprised of all the linked statements (rows) that are pointed to by an entry in the filterSpecTable. Filter statements are linked together by fltSpecIndex, and are ordered within the comprised filter using fltStmtIndex. A statement can only be owned by one filter spec. Rows are created by assigning fltSpecIndex and fltStmtIndex, and setting fltStmtRowStatus to 'createAndGo'. All columnar objects in this table have default values, so no objects other than the index values need be set to create a row. Rows are destroyed by setting fltStmtRowStatus to 'delete'. When rows are created or destroyed, the version of the corresponding filter spec row is incremented.") filterStatementEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1), ).setIndexNames((0, "ZHONE-COM-IP-FILTER-MIB", "fltSpecIndex"), (0, "ZHONE-COM-IP-FILTER-MIB", "fltStmtIndex")) if mibBuilder.loadTexts: filterStatementEntry.setStatus('current') if mibBuilder.loadTexts: filterStatementEntry.setDescription('An entry in the filterStatement table. Each entry represents one of a sequence of statements that comprise a filter. Each filter statement consists of an index, specific packet header fields, and arbitrary packet offsets and values. Some objects in this entry define ranges for specific packet header fields. These objects define comparison operations on the field they share in the following manner: Low High Compare Method for field f --- ---- ------------------------------------------- 0 0 no comparison on the field 0 H less than or equal to High (f <= H) L 0 exact match (L == f) L H inclusive between comparison (L <= f <= H) ') fltStmtIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: fltStmtIndex.setStatus('current') if mibBuilder.loadTexts: fltStmtIndex.setDescription('The table index that identifies a filter statement. These indicies should be sparse to allow for insertion into the list.') fltStmtIpSrcAddrLow = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 2), IpAddress().clone(hexValue="00000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtIpSrcAddrLow.setStatus('current') if mibBuilder.loadTexts: fltStmtIpSrcAddrLow.setDescription('The inclusive lower bound for the source IP address range. See the filterStatementEntry description for details.') fltStmtIpSrcAddrHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 3), IpAddress().clone(hexValue="00000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtIpSrcAddrHigh.setStatus('current') if mibBuilder.loadTexts: fltStmtIpSrcAddrHigh.setDescription('The inclusive upper bound for the source IP address range. See the filterStatementEntry description for details.') fltStmtSrcPortLow = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtSrcPortLow.setStatus('current') if mibBuilder.loadTexts: fltStmtSrcPortLow.setDescription('The inclusive lower bound for the transport layer source port range. See the filterStatementEntry description for details.') fltStmtSrcPortHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtSrcPortHigh.setStatus('current') if mibBuilder.loadTexts: fltStmtSrcPortHigh.setDescription('The inclusive upper bound for the transport layer source port range. See the filterStatementEntry description for details.') fltStmtIpDstAddrLow = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 6), IpAddress().clone(hexValue="00000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtIpDstAddrLow.setStatus('current') if mibBuilder.loadTexts: fltStmtIpDstAddrLow.setDescription('The inclusive lower bound for the destination IP address range. See the filterStatementEntry description for details.') fltStmtIpDstAddrHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 7), IpAddress().clone(hexValue="00000000")).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtIpDstAddrHigh.setStatus('current') if mibBuilder.loadTexts: fltStmtIpDstAddrHigh.setDescription('The inclusive upper bound for the destination IP address range. See the filterStatementEntry description for details.') fltStmtDstPortLow = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtDstPortLow.setStatus('current') if mibBuilder.loadTexts: fltStmtDstPortLow.setDescription('The inclusive lower bound for the transport layer destination port range. See the filterStatementEntry description for details.') fltStmtDstPortHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtDstPortHigh.setStatus('current') if mibBuilder.loadTexts: fltStmtDstPortHigh.setDescription('The inclusive upper bound for the transport layer destination port range. See the filterStatementEntry description for details.') fltStmtIpProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("any", 1), ("ip", 2), ("tcp", 3), ("udp", 4), ("icmp", 5))).clone('any')).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtIpProtocol.setStatus('current') if mibBuilder.loadTexts: fltStmtIpProtocol.setDescription('The IP protocol value that is to be matched. The enum values are as follows: any(1) : any protocol type is a match (wildcard) ip(2) : raw IP packet tcp(3) : TCP packet udp(4) : UDP packet icmp(5) : ICMP packet The default value is any(1).') fltStmtArbValueBase = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("none", 1), ("ip", 2), ("udp", 3), ("tcp", 4), ("icmp", 5), ("ipOptions", 6), ("tcpOptions", 7))).clone('none')).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtArbValueBase.setStatus('current') if mibBuilder.loadTexts: fltStmtArbValueBase.setDescription('This field identifies the protocol header to which the arbitrary value comparison applies. The enum values are as follows: none(1) : no arbitrary value comparison ip(2) : base is IP header udp(3) : base is UDP header tcp(4) : base is TCP header icmp(5) : base is ICMP header ipOptions(6) : base is IP options header tcpOptions(7) : base is TCP options header The default value is none(1).') fltStmtArbOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtArbOffset.setStatus('current') if mibBuilder.loadTexts: fltStmtArbOffset.setDescription('The offset, in octets, from the beginning of the header to the most significant octet for the arbitrary value comparison.') fltStmtArbMask = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 13), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtArbMask.setStatus('current') if mibBuilder.loadTexts: fltStmtArbMask.setDescription('This object is mask for for arbitrary value comparisons. The non-zero bits in this field determine the size of the arbitrary field.') fltStmtArbValueLow = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 14), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtArbValueLow.setStatus('current') if mibBuilder.loadTexts: fltStmtArbValueLow.setDescription('This object is the inclusive lower bound for arbitrary value comparison. See the filterStatementEntry description for details.') fltStmtArbValueHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 15), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtArbValueHigh.setStatus('current') if mibBuilder.loadTexts: fltStmtArbValueHigh.setDescription('This object is the inclusive upper bound for arbitrary value comparison. See the filterStatementEntry description for details.') fltStmtModifier = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 16), Bits().clone(namedValues=NamedValues(("notIpSrc", 0), ("notSrcPort", 1), ("notDstIp", 2), ("notPortDst", 3), ("notProtocol", 4), ("notArbitrary", 5), ("notStatement", 6)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtModifier.setStatus('current') if mibBuilder.loadTexts: fltStmtModifier.setDescription('Filter statement modifier. The bits set in this object logically negate the results of the comparisons made on their respecive fields as shown : notIpSrcAddr(1) : fltStmtIpSrcAddrLow, fltStmtIpSrcAddrHigh notSrcPort(2) : fltStmtSrcPortLow, fltStmtSrcPortHigh notIpDstAddr(3) : fltStmtIpDstAddrLow, fltStmtIpDstAddrHigh notDstPort(4) : fltStmtDstPortLow, fltStmtDstPortHigh notIpProtocol(5) : fltStmtIpProtocol notArbitrary(6) : fltStmtArbValueLow, fltStmtArbValueHigh notStatement(7) : negate outcome of the entire statement No bits set (the default) specifies to use all outcomes as is.') fltStmtAction = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 17), Bits().clone(namedValues=NamedValues(("reset", 0), ("permit", 1), ("deny", 2), ("forward", 3), ("reject", 4), ("log", 5))).clone(namedValues=NamedValues(("deny", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtAction.setStatus('current') if mibBuilder.loadTexts: fltStmtAction.setDescription('Filter statement action. The bits set in this object specify actions to take on packets matching this statement. Supported actions are: reset(0) : Return a TCP reset packet to the packet sender and drop the packet. This cannot be specified with permit. permit(1) : Stop filtering the packet and allow it to be sent on the associated interface. This cannot be specified with deny. deny(2) : Stop filtering the packet and discard it. This cannot be specified with permit. forward(3) : Forward the packet the IP address specified in fltStmtActionArg. reject(4) : Return an ICMP destination unreachable packet (type 3) to the packet sender with code 13 (communication administratively prohibited). This cannot be specified permit. log(5) : Write the packet to the log stream. There are some mutually exclusive bits: reset(0) and permit(1), permit(1) and deny(2), permit(1) and reject(4). No bits set implies to continue filtering on the packet.') fltStmtActionArg = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 18), Integer32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtActionArg.setStatus('current') if mibBuilder.loadTexts: fltStmtActionArg.setDescription('Filter statement action argument. The meaning of this object depends on the value of fltStmtAction: forward(3) : An IP address to forward the packet to. The value of this object must be non-zero. All other values of fltStmtAction have no relation to this object. The default is zero.') fltStmtRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 3, 1, 19), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: fltStmtRowStatus.setStatus('current') if mibBuilder.loadTexts: fltStmtRowStatus.setDescription('Zhone convention to support row creation and deletion. This is the only object required to create or destroy a row in this table.') filterStmtRenumTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 4), ) if mibBuilder.loadTexts: filterStmtRenumTable.setStatus('current') if mibBuilder.loadTexts: filterStmtRenumTable.setDescription('This table provides a mechanism for renumbering individual filter statments within their particular filter spec.') filterStmtRenumEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 4, 1), ) filterStatementEntry.registerAugmentions(("ZHONE-COM-IP-FILTER-MIB", "filterStmtRenumEntry")) filterStmtRenumEntry.setIndexNames(*filterStatementEntry.getIndexNames()) if mibBuilder.loadTexts: filterStmtRenumEntry.setStatus('current') if mibBuilder.loadTexts: filterStmtRenumEntry.setDescription('An entry in the filterStmtRenumTable.') fltStmtIndexNew = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fltStmtIndexNew.setStatus('current') if mibBuilder.loadTexts: fltStmtIndexNew.setDescription("The new statement index for the filter statement. Reading this object will return the same value as the 'fltStmtIndex' portion of its index. Writing to this object will cause the corresponding filter statement to be relocated to the position identified by the value written here. If no statement exists at the current index, 'no such instance' will be returned. If a statement already exists at the new index then 'inconsistent value' is returned. For example, to move the second statement of filter #4 to the third position (e.g. to make room for a new statement #2), the following SNMP set-request would be issued: fltStmtIndexNew.4.2 = 3 There is no default value for this object as it is derived from the fltStmtIndex.") filterStatsTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5), ) if mibBuilder.loadTexts: filterStatsTable.setStatus('current') if mibBuilder.loadTexts: filterStatsTable.setDescription('This table provides ingress and egress IP filter statistics for each interface. This table is indexed by the ifIndex of the interface and the direction (ingress or egress) of traffic being filtered. This is a read-only table.') filterStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "ZHONE-COM-IP-FILTER-MIB", "fltStatDirection")) if mibBuilder.loadTexts: filterStatsEntry.setStatus('current') if mibBuilder.loadTexts: filterStatsEntry.setDescription('An entry in the filterStatsTable. There will be an entry for each filter provisioned on an interface. There can be, at most, two filters provisioned per interface; one for ingress filtering and the other for egress filtering.') fltStatDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ingress", 1), ("egress", 2)))) if mibBuilder.loadTexts: fltStatDirection.setStatus('current') if mibBuilder.loadTexts: fltStatDirection.setDescription('The direction for which this set of statistics is kept: ingress or egress.') fltStatResetPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatResetPkts.setStatus('current') if mibBuilder.loadTexts: fltStatResetPkts.setDescription('The number of discarded packets for which a TCP reset packet was sent.') fltStatPermitPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatPermitPkts.setStatus('current') if mibBuilder.loadTexts: fltStatPermitPkts.setDescription('The number of permitted packets.') fltStatDenyPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 4), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatDenyPkts.setStatus('current') if mibBuilder.loadTexts: fltStatDenyPkts.setDescription('The number of discarded packets.') fltStatForwardPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 5), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatForwardPkts.setStatus('current') if mibBuilder.loadTexts: fltStatForwardPkts.setDescription('The number of packets forwarded to the IP address specified in the filter.') fltStatRejectPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 6), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatRejectPkts.setStatus('current') if mibBuilder.loadTexts: fltStatRejectPkts.setDescription('The number of discarded packets for which an ICMP destination unreachable packet with code 13 was sent.') fltStatLogPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 7), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatLogPkts.setStatus('current') if mibBuilder.loadTexts: fltStatLogPkts.setDescription('The number of logged packets.') fltStatDefaultPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatDefaultPkts.setStatus('current') if mibBuilder.loadTexts: fltStatDefaultPkts.setDescription('The number of packets that pass through the filter without matching upon which the default action is used.') fltStatSpecVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 9), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatSpecVersion.setStatus('current') if mibBuilder.loadTexts: fltStatSpecVersion.setDescription('The version of the filter being used on this interface.') fltStatSpecIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 5, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: fltStatSpecIndex.setStatus('current') if mibBuilder.loadTexts: fltStatSpecIndex.setDescription('The index of the filter specification being used on this interface. If there is no filter configured for an interface, the entry will not exist in this table.') mcastControl = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6)) if mibBuilder.loadTexts: mcastControl.setStatus('current') if mibBuilder.loadTexts: mcastControl.setDescription('The MIB module representing Multicast control list specifications in Zhone Technologies products. The First application of multicast control list is to accept of deny a IGMP request to join or leave a IGMP group. Any IGMP request to join a group is accepted only if the group address is available in the Multicast Control list pointed by a field in the ip-interface-record.') mcastControlListTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1), ) if mibBuilder.loadTexts: mcastControlListTable.setStatus('current') if mibBuilder.loadTexts: mcastControlListTable.setDescription('Multicast control list table conatins the one of the IP Address that can be allowed to join to by a IGMP join request from IP interface that has the the multicast control list in its ip-interfce-profile. The address to the table is the multicast control list ID and the precedence. The Row status in the table contains indication of whether the row is being created or destroyed. ') mcastControlListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1, 1), ).setIndexNames((0, "ZHONE-COM-IP-FILTER-MIB", "mcastControlListControlId"), (0, "ZHONE-COM-IP-FILTER-MIB", "mcastControlListControlPrecedence")) if mibBuilder.loadTexts: mcastControlListEntry.setStatus('current') if mibBuilder.loadTexts: mcastControlListEntry.setDescription('An entry in the Multicast Control List.') mcastControlListControlId = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: mcastControlListControlId.setStatus('current') if mibBuilder.loadTexts: mcastControlListControlId.setDescription('Description.') mcastControlListControlPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))) if mibBuilder.loadTexts: mcastControlListControlPrecedence.setStatus('current') if mibBuilder.loadTexts: mcastControlListControlPrecedence.setDescription('Description.') mcastControlListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1, 1, 3), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mcastControlListRowStatus.setStatus('current') if mibBuilder.loadTexts: mcastControlListRowStatus.setDescription('Description.') mcastControlListIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: mcastControlListIpAddress.setStatus('current') if mibBuilder.loadTexts: mcastControlListIpAddress.setDescription('multicast ip address.') mcastControlListType = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 6, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("normal", 1), ("always-on", 2), ("periodic", 3))).clone('normal')).setMaxAccess("readcreate") if mibBuilder.loadTexts: mcastControlListType.setStatus('current') if mibBuilder.loadTexts: mcastControlListType.setDescription('Defines the video stream type. normal - join and leave when desired. Used for video. always-on - always joined. Meant for EBS, not video. periodic - will join and leave after task complete. Not meant for video. Used to download the tv guide.') portAccessControl = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7)) if mibBuilder.loadTexts: portAccessControl.setStatus('current') if mibBuilder.loadTexts: portAccessControl.setDescription('This MIB represents the port access control list in Zhone products. It is used to control access to internal ports. Initially it is used just for TELNET (23) , but in theory could be used for other ports as well.') portAccessNextIndex = MibScalar((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: portAccessNextIndex.setStatus('current') if mibBuilder.loadTexts: portAccessNextIndex.setDescription('Description: A hint for the next free index should the manager want to create a new entry.') portAccessTable = MibTable((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2), ) if mibBuilder.loadTexts: portAccessTable.setStatus('current') if mibBuilder.loadTexts: portAccessTable.setDescription('Contains the list of entries that control port access on this device.') portAccessEntry = MibTableRow((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2, 1), ).setIndexNames((0, "ZHONE-COM-IP-FILTER-MIB", "portAccessIndex")) if mibBuilder.loadTexts: portAccessEntry.setStatus('current') if mibBuilder.loadTexts: portAccessEntry.setDescription('This contains the entry that is to be accepted. Currently only used to control access to port 23. arg1, arg2 provide IP Address/mask to allow in.') portAccessIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 100))) if mibBuilder.loadTexts: portAccessIndex.setStatus('current') if mibBuilder.loadTexts: portAccessIndex.setDescription('The index of this entry in table. 100 entries should be more than enough.') portAccessRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2, 1, 2), ZhoneRowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: portAccessRowStatus.setStatus('current') if mibBuilder.loadTexts: portAccessRowStatus.setDescription('Description.: used to create/delete entries in the table.') portAccessNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1023))).setMaxAccess("readcreate") if mibBuilder.loadTexts: portAccessNumber.setStatus('current') if mibBuilder.loadTexts: portAccessNumber.setDescription('PortNumber that this applies to, 1..1023 supported.') portAccessSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2, 1, 4), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: portAccessSrcAddr.setStatus('current') if mibBuilder.loadTexts: portAccessSrcAddr.setDescription('The IP address that we will accept packets from.') portAccessNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 5504, 4, 1, 8, 7, 2, 1, 5), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: portAccessNetMask.setStatus('current') if mibBuilder.loadTexts: portAccessNetMask.setDescription('portAccessNetMask - used to pass the range that we will accept with regards to portAccessSrcAddr.') mibBuilder.exportSymbols("ZHONE-COM-IP-FILTER-MIB", fltStmtIpDstAddrLow=fltStmtIpDstAddrLow, fltStmtIpSrcAddrHigh=fltStmtIpSrcAddrHigh, mcastControlListIpAddress=mcastControlListIpAddress, fltSpecVersion1=fltSpecVersion1, fltStatSpecIndex=fltStatSpecIndex, portAccessSrcAddr=portAccessSrcAddr, fltStatSpecVersion=fltStatSpecVersion, portAccessNumber=portAccessNumber, fltStmtIpProtocol=fltStmtIpProtocol, fltStmtModifier=fltStmtModifier, fltSpecLanguageVersion=fltSpecLanguageVersion, fltStmtSrcPortLow=fltStmtSrcPortLow, mcastControlListControlPrecedence=mcastControlListControlPrecedence, fltStmtActionArg=fltStmtActionArg, fltSpecVersion2=fltSpecVersion2, filterStmtRenumEntry=filterStmtRenumEntry, filterStmtRenumTable=filterStmtRenumTable, portAccessTable=portAccessTable, mcastControlListControlId=mcastControlListControlId, fltStmtIpDstAddrHigh=fltStmtIpDstAddrHigh, fltStmtRowStatus=fltStmtRowStatus, comIpFilter=comIpFilter, portAccessControl=portAccessControl, fltStatDirection=fltStatDirection, mcastControl=mcastControl, fltStmtArbValueLow=fltStmtArbValueLow, mcastControlListTable=mcastControlListTable, filterGlobal=filterGlobal, fltSpecIndex=fltSpecIndex, PYSNMP_MODULE_ID=comIpFilter, fltStmtSrcPortHigh=fltStmtSrcPortHigh, filterStatsTable=filterStatsTable, fltStmtArbMask=fltStmtArbMask, fltGlobalIndexNext=fltGlobalIndexNext, fltStmtIndexNew=fltStmtIndexNew, mcastControlListRowStatus=mcastControlListRowStatus, filterStatsEntry=filterStatsEntry, fltStmtArbValueBase=fltStmtArbValueBase, fltStatLogPkts=fltStatLogPkts, fltStatResetPkts=fltStatResetPkts, fltStatPermitPkts=fltStatPermitPkts, mcastControlListType=mcastControlListType, portAccessIndex=portAccessIndex, fltStmtDstPortLow=fltStmtDstPortLow, fltGlobalTimeout=fltGlobalTimeout, filterStatementTable=filterStatementTable, fltStatDefaultPkts=fltStatDefaultPkts, filter=filter, fltStmtArbOffset=fltStmtArbOffset, portAccessEntry=portAccessEntry, portAccessNextIndex=portAccessNextIndex, fltStatRejectPkts=fltStatRejectPkts, mcastControlListEntry=mcastControlListEntry, filterStatementEntry=filterStatementEntry, fltStmtIndex=fltStmtIndex, filterSpecTable=filterSpecTable, fltSpecRowStatus=fltSpecRowStatus, fltStmtArbValueHigh=fltStmtArbValueHigh, portAccessNetMask=portAccessNetMask, portAccessRowStatus=portAccessRowStatus, fltStmtAction=fltStmtAction, fltStmtIpSrcAddrLow=fltStmtIpSrcAddrLow, filterSpecEntry=filterSpecEntry, fltStatDenyPkts=fltStatDenyPkts, fltSpecDesc=fltSpecDesc, fltSpecName=fltSpecName, fltStmtDstPortHigh=fltStmtDstPortHigh, fltStatForwardPkts=fltStatForwardPkts)
168.707424
2,566
0.786354
5,008
38,634
6.065695
0.153355
0.054515
0.095401
0.008822
0.396385
0.250058
0.21536
0.202456
0.172466
0.14455
0
0.049883
0.106978
38,634
228
2,567
169.447368
0.830585
0.008801
0
0
0
0.15
0.461956
0.014523
0
0
0
0
0
1
0
false
0.009091
0.045455
0
0.045455
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
54520f95709f73e2e760152d29139cc05ba229e9
218
py
Python
badgify/apps.py
BrendanBerkley/django-badgify
61203e92cb76982f778caf168d371a72a401db10
[ "MIT" ]
null
null
null
badgify/apps.py
BrendanBerkley/django-badgify
61203e92cb76982f778caf168d371a72a401db10
[ "MIT" ]
null
null
null
badgify/apps.py
BrendanBerkley/django-badgify
61203e92cb76982f778caf168d371a72a401db10
[ "MIT" ]
null
null
null
from django.apps import AppConfig class BadgifyConfig(AppConfig): name = 'badgify' verbose_name = 'Badgify' def ready(self): super(BadgifyConfig, self).ready() self.module.autodiscover()
19.818182
42
0.674312
23
218
6.347826
0.695652
0.150685
0
0
0
0
0
0
0
0
0
0
0.220183
218
10
43
21.8
0.858824
0
0
0
0
0
0.06422
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0
0.714286
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
54670eac7c97edca8f6b8dd01151c748a6156511
9,940
py
Python
bin/genparams.py
neonkingfr/VizBench
e41f559cb6e761d717f2f5b202482d5d8dacd2d8
[ "MIT" ]
7
2015-01-05T06:32:49.000Z
2020-10-30T19:29:07.000Z
bin/genparams.py
neonkingfr/VizBench
e41f559cb6e761d717f2f5b202482d5d8dacd2d8
[ "MIT" ]
null
null
null
bin/genparams.py
neonkingfr/VizBench
e41f559cb6e761d717f2f5b202482d5d8dacd2d8
[ "MIT" ]
4
2016-03-09T22:29:26.000Z
2021-04-07T13:52:28.000Z
# This script reads *VizParams.list files that define Vizlet parameters # and generates .h files for them, making runtime access to them much faster. # This allows new parameters to be added just by editing one file. import sys import os import re types={"bool":"BOOL","int":"INT","double":"DBL","string":"STR"} realtypes={"bool":"bool","int":"int","double":"double","string":"std::string"} paramtypes={"bool":"BoolParam","int":"IntParam","double":"DoubleParam","string":"StringParam"} def readparams(listfile): try: f = open(listfile) except: print(sys.stderr,"Unable to open "+listfile) sys.exit(1) lines = f.readlines() params = [] for ln in lines: if len(ln) == 0: continue if ln[0] == '#': continue if ln[0] == ':': # These lines are used to define string values vals = ln.split(None,5) (name,typ,mn,mx,default,comment) = vals continue vals = ln.split(None,5) (name,typ,mn,mx,default,comment) = vals params.append( { "name": name, "type": typ, "min": mn, "max": mx, "default": default, "comment": comment } ) params = sorted(params, key=lambda dct: dct['name']) return params def writeln(line): sys.stdout.write(line+"\n") def write(line): sys.stdout.write(line) def genparamcpp(paramclass): writeln("#include \"VizParams.h\"") writeln("#include \""+paramclass+".h\"") writeln("char* "+paramclass+"Names[] = { "+paramclass+"Names_INIT };") ## utility to make sure floating-point values are printed with a decimal point ## so function calls/etc get disambiguated between double and int. def s2d(d): return "%f" % float(d); def genparamheader(params,classname): uptype = classname.upper() tab = "\t" tab2 = "\t\t" tab3 = "\t\t\t" writeln("#ifndef _"+uptype+"_H") writeln("#define _"+uptype+"_H") writeln("#include \"VizParams.h\"") writeln("#include \"VizJSON.h\"") writeln("") ### Generate a declaration for the array of parameter names. ### The actual storage for it needs to be declared in a non-header file. writeln("extern char* "+paramnames+"[];") writeln("") ### Generate a macro which is all the parameter names, used to initialize that array writeln("#define "+paramnames+"_INIT \\") for p in params: name = p["name"] writeln(tab+"\"%s\",\\"%(name)) writeln(tab+"NULL") writeln("") ### Start the class writeln("class "+classname+" : public VizParams {") writeln("public:") ### Generate the class constructor writeln(tab+classname+"() {") writeln(tab2+"loadDefaults();") writeln(tab+"}") writeln(tab+"char **ListOfNames() { return "+paramnames+"; }"); writeln(tab+"// std::string JsonListOfValues() { return _JsonListOfValues("+paramnames+"); }"); writeln(tab+"// std::string JsonListOfParams() { return _JsonListOfParams("+paramnames+"); }"); writeln(tab+"std::string JsonListOfStringValues(std::string type) { return _JsonListOfStringValues(type); }"); ### Generate the method that loads JSON writeln(tab+"void loadJson(cJSON* json) {") writeln(tab2+"cJSON* j;") for p in params: name = p["name"] typ = p["type"] writeln(tab2+"j = cJSON_GetObjectItem(json,\""+name+"\");") writeln(tab2+"if (j) { "+name+".set(j); }") writeln(tab+"}") ### Generate the method that loads default values writeln(tab+"void loadDefaults() {") for p in params: name = p["name"] typ = p["type"] defaultvalue = p["default"] if typ == "double": defaultvalue = s2d(defaultvalue) writeln(tab2+name+".set("+defaultvalue+");") writeln(tab+"}") ### Generate the method that applies one params to another writeln(tab+"void applyVizParamsFrom("+classname+"* p) {") writeln(tab2+"if ( ! p ) { return; }"); for p in params: name = p["name"] typ = p["type"] writeln(tab2+"if ( p->"+name+".isset() ) { this->"+name+".set(p->"+name+".get()); }"); writeln(tab+"}") ### Generate the Set method writeln(tab+"void Set(std::string nm, std::string val) {") writeln(tab2+"bool stringval = false;") estr = "" for p in params: name = p["name"] writeln(tab2+estr+"if ( nm == \""+name+"\" ) {") typ = p["type"] if typ == "double": writeln(tab3+name+".set(string2double(val));") elif typ == "int": writeln(tab3+name+".set(string2int(val));") elif typ == "bool": writeln(tab3+name+".set(string2bool(val));") elif typ == "string": writeln(tab3+name+".set(val);") writeln(tab3+"stringval = true;") estr = "} else " writeln(tab2+"}") writeln("") writeln(tab2+"if ( ! stringval ) {") writeln(tab3+"Increment(nm,0.0); // abide by limits, using code in Increment") writeln(tab2+"}") writeln(tab+"}") ### Generate the Increment method writeln(tab+"void Increment(std::string nm, double amount) {") estr = "" for p in params: name = p["name"] typ = p["type"] mn = p["min"] mx = p["max"] writeln(tab2+estr+"if ( nm == \""+name+"\" ) {") if typ == "double": writeln(tab3+name+".set(adjust("+name+".get(),amount,"+s2d(mn)+","+s2d(mx)+"));") elif typ == "int": writeln(tab3+name+".set(adjust("+name+".get(),amount,"+mn+","+mx+"));") elif typ == "bool": writeln(tab3+name+".set(adjust("+name+".get(),amount));") elif typ == "string": vals = p["min"] if vals == "*": writeln(tab3+"// '*' means the value can be anything"); else: writeln(tab3+name+".set(adjust("+name+".get(),amount,VizParams::StringVals[\""+vals+"\"]));") estr = "} else " writeln(tab2+"}") writeln("") writeln(tab+"}") ### Generate the DefaultValue method writeln(tab+"std::string DefaultValue(std::string nm) {") estr = "" for p in params: name = p["name"] typ = p["type"] default = p["default"] if default[0] != "\"": default = "\"" + default + "\"" writeln(tab2+estr+"if ( nm == \""+name+"\" ) { return "+default+"; }"); writeln(tab2+"return \"\";"); writeln(tab+"}") ### Generate the MinValue method writeln(tab+"std::string MinValue(std::string nm) {") estr = "" for p in params: name = p["name"] typ = p["type"] mn = p["min"] write(tab2+estr+"if ( nm == \""+name+"\" ) { ") if typ == "double": write("return \""+mn+"\";"); elif typ == "int": write("return \""+mn+"\";"); elif typ == "bool": write("return \"false\";"); elif typ == "string": write("return \""+mn+"\";"); writeln(" }"); writeln(tab2+"return \"\";"); writeln(tab+"}") ### Generate the MaxValue method writeln(tab+"std::string MaxValue(std::string nm) {") estr = "" for p in params: name = p["name"] typ = p["type"] mx = p["max"] write(tab2+estr+"if ( nm == \""+name+"\" ) { ") if typ == "double": write("return \""+mx+"\";"); elif typ == "int": write("return \""+mx+"\";"); elif typ == "bool": write("return \"true\";"); elif typ == "string": write("return \""+mx+"\";"); writeln(" }"); writeln(tab2+"return \"\";"); writeln(tab+"}") ### Generate the Toggle method writeln(tab+"void Toggle(std::string nm) {") writeln(tab2+"bool stringval = false;") estr = "" for p in params: name = p["name"] typ = p["type"] if typ == "bool": writeln(tab2+estr+"if ( nm == \""+name+"\" ) {") writeln(tab3+name+".set( ! "+name+".get());") writeln(tab2+"}") estr = "else " writeln(tab+"}") ### Generate the Get method writeln(tab+"std::string GetAsString(std::string nm) {") estr = "" for p in params: name = p["name"] typ = p["type"] writeln(tab2+estr+"if ( nm == \""+name+"\" ) {") if typ == "double": writeln(tab3+"return DoubleString("+name+".get());") elif typ == "int": writeln(tab3+"return IntString("+name+".get());") elif typ == "bool": writeln(tab3+"return BoolString("+name+".get());") elif typ == "string": writeln(tab3+"return "+name+".get();") estr = "} else " writeln(tab2+"}") writeln(tab2+"return \"\";") writeln(tab+"}") ### Generate the GetType method writeln(tab+"std::string GetType(std::string nm) {") for p in params: name = p["name"] typ = p["type"] writeln(tab2+"if ( nm == \""+name+"\" ) { return \""+typ+"\"; }") writeln(tab2+"return \"\";") writeln(tab+"}") ### Generate the member declarations writeln("") for p in params: name = p["name"] typ = p["type"] paramtype = paramtypes[typ] writeln(tab+paramtype+" "+name+";") writeln("};") writeln("") writeln("#endif") def modtime(file): try: return os.path.getmtime(file) except: return -1 if __name__ != "__main__": print "This code needs to be invoked as a main program." sys.exit(1) if len(sys.argv) < 2: print("Usage: %s {paramlist}" % sys.argv[0]) sys.exit(1) # We expect this program to be invoked from the VizBench/bin directory # so everything can be full paths without depending on environment variables paramdir = "../src/params" if not os.path.isdir(paramdir): print("No directory "+paramdir+" !?") sys.exit(1) os.chdir(paramdir) force = False if len(sys.argv) > 2 and sys.argv[1] == "-f": force = True parambase = sys.argv[2] else: parambase = sys.argv[1] paramclass = parambase+"VizParams" paramlist = parambase+"VizParams.list" paramtouch = parambase+"VizParams.touch" paramnames = parambase+"VizParamsNames" file_h = parambase + "VizParams.h" file_cpp = parambase + "VizParams.cpp" changed = force or (modtime(paramlist) > modtime(paramtouch) ) or not os.path.exists(file_h) or not os.path.exists(file_cpp) if not changed: print "No change in "+paramlist sys.exit(0) do_not_edit = "/************************************************\n" \ " *\n" \ " * This file is generated from '"+paramlist+"' by genparams.py\n" \ " *\n" \ " * DO NOT EDIT!\n" \ " *\n" \ " ************************************************/\n"; f = open(file_h,"w") f.write(do_not_edit) sys.stdout = f params = readparams(paramlist) genparamheader(params,paramclass) f.close() f = open(file_cpp,"w") f.write(do_not_edit); sys.stdout = f genparamcpp(paramclass) f.close() def touch(filename): f = open(filename,"w") f.write("# This file exists to record the last build time\n"); f.close() touch(paramtouch)
27.458564
124
0.609557
1,308
9,940
4.610092
0.204128
0.05141
0.012935
0.025871
0.380929
0.276949
0.218905
0.182255
0.138806
0.130182
0
0.008774
0.162978
9,940
361
125
27.534626
0.715865
0.119417
0
0.506993
1
0.003497
0.321404
0.042232
0
0
0
0
0
0
null
null
0
0.01049
null
null
0.017483
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
5468626a4d8739106b686cc86e072541eeccc86e
956
py
Python
reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py
rgolubtsov/reporter-multilang
6d7e04bbd57342ea80e1beccea3c4de1b1c4e203
[ "Unlicense" ]
3
2017-04-28T16:40:22.000Z
2019-02-22T16:57:12.000Z
reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py
rgolubtsov/reporter-multilang
6d7e04bbd57342ea80e1beccea3c4de1b1c4e203
[ "Unlicense" ]
46
2017-01-17T01:10:15.000Z
2019-06-13T20:45:12.000Z
reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py
rgolubtsov/reporter-multilang
6d7e04bbd57342ea80e1beccea3c4de1b1c4e203
[ "Unlicense" ]
1
2017-07-06T14:18:55.000Z
2017-07-06T14:18:55.000Z
# -*- coding: utf-8 -*- # reporter-cli/sql-pdf/python/src/reporterprimary/__init__.py # ============================================================================= # Reporter Multilang. Version 0.5.9 # ============================================================================= # A tool to generate human-readable reports based on data from various sources # with the focus on its implementation using a series of programming languages. # ============================================================================= # Written by Radislav (Radicchio) Golubtsov, 2016-2021 # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # # (See the LICENSE file at the top of the source tree.) # # vim:set nu et ts=4 sw=4:
45.52381
79
0.561715
115
956
4.634783
0.808696
0.022514
0
0
0
0
0
0
0
0
0
0.016807
0.128661
956
20
80
47.8
0.623049
0.957113
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
547d39324fd1deeba259dcc2ee665fe787ad6b6c
1,055
py
Python
sphecius/ciphers/base.py
douglasdaly/sphecius
df8fc8dd2add157c6360c2b66cb22ac6f0241051
[ "MIT" ]
1
2019-09-26T01:08:20.000Z
2019-09-26T01:08:20.000Z
sphecius/ciphers/base.py
douglasdaly/sphecius
df8fc8dd2add157c6360c2b66cb22ac6f0241051
[ "MIT" ]
null
null
null
sphecius/ciphers/base.py
douglasdaly/sphecius
df8fc8dd2add157c6360c2b66cb22ac6f0241051
[ "MIT" ]
1
2019-09-26T01:08:19.000Z
2019-09-26T01:08:19.000Z
# -*- coding: utf-8 -*- """ base.py Base Cipher Object class @author: Douglas Daly @date: 1/12/2017 """ # # Imports # from abc import ABCMeta, abstractmethod from ..alphabets import English # # Classes # class Cipher(object, metaclass=ABCMeta): """ Base Cipher Class """ def __init__(self, alphabet=English): """ Default Constructor """ self._alphabet = alphabet self._key = None def set_key(self, key): """ Sets the Key for this Cipher object :param str key: Key for this Cipher object """ self._key = key.upper() @abstractmethod def encrypt(self, plaintext): """ Abstract Encrypt Method :param str plaintext: Text to encrypt :returns: Encrypted text :rtype: str """ pass @abstractmethod def decrypt(self, ciphertext): """ Abstract Decrypt Method :param str ciphertext: Text to decrypt :returns: Decrypted text :rtype: str """ pass
16.484375
50
0.57346
112
1,055
5.330357
0.482143
0.080402
0.033501
0.053601
0.073702
0
0
0
0
0
0
0.01122
0.324171
1,055
63
51
16.746032
0.826087
0.42654
0
0.285714
0
0
0
0
0
0
0
0
0
1
0.285714
false
0.142857
0.142857
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
54835562ea5262f2ee7bb00d7ceac361aa51a6f1
226
py
Python
lnd/utils.py
gsmadi/lightningpy
14f4cc2dd5eb8726a06db8798944302974b890aa
[ "MIT" ]
null
null
null
lnd/utils.py
gsmadi/lightningpy
14f4cc2dd5eb8726a06db8798944302974b890aa
[ "MIT" ]
3
2019-08-21T11:51:52.000Z
2019-10-07T11:51:45.000Z
lnd/utils.py
smadici-labs/pylnd
14f4cc2dd5eb8726a06db8798944302974b890aa
[ "MIT" ]
null
null
null
import codecs def encode_macaroon(macaroon): encoded_macaroon = codecs.encode(macaroon, 'hex') return encoded_macaroon def read_file(file_path): opened_file = open(file_path, 'rb').read() return opened_file
20.545455
53
0.738938
30
226
5.3
0.466667
0.176101
0
0
0
0
0
0
0
0
0
0
0.163717
226
11
54
20.545455
0.84127
0
0
0
0
0
0.022026
0
0
0
0
0
0
1
0.285714
false
0
0.142857
0
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
5497dc6a086f32d3001f4b0c68ed070534942148
179
py
Python
tests/_compat.py
lanius/hunk
bba04d9fb7f37c378ea41bc934c3a02401e34fe6
[ "MIT" ]
1
2015-04-03T08:35:41.000Z
2015-04-03T08:35:41.000Z
tests/_compat.py
lanius/hunk
bba04d9fb7f37c378ea41bc934c3a02401e34fe6
[ "MIT" ]
null
null
null
tests/_compat.py
lanius/hunk
bba04d9fb7f37c378ea41bc934c3a02401e34fe6
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import sys PY2 = sys.version_info[0] == 2 if not PY2: json_text = lambda rv: rv.data.decode(rv.charset) else: json_text = lambda rv: rv.data
12.785714
53
0.625698
30
179
3.633333
0.666667
0.146789
0.256881
0.293578
0.40367
0.40367
0
0
0
0
0
0.035971
0.223464
179
13
54
13.769231
0.748201
0.117318
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
54990a8312bff53b0e8f90e7a2361334c451c834
1,625
py
Python
osbot_aws/helpers/IAM_Policy.py
artem7902/OSBot-AWS
4b676b8323f18d3d9809d41263f3a71745ec2828
[ "Apache-2.0" ]
null
null
null
osbot_aws/helpers/IAM_Policy.py
artem7902/OSBot-AWS
4b676b8323f18d3d9809d41263f3a71745ec2828
[ "Apache-2.0" ]
null
null
null
osbot_aws/helpers/IAM_Policy.py
artem7902/OSBot-AWS
4b676b8323f18d3d9809d41263f3a71745ec2828
[ "Apache-2.0" ]
null
null
null
from osbot_aws.apis.IAM import IAM class IAM_Policy: def __init__(self, policy_name=None, policy_path=None): self.iam = IAM() self.policy_name = policy_name self.version = "2012-10-17" self.statements = [] self.policy_path = policy_path self.account_id = self.iam.account_id() def add_cloud_watch(self, resource_arn): return self.add_statement_allow(["logs:CreateLogGroup","logs:CreateLogStream","logs:PutLogEvents"], [resource_arn]) def add_statement(self, effect, actions, resources): self.statements.append({"Effect" : effect , "Action" : actions , "Resource" : resources}) return self def add_statement_allow(self, actions, resources): return self.add_statement('Allow', actions,resources) def create(self,delete_before_create=False): if self.policy_name is None: return {'status':'error', 'data':'policy name is None'} return self.iam.policy_create(self.policy_name, self.statement(), delete_before_create=delete_before_create) def delete(self): return self.iam.policy_delete(self.policy_arn()) def exists(self): return self.iam.policy_exists(self.policy_arn()) def policy_arn(self): return self.iam.policy_arn(self.policy_name, self.policy_path, self.account_id) def statement(self): return { 'Version' : self.version , 'Statement': self.statements} def statement_from_aws(self): return self.iam.policy_statement(self.policy_arn())
36.111111
123
0.649846
198
1,625
5.10101
0.242424
0.09901
0.069307
0.094059
0.233663
0
0
0
0
0
0
0.006478
0.24
1,625
44
124
36.931818
0.811336
0
0
0
0
0
0.086823
0
0
0
0
0
0
1
0.3125
false
0
0.03125
0.21875
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
0
0
0
1
0
0
0
1
0
0
0
2
549ee02e71d944702ec6c3b3ab3e03cf388c6552
458
py
Python
tests/test_eeg.py
y1ngyang/NeuroKit.py
867655f84bf210626649bca72258af6a2b5a2791
[ "MIT" ]
null
null
null
tests/test_eeg.py
y1ngyang/NeuroKit.py
867655f84bf210626649bca72258af6a2b5a2791
[ "MIT" ]
null
null
null
tests/test_eeg.py
y1ngyang/NeuroKit.py
867655f84bf210626649bca72258af6a2b5a2791
[ "MIT" ]
null
null
null
import pytest import doctest import os import numpy as np import pandas as pd import neurokit as nk run_tests_in_local = False #============================================================================== # data #============================================================================== #def test_read_acqknowledge(): # # assert 3 == 3 if __name__ == '__main__': # nose.run(defaultTest=__name__) doctest.testmod() pytest.main()
16.962963
79
0.458515
42
458
4.595238
0.690476
0
0
0
0
0
0
0
0
0
0
0.005076
0.139738
458
26
80
17.615385
0.484772
0.526201
0
0
0
0
0.038278
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
54a4f81f72eecfec1f015beea32efd5b9edfa7de
168
py
Python
Curso-em-video-Python3-mundo1/ex024.py
bernardombraga/Solucoes-exercicios-cursos-gratuitos
0347a8325443fce84e0a753c96f523a22858537b
[ "MIT" ]
null
null
null
Curso-em-video-Python3-mundo1/ex024.py
bernardombraga/Solucoes-exercicios-cursos-gratuitos
0347a8325443fce84e0a753c96f523a22858537b
[ "MIT" ]
null
null
null
Curso-em-video-Python3-mundo1/ex024.py
bernardombraga/Solucoes-exercicios-cursos-gratuitos
0347a8325443fce84e0a753c96f523a22858537b
[ "MIT" ]
null
null
null
entrada = str(input('Em que cidade você nasceu? ')) cidade = entrada.strip().lower() partido = cidade.split() pnome = partido[0] santo = (pnome == 'santo') print(santo)
28
51
0.684524
23
168
5
0.695652
0
0
0
0
0
0
0
0
0
0
0.006849
0.130952
168
6
52
28
0.780822
0
0
0
0
0
0.189349
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
54b1f3e83d93705cfe337ba5f02b4044fdd2e4b8
70
py
Python
decimal to binary.py
Kshitijkrishnadas/haribol
ca45e633baaabaad3bb923f5633340ccf88d996c
[ "bzip2-1.0.6" ]
null
null
null
decimal to binary.py
Kshitijkrishnadas/haribol
ca45e633baaabaad3bb923f5633340ccf88d996c
[ "bzip2-1.0.6" ]
null
null
null
decimal to binary.py
Kshitijkrishnadas/haribol
ca45e633baaabaad3bb923f5633340ccf88d996c
[ "bzip2-1.0.6" ]
null
null
null
a='' n=int(input()) while n != 0: a=str(n%2)+a n//=2 print(a)
10
16
0.457143
16
70
2
0.5625
0.125
0
0
0
0
0
0
0
0
0
0.056604
0.242857
70
6
17
11.666667
0.54717
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
49a800c2275f46ea1981d8aa809ee37691f78025
1,330
py
Python
lottery/branch/retrain.py
chenw23/open_lth
2ce732fe48abd5a80c10a153c45d397b048e980c
[ "MIT" ]
509
2020-05-07T16:45:46.000Z
2022-03-28T13:41:36.000Z
lottery/branch/retrain.py
chenw23/open_lth
2ce732fe48abd5a80c10a153c45d397b048e980c
[ "MIT" ]
12
2020-06-10T10:07:09.000Z
2022-02-03T01:57:32.000Z
lottery/branch/retrain.py
chenw23/open_lth
2ce732fe48abd5a80c10a153c45d397b048e980c
[ "MIT" ]
103
2020-05-07T21:40:06.000Z
2022-03-11T19:07:55.000Z
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import datasets.registry from foundations import hparams from foundations.step import Step from lottery.branch import base import models.registry from pruning.mask import Mask from pruning.pruned_model import PrunedModel from training import train class Branch(base.Branch): def branch_function( self, retrain_d: hparams.DatasetHparams, retrain_t: hparams.TrainingHparams, start_at_step_zero: bool = False ): # Get the mask and model. m = models.registry.load(self.level_root, self.lottery_desc.train_start_step, self.lottery_desc.model_hparams) m = PrunedModel(m, Mask.load(self.level_root)) start_step = Step.from_iteration(0 if start_at_step_zero else self.lottery_desc.train_start_step.iteration, datasets.registry.iterations_per_epoch(retrain_d)) train.standard_train(m, self.branch_root, retrain_d, retrain_t, start_step=start_step, verbose=self.verbose) @staticmethod def description(): return "Retrain the model with different hyperparameters." @staticmethod def name(): return 'retrain'
35.945946
118
0.72406
176
1,330
5.295455
0.431818
0.048283
0.048283
0.032189
0.062232
0.062232
0
0
0
0
0
0.00095
0.208271
1,330
36
119
36.944444
0.884141
0.144361
0
0.076923
0
0
0.049426
0
0
0
0
0
0
1
0.115385
false
0
0.307692
0.076923
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
49abd960ef01b21e1a602cfce947ec5f7f32f14e
3,182
py
Python
pychron/processing/analysis_graph.py
aelamspychron/pychron
ad87c22b0817c739c7823a24585053041ee339d5
[ "Apache-2.0" ]
null
null
null
pychron/processing/analysis_graph.py
aelamspychron/pychron
ad87c22b0817c739c7823a24585053041ee339d5
[ "Apache-2.0" ]
20
2020-09-09T20:58:39.000Z
2021-10-05T17:48:37.000Z
pychron/processing/analysis_graph.py
aelamspychron/pychron
ad87c22b0817c739c7823a24585053041ee339d5
[ "Apache-2.0" ]
null
null
null
# =============================================================================== # Copyright 2013 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # =============================================================================== # ============= enthought library imports ======================= from __future__ import absolute_import from traits.api import Event # ============= standard library imports ======================== # ============= local library imports ========================== from pychron.graph.graph import Graph from pychron.graph.stacked_graph import StackedGraph from pychron.graph.stacked_regression_graph import StackedRegressionGraph class AnalysisGraph(Graph): rescale_event = Event figure_event = Event def get_rescale_actions(self): return [('Valid Analyses', 'rescale_to_valid', {})] def rescale_to_valid(self): self.rescale_event = 'valid' def rescale_x_axis(self): self.rescale_event = 'x' def rescale_y_axis(self): self.rescale_event = 'y' class AnalysisStackedGraph(AnalysisGraph, StackedGraph): pass class AnalysisStackedRegressionGraph(AnalysisGraph, StackedRegressionGraph): pass class SpectrumGraph(AnalysisStackedGraph): # make_alternate_figure_event = Event def get_child_context_menu_actions(self): return [self.action_factory('Ideogram...', 'make_ideogram'), self.action_factory('Inverse Isochron...', 'make_inverse_isochron'), self.action_factory('Tag Non Plateau...', 'tag_non_plateau')] def tag_non_plateau(self): self.figure_event = ('tag', 'tag_non_plateau') def make_ideogram(self): self.figure_event = 'alternate_figure', 'Ideogram' def make_inverse_isochron(self): self.figure_event = 'alternate_figure', 'InverseIsochron' class IdeogramGraph(AnalysisStackedGraph): def get_child_context_menu_actions(self): return [self.action_factory('Correlation...', 'make_correlation'), self.action_factory('Identify Peaks', 'identify_peaks')] def make_correlation(self): self.figure_event = ('correlation', (self.selected_plotid, self.selected_plot.y_axis.title)) def identify_peaks(self): self.figure_event = ('identify_peaks', None) class ReferencesGraph(AnalysisStackedRegressionGraph): def get_child_context_menu_actions(self): return [self.action_factory('Correlation...', 'make_correlation')] def make_correlation(self): self.figure_event = ('correlation', (self.selected_plot, self.selected_plot.y_axis.title)) # ============= EOF =============================================
33.851064
100
0.653363
345
3,182
5.802899
0.35942
0.035964
0.050949
0.056943
0.272727
0.22977
0.16983
0.16983
0.16983
0.16983
0
0.002992
0.159648
3,182
93
101
34.215054
0.745699
0.313011
0
0.159091
0
0
0.152887
0.0097
0
0
0
0
0
1
0.295455
false
0.045455
0.113636
0.090909
0.681818
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
49b84672d25848b03244c392641967f515178752
1,395
py
Python
examples/tx_rpc_client_ssl.py
jakm/txmsgpackrpc
9ff15fd7a7cd412d246d4e4937a5c56365f0d6be
[ "MIT" ]
18
2015-01-19T15:27:02.000Z
2018-12-29T17:30:36.000Z
examples/tx_rpc_client_ssl.py
jakm/txmsgpackrpc
9ff15fd7a7cd412d246d4e4937a5c56365f0d6be
[ "MIT" ]
6
2015-05-27T11:28:18.000Z
2016-12-19T06:35:55.000Z
examples/tx_rpc_client_ssl.py
jakm/txmsgpackrpc
9ff15fd7a7cd412d246d4e4937a5c56365f0d6be
[ "MIT" ]
4
2015-03-24T22:18:27.000Z
2018-02-05T18:12:45.000Z
from twisted.internet import defer, reactor @defer.inlineCallbacks def main(): try: from txmsgpackrpc.client import connect c = yield connect('localhost', 8000, ssl=True, connectTimeout=5, waitTimeout=5) data = { 'firstName': 'John', 'lastName': 'Smith', 'isAlive': True, 'age': 25, 'height_cm': 167.6, 'address': { 'streetAddress': "21 2nd Street", "city": 'New York', "state": 'NY', 'postalCode': '10021-3100' }, 'phoneNumbers': [ { 'type': 'home', 'number': '212 555-1234' }, { 'type': 'office', 'number': '646 555-4567' } ], 'children': [], 'spouse': None } res = yield c.createRequest('echo', data) assert data == res print res except Exception: import traceback traceback.print_exc() finally: reactor.stop() if __name__ == '__main__': reactor.callWhenRunning(main) reactor.run()
27.352941
87
0.387097
98
1,395
5.408163
0.765306
0.041509
0
0
0
0
0
0
0
0
0
0.063676
0.50466
1,395
50
88
27.9
0.703329
0
0
0
0
0
0.156272
0
0
0
0
0
0.02381
0
null
null
0
0.071429
null
null
0.047619
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
1
0
0
0
0
0
0
0
0
2
49c52e67e91490b5205014ce1748575c1b06124d
9,647
py
Python
ocradmin/lib/fcrepo/http/interfaces.py
mikesname/ocropodium
a3e379cca38dc1999349bf4e9b5608e81dc54b10
[ "Apache-2.0" ]
2
2015-03-30T16:36:51.000Z
2016-06-15T01:39:47.000Z
ocradmin/lib/fcrepo/http/interfaces.py
mikesname/ocropodium
a3e379cca38dc1999349bf4e9b5608e81dc54b10
[ "Apache-2.0" ]
2
2021-06-10T17:43:54.000Z
2021-12-13T19:40:08.000Z
ocradmin/lib/fcrepo/http/interfaces.py
mikesname/ocropodium
a3e379cca38dc1999349bf4e9b5608e81dc54b10
[ "Apache-2.0" ]
1
2015-11-08T00:40:11.000Z
2015-11-08T00:40:11.000Z
""" Interfaces for FCRepoRequestFactory, FCRepoResponse and FCRepoResponseBody. """ from exceptions import NotImplementedError # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class I_FCRepoResponseBody: def __init__(self, raw_content, mime_type): """ Constructor takes tow arguments : raw_content = raw body content (Base64 encoded). mime_type = MimeTyoe of the body content. """ raise NotImplementedError def getContent(self): """ Returns the reponse body properly formatted for the MimeType. """ raise NotImplementedError def getMimeType(self): """ Returns the MimeType of the body content. """ raise NotImplementedError def getRawData(self): """ Returns the raw response body (Base64 encoded). """ raise NotImplementedError # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class I_FCRepoResponse: def __init__(self): # init method args are implementation-dependent pass def getBody(self): """ Provides accces to body content enclosed in the response """ raise NotImplementedError def getFooter(self, name, default): """ Returns value of a response footer parameter. Takes two arguments: name = name of the parameter default = default value to be returned when parameter is NOT in the footer. """ raise NotImplementedError def getFooters(self): """ Returns all response footer parameters as a Python dictionary. """ raise NotImplementedError def getHeader(self, name, default): """ Returns value of a response header parameter. Takes two arguments: name = name of the parameter default = default value to be returned when parameter is NOT in the header. """ raise NotImplementedError def getHeaders(self): """ Returns all response header parameters as a Python dictionary. """ raise NotImplementedError def getStatus(self): """ Returns the HTTP status code returned for the request. """ raise NotImplementedError def getRequestMethod(self): """ Returns the name of the HTTP method used for the request. """ raise NotImplementedError def getRequestURI(self): """ Returns the complete escaped URI used for the request. """ raise NotImplementedError def getRequest(self): """ Returns the reguest method and the complete escaped request URI as a single string. """ raise NotImplementedError # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # class I_FCRepoRequestFactory: def __init__(self, repository_url, username, password, realm='any'): """ Requires at least four arguments: repository_url = the base URL for the Fedora Repository including the protocol, domain, port, and context. username = name of a user that is authorized to perform requests using the Fedora REST API. password = password for the authorized user. realm = authorization realm, must ak=llow the string 'any' to designate that authentication is valid for anty realm. """ raise NotImplementedError # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def DELETE(self, request_uri): """ Submits a DELETE request for the requested URI. Takes a single argument: request_uri = the query portion of the DELETE request i.e. the URL for the request without the protocol, domain, port and context of the Fedora Repository. Returns results of the request as a FCRepoResponse object. """ raise NotImplementedError def GET(self, request_uri): """ Submits a GET request for the requested URI Takes a single argument: request_uri = the query portion of the DELETE request i.e. the URL for the request without the protocol, domain, port and context of the Fedora Repository. """ raise NotImplementedError def POST(self, request_uri, content=None, chunked=False): """ Submits a POST request for the requested URI Takes a three arguments: request_uri = the query portion of the DELETE request i.e. the URL for the request without the protocol, domain, port and context of the Fedora Repository. content = contet to be include in POST request (if any) chunked = boolean indiciating whether contant is to be provided in chunks. """ raise NotImplementedError def PUT(self, request_uri, content=None, chunked=False): """ Submits a PUT request for the requested URI Takes a three arguments: request_uri = the query portion of the DELETE request i.e. the URL for the request without the protocol, domain, port and context of the Fedora Repository. content = contet to be include in POST request (if any) chunked = boolean indiciating whether contant is to be provided in chunks. """ raise NotImplementedError # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def getAuthPassword(self): """ Returns current value of password to be used for authenticating access to the Fedora Repository (as set in the constructor or by the setAuthPassword method). """ raise NotImplementedError def getAuthRealm(self): """ Returns current value of realm to be used for authenticating access to the Fedora Repository (as set in the constructor or by the setAuthRealm method). """ raise NotImplementedError def getAuthUser(self): """ Returns current value of the username to be used for authenticating access to the Fedora Repository (as set in the constructor or by the setAuthUser method). """ raise NotImplementedError def getContext(self): """ Returns current value of the context to be used for accesssing the Fedora Repository (as initialized by the constructor or set by the setContext method). """ raise NotImplementedError def getDomain(self): """ Returns current value of the internat domain to be used for accesssing the Fedora Repository (as initialized by the constructor or set by the setDomain method). """ raise NotImplementedError def getPort(self): """ Returns current value of the port to be used for accesssing the Fedora Repository (as initialized by the constructor or set by the setPort method). """ raise NotImplementedError def getProtocol(self): """ Returns current value of the HTTP protocol to be used for accesssing the Fedora Repository (as initialized by the constructor or set by the setProtocol method). """ raise NotImplementedError def getRepositoryURL(self): """ Returns current value of the root URL to be used for accesssing the Fedora Repository. It is constructed from the current values of the HTTP protocol, repository domain name, port number and repository context. """ raise NotImplementedError def getLastRequest(self): """ Returns a string representing the last HTTP Request that was submitted by the factory. It will include the HTTP method and the URL submitted. PUT and POST request strings will NOT include the content submitted with the request. """ raise NotImplementedError # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def setAuthPassword(self, password): """ Changes the value of the password to be used for authenticating access to the Fedora Repository. """ raise NotImplementedError def setAuthRealm(self, realm): """ Changes the value of the realm to be used for authenticating access to the Fedora Repository. """ raise NotImplementedError def setAuthUser(self, username): """ Changes the name of the user to be used for authenticating access to the Fedora Repository. """ raise NotImplementedError def setContext(self, context): """ Changes the value of the context to be used for accessing the Fedora Repository. """ raise NotImplementedError def setDomain(self, url): """ Changes the value of the domain to be used for accesssing the Fedora Repository. """ raise NotImplementedError def setPort(self, port): """ Changes the value of the port used to be used for accesssing the Fedora Repository. """ raise NotImplementedError def setProtocol(self, protocol): """ Changes the value of the HTTP protocol to be used for accesssing the Fedora Repository. """ raise NotImplementedError
35.996269
79
0.59604
1,027
9,647
5.570594
0.182084
0.142632
0.146303
0.028841
0.571404
0.531026
0.479986
0.449572
0.401853
0.384024
0
0.00062
0.330984
9,647
267
80
36.131086
0.885807
0.584223
0
0.459459
0
0
0.001053
0
0
0
0
0
0
1
0.472973
false
0.054054
0.013514
0
0.527027
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
49c885495b8b9d85f2a2df00b05e024d355e6e0a
1,463
py
Python
analytics/utils.py
educreations/py-analytics
abbc814925c6cc200b3329c7de9f1868e1cb8c01
[ "Apache-2.0" ]
10
2015-01-25T20:29:55.000Z
2020-12-08T21:35:09.000Z
analytics/utils.py
educreations/py-analytics
abbc814925c6cc200b3329c7de9f1868e1cb8c01
[ "Apache-2.0" ]
3
2018-05-15T06:28:20.000Z
2021-03-30T17:47:45.000Z
analytics/utils.py
educreations/py-analytics
abbc814925c6cc200b3329c7de9f1868e1cb8c01
[ "Apache-2.0" ]
6
2017-07-03T16:28:29.000Z
2020-06-15T19:10:45.000Z
""" Copyright 2012 Numan Sachwani <numan@7Geese.com> This file is provided to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ # import_string comes form Werkzeug # http://werkzeug.pocoo.org def import_string(import_name, silent=False): """Imports an object based on a string. If *silent* is True the return value will be None if the import fails. Simplified version of the function with same name from `Werkzeug`_. :param import_name: The dotted name for the object to import. :param silent: If True, import errors are ignored and None is returned instead. :returns: The imported object. """ import_name = str(import_name) try: if '.' in import_name: module, obj = import_name.rsplit('.', 1) return getattr(__import__(module, None, None, [obj]), obj) else: return __import__(import_name) except (ImportError, AttributeError): if not silent: raise
32.511111
74
0.699932
209
1,463
4.813397
0.526316
0.069583
0.025845
0.031809
0
0
0
0
0
0
0
0.008865
0.228982
1,463
44
75
33.25
0.882979
0.695147
0
0
0
0
0.005063
0
0
0
0
0
0
1
0.090909
false
0
0.636364
0
0.909091
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
49cfbdd139a2858864f15766804aa976f1344306
6,456
py
Python
room/easyctf/exploit/46635.py
danieldavidson/tryhackme-ctf
f42362609ffb72151f7056371e6ad7207e42c8c5
[ "MIT" ]
null
null
null
room/easyctf/exploit/46635.py
danieldavidson/tryhackme-ctf
f42362609ffb72151f7056371e6ad7207e42c8c5
[ "MIT" ]
null
null
null
room/easyctf/exploit/46635.py
danieldavidson/tryhackme-ctf
f42362609ffb72151f7056371e6ad7207e42c8c5
[ "MIT" ]
1
2022-03-11T22:55:33.000Z
2022-03-11T22:55:33.000Z
#!/usr/bin/env python # Exploit Title: Unauthenticated SQL Injection on CMS Made Simple <= 2.2.9 # Date: 30-03-2019 # Exploit Author: Daniele Scanu @ Certimeter Group # Vendor Homepage: https://www.cmsmadesimple.org/ # Software Link: https://www.cmsmadesimple.org/downloads/cmsms/ # Version: <= 2.2.9 # Tested on: Ubuntu 18.04 LTS # CVE : CVE-2019-9053 import requests from termcolor import colored import time from termcolor import cprint import optparse import hashlib parser = optparse.OptionParser() parser.add_option('-u', '--url', action="store", dest="url", help="Base target uri (ex. http://10.10.10.100/cms)") parser.add_option('-w', '--wordlist', action="store", dest="wordlist", help="Wordlist for crack admin password") parser.add_option('-c', '--crack', action="store_true", dest="cracking", help="Crack password with wordlist", default=False) options, args = parser.parse_args() if not options.url: print "[+] Specify an url target" print "[+] Example usage (no cracking password): exploit.py -u http://target-uri" print "[+] Example usage (with cracking password): exploit.py -u http://target-uri --crack -w /path-wordlist" print "[+] Setup the variable TIME with an appropriate time, because this sql injection is a time based." exit() url_vuln = options.url + '/moduleinterface.php?mact=News,m1_,default,0' session = requests.Session() dictionary = '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM@._-$' flag = True password = "" temp_password = "" TIME = 1 db_name = "" output = "" email = "" salt = '' wordlist = "" if options.wordlist: wordlist += options.wordlist def crack_password(): global password global output global wordlist global salt dict = open(wordlist) for line in dict.readlines(): line = line.replace("\n", "") beautify_print_try(line) if hashlib.md5(str(salt) + line).hexdigest() == password: output += "\n[+] Password cracked: " + line break dict.close() def beautify_print_try(value): global output print "\033c" cprint(output,'green', attrs=['bold']) cprint('[*] Try: ' + value, 'red', attrs=['bold']) def beautify_print(): global output print "\033c" cprint(output,'green', attrs=['bold']) def dump_salt(): global flag global salt global output ord_salt = "" ord_salt_temp = "" while flag: flag = False for i in range(0, len(dictionary)): temp_salt = salt + dictionary[i] ord_salt_temp = ord_salt + hex(ord(dictionary[i]))[2:] beautify_print_try(temp_salt) payload = "a,b,1,5))+and+(select+sleep(" + str(TIME) + ")+from+cms_siteprefs+where+sitepref_value+like+0x" + ord_salt_temp + "25+and+sitepref_name+like+0x736974656d61736b)+--+" url = url_vuln + "&m1_idlist=" + payload start_time = time.time() r = session.get(url) elapsed_time = time.time() - start_time if elapsed_time >= TIME: flag = True break if flag: salt = temp_salt ord_salt = ord_salt_temp flag = True output += '\n[+] Salt for password found: ' + salt def dump_password(): global flag global password global output ord_password = "" ord_password_temp = "" while flag: flag = False for i in range(0, len(dictionary)): temp_password = password + dictionary[i] ord_password_temp = ord_password + hex(ord(dictionary[i]))[2:] beautify_print_try(temp_password) payload = "a,b,1,5))+and+(select+sleep(" + str(TIME) + ")+from+cms_users" payload += "+where+password+like+0x" + ord_password_temp + "25+and+user_id+like+0x31)+--+" url = url_vuln + "&m1_idlist=" + payload start_time = time.time() r = session.get(url) elapsed_time = time.time() - start_time if elapsed_time >= TIME: flag = True break if flag: password = temp_password ord_password = ord_password_temp flag = True output += '\n[+] Password found: ' + password def dump_username(): global flag global db_name global output ord_db_name = "" ord_db_name_temp = "" while flag: flag = False for i in range(0, len(dictionary)): temp_db_name = db_name + dictionary[i] ord_db_name_temp = ord_db_name + hex(ord(dictionary[i]))[2:] beautify_print_try(temp_db_name) payload = "a,b,1,5))+and+(select+sleep(" + str(TIME) + ")+from+cms_users+where+username+like+0x" + ord_db_name_temp + "25+and+user_id+like+0x31)+--+" url = url_vuln + "&m1_idlist=" + payload start_time = time.time() r = session.get(url) elapsed_time = time.time() - start_time if elapsed_time >= TIME: flag = True break if flag: db_name = temp_db_name ord_db_name = ord_db_name_temp output += '\n[+] Username found: ' + db_name flag = True def dump_email(): global flag global email global output ord_email = "" ord_email_temp = "" while flag: flag = False for i in range(0, len(dictionary)): temp_email = email + dictionary[i] ord_email_temp = ord_email + hex(ord(dictionary[i]))[2:] beautify_print_try(temp_email) payload = "a,b,1,5))+and+(select+sleep(" + str(TIME) + ")+from+cms_users+where+email+like+0x" + ord_email_temp + "25+and+user_id+like+0x31)+--+" url = url_vuln + "&m1_idlist=" + payload start_time = time.time() r = session.get(url) elapsed_time = time.time() - start_time if elapsed_time >= TIME: flag = True break if flag: email = temp_email ord_email = ord_email_temp output += '\n[+] Email found: ' + email flag = True dump_salt() dump_username() dump_email() dump_password() if options.cracking: print colored("[*] Now try to crack password") crack_password() beautify_print()
34.709677
189
0.586431
795
6,456
4.589937
0.222642
0.043848
0.026309
0.018635
0.397369
0.355714
0.355714
0.344752
0.323376
0.255961
0
0.024167
0.288569
6,456
186
190
34.709677
0.770303
0.05189
0
0.425926
0
0.006173
0.207153
0.085358
0
0
0.005061
0
0
0
null
null
0.154321
0.037037
null
null
0.117284
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
49e3eb2356e1b76dcdb5820a9f4030de1c698ff6
1,510
py
Python
nitmis_admin/controllers/register.py
kalesh13/nitmis
b8c73f74411bbad441557c6553cbbd35acc5a5ee
[ "MIT" ]
null
null
null
nitmis_admin/controllers/register.py
kalesh13/nitmis
b8c73f74411bbad441557c6553cbbd35acc5a5ee
[ "MIT" ]
5
2020-07-19T10:28:57.000Z
2021-08-19T18:25:28.000Z
nitmis_admin/controllers/register.py
kalesh13/nitmis
b8c73f74411bbad441557c6553cbbd35acc5a5ee
[ "MIT" ]
null
null
null
from rest_framework.views import APIView from rest_framework.response import Response from django.shortcuts import render from django.http.response import JsonResponse from nitmis_admin.serializers.UserSerializer import UserSerializer def create_user(role="Guest"): """ """ def fun_wrapper(func): def wrapper(*args, **kwargs): serializer = UserSerializer(data=args[1].data) # # If the data is valid, create a new user # and return the access token details. if serializer.is_valid(): serializer.save(role=role) return JsonResponse(serializer.data) return JsonResponse({"errors": serializer.errors}, status=422) return wrapper return fun_wrapper class Register(APIView): ''' Parent register controller. Post requests create a general Guest account ''' def get(self, request): ''' Renders the base layout on GET request. Frontend handles the rendering of forms ''' return render(request, 'base.html') @create_user() def post(self, request): ''' Registers a new user and assigns the user a Guest role. ''' class AdminRegister(Register): ''' Register controller for administrators. ''' @create_user(role="Administrator") def post(self, request): ''' Overriden post function. Registers the user as an administrator '''
26.491228
74
0.625828
164
1,510
5.707317
0.457317
0.032051
0.036325
0.023504
0
0
0
0
0
0
0
0.003721
0.288079
1,510
56
75
26.964286
0.866977
0.261589
0
0.086957
0
0
0.033708
0
0
0
0
0
0
1
0.26087
false
0
0.217391
0
0.782609
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
49ebafbb9bb001087a55a6aebb22dbde9671371c
271
py
Python
{{cookiecutter.project_name}}/pages/main_page.py
victory-sokolov/selenium-boilerplate
43ac0e37c93c6379186f06050ab29e8521ac3ad1
[ "MIT" ]
null
null
null
{{cookiecutter.project_name}}/pages/main_page.py
victory-sokolov/selenium-boilerplate
43ac0e37c93c6379186f06050ab29e8521ac3ad1
[ "MIT" ]
null
null
null
{{cookiecutter.project_name}}/pages/main_page.py
victory-sokolov/selenium-boilerplate
43ac0e37c93c6379186f06050ab29e8521ac3ad1
[ "MIT" ]
null
null
null
from utils.Driver import Driver from pages.base_page import BasePage from pages.locators import MainPageLocators class MainPage(BasePage): def __init__(self, driver: Driver): self.locators = MainPageLocators super().__init__(driver=driver)
27.1
44
0.734317
31
271
6.129032
0.516129
0.094737
0
0
0
0
0
0
0
0
0
0
0.195572
271
10
45
27.1
0.87156
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
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
49f718d53ef81854c33add0bb6b608250490d75e
798
py
Python
saq/utils.py
cofin/saq
be81f383a0904e9084e24ccb5334e07fc5b61e00
[ "MIT" ]
29
2022-01-05T07:07:18.000Z
2022-03-29T20:09:03.000Z
saq/utils.py
cofin/saq
be81f383a0904e9084e24ccb5334e07fc5b61e00
[ "MIT" ]
3
2022-01-23T17:33:40.000Z
2022-03-10T03:36:21.000Z
saq/utils.py
cofin/saq
be81f383a0904e9084e24ccb5334e07fc5b61e00
[ "MIT" ]
4
2022-01-06T18:33:33.000Z
2022-03-23T18:44:19.000Z
import time import uuid from random import random def now(): return int(time.time() * 1000) def uuid1(): return str(uuid.uuid1()) def millis(s): return s * 1000 def seconds(ms): return ms / 1000 def exponential_backoff( attempts, base_delay, max_delay=None, jitter=True, ): """ Get the next delay for retries in exponential backoff. attempts: Number of attempts so far base_delay: Base delay, in seconds max_delay: Max delay, in seconds. If None (default), there is no max. jitter: If True, add a random jitter to the delay """ if max_delay is None: max_delay = float("inf") backoff = min(max_delay, base_delay * 2 ** max(attempts - 1, 0)) if jitter: backoff = backoff * random() return backoff
19
73
0.641604
115
798
4.373913
0.426087
0.095427
0.10338
0
0
0
0
0
0
0
0
0.028961
0.264411
798
41
74
19.463415
0.827939
0.308271
0
0
0
0
0.005769
0
0
0
0
0
0
1
0.217391
false
0
0.130435
0.173913
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
1
0
0
0
1
0
0
0
2
49fe4d073489d2871ae5e7fb65b3eed92cc792a4
372
py
Python
benchmark/info_locust.py
dmitryhd/avio
4e99c123de12a682f1ac1141899d670fbab81de6
[ "MIT" ]
2
2018-05-28T14:15:00.000Z
2018-10-15T09:33:38.000Z
benchmark/info_locust.py
dmitryhd/avio
4e99c123de12a682f1ac1141899d670fbab81de6
[ "MIT" ]
null
null
null
benchmark/info_locust.py
dmitryhd/avio
4e99c123de12a682f1ac1141899d670fbab81de6
[ "MIT" ]
null
null
null
from locust import HttpLocust, TaskSet def login(l): l.client.post("/login", {"username": "ellen_key", "password": "education"}) def info(l): l.client.get("/_info") def profile(l): l.client.get("/profile") class UserBehavior(TaskSet): tasks = {info: 1} class WebsiteUser(HttpLocust): task_set = UserBehavior min_wait = 0 max_wait = 0
15.5
79
0.647849
49
372
4.816327
0.591837
0.025424
0.101695
0.09322
0
0
0
0
0
0
0
0.010033
0.196237
372
23
80
16.173913
0.779264
0
0
0
0
0
0.145161
0
0
0
0
0
0
1
0.230769
false
0.076923
0.076923
0
0.769231
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
b70252d52453ebc8294d55dbd8e4ca2fdec3a045
338
py
Python
bluebottle/members/migrations/0028_merge_20190215_1441.py
terrameijar/bluebottle
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
[ "BSD-3-Clause" ]
10
2015-05-28T18:26:40.000Z
2021-09-06T10:07:03.000Z
bluebottle/members/migrations/0028_merge_20190215_1441.py
terrameijar/bluebottle
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
[ "BSD-3-Clause" ]
762
2015-01-15T10:00:59.000Z
2022-03-31T15:35:14.000Z
bluebottle/members/migrations/0028_merge_20190215_1441.py
terrameijar/bluebottle
b4f5ba9c4f03e678fdd36091b29240307ea69ffd
[ "BSD-3-Clause" ]
9
2015-02-20T13:19:30.000Z
2022-03-08T14:09:17.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-02-15 13:41 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('members', '0026_auto_20180919_1434'), ('members', '0027_auto_20190208_1119'), ] operations = [ ]
19.882353
48
0.662722
41
338
5.195122
0.804878
0
0
0
0
0
0
0
0
0
0
0.184211
0.213018
338
16
49
21.125
0.616541
0.201183
0
0
1
0
0.224719
0.172285
0
0
0
0
0
1
0
false
0
0.222222
0
0.555556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
b7076a862b13e824331a204380735697e0b6b508
4,158
py
Python
trabajo/Plugins/test_plugin_MontoEscrito.py
f2scali/siendo
5e3c20143317e365cfecb5b56a0f2388acc46949
[ "Apache-2.0" ]
null
null
null
trabajo/Plugins/test_plugin_MontoEscrito.py
f2scali/siendo
5e3c20143317e365cfecb5b56a0f2388acc46949
[ "Apache-2.0" ]
null
null
null
trabajo/Plugins/test_plugin_MontoEscrito.py
f2scali/siendo
5e3c20143317e365cfecb5b56a0f2388acc46949
[ "Apache-2.0" ]
1
2021-10-01T22:22:09.000Z
2021-10-01T22:22:09.000Z
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'efrenfuentes' import unittest from plugin_MontoEscrito import numero_a_letras, numero_a_moneda class TestNumeroLetras(unittest.TestCase): def test_numero_demasiado_alto(self): numero = 1000000000000 self.assertRaises(OverflowError, numero_a_letras, numero) def test_unidades(self): numero = 8 self.assertEqual(numero_a_letras(numero), 'ocho') numero = 2 self.assertEqual(numero_a_letras(numero), 'dos') numero = 0 self.assertEqual(numero_a_letras(numero), 'cero') def test_decena_diez(self): numero = 15 self.assertEqual(numero_a_letras(numero), 'quince') numero = 17 self.assertEqual(numero_a_letras(numero), 'diecisiete') numero = 19 self.assertEqual(numero_a_letras(numero), 'diecinueve') def test_decena_veinte(self): numero = 23 self.assertEqual(numero_a_letras(numero), 'veintitres') numero = 26 self.assertEqual(numero_a_letras(numero), 'veintiseis') numero = 21 self.assertEqual(numero_a_letras(numero), 'veintiuno') def test_menores_cien(self): numero = 32 self.assertEqual(numero_a_letras(numero), 'treinta y dos') numero = 73 self.assertEqual(numero_a_letras(numero), 'setenta y tres') numero = 89 self.assertEqual(numero_a_letras(numero), 'ochenta y nueve') def test_centenas(self): numero = 167 self.assertEqual(numero_a_letras(numero), 'ciento sesenta y siete') numero = 735 self.assertEqual(numero_a_letras(numero), 'setecientos treinta y cinco') numero = 899 self.assertEqual(numero_a_letras(numero), 'ochocientos noventa y nueve') def test_miles(self): numero = 1973 self.assertEqual(numero_a_letras(numero), 'mil novecientos setenta y tres') numero = 5230 self.assertEqual(numero_a_letras(numero), 'cinco mil doscientos treinta') numero = 41378 self.assertEqual(numero_a_letras(numero), 'cuarenta y un mil trescientos setenta y ocho') numero = 197356 self.assertEqual(numero_a_letras(numero), 'ciento noventa y siete mil trescientos cincuenta y seis') numero = 2004 self.assertEqual(numero_a_letras(numero), 'dos mil cuatro') def test_millones(self): numero = 11852739 self.assertEqual(numero_a_letras(numero), 'once millones ochocientos cincuenta y dos mil setecientos treinta y nueve') numero = 2000000 self.assertEqual(numero_a_letras(numero), 'dos millones') def test_millardos(self): numero = 1212673201 self.assertEqual(numero_a_letras(numero), 'mil doscientos doce millones seiscientos setenta y tres mil doscientos uno') numero = 56547567945 self.assertEqual(numero_a_letras(numero), 'cincuenta y seis mil quinientos cuarenta y siete millones quinientos sesenta y siete mil novecientos cuarenta y cinco') def test_decimales(self): numero = 1.87 self.assertEqual(numero_a_letras(numero), 'uno punto ochenta y siete') numero = 1.50 self.assertEqual(numero_a_letras(numero), 'uno punto cincuenta') numero = 1.04 self.assertEqual(numero_a_letras(numero), 'uno punto cero cuatro') numero = 1.00 self.assertEqual(numero_a_letras(numero), 'uno') def test_negativos(self): numero = -4.5 self.assertEqual(numero_a_letras(numero), 'menos cuatro punto cincuenta') def test_moneda(self): numero = 1212673201 self.assertEqual(numero_a_moneda(numero), 'mil doscientos doce millones seiscientos setenta y tres mil doscientos un pesos con cero centavos') numero = 56547567945.5 self.assertEqual(numero_a_moneda(numero), 'cincuenta y seis mil quinientos cuarenta y siete millones quinientos sesenta y siete mil novecientos cuarenta y cinco pesos con cincuenta centavos') numero = 1.01 self.assertEqual(numero_a_moneda(numero), 'un peso con un centavo') if __name__ == '__main__': unittest.main()
39.980769
199
0.685907
514
4,158
5.354086
0.229572
0.089026
0.244186
0.255814
0.546148
0.545422
0.300509
0.171512
0.125727
0.125727
0
0.044099
0.225589
4,158
103
200
40.368932
0.810559
0.009139
0
0.02381
0
0.011905
0.24575
0
0
0
0
0
0.392857
1
0.142857
false
0
0.02381
0
0.178571
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b72dfc9dbad5e8ddb1f77fb1efb1c89913e0c025
2,863
py
Python
backend/translator/admin.py
Gobaan/menu-translator-django
db2a922dce844cd60a66b0325d4c074696126ca4
[ "MIT" ]
null
null
null
backend/translator/admin.py
Gobaan/menu-translator-django
db2a922dce844cd60a66b0325d4c074696126ca4
[ "MIT" ]
4
2020-06-05T23:09:23.000Z
2021-06-10T18:51:26.000Z
backend/translator/admin.py
Gobaan/menu-translator-django
db2a922dce844cd60a66b0325d4c074696126ca4
[ "MIT" ]
null
null
null
from django.contrib import admin from django import forms from .models import Annotation, Clip, Food, Image, Language, Website, UserProfile class AnnotationAdminForm(forms.ModelForm): class Meta: model = Annotation fields = '__all__' class AnnotationAdmin(admin.ModelAdmin): form = AnnotationAdminForm list_display = ['slug', 'created', 'last_updated', 'text', 'annotates_source_language'] readonly_fields = ['slug', 'created', 'last_updated', 'text', 'annotates_source_language'] admin.site.register(Annotation, AnnotationAdmin) class ClipAdminForm(forms.ModelForm): class Meta: model = Clip fields = '__all__' class ClipAdmin(admin.ModelAdmin): form = ClipAdminForm list_display = ['slug', 'created', 'last_updated', 'bounding_box'] readonly_fields = ['slug', 'created', 'last_updated', 'bounding_box'] admin.site.register(Clip, ClipAdmin) class FoodAdminForm(forms.ModelForm): class Meta: model = Food fields = '__all__' class FoodAdmin(admin.ModelAdmin): form = FoodAdminForm list_display = ['name', 'slug', 'created', 'last_updated'] readonly_fields = ['name', 'slug', 'created', 'last_updated'] admin.site.register(Food, FoodAdmin) class ImageAdminForm(forms.ModelForm): class Meta: model = Image fields = '__all__' class ImageAdmin(admin.ModelAdmin): form = ImageAdminForm list_display = ['slug', 'created', 'last_updated', 'cloud_URL', 'filesize', 'longitude', 'latitude', 'width', 'height'] readonly_fields = ['slug', 'created', 'last_updated', 'cloud_URL', 'filesize', 'longitude', 'latitude', 'width', 'height'] admin.site.register(Image, ImageAdmin) class LanguageAdminForm(forms.ModelForm): class Meta: model = Language fields = '__all__' class LanguageAdmin(admin.ModelAdmin): form = LanguageAdminForm list_display = ['name', 'slug', 'created', 'last_updated', 'short_name'] readonly_fields = ['name', 'slug', 'created', 'last_updated', 'short_name'] admin.site.register(Language, LanguageAdmin) class WebsiteAdminForm(forms.ModelForm): class Meta: model = Website fields = '__all__' class WebsiteAdmin(admin.ModelAdmin): form = WebsiteAdminForm list_display = ['slug', 'created', 'last_updated', 'URL', 'cache_path'] readonly_fields = ['slug', 'created', 'last_updated', 'URL', 'cache_path'] admin.site.register(Website, WebsiteAdmin) class UserProfileAdminForm(forms.ModelForm): class Meta: model = UserProfile fields = '__all__' class UserProfileAdmin(admin.ModelAdmin): form = UserProfileAdminForm list_display = ['slug', 'created', 'last_updated', 'category'] readonly_fields = ['slug', 'created', 'last_updated', 'category'] admin.site.register(UserProfile, UserProfileAdmin)
26.027273
126
0.689487
292
2,863
6.527397
0.212329
0.080797
0.110178
0.161595
0.481112
0.369885
0.24659
0.120672
0.069255
0.069255
0
0
0.176039
2,863
109
127
26.266055
0.807969
0
0
0.212121
0
0
0.217057
0.017476
0
0
0
0
0
1
0
false
0
0.045455
0
0.681818
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
b7366ab4b541a6d00ae9df7ac65ca2ada6762d7d
2,121
py
Python
test/unit/database/test_work.py
matiasmorant/py2neo
521c9799f386fcae262f9f1b379bca9e24184d16
[ "Apache-2.0" ]
null
null
null
test/unit/database/test_work.py
matiasmorant/py2neo
521c9799f386fcae262f9f1b379bca9e24184d16
[ "Apache-2.0" ]
null
null
null
test/unit/database/test_work.py
matiasmorant/py2neo
521c9799f386fcae262f9f1b379bca9e24184d16
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2020, Nigel Small # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from pytest import raises from py2neo import Transaction class FakeTransaction(object): def __init__(self, graph_name, readonly=False): self._graph_name = graph_name self._readonly = readonly @property def readonly(self): return self._readonly class FakeConnector(object): def begin(self, graph_name, readonly=False): return FakeTransaction(graph_name, readonly=readonly) class FakeService(object): @property def connector(self): return FakeConnector() class FakeGraph(object): @property def name(self): return "fake" @property def service(self): return FakeService() def test_should_fail_on_tx_create_object(): tx = Transaction(FakeGraph()) with raises(TypeError): tx.create(object()) def test_should_fail_on_tx_delete_object(): tx = Transaction(FakeGraph()) with raises(TypeError): tx.delete(object()) def test_should_fail_on_tx_merge_object(): tx = Transaction(FakeGraph()) with raises(TypeError): tx.merge(object()) def test_should_fail_on_tx_pull_object(): tx = Transaction(FakeGraph()) with raises(TypeError): tx.pull(object()) def test_should_fail_on_tx_push_object(): tx = Transaction(FakeGraph()) with raises(TypeError): tx.push(object()) def test_should_fail_on_tx_separate_object(): tx = Transaction(FakeGraph()) with raises(TypeError): tx.separate(object())
22.806452
74
0.701556
273
2,121
5.274725
0.391941
0.04375
0.054167
0.070833
0.348611
0.3125
0.297917
0.204167
0
0
0
0.008274
0.202263
2,121
92
75
23.054348
0.84279
0.282414
0
0.340426
0
0
0.002654
0
0
0
0
0
0
1
0.255319
false
0
0.042553
0.106383
0.489362
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
3f814f9f3699e39e3b921e760844dbc2795a7e64
225
py
Python
src/spaceone/monitoring/interface/rest/v1/common.py
xellos00/monitoring
deb5363a2152e7b3f85a08d27bdede0e00023824
[ "Apache-2.0" ]
null
null
null
src/spaceone/monitoring/interface/rest/v1/common.py
xellos00/monitoring
deb5363a2152e7b3f85a08d27bdede0e00023824
[ "Apache-2.0" ]
null
null
null
src/spaceone/monitoring/interface/rest/v1/common.py
xellos00/monitoring
deb5363a2152e7b3f85a08d27bdede0e00023824
[ "Apache-2.0" ]
null
null
null
import logging from fastapi import APIRouter from spaceone.core.locator import Locator _LOGGER = logging.getLogger(__name__) router = APIRouter() @router.get('/check') async def check(): return {'status': 'SERVING'}
16.071429
41
0.742222
27
225
6
0.703704
0
0
0
0
0
0
0
0
0
0
0
0.142222
225
13
42
17.307692
0.839378
0
0
0
0
0
0.084444
0
0
0
0
0
0
1
0
false
0
0.375
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
3f83a4002afc61816d499ce9af2515b129624aaf
392
py
Python
examples/task1.py
qqgg231/Allegro
d5300bfb8eb58168d5efbd6a7e211561fce569e0
[ "MIT" ]
27
2017-04-22T03:00:04.000Z
2017-11-28T08:40:47.000Z
examples/task1.py
qqgg231/Allegro
d5300bfb8eb58168d5efbd6a7e211561fce569e0
[ "MIT" ]
2
2017-05-18T08:40:29.000Z
2018-11-07T02:00:20.000Z
examples/task1.py
qqgg231/Allegro
d5300bfb8eb58168d5efbd6a7e211561fce569e0
[ "MIT" ]
4
2017-04-21T11:49:15.000Z
2018-10-29T12:01:38.000Z
#!/usr/bin/env python # coding=utf-8 from celery import Celery from pprint import pprint import time app = Celery('tasks', backend='redis://localhost:6379/0', broker = 'redis://localhost:6379/0') @app.task def get(message): #=========== #pprint(message) #=========== return {"app":"Get Got"} @app.task def post(message): #print(message) return {"app":"Post Got"}
17.818182
94
0.614796
52
392
4.634615
0.538462
0.099585
0.149378
0.157676
0
0
0
0
0
0
0
0.033742
0.168367
392
21
95
18.666667
0.705521
0.214286
0
0.2
0
0
0.245847
0.159468
0
0
0
0
0
1
0.2
false
0
0.3
0.2
0.7
0.1
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
3f8a3a645b102cb7225f8c5a5422dfe385638911
4,775
py
Python
mysite/settings/base.py
HumanCellAtlas/HCA-Tracker
4b3df2b8a99582b7b654253d6e0faf537298a876
[ "MIT" ]
3
2019-09-09T15:43:23.000Z
2020-12-03T23:29:45.000Z
mysite/settings/base.py
HumanCellAtlas/HCA-Tracker
4b3df2b8a99582b7b654253d6e0faf537298a876
[ "MIT" ]
45
2019-09-30T19:00:04.000Z
2020-12-03T23:50:35.000Z
mysite/settings/base.py
HumanCellAtlas/HCA-Tracker
4b3df2b8a99582b7b654253d6e0faf537298a876
[ "MIT" ]
1
2021-01-11T21:30:52.000Z
2021-01-11T21:30:52.000Z
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 2.2.4. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os import re # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # __file__ represents this file itself. BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! # this is the hardwired key for non-production SECRET_KEY = '=yztu+7vgkkr%f1uy(fnk%zl=!jx*tg$v6ekzsp40a%2m7_d3!' if "HCAT_SECRET_KEY" in os.environ: SECRET_KEY = os.environ["HCAT_SECRET_KEY"] # this env var only used by production # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = ["hgwdev.gi.ucsc.edu"] # Application definition INSTALLED_APPS = [ 'hcat.apps.HcatConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.google', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'mysite.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'mysite.wsgi.application' # Database # https://docs.djangoproject.com/en/2.2/ref/settings/#databases #DATABASES = { # 'default': { # 'ENGINE': 'django.db.backends.sqlite3', # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), # } #} DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': os.environ["HCAT_DB"], 'USER': os.environ["HCAT_USER"], 'PASSWORD': os.environ["HCAT_PASSWORD"], 'OPTIONS': { 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", }, } } # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/2.2/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'America/Los_Angeles' USE_I18N = True USE_L10N = True USE_TZ = True SITE_ID = 1 # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.2/howto/static-files/ STATIC_URL = '/static/' # help it find our static files STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), # this could have called i.e. assets instead ] # Where wranglers can upload things, whoohoo! MEDIA_ROOT = os.environ["HCAT_MEDIA"] MEDIA_URL = '/media/' LOGIN_REDIRECT_URL = '/' # Hide Sensitive Secret Environment Variables. # We do not want them to leak out if debug=true. # Django should be doing this for us automatically, but it does not. # runserver runs and forks and runs again. We only want to change env var for the main run process. if os.environ.get('RUN_MAIN') == 'true': HIDDEN_SETTINGS = re.compile('API|TOKEN|KEY|SECRET|PASS|SIGNATURE', flags=re.IGNORECASE) CLEANSED_SUBSTITUTE = '********************' for key in os.environ: if key.isupper(): if HIDDEN_SETTINGS.search(key): os.environ[key] = CLEANSED_SUBSTITUTE
27.923977
99
0.685654
572
4,775
5.615385
0.421329
0.064757
0.047945
0.054483
0.193026
0.182441
0.097136
0.097136
0.03736
0
0
0.008671
0.178848
4,775
170
100
28.088235
0.810508
0.33822
0
0.021505
1
0
0.494231
0.366667
0
0
0
0
0
1
0
false
0.075269
0.021505
0
0.021505
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
1
0
0
0
0
0
2
3f8d947a33583e1607214e59c7b361284124cdbb
1,808
py
Python
hwk/tests/unit/test_udev.py
jaypipes/os-hardware
b43be56fafc7e853614cafc7d02c734aadb72cbe
[ "Apache-2.0" ]
null
null
null
hwk/tests/unit/test_udev.py
jaypipes/os-hardware
b43be56fafc7e853614cafc7d02c734aadb72cbe
[ "Apache-2.0" ]
7
2017-06-02T00:41:49.000Z
2017-06-19T23:00:12.000Z
hwk/tests/unit/test_udev.py
jaypipes/hwk
b43be56fafc7e853614cafc7d02c734aadb72cbe
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from hwk import udev from hwk.tests.unit import base class TestUdev(base.TestCase): @mock.patch('subprocess.check_output') def test_device_properties(self, sp_mock): sp_mock.return_value = """ DEVLINKS=/dev/disk/by-id/wwn-0x600508e000000000f8253aac9a1abd0c ... DEVNAME=/dev/sda DEVPATH=/devices/pci0000:00/0000:00:07.0/... DEVTYPE=disk ID_BUS=scsi ID_MODEL=Logical_Volume ID_MODEL_ENC=Logical\x20Volume\x20\x20 ID_PART_TABLE_TYPE=dos ID_PART_TABLE_UUID=0000ebf3 ID_PATH=pci-0000:04:00.0-scsi-0:1:0:0 ID_PATH_TAG=pci-0000_04_00_0-scsi-0_1_0_0 ID_REVISION=3000 ID_SCSI=1 ID_SERIAL=3600508e000000000f8253aac9a1abd0c ID_SERIAL_SHORT=600508e000000000f8253aac9a1abd0c ID_TYPE=disk ID_VENDOR=LSI ID_VENDOR_ENC=LSI\x20\x20\x20\x20\x20 ID_WWN=0x600508e000000000 ID_WWN_VENDOR_EXTENSION=0xf8253aac9a1abd0c ID_WWN_WITH_EXTENSION=0x600508e000000000f8253aac9a1abd0c MAJOR=8 MINOR=0 SUBSYSTEM=block TAGS=:systemd: USEC_INITIALIZED=10219204 """ props = udev.device_properties("/sys/class/block/sda") self.assertIn('ID_BUS', props) self.assertEqual('scsi', props['ID_BUS']) self.assertIn('ID_MODEL_ENC', props) self.assertEqual('Logical\x20Volume\x20\x20', props['ID_MODEL_ENC'])
30.644068
76
0.776549
277
1,808
4.888087
0.516245
0.044313
0.022157
0.023634
0.032496
0.032496
0.032496
0.032496
0.032496
0.032496
0
0.127834
0.121681
1,808
58
77
31.172414
0.724811
0.300885
0
0
0
0.025641
0.673062
0.494804
0
0
0.083133
0
0.102564
1
0.025641
false
0
0.076923
0
0.128205
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
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3f8dbacf9ded6ecf935b85a50c2260653a9563a1
618
py
Python
app/resources/continent.py
visar/world
c609dcf343e94d6bb5cd242cd093ad646c744575
[ "MIT" ]
2
2021-03-20T05:53:33.000Z
2021-04-12T04:38:58.000Z
app/resources/continent.py
visar/world
c609dcf343e94d6bb5cd242cd093ad646c744575
[ "MIT" ]
null
null
null
app/resources/continent.py
visar/world
c609dcf343e94d6bb5cd242cd093ad646c744575
[ "MIT" ]
null
null
null
from http import HTTPStatus from flask_restful import Resource from ..extensions import cache from ..models.country import Country from ..schemas.continent import ContinentSchema continent_list_schema = ContinentSchema(many=True) class ContinentListResource(Resource): @cache.cached(timeout=60, query_string=True) def get(self): continents = Country.get_continents() if continents is None: return {'message': 'Could not find any continent.'}, HTTPStatus.NOT_FOUND return continent_list_schema.dump([{"name": continent[0]} for continent in continents]), HTTPStatus.OK
29.428571
110
0.745955
74
618
6.121622
0.608108
0.057395
0.083885
0
0
0
0
0
0
0
0
0.005825
0.166667
618
20
111
30.9
0.873786
0
0
0
0
0
0.064725
0
0
0
0
0
0
1
0.076923
false
0
0.384615
0
0.692308
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
3f8ee60500939b288620ad55089e24b11d028c78
413
py
Python
tests/__init__.py
sgbaird/ml-matrics
e0560af810b12cae3a34dd818d628360de2d96e5
[ "MIT" ]
11
2021-07-12T02:12:02.000Z
2022-02-14T19:06:22.000Z
tests/__init__.py
sgbaird/ml-matrics
e0560af810b12cae3a34dd818d628360de2d96e5
[ "MIT" ]
7
2021-10-14T10:00:01.000Z
2022-03-01T21:09:30.000Z
tests/__init__.py
sgbaird/ml-matrics
e0560af810b12cae3a34dd818d628360de2d96e5
[ "MIT" ]
2
2021-10-01T10:00:50.000Z
2022-02-12T08:50:22.000Z
import matplotlib.pyplot as plt import pandas as pd import pytest from ml_matrics import ROOT @pytest.fixture(autouse=True) def run_around_tests(): # Code that runs before each test yield # Code that runs after each test plt.close() y_binary, y_proba, y_clf = pd.read_csv(f"{ROOT}/data/rand_clf.csv").to_numpy().T xs, y_pred, y_true = pd.read_csv(f"{ROOT}/data/rand_regr.csv").to_numpy().T
20.65
80
0.723971
74
413
3.851351
0.581081
0.05614
0.084211
0.070175
0.154386
0.154386
0.154386
0
0
0
0
0
0.159806
413
19
81
21.736842
0.821326
0.150121
0
0
0
0
0.140805
0.140805
0
0
0
0
0
1
0.1
true
0
0.4
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
3fa22069ae5fe18f29c6332040788c47fba607ea
469
py
Python
DataStructures/Stacks/TextEditor.py
baby5/HackerRank
1e68a85f40499adb9b52a4da16936f85ac231233
[ "MIT" ]
null
null
null
DataStructures/Stacks/TextEditor.py
baby5/HackerRank
1e68a85f40499adb9b52a4da16936f85ac231233
[ "MIT" ]
null
null
null
DataStructures/Stacks/TextEditor.py
baby5/HackerRank
1e68a85f40499adb9b52a4da16936f85ac231233
[ "MIT" ]
null
null
null
#coding:utf-8 N = int(raw_input()) S = '' stack = [S] for _ in xrange(N): s = raw_input() if s.startswith('1'): S = ''.join((S, s.split()[-1])) stack.append(S) elif s.startswith('2'): k = int(s.split()[-1]) S = S[:-k] stack.append(S) elif s.startswith('3'): k = int(s.split()[-1]) index = k-1 print S[index] elif s.startswith('4'): stack.pop() S = stack[-1]
19.541667
39
0.447761
69
469
3
0.376812
0.21256
0.101449
0.154589
0.36715
0.26087
0
0
0
0
0
0.032362
0.341151
469
23
40
20.391304
0.63754
0.025586
0
0.210526
0
0
0.008772
0
0
0
0
0
0
0
null
null
0
0
null
null
0.052632
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
3fa6b41c13b8399c331e3ed2f410f771408be4f8
680
py
Python
envoy/examples/puma-proxy/internal_lib/backend/netflix/database_connect.py
kevinjesse/puma
163a363275bf5d84d1957aaf23783be84053e40f
[ "MIT" ]
null
null
null
envoy/examples/puma-proxy/internal_lib/backend/netflix/database_connect.py
kevinjesse/puma
163a363275bf5d84d1957aaf23783be84053e40f
[ "MIT" ]
null
null
null
envoy/examples/puma-proxy/internal_lib/backend/netflix/database_connect.py
kevinjesse/puma
163a363275bf5d84d1957aaf23783be84053e40f
[ "MIT" ]
null
null
null
# # @author Kevin Jesse # @email kevin.r.jesse@gmail.com # """ Database Connect serves to connect to the database postgres, as the master user. Autocommit has been turned on so all inserts, updates, and deletes will be enforced atomically """ import psycopg2 def db_connect(): cur = None try: conn = psycopg2.connect("dbname='postgres' user='postgres' host='localhost' password='postgres'", connect_timeout=30) conn.autocommit = True #Auto commit must be on if you want changes to be immediate for insert/update cur = conn.cursor() #cur.itersize = 10000 except: print "[ERROR] couldn't connect to the database" return cur
30.909091
125
0.695588
94
680
5.010638
0.702128
0.038217
0.050955
0.084926
0
0
0
0
0
0
0
0.016822
0.213235
680
22
126
30.909091
0.863551
0.214706
0
0
0
0
0.318841
0
0
0
0
0
0
0
null
null
0.1
0.1
null
null
0.1
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
3fc2b905de175376e48fc847adcd762ca15c7b7a
2,571
py
Python
sarpy_gui_apps/apps/canvas_demo/panels/canvas_demo_button_panel.py
spowlas/sarpy
c4a404203607d404b93a556459aa5311d7148e95
[ "MIT" ]
null
null
null
sarpy_gui_apps/apps/canvas_demo/panels/canvas_demo_button_panel.py
spowlas/sarpy
c4a404203607d404b93a556459aa5311d7148e95
[ "MIT" ]
1
2019-11-14T20:55:57.000Z
2019-12-27T18:11:29.000Z
sarpy_gui_apps/apps/canvas_demo/panels/canvas_demo_button_panel.py
spowlas/sarpy
c4a404203607d404b93a556459aa5311d7148e95
[ "MIT" ]
2
2020-02-12T20:11:00.000Z
2020-03-26T16:55:03.000Z
from tkinter_gui_builder.panel_templates.widget_panel.widget_panel import AbstractWidgetPanel from tkinter_gui_builder.widgets import basic_widgets class CanvasDemoButtonPanel(AbstractWidgetPanel): fname_select = basic_widgets.Button zoom_in = basic_widgets.Button zoom_out = basic_widgets.Button rect_select = basic_widgets.Button update_rect_image = basic_widgets.Button pan = basic_widgets.Button draw_line_w_drag = basic_widgets.Button draw_line_w_click = basic_widgets.Button draw_arrow_w_drag = basic_widgets.Button draw_arrow_w_click = basic_widgets.Button draw_rect_w_drag = basic_widgets.Button draw_rect_w_click = basic_widgets.Button draw_polygon_w_click = basic_widgets.Button draw_point_w_click = basic_widgets.Button modify_existing_shape = basic_widgets.Button color_selector = basic_widgets.Button save_kml = basic_widgets.Button select_existing_shape = basic_widgets.Combobox # type: basic_widgets.Combobox remap_dropdown = basic_widgets.Combobox # type: basic_widgets.Combobox def __init__(self, parent): AbstractWidgetPanel.__init__(self, parent) controls = ["fname_select", "zoom_in", "zoom_out", "pan", "draw_line_w_drag", "draw_line_w_click", "draw_arrow_w_drag", "draw_arrow_w_click", "draw_rect_w_drag", "draw_rect_w_click", "draw_polygon_w_click", "draw_point_w_click", "select_existing_shape", "modify_existing_shape", "save_kml", "color_selector", "rect_select", "update_rect_image", "remap_dropdown"] self.init_w_box_layout(controls, 4, column_widths=20) self.remap_dropdown.update_combobox_values(["density", "brighter", "darker", "high contrast", "linear", "log", "pedf", "nrl"]) self.set_label_text("taser buttons") if __name__ == '__main__': print(dir(AbstractWidgetPanel))
40.171875
93
0.552703
246
2,571
5.256098
0.296748
0.204176
0.236659
0.136118
0.273009
0.254447
0.068059
0
0
0
0
0.001889
0.382342
2,571
63
94
40.809524
0.812343
0.02217
0
0
0
0
0.137794
0.016726
0
0
0
0
0
1
0.018182
false
0
0.036364
0
0.418182
0.018182
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
3fc90063242679a163aee4c95d494aed3302ce11
961
py
Python
setup.py
adamltyson/fancylog
8e9047759d5c394e98b5af7c2d68f70f2fbeb40e
[ "MIT" ]
3
2020-09-30T09:02:08.000Z
2021-06-12T20:43:43.000Z
setup.py
adamltyson/fancylog
8e9047759d5c394e98b5af7c2d68f70f2fbeb40e
[ "MIT" ]
8
2020-01-07T11:27:05.000Z
2021-07-13T11:07:11.000Z
setup.py
adamltyson/fancylog
8e9047759d5c394e98b5af7c2d68f70f2fbeb40e
[ "MIT" ]
2
2020-02-05T19:03:04.000Z
2021-07-07T09:42:24.000Z
from setuptools import setup, find_packages setup( name="fancylog", version="0.2.6", description="Fancier logging in Python", install_requires=["packaging", "rich"], extras_require={ "dev": [ "black", "pytest-cov", "pytest", "coverage", "bump2version", "pre-commit", "flake8", ] }, python_requires=">=3.6", packages=find_packages(), include_package_data=True, url="https://github.com/adamltyson/fancylog", author="Adam Tyson", author_email="code@adamltyson.com", classifiers=[ "Development Status :: 3 - Alpha", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Intended Audience :: Developers", ], )
26.694444
49
0.552549
89
961
5.876404
0.707865
0.145315
0.191205
0.14914
0
0
0
0
0
0
0
0.020802
0.299688
961
35
50
27.457143
0.756315
0
0
0
0
0
0.437045
0
0
0
0
0
0
1
0
true
0
0.030303
0
0.030303
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
3fce57d4964a0ce253965c723aa6fb69e1b90bf3
4,069
py
Python
mat2py/core/graph2d.py
mat2py/mat2py
2776fbe9ca4ad2aaa3eac6aa79d17747a9ec24a8
[ "MIT" ]
null
null
null
mat2py/core/graph2d.py
mat2py/mat2py
2776fbe9ca4ad2aaa3eac6aa79d17747a9ec24a8
[ "MIT" ]
37
2021-12-23T03:22:20.000Z
2022-02-16T15:40:47.000Z
mat2py/core/graph2d.py
mat2py/mat2py
2776fbe9ca4ad2aaa3eac6aa79d17747a9ec24a8
[ "MIT" ]
2
2022-01-23T07:59:10.000Z
2022-02-03T09:15:54.000Z
# type: ignore __all__ = [ "plotyy", "figtoolset", "getscribecontextmenu", "getobj", "scribeeventhandler", "setscribecontextmenu", "putdowntext", "gtext", "scribetextdlg", "doresize", "prepdrag", "scriberestoresavefcns", "zoom", "scribeclearmode", "domymenu", "ylabel", "getscribeobjectdata", "enddrag", "texlabel", "setscribeobjectdata", "polar", "getcolumn", "plotedit", "semilogx", "jpropeditutils", "basicfitdatastat", "plot", "box", "axis", "title", "loglog", "dokeypress", "semilogy", "doclick", "middrag", "text", "pan", "subplot", "xlabel", "rbbox", "grid", "moveaxis", "getorcreateobj", ] from mat2py.common.backends import numpy as np from ._internal import M def plotyy(*args): raise NotImplementedError("plotyy") def figtoolset(*args): raise NotImplementedError("figtoolset") def getscribecontextmenu(*args): raise NotImplementedError("getscribecontextmenu") def getobj(*args): raise NotImplementedError("getobj") def scribeeventhandler(*args): raise NotImplementedError("scribeeventhandler") def setscribecontextmenu(*args): raise NotImplementedError("setscribecontextmenu") def putdowntext(*args): raise NotImplementedError("putdowntext") def gtext(*args): raise NotImplementedError("gtext") def scribetextdlg(*args): raise NotImplementedError("scribetextdlg") def doresize(*args): raise NotImplementedError("doresize") def prepdrag(*args): raise NotImplementedError("prepdrag") def scriberestoresavefcns(*args): raise NotImplementedError("scriberestoresavefcns") def zoom(*args): raise NotImplementedError("zoom") def scribeclearmode(*args): raise NotImplementedError("scribeclearmode") def domymenu(*args): raise NotImplementedError("domymenu") def ylabel(*args): raise NotImplementedError("ylabel") def getscribeobjectdata(*args): raise NotImplementedError("getscribeobjectdata") def enddrag(*args): raise NotImplementedError("enddrag") def texlabel(*args): raise NotImplementedError("texlabel") def setscribeobjectdata(*args): raise NotImplementedError("setscribeobjectdata") def polar(*args): raise NotImplementedError("polar") def getcolumn(*args): raise NotImplementedError("getcolumn") def plotedit(*args): raise NotImplementedError("plotedit") def semilogx(*args): raise NotImplementedError("semilogx") def jpropeditutils(*args): raise NotImplementedError("jpropeditutils") def basicfitdatastat(*args): raise NotImplementedError("basicfitdatastat") def plot(*args): import matplotlib.pyplot as plt fig, ax = plt.subplots() while args: x, y, *args = args if args and isinstance(args[0], str): style, *args = args style = (style,) else: style = tuple() x = M[x].reshape(-1) y = M[y].reshape(-1) ax.plot(x, y, *style) return fig def box(*args): raise NotImplementedError("box") def axis(*args): raise NotImplementedError("axis") def title(*args): raise NotImplementedError("title") def loglog(*args): raise NotImplementedError("loglog") def dokeypress(*args): raise NotImplementedError("dokeypress") def semilogy(*args): raise NotImplementedError("semilogy") def doclick(*args): raise NotImplementedError("doclick") def middrag(*args): raise NotImplementedError("middrag") def text(*args): raise NotImplementedError("text") def pan(*args): raise NotImplementedError("pan") def subplot(*args): raise NotImplementedError("subplot") def xlabel(*args): raise NotImplementedError("xlabel") def rbbox(*args): raise NotImplementedError("rbbox") def grid(*args): raise NotImplementedError("grid") def moveaxis(*args): raise NotImplementedError("moveaxis") def getorcreateobj(*args): raise NotImplementedError("getorcreateobj")
17.168776
54
0.673876
360
4,069
7.602778
0.222222
0.138107
0.429668
0
0
0
0
0
0
0
0
0.001224
0.1971
4,069
236
55
17.241525
0.836547
0.002949
0
0
0
0
0.194821
0.010358
0
0
0
0
0
1
0.296552
false
0
0.02069
0
0.324138
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
3fd08ba20ef96dd8738b44a611be2e078eaec1a9
789
py
Python
django_alive/tests/test_command.py
lincolnloop/django-alive
608fd0a1d94f90f51a48a943348e9038f402a504
[ "MIT" ]
25
2018-08-22T12:42:14.000Z
2022-01-18T19:03:05.000Z
django_alive/tests/test_command.py
lincolnloop/django-alive
608fd0a1d94f90f51a48a943348e9038f402a504
[ "MIT" ]
7
2019-11-05T23:52:49.000Z
2020-07-01T18:03:32.000Z
django_alive/tests/test_command.py
lincolnloop/django-alive
608fd0a1d94f90f51a48a943348e9038f402a504
[ "MIT" ]
null
null
null
import sys from django.core.management import CommandError, call_command from django.test import TestCase from .side_effects import bad_database_check try: from unittest.mock import patch except ImportError: from mock import patch # Python 2.7 support if sys.version_info > (3, 0): from io import StringIO else: from io import BytesIO as StringIO class CommandTestCase(TestCase): def test_command(self): out = StringIO() call_command("healthcheck", stdout=out) self.assertIn("OK", out.getvalue()) def test_command_failed(self): with patch( "django_alive.checks.check_database", side_effect=bad_database_check ): with self.assertRaises(CommandError): call_command("healthcheck")
24.65625
80
0.697085
98
789
5.459184
0.530612
0.061682
0.085981
0
0
0
0
0
0
0
0
0.006547
0.225602
789
31
81
25.451613
0.869067
0.022814
0
0
0
0
0.075423
0.044213
0
0
0
0
0.086957
1
0.086957
false
0
0.391304
0
0.521739
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
3fda3cc0af3e5e42cd6c1e11390f1713cf4c09d1
3,365
py
Python
tests/unit/test_baseObject.py
asaranprasad/nvda
e9609694acbfb06398eb6552067a0dcd532d67af
[ "bzip2-1.0.6" ]
1
2018-11-16T10:15:59.000Z
2018-11-16T10:15:59.000Z
tests/unit/test_baseObject.py
asaranprasad/nvda
e9609694acbfb06398eb6552067a0dcd532d67af
[ "bzip2-1.0.6" ]
3
2017-09-29T17:14:18.000Z
2019-05-20T16:13:39.000Z
tests/unit/test_baseObject.py
asaranprasad/nvda
e9609694acbfb06398eb6552067a0dcd532d67af
[ "bzip2-1.0.6" ]
1
2017-09-29T08:53:52.000Z
2017-09-29T08:53:52.000Z
#tests/unit/test_baseObject.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2018 NV Access Limited, Babbage B.V. """Unit tests for the baseObject module, its classes and their derivatives.""" import unittest from baseObject import ScriptableObject from objectProvider import PlaceholderNVDAObject from scriptHandler import script class NVDAObjectWithDecoratedScript(PlaceholderNVDAObject): """An object with a decorated script.""" @script(gestures=["kb:a"]) def script_alpha(self, gesture): return class NVDAObjectWithGesturesDictionary(PlaceholderNVDAObject): """An object with a script that is bound to a gesture in a L{__gestures} dictionary.""" def script_bravo(self, gesture): return __gestures = { "kb:b": "bravo" } class NVDAObjectWithDecoratedScriptAndGesturesDictionary(PlaceholderNVDAObject): """An object with a decorated script and a script that is bound to a gesture in a L{__gestures} dictionary. """ @script(gestures=["kb:c"]) def script_charlie(self, gesture): return def script_delta(self, gesture): return __gestures = { "kb:d": "delta", } class SubclassedNVDAObjectWithDecoratedScriptAndGesturesDictionary( NVDAObjectWithDecoratedScript, NVDAObjectWithGesturesDictionary, NVDAObjectWithDecoratedScriptAndGesturesDictionary ): """An object with decorated scripts and L{__gestures} dictionaries, based on subclassing.""" @script(gestures=["kb:e"]) def script_echo(self, gesture): return def script_foxtrot(self, gesture): return __gestures = { "kb:f": "foxtrot", } class DynamicNVDAObjectWithDecoratedScriptAndGesturesDictionary(PlaceholderNVDAObject): """An object with decorated scripts and L{__gestures} dictionaries, using the chooseOverlayClasses logic to construct a dynamic object.""" def findOverlayClasses(self, clsList): clsList.extend([ NVDAObjectWithDecoratedScript, NVDAObjectWithGesturesDictionary, NVDAObjectWithDecoratedScriptAndGesturesDictionary ]) @script(gestures=["kb:g"]) def script_golf(self, gesture): return def script_hotel(self, gesture): return __gestures = { "kb:h": "hotel", } class TestScriptableObject(unittest.TestCase): """A test that verifies whether scripts are properly bound to associated gestures.""" def test_decoratedScript(self): obj = NVDAObjectWithDecoratedScript() self.assertIn("kb:a", obj._gestureMap) def test_gesturesDictionary(self): obj = NVDAObjectWithGesturesDictionary() self.assertIn("kb:b", obj._gestureMap) def test_decoratedScriptAndGesturesDictionary(self): obj = NVDAObjectWithDecoratedScriptAndGesturesDictionary() self.assertIn("kb:c", obj._gestureMap) self.assertIn("kb:d", obj._gestureMap) def test_decoratedScriptsAndGestureDictionariesIfSubclassed(self): obj = SubclassedNVDAObjectWithDecoratedScriptAndGesturesDictionary() for key in ("a", "b", "c", "d", "e", "f"): self.assertIn("kb:%s" % key, obj._gestureMap) def test_decoratedScriptsAndGestureDictionariesIfDynamic(self): obj = DynamicNVDAObjectWithDecoratedScriptAndGesturesDictionary() for key in ("a", "b", "c", "d", "g", "h"): self.assertIn("kb:%s" % key, obj._gestureMap)
30.044643
94
0.744428
343
3,365
7.198251
0.332362
0.032402
0.055083
0.053463
0.245849
0.157149
0.157149
0.082625
0.082625
0.040502
0
0.001407
0.155126
3,365
111
95
30.315315
0.867042
0.240119
0
0.285714
0
0
0.038301
0
0
0
0
0
0.085714
1
0.2
false
0
0.057143
0.114286
0.514286
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
3fdb9c34cb8887a4abfe9945968ed8dd70631d27
137
py
Python
flopz/__init__.py
Flopz-Project/flopz
eb470811e4a8be5e5d625209b0f8eb7ccd1d5da3
[ "Apache-2.0" ]
7
2021-11-19T15:53:58.000Z
2022-03-28T03:38:52.000Z
flopz/__init__.py
Flopz-Project/flopz
eb470811e4a8be5e5d625209b0f8eb7ccd1d5da3
[ "Apache-2.0" ]
null
null
null
flopz/__init__.py
Flopz-Project/flopz
eb470811e4a8be5e5d625209b0f8eb7ccd1d5da3
[ "Apache-2.0" ]
1
2022-03-25T12:44:01.000Z
2022-03-25T12:44:01.000Z
""" flopz. Low Level Assembler and Firmware Instrumentation Toolkit """ __version__ = "0.2.0" __author__ = "Noelscher Consulting GmbH"
15.222222
56
0.744526
16
137
5.875
0.9375
0
0
0
0
0
0
0
0
0
0
0.025641
0.145985
137
8
57
17.125
0.777778
0.467153
0
0
0
0
0.461538
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
3fec010889ccbdbd07b4bb7fe68a11cde75d9565
3,641
py
Python
server.py
MVHSiot/yelperhelper
a94dc9e80e301241da58b678770338e3fa9b642e
[ "MIT" ]
null
null
null
server.py
MVHSiot/yelperhelper
a94dc9e80e301241da58b678770338e3fa9b642e
[ "MIT" ]
null
null
null
server.py
MVHSiot/yelperhelper
a94dc9e80e301241da58b678770338e3fa9b642e
[ "MIT" ]
null
null
null
import sys try: sys.path.append('/opt/python3/lib/python3.4/site-packages') except: pass import yelp_api import pickle import calc pub_key = 'pub-c-2c436bc0-666e-4975-baaf-63f16a61558d' sub_key = 'sub-c-0442432a-3312-11e7-bae3-02ee2ddab7fe' from pubnub.callbacks import SubscribeCallback from pubnub.enums import PNStatusCategory from pubnub.pnconfiguration import PNConfiguration from pubnub.pubnub import PubNub pnconfig = PNConfiguration() pnconfig.subscribe_key = sub_key pnconfig.publish_key = pub_key pubnub = PubNub(pnconfig) def publishCallback(result, status): pass class subscribeCallback(SubscribeCallback): def status(self, pubnub, status): pass def presence(self, pubnub, presence): pass # handle incoming presence data def message(self, pubnub, message): if message.message['cmdtype'] == "request": print(message.message) try: print('searching current loc') best_restaurants = calc.process(message.message['latitude'],message.message['longitude']) except: print('searching city') print(message.message['city'].replace("%20", "+")) best_restaurants = calc.process(city=message.message['city'].replace("%20", "+")) review = yelp_api.get_business_review(best_restaurants[0]['id']) review1 = yelp_api.get_business_review(best_restaurants[1]['id']) review2 = yelp_api.get_business_review(best_restaurants[2]['id']) id1 = best_restaurants[0]['id'] id2 = best_restaurants[1]['id'] id3 = best_restaurants[2]['id'] loc = best_restaurants[0]['location'] name = best_restaurants[0]['name'] rating = best_restaurants[0]['rating'] price = best_restaurants[0]['price'] image = best_restaurants[0]['image_url'] url = best_restaurants[0]['url'] loc1 = best_restaurants[1]['location'] name1 = best_restaurants[1]['name'] rating1 = best_restaurants[1]['rating'] price1 = best_restaurants[1]['price'] image1 = best_restaurants[1]['image_url'] url1 = best_restaurants[1]['url'] loc2 = best_restaurants[2]['location'] name2 = best_restaurants[2]['name'] rating2 = best_restaurants[2]['rating'] price2 = best_restaurants[2]['price'] image2 = best_restaurants[2]['image_url'] url2 = best_restaurants[2]['url'] print(name,name1,name2) pubnub.publish().channel('main_channel').message([{"name":name,"rating":rating,"price":price,"loc":loc,"image":image,"url":url, "review":review, "id":id1}, {"name":name1,"rating":rating1,"price":price1,"loc":loc1,"image":image1,"url":url1, "review":review1, "id":id2}, {"name":name2,"rating":rating2,"price":price2,"loc":loc2,"image":image2,"url":url2, "review":review2, "id":id3}]).async(publishCallback) elif message.message['cmdtype'] == "append": print("new restaurant received") with open("restaurant_data.dat", "rb") as f: rl = pickle.load(f) rl.append(yelp_api.convertFormat(yelp_api.get_business_by_id(message.message['id']))) with open("restaurant_data.dat", "wb") as f: pickle.dump(rl,f) pubnub.add_listener(subscribeCallback()) pubnub.subscribe().channels('secondary_channel').execute() while True: pass
44.402439
198
0.611096
405
3,641
5.358025
0.303704
0.179724
0.058986
0.03318
0.101843
0.053917
0.053917
0
0
0
0
0.039065
0.247734
3,641
81
199
44.950617
0.753195
0.007965
0
0.121622
0
0
0.147922
0.034349
0
0
0
0
0
0
null
null
0.067568
0.108108
null
null
0.081081
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
3fefc1a6bf75d8c0151f7c8fa8710346285e3ae9
281
py
Python
aas_core_meta/__init__.py
aas-core-works/aas-core3-meta
88b618c82f78392a47ee58cf2657ae6df8e5a418
[ "MIT" ]
null
null
null
aas_core_meta/__init__.py
aas-core-works/aas-core3-meta
88b618c82f78392a47ee58cf2657ae6df8e5a418
[ "MIT" ]
null
null
null
aas_core_meta/__init__.py
aas-core-works/aas-core3-meta
88b618c82f78392a47ee58cf2657ae6df8e5a418
[ "MIT" ]
null
null
null
"""Provide meta-models for Asset Administration Shell information model.""" __version__ = "2021.11.20a2" __author__ = ( "Nico Braunisch, Marko Ristin, Robert Lehmann, Marcin Sadurski, Manuel Sauer" ) __license__ = "License :: OSI Approved :: MIT License" __status__ = "Alpha"
31.222222
81
0.736655
32
281
5.96875
0.9375
0
0
0
0
0
0
0
0
0
0
0.037657
0.149466
281
8
82
35.125
0.761506
0.245552
0
0
0
0
0.631068
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b20a4404ed9e15d9b510a71724e0f8e9d7cc1046
645
py
Python
tools/leetcode.128.Longest Consecutive Sequence/leetcode.128.Longest Consecutive Sequence.submission1.py
tedye/leetcode
975d7e3b8cb9b6be9e80e07febf4bcf6414acd46
[ "MIT" ]
4
2015-10-10T00:30:55.000Z
2020-07-27T19:45:54.000Z
tools/leetcode.128.Longest Consecutive Sequence/leetcode.128.Longest Consecutive Sequence.submission1.py
tedye/leetcode
975d7e3b8cb9b6be9e80e07febf4bcf6414acd46
[ "MIT" ]
null
null
null
tools/leetcode.128.Longest Consecutive Sequence/leetcode.128.Longest Consecutive Sequence.submission1.py
tedye/leetcode
975d7e3b8cb9b6be9e80e07febf4bcf6414acd46
[ "MIT" ]
null
null
null
class Solution: # @param {integer[]} nums # @return {integer} def longestConsecutive(self, nums): if not nums: return 0 result = 0 hashtable = set(nums) while hashtable: i = hashtable.pop() cnt = 1 temp = i while temp+1 in hashtable: cnt += 1 temp += 1 hashtable.remove(temp) temp = i while temp-1 in hashtable: cnt += 1 temp -=1 hashtable.remove(temp) result = max(result, cnt) return result
645
645
0.432558
62
645
4.5
0.387097
0.071685
0.086022
0.100358
0.387097
0.387097
0.387097
0.387097
0.387097
0.387097
0
0.027356
0.489922
645
1
645
645
0.820669
0.063566
0
0.285714
0
0
0
0
0
0
0
0
0
1
0.047619
false
0
0
0
0.190476
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b20cdd9f8c550b03afcaa9236a4a608b7379d8bd
453
py
Python
pygeos/measurements.py
jorisvandenbossche/pygeos
0a25af4ae1c96d11752318d2755f4f3342611b17
[ "BSD-3-Clause" ]
null
null
null
pygeos/measurements.py
jorisvandenbossche/pygeos
0a25af4ae1c96d11752318d2755f4f3342611b17
[ "BSD-3-Clause" ]
null
null
null
pygeos/measurements.py
jorisvandenbossche/pygeos
0a25af4ae1c96d11752318d2755f4f3342611b17
[ "BSD-3-Clause" ]
null
null
null
from . import ufuncs __all__ = ["area", "distance", "length", "hausdorff_distance"] def area(geometries): return ufuncs.area(geometries) def distance(a, b): return ufuncs.distance(a, b) def length(geometries): return ufuncs.length(geometries) def hausdorff_distance(a, b, densify=None): if densify is None: return ufuncs.hausdorff_distance(a, b) else: return ufuncs.haussdorf_distance_densify(a, b, densify)
19.695652
63
0.697572
58
453
5.293103
0.327586
0.19544
0.130293
0.123779
0
0
0
0
0
0
0
0
0.187638
453
22
64
20.590909
0.834239
0
0
0
0
0
0.07947
0
0
0
0
0
0
1
0.307692
false
0
0.076923
0.230769
0.769231
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
b76e3c3a78b500e4bd43645ac8426138d20f7491
659
py
Python
uniclass_to_nf_ea_com_source/b_code/migrators/uniclass_raw_to_domain/evolve/evolve_stage_4/domain_table_data_processor/parent_code_column_adder.py
boro-alpha/uniclass_to_nf_ea_com
753e97467ce53c25bc86341b915489c2eeeb3f49
[ "MIT" ]
2
2021-08-09T14:40:04.000Z
2022-03-13T22:22:19.000Z
uniclass_to_nf_ea_com_source/b_code/migrators/uniclass_raw_to_domain/evolve/evolve_stage_4/domain_table_data_processor/parent_code_column_adder.py
boro-alpha/uniclass_to_nf_ea_com
753e97467ce53c25bc86341b915489c2eeeb3f49
[ "MIT" ]
null
null
null
uniclass_to_nf_ea_com_source/b_code/migrators/uniclass_raw_to_domain/evolve/evolve_stage_4/domain_table_data_processor/parent_code_column_adder.py
boro-alpha/uniclass_to_nf_ea_com
753e97467ce53c25bc86341b915489c2eeeb3f49
[ "MIT" ]
null
null
null
import numpy as np from uniclass_to_nf_ea_com_source.b_code.configurations.common_constants.uniclass_bclearer_constants import PARENT_CODE_COLUMN_NAME, \ UNICLASS2015_OBJECT_TABLE_NAME def add_parent_code_column_to_uniclass_objects_table( dictionary_of_dataframes: dict)\ -> dict: uniclass_2015_object_table = \ dictionary_of_dataframes[ UNICLASS2015_OBJECT_TABLE_NAME] uniclass_2015_object_table[ PARENT_CODE_COLUMN_NAME] = \ np.NaN dictionary_of_dataframes[ UNICLASS2015_OBJECT_TABLE_NAME] = \ uniclass_2015_object_table return \ dictionary_of_dataframes
27.458333
134
0.752656
78
659
5.74359
0.423077
0.147321
0.196429
0.180804
0.321429
0.321429
0.321429
0.321429
0.321429
0.321429
0
0.045889
0.206373
659
23
135
28.652174
0.810707
0
0
0.117647
0
0
0
0
0
0
0
0
0
1
0.058824
false
0
0.117647
0
0.235294
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
b778ede17d0ff72b747e93fc5f260c19e384862d
160
py
Python
1_PROGI/Exe 5.py
Julymusso/IFES
939277c375dacc7750705c5593537d80ab4cbc0e
[ "MIT" ]
null
null
null
1_PROGI/Exe 5.py
Julymusso/IFES
939277c375dacc7750705c5593537d80ab4cbc0e
[ "MIT" ]
null
null
null
1_PROGI/Exe 5.py
Julymusso/IFES
939277c375dacc7750705c5593537d80ab4cbc0e
[ "MIT" ]
null
null
null
#var #num, media, i: inteiro media=0 for i in range(1,11,1): num=int(input("Digite um número: ")) media = media+num media=media/i print (media)
17.777778
40
0.61875
28
160
3.535714
0.607143
0.161616
0
0
0
0
0
0
0
0
0
0.040323
0.225
160
9
41
17.777778
0.758065
0.15625
0
0
0
0
0.134328
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
b789e2f11f57608cb00f55b63d916cf77099aa18
338
py
Python
condiment/tests/test_simple.py
WeilerWebServices/Kivy
54e3438156eb0c853790fd3cecc593f09123f892
[ "MIT" ]
3
2020-09-13T09:55:02.000Z
2021-01-23T11:13:59.000Z
condiment/tests/test_simple.py
WeilerWebServices/Kivy
54e3438156eb0c853790fd3cecc593f09123f892
[ "MIT" ]
2
2018-03-16T22:01:12.000Z
2020-01-13T10:33:22.000Z
condiment/tests/test_simple.py
WeilerWebServices/Kivy
54e3438156eb0c853790fd3cecc593f09123f892
[ "MIT" ]
2
2015-04-26T15:31:40.000Z
2017-09-12T12:36:14.000Z
#exclude import condiment; condiment.install() #endexclude if WITH_TIMEBOMB: timebomb = int(WITH_TIMEBOMB) print 'timebomb feature is activated, and set to', timebomb if WITH_INAPP_PURCHASE: print 'inapp purchase feature is activated' if WITH_TIMEBOMB and WITH_INAPP_PURCHASE: print 'both features have been activated'
24.142857
63
0.775148
45
338
5.666667
0.488889
0.070588
0.109804
0.172549
0
0
0
0
0
0
0
0
0.16568
338
13
64
26
0.904255
0.050296
0
0
0
0
0.341693
0
0
0
0
0
0
0
null
null
0
0.125
null
null
0.375
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
b7939b77631def2ec27e1370419a519e33e2db7a
180
py
Python
matchms/similarity/spec2vec/__init__.py
fossabot/matchms
090db31b22829dc224e5ed78fb4901e8c14a8e92
[ "Apache-2.0" ]
null
null
null
matchms/similarity/spec2vec/__init__.py
fossabot/matchms
090db31b22829dc224e5ed78fb4901e8c14a8e92
[ "Apache-2.0" ]
null
null
null
matchms/similarity/spec2vec/__init__.py
fossabot/matchms
090db31b22829dc224e5ed78fb4901e8c14a8e92
[ "Apache-2.0" ]
null
null
null
from .Document import Document from .SpectrumDocument import SpectrumDocument from .Spec2Vec import Spec2Vec __all__ = [ "Document", "SpectrumDocument", "Spec2Vec" ]
16.363636
46
0.738889
16
180
8.0625
0.375
0
0
0
0
0
0
0
0
0
0
0.020408
0.183333
180
10
47
18
0.857143
0
0
0
0
0
0.177778
0
0
0
0
0
0
1
0
false
0
0.375
0
0.375
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
b7ae3072a6046637d4bd29d21eabd8d449e98c65
274
py
Python
src/events/admin.py
cbsBiram/xarala__ssr
863e1362c786daa752b942b796f7a015211d2f1b
[ "FSFAP" ]
null
null
null
src/events/admin.py
cbsBiram/xarala__ssr
863e1362c786daa752b942b796f7a015211d2f1b
[ "FSFAP" ]
null
null
null
src/events/admin.py
cbsBiram/xarala__ssr
863e1362c786daa752b942b796f7a015211d2f1b
[ "FSFAP" ]
null
null
null
from django.contrib import admin from django_summernote.admin import SummernoteModelAdmin from .models import Event, Speaker class EventAdmin(SummernoteModelAdmin): summernote_fields = ("content",) admin.site.register(Event, EventAdmin) admin.site.register(Speaker)
22.833333
56
0.813869
31
274
7.129032
0.516129
0.090498
0.153846
0
0
0
0
0
0
0
0
0
0.105839
274
11
57
24.909091
0.902041
0
0
0
0
0
0.025547
0
0
0
0
0
0
1
0
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
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
b7b473cc7728c8bc405a3042f957fe877f0c27c2
790
py
Python
JTP Recap./2.Program_IO/function.py
SNP0301/Study_Python
bb7ce7a0d915131c281152e7faee5b57c290df6b
[ "MIT" ]
null
null
null
JTP Recap./2.Program_IO/function.py
SNP0301/Study_Python
bb7ce7a0d915131c281152e7faee5b57c290df6b
[ "MIT" ]
null
null
null
JTP Recap./2.Program_IO/function.py
SNP0301/Study_Python
bb7ce7a0d915131c281152e7faee5b57c290df6b
[ "MIT" ]
null
null
null
""" Function def function_name(arg1, arg2, ...) : <op 1> <op 2> ... Function with undefined amount of input def fn_name(*args) --> args' elements make tuple. kwargs = Keyword Parameter >>> def print_kwargs(**kwargs): ... print(kwargs) ... >>> print_kwargs(a=1) {'a':1} >>> print_kwargs(name='foo', age=3) {'age':3, 'name':'foo'} **args_name = make args_name as a dictionary clearing & assignment : element should be added in the last part of args Lambda : another method to make fn lambda arg1, arg2, .. : operation_of_fn >>> add = lambda a,b : a+b >>> result = add(3,4) >>> print(result) 7 lambda can return result with out expression 'return' Contents Source : https://wikidocs.net/24 """
22.571429
72
0.596203
108
790
4.277778
0.537037
0.095238
0.073593
0
0
0
0
0
0
0
0
0.025554
0.256962
790
35
73
22.571429
0.761499
0.989873
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
b7c327b6206469cd0cf73575f1196729fde0be3b
1,695
py
Python
nps/network_entity.py
Dry8r3aD/penta-nps
a4c74a2cd90eb2f95158e2040b7eca7056b062db
[ "MIT" ]
6
2016-09-25T07:26:22.000Z
2022-03-16T06:30:05.000Z
nps/network_entity.py
Dry8r3aD/penta-nps
a4c74a2cd90eb2f95158e2040b7eca7056b062db
[ "MIT" ]
14
2016-10-04T00:02:20.000Z
2017-02-22T03:06:21.000Z
nps/network_entity.py
Dry8r3aD/penta-nps
a4c74a2cd90eb2f95158e2040b7eca7056b062db
[ "MIT" ]
5
2016-10-06T04:53:32.000Z
2019-12-08T13:48:58.000Z
# -*- coding: UTF-8 -*- from collections import deque class NetworkEntity(object): """Client or Server simulation network entity""" def __init__(self, name): # "client" or "server" self.name = name # simulatation packet list(queue) # _packet_list contains send/recv PacketBuff self._packet_list = deque() # for scapy sniff # ex)tp0, eth0, ... self._interface_name = "" self._interface_mac_addr = "00:00:00:00:00:00" # nat!! # port random generator for DUT #self._nat_port = 0 #self._nat_magic_number = 99999 #self._use_nat_port = "False" def get_name(self): return self.name def append_packet_list(self, packet_buff): self._packet_list.append(packet_buff) def pop_packet_list(self): return self._packet_list.popleft() def get_packet_list(self): return self._packet_list def is_empty_packet_list(self): return (len(self._packet_list) == 0) def set_interface(self, iface_name, iface_mac): self._interface_name = iface_name self._interface_mac_addr = iface_mac def get_interface_name(self): return self._interface_name def get_interface_mac_addr(self): return self._interface_mac_addr # def set_use_nat_port(self, use_or_not): # self._use_nat_port = use_or_not # # def get_use_nat_port(self): # return self._use_nat_port # # def set_dut_nat_port(self, port): # self._nat_port = port # # def get_dut_nat_port(self): # return self._nat_port # # def get_nat_magic_number(self): # return self._nat_magic_number #
25.298507
54
0.645428
228
1,695
4.390351
0.267544
0.10989
0.111888
0.05994
0.16983
0.067932
0.067932
0
0
0
0
0.017502
0.258407
1,695
66
55
25.681818
0.778839
0.384071
0
0
0
0
0.016782
0
0
0
0
0
0
1
0.375
false
0
0.041667
0.25
0.708333
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
b7c3c9491c620a60056834ce6902dd96ab059f3b
3,373
py
Python
Scripts/simulation/tunable_utils/create_object.py
velocist/TS4CheatsInfo
b59ea7e5f4bd01d3b3bd7603843d525a9c179867
[ "Apache-2.0" ]
null
null
null
Scripts/simulation/tunable_utils/create_object.py
velocist/TS4CheatsInfo
b59ea7e5f4bd01d3b3bd7603843d525a9c179867
[ "Apache-2.0" ]
null
null
null
Scripts/simulation/tunable_utils/create_object.py
velocist/TS4CheatsInfo
b59ea7e5f4bd01d3b3bd7603843d525a9c179867
[ "Apache-2.0" ]
null
null
null
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\tunable_utils\create_object.py # Compiled at: 2020-05-07 00:26:47 # Size of source mod 2**32: 4106 bytes from crafting.crafting_tunable import CraftingTuning from objects.components.state import TunableStateValueReference, CommodityBasedObjectStateValue from objects.system import create_object from sims4.random import weighted_random_item from sims4.tuning.tunable import TunableReference, TunableTuple, TunableList, TunableRange, AutoFactoryInit, HasTunableSingletonFactory, TunableFactory import crafting, services, sims4 logger = sims4.log.Logger('CreateObject') class ObjectCreator(HasTunableSingletonFactory, AutoFactoryInit): @TunableFactory.factory_option def get_definition(pack_safe): return {'definition': TunableReference(description='\n The definition of the object to be created.\n ', manager=(services.definition_manager()), pack_safe=pack_safe)} FACTORY_TUNABLES = {'definition': TunableReference(description='\n The definition of the object to be created.\n ', manager=(services.definition_manager()))} def __call__(self, **kwargs): return create_object((self.definition), **kwargs) def get_object_definition(self): return self.definition def get_footprint(self): return self.definition.get_footprint() @property def id(self): return self.definition.id def _verify_tunable_quality_value_callback(instance_class, tunable_name, source, quality, weight): if quality not in CraftingTuning.QUALITY_STATE.values: logger.error('A TunableRecipeCreator {} specifies an invalid quality {}.', source, quality) class RecipeCreator(HasTunableSingletonFactory, AutoFactoryInit): FACTORY_TUNABLES = {'recipe':TunableReference(description='\n Recipe to produce an object with.\n ', manager=services.get_instance_manager(sims4.resources.Types.RECIPE)), 'weighted_quality':TunableList(description='\n A list of weighted quality in which the object will be created.\n \n If empty, it will apply a default quality.\n ', tunable=TunableTuple(description='\n A possible level of quality for this item that will be generated.\n This will be randomly chosen based off weight against other items in the list.\n ', weight=TunableRange(tunable_type=int, default=1, minimum=1), quality=TunableStateValueReference(class_restrictions=CommodityBasedObjectStateValue), verify_tunable_callback=_verify_tunable_quality_value_callback))} def __call__(self, crafter_sim=None, post_add=None, **kwargs): choices = [(quality.weight, quality.quality) for quality in self.weighted_quality] quality = weighted_random_item(choices) if choices else None return crafting.crafting_interactions.create_craftable((self.recipe), crafter_sim, quality=quality, post_add=post_add) def get_object_definition(self): return self.recipe.final_product.definition
54.403226
240
0.714794
393
3,373
5.979644
0.407125
0.025532
0.02383
0.030638
0.148936
0.120851
0.120851
0.090213
0.090213
0.090213
0
0.026716
0.201008
3,373
62
241
54.403226
0.845269
0.092499
0
0.046512
0
0.046512
0.222913
0
0
0
0
0
0
1
0.186047
false
0
0.139535
0.139535
0.581395
0.046512
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
b7c7e5d7b1958fefce1bb2170ee1a05f5b0e1bc0
444
py
Python
cobalt/__init__.py
NicolasDenoyelle/cobalt
08742676214e728ed83f3a90a118b9c020a347fd
[ "BSD-3-Clause" ]
null
null
null
cobalt/__init__.py
NicolasDenoyelle/cobalt
08742676214e728ed83f3a90a118b9c020a347fd
[ "BSD-3-Clause" ]
null
null
null
cobalt/__init__.py
NicolasDenoyelle/cobalt
08742676214e728ed83f3a90a118b9c020a347fd
[ "BSD-3-Clause" ]
null
null
null
############################################################################### # Copyright 2020 UChicago Argonne, LLC. # (c.f. AUTHORS, LICENSE) # For more info, see https://xgitlab.cels.anl.gov/argo/cobalt-python-wrapper # SPDX-License-Identifier: BSD-3-Clause ############################################################################## import subprocess from cobalt.cobalt import Cobalt, UserPolicy __all__ = [ 'Cobalt', 'UserPolicy' ]
37
79
0.481982
39
444
5.384615
0.820513
0.152381
0
0
0
0
0
0
0
0
0
0.012255
0.081081
444
11
80
40.363636
0.502451
0.391892
0
0
0
0
0.148148
0
0
0
0
0
0
1
0
false
0
0.666667
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
b7caeb322abf8aa00666ef3387b5272abace4020
528
py
Python
persons/urls.py
nhieckqo/lei
f461d8dcbc8f9e037c661abb18b226aa6fa7acae
[ "MIT" ]
null
null
null
persons/urls.py
nhieckqo/lei
f461d8dcbc8f9e037c661abb18b226aa6fa7acae
[ "MIT" ]
null
null
null
persons/urls.py
nhieckqo/lei
f461d8dcbc8f9e037c661abb18b226aa6fa7acae
[ "MIT" ]
null
null
null
from django.urls import path from . import views app_name = 'persons' urlpatterns = [ path('', views.PersonsTableView.as_view(),name='persons_list'), path('persons_details/<int:pk>',views.PersonsUpdateView.as_view(),name='persons_details_edit'), path('persons_details/create',views.PersonsCreateView.as_view(),name='persons_details_add'), path('persons_details/<int:pk>/delete',views.PersonsDeleteView.as_view(),name="persons_details_delete"), path('persons_details/sort',views.event_gate, name='sort'), ]
40.615385
108
0.753788
68
528
5.602941
0.397059
0.257218
0.104987
0.178478
0.309711
0
0
0
0
0
0
0
0.083333
528
12
109
44
0.78719
0
0
0
0
0
0.342803
0.1875
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b7cb5d32a878f3d9855d96b75ff3e715c839115f
977
py
Python
src/PyMud/Systems/system.py
NichCritic/pymud
583ec16f5a75dc7b45146564b39851291dc07b6c
[ "MIT" ]
null
null
null
src/PyMud/Systems/system.py
NichCritic/pymud
583ec16f5a75dc7b45146564b39851291dc07b6c
[ "MIT" ]
null
null
null
src/PyMud/Systems/system.py
NichCritic/pymud
583ec16f5a75dc7b45146564b39851291dc07b6c
[ "MIT" ]
null
null
null
import time class System(object): manditory = [] optional = [] handles = [] def __init__(self, node_factory): self.node_factory = node_factory def process(self): for node in self.get_nodes(): # print(f"{self.__class__.__name__} system got message from # {node.id}") self.handle(node) self.clean(node) def handle(self, node): pass def clean(self, node): [node.remove_component(c) for c in self.handles] def get_nodes(self): return self.node_factory.create_node_list(self.manditory, self.optional) class TimedSystem(System): def is_timed_out(self, lt, ct, timeout): if lt is None: return False return ct - lt > timeout def process(self): t = time.time() for node in self.get_nodes(): self.handle(node, t) self.clean(node)
23.261905
71
0.551689
117
977
4.401709
0.384615
0.07767
0.087379
0.050485
0.081553
0.081553
0
0
0
0
0
0
0.348004
977
41
72
23.829268
0.808477
0.070624
0
0.214286
0
0
0
0
0
0
0
0
0
1
0.25
false
0.035714
0.035714
0.035714
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
b7cbe1a4f3d3609804f5ba47a2634ce6c4505d36
716
py
Python
yocto/poky/bitbake/lib/bb/ui/crumbs/__init__.py
jxtxinbing/ops-build
9008de2d8e100f3f868c66765742bca9fa98f3f9
[ "Apache-2.0" ]
16
2017-01-17T15:20:43.000Z
2021-03-19T05:45:14.000Z
yocto/poky/bitbake/lib/bb/ui/crumbs/__init__.py
jxtxinbing/ops-build
9008de2d8e100f3f868c66765742bca9fa98f3f9
[ "Apache-2.0" ]
415
2016-12-20T17:20:45.000Z
2018-09-23T07:59:23.000Z
yocto/poky/bitbake/lib/bb/ui/crumbs/__init__.py
jxtxinbing/ops-build
9008de2d8e100f3f868c66765742bca9fa98f3f9
[ "Apache-2.0" ]
10
2016-12-20T13:24:50.000Z
2021-03-19T05:46:43.000Z
# # Gtk+ UI pieces for BitBake # # Copyright (C) 2006-2007 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
39.777778
73
0.765363
115
716
4.765217
0.686957
0.060219
0.071168
0.104015
0.149635
0.10219
0
0
0
0
0
0.03413
0.181564
716
17
74
42.117647
0.901024
0.951117
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
b7cc56e3520e5aa20afd04452b3d297df2206e1a
1,473
py
Python
ipmanagement/models.py
smilelhong/ip_manage
7581c596a84e943dc5dea4122eca3de14263992b
[ "Apache-2.0" ]
null
null
null
ipmanagement/models.py
smilelhong/ip_manage
7581c596a84e943dc5dea4122eca3de14263992b
[ "Apache-2.0" ]
null
null
null
ipmanagement/models.py
smilelhong/ip_manage
7581c596a84e943dc5dea4122eca3de14263992b
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from django.db import models from datetime import datetime # Create your models here. class IP_Address(models.Model): ip = models.GenericIPAddressField(verbose_name=u"IP地址") gateway = models.GenericIPAddressField(verbose_name=u"网关") network = models.GenericIPAddressField(verbose_name=u"网络号") netmask = models.CharField(max_length=20,default='',null=True,blank='',verbose_name=u"掩码") system = models.CharField(max_length=64,default='',null=True,blank='',verbose_name=u"应用系统") apply_person = models.CharField(max_length=64,default='',null=True,blank='',verbose_name=u"申请人") state = models.CharField(max_length=20,choices=((u"已分配",u"已分配"),(u"未分配",u"未分配")),verbose_name=u"状态") apply_time = models.DateField(default=datetime.now(),verbose_name=u"申请时间") class IP_Range(models.Model): start_ip = models.GenericIPAddressField(verbose_name=u"开始IP") end_ip = models.GenericIPAddressField(verbose_name=u"结束IP") network = models.GenericIPAddressField(verbose_name=u"网络号") netmask = models.CharField(max_length=20,default='',verbose_name=u"掩码") use_ip = models.CharField(max_length=20,default='',null=True,blank='',verbose_name=u"已使用IP数") left_ip = models.CharField(max_length=20,default='',null=True,blank='',verbose_name=u"未使用IP数") create_time = models.DateField(default=datetime.now(),verbose_name=u"创建时间") des = models.CharField(max_length=20,default='',null=True,blank='',verbose_name=u"描述")
64.043478
104
0.745418
209
1,473
5.095694
0.296651
0.165258
0.180282
0.180282
0.735211
0.674178
0.558685
0.558685
0.558685
0.466667
0
0.012696
0.090971
1,473
23
105
64.043478
0.782674
0.031229
0
0.1
0
0
0.047018
0
0
0
0
0
0
1
0
false
0
0.1
0
1
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b7d5141df884819f6f2e7164679f65c6fbc05ccf
5,741
py
Python
trainer.py
tkuboi/my-Punctuator
17c2c43f3397387b7c21a8ef25584c4fdab73f1b
[ "MIT" ]
3
2018-11-29T02:12:12.000Z
2020-01-15T10:52:38.000Z
trainer.py
tkuboi/my-Punctuator
17c2c43f3397387b7c21a8ef25584c4fdab73f1b
[ "MIT" ]
3
2020-01-15T10:52:25.000Z
2020-05-03T17:24:56.000Z
trainer.py
tkuboi/my-Punctuator
17c2c43f3397387b7c21a8ef25584c4fdab73f1b
[ "MIT" ]
5
2018-11-19T13:37:31.000Z
2021-06-25T07:03:38.000Z
"""This script is for training and evaluating a model.""" import sys import os import traceback import numpy as np from functools import partial from utils import * from punctuator import Punctuator from bidirectional_gru_with_gru import BidirectionalGruWithGru from keras.callbacks import ModelCheckpoint from keras.models import Model, load_model, Sequential from keras.layers import Dense, Activation, Dropout, Input, Masking, TimeDistributed, LSTM, Conv1D, Embedding, RepeatVector, Lambda, Dot, Multiply, Concatenate, Permute from keras.layers import GRU, Bidirectional, BatchNormalization, Reshape, Flatten, ThresholdedReLU from keras.optimizers import Adam EMBEDDING_FILE = 'data/glove.6B.50d.txt' MODEL_FILE = 'data/model.json' WEIGHTS_FILE = 'data/model.h5' TEXT_FILE = 'data/utterances.txt' BATCH = 128 EPOCH = 1000 DEV_SIZE = 100 def load_text_data(textfile): """Read a text file containing lines of text. Args: textfile: string representing a path name to a file Returns: list of words """ words = [] with open(textfile, 'r') as lines: for line in lines: words.extend(line.split()) return words def main(): """Train a model using lines of text contained in a file and evaluates the model. """ #read golve vecs #words, word_to_index, index_to_word, word_to_vec_map = read_glove_vecs(EMBEDDING_FILE) #create word embedding matrix #embedding_matrix = create_emb_matrix(word_to_index, word_to_vec_map) embedding_matrix = None #print('shape of embedding_matrix:', embedding_matrix.shape) #load trainig text from a file utterances = load_text_data(TEXT_FILE) punctuator = Punctuator(None, None) X, Y = punctuator.create_training_data(utterances[:3], False) print(X.shape) print(X.shape[1]) print(Y.shape) #if a model already exists, load the model if os.path.isfile(MODEL_FILE) and False: punctuator.load_model(MODEL_FILE) else: model = BidirectionalGruWithGru.create_model( input_shape=(X.shape[1], X.shape[2], ), embedding_matrix=None, vocab_len=0, n_d1=128, n_d2=128, n_c=len(punctuator.labels)) print(model.summary()) punctuator.__model__ = model #if the model has been already trained, use the pre-trained weights if os.path.isfile(WEIGHTS_FILE): punctuator.load_weights(WEIGHTS_FILE) for i in range(100): shuffle(utterances) print(utterances[0]) #create an instance of Punctutor and create training data X, Y = punctuator.create_training_data(utterances[:300000], False) #shuffle the training data shuffle(X,Y) denom_Y = Y.swapaxes(0,1).sum((0,1)) print ('Summary of Y:', denom_Y) print('shape of X:', X.shape) print(X[0:10]) print('shape of Y:', Y.shape) print(Y[0:10]) #define optimizer and compile the model opt = Adam(lr=0.007, beta_1=0.9, beta_2=0.999, decay=0.01) punctuator.compile(opt, loss='categorical_crossentropy', metrics=['accuracy']) #split the training data into training set, test set, and dev set t_size = int(X.shape[0] * 0.9) train_X, train_Y = X[:t_size], Y[:t_size] test_X, test_Y = X[t_size:-DEV_SIZE], Y[t_size:-DEV_SIZE] dev_X, dev_Y = X[-DEV_SIZE:], Y[-DEV_SIZE:] print (train_Y.swapaxes(0,1).sum((0,1))) print (test_Y.swapaxes(0,1).sum((0,1))) #train the model punctuator.fit([train_X], train_Y, batch_size = BATCH, epochs=EPOCH) punctuator.save_model(MODEL_FILE) punctuator.save_weights(WEIGHTS_FILE) #evaluate the model on the dev set (or the test set) for i,example in enumerate(dev_X): prediction = punctuator.predict(example) punctuator.check_result(prediction, dev_Y[i]) #manually evaluate the model on an example examples = ["good morning chairman who I saw and members of the committee it's my pleasure to be here today I'm Elizabeth Ackles director of the office of rate payer advocates and I appreciate the chance to present on oris key activities from 2017 I have a short presentation and I'm going to move through it really quickly because you've had a long morning already and be happy to answer any questions that you have", "this was a measure that first was introduced back in 1979 known as the International bill of rights for women it is the first and only international instrument that comprehensively addresses women's rights within political cultural economic social and family life", "I'm Elizabeth Neumann from the San Francisco Department on the status of women Sita is not just about naming equal rights for women and girls it provides a framework to identify and address inequality", "we have monitored the demographics of commissioners and board members in San Francisco to assess the equality of political opportunities and after a decade of reports women are now half of appointees but white men are still over-represented and Asian and Latina men and women are underrepresented", "when the city and county faced a 300 million dollar budget deficit in 2003 a gender analysis of budget cuts by city departments identified the disproportionate effect on women and particularly women of color in the proposed layoffs and reduction of services"] for example in examples: words = example.split() x = punctuator.create_live_data(words) print x for s in x: print s prediction = punctuator.predict(s) result = punctuator.add_punctuation(prediction, words) print(result) if __name__ == "__main__": main()
43.492424
1,454
0.708413
849
5,741
4.673734
0.376914
0.014113
0.009073
0.008317
0.034778
0.034778
0.034778
0.010585
0
0
0
0.019699
0.213029
5,741
131
1,455
43.824427
0.858566
0.118795
0
0
0
0.060976
0.330025
0.009502
0
0
0
0
0
0
null
null
0
0.158537
null
null
0.182927
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
b7dd25cebefde2e55f7311a4ace4a861586de3c9
1,299
py
Python
lims/models/shipping.py
razorlabs/BRIMS-backend
2c5b7bd126debec459b775e9d11e96fc09975059
[ "MIT" ]
1
2020-03-20T23:00:24.000Z
2020-03-20T23:00:24.000Z
lims/models/shipping.py
razorlabs/BRIMS-backend
2c5b7bd126debec459b775e9d11e96fc09975059
[ "MIT" ]
null
null
null
lims/models/shipping.py
razorlabs/BRIMS-backend
2c5b7bd126debec459b775e9d11e96fc09975059
[ "MIT" ]
1
2020-03-09T09:57:25.000Z
2020-03-09T09:57:25.000Z
from django.db import models """ ShipmentModels have a one to many relationship with boxes and aliquot Aliquot and Box foreign keys to a ShipmentModel determine manifest contents for shipping purposes (resolved in schema return for manifest view) """ class ShipmentModel(models.Model): carrier = models.ForeignKey('CarrierModel', on_delete=models.SET_NULL, blank=True, null=True) shipment_number = models.CharField(max_length=255, blank=True, null=True) # TODO What should we do if a destination is removed? destination = models.ForeignKey('DestinationModel', on_delete=models.SET_NULL, blank=True, null=True) sent_date = models.DateTimeField(blank=True, null=True) received_date = models.DateTimeField(blank=True, null=True) notes = models.CharField(max_length=255, blank=True, null=True) class DestinationModel(models.Model): name = models.CharField(max_length=255) def __str__(self): return self.name class CarrierModel(models.Model): name = models.CharField(max_length=255) def __str__(self): return self.name
34.184211
79
0.628176
146
1,299
5.458904
0.458904
0.067754
0.097867
0.12798
0.471769
0.471769
0.471769
0.371393
0.371393
0.165621
0
0.013115
0.295612
1,299
37
80
35.108108
0.857924
0.039261
0
0.545455
0
0
0.027695
0
0
0
0
0.027027
0
1
0.090909
false
0
0.045455
0.090909
0.727273
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
b7f255f31605c7a9c29e736bc41dc0df25f503be
294
py
Python
tests/test_xmllint_map_html.py
sthagen/python-xmllint_map_html
23363cfe1c126bc72efddf8fea084283375e2204
[ "MIT" ]
null
null
null
tests/test_xmllint_map_html.py
sthagen/python-xmllint_map_html
23363cfe1c126bc72efddf8fea084283375e2204
[ "MIT" ]
16
2020-09-11T11:07:09.000Z
2020-12-06T16:42:18.000Z
tests/test_xmllint_map_html.py
sthagen/python-xmllint_map_html
23363cfe1c126bc72efddf8fea084283375e2204
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # pylint: disable=missing-docstring,unused-import,reimported import json import pytest # type: ignore import xmllint_map_html.xmllint_map_html as xmh def test_parse_ok_minimal(): job = ['[]'] parser = xmh.parse(job) assert next(parser) == NotImplemented
22.615385
60
0.714286
39
294
5.205128
0.74359
0.098522
0.137931
0
0
0
0
0
0
0
0
0.004049
0.159864
294
12
61
24.5
0.817814
0.316327
0
0
0
0
0.010152
0
0
0
0
0
0.142857
1
0.142857
false
0
0.428571
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
0
0
0
1
0
1
0
0
2
4d01262d0ab1840560717880a8567c3e85b8f930
1,082
py
Python
tests/application/register/test_views.py
AlexKouzy/ethnicity-facts-and-figures-publisher
18ab2495a8633f585e18e607c7f75daa564a053d
[ "MIT" ]
1
2021-10-06T13:48:36.000Z
2021-10-06T13:48:36.000Z
tests/application/register/test_views.py
AlexKouzy/ethnicity-facts-and-figures-publisher
18ab2495a8633f585e18e607c7f75daa564a053d
[ "MIT" ]
116
2018-11-02T17:20:47.000Z
2022-02-09T11:06:22.000Z
tests/application/register/test_views.py
racedisparityaudit/rd_cms
a12f0e3f5461cc41eed0077ed02e11efafc5dd76
[ "MIT" ]
2
2018-11-09T16:47:35.000Z
2020-04-09T13:06:48.000Z
from bs4 import BeautifulSoup from flask import url_for from application.utils import generate_token from application.auth.models import TypeOfUser from tests.models import UserFactory def test_confirm_account_rejects_easy_password(app, test_app_client): rdu_user = UserFactory(user_type=TypeOfUser.RDU_USER, active=False) token = generate_token(rdu_user.email, app) confirmation_url = url_for("register.confirm_account", token=token, _external=True) rdu_user.active = False user_details = {"password": "long-enough-but-too-easy", "confirm_password": "long-enough-but-too-easy"} resp = test_app_client.post(confirmation_url, data=user_details, follow_redirects=True) page = BeautifulSoup(resp.data.decode("utf-8"), "html.parser") assert ( page.find("div", class_="eff-flash-message__body").text.strip() == """Your password is too weak. It has to be at least 10 characters long and use a mix of numbers, special characters as well as upper and lowercase letters. Avoid using common patterns and repeated characters.""" )
38.642857
115
0.756932
153
1,082
5.163399
0.581699
0.035443
0.032911
0.04557
0.070886
0.070886
0
0
0
0
0
0.004329
0.146026
1,082
27
116
40.074074
0.850649
0
0
0
1
0.055556
0.31793
0.0878
0
0
0
0
0.055556
1
0.055556
false
0.166667
0.277778
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
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
4d1842ad937506e0139c4548364f4972688cf066
606
py
Python
lgtv_rs232/commands/power.py
davo22/lgtv_rs232
40562cddf7acdf6fa95124029595e3838dd9e7b0
[ "MIT" ]
null
null
null
lgtv_rs232/commands/power.py
davo22/lgtv_rs232
40562cddf7acdf6fa95124029595e3838dd9e7b0
[ "MIT" ]
null
null
null
lgtv_rs232/commands/power.py
davo22/lgtv_rs232
40562cddf7acdf6fa95124029595e3838dd9e7b0
[ "MIT" ]
null
null
null
from enum import Enum class Power(Enum): OFF = 0 ON = 1 def map_to_state(data: int): return Power(data) class PowerCommands(object): _command = "ka" def __init__(self, send_command): self._send_command = send_command async def get_state(self): return map_to_state(await self._send_command(self._command, 255)) async def set_state(self, state: Power): return map_to_state(await self._send_command(self._command, state.value)) def on(self): return self.set_state(Power.ON) def off(self): return self.set_state(Power.OFF)
20.2
81
0.671617
88
606
4.340909
0.329545
0.143979
0.157068
0.149215
0.387435
0.387435
0.246073
0.246073
0.246073
0.246073
0
0.010707
0.229373
606
29
82
20.896552
0.807281
0
0
0
0
0
0.0033
0
0
0
0
0
0
1
0.222222
false
0
0.055556
0.166667
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2