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 |
|---|---|---|---|---|---|---|
backend/tradersplatform/equipment/urls.py | ybedirhanpak/bounswe2019group1 | 10 | 52800 | <filename>backend/tradersplatform/equipment/urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^currency/', views.CurrencyAPI.as_view(), name="update_de"),
url(r'^currencylastmonth/', views.CurrencyAPILastMonth.as_view(), name="update_de"),
url(r'^currencyconvert/', views.... | 1.851563 | 2 |
slab2code/s2d_fnctns.py | ftbernales/slab2 | 46 | 52801 | #!/usr/bin/env python
#import standard libraries
import obspy.imaging.beachball
import datetime
import os
import csv
import pandas as pd
import numpy as np
import fnmatch
from geopy.distance import geodesic
from math import *
#from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from matplotlib imp... | 2.5625 | 3 |
L1Trigger/GlobalCaloTrigger/test/testElectrons_cfg.py | ckamtsikis/cmssw | 852 | 52802 | <reponame>ckamtsikis/cmssw<gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
process = cms.Process("TestGct")
process.load("L1Trigger.GlobalCaloTrigger.test.gctTest_cff")
process.load("L1Trigger.GlobalCaloTrigger.test.gctConfig_cff")
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untrack... | 1.132813 | 1 |
configure.py | EthanHindmarsh/PyGridClicker | 0 | 52803 | import json
def confirm():
print("")
# custom function
def rowPrint(xrow=-1,yrow=-1,xpos=-1,ypos=-1,width=9,height=9):
rows = [["O"]*width for _ in range(height)]
for list in rows:
if yrow != -1:
list[yrow]="X"
if xrow != -1:
rows[xrow] = ["X"]*width
if ypos != -1:
... | 3.53125 | 4 |
auto_ml/GRU/gru_tuner.py | AlongZG/XFinAI | 1 | 52804 | import sys
import nni
from sklearn.metrics import r2_score
sys.path.append('../..')
from model_layer.model_hub import GRU
from model_layer.model_tuner import RecurrentModelTuner
from utils import base_io
def main(model_class, future_index, params):
target_metric_func = r2_score
metric_name = 'R... | 2.265625 | 2 |
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/Volume/Renderers/UTVolumeLibrary/UTVolumeLibrary.py | J-E-J-S/aaRS-Pipeline | 8 | 52805 | <gh_stars>1-10
#from utvollib.UTVolumeLibrary import *
from UTpackages.UTvolrend.UTVolumeLibrary import *
| 1.125 | 1 |
curvefever-overlay/main.py | Pipeliner/misc | 0 | 52806 | import sys
from PyQt4 import QtGui, QtCore
class TopWindow(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.setWindowFlags(
QtCore.Qt.WindowStaysOnTopHint |
QtCore.Qt.FramelessWindowHint |
QtCore.Qt.X11BypassWindowManagerHint
... | 2.53125 | 3 |
LevelMethod/LevelMethod2d.py | michelebersani/ComputationalMathematics | 1 | 52807 | import numpy as np
import matplotlib.pyplot as plt
import math
from scipy.optimize import linprog
from cvxpy import *
class CuttingPlaneModel:
def __init__(self, dim, bounds):
self.dim = dim
self.bounds = bounds
self.coefficients = np.empty((0,dim+1))
def __call__(self, x):#REMOVE
... | 2.40625 | 2 |
All_Source_Code/MultilayerPerceptronNeuralNetwork/MultilayerPerceptronNeuralNetwork_9.py | APMonitor/pds | 11 | 52808 | from gekko import GEKKO
import numpy as np
import matplotlib.pyplot as plt
# generate training data
x = np.linspace(0.0,2*np.pi,20)
y = np.sin(x)
# option for fitting function
select = True # True / False
if select:
# Size with cosine function
nin = 1 # inputs
n1 = 1 # hidden layer 1 (linear)
n2 ... | 2.921875 | 3 |
src/phenotype/neural_network/evaluator/evaluator.py | sash-a/CoDeepNEAT | 28 | 52809 | <filename>src/phenotype/neural_network/evaluator/evaluator.py
from __future__ import annotations
import random
import time
from typing import TYPE_CHECKING, Union
import numpy as np
import torch
from sklearn.metrics import accuracy_score
from torch.utils.data import DataLoader
from configuration import config
from s... | 2.15625 | 2 |
embedding/custom_loader.py | ShapRL/ShapRL | 0 | 52810 | <gh_stars>0
# pubfig
from PIL import Image
import os
import os.path
import numpy as np
import sys
import torch.utils.data as data
from torchvision.datasets import ImageFolder
def pil_loader(path):
# open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835)
with open(pat... | 2.5625 | 3 |
F1_accuracy_rwi.py | TalalWasim/scene_text_segmentation | 3 | 52811 | import argparse
import os
import sys
import numpy as np
import pdb
from tqdm import tqdm
import cv2
import glob
import numpy as np
from numpy import *
import matplotlib
#matplotlib.use("Agg")
#matplotlib.use("wx")
#matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import scipy
from scipy.special import softmax
... | 2.046875 | 2 |
mergeLOCandDBpedia.py | thisismattmiller/linked-jazz-name-directory | 6 | 52812 | import sys, os, re, urllib, time
def main():
if not os.path.exists('data/loc_single'):
os.makedirs('data/loc_single')
dbData = open('data/jazzPeople.nt', 'r')
personNames = {}
personBirthDates = {}
personDeathDates = {}
nameCollisons = {}
matchesBothDate = []
matchesBothDateURIs = []... | 2.796875 | 3 |
test/test_del_group.py | Sviatlana-Pi/python_training | 0 | 52813 | <gh_stars>0
# -*- coding: utf-8 -*-
def test_del_first_group(app):
app.session.login(username = "admin", password = "<PASSWORD>")
app.group.delete_first_group()
app.session.logout() | 1.335938 | 1 |
[Solusi] Tugas 1 - IPC/04.tugas_download_file_server.py | bagindakarli/IPC-Python3.7 | 0 | 52814 | # import library socket karena menggunakan IPC socket
import socket
# definisikan IP untuk binding
TCP_IP = '127.0.0.1'
# definisikan port untuk binding
TCP_PORT = 5005
# definisikan ukuran buffer untuk menerima pesan
BUFFER_SIZE = 4096
# buat socket (bertipe UDP atau TCP?)
s = socket.socket(socket.AF_INET, socke... | 3.421875 | 3 |
embutils/utils/version.py | cwichel/embutils | 0 | 52815 | <filename>embutils/utils/version.py<gh_stars>0
#!/usr/bin/python
# -*- coding: ascii -*-
"""
Version number implementation.
:date: 2021
:author: <NAME>
:contact: <EMAIL>
:license: The MIT License (MIT)
"""
import re
import attr
from ..utils.common import TPAny, TPText
# -->> Tunables <<----------------... | 2.40625 | 2 |
src/t4me/__init__.py | knirajiitb/t4me_AMMCR | 6 | 52816 | <reponame>knirajiitb/t4me_AMMCR
"""T4ME - Transport 4 MatErials - a code to calculate the electronic transport coefficients of materials."""
__version__ = '2.0.0'
| 1.148438 | 1 |
utils/read_BAIR_tfrecords.py | XiYe20/VPTR | 0 | 52817 | <reponame>XiYe20/VPTR
import tensorflow as tf
import numpy as np
from PIL import Image
from pathlib import Path
import shutil
import os
from tqdm import tqdm
#Requirements: tensorflow 2.6.0
def read_BAIR_tf2_record(records_dir, save_dir):
"""
Args:
record_file: string for the BAIR tf record file path
... | 2.703125 | 3 |
example/pysvusage.py | raybdzhou/PyChip-py-hcl | 1 | 52818 | <filename>example/pysvusage.py
import random
from pyhcl import *
from pysv import sv, DataType, Reference
from pyhcl.simulator import Simlite, DpiConfig
import random
class Add(BlackBox):
io = IO(
in1=Input(U.w(32)),
out=Output(U.w(32))
)
@sv(a=DataType.UInt, return_type=Reference(x=DataType... | 2.390625 | 2 |
tests/test_provider_vultr_vultr.py | mjuenema/python-terrascript | 507 | 52819 | <filename>tests/test_provider_vultr_vultr.py<gh_stars>100-1000
# tests/test_provider_vultr_vultr.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:31:06 UTC)
def test_provider_import():
import terrascript.provider.vultr.vultr
def test_resource_import():
from terrascript.resource.vultr.vultr ... | 1.546875 | 2 |
openpipe_hooks/__init__.py | vvzen/open-pipe | 1 | 52820 | # If the client has defined its own hooks, this package will useless.
# If not, we keep it just to make the import pass correctly | 1.3125 | 1 |
neural_models/morris_lecar.py | sgalella/NeuralModels | 2 | 52821 | import numpy as np
from scipy.integrate import odeint
class MorrisLecar:
"""
Creates a MorrisLecar model.
"""
def __init__(self, C=20, VL=-60, VCa=120, VK=-84, gL=2, gCa=4, gK=8,
V1=-1.2, V2=18, V3=12, V4=17.4, phi=0.06):
"""
Initializes the model.
Args:
... | 3.125 | 3 |
neuropype/nodes/CrossCorr.py | ablot/Pinceau | 0 | 52822 | <gh_stars>0
from neuropype import node
import matplotlib.cm as cm
from neuropype.ressources._common import gaussian_density, flatenList, exponential_density, conv_dict
from neuropype import parameter
from numpy import array
import numpy as np
import neuropype.ressources.progressbar as pgb
from neuropype.ressources.re... | 2.21875 | 2 |
app/tests/test_get_data.py | rafayahmed123/covid19-api | 0 | 52823 | """
FILE: test_get_data.py
DESCRIPTION: Test reading raw files from GitHub
AUTHOR: <NAME>
DATE: 11-April-2020
"""
# Import libraries
import pandas as pd
from ..utils import getData
getdataRep = getInstance.get_data()
# Test - Get Lookup table
def test_get_data_lookup_table() -> None:
result = getdataRep.get_data... | 2.6875 | 3 |
experiments/tf_trainer/common/base_keras_model.py | deeglaze/conversationai-models | 0 | 52824 | """Abstract Base Class for Keras Models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import tensorflow as tf
from keras import models
from tf_trainer.common import types
from tf_trainer.common import base_model
class BaseKerasModel(base... | 2.8125 | 3 |
stanza/pipeline/constituency_processor.py | asears/stanza | 3,633 | 52825 | <gh_stars>1000+
"""Processor that attaches a constituency tree to a sentence
The model used is a generally a model trained on the Stanford
Sentiment Treebank or some similar dataset. When run, this processor
attaches a score in the form of a string to each sentence in the
document.
TODO: a possible way to generalize... | 2.765625 | 3 |
cycle/__main__.py | Pedrosa-Andre/game_example | 0 | 52826 | import game.shared.gamecontants as gameconstants
from game.casting.cast import Cast
from game.casting.cycle import Cycle
from game.directing.director import Director
from game.services.keyboard_service import KeyboardService
from game.services.display_service import DisplayService
from game.shared.color import Colo... | 2.515625 | 3 |
python/test/eager_mode/annotate_args.py | rdadolf/torch-mlir | 213 | 52827 | <reponame>rdadolf/torch-mlir
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
# RUN: %PYTHON %s | FileCheck %s
... | 1.992188 | 2 |
test_generator/views.py | aipescience/django-client-test-mixins | 0 | 52828 | <reponame>aipescience/django-client-test-mixins<gh_stars>0
from collections import OrderedDict
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.utils.http import urlencode
from .core import TestMixin, TestSingleObjectMixin
class TestViewMixin... | 2.28125 | 2 |
cloudcafe/cloudkeep/client_lib/secrets/clients.py | rcbops-qa/cloudcafe | 0 | 52829 | <gh_stars>0
"""
Copyright 2013 Rackspace
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, s... | 2.015625 | 2 |
strings/first_unique_char.py | kandarpck/leetcode | 0 | 52830 | <reponame>kandarpck/leetcode<filename>strings/first_unique_char.py<gh_stars>0
from collections import Counter
class Solution:
def firstUniqChar(self, s):
"""
:type s: str
:rtype: int
"""
s_counter = Counter(s)
for i, char in enumerate(s):
if s_counter.ge... | 3.28125 | 3 |
asis18/cat/exploit.py | giosch/CTF-stuff | 0 | 52831 | <filename>asis18/cat/exploit.py
#!/usr/bin/python
#The libc was obtained by leaking pointers from the GOT and searching the libc_database
from pwn import *
import sys
def create(name,kind,age):
r.sendline("1")
r.recvuntil("What's the pet's name?\n> ")
r.sendline(name)
r.recvuntil("What's the pet's kin... | 2.5625 | 3 |
basi_python/list _concept/remove_list.py | KMONISH/learning-challenge-season-2 | 0 | 52832 | List = [2.3, 4.445, 3, 5.33, 1.054, 2.5]
List.remove(4.445)
print(List)
| 2.78125 | 3 |
src/qfit/scaler.py | ss199514/qfit-3.0 | 0 | 52833 | import logging
import numpy as np
from .transformer import Transformer, FFTTransformer
logger = logging.getLogger(__name__)
class MapScaler:
def __init__(self, xmap, scattering='xray'):
self.xmap = xmap
self.scattering = scattering
self._model_map = xmap.zeros_like(xmap)
def subtr... | 2.703125 | 3 |
fluent-python-code/01-data-model/vector.py | dym0080/learn-python | 0 | 52834 | <reponame>dym0080/learn-python<gh_stars>0
from math import hypot
class Vector:
def __init__(self,x=0,y=0):
self.x=x
self.y=y
def __repr__(self):
return 'Vector(%r,%r)' % (self.x,self.y)
def __abs__(self):
return hypot(self.x,self.y)
def __bool__(self):
ret... | 4.0625 | 4 |
tasks.py | harvest-project/bibliotik_archiver | 0 | 52835 | import time
from django.conf import settings
from Harvest.utils import get_logger
from monitoring.decorators import update_component_status
from monitoring.models import ComponentStatus
from plugins.bibliotik.client import BibliotikClient
from plugins.bibliotik.exceptions import BibliotikTorrentNotFoundException
from... | 1.828125 | 2 |
gaea-platform/src/common/api_exception.py | h3copen/baas | 25 | 52836 |
from flask import request,json
from werkzeug.exceptions import HTTPException
class ApiException(HTTPException):
code = 500
error_code = 500
msg = 'sorry, made a mistake'
def __init__(self,code=None, error_code=None, msg=None, header=None):
if code:
self.code = code
if msg:... | 2.828125 | 3 |
esp8266/clock/printf.py | JiangYangJie/Embedded | 1 | 52837 | <reponame>JiangYangJie/Embedded<filename>esp8266/clock/printf.py
from dictionary import dicts
class Printf:
def __init__(self,oled):
self.oled=oled
self.clear()
def clear(self):#清屏
self.oled.fill(0)
self.oled.show()
def en(self, String, x, y):#显示英文,oled:屏幕对象,string:英文内容,x,... | 2.984375 | 3 |
docker_images/speechbrain/app/common.py | huggingface/api-inference-community | 2 | 52838 | <reponame>huggingface/api-inference-community<filename>docker_images/speechbrain/app/common.py
from enum import Enum
from huggingface_hub import HfApi
class ModelType(Enum):
# audio-to-audio
SEPFORMERSEPARATION = "SEPFORMERSEPARATION"
SPECTRALMASKENHANCEMENT = "SPECTRALMASKENHANCEMENT"
# automatic-sp... | 2.09375 | 2 |
magi/examples/offline/run_bc.py | akbir/magi | 0 | 52839 | <filename>magi/examples/offline/run_bc.py
"""Run Behavior-Cloning (BC) baseline on D4RL."""
from absl import app
from absl import flags
from absl import logging
from acme import specs
from acme import types
from acme import wrappers
from acme.agents.jax import actors as acting_lib
from acme.jax import networks as netw... | 2 | 2 |
Aeneas_cryptographic_disc.py | barisozbas/IEEExtreme | 1 | 52840 | <reponame>barisozbas/IEEExtreme<gh_stars>1-10
import math
r = float(raw_input())
gap = lambda (a1,b1), (a2,b2) : math.sqrt( (a1 - a2) * (a1 - a2) + (b1- b2) * (b1-b2) )
polar = lambda r , angle : ( math.cos( angle ) * r, math.sin( angle ) * r)
coord = {0 : (0,0)}
for i in xrange (0,26):
letter, angle = raw_input... | 3.0625 | 3 |
tests/providers/amazon/aws/operators/test_emr_system.py | ChaseKnowlden/airflow | 15,947 | 52841 | <gh_stars>1000+
# 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"... | 1.703125 | 2 |
smaa.py | youqad/oxford-hack-2020 | 0 | 52842 | <reponame>youqad/oxford-hack-2020<gh_stars>0
from dataclasses import dataclass
import torch
import numpy as np
import pyro
import matplotlib.pyplot as plt
from pyro.infer import MCMC, NUTS
# import pyro.infer
# import pyro.optim
from pyro.distributions import Normal
# def model(data):
# """
# Explanation
# ... | 2.25 | 2 |
fabfile.py | maracuja/maracuja.github.io | 0 | 52843 | from fabric.api import *
def live():
""" Set the target to production. """
env.hosts = ['kurosaki@ichigo']
env.remote_app_dir = '/home/kurosaki/htdocs/setr.co.uk/'
env.build_dir = '_site/'
def push():
"""
Pushes the code to nominated server.
restart included.
doesn't touch ... | 2 | 2 |
gin/gin.py | Javanile/GIN | 3 | 52844 | # -*- coding: utf-8 -*-
"""gin.gin: provides entry point main()."""
__version__ = "0.0.4"
import sys
import os
from .parser import Parser
def main():
parser = Parser()
gin_src = sys.argv[1]
ini_dst = sys.argv[1].replace(".gin", ".ini")
if not os.path.isfile(gin_src):
print '... | 2.34375 | 2 |
tests/fi/data/parl_long_test_strings.py | aalto-speech/aalto-asr-preprocessor | 0 | 52845 | <filename>tests/fi/data/parl_long_test_strings.py
"""Long statement strings and other space consuming data definitions for testing are declared here.
This is done to avoid clutter in main test files.
"""
from typing import Any
from typing import List
from typing import Tuple
import pytest
parl_to_kaldi_pairs: List[T... | 2.3125 | 2 |
robot/evolved_robot.py | richban/behavioral.neuroevolution | 0 | 52846 | from robot.thymio_robot import ThymioII
from robot.vrep_robot import VrepRobot
from aseba.aseba import Aseba
from utility.util_functions import normalize
import numpy as np
T_SEN_MIN = 0
T_SEN_MAX = 4500
class EvolvedRobot(VrepRobot, ThymioII):
def __init__(self, name, client_id, id, op_mode, chromosome, robot_... | 2.25 | 2 |
json2darknet.py | Deahran/json2darknetyolo | 1 | 52847 | import argparse
import json
import os
try:
import cv2
def get_image_dims(im_file):
im = cv2.imread(im_file,0)
im_h, im_w = im.shape
return im_h, im_w
Exception.Modu
except ModuleNotFoundError as e:
from PIL import Image
def get_image_dims(im_file):
im = Image.open(im_file)
im_w, im_h = im.size
return ... | 2.703125 | 3 |
tests/test_parser.py | tricoder42/django-forme | 5 | 52848 | <filename>tests/test_parser.py
# coding: utf-8
from __future__ import unicode_literals
import pytest
from django import template
from forme.parser import FormeParser
def parse_template(content):
lexer = template.Lexer(content, '')
parser = template.Parser(lexer.tokenize())
token = parser.next_token()
... | 2.46875 | 2 |
libs/__init__.py | manishrawat4u/plugin.video.bloimediaplayer | 1 | 52849 | print('inside init of libs') | 1.039063 | 1 |
starlight_wrapper/utils.py | hypergravity/starlight_wrapper | 1 | 52850 | <reponame>hypergravity/starlight_wrapper
# -*- coding: utf-8 -*-
"""
Author
------
<NAME>
Email
-----
<EMAIL>
Created on
----------
- Sat Jul 16 22:30:00 2016
Modifications
-------------
- Sat Jul 16 22:30:00 2016 framework
- Sun Jul 17 23:00:00 2016 StarlightGrid
- Mon Jul 18 09:27:00 2016
Aims
----
- to g... | 1.929688 | 2 |
workflowparsers/lobster/parser.py | nomad-coe/workflow-parsers | 0 | 52851 | #
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD. See https://nomad-lab.eu for further info.
#
# 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/licen... | 2.109375 | 2 |
Examples/square.py | comptoolsres/Class_Files | 2 | 52852 | <reponame>comptoolsres/Class_Files
#!/usr/bin/env python
# square.py: Demo of argparse
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("square", help="display a square of a given number",
type=float)
args = parser.parse_args()
print(f"The square of {args.square} is {args.squ... | 3.859375 | 4 |
cgmzscore/exceptions.py | prajurock/cgmzscore | 0 | 52853 | class DataNotFound(RuntimeError):
pass
class DataError(RuntimeError):
pass
class InvalidAge(RuntimeError):
pass
class InvalidMeasurement(RuntimeError):
pass | 1.703125 | 2 |
maas_deploy/fabfile.py | Taximu/maas_scripts | 0 | 52854 | ##
# Fabric module to deploy MaaS. Run as root user.
#
import os
import sys
import time
import logging
from fabric.api import *
from fabric.operations import reboot
from fabric.colors import cyan, green, red
from fabric.context_managers import shell_env
from fabric.contrib.files import append, sed, comment
from fabri... | 2.0625 | 2 |
code/03_deployment/DataPreparation.py | maelcamerlynck/MachineLearningSamples-TwitterSentimentPrediction | 12 | 52855 | <gh_stars>10-100
import numpy as np
#import cPickle as pickle
import pickle
class Data_Preparation:
def __init__ (self, vectors_file):
self.vectors_dc=self.load_word_embedding_pickle(vectors_file)
def load_word_embedding_pickle(self, pickle_file):
vectors_dc = pickle.load( o... | 2.640625 | 3 |
import_snapshot.py | Earthnuker/Universe | 0 | 52856 | import re
from dateutil.parser import parse
from vessel import Vessel,Forum,InvalidVesselException,engine,session
from tqdm import tqdm
import urllib.request
import codecs
program_to_jinja={
"children count": "vessel.children|length",
"children random":"(vessel.children|random).name",
"children list":"('\n ... | 2.4375 | 2 |
test_draw.py | dmiyakawa/turtle-draw | 0 | 52857 | <gh_stars>0
#!/usr/bin/env python3
import unittest.mock
from unittest.mock import call
import draw
class TestDraw(unittest.TestCase):
def test_parse_command_1(self):
self.assertEqual([("F", 100), ("T", 90), ("F", 100), ("T", 90), ("F", 100), ("T", 90), ("F", 100)],
draw.parse_com... | 2.875 | 3 |
dynamodb_scripts/DeleteTables.py | mattmcclean/sam-voting-app | 0 | 52858 | from __future__ import print_function # Python 2/3 compatibility
import boto3
dynamodb = boto3.resource('dynamodb', endpoint_url="http://localhost:8000")
table = dynamodb.Table('Election')
table.delete()
table = dynamodb.Table('Vote')
table.delete() | 2.15625 | 2 |
neo/io/plexonio.py | michaelfsp/python-neo | 1 | 52859 | <filename>neo/io/plexonio.py
# encoding: utf-8
"""
Class for reading data from Plexion acquisition system (.plx)
Compatible with versions 100 to 106.
Other versions have not been tested.
This IO is developed thanks to the header file downloadable from:
http://www.plexon.com/downloads.html
Depend on:
Supported : Re... | 2.53125 | 3 |
tests/basics/modulo.py | lurch/micropython | 2 | 52860 | <gh_stars>1-10
# check modulo matches python definition
# this tests compiler constant folding
print(123 % 7)
print(-123 % 7)
print(123 % -7)
print(-123 % -7)
a = 321
b = 19
print(a % b)
print(a % -b)
print(-a % b)
print(-a % -b)
a = 987654321987987987987987987987
b = 19
print(a % b)
print(a % -b)
print(-a % b)
pr... | 2.75 | 3 |
src/safe.py | vincent-lg/cocomud | 3 | 52861 | <gh_stars>1-10
# Copyright (c) 2016-2020, <NAME>
# 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 notice, this
# list of condit... | 1.242188 | 1 |
build/lib/atesa/test/test_return_rcs.py | team-mayes/atesa_OLD | 0 | 52862 | <gh_stars>0
# from unittest import TestCase
#
#
# class TestReturn_rcs(TestCase):
# def test_return_rcs(self):
# self.fail()
# literal_ops = True
#
#
# rc_values = []
# for i in range(traj.__len__()): # iterate through frames
# op_values = candidatevalues(thread,frame=i).split('... | 2.75 | 3 |
setup.py | bgpkit/pybgpkit | 1 | 52863 | import setuptools
# read the contents of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
setuptools.setup(
name='pybgpkit',
version='0.1.0',
description='BGPKIT tools Python bindings',
url='https://github.co... | 1.625 | 2 |
src/napari_ids/_widget.py | tcotte/napari-IDS | 0 | 52864 | <filename>src/napari_ids/_widget.py
"""
This module is an example of a barebones QWidget plugin for napari
It implements the Widget specification.
see: https://napari.org/plugins/stable/guides.html#widgets
Replace code below according to your needs.
"""
import os
import pathlib
from datetime import datetime
from path... | 2.546875 | 3 |
keyman44/interface/chain_creation.py | sahabi/keyman44 | 0 | 52865 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/chain_creation.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.se... | 1.804688 | 2 |
cronjob/utils/cache.py | fucangyu/SimpleSpider | 4 | 52866 | <reponame>fucangyu/SimpleSpider<filename>cronjob/utils/cache.py
import logging
import socket
from collections import OrderedDict
LOGGER = logging.getLogger(__name__)
class LocalCache(OrderedDict):
def __init__(self, limit=None):
super().__init__()
self.limit = limit
def __setitem__(self, key... | 2.59375 | 3 |
test/ResultsAndPrizes/top-3/test_top_3_winning_numbers_of_the_last_draw.py | FearFactor1/SPA | 1 | 52867 | # Топ-3 + Выигрышные номера последнего тиража
def test_top_3_winning_numbers_last_draw(app):
app.ResultAndPrizes.open_page_results_and_prizes()
app.ResultAndPrizes.click_game_top_3()
app.ResultAndPrizes.button_get_report_winners()
assert "ВЫИГРЫШНЫЕ НОМЕРА" in app.ResultAndPrizes.parser_report_text_w... | 1.992188 | 2 |
slurmer/__init__.py | jmigual/slurmer | 0 | 52868 | <reponame>jmigual/slurmer
"""Slurmer package.
Use this package to run tasks in a computing cluster. Supported task schedulers are:
- `SLURM <https://slurm.schedmd.com/documentation.html>`_
"""
from .task_runner import Task, TaskFailedError, TaskParameters, TaskResult
__all__ = ["Task", "TaskFailedError", "TaskPar... | 1.398438 | 1 |
datahub/dbmaintenance/management/commands/create_sector.py | Staberinde/data-hub-api | 6 | 52869 | <filename>datahub/dbmaintenance/management/commands/create_sector.py
from logging import getLogger
import reversion
from datahub.dbmaintenance.management.base import CSVBaseCommand
from datahub.dbmaintenance.utils import parse_limited_string, parse_uuid
from datahub.metadata.models import Sector, SectorCluster
logg... | 2.65625 | 3 |
scheduler/judge.py | srobo/volunteer-scheduler | 0 | 52870 | <filename>scheduler/judge.py
class Judge:
def __init__(self, trial, comparator):
self.trial = trial
self.comparator = comparator
def judge(self, inputs, default):
results = {input: self.trial(input) for input in inputs}
eligible = {input: result for input, result in results.item... | 2.984375 | 3 |
tests/test_discussion.py | vpchung/challengeutils | 5 | 52871 | <gh_stars>1-10
'''
Test challengeutils.discussion functions
'''
import json
from unittest import mock
from unittest.mock import patch
import uuid
import requests
import synapseclient
from challengeutils import discussion
from challengeutils.discussion import DiscussionApi
from challengeutils.synapseservices.discussio... | 2.296875 | 2 |
Course_1/Week_02/2_ClosestPairs.py | KnightZhang625/Stanford_Algorithm | 0 | 52872 | <gh_stars>0
"""Merge Sort"""
def merge(array_left, array_right):
i, j = 0, 0
merged_array = []
while (i < len(array_left)) and (j < len(array_right)):
if array_left[i] < array_right[j]:
merged_array.append(array_left[i])
i +=1
else:
merged_array.append(array_right[j])
j +=1
if i < len(array_left):... | 3.390625 | 3 |
py_ctp/ctp_enum.py | xzstar/Rainbird2 | 4 | 52873 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from enum import Enum
class THOST_TE_RESUME_TYPE(Enum):
TERT_RESTART = 0
TERT_RESUME = 1
TERT_QUICK = 2
class TThostFtdcExchangePropertyType(Enum):
"""交易所属性类型"""
THOST_FTDC_EXP_Normal = 48
"""正常"""
THOST_FTDC_EXP_GenOrderByTrade = 49
... | 2.09375 | 2 |
mcommon.py | kunyuan/PyGW | 7 | 52874 | from scipy import *
from scipy import optimize
from numpy import linalg
from scipy import interpolate
from inout import *
import for_tetrahedra as ft
import fnc
import for_pade as fpade
from pylab import *
def Give2TanMesh(x0,L,Nw):
def fun(x,x0,L,Nw):
"x[0]=d, x[1]=w"
d=x[0]
w=x[1]
... | 2.3125 | 2 |
webscan/webscan/log.py | gwvsol/WebScanQRcode-JSON-RPC | 0 | 52875 | <reponame>gwvsol/WebScanQRcode-JSON-RPC
# import logging
from loguru import logger as logging
# log_format = '%(asctime)s.%(msecs)d|\
# %(levelname)s|%(module)s.%(funcName)s:%(lineno)d %(message)s'
# logging.basicConfig(level=logging.INFO,
# format=log_format,
# datefmt='%Y-%m-%... | 2.140625 | 2 |
src/motor/3rdparty/physics/bullet/mak/build.py | motor-dev/Motor | 0 | 52876 | <reponame>motor-dev/Motor
from waflib import Options
from waflib.TaskGen import feature, after_method
import os
@feature('motor:deploy:bullet')
@after_method('install_step')
@after_method('apply_link')
def deploy_bullet_package(task_gen):
if task_gen.env.PROJECTS:
return
path = task_gen.source_nodes[... | 2.015625 | 2 |
source/tagger/_classification/logisticregression.py | chrka/cip-tagging-exercise | 0 | 52877 | from sklearn.base import BaseEstimator
from sklearn.multiclass import OneVsRestClassifier
from sklearn.linear_model import LogisticRegression as SKLearnLR
class LogisticRegression(BaseEstimator):
def __init__(self):
pass
def fit(self, X, y):
# TODO: Consider pure (no penalty) LR
# TODO... | 2.78125 | 3 |
SBbadger/generate_serial.py | sys-bio/SBbadger | 1 | 52878 | <reponame>sys-bio/SBbadger
import sys
from SBbadger import buildNetworks
import os
import shutil
import glob
import antimony
import matplotlib.pyplot as plt
import numpy as np
import importlib
pydot_spec = importlib.util.find_spec("pydot")
found_pydot = pydot_spec is not None
if found_pydot:
import pydot
def m... | 2.3125 | 2 |
Ago-Dic-2019/Ricardo_Romero_Medina/Practica1/Practica_7-1.py | Arbupa/DAS_Sistemas | 41 | 52879 | <gh_stars>10-100
car=input("¿Que carro desea rentar? ")
print("Deseo rentar un carro de la marca ",car) | 3.265625 | 3 |
tomography/likelihood_maximisation.py | matteoacrossi/adapt_ic-povm | 0 | 52880 | <reponame>matteoacrossi/adapt_ic-povm
import numpy as np
# Log-likelihood function
def log_l(rho, observables, counts):
return np.sum(counts * np.log(np.real(np.tensordot(observables, rho.T)))) / np.sum(
counts
)
# R(rho) operator
def R(rho, observables, counts):
R = np.zeros_like(rho)
trace... | 2.1875 | 2 |
day13/day13.py | gmelodie/advent-of-code-2021 | 0 | 52881 | import numpy as np
MAX = 10000
matrix = np.full((MAX, MAX), False)
def pretty_print(matrix):
print_matrix = np.full(matrix.shape, ".")
print_matrix[matrix] = "#"
for row in print_matrix:
for symb in row:
print(symb, end="")
print()
def fold_once(matrix, axis, value):
if ... | 3.546875 | 4 |
torchlib/datasets/__init__.py | pedrodiamel/kaggle-tgs-salt-identification | 0 | 52882 | <reponame>pedrodiamel/kaggle-tgs-salt-identification<gh_stars>0
from .tgsdata import *
from .imageutl import *
| 1.242188 | 1 |
tinyforum/models.py | matthiask/django-tinyforum | 0 | 52883 | from ckeditor.fields import RichTextField
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.html import strip_tags
from django.utils.text import Truncator
from django.utils.translation import gettext_lazy as _
from html_sani... | 2.0625 | 2 |
lab6_ILP/main.py | j-adamczyk/ADPTO_templates | 0 | 52884 | <gh_stars>0
import os
from time import time
from ilp.approx_vertex_cover import approx_vertex_cover_solver
from ilp.example import solve_and_print_example
from ilp.vertex_cover import vertex_cover_solver
from ilp.weighted_vertex_cover import weighted_vertex_cover_solver
from utils.dimacs import *
graph_names = [
... | 2.59375 | 3 |
account/urls.py | mateuszwwwrobel/Expense_Tracker_Django | 0 | 52885 | from django.urls import path
from account import views as account_views
urlpatterns = [
path('begin/', account_views.BeginView.as_view(), name='begin'),
path('signup/', account_views.SignUpView.as_view(), name='signup'),
path('login/', account_views.LoginView.as_view(), name='login'),
path('logout/', ... | 1.75 | 2 |
0198_HouseRobber.py | taro-masuda/leetcode | 0 | 52886 | <filename>0198_HouseRobber.py
class Solution:
def rob(self, nums: List[int]) -> int:
if len(nums) == 0:
return 0
elif len(nums) == 1:
return nums[0]
elif len(nums) == 2:
return max(nums[0], nums[1])
scores = [0] * len(nums)
scores[0] =... | 3.03125 | 3 |
src/lockFile.py | JaredButcher/Client | 0 | 52887 | """MEG system lockfile parser
Can be used to parse the lock file and preform operations on the lockfile
Only interacts with the lockfile, does not preform any git actions
Does not check permissions before actions are taken
All file paths are relitive to the repository directory
Working directory should be changed by ... | 3.265625 | 3 |
artistapp/artist/migrations/0007_auto_20201208_1134.py | fallprojects/ArtistApp | 0 | 52888 | # Generated by Django 3.1.3 on 2020-12-08 11:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('artist', '0006_auto_20201208_1052'),
]
operations = [
migrations.AlterModelOptions(
name='comme... | 1.5625 | 2 |
exercicios/exe084/exe084.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | 0 | 52889 | <reponame>tiagolsouza/exercicios-Curso-em-video-PYTHON<filename>exercicios/exe084/exe084.py
a = 50
print('\033[32m_\033[m'*a)
print('\033[1;32m{:=^{}}\033[m'.format('SISTEMA DE IDENTIFICAÇÃO DE PESOS', a))
print('\033[32m-\033[m'*a)
listafinal = list()
listainit = list()
tamanho = 0
maiorp = menorp = 0
continuar = 's'... | 3.53125 | 4 |
result.py | Hom-Wang/python_clang_struct_conv | 1 | 52890 | from ctypes import *
class result(Structure):
_fields_ = [
("type", c_uint),
("nbyte", c_uint),
("param", c_ubyte*2),
("data", c_ubyte*8),
]
| 2.296875 | 2 |
examples/dehydrogenation/3-property-mappings/mappings_from_ontology/map_substance.py | TorgeirUstad/dlite | 0 | 52891 | from pathlib import Path
from ontopy import get_ontology, World
# Setup dlite paths
thisdir = Path(__file__).parent.absolute()
rootdir = thisdir.parent.parent
# Note install emmopython from github, not pypi.
world = World()
mapsTo_onto = world.get_ontology(f'{rootdir}/ontology/mapsTo.ttl').load(
EMMObased=Fals... | 2.25 | 2 |
oxforddictionaries/caching_language_dictionary.py | RafaelBroseghini/OxfordAPI | 8 | 52892 | <filename>oxforddictionaries/caching_language_dictionary.py
import util
from oxford_api import OxfordApi
class CachingLanguageDictionary:
def __init__(
self,
oxford_api: OxfordApi,
language='en-gb',
cached_words_path='oxford_cached_words.json',
bad_words... | 2.75 | 3 |
cifar.py | Lornatang/PyTorch-AlexNet | 4 | 52893 | <filename>cifar.py
# Copyright 2019 Lorna Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 2.15625 | 2 |
xframes/deps/__init__.py | cchayden/xframes | 0 | 52894 | from distutils.version import StrictVersion
import logging
def __get_version(version):
if 'dev' in str(version):
version = version[:version.find('.dev')]
return StrictVersion(version)
# Detect pandas and use a mock if missing
PANDAS_MIN_VERSION = '0.13.0'
try:
import pandas
if __get_version... | 2.65625 | 3 |
ApartadoA.py | JIraizoz/CLO-PROJECT | 0 | 52895 | from pyspark import SparkConf, SparkContext
from pyspark import SQLContext
from pyspark.sql.functions import udf
import string
conf = SparkConf().setAppName('MovieRating')
sc = SparkContext(conf = conf)
sqlContext = SQLContext(sc)
df = sqlContext.read.format("com.databricks.spark.csv").option("header", "true").optio... | 3.125 | 3 |
ASCIIencoder.py | MMquant/ASCII_Encoder | 0 | 52896 | #!/usr/bin/env python3
################################################################################
# INTRODUCTION
################################################################################
# Encoder Title: ASCII shellcode encoder via AND, SUB, PUSH
# Date: 26.6.2019
# Encoder Author: <NAME>, www.mmquant.ne... | 2.84375 | 3 |
iautomate/resources/execution_resource.py | iranianpep/iautomate | 0 | 52897 | from . import abstract_resource
class ExecutionResource(abstract_resource.AbstractResource):
def __init__(self, properties, global_variables=None):
super(ExecutionResource, self).__init__(properties, global_variables)
def run(self):
self._run_shell_command(self.action)
| 2.453125 | 2 |
park/envs/tf_placement_sim/tf_placement_sim.py | utkarsh5k/park | 180 | 52898 | <gh_stars>100-1000
import os
import numpy as np
import math
from itertools import permutations
import wget
import pickle
import networkx as nx
import park
from park import core, spaces, logger
from park.utils.misc import create_folder_if_not_exists
from park.spaces import Tuple, Box, Discrete, Graph, Null
from park.pa... | 2.234375 | 2 |
pypedream/expressions/equation.py | Nukleon84/pypedream | 9 | 52899 | from . basic import Expression,Variable
class Equation(object):
def __init__(self, rhs, name=""):
self.name=name
self.rhs=rhs
self.variables=[]
self.exploreVariables(rhs)
return
def exploreVariables(self, expr):
if(isinstance(expr,Variable)):
... | 3.625 | 4 |