hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
358a6eb9c1501c587bc5bfcf16880734d69fa7cf | 932 | py | Python | dexter_utils/vectorpixel.py | rsbohn/Dexter_CircuitPython_Widgets | 0ba1a559c64878bcdd1dba0f0481f1a9ab6b4521 | [
"MIT"
] | null | null | null | dexter_utils/vectorpixel.py | rsbohn/Dexter_CircuitPython_Widgets | 0ba1a559c64878bcdd1dba0f0481f1a9ab6b4521 | [
"MIT"
] | 1 | 2022-02-13T23:29:10.000Z | 2022-02-13T23:29:10.000Z | dexter_utils/vectorpixel.py | rsbohn/Dexter_CircuitPython_Widgets | 0ba1a559c64878bcdd1dba0f0481f1a9ab6b4521 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: Copyright (c) 2022 Randall Bohn (dexter)
#
# SPDX-License-Identifier: MIT
"""
dexter_utils.vectorpixel
VectorIO shapes that act like NeoPixels.
"""
import displayio
class VectorPixel:
"""Turn a group of Vectorio shapes into a string of NeoPixel-like objects."""
def __init__(self, g... | 24.526316 | 81 | 0.614807 |
f786d85dd58402ea383d4a920a6ac44d1cab724d | 43 | py | Python | cli/python/src/auth/version.py | qweio/qwe-vpn | 99f1deb0e156d9c4a6b3696cb031f6d6f4063a58 | [
"Apache-2.0"
] | 1 | 2021-03-23T07:28:46.000Z | 2021-03-23T07:28:46.000Z | cli/python/src/auth/version.py | qweio/qwe-vpn | 99f1deb0e156d9c4a6b3696cb031f6d6f4063a58 | [
"Apache-2.0"
] | 38 | 2021-05-12T06:12:51.000Z | 2022-03-15T20:12:18.000Z | cli/python/src/auth/version.py | zero88/qwe-vpn | 99f1deb0e156d9c4a6b3696cb031f6d6f4063a58 | [
"Apache-2.0"
] | null | null | null | APP_VERSION = '0.0.1'
HASH_VERSION = 'dev'
| 14.333333 | 21 | 0.674419 |
bda3cde238bebbfe7a245da3498862d8458bb7bb | 9,108 | py | Python | neo/test/coretest/test_spike.py | tclose/python-neo | 338d381b735a019f6be68ab7196366eed33815fe | [
"BSD-3-Clause"
] | null | null | null | neo/test/coretest/test_spike.py | tclose/python-neo | 338d381b735a019f6be68ab7196366eed33815fe | [
"BSD-3-Clause"
] | null | null | null | neo/test/coretest/test_spike.py | tclose/python-neo | 338d381b735a019f6be68ab7196366eed33815fe | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tests of the neo.core.spike.Spike class
"""
try:
import unittest2 as unittest
except ImportError:
import unittest
import numpy as np
import quantities as pq
try:
from IPython.lib.pretty import pretty
except ImportError as err:
HAVE_IPYTHON = False
else:
HAVE_IPYTHON = ... | 38.268908 | 78 | 0.639438 |
c034c3234606ed7aa1cd3c2989d1e9f55ec11045 | 6,104 | py | Python | pygame_menu/examples/other/scrollbar_area.py | apuly/pygame-menu | 77bf8f2c8913de5a24674ee0d0d2c7c9b816a58b | [
"MIT"
] | null | null | null | pygame_menu/examples/other/scrollbar_area.py | apuly/pygame-menu | 77bf8f2c8913de5a24674ee0d0d2c7c9b816a58b | [
"MIT"
] | null | null | null | pygame_menu/examples/other/scrollbar_area.py | apuly/pygame-menu | 77bf8f2c8913de5a24674ee0d0d2c7c9b816a58b | [
"MIT"
] | null | null | null | """
pygame-menu
https://github.com/ppizarror/pygame-menu
EXAMPLE - SCROLL AREA
Shows ScrollArea widget usage.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of charge, to... | 31.626943 | 90 | 0.549803 |
2ff2d706eadd273c7647a30c057650d9efd85fef | 347 | py | Python | tests/test_circuit/test_inheritance.py | leonardt/magma | d3e8c9500ec3b167df8ed067e0c0305781c94ab6 | [
"MIT"
] | 167 | 2017-10-08T00:59:22.000Z | 2022-02-08T00:14:39.000Z | tests/test_circuit/test_inheritance.py | leonardt/magma | d3e8c9500ec3b167df8ed067e0c0305781c94ab6 | [
"MIT"
] | 719 | 2017-08-29T17:58:28.000Z | 2022-03-31T23:39:18.000Z | tests/test_circuit/test_inheritance.py | leonardt/magma | d3e8c9500ec3b167df8ed067e0c0305781c94ab6 | [
"MIT"
] | 14 | 2017-09-01T03:25:16.000Z | 2021-11-05T13:30:24.000Z | import magma as m
def test_circuit_base_attr():
class _FooInterface(m.Circuit):
_circuit_base_ = True
class _FooBase(_FooInterface):
pass
class _FooImpl(_FooBase):
pass
assert _FooInterface._circuit_base_ == True
assert _FooBase._circuit_base_ == False
assert _FooIm... | 19.277778 | 47 | 0.694524 |
847f8f63f9dd16feeb616b239d18047ffe30dd4c | 2,750 | py | Python | keithleygui/utils/led_indicator_widget.py | quaeritis/keithleygui | f5552aff6ed69a4fd2932c298bba662e9a21a96d | [
"MIT"
] | null | null | null | keithleygui/utils/led_indicator_widget.py | quaeritis/keithleygui | f5552aff6ed69a4fd2932c298bba662e9a21a96d | [
"MIT"
] | null | null | null | keithleygui/utils/led_indicator_widget.py | quaeritis/keithleygui | f5552aff6ed69a4fd2932c298bba662e9a21a96d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © keithleygui Project Contributors
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)
from __future__ import division, absolute_import, print_function
from qtpy import QtGui, QtCore, QtWidgets
class LedIndicator(QtWidgets.QAbstractButton):
scaledSi... | 37.671233 | 78 | 0.614909 |
2c309c24ebbc0604018a414b42b652cba5e729a4 | 36,103 | py | Python | green/test/test_result.py | jwaschkau/green | 96409beaf27f2d132def1fee4d568ba042b91769 | [
"MIT"
] | null | null | null | green/test/test_result.py | jwaschkau/green | 96409beaf27f2d132def1fee4d568ba042b91769 | [
"MIT"
] | null | null | null | green/test/test_result.py | jwaschkau/green | 96409beaf27f2d132def1fee4d568ba042b91769 | [
"MIT"
] | null | null | null | # encoding: utf-8
from __future__ import unicode_literals
import copy
# `from doctest import DocTestCase` causes crashes, since the DocTestCase is
# detected as a TestCase subclass and unittest.TestLoader.loadTestsFromModule()
# called from GreenTestLoader.loadTestsFromModule() thinks it is a definition
# of a test to... | 32.583935 | 88 | 0.605739 |
06000915a7d48e4d8a23145392b45b4e8475f58a | 1,207 | py | Python | class9/collateral/napalm_get_config.py | ksannedhi/pyplus_course | fc3499f2dfef472dc49fe6caddf2e6e2be160f4b | [
"Apache-2.0"
] | 39 | 2019-03-03T18:16:55.000Z | 2022-02-17T17:05:18.000Z | class9/collateral/napalm_get_config.py | ksannedhi/pyplus_course | fc3499f2dfef472dc49fe6caddf2e6e2be160f4b | [
"Apache-2.0"
] | 1 | 2020-06-17T22:39:28.000Z | 2020-06-17T22:39:28.000Z | class9/collateral/napalm_get_config.py | ksannedhi/pyplus_course | fc3499f2dfef472dc49fe6caddf2e6e2be160f4b | [
"Apache-2.0"
] | 77 | 2019-01-25T10:41:23.000Z | 2022-03-14T21:35:59.000Z | #!/usr/bin/env python
from getpass import getpass
from napalm import get_network_driver
# Supress SSL Certificate Warnings
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# Device definitions
password = getpas... | 21.553571 | 71 | 0.728252 |
34d94c4c9e119b9717235619d30db4078ac13b18 | 708 | py | Python | djflow/apps/security/signals.py | jasmanysanchez/djflow | 44dea3221a9228dd8685184ab0ecc2108671a5e6 | [
"MIT"
] | 20 | 2017-09-27T01:57:54.000Z | 2021-07-22T19:09:20.000Z | djflow/apps/security/signals.py | yunica/djflow | 244b301ed585fe46ba152e9d08f9b23622dcc697 | [
"MIT"
] | null | null | null | djflow/apps/security/signals.py | yunica/djflow | 244b301ed585fe46ba152e9d08f9b23622dcc697 | [
"MIT"
] | 12 | 2017-09-29T14:12:28.000Z | 2020-06-16T19:46:32.000Z | from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.contrib.auth.models import User
from .models import UserProfile
@receiver(post_save, sender=User)
def new_user(sender, **kwargs):
"""
Creamos un UserProfile cuando se crea un nuevo User.
"""
if... | 27.230769 | 59 | 0.706215 |
273059e86ab4c3d4c9c26880cbd0f33d2ff13567 | 4,858 | py | Python | zip_0143.py | paracetamolo/zcash-test-vectors | 0db0553a93282768faf95fc995d38fab74ceb9f1 | [
"Apache-2.0",
"MIT"
] | null | null | null | zip_0143.py | paracetamolo/zcash-test-vectors | 0db0553a93282768faf95fc995d38fab74ceb9f1 | [
"Apache-2.0",
"MIT"
] | null | null | null | zip_0143.py | paracetamolo/zcash-test-vectors | 0db0553a93282768faf95fc995d38fab74ceb9f1 | [
"Apache-2.0",
"MIT"
] | null | null | null | #!/usr/bin/env python3
from pyblake2 import blake2b
import struct
from transaction import (
MAX_MONEY,
OVERWINTER_TX_VERSION,
Script,
Transaction,
)
from tv_output import render_args, render_tv, Some
from tv_rand import Rand
SIGHASH_ALL = 1
SIGHASH_NONE = 2
SIGHASH_SINGLE = 3
SIGHASH_ANYONECANPAY = 0... | 28.745562 | 84 | 0.602923 |
4d5d18dbd9172f9d9a5a61e4828c47d14d475ba8 | 14,425 | py | Python | astroquery/utils/commons.py | olyoberdorf/astroquery | 7de90842fae95524c67173de4bae3f7d7a705aec | [
"BSD-3-Clause"
] | 577 | 2015-02-12T18:23:49.000Z | 2022-03-22T21:38:58.000Z | astroquery/utils/commons.py | olyoberdorf/astroquery | 7de90842fae95524c67173de4bae3f7d7a705aec | [
"BSD-3-Clause"
] | 1,812 | 2015-01-01T08:02:20.000Z | 2022-03-31T13:03:52.000Z | astroquery/utils/commons.py | olyoberdorf/astroquery | 7de90842fae95524c67173de4bae3f7d7a705aec | [
"BSD-3-Clause"
] | 322 | 2015-02-23T19:31:29.000Z | 2022-03-25T18:51:30.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Common functions and classes that are required by all query classes.
"""
import re
import warnings
import os
import shutil
import socket
from io import BytesIO, StringIO
from urllib.error import URLError
import requests
import astropy.units as u
fro... | 31.222944 | 99 | 0.6 |
77cf64443030ec0211626c452e237525b6a1bde6 | 2,598 | py | Python | PyFlowPackages/PyFlowFreeCAD/FunctionLibraries/Rotation.py | madhusenthilvel/NodeEditor | e5612d917a24924a7961d196aafa85ca9b650dcf | [
"MIT"
] | 53 | 2019-07-17T17:42:13.000Z | 2022-02-07T20:19:48.000Z | PyFlowPackages/PyFlowFreeCAD/FunctionLibraries/Rotation.py | madhusenthilvel/NodeEditor | e5612d917a24924a7961d196aafa85ca9b650dcf | [
"MIT"
] | 13 | 2019-07-10T11:15:34.000Z | 2020-12-31T05:03:48.000Z | PyFlowPackages/PyFlowFreeCAD/FunctionLibraries/Rotation.py | madhusenthilvel/NodeEditor | e5612d917a24924a7961d196aafa85ca9b650dcf | [
"MIT"
] | 12 | 2019-07-10T11:03:39.000Z | 2022-02-15T11:58:14.000Z | import FreeCAD
#from FreeCAD import Rotation as MRotation
from FreeCAD import Vector
from PyFlow.Core import(
FunctionLibraryBase,
IMPLEMENT_NODE
)
from PyFlow.Core.Common import *
from nodeeditor.say import *
class Rotation(FunctionLibraryBase):
'''doc string for Rotation'''
def __init__(self,packa... | 46.392857 | 282 | 0.655504 |
59c094462097e13ea6b755aeb81cfa0d863c0fa0 | 629 | py | Python | test/cli_test/test_general.py | nprint/nPrintML | 69e56036fd7ab6b050cbe81b31309c06f166f0f2 | [
"Apache-2.0"
] | 13 | 2020-11-04T14:57:12.000Z | 2021-11-18T08:50:00.000Z | test/cli_test/test_general.py | nprint/nPrintML | 69e56036fd7ab6b050cbe81b31309c06f166f0f2 | [
"Apache-2.0"
] | 60 | 2020-10-22T16:08:14.000Z | 2021-12-14T23:00:36.000Z | test/cli_test/test_general.py | nprint/nprintml | 69e56036fd7ab6b050cbe81b31309c06f166f0f2 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:10:18.000Z | 2021-12-16T01:10:18.000Z | import nprintml
from .base import CLITestCase
class TestGeneral(CLITestCase):
def test_error(self):
result = self.try_execute('--yelp', raise_exc=False, stderr=True)
self.assertEqual(result.code, 2)
self.assertGreater(len(result.stderr), 0)
def test_help(self):
result = self... | 29.952381 | 96 | 0.661367 |
cb5a8f04989eedffd10baf2023aac0b818a8db31 | 704 | py | Python | mhkit_python_utils/pandas_dataframe.py | kmruehl/MHKiT-MATLAB | 6d640144d3f48e5ddea46947e15256fc85828b01 | [
"BSD-3-Clause"
] | 11 | 2020-03-30T07:49:23.000Z | 2022-03-30T16:27:32.000Z | mhkit_python_utils/pandas_dataframe.py | kmruehl/MHKiT-MATLAB | 6d640144d3f48e5ddea46947e15256fc85828b01 | [
"BSD-3-Clause"
] | 45 | 2020-05-04T22:25:23.000Z | 2022-03-31T20:52:36.000Z | mhkit_python_utils/pandas_dataframe.py | kmruehl/MHKiT-MATLAB | 6d640144d3f48e5ddea46947e15256fc85828b01 | [
"BSD-3-Clause"
] | 16 | 2020-04-06T22:21:30.000Z | 2022-02-04T13:48:22.000Z | import pandas as pd
def timeseries_to_pandas(ts,ind,x):
if x>1:
ts=list(map(list,zip(*ts)))
df=pd.DataFrame(data=ts,index=ind)
else:
df=pd.DataFrame(data=ts,index=ind)
return df.astype('float64')
def spectra_to_pandas(frequency,spectra,x,cols=N... | 22 | 53 | 0.558239 |
64fb2890d944fcdf377a771da30d9cc4a977ae03 | 471 | py | Python | nsd1802/python/day06/mygui2.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1802/python/day06/mygui2.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1802/python/day06/mygui2.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | import tkinter
from functools import partial
def hello():
lb.config(text="Hello China!")
def welcome():
lb.config(text="Hello tedu!")
root = tkinter.Tk()
lb = tkinter.Label(text="Hello world!", font="Times 26")
MyBtn = partial(tkinter.Button, root, fg='white', bg='blue')
b1 = MyBtn(text='Button 1', command=h... | 21.409091 | 60 | 0.683652 |
067aa47c6f1e82c03e466d7df5f9240a877deffd | 6,205 | py | Python | functions/misc_functions_folder/gcf_misc_functions.py | Liodeus/GCP_Security_Check | 370fe0b951bae1a382d03021c854600d638cad68 | [
"MIT"
] | null | null | null | functions/misc_functions_folder/gcf_misc_functions.py | Liodeus/GCP_Security_Check | 370fe0b951bae1a382d03021c854600d638cad68 | [
"MIT"
] | null | null | null | functions/misc_functions_folder/gcf_misc_functions.py | Liodeus/GCP_Security_Check | 370fe0b951bae1a382d03021c854600d638cad68 | [
"MIT"
] | null | null | null | from functions.misc_functions_folder.misc_functions import *
def get_secret_search():
"""
Return all the regex to search
"""
return {
'AWS Access Key ID Value': '(A3T[A-Z0-9]|AKIA|AGPA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}',
'AWS Access Key ID': '((\"|''|`)?((?i)aws)?_?((?i)access)_?((?i)key)?_?((?i)id)?(\"|... | 42.793103 | 206 | 0.575181 |
9001c6012503b11400320d12d03a86e5873efcae | 178 | py | Python | posts/service/get_posts_list.py | gergerov/easy_django | 98eea5d5c2be36c5b3ac6497d803d18d4a811ded | [
"MIT"
] | null | null | null | posts/service/get_posts_list.py | gergerov/easy_django | 98eea5d5c2be36c5b3ac6497d803d18d4a811ded | [
"MIT"
] | null | null | null | posts/service/get_posts_list.py | gergerov/easy_django | 98eea5d5c2be36c5b3ac6497d803d18d4a811ded | [
"MIT"
] | null | null | null | from ..models import Posts
def get_post_list(quantity: int):
posts = Posts.objects.filter(
status="ACTIVE"
).order_by('-post_date')[:quantity]
return posts | 19.777778 | 39 | 0.668539 |
808f173859824e2cbcc1d40600e04148ff4d09a5 | 6,485 | py | Python | PaddleCV/Research/astar2019/score.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | 1,319 | 2020-02-14T10:42:07.000Z | 2022-03-31T15:42:18.000Z | PaddleCV/Research/astar2019/score.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | 192 | 2020-02-14T02:53:34.000Z | 2022-03-31T02:25:48.000Z | PaddleCV/Research/astar2019/score.py | XiaoguangHu01/models | a95d49323ed504e5a9164586f171f408954fd43a | [
"Apache-2.0"
] | 720 | 2020-02-14T02:12:38.000Z | 2022-03-31T12:21:15.000Z | # Copyright (c) 2019 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... | 36.22905 | 140 | 0.640555 |
ad2042ea19cf829c65e5003282a49b611a6fdbb4 | 4,233 | py | Python | test/test_signal.py | danbar/YaFFT | ba913f33a1e542bc0bba9664e76b0a0d65e76497 | [
"MIT"
] | null | null | null | test/test_signal.py | danbar/YaFFT | ba913f33a1e542bc0bba9664e76b0a0d65e76497 | [
"MIT"
] | null | null | null | test/test_signal.py | danbar/YaFFT | ba913f33a1e542bc0bba9664e76b0a0d65e76497 | [
"MIT"
] | null | null | null | import sys
import os
import unittest
import numpy as np
import numpy.testing as npt
from oct2py import octave
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'build', 'debug'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'build', 'debug', 'swig'))
import yafft
def _create_sine(num_... | 26.961783 | 88 | 0.631467 |
0da946fbbaf95f72bd8f2937c715f068d60f9a31 | 956 | py | Python | genes.py | austinmdillow/natural-selection-simulator | 01c7d3ba310a3629a04f1a7e67c04a1b87ee4f09 | [
"MIT"
] | null | null | null | genes.py | austinmdillow/natural-selection-simulator | 01c7d3ba310a3629a04f1a7e67c04a1b87ee4f09 | [
"MIT"
] | 1 | 2020-06-12T20:52:07.000Z | 2020-06-12T20:52:07.000Z | genes.py | austinmdillow/natural-selection-simulator | 01c7d3ba310a3629a04f1a7e67c04a1b87ee4f09 | [
"MIT"
] | null | null | null | import random
class Genes():
mutation = False
Animal = 0
Plant = 1
def __init__(self, entity_type):
self.size = 5 # default value
self.typeSpecificTraits(entity_type)
def typeSpecificTraits(self, entity_type):
if entity_type == Genes.Animal:
self.sense = 50
self.speed = 10
sel... | 26.555556 | 85 | 0.640167 |
bbb8e4865cb2b7b764cb0dfa66d4a296497a7c5e | 527 | py | Python | maml/apps/bowsr/model/base.py | anooptp/maml | fdd95f3d60c9281d871d89b25b073e87b6ba4e52 | [
"BSD-3-Clause"
] | 161 | 2020-01-26T08:24:41.000Z | 2022-03-29T06:42:42.000Z | maml/apps/bowsr/model/base.py | anooptp/maml | fdd95f3d60c9281d871d89b25b073e87b6ba4e52 | [
"BSD-3-Clause"
] | 195 | 2020-01-25T19:35:20.000Z | 2022-03-28T13:14:30.000Z | maml/apps/bowsr/model/base.py | anooptp/maml | fdd95f3d60c9281d871d89b25b073e87b6ba4e52 | [
"BSD-3-Clause"
] | 46 | 2020-03-30T12:56:39.000Z | 2022-03-27T12:53:23.000Z | """
Base class that expose a predict_energy method
"""
from pymatgen.core.structure import Structure
class EnergyModel:
"""
Base energy model class. For any model used in BOWSR, it has to have
a predict_energy method that returns a float
"""
def predict_energy(self, structure: Structure) -> float... | 22.913043 | 72 | 0.648956 |
4e88d7083c43cfb02bfe88bdc07ad70620b0b451 | 10,879 | py | Python | tests/components/ecobee/test_climate.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | tests/components/ecobee/test_climate.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 52 | 2020-07-14T14:12:26.000Z | 2022-03-31T06:24:02.000Z | tests/components/ecobee/test_climate.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """The test for the Ecobee thermostat module."""
import unittest
from unittest import mock
from homeassistant.components.ecobee import climate as ecobee
import homeassistant.const as const
from homeassistant.const import STATE_OFF
class TestEcobee(unittest.TestCase):
"""Tests for Ecobee climate."""
def setU... | 37.643599 | 81 | 0.592702 |
c276c90544772ac5e62b8ba97b8e8b4a5ffac85b | 459 | py | Python | run_files/ppo_reg_adapt/run_ppo_reg_adapt_ipsu.py | YunjaeChoi/Gain-Risk_Framework_for_Stabilization_of_Deep_Policy_Gradient_Optimization | 68d3f8fca6c6e6b356261f568f0d8562242fa649 | [
"MIT"
] | null | null | null | run_files/ppo_reg_adapt/run_ppo_reg_adapt_ipsu.py | YunjaeChoi/Gain-Risk_Framework_for_Stabilization_of_Deep_Policy_Gradient_Optimization | 68d3f8fca6c6e6b356261f568f0d8562242fa649 | [
"MIT"
] | null | null | null | run_files/ppo_reg_adapt/run_ppo_reg_adapt_ipsu.py | YunjaeChoi/Gain-Risk_Framework_for_Stabilization_of_Deep_Policy_Gradient_Optimization | 68d3f8fca6c6e6b356261f568f0d8562242fa649 | [
"MIT"
] | null | null | null | from ppo_reg_adapt import ppo_reg_adapt
from env_functions import *
from utils.run_utils import ExperimentGrid
if __name__ == '__main__':
exp_name = 'ipsu-ppo_reg_adapt'
eg = ExperimentGrid(name=exp_name)
eg.add('seed', [10*i for i in range(5)])
#pendulum
eg.add('env_fn', inverted_pendulum_swingu... | 24.157895 | 65 | 0.694989 |
166b88a9fe6a51b81b2918d13ffc4464793d62e4 | 17,188 | py | Python | lib-python/2.7/test/list_tests.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 333 | 2015-08-08T18:03:38.000Z | 2022-03-22T18:13:12.000Z | lib-python/2.7/test/list_tests.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 7 | 2020-02-16T16:49:05.000Z | 2021-11-26T09:00:56.000Z | lib-python/2.7/test/list_tests.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | """
Tests common to list and UserList.UserList
"""
import sys
import os
from test import test_support, seq_tests
class CommonTest(seq_tests.CommonTest):
def test_init(self):
# Iterable arg is optional
self.assertEqual(self.type2test([]), self.type2test())
# Init clears previous values
... | 30.969369 | 81 | 0.521119 |
60868e8912f936783032e42516a8077d467ca132 | 1,848 | py | Python | modelbased-rl/BMPO/env/walker2dNT.py | TJU-DRL-LAB/ai-optimizer | f558cc524c66460913989519779873b371bf78bc | [
"MIT"
] | 19 | 2020-09-02T05:58:09.000Z | 2021-08-23T11:03:00.000Z | modelbased-rl/BMPO/env/walker2dNT.py | TJU-DRL-LAB/ai-optimizer | f558cc524c66460913989519779873b371bf78bc | [
"MIT"
] | 4 | 2020-07-19T13:57:56.000Z | 2021-11-10T19:42:58.000Z | env/walker2dNT.py | apexrl/bmpo | d065cf195b942c3e534d4c789a0982e0ec09957c | [
"MIT"
] | 3 | 2020-09-28T11:21:24.000Z | 2020-12-28T23:27:25.000Z | import numpy as np
from gym import utils
from gym.envs.mujoco import mujoco_env
class Walker2dNTEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
mujoco_env.MujocoEnv.__init__(self, "walker2d.xml", 4)
utils.EzPickle.__init__(self)
def step(self, a):
'''
posbefore ... | 33 | 94 | 0.579545 |
16f73a0ef01f2a3d56601915dbd064462d7e0bea | 276 | py | Python | hw1/choose.py | BobAnkh/MaC | f43c75576ea5af35e4c67f593627cbe1d479648e | [
"MIT"
] | 2 | 2021-02-17T08:18:33.000Z | 2021-02-21T10:48:47.000Z | hw1/choose.py | BobAnkh/MaC | f43c75576ea5af35e4c67f593627cbe1d479648e | [
"MIT"
] | null | null | null | hw1/choose.py | BobAnkh/MaC | f43c75576ea5af35e4c67f593627cbe1d479648e | [
"MIT"
] | null | null | null | import numpy as np
# choose 1: B
a = np.arange(60.).reshape(3, 4, 5)
print(np.arange(60.).reshape(3, 4, 5))
b = np.sum(a, axis=0, keepdims=True)
print(b)
print(b.shape)
c = np.sum(a, axis=0)
print(c)
print(c.shape)
# choose 2: A
# choose 3: A
# choose 4: A
# choose 5: C
| 13.8 | 38 | 0.619565 |
871c3976d647277832e5d1365abfb8e0758edfa6 | 27,127 | py | Python | retopoflow/rftool_polystrips/polystrips.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | null | null | null | retopoflow/rftool_polystrips/polystrips.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | null | null | null | retopoflow/rftool_polystrips/polystrips.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | null | null | null | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson, and Patrick Moore
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation... | 39.371553 | 184 | 0.607955 |
2b65d566b9e2a0182f334a7077590771b4cb818b | 974 | py | Python | job/models.py | AnsGoo/cronJob | 0f9aedbe2ffe3c405376c13a7c2d24540360bd0e | [
"MIT"
] | 11 | 2021-06-27T05:00:09.000Z | 2022-02-15T14:31:21.000Z | job/models.py | AnsGoo/cornJob | 0f9aedbe2ffe3c405376c13a7c2d24540360bd0e | [
"MIT"
] | 1 | 2021-12-01T12:20:54.000Z | 2021-12-08T11:54:12.000Z | job/models.py | AnsGoo/cornJob | 0f9aedbe2ffe3c405376c13a7c2d24540360bd0e | [
"MIT"
] | 2 | 2021-06-27T05:00:16.000Z | 2021-08-09T06:36:09.000Z | import json
from typing import Dict
from sqlalchemy import Column, Integer, String, Text, Enum, DateTime
from app.database import Base
class JobRecord(Base):
id = Column(Integer, primary_key=True, autoincrement=True, index=True)
job_id = Column(String(191))
name = Column(String(255))
args = Column(Tex... | 32.466667 | 74 | 0.61191 |
fd4f99e84c943319e6544bdfaf7596fc366fda4e | 4,290 | py | Python | ete2/treeview/_about.py | csc8630Spring2014/Clusterizer | f64b0cabfbf4fa117b73a2af9355f67cc9207fe5 | [
"MIT"
] | 1 | 2017-05-10T02:51:51.000Z | 2017-05-10T02:51:51.000Z | ete2/treeview/_about.py | csc8630Spring2014/Clusterizer | f64b0cabfbf4fa117b73a2af9355f67cc9207fe5 | [
"MIT"
] | null | null | null | ete2/treeview/_about.py | csc8630Spring2014/Clusterizer | f64b0cabfbf4fa117b73a2af9355f67cc9207fe5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public ... | 51.071429 | 311 | 0.680886 |
082718e61a663b216fa681e53fe7397a0a761266 | 21,352 | py | Python | venv/lib/python3.7/site-packages/datalad/support/archives.py | emmetaobrien/dats-validator | fb25f97a32119c2bce4eb50dc080a93d5ee77141 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/datalad/support/archives.py | emmetaobrien/dats-validator | fb25f97a32119c2bce4eb50dc080a93d5ee77141 | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/datalad/support/archives.py | emmetaobrien/dats-validator | fb25f97a32119c2bce4eb50dc080a93d5ee77141 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 37.263525 | 96 | 0.601255 |
4ab25938c8ced62720075fdd9777b402c305d44e | 3,317 | py | Python | lib/SetAPI/generic/WorkspaceListObjectsIterator.py | r2sunita/SetAPI | 4ed769ed9678c057c7ded05fb93b9b7dc0874fc2 | [
"MIT"
] | null | null | null | lib/SetAPI/generic/WorkspaceListObjectsIterator.py | r2sunita/SetAPI | 4ed769ed9678c057c7ded05fb93b9b7dc0874fc2 | [
"MIT"
] | null | null | null | lib/SetAPI/generic/WorkspaceListObjectsIterator.py | r2sunita/SetAPI | 4ed769ed9678c057c7ded05fb93b9b7dc0874fc2 | [
"MIT"
] | null | null | null | import time
from collections import deque
class WorkspaceListObjectsIterator:
# ws_info - optional workspace info tuple (if is not defined then either ws_id
# or ws_name should be provided),
# ws_id/ws_name - optional workspace identification (if neither is defined
# then ws_info should be pro... | 43.077922 | 92 | 0.602352 |
2736a3cd1f2c78689bfad9057739dbce76e6f686 | 779 | py | Python | shop/migrations/0011_genre.py | dada00321/clothing_website | 8834aa5136d18435e095aa00a3e1a70a7dbbcb43 | [
"MIT"
] | 1 | 2021-04-19T08:36:43.000Z | 2021-04-19T08:36:43.000Z | shop/migrations/0011_genre.py | dada00321/clothing_website | 8834aa5136d18435e095aa00a3e1a70a7dbbcb43 | [
"MIT"
] | null | null | null | shop/migrations/0011_genre.py | dada00321/clothing_website | 8834aa5136d18435e095aa00a3e1a70a7dbbcb43 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.5 on 2021-02-20 15:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0010_auto_20210220_1946'),
]
operations = [
migrations.CreateModel(
name='Genre',
fields=[
(... | 29.961538 | 114 | 0.553273 |
f00826f68bcd67af2cb16741925440c648e23966 | 87,860 | py | Python | setup.py | PonyPC/python-pcl | b2df1599d2794a176caee25ae536ba232ea90254 | [
"BSD-3-Clause"
] | 1 | 2021-05-12T05:21:50.000Z | 2021-05-12T05:21:50.000Z | setup.py | PonyPC/python-pcl | b2df1599d2794a176caee25ae536ba232ea90254 | [
"BSD-3-Clause"
] | null | null | null | setup.py | PonyPC/python-pcl | b2df1599d2794a176caee25ae536ba232ea90254 | [
"BSD-3-Clause"
] | 1 | 2021-07-21T03:07:17.000Z | 2021-07-21T03:07:17.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
from collections import defaultdict
from Cython.Distutils import build_ext
from distutils.core import setup
from distutils.extension import Extension
# from Cython.Build import cythonize # MacOS NG
from setuptools import setup, find_packages, Exten... | 97.190265 | 3,707 | 0.669804 |
8e835131f0cd1fd040b14b3ee3cefdc0fa289b33 | 1,117 | py | Python | setup.py | mwilliamson/python-cobble | 2212d04bf51e8fb1b1c05998614c06023305cbd0 | [
"BSD-2-Clause"
] | 6 | 2015-08-08T16:34:59.000Z | 2020-01-07T22:10:04.000Z | setup.py | dougmassay/python-cobble | 2212d04bf51e8fb1b1c05998614c06023305cbd0 | [
"BSD-2-Clause"
] | null | null | null | setup.py | dougmassay/python-cobble | 2212d04bf51e8fb1b1c05998614c06023305cbd0 | [
"BSD-2-Clause"
] | 2 | 2015-11-08T21:48:34.000Z | 2017-07-20T20:37:10.000Z | #!/usr/bin/env python
import os
from setuptools import setup
import sys
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='cobble',
version='0.1.3',
description='Create data objects',
long_description=read("README.rst"),
author='Michael Williamson... | 31.027778 | 70 | 0.612355 |
1c7e1888a0171272023e97a155919bcb2d2fd51d | 154 | py | Python | makewiki/forms.py | franklin-phan/makewikiv2 | 5bb2dce694e2a2fffcab5a30355be5fa57718c55 | [
"MIT"
] | null | null | null | makewiki/forms.py | franklin-phan/makewikiv2 | 5bb2dce694e2a2fffcab5a30355be5fa57718c55 | [
"MIT"
] | 5 | 2020-06-06T01:32:33.000Z | 2022-02-10T09:25:44.000Z | makewiki/forms.py | franklin-phan/makewikiv2 | 5bb2dce694e2a2fffcab5a30355be5fa57718c55 | [
"MIT"
] | null | null | null | from django import forms
class FriendlyForm(forms.Form):
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100) | 30.8 | 48 | 0.779221 |
98410bf4e92206f97fb5860918b86d698d8e401e | 1,241 | py | Python | 0401-0500/0407-Trapping Rain Water II/0407-Trapping Rain Water II.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0401-0500/0407-Trapping Rain Water II/0407-Trapping Rain Water II.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0401-0500/0407-Trapping Rain Water II/0407-Trapping Rain Water II.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | import heapq
class Solution:
def trapRainWater(self, heightMap: List[List[int]]) -> int:
m = len(heightMap)
if m == 0:
return 0
n = len(heightMap[0])
if n == 0:
return 0
visited = [[False]*n for _ in range(m)]
pq = []
for i in range(m):... | 36.5 | 81 | 0.424658 |
a23e9d1041fb419479de9006470ac81832acafc3 | 2,032 | py | Python | FastAutoAugment/nas/evaluate.py | sytelus/fast-autoaugment | a53708699dce1233ce2a0bf0416ae2278007d506 | [
"MIT"
] | null | null | null | FastAutoAugment/nas/evaluate.py | sytelus/fast-autoaugment | a53708699dce1233ce2a0bf0416ae2278007d506 | [
"MIT"
] | null | null | null | FastAutoAugment/nas/evaluate.py | sytelus/fast-autoaugment | a53708699dce1233ce2a0bf0416ae2278007d506 | [
"MIT"
] | null | null | null | from typing import Optional
import torch
from ..common.trainer import Trainer
from ..common.config import Config
from ..common.common import get_logger
from ..common import data
from .model_desc import ModelDesc
from .micro_builder import MicroBuilder
from . import nas_utils
def eval_arch(conf_eval:Config, micro_bui... | 29.882353 | 76 | 0.677165 |
a7c3e2c19f22aa65d1560768808ed28bbcc874cb | 1,196 | py | Python | katrain/gui/sound.py | NhanHo/katrain | 070420941c117e2ca2fdff8e0c7521566149e760 | [
"MIT"
] | 1 | 2022-01-16T04:22:59.000Z | 2022-01-16T04:22:59.000Z | katrain/gui/sound.py | PeonyWhite/katrain | 070420941c117e2ca2fdff8e0c7521566149e760 | [
"MIT"
] | null | null | null | katrain/gui/sound.py | PeonyWhite/katrain | 070420941c117e2ca2fdff8e0c7521566149e760 | [
"MIT"
] | 1 | 2022-03-08T12:23:04.000Z | 2022-03-08T12:23:04.000Z | from kivy.clock import Clock
from kivymd.app import MDApp
from kivy.core.audio import SoundLoader
from kivy.utils import platform
cached_sounds = {}
# prefer ffpyplayer on linux, then others, avoid gst and avoid or ffpyplayer on windows
ranking = [("ffpy", 98 if platform in ["win", "macosx"] else -2), ("sdl", -1), ("... | 31.473684 | 102 | 0.635452 |
9a9bba7149f3be6c0985c894daf8b09d35092064 | 6,448 | py | Python | qa327/backend.py | EduardVar/BrainBench | abc26c5a6e7492e5c0ef03457c91175b0bb8ba41 | [
"MIT"
] | null | null | null | qa327/backend.py | EduardVar/BrainBench | abc26c5a6e7492e5c0ef03457c91175b0bb8ba41 | [
"MIT"
] | null | null | null | qa327/backend.py | EduardVar/BrainBench | abc26c5a6e7492e5c0ef03457c91175b0bb8ba41 | [
"MIT"
] | 2 | 2021-01-04T04:44:28.000Z | 2021-01-16T19:41:29.000Z | from qa327.models import db, User, Ticket, Order
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import date, datetime
from typing import List, Union, Optional
import re
"""
This file defines all backend logic that interacts with database and other services
"""
def validate_em... | 30.704762 | 183 | 0.66067 |
1d06240994456fc8dfb552b14ce6f1186bbf36e0 | 461 | py | Python | cannabis_api/api/migrations/0002_auto_20190409_2107.py | abyrne55/cs411-a3 | 919f2d77ecd2e97c4b548d441eddda0248a640b1 | [
"MIT"
] | null | null | null | cannabis_api/api/migrations/0002_auto_20190409_2107.py | abyrne55/cs411-a3 | 919f2d77ecd2e97c4b548d441eddda0248a640b1 | [
"MIT"
] | null | null | null | cannabis_api/api/migrations/0002_auto_20190409_2107.py | abyrne55/cs411-a3 | 919f2d77ecd2e97c4b548d441eddda0248a640b1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-04-09 21:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='strain',
name='strain_type',
fi... | 24.263158 | 137 | 0.587852 |
560691c5ae6da26984d6a99927d2093b0e4227fe | 15,861 | py | Python | flow/utils/aimsun/run.py | syuntoku14/flow | 3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e | [
"MIT"
] | null | null | null | flow/utils/aimsun/run.py | syuntoku14/flow | 3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e | [
"MIT"
] | null | null | null | flow/utils/aimsun/run.py | syuntoku14/flow | 3a1157cde31d0b7d6a3cc2f91eef0ec9ea53575e | [
"MIT"
] | null | null | null | # flake8: noqa
import flow.config as config
import sys
import os
sys.path.append(os.path.join(config.AIMSUN_NEXT_PATH,
'programming/Aimsun Next API/AAPIPython/Micro'))
import flow.utils.aimsun.constants as ac
import AAPI as aimsun_api
from AAPI import *
from PyANGKernel import *
import so... | 35.013245 | 79 | 0.531555 |
36d258fa632117a09c96705c2e7efcaf62773a84 | 4,131 | py | Python | test/test_redisqlite.py | Tejusbharadwaj/nimbella-sdk-python | cdd05c656450ef5e92ababd88a6db5c2c51393f8 | [
"Apache-2.0"
] | 1 | 2021-02-22T20:14:09.000Z | 2021-02-22T20:14:09.000Z | test/test_redisqlite.py | Tejusbharadwaj/nimbella-sdk-python | cdd05c656450ef5e92ababd88a6db5c2c51393f8 | [
"Apache-2.0"
] | 16 | 2021-01-27T17:34:40.000Z | 2021-08-13T17:05:06.000Z | test/test_redisqlite.py | Tejusbharadwaj/nimbella-sdk-python | cdd05c656450ef5e92ababd88a6db5c2c51393f8 | [
"Apache-2.0"
] | 4 | 2021-01-28T16:47:26.000Z | 2021-07-20T08:32:10.000Z | """
/**
* Copyright (c) 2020-present, Nimbella, 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 applica... | 31.776923 | 135 | 0.566691 |
ef6645e401a44fac8e9ff25eeb790e95e03ad70e | 110 | py | Python | tests/test_ec2/test_customer_gateways.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | tests/test_ec2/test_customer_gateways.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | tests/test_ec2/test_customer_gateways.py | andrewgross/moto | 912c3ceb396e1e460c75d6a0a65f2431800a1583 | [
"Apache-2.0"
] | null | null | null | import boto
import sure # noqa
from moto import mock_ec2
@mock_ec2
def test_customer_gateways():
pass
| 11 | 29 | 0.754545 |
139f3a89d1f101ab7f012cc278ad2bf8186731bd | 2,470 | py | Python | apps/resource/migrations/0001_initial.py | Quanfita/QTechCode | 78a3cac617a63bd46272461e6b1e89411e2fb130 | [
"MIT"
] | null | null | null | apps/resource/migrations/0001_initial.py | Quanfita/QTechCode | 78a3cac617a63bd46272461e6b1e89411e2fb130 | [
"MIT"
] | 9 | 2022-01-16T04:23:33.000Z | 2022-03-31T20:39:58.000Z | apps/resource/migrations/0001_initial.py | Quanfita/QTechCode | 78a3cac617a63bd46272461e6b1e89411e2fb130 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.20 on 2022-01-15 17:23
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('blo... | 53.695652 | 145 | 0.617004 |
80481ca7ae5ba55e51ee30de841587028ca0d192 | 1,250 | py | Python | tests/unitary/test_approve_all.py | curvefi/curve-cross-asset-swaps | 741701ab0e93de8775079cdc69d638a618196da3 | [
"MIT"
] | 23 | 2021-01-06T02:52:25.000Z | 2022-01-04T05:53:42.000Z | tests/unitary/test_approve_all.py | curvefi/curve-cross-asset-swaps | 741701ab0e93de8775079cdc69d638a618196da3 | [
"MIT"
] | 1 | 2021-01-09T14:15:00.000Z | 2021-01-09T14:15:00.000Z | tests/unitary/test_approve_all.py | curvefi/curve-cross-asset-swaps | 741701ab0e93de8775079cdc69d638a618196da3 | [
"MIT"
] | 5 | 2021-01-11T23:32:15.000Z | 2022-02-07T00:07:42.000Z | def test_approve_all(swap, alice, bob):
assert swap.isApprovedForAll(alice, bob) is False
swap.setApprovalForAll(bob, True, {"from": alice})
assert swap.isApprovedForAll(alice, bob) is True
def test_approve_all_multiple(swap, alice, accounts):
operators = accounts[4:8]
for acct in operators:
... | 33.783784 | 69 | 0.7064 |
1ba8db5f61a8b5a624f0d16ee72405470664ca97 | 120 | py | Python | tests/context.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | tests/context.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | tests/context.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import ezparse
| 20 | 82 | 0.733333 |
98f45678c42eff043f2719f36bc636b0800ec976 | 901 | bzl | Python | prometheus/defs.bzl | 5h4d0w4rt/bazel_prometheus | 69553b8837b7cdde79a5327d33fd757c0d1fbd9d | [
"MIT"
] | null | null | null | prometheus/defs.bzl | 5h4d0w4rt/bazel_prometheus | 69553b8837b7cdde79a5327d33fd757c0d1fbd9d | [
"MIT"
] | null | null | null | prometheus/defs.bzl | 5h4d0w4rt/bazel_prometheus | 69553b8837b7cdde79a5327d33fd757c0d1fbd9d | [
"MIT"
] | null | null | null | load(
"@io_bazel_rules_prometheus//prometheus/internal:repositories.bzl",
_prometheus_repositories = "prometheus_repositories",
)
load(
"@io_bazel_rules_prometheus//prometheus/internal:promtool.bzl",
_promtool = "promtool",
_promtool_config_test = "promtool_config_test",
_promtool_rules_test = "... | 32.178571 | 71 | 0.802442 |
f2821b0131fd3f49165a12f049b365eafe7d5edb | 604 | py | Python | Geometry/tests/test_line.py | liuxiang0/Geometry | 3500f815fa56c535b36d1b6fd0afe69ce5d055be | [
"MIT"
] | 23 | 2015-10-28T15:21:41.000Z | 2022-03-29T13:52:41.000Z | Geometry/tests/test_line.py | liuxiang0/Geometry | 3500f815fa56c535b36d1b6fd0afe69ce5d055be | [
"MIT"
] | 7 | 2021-01-26T11:57:25.000Z | 2022-02-07T11:00:06.000Z | Geometry/tests/test_line.py | liuxiang0/Geometry | 3500f815fa56c535b36d1b6fd0afe69ce5d055be | [
"MIT"
] | 16 | 2016-07-17T12:47:05.000Z | 2021-06-21T21:02:48.000Z |
import unittest
import math
import sys
from .. import Line, Segment, Ray, Point
from ..exceptions import *
class LineTestCase(unittest.TestCase):
def assertIsLine(self, l, msg=None):
self.assertIsInstance(l, Line)
def assertLinesEqual(self, p, q, msg=None):
pass
def testLineCreation(s... | 18.30303 | 47 | 0.657285 |
6bcbbf8a131f8d71a3552725de20c3e78083297e | 17,774 | py | Python | contrib/IECoreAlembic/test/IECoreAlembic/AlembicInputTest.py | goddardl/cortex | 323a160fd831569591cde1504f415a638f8b85bc | [
"BSD-3-Clause"
] | null | null | null | contrib/IECoreAlembic/test/IECoreAlembic/AlembicInputTest.py | goddardl/cortex | 323a160fd831569591cde1504f415a638f8b85bc | [
"BSD-3-Clause"
] | null | null | null | contrib/IECoreAlembic/test/IECoreAlembic/AlembicInputTest.py | goddardl/cortex | 323a160fd831569591cde1504f415a638f8b85bc | [
"BSD-3-Clause"
] | 1 | 2020-09-26T01:15:37.000Z | 2020-09-26T01:15:37.000Z | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of sou... | 38.059957 | 144 | 0.672499 |
dba4892df6b04036d2bb5c14229d3ad666dc9abb | 2,810 | py | Python | mvlearn/datasets/base.py | cameronfr/mvlearn | 5e279d979446f213dd3ae420536138ce6c60cccf | [
"Apache-2.0"
] | null | null | null | mvlearn/datasets/base.py | cameronfr/mvlearn | 5e279d979446f213dd3ae420536138ce6c60cccf | [
"Apache-2.0"
] | null | null | null | mvlearn/datasets/base.py | cameronfr/mvlearn | 5e279d979446f213dd3ae420536138ce6c60cccf | [
"Apache-2.0"
] | null | null | null | from os.path import dirname, join
import numpy as np
def load_UCImultifeature(select_labeled="all"):
"""
Load the UCI multiple features dataset, taken from
https://archive.ics.uci.edu/ml/datasets/Multiple+Features This data set
consists of 6 views of handwritten digit images, with classes 0-9. The
... | 35.125 | 79 | 0.625979 |
6561d33379623149d36537a5f95a5152b9b99399 | 14,908 | py | Python | bin/update_isa.py | ucam-comparch-loki/lokisim | 3641e01d6173d448a8bd9d62c3cc9664d05e442d | [
"MIT"
] | null | null | null | bin/update_isa.py | ucam-comparch-loki/lokisim | 3641e01d6173d448a8bd9d62c3cc9664d05e442d | [
"MIT"
] | 2 | 2020-04-06T14:22:31.000Z | 2020-06-01T09:33:37.000Z | bin/update_isa.py | ucam-comparch-loki/lokisim | 3641e01d6173d448a8bd9d62c3cc9664d05e442d | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import datetime, os
class Operation:
# Split the string into its individual sections. These should be:
# operation[0] = mnemonic (e.g. NOR)
# operation[1] = opcode (e.g. 0000000)
# operation[2] = format (e.g. 3R(rd,rs,rt))
# operation[3] = function ... | 37.363409 | 135 | 0.601422 |
00ab72c7edc5cf468271829378e07e8f0c7064d2 | 36,865 | py | Python | multimodal_transformers/model/tabular_transformers.py | sidharrth2002/Multimodal-Toolkit | 3e5e9cf58e5310a10f62203113443631bc6ca1fe | [
"MIT"
] | null | null | null | multimodal_transformers/model/tabular_transformers.py | sidharrth2002/Multimodal-Toolkit | 3e5e9cf58e5310a10f62203113443631bc6ca1fe | [
"MIT"
] | null | null | null | multimodal_transformers/model/tabular_transformers.py | sidharrth2002/Multimodal-Toolkit | 3e5e9cf58e5310a10f62203113443631bc6ca1fe | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.utils.data.dataset import T
from transformers import (
BertForSequenceClassification,
RobertaForSequenceClassification,
DistilBertForSequenceClassification,
AlbertForSequenceClassification,
XLNetForSequenceClassification,
XLMForSequenceClassification,... | 48.570487 | 152 | 0.606999 |
55eccd8de3593950e9094d97a36fd2d8aa7100e4 | 1,874 | py | Python | iree/compiler/API/python/test/transforms/ireec/compile_sample_module.py | dcaballe/iree | e73f0505831b5c29ed5d97537472b6e2068eed7f | [
"Apache-2.0"
] | null | null | null | iree/compiler/API/python/test/transforms/ireec/compile_sample_module.py | dcaballe/iree | e73f0505831b5c29ed5d97537472b6e2068eed7f | [
"Apache-2.0"
] | null | null | null | iree/compiler/API/python/test/transforms/ireec/compile_sample_module.py | dcaballe/iree | e73f0505831b5c29ed5d97537472b6e2068eed7f | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import io
import subprocess
from iree.compiler import ir
from iree.compiler import passmanager
from i... | 34.703704 | 100 | 0.759872 |
b035632a13e8e2dbf500075afcc2782555a2d6e8 | 9,276 | py | Python | electrum_ltc/gui/qt/paytoedit.py | jakesum/electrum-ltc | 8bc205e086210e6ec40dbc0b8f46c9fc74c47121 | [
"MIT"
] | null | null | null | electrum_ltc/gui/qt/paytoedit.py | jakesum/electrum-ltc | 8bc205e086210e6ec40dbc0b8f46c9fc74c47121 | [
"MIT"
] | null | null | null | electrum_ltc/gui/qt/paytoedit.py | jakesum/electrum-ltc | 8bc205e086210e6ec40dbc0b8f46c9fc74c47121 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... | 33.730909 | 96 | 0.604355 |
7c00f00f0af44752aa86f0af3bebb2e82d7b0717 | 4,181 | py | Python | examples/Python/ReconstructionSystem/sensors/azure_kinect_recorder.py | yuki-inaho/Open3D | cbbee4e19a45551ada223f491e667f1868115ead | [
"MIT"
] | 113 | 2018-11-12T03:32:52.000Z | 2022-03-29T13:58:54.000Z | examples/Python/ReconstructionSystem/sensors/azure_kinect_recorder.py | llp45135/Open3D | ff7003d542c4fcf88a2d9e7fe08508b3e52dc702 | [
"MIT"
] | 3 | 2018-10-19T12:09:57.000Z | 2020-04-22T11:55:54.000Z | examples/Python/ReconstructionSystem/sensors/azure_kinect_recorder.py | llp45135/Open3D | ff7003d542c4fcf88a2d9e7fe08508b3e52dc702 | [
"MIT"
] | 27 | 2018-10-16T20:01:18.000Z | 2021-07-26T08:02:20.000Z | # Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
# examples/Python/ReconstructionSystem/sensors/azure_kinect_recorder.py
import argparse
import datetime
import open3d as o3d
class RecorderWithCallback:
def __init__(self, config, device, filename, align_dep... | 33.448 | 78 | 0.586463 |
ea54fce9273d175db856d4ad57f983d247c41de8 | 4,135 | py | Python | pde/pdes/wave.py | tefavidal/py-pde | 427be3f2f4b096775f46111cd5a5d05af50e94bc | [
"MIT"
] | 163 | 2020-03-30T09:26:32.000Z | 2022-03-31T12:22:18.000Z | pde/pdes/wave.py | tefavidal/py-pde | 427be3f2f4b096775f46111cd5a5d05af50e94bc | [
"MIT"
] | 127 | 2020-03-31T15:33:15.000Z | 2022-03-30T19:27:47.000Z | pde/pdes/wave.py | tefavidal/py-pde | 427be3f2f4b096775f46111cd5a5d05af50e94bc | [
"MIT"
] | 37 | 2020-03-10T18:54:22.000Z | 2022-03-29T14:45:40.000Z | """
A simple diffusion equation
.. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de>
"""
from typing import Callable, Dict
import numpy as np
from ..fields import FieldCollection, ScalarField
from ..grids.boundaries.axes import BoundariesData
from ..tools.docstrings import fill_in_docstring
from ..tools.numba i... | 31.564885 | 84 | 0.579686 |
8ed664ce2ce7703fc7d24abafd23b4083023d095 | 3,734 | py | Python | coverage-4.2-py2.7-linux-armv7l.egg/coverage/debug.py | NextGenTechBar/twandora | f626717a5580f82250bbe66d4ebc357e0882382c | [
"MIT"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | coverage-4.2-py2.7-linux-armv7l.egg/coverage/debug.py | NextGenTechBar/twandora | f626717a5580f82250bbe66d4ebc357e0882382c | [
"MIT"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | coverage-4.2-py2.7-linux-armv7l.egg/coverage/debug.py | NextGenTechBar/twandora | f626717a5580f82250bbe66d4ebc357e0882382c | [
"MIT"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Control of and utilities for debugging."""
import inspect
import os
import sys
from coverage.misc import isolate_module
os = isolate_module(os)
# When debug... | 32.469565 | 82 | 0.614355 |
cf3ef70d19c131dde23a104072bf8395cbead6a2 | 581 | py | Python | nomadgram/images/migrations/0003_auto_20190312_0234.py | hyeseonii/nomadgram | 5aa3d4bad038e59f95e618168b1ea01af99eff15 | [
"MIT"
] | null | null | null | nomadgram/images/migrations/0003_auto_20190312_0234.py | hyeseonii/nomadgram | 5aa3d4bad038e59f95e618168b1ea01af99eff15 | [
"MIT"
] | 5 | 2020-06-05T20:29:02.000Z | 2021-09-08T00:58:35.000Z | nomadgram/images/migrations/0003_auto_20190312_0234.py | hyeseonii/nomadgram | 5aa3d4bad038e59f95e618168b1ea01af99eff15 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-03-11 17:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('images', '0002_auto_20190311_2224'),
]
operations = [
migrations.RemoveField(
model_name='comm... | 24.208333 | 111 | 0.605852 |
b421d66c50fe97398de43ba410e1e1b500ed5914 | 4,340 | py | Python | DeepSpeech/examples/vad_transcriber/audioTranscript_cmd.py | wingerse/audio_adversarial_examples | f747efea967e64351e9d5dc1b36fa1ca8d52b066 | [
"BSD-2-Clause"
] | null | null | null | DeepSpeech/examples/vad_transcriber/audioTranscript_cmd.py | wingerse/audio_adversarial_examples | f747efea967e64351e9d5dc1b36fa1ca8d52b066 | [
"BSD-2-Clause"
] | null | null | null | DeepSpeech/examples/vad_transcriber/audioTranscript_cmd.py | wingerse/audio_adversarial_examples | f747efea967e64351e9d5dc1b36fa1ca8d52b066 | [
"BSD-2-Clause"
] | null | null | null | import sys
import os
import logging
import argparse
import subprocess
import shlex
import numpy as np
import wavTranscriber
# Debug helpers
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
def main(args):
parser = argparse.ArgumentParser(description='Transcribe long audio files using webRTC VAD or use... | 46.666667 | 144 | 0.593779 |
79af22d62e19765d358a42bdbe956e8e584d7f61 | 2,370 | py | Python | Bayesian/bayesian_linear_regression.py | perathambkk/ml-techniques | 5d6fd122322342c0b47dc65d09c4425fd73f2ea9 | [
"MIT"
] | null | null | null | Bayesian/bayesian_linear_regression.py | perathambkk/ml-techniques | 5d6fd122322342c0b47dc65d09c4425fd73f2ea9 | [
"MIT"
] | null | null | null | Bayesian/bayesian_linear_regression.py | perathambkk/ml-techniques | 5d6fd122322342c0b47dc65d09c4425fd73f2ea9 | [
"MIT"
] | null | null | null | """
Author: Peratham Wiriyathammabhum
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
eps = np.finfo(float).eps
class BayesLinReg(object):
"""
Bayesian linear regression.
See: Pattern Recognition and Machine Learning by Christopher Bishop ch.3.
https://www.m... | 26.043956 | 140 | 0.694093 |
52f70fbe982b13a35ac2f1a8f13a5c4d790077b1 | 158 | py | Python | k2mosaic/version.py | amcody/k2mosaic | 79733ab86249825868d5d6f6362a98656b8482f0 | [
"MIT"
] | 13 | 2015-12-17T02:47:11.000Z | 2021-09-07T21:13:21.000Z | k2mosaic/version.py | amcody/k2mosaic | 79733ab86249825868d5d6f6362a98656b8482f0 | [
"MIT"
] | 12 | 2015-12-17T02:50:49.000Z | 2019-01-24T19:31:15.000Z | k2mosaic/version.py | amcody/k2mosaic | 79733ab86249825868d5d6f6362a98656b8482f0 | [
"MIT"
] | 18 | 2016-05-20T06:41:06.000Z | 2021-09-08T21:15:02.000Z | # It is important to store the version number in a separate file
# so that we can read it from setup.py without importing the package
__version__ = "2.1.dev"
| 39.5 | 68 | 0.765823 |
1f9968ab60d2e3497cf55536a9d02b6fb47eb340 | 1,472 | py | Python | AddExcelData/AddExcelData.py | IndyMPO/IndyGeoprocessingTools | 968f9befc37252e065e8d8085c0d10f17a871152 | [
"Apache-2.0"
] | null | null | null | AddExcelData/AddExcelData.py | IndyMPO/IndyGeoprocessingTools | 968f9befc37252e065e8d8085c0d10f17a871152 | [
"Apache-2.0"
] | 3 | 2016-08-30T16:10:20.000Z | 2016-09-06T15:32:44.000Z | AddExcelData/AddExcelData.py | IndyMPO/IndyGeoprocessingTools | 968f9befc37252e065e8d8085c0d10f17a871152 | [
"Apache-2.0"
] | null | null | null | #This script copyright 2017 Indianapolis Metropolitan Planning Organization
import arcpy
import pandas as pd
shapefile = arcpy.GetParameterAsText(0)
id_field = arcpy.GetParameterAsText(1)
excel_file = arcpy.GetParameterAsText(2)
sheet = arcpy.GetParameter(3)
#Map to determine each new field's data type based on the d... | 34.232558 | 114 | 0.688859 |
e33ddc20d66c5185a5fce266e23aaa2181291511 | 1,230 | py | Python | jdcloud_sdk/services/vod/apis/DeleteSnapshotTemplateRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/vod/apis/DeleteSnapshotTemplateRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/vod/apis/DeleteSnapshotTemplateRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 29.285714 | 75 | 0.721138 |
8e23ee323791607793f35ce51f325dac47f68e6d | 10,260 | py | Python | plaso/engine/artifact_filters.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | 1 | 2020-12-04T10:26:34.000Z | 2020-12-04T10:26:34.000Z | plaso/engine/artifact_filters.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | plaso/engine/artifact_filters.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Helper to create filters based on forensic artifact definitions."""
from __future__ import unicode_literals
from artifacts import definitions as artifact_types
from dfwinreg import registry_searcher
from dfvfs.helpers import file_system_searcher
from plaso.engine import filters_helper
fr... | 38 | 128 | 0.705653 |
c29f37c95e9d53035a512fc38888bf216bf8a364 | 1,368 | py | Python | tests/_test_utils.py | SimonBlanke/data-storage | 65ff5b6115099d0dad86cf3472c4ebe66249eade | [
"MIT"
] | null | null | null | tests/_test_utils.py | SimonBlanke/data-storage | 65ff5b6115099d0dad86cf3472c4ebe66249eade | [
"MIT"
] | null | null | null | tests/_test_utils.py | SimonBlanke/data-storage | 65ff5b6115099d0dad86cf3472c4ebe66249eade | [
"MIT"
] | null | null | null | import numpy as np
from collections import Counter
def search_data_equal(search_data1, search_data2, assert_order=True):
col1 = list(search_data1.columns)
col2 = list(search_data2.columns)
print("\n col1 \n", col1, "\n", type(col1))
print("\n col2 \n", col2, "\n", type(col2))
if set(col1) != se... | 27.918367 | 82 | 0.60307 |
6ed77a59d96ded565b7124aa205d4c4b0dc94dcb | 12,590 | py | Python | cirq-google/cirq_google/serialization/op_deserializer.py | peterse/Cirq | 31daa9410a0e1e1ac3da38109aa8ce3a15aed17b | [
"Apache-2.0"
] | 3,326 | 2018-07-18T23:17:21.000Z | 2022-03-29T22:28:24.000Z | cirq-google/cirq_google/serialization/op_deserializer.py | peterse/Cirq | 31daa9410a0e1e1ac3da38109aa8ce3a15aed17b | [
"Apache-2.0"
] | 3,443 | 2018-07-18T21:07:28.000Z | 2022-03-31T20:23:21.000Z | cirq-google/cirq_google/serialization/op_deserializer.py | peterse/Cirq | 31daa9410a0e1e1ac3da38109aa8ce3a15aed17b | [
"Apache-2.0"
] | 865 | 2018-07-18T23:30:24.000Z | 2022-03-30T11:43:23.000Z | # Copyright 2019 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 38.501529 | 98 | 0.625894 |
9ed9a6031a22000a8fd1579f3e84ad009fa37881 | 602 | py | Python | oop/inheritance.py | mbreault/python | addab433b2f1e9b2fdd4851d9b9662804656ce5a | [
"MIT"
] | null | null | null | oop/inheritance.py | mbreault/python | addab433b2f1e9b2fdd4851d9b9662804656ce5a | [
"MIT"
] | null | null | null | oop/inheritance.py | mbreault/python | addab433b2f1e9b2fdd4851d9b9662804656ce5a | [
"MIT"
] | null | null | null | ## Simple Inheritance
class Person:
def __init__(self, first, last, age):
self.firstname = first
self.lastname = last
self.age = age
def __str__(self):
return self.firstname + " " + self.lastname + ", " + str(self.age)
class Employee(Person):
def __init__(self, first, la... | 23.153846 | 74 | 0.60299 |
dd27ac2f09077aa7401408c152552f102c2853b6 | 898 | py | Python | notebook_snapshot/snapshot.py | oscar6echo/notebook-snapshot | 3f2474d27abfca6610a68c6651c2e327792f8a5a | [
"MIT"
] | 1 | 2019-08-15T22:24:43.000Z | 2019-08-15T22:24:43.000Z | notebook_snapshot/snapshot.py | oscar6echo/notebook-snapshot | 3f2474d27abfca6610a68c6651c2e327792f8a5a | [
"MIT"
] | null | null | null | notebook_snapshot/snapshot.py | oscar6echo/notebook-snapshot | 3f2474d27abfca6610a68c6651c2e327792f8a5a | [
"MIT"
] | 3 | 2018-12-11T10:10:21.000Z | 2019-11-22T17:57:47.000Z |
import sys
import subprocess as sp
def snapshot(path_nb,
path_template=None,
embed_img=True,
):
"""
"""
if embed_img:
exporter = 'notebook_snapshot.html_embed_img'
else:
exporter = 'html'
cmd = 'jupyter nbconvert --to {} --template {} {}'
... | 29.933333 | 87 | 0.615813 |
e9a326d8c4fd8f7e4073d33b5ed616a3c2533d13 | 6,119 | py | Python | green/output.py | kris-winiark/green | 7f1dc69a38ed6af4947988f29b5f3c8353449961 | [
"MIT"
] | null | null | null | green/output.py | kris-winiark/green | 7f1dc69a38ed6af4947988f29b5f3c8353449961 | [
"MIT"
] | null | null | null | green/output.py | kris-winiark/green | 7f1dc69a38ed6af4947988f29b5f3c8353449961 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from colorama.ansi import Cursor
from colorama.initialise import wrap_stream
import logging
import os
import platform
import sys
import termstyle
from unidecode import unidecode
global debug_level
debug_level = 0
if sys.version_info[0] == 3: # pragma: no cover
text_type = ... | 30.595 | 81 | 0.61546 |
312f2612c5879e3b0bf017b107cd20b912afb83b | 1,455 | bzl | Python | vendor/mlir/mlir.bzl | Antetokounpo/plaidml | 06891b0a4a2691994580add063232f83294f7fec | [
"Apache-2.0"
] | null | null | null | vendor/mlir/mlir.bzl | Antetokounpo/plaidml | 06891b0a4a2691994580add063232f83294f7fec | [
"Apache-2.0"
] | null | null | null | vendor/mlir/mlir.bzl | Antetokounpo/plaidml | 06891b0a4a2691994580add063232f83294f7fec | [
"Apache-2.0"
] | null | null | null | TBLGEN_ACTIONS = [
"-gen-enum-defs",
"-gen-enum-decls",
"-gen-llvmir-conversions",
"-gen-op-decls",
"-gen-op-defs",
"-gen-op-doc",
"-gen-reference-implementations",
"-gen-rewriters",
]
def _tblgen_impl(ctx):
args = ctx.actions.args()
args.add(ctx.attr.action)
args.add_all(ct... | 25.982143 | 59 | 0.534708 |
d14e733bdec0dc0ea49894ccb571bfc216bf27d1 | 6,024 | py | Python | src/mantarray_file_manager/__init__.py | CuriBio/mantarray-file-manager | fa71793ef9ac469f1868fa77c5d0929aad764900 | [
"MIT"
] | null | null | null | src/mantarray_file_manager/__init__.py | CuriBio/mantarray-file-manager | fa71793ef9ac469f1868fa77c5d0929aad764900 | [
"MIT"
] | 50 | 2020-08-07T17:38:06.000Z | 2022-02-21T12:01:57.000Z | src/mantarray_file_manager/__init__.py | CuriBio/mantarray-file-manager | fa71793ef9ac469f1868fa77c5d0929aad764900 | [
"MIT"
] | 1 | 2021-07-01T16:48:07.000Z | 2021-07-01T16:48:07.000Z | # -*- coding: utf-8 -*-
"""Curi Bio File Manager.
File Manager for utilizing Curi bio data files and online databases.
"""
from . import file_writer
from .constants import ADC_GAIN_SETTING_UUID
from .constants import ADC_REF_OFFSET_UUID
from .constants import ADC_TISSUE_OFFSET_UUID
from .constants import BACKEND_LOG_U... | 38.615385 | 68 | 0.834495 |
d0000e6e98510600d51c0be34c93515ab1685ecb | 15,026 | py | Python | demos/text_to_speech_demo/python/models/forward_tacotron_ie.py | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 2,201 | 2018-10-15T14:37:19.000Z | 2020-07-16T02:05:51.000Z | demos/text_to_speech_demo/python/models/forward_tacotron_ie.py | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 759 | 2018-10-18T07:43:55.000Z | 2020-07-16T01:23:12.000Z | demos/text_to_speech_demo/python/models/forward_tacotron_ie.py | kblaszczak-intel/open_model_zoo | e313674d35050d2a4721bbccd9bd4c404f1ba7f8 | [
"Apache-2.0"
] | 808 | 2018-10-16T14:03:49.000Z | 2020-07-15T11:41:45.000Z | """
Copyright (c) 2020-2022 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 i... | 48.627832 | 128 | 0.582989 |
64869eefd3d8c8e8b9294409dae8a4d102581dc7 | 3,781 | py | Python | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/SubmitIProductionJobRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/SubmitIProductionJobRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/SubmitIProductionJobRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.191919 | 79 | 0.75324 |
ebb8059662b2b31f18fc1f1b5b2e731f200e6df2 | 6,659 | py | Python | ocfweb/stats/printing.py | expedited/ocfweb | ed143b8f1c59e58157780007fe5fd104ee18d944 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | ocfweb/stats/printing.py | expedited/ocfweb | ed143b8f1c59e58157780007fe5fd104ee18d944 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | ocfweb/stats/printing.py | expedited/ocfweb | ed143b8f1c59e58157780007fe5fd104ee18d944 | [
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | import time
from collections import defaultdict
from datetime import date
from datetime import timedelta
from functools import partial
from django.http import HttpResponse
from django.shortcuts import render
from matplotlib.figure import Figure
from ocflib.lab import stats
from ocflib.printing.printers import PRINTERS... | 30.406393 | 115 | 0.532212 |
083cc22c4f52c39407fd57167da5617c1d4e8944 | 18,820 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/route_selection_options/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/route_selection_options/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/afi_safis/afi_safi/route_selection_options/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 39.208333 | 377 | 0.606164 |
877d35fb38ccda1f21d30e07a23fdf1a58b2ecfe | 127 | py | Python | lab_2/3.py | Mmalikov1337/python_labs | 0d72604efc8a9a94c80de38525146ebbc3287fa3 | [
"MIT"
] | null | null | null | lab_2/3.py | Mmalikov1337/python_labs | 0d72604efc8a9a94c80de38525146ebbc3287fa3 | [
"MIT"
] | null | null | null | lab_2/3.py | Mmalikov1337/python_labs | 0d72604efc8a9a94c80de38525146ebbc3287fa3 | [
"MIT"
] | null | null | null | from random import randint
print("random three-digit number ending in zero")
num = str(randint(10, 99))
print(int(num + '0'))
| 21.166667 | 49 | 0.716535 |
9001d4f08769bcdb4a48f64146b7b178ccd491c0 | 1,698 | py | Python | setup.py | hugovk/ety-python | b59f424b05f3bfb7c1fa023348842e2404128f32 | [
"MIT"
] | null | null | null | setup.py | hugovk/ety-python | b59f424b05f3bfb7c1fa023348842e2404128f32 | [
"MIT"
] | null | null | null | setup.py | hugovk/ety-python | b59f424b05f3bfb7c1fa023348842e2404128f32 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
from codecs import open
from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
with open(path.join(here, 'ety/__init__.py')... | 33.96 | 75 | 0.623675 |
b26d082ddcda888714fff0b3149cf3a2fc444229 | 846 | py | Python | train_evaluator/TFRecord_Slim_Reader.py | cow8/PupilTracking | 02977de83c9f1481b700a3bb0ac37f0f814b1faa | [
"Apache-2.0"
] | 8 | 2018-01-28T06:41:14.000Z | 2020-07-09T05:01:06.000Z | train_evaluator/TFRecord_Slim_Reader.py | asanchez19/PupilTracking | 02977de83c9f1481b700a3bb0ac37f0f814b1faa | [
"Apache-2.0"
] | 1 | 2019-12-23T08:47:57.000Z | 2019-12-23T08:47:57.000Z | train_evaluator/TFRecord_Slim_Reader.py | asanchez19/PupilTracking | 02977de83c9f1481b700a3bb0ac37f0f814b1faa | [
"Apache-2.0"
] | 4 | 2018-05-19T06:28:07.000Z | 2020-07-09T05:13:22.000Z | import tensorflow as tf
def PupilDataset(tf_record_filename="C:\\LPW\\train.tfrecords.AlexJ"):
filename_queue = tf.train.string_input_producer([tf_record_filename])
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue) # 返回文件名和文件
features = tf.parse_single_example(serialized... | 40.285714 | 88 | 0.556738 |
06781cc702222f07fcd4c0da5ff6b34e58db0e13 | 222 | py | Python | 8958.py | kwondohun0308/Beakjoon | 65e8c1015bcb3bb757d8056525034ee333ecb681 | [
"MIT"
] | null | null | null | 8958.py | kwondohun0308/Beakjoon | 65e8c1015bcb3bb757d8056525034ee333ecb681 | [
"MIT"
] | null | null | null | 8958.py | kwondohun0308/Beakjoon | 65e8c1015bcb3bb757d8056525034ee333ecb681 | [
"MIT"
] | null | null | null | a = int(input())
for i in range(a):
arr_1 = list(input())
S = 0
start = 1
for j in arr_1:
if j == 'O':
S += start
start += 1
else:
start = 1
print(S)
| 17.076923 | 25 | 0.387387 |
7aedc50ab9a71deb8d9da977f9a61d9c0d0bc5fa | 3,053 | py | Python | label_maker/images.py | cgoodier/label-maker | 4e8774ff2790234352a78de82b92d762697a65d2 | [
"MIT"
] | 1 | 2021-03-21T13:37:46.000Z | 2021-03-21T13:37:46.000Z | label_maker/images.py | cgoodier/label-maker | 4e8774ff2790234352a78de82b92d762697a65d2 | [
"MIT"
] | null | null | null | label_maker/images.py | cgoodier/label-maker | 4e8774ff2790234352a78de82b92d762697a65d2 | [
"MIT"
] | null | null | null | # pylint: disable=unused-argument
"""Generate an .npz file containing arrays for training machine learning algorithms"""
from os import makedirs, path as op
from urllib.parse import urlparse
from random import shuffle
import numpy as np
import requests
from label_maker.utils import url
def download_images(dest_fold... | 40.706667 | 108 | 0.679332 |
6b6e661db16eab9dd99920f02b65c97e1779f93d | 1,756 | py | Python | remove_chromosomes.py | djlduckett/Genome_Resources | 7d0e17c349606464f11a20ce3f04acdc57202cd6 | [
"MIT"
] | null | null | null | remove_chromosomes.py | djlduckett/Genome_Resources | 7d0e17c349606464f11a20ce3f04acdc57202cd6 | [
"MIT"
] | null | null | null | remove_chromosomes.py | djlduckett/Genome_Resources | 7d0e17c349606464f11a20ce3f04acdc57202cd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###Imports###
import numpy as np
import pandas as pd
import re
import sys
import collections
###Definitions###
vcf_file = sys.argv[1]
chr_file = sys.argv[2]
out_file = sys.argv[3]
###Functions###
def get_header_lines(vcf_file):
lines = []
comment = True
with open(vcf_file, 'r')... | 30.275862 | 114 | 0.678815 |
ea20464908936d45f2d7dffe01ba623153057a1c | 23,493 | py | Python | Chempy/input/yields/West17/fortranfile/writer.py | jan-rybizki/Chempy | 18260a0647b448a8a937384271c8a4de8702aefe | [
"MIT"
] | 25 | 2017-02-28T14:06:09.000Z | 2022-03-21T16:00:40.000Z | Chempy/input/yields/West17/fortranfile/writer.py | oliverphilcox/ChempyMulti | 1ab0d0c56a03c4f4b710ee8f0142bcccc7e84e22 | [
"MIT"
] | 15 | 2017-02-03T14:45:26.000Z | 2020-10-01T10:56:45.000Z | Chempy/input/yields/West17/fortranfile/writer.py | oliverphilcox/ChempyMulti | 1ab0d0c56a03c4f4b710ee8f0142bcccc7e84e22 | [
"MIT"
] | 14 | 2017-02-16T12:34:39.000Z | 2021-07-12T02:51:41.000Z | """
Classes for writing UNIX unformatted FORTRAN files.
"""
# TODO
# * for general reading, load needs to be able to specify record size?
# * fortranfile needs "backspace" and "truncate" functions.
import os
import sys
import gzip
import bz2
import lzma
import numpy as np
from .utils import prod
from .errors import... | 31.324 | 142 | 0.519644 |
69221d87120b1fc09cb17bd910838805bd4a8321 | 5,521 | py | Python | build/PureCloudPlatformClientV2/models/sms_config.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/sms_config.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/sms_config.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 30.169399 | 89 | 0.604238 |
bce1489f133afee12e58137c1434055371d5219d | 2,830 | py | Python | data_output.py | woctezuma/playing-with-simpleitk | a9ff669afdacdced53372ab0f13a21d71f1cf13c | [
"MIT"
] | 6 | 2019-11-25T17:58:53.000Z | 2022-02-17T19:32:30.000Z | data_output.py | woctezuma/playing-with-simpleitk | a9ff669afdacdced53372ab0f13a21d71f1cf13c | [
"MIT"
] | 1 | 2019-11-25T18:15:05.000Z | 2019-11-25T18:35:51.000Z | data_output.py | woctezuma/playing-with-simpleitk | a9ff669afdacdced53372ab0f13a21d71f1cf13c | [
"MIT"
] | 5 | 2020-09-15T07:04:20.000Z | 2022-01-23T23:42:50.000Z | from pathlib import Path
from utils import get_data_root, get_ground_truth_keyword
def get_image_modality_convention_dict():
# We index each modality used in our dataset.
modality_dict = dict()
# The first modality is indexed with 0, following convention in:
# https://github.com/MIC-DKFZ/nnUNet/t... | 26.698113 | 119 | 0.704947 |
a60912286ff6ab0ad5b417fe4e5ba725ef8001c3 | 2,220 | py | Python | mailchat/forms.py | MachineThing/Portfolio-SiteV2 | 5ffff652e0d19d49585cadb0df4521933df4d41c | [
"MIT"
] | 2 | 2021-05-29T04:52:50.000Z | 2021-07-04T15:40:27.000Z | mailchat/forms.py | MachineThing/Portfolio-SiteV2 | 5ffff652e0d19d49585cadb0df4521933df4d41c | [
"MIT"
] | 9 | 2021-02-13T20:19:53.000Z | 2021-07-04T15:43:57.000Z | mailchat/forms.py | MachineThing/Portfolio-SiteV2 | 5ffff652e0d19d49585cadb0df4521933df4d41c | [
"MIT"
] | null | null | null | from datetime import datetime
from django.forms import Form
from django.utils.crypto import get_random_string
from unidecode import unidecode
import country_list
from . import fields
from .models import Email
def return_countries():
countries = country_list.countries_for_language('EN')[:] # Copy the list to avoid ... | 37 | 151 | 0.683784 |
2d90d358b50d2ef42bddafb660be490607ecd4b9 | 8,489 | py | Python | test/functional/test_framework/key.py | kenfmcoin/kenfmcoin | 1fa48487593233f2066757dc54f48b2349e2d9db | [
"MIT"
] | null | null | null | test/functional/test_framework/key.py | kenfmcoin/kenfmcoin | 1fa48487593233f2066757dc54f48b2349e2d9db | [
"MIT"
] | null | null | null | test/functional/test_framework/key.py | kenfmcoin/kenfmcoin | 1fa48487593233f2066757dc54f48b2349e2d9db | [
"MIT"
] | null | null | null | # Copyright (c) 2011 Sam Rushing
"""ECC secp256k1 OpenSSL wrapper.
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
This file is modified from python-kenfmcoinlib.
"""
import ctypes
import ctypes.util
import hashlib
import sys
ssl = ctypes.cdll.LoadLibra... | 36.433476 | 130 | 0.687831 |
bcf0169a7e492b74a2257edeb14c0d14dfd9d64e | 3,902 | py | Python | benchmark/startCirq1454.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq1454.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq1454.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=5
# total number=51
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 38.254902 | 77 | 0.652486 |
6a3aa0f471befaf396ddcafeecdcee339c1d2cc1 | 17,766 | py | Python | gameState.py | LimIvan336/chessengine-with-pygame | 9ff10e90b101de1c2b4ab4f907e4de2138f824ce | [
"MIT"
] | 1 | 2021-06-05T08:12:55.000Z | 2021-06-05T08:12:55.000Z | gameState.py | LimIvan336/chessengine-with-pygame | 9ff10e90b101de1c2b4ab4f907e4de2138f824ce | [
"MIT"
] | null | null | null | gameState.py | LimIvan336/chessengine-with-pygame | 9ff10e90b101de1c2b4ab4f907e4de2138f824ce | [
"MIT"
] | null | null | null | #Store the state, info of the game
from castleRights import CastleRights
from move import Move
class GameState():
def __init__(self):
#initialize 8x8 chess board
#2 characters, bK - black King
#"--" represents empty slot
self.board = [
["bR", "bN", "bB", "bQ", "bK", "bB"... | 45.78866 | 172 | 0.565687 |
8d58c91dce978c78b0a4b3e99e226a010a9af887 | 17,885 | py | Python | web-crawl/runtime/lib/python3.4/site-packages/w3lib/url.py | yangsongx/refrence | 58376b97d0d1364b6a92dad89f5125a0d6e009e0 | [
"Apache-2.0"
] | 1 | 2017-01-14T15:20:35.000Z | 2017-01-14T15:20:35.000Z | web-crawl/runtime/lib/python3.4/site-packages/w3lib/url.py | yangsongx/refrence | 58376b97d0d1364b6a92dad89f5125a0d6e009e0 | [
"Apache-2.0"
] | 1 | 2017-01-07T17:41:51.000Z | 2017-05-18T08:38:42.000Z | env/lib/python3.6/site-packages/w3lib/url.py | Tokyo-Buffalo/tokyosouth | 0fcbff35b6bfc9944b5196a6b059e4549d989c06 | [
"MIT"
] | 1 | 2019-01-29T06:37:19.000Z | 2019-01-29T06:37:19.000Z | """
This module contains general purpose URL functions not found in the standard
library.
"""
import codecs
import os
import re
import posixpath
import warnings
import six
from six.moves.urllib.parse import (urljoin, urlsplit, urlunsplit,
urldefrag, urlencode, urlparse,
... | 36.64959 | 123 | 0.638021 |
351455c685e9df347bc008f90f3de6ffa135a7f2 | 879 | py | Python | leetcode/Array/1295. Find Numbers with Even Number of Digits.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | 23 | 2019-08-02T12:02:47.000Z | 2022-03-09T15:24:16.000Z | leetcode/Array/1295. Find Numbers with Even Number of Digits.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | null | null | null | leetcode/Array/1295. Find Numbers with Even Number of Digits.py | yanshengjia/algorithm | 0608d286be9c93d51768d47f21e569c6b0be9cda | [
"MIT"
] | 21 | 2019-12-22T04:47:32.000Z | 2021-09-12T14:29:35.000Z | """
Given an array nums of integers, return how many of them contain an even number of digits.
Example 1:
Input: nums = [12,345,2,6,7896]
Output: 2
Explanation:
12 contains 2 digits (even number of digits).
345 contains 3 digits (odd number of digits).
2 contains 1 digit (odd number of digits).
6 contains 1 dig... | 22.538462 | 90 | 0.658703 |
0b780f9f152851feae0669ba881ed655a84613cb | 4,321 | py | Python | src/pymortests/lyapunov.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | 1 | 2021-08-17T15:55:12.000Z | 2021-08-17T15:55:12.000Z | src/pymortests/lyapunov.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | src/pymortests/lyapunov.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import os
import sys
import numpy as np
import scipy.linalg as spla
import scipy.sparse as sps
f... | 29.394558 | 77 | 0.574173 |
e4b143f42b18f29a351105aa8b03bb297981d263 | 1,713 | py | Python | aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/CreateMediaComplexTaskRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/CreateMediaComplexTaskRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/CreateMediaComplexTaskRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"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 u... | 34.959184 | 81 | 0.770578 |
60ef205f9c63ddc8f0d28f12598018a4ba314e06 | 149 | py | Python | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 8/E2.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | 12 | 2018-11-14T03:55:58.000Z | 2021-12-12T01:13:05.000Z | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 8/E2.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | null | null | null | 1c. beginner_path_3_How to Think Like a Computer Scientist Learning with Python 3/thinkcs-python3-solutions/Chapter 8/E2.py | codeclubbentleigh/Python | 94d6a937aa3520b201ee1641c2009bd90566d52a | [
"MIT"
] | 7 | 2019-10-10T06:28:58.000Z | 2022-02-15T07:18:12.000Z | prefixes = "JKLMNOPQ"
suffix = "ack"
for letter in prefixes:
if letter == "O" or letter == "Q":
letter += "u"
print(letter + suffix)
| 21.285714 | 38 | 0.577181 |
c51d8f7220f815cc72f11a46c3434d010a43bda2 | 18,323 | py | Python | corehq/messaging/scheduling/models/content.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/messaging/scheduling/models/content.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/messaging/scheduling/models/content.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import jsonfield as old_jsonfield
from contextlib import contextmanager
from copy import deepcopy
from corehq.apps.accounting.utils import domain_is_on_trial
from corehq.apps.app_manager.exceptions impor... | 38.902335 | 114 | 0.670523 |
bc5468b8ba363da089641b887d9013deada34cf0 | 11,860 | py | Python | dashboard/dashboard/pinpoint/models/tasks/run_test.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | 1 | 2019-11-01T23:31:22.000Z | 2019-11-01T23:31:22.000Z | dashboard/dashboard/pinpoint/models/tasks/run_test.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/pinpoint/models/tasks/run_test.py | tingshao/catapult | a8fe19e0c492472a8ed5710be9077e24cc517c5c | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 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.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import collections
import itertools
import json... | 35.088757 | 80 | 0.613322 |
2ac0749ea25711444e959559fd4f00153e34a6dc | 558 | py | Python | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwShmtranslationsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 193 | 2016-08-02T22:04:35.000Z | 2022-03-09T20:45:41.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwShmtranslationsCom.py | fake-name/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 533 | 2016-08-23T20:48:23.000Z | 2022-03-28T15:55:13.000Z | WebMirror/management/rss_parser_funcs/feed_parse_extractWwwShmtranslationsCom.py | rrosajp/ReadableWebProxy | ed5c7abe38706acc2684a1e6cd80242a03c5f010 | [
"BSD-3-Clause"
] | 19 | 2015-08-13T18:01:08.000Z | 2021-07-12T17:13:09.000Z |
def extractWwwShmtranslationsCom(item):
'''
Parser for 'www.shmtranslations.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loite... | 25.363636 | 104 | 0.637993 |
02292634c3a5ac03df7b60f354e83c283f10049b | 4,782 | py | Python | tests/chia_log/handlers/test_harvester_activity_handler.py | kilbot/chiadog | 1a49192b8b2e9c50ebcca4d43d1a6427c3b00f62 | [
"MIT"
] | 1 | 2022-03-10T08:25:29.000Z | 2022-03-10T08:25:29.000Z | tests/chia_log/handlers/test_harvester_activity_handler.py | kilbot/chiadog | 1a49192b8b2e9c50ebcca4d43d1a6427c3b00f62 | [
"MIT"
] | null | null | null | tests/chia_log/handlers/test_harvester_activity_handler.py | kilbot/chiadog | 1a49192b8b2e9c50ebcca4d43d1a6427c3b00f62 | [
"MIT"
] | null | null | null | # std
import unittest
from pathlib import Path
# project
from src.chia_log.handlers import harvester_activity_handler
from src.notifier import EventType, EventService, EventPriority
class TestHarvesterActivityHandler(unittest.TestCase):
def setUp(self) -> None:
self.handler = harvester_activity_handler.H... | 52.549451 | 118 | 0.663112 |
80dd5d3e771c08a60c5a6b24893aee8f0f2451da | 776 | py | Python | sdk/confidentialledger/azure-confidentialledger/tests/test_confidential_ledger_client_certificate_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/confidentialledger/azure-confidentialledger/tests/test_confidential_ledger_client_certificate_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/confidentialledger/azure-confidentialledger/tests/test_confidential_ledger_client_certificate_async.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | from azure.confidentialledger import (
ConfidentialLedgerCertificateCredential,
)
from azure.confidentialledger.aio import ConfidentialLedgerClient
from _shared.client_test_common_async import AsyncConfidentialLedgerClientTestMixin
class AsyncCertificateCredentialClientTest(
AsyncConfidentialLedgerClientTest... | 35.272727 | 83 | 0.762887 |
80d04b9c406680653cb8dc2bf70658a08daecf89 | 750 | py | Python | Engineering/Software Engineering/Code/Raspberry Pi/model-airport/test/python/ModelAirportDevicesTest.py | DarshanShet777/Model-Airport | 873411d8c5017d996622f932c3a39c1b4d7ee340 | [
"BSD-3-Clause"
] | 1 | 2019-04-25T21:24:39.000Z | 2019-04-25T21:24:39.000Z | Engineering/Software Engineering/Code/Raspberry Pi/model-airport/test/python/ModelAirportDevicesTest.py | DarshanShet777/Model-Airport | 873411d8c5017d996622f932c3a39c1b4d7ee340 | [
"BSD-3-Clause"
] | 49 | 2019-04-25T21:03:59.000Z | 2021-04-19T03:21:00.000Z | Engineering/Software Engineering/Code/Raspberry Pi/model-airport/test/python/ModelAirportDevicesTest.py | DarshanShet777/Model-Airport | 873411d8c5017d996622f932c3a39c1b4d7ee340 | [
"BSD-3-Clause"
] | null | null | null | from time import sleep
from ModelAirportGPIO import ModelAirportGPIO
print("[ModelAirportDevicesTest] Setting up GPIO...")
gpio = ModelAirportGPIO()
print("[ModelAirportDevicesTest] Testing all devices...")
gpio.setDeviceState("Pavement-Lighting", True)
gpio.setDeviceState("Backstage-Entrance", True)
gpio.setDeviceS... | 30 | 57 | 0.797333 |
6f31712a2faaabb4fc6e75b081a9e4d131ea61de | 400 | py | Python | flask_admin_markdown/ckeditor/fields.py | suckmybigdick/flask-admin-markdown | 2711a95118efb5fcb4c82edda3565fb4b9561adb | [
"MIT"
] | null | null | null | flask_admin_markdown/ckeditor/fields.py | suckmybigdick/flask-admin-markdown | 2711a95118efb5fcb4c82edda3565fb4b9561adb | [
"MIT"
] | null | null | null | flask_admin_markdown/ckeditor/fields.py | suckmybigdick/flask-admin-markdown | 2711a95118efb5fcb4c82edda3565fb4b9561adb | [
"MIT"
] | null | null | null | #coding:utf8
from wtforms import TextAreaField
from wtforms.widgets import TextArea
class CKTextAreaWidget(TextArea):
def __call__(self, field, **kwargs):
if kwargs.get('class'):
kwargs['class'] += ' ckeditor'
else:
kwargs.setdefault('class', 'ckeditor')
return super(CKTextAreaWidget, self).__call__(field,... | 26.666667 | 64 | 0.75 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.