hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
117402d75f81fcb6c84866b477ee03e3acc57282 | 2,385 | py | Python | pypika/tests/test_parameter.py | trust-kaz/pypika | 78ce885ca445e63bb6168d4456dd11072c60e63b | [
"Apache-2.0"
] | null | null | null | pypika/tests/test_parameter.py | trust-kaz/pypika | 78ce885ca445e63bb6168d4456dd11072c60e63b | [
"Apache-2.0"
] | null | null | null | pypika/tests/test_parameter.py | trust-kaz/pypika | 78ce885ca445e63bb6168d4456dd11072c60e63b | [
"Apache-2.0"
] | null | null | null | import unittest
from pypika import Tables, Query, Parameter
class ParametrizedTests(unittest.TestCase):
table_abc, table_efg = Tables("abc", "efg")
def test_param_insert(self):
q = (
Query.into(self.table_abc)
.columns("a", "b", "c")
.insert(Parameter("?"), Parame... | 32.22973 | 130 | 0.502725 |
cc3289066081e4e8ce5afe8f3c4a02b7cd1d5799 | 1,203 | py | Python | iwatlas/stats.py | Yadidya5/iwatlas | 7cf2a8778b9ebefe564f93efe013d6d3743c94ec | [
"BSD-2-Clause"
] | 7 | 2019-12-24T08:24:46.000Z | 2022-01-30T07:06:47.000Z | iwatlas/stats.py | Yadidya5/iwatlas | 7cf2a8778b9ebefe564f93efe013d6d3743c94ec | [
"BSD-2-Clause"
] | 2 | 2020-10-12T05:40:24.000Z | 2022-01-30T07:25:27.000Z | iwatlas/stats.py | Yadidya5/iwatlas | 7cf2a8778b9ebefe564f93efe013d6d3743c94ec | [
"BSD-2-Clause"
] | 2 | 2021-05-31T10:20:27.000Z | 2022-01-30T07:06:52.000Z | """
Statistical metrics used for harmonic analysis
"""
import numpy as np
def harmonic_indices(ntide, na):
"""
Return the indices for each central (tidal) frequency
"""
ii=[]
for ff in range(ntide):
ii.append((ff+1)*(2*na+1)-na-1) # Index of the fixed harmonics
return ii
def TVFH... | 26.152174 | 86 | 0.61596 |
0b32273ceb96bd7671d0c62d65620cdcf39287d4 | 9,017 | py | Python | slack_sdk/models/views/__init__.py | ggml1/python-slack-sdk | 1fddbffecb55abf4841ed03b1c59f8879148be9f | [
"MIT"
] | 2 | 2021-09-11T06:18:24.000Z | 2021-10-30T14:00:48.000Z | slack_sdk/models/views/__init__.py | ggml1/python-slack-sdk | 1fddbffecb55abf4841ed03b1c59f8879148be9f | [
"MIT"
] | 1 | 2021-09-12T23:26:37.000Z | 2021-09-12T23:26:37.000Z | slack_sdk/models/views/__init__.py | ggml1/python-slack-sdk | 1fddbffecb55abf4841ed03b1c59f8879148be9f | [
"MIT"
] | 1 | 2021-09-11T06:18:21.000Z | 2021-09-11T06:18:21.000Z | import copy
import logging
from typing import Optional, Union, Dict, Sequence
from slack_sdk.models.basic_objects import JsonObject, JsonValidator
from slack_sdk.models.blocks import Block, TextObject, PlainTextObject, Option
class View(JsonObject):
"""View object for modals and Home tabs.
https://api.slack... | 36.506073 | 99 | 0.608185 |
ae2f7b29ad18644c17925105f2d3a28858e79538 | 150 | py | Python | tests/test_ec2/test_windows.py | jonnangle/moto-1 | 40b4e299abb732aad7f56cc0f680c0a272a46594 | [
"Apache-2.0"
] | 1 | 2021-12-12T04:23:06.000Z | 2021-12-12T04:23:06.000Z | tests/test_ec2/test_windows.py | jonnangle/moto-1 | 40b4e299abb732aad7f56cc0f680c0a272a46594 | [
"Apache-2.0"
] | 17 | 2020-08-28T12:53:56.000Z | 2020-11-10T01:04:46.000Z | tests/test_ec2/test_windows.py | jonnangle/moto-1 | 40b4e299abb732aad7f56cc0f680c0a272a46594 | [
"Apache-2.0"
] | 2 | 2021-11-24T08:05:43.000Z | 2021-11-25T16:18:48.000Z | from __future__ import unicode_literals
import boto
import sure # noqa
from moto import mock_ec2
@mock_ec2
def test_windows():
pass
| 13.636364 | 40 | 0.726667 |
36c71b9c631c839ac1b2add810fe622147587cda | 2,764 | py | Python | discortbot.py | misc4747/discord_voiceroid_tts | 47e36c634511ebcb4c0b9c1007c10b224e4ac8dd | [
"MIT"
] | null | null | null | discortbot.py | misc4747/discord_voiceroid_tts | 47e36c634511ebcb4c0b9c1007c10b224e4ac8dd | [
"MIT"
] | null | null | null | discortbot.py | misc4747/discord_voiceroid_tts | 47e36c634511ebcb4c0b9c1007c10b224e4ac8dd | [
"MIT"
] | null | null | null | import discord
import text2wav
import ffmpeg
import time
import re
TOKEN = "TOKEN" #Replace TOKEN with your discord bot token
client = discord.Client()
queue = []
def play_voice(path):
print(queue)
if not voice.is_playing():
voice.play(discord.FFmpegPCMAudio(path),after=after_playing)
def aft... | 29.72043 | 92 | 0.601664 |
273e6d2091491d6ee3cdbb93daa919838a91b081 | 2,860 | py | Python | ed2d/assets/objloader.py | explosiveduck/cubix | 16e7a298a83fe53174bda8ec77dfcf6869ed5336 | [
"BSD-2-Clause"
] | 1 | 2015-11-02T02:11:18.000Z | 2015-11-02T02:11:18.000Z | ed2d/assets/objloader.py | explosiveduck/cubix | 16e7a298a83fe53174bda8ec77dfcf6869ed5336 | [
"BSD-2-Clause"
] | 29 | 2015-06-09T19:27:49.000Z | 2016-03-08T06:13:24.000Z | ed2d/assets/objloader.py | explosiveduck/cubix | 16e7a298a83fe53174bda8ec77dfcf6869ed5336 | [
"BSD-2-Clause"
] | null | null | null | from ed2d.assets.mtlloader import MTL
from ed2d import files
class OBJ(object):
def __init__(self, fileName):
''' Wavefront .obj file parser.'''
objPath = files.resolve_path('data', 'models', fileName + '.obj')
self.fmvnig = {}
# Shared temporary storage of data
self.tempV... | 31.777778 | 85 | 0.474825 |
a7a40cc0041cd1b331718fe37a0eefbdf93bb5f8 | 2,456 | py | Python | relaton_bib/relaton_bib.py | relaton/relaton-bib-py | 03b601d9a5482e6142b90d6b6cca5a05879452c8 | [
"BSD-3-Clause"
] | null | null | null | relaton_bib/relaton_bib.py | relaton/relaton-bib-py | 03b601d9a5482e6142b90d6b6cca5a05879452c8 | [
"BSD-3-Clause"
] | 7 | 2021-08-18T04:02:25.000Z | 2022-01-28T19:22:42.000Z | relaton_bib/relaton_bib.py | relaton/relaton-bib-py | 03b601d9a5482e6142b90d6b6cca5a05879452c8 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import dataclasses
import re
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .localized_string import LocalizedString
class RequestError(Exception):
pass
def parse_date(date, str_res=True):
"""Convert date from string to date or string
"""
if date is datetime.datetime:... | 26.695652 | 78 | 0.550896 |
2f24c915dec53177cc1f35562ee2901f6df5ee43 | 327 | py | Python | traccar_graphql/types.py | sunhoww/traccar_graphql | e63868f9b6c6d15cec4d184b2609991824554534 | [
"MIT"
] | 1 | 2020-11-13T22:15:54.000Z | 2020-11-13T22:15:54.000Z | traccar_graphql/types.py | sunhoww/traccar_graphql | e63868f9b6c6d15cec4d184b2609991824554534 | [
"MIT"
] | null | null | null | traccar_graphql/types.py | sunhoww/traccar_graphql | e63868f9b6c6d15cec4d184b2609991824554534 | [
"MIT"
] | 1 | 2021-01-14T01:26:16.000Z | 2021-01-14T01:26:16.000Z | import datetime, iso8601
from graphene.types import datetime
from graphql.language import ast
class DateTime(datetime.DateTime):
'''Graphene DateTime overide'''
@staticmethod
def serialize(dt):
if isinstance(dt, str):
dt = iso8601.parse_date(dt)
return datetime.DateTime.seriali... | 25.153846 | 46 | 0.700306 |
2cdcc879bc0b91f5bce84366d5aee46328b276f9 | 823 | py | Python | config.py | kenmutuma001/Blog | 6b19a77b71694bbe9f5e84207de46c68f87ebc5e | [
"Unlicense"
] | null | null | null | config.py | kenmutuma001/Blog | 6b19a77b71694bbe9f5e84207de46c68f87ebc5e | [
"Unlicense"
] | null | null | null | config.py | kenmutuma001/Blog | 6b19a77b71694bbe9f5e84207de46c68f87ebc5e | [
"Unlicense"
] | null | null | null | import os
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
BASE_URL = 'http://quotes.stormconsultancy.co.uk/{}.json'
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://ken:kennedy@localhost/blogs'
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USERN... | 21.102564 | 81 | 0.73633 |
9c9e852a964bd2e99b05029fd27b42f86d62f022 | 1,950 | py | Python | SciComputing with Python/TextAnalyzer/_backupTextAnalyzer.py | evtodorov/aerospace | 54a1b58c3c0b02c0eaa3aef14d0e732d7f867566 | [
"MIT"
] | null | null | null | SciComputing with Python/TextAnalyzer/_backupTextAnalyzer.py | evtodorov/aerospace | 54a1b58c3c0b02c0eaa3aef14d0e732d7f867566 | [
"MIT"
] | null | null | null | SciComputing with Python/TextAnalyzer/_backupTextAnalyzer.py | evtodorov/aerospace | 54a1b58c3c0b02c0eaa3aef14d0e732d7f867566 | [
"MIT"
] | null | null | null | '''
Assigment 2: Text analyzer
finding the fingerprint of different languages
29.4.2014
@author: etodorov
'''
#get the name of the tested file
fileName = "english.txt"#raw_input("Give file name (with the extenision)")
#clear the name of the tested file
fileName = fileName.lstrip().rstrip()
#open the file
fTested = op... | 28.676471 | 102 | 0.702051 |
2f0cbfdbe852d180e98559654fb955a8b9f26ca9 | 29,411 | py | Python | Lib/asyncio/streams.py | hdaugherty/cpython | 27ee0f8551a6d576a65e20da90acf9f3cb412c35 | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-05-22T08:19:52.000Z | 2019-05-22T08:19:52.000Z | Lib/asyncio/streams.py | hdaugherty/cpython | 27ee0f8551a6d576a65e20da90acf9f3cb412c35 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/asyncio/streams.py | hdaugherty/cpython | 27ee0f8551a6d576a65e20da90acf9f3cb412c35 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | __all__ = (
'StreamReader', 'StreamWriter', 'StreamReaderProtocol',
'open_connection', 'start_server')
import socket
import sys
import warnings
import weakref
if hasattr(socket, 'AF_UNIX'):
__all__ += ('open_unix_connection', 'start_unix_server')
from . import coroutines
from . import events
from . impor... | 36.535404 | 86 | 0.603142 |
9fa2ee67adbd10b5cd897ec5cf9693a427f3d9be | 9,170 | py | Python | programs/buck.py | fkorotkov/buck | 4d63790ceda1028281600af9cf75153ccb92a5f5 | [
"Apache-2.0"
] | 1 | 2018-09-12T14:58:13.000Z | 2018-09-12T14:58:13.000Z | programs/buck.py | fkorotkov/buck | 4d63790ceda1028281600af9cf75153ccb92a5f5 | [
"Apache-2.0"
] | null | null | null | programs/buck.py | fkorotkov/buck | 4d63790ceda1028281600af9cf75153ccb92a5f5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import errno
import logging
import os
import re
import signal
import subprocess
import sys
import threading
import time
import uuid
import zipfile
from multiprocessing import Queue
from subprocess import check_output
from buck_logging import setup_logging
f... | 34.734848 | 97 | 0.667612 |
d05aea8549ebff2cddd7ceffcfaecbf9d7779138 | 306 | py | Python | scibeam/util/__init__.py | SuperYuLu/SciBeam | 80601adda9288fd32efeedf5b1de015761c1f8e5 | [
"MIT"
] | 3 | 2020-07-31T09:24:46.000Z | 2021-03-01T23:59:51.000Z | scibeam/util/__init__.py | SuperYuLu/SciBeam | 80601adda9288fd32efeedf5b1de015761c1f8e5 | [
"MIT"
] | 12 | 2018-05-14T18:40:14.000Z | 2019-02-06T22:51:33.000Z | scibeam/util/__init__.py | SuperYuLu/SciBeam | 80601adda9288fd32efeedf5b1de015761c1f8e5 | [
"MIT"
] | null | null | null | # __init__.py ---
#
# Filename: __init__.py
# Description:
#
# Author: Yu Lu
# Email: yulu@utexas.edu
# Github: https://github.com/SuperYuLu
#
# Created: Wed Aug 22 11:14:07 2018 (-0500)
# Version:
# Last-Updated: Wed Aug 22 11:14:07 2018 (-0500)
# By: yulu
# Update #: 1
#
| 19.125 | 48 | 0.581699 |
92c794c16260edc09e099f5997de409a7c65733d | 122 | py | Python | tests/test_tsv.py | roedoejet/convertextract | bf194a7d81d847d68690ea0d58dc47a70259cd78 | [
"MIT"
] | 12 | 2016-10-20T16:17:04.000Z | 2022-03-10T06:36:59.000Z | tests/test_tsv.py | roedoejet/convertextract | bf194a7d81d847d68690ea0d58dc47a70259cd78 | [
"MIT"
] | 3 | 2018-01-12T00:41:26.000Z | 2020-08-12T05:04:45.000Z | tests/test_tsv.py | roedoejet/convertextract | bf194a7d81d847d68690ea0d58dc47a70259cd78 | [
"MIT"
] | 3 | 2020-08-18T21:47:03.000Z | 2022-02-03T06:32:46.000Z | import unittest
from . import base
class TsvTestCase(base.BaseParserTestCase, unittest.TestCase):
extension = 'tsv' | 17.428571 | 62 | 0.770492 |
24f4371799c5a982e103f53f208aa0dcaa95100f | 61,737 | py | Python | pyNastran/bdf/subcase.py | JohannesSeidel/pyNastran | 91ccd2756b201a7a3e4bb81cc6dc53b947d43bbf | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/subcase.py | JohannesSeidel/pyNastran | 91ccd2756b201a7a3e4bb81cc6dc53b947d43bbf | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/subcase.py | JohannesSeidel/pyNastran | 91ccd2756b201a7a3e4bb81cc6dc53b947d43bbf | [
"BSD-3-Clause"
] | null | null | null | """Subcase creation/extraction class"""
from typing import List, Dict, Any
from numpy import ndarray
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.utils import object_attributes, deprecated
from pyNastran.bdf.bdf_interface.case_control_cards import CLASS_MAP
from pyNastran.bdf.bdf_interface.sub... | 36.94614 | 100 | 0.525196 |
e4255d246e3df3bade5c59f558e13be33c14e4bb | 11,331 | py | Python | alg/knockoffgan/KnockoffGAN.py | loramf/mlforhealthlabpub | aa5a42a4814cf69c8223f27c21324ee39d43c404 | [
"BSD-3-Clause"
] | 171 | 2021-02-12T10:23:19.000Z | 2022-03-29T01:58:52.000Z | alg/knockoffgan/KnockoffGAN.py | loramf/mlforhealthlabpub | aa5a42a4814cf69c8223f27c21324ee39d43c404 | [
"BSD-3-Clause"
] | 4 | 2021-06-01T08:18:33.000Z | 2022-02-20T13:37:30.000Z | alg/knockoffgan/KnockoffGAN.py | loramf/mlforhealthlabpub | aa5a42a4814cf69c8223f27c21324ee39d43c404 | [
"BSD-3-Clause"
] | 93 | 2021-02-10T03:21:59.000Z | 2022-03-30T19:10:37.000Z | '''
KnockoffGAN Knockoff Variable Generation
Jinsung Yoon (9/27/2018)
'''
#%% Necessary Packages
import numpy as np
from tqdm import tqdm
import tensorflow as tf
import logging
import argparse
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
#%% KnockoffGAN Function
'''
Inputs:
x_train: Training dat... | 31.650838 | 164 | 0.572235 |
ef7439605e68e2f5c25018566b3aa97b93fc13dc | 667 | py | Python | test/conftest.py | caedonhsieh/ps-munna | bb0194ef3c3efb5ecce5f16913ffb8d882953bb8 | [
"MIT"
] | null | null | null | test/conftest.py | caedonhsieh/ps-munna | bb0194ef3c3efb5ecce5f16913ffb8d882953bb8 | [
"MIT"
] | null | null | null | test/conftest.py | caedonhsieh/ps-munna | bb0194ef3c3efb5ecce5f16913ffb8d882953bb8 | [
"MIT"
] | null | null | null | from pathlib import Path
import pytest
import munna
TEST_ASSETS_DIR = Path(__file__).parent / 'assets'
###############################################################################
# Pytest fixtures
###############################################################################
@pytest.fixture(scope='session'... | 20.84375 | 79 | 0.527736 |
a17b27a3f74bc47c3f3e83ff56ba2804353640b9 | 1,768 | py | Python | launch/razor-pub.launch.py | davidcutting/ros2_razor_imu | 8cac06e2dc38766bef5827faa4386016497054b9 | [
"BSD-3-Clause"
] | null | null | null | launch/razor-pub.launch.py | davidcutting/ros2_razor_imu | 8cac06e2dc38766bef5827faa4386016497054b9 | [
"BSD-3-Clause"
] | null | null | null | launch/razor-pub.launch.py | davidcutting/ros2_razor_imu | 8cac06e2dc38766bef5827faa4386016497054b9 | [
"BSD-3-Clause"
] | null | null | null | # MIT License
#
# Copyright (c) 2022 David Cutting
#
# 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
# to use, copy, modify, merge... | 35.36 | 101 | 0.760747 |
89f415407fb00e95453497e5eb6059830a72fa62 | 270 | py | Python | services/dsrp-api/app/commands.py | bcgov/dormant-site-reclamation-program | 4710434174a204a292a3128d92c8daf1de2a65a6 | [
"Apache-2.0"
] | null | null | null | services/dsrp-api/app/commands.py | bcgov/dormant-site-reclamation-program | 4710434174a204a292a3128d92c8daf1de2a65a6 | [
"Apache-2.0"
] | 9 | 2020-05-06T23:29:43.000Z | 2022-03-14T22:58:17.000Z | services/dsrp-api/app/commands.py | bcgov/dormant-site-reclamation-program | 4710434174a204a292a3128d92c8daf1de2a65a6 | [
"Apache-2.0"
] | 3 | 2020-05-08T16:54:22.000Z | 2021-01-27T17:28:49.000Z | import click
import psycopg2
from sqlalchemy.exc import DBAPIError
from multiprocessing.dummy import Pool as ThreadPool
from flask import current_app
from app.api.utils.include.user_info import User
from app.extensions import db
def register_commands(app):
return | 22.5 | 52 | 0.833333 |
fdac52c9760ad21d04251e24b15f9158eebe39ff | 8,648 | py | Python | partition/partition.py | davijo/superpoint_graph | 0d60fb364bfa37fb70570784899ce46c0296ee22 | [
"MIT"
] | null | null | null | partition/partition.py | davijo/superpoint_graph | 0d60fb364bfa37fb70570784899ce46c0296ee22 | [
"MIT"
] | null | null | null | partition/partition.py | davijo/superpoint_graph | 0d60fb364bfa37fb70570784899ce46c0296ee22 | [
"MIT"
] | null | null | null | """
Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs
http://arxiv.org/abs/1711.09869
2017 Loic Landrieu, Martin Simonovsky
Script for partioning into simples shapes
"""
import os.path
import sys
import numpy as np
import argparse
from timeit import default_timer as timer
sys.path.app... | 47.516484 | 155 | 0.595398 |
48b524320e2ef1725410b778fe797be924543b0a | 2,894 | py | Python | tutorials/slac/arguments.py | namjiwon1023/Code_With_RL | 37beec975b1685e9f6cf991abed491b854b78173 | [
"MIT"
] | 3 | 2021-08-12T15:11:28.000Z | 2021-09-27T16:04:16.000Z | tutorials/slac/arguments.py | namjiwon1023/Code_With_RL | 37beec975b1685e9f6cf991abed491b854b78173 | [
"MIT"
] | null | null | null | tutorials/slac/arguments.py | namjiwon1023/Code_With_RL | 37beec975b1685e9f6cf991abed491b854b78173 | [
"MIT"
] | 1 | 2021-08-05T07:20:57.000Z | 2021-08-05T07:20:57.000Z | # Copyright (c) 2021: Zhiyuan Nan (namjw@hanyang.ac.kr).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
import argparse
import torch as T
device = T.device('cuda:0' if T.cuda.is_available() else 'cpu')
def get_args():
parser = argparse.Argum... | 59.061224 | 134 | 0.719765 |
aa0089979f3f2cde30d2c49864fc4a4d11839fcb | 5,706 | py | Python | data/p3BR/R2/benchmark/startQiskit_noisy127.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_noisy127.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_noisy127.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=21
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.564767 | 140 | 0.629863 |
2573314f155cf68ff486218538dc621f5f9b0063 | 9,570 | py | Python | pandas/tests/io/parser/test_encoding.py | loicdiridollou/pandas-loic | 2f203d11ef1dba251b6cd3df89d073bf5b970e68 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 28,899 | 2016-10-13T03:32:12.000Z | 2022-03-31T21:39:05.000Z | pandas/tests/io/parser/test_encoding.py | soumyas567/pandas | ccb36cc8f1eeed53dea321ee7381602a6957de54 | [
"BSD-3-Clause"
] | 31,004 | 2016-10-12T23:22:27.000Z | 2022-03-31T23:17:38.000Z | pandas/tests/io/parser/test_encoding.py | soumyas567/pandas | ccb36cc8f1eeed53dea321ee7381602a6957de54 | [
"BSD-3-Clause"
] | 15,149 | 2016-10-13T03:21:31.000Z | 2022-03-31T18:46:47.000Z | """
Tests encoding functionality during parsing
for all of the parsers defined in parsers.py
"""
from io import BytesIO
import os
import tempfile
import numpy as np
import pytest
from pandas import (
DataFrame,
read_csv,
)
import pandas._testing as tm
skip_pyarrow = pytest.mark.usefixtures("pyarrow_skip")
... | 30.28481 | 88 | 0.647858 |
0bbb8af27c41a58d0437d4532bfd95fc1fd7c8d0 | 478 | py | Python | NEMbox/osx/test.py | qinyongliang/musicbox | 5e1bbd2a4b35b4c3fb8d975c5e5a375bfa2931fb | [
"MIT"
] | 1 | 2019-10-24T10:25:57.000Z | 2019-10-24T10:25:57.000Z | NEMbox/osx/test.py | qinyongliang/musicbox | 5e1bbd2a4b35b4c3fb8d975c5e5a375bfa2931fb | [
"MIT"
] | null | null | null | NEMbox/osx/test.py | qinyongliang/musicbox | 5e1bbd2a4b35b4c3fb8d975c5e5a375bfa2931fb | [
"MIT"
] | null | null | null | import ctypes
def play():
print("play from python")
def nextSong():
print("next song from python")
def lastSong():
print("last song from python")
if __name__ == "__main__":
lib = ctypes.cdll.LoadLibrary("NEMbox/osx/HotKey.lib")
playControll = ctypes.CFUNCTYPE(None)(play)
nextControll = ctypes... | 28.117647 | 63 | 0.713389 |
1a9e73f390822455b8e39b61472cff8d38fe90f3 | 5,684 | py | Python | tryout-cnns/venv/TrainerAgent.py | thatmariia/math-modeling-13 | 31ab5ffb28d8025191b781c7001ac3a20895bb0d | [
"MIT"
] | null | null | null | tryout-cnns/venv/TrainerAgent.py | thatmariia/math-modeling-13 | 31ab5ffb28d8025191b781c7001ac3a20895bb0d | [
"MIT"
] | null | null | null | tryout-cnns/venv/TrainerAgent.py | thatmariia/math-modeling-13 | 31ab5ffb28d8025191b781c7001ac3a20895bb0d | [
"MIT"
] | null | null | null | from Constants import *
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
from keras.utils.np_utils import to_categorical
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
import itertools
from keras.utils.np_utils import to_c... | 36.670968 | 121 | 0.611717 |
50fce3fd5649dc8401922bb02946f118875f0804 | 903 | py | Python | avaliacoes/migrations/0001_initial.py | pjelelhml/pontosTuristicosAPI | 90cb9fee71ea8858ca225789fa73d5f659618413 | [
"MIT"
] | null | null | null | avaliacoes/migrations/0001_initial.py | pjelelhml/pontosTuristicosAPI | 90cb9fee71ea8858ca225789fa73d5f659618413 | [
"MIT"
] | null | null | null | avaliacoes/migrations/0001_initial.py | pjelelhml/pontosTuristicosAPI | 90cb9fee71ea8858ca225789fa73d5f659618413 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-13 19:46
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),
]
ope... | 32.25 | 118 | 0.635659 |
9700985ba4ef4f99be03fdf6053c064f9d772829 | 3,948 | py | Python | tests/test_sink.py | thenetcircle/event-bus-3 | 96216210c892d90a957540da9a2bc5712bd40752 | [
"Apache-2.0"
] | null | null | null | tests/test_sink.py | thenetcircle/event-bus-3 | 96216210c892d90a957540da9a2bc5712bd40752 | [
"Apache-2.0"
] | null | null | null | tests/test_sink.py | thenetcircle/event-bus-3 | 96216210c892d90a957540da9a2bc5712bd40752 | [
"Apache-2.0"
] | null | null | null | import asyncio
import pytest
from aiohttp import web
from loguru import logger
from utils import create_kafka_event_from_dict
from eventbus.config import (
ConsumerConfig,
HttpSinkConfig,
HttpSinkMethod,
UseProducersConfig,
)
from eventbus.event import EventProcessStatus
from eventbus.sink import Http... | 34.631579 | 84 | 0.606636 |
4744e365ba79102ee4637e23367c4d3ecaa6f189 | 432 | py | Python | 1201-1300/1228-Poor Pigs/1228-Poor Pigs.py | jiadaizhao/LintCode | a8aecc65c47a944e9debad1971a7bc6b8776e48b | [
"MIT"
] | 77 | 2017-12-30T13:33:37.000Z | 2022-01-16T23:47:08.000Z | 1201-1300/1228-Poor Pigs/1228-Poor Pigs.py | jxhangithub/LintCode-1 | a8aecc65c47a944e9debad1971a7bc6b8776e48b | [
"MIT"
] | 1 | 2018-05-14T14:15:40.000Z | 2018-05-14T14:15:40.000Z | 1201-1300/1228-Poor Pigs/1228-Poor Pigs.py | jxhangithub/LintCode-1 | a8aecc65c47a944e9debad1971a7bc6b8776e48b | [
"MIT"
] | 39 | 2017-12-07T14:36:25.000Z | 2022-03-10T23:05:37.000Z | import math
class Solution:
"""
@param buckets: an integer
@param minutesToDie: an integer
@param minutesToTest: an integer
@return: how many pigs you need to figure out the "poison" bucket within p minutes
"""
def poorPigs(self, buckets, minutesToDie, minutesToTest):
# Write your c... | 33.230769 | 87 | 0.673611 |
669494175fd905b266109854b516f00f38e18820 | 724 | py | Python | symlinks_cameras.py | GuillaumeRochette/PanopticProcessing | 6dd9bd902b2c9ede6fa3f83b6d17b826705d56f8 | [
"Apache-2.0"
] | 2 | 2022-03-16T07:06:08.000Z | 2022-03-20T09:08:09.000Z | symlinks_cameras.py | GuillaumeRochette/PanopticProcessing | 6dd9bd902b2c9ede6fa3f83b6d17b826705d56f8 | [
"Apache-2.0"
] | 1 | 2022-03-16T07:05:40.000Z | 2022-03-16T11:06:56.000Z | symlinks_cameras.py | GuillaumeRochette/PanopticProcessing | 6dd9bd902b2c9ede6fa3f83b6d17b826705d56f8 | [
"Apache-2.0"
] | null | null | null | import argparse
from pathlib import Path
from metadata import SEQUENCES, SUBSEQUENCES
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--root", type=Path, required=True)
args = parser.parse_args()
root = args.root
for sequence, subsequences in zip(SEQUENCES, SUBSEQUENCES):
... | 27.846154 | 84 | 0.645028 |
d2b21f591170d36e86d046c5c4bb5e1d6e3558b6 | 348 | py | Python | migrations/0011_remove_question_edit_para_chains.py | tkhjp/editor_tkh | fcf8fc4ba3d058b5d0de878ec72a07c56a5c7377 | [
"MIT"
] | null | null | null | migrations/0011_remove_question_edit_para_chains.py | tkhjp/editor_tkh | fcf8fc4ba3d058b5d0de878ec72a07c56a5c7377 | [
"MIT"
] | null | null | null | migrations/0011_remove_question_edit_para_chains.py | tkhjp/editor_tkh | fcf8fc4ba3d058b5d0de878ec72a07c56a5c7377 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-20 10:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('editor', '0010_remove_hypothesis_para_list'),
]
operations = [
migrations.RemoveField(
model_name='question_edit',
name='par... | 19.333333 | 55 | 0.614943 |
7a5b4694fc39b7001e34d1734cbce28acd84f8bf | 2,311 | py | Python | src/command_modules/azure-cli-appservice/setup.py | wurp/azure-cli | a1f2f2b666a759eb2f593dd7796db6bbd0237614 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-appservice/setup.py | wurp/azure-cli | a1f2f2b666a759eb2f593dd7796db6bbd0237614 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-appservice/setup.py | wurp/azure-cli | a1f2f2b666a759eb2f593dd7796db6bbd0237614 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 31.657534 | 94 | 0.603635 |
db21ccc5b2b44efe4cb7416c5dc9e8e0b98c3bd7 | 8,661 | py | Python | cosmogrb/universe/survey.py | grburgess/cosmogrb | 55182f2223a329f598bcbc43448f3b0ae9f45448 | [
"BSD-2-Clause"
] | 3 | 2020-03-08T18:20:32.000Z | 2022-03-10T17:27:26.000Z | cosmogrb/universe/survey.py | grburgess/cosmogrb | 55182f2223a329f598bcbc43448f3b0ae9f45448 | [
"BSD-2-Clause"
] | 11 | 2020-03-04T17:21:15.000Z | 2020-06-09T12:20:00.000Z | cosmogrb/universe/survey.py | grburgess/cosmogrb | 55182f2223a329f598bcbc43448f3b0ae9f45448 | [
"BSD-2-Clause"
] | 5 | 2020-03-18T18:05:05.000Z | 2022-03-21T16:06:38.000Z | import collections
from typing import Any, Dict, List, Optional
import h5py
import numpy as np
import pandas as pd
import popsynth
from IPython.display import display
from natsort import natsorted
from cosmogrb.grb.grb_detector import GRBDetector
from cosmogrb.io.detector_save import DetectorSave
from cosmogrb.io.grb... | 26.486239 | 87 | 0.603972 |
4663e494f00a884a99078313afdf18e2e62427fd | 1,171 | py | Python | cnn_model.py | amanrOnly/CalorieDetectionModel | 831c2cd91a8fa901b56bf9b034de3e8cbaef2916 | [
"Unlicense"
] | null | null | null | cnn_model.py | amanrOnly/CalorieDetectionModel | 831c2cd91a8fa901b56bf9b034de3e8cbaef2916 | [
"Unlicense"
] | null | null | null | cnn_model.py | amanrOnly/CalorieDetectionModel | 831c2cd91a8fa901b56bf9b034de3e8cbaef2916 | [
"Unlicense"
] | null | null | null | import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression
def get_model(IMG_SIZE,no_of_fruits,LR):
try:
tf.reset_default_graph()
except:
print("tensorflow")
convnet = input_data(shape=[... | 29.275 | 115 | 0.752348 |
7c3370e9e102f838e83d2fb1df98ecf5cf2a5d94 | 4,810 | py | Python | assets/spark_regression/spark_regression_data_manager.py | kerenleibovich/mlapp | 0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693 | [
"Apache-2.0"
] | 33 | 2021-02-26T10:41:09.000Z | 2021-11-07T12:35:32.000Z | assets/spark_regression/spark_regression_data_manager.py | kerenleibovich/mlapp | 0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693 | [
"Apache-2.0"
] | 17 | 2021-03-04T15:37:21.000Z | 2021-04-06T12:00:13.000Z | assets/spark_regression/spark_regression_data_manager.py | kerenleibovich/mlapp | 0b8dfaba7a7070ab68cb29ff61dd1c7dd8076693 | [
"Apache-2.0"
] | 9 | 2021-03-03T20:02:41.000Z | 2021-10-05T13:03:56.000Z | from mlapp.handlers.instance import spark_handler
from mlapp.managers import DataManager, pipeline
import pyspark.sql.functions as F
from pyspark.ml.feature import Bucketizer
class SparkRegressionDataManager(DataManager):
@pipeline
def load_train_data(self, *args):
return self._load_data()
@pipel... | 41.465517 | 114 | 0.621622 |
40fe6b60bde29c865d4aaf7cf05623e68282bcf5 | 2,601 | py | Python | metrics/psnr_ssim.py | changwoolee/gradient-rescaling-attention-model | 2f1d819e8cee03a9d06312e700a5c474bed48c70 | [
"Apache-2.0"
] | 6 | 2019-11-28T13:46:55.000Z | 2022-03-12T02:52:13.000Z | metrics/psnr_ssim.py | changwoolee/gradient-rescaling-attention-model | 2f1d819e8cee03a9d06312e700a5c474bed48c70 | [
"Apache-2.0"
] | null | null | null | metrics/psnr_ssim.py | changwoolee/gradient-rescaling-attention-model | 2f1d819e8cee03a9d06312e700a5c474bed48c70 | [
"Apache-2.0"
] | 1 | 2020-10-13T18:23:56.000Z | 2020-10-13T18:23:56.000Z | import numpy as np
import PIL.Image as Image
from skimage.measure import compare_psnr, compare_ssim
import glob
import os
import sys
import utils
import tqdm
csv_filename = sys.argv[1]
DATA_DIR='/home/esoc/datasets/SuperResolution/'
RESULT_DIR=sys.argv[2]
Benchmarks=['Set5', 'Set14', 'DIV2K_valid_HR', 'BSDS100', 'Urb... | 33.779221 | 146 | 0.697809 |
b5e366d5a5c75b0204b066137055a1d261caa72c | 4,798 | py | Python | ec2api_tempest_plugin/scenario/base.py | NeCTAR-RC/ec2api-tempest-plugin | 2757fdac7355e9bd355b0e472ed928d7b88b933e | [
"Apache-2.0"
] | 5 | 2018-06-27T11:17:10.000Z | 2019-01-28T22:00:08.000Z | ec2api_tempest_plugin/scenario/base.py | NeCTAR-RC/ec2api-tempest-plugin | 2757fdac7355e9bd355b0e472ed928d7b88b933e | [
"Apache-2.0"
] | null | null | null | ec2api_tempest_plugin/scenario/base.py | NeCTAR-RC/ec2api-tempest-plugin | 2757fdac7355e9bd355b0e472ed928d7b88b933e | [
"Apache-2.0"
] | 2 | 2019-01-14T04:54:29.000Z | 2020-02-03T15:53:18.000Z | # Copyright 2015 OpenStack Foundation
# 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 requ... | 35.279412 | 78 | 0.582118 |
7b904057c114d15865a65de43810647cea46b1f3 | 459 | py | Python | application/model/widget/game/GameTextdialogue.py | Kzulfazriawan/Stigma-game-demo | 971ee90a908784dfe1c9e87733b0394fa2212299 | [
"MIT"
] | 2 | 2016-08-09T05:33:21.000Z | 2016-10-05T06:34:04.000Z | application/model/widget/game/GameTextdialogue.py | Kzulfazriawan/stigma-game-demo | 971ee90a908784dfe1c9e87733b0394fa2212299 | [
"MIT"
] | null | null | null | application/model/widget/game/GameTextdialogue.py | Kzulfazriawan/stigma-game-demo | 971ee90a908784dfe1c9e87733b0394fa2212299 | [
"MIT"
] | null | null | null | from core import Files
from library.stigma.application import Label
from library.stigma.helper import kivyBuilder
kivyBuilder(Files.apppath, 'model', 'builder', 'game', 'gametextdialogue.kv')
class GameTextdialogue(Label):
def __init__(self):
super(GameTextdialogue, self).__init__()
self.state ... | 32.785714 | 77 | 0.647059 |
3c85df2edd27841eb9c5cbfd8b7f767defb1e680 | 4,049 | py | Python | active_learning_ts/experiments/blueprint.py | bela127/active_learning_ts | b652995edfb14c37e486ddc8261d6093d6babdae | [
"MIT"
] | 1 | 2022-02-14T09:38:22.000Z | 2022-02-14T09:38:22.000Z | active_learning_ts/experiments/blueprint.py | bela127/active_learning_ts | b652995edfb14c37e486ddc8261d6093d6babdae | [
"MIT"
] | 1 | 2022-02-11T12:13:31.000Z | 2022-02-11T12:13:31.000Z | active_learning_ts/experiments/blueprint.py | bela127/active_learning_ts | b652995edfb14c37e486ddc8261d6093d6babdae | [
"MIT"
] | 2 | 2021-12-15T12:56:30.000Z | 2022-02-01T15:31:08.000Z | from typing import Iterable, Protocol
from active_learning_ts.data_pipeline import DataPipeline
from active_learning_ts.data_retrievement.augmentation.no_augmentation import NoAugmentation
from active_learning_ts.data_retrievement.data_source import DataSource
from active_learning_ts.data_retrievement.data_sources.tes... | 69.810345 | 118 | 0.88244 |
39e6d66036c6b6df4b453a8078aa2be8db1b40c5 | 7,880 | py | Python | yolov5/object_detection_3d.py | jeffreyttc/yolov5_ros2 | 305f96b1c33ea0045738cc498cfe98a35efd3acb | [
"MIT"
] | 1 | 2021-12-28T22:41:56.000Z | 2021-12-28T22:41:56.000Z | yolov5/object_detection_3d.py | jeffreyttc/yolov5_ros2 | 305f96b1c33ea0045738cc498cfe98a35efd3acb | [
"MIT"
] | null | null | null | yolov5/object_detection_3d.py | jeffreyttc/yolov5_ros2 | 305f96b1c33ea0045738cc498cfe98a35efd3acb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os, sys
from types import FrameType
import rclpy
from rclpy.node import Node
from rclpy.qos import qos_profile_sensor_data
from std_msgs.msg import String
from sensor_msgs.msg import Image, CompressedImage
from cv_bridge import CvBridge, CvBridgeError
import cv2
import numpy as np
import t... | 38.439024 | 128 | 0.611675 |
05a3f910877ef2e5677f0368dc88236112d232e9 | 1,333 | py | Python | nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/camino/tests/test_auto_ComputeMeanDiffusivity.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.dti import ComputeMeanDiffusivity
def test_ComputeMeanDiffusivity_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore... | 27.204082 | 78 | 0.662416 |
79b2df94d08cdac48138657f2bfb4844d102be68 | 1,749 | py | Python | aiida/storage/psql_dos/models/settings.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 153 | 2016-12-23T20:59:03.000Z | 2019-07-02T06:47:52.000Z | aiida/storage/psql_dos/models/settings.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 2,466 | 2016-12-24T01:03:52.000Z | 2019-07-04T13:41:08.000Z | aiida/storage/psql_dos/models/settings.py | mkrack/aiida-core | bab1ad6cfc8e4ff041bce268f9270c613663cb35 | [
"MIT",
"BSD-3-Clause"
] | 88 | 2016-12-23T16:28:00.000Z | 2019-07-01T15:55:20.000Z | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 42.658537 | 117 | 0.590623 |
834215d8101d7a80508d8aacd733ac7510fe51f6 | 1,614 | py | Python | dashboard/dashboard/pinpoint/handlers/results2.py | bopopescu/chromium72-third-party-catapult | 774e1355b871e13bb858147a136e9cb476f55030 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | dashboard/dashboard/pinpoint/handlers/results2.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | dashboard/dashboard/pinpoint/handlers/results2.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2017 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.
"""Provides the web interface for displaying a results2 file."""
import json
import webapp2
from dashboard.pinpoint.models import job as job_module
from da... | 29.888889 | 79 | 0.69083 |
5b60c355135b35b64c4d30e49258566a1543c027 | 1,588 | py | Python | src/grid.py | alexlarson98/HollywoodSquares | ab48bf3a01233ed62fe4695a9e5733433e96832e | [
"MIT"
] | null | null | null | src/grid.py | alexlarson98/HollywoodSquares | ab48bf3a01233ed62fe4695a9e5733433e96832e | [
"MIT"
] | null | null | null | src/grid.py | alexlarson98/HollywoodSquares | ab48bf3a01233ed62fe4695a9e5733433e96832e | [
"MIT"
] | null | null | null | import pygame
class Grid:
def __init__(self, sizes):
self.sizes = sizes
self.board = pygame.image.load('./media/hs_grid.png')
self.board = pygame.transform.scale(self.board, (sizes.grid_size, sizes.grid_size))
self.alt_board = None
self.player_index = None
self.count... | 39.7 | 109 | 0.63665 |
a888bc46d6eecec7db157d766155f7bfee9cec77 | 2,505 | py | Python | tensortrade/features/indicators/talib_indicator.py | msincenselee/tensortrade | aeed3fbf1657ba1f3bf4bb81fec876d65284b79b | [
"Apache-2.0"
] | 7 | 2020-09-28T23:36:40.000Z | 2022-02-22T02:00:32.000Z | tensortrade/features/indicators/talib_indicator.py | msincenselee/tensortrade | aeed3fbf1657ba1f3bf4bb81fec876d65284b79b | [
"Apache-2.0"
] | 4 | 2020-11-13T18:48:52.000Z | 2022-02-10T01:29:47.000Z | tensortrade/features/indicators/talib_indicator.py | msincenselee/tensortrade | aeed3fbf1657ba1f3bf4bb81fec876d65284b79b | [
"Apache-2.0"
] | 3 | 2020-11-23T17:31:59.000Z | 2021-04-08T10:55:03.000Z | # Copyright 2019 The TensorTrade Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.065574 | 145 | 0.65988 |
e195f634d6a08362d544e757a3012dcbe0d73a5a | 1,576 | py | Python | server/orchestrator/models/base.py | bsantaus/qiskit-dell-runtime | aec129a83e0a5d6ee34de01be14c91469ce74407 | [
"Apache-2.0"
] | 17 | 2021-09-27T14:46:06.000Z | 2022-02-15T12:08:48.000Z | server/orchestrator/models/base.py | manannarang/qiskit-dell-runtime | ef8da4fc27ccca60ef81e7391d0c2a60593170b3 | [
"Apache-2.0"
] | 4 | 2021-09-27T14:21:53.000Z | 2022-01-20T16:43:46.000Z | server/orchestrator/models/base.py | manannarang/qiskit-dell-runtime | ef8da4fc27ccca60ef81e7391d0c2a60593170b3 | [
"Apache-2.0"
] | 2 | 2021-10-13T03:42:31.000Z | 2022-01-16T10:12:54.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 35.022222 | 80 | 0.764594 |
bb22ad7744c76cd945d0bf803f2869ca9c66dd54 | 2,389 | py | Python | temp.py | Devanshu-singh-VR/pack-it-up | 4833ad08b7ba8afbb5a685f524fbb5fada88bc43 | [
"MIT"
] | null | null | null | temp.py | Devanshu-singh-VR/pack-it-up | 4833ad08b7ba8afbb5a685f524fbb5fada88bc43 | [
"MIT"
] | null | null | null | temp.py | Devanshu-singh-VR/pack-it-up | 4833ad08b7ba8afbb5a685f524fbb5fada88bc43 | [
"MIT"
] | null | null | null | #/usr/bin/env python3
import pyrebase
from sklearn import tree
config = {
"apiKey": "AIzaSyByA7celafHSloxdOLA7_s-D097Ld10Jus",
"authDomain": "firepack-66e50.firebaseapp.com",
"databaseURL": "https://firepack-66e50.firebaseio.com",
"projectId": "firepack-66e50",
"storageBucket": "firepack-66e50.appspot.co... | 31.434211 | 818 | 0.689828 |
a9e1e7b7c986a77eb9c23e5cbd59f730422e1293 | 2,797 | py | Python | tests/chainer_tests/functions_tests/test_linear.py | umitanuki/chainer | 225c56b233e684ff4855451d2af4c2fb66915f21 | [
"MIT"
] | null | null | null | tests/chainer_tests/functions_tests/test_linear.py | umitanuki/chainer | 225c56b233e684ff4855451d2af4c2fb66915f21 | [
"MIT"
] | null | null | null | tests/chainer_tests/functions_tests/test_linear.py | umitanuki/chainer | 225c56b233e684ff4855451d2af4c2fb66915f21 | [
"MIT"
] | 1 | 2018-11-18T00:36:51.000Z | 2018-11-18T00:36:51.000Z | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import type_check
class TestLinear(unittest.TestCase):
in_s... | 28.540816 | 77 | 0.642474 |
f50d96cfcdf6b758bd86d8866691ff1b6d54c19d | 78 | py | Python | message_media_messages/exceptions/__init__.py | Fredpwol/messages-python-sdk | 8902934edc2883afe5105ec02468caf00ded634e | [
"Apache-2.0"
] | 6 | 2018-04-30T05:45:53.000Z | 2021-09-18T04:45:28.000Z | message_media_messages/exceptions/__init__.py | Fredpwol/messages-python-sdk | 8902934edc2883afe5105ec02468caf00ded634e | [
"Apache-2.0"
] | 4 | 2017-11-30T21:50:23.000Z | 2020-06-19T06:25:51.000Z | message_media_messages/exceptions/__init__.py | messagemedia/messages-python-sdk | 915c29ab7cbabca5c3fbeb89c9d4b28754630a57 | [
"Apache-2.0"
] | 7 | 2017-11-30T13:29:50.000Z | 2022-01-25T22:30:34.000Z | __all__ = [
'api_exception',
'send_messages_400_response_exception',
] | 19.5 | 43 | 0.717949 |
b1b0f9d3fb0c4fc96ccf2e65cf999de1f2ea6f64 | 447 | py | Python | backend/common/schemas.py | restato/bunnybook | 970c862aa55941f073c708d748f7ff415ec3e785 | [
"MIT"
] | 131 | 2021-08-30T11:05:47.000Z | 2022-03-22T19:08:21.000Z | backend/common/schemas.py | restato/bunnybook | 970c862aa55941f073c708d748f7ff415ec3e785 | [
"MIT"
] | 1 | 2022-02-22T16:52:46.000Z | 2022-02-22T16:54:47.000Z | backend/common/schemas.py | restato/bunnybook | 970c862aa55941f073c708d748f7ff415ec3e785 | [
"MIT"
] | 13 | 2021-09-02T23:25:28.000Z | 2022-02-25T18:24:31.000Z | import datetime as dt
from fastapi_camelcase import CamelModel
def dt_to_iso8601z(d: dt.datetime) -> str:
# convert datetime to iso 8601 format, adding milliseconds and "Z" suffix
return f"{d.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3]}Z"
class BaseSchema(CamelModel):
# add Zulu timezone to allow javascript ... | 26.294118 | 77 | 0.680089 |
a1a3d6aff9e2b321a57ab6f31fe83a396b009e15 | 2,233 | py | Python | examples/old_style_CPython_ast.py | LISTERINE/sourcerer | 5f756fdc3a79c902eafbceccb49c0c1e4b395ad1 | [
"Apache-2.0"
] | null | null | null | examples/old_style_CPython_ast.py | LISTERINE/sourcerer | 5f756fdc3a79c902eafbceccb49c0c1e4b395ad1 | [
"Apache-2.0"
] | null | null | null | examples/old_style_CPython_ast.py | LISTERINE/sourcerer | 5f756fdc3a79c902eafbceccb49c0c1e4b395ad1 | [
"Apache-2.0"
] | null | null | null | from yaml import load
from sys import argv
from pdb import set_trace
from ast import *
import re
from astunparse import unparse
def format_name(name):
no_vars = re.sub(r'_?\{.*?\}', '', name)
no_doubles = no_vars.replace('//', '/')
no_inner = re.sub('(\w)\/(\w)', r'\1_\2', no_doubles) # replace inner sla... | 31.9 | 91 | 0.512315 |
2e546567e7d4c87698c87bc0d1f515e4ab22b727 | 769 | py | Python | enrocrypt/error.py | Morgan-Phoenix/EnroCrypt | cf883225a06bac73c564cff83af5e3f9386de116 | [
"MIT"
] | 6 | 2021-05-25T10:04:04.000Z | 2021-12-26T14:36:21.000Z | enrocrypt/error.py | Morgan-Phoenix/EnroCrypt | cf883225a06bac73c564cff83af5e3f9386de116 | [
"MIT"
] | 7 | 2021-05-26T12:59:16.000Z | 2021-08-31T09:17:48.000Z | enrocrypt/error.py | Morgan-Phoenix/EnroCrypt | cf883225a06bac73c564cff83af5e3f9386de116 | [
"MIT"
] | 2 | 2021-05-27T10:16:58.000Z | 2021-08-01T03:50:17.000Z | class ModifiedError(Exception):
def __init__(self):
self.msg = 'The List Provided To The Function Is Modified'
super().__init__(self.msg)
class ListIndexError(Exception):
def __init__(self):
self.msg = 'Returned List Must Only Have 4 Elements'
super().__init__(self.msg)
class NoK... | 36.619048 | 75 | 0.652796 |
85f66d49e446b793d35699fccef71d6d2f38bdaa | 5,882 | py | Python | Rationale_Analysis/models/extractors/supervised_bert_lstm_extractor.py | CMSC35100-JET/FRESH | ea2b23386f8411da7127ec84ff6dd6e684b1dced | [
"MIT"
] | 30 | 2020-05-15T02:24:54.000Z | 2022-03-14T21:52:48.000Z | Rationale_Analysis/models/extractors/supervised_bert_lstm_extractor.py | CMSC35100-JET/FRESH | ea2b23386f8411da7127ec84ff6dd6e684b1dced | [
"MIT"
] | 5 | 2020-05-04T13:43:14.000Z | 2022-02-14T19:37:01.000Z | Rationale_Analysis/models/extractors/supervised_bert_lstm_extractor.py | CMSC35100-JET/FRESH | ea2b23386f8411da7127ec84ff6dd6e684b1dced | [
"MIT"
] | 6 | 2020-10-12T21:09:57.000Z | 2022-01-12T00:48:42.000Z | from typing import Optional, Dict, Any
import torch
from allennlp.data.vocabulary import Vocabulary
from allennlp.models.model import Model
from allennlp.nn import InitializerApplicator, RegularizerApplicator, util
from allennlp.modules import Seq2SeqEncoder, TextFieldEmbedder, FeedForward, TimeDistributed
from Rati... | 39.213333 | 139 | 0.629548 |
5847ae666a144ba0d5fb1c2ec3660bf5e784561c | 6,923 | py | Python | test/test_plugin_ifttt.py | NiNiyas/apprise | 8d96e95acd7cb89f082685ae161bd0e268203f0c | [
"MIT"
] | 1 | 2022-01-19T01:40:04.000Z | 2022-01-19T01:40:04.000Z | test/test_plugin_ifttt.py | NiNiyas/apprise | 8d96e95acd7cb89f082685ae161bd0e268203f0c | [
"MIT"
] | null | null | null | test/test_plugin_ifttt.py | NiNiyas/apprise | 8d96e95acd7cb89f082685ae161bd0e268203f0c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# 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 th... | 33.444444 | 79 | 0.678896 |
a1ae33da36dd8f448097b8044587b4b85d5f9a7e | 1,028 | py | Python | 15_threeSum/solution.py | NekoApocalypse/leetcode-collection | d7db13b34078eb3027f89a02eeb45066073a4a5c | [
"MIT"
] | null | null | null | 15_threeSum/solution.py | NekoApocalypse/leetcode-collection | d7db13b34078eb3027f89a02eeb45066073a4a5c | [
"MIT"
] | null | null | null | 15_threeSum/solution.py | NekoApocalypse/leetcode-collection | d7db13b34078eb3027f89a02eeb45066073a4a5c | [
"MIT"
] | null | null | null | class Solution:
def threeSum(self, nums):
nums = sorted(nums)
ans = []
for i, n1 in enumerate(nums):
if n1 > 0:
break
if i > 0 and n1 == nums[i - 1]:
continue
target = -n1
ll = i + 1
rr = len(nums) - ... | 25.7 | 63 | 0.366732 |
146dfe8f63c9b5c1eabfdb9ae5ee71d20eff7ce7 | 13,068 | py | Python | examples/master.py | Sevendi/dnpy | 3d463805ae553e537be97050083113b56f30b20d | [
"MIT"
] | 3 | 2020-07-13T17:39:01.000Z | 2021-06-09T06:52:48.000Z | examples/master.py | Sevendi/dnpy | 3d463805ae553e537be97050083113b56f30b20d | [
"MIT"
] | 1 | 2020-08-09T04:53:38.000Z | 2020-08-27T04:22:19.000Z | examples/master.py | Sevendi/dnpy | 3d463805ae553e537be97050083113b56f30b20d | [
"MIT"
] | 3 | 2020-12-06T21:19:28.000Z | 2021-08-01T15:10:31.000Z | import logging
import sys
import time
from dnpy import opendnp3
FILTERS = opendnp3.levels.ALL | opendnp3.levels.ALL_APP_COMMS
HOST = "127.0.0.1"
LOCAL = "0.0.0.0"
PORT = 20005
stdout_stream = logging.StreamHandler(sys.stdout)
stdout_stream.setFormatter(logging.Formatter('%(asctime)s\t%(name)s\t%(levelname)s\t%(messa... | 42.428571 | 188 | 0.66858 |
564c731e5d5cd0bbd116928a5ae54f7ffc150fd6 | 1,040 | py | Python | python_files/server/serve_model.py | cjbumgardner/HE_for_Medical_Data | 248dcd8b48924fe1f6edbeee4e16282d4a31069a | [
"MIT"
] | 1 | 2020-05-17T08:36:11.000Z | 2020-05-17T08:36:11.000Z | python_files/server/serve_model.py | cjbumgardner/HE_for_Medical_Data | 248dcd8b48924fe1f6edbeee4e16282d4a31069a | [
"MIT"
] | null | null | null | python_files/server/serve_model.py | cjbumgardner/HE_for_Medical_Data | 248dcd8b48924fe1f6edbeee4e16282d4a31069a | [
"MIT"
] | null | null | null | """
This file will be removed in the future.
"""
import server.seal_functions as sf
from pathlib import Path, PurePath
import os
import streamlit as st
MODELPARMS = Path(os.path.realpath(__file__)).parent.joinpath("model_params")
MODELS = {"Mortality Risk":
{"path":"log_reg_mortality",
"seal_... | 31.515152 | 77 | 0.682692 |
1411a0a15f8a58e2d20235c4b42129c2418d30b1 | 253 | py | Python | Leetcode/0279. Perfect Squares/0279.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0279. Perfect Squares/0279.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0279. Perfect Squares/0279.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | class Solution:
def numSquares(self, n: int) -> int:
dp = [n] * (n + 1)
dp[0] = 0
dp[1] = 1
for i in range(2, n + 1):
j = 1
while j * j <= i:
dp[i] = min(dp[i], dp[i - j * j] + 1)
j += 1
return dp[n]
| 16.866667 | 45 | 0.395257 |
781e61872fc47a6c46475cab2bc49fb527c73534 | 241 | py | Python | LA_app/LA_project/projects/forms.py | laxminarayanRaval/DjangoPractixe | 4ac22cdb732fd2443197f4f71662b74c35ae73ff | [
"CC0-1.0"
] | null | null | null | LA_app/LA_project/projects/forms.py | laxminarayanRaval/DjangoPractixe | 4ac22cdb732fd2443197f4f71662b74c35ae73ff | [
"CC0-1.0"
] | null | null | null | LA_app/LA_project/projects/forms.py | laxminarayanRaval/DjangoPractixe | 4ac22cdb732fd2443197f4f71662b74c35ae73ff | [
"CC0-1.0"
] | null | null | null | from django.forms import ModelForm
from .models import Project
class ProjectForm(ModelForm):
class Meta:
model = Project
fields = ['title', 'description', 'featured_img', 'tags', 'demo_link', 'source_link',] # '__all__' | 34.428571 | 107 | 0.680498 |
f6999adba50e72b21b70d12868ea05f886f9eb05 | 6,531 | py | Python | Allura/allura/tests/unit/phone/test_nexmo.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | 1 | 2021-12-09T21:52:12.000Z | 2021-12-09T21:52:12.000Z | Allura/allura/tests/unit/phone/test_nexmo.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | null | null | null | Allura/allura/tests/unit/phone/test_nexmo.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"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 (t... | 39.107784 | 106 | 0.595315 |
1e645a0a5cf1ac8e66925c0a9950b9b504e3c3aa | 1,210 | py | Python | tutorials/W3D1_BayesianDecisions/solutions/W3D1_Tutorial1_Solution_a004d68d.py | arpitadash/course-content | c925341cdc34492f3c6125690a5c1b0ca1d26260 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2020-06-14T16:12:01.000Z | 2020-06-14T16:12:01.000Z | tutorials/W3D1_BayesianDecisions/solutions/W3D1_Tutorial1_Solution_a004d68d.py | macasal/course-content | 0fc5e1a0d736c6b0391eeab587012ed0ab01e462 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2021-06-16T05:41:08.000Z | 2021-06-16T05:41:08.000Z | tutorials/W3D1_BayesianDecisions/solutions/W3D1_Tutorial1_Solution_a004d68d.py | macasal/course-content | 0fc5e1a0d736c6b0391eeab587012ed0ab01e462 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2021-11-26T17:23:48.000Z | 2021-11-26T17:23:48.000Z |
# 1). The prior exerts a strong influence over the posterior when it is very informative: when
#. the probability of the school being on one side or the other. If the prior that the fish are
#. on the left side is very high (like 0.9), the posterior probability of the state being left is
#. high regardless of t... | 71.176471 | 111 | 0.738017 |
29fc78734a3ec29ece4976f2681a207d16a82591 | 251 | py | Python | manage.py | joseluan/ifnaroca | 36a9ed54490a9cd14a349bb9c6f8fcbaa131aa76 | [
"Apache-2.0"
] | null | null | null | manage.py | joseluan/ifnaroca | 36a9ed54490a9cd14a349bb9c6f8fcbaa131aa76 | [
"Apache-2.0"
] | null | null | null | manage.py | joseluan/ifnaroca | 36a9ed54490a9cd14a349bb9c6f8fcbaa131aa76 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ifnaroca.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.818182 | 72 | 0.772908 |
fe57c515be0f06cd5c80a273105ef59a3eb1b8b7 | 8,261 | py | Python | lyricsearch/searchutil.py | wmcooper2/lyricsearch | 0aff7a32d240f6ba2ba1e21ae46d3ce79d13edd5 | [
"MIT"
] | null | null | null | lyricsearch/searchutil.py | wmcooper2/lyricsearch | 0aff7a32d240f6ba2ba1e21ae46d3ce79d13edd5 | [
"MIT"
] | null | null | null | lyricsearch/searchutil.py | wmcooper2/lyricsearch | 0aff7a32d240f6ba2ba1e21ae46d3ce79d13edd5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
"""Utility module for Lyric Search program."""
# stand lib
import difflib
from pathlib import Path
import re
import shelve
from time import asctime
from typing import (
Callable,
Dict,
List,
Set,
Text,
Tuple,
)
# 3rd party
from nltk impor... | 31.173585 | 71 | 0.592059 |
56ed81643d4d14a3951c9f7b26537b0cd5efdb88 | 18,195 | py | Python | tests/test_modeling_tf_gpt2.py | christy-yuan-li/transformers-1 | 2ee9f9b69e67426aaed690f652f9cdd8b524b99d | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_tf_gpt2.py | christy-yuan-li/transformers-1 | 2ee9f9b69e67426aaed690f652f9cdd8b524b99d | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_tf_gpt2.py | christy-yuan-li/transformers-1 | 2ee9f9b69e67426aaed690f652f9cdd8b524b99d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... | 39.468547 | 117 | 0.669854 |
78db66e4952af787252c688ca5bee69f5dd45ceb | 199 | py | Python | log/lib.py | mitsuboshi20190723/py3Study | 428eeb8a83efb6dbdffc40fd60acb7b765ffda24 | [
"Apache-2.0"
] | null | null | null | log/lib.py | mitsuboshi20190723/py3Study | 428eeb8a83efb6dbdffc40fd60acb7b765ffda24 | [
"Apache-2.0"
] | null | null | null | log/lib.py | mitsuboshi20190723/py3Study | 428eeb8a83efb6dbdffc40fd60acb7b765ffda24 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
# 2020.11.22
# lib.py
# ver 0.1
# Kunihito Mitsuboshi
# license(Apache-2.0) at http://www.apache.org/licenses/LICENSE-2.0
##
import sys
| 14.214286 | 69 | 0.603015 |
1f071863131bb2b18dfc5c822785e1dab12555d2 | 19,204 | py | Python | utilipy/decorators/func_io.py | nstarman/utilipy | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 2 | 2020-11-15T01:48:45.000Z | 2020-12-02T20:44:20.000Z | utilipy/decorators/func_io.py | nstarman/astroPHD | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 22 | 2020-09-13T17:58:24.000Z | 2022-02-04T19:05:23.000Z | utilipy/decorators/func_io.py | nstarman/utilipy | 17984942145d31126724df23500bafba18fb7516 | [
"BSD-3-Clause"
] | 1 | 2020-04-21T22:41:01.000Z | 2020-04-21T22:41:01.000Z | # -*- coding: utf-8 -*-
"""Function Input and Output Decorators."""
__all__ = [
"store_function_input",
"add_folder_backslash",
"random_generator_from_seed",
"dtypeDecoratorMaker",
]
##############################################################################
# IMPORTS
# BUILT-IN
import typing as... | 28.408284 | 79 | 0.550771 |
e3b1ec058b5045fe2a1f61008ffa81a9f654c1e3 | 219 | py | Python | scr/map_utr3_snp/in_utr3/relatejson.py | chunjie-sam-liu/miRNASNP-v3 | 41fab95b496b639674010863895547db0fc108bc | [
"MIT"
] | 1 | 2020-07-02T08:51:37.000Z | 2020-07-02T08:51:37.000Z | scr/map_utr3_snp/in_utr3/relatejson.py | chunjie-sam-liu/miRNASNP-v3 | 41fab95b496b639674010863895547db0fc108bc | [
"MIT"
] | null | null | null | scr/map_utr3_snp/in_utr3/relatejson.py | chunjie-sam-liu/miRNASNP-v3 | 41fab95b496b639674010863895547db0fc108bc | [
"MIT"
] | null | null | null | import json
surj = {}
with open("snp_utr3_relate.json","a") as sur:
with open("snp_utr3_relate") as infile:
for line in infile:
if line:
rs = line.split()[3]
surj[rs] = line.strip()
json.dump(surj,sur)
| 18.25 | 45 | 0.643836 |
9b8233a09577d1abb3edb7c4dad0bd916c43cf88 | 11,961 | py | Python | spyder/plugins/editor/widgets/tests/test_editorsplitter.py | aglotero/spyder | 075d32fa359b728416de36cb0e744715fa5e3943 | [
"MIT"
] | null | null | null | spyder/plugins/editor/widgets/tests/test_editorsplitter.py | aglotero/spyder | 075d32fa359b728416de36cb0e744715fa5e3943 | [
"MIT"
] | null | null | null | spyder/plugins/editor/widgets/tests/test_editorsplitter.py | aglotero/spyder | 075d32fa359b728416de36cb0e744715fa5e3943 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""
Tests for EditorSplitter class in editor.py
"""
# Standard library imports
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
# Third party imports
im... | 35.076246 | 82 | 0.662654 |
5c0ddb6875cbfa6b875216b03aa72a14aee03a0f | 2,626 | py | Python | xlsxwriter/test/comparison/test_chart_up_down_bars02.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-05-19T22:17:15.000Z | 2015-05-19T22:17:15.000Z | xlsxwriter/test/comparison/test_chart_up_down_bars02.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_up_down_bars02.py | sontek/XlsxWriter | 7f17a52f95be9ecfb9c7f213fc0a02e0f625c6ec | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2014, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.... | 26.26 | 79 | 0.470678 |
9b8a3461ee253265b4850032aa5e82df995a5550 | 4,906 | py | Python | openapi_server/models/landing_page.py | eugenegesdisc/gmuedr | e8b3e5c7b8d18421d875f0f6f778a37a6d8ec3fd | [
"MIT"
] | null | null | null | openapi_server/models/landing_page.py | eugenegesdisc/gmuedr | e8b3e5c7b8d18421d875f0f6f778a37a6d8ec3fd | [
"MIT"
] | null | null | null | openapi_server/models/landing_page.py | eugenegesdisc/gmuedr | e8b3e5c7b8d18421d875f0f6f778a37a6d8ec3fd | [
"MIT"
] | null | null | null | # coding: utf-8
from datetime import date, datetime
from typing import List, Dict, Type
from openapi_server.models.base_model_ import Model
from openapi_server.models.landing_page_contact import LandingPageContact
from openapi_server.models.landing_page_provider import LandingPageProvider
from openapi_server.models.... | 25.685864 | 183 | 0.611904 |
5236c0bf8d143eb6aa58129c02ce01c3c716c358 | 7,782 | py | Python | models/densenet121_3d_dilate_front.py | JSharpClone/M3D-RPN- | 5192b095e921b5c054a66fd0ce948e67aee957be | [
"Apache-2.0"
] | null | null | null | models/densenet121_3d_dilate_front.py | JSharpClone/M3D-RPN- | 5192b095e921b5c054a66fd0ce948e67aee957be | [
"Apache-2.0"
] | null | null | null | models/densenet121_3d_dilate_front.py | JSharpClone/M3D-RPN- | 5192b095e921b5c054a66fd0ce948e67aee957be | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
from torchvision import models
from lib.rpn_util import *
from flownet2pytorch.models import FlowNet2C
import torch
class Args:
def __init__(self):
self.rgb_max = 255.0
self.fp16 = False
def dilate_layer(layer, val):
layer.dilation = val
layer.padding = val
class R... | 40.53125 | 117 | 0.662298 |
eba9f312dcc1755bb038bc6db71763297e2454e3 | 1,627 | py | Python | main.py | Sein-Jang/SRGAN | f6dd431f70857a95034b915c472f1e79210c537b | [
"MIT"
] | 1 | 2020-11-26T19:11:54.000Z | 2020-11-26T19:11:54.000Z | main.py | Sein-Jang/SRGAN | f6dd431f70857a95034b915c472f1e79210c537b | [
"MIT"
] | null | null | null | main.py | Sein-Jang/SRGAN | f6dd431f70857a95034b915c472f1e79210c537b | [
"MIT"
] | null | null | null | import glob
import os
from conf import *
from data import *
from model import generator, discriminator
from train import GeneratorTrainer, SrganTrainer
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATASET = os.path.join(BASE_DIR, 'dataset')
"""
DATA
"""
train_hr_img_path = glob.glob(os.path.join(DATASET, TR... | 34.617021 | 105 | 0.803319 |
3e238b9022095ce6d9f9922cd5c9ff722a108eff | 1,485 | py | Python | homework-10-su21-falkishi-main/kmeans.py | falkishi/Python-HWs | 04504c21a7fc5dc4b9fe7820549d9cdf98c7aa91 | [
"Apache-2.0"
] | null | null | null | homework-10-su21-falkishi-main/kmeans.py | falkishi/Python-HWs | 04504c21a7fc5dc4b9fe7820549d9cdf98c7aa91 | [
"Apache-2.0"
] | null | null | null | homework-10-su21-falkishi-main/kmeans.py | falkishi/Python-HWs | 04504c21a7fc5dc4b9fe7820549d9cdf98c7aa91 | [
"Apache-2.0"
] | null | null | null | from cluster import *
from point import *
def kmeans(pointdata, clusterdata) :
#Fill in
#1. Make list of points using makePointList and pointdata
points = makePointList(pointdata);
#2. Make list of clusters using createClusters and clusterdata
clusters = createClusters(clusterdata);
... | 29.7 | 110 | 0.56835 |
8457aa0514b807b533e827e5b42203d18255a164 | 2,456 | py | Python | lib/rucio/tests/test_temporary_did.py | zzaiin/rucio-1 | 374e51a371a9c6ae8f7dcc7e2a90e5665bc3a65f | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_temporary_did.py | zzaiin/rucio-1 | 374e51a371a9c6ae8f7dcc7e2a90e5665bc3a65f | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_temporary_did.py | zzaiin/rucio-1 | 374e51a371a9c6ae8f7dcc7e2a90e5665bc3a65f | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... | 35.594203 | 89 | 0.629479 |
fd8a0f8da309b202b6ff6b6e93be349520d8d16f | 1,901 | py | Python | util.py | xuqy1981/ppgn | 083d99f123c727363eb69033355880e3822540c5 | [
"MIT"
] | 1 | 2021-04-08T03:47:47.000Z | 2021-04-08T03:47:47.000Z | util.py | CRyan2016/ppgn | 083d99f123c727363eb69033355880e3822540c5 | [
"MIT"
] | null | null | null | util.py | CRyan2016/ppgn | 083d99f123c727363eb69033355880e3822540c5 | [
"MIT"
] | 1 | 2017-01-10T08:00:43.000Z | 2017-01-10T08:00:43.000Z | import numpy as np
import scipy.misc
import subprocess
def normalize(img, out_range=(0.,1.), in_range=None):
if not in_range:
min_val = np.min(img)
max_val = np.max(img)
else:
min_val = in_range[0]
max_val = in_range[1]
result = np.copy(img)
result[result > max_val] = m... | 29.246154 | 109 | 0.620726 |
2fe33fdd34dbbaafcb7754a8974b8cc0b01ea64a | 22,469 | py | Python | deribit_api_python/openapi_client/models/trades_volumes.py | jDally987/deribit-simple-gui | 60c91f8e11b541b0e59cbd23625639a9b9f0dd43 | [
"MIT"
] | 5 | 2019-06-06T04:48:34.000Z | 2019-10-14T00:31:21.000Z | deribit_api_python/openapi_client/models/trades_volumes.py | jDally987/deribit-simple-gui | 60c91f8e11b541b0e59cbd23625639a9b9f0dd43 | [
"MIT"
] | 1 | 2019-10-15T08:55:21.000Z | 2019-10-15T08:55:21.000Z | deribit_api_python/openapi_client/models/trades_volumes.py | jDally987/deribit-simple-gui | 60c91f8e11b541b0e59cbd23625639a9b9f0dd43 | [
"MIT"
] | 4 | 2019-07-27T16:50:14.000Z | 2019-11-13T21:03:50.000Z | # coding: utf-8
"""
Deribit API
#Overview Deribit provides three different interfaces to access the API: * [JSON-RPC over Websocket](#json-rpc) * [JSON-RPC over HTTP](#json-rpc) * [FIX](#fix-api) (Financial Information eXchange) With the API Console you can use and test the JSON-RPC API, both via HTTP and ... | 107.507177 | 15,697 | 0.66505 |
32a15e620103759eb08160ad4d3b2632765dae31 | 100,730 | py | Python | pandas/tests/io/test_sql.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | 1 | 2020-08-18T16:49:16.000Z | 2020-08-18T16:49:16.000Z | pandas/tests/io/test_sql.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/io/test_sql.py | gabriellm1/pandas | 020040b3b92516b445ddd8daba3b9818340e82d4 | [
"BSD-3-Clause"
] | 2 | 2021-07-17T19:28:31.000Z | 2021-11-28T17:14:58.000Z | """SQL io tests
The SQL tests are broken down in different classes:
- `PandasSQLTest`: base class with common methods for all test classes
- Tests for the public API (only tests with sqlite3)
- `_TestSQLApi` base class
- `TestSQLApi`: test the public API with sqlalchemy engine
- `TestSQLiteFallbackApi`: t... | 34.854671 | 88 | 0.588295 |
dfc9da0ba5f29a8cb0629ebebfbf5121f85b5e8c | 5,645 | py | Python | pyci/tests/shell/__init__.py | iliapolo/pyrelease | 85784c556a0760d560378ef6edcfb32ab87048a5 | [
"Apache-2.0"
] | 5 | 2018-05-03T15:20:12.000Z | 2019-12-13T20:19:47.000Z | pyci/tests/shell/__init__.py | iliapolo/pyci | 85784c556a0760d560378ef6edcfb32ab87048a5 | [
"Apache-2.0"
] | 54 | 2018-04-09T06:34:50.000Z | 2020-03-30T06:13:39.000Z | pyci/tests/shell/__init__.py | iliapolo/pyrelease | 85784c556a0760d560378ef6edcfb32ab87048a5 | [
"Apache-2.0"
] | null | null | null | #############################################################################
# Copyright (c) 2018 Eli Polonsky. 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... | 34.631902 | 102 | 0.575376 |
5c10649b9f8f7e2d6dbced56344dcc5e24259ec9 | 594 | py | Python | testlib/__init__.py | MSanKeys963/gramex | 8ac5fd6e79d100982fdc9e9308d9a6250ce021e2 | [
"MIT"
] | 130 | 2019-02-05T06:09:16.000Z | 2022-03-31T03:09:00.000Z | testlib/__init__.py | MSanKeys963/gramex | 8ac5fd6e79d100982fdc9e9308d9a6250ce021e2 | [
"MIT"
] | 457 | 2019-02-05T05:08:34.000Z | 2022-03-30T03:47:45.000Z | testlib/__init__.py | MSanKeys963/gramex | 8ac5fd6e79d100982fdc9e9308d9a6250ce021e2 | [
"MIT"
] | 50 | 2019-02-12T12:20:02.000Z | 2022-03-15T02:50:02.000Z | import os
import sys
import logging
# Import from ../tests/ folder. e.g. dbutils.py for use in test_data.py, etc.
# This is a not elegant.
folder = os.path.dirname(os.path.abspath(__file__))
tests_dir = os.path.normpath(os.path.join(folder, '..', 'tests'))
sys.path.append(tests_dir)
import dbutils ... | 31.263158 | 77 | 0.723906 |
2b58398450175e908b772eb8c61f137be3d45dd8 | 2,303 | py | Python | napalm_arubaoss/helper/__init__.py | derpedda/napalm-arubaos-switch | 7a705e995b48a9a1815949ff730787618d774ae5 | [
"MIT"
] | 13 | 2020-02-17T16:55:23.000Z | 2022-01-07T21:56:38.000Z | napalm_arubaoss/helper/__init__.py | derpedda/napalm-arubaos-switch | 7a705e995b48a9a1815949ff730787618d774ae5 | [
"MIT"
] | 7 | 2020-01-08T16:41:28.000Z | 2021-12-20T16:45:43.000Z | napalm_arubaoss/helper/__init__.py | derpedda/napalm-arubaos-switch | 7a705e995b48a9a1815949ff730787618d774ae5 | [
"MIT"
] | 6 | 2020-04-25T09:21:02.000Z | 2022-01-03T10:32:48.000Z | """Import all functions of this directory."""
from napalm_arubaoss.helper.base import Connection
from napalm_arubaoss.helper.commit_config import commit_config
from napalm_arubaoss.helper.compare_config import compare_config
from napalm_arubaoss.helper.confirm_commit import confirm_commit
from napalm_arubaoss.helper.g... | 34.893939 | 86 | 0.810248 |
8c5461acac6e7b0aa0676bfebcdd52d98a71ea85 | 9,825 | py | Python | tests/providers/google/cloud/hooks/test_automl.py | shashijangra/airflow-1 | c3e340584bf1892c4f73aa9e7495b5823dab0c40 | [
"Apache-2.0"
] | 2 | 2021-07-30T17:25:56.000Z | 2021-08-03T13:51:09.000Z | tests/providers/google/cloud/hooks/test_automl.py | shashijangra/airflow-1 | c3e340584bf1892c4f73aa9e7495b5823dab0c40 | [
"Apache-2.0"
] | 14 | 2019-12-03T02:54:42.000Z | 2020-02-27T16:08:10.000Z | tests/providers/google/cloud/hooks/test_automl.py | shashijangra/airflow-1 | c3e340584bf1892c4f73aa9e7495b5823dab0c40 | [
"Apache-2.0"
] | 1 | 2021-07-02T04:23:18.000Z | 2021-07-02T04:23:18.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... | 37.788462 | 107 | 0.695064 |
ee74ab47d4e097f20012558a1e5a914b9b0c6ba2 | 567 | py | Python | dnachisel/Specification/SpecificationSet.py | Edinburgh-Genome-Foundry/DnaChisel | fed4613cee67c22326a5f654ecf8ff0490298359 | [
"MIT"
] | 124 | 2017-11-14T14:42:25.000Z | 2022-03-31T08:02:07.000Z | dnachisel/Specification/SpecificationSet.py | Edinburgh-Genome-Foundry/DnaChisel | fed4613cee67c22326a5f654ecf8ff0490298359 | [
"MIT"
] | 65 | 2017-11-15T07:25:38.000Z | 2022-01-31T10:38:45.000Z | dnachisel/Specification/SpecificationSet.py | Edinburgh-Genome-Foundry/DnaChisel | fed4613cee67c22326a5f654ecf8ff0490298359 | [
"MIT"
] | 31 | 2018-10-18T12:59:47.000Z | 2022-02-11T16:54:43.000Z | class SpecificationSet:
"""Generic class for writing Specs which are actually made of more specs.
Behaves as a Specification when it comes to instantiation, reading it
from annotated records, etc. but the initialization actually creates a
dictionary of standard Specifications in the DNAOptimizationProb... | 40.5 | 77 | 0.731922 |
58a23099c324bbfdb2b3e48a798044e1715bd1e6 | 399 | py | Python | DSBD_Server/asgi.py | claudi47/DSBD_Server | a54192655042cdf8ff917db7a22b07bc83d07a0d | [
"MIT"
] | 1 | 2021-12-29T18:12:07.000Z | 2021-12-29T18:12:07.000Z | DSBD_Server/asgi.py | claudi47/DSBD_Server | a54192655042cdf8ff917db7a22b07bc83d07a0d | [
"MIT"
] | null | null | null | DSBD_Server/asgi.py | claudi47/DSBD_Server | a54192655042cdf8ff917db7a22b07bc83d07a0d | [
"MIT"
] | null | null | null | """
ASGI config for DSBD_Server project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
773083b3fe3ee029efc9588d78813e106b583d07 | 2,365 | py | Python | tests/communication/test_decorator.py | yourmoonlight/maro | 4fbe556f3ae1817995f90cb529e9ca6191f67d7f | [
"MIT"
] | 1 | 2020-09-22T12:13:32.000Z | 2020-09-22T12:13:32.000Z | tests/communication/test_decorator.py | chaosddp/maro | 3d6715649467d49a83886c1fd4ae9b41ff012a50 | [
"MIT"
] | null | null | null | tests/communication/test_decorator.py | chaosddp/maro | 3d6715649467d49a83886c1fd4ae9b41ff012a50 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import subprocess
import sys
import threading
import unittest
from concurrent.futures import ThreadPoolExecutor, as_completed
from maro.communication import Proxy, SessionMessage, dist
from tests.communication.utils import get_random_p... | 31.959459 | 108 | 0.687949 |
48acaa8a53e7e0ce5503bfefe8fd216cb2c93dc2 | 2,109 | py | Python | idao/data_module.py | Blue-Watermelon/MLhep2021-Competition2 | 2f02e133b95f2d6669b26f16cb2dfb8f1b1866f7 | [
"Apache-2.0"
] | null | null | null | idao/data_module.py | Blue-Watermelon/MLhep2021-Competition2 | 2f02e133b95f2d6669b26f16cb2dfb8f1b1866f7 | [
"Apache-2.0"
] | null | null | null | idao/data_module.py | Blue-Watermelon/MLhep2021-Competition2 | 2f02e133b95f2d6669b26f16cb2dfb8f1b1866f7 | [
"Apache-2.0"
] | null | null | null | import pathlib as path
import pytorch_lightning as pl
import torch
from torch.utils.data import DataLoader, random_split
from torchvision import transforms
from .dataloader import IDAODataset, img_loader, InferenceDataset
class IDAODataModule(pl.LightningDataModule):
def __init__(self, data_dir: path.Path, batc... | 31.477612 | 85 | 0.573732 |
46b3623c5759a430f86a170c16f3f4351c3ab5d1 | 12,252 | py | Python | dragonflow/switch/drivers/ovs/datapath.py | anlaneg/dragonflow | f684fd721cb953f4d0320725d708e79c9f35ef6c | [
"Apache-2.0"
] | null | null | null | dragonflow/switch/drivers/ovs/datapath.py | anlaneg/dragonflow | f684fd721cb953f4d0320725d708e79c9f35ef6c | [
"Apache-2.0"
] | null | null | null | dragonflow/switch/drivers/ovs/datapath.py | anlaneg/dragonflow | f684fd721cb953f4d0320725d708e79c9f35ef6c | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 33.845304 | 79 | 0.609941 |
193a1372cbc445b408097d34b26a662027c0d18e | 8,780 | py | Python | liteasr/models/transducer.py | Nazukixv/LiteASR | 8ee0ef2139acc7c9185b7fecc4b0283f31499830 | [
"MIT"
] | null | null | null | liteasr/models/transducer.py | Nazukixv/LiteASR | 8ee0ef2139acc7c9185b7fecc4b0283f31499830 | [
"MIT"
] | null | null | null | liteasr/models/transducer.py | Nazukixv/LiteASR | 8ee0ef2139acc7c9185b7fecc4b0283f31499830 | [
"MIT"
] | null | null | null | """Transducer."""
from dataclasses import dataclass
from dataclasses import field
from enum import Enum
from typing import List
from omegaconf import II
from omegaconf import MISSING
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from liteasr.config import LiteasrDataclas... | 32.639405 | 79 | 0.569134 |
8e47543d2043ae7eb97347f528838ca64b73feca | 4,350 | py | Python | code/platforms/linux/edit.py | joshpearce/knausj_talon | 44c49806c6e53b2e5fe90fc24fd06a1fc5125883 | [
"MIT"
] | 3 | 2020-04-07T10:44:31.000Z | 2022-01-30T17:04:14.000Z | code/platforms/linux/edit.py | joshpearce/knausj_talon | 44c49806c6e53b2e5fe90fc24fd06a1fc5125883 | [
"MIT"
] | null | null | null | code/platforms/linux/edit.py | joshpearce/knausj_talon | 44c49806c6e53b2e5fe90fc24fd06a1fc5125883 | [
"MIT"
] | 1 | 2021-05-26T14:43:11.000Z | 2021-05-26T14:43:11.000Z | # defines the default edit actions for linux
from talon import Context, actions
ctx = Context()
ctx.matches = r"""
os: linux
"""
@ctx.action_class('edit')
class EditActions:
def copy():
actions.key('ctrl-c')
def cut():
actions.key('ctrl-x')
def delete():
actions.key('backspace')
... | 29.391892 | 51 | 0.591034 |
533fcab5df27c550d0fac753509c2cdce88ce42b | 12,680 | py | Python | tests/temporal/operations/test_horizons.py | anamileva/gridpath | e55eacb88ca5e6c034a90b18819e17cbd6f43854 | [
"Apache-2.0"
] | 44 | 2020-10-27T19:05:44.000Z | 2022-03-22T17:17:37.000Z | tests/temporal/operations/test_horizons.py | anamileva/gridpath | e55eacb88ca5e6c034a90b18819e17cbd6f43854 | [
"Apache-2.0"
] | 67 | 2020-10-08T22:36:53.000Z | 2022-03-22T22:58:33.000Z | tests/temporal/operations/test_horizons.py | anamileva/gridpath | e55eacb88ca5e6c034a90b18819e17cbd6f43854 | [
"Apache-2.0"
] | 21 | 2020-10-08T23:23:48.000Z | 2022-03-28T01:21:21.000Z | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 40.641026 | 94 | 0.560331 |
6431a537106e24957432c80a6706ccd524352c78 | 341 | py | Python | Interview Preparation/Warm-up/sales_by_match.py | matheuscordeiro/HackerRank | 003ab87fdfa9e7c0535972abd06caebb1165423f | [
"MIT"
] | null | null | null | Interview Preparation/Warm-up/sales_by_match.py | matheuscordeiro/HackerRank | 003ab87fdfa9e7c0535972abd06caebb1165423f | [
"MIT"
] | null | null | null | Interview Preparation/Warm-up/sales_by_match.py | matheuscordeiro/HackerRank | 003ab87fdfa9e7c0535972abd06caebb1165423f | [
"MIT"
] | null | null | null | def sockMerchant(n, ar):
colors = {}
pairs = 0
for _, color in enumerate(ar):
if color in colors:
pairs += 1
del colors[color]
else:
colors[color] = True
return pairs
if __name__ == "__main__":
ar = [10, 20, 20, 10, 10, 30, 50, 10, 20]
print... | 21.3125 | 45 | 0.513196 |
587ba640210704ffd68b8c6ba5afc38d70621111 | 5,542 | py | Python | venv/lib/python3.9/site-packages/markdown/extensions/extra.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 182 | 2017-03-05T07:43:13.000Z | 2022-03-15T13:09:07.000Z | venv/lib/python3.9/site-packages/markdown/extensions/extra.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 15 | 2018-05-02T11:05:30.000Z | 2018-05-11T20:51:27.000Z | env/lib/python3.6/site-packages/markdown/extensions/extra.py | bcss-pm/incidents | 927a102104b5718fe118bceb307d3cd633d6699b | [
"MIT"
] | 38 | 2017-04-26T14:13:37.000Z | 2021-06-24T11:36:38.000Z | """
Python-Markdown Extra Extension
===============================
A compilation of various Python-Markdown extensions that imitates
[PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/).
Note that each of the individual extensions still need to be available
on your PYTHONPATH. This extension simply ... | 41.669173 | 78 | 0.648863 |
315ee8e12bb8a53a10fec2031974282edc1039f1 | 437 | py | Python | core/web/api/indicator.py | rorymbyrne/yeti | bc6d7ab7374f3b015c2f92ed8f5ac7e303f95474 | [
"Apache-2.0"
] | 2 | 2018-11-23T15:46:17.000Z | 2019-06-18T20:45:48.000Z | core/web/api/indicator.py | rorymbyrne/yeti | bc6d7ab7374f3b015c2f92ed8f5ac7e303f95474 | [
"Apache-2.0"
] | 3 | 2020-12-04T21:17:20.000Z | 2022-01-15T02:39:23.000Z | core/web/api/indicator.py | rorymbyrne/yeti | bc6d7ab7374f3b015c2f92ed8f5ac7e303f95474 | [
"Apache-2.0"
] | 1 | 2022-02-03T11:23:34.000Z | 2022-02-03T11:23:34.000Z | from __future__ import unicode_literals
from core.web.api.crud import CrudSearchApi, CrudApi
from core import indicators
class IndicatorSearch(CrudSearchApi):
template = 'indicator_api.html'
objectmanager = indicators.Indicator
class Indicator(CrudApi):
template = 'indicator_api.html'
objectmanager... | 23 | 52 | 0.732265 |
0e64be56edc39867604bac6d9923d8d62ea07faf | 1,066 | py | Python | frames/frameManager.py | AndreiPopescu21/StarshipInvaders | 0613dd83a5e947431734d53e8784e68d343a45a8 | [
"CC0-1.0"
] | null | null | null | frames/frameManager.py | AndreiPopescu21/StarshipInvaders | 0613dd83a5e947431734d53e8784e68d343a45a8 | [
"CC0-1.0"
] | null | null | null | frames/frameManager.py | AndreiPopescu21/StarshipInvaders | 0613dd83a5e947431734d53e8784e68d343a45a8 | [
"CC0-1.0"
] | null | null | null | # Import Frames
from frames.menuFrame import MenuFrame
from frames.gameFrame import GameFrame
from frames.settingsFrame import SettingsFrame
from frames.leaderboardsFrame import LeaderboardsFrame
# This function returns a dictionary with all the frames
def getFrames(window,changeFrameFunctions):
# Instantiate fram... | 44.416667 | 123 | 0.798311 |
c4c9c6b06f67b4e1ebf98eb26f5e87e511932f3d | 2,180 | py | Python | vspk/v4_0/fetchers/nuflowforwardingpolicies_fetcher.py | cldelcourt/vspk-python | cdea810cd220e6ddc131407735941b9a26b2edda | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/fetchers/nuflowforwardingpolicies_fetcher.py | cldelcourt/vspk-python | cdea810cd220e6ddc131407735941b9a26b2edda | [
"BSD-3-Clause"
] | null | null | null | vspk/v4_0/fetchers/nuflowforwardingpolicies_fetcher.py | cldelcourt/vspk-python | cdea810cd220e6ddc131407735941b9a26b2edda | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# no... | 41.923077 | 86 | 0.736239 |
f40c032dc82fc6f82d98797b101858b3c3f1f0f6 | 1,375 | py | Python | userbot/plugins/randomownsticker.py | HarshTech26/IndianBot | aa84b30889a2cceca9911a3e95216ac5ba7f4ad0 | [
"MIT"
] | null | null | null | userbot/plugins/randomownsticker.py | HarshTech26/IndianBot | aa84b30889a2cceca9911a3e95216ac5ba7f4ad0 | [
"MIT"
] | null | null | null | userbot/plugins/randomownsticker.py | HarshTech26/IndianBot | aa84b30889a2cceca9911a3e95216ac5ba7f4ad0 | [
"MIT"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
""" Command: .dab , .brain
credit: lejend @anon_cracker"""
import random
from telethon import events, types, functio... | 27.5 | 126 | 0.685818 |
682617a20052e0ff65f64e8384400498b706c696 | 3,107 | py | Python | instana/collector/helpers/base.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 61 | 2017-09-27T02:50:17.000Z | 2022-03-22T12:13:37.000Z | instana/collector/helpers/base.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 82 | 2017-07-11T13:47:33.000Z | 2022-03-22T10:10:38.000Z | instana/collector/helpers/base.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 27 | 2017-09-11T16:22:32.000Z | 2022-03-11T17:21:49.000Z | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
"""
Base class for the various helpers that can be used by Collectors. Helpers assist
in the data collection for various entities such as host, hardware, AWS Task, ec2,
memory, cpu, docker etc etc..
"""
from ...log import logger
class BaseHelper(objec... | 39.329114 | 109 | 0.633408 |
3ce85e4d51677131b09e3707c081758b05f7937b | 921 | py | Python | Misc/changelog.py | pixeldrama/ANNIS | 94fa483804a7edb94bb303349a217c059feb5104 | [
"Apache-2.0"
] | null | null | null | Misc/changelog.py | pixeldrama/ANNIS | 94fa483804a7edb94bb303349a217c059feb5104 | [
"Apache-2.0"
] | null | null | null | Misc/changelog.py | pixeldrama/ANNIS | 94fa483804a7edb94bb303349a217c059feb5104 | [
"Apache-2.0"
] | 1 | 2018-06-25T19:22:52.000Z | 2018-06-25T19:22:52.000Z | #!/usr/bin/python
import json
import io
from subprocess import call
milestone_id = "29"
call(["curl", "-H", "Accept: application/vnd.github.beta.full+json", "-o", "issues.json", "https://api.github.com/repos/korpling/ANNIS/issues?state=closed&milestone=" + milestone_id + "&sort=created"])
f = open("issues.json")
j ... | 20.021739 | 201 | 0.640608 |
7ce05e0804397f78c33d502f50f1cfc1b168d965 | 269 | py | Python | tests/test_urls.py | Xaelias/Vestaboard | a1bc7b6efe6b2ad49079e851c09542c2b9452409 | [
"MIT"
] | 19 | 2020-04-17T04:59:41.000Z | 2022-01-27T23:21:28.000Z | tests/test_urls.py | Xaelias/Vestaboard | a1bc7b6efe6b2ad49079e851c09542c2b9452409 | [
"MIT"
] | 11 | 2020-04-17T04:59:19.000Z | 2022-01-07T00:18:34.000Z | tests/test_urls.py | Xaelias/Vestaboard | a1bc7b6efe6b2ad49079e851c09542c2b9452409 | [
"MIT"
] | 10 | 2021-02-08T18:35:23.000Z | 2022-01-27T23:21:23.000Z | import vestaboard.vbUrls as vbUrls
def test_post_url_matches():
assert vbUrls.post == 'https://platform.vestaboard.com/subscriptions/{}/message'
def test_subscription_url_matches():
assert vbUrls.subscription == 'https://platform.vestaboard.com/subscriptions' | 38.428571 | 84 | 0.784387 |
d6ffee5c2655d96e6d28889b9bd7563cc9ebdce9 | 59,958 | py | Python | numpy/linalg/tests/test_linalg.py | stefb965/numpy | deb4be85025088553d80d6637dbc17d7f8101f41 | [
"BSD-3-Clause"
] | null | null | null | numpy/linalg/tests/test_linalg.py | stefb965/numpy | deb4be85025088553d80d6637dbc17d7f8101f41 | [
"BSD-3-Clause"
] | null | null | null | numpy/linalg/tests/test_linalg.py | stefb965/numpy | deb4be85025088553d80d6637dbc17d7f8101f41 | [
"BSD-3-Clause"
] | null | null | null | """ Test functions for linalg module
"""
from __future__ import division, absolute_import, print_function
import os
import sys
import itertools
import traceback
import warnings
import numpy as np
from numpy import array, single, double, csingle, cdouble, dot, identity
from numpy import multiply, atleast_2d, inf, asa... | 36.010811 | 96 | 0.554855 |
4b9ce1d405fdf9951b558b04ea92e50e97ff468e | 191 | py | Python | exec.28.py | Domingosws/Aprendendo.PYTHON.3 | f525e4324ab3fe33107b9c8cbea2deb61736d151 | [
"MIT"
] | 1 | 2022-02-01T04:22:56.000Z | 2022-02-01T04:22:56.000Z | exec.28.py | Domingosws/Aprendendo.PYTHON.3 | f525e4324ab3fe33107b9c8cbea2deb61736d151 | [
"MIT"
] | null | null | null | exec.28.py | Domingosws/Aprendendo.PYTHON.3 | f525e4324ab3fe33107b9c8cbea2deb61736d151 | [
"MIT"
] | null | null | null | #condição composta
nome=str(input('Qual é seu nome?'))
if nome=='domingos':
print('Que nome lindo você tem!')
else:
print('Seu nome é tão nomal!')
print('Boa noite, {}'.format(nome))
| 23.875 | 37 | 0.659686 |
cae3d7083923cfc4a853abb2783e41b03cb1b5c8 | 979 | py | Python | tests/test_models/test_decoder/test_context_net.py | hologerry/mmflow | 40caf064851bd95317424e31cc137c0007a2bece | [
"Apache-2.0"
] | 481 | 2021-11-16T07:04:23.000Z | 2022-03-31T22:21:21.000Z | tests/test_models/test_decoder/test_context_net.py | hologerry/mmflow | 40caf064851bd95317424e31cc137c0007a2bece | [
"Apache-2.0"
] | 72 | 2021-11-16T12:25:55.000Z | 2022-03-28T13:10:45.000Z | tests/test_models/test_decoder/test_context_net.py | hologerry/mmflow | 40caf064851bd95317424e31cc137c0007a2bece | [
"Apache-2.0"
] | 48 | 2021-11-16T06:48:46.000Z | 2022-03-30T12:46:40.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmflow.models.decoders.context_net import ContextNet
def test_context_net():
# test invalid inchannels type
with pytest.raises(AssertionError):
ContextNet(in_channels='invalid')
feat_channels = (128, 128, 128, 96, 6... | 28.794118 | 65 | 0.671093 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.