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 |
|---|---|---|---|---|---|---|
backend/logger/migrations/0029_rename_httprequest_payload.py | AstroMatt/esa-subjective-time-perception | 1 | 12791351 | <gh_stars>1-10
# Generated by Django 4.0.4 on 2022-05-07 09:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logger', '0028_remove_httprequest_api_version_and_more'),
]
operations = [
migrations.RenameModel(
old_name='HTTPRequest'... | 1.515625 | 2 |
nn/mnist_tf_coreml/pb_to_coreml.py | kamino410/edsdk-sample | 23 | 12791352 | <filename>nn/mnist_tf_coreml/pb_to_coreml.py
import tensorflow as tf
import tfcoreml
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_pb')
parser.add_argument('output_mlmodel')
args = parser.parse_args()
model = tfcoreml.convert(tf_model_path=args.input_pb,
mlmo... | 2.765625 | 3 |
build_framework/build_clib.py | kdschlosser/wxAnimation | 2 | 12791353 | <filename>build_framework/build_clib.py
# -*- coding: utf-8 -*-
import distutils
import distutils.errors
import distutils.core
import distutils.command.build_clib
import distutils.log
from distutils.sysconfig import customize_compiler
import distutils.dir_util
import os
from . import spawn_process
from .library.libr... | 2.109375 | 2 |
gradools/mconfig.py | matthew-brett/gradools | 1 | 12791354 | <filename>gradools/mconfig.py
""" Tools for grading
"""
from os.path import exists, join as pjoin
from collections import OrderedDict
import pytoml as toml
import pandas as pd
class ConfigError(RuntimeError):
pass
class Config:
config_fname = 'gdconfig.toml'
required_fields = ('year',)
default_l... | 2.40625 | 2 |
wandb/integration/xgboost/xgboost.py | ayulockin/client | 0 | 12791355 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
xgboost init
"""
import os
import json
import wandb
import warnings
import xgboost as xgb
from typing import cast
from pathlib import Path
MINIMIZE_METRICS = [
"rmse",
"rmsle",
"mae",
"mape",
"mphe",
"logloss",
"error",
"error@t",
"merror",
... | 2.53125 | 3 |
fix_timestamps.py | molguin92/EdgeDroidResults | 0 | 12791356 | """
Copyright 2019 <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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... | 1.890625 | 2 |
oldp/apps/cases/migrations/0010_case_abstract.py | docsuleman/oldp | 66 | 12791357 | <reponame>docsuleman/oldp<filename>oldp/apps/cases/migrations/0010_case_abstract.py
# Generated by Django 2.1.1 on 2018-09-18 08:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cases', '0009_auto_20180430_1225'),
]
operations = [
mig... | 1.5 | 2 |
tests/connectors/mock/test_mockdata.py | gvasold/papilotte | 3 | 12791358 | """Test creation of mock data.
"""
import datetime
from papilotte.connectors.mock import mockdata
def test_generate_person():
"Make sure generate_person() doesn not create more than 15 different persons."
num_of_different_objects = 15
generator = mockdata.generate_person(num_of_different_objects)
o... | 2.90625 | 3 |
sdk/python/pulumi_spotinst/aws/ocean.py | 346/pulumi-spotinst | 1 | 12791359 | <reponame>346/pulumi-spotinst<filename>sdk/python/pulumi_spotinst/aws/ocean.py<gh_stars>1-10
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
... | 1.9375 | 2 |
init.py | yuryyu/SmartHome | 0 | 12791360 | <filename>init.py
# configuration module
import socket
nb=1 # 0- HIT-"192.168.3.11", 1 - open HiveMQ - broker.hivemq.com
brokers=[str(socket.gethostbyname('vmm1.saaintertrade.com')), str(socket.gethostbyname('broker.hivemq.com')),"18 .194.176.210"]
ports=['80','1883','1883']
usernames = ['','',''] # should be modifie... | 2.03125 | 2 |
GetBulletChat.py | Hopejoyce/python_game | 1 | 12791361 | from bs4 import BeautifulSoup
import time
import pandas as pd
import requests
import datetime
headers={
"User-Agent":"",
"Connection": "keep-alive",
# 这个cookie的获取方法在文档中已说明
"Cookie":""
}
sets=124 # 最新一期的数字
dates=[] # 日期数组,用于填充url
# 遍历日期 包括begin和end的日期 生成类似2020-05-03的格式的日期
begin = datetime.date(2020... | 2.90625 | 3 |
run_ogs5py_scripts.py | GeoStat-Framework/ogs5py_benchmarks | 3 | 12791362 | # -*- coding: utf-8 -*-
"""
run all ogs5py benchmarks
"""
import sys
import os
import fnmatch
import time
from pexpect.popen_spawn import PopenSpawn
import pexpect
from ogs5py.tools.tools import Output
# pexpect.spawn just runs on unix-like systems
if sys.platform == "win32":
CmdRun = PopenSpawn
else:
CmdRun =... | 2.1875 | 2 |
src/libspec/arm/scripts/ast/nodes.py | agustingianni/retools | 80 | 12791363 | <filename>src/libspec/arm/scripts/ast/nodes.py<gh_stars>10-100
class BaseNode(object):
def accept(self, visitor):
return visitor.accept(self)
class BooleanValue(BaseNode):
def __init__(self, value):
self.value = value
def __str__(self):
return str("true" if self.value else "false")... | 2.859375 | 3 |
image_styles/views.py | fotorius/django-image-styles | 0 | 12791364 | from django.shortcuts import render, HttpResponse, get_object_or_404
from django.http import Http404
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.urls import reverse,reve... | 1.9375 | 2 |
python/pynamics_examples/parallel_five_bar_jumper_foot.py | zmpatel19/Foldable-Robotics | 2 | 12791365 | <filename>python/pynamics_examples/parallel_five_bar_jumper_foot.py
# -*- coding: utf-8 -*-
"""
Written by <NAME>
Email: danaukes<at>gmail.com
Please see LICENSE for full license.
"""
import pynamics
from pynamics.frame import Frame
from pynamics.variable_types import Differentiable,Constant
from pynamics.system impor... | 2.671875 | 3 |
Comparison_fun_2.py | MarianaCandamil/Kocolatl | 0 | 12791366 | <filename>Comparison_fun_2.py
#====Librerias usadas==========================================================
# Manejo de datos
#import pandas as pd
#multiples data frames
#from pathlib import Path
#libreria para manejar opciones del sistema
import os
#==Funciones auxiliares======================================... | 2.953125 | 3 |
examples/copernicus_downloader.py | freol35241/voyapt | 3 | 12791367 | from pathlib import Path
import cdsapi
YEARS = [2019]
MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
ROOT = Path("wind_data")
ROOT.mkdir(exist_ok=True)
c = cdsapi.Client(key="YOUR_API_KEY")
for year in YEARS:
for month in MONTHS:
month = str(month).zfill(2)
c.retrieve(
"reanalysis-... | 2.34375 | 2 |
resources/user.py | jacoboviii/flask-rest-api | 0 | 12791368 | <reponame>jacoboviii/flask-rest-api
from typing import Dict, Tuple
from flask_restful import Resource, reqparse
from models.user import UserModel
class UserRegister(Resource):
parser = reqparse.RequestParser()
parser.add_argument(
"username", type=str, required=True, help="This field cannot be left b... | 2.96875 | 3 |
Test/FunctionalTests/LegacyTests/FsmEditorLegacyTestScripts/TestGetBounds.py | migueldeicaza/ATF | 1 | 12791369 | <reponame>migueldeicaza/ATF
#Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import System.Xml
import Scea.Dom
import Test
#create new document
print editor
fsmDocument = atfFile.OpenNewDocument(editor)
fsmDocument.CircuitControl.Style.SnapToGrid = False
#create 2 states
names... | 2.390625 | 2 |
gramex/apps/guide/websockethandler/websocketchat.py | joshuamosesb/gramex | 2 | 12791370 | import time
from random import choice
from tornado.ioloop import PeriodicCallback
from nltk.chat.util import Chat, reflections
from nltk.chat.eliza import pairs
chat_info = {}
idle_phrases = [
"Are you still there?",
"Would you like to say something?",
"If you're busy, we can talk later.",
"What are yo... | 3.0625 | 3 |
mantisshrimp/hub/detr/detr_pretrained_checkpoint_base.py | ramaneswaran/mantisshrimp | 0 | 12791371 | <reponame>ramaneswaran/mantisshrimp
__all__ = ["detr_pretrained_checkpoint_base"]
from mantisshrimp.imports import *
def detr_pretrained_checkpoint_base():
# load checkpoint and delete head
url = "https://dl.fbaipublicfiles.com/detr/detr-r50-e632da11.pth"
checkpoint = torch.hub.load_state_dict_from_url(
... | 1.734375 | 2 |
devices/fan.py | tmkasun/jetson-gpio-device-controller | 0 | 12791372 | #!/usr/bin/env python3
import logging
import os
import signal
import sys
from .device import Device
class Fan(Device):
@staticmethod
def logTemperature():
process = os.popen(
"cat /sys/devices/virtual/thermal/thermal_zone*/temp")
stdout = process.read()
zones = [
... | 2.59375 | 3 |
Flash.py | Gu-Youngfeng/Config-Optimization | 2 | 12791373 | #!\usr\bin\python
# coding=utf-8
# Author: youngfeng
# Update: 07/16/2018
"""
Flash, proposed by Nair et al. (arXiv '18), which aims to find the (near) optimal configuration in unevaluated set.
STEP 1: select 80%% of original data as dataset
STEP 2: split the dataset into training set (30 configs) and unevaluated set ... | 3.125 | 3 |
debugging/check_athena.py | 094459/devday-elt-automation | 2 | 12791374 | <filename>debugging/check_athena.py
import os
import boto3
import sys
ath = boto3.client('athena')
try:
response = ath.get_database(
CatalogName='AwsDataCatalog',
DatabaseName='scifimovies'
)
print("Database found")
except:
print("No Database Found")
try:
response = ath.get_table... | 2.671875 | 3 |
external/opengl-registry/extensions/registry.py | FTD2012/CrossWindow | 6 | 12791375 | registry = {
'GL_3DFX_multisample' : {
'number' : 207,
'flags' : { 'public' },
'supporters' : { '3DFX' },
'url' : 'extensions/3DFX/3DFX_multisample.txt',
},
'GL_3DFX_tbuffer' : {
'number' : 208,
'flags' : { 'public' },
'supporters' : { '3DFX' },
... | 1.21875 | 1 |
uncertainty_toolbox/data.py | rebeccadavidsson/uncertainty-toolbox | 1 | 12791376 | <filename>uncertainty_toolbox/data.py
"""
Code for importing and generating data.
"""
import numpy as np
def synthetic_arange_random(num_points=10):
"""
Simple dataset of evenly spaced points and identity function (with some
randomization)
"""
y_true = np.arange(num_points)
y_pred = np.arange... | 3.125 | 3 |
python/frame.py | ramity/apexcv | 13 | 12791377 | <reponame>ramity/apexcv
import os
import numpy as np
class Frame:
path = ""
frameNumber = 1
image
cols = 0
rows = 0
# default configured opencv settings
simpleBlurAmount = 25
thresholdType = cv2.THRESH_BINARY
bilateralKernelSize = 9
bilateralSigmaSpace = 9
countourRetrival... | 2.484375 | 2 |
external_tools/src/main/python/images/CopyOnlyFilesSpecifiedInSolr.py | amccoy95/PhenotypeData | 1 | 12791378 | <filename>external_tools/src/main/python/images/CopyOnlyFilesSpecifiedInSolr.py
#!/usr/bin/python
"""this program gets the download_file_paths (http mousephenotype uris) from the experiment core and then downloads the images"""
import os
import requests
import json
import sys
import os.path
import sys
import argparse
... | 2.609375 | 3 |
tests/test_PerCarRaceStatusData.py | jdamiani27/PyRaceView | 4 | 12791379 | <filename>tests/test_PerCarRaceStatusData.py
import pytest
from pyraceview.messages import MsgRaceStatus
raw = (
b"\xab\xcd*T\x02Cs\x04\x90\x90[3\x10\xcc\x89\xb8V\x00\x00"
b"\x00\x05q\xe0\x03 \x00y\x86\xb9\x00\x00$\x00\x10\x10\x06"
b"\x0e\xe8\x00\x06\x0f\x91k\xe5\x00\x00&\x00\x15\xce\x05\xb9x"
b"\x00\... | 1.976563 | 2 |
python_helper/api/src/service/LogHelper.py | SamuelJansen/python_helper | 0 | 12791380 | import colorama, traceback
from python_helper.api.src.domain import Constant as c
from python_helper.api.src.service import SettingHelper, StringHelper, EnvironmentHelper, ObjectHelper, ReflectionHelper
LOG = 'LOG'
INFO = 'INFO'
SUCCESS = 'SUCCESS'
SETTING = 'SETTING'
DEBUG = 'DEBUG'
WARNING = 'WARNING'
WRAPPER = 'WRA... | 1.875 | 2 |
EDX_main.py | tkcroat/EDX | 0 | 12791381 | # -*- coding: utf-8 -*-
"""
Spyder Editor
SEM_batch_conversion script
Extracts important header info into parameter log, designed to read out pertinent header information from all emsa files within a folder.
No need to convert psmsa into csv ... just always strip header when opening
Output into single log file for impo... | 2.34375 | 2 |
Code/AnalyseFittedData_Field_at_He.py | nancy-aggarwal/Characterization-of-ARIADNE-source-mass-rotor_Github | 0 | 12791382 | <gh_stars>0
# %%
from scipy.io import loadmat
import numpy as np
# from scipy.optimize import minimize
from datetime import datetime
now = datetime.now
import matplotlib.pyplot as plt
import matplotlib as mpl
import time
import os
import pickle
import json
from scipy import fft
from scipy.signal.windows import hann
f... | 1.90625 | 2 |
specification/tools/VMHprocessMappings1.py | iptc/video-metadata-hub | 1 | 12791383 | #!/usr/bin/env python3
"""
Python script for retrieving IPTC Video Metadata Hub mapping data from a Google sheet
The retrieved data are transformed in HTML as saved as HTML page.
For IPTC-internal use
Creator: <NAME>
History:
2016-11-25 mws: project started, download and HTML output ok
2020-06-15 BQ: Updated a... | 2.9375 | 3 |
imgtopdf/__init__.py | AVIPAGHADAR1729/imgtopdf | 0 | 12791384 | <filename>imgtopdf/__init__.py
from .imgtopdf import get_images_and_convert
# https://towardsdatascience.com/how-to-build-your-first-python-package-6a00b02635c9 | 1.578125 | 2 |
scratch.py | satyarth934/DCASE2020_task1 | 0 | 12791385 | import glob
import numpy as np
from pprint import pprint as pp
g = glob.glob("data/*/*/audio/*.wav")
wavpath = g[:10]
pp(wavpath)
res = [("/".join(wp.split("/")[:-2]), "/".join(wp.split("/")[-2:])) for wp in wavpath]
pp(res) | 2.71875 | 3 |
database.py | jhuiry8/fdfsdsdf | 16 | 12791386 | from __future__ import annotations
from datetime import datetime
from typing import List, Dict, Union, Optional, TYPE_CHECKING
import pymongo
from pymongo import MongoClient
from pytz import timezone
import config
if TYPE_CHECKING:
import discord
JsonData = Dict[str, Union[str, int]]
cluster = M... | 2.5625 | 3 |
datasets/ChEMBL_STRING/step_02.py | chao1224/SGNN-EBM | 0 | 12791387 | <filename>datasets/ChEMBL_STRING/step_02.py<gh_stars>0
import pandas as pd
import requests
import urllib
import argparse
import urllib.request
import xml.etree.ElementTree as ET
from multiprocessing import Pool
from tqdm import tqdm
from time import sleep
from requests.models import HTTPError
'''
http://www.uniprot.o... | 2.84375 | 3 |
union-find-by-rank.py | zLianK/algorithms | 0 | 12791388 | <gh_stars>0
from collections import defaultdict
# The structure to represent the graph
class Graph:
def __init__(self, vertices):
self.V = vertices
self.edges = defaultdict(list)
def add_edge(self, u, v):
self.edges[u].append(v)
# The structure to represent a subset
class Subset:
... | 3.390625 | 3 |
code/decoder.py | JacksonFrank/GEMSECDataPipelining | 0 | 12791389 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 1 11:41:59 2019
@author: gemsec-user
"""
import numpy as np
import prody as pd
import PeptideBuilder as pb
import os
import Bio
import cleaning
from decimal import Decimal
from symbols import *
#from pdbtools import pdbtools as pdb
d = os.getcwd()... | 2.78125 | 3 |
webservice/server/server/summ_eval/server/cli/__init__.py | mymusise/emnlp19-moverscore | 141 | 12791390 | def main():
from summ_eval.server import EvalServer
from summ_eval.server.helper import get_run_args
args = get_run_args()
server = EvalServer(args)
server.start()
server.join() | 1.484375 | 1 |
tests/test_target.py | projectsyn/commodore | 39 | 12791391 | """
Unit-tests for target generation
"""
import os
import click
import pytest
from pathlib import Path as P
from textwrap import dedent
from commodore import cluster
from commodore.inventory import Inventory
from commodore.config import Config
@pytest.fixture
def data():
"""
Setup test data
"""
te... | 2.3125 | 2 |
raster_info_car.py | leandromet/Geoprocessamento---Geoprocessing | 2 | 12791392 | <filename>raster_info_car.py
#-------------------------------------------------------------------------------
# Name: Raster information from vector relations
# Purpose: Classify features of interest based on a raster with pixels that have classification values.
# Having a catalog in a vector l... | 3.390625 | 3 |
media.py | PatrickO10/movie_trailers | 0 | 12791393 | import webbrowser
class Movie():
'''This is a class for storing information about movies.'''
def __init__(self, movie_title, movie_year, poster_image, trailer_youtube, movie_rating):
self.title = movie_title
self.year = movie_year
self.poster_image_url = poster_image
self.traile... | 3.59375 | 4 |
msf_2022/io/read.py | molssi-workshops/msf_sample_2022 | 0 | 12791394 | <gh_stars>0
"""
Functions for reading molecular files
"""
import numpy as np
import matplotlib.pyplot as plt
def read_pdb(f_loc: str)->tuple[list[str], np.ndarray]:
# This function reads in a pdb file and returns the atom names and coordinates.
with open(f_loc) as f:
data = f.readlines()
c = []
... | 2.921875 | 3 |
stats/constants.py | mpope9/nba-sql | 113 | 12791395 | <gh_stars>100-1000
"""
Constants used in the application.
"""
"""
List of seasons.
"""
season_list = [
'1996-97',
'1997-98',
'1998-99',
'1999-00',
'2000-01',
'2001-02',
'2002-03',
'2003-04',
'2004-05',
'2005-06',
'2006-07',
'2007-08',
'2008-09',
'2009-10',
'2... | 1.773438 | 2 |
kokoropy/scaffolding/scaffold_cms/controllers/page.py | goFrendiAsgard/kokoropy | 5 | 12791396 | from kokoropy.controller import Crud_Controller
from ..models._all import Page
class Page_Controller(Crud_Controller):
__model__ = Page
Page_Controller.publish_route() | 1.601563 | 2 |
Leetcode/Solutions/Find_First_and_Last_Position_of_Element_in_Sorted_Array.py | fakecoinbase/sweetpandslashAlgorithms | 3 | 12791397 | <reponame>fakecoinbase/sweetpandslashAlgorithms
# Question: Given a sorted array, find the first and last indices of a target number
# Solution: Run two (lower bounded) binary searches, one for the target number and one
# for the successor of the target (the next natural number after the targer number)
# Dif... | 3.78125 | 4 |
example/kd_loss.py | chris4540/DT2119-Final-Project | 1 | 12791398 | <gh_stars>1-10
import torch
# from torch.autograd import Variable
import torch.nn as nn
# import torch.nn.functional as F
import numpy as np
from torch.nn.utils.rnn import pad_sequence
from torch.nn.functional import softmax
from torch.nn.functional import log_softmax
if __name__=='__main__':
logits1 = -np.random.... | 2.34375 | 2 |
tests/terraform/checks/resource/aws/test_LBDeletionProtection.py | kylelaker/checkov | 3 | 12791399 | <gh_stars>1-10
import unittest
import hcl2
from checkov.terraform.checks.resource.aws.LBDeletionProtection import check
from checkov.common.models.enums import CheckResult
class TestLBDeletionProtection(unittest.TestCase):
def test_failure(self):
hcl_res = hcl2.loads("""
resource "aws_l... | 2.234375 | 2 |
filmfestival/migrations/0031_film_stills.py | mykonosbiennale/mykonosbiennale.github.io | 1 | 12791400 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('material', '0002_auto_20170327_0215'),
('filmfestival', '0030_reward'),
]
operations = [
migrations.A... | 1.523438 | 2 |
lib/googlecloudsdk/sql/tools/ssl_certs/__init__.py | IsaacHuang/google-cloud-sdk | 0 | 12791401 | # Copyright 2013 Google Inc. All Rights Reserved.
"""Provide commands for managing SSL certificates of Cloud SQL instances."""
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
class SslCerts(base.Group):
"""Provide commands for managing SSL certificates of Cloud SQL instanc... | 2.25 | 2 |
layersclick/efs.py | hdknr/py-layers | 0 | 12791402 | <reponame>hdknr/py-layers
import click
from layerslib import efs as EFS
from .utils import J, setup
@click.group()
@click.option("--profile_name", "-p", default=None)
@click.pass_context
def efs(ctx, profile_name):
setup(ctx, profile_name)
@efs.command()
@click.pass_context
def efs_list(ctx):
data = EFS.g... | 1.921875 | 2 |
tests/unit/test_get_data.py | shivaq/set_aws_mfa | 0 | 12791403 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from random import randint
from set_aws_mfa.data.data_manager import ProfileTuple
from set_aws_mfa.helper import helper
from set_aws_mfa import validate
from set_aws_mfa.data import data_manager
from set_aws_mfa.helper.helper import IntObject
from set_aws_mfa import promp... | 2.453125 | 2 |
src/userlogs/admin.py | cbsBiram/xarala__ssr | 0 | 12791404 | from django.contrib import admin
from .models import UserLog
admin.site.register(UserLog)
| 1.226563 | 1 |
dl4nlp_pos_tagging/models/modules/seq2seq_encoders/bi_feedforward_encoder.py | michaeljneely/model-uncertainty-pos-tagging | 1 | 12791405 | <reponame>michaeljneely/model-uncertainty-pos-tagging<filename>dl4nlp_pos_tagging/models/modules/seq2seq_encoders/bi_feedforward_encoder.py
from overrides import overrides
from allennlp.modules.seq2seq_encoders.feedforward_encoder import FeedForwardEncoder
from allennlp.modules.seq2seq_encoders.seq2seq_encoder import ... | 2.03125 | 2 |
proc_1040.py | ketancmaheshwari/Tributum | 0 | 12791406 | <gh_stars>0
#!/usr/bin/env python3
"""
Programs for processing form 1040
"""
import toml
def deps(dict_1040):
"""
A function to calculate no. of dependents.
This currently goes up to 4 dependents.
"""
dep_count = 0
#while
counter = 1
while counter <= 4 and dict_1040["Dep" + str(counter... | 2.984375 | 3 |
descarteslabs/common/graft/interpreter/__init__.py | descarteslabs/descarteslabs-python | 167 | 12791407 | <gh_stars>100-1000
from .interpreter import interpret
from . import exceptions
from .scopedchainmap import ScopedChainMap
__all__ = ["interpret", "exceptions", "ScopedChainMap"]
| 1.179688 | 1 |
skyline/functions/database/queries/related_to_metric_groups.py | datastreaming/skyline-1 | 396 | 12791408 | <reponame>datastreaming/skyline-1
"""
Get anomalies for a metric id
"""
import logging
import traceback
from ast import literal_eval
from sqlalchemy.sql import select
from database import get_engine, engine_disposal, metric_group_table_meta
from functions.metrics.get_base_name_from_metric_id import get_base_name_from_... | 2.359375 | 2 |
mwbase/admin.py | uw-ictd/mwbase | 1 | 12791409 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.http.response import HttpResponse
from django.http import JsonResponse
from django.template.response import SimpleTemplateResponse, TemplateResponse
from django.urls import path, reve... | 1.992188 | 2 |
scripts/iemre/db_to_netcdf.py | jamayfieldjr/iem | 1 | 12791410 | <gh_stars>1-10
"""Copy database grids to netcdf.
Example: python db_to_netcdf.py <year> <month> <day> <utchour>
If hour and minute are omitted, this is a daily copy, otherwise hourly.
see: akrherz/iem#199
"""
import sys
import datetime
import numpy as np
from pyiem.util import utc, ncopen, logger
from pyiem imp... | 2.90625 | 3 |
meshes/read_brain_mesh_3D.py | AasmundResell/FEniCS-Brain-Flow | 0 | 12791411 | from fenics import *
from matplotlib.pyplot import show
def read_brain_mesh_3D():
path = "/home/asmund/dev/FEniCS-Brain-Flow/meshes/parenchyma16_with_DTI.h5"
mesh = Mesh()
#hdf = HDF5File(mesh.mpi_comm(),path , "r")
#hdf.read(mesh, "/mesh", False)
SD = MeshFunction("size_t", mesh,mesh.topology().d... | 2.34375 | 2 |
djangosheet/migrations/0004_lineupentry_ordering.py | seandw/djangosheet | 2 | 12791412 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('djangosheet', '0003_lineup_1to1'),
]
operations = [
migrations.AlterModelOptions(
name='lineupent... | 1.554688 | 2 |
lib/bnet/cache.py | theonewolf/siegvswolf | 0 | 12791413 | import logging
from .util import raw_get
from google.appengine.api.taskqueue import TaskAlreadyExistsError
from google.appengine.api.taskqueue import TombstonedTaskError
from google.appengine.ext import ndb
from google.appengine.ext import deferred
from datetime import datetime
from time import time
CACHE_TIMEO... | 2.09375 | 2 |
ex08-BibliotecaMath.py | vnnstar/Python-Mundo1-CursoEmVideo | 0 | 12791414 | <reponame>vnnstar/Python-Mundo1-CursoEmVideo<filename>ex08-BibliotecaMath.py
import math
n = int(input('Informe um valor inteiro: '))
print('Esté é o número digitado {}, este é seu antecessor {}, este é seu'
' sucessor {}.'.format(n, n - 1, n + 1))
n1 = int(input('Informe um valor inteiro: '))
raiz = math.sqrt(... | 3.5625 | 4 |
vindauga/widgets/color_item_list.py | gabbpuy/vindauga | 5 | 12791415 | <reponame>gabbpuy/vindauga<gh_stars>1-10
# -*- coding: utf-8 -*-
import logging
from vindauga.constants.colors import cmSaveColorIndex, cmNewColorIndex, cmNewColorItem
from vindauga.constants.event_codes import evBroadcast
from vindauga.misc.message import message
from .list_viewer import ListViewer
logger = logging.... | 2.640625 | 3 |
geophys_utils/dataset_metadata_cache/__init__.py | GeoscienceAustralia/geophys_utils | 18 | 12791416 | '''
Created on 20 Jul. 2018
@author: Alex
'''
from ._dataset_metadata_cache import settings, DatasetMetadataCache, Dataset, Distribution
from ._postgres_dataset_metadata_cache import PostgresDatasetMetadataCache
from ._sqlite_dataset_metadata_cache import SQLiteDatasetMetadataCache
def get_dataset_metadata_c... | 2.109375 | 2 |
mutJacobMethod.py | vicentepese/PSM-Narcolepsy | 1 | 12791417 | import numpy as np
import sys
import os
import json
import csv
import re
import random
import subprocess
from markdown2 import Markdown
from Bio import Entrez
from Bio import SeqIO
from collections import defaultdict, OrderedDict
from scipy import stats
from utils import getBindingCore, importBindData,\
importData, r... | 2.125 | 2 |
orchestration/integration/custom_scripts/script_execution.py | dave-read/vdc | 1 | 12791418 | <reponame>dave-read/vdc
from orchestration.models.script_type import ScriptType
from orchestration.common import helper
class CustomScriptExecution(object):
def execute(
self,
script_type: ScriptType,
command: str,
output_file_path: str = None,
property_path: str = None... | 2.234375 | 2 |
Ver.1/Main.py | AbdAlazezAhmed/TilesPy | 0 | 12791419 | import numpy as np
from grabscreen import grab_screen
from directkeys import Up , Down , PressKey , ReleaseKey , Move1 , Move2
import time
from getkeys import key_check
import cv2
def main () :
while(True) :
#Resize the game window to about less than quarter of the screen at 1920*1080 resolution
... | 2.734375 | 3 |
src/backend/graph/api/urls.py | pawlaczyk/KTZgraph | 0 | 12791420 | <filename>src/backend/graph/api/urls.py<gh_stars>0
from django.urls import path
from graph.api import views
urlpatterns = [
path('', views.GraphList.as_view(), name='graph-list'),
path('<int:pk>', views.GraphDetail.as_view(), name='graph-list'),
path('create/', views.GraphCreate.as_view(), name='graph-lis... | 1.851563 | 2 |
html_parsing/get_game_genres/parsers/squarefaction_ru.py | DazEB2/SimplePyScripts | 117 | 12791421 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from typing import List
from bs4 import BeautifulSoup
from base_parser import BaseParser
class SquarefactionRu_Parser(BaseParser):
def _parse(self) -> List[str]:
url = f'http://squarefaction.ru/main/search/games?q={self.game_name}'
... | 2.9375 | 3 |
setup.py | movermeyer/envtool | 3 | 12791422 | <gh_stars>1-10
# -*- encoding: utf-8 -*-
import glob
import io
import re
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_o... | 2 | 2 |
tests/test_rigraph.py | tipech/OverlapGraph | 0 | 12791423 | #!/usr/bin/env python
"""
Unit tests for Regional Intersection Graph -- NetworkX
- test_nxgraph_create
- test_nxgraph_sweepctor
- test_nxgraph_mdsweepctor
- test_nxgraph_sweepctor_graph
- test_nxgraph_sweepctor_random
"""
from io import StringIO
from typing import List, Tuple
from unittest import TestCase
from pprin... | 2.421875 | 2 |
wbia_orientation/test.py | WildMeOrg/wbia-plugin-orientation | 1 | 12791424 | # -*- coding: utf-8 -*-
# Written by <NAME> (<EMAIL>)
import os
import pprint
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms
from wbia_orientation.config.default impor... | 1.921875 | 2 |
chess/piece/pawn.py | foxfluff/chess-py | 0 | 12791425 | <gh_stars>0
from ._piece import chess_piece
class pawn(chess_piece):
def avaliable_moves(self):
raise NotImplementedError
@staticmethod
def legal_moves():
return [[x, 1] for x in range(-1, 2)] + [[0, 2]]
| 3.015625 | 3 |
TWLight/users/migrations/0060_auto_20200804_1634.py | saloniig/TWLight | 0 | 12791426 | # Generated by Django 3.0.9 on 2020-08-04 16:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("resources", "0083_auto_20200804_1634"),
("users", "0059_auto_20200706_1659"),
]
operations = [
migr... | 1.632813 | 2 |
test/test_algos/test_opt_algorithm/test_racos/test_racos.py | IcarusWizard/ZOOpt | 403 | 12791427 | <filename>test/test_algos/test_opt_algorithm/test_racos/test_racos.py
from zoopt.algos.opt_algorithms.racos.racos_common import RacosCommon
from zoopt.algos.opt_algorithms.racos.sracos import SRacos
from zoopt import Solution, Objective, Dimension, Parameter, Opt, ExpOpt, ValueType, Dimension2
import numpy as np
def ... | 2.46875 | 2 |
cogs/rolemanager.py | yaansz/RoleManager | 1 | 12791428 | import discord
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, CheckFailure
from utils.converters import CtxRoleConverter
from utils.utils import str2bool
from functools import reduce
import random
import json
import utils.embed as embed
from utils.colors impor... | 2.546875 | 3 |
app/models/__init__.py | woodybriggs/attribute-store | 0 | 12791429 | from sqlalchemy import Column, String, Boolean, ForeignKey, Integer, Float
from ..db import Base
class Attribute(Base):
__tablename__ = "attribute"
id = Column(Integer, autoincrement=True, primary_key=True, unique=True, nullable=False)
type = Column(String(length=256), nullable=False)
remote_reference... | 2.625 | 3 |
scihub/scihub.py | lkirk/scihub-client | 0 | 12791430 | # -*- coding: utf-8 -*-
"""
SciHub client
"""
import logging
import os
import random
import urllib
import requests
from bs4 import BeautifulSoup
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.NullHandler())
class SciHubClient:
"""
Client for accessing SciHub
"""
DEFAULT_HEADERS = {
... | 2.515625 | 3 |
jobbing/models_remote/media.py | davidall-amdocs/jobbing | 0 | 12791431 | <gh_stars>0
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from jobbing.models.base_model_ import Model
from jobbing import util
class Media(Model):
def __init__(self,
media_id:int = None,
media_status_id:i... | 1.867188 | 2 |
qctool/src/mode.py | meghasin/icees-api-config | 0 | 12791432 | <gh_stars>0
from typing import Dict, List, Optional
from dataclasses import dataclass, field
from file import YAMLFile
@dataclass
class CacheTables:
tables: Dict[str, list] = field(default_factory=dict)
table_names: List[str] = field(default_factory=list)
current_table: Optional[int] = 0
def update_ta... | 2.390625 | 2 |
Testing/test_2D_frames.py | geosharma/PyNite | 199 | 12791433 | <filename>Testing/test_2D_frames.py
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 <NAME>, SE; tamalone1
"""
import unittest
from PyNite import FEModel3D
import math
import sys
from io import StringIO
class Test_2D_Frame(unittest.TestCase):
''' Tests of analyzing 2D frames. '''
def setUp(self):
... | 2.765625 | 3 |
src/__init__.py | iki-taichi/tf-keras-transformer | 5 | 12791434 | # coding:utf-8
#from .custom_callbacks import *
| 1.09375 | 1 |
cycada/data/surreal.py | AdityaAS/cycada | 1 | 12791435 | <reponame>AdityaAS/cycada<filename>cycada/data/surreal.py
import numpy as np
import scipy.io
import torch
import os
from torch.utils.data import Dataset
from glob import glob
from os.path import join, exists
import json
from cycada.data.data_loader import register_data_params, register_dataset_obj
from cycada.data.data... | 2.265625 | 2 |
bus_arrival.py | luaneyed/bus | 1 | 12791436 | from BusArrivalItem import BusArrivalItem
from api import call
# bus_arrival_item = BusArrivalItem(xml_root.find('msgBody').find('busArrivalItem'))
# print(bus_arrival_item)
def fetch(station_id: str, route_id: str):
response = call(
'busarrivalservice',
{
'stationId': station_id,
... | 2.859375 | 3 |
build/lib/SOMsHelpers.py | msc-acse/acse-9-independent-research-project-wafflescore | 2 | 12791437 | """
Author: <NAME>
GitHub: wafflescore
"""
from minisom import MiniSom, asymptotic_decay
import numpy as np
import matplotlib.pyplot as plt
import itertools
from skimage import measure
from skimage.segmentation import random_walker
from skimage import filters
from scipy.spatial import distance
from collections impor... | 2.71875 | 3 |
wapkg/remote.py | chickentuna/wapkg | 2 | 12791438 | import json
from urllib.request import urlopen
from urllib.error import URLError
from urllib.parse import urljoin
VERSION_REQUIRED = 3
EXTERNAL_LIST = 'https://pastebin.com/raw/aKjmATab'
# Returns repo index dictionary object, or None in case of failure
def fetch_index(repo_url):
try:
with urlopen(urljo... | 3.171875 | 3 |
min_win_substr.py | skokal01/Interview-Practice | 0 | 12791439 | <filename>min_win_substr.py
# https://discuss.leetcode.com/topic/30941/here-is-a-10-line-template-that-can-solve-most-substring-problems/12
#1. Use two pointers: start and end to represent a window.
#2. Move end to find a valid window.
#3. When a valid window is found, move start to find a smaller window.
from coll... | 3.6875 | 4 |
translator/tasks.py | gsi-upm/eurosentiment-translator | 1 | 12791440 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import time
import traceback
from factory import create_celery_app
from .models import *
from .utils import translate_document
from datetime import timedelta, datetime
from StringIO import StringIO
celery = create_celery_app().celery
logger = celery.logger
@celery.task()
def pr... | 2.171875 | 2 |
celery_app/ipviews.py | tiaotiaolong/piu | 2 | 12791441 | from flask import Blueprint,request
from app import pa_domain,pa_ip
from .tasks import scan_ip_task
from celery_app.utils.utils import get_current_time,insert_taskid_db
ipscan_blueprint = Blueprint("ipscan", __name__, url_prefix='/ipscan')
#通过传入一个一级域名,对这个域名下的所有ip进行scan
@ipscan_blueprint.route('/scan')
def scan_ip():
... | 2.484375 | 2 |
zhuangzhuangml/api/state.py | Alpaca-Hub/zhuangzhuangml | 2 | 12791442 | from notebook.utils import url_path_join as ujoin
from notebook.base.handlers import IPythonHandler
import os, json, git, urllib, requests
from git import Repo, GitCommandError
from subprocess import check_output
import subprocess
repo = None
htable = []
config = {
"GIT_USER": "alpaca",
"GIT_PARENT_DIR": os.path.... | 2.125 | 2 |
rolz_bot/database.py | Reriiru/rolz_org_to_discord | 1 | 12791443 | from pymongo import MongoClient
from settings import MONGO_URL
client = MongoClient(MONGO_URL)
db = client.rolz_database
| 1.609375 | 2 |
naturalnum.py | gusenov/code-stepik-org-entrance-exam | 1 | 12791444 | <reponame>gusenov/code-stepik-org-entrance-exam<gh_stars>1-10
import sys
def expr(x):
a = x / (x - 2018)
b = (x - 500) / (x - 2500)
c = a - b
return c < 0
cnt = 0
for n in range(1, sys.maxsize):
# print("n = %d" % n)
if (n == 2018) or (n == 2500):
continue
if expr(n):
cnt... | 3.234375 | 3 |
src/covid_model_seiir_pipeline/pipeline/regression/model/containers.py | yukgu/covid-model-seiir-pipeline | 0 | 12791445 | <gh_stars>0
"""Containers for regression data."""
from dataclasses import dataclass
from typing import Dict, List, Iterator, Tuple, Union
import pandas as pd
from covid_model_seiir_pipeline.lib import (
utilities,
)
@dataclass
class RatioData:
infection_to_death: int
infection_to_admission: int
infe... | 2.703125 | 3 |
tests/samples.py | ewerybody/svg.charts | 26 | 12791446 | """
Samples of the various charts. Run this script to generate the reference
samples.
"""
import os
from svg.charts.plot import Plot
from svg.charts import bar
from svg.charts import time_series
from svg.charts import pie
from svg.charts import schedule
from svg.charts import line
def sample_Plot():
g = Plot(
... | 2.8125 | 3 |
SUL1/sample/data_reader_example/reader_sample.py | ddddwee1/SULT | 18 | 12791447 | import data_reader
import time
import tensorflow as tf
def worker(num):
time.sleep(0.5)
print(num)
return num
if __name__=='__main__':
data = list(range(100))
bsize = 10
reader = data_reader.data_reader(data, worker, bsize)
for i in range(10):
a = reader.get_next_batch()
print(a)
| 3 | 3 |
ariadna/__init__.py | dacabdi/ariadna | 0 | 12791448 | from .PathSplitter import PathSplitter
from .PathSplitter import RegexSplitter
__DEFAULT_PATH_SPLITTER__ = RegexSplitter
__cajas__ = [
'Caja',
'CajaMapping',
'CajaMutableMapping',
'CajaMutableSequence',
'CajaMutableSet',
'CajaSequence',
'CajaSet'
]
from .Caja import Caja
from .CajaMapping... | 1.414063 | 1 |
cpdb/config/storages.py | invinst/CPDBv2_backend | 25 | 12791449 | import mimetypes
from django.core.files.base import ContentFile
from django.core.files.storage import Storage
from django.utils.deconstruct import deconstructible
from django.conf import settings
from azure.storage.blob.models import ContentSettings
from azure.storage.blob.baseblobservice import BaseBlobService
from ... | 1.960938 | 2 |
test/SentimentAnalyzerTest.py | fractalbass/bayesian_trump | 0 | 12791450 | #--------------------------------------------------------------
# By <NAME>
# Painted Harmony Group, Inc
# June 26, 2017
# Please See LICENSE.txt
#--------------------------------------------------------------
import unittest
import SentimentAnalyzer as analyzer
class SentimentAnalyzerTest(unittest.TestCase):
... | 2.78125 | 3 |