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 |
|---|---|---|---|---|---|---|
loader/loader.py | jsoldani/ship-to | 0 | 42200 | import json
import os
import sys
import yaml
def parseYaml(file):
yFile = open(file)
yml = yaml.load(yFile, Loader=yaml.FullLoader)
yFile.close()
return yml
def generateCosts(tosca, deploymentInfo):
# creating empty costs dictionary
costs = {}
# adding cost for bottom
costs["bottom"] ... | 2.578125 | 3 |
examples/run_inods.py | greenkidneybean/INoDS-model | 1 | 42201 | import sys
import os
sys.path = [os.path.abspath(os.path.join(__file__, '..', '..')), ] + sys.path
import INoDS_model as inods
import numpy as np
import time
##################################################
## NOTE: INoDS requires the network and health data to be formatted in
## a specific manner. Check example file... | 1.890625 | 2 |
tasks/task3_4.py | shmalex/galvanize | 1 | 42202 | import os
import random as rn
def clear(): return os.system('cls')
lines = [x.replace('\n', '') for x in tuple(open('words.txt', 'r'))]
clear()
words = lines
char_set = set()
word = ''
word_set = set(word)
word_len = len(word)
trie = 6
score = [0, 0]
def reset():
x = rn.randint(0, len(words) - 1)
global ... | 3.65625 | 4 |
src/import_functions/auxiliary_function_for_geo_files.py | dataforgoodfr/batch9_geowatchlabs-3-markets | 1 | 42203 | <gh_stars>1-10
import os
import re
from pathlib import Path
import zipfile
import pandas as pd
from osgeo import osr
from auxiliary_function_for_importing_data import (
extract_pattern_from_string as matching,
)
from osgeo import gdal
import matplotlib.pyplot as plt
def list_geo_file(folder=""):
"""Lists all ... | 2.75 | 3 |
src/dp/rest_api/v1/handlers/user/__init__.py | Michalesko/DP_API | 0 | 42204 | <reponame>Michalesko/DP_API
# coding: utf-8
__author__ = 'Miso'
from users import UsersHandlerOne
from users import UsersHandler
from userGoal import UserHandlerGoal
from userEvalInit import UserHandlerInitialEval
from userEvalPage import UserHandlerRuntimeEval
from usersPages import UserPages
from userPageRating impo... | 0.992188 | 1 |
src/rimuc/__init__.py | srackham/rimu-py | 0 | 42205 | <gh_stars>0
from rimuc.rimuc import main, readResource
from rimuc.resources import resources
| 1.09375 | 1 |
UGRID/ESTOFS_water_levels.py | petercunning/notebook | 32 | 42206 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# #Extract ESTOFS water levels using NetCDF4-Python and analyze/visualize with Pandas
# <codecell>
# Plot forecast water levels from NECOFS model from list of lon,lat locations
# (uses the nearest point, no interpolation)
%matplotlib inline
import ... | 2.875 | 3 |
datahub/company/test/test_contact_matching.py | Staberinde/data-hub-api | 6 | 42207 | <filename>datahub/company/test/test_contact_matching.py<gh_stars>1-10
import pytest
from datahub.company.contact_matching import (
ContactMatchingStatus,
find_active_contact_by_email_address,
MatchStrategy,
)
from datahub.company.test.factories import ContactFactory
from datahub.interaction.test.factories ... | 2.0625 | 2 |
venv/lib/python3.7/hmac.py | OseiasBeu/PyECom | 1 | 42208 | /home/oseiasbeu/anaconda3/lib/python3.7/hmac.py | 0.933594 | 1 |
foodgram/migrations/0008_auto_20210303_2022.py | valkhmyrov/foodgram-project | 0 | 42209 | <reponame>valkhmyrov/foodgram-project
# Generated by Django 3.1.6 on 2021-03-03 20:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... | 1.78125 | 2 |
feed.py | rlexmann/CatFeeder | 0 | 42210 | import os
import sys
import fcntl
fh=0
def run_once():
global fh
fh=open(os.path.realpath(__file__),'r')
try:
fcntl.flock(fh,fcntl.LOCK_EX|fcntl.LOCK_NB)
except:
os._exit(0)
run_once()
| 2.1875 | 2 |
tests/test_faulty.py | ashwoods/gst-c-crash | 0 | 42211 | import pytest
import asyncio
@pytest.mark.asyncio
async def test_faulty_setup(Player):
p = Player.from_description("videotestsrc ! faulty ! fakesink")
await p.play()
await asyncio.sleep(5)
await p.stop() | 2.203125 | 2 |
music_exercises/accidentals.py | d53dave/music-exercises-python | 0 | 42212 | <gh_stars>0
import statistics
import random
import time
from typing import List, Tuple, Dict
from time import monotonic
from blessings import Terminal
from . import Note
_ACCIDENTALS: Dict[str, Dict] = {
'sharps': {
Note('C'): [],
Note('G'): [Note('F#')],
Note('D'): [Note('F#'), Note('C#'... | 2.375 | 2 |
api/server.py | myrithok/James | 0 | 42213 | # Library imports
from flask import Flask, request, make_response, Response
from flask_cors import CORS
import json
import os
import sys
# Add James to path
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# Project imports
from api.jamesClasses import inputCorpus
from api.jamesConfig import cfg
from api.jam... | 2.78125 | 3 |
main.py | henryshunt/psn-logger | 0 | 42214 | <filename>main.py
import json
import os
from datetime import datetime
import sys
import queue
import threading
import smtplib
import ssl
import daemon
import paho.mqtt.client as mqtt
import pymysql
import config
import helpers
broker = None
alarm_analysis_queue = queue.Queue()
is_processing_alarm... | 2.765625 | 3 |
toolsaurus/database/video_similarities/backend_python.py | notoraptor/pysaurus | 0 | 42215 | <gh_stars>0
from typing import List
from pysaurus.core import notifications
from pysaurus.core.constants import VIDEO_BATCH_SIZE
from pysaurus.core.notifier import Notifier
from pysaurus.core.profiling import Profiler
from pysaurus.database.miniature_tools.miniature import Miniature
from pysaurus.database.video_simila... | 2.203125 | 2 |
tests/test_hypothesis.py | bcbernardo/hyp2rem | 1 | 42216 | <filename>tests/test_hypothesis.py
# Copyright 2020 The Hyp2Rem Authors
# Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.
"""Test Hypothes.is connection logic.
This module provides tests cases for Hypothes.is API interf... | 2.578125 | 3 |
neighapp/views.py | erhic/NeighbourHood- | 2 | 42217 | from os import name
from django.shortcuts import render,redirect
# Create your views here.
# from django.contrib.auth.forms import UserCreationForm
from django.contrib import messages
from .forms import UserRegisterForm,UserUpdateForm,ProfileUpdateForm
from django.contrib.auth.decorators import login_required
# from... | 2.28125 | 2 |
user/models.py | yangfeiffei/Dsystem | 0 | 42218 | <reponame>yangfeiffei/Dsystem
from django.db import models
from django.contrib.auth.models import Permission, User
# Create your models here.
class UserProfile(models.Model):
'''
用户相关
'''
user = models.OneToOneField(User)
name = models.CharField(u'姓名', max_length=16, )
signature = models.Char... | 2.578125 | 3 |
tests/main_test.py | viggyfresh/prom | 0 | 42219 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import os
from prom import query
from prom.model import Orm
import prom
from captain.client import Captain
from . import BaseTestCase as BTC, testdata
from prom.cli.dump import get_orm_classes, get_... | 2 | 2 |
pydictoolkit/plot/plotter.py | ilyasst/pydictoolkit | 7 | 42220 | import matplotlib.pyplot as plt
import matplotlib
from matplotlib import animation
import seaborn as sns
import numpy as np
import cmocean
import os
from mpl_toolkits.axes_grid1 import AxesGrid
from mpl_toolkits.axes_grid1 import make_axes_locatable
import scipy
import scipy.ndimage
from scipy.stats import norm
import ... | 2.21875 | 2 |
src/sage/version.py | yzpopulation/sage | 0 | 42221 | # Sage version information for Python scripts
# This file is auto-generated by the sage-update-version script, do not edit!
version = '9.5.beta2'
date = '2021-09-26'
banner = 'SageMath version 9.5.beta2, Release Date: 2021-09-26'
| 0.878906 | 1 |
src/postgres/migrations/0008_fix_user_id_group.py | kaka-lin/pycon.tw | 47 | 42222 | <gh_stars>10-100
from django.db import migrations
ALTER_GROUP_USER_ID = """
ALTER TABLE "users_user_groups" alter COLUMN "user_id"
SET DATA TYPE bigint;
"""
class Migration(migrations.Migration):
dependencies = [
('reviews', '0001_initial'),
('postgres', '0007_fix_user_id_proposal_id... | 1.382813 | 1 |
python.py | weijie88/test | 0 | 42223 | <filename>python.py
# class Cat(Resource):
# def get(self):
# return {'data':'get'}
#
# def post(self):
# return {'data': 'post'}
#
# def put(self):
# return {'data': 'put'}
#
# def delete(self):
# return {'data': 'delete'}
from pip._vendor.distlib.resources import Reso... | 2.4375 | 2 |
export_onnx_group_norm.py | lachinov/brats2019 | 42 | 42224 | <reponame>lachinov/brats2019
import argparse
import torch.onnx
import os
from collections import OrderedDict
from torch.onnx.symbolic_registry import register_op
from torch.onnx.symbolic_helper import parse_args
from model import UNet
parser = argparse.ArgumentParser(description="PyTorch SegTHOR")
parser.add_... | 2.0625 | 2 |
Zoo/neural_network_sense/predator.py | Tanmay-Kumar-Sinha/Evolution-Simulation | 7 | 42225 | from creature import *
from nn_model import model_simple_predator
class Predator(Creature):
def __init__(self,starting_pos=[0,0],
speed=np.random.randint(10,20),
size=np.random.randint(1,10),
sense = np.random.uniform(0,20),
weights_food = np.random.uniform(-1,1,(2,6))):
super(Predator,self).__i... | 2.875 | 3 |
libcloud/extra/drivers/google.py | Scalr/libcloud | 0 | 42226 | <gh_stars>0
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you ... | 2.078125 | 2 |
projects/models.py | nuwainfo/treeio | 0 | 42227 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Project management models
"""
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from treeio.core.models import Object, User
from... | 2.25 | 2 |
pandapower/shortcircuit/__init__.py | yougnen/pandapower | 104 | 42228 | from pandapower.shortcircuit.calc_sc import calc_sc
from pandapower.shortcircuit.toolbox import * | 1.09375 | 1 |
virtool/files/db.py | ColeVoelpel/virtool | 1 | 42229 | <filename>virtool/files/db.py<gh_stars>1-10
import logging
from typing import Union
import arrow
import virtool.db.core
import virtool.db.utils
import virtool.files.utils
import virtool.utils
logger = logging.getLogger(__name__)
PROJECTION = [
"_id",
"name",
"size",
"user",
"uploaded_at",
"t... | 2.40625 | 2 |
test/test_simulation.py | andrea-simonetto/qiskit | 2,660 | 42230 | <gh_stars>1000+
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.... | 2.390625 | 2 |
tipfyrecipes/ln.py | zhaohongw2015/tipfyrecipes | 0 | 42231 | # <NAME> <<EMAIL>>
# Seg 14 Mar 2011 21:46:55 BRT
import logging, os, zc.buildout
class CreateSymbolicLinks:
"""
Buildout recipe for create dir and link modules. Use as:
[buildout]
parts =
django
tipfy
[django]
recipe = recipes:ln
target = /home/carlo/django/trunk/django
directory = app/lib/dist/django... | 2.390625 | 2 |
tests/test.py | Marselliy/tf-aug | 1 | 42232 | <filename>tests/test.py
import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'src'))
import tensorflow as tf
from tf_imgaug.sequential import Sequential
from tf_imgaug.augments import *
import unittest
class TestAugments(unittest.TestCase):
def _abstract_shape_te... | 2.46875 | 2 |
sdk/python/pulumi_gcp/storage/bucket.py | stack72/pulumi-gcp | 0 | 42233 | <filename>sdk/python/pulumi_gcp/storage/bucket.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilit... | 1.914063 | 2 |
Shiva Sketch/main.py | arunvemana/Turtle-Animations | 0 | 42234 | <gh_stars>0
import cv2
import turtle
import numpy as np
from matplotlib import pyplot as plt
def find_closest(p):
if len(positions) > 0:
nodes = np.array(positions)
distances = np.sum((nodes - p)**2, axis=1)
i_min = np.argmin(distances)
return positions[i_min]
else:
r... | 2.8125 | 3 |
news/views.py | Hardik-Mittal/Robotics_Club_Website | 0 | 42235 | from django.shortcuts import render,redirect,HttpResponse
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from .forms import NewsForm
from .models import News
from django.contrib import messages
from RoboClub.decorators import has_role_head_or_coordinator
from django.template.l... | 2.0625 | 2 |
ui.py | Hidanko/Caxeiro-Viajante | 0 | 42236 | <gh_stars>0
import tkinter as tk
class Application(tk.Frame):
def chamar_algoritmo_genetico(self):
print('a')
def __init__(self, master):
tk.Frame.__init__(self, master)
self.grid()
self.create_widget()
def create_widget(self):
self.instruction = tk.Label(self,tex... | 3.21875 | 3 |
negar/countriesWithTheirCapital.py | sys113/negar | 23 | 42237 | countries = {
"kabul": "afghanistan",
"tirana": "albania",
"alger": "algeria",
"fagatogo": "american samoa",
"andorra la vella": "andorra",
"luanda": "angola",
"the valley": "anguilla",
"null": "united states minor outlying islands",
"saint john's": "antigua and barbuda",
"buenos... | 1.820313 | 2 |
parse_posts.py | artyemk/GolosProject | 2 | 42238 | from websocket import WebSocket
from pymongo import MongoClient
import json
import re
#preventing eval mistakes
true = True
false = False
null = None
#connecting to db for posts and blockchain websocket
db = MongoClient().golos
ws = WebSocket()
ws.connect('wss://api.golos.cf')
print('Sending for 100')
#Sending quer... | 2.640625 | 3 |
Array/Search for Items in an Array/Valid Mountain Array/by_iteration_one-pass_scan.py | coderMaruf/leetcode-1 | 32 | 42239 | '''
Description:
Given an array A of integers, return true if and only if it is a valid mountain array.
Recall that A is a mountain array if and only if:
A.length >= 3
There exists some i with 0 < i < A.length - 1 such that:
A[0] < A[1] < ... A[i-1] < A[i]
A[i] > A[i+1] > ... > A[A.length - 1]
Example 1:
Input... | 4.28125 | 4 |
eventz/immutable_sequence.py | danballance/eventz | 1 | 42240 | from typing import TypeVar, Generic, Iterable, Tuple
T = TypeVar('T')
class ImmutableSequence(Generic[T]):
def __init__(self, items: Iterable[T]):
self._items: Tuple[T] = tuple(items)
def __eq__(self, other) -> bool:
if not isinstance(other, ImmutableSequence):
return False
... | 2.984375 | 3 |
sensoring/scripts/ball_detector.py | Cavalletta98/Behavioral-Architecture-with-Real-Simulation | 1 | 42241 | #!/usr/bin/env python3
"""
ROS component that implement a ball detector
"""
# Import of libraries
import sys
import time
import numpy as np
from scipy.ndimage import filters
import imutils
import cv2
import roslib
import rospy
from sensor_msgs.msg import CompressedImage
from sensoring.srv import DetectImage,Dete... | 3.140625 | 3 |
module/logger.py | Xetera/IreneBot | 1 | 42242 | import logging
import datetime
from concurrent.futures import ThreadPoolExecutor
thread_pool = ThreadPoolExecutor()
def debug():
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename=f'Logs/{datetime.date.today()}-debug.log', encoding='utf-8')
han... | 3.03125 | 3 |
src/ds-visuals/snippets/tree/create.py | Ray784/ds-visualization | 0 | 42243 | <gh_stars>0
def createTree(self, root, *elements):
root = None
for element in elements:
root = self.insert(root, element)
return root | 3.328125 | 3 |
n3rgy-consumer-data.py | n3rgy/consumer-data | 10 | 42244 | <filename>n3rgy-consumer-data.py
#!/usr/bin/python
# Copyright 2020 by <NAME>, n3rgy data ltd.
# All rights reserved.
#
# Sample script to interact with https://data.n3rgy.com service
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" ba... | 2.3125 | 2 |
data/user.py | zr4x/pythonTests | 0 | 42245 | from model.user_form import UserForm
import random
import string
# def random_string(prefix, maxlen):
# symbols = string.ascii_letters + string.digits + " " * 10
# return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])
#
#
# testdata =[
# UserForm(firstname=random_strin... | 3 | 3 |
project/tests/test_senders.py | vpplatonov/flask_part | 0 | 42246 | # project/tests/test_users.py
import json
from project.tests.base import BaseTestCase
from project import create_app
app = create_app()
class TestSendersService(BaseTestCase):
"""Tests for the Users Service."""
def test_all_senders(self):
"""Ensure get all senders behaves correctly."""
wi... | 2.75 | 3 |
asf_tools/hand/prepare.py | jhkennedy/asf-tools | 2 | 42247 | <filename>asf_tools/hand/prepare.py
"""Prepare a Height Above Nearest Drainage (HAND) virtual raster (VRT) covering a given geometry"""
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Union
from osgeo import gdal, ogr
from rasterio.enums import Resampling
from shapely.geometry impor... | 2.625 | 3 |
app/gwells/test_survey_render.py | cvarjao/gwells | 1 | 42248 | from django.test import TestCase
from django.core.urlresolvers import reverse
from http import HTTPStatus
from django.contrib.auth.models import Group
class SurveyRenderTestCase(TestCase):
@classmethod
def setUpTestData(cls):
Group.objects.create(name='admin')
def setUp(self):
pass
clas... | 2.4375 | 2 |
old python/zipf_writer.py | quasarbright/quasarbright.github.io | 1 | 42249 | from random import randint
chars = 'abcdefghijklmnopqrstuvwxyz '
def random_letter():
ind = randint(0,len(chars)-2)
return chars[ind]
def random_char():
ind = randint(0,len(chars)-1)
return chars[ind]
def random_word(max_len=None):
word = ''
letter = random_letter()
if max_len:
whil... | 3.625 | 4 |
Client/App/UI/Helper/ClassList.py | Dragon-KK/ComputerProject2021 | 0 | 42250 | <filename>Client/App/UI/Helper/ClassList.py
class ClassList(list):
def __init__(self):
self.OnClassListChange = lambda *args,**kwargs:0
def AddClass(self,Cls, notify = True):
if Cls not in self:
self.append(Cls)
if notify:self.OnClassListChange(added = self[-1])
def... | 2.859375 | 3 |
src/cogite/completion.py | Polyconseil/cogite | 4 | 42251 | <filename>src/cogite/completion.py<gh_stars>1-10
import re
from typing import List
import prompt_toolkit
import prompt_toolkit.completion
from cogite import models
USER_FORMATTER = "{login} ({name})"
USER_REGEXP = re.compile(r" *(?P<login>[^\(]+?) \([^\)]*?\)")
class UserCompleter(prompt_toolkit.completion.Comple... | 2.953125 | 3 |
porespy/dns/__funcs__.py | hfathian/porespy | 3 | 42252 | import numpy as np
import openpnm as op
from porespy.filters import trim_nonpercolating_paths
import collections
def tortuosity(im, axis, return_im=False, **kwargs):
r"""
Calculates tortuosity of given image in specified direction
Parameters
----------
im : ND-image
The binary image to an... | 2.671875 | 3 |
tests/decision_tree_test.py | asross/decision_trees | 1 | 42253 | import unittest
import numpy
from oo_trees.dataset import *
from oo_trees.decision_tree import *
from oo_trees.attribute import *
class TestDecisionTree(unittest.TestCase):
def test_classification(self):
X = numpy.array([[0, 1], [0, 0], [1, 0], [1, 1]])
y = numpy.array(['H', 'H', 'H', 'T'])
... | 3.109375 | 3 |
workflows/diagnostics/fv3net/diagnostics/prognostic_run/emulation/query.py | ai2cm/fv3net | 1 | 42254 | <gh_stars>1-10
import wandb
from dataclasses import dataclass
@dataclass
class PrognosticRunClient:
tag: str
project: str
entity: str
api: wandb.Api
def use_artifact_in(self, run):
"""Gets prognostic rundir artifact.
Makes an explicit link the wandb web console.
"""
... | 2.34375 | 2 |
bin/busers.py | ddierschow/bamca | 1 | 42255 | #!/usr/local/bin/python
from sprint import sprint as print
import string
import uuid
import basics
import config
import useful
# ------ user editor
def print_users(pif):
table_info = pif.dbh.table_info['user']
entries = []
for user in pif.dbh.fetch_users():
user['user_id'] = '<a href="user.cgi... | 2.375 | 2 |
self_finance/front_end/routes/reference.py | MaksimDan/self-finance | 0 | 42256 | <filename>self_finance/front_end/routes/reference.py
from flask import render_template
from self_finance.front_end import app
def _standard_render():
return render_template("reference.html")
@app.route('/reference')
def reference():
return _standard_render()
| 1.914063 | 2 |
bfgame/components/shield.py | ChrisLR/BasicDungeonRL | 3 | 42257 | <reponame>ChrisLR/BasicDungeonRL
from core.components import Component, listing
@listing.register
class Shield(Component):
NAME = "shield"
__slots__ = ["armor_class_melee", "armor_class_missile"]
def __init__(self, armor_class_melee, armor_class_missile):
super().__init__()
self.armor_cla... | 2.5625 | 3 |
cfn_review_bot/error.py | biochimia/cfn-review-bot | 1 | 42258 | '''
Defines `Error`, the base class for all exceptions generated in this package.
'''
class Error(Exception):
pass
| 1.523438 | 2 |
load_data.py | sanidhyamangal/riceleaf_disease_classification | 1 | 42259 | import tensorflow as tf # for tf libs
import pathlib # for giving path of the images
# a closs to wrap dataset functions
class LoadImages:
def __init__(self, data_path):
# assign a data path to all the libs
self.__data_root = pathlib.Path(data_path)
# def a function to process data
def _... | 2.75 | 3 |
src/game.py | tommaso1311/sNNake | 0 | 42260 | <gh_stars>0
import snake
import food
import pygame
import numpy as np
class game:
"""
Main class used to play the game Snake
Attributes
----------
size : int
size of the game (in squares)
_view : bool
if True represent the game
_step : int
current duration of the game
_duration : float
max duration o... | 4 | 4 |
config.py | Relintai/voxelman | 53 | 42261 |
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"WorldArea",
"VoxelLight",
"VoxelmanLight",
"VoxelmanLevelGenerator",
"VoxelmanLevelGeneratorFlat",
"VoxelSurfaceMerger",
"VoxelSurfaceSimple",
... | 1.757813 | 2 |
code/processing/prefix_metrics.py | msaveski/toxic_conversation_structure | 8 | 42262 | <filename>code/processing/prefix_metrics.py
import gzip
import click
import warnings
import json
import ujson
import pickle
import numpy as np
from tqdm import tqdm
from ciso8601 import parse_datetime
from joblib import Parallel, delayed
from _config import Config
from utils import json_paths_iter, sanitize_numpy_ty... | 2.109375 | 2 |
src/pylendingclub/wrapper/resource.py | bbarney213/PyLendingClub-Wrapper | 2 | 42263 | <reponame>bbarney213/PyLendingClub-Wrapper
from .base import Base
from .request import GetRequest
from .request import PostRequest
class Resource(Base):
"""
Base class for all resources within the API.
"""
def _get_request(self, sub_url):
"""
Constructor for a new GetRequest.
... | 3.015625 | 3 |
tests/parse/test_frequency.py | CHRUdeLille/scout | 1 | 42264 | <gh_stars>1-10
from scout.parse.variant.frequency import (parse_frequency, parse_frequencies,
parse_sv_frequencies)
def test_parse_frequency(cyvcf2_variant):
# GIVEN a variant dict with a frequency in info_dict
variant = cyvcf2_variant
variant.INFO['1000G'] ... | 2.671875 | 3 |
setup.py | pfleischerHU/snowshu | 0 | 42265 | #!/usr/bin/env python3
from setuptools import find_packages, setup
VERSION = '0.0.3'
PYTHON_REQUIRES = '3.8'
packagedata = {
'include_package_data': True,
'name': "snowshu",
'version': VERSION,
'author': "Health Union Data Team",
'author_email': '<EMAIL>',
'url': 'https://snowshu.readthedocs.... | 1.4375 | 1 |
chmoder.py | exeCODEable/CTFware | 1 | 42266 | <gh_stars>1-10
"""
-------------
| CTF Ware |
------------
| CHMODER |
-----------
"""
import main
import Error_Handler
from time import sleep
# ---- Defining Functions ----
# The Title : CHMODER
def title():
print(""""
__ __ __ __ __
/ |__||\/|/ \| \|_ |__)
\__| || |\__... | 3.140625 | 3 |
Commands/Command.py | densikat/PyRobotSim | 0 | 42267 | <filename>Commands/Command.py
from abc import ABC, abstractmethod
class Command(ABC):
def __init__(self,commandname):
self.commandname = commandname
@abstractmethod
def initializecommand(self, command):
pass
@abstractmethod
def validateinstruction(self, robot, table):
pa... | 3.34375 | 3 |
ivy/test/afterinit1.py | b1f6c1c4/cfg-enum | 113 | 42268 |
from ivy import ivy_module as im
from ivy.ivy_compiler import ivy_from_string
from ivy.tk_ui import new_ui
from ivy import ivy_utils as iu
prog = """#lang ivy1.6
type t
individual x(X:t) : t
object foo(me:t) = {
after init {
x(me) := me;
assert false
}
}
isolate iso_foo(me:t) = foo(me) wit... | 2.390625 | 2 |
api/snippets/textSnippet.py | kc611/learn-hub | 5 | 42269 | from api.snippet import NonConsoleSnippet
from api.colors import print_error
class textSnippet(NonConsoleSnippet):
_requiredFields_ = []
def get_response(self, data={}):
"""Takes in a key press as user input."""
input("...")
def test_response(self, response, data={}):
return Tru... | 2.90625 | 3 |
2020-11-02/meio.py | pufe/programa | 2 | 42270 | <filename>2020-11-02/meio.py
n = int(input())
lado = 2
for i in range(n):
lado = 2*lado-1
print(lado*lado)
| 3.265625 | 3 |
Sequential Search/sequential_search.py | JKooll/code-segment | 0 | 42271 | class SequentialSearchST():
first = None
class Node():
def __init__(self, key, val, next):
self.key = key
self.val = val
self.next = next
def get(self, key):
x = self.first
while x is not None:
if key == x.key:
return x.val
x = x.next
return None
def ... | 3.6875 | 4 |
training_inheritance.py | GreenSpir1t/PinPong_CS-GO_Stars | 0 | 42272 | from pygame import *
from time import sleep
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import *
app = QApplication([])
widget1 = QWidget()
button1 = QPushButton("ИГРАТЬ")
button1.resize(100, 60)
label1 = QLabel("Привет! Ты запустил игру PinPong, где ты можешь посоревноваться с другом в ловкости и проверить свою ... | 3.046875 | 3 |
medium/er-wei-shu-zu-zhong-de-cha-zhao-lcof/er-wei-shu-zu-zhong-de-cha-zhao-lcof.py | yujiecong/LeetCode-learning | 0 | 42273 | <filename>medium/er-wei-shu-zu-zhong-de-cha-zhao-lcof/er-wei-shu-zu-zhong-de-cha-zhao-lcof.py
class Solution:
def findNumberIn2DArray(self, matrix, target: int) -> bool:
if not matrix:
return False
n,m=len(matrix),len(matrix[0])
if m==0:
return False
row,col=0... | 3.453125 | 3 |
importio2/commands/csv_to_json.py | import-io/import-io-api-python | 1 | 42274 | #
# Copyright 2017 Import.io
#
# 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, ... | 2.234375 | 2 |
examples/gridworld.py | abadithela/NFM2021_Static_Test_Synthesis | 0 | 42275 | <reponame>abadithela/NFM2021_Static_Test_Synthesis
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 22 08:32:59 2020
@author: apurvabadithela
"""
# Generates plots for large number of examples:
# Use: restrict_transitions_complex
import networkx as nx
import time
import random
import numpy as np
i... | 2.25 | 2 |
bite/transformers.py | jgosmann/bite | 0 | 42276 | <reponame>jgosmann/bite
from dataclasses import dataclass
from typing import Callable, Generic, Iterable, Tuple, TypeVar
from bite.io import ParserBuffer
from bite.parsers import ParsedBaseNode, ParsedNode, Parser
T = TypeVar("T", covariant=True)
VIn = TypeVar("VIn", covariant=True)
VOut = TypeVar("VOut", covariant=T... | 2.4375 | 2 |
blitzdb/fields/integer.py | marcinguy/blitzdb3 | 252 | 42277 | <gh_stars>100-1000
from .base import BaseField
class IntegerField(BaseField):
pass
| 1.132813 | 1 |
src/crypto_dom/bybt/futures/liquidation.py | maxima-us/crypto-dom | 0 | 42278 | <filename>src/crypto_dom/bybt/futures/liquidation.py<gh_stars>0
import typing
from decimal import Decimal
import pydantic
import stackprinter
stackprinter.set_excepthook(style="darkbg2")
from crypto_dom.bybt.definitions import SYMBOL, EXCHANGE
# ============================================================
# Liquida... | 2.0625 | 2 |
garlic_pear/path.py | mtao/garlic_pear | 0 | 42279 | <reponame>mtao/garlic_pear
import pathlib
# a file
class Path:
@staticmethod
def __get_path(pathlike) -> pathlib.Path :
if type(pathlike) is pathlib.Path:
return path_or_file
elif issubclass(pathlike, Path):
return other_file.path()
else:
re... | 2.9375 | 3 |
bak/SLSTM.py | rnbwdsh/VisRNN_ICLR_2016_Text | 12 | 42280 | <filename>bak/SLSTM.py
# Thanks to https://discuss.pytorch.org/t/implementation-of-multiplicative-lstm/2328/9
import torch
import torch.nn as nn
import torch.nn.functional as F
import pdb
class SLSTM(nn.Module):
def __init__(self, input_size, hidden_size, num_layers = 1, batch_first = True):
super(SLSTM... | 2.5625 | 3 |
endpoints/routers/__init__.py | tszan/project_skeleton | 2 | 42281 | <filename>endpoints/routers/__init__.py
from flask_restful import Resource
class Home(Resource):
def get(self):
return "Hello, why are you here?!" | 2.21875 | 2 |
ophiuchus/coordinates/core.py | adrn/ophiuchus | 1 | 42282 | <filename>ophiuchus/coordinates/core.py
# coding: utf-8
""" Astropy coordinate class for the Ophiuchus coordinate system """
from __future__ import division, print_function
__author__ = "adrn <<EMAIL>>"
# Third-party
import numpy as np
from astropy.coordinates import frame_transform_graph
from astropy.utils.data i... | 2.984375 | 3 |
aifo_simulation/java-code/projects/aifo/plots/aifo_evaluation/pFabric/web_search_workload_w_sr/analyze.py | AlmondDust/Assignment3-Final-AIFO | 21 | 42283 | #!/usr/bin/python
# This python scripts extracts the data from the logs that we want to plot and outputs it in a format that gnuplot can
# later on represent.
# Theoretical plot number of combinations
#!/usr/bin/python
import math
if __name__ == '__main__':
######################################################... | 2.59375 | 3 |
tools/util/clone_project.py | highfestiva/life | 9 | 42284 | #!/usr/bin/env python
import glob
import os
import shutil
import subprocess
import uuid
def renameFiles(tooldir, dadir, fromnames, toname):
"Recursively replace file names and contents."
tooldir = os.path.join('..', tooldir)
os.chdir(dadir)
for fromname in fromnames:
fromspaced = "".join([x if x.islower() else ... | 3.015625 | 3 |
cluster_funk/core/environments/stack_collection.py | johnnyiller/cluster_funk | 0 | 42285 | class StackCollection:
def __init__(self, client=None, data=None):
super(StackCollection, self).__init__()
if data is None:
paginator = client.get_paginator('describe_stacks')
results = paginator.paginate()
self.list = list()
for result in results:
... | 2.734375 | 3 |
official/nlp/transformer/sched_sample/sched_sampler.py | king821221/models | 0 | 42286 | <filename>official/nlp/transformer/sched_sample/sched_sampler.py
import tensorflow as tf
class FlipThresholdDecayFunc(object):
def __init__(self):
pass
def __call__(self, steps, **kwargs):
return self.call(steps, **kwargs)
def call(self, steps, **kwargs):
raise NotImplementedErro... | 2.359375 | 2 |
src/scheduler.py | scify/DemocracIT-Backend-Scheduler | 1 | 42287 | <filename>src/scheduler.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import datetime
import subprocess
import os
import re
import importlib
import requests
import yaml
import json
from psql_dbaccess import PSQLDBAccess
from dit_logger import DITLogger
__author__ = '<NAME>. <<EMAIL>>'
CLASS_LABEL = 'clas... | 2.34375 | 2 |
scripts/send_html_get_request.py | JoanDM/macos-mouse-and-keyboard-automator | 0 | 42288 | import json
from automator_class import Automator
# fetch('https://jsonplaceholder.typicode.com/posts/1')
# .then(res => res.json())
# .then(console.log)
if __name__ == "__main__":
url = "https://jsonplaceholder.typicode.com/posts/1"
automator = Automator()
automator.start_html_session()
res_sta... | 2.921875 | 3 |
tests/utils.py | reasoned-ai/norm | 8 | 42289 | import unittest
import hashids
import time
import os
hashid = hashids.Hashids()
__all__ = ['user_tester', 'NormTestCase']
os.environ['NORM_DATA_STORAGE_ROOT'] = 'data'
os.environ['NORM_DB_PATH'] = 'norm/db/norm.db'
from norm.config import session
def user_tester():
from norm.models.user import User
tester... | 2.34375 | 2 |
tests/test_scope.py | MrCoft/twocode | 0 | 42290 | <reponame>MrCoft/twocode
"""
import a
import a.b
import a.B (and is the cross thing)
import a.*
import a.b as c
from a import b, c
import a, b
from _ import *
"""
# objects see their own vars
# function args are seen ((x)->x)(2)
# import bogus
# errors
# bogus -> NameError
"""
del list[index]
del x
... | 2.21875 | 2 |
stormpath/cache/cache.py | denibertovic/stormpath-sdk-python | 0 | 42291 | <reponame>denibertovic/stormpath-sdk-python
"""Cache abstractions."""
from .entry import CacheEntry
from .memory_store import MemoryStore
from .stats import CacheStats
class Cache(object):
"""A unified interface to different implementations of data caching.
Example of an implementetion is
:class:`storm... | 2.625 | 3 |
api/migrations/versions/7bce3314f2d8_chg_assignment_test_output_types.py | jepst/Anubis | 87 | 42292 | <filename>api/migrations/versions/7bce3314f2d8_chg_assignment_test_output_types.py
"""CHG assignment test output types
Revision ID: <KEY>
Revises: 28971042fc9c
Create Date: 2022-01-15 19:53:48.734288
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used... | 1.460938 | 1 |
dev/circuitpython/examples/htu31d_simpletest.py | scripsi/picodeebee | 0 | 42293 | <filename>dev/circuitpython/examples/htu31d_simpletest.py
# SPDX-FileCopyrightText: Copyright (c) 2020 ladyada for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time
import board
import adafruit_htu31d
i2c = board.I2C() # uses board.SCL and board.SDA
htu = adafruit_htu31d.HTU31D(i2c)
print("F... | 2.84375 | 3 |
infiltration.py | samaranin/flask_infiltration | 0 | 42294 | import numpy as np
k_i = np.array([0.20, 0.22, 0.78, 0.80,
0.30, 0.32, 0.96, 1.00,
1.20, 1.43, 1.80, 1.88,
0.40, 0.50, 3.24, 3.50,
0.38, 0.43, 2.24, 4.90,
0.40, 0.44, 1.22, 4.00,
0.39, 0.44, 0.96, 1.80,
0.39... | 2.5 | 2 |
cotk/scripts/resources.py | ishine/cotk | 117 | 42295 | '''
A command library help user upload their results to dashboard.
'''
#!/usr/bin/env python
import argparse
from ..file_utils import get_resource_file_path, get_resource_list
from . import cli_constant as cli
def entry(args):
'''Entrance of show resources path and whether resource is cached or not'''
resource_nam... | 2.703125 | 3 |
backend/py/vcf_parser.py | alexxxnf/VirusMutationsAI | 0 | 42296 | from Bio.Data.IUPACData import protein_letters_3to1_extended
import os
import pandas as pd
import re
import sys
# Note: the 'logging' module does not work with unit tests for some reason, replaced to 'print' for now
# logging.basicConfig(level=logging.DEBUG)
COL__INFO = 'INFO'
def eprint(*a):
"""Print message ... | 2.65625 | 3 |
1-Programming Basics/FunctionPractice.py | allysonvasquez/Python-Basics | 1 | 42297 | <filename>1-Programming Basics/FunctionPractice.py<gh_stars>1-10
# author: <NAME>
# version: May.14.2020
# Practice using functions & lists
# https://www.w3resource.com/python-exercises/python-functions-exercises.php
# Find the max of three numbers
def max(x,y,z):
if x > y or x == y:
num1 = x
else:
... | 4.28125 | 4 |
pytorch/examine_results.py | XinyiYS/CollaborativeFairFederatedLearning | 25 | 42298 | import os
import shutil
import json
import pandas as pd
import ast
import numpy as np
from utils.read_convergence import plot_convergence, parse, get_cffl_best
fairness_keys = [
'standalone_vs_fedavg_mean',
'standalone_vs_rrdssgd_mean',
'standalone_vs_final_mean',
]
def collect_and_compile_performance(dirnam... | 2.203125 | 2 |
getHiveCounters.py | Jimvin/UsefulHadoopScripts | 0 | 42299 | #!/usr/bin/python
import sys
import requests
import json
import kerberos
"""
Queries the YARN Job History Server (JHS) for a given jobId and returns the Hive counters
Works with unauthenticated and SPNEGO (Kerberos) authenticated API endpoints
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, <NAME>"
... | 2.703125 | 3 |