hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2098e6c83ceaacb23c61f4fef967a43a0da02414 | 2,916 | py | Python | src/train_xgb_FE.py | sin1012/approach-tabular-competitions | 660995ba6c1d42006bce01a90fa04bce507f4c16 | [
"MIT"
] | null | null | null | src/train_xgb_FE.py | sin1012/approach-tabular-competitions | 660995ba6c1d42006bce01a90fa04bce507f4c16 | [
"MIT"
] | null | null | null | src/train_xgb_FE.py | sin1012/approach-tabular-competitions | 660995ba6c1d42006bce01a90fa04bce507f4c16 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import config
import os
import joblib
from sklearn import metrics
from sklearn import preprocessing
import xgboost as xgb
from feature_engineering import feature_engineering
import warnings
warnings.filterwarnings('ignore')
def train(fold):
df = pd.read_csv(config.training_fi... | 28.038462 | 88 | 0.656379 |
362565fd4ae13ebe5c0e0c59366188f1268a50ab | 5,315 | py | Python | guide.py | NAKKA-K/raspi-pedestrian-signs | 64016db54f74ccce9c592082e894c9068da8b5c6 | [
"MIT"
] | null | null | null | guide.py | NAKKA-K/raspi-pedestrian-signs | 64016db54f74ccce9c592082e894c9068da8b5c6 | [
"MIT"
] | null | null | null | guide.py | NAKKA-K/raspi-pedestrian-signs | 64016db54f74ccce9c592082e894c9068da8b5c6 | [
"MIT"
] | null | null | null | # making now ...
import threading
import os
import RPi.GPIO as GPIO
import pygame.mixer
class BoardInfo(object):
STATE_LED = 1
STATE_BLUE = 2
STATE_FLASH = 3
def __init__(self, sw_pin=18, led_LED_pin=21, blue_LED_pin=20):
self.sw_pin = sw_pin
self.led_LED_pin = led_LED_pin
self... | 28.88587 | 108 | 0.623518 |
f36696c80e97352d002f772de9a12918802353d0 | 459 | py | Python | training/training_code/dataset/constants.py | Bhaskers-Blu-Org1/MAX-Recommender | a39da6d7f6028b56eada029461e18d3932d9fc88 | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:13.000Z | 2021-01-11T18:40:13.000Z | training/training_code/dataset/constants.py | kiminh/MAX-Recommender | 044525fa74af25ba3b8611695527eeea4b3ccf14 | [
"Apache-2.0"
] | null | null | null | training/training_code/dataset/constants.py | kiminh/MAX-Recommender | 044525fa74af25ba3b8611695527eeea4b3ccf14 | [
"Apache-2.0"
] | 1 | 2020-07-30T10:33:47.000Z | 2020-07-30T10:33:47.000Z | # Default column names
DEFAULT_USER_COL = "userID"
DEFAULT_ITEM_COL = "itemID"
DEFAULT_RATING_COL = "rating"
DEFAULT_LABEL_COL = "label"
DEFAULT_TIMESTAMP_COL = "timestamp"
DEFAULT_PREDICTION_COL = "prediction"
COL_DICT = {
"col_user": DEFAULT_USER_COL,
"col_item": DEFAULT_ITEM_COL,
"col_rating": DEFAULT_... | 22.95 | 44 | 0.760349 |
5965b025a7b55c94a71b22e9c12fd24674fc3a28 | 628 | py | Python | cybot/plug/start.py | francis-taylor/Timotty-Bot | 2cf7c9897ed31d26d331594e2578b253e3b970d8 | [
"MIT"
] | 6 | 2017-10-18T14:22:48.000Z | 2017-10-26T15:14:52.000Z | cybot/plug/start.py | Fr4ncisTaylor/Timotty | 2cf7c9897ed31d26d331594e2578b253e3b970d8 | [
"MIT"
] | 1 | 2017-10-20T19:16:03.000Z | 2017-10-20T19:16:03.000Z | cybot/plug/start.py | Fr4ncisTaylor/Timotty | 2cf7c9897ed31d26d331594e2578b253e3b970d8 | [
"MIT"
] | 7 | 2017-10-18T14:19:52.000Z | 2017-10-22T15:23:33.000Z | # -*- coding: utf-8 -*-
import mensagens
from inline import inline_keyboard
from metodos import *
m = mensagens
def start(msg):
if 'text' in msg:
texto = msg[u'text']
chat_id = msg['chat']['id']
nome = msg['from'][u'first_name']
from_id = msg['from']['id']
if texto == '/s... | 28.545455 | 87 | 0.557325 |
d0a8194e0de050382cd4161dee3beac6475c12a8 | 1,446 | py | Python | src/ttu_encoder/mentioned_persons.py | ediewilson/ddhi-encoder | 020e7e5b237ce2d1d329432d5842fbe8dc8abcca | [
"MIT"
] | null | null | null | src/ttu_encoder/mentioned_persons.py | ediewilson/ddhi-encoder | 020e7e5b237ce2d1d329432d5842fbe8dc8abcca | [
"MIT"
] | null | null | null | src/ttu_encoder/mentioned_persons.py | ediewilson/ddhi-encoder | 020e7e5b237ce2d1d329432d5842fbe8dc8abcca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import sys
import csv
from ttu_encoder.ne_extractor import NeExtractor
from ttu_encoder import __version__
__author__ = "Clifford Wulfman"
__copyright__ = "Clifford Wulfman"
__license__ = "mit"
def to_tsv(list, stream=sys.stdout):
writer = csv.DictWriter(stream,
... | 23.704918 | 67 | 0.618257 |
13c7f604e0acf1acd8ca666cb750d2f80c9b3e28 | 926 | py | Python | 0653_TwoSumBSTree.py | zsyc/LeetAlgo | 70793a26900824e308f69ec2b2299e04eb9c7646 | [
"MIT"
] | null | null | null | 0653_TwoSumBSTree.py | zsyc/LeetAlgo | 70793a26900824e308f69ec2b2299e04eb9c7646 | [
"MIT"
] | null | null | null | 0653_TwoSumBSTree.py | zsyc/LeetAlgo | 70793a26900824e308f69ec2b2299e04eb9c7646 | [
"MIT"
] | null | null | null | """
值得注意的是特性:
二叉查找树(英语:Binary Search Tree),也称为二叉搜索树、***有序***二叉树(ordered binary tree)或排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树:
若任意节点的左子树不空,则左子树上所有节点的值均小于它的根节点的值;
若任意节点的右子树不空,则右子树上所有节点的值均大于它的根节点的值;
任意节点的左、右子树也分别为二叉查找树;
没有键值相等的节点。
本题首先遍历所有值,放入一个无序集合set,然后进行搜索。"""
# Definition for a binary tree node.
# class TreeNo... | 26.457143 | 116 | 0.62203 |
c8bc815c4dba25c6ba27a8d715efb676a179bfdb | 1,583 | py | Python | docs/src/parse_ranking2.py | vishalbelsare/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 61 | 2015-03-06T08:48:01.000Z | 2021-04-26T16:13:07.000Z | docs/src/parse_ranking2.py | andrecamara/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 5 | 2016-09-08T15:47:00.000Z | 2019-02-25T17:44:55.000Z | docs/src/parse_ranking2.py | vishalbelsare/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 31 | 2015-01-28T15:05:33.000Z | 2021-04-16T19:39:48.000Z | import numpy as np
from rlscore.learner import QueryRankRLS
from rlscore.measure import cindex
from rlscore.utilities.reader import read_sparse
from rlscore.utilities.cross_validation import map_ids
def train_rls():
#Select regparam with k-fold cross-validation,
#where instances related to a single sentence fo... | 35.977273 | 64 | 0.67909 |
2d1509929b6bfd6ac54cfaab9377d8a8c6f2cd2b | 2,626 | py | Python | python/crr/scattered/roll_zeropad.py | blanton144/crr | f4edd1bf3f4f1f7ea5d0f8bc3e14e223c83e02c1 | [
"BSD-3-Clause"
] | null | null | null | python/crr/scattered/roll_zeropad.py | blanton144/crr | f4edd1bf3f4f1f7ea5d0f8bc3e14e223c83e02c1 | [
"BSD-3-Clause"
] | null | null | null | python/crr/scattered/roll_zeropad.py | blanton144/crr | f4edd1bf3f4f1f7ea5d0f8bc3e14e223c83e02c1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
def roll_zeropad(a, shift, axis=None):
"""
Roll array elements along a given axis.
Elements off the end of the array are treated as zeros.
Parameters
----------
a : array_like
Input array.
shift : int
The number of places by which elements are shifted.
... | 27.072165 | 76 | 0.476009 |
689206e51b9e2a34b7e43ac4df5cd34d0608c68a | 4,853 | py | Python | utils/dataloader_medical.py | Rossettaylm/unet_for_jamming_segmentation | 4c9898e4f4093d0deb6266b0380007d729857788 | [
"MIT"
] | 2 | 2021-12-03T04:39:15.000Z | 2021-12-09T14:33:17.000Z | utils/dataloader_medical.py | Rossettaylm/unet_for_jamming_segmentation | 4c9898e4f4093d0deb6266b0380007d729857788 | [
"MIT"
] | null | null | null | utils/dataloader_medical.py | Rossettaylm/unet_for_jamming_segmentation | 4c9898e4f4093d0deb6266b0380007d729857788 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
from PIL import Image
from torch.utils.data.dataset import Dataset
from utils.utils import cvtColor, preprocess_input
class UnetDataset(Dataset):
def __init__(self, annotation_lines, input_shape, num_classes, train, dataset_path):
super(UnetDataset, self).__init__... | 35.948148 | 116 | 0.514733 |
a9856b65dc900dfd345b892a85c6d9281d9093a5 | 1,652 | py | Python | dask/array/tests/test_wrap.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2018-12-29T13:47:40.000Z | 2018-12-29T13:47:49.000Z | dask/array/tests/test_wrap.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2019-03-19T22:19:04.000Z | 2019-03-26T19:04:00.000Z | dask/array/tests/test_wrap.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 1 | 2021-03-28T04:50:43.000Z | 2021-03-28T04:50:43.000Z | import pytest
pytest.importorskip('numpy')
from dask.array.wrap import ones
import dask.array as da
import numpy as np
def test_ones():
a = ones((10, 10), dtype='i4', chunks=(4, 4))
x = np.array(a)
assert (x == np.ones((10, 10), 'i4')).all()
assert a.name.startswith('ones-')
def test_size_as_list(... | 28.482759 | 75 | 0.580508 |
8e3403d70ad12c321735861a6fc4686da1cdc3e8 | 13,002 | py | Python | disnake/asset.py | Kraots/disnake | 9eb9ab81915dae7249ffb2b757dd6dee6090341e | [
"MIT"
] | null | null | null | disnake/asset.py | Kraots/disnake | 9eb9ab81915dae7249ffb2b757dd6dee6090341e | [
"MIT"
] | null | null | null | disnake/asset.py | Kraots/disnake | 9eb9ab81915dae7249ffb2b757dd6dee6090341e | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 30.378505 | 102 | 0.581603 |
c51b5f2f26d17474545aecfe05351eeafbca8ed0 | 989 | py | Python | heat/engine/clients/os/vitrage.py | odmanV2/heat | 76c20f1fc94a06ce5a00730c50952efe19ed0e3e | [
"Apache-2.0"
] | 265 | 2015-01-02T09:33:22.000Z | 2022-03-26T23:19:54.000Z | heat/engine/clients/os/vitrage.py | HyunJin-Jeong/heat | 8353fddf9ebfb0eca67d6f2b2feb529031acff89 | [
"Apache-2.0"
] | 8 | 2015-09-01T15:43:19.000Z | 2021-12-14T05:18:23.000Z | heat/engine/clients/os/vitrage.py | HyunJin-Jeong/heat | 8353fddf9ebfb0eca67d6f2b2feb529031acff89 | [
"Apache-2.0"
] | 295 | 2015-01-06T07:00:40.000Z | 2021-09-06T08:05:06.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 31.903226 | 78 | 0.741153 |
4d0e71c5cf9fd179ecdf4a35c61c8414810d6a00 | 826 | py | Python | app/main/forms.py | Vector254/pitcher | 1eccdae41b8a639aef9bb7319ec86437ded60709 | [
"MIT"
] | null | null | null | app/main/forms.py | Vector254/pitcher | 1eccdae41b8a639aef9bb7319ec86437ded60709 | [
"MIT"
] | null | null | null | app/main/forms.py | Vector254/pitcher | 1eccdae41b8a639aef9bb7319ec86437ded60709 | [
"MIT"
] | 1 | 2020-10-02T14:41:40.000Z | 2020-10-02T14:41:40.000Z | from flask_wtf import FlaskForm
from wtforms import StringField,PasswordField,SubmitField,BooleanField,SubmitField,TextAreaField,RadioField
from wtforms.validators import Required,Email,EqualTo
from wtforms import ValidationError
class PitchForm(FlaskForm):
title = StringField("title",validators=[Required()])
pitc... | 34.416667 | 201 | 0.780872 |
74e5ce410f0dcddfca38dddd48fd7be59c6705ec | 369 | py | Python | Leetcode/week_1/p0557_reverse_words_in_a_string_iii.py | SamSamhuns/wallbreakers_projekts | c07b555127ee89d6f461cea7cd87811c382086ff | [
"MIT"
] | 1 | 2021-07-07T00:55:23.000Z | 2021-07-07T00:55:23.000Z | Leetcode/week_1/p0557_reverse_words_in_a_string_iii.py | SamSamhuns/wallbreakers_projekts | c07b555127ee89d6f461cea7cd87811c382086ff | [
"MIT"
] | null | null | null | Leetcode/week_1/p0557_reverse_words_in_a_string_iii.py | SamSamhuns/wallbreakers_projekts | c07b555127ee89d6f461cea7cd87811c382086ff | [
"MIT"
] | null | null | null | class Solution:
def reverseWords(self, s: str) -> str:
return ' '.join([word[::-1] for word in s.split()])
"""
Runtime: O(4N) ~ O(N)
Space: O(N)
Runtime: 28 ms, faster than 86.92% of Python3 online submissions for Reverse Words in a String III.
Memory Usage: 13.2 MB, less than 96.15% of Python3 online su... | 28.384615 | 104 | 0.669377 |
d7aa580558eb445a73acd6467eb92eb2bc8465c2 | 191 | py | Python | metrics-calculator/chalicelib/get_splunk_api_token.py | nhsconnect/prm-practice-migration-dashboard | 40c8760f409834d05bde4fb015aa5f8765acaa82 | [
"0BSD"
] | null | null | null | metrics-calculator/chalicelib/get_splunk_api_token.py | nhsconnect/prm-practice-migration-dashboard | 40c8760f409834d05bde4fb015aa5f8765acaa82 | [
"0BSD"
] | null | null | null | metrics-calculator/chalicelib/get_splunk_api_token.py | nhsconnect/prm-practice-migration-dashboard | 40c8760f409834d05bde4fb015aa5f8765acaa82 | [
"0BSD"
] | null | null | null | def get_splunk_api_token(ssm, parameter_name):
parameter_details = ssm.get_parameter(
Name=parameter_name, WithDecryption=True)
return parameter_details['Parameter']['Value']
| 38.2 | 50 | 0.764398 |
f6b48ccb678dee964cc7b12444188b97e73802e7 | 276 | py | Python | Task_4/Q1_part_d.py | ayyzenn/Python_Codes | cdcd9dcb9e4301c4a84637a40eaad357d59a32d8 | [
"MIT"
] | null | null | null | Task_4/Q1_part_d.py | ayyzenn/Python_Codes | cdcd9dcb9e4301c4a84637a40eaad357d59a32d8 | [
"MIT"
] | null | null | null | Task_4/Q1_part_d.py | ayyzenn/Python_Codes | cdcd9dcb9e4301c4a84637a40eaad357d59a32d8 | [
"MIT"
] | null | null | null | #Question:1 part d
with open('names.txt', 'r') as n:
sum_of_length =0
for i in n:
sum_of_length+= len(i) -1
n=open("names.txt","r")
z=len(n.read().split())
z
avg=sum_of_length/z
avg
print("The Average of the lengths of the names in names.txt is",avg)
n.close() | 23 | 68 | 0.652174 |
3abe0173728a43474bf2fc0ed8b2fd9b817d4595 | 36,415 | py | Python | oletools/oleobj.py | n3m351d4/oletools | 15aad9601302c164fccb20020bf98699364ad78c | [
"BSD-2-Clause"
] | null | null | null | oletools/oleobj.py | n3m351d4/oletools | 15aad9601302c164fccb20020bf98699364ad78c | [
"BSD-2-Clause"
] | null | null | null | oletools/oleobj.py | n3m351d4/oletools | 15aad9601302c164fccb20020bf98699364ad78c | [
"BSD-2-Clause"
] | 1 | 2020-07-25T00:23:51.000Z | 2020-07-25T00:23:51.000Z | #!/usr/bin/env python
"""
oleobj.py
oleobj is a Python script and module to parse OLE objects and files stored
into various MS Office file formats (doc, xls, ppt, docx, xlsx, pptx, etc)
Author: Philippe Lagadec - http://www.decalage.info
License: BSD, see source code or documentation
oleobj is part of the python-ole... | 38.616119 | 101 | 0.595798 |
a94f0352cd02843bf926b926dd2be63d28db4695 | 1,211 | py | Python | framebuf/framebuf.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 126 | 2019-07-19T14:42:41.000Z | 2022-03-21T22:22:19.000Z | framebuf/framebuf.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 38 | 2019-08-28T01:46:31.000Z | 2022-03-17T05:46:51.000Z | framebuf/framebuf.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 55 | 2019-08-02T09:32:33.000Z | 2021-12-22T11:25:51.000Z | # (c) 2018 Paul Sokolovsky. MIT license.
from usdl2 import *
RGB888 = 1
class FrameBuffer:
def __init__(self, buffer, width, height, format, stride=None):
if stride is None:
stride = width
self.win = SDL_CreateWindow(
"Pycopy FrameBuffer",
SDL_WINDOWPOS_UNDEF... | 27.522727 | 96 | 0.603633 |
79f4ce6e7a80503e20806a19c7e5886f1a8558c3 | 2,150 | py | Python | pysaint/constants.py | puroong/pysaint | 484cc4e819b61068e628ae70f96fc4e4a8213c27 | [
"MIT"
] | 33 | 2018-08-21T05:48:01.000Z | 2021-07-09T04:46:36.000Z | pysaint/constants.py | puroong/pysaint | 484cc4e819b61068e628ae70f96fc4e4a8213c27 | [
"MIT"
] | 9 | 2019-07-26T20:56:36.000Z | 2021-02-02T03:51:54.000Z | pysaint/constants.py | puroong/pysaint | 484cc4e819b61068e628ae70f96fc4e4a8213c27 | [
"MIT"
] | 10 | 2019-07-25T14:50:00.000Z | 2021-07-11T22:53:08.000Z | SOURCE_URL = "http://ecc.ssu.ac.kr/sap/bc/webdynpro/sap/zcmw2100?sap-language=KO"
ECC_URL = "http://ecc.ssu.ac.kr"
SAINT_URL = "https://saint.ssu.ac.kr"
PORTAL_URL = "https://saint.ssu.ac.kr/irj/portal"
POPUP_URL = "https://saint.ssu.ac.kr/ssu_logon/jsp/popupCheck.jsp"
REQUEST_HEADERS = {
'Accept': 'text/html,appl... | 37.068966 | 128 | 0.618605 |
887276956a9e20429defc1119ff63b8b7d7ccec7 | 1,515 | py | Python | pythonrpc.py | fujimotomh/python-rpc | 7b59724986dc4751bb80c165604e368f079fa833 | [
"MIT"
] | 1 | 2017-06-08T11:03:34.000Z | 2017-06-08T11:03:34.000Z | pythonrpc.py | fujimotomh/python-rpc | 7b59724986dc4751bb80c165604e368f079fa833 | [
"MIT"
] | null | null | null | pythonrpc.py | fujimotomh/python-rpc | 7b59724986dc4751bb80c165604e368f079fa833 | [
"MIT"
] | null | null | null | from __future__ import print_function
import io
import time
import requests
import pickle
from six.moves.BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class RPCServer(HTTPServer):
def __init__(self, func, local=False, port=8080, verbose=False):
self.func = func
self.verbose = verbose
... | 25.25 | 74 | 0.60132 |
ad4a10a8ad27e8ae24eeff6369762fea64a00c6e | 20,083 | py | Python | openstack_dashboard/dashboards/admin/networks/subnets/tests.py | kbujold/stx-horizon | a9454b7fe7ac74f76f0362b8c978673b89e5aa0c | [
"Apache-2.0"
] | 37 | 2018-10-30T02:47:24.000Z | 2021-12-04T10:29:40.000Z | openstack_dashboard/dashboards/admin/networks/subnets/tests.py | kbujold/stx-horizon | a9454b7fe7ac74f76f0362b8c978673b89e5aa0c | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/admin/networks/subnets/tests.py | kbujold/stx-horizon | a9454b7fe7ac74f76f0362b8c978673b89e5aa0c | [
"Apache-2.0"
] | 35 | 2018-11-26T03:36:31.000Z | 2021-12-04T10:29:41.000Z | # Copyright 2012 NEC Corporation
# Copyright 2015 Cisco Systems, 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
#
# Un... | 45.956522 | 79 | 0.566001 |
7c6d31b297ba398435ddbad716a9d15745082f68 | 17,368 | py | Python | tests/python/unittest/test_hybrid_script.py | liwchang/tvm | 00f80d12bbaa7efd1a1e8e4fbee023bfd81be9f9 | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_hybrid_script.py | liwchang/tvm | 00f80d12bbaa7efd1a1e8e4fbee023bfd81be9f9 | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_hybrid_script.py | liwchang/tvm | 00f80d12bbaa7efd1a1e8e4fbee023bfd81be9f9 | [
"Apache-2.0"
] | null | null | null | import tvm, inspect, sys, traceback, numpy, nose, types
from tvm.hybrid import script
from tvm.hybrid.intrin import HYBRID_GLOBALS
@nose.tools.nottest
def run_and_check(func, args, var_dict={}, target='llvm'):
def tvm_val_2_py_val(val):
val = tvm.ir_pass.Substitute(val, var_dict)
val = tvm.ir_pass.... | 29.739726 | 96 | 0.545947 |
c213c2497628c22e01d1462416d868581d5910e7 | 4,419 | py | Python | hpobench/container/benchmarks/nas/tabular_benchmarks.py | pfistfl/HPOBench | a7ad8807bd2e058ff99f703ad057b64ecadd4b66 | [
"Apache-2.0"
] | 78 | 2017-01-14T14:25:55.000Z | 2020-09-30T22:57:14.000Z | hpobench/container/benchmarks/nas/tabular_benchmarks.py | pfistfl/HPOBench | a7ad8807bd2e058ff99f703ad057b64ecadd4b66 | [
"Apache-2.0"
] | 84 | 2016-11-24T15:19:20.000Z | 2020-11-09T11:34:19.000Z | hpobench/container/benchmarks/nas/tabular_benchmarks.py | pfistfl/HPOBench | a7ad8807bd2e058ff99f703ad057b64ecadd4b66 | [
"Apache-2.0"
] | 31 | 2016-11-29T19:56:06.000Z | 2020-07-10T04:13:33.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
""" Benchmark for the Tabular Benchmark from hpobench/benchmarks/nas/tabular_benchmarks.py """
from hpobench.container.client_abstract_benchmark import AbstractBenchmarkClient
class SliceLocalizationBenchmark(AbstractBenchmarkClient):
def __init__(self, **kwargs):
... | 51.988235 | 108 | 0.728898 |
7f5652e0f111dfec2b7dfd1863d1975415ccc374 | 2,524 | py | Python | nnvm/examples/benchmark/cuda_imagenet_bench.py | CynthiaProtector/helo | ad9e22363a92389b3fa519ecae9061c6ead28b05 | [
"Apache-2.0"
] | 9 | 2019-04-19T04:45:18.000Z | 2021-01-07T06:31:15.000Z | src/nnvm/examples/benchmark/cuda_imagenet_bench.py | tashby/turicreate | 7f07ce795833d0c56c72b3a1fb9339bed6d178d1 | [
"BSD-3-Clause"
] | 3 | 2021-09-08T02:18:00.000Z | 2022-03-12T00:39:44.000Z | src/nnvm/examples/benchmark/cuda_imagenet_bench.py | tashby/turicreate | 7f07ce795833d0c56c72b3a1fb9339bed6d178d1 | [
"BSD-3-Clause"
] | 5 | 2019-09-18T20:21:23.000Z | 2020-11-22T11:18:15.000Z | """ Benchmark script for performance on GPUs. For example, run the file with: `python cuda_imagenet_bench.py --model='mobilenet'`. For more details about how to set up the inference environment on GPUs, please refer to NNVM Tutorial: ImageNet Inference on the GPU """
import time
import argparse
import numpy as np
impor... | 37.671642 | 267 | 0.66878 |
4ff4671ef7ff6d402f4c0dcf834c666e0c0d16da | 7,742 | py | Python | isso/ext/notifications.py | matolivier/isso | 784e08170ab8694ef610564305e6382a482f78b0 | [
"MIT"
] | null | null | null | isso/ext/notifications.py | matolivier/isso | 784e08170ab8694ef610564305e6382a482f78b0 | [
"MIT"
] | null | null | null | isso/ext/notifications.py | matolivier/isso | 784e08170ab8694ef610564305e6382a482f78b0 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import sys
import io
import time
import json
import socket
import smtplib
from email.utils import formatdate
from email.header import Header
from email.mime.text import MIMEText
try:
from urllib.parse import quote
except ImportError:
from ur... | 32.805085 | 121 | 0.574787 |
0de39e43b1d3159c7f32b3f2717c2b3b35bd27de | 1,005 | py | Python | startup/12-xbpms.py | mrakitin/profile_collection-smi | 1eea45a3b886b2c0daeec715ce94f27da24d0ba3 | [
"BSD-3-Clause"
] | null | null | null | startup/12-xbpms.py | mrakitin/profile_collection-smi | 1eea45a3b886b2c0daeec715ce94f27da24d0ba3 | [
"BSD-3-Clause"
] | null | null | null | startup/12-xbpms.py | mrakitin/profile_collection-smi | 1eea45a3b886b2c0daeec715ce94f27da24d0ba3 | [
"BSD-3-Clause"
] | null | null | null | print(f'Loading {__file__}')
from ophyd import EpicsMotor, EpicsSignalRO, EpicsSignal, Device, Component as Cpt, PseudoPositioner
# xbpm2 positioner shortcut for scans 5 april 2017
# Note: this class isn't really different from APER ifle only motor axes
# are here. But I can imagine inputting numerical values pertai... | 29.558824 | 100 | 0.728358 |
e8804c193abead81f086a2968812e96faf1cd938 | 3,555 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/page_block_embed_post.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/page_block_embed_post.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/page_block_embed_post.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram 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... | 33.857143 | 176 | 0.607032 |
63db13c56ba78d2fd4e8bb3a47237113853905ea | 872 | py | Python | samples/regression/models/L0RF1/train_model.py | jimthompson5802/model-stacking-framework | 486461340c41072627a8c6c69ef6902297d2ada7 | [
"MIT"
] | 3 | 2018-06-10T23:45:52.000Z | 2019-08-04T08:08:05.000Z | samples/regression/models/L0RF1/train_model.py | jimthompson5802/model-stacking-framework | 486461340c41072627a8c6c69ef6902297d2ada7 | [
"MIT"
] | 25 | 2018-06-09T11:08:00.000Z | 2019-02-06T22:47:26.000Z | samples/regression/models/L0RF1/train_model.py | jimthompson5802/model-stacking-framework | 486461340c41072627a8c6c69ef6902297d2ada7 | [
"MIT"
] | 1 | 2018-06-10T23:45:53.000Z | 2018-06-10T23:45:53.000Z | # -*- coding: utf-8 -*-
#%%
from msw.model_stacking import ModelTrainer, ModelPerformanceTracker
from sklearn.ensemble import RandomForestRegressor as ThisModel
#%%
#
# Set up model for training
#
this_model = ModelTrainer(
ModelClass=ThisModel, #Model algorithm
model_params=dict(n_estimators=20,n_job... | 18.956522 | 71 | 0.727064 |
090cee2fdc20a20b06651e2935aa08456e8e3ded | 55 | py | Python | readability/__init__.py | anekos/python-readability | ede4d015abd1829cc723ad59bf2db3c487fda66f | [
"Apache-2.0"
] | null | null | null | readability/__init__.py | anekos/python-readability | ede4d015abd1829cc723ad59bf2db3c487fda66f | [
"Apache-2.0"
] | null | null | null | readability/__init__.py | anekos/python-readability | ede4d015abd1829cc723ad59bf2db3c487fda66f | [
"Apache-2.0"
] | null | null | null | __version__ = "0.8"
from .readability import Document
| 13.75 | 33 | 0.763636 |
c0b68474f685bd3330fb107544b2f5c8e78d13cd | 399 | py | Python | GUI Features/Mouse/MouseCallBack.py | hardy8059/OpenCV_Examples | 8cdba1a72374b4cb9f8aa293a4b88edc7d1f341d | [
"MIT"
] | null | null | null | GUI Features/Mouse/MouseCallBack.py | hardy8059/OpenCV_Examples | 8cdba1a72374b4cb9f8aa293a4b88edc7d1f341d | [
"MIT"
] | null | null | null | GUI Features/Mouse/MouseCallBack.py | hardy8059/OpenCV_Examples | 8cdba1a72374b4cb9f8aa293a4b88edc7d1f341d | [
"MIT"
] | null | null | null | import cv2
import numpy as np
def draw_circle(event,x,y,flag,param):
if event == cv2.EVENT_LBUTTONDBLCLK:
cv2.circle(img,(x,y),100,(255,0,0),-1)
img = np.zeros((512,512,3),np.uint8)
cv2.namedWindow('image')
cv2.setMouseCallback('image',draw_circle)
while(1):
cv2.imshow('image',img)
i... | 22.166667 | 47 | 0.631579 |
129487ee6494ade899fa812ba522f50e0e84706a | 783 | py | Python | calcpayment.py | Alfareiza/calc-payment | c0ad005795a1841da82ae1c8092c65233510fd99 | [
"MIT"
] | null | null | null | calcpayment.py | Alfareiza/calc-payment | c0ad005795a1841da82ae1c8092c65233510fd99 | [
"MIT"
] | null | null | null | calcpayment.py | Alfareiza/calc-payment | c0ad005795a1841da82ae1c8092c65233510fd99 | [
"MIT"
] | null | null | null | import os
import pathlib
from src.facade import EXPLANATION
from src.tools import main
FOLDER = pathlib.Path(__file__).parent.resolve()
def ask():
txt_files = [file for file in os.listdir(FOLDER) if file.endswith(".txt") and not file.startswith('requirements')]
if not txt_files:
print(f'Please, plac... | 27.964286 | 118 | 0.624521 |
03fba1c732f75be3ee10f321b26a15b5180d72a7 | 970 | py | Python | fixture/application.py | anna-inboxx/python_training | 0a2c1a393894eb3d999d77a0ae1f9366ecb88185 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | anna-inboxx/python_training | 0a2c1a393894eb3d999d77a0ae1f9366ecb88185 | [
"Apache-2.0"
] | null | null | null | fixture/application.py | anna-inboxx/python_training | 0a2c1a393894eb3d999d77a0ae1f9366ecb88185 | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "firefox":
self.wd = webdriver.Firefox()
elif browser == "chro... | 27.714286 | 65 | 0.604124 |
743fc4e262defa340d527119fec34fe047d43321 | 6,672 | py | Python | homeassistant/components/media_player/russound_rio.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 4 | 2019-05-14T20:33:43.000Z | 2021-09-25T14:56:08.000Z | homeassistant/components/media_player/russound_rio.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/media_player/russound_rio.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | """
Support for Russound multizone controllers using RIO Protocol.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.russound_rio/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeas... | 31.17757 | 79 | 0.623951 |
2204d449944993f79beecd881dc403a5862b8285 | 1,918 | py | Python | day7/bags.py | PatrickKalkman/Advent-of-Code-2020 | 74e6dad69eb82f16c58db7a589720cf6d21d1a8f | [
"MIT"
] | null | null | null | day7/bags.py | PatrickKalkman/Advent-of-Code-2020 | 74e6dad69eb82f16c58db7a589720cf6d21d1a8f | [
"MIT"
] | null | null | null | day7/bags.py | PatrickKalkman/Advent-of-Code-2020 | 74e6dad69eb82f16c58db7a589720cf6d21d1a8f | [
"MIT"
] | null | null | null |
def construct_rules(rules_list):
rules = []
for rule_line in rules_list:
parts = rule_line.split("bags contain")
color_key = parts[0].strip()
contents = parts[1].split(",")
internal_colors = []
for content_part in contents:
content_part = content_part.strip()... | 29.96875 | 71 | 0.578206 |
ae18cb38b9ef54e9bc09b4b2f4fbaa46556af681 | 462 | py | Python | setup.py | xavierhardy/harbinger | 66455ee77280c4779f3a57ffa42f6f728812197f | [
"Apache-2.0"
] | 1 | 2018-07-24T20:09:27.000Z | 2018-07-24T20:09:27.000Z | setup.py | xavierhardy/harbinger | 66455ee77280c4779f3a57ffa42f6f728812197f | [
"Apache-2.0"
] | 13 | 2018-07-27T22:55:54.000Z | 2022-03-29T21:54:19.000Z | setup.py | xavierhardy/harbinger | 66455ee77280c4779f3a57ffa42f6f728812197f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(
name="harbinger",
version="0.0.1",
description="Abstract remote shell connection through several libraries, "
"designed for performance",
author="Xavier Hardy",
url="https://github.com/xavierhardy/harbinger",
packages=[],
... | 22 | 78 | 0.614719 |
1d528b838c024d430c37e4c77e5b4605c8e095e9 | 3,209 | py | Python | appEngine-DataStore/labs/fortune-teller/solution/main.py | silpillasil/DANK_CSSI_STUFFS | e1aa1d2b86cfe69a359d3084f0ed899102f7fe6c | [
"Apache-2.0"
] | null | null | null | appEngine-DataStore/labs/fortune-teller/solution/main.py | silpillasil/DANK_CSSI_STUFFS | e1aa1d2b86cfe69a359d3084f0ed899102f7fe6c | [
"Apache-2.0"
] | null | null | null | appEngine-DataStore/labs/fortune-teller/solution/main.py | silpillasil/DANK_CSSI_STUFFS | e1aa1d2b86cfe69a359d3084f0ed899102f7fe6c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# 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 ag... | 38.202381 | 94 | 0.712371 |
eb29e30de11c78ea1955b7c988986ec3b04b31b3 | 16,687 | py | Python | gevent/queue.py | patricklx/gevent | 4bfd06c708e7f408a086398babe8edeb9e74b094 | [
"MIT"
] | null | null | null | gevent/queue.py | patricklx/gevent | 4bfd06c708e7f408a086398babe8edeb9e74b094 | [
"MIT"
] | null | null | null | gevent/queue.py | patricklx/gevent | 4bfd06c708e7f408a086398babe8edeb9e74b094 | [
"MIT"
] | null | null | null | # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
"""Synchronized queues.
The :mod:`gevent.queue` module implements multi-producer, multi-consumer queues
that work across greenlets, with the API similar to the classes found in the
standard :mod:`Queue` and :class:`multiprocessing <multiprocessing.Queue... | 32.719608 | 117 | 0.577515 |
84f0d9b3238e80cb7f217330856ae199823eea36 | 4,755 | py | Python | django/engagementmanager/service/checklist_audit_log_service.py | onap/vvp-engagementmgr | 8d2108708e7c55cc753b956563c535177f92d0d9 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | django/engagementmanager/service/checklist_audit_log_service.py | onap/vvp-engagementmgr | 8d2108708e7c55cc753b956563c535177f92d0d9 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | django/engagementmanager/service/checklist_audit_log_service.py | onap/vvp-engagementmgr | 8d2108708e7c55cc753b956563c535177f92d0d9 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-10-19T15:17:09.000Z | 2021-10-19T15:17:09.000Z | #
# ============LICENSE_START==========================================
# org.onap.vvp/engagementmgr
# ===================================================================
# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
# ===================================================================
#
# Unless ... | 40.641026 | 78 | 0.674238 |
c47b3e37ecf172fa15b89215170930cbad17de6c | 1,063 | py | Python | src/python/WMCore/MicroService/Unified/Injector.py | ramonbrugman/WMCore | 7faea49e870a1a08459509c7fc681b0ce09cb2b9 | [
"Apache-2.0"
] | null | null | null | src/python/WMCore/MicroService/Unified/Injector.py | ramonbrugman/WMCore | 7faea49e870a1a08459509c7fc681b0ce09cb2b9 | [
"Apache-2.0"
] | null | null | null | src/python/WMCore/MicroService/Unified/Injector.py | ramonbrugman/WMCore | 7faea49e870a1a08459509c7fc681b0ce09cb2b9 | [
"Apache-2.0"
] | null | null | null | """
File : UnifiedInjectorManager.py
Author : Valentin Kuznetsov <vkuznet AT gmail dot com>
Description: UnifiedInjectorManager class provides full functionality of the UnifiedInjector service.
"""
# futures
from __future__ import division
# system modules
from builtins import object
import time
# Unified ... | 27.25641 | 101 | 0.672625 |
4317febdeb4c88700a1a498533207847d8eae8b3 | 37,805 | py | Python | plotly/offline/offline.py | malmaud/plotly.py | bcf4a2a0ca01b2568ccc521fc0cd6fd78c2edb0f | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/offline/offline.py | Abd-Elrazek/plotly.py | 568f577cbee3ecca3fd7b6493b7f0c9901acfb65 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/offline/offline.py | Abd-Elrazek/plotly.py | 568f577cbee3ecca3fd7b6493b7f0c9901acfb65 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | """ Plotly Offline
A module to use Plotly's graphing library with Python
without connecting to a public or private plotly enterprise
server.
"""
from __future__ import absolute_import
import os
import uuid
import warnings
import pkgutil
import time
import webbrowser
import six
from requests.compat import ... | 40.260916 | 81 | 0.619442 |
b5a88653ed37c0aa5d084b01d87b0012ccb89a3a | 925 | py | Python | meerkat/columns/video_column.py | HazyResearch/meerkat | e3b437d47809ef8e856a5f732ac1e11a1176ba1f | [
"Apache-2.0"
] | 65 | 2021-06-25T06:51:15.000Z | 2022-02-08T22:25:27.000Z | meerkat/columns/video_column.py | HazyResearch/meerkat | e3b437d47809ef8e856a5f732ac1e11a1176ba1f | [
"Apache-2.0"
] | 111 | 2021-06-24T01:16:36.000Z | 2022-03-07T17:54:58.000Z | meerkat/columns/video_column.py | HazyResearch/meerkat | e3b437d47809ef8e856a5f732ac1e11a1176ba1f | [
"Apache-2.0"
] | 4 | 2021-08-03T18:24:22.000Z | 2022-03-09T21:06:07.000Z | from __future__ import annotations
import logging
from typing import Callable, Optional, Sequence
from meerkat.cells.video import VideoCell
from meerkat.columns.cell_column import CellColumn
logger = logging.getLogger(__name__)
class VideoColumn(CellColumn):
"""Interface for creating a CellColumn from VideoCel... | 25.694444 | 85 | 0.633514 |
ada6e9bd00edabf3a538e81d169fc66239f94d30 | 28,379 | py | Python | tools/webidl_binder.py | DingYong4223/emscripten | 1fc7303e52cce207822977fa6770f1aae371cc43 | [
"MIT"
] | 1 | 2020-02-22T14:55:15.000Z | 2020-02-22T14:55:15.000Z | tools/webidl_binder.py | DingYong4223/emscripten | 1fc7303e52cce207822977fa6770f1aae371cc43 | [
"MIT"
] | null | null | null | tools/webidl_binder.py | DingYong4223/emscripten | 1fc7303e52cce207822977fa6770f1aae371cc43 | [
"MIT"
] | null | null | null | # Copyright 2014 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
'''
WebIDL binder
http://kripken.github.io/emscripten-site/docs/port... | 35.607277 | 214 | 0.618133 |
6017e59cb0752a26f3454ddbc603f1ca25926af6 | 607 | py | Python | qiskit/aqua/components/eigs/__init__.py | gawelk/aqua | 98ce06289cc6e12d087982cba95a45353ce0cb3b | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/components/eigs/__init__.py | gawelk/aqua | 98ce06289cc6e12d087982cba95a45353ce0cb3b | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/components/eigs/__init__.py | gawelk/aqua | 98ce06289cc6e12d087982cba95a45353ce0cb3b | [
"Apache-2.0"
] | 1 | 2019-06-05T01:08:23.000Z | 2019-06-05T01:08:23.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 31.947368 | 77 | 0.742998 |
9ecd4c740b29ddfa800016dc25ad3a4aa6ca754c | 5,769 | py | Python | examples/task_seq2seq_autotitle_csl.py | EthanChen1234/bert4keras | 149b8abe4f5696f7762f49547533873b935f85b9 | [
"Apache-2.0"
] | 2 | 2020-11-24T02:58:24.000Z | 2021-08-18T06:50:28.000Z | examples/task_seq2seq_autotitle_csl.py | ZhenHengDong/bert4keras | de66f9b66a57152816920a6b068a3f28648dd547 | [
"Apache-2.0"
] | null | null | null | examples/task_seq2seq_autotitle_csl.py | ZhenHengDong/bert4keras | de66f9b66a57152816920a6b068a3f28648dd547 | [
"Apache-2.0"
] | null | null | null | #! -*- coding: utf-8 -*-
# bert做Seq2Seq任务,采用UNILM方案
# 介绍链接:https://kexue.fm/archives/6933
# 数据集:https://github.com/CLUEbenchmark/CLGE 中的CSL数据集
# 补充了评测指标bleu、rouge-1、rouge-2、rouge-l
from __future__ import print_function
import numpy as np
from tqdm import tqdm
from bert4keras.backend import keras, K
from bert4keras.lay... | 32.22905 | 80 | 0.641186 |
1b14dfa994e955b906622ea478e98066af21a4be | 301 | py | Python | desafio063.py | EdnaMota/python3_estudos | 78fd4cf0063329d02b1e8b6f0094679e8922d5d7 | [
"MIT"
] | null | null | null | desafio063.py | EdnaMota/python3_estudos | 78fd4cf0063329d02b1e8b6f0094679e8922d5d7 | [
"MIT"
] | null | null | null | desafio063.py | EdnaMota/python3_estudos | 78fd4cf0063329d02b1e8b6f0094679e8922d5d7 | [
"MIT"
] | null | null | null | print('-'*30)
print('Sequência de Fibonacci')
print('-'*30)
n = int(input('Quantos termos você quer mostrar? '))
t1 = 0
t2 = 1
print('~'*30)
print(f'{t1} -> {t2}', end='')
cont = 3
while cont <= n:
t3 = t1 + t2
print(f' -> {t3}', end='')
t1 = t2
t2 = t3
cont += 1
print(' -> FIM')
| 17.705882 | 52 | 0.51495 |
8a6da2bfc8b49642b93ac006e1ff225d829adc12 | 3,978 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/member_object.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/member_object.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/member_object.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class MemberObject(object):
... | 24.109091 | 80 | 0.529915 |
a0a0da885c48fd14cf08145cc2b01bfe750a9979 | 1,423 | py | Python | skills-sdk-setup.py | sowmyavasudeva/SmartBookmark | 797a90cfea624d2ab977e5aa78614c0db1177a23 | [
"Apache-2.0"
] | 2 | 2018-12-16T15:55:04.000Z | 2018-12-29T19:52:38.000Z | skills-sdk-setup.py | sowmyavasudeva/SmartBookmark | 797a90cfea624d2ab977e5aa78614c0db1177a23 | [
"Apache-2.0"
] | null | null | null | skills-sdk-setup.py | sowmyavasudeva/SmartBookmark | 797a90cfea624d2ab977e5aa78614c0db1177a23 | [
"Apache-2.0"
] | 1 | 2018-03-14T07:07:56.000Z | 2018-03-14T07:07:56.000Z | # Copyright 2017 Mycroft AI 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 writin... | 27.365385 | 74 | 0.653549 |
b35b2faf9a08b510bf13baac66c9b32a7ce819b8 | 3,775 | py | Python | res_build/build.py | carlosgim/cagimenez.github.io | 7b6a89e709fa43ea790ed62cba59a7a88c6ee66e | [
"MIT"
] | null | null | null | res_build/build.py | carlosgim/cagimenez.github.io | 7b6a89e709fa43ea790ed62cba59a7a88c6ee66e | [
"MIT"
] | null | null | null | res_build/build.py | carlosgim/cagimenez.github.io | 7b6a89e709fa43ea790ed62cba59a7a88c6ee66e | [
"MIT"
] | null | null | null | """
Simple HTML and PDF resume generator from structurized YAML files.
Usage:
build.py [-o=<DIR>] [-f=<FORMAT>] [-t=<THEME>] <resume_file>
Options:
-o=<DIR>, --output_dir=<DIR> Output directory for the build files. [default: build].
-f=<FORMAT>, --format=<FORMAT> Format of the build [default: html].... | 26.215278 | 92 | 0.651921 |
4f461f3c4ec8d01985ca4cc27c43e12abc439726 | 436 | py | Python | backend/global/settings/prod.py | kevindice/cnap-dms | edb850412b6f95d1d4e057674e5cd899ee0b444e | [
"MIT"
] | 1 | 2018-11-01T22:16:02.000Z | 2018-11-01T22:16:02.000Z | backend/global/settings/prod.py | kevindice/cnap-dms | edb850412b6f95d1d4e057674e5cd899ee0b444e | [
"MIT"
] | 128 | 2018-04-19T08:28:03.000Z | 2018-12-20T19:02:06.000Z | backend/global/settings/prod.py | cnap-cobre/hyperion | edb850412b6f95d1d4e057674e5cd899ee0b444e | [
"MIT"
] | 2 | 2018-04-24T20:04:55.000Z | 2018-04-25T12:17:29.000Z | from .base import *
from .secret import Secret
DEBUG = False
ALLOWED_HOSTS = ['127.0.0.1',
'172.18.0.1',
'127.18.0.3',
'localhost',
'synapse.ksu.edu',
'172.18.0.4']
CSRF_TRUSTED_ORIGINS += ['localhost']
EMAIL_BACKEND = 'django.core.m... | 27.25 | 61 | 0.582569 |
709c77bab92408e1a384c591359ccf2ad062f494 | 87,532 | py | Python | psutil/tests/test_linux.py | marza-animation-planet/psutil | e1ea2bccf8aea404dca0f79398f36f37217c45f6 | [
"BSD-3-Clause"
] | null | null | null | psutil/tests/test_linux.py | marza-animation-planet/psutil | e1ea2bccf8aea404dca0f79398f36f37217c45f6 | [
"BSD-3-Clause"
] | null | null | null | psutil/tests/test_linux.py | marza-animation-planet/psutil | e1ea2bccf8aea404dca0f79398f36f37217c45f6 | [
"BSD-3-Clause"
] | 1 | 2020-05-07T08:37:52.000Z | 2020-05-07T08:37:52.000Z | #!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Linux specific tests."""
from __future__ import division
import collections
import contextlib
import errno
import glob
import i... | 41.386288 | 79 | 0.549605 |
cea4c9da31b01c7d4e4b6a9b839c758c40069a56 | 165 | py | Python | 0046_Permutations.py | taro-masuda/leetcode | 39739e9fec7c66513b114c740ef982ccc09dc39f | [
"MIT"
] | null | null | null | 0046_Permutations.py | taro-masuda/leetcode | 39739e9fec7c66513b114c740ef982ccc09dc39f | [
"MIT"
] | null | null | null | 0046_Permutations.py | taro-masuda/leetcode | 39739e9fec7c66513b114c740ef982ccc09dc39f | [
"MIT"
] | 1 | 2020-03-18T05:23:40.000Z | 2020-03-18T05:23:40.000Z | from itertools import permutations
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
perm = permutations(nums)
return perm
| 23.571429 | 58 | 0.666667 |
01e353276546d78fffc512db94d1b4a02f93c335 | 3,240 | py | Python | tools/generate_EMP_statement.py | bert-kapsarc/KEMChinaCoal | 34d321c406f24a0f023ec0c616e350b66c2b1ce6 | [
"MIT"
] | null | null | null | tools/generate_EMP_statement.py | bert-kapsarc/KEMChinaCoal | 34d321c406f24a0f023ec0c616e350b66c2b1ce6 | [
"MIT"
] | null | null | null | tools/generate_EMP_statement.py | bert-kapsarc/KEMChinaCoal | 34d321c406f24a0f023ec0c616e350b66c2b1ce6 | [
"MIT"
] | 2 | 2020-08-24T00:25:57.000Z | 2021-04-12T09:33:36.000Z | from argparse import ArgumentParser
import os, re
parser = ArgumentParser()
parser.add_argument('--agents', type=str, default='')
parser.add_argument('--input', type=str, default='KEM_EMP.lst')
parser.add_argument('--output', type=str, default='EMP_statement.gms')
parser.add_argument('--models', type=str, default='int... | 34.83871 | 93 | 0.540432 |
16480e5e97633771f61d4cf208994db35108bfd0 | 8,287 | py | Python | Mi Lenguaje/tests/lexer_test.py | DataEngel/Creando-mi-primer-lenguaje-de-programaci-n- | 92434f89c62b6cec0114441c669952450ba21b79 | [
"MIT"
] | null | null | null | Mi Lenguaje/tests/lexer_test.py | DataEngel/Creando-mi-primer-lenguaje-de-programaci-n- | 92434f89c62b6cec0114441c669952450ba21b79 | [
"MIT"
] | null | null | null | Mi Lenguaje/tests/lexer_test.py | DataEngel/Creando-mi-primer-lenguaje-de-programaci-n- | 92434f89c62b6cec0114441c669952450ba21b79 | [
"MIT"
] | null | null | null | from unittest import TestCase
from typing import List
from lpp.token import (
Token,
TokenType,
)
from lpp.lexer import Lexer
class LexerTest(TestCase):
def test_illegal(self) -> None:
source: str = '¡¿@'
lexer: Lexer = Lexer(source)
tokens: List[Token] = []
... | 32.120155 | 62 | 0.492941 |
5ce5aed85795130801b6ab7bae2c441b2d15db5e | 33,487 | py | Python | parser/team06/TablaDeSimbolos.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/team06/TablaDeSimbolos.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/team06/TablaDeSimbolos.py | webdev188/tytus | 847071edb17b218f51bb969d335a8ec093d13f94 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from enum import Enum
import pandas as pd
import reportes as h
class TIPO_DE_DATO(Enum) :
NUMERO = 1
FLOTANTE=2
CARACTER=3
#ir agregando los tipos faltantes para la comprobacion de tipos en las operacioens
class Simbolo() :
'Esta clase representa un simbolo dentro de nuestra tabla de simbolos'
... | 42.71301 | 257 | 0.545943 |
ef577e05aa83900eeb732ad94aa60eb48f74c640 | 1,600 | py | Python | scalpr/core/state.py | TvanMeer/scalpr | c4d2e07da60663f77c3d17875aa61ad9d215a08d | [
"MIT"
] | 1 | 2022-02-14T22:48:58.000Z | 2022-02-14T22:48:58.000Z | scalpr/core/state.py | TvanMeer/scalpr | c4d2e07da60663f77c3d17875aa61ad9d215a08d | [
"MIT"
] | null | null | null | scalpr/core/state.py | TvanMeer/scalpr | c4d2e07da60663f77c3d17875aa61ad9d215a08d | [
"MIT"
] | 1 | 2022-02-14T22:49:01.000Z | 2022-02-14T22:49:01.000Z | import asyncio
from dataclasses import dataclass, field
from queue import Queue
from typing import Dict
from ..database.database import DataBase
@dataclass
class SharedState:
"""Holds data that is shared between all concurrent loops.
Contains both state variables for internal usage, and
the database inst... | 30.769231 | 87 | 0.615625 |
61197612f2dc57e38dc0a6d7c579e473985b0251 | 19,178 | py | Python | model/transform.py | ZENGXH/NPDRAW | 339d1d9b4880cce891cafe7c20198ef7c121a29e | [
"MIT"
] | 21 | 2021-06-28T18:29:28.000Z | 2022-03-13T09:12:07.000Z | model/transform.py | ZENGXH/NPDRAW | 339d1d9b4880cce891cafe7c20198ef7c121a29e | [
"MIT"
] | null | null | null | model/transform.py | ZENGXH/NPDRAW | 339d1d9b4880cce891cafe7c20198ef7c121a29e | [
"MIT"
] | 2 | 2021-07-05T02:29:32.000Z | 2021-11-02T08:25:14.000Z | import torch
import utils
from loguru import logger
from utils.checker import *
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from utils import data_helper, ph_helper
class CanvasPlotter(object):
'''
one class hold several function within transform file;
'''
d... | 46.6618 | 130 | 0.60366 |
ca1c3e665c4fb93b9b24cddc99a1d7592e11a07f | 1,534 | py | Python | python/dynamic_programming/coin_change.py | SounakMandal/AlgoBook | 3952cb49ef12f1c00e97e0cf25810170f8585748 | [
"MIT"
] | 191 | 2020-09-28T10:00:20.000Z | 2022-03-06T14:36:55.000Z | python/dynamic_programming/coin_change.py | SounakMandal/AlgoBook | 3952cb49ef12f1c00e97e0cf25810170f8585748 | [
"MIT"
] | 210 | 2020-09-28T10:06:36.000Z | 2022-03-05T03:44:24.000Z | python/dynamic_programming/coin_change.py | SounakMandal/AlgoBook | 3952cb49ef12f1c00e97e0cf25810170f8585748 | [
"MIT"
] | 320 | 2020-09-28T09:56:14.000Z | 2022-02-12T16:45:57.000Z | """
THE COIN CHANGE PROBLEM (SOLVED FROM HACKERRANK- PROBLEM SOLVING)
PROBLEM:
You are working at the cash counter at a fun-fair, and you have different types of coins available
to you in infinite quantities. The value of each coin is already given.
Can you determine the number of ways of making change for a particul... | 31.306122 | 119 | 0.709257 |
57756ed7ac47dcd7de8ad5bc88ea6813c505120a | 1,388 | py | Python | 03_rabbitmq/doctor.py | wgslr/agh-distributed | ce10efbf24af26bde03cbfe051f01e784b1d4222 | [
"MIT"
] | 1 | 2019-05-28T07:21:16.000Z | 2019-05-28T07:21:16.000Z | 03_rabbitmq/doctor.py | wgslr/agh-distributed | ce10efbf24af26bde03cbfe051f01e784b1d4222 | [
"MIT"
] | null | null | null | 03_rabbitmq/doctor.py | wgslr/agh-distributed | ce10efbf24af26bde03cbfe051f01e784b1d4222 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pika
import sys
import select
import time
from typing import Optional
from interactive_server import InteractiveServer
import common
from common import errprint
def get_injury(line: str) -> dict:
if not line:
return None
parts = line.split(maxsplit=1)
if len(parts)... | 24.785714 | 71 | 0.585735 |
3d50f6c16e44c15ac564ff8cfaf1329cc7b09720 | 2,573 | py | Python | applications/view/manage/manage.py | wangyuan02605/webcloud | e57a2713125b751ee8bb8da29b789e2044e789aa | [
"MIT"
] | null | null | null | applications/view/manage/manage.py | wangyuan02605/webcloud | e57a2713125b751ee8bb8da29b789e2044e789aa | [
"MIT"
] | null | null | null | applications/view/manage/manage.py | wangyuan02605/webcloud | e57a2713125b751ee8bb8da29b789e2044e789aa | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, request
from flask_login import login_required, current_user
from sqlalchemy import desc
from applications.models import Recruitment
from applications.common import curd
from applications.common.curd import model_to_dicts, enable_status, disable_status
from applications.com... | 25.73 | 108 | 0.745433 |
83dc75755dac84466a159c3a4e7170b4ddbaf21d | 7,923 | py | Python | cloudsplaining/scan/principal_detail.py | jhutchings1/cloudsplaining | 7c94658a4f6e087a2d0e1a1b87df668e8eaa6ab6 | [
"BSD-3-Clause"
] | null | null | null | cloudsplaining/scan/principal_detail.py | jhutchings1/cloudsplaining | 7c94658a4f6e087a2d0e1a1b87df668e8eaa6ab6 | [
"BSD-3-Clause"
] | null | null | null | cloudsplaining/scan/principal_detail.py | jhutchings1/cloudsplaining | 7c94658a4f6e087a2d0e1a1b87df668e8eaa6ab6 | [
"BSD-3-Clause"
] | null | null | null | """Objects abstracting UserDetailList, GroupDetailList, or RoleDetailList sections of the output generated by the
command `aws iam get-account-authorization-details`"""
# Copyright (c) 2020, salesforce.com, inc.
# All rights reserved.
# Licensed under the BSD 3-Clause license.
# For full license text, see the LICENSE f... | 45.017045 | 127 | 0.598511 |
5580ba1d70a7b2884c87ced02d6686dc5f1d8193 | 2,304 | py | Python | .tox/scenario/lib/python2.7/site-packages/oslo_reports/views/json/generic.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | 21 | 2015-06-23T08:06:36.000Z | 2021-04-24T19:16:46.000Z | .tox/scenario/lib/python2.7/site-packages/oslo_reports/views/json/generic.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/oslo_reports/views/json/generic.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | 7 | 2015-07-02T13:48:34.000Z | 2020-02-04T15:51:39.000Z | # Copyright 2013 Red Hat, 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 agre... | 34.38806 | 78 | 0.711806 |
68a3e341fa10593cd76664fe28bb40ad78aec2ff | 41,064 | py | Python | pytorch_translate/ensemble_export.py | batikim09/translate | ae275549c414a68af783a87cb2eacc303a0553b0 | [
"BSD-3-Clause"
] | null | null | null | pytorch_translate/ensemble_export.py | batikim09/translate | ae275549c414a68af783a87cb2eacc303a0553b0 | [
"BSD-3-Clause"
] | null | null | null | pytorch_translate/ensemble_export.py | batikim09/translate | ae275549c414a68af783a87cb2eacc303a0553b0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import logging
import os
import tempfile
import numpy as np
import onnx
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx.operators
from caffe2.python import core, workspace
from caffe2.python.onnx import backend as caffe2_backend
from caffe2.python.predictor ... | 35.067464 | 99 | 0.606833 |
0e75f1e7d82eafae6bb7f3bed3f5b4c96adde373 | 1,154 | py | Python | lv3/integer_triangle.py | 5joon2/algorithm_programmers | 72f04ad610e1700f13d0657fffb4ab952fefa047 | [
"MIT"
] | null | null | null | lv3/integer_triangle.py | 5joon2/algorithm_programmers | 72f04ad610e1700f13d0657fffb4ab952fefa047 | [
"MIT"
] | null | null | null | lv3/integer_triangle.py | 5joon2/algorithm_programmers | 72f04ad610e1700f13d0657fffb4ab952fefa047 | [
"MIT"
] | null | null | null | def solution(triangle):
for i, numbers in enumerate(triangle):
if i == 0:
continue
elif i > 0:
for j, number in enumerate(numbers):
if j == 0: # left end
numbers[j] += triangle[i-1][0]
elif j == len(numbers)-1: # righ... | 30.368421 | 75 | 0.495667 |
5790eaa9e058afa62ea1e1554f2b1d9e569043ba | 3,359 | py | Python | src/data/dataset_factory.py | benihime91/leaf-disease-classification-kaggle | e1c8b1c6b88fe199a09e9d956db7b9baa3fb9dcc | [
"MIT"
] | null | null | null | src/data/dataset_factory.py | benihime91/leaf-disease-classification-kaggle | e1c8b1c6b88fe199a09e9d956db7b9baa3fb9dcc | [
"MIT"
] | null | null | null | src/data/dataset_factory.py | benihime91/leaf-disease-classification-kaggle | e1c8b1c6b88fe199a09e9d956db7b9baa3fb9dcc | [
"MIT"
] | 3 | 2020-12-14T04:22:31.000Z | 2021-04-22T19:40:34.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/01b_data.datasests_factory.ipynb (unless otherwise specified).
__all__ = ["create_transform", "DatasetMapper"]
# Cell
from omegaconf import DictConfig
from sklearn.model_selection import train_test_split
from .datasets import CassavaDataset, load_data
from .transforms_... | 32.298077 | 110 | 0.629949 |
4987387dc302368a9c3556b5a50a78b321d51812 | 68,385 | py | Python | tensorflow/python/training/checkpointable/util_test.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | 5 | 2019-01-13T16:15:25.000Z | 2019-07-07T16:17:32.000Z | tensorflow/python/training/checkpointable/util_test.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/checkpointable/util_test.py | handongke/tensorflow | c6bb5cd0447a0af2764c195fb14d218df8ae6471 | [
"Apache-2.0"
] | 1 | 2019-04-16T13:48:37.000Z | 2019-04-16T13:48:37.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 43.529599 | 101 | 0.715669 |
1e09d08ef44dc21563bbb9795dbdbcbe3b94be7d | 1,504 | py | Python | PycharmProjects/PythonTest/DistributionProgramming.py | FLYKingdom/CodeSeeker | f09b84ea3d04631aa36de98a9d6ad549cbaffebd | [
"MIT"
] | null | null | null | PycharmProjects/PythonTest/DistributionProgramming.py | FLYKingdom/CodeSeeker | f09b84ea3d04631aa36de98a9d6ad549cbaffebd | [
"MIT"
] | null | null | null | PycharmProjects/PythonTest/DistributionProgramming.py | FLYKingdom/CodeSeeker | f09b84ea3d04631aa36de98a9d6ad549cbaffebd | [
"MIT"
] | null | null | null | # 分布式编程
import random, time, queue
from multiprocessing.managers import BaseManager
# 发送任务的队列
task_queue = queue.Queue()
# 接受任务的队列
result_queue = queue.Queue()
class QueueManager(BaseManager):
pass
QueueManager.register('get_task_queue', callable=lambda: task_queue)
QueueManager.register('get_result_queue', cal... | 22.787879 | 72 | 0.678191 |
91e37d431d776fdbe95a199561c7f9e49a4474f8 | 5,262 | py | Python | auth/ops/cert_auth.py | socrateslee/pauli | 983b317febf1b3b78b8b1b9b7aaa21a32fe0aa2b | [
"MIT"
] | 2 | 2019-09-02T02:59:09.000Z | 2021-05-20T09:43:54.000Z | auth/ops/cert_auth.py | socrateslee/pauli | 983b317febf1b3b78b8b1b9b7aaa21a32fe0aa2b | [
"MIT"
] | null | null | null | auth/ops/cert_auth.py | socrateslee/pauli | 983b317febf1b3b78b8b1b9b7aaa21a32fe0aa2b | [
"MIT"
] | 1 | 2019-10-10T07:38:13.000Z | 2019-10-10T07:38:13.000Z | # coding:utf-8
import os
import re
import time
import uuid
import random
import sys
import getopt
import logging
from ... import conf
from ..models import User, CertLogin
logger = logging.getLogger(__name__)
def get_user(**headers):
if headers.get('Ssl-Client-Verified') != 'SUCCESS':
return None
if n... | 34.847682 | 112 | 0.603193 |
1ba1f05007dbd4086c75735bf947439378f9b25b | 1,045 | py | Python | setup.py | shu11/django-s3-backup | 2f2fe1e43fdcef2cf7dc250c1f8511e112439185 | [
"MIT"
] | 1 | 2018-01-21T03:06:11.000Z | 2018-01-21T03:06:11.000Z | setup.py | shu11/django-s3-backup | 2f2fe1e43fdcef2cf7dc250c1f8511e112439185 | [
"MIT"
] | null | null | null | setup.py | shu11/django-s3-backup | 2f2fe1e43fdcef2cf7dc250c1f8511e112439185 | [
"MIT"
] | null | null | null | import os
from distutils.core import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
packages = []
package_dir = "django_s3_backup"
for dirpath, dirnames, filenames in os.walk(package_dir):
# ignore dirnames that start with '.'
for i, dirname in enumerate(dirnam... | 29.027778 | 115 | 0.656459 |
9d55fcf1121a7558c558900c0eb7a8a6e97d6aa9 | 436 | py | Python | test/test_del_group.py | vp96288/python_training | 31ad72969712c25a52698ee82c156e3abd91d087 | [
"Apache-2.0"
] | null | null | null | test/test_del_group.py | vp96288/python_training | 31ad72969712c25a52698ee82c156e3abd91d087 | [
"Apache-2.0"
] | null | null | null | test/test_del_group.py | vp96288/python_training | 31ad72969712c25a52698ee82c156e3abd91d087 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
import random
def test_delete_some_group(app, db):
if len(db.get_group_list()) == 0:
app.group.create(Group(name = "test"))
old_groups = db.get_group_list()
group = random.choice(old_groups)
app.group.delete_group_by_id(group.id)
new_groups = db.get_group_list(... | 33.538462 | 49 | 0.706422 |
d48f5d5623cff8a54f366e1b901b296cb64ff63a | 3,279 | py | Python | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/DescribeRestoreJobsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/DescribeRestoreJobsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-hbr/aliyunsdkhbr/request/v20170908/DescribeRestoreJobsRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # 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 u... | 31.228571 | 78 | 0.754498 |
af3f04906ce387709f98d9ff00f6b9573cbd9fa4 | 122 | py | Python | tests/test_extract_nominations.py | jwilk-forks/and-the-award-goes-to | 94d05babf85bd06ad2aea42054e949940875cc22 | [
"MIT"
] | 1 | 2017-12-26T15:43:31.000Z | 2017-12-26T15:43:31.000Z | tests/test_extract_nominations.py | jwilk-forks/and-the-award-goes-to | 94d05babf85bd06ad2aea42054e949940875cc22 | [
"MIT"
] | null | null | null | tests/test_extract_nominations.py | jwilk-forks/and-the-award-goes-to | 94d05babf85bd06ad2aea42054e949940875cc22 | [
"MIT"
] | 1 | 2018-08-14T06:49:51.000Z | 2018-08-14T06:49:51.000Z | import unittest
class TestExtractAwards(unittest.TestCase):
def test_xyz(self):
self.assertEqual(True, True) | 20.333333 | 43 | 0.737705 |
04456412785b9ce57c62ad43238a41b952b1b1fa | 28,534 | py | Python | simulators/lakeshore372/ls372_simulator.py | simonsobs/socs | ef1c0f6e3620dcbb574aea64b5eb1b633ce87b07 | [
"BSD-2-Clause"
] | 6 | 2019-09-02T14:16:53.000Z | 2022-01-19T20:49:35.000Z | simulators/lakeshore372/ls372_simulator.py | simonsobs/socs | ef1c0f6e3620dcbb574aea64b5eb1b633ce87b07 | [
"BSD-2-Clause"
] | 183 | 2019-06-04T20:38:07.000Z | 2022-03-28T18:45:17.000Z | simulators/lakeshore372/ls372_simulator.py | simonsobs/socs | ef1c0f6e3620dcbb574aea64b5eb1b633ce87b07 | [
"BSD-2-Clause"
] | 7 | 2019-06-28T15:55:16.000Z | 2022-02-02T16:27:44.000Z | # To run the simulator: python3 ls372_simulator.py -p 7777
# (Since it automatically tries nearby ports, sometimes it will connect to 7778 when restarted,
# so you may need to temporarily change the port in Lakeshore372.py or just try running it again)
#
# To interact with the simulator:
# Connect 372 agent: python3 -i... | 33.25641 | 157 | 0.530245 |
c2fbc956a069c7139ebc5f8b5074082d11cb5eff | 3,248 | py | Python | scraper.py | creat00r/EarningSurpriseScraper | db01b1ba23e649bc513f9dc87a2aaca288a208c3 | [
"MIT"
] | null | null | null | scraper.py | creat00r/EarningSurpriseScraper | db01b1ba23e649bc513f9dc87a2aaca288a208c3 | [
"MIT"
] | null | null | null | scraper.py | creat00r/EarningSurpriseScraper | db01b1ba23e649bc513f9dc87a2aaca288a208c3 | [
"MIT"
] | null | null | null |
def ES(symbol):#get earning surprises for last three quarters
#example: ES("AApl")
import time
from selenium import webdriver
#from selenium import driver
#CLICK ANY BUTTONS
#driver.get("https://www.nasdaq.com/market-activity/stocks/aapl/earnings")
#more_buttons = driver.find_elements_by_c... | 36.909091 | 187 | 0.637931 |
c79e67969299905ae09959eea517176ca47ace1e | 321 | py | Python | 25.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | 25.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | 25.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | times = int(input())
lst = []
for i in range(times):
k = int(input())
lst.append(k)
for word in lst:
word = int(word)
if word >= 1900:
print("Division 1")
elif word >= 1600:
print("Division 2")
elif word >= 1400:
print("Division 3")
else:
print("Division 4"... | 17.833333 | 27 | 0.523364 |
3bb5ca9abd3e86c6a9fb59c33743fc3f5907dd82 | 9,049 | py | Python | tests/test_exceptions.py | HazenBabcock/pytest-qt | ae4947d5a5ab5799c5153f4fe2c0af938bd07ffe | [
"MIT"
] | 5 | 2015-02-07T14:37:53.000Z | 2021-03-19T11:00:40.000Z | tests/test_exceptions.py | HazenBabcock/pytest-qt | ae4947d5a5ab5799c5153f4fe2c0af938bd07ffe | [
"MIT"
] | 1 | 2015-01-07T15:35:47.000Z | 2015-01-07T15:35:47.000Z | tests/test_exceptions.py | HazenBabcock/pytest-qt | ae4947d5a5ab5799c5153f4fe2c0af938bd07ffe | [
"MIT"
] | 1 | 2018-08-18T17:01:37.000Z | 2018-08-18T17:01:37.000Z | from pytestqt.exceptions import capture_exceptions, format_captured_exceptions
import pytest
import sys
@pytest.mark.parametrize('raise_error', [False, True])
def test_catch_exceptions_in_virtual_methods(testdir, raise_error):
"""
Catch exceptions that happen inside Qt virtual methods and make the
tests f... | 28.545741 | 89 | 0.622942 |
8ceba797990701e0ee8b22847ce34d5002546627 | 2,231 | py | Python | jaguarete_store/views.py | Alexander0z/trabajo-final-django-v2 | 09f394ecc7876bd0c96a43239f049a06c5d05e06 | [
"CC0-1.0"
] | 1 | 2021-06-06T20:27:51.000Z | 2021-06-06T20:27:51.000Z | jaguarete_store/views.py | Alexander0z/trabajo-final-django-v2 | 09f394ecc7876bd0c96a43239f049a06c5d05e06 | [
"CC0-1.0"
] | null | null | null | jaguarete_store/views.py | Alexander0z/trabajo-final-django-v2 | 09f394ecc7876bd0c96a43239f049a06c5d05e06 | [
"CC0-1.0"
] | 1 | 2021-07-06T01:42:45.000Z | 2021-07-06T01:42:45.000Z | from categories.models import Category
from django.http.response import HttpResponseRedirect
from products.models import Product
from django.shortcuts import get_object_or_404, redirect, render
from django.contrib.auth import authenticate, login, logout
from users.models import User
from django.contrib import messages
... | 33.80303 | 72 | 0.659794 |
cf581f051234bc9017d7e9ffb8b1fca83e44e70d | 2,377 | py | Python | happyball.py | FreshConsulting/happyball | 52b067c1fb8b340aaeb5cec47ebce90150f33b95 | [
"MIT"
] | null | null | null | happyball.py | FreshConsulting/happyball | 52b067c1fb8b340aaeb5cec47ebce90150f33b95 | [
"MIT"
] | null | null | null | happyball.py | FreshConsulting/happyball | 52b067c1fb8b340aaeb5cec47ebce90150f33b95 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""happyball.py: A basic ball bouncing program to demonstrate programming
during the Fresh Future Innovators Workshop."""
__author__ = "Sean Patterson"
__copyright__ = "Copyright 2019, Fresh Consulting"
__credits__ = ["Randall Tateishi", "Sean McKay"]
__license__ = "MIT"
__version__ = "1.0.... | 31.276316 | 76 | 0.755995 |
d7d6ed5b318e3c9cd0e9490c3fd6c85bd0a82f5b | 154 | py | Python | create_box/main.py | ine-rmotr-projects/itp-w1-create-box | 0b3bbec88b2858a10bad3eb9c267ffd839f17bf6 | [
"MIT"
] | null | null | null | create_box/main.py | ine-rmotr-projects/itp-w1-create-box | 0b3bbec88b2858a10bad3eb9c267ffd839f17bf6 | [
"MIT"
] | null | null | null | create_box/main.py | ine-rmotr-projects/itp-w1-create-box | 0b3bbec88b2858a10bad3eb9c267ffd839f17bf6 | [
"MIT"
] | null | null | null | """This is the entry point of the program."""
def create_box(height, width, character):
pass
if __name__ == '__main__':
create_box(3, 4, '*')
| 15.4 | 45 | 0.636364 |
4787fb30faa5e31ccaf72e590ccd251890fff3aa | 212 | py | Python | beneficiaries/beneficiaries/doctype/material_status/test_material_status.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | null | null | null | beneficiaries/beneficiaries/doctype/material_status/test_material_status.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | null | null | null | beneficiaries/beneficiaries/doctype/material_status/test_material_status.py | baidalala/beneficiaries | b7299e0a7da91e90c607e70d76994ec0aebae402 | [
"MIT"
] | 1 | 2021-08-31T18:47:58.000Z | 2021-08-31T18:47:58.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Baida and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestMaterialStatus(unittest.TestCase):
pass
| 19.272727 | 44 | 0.764151 |
a17feda15fe8eac649b81dce19cdd5796eb371a0 | 7,089 | py | Python | app/api/event_invoices.py | akashtalole/python-flask-restful-api | 475d8fd7be1724183716a197aac4257f8fbbeac4 | [
"MIT"
] | 3 | 2019-09-05T05:28:49.000Z | 2020-06-10T09:03:37.000Z | app/api/event_invoices.py | akashtalole/python-flask-restful-api | 475d8fd7be1724183716a197aac4257f8fbbeac4 | [
"MIT"
] | null | null | null | app/api/event_invoices.py | akashtalole/python-flask-restful-api | 475d8fd7be1724183716a197aac4257f8fbbeac4 | [
"MIT"
] | null | null | null | import datetime
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
from flask import jsonify, request
from app.api.bootstrap import api
from app.api.helpers.db import safe_query
from app.api.helpers.permissions import is_admin
from app.api.helpers.query import event_query
from app.api.he... | 36.353846 | 118 | 0.656933 |
c25006b03bc13043ce425cfc55c91918537d479d | 4,377 | py | Python | pytorch_widedeep/utils/dense_utils.py | yuanzhiKe/pytorch-widedeep | 65465a454de6cd917a0927eb16b0137170ee4dc9 | [
"MIT"
] | null | null | null | pytorch_widedeep/utils/dense_utils.py | yuanzhiKe/pytorch-widedeep | 65465a454de6cd917a0927eb16b0137170ee4dc9 | [
"MIT"
] | null | null | null | pytorch_widedeep/utils/dense_utils.py | yuanzhiKe/pytorch-widedeep | 65465a454de6cd917a0927eb16b0137170ee4dc9 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import pandas as pd
from sklearn.exceptions import NotFittedError
from ..wdtypes import *
warnings.filterwarnings("ignore")
pd.options.mode.chained_assignment = None
__all__ = ["LabelEncoder"]
class LabelEncoder(object):
"""Class to Label Encode categorical values for multip... | 32.422222 | 97 | 0.581448 |
a366634dd92c16fc459460ebba81cef33488c5ce | 4,466 | py | Python | day_19/part_2.py | Akarys42/aoc-2021 | 610d32777d91caada78036b6ed864dc871901ee3 | [
"MIT"
] | 2 | 2021-12-12T11:31:03.000Z | 2022-01-02T11:32:53.000Z | day_19/part_2.py | Akarys42/aoc-2021 | 610d32777d91caada78036b6ed864dc871901ee3 | [
"MIT"
] | null | null | null | day_19/part_2.py | Akarys42/aoc-2021 | 610d32777d91caada78036b6ed864dc871901ee3 | [
"MIT"
] | 1 | 2021-12-18T05:06:26.000Z | 2021-12-18T05:06:26.000Z | import dataclasses
from decimal import Decimal
from itertools import count, chain, product
from typing import Optional, Literal
REQUIRED_COMMON = 12
AXIS = [*"xyz"]
Axis = Literal["x", "y", "z"]
@dataclasses.dataclass(eq=True, frozen=True)
class Point:
x: int
y: int
z: int
def get(self, axis: Axis)... | 27.066667 | 88 | 0.545007 |
fe6bd7c24f340fc9dfb522103d87491f01ee60f2 | 3,803 | py | Python | utils/dicomutils.py | Whtie4622/dicom2stl | 35e64e9c80e81a7519407199a6d93c59778ad34c | [
"Apache-2.0"
] | null | null | null | utils/dicomutils.py | Whtie4622/dicom2stl | 35e64e9c80e81a7519407199a6d93c59778ad34c | [
"Apache-2.0"
] | null | null | null | utils/dicomutils.py | Whtie4622/dicom2stl | 35e64e9c80e81a7519407199a6d93c59778ad34c | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
"""
Function to load the largest Dicom series in a directory.
It scans the directory recursively search for files with the ".dcm"
suffix. Note that DICOM fails don't always have that suffix. In
that case this function will fail.
Written by David T. Chen from the National Institute of Allergy... | 24.22293 | 78 | 0.632395 |
d5d2654be1ad312fee08dc1fe969500697c12c1f | 10,280 | py | Python | src/python/paperai/query.py | personx000/paperai | f23bb99b6cb0522a600487286c73b570740d795c | [
"Apache-2.0"
] | 743 | 2020-07-21T18:46:37.000Z | 2022-03-28T22:27:02.000Z | src/python/paperai/query.py | gobbletown/paperai | 5c0efd7931d287f3f372fecb57f5d31e5957ac2b | [
"Apache-2.0"
] | 56 | 2020-07-24T20:17:26.000Z | 2022-03-17T01:44:26.000Z | src/python/paperai/query.py | gobbletown/paperai | 5c0efd7931d287f3f372fecb57f5d31e5957ac2b | [
"Apache-2.0"
] | 72 | 2020-07-22T16:23:58.000Z | 2022-03-18T20:32:42.000Z | """
Query module
"""
import datetime
import re
import sys
import html2markdown
import mdv
from txtai.pipeline import Tokenizer
from .highlights import Highlights
from .models import Models
class Query:
"""
Methods to query an embeddings index.
"""
@staticmethod
def markdown(text):
"""... | 25.894207 | 104 | 0.521595 |
afd7326ff4fd417f73a980183d93c1e2f12ce1db | 3,190 | py | Python | configs/recognition/slowonly/slowonly_imagenet_pretrained_r50_8x8x1_150e_kinetics400_rgb.py | Naoki-Wake/mmaction2 | a2032605db82509744a18d993c94a06feb1efd15 | [
"Apache-2.0"
] | 648 | 2021-06-24T19:33:09.000Z | 2022-03-31T06:27:24.000Z | configs/recognition/slowonly/slowonly_imagenet_pretrained_r50_8x8x1_150e_kinetics400_rgb.py | jayleicn/mmaction2-1 | 0a6fde1abb8403f1f68b568f5b4694c6f828e27e | [
"Apache-2.0"
] | 53 | 2021-07-01T03:07:52.000Z | 2022-03-27T16:15:29.000Z | configs/recognition/slowonly/slowonly_imagenet_pretrained_r50_8x8x1_150e_kinetics400_rgb.py | jayleicn/mmaction2-1 | 0a6fde1abb8403f1f68b568f5b4694c6f828e27e | [
"Apache-2.0"
] | 117 | 2021-06-25T01:22:32.000Z | 2022-03-31T08:33:55.000Z | _base_ = [
'../../_base_/models/slowonly_r50.py', '../../_base_/default_runtime.py'
]
# dataset settings
dataset_type = 'RawframeDataset'
data_root = 'data/kinetics400/rawframes_train'
data_root_val = 'data/kinetics400/rawframes_val'
ann_file_train = 'data/kinetics400/kinetics400_train_list_rawframes.txt'
ann_file... | 32.55102 | 78 | 0.66489 |
67e347f5eb6300f504633834d5bd13ec5fba360b | 851 | py | Python | encuestas/migrations/0005_userprofile.py | cjpm1983/tesoreriapy | 552cf5ab4237ced086b54d5a0552fd607704cec5 | [
"MIT"
] | null | null | null | encuestas/migrations/0005_userprofile.py | cjpm1983/tesoreriapy | 552cf5ab4237ced086b54d5a0552fd607704cec5 | [
"MIT"
] | null | null | null | encuestas/migrations/0005_userprofile.py | cjpm1983/tesoreriapy | 552cf5ab4237ced086b54d5a0552fd607704cec5 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-08-16 07:40
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('encuestas', '0004_calif... | 32.730769 | 121 | 0.638073 |
2be8c7d2108d7a0e4f3a5add0eb7c222a9ce2971 | 1,013 | py | Python | darktrace/icon_darktrace/connection/connection.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | darktrace/icon_darktrace/connection/connection.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | darktrace/icon_darktrace/connection/connection.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | import insightconnect_plugin_runtime
from .schema import ConnectionSchema, Input
# Custom imports below
from icon_darktrace.util.api import DarkTraceAPI
from insightconnect_plugin_runtime.exceptions import PluginException, ConnectionTestException
class Connection(insightconnect_plugin_runtime.Connection):
def __... | 33.766667 | 94 | 0.670286 |
d164987319d5454975b8d872e788fcdf296def53 | 50,969 | py | Python | shibgreen/consensus/block_header_validation.py | BTCgreen-Network/shibgreen-blockchain | b1e41e82ad849775543aa36fefc0c0d03e13f6e8 | [
"Apache-2.0"
] | 12 | 2021-11-10T02:52:38.000Z | 2022-03-22T10:19:45.000Z | shibgreen/consensus/block_header_validation.py | BTCgreen-Network/shibgreen-blockchain | b1e41e82ad849775543aa36fefc0c0d03e13f6e8 | [
"Apache-2.0"
] | 13 | 2021-11-16T03:09:34.000Z | 2022-03-09T00:45:05.000Z | shibgreen/consensus/block_header_validation.py | BTCgreen-Network/shibgreen-blockchain | b1e41e82ad849775543aa36fefc0c0d03e13f6e8 | [
"Apache-2.0"
] | 1 | 2022-03-15T08:25:06.000Z | 2022-03-15T08:25:06.000Z | import dataclasses
import logging
import time
from typing import Optional, Tuple
from blspy import AugSchemeMPL
from shibgreen.consensus.block_record import BlockRecord
from shibgreen.consensus.blockchain_interface import BlockchainInterface
from shibgreen.consensus.constants import ConsensusConstants
from shibgreen.... | 47.903195 | 120 | 0.640193 |
4299983e535919c1e7cd881d874a61d2d3ee1550 | 15,172 | py | Python | tests/features/steps/intersections.py | darsovit/pyRayTracerChallenge | 5ca833c3606c67c3113d91e5de0750cbfd73660d | [
"MIT"
] | 2 | 2020-05-13T20:55:23.000Z | 2020-10-26T02:54:40.000Z | tests/features/steps/intersections.py | darsovit/pyRayTracerChallenge | 5ca833c3606c67c3113d91e5de0750cbfd73660d | [
"MIT"
] | null | null | null | tests/features/steps/intersections.py | darsovit/pyRayTracerChallenge | 5ca833c3606c67c3113d91e5de0750cbfd73660d | [
"MIT"
] | 1 | 2020-05-15T02:18:15.000Z | 2020-05-15T02:18:15.000Z | #! python
#
#
from behave import given,then,when
from renderer.bolts import IdentifyHit, EPSILON, Vector
from math import isclose
@given(u'{intersectionvar:w} ← intersection({time:S}, {objectvar:w})')
@when(u'{intersectionvar:w} ← intersection({time:S}, {objectvar:w})')
def step_impl(context, intersectionvar, time, ob... | 54.971014 | 237 | 0.693383 |
f8afa468b5180fb0ff8f959889875f56e695185b | 3,866 | py | Python | src/evaluation/utils.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | src/evaluation/utils.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | src/evaluation/utils.py | lyonva/Nue | 90680de00b0c76f6bfdbed71b785671e7c3a3f54 | [
"Apache-2.0"
] | null | null | null | from copy import copy
def get_metrics_dataset(df, metrics, problem, names = None):
"""
Function:
get_metrics_dataset
Description:
From a list of Metrics, returns only those that are applicable to the dataset.
That means:
1) match to the type of pr... | 34.828829 | 100 | 0.584066 |
565c471061e790c5e812561e8dcf9fd545d93316 | 1,691 | py | Python | spiders/mps/all/guangxi.py | JJYYYY/policy_crawl | e5f7612163c00049f2e6859e81babb3e0f30aca4 | [
"Apache-2.0"
] | 3 | 2020-04-15T07:17:04.000Z | 2020-09-21T13:06:57.000Z | spiders/mps/all/guangxi.py | JJYYYY/policy_crawl | e5f7612163c00049f2e6859e81babb3e0f30aca4 | [
"Apache-2.0"
] | null | null | null | spiders/mps/all/guangxi.py | JJYYYY/policy_crawl | e5f7612163c00049f2e6859e81babb3e0f30aca4 | [
"Apache-2.0"
] | 4 | 2020-03-23T02:09:18.000Z | 2021-04-18T08:30:08.000Z | import re
import time
from pyquery import PyQuery as pq
from policy_crawl.common.fetch import get,post
from policy_crawl.common.save import save
from policy_crawl.common.logger import alllog,errorlog
def parse_detail(html,url):
alllog.logger.info("广西省公安厅: %s"%url)
doc=pq(html)
data={}
data["title"]=d... | 31.314815 | 92 | 0.59728 |
14a6a8c497e8980313fd2f5b476694f939c8172b | 9,046 | py | Python | projects/mechanism_config_files/input_Propane_v7/local_settings.py | AdamPI314/SOHR | eec472ec98c69ce58d8dee1bc5bfc4a2bf9063c6 | [
"MIT"
] | 2 | 2017-08-11T23:29:56.000Z | 2020-07-22T18:13:50.000Z | projects/mechanism_config_files/input_Propane_v7/local_settings.py | AdamPI314/SOHR | eec472ec98c69ce58d8dee1bc5bfc4a2bf9063c6 | [
"MIT"
] | null | null | null | projects/mechanism_config_files/input_Propane_v7/local_settings.py | AdamPI314/SOHR | eec472ec98c69ce58d8dee1bc5bfc4a2bf9063c6 | [
"MIT"
] | null | null | null | """
local settings, include settings from C++ code and fast transitions
"""
from collections import OrderedDict
def get_local_settings():
"""
local settings for C++ codes
"""
setting = {
"system": {
"condition": "cv",
"initializer": "dlsode"
},
"network"... | 31.964664 | 102 | 0.426818 |
e7f1ebcb334a8dd0788111ae95d97cc639e6cc9e | 684 | py | Python | vol/save/fixsave.py | Newer-Team/NewerSMBU | 3f91885234852b5763f5c8815ea14816f3baffff | [
"MIT"
] | 7 | 2021-05-22T21:59:42.000Z | 2022-01-03T16:33:03.000Z | vol/save/fixsave.py | Newer-Team/NewerSMBU | 3f91885234852b5763f5c8815ea14816f3baffff | [
"MIT"
] | null | null | null | vol/save/fixsave.py | Newer-Team/NewerSMBU | 3f91885234852b5763f5c8815ea14816f3baffff | [
"MIT"
] | 2 | 2021-05-24T03:38:18.000Z | 2021-08-12T01:25:36.000Z |
import binascii
import struct
def crc32(dat):
return struct.pack('>i', binascii.crc32(dat))
with open('rp_savedata.dat', 'rb') as f:
data = f.read()
data = data[:0xC] + crc32(data[:0xC]) + data[0x10:]
for i in range(12):
data = data[:0x210 + 0x204 * i] + crc32(data[0x10 + 0x204 * i : 0x210 + 0x204 * i])... | 31.090909 | 114 | 0.641813 |
ede0f1ce7b32bfc610dca0d6c3bc405e74e20dc8 | 45,047 | py | Python | ttrv/content.py | jspanos/ttrv | 45838659a8184a33d02560e265ad7c3ce05e83e2 | [
"MIT"
] | 248 | 2019-12-12T08:09:27.000Z | 2021-11-14T22:28:01.000Z | ttrv/content.py | jspanos/ttrv | 45838659a8184a33d02560e265ad7c3ce05e83e2 | [
"MIT"
] | 29 | 2019-12-29T20:43:25.000Z | 2021-05-14T07:06:55.000Z | ttrv/content.py | jspanos/ttrv | 45838659a8184a33d02560e265ad7c3ce05e83e2 | [
"MIT"
] | 30 | 2020-03-05T12:59:59.000Z | 2021-08-08T07:02:53.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import time
import logging
from datetime import datetime
from timeit import default_timer as timer
import six
from bs4 import BeautifulSoup
from kitchen.text.display import wrap
from . import exceptions
from .packages import praw
from .package... | 37.854622 | 86 | 0.567629 |
547b0ef99dfb6e1f9d42572329f92f1b37b9ba98 | 258 | py | Python | db_connection/db_conn.py | scorelab/DroneMap | 73d620caf3e0d8b1101059aee844c0200858493f | [
"Apache-2.0"
] | 2 | 2018-10-02T12:02:42.000Z | 2018-10-20T06:00:06.000Z | db_connection/db_conn.py | horizon00/DroneMap | 73d620caf3e0d8b1101059aee844c0200858493f | [
"Apache-2.0"
] | 2 | 2017-12-06T11:56:24.000Z | 2019-04-07T00:55:32.000Z | db_connection/db_conn.py | horizon00/DroneMap | 73d620caf3e0d8b1101059aee844c0200858493f | [
"Apache-2.0"
] | 17 | 2016-11-30T09:56:28.000Z | 2021-05-25T12:25:29.000Z | #Created by Imal thiunuwan using Intellij Idea
import pymongo
client = pymongo.MongoClient("link to the remote database/dbname") # defaults to port 27017
db = client.db_name
# print the number of documents in a collection
print db.collection_name.count() | 25.8 | 91 | 0.790698 |
2150c266da8860dc3572de1db6cfe427289df233 | 524 | py | Python | authserver/mailauth/migrations/0010_domain_redirect_to.py | yopiti/authserver | 0a1f7f5a83d03963d1ecfb5199be8e05d3068dfd | [
"MIT"
] | 8 | 2017-07-04T10:07:32.000Z | 2022-01-02T10:31:43.000Z | authserver/mailauth/migrations/0010_domain_redirect_to.py | yopiti/authserver | 0a1f7f5a83d03963d1ecfb5199be8e05d3068dfd | [
"MIT"
] | 14 | 2020-02-11T21:42:38.000Z | 2022-03-28T16:00:55.000Z | authserver/mailauth/migrations/0010_domain_redirect_to.py | yopiti/authserver | 0a1f7f5a83d03963d1ecfb5199be8e05d3068dfd | [
"MIT"
] | 1 | 2020-03-01T10:39:28.000Z | 2020-03-01T10:39:28.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-25 19:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mailauth', '0009_auto_20170912_2158'),
]
operations = [
migrations.AddField... | 24.952381 | 119 | 0.637405 |
72184825f18a8e172c908cbb33ce04a9ac90fc4a | 17,398 | py | Python | mypy/semanal_pass1.py | AlexTalks/mypy | e35b642d1f679ba8dd656091d9641ac24f481bbe | [
"PSF-2.0"
] | null | null | null | mypy/semanal_pass1.py | AlexTalks/mypy | e35b642d1f679ba8dd656091d9641ac24f481bbe | [
"PSF-2.0"
] | 7 | 2018-12-11T20:01:53.000Z | 2018-12-12T12:06:33.000Z | mypy/semanal_pass1.py | AlexTalks/mypy | e35b642d1f679ba8dd656091d9641ac24f481bbe | [
"PSF-2.0"
] | null | null | null | """The semantic analyzer pass 1.
This sets up externally visible names defined in a module but doesn't
follow imports and mostly ignores local definitions. It helps enable
(some) cyclic references between modules, such as module 'a' that
imports module 'b' and used names defined in 'b' *and* vice versa. The
first pa... | 45.072539 | 98 | 0.589953 |
7f9a63858dba2966583a4fc571d65b19932e61e6 | 3,223 | py | Python | experiments/ops.py | LizhengMathAi/svgd | 9606388cf4565e4fafe82869feef7a7ba8986ef2 | [
"Apache-2.0"
] | 3 | 2019-07-10T16:48:53.000Z | 2019-11-03T11:23:06.000Z | experiments/ops.py | LizhengMathAi/svgd | 9606388cf4565e4fafe82869feef7a7ba8986ef2 | [
"Apache-2.0"
] | null | null | null | experiments/ops.py | LizhengMathAi/svgd | 9606388cf4565e4fafe82869feef7a7ba8986ef2 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from tensorflow.python.framework import ops
OP_MODULE = tf.load_op_library('./src/ops.so')
SCALE = 0.1
# ---------------------------------------- for Variable ----------------------------------------
def identity(input_tensor):
dim = input_tensor.get_shape().as_list().__len__()
retu... | 33.226804 | 115 | 0.681663 |
8513f067433fb807a3381a376d67367c61960958 | 6,057 | py | Python | src/models/main.py | AsgerG/cookie | 73b9dbd708564e7ae03a671b21969d3746b3eaac | [
"MIT"
] | null | null | null | src/models/main.py | AsgerG/cookie | 73b9dbd708564e7ae03a671b21969d3746b3eaac | [
"MIT"
] | null | null | null | src/models/main.py | AsgerG/cookie | 73b9dbd708564e7ae03a671b21969d3746b3eaac | [
"MIT"
] | null | null | null | import argparse
import sys
import matplotlib.pyplot as plt
import torch
import tqdm
from src.data.make_dataset import load_mnist
import torchvision
from torch import nn, optim
#from torch.utils.tensorboard import SummaryWriter
import wandb
from model import Classifier
class TrainOREvaluate(object):
"""Helper cl... | 33.28022 | 88 | 0.552749 |
c294e0b51673392abe8847884c5ae8b55c85903a | 844 | py | Python | tests/test_validators.py | Kristianuruplarsen/pydst-1 | 6bb7d96a01d09cf326b0894b0a1ba54c486e0ec3 | [
"MIT"
] | 1 | 2020-03-11T15:42:08.000Z | 2020-03-11T15:42:08.000Z | tests/test_validators.py | Kristianuruplarsen/pydst-1 | 6bb7d96a01d09cf326b0894b0a1ba54c486e0ec3 | [
"MIT"
] | 53 | 2018-06-12T14:36:58.000Z | 2021-11-15T17:48:19.000Z | tests/test_validators.py | Kristianuruplarsen/pydst-1 | 6bb7d96a01d09cf326b0894b0a1ba54c486e0ec3 | [
"MIT"
] | 1 | 2020-03-10T09:06:11.000Z | 2020-03-10T09:06:11.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `pydst` package."""
import pytest
from pydst import validators
from pydst import utils
def test_ValueError_if_lang_wrong_type():
with pytest.raises(ValueError):
validators.lang_validator(2, ['da', 'en'])
def test_ValueError_if_valid_langs_wrong... | 27.225806 | 64 | 0.71564 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.