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 |
|---|---|---|---|---|---|---|
tests/testapp/urls.py | grofers/django-authlib | 0 | 12782851 | from django.conf.urls import include, url
from django.contrib import admin
from django.shortcuts import render
from authlib import views
from authlib.facebook import FacebookOAuth2Client
from authlib.google import GoogleOAuth2Client
from authlib.twitter import TwitterOAuthClient
from testapp.views import custom_verif... | 1.976563 | 2 |
simsiam_imagenet/imagenet.py | Yif-Yang/DSSL | 8 | 12782852 |
from torchvision.datasets.vision import VisionDataset
import os
import pickle
from torchvision.datasets.folder import default_loader
class Imagenet(VisionDataset):
def __init__(self, root, data_list, train=True, transform=None, target_transform=None, img_dir='all', target_dir='annos'):
super(Imagenet, se... | 2.71875 | 3 |
demo/state_solar_page.py | stevej2608/dash-spa | 27 | 12782853 | from dash import html, dcc
import dash_bootstrap_components as dbc
import pandas as pd
from .demo import blueprint as spa
global_md = """\
### Global Warming
Global Temperature Time Series. Data are included from the GISS
Surface Temperature (GISTEMP) analysis and the global component
of Climate at a Glance (GCAG). ... | 3.21875 | 3 |
assets/bifurcation/saddle-node.py | dantaylor688/dantaylor688.github.io | 0 | 12782854 | from numpy import *
from matplotlib import *
from pylab import *
import matplotlib.lines as mlines
if __name__ == "__main__":
rc('text', usetex=True)
rc('font', family='serif')
fs = 20
### Example 1
x = arange(-5,5,0.1)
# r > 0
fig= figure(1)
ax = fig.add_subplot(311)
frame1 =... | 2.359375 | 2 |
tests/conftest.py | Murthy10/pyGeoTile | 93 | 12782855 | <gh_stars>10-100
import pytest
'''
Chicago, IL
LatLng: (41.85, -87.64999999999998)
Zoom level: 19
World Coordinate: (65.67111111111113, 95.17492654697409)
Pixel Coordinate: (34430575, 49899071)
Tile Coordinate: (134494, 194918)
'''
@pytest.fixture(scope="session", autouse=True)
def chicago_latitude_longitude():
... | 2.1875 | 2 |
Chapter 04/ch4_3_24.py | bpbpublications/TEST-YOUR-SKILLS-IN-PYTHON-LANGUAGE | 0 | 12782856 | <gh_stars>0
x=100
y=100
print(x is y)
#True
| 2.015625 | 2 |
main.py | gokudo21/doctor | 0 | 12782857 | <reponame>gokudo21/doctor
from flask import Flask, render_template, request
from flask_pymongo import PyMongo
app = Flask(__name__)
#app.config['MONGO_DBNAME'] = 'test'
app.config['MONGO_URI'] = 'mongodb://localhost:27017/test'
#app.config['MONGO_URI'] = 'mongodb://gokudo21:<EMAIL>:18848/patientdb'
mongo = PyMong... | 2.546875 | 3 |
main.py | casmofoundation/Ctool | 0 | 12782858 |
import os
from licensing.models import *
from licensing.methods import Key, Helpers
from PIL import Image, ImageFont, ImageDraw
import sys
import time
from colorama import Fore, Back, Style, init
import shutil
import sys
import os
import requests
import shutil
from bs4 import BeautifulSoup
from reque... | 2.421875 | 2 |
main/permissions.py | sultanalieva-s/discrourse | 0 | 12782859 | <reponame>sultanalieva-s/discrourse
# from rest_framework.permissions import BasePermission
#
#
# class IsOwner(BasePermission):
#
# def has_object_permission(self, req, view, obj):
# return req.user.is_authenticated and req.user == obj.author
#
| 2.109375 | 2 |
test_wsi.py | jlevy44/HE2Tri | 1 | 12782860 | <filename>test_wsi.py
"""General-purpose test script for image-to-image translation.
Once you have trained your model with train.py, you can use this script to test the model.
It will load a saved model from --checkpoints_dir and save the results to --results_dir.
It first creates model and dataset given the option. ... | 3.09375 | 3 |
ThreadFixProApi/Applications/_utils/_team.py | denimgroup/threadfix-python-api | 1 | 12782861 | <reponame>denimgroup/threadfix-python-api
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__copyright__ = "(C) 2019 Denim group"
__contributors__ = ["<NAME>"]
__status__ = "Production"
__license__ = "MIT"
from ...API import API
class TeamsAPI(API):
def __init__(self, host, api_key, verify_ss... | 2.40625 | 2 |
two-sum.py | ibigbug/leetcode | 0 | 12782862 | <gh_stars>0
# Link: https://oj.leetcode.com/problems/two-sum/
class Solution:
# @return a tuple, (index1, index2)
def twoSum(self, num, target):
"""
use hashtable
"""
d = {}
index1 = index2 = 0
for i in range(0, len(num)):
if (target - num[i]) in d:
... | 3.390625 | 3 |
src/programy/clients/restful/asyncio/microsoft/client.py | motazsaad/fit-bot-fb-clt | 0 | 12782863 | """
Copyright (c) 2016-2019 <NAME> http://www.keithsterling.com
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 limitation
the rights to use, copy, modify, m... | 1.523438 | 2 |
other/dingding/dingtalk/api/rest/OapiFinanceIdCardOcrRequest.py | hth945/pytest | 0 | 12782864 | '''
Created by auto_sdk on 2021.01.26
'''
from dingtalk.api.base import RestApi
class OapiFinanceIdCardOcrRequest(RestApi):
def __init__(self,url=None):
RestApi.__init__(self,url)
self.back_picture_url = None
self.front_picture_url = None
self.id_card_no = None
self.request_id = None
self.user_mobile = Non... | 1.898438 | 2 |
plugin/src/test/resources/refactoring/extractmethod/Comment2.before.py | consulo/consulo-python | 0 | 12782865 | <reponame>consulo/consulo-python
class Foo():
<selection>tmp = "!" #try to extract this assignmet, either with or without this comment</selection>
def bar(self):
pass | 1.46875 | 1 |
utils.py | jiuthree/speaker_recognition | 0 | 12782866 | <filename>utils.py<gh_stars>0
from scipy.io import wavfile
import soundfile as sf
#import librosa
def read_wav(fname):
signal, fs = sf.read(fname) # 这两个参数换了个位置, 第二个返回值fs代表了 音频的rate
# fs, signal = wavfile.read(fname);
print(fname)
if len(signal.shape) != 1:
print("convert stereo to mono")
... | 2.765625 | 3 |
Rozdzial_4/r4_01.py | abixadamj/helion-python | 1 | 12782867 | # program r4_01.py
# Sprawdzamy, czy mamy zainstalowane odpowiednie biblilteki zewnętrzne
# Importujemy funkcje dodatkowe
from sys import exit
from r4_functions import *
load_module_ok = True
try:
import numpy as np
ok_module_info("numpy")
except:
error_module_info("numpy")
load_module_ok = False
t... | 2.25 | 2 |
cp_homebrew_003/cp_state.py | DmitriKudryashov/setcover | 86 | 12782868 | #!/usr/bin/env python
# encoding: utf-8
from collections import defaultdict
from cp_estimator import Estimator
class State(object):
def __init__(self, estimator, set2items, item2sets,
parent=None, picked_set=None, decision=None):
# Don't use this constructor directly. Use .from_task() in... | 2.6875 | 3 |
app/display_modules/beta_div/tests/test_module.py | MetaGenScope/metagenscope-server | 0 | 12782869 | """Test suite for Beta Diversity display module."""
from app.display_modules.beta_div import BetaDiversityDisplayModule
from app.display_modules.beta_div.models import BetaDiversityResult
from app.display_modules.beta_div import MODULE_NAME
from app.display_modules.display_module_base_test import BaseDisplayModuleTest... | 2.34375 | 2 |
250_indian_movies_imdb/web1.py | Pratiknavgurukul/Web_Scraping | 6 | 12782870 | import requests,pprint,json
from bs4 import BeautifulSoup
url=requests.get("https://www.imdb.com/india/top-rated-indian-movies/?ref_=nv_mv_250_in")
soup=BeautifulSoup(url.text,"lxml")
def scrape_top_list():
tbody= soup.find("tbody",class_="lister-list")
all_movies=[]
for tr in tbody.find_all("tr"):
dic={}
d... | 3.15625 | 3 |
basis_set_exchange/convert.py | BasisSetExchange/basis_set_exchange | 4 | 12782871 | <reponame>BasisSetExchange/basis_set_exchange
# Copyright (c) 2017-2022 The Molecular Sciences Software Institute, Virginia Tech
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code mu... | 0.980469 | 1 |
validate/utils.py | oguzhanunlu/validate_json | 0 | 12782872 | # -*- coding: utf-8 -*-
import jsonschema
import sys
def clean_doc(doc):
"""
Clean given JSON document from keys where its value is None
:param doc: Pure, dirty JSON
:return: Cleaned JSON document
"""
for key, value in list(doc.items()):
if value is None:
del doc[key]
... | 2.953125 | 3 |
tests/test_degrees.py | thierrydecker/siarnaq | 0 | 12782873 | <reponame>thierrydecker/siarnaq
"""Degrees tests module.
Copyright (c) 2020 <NAME>
All Rights Reserved.
Released under the MIT license
"""
import pytest
from siarnaq.degrees import Degree
def test_instanciations():
assert isinstance(Degree(), Degree)
assert isinstance(Degree('ce'), Degree)
assert isi... | 2.5 | 2 |
External/Objects.py | Occy88/TrainSimulator | 0 | 12782874 | import os
import json
cwd=os.getcwd()
weighted_graph_dict={}
stop_dict = {}
off_stop_dict={}
with open(cwd+'/WeightedGraph','r')as f:
line = True
while line:
line = f.readline()
if line:
data = json.loads(line)
weighted_graph_dict = data
exception_dict={}
with open(cwd+... | 2.578125 | 3 |
sfn-log-export/src/functions/export_status_check/index.py | Domt301/serverless-patterns | 883 | 12782875 | <gh_stars>100-1000
import boto3
log_client = boto3.client('logs')
def handler(event, context):
task_id = event['taskId']
result = log_client.describe_export_tasks(taskId=task_id)
# per documentation, only one export can run at a time per account,
# therefore ensure none are running in this account
... | 2.203125 | 2 |
scripts.py | packetsss/Image-Editor | 6 | 12782876 | # Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
import numpy as np
import cv2
from scipy import ndimage
import math
from copy import deepcopy
class Images:
def __init__(self, img):
self.img = cv2.imread(img, 1)
if self.img.shape[0] / self.img.shape[1] ... | 2.671875 | 3 |
apps/airflow/dags/dependent_dag.py | ceelo777/k8splayground | 5 | 12782877 | from airflow import DAG
from datetime import datetime, timedelta
from airflow.operators.bash_operator import BashOperator
from airflow.sensors.external_task_sensor import ExternalTaskSensor
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2020, 6, 7),
'email_on_fai... | 2.234375 | 2 |
meteocat_api_client/xarxes/xema/mesurades.py | herrera-lu/meteocat-api-client | 0 | 12782878 | from typing import List
from ...excepcions import MeteocatLocalError
from ...helpers.utils import formateja_valors_data, neteja_diccionari, genera_info
class Mesurades:
def mesurades_x_1_variable_d_totes_estacions_o_1_estacio(
self, codi_variable: int, any: int, mes: int, dia: int, codi_estacio: str = Non... | 2.484375 | 2 |
dashboard/core/forms.py | hebergui/webtrade | 0 | 12782879 | <reponame>hebergui/webtrade
from django import forms
from .models import Employee
class EmployeeForm(forms.ModelForm):
class Meta:
model = Employee
fields = ('name', 'position', 'office', 'age', 'start_date', 'salary')
| 2.171875 | 2 |
production/rtk_trans.py | gautodev/pcb_production_test_server | 0 | 12782880 | <reponame>gautodev/pcb_production_test_server
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# File : production.py
# Author : bssthu
# Project : rtk_trans
# Description : socket 转发数据
#
import os
import sys
import json
import time
import signal
from production import log
from production.control... | 2.265625 | 2 |
src/lib/approximation/dense.py | evolutics/sparse-approximation | 0 | 12782881 | """
Minimizes D(b, Ax) for x ∈ ℝ₊^N where aₙ, b ∈ ℝ₊^M and D is a divergence.
These occur as ingredients of algorithms for the sparse case.
"""
import cvxpy
import numpy
def euclidean(A, b):
return _solve_convex(A, b, lambda p, q: cvxpy.norm2(p - q))
def total_variation(A, b):
return _solve_convex(A, b, ... | 2.90625 | 3 |
day09/shetuproject/shetuproject/spiders/start.py | Mhh123/spider | 0 | 12782882 | <reponame>Mhh123/spider
from scrapy import cmdline
cmdline.execute(['scrapy', 'crawl', 'image'])
| 1.859375 | 2 |
tools/commands/laravel.py | vertexportus/devdock | 5 | 12782883 | <gh_stars>1-10
import argparse
import re
from commands import base_command
from utils import env, file_regex_replace
class Laravel(base_command.BaseCommand):
@staticmethod
def argparse(parser, subparsers):
parser_main = subparsers.add_parser('laravel', help="runs artisan inside a laravel container")
... | 2.4375 | 2 |
api/urls.py | ferrumie/multi-pay | 0 | 12782884 | from django.urls import path
from api.authentication import CustomAuthToken
from api.views import (
ApiKeyDetail, ApiKeyView, PaymentConfirmationView, PaymentView,
RegisterUserView, TransactionList)
urlpatterns = [
# Register
path('user/register/', RegisterUserView.as_view(), name="register-user"),
... | 1.820313 | 2 |
java2s/toolbarbuttons.py | mhcrnl/PmwTkEx | 0 | 12782885 | <reponame>mhcrnl/PmwTkEx
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Utilizarea importului multiplu pt functionarea codului in Python 2 si Python3
try:
#Python 2
import Tkinter as tk
except ImportError:
#Python 3
import tkinter as tk
title = "Toolbar Buttons"
geometry = "400x400+100+100"
class Too... | 2.625 | 3 |
cryton_worker/lib/util/constants.py | slashsec-edu/cryton-worker | 0 | 12782886 | from datetime import datetime
from schema import Optional, Or
# Main queue constants
ACTION = "action"
CORRELATION_ID = "correlation_id"
DATA = "data"
RESULT_PIPE = "result_pipe"
QUEUE_NAME = "queue_name"
PROPERTIES = "properties"
HIGH_PRIORITY = 0
MEDIUM_PRIORITY = 1
LOW_PRIORITY = 2
# Processor action types
ACTION_... | 2 | 2 |
datasets/spmotif_dataset.py | Wuyxin/DIR-GNN | 34 | 12782887 | import os.path as osp
import pickle as pkl
import torch
import random
import numpy as np
from torch_geometric.data import InMemoryDataset, Data
class SPMotif(InMemoryDataset):
splits = ['train', 'val', 'test']
def __init__(self, root, mode='train', transform=None, pre_transform=None, pre_filter=None):
... | 2.21875 | 2 |
src/experiment.py | rainwangphy/cgate | 15 | 12782888 | <gh_stars>10-100
"""Experiments infrastructure.
This module contains functions with preparations for an experiment.
"""
import os
from config import cfg
def init():
r"""
Checks, if results folder has already been used and prevents overwriting of the results.
Returns:
None
"""
old, new =... | 2.515625 | 3 |
msm_pele/AdaptivePELE/freeEnergies/extendTrajectories.py | danielSoler93/msm_pele | 13 | 12782889 | <gh_stars>10-100
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import glob
import os
import re
import sys
import argparse
import ast
def parseArguments():
desc = "Program that extends trajectories.\n\
Trajectories are joined with those from which... | 2.578125 | 3 |
src/models/train_model.py | ralucaj/dtu_mlops | 0 | 12782890 | import logging
import hydra
import torch
from model import MyAwesomeModel
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks.early_stopping import EarlyStopping
from torch.utils.data import DataLoader
from src.data.mnist import CorruptedMNIST
log = logging.getLogger(__name__)
@hyd... | 2.234375 | 2 |
seraphim/util/reducible_helper.py | kluhan/seraphim | 0 | 12782891 | <gh_stars>0
from seraphim.finite_fields.polynomial import Polynomial
from seraphim.mod_arithmetics.modulare_arithmetic_efficient import RestclassEfficient
def is_reducible(polynom, p):
intmod = RestclassEfficient(1, p).get_representative()
zmodx = [Polynomial(list(reversed(x))) for x in intmod]
zero = p... | 2.890625 | 3 |
scripts/01_MEGRE/05_split_echoes.py | ofgulban/meso-MRI | 1 | 12782892 | """Split each echo to prepare for registration."""
import os
import subprocess
import numpy as np
import nibabel as nb
# =============================================================================
NII_NAMES = [
'/home/faruk/data/DATA_MRI_NIFTI/derived/sub-23/T2s/01_crop/sub-23_ses-T2s_run-01_dir-AP_part-mag_MEG... | 1.90625 | 2 |
warn_transformer/transformers/in.py | chriszs/warn-transformer | 3 | 12782893 | import typing
from datetime import datetime
from ..schema import BaseTransformer
class Transformer(BaseTransformer):
"""Transform Indiana raw data for consolidation."""
postal_code = "IN"
fields = dict(
company="Company",
location="City",
notice_date="Notice Date",
effect... | 2.6875 | 3 |
python/mbox/lego/box/block_settings_ui.py | chowooseoung/mbox | 0 | 12782894 | <filename>python/mbox/lego/box/block_settings_ui.py
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'block_settings_ui.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this ... | 2.09375 | 2 |
app/__init__.py | sd19surf/flask | 0 | 12782895 | from flask import Flask
def create_app():
app = Flask(__name__)
# register routes with app instead of current_app:
from app.main import bp as main_bp
app.register_blueprint(main_bp)
return app | 1.992188 | 2 |
newspaper_crawler/crawling_jobs/futurasciences_crawling_job.py | jeugregg/newspaper-crawler | 8 | 12782896 | <reponame>jeugregg/newspaper-crawler
from .base_crawling_job import BaseCrawlingJob
from ..spiders import FuturaSciencesSpider
class FuturaSciencesCrawlingJob(BaseCrawlingJob):
def __init__(self, has_database):
BaseCrawlingJob.__init__(self, has_database)
self.newspaper = "futura-sciences"
... | 2.640625 | 3 |
justice/parser/line_parser/abc.py | it-matters-cz/justice | 0 | 12782897 | <filename>justice/parser/line_parser/abc.py<gh_stars>0
import abc
import dateparser
class AbstractLineParser:
def parse(self, data):
parsed_date = None
parsed_data = self.parse_data(data[0])
if len(data) > 1:
parsed_date = self.parse_date(data[1])
return parsed_data, pa... | 3.34375 | 3 |
dwconv1d/__init__.py | ashishpatel26/depthwiseconv1d | 6 | 12782898 | from .depthwiseconv1d import DepthwiseConv1D
__all__ = [
'DepthwiseConv1D'
]
| 1.0625 | 1 |
graphene_django_jwt/schema/mutations.py | Speedy1991/graphene-django-jwt | 0 | 12782899 | from calendar import timegm
from django.contrib.auth import get_user_model
from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.db import transaction
import graphene
from graphene.types.generic import GenericScalar
from graphene_django_jwt import signals
from graphene_django_jwt.blackl... | 1.96875 | 2 |
My_NN.py | aaksul/Classifying-Letters-With-Perceptron-Method | 0 | 12782900 | import numpy as np
class layer():
def __init__(self,name,type,nodes_number):
self.name=name
self.type=type
self.nodes_number=nodes_number
self.input_values=np.zeros(shape=(nodes_number,1),dtype=float)##input values of nodes
self.sum_values=np.zeros(shape=(nodes_number,1),dty... | 3.203125 | 3 |
src/CTL/tensor/diagonalTensor.py | CaoRX/CTL | 11 | 12782901 | import CTL.funcs.xplib as xplib
from CTL.tensorbase.tensorbase import TensorBase
import CTL.funcs.funcs as funcs
# import numpy as np
from copy import deepcopy
from CTL.tensor.leg import Leg
from CTL.tensor.tensor import Tensor
import warnings
class DiagonalTensor(Tensor):
"""
The class for diagonal tensors,... | 2.859375 | 3 |
training_codes/train_prostate_cnn_Resnet_pretrained_SEER.py | SBU-BMI/quip_prad_cancer_detection | 1 | 12782902 | import argparse
from torchvision import transforms
import time, os, sys
from time import strftime
from sklearn.metrics import mean_squared_error, accuracy_score, hamming_loss, roc_curve, auc, f1_score, confusion_matrix
import copy
from torch.utils.data import DataLoader, Dataset
import pdb
from prostate_utils import *
... | 2.0625 | 2 |
python_scripts/calculate_training_set_size_vs_loss.py | GoldenholzLab/LPC-RCT | 0 | 12782903 | <filename>python_scripts/calculate_training_set_size_vs_loss.py<gh_stars>0
from train_keras_model import build_single_perceptron
import matplotlib.pyplot as plt
import numpy as np
import json
import os
import time
os.environ['KMP_DUPLICATE_LIB_OK']='True'
def create_model_and_load_training_data(training_data_dir,
... | 2.65625 | 3 |
thread_queue_tests/test_queue_not_empty_exception.py | timmartin19/thread-queue | 0 | 12782904 | <reponame>timmartin19/thread-queue
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from thread_queue import QueueNotEmptyException, ThreadTaskException
class TestQueueNotEmptyException(unittest.TestC... | 2.890625 | 3 |
app.py | Varigarble/twin-atom | 0 | 12782905 | <gh_stars>0
from pprint import pprint
from flask import Flask, render_template, request
import database
app = Flask(__name__)
@app.route('/')
def index():
return render_template('layout.html')
@app.route('/tasks_entry.html', methods=['GET', 'POST'])
def tasks_entry():
name = None
creators = None
desc... | 2.453125 | 2 |
src/svm/gm/preprocessing.py | aramis-lab/pac2019 | 3 | 12782906 | """File with the preprocessing tools."""
import os
import numpy as np
import nibabel as nib
import pandas as pd
from tqdm import tqdm
from sklearn.metrics import pairwise_distances
from sklearn.metrics.pairwise import linear_kernel
# Change this path
path = '' # folder containing the gray-matter maps
# Folders wi... | 2.28125 | 2 |
climate/core/menu.py | FidelElie/cliMate | 0 | 12782907 | """
"""
import sys
import itertools
from climate.lib import mapper
from climate.lib import utilities
from climate.lib import inquirers
from climate.lib.inquirers import INQUIRER_TABLE
from climate.lib.converters import CONVERSION_TABLE
from climate.lib.converters import map_int, map_float, map_bool, map_list
from . i... | 2.4375 | 2 |
src/obj/pendulum.py | jesuscfv/friction_less | 0 | 12782908 | <gh_stars>0
import numpy as np
import math
from . import physicalobject, definitions as defs, resources, rungekutta
class Pendulum(physicalobject.PhysicalObject):
def __init__(self, phi=0.7854, length=1.0, x_h=1.0, y_h=1.0, *args, **kwargs):
image = resources.get_resource(defs.PENDULUM_IMAGE)
sup... | 2.671875 | 3 |
backend/posts/views.py | shakib609/django-redis-blog | 0 | 12782909 | from django.conf import settings
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticatedOrReadOnly, IsAdminUser
from re... | 2.015625 | 2 |
m_kplug/model/kplug_dataset.py | WaveLi123/m-kplug | 2 | 12782910 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
import random
import math
import logging
import itertools
from fairseq import utils
from fairseq.data import ... | 1.953125 | 2 |
src/hfts_grasp_planner/core.py | malwaru/hfts_grasp_planner | 3 | 12782911 | #! /usr/bin/python
import numpy as np
import math
from scipy.spatial import KDTree
import openravepy as orpy
import transformations
from robotiqloader import RobotiqHand, InvalidTriangleException
import sys, time, logging, copy
import itertools
from utils import ObjectFileIO, clamp, compute_grasp_stability, normal_dis... | 2.09375 | 2 |
tests/test_bootstrap.py | initOS/dob-lib | 0 | 12782912 | # © 2021 <NAME> (initOS GmbH)
# License Apache-2.0 (http://www.apache.org/licenses/).
import os
from queue import Empty
from unittest import mock
import pytest
from doblib.bootstrap import BootstrapEnvironment, aggregate_repo
def aggregate_exception(repo, args, sem, err_queue):
try:
err_queue.put_nowai... | 2.125 | 2 |
api/urls.py | horbenko/web | 0 | 12782913 | from django.conf.urls import url
from django.http import HttpResponseRedirect
from .views import PostCreate, PostUpdate, PostDelete, ProfileView
app_name = 'api'
urlpatterns = [
url(r'^$', lambda r: HttpResponseRedirect('new/'), name='index'),
url(r'^(?P<pk>[0-9]+)/$', PostUpdate.as_view(), name='update'),
... | 1.796875 | 2 |
spreedly/forms.py | guitarparty/django-spreedly | 2 | 12782914 | import uuid
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.transl... | 2.265625 | 2 |
controllers/feed.py | Dans-labs/shebanq | 24 | 12782915 | <filename>controllers/feed.py<gh_stars>10-100
from textwrap import dedent
from markdown import markdown
from helpers import hEsc, sanitize, isodt
from urls import Urls
from queryrecent import QUERYRECENT
def atom():
"""Serves an RSS feed of recently saved shared queries.
See also [M:QUERYRECENT][queryrecent... | 2.703125 | 3 |
tests/lupin/validators/test_in.py | Clustaar/lupin | 22 | 12782916 | import pytest
from lupin.errors import InvalidIn
from lupin.validators import In
@pytest.fixture
def validator():
return In({1, 2, 3})
class TestCall(object):
def test_raise_error_if_invalid_value(self, validator):
with pytest.raises(InvalidIn):
validator(4, [])
def test_does_nothi... | 2.515625 | 3 |
rsvp_language/rsvp_language_protocol/langexpy_script/order.py | thomasbazeille/public_protocols | 3 | 12782917 | # -*- coding: utf-8 -*-
import os
import csv
import dirfiles
def trial_order(order_directory):
"""
Reads a specific trial order for n blocks from n csv files and
returns n lists to be used by the object block_list.order_trials()
of Expyriment library
"""
# Define the pathway of the inputs dir... | 3.453125 | 3 |
examples/render_test.py | markreidvfx/pct_titles | 0 | 12782918 | import pct_titles
import os
import cythonmagick
from StringIO import StringIO
def escape(s):
s = s.replace("&", "\&")
s = s.replace("<", "\<")
s = s.replace(">", ">")
s = s.replace('"', """)
s = s.replace("'", ''')
return s
def convert_color(c, alpha):
a = 1.0 - (alpha ... | 2.34375 | 2 |
website/hello.py | simonra/Distributed_Raspberry-Pi_Computing | 0 | 12782919 | import os
from flask import Flask, request, redirect, url_for, render_template, send_from_directory
from werkzeug import secure_filename
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = set(['m'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['MAX_CONTENT_LENGTH'] = 16*1024*1024
def al... | 2.53125 | 3 |
polybookexchange/models.py | maltherd/polybookexchange | 0 | 12782920 | from django.db import models
from django.db.models import Min
import requests
import isbnlib
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
from django.templatetags.static import static
from django.conf import settings
import datetime
from django.utils.timezone import now
cla... | 2.15625 | 2 |
portfolio/Python/scrapy/kalahari/takealot.py | 0--key/lib | 0 | 12782921 | import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import csv
from product_spiders.items import Produc... | 2.703125 | 3 |
common/instruments/instrument.py | codestetic/optionworkshop | 0 | 12782922 | <gh_stars>0
# -*- coding: utf-8 -*-
from datetime import datetime
import numpy as np
from common.instruments.option_type import *
month_codes = {
1: "F",
2: "G",
3: "H",
4: "J",
5: "K",
6: "M",
7: "N",
8: "Q",
9: "U",
10: "V",
11: "X",
12: "Z"
}
class Instrument:
... | 2.359375 | 2 |
main/migrations/0001_initial.py | xn1990/B10 | 0 | 12782923 | <reponame>xn1990/B10
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-29 11:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 1.734375 | 2 |
discord/ext/voice_recv/common/__init__.py | schlopp/Novus | 61 | 12782924 | <reponame>schlopp/Novus
# -*- coding: utf-8 -*-
from .rtp import *
| 1.09375 | 1 |
webapp/ansible/roles/webapp/files/webapp/app/form.py | iganari/hisucon2018 | 4 | 12782925 | <filename>webapp/ansible/roles/webapp/files/webapp/app/form.py
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired
class LoginForm(FlaskForm):
name = StringField('Name', validators=[DataRequired()])
password = Pa... | 1.890625 | 2 |
All_Source_Code/GatherData/GatherData_10.py | APMonitor/pds | 11 | 12782926 | <filename>All_Source_Code/GatherData/GatherData_10.py<gh_stars>10-100
f = open('dx.csv', 'r')
print(f.readline())
print(f.readline())
print(f.readline())
f.close() | 1.875 | 2 |
tests/cash_service_test_case.py | odeoteknologi/odeo-python-sdk | 0 | 12782927 | import json
import unittest
import odeo.client
from odeo.exceptions import GeneralError, InputValidationError
from odeo.models.cash import *
from tests.service_test_case import ServiceTestCase
class CashServiceTestCase(ServiceTestCase):
def test_create_bulk_transfers(self):
self.adapter.register_uri(
... | 2.546875 | 3 |
scripts/python_lib/calpha_distance_map.py | sambitmishra0628/PSP-GNM | 0 | 12782928 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 1 16:33:02 2018
@author: <NAME>
"""
# Calculate the distance map between the C-alpha atoms in a protein. The input
# file is required to be a C_alpha coordinate file
import sys
import re
import numpy as np
import matplotlib.pyplot as plt
def ge... | 3.296875 | 3 |
setup.py | MiltFra/discord-exchange | 0 | 12782929 | from setuptools import setup
setup(
name='discord-exchange',
version='0.0.1',
description='A Discord bot to trade on arbitrary quantities',
url='https://github.com/miltfra/discord-exchange',
author='<NAME>',
author_email='<EMAIL>',
license='Apache License 2.0',
packages=['discord_exchan... | 1.265625 | 1 |
huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/query_vmr_pkg_res_result_dto.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 1 | 12782930 | # coding: utf-8
import pprint
import re
import six
class QueryVmrPkgResResultDTO:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the ... | 2.40625 | 2 |
test/dataloadertest.py | iseesaw/EAlib | 4 | 12782931 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-09-22 00:54:06
# @Author : <NAME> (<EMAIL>)
# @Link : https://github.com/iseesaw
# @Version : $Id$
import os
from EAlib.utils.dataloader import BasicLoader
def BasicLoaderTest():
import os
dirpath = "D:\\ACourse\\2019Fall\\Evoluti... | 2.046875 | 2 |
model.py | xinjli/tflstm2np | 1 | 12782932 | <filename>model.py
import numpy as np
def lstm_cell(input_tensor, prev_hidden_tensor, prev_cell_state, kernel, bias):
"""
forward inference logic of a lstm cell
reference: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/rnn/python/ops/lstm_ops.py
:param input_tensor: input tens... | 3.1875 | 3 |
autogalaxy/pipeline/phase/dataset/__init__.py | jonathanfrawley/PyAutoGalaxy_copy | 0 | 12782933 | <gh_stars>0
from autogalaxy.pipeline.phase.dataset.analysis import Analysis
from autogalaxy.pipeline.phase.dataset.meta_dataset import MetaDataset
from autogalaxy.pipeline.phase.dataset.result import Result
from .phase import PhaseDataset
| 1.078125 | 1 |
game.py | projeto-de-algoritmos/Trabalho_1_Graph_game | 0 | 12782934 | <filename>game.py
import pygame
import math
from pygame.locals import *
from screens import Menu
from screens import Question
from screens import Answer
from screens import Info
from screens import CreateLevel
from screens import Finish
from screens import SelectTam
class Game:
# Game constants
WIDTH = 1024
... | 3.21875 | 3 |
test/test_cores/test_video/mm_lt24lcdsys.py | meetps/rhea | 1 | 12782935 | <reponame>meetps/rhea<gh_stars>1-10
import myhdl
from myhdl import Signal, intbv
from rhea.system import Global, Clock, Reset
from rhea.cores.video import VideoMemory
from rhea.cores.video import color_bars
from rhea.cores.video.lcd import LT24Interface
from rhea.cores.video.lcd import lt24lcd
from rhea.cores.misc im... | 2.015625 | 2 |
urls.py | 0x0mar/PyDetector | 1 | 12782936 | from django.conf.urls import patterns, include, url
from pydetector.views import hello
from pydetector.views2 import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^logs/$', logs),
# Examples:
url(r'^$', welcome)... | 1.953125 | 2 |
nova/tests/functional/test_images.py | lixiaoy1/nova | 1 | 12782937 | # 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
# d... | 1.796875 | 2 |
tests/test.py | dirkmcpherson/gym-novel-gridworlds | 2 | 12782938 | <reponame>dirkmcpherson/gym-novel-gridworlds
import time
import gym
import gym_novel_gridworlds
from gym_novel_gridworlds.wrappers import SaveTrajectories, LimitActions
from gym_novel_gridworlds.observation_wrappers import LidarInFront, AgentMap
from gym_novel_gridworlds.novelty_wrappers import inject_novelty
from st... | 2.21875 | 2 |
cnn_model/unet.py | WangSong960913/CraterDetection | 5 | 12782939 | from keras.models import Model
from keras.optimizers import Adam, SGD
from keras.layers.core import Dropout, Reshape
from keras.layers import PReLU, Conv2DTranspose
from keras.layers import Input, Dense, Dropout, LeakyReLU, BatchNormalization, Conv2D, MaxPooling2D, AveragePooling2D, \
concatenate, Activation, ZeroP... | 2.53125 | 3 |
CSD_API/REFCODEs_to_CIFs.py | andrewtarzia/cage_collect | 0 | 12782940 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Distributed under the terms of the MIT License.
"""
Script to convert list of REFCODEs into CIFs.
No constraints are applied.
Author: <NAME>
Date Created: 12 May 2019
"""
import ccdc.io
import sys
import CSD_f
def main():
if (not len(sys.argv) == 4):
pr... | 2.90625 | 3 |
bookworm/search/templatetags/results.py | srilatha44/threepress | 2 | 12782941 | <gh_stars>1-10
import logging
from lxml import etree
from lxml.html import soupparser
from django import template
log = logging.getLogger('library.templatetags')
register = template.Library()
@register.inclusion_tag('includes/result.html', takes_context=True)
def display_result(context, htmlfile, search_term):
... | 2.65625 | 3 |
app/models/message.py | Info-ag/labplaner | 7 | 12782942 | from datetime import datetime
from app.models import db
__all__ = ['Message']
class Message(db.Model):
"""Message
Messages only have an author. They are either connected to a working
group (AG) or to an individual user (recepient).
:param id:
:param message:
:param time:
:param author... | 2.921875 | 3 |
webapp/__init__.py | Copyrighted/portfolio | 0 | 12782943 | <filename>webapp/__init__.py
from flask import Flask
from flask_mail import Mail
from flaskext.markdown import Markdown
from webapp.config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bootstrap import Bootstrap
from flask_wtf.csrf import CSRFProtect
from flask_mi... | 2.28125 | 2 |
utils/ply_utils.py | WeberSamuel/MonoRecPL | 0 | 12782944 | <filename>utils/ply_utils.py
from array import array
import torch
from monorec.model.layers import Backprojection
class PLYSaver(torch.nn.Module):
def __init__(self, height, width, min_d=3, max_d=400, batch_size=1, roi=None, dropout=0):
super(PLYSaver, self).__init__()
self.min_d = min_d
... | 2.4375 | 2 |
code_week9_622_628/pattern_matching_lcci.py | dylanlee101/leetcode | 0 | 12782945 | <reponame>dylanlee101/leetcode
'''
你有两个字符串,即pattern和value。 pattern字符串由字母"a"和"b"组成,用于描述字符串中的模式。例如,字符串"catcatgocatgo"匹配模式"aabab"(其中"cat"是"a","go"是"b"),该字符串也匹配像"a"、"ab"和"b"这样的模式。但需注意"a"和"b"不能同时表示相同的字符串。编写一个方法判断value字符串是否匹配pattern字符串。
示例 1:
输入: pattern = "abba", value = "dogcatcatdog"
输出: true
示例 2:
输入: pattern = "abba"... | 3.359375 | 3 |
my_project/init_ephys.py | ttngu207/u24-example-ephys-pipeline | 0 | 12782946 | import datajoint as dj
from djsubject import subject
from djlab import lab
from djephys import ephys
from my_project.utils import get_ephys_probe_data_dir, get_ks_data_dir
# ============== Declare "lab" and "subject" schema ==============
lab.declare('u24_lab')
subject.declare('u24_subject',
dependen... | 2.171875 | 2 |
cowin_appointment_check.py | Bharys/India-Covid-Vaccination-Alert | 1 | 12782947 | <gh_stars>1-10
import requests
import datetime,pprint,time
import smtplib, ssl
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
curr_date = datetime.date.today().strftime('%d-%m-%Y')
mys_restricted_pin = [
570008,571186,570026,570020,570004,570010,570004,570001,570013,570007,57000... | 2.03125 | 2 |
daedalus_data_dictionary/storage/urls.py | aristotle-mdr/daedalus-data-dictionary | 0 | 12782948 | from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from aristotle_mdr.contrib.generic.views import GenericAlterOneToManyView, generic_foreign_key_factory_view
from daedalus_data_dictionary.storage import models
urlpatterns = [
url(r'^dictionary/(?P<iid>\d+)?/edit/?$',
... | 1.804688 | 2 |
eeggan/pytorch/modules/weights/weight_scaling.py | kahartma/eeggan | 3 | 12782949 | # coding=utf-8
# Author: <NAME> <<EMAIL>>
import numpy as np
from torch import nn
from torch.nn import Parameter
from eeggan.pytorch.modules.conv.multiconv import MultiConv1d
class WeightScale(object):
"""
Implemented for PyTorch using WeightNorm implementation
https://pytorch.org/docs/stable/_modules... | 2.59375 | 3 |
tracer/tracer.py | zachbateman/tracer | 0 | 12782950 | '''
Module containing Tracer metaclass and associated trace decorator.
'''
from types import FunctionType
from functools import wraps
import traceback
from pprint import pprint
import sys
class Tracer(type):
def __new__(cls, name, bases, cls_dct):
wrapped_cls_dct = {}
for attribute_name, attribute... | 2.609375 | 3 |