hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79639ccb33ee97c8e3dbae067dca6bc890ec6294 | 8,469 | py | Python | src/python_implementations/pr_mix.py | fhapocryphal-sigma/Thermodynamics.jl | 6aaaba44f8f608ccc62c8bc8f11e854fc4d805f7 | [
"MIT"
] | 2 | 2019-10-15T14:26:28.000Z | 2021-03-23T11:38:34.000Z | src/python_implementations/pr_mix.py | fhapocryphal-sigma/Thermodynamics.jl | 6aaaba44f8f608ccc62c8bc8f11e854fc4d805f7 | [
"MIT"
] | null | null | null | src/python_implementations/pr_mix.py | fhapocryphal-sigma/Thermodynamics.jl | 6aaaba44f8f608ccc62c8bc8f11e854fc4d805f7 | [
"MIT"
] | 1 | 2019-01-07T14:06:06.000Z | 2019-01-07T14:06:06.000Z | import numpy as np
import scipy.optimize as opt
import scipy.integrate as intg
import matplotlib.pyplot as plt
from scipy.misc import derivative
def R():
return 8.31446
class pengRobinson:
def __init__(self, Tc, Pc, omega, Cp_func):
self.Tc = Tc
self.Pc = Pc
self.omega... | 31.600746 | 113 | 0.463219 |
79639d4b6327d86b58bc97b2959aa799cc1bd8e5 | 188 | py | Python | tests/test_sqlite.py | cieplak/asylum | 12f95d6b42dc441f41aa7e7cc9791675b01d3682 | [
"MIT"
] | null | null | null | tests/test_sqlite.py | cieplak/asylum | 12f95d6b42dc441f41aa7e7cc9791675b01d3682 | [
"MIT"
] | null | null | null | tests/test_sqlite.py | cieplak/asylum | 12f95d6b42dc441f41aa7e7cc9791675b01d3682 | [
"MIT"
] | null | null | null | from unittest import TestCase
from asylum import sqlite
class TestSqlite(TestCase):
def setUp(self):
sqlite.init('sqlite://')
def test_init(self):
print('ok')
| 14.461538 | 32 | 0.648936 |
79639e8782cb8c72bf4b7afd3d78976efd825eff | 2,303 | py | Python | 01-getting-started/Python/rest-client/rest-client.py | pradorodriguez/AI-102-AIEngineer | 1807a2fd95d9818d27b8c34c0ad041d844eea806 | [
"MIT"
] | 1 | 2022-03-29T07:40:08.000Z | 2022-03-29T07:40:08.000Z | 01-getting-started/Python/rest-client/rest-client.py | pradorodriguez/AI-102-AIEngineer | 1807a2fd95d9818d27b8c34c0ad041d844eea806 | [
"MIT"
] | null | null | null | 01-getting-started/Python/rest-client/rest-client.py | pradorodriguez/AI-102-AIEngineer | 1807a2fd95d9818d27b8c34c0ad041d844eea806 | [
"MIT"
] | 1 | 2022-02-11T05:18:12.000Z | 2022-02-11T05:18:12.000Z | from dotenv import load_dotenv
import os
import http.client, base64, json, urllib
from urllib import request, parse, error
def main():
global cog_endpoint
global cog_key
try:
# Get Configuration Settings
load_dotenv()
cog_endpoint = os.getenv('COG_SERVICE_ENDPOINT')
cog_key... | 28.7875 | 103 | 0.577942 |
79639ebacffb2dbdf20566dd3b6416e2561fc4f5 | 9,073 | py | Python | tests/test_alerts.py | joshuamosesb/gramex | e416cb609698b5941a18b06743c853dee50e0500 | [
"MIT"
] | 1 | 2020-05-17T18:03:44.000Z | 2020-05-17T18:03:44.000Z | tests/test_alerts.py | joshuamosesb/gramex | e416cb609698b5941a18b06743c853dee50e0500 | [
"MIT"
] | null | null | null | tests/test_alerts.py | joshuamosesb/gramex | e416cb609698b5941a18b06743c853dee50e0500 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import os
import email
import gramex
import gramex.cache
from binascii import a2b_base64
from datetime import datetime, timedelta
from . import folder, utils, TestGramex
from .test_capturehandler import get_text
from nose.tools import eq_, ok_
def run_alert(name, count=1, **kw... | 43.411483 | 95 | 0.600573 |
79639f90c0ebfb972ebc73f96c4e8cc80e02694a | 278,778 | py | Python | saya.py | teambotmax/t1 | a85a7c4c12379783015bb3f2b4277fbb500bb207 | [
"MIT"
] | 4 | 2019-11-06T06:50:59.000Z | 2021-02-26T05:48:37.000Z | LINETCR/saya.py | teambotmax/t1 | a85a7c4c12379783015bb3f2b4277fbb500bb207 | [
"MIT"
] | 2 | 2021-04-30T20:55:16.000Z | 2021-06-02T00:34:06.000Z | LINETCR/saya.py | teambotmax/t1 | a85a7c4c12379783015bb3f2b4277fbb500bb207 | [
"MIT"
] | 3 | 2019-10-21T18:40:36.000Z | 2019-11-27T06:11:19.000Z | #RENGGA===Version SB
import linepy
from linepy import *
from akad.ttypes import *
from datetime import datetime
import pytz, pafy, time, asyncio, random, multiprocessing, timeit, sys, json, ctypes, codecs, tweepy, threading, glob, re, ast, six, os, subprocess, wikipedia, atexit, urllib, urllib.parse, urllib3, string, ... | 48.090047 | 976 | 0.363798 |
7963a17e909e4df99971aedd9180a4ffe7d8017f | 25,505 | py | Python | ambari-agent/src/test/python/ambari_agent/TestRecoveryManager.py | runningt/ambari | 7b91469e68a80bfcabe4b79d855caa684bf51378 | [
"Apache-2.0"
] | 16 | 2018-05-24T10:28:24.000Z | 2021-08-05T03:13:26.000Z | ambari-agent/src/test/python/ambari_agent/TestRecoveryManager.py | runningt/ambari | 7b91469e68a80bfcabe4b79d855caa684bf51378 | [
"Apache-2.0"
] | 2 | 2018-10-24T11:06:24.000Z | 2019-09-09T08:51:21.000Z | ambari-agent/src/test/python/ambari_agent/TestRecoveryManager.py | runningt/ambari | 7b91469e68a80bfcabe4b79d855caa684bf51378 | [
"Apache-2.0"
] | 17 | 2018-07-06T08:57:00.000Z | 2021-11-04T11:00:36.000Z | #!/usr/bin/env python
'''
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")... | 36.75072 | 112 | 0.679122 |
7963a23c20f09b4badbef75b7fe7672bbc91ff4c | 16,817 | py | Python | tensorflow/python/distribute/one_device_strategy.py | scentini/tensorflow | 204ed332c0886a0e0ab10b22ba8d67b97e1c83c4 | [
"Apache-2.0"
] | 56 | 2018-06-21T13:47:23.000Z | 2020-05-13T09:31:47.000Z | tensorflow/python/distribute/one_device_strategy.py | kaist-ina/tensorflow | 169124c0c9630b719e7f0e55722c38c7ecd6c5ac | [
"Apache-2.0"
] | 5 | 2020-06-01T18:50:38.000Z | 2021-07-16T07:13:52.000Z | tensorflow/python/distribute/one_device_strategy.py | kaist-ina/tensorflow | 169124c0c9630b719e7f0e55722c38c7ecd6c5ac | [
"Apache-2.0"
] | 15 | 2018-09-06T14:18:32.000Z | 2020-05-14T06:35:30.000Z | # 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... | 37.876126 | 115 | 0.718737 |
7963a34626216cef2f261115dd530729c25de1fd | 1,792 | py | Python | tests/unit/tst_18.py | qrefine/qrefine | 016cac07a39e032c07f34384065dbd4756fe85f8 | [
"Apache-2.0"
] | 17 | 2016-01-13T02:22:26.000Z | 2021-04-03T18:58:43.000Z | tests/unit/tst_18.py | qrefine/qrefine | 016cac07a39e032c07f34384065dbd4756fe85f8 | [
"Apache-2.0"
] | 78 | 2015-12-23T12:03:38.000Z | 2022-01-28T18:13:21.000Z | tests/unit/tst_18.py | qrefine/qrefine | 016cac07a39e032c07f34384065dbd4756fe85f8 | [
"Apache-2.0"
] | 11 | 2017-04-04T04:10:25.000Z | 2021-04-13T08:54:54.000Z | from __future__ import division
import iotbx.pdb
import os
from scitbx.array_family import flex
from libtbx import easy_pickle
import time
import run_tests
from libtbx.test_utils import approx_equal
import libtbx.load_env
qrefine = libtbx.env.find_in_repositories("qrefine")
qr_unit_tests_data = os.path.join(qrefine,"t... | 35.84 | 84 | 0.695313 |
7963a360df01647bfde42172ca33ca2abb274d1a | 800 | py | Python | muser/env/Lib/site-packages/django/__init__.py | briankim-pitt/muser | 55be568ff58c40517f53f555da59f1acdad57ae3 | [
"MIT"
] | 2 | 2021-12-15T08:33:31.000Z | 2021-12-15T08:33:40.000Z | muser/env/Lib/site-packages/django/__init__.py | briankim-pitt/muser | 55be568ff58c40517f53f555da59f1acdad57ae3 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/django/__init__.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | null | null | null | from django.utils.version import get_version
VERSION = (2, 2, 24, 'final', 0)
__version__ = get_version(VERSION)
def setup(set_prefix=True):
"""
Configure the settings (this happens as a side effect of accessing the
first setting), configure logging and populate the app registry.
Set the thread-loca... | 32 | 85 | 0.7325 |
7963a50c285c5b6c7d680a212405d8c5f41a2269 | 3,410 | py | Python | tests/test_example.py | bpuderer/python-test-env | ed5d1f1b977560cc9bc52952500b93060fc11e6a | [
"MIT"
] | null | null | null | tests/test_example.py | bpuderer/python-test-env | ed5d1f1b977560cc9bc52952500b93060fc11e6a | [
"MIT"
] | 1 | 2021-03-31T18:50:05.000Z | 2021-03-31T18:50:05.000Z | tests/test_example.py | bpuderer/python-test-env | ed5d1f1b977560cc9bc52952500b93060fc11e6a | [
"MIT"
] | null | null | null | """Demo basics of using test environment"""
from datetime import datetime
import logging
import unittest
from framework.config import settings
from tests.base_test import BaseTestCase
from utils.useless_util import add_stuffs
log = logging.getLogger(__name__)
class ExampleTestCase(BaseTestCase):
"""Demo basics... | 32.47619 | 92 | 0.669795 |
7963a589ad3d64531c603c34eee73161c2ea848d | 1,901 | py | Python | lambda_functions/download/features/aws.py | pierrealixt/MapCampaigner | 7845bda4b0f6ccb7d18905a8c77d91ba6a4f78ad | [
"BSD-3-Clause"
] | null | null | null | lambda_functions/download/features/aws.py | pierrealixt/MapCampaigner | 7845bda4b0f6ccb7d18905a8c77d91ba6a4f78ad | [
"BSD-3-Clause"
] | 1 | 2018-07-24T13:57:03.000Z | 2018-07-24T13:57:03.000Z | lambda_functions/download/features/aws.py | pierrealixt/MapCampaigner | 7845bda4b0f6ccb7d18905a8c77d91ba6a4f78ad | [
"BSD-3-Clause"
] | null | null | null | import os
import json
import boto3
from dependencies import yaml
class S3Data(object):
"""
Class for AWS S3
"""
def __init__(self):
"""
Initialize the s3 client.
"""
self.s3 = boto3.client('s3')
self.bucket = os.environ['S3_BUCKET']
def fetch(self, key):
... | 22.104651 | 54 | 0.510784 |
7963a6c08aaf2b6b27cfd76a721babe3b5f25785 | 3,802 | py | Python | dockerfiles/CohortVcfToZarr/test_cohort_vcf_to_zarr.py | GvandeSteeg/pipelines | 9e10e8edf1397d09a92761bc764acfec6006dd67 | [
"MIT"
] | 7 | 2020-03-25T22:44:00.000Z | 2021-03-25T09:37:43.000Z | dockerfiles/CohortVcfToZarr/test_cohort_vcf_to_zarr.py | GvandeSteeg/pipelines | 9e10e8edf1397d09a92761bc764acfec6006dd67 | [
"MIT"
] | 56 | 2020-03-25T15:41:10.000Z | 2022-01-12T19:38:10.000Z | dockerfiles/CohortVcfToZarr/test_cohort_vcf_to_zarr.py | GvandeSteeg/pipelines | 9e10e8edf1397d09a92761bc764acfec6006dd67 | [
"MIT"
] | 12 | 2020-04-01T10:32:46.000Z | 2022-03-30T07:20:11.000Z | import unittest
import subprocess
import shutil
import os
import zarr
import numpy as np
class TestScript(unittest.TestCase):
def setUp(self):
shutil.rmtree("output", ignore_errors=True)
os.mkdir("output")
def check_example_callset(self, callset):
assert "2R" in callset
conti... | 39.604167 | 68 | 0.423724 |
7963a7328396c9304a903b1e8266ec4b5bd3025b | 7,194 | py | Python | muselsl/record.py | fusefactory/muse-lsl | b713b32e93b0ed13b6ffd4d431bb29450ec0db54 | [
"BSD-3-Clause"
] | null | null | null | muselsl/record.py | fusefactory/muse-lsl | b713b32e93b0ed13b6ffd4d431bb29450ec0db54 | [
"BSD-3-Clause"
] | null | null | null | muselsl/record.py | fusefactory/muse-lsl | b713b32e93b0ed13b6ffd4d431bb29450ec0db54 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
import os
from typing import Union, List, Optional
from pathlib import Path
from pylsl import StreamInlet, resolve_byprop
from sklearn.linear_model import LinearRegression
from time import time, strftime, gmtime
from .stream import find_muse
from . import backends
from .muse impor... | 29.975 | 110 | 0.593133 |
7963a75b8dd99ec7f90a2e1240341150774bdb82 | 994 | py | Python | Code/PostProcesssor/Visualization/heatmap_gif.py | BigDataSystemTHU2018/Project-Unicom | eef8302a0213cf1709fbeb76ac7e0360be3cf79f | [
"MIT"
] | 7 | 2018-10-11T10:05:20.000Z | 2020-10-18T05:41:58.000Z | Code/PostProcesssor/Visualization/heatmap_gif.py | BigDataSystemTHU2018/Project-Unicom | eef8302a0213cf1709fbeb76ac7e0360be3cf79f | [
"MIT"
] | 2 | 2018-10-12T03:36:10.000Z | 2018-10-15T05:45:51.000Z | Code/PostProcesssor/Visualization/heatmap_gif.py | BigDataSystemTHU2018/Project-Unicom | eef8302a0213cf1709fbeb76ac7e0360be3cf79f | [
"MIT"
] | 10 | 2019-02-15T17:40:06.000Z | 2022-01-24T08:29:07.000Z | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 9 20:57:19 2018
@author: xiaofeiyu
"""
import pandas as pd
import numpy as np
import os
import imageio
import seaborn as sns
from matplotlib import pyplot as plt
File = "output_fit"
Data = p... | 21.608696 | 90 | 0.662978 |
7963a9c6bd38e156d110a02ba5e4da859aa7f8d3 | 621 | py | Python | visualise_simulator.py | TomWagg/astr507-particles-in-a-box | 8bf8e94aa227dfa58ec5800fb9708e08b285cf3d | [
"MIT"
] | null | null | null | visualise_simulator.py | TomWagg/astr507-particles-in-a-box | 8bf8e94aa227dfa58ec5800fb9708e08b285cf3d | [
"MIT"
] | null | null | null | visualise_simulator.py | TomWagg/astr507-particles-in-a-box | 8bf8e94aa227dfa58ec5800fb9708e08b285cf3d | [
"MIT"
] | null | null | null | """
visualise_simulator.py
=================
Use this file to test your simulator by visualising the results and making sure everything looks okay.
Note that you'll need to change your simulator.py code for this to actually work!!
"""
import simulator
# you probably want the size to be at least 750 a... | 27 | 106 | 0.713366 |
7963ad8f6e3e9e12f0bed073cb73935c660cbe11 | 2,309 | py | Python | tensorflow/python/training/server_lib_same_variables_no_clear_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/server_lib_same_variables_no_clear_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/training/server_lib_same_variables_no_clear_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 40.508772 | 81 | 0.709398 |
7963adec42ee82f43e4ff76cddf56fc47fbb25f6 | 773 | py | Python | intro/matplotlib/examples/plot_exercice_2.py | jorisvandenbossche/scipy-lecture-notes | 689105f90db641eb1e1f82692f4d8b8492e8245d | [
"CC-BY-3.0"
] | 3 | 2016-06-14T02:37:55.000Z | 2019-08-08T16:52:09.000Z | intro/matplotlib/examples/plot_exercice_2.py | jorisvandenbossche/scipy-lecture-notes | 689105f90db641eb1e1f82692f4d8b8492e8245d | [
"CC-BY-3.0"
] | null | null | null | intro/matplotlib/examples/plot_exercice_2.py | jorisvandenbossche/scipy-lecture-notes | 689105f90db641eb1e1f82692f4d8b8492e8245d | [
"CC-BY-3.0"
] | 2 | 2018-11-13T08:48:59.000Z | 2020-06-03T18:01:57.000Z | import pylab as pl
import numpy as np
# Create a new figure of size 8x6 points, using 100 dots per inch
pl.figure(figsize=(8, 6), dpi=80)
# Create a new subplot from a grid of 1x1
pl.subplot(111)
X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C, S = np.cos(X), np.sin(X)
# Plot cosine using blue color with a con... | 23.424242 | 73 | 0.681759 |
7963aecd36300a4e827e4e75ecb292ac6f1f046a | 3,029 | py | Python | part2.py | burakekici/Naive-Bayes-and-KNN | 6d6a309b01802298e81bf29ff1515d532b0dbc71 | [
"Apache-2.0"
] | 1 | 2019-05-19T12:01:58.000Z | 2019-05-19T12:01:58.000Z | part2.py | burakekici/Naive-Bayes-and-KNN | 6d6a309b01802298e81bf29ff1515d532b0dbc71 | [
"Apache-2.0"
] | null | null | null | part2.py | burakekici/Naive-Bayes-and-KNN | 6d6a309b01802298e81bf29ff1515d532b0dbc71 | [
"Apache-2.0"
] | null | null | null | """
Introduction to Artificial Intelligence
K-Nearest Neighbors
Due: 18.05.2017
"""
from collections import Counter
import numpy as np
from scipy.spatial import distance
from sklearn import metrics
from sklearn.datasets import load_iris
from sklearn.utils import shuffle
def main():
data = load_iris()... | 30.59596 | 110 | 0.636514 |
7963aef3ffece03548923e7109cbe03e4bfd53f4 | 4,641 | py | Python | docs/source/auto_examples/plot_otda_semi_supervised.py | dohmatob/POT | 42d0aa94e7cb49711a646fe9b263a86cdb817161 | [
"MIT"
] | null | null | null | docs/source/auto_examples/plot_otda_semi_supervised.py | dohmatob/POT | 42d0aa94e7cb49711a646fe9b263a86cdb817161 | [
"MIT"
] | null | null | null | docs/source/auto_examples/plot_otda_semi_supervised.py | dohmatob/POT | 42d0aa94e7cb49711a646fe9b263a86cdb817161 | [
"MIT"
] | 1 | 2020-06-11T08:48:35.000Z | 2020-06-11T08:48:35.000Z | # -*- coding: utf-8 -*-
"""
============================================
OTDA unsupervised vs semi-supervised setting
============================================
This example introduces a semi supervised domain adaptation in a 2D setting.
It explicits the problem of semi supervised domain adaptation and introduces
so... | 31.147651 | 78 | 0.616246 |
7963aefda43986b9b3100e40be7bd6864a16d28e | 120 | py | Python | Codewars/7kyu/minimum-ticket-cost/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codewars/7kyu/minimum-ticket-cost/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codewars/7kyu/minimum-ticket-cost/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python - 3.6.0
Test.describe('Basic tests')
Test.assert_equals(find_jane(2), 0)
Test.assert_equals(find_jane(10), 4)
| 20 | 36 | 0.733333 |
7963af8e2804c7e15bd17a810f499720a4a7bb3d | 722 | py | Python | linux-test-payments/payment_information_factory.py | T-Visor/stripe-checkout | 106aafb36a0a6a4b8ebcf1dbae2e6c001a8e3c33 | [
"MIT"
] | null | null | null | linux-test-payments/payment_information_factory.py | T-Visor/stripe-checkout | 106aafb36a0a6a4b8ebcf1dbae2e6c001a8e3c33 | [
"MIT"
] | null | null | null | linux-test-payments/payment_information_factory.py | T-Visor/stripe-checkout | 106aafb36a0a6a4b8ebcf1dbae2e6c001a8e3c33 | [
"MIT"
] | null | null | null | from visa_success import VisaSuccess
from visa_decline import VisaDecline
class PaymentInformationFactory:
"""
This class generates encapsulated payment information
objects to be used for the Stripe Checkout webpage.
"""
def get_payment_information(self, transaction_type):
""... | 24.896552 | 74 | 0.594183 |
7963af9399046bb239b27bb86b93c76304ff578e | 3,032 | py | Python | explorer.py | illBeRoy/tldr-of-the-world-data | 06d581eb117bdc79ebbe7af4f8ae4b26190d7231 | [
"MIT"
] | null | null | null | explorer.py | illBeRoy/tldr-of-the-world-data | 06d581eb117bdc79ebbe7af4f8ae4b26190d7231 | [
"MIT"
] | null | null | null | explorer.py | illBeRoy/tldr-of-the-world-data | 06d581eb117bdc79ebbe7af4f8ae4b26190d7231 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# The Explorer Utility
#
# Lets you explore a generated graph by querying it: for a given person name, it returns the ten closest neighbours.
#
# Available queries and commands are:
# 1. <Person Name>[:x] - searches for that person. case insensitive. must be spelled exactly as it is in the graph... | 32.956522 | 116 | 0.576517 |
7963afa5e91a0f4ef65387ed62c458861f174748 | 1,806 | py | Python | Employee_list/employee/views.py | Thanduxol/employee_list | e5ad3b47d1a89836d9b5e2f14521a40da31562fc | [
"MIT"
] | null | null | null | Employee_list/employee/views.py | Thanduxol/employee_list | e5ad3b47d1a89836d9b5e2f14521a40da31562fc | [
"MIT"
] | null | null | null | Employee_list/employee/views.py | Thanduxol/employee_list | e5ad3b47d1a89836d9b5e2f14521a40da31562fc | [
"MIT"
] | null | null | null | from django.http import JsonResponse
from django.urls import reverse_lazy
from django.views.generic import ListView, DetailView, TemplateView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from .models import Employee
class EmployeeListView(ListView):
model = Employee
template_name ... | 28.21875 | 96 | 0.727575 |
7963afdaaa3e571e48aa6ec603fb461cf3b78a8f | 4,806 | py | Python | 6_binary_tree.py | Akshatha-Jagadish/Data_structures | 3a2833e4f8ffa26127ba661708b45ccfac141484 | [
"MIT"
] | null | null | null | 6_binary_tree.py | Akshatha-Jagadish/Data_structures | 3a2833e4f8ffa26127ba661708b45ccfac141484 | [
"MIT"
] | null | null | null | 6_binary_tree.py | Akshatha-Jagadish/Data_structures | 3a2833e4f8ffa26127ba661708b45ccfac141484 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 31 11:56:41 2022
@author: Akshatha
"""
class Binary_Tree_Node():
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def add_child(self, data):
if self.data == data:
ret... | 32.255034 | 77 | 0.516438 |
7963afe84e0605083ec5111893ab8d4801355355 | 238 | py | Python | 15_lattice.py | jrialland/project_euler | 64e7c461182675ffe50ad4cd74f262384ee58591 | [
"Unlicense"
] | null | null | null | 15_lattice.py | jrialland/project_euler | 64e7c461182675ffe50ad4cd74f262384ee58591 | [
"Unlicense"
] | null | null | null | 15_lattice.py | jrialland/project_euler | 64e7c461182675ffe50ad4cd74f262384ee58591 | [
"Unlicense"
] | null | null | null |
paths={}
def n_paths(x,y):
if (x,y) in paths:
return paths[x,y]
if x == 0:
return 1
if y == 0:
return 1
p = n_paths(x-1,y) + n_paths(x, y-1)
paths[x,y] = p
return p
print n_paths(20,20)
| 14.875 | 40 | 0.483193 |
7963b0a189192d6e1e3084d3522a17b8f660df8c | 1,569 | py | Python | sa/profiles/Dahua/DH/profile.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/Dahua/DH/profile.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/Dahua/DH/profile.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Vendor: Dahua
# OS: DH
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Pyth... | 31.38 | 99 | 0.460803 |
7963b0a270456e7cae733d9c27b5915993d2b991 | 1,565 | py | Python | tmt/steps/provision/localhost.py | rasibley/tmt | 1b33dd901e875c5fc496f4654755dfc9f4009627 | [
"MIT"
] | null | null | null | tmt/steps/provision/localhost.py | rasibley/tmt | 1b33dd901e875c5fc496f4654755dfc9f4009627 | [
"MIT"
] | null | null | null | tmt/steps/provision/localhost.py | rasibley/tmt | 1b33dd901e875c5fc496f4654755dfc9f4009627 | [
"MIT"
] | 1 | 2020-05-09T07:25:19.000Z | 2020-05-09T07:25:19.000Z | import os
from click import echo
from tmt.steps.provision.base import ProvisionBase
from tmt.utils import SpecificationError
class ProvisionLocalhost(ProvisionBase):
""" Localhost provisioner """
def __init__(self, data, step):
super(ProvisionLocalhost, self).__init__(data, step)
self._prepa... | 35.568182 | 79 | 0.6377 |
7963b29438f3dfb0d4648952fdb7382bef59c236 | 3,439 | py | Python | model_compression_toolkit/common/quantization/quantization_analyzer.py | isabella232/model_optimization | 074d1dfd8b4d18e57c6186c0ec5e49eb17a0fc7a | [
"Apache-2.0"
] | null | null | null | model_compression_toolkit/common/quantization/quantization_analyzer.py | isabella232/model_optimization | 074d1dfd8b4d18e57c6186c0ec5e49eb17a0fc7a | [
"Apache-2.0"
] | null | null | null | model_compression_toolkit/common/quantization/quantization_analyzer.py | isabella232/model_optimization | 074d1dfd8b4d18e57c6186c0ec5e49eb17a0fc7a | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Sony Semiconductors Israel, Inc. 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 b... | 48.43662 | 155 | 0.692643 |
7963b2f456a7ba5cea3ccafdf968b3e672528783 | 923,833 | py | Python | Lib/site-packages/phonenumbers/geodata/data19.py | Vijetha-nrupathunga/courier-service | 6c71370e6e9b0911645e81d8d0c8cf0bcd8cddf5 | [
"bzip2-1.0.6"
] | 1 | 2021-03-26T11:11:59.000Z | 2021-03-26T11:11:59.000Z | Lib/site-packages/phonenumbers/geodata/data19.py | Vijetha-nrupathunga/courier-service | 6c71370e6e9b0911645e81d8d0c8cf0bcd8cddf5 | [
"bzip2-1.0.6"
] | 10 | 2020-05-11T20:29:28.000Z | 2022-01-13T01:41:27.000Z | oscar/lib/python3.6/site-packages/phonenumbers/geodata/data19.py | aiegoo/oscar | ab9b8a278cbc92a76ef2a92347cc44ced5a4e1d3 | [
"BSD-3-Clause"
] | 1 | 2021-03-26T11:12:00.000Z | 2021-03-26T11:12:00.000Z | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2019 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 92.171306 | 139 | 0.649017 |
7963b3dc277e48d42fd2e03c1cb98fc8ff1a853b | 5,951 | py | Python | ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py | hortonworks/ambari-perf | 71305effa9ac00e2e9adb36e6a66a13c9105a811 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py | hortonworks/ambari-perf | 71305effa9ac00e2e9adb36e6a66a13c9105a811 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqsegment.py | hortonworks/ambari-perf | 71305effa9ac00e2e9adb36e6a66a13c9105a811 | [
"Apache-2.0",
"MIT"
] | 3 | 2017-10-31T11:42:31.000Z | 2021-04-26T07:17:53.000Z | #!/usr/bin/env python
'''
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")... | 33.432584 | 119 | 0.654008 |
7963b3fc643c6f7eef505e6a26606693283d67e9 | 6,133 | py | Python | azure-mgmt-datafactory/azure/mgmt/datafactory/models/hbase_linked_service_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-datafactory/azure/mgmt/datafactory/models/hbase_linked_service_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-datafactory/azure/mgmt/datafactory/models/hbase_linked_service_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.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 ... | 53.330435 | 370 | 0.69656 |
7963b5b6b7f03eee11183d4d05b9556e7710a9b5 | 6,886 | py | Python | app/app/settings.py | erikamenezes/doccano | 59e8f8a4368adb68a2e43e1aac287848ba109496 | [
"MIT"
] | null | null | null | app/app/settings.py | erikamenezes/doccano | 59e8f8a4368adb68a2e43e1aac287848ba109496 | [
"MIT"
] | null | null | null | app/app/settings.py | erikamenezes/doccano | 59e8f8a4368adb68a2e43e1aac287848ba109496 | [
"MIT"
] | null | null | null | """
Django settings for app project.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
Any setting that is configured via an environment variable may
also be set in a `.... | 30.069869 | 91 | 0.713622 |
7963b71a7672c6e7e5ae6e613d52f0253fd4b9b5 | 1,901 | py | Python | FrogGems/Bug.py | IrvKalb/pygwidgetsExamples | 0239edfc8553bf51a95d330107dfec48ff1581c1 | [
"BSD-3-Clause"
] | 1 | 2022-01-05T13:35:08.000Z | 2022-01-05T13:35:08.000Z | FrogGems/Bug.py | IrvKalb/pygwidgetsExamples | 0239edfc8553bf51a95d330107dfec48ff1581c1 | [
"BSD-3-Clause"
] | null | null | null | FrogGems/Bug.py | IrvKalb/pygwidgetsExamples | 0239edfc8553bf51a95d330107dfec48ff1581c1 | [
"BSD-3-Clause"
] | null | null | null | # Bug class
from Constants import *
import pygwidgets
import random
MOVE_LR = 'Left to Right'
MOVE_RL = 'Right to Left'
class Bug():
def __init__(self, window, id):
self.window = window
self.id = id
# Load pictures Left to Right and Right to Left
self.pictureLR = pygwidgets.Image... | 31.683333 | 82 | 0.573908 |
7963b774fec5765891a89af8f33be72a8f343a7f | 2,365 | py | Python | src/main/python/tests/onnx_systemds/test_simple.py | abhishek3100/systemds | ccb9b08e8d406e8b7b2093e1df9adc2c3158c554 | [
"Apache-2.0"
] | null | null | null | src/main/python/tests/onnx_systemds/test_simple.py | abhishek3100/systemds | ccb9b08e8d406e8b7b2093e1df9adc2c3158c554 | [
"Apache-2.0"
] | 1 | 2020-06-02T08:07:02.000Z | 2020-06-02T08:07:02.000Z | src/main/python/tests/onnx_systemds/test_simple.py | abhishek3100/systemds | ccb9b08e8d406e8b7b2093e1df9adc2c3158c554 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to you under the Apache License, Version 2.0
# (the "License"); you may not use ... | 35.833333 | 74 | 0.734884 |
7963b787cdb120e256898e897ace99c2d96253ae | 604 | py | Python | utils/plot.py | jairotunior/gym-trading | d4ccd33db600328bcc99e255bf0ec52ff9ab03f6 | [
"MIT"
] | null | null | null | utils/plot.py | jairotunior/gym-trading | d4ccd33db600328bcc99e255bf0ec52ff9ab03f6 | [
"MIT"
] | null | null | null | utils/plot.py | jairotunior/gym-trading | d4ccd33db600328bcc99e255bf0ec52ff9ab03f6 | [
"MIT"
] | null | null | null | import numpy
def fig2data(fig):
"""
@brief Convert a Matplotlib figure to a 4D numpy array with RGBA channels and return it
@param fig a matplotlib figure
@return a numpy 3D array of RGBA values
"""
# draw the renderer
fig.canvas.draw()
# Get the RGBA buffer from the figure
w, h =... | 28.761905 | 99 | 0.675497 |
7963b7d94917ac578b9287e7b05fcd21c809176f | 812 | py | Python | dtunet/api/admin.py | yashgupta417/DTUNET-Backend | 80a5cea84842155ca0196312d69517308fceb57f | [
"MIT"
] | 1 | 2020-07-04T07:28:02.000Z | 2020-07-04T07:28:02.000Z | dtunet/api/admin.py | yashgupta417/DTUNET-Backend | 80a5cea84842155ca0196312d69517308fceb57f | [
"MIT"
] | null | null | null | dtunet/api/admin.py | yashgupta417/DTUNET-Backend | 80a5cea84842155ca0196312d69517308fceb57f | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import User
class UserAdmin(BaseUserAdmin):
fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('name','label','bio','image','is_online','following')}),
... | 30.074074 | 94 | 0.603448 |
7963b7da91d86cd7a8f740a6481bf88419eb75c8 | 3,213 | py | Python | torch_scatter/composite/softmax.py | Novare/pytorch_scatter | 6733f0e290797267df92eacd38914d093f679e73 | [
"MIT"
] | 1 | 2020-04-21T13:10:17.000Z | 2020-04-21T13:10:17.000Z | torch_scatter/composite/softmax.py | Novare/pytorch_scatter | 6733f0e290797267df92eacd38914d093f679e73 | [
"MIT"
] | null | null | null | torch_scatter/composite/softmax.py | Novare/pytorch_scatter | 6733f0e290797267df92eacd38914d093f679e73 | [
"MIT"
] | null | null | null | import torch
from torch_scatter import scatter_add, scatter_max
from torch_scatter.utils.gen import broadcast
def scatter_softmax(src, index, dim=-1, eps=1e-12):
r"""
Softmax operation over all values in :attr:`src` tensor that share indices
specified in the :attr:`index` tensor along a given axis :attr:... | 35.7 | 79 | 0.656396 |
7963b917a6aae24310829f3e65b2cbb2125e0039 | 1,292 | py | Python | Python3/Problem69.py | humford/ProjectEulerSolutions | 8339c29658e8704a07f8a586788778e560ad807f | [
"CNRI-Python"
] | 3 | 2016-06-26T17:46:21.000Z | 2017-02-14T21:06:24.000Z | Python3/Problem69.py | LieutenantHawkeye/ProjectEulerSolutions | 8339c29658e8704a07f8a586788778e560ad807f | [
"CNRI-Python"
] | null | null | null | Python3/Problem69.py | LieutenantHawkeye/ProjectEulerSolutions | 8339c29658e8704a07f8a586788778e560ad807f | [
"CNRI-Python"
] | 1 | 2017-08-09T14:28:36.000Z | 2017-08-09T14:28:36.000Z | import math
import time
def ASieve(limit):
is_prime = [False] * (limit + 1)
for x in range(1, int(math.sqrt(limit)) + 1):
for y in range(1, int(math.sqrt(limit)) + 1):
n = 4 * x ** 2 + y ** 2
if n <= limit and (n % 12 == 1 or n % 12 == 5):
is_prime[n] = not is_... | 26.367347 | 67 | 0.506966 |
7963b950170256500e2999cc1e4f5176b52c9846 | 22,328 | py | Python | sdk/python/pulumi_ovh/public_cloud_user.py | tumblewader/pulumi-ovh | fd484de69a247cf4f05c22cf73f1c57b973a1dab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_ovh/public_cloud_user.py | tumblewader/pulumi-ovh | fd484de69a247cf4f05c22cf73f1c57b973a1dab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_ovh/public_cloud_user.py | tumblewader/pulumi-ovh | fd484de69a247cf4f05c22cf73f1c57b973a1dab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 41.424861 | 134 | 0.638929 |
7963ba88affe80806fc83fb281663085ca579405 | 11,662 | py | Python | sympy/functions/special/tensor_functions.py | sn6uv/sympy | 5b149c2f72847e4785c65358b09d99b29f101dd5 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/special/tensor_functions.py | sn6uv/sympy | 5b149c2f72847e4785c65358b09d99b29f101dd5 | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/special/tensor_functions.py | sn6uv/sympy | 5b149c2f72847e4785c65358b09d99b29f101dd5 | [
"BSD-3-Clause"
] | null | null | null | from sympy.core.function import Function, C
from sympy.core import S, Integer
from sympy.core.mul import prod
from sympy.utilities.iterables import has_dups
###############################################################################
###################### Kronecker Delta, Levi-Civita etc. ######################
##... | 26.809195 | 79 | 0.547247 |
7963ba8a3dbb21f30bb0f0e53105c587e102467b | 823 | py | Python | modules/settlement_pay/urls.py | xuhuiliang-maybe/ace_office | 07fae18676a193206802e8fb9aa32a805b1da24c | [
"Apache-2.0"
] | 1 | 2018-11-27T08:08:07.000Z | 2018-11-27T08:08:07.000Z | modules/settlement_pay/urls.py | xuhuiliang-maybe/ace_office | 07fae18676a193206802e8fb9aa32a805b1da24c | [
"Apache-2.0"
] | null | null | null | modules/settlement_pay/urls.py | xuhuiliang-maybe/ace_office | 07fae18676a193206802e8fb9aa32a805b1da24c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from django.conf.urls import url
from modules.settlement_pay.code import payroll_add
from modules.settlement_pay.code import payroll_del
from modules.settlement_pay.code import payroll_edit
from modules.settlement_pay.code import payroll_list
from modules.settlement_pay.models import Payroll
# 结算发薪
url... | 43.315789 | 112 | 0.759417 |
7963bc16c0a27519fb84f0757a4dcb322c8b10c8 | 2,419 | py | Python | SEPHIRA/FastAPI/modules/JWT/jwt.py | dman926/Flask-API | 49e052159a3915ec25305141ecdd6cdeb1d7a25c | [
"MIT"
] | 4 | 2021-04-23T16:51:57.000Z | 2021-06-06T20:28:08.000Z | SEPHIRA/FastAPI/modules/JWT/jwt.py | dman926/Flask-API | 49e052159a3915ec25305141ecdd6cdeb1d7a25c | [
"MIT"
] | 15 | 2021-10-22T01:55:53.000Z | 2022-01-15T11:40:48.000Z | SEPHIRA/FastAPI/modules/JWT/jwt.py | dman926/Flask-API | 49e052159a3915ec25305141ecdd6cdeb1d7a25c | [
"MIT"
] | 3 | 2021-03-21T22:29:05.000Z | 2021-06-06T20:30:18.000Z | from typing import Optional
from fastapi import HTTPException, Depends
from fastapi.security import OAuth2PasswordBearer
from pydantic import BaseModel
from jose import jwt
from jose.jwt import JWTError, ExpiredSignatureError, JWTClaimsError
from datetime import datetime, timedelta
from config import OAuth2Settings, A... | 31.828947 | 127 | 0.750723 |
7963bc7bce47662a192694a2fe3da1e40c85fd71 | 14,085 | py | Python | resolwe/flow/tests/test_executors.py | dblenkus/resolwe | d64cd9bc7d77b383771a54e01b5db136abb23767 | [
"Apache-2.0"
] | null | null | null | resolwe/flow/tests/test_executors.py | dblenkus/resolwe | d64cd9bc7d77b383771a54e01b5db136abb23767 | [
"Apache-2.0"
] | null | null | null | resolwe/flow/tests/test_executors.py | dblenkus/resolwe | d64cd9bc7d77b383771a54e01b5db136abb23767 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=missing-docstring
import os
import subprocess
import unittest
from pathlib import Path
from unittest import mock
from django.conf import settings
from django.test import override_settings
from guardian.shortcuts import assign_perm
from resolwe.flow.executors.prepare import BaseFlowExecutorPreparer
... | 38.274457 | 88 | 0.663827 |
7963bc9b2c8599707392aef014e2daa52aca242d | 7,883 | py | Python | per.py | jsztompka/DuelDQN | 3b1234425b66034ef233ac988305dc13ffbf7ace | [
"MIT"
] | null | null | null | per.py | jsztompka/DuelDQN | 3b1234425b66034ef233ac988305dc13ffbf7ace | [
"MIT"
] | null | null | null | per.py | jsztompka/DuelDQN | 3b1234425b66034ef233ac988305dc13ffbf7ace | [
"MIT"
] | null | null | null | import numpy as np
from collections import namedtuple, deque
import torch
import config
device = config.device
class SumTree():
"""
This SumTree code is modified version and the original code is from:
https://github.com/jaara/AI-blog/blob/master/SumTree.py
Store the data with its priority in tree an... | 41.272251 | 133 | 0.594444 |
7963bcc5134104d828e3d4786de2ea61be070923 | 555 | py | Python | exasol_integration_test_docker_environment/testing/luigi_utils.py | exasol/integration-test-docker-environment | 35850f67cd4cde010f03dd556d1a0f74b3291eb8 | [
"MIT"
] | 4 | 2020-06-25T20:47:31.000Z | 2021-09-10T15:22:51.000Z | exasol_integration_test_docker_environment/testing/luigi_utils.py | exasol/integration-test-docker-environment | 35850f67cd4cde010f03dd556d1a0f74b3291eb8 | [
"MIT"
] | 113 | 2020-06-02T08:51:08.000Z | 2022-03-31T08:47:41.000Z | exasol_integration_test_docker_environment/testing/luigi_utils.py | exasol/integration-test-docker-environment | 35850f67cd4cde010f03dd556d1a0f74b3291eb8 | [
"MIT"
] | 2 | 2020-05-19T10:57:47.000Z | 2020-06-22T13:32:20.000Z | import shutil
import luigi
from exasol_integration_test_docker_environment.cli.common import generate_root_task
from exasol_integration_test_docker_environment.lib.docker.images.clean.clean_images import CleanImagesStartingWith
def clean(docker_repository_name):
task = generate_root_task(task_class=CleanImagesS... | 39.642857 | 115 | 0.832432 |
7963bd5164b73cc865abd819a32c168e5a9b3502 | 8,934 | py | Python | 11_data_science/pdf/pdfminer_extract_text.py | edgardeng/python-advance-interview | 59fd7bee8e871acdc7fdfecf2a110db840c47ebb | [
"Apache-2.0"
] | 1 | 2022-03-06T13:03:56.000Z | 2022-03-06T13:03:56.000Z | 11_data_science/pdf/pdfminer_extract_text.py | edgardeng/python-advance-interview | 59fd7bee8e871acdc7fdfecf2a110db840c47ebb | [
"Apache-2.0"
] | null | null | null | 11_data_science/pdf/pdfminer_extract_text.py | edgardeng/python-advance-interview | 59fd7bee8e871acdc7fdfecf2a110db840c47ebb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @author: edgardeng
# @date: 2021-05-25
# @file: 使用PdfMine 提取文字 (pdfminer.six == 20201018)
import base64
import math
import time
import pdfminer
from pdfminer.converter import PDFPageAggregator
from pdfminer.pdfdocument import PDFTextExtractionNotAllowed, PDFDocument
from pdfminer.pdfinterp... | 40.243243 | 120 | 0.570181 |
7963be6250dae2fadb3dcc02c95fdc729c2903c8 | 104 | py | Python | NeuralNetwork/__init__.py | javier-op/MyNeuralNetwork | 6cd0f21c720c01e1794a8d5ed59e7b473318b6e2 | [
"MIT"
] | null | null | null | NeuralNetwork/__init__.py | javier-op/MyNeuralNetwork | 6cd0f21c720c01e1794a8d5ed59e7b473318b6e2 | [
"MIT"
] | null | null | null | NeuralNetwork/__init__.py | javier-op/MyNeuralNetwork | 6cd0f21c720c01e1794a8d5ed59e7b473318b6e2 | [
"MIT"
] | null | null | null | from NeuralNetwork.NeuralNetwork import NeuralNetwork
from NeuralNetwork.NeuronLayer import NeuronLayer
| 34.666667 | 53 | 0.903846 |
7963be76f603da5bdf53c5722e4ec22eba41b16f | 1,181 | py | Python | setup.py | xelzmm/macholibre | 688da18751b97dab85998bfce5ad78bb9d0b42b0 | [
"Apache-2.0"
] | null | null | null | setup.py | xelzmm/macholibre | 688da18751b97dab85998bfce5ad78bb9d0b42b0 | [
"Apache-2.0"
] | null | null | null | setup.py | xelzmm/macholibre | 688da18751b97dab85998bfce5ad78bb9d0b42b0 | [
"Apache-2.0"
] | 1 | 2019-12-11T07:52:59.000Z | 2019-12-11T07:52:59.000Z | from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
NEWS = open(os.path.join(here, 'NEWS.txt')).read()
version = '0.1'
install_requires = [
# List your project dependencies here.
# For more detail... | 26.244444 | 82 | 0.681626 |
7963c10738b0d06a465c38078eec8d978c04c9a9 | 767 | py | Python | setup.py | Eventz-Framework/eventz-aws | 1cf155851282ce3cab2dec0ea1dcdd38ff583081 | [
"MIT"
] | null | null | null | setup.py | Eventz-Framework/eventz-aws | 1cf155851282ce3cab2dec0ea1dcdd38ff583081 | [
"MIT"
] | null | null | null | setup.py | Eventz-Framework/eventz-aws | 1cf155851282ce3cab2dec0ea1dcdd38ff583081 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE!
# This file has been autogenerated by dephell <3
# https://github.com/dephell/dephell
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = ''
setup(
long_description=readme,
name='eventz-aws',
version='0... | 26.448276 | 103 | 0.615385 |
7963c1a2b5ea759e48e4ad4b9c190658da95ccfb | 28,620 | py | Python | electrum/util.py | bismuthfoundation/alliage | b5db6afcaea8f4c975248f6cca816c143f1c5779 | [
"MIT"
] | 1 | 2020-03-28T04:25:54.000Z | 2020-03-28T04:25:54.000Z | electrum/util.py | bismuthfoundation/alliage | b5db6afcaea8f4c975248f6cca816c143f1c5779 | [
"MIT"
] | null | null | null | electrum/util.py | bismuthfoundation/alliage | b5db6afcaea8f4c975248f6cca816c143f1c5779 | [
"MIT"
] | null | null | null | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# 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... | 30.54429 | 119 | 0.605625 |
7963c2437c8cdef472031140d9ea3f6609904098 | 7,179 | py | Python | src/compas/geometry/_shapes/capsule.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | 2 | 2021-03-17T18:14:22.000Z | 2021-09-19T13:50:02.000Z | src/compas/geometry/_shapes/capsule.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | src/compas/geometry/_shapes/capsule.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from math import cos
from math import pi
from math import sin
from compas.geometry import matrix_from_frame
from compas.geometry import transform_points
from compas.geometry import Frame
from compas.geometry i... | 27.090566 | 80 | 0.492687 |
7963c45a1f3268450fe95d4f536bc50f59368ed9 | 1,842 | py | Python | tfx/v1/orchestration/experimental/__init__.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | tfx/v1/orchestration/experimental/__init__.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | tfx/v1/orchestration/experimental/__init__.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC. 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 law or a... | 46.05 | 105 | 0.807818 |
7963c620e79a100b4e0515df5924a9ea65630ff4 | 1,675 | py | Python | precise/skaters/covariance/bufskfactory.py | OVVO-Financial/precise | ce744cadfca18f4ab77c68cc27bf8d712561127f | [
"MIT"
] | null | null | null | precise/skaters/covariance/bufskfactory.py | OVVO-Financial/precise | ce744cadfca18f4ab77c68cc27bf8d712561127f | [
"MIT"
] | null | null | null | precise/skaters/covariance/bufskfactory.py | OVVO-Financial/precise | ce744cadfca18f4ab77c68cc27bf8d712561127f | [
"MIT"
] | null | null | null | import numpy as np
from precise.skaters.covarianceutil.conventions import X_TYPE, X_DATA_TYPE, is_data
from precise.skaters.covariance.buffactory import buf_pcov_factory
from precise.skaters.covarianceutil.datacovfunctions import pcov_of_columns
import warnings
def buf_sk_factory(cls, y:X_TYPE=None, s:dict=None, n_b... | 37.222222 | 124 | 0.614925 |
7963c6b111a50d5f1f2757431b4afdf67c1afe70 | 3,911 | py | Python | player.py | NicolasM3/python-shooter | fef75a19bd3041b5c6969ad93847f70b6bc617b1 | [
"Apache-2.0"
] | null | null | null | player.py | NicolasM3/python-shooter | fef75a19bd3041b5c6969ad93847f70b6bc617b1 | [
"Apache-2.0"
] | null | null | null | player.py | NicolasM3/python-shooter | fef75a19bd3041b5c6969ad93847f70b6bc617b1 | [
"Apache-2.0"
] | null | null | null | from shoot import shoot
from sprite import sprite
import pygame
# Dicionário de direções
# cada chave apresenta uma tupla com o movimento x, y
# 0 - não movimenta
# 1 - movimenta
dicionario_direction = {
0: (0, -1), 1: (1, -1), 2: (1, 0), 3: (1, 1), 4: (0, 1), 5: (-1, 1), 6: (-1, 0), 7: (-1, -1)
}
class Player:
... | 34.008696 | 126 | 0.583227 |
7963c7127f6a723bec37f0db7920beeb18bd777b | 2,418 | py | Python | dashboard/frontend/treemap.py | AndreWohnsland/CocktailBerry | 60b2dfc3a4a6f3ef9ab2d946a97d14829e575a9d | [
"MIT"
] | 1 | 2022-03-06T23:50:34.000Z | 2022-03-06T23:50:34.000Z | dashboard/frontend/treemap.py | AndreWohnsland/CocktailBerry | 60b2dfc3a4a6f3ef9ab2d946a97d14829e575a9d | [
"MIT"
] | 4 | 2022-03-03T11:16:17.000Z | 2022-03-20T15:53:37.000Z | dashboard/frontend/treemap.py | AndreWohnsland/CocktailBerry | 60b2dfc3a4a6f3ef9ab2d946a97d14829e575a9d | [
"MIT"
] | null | null | null | import json
import os
import warnings
import requests
import plotly.express as px
import pandas as pd
from language import language
from store import store
# something from plotly triggers pandas warnign
warnings.filterwarnings("ignore")
DF_START = pd.DataFrame(
[(language.DEFAULT_MESSAGE, language.CALL_TO_ACTIO... | 35.558824 | 109 | 0.674524 |
7963c84917d4bd6b401c8e7fe9b9605f2eb13f5c | 5,198 | py | Python | testproject/django_file_form_example/views.py | nklsw/django-file-form | c941da77505e259cbfc59b89f3a107aad41033c6 | [
"Apache-2.0"
] | null | null | null | testproject/django_file_form_example/views.py | nklsw/django-file-form | c941da77505e259cbfc59b89f3a107aad41033c6 | [
"Apache-2.0"
] | null | null | null | testproject/django_file_form_example/views.py | nklsw/django-file-form | c941da77505e259cbfc59b89f3a107aad41033c6 | [
"Apache-2.0"
] | null | null | null | import json
from django.core.files.storage import FileSystemStorage
from django.http import HttpResponseForbidden, HttpResponseRedirect
from django.views import generic
from django.urls import reverse
from django.conf import settings
from django.views.generic.base import ContextMixin
from formtools.wizard.views import... | 28.25 | 85 | 0.678915 |
7963c87640431e4ec29240e205d53b4df009c19c | 6,711 | py | Python | src/main.py | vamsi3/pix2pix | 379577417d7b7e5141147ad66db7a1cede27debe | [
"MIT"
] | 2 | 2019-07-04T01:31:12.000Z | 2019-12-04T06:10:15.000Z | src/main.py | vamsi3/pix2pix | 379577417d7b7e5141147ad66db7a1cede27debe | [
"MIT"
] | null | null | null | src/main.py | vamsi3/pix2pix | 379577417d7b7e5141147ad66db7a1cede27debe | [
"MIT"
] | 2 | 2021-08-13T03:56:57.000Z | 2022-01-06T18:42:28.000Z | import argparse
import csv
import os
import time
import torch
import torchvision
from data import dataloader
from model import Pix2Pix
EXECUTION_ID = time.strftime('%m_%d_%H_%M_%S')
parser = argparse.ArgumentParser()
# Data
parser.add_argument('--data_root', required=True, type=str)
parser.add_argument('--data_res... | 45.040268 | 141 | 0.608255 |
7963c95b3c119da6f9c39082df7ef6915b518b82 | 4,193 | py | Python | salt/returners/etcd_return.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | salt/returners/etcd_return.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/returners/etcd_return.py | bogdanr/salt | 4f198525873a1b7da3fbb9994dbb40d381494922 | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
Return data to an etcd server or cluster
:depends: - python-etcd
In order to return to an etcd server, a profile should be created in the master
configuration file:
.. code-block:: yaml
my_etcd_config:
etcd.host: 127.0.0.1
etcd.port: 4001
It is technically possible to co... | 23.55618 | 80 | 0.635106 |
7963c982159a02cea3509aa05165677d3c8fd969 | 512 | py | Python | cdk/tests/unit/test_stages_ci.py | IGVF-DACC/igvfd | 432d711a3a245182fc797eef21580158c1a713e6 | [
"MIT"
] | 1 | 2022-01-20T23:10:34.000Z | 2022-01-20T23:10:34.000Z | cdk/tests/unit/test_stages_ci.py | IGVF-DACC/igvfd | 432d711a3a245182fc797eef21580158c1a713e6 | [
"MIT"
] | 8 | 2022-02-24T00:34:29.000Z | 2022-03-30T01:02:47.000Z | cdk/tests/unit/test_stages_ci.py | IGVF-DACC/igvfd | 432d711a3a245182fc797eef21580158c1a713e6 | [
"MIT"
] | null | null | null | import pytest
from aws_cdk.assertions import Template
def test_stages_ci_initialize_ci_stage():
from aws_cdk import Stage
from aws_cdk import App
from infrastructure.stages.ci import CIDeployStage
app = App()
ci_deploy_stage = CIDeployStage(
app,
'TestCIDeployStage',
)
clo... | 23.272727 | 55 | 0.689453 |
7963c987c1a3ec5de87bdd4e75144db3ce1e4d1b | 1,558 | py | Python | Wastewater exchange/trainD_Video.py | seungsikchi/SmartFactory_Sambo | 6395117c8b7271478e12145acac79c686a6825aa | [
"MIT"
] | 2 | 2021-08-20T08:06:02.000Z | 2021-09-03T13:57:19.000Z | Wastewater exchange/trainD_Video.py | seungsikchi/SmartFactory_Sambo | 6395117c8b7271478e12145acac79c686a6825aa | [
"MIT"
] | null | null | null | Wastewater exchange/trainD_Video.py | seungsikchi/SmartFactory_Sambo | 6395117c8b7271478e12145acac79c686a6825aa | [
"MIT"
] | 1 | 2021-12-16T12:36:46.000Z | 2021-12-16T12:36:46.000Z | import cv2
import datetime
import time
path = './Module/train_img/'
cap = cv2.VideoCapture(1, cv2.CAP_DSHOW) # 종료할 때 [WARN:0]오류 제거
# print('width :%d, height : %d' % (cap.get(3), cap.get(4)))
n = 1
while(True):
ret, frame = cap.read() # ret은 정상적으로 작동하는지 반환(True, False), frame은 이미지를 넘파이배열 형대로 가져옴
# 비디오... | 32.458333 | 94 | 0.548139 |
7963c9f71677665050375fccd829a8a34d8fc198 | 41,149 | py | Python | trace/google/cloud/trace_v1/proto/trace_pb2.py | q-logic/google-cloud-python | a65065c89c059bc564bbdd79288a48970907c399 | [
"Apache-2.0"
] | null | null | null | trace/google/cloud/trace_v1/proto/trace_pb2.py | q-logic/google-cloud-python | a65065c89c059bc564bbdd79288a48970907c399 | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | trace/google/cloud/trace_v1/proto/trace_pb2.py | q-logic/google-cloud-python | a65065c89c059bc564bbdd79288a48970907c399 | [
"Apache-2.0"
] | 2 | 2019-07-18T00:05:31.000Z | 2019-11-27T14:17:22.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/devtools/cloudtrace_v1/proto/trace.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import mes... | 37.104599 | 3,556 | 0.629371 |
7963cbc10e5a70eeefd37d6791666098e3fc6d2c | 3,473 | py | Python | tests/cli/test_utils.py | erinliao/dss_oust | 2c80a58fe0ca97e7e4f3069a578e5d3e43299d93 | [
"Apache-2.0"
] | 1 | 2019-10-10T05:43:34.000Z | 2019-10-10T05:43:34.000Z | tests/cli/test_utils.py | erinliao/dss_oust | 2c80a58fe0ca97e7e4f3069a578e5d3e43299d93 | [
"Apache-2.0"
] | 5 | 2020-09-26T00:20:53.000Z | 2022-02-10T00:26:22.000Z | tests/cli/test_utils.py | erinliao/dss_oust | 2c80a58fe0ca97e7e4f3069a578e5d3e43299d93 | [
"Apache-2.0"
] | null | null | null | import contextlib
import logging
import os
import pathlib
import sys
import tempfile
import pytest
from _pytest.logging import LogCaptureFixture
import rasa.cli.utils
from rasa.cli.utils import (
parse_last_positional_argument_as_model_path,
get_validated_path,
)
from tests.conftest import assert_log_emitted
... | 26.715385 | 88 | 0.680104 |
7963cc8db8d61f76b441a2ffc958b8d774399eeb | 5,489 | py | Python | Analysis_protocol/post_trans_JS_divergence.py | obrien-lab/cg_simtk_protain_folding | c64aa49696afe6fc1680c083cda556697d937f52 | [
"MIT"
] | null | null | null | Analysis_protocol/post_trans_JS_divergence.py | obrien-lab/cg_simtk_protain_folding | c64aa49696afe6fc1680c083cda556697d937f52 | [
"MIT"
] | null | null | null | Analysis_protocol/post_trans_JS_divergence.py | obrien-lab/cg_simtk_protain_folding | c64aa49696afe6fc1680c083cda556697d937f52 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys, getopt, math, os, time, traceback
import numpy as np
from scipy.stats import entropy
################################# Arguments ###################################
# Default parameters
dt = 0.015/1000
nsave = 5000
alpha = 4331293.0
n_window = 200
n_traj = 100
num_rep = 10
mutant_typ... | 31.011299 | 137 | 0.547823 |
7963cdb225b76a861809ffeae393188497dd41da | 3,350 | py | Python | pextant/api.py | norheim/pextant | f4235719279c0e6f178ae1e0f8b1ea3346533915 | [
"MIT"
] | null | null | null | pextant/api.py | norheim/pextant | f4235719279c0e6f178ae1e0f8b1ea3346533915 | [
"MIT"
] | 1 | 2019-12-03T03:52:41.000Z | 2019-12-04T14:50:36.000Z | pextant/api.py | norheim/pextant | f4235719279c0e6f178ae1e0f8b1ea3346533915 | [
"MIT"
] | 1 | 2019-12-03T02:37:57.000Z | 2019-12-03T02:37:57.000Z | import csv
import json
import logging
import re
from pextant.solvers.astarMesh import astarSolver
from pextant.analysis.loadWaypoints import JSONloader
import matplotlib.pyplot as plt
logger = logging.getLogger()
class Pathfinder:
"""
This class performs the A* path finding algorithm and contains the Cost Func... | 41.358025 | 104 | 0.675522 |
7963ce8439e8a541e3c929af1aca00a4a066614a | 2,974 | py | Python | advance/Snake_water_gun/main.py | plerin/playground_with_python | 221362b47e456656749455d82bb3c611fa8f4440 | [
"MIT"
] | null | null | null | advance/Snake_water_gun/main.py | plerin/playground_with_python | 221362b47e456656749455d82bb3c611fa8f4440 | [
"MIT"
] | null | null | null | advance/Snake_water_gun/main.py | plerin/playground_with_python | 221362b47e456656749455d82bb3c611fa8f4440 | [
"MIT"
] | null | null | null | '''
code by : https://github.com/geekcomputers/Python/tree/master/Snake_water_gun
learn about this
- input styling
한두 줄이 아닌 여러 부분에서 사용을 해야 하는 경우라면 글로벌 혹은 클래스
class bcolors:
HEADERS = "\033[95m"
OKBLUE = "\033[94m"
OKGREEN = "\033[93m"
WARNING = "\033[92m"
FAIL = "\033[91m"
ENDC = "\033[0m"
... | 25.20339 | 87 | 0.580363 |
7963d0f4ddfc20bd8286e0c237859b84a2095ecb | 1,702 | py | Python | examples/cartpole_orig/independent.py | imanolarrieta/RL | 072a8c328652f45e053baecd640f04adf7f84b49 | [
"BSD-3-Clause"
] | 1 | 2019-12-07T13:47:43.000Z | 2019-12-07T13:47:43.000Z | examples/cartpole_orig/independent.py | imanolarrieta/RL | 072a8c328652f45e053baecd640f04adf7f84b49 | [
"BSD-3-Clause"
] | null | null | null | examples/cartpole_orig/independent.py | imanolarrieta/RL | 072a8c328652f45e053baecd640f04adf7f84b49 | [
"BSD-3-Clause"
] | null | null | null | """
Cart-pole balancing with independent discretization
"""
from rlpy.Domains.FiniteTrackCartPole import FiniteCartPoleBalanceOriginal, FiniteCartPoleBalanceModern
from rlpy.Agents import SARSA, Q_LEARNING
from rlpy.Representations import *
from rlpy.Policies import eGreedy
from rlpy.Experiments import Experiment
impor... | 34.734694 | 103 | 0.706228 |
7963d245d2e04a61af8f0ff55c58acf090d8487c | 4,188 | py | Python | benchmark/startQiskit3021.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit3021.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit3021.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=41
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.61157 | 140 | 0.650191 |
7963d255b9d3c9fc9ded1453e95873fd9520f63f | 680 | py | Python | meta_dt_files/0328_anim3_metadt.py | timothylwarren/imaging-routines | f6356c6152dd293bbfac57263c9df341e34c0786 | [
"Apache-2.0"
] | null | null | null | meta_dt_files/0328_anim3_metadt.py | timothylwarren/imaging-routines | f6356c6152dd293bbfac57263c9df341e34c0786 | [
"Apache-2.0"
] | null | null | null | meta_dt_files/0328_anim3_metadt.py | timothylwarren/imaging-routines | f6356c6152dd293bbfac57263c9df341e34c0786 | [
"Apache-2.0"
] | null | null | null | #march26_animal_9_meta_dt
from py_utilities import tw_filehandling as fh
meta_dt={}
meta_dt['data_path']= '/Volumes/LaCie/2pdata/march28/wt/animal3/'
meta_dt['meta_file_name']='anim3_plotdata.pck'
#file_names=['---Streaming Phasor Capture - 2 - 2_XY0_Z0_T0000_C0.tif']
meta_dt['file_names']=['---Streaming Phasor Capture... | 37.777778 | 130 | 0.767647 |
7963d3b27df99cf26eace0de79b7a9ea4ee28cc4 | 1,735 | py | Python | pyleecan/GUI/Dialog/DMachineSetup/SMSlot/PMSlot16/Gen_PMSlot16.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/GUI/Dialog/DMachineSetup/SMSlot/PMSlot16/Gen_PMSlot16.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/GUI/Dialog/DMachineSetup/SMSlot/PMSlot16/Gen_PMSlot16.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
"""File generated according to PMSlot16/gen_list.json
WARNING! All changes made in this file will be lost!
"""
from pyleecan.GUI.Dialog.DMachineSetup.SMSlot.PMSlot16.Ui_PMSlot16 import Ui_PMSlot16
class Gen_PMSlot16(Ui_PMSlot16):
def setupUi(self, PMSlot16):
"""Abstract class to up... | 31.545455 | 85 | 0.611527 |
7963d55ab1d01f5de475ad6a212b1526a08fd8ca | 749 | py | Python | release/xgboost_tests/workloads/train_moderate.py | Crissman/ray | 2092b097eab41b118a117fdfadd0fe664db41f63 | [
"Apache-2.0"
] | 3 | 2021-06-22T19:57:41.000Z | 2021-06-23T07:16:44.000Z | release/xgboost_tests/workloads/train_moderate.py | Crissman/ray | 2092b097eab41b118a117fdfadd0fe664db41f63 | [
"Apache-2.0"
] | 72 | 2021-02-06T08:07:16.000Z | 2022-03-26T07:17:49.000Z | release/xgboost_tests/workloads/train_moderate.py | Crissman/ray | 2092b097eab41b118a117fdfadd0fe664db41f63 | [
"Apache-2.0"
] | 2 | 2021-05-05T21:05:16.000Z | 2021-06-22T21:16:03.000Z | """Moderate cluster training
This training run will start 32 workers on 32 nodes (including head node).
Test owner: krfricke
Acceptance criteria: Should run through and report final results.
"""
import ray
from xgboost_ray import RayParams
from _train import train_ray
if __name__ == "__main__":
ray.init(addres... | 22.029412 | 74 | 0.670227 |
7963d60de5c72dbe518fcfb963720b8e49196a53 | 9,863 | py | Python | python/lib/Lib/site-packages/django/core/files/storage.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2018-12-29T09:53:39.000Z | 2018-12-29T09:53:42.000Z | python/lib/Lib/site-packages/django/core/files/storage.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 1 | 2021-06-30T10:10:56.000Z | 2021-06-30T10:10:56.000Z | python/lib/Lib/site-packages/django/core/files/storage.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2017-08-04T02:42:35.000Z | 2021-06-30T10:10:34.000Z | import os
import errno
import urlparse
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding impo... | 35.735507 | 110 | 0.619183 |
7963d680c2be746fd5a98e972bba97c297e108ea | 529 | py | Python | vel/commands/summary_command.py | cclauss/vel | 78a6a20af80ff613898d2983c83fdb223634aaad | [
"MIT"
] | null | null | null | vel/commands/summary_command.py | cclauss/vel | 78a6a20af80ff613898d2983c83fdb223634aaad | [
"MIT"
] | null | null | null | vel/commands/summary_command.py | cclauss/vel | 78a6a20af80ff613898d2983c83fdb223634aaad | [
"MIT"
] | null | null | null |
class ModelSummary:
""" Just print model summary """
def __init__(self, model, source):
self.model = model
self.source = source
def run(self, *args):
""" Print model summary """
if self.source is None:
self.model.summary()
else:
x_data, y_da... | 25.190476 | 65 | 0.595463 |
7963d6be61be7f03a6d95e6d1605c8bfaa755720 | 13,887 | py | Python | tests/models/test_glms.py | jawadbabar/nums-custom-add | 28bf2982f404ef7754cc27f1b0697bdd436d6ad1 | [
"Apache-2.0"
] | null | null | null | tests/models/test_glms.py | jawadbabar/nums-custom-add | 28bf2982f404ef7754cc27f1b0697bdd436d6ad1 | [
"Apache-2.0"
] | null | null | null | tests/models/test_glms.py | jawadbabar/nums-custom-add | 28bf2982f404ef7754cc27f1b0697bdd436d6ad1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright (C) 2020 NumS Development Team.
#
# 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... | 38.468144 | 87 | 0.626701 |
7963d8332cca52d48bd15201352913fe5caca015 | 558 | py | Python | ex23.py | NandarNandar/coding-sprint | 0040a20c361e702e17e84c2afe35c0cd0cba7618 | [
"MIT"
] | null | null | null | ex23.py | NandarNandar/coding-sprint | 0040a20c361e702e17e84c2afe35c0cd0cba7618 | [
"MIT"
] | null | null | null | ex23.py | NandarNandar/coding-sprint | 0040a20c361e702e17e84c2afe35c0cd0cba7618 | [
"MIT"
] | null | null | null | import sys
script, encoding, error = sys.argv
def main(language_file, encoding, errors):
line = language_file.readline()
if line:
print_line(line, encoding, errors)
return main(language_file, encoding, errors)
def print_line(line, encoding, errors):
next_lang = line.strip()
raw_bytes ... | 27.9 | 61 | 0.709677 |
7963d927a6bc80adc9d1fac1a2e281ec857e0fcc | 774 | py | Python | shared/util/string_util.py | pietrot/timemebud | 62534497c12218b459bd6ec5f3240005855245f3 | [
"MIT"
] | null | null | null | shared/util/string_util.py | pietrot/timemebud | 62534497c12218b459bd6ec5f3240005855245f3 | [
"MIT"
] | null | null | null | shared/util/string_util.py | pietrot/timemebud | 62534497c12218b459bd6ec5f3240005855245f3 | [
"MIT"
] | null | null | null | class StringUtil:
""" String Utility
"""
def wordwrap(text, n):
""" Returns a string where \\n is inserted between every n words
Args:
text (string):
n (integer): Wrap to nth number of words.
Returns:
string
"""
text = tex... | 20.918919 | 72 | 0.44186 |
7963d9f8e1f713ed1cc7ee3746d680fca8c41638 | 359 | py | Python | ferris/types/member.py | DistortedPumpkin/ferriswheel | e7faa49c0bfd72233c30c6cfe5d407a63c23acc7 | [
"MIT"
] | 10 | 2021-08-21T02:06:27.000Z | 2022-02-08T22:19:06.000Z | ferris/types/member.py | DistortedPumpkin/ferriswheel | e7faa49c0bfd72233c30c6cfe5d407a63c23acc7 | [
"MIT"
] | 7 | 2021-11-04T04:37:19.000Z | 2021-12-15T02:38:29.000Z | ferris/types/member.py | DistortedPumpkin/ferriswheel | e7faa49c0bfd72233c30c6cfe5d407a63c23acc7 | [
"MIT"
] | 6 | 2021-08-22T01:46:29.000Z | 2021-12-13T21:15:26.000Z | from __future__ import annotations
from typing import TypedDict, TYPE_CHECKING
if TYPE_CHECKING:
from .base import Snowflake
from .user import UserPayload
from .guild import GuildPayload
__all__ = ('MemberPayload',)
class MemberPayload(TypedDict):
user_id: Snowflake
user: UserPayload
guild... | 18.894737 | 43 | 0.754875 |
7963db1630565ccb7287ee64329c230571e03799 | 2,212 | py | Python | scrivo/blog.py | tomshafer/scrivo | 2fb7ed4b8661bce519b62a8feec9b513187c3ccf | [
"MIT"
] | null | null | null | scrivo/blog.py | tomshafer/scrivo | 2fb7ed4b8661bce519b62a8feec9b513187c3ccf | [
"MIT"
] | null | null | null | scrivo/blog.py | tomshafer/scrivo | 2fb7ed4b8661bce519b62a8feec9b513187c3ccf | [
"MIT"
] | null | null | null | """Blog-specific utilities.
To consider:
- word clouds
- topic models
- Doc2Vec
- Blog post generator via char-level RCNN
- Sentiment analysis
"""
from collections import OrderedDict, defaultdict
from datetime import datetime
from typing import DefaultDict, Iterable, List, Optional
from jinja2 import Template
from... | 27.308642 | 72 | 0.650542 |
7963db8a6a6dc62016106c85f1eeee385eb059b3 | 461 | py | Python | app/api/tags.py | smachuga/DayZ-Admin-Tool | 8dafbd1ff1d30e396e053efd7075a8f51ff511e3 | [
"Unlicense"
] | null | null | null | app/api/tags.py | smachuga/DayZ-Admin-Tool | 8dafbd1ff1d30e396e053efd7075a8f51ff511e3 | [
"Unlicense"
] | null | null | null | app/api/tags.py | smachuga/DayZ-Admin-Tool | 8dafbd1ff1d30e396e053efd7075a8f51ff511e3 | [
"Unlicense"
] | null | null | null | from api.controller import Controller
from typing import List
class TagsService():
ctl = Controller(
file_name='./dayzOffline.chernarusplus/cfglimitsdefinition.xml',
container_name='tags',
item_name='tag'
)
def get(self) -> List[str]:
return ctl.search()
def create... | 24.263158 | 72 | 0.635575 |
7963dbaf3e6a4ad19324048a3887cff0b2450ada | 2,410 | py | Python | src/capturePkt/pppoed.py | Alopex4/spruce | 2bf0bae18fe9b0d13691f2ee926071635cbe7c6f | [
"MIT"
] | 1 | 2019-07-04T10:32:07.000Z | 2019-07-04T10:32:07.000Z | src/capturePkt/pppoed.py | Alopex4/spruce | 2bf0bae18fe9b0d13691f2ee926071635cbe7c6f | [
"MIT"
] | null | null | null | src/capturePkt/pppoed.py | Alopex4/spruce | 2bf0bae18fe9b0d13691f2ee926071635cbe7c6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from struct import unpack
from src.capturePkt.networkProtocol import NetworkProtocol
# http://jhengda.blogspot.com/2009/12/ppp-over-ethernet-pppoe.html
class PPPoED(NetworkProtocol):
PPPoeDFields = (
'Version', 'Type', 'Code', 'Session-ID', 'Payload Length... | 32.567568 | 79 | 0.545643 |
7963dc287db99340b01b63901a4e804c81baa48e | 2,434 | py | Python | start_vision.py | unball/python_vision | 2004fc03453ef32f8206ebc653cefefe9e4d82f4 | [
"MIT"
] | null | null | null | start_vision.py | unball/python_vision | 2004fc03453ef32f8206ebc653cefefe9e4d82f4 | [
"MIT"
] | null | null | null | start_vision.py | unball/python_vision | 2004fc03453ef32f8206ebc653cefefe9e4d82f4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import cv2
import numpy as np
import rospy
from vision.msg import VisionMessage
from image_processor import ImageProcessor
from pixel2metric import pixels2meters
from measurement_system import measurement_system
FREQUENCY = 20 #In Hz
CAMERA_INDEX = 0
# -------------------- FUNCTIONS SECTION ... | 31.61039 | 101 | 0.631471 |
7963dcb23f69f54ed11997fa5e975b35114cc472 | 4,257 | py | Python | tests/core/custom_controller_test.py | sreknob/controllerx | f5e4475dae93d171ba3056399378107df1d52fa5 | [
"MIT"
] | null | null | null | tests/core/custom_controller_test.py | sreknob/controllerx | f5e4475dae93d171ba3056399378107df1d52fa5 | [
"MIT"
] | null | null | null | tests/core/custom_controller_test.py | sreknob/controllerx | f5e4475dae93d171ba3056399378107df1d52fa5 | [
"MIT"
] | null | null | null | import pytest
from core import (
CallServiceController,
CustomLightController,
CustomMediaPlayerController,
Controller,
)
from tests.test_utils import hass_mock, fake_async_function
@pytest.mark.parametrize(
"custom_cls, mapping, action_input, mock_function, expected_calls",
[
(Custom... | 28.006579 | 87 | 0.538877 |
7963dd6858ee2f611278a501c58b997e8c3df83b | 4,550 | py | Python | test/test_data.py | bertrand-caron/cv_blog_flask | ce779db31805f0b1a7bbc9a6f09a7d3fe1af74b2 | [
"MIT"
] | null | null | null | test/test_data.py | bertrand-caron/cv_blog_flask | ce779db31805f0b1a7bbc9a6f09a7d3fe1af74b2 | [
"MIT"
] | null | null | null | test/test_data.py | bertrand-caron/cv_blog_flask | ce779db31805f0b1a7bbc9a6f09a7d3fe1af74b2 | [
"MIT"
] | null | null | null | from os.path import exists, dirname, join
from glob import glob
from typing import Any
from yaml import load, dump
DATA_DIR = join(dirname(dirname(__file__)), 'data')
CONFIG_DIR = join(dirname(dirname(__file__)), 'config')
def example_yml_file(yml_file: str) -> str:
return yml_file + '.example'
DEBUG = False
d... | 35.271318 | 154 | 0.574505 |
7963dddbe70d7783ec498eb1f484ff1ee5d0ffd4 | 28,896 | py | Python | scripts/caffe/convert_caffe_weights_to_npy.py | fperezgamonal/flownet2-tf | fd7cde8af1cb15fa1d4cc5ab0fe40f3c8c06b227 | [
"MIT"
] | null | null | null | scripts/caffe/convert_caffe_weights_to_npy.py | fperezgamonal/flownet2-tf | fd7cde8af1cb15fa1d4cc5ab0fe40f3c8c06b227 | [
"MIT"
] | 1 | 2019-05-26T09:21:43.000Z | 2019-05-26T09:21:43.000Z | scripts/caffe/convert_caffe_weights_to_npy.py | fperezgamonal/flownet2-tf | fd7cde8af1cb15fa1d4cc5ab0fe40f3c8c06b227 | [
"MIT"
] | null | null | null | """
Please read README.md for usage instructions.
Extracts Caffe parameters from a given caffemodel/prototxt to a dictionary of numpy arrays,
ready for conversion to TensorFlow variables. Writes the dictionary to a .npy file.
"""
import argparse
import caffe
import numpy as np
import os
import tempfile
FLAGS = None
A... | 55.676301 | 102 | 0.647944 |
7963dde4ad10ee40f9a537c848bc371628eba51a | 599 | py | Python | mate/domains.py | thomyphan/emergent-cooperation | 2406b8679ddbebba745f1026ca3689f1ba181e28 | [
"MIT"
] | null | null | null | mate/domains.py | thomyphan/emergent-cooperation | 2406b8679ddbebba745f1026ca3689f1ba181e28 | [
"MIT"
] | null | null | null | mate/domains.py | thomyphan/emergent-cooperation | 2406b8679ddbebba745f1026ca3689f1ba181e28 | [
"MIT"
] | null | null | null | import mate.environments.matrix_games as matrix_games
import mate.environments.coin_game as coin_game
import mate.environments.harvest as harvest
def make(params):
domain_name = params["domain_name"]
if domain_name.startswith("Matrix-"):
params["R_max"] = 3
return matrix_games.make(params)
... | 37.4375 | 63 | 0.69783 |
7963de252cd353021e89f4ecf68269bbe8bfb3f0 | 2,812 | py | Python | onami/repl/repl_builtins.py | alexyy802/Onami | 701c1a19153958391f73efaa33061673b44c4533 | [
"MIT"
] | null | null | null | onami/repl/repl_builtins.py | alexyy802/Onami | 701c1a19153958391f73efaa33061673b44c4533 | [
"MIT"
] | null | null | null | onami/repl/repl_builtins.py | alexyy802/Onami | 701c1a19153958391f73efaa33061673b44c4533 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
onami.repl.repl_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin functions and variables within onami REPL contexts.
:copyright: (c) 2021 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import aiohttp
import nextcord
from nextcord.ext import commands
async def http_get... | 28.40404 | 95 | 0.648649 |
7963de5f6d3d10d825cbeea156a14cc8112b60d8 | 1,777 | py | Python | test/multi/test_radio_program_switching.py | wishful-project/module_gnuradio | 01d14511aade2939bc9faa826430ed92c70f5893 | [
"MIT"
] | null | null | null | test/multi/test_radio_program_switching.py | wishful-project/module_gnuradio | 01d14511aade2939bc9faa826430ed92c70f5893 | [
"MIT"
] | null | null | null | test/multi/test_radio_program_switching.py | wishful-project/module_gnuradio | 01d14511aade2939bc9faa826430ed92c70f5893 | [
"MIT"
] | 1 | 2018-11-23T17:58:25.000Z | 2018-11-23T17:58:25.000Z | #!/usr/bin/env python3
import os
import time
import xmlrpc.client
import subprocess
'''
Run-time control of meta radio program which allows very fast switching from
one protocol to another:
- context switching
'''
__author__ = "A. Zubow"
__copyright__ = "Copyright (c) 2016, Technische Universität Berlin"... | 31.732143 | 114 | 0.644344 |
7963de74fa32a1b31fa15f9359fc148f5f20fe81 | 7,587 | py | Python | lib/python3.8/site-packages/ansible_collections/community/general/plugins/modules/remote_management/oneview/oneview_enclosure_info.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | .ansible/collections/ansible_collections/community/general/plugins/modules/remote_management/oneview/oneview_enclosure_info.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | .ansible/collections/ansible_collections/community/general/plugins/modules/remote_management/oneview/oneview_enclosure_info.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright: (c) 2016-2017, Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
---
module: oneview_enclosur... | 33.570796 | 121 | 0.665217 |
7963decc67014332a7ae622f187bddbf919c2e95 | 1,785 | py | Python | scripts/slave/recipe_modules/build/api.py | bopopescu/chromium-build | f8e42c70146c1b668421ee6358dc550a955770a3 | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipe_modules/build/api.py | bopopescu/chromium-build | f8e42c70146c1b668421ee6358dc550a955770a3 | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipe_modules/build/api.py | bopopescu/chromium-build | f8e42c70146c1b668421ee6358dc550a955770a3 | [
"BSD-3-Clause"
] | 1 | 2020-07-22T09:16:32.000Z | 2020-07-22T09:16:32.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import contextlib
from recipe_engine import recipe_api
class ToolsBuildApi(recipe_api.RecipeApi):
@property
def runit_py(self):
return self.packag... | 34.326923 | 79 | 0.70084 |
7963df5c8daac15a5c2eaa6e490a883d4dfc5a2a | 848 | py | Python | angalabiri/users/tests/test_drf_views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 1 | 2021-03-25T14:06:23.000Z | 2021-03-25T14:06:23.000Z | angalabiri/users/tests/test_drf_views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 5 | 2021-09-08T03:08:46.000Z | 2022-03-12T00:56:35.000Z | angalabiri/users/tests/test_drf_views.py | me-edavids/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | null | null | null | import pytest
from django.test import RequestFactory
from angalabiri.users.api.views import UserViewSet
from angalabiri.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):
view = UserViewSet()
request = r... | 24.941176 | 67 | 0.626179 |
7963df78d8ad104808a1ec5a1b7174f9c66458fe | 2,574 | py | Python | scripts/rosruby_genmsg.py | pincsolutions/rosruby | a7ab079b3ba3c948a2306069d048ec51d516af94 | [
"BSD-3-Clause"
] | 16 | 2015-04-02T16:15:14.000Z | 2020-12-23T07:05:40.000Z | scripts/rosruby_genmsg.py | g-arjones/rosruby | dc29af423241167ab9060b40366b4616a62c5f11 | [
"BSD-3-Clause"
] | 2 | 2016-03-21T18:02:41.000Z | 2019-07-15T19:55:08.000Z | scripts/rosruby_genmsg.py | g-arjones/rosruby | dc29af423241167ab9060b40366b4616a62c5f11 | [
"BSD-3-Clause"
] | 6 | 2015-08-23T06:23:28.000Z | 2019-06-18T13:29:07.000Z | #! /usr/bin/env python
# msg/srv generator for precompiled system
# It is useful if you are using precompiled ROS system,
# because it needs root access and there are ROS_NOBUILD file in the packages.
# This script generates *.rb files in the rosruby dir.
import sys
import os
from rospkg import RosPack
import genms... | 36.771429 | 142 | 0.669386 |
7963e02dd5fbeae2da0b27b9fe0811b725c0d354 | 8,045 | py | Python | tests/serializers.py | likeanaxon/drf-writable-nested | f06df1a2dcac222f519bb368da273150036b8323 | [
"BSD-2-Clause"
] | null | null | null | tests/serializers.py | likeanaxon/drf-writable-nested | f06df1a2dcac222f519bb368da273150036b8323 | [
"BSD-2-Clause"
] | null | null | null | tests/serializers.py | likeanaxon/drf-writable-nested | f06df1a2dcac222f519bb368da273150036b8323 | [
"BSD-2-Clause"
] | null | null | null | from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from drf_writable_nested import (
WritableNestedModelSerializer, UniqueFieldsMixin)
from . import models
class AvatarSerializer(serializers.ModelSerializer):
image = serializers.CharField()
class Meta:
m... | 25.621019 | 74 | 0.663393 |
7963e0dd54a2aebe203d1e94d5c560e89923da17 | 246 | py | Python | python/src/neurons/activation_functions/linear_activation.py | DomenicD/dom_ml_playground | 1c9e2096bc6882fdcc96a3c39db6210b53224639 | [
"MIT"
] | null | null | null | python/src/neurons/activation_functions/linear_activation.py | DomenicD/dom_ml_playground | 1c9e2096bc6882fdcc96a3c39db6210b53224639 | [
"MIT"
] | 7 | 2015-09-25T15:30:10.000Z | 2015-10-14T15:36:22.000Z | python/src/neurons/activation_functions/linear_activation.py | DomenicD/dom_ml_playground | 1c9e2096bc6882fdcc96a3c39db6210b53224639 | [
"MIT"
] | null | null | null | from python.src.neurons.activation_functions.activation_function import ActivationFunction
class LinearActivation(ActivationFunction):
def __init__(self):
ActivationFunction.__init__(
self, lambda x: x, lambda x: 1.0)
| 27.333333 | 91 | 0.747967 |
7963e1814f634afb6df888f10c82074d81bac435 | 4,598 | py | Python | src/cobble/test_env.py | cbiffle/cobble-build | 8cd2bc1d03c1d41a2f25ae6b064ab6dafd6016e4 | [
"BSD-2-Clause"
] | 9 | 2015-09-08T14:35:40.000Z | 2021-09-27T23:24:19.000Z | src/cobble/test_env.py | oxidecomputer/cobble-build | e98052fd15d7718950155d595c6d8e07e3f4531e | [
"BSD-2-Clause"
] | 1 | 2021-01-07T01:53:22.000Z | 2021-11-03T13:18:24.000Z | src/cobble/test_env.py | cbiffle/cobble-build | 8cd2bc1d03c1d41a2f25ae6b064ab6dafd6016e4 | [
"BSD-2-Clause"
] | 2 | 2020-03-12T22:04:12.000Z | 2020-12-21T20:15:25.000Z | """Test suite for cobble.env
This is a pytest suite. You can run it by installing pytest and running pytest
from the root of the repository.
"""
import cobble
from cobble.env import *
import pytest
# Wrapper to apply is_frozen every time
def freeze(x):
result = cobble.env.freeze(x)
assert is_frozen(result), ... | 26.274286 | 78 | 0.564811 |
7963e1a0a9d7187c5467fb9ef8d36a4e77fabcf4 | 16,311 | py | Python | packages/augur-core/tests/trading/test_profitLoss.py | jfarid27/augur-1 | 9a6197aae8f147c8373985dd0b4749de524ea3d3 | [
"MIT"
] | null | null | null | packages/augur-core/tests/trading/test_profitLoss.py | jfarid27/augur-1 | 9a6197aae8f147c8373985dd0b4749de524ea3d3 | [
"MIT"
] | null | null | null | packages/augur-core/tests/trading/test_profitLoss.py | jfarid27/augur-1 | 9a6197aae8f147c8373985dd0b4749de524ea3d3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import math
from utils import fix, AssertLog, longTo32Bytes, longToHexString, stringToBytes, BuyWithCash, nullAddress
from constants import BID, ASK, LONG, SHORT, YES
INVALID = 0
A = 1
B = 2
C = 3
def test_binary_and_claim(contractsFixture, cash, market, universe):
createOrder = contractsF... | 35.458696 | 236 | 0.571271 |
7963e2b0d8945734ef3076e734d2df4bac696b74 | 14,089 | py | Python | tests/utils.py | icota/lightning | dace9bfdcfd9bbd68a7661f0dfedf69cf42d7cba | [
"MIT"
] | 3 | 2018-01-24T16:50:59.000Z | 2021-02-15T06:44:26.000Z | tests/utils.py | icota/lightning | dace9bfdcfd9bbd68a7661f0dfedf69cf42d7cba | [
"MIT"
] | null | null | null | tests/utils.py | icota/lightning | dace9bfdcfd9bbd68a7661f0dfedf69cf42d7cba | [
"MIT"
] | 4 | 2018-01-17T19:36:09.000Z | 2018-05-01T00:56:20.000Z | import binascii
import logging
import os
import re
import sqlite3
import subprocess
import threading
import time
from bitcoin.rpc import RawProxy as BitcoinProxy
BITCOIND_CONFIG = {
"rpcuser": "rpcuser",
"rpcpassword": "rpcpass",
"rpcport": 18332,
}
LIGHTNINGD_CONFIG = {
"bitcoind-poll": "1s",
... | 33.867788 | 111 | 0.598694 |
7963e33be9bc4edc92af471ad497963e2ed0494b | 556 | py | Python | ds-bifurcation-diagram-numerical.py | RachidStat/PyCX | a1a597e61d03b25cf138dd11ab136db8202e1243 | [
"BSD-2-Clause-FreeBSD"
] | 176 | 2019-12-18T11:44:28.000Z | 2022-03-27T09:09:33.000Z | ds-bifurcation-diagram-numerical.py | RachidStat/PyCX | a1a597e61d03b25cf138dd11ab136db8202e1243 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2020-03-29T00:51:25.000Z | 2020-07-19T11:08:32.000Z | ds-bifurcation-diagram-numerical.py | RachidStat/PyCX | a1a597e61d03b25cf138dd11ab136db8202e1243 | [
"BSD-2-Clause-FreeBSD"
] | 56 | 2019-12-18T19:04:12.000Z | 2022-03-22T09:35:33.000Z | from pylab import *
def initialize():
global x, result
x = 0.1
result = []
def observe():
global x, result
result.append(x)
def update():
global x, result
x = x + r - x**2
def plot_asymptotic_states():
initialize()
for t in range(100): # first 100 steps are discarded
upda... | 17.935484 | 57 | 0.584532 |
7963e3ba4bc655316f22aff739438b4f8114c7ed | 511 | py | Python | setup.py | dgisolfi/T-RexRun | a6365faee539089bf2da0fcc8f72c7c80e59d18b | [
"MIT"
] | 1 | 2018-12-25T04:31:30.000Z | 2018-12-25T04:31:30.000Z | setup.py | dgisolfi/T-RexRun | a6365faee539089bf2da0fcc8f72c7c80e59d18b | [
"MIT"
] | 3 | 2018-12-23T23:19:05.000Z | 2018-12-27T16:37:00.000Z | setup.py | dgisolfi/T-RexRun | a6365faee539089bf2da0fcc8f72c7c80e59d18b | [
"MIT"
] | null | null | null | import cx_Freeze
executables = [cx_Freeze.Executable("./src/RexRun.py")]
cx_Freeze.setup(
name="T-Rex Run",
options = {
"build_exe": {
"packages":["pygame"],
"include_files":[
"./src/ObstacleClass.py",
"./src/PlayerClass.py",
"./src/settings.py",
... | 24.333333 | 55 | 0.51272 |
7963e3f784c0f9545961e1cdf1c05cfe386e5308 | 4,327 | py | Python | examples/lexical_analysis/model.py | zkh2016/PaddleNLP | 33146398dfce1f9582d01146c675c0d8f089275e | [
"Apache-2.0"
] | 1 | 2022-01-13T00:54:33.000Z | 2022-01-13T00:54:33.000Z | examples/lexical_analysis/model.py | zkh2016/PaddleNLP | 33146398dfce1f9582d01146c675c0d8f089275e | [
"Apache-2.0"
] | null | null | null | examples/lexical_analysis/model.py | zkh2016/PaddleNLP | 33146398dfce1f9582d01146c675c0d8f089275e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 app... | 40.439252 | 141 | 0.639011 |
7963e424a236e4f00f24a083792f17a724c2e0b8 | 13,280 | py | Python | tfyolov4/core/utils_plates.py | evgenevolkov/Automated-car-tracker-and-plates-reader | 5cee11b654bb8cfd20d081198af43b56811d2107 | [
"MIT"
] | 3 | 2020-10-15T14:32:36.000Z | 2022-03-08T20:56:58.000Z | tfyolov4/core/utils_plates.py | evgenevolkov/Automated-car-tracker-and-plates-reader | 5cee11b654bb8cfd20d081198af43b56811d2107 | [
"MIT"
] | 2 | 2022-02-09T23:51:20.000Z | 2022-02-10T02:25:10.000Z | tfyolov4/core/utils_plates.py | evgenevolkov/Automated-car-tracker-and-plates-reader | 5cee11b654bb8cfd20d081198af43b56811d2107 | [
"MIT"
] | 2 | 2021-04-07T11:56:20.000Z | 2022-01-28T22:25:36.000Z | import cv2
import random
import colorsys
import numpy as np
import tensorflow as tf
from core.config_plates import cfg
def load_freeze_layer(model='yolov4', tiny=False):
if tiny:
if model == 'yolov3':
freeze_layouts = ['conv2d_9', 'conv2d_12']
else:
freeze_layouts = ['conv2d... | 32.871287 | 100 | 0.563554 |
7963e51798ca48d528a2a7b229cb6d86894806bb | 6,428 | py | Python | impl/moprem.py | snucvpip/MopReM | 4338bb0c4980b40d448967b48a5785be7d129b27 | [
"MIT"
] | 15 | 2021-12-09T02:56:32.000Z | 2022-01-12T07:25:06.000Z | impl/moprem.py | snucvpip/MopReM | 4338bb0c4980b40d448967b48a5785be7d129b27 | [
"MIT"
] | 2 | 2021-11-26T16:56:13.000Z | 2021-12-02T15:52:28.000Z | impl/moprem.py | snucvpip/MopReM | 4338bb0c4980b40d448967b48a5785be7d129b27 | [
"MIT"
] | null | null | null | import os
from re import M
import time
from functools import partial
from multiprocessing import Pool
import cv2
import numpy as np
from skimage.metrics import structural_similarity
import pre_process.pre_process as pre_process
import post_process.post_process as post_process
import post_process.eval as eval
import d... | 34.55914 | 110 | 0.576229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.