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 |
|---|---|---|---|---|---|---|
validator/setup.py | acmiyaguchi/mozschema-validator | 0 | 45900 | <filename>validator/setup.py
#!/usr/bin/env python
# encoding: utf-8
from setuptools import setup
setup(
name='validator',
version='0.1.0',
author='<NAME>',
author_email='<EMAIL>',
description='Spark schema validation job',
url='https://github.com/acmiyaguchi/schema-validator',
install_req... | 1.257813 | 1 |
pythia/opal/weaver/BodyMill.py | willic3/pythia | 1 | 45901 | <filename>pythia/opal/weaver/BodyMill.py
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <NAME>
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#... | 2.28125 | 2 |
BuildLex/LexiconBase.py | viitormiiguel/AnalysisFinancial | 0 | 45902 | import sys
import codecs
import nltk
from nltk.corpus import stopwords
from nltk import pos_tag, word_tokenize
import csv
import datetime
from collections import Counter
import re
now = datetime.datetime.now()
today = now.strftime("%Y-%m-%d")
dTrading = 'C:/Users/vitor/Documents/GetDataset/TradingView/'... | 3.078125 | 3 |
kay/generics/__init__.py | Letractively/kay-framework | 1 | 45903 | # -*- coding: utf-8 -*-
"""
Kay generics.
:Copyright: (c) 2009 <NAME> <<EMAIL>> All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from kay.exceptions import NotAuthorized
OP_LIST = 'list'
OP_SHOW = 'show'
OP_CREATE = 'create'
OP_UPDATE = 'update'
OP_DELETE = 'delete'
# presets for authorization... | 2.234375 | 2 |
main.py | engelke/google-signin-demo | 3 | 45904 | #
# This is a minimal server-side web application that authenticates visitors
# using Google Sign-in.
#
# See the README.md and LICENSE.md files for the purpose of this code.
#
# ENVIRONMENT VARIABLES YOU MUST SET
#
# The following values must be provided in environment variables for Google
# Sign-in to work.
#
# The... | 2.84375 | 3 |
examples/sum_sum_plus_one_lt.py | uta8a/Jikka | 139 | 45905 | # https://judge.kimiyuki.net/problem/sum-sum-plus-one-lt
from typing import *
def solve(a: List[int]) -> int:
n = len(a)
ans = 0
for i in range(n):
for j in range(i + 1, n):
ans += a[i] - a[j]
return ans
def main() -> None:
n = int(input())
a = list(map(int, input().split... | 3.25 | 3 |
tests/mocks.py | Mahir-Sparkess/django-haystack-elasticsearch | 25 | 45906 | <filename>tests/mocks.py
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django.apps import apps
from haystack.models import SearchResult
class MockSearchResult(SearchResult):
def __init__(self, app_label, model_name, pk, score, **kwargs):
super(... | 2.1875 | 2 |
Codewars/HighestScoringWord.py | SelvorWhim/competitive | 0 | 45907 | oa = ord('a')
def word_score(word):
return sum((ord(letter) - oa + 1) for letter in word)
def high(s):
print(s)
return max(s.split(), key=word_score)
| 3.640625 | 4 |
src/utils/boolmask.py | r39ashmi/LastMileRoutingResearchChallenge | 0 | 45908 | import torch
def _mask_long2byte(mask, n=None):
if n is None:
n = 8 * mask.size(-1)
return (mask[..., None] >> (torch.arange(8, out=mask.new()) * 8))[..., :n].to(torch.uint8).view(*mask.size()[:-1], -1)[..., :n]
def _mask_byte2bool(mask, n=None):
if n is None:
n = 8 * mask.size(-1)
r... | 2.703125 | 3 |
w20data.py | zhuligs/Pallas | 0 | 45909 | <reponame>zhuligs/Pallas
import fppy
class Wstorage(object):
def __init__(self, ediff=0.001, fpdiff=0.001,
ntyp=None):
self.minima = []
self.saddle = []
self.ediff = float(ediff)
self.fpdiff = float(fpdiff)
self.ntyp = ntyp
# self.types = types
... | 2.3125 | 2 |
tests/script/tavern_chars.py | ufosc/MuddySwamp | 10 | 45910 | <filename>tests/script/tavern_chars.py<gh_stars>1-10
"""a few CharacterClasses for testing the 'find' method
(see save 'tavern.yaml')"""
from swampymud.character import Character
class Humanoid(Character):
"""a base class for all other classes in this group"""
class Merchant(Humanoid):
"""good with coin (espe... | 2.0625 | 2 |
iptfe/blog/urls.py | I-prefer-the-front-end/I-prefer-the-front-end | 0 | 45911 | from django.conf.urls import url
from blog import views
urlpatterns = [
url(r'^archive/$', views.archive, name='archive'),
url(r'^comment/$', views.comment, name='comment'),
url(r'^(?P<slug>[A-Za-z0-9_\-.]+)?/?$', views.post, name='post'),
]
| 1.71875 | 2 |
gui/qt_ui/OptimizationQT.py | victorgabr/pps | 7 | 45912 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Users\Victor\Dropbox\DFR\film2dose\qt_ui\evo_widget.ui'
#
# Created: Tue Sep 29 14:54:23 2015
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
... | 1.875 | 2 |
bin_env/MapperData.py | ArChiiii/TSP_DRL_PtrNet | 0 | 45913 | <reponame>ArChiiii/TSP_DRL_PtrNet
from dataclasses import dataclass
from typing import List
from enum import Enum
class IterationResult(Enum):
Success = 1
Failure = 2
BiggerThanBestContainer = 3
SmallerThanCombinedImages = 4
@dataclass
class ContainerStats():
rectangleAddAttempts: int
nbr... | 2.25 | 2 |
apps/cursos/urls.py | ravellys/drf-geek-university | 0 | 45914 | from django.urls import path
from rest_framework.routers import SimpleRouter
from apps.cursos.api.views_genericsview import CursoAPIView, CursosAPIView, AvaliacaoAPIView, AvaliacoesAPIView
from apps.cursos.api.viewsets import CursoViewSet, AvaliacaoViewSet
router = SimpleRouter()
router.register('cursos', CursoViewS... | 1.945313 | 2 |
jrdb/models/managers.py | hankehly/JRDB | 1 | 45915 | import pandas as pd
from django.db import models
from django.db.models.query import ModelIterable
class DataFrameQuerySet(models.QuerySet):
def to_dataframe(self):
records = (
self.values() if issubclass(self._iterable_class, ModelIterable) else self
)
return pd.DataFrame.from_... | 2.484375 | 2 |
scripts/variability_study_run.py | cshunk/covidsim | 0 | 45916 | """
Runs the susceptibility variability study.
Modify the params variable to set the parameters of the study.
Parameters:
pInfect: Rate of infection
pRemove: Rate of removal
pInfected: Starting percent of population that is infected
population: Approximate popul... | 2.984375 | 3 |
hpo/helpers.py | ekremozturk/ZAP-few-shot | 0 | 45917 | import json
import torch
import torch.nn as nn
import numpy as np
import torchvision
from torchvision import models, transforms
import ConfigSpace as CS
import ConfigSpace.hyperparameters as CSH
from efficientnet_pytorch import EfficientNet
from PIL import Image
from trivialaugment import aug_lib
np.random.seed(42)
to... | 2.265625 | 2 |
doc/examples/example04.py | vinceatbluelabs/config_resolver | 1 | 45918 | from config_resolver import get_config
cfg = get_config("bird_feeder", "acmecorp")
print(cfg.meta)
| 1.554688 | 2 |
src/build_test_xll.py | thatcr/cffi-xll | 0 | 45919 | <filename>src/build_test_xll.py
from cffi import FFI
from pathlib import Path
sdk_dir = (Path(__file__).parent / '..' / 'ExcelXllSdk' ).resolve()
ffi = FFI()
# note need cffi 1.5.1 in order to support __stdcall
ffi.embedding_api(r'''
extern int __stdcall xlAutoOpen(void);
extern int __stdcall xlAutoClose(... | 1.859375 | 2 |
src/third_party/v8/js2c-wrap.py | morsvolia/mongo | 324 | 45920 | <filename>src/third_party/v8/js2c-wrap.py
#!/usr/bin/python2
import sys
js2c_dir = sys.argv[1]
sys.path.append(js2c_dir)
import js2c
srcs = sys.argv[2]
natives = sys.argv[3].split(',')
type = sys.argv[4]
compression = sys.argv[5]
js2c.JS2C(natives, [srcs], {'TYPE': type, 'COMPRESSION': compression})
| 1.804688 | 2 |
starfish/core/morphology/Filter/map.py | haoxusci/starfish | 164 | 45921 | <gh_stars>100-1000
import warnings
from typing import Optional, Union
from starfish.core.morphology.binary_mask import BinaryMaskCollection
from starfish.core.types import FunctionSource, FunctionSourceBundle
from ._base import FilterAlgorithm
class Map(FilterAlgorithm):
"""
Map from input to output by apply... | 2.421875 | 2 |
aula2/exercicio1.py | ArseniumGX/bluemer-modulo1-python | 0 | 45922 | """ 01
E os 10% do garçom?**
Defina uma variável para o valor de uma refeição que custou R$ 42,54;
Defina uma variável para o valor da taxa de serviço que é de 10%;
Defina uma variável que calcula o valor total da conta e exiba-o no console com essa
formatação: R$ XXXX.XX.
"""
valor = 42.5... | 3.34375 | 3 |
CAAPR/CAAPR_AstroMagic/PTS/pts/do/modeling/seba/check_heating.py | wdobbels/CAAPR | 7 | 45923 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# ******************************************************... | 2.203125 | 2 |
Clock/PyQtPiClock.py | tonymorris/PiClock | 2 | 45924 | # -*- coding: utf-8 -*- # NOQA
import sys
import os
import platform
import signal
import datetime
import time
import json
import locale
import random
import re
from PyQt4 import QtGui, QtCore, QtNetwork
from PyQt4.QtGui import QPixmap, QMovie, QBrush, QColor, QPainter
from PyQt4.QtCore import QUrl
fro... | 2.34375 | 2 |
Datasets/paddy_millet_data.py | kabbas570/CED-Net-Crops-and-Weeds-Segmentation-for-Smart-Farming-Using | 0 | 45925 | <reponame>kabbas570/CED-Net-Crops-and-Weeds-Segmentation-for-Smart-Farming-Using<gh_stars>0
import cv2
import glob
import numpy as np
import matplotlib.pyplot as plt
mask_id = []
for infile in sorted(glob.glob('/home/user01/data_ssd/Abbas/PAPER/Datasets/Paddy_Millet/train/masks/*.png')): # path to masks of train data... | 2.4375 | 2 |
procyclist/dataset.py | vigosan/procyclist_performance | 11 | 45926 | <filename>procyclist/dataset.py
import configparser
import glob
import inspect
import hashlib
import os
import numpy as np
from procyclist.sessions import Sessions
from procyclist.utilities import resample
def load():
# Use hash of this function to determine if dataset should be recreated
current_source = i... | 2.25 | 2 |
src/sasctl/utils/pyml2ds/connectors/ensembles/__init__.py | jameskochubasas/python-sasctl | 30 | 45927 | <reponame>jameskochubasas/python-sasctl
from .xgb import XgbParser
from .lgb import LightgbmParser
from .pmml import PmmlParser | 1.078125 | 1 |
gene_grouper.py | kpj/DictyPy | 0 | 45928 | <reponame>kpj/DictyPy
import collections, json
class GeneGrouper(object):
def __init__(self, Classifier):
self.classifier = Classifier()
for f in self.classifier.skip_filter: f.skip = True
def group(self, record_list):
""" Group genes according to their annotation
'gene_di... | 3.171875 | 3 |
client/modules/face_recognizer/loading_bar.py | m0re4u/SmartLight- | 0 | 45929 | # -*- coding: utf-8 -*-
import sys
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1,
bar_length=100):
"""
Call in a loop to create terminal progress bar
"""
str_format = "{0:." + str(decimals) + "f}"
percents = str_format.format(... | 3.484375 | 3 |
src/hub/dataload/uploader.py | erikyao/myvariant.info | 39 | 45930 | <gh_stars>10-100
import glob, os, math, asyncio
from functools import partial
import biothings.hub.dataload.uploader as uploader
from biothings.hub.dataload.storage import UpsertStorage
from biothings.utils.mongo import doc_feeder, id_feeder
import biothings.utils.mongo as mongo
from biothings.utils.common import iter... | 1.882813 | 2 |
invenio_records_resources/services/records/params/__init__.py | jrcastro2/invenio-records-resources | 0 | 45931 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Search parameter interpreter API."""
from .base import ParamInterpreter
from .facets import Facets... | 1.4375 | 1 |
tests/actions/action_config_validator_test.py | mcunha/forseti-security | 0 | 45932 | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 2.203125 | 2 |
PublisherAzureTestsResults/variables.py | ismailktami/robotframework-azuretestplans-results | 1 | 45933 | from robot.libraries.BuiltIn import BuiltIn
import json
class VariablesBuiltIn:
@staticmethod
def getVariables():
USERNAME = BuiltIn().get_variable_value("${USERNAME}") or "USERNAME"
ENVIRONNEMENT = BuiltIn().get_variable_value("${ENVIRONNEMENT}") or "ENVIRONNEMENT"
JOB_ID = BuiltIn().... | 2.796875 | 3 |
run.py | NeeharikaESai/NSP | 0 | 45934 | import os
os.system("python manage.py runserver")
| 1.1875 | 1 |
floodviz/linked_data_utils.py | USGS-VIZLAB/active-flood-viz | 3 | 45935 | from datetime import date
class LinkedData:
"""
Generates JSON-LD based on gages and the flood event.
"""
def __init__(self):
self.ld = self._blank_thing("WebSite")
self.ld.update({
"name": "Active flood visualization placeholder name",
"datePublished": str(date... | 3.125 | 3 |
aib/init/tables/adm_tax_cats.py | FrankMillman/AccInABox | 3 | 45936 | <reponame>FrankMillman/AccInABox
# table definition
table = {
'table_name' : 'adm_tax_cats',
'module_id' : 'adm',
'short_descr' : 'Sales tax categories',
'long_descr' : 'Sales tax categories',
'sub_types' : None,
'sub_trans' : None,
'sequence' : ['seq', [], None],
... | 2.015625 | 2 |
account/views.py | shrimp509/django_message_board | 1 | 45937 | <filename>account/views.py
from django.shortcuts import render
# no views but api
| 1.25 | 1 |
TagListsAndScripts/parse_sentences.py | ciminilab/2021_Jamali_submitted | 1 | 45938 | <filename>TagListsAndScripts/parse_sentences.py
import csv
to_be_removed_chars = ['"', "(", ")", "]", "[", ",", ";", "\n", "."]
to_be_removed_letters = ["and", "or", "add", "of", "in", "analysis", "with", "to", "a", "from", "are", "is", "as",
"that", "i", "at"]
fname = "WishHadBetterSolutions... | 3.203125 | 3 |
genderdecoder/__init__.py | sagahansson/genderdecoder | 0 | 45939 | <gh_stars>0
import sys
import os
current_dir = os.getcwd()
sys.path.append(current_dir + "/genderdecoder/genderdecoder")
from assess import assess, assess_v2, assess_v3
from wordlists import feminine_coded_words
from wordlists import masculine_coded_words
| 1.726563 | 2 |
tests/app/test_argument_actions.py | pyapp-org/pyapp | 5 | 45940 | from argparse import ArgumentError
from argparse import ArgumentParser
from argparse import Namespace
from enum import Enum
import pytest
from pyapp.app import argument_actions
class TestKeyValueAction:
def test_init__default_values(self):
target = argument_actions.KeyValueAction(
option_str... | 2.71875 | 3 |
src/prodstats/cq/__init__.py | la-mar/prodstats | 0 | 45941 | <gh_stars>0
# flake8: noqa
import functools
import logging
from celery.schedules import crontab
import config as conf
import cq.signals
import cq.tasks as tasks
import db
import loggers
from const import HoleDirection, IHSPath
from cq.worker import celery_app
logger = logging.getLogger(__name__)
@celery_app.on_aft... | 1.976563 | 2 |
ruclip/__init__.py | AlexWortega/ru-clip | 1 | 45942 | <reponame>AlexWortega/ru-clip
# -*- coding: utf-8 -*-
import os
from huggingface_hub import hf_hub_url, cached_download
from . import model, processor, predictor
from .model import CLIP
from .processor import RuCLIPProcessor
from .predictor import Predictor
MODELS = {
'ruclip-vit-base-patch32-224': dict(
... | 1.679688 | 2 |
Utility/Torch/Models/Supertransformer/StorageTools.py | smithblack-0/Utility | 0 | 45943 | """
Storing tensors such that torchscript can work with them can be
quite a pain. This set of tools makes it a lot easier. Tensors
are stored by placing them in the initialization region, and become
something that can then be accessed by looking at
.stored
"""
from __future__ import annotations
from typing import ... | 2.96875 | 3 |
zprime_search/python/Systematics.py | cdragoiu/particle_physics | 0 | 45944 | <reponame>cdragoiu/particle_physics
import math, ROOT, sys
from PlotStyle import *
# estimate systematics -----------------------------------------------------------------------------
def GetSys(basePath, baseRunType, sysPath, sysRunType, N, ybin):
if 'ele' in baseRunType:
data = 'DoubleElectron'
elif ... | 2.078125 | 2 |
userprofile/models.py | hyywestwood/web | 0 | 45945 | from django.db import models
from django.contrib.auth.models import User
# 处理图片
from PIL import Image
# 引入内置信号
# from django.db.models.signals import post_save
# 引入信号接收器的装饰器
# from django.dispatch import receiver
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFit
# 用户扩展信息
cla... | 2.140625 | 2 |
scripts/factors.py | prathimacode-hub/python-scripts-bible | 0 | 45946 | <filename>scripts/factors.py<gh_stars>0
# Script Name : factors.py
# Author : <NAME>
# Created : 20th May 2017
# Description : Find the number from its factors.
import math
print('The factors of the number you type when prompted will be displayed')
a = int(input('Type now // '))
b = 1
while b <= math.sqrt(a):
... | 4.125 | 4 |
src/api/urls.py | rjuppa/onepip | 0 | 45947 | from django.conf.urls import url, include
from rest_framework import routers
from . import views
# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
urlpatterns = [
url(r'^prices/(?P<mid>[0-9]+)/$', views.PriceLis... | 2.03125 | 2 |
whitenoise/management/commands/runfixtures.py | vsgiri/white-noise | 4 | 45948 | <reponame>vsgiri/white-noise
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCOmmand):
help = 'Run white-noise fixtures'
def add_arguments(self, parser):
pass
def handle(self, *args, **options):
pass
| 1.703125 | 2 |
zendesk_jira_migrator/main.py | adrianbeloqui/zendesk_jira_migrator | 0 | 45949 | <reponame>adrianbeloqui/zendesk_jira_migrator
from .migrator import Migrator
def run_migration(migrator: Migrator):
migrator.migrate()
def run_migrated_tickets_update(migrator: Migrator):
migrator.update_migrated_tickets()
def start():
migrator = Migrator()
while True:
print("Enter an acti... | 2.328125 | 2 |
ejercicios/sum_negative.py | carlosviveros/Soluciones | 4 | 45950 | <filename>ejercicios/sum_negative.py
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython
Given a list of numbers, stop processing input after the cumulative sum
of all the input becomes negative.
Input format: A list of integers to be processed
Constrains: All numbers input are integers between -1000 and 10... | 3.796875 | 4 |
logiq/src/Qmath.py | Bnz-0/logiq | 1 | 45951 | <filename>logiq/src/Qmath.py
from random import random, sample
from .Qerrors import DimensionError, GenericLogiqError, InitializationError
from .qtils import equal, isScalar, math, mod_square, np
#### Qmath.py
#
# This file contains 2 classes that wrap the numpy.matrix class: the vector and the matrix class,
# it co... | 2.8125 | 3 |
mindspore/ops/operations/inner_ops.py | taroxd/mindspore | 55 | 45952 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 2.53125 | 3 |
networks/marketing_prj/kr/main.py | artemkush1/neuro | 1 | 45953 | import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_error as mae
import matplotlib.pyplot as plt
import pandas as pd
import csv
df = pd.read_csv('vgsales.csv')
print(df.head())
y = df['Global_Sales']
df =... | 3.125 | 3 |
utils/filter_data.py | tinvukhac/learned-spatial-join | 6 | 45954 | from itertools import combinations
def item_in_string(g, str):
for item in g:
if item in str:
return True
return False
def main():
print ('Filter data')
distributions = ['uniform', 'diagonal', 'gauss', 'parcel', 'bit']
for r in range(1, len(distributions) + 1):
grou... | 3.328125 | 3 |
multi-layer-polar-cython/cython/test.py | MaverickPeter/DiSCO-pytorch | 41 | 45955 | import gputransform
import numpy as np
import numpy.testing as npt
import time
import os
import numpy.testing as npt
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# load test point cloud util
def load_pc_file(filename):
# returns Nx3 matrix
pc = np.fromfile(os.path.join("./", filename... | 2.421875 | 2 |
djfw/pagination/middleware.py | kozzztik/tulius | 1 | 45956 | import asyncio
def get_page(self):
"""
A function which will be monkeypatched onto the request to get the current
integer representing the current page.
"""
try:
if self.POST:
p = self.POST['page']
else:
p = self.GET['page']
if p == 'last':
... | 3.3125 | 3 |
tasks.py | Lucaweihs/ai2thor | 1 | 45957 | import os
import datetime
import zipfile
import threading
import hashlib
import shutil
import subprocess
import pprint
from invoke import task
import boto3
S3_BUCKET = 'ai2-thor'
UNITY_VERSION = '2018.3.6f1'
def add_files(zipf, start_dir):
for root, dirs, files in os.walk(start_dir):
for f in files:
... | 2.1875 | 2 |
treap/treap_test.py | Monras/Treap | 0 | 45958 | #Test code to treap.py
from treap import *
def test():
"""test code to treap.py"""
treap = Treap()
treap.add("A", 2)
treap.add("B", 123)
treap.add("C", 23)
treap.add("D", "T")
all = treap.get_all()
assert treap.size() == 4
assert treap.search("A") == all[0]
assert treap.get_min(... | 3.296875 | 3 |
eteach/com/pybsoft/eteach/regression/mvlinear.py | juanmr82/e-teach | 0 | 45959 | '''
Created on Aug 10, 2018
@author: <NAME>
@contact: <EMAIL>
This module uses tensorflow on a dataset to implement a multivarian linear regression.
The following input arguments are needed and for practical purposes, in CSV format
and only float values
1. File name. Must be specified with -i
2. Colum... | 3.4375 | 3 |
l0bnb/_third_party.py | rahulmaz/L0BnB | 1 | 45960 | import sys
import numpy as np
def l0gurobi(x, y, l0, l2, m, lb, ub, relaxed=True):
try:
from gurobipy import Model, GRB, QuadExpr, LinExpr
except ModuleNotFoundError:
raise Exception('Gurobi is not installed')
model = Model() # the optimization model
n = x.shape[0] # number of sampl... | 2.28125 | 2 |
Kattis/joinstrings.py | MilladMuhammadi/Competitive-Programming | 0 | 45961 | <filename>Kattis/joinstrings.py
li = []
nli = []
n = int(input())
for i in range(n):
li.append(input())
nli.append([i])
a=0
#print(nli)
for i in range(n-1):
a,b = map(int,input().split())
a-=1
b-=1
nli[a]+=nli[b]
nli[b] = []
res = ""
for i in range(n):
print(li[nli[a][i]],sep='',end='') | 3.21875 | 3 |
Sleep_stage_classifier/score_newpatient.py | bdh-team-12/sleep-predictions-through-deep-learning | 7 | 45962 | <filename>Sleep_stage_classifier/score_newpatient.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 21 23:01:59 2019
@author: CRNZ
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 21 21:24:21 2019
@author: CRNZ
"""
import numpy as np
import pandas as pd
import scipy.signal as ssignal... | 2.546875 | 3 |
tools/bibliotheca_account_headers.py | dentes-purgo/opacclient | 120 | 45963 | <reponame>dentes-purgo/opacclient<filename>tools/bibliotheca_account_headers.py
#!/usr/bin/python3
# Searches for Bibliotheca libraries in the assets/bibs/ directory and tries if they have a w3oini.txt configuration to
# find out what the headers in their account view are called.
import json
import os
import configpars... | 2.34375 | 2 |
alembic/versions/e43177bfe90b_nbgrader_schema.py | EvgenyTsydenov/python_course | 4 | 45964 | """nbgrader_schema
Revision ID: <KEY>
Revises:
Create Date: 2021-09-11 04:07:31.804665+00:00
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass
| 0.785156 | 1 |
blockbuster_clone/store/migrations/0001_initial.py | alexche77/blockbuster-api-clone | 0 | 45965 | # Generated by Django 3.1.8 on 2021-04-13 07:02
from decimal import Decimal
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 1.859375 | 2 |
src/sage/sat/solvers/__init__.py | switzel/sage | 5 | 45966 | from satsolver import SatSolver
from dimacs import Glucose, RSat
try:
from cryptominisat import CryptoMiniSat
except ImportError:
pass
| 1.039063 | 1 |
ipregistry/request.py | sebspion/ipregistry-python | 7 | 45967 | <gh_stars>1-10
"""
Copyright 2019 Ipregistry (https://ipregistry.co).
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 ... | 1.976563 | 2 |
utils/anchor_utils.py | ZCHILLAXY/FDFN-3D-SOT | 0 | 45968 | import numpy as np
import torch
from pyquaternion import Quaternion
from utils.data_classes import Box
def anchor_to_standup_box2d(anchors):
# (N, 4) -> (N, 4); x,y,w,l -> x1,y1,x2,y2
anchor_standup = np.zeros_like(anchors)
# r == 0
anchor_standup[::2, 0] = anchors[::2, 0] - anchors[::2, 3] / 2
a... | 2.296875 | 2 |
moto/events/__init__.py | gvlproject/moto | 2 | 45969 | <filename>moto/events/__init__.py
from __future__ import unicode_literals
from .models import events_backend
events_backends = {"global": events_backend}
mock_events = events_backend.decorator
| 1.453125 | 1 |
python/ns/tests/TestFlipInputs.py | redpawfx/massiveImporter | 2 | 45970 | <filename>python/ns/tests/TestFlipInputs.py
# The MIT License
#
# Copyright (c) 2008 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without li... | 2.0625 | 2 |
nales/commands/base_commands.py | Jojain/Nales | 5 | 45971 | <gh_stars>1-10
from typing import TYPE_CHECKING, Any
from PyQt5.QtCore import QModelIndex
from PyQt5.QtWidgets import QUndoCommand
from nales.NDS.interfaces import NOperation, NPart, NShape
if TYPE_CHECKING:
from nales.NDS.model import NModel
class BaseCommand(QUndoCommand):
def __init__(self):
sup... | 2.3125 | 2 |
TestA.py | RajeshMIT/JobScraping | 0 | 45972 | a = [1,2,3
2,4,5]
print(a)
b = a[-1:] | 3.4375 | 3 |
examples/timing.py | tahmid-choyon/capslock | 8 | 45973 | <reponame>tahmid-choyon/capslock
from capslock import timing
@timing
def say_hello():
print("Hello World")
if __name__ == '__main__':
say_hello() | 1.976563 | 2 |
reverse_api_call.py | ericpanyc/INFO550_Project | 0 | 45974 | import requests
import xml.etree.ElementTree as ET
import urllib.request, urllib.parse, urllib.error
import json
import ssl
import sys
import re
import getopt
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
lon = str(37.7812808)
lat = str(-122.4152363)
url = "https://no... | 2.84375 | 3 |
Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch06_arrays/ex09_sudoku_checker_test.py | Kreijeck/learning | 0 | 45975 | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by <NAME>
from ch06_arrays.solutions.ex09_sudoku_checker import is_sudoku_valid
def create_initialized_board():
return [[1, 2, 0, 4, 5, 0, 7, 8, 9],
[0, 5, 6, 7, 0, 9, 0, 2, 3],
[7, 8, 0, 1, 2, 3, 4, 5, 6],
[... | 3.890625 | 4 |
crontab_holdernumber.py | xuan-wang/funcat | 18 | 45976 | <reponame>xuan-wang/funcat
#!/root/miniconda3/envs/py36/bin/python3
import time
import tushare as ts
import datetime
from funcat import *
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.types import NVARCHAR, Float, Integer
from wxpusher import WxPusher as wx
uid = ['UID... | 1.84375 | 2 |
skeema/intermediate/__init__.py | HeadHaus/Skeema | 0 | 45977 | from .class_context import ClassContext
from .compilation_context import CompilationContext
from .data_member import DataMember
from .parameter import Parameter
from .representation import Representation
| 1.265625 | 1 |
vivarium/braitenberg_rooms.py | Pyrofoux/vivarium | 2 | 45978 | <gh_stars>1-10
import math
from simple_playgrounds.game_engine import Engine
from simple_playgrounds.playgrounds import *
from simple_playgrounds.utils import *
from simple_playgrounds.entities import *
from simple_playgrounds.entities.scene_elements.collection.contact import *
class CandyRoom(SingleRoom):
def... | 2.859375 | 3 |
main.py | uppi/foodtracker | 0 | 45979 | <reponame>uppi/foodtracker
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import os
import logging
from messages import question_text, question_markup, resubmit_markup, stats_text, unsubscribed_message, draw_stats, \
moving_avg
from storage import Storage, QUESTIONS, question_by_kind
from model imp... | 1.945313 | 2 |
code/python_scripts/kandane_subarrays.py | lukaschoebel/LUMOS | 0 | 45980 | <gh_stars>0
from collections import Counter
def maxSubArray(nums) -> int:
""" Find the maximum int value
:type nums: List[int]
:rtype: int
"""
subarray = []
for i in range(1, len(nums)):
if nums[i-1] > 0:
nums[i] += nums[i-1]
subarray.append(nums[i])
return ... | 3.875 | 4 |
project-fortis-pipeline/localdeploy/parse-output.py | prathmj/project-fortis | 46 | 45981 | #!/usr/bin/env python
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument('file_to_parse', type=argparse.FileType('r'))
args = parser.parse_args()
json_payload = json.load(args.file_to_parse)
outputs = json_payload.get('properties', {}).get('outputs', {})
for key, value in outputs.ite... | 3.609375 | 4 |
simianpy/io/trodes/__init__.py | jselvan/simianpy | 0 | 45982 | from .io import Trodes
def infer_session_name(path):
matches = list(path.glob('*.raw'))
if matches:
session_name = matches[0].stem.replace('.raw','')
return session_name
else:
raise ValueError('Could not infer session name') | 2.296875 | 2 |
hesiod.py | ebroder/python-hesiod | 3 | 45983 | """
Present both functional and object-oriented interfaces for executing
lookups in Hesiod, Project Athena's service name resolution protocol.
"""
from _hesiod import bind, resolve
from pwd import struct_passwd
from grp import struct_group
class HesiodParseError(Exception):
pass
class Lookup(object):
"""
... | 2.828125 | 3 |
examples/dpdk/chain.py | fabrizio-granelli/comnetsemu | 11 | 45984 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
About: Basic chain topology for test DPDK L2 forwarding application.
"""
import argparse
import multiprocessing
import subprocess
import sys
import time
from shlex import split
from subprocess import check_output
from comnetsemu.cli import CLI
from... | 2.25 | 2 |
tests/unit/test_worksheet.py | jaraco/xlsxcessive | 3 | 45985 | import random
from xlsxcessive.worksheet import Worksheet
class TestAddingCellsToWorksheet:
def setup_method(self, method):
self.sheet = Worksheet(None, 'test', None, None)
def _coords_to_a1(self, coords):
def num_to_a(n):
if n < 0:
return ""
if n == 0... | 2.953125 | 3 |
ooobuild/lo/xml/sax/x_fast_attribute_list.py | Amourspirit/ooo_uno_tmpl | 0 | 45986 | <reponame>Amourspirit/ooo_uno_tmpl<gh_stars>0
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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/licens... | 1.414063 | 1 |
test/test_train.py | mikolasan/name-generator | 0 | 45987 | import os
import pytest
from stupid_ai.markov_chain import MarkovChain
@pytest.fixture
def markov_chain():
m = MarkovChain()
m.set_file(os.path.join('data', 'male.txt'))
m.train()
return m
def test_p_values(markov_chain):
assert markov_chain.P[0][0] == 0.004246284501061571
assert markov_chai... | 2.328125 | 2 |
Doulist-book-Spider/spider.py | bujige/Python-practice | 0 | 45988 | <reponame>bujige/Python-practice
#!/usr/bin/python
#-*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from bs4 import BeautifulSoup
import re
import urllib2
import xlwt
#得到页面全部内容
def askURL(url):
request = urllib2.Request(url)#发送请求
try:
response = urllib2.urlopen(request)#取得响应... | 3.078125 | 3 |
tests/test_QGrid___eq__.py | nivlekp/abjad-ext-nauert | 2 | 45989 | import abjadext.nauert
def test_QGrid___eq___01():
a = abjadext.nauert.QGrid()
b = abjadext.nauert.QGrid()
assert format(a) == format(b)
assert a != b
def test_QGrid___eq___02():
a = abjadext.nauert.QGrid(
root_node=abjadext.nauert.QGridContainer(
preprolated_duration=1,
... | 2.25 | 2 |
shared/tests/unit/test_create_base_application.py | ostcar/openslides-datastore-service | 0 | 45990 | import os
from unittest.mock import MagicMock, patch
import pytest
from shared import create_base_application
from shared.di import injector
from shared.services import EnvironmentService, ShutdownService
from shared.tests import reset_di # noqa
@pytest.fixture()
def env_service(reset_di): # noqa
injector.reg... | 2.265625 | 2 |
tangshi.py | fanyunhua/python | 0 | 45991 | <filename>tangshi.py
#coding=utf-8
import re
import requests
from bs4 import BeautifulSoup
soup = BeautifulSoup.text
url = 'https://www.gushiwen.org/shiwen/'
def get_all_url(url):
html_text = requests.get(url)
html_text = html_text.text
url_text = re.findall('<a href="https://so.gushiwen.org/gushi/(.*?).as... | 3.21875 | 3 |
distribution/build_nightly.py | jwhite-usgs/modflow6 | 0 | 45992 | <gh_stars>0
import os
import sys
import platform
import shutil
import flopy
import pymake
# make sure exe extension is used on windows
eext = ''
soext = '.so'
if sys.platform.lower() == 'win32':
eext = '.exe'
soext = '.dll'
binpth, temppth = os.path.join('..', 'bin'), os.path.join('temp')
# some flags to che... | 2.203125 | 2 |
objets/rectangles.py | houahidi/exos-python | 0 | 45993 | <reponame>houahidi/exos-python<filename>objets/rectangles.py<gh_stars>0
""" Gestion des rectangles"""
from objets import points as p
from objets.formes import Forme
class Rectangle(Forme):
""" Rectangle avec 2D"""
def __init__(self, origine, longueur=0, largeur=0):
Forme.__init__(self,origine)
... | 3.34375 | 3 |
python/ach.py | sedgwickc/ach | 48 | 45994 | <filename>python/ach.py
#!/usr/bin/env python
## Copyright (c) 2013, Georgia Tech Research Corporation
## Copyright (c) 2015, Rice University
## All rights reserved.
##
## Author(s): <NAME> <<EMAIL>>
## Georgia Tech Humanoid Robotics Lab
## Under Direction of Prof. <NAME> <<EMAIL>>
##
## Redistribution and use in sour... | 1.664063 | 2 |
rackspaceauth/loading/v2.py | serzh/rackspace-keystoneauth-plugin | 1 | 45995 | # 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, software
# distributed under t... | 1.789063 | 2 |
python-backend/helper/dataHelper.py | Jesse-Yan/UniMatch | 1 | 45996 | <filename>python-backend/helper/dataHelper.py
import sqlite3
## input is the value, search is either "OPEID" or "name"
def getData(input, search):
connection = sqlite3.connect("school-data.db")
cursor = connection.cursor()
query = "SELECT * FROM schools where {}=?".format(search)
result = cursor.ex... | 3.6875 | 4 |
setup.py | lightswarm124/bitbox-py | 0 | 45997 | <reponame>lightswarm124/bitbox-py
import setuptools
with open("README.md", 'r') as fh:
long_description = fh.read()
setuptools.setup(
name = "bitbox-py",
version = "0.0.3",
author = "<NAME>",
author_email = "<EMAIL>",
description = "Gabriel Cardona's Bitbox ported to Python... | 1.554688 | 2 |
web/migrations/0007_auto_20150702_0943.py | LandyGuo/brosbespoke | 1 | 45998 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import web.models
class Migration(migrations.Migration):
dependencies = [
('web', '0006_auto_20150627_1942'),
]
operations = [
migrations.AddField(
model_n... | 1.703125 | 2 |
hibp/example.py | kernelmachine/haveibeenpwned | 42 | 45999 | from hibp import HIBP, AsyncHIBP
import time
import logging
logging.basicConfig(level=logging.INFO, format='%(message)s')
logging.getLogger("requests").setLevel(logging.WARNING)
if __name__ == '__main__':
# random set of query paramaters
names = ['adobe','ashleymadison', 'naughtyamerica', 'myspace']
accou... | 2.3125 | 2 |