hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e7b72a5084cc2e1739fa4207f495f6ffa23fa61 | 2,420 | py | Python | GAS.py | heieureka/emotic | 93cd79e30e03c3fd3a4a478dcf645db569fe2a1b | [
"MIT"
] | null | null | null | GAS.py | heieureka/emotic | 93cd79e30e03c3fd3a4a478dcf645db569fe2a1b | [
"MIT"
] | null | null | null | GAS.py | heieureka/emotic | 93cd79e30e03c3fd3a4a478dcf645db569fe2a1b | [
"MIT"
] | null | null | null | from tensorbay import GAS
from tensorbay.dataset import Dataset
import numpy as np
from PIL import Image
import cv2
from tqdm import tqdm
import os
def cat_to_one_hot(y_cat):
cat2ind = {'Affection': 0, 'Anger': 1, 'Annoyance': 2, 'Anticipation': 3, 'Aversion': 4,
'Confidence': 5, 'Disapproval': 6, '... | 44 | 161 | 0.625207 |
2fd48d5ea71d8c036ad29c3af93dc4c02c5e4af1 | 3,119 | py | Python | templates/materials/PlaneStrainState.py | cehanagan/pylith | cf5c1c34040460a82f79b6eb54df894ed1b1ee93 | [
"MIT"
] | 93 | 2015-01-08T16:41:22.000Z | 2022-02-25T13:40:02.000Z | templates/materials/PlaneStrainState.py | sloppyjuicy/pylith | ac2c1587f87e45c948638b19560813d4d5b6a9e3 | [
"MIT"
] | 277 | 2015-02-20T16:27:35.000Z | 2022-03-30T21:13:09.000Z | templates/materials/PlaneStrainState.py | sloppyjuicy/pylith | ac2c1587f87e45c948638b19560813d4d5b6a9e3 | [
"MIT"
] | 71 | 2015-03-24T12:11:08.000Z | 2022-03-03T04:26:02.000Z | # ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... | 33.180851 | 79 | 0.607887 |
af7772c5a01cc7ee807d7b5f51c96df548d479f1 | 4,393 | py | Python | dist-packages/defer/utils.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/defer/utils.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/defer/utils.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utils for using deferreds with D-Bus."""
# Copyright (C) 2008-2010 Sebastian Heinlein <devel@glatzor.de>
#
# 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 ... | 39.576577 | 79 | 0.669019 |
cbe03a21401c8aa108df1bc72d1d59464581d387 | 3,819 | py | Python | lib/galaxy/datatypes/checkers.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/datatypes/checkers.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/datatypes/checkers.py | bopopescu/phyG | 023f505b705ab953f502cbc55e90612047867583 | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:03:18.000Z | 2020-07-25T21:03:18.000Z | import os, gzip, re, gzip, zipfile, binascii, bz2, imghdr
from galaxy import util
try:
import Image as PIL
except ImportError:
try:
from PIL import Image as PIL
except:
PIL = None
def check_image( file_path ):
if PIL != None:
try:
im = PIL.open( file_path )
... | 29.152672 | 144 | 0.575543 |
4f16212cb3ba8f657957bd2f06741ac83de96a08 | 90 | py | Python | examples/processing/split_lambda/tests/test_splitter.py | dgilmanAIDENTIFIED/juniper | 81452cb86863340e9f7dd57ccd1cf69881b6e9a9 | [
"Apache-2.0"
] | 65 | 2019-02-01T19:49:49.000Z | 2022-01-17T10:43:50.000Z | examples/processing/split_lambda/tests/test_splitter.py | dgilmanAIDENTIFIED/juniper | 81452cb86863340e9f7dd57ccd1cf69881b6e9a9 | [
"Apache-2.0"
] | 28 | 2019-02-12T18:57:13.000Z | 2021-09-21T00:00:50.000Z | examples/processing/split_lambda/tests/test_splitter.py | dgilmanAIDENTIFIED/juniper | 81452cb86863340e9f7dd57ccd1cf69881b6e9a9 | [
"Apache-2.0"
] | 9 | 2019-03-02T02:30:50.000Z | 2022-01-12T21:34:54.000Z |
def test_lambda_function():
# Test the read and write of the files!
assert True
| 15 | 43 | 0.688889 |
75418758e3acd20aec13a3b7726588aff25e2441 | 183,387 | py | Python | nfelib/v4_00/retConsSitNFe.py | erpbrasil/nfelib | 2c8911f6976163525e6fbc4a1b254420ded1a997 | [
"MIT"
] | 2 | 2021-09-17T17:06:37.000Z | 2021-09-20T15:09:35.000Z | nfelib/v4_00/retConsSitNFe.py | erpbrasil/nfelib | 2c8911f6976163525e6fbc4a1b254420ded1a997 | [
"MIT"
] | null | null | null | nfelib/v4_00/retConsSitNFe.py | erpbrasil/nfelib | 2c8911f6976163525e6fbc4a1b254420ded1a997 | [
"MIT"
] | 2 | 2021-04-01T12:59:36.000Z | 2021-08-07T15:59:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Mon Sep 23 18:59:23 2019 by generateDS.py version 2.29.3.
# Python 3.7.3 (default, Jun 24 2019, 04:54:02) [GCC 9.1.0]
#
# Command line options:
# ('--no-namespace-defs', '')
# ('--use-getter-setter', 'none')
# ('-f', '')
# ('-o', '/home/mileo/Pycharm... | 47.191714 | 334 | 0.605577 |
6dd66f384f47657498569e906c19bf9ad5445c77 | 4,402 | py | Python | example_devices/cyberglove.py | aforren1/peacoat | 73c4c8f3fe429de262d32948ee43f2d5dde05570 | [
"MIT"
] | null | null | null | example_devices/cyberglove.py | aforren1/peacoat | 73c4c8f3fe429de262d32948ee43f2d5dde05570 | [
"MIT"
] | 64 | 2017-06-11T21:18:12.000Z | 2021-11-09T15:48:04.000Z | example_devices/cyberglove.py | aforren1/toon | 73c4c8f3fe429de262d32948ee43f2d5dde05570 | [
"MIT"
] | null | null | null | import ctypes
import struct
import serial
import numpy as np
from time import sleep
from toon.input.device import BaseDevice
from serial.tools import list_ports
# thanks to ROS http://docs.ros.org/fuerte/api/cyberglove/html/serial__glove_8hpp.html
# for commands
# http://web.cs.ucdavis.edu/~neff/papers/GloveCalibratio... | 36.380165 | 125 | 0.601318 |
bc8c05ed0a67b662bb7e3a20d9158ba9f32dbd48 | 3,941 | py | Python | homeassistant/helpers/area_registry.py | Tony763/home-assistant | fa1df2e015d76abfc6cfd7d795eb439130f5d0ea | [
"Apache-2.0"
] | 1 | 2019-02-18T03:16:32.000Z | 2019-02-18T03:16:32.000Z | homeassistant/helpers/area_registry.py | Tony763/home-assistant | fa1df2e015d76abfc6cfd7d795eb439130f5d0ea | [
"Apache-2.0"
] | 3 | 2021-09-08T03:29:36.000Z | 2022-03-12T00:59:48.000Z | homeassistant/helpers/area_registry.py | akhan69/home-assistant | fb460a325e25fdea9043136bccaf546ec1c04eab | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:08.000Z | 2019-09-28T07:06:08.000Z | """Provide a way to connect devices to one physical location."""
import logging
import uuid
from collections import OrderedDict
from typing import MutableMapping # noqa: F401
from typing import Iterable, Optional, cast
import attr
from homeassistant.core import callback
from homeassistant.loader import bind_hass
fro... | 27.753521 | 78 | 0.614057 |
6447fd37d9d9384669fd82b7bce5900ea77d3d53 | 885 | py | Python | app/tests/test_kruskal_maze.py | rpowel/maze | d98d7a39e6cc0abbd32323be1722fc1a126d8910 | [
"MIT"
] | null | null | null | app/tests/test_kruskal_maze.py | rpowel/maze | d98d7a39e6cc0abbd32323be1722fc1a126d8910 | [
"MIT"
] | null | null | null | app/tests/test_kruskal_maze.py | rpowel/maze | d98d7a39e6cc0abbd32323be1722fc1a126d8910 | [
"MIT"
] | null | null | null | import random
import numpy as np
from mazes import KruskalMaze
def test_make_maze():
random.seed(1)
n_x = n_y = 10
result = KruskalMaze().make_maze(n_x, n_y)
correct = np.array(
[
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1],
[1... | 31.607143 | 49 | 0.360452 |
d25cc3da70905b5da9c826f4d6b2a5b5d802155b | 1,010 | py | Python | scripts/swiftdocify.py | awmcclain/CEF.swift | 620a4fdd0f2d131e9d87913dcf08d3ad96dabdf8 | [
"BSD-3-Clause"
] | 77 | 2015-09-28T08:33:06.000Z | 2022-01-26T16:05:40.000Z | scripts/swiftdocify.py | awmcclain/CEF.swift | 620a4fdd0f2d131e9d87913dcf08d3ad96dabdf8 | [
"BSD-3-Clause"
] | 63 | 2015-09-03T19:18:01.000Z | 2022-01-17T12:54:58.000Z | scripts/swiftdocify.py | awmcclain/CEF.swift | 620a4fdd0f2d131e9d87913dcf08d3ad96dabdf8 | [
"BSD-3-Clause"
] | 26 | 2015-09-28T08:21:58.000Z | 2021-11-11T13:51:22.000Z | #!/usr/bin/python
import sys
import os
import re
import string
from translation_helpers import *
def swiftdocify(cef_comment):
level = len(cef_comment.group(1)) // 4
swiftdoc_comment = make_swiftdoc_comment(strip_c_comment_prefix(cef_comment.group(2)))
return indent_multiline_string(swiftdoc_comment, lev... | 25.25 | 97 | 0.693069 |
85644e5db30a5497c6d063fbf01afc2a0786ec6a | 3,783 | py | Python | src/archive/ir-hotspot-rfc/hotspot_training.py | Bhaskers-Blu-Org2/arcticseals | 9e2629ca0ce7aadbe63118f39ff2da757d5dbc33 | [
"MIT"
] | 16 | 2019-05-21T20:08:01.000Z | 2021-11-23T22:34:00.000Z | src/archive/ir-hotspot-rfc/hotspot_training.py | readicculus/arcticseals | adfdd911e7f74ffaf288d1fbc4d8863844328d45 | [
"MIT"
] | 14 | 2018-07-18T17:14:30.000Z | 2019-04-14T14:40:12.000Z | src/archive/ir-hotspot-rfc/hotspot_training.py | readicculus/arcticseals | adfdd911e7f74ffaf288d1fbc4d8863844328d45 | [
"MIT"
] | 10 | 2019-05-10T20:56:47.000Z | 2022-01-26T13:16:40.000Z | import os
import pandas as pd
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import pickle
import time
def square_crop(image, x_pos, y_pos, size=35):
"""Returns a square crop of size centered on (x_pos, y_pos)
Inputs:
image: np.ndarray, image data in an array
x_pos: in... | 28.231343 | 90 | 0.667195 |
78ad9971643e954308ee94d8bb78c88ed09d61f3 | 118 | py | Python | pytest_pcap/__init__.py | sangoma/pytest-pcap | 815652f9ecbc98332c1bbc82869dc594d725f67e | [
"MIT"
] | 3 | 2017-01-06T17:01:32.000Z | 2021-06-30T07:58:44.000Z | pytest_pcap/__init__.py | sangoma/pytest-pcap | 815652f9ecbc98332c1bbc82869dc594d725f67e | [
"MIT"
] | 1 | 2017-02-27T17:36:00.000Z | 2017-02-27T17:38:43.000Z | pytest_pcap/__init__.py | sangoma/pytest-pcap | 815652f9ecbc98332c1bbc82869dc594d725f67e | [
"MIT"
] | null | null | null | from .dump import PcapDump, TcpDump
from .pcap import Ethernet, LinuxSLL, IP, IPV6, TCP, UDP, PcapError, Dumper, Pcap
| 39.333333 | 81 | 0.762712 |
a669d8017ab50c5666e01ac3b43f331e15fe3bce | 4,566 | bzl | Python | third_party/workspace.bzl | aknoerig/tensorboard | 574068af7129db9970184778ed9f479b6c6f8613 | [
"Apache-2.0"
] | 1 | 2020-04-16T05:27:17.000Z | 2020-04-16T05:27:17.000Z | third_party/workspace.bzl | lanpa/tensorboard | 6ba7155a614cf1cfab97f8ec7c561adb0a609b0d | [
"Apache-2.0"
] | null | null | null | third_party/workspace.bzl | lanpa/tensorboard | 6ba7155a614cf1cfab97f8ec7c561adb0a609b0d | [
"Apache-2.0"
] | null | null | null | # 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... | 42.277778 | 136 | 0.696014 |
105cbdda1e95943485afb27b70c3d912f6382c54 | 617 | py | Python | utils/evaluate.py | scoyer/MTN | db0aaa53ece29ab38f7a7b7cdc742d5d90fda902 | [
"MIT"
] | 102 | 2019-05-31T11:54:18.000Z | 2022-03-14T13:27:17.000Z | utils/evaluate.py | scoyer/MTN | db0aaa53ece29ab38f7a7b7cdc742d5d90fda902 | [
"MIT"
] | 11 | 2019-07-24T04:23:52.000Z | 2022-01-05T23:43:09.000Z | utils/evaluate.py | scoyer/MTN | db0aaa53ece29ab38f7a7b7cdc742d5d90fda902 | [
"MIT"
] | 23 | 2019-07-06T11:39:40.000Z | 2022-01-04T01:22:54.000Z | #!/usr/bin/python
from pycocotools.coco import COCO
from pycocoevalcap.eval import COCOEvalCap
import sys
# create coco object and cocoRes object
coco = COCO(sys.argv[1])
cocoRes = coco.loadRes(sys.argv[2])
# create cocoEval object by taking coco and cocoRes
cocoEval = COCOEvalCap(coco, cocoRes)
# evaluate on a subset... | 29.380952 | 51 | 0.758509 |
4ad4939bbe6f7a1d32acfe787089fa218824a7bb | 3,771 | py | Python | benchmark/startCirq1064.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq1064.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq1064.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=5
# total number=48
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 38.090909 | 77 | 0.652347 |
9a7864bb267dbc1aea9e3d50b5ef99fc9c231bd1 | 5,482 | py | Python | library/PyAkaiKKR/pyakaikkr/AwkReader.py | AkaiKKRteam/AkaiKKRPythonUtil | be716747de83c9f1787b6ac1c9a61ef725a643dd | [
"Apache-2.0"
] | null | null | null | library/PyAkaiKKR/pyakaikkr/AwkReader.py | AkaiKKRteam/AkaiKKRPythonUtil | be716747de83c9f1787b6ac1c9a61ef725a643dd | [
"Apache-2.0"
] | 6 | 2021-11-26T06:28:13.000Z | 2022-02-18T05:45:11.000Z | library/PyAkaiKKR/pyakaikkr/AwkReader.py | AkaiKKRteam/AkaiKKRPythonUtil | be716747de83c9f1787b6ac1c9a61ef725a643dd | [
"Apache-2.0"
] | 3 | 2021-11-26T03:06:15.000Z | 2021-11-26T04:45:31.000Z | # coding: utf-8
# Copyright (c) 2021 AkaiKKRteam.
# Distributed under the terms of the Apache License, Version 2.0.
from pymatgen.core.periodic_table import Element
from collections import OrderedDict
import matplotlib.pyplot as plt
import re
import numpy as np
if False:
# Awk can be read, but an error occurs in... | 27.547739 | 99 | 0.519701 |
687e7689fc1c89408ba46677ab33d66bee01edae | 270 | py | Python | Ex011.py | CaioHRombaldo/PythonClasses | 78cd990153ff95c0b4a120550a9e77438008d2d0 | [
"MIT"
] | null | null | null | Ex011.py | CaioHRombaldo/PythonClasses | 78cd990153ff95c0b4a120550a9e77438008d2d0 | [
"MIT"
] | null | null | null | Ex011.py | CaioHRombaldo/PythonClasses | 78cd990153ff95c0b4a120550a9e77438008d2d0 | [
"MIT"
] | null | null | null | height = int(input('Please enter the height of the wall in meters: '))
width = int(input('Please enter the width of the wall in meters: '))
area = height * width
paintByArea = 2
print('It will take {} liters of paint to paint the entire wall.'.format(area/paintByArea))
| 45 | 91 | 0.725926 |
7eec3cc2a005b80b9ffac99ecc26e5cd63629470 | 464 | py | Python | gitinfo.py | l3gacyb3ta/ghcopilottest | 1139b373fafa34deedaf286f7c07a596fef5d191 | [
"Unlicense"
] | null | null | null | gitinfo.py | l3gacyb3ta/ghcopilottest | 1139b373fafa34deedaf286f7c07a596fef5d191 | [
"Unlicense"
] | null | null | null | gitinfo.py | l3gacyb3ta/ghcopilottest | 1139b373fafa34deedaf286f7c07a596fef5d191 | [
"Unlicense"
] | null | null | null | import subprocess, os
def has_remote(path: str) -> bool:
"""
Return True if the given path has a remote.
:param path: The path to check.
:return: True if the path has a remote.
"""
try:
git_path = os.path.join(path, ".git")
git_cmd = ["git", "-C", git_path, "remote", "-v"]
... | 22.095238 | 57 | 0.601293 |
86b3834405477a53b840056524cd97c0ef2a7b88 | 5,062 | py | Python | tests/test_convert.py | Alexsandruss/sklearn-onnx | b612557615df439e471867a676c9eca8ae4a787c | [
"Apache-2.0"
] | 1 | 2021-06-11T22:08:57.000Z | 2021-06-11T22:08:57.000Z | tests/test_convert.py | ogrisel/sklearn-onnx | 0afbe295aa3f1abbcea60f582faac31d16bd3ab0 | [
"Apache-2.0"
] | null | null | null | tests/test_convert.py | ogrisel/sklearn-onnx | 0afbe295aa3f1abbcea60f582faac31d16bd3ab0 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
import unittest
import warnings
import numpy
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
from sklearn.cluster import KMeans
try:
from sklearn.preprocessing import KBinsDiscretizer
except ImportError:
KBinsDiscretizer = None
from sklearn.gaussian_process ... | 35.900709 | 76 | 0.512446 |
3db063f89022eac543143d4c580cfc33d0871c36 | 17,580 | py | Python | tccli/services/emr/v20190103/help.py | bopopescu/tencentcloud-cli-intl-en | e6317252557095dd10018226244e636daa4a3c67 | [
"Apache-2.0"
] | null | null | null | tccli/services/emr/v20190103/help.py | bopopescu/tencentcloud-cli-intl-en | e6317252557095dd10018226244e636daa4a3c67 | [
"Apache-2.0"
] | null | null | null | tccli/services/emr/v20190103/help.py | bopopescu/tencentcloud-cli-intl-en | e6317252557095dd10018226244e636daa4a3c67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
DESC = "emr-2019-01-03"
INFO = {
"ScaleOutInstance": {
"params": [
{
"name": "TimeUnit",
"desc": "Time unit of scale-out. Valid values:\n<li>s: seconds. When `PayMode` is 0, `TimeUnit` can only be `s`.</li>\n<li>m: month. When `PayMode` is 1, `TimeUnit` can only be `m... | 42.878049 | 671 | 0.59033 |
ac93011679ae43b9673544189190096aaa7e9a97 | 4,203 | py | Python | corpus.py | tarun-bathwal/MOQA | 5cb111983b265c0f0288269aedeb13f1307692c9 | [
"MIT"
] | 17 | 2017-06-17T14:16:59.000Z | 2020-08-24T05:44:03.000Z | corpus.py | tarun-bathwal/MOQA | 5cb111983b265c0f0288269aedeb13f1307692c9 | [
"MIT"
] | 1 | 2019-01-07T10:09:21.000Z | 2019-01-07T10:09:21.000Z | corpus.py | pprakhar30/MOQA | 5cb111983b265c0f0288269aedeb13f1307692c9 | [
"MIT"
] | 5 | 2017-12-26T11:27:32.000Z | 2019-12-27T17:47:18.000Z | import sys
import gzip
import json
import operator
import numpy as np
from math import log
from mapping import Mapping
from utils import calc_LCS
from collections import defaultdict
from documents import QAdoc, ReviewDoc, Sentence
from multiprocessing import Pool
import multiprocessing
mp = multiprocessing.cpu_coun... | 26.433962 | 111 | 0.660719 |
75dea4e883152f9404c04c0d0cf7f22ea88a5a0a | 10,124 | py | Python | thunder_board/server.py | ZW7436/ThunderBoard | b122d7fb75208da43df86213fb32901caa6c2e41 | [
"MIT"
] | 7 | 2020-04-10T09:05:45.000Z | 2021-08-30T07:26:49.000Z | thunder_board/server.py | ZW7436/ThunderBoard | b122d7fb75208da43df86213fb32901caa6c2e41 | [
"MIT"
] | 2 | 2021-09-08T01:52:52.000Z | 2022-03-12T00:23:47.000Z | thunder_board/server.py | ZW7436/ThunderBoard | b122d7fb75208da43df86213fb32901caa6c2e41 | [
"MIT"
] | 4 | 2021-03-31T14:27:21.000Z | 2021-08-30T07:26:52.000Z | import io
import threading
import socket
import struct
import logging
import time
from flask import Flask, render_template
from flask_socketio import SocketIO, emit, join_room, leave_room
from thunder_board import objects
class DashboardServer:
def __init__(self, recv_server_host = "0.0.0.0", recv_server_port =... | 38.789272 | 131 | 0.542177 |
0248f725b4934087bec9bd3915fbd80babc706da | 25,240 | py | Python | Tests/test_Uniprot.py | xzy3/biopython | 4bd06c16bbcef7a0f5bc43ba9bb936b9557996e9 | [
"BSD-3-Clause"
] | 2 | 2020-06-25T12:52:03.000Z | 2020-07-11T09:47:34.000Z | Tests/test_Uniprot.py | xzy3/biopython | 4bd06c16bbcef7a0f5bc43ba9bb936b9557996e9 | [
"BSD-3-Clause"
] | null | null | null | Tests/test_Uniprot.py | xzy3/biopython | 4bd06c16bbcef7a0f5bc43ba9bb936b9557996e9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2010 by Andrea Pierleoni
# Revisions copyright 2010-2015 by Peter Cock. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Test for the Uniprot parser on Uniprot XML ... | 57.363636 | 258 | 0.595325 |
f674a1d0adf90c030f28e938d148ede11bd1ad16 | 2,250 | py | Python | tests/bugs/core_6487_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/bugs/core_6487_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/bugs/core_6487_test.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: bugs.core_6487
# title: FETCH ABSOLUTE and RELATIVE beyond bounds of cursor should always position immediately before-first or after-last
# decription:
# Confirmed bug on 4.0.0.2365, 3.0.8.33415.
# Checked on 4.0.0.2369, 3.0.8.33416 - works OK.
#... | 25 | 129 | 0.601333 |
dea43e633f07bd7c8e98bdef1e5b8704358fdbd6 | 39,979 | py | Python | test/test_local_io.py | dahsh/data | 8527864ae9e0692b62e05b708bc100e48860aaf8 | [
"BSD-3-Clause"
] | null | null | null | test/test_local_io.py | dahsh/data | 8527864ae9e0692b62e05b708bc100e48860aaf8 | [
"BSD-3-Clause"
] | null | null | null | test/test_local_io.py | dahsh/data | 8527864ae9e0692b62e05b708bc100e48860aaf8 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import bz2
import functools
import hashlib
import io
import itertools
import lzma
import os
import subprocess
i... | 45.379115 | 119 | 0.671377 |
12840bce04a1a2ba03f187e9218b1798fe165492 | 370,682 | py | Python | test/unit/obj/test_diskfile.py | gyaozhou/swift-read | 16fe18ae3be59a095f3bafdd69fe74b48a2771cb | [
"Apache-2.0"
] | null | null | null | test/unit/obj/test_diskfile.py | gyaozhou/swift-read | 16fe18ae3be59a095f3bafdd69fe74b48a2771cb | [
"Apache-2.0"
] | null | null | null | test/unit/obj/test_diskfile.py | gyaozhou/swift-read | 16fe18ae3be59a095f3bafdd69fe74b48a2771cb | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | 44.660482 | 79 | 0.566631 |
b5754f1893b4578d46aff3fea5ca93dfb1ef6725 | 998 | py | Python | A1_T6.py | ydang5/Assignment-1 | 04658b070e99b21bcf7bffd9f83b3333e892c4db | [
"BSD-3-Clause"
] | null | null | null | A1_T6.py | ydang5/Assignment-1 | 04658b070e99b21bcf7bffd9f83b3333e892c4db | [
"BSD-3-Clause"
] | null | null | null | A1_T6.py | ydang5/Assignment-1 | 04658b070e99b21bcf7bffd9f83b3333e892c4db | [
"BSD-3-Clause"
] | null | null | null | import statistics
#1 Given array data, find single mode value
values = [80, 90, 100, 150, 120, 110, 160, 110, 100]
# mode = statistics.mode(values)
#
# print(mode)
#
# #2 Given array data, find multiple mode values
# # This code demonstrates that we cannot calculate mode value because there
# # are more then one mod... | 22.177778 | 76 | 0.672345 |
94c3da9e8809a26748289e94337190a80b20d7ef | 3,863 | py | Python | frocket/invoker/metrics_frame.py | DynamicYieldProjects/funnel-rocket | 70963fddc0881cebdc6da1af2654d412f95d660c | [
"Apache-2.0"
] | 56 | 2021-04-04T08:15:33.000Z | 2022-03-14T06:31:20.000Z | frocket/invoker/metrics_frame.py | DynamicYieldProjects/funnel-rocket | 70963fddc0881cebdc6da1af2654d412f95d660c | [
"Apache-2.0"
] | 19 | 2021-04-01T20:35:48.000Z | 2022-03-30T22:07:27.000Z | frocket/invoker/metrics_frame.py | DynamicYieldProjects/funnel-rocket | 70963fddc0881cebdc6da1af2654d412f95d660c | [
"Apache-2.0"
] | 2 | 2021-07-14T13:47:00.000Z | 2021-08-12T07:58:32.000Z | """
Transform a given list of metrics from multiple sources (invoker, workers) into one DataFrame, for easy analysis.
Export the data into file and/or Prometheus, by configuration.
"""
# Copyright 2021 The Funnel Rocket Maintainers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... | 40.663158 | 119 | 0.704893 |
ef3b5c7d0babae489ac86eef10ac1e6a94abf6fd | 7,110 | py | Python | sphinx/testing/path.py | supyrow/sphinx | 680417a10df7e5c35c0ff65979bd22906b9a5f1e | [
"BSD-2-Clause"
] | 2 | 2022-01-19T02:33:11.000Z | 2022-01-19T02:33:13.000Z | sphinx/testing/path.py | supyrow/sphinx | 680417a10df7e5c35c0ff65979bd22906b9a5f1e | [
"BSD-2-Clause"
] | 4 | 2022-01-23T07:54:28.000Z | 2022-03-02T14:35:14.000Z | sphinx/testing/path.py | supyrow/sphinx | 680417a10df7e5c35c0ff65979bd22906b9a5f1e | [
"BSD-2-Clause"
] | null | null | null | """
sphinx.testing.path
~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import builtins
import os
import shutil
import sys
import warnings
from typing import IO, Any, Callable, List
from sphinx.deprecation import Removed... | 30.127119 | 86 | 0.569058 |
21e52fdf930c733fb4c3b042af039579f4967e2e | 9,665 | py | Python | contrib/bitrpc/bitrpc.py | uvcproject/uvc | dd3e0f61e6fcf5a8bd0c491a03b42d2a00520af1 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | uvcproject/uvc | dd3e0f61e6fcf5a8bd0c491a03b42d2a00520af1 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | uvcproject/uvc | dd3e0f61e6fcf5a8bd0c491a03b42d2a00520af1 | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:41062")
... | 28.594675 | 101 | 0.573513 |
4499e3bfd7208f03a88507d752858e44b7531d5f | 571 | py | Python | view.py | tkinjo1985/ESP32-CAM_RTSP | 3dceaf590a5f8aef447e5573a7fd7a8797258731 | [
"MIT"
] | 8 | 2020-12-02T17:03:39.000Z | 2022-01-10T18:47:06.000Z | view.py | tkinjo1985/ESP32CAM_RTSP | 3dceaf590a5f8aef447e5573a7fd7a8797258731 | [
"MIT"
] | null | null | null | view.py | tkinjo1985/ESP32CAM_RTSP | 3dceaf590a5f8aef447e5573a7fd7a8797258731 | [
"MIT"
] | 8 | 2021-03-29T06:45:29.000Z | 2022-03-16T13:44:17.000Z | import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
esp_ip = "192.168.0.100"
vcap = cv2.VideoCapture(f"rtsp://{esp_ip}:8554/mjpeg/1")
while True:
ret, frame = vcap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(frame, 1.3, 5... | 25.954545 | 76 | 0.637478 |
c21073fd068af1af06cce82c85de96d3ed0759d4 | 1,052 | py | Python | naf2conll/tests/conftest.py | Filter-Bubble/FormatConversions | 91c313d66edba077462740c1403a705aa1f96df4 | [
"Apache-2.0"
] | 3 | 2019-11-21T13:43:37.000Z | 2021-05-12T20:46:49.000Z | naf2conll/tests/conftest.py | Filter-Bubble/FormatConversions | 91c313d66edba077462740c1403a705aa1f96df4 | [
"Apache-2.0"
] | 3 | 2018-05-22T13:07:43.000Z | 2020-03-14T17:31:15.000Z | naf2conll/tests/conftest.py | Filter-Bubble/FormatConversions | 91c313d66edba077462740c1403a705aa1f96df4 | [
"Apache-2.0"
] | 2 | 2020-03-05T15:55:47.000Z | 2021-05-12T20:46:50.000Z | import os
import pytest
@pytest.fixture
def resources_dir():
return './resources/'
@pytest.fixture
def config_dir():
return '../config/'
@pytest.fixture
def empty_dir(resources_dir):
return os.path.join(resources_dir, 'empty_dir')
@pytest.fixture
def naffile_coref(resources_dir):
return os.path... | 19.127273 | 62 | 0.764259 |
77a69c7886c776e18201fadd4ae31765cf47f1ae | 214 | py | Python | src/PSNR.py | mwutti/CodecComparision | b03995e830fb26dfa9d9df21ba6e034ab4c23b11 | [
"Unlicense"
] | null | null | null | src/PSNR.py | mwutti/CodecComparision | b03995e830fb26dfa9d9df21ba6e034ab4c23b11 | [
"Unlicense"
] | null | null | null | src/PSNR.py | mwutti/CodecComparision | b03995e830fb26dfa9d9df21ba6e034ab4c23b11 | [
"Unlicense"
] | null | null | null | import math
import numpy
def psnr(image1, image2):
mse = numpy.mean((image1 - image2) ** 2)
if mse == 0:
return 100
max_value = 255.0
return 20 * math.log10(max_value / math.sqrt(mse))
| 15.285714 | 54 | 0.607477 |
afb9a3a7d345676539630fc1a712fd46d35315ac | 5,240 | py | Python | settings.py | tonycairns1/Healthy-Planet-Heros | 7390c65b60a0d1b91c8123d8f92f973f00e43cda | [
"MIT"
] | null | null | null | settings.py | tonycairns1/Healthy-Planet-Heros | 7390c65b60a0d1b91c8123d8f92f973f00e43cda | [
"MIT"
] | null | null | null | settings.py | tonycairns1/Healthy-Planet-Heros | 7390c65b60a0d1b91c8123d8f92f973f00e43cda | [
"MIT"
] | null | null | null | # Django settings for healthyplanetheros project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | 34.933333 | 115 | 0.694275 |
1cdbcf36ed547954a42aa8fd65188c336642f03d | 669 | py | Python | apps/account/models.py | youjiajia/loonflow | 0542e543ffea49b2eda864397b9875b6bf107dd5 | [
"MIT"
] | null | null | null | apps/account/models.py | youjiajia/loonflow | 0542e543ffea49b2eda864397b9875b6bf107dd5 | [
"MIT"
] | null | null | null | apps/account/models.py | youjiajia/loonflow | 0542e543ffea49b2eda864397b9875b6bf107dd5 | [
"MIT"
] | null | null | null | from django.contrib.auth.base_user import BaseUserManager, AbstractBaseUser
from django.db import models
from apps.loon_base_model import BaseModel
class AppToken(BaseModel):
"""
App token,用于api调用方授权
"""
app_name = models.CharField('应用名称', max_length=50)
token = models.CharField('签名令牌', max_length... | 35.210526 | 106 | 0.689088 |
d30d95a3c0280e3b36f1444e6904260952414621 | 1,214 | py | Python | setup.py | poxip/django-furl | 3dc74d6a2f1bb677abc7d1c7878b51af2a7c394d | [
"MIT"
] | 10 | 2016-02-14T15:28:13.000Z | 2017-10-14T17:07:13.000Z | setup.py | poxip/django-furl | 3dc74d6a2f1bb677abc7d1c7878b51af2a7c394d | [
"MIT"
] | 7 | 2016-02-14T15:47:40.000Z | 2021-06-10T20:34:50.000Z | setup.py | poxip/django-furl | 3dc74d6a2f1bb677abc7d1c7878b51af2a7c394d | [
"MIT"
] | 1 | 2017-10-14T17:07:14.000Z | 2017-10-14T17:07:14.000Z | import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-furl',
version='0.1.0',
... | 33.722222 | 78 | 0.644152 |
0bf32d2a4cd637f3e9b811ce4815b37e0ae0c3d5 | 619 | py | Python | Getting-Started-with-Python/pay_calculator.py | michellevrp/Python_Course | ac2a353fa828290d9923665fbdb1e742bea9931e | [
"CC0-1.0"
] | null | null | null | Getting-Started-with-Python/pay_calculator.py | michellevrp/Python_Course | ac2a353fa828290d9923665fbdb1e742bea9931e | [
"CC0-1.0"
] | null | null | null | Getting-Started-with-Python/pay_calculator.py | michellevrp/Python_Course | ac2a353fa828290d9923665fbdb1e742bea9931e | [
"CC0-1.0"
] | null | null | null | #first exercise
#This code asks the user for hours and rate for hour, calculate total pay and print it.
hrs = input("Enter Hours:")
rate = input("Enter Rate:")
pay = float(hrs) * float(rate)
print("Pay:", pay)
#second exercise
#This code asks the user for hours and rate for hour, calculate total pay and print... | 25.791667 | 89 | 0.628433 |
8405265f1e1f9ed8b6388f230508394e58261d31 | 6,725 | py | Python | examples/pwr_run/checkpointing/socket_short/feedback/job9.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/socket_short/feedback/job9.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/socket_short/feedback/job9.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 30.568182 | 118 | 0.703048 |
8fc253c18eb981d1d6079ce374bfdafffed21261 | 8,943 | py | Python | .pc/hg-updates.diff/Lib/asyncio/base_subprocess.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 3 | 2016-12-26T18:35:07.000Z | 2021-08-24T22:49:40.000Z | .pc/hg-updates.diff/Lib/asyncio/base_subprocess.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 1 | 2018-12-28T21:11:50.000Z | 2018-12-28T21:11:50.000Z | .pc/hg-updates.diff/Lib/asyncio/base_subprocess.py | Hadron/python | 73137f499ed658169f49273eee46845e3b53e800 | [
"PSF-2.0"
] | 3 | 2018-01-21T17:53:17.000Z | 2021-09-08T10:22:05.000Z | import collections
import subprocess
import warnings
from . import compat
from . import futures
from . import protocols
from . import transports
from .coroutines import coroutine
from .log import logger
class BaseSubprocessTransport(transports.SubprocessTransport):
def __init__(self, loop, protocol, args, shell... | 31.052083 | 79 | 0.578218 |
9de8e438840bfe714265c453c74f23632d728eee | 7,101 | py | Python | tinycord/models/message/component.py | tinycord/tinycord | 9e817452c1f2357878f07f8622f6240687470cad | [
"MIT"
] | 8 | 2022-01-08T20:04:29.000Z | 2022-03-21T19:12:19.000Z | tinycord/models/message/component.py | tinycord/tinycord | 9e817452c1f2357878f07f8622f6240687470cad | [
"MIT"
] | null | null | null | tinycord/models/message/component.py | tinycord/tinycord | 9e817452c1f2357878f07f8622f6240687470cad | [
"MIT"
] | 1 | 2022-01-02T21:42:53.000Z | 2022-01-02T21:42:53.000Z | import typing
from ..guild.emoji import Emoji
class Component:
"""
This is the Component it used to represent a component.
"""
def __init__(self, **data) -> None:
self.type: int = int(
data.get('type'))
"""The type of the component."""
self.custom_id: ... | 29.962025 | 99 | 0.541191 |
2099e6605d19e85cf6f934a0c61f9f8e35f95699 | 4,230 | py | Python | example/0_Basic_usage_of_the_library/python_asyncio/example_3_coroutinepool.py | RecluseXU/learning_spider | 45fa790ed7970be57a21b40817cc66856de3d99b | [
"MIT"
] | 38 | 2020-08-30T11:41:53.000Z | 2022-03-23T04:30:26.000Z | example/0_Basic_usage_of_the_library/python_asyncio/example_3_coroutinepool.py | AndersonHJB/learning_spider | b855b7808fb5268e9564180cf73ba5b1fb133f58 | [
"MIT"
] | 2 | 2021-08-20T16:34:12.000Z | 2021-10-08T11:06:41.000Z | example/0_Basic_usage_of_the_library/python_asyncio/example_3_coroutinepool.py | AndersonHJB/learning_spider | b855b7808fb5268e9564180cf73ba5b1fb133f58 | [
"MIT"
] | 10 | 2020-11-24T09:15:42.000Z | 2022-02-25T06:05:16.000Z | # -*- encoding: utf-8 -*-
'''
@Time : 2021-05-18
@Author : EvilRecluse
@Contact : https://github.com/RecluseXU
@Desc : 启动一个线程来运行协程池,进行任务执行
'''
# here put the import lib
import asyncio
import aiohttp
import time
import queue
from threading import Thread
class AsyncPool(object):
"""
1. 支持动态添加任务
... | 22.03125 | 93 | 0.5513 |
4888109f615b522a5e65b5d17a80bfa844a0bfec | 2,430 | py | Python | translate/multitask_model.py | trangvu/ape-npi | 4ae2cd6ed1be773dfe1513458d5e7adae0d46283 | [
"Apache-2.0"
] | 1 | 2019-01-02T15:57:32.000Z | 2019-01-02T15:57:32.000Z | translate/multitask_model.py | trangvu/ape-npi | 4ae2cd6ed1be773dfe1513458d5e7adae0d46283 | [
"Apache-2.0"
] | null | null | null | translate/multitask_model.py | trangvu/ape-npi | 4ae2cd6ed1be773dfe1513458d5e7adae0d46283 | [
"Apache-2.0"
] | 2 | 2020-08-02T18:28:54.000Z | 2021-07-30T07:28:40.000Z | import numpy as np
from translate import utils
from translate.translation_model import TranslationModel
class MultiTaskModel:
def __init__(self, tasks, **kwargs):
self.models = []
self.ratios = []
for i, task in enumerate(tasks, 1):
if task.name is None:
task.n... | 35.217391 | 95 | 0.574486 |
6d5bbb13ef42c3146d1ebe73684180fabd412c9c | 7,485 | py | Python | plugin.video.saltsrd.lite/scrapers/pubfilm_scraper.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2019-03-05T09:38:10.000Z | 2019-03-05T09:38:10.000Z | plugin.video.saltsrd.lite/scrapers/pubfilm_scraper.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | null | null | null | plugin.video.saltsrd.lite/scrapers/pubfilm_scraper.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2021-11-05T20:48:09.000Z | 2021-11-05T20:48:09.000Z | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | 47.075472 | 164 | 0.61336 |
e76a6ad514aa4debd7e269601960824d1bdf70b7 | 813 | py | Python | setup.py | mkasa/taw | 9447d27133a9f2d8a0bc162347757702ccb17b30 | [
"MIT"
] | 3 | 2017-12-17T02:11:50.000Z | 2019-11-21T10:30:16.000Z | setup.py | mkasa/taw | 9447d27133a9f2d8a0bc162347757702ccb17b30 | [
"MIT"
] | null | null | null | setup.py | mkasa/taw | 9447d27133a9f2d8a0bc162347757702ccb17b30 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
import sys
depending_libraries = \
[
'click>=6.6',
'boto3>=1.7.7',
'tabulate>=0.7.7',
'colorama==0.2.5',
'termcolor',
'future',
'six',
'pyperclip',
'awscli>=1.11.35',
'... | 21.394737 | 79 | 0.510455 |
e4c55b41a975e7e784b112aae6eede6fbb725ef3 | 2,228 | py | Python | nets/TUs_graph_classification/gated_gcn_net.py | sejunssi/benchmarking_gnns | 881c92850f5366f7f8ca008da375037a41936681 | [
"MIT"
] | 5 | 2021-07-13T14:16:22.000Z | 2022-03-07T10:41:21.000Z | nets/TUs_graph_classification/gated_gcn_net.py | sejunssi/benchmarking_gnns | 881c92850f5366f7f8ca008da375037a41936681 | [
"MIT"
] | null | null | null | nets/TUs_graph_classification/gated_gcn_net.py | sejunssi/benchmarking_gnns | 881c92850f5366f7f8ca008da375037a41936681 | [
"MIT"
] | 1 | 2021-07-26T03:59:48.000Z | 2021-07-26T03:59:48.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
"""
ResGatedGCN: Residual Gated Graph ConvNets
An Experimental Study of Neural Networks for Variable Graphs (Xavier Bresson and Thomas Laurent, ICLR 2018)
https://arxiv.org/pdf/1711.07553v2.pdf
"""
from layers.gated_gcn_layer im... | 34.8125 | 120 | 0.603232 |
e2266434d38b3592bef31be87c5ef837340c7891 | 3,123 | py | Python | githubscrapy/githubscrapy/settings.py | lhfei/scrapy-in-action | 1caac28812a6b11cf69e90f276fa7e9dc08a635e | [
"Apache-2.0"
] | null | null | null | githubscrapy/githubscrapy/settings.py | lhfei/scrapy-in-action | 1caac28812a6b11cf69e90f276fa7e9dc08a635e | [
"Apache-2.0"
] | null | null | null | githubscrapy/githubscrapy/settings.py | lhfei/scrapy-in-action | 1caac28812a6b11cf69e90f276fa7e9dc08a635e | [
"Apache-2.0"
] | null | null | null | # Scrapy settings for githubscrapy project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middl... | 35.089888 | 103 | 0.78098 |
368ad837d302c4117a2e75dcbd405766768bac7c | 773 | py | Python | booktime/booktime/main/tests/test_forms.py | thiagosantos346/apress | 0dab6b36fd8e937b79194f670bf5161154b80e39 | [
"Apache-2.0"
] | null | null | null | booktime/booktime/main/tests/test_forms.py | thiagosantos346/apress | 0dab6b36fd8e937b79194f670bf5161154b80e39 | [
"Apache-2.0"
] | null | null | null | booktime/booktime/main/tests/test_forms.py | thiagosantos346/apress | 0dab6b36fd8e937b79194f670bf5161154b80e39 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from django.core import mail
from main import forms
class TestForm(TestCase):
def test_valid_contact_us_form_sends_email(self):
form = forms.ContactForm({
'name': "Luke Skywalker",
'message': "Hi there"})
self.assertTrue(form.is_valid())
... | 26.655172 | 64 | 0.608021 |
31629a8696aa9797f2587420d1f084f9fdf47d80 | 11,295 | py | Python | modules/core/_manage.py | Fates-List/infra | bdc10244b371047069a784ab60517013fe636fcb | [
"MIT"
] | 3 | 2022-03-13T12:48:02.000Z | 2022-03-14T01:54:54.000Z | modules/core/_manage.py | Fates-List/infra | bdc10244b371047069a784ab60517013fe636fcb | [
"MIT"
] | 1 | 2022-03-06T16:20:40.000Z | 2022-03-06T16:20:40.000Z | modules/core/_manage.py | Fates-List/infra | bdc10244b371047069a784ab60517013fe636fcb | [
"MIT"
] | 1 | 2022-03-04T06:13:12.000Z | 2022-03-04T06:13:12.000Z | # pylint: disable=E1101
"""_manage comtains functions to manage the site using dragon"""
import asyncio
import datetime
import importlib
import os
import secrets
import shutil
import sys
import time
import uuid
from getpass import getpass
from pathlib import Path
from subprocess import DEVNULL, Popen
import requests
d... | 30.039894 | 101 | 0.55405 |
ebc47ccaad73fca9e089278e830cc556bbffe98c | 880 | py | Python | pelicanconf.py | SebastianFish/GettingStarted | 12c7bb6468fc0ce2622d72f1006c449f66d4d238 | [
"MIT"
] | null | null | null | pelicanconf.py | SebastianFish/GettingStarted | 12c7bb6468fc0ce2622d72f1006c449f66d4d238 | [
"MIT"
] | null | null | null | pelicanconf.py | SebastianFish/GettingStarted | 12c7bb6468fc0ce2622d72f1006c449f66d4d238 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
AUTHOR = 'Sebastian Fisher'
SITENAME = 'GettingStarted.io'
SITEURL = ''
PATH = 'content'
OUTPUT_PATH = 'docs/'
TIMEZONE = 'America/Chicago'
DEFAULT_LANG = 'English'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = Non... | 25.142857 | 77 | 0.679545 |
5397a9d58518aae1da062a31a3d1df22cd178021 | 3,596 | py | Python | vpl_graph.py | WeakKnight/Falcor | 9c0306a3d0525902b042efd2581369141bb95339 | [
"BSD-3-Clause"
] | null | null | null | vpl_graph.py | WeakKnight/Falcor | 9c0306a3d0525902b042efd2581369141bb95339 | [
"BSD-3-Clause"
] | null | null | null | vpl_graph.py | WeakKnight/Falcor | 9c0306a3d0525902b042efd2581369141bb95339 | [
"BSD-3-Clause"
] | null | null | null | from falcor import *
def render_graph_DefaultRenderGraph():
g = RenderGraph('DefaultRenderGraph')
loadRenderPassLibrary('SceneDebugger.dll')
loadRenderPassLibrary('BSDFViewer.dll')
loadRenderPassLibrary('AccumulatePass.dll')
loadRenderPassLibrary('ReSTIRPass.dll')
loadRenderPassLibrary('Antiali... | 53.671642 | 342 | 0.769744 |
ac2cf11c1a5b0ff68e2413becf80c09f1853ae03 | 3,706 | py | Python | tournament.py | Pavlos1/linkgame_tournament_server | 8ec77dc774eeab223dddd69b5951b2367d0c8bce | [
"BSD-2-Clause"
] | null | null | null | tournament.py | Pavlos1/linkgame_tournament_server | 8ec77dc774eeab223dddd69b5951b2367d0c8bce | [
"BSD-2-Clause"
] | null | null | null | tournament.py | Pavlos1/linkgame_tournament_server | 8ec77dc774eeab223dddd69b5951b2367d0c8bce | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python2
from tests import runTest
from time import sleep
import db
fp = open("/srv/sol.txt")
raw = []
for solution in fp.readlines():
raw.append(solution.lstrip().rstrip())
fp.close()
def getTenNewestUsers():
cnx = db.dbConnect("linkgame")
cur = cnx.cursor()
cur.execute(("SELECT uid FR... | 35.980583 | 141 | 0.529682 |
b4add4a4f1790741585ff95625f2d1b3676af801 | 1,670 | py | Python | profiles_api/models.py | junaij-work/ProfileRestAPI | 770da2010bf40261820a3c304bd8dbd0ca3ca814 | [
"MIT"
] | null | null | null | profiles_api/models.py | junaij-work/ProfileRestAPI | 770da2010bf40261820a3c304bd8dbd0ca3ca814 | [
"MIT"
] | null | null | null | profiles_api/models.py | junaij-work/ProfileRestAPI | 770da2010bf40261820a3c304bd8dbd0ca3ca814 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
# Create your models here.
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def create_u... | 29.298246 | 64 | 0.677246 |
0115a07eb621437f6def38900d3eccf7e99513fc | 8,421 | py | Python | src/train.py | GreenLv/Pensieve-PPO | 0b4ff7550102cd4be7080eaf942a096f629bed0c | [
"BSD-2-Clause"
] | 1 | 2022-03-03T12:09:00.000Z | 2022-03-03T12:09:00.000Z | src/train.py | GreenLv/Pensieve-PPO | 0b4ff7550102cd4be7080eaf942a096f629bed0c | [
"BSD-2-Clause"
] | null | null | null | src/train.py | GreenLv/Pensieve-PPO | 0b4ff7550102cd4be7080eaf942a096f629bed0c | [
"BSD-2-Clause"
] | 1 | 2022-03-03T12:09:02.000Z | 2022-03-03T12:09:02.000Z | import multiprocessing as mp
import numpy as np
import logging
import os
import sys
from abr import ABREnv
import ppo2 as network
import tensorflow as tf
os.environ['CUDA_VISIBLE_DEVICES'] = '3'
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
S_DIM = [6, 8]
A_DIM = 6
ACTOR_LR_RATE =1e-4
CRITIC_LR_RATE = 1e-3
NUM_AGENTS = 12... | 34.512295 | 100 | 0.572022 |
a3e579919067b2734bb828f96a1bcee93d0d0421 | 4,753 | py | Python | scripts/estimate_Pn_bam.py | aakashsur/docker-hirise | 9b97cc4e7522e287aa2ee39c2993270e75b43a6d | [
"MIT"
] | null | null | null | scripts/estimate_Pn_bam.py | aakashsur/docker-hirise | 9b97cc4e7522e287aa2ee39c2993270e75b43a6d | [
"MIT"
] | null | null | null | scripts/estimate_Pn_bam.py | aakashsur/docker-hirise | 9b97cc4e7522e287aa2ee39c2993270e75b43a6d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2015 Dovetail Genomics LLC
#
#
from __future__ import division
from __future__ import print_function
from builtins import str
from builtins import range
from past.utils import old_div
import sys
import random
#import chicago_edge_scores as ces
import pysam
#from random import ran... | 28.461078 | 199 | 0.60425 |
5b32000cde9a573517f0b52c70ca7d1ace632960 | 9,388 | py | Python | contrib/testgen/gen_key_io_test_vectors.py | acejr1337/TerryDavisCoin | 72a5c737f68042fa8f73d2879c13b0c120deb4aa | [
"MIT"
] | null | null | null | contrib/testgen/gen_key_io_test_vectors.py | acejr1337/TerryDavisCoin | 72a5c737f68042fa8f73d2879c13b0c120deb4aa | [
"MIT"
] | 3 | 2021-09-25T19:03:51.000Z | 2021-09-27T20:27:25.000Z | contrib/testgen/gen_key_io_test_vectors.py | acejr1337/TerryDavisCoin | 72a5c737f68042fa8f73d2879c13b0c120deb4aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2012-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
PYTHONPATH=../../t... | 36.96063 | 133 | 0.618769 |
aa56b1194cd116a484410af68756f080d065c8dd | 1,123 | py | Python | setup_colab.py | AlbertoRosado1/desihigh | a9f9d78c0c7605a704ae8008633f7aa9f641f7e4 | [
"BSD-3-Clause"
] | null | null | null | setup_colab.py | AlbertoRosado1/desihigh | a9f9d78c0c7605a704ae8008633f7aa9f641f7e4 | [
"BSD-3-Clause"
] | null | null | null | setup_colab.py | AlbertoRosado1/desihigh | a9f9d78c0c7605a704ae8008633f7aa9f641f7e4 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import subprocess
drivepath='/content/drive/'
if 'COLAB_GPU' in os.environ:
from google.colab import drive
# 'Hmmm, seems you\'re not in colab :) Try again later.'
drive.mount(drivepath, force_remount=True)
mydrive = drivepath + '/MyDrive/'
os.chdir(mydrive)
... | 26.116279 | 179 | 0.62244 |
228042793da4d8d76a3a128cb8875f07da2f7fe4 | 833 | py | Python | launcher.py | zCFD/zCFD-driver | 4c7d217bdf0eb8563e2a357afd7393d5d86c3f22 | [
"BSD-3-Clause"
] | 1 | 2019-04-16T16:06:08.000Z | 2019-04-16T16:06:08.000Z | launcher.py | zCFD/zCFD-driver | 4c7d217bdf0eb8563e2a357afd7393d5d86c3f22 | [
"BSD-3-Clause"
] | null | null | null | launcher.py | zCFD/zCFD-driver | 4c7d217bdf0eb8563e2a357afd7393d5d86c3f22 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import os
from zcfd import zCFDSolver
def RequiredModuleCheck():
try:
"""import mpi4py
import snakemq
import numpy
import cgen
import jinja2
import codepy
import yaml
import json
import boto
import st... | 18.108696 | 52 | 0.597839 |
dad67ab8fc025c6ded0fc4ed765cdb20e9c1097d | 8,667 | py | Python | trio/_core/tests/test_io.py | monobot/trio | 0fc81827093ebb7eb524e1c14464bb0dfd8641e8 | [
"Apache-2.0",
"MIT"
] | null | null | null | trio/_core/tests/test_io.py | monobot/trio | 0fc81827093ebb7eb524e1c14464bb0dfd8641e8 | [
"Apache-2.0",
"MIT"
] | null | null | null | trio/_core/tests/test_io.py | monobot/trio | 0fc81827093ebb7eb524e1c14464bb0dfd8641e8 | [
"Apache-2.0",
"MIT"
] | null | null | null | import pytest
import socket as stdlib_socket
import select
import random
from ... import _core
from ...testing import wait_all_tasks_blocked, Sequencer, assert_checkpoints
# Cross-platform tests for IO handling
def fill_socket(sock):
try:
while True:
sock.send(b"x" * 65536)
except Block... | 28.509868 | 78 | 0.665628 |
f3031f3485bcad8ab140c7f3c014326177f50be7 | 1,012 | py | Python | stm32l4xx-hal/tools/check.py | Disasm/zissou | 20f7aa1ac517bf6b81fe618d90e7eb813ebc8ce8 | [
"Apache-2.0",
"MIT"
] | 7 | 2019-05-29T22:37:08.000Z | 2021-09-01T03:48:57.000Z | stm32l4xx-hal/tools/check.py | Disasm/zissou | 20f7aa1ac517bf6b81fe618d90e7eb813ebc8ce8 | [
"Apache-2.0",
"MIT"
] | 9 | 2019-05-30T23:07:23.000Z | 2021-06-25T15:20:38.000Z | stm32l4xx-hal/tools/check.py | Disasm/zissou | 20f7aa1ac517bf6b81fe618d90e7eb813ebc8ce8 | [
"Apache-2.0",
"MIT"
] | 1 | 2019-07-28T08:39:51.000Z | 2019-07-28T08:39:51.000Z | #! /usr/bin/env python3
import json
import subprocess
import sys
def run_inner(args):
print("Running `{}`...".format(" ".join(args)))
ret = subprocess.call(args) == 0
print("")
return ret
def run(mcu, cargo_cmd):
if mcu == "":
return run_inner(cargo_cmd)
else:
return run_inn... | 22 | 78 | 0.544466 |
c86094c5a85dd7d06c609c47ecfaa3ac2ae32955 | 3,416 | py | Python | tradingfeatures/apis/bitmex/funding.py | realiti4/bitfinexget | 6a64cf0cd1b7040fced33008ad3bbf5af034e3b9 | [
"MIT"
] | null | null | null | tradingfeatures/apis/bitmex/funding.py | realiti4/bitfinexget | 6a64cf0cd1b7040fced33008ad3bbf5af034e3b9 | [
"MIT"
] | null | null | null | tradingfeatures/apis/bitmex/funding.py | realiti4/bitfinexget | 6a64cf0cd1b7040fced33008ad3bbf5af034e3b9 | [
"MIT"
] | null | null | null | import time
import requests
import numpy as np
import pandas as pd
from tradingfeatures import apiBase
from tradingfeatures.apis.bitmex.base import bitmexBase
class bitmexFunding(bitmexBase):
def __init__(self):
super(bitmexFunding, self).__init__()
self.name = 'bitmex_fundings'
self.add... | 33.821782 | 108 | 0.591335 |
7f787162f667a0376176bedb46169ca899e13a8e | 64 | py | Python | code/abc088_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc088_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc088_a_02.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | N=int(input())
A=int(input())
print("Yes" if N%500<=A else "No") | 21.333333 | 34 | 0.609375 |
2c6e385321263d717c5c712c25930501c5649326 | 299 | py | Python | maskrcnn_benchmark/data/datasets/__init__.py | yenchenlin/maskrcnn-benchmark | d8f34136c719190770d1f2ecccdbe13c9a8ee025 | [
"MIT"
] | 1 | 2019-03-12T18:00:10.000Z | 2019-03-12T18:00:10.000Z | maskrcnn_benchmark/data/datasets/__init__.py | yenchenlin/maskrcnn-benchmark | d8f34136c719190770d1f2ecccdbe13c9a8ee025 | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/datasets/__init__.py | yenchenlin/maskrcnn-benchmark | d8f34136c719190770d1f2ecccdbe13c9a8ee025 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from .coco import COCODataset
from .voc import PascalVOCDataset
from .concat_dataset import ConcatDataset
from .omnipush import OmnipushDataset
__all__ = ["COCODataset", "ConcatDataset", "PascalVOCDataset", "OmnipushDataset"]
| 37.375 | 81 | 0.802676 |
936d9c590d6794d09f20a98c0f92f4daf762e3f3 | 91 | py | Python | src/geneticSonic/main.py | danilo94/GeneticSonic | 94b6e71eab522e2ced409543454d30f774fbf439 | [
"MIT"
] | 31 | 2018-11-30T14:30:27.000Z | 2021-12-18T01:21:01.000Z | src/geneticSonic/main.py | domsamuka/GeneticSonic | 23bdd24152c8ca460f965359651a8e0f0c9e64e6 | [
"MIT"
] | null | null | null | src/geneticSonic/main.py | domsamuka/GeneticSonic | 23bdd24152c8ca460f965359651a8e0f0c9e64e6 | [
"MIT"
] | 11 | 2018-11-30T21:43:41.000Z | 2021-11-23T00:01:07.000Z | from GerenciadorJogo import *
run = GerenciadorJogo("gens.exe")
run.iniciar() | 10.111111 | 34 | 0.659341 |
cb332e886d6cb819c4933585b32c6a42d0e7ae63 | 501 | py | Python | data/scripts/templates/object/tangible/ship/components/engine/shared_eng_incom_heavy_fusialthrust.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/ship/components/engine/shared_eng_incom_heavy_fusialthrust.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/ship/components/engine/shared_eng_incom_heavy_fusialthrust.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/engine/shared_eng_incom_heavy_fusialthrust.iff"
res... | 29.470588 | 99 | 0.752495 |
1cf0d5760ae95a1cc8430c8622e17f4e7cb0168c | 391 | py | Python | kolang.py | hillasen/kolang | c97401e067280c964994c838490de9de8db875f8 | [
"MIT"
] | 2 | 2020-11-22T08:42:06.000Z | 2020-11-26T23:19:08.000Z | kolang.py | hillasen/kolang | c97401e067280c964994c838490de9de8db875f8 | [
"MIT"
] | null | null | null | kolang.py | hillasen/kolang | c97401e067280c964994c838490de9de8db875f8 | [
"MIT"
] | null | null | null | from function import function_manager
from base import variable
from library import parser, builder
import sys
b_i = builder.Builder()
f = open(sys.argv[1], 'r')
code = f.read()
f.close()
compiled_code = b_i.startRun(parser.code_parser(code))
#print(compiled_code)
f = open(sys.argv[2], 'w')
f.write(compiled_cod... | 17 | 54 | 0.703325 |
dbb4961e4af06472d0fd6153fd9d56a52251c4dc | 2,648 | py | Python | engine_tests/crud_tests.py | etozhezhenechka/VadikDB | 6f5a80f2a525871375a64e40f212f23fb26a3eb4 | [
"Unlicense"
] | null | null | null | engine_tests/crud_tests.py | etozhezhenechka/VadikDB | 6f5a80f2a525871375a64e40f212f23fb26a3eb4 | [
"Unlicense"
] | null | null | null | engine_tests/crud_tests.py | etozhezhenechka/VadikDB | 6f5a80f2a525871375a64e40f212f23fb26a3eb4 | [
"Unlicense"
] | null | null | null | import engine.db_structure as db_py
import os
filename = "crud.vdb"
if os.path.isfile(filename):
os.remove(filename)
db = db_py.Database(False, filename)
def test_create():
excepted_table = db_py.Table()
excepted_table.name = "vadik_table"
excepted_table.fields = ["zhenya1", "zhenya2"]
excepted_... | 37.295775 | 91 | 0.628776 |
fa07a73d2b27ba1a23cfa56ca3e934c4aed885be | 1,482 | py | Python | gdsfactory/tests/test_containers.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | gdsfactory/tests/test_containers.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | gdsfactory/tests/test_containers.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | null | null | null | import pytest
from pytest_regressions.data_regression import DataRegressionFixture
from gdsfactory.components.mmi2x2 import mmi2x2
from gdsfactory.components.mzi_phase_shifter import mzi_phase_shifter_top_heater_metal
# from gdsfactory.components.spiral_inner_io import spiral_inner_io
from gdsfactory.containers impor... | 36.146341 | 87 | 0.795547 |
950b2e2d111a1ca1cc1963452cf3692613361c97 | 710 | py | Python | tools/distrib/python/grpcio_tools/grpc_version.py | annp1987/grpc | 0f7450b728980dae8e3ddb6c0a51be993d70859d | [
"Apache-2.0"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/distrib/python/grpcio_tools/grpc_version.py | annp1987/grpc | 0f7450b728980dae8e3ddb6c0a51be993d70859d | [
"Apache-2.0"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/distrib/python/grpcio_tools/grpc_version.py | annp1987/grpc | 0f7450b728980dae8e3ddb6c0a51be993d70859d | [
"Apache-2.0"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2015 gRPC authors.
#
# 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... | 39.444444 | 106 | 0.76338 |
339bb5064b1dc2a952be7f83e155b219b35b2875 | 7,183 | py | Python | src/dscompiler/compiler/parser.py | Aimini/hm-51 | 2d46323388a0679b2f99d1a33f5a0d55a5f838e6 | [
"MIT"
] | null | null | null | src/dscompiler/compiler/parser.py | Aimini/hm-51 | 2d46323388a0679b2f99d1a33f5a0d55a5f838e6 | [
"MIT"
] | 20 | 2020-01-13T04:19:37.000Z | 2020-02-12T14:25:44.000Z | src/dscompiler/compiler/parser.py | Aimini/hm-51 | 2d46323388a0679b2f99d1a33f5a0d55a5f838e6 | [
"MIT"
] | null | null | null | ##########################################
# 2019-12-22 12:44:23
# AI
# dtoken compiler, compile all dtoken in all lines to
# machine code
##########################################
import enum
import tokenize
import tokenize
import json
from compiler.compile_error import CompileError
from . import micro_control
cl... | 34.042654 | 124 | 0.54991 |
1323dc0091ae02347537899d1d00aeab6e8fd5a6 | 77,808 | py | Python | web3/contract.py | bhardwajRahul/web3.py | efecadcdea64f9481fcace558a8ea103462e2923 | [
"MIT"
] | null | null | null | web3/contract.py | bhardwajRahul/web3.py | efecadcdea64f9481fcace558a8ea103462e2923 | [
"MIT"
] | null | null | null | web3/contract.py | bhardwajRahul/web3.py | efecadcdea64f9481fcace558a8ea103462e2923 | [
"MIT"
] | null | null | null | """Interaction with smart contracts over Web3 connector.
"""
import copy
import itertools
from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
Collection,
Dict,
Generator,
Iterable,
List,
NoReturn,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
... | 34.6121 | 135 | 0.601455 |
a9c872d8a113d95079935c10ec1a760306b8e771 | 1,412 | py | Python | 1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/06_Nested-Loops/03-More-Exercises-08-Secred-Doors-lock.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | 1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/06_Nested-Loops/03-More-Exercises-08-Secred-Doors-lock.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | 1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/06_Nested-Loops/03-More-Exercises-08-Secred-Doors-lock.py | karolinanikolova/SoftUni-Software-Engineering | 7891924956598b11a1e30e2c220457c85c40f064 | [
"MIT"
] | null | null | null | # 8. Отключване на тайната врата
# В града има тайна врата, за която всички знаят, но никой не е успявал да я отключи и да види какво има зад нея.
# За да бъде отключена трябва да се въведе трицифрен код.
# Напишете програма, която генерира комбинации спрямо въведени числа – предположения от потребителя.
# От конзолата... | 56.48 | 113 | 0.736544 |
9dbae9455651d83d1f7e7476804d38c95eb81ea0 | 371 | py | Python | Task1E.py | NathanSeyoum/jm-nat- | 2f073a0c92e19b388a797d4878ceccba5f191484 | [
"MIT"
] | null | null | null | Task1E.py | NathanSeyoum/jm-nat- | 2f073a0c92e19b388a797d4878ceccba5f191484 | [
"MIT"
] | null | null | null | Task1E.py | NathanSeyoum/jm-nat- | 2f073a0c92e19b388a797d4878ceccba5f191484 | [
"MIT"
] | 1 | 2022-01-30T20:59:35.000Z | 2022-01-30T20:59:35.000Z |
from floodsystem.stationdata import build_station_list
from floodsystem.geo import rivers_by_station_number
def run():
"""Requirements for Task 1E"""
data = build_station_list()
rivStatDat = rivers_by_station_number(data, 9)
print(rivStatDat)
if __name__ == "__main__":
print("*** Task 1E... | 20.611111 | 63 | 0.703504 |
76064922b3520882d6e4e47d75126fed58edaced | 2,255 | py | Python | utils/utils.py | duyc168/hash_v2 | b0f16d399e2b69fe0b01218dc09c32cdb25eb848 | [
"MIT"
] | null | null | null | utils/utils.py | duyc168/hash_v2 | b0f16d399e2b69fe0b01218dc09c32cdb25eb848 | [
"MIT"
] | null | null | null | utils/utils.py | duyc168/hash_v2 | b0f16d399e2b69fe0b01218dc09c32cdb25eb848 | [
"MIT"
] | null | null | null |
import numpy as np
import torch
from tqdm import tqdm
def GenerateCode(model, data_loader, num_data, bit, batch_sz, n_class):
B = np.zeros([num_data, bit], dtype=np.float32)
all_labels = np.zeros([num_data, n_class], dtype=np.float32)
for i, data in enumerate(tqdm(data_loader)):
imgs, label, _, _... | 30.890411 | 87 | 0.566741 |
40a282b720d467e859dd1c26657dfc4456615034 | 1,667 | py | Python | 537/app.py | kaixiang1992/python-flask | 2b4c597d83f5a6ed662d42d7ff692e563a9adbf8 | [
"MIT"
] | null | null | null | 537/app.py | kaixiang1992/python-flask | 2b4c597d83f5a6ed662d42d7ff692e563a9adbf8 | [
"MIT"
] | null | null | null | 537/app.py | kaixiang1992/python-flask | 2b4c597d83f5a6ed662d42d7ff692e563a9adbf8 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
from flask_restful import Api, Resource, reqparse, inputs
from datetime import date
app = Flask(__name__)
api = Api(app)
class LoginView(Resource):
def post(self):
parse = reqparse.RequestParser()
# TODO: 1.default:默认值,如果这个参数没有值,那么将使用这个参数指定的值。
pars... | 37.044444 | 115 | 0.676665 |
4a7754613c76e891992bacf205122baa8d405319 | 1,008 | py | Python | logistics.py | yanyiju/bilingual-danmaku-synthesizer | 496136295f9c2da4041e3ebcc91583b24b155143 | [
"MIT"
] | 9 | 2021-02-18T05:52:50.000Z | 2022-01-08T08:27:17.000Z | logistics.py | yanyiju/bilingual-danmaku-synthesizer | 496136295f9c2da4041e3ebcc91583b24b155143 | [
"MIT"
] | 1 | 2021-04-04T01:22:10.000Z | 2021-04-10T21:44:21.000Z | logistics.py | yanyiju/bilingual-danmaku-synthesizer | 496136295f9c2da4041e3ebcc91583b24b155143 | [
"MIT"
] | 2 | 2021-10-16T11:00:22.000Z | 2022-03-21T16:47:06.000Z | # Helper functions
from moviepy_opt_patch import *
class colors:
"""Color used for printing."""
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def apply_patch():
"""Applies pa... | 24.585366 | 78 | 0.707341 |
7b8369509a81680e34cf834a6716cf2d620b99f7 | 1,560 | py | Python | udemy/colorized/colors.py | vquilon/udemy-dl | d8773553d5c644a36db97d82fa62dba4a422c3af | [
"MIT"
] | 4,740 | 2017-05-01T17:49:51.000Z | 2022-03-31T18:42:56.000Z | udemy/colorized/colors.py | vquilon/udemy-dl | d8773553d5c644a36db97d82fa62dba4a422c3af | [
"MIT"
] | 650 | 2017-05-03T04:38:31.000Z | 2021-08-01T10:50:56.000Z | udemy/colorized/colors.py | vquilon/udemy-dl | d8773553d5c644a36db97d82fa62dba4a422c3af | [
"MIT"
] | 1,355 | 2017-05-01T17:49:57.000Z | 2022-03-30T14:30:31.000Z | # pylint: disable=R,C,W,E
#!/usr/bin/python
"""
Author : Nasir Khan (r0ot h3x49)
Github : https://github.com/r0oth3x49
License : MIT
Copyright (c) 2018-2025 Nasir Khan (r0ot h3x49)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (th... | 33.191489 | 168 | 0.765385 |
bc1cc1aef0d8a64dfa6b96b77df37142c940928c | 484 | py | Python | app/core/migrations/0005_product_email.py | jaydhanani99/amazon-price-tracker | aece5a6147a84269684f52d4001b019f894aa654 | [
"MIT"
] | null | null | null | app/core/migrations/0005_product_email.py | jaydhanani99/amazon-price-tracker | aece5a6147a84269684f52d4001b019f894aa654 | [
"MIT"
] | null | null | null | app/core/migrations/0005_product_email.py | jaydhanani99/amazon-price-tracker | aece5a6147a84269684f52d4001b019f894aa654 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-02-16 17:06
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20210216_1452'),
]
operations = [
migrations.AddField(
model_name='product',
... | 23.047619 | 87 | 0.628099 |
cd006d6fd78224c26781b8ca25c6d2075370fccd | 898 | py | Python | wildfirepy/gis/map.py | Lashuk1729/wildfirepy | 085a1b90e64e4875aa6e9e7fc882902acff97775 | [
"MIT"
] | 21 | 2020-05-03T11:29:49.000Z | 2021-08-18T15:51:29.000Z | wildfirepy/gis/map.py | iamvpa/wildfirepy | 085a1b90e64e4875aa6e9e7fc882902acff97775 | [
"MIT"
] | 60 | 2020-05-01T22:35:09.000Z | 2020-12-07T08:48:59.000Z | wildfirepy/gis/map.py | iamvpa/wildfirepy | 085a1b90e64e4875aa6e9e7fc882902acff97775 | [
"MIT"
] | 24 | 2020-05-02T02:01:56.000Z | 2021-01-05T18:03:19.000Z | import h5py
from wildfirepy.gis.mapfactory import MapFactory
__all__ = ['Map']
class Map(MapFactory):
def __init__(self, data=None, **kwargs):
super().__init__(data, **kwargs)
if data is None and len(kwargs) == 0:
raise ValueError
self.data = self.load_data()
def _get_a... | 28.0625 | 120 | 0.66147 |
024d72104bd9b3c0c5a50490d54125f3c451a085 | 5,410 | py | Python | gram/views.py | SatishPatel8424/Instagram-django | c67728574da643f07167420731324b59817828be | [
"MIT"
] | null | null | null | gram/views.py | SatishPatel8424/Instagram-django | c67728574da643f07167420731324b59817828be | [
"MIT"
] | null | null | null | gram/views.py | SatishPatel8424/Instagram-django | c67728574da643f07167420731324b59817828be | [
"MIT"
] | null | null | null | from django.conf import settings
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.conf.urls import url,include
from django.contrib.auth import authenticate, login, logout
from .forms import PostForm
from django.conf.urls.static import static
from .models import Profile, Ima... | 47.876106 | 177 | 0.377819 |
d37bfa7a32dafe6ccd2d53990eb725ab6696d141 | 10,823 | py | Python | staplelib/commands.py | jonboulle/stapler | eae0de20cf41c780b63311ab3dfdeab4f9a065da | [
"BSD-3-Clause"
] | null | null | null | staplelib/commands.py | jonboulle/stapler | eae0de20cf41c780b63311ab3dfdeab4f9a065da | [
"BSD-3-Clause"
] | null | null | null | staplelib/commands.py | jonboulle/stapler | eae0de20cf41c780b63311ab3dfdeab4f9a065da | [
"BSD-3-Clause"
] | null | null | null | """Module containing the actual commands stapler understands."""
from __future__ import print_function
import math
import os
try:
from PyPDF2 import PdfFileWriter, PdfFileReader
except:
from pyPdf import PdfFileWriter, PdfFileReader
from . import CommandError, iohelper
import staplelib
def _write_output(outp... | 31.739003 | 106 | 0.574887 |
0c80b85478673b5fee389d24d4a6873017c94e14 | 4,616 | py | Python | pipeline/tests/engine/core/handlers/test_empty_end_event_handler.py | gangh/bk-sops | 29f4b4915be42650c2eeee637e0cf798e4066f09 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | pipeline/tests/engine/core/handlers/test_empty_end_event_handler.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | pipeline/tests/engine/core/handlers/test_empty_end_event_handler.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 45.70297 | 115 | 0.692591 |
736b71ee7fbc546ff9f0bf68776a7f1cf7a2c297 | 445 | py | Python | setup.py | j39m/naklo | 1241059d292f588951a3daf371f5208fc1cd96bc | [
"BSD-3-Clause"
] | null | null | null | setup.py | j39m/naklo | 1241059d292f588951a3daf371f5208fc1cd96bc | [
"BSD-3-Clause"
] | null | null | null | setup.py | j39m/naklo | 1241059d292f588951a3daf371f5208fc1cd96bc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
from setuptools import setup
from Cython.Build import cythonize
setup(
ext_modules=cythonize(
"libnaklo3/*.pyx",
annotate=True,
compiler_directives={
"language_level": "3",
"warn.undeclared": True,
"warn.maybe_uninitialized": True,
... | 22.25 | 45 | 0.557303 |
fe4541a31f00667efe53cf62bb604e71b91bbc09 | 660 | py | Python | cryptodoge/types/blockchain_format/sub_epoch_summary.py | grayfallstown-cryptodoge/cryptodoge | ffeb5218ce184a56073a5dc0ac5acddba3728bd4 | [
"Apache-2.0"
] | 10 | 2021-08-21T17:41:51.000Z | 2022-02-09T04:28:12.000Z | cryptodoge/types/blockchain_format/sub_epoch_summary.py | grayfallstown-cryptodoge/cryptodoge | ffeb5218ce184a56073a5dc0ac5acddba3728bd4 | [
"Apache-2.0"
] | 1 | 2021-12-15T21:23:38.000Z | 2021-12-15T21:23:38.000Z | cryptodoge/types/blockchain_format/sub_epoch_summary.py | grayfallstown-cryptodoge/cryptodoge | ffeb5218ce184a56073a5dc0ac5acddba3728bd4 | [
"Apache-2.0"
] | 2 | 2021-08-21T18:22:59.000Z | 2021-12-10T07:12:18.000Z | from dataclasses import dataclass
from typing import Optional
from cryptodoge.types.blockchain_format.sized_bytes import bytes32
from cryptodoge.util.ints import uint8, uint64
from cryptodoge.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class SubEpochSummary(Streamable):
prev... | 38.823529 | 81 | 0.8 |
1819cbcf43a3a03d3b643800f035de5b8aa0c60b | 9,639 | py | Python | apps/jobbrowser/src/jobbrowser/models.py | alanlyh/hue | ff82a9f1fe2d2b978784239a64f05fb5a0fdd3b4 | [
"Apache-2.0"
] | null | null | null | apps/jobbrowser/src/jobbrowser/models.py | alanlyh/hue | ff82a9f1fe2d2b978784239a64f05fb5a0fdd3b4 | [
"Apache-2.0"
] | null | null | null | apps/jobbrowser/src/jobbrowser/models.py | alanlyh/hue | ff82a9f1fe2d2b978784239a64f05fb5a0fdd3b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 42.84 | 139 | 0.744164 |
3174084dcaa3ea5478a355b85fe24f3961765994 | 2,063 | py | Python | cogs/admin.py | Soulsender/scarabbot | 0c92834c65579912643b95d8aa37b23a6cf08602 | [
"MIT"
] | 6 | 2021-06-15T01:26:46.000Z | 2022-01-21T06:04:04.000Z | cogs/admin.py | Soulsender/scarabbot | 0c92834c65579912643b95d8aa37b23a6cf08602 | [
"MIT"
] | 10 | 2021-06-15T20:35:52.000Z | 2022-02-07T03:04:43.000Z | cogs/admin.py | Soulsender/scarabbot | 0c92834c65579912643b95d8aa37b23a6cf08602 | [
"MIT"
] | 1 | 2021-07-12T09:25:53.000Z | 2021-07-12T09:25:53.000Z | from discord.ext import commands
import discord
class Admin(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Admin Online')
@commands.command()
async def adminhelp(self, ctx):
embed = discord.Embed(title="__Admin Menu__"... | 38.203704 | 467 | 0.700436 |
c8297c3964b51a0deed593a721d0e6c44039858b | 2,716 | py | Python | stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/error.py | wusirs/learn_python3_spider | a3301f8112e4ded25c3578162db8c6a263a0693b | [
"MIT"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/error.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 44 | 2019-05-27T10:59:29.000Z | 2022-03-31T14:14:29.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/error.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An error to represent bad things happening in Conch.
Maintainer: Paul Swartz
"""
from __future__ import absolute_import, division
from twisted.cred.error import UnauthorizedLogin
class ConchError(Exception):
def __init__(self, value, ... | 26.115385 | 79 | 0.709867 |
cead988e6e2e4df99baa5c2e289bb00b66d603e5 | 1,998 | py | Python | tests/unit/TestConfig.py | jbouter/salt-lint | b639099238d2ba7eebe84ba274253b9c577b4a56 | [
"MIT"
] | null | null | null | tests/unit/TestConfig.py | jbouter/salt-lint | b639099238d2ba7eebe84ba274253b9c577b4a56 | [
"MIT"
] | null | null | null | tests/unit/TestConfig.py | jbouter/salt-lint | b639099238d2ba7eebe84ba274253b9c577b4a56 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Warpnet B.V.
import unittest
import tempfile
from saltlint.config import Configuration
SALT_LINT_CONFIG = '''
---
exclude_paths:
- exclude_this_file
- exclude_this_directory/
- exclude/this/sub-directory/
skip_list:
- 207
- 208
tags:
- formatting
verbosity: 1... | 27 | 85 | 0.644645 |
5b5f206d8bbd4368ad63c112f16b0fe9c4192898 | 9,160 | py | Python | dvc/utils/__init__.py | vyloy/dvc | 60c89adeb5dcc293d8661d6aabeb1da6d05466f5 | [
"Apache-2.0"
] | 1 | 2019-04-16T19:51:03.000Z | 2019-04-16T19:51:03.000Z | dvc/utils/__init__.py | vyloy/dvc | 60c89adeb5dcc293d8661d6aabeb1da6d05466f5 | [
"Apache-2.0"
] | null | null | null | dvc/utils/__init__.py | vyloy/dvc | 60c89adeb5dcc293d8661d6aabeb1da6d05466f5 | [
"Apache-2.0"
] | null | null | null | """Helpers for other modules."""
from __future__ import unicode_literals
import yaml
from dvc.utils.compat import str, builtin_str, open, cast_bytes_py2
import os
import sys
import stat
import math
import json
import errno
import shutil
import hashlib
import nanotime
import time
import colorama
import re
import logg... | 24.426667 | 78 | 0.604913 |
fa785b5ca6952304a3f6e4011e616a83fc1c3ebe | 511 | py | Python | openprocurement/storage/s3/__init__.py | oleksiyVeretiuk/openprocurement.storage.s3 | 5046a3b7249c4b75a744d0110700081d2e1a95f5 | [
"Apache-2.0"
] | null | null | null | openprocurement/storage/s3/__init__.py | oleksiyVeretiuk/openprocurement.storage.s3 | 5046a3b7249c4b75a744d0110700081d2e1a95f5 | [
"Apache-2.0"
] | 3 | 2016-12-16T11:43:25.000Z | 2017-07-18T10:37:41.000Z | openprocurement/storage/s3/__init__.py | oleksiyVeretiuk/openprocurement.storage.s3 | 5046a3b7249c4b75a744d0110700081d2e1a95f5 | [
"Apache-2.0"
] | 6 | 2016-12-16T10:22:28.000Z | 2019-07-22T08:41:55.000Z | from boto.s3.connection import S3Connection
from openprocurement.storage.s3.storage import S3Storage
def includeme(config):
settings = config.registry.settings
if 's3.access_key' in settings and 's3.secret_key' in settings and 's3.bucket' in settings:
# S3 connection
connection = S3Connection(... | 36.5 | 95 | 0.7182 |
2627846edf2f255477931120e554c1ef6c321bba | 3,136 | py | Python | core/engine/validation_helper.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-07-09T20:02:48.000Z | 2021-11-21T20:00:37.000Z | core/engine/validation_helper.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | core/engine/validation_helper.py | M-Spencer-94/configNOW | 56828587253202089e77cfdfcf5329f2a7f09b3f | [
"PSF-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # ============================================================================
#
# Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd,
# All Rights Reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | 34.461538 | 104 | 0.661671 |
404344608dc5fc7e2da81e22bb19bf0bdac4a551 | 818 | py | Python | tests/integration/cloudformation/test_cloudformation_ec2.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | tests/integration/cloudformation/test_cloudformation_ec2.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | tests/integration/cloudformation/test_cloudformation_ec2.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | import os
def test_vpc_creates_default_sg(deploy_cfn_template, ec2_client):
"""tests GetAtt references to default security groups and network ACLs for VPCs"""
result = deploy_cfn_template(
template_path=os.path.join(
os.path.dirname(__file__), "../templates/ec2_vpc_default_sg.yaml"
... | 31.461538 | 98 | 0.718826 |
ded335a2186df43e1c0860563360ac5f5ee761ee | 5,188 | py | Python | src/api/bkuser_core/tests/categories/plugins/custom/test_client.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/tests/categories/plugins/custom/test_client.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/tests/categories/plugins/custom/test_client.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 36.794326 | 115 | 0.533924 |
bd1e619cfbb96266fa46f1316346525bc669138f | 3,325 | py | Python | chapter2/2_process_image_data/2_handling_image_data/2-2-04_fix_if_condition.py | jongfeel/EBS-AI | 8d879e4842cd969aa3165400f621860a72b1f1be | [
"MIT"
] | null | null | null | chapter2/2_process_image_data/2_handling_image_data/2-2-04_fix_if_condition.py | jongfeel/EBS-AI | 8d879e4842cd969aa3165400f621860a72b1f1be | [
"MIT"
] | null | null | null | chapter2/2_process_image_data/2_handling_image_data/2-2-04_fix_if_condition.py | jongfeel/EBS-AI | 8d879e4842cd969aa3165400f621860a72b1f1be | [
"MIT"
] | null | null | null | # 행렬의 합을 이용해서 두 이미지를 결합하기
# 외부 모듈 선언
import turtle
import numpy as np
pixelSize = 10
def putPixel(x, y, pSize, pCol): # 메인 소스 코드에서 호출하는 Pixel 채우기 함수
turtle.penup() # 좌표 이동을 위해 펜기능을 비활성화
turtle.goto(x*pSize,(-1)*y*pSize) # 주어진 좌표로 이동
turtle.pendown() # 펜기능을 ... | 49.626866 | 105 | 0.369323 |
bc2c09345e1cfa52ac8ed6867bce3cf0ba3586cc | 4,571 | py | Python | nbs/dl2/exp/nb_06.py | osamak/course-v3 | 68ee8a707bf612a9c3b98c33d3de5aa1ae73cd30 | [
"Apache-2.0"
] | 5,111 | 2018-10-11T19:56:14.000Z | 2022-03-31T20:19:03.000Z | nbs/dl2/exp/nb_06.py | osamak/course-v3 | 68ee8a707bf612a9c3b98c33d3de5aa1ae73cd30 | [
"Apache-2.0"
] | 404 | 2018-10-20T14:52:58.000Z | 2021-06-17T23:47:36.000Z | nbs/dl2/exp/nb_06.py | osamak/course-v3 | 68ee8a707bf612a9c3b98c33d3de5aa1ae73cd30 | [
"Apache-2.0"
] | 4,381 | 2018-10-13T01:29:19.000Z | 2022-03-20T17:18:02.000Z |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: dev_nb/06_cuda_cnn_hooks_init.ipynb
from exp.nb_05b import *
torch.set_num_threads(2)
def normalize_to(train, valid):
m,s = train.mean(),train.std(... | 33.859259 | 90 | 0.62634 |
0d58e33b1867142027ffd383bf252b415fa13ad7 | 83 | py | Python | app/api/__init__.py | JN513/eduapi | 65534e9630f9ada372e07df4f33fad15614e171a | [
"MIT"
] | 4 | 2021-04-14T01:27:00.000Z | 2021-04-16T12:59:26.000Z | Server/app/api/__init__.py | kazaamjt/HIMOS | df0e0c0d88e7d70b7fdfad00ed43a762ea0de1a7 | [
"MIT"
] | null | null | null | Server/app/api/__init__.py | kazaamjt/HIMOS | df0e0c0d88e7d70b7fdfad00ed43a762ea0de1a7 | [
"MIT"
] | 2 | 2021-09-16T12:08:49.000Z | 2021-11-06T00:06:24.000Z | from flask import Blueprint
api = Blueprint("api", __name__)
from . import views
| 13.833333 | 32 | 0.746988 |
f2aadd0946eae656c2f954f98401b568a373a486 | 1,958 | py | Python | setup.py | lambdaofgod/deeplearning_image_pixelwise | 7c0529d624339832de601efa00beca11177e254f | [
"Apache-2.0"
] | 1 | 2020-05-28T10:39:35.000Z | 2020-05-28T10:39:35.000Z | setup.py | lambdaofgod/deeplearning_image_pixelwise | 7c0529d624339832de601efa00beca11177e254f | [
"Apache-2.0"
] | 3 | 2020-11-13T18:55:03.000Z | 2021-09-28T02:37:56.000Z | setup.py | lambdaofgod/deeplearning_image_pixelwise | 7c0529d624339832de601efa00beca11177e254f | [
"Apache-2.0"
] | null | null | null | from pkg_resources import parse_version
from configparser import ConfigParser
import setuptools
assert parse_version(setuptools.__version__)>=parse_version('36.2')
# note: all settings are in settings.ini; edit there, not here
config = ConfigParser(delimiters=['='])
config.read('settings.ini')
cfg = config['DEFAULT']
... | 38.392157 | 102 | 0.668029 |
806c80aac49b6ae44fe05106e02d0d3338557e0e | 610 | py | Python | users/management/commands/replay_stuck_reviews.py | ujlbu4/vas3k.club | 1ec907cf7e5ae3a74059cde8729ca0b3e2d55a3e | [
"MIT"
] | 496 | 2020-04-24T04:20:32.000Z | 2022-03-31T21:55:57.000Z | users/management/commands/replay_stuck_reviews.py | ujlbu4/vas3k.club | 1ec907cf7e5ae3a74059cde8729ca0b3e2d55a3e | [
"MIT"
] | 642 | 2020-04-24T11:54:13.000Z | 2022-03-26T15:41:06.000Z | users/management/commands/replay_stuck_reviews.py | ujlbu4/vas3k.club | 1ec907cf7e5ae3a74059cde8729ca0b3e2d55a3e | [
"MIT"
] | 243 | 2020-04-24T11:49:11.000Z | 2022-03-24T18:38:48.000Z | import logging
from django.core.management import BaseCommand
from notifications.telegram.users import notify_profile_needs_review
from posts.models.post import Post
from users.models.user import User
log = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Fix broken or stuck review messages"
... | 26.521739 | 87 | 0.736066 |
7694e5c6ed6a38de42d6ca596720dcdfa55178be | 1,092 | py | Python | scanner/plugins/cms/qibocms/qibocms_s_fids_sqli.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 1,207 | 2018-01-31T06:36:34.000Z | 2022-03-31T07:35:35.000Z | scanner/plugins/cms/qibocms/qibocms_s_fids_sqli.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 21 | 2018-07-30T03:01:49.000Z | 2022-03-28T08:20:39.000Z | scanner/plugins/cms/qibocms/qibocms_s_fids_sqli.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 310 | 2018-02-22T01:23:20.000Z | 2022-03-28T08:51:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: qibocms s.php文件参数fids SQL注入
referer: http://www.wooyun.org/bugs/wooyun-2014-079938
author: Lucifer
description: 文件/coupon/s.php中,参数fids存在SQL注入。
'''
import sys
import requests
class qibocms_s_fids_sqli_BaseVerify:
def __init__(self, url):
self.url = ... | 31.2 | 148 | 0.644689 |
f13e6d8f739a3d281392745fea63f674e78a9928 | 206,479 | py | Python | pytorch/torch/testing/_internal/common_nn.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/testing/_internal/common_nn.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/testing/_internal/common_nn.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | import math
import sys
import tempfile
import unittest
from copy import deepcopy
from functools import reduce
from itertools import product
from operator import mul
from math import pi
import torch
import torch.cuda
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.functional import _Reduction
from... | 40.367351 | 124 | 0.58636 |
969c290df3dd48eef41848355a38511514e84ed9 | 121 | py | Python | pythonidbot/callback/__init__.py | hexatester/pythonidbot | 39964a340dca90dd64e3cd45d0513d5ae0be3986 | [
"MIT"
] | null | null | null | pythonidbot/callback/__init__.py | hexatester/pythonidbot | 39964a340dca90dd64e3cd45d0513d5ae0be3986 | [
"MIT"
] | null | null | null | pythonidbot/callback/__init__.py | hexatester/pythonidbot | 39964a340dca90dd64e3cd45d0513d5ae0be3986 | [
"MIT"
] | null | null | null | HANDLERS = []
def register_callbacks(dispatcher):
for handler in HANDLERS:
dispatcher.add_handler(handler)
| 17.285714 | 39 | 0.719008 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.