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
python/src/main/python/pygw/query/aggregation_query_builder.py
radiant-maxar/geowave
280
21900
<reponame>radiant-maxar/geowave # # Copyright (c) 2013-2020 Contributors to the Eclipse Foundation # # See the NOTICE file distributed with this work for additional information regarding copyright # ownership. All rights reserved. This program and the accompanying materials are made available # under the terms of the ...
2.125
2
tests/test_cells.py
nclarey/pyg-base
0
21901
<filename>tests/test_cells.py from pyg_base import acell, cell, cell_func, dictattr, dt, getargspec, passthru, add_, get_cache from pyg_base._cell import cell_output, cell_item, cell_inputs, _updated import pytest from pyg_base import * def test_cell(): c = cell(lambda a:a+1) assert cell_output(c) == ['data']...
2.484375
2
uwsgi/unacc/poc.py
nobgr/vulhub
9,681
21902
#!/usr/bin/python # coding: utf-8 ###################### # Uwsgi RCE Exploit ###################### # Author: <EMAIL> # Created: 2017-7-18 # Last modified: 2018-1-30 # Note: Just for research purpose import sys import socket import argparse import requests def sz(x): s = hex(x if isinstance(x, int) else len(x))[2...
2.546875
3
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/dark_lang/views.py
osoco/better-ways-of-thinking-about-software
3
21903
""" Views file for the Darklang Django App """ from django.contrib.auth.decorators import login_required from django.http import Http404 from django.shortcuts import redirect from django.template.loader import render_to_string from django.utils.decorators import method_decorator from django.utils.translation import L...
2.078125
2
pipenv/vendor/vistir/spin.py
erikkemperman/pipenv
3
21904
<gh_stars>1-10 # -*- coding=utf-8 -*- import functools import os import signal import sys import threading import time import colorama import cursor import six from .compat import to_native_string from .termcolors import COLOR_MAP, COLORS, colored, DISABLE_COLORS from io import StringIO try: import yaspin excep...
1.929688
2
book/book/settings.py
ChaosSoong/ScrapyDouban
1
21905
#!/usr/bin/env python # -*- coding: utf-8 -*- BOT_NAME = 'book' SPIDER_MODULES = ['book.spiders'] NEWSPIDER_MODULE = 'book.spiders' IMAGES_STORE = '../storage/book/' COOKIES_ENABLED = True COOKIE_DEBUG = True LOG_LEVEL = 'INFO' # LOG_LEVEL = 'DEBUG' CONCURRENT_REQUESTS = 100 CONCURRENT_REQUESTS_PER_DOMAIN = 1000 U...
1.703125
2
tests/pyxl_original/test_eof.py
adrienbrunet/mixt
27
21906
<filename>tests/pyxl_original/test_eof.py # coding: mixt from mixt import html def test(): assert str(<Fragment>'''</Fragment>) == """'''"""
1.929688
2
text_analysis/analysis_classify/a01_basic_statistics.py
yongzhuo/Text-Analysis
3
21907
# !/usr/bin/python # -*- coding: utf-8 -*- # @time : 2020/5/27 21:18 # @author : Mo # @function: 统计 from text_analysis.utils.text_common import txt_read, txt_write, load_json, save_json, get_all_dirs_files from text_analysis.conf.path_log import logger from collections import Counter from typing import List, Dict...
2.453125
2
components/workstation.py
cqzhao/FooProxy
0
21908
#coding:utf-8 """ @author : linkin @email : <EMAIL> @date : 2018-10-04 """ import logging from APIserver.apiserver import app from components.collector import Collector from components.validator import Validator from components.detector import Detector from components.scanner import Sc...
2.3125
2
ml/rbms/core.py
torfjelde/ml
0
21909
import abc import logging from enum import Enum from tqdm import tqdm from ml import np from ml.functions import sigmoid, dot_batch, bernoulli_from_probas _log = logging.getLogger("ml") class UnitType(Enum): GAUSSIAN = 1 BERNOULLI = 2 class RBMSampler(object): """Sampler used in training of RBMs for e...
3.09375
3
Ports.py
bullgom/pysnn2
0
21910
<reponame>bullgom/pysnn2 AP = "AP" BP = "BP" ARRIVE = "ARRIVE" NEUROMODULATORS = "NEUROMODULATORS" TARGET = "TARGET" OBSERVE = "OBSERVE" SET_FREQUENCY = "SET_FREQUENCY" DEACTIVATE = "DEACTIVATE" ENCODE_INFORMATION = "ENCODE_INFORMATION"
1.320313
1
src/oolongt/cli/cli.py
schmamps/textteaser
2
21911
<reponame>schmamps/textteaser """Command line interface for OolongT""" import argparse import os import sys import typing from textwrap import wrap as wrap_text from ..constants import DEFAULT_LENGTH from ..content import Document from ..files import get_document from ..string import simplify from ..typings import Opt...
2.640625
3
chotgun.py
hmatsuya/chotgun
1
21912
<gh_stars>1-10 import sys import os.path import threading import queue import logging import random import copy from paramiko.client import SSHClient import paramiko import re import time import os class USIEngine: def __init__(self, name, host, engine_path, nodes=None, multiPV=1, threads=1, ...
2.09375
2
source/base/utils.py
phygitalism/points2surf
4
21913
<gh_stars>1-10 import numpy as np import os from source.base import utils_mp from source.base import file_utils def cartesian_dist(vec_x: np.array, vec_y: np.array, axis=1) -> np.ndarray: dist = np.linalg.norm(vec_x - vec_y, axis=axis) return dist def batch_quat_to_rotmat(q, out=None): """ quaterni...
2.265625
2
contact/views.py
rsHalford/xhalford-django
2
21914
from django.shortcuts import render from django.views.generic import ListView from contact.models import Profile class Contact(ListView): model = Profile template_name = "contact.html"
1.507813
2
xbbo/surrogate/gaussian_process.py
zhanglei1172/bbobenchmark
2
21915
<reponame>zhanglei1172/bbobenchmark from typing import List import typing from scipy import optimize import sklearn # from sklearn.gaussian_process import kernels from sklearn.gaussian_process.kernels import Kernel, KernelOperator # import torch # from scipy.linalg import solve_triangular, cholesky # from scipy import ...
2.203125
2
lib/training/tpu.py
learning-at-home/dalle
0
21916
import ctypes import threading from functools import partial from contextlib import nullcontext from copy import deepcopy import multiprocessing as mp from itertools import zip_longest from typing import Iterable import torch import torch.nn as nn import torch.utils.data import torch_xla.core.xla_model as xm import to...
2.046875
2
code/evaluate.py
xuyangcao/SegWithDistMap
3
21917
<gh_stars>1-10 import numpy as np import os import argparse import tqdm import pandas as pd import SimpleITK as sitk from medpy import metric def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--file_path', type=str, default='./results/abus_roi/0108_dice_1/') args = parser.parse_ar...
2.3125
2
integraph/core/__init__.py
nleguillarme/inteGraph
0
21918
<filename>integraph/core/__init__.py from .taxid import TaxId from .uri import URIManager, URIMapper
1.15625
1
unit_tests/test_swift_storage_context.py
coreycb/charm-swift-storage
0
21919
<reponame>coreycb/charm-swift-storage # Copyright 2016 Canonical 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 app...
1.875
2
spiketoolkit/validation/quality_metric_classes/noise_overlap.py
ferchaure/spiketoolkit
0
21920
import numpy as np from copy import copy from .utils.thresholdcurator import ThresholdCurator from .quality_metric import QualityMetric import spiketoolkit as st import spikemetrics.metrics as metrics from spikemetrics.utils import printProgressBar from collections import OrderedDict from sklearn.neighbors import Neare...
2.359375
2
lib/spider/NewsSpider1.py
ardegra/standard.api
0
21921
<reponame>ardegra/standard.api import json import pymongo import falcon from bson import json_util class NewsSpider1: def __init__(self, **kwargs): self.name = kwargs.get("name", None) self.country = kwargs.get("country", None) self.category = kwargs.get("category", None) self.entryDateParser = kw...
2.578125
3
core/global_registration.py
MichaelArbel/OT-sync
2
21922
# Open3D: www.open3d.org # The MIT License (MIT) # See license file or visit www.open3d.org for details # examples/Python/Advanced/global_registration.py import open3d as o3d import numpy as np import copy def draw_registration_result(source, target, transformation): source_temp = copy.deepcopy(source) targ...
2.171875
2
src/get_test_results.py
williamdjones/deep_protein_binding
0
21923
import os import argparse import pandas as pd import numpy as np from sklearn.metrics import f1_score, r2_score from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument("--exp_dir", type=str, help="path to directory containing test results", default="/scratch/wdjo224/deep_protei...
2.484375
2
analysis/Leo/scripts/__init__.py
data301-2020-winter2/course-project-group_1039
1
21924
<filename>analysis/Leo/scripts/__init__.py import scripts.project_functions
0.957031
1
align/pnr/write_constraint.py
ALIGN-analoglayout/ALIGN-public
119
21925
<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 13 14:50:24 2021 @author: kunal001 """ import pathlib import pprint import json import logging from ..schema import constraint logger = logging.getLogger(__name__) pp = pprint.PrettyPrinter(indent=4) class PnRConstraintWriter: ...
2.3125
2
ch02/number_eight.py
joy-joy/pcc
0
21926
<filename>ch02/number_eight.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 9 00:00:43 2018 @author: joy """ print(5 + 3) print(9 - 1) print(2 * 4) print(16//2)
2.296875
2
tests/test_git_factory.py
kostya0shift/SyncToGit
1
21927
import os from contextlib import ExitStack from pathlib import Path import pytest from synctogit.git_factory import GitError, git_factory def remotes_dump(remote_name, remote): # fmt: off return ( "%(remote_name)s\t%(remote)s (fetch)\n" "%(remote_name)s\t%(remote)s (push)" ) % locals() ...
2.234375
2
pychron/fractional_loss_calculator.py
ASUPychron/pychron
31
21928
# =============================================================================== # Copyright 2019 ross # # 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/LICE...
2.203125
2
chatrooms/mixer/thread.py
Dogeek/ChatAggregator
3
21929
<reponame>Dogeek/ChatAggregator import asyncio import threading from .connection import MixerConnection from .utils import get_channel_id from chatrooms import lock class MixerThread(threading.Thread): def __init__(self, **kwargs): super().__init__() self.channel_id = get_channel_id(kwargs.pop("ch...
2.4375
2
test/py.py
PhilipDeegan/mkn
61
21930
#! /usr/bin/python3 print("HELLO PYTHON")
1.695313
2
proxy_config.py
Nou4r/YandexMail-Account-Creator
1
21931
try: with open('proxies.txt', 'r') as file: proxy = [ line.rstrip() for line in file.readlines()] except FileNotFoundError: raise Exception('Proxies.txt not found.')
2.859375
3
src/notifications/middleware.py
MAE776569/project-manager
0
21932
<reponame>MAE776569/project-manager from .models import NotificationManager from django.utils.deprecation import MiddlewareMixin class NotificationMiddleware(MiddlewareMixin): def process_request(self, request): if request.user.is_authenticated: notif_id = request.GET.get('notif_id', None) ...
2.109375
2
tests/test_prns.py
mfkiwl/laika-gnss
365
21933
<gh_stars>100-1000 import unittest from laika.helpers import get_constellation, get_prn_from_nmea_id, \ get_nmea_id_from_prn, NMEA_ID_RANGES SBAS_DATA = [ ['S01', 33], ['S02', 34], ['S10', 42], ['S22', 54], ['S23', 55], ['S32', 64], ['S33', 120], ['S64', 151...
2.046875
2
amt_tools/transcribe.py
cwitkowitz/transcription-models
4
21934
<filename>amt_tools/transcribe.py # Author: <NAME> <<EMAIL>> # My imports from . import tools # Regular imports from abc import abstractmethod from copy import deepcopy import numpy as np import os def filter_notes_by_duration(pitches, intervals, threshold=0.): """ Remove notes from a collection which have...
2.90625
3
ToDoApp/admin.py
aishabazylzhanova/ToDo
0
21935
<filename>ToDoApp/admin.py<gh_stars>0 from django.contrib import admin from .models import Tasks admin.site.register(Tasks) # Register your models here.
1.34375
1
dilami_calendar/constants.py
Jangal/python-deylami-calendar
12
21936
DILAMI_WEEKDAY_NAMES = { 0: "شمبه", 1: "یکشمبه", 2: "دۊشمبه", 3: "سۊشمبه", 4: "چارشمبه", 5: "پئنشمبه", 6: "جۊمه", } DILAMI_MONTH_NAMES = { 0: "پنجيک", 1: "نؤرۊز ما", 2: "کۊرچ ٚ ما", 3: "أرئه ما", 4: "تیر ما", 5: "مۊردال ما", 6: "شریرما", 7: "أمیر ما", 8: ...
1.257813
1
inputs/sineClock.py
hongaar/ringctl
0
21937
import math from inputs.sine import Sine from inputs.timeElapsed import TimeElapsed from utils.number import Number class SineClock(Number): def __init__(self, sine: Sine): self.__sine = sine self.__elapsed = TimeElapsed() def get(self): return self.__sine.at_time(self.__elapsed.get(...
2.640625
3
config/urls.py
erik-sn/tagmap
0
21938
<reponame>erik-sn/tagmap from django.conf import settings from django.conf.urls import url, include from django.contrib import admin from api.views import index urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^api/', include('api.urls')), ] # troubleshooting tool if settings.TOOLBAR: import debug...
2.15625
2
run.py
tdavislab/mapper-stitching
10
21939
<gh_stars>1-10 #!flask/bin/python from app import app app.run(host='127.0.0.1',port=8080,debug=True)
1.773438
2
middleware.py
jaylett/django_audited_model
1
21940
<reponame>jaylett/django_audited_model # Copyright (c) 2009 <NAME> <http://tartarus.org/james/computers/django/> # # 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, includ...
1.898438
2
data_attributes.py
prise-3d/Thesis-NoiseDetection-metrics
0
21941
# main imports import numpy as np import sys # image transform imports from PIL import Image from skimage import color from sklearn.decomposition import FastICA from sklearn.decomposition import IncrementalPCA from sklearn.decomposition import TruncatedSVD from numpy.linalg import svd as lin_svd from scipy.signal impo...
2.28125
2
pythonVersion/interpolateMetm.py
oradules/Deconvolution_short_long
1
21942
<filename>pythonVersion/interpolateMetm.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 11 21:36:32 2021 @author: rachel """ import numpy as np from scipy import interpolate import matplotlib.pyplot as plt def interpolateMetm(uxsg, ufsg, uxl, ufl, m, M, fact1, fact2): #%%%%% interpolate o...
2.640625
3
mad_scientist_lab/histogram.py
wusui/squidly_dorkle
0
21943
<gh_stars>0 import os import sys import codecs import itertools sys.stdout = codecs.getwriter('utf=8')(sys.stdout.buffer) sys.stderr = codecs.getwriter('utf=8')(sys.stderr.buffer) fname = os.sep.join(["D:", "Users", "Warren", "python3", "squirrels_on_caffeine", "src", "sedecordle", ...
3.046875
3
app/jobHistory/migrations/0003_auto_20190804_1403.py
stephengtuggy/job-history
2
21944
# Generated by Django 2.2.4 on 2019-08-04 21:03 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('jobHistory', '0002_auto_20190106_0202'), ] operations = [ migrations.AlterField( model_name='em...
1.664063
2
Messaging/Packets/Server/Home/LobbyInfoMessage.py
Kuler2006/BSDS-V40
4
21945
from Logic.Data.DataManager import Writer from Logic.Client.ClientsManager import ClientsManager class LobbyInfoMessage(Writer): def __init__(self, client, player): super().__init__(client) self.id = 23457 self.client = client self.player = player def encode(self): self...
2.46875
2
article/views.py
TianyongWang/TyBlog
0
21946
<reponame>TianyongWang/TyBlog from django.shortcuts import render from django.http import HttpResponse from article.models import Article from datetime import datetime # Create your views here. def home(request): post_list = Article.objects.all() #获取全部的Article对象 return render(request, 'home.html', {'post_list...
2.40625
2
PythonExercicios/ex067.py
Luis-Emanuel/Python
0
21947
#Faça um programa que mostre a tabuada de vários números, um de cada vez, para cada valor digitado pelo usuário. #O programa será interronpido quando o número solicitado for negativo. c = 0 while True: print(30*'-') num = int(input('Quer ver a tabuada de qual valor ?')) print(30*'-') if num < 0: ...
3.875
4
examples/src/python/bolt/half_ack_bolt.py
takeratta/heron
1
21948
#!/usr/bin/env python # -*- encoding: utf-8 -*- # copyright 2016 twitter. 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...
2.40625
2
projects/cassava-leaf-disease/code/src/config.py
dric2018/coding-room
1
21949
<filename>projects/cassava-leaf-disease/code/src/config.py import os class Config: data_dir = os.path.abspath('../data/input/') models_dir = os.path.abspath('../models') logs_dir = os.path.abspath('../logs') train_data_dir = os.path.abspath('../data/input/train_images') test_data_dir = os.path.abs...
1.65625
2
midburn/migrations/0007_auto_20160116_0902.py
mtr574/projectMidbrunFirstReg
0
21950
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('midburn', '0006_auto_20160116_0842'), ] operations = [ migrations.AlterField( model_name='camp', ...
1.59375
2
win/test_ddg.py
janakhpon/PersonalAssistant
0
21951
from bs4 import BeautifulSoup import requests text = input("text : ") text.replace(" ", "+") params = {"q": text} content = requests.get("https://duckduckgo.com/?q=", params=params) soup = BeautifulSoup(content.text, 'html.parser') res = soup.find_all('div', class_="result__snippet js-result-snippet") for r in res: ...
3.296875
3
experiments/scripts/third_party/roll_q/roll_q.py
AnonymousALifer/primordium
0
21952
import sys #### CONFIG OPTIONS # replicates = 50 #Will be dynamically determined roll_q_dir = './' if len(sys.argv) < 2: print('Must pass one argument, the number of jobs in the queue!') exit(-1) jobs_in_queue = int(sys.argv[1]) if len(sys.argv) >= 3: roll_q_dir = sys.argv[2] do_resub = True if le...
2.71875
3
prplatform/exercises/migrations/0002_auto_20180508_1200.py
piehei/prplatform
3
21953
<gh_stars>1-10 # Generated by Django 2.0.4 on 2018-05-08 12:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('courses', '0013_auto_20180426_0754'), ('exercises', '0001_initial'), ] operations = [ migrations.RenameModel( old...
1.492188
1
spirit/utils/paginator/infinite_paginator.py
rterehov/Spirit
0
21954
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import Http404 from infinite_scroll_pagination.paginator import SeekPaginator, EmptyPage def paginate(request, query_set, lookup_field, per_page=15, page_var='value'): # TODO: remove page_pk = request.GET.get(page_var, None) ...
2.34375
2
lib/exaproxy/configuration.py
oriolarcas/exaproxy
124
21955
<gh_stars>100-1000 # encoding: utf-8 """ configuration.py Created by <NAME> on 2011-11-29. Copyright (c) 2011-2013 Exa Networks. All rights reserved. """ # NOTE: reloading mid-program not possible import os import sys import logging import pwd import math import socket import struct _application = None _config = ...
2.03125
2
timo/exception.py
Minsoo-web/TIMO
0
21956
<filename>timo/exception.py from typing import AnyStr from typing import NoReturn class Error(Exception): """ This is the basis of all errors.\n Basically the same as Exception. """ def __init__(self, msg: AnyStr) -> NoReturn: self.msg: str = msg def __str__(self) -> str: ret...
3.1875
3
scikit/Adaboost/example.py
JayMiao/MLAction
1
21957
<gh_stars>1-10 # -*- coding: utf-8 -*- from sklearn.datasets import load_iris from sklearn.model_selection import cross_val_score from sklearn.ensemble import AdaBoostClassifier iris = load_iris() clf = AdaBoostClassifier(n_estimators=1000) scores = cross_val_score(clf, iris.data, iris.target) print scores.mean()
2.4375
2
main.py
jg-fisher/indeed-bot
9
21958
<gh_stars>1-10 import os import sys import time from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys class IndeedBot: def __init__(self): """ Initilializes the Chrome webdriver. Sets the ...
2.984375
3
biobb_adapters/pycompss/biobb_md/gromacs_extra/append_ligand_pc.py
jfennick/biobb_adapters
0
21959
import traceback from pycompss.api.task import task from pycompss.api.constraint import constraint from pycompss.api.parameter import FILE_IN, FILE_OUT from biobb_common.tools import file_utils as fu from biobb_md.gromacs_extra import append_ligand import os import sys @constraint(computingUnits="1") @task(input_top_z...
2.046875
2
sellalert.py
sjmiller609/cvs_scraper
0
21960
import requests import json from pprint import pprint import re import time import sys #getdata = requests.get(geturl) #pprint (vars(getdata)) from bs4 import BeautifulSoup from geopy.geocoders import Nominatim if len(sys.argv) != 4: print(sys.argv[0]+" <item> <location> <num items>") exit() #get list of prod...
2.859375
3
neucom/utils.py
jacobver/diag_context
0
21961
from __future__ import print_function import numpy as np from copy import copy import torch import torch.nn.functional as F from torch.autograd import Variable import torch.nn as nn def apply_var(v, k): if isinstance(v, Variable) and v.requires_grad: v.register_hook(inves(k)) def apply_dict(dic): fo...
2.765625
3
school/lecture1/isi_cv_02_task.py
kubekbreha/ML-Python-Algorithms
0
21962
<filename>school/lecture1/isi_cv_02_task.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Feb 19 20:41:09 2017 @author: pd """ #from IPython import get_ipython #get_ipython().magic('reset -sf') import matplotlib.pyplot as plt from sklearn import datasets from sklearn.tree import DecisionTreeClass...
3.53125
4
rotary/rotary/doctype/monthly_report/monthly_report.py
neilLasrado/rotary
0
21963
<filename>rotary/rotary/doctype/monthly_report/monthly_report.py # -*- coding: utf-8 -*- # Copyright (c) 2015, <NAME> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils import now class M...
1.65625
2
kili/mutations/project_version/fragments.py
ASonay/kili-playground
214
21964
<reponame>ASonay/kili-playground """ Fragments of project version mutations """ PROJECT_VERSION_FRAGMENT = ''' content id name projectId '''
0.714844
1
metrics/fid/fid_score.py
vfcosta/coegan-trained
0
21965
# Code apapted from https://github.com/mseitzer/pytorch-fid """Calculates the Frechet Inception Distance (FID) to evalulate GANs The FID metric calculates the distance between two distributions of images. Typically, we have summary statistics (mean & covariance matrix) of one of these distributions, while the 2nd dist...
2.796875
3
test/test.py
ttkltll/fisher
0
21966
from flask import Flask, current_app, request, Request app = Flask(__name__) ctx = app.app_context() ctx.push() current_app.static_floder = 'static' ctx.pop() app.run
1.875
2
augmentation.py
Pandoro/tools
1
21967
<gh_stars>1-10 import scipy.ndimage import cv2 import numpy as np class flip_augmentation(object): def __init__(self, chance=0.5, image_x_axis=-1, semantics_x_axis=-1): ''' The standard parameters will flip the image along the x axis, assuming a 'bc01' format for the image and a 'b01' for...
2.609375
3
src/config/utils/db-loader/contrail_db_loader/resources/security_group.py
hamzazafar/contrail-controller
1
21968
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # from __future__ import unicode_literals from builtins import str from builtins import range import logging from netaddr import IPNetwork from random import randint, choice import uuid from .resource import Resource from ..util...
1.960938
2
sopy/admin/__init__.py
AlexFrazer/sopython-site
81
21969
<filename>sopy/admin/__init__.py from flask import Blueprint bp = Blueprint('admin', __name__) @bp.record_once def register(state): from sopy.admin import views
1.664063
2
onmt/modules/extensions/fused_layer_norm/setup.py
quanpn90/NMTGMinor
75
21970
<filename>onmt/modules/extensions/fused_layer_norm/setup.py import os import torch from torch.utils import cpp_extension from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension # ninja build does not work unless include_dirs are abs path this_dir = os.path.dirname(os.path.abspa...
1.796875
2
expenses/migrations/0001_initial.py
inducer/expensely
1
21971
<filename>expenses/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-24 23:01 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrat...
1.53125
2
pages/themes/ParallelProgramming-Lecture4/examples/processQueue/TASK_sharing_variable_by_processes.py
WWWCourses/PythonCourseNetIT-Slides
0
21972
<reponame>WWWCourses/PythonCourseNetIT-Slides """ЗАДАЧА: Разгледайте дадения по-долу код и направете необходимите промени, така че след приключването на двата процеса променливата x да има стойност 20. Използвайте multiprocessing.Queue() за да обмените текущата стойност на x между процесите. """ import multiproces...
4.0625
4
pythonProject/02al28pass_elipsis_placeholders/exercicio_num_int.py
D-Wolter/PycharmProjects
0
21973
<reponame>D-Wolter/PycharmProjects numero_int = input('Digite um numero inteiro') if numero_int.isdigit(): numero_int = int(numero_int) if numero_int % 2 == 0: print('o numero e par') elif numero_int % 1 == 0: print('o numero e impar') else:
3.921875
4
Ejercicio_DecimalBinario.py
Sofia1306/Python_Clases
0
21974
<gh_stars>0 """Ejercicio Decimal a Binario """ import math numero = int(input('Ingresa un número: \n')) binario = '' while (numero > 0): if (numero%2 == 0): binario = '0' + binario else: binario = '1' + binario numero = int(math.floor(numero/2)) print(f'El número en binario...
3.78125
4
src/server.py
awsassets/superfish
0
21975
import flask ; from flask import * def Serve(email_form, password_form, rd, dic, host="0.0.0.0", port="8080"): app = Flask(__name__, template_folder="../clone") # login storage class Login: email = "" pwd = "" ip = "" # forms @app.get("/") def index(): retu...
2.828125
3
block/admin.py
amirkh75/user_block_chain
0
21976
<reponame>amirkh75/user_block_chain from django.contrib import admin from .models import Block @admin.register(Block) class ActionAdmin(admin.ModelAdmin): list_filter = ('created',)
1.734375
2
SOURCE/test_ex01.py
PinkPhayate/Information_Access_Design
0
21977
import re,io,os.path,os def remove_tag(str): alldigit = re.compile(r"^<.+") if alldigit.search(str) != None: return False return True for line in open('./../text_list', "r"): filename = './../TXT/tragedies/'+line.rstrip() print filename f = open("./../TXT/test_"+line.rstrip(),"w") ...
3.078125
3
lumiml/examples/test_install.py
ovra-peers/lumiml
4
21978
<gh_stars>1-10 def TestInstall(): from ..base import DeltaBasisFeatures, TriangBasisFeatures, HistBasisFeatures from ..models import PoissonElasticNet from ..model_selection import PoissonElasticNetCV from ..simulator import StretchedExponentialDistribution, Simulator import numpy as np # ...
2.203125
2
urllib/Cookie/CookieServer.py
pengchenyu111/SpiderLearning
3
21979
<gh_stars>1-10 from flask import Flask from flask import request app = Flask(__name__) @app.route("/readCookie") def readCookie(): print(request.cookies) print(request.cookies.get('MyCookie')) return "hello world" @app.route("/writeCookie") def writeCookie(): response = app.make_response('write coo...
2.71875
3
Aihan-Liu-Individual-project/Code/demo.py
laihanel/Final-Project-Group3
0
21980
import torch import torch.nn as nn import numpy as np import cv2 import os import shutil from matplotlib import pyplot as plt from Model_Definition import VC3D from mypath import NICKNAME, DATA_DIR, PATH # TODO: Now can display images with plt.show(), need to solve display on cloud instance OUT_DIR = PATH + os.path....
2.65625
3
remove_punctuations.py
sparemeyoursoliloquy/Python-Exercises
3
21981
<gh_stars>1-10 text = input() punc_remove = [",", ".", "!", "?"] for i in punc_remove: text = text.replace(i, "") print(text.lower())
3.265625
3
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/multisalesforce/views.py
oddbird/sfdo-template
3
21982
<filename>{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/multisalesforce/views.py import logging import re import requests from allauth.socialaccount.providers.oauth2.views import ( OAuth2CallbackView, OAuth2LoginView, ) from allauth.socialaccount.providers.salesforce.views import ( Salesforce...
1.890625
2
7_testing/autotest/student.py
ProGabe/teals
0
21983
''' Student: <NAME> Assignment: Homework 1 Submission of the first homework assignment. The assignment was to create a python file with 2 functions multiply - Takes two parameters x and y and returns the product of the values provided. noop - Takes 0 parameters and returns Non...
3.75
4
nova/tests/unit/virt/ec2/test_ec2.py
platform9/omni-devstack-fixes
0
21984
<gh_stars>0 """ Copyright 2016 Platform9 Systems Inc. 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 applicable...
1.59375
2
tests/run_examples.py
theGreenJedi/neon
0
21985
<gh_stars>0 #!/usr/bin/env python # this script runs all examples and checks that they all # run without throwing an exception from __future__ import print_function import os import sys from glob import glob import subprocess as subp from datetime import timedelta from timeit import default_timer as timer # Modify the...
1.9375
2
critical/rankorder.py
NECOTIS/CRITICAL
1
21986
<reponame>NECOTIS/CRITICAL # Copyright (c) 2012-2018, NECOTIS # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, # thi...
1.257813
1
trac/wiki/tests/web_api.py
clubturbo/Trac-1.4.2
0
21987
<reponame>clubturbo/Trac-1.4.2 # -*- coding: utf-8 -*- # # Copyright (C) 2014-2020 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at https://trac.edgewall.org/wi...
2
2
main.py
eyalnaor/DeepTemporalSR
38
21988
<reponame>eyalnaor/DeepTemporalSR import torch import Network import Network_res3d from data_handler import * import cProfile import io import pstats parser = utils.create_parser() args = parser.parse_args() def worker_init_fn(worker_id): np.random.seed(np.random.get_state()[1][0] + worker_id) def main(): ...
1.96875
2
package_name/__init__.py
netserf/template-python-repo
0
21989
# `name` is the name of the package as used for `pip install package` name = "package-name" # `path` is the name of the package for `import package` path = name.lower().replace("-", "_").replace(" ", "_") version = "0.1.0" author = "<NAME>" author_email = "" description = "" # summary license = "MIT"
1.898438
2
signaling_trajectories.py
simberaj/mobilib
0
21990
"""Transform signaling data to smoothed trajectories.""" import sys import numpy import pandas as pd import geopandas as gpd import shapely.geometry import matplotlib.patches import matplotlib.pyplot as plt import mobilib.voronoi SAMPLING = pd.Timedelta('00:01:00') STD = pd.Timedelta('00:05:00') def smoothen(arr...
2.703125
3
home/pi/_testing/logging-test.py
rc-bellergy/pxpi
26
21991
<filename>home/pi/_testing/logging-test.py<gh_stars>10-100 #!/usr/bin/env python import logging import logging.handlers import os # Logging to file dir_path = os.path.dirname(os.path.realpath(__file__)) logging.basicConfig(filename=dir_path + "/test.log", format='%(asctime)s - %(message)s', level=logging.INFO, filemo...
2.28125
2
test_client.py
ericjmartin/slackview
0
21992
<filename>test_client.py import os from slack_sdk.web import WebClient from slack_sdk.socket_mode import SocketModeClient # Initialize SocketModeClient with an app-level token + WebClient client = SocketModeClient( # This app-level token will be used only for establishing a connection app_token=os.environ.get(...
2.71875
3
utils/misc.py
hengwei-chan/3D_SBDD
67
21993
<filename>utils/misc.py import os import time import random import logging import torch import numpy as np import yaml from easydict import EasyDict from logging import Logger from tqdm.auto import tqdm class BlackHole(object): def __setattr__(self, name, value): pass def __call__(self, *args, **kwarg...
2.234375
2
tests/test_api.py
mattjm/iam-idbase
0
21994
<filename>tests/test_api.py<gh_stars>0 from idbase.api import RESTDispatch, LoginStatus from idbase import exceptions from django.http import HttpResponse from mock import MagicMock import pytest import json @pytest.fixture def req(rf): request = rf.get('/') request.user = MagicMock() request.user.is_auth...
2.140625
2
volatility/volatility/plugins/mac/adiummsgs.py
williamclot/MemoryVisualizer
2
21995
<reponame>williamclot/MemoryVisualizer<filename>volatility/volatility/plugins/mac/adiummsgs.py # Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
1.734375
2
main.py
attakei/lantis-web-radio
0
21996
#!/usr/bin/env python # -*- coding:utf8 -*- import sys import argparse from lantis.webradio.commands import bind_subparsers parser = argparse.ArgumentParser() subparsers = parser.add_subparsers() bind_subparsers(subparsers) def main(argv=None): if argv is None: argv = sys.argv[1:] args = parser.pars...
2.375
2
vnpy/app/portfolio_strategy/strategies/daily_amplitude_2_days_volitility_strategy.py
franklili3/vnpy
0
21997
from typing import List, Dict from datetime import datetime import numpy as np from vnpy.app.portfolio_strategy import StrategyTemplate, StrategyEngine from vnpy.trader.utility import BarGenerator, ArrayManager from vnpy.trader.object import BarData from vnpy.trader.constant import Interval class AmplitudeVolitilit...
2.25
2
old_game/hotmaps.py
jwvhewitt/dmeternal
53
21998
# Pathfinding algorithm. import pygame import random class HotTile( object ): def __init__( self ): self.heat = 9999 self.cost = 0 self.block = False class HotMap( object ): DELTA8 = [ (-1,-1), (0,-1), (1,-1), (-1,0), (1,0), (-1,1), (0,1), (1,1) ] EXPENSIVE = 9999 def __init__...
3.3125
3
upload_menu.py
jaypee-f/webhook
0
21999
import json import jsonpickle from pprint import pprint class Object(object): pass prods = Object() prods.accountId="<KEY>" prods.locationId="5db938536d49b300017efcc3" prods.products=[] prods.categories=[] with open ('pl.json', 'r') as f: products_dict = json.load(f) for item in products_dict["models"]: ...
3.046875
3