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 |
|---|---|---|---|---|---|---|
network_objects/decorators/LimitedChargeOrDischargeCapacity.py | Jipje/local_smart_grid_simulation | 0 | 12785251 | <gh_stars>0
class LimitedChargeOrDischargeCapacity:
def __init__(self, network_object, max_charge_index, max_discharge_index):
self.network_object = network_object
self.max_charge_index = max_charge_index
self.max_discharge_index = max_discharge_index
self.maximum_charge_kwh = 0
... | 2.671875 | 3 |
apps/fithm-gateway/apps/user/router.py | sergio1221/flask-backend | 3 | 12785252 | from flask_restx import Namespace, Resource
from flask import request
from .lib.parser import UserParser
from .view import UserView
from libs.depends.entry import container
from libs.middleware.auth import login_required, active_required
user = Namespace('user', path='/users', decorators=[active_required(), l... | 2.25 | 2 |
imageprocessor/rotate.py | UBC-MDS/MDSPyGram | 0 | 12785253 | # This script is for the rotate function
import numpy as np
import matplotlib.pyplot as plt
import cv2
def rotate(image, degree, output_path):
"""
Rotates an OpenCV 2 / NumPy image about it's centre by the given degree
(in degrees). The returned image will be large enough to hold the entire
new image,... | 3.90625 | 4 |
tensorflow/mantaGen/scenes/smoke_buoyant_scene.py | BrianKmdy/mantaflow | 95 | 12785254 | #******************************************************************************
#
# MantaGen
# Copyright 2018 <NAME>, <NAME>, <NAME>
#
# This program is free software, distributed under the terms of the
# Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
#**************************************... | 2.4375 | 2 |
4/test_main.py | felixb/advent-of-code-2017 | 0 | 12785255 | #! /usr/bin/env python3
import unittest
from main import run_1, run_2
class Test(unittest.TestCase):
def test_1(self):
self.assertEqual(run_1("aa bb cc dd ee\naa bb cc dd aa\naa bb cc dd aaa"), 2)
def test_2(self):
self.assertEqual(
run_2("abcde fghij\nabcde xyz ecdab\na ab abc a... | 3.53125 | 4 |
atari/experiment_1_atari/main.py | arcosin/Task_Detector | 0 | 12785256 | <reponame>arcosin/Task_Detector<filename>atari/experiment_1_atari/main.py
import sys
import time
import random
import json
from collections import defaultdict
import torch
import torchvision.transforms as transforms
from torchvision.utils import save_image
from PIL import Image as Image
from datetime import datetime
... | 2.140625 | 2 |
Ex028.py | CaioHRombaldo/PythonClasses | 0 | 12785257 | <reponame>CaioHRombaldo/PythonClasses<gh_stars>0
from random import randint
from time import sleep
answer = int(input('* Computer sound * Im thinking of a number from 1 to 5, try to guess: '))
rand = randint(1, 5)
print('PROCESSING...')
sleep(2)
if answer == rand:
print('Congratulations, I dont know how you did i... | 3.828125 | 4 |
score.py | htang22/pong_on_pygame | 0 | 12785258 | import pygame
class Score:
def __init__(self):
self.right_score = 0
self.left_score = 0
self.right_cord = (465, 50)
self.left_cord = (300, 50)
self.left_color = (0, 0, 0)
self.right_color = (0, 0, 0)
def show_score(self, window, color):
"""... | 3.671875 | 4 |
python/celerite2/__init__.py | jacksonloper/celerite2 | 38 | 12785259 | <filename>python/celerite2/__init__.py
# -*- coding: utf-8 -*-
__all__ = ["__version__", "terms", "GaussianProcess"]
from . import terms
from .celerite2_version import __version__
from .numpy import GaussianProcess
__uri__ = "https://celerite2.readthedocs.io"
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = ... | 1.96875 | 2 |
scripts/get_seqs.py | MonashBioinformaticsPlatform/iffyRna | 1 | 12785260 | <reponame>MonashBioinformaticsPlatform/iffyRna
#!/usr/bin/env python3
# -*- coding: iso-8859-15 -*-
import sys
import gzip
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
feats = sys.argv[1]
ref_genome = sys.argv[2]
feats_dict = {}
with open(feats) as feats_handl:
for i in feat... | 2.171875 | 2 |
app/utils/navigation.py | tch1bo/viaduct | 11 | 12785261 | <reponame>tch1bo/viaduct<filename>app/utils/navigation.py<gh_stars>10-100
# -*- coding: utf-8 -*-
import datetime
import re
from flask import render_template, request, url_for
from flask_login import current_user
from app import db
from app.forms.user import SignInForm
from app.models.activity import Activity
from app... | 2.21875 | 2 |
autofit/plot/__init__.py | vishalbelsare/PyAutoFit | 0 | 12785262 | from autofit.plot.mat_wrap.wrap.wrap_base import Units
from autofit.plot.mat_wrap.wrap.wrap_base import Figure
from autofit.plot.mat_wrap.wrap.wrap_base import Axis
from autofit.plot.mat_wrap.wrap.wrap_base import Cmap
from autofit.plot.mat_wrap.wrap.wrap_base import Colorbar
from autofit.plot.mat_wrap.wrap.wrap_b... | 1.4375 | 1 |
tests/test_spyd/test_authentication/test_services/test_vanilla/test_auth_success.py | DanSeraf/spyd | 4 | 12785263 | import unittest
from spyd.authentication.services.vanilla.auth_success import VanillaAuthSuccess
class TestVanillaAuthSuccess(unittest.TestCase):
def setUp(self):
self.instance = VanillaAuthSuccess('localhost', 'chasm')
def test_get_group_names(self):
group_names = self.instance.group_pro... | 2.484375 | 2 |
your_projects/aymen_api_music/main.py | kdj309/H4ckT0b3rF3st-2k21 | 23 | 12785264 | import tekore as tk
app_token = tk.request_client_token("b516728497b34264afab4e995b4e2569", "<KEY>")
spotify = tk.Spotify(app_token)
def menu():
print("search for:\n1. Artist\n2. Album\n3. Track ")
num = input("type your input there : ")
if num == "1":
artist_name = input("what's the artist name... | 3.5 | 4 |
rasa_core/channels/rasa_chat.py | tupac56/rasa_core | 0 | 12785265 | <filename>rasa_core/channels/rasa_chat.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import requests
from flask import Blueprint, request, jsonify, abort
from flask_cors import CORS, cross_origin
... | 2.203125 | 2 |
project/submissions/avneesh/astar_path.py | naveenmoto/lablet102 | 1 | 12785266 | """
Generates a path on the given occupancy grid (map of
the environment)
"""
import networkx as nx
from grid_loader import Grid
import numpy as np
def euclidean(node1, node2):
x1, y1 = node1
x2, y2 = node2
return ((x1-x2)**2+(y1-y2)**2)**0.5
class AStar:
# Constructor
def __init__(self)... | 3.453125 | 3 |
riaps-x86runtime/env_setup_tests/WeatherMonitor/TempSensor.py | timkrentz/riaps-integration | 7 | 12785267 | '''
Created on Jan 25, 2017
@author: metelko
'''
# riaps:keep_import:begin
from riaps.run.comp import Component
import logging
import time
import os
# riaps:keep_import:end
class TempSensor(Component):
# riaps:keep_constr:begin
def __init__(self):
super(TempSensor, self).__init__()
self.pid = os.ge... | 2.125 | 2 |
tests/assign.py | fangyuchen86/mini-pysonar | 22 | 12785268 | def f():
x = 0
def g(y):
global x
x = y
g(2)
print x
f()
| 2.984375 | 3 |
boards/iotSDR-IOT_Z7020/iotSDR_IOT/notebooks/.ipynb_checkpoints/iotSDR_Device-checkpoint.py | mfkiwl/iotSDR | 12 | 12785269 | <reponame>mfkiwl/iotSDR
import iotFrontEndCore
import iotSDR_defs as defs
from pynq import MMIO
import pynq.lib.dma
from pynq import Xlnk
from pynq import Overlay
import numpy as np
import threading
import time
from queue import Queue
class iotSDR():
def __init__(self,overlay,args):
... | 2.4375 | 2 |
cogs/help.py | aNOOBisTheGod/upgraded-discord-bot | 3 | 12785270 | <reponame>aNOOBisTheGod/upgraded-discord-bot
import discord
from discord.ext import commands
from discord.errors import Forbidden
async def send_embed(ctx, embed):
try:
await ctx.send(embed=embed)
except Forbidden:
try:
await ctx.send("Hey, seems like I can't send embeds.... | 2.359375 | 2 |
generate_samples.py | mnielsen/iGAN | 14 | 12785271 | <reponame>mnielsen/iGAN
from __future__ import print_function
import argparse, iGAN_predict
from pydoc import locate
from lib import utils
from lib.rng import np_rng
import cv2
import numpy as np
from lib.theano_utils import floatX
import requests
from PIL import Image
from StringIO import StringIO
def parse_args():
... | 2.578125 | 3 |
tasfie/migrations/0007_auto_20190820_0007.py | mablue/Specialized-Procurement-and-Sales-Management-System-for-East-Azarbaijan-Gas-Company | 30 | 12785272 | <reponame>mablue/Specialized-Procurement-and-Sales-Management-System-for-East-Azarbaijan-Gas-Company<filename>tasfie/migrations/0007_auto_20190820_0007.py
# Generated by Django 2.2.4 on 2019-08-20 00:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ta... | 1.054688 | 1 |
dashunderscoredash/cogs/develop.py | rtao258/-_- | 1 | 12785273 | # -*- coding: utf-8 -*-
from discord import Embed, Member
from discord.ext.commands import command, Cog, Context
import time
from dataclasses import dataclass
@dataclass
class Job:
title: str
salary: float
responsibilites: str
requirements: str
JOBS = [
Job(
"Backend Specialist",
... | 2.875 | 3 |
main.py | yptheangel/human-skin-segmentation | 0 | 12785274 | import cv2
from model import PersonSegmentation
if __name__ == '__main__':
# change 'cpu' to 'cuda' if you have pytorch cuda and your discrete GPU has enough VRAM
# output size will autoscale to fit input image aspect ratio
# if you want full image resolution set 'is_resize=False'
ps = PersonSegmentati... | 3 | 3 |
tests/test_version.py | rchenzheng/datadog-api-client-python | 32 | 12785275 | def test_version():
from datadog_api_client.version import __version__
assert __version__
| 1.351563 | 1 |
configs/CCNuE/config/AnalysisConfig.py | ryounsumiko/CC-NuE-XSec | 0 | 12785276 | """
AnalysisConfig.py:
Centralized configuration for the nu_e CCQE analysis:
signal definitions (nu vs. anti-nu),
file locations,
etc.
Original author: <NAME> (<EMAIL>)
January 2014
"""
import ROOT
ROOT.PyConfig.IgnoreCommandLineOptions = True
#ROOT.gErrorIgnoreLevel = ROOT.k... | 2.171875 | 2 |
crawler/browser/condition.py | CvvT/crawler_sqlmap | 9 | 12785277 | <reponame>CvvT/crawler_sqlmap<gh_stars>1-10
#! /usr/bin/env python
# -*- coding: utf-8 -*-
class jQuery_load(object):
def __init__(self):
pass
def __call__(self, driver):
try:
ret = driver.execute_script("return jQuery.active")
return int(ret) == 0
except:
... | 2.140625 | 2 |
XAF V2.py | BasVVisser/XAF-Auditfiles | 1 | 12785278 | <reponame>BasVVisser/XAF-Auditfiles
#XAF V2 (CLAIR2.00) XML inlezen en exporteren naar CSV
#Dit programma leest een XAF V2 (CLAIR2.00) bestand in een Pandas Dataframe en maakt van alle tabellen 1 totaaltabel en exporteert deze naar een CSV-bestand.
#Benodigde modules
import pandas as pd
import numpy as np
import... | 2.421875 | 2 |
geolib/models/dsheetpiling/internal_partial_factors.py | Deltares/geolib | 4 | 12785279 | from geolib.models import BaseDataClass
from geolib.models.dseries_parser import DSeriesInlineMappedProperties
class PartialFactorsEurocodeDa1Set1(DSeriesInlineMappedProperties):
safetyfactorgammad: float = 1.00
safetyfactoreta: float = 1.00
loadfactorpermunfav: float = 1.00
loadfactorpermfav: float =... | 1.90625 | 2 |
uts/uts_17_aut_py/1/J.py | viad00/code_olymp | 0 | 12785280 | <filename>uts/uts_17_aut_py/1/J.py<gh_stars>0
ser = int(input())
mas = list(map(int, input().split()))
ind = ser // 2
mas1 = mas[:ind]
mas2 = mas[ind:]
mas1.sort()
mas2.sort(reverse=True)
for i in mas1:
print(i, end=' ')
for i in mas2:
print(i, end=' ')
| 2.84375 | 3 |
cogs/db_optimise.py | pratheek78/Ezebot-Open-Source | 2 | 12785281 | <reponame>pratheek78/Ezebot-Open-Source
import discord, pymongo, os
from discord.ext import commands
from dotenv import load_dotenv
from DiscordBot import client
"""Optimise Database usage by removing server data when the bot leaves that server"""
# Mongo variables
load_dotenv()
MONGOCONN = os.getenv('Mo... | 2.359375 | 2 |
enthought/chaco/shell/scaly_plot.py | enthought/etsproxy | 3 | 12785282 | <filename>enthought/chaco/shell/scaly_plot.py<gh_stars>1-10
# proxy module
from __future__ import absolute_import
from chaco.shell.scaly_plot import *
| 1.1875 | 1 |
forestsim/ForestSim.py | CharlesGaydon/forestsim | 1 | 12785283 | import numpy as np
import collections
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.manifold import MDS
from time import time
from warnings import warn
class ForestSim():
def __init__(self, forest):
# TODO : adapt if non sklearn forest used
self.forest = forest
def fit... | 2.90625 | 3 |
tests/test_sections_Fillet.py | iamlikeme/sections | 0 | 12785284 | <reponame>iamlikeme/sections<gh_stars>0
import unittest
import sys
from math import pi
sys.path.insert(0, "..")
from sections.sections import Fillet
import test_sections_generic as generic
class TestPhysicalProperties(generic.TestPhysicalProperties, unittest.TestCase):
@classmethod
def setUpClass(cls):
... | 2.40625 | 2 |
connection.py | pizzapanther/gae_boto | 1 | 12785285 |
import gae_boto.settings as settings
from .apis.sqs import SQS
from .apis.route53 import Route53
class AmazonConnection (object):
def __init__ (self, aws_id, aws_key, aws_acct=None, region=None):
self.aws_id = aws_id
self.aws_key = aws_key
self.aws_acct = aws_acct
self.region = region
if s... | 2.28125 | 2 |
pyinfra/facts/yum.py | blarghmatey/pyinfra | 1,532 | 12785286 | from pyinfra.api import FactBase
from .util import make_cat_files_command
from .util.packaging import parse_yum_repositories
class YumRepositories(FactBase):
'''
Returns a list of installed yum repositories:
.. code:: python
[
{
'name': 'CentOS-$releasever - Apps',
... | 2.234375 | 2 |
Others/code_festival/cf17-final-open/a.py | KATO-Hiro/AtCoder | 2 | 12785287 | <filename>Others/code_festival/cf17-final-open/a.py<gh_stars>1-10
# -*- coding: utf-8 -*-
def main():
from re import search
s = input()
pattern = r'^A?KIHA?BA?RA?$'
is_match = search(pattern, s)
if is_match:
print('YES')
else:
print('NO')
if __name__ == '__main__':
main... | 2.921875 | 3 |
Scripts/python/scripts mundo 2/teste052.py | BrenoNAlmeida/Scripts-Escola | 0 | 12785288 | x= int(input('bla bla bla = '))
e_primo = True
for n in range (2 , x):
if x % n == 0:
e_primo = False
break
if e_primo:
print('o numero é primo ')
else:
print('nao é primo')
| 3.59375 | 4 |
paca_distance.py | nntrongnghia/chatenoud_delorme | 0 | 12785289 | <filename>paca_distance.py
from bs4 import BeautifulSoup as soup
import requests
import re
import time
import sqlite3 as sql
import pandas as pd
wiki = 'https://fr.wikipedia.org/wiki/Liste_des_communes_des_Bouches-du-Rh%C3%B4ne'
page = requests.get(wiki)
html = soup(page.content,'html.parser')
content = html.find(... | 2.953125 | 3 |
data/test/python/3c5cd7a0d3d83c56ea0eb09bf56765f8b2cf2fe5main.py | harshp8l/deep-learning-lang-detection | 84 | 12785290 | <reponame>harshp8l/deep-learning-lang-detection
import sys
from resources.resource_manager import GetImagePath
def GetPygameWindowAndController():
""" Return the Pygame Window and Controller """
from Screen.Pygame.Menu.MainMenu.main_menu_controller import MainMenuController
from kao_gui.pygame.window impo... | 2.828125 | 3 |
mpglue/mpglue/rad_calibration.py | siu-panh/mapeo-uso-del-suelo | 0 | 12785291 | <reponame>siu-panh/mapeo-uso-del-suelo
#!/usr/bin/env python
"""
@author: <NAME>
Date Created: 9/24/2011
"""
from __future__ import division, print_function
from future.utils import viewitems
from builtins import int, map
import math
from copy import copy
import datetime
from collections import OrderedDict
import ca... | 2.34375 | 2 |
nanoCameras/Hamamatsu_nanoCam.py | hzg-wpi/p05nano | 0 | 12785292 | <gh_stars>0
import time
import PyTango
import p05.common.PyTangoProxyConstants as proxies
import p05.tools.misc as misc
class Hamamatsu_nanoCam():
def __init__(self, tHama=None, tTrigger=None, imageDir=None, exptime=None):
if tHama == None:
self.tHama = PyTango.DeviceProxy(proxies.camera_ham... | 2.0625 | 2 |
scripts/models/CNN_using_persistence_images_on_patch.py | pjhartout/TDA_ADNI_MLCB | 1 | 12785293 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""CNN_using_persistence_images_on_patch.py
The aim of this script is to perform the training of a CNN using persistence
images as a input. This script is inspired from this script:
BorgwardtLab/ADNI_MRI_Analysis/blob/mixed_CNN/mixed_CNN/run_Sarah.py
To get real time info... | 2.640625 | 3 |
yah/types/device.py | sunsx0/yah | 0 | 12785294 | <reponame>sunsx0/yah<gh_stars>0
import typing
import dataclasses as dc
from .capability import CapabilityBase
from .properties import PropertyBase
@dc.dataclass
class Device:
id: str
name: str
type: str
icon_url: str = ''
capabilities: typing.List[CapabilityBase] = dc.field(default_factory=list)... | 2.234375 | 2 |
TensorFlow_Classification/TensorFlow_AlexNet/train.py | YouthJourney/Deep-Learning-For-Image-Process | 2 | 12785295 | <reponame>YouthJourney/Deep-Learning-For-Image-Process
# -*- coding: UTF-8 -*-
"""
Author: LGD
FileName: train
DateTime: 2021/1/20 17:19
SoftWare: PyCharm
"""
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
from TensorFlow_AlexNet.model import AlexNet_v1, Al... | 2.734375 | 3 |
Testing/doctesting.py | lvolkmann/couch-to-coder-python-exercises | 0 | 12785296 | """
Create docstring tests for the following functions
"""
import doctest
# Example
def get_area_rect(length, width):
"""Returns area of rectangle
>>> get_area_rect(5 , 5)
25
>>> get_area_rect(5 , 0)
Traceback (most recent call last):
...
ValueError
>>> g... | 4 | 4 |
settings.py | AtleMichaelSelberg/3dpav-desktop | 0 | 12785297 | INCHES_TO_CENIMETERS = 2.54
class Reading():
def __init__(self, value, stamp):
self.value = value
self.stamp = stamp | 2.21875 | 2 |
JobScheduleEnv/envs/JobScheduleEnv.py | changxin-ge/JobScheduleEnv | 0 | 12785298 | <filename>JobScheduleEnv/envs/JobScheduleEnv.py<gh_stars>0
# coding: utf-8
import pandas as pd
import gym
import numpy as np
import datetime
import random
class JobScheduleEnv(gym.Env):
def __init__(self, config=None):
""" Job schedule environment constructor
Args:
config: configurat... | 2.78125 | 3 |
skeletor/error.py | vmasrani/skeletor | 66 | 12785299 | """ Exception handling for skeletor """
class SkeletorException(Exception):
""" General exception raised by skeletor """
pass
| 1.726563 | 2 |
examples/example1/example.py | bb515/probabilistic-peridynamics-project | 0 | 12785300 | """A simple, 2D peridynamics simulation example."""
import argparse
import cProfile
from io import StringIO
import numpy as np
import pathlib
from peridynamics import Model
from peridynamics.model import initial_crack_helper
from peridynamics.integrators import Euler
from pstats import SortKey, Stats
mesh_file = pathl... | 2.96875 | 3 |
src/z3c/dav/exceptions/__init__.py | mkerrin/z3c.dav | 1 | 12785301 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 1.765625 | 2 |
Codeforces/C_Nice_Garland.py | anubhab-code/Competitive-Programming | 0 | 12785302 | n=int(input())
s=input()
l=["RGB","RBG","GRB","GBR","BGR","BRG"]
mn=10**10
ans=""
for i in l:
t=i
t=t*((n+3)//3)
t=t[0:n]
c=0
for j in range(n):
if t[j]!=s[j]:
c+=1
if c < mn:
mn=c
ans=t
print(mn)
print(ans) | 3.203125 | 3 |
snek/__init__.py | MaT1g3R/dot_snek | 0 | 12785303 | __license__ = 'MIT'
__title__ = 'dot_snek'
__version__ = '0.0.5'
__url__ = 'https://github.com/MaT1g3R/dot_snek'
__author__ = 'MaT1g3R'
__description__ = 'Dot files manager'
| 0.953125 | 1 |
tf_encrypted/player/player.py | bendecoste/tf-encrypted | 0 | 12785304 | <gh_stars>0
from typing import Optional
import tensorflow as tf
class Player(object):
def __init__(self, name: str, index: int, device_name: str, host: Optional[str] = None) -> None:
self.name = name
self.index = index
self.device_name = device_name
self.host = host
def player(p... | 2.75 | 3 |
tools/change_model_savings.py | hli2020/turbo-boost-detection | 18 | 12785305 | <reponame>hli2020/turbo-boost-detection
import torch
import os
# in terminal, execute python this_file_name.py, the following path is right;
# however, in MacPycharm, it sees tools folder as root
base_name = 'results/meta_101_quick_3_l1_sig_multi/train'
file_name = 'mask_rcnn_ep_0006_iter_001238.pth'
# old file
model_... | 2.140625 | 2 |
Sim.Pro.Flow/src/clustering.py | EmmaAspland/Sim.Pro.Flow | 1 | 12785306 | <gh_stars>1-10
import numpy as np
import pandas as pd
from pyclustering.cluster.kmedoids import kmedoids
from pyclustering.utils.metric import distance_metric, type_metric
from sklearn.metrics import silhouette_samples, silhouette_score
from collections import Counter
import matplotlib.pyplot as plt
import imp
import ... | 2.34375 | 2 |
model.py | chinmaydas96/CarND-Behavioral-Cloning-P3 | 0 | 12785307 | <filename>model.py
## Import the necessary libraries
import os
import csv
import cv2
import sklearn
import numpy as np
from keras.models import Sequential
from keras.layers import Lambda, Conv2D, MaxPool2D, Cropping2D, Flatten, Dense,Dropout
from keras.callbacks import ModelCheckpoint
from keras.utils import plot_mod... | 3.203125 | 3 |
codegeneration/code_manip/file_utils.py | sacceus/BabylonCpp | 277 | 12785308 | <gh_stars>100-1000
import os
import os.path
import codecs
from typing import *
from bab_types import *
def files_with_extension(folder: Folder, extension: Extension) -> List[FileFullPath]:
r = []
ext_len = len(extension)
if not os.path.isdir(folder):
print("ouch")
for root, _, files in os.walk... | 2.734375 | 3 |
src/terra/contracts/orion.py | fentas/staketaxcsv | 0 | 12785309 | # known contracts from protocol
CONTRACTS = [
# Airdrop
"terra1rqlu6w83tzrmm04ld97muwakuegn4c09vwgk2l",
]
def handle(exporter, elem, txinfo, contract):
print(f"Orion! {contract}")
#print(elem)
| 1.507813 | 2 |
events/admin.py | NyntoFive/big-peach | 4 | 12785310 | <reponame>NyntoFive/big-peach<gh_stars>1-10
from django.contrib import admin
from events.models import Location, Event
class EventAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'start', 'location')
class LocationAdmin(admin.ModelAdmin):
prepopulated_fields = {... | 1.960938 | 2 |
test/utils/utils.py | Andres-GC/py-spiffe-HPE | 0 | 12785311 | <reponame>Andres-GC/py-spiffe-HPE<gh_stars>0
def read_file_bytes(filename):
with open(filename, 'rb') as file:
return file.read()
| 2.3125 | 2 |
experimentos/Experimentos_artigo_2/parse.py | dcomp-labPi/G-PETo | 0 | 12785312 | import xml.etree.ElementTree as ET
from os import sys
#Return *.c for 1, *.o for 2
#tipo = sys.argv[1]
#names_files = []
names_files = []
names_functions = []
hosts_ips = []
names = ""
root = ET.parse('startup.xml').getroot()
arquivo = open("Makefile","w")
functions_file = open("functions_names","w")
hosts = open(... | 2.609375 | 3 |
aws/approveParticipants.py | stevencdang/data_proc_lib | 0 | 12785313 | import mongohq
import mturk
priming_exp = {'desc': "rare vs common individual brainstorming",
"hit_id": '3ZURAPD288NJZ4HUTVEJXT1RKF51F5'
}
if __name__ == '__main__':
params = mongohq.ideagenstest
db = mongohq.get_mongodb(params['url'],
params['port'],
... | 2.375 | 2 |
tests/document/test_retrieve.py | constructpm/pysyncgateway | 2 | 12785314 | import pytest
from pysyncgateway.exceptions import DoesNotExist
def test(recipe_document, database):
reload_document = database.get_document('butter_chicken')
result = reload_document.retrieve()
assert result is True
for key in list(reload_document.data.keys()):
assert isinstance(key, str)
... | 2.34375 | 2 |
tests/documents.py | macrat/macracoin | 0 | 12785315 | <filename>tests/documents.py
import doctest
import unittest
import core.block
import core.chain
import core.errors
import core.message
import core.user
import peer.chainmanager
import peer.client
import peer.endpoint
import peer.peer
class DocTest(unittest.TestCase):
def test_doctest_core_block(self):
fa... | 2.328125 | 2 |
doc/examples/skeleton_behaviour.py | andrewbest-tri/py_trees | 201 | 12785316 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import py_trees
import random
class Foo(py_trees.behaviour.Behaviour):
def __init__(self, name):
"""
Minimal one-time initialisation. A good rule of thumb is
to only include the initialisation relevant for being able
to insert this be... | 2.953125 | 3 |
pdbparse/construct/protocols/application/xwindows.py | ax330d/ida_pdb_loader | 50 | 12785317 | """
X-Windows (TCP/IP protocol stack)
"""
| 0.832031 | 1 |
lbrynet/schema/claim.py | abueide/lbry | 0 | 12785318 | <reponame>abueide/lbry
import os.path
import json
from string import ascii_letters
from typing import List, Tuple, Iterator, TypeVar, Generic
from decimal import Decimal, ROUND_UP
from binascii import hexlify, unhexlify
from google.protobuf.json_format import MessageToDict
from google.protobuf.message import DecodeErr... | 1.789063 | 2 |
apps/notifications/views/NotificationView.py | Nelson-Morais/HA-OOAD | 0 | 12785319 | <reponame>Nelson-Morais/HA-OOAD
"""
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
"... | 1.664063 | 2 |
montlake/tslasso/main.py | sjkoelle/montlake | 8 | 12785320 | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/tslasso.main.ipynb (unless otherwise specified).
__all__ = ['run_exp']
# Cell
from ..atomgeom.features import get_features,get_D_feats_feats
from ..atomgeom.utils import get_atoms_4
from ..simulations.rigidethanol import get_rigid_ethanol_data
from ..utils.utils import... | 1.5625 | 2 |
nlpproject/main/processing.py | Hrishi2312/IR-reimagined | 0 | 12785321 | <reponame>Hrishi2312/IR-reimagined
from .words import *
from .Node import *
connecting_words = []
cnt = 1
different_words = []
total_files = len(files_with_index)
zeroes_and_ones = []
zeroes_and_ones_of_all_words = []
query_words = []
files = []
def processing(query):
connecting_words = []
cnt = 1
differe... | 3 | 3 |
addonpayments/api/common/requests.py | javisenberg/addonpayments-Python-SDK | 2 | 12785322 | # -*- encoding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import attr
from attr import ib as Field
from addonpayments.validators import RequestValidator
from addonpayments.utils import GenerationUtils
from addonpayments.mixins import HashMixin
from addonpayments.api.mixins import XmlMixin
... | 2.21875 | 2 |
removeNthFromEnd.py | xiaochuan-cd/leetcode | 0 | 12785323 | <gh_stars>0
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def removeNthFromEnd(self, head, n):
"""
:type head: ListNode
:type n: int
:rtype: ListNode
"""
f, s, f... | 3.703125 | 4 |
joblib/backports.py | aabadie/joblib | 0 | 12785324 | <gh_stars>0
"""
Backports of fixes for joblib dependencies
"""
from distutils.version import LooseVersion
try:
import numpy as np
def make_memmap(filename, dtype='uint8', mode='r+', offset=0,
shape=None, order='C'):
"""Backport of numpy memmap offset fix.
See https://gith... | 2.09375 | 2 |
al/model/model_zoo/image_classification.py | kili-technology/active-learning | 3 | 12785325 | <filename>al/model/model_zoo/image_classification.py
import torchvision.models as models
resnet18 = models.resnet18()
mobilenet = models.mobilenet_v2()
vgg16 = models.vgg16() | 1.609375 | 2 |
crawler/admin.py | mental689/paddict | 1 | 12785326 | <reponame>mental689/paddict
from django.contrib import admin
from crawler.models import Author, Document, Event, Tag, TagAssignment, Comment
# Register your models here.
class MembershipInline(admin.TabularInline):
model = Document.authors.through
class DocumentAdmin(admin.ModelAdmin):
inlines = [MembershipI... | 2.09375 | 2 |
adhmodel/simulation/iteration_parameters.py | erdc/AdhModel | 3 | 12785327 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import param
import panel as pn
class IterationParameters(param.Parameterized):
non_linear_iterations = param.Integer(
default=10,
bounds=(1, None),
softbounds=(1, 20),
doc='IP NIT: Maximum number of nonlinear iterations. REQUIRED.',
p... | 2.234375 | 2 |
tests/simple_substitution_tests.py | Steven-Hall/holtzman | 0 | 12785328 | <filename>tests/simple_substitution_tests.py
"""
Test simple variable substituion, for example:
{{ variable }}
in a template should be replaced by the variables value in the rendered template
"""
import pytest
from collections import namedtuple
import holtzman
from holtzman.errors import TemplateError, MissingVa... | 3.203125 | 3 |
scripts/MGCluster/mgcluster.py | fplaza/CAMISIM | 88 | 12785329 | __author__ = 'hofmann'
import os
import glob
import time
import shutil
import tempfile
from scripts.Validator.validator import Validator
class MGCluster(Validator):
"""
Alignment and clustering of marker genes with references
"""
_label = "MGCluster"
_cluster_method_choices = ['average', 'furthest', 'nearest... | 2.296875 | 2 |
home/admin.py | codejay411/Wheeling_and_dealing | 1 | 12785330 | <gh_stars>1-10
from django.contrib import admin
from .models import ngodetail, donordetail, medicine
# Register your models here.
admin.site.register(ngodetail)
admin.site.register(donordetail)
admin.site.register(medicine)
# admin.site.register(post)
# admin.site.register(postngo) | 1.421875 | 1 |
trainer/__init__.py | Neronjust2017/pytorch-classification-project | 1 | 12785331 | from .trainer import *
from trainer.Bayes_By_Backprop.trainer import *
from trainer.Variational_dropout.trainer import *
from trainer.MC_Dropout.trainer import *
from trainer.Quality_driven_PI.trainer import *
from trainer.Deep_Ensemble.trainer import *
from trainer.Deep_Ensemble.trainer_ensemble import *
from trainer.... | 1.101563 | 1 |
app/pg_pipeline/retweeter_details.py | s2t2/tweet-analyzer-py | 5 | 12785332 | <filename>app/pg_pipeline/retweeter_details.py
from app.pg_pipeline import Pipeline
if __name__ == "__main__":
pipeline = Pipeline()
pipeline.download_retweeter_details() # takes about 16 minutes for 2.7M users in batches of 2500
| 1.757813 | 2 |
tasks/celery.py | codeb2cc/noweibo | 1 | 12785333 | from datetime import timedelta
from celery import Celery
from ..conf import setting
celery = Celery(
'noweibo',
broker=setting.CELERY_BROKER,
)
celery.conf.update(
CELERY_TIMEZONE='Asia/Shanghai',
CELERY_IMPORTS=('noweibo.tasks.periodic', ),
CELERY_RESULT_BACKEND=setting.CELERY_BACKEND,
CEL... | 1.875 | 2 |
bcbio/ngsalign/bwa.py | brentp/bcbio-nextgen | 1 | 12785334 | """Next-gen alignments with BWA (http://bio-bwa.sourceforge.net/)
"""
import contextlib
import gzip
import os
from Bio.SeqIO.QualityIO import FastqGeneralIterator
from bcbio.pipeline import config_utils
from bcbio import utils
from bcbio.distributed.transaction import file_transaction
from bcbio.ngsalign import novoa... | 2.203125 | 2 |
SMPL++/scripts/preprocess.py | Smorodov/SMPLpp | 4 | 12785335 | <reponame>Smorodov/SMPLpp
# Copyright 2018 <NAME>. All rights reserved.
#
# This software implements a 3D human skinning model, SMPL, with tensorflow
# and numpy.
# For more detail, see the paper - SMPL: A Skinned Multi-Person Linear Model -
# published by Max Planck Institute for Intelligent Systems on SIGGRAPH ASIA 2... | 2.703125 | 3 |
portality/lib/query_filters.py | glauberm/doaj | 0 | 12785336 | from flask_login import current_user
from portality.core import app
from portality import models
# query sanitisers
##################
def public_query_validator(q):
# no deep paging
if q.from_result() > 10000:
return False
if q.size() > 200:
return False
# if the query has facets, t... | 2.203125 | 2 |
Bird-Species/train-py-ViT.py | NCcoco/kaggle-project | 0 | 12785337 | <reponame>NCcoco/kaggle-project<gh_stars>0
import os
import numpy as np
import pathlib
import pandas as pd
import keras.api._v2.keras as keras
from sklearn.metrics import confusion_matrix, classification_report
from keras.api._v2.keras import layers, \
losses, regularizers, optimizers
from keras.api._v2.keras.prepr... | 2 | 2 |
uwsgi/encorea-old/page_header/apps.py | btardio/encore-swarm | 0 | 12785338 | <reponame>btardio/encore-swarm
from django.apps import AppConfig
class PageHeaderConfig(AppConfig):
name = 'page_header'
| 1.40625 | 1 |
pretrain/training/unsup/__init__.py | archon159/elsa | 13 | 12785339 | def setup(mode, P):
fname = f'{P.dataset}_{P.model}_unsup_{mode}'
if mode == 'simclr':
from .simclr import train
elif mode == 'simclr_CSI':
from .simclr_CSI import train
fname += f'_shift_{P.shift_trans_type}'
else:
raise NotImplementedError()
if P.one_cl... | 2.203125 | 2 |
genetic_algorithm/spectroscopy.py | pozzo-research-group/HEAD | 1 | 12785340 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pyGDM2 import (structures, materials, core,
linear, fields, propagators,
tools)
def get_spectrum(geometry, step, wavelengths):
'''Obtains a uv-vis spectra for a specified geometry'''
material ... | 3.078125 | 3 |
pysparkling/fileio/codec/codec.py | lyle-nel/pysparkling | 0 | 12785341 | import logging
log = logging.getLogger(__name__)
class Codec(object):
"""Codec."""
def __init__(self):
pass
def compress(self, stream):
"""Compress.
:param io.BytesIO stream: Uncompressed input stream.
:rtype: io.BytesIO
"""
return stream
def decompr... | 3 | 3 |
UpdateScheduler.py | DriptaSenapati/CovidindiaServer | 5 | 12785342 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 3 16:14:46 2020
@author: Dripta
"""
from covidindia import *
import os
import pickle
file_path = os.path.dirname(os.path.abspath(__file__))
data_path=os.path.join(file_path,'static','server_data')
with open(os.path.join(file_path,'updater.txt'),'a') as f:
f.writ... | 2.140625 | 2 |
tests/example/endpoints_additional.py | tclh123/aio-openapi | 19 | 12785343 | from typing import List
from aiohttp import web
from openapi.db.path import ApiPath, SqlApiPath
from openapi.exc import JsonHttpException
from openapi.spec import op
from .models import (
MultiKey,
MultiKeyUnique,
SourcePrice,
Task,
TaskAdd,
TaskOrderableQuery,
TaskPathSchema,
TaskPat... | 2.359375 | 2 |
lakes/misc/tarscripts/makefilelistIce.py | kojitominaga/scratch | 0 | 12785344 | import os
count = 0
with open('listHis', 'w') as f:
for root, dirs, files in os.walk('.'):
tzt = [file for file in files if 'His.csv.gz' in file]
for tztfile in tzt:
p = os.path.join(root, tztfile)
f.write(p) ; f.write('\n')
count += 1
if count % 1000 ... | 2.65625 | 3 |
OZoptics/__init__.py | gregmoille/InstrumentControl | 3 | 12785345 | from .attenuator import Attenuator
| 1.109375 | 1 |
freebasics/__init__.py | praekeltfoundation/mc-freebasics | 0 | 12785346 | from .celery_app import app as the_celery_app # noqa
| 1.03125 | 1 |
migrations/versions/ac89777fdf69_add_admin_field_to_user_table.py | yuanqili/QuickMining | 0 | 12785347 | <filename>migrations/versions/ac89777fdf69_add_admin_field_to_user_table.py
"""add admin field to user table
Revision ID: <KEY>
Revises: ea6057506937
Create Date: 2018-02-25 01:05:03.266887
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision =... | 1.359375 | 1 |
generative_structures/explainer/tests.py | RaymondDashWu/generative-structures2 | 0 | 12785348 | <reponame>RaymondDashWu/generative-structures2
from django.test import TestCase, Client
from django.urls import reverse
from django.contrib.staticfiles import finders
class TestPages(TestCase):
def test_get_homepage(self):
c = Client()
response = c.get('/')
self.assertEqual(response.sta... | 2.46875 | 2 |
dfirtrack_artifacts/admin.py | cclauss/dfirtrack | 273 | 12785349 | from django.contrib import admin
from dfirtrack_artifacts.models import (
Artifact,
Artifactpriority,
Artifactstatus,
Artifacttype,
)
# Register your models here.
admin.site.register(Artifact)
admin.site.register(Artifactpriority)
admin.site.register(Artifactstatus)
admin.site.register(Artifacttype)
| 1.445313 | 1 |
packages/python/pyfora/Connection.py | ufora/ufora | 571 | 12785350 | <reponame>ufora/ufora<gh_stars>100-1000
# Copyright 2015 Ufora 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 r... | 1.734375 | 2 |