max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
syft_proto/execution/v1/protocol_pb2.py | karlhigley/syft-proto | 0 | 39200 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: syft_proto/execution/v1/protocol.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import sym... | 1.25 | 1 |
ndn_python_repo/clients/delete.py | daniel-achee/ndn-python-repo-replication | 0 | 39201 | # -----------------------------------------------------------------------------
# NDN Repo delete client.
#
# @Author <EMAIL>
# @Date 2019-09-26
# -----------------------------------------------------------------------------
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import argparse
im... | 2.0625 | 2 |
watchmate_v2.0.1/app/models.py | rroy11705/Rest_API_With_Django | 0 | 39202 | <reponame>rroy11705/Rest_API_With_Django<gh_stars>0
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.contrib.auth.models import User
class StreamPlatform(models.Model):
name = models.CharField(max_length=64)
about = models.TextField(max_length=51... | 2.28125 | 2 |
junk-test/junk-cable.py | SanjibSarkarU/EDRC | 0 | 39203 | import threading
import datetime
import serial
import functions
from queue import Queue
rf_port = 'COM4'
ser_rf = serial.Serial(rf_port, baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=1, xonxoff=0)
iver = '3089'
send_through_rf_every = 2
def read_rf():
"""Read RF port"""
ser_rf.reset_input_bu... | 2.59375 | 3 |
experiments.py | joshsanz/learned_uncertainty | 0 | 39204 | <reponame>joshsanz/learned_uncertainty
import matplotlib
matplotlib.use('tkagg')
from matplotlib import pyplot as plt
plt.rc('figure', figsize=[10, 6])
import time
from data_models import *
from prediction_models import *
from control_models import *
def error(predicted_return, true_return):
return (predicted_r... | 2.953125 | 3 |
Python 201/enumeration.py | PacktPublishing/The-Complete-Python-Course-including-Django-Web-Framework | 3 | 39205 | animals = ["Gully", "Rhubarb", "Zephyr", "Henry"]
for index, animal in enumerate(animals):
# if index % 2 == 0:
# continue
# print(animal)
print(f"{index+1}.\t{animal}")
| 3.71875 | 4 |
openpeerpower/components/rituals_perfume_genie/__init__.py | pcaston/core | 1 | 39206 | """The Rituals Perfume Genie integration."""
from datetime import timedelta
import logging
import aiohttp
from pyrituals import Account, Diffuser
from openpeerpower.config_entries import ConfigEntry
from openpeerpower.core import OpenPeerPower
from openpeerpower.exceptions import ConfigEntryNotReady
from openpeerpowe... | 2.015625 | 2 |
GwasJP/utils/__init__.py | 2waybene/GwasJP | 0 | 39207 | # -*- coding: utf-8 -*-
"""This is utility folder that contains useful functions"""
from . import statFittings
# from .model_eval_cv_genotyped import *
| 0.984375 | 1 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/FittingAndAccessoryCalculationType.py | YKato521/ironpython-stubs | 0 | 39208 | <filename>release/stubs.min/Autodesk/Revit/DB/__init___parts/FittingAndAccessoryCalculationType.py<gh_stars>0
class FittingAndAccessoryCalculationType(Enum, IComparable, IFormattable, IConvertible):
"""
Enum of fitting and accessory pressure drop calculation type.
enum FittingAndAccessoryCalculationType... | 1.992188 | 2 |
python/dnstest/netns.py | InfrastructureServices/dnssec-trigger-testing | 1 | 39209 | <filename>python/dnstest/netns.py<gh_stars>1-10
# Network namespaces
#
# Currently best-effort functions meaning no clean up after error.
import subprocess
import re
from dnstest.error import ConfigError
def _run_ip_command(arguments):
"""
:param arguments: List of strings
:return:
"""
ret = su... | 2.59375 | 3 |
scripts/matrixlengthandisoformanalysis/raw_matrixlengthandisoformanalysis.py | serenolopezdarwin/apanalysis | 4 | 39210 | <filename>scripts/matrixlengthandisoformanalysis/raw_matrixlengthandisoformanalysis.py
import csv
import gzip
import numpy as np
import pickle as pkl
import sys
INPUT_FILE_PATH = ""
OVERLAP_PATH = "/net/shendure/vol1/home/sereno/projects/cell_clustering/nobackup/newannotations/data/overlapfiles/"
PAS_DATASET = ""
CEL... | 2.40625 | 2 |
016 3Sum Closest.py | ChiFire/legend_LeetCode | 872 | 39211 | <filename>016 3Sum Closest.py<gh_stars>100-1000
"""
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return
the sum of the three integers. You may assume that each input would have exactly one solution.
For example, given array S = {-1 2 1 -4}, an... | 4.0625 | 4 |
SENN/models.py | EdwardGuen/SENN-revisited | 0 | 39212 | # torch
import torch.nn as nn
class Senn(nn.Module):
"""Self-Explaining Neural Network (SENN)
Args:
conceptizer: conceptizer architecture
parametrizer: parametrizer architecture
aggregator: aggregator architecture
Inputs:
x: image (b, n_channels, h, w)
Returns:
... | 2.78125 | 3 |
src/pets/crud.py | nadundesilva/sample-open-telemetry | 2 | 39213 | """Copyright (c) 2021, <NAME>. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | 2.328125 | 2 |
problems/1232.py | mengshun/Leetcode | 0 | 39214 | <gh_stars>0
"""
1232. 缀点成线
在一个 XY 坐标系中有一些点,我们用数组 coordinates 来分别记录它们的坐标,
其中 coordinates[i] = [x, y] 表示横坐标为 x、纵坐标为 y 的点。
请你来判断,这些点是否在该坐标系中属于同一条直线上,是则返回 true,否则请返回 false。
"""
class XYCheck:
def __init__(self, coordinates):
self.a = self.b = 0
x1, y1 = coordinates[0]
x2, y2 = coordinates[1]
... | 3.265625 | 3 |
test/test_utils.py | scanon/execution_engine2 | 0 | 39215 | from configparser import ConfigParser
import os
from dotenv import load_dotenv
import pathlib
from shutil import copyfile
from execution_engine2.db.models.models import Job, JobInput, Meta
from dateutil import parser as dateparser
import requests
import json
from datetime import datetime
from execution_engine2.exceptio... | 2.21875 | 2 |
tests/servers/test_tcp.py | luciferliu/xTools | 2 | 39216 | # -*- coding: utf-8 -*-
import asyncio
import socket
from xTool.servers.tcp import TCPServer
def test_tcp_server(aiomisc_unused_port):
loop = asyncio.get_event_loop()
class TestTcpService(TCPServer):
DATA = []
async def handle_client(self, reader: asyncio.StreamReader,
... | 2.609375 | 3 |
backend/benefit/applications/tests/factories.py | City-of-Helsinki/kesaseteli | 2 | 39217 | import decimal
import itertools
import random
from datetime import date, timedelta
import factory
from applications.enums import ApplicationStatus, ApplicationStep, BenefitType
from applications.models import (
AhjoDecision,
Application,
APPLICATION_LANGUAGE_CHOICES,
ApplicationBasis,
ApplicationBa... | 2.15625 | 2 |
Python/kata/bankocr.py | caichinger/BankOCR-Outside-in-Kata | 2 | 39218 | <gh_stars>1-10
# coding=utf-8
from kata.accountnumber import AccountNumber
class BankOcr(object):
"""Example for the outside interface of the API we need to create."""
def __init__(self):
pass
def parse(self, raw_lines):
# TODO return an array of AccountNumber
raise N... | 2.859375 | 3 |
createData.py | msiampou/distributed-fault-tolerant-kv-store | 7 | 39219 | <filename>createData.py
#!/usr/bin/python
import sys, getopt
import random
import string
import sys
import math
def create_random_value(type, maxlength):
if type == "int":
start = 10**(maxlength-1)
end = (10**maxlength)-1
return random.randint(start, end)
elif type == "string":
return ''... | 3.40625 | 3 |
homework(december)/decemberAssigment1/random1.py | tkanicka/python_learning | 0 | 39220 | import random
class Play:
def __init__(self, name="Player"):
self.name = name
def print_name(self):
print("your name is ", self.name)
def TossDie(self, x=1):
for i in range(x):
print(random.randint(1, 6))
def RPC(self, x=1):
for i in range(x):
... | 3.5625 | 4 |
armory/baseline_models/pytorch/resnet50.py | paperwhite/armory | 0 | 39221 | <reponame>paperwhite/armory<filename>armory/baseline_models/pytorch/resnet50.py
"""
ResNet50 CNN model for 244x244x3 image classification
"""
import logging
from art.classifiers import PyTorchClassifier
import numpy as np
import torch
from torchvision import models
logger = logging.getLogger(__name__)
DEVICE = torc... | 2.375 | 2 |
clac_line_index.py | shichenhui/Data-mining-techniques-on-astronomical-spectra-data.-I-Clustering-analysis | 0 | 39222 | <filename>clac_line_index.py
import numpy as np
import matplotlib.pyplot as plt
class LineIndex:
def __init__(self):
self.elements = [(4143.375, 4178.375, 4081.375, 4118.875, 4245.375, 4285.375),
(4143.375, 4178.375, 4085.125, 4097.625, 4245.375, 4285.375),
... | 2.5 | 2 |
spire/github/upgrades/broodauth.py | bugout-dev/spire | 1 | 39223 | """
According with BUG-132 was added table GitHubBugoutUser.
It requires additional script to generate BugoutUser for existing installations
after database migration.
"""
import argparse
import uuid
from ..models import GitHubOAuthEvent, GitHubBugoutUser
from ...broodusers import bugout_api
from ...db import yield_con... | 2.125 | 2 |
preprocess_list_tokenized.py | c-col/Transformer | 0 | 39224 | import numpy as np
import json
import re
from Utils import *
np.random.seed(4)
def output_process(example):
state = e['state'][-1]
if type(state) == str:
return state
else:
return ' '.join(state)
def polish_notation(steps):
step_mapping = {}
for ix, s in enumerate(steps):
... | 2.5625 | 3 |
galaxy-shooter/src/enemy.py | akshayreddy/games | 0 | 39225 | <filename>galaxy-shooter/src/enemy.py
import pygame, random
from datetime import datetime
from bullet import EnemyBullet, ChasingBullet
class Enemy:
stepSize = 0.4
def __init__(self, screen, gameScreenX, gameScreenY):
self.gameScreenX = gameScreenX
self.gameScreenY = gameScreenY
self.... | 2.859375 | 3 |
python/ign_topic_info.py | srmainwaring/python-ignition | 3 | 39226 | <filename>python/ign_topic_info.py
#!/usr/bin/env python
# Copyright (C) 2022 <NAME>
#
# 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
#
# Un... | 2.5625 | 3 |
tests/spec/cms/blogs/test_blogs.py | fakepop/hubspot-api-python | 117 | 39227 | <reponame>fakepop/hubspot-api-python
from hubspot import HubSpot
from hubspot.discovery.cms.blogs.discovery import Discovery
def test_is_discoverable():
apis = HubSpot().cms
assert isinstance(apis.blogs, Discovery)
| 1.929688 | 2 |
tests/clvm/benchmark_costs.py | Flax-Network/flax-light-wallet | 1 | 39228 | <filename>tests/clvm/benchmark_costs.py
from flaxlight.types.blockchain_format.program import INFINITE_COST
from flaxlight.types.spend_bundle import SpendBundle
from flaxlight.types.generator_types import BlockGenerator
from flaxlight.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from flaxlight.... | 1.835938 | 2 |
Validation/Performance/python/SaveRandomSeedsDigi.py | NTrevisani/cmssw | 3 | 39229 | #G.Benelli Feb 7 2008
#This fragment is used to have the random generator seeds saved to test
#simulation reproducibility. Anothe fragment then allows to run on the
#root output of cmsDriver.py to test reproducibility.
import FWCore.ParameterSet.Config as cms
def customise(process):
#Renaming the process
proce... | 2.125 | 2 |
chapter_6/ex_6-4.py | akshaymoharir/PythonCrashCourse | 0 | 39230 |
## Python Crash Course
# Exercise 6.4: Glossary#2:
# Now that you know how to loop through a dictionary, clean up the code from Exercise 6-3 (page 102)
# by replacing your series of print statements with a loop that runs through the dictionary’s keys and values.
# Whe... | 4.25 | 4 |
test/ai/test_basic_ai.py | PMatthaei/multiagent-particle-envs | 0 | 39231 | <filename>test/ai/test_basic_ai.py
import unittest
import numpy as np
from maenv.ai.basic_ai import BasicScriptedAI
from test.mock import mock_agent, mock_team, mock_world
AGENTS_N = 4
class BasicAgentActTestCases(unittest.TestCase):
def setUp(self):
self.a = mock_agent(id=0, tid=0)
self.b = mo... | 2.890625 | 3 |
src/m3_extra.py | wangj19/99-CapstoneProject-201920 | 0 | 39232 | import rosebot
import time
def led():
robot = rosebot.RoseBot()
robot.drive_system.go(30, 30)
while True:
distance = robot.sensor_system.ir_proximity_sensor.get_distance_in_inches()
delay = distance/500
robot.led_system.left_led.turn_on()
time.sleep(delay)
robot.l... | 2.984375 | 3 |
app/requests.py | Mash14/personal-blog | 0 | 39233 | <gh_stars>0
import urllib.request,json
from .models import Quote
def get_quotes():
get_quotes_url = 'http://quotes.stormconsultancy.co.uk/random.json'
with urllib.request.urlopen(get_quotes_url) as url:
get_quotes_data = url.read()
get_quotes_response = json.loads(get_quotes_data)
pri... | 2.5625 | 3 |
misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 39 | 39234 | <filename>misc/phyler_classify.py<gh_stars>10-100
#!/usr/bin/env python
import sys, getopt
import glob,os
# sample the first 10**7 reads
def get_fasta(fp,fo):
f = open(fp)
g = open(fo,'w')
lastlinechar = ''
writenext = False
read_count = 0
for line in f:
if (line[0] == '@') and (lastlinechar != '+'):
g.wri... | 2.609375 | 3 |
Labs/PolicyFunctionIteration/policy_solutions.py | jessicaleete/numerical_computing | 10 | 39235 | <filename>Labs/PolicyFunctionIteration/policy_solutions.py
#Solutions to Policy Function Iteration Lab
import numpy as np
import scipy as sp
from scipy import sparse
from scipy.sparse import linalg
import math
from matplotlib import pyplot as plt
from scipy import linalg as la
def u(x):
return np.sqrt(x).flatten... | 3.109375 | 3 |
official/nlp/gpt/src/gpt.py | mindspore-ai/models | 77 | 39236 | <filename>official/nlp/gpt/src/gpt.py
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 r... | 2.078125 | 2 |
packages/syft/src/syft/proto/lib/python/bytes_pb2.py | jackbandy/PySyft | 0 | 39237 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/lib/python/bytes.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import ... | 1.296875 | 1 |
pyscripts/excel2md.py | heyrict/custom_modules | 0 | 39238 | <reponame>heyrict/custom_modules<gh_stars>0
#!/usr/bin/env python3
import optparse,sys,os
from txtform import df_format_print, df_format_read
import pandas as pd, numpy as np
import pyperclip
class string():
def __init__(self,*args,sep=' ',end='\n'):
self.content = sep.join([str(i) for i in args])+end
... | 2.5625 | 3 |
spexxy/weight/fromgridnearest.py | thusser/spexxy | 4 | 39239 | <gh_stars>1-10
import os
import numpy as np
import pandas as pd
from typing import List, Union
from .weight import Weight
from ..data import Spectrum
class WeightFromGridNearest(Weight):
"""
This class loads the weights from a grid depending on the initial values of the fit parameters by choosing the
n... | 3.046875 | 3 |
testproject/testapp/tests/test_password_reset.py | d1opensource/djoser | 0 | 39240 | <gh_stars>0
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core import mail
from django.test.utils import override_settings
from djet import assertions, restframework
from rest_framework import status
import djoser.views
from djoser.compat import get_user_email... | 2.109375 | 2 |
sequenceur.py | lperezfr/turbot-toulouse-robot-race | 1 | 39241 | # encoding:utf-8
# Librairies tierces
import time
import os
# Mes classes
from voiture import Voiture
from asservissement import Asservissement
from arduino import Arduino
class Sequenceur:
# General
# CONST_NOMBRE_MESURES_DEPASSEMENT_DISTANCE = 1000 # Nombre de mesures consecutives du telemetre a... | 2.328125 | 2 |
ddtrace/internal/wrapping.py | ysk24ok/dd-trace-py | 0 | 39242 | <filename>ddtrace/internal/wrapping.py
import sys
from types import FunctionType
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Tuple
from typing import cast
from six import PY3
try:
from typing import Protocol
except ImportError:
fro... | 2.515625 | 3 |
setup.py | davidfraser/WSGIUtils | 0 | 39243 | <gh_stars>0
#!/usr/bin/env python
import sys, os
sys.path.insert(0, os.path.join(os.getcwd(),'lib'))
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import wsgiutils
try:
os.remove ('MANIFEST')
except:
pass
with open(os.path.join(os.getcwd(), 'README.txt'), 'r') as _readm... | 1.375 | 1 |
doc/doc_updates.py | briandorsey/partisci | 5 | 39244 | import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../clients/python"))
import pypartisci
server, port = "localhost", 7777
apps = ["Demo App A",
"Demo App B"]
hosts = ["host1.example.com",
"host2.example.com"]
versions = ["1.0", "2.0"]
for app in apps:
for i, hos... | 2.40625 | 2 |
axisutilities/axisremapper.py | coderepocenter/AxisUtilities | 0 | 39245 | <reponame>coderepocenter/AxisUtilities
from __future__ import annotations
from typing import Iterable, Callable
import numpy as np
import dask.array as da
from numba import prange
from scipy.sparse import csr_matrix
from axisutilities import Axis
class AxisRemapper:
"""
`AxisRemapper` facilitates conversio... | 2.921875 | 3 |
examples/__old/freeform_vault_tutorial.py | selinabitting/compas-RV2 | 34 | 39246 | <gh_stars>10-100
from compas_rv2.skeleton import Skeleton
from compas_rv2.diagrams import FormDiagram # noqa F401
from compas_rv2.diagrams import ForceDiagram
from compas_rv2.diagrams import ThrustDiagram # noqa F401
from compas_rv2.rhino import RhinoSkeleton
from compas_rv2.rhino import RhinoFormDiagram
from compas_... | 1.726563 | 2 |
tasks/time-series/time-series-forecasting/a65761f6-78d4-4fa7-988c-4ac6e7c07421/src/runner.py | sujithvemi/ai-platform | 1 | 39247 | <gh_stars>1-10
import pandas as pd
import numpy as np
import io
import requests
from datetime import timedelta
import xgboost as xgb
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import *
import matplotlib.pyplot as plt
import mlflow
import mlflow.sklearn
class ForecastRunner(object):
def ... | 2.609375 | 3 |
configs.py | GavinLiu-AI/warden-bots | 0 | 39248 | <reponame>GavinLiu-AI/warden-bots
WAR_BOT_TOKEN = 'token'
| 0.824219 | 1 |
eigenface.py | lion-tohiro/MyEigenface | 0 | 39249 | from cv2 import cv2
import numpy as np
import sys
import os
from base import normalize
# some parameters of training and testing data
train_sub_count = 40
train_img_count = 5
total_face = 200
row = 70
col = 70
def eigenfaces_train(src_path):
img_list = np.empty((row*col, total_face))
count = 0
... | 2.984375 | 3 |
app/request/migrations/0003_auto_20190924_2107.py | contestcrew/2019SeoulContest-Backend | 0 | 39250 | # Generated by Django 2.2.5 on 2019-09-24 12:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('request', '0002_auto_20190924_1811'),
]
operations = [
migrations.CreateModel(
name='PoliceOffi... | 1.625 | 2 |
mrmap/service/helper/ogc/layer.py | SvenTUM/mrmap | 0 | 39251 | <reponame>SvenTUM/mrmap
from django.contrib.gis.geos import Polygon
from django.db import IntegrityError
from service.helper.enums import MetadataEnum, OGCOperationEnum, MetadataRelationEnum
from service.helper.epsg_api import EpsgApi
from service.models import Service, Metadata, Layer, Keyword, ReferenceSystem, Dimen... | 2 | 2 |
Sample/PyWebApi.IIS/json_fmtr.py | DataBooster/PyWebApi | 6 | 39252 | # -*- coding: utf-8 -*-
"""json_fmtr.py
This module implements a MediaTypeFormatter with JSON response.
This module was originally shipped as an example code from https://github.com/DataBooster/PyWebApi, licensed under the MIT license.
Anyone who obtains a copy of this code is welcome to modify it for any... | 2.625 | 3 |
vad.py | zhuligs/Pallas | 0 | 39253 | #!/usr/bin/env python
# import numpy as np
import itin
import sdata
import fppy
from copy import deepcopy as cp
from wrapdimer import get_rmode, get_0mode, get_mode
from zfunc import set_cell_from_vasp, write_cell_to_vasp
from vfunc import runvdim, goptv
# def con(reac, prod):
# mode = get_mode(reac, prod)
# sdd = ... | 1.78125 | 2 |
EASTAR/main/templatetags/extra.py | DightMerc/EASTAR | 1 | 39254 | from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def FindPhoto(value):
if "%photo%" in str(value):
return True
else:
return False
@register.filter
@stringfilter
def ReplacePhoto(value):
return... | 2.34375 | 2 |
influxable/db/function/transformations.py | AndyBryson/influxable | 30 | 39255 | <reponame>AndyBryson/influxable
from . import _generate_function
Abs = _generate_function('ABS')
ACos = _generate_function('ACOS')
ASin = _generate_function('ASIN')
ATan = _generate_function('ATAN')
ATan2 = _generate_function('ATAN2')
Ceil = _generate_function('CEIL')
Cos = _generate_function('COS')
CumulativeSum = _g... | 1.984375 | 2 |
notebooks/pixel_cnn/pixelcnn_helpers.py | bjlkeng/sandbox | 158 | 39256 | <gh_stars>100-1000
import math
import numpy as np
from keras import backend as K
from keras.layers import Conv2D, Concatenate, Activation, Add
from keras.engine import InputSpec
def logsoftmax(x):
''' Numerically stable log(softmax(x)) '''
m = K.max(x, axis=-1, keepdims=True)
return x - m - K.log(K.sum(... | 2.453125 | 2 |
so_ana_util/common_types.py | HBernigau/StackOverflowAnalysis | 0 | 39257 | """
contains several global data classes (for log entries for example)
Author: `HBernigau <https://github.com/HBernigau>`_
Date: 01.2022
"""
import marshmallow_dataclass as mmdc
import marshmallow
from logging import StreamHandler
from typing import Any
from dataclasses import is_dataclass, dataclass, field
from date... | 2.65625 | 3 |
main.py | traduttore/traduttore-model | 0 | 39258 | from run_translation.TestModelComputer import asl_translation
from run_translation.TextToSpeech import tts
from run_translation.RunPiModelStream import rasp_translation
# from run_translation.RunPiModelTesting import rasp_translation
from run_translation.TestModelComputerLetters import asl_translation_letters
# from ru... | 2.15625 | 2 |
counting_elements.py | vyshuks/Leetcode-30-day-challenge | 0 | 39259 | # Given an integer array arr, count element x such that x + 1 is also in arr.
# If there're duplicates in arr, count them seperately.
# Example 1:
# Input: arr = [1,2,3]
# Output: 2
# Explanation: 1 and 2 are counted cause 2 and 3 are in arr.
# Example 2:
# Input: arr = [1,1,3,3,5,5,7,7]
# Output: 0
# Explanatio... | 4.125 | 4 |
terrascript/data/logicmonitor.py | hugovk/python-terrascript | 507 | 39260 | # terrascript/data/logicmonitor.py
import terrascript
class logicmonitor_collectors(terrascript.Data):
pass
class logicmonitor_dashboard(terrascript.Data):
pass
class logicmonitor_dashboard_group(terrascript.Data):
pass
class logicmonitor_device_group(terrascript.Data):
pass
__all__ = [
"l... | 1.601563 | 2 |
src/plotting_modules.py | kjdavidson/NoisePy | 74 | 39261 | <gh_stars>10-100
import os
import sys
import glob
import obspy
import scipy
import pyasdf
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy.fftpack import next_fast_len
from obspy.signal.filter import bandpass
'''
Ensembles of plotting functions to display intermediate/final waveforms fro... | 2.3125 | 2 |
version_2.0/cli.py | Isak-Landin/AlienWorldsBot | 0 | 39262 | <gh_stars>0
try:
import time
import traceback
from program_files.__main__ import main
if __name__ == '__main__':
main()
except:
print(traceback.print_exc())
time.sleep(10000) | 1.890625 | 2 |
zeugs/wz_table/spreadsheet_make.py | gradgrind/Zeugs | 0 | 39263 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
wz_table/spreadsheet_make.py
Last updated: 2019-10-14
Create a new spreadsheet (.xlsx).
=+LICENCE=============================
Copyright 2017-2019 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in comp... | 2.71875 | 3 |
pygpsnmea/kml.py | tww-software/py_gps_nmea | 0 | 39264 | <gh_stars>0
"""
a parser to generate Keyhole Markup Language (KML) for Google Earth
"""
import datetime
import os
import re
DATETIMEREGEX = re.compile(
r'\d{4}/(0[1-9]|1[0-2])/(0[1-9]|1[0-9]|2[0-9]|3[01]) '
r'(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])')
class KMLOutputParser():
"""
Class to p... | 3.3125 | 3 |
config_web/uberon.py | NikkiBytes/pending.api | 3 | 39265 | <reponame>NikkiBytes/pending.api<gh_stars>1-10
ES_HOST = 'localhost:9200'
ES_INDEX = 'pending-uberon'
ES_DOC_TYPE = 'anatomy'
API_PREFIX = 'uberon'
API_VERSION = ''
| 0.984375 | 1 |
tests/unittests/models/movinet/test_movinet.py | jaelgu/towhee | 0 | 39266 | <reponame>jaelgu/towhee
# Copyright 2022 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 2.359375 | 2 |
setup.py | btpka3/certbot-auto-dns-challenge | 0 | 39267 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf8 -*-
from setuptools import setup
setup(
name='certbot_adc',
version='0.1',
description="perform certbot auto dns challenge with DNS provider's API",
url='http://github.com/btpka3/certbot-auto-dns-challenge',
author='btpka3',
author_email='<E... | 1.335938 | 1 |
meta_learn/hyperparameter/hyperactive_wrapper.py | SimonBlanke/Meta-Learn | 2 | 39268 | <reponame>SimonBlanke/Meta-Learn
import os
import glob
import hashlib
import inspect
from .collector import Collector
from ._meta_regressor import MetaRegressor
from ._recognizer import Recognizer
from ._predictor import Predictor
class HyperactiveWrapper:
def __init__(self, search_config, meta_learn_path_alt=No... | 2.203125 | 2 |
SIR_Model_Spread_of_Disease/SIR.py | Ukasz09/Machine-learning | 1 | 39269 | import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
T = 200
h = 1e-2
t = np.arange(start=0, stop=T + h, step=h)
bet, gam = 0.15, 1 / 50
# todo: zmienic poziej na randoma
# S_pocz = np.random.uniform(0.7, 1)
S_start = 0.8
I_start = 1 - S_start
R_start = 0
N = S_start + I_start + R_sta... | 2.9375 | 3 |
Source/fcm_estimator.py | SamanKhamesian/Imputation-of-Missing-Values | 4 | 39270 | import numpy as np
from skfuzzy import cmeans
from config import NAN, FCMParam
class FCMeansEstimator:
def __init__(self, c, m, data):
self.c = c
self.m = m
self.data = data
self.complete_rows, self.incomplete_rows = self.__extract_rows()
# Extract complete and incomplete row... | 2.640625 | 3 |
assignments/06_common/common_expanded.py | xanoob/be434-fall-2021 | 0 | 39271 | #!/usr/bin/env python3
"""
Author : RoxanneB <<EMAIL>>
Date : 2021-10-07
Purpose: Rock the Casbah
"""
import argparse
import sys
import string
from collections import defaultdict
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.Argument... | 3.375 | 3 |
protocols/acars618.py | wagoodman/protocol-tools | 1 | 39272 | <gh_stars>1-10
from byteProtocol import *
import re
import time
class Acars618Support(object):
@staticmethod
def int(cls, value):
if isinstance(value, int):
value = str(value)
return value
@staticmethod
def tail(cls, value):
if not isinstance(value, str):
... | 2.28125 | 2 |
db_env/tpch/tpch_stream/RefreshPair.py | Chotom/rl-db-indexing | 0 | 39273 | <gh_stars>0
import datetime
from typing import Iterator, Tuple, List
import numpy as np
import pandas as pd
from mysql.connector import MySQLConnection
from mysql.connector.cursor import MySQLCursorBuffered
from db_env.tpch.config import DB_REFRESH_DIR
from db_env.tpch.tpch_stream.consts import LINEITEM_QUOTE_INDEX_L... | 2.296875 | 2 |
zip_submission.py | RapidsAtHKUST/TriangleCounting | 0 | 39274 | import datetime
import os
if __name__ == '__main__':
date_str = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M")
print(date_str)
os.system('zip -r tc-rapids-{}.zip triangle-counting technical_report.pdf -x *cmake-build-debug/* -x */CMake* -x *.idea/*'.format(date_str))
| 2.578125 | 3 |
binarysearch/loneInteger.py | Ry4nW/python-wars | 1 | 39275 | class Solution:
def solve(self, nums):
integersDict = {}
for i in range(len(nums)):
try:
integersDict[nums[i]] += 1
except:
integersDict[nums[i]] = 1
for integer in integersDict:
if integersDict[integer] != 3:
... | 3.328125 | 3 |
data/multimodal_miss_dataset.py | Norwa9/missing_modalities | 0 | 39276 | <reponame>Norwa9/missing_modalities<filename>data/multimodal_miss_dataset.py
import os
import sys
sys.path.append("/data/luowei/MMIN")
import json
import random
import torch
import numpy as np
import h5py
from torch.nn.utils.rnn import pad_sequence
from torch.nn.utils.rnn import pack_padded_sequence
from data.base_dat... | 2.03125 | 2 |
projects/admin.py | BridgesLab/Lab-Website | 6 | 39277 | '''This package sets up the admin interface for the :mod:`papers` app.'''
from django.contrib import admin
from projects.models import Funding, FundingAgency
class FundingAdmin(admin.ModelAdmin):
'''The :class:`~projects.models.Funding` model admin is the default.'''
pass
admin.site.register(Funding, Fundi... | 1.71875 | 2 |
evap/evaluation/migrations/0032_populate_rating_answer_counters.py | JenniferStamm/EvaP | 0 | 39278 | <reponame>JenniferStamm/EvaP
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def populateRatingAnswerCounters(apps, schema_editor):
LikertAnswerCounter = apps.get_model('evaluation', 'LikertAnswerCounter')
GradeAnswerCounter = apps.get_model('evaluatio... | 1.84375 | 2 |
core/entities/character_utils.py | jklemm/py-dnd | 9 | 39279 |
class CharacterRaceList(object):
DEVA = 'DEVA'
DRAGONBORN = 'DRAGONBORN'
DWARF = 'DWARF'
ELADRIN = 'ELADRIN'
ELF = 'ELF'
GITHZERAI = 'GITHZERAI'
GNOME = 'GNOME'
GOLIATH = 'GOLIATH'
HALFELF = 'HALFELF'
HALFLING = 'HALFLING'
HALFORC = 'HALFORC'
HUMAN = 'HUMAN'
MINOTAUR... | 2.421875 | 2 |
src/main.py | NonAbelianCapu/Traffic_Sim | 0 | 39280 | import sim
import utils
import numpy as np
import matplotlib.pyplot as plt
import argparse
def main():
my_parser = argparse.ArgumentParser(description='Parameters for Simulation')
my_parser.add_argument('-N', '--n_cars', type=int, action='store', help='Number of cars', default = 40)
my_parser.add_argumen... | 3.0625 | 3 |
tests/functional/parser/schemas.py | n2N8Z/aws-lambda-powertools-python | 0 | 39281 | from typing import Dict, List, Optional
from pydantic import BaseModel
from typing_extensions import Literal
from aws_lambda_powertools.utilities.parser.models import (
DynamoDBStreamChangedRecordModel,
DynamoDBStreamModel,
DynamoDBStreamRecordModel,
EventBridgeModel,
SnsModel,
SnsNotification... | 2.265625 | 2 |
src/350.py | hippieZhou/The-Way-Of-LeetCode | 0 | 39282 | # 给定两个数组,编写一个函数来计算它们的交集。
class Solution:
def intersect(self, nums1: list, nums2: list) -> list:
inter = set(nums1) & set(nums2)
print(inter)
l = []
for i in inter:
l += [i] * min(nums1.count(i), nums2.count(i))
print(l)
return l
nums1 = [1, 2, 2, 1... | 3.796875 | 4 |
IATI2LOD/src/gather data scripts/DbpediaData.py | KasperBrandt/IATI2LOD | 1 | 39283 | <gh_stars>1-10
## By <NAME>
## Last updated on 26-05-2013
import os, sys, datetime, urllib2, AddProvenance
from rdflib import Namespace, Graph
# Settings
dbpedia_folder = "/media/Acer/School/IATI-data/dataset/DBPedia/"
dbpedia_files = ["/media/Acer/School/IATI-data/mappings/DBPedia/dbpedia-countries-via-factbook.ttl"... | 2.65625 | 3 |
mellow/core.py | unsonnet/mellow | 0 | 39284 | <reponame>unsonnet/mellow<gh_stars>0
# -*- coding: utf-8 -*-
import warnings
import jax.numpy as np
import jax.ops as jo
import mellow.factory as factory
import mellow.ops as mo
class Network(object):
"""Homogenous feedforward neural network."""
def __init__(self, inp, out, params, act):
"""Inits ... | 2.796875 | 3 |
PythonExercicios/ex082.py | lordvinick/Python | 0 | 39285 | print('\033[32m{:=^60}'.format('\033[36m Dividindo valores em várias listas \033[32m'))
lista = []
par = []
impar = []
while True:
lista.append(int(input('\033[36mDigite um número: ')))
resp = str(input('\033[32mQuer continuar? [S/N] ')).strip()[0]
if resp in 'Nn':
break
for c in range(len(lista)):
... | 3.46875 | 3 |
test_api.py | cagcoach/aikapi | 0 | 39286 | from PythonAPI.bam import BAM
import numpy as np
dataset_dir = '/home/beatriz/Documentos/Work/final_datasets' # For Bea
# dataset_dir = '/home/almartmen/Github/aikapi' # For Alberto
dataset_name = '181129'
bam = BAM(dataset_dir, dataset_name, image_format='png')
# bam.unroll_videos()
# print(bam.get_persons_in... | 2.15625 | 2 |
account/management/commands/monthly_charging.py | coseasonruby/Gluu-Ecommerce-djagno-project | 0 | 39287 | <filename>account/management/commands/monthly_charging.py
import logging
import stripe
from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from account import constants
from account.utils import send_billing_email, send_cha... | 2.03125 | 2 |
pokemon_combat/body_part.py | ryndovaira/telebot_fight_game | 0 | 39288 | <filename>pokemon_combat/body_part.py
from enum import Enum, auto
class BodyPart(Enum):
NOTHING = auto() # ничего (начальное состояние)
HEAD = auto() # голова
BELLY = auto() # живот
LEGS = auto() # ноги
@classmethod
def min_index(cls):
return cls.HEAD.value
@classmethod
d... | 2.8125 | 3 |
labyrinth_8_rooms_quantum.py | katema-official/Tesi-laurea-triennale-Pisa-2021 | 1 | 39289 | <filename>labyrinth_8_rooms_quantum.py
import math
from random import *
from qiskit import *
from qiskit.tools.visualization import plot_histogram
import random
#Molte cose saranno simili al codice classico, cambia solo la rappresentazione della
#funzione di transizione, ovvero come l'agente sceglie la prossima... | 2.703125 | 3 |
setup.py | monk1337/amazon-denseclus | 46 | 39290 | #!/usr/bin/env/python3
import setuptools
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="Amazon DenseClus",
version="0.0.19",
author="<NAME>",
description="Dense Clustering for Mixed Data Types",
long_description=long_description,
long_d... | 1.507813 | 2 |
polog/tests/handlers/memory/test_saver.py | pomponchik/polog | 30 | 39291 | <filename>polog/tests/handlers/memory/test_saver.py
import pytest
from polog.handlers.memory.saver import memory_saver
from polog.core.log_item import LogItem
handler = memory_saver()
def test_singleton():
"""
Проверка, что memory_saver - синглтон.
"""
assert memory_saver() is memory_saver()
def te... | 2.375 | 2 |
api/v2/serializers/fields/identity.py | simpsonw/atmosphere | 197 | 39292 | <reponame>simpsonw/atmosphere
from rest_framework import exceptions, serializers
from api.v2.serializers.summaries import IdentitySummarySerializer
from core.models import Identity
class IdentityRelatedField(serializers.RelatedField):
def get_queryset(self):
return Identity.objects.all()
def to_repre... | 2.421875 | 2 |
snippets/python/notification.py | Gautam-virmani/snippets | 0 | 39293 | #Title: Notification Processor
#Tags:plyer,python
#Can process notification of your choice
#plyer:built in module help you to find more information
from plyer import notification
def notifyme(title, message):
notification.notify(
title=title,
message=message,
app_icon='Write your icon... | 3.078125 | 3 |
mysite/forms.py | donovan680/django-form-rendering | 41 | 39294 | <filename>mysite/forms.py
from django import forms
class ContactForm(forms.Form):
name = forms.CharField(max_length=30)
email = forms.EmailField(max_length=254)
message = forms.CharField(
max_length=2000,
widget=forms.Textarea(),
help_text='Write here your message!'
)
sourc... | 2.640625 | 3 |
modules/dialogue_importer.py | KAIST-AILab/PyOpenDial | 9 | 39295 | import logging
from threading import Thread
from time import sleep
from multipledispatch import dispatch
from dialogue_state import DialogueState
from modules.dialogue_recorder import DialogueRecorder
from modules.forward_planner import ForwardPlanner
class DialogueImporter(Thread):
"""
Functionality to im... | 2.625 | 3 |
flask_cm/pycompile.py | Ginnam/flask-onlineIDE | 1 | 39296 | import os, sys, subprocess, tempfile, time
# 创建临时文件夹,返回临时文件夹路径
TempFile = tempfile.mkdtemp(suffix='_test', prefix='python_')
# 文件名
FileNum = int(time.time() * 1000)
# python编译器位置
EXEC = sys.executable
# 获取python版本
def get_version():
v = sys.version_info
version = "python %s.%s" % (v.major, v.minor)
retur... | 2.609375 | 3 |
flask_resultful_plugin/error.py | PushyZqin/flask-restful-plugin | 2 | 39297 | <gh_stars>1-10
# encoding:utf-8
# 401 错误
class UnauthorizedError(Exception):
pass
# 400 错误
class BadRequestError(Exception):
pass
class MediaTypeError(Exception):
pass
# 父异常
class RestfulException(Exception):
pass | 1.789063 | 2 |
wunderkafka/config/generated/enums.py | severstal-digital/wunderkafka | 0 | 39298 | <gh_stars>0
from enum import Enum
class BrokerAddressFamily(str, Enum):
any = 'any'
v4 = 'v4'
v6 = 'v6'
class SecurityProtocol(str, Enum):
plaintext = 'plaintext'
ssl = 'ssl'
sasl_plaintext = 'sasl_plaintext'
sasl_ssl = 'sasl_ssl'
class SslEndpointIdentificationAlgorithm(str, Enum):
... | 2.5 | 2 |
std/captum/21.py | quantapix/qnarre.com | 0 | 39299 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from transformers import BertTokenizer, BertForQuestionAnswering, BertConfig
from captum.attr import visualization as viz
from captum.attr import LayerConductance, LayerIntegratedGradients
... | 2.25 | 2 |