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 |
|---|---|---|---|---|---|---|
session/static_configs.py | SirjanK/Multivac | 0 | 12767751 | <filename>session/static_configs.py
DEFAULT_REDIS_PORT = 6379
# Number of seconds to sleep upon successful end to allow graceful termination of subprocesses.
TERMINATION_TIME = 3
# Max caps on parameters
MAX_NUM_STEPS = 10000
MAX_OBSERVATION_DELTA = 5000
MAX_VIDEO_FPS = 60
| 1.203125 | 1 |
images_augmentation.py | KafKaf/CarND-Semantic-Segmentation | 0 | 12767752 | from glob import glob
import os.path
import cv2
def purge_augmentation(data_folder):
for f in glob(os.path.join(data_folder, 'image_2', 'equ_*.png')):
os.remove(f)
for f in glob(os.path.join(data_folder, 'image_2', 'flipped_*.png')):
os.remove(f)
for f in glob(os.path.join(data_folder, 'gt_... | 2.828125 | 3 |
src/WaveBlocks/IOM_plugin_grid.py | WaveBlocks/WaveBlocks | 0 | 12767753 | <filename>src/WaveBlocks/IOM_plugin_grid.py
"""The WaveBlocks Project
IOM plugin providing functions for handling grid data.
@author: <NAME>
@copyright: Copyright (C) 2010, 2011 <NAME>
@license: Modified BSD License
"""
import numpy as np
import h5py as hdf
def add_grid(self, parameters, blockid=0):
r"""
A... | 2.453125 | 2 |
ps2000Examples/streaming_mode/streaming_mode_gathering.py | LauritzRaisch/picosdk-python-wrappers | 114 | 12767754 | from time import time_ns
from ctypes import POINTER, c_int16, c_uint32
import matplotlib.pyplot as plt
import numpy as np
from picosdk.ps2000 import ps2000
from picosdk.functions import assert_pico2000_ok
from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY
from enum import IntEnum
class Channel(IntEnum)... | 2.515625 | 3 |
tests/test_history.py | l1kw1d/stashboard | 761 | 12767755 | <filename>tests/test_history.py
from datetime import datetime
from datetime import date
from datetime import timedelta
from base import TestbedTest
from models import Event
from models import Service
from models import Status
class HistoryTest(TestbedTest):
def setUp(self):
super(HistoryTest, self).setUp(... | 2.84375 | 3 |
pycozmo/protocol_utils.py | gimait/pycozmo | 1 | 12767756 | <filename>pycozmo/protocol_utils.py
import struct
_struct_cache = dict()
def _get_struct(fmt, length):
key = (fmt, length)
if key in _struct_cache:
return _struct_cache[key]
else:
reader = struct.Struct("<{0}{1}".format(length, fmt))
_struct_cache[key] = reader
return re... | 2.625 | 3 |
modelzoo/apps.py | SuperElastix/ElastixModelZooWebsite | 1 | 12767757 | <filename>modelzoo/apps.py
from django.apps import AppConfig
class ModelzooConfig(AppConfig):
name = 'modelzoo'
| 1.328125 | 1 |
TimeSeriesTools/TS_statistics/ts_statistics.py | Psicowired87/TimeSeriesTools | 1 | 12767758 | <gh_stars>1-10
"""
This module contains the functions which computes interesting statistics. They
can be applied to continious time-series for obtaining important statistics for
the study of causality or prediction.
TODO
----
Pass to the individuals a list of values.
values_info or samevals for all.
"""
from itertoo... | 2.703125 | 3 |
ocrd_butler/celery_utils.py | stweil/ocrd_butler | 6 | 12767759 | <filename>ocrd_butler/celery_utils.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""Utils for celery."""
def init_celery(celery, app):
celery.conf.update(app.config)
celery.conf.update(
task_serializer='json',
accept_content=['json'], # Ignore other content
result_serializer='json',
... | 2.109375 | 2 |
gender_recognition/apps.py | JasonZhangHub/django_gender_app | 0 | 12767760 | <gh_stars>0
from django.apps import AppConfig
class GenderRecognitionConfig(AppConfig):
name = 'gender_recognition'
| 1.320313 | 1 |
src/mysite/urls.py | kierrez/movie-website | 1 | 12767761 | <reponame>kierrez/movie-website
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('titles.urls'... | 2.109375 | 2 |
appengine/cr-buildbucket/main.py | allaparthi/monorail | 2 | 12767762 | <reponame>allaparthi/monorail<gh_stars>1-10
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from components import endpoints_webapp2
from components import ereporter2
from components import utils
import ga... | 1.96875 | 2 |
feed/urls.py | kubapi/hater | 0 | 12767763 | <reponame>kubapi/hater
from django.urls import path
from . import views
app_name = 'feed'
urlpatterns = [
path('', views.index, name='index'),
path('kontakt/', views.contact, name='contact'),
path('o-projekcie/', views.about, name='about'),
path('ranking/', views.ranking, name='ranking'),
path(... | 1.828125 | 2 |
solutions/811.py | tdakhran/leetcode | 0 | 12767764 | from collections import defaultdict
from typing import List
class Solution:
def subdomainVisits(self, cpdomains: List[str]) -> List[str]:
total_count = defaultdict(int)
for cpdomain in cpdomains:
count, domain = cpdomain.split(' ')
while domain:
total_count[... | 3.234375 | 3 |
screenshotter.py | rand0musername/bigmapmaker | 3 | 12767765 | import math
from io import BytesIO
import os
from time import sleep
from PIL import Image
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from geo_utils import get_meters_per_px, get_distance, get_latlng_inc_for_px_inc
class Screenshotter:
def __init__(self, start, end, zoo... | 2.671875 | 3 |
src/utils/lookups.py | PieInTheSky-Inc/pss-statistics | 12 | 12767766 | from typing import Dict as _Dict
# ---------- Constants ----------
REDUCE_TOKENS_LOOKUP: _Dict[int, str] = {
0: '',
1: 'k',
2: 'm',
3: 'g'
} | 2.8125 | 3 |
PrimeTheory/sieve_of_eratosthenes.py | kbrezinski/Candidacy-Prep | 0 | 12767767 | <filename>PrimeTheory/sieve_of_eratosthenes.py
from typing import List
from math import sqrt
def primes_less_than(n: int) -> List[int]:
if n <= 2:
return []
is_prime = [True] * n
is_prime[0] = False
is_prime[1] = False
# loops from 2 to sqrt of n
for i in range(2, int(sqrt(n))):
... | 3.84375 | 4 |
2015/13_seatings.py | pchudzik/adventofcode | 0 | 12767768 | import re
import itertools
"""
--- Day 13: Knights of the Dinner Table ---
In years past, the holiday feast with your family hasn't gone so well. Not everyone gets along! This year, you resolve,
will be different. You're going to find the optimal seating arrangement and avoid all those awkward conversations.
You sta... | 4.03125 | 4 |
avatar_sgg/dataset/ade20k.py | rafiberlin/clp-sose21-pm-vision | 0 | 12767769 | from avatar_sgg.config.util import get_config
import collections
import pandas as pd
import string
import json
import random
import torch
import torch.utils.data as data
import os
import sng_parser
import numpy as np
def get_ade20k_caption_annotations(path_prefix=None):
"""
Precondition: checkout the https://... | 2.359375 | 2 |
taskbar.py | sczzr/visual-window | 0 | 12767770 | <gh_stars>0
import os
import sys
import win32con
import win32gui
def resource_path(relative_path):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath("./icon"), relative_path)
class SysTrayIcon(object):
QUIT = "QUIT"
ID = 1234
... | 2.265625 | 2 |
notebooks/thunderdome/eth2spec/utils/bls.py | casparschwa/beaconrunner | 11 | 12767771 | <gh_stars>10-100
from py_ecc.bls import G2ProofOfPossession as py_ecc_bls
from py_ecc.bls.g2_primatives import signature_to_G2 as _signature_to_G2
import milagro_bls_binding as milagro_bls # noqa: F401 for BLS switching option
# Flag to make BLS active or not. Used for testing, do not ignore BLS in production unless ... | 2.390625 | 2 |
Python_Fundamentals/04_Lambda_Functions_And_Exercise/task_dictionaries/a_key_key_value_value.py | Dochko0/Python | 0 | 12767772 | key = input().strip()
value = input().strip()
count = int(input())
result = ''
for entry in range(count):
keys, values = input().split(' => ')
if key in keys:
result += f'{keys}:\n'
if value in values:
all_values = '\n'.join([f'-{v}' for v in values.split(';') if value in v])
... | 3.59375 | 4 |
Incubator.py | Decamark/CR2Incubator | 0 | 12767773 | <gh_stars>0
# -*- coding: utf-8 -*-
import sys
from struct import pack, unpack
def iprint(s, level):
print(' '*level*2 + s)
class Incubator:
def open_raw(self, path):
raw_f = open(path, 'rb')
self.all_bytes = raw_f.read()
raw_f.close()
def save_jpg(self, path):
jpg_f = op... | 2.578125 | 3 |
crazyflie-clients-python/src/cfclient/ui/dialogs/logconfigdialogue.py | manikamakam/swarm | 0 | 12767774 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | 1.515625 | 2 |
pun/__main__.py | Unviray/pun | 2 | 12767775 | import sys
from .cli import main
sys.exit(main())
| 1.109375 | 1 |
xp-hdf5_parse1.py | johnwilldonicely/LDAS | 2 | 12767776 | <gh_stars>1-10
#!/usr/local/bin/python3
# script for reading HDF5 output from MultiChannelSystems recordings - combined timestamps and waveforms for detected events
# EXAMPLES
# NOTE!!! - the above pathmight be incorrect depending on the machine
# THEREFORE, consider running each command as follows: python3 xp-hdf5_... | 2.671875 | 3 |
src/detext/layers/multi_layer_perceptron.py | StarWang/detext | 1,229 | 12767777 | <gh_stars>1000+
from typing import List
import tensorflow as tf
class MultiLayerPerceptron(tf.keras.layers.Layer):
""" A multi layer perceptron """
def __init__(self, num_hidden: List[int], activations: List, prefix: str = ''):
""" Initializes the layer
:param num_hidden: list of hidden lay... | 3.15625 | 3 |
BackPropogationMLR.py | 1MT3J45/ml-imbalanced-bigdata | 0 | 12767778 | <filename>BackPropogationMLR.py
# MULTILINEAR REGRESSION
# IMPORT LIBRARIES
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# IMPORTING DATASET
def fit_data(data):
dataset = data# pd.read_csv("")
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
print("FIRST X ___\... | 3.53125 | 4 |
vindauga/types/rect.py | gabbpuy/vindauga | 5 | 12767779 | # -*- coding: utf-8 -*-
from .point import Point
class Rect:
"""
A screen rectangular area.
`Rect` is used to hold two coordinates on the screen, which usually specify
the upper left corner and the lower right corner of views. Sometimes the
second coordinate specify the size (extension) of... | 4.375 | 4 |
solutions/numbers/factorial.py | TheAtomicGoose/karan | 0 | 12767780 | <gh_stars>0
"""
Written by <NAME>
Finds the factorial of a number.
"""
def factorial(num):
# While num > 1, multiply num by num - 1
if num > 1:
return num * factorial(num - 1)
return num
print(factorial(10)) | 3.953125 | 4 |
example_project/server/django_server/ajax_client/urls.py | ghuntley/simpleapi | 1 | 12767781 | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
urlpatterns = patterns('',
(r'^$', direct_to_template, {'template': 'ajax_client/index.html'}),
) | 1.328125 | 1 |
py/lukai/proto/github/com/luk_ai/lukai/protobuf/aggregatorpb/aggregator_pb2_grpc.py | d4l3k/lukai | 23 | 12767782 | <reponame>d4l3k/lukai
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from github.com.luk_ai.lukai.protobuf.aggregatorpb import aggregator_pb2 as github_dot_com_dot_luk__ai_dot_lukai_dot_protobuf_dot_aggregatorpb_dot_aggregator__pb2
class AggregatorStub(object):
# missing associat... | 1.515625 | 2 |
hw1/Resources Given/autograder/auto_grader.py | Shubham8037/Rutgers-CS314-Spring19 | 1 | 12767783 | <reponame>Shubham8037/Rutgers-CS314-Spring19
#!/usr/bin/env python3
import os
import sys
import time
import signal
import subprocess
basepath = 'hw1'
problems = ['matmult', 'bst', 'rpn', 'dfa']
buildRequired = False
problemsInSeparateDirectories = False
test_cases_directory = os.getcwd() + '/testcases/'
maxPossibleS... | 2.609375 | 3 |
packaging/setup/plugins/ovirt-engine-common/dockerc/core.py | leongold/ovirt-engine | 0 | 12767784 | <filename>packaging/setup/plugins/ovirt-engine-common/dockerc/core.py<gh_stars>0
#
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2015 Red Hat, 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 ... | 1.757813 | 2 |
promoterz/evaluationPool.py | Jeket/japonicus | 0 | 12767785 | <filename>promoterz/evaluationPool.py
#!/bin/python
import time
import random
import itertools
from multiprocessing import Pool, Process, Pipe, TimeoutError
from multiprocessing.pool import ThreadPool
showIndividue = lambda evaldata: "~ bP: %.3f\tS: %.3f\tnbT:%.3f" % (
evaldata[0][0], evaldata[0][1], evaldata[1]
... | 2.359375 | 2 |
examples/litescope_client.py | TrustedThings/litepuf | 0 | 12767786 | from itertools import product
from sys import stdout
import json
import ctypes
from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
wb = RemoteClient(csr_csv="test/csr.csv")
wb.open()
analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=Tru... | 2.171875 | 2 |
qcli/bsp2svg/api.py | LaudateCorpus1/quake-cli-tools | 42 | 12767787 | <filename>qcli/bsp2svg/api.py<gh_stars>10-100
from collections import namedtuple
from functools import lru_cache
from vgio.quake import bsp
def dot(v0, v1):
return v0[0] * v1[0] + v0[1] * v1[1] + v0[2] * v1[2]
def cross(v0, v1):
return v0[1] * v1[2] - v0[2] * v1[1], \
v0[2] * v1[0] - v0[0] * v1[... | 2.328125 | 2 |
directory_client_core/helpers.py | fericsepi/directory-client-core | 0 | 12767788 | from functools import wraps
import json
import logging
from urllib.parse import urlencode
import requests
from requests.exceptions import HTTPError, RequestException
from w3lib.url import canonicalize_url
from django.conf import settings
from directory_client_core.cache_control import ETagCacheControl
logger = log... | 2.171875 | 2 |
PythonExercicios/ex033.py | marcoantonio97/Curso-de-Python | 0 | 12767789 | <gh_stars>0
n1 = float(input('Primeiro número: '))
n2 = float(input('Segundo número: '))
n3 = float(input('Terceiro número: '))
menor = n1
if n2<n1 and n2<n3:
menor = n2
if n3<n1 and n3<n2:
menor = n3
maior = n1
if n2>n1 and n2>n3:
maior = n2
if n3>n1 and n3>n2:
maior = n3
print('{} é o maior'.format... | 3.953125 | 4 |
demo/quadruped.py | jviereck/pinocchio_bullet | 0 | 12767790 | #///////////////////////////////////////////////////////////////////////////////
#// BSD 3-Clause License
#//
#// Copyright (C) 2018-2019, New York University , Max Planck Gesellschaft
#// Copyright note valid unless otherwise stated in individual files.
#// All rights reserved.
#///////////////////////////////////////... | 2.359375 | 2 |
src/axom/sidre/interface/c_fortran/genfsidresplicer.py | bmhan12/axom | 86 | 12767791 | # Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and
# other Axom Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
#
# Routines to generate splicers for wrappers.
# Used to generate several variations of a routine for Fortran.
# Similar to ... | 1.929688 | 2 |
leveesim/util.py | jdossgollin/leveesim | 0 | 12767792 | <gh_stars>0
"""
Useful functions
These generally fall into three categories:
* those for working with stan / pystan
* those for managing the file system
* those for building the GEV distribution. Although scipy provides a good
implementation of the GEV distribution, it's not compatible with numba, and
so in order to ... | 2.921875 | 3 |
src/github/db/repositories/Repositories.py | ytyaru/GitHub.Repo.Create.201701281344 | 0 | 12767793 | <filename>src/github/db/repositories/Repositories.py<gh_stars>0
#!python3
#encoding:utf-8
import dataset
import requests
import urllib.parse
import datetime
import time
import pytz
import json
import github.api.Pagenation
import github.db.repositories.Languages
class Repositories:
def __init__(self, db_... | 2.484375 | 2 |
setup.py | sthysel/flatspace | 1 | 12767794 | # -*- encoding: utf-8 -*-
from glob import glob
from os.path import basename, splitext
from setuptools import find_packages, setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='flatspace',
license='GPLv2',
version='0.0.1',
description='Space is flat here',
long_de... | 1.765625 | 2 |
api/app.py | Tibblist/react-flask-docker-sample | 0 | 12767795 | from flask import request, jsonify, Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db_string = "postgres://postgres:example@db:5432/postgres"
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = db_string
db = SQLAlchemy(app)
migrate = Migrate(app, db)
class ListModel(db.Mo... | 2.90625 | 3 |
tests/test_mixins.py | gBobCodes/django-rest-framework-proxy-gateway | 0 | 12767796 | from rest_framework import status
from rest_framework.response import Response
from rest_framework.test import APITestCase
from rest_framework_proxy.views import ProxyView
from rest_framework_proxy_gateway.mixins import (
BlockDelete,
BlockGet,
BlockOptions,
BlockPatch,
BlockPost,
BlockPut,
)
... | 2.40625 | 2 |
Leetcode/0201-0250/0238-product-of-array-except-self.py | MiKueen/Data-Structures-and-Algorithms | 0 | 12767797 | '''
Author : MiKueen
Level : Medium
Problem Statement : Product of Array Except Self
Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].
Example:
Input: [1,2,3,4]
Output: [24,12,8,6]
Constraint: It's guaranteed... | 3.578125 | 4 |
src/Database/digikey_web_scraping.py | hong-yh/datasheet-scrubber | 13 | 12767798 | <filename>src/Database/digikey_web_scraping.py
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriv... | 3.203125 | 3 |
filestack/utils/intelligent_ingestion.py | yousefiparsa/filestack-python | 1 | 12767799 | import os
import sys
import mimetypes
import hashlib
import logging
import time
from multiprocessing import Queue, Process
from base64 import b64encode
from collections import deque, OrderedDict
import requests
from filestack.config import HEADERS
from filestack.utils.utils import store_params
log = logging.getLogg... | 2.140625 | 2 |
examples/iris-scatterplot.py | chofchof/probml | 0 | 12767800 | #https://seaborn.pydata.org/generated/seaborn.pairplot.html
import matplotlib.pyplot as plt
import os
import seaborn as sns; sns.set(style="ticks", color_codes=True)
iris = sns.load_dataset("iris")
#g = sns.pairplot(iris)
g = sns.pairplot(iris, hue="species")
plt.savefig(os.path.join('figures', 'iris-scatterplot.pdf')) | 2.734375 | 3 |
zenqueue/client/http/common.py | zacharyvoase/zenqueue | 6 | 12767801 | # -*- coding: utf-8 -*-
import urllib
from urlobject import URLObject
from zenqueue import json
from zenqueue.client.common import AbstractQueueClient
class HTTPQueueClient(AbstractQueueClient):
log_name = 'zenq.client.http'
def __init__(self, host='127.0.0.1', port=3080):
super(HTTPQueue... | 2.40625 | 2 |
python3/pracmln/utils/latexmath2png.py | seba90/pracmln | 123 | 12767802 | #!/usr/bin/python2.5
# Until Python 2.6
from dnutils import logs
from pracmln.utils import locs
"""
Converts LaTeX math to png images.
Run latexmath2png.py --help for usage instructions.
"""
"""
Author:
<NAME> <<EMAIL>>
URL: http://www.kamilkisiel.net
Revision History:
2007/04/20 - Initial version
T... | 2.125 | 2 |
URI/1009.py | Diiego2202/Python | 0 | 12767803 | name = str(input())
salary = float(input())
sales = float(input())
total = salary + (sales * 0.15)
print(f'TOTAL = R$ {total:.2f}') | 3.484375 | 3 |
main/cogs/beta.py | avizum/Groot | 0 | 12767804 | from utils._type import *
import discord
from discord.ext import commands
class Beta(commands.Cog):
"""
A cog with commands available to only the beta-testers
"""
def __init__(self, bot):
self.bot = bot
def cog_check(self, ctx: customContext):
member: discord.Member = self.bo... | 2.375 | 2 |
com/kakao/cafe/menu/smoothie/berryBerrySmoothie.py | roseonghwan/kakao-cafe | 2 | 12767805 | <gh_stars>1-10
from com.kakao.cafe.menu.smoothie.smoothie import Smoothie
class BerryBerrySmoothie(Smoothie):
def __init__(self):
super().__init__()
self.__mixedBerry = 1
self.name = 'BerryBerrySmoothie'
self.__price = 5000
self.__groundIce = 400
def getName(self) -> s... | 2.921875 | 3 |
api.py | richrosenthal/Hackathon-SteelHacks-_Creddy_Website | 0 | 12767806 | <reponame>richrosenthal/Hackathon-SteelHacks-_Creddy_Website
import ads
import json
ADS_DEV_KEY = '<KEY>'
def main():
with open( 'papers.json', 'w' ) as f:
ads.config.token = ADS_DEV_KEY
papers = ads.SearchQuery( q ="supernova", sort='citation_count', fl=['title','citation_count'])
foundPa... | 2.4375 | 2 |
bebotPlatform/settings.py | ElitosGon/bebotPlatform | 0 | 12767807 | """
Django settings for bebotPlatform project.
Generated by 'django-admin startproject' using Django 2.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
from dj... | 1.789063 | 2 |
users/migrations/0010_user_cerbere_login.py | MTES-MCT/apilos | 0 | 12767808 | # Generated by Django 3.2.13 on 2022-05-17 14:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0009_alter_user_filtre_departements"),
]
operations = [
migrations.AddField(
model_name="user",
name="cerb... | 1.578125 | 2 |
examples/Garch_Example.py | zli69/finance_ml | 0 | 12767809 | #https://machinelearningmastery.com/develop-arch-and-garch-models-for-time-series-forecasting-in-python/
# example of ARCH model
from random import gauss
from random import seed
from matplotlib import pyplot
from arch import arch_model
# seed pseudorandom number generator
seed(1)
# create dataset
data = [gauss(0, i*0.... | 3.875 | 4 |
src/main.py | shanytc/BlastML | 4 | 12767810 | <reponame>shanytc/BlastML<filename>src/main.py<gh_stars>1-10
from BlastML.blastml import CFG, BlastML
# /Users/i337936/Desktop/
# /home/ubuntu/projects/
def main():
# Configurations for BlastML
cfg = CFG(
project={
'project_name': 'shanynet',
'root': '/Users/i337936/Desktop/',
'project_folder': 'final_pr... | 2.046875 | 2 |
readme.py | mungojelly/Fifth-Dimensional-Chaos-Matrix | 0 | 12767811 | <filename>readme.py<gh_stars>0
#!/usr/bin/python
import re
import random
alternatives_bracket = re.compile(r'\[([^/]*)/([^\]]*)\]') # thar be dragons! explanation:
# \[ open bracket
# ([^/]*) first group, goes up to a slash
# / the slash
# ([^\]]*) second group, goes up to the closing bracket
# \] clos... | 3.53125 | 4 |
RTplzrunBlog/Divide and Conquer/1780.py | lkc263/Algorithm_Study_Python | 0 | 12767812 | import sys
read = sys.stdin.readline
n = int(read())
board = [list(map(int, read().split())) for _ in range(n)]
array = [0] * 3
def dfs(x, y, n):
global array
num_check = board[x][y]
# 위의 구간 두개의 for문 돌리면서 현재 시작점과 해당 위치 구간 값이 다르다면 재귀호출
# print()
# print("현재 x, y, n", x, y, n)
for i in rang... | 3.328125 | 3 |
more/transaction/tests/test_transaction.py | morepath/more.transaction | 3 | 12767813 | <reponame>morepath/more.transaction
import morepath
from transaction import TransactionManager
from transaction.interfaces import TransientError
from more.transaction import TransactionApp
from more.transaction.main import transaction_tween_factory, default_commit_veto
from webtest import TestApp as Client
import pyte... | 2.25 | 2 |
PluginMaster/pluginListener.py | swinflowcloud/mspf | 2 | 12767814 | <filename>PluginMaster/pluginListener.py
from watchdog.events import *
import logging
from . import globalVal
class FileEventHandler(FileSystemEventHandler):
def __init__(self):
logging.basicConfig(filename=globalVal.LOGS_DIR+'/plugin_master.log',
level=logging.DEBUG,
... | 2.234375 | 2 |
server/domain/usecase/create_room.py | jwilyandi19/tic-tac-royale | 0 | 12767815 | import server.domain.model.tictactoe as tttMod
import server.domain.model.room as roomMod
import asyncio.locks as lockMod
class CreateRoom:
def __init__(self, ticTacToe: tttMod.TicTacRoyale, lock: lockMod.Lock):
self.tictactoe = ticTacToe
self.lock = lock
def Create(self) -> roomMod.Room:
... | 2.421875 | 2 |
lib/amqp/amqpadapter.py | Juniper/YAPT | 33 | 12767816 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
# Copyright (c) 2018 Juniper Networks, Inc.
# All rights reserved.
# Use is subject to license terms.
#
# Author: cklewar
import abc
import sys
import threading
import pika
from pika import exceptions
from lib.logmsg import LogAmqp as logmsg
import lib.c... | 1.789063 | 2 |
Node3D/base/data/Math.py | ArnoChenFx/Node3D | 3 | 12767817 | import numpy as np
def clamp(value, min, max):
return np.clip(value, min, max)
def lerp(a, b, fraction):
fraction = clamp(fraction, 0, 1)
return a * (1 - fraction) + b * fraction
def fit(value, omin, omax, nmin, nmax):
v = (value - omin) / (omax - omin)
return v * (nmax - nmin) + nmin
def fi... | 2.8125 | 3 |
chapter_6/scalability/scalability.py | mossblaser/phd_thesis_experiments | 1 | 12767818 | <gh_stars>1-10
import random
import math
import time
import logging
import argparse
import sys
from collections import defaultdict
from rig.place_and_route import place, allocate, route, Machine, Cores, SDRAM
from rig.netlist import Net
from rig.routing_table import routing_tree_to_tables, minimise_tables
from rig.ro... | 2.078125 | 2 |
poky-dunfell/bitbake/lib/bb/parse/parse_py/BBHandler.py | lacie-life/YoctoPi | 0 | 12767819 | """
class for handling .bb files
Reads a .bb file and obtains its metadata
"""
# Copyright (C) 2003, 2004 <NAME>
# Copyright (C) 2003, 2004 <NAME>
#
# SPDX-License-Identifier: GPL-2.0-only
#
import re, bb, os
import bb.build, bb.utils
from . import ConfHandler
from .. import resolve_file, ast, logger, P... | 2.6875 | 3 |
tests/test_lib.py | ajberkley/minorminer | 0 | 12767820 | """
Unit tests over parameter combinations of the library.
TODO ADD MORE
"""
from __future__ import print_function
from minorminer import find_embedding as find_embedding_orig
from warnings import warn
import os
import sys
import time
# Given that this test is in the tests directory, the calibration data shou... | 2.5 | 2 |
CadeMinhaPasta/teste.py | RafaelContact/pythonProject | 0 | 12767821 | nome = str(input('Digite seu nome : '))
print(f'Voce digitou {nome:^40}') | 3.015625 | 3 |
few_shot_learning/train_few_shot.py | gitmatti/few-shot-learning | 0 | 12767822 | """
Run few-shot learning on FashionProductImaes dataset using code from github
repo https://github.com/oscarknagg/few-shot under
MIT License
Copyright (c) 2019 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to... | 1.539063 | 2 |
test.py | lelloman/python-introcutter | 1 | 12767823 | <reponame>lelloman/python-introcutter<gh_stars>1-10
#!/usr/bin/python
"""
a simple test to check that every piece is in place
TMP_DIR and OUTPUT_DIR from conf.py are used in order to check that
writing there is ok
first a mock intro track is created, just some random tones put together,
then N_TEST_CASES tracks are c... | 3.40625 | 3 |
deep_banana_eater.py | jwergieluk/deep_banana_eater | 0 | 12767824 | <filename>deep_banana_eater.py
import math
import datetime
import os
import pandas
import matplotlib.pyplot as plt
import numpy
import random
from unityagents import UnityEnvironment
import torch
import torch.nn
import torch.optim
from collections import deque, namedtuple
import click
DEVICE = torch.device("cuda:0" i... | 2.578125 | 3 |
NEATClub/Parameters.py | Magody/IAProyecto_NEAT | 0 | 12767825 |
class Parameters:
WINDOW_WIDTH = 500
WINDOW_HEIGHT = 600
BASE_HEIGHT = 100
BASE_IMAGE = "base.png"
BACKGROUND_IMAGE = "bg.png"
BIRD_IMAGES = ["bird1.png", "bird2.png", "bird3.png"]
PIPE_IMAGES = ["pipe.png"]
| 1.71875 | 2 |
stx/outputs/html/themes.py | bakasoft/stx | 1 | 12767826 | from typing import List
class HtmlTheme:
def __init__(self):
self.head_styles: List[str] = []
self.head_scripts: List[str] = []
self.body_scripts: List[str] = []
class NullHtmlTheme(HtmlTheme):
pass
| 2.296875 | 2 |
aradhana/views.py | hehaichi/Aradhana-2017-Webapp | 0 | 12767827 | from django.shortcuts import render,redirect,get_object_or_404
from .models import Student, Event
# Create your views here.
def index(request):
students = Student.objects.all()
events = Event.objects.all().order_by('name','category')
context={'event_len':len(events),'students':len(students),'events':events}
return ... | 1.929688 | 2 |
src/bitwardentools/common.py | kiorky/bitwardentools | 0 | 12767828 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import enum
import logging
import os
import re
from http.client import HTTPConnection
class VAULTIER_SECRET(enum.IntEnum):
secret = 200
note = 100
file = 300
def sanitize(st):
... | 2.28125 | 2 |
repositories/__init__.py | Simon1093/book-shop | 0 | 12767829 | from .pastebin_repository import PasteBinRepository
| 1.023438 | 1 |
deco/sinks/sink.py | mfojtak/decor | 1 | 12767830 | from abc import ABC, abstractmethod
class Sink(ABC):
@abstractmethod
def __iter__(self):
pass
def eval(self):
it = iter(self)
while True:
try:
next(it)
except StopIteration:
break | 3.3125 | 3 |
Sorting and pathfinding/dijkstra.py | LucasEmmes/pythonScripts | 0 | 12767831 | <filename>Sorting and pathfinding/dijkstra.py
# It make a node
class node:
def __init__(self, symbol):
self.symbol = symbol
self.edges = []
self.shortest_distance = float('inf')
self.shortest_path_via = None
# Adds another node as a weighted edge
def add_edge(self, node, dis... | 4 | 4 |
app.py | aslan1301/sql_alchemy | 0 | 12767832 | <reponame>aslan1301/sql_alchemy<filename>app.py
# Dependencies
from flask import Flask, jsonify
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
# Set up database
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
B... | 2.484375 | 2 |
python/ml4ir/applications/ranking/tests/test_tfrecord_reader.py | ducouloa/ml4ir | 0 | 12767833 | import unittest
import tensorflow as tf
import logging
from ml4ir.base.data.tfrecord_reader import TFRecordSequenceExampleParser
from ml4ir.base.features.feature_config import FeatureConfig
from ml4ir.base.config.keys import TFRecordTypeKey
from ml4ir.base.io.local_io import LocalIO
from ml4ir.base.features.preprocess... | 2.40625 | 2 |
CosmOrc/cospar.py | akvatol/CosmOrc | 1 | 12767834 | import re
import pandas as pd
from CosmOrc.setting import Setting
def chunkit(data: list or tuple = None, n: int = None):
"""
Функция разбивает исходный массив на N частей (N == n).
Arguments
---------
data_list: list or tuple
Массив, который будет разделен на n частей
n: int
... | 3.109375 | 3 |
alembic/versions/61298763f7e4_create_characters_table.py | chalupaul/twitch_dungeon | 0 | 12767835 | <filename>alembic/versions/61298763f7e4_create_characters_table.py
"""create characters table
Revision ID: 61298763f7e4
Revises:
Create Date: 2020-10-24 12:29:03.632815
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "61298763f7e4"
down_revision = None
branch_... | 1.445313 | 1 |
actionnetwork_activist_sync/full_member_api_pull.py | afitts/actionnetwork_activist_sync | 0 | 12767836 | <gh_stars>0
import pandas as pd
import numpy as np
import requests
import datetime
from actionnetwork_activist_sync.actionnetwork import ActionNetwork
def get_all_people(api=None, people=None, url="https://actionnetwork.org/api/v2/people",i=0):
if not people:
people = []
data = requests.get(url=url, he... | 2.4375 | 2 |
runRec.py | rocco-haro/Linear-Difference-Eq. | 0 | 12767837 | <reponame>rocco-haro/Linear-Difference-Eq.
# Linear Algebra Take Home Quiz #3
# Author: <NAME>
# University of Alaska, Anchorage
# Oct '17'
# https://github.com/rocco-haro/Linear-Difference-Eq..git
import numpy as np
class StateMtx(object):
""" Calculates the k+1 values for a linear difference equation
"""
... | 3.90625 | 4 |
addresses/models.py | indoriyasboyz/E-commerce | 0 | 12767838 | from django.db import models
from billing.models import BillingProfile
ADDRESS_TYPES = (
('billing', 'Billing'),
('shipping', 'Shipping')
)
class Address(models.Model):
billing_profile = models.ForeignKey(BillingProfile, null=True, blank=False, on_delete=models.SET_NULL)
address_type = models.CharFi... | 2.5625 | 3 |
shgp/classification/demos/demo_pgpr_1D.py | GiovanniPasserello/SHGP | 0 | 12767839 | <gh_stars>0
import gpflow
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from shgp.data.dataset import PlatformDataset
from shgp.utilities.general import invlink
from shgp.utilities.train_pgpr import train_pgpr
np.random.seed(42)
tf.random.set_seed(42)
"""
Demonstration of non-sparse PGPR... | 2.3125 | 2 |
Adafruit_BMP/BMP280.py | DragonflyNet67/Adafruit_Python_BMP | 0 | 12767840 | # Author: <NAME> <<EMAIL>>
#
# Based on the Adafruit BMP280 Driver C++ driver and the BMP085 python lib.
# - https://github.com/adafruit/Adafruit_BMP280_Library
# - https://github.com/adafruit/Adafruit_Python_BMP
#
# Datasheet: https://www.adafruit.com/datasheets/BST-BMP280-DS001-11.pdf
from __future__ import divisi... | 1.703125 | 2 |
test/common.py | stavros7167/distributed_protocol_completion | 0 | 12767841 | import automaton
def automaton1():
a = automaton.Automaton()
a.add_string('label1L a? b! label2L')
return a
def process_example():
process = automaton.Automaton()
process.add_edge('p0', 'p1', label='a!')
return process
def environment_example():
environment = automaton.Automaton()
e... | 2.703125 | 3 |
2312.py | gabzin/uri | 3 | 12767842 | d=dict()
for _ in range(int(input())):
s=input().split(' ',1)
d[s[0]]=list(map(int,s[1].split()))
d=dict(sorted(d.items(), key=lambda x: x[0]))
d=dict(sorted(d.items(), key=lambda x: x[1][2],reverse=True))
d=dict(sorted(d.items(), key=lambda x: x[1][1],reverse=True))
d=dict(sorted(d.items(), key=lambda x: x[1][... | 3.34375 | 3 |
server/config.py | smartscenes/multiscan | 6 | 12767843 | import os
import util
# Server configuration
DATA_SERVER = 'http://localhost:3030'
TEMP_FOLDER = 'tmp'
STAGING_FOLDER = 'staging'
AUTOPROCESS = True
# General paths to binaries
SCRIPT_DIR = util.getScriptPath()
SOURCE_DIR = os.path.join(SCRIPT_DIR, '..')
DATA_DIR = 'staging/'
COLOR_FOLDER = 'color'
DEPTH_FOLDER = 'd... | 2.140625 | 2 |
tests/test_compression_func_default.py | dylan-profiler/compressio | 16 | 12767844 | import numpy as np
import pandas as pd
import pytest
from pandas.testing import assert_series_equal
from visions import StandardSet
from compressio.compress import compress_func
from compressio.type_compressor import DefaultCompressor
bool_dtype = "boolean" if int(pd.__version__.split(".")[0]) >= 1 else "Bool"
@pyt... | 2.296875 | 2 |
toucan/alert_api/migrations/0001_initial.py | toucan-project/TOUCAN | 4 | 12767845 | <reponame>toucan-project/TOUCAN
# Generated by Django 2.2.3 on 2019-08-27 10:12
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CanaryAlertItem',
fields=[
... | 1.867188 | 2 |
lib/python2.7/site-packages/samba/tests/common.py | abankalarm/pth-toolkit | 480 | 12767846 | <filename>lib/python2.7/site-packages/samba/tests/common.py
# Unix SMB/CIFS implementation. Tests for common.py routines
# Copyright (C) <NAME> 2011
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | 2.40625 | 2 |
shopping_mall/order/admin.py | djangojeng-e/djangoproejcts | 0 | 12767847 | <filename>shopping_mall/order/admin.py<gh_stars>0
from django.contrib import admin
from .models import Order
# Register your models here.
class OrderAdmin(admin.ModelAdmin):
list_display = ('fcuser', 'product')
admin.site.register(Order, OrderAdmin) | 1.515625 | 2 |
python/local-for.py | tbedford/code-snippets | 0 | 12767848 | <filename>python/local-for.py
def my_func(count=4):
for i in range (1, 5):
print("count", count)
if count == 2:
print("count", count)
count = count - 1
my_func()
| 3.40625 | 3 |
sypt_train.py | pan-webis-de/hosseinia18 | 1 | 12767849 | import torch, os, argparse
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import sypt_dataset, sypt_utils
from torch.utils.data import DataLoader
from sypt_utils import *
from sypt_dataset import create_pt_pan2018
US = "\x1f" # unit separator => se... | 2.265625 | 2 |
metagov/metagov/core/migrations/0006_auto_20211101_2053.py | ajnam12/gateway | 8 | 12767850 | # Generated by Django 3.2.2 on 2021-11-01 20:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_remove_linkedaccount_unique_identifer_on_community_platform'),
]
operations = [
migrations.AddField(
model_name='pl... | 1.664063 | 2 |