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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790c759b73c878a7b39473583ec0ffc5dfbb10f0 | 6,196 | py | Python | smock.py | serverboards/serverboards-plugin-google-drive | 2295df2c8c42d1667e80d00d2038aabd2fe15b62 | [
"Apache-2.0"
] | null | null | null | smock.py | serverboards/serverboards-plugin-google-drive | 2295df2c8c42d1667e80d00d2038aabd2fe15b62 | [
"Apache-2.0"
] | null | null | null | smock.py | serverboards/serverboards-plugin-google-drive | 2295df2c8c42d1667e80d00d2038aabd2fe15b62 | [
"Apache-2.0"
] | null | null | null | import json
import yaml
"""
SMock -- Serverboards Mock library -- Mock comfortably.
This library helps to mock function and method calls, getting the data
from an external yaml file.
"""
class MockWrapper:
"""
Wraps all the data returned by the mocked function to behave like a
dictionary, like an object... | 25.497942 | 102 | 0.576017 |
47bde0175ac9ab1abb8a0ed8418ea46db9801467 | 8,138 | py | Python | samples/ralph/main.py | el-dee/panda3d-openvr | 3f9567897552df6c10078bc124795101cf478f91 | [
"BSD-3-Clause"
] | 12 | 2020-06-23T08:31:14.000Z | 2022-02-26T00:44:53.000Z | samples/ralph/main.py | el-dee/panda3d-openvr | 3f9567897552df6c10078bc124795101cf478f91 | [
"BSD-3-Clause"
] | 17 | 2020-08-03T15:39:51.000Z | 2022-02-25T00:27:44.000Z | samples/ralph/main.py | el-dee/panda3d-openvr | 3f9567897552df6c10078bc124795101cf478f91 | [
"BSD-3-Clause"
] | 5 | 2020-08-12T15:17:36.000Z | 2022-02-09T16:02:31.000Z | #!/usr/bin/env python
from direct.showbase.ShowBase import ShowBase
from panda3d.core import CollisionTraverser, CollisionNode
from panda3d.core import CollisionHandlerQueue, CollisionRay
from panda3d.core import AmbientLight, DirectionalLight
from panda3d.core import TextNode
from panda3d.core import CollideMask, LV... | 45.211111 | 129 | 0.666871 |
a734822b3c78189875eb0fb3521259523d701602 | 180 | py | Python | kapre/__init__.py | MichaelisTrofficus/kapre | f25fdab1b8ea9e236e514aab19063cd114869f53 | [
"MIT"
] | null | null | null | kapre/__init__.py | MichaelisTrofficus/kapre | f25fdab1b8ea9e236e514aab19063cd114869f53 | [
"MIT"
] | null | null | null | kapre/__init__.py | MichaelisTrofficus/kapre | f25fdab1b8ea9e236e514aab19063cd114869f53 | [
"MIT"
] | null | null | null | __version__ = '0.3.6'
VERSION = __version__
from . import composed
from . import backend
from .signal import *
from .time_frequency import *
from .time_frequency_tflite import *
| 18 | 36 | 0.766667 |
1d4ce80b9d5cde5485674bd9df58c25118c8ace6 | 494 | py | Python | test/lib_common_test.py | yokoyama-flogics/ibp_monitor_2 | 1a7df55a524ff3a7908df330e7e02c9f27e24ae0 | [
"BSD-2-Clause"
] | 3 | 2017-11-23T13:29:47.000Z | 2021-01-08T09:28:35.000Z | test/lib_common_test.py | yokoyama-flogics/ibp_monitor_2 | 1a7df55a524ff3a7908df330e7e02c9f27e24ae0 | [
"BSD-2-Clause"
] | null | null | null | test/lib_common_test.py | yokoyama-flogics/ibp_monitor_2 | 1a7df55a524ff3a7908df330e7e02c9f27e24ae0 | [
"BSD-2-Clause"
] | 2 | 2018-02-15T08:11:24.000Z | 2021-01-08T09:28:43.000Z | import os
import sys
import unittest
# Set Python search path to the parent directory
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from lib.common import *
class TestLibCommon(unittest.TestCase):
def test_eprint1(self):
eprint('Hello')
self.assertEquals(sys.stderr.getvalue(), 'He... | 24.7 | 62 | 0.690283 |
b11f3d26915f9586dadc745775f903eb6cc2c249 | 5,471 | py | Python | recipes/arcus/all/conanfile.py | marsven/conan-center-index | d8bb4ad617cee02d8664e8341fa32cdf702e4284 | [
"MIT"
] | 1 | 2021-11-11T03:07:13.000Z | 2021-11-11T03:07:13.000Z | recipes/arcus/all/conanfile.py | marsven/conan-center-index | d8bb4ad617cee02d8664e8341fa32cdf702e4284 | [
"MIT"
] | 1 | 2022-03-09T06:33:41.000Z | 2022-03-09T06:33:41.000Z | recipes/arcus/all/conanfile.py | marsven/conan-center-index | d8bb4ad617cee02d8664e8341fa32cdf702e4284 | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake, tools
import os
import textwrap
required_conan_version = ">=1.43.0"
class ArcusConan(ConanFile):
name = "arcus"
description = "This library contains C++ code and Python3 bindings for " \
"creating a socket in a thread and using this socket to send " \
... | 38.801418 | 94 | 0.624383 |
c7999324166ffc44ab7a5cbf1f221d4bb5ecc8d7 | 32,730 | py | Python | src_data/lgbt_content_selection.py | marcmiquel/WDO | 7d8d8e912f8dbacb2cdc0f6fd5c26370b8310cbb | [
"MIT"
] | 3 | 2020-12-21T06:06:16.000Z | 2021-08-28T12:52:07.000Z | src_data/lgbt_content_selection.py | marcmiquel/WDO | 7d8d8e912f8dbacb2cdc0f6fd5c26370b8310cbb | [
"MIT"
] | 1 | 2021-01-27T19:33:20.000Z | 2021-01-27T19:33:20.000Z | src_data/lgbt_content_selection.py | marcmiquel/WDO | 7d8d8e912f8dbacb2cdc0f6fd5c26370b8310cbb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# script
import wikilanguages_utils
from wikilanguages_utils import *
# time
import time
import datetime
from dateutil import relativedelta
import calendar
# system
import os
import sys
import shutil
import re
import random
# databases
import MySQLdb as mdb, MySQLdb.cursors as mdb_cursors
impor... | 38.505882 | 308 | 0.635044 |
6bfee7c2ea5fc9925547aa9b4d43756e661701c0 | 1,257 | py | Python | tests/function/value/test_func_text.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 4 | 2021-04-20T09:06:26.000Z | 2021-11-20T20:31:28.000Z | tests/function/value/test_func_text.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 14 | 2021-01-19T19:23:16.000Z | 2021-04-28T14:31:03.000Z | tests/function/value/test_func_text.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 5 | 2021-08-24T11:57:21.000Z | 2022-03-17T04:39:04.000Z | # This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Unit tests for string helper functions."""
import pytest
from openclean.function.value.text import Al... | 24.647059 | 92 | 0.579952 |
2543ce86ca2b4201663cee41a5ca2c0b2280cfe8 | 291 | py | Python | Desafio 103.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 103.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | Desafio 103.py | MoomenEltelbany/PythonDesafios | aa2f44d3104cf3607f58dc42c2f8fc8023f128de | [
"MIT"
] | null | null | null | def ficha(nome='<Desconhecido>', gols=0):
print(f'O jogador {nome} fez {gols} gols(s) no campeonato.')
n = str(input(f'Nome do Jogador: '))
g = str(input(f'Número do gols: '))
if g.isnumeric():
g = int(g)
else:
g = 0
if n.strip() == '':
ficha(gols=g)
else:
ficha(n, g)
| 19.4 | 64 | 0.57732 |
ea0fbf1aaee14031e1605717382275c69dd2184b | 4,918 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711204043.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711204043.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711204043.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Closuers
Free variables and closures
Remember: Functions defined inside another function can access the outer (nonLocal) variables
"""
def outer():
x = 'python'
/ this x refers to the one in outer's scope', this nonlocal variable x is called a free varia... | 28.427746 | 132 | 0.539854 |
47367da86f30b44992f2612993e6f0d0d4d896a0 | 3,981 | py | Python | examples/sklearn_elasticnet_diabetes/osx/train_diabetes.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 10,351 | 2018-07-31T02:52:49.000Z | 2022-03-31T23:33:13.000Z | examples/sklearn_elasticnet_diabetes/osx/train_diabetes.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 3,733 | 2018-07-31T01:38:51.000Z | 2022-03-31T23:56:25.000Z | examples/sklearn_elasticnet_diabetes/osx/train_diabetes.py | PeterSulcs/mlflow | 14c48e7bb1ca6cd6a3c1b249a486cd98bd5e7051 | [
"Apache-2.0"
] | 2,596 | 2018-07-31T06:38:39.000Z | 2022-03-31T23:56:32.000Z | #
# train_diabetes.py
#
# MLflow model using ElasticNet (sklearn) and Plots ElasticNet Descent Paths
#
# Uses the sklearn Diabetes dataset to predict diabetes progression using ElasticNet
# The predicted "progression" column is a quantitative measure of disease progression one year after baseline
# http... | 32.365854 | 122 | 0.708114 |
615a492f27fadadb58a87a50f2682d8332afd795 | 1,652 | py | Python | aiotdlib/api/types/input_background.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 37 | 2021-05-04T10:41:41.000Z | 2022-03-30T13:48:05.000Z | aiotdlib/api/types/input_background.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 13 | 2021-07-17T19:54:51.000Z | 2022-02-26T06:50:00.000Z | aiotdlib/api/types/input_background.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 7 | 2021-09-22T21:27:11.000Z | 2022-02-20T02:33:19.000Z | # =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | 30.036364 | 182 | 0.559927 |
3fa92bcc8fb0602e3a0bdf715b9aa8d52d17b12c | 7,201 | py | Python | tm1637.py | dbreen/micropython-tm1637 | 446ed2c32baa5bd8ae4050b7bc72e1fe9398ddf7 | [
"MIT"
] | null | null | null | tm1637.py | dbreen/micropython-tm1637 | 446ed2c32baa5bd8ae4050b7bc72e1fe9398ddf7 | [
"MIT"
] | null | null | null | tm1637.py | dbreen/micropython-tm1637 | 446ed2c32baa5bd8ae4050b7bc72e1fe9398ddf7 | [
"MIT"
] | null | null | null | # CircuitPython TM1637 quad 7-segment LED display driver
# Ported from MicroPython version.
import digitalio
import time
TM1637_CMD1 = 64 # 0x40 data command
TM1637_CMD2 = 192 # 0xC0 address command
TM1637_CMD3 = 128 # 0x80 display control command
TM1637_DSP_ON = 8 # 0x08 display on
TM1637_DELAY = 10 # 10us delay b... | 33.493023 | 182 | 0.597 |
fbf03480252c6c3313112b4fa42b37356f0d9227 | 3,672 | py | Python | experiments/mainTrainOpt.py | AziziShekoofeh/TimeSeries_Classification | 8bd18688e3220392ffc85642f10a68aed0f7f429 | [
"Apache-2.0"
] | 14 | 2018-11-27T19:54:29.000Z | 2021-02-03T05:32:31.000Z | experiments/mainTrainOpt.py | AziziShekoofeh/TimeSeries_Classification | 8bd18688e3220392ffc85642f10a68aed0f7f429 | [
"Apache-2.0"
] | null | null | null | experiments/mainTrainOpt.py | AziziShekoofeh/TimeSeries_Classification | 8bd18688e3220392ffc85642f10a68aed0f7f429 | [
"Apache-2.0"
] | 4 | 2018-11-25T07:08:31.000Z | 2021-03-23T14:16:11.000Z | import sys
import time
import os
module_root = '..'
sys.path.append(module_root)
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from deepNetworks.model import RNNModel
from utils.data_loader import DataLoader
from deepNetworks.netArch import DeepNetArch1, DeepNetArch2, DeepNetArch3... | 47.688312 | 120 | 0.634532 |
f4d94f641f932cd8e3165b510dbeb5fc0efb20db | 2,533 | py | Python | src/memory.py | Pablok98/PyGB | afd846d8fb505ebeea2a16c97ac3771a4f1d4cac | [
"MIT"
] | null | null | null | src/memory.py | Pablok98/PyGB | afd846d8fb505ebeea2a16c97ac3771a4f1d4cac | [
"MIT"
] | null | null | null | src/memory.py | Pablok98/PyGB | afd846d8fb505ebeea2a16c97ac3771a4f1d4cac | [
"MIT"
] | null | null | null | from cartridge import CartridgeMBC1
from config import ROM_PATH
class Memory:
def __init__(self):
self.wram = bytearray(8192)
self.vram = bytearray(8192)
# TODO: implement all MBCs, for now, we force MBC1.
self.cartridge = CartridgeMBC1()
self.io_registers = bytearray(128)
... | 35.676056 | 70 | 0.568101 |
ab31dfff6fdcc85259d346512d8c08072ea0824a | 3,423 | py | Python | accenv/lib/python3.4/site-packages/IPython/lib/tests/test_pretty.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | accenv/lib/python3.4/site-packages/IPython/lib/tests/test_pretty.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | accenv/lib/python3.4/site-packages/IPython/lib/tests/test_pretty.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | """Tests for IPython.lib.pretty.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2011, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#---------... | 28.289256 | 86 | 0.530237 |
ff1546d0ade6777c5499ba460f053958967171a0 | 3,613 | py | Python | main.py | scw2tt/traffic-lights | 725ee552e7399f4f7bd42322861bc09c8258a17e | [
"MIT"
] | 1 | 2020-01-16T07:36:28.000Z | 2020-01-16T07:36:28.000Z | main.py | scw2tt/traffic-lights | 725ee552e7399f4f7bd42322861bc09c8258a17e | [
"MIT"
] | null | null | null | main.py | scw2tt/traffic-lights | 725ee552e7399f4f7bd42322861bc09c8258a17e | [
"MIT"
] | null | null | null | import torch
from PIL import Image
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.patches as patches
import torchvision.transforms as transforms
from model import SSD300, ResNet, Loss
from train import train_loop, tencent_trick
from PIL import ImageMath
import cv2
#Sources : https://github.c... | 28.448819 | 143 | 0.716025 |
211da5edfabbe20ed98b5924a0ec677e4938534f | 648 | py | Python | drf_demos/drf_demos/api/models.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | 2 | 2022-03-06T11:56:35.000Z | 2022-03-20T09:31:45.000Z | drf_demos/drf_demos/api/models.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | null | null | null | drf_demos/drf_demos/api/models.py | Minkov/python-web-framework-demos- | 30f39de0b4344e1b7e5d4cf96f6d6bbbfe867305 | [
"MIT"
] | 4 | 2022-03-17T18:05:19.000Z | 2022-03-22T16:38:11.000Z | from django.db import models
from django.core import validators
class Category(models.Model):
NAME_MAX_LENGTH = 15
name = models.CharField(
max_length=NAME_MAX_LENGTH,
)
description = models.TextField(
null=True,
blank=True,
)
class Product(models.Model):
NAME_MAX_LEN... | 19.636364 | 58 | 0.634259 |
f9cfa81014dc43bda997450985cd643d07e86c3b | 38,042 | py | Python | py/dynesty/sampling.py | mcurliss/dynesty | 84ba36f3a698c267fdebccaecead8c83953a0533 | [
"MIT"
] | null | null | null | py/dynesty/sampling.py | mcurliss/dynesty | 84ba36f3a698c267fdebccaecead8c83953a0533 | [
"MIT"
] | null | null | null | py/dynesty/sampling.py | mcurliss/dynesty | 84ba36f3a698c267fdebccaecead8c83953a0533 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functions for proposing new live points used by
:class:`~dynesty.sampler.Sampler` (and its children from
:mod:`~dynesty.nestedsamplers`) and
:class:`~dynesty.dynamicsampler.DynamicSampler`.
"""
import warnings
import math
import numpy as np
from numpy import linalg
f... | 35.387907 | 79 | 0.529441 |
95fa2cf31652bc5504db781c43d31a4e125fced9 | 954 | py | Python | lhcb/cmtuser/DaVinci_v36r5/Phys/DiLeptonTuple/python/DiLeptonTuple/configIso.py | ibab/lhcb-b2dmumu | c1334c381032af9459602640e17541377fd16606 | [
"MIT"
] | 3 | 2019-06-24T10:56:34.000Z | 2019-06-24T10:57:11.000Z | lhcb/cmtuser/DaVinci_v36r5/Phys/DiLeptonTuple/python/DiLeptonTuple/configIso.py | ibab/lhcb-b2dmumu | c1334c381032af9459602640e17541377fd16606 | [
"MIT"
] | null | null | null | lhcb/cmtuser/DaVinci_v36r5/Phys/DiLeptonTuple/python/DiLeptonTuple/configIso.py | ibab/lhcb-b2dmumu | c1334c381032af9459602640e17541377fd16606 | [
"MIT"
] | null | null | null | # lines from Greg Ciezarek -
# this is work in progress
#will be comitted to SVN properly at a future date as of 3/4/14
# this needs to go before the tuple tool is run
def configIso():
from Configurables import ChargedProtoParticleMaker, DaVinci
veloprotos = ChargedProtoParticleMaker("ProtoPMaker")
velopr... | 47.7 | 102 | 0.742138 |
9d9654eba1ba7459c7bac405c5ce4556a782afd0 | 1,607 | py | Python | 2020/test/test_day7.py | terezaif/adventofcode | 67601f79a3b01d71434ef0236387ffd5ab7dca0f | [
"MIT"
] | 4 | 2020-12-06T13:11:59.000Z | 2021-12-15T11:34:34.000Z | 2020/test/test_day7.py | terezaif/adventofcode | 67601f79a3b01d71434ef0236387ffd5ab7dca0f | [
"MIT"
] | null | null | null | 2020/test/test_day7.py | terezaif/adventofcode | 67601f79a3b01d71434ef0236387ffd5ab7dca0f | [
"MIT"
] | 1 | 2021-12-02T16:32:50.000Z | 2021-12-02T16:32:50.000Z | import pytest
from days.day7 import get_bags
from days.day7 import get_bags_2
from utils.reading_data import get_string_input_array
input = [
"light red bags contain 1 bright white bag, 2 muted yellow bags.",
"dark orange bags contain 3 bright white bags, 4 muted yellow bags.",
"bright white bags contain 1... | 30.903846 | 73 | 0.702551 |
c79206492753a2253e4048164f44e9414f91f064 | 9,091 | py | Python | tests/test_formats.py | robocorp/jupytext | 57c011db9055242bb59ca9dd1ee5ca4f7fab752b | [
"MIT"
] | 1 | 2021-12-27T16:26:14.000Z | 2021-12-27T16:26:14.000Z | tests/test_formats.py | huangyingw/mwouts_jupytext | b72d03f39920333eb312d675a1ecd0fa7c2b549f | [
"MIT"
] | null | null | null | tests/test_formats.py | huangyingw/mwouts_jupytext | b72d03f39920333eb312d675a1ecd0fa7c2b549f | [
"MIT"
] | null | null | null | import pytest
from jupytext.compare import compare
from nbformat.v4.nbbase import new_notebook
import jupytext
from jupytext.formats import (
guess_format,
divine_format,
read_format_from_metadata,
rearrange_jupytext_metadata,
)
from jupytext.formats import (
long_form_multiple_formats,
short_fo... | 25.536517 | 84 | 0.613794 |
6dc8679ab98ab3f1584e4707fb35d1ab785f258a | 5,751 | py | Python | GhostScan/Reconstructions/Mesh.py | yyf20001230/GhostScan | 5694df4532132be5e916bd72a46dc907eb108bf9 | [
"MIT"
] | 4 | 2021-09-27T14:16:08.000Z | 2022-03-17T07:03:18.000Z | GhostScan/Reconstructions/Mesh.py | clkimsdu/GhostScan | 5694df4532132be5e916bd72a46dc907eb108bf9 | [
"MIT"
] | null | null | null | GhostScan/Reconstructions/Mesh.py | clkimsdu/GhostScan | 5694df4532132be5e916bd72a46dc907eb108bf9 | [
"MIT"
] | 2 | 2022-02-04T17:32:04.000Z | 2022-03-31T09:53:20.000Z | from __future__ import print_function
import os, sys, glob
import numpy as np
import cv2
import scipy.spatial
import matplotlib
import wavepy
import matplotlib.pyplot as plt
# import pyvista as pv
# import plotly.graph_objects as go
# Set Parameters
DEFLECTOMETRY_GRADMAP_FILTERSIZE = 49
# Render parameters
MESH_Ka = ... | 39.9375 | 118 | 0.557294 |
c09f41c3f17c47d5e2ecf9641b49ba08495d5902 | 2,919 | py | Python | python/smap/checkers.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 21 | 2015-02-06T21:55:59.000Z | 2021-04-29T11:23:18.000Z | python/smap/checkers.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 9 | 2015-02-03T10:41:35.000Z | 2020-02-18T12:46:10.000Z | python/smap/checkers.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 20 | 2015-02-06T00:09:19.000Z | 2020-01-10T13:27:06.000Z | """
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this l... | 39.445946 | 80 | 0.74272 |
7ab2896112aaadabe020a170b9d269464c1a5afc | 5,617 | py | Python | CrossPlan/settings.py | YuzuRyo61/CrossPlan | 7bdc9b688885cd2bcce8bdc1f4d65b225beeb122 | [
"MIT"
] | 8 | 2020-01-22T07:44:59.000Z | 2020-05-17T18:32:06.000Z | CrossPlan/settings.py | YuzuRyo61/CrossPlan | 7bdc9b688885cd2bcce8bdc1f4d65b225beeb122 | [
"MIT"
] | 4 | 2021-03-19T08:17:48.000Z | 2021-06-10T19:53:08.000Z | CrossPlan/settings.py | YuzuRyo61/CrossPlan | 7bdc9b688885cd2bcce8bdc1f4d65b225beeb122 | [
"MIT"
] | null | null | null | """
Django settings for CrossPlan project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 26.620853 | 126 | 0.682215 |
0390268a3ecabf2d51d156e655958f0de0b87ead | 3,223 | py | Python | isi_sdk_7_2/isi_sdk_7_2/models/compatibilities_ssd_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_7_2/isi_sdk_7_2/models/compatibilities_ssd_active.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_7_2/isi_sdk_7_2/models/compatibilities_ssd_active.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: 2
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_7_2.models.compatibi... | 28.026087 | 123 | 0.587341 |
681779806d72b020dd41a28020f911b6eec0648a | 319 | py | Python | exercises/pt/exc_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/pt/exc_02_05_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("pt")
# Importe a classe Doc
from ____ import ____
# Texto desejado: "Oh, realmente?!"
words = [____, ____, ____, ____, ____]
spaces = [____, ____, ____, ____, ____]
# Crie um Doc a partir das palavras words e espaçamento spaces
doc = ____(____, ____=____, ____=____)
print(doc.text)
| 21.266667 | 62 | 0.705329 |
abe44e5583c504d4acdfdda832c07597957e1c3d | 2,648 | py | Python | plot/ART/point/height_url_art.py | XinYao1994/HOPE | 99b41b457b67d3e5d6dd182f8aa2ce4ea66e4a68 | [
"Apache-2.0"
] | 108 | 2020-04-23T19:06:51.000Z | 2022-02-23T20:05:09.000Z | plot/ART/point/height_url_art.py | XinYao1994/HOPE | 99b41b457b67d3e5d6dd182f8aa2ce4ea66e4a68 | [
"Apache-2.0"
] | 1 | 2021-07-07T05:58:57.000Z | 2021-07-07T05:58:57.000Z | plot/ART/point/height_url_art.py | XinYao1994/HOPE | 99b41b457b67d3e5d6dd182f8aa2ce4ea66e4a68 | [
"Apache-2.0"
] | 11 | 2020-04-24T01:53:50.000Z | 2022-01-21T07:36:14.000Z | import sys
import os
sys.path.append(os.path.abspath('./plot/'))
from option import *
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plot
import matplotlib.ticker as ticker
import numpy as np
import csv
def autolabel(rects):
for rect in rects:
height = rect.get_height()
ax.text... | 30.790698 | 152 | 0.614804 |
0e61909910bec4da938c30cad80653f49eb97586 | 97 | py | Python | flash/core/serve/dag/utils_test.py | Actis92/lightning-flash | 49972268cfc0f95f1bd2b8fbf25036970cc44b59 | [
"Apache-2.0"
] | 1,457 | 2021-01-28T20:40:16.000Z | 2022-03-31T06:22:05.000Z | flash/core/serve/dag/utils_test.py | Actis92/lightning-flash | 49972268cfc0f95f1bd2b8fbf25036970cc44b59 | [
"Apache-2.0"
] | 1,123 | 2021-01-28T20:37:56.000Z | 2022-03-31T19:34:44.000Z | flash/core/serve/dag/utils_test.py | Actis92/lightning-flash | 49972268cfc0f95f1bd2b8fbf25036970cc44b59 | [
"Apache-2.0"
] | 170 | 2021-01-29T00:41:39.000Z | 2022-03-29T16:09:52.000Z | def inc(x):
return x + 1
def add(x, y):
return x + y
def mul(x, y):
return x * y
| 8.818182 | 16 | 0.484536 |
de256e518c463051029f6d58a76daa3c10de7179 | 14,731 | py | Python | main-back.py | p-sk/AlexaMeetingRoomBooking | 42c9cefa6cc085c51312fb9e1bcc66ea2e73fe23 | [
"MIT"
] | null | null | null | main-back.py | p-sk/AlexaMeetingRoomBooking | 42c9cefa6cc085c51312fb9e1bcc66ea2e73fe23 | [
"MIT"
] | null | null | null | main-back.py | p-sk/AlexaMeetingRoomBooking | 42c9cefa6cc085c51312fb9e1bcc66ea2e73fe23 | [
"MIT"
] | null | null | null | import json
import datetime
import isodate
import boto3
# Create clients
sns = boto3.client('sns')
dynamodb = boto3.resource('dynamodb', region_name='eu-west-1')
roomTable = dynamodb.Table('myrecords')
# Check if is there any booking fot that day
def isTimeAvailable(_order):
bookingData = roomTable.scan()["Ite... | 39.387701 | 163 | 0.388908 |
5368f3dc9a1620c617284f05ce8a5bd699fc49e6 | 1,382 | py | Python | Notes_20-29/KnoxFlaskAPI.py | joseeden/notes-cbt-nuggets-devasc | 7e1b3e08be50de6b4c58ca77944d93c81f0db8ab | [
"MIT"
] | 1 | 2021-01-18T08:13:16.000Z | 2021-01-18T08:13:16.000Z | Notes_20-29/KnoxFlaskAPI.py | joseeden/cbt-nuggets-devasc-notes | 7e1b3e08be50de6b4c58ca77944d93c81f0db8ab | [
"MIT"
] | null | null | null | Notes_20-29/KnoxFlaskAPI.py | joseeden/cbt-nuggets-devasc-notes | 7e1b3e08be50de6b4c58ca77944d93c81f0db8ab | [
"MIT"
] | 1 | 2021-05-27T01:55:49.000Z | 2021-05-27T01:55:49.000Z |
#**********************************************************************************************************************#
# KnoxFlaskAPI.py
#**********************************************************************************************************************#
# 2021-01-15 17:44:10
# EDEN:
# This is the code for th... | 38.388889 | 120 | 0.424023 |
cb85694377ee4258b274e313364c30514f76d993 | 2,427 | py | Python | samples/sunrgbd/sun_config.py | Yannick947/Mask_RCNN | 19cb2a26003870f80fac3feae834b82725530557 | [
"MIT"
] | 3 | 2021-03-19T22:10:25.000Z | 2022-02-27T20:41:43.000Z | samples/sunrgbd/sun_config.py | Yannick947/Mask_RCNN | 19cb2a26003870f80fac3feae834b82725530557 | [
"MIT"
] | null | null | null | samples/sunrgbd/sun_config.py | Yannick947/Mask_RCNN | 19cb2a26003870f80fac3feae834b82725530557 | [
"MIT"
] | null | null | null | import sys
import os
import numpy as np
from mrcnn.config import Config
ANNOTATION_FILENAME = 'via_regions_sunrgbd.json'
# removed 'tool', put 'wardrobe' and 'desk' to COMBINED_CLASSES
CLASSES = ['bed', 'chair', 'table', 'sofa', 'bookcase']
COMBINED_CLASSES = {'desk': 'table'}
IGNORE_IMAGES_PATH = os.path.abspath... | 27.896552 | 98 | 0.677379 |
703cda44669aa8b8dba47e4158d637e99434680a | 4,281 | py | Python | Extra/image_classification.py | seunboy1/Coursera-TensorFlow-Developer-Course | 0f0b2b2637c561293e7f7fef5acaaac5e12c1ca2 | [
"MIT"
] | 3 | 2021-07-04T18:49:10.000Z | 2021-08-15T13:54:30.000Z | Extra/image_classification.py | seunboy1/Coursera-TensorFlow-Developer-Course | 0f0b2b2637c561293e7f7fef5acaaac5e12c1ca2 | [
"MIT"
] | null | null | null | Extra/image_classification.py | seunboy1/Coursera-TensorFlow-Developer-Course | 0f0b2b2637c561293e7f7fef5acaaac5e12c1ca2 | [
"MIT"
] | null | null | null | import os
import PIL
import random
import pathlib
import shutil
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import RMSprop
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.layers import Conv2D, Dense,... | 33.708661 | 107 | 0.658958 |
94b50ecd6575e8d6513fb444bff3fa9f26a114b9 | 7,787 | py | Python | netket/operator/_local_cost_functions.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 352 | 2018-04-24T16:45:10.000Z | 2022-03-31T01:15:34.000Z | netket/operator/_local_cost_functions.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 947 | 2018-04-24T20:16:17.000Z | 2022-03-31T17:33:52.000Z | netket/operator/_local_cost_functions.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | 148 | 2018-04-25T02:44:20.000Z | 2022-03-11T11:42:34.000Z | # Copyright 2021 The NetKet 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 applicable ... | 36.38785 | 88 | 0.720046 |
81934394389f6681c577293790ba2b078d8aee8d | 652 | py | Python | myspiders/spider_console_news.py | zhouhongf/spider_news | 6ea4a80d050bf3ab70724f45312c5a2580e714a6 | [
"MIT"
] | 2 | 2021-11-27T06:40:44.000Z | 2022-02-23T11:19:11.000Z | myspiders/spider_console_news.py | zhouhongf/spider_news | 6ea4a80d050bf3ab70724f45312c5a2580e714a6 | [
"MIT"
] | null | null | null | myspiders/spider_console_news.py | zhouhongf/spider_news | 6ea4a80d050bf3ab70724f45312c5a2580e714a6 | [
"MIT"
] | 1 | 2021-12-15T09:11:16.000Z | 2021-12-15T09:11:16.000Z | import os
import sys
from config import Config
from importlib import import_module
# sys.path.append('../')
def file_name(file_dir=os.path.join(Config.BASE_DIR, 'myspiders/spider_news')):
all_files = []
for file in os.listdir(file_dir):
if file.endswith('_spider.py'):
all_file... | 24.148148 | 81 | 0.653374 |
fff327fc597ba0f45d4433491111ed4e79dba68f | 2,466 | py | Python | tutorials/TutorialCollection.py | lmidolo/samplemaker | 8211af0e4cea60aea8f5720d5ff0ee532c442123 | [
"BSD-3-Clause"
] | null | null | null | tutorials/TutorialCollection.py | lmidolo/samplemaker | 8211af0e4cea60aea8f5720d5ff0ee532c442123 | [
"BSD-3-Clause"
] | null | null | null | tutorials/TutorialCollection.py | lmidolo/samplemaker | 8211af0e4cea60aea8f5720d5ff0ee532c442123 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tutorial device collection
"""
# This is how you create a collection of devices, just add all the classes in this file
# Check the end of this file, we run a command to make samplemaker aware of our devices
import samplemaker.makers as sm # used for drawing
from samplemaker.devices import... | 44.035714 | 111 | 0.667478 |
912b9776a346a913c787ac26d80eff8862a03130 | 6,974 | py | Python | triplet.py | leonardbereska/master | a654b3d9d4520fa3141a4595ee5ee0f9c2cfd4fe | [
"MIT"
] | null | null | null | triplet.py | leonardbereska/master | a654b3d9d4520fa3141a4595ee5ee0f9c2cfd4fe | [
"MIT"
] | null | null | null | triplet.py | leonardbereska/master | a654b3d9d4520fa3141a4595ee5ee0f9c2cfd4fe | [
"MIT"
] | null | null | null | import torch.optim as optim
import torchvision
import torch
from torch.autograd import Variable
import numpy as np
from torch.nn import functional as F
import dataset
import helpers
import models
from config import *
# assert(file_name == 'triplet' or file_name == 'bigbottle' or file_name == 'tripletpro')
writer, save... | 44.139241 | 122 | 0.567823 |
7fb5159a71f489f9c8b111d516a335c971bc5133 | 4,036 | py | Python | eval_scripts/ppi_eval.py | SherylHYX/GraphSAGE | 4d54c8165605502e4e358cfc6c5efbeddcc62221 | [
"MIT"
] | null | null | null | eval_scripts/ppi_eval.py | SherylHYX/GraphSAGE | 4d54c8165605502e4e358cfc6c5efbeddcc62221 | [
"MIT"
] | null | null | null | eval_scripts/ppi_eval.py | SherylHYX/GraphSAGE | 4d54c8165605502e4e358cfc6c5efbeddcc62221 | [
"MIT"
] | null | null | null | from __future__ import print_function
import json
import numpy as np
from networkx.readwrite import json_graph
from argparse import ArgumentParser
''' To evaluate the embeddings, we run a logistic regression.
Run this script after running unsupervised training.
Baseline of using features-only can be run by setting da... | 44.844444 | 134 | 0.67889 |
0f36e9edf37e4e750c6b66bd9230a955d79966bb | 194 | py | Python | setup.py | edurenye/yolov3-tf2 | 08bfbe6111ffbbd0ba93bc3a3165c921ac9f4897 | [
"MIT"
] | null | null | null | setup.py | edurenye/yolov3-tf2 | 08bfbe6111ffbbd0ba93bc3a3165c921ac9f4897 | [
"MIT"
] | null | null | null | setup.py | edurenye/yolov3-tf2 | 08bfbe6111ffbbd0ba93bc3a3165c921ac9f4897 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='yolov3_tf2',
version='0.1',
url='https://github.com/zzh8829/yolov3-tf2',
author='Zihao Zhang',
author_email='zzh8829@gmail.com') | 27.714286 | 50 | 0.664948 |
2cb96f3610bbe07ed0c4cb7f1ba74c65da2131a1 | 27,804 | py | Python | barbante/recommendation/tests/fixtures/HybridRecommenderFixture.py | hypermindr/barbante | 40056e9e4f4564461294b3a1d9afc855062350ac | [
"MIT"
] | 10 | 2015-06-01T21:48:16.000Z | 2021-08-20T20:18:48.000Z | barbante/recommendation/tests/fixtures/HybridRecommenderFixture.py | hypermindr/barbante | 40056e9e4f4564461294b3a1d9afc855062350ac | [
"MIT"
] | null | null | null | barbante/recommendation/tests/fixtures/HybridRecommenderFixture.py | hypermindr/barbante | 40056e9e4f4564461294b3a1d9afc855062350ac | [
"MIT"
] | 2 | 2015-06-03T21:54:32.000Z | 2015-11-24T23:13:05.000Z | """ Test fixture for hybrid recommendations.
"""
import datetime as dt
import nose.tools
import barbante.context as ctx
import barbante.maintenance.product_templates as pt
import barbante.maintenance.product_templates_tfidf as pt_tfidf
import barbante.maintenance.user_templates as ut
from barbante.recommendation.test... | 48.864675 | 118 | 0.606675 |
4b3e9db303ca8e09b220ed76840263b3f827b439 | 13,291 | py | Python | imodels/rule_list/bayesian_rule_list/bayesian_rule_list.py | teakfi/imodels | 0144698c5c9b919b2640cb8e2caac3a9124a2a0e | [
"MIT"
] | 598 | 2020-09-15T19:46:27.000Z | 2022-03-31T21:05:30.000Z | imodels/rule_list/bayesian_rule_list/bayesian_rule_list.py | teakfi/imodels | 0144698c5c9b919b2640cb8e2caac3a9124a2a0e | [
"MIT"
] | 52 | 2020-09-28T12:15:03.000Z | 2022-03-22T16:43:51.000Z | imodels/rule_list/bayesian_rule_list/bayesian_rule_list.py | teakfi/imodels | 0144698c5c9b919b2640cb8e2caac3a9124a2a0e | [
"MIT"
] | 60 | 2020-09-16T21:42:28.000Z | 2022-03-31T14:08:29.000Z | import numpy as np
import pandas as pd
import random
from collections import Counter, defaultdict
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.multiclass import check_classification_targets, unique_labels
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from im... | 41.927445 | 119 | 0.57648 |
8b4f1c0ca3e311131cfe461d08de494f126f0110 | 11,392 | py | Python | sahara/service/heat/templates.py | redhat-openstack/sahara | 67165c96eceb1ce3b087870934d394602f5dd959 | [
"Apache-2.0"
] | null | null | null | sahara/service/heat/templates.py | redhat-openstack/sahara | 67165c96eceb1ce3b087870934d394602f5dd959 | [
"Apache-2.0"
] | null | null | null | sahara/service/heat/templates.py | redhat-openstack/sahara | 67165c96eceb1ce3b087870934d394602f5dd959 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Mirantis 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 writ... | 33.02029 | 78 | 0.593838 |
eb3ff1b92d8d3404b22945f3bfb081cc5b00da01 | 257 | py | Python | features/signals.py | KDD-OpenSource/fexum | 2288a4be2fcbd5bed0e2549204f313bca50d3265 | [
"MIT"
] | 6 | 2017-05-15T16:07:15.000Z | 2020-05-18T10:04:38.000Z | features/signals.py | KDD-OpenSource/fexum | 2288a4be2fcbd5bed0e2549204f313bca50d3265 | [
"MIT"
] | 34 | 2017-05-11T13:45:03.000Z | 2017-07-29T19:18:45.000Z | features/signals.py | KDD-OpenSource/fexum | 2288a4be2fcbd5bed0e2549204f313bca50d3265 | [
"MIT"
] | null | null | null | from django.db.models.signals import post_delete
from django.dispatch.dispatcher import receiver
from features.models import Dataset
@receiver(post_delete, sender=Dataset)
def dataset_delete(sender, instance, **kwargs):
instance.content.delete(False)
| 28.555556 | 48 | 0.817121 |
1bcc93ae0c6c269a7d51dd0682e8915be3f1d43c | 1,781 | py | Python | lib/geovista/geoplotter.py | jamesp/geovista | 4850c519c7a37c4765befa06fbab933350637c93 | [
"BSD-3-Clause"
] | null | null | null | lib/geovista/geoplotter.py | jamesp/geovista | 4850c519c7a37c4765befa06fbab933350637c93 | [
"BSD-3-Clause"
] | null | null | null | lib/geovista/geoplotter.py | jamesp/geovista | 4850c519c7a37c4765befa06fbab933350637c93 | [
"BSD-3-Clause"
] | null | null | null | from typing import Any, Optional
import pyvista as pv
from pyvista.utilities import abstract_class
import pyvistaqt as pvqt
import vtk
from .geometry import COASTLINE_RESOLUTION, get_coastlines
from .log import get_logger
__all__ = ["GeoBackgroundPlotter", "GeoMultiPlotter", "GeoPlotter"]
# configure the logger
log... | 21.719512 | 87 | 0.612016 |
61f822f04c85f2bf78ac8685a28495ad4b90ecf2 | 8,234 | py | Python | ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
'''
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"); y... | 39.970874 | 198 | 0.606267 |
49b2dbbc25672dbe6506d10544fe10edb50b8fd7 | 318 | py | Python | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/systems/load_vm_crawler.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 108 | 2015-07-21T10:40:36.000Z | 2021-07-01T06:54:51.000Z | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/systems/load_vm_crawler.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 320 | 2015-07-21T01:33:20.000Z | 2020-07-21T15:57:02.000Z | m2-modified/ims/common/agentless-system-crawler/crawler/plugins/systems/load_vm_crawler.py | CCI-MOC/ABMI | 955c12ae9d2dc7afe7323f6c25f2af120f5b281a | [
"Apache-2.0"
] | 61 | 2015-07-20T18:26:37.000Z | 2021-03-17T01:18:54.000Z | from icrawl_plugin import IVMCrawler
import logging
try:
import psvmi
except ImportError:
psvmi = None
logger = logging.getLogger('crawlutils')
class load_vm_crawler(IVMCrawler):
def get_feature(self):
return 'load'
def crawl(self, vm_desc, **kwargs):
raise NotImplementedError()
| 16.736842 | 40 | 0.707547 |
4f9abfb2ac6a4b94f2867753c170735d80da9b05 | 2,166 | py | Python | tests/broker/test_del_intervention.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 7 | 2015-07-31T05:57:30.000Z | 2021-09-07T15:18:56.000Z | tests/broker/test_del_intervention.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 115 | 2015-03-03T13:11:46.000Z | 2021-09-20T12:42:24.000Z | tests/broker/test_del_intervention.py | ned21/aquilon | 6562ea0f224cda33b72a6f7664f48d65f96bd41a | [
"Apache-2.0"
] | 13 | 2015-03-03T11:17:59.000Z | 2021-09-09T09:16:41.000Z | #!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2016 Contributor
#
# 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... | 36.711864 | 76 | 0.674054 |
6404eb5d41b3fe5dee8b0d2d802aa4fd88a4b989 | 3,815 | py | Python | build/lib/SciDataTool/Methods/Data1D/get_values.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | 24 | 2020-04-06T11:30:04.000Z | 2022-03-15T17:03:33.000Z | build/lib/SciDataTool/Methods/Data1D/get_values.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | 48 | 2020-07-02T13:00:51.000Z | 2022-03-14T11:22:39.000Z | build/lib/SciDataTool/Methods/Data1D/get_values.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | 18 | 2020-06-08T16:20:05.000Z | 2021-11-08T12:59:35.000Z | from importlib import import_module
from numpy import array
from SciDataTool.Functions.conversions import convert
from SciDataTool.Functions.symmetries import rebuild_symmetries_axis
from SciDataTool.Functions import AxisError, NormError
def get_values(
self,
unit="SI",
is_oneperiod=False,
is_antiper... | 31.791667 | 84 | 0.63329 |
e3d52352e219b89a01a13b5f8c3d2780ac68dd8a | 9,762 | py | Python | src/gluonnlp/data/dataset.py | brettkoonce/gluon-nlp | 205453e11e7638aeb786da09b4faa399eb6bc95d | [
"Apache-2.0"
] | null | null | null | src/gluonnlp/data/dataset.py | brettkoonce/gluon-nlp | 205453e11e7638aeb786da09b4faa399eb6bc95d | [
"Apache-2.0"
] | null | null | null | src/gluonnlp/data/dataset.py | brettkoonce/gluon-nlp | 205453e11e7638aeb786da09b4faa399eb6bc95d | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# 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... | 37.837209 | 100 | 0.656628 |
6b409454b743d905f3a2d4f89526cbc984a2e830 | 433 | py | Python | Section05_Singleton/SingletonAllocator/Database.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | 1 | 2020-10-20T07:41:51.000Z | 2020-10-20T07:41:51.000Z | Section05_Singleton/SingletonAllocator/Database.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | null | null | null | Section05_Singleton/SingletonAllocator/Database.py | enriqueescobar-askida/Kinito.Python | e4c5521e771c4de0ceaf81776a4a61f7de01edb4 | [
"MIT"
] | null | null | null | class Database:
initialized = False
def __init__(self):
# self.id = random.randint(1,101)
# print('Generated an id of ', self.id)
# print('Loading database from file')
pass
_instance = None
def __new__(cls, *args, **kwargs):
if not cls._instance:
cl... | 24.055556 | 49 | 0.56351 |
9c3bedcbd92627412ae402594d30dbfe8dfdca21 | 12,583 | py | Python | scipy/linalg/_decomp_ldl.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | 2 | 2020-06-20T14:11:14.000Z | 2020-10-12T07:11:36.000Z | scipy/linalg/_decomp_ldl.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | null | null | null | scipy/linalg/_decomp_ldl.py | smola/scipy | ff8b9d9e87a585a820846d7f459d6156ba621c4d | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, print_function, absolute_import
from warnings import warn
import numpy as np
from numpy import (atleast_2d, ComplexWarning, arange, zeros_like, imag, diag,
iscomplexobj, tril, triu, argsort, empty_like)
from .decomp import _asarray_validated
from .lapack import get_... | 35.44507 | 79 | 0.608043 |
895b82a8fe953a79bcb72c96c50765c05d8eb6b1 | 1,812 | py | Python | tests/__mocks__.py | stphivos/bg-kube | 3936c2899f76b2f58df7a5f38fac741c638562cf | [
"MIT"
] | 8 | 2017-11-24T12:07:02.000Z | 2020-04-27T03:27:58.000Z | tests/__mocks__.py | stphivos/bg-kube | 3936c2899f76b2f58df7a5f38fac741c638562cf | [
"MIT"
] | 19 | 2017-11-14T23:35:31.000Z | 2022-03-08T22:50:02.000Z | tests/__mocks__.py | stphivos/bg-kube | 3936c2899f76b2f58df7a5f38fac741c638562cf | [
"MIT"
] | null | null | null | from random import randint, choice
from string import ascii_letters
from sys import maxsize
from mock import patch
patch_object = patch.object = patch.object
class DictionaryObject(dict):
__getattr__ = dict.get
__setattr__ = dict.__setitem__
def get_random_int(min_value=-maxsize, max_value=maxsize):
re... | 26.26087 | 89 | 0.63245 |
3e5394af87436776a7cd48dadc7e2f1e1a16bf31 | 171 | py | Python | autofaiss/version.py | Evaia/autofaiss | ad164b7be30ddf9ce45ab616d31cb4365fe7f5ab | [
"Apache-2.0"
] | null | null | null | autofaiss/version.py | Evaia/autofaiss | ad164b7be30ddf9ce45ab616d31cb4365fe7f5ab | [
"Apache-2.0"
] | null | null | null | autofaiss/version.py | Evaia/autofaiss | ad164b7be30ddf9ce45ab616d31cb4365fe7f5ab | [
"Apache-2.0"
] | null | null | null | # pylint: disable=all
__version__ = "1.7.0"
__author__ = "Criteo"
MAJOR = __version__.split(".")[0]
MINOR = __version__.split(".")[1]
PATCH = __version__.split(".")[2]
| 17.1 | 33 | 0.654971 |
19e1062d877f52ccdadc6a39ef874c9578b9f0d5 | 306 | py | Python | test/fontio.py | jposada202020/Adafruit_CircuitPython_Bitmap_Font | 1aeb6ef4f8936e7c595dce323bab79897118f1d2 | [
"Unlicense",
"MIT-0",
"MIT"
] | 14 | 2019-02-13T00:23:57.000Z | 2021-12-16T06:13:39.000Z | test/fontio.py | jposada202020/Adafruit_CircuitPython_Bitmap_Font | 1aeb6ef4f8936e7c595dce323bab79897118f1d2 | [
"Unlicense",
"MIT-0",
"MIT"
] | 39 | 2019-02-12T18:21:30.000Z | 2022-02-18T20:16:08.000Z | test/fontio.py | jposada202020/Adafruit_CircuitPython_Bitmap_Font | 1aeb6ef4f8936e7c595dce323bab79897118f1d2 | [
"Unlicense",
"MIT-0",
"MIT"
] | 18 | 2019-02-25T23:36:03.000Z | 2022-01-18T01:35:23.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""Implementation of minimal fontio subset for testing"""
import collections
Glyph = collections.namedtuple(
"Glyph",
["bitmap", "tile_index", "width", "height", "dx", "dy", "shift_x", "shift_y"],
)
| 23.538462 | 82 | 0.702614 |
f6974479703166bf2703729797ea58949671536e | 723 | py | Python | tests/unit/docker/test_docker.py | abreu4/jina | d1d045e9e0933dffb3bd668cb9cfebab6cd52202 | [
"Apache-2.0"
] | 2 | 2021-04-22T16:59:02.000Z | 2021-04-22T17:14:32.000Z | tests/unit/docker/test_docker.py | abreu4/jina | d1d045e9e0933dffb3bd668cb9cfebab6cd52202 | [
"Apache-2.0"
] | 4 | 2020-09-01T17:47:27.000Z | 2021-04-16T23:11:57.000Z | tests/unit/docker/test_docker.py | abreu4/jina | d1d045e9e0933dffb3bd668cb9cfebab6cd52202 | [
"Apache-2.0"
] | null | null | null | from jina.docker.checker import is_error_message
def test_checker_is_error_message():
err_msg_list = [
'HubIO@11[C]:ERROR: Command errored out with exit status 1: ...',
'HubIO@11[C]: ERROR: Failed building wheel for ...',
'HubIO@11[C]: gcc: error trying to exec : execvp: No such file or ... | 34.428571 | 103 | 0.59751 |
0f4c4714eb2927e7d84dbb60619d19820619c0cd | 5,172 | py | Python | scripts/logreg_laplace_demo.py | karalleyna/pyprobml | 72195e46fdffc4418910e76d02e3d6469f4ce272 | [
"MIT"
] | null | null | null | scripts/logreg_laplace_demo.py | karalleyna/pyprobml | 72195e46fdffc4418910e76d02e3d6469f4ce272 | [
"MIT"
] | null | null | null | scripts/logreg_laplace_demo.py | karalleyna/pyprobml | 72195e46fdffc4418910e76d02e3d6469f4ce272 | [
"MIT"
] | null | null | null | # Author: Meduri Venkata Shivaditya
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm, multivariate_normal
import bayes_logistic # pip install bayes_logistic
import warnings
import pyprobml_utils as pml
warnings.filterwarnings("ignore", category=RuntimeWarning)
np.random.seed(135)
#Creat... | 33.584416 | 168 | 0.684648 |
dd8b7e0205465a869d7f3815371010a99a372f22 | 4,722 | py | Python | tweb/utils/strings.py | marcohong/tweb | 194518f6969b9c0d73899b7e616bd93a02d93c16 | [
"MIT"
] | 2 | 2021-01-01T14:52:25.000Z | 2022-01-20T03:52:39.000Z | tweb/utils/strings.py | marcohong/tweb | 194518f6969b9c0d73899b7e616bd93a02d93c16 | [
"MIT"
] | null | null | null | tweb/utils/strings.py | marcohong/tweb | 194518f6969b9c0d73899b7e616bd93a02d93c16 | [
"MIT"
] | null | null | null | import os
import sys
import uuid
import time
import string
import random
import datetime
def get_start_shell() -> str:
return os.path.abspath(sys.argv[0])
def get_root_path(path: str = None) -> str:
'''
Get project base path, default start shell dir
:param path: `<str>`
:return:
'''
if ... | 24.722513 | 79 | 0.604405 |
0c2aacdc9df003776d2c0b67fd997bfd545e791b | 6,498 | py | Python | king_phisher/archive.py | 1ndy/king-phisher | 937706a22d17ca01428f0edee48b9d60a20b33d9 | [
"BSD-3-Clause"
] | 3 | 2018-12-17T02:54:18.000Z | 2021-07-07T15:46:04.000Z | king_phisher/archive.py | 1ndy/king-phisher | 937706a22d17ca01428f0edee48b9d60a20b33d9 | [
"BSD-3-Clause"
] | null | null | null | king_phisher/archive.py | 1ndy/king-phisher | 937706a22d17ca01428f0edee48b9d60a20b33d9 | [
"BSD-3-Clause"
] | 4 | 2017-09-14T03:02:40.000Z | 2019-06-25T02:58:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# king_phisher/archive.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | 34.020942 | 103 | 0.736996 |
ef80d4e3607a5f95db0ceb8076dc345de5fc3e63 | 391 | py | Python | src/contact/wsgi.py | avvypardhan/Contact-App | a1585f236299a505b7f4770d49a38f612eb3ab6f | [
"bzip2-1.0.6"
] | null | null | null | src/contact/wsgi.py | avvypardhan/Contact-App | a1585f236299a505b7f4770d49a38f612eb3ab6f | [
"bzip2-1.0.6"
] | 8 | 2019-12-04T23:04:46.000Z | 2022-02-10T07:21:33.000Z | src/contact/wsgi.py | avvypardhan/Contact-App | a1585f236299a505b7f4770d49a38f612eb3ab6f | [
"bzip2-1.0.6"
] | null | null | null | """
WSGI config for contact project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
4f87e03637072614a1d6c990a61969b07496a6e4 | 22,946 | py | Python | util/secscan/api.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | util/secscan/api.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | util/secscan/api.py | dongboyan77/quay | 8018e5bd80f17e6d855b58b7d5f2792d92675905 | [
"Apache-2.0"
] | null | null | null | import os
import logging
from abc import ABCMeta, abstractmethod
from six import add_metaclass
from urlparse import urljoin
import requests
from data import model
from data.database import CloseForLongOperation, TagManifest, Image, Manifest, ManifestLegacyImage
from data.model.storage import get_storage_locations
fr... | 40.115385 | 107 | 0.641114 |
91e14d81bcf5b1a4279eca1cb8e64dcd22e2800a | 12,198 | py | Python | DataScience/Analytics/prototype/automatic_testing.py | Yasir326/address-index-data | f95da1f5ecda911d5d5a83ce396b33837b629bdd | [
"MIT"
] | 13 | 2016-11-30T16:52:59.000Z | 2021-03-26T23:49:41.000Z | DataScience/Analytics/prototype/automatic_testing.py | Yasir326/address-index-data | f95da1f5ecda911d5d5a83ce396b33837b629bdd | [
"MIT"
] | 84 | 2016-11-17T10:46:54.000Z | 2022-02-24T09:09:31.000Z | DataScience/Analytics/prototype/automatic_testing.py | Yasir326/address-index-data | f95da1f5ecda911d5d5a83ce396b33837b629bdd | [
"MIT"
] | 7 | 2019-01-26T10:43:25.000Z | 2022-02-24T08:53:54.000Z | #!/usr/bin/env python
"""
ONS Address Index - Automatic Testing of Different Datasets
===========================================================
A simple wrapper to call all independent address linking datasets in serial.
Could be parallelised trivially, however, the linking code is memory hungry
so the node needs to... | 34.360563 | 104 | 0.669864 |
c91e808d177e7eef5ac0f3703c198f1965edb996 | 2,452 | py | Python | boto/compat.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | 1 | 2019-06-22T23:31:13.000Z | 2019-06-22T23:31:13.000Z | boto/compat.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | null | null | null | boto/compat.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | null | null | null | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | 38.920635 | 77 | 0.738581 |
a661518ad92a5bdf1f7d1b5c1ad0f7fd07a497cb | 5,644 | py | Python | aws_lambda_builders/actions.py | mingkun2020/aws-lambda-builders | 71e507fbc08eb8d583be339b3701ce30bf026776 | [
"Apache-2.0"
] | 88 | 2020-09-03T18:51:44.000Z | 2022-03-22T23:46:14.000Z | aws_lambda_builders/actions.py | mingkun2020/aws-lambda-builders | 71e507fbc08eb8d583be339b3701ce30bf026776 | [
"Apache-2.0"
] | 88 | 2020-09-01T19:22:28.000Z | 2022-03-30T01:55:36.000Z | aws_lambda_builders/actions.py | mingkun2020/aws-lambda-builders | 71e507fbc08eb8d583be339b3701ce30bf026776 | [
"Apache-2.0"
] | 40 | 2020-09-02T17:29:39.000Z | 2022-03-31T02:36:17.000Z | """
Definition of actions used in the workflow
"""
import logging
import os
import shutil
import six
from aws_lambda_builders.utils import copytree
LOG = logging.getLogger(__name__)
class ActionFailedError(Exception):
"""
Base class for exception raised when action failed to complete. Use this to express w... | 28.795918 | 117 | 0.675762 |
86c2fe4c6bccb8c4869548a85304d05d424ed707 | 12,120 | py | Python | dist/weewx-4.0.0b6/bin/weeutil/ftpupload.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 10 | 2017-01-05T17:30:48.000Z | 2021-09-18T15:04:20.000Z | dist/weewx-4.0.0b6/bin/weeutil/ftpupload.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 2 | 2019-07-21T10:48:42.000Z | 2022-02-16T20:36:45.000Z | dist/weewx-4.0.0b6/bin/weeutil/ftpupload.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 12 | 2017-01-05T18:50:30.000Z | 2021-10-05T07:35:45.000Z | #
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""For uploading files to a remove server via FTP"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import with_statement
import ftplib
import logging
imp... | 39.737705 | 123 | 0.552723 |
802f0000a3deed24863b56fded7c90a5f47c0ed1 | 298 | py | Python | lib/model/roi_layers/__init__.py | YeolJ00/Gradually-Applying-Weakly-Supervised-and-Active-Learning-for-Mass-Detection-in-Breast-Ultrasound | 2aa6a02ffc688455308819b719a6e0ccc4154d5b | [
"MIT"
] | 4 | 2021-09-22T14:49:55.000Z | 2022-01-24T14:59:16.000Z | lib/model/roi_layers/__init__.py | YeolJ00/faster-rcnn-pytorch | 2aa6a02ffc688455308819b719a6e0ccc4154d5b | [
"MIT"
] | null | null | null | lib/model/roi_layers/__init__.py | YeolJ00/faster-rcnn-pytorch | 2aa6a02ffc688455308819b719a6e0ccc4154d5b | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from .nms import nms
from .roi_align import ROIAlign
from .roi_align import roi_align
from .roi_pool import ROIPool
from .roi_pool import roi_pool
__all__ = ["nms", "roi_align", "ROIAlign", "roi_pool", "ROIPool"] | 33.111111 | 71 | 0.768456 |
b794e1b5408d8cf8a0f8a4a474dd264a0df3185d | 2,333 | py | Python | setup.py | BlueOwlDev/python-mocket | 7075f206394c6f226b975a2955821a2609023e24 | [
"BSD-3-Clause"
] | null | null | null | setup.py | BlueOwlDev/python-mocket | 7075f206394c6f226b975a2955821a2609023e24 | [
"BSD-3-Clause"
] | null | null | null | setup.py | BlueOwlDev/python-mocket | 7075f206394c6f226b975a2955821a2609023e24 | [
"BSD-3-Clause"
] | null | null | null | import io
import os
import sys
from setuptools import find_packages, setup
os.environ.setdefault("PIPENV_SKIP_LOCK", "1")
major, minor = sys.version_info[:2]
install_requires = [
line
for line in io.open(
os.path.join(os.path.dirname(__file__), "requirements.txt")
).readlines()
if not line.s... | 32.859155 | 98 | 0.633519 |
0e18b51b898e36d1def11aefec3195938804effe | 1,170 | py | Python | Assignment2/draw_line.py | rahlin1004/sc-projects | 48c602b0474ddb910a08534ba56bbd13de79b7bc | [
"MIT"
] | null | null | null | Assignment2/draw_line.py | rahlin1004/sc-projects | 48c602b0474ddb910a08534ba56bbd13de79b7bc | [
"MIT"
] | null | null | null | Assignment2/draw_line.py | rahlin1004/sc-projects | 48c602b0474ddb910a08534ba56bbd13de79b7bc | [
"MIT"
] | null | null | null | """
File: draw_line.py
Name: Sarah Lin
-------------------------
this program help you to draw lines
"""
from campy.graphics.gobjects import GOval, GLine
from campy.graphics.gwindow import GWindow
from campy.gui.events.mouse import onmouseclicked
SIZE = 10 # this constant control the circle size
w = GWindo... | 27.209302 | 77 | 0.623077 |
2a6f78a3dbb9f1ba095c6e83fb94011e82d2717f | 4,369 | py | Python | tests/python/pants_test/backend/codegen/jaxb/test_jaxb_gen.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/codegen/jaxb/test_jaxb_gen.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/backend/codegen/jaxb/test_jaxb_gen.py | SergeKireev/pants | cd92c65aeb3dfdcee3e0946f2b68a301ef2f4541 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from pants.backend.codegen.jaxb.jaxb_gen import JaxbGen
from pants.backend.codegen.jaxb.jaxb_library import JaxbLibrary
from pants.backend.codegen.jaxb.register import build_fil... | 45.989474 | 98 | 0.644999 |
aa4e3281a7f373935d42d18ded7243d39849ca7c | 1,052 | py | Python | datamodel_code_generator/parser/openapi.py | Chilipp/datamodel-code-generator | 849955ad82034a04a7036914e04402e8ebd18776 | [
"MIT"
] | null | null | null | datamodel_code_generator/parser/openapi.py | Chilipp/datamodel-code-generator | 849955ad82034a04a7036914e04402e8ebd18776 | [
"MIT"
] | null | null | null | datamodel_code_generator/parser/openapi.py | Chilipp/datamodel-code-generator | 849955ad82034a04a7036914e04402e8ebd18776 | [
"MIT"
] | null | null | null | from typing import Any, Dict
import yaml
from datamodel_code_generator import snooper_to_methods
from datamodel_code_generator.parser.jsonschema import JsonSchemaParser
@snooper_to_methods(max_variable_length=None)
class OpenAPIParser(JsonSchemaParser):
def parse_raw(self) -> None:
for source in self.it... | 36.275862 | 84 | 0.620722 |
da34c8c3ac850ebdfd8ea38564876230cb438bd4 | 1,181 | py | Python | strategies/gekko-japonicus-master/evaluation/gekko/API.py | tobby2002/tradyai-api | 1314528ee5200114a951e298a64633d4485eef62 | [
"MIT"
] | 229 | 2018-01-05T13:32:52.000Z | 2021-12-18T00:57:49.000Z | strategies/gekko-japonicus-master/evaluation/gekko/API.py | tobby2002/tradyai-api | 1314528ee5200114a951e298a64633d4485eef62 | [
"MIT"
] | 142 | 2018-01-04T23:39:28.000Z | 2019-12-14T16:38:24.000Z | strategies/gekko-japonicus-master/evaluation/gekko/API.py | tobby2002/tradyai-api | 1314528ee5200114a951e298a64633d4485eef62 | [
"MIT"
] | 95 | 2018-01-06T05:35:23.000Z | 2021-12-13T16:42:22.000Z | #!/bin/python
import os
import requests
import json
from subprocess import Popen, PIPE
def initializeGekko(): # not used yet.
CMD = ['node', gekkoDIR + '/gekko', '--ui']
D = Popen(CMD, stdin=PIPE, stdout=PIPE, stderr=PIPE)
def checkInstance(instanceUrl):
try:
Request = requests.get(instance... | 24.102041 | 74 | 0.598645 |
4239dd3b51fea8e51d3cdaf33116595cc2748f34 | 1,927 | py | Python | sdk/cwl/arvados_cwl/context.py | chlige/arvados | e4a68851e521c0e3152f9790683d8cdb1b3923df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/cwl/arvados_cwl/context.py | chlige/arvados | e4a68851e521c0e3152f9790683d8cdb1b3923df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/cwl/arvados_cwl/context.py | chlige/arvados | e4a68851e521c0e3152f9790683d8cdb1b3923df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from cwltool.context import LoadingContext, RuntimeContext
from collections import namedtuple
class ArvLoadingContext(LoadingContext):
def __init__(self, kwargs=None):
super(ArvLoadingContext, self).__init__(... | 33.807018 | 75 | 0.670472 |
fb95e831a4666c32864b9ff166332cae2bb78252 | 1,104 | py | Python | numbermix.py | thekushalpokhrel/Python_Programs_SoftDev_DataAnalysis | e56e0e853aca4367ebf99ae18e920b80f39bd133 | [
"MIT"
] | null | null | null | numbermix.py | thekushalpokhrel/Python_Programs_SoftDev_DataAnalysis | e56e0e853aca4367ebf99ae18e920b80f39bd133 | [
"MIT"
] | null | null | null | numbermix.py | thekushalpokhrel/Python_Programs_SoftDev_DataAnalysis | e56e0e853aca4367ebf99ae18e920b80f39bd133 | [
"MIT"
] | null | null | null | #questions for numbers level
que_num_lev1=['105+26+30 = ',
'1152+269+963 = ',
'5269+125+478 = ',
'256+36+987 = ',
'1245+69+5896 = ']
que_num_lev2=['86*2 = ',
'526*2 = ',
'256*8 = ',
'256*9 = ',
'589*... | 27.6 | 44 | 0.365942 |
c3d07292329cef3a003d88df6aab05f3005b1d35 | 1,393 | py | Python | pack.py | Zhen-Dong/BitPack | 491a2a739b7138e1006637e132f4ab5307a91db9 | [
"MIT"
] | 32 | 2021-01-17T08:57:01.000Z | 2022-02-17T10:52:54.000Z | pack.py | Zhen-Dong/BitPack | 491a2a739b7138e1006637e132f4ab5307a91db9 | [
"MIT"
] | null | null | null | pack.py | Zhen-Dong/BitPack | 491a2a739b7138e1006637e132f4ab5307a91db9 | [
"MIT"
] | 8 | 2021-02-08T22:38:22.000Z | 2021-08-08T10:01:41.000Z | import argparse
import torch
from bitpack.pytorch_interface import save_quantized_state_dict
parser = argparse.ArgumentParser(description='BitPack to efficiently save mixed-precision models')
parser.add_argument('--input-int-file',
type=str,
default=None,
... | 46.433333 | 99 | 0.677674 |
941a668e0d801716fa03904aba79e1f96f7b35d7 | 1,035 | py | Python | Annotated_Transformer/PositionEncoding.py | treefriend/NLP_study_tf2 | ec064b451efc57b90a002430a01c840ba8262557 | [
"MIT"
] | null | null | null | Annotated_Transformer/PositionEncoding.py | treefriend/NLP_study_tf2 | ec064b451efc57b90a002430a01c840ba8262557 | [
"MIT"
] | null | null | null | Annotated_Transformer/PositionEncoding.py | treefriend/NLP_study_tf2 | ec064b451efc57b90a002430a01c840ba8262557 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020-05-21 22:44
# @Author : Shupeng
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
class PositionalEncoding(nn.Module):
def __init__(self, d_model, dropout, max_len=5000):
super(PositionalEncoding, self).__init__()
self... | 30.441176 | 69 | 0.604831 |
626f38da05503cf61a6fbd11c6bb8ccaff769346 | 1,425 | py | Python | Python_MiniGame_Fighter/venv/Lib/site-packages/pygame/__pyinstaller/hook-pygame.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | Python_MiniGame_Fighter/venv/Lib/site-packages/pygame/__pyinstaller/hook-pygame.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | Python_MiniGame_Fighter/venv/Lib/site-packages/pygame/__pyinstaller/hook-pygame.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | """
binaries hook for pygame seems to be required for pygame 2.0 Windows.
Otherwise some essential DLLs will not be transfered to the exe.
And also put hooks for datas, resources that pygame uses, to work
correctly with pyinstaller
"""
import os
import platform
from pygame import __file__ as pygame_main_... | 31.666667 | 85 | 0.711579 |
c099f12343b2a5b81c747582e03b26b13b2f6723 | 33,161 | py | Python | vealous/libs/pydouban.py | lepture/Vealous | a13956a70871419f24bab7e7c9ecbaf09337feb1 | [
"BSD-3-Clause"
] | 1 | 2019-04-14T19:58:42.000Z | 2019-04-14T19:58:42.000Z | vealous/libs/pydouban.py | lepture/Vealous | a13956a70871419f24bab7e7c9ecbaf09337feb1 | [
"BSD-3-Clause"
] | null | null | null | vealous/libs/pydouban.py | lepture/Vealous | a13956a70871419f24bab7e7c9ecbaf09337feb1 | [
"BSD-3-Clause"
] | null | null | null | #-*- coding: utf-8 -*-
"""
pydouban
A lightweight douban api library.
Basic Usage:
>>> import pydouban
>>> key = 'your douban oauth consumer key'
>>> secret = 'your douban oauth consumer secret'
>>> auth = pydouban.Auth(key, secret)
>>> dic = auth.login()
>>> print dic['url']
...
>>> t... | 37.470056 | 224 | 0.600525 |
22b9e92cda9fe64fa0f81628a53b51cd039e0145 | 15,189 | py | Python | docs/flydra-sphinx-docs/ext/docscrape.py | elhananby/flydra | 09b86859b1863700cdea0bbcdd4758da6c83930b | [
"Apache-2.0",
"MIT"
] | 45 | 2017-08-25T06:46:56.000Z | 2021-08-29T16:42:49.000Z | docs/flydra-sphinx-docs/ext/docscrape.py | elhananby/flydra | 09b86859b1863700cdea0bbcdd4758da6c83930b | [
"Apache-2.0",
"MIT"
] | 7 | 2017-10-16T10:46:20.000Z | 2020-12-03T16:42:55.000Z | docs/flydra-sphinx-docs/ext/docscrape.py | elhananby/flydra | 09b86859b1863700cdea0bbcdd4758da6c83930b | [
"Apache-2.0",
"MIT"
] | 21 | 2018-04-11T09:06:40.000Z | 2021-12-26T23:38:40.000Z | """Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from warnings import warn
class Reader(object):
"""A line-based string reader.
"""
def __init__(self, data):
"""
Parameters
----------
data : str
... | 30.438878 | 80 | 0.500099 |
ba3e44fc1791088ca5be008229b0988840fd2d1d | 1,450 | py | Python | server.py | balajirama/guessing_game | 89813882b669d0af3e17c070bfe9b10c80a4f843 | [
"MIT"
] | null | null | null | server.py | balajirama/guessing_game | 89813882b669d0af3e17c070bfe9b10c80a4f843 | [
"MIT"
] | null | null | null | server.py | balajirama/guessing_game | 89813882b669d0af3e17c070bfe9b10c80a4f843 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, redirect, session
app = Flask(__name__)
app.secret_key = 'darksecret'
import random
@app.route("/")
def root():
if 'number' not in session:
session['number'] = random.randint(1,100)
session['message'] = 'start'
session['trials'] = 0
... | 27.884615 | 68 | 0.606207 |
9afbe918c33006f6fb33d20a64a6ac380fe6ce4c | 2,351 | py | Python | RecoJets/JetPlusTracks/test/JetShapeJPTAnalysis_mc_s_sql_qcd_pat2.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoJets/JetPlusTracks/test/JetShapeJPTAnalysis_mc_s_sql_qcd_pat2.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoJets/JetPlusTracks/test/JetShapeJPTAnalysis_mc_s_sql_qcd_pat2.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("RECO4")
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load("Configuration.StandardSequences.GeometryDB_cff")
process.load('Configuration.StandardSequences.MagneticField_AutoFr... | 41.982143 | 160 | 0.788601 |
2dcb7a4be6625d53ca3aa54df47621117fa9a086 | 1,527 | py | Python | notest/testset.py | GodQ/notest | 530d91782e8ed06493a1313facbed86e06662daf | [
"Apache-2.0"
] | 3 | 2019-05-10T09:36:07.000Z | 2021-04-16T23:40:46.000Z | notest/testset.py | GodQ/notest | 530d91782e8ed06493a1313facbed86e06662daf | [
"Apache-2.0"
] | null | null | null | notest/testset.py | GodQ/notest | 530d91782e8ed06493a1313facbed86e06662daf | [
"Apache-2.0"
] | 1 | 2019-05-10T09:43:48.000Z | 2019-05-10T09:43:48.000Z | import json
from notest.common_test import CommonTest
from notest.lib.parsing import safe_to_json
DEFAULT_TIMEOUT = 30
class TestSetConfig:
""" Configuration for a test run """
testset_name = None
timeout = DEFAULT_TIMEOUT # timeout of tests, in seconds
request_client = None # requests or pycurl
... | 26.789474 | 81 | 0.682384 |
96a763057a61cb1a2a7d2febfd1f493fe464268d | 398 | py | Python | d2l/__init__.py | 0x00A0/d2l-zh_paddle | b9e64216e55dfe88066750ed46b75c96664d02a2 | [
"Apache-2.0"
] | null | null | null | d2l/__init__.py | 0x00A0/d2l-zh_paddle | b9e64216e55dfe88066750ed46b75c96664d02a2 | [
"Apache-2.0"
] | null | null | null | d2l/__init__.py | 0x00A0/d2l-zh_paddle | b9e64216e55dfe88066750ed46b75c96664d02a2 | [
"Apache-2.0"
] | null | null | null | """Saved source code for "Dive into Deep Learing" (https://d2l.ai).
Please import d2l by one of the following ways:
from d2l import mxnet as d2l # Use MXNet as the backend
from d2l import torch as d2l # Use PyTorch as the backend
from d2l import tensorflow as d2l # Use TensorFlow as the backend
from d2l import pad... | 30.615385 | 67 | 0.738693 |
3889c91df98e10a60dff6a1a91b24acbb47da6b2 | 512 | py | Python | dynamic_preferences/migrations/0004_move_user_model.py | EliotBerriot/django-dynamic-preferences | 1a4cba7323f5456a3ddb2b9a387775f5fa7e0458 | [
"BSD-3-Clause"
] | 244 | 2015-06-19T15:48:21.000Z | 2020-12-28T21:16:48.000Z | dynamic_preferences/migrations/0004_move_user_model.py | EliotBerriot/django-dynamic-preferences | 1a4cba7323f5456a3ddb2b9a387775f5fa7e0458 | [
"BSD-3-Clause"
] | 193 | 2015-07-08T04:55:22.000Z | 2020-12-04T08:59:08.000Z | dynamic_preferences/migrations/0004_move_user_model.py | EliotBerriot/django-dynamic-preferences | 1a4cba7323f5456a3ddb2b9a387775f5fa7e0458 | [
"BSD-3-Clause"
] | 81 | 2015-07-12T22:18:47.000Z | 2020-12-12T03:04:29.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
"""
Migration to move the user preferences to a dedicated app, see #33
Borrowed from http://stackoverflow.com/a/26472482/2844093... | 25.6 | 73 | 0.707031 |
b34a318389ca7ec859e7b02241a13462d7e1d7c5 | 2,081 | py | Python | src/python/pants/backend/helm/goals/tailor.py | wonlay/pants | 53c66503b6898e83c9c9596e56cde5ad9ed6a0d3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/helm/goals/tailor.py | wonlay/pants | 53c66503b6898e83c9c9596e56cde5ad9ed6a0d3 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/helm/goals/tailor.py | wonlay/pants | 53c66503b6898e83c9c9596e56cde5ad9ed6a0d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
from dataclasses import dataclass
from itertools import chain
from pants.backend.helm.subsystems.helm import HelmSubsystem
from pants.backend... | 33.031746 | 97 | 0.753964 |
82c67e13ee3036798d32dcb8aa89ced5f7ae4751 | 5,305 | py | Python | docs/conf.py | xywang58/molecool | 8aa12bbdc62d70f87ce44250825dbde77ab26bc5 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | xywang58/molecool | 8aa12bbdc62d70f87ce44250825dbde77ab26bc5 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | xywang58/molecool | 8aa12bbdc62d70f87ce44250825dbde77ab26bc5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config
# -- Path setup ------------------------------------------------------------... | 30.314286 | 85 | 0.65655 |
331292abc000a0f5781c4a88691286e722fa6bd1 | 2,866 | py | Python | salt/states/loop.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2021-08-14T13:48:38.000Z | 2021-08-14T13:48:38.000Z | salt/states/loop.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 3 | 2015-03-31T14:44:05.000Z | 2015-06-18T19:02:24.000Z | salt/states/loop.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
Loop state
Allows for looping over execution modules.
.. versionadded:: 2017.7.0
.. code-block:: yaml
wait_for_service_to_be_healthy:
loop.until:
- name: boto_elb.get_instance_health
- condition: m_ret[0]['state'] == 'InService'
- period: 5
- tim... | 24.921739 | 82 | 0.600488 |
304df669dfb5311b9c1dfc52b5f64ed191339515 | 34,206 | py | Python | main/example3/utils.py | YerbaPage/FEM | b60fb76b1556f3f92dce96e37ce4e5f3632424c3 | [
"MIT"
] | 1 | 2021-09-13T05:27:52.000Z | 2021-09-13T05:27:52.000Z | main/example3/utils.py | YerbaPage/FEM_forth_perturb | b60fb76b1556f3f92dce96e37ce4e5f3632424c3 | [
"MIT"
] | null | null | null | main/example3/utils.py | YerbaPage/FEM_forth_perturb | b60fb76b1556f3f92dce96e37ce4e5f3632424c3 | [
"MIT"
] | null | null | null | """This module contains utility functions such as convenient access to
SciPy linear solvers."""
import sys
from skfem.assembly import BilinearForm, LinearForm
from skfem.models.poisson import *
from scipy.sparse.linalg import LinearOperator, minres
from skfem.helpers import d, dd, ddd, dot, ddot, grad, dddot, prod
fro... | 30.595707 | 425 | 0.534029 |
29c5051467518ef127a203b85968b4ed89b23176 | 689 | py | Python | python/SecantMethod.py | vladalex01/numerical-methods | 2c58e726c50073824751f07eb1f7be1645bac337 | [
"MIT"
] | null | null | null | python/SecantMethod.py | vladalex01/numerical-methods | 2c58e726c50073824751f07eb1f7be1645bac337 | [
"MIT"
] | null | null | null | python/SecantMethod.py | vladalex01/numerical-methods | 2c58e726c50073824751f07eb1f7be1645bac337 | [
"MIT"
] | null | null | null | import numpy as np
def f(x):
return 2 * x**3 + 1
def SecantMethod(f, x0, x1, tol, max_iter):
x = 0
for i in range (1, max_iter):
print(" La pasul: {}".format(i))
f0 = f(x0)
f1 = f(x1)
print("f0 = {}; f1 = {}".format(f0, f1))
xi = x1 - f1 * (x1 - x0) / (f1 - f0)
fxi = f(xi)
print("xi = {}; fxi = {}".... | 19.685714 | 65 | 0.534107 |
df8416b9c41fb9a7ca8cb7a4002c9a690a4bbd7f | 12,048 | py | Python | lldb/test/API/types/AbstractBase.py | elizabethandrews/llvm | 308498236c1c4778fdcba0bfbb556adf8aa333ea | [
"Apache-2.0"
] | 5 | 2021-02-21T22:35:08.000Z | 2022-02-01T18:22:50.000Z | lldb/test/API/types/AbstractBase.py | elizabethandrews/llvm | 308498236c1c4778fdcba0bfbb556adf8aa333ea | [
"Apache-2.0"
] | null | null | null | lldb/test/API/types/AbstractBase.py | elizabethandrews/llvm | 308498236c1c4778fdcba0bfbb556adf8aa333ea | [
"Apache-2.0"
] | 1 | 2021-03-30T11:22:52.000Z | 2021-03-30T11:22:52.000Z | """
Abstract base class of basic types provides a generic type tester method.
"""
from __future__ import print_function
import os
import re
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
def Msg(var, val, using_frame_variable):
return "'%s %s' matches the output (fr... | 41.979094 | 90 | 0.566235 |
00d1a17988ac9311f65610c00fc65fe9ab23cb8b | 5,915 | py | Python | quru/server/raft/state/candidate.py | ShawnHan1993/quru | 6b103a54d8228e4e2d44b06cc068c60a44b02d67 | [
"MIT"
] | null | null | null | quru/server/raft/state/candidate.py | ShawnHan1993/quru | 6b103a54d8228e4e2d44b06cc068c60a44b02d67 | [
"MIT"
] | null | null | null | quru/server/raft/state/candidate.py | ShawnHan1993/quru | 6b103a54d8228e4e2d44b06cc068c60a44b02d67 | [
"MIT"
] | null | null | null | import asyncio
import random
import typing
from aiozipkin.span import SpanAbc
from ....quru_logger import logger
from ....env import HEARTBEAT_INTERVAL
from ....words import RaftLog
from ..timer import Timer
from .base import BaseState, log_consistency_check, candidate_qualification
from ...protocol.layer2 import RPC... | 35 | 77 | 0.514286 |
a5784097b96e3988fd4b432114b0389412e0ad06 | 360 | py | Python | tasks.py | li195111/FastAPI-Template | ca5c0b6633496b7ddcb1ad35566d817a3e16598a | [
"MIT"
] | null | null | null | tasks.py | li195111/FastAPI-Template | ca5c0b6633496b7ddcb1ad35566d817a3e16598a | [
"MIT"
] | null | null | null | tasks.py | li195111/FastAPI-Template | ca5c0b6633496b7ddcb1ad35566d817a3e16598a | [
"MIT"
] | null | null | null | from celery import Celery
task = Celery('tasks',
broker='redis://localhost:6379/0',
backend='redis://localhost:6379/0')
'''
@task.task
def function():
...
'''
@task.on_after_configure.connect
def setup_periodic_tasks(sender, **kwargs):
# sender.add_periodic_task(10.0, clean_key_pair... | 22.5 | 81 | 0.65 |
81187a12ca45b2b1e1460b755b45f741ba28fc65 | 3,620 | py | Python | opts.py | RockingRok/SeniorDesignDemo | c42a44310a3976cf6de2a7f3701bc6749373736c | [
"MIT"
] | 1 | 2018-11-30T19:19:50.000Z | 2018-11-30T19:19:50.000Z | opts.py | RockingRok/SeniorDesignDemo | c42a44310a3976cf6de2a7f3701bc6749373736c | [
"MIT"
] | null | null | null | opts.py | RockingRok/SeniorDesignDemo | c42a44310a3976cf6de2a7f3701bc6749373736c | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser(description="PyTorch implementation of Temporal Segment Networks")
parser.add_argument('dataset', type=str, choices=['something','jester','moments'])
parser.add_argument('modality', type=str, choices=['RGB', 'Flow'])
parser.add_argument('--train_list', type=str,default="... | 57.460317 | 108 | 0.620718 |
559f521086bd410bb53080954deec566f6a13f8a | 7,381 | py | Python | KiBuzzard/dialog/dialog_base.py | femtoduino/KiBuzzard | 2065819fc822549a03516377929fbc2cecc66252 | [
"MIT"
] | 17 | 2021-01-24T03:09:36.000Z | 2021-02-13T12:40:23.000Z | KiBuzzard/dialog/dialog_base.py | arturo182/KiBuzzard | a963b413a0c89f7d7eb88bc15fc15186a19f5dfc | [
"MIT"
] | null | null | null | KiBuzzard/dialog/dialog_base.py | arturo182/KiBuzzard | a963b413a0c89f7d7eb88bc15fc15186a19f5dfc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Oct 26 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
impor... | 44.463855 | 197 | 0.658718 |
ea77a533a061ab8a89e995bfcf9d820712750779 | 1,011 | py | Python | aiogram/__init__.py | fakegit/aiogram | 583f00ce317dfb4c2c6c4df4bd4694c6f0b0bf18 | [
"MIT"
] | 2 | 2021-12-28T06:40:14.000Z | 2022-02-05T08:33:13.000Z | aiogram/__init__.py | MrShox777/aiogram | 763efb77631de07c563868273b1bd22b15f63be5 | [
"MIT"
] | null | null | null | aiogram/__init__.py | MrShox777/aiogram | 763efb77631de07c563868273b1bd22b15f63be5 | [
"MIT"
] | null | null | null | import sys
if sys.version_info < (3, 7):
raise ImportError('Your Python version {0} is not supported by aiogram, please install '
'Python 3.7+'.format('.'.join(map(str, sys.version_info[:3]))))
import asyncio
import os
from . import bot
from . import contrib
from . import dispatcher
from . i... | 21.0625 | 92 | 0.663699 |
c2d0905853f9c67d2fd9621498f3d7653b3c962b | 21,275 | py | Python | newcomb.py | jensv/fluxtubestability | 743ec7c43de5371e0ac9d98cec7bcb235703b13d | [
"MIT"
] | null | null | null | newcomb.py | jensv/fluxtubestability | 743ec7c43de5371e0ac9d98cec7bcb235703b13d | [
"MIT"
] | null | null | null | newcomb.py | jensv/fluxtubestability | 743ec7c43de5371e0ac9d98cec7bcb235703b13d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 08 15:36:58 2015
@author: Jens von der Linden
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future.builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, map,... | 40.370019 | 100 | 0.558496 |
357846a51d6146b60c6d5b0d1cea91a44051ff36 | 507 | py | Python | fcm_app/migrations/0012_fcm_concept_id_in_fcm.py | gtsapelas/TRANSrisk_fcm_app | d9d0efc6d693461fda14a71481c6061756527dcb | [
"MIT"
] | null | null | null | fcm_app/migrations/0012_fcm_concept_id_in_fcm.py | gtsapelas/TRANSrisk_fcm_app | d9d0efc6d693461fda14a71481c6061756527dcb | [
"MIT"
] | null | null | null | fcm_app/migrations/0012_fcm_concept_id_in_fcm.py | gtsapelas/TRANSrisk_fcm_app | d9d0efc6d693461fda14a71481c6061756527dcb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-11-10 09:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fcm_app', '0011_auto_20171025_1632'),
]
operations = [
migrations.AddField(
... | 23.045455 | 67 | 0.621302 |
4e9d7739bbe1b683a81b07f1175f23af561ed6e0 | 4,708 | py | Python | qlib/utils/serial.py | majiajue/qlib | 93088485c31508f74dc8e19dfc7a55e906ae9024 | [
"MIT"
] | 8,637 | 2020-09-21T05:07:34.000Z | 2022-03-31T10:02:54.000Z | qlib/utils/serial.py | Sainpse/qlib | 84103c7d43eaa0ff74118a4d05884f659f0548eb | [
"MIT"
] | 711 | 2020-09-21T03:32:44.000Z | 2022-03-31T22:18:42.000Z | qlib/utils/serial.py | Sainpse/qlib | 84103c7d43eaa0ff74118a4d05884f659f0548eb | [
"MIT"
] | 1,569 | 2020-09-21T10:21:08.000Z | 2022-03-31T01:14:12.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import pickle
import dill
from pathlib import Path
from typing import Union
from ..config import C
class Serializable:
"""
Serializable will change the behaviors of pickle.
- It only saves the state whose name **does not** start wit... | 32.027211 | 120 | 0.585599 |
e89788556cf379d733894dc57d258eb0e23f4bb6 | 7,559 | py | Python | minemeld/ft/cofense.py | christian-recordedfuture/minemeld-core | 175e85fba07cec4f7da15a83426ebf04dbc0ff3e | [
"Apache-2.0"
] | 147 | 2016-07-22T18:15:49.000Z | 2022-03-26T23:32:44.000Z | minemeld/ft/cofense.py | christian-recordedfuture/minemeld-core | 175e85fba07cec4f7da15a83426ebf04dbc0ff3e | [
"Apache-2.0"
] | 167 | 2016-07-27T07:02:25.000Z | 2021-12-16T16:26:52.000Z | minemeld/ft/cofense.py | christian-recordedfuture/minemeld-core | 175e85fba07cec4f7da15a83426ebf04dbc0ff3e | [
"Apache-2.0"
] | 112 | 2016-07-22T07:14:29.000Z | 2022-03-24T18:43:12.000Z | # Copyright 2016 Palo Alto Networks, 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.20362 | 109 | 0.617807 |
71bf07895d851a03c1509020f87b12e9d0c73feb | 5,941 | py | Python | leetcode/models/graphql_question_contributor.py | prius/python-leetcode | 5e8bbee0f941ece8188853703d47aad992191456 | [
"MIT"
] | 25 | 2021-09-27T20:13:33.000Z | 2022-03-25T07:12:19.000Z | leetcode/models/graphql_question_contributor.py | iraghavr/python-leetcode | 5e8bbee0f941ece8188853703d47aad992191456 | [
"MIT"
] | 3 | 2021-12-26T00:22:41.000Z | 2022-03-06T17:30:24.000Z | leetcode/models/graphql_question_contributor.py | iraghavr/python-leetcode | 5e8bbee0f941ece8188853703d47aad992191456 | [
"MIT"
] | 6 | 2021-10-16T04:51:45.000Z | 2022-02-24T10:53:55.000Z | # coding: utf-8
"""
Leetcode API
Leetcode API implementation. # noqa: E501
OpenAPI spec version: 1.0.1-1
Contact: pv.safronov@gmail.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import annotations
import pprint
import re # noqa: F401
import six
cla... | 28.980488 | 93 | 0.581215 |
70a312b19b2631d0b0df1c351eb2fb56f6737627 | 746 | py | Python | renewer/aws.py | cloud-gov/legacy-domain-certificate-renewer | 6b008fdc8e1277cfe4449626e6c488d11fc4857c | [
"CC0-1.0"
] | 1 | 2021-11-16T17:25:21.000Z | 2021-11-16T17:25:21.000Z | renewer/aws.py | cloud-gov/legacy-domain-certificate-renewer | 6b008fdc8e1277cfe4449626e6c488d11fc4857c | [
"CC0-1.0"
] | 1 | 2021-12-22T19:04:34.000Z | 2021-12-22T19:04:34.000Z | renewer/aws.py | cloud-gov/legacy-domain-certificate-renewer | 6b008fdc8e1277cfe4449626e6c488d11fc4857c | [
"CC0-1.0"
] | null | null | null | import boto3
from renewer.extensions import config
commercial_session = boto3.Session(
region_name=config.AWS_COMMERCIAL_REGION,
aws_access_key_id=config.AWS_COMMERCIAL_ACCESS_KEY_ID,
aws_secret_access_key=config.AWS_COMMERCIAL_SECRET_ACCESS_KEY,
)
govcloud_session = boto3.Session(
region_name=config.... | 33.909091 | 66 | 0.828418 |
7f76211ceda3f36a544cd20b011a2a4d28a91cb9 | 247,991 | py | Python | tests/test_browser.py | sofu456/emscripten | 1108a8aae24aa2a18c64172e9d7d828b79e6b63f | [
"MIT"
] | 1 | 2021-06-15T20:40:30.000Z | 2021-06-15T20:40:30.000Z | tests/test_browser.py | hanbitmyths/emscripten | e642863ed84f8bfef2ff2c3a45b87dc6b1f0b4f6 | [
"MIT"
] | null | null | null | tests/test_browser.py | hanbitmyths/emscripten | e642863ed84f8bfef2ff2c3a45b87dc6b1f0b4f6 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2013 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.
import argparse
import json
import multiprocessing
imp... | 47.883954 | 310 | 0.646459 |
3c0f89f3ec5e091a5567faf10c0d96a3806118db | 8,788 | py | Python | suapp/moduleloader.py | schilduil/suapp | c6e269fca0ce7af1127d41906ff811b007ad915f | [
"MIT"
] | null | null | null | suapp/moduleloader.py | schilduil/suapp | c6e269fca0ce7af1127d41906ff811b007ad915f | [
"MIT"
] | null | null | null | suapp/moduleloader.py | schilduil/suapp | c6e269fca0ce7af1127d41906ff811b007ad915f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Loads to datamodels of modules.
A module must have a datamodel.py for this to work:
modlib/<module>/datamodel.py
The datamodel.py must have the following elements:
app_name
A string with the name of the app to which this module belongs.
def requ... | 33.670498 | 89 | 0.546541 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.