content stringlengths 7 928k | avg_line_length float64 3.5 33.8k | max_line_length int64 6 139k | alphanum_fraction float64 0.08 0.96 | licenses list | repository_name stringlengths 7 104 | path stringlengths 4 230 | size int64 7 928k | lang stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|
from django.conf.urls import url
from . import views
urlpatterns = [
url(
r"^control/event/(?P<organizer>[^/]+)/(?P<event>[^/]+)/key-file-upload/$",
views.KeyFileUploadView.as_view(),
name="key_file_upload",
),
]
| 19.076923 | 82 | 0.58871 | [
"MIT"
] | ayanginet/pretix-attestation-placeholder-plugin | pretix_attestation_plugin/urls.py | 248 | Python |
import time
from check_lang import check_py,check_rb,check_j,check_c,check_cpp
from flask import Flask, request, jsonify
from flask_cors import CORS, cross_origin
import subprocess
import json
from json import JSONEncoder
from main import predict
app = Flask(__name__)
CORS(app)
@app.route("/")
def hello():
return... | 28.473118 | 157 | 0.554003 | [
"MIT",
"Unlicense"
] | poke19962008/Source-Code-Classifier | server/home.py | 2,648 | Python |
import numpy as np
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Arnett, 2014, Compressible Hyd... | 36.874477 | 125 | 0.572336 | [
"BSD-2-Clause"
] | mmicromegas/ransX | EQUATIONS/InternalEnergyEquation.py | 8,813 | Python |
#-----------------------------------------------------------------------------
# Copyright (c) 2015-2017, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | 39.538462 | 78 | 0.529183 | [
"MIT"
] | JohnWJackson/arcadePython | venv/Lib/site-packages/PyInstaller/hooks/hook-netCDF4.py | 514 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Copyright (c) Ostap developers.
# =============================================================================
# @file test_fitting_efficiency.py
# Test module for ostap/fitting/efficiency.p... | 34.657143 | 89 | 0.436796 | [
"BSD-3-Clause"
] | MohamedElashri/ostap | ostap/fitting/tests/test_fitting_efficiency.py | 7,278 | Python |
#
# @file TestConstraint_newSetters.py
# @brief Constraint unit tests for new set function API
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# $Id$
# $HeadURL$
#
# This test file was converted from src/sbml/test/TestConstraint_newSetters.c
# with the help of conversion sciprt (ctest_... | 32.947368 | 79 | 0.660011 | [
"BSD-3-Clause"
] | dchandran/evolvenetworks | external/sbml/bindings/python/test/sbml/TestConstraint_newSetters.py | 3,756 | Python |
#!/usr/bin/env python3
import sys
import os
import argparse
scriptpath = os.path.abspath(os.path.dirname(__file__))
includepath = os.path.dirname(scriptpath)
sys.path.insert(0, includepath)
from audio.audiofilefactory import AudioFileFactory
from audio.audioconversionservice import AudioConversionService
from filesyste... | 43.295455 | 135 | 0.76378 | [
"BSD-3-Clause"
] | redmond-penguin/musicplayer | bin/convertfavourites.py | 1,905 | Python |
from pymavlink import mavutil
#import time
mavutil.set_dialect("video_monitor")
# create a connection to FMU
hoverGames = mavutil.mavlink_connection("/dev/ttymxc2", baud=921600)
# wait for the heartbeat message to find the system id
hoverGames.wait_heartbeat()
print("Heartbeat from system (system %u component %u... | 30.742857 | 112 | 0.643123 | [
"BSD-3-Clause"
] | dmdobrea/HoverGames_Challenge2 | 02_commCustom/receiveCustomMavlinkMSG.py | 1,076 | Python |
import numpy as np
from .utils import make_dir
class Evaluater(object):
def __init__(self, logger, size, original_size, tag='paper_figure'):
self.pixel_spaceing = 0.1
self.tag = tag
make_dir(tag)
self.tag += '/'
self.logger = logger
self.scale_rate_y ... | 37.300885 | 86 | 0.530724 | [
"Apache-2.0"
] | Curli-quan/oneshot-medical-landmark | utils/eval.py | 4,215 | Python |
# Copyright 2012 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... | 45.637703 | 79 | 0.639635 | [
"Apache-2.0"
] | AurelienLourot/tempest | tempest/api/compute/base.py | 30,988 | Python |
"""Script that generates a refresh token for a specific user."""
import os
import sys
import spotipy.util as util
import json
if len(sys.argv) == 2:
username = str(sys.argv[1])
else:
print('Usage: {} username'.format(sys.argv[0]))
sys.exit(1)
scope = 'user-read-currently-playing user-read-playback-state... | 24.923077 | 77 | 0.699074 | [
"MIT"
] | Georgej5/Colorfy | spotify_setup.py | 648 | Python |
from sdklib.http import HttpSdk
class SampleHttpsHttpSdk(HttpSdk):
DEFAULT_HOST = "https://www.google.com"
API_IVANPRJCTS_PATH = "/ivanprjcts"
def get_ivanprjcts(self):
return self.get(self.API_IVANPRJCTS_PATH)
| 19.666667 | 49 | 0.728814 | [
"BSD-2-Clause"
] | ivanprjcts/sdklib | tests/sample_sdk_https.py | 236 | Python |
from django.forms import ModelForm
from .models import Post, Comment
from loginsignup.utils import getBeaverInstance
class PostForm(ModelForm):
class Meta:
model = Post
exclude = ["likes", "posted_on", "post_creator"]
def checkPost(self, request):
if self.is_valid():
post ... | 26.176471 | 64 | 0.602247 | [
"MIT"
] | BastaAditya/Quiver | Quiver/posts/forms.py | 890 | Python |
'''
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answer does not exist, return -1.0.
Example:
Given a / b = 2.0, b / c = 3.0.
queries are: a / c = ?, b / a = ?, a / e = ?, ... | 35.566265 | 240 | 0.542005 | [
"BSD-3-Clause"
] | shub0/algorithm-data-structure | python/evaluate_division.py | 2,952 | Python |
# -*- coding: utf-8 -*-
import hmac
import requests
from json import dumps
from hashlib import sha1
from .app import api, env
def match_any_if_any(event, events):
return events is None or event in events
class Subscription:
def __init__(self, data):
self.data = data
self.events = data['dat... | 26.78 | 76 | 0.590739 | [
"MIT"
] | adnrs96/github | app/webhooks.py | 2,678 | Python |
import json
import requests
from cklib.args import ArgumentParser
from cklib.logging import log
from cklib.jwt import encode_jwt_to_headers
from cklib.graph import Graph, GraphExportIterator
def send_to_ckcore(graph: Graph):
if not ArgumentParser.args.ckcore_uri:
return
log.info("ckcore Event Handler... | 32.096774 | 82 | 0.654271 | [
"Apache-2.0"
] | mesosphere/cloudkeeper | ckworker/ckworker/ckcore.py | 3,980 | Python |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 38.240602 | 78 | 0.624853 | [
"Apache-2.0"
] | TeutoNet/openstacksdk | openstack/message/v2/queue.py | 5,086 | Python |
from dataclasses import dataclass, field
__NAMESPACE__ = "NISTSchema-SV-IV-union-short-gYear-pattern-3-NS"
@dataclass
class NistschemaSvIvUnionShortGYearPattern3:
class Meta:
name = "NISTSchema-SV-IV-union-short-gYear-pattern-3"
namespace = "NISTSchema-SV-IV-union-short-gYear-pattern-3-NS"
v... | 23.777778 | 69 | 0.64486 | [
"MIT"
] | tefra/xsdata-w3c-tests | output/models/nist_data/union/short_g_year/schema_instance/nistschema_sv_iv_union_short_g_year_pattern_3_xsd/nistschema_sv_iv_union_short_g_year_pattern_3.py | 428 | Python |
''' setup module
'''
from distutils.core import setup
# TEMPLATE
setup(
name='mask-query-aide',
version='0.0',
description='python code to train ML for detecting people with masks',
long_description=open('README.rst').read(),
author='Christine Madden',
license=open('LICENSE').read(),
autho... | 23.166667 | 74 | 0.570743 | [
"MIT"
] | usckiki82/mask-query-aide | setup.py | 834 | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import numpy as np
__all__ = ["Config"]
class Config(object):
"""
Config: Holds configuration settings.
Parameters
----------
fitParameters : list
Parameters to fit.
parameterPriors : dict
Dictionary with parameters as keys, and ... | 28.180328 | 91 | 0.513962 | [
"BSD-3-Clause"
] | moeyensj/atm | atm/config.py | 3,438 | Python |
from attr import dataclass
#s4 teng https://t.me/shuraim1/https:/
#S5 teng https://t.me/alquran30juzsaadalghamidi/5
#s6 teng https://t.me/bandar_abdulaziz_balilah/5
#s7 teng https://t.me/Idriss_Akbar/388
#s8 teng https://t.me/yasseraldosari_mp3/2
sura = {
'0': {'s1':'42', 's2':'257', 's3':'18', 's4':... | 74.244444 | 112 | 0.348623 | [
"BSD-2-Clause"
] | SarvarRaxmonov/december-2 | pipuchun/jsonuz.py | 13,364 | Python |
a, b = raw_input().split()
a = int(a)
b = int(b)
if b > a:
print(b)
else:
print(a)1 | 11.625 | 27 | 0.505376 | [
"MIT"
] | KelwinKomka/URI | src/UOJ_1933 - (3425561) Accepted.py | 93 | Python |
#!/usr/bin/python2
import re, sys
from pygments import highlight
from pygments.lexers import get_lexer_by_name, JavascriptLexer, FactorLexer
from pygments.formatters import HtmlFormatter
from pygments.token import *
from pygments.lexer import RegexLexer
class UnlambdaLexer(RegexLexer):
name = 'Unlambda'
aliases =... | 30.744898 | 324 | 0.578659 | [
"MIT"
] | 1930sc/repl.it | pyg.py | 6,026 | Python |
# Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 35.155393 | 80 | 0.663599 | [
"Apache-2.0"
] | zhoudoufu/lingvo | lingvo/core/conv_layers_with_time_padding.py | 19,230 | Python |
import torch
from recstudio.ann import sampler
from recstudio.data import dataset
from recstudio.model import basemodel, loss_func, scorer
r"""
HGN
########
Paper Reference:
Chen ma, et al. "HGN: Hierarchical Gating Networks for Sequential Recommendation" in KDD2019.
https://dl.acm.org/doi/abs/10.1145/3292500... | 36.797297 | 120 | 0.662505 | [
"MIT"
] | ustc-recsys/Torchrec | recstudio/model/seq/hgn.py | 2,723 | Python |
import time
import board
import debouncer
import busio as io
import digitalio
import pulseio
import adafruit_ssd1306
i2c = io.I2C(board.SCL, board.SDA)
reset_pin = digitalio.DigitalInOut(board.D11)
oled = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=reset_pin)
button_select = debouncer.Debouncer(board.D7, mode=dig... | 41.433333 | 185 | 0.448914 | [
"MIT"
] | ChrisKuhi/Adafruit_Learning_System_Guides | CircuitPython_101/basic_data_structures/song_book/code.py | 3,729 | Python |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-23 18:07
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('voting', '0002_auto_20170223_1054'),
]
operations = [
migrations.RemoveField(... | 35.433333 | 312 | 0.594544 | [
"MIT"
] | TexasLAN/texaslan.org | texaslan/voting/migrations/0003_auto_20170223_1207.py | 1,063 | Python |
#!/usr/bin/env python3
# Copyright (c) 2017-2020 The Mantle Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool acceptance of raw transactions."""
from decimal import Decimal
from io import BytesIO
impo... | 48.050296 | 154 | 0.634382 | [
"MIT"
] | Mantle-One/mantlecoin | test/functional/mempool_accept.py | 16,241 | Python |
#!/usr/bin/env python
import os
import sys
import argparse
import subprocess
import glob
import math
from EMAN2 import *
def file_base(movie):
# return the filename and basename, exclude '.p3'
return movie, os.path.basename(os.path.splitext(movie)[0]).replace('.p3', '')
def check(log,c_p):
with open(log) as log_r... | 41.092199 | 214 | 0.654298 | [
"MIT"
] | emkailu/PAT3DEM | bin/p3motioncor2.py | 5,794 | Python |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'tables/$', views.report_tables, name='tables'),
url(r'^api/stop_enforcement/', views.stop_enforcement_json_view, name='stop_enforcement'),
url(r'^api/residency/', views.resident_json_view, name='residency'),
url(r'^api/nature_of... | 62.157895 | 100 | 0.751058 | [
"MIT"
] | CT-Data-Collaborative/ctrp3_v2 | ctrp3_py3/reports/urls.py | 1,181 | Python |
"""
Copyright (c) 2018 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 in wri... | 35.733333 | 99 | 0.785448 | [
"Apache-2.0"
] | AlexeyAB/dldt | model-optimizer/mo/front/kaldi/extractors/affine_component_ext.py | 1,072 | Python |
# import unittest
import pytest
# from ci_testing_python.app.identidock import app
if __name__ == '__main__':
# unittest.main()
pytest.main()
| 14.7 | 50 | 0.741497 | [
"MIT"
] | anirbanroydas/MChat-Mosquitto-MQTT | tests/contract/test_contract_identidock.py | 147 | Python |
def solve(n):
a = []
for _ in range(n):
name, h = input().split()
h = float(h)
a.append((name, h))
a.sort(key = lambda t: t[1], reverse=True)
m = a[0][1]
for n, h in a:
if h != m: break
print(n, end = " ")
print()
while True:
n = int(input())
if ... | 18.473684 | 46 | 0.433048 | [
"MIT"
] | honux77/algorithm | prompt412/round-101/c.py | 351 | Python |
import numpy as np
import matplotlib.pyplot as plt
import time
import csv
import os
import scipy.io as mat4py
import logging
logger = logging.getLogger("logger")
class ResultBuffer(object):
def __init__(self, log_path, episode_types):
self.log_path = log_path
self.current_episode = None
s... | 41.651064 | 135 | 0.581324 | [
"MIT"
] | zivaharoni/capacity-rl | result_buffer.py | 9,788 | Python |
"""Import a file from Illumina BaseSpace."""
import atexit
import gzip
import os
import time
import traceback
from pathlib import Path
from requests import RequestException, Session
from resolwe.process import (
BooleanField,
FileField,
GroupField,
IntegerField,
Persistence,
Process,
Secr... | 31.376812 | 95 | 0.588337 | [
"Apache-2.0"
] | plojyon/resolwe-bio | resolwe_bio/processes/import_data/basespace.py | 8,660 | Python |
from kafka import KafkaProducer
from kafka import KafkaConsumer
from kafka import KafkaAdminClient
import json
from json import dumps
from json import loads
import time
import os
import requests
import sys
import GE_GSCH_low_define as lowDefine
'''
{'requestID': 'req-f6720a0e-e3df-455a-825d-f8c80cedc2d9',
'date': '... | 40.507407 | 161 | 0.540642 | [
"Apache-2.0"
] | gedge-platform/GEdge-Platform | gs-scheduler/global_scheduler2/policy_dockerfile/lowlatency/GE_GSCH_low_latency.py | 10,937 | Python |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__al... | 43.629139 | 224 | 0.713418 | [
"Apache-2.0"
] | pulumi/pulumi-azure-nextgen | sdk/python/pulumi_azure_nextgen/servicebus/list_topic_keys.py | 6,588 | Python |
"""
Base backend
Trace and Database classes from the other modules should Subclass the base
classes.
"""
import PyMC2
class Trace(object):
"""Dummy Trace class.
"""
def __init__(self,value=None, obj=None):
"""Assign an initial value and an internal PyMC object."""
self._trace = val... | 31.008264 | 86 | 0.559701 | [
"Apache-2.0"
] | rsumner31/pymc3-23 | PyMC2/database/base.py | 3,752 | Python |
from utils import TreeNode, binary_tree
class Solution:
def __init__(self):
self.index = 0 # 利用[中序遍历左边元素数量 = 左子树节点总数]可以省掉这个计数的字段
def buildTree(self, preorder, inorder):
"""
:type preorder: List[int]
:type inorder: List[int]
:rtype: TreeNode
"""
if not preorder:
return None
def build_node(lo, h... | 26 | 83 | 0.642857 | [
"MIT"
] | Kaciras/leetcode | medium/Q105_ConstructBinaryTreeFromPreorderAndInorderTraversal.py | 1,016 | Python |
#
# Copyright (c) 2019, 2021 by Delphix. All rights reserved.
#
import dlpx.virtualization.api
from dlpx.virtualization.common.util import to_str
def get_virtualization_api_version():
"""Returns the Virutalization API version string.
:return: version string
"""
return to_str(dlpx.virtualization.api._... | 23.714286 | 59 | 0.756024 | [
"Apache-2.0"
] | Balamuruhan/virtualization-sdk | platform/src/main/python/dlpx/virtualization/platform/util.py | 332 | Python |
# -*- coding: utf-8 -*-
from ..base import Property
from .array import StateVector
from .base import Type
class Particle(Type):
"""
Particle type
A particle type which contains a state and weight
"""
state_vector: StateVector = Property(doc="State vector")
weight: float = Property(doc='Weigh... | 29.321429 | 82 | 0.666261 | [
"MIT"
] | 0sm1um/Stone-Soup | stonesoup/types/particle.py | 821 | Python |
from heapq import heappush, nsmallest
import numpy as np
class NearestNeighbor():
def __init__(self, embeddings, encodings, config):
self.embeddings = embeddings
self.encodings = encodings
self.config = config
def euclidian_distance(self, e1, e2):
'''
https://stackoverf... | 34.868421 | 107 | 0.644528 | [
"MIT"
] | bi3mer/Word2Vec | Word2Vec/NearestNeighbor.py | 1,325 | Python |
# Copyright (c) 2013, igrekus and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from dc_plc.custom.utils import add_completeness, add_query_relevance
from dc_plc.controllers.stats_query import get_procmap_stats
def execute(f... | 21.609756 | 85 | 0.749436 | [
"MIT"
] | igrekus/dc_plc | dc_plc/dc_plc/report/dc_product_procmap_stats/dc_product_procmap_stats.py | 886 | Python |
un = 0
re = 0
gramo = 0
mientras que es cierto :
numero = int ( entrada ( "" ))
si ( numero == 4 ):
descanso
si ( numero == 1 ):
un = un + 1
elif ( numero == 2 ):
re = re + 1
elif ( numero == 3 ):
gramo = gramo + 1
elif ( numero == 4 ):
de... | 24.470588 | 88 | 0.435096 | [
"MIT"
] | Davidpadilla1234/Taller-de-Estrucuras-de-Control-Repeticion | Taller-de-Estrucuras-de-Control-Repeticion/ejercicio 9.py | 416 | Python |
# module for distance computation;
import numpy as np
def dist(arraya, arrayb, mode):
if mode == 0:
dis = np.sum(np.abs(np.subtract(arraya, arrayb)))
elif mode == 1:
dis = np.sqrt(np.sum(np.power(np.subtract(arraya, arrayb), 2)))
else:
dis = 1 - np.dot(arraya, arrayb) / np.sqrt(np.s... | 35.444444 | 109 | 0.619122 | [
"MIT"
] | Lan-Jing/Courses | DCS311 Artificial Intelligence/KNN/lab1_code/M3/dist.py | 638 | Python |
"""Run CVEjob."""
import sys
from decimal import Decimal
import multiprocessing
import nvdlib
from nvdlib.manager import FeedManager
from nvdlib.query_selectors import in_range
from cvejob.filters.input import validate_cve
from cvejob.config import Config
from cvejob.identifiers import get_identifier_cls
from cvejob... | 29.666667 | 88 | 0.582496 | [
"Apache-2.0"
] | jparsai/cvejob | run.py | 6,764 | Python |
# This file is generated by C:\projects\numpy-wheels\numpy\setup.py
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
blas_opt_info={'library_dirs': ['C:\\projects\\numpy-wheels\\windows-wheel-builder\\atlas-builds\\atlas-3.11.38-sse2-64\\lib'], 'language': 'c', ... | 62 | 263 | 0.609566 | [
"CC0-1.0"
] | CSnap/photogate | python-3.4.4.amd64/Lib/site-packages/numpy/__config__.py | 1,798 | Python |
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import functools
import logging
from os import path
import boto3
import jsonschema
from c7n_mailer import deploy, utils
from c7n_mailer.azure_mailer.azure_queue_processor import MailerAzureQueueProcessor
from c7n_mailer... | 37.527344 | 100 | 0.575518 | [
"Apache-2.0"
] | CU-CommunityApps/cloud-custodian | tools/c7n_mailer/c7n_mailer/cli.py | 9,607 | Python |
from sklearn.exceptions import NotFittedError
class MockFunction:
"""
Mock utility function for testing.
"""
def __init__(self, return_val):
self.return_val = return_val
def __call__(self, *args):
return self.return_val
class MockEstimator:
"""
Mock classifier object for... | 25.963768 | 109 | 0.640246 | [
"MIT"
] | AlexandreAbraham/modAL | tests/mock.py | 3,583 | Python |
class InkCanvasEditingMode(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the editing mode for the System.Windows.Controls.InkCanvas
enum InkCanvasEditingMode,values: EraseByPoint (5),EraseByStroke (6),GestureOnly (2),Ink (1),InkAndGesture (3),None (0),Select (4)
"""
def __eq__(self,*args):... | 27.902439 | 215 | 0.682692 | [
"MIT"
] | BCSharp/ironpython-stubs | release/stubs.min/System/Windows/Controls/__init___parts/InkCanvasEditingMode.py | 1,144 | Python |
#!/usr/bin/env python
from itertools import izip
import xmlrpclib
import rospy
from rospy.rostime import Time, Duration
from flexbe_core import EventState as Dummy
from flexbe_core import Logger
from flexbe_core.proxy import ProxyPublisher, ProxySubscriberCached, ProxyActionClient
from sensor_msgs.msg import JointSt... | 42.273438 | 145 | 0.656441 | [
"BSD-3-Clause"
] | sweetie-bot-project/sweetie_bot_flexbe_behaviors | sweetie_bot_flexbe_states/src/sweetie_bot_flexbe_states/internal/set_joint_state_base.py | 5,411 | Python |
import logging
import asyncio
from steam.ext.csgo import Client
from steam.ext.csgo.enums import Language
from steam.ext.csgo.backpack import BaseInspectedItem
from steam.protobufs import GCMsgProto, EMsg, MsgProto
from steam.protobufs.client_server import CMsgClientLicenseListLicense
from steam_tradeoffer_manager.ba... | 22.704819 | 120 | 0.613425 | [
"MIT"
] | somespecialone/clever-inspect | app/services/pool/pool.py | 3,769 | Python |
import numpy as np
class Reward:
pass
class StaticReward(Reward):
def __init__(self, value):
self.value = value
def get(self):
return value
class NormalReward(Reward):
def __init__(self, mean, std):
self.mean = mean
self.std = std
def get(self):
return np.random.normal(self.mean, self.std)
class Ba... | 19 | 67 | 0.634624 | [
"MIT"
] | ronaldosvieira/rl | main.py | 2,299 | Python |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 27.633929 | 105 | 0.53958 | [
"BSD-2-Clause"
] | Flav-STOR-WL/py-pure-client | pypureclient/flasharray/FA_2_2/models/username.py | 3,095 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=39
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... | 36.127907 | 77 | 0.679112 | [
"BSD-3-Clause"
] | UCLA-SEAL/QDiff | benchmark/startCirq2615.py | 3,107 | Python |
import simulations.simulation as simulation
import simulations.simulation_runner as simrunner
import cPickle
import os
import random
import re
import string
import subprocess
import sys
from simulations.utils.optionparser import OptionParser
from nose.tools import assert_equal
from nose.tools import assert_raises
de... | 41.625397 | 171 | 0.616306 | [
"MIT"
] | gsmcwhirter/simulations | test/simulation_tests.py | 13,112 | Python |
"""Support for Blockchain.com sensors."""
from datetime import timedelta
import logging
from pyblockchain import get_balance, validate_address
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
import homeassistant.helpers.c... | 26.453488 | 77 | 0.688791 | [
"Apache-2.0"
] | CantankerousBullMoose/core | homeassistant/components/blockchain/sensor.py | 2,275 | Python |
from typing import Any
from copy import deepcopy
class Model:
def __init__(self, name: str, model, freq: str):
self.name = name
self.model = model
self.freq = freq
self.train = None
self.test = None
self.prediction = None
self.pred_col = "prediction"
... | 27.612245 | 92 | 0.597931 | [
"MIT"
] | MiguelMque/eafit-numerical-analysis-project | interpolML/interpolML/model/model.py | 1,353 | Python |
#!/usr/bin/python
# https://practice.geeksforgeeks.org/problems/knapsack-with-duplicate-items/0
def sol(n, w, wt, v):
"""
We do not need to create a 2d array here because all numbers are available
always
Try all items for weight ranging from 1 to w and check if weight
can be picked. Take the max of... | 30.941176 | 78 | 0.587452 | [
"Apache-2.0"
] | vikas-t/DS-Algo | full-problems/knapsackWithDuplicates.py | 526 | Python |
# -*- coding: utf-8 -*-
from .amount import Amount
from .instance import BlockchainInstance
from graphenecommon.account import (
Account as GrapheneAccount,
AccountUpdate as GrapheneAccountUpdate,
)
from bitsharesbase import operations
@BlockchainInstance.inject
class Account(GrapheneAccount):
"""
Thi... | 29.729167 | 87 | 0.662929 | [
"MIT"
] | bangzi1001/python-nbs | bitshares/account.py | 2,854 | Python |
"""BGEN reader implementation (using bgen_reader)"""
import logging
import tempfile
import time
from pathlib import Path
from typing import (
Any,
Dict,
Hashable,
List,
Mapping,
MutableMapping,
Optional,
Tuple,
Union,
)
import dask
import dask.array as da
import dask.dataframe as dd... | 36.959083 | 113 | 0.64299 | [
"Apache-2.0"
] | pystatgen/sgk | sgkit/io/bgen/bgen_reader.py | 22,582 | Python |
import inspect
import os
import pyperclip
import requests
import time
from urllib.parse import quote
# a list of the request error classes
request_errors = [obj for name, obj in inspect.getmembers(requests.exceptions)
if inspect.isclass(obj) and issubclass(obj, Exception)]
# main daemon loop
while Tr... | 34.972973 | 78 | 0.629057 | [
"MIT"
] | lawja/AutoSHRTNR | autoshort.py | 1,294 | Python |
# source ./venv/bin/activate
# ===============================================================
# =============================COOL==============================
# ===============================================================
import sys
from general import errors
# import os
# basedir = os.path.abspath(os... | 34.423841 | 111 | 0.50808 | [
"MIT"
] | harry1911/CoolCompiler | src/coolc.py | 5,198 | Python |
import os
from griddly import GymWrapperFactory, gd, GymWrapper
from griddly.RenderTools import VideoRecorder, RenderToFile
if __name__ == "__main__":
wrapper = GymWrapperFactory()
name = "projectiles_env"
current_path = os.path.dirname(os.path.realpath(__file__))
env = GymWrapper(
"health_ba... | 30.418605 | 78 | 0.700306 | [
"MIT"
] | Thaigun/Griddly | python/examples/Custom Shaders/Health Bars/main.py | 1,308 | Python |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.032258 | 89 | 0.675958 | [
"Apache-2.0"
] | Ctfbuster/python-compute | google/cloud/compute_v1/services/target_instances/pagers.py | 5,740 | Python |
import argparse
import sys, os
import logging
from utils.misc import ArgParseDefault, add_bool_arg
USAGE_DESC = """
python main.py <command> [<args>]
Available commands:
init Initialize project
sync Sync project data from S3
parse Preprocessing of data to generate `/data/1_par... | 85.954545 | 327 | 0.708554 | [
"MIT"
] | crowdbreaks/preprocess | main.py | 15,128 | Python |
import os
import subprocess
from tempfile import NamedTemporaryFile
from torch.distributed import get_rank
from torch.distributed import get_world_size
from torch.utils.data.sampler import Sampler
import librosa
import numpy as np
import scipy.signal
import torch
from scipy.io.wavfile import read
import math
from tor... | 39.149051 | 127 | 0.631524 | [
"MIT"
] | ShuanDeMorian/deepspeech.pytorch | data/data_loader.py | 14,446 | Python |
# -*- coding: utf8 -*-
def filter_event(event, happening_before):
"""Check if the following keys are present. These
keys only show up when using the API. If fetching
from the iCal, JSON, or RSS feeds it will just compare
the dates
"""
status = True
visibility = True
actions = True
... | 28.304348 | 60 | 0.6298 | [
"MIT"
] | OpenTwinCities/site_bot | app/Meetup/Filter.py | 651 | Python |
import csv
from pathlib import Path
import torch
import pandas
import numpy as np
from utils import peek, load_json, dump_json
from .module import ContrastiveModule
from mps import distributed as du
from save import format_rows
def get_penultimates(keys):
penultimates = {}
for key in keys:
view = ke... | 39.692607 | 121 | 0.605921 | [
"MIT"
] | JiwanChung/acav100m | subset_selection/code/measures/contrastive/contrastive.py | 10,201 | Python |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test pricecoind with different proxy configuration.
Test plan:
- Start pricecoind's with different pro... | 41.366337 | 121 | 0.625299 | [
"MIT"
] | barrystyle/Pricecoin | test/functional/feature_proxy.py | 8,356 | Python |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2021 Showa Denko Materials co., Ltd. All rights reserved.
This software is for non-profit use only.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PU... | 34.875 | 121 | 0.673835 | [
"MIT",
"Unlicense"
] | wilsongis/3DP_Experiments | Samples/codes/matopt_review/add_objective.py | 2,232 | Python |
"""
Given a rod of length n inches and an array of prices
that includes prices of all pieces of size smaller than n.
Determine the maximum value obtainable by cutting up the rod and
selling the pieces. For example, if the length of the rod is 8
and the values of different pieces are given as the following,
then the... | 27.463415 | 86 | 0.55595 | [
"MIT"
] | Saicharan67/Interview-Coding-Questions | DynamicProgramming/UnBoundedKnapSack/RodCutting.py | 1,126 | Python |
"""Classes for validating data passed to the annotations API."""
import copy
import colander
from dateutil.parser import parse
from pyramid import i18n
from h.schemas.base import JSONSchema, ValidationError
from h.search.query import LIMIT_DEFAULT, LIMIT_MAX, OFFSET_MAX
from h.search.util import wildcard_uri_is_valid... | 35.168122 | 101 | 0.562488 | [
"BSD-2-Clause"
] | bibliotechie/h | h/schemas/annotation.py | 16,107 | Python |
import tensorflow as tf
import tensorflow_zero_out
import numpy as np
import os
# Create a model using low-level tf.* APIs
class ZeroOut(tf.Module):
@tf.function(input_signature=[tf.TensorSpec(shape=[None], dtype=tf.int32)])
def __call__(self, x):
return tensorflow_zero_out.zero_out(x)
model = ZeroOut()
# (ro... | 38 | 80 | 0.722222 | [
"Apache-2.0"
] | yuko29/TF_custom_op | tensorflow_zero_out/python/ops/convert_to_tflite.py | 1,026 | Python |
# -*- coding: utf-8 -*-
#
# Author: oldj
# Email: oldj.wu@gmail.com
# Blog: http://oldj.net
#
import os
import re
import StringIO
from PIL import Image
from PIL import ImageDraw
import pygame
g_script_folder = os.path.dirname(os.path.abspath(__file__))
g_fonts_folder = os.path.join(g_script_folder, "fonts")
g_re_fir... | 24.259146 | 113 | 0.544803 | [
"Apache-2.0"
] | bopopescu/dockerizeme | hard-gists/9c4d012d6fff059ccea7/snippet.py | 8,249 | Python |
###
# (C) Copyright [2019-2020] Hewlett Packard Enterprise Development LP
#
# 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 ... | 26.974194 | 104 | 0.702464 | [
"Apache-2.0"
] | simplivity/simplivity-python | examples/policies.py | 4,181 | Python |
# Copyright 2014-2016 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 27.140845 | 78 | 0.704203 | [
"Apache-2.0"
] | smurfix/motor | motor/frameworks/tornado/__init__.py | 3,854 | Python |
# -*- coding: utf-8 -*-
"""Collection of useful http error for the Api"""
class JsonApiException(Exception):
"""Base exception class for unknown errors"""
title = "Unknown error"
status = "500"
source = None
def __init__(
self,
detail,
source=None,
title=None,
... | 24.93617 | 116 | 0.625711 | [
"MIT"
] | Leechael/flapison | flapison/exceptions.py | 3,516 | Python |
import argparse
import logging
import json
import os
import tempfile
import sys
import re
import flywheel
from .supporting_files import bidsify_flywheel, utils, templates
from .supporting_files.project_tree import get_project_tree
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('curate-bids')
def... | 36.82197 | 136 | 0.640778 | [
"MIT"
] | AndysWorth/bids-client | flywheel_bids/curate_bids.py | 9,721 | Python |
class PlayerResourceHand:
def __init__(self):
self.brick = 0
self.grain = 0
self.lumber = 0
self.ore = 0
self.wool = 0
self.totalResources = 0
def update(self):
self.totalResources = self.brick + self.grain + self.lumber + self.ore + self.wool
class Pla... | 32.337209 | 117 | 0.607695 | [
"MIT"
] | ForgedSnow/Frontiersman | src/Player.py | 2,781 | Python |
import httpx
from anilist.types import Anime
from pyrogram import filters
from pyrogram.types import CallbackQuery
from pyromod.helpers import ikb
from pyromod.nav import Pagination
from amime.amime import Amime
@Amime.on_callback_query(filters.regex(r"^tvshort_trending7 anime (?P<page>\d+)"))
async def anime_sugges... | 32.27027 | 105 | 0.490787 | [
"MIT"
] | Myudi422/ccgnime_req | amime/modules/anime/TV-SHORT/tvshort_trend/TVSHORT_TREND/tvshort_trend7.py | 2,388 | Python |
from typing import Optional
import pandas as pd
import pytest
from evidently.analyzers.regression_performance_analyzer import RegressionPerformanceAnalyzer
from evidently.model.widget import BaseWidgetInfo
from evidently.options import OptionsProvider
from evidently.pipeline.column_mapping import ColumnMapping
from ... | 33.310811 | 101 | 0.696552 | [
"Apache-2.0"
] | Tapot/evidently | tests/dashboard/widgets/test_reg_error_normality_widget.py | 2,465 | Python |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/faction_perk/hq/shared_hq_s05.iff"
result.attribute_template_i... | 25.941176 | 75 | 0.721088 | [
"MIT"
] | SWGANHServices/GameServer_Legacy | data/scripts/templates/object/tangible/deed/faction_perk/hq/shared_hq_s05.py | 441 | Python |
# -*- coding: utf-8 -*-
import unittest.mock
import pytest
import pycamunda.incident
from tests.mock import raise_requests_exception_mock, not_ok_response_mock
def test_get_params(engine_url):
get_incident = pycamunda.incident.Get(url=engine_url, id_='anId')
assert get_incident.url == engine_url + '/incid... | 34.796296 | 83 | 0.77009 | [
"MIT"
] | asyncee/pycamunda | tests/incident/test_get.py | 1,879 | Python |
import uuid
from datetime import datetime, timedelta
import pytest
import simplejson as json
from django.db.models import Q
from mock import Mock, patch
from treeherder.config.settings import IS_WINDOWS
from treeherder.perf.auto_perf_sheriffing.secretary_tool import SecretaryTool
from treeherder.model.models import P... | 38.198502 | 98 | 0.761055 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | aerickson/treeherder | tests/perfalert/test_auto_perf_sheriffing/test_secretary_tool.py | 10,199 | Python |
#!/usr/bin/env python3
# This scripts attempts to generate massive design of experiment runscripts.
# and save it into a "runMassive.sh" and "doe.log".
#-------------------------------------------------------------------------------
import os, sys
import os.path
import re
import itertools
import glob
PUBLIC = ['... | 31.703863 | 150 | 0.648707 | [
"BSD-3-Clause"
] | ABKGroup/GenMassive | genMassive.py | 14,774 | Python |
from integration.helpers.base_test import BaseTest
class TestBasicLayerVersion(BaseTest):
"""
Basic AWS::Serverless::StateMachine tests
"""
def test_basic_state_machine_inline_definition(self):
"""
Creates a State Machine from inline definition
"""
self.create_and_veri... | 29.659091 | 77 | 0.629885 | [
"Apache-2.0"
] | faraz891/serverless-application-model | integration/single/test_basic_state_machine.py | 1,305 | Python |
from __future__ import absolute_import
from .context import *
from .base_verbs import *
from .model import OpenShiftPythonException
from .model import Model, Missing
from .selector import *
from .apiobject import *
from . import naming
from . import status
from . import config
from .ansible import ansible
# Single so... | 23.321429 | 66 | 0.777948 | [
"Apache-2.0"
] | dmaizel/openshift-client-python | packages/openshift/__init__.py | 653 | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test attention
"""
import unittest
import torch
from torch import tensor
from torch import nn
from function_GAT_attention import SpGraphAttentionLayer, ODEFuncAtt
from torch_geometric.utils import softmax, to_dense_adj
from data import get_dataset
class AttentionTests... | 44.326531 | 113 | 0.67058 | [
"Apache-2.0"
] | dungxibo123/graph-neural-pde | test/test_attention.py | 4,344 | Python |
"""Platform for Husqvarna Automower device tracker integration."""
from homeassistant.components.device_tracker import SOURCE_TYPE_GPS
from homeassistant.components.device_tracker.config_entry import TrackerEntity
from homeassistant.helpers.entity import DeviceInfo
from .const import DOMAIN
async def async_s... | 33.402985 | 87 | 0.645666 | [
"MIT"
] | kalhimeo/husqvarna_automower | custom_components/husqvarna_automower/device_tracker.py | 2,238 | Python |
import django
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portfolio.settings')
django.setup()
import base64
import tempfile
from django.test import TestCase, override_settings
from portfolio.portfolio_projects.forms import CommentForm, ProjectForm
from django.core.files.uploadedfile import ... | 45.12 | 76 | 0.843085 | [
"MIT"
] | Dafov/portfolio | tests/portfolio_projects/forms_test.py | 4,512 | Python |
import pytest
import numpy as np
import pandas as pd
from skippa import columns
from skippa.transformers.sklearn import(
SkippaSimpleImputer,
SkippaStandardScaler,
SkippaMinMaxScaler,
SkippaOneHotEncoder,
SkippaLabelEncoder,
SkippaOrdinalEncoder,
SkippaPCA
)
from skippa.utils import get_dum... | 30.60241 | 88 | 0.692913 | [
"BSD-3-Clause"
] | data-science-lab-amsterdam/skippa | tests/test_sklearn.py | 2,540 | Python |
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import argparse
from RouToolPa.Parsers.VCF import CollectionVCF
from MACE.Routines import StatsVCF, Visualization
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input_file", action="store", dest="input", required=True,
help="In... | 51.903846 | 110 | 0.593183 | [
"Apache-2.0"
] | mahajrod/MACE | scripts/count_singletons.py | 2,699 | Python |
# _*_ coding: utf-8 _*_
__author__ = 'Di Meng'
__date__ = '1/3/2018 10:16 PM'
# _*_ coding: utf-8 _*_
__author__ = 'Di Meng'
__date__ = '1/3/2018 9:26 PM'
from tutorial.feature_functions import *
import pandas as pd
import plotly as py
import json
from plotly import tools
import plotly.graph_objs as go
#loading our... | 23.546875 | 106 | 0.696085 | [
"MIT"
] | leonsariel/python | finance/tutorial/tester.py | 1,507 | Python |
#!/usr/bin/env python3
"""Run AFL repeatedly with externally supplied generated packet from STDIN."""
import logging
import sys
from ryu.controller import dpset
from faucet import faucet
from faucet import faucet_experimental_api
import afl
import fake_packet
ROUNDS = 1
logging.disable(logging.CRITICAL)
def main()... | 28.403846 | 94 | 0.67434 | [
"Apache-2.0"
] | 1ndochine/faucet | tests/fuzzer/fuzz_packet.py | 1,477 | Python |
import os
from connexion import App
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
basedir = os.path.abspath(os.path.dirname(__file__))
conn = App(__name__, specification_dir='./')
app = conn.app
postgres_url = 'postgres://postgres:docker@10.5.95.65:54320/web_service_db'
app.conf... | 25.464286 | 75 | 0.760168 | [
"MIT"
] | celinekeisja/capstone | web_service/config.py | 713 | Python |
import logging
import warnings
lcb_min_version_baseline = (2, 9, 0)
def get_lcb_min_version():
result = lcb_min_version_baseline
try:
# check the version listed in README.rst isn't greater than lcb_min_version
# bump it up to the specified version if it is
import docutils.parsers.rst
... | 38.46875 | 118 | 0.656377 | [
"Apache-2.0"
] | griels/couchbase-python-client-ng | lcb_version.py | 1,231 | Python |
# Generated by Django 2.2.5 on 2019-11-10 02:46
from django.db import migrations
import django.db.models.deletion
import smart_selects.db_fields
class Migration(migrations.Migration):
dependencies = [
('main_site', '0014_auto_20191109_2038'),
]
operations = [
migrations.AlterField(
... | 36.230769 | 215 | 0.687898 | [
"MIT"
] | Javen17/plants_api | plants_api/main_site/migrations/0015_auto_20191109_2046.py | 944 | Python |
from graphene import ObjectType, String, Schema
class ExampleQuery(ObjectType):
hello = String()
def resolve_hello(self):
return "Hello"
class RootQuery(ExampleQuery, ObjectType):
pass
schema = Schema(query=RootQuery) | 16.266667 | 47 | 0.717213 | [
"MIT"
] | jehalladay/React-Playground | demo/graphQLDemos/spacy/schema.py | 244 | Python |
import requests
import json
from datetime import datetime, timezone
from . utils import _extract_videos_necessary_details, _save_video_detils_in_db
from .models import ApiKeys
from . import config
def _get_api_key(): #getting different key w.r.t last used every time cron job starts.(load balanced)
new_key = ApiKe... | 37.689655 | 101 | 0.755718 | [
"MIT"
] | aryamaan98/Youtube-Data-API-Integration | youtubeDataApi/searchApi/cron.py | 1,093 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.