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 |
|---|---|---|---|---|---|---|
app/mongo/data/collect/models/model.py | jgphilpott/polyMaker | 0 | 12771651 | class Model():
def __init__(self, model):
pass
| 1.359375 | 1 |
qs_backend/qs_backend/workers/worker_fetch_stock.py | Praneesh/quickstocks | 2 | 12771652 | <filename>qs_backend/qs_backend/workers/worker_fetch_stock.py
#! /usr/bin/env python3
# __author__ = "<NAME>"
# __credits__ = []
# __version__ = "0.1.2"
# __maintainer__ = "<NAME>"
# __email__ = "<EMAIL>"
# __status__ = "Prototype"
#
# Step 1: Spawned as a thread, fetches the stock price and pushe... | 2.65625 | 3 |
Source/lbp.py | SaladinoBelisario/PatternsProject | 1 | 12771653 | <gh_stars>1-10
import numpy as np
from scipy.signal import convolve2d
#Filter to make a series of convolve operations
f1 = np.array([[1, 0, 0], [0, -1, 0], [0, 0, 0]])
f2 = np.array([[0, 1, 0], [0, -1, 0], [0, 0, 0]])
f3 = np.array([[0, 0, 1], [0, -1, 0], [0, 0, 0]])
f4 = np.array([[0, 0, 0], [0, -1, 1], [0, 0, 0]])
f... | 2.25 | 2 |
hvac_cli/cmd.py | hvac/hvac-cli | 5 | 12771654 | import sys
import os
from cliff.app import App
from cliff.commandmanager import CommandManager
from hvac_cli.version import __version__
DEFAULT_VAULT_ADDR = 'http://127.0.0.1:8200'
class HvacApp(App):
def __init__(self):
super(HvacApp, self).__init__(
description="""
hvac-cli i... | 2.453125 | 2 |
python__fundamentals/data_types_and_variables_lab/05.pounds_to_dollars.py | EmilianStoyanov/Projects-in-SoftUni | 1 | 12771655 | pound = int(input())
conv_to_dollar = pound * 1.31
print(f"{conv_to_dollar:.3f}")
| 3.59375 | 4 |
jcourse_api/admin.py | dujiajun/jcourse_api | 7 | 12771656 | <reponame>dujiajun/jcourse_api
import os
from django.contrib import admin
from django.db import IntegrityError
from django.db.models import F
from import_export import resources, fields
from import_export.admin import ImportExportModelAdmin
from import_export.widgets import ForeignKeyWidget, ManyToManyWidget
from jco... | 2.015625 | 2 |
web-crawler/spider-wechat/config.py | lovelifeming/AI-Studies-Road | 0 | 12771657 | <filename>web-crawler/spider-wechat/config.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/4/30 13:40
# @Author : zengsm
# @File : config
#爬取公众号文章
PROXY_POOL_URL = 'http://127.0.0.1:5000/get'
KEYWORD ='计算机等级二级' # 输入关键词
MONGO_URI = 'localhost'
MONGO_DB = 'data'
MAX_COUNT = 5 | 1.398438 | 1 |
QGrain/__init__.py | yuriok/QGrain | 4 | 12771658 | QGRAIN_VERSION = "0.3.4.2"
import os
QGRAIN_ROOT_PATH = os.path.dirname(__file__)
from enum import Enum, unique
@unique
class DistributionType(Enum):
Customized = "Customized"
Nonparametric = "NonParametric"
Normal = "Normal"
Weibull = "Weibull"
SkewNormal = "SkewNormal"
@unique
class FittingSt... | 2.421875 | 2 |
testing/vcs/test_vcs_verify_levels_extensions_order_setting.py | xylar/cdat | 62 | 12771659 | import vcs
x=vcs.init()
b=x.createboxfill()
b.boxfill_type="custom"
b.levels=[10.0, 21.42857142857143, 32.85714285714286, 44.28571428571429, 55.71428571428572, 67.14285714285715, 78.57142857142858, 90.00000000000001]
assert(abs(b.levels[0])<1.e19 and b.ext_1 is False and b.ext_2 is False)
b.ext_1=False
assert(abs(b.lev... | 2.25 | 2 |
src/preprocessor.py | martinoywa/MultiDigitClassification-API | 4 | 12771660 | <reponame>martinoywa/MultiDigitClassification-API
import io
from torchvision import transforms
from PIL import Image
def preprocess(image_bytes):
"""
Returns transformed image tensor.
:param image_bytes: image bytes from canvas.
:return: transformed image.
"""
transform = transforms.Compose([
... | 3.28125 | 3 |
z.uncategorized/softeer581.py | kimminki10/algorithms2 | 0 | 12771661 | """
https://softeer.ai/practice/info.do?eventIdx=1&psProblemId=581
택배 마스터 광우
큐, 순열
"""
import sys
input = sys.stdin.readline
import itertools
N, M, K = map(int, input().split())
arr = map(int, input().split())
result = 987654321
def dojob(k, p, m):
global result
part_sum = 0
s = 0
i = 0
while Tr... | 2.90625 | 3 |
Utilities/learn_weights.py | tesslerc/H-DRLN | 31 | 12771662 | <filename>Utilities/learn_weights.py<gh_stars>10-100
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import h5py
import numpy as np
import math
import tensorflow as tf
FLAGS = None
def main(_):
hiddenWidth1 = 100
hiddenWidth... | 2.28125 | 2 |
corehq/apps/sms/management/commands/change_phonenumber_backend.py | dimagilg/commcare-hq | 471 | 12771663 | <filename>corehq/apps/sms/management/commands/change_phonenumber_backend.py<gh_stars>100-1000
import os
import sys
from collections import defaultdict
from django.core.management.base import BaseCommand
import csv
from corehq.util.log import with_progress_bar
from ...models import PhoneNumber, SQLMobileBackend
from... | 2.265625 | 2 |
airflow/contrib/operators/pubsub_operator.py | diggzhang/airflow-dingit | 6 | 12771664 | <filename>airflow/contrib/operators/pubsub_operator.py<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# 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
#
#... | 2.421875 | 2 |
pastebin/paste.py | 11mariom/pastebin | 1 | 12771665 | # -*- encoding: utf-8 -*-
#from flask_sqlalchemy import SQLAlchemy
#db = SQLAlchemy()
from sqlalchemy import Column, Integer, Text
from database import db
from database import Base
class Paste(Base):
__tablename__ = 'paste'
id = Column(Integer, primary_key = True)
#hash = db.Column(db.String(32), unique =... | 2.984375 | 3 |
dark/codonDistance.py | UdoGi/dark-matter | 10 | 12771666 | <reponame>UdoGi/dark-matter<filename>dark/codonDistance.py<gh_stars>1-10
from collections import defaultdict
def findDistance(co1, co2):
"""
Find the distance between two codons.
@param co1: A C{str} of length three.
@param co2: A C{str} of length three.
@return: An C{int} distance in [0, 3].
... | 2.984375 | 3 |
external/plex/dist/tests/test10.py | almartin82/bayeslite | 964 | 12771667 | <filename>external/plex/dist/tests/test10.py
# Test traditional regular expression syntax.
import Test
from Plex.Traditional import re
from Plex.Errors import PlexError
from Plex import Seq, AnyBut
def test_err(s):
try:
print re(s)
except PlexError, e:
print e
print re("")
print re("a")
print re("[a]")
... | 2.6875 | 3 |
lomond/events.py | johnashu/dataplicity-lomond | 225 | 12771668 | from __future__ import unicode_literals
import json
import time
class Event(object):
"""Base class for a websocket 'event'."""
__slots__ = ['received_time']
def __init__(self):
self.received_time = time.time()
def __repr__(self):
return "{}()".format(self.__class__.__name__)
@c... | 3.015625 | 3 |
twittoff/twitter.py | rgiuffre90/twittoff | 0 | 12771669 | """Retrive Tweets, word embeddings, and populate DB"""
import tweepy
import spacy
from .models import DB, Tweet, User
from os import getenv
TWITTER_API_KEY = getenv('TWITTER_API_KEY')
TWITTER_API_KEY_SECRET = getenv('TWITTER_API_KEY_SECRET')
TWITTER_AUTH = tweepy.OAuthHandler(TWITTER_API_KEY, TWITTER_API_KEY_SECRET)... | 3.078125 | 3 |
tests/checks/check.py | ptrahrens/ReproBLAS | 6 | 12771670 | import os
from tests.checks import checks
from tests.harness import harness
from scripts import terminal
check_dir = os.path.dirname(os.path.abspath(__file__))
check_suite = checks.CheckSuite()
folds = [3]
inf_folds = [3]
incs = [1]
FLT_BIN_WIDTH=13
FLT_MAX_EXP=128
FLT_BIG_EXP=13
FLT_SMALL_EXP=-12
FLT_MIN_EXP=-125... | 1.765625 | 2 |
elisa/linalg/mat3.py | christianbitter/Elisa | 1 | 12771671 | from __future__ import annotations
import math
from .linalg import is_numeric
from .vec3 import Point3, Vec3
# TODO: is orthogonal
# TODO: is orthonormal
# TODO: cross product
class Mat3:
"""
A 3x3 matrix, built in row-wise order. That is the values a, b, c, d, e, f, g, h, i
go into:
a | b | c
-... | 3.1875 | 3 |
starter_kit/lib/engine.py | ido777/Skillz | 0 | 12771672 | #!/usr/bin/env python
from __future__ import print_function
import time
import traceback
import os
import base64
import random
import sys
import json
import subprocess
from os import walk
from os.path import splitext, join
import io
if sys.version_info >= (3,):
def unicode(s):
return s
from sandbox import... | 2.40625 | 2 |
tests/gpu/test_gpuargs.py | gnafit/gna | 5 | 12771673 | #!/usr/bin/env python
"""Check Identity class"""
from matplotlib import pyplot as plt
import numpy as N
from load import ROOT as R
from matplotlib.ticker import MaxNLocator
from gna import constructors as C
from gna.bindings import DataType
from gna.unittest import *
from gna import context
#
# Create the matrix
#
d... | 2.484375 | 2 |
hcap/views/my_capacity_notifications_view_set.py | fabiommendes/capacidade_hospitalar | 0 | 12771674 | from django.utils.translation import gettext_lazy as _
from hcap_notifications.models import HealthcareUnitCapacity
from hcap_utils.contrib.material.viewsets import ModelViewSet
class MyCapacityNotificationsViewSet(ModelViewSet):
model = HealthcareUnitCapacity
label = "hcap"
name = "my_capacity_notificat... | 2.15625 | 2 |
py_algo/basics/implementation/binary_movement.py | Sk0uF/Algorithms | 1 | 12771675 | """
Codemonk link: https://www.hackerearth.com/practice/basic-programming/implementation/basics-of-implementation/practice-problems/algorithm/binary-movement/
You are given a bit array (0 and 1) of size n. Your task is to perform Q queries. In each query you have to toggle all
the bits from the index L to R (L and... | 3.84375 | 4 |
src/twitter.py | shivchander/political-alignment-prediction | 1 | 12771676 | <gh_stars>1-10
import tweepy
from src.keys import keys
from src.bacon import Frontier, safe_lookup_users
__author__ = '<NAME>'
class Tweet:
def __init__(self, user_handle):
"""
:param user_handle: twitter username without '@' symbol
:return: class method
"""
self._consume... | 2.859375 | 3 |
drake_pytorch/__init__.py | DAIRLab/drake-pytorch | 9 | 12771677 | from drake_pytorch.symbolic import sym_to_pytorch, Simplifier
| 1.171875 | 1 |
dqsort/sort.py | MaestroGraph/quicksort | 0 | 12771678 | <reponame>MaestroGraph/quicksort<filename>dqsort/sort.py
import torch
import torch.nn.functional as F
from torch import nn, Tensor
import util, tensors
import numpy as np
"""
Modules to implement differentiable quicksort.
```Split``` implements the half-permutation.
```SortLayer``` chains these into quicksort.
"""... | 2.71875 | 3 |
sublime/Packages/Anaconda/anaconda_lib/explore_panel.py | mklewitz-kisura/dotfiles | 0 | 12771679 |
# Copyright (C) 2013 ~ 2016 - <NAME> <<EMAIL>>
# This program is Free Software see LICENSE file for details
import sublime
from ._typing import List
from Default.history_list import get_jump_history_for_view
class ExplorerPanel:
"""
Creates a panel that can be used to explore nested options sets
The d... | 3.078125 | 3 |
test/helpers.py | dboeckenhoff/tikzplotlib | 0 | 12771680 | <filename>test/helpers.py
import os
import subprocess
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import tikzplotlib
def print_tree(obj, indent=""):
"""Recursively prints the tree structure of the matplotlib object.
"""
if isinstance(obj, matplotlib.text.Text):
print(indent... | 2.53125 | 3 |
tests/interface_test.py | welfare-state-analytics/pyriksprot | 0 | 12771681 | from __future__ import annotations
import glob
import os
import uuid
from typing import Callable
import pandas as pd
import pytest
from black import itertools
from pyriksprot import interface, to_speech
from pyriksprot.corpus import tagged as tagged_corpus
from .utility import TAGGED_SOURCE_PATTERN, UTTERANCES_DICT... | 2.125 | 2 |
S4/S4 Decompiler/Old Libraries/uncompyle6/parsers/parse38.py | NeonOcean/Environment | 1 | 12771682 | <reponame>NeonOcean/Environment<gh_stars>1-10
# Copyright (c) 2017-2019 <NAME>
#
# 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 Foundation, either version 3 of the License, or
# (at your option) any l... | 1.726563 | 2 |
Calibration/IsolatedParticles/test/python/proto_runIsolatedTracksNxNNzsData_cfg.py | ckamtsikis/cmssw | 852 | 12771683 | import FWCore.ParameterSet.Config as cms
process = cms.Process("L1SKIM")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 100000
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
####################### configure pool source ####... | 1.257813 | 1 |
build/plugins/lib/nots/package_manager/pnpm/tests/workspace.py | jochenater/catboost | 6,989 | 12771684 | <filename>build/plugins/lib/nots/package_manager/pnpm/tests/workspace.py
from build.plugins.lib.nots.package_manager.base import PackageJson
from build.plugins.lib.nots.package_manager.pnpm.workspace import PnpmWorkspace
def test_workspace_get_paths():
ws = PnpmWorkspace(path="/packages/foo/pnpm-workspace.yaml")
... | 2.109375 | 2 |
python/src/yalix/globals.py | rm-hull/yalix | 4 | 12771685 | <reponame>rm-hull/yalix
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Some predefined functions injected into an environment
"""
import functools
import operator
import random
import math
import time
from yalix.py3_compat import long_t
from yalix.utils import log_progress
from yalix.parser import scheme_parser
fr... | 2.078125 | 2 |
python/pygame/basic/collison-detection.py | batturo/lightning-projects | 15 | 12771686 | import os
import random
import sys
import pygame
from pygame.locals import *
class Satyr(pygame.sprite.Sprite):
def __init__(self, position, ipath, scale=0.5):
pygame.sprite.Sprite.__init__(self)
img = pygame.image.load(ipath)
rect = img.get_rect(center=position)
w, h = rect.size... | 2.828125 | 3 |
tests/test_processor.py | alisaifee/jira-cli | 125 | 12771687 | <gh_stars>100-1000
import unittest
import mock
from jiracli.interface import build_parser, cli
class AddCommandTests(unittest.TestCase):
def test_issue_type_parsing(self):
"Previously, calling this would raise an exception on python3"
with mock.patch("jiracli.interface.print_output"):
... | 2.484375 | 2 |
Metodos Computacionales Uniandes/Code/ejercicio_28.py | aess14/Cursos-Uniandes | 0 | 12771688 | <filename>Metodos Computacionales Uniandes/Code/ejercicio_28.py
#Escriba una función en python que toma como entrada dos listas
#(valores_x, valores_y) y el grado de un polinomio (p_poli, un entero
# positivo) y ajusta
#por mínimos cuadrados el polinomio de orden p_poli... | 3.546875 | 4 |
toontown/uberdog/GlobalLobbyManagerAI.py | CrankySupertoon01/Toontown-2 | 1 | 12771689 | from direct.distributed.DistributedObjectGlobalAI import DistributedObjectGlobalAI
from direct.distributed.PyDatagram import *
from direct.directnotify.DirectNotifyGlobal import directNotify
class GlobalLobbyManagerAI(DistributedObjectGlobalAI):
notify = directNotify.newCategory('GlobalLobbyManagerAI')
def an... | 1.890625 | 2 |
src/ensemble_voting.py | andifunke/semeval18task12 | 2 | 12771690 | """
Combines predictions based on votes by a set of answer files.
"""
import re
from os import listdir
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from sklearn.metrics import accuracy_score
from .consta... | 2.734375 | 3 |
tests/test_color.py | underwatergrasshopper/PyUnderGUI | 0 | 12771691 | <filename>tests/test_color.py
import math
from TestKit import *
from UnderGUI.Color import *
__all__ = ['test_color']
def test_color():
### ColorF ###
c = ColorF(1, 0.5, 0.75, 0.25).to_color_i()
assert c.r == 255 and c.g == 127 and c.b == 191 and c.a == 63
c = ColorF(1, 0.5, 0.75, 0.25).to_color_f()... | 2.796875 | 3 |
roses/effect_size/test/vargha_delaney_test.py | jacksonpradolima/roses | 7 | 12771692 | <reponame>jacksonpradolima/roses
import unittest
import pandas as pd
from roses.effect_size.vargha_delaney import VD_A, VD_A_DF, reduce
class RunningEffectSize(unittest.TestCase):
def test_VD_A_negligible(self):
# negligible
array1 = [0.8236111111111111, 0.7966666666666666, 0.923611111111111, 0.... | 2.734375 | 3 |
DeepFashionModel/classDetect/predict_and_pickle.py | RexBarker/DeepF | 0 | 12771693 | <reponame>RexBarker/DeepF
# given an input model, run batch prediction and pickle results
import os
import matplotlib.pyplot as plt
from keras.preprocessing.image import ImageDataGenerator
from keras.models import load_model
import numpy as np
import argparse
import pickle
parser = argparse.ArgumentParser()
parser.add... | 2.765625 | 3 |
src/ProjectScript.py | JacobSal/openSIM | 0 | 12771694 | <reponame>JacobSal/openSIM
#%% Imports
import opensim as osim
from opensim import Vec3
from os.path import join, abspath, dirname
from os import mkdir
import numpy as np
import matplotlib.pyplot as plt
#%% Path
global cfpath, omArm26Dir
cfpath = dirname(__file__)
prjPath = join(cfpath,'_data','final_project_saves')
mod... | 1.984375 | 2 |
configs/common/cpu2006.py | KuroeKurose/gem5 | 0 | 12771695 | import os
import m5
from m5.objects import *
m5.util.addToPath('../common')
spec_dist = os.environ.get('M5_CPU2006', '/dist/m5/cpu2006')
binary_dir = spec_dist
data_dir = binary_dir
current_pid = 100
# 400.perlbench
def perlbench():
process = Process(pid=current_pid)
process.cwd = binary_dir + '400.perlb... | 2.015625 | 2 |
Allfiles/Labs/01-preprocess-data/script/preprocess-rapids.py | madiepev/mslearn-deep-learning | 2 | 12771696 | # import libraries
import os
import argparse
import cudf
import mlflow
# define functions
def main():
# Set the columns and their datatypes for conversion and parsing
cols = ['Flight_Number_Reporting_Airline', 'Year', 'Quarter', 'Month', 'DayOfWeek', 'DOT_ID_Reporting_Airline', 'OriginCityMarketID', 'DestC... | 2.5625 | 3 |
Lab2_ALG/src/L2Q03.py | DanialAroff/WIA2005---Lab | 0 | 12771697 | <reponame>DanialAroff/WIA2005---Lab<filename>Lab2_ALG/src/L2Q03.py
# Runway Reservation System
import time
from BinarySearchTree import BST
R = [None] # set of landing request
t = 0
tree = BST()
print('Runway Reservation System\n')
while True:
tw = int(input('Input landing time request: '))
if tw < 0:
... | 2.96875 | 3 |
src/lib/Bcfg2/Server/Plugins/Cfg/CfgCatFilter.py | amplify-education/bcfg2 | 0 | 12771698 | <gh_stars>0
import logging
import Bcfg2.Server.Plugin
from Bcfg2.Server.Plugins.Cfg import CfgFilter
logger = logging.getLogger(__name__)
class CfgCatFilter(CfgFilter):
__extensions__ = ['cat']
def modify_data(self, entry, metadata, data):
datalines = data.strip().split('\n')
for line in self... | 2.640625 | 3 |
testingCentre/apps.py | p2titus/ContactTracing | 0 | 12771699 | from django.apps import AppConfig
class TestingCentreConfig(AppConfig):
name = 'testingCentre'
| 1.125 | 1 |
main.py | eth-sri/ACE | 6 | 12771700 | <reponame>eth-sri/ACE
import time
import json
import numpy as np
import os
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
from args_factory import get_args
from loaders import get_loaders
from utils import (get_net, Scheduler, Statistics, count_vars, wri... | 1.882813 | 2 |
tests/builtins/test_oct.py | Mariatta/voc | 1 | 12771701 | from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class OctTests(TranspileTestCase):
pass
class BuiltinOctFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["oct"]
not_implemented = [
'test_bytearray',
'test_bytes',
'test_class',
'test_... | 1.65625 | 2 |
Machine-Learning-in-Production/Includes/Drift-Monitoring-Setup.py | databricks-academy/ml-in-production | 14 | 12771702 | # Databricks notebook source
import numpy as np
import pandas as pd
from scipy import stats
# COMMAND ----------
# Simulate original ice cream dataset
df = pd.DataFrame()
df['temperature'] = np.random.uniform(60, 80, 1000)
df['number_of_cones_sold'] = np.random.uniform(0, 20, 1000)
flavors = ["Vanilla"] * 300 + ['... | 3.078125 | 3 |
api/accounts/base/serializers.py | klebed/esdc-ce | 97 | 12771703 | <reponame>klebed/esdc-ce<gh_stars>10-100
from api import serializers as s
from api.authtoken.serializers import AuthTokenSerializer
class APIAuthTokenSerializer(AuthTokenSerializer):
"""
Add some more validation into the AuthTokenSerializer.
"""
def validate(self, attrs):
attrs = super(APIAuth... | 2.421875 | 2 |
ch4/magic8.py | rfreiberger/Automate-the-Boring-Stuff | 0 | 12771704 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 14 22:11:14 2016
@author: Rob
"""
import random
messages = ['It is certain',
'It is decidedly so',
'Yes definitely',
'Reply hazy try again',
'Ask again later',
'Concentrate and ask again',
... | 3.53125 | 4 |
python/src/keras/resnet.py | d-ikeda-sakurasoft/deep-learning | 0 | 12771705 | <reponame>d-ikeda-sakurasoft/deep-learning
import numpy as np
import matplotlib.pylab as plt
from keras.datasets import *
from keras.utils import *
from keras.models import *
from keras.layers import *
#データ
(x_train, y_train),(x_test, y_test) = cifar100.load_data()
labels = np.max(y_train) + 1
x_train = x_train.astyp... | 2.890625 | 3 |
src/connectionWindow.py | insoPL/QtDraughts | 0 | 12771706 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLineEdit, QHBoxLayout, QPushButton, QProgressDialog
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtCore import pyqtSignal, Qt
from network import Server, Client
import logging
import socket
class Connectio... | 2.5625 | 3 |
logic/dimreduce/sax.py | CityPulse/KAT | 4 | 12771707 | from __future__ import division
__author__ = '<NAME>'
import numpy as np
from scipy.stats import norm
import string
import bottleneck as bn
import math
# paa tranformation, window = incoming data, string_length = length of outcoming data
class sax():
def process(self, window, output_length, sax_vocab):
sa... | 2.625 | 3 |
api/app/urls/address_url.py | LIttle-soul/LSOJ | 0 | 12771708 | from django.urls import path
from app.view.address_view import *
urlpatterns = [
path('synchronizeaddress/', SynchronizeAddress.as_view(), name='SynchronizeAddress'),
path('getprovince/', GetProvince.as_view(), name='GetProvince'),
path('getmunicipality/', GetMunicipality.as_view(), name='GetMunicipality')... | 1.804688 | 2 |
scripts/models/covidNet.py | anudeepsekhar/Lane-Detection-Pytorch | 1 | 12771709 | <filename>scripts/models/covidNet.py<gh_stars>1-10
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from models.layers import denseBlock2, convBlock, unetUp, outconv
class Net(nn.Module):
"""Some Information about Net"""
def __init__(self, in_channels=3, n_classes... | 2.5 | 2 |
leetcode/week_race/virtual_race/divide_array_in_consecutive_nums.py | BillionsRichard/pycharmWorkspace | 0 | 12771710 | <filename>leetcode/week_race/virtual_race/divide_array_in_consecutive_nums.py
# encoding: utf-8
"""
@version: v1.0
@author: Richard
@license: Apache Licence
@contact: <EMAIL>
@site:
@software: PyCharm
@time: 2019/12/22 23:14
"""
from typing import List
import heapq
class Solution:
def isPossibleDivide(self, nums... | 3.4375 | 3 |
modulos/thread_sync.py | ingprovencio/pyvisionapp | 0 | 12771711 | <filename>modulos/thread_sync.py
# Lint as: python3
# Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 2.484375 | 2 |
get_url/komand_get_url/actions/get_file/action.py | emartin-merrill-r7/insightconnect-plugins | 1 | 12771712 | import komand
from .schema import GetFileInput, GetFileOutput
# Custom imports below
from komand_get_url.util.utils import Utils
class GetFile(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='get_file',
description='Download a file by URL',
... | 2.1875 | 2 |
app/recipe/tests/test_recipe_api.py | DamienPond001/recipe-app-api | 0 | 12771713 | import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import ... | 2.484375 | 2 |
retrieval_rs/retrieval_rs/metric/rouge.py | microsoft/MRS | 2 | 12771714 | <filename>retrieval_rs/retrieval_rs/metric/rouge.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from retrieval_rs.metric import rouge_score as rouge_score
import sys
import os
SR_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, os.pardir))
sys.path.insert(0, SR_DIR)
class Rouge:
... | 2.46875 | 2 |
katrain.py | Kameone/katrain | 0 | 12771715 | from kivy.config import Config # isort:skip
Config.set("input", "mouse", "mouse,multitouch_on_demand") # isort:skip # no red dots on right click
ICON = "img/icon.png"
Config.set("kivy", "window_icon", ICON) # isort:skip # set icon before Window is imported
import signal
import os
import sys
import threading
impo... | 2.21875 | 2 |
app/api/cms/quota.py | yyywang/quota | 0 | 12771716 | <filename>app/api/cms/quota.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created by Wesley on 2020/3/23.
"""
from flask import current_app, jsonify
from lin import admin_required
from lin.exception import Success
from lin.redprint import Redprint
from app.libs.utils import json_paginate
from app.models.quota import Quot... | 1.992188 | 2 |
PythonDesafios/d075.py | adaatii/Python-Curso-em-Video- | 0 | 12771717 | <reponame>adaatii/Python-Curso-em-Video-
# Desenvolva um programa que leia quatro valores
# pelo teclado e guarde-os em uma tupla.
# No final, mostre:
# A) Quantas vezes apareceu o valor 9.
# B) Em que posição foi digitado o primeiro valor 3.
# C) Quais foram os números pares.
num = (int(input('Digite um numero: ')),
... | 4.40625 | 4 |
bumblebee_status/modules/contrib/playerctl.py | kongr45gpen/bumblebee-status | 0 | 12771718 | <filename>bumblebee_status/modules/contrib/playerctl.py
# pylint: disable=C0111,R0903
"""Displays information about the current song in vlc, audacious, bmp, xmms2, spotify and others
Requires the following executable:
* playerctl
Parameters:
* playerctl.format: Format string (defaults to '{artist} - {title... | 2.96875 | 3 |
tasks/test/__init__.py | remarkablerocket/changelog-cli | 16 | 12771719 | <reponame>remarkablerocket/changelog-cli
"""
Run Test Suite
"""
from invoke import task
@task
def test(context):
"""
Runs Test Suite
"""
context.run('coverage run -m unittest discover')
| 1.390625 | 1 |
pw_tokenizer/py/pw_tokenizer/decode.py | Tiggerlaboratoriet/pigweed | 1 | 12771720 | # Copyright 2020 The Pigweed Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 2.234375 | 2 |
mmtfPyspark/tests/datasets/test_dbPtmDataset.py | sbliven/mmtf-pyspark | 59 | 12771721 | #!/usr/bin/env python
import unittest
from pyspark.sql import SparkSession
from mmtfPyspark.datasets import dbPtmDataset as pm
from mmtfPyspark.datasets.dbPtmDataset import PtmType
class DbPtmDatasetTest(unittest.TestCase):
def setUp(self):
self.spark = SparkSession.builder.master("local[*]") \
... | 2.40625 | 2 |
skroute/metaheuristics/simulated_annealing/__init__.py | arubiales/scikit-route | 2 | 12771722 | from ._base_simulated_annealing._base_simulated_annealing import SimulatedAnnealing
from ._base_ensemble_simulated_annealing import EnsembleSimulatedAnnealing
__all__ = ['SimmulatedAnnealing', "EnsembleSimulatedAnnealing"]
| 0.976563 | 1 |
server/server/api/__init__.py | benetech/Winnow2.0 | 26 | 12771723 | # Disable flake8 issue F401 as we need these imports to configure api
# but not going to re-export them from the __init__
from . import ( # noqa: F401
scenes,
matches,
files,
errors,
videos,
cluster,
tasks,
socket,
templates,
examples,
template_matches,
file_filter_prese... | 1.296875 | 1 |
spintorch/exch.py | a-papp/SpinTorch | 1 | 12771724 | <gh_stars>1-10
"""Class to calculate the exchange field"""
from torch import nn, tensor
class Exchange(nn.Module):
A_exch = 3.65e-12 # exchange coefficient (J/m)
def __init__(self, d: tuple):
super().__init__()
# defining the LAPLACE convolution kernel for exchange field
... | 2.8125 | 3 |
src/lambda_process_doc.py | maximillianus/smart-document-check | 0 | 12771725 | <gh_stars>0
import json
import urllib.parse
import boto3
import base64
from pprint import pprint
import re
print('Loading function')
textractClient = boto3.client('textract')
s3 = boto3.client('s3')
DOCUMENT_TYPE_ENUM = {
'passport': 'PASSPORT',
'identity_card': 'IDENTITY_CARD',
'driving_license': 'DRIVE... | 2.328125 | 2 |
optimizedGPS/results_provider/pre_solver_stats.py | mickael-grima/optimizedGPS | 0 | 12771726 | <reponame>mickael-grima/optimizedGPS<gh_stars>0
from collections import defaultdict
from optimizedGPS.data.data_generator import generate_grid_data, generate_random_drivers
from optimizedGPS.problems.PreSolver import GlobalPreSolver
from optimizedGPS.problems.Solver import Solver
def get_percentage(part, total, trun... | 2.4375 | 2 |
hover/hover/core.py | DouglasOrr/Snippets | 0 | 12771727 | <reponame>DouglasOrr/Snippets
from __future__ import annotations
import collections
from contextlib import contextmanager
from dataclasses import dataclass
import functools as ft
import glob
import json
import itertools as it
import os
import time
import Box2D as B
import IPython.display
import matplotlib.pyplot as p... | 2.4375 | 2 |
wdwarfdate/Models/MIST/make_one_file.py | rkiman/wdwarfdate | 3 | 12771728 | import numpy as np
from astropy.table import Table
import glob
models = ['MIST_v1.2_feh_m4.00_afe_p0.0_vvcrit0.0_EEPS',
'MIST_v1.2_feh_m4.00_afe_p0.0_vvcrit0.4_EEPS',
'MIST_v1.2_feh_p0.00_afe_p0.0_vvcrit0.0_EEPS',
'MIST_v1.2... | 2.078125 | 2 |
main/migrations/0010_auto_20180317_1440.py | hectdev/python_sh | 4 | 12771729 | <reponame>hectdev/python_sh
# Generated by Django 2.0.1 on 2018-03-17 14:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0009_auto_20180317_1434'),
]
operations = [
migrations.AlterField(
model_name='log',
... | 1.828125 | 2 |
Misc_plots.py | lens-corp/auto-plot | 0 | 12771730 |
import json
import csv
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import itertools
import os
import shutil
def get_dtype_groups(data_types):
float_unis = []
object_unis = []
int_unis = []
for i, v in data_types.items():
if i == np.dtype('float... | 2.296875 | 2 |
dlpy/applications/densenet.py | arharvey918/python-dlpy | 1 | 12771731 | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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... | 2.234375 | 2 |
pyraft/test_client.py | yashrsharma44/pyraft | 0 | 12771732 | <reponame>yashrsharma44/pyraft<filename>pyraft/test_client.py
from json import encoder
from collections import defaultdict
from pyraft.client import NodeClient
import unittest
import uuid
import asyncio
import logging
import json
import multiprocessing
DELIMITER = "$"
def runner(coro):
asyncio.run(coro())
cla... | 2.375 | 2 |
open_world/data.py | khalilbalaree/OWE-sBert | 0 | 12771733 | <reponame>khalilbalaree/OWE-sBert<gh_stars>0
import pickle
import os
from tqdm import tqdm
import numpy as np
from sentence_transformers import SentenceTransformer
# from name_entity_recognition import spacy_filter
def load_model(model='transe'):
if model == 'transe':
with open('./openke_models/transe300/... | 2.375 | 2 |
plugins/tff_backend/tff_backend_plugin.py | threefoldfoundation/app_backend | 0 | 12771734 | <reponame>threefoldfoundation/app_backend
# -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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/LIC... | 0.867188 | 1 |
section4/scikit_learn_pipeline/predict.py | Jeffresh/deployment-of-machine-learning-models | 0 | 12771735 | <reponame>Jeffresh/deployment-of-machine-learning-models<filename>section4/scikit_learn_pipeline/predict.py
import pandas as pd
import joblib
import config
def make_prediction(input_data):
_pipe_price = joblib.load(filename=config.PIPELINE_NAME)
results = _pipe_price.predict(input_data)
return results... | 3.1875 | 3 |
showminder/showminder/settings.py | chassing/showminder | 1 | 12771736 | <gh_stars>1-10
from pathlib import Path
import environ
env = environ.Env(DEBUG=(bool, False))
env.read_env()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangopro... | 1.953125 | 2 |
flask_value_checker/restrictions/rtypes/file.py | therealadityashankar/flask-value-checker | 1 | 12771737 | from ..generic_restriction import GenericRestriction
from flask import request
class FileRestriction(GenericRestriction):
type_keyword = "file"
attributes = {
"optional": {},
"number": {"parameters": [{"type": int}]},
}
def __init_restriction__(self):
self.optional = False
... | 2.78125 | 3 |
SeqGAN/seqgan_train.py | rickyHong/GANs-Repository-repl | 3 | 12771738 | <reponame>rickyHong/GANs-Repository-repl
# initial python file
| 0.742188 | 1 |
tools/plot/PlotHelper.py | shenweihai1/veribetrkv-linear | 0 | 12771739 | #!/usr/bin/env python3
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import numpy as np
import sys
import operator
import bisect
import os
class Scale:
def __init__(self, prefix, mult):
self.prefix = prefix
self.mult = float(mult)
def __call__(self... | 2.734375 | 3 |
include/createMap.py | sahibdhanjal/DeepLocNet | 27 | 12771740 | <reponame>sahibdhanjal/DeepLocNet<gh_stars>10-100
import numpy as np
from pylayers.gis.layout import Layout
from pylayers.antprop.coverage import *
from pylayers.simul.link import *
from mayavi import mlab
from pdb import set_trace as bp
from math import sqrt, floor, ceil
import matplotlib.pyplot as plt
from mpl_toolki... | 2.609375 | 3 |
03_LearnDSP-Python/Sec05_ExtendDFT/case03_InterpolateDFT.py | iChunyu/signal-process-demo | 15 | 12771741 | <gh_stars>10-100
'''
Interpolate DFT to correct frequency/amplitude/phase
Take a cosine wave for example
XiaoCY 2021-02-23
'''
#%%
import numpy as np
import matplotlib.pyplot as plt
fs = 1000
N = 2000
t = np.arange(N)/fs
ax = 3.0
fx = 12.3
px = 0.5
x = ax*np.cos(2*np.pi*fx*t+px)
#%% uncorrect DFT
X = np.fft.fft(x,... | 2.671875 | 3 |
imle_tf.py | MoustafaMeshry/StEP | 4 | 12771742 | <filename>imle_tf.py
"""
Implentation of the noise-to-latent mapping approach used in the
"Non-Adversarial Image Synthesis wit Generative Latent Nearest Neighbors" paper,
which can be found at https://arxiv.org/abs/1812.08985.
"""
import collections
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as p... | 2.765625 | 3 |
6. sorting_algorithms/heap_sort.py | sourcery-ai-bot/udacity-datastructures-algorithms | 3 | 12771743 | from typing import List
def heapify(arr: List[int], n: int, i: int):
# Using i as the index of the current node, find the 2 child nodes
# (if the array were a binary tree)
# and find the largest value.
# If one of the children is larger swap the values and recurse into that subtree
# consider... | 4 | 4 |
artworks/admin.py | mnosinov/artworks_project | 0 | 12771744 | from django.contrib import admin
from .models import Author, Genre, Artwork, Painting, Book, Media
class AuthorAdmin(admin.ModelAdmin):
list_display = ('id', 'name', )
list_display_links = ('id', 'name', )
search_fields = ('name', )
class GenreAdmin(admin.ModelAdmin):
list_display = ('id', 'title',... | 1.960938 | 2 |
security/logging/requests/utils.py | druids/django-security | 9 | 12771745 | import re
import json
from urllib.parse import parse_qs, urlparse
from json import JSONDecodeError
from django.template.defaultfilters import truncatechars
from django.utils.encoding import force_text
from security.config import settings
from security.utils import remove_nul_from_string
def is_base_collection(v):... | 2.296875 | 2 |
SimG4CMS/HGCalTestBeam/python/hgcalTBMBAnalyzerCERN_cfi.py | PKUfudawei/cmssw | 2 | 12771746 | import FWCore.ParameterSet.Config as cms
from SimG4CMS.HGCalTestBeam.hgcalTBMBAnalyzer_cfi import *
hgcalTBMBAnalyzerCERN = hgcalTBMBAnalyzer.clone()
| 1.109375 | 1 |
examples/pbc/22-k_points_mp2_stagger.py | xinxing02/pyscf | 0 | 12771747 | #!/usr/bin/env python
'''
Example code for
k-point spin-restricted periodic MP2 calculation using the staggered mesh method
Author: <NAME> (<EMAIL>)
Reference: Staggered Mesh Method for Correlation Energy Calculations of Solids: Second-Order
Møller–Plesset Perturbation Theory, J. Chem. Theory Comput. 2021, 17,... | 2.328125 | 2 |
defender/middleware.py | Korred/django-defender | 1 | 12771748 | try:
from django.utils.deprecation import MiddlewareMixin as MIDDLEWARE_BASE_CLASS
except ImportError:
MIDDLEWARE_BASE_CLASS = object
from django.contrib.auth import views as auth_views
from django.utils.decorators import method_decorator
from .decorators import watch_login
class FailedLoginMiddleware(MIDDLE... | 2.15625 | 2 |
mmf/datasets/processors/video_processors.py | dk25021999/mmf | 1,928 | 12771749 | # Copyright (c) Facebook, Inc. and its affiliates.
# TODO: Once internal torchvision transforms become stable either in torchvision
# or in pytorchvideo, move to use those transforms.
import random
import mmf.datasets.processors.functional as F
import torch
from mmf.common.registry import registry
from mmf.datasets.p... | 2.25 | 2 |
util/langUtil.py | herougan/TradeHunter | 0 | 12771750 | import math
import os
from datetime import timedelta, datetime
import unicodedata
from typing import List
import re
import pandas as pd
from dateutil import parser
# timedelta/datetime
def strtotimedelta(s: str):
"""XM X minutes, XH X hours, Xd X days, Xw X weeks, Xm X months, all separated by a space"""
t... | 3.125 | 3 |