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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d7e374ebbffe2bdd01da8a74a6487575353e6a3e | 1,961 | py | Python | kr_preprocess/document.py | sybock/KR-Preprocess | 4b190b991b74fcb2bb1c0e8d17be126f845120c9 | [
"CC0-1.0"
] | 2 | 2021-06-28T22:51:54.000Z | 2021-07-14T02:57:53.000Z | kr_preprocess/document.py | sybock/KR-Preprocess | 4b190b991b74fcb2bb1c0e8d17be126f845120c9 | [
"CC0-1.0"
] | null | null | null | kr_preprocess/document.py | sybock/KR-Preprocess | 4b190b991b74fcb2bb1c0e8d17be126f845120c9 | [
"CC0-1.0"
] | null | null | null | import os
import re
import gzip
import logging
logger = logging.getLogger(__name__)
class Document():
def __init__(self, args):
'''
in_path: path of input file
out_path: path of output file. set as '/' if you want to overwrite input file
'''
self.in_path = args.input
... | 33.810345 | 85 | 0.54564 |
ef4e0708cc80680aa5fc7757960c492e54db0be8 | 888 | py | Python | clients/python/generated/test/test_favorite_impl.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 23 | 2017-08-01T12:25:26.000Z | 2022-01-25T03:44:11.000Z | clients/python/generated/test/test_favorite_impl.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 35 | 2017-06-14T03:28:15.000Z | 2022-02-14T10:25:54.000Z | clients/python/generated/test/test_favorite_impl.py | PankTrue/swaggy-jenkins | aca35a7cca6e1fcc08bd399e05148942ac2f514b | [
"MIT"
] | 11 | 2017-08-31T19:00:20.000Z | 2021-12-19T12:04:12.000Z | # coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
OpenAPI spec version: 1.0.1
Contact: blah@cliffano.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import swaggyjenk... | 21.658537 | 85 | 0.701577 |
0508cd9303318566567af6cb6598d2c4e2137aee | 11,936 | py | Python | bindsnet_master/examples/mnist/batch_eth_mnist.py | Singular-Brain/ProjectBrain | 2d22d45c13a86825c0dcaf517a59e02f2c4f6164 | [
"MIT"
] | 6 | 2021-06-01T03:43:35.000Z | 2022-02-11T10:41:06.000Z | bindsnet_master/examples/mnist/batch_eth_mnist.py | Singular-Brain/ProjectBrain | 2d22d45c13a86825c0dcaf517a59e02f2c4f6164 | [
"MIT"
] | 1 | 2022-03-31T03:22:14.000Z | 2022-03-31T03:22:14.000Z | bindsnet_master/examples/mnist/batch_eth_mnist.py | Singular-Brain/ProjectBrain | 2d22d45c13a86825c0dcaf517a59e02f2c4f6164 | [
"MIT"
] | 3 | 2021-10-30T02:30:40.000Z | 2021-11-16T04:23:12.000Z | import os
import torch
import argparse
import numpy as np
import matplotlib.pyplot as plt
from torchvision import transforms
from tqdm import tqdm
from time import time as t
from bindsnet import ROOT_DIR
from bindsnet.datasets import MNIST, DataLoader
from bindsnet.encoding import PoissonEncoder
from bindsnet.evalua... | 31.914439 | 88 | 0.639159 |
1581dcbbb313a2b7406e8c4d3fe645eeb2d5f6b7 | 24,035 | py | Python | tensorflow/python/distribute/collective_all_reduce_strategy_test.py | barathum000/tensorflow-upstream | 1ec5f5f5d8e25e9cdd55cb74ae5af370d653c618 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/collective_all_reduce_strategy_test.py | barathum000/tensorflow-upstream | 1ec5f5f5d8e25e9cdd55cb74ae5af370d653c618 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/collective_all_reduce_strategy_test.py | barathum000/tensorflow-upstream | 1ec5f5f5d8e25e9cdd55cb74ae5af370d653c618 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 40.531197 | 81 | 0.705804 |
01bc5650088e3a6a868218ce560a5f9934f6ab5b | 3,824 | py | Python | syft/workers/tfe.py | theoptips/PySyft | 4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc | [
"Apache-2.0"
] | 1 | 2019-08-27T21:48:50.000Z | 2019-08-27T21:48:50.000Z | syft/workers/tfe.py | theoptips/PySyft | 4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc | [
"Apache-2.0"
] | null | null | null | syft/workers/tfe.py | theoptips/PySyft | 4b68c3c6fbe0c18cdf87dfe6ddc3c2071a71f1cc | [
"Apache-2.0"
] | 1 | 2019-07-06T06:28:49.000Z | 2019-07-06T06:28:49.000Z | """To be extended in the near future."""
from collections import OrderedDict
import logging
import os
import subprocess
import tempfile
import tf_encrypted as tfe
logger = logging.getLogger("tf_encrypted")
_TMP_DIR = tempfile.gettempdir()
class TFEWorker:
# TODO(Morten) this should be turned into a proxy, with... | 34.142857 | 100 | 0.640167 |
9c9679415978300a60e48b93275aac603471ed2f | 25,468 | py | Python | qa/rpc-tests/fundrawtransaction-hd.py | CoinStaging/SharkByte | 3eb3b3ff2250e2433235c7a45d0bbac8784d8617 | [
"MIT"
] | 2 | 2019-11-23T09:36:18.000Z | 2019-11-23T09:48:29.000Z | qa/rpc-tests/fundrawtransaction-hd.py | CoinStaging/SharkByte | 3eb3b3ff2250e2433235c7a45d0bbac8784d8617 | [
"MIT"
] | null | null | null | qa/rpc-tests/fundrawtransaction-hd.py | CoinStaging/SharkByte | 3eb3b3ff2250e2433235c7a45d0bbac8784d8617 | [
"MIT"
] | 1 | 2019-11-28T02:55:30.000Z | 2019-11-28T02:55:30.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... | 40.683706 | 214 | 0.558701 |
48e97bb1bd14eb60d73fb851d000f47ec1cb37c3 | 345 | py | Python | counterfit/frameworks/textattack/improved_ga.py | Mandroide/counterfit | 3252588d45514192edd4444b3bff0bf006f92bf0 | [
"MIT"
] | null | null | null | counterfit/frameworks/textattack/improved_ga.py | Mandroide/counterfit | 3252588d45514192edd4444b3bff0bf006f92bf0 | [
"MIT"
] | null | null | null | counterfit/frameworks/textattack/improved_ga.py | Mandroide/counterfit | 3252588d45514192edd4444b3bff0bf006f92bf0 | [
"MIT"
] | null | null | null | from textattack.attack_recipes.iga_wang_2019 import IGAWang2019
from counterfit.core.state import Attack
class ImprovedGAAttackWrapper(Attack):
attack_cls = IGAWang2019
attack_name = "iga_wang_2019"
attack_type = "evasion"
tags = ["text"]
category = "blackbox"
framework = "textattack"
def... | 24.642857 | 63 | 0.713043 |
0e1276e4e705a06518c0f81251f8c9e004fb6d33 | 23,179 | py | Python | ansible/lib/ansible/modules/core/database/mysql/mysql_user.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/core/database/mysql/mysql_user.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/modules/core/database/mysql/mysql_user.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.com.
#
# This file is part of Ansible
#
# Ansible 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... | 39.219966 | 178 | 0.623797 |
18182ebb1b2f2ad2bcf2259abd8b14684ed14539 | 465 | py | Python | packages/pyre/weaver/TeX.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | packages/pyre/weaver/TeX.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/weaver/TeX.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# access to the pyre package
import pyre
# my ancestor
from .LineMill import LineMill
# my declaration
class TeX(LineMill):
"""
Support for TeX
"""
# traits
languageMarker = pyre.properties.str(... | 14.53125 | 72 | 0.649462 |
db56e6fb20a4ba9979cde9028238feff3898741f | 10,523 | py | Python | st2common/st2common/util/virtualenvs.py | amanda11/st2 | 6c3716bf928c65dc6eb6a8126f21e4fbaffb3680 | [
"Apache-2.0"
] | null | null | null | st2common/st2common/util/virtualenvs.py | amanda11/st2 | 6c3716bf928c65dc6eb6a8126f21e4fbaffb3680 | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | st2common/st2common/util/virtualenvs.py | dgkh1975/st2 | f1430045d87b810f470417706a1f72e751abaf6d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme 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 ... | 34.055016 | 98 | 0.669676 |
d73984cd19d0122516256c5747994cc5f28e6822 | 287 | py | Python | src/store/admin.py | shubham2803/e_commerce | 6b20659614f5c7e108926abafc67618401fcc386 | [
"MIT"
] | null | null | null | src/store/admin.py | shubham2803/e_commerce | 6b20659614f5c7e108926abafc67618401fcc386 | [
"MIT"
] | null | null | null | src/store/admin.py | shubham2803/e_commerce | 6b20659614f5c7e108926abafc67618401fcc386 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Customer,Product,Order,OrderItem,ShippingAddress
# Register your models here.
admin.site.register(Customer)
admin.site.register(Product)
admin.site.register(Order)
admin.site.register(OrderItem)
admin.site.register(ShippingAddress)
| 26.090909 | 68 | 0.832753 |
84db7e257492c6f2f68ed526e5a12dbd0f311b4c | 9,041 | py | Python | generate_namelist.py | jiahe23/SCAMPy | 0f8e9656b043e98c6bd316fda45bcf146bddbcbd | [
"Apache-2.0"
] | null | null | null | generate_namelist.py | jiahe23/SCAMPy | 0f8e9656b043e98c6bd316fda45bcf146bddbcbd | [
"Apache-2.0"
] | null | null | null | generate_namelist.py | jiahe23/SCAMPy | 0f8e9656b043e98c6bd316fda45bcf146bddbcbd | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import pprint
from sys import exit
import uuid
import ast
import copy
#Adapated from PyCLES: https://github.com/pressel/pycles
def main():
parser = argparse.ArgumentParser(prog='Namelist Generator')
parser.add_argument('case_name')
args = parser.parse_args()
case_name = a... | 30.136667 | 101 | 0.663865 |
c4e2998502faef2a6837d047bf890d50947a41cd | 8,121 | py | Python | main.py | rynicric/neural-poet-rnn-demo | e8f686de2eacc9bf12d3db26b20c7ee1eed096a0 | [
"MIT"
] | null | null | null | main.py | rynicric/neural-poet-rnn-demo | e8f686de2eacc9bf12d3db26b20c7ee1eed096a0 | [
"MIT"
] | null | null | null | main.py | rynicric/neural-poet-rnn-demo | e8f686de2eacc9bf12d3db26b20c7ee1eed096a0 | [
"MIT"
] | 2 | 2021-06-21T11:35:22.000Z | 2021-07-03T02:09:30.000Z | import os
import visdom
import torch
import torchnet
import numpy as np
from tqdm import tqdm
from utils.data import build_data
from utils.model import Poet as OurModel
from utils.misc import config_hook
from utils.misc import keep_seed
from utils.misc import load_model_cache
def _composer(model, start_words, comp_ma... | 35.618421 | 94 | 0.603867 |
b713522fac767a28191982af94e46e6657d352ed | 56,575 | py | Python | test/quantization/core/test_workflow_ops.py | svecjan/pytorch | 09d221e8d439bc748b162c028f7eece202688adf | [
"Intel"
] | 3 | 2020-11-06T22:02:36.000Z | 2021-06-25T13:50:47.000Z | test/quantization/core/test_workflow_ops.py | svecjan/pytorch | 09d221e8d439bc748b162c028f7eece202688adf | [
"Intel"
] | 1 | 2021-04-22T18:37:42.000Z | 2021-04-28T00:53:25.000Z | test/quantization/core/test_workflow_ops.py | svecjan/pytorch | 09d221e8d439bc748b162c028f7eece202688adf | [
"Intel"
] | null | null | null | import torch
import math
from typing import Tuple
from torch.quantization import (
FakeQuantize,
MovingAverageMinMaxObserver,
default_observer,
default_affine_fixed_qparams_fake_quant,
)
from torch.quantization._learnable_fake_quantize import _LearnableFakeQuantize
from torch.testing._internal.common_q... | 45.772654 | 131 | 0.625046 |
3f2e9583eb60fe076d77bc305a991cfb6e36ddf6 | 696 | py | Python | Day01-15/code/Day13/multithread2.py | bdfd/Python_Zero2Hero_DS | 9dafe90b8112fdc3d07e1aa02e41ed3f019f733c | [
"MIT"
] | 3 | 2022-01-15T19:06:19.000Z | 2022-01-18T16:47:27.000Z | Day01-15/code/Day13/multithread2.py | bdfd/4.5_Data-Science-Python-Zero2Hero- | 9dafe90b8112fdc3d07e1aa02e41ed3f019f733c | [
"MIT"
] | null | null | null | Day01-15/code/Day13/multithread2.py | bdfd/4.5_Data-Science-Python-Zero2Hero- | 9dafe90b8112fdc3d07e1aa02e41ed3f019f733c | [
"MIT"
] | 1 | 2022-01-09T00:18:49.000Z | 2022-01-09T00:18:49.000Z | """
使用多线程的情况 - 模拟多个下载任务
Version: 0.1
Author: BDFD
Date: 2018-03-20
"""
from random import randint
from threading import Thread
from time import time, sleep
def download_task(filename):
print('开始下载%s...' % filename)
time_to_download = randint(5, 10)
sleep(time_to_download)
print('%s下载完成! 耗费了%d秒' % (f... | 19.885714 | 70 | 0.656609 |
b9e00892ad27d148be039dcd0b1136fdcb64bda5 | 1,950 | py | Python | autokeras/auto/tuner.py | HanxiaoLyu/autokeras | 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74 | [
"MIT"
] | null | null | null | autokeras/auto/tuner.py | HanxiaoLyu/autokeras | 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74 | [
"MIT"
] | null | null | null | autokeras/auto/tuner.py | HanxiaoLyu/autokeras | 2f1f42eeb68c64ff991c0ae2e8253a9305e90f74 | [
"MIT"
] | null | null | null | import copy
import inspect
import tensorflow as tf
import kerastuner
from autokeras import utils
class AutoTuner(kerastuner.Tuner):
"""Modified KerasTuner base class to include preprocessing layers."""
def run_trial(self, trial, hp, fit_args, fit_kwargs):
"""Preprocess the x and y before calling th... | 33.050847 | 82 | 0.644615 |
572fa02c2a2f98bb666d9c060ec5a529676d7ae6 | 680 | py | Python | python/cusignal/radartools/__init__.py | jakirkham/cusignal | 69c4e2a2d7a5fd955c5fb92a2364fd5eeb6cad2e | [
"Apache-2.0"
] | null | null | null | python/cusignal/radartools/__init__.py | jakirkham/cusignal | 69c4e2a2d7a5fd955c5fb92a2364fd5eeb6cad2e | [
"Apache-2.0"
] | null | null | null | python/cusignal/radartools/__init__.py | jakirkham/cusignal | 69c4e2a2d7a5fd955c5fb92a2364fd5eeb6cad2e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020-2021, NVIDIA CORPORATION.
# 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... | 40 | 74 | 0.763235 |
1728bb75860de2749523d10ec0a52a285f1f7be4 | 5,008 | py | Python | animations/hyperspace.py | Furikuda/dcfurs-badge-dc27 | f6b49d9bc3ca07b1dced3b39c23a32c79d9bbb83 | [
"MIT"
] | 22 | 2019-07-04T22:32:40.000Z | 2022-03-30T22:48:50.000Z | animations/hyperspace.py | Furikuda/dcfurs-badge-dc27 | f6b49d9bc3ca07b1dced3b39c23a32c79d9bbb83 | [
"MIT"
] | 3 | 2019-08-14T17:46:29.000Z | 2020-01-04T06:12:39.000Z | animations/hyperspace.py | Furikuda/dcfurs-badge-dc27 | f6b49d9bc3ca07b1dced3b39c23a32c79d9bbb83 | [
"MIT"
] | 9 | 2019-06-24T01:22:11.000Z | 2022-01-04T14:49:19.000Z | ## DranoTheCat's Hyperspace
##
## Tilt badge left to
## Tilt badge right to
## Boop to change speed
##
from random import randrange
#import math
import dcfurs
import badge
import utime
# Each starLight object keeps track of its own settings
class starLight:
def __init__(self, x, y, center_x, center_y):
self.c... | 25.42132 | 91 | 0.571286 |
3b71ec37d7caa57220e216221d380eb3b20cb93f | 4,169 | py | Python | brainiak/io.py | hejiaz/brainiak | d03e7eef537d7a5e99d12fd78e796c7efd94c2a1 | [
"Apache-2.0"
] | null | null | null | brainiak/io.py | hejiaz/brainiak | d03e7eef537d7a5e99d12fd78e796c7efd94c2a1 | [
"Apache-2.0"
] | null | null | null | brainiak/io.py | hejiaz/brainiak | d03e7eef537d7a5e99d12fd78e796c7efd94c2a1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# 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... | 25.420732 | 78 | 0.627489 |
65e2e1c2ae2b2fd9d5901d342b46feacdbf528ac | 11,227 | py | Python | ec2stack/providers/cloudstack/instances.py | sureshanaparti/cloudstack-ec2stack | 8e07435d3d04357995f2a5d337adef62ecbfdd8d | [
"Apache-2.0"
] | 13 | 2015-05-06T13:38:13.000Z | 2021-11-09T21:39:01.000Z | ec2stack/providers/cloudstack/instances.py | sureshanaparti/cloudstack-ec2stack | 8e07435d3d04357995f2a5d337adef62ecbfdd8d | [
"Apache-2.0"
] | 3 | 2015-08-21T17:31:20.000Z | 2021-07-07T08:39:11.000Z | ec2stack/providers/cloudstack/instances.py | sureshanaparti/cloudstack-ec2stack | 8e07435d3d04357995f2a5d337adef62ecbfdd8d | [
"Apache-2.0"
] | 17 | 2015-07-24T06:00:59.000Z | 2021-11-09T21:38:52.000Z | #!/usr/bin/env python
# encoding: 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 Licens... | 27.789604 | 80 | 0.677652 |
2ba2dea28bd5739100d7a7a3019ec8c2d6b08f19 | 18,743 | bzl | Python | internal/npm_install/npm_install.bzl | melindalu/rules_nodejs | 3d55e7b6168bf37c34d1572e98d47fa2cfe8e7a9 | [
"Apache-2.0"
] | null | null | null | internal/npm_install/npm_install.bzl | melindalu/rules_nodejs | 3d55e7b6168bf37c34d1572e98d47fa2cfe8e7a9 | [
"Apache-2.0"
] | 4 | 2022-03-26T04:05:59.000Z | 2022-03-26T11:34:51.000Z | build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl | aspect-dev/rules_nodejs-builds | 87804b694c73c651d92b18509d4c6a830c03f163 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel 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 la... | 39.709746 | 130 | 0.69546 |
e92369a0bebcd053de2e3f8839abc91a2077fb8a | 73,359 | py | Python | tests/unit/modules/test_elasticsearch.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:21.000Z | 2020-01-02T09:03:21.000Z | tests/unit/modules/test_elasticsearch.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 3 | 2015-03-31T14:44:05.000Z | 2015-06-18T19:02:24.000Z | tests/unit/modules/test_elasticsearch.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Lukas Raska <lukas@raska.me>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
# ... | 32.359506 | 111 | 0.528756 |
be349e3fb8ba16a8a1f73a4156e8dae36b7222ee | 600 | py | Python | plotly/validators/splom/marker/colorbar/titlefont/_family.py | paulamool/plotly.py | 6121ac1f324e247e4e4b2964d65d7393377777c0 | [
"MIT"
] | 1 | 2018-08-29T02:52:43.000Z | 2018-08-29T02:52:43.000Z | plotly/validators/splom/marker/colorbar/titlefont/_family.py | paulamool/plotly.py | 6121ac1f324e247e4e4b2964d65d7393377777c0 | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/splom/marker/colorbar/titlefont/_family.py | skeptycal/plotly.py | 2e5bf6e2f7c213295c405ece3e859f4d3f8030d1 | [
"MIT"
] | 1 | 2019-02-14T05:18:20.000Z | 2019-02-14T05:18:20.000Z | import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name='family',
parent_name='splom.marker.colorbar.titlefont',
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_name=... | 28.571429 | 68 | 0.601667 |
07bbeacbdfe0a8928a9de2419df812a80813ae19 | 34,246 | py | Python | src/python/turicreate/toolkits/text_analytics/_util.py | pappasG/turicreate | 494e313957a6c01333628b182a7d5bc6efea18f8 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/toolkits/text_analytics/_util.py | pappasG/turicreate | 494e313957a6c01333628b182a7d5bc6efea18f8 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/toolkits/text_analytics/_util.py | pappasG/turicreate | 494e313957a6c01333628b182a7d5bc6efea18f8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
from... | 41.310012 | 4,877 | 0.594405 |
f24937bcd2d5688511d4a8d0c67f5318f335c0e2 | 190 | py | Python | HackerRank/Algorithms/02_Implementation/16_Extra_Long_Factorials.py | Zubieta/CPP | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 8 | 2017-03-02T07:56:45.000Z | 2021-08-07T20:20:19.000Z | HackerRank/Algorithms/02_Implementation/16_Extra_Long_Factorials.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | null | null | null | HackerRank/Algorithms/02_Implementation/16_Extra_Long_Factorials.py | zubie7a/Algorithms | fb4a3cbf2e4edcc590df15663cd28fb9ecab679c | [
"MIT"
] | 1 | 2021-08-07T20:20:20.000Z | 2021-08-07T20:20:20.000Z | # https://www.hackerrank.com/challenges/extra-long-factorials
n = int(raw_input())
res = 1
# Factorial in Python, easy because big integers :-P
for i in range(1,n+1):
res *= i
print res
| 23.75 | 61 | 0.7 |
b975bf846f7e2c7a492e18ed6fed709fb350df13 | 2,892 | py | Python | code/bathymetry.py | jessecusack/LeConte_postprocessing | 1f1a1dc0541033fc83d5953b0a06c6695ae8036d | [
"MIT"
] | 1 | 2020-11-12T18:33:16.000Z | 2020-11-12T18:33:16.000Z | code/bathymetry.py | jessecusack/LeConte_postprocessing | 1f1a1dc0541033fc83d5953b0a06c6695ae8036d | [
"MIT"
] | null | null | null | code/bathymetry.py | jessecusack/LeConte_postprocessing | 1f1a1dc0541033fc83d5953b0a06c6695ae8036d | [
"MIT"
] | null | null | null | import os
import xarray as xr
from munch import munchify
import clargs
import utils
############### PRELIMINARIES ################
# Parse command line arguments
args = clargs.parse_check_args()
sdroot = args.save
files = utils.find_files(args, "bathymetry")
params = utils.load_parameters()
############### LOAD ... | 33.241379 | 88 | 0.592324 |
56ebaa5776c90b516fcceecf027416ecdab1c43e | 5,987 | py | Python | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/sub_transaction_limit_removal/sub_transaction_limit_scenario/test_func_sub_transaction_limit_removal.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2017-09-15T06:09:56.000Z | 2017-09-15T06:09:56.000Z | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/sub_transaction_limit_removal/sub_transaction_limit_scenario/test_func_sub_transaction_limit_removal.py | guofengrichard/gpdb | 29bdd6ef38d8d9b9cb04ca31d44e279eb9f640d3 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/sub_transaction_limit_removal/sub_transaction_limit_scenario/test_func_sub_transaction_limit_removal.py | guofengrichard/gpdb | 29bdd6ef38d8d9b9cb04ca31d44e279eb9f640d3 | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2018-12-04T09:13:57.000Z | 2018-12-04T09:13:57.000Z | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | 43.384058 | 142 | 0.732587 |
dd77bdd59b78dc72e42bfb980537d80607bee77b | 248 | py | Python | tests/test_sample.py | deusebio/python-ci-template | 3f05c8d1a90a4f4f7690a5fe01589ba334aa4774 | [
"MIT"
] | 6 | 2022-02-15T10:12:26.000Z | 2022-03-13T19:05:10.000Z | tests/test_sample.py | deusebio/python-ci-template | 3f05c8d1a90a4f4f7690a5fe01589ba334aa4774 | [
"MIT"
] | 41 | 2021-12-21T22:50:24.000Z | 2022-03-31T17:02:49.000Z | tests/test_sample.py | deusebio/python-ci-template | 3f05c8d1a90a4f4f7690a5fe01589ba334aa4774 | [
"MIT"
] | 1 | 2022-03-17T13:11:50.000Z | 2022-03-17T13:11:50.000Z | """Sample test module."""
import unittest
class TestTrue(unittest.TestCase):
"""Sample test class."""
def test_true(self):
"""Sample test method."""
self.assertEqual(1, 1)
if __name__ == "__main__":
unittest.main()
| 16.533333 | 34 | 0.616935 |
74fecee9ec3f008bc9d32b27dcecf5a61763a087 | 8,734 | py | Python | husk_experiment_scripts/ben-finetuning.py | YashBit/generalized-hindsight | 2ba2e1ba0caa20b71d01c8ad70fbc7f47d61bd6c | [
"MIT"
] | null | null | null | husk_experiment_scripts/ben-finetuning.py | YashBit/generalized-hindsight | 2ba2e1ba0caa20b71d01c8ad70fbc7f47d61bd6c | [
"MIT"
] | null | null | null | husk_experiment_scripts/ben-finetuning.py | YashBit/generalized-hindsight | 2ba2e1ba0caa20b71d01c8ad70fbc7f47d61bd6c | [
"MIT"
] | null | null | null | """Script for launching DIAYN experiments.
Usage:
python mujoco_all_diayn.py --env=point --snapshot_dir=<snapshot_dir> --log_dir=/dev/null
"""
from rllab.misc.instrument import VariantGenerator
from sac.algos import SAC
from sac.envs.meta_env import FixedOptionEnv
from sac.misc.instrument import run_sac_experime... | 30.117241 | 108 | 0.575223 |
33976d2f6749950449a86435c98f3773ff90757b | 9,794 | py | Python | insights/client/archive.py | TZ3070/insights-core | 13f4fc6bfcb89d76f0255c6259902360a298d619 | [
"Apache-2.0"
] | null | null | null | insights/client/archive.py | TZ3070/insights-core | 13f4fc6bfcb89d76f0255c6259902360a298d619 | [
"Apache-2.0"
] | null | null | null | insights/client/archive.py | TZ3070/insights-core | 13f4fc6bfcb89d76f0255c6259902360a298d619 | [
"Apache-2.0"
] | null | null | null | """
Handle adding files and preparing the archive for upload
"""
from __future__ import absolute_import
import glob
from signal import SIGTERM, signal
import sys
import time
import os
import shutil
import subprocess
import shlex
import logging
import tempfile
import re
import atexit
from .utilities import determine_ho... | 35.614545 | 104 | 0.603839 |
897874e87f442168db075d9ec845404efdf1b0f5 | 431 | py | Python | config/migrations/0002_sidebar_status.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | null | null | null | config/migrations/0002_sidebar_status.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | 7 | 2020-06-05T16:37:46.000Z | 2022-03-11T23:11:36.000Z | config/migrations/0002_sidebar_status.py | atlednolispe/blog | d3926e424d544f3e9a3805b16a15072ac6c6a780 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-14 11:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('config', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='sidebar',
name='status',
fie... | 22.684211 | 108 | 0.584687 |
a71bfe0b92209c23bde2b36cdd3909ccd4e7204b | 8,790 | py | Python | third_party/WebKit/Tools/Scripts/webkitpy/common/system/log_testing.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | third_party/WebKit/Tools/Scripts/webkitpy/common/system/log_testing.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | third_party/WebKit/Tools/Scripts/webkitpy/common/system/log_testing.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | 37.564103 | 80 | 0.675085 |
1eac2e945c5b105d2a50f8f3955076250d863a72 | 743 | py | Python | test/cherrypy_ssl_server_test.py | mitainesoft/mitzon | fdd1a53947b3b1b99c0f680e1dc4b0bfb089a961 | [
"Apache-2.0",
"MIT"
] | null | null | null | test/cherrypy_ssl_server_test.py | mitainesoft/mitzon | fdd1a53947b3b1b99c0f680e1dc4b0bfb089a961 | [
"Apache-2.0",
"MIT"
] | 4 | 2016-12-28T20:11:29.000Z | 2017-03-08T00:49:23.000Z | test/cherrypy_ssl_server_test.py | mitainesoft/mitzon | fdd1a53947b3b1b99c0f680e1dc4b0bfb089a961 | [
"Apache-2.0",
"MIT"
] | null | null | null | import cherrypy
# try:
from cheroot.wsgi import Server as WSGIServer
# except ImportError:
# from cherrypy.wsgiserver import CherryPyWSGIServer as WSGIServer
class RootServer:
@cherrypy.expose
def index(self, **keywords):
return "it works!"
if __name__ == '__main__':
server_config={
'serv... | 27.518519 | 82 | 0.697174 |
bd3a45c27f409ac936ba87797c71b9c07952be3c | 16,242 | py | Python | pynamodb/tests/test_table_connection.py | ikonst/PynamoDB | cd705cc4e0e3dd365c7e0773f6bc02fe071a0631 | [
"MIT"
] | null | null | null | pynamodb/tests/test_table_connection.py | ikonst/PynamoDB | cd705cc4e0e3dd365c7e0773f6bc02fe071a0631 | [
"MIT"
] | null | null | null | pynamodb/tests/test_table_connection.py | ikonst/PynamoDB | cd705cc4e0e3dd365c7e0773f6bc02fe071a0631 | [
"MIT"
] | null | null | null | """
Test suite for the table class
"""
import six
from pynamodb.compat import CompatTestCase as TestCase
from pynamodb.connection import TableConnection
from pynamodb.constants import DEFAULT_REGION
from pynamodb.tests.data import DESCRIBE_TABLE_DATA, GET_ITEM_DATA
from pynamodb.tests.response import HttpOK
if six.PY3... | 34.929032 | 117 | 0.44779 |
93fde92fd33ef9072b1b0ea784fcadd17f170fff | 2,200 | py | Python | 文字绘制/main.py | LZY2006/pygame-small-games | 41c97a67f3781d4691b822b4fbdafa310f785938 | [
"MIT"
] | null | null | null | 文字绘制/main.py | LZY2006/pygame-small-games | 41c97a67f3781d4691b822b4fbdafa310f785938 | [
"MIT"
] | null | null | null | 文字绘制/main.py | LZY2006/pygame-small-games | 41c97a67f3781d4691b822b4fbdafa310f785938 | [
"MIT"
] | null | null | null | import sys,pygame
import pygame.freetype as pf
import random
from os import sep
pygame.init()
size=600,400
screen=pygame.display.set_mode(size)
pygame.display.set_caption("pygame屏幕绘制")
BLACK=pygame.Color("white")
GOLD=pygame.Color("gold")
GREEN=pygame.Color("green")
RED=pygame.Color("red")
#msyh.ttc
Font=pf.Font("F... | 26.506024 | 79 | 0.524091 |
fd4ba340061f6998c20a3e3ec35cb667e6d63f65 | 453 | py | Python | solutions/025/025.py | jwmcgettigan/project-euler-solutions | f06b6551e713619d5fd1359ee2f96fcff61c425b | [
"FTL"
] | 1 | 2020-08-21T00:30:17.000Z | 2020-08-21T00:30:17.000Z | solutions/025/025.py | jwmcgettigan/project-euler-solutions | f06b6551e713619d5fd1359ee2f96fcff61c425b | [
"FTL"
] | 2 | 2020-09-18T00:40:01.000Z | 2020-09-21T04:13:05.000Z | solutions/025/025.py | jwmcgettigan/project-euler-solutions | f06b6551e713619d5fd1359ee2f96fcff61c425b | [
"FTL"
] | null | null | null | """
Project Euler - Problem Solution 025
Copyright (c) Justin McGettigan. All rights reserved.
https://github.com/jwmcgettigan/project-euler-solutions
"""
def newTerms(f): return [f[1], f[0] + f[1]]
def index_of_1000_digit_fibonacci_value():
# repurposed from problem 002
index, f = 1, [1, 1]
while(len(str(f[0]))... | 26.647059 | 55 | 0.699779 |
b4ee21e87e8529d05c3fec3470dbb8bc713e5992 | 4,128 | py | Python | day-16/part-2/thomas.py | badouralix/adventofcode-2018 | 543ce39d4eeb7d9d695459ffadca001a8c56386d | [
"MIT"
] | 31 | 2018-12-01T00:43:40.000Z | 2020-05-30T05:18:59.000Z | day-16/part-2/thomas.py | badouralix/adventofcode-2018 | 543ce39d4eeb7d9d695459ffadca001a8c56386d | [
"MIT"
] | 14 | 2018-12-01T12:14:26.000Z | 2021-05-07T22:41:47.000Z | day-16/part-2/thomas.py | badouralix/adventofcode-2018 | 543ce39d4eeb7d9d695459ffadca001a8c56386d | [
"MIT"
] | 10 | 2018-12-01T23:38:34.000Z | 2020-12-28T13:36:10.000Z | from tool.runners.python import SubmissionPy
class VM:
def __init__(self):
self.registers = [0] * 4
self.ops = {
"addr": self.addr,
"addi": self.addi,
"mulr": self.mulr,
"muli": self.muli,
"banr": self.banr,
"bani": self.bani,... | 31.51145 | 88 | 0.531492 |
b6c27fc1f1aca7e6dc3c20c9eeea5e219b8d514c | 1,498 | py | Python | prismriver/plugin/absolutelyrics.py | anlar/prismriver-lyrics | b9adb7f860fc5bf0fc41029a8e9e472aa262a0f4 | [
"MIT"
] | 16 | 2016-11-08T03:31:37.000Z | 2021-11-17T20:00:56.000Z | prismriver/plugin/absolutelyrics.py | odrling/prismriver-lyrics | 995b687b1e795298ce5e31348120c510f99a378f | [
"MIT"
] | 5 | 2016-06-14T19:59:57.000Z | 2021-01-24T10:35:43.000Z | prismriver/plugin/absolutelyrics.py | odrling/prismriver-lyrics | 995b687b1e795298ce5e31348120c510f99a378f | [
"MIT"
] | 5 | 2016-06-14T18:01:20.000Z | 2021-02-24T05:52:31.000Z | from prismriver.plugin.common import Plugin
from prismriver.struct import Song
class AbsoluteLyricsPlugin(Plugin):
ID = 'absolutelyrics'
def __init__(self, config):
super(AbsoluteLyricsPlugin, self).__init__('AbsoluteLyrics', config)
def search_song(self, artist, title):
to_delete = ['?'... | 37.45 | 104 | 0.616822 |
32a87a0afc4ae2b46f0bf8ffa2ed8044bf74bacb | 520 | py | Python | FeVER/test/normalize_test.py | flyaway1217/FeVER | cd4a82cb2f2405671e53cecafcf59cda30eff8eb | [
"Apache-2.0"
] | null | null | null | FeVER/test/normalize_test.py | flyaway1217/FeVER | cd4a82cb2f2405671e53cecafcf59cda30eff8eb | [
"Apache-2.0"
] | null | null | null | FeVER/test/normalize_test.py | flyaway1217/FeVER | cd4a82cb2f2405671e53cecafcf59cda30eff8eb | [
"Apache-2.0"
] | null | null | null | # !/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# Author: Yichu Zhou - flyaway1217@gmail.com
# Blog: zhouyichu.com
#
# Python release: 3.6.0
#
# Date: 2018-09-26 13:27:28
# Last modified: 2018-09-27 13:25:23
"""
Normalize
"""
import torch
import torch.nn as nn
weight = [[3, 4], [5, 12], [3, 6]]
weight = torch.Float... | 17.333333 | 62 | 0.682692 |
ade1462f12cdedd71261e2b5d577f1de309b5e02 | 3,501 | py | Python | bindings/python/ensmallen/datasets/string/lawsonellaclevelandensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/lawsonellaclevelandensis.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/lawsonellaclevelandensis.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Lawsonella clevelandensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prot... | 33.342857 | 223 | 0.680377 |
40f77061b2ad02054f9eb6e9a7e09b99c817063f | 1,756 | py | Python | reproduction/text_classification/train_lstm.py | KuNyaa/fastNLP | 22f9b87c54a4eebec7352c7ff772cd24685c7186 | [
"Apache-2.0"
] | 1 | 2019-10-05T06:02:44.000Z | 2019-10-05T06:02:44.000Z | reproduction/text_classification/train_lstm.py | awesomemachinelearning/fastNLP | 945b30bb6174751130744231aa26119bf9bb2601 | [
"Apache-2.0"
] | 1 | 2019-12-09T06:34:44.000Z | 2019-12-09T06:34:44.000Z | reproduction/text_classification/train_lstm.py | awesomemachinelearning/fastNLP | 945b30bb6174751130744231aa26119bf9bb2601 | [
"Apache-2.0"
] | null | null | null | # 首先需要加入以下的路径到环境变量,因为当前只对内部测试开放,所以需要手动申明一下路径
import os
os.environ['FASTNLP_BASE_URL'] = 'http://10.141.222.118:8888/file/download/'
os.environ['FASTNLP_CACHE_DIR'] = '/remote-home/hyan01/fastnlp_caches'
from fastNLP.io.data_loader import IMDBLoader
from fastNLP.embeddings import StaticEmbedding
from model.lstm import ... | 29.762712 | 135 | 0.747153 |
8a2340c586b012397eac91305973244214dc5ead | 15,080 | py | Python | reviewboard/reviews/management/commands/fill-database.py | vigneshsrinivasan/reviewboard | 4775130c1c1022f81edc11928e02b1b6c069f6ed | [
"MIT"
] | 1 | 2020-02-11T07:09:14.000Z | 2020-02-11T07:09:14.000Z | reviewboard/reviews/management/commands/fill-database.py | vigneshsrinivasan/reviewboard | 4775130c1c1022f81edc11928e02b1b6c069f6ed | [
"MIT"
] | null | null | null | reviewboard/reviews/management/commands/fill-database.py | vigneshsrinivasan/reviewboard | 4775130c1c1022f81edc11928e02b1b6c069f6ed | [
"MIT"
] | null | null | null | import os
import random
import string
import sys
from optparse import make_option
from django import forms
from django import db
from django.contrib.auth.models import User
from django.core.management.base import (
BaseCommand, CommandError, NoArgsCommand )
from django.db import transaction
from reviewboard.accou... | 44.352941 | 80 | 0.536472 |
8d9f8ff4ed25ff8e4430f8f2ad341670d808b8c2 | 1,317 | py | Python | fixture/session.py | mariagrudinina/python_training | cd8a4810cf62dbe8de235d90bca508b1d4e17738 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | mariagrudinina/python_training | cd8a4810cf62dbe8de235d90bca508b1d4e17738 | [
"Apache-2.0"
] | null | null | null | fixture/session.py | mariagrudinina/python_training | cd8a4810cf62dbe8de235d90bca508b1d4e17738 | [
"Apache-2.0"
] | null | null | null | class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").clear()
wd.find_element_by_name("user").send_keys(username)
wd.find_element_by_name("pass... | 30.627907 | 73 | 0.613516 |
b09ceb162a465f41a3ff20dff640d57fba85b1d5 | 10,858 | py | Python | test/functional/wallet_import_rescan.py | hiphopcoin24/hiphopcoin24 | 09b780546ba9e28b452a8641863aafa90def40d1 | [
"MIT"
] | null | null | null | test/functional/wallet_import_rescan.py | hiphopcoin24/hiphopcoin24 | 09b780546ba9e28b452a8641863aafa90def40d1 | [
"MIT"
] | null | null | null | test/functional/wallet_import_rescan.py | hiphopcoin24/hiphopcoin24 | 09b780546ba9e28b452a8641863aafa90def40d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Hiphopcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet import RPCs.
Test rescan behavior of importaddress, importpubkey, importprivkey, and
im... | 47.004329 | 126 | 0.665684 |
eb720fd1be38350e7a5e0b1b986217bb484f53b2 | 19,599 | py | Python | utils/sync_pagerduty_policies.py | dark-vex/sysdig-sdk-python | 52962a0c283ca12b93a743ae8c5d1639a12b0998 | [
"MIT"
] | 45 | 2016-04-11T16:50:15.000Z | 2020-07-11T23:37:51.000Z | utils/sync_pagerduty_policies.py | dark-vex/sysdig-sdk-python | 52962a0c283ca12b93a743ae8c5d1639a12b0998 | [
"MIT"
] | 74 | 2016-08-09T17:10:55.000Z | 2020-07-09T08:36:16.000Z | utils/sync_pagerduty_policies.py | dark-vex/sysdig-sdk-python | 52962a0c283ca12b93a743ae8c5d1639a12b0998 | [
"MIT"
] | 39 | 2016-04-20T17:22:23.000Z | 2020-07-08T17:25:52.000Z | #!/usr/bin/env python
#
# Synchronize list of escalation policies with notification channels in Sysdig
#
import argparse
import copy
import json
import sys
from functools import reduce
import requests
from sdcclient import SdMonitorClient
#
# Parse arguments
#
parser = argparse.ArgumentParser(description='Synchroniz... | 39.916497 | 120 | 0.50574 |
87da76a1de8d9ef749ed3222eede4aca8406b712 | 8,273 | py | Python | tuf/keydb.py | ponyville/tuf | aa71ae6c0dd80ebb3a9da8d36eae14d82f13723e | [
"MIT"
] | null | null | null | tuf/keydb.py | ponyville/tuf | aa71ae6c0dd80ebb3a9da8d36eae14d82f13723e | [
"MIT"
] | null | null | null | tuf/keydb.py | ponyville/tuf | aa71ae6c0dd80ebb3a9da8d36eae14d82f13723e | [
"MIT"
] | null | null | null | """
<Program Name>
keydb.py
<Author>
Vladimir Diaz <vladimir.v.diaz@gmail.com>
<Started>
March 21, 2012. Based on a previous version of this module by Geremy Condra.
<Copyright>
See LICENSE for licensing information.
<Purpose>
Represent a collection of keys and their organization. This module ensures
... | 29.441281 | 84 | 0.699867 |
ad7904a5a0780d55f6cd8f62c0a6ae79d709e7a8 | 4,048 | py | Python | oqtans_tools/KIRMES/0.8/src/Gibbs.py | vipints/oqtans | af8119a73f6023deca57aedb9b090f7378a1a6c6 | [
"BSD-3-Clause"
] | 3 | 2015-11-20T19:40:29.000Z | 2019-07-25T15:34:24.000Z | oqtans_tools/KIRMES/0.8/src/Gibbs.py | vipints/oqtans | af8119a73f6023deca57aedb9b090f7378a1a6c6 | [
"BSD-3-Clause"
] | null | null | null | oqtans_tools/KIRMES/0.8/src/Gibbs.py | vipints/oqtans | af8119a73f6023deca57aedb9b090f7378a1a6c6 | [
"BSD-3-Clause"
] | 2 | 2018-09-20T08:28:36.000Z | 2019-03-06T06:26:52.000Z | #############################################################################################
# #
# This class is part of the metaTFBS ExpressionAnalysis package. #
# Copyright (C) 2006 - 2007 Sebasti... | 62.276923 | 111 | 0.414279 |
a2ce96bd12f2fc1e74667cdaa4ea58c685236ff9 | 430 | py | Python | urduhack/tokenization/tests/test_words.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 252 | 2018-08-20T16:16:45.000Z | 2022-03-04T07:03:58.000Z | urduhack/tokenization/tests/test_words.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 111 | 2019-01-21T11:39:45.000Z | 2021-09-30T07:26:50.000Z | urduhack/tokenization/tests/test_words.py | cinfotech94/urduhackk | 44500cd6a78e1a7765bb4f7d6fb92bbb612b7b11 | [
"MIT"
] | 35 | 2019-02-09T14:29:36.000Z | 2022-01-09T10:02:56.000Z | # coding: utf8
"""Test Cases for words"""
from urduhack.tokenization.words import WORDS_SPACE
from urduhack.urdu_characters import URDU_ALPHABETS
def test_words():
"""Test Case"""
for key, value in WORDS_SPACE.items():
for char in key:
if char != ' ':
assert char in URDU_A... | 25.294118 | 51 | 0.604651 |
45f9c00f67384b5bf4dbd4cb953ef4c182744997 | 36,422 | py | Python | sympy/sets/tests/test_fancysets.py | iamabhishek0/sympy | c461bd1ff9d178d1012b04fd0bf37ee3abb02cdd | [
"BSD-3-Clause"
] | 2 | 2019-12-16T16:02:58.000Z | 2020-01-20T04:07:18.000Z | sympy/sets/tests/test_fancysets.py | iamabhishek0/sympy | c461bd1ff9d178d1012b04fd0bf37ee3abb02cdd | [
"BSD-3-Clause"
] | null | null | null | sympy/sets/tests/test_fancysets.py | iamabhishek0/sympy | c461bd1ff9d178d1012b04fd0bf37ee3abb02cdd | [
"BSD-3-Clause"
] | null | null | null | from sympy.core.compatibility import range, PY3
from sympy.core.expr import unchanged
from sympy.sets.fancysets import (ImageSet, Range, normalize_theta_set,
ComplexRegion)
from sympy.sets.sets import (FiniteSet, Interval, imageset, Union,
Intersection, Pro... | 38.098326 | 104 | 0.615782 |
23edbdd865e79d4c86d23f73676e796a4439cfb7 | 1,366 | py | Python | smlcs/helper/gen_clf_config.py | AnandBhatUpb/smlcs-final-submission | 54d810d2ed1dc5907973ce55d93d318bec0d4011 | [
"Apache-2.0"
] | null | null | null | smlcs/helper/gen_clf_config.py | AnandBhatUpb/smlcs-final-submission | 54d810d2ed1dc5907973ce55d93d318bec0d4011 | [
"Apache-2.0"
] | null | null | null | smlcs/helper/gen_clf_config.py | AnandBhatUpb/smlcs-final-submission | 54d810d2ed1dc5907973ce55d93d318bec0d4011 | [
"Apache-2.0"
] | null | null | null | import json
def gen_clf_config():
classifier_config = dict()
classifier_config['classifiers'] = []
classifier_config['innercv_folds'] = 10
rf_grid = {'n_estimators': (1000, 2000),
'max_features': (50, 70),
'max_depth': (15, 30),
'min_samples_split': (2, 10... | 25.773585 | 69 | 0.535139 |
ef03e9be78abc12f25560246f9dd0ff52265a3fc | 2,418 | py | Python | pandas/tests/indexes/interval/test_interval_overlaps_covers.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/interval/test_interval_overlaps_covers.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/interval/test_interval_overlaps_covers.py | zfrenchee/pandas | d28f9326de26882a9b4dc0bee9dec5c598747190 | [
"BSD-3-Clause"
] | 1 | 2019-03-31T13:46:57.000Z | 2019-03-31T13:46:57.000Z | from __future__ import division
import pytest
import numpy as np
from pandas import IntervalIndex
from pandas.tests.indexes.common import Base
import pandas.util.testing as tm
pytestmark = pytest.mark.skip(reason="new indexing tests for issue 16316")
class TestIntervalIndex(Base):
def _compare_tuple_of_numpy_... | 37.78125 | 79 | 0.527295 |
c29e11ac53794fdf005637b58c72450cbf4e789e | 12,218 | py | Python | python/GafferSceneUI/HierarchyView.py | ivanimanishi/gaffer | 7cfd79d2f20c25ed1d680730de9d6a2ee356dd4c | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneUI/HierarchyView.py | ivanimanishi/gaffer | 7cfd79d2f20c25ed1d680730de9d6a2ee356dd4c | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneUI/HierarchyView.py | ivanimanishi/gaffer | 7cfd79d2f20c25ed1d680730de9d6a2ee356dd4c | [
"BSD-3-Clause"
] | 1 | 2020-12-21T12:33:49.000Z | 2020-12-21T12:33:49.000Z | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 36.912387 | 156 | 0.70167 |
8407721effaf780a26ae656e9cbdcbd953cd81ea | 7,152 | py | Python | src/sentry/api/endpoints/project_release_files.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/api/endpoints/project_release_files.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/api/endpoints/project_release_files.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import re
import logging
from django.db import IntegrityError, transaction
from django.db.models import Q
from six import BytesIO
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint, ProjectRele... | 37.445026 | 99 | 0.607942 |
5f7d7f368c2724bd8d2fa7ba19436f1d588ab8a9 | 14,032 | py | Python | tests/unit/integration/vulnerabilities/test_utils.py | Liath/warehouse | 3943226cf1168f5cead40913d42603e9d1f25010 | [
"Apache-2.0"
] | null | null | null | tests/unit/integration/vulnerabilities/test_utils.py | Liath/warehouse | 3943226cf1168f5cead40913d42603e9d1f25010 | [
"Apache-2.0"
] | null | null | null | tests/unit/integration/vulnerabilities/test_utils.py | Liath/warehouse | 3943226cf1168f5cead40913d42603e9d1f25010 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 34.561576 | 143 | 0.643885 |
279d13260575a3d4b986e08af078b099cb9a63ca | 2,740 | py | Python | wrk2img/parser.py | PPACI/wrk2img | 15b8232ebf8d5ea1ddab30845016c84bd7a5258e | [
"MIT"
] | 22 | 2018-08-15T17:08:43.000Z | 2022-03-08T06:34:21.000Z | wrk2img/parser.py | farquet/wrk2img | 57695f3dab915dc859a3727b8a6d4d748e5c18eb | [
"MIT"
] | 6 | 2018-12-18T04:33:12.000Z | 2019-11-06T09:21:11.000Z | wrk2img/parser.py | farquet/wrk2img | 57695f3dab915dc859a3727b8a6d4d748e5c18eb | [
"MIT"
] | 1 | 2019-10-04T00:23:24.000Z | 2019-10-04T00:23:24.000Z | import re
import sys
from enum import Enum
from typing import Dict, Tuple
class RegexLibrary(Enum):
website = r"Running \d+. test @ https?://(.+?)[/\n]"
req_s = r" *Requests/sec: +(\d+\.?\d*)"
latency = r" +(\d+\.?\d*)% +(\d+\.?\d*)(\w+)"
detailed_latency = r" +([\d\.]+) +([\d\.]+) +[\d\.]+ +[\d\.inf]... | 40.294118 | 119 | 0.590511 |
ee2f6c98c35d15b31b6adddaa2177a31e125d9e4 | 4,340 | py | Python | services/arguments/pretrained_arguments_service.py | ktodorov/historical-ocr | d4d7bf0addf5ff98b7182c00ff716e79c97e050e | [
"MIT"
] | null | null | null | services/arguments/pretrained_arguments_service.py | ktodorov/historical-ocr | d4d7bf0addf5ff98b7182c00ff716e79c97e050e | [
"MIT"
] | null | null | null | services/arguments/pretrained_arguments_service.py | ktodorov/historical-ocr | d4d7bf0addf5ff98b7182c00ff716e79c97e050e | [
"MIT"
] | null | null | null | from overrides import overrides
import argparse
from services.arguments.arguments_service_base import ArgumentsServiceBase
from enums.metric_type import MetricType
from enums.configuration import Configuration
from enums.pretrained_model import PretrainedModel
class PretrainedArgumentsService(ArgumentsServiceBase):... | 48.222222 | 170 | 0.686175 |
e244dc98ca32b9a66ee43d5ef4fb7b75279e2107 | 1,451 | py | Python | kitsune/upload/models.py | Corporex/kitsune | e12064de2f1bc0fb43d319944545bd3aa8493de0 | [
"BSD-3-Clause"
] | 1 | 2020-05-08T10:01:30.000Z | 2020-05-08T10:01:30.000Z | kitsune/upload/models.py | Corporex/kitsune | e12064de2f1bc0fb43d319944545bd3aa8493de0 | [
"BSD-3-Clause"
] | 32 | 2021-04-15T22:35:58.000Z | 2022-01-04T21:30:05.000Z | kitsune/upload/models.py | Corporex/kitsune | e12064de2f1bc0fb43d319944545bd3aa8493de0 | [
"BSD-3-Clause"
] | 1 | 2019-08-31T05:47:57.000Z | 2019-08-31T05:47:57.000Z | from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from kitsune.sumo.templatetags.jinja_helpers import reverse
from kitsune.sumo.models impo... | 37.205128 | 75 | 0.73122 |
99e2312bc0225d2e62254f133eff6977792a8a8c | 4,353 | py | Python | caffe2/python/operator_test/activation_ops_test.py | KevinKecc/caffe2 | a2b6c6e2f0686358a84277df65e9489fb7d9ddb2 | [
"Apache-2.0"
] | 58 | 2019-01-03T02:20:41.000Z | 2022-02-25T14:24:13.000Z | caffe2/python/operator_test/activation_ops_test.py | KevinKecc/caffe2 | a2b6c6e2f0686358a84277df65e9489fb7d9ddb2 | [
"Apache-2.0"
] | 27 | 2018-04-14T06:44:22.000Z | 2018-08-01T18:02:39.000Z | caffe2/python/operator_test/activation_ops_test.py | KevinKecc/caffe2 | a2b6c6e2f0686358a84277df65e9489fb7d9ddb2 | [
"Apache-2.0"
] | 23 | 2018-04-13T10:47:31.000Z | 2021-05-06T08:38:06.000Z | # Copyright (c) 2016-present, Facebook, 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... | 34.547619 | 78 | 0.566506 |
1b5c75c1481733089818bde193262b831c2fde11 | 21,686 | py | Python | tests/tensor/nnet/test_corr3d.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | 1 | 2020-12-30T19:12:52.000Z | 2020-12-30T19:12:52.000Z | tests/tensor/nnet/test_corr3d.py | luke14free/Theano-PyMC | 511c778f8a595444e009bcad738d552413b16f2c | [
"BSD-3-Clause"
] | null | null | null | tests/tensor/nnet/test_corr3d.py | luke14free/Theano-PyMC | 511c778f8a595444e009bcad738d552413b16f2c | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
import theano
import theano.tensor as tt
from tests import unittest_tools as utt
from tests.tensor.nnet.test_abstract_conv import TestGroupedConv3dNoOptim
from theano.tensor.nnet import conv, corr3d
@pytest.mark.skipif(
theano.config.cxx == "" or not conv.imported_scipy_signal,
... | 39.21519 | 88 | 0.476575 |
181af535abba461ca8caab890f518aa4e1134ad2 | 1,026 | py | Python | pocket_audio_process.py | Siddharth858/EnGL | a4fb6209b23d5914690788ea0914d223219247ba | [
"MIT"
] | 2 | 2017-08-18T16:39:19.000Z | 2017-10-17T14:42:20.000Z | pocket_audio_process.py | Siddharth858/EnGL | a4fb6209b23d5914690788ea0914d223219247ba | [
"MIT"
] | null | null | null | pocket_audio_process.py | Siddharth858/EnGL | a4fb6209b23d5914690788ea0914d223219247ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from pocketsphinx import LiveSpeech, get_model_path, get_data_path, DefaultConfig, Decoder, AudioFile
import json
with open('./file_to_read.json','r') as fo:
temp_dic = json.load(fo)
k0 = temp_dic['k0']
lesson_number = temp_dic['lesson_number']
config = {
'verbose': False,
'a... | 33.096774 | 101 | 0.653021 |
f8ee70dc7fb02bec3351bce0a2f4c6ecd44f2c8c | 2,335 | py | Python | fpipe/utils/s3_writer_worker.py | vkvam/fpipe | 2905095f46923c6c4c460c3d154544b654136df4 | [
"MIT"
] | 18 | 2019-12-16T17:55:57.000Z | 2020-10-21T23:25:40.000Z | fpipe/utils/s3_writer_worker.py | vkvam/fpipe | 2905095f46923c6c4c460c3d154544b654136df4 | [
"MIT"
] | 23 | 2019-12-11T14:15:08.000Z | 2020-02-17T12:53:21.000Z | fpipe/utils/s3_writer_worker.py | vkvam/fpipe | 2905095f46923c6c4c460c3d154544b654136df4 | [
"MIT"
] | null | null | null | import hashlib
from queue import Empty, Queue
from threading import Event
import gc
from botocore import exceptions
from botocore.client import BaseClient
class CorruptedMultipartError(Exception):
pass
class S3FileProgress(object):
def __init__(self, name, data):
self.name = name
self.data ... | 27.151163 | 75 | 0.539615 |
7a1562a8fc57124bb41660f51d1ec78ffcaaa30b | 2,361 | py | Python | python/functions/plotGEQ.py | spatialaudio/geq-design | fb393cb2ec7141016770118e8495e6ea577677d4 | [
"MIT"
] | 1 | 2021-10-11T04:58:33.000Z | 2021-10-11T04:58:33.000Z | python/functions/plotGEQ.py | spatialaudio/geq-design | fb393cb2ec7141016770118e8495e6ea577677d4 | [
"MIT"
] | null | null | null | python/functions/plotGEQ.py | spatialaudio/geq-design | fb393cb2ec7141016770118e8495e6ea577677d4 | [
"MIT"
] | null | null | null | """
Evaluate and plot
Parameters
----------
numsopt : ndarray
numerator coefficients for each filter
densopt : ndarray
denominator coefficients for each filter
fs : float
sample frequency
fc1 : ndarray
center frequences
fc2 : ndarray
center frequencie... | 33.253521 | 136 | 0.63363 |
31307c37112bfeec7a589217155681f6921c7928 | 2,659 | py | Python | setup.py | SuffolkLITLab/docassemble-HousingPretrialMemo | b8123468988777c221ba5cafb8c63badf52f33cc | [
"MIT"
] | 1 | 2021-06-17T18:58:29.000Z | 2021-06-17T18:58:29.000Z | setup.py | SuffolkLITLab/docassemble-HousingPretrialMemo | b8123468988777c221ba5cafb8c63badf52f33cc | [
"MIT"
] | 14 | 2020-12-07T16:26:08.000Z | 2021-12-10T18:11:36.000Z | setup.py | SuffolkLITLab/docassemble-HousingPretrialMemo | b8123468988777c221ba5cafb8c63badf52f33cc | [
"MIT"
] | null | null | null | import os
import sys
from setuptools import setup, find_packages
from fnmatch import fnmatchcase
from distutils.util import convert_path
standard_exclude = ('*.pyc', '*~', '.*', '*.bak', '*.swp*')
standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info')
def find_package_dat... | 43.590164 | 226 | 0.562618 |
bc5ba1e1b19b3c3bfca4502df8a969e78f5c9d65 | 75,598 | py | Python | nikola/utils.py | timgates42/nikola | 910d7fc865cf9f2e1dad8135a242c9ab3a6ff48b | [
"MIT"
] | null | null | null | nikola/utils.py | timgates42/nikola | 910d7fc865cf9f2e1dad8135a242c9ab3a6ff48b | [
"MIT"
] | null | null | null | nikola/utils.py | timgates42/nikola | 910d7fc865cf9f2e1dad8135a242c9ab3a6ff48b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2012-2020 Roberto Alsina and others.
# 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 t... | 36.823186 | 174 | 0.617053 |
17a6b91d3bea3a4cbbe95d5cb941322470af268c | 5,148 | py | Python | ironic_python_agent/inspect.py | poojaghumre/ironic-python-agent | dc8c1f16f9a00e2bff21612d1a9cf0ea0f3addf0 | [
"Apache-2.0"
] | 86 | 2015-01-21T22:04:48.000Z | 2022-03-29T12:15:49.000Z | ironic_python_agent/inspect.py | arnewiebalck/ironic-python-agent | 3fbcc7c38e858fea2279d376c60367a844ac3a04 | [
"Apache-2.0"
] | 3 | 2018-01-29T07:44:43.000Z | 2021-09-04T06:13:42.000Z | ironic_python_agent/inspect.py | arnewiebalck/ironic-python-agent | 3fbcc7c38e858fea2279d376c60367a844ac3a04 | [
"Apache-2.0"
] | 110 | 2015-01-29T09:26:52.000Z | 2021-12-29T03:16:27.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | 40.857143 | 77 | 0.541958 |
817fdd9c1dea9299bafa554faac370d750b1c436 | 211 | py | Python | scripts/interact_erc20.py | Hellhound5/dev-bootcamp-brownies | fb61ee10b5299e104a422a38d40446b3a13e650b | [
"MIT"
] | null | null | null | scripts/interact_erc20.py | Hellhound5/dev-bootcamp-brownies | fb61ee10b5299e104a422a38d40446b3a13e650b | [
"MIT"
] | null | null | null | scripts/interact_erc20.py | Hellhound5/dev-bootcamp-brownies | fb61ee10b5299e104a422a38d40446b3a13e650b | [
"MIT"
] | null | null | null | from brownie import ERC20Basic, config, accounts, network
def main():
account = accounts.add(config["wallets"]["from_key"])
erc20 = ERC20Basic[-1]
print("Total Supply is", erc20.totalSupply())
| 23.444444 | 57 | 0.682464 |
bcc71f31b25b84e3bea7c34f6a43184b016436f8 | 6,281 | py | Python | userbot/plugins/afk.py | Luuukeeeee/X-tra-Telegram | d41905eba98e418492f4957bee7219d17d438d00 | [
"MIT"
] | 1 | 2020-06-16T21:07:37.000Z | 2020-06-16T21:07:37.000Z | userbot/plugins/afk.py | Luuukeeeee/X-tra-Telegram | d41905eba98e418492f4957bee7219d17d438d00 | [
"MIT"
] | null | null | null | userbot/plugins/afk.py | Luuukeeeee/X-tra-Telegram | d41905eba98e418492f4957bee7219d17d438d00 | [
"MIT"
] | null | null | null | """AFK Plugin for @UniBorg
Syntax: .afk REASON"""
import asyncio
import datetime
from datetime import datetime
from telethon import events
from telethon.tl import functions, types
global USER_AFK # pylint:disable=E0602
global afk_time # pylint:disable=E0602
global last_afk_message # pylint:disable=E0602
global afk... | 40.006369 | 134 | 0.605158 |
6483d2215362af2ecf177d1aaee92f26c1e9b6fd | 11,791 | py | Python | grr/core/grr_response_core/config/server.py | isabella232/grr | db43c7df6eccd6696a5ad3ba8a338088b289d8b1 | [
"Apache-2.0"
] | 1 | 2021-07-01T01:43:06.000Z | 2021-07-01T01:43:06.000Z | grr/core/grr_response_core/config/server.py | Lostar303/grr | fe2563069b0a8c6fdea3fe24a3c938c16391a5e3 | [
"Apache-2.0"
] | 44 | 2021-05-14T22:49:24.000Z | 2022-03-13T21:54:02.000Z | grr/core/grr_response_core/config/server.py | Lostar303/grr | fe2563069b0a8c6fdea3fe24a3c938c16391a5e3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Lint as: python3
"""Configuration parameters for the server side subsystems."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core import version
from grr_response_core.lib import config_lib
from grr_response_co... | 36.962382 | 80 | 0.722076 |
75988bfd325914b64b5db16aa8be4f01b4a9f12f | 3,628 | py | Python | scripts/e114.py | JackKelly/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 38 | 2015-08-14T14:38:52.000Z | 2021-12-15T03:21:04.000Z | scripts/e114.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | null | null | null | scripts/e114.py | VidipG/neuralnilm_prototype | 2119292e7d5c8a137797ad3c9abf9f37e7f749af | [
"MIT"
] | 26 | 2015-09-24T20:55:26.000Z | 2021-12-07T15:42:09.000Z | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... | 27.278195 | 92 | 0.64774 |
e5a8db7dc6a8ac8512d6559e956169a93fb2aff4 | 657 | py | Python | tests/water_pump.py | One-Green/plant-keeper-master | 67101a4cc7070d26fd1685631a710ae9a60fc5e8 | [
"CC0-1.0"
] | 2 | 2022-02-04T17:52:38.000Z | 2022-02-04T17:52:40.000Z | tests/water_pump.py | shanisma/plant-keeper | 3ca92ae2d55544a301e1398496a08a45cca6d15b | [
"CC0-1.0"
] | 4 | 2021-06-16T20:01:50.000Z | 2022-03-09T20:17:53.000Z | tests/water_pump.py | shanisma/plant-keeper | 3ca92ae2d55544a301e1398496a08a45cca6d15b | [
"CC0-1.0"
] | 1 | 2021-06-27T10:45:36.000Z | 2021-06-27T10:45:36.000Z | import requests
from pprint import pprint
import ray
import random
@ray.remote
class WaterPump:
api = "http://192.168.0.21:8001/water-pump/"
def post(self):
_dict = {"water_level": random.randint(50, 70)}
return requests.post(self.api, json=_dict).json()
def get(self):
return re... | 17.756757 | 57 | 0.563166 |
952f73bb1a6b57dd0d9bf6b4d398d8e2c813d3cd | 2,237 | py | Python | pytplot/QtPlotter/TVarFigureAxisOnly.py | xnchu/PyTplot | 65ad594ea216d56f0acf8886d8cf3b14f48ed333 | [
"MIT"
] | null | null | null | pytplot/QtPlotter/TVarFigureAxisOnly.py | xnchu/PyTplot | 65ad594ea216d56f0acf8886d8cf3b14f48ed333 | [
"MIT"
] | null | null | null | pytplot/QtPlotter/TVarFigureAxisOnly.py | xnchu/PyTplot | 65ad594ea216d56f0acf8886d8cf3b14f48ed333 | [
"MIT"
] | null | null | null | # Copyright 2018 Regents of the University of Colorado. All Rights Reserved.
# Released under the MIT license.
# This software was developed at the University of Colorado's Laboratory for Atmospheric and Space Physics.
# Verify current version before use at: https://github.com/MAVENSDC/PyTplot
import pyqtgraph as pg
f... | 47.595745 | 150 | 0.659812 |
e491fd2483b15ba5688091e19bd06d0e46e443fc | 4,271 | py | Python | code-samples/hazelcast-integration/hibernate-2ndlevel-cache/src/main/resources/conf.py | ardeshir/gohazel | edc11cd068cc132b1baa7c51f43b180d74f60316 | [
"Apache-2.0",
"MIT"
] | null | null | null | code-samples/hazelcast-integration/hibernate-2ndlevel-cache/src/main/resources/conf.py | ardeshir/gohazel | edc11cd068cc132b1baa7c51f43b180d74f60316 | [
"Apache-2.0",
"MIT"
] | null | null | null | code-samples/hazelcast-integration/hibernate-2ndlevel-cache/src/main/resources/conf.py | ardeshir/gohazel | edc11cd068cc132b1baa7c51f43b180d74f60316 | [
"Apache-2.0",
"MIT"
] | null | null | null | from lxml import etree
from optparse import OptionParser
CFG_FILE = "src/main/resources/hibernate.cfg.xml"
optparser = OptionParser()
optparser.add_option("-q", "--query-cache",
action="store",
dest="querycache",
help="hibernate.cache.use_query_cache",
... | 36.504274 | 86 | 0.554905 |
b638785252050fa1e589ad3db031203198d1212b | 15,157 | py | Python | numerblox/postprocessing.py | mickeybeurskens/numerblox | 0e4b887efcd9e6b84309b6ac5fb1d0de327e810e | [
"Apache-2.0"
] | null | null | null | numerblox/postprocessing.py | mickeybeurskens/numerblox | 0e4b887efcd9e6b84309b6ac5fb1d0de327e810e | [
"Apache-2.0"
] | null | null | null | numerblox/postprocessing.py | mickeybeurskens/numerblox | 0e4b887efcd9e6b84309b6ac5fb1d0de327e810e | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/05_postprocessing.ipynb (unless otherwise specified).
__all__ = ['BasePostProcessor', 'Standardizer', 'MeanEnsembler', 'DonateWeightedEnsembler', 'GeometricMeanEnsembler',
'FeatureNeutralizer', 'FeaturePenalizer', 'AwesomePostProcessor']
# Cell
import scipy
i... | 38.275253 | 153 | 0.644059 |
53f0d209b5eaafee82633c9e5b41406c13cec8a5 | 4,768 | py | Python | loss/SSIMs/SSIM.py | lartpang/CoSaliencyProj | fe2acf887c74977010aed8e2d519a503a7e75ae3 | [
"MIT"
] | 1 | 2020-12-26T04:03:13.000Z | 2020-12-26T04:03:13.000Z | loss/SSIMs/SSIM.py | lartpang/CoSaliencyProj | fe2acf887c74977010aed8e2d519a503a7e75ae3 | [
"MIT"
] | null | null | null | loss/SSIMs/SSIM.py | lartpang/CoSaliencyProj | fe2acf887c74977010aed8e2d519a503a7e75ae3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# https://github.com/Po-Hsun-Su/pytorch-ssim/blob/master/pytorch_ssim
# /__init__.py
from math import exp
import torch
import torch.nn.functional as F
from torch.autograd import Variable
def gaussian(window_size, sigma):
gauss = torch.Tensor([exp(-((x - window_size // 2) ** 2) / float(2 *... | 34.302158 | 115 | 0.643666 |
9a1815661106c98e72eaf3abf0eaa2677c117b39 | 1,455 | py | Python | openprocurement/contracting/core/tests/main.py | oleksiyVeretiuk/openprocurement.contracting.core | 4f04ef136ac2e819ddc21ee810838e3c78fc11ce | [
"Apache-2.0"
] | null | null | null | openprocurement/contracting/core/tests/main.py | oleksiyVeretiuk/openprocurement.contracting.core | 4f04ef136ac2e819ddc21ee810838e3c78fc11ce | [
"Apache-2.0"
] | 28 | 2018-03-28T05:36:08.000Z | 2019-02-28T13:44:15.000Z | openprocurement/contracting/core/tests/main.py | oleksiyVeretiuk/openprocurement.contracting.core | 4f04ef136ac2e819ddc21ee810838e3c78fc11ce | [
"Apache-2.0"
] | 5 | 2018-03-28T08:17:04.000Z | 2019-02-07T17:22:17.000Z | # -*- coding: utf-8 -*-
import unittest
from pyramid.config import Configurator
from pyramid.request import Request
from openprocurement.contracting.core.adapters import ContractConfigurator
from openprocurement.contracting.core.models import Contract
from openprocurement.contracting.core.includeme import includeme
f... | 30.957447 | 79 | 0.721649 |
e963636185061329b9163f9e1350527895a52172 | 2,976 | py | Python | src/Services/war_notifer.py | Stratia/PNW-Utility-Belt | 7a7abcf793ac7de721ae7c36dc75e08e61fd0627 | [
"MIT"
] | null | null | null | src/Services/war_notifer.py | Stratia/PNW-Utility-Belt | 7a7abcf793ac7de721ae7c36dc75e08e61fd0627 | [
"MIT"
] | null | null | null | src/Services/war_notifer.py | Stratia/PNW-Utility-Belt | 7a7abcf793ac7de721ae7c36dc75e08e61fd0627 | [
"MIT"
] | null | null | null | import requests
import time
from pynotifier import Notification
import json
import os
from twilio.rest import Client
iden = os.getpid()
json_file = open('Services\config.json')
json_file_data = json.load(json_file)
api_key = json_file_data['Data']['Api_key']
nation_id = json_file_data['Data']['ID']
phone... | 37.2 | 116 | 0.573925 |
cc87a5a6e2092a0ea764d2e41e39f5f11baf2652 | 1,063 | py | Python | wagtail_footnotes/models.py | GreenLightGo/wagtail-footnotes | 0a13e3757c8a435cd3add7131cd2d19fc9fb1cc8 | [
"MIT"
] | 12 | 2020-08-03T16:31:05.000Z | 2022-03-29T20:45:12.000Z | wagtail_footnotes/models.py | GreenLightGo/wagtail-footnotes | 0a13e3757c8a435cd3add7131cd2d19fc9fb1cc8 | [
"MIT"
] | 20 | 2020-10-12T07:04:35.000Z | 2022-02-25T16:57:54.000Z | wagtail_footnotes/models.py | GreenLightGo/wagtail-footnotes | 0a13e3757c8a435cd3add7131cd2d19fc9fb1cc8 | [
"MIT"
] | 8 | 2021-02-19T09:23:54.000Z | 2022-02-22T22:07:31.000Z | from django.conf import settings
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel
from wagtail.core.fields import RichTextField
from .fields import CustomUUIDField
from .widgets import ReadonlyUUIDInput
class Footnote(models.Mode... | 31.264706 | 83 | 0.70461 |
75e8374a4e795d1550ff2498d55d1262c2c0150b | 2,517 | py | Python | src/golf_tracker/tracker.py | J-Curwell/golf-tracker | 50b34dca0f3cb269f6738cf928dff3d5862c675f | [
"MIT"
] | null | null | null | src/golf_tracker/tracker.py | J-Curwell/golf-tracker | 50b34dca0f3cb269f6738cf928dff3d5862c675f | [
"MIT"
] | null | null | null | src/golf_tracker/tracker.py | J-Curwell/golf-tracker | 50b34dca0f3cb269f6738cf928dff3d5862c675f | [
"MIT"
] | null | null | null | """
TODO: Ensure attributes can only take the following values:
Standard shot:
- Holed: True / False
- Direction: Correct / Left / Right
- Distance: Correct / Long / Short
- Flight: Straight Draw / Hook / Fade / Slice
- Connection: Pure / Fat / Thin
Putting:
- Holed: True / None
- Direction: Correct / Left / Right
- ... | 24.920792 | 73 | 0.574096 |
cdb287fbfd26d86d673d87e5e02e3e46abf10ffc | 19,625 | py | Python | solver-Naga.py | coeus89/Beta-VAE | 6c248ef9fb1b5bea7068c6f79291f11de45af2b5 | [
"MIT"
] | null | null | null | solver-Naga.py | coeus89/Beta-VAE | 6c248ef9fb1b5bea7068c6f79291f11de45af2b5 | [
"MIT"
] | null | null | null | solver-Naga.py | coeus89/Beta-VAE | 6c248ef9fb1b5bea7068c6f79291f11de45af2b5 | [
"MIT"
] | null | null | null | """solver.py"""
import warnings
warnings.filterwarnings("ignore")
import os
from tqdm import tqdm
import visdom
import torch
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision.utils import make_grid, save_image
from utils import cuda, grid... | 42.023555 | 105 | 0.470013 |
b53e19bd3ae4e648d992cfa4b9854debe4444983 | 472 | py | Python | Code/merge_two_sorted_lists.py | lpc477/Leet | e152012d5f8fa5df0a089bd09fe5c9fc011fcb49 | [
"MIT"
] | null | null | null | Code/merge_two_sorted_lists.py | lpc477/Leet | e152012d5f8fa5df0a089bd09fe5c9fc011fcb49 | [
"MIT"
] | null | null | null | Code/merge_two_sorted_lists.py | lpc477/Leet | e152012d5f8fa5df0a089bd09fe5c9fc011fcb49 | [
"MIT"
] | null | null | null | class ListNode(object):
def __init__(self, val=0, next=None):
self.val = val
self.next = next
def merge_two_lists(l1, l2):
head = result = ListNode(0)
while l1 and l2:
if l1.val > l2.val:
result.next = l2
l2 = l2.next
else:
result.next = ... | 21.454545 | 41 | 0.510593 |
45f6462113263ed18f9b453d03297908c4914a84 | 1,171 | py | Python | gn/dehydrate_sksl.py | TheRakeshPurohit/skia | 817dd601f85f986a99d102de8dc42ee8638a56f9 | [
"BSD-3-Clause"
] | null | null | null | gn/dehydrate_sksl.py | TheRakeshPurohit/skia | 817dd601f85f986a99d102de8dc42ee8638a56f9 | [
"BSD-3-Clause"
] | null | null | null | gn/dehydrate_sksl.py | TheRakeshPurohit/skia | 817dd601f85f986a99d102de8dc42ee8638a56f9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
sksl_precompile = sys.argv[1]
targetDir = sys.argv[2]
modules = sys.argv[3:]
dependencies = {
'sksl_frag': ['sksl_gpu'... | 30.025641 | 74 | 0.648164 |
62a47d3b1b6d3ac2b73203ada18e305738e375d3 | 3,144 | py | Python | app/app/settings.py | fcetintas/MiningMonitor | b9eb33686c468a2846bb70cba6b7b8913a62cc10 | [
"MIT"
] | null | null | null | app/app/settings.py | fcetintas/MiningMonitor | b9eb33686c468a2846bb70cba6b7b8913a62cc10 | [
"MIT"
] | null | null | null | app/app/settings.py | fcetintas/MiningMonitor | b9eb33686c468a2846bb70cba6b7b8913a62cc10 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Bui... | 25.152 | 91 | 0.693702 |
8c2e044de6c1447ec35806055963e0785941386d | 15,968 | py | Python | code/nbs/reco-tut-asr-99-06-similarity-metrics-for-cf.py | sparsh-ai/reco-tut-asr | d64b6ed02826933e8add8f83a5773c5a0a21896b | [
"MIT"
] | null | null | null | code/nbs/reco-tut-asr-99-06-similarity-metrics-for-cf.py | sparsh-ai/reco-tut-asr | d64b6ed02826933e8add8f83a5773c5a0a21896b | [
"MIT"
] | null | null | null | code/nbs/reco-tut-asr-99-06-similarity-metrics-for-cf.py | sparsh-ai/reco-tut-asr | d64b6ed02826933e8add8f83a5773c5a0a21896b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Notes on Similarity Metrics
#
# The last notebook on this month in the domain of collaborative filtering (CF) is to take a look at the metrics that were used in the 2 previous notebooks about [User User CF](https://github.com/caiomiyashiro/RecommenderSystemsNotebooks/blob/mas... | 87.256831 | 1,302 | 0.742548 |
c8f40248b89c6d5d2b6caf7b16e34d4b524cb464 | 183 | py | Python | benchmark/pyfaidx_fasta_random_access.py | DishSri1/pyfastx | 4bfa6662fb50b7244565ad00ef6e99962b4f3169 | [
"MIT"
] | 122 | 2019-10-21T16:22:27.000Z | 2022-03-31T06:07:45.000Z | benchmark/pyfaidx_fasta_random_access.py | DishSri1/pyfastx | 4bfa6662fb50b7244565ad00ef6e99962b4f3169 | [
"MIT"
] | 40 | 2019-11-08T14:38:51.000Z | 2022-03-15T13:07:38.000Z | benchmark/pyfaidx_fasta_random_access.py | DishSri1/pyfastx | 4bfa6662fb50b7244565ad00ef6e99962b4f3169 | [
"MIT"
] | 8 | 2020-01-20T01:31:51.000Z | 2021-07-30T10:28:35.000Z | import sys
import pyfaidx
idfile, fafile = sys.argv[1:]
fa = pyfaidx.Fasta(fafile)
with open(idfile) as fh:
for line in fh:
seqid = line.strip()
s = str(fa[seqid])
print(s)
| 14.076923 | 29 | 0.666667 |
8802f115c877c190d4f71c1a67abb35ac6f433d4 | 1,360 | py | Python | teams/Team Malaysia 2020/Chainsaw/MYiTOPS_Code_2020/MYiTOPS-MQTT-CAYENNE_2020/Chokehebel_Aus_Testing.py | IKKUengine/MYiTOPS | f250618dcb1ce4536789248731314d9178d1672d | [
"MIT"
] | null | null | null | teams/Team Malaysia 2020/Chainsaw/MYiTOPS_Code_2020/MYiTOPS-MQTT-CAYENNE_2020/Chokehebel_Aus_Testing.py | IKKUengine/MYiTOPS | f250618dcb1ce4536789248731314d9178d1672d | [
"MIT"
] | null | null | null | teams/Team Malaysia 2020/Chainsaw/MYiTOPS_Code_2020/MYiTOPS-MQTT-CAYENNE_2020/Chokehebel_Aus_Testing.py | IKKUengine/MYiTOPS | f250618dcb1ce4536789248731314d9178d1672d | [
"MIT"
] | 4 | 2019-03-06T15:09:58.000Z | 2021-06-08T13:33:38.000Z | import pigpio #Install every library here in common library path
from enum import Enum
from time import sleep
from time import time
import threading
import cayenne.client
class Servo:
def __init__(self, pi, GPIO, Nullposition = 1500, min_Winkel = -20,anschlag_Winkel = 0, max_Winkel = 20):... | 29.565217 | 187 | 0.738235 |
2a5aa20cb5a7b274198d2eaaa500f4fa6723e4d5 | 1,749 | py | Python | Patterns/arghyasahoo.py | sanchit781/HACKTOBERFEST2021_PATTERN | c457eb2a1c7b729bdaa26ade7d4c7eb4092291e2 | [
"MIT"
] | 229 | 2021-09-10T13:24:47.000Z | 2022-03-18T16:54:29.000Z | Patterns/arghyasahoo.py | sanchit781/HACKTOBERFEST2021_PATTERN | c457eb2a1c7b729bdaa26ade7d4c7eb4092291e2 | [
"MIT"
] | 164 | 2021-09-10T12:04:39.000Z | 2021-10-29T21:20:42.000Z | Patterns/arghyasahoo.py | sanchit781/HACKTOBERFEST2021_PATTERN | c457eb2a1c7b729bdaa26ade7d4c7eb4092291e2 | [
"MIT"
] | 567 | 2021-09-10T17:35:27.000Z | 2021-12-11T12:45:43.000Z | # Hacktober Fest Ascii Icon
# Author : Arghya Sahoo
# Github : https://github.com/arghyasahoo
import sys
n = int(input("Size of Pattern: "))
# Up
for i in range(n):
if i == 0:
sys.stdout.write(" "*(n*2+2) + " "*(n-i) + '*\n')
else:
sys.stdout.write(" "*(n*2+2) + " "*(n-i) + '*' + " "*((i*2)-1) + '*\n')
# sys... | 33.634615 | 113 | 0.424814 |
4fe9c1ca29a5bad9c59ca9970efd4e3eff6b7868 | 6,429 | py | Python | qutip/tests/test_qubit_evolution.py | dweigand/qutip | b57d5e4b4846880e894afa390c62f4d095c642e1 | [
"BSD-3-Clause"
] | 2 | 2021-03-04T03:26:35.000Z | 2021-03-18T19:52:20.000Z | qutip/tests/test_qubit_evolution.py | dweigand/qutip | b57d5e4b4846880e894afa390c62f4d095c642e1 | [
"BSD-3-Clause"
] | 52 | 2019-10-28T07:53:01.000Z | 2020-07-10T22:35:57.000Z | qutip/tests/test_qubit_evolution.py | dweigand/qutip | b57d5e4b4846880e894afa390c62f4d095c642e1 | [
"BSD-3-Clause"
] | 2 | 2017-08-11T11:14:52.000Z | 2022-03-13T21:37:47.000Z | # This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
... | 34.940217 | 79 | 0.624825 |
aed86c44377c6f9c8efabcf2fd07694710c6ebd6 | 1,148 | py | Python | mbrl/examples/main.py | MaxSobolMark/mbrl-lib | bc8ccfe8a56b58d3ce5bae2c4ccdadd82ecdb594 | [
"MIT"
] | null | null | null | mbrl/examples/main.py | MaxSobolMark/mbrl-lib | bc8ccfe8a56b58d3ce5bae2c4ccdadd82ecdb594 | [
"MIT"
] | null | null | null | mbrl/examples/main.py | MaxSobolMark/mbrl-lib | bc8ccfe8a56b58d3ce5bae2c4ccdadd82ecdb594 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict
import hydra
import numpy as np
import omegaconf
from omegaconf import OmegaConf
import torch
impo... | 31.027027 | 76 | 0.675087 |
54f54a56cbb6ca039bae761b9d002c82ff33f8cf | 836 | py | Python | day03/day3_q1.py | antithalian/advent-of-code-2020 | bc26399a6fe9549c9d2c226752dbfd9610283577 | [
"MIT"
] | null | null | null | day03/day3_q1.py | antithalian/advent-of-code-2020 | bc26399a6fe9549c9d2c226752dbfd9610283577 | [
"MIT"
] | null | null | null | day03/day3_q1.py | antithalian/advent-of-code-2020 | bc26399a6fe9549c9d2c226752dbfd9610283577 | [
"MIT"
] | null | null | null | # day 3 question 1
# how many trees?
# get input
map = []
with open('input.txt', 'r') as file:
for line in file:
map.append(list(line.strip()))
# map is basically a list of strings at this point
# get 0-indexed length of map segment, for repetition (it's 31)
length = len(map[0]) - 1
# get 0-indexed height... | 22.594595 | 63 | 0.595694 |
cfc185c645f449583910411f5d37d3229f9ad67b | 5,506 | py | Python | kmeans256.py | roryschadler/manim | 1a175116c4c0aef0c60b55cee605a41b0dcaa7d5 | [
"MIT"
] | null | null | null | kmeans256.py | roryschadler/manim | 1a175116c4c0aef0c60b55cee605a41b0dcaa7d5 | [
"MIT"
] | null | null | null | kmeans256.py | roryschadler/manim | 1a175116c4c0aef0c60b55cee605a41b0dcaa7d5 | [
"MIT"
] | null | null | null | import numpy as np
from PIL import Image
from numpy.linalg import norm
from pathlib import Path
import os
from colormath.color_objects import LabColor, AdobeRGBColor
from colormath.color_diff import delta_e_cie2000
from colormath.color_conversions import convert_color
class KMeansMLFinal:
"""
CS74/174 Final E... | 43.015625 | 125 | 0.634399 |
62a11e5099f5ac4b9ab1a2c1faed44cc8bb90f99 | 625 | py | Python | apps/Config/config.py | uvic-aero/onboard-computer | 1f4be998185b63e5b23f0325e4e696ef2c59b01d | [
"MIT"
] | 1 | 2020-03-25T17:24:42.000Z | 2020-03-25T17:24:42.000Z | apps/Config/config.py | uvic-aero/onboard-computer | 1f4be998185b63e5b23f0325e4e696ef2c59b01d | [
"MIT"
] | 47 | 2019-09-26T20:52:53.000Z | 2021-11-25T00:43:28.000Z | apps/Config/config.py | uvic-aero/onboard-computer | 1f4be998185b63e5b23f0325e4e696ef2c59b01d | [
"MIT"
] | 2 | 2019-09-30T20:22:48.000Z | 2019-10-26T21:00:55.000Z | import configparser
class Config:
def __init__(self):
self.values = self.get_values()
self.print_values()
def get_values(self):
config = configparser.ConfigParser()
config.read("config.ini")
return config
def print_values(self):
print(
"Configu... | 22.321429 | 53 | 0.4976 |
9f2fd2a2443ac71faa48b962b881307a86dc0bc0 | 5,128 | py | Python | flask_jsontools/formatting.py | oharsta/py-flask-jsontools | fa4c143b743431053f2426f1debaa6cd74c827c0 | [
"BSD-2-Clause"
] | 29 | 2015-03-16T18:03:02.000Z | 2020-06-18T23:02:30.000Z | flask_jsontools/formatting.py | oharsta/py-flask-jsontools | fa4c143b743431053f2426f1debaa6cd74c827c0 | [
"BSD-2-Clause"
] | 6 | 2015-04-18T18:16:23.000Z | 2019-01-15T13:53:38.000Z | flask_jsontools/formatting.py | oharsta/py-flask-jsontools | fa4c143b743431053f2426f1debaa6cd74c827c0 | [
"BSD-2-Clause"
] | 19 | 2015-03-09T13:32:04.000Z | 2021-12-29T09:04:06.000Z | from __future__ import absolute_import
from builtins import object
from flask.json import JSONEncoder
class DynamicJSONEncoder(JSONEncoder):
""" JSON encoder for custom classes:
Uses __json__() method if available to prepare the object.
Especially useful for SQLAlchemy models
"""
def de... | 39.446154 | 80 | 0.665172 |
1542af97500efd93ef435f03b5612455a9db1f07 | 70,393 | py | Python | subversion/tests/cmdline/move_tests.py | YueLinHo/Subversion | b28ce23d2e0109f0ca64b9f2a46be0fa23820f5f | [
"Apache-2.0"
] | 1 | 2018-03-09T01:54:29.000Z | 2018-03-09T01:54:29.000Z | subversion/tests/cmdline/move_tests.py | whiplashcn/subversion | da9560b9b82437f9a8be30165dc110ce708b29bc | [
"Apache-2.0"
] | null | null | null | subversion/tests/cmdline/move_tests.py | whiplashcn/subversion | da9560b9b82437f9a8be30165dc110ce708b29bc | [
"Apache-2.0"
] | 2 | 2017-04-24T23:04:44.000Z | 2020-11-04T07:27:17.000Z | #!/usr/bin/env python
#
# move_tests.py: testing the local move tracking
#
# Subversion is a tool for revision control.
# See http://subversion.apache.org for more information.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# ... | 39.194321 | 101 | 0.577984 |
02e5dd72267bb5f1c7d29ca717eba194dc82aaf5 | 25,253 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations_async/_express_route_ports_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.845261 | 203 | 0.672475 |
0df2951dc9452e4d341784fd40ace33de96285bb | 1,030 | py | Python | kubernetes/test/test_v1_cluster_role_binding_list.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/test/test_v1_cluster_role_binding_list.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1_cluster_role_binding_list.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 22.888889 | 105 | 0.728155 |
e60f597c9e25181197471e52568dc10fda283f57 | 25,128 | py | Python | google/ads/googleads/v9/services/services/customer_extension_setting_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/customer_extension_setting_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/customer_extension_setting_service/client.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 41.88 | 180 | 0.640322 |
0e53a8c0f8fed55e7ab26698326d72cd7871f533 | 282 | py | Python | app/restaurants/urls.py | yagnic/recipe-app-me | 2713461de85f7fb009a4244f43eca9ac97c35722 | [
"MIT"
] | null | null | null | app/restaurants/urls.py | yagnic/recipe-app-me | 2713461de85f7fb009a4244f43eca9ac97c35722 | [
"MIT"
] | null | null | null | app/restaurants/urls.py | yagnic/recipe-app-me | 2713461de85f7fb009a4244f43eca9ac97c35722 | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from restaurants import views
router = DefaultRouter()
router.register('restaurants', views.RestaurantViewSet)
app_name = 'restaurants'
urlpatterns = [
path('', include(router.urls))
]
| 17.625 | 55 | 0.77305 |
eb0420513ce712a78e1712f83d039473e7931e4b | 11,212 | py | Python | HPOBenchExperimentUtils/utils/optimizer_utils.py | PhMueller/TrajectoryParser | 9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f | [
"Apache-2.0"
] | null | null | null | HPOBenchExperimentUtils/utils/optimizer_utils.py | PhMueller/TrajectoryParser | 9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f | [
"Apache-2.0"
] | 1 | 2021-09-01T16:35:21.000Z | 2021-11-05T19:53:25.000Z | HPOBenchExperimentUtils/utils/optimizer_utils.py | automl/HPOBenchExperimentUtils | 9c19d37a3ff29a593c9b6d3e7fd3857e8c2d724f | [
"Apache-2.0"
] | null | null | null | import json
import logging
from enum import Enum
from typing import Union, Optional, Any, Dict
import numpy as np
from HPOBenchExperimentUtils.utils.runner_utils import get_optimizer_settings_names
_log = logging.getLogger(__name__)
class OptimizerEnum(Enum):
""" Enumeration type for the supported optimizers "... | 41.220588 | 119 | 0.710846 |
753da0691c62776ba264702abdabe844b513d891 | 2,280 | py | Python | three-connector/utils/ws_server.py | ukonpower/three-connector | 9583312c4955000da7d16b7535ffac9c4dd37ab6 | [
"MIT"
] | 3 | 2022-03-26T09:36:26.000Z | 2022-03-30T00:41:57.000Z | three-connector/utils/ws_server.py | ukonpower/three-connector | 9583312c4955000da7d16b7535ffac9c4dd37ab6 | [
"MIT"
] | 1 | 2022-03-22T00:56:39.000Z | 2022-03-22T00:56:39.000Z | three-connector/utils/ws_server.py | ukonpower/three-connector | 9583312c4955000da7d16b7535ffac9c4dd37ab6 | [
"MIT"
] | null | null | null | import threading
import json
import inspect
import asyncio
import websockets
class WS:
def __init__(self):
self.server = None
self.server_stop = None
self.server_thread = None
self.sockets = set()
self.on_connect = None
async def clientEvents(self, websocket ):
... | 24 | 91 | 0.579825 |
81392a1bc5a85b7c013bd988bb52d59cc35a9abf | 579 | py | Python | tests/test_fixtures/notebook_assets/suite_edit/footer.py | vanderGoes/great_expectations | 9790cd992a8a4de672c640e89ddd7278a0ca0889 | [
"Apache-2.0"
] | 6,451 | 2017-09-11T16:32:53.000Z | 2022-03-31T23:27:49.000Z | tests/test_fixtures/notebook_assets/suite_edit/footer.py | vanderGoes/great_expectations | 9790cd992a8a4de672c640e89ddd7278a0ca0889 | [
"Apache-2.0"
] | 3,892 | 2017-09-08T18:57:50.000Z | 2022-03-31T23:15:20.000Z | tests/test_fixtures/notebook_assets/suite_edit/footer.py | vanderGoes/great_expectations | 9790cd992a8a4de672c640e89ddd7278a0ca0889 | [
"Apache-2.0"
] | 1,023 | 2017-09-08T15:22:05.000Z | 2022-03-31T21:17:08.000Z | batch.save_expectation_suite(discard_failed_expectations=False)
run_id = {
"run_name": "some_string_that_uniquely_identifies_this_run", # insert your own run_name here
"run_time": datetime.datetime.now(datetime.timezone.utc),
}
results = context.run_validation_operator(
"{{ validation_operator_name }}", as... | 48.25 | 97 | 0.799655 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.