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
src/mblib/httpclient.py
odra/mbctl
0
36400
<filename>src/mblib/httpclient.py<gh_stars>0 """ HTTP client module. """ import requests from requests.auth import HTTPBasicAuth from requests_kerberos import HTTPKerberosAuth from . import errors class KRBAuth: """ Kerberos authenticaton type. """ principal = None hostname_override = None def __init__(...
3.359375
3
students/K33422/Izmaylova_Anna/web_lab2/tours2/tours_app/view_create_user.py
Anna0102/ITMO_ICT_WebDevelopment_2021-2022
0
36401
<gh_stars>0 from django.shortcuts import render from django.views.generic.edit import CreateView from .models import Users from .forms import UserForm from django.contrib.auth.views import LoginView # представление для создания пользователя class UserCreateView(CreateView): form_class = UserForm success_url = ...
1.859375
2
mtp_api/apps/prison/tests/test_utils.py
ministryofjustice/mtp-api
5
36402
from collections import defaultdict from copy import copy import re import json from django.conf import settings from django.test import override_settings, TestCase import responses from prison.models import PrisonerLocation from prison.tests.utils import ( load_prisoner_locations_from_dev_prison_api, random_...
2.28125
2
metrics/__init__.py
MauTrib/gnn-en-folie
0
36403
<gh_stars>0 from metrics.preprocess import edgefeat_converter, fulledge_converter, node_converter from metrics.common import fulledge_compute_f1, edgefeat_compute_f1, node_compute_f1, node_total from metrics.mcp import fulledge_total as mcp_fulledge_total, edgefeat_total as mcp_edgefeat_total from metrics.tsp import ts...
1.992188
2
grpc/clients/python/vegaapiclient/generated/wallet/v1/__init__.py
legg/api
6
36404
from . import wallet_pb2_grpc as wallet_grpc from . import wallet_pb2 as wallet __all__ = [ "wallet_grpc", "wallet", ]
1.046875
1
noisysystem_temp/CutoffPhi.py
Tom271/InteractingParticleSystems
1
36405
<reponame>Tom271/InteractingParticleSystems import particle.processing as processing particles = 480 test_params = { "particle_count": 2 * [particles], # (3 * np.arange(8, 150, 16)).tolist(), "gamma": [0.05], "G": ["Smooth"], "scaling": ["Local"], "D": [1.0], "phi": ["Gamma"], "initial_...
2.234375
2
examples/client-context/client.py
barberj/bridge-python
0
36406
from BridgePython import Bridge bridge = Bridge(api_key='myapikey') class PongHandler(object): def pong(self): print ("PONG!") bridge.store_service("pong", PongHandler()) bridge.get_service("ping").ping() bridge.connect()
3
3
lidi/home/views.py
campovski/lidi
0
36407
<reponame>campovski/lidi from django.shortcuts import render def index(request): try: return render(request, 'home/index.html', {'user': request.session['user']}) except KeyError: return render(request, 'home/index.html', {'user': None})
1.867188
2
src/models/fcnet.py
ArlindKadra/DeepLearning
4
36408
import torch.nn as nn class FcNet(nn.Module): def __init__(self, config, input_features, nr_labels): super(FcNet, self).__init__() self.config = config # create the blocks self.layers = self._make_block(self.config["num_layers"], input_features) self.fc_layer = nn.Linear(...
2.9375
3
lib/galaxy/version.py
natefoo/galaxy-beta2
0
36409
<gh_stars>0 VERSION_MAJOR = "15.03"
0.992188
1
vspreview/toolbars/comp/toolbar.py
wwww-wwww/vs-preview
0
36410
from __future__ import annotations import os import string import random import logging import vapoursynth as vs from pathlib import Path from requests import Session from functools import partial from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor from typing import Any, Mapping, Callable, Dict, F...
1.90625
2
tweets.py
s-broda/capstoneproject
0
36411
# see https://www.spinningbytes.com/resources/germansentiment/ and https://github.com/aritter/twitter_download for obtaining the data. import os from pathlib import Path import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from conversion import convert_examples_to_features, conv...
3.25
3
guiHandling/webHandler.py
Mstpyt/Faceit-Overlay
6
36412
<gh_stars>1-10 """ ------------------------------------------------------------------------------------------------------------------- WEB HANDLING ---------------------------------------------------------------------------------------------------------------------""" impo...
2.1875
2
examples/tensorflow/image_recognition/slim/main.py
daisyden/lpot
0
36413
# # -*- coding: utf-8 -*- # # Copyright (c) 2020 Intel Corporation # # 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...
2.140625
2
visitors/models.py
maxhamz/prieds_test_hospital_queue_be
0
36414
<filename>visitors/models.py from django.db import models # Create your models here. class Visitor(models.Model): MALE = 'M' FEMALE = 'F' OTHER = 'X' GENDER_OPTIONS = [ (MALE, 'Male'), (FEMALE, 'Female'), (OTHER, 'Other') ] dtRegistered = models.DateTimeField(auto_now_...
2.546875
3
muchbettermoments.py
mirca/muchbettermoments
1
36415
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["quadratic_2d"] import numpy as np def quadratic_2d(data): """ Compute the quadratic estimate of the centroid in a 2d-array. Args: data (2darray): two dimensional data array Returns ce...
3.25
3
script/run_WOA.py
cyy111/metaheuristics
104
36416
<gh_stars>100-1000 from models.multiple_solution.swarm_based.WOA import BaseWOA, BaoWOA from utils.FunctionUtil import square_function ## Setting parameters root_paras = { "problem_size": 30, "domain_range": [-1, 1], "print_train": True, "objective_func": square_function } woa_paras = { "epoch": 10...
1.898438
2
mmdetection_pipeline/tests/mmdet_test.py
KonstantinSviridov/mmdetection_pipeline
0
36417
import unittest from musket_core import projects from musket_core import parralel import os fl=__file__ fl=os.path.dirname(fl) class TestCoders(unittest.TestCase): def test_basic_network(self): pr = projects.Project(os.path.join(fl, "project")) exp = pr.byName("exp01") tasks = exp.fit() ...
2.75
3
setup.py
CentryPlan/dataclassframe
321
36418
#!/usr/bin/env python3 """ Based on template: https://github.com/FedericoStra/cython-package-example """ from setuptools import setup with open("requirements.txt") as fp: install_requires = fp.read().strip().split("\n") with open("requirements_dev.txt") as fp: dev_requires = fp.read().strip().split("\n") s...
1.328125
1
Paleo_DB_Rip.py
matt-oak/DinoFinder
0
36419
<gh_stars>0 #Paleo_DB_Rip.py #Python script to programmatically web-scrape from paleobiodb.org #Author: <NAME> #Date: 08/15/2016 # Imports # from bs4 import BeautifulSoup from time import sleep from geopy.geocoders import Nominatim import urllib2 import pycountry import wget import sys import os.path import codecs # ...
3.140625
3
body/body_textEditor.py
XiantaoCheng/Structure
1
36420
import sys, re if __name__=='__main__': sys.path.append(sys.path[0]+'\\..') from body.bone import NetP from body.soul import Karma from body.body_motor import Motor from body.body_pool import Pool from body.body_brain import Brain from body.body_debugger import Debugger from tools import tools_sl, tools_ba...
2.015625
2
test/test_add_group.py
eugene1smith/homeworks
0
36421
<gh_stars>0 # -*- coding: utf-8 -*- from model.group import group def test_add_group(app): app.group.create(group(name="Name", header="Head", footer="Footer")) def test_add_empty_group(app): app.group.create(group(name="", header="", footer=""))
1.921875
2
apps/events/views.py
seanlefevre/openduty
145
36422
from django.views.generic import DeleteView from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib import messages from django.urls import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from schedule.models import Calendar from schedule.views i...
1.851563
2
examples/experiments_code/amazon_reviews/sentiment_subsampling.py
fossabot/textlytics
26
36423
import dill import glob import csv import os from os.path import basename, join from joblib import Parallel, delayed domain_path = '/datasets/amazon-data/new-julian/domains' domain_subdirectory = 'only-overall-lemma-and-label-sampling-1-3-5' domain_files = glob.glob(join(domain_path, 'o...
2.3125
2
image_augmentation/preprocessing/__init__.py
tanzhenyu/image_augmentation
6
36424
<gh_stars>1-10 from image_augmentation.preprocessing.preprocess import cifar_baseline_augmentation, cifar_standardization from image_augmentation.preprocessing.preprocess import imagenet_baseline_augmentation, imagenet_standardization from image_augmentation.preprocessing import efficientnet_preprocess
1.210938
1
__init__.py
mechanicalnull/sourcery_pane
3
36425
<reponame>mechanicalnull/sourcery_pane from binaryninjaui import DockHandler, DockContextHandler, UIActionHandler, getMonospaceFont from PySide2 import QtCore from PySide2.QtCore import Qt from PySide2.QtWidgets import (QApplication, QHBoxLayout, QVBoxLayout, QLabel, QWidget, QPlainTextEdit, QSizePolicy...
2.171875
2
goodrich/python_primer/c119.py
saurabhkhattry/data-structure-algorithm-design
0
36426
<filename>goodrich/python_primer/c119.py """ C 1.19 --------------------------------- Problem Statement : Demonstrate how to use Python’s list comprehension syntax to produce the list [ a , b , c , ..., z ], but without having to type all 26 such characters literally. Author : Saurabh """ print([chr(x + 97) for x in ...
3.703125
4
Lib/compiler/readonly/util.py
isabella232/cinder-1
0
36427
from __future__ import annotations from ast import AST, Subscript, Name, Call READONLY_ANNOTATION: str = "Readonly" READONLY_CALL: str = "readonly" READONLY_FUNC: str = "readonly_func" def is_readonly_annotation(node: AST) -> bool: return ( isinstance(node, Subscript) and isinstance(node.value, ...
2.921875
3
test/Velvet_server_test.py
kbaseapps/Velvet
1
36428
<reponame>kbaseapps/Velvet<filename>test/Velvet_server_test.py<gh_stars>1-10 # -*- coding: utf-8 -*- import os # noqa: F401 import os.path import shutil import time import unittest from configparser import ConfigParser from os import environ from pprint import pformat from pprint import pprint # noqa: F401 from Velv...
1.929688
2
scale/product/apps.py
kaydoh/scale
121
36429
"""Defines the application configuration for the product application""" from __future__ import unicode_literals from django.apps import AppConfig class ProductConfig(AppConfig): """Configuration for the product application""" name = 'product' label = 'product' verbose_name = 'Product' def ready(...
2.328125
2
lattly_tests/converter_tests.py
yfarrugia/lattly
0
36430
<filename>lattly_tests/converter_tests.py __author__ = 'yanikafarrugia' import unittest import lattly_service.converter class ConverterTests(unittest.TestCase): def test_degrees_to_radians(self): rad = lattly_service.converter.Converter.degrees_to_radians(120) self.assertEqual(rad, 2.0943951023931953) self.as...
2.984375
3
setup.py
halfstrik/vindinium-client
0
36431
<filename>setup.py # -*- coding: utf-8 -*- from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='vindinium-client', version='0.1.0', description='Client for Vindinium.org', long_description=readm...
1.273438
1
forte/processors/tests/machine_translation_processor_test.py
tcl326/forte
0
36432
<filename>forte/processors/tests/machine_translation_processor_test.py<gh_stars>0 """This module tests Machine Translation processor.""" import unittest import os import tempfile import shutil from ddt import ddt, data, unpack from texar.torch import HParams from forte.pipeline import Pipeline from forte.data.readers...
2.484375
2
autodriver/src/autodriver/image_capture.py
rel1c/robocar
0
36433
<filename>autodriver/src/autodriver/image_capture.py #!/usr/bin/env python import cv2 from picamera.array import PiRGBArray from picamera import PiCamera import rospy from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError from models.ros_publisher import ROSPublisher class ImageCapture(ROSPub...
2.71875
3
lesson6/solution_simple_functions.py
vinaymayar/python-game-workshop
1
36434
"""lesson6/solution_simple_functions.py Contains solutions for simple functions. """ # Exercise 1: Write a function that prints your name and try calling it. # Work in this file and not in the Python shell. Defining functions in # a Python shell is difficult. Remember to name your function something # that indicat...
4.40625
4
pydl/tests/test_rnn.py
nash911/PyDL
0
36435
<reponame>nash911/PyDL # ------------------------------------------------------------------------ # MIT License # # Copyright (c) [2021] [<NAME>] # # This code is part of the library PyDL <https://github.com/nash911/PyDL> # This code is licensed under MIT license (see LICENSE.txt for details) # ------------------------...
2.234375
2
hcloud/helpers/descriptors.py
rebost/hcloud-python
1
36436
# -*- coding: utf-8 -*- from dateutil.parser import isoparse class ISODateTime(object): def __init__(self, initval=None): self.val = initval def __get__(self, obj, obj_type): return self.val def __set__(self, obj, string_date): if string_date is None: self.val = None ...
2.9375
3
src/classification_report.py
cognibit/Text-Normalization-Demo
66
36437
# Copyright 2018 Cognibit Solutions LLP. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
2.703125
3
Joints/Pelvis.py
lcremer/Maya_Rigging
0
36438
""" Creates Pelvis """ import maya.cmds as mc from ..Utils import String as String class Pelvis(): def __init__(self, characterName = '', suffix = '', name = 'Pelvis', parent = ''): """ @return: returns end joint """ ...
2.890625
3
src/get_weather.py
Sphinxxx1984/Welcome_system
0
36439
<reponame>Sphinxxx1984/Welcome_system from multiprocessing import Pipe import requests import json import time cur_file = "../data/cur_weather.json" today_file = "../data/today_weather.json" def write2file(data, json_file): with open(json_file, 'w') as f: f.write(json.dumps(data)) f.close() # cla...
2.96875
3
spts/gui/options.py
FilipeMaia/spts
0
36440
<gh_stars>0 import os.path import logging logger = logging.getLogger("MSI_GUI") from PyQt5 import QtCore, QtGui class Options: def __init__(self, mainWindow): self.general_box = GeneralBox(mainWindow) self.raw_tab = RawTab(mainWindow) self.process_tab = ProcessTab(mainWindow) self...
2.25
2
narx_double_descent.py
antonior92/narx-double-descent
6
36441
import numpy as np from models import * from datasets import * from util import parse_funct_arguments import pickle import itertools def mse(y_true, y_mdl): return np.mean((y_true - y_mdl)**2) def train(mdl, dset): # Get train u_train, y_train = dset.get_train() # Fit X_train, z_train = construc...
2.5625
3
tests/artifactcache/push.py
samkenxstream/buildstream
0
36442
<reponame>samkenxstream/buildstream # Pylint doesn't play well with fixtures and dependency injection from pytest # pylint: disable=redefined-outer-name import os import pytest from buildstream import _yaml from buildstream._project import Project from buildstream._protos.build.bazel.remote.execution.v2 import remot...
1.773438
2
app/app.py
HAKSOAT/Basafa
22
36443
<reponame>HAKSOAT/Basafa import logging from app.config import oapi, app_api, redis, LAST_MENTION_ID from app.fetcher import fetch from app.utils import compile_tweet_link, process_tweet_text, get_most_similar_tweets, send_tweet, \ get_action, ActionType, send_no_reference_tweet import tweepy logging.basicConfi...
2.265625
2
attachments/models.py
javango/django-attachments
0
36444
<reponame>javango/django-attachments import os from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey from django.core.files.storage import Defau...
2.140625
2
src/models/dive.py
Skorp7/backend
0
36445
from pymodm import MongoModel, fields from models.target import Target from models.user import User class Dive(MongoModel): diver = fields.ReferenceField(User) target = fields.ReferenceField(Target) created_at = fields.DateTimeField() location_correct = fields.BooleanField() new_x_coordinate = fie...
2.421875
2
evaluate.py
uw-biomedical-ml/oct-irf-train
1
36446
#!/usr/bin/env python from PIL import Image import sys, glob, tqdm, os import numpy as np from colour import Color def usage(): print("./evaluate.py <imgdir> <outdir> <mode>") print("") print("\timgdir = folder of OCT B scans") print("\toutdir = EMPTY folder to output segmentation masks") print("\t...
2.390625
2
interfaz.py
ifigueroa065/Voluntariado
0
36447
from tkinter import * import os from datetime import datetime import webbrowser from tkinter import messagebox from tkinter import ttk import tkinter.filedialog import tkinter as tk import openpyxl from REPORTE import * datos = [] #reporte precios = [] #precios preciosmq=[] #precios mq subtotales = [] def CREAR_INTER...
2.90625
3
deep_hipsc_tracking/plotting/compartment_plot.py
JackToppen/deep-hipsc-tracking
2
36448
""" Plot data split by compartments Classes: * :py:class:`CompartmentPlot`: compartment plotting tool """ # Standard lib from typing import Tuple, Optional, Dict # 3rd party imports import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # Our own imports from .styling impo...
3.171875
3
utils/perm_utils.py
IBM/NeuronAlignment
3
36449
<filename>utils/perm_utils.py import torch import numpy as np def train_perm_orth(train_loader, model, optimizer, scheduler, criterion, regularizer=None, rho=1E-4, delta=0.5, nu=1E-2, eps=1E-3, tau=1E-2, lagrange_pen=1E-2, perm_flag=True, t_step=40): if perm_flag: tau_min = 1E-24 ...
2.125
2
src/test_main.py
kkworden/python-pipenv-bootstrap
0
36450
<reponame>kkworden/python-pipenv-bootstrap<filename>src/test_main.py from unittest import mock import unittest import pytest from .main import some_func class TestMain(unittest.TestCase): @pytest.fixture(autouse=True) def _setup_service(self): self.mock_object = mock.MagicMock() def test_some_f...
2.328125
2
venv/lib/python3.8/site-packages/keras/api/_v2/keras/applications/densenet/__init__.py
JIANG-CX/data_labeling
1
36451
<reponame>JIANG-CX/data_labeling<filename>venv/lib/python3.8/site-packages/keras/api/_v2/keras/applications/densenet/__init__.py # This file is MACHINE GENERATED! Do not edit. # Generated by: tensorflow/python/tools/api/generator/create_python_api.py script. """Public API for tf.keras.applications.densenet namespace. "...
1.710938
2
ndtt/mp/mpmanager.py
HMEIatJHU/neural-datalog-through-time
18
36452
import torch from torch import nn import torch.optim as optim import torch.multiprocessing as mp import numpy as np import time class MPManager(object): def __init__(self, num_workers): """ manage a single-instruction-multiple-data (SIMD) scheme :param int num_workers: The number of proces...
3.140625
3
link.py
EthanC2/broken-link-finder
0
36453
# Link class class Link: ## Constructor ## def __init__(self, text = "None", url = "None", status_code = 000): # Not the keyword 'None' so it will still print something # Dictionary of URL-related content self.text = text self.url = url self.status_code = status_code # ...
3.59375
4
distnet/keras_models/self_attention.py
jeanollion/dlutils
4
36454
import tensorflow as tf from tensorflow.keras.layers import Layer, Dense, Reshape, Embedding, Concatenate, Conv2D from tensorflow.keras.models import Model import numpy as np class SelfAttention(Model): def __init__(self, d_model, spatial_dims, positional_encoding=True, name="self_attention"): ''' ...
2.9375
3
src/UQpy/SampleMethods.py
bsaakash/new_repo
0
36455
<reponame>bsaakash/new_repo """This module contains functionality for all the sampling methods supported in UQpy.""" import sys import copy import numpy as np from scipy.spatial.distance import pdist import scipy.stats as sp import random from UQpy.Distributions import * import warnings def init_sm(data): #######...
2.125
2
examples/python-api/simple_alu.py
ahmed-irfan/cosa2
26
36456
<filename>examples/python-api/simple_alu.py #!/usr/bin/env python3 import argparse import pono import smt_switch as ss from smt_switch.primops import And, BVAdd, BVSub, Equal, Ite from smt_switch.sortkinds import BOOL, BV def build_simple_alu_fts(s:ss.SmtSolver)->pono.Property: ''' Creates a simple alu transit...
2.46875
2
lrs/admin.py
ELSUru/ADL_LRS
0
36457
<reponame>ELSUru/ADL_LRS<filename>lrs/admin.py<gh_stars>0 from util.util import autoregister autoregister('lrs')
1.265625
1
cloudmesh/key/Key.py
wang542/cloudmesh-cloud
0
36458
<filename>cloudmesh/key/Key.py # See also the methods already implemented we have in cm for ssh management # I think you reimplemented things that already exists. # see and inspect cloudmesh.common import os from os.path import expanduser # see content of path_expand it does expanduser as far as I know from cloudmesh....
2.40625
2
code/DNN/dnn_regression-keras.py
Knowledge-Precipitation-Tribe/Neural-network
3
36459
<reponame>Knowledge-Precipitation-Tribe/Neural-network # -*- coding: utf-8 -*-# ''' # Name: dnn_regression-keras # Description: # Author: super # Date: 2020/6/2 ''' from HelperClass2.MnistImageDataReader import * from keras.models import Sequential from keras.layers import Dense import matplo...
2.734375
3
milarun/models/ssd/__init__.py
laceyg/milabench
67
36460
<reponame>laceyg/milabench from .train import main
0.910156
1
separator.py
TimBossuyt/GcodeAnalyzer
2
36461
<reponame>TimBossuyt/GcodeAnalyzer # MIT License # Copyright (c) 2020 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # t...
2.09375
2
corpustools/funcload/io.py
PhonologicalCorpusTools/CorpusTools
97
36462
import csv def save_minimal_pairs(output_filename, to_output, write_header=True): if isinstance(output_filename, str): outf = open(output_filename, mode='w', encoding='utf-8-sig', newline='') needs_closed = True else: outf = output_filename needs_closed = False writer = cs...
3.0625
3
src/modax/layers/network.py
GJBoth/modax
2
36463
from typing import Callable from jax import lax from flax import linen as nn class MultiTaskDense(nn.Module): features: int n_tasks: int kernel_init: Callable = nn.initializers.lecun_normal() bias_init: Callable = nn.initializers.zeros @nn.compact def __call__(self, inputs): kernel = ...
2.15625
2
tests/integrations/java/test_JDK__verify.py
pybee/briefcase
522
36464
<reponame>pybee/briefcase import os import shutil import subprocess import sys from pathlib import Path from unittest import mock import pytest from requests import exceptions as requests_exceptions from briefcase.console import Log from briefcase.exceptions import BriefcaseCommandError, MissingToolError, NetworkFail...
2.015625
2
Script Examples/selectionpickobject.py
chuongmep/CadPythonShell
9
36465
<reponame>chuongmep/CadPythonShell<filename>Script Examples/selectionpickobject.py import clr import sys sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib') import os import math clr.AddReference('acmgd') clr.AddReference('acdbmgd') clr.AddReference('accoremgd') # Import references from AutoCAD from Autodesk.A...
2.25
2
Katna/config.py
viddik13/katna
125
36466
<gh_stars>100-1000 """ .. module:: Katna.config :platform: Platfrom Independent :synopsis: This module defines some helpful configuration variables """ import os # # Configuration parameters for Image class class Image: # default value by which image size to be reduces for processing down_sample_factor...
2.15625
2
functions/closeAll.py
chiluf/visvis.dev
0
36467
<filename>functions/closeAll.py # -*- coding: utf-8 -*- # Copyright (C) 2012, <NAME> # # Visvis is distributed under the terms of the (new) BSD License. # The full license can be found in 'license.txt'. import visvis as vv def closeAll(): """ closeAll() Closes all figures. """ for fig i...
2.296875
2
gtrace/optics/geometric.py
terrencetec/gtrace
1
36468
<reponame>terrencetec/gtrace #{{{ Import import numpy as np pi = np.pi #}}} #{{{ Snell's Law def deflection_angle(theta, n1, n2, deg=True): """Calculate deflection angle according to Snell's law. Parameters ---------- theta : float Angle of incidence. n1 : float Refractive index o...
3.203125
3
tpau_gtfsutilities/gtfs/process/__init__.py
anniekfifer/tpau-gtfsutils
3
36469
<gh_stars>1-10 from . import preprocess
0.992188
1
setup.py
mlab-upenn/pyEp
11
36470
<reponame>mlab-upenn/pyEp<filename>setup.py from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f...
1.351563
1
python_code/vnev/Lib/site-packages/jdcloud_sdk/services/jcq/models/Subscription.py
Ureimu/weather-robot
14
36471
<reponame>Ureimu/weather-robot # coding=utf8 # Copyright 2018 JDCLOUD.COM # # 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 requir...
1.898438
2
aggregator/migrations/0033_auto_20190118_1735.py
dipapaspyros/bdo_platform
2
36472
<gh_stars>1-10 # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-01-18 15:35 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('aggregator', '0032_auto_20190118_1720'), ] operations = [ # migrations...
1.5
2
src/lead2gold/tools/emd.py
plachta11b/lead2gold
0
36473
<reponame>plachta11b/lead2gold import ntpath from lead2gold.tools.tool import Tool from lead2gold.util import pwm2consensus from lead2gold.util import sequence2pwm from lead2gold.motif import Motif class EMD(Tool): """Class implementing a EMD search tool motif convertor. """ toolName = "EMD" def __init__(self):...
2.640625
3
plaso/formatters/manager.py
pyllyukko/plaso
1,253
36474
# -*- coding: utf-8 -*- """Manages custom event formatter helpers.""" class FormattersManager(object): """Custom event formatter helpers manager.""" _custom_formatter_helpers = {} @classmethod def GetEventFormatterHelper(cls, identifier): """Retrieves a custom event formatter helper. Args: id...
2.71875
3
scvae/analyses/metrics/summary.py
chgroenbech/deep-learning-for-single-cell-transcriptomics
46
36475
<filename>scvae/analyses/metrics/summary.py<gh_stars>10-100 # ======================================================================== # # # Copyright (c) 2017 - 2020 scVAE authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Yo...
2
2
template.py
gtback/kuberwatcher
23
36476
<filename>template.py template_open = '{{#ctx.payload.aggregations.result.hits.hits.0._source}}' template_close = template_open.replace('{{#','{{/') kibana_url = ( "{{ctx.metadata.kibana_url}}/app/kibana#/discover?" "_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,...
1.804688
2
preset.py
IkhwanFikri1997/Exam-Schedule-Generation
0
36477
<filename>preset.py #!/usr/bin/env python """ ZetCode wxPython tutorial In this example, we create a wx.ListBox widget. author: <NAME> website: www.zetcode.com last modified: July 2020 """ import wx class Example(wx.Frame): def __init__(self, *args, **kw): super(Example, self).__init_...
2.84375
3
CrySPY/interface/QE/collect_qe.py
sgbaird/CrySPY
57
36478
''' Collect results in Quantum ESPRESSO ''' import sys import numpy as np from pymatgen.core import Structure from . import structure as qe_structure from ... import utility from ...IO import pkl_data from ...IO import read_input as rin def collect_qe(current_id, work_path): # ---------- check optimization in ...
2.375
2
jobs/scripts/index_jobs.py
soheltarir/django-es-test
5
36479
<filename>jobs/scripts/index_jobs.py import json from django.db import connection from elasticsearch import Elasticsearch from jobs.models import Job es_client = Elasticsearch('http://localhost:9200') def run(): # Create Index es_client.indices.create(index='jobs') # Put Mapping with open("jobs/jo...
2.421875
2
dealconvert/formats/bri.py
michzimny/deal-convert
0
36480
<reponame>michzimny/deal-convert<gh_stars>0 import warnings from . import DealFormat from .. import dto class BRIFormat(DealFormat): number_warning = '.bri file format assumes consequent deal numbers from 1' @property def suffix(self): return '.bri' def parse_content(self, content): ...
2.5
2
src/test_sudoku_solver.py
tillschallau/sudoku-solver
0
36481
import src.sudoku_solver as sudoku_solver from src.sudoku import Sudoku correct_sudoku = Sudoku([[9, 5, 7, 6, 1, 3, 2, 8, 4], [4, 8, 3, 2, 5, 7, 1, 9, 6], [6, 1, 2, 8, 4, 9, 5, 3, 7], [1, 7, 8, 3, 6, 4, 9, 5, 2], [5, 2, 4, 9, 7, 1, 3, 6, 8], [3, 6, 9, 5, 2, 8, 7, 4, 1], ...
2.875
3
maquinaria/alquileres/serializers/alquileres.py
CFredy9/Maquinaria
0
36482
"""Serializers Alquileres""" #Django REST Framework from rest_framework import serializers #Model from maquinaria.alquileres.models import Alquiler from maquinaria.maquinas.models import Maquina class AlquilerModelSerializer(serializers.ModelSerializer): """Modelo Serializer de Cliente""" class Meta: """Clase ...
2.359375
2
test_RTC_DS1307.py
LeMaker/LeScratch
4
36483
<gh_stars>1-10 #!/usr/bin/env python # # Test RTC_DS1307 import sys import time import datetime import RTC_DS1307 # Main Program print "Program Started at:"+ time.strftime("%Y-%m-%d %H:%M:%S") filename = time.strftime("%Y-%m-%d%H:%M:%SRTCTest") + ".txt" starttime = datetime.datetime.utcnow() ds1307 = RTC_DS1307.R...
2.71875
3
VS State and Virtual IP Info/avi_virtual_service_info.py
jagmeetsingh91/AviSDK-Scripts
0
36484
<filename>VS State and Virtual IP Info/avi_virtual_service_info.py #!/usr/bin/env python # # Created on Nov 14, 2017 # @author: <EMAIL>, <EMAIL> # # AVISDK based Script to get the status and configuration information of the Virtual Services # # Requires AVISDK ("pip install avisdk") and PrettyTable ("pip install Pretty...
2.15625
2
tomograph/transform.py
fkokosinski/tomograph
4
36485
import numpy as np def projective(coords): """ Convert 2D cartesian coordinates to homogeneus/projective. """ num = np.shape(coords)[0] w = np.array([[1], ]*num) return np.append(coords, w, axis=1) def cartesian(coords): """ Convert 2D homogeneus/projective coordinates to cartesian. """ ret...
3.5
4
tvl_backends/tvl-backends-nvdec/tests/test_nvdec.py
ashwhall/tvl
21
36486
<filename>tvl_backends/tvl-backends-nvdec/tests/test_nvdec.py import torch from tvl_backends.nvdec import nv12_to_rgb def test_nv12_to_rgb(): w = 3840 h = 2160 nv12 = torch.empty(int(w * h * 1.5), device='cuda:0', dtype=torch.uint8) for i in range(100): nv12.random_(0, 256) rgb = nv12...
2.328125
2
agent/dxagent.py
Advanced-Observability/dxagent
3
36487
<gh_stars>1-10 """ dxagent.py This file contains the core of dxagent @author: K.Edeline """ import sched import time import signal import importlib from .constants import AGENT_INPUT_PERIOD from .core.ios import IOManager from .core.daemon import Daemon from .input.sysinfo import SysInfo from .input.bm_input im...
1.765625
2
app/models.py
SFC-foundations/SFC-website
0
36488
from django.db import models from django.utils import timezone import os #BLOGS class BlogPost(models.Model): author=models.CharField(max_length=200) role=models.CharField(max_length=200) image=models.ImageField(upload_to='blogMedia/') title=models.CharField(max_length=200) displayText=models.Te...
2.234375
2
script/generate_default_repositories.py
peyanski/documentation
0
36489
<filename>script/generate_default_repositories.py import requests import json import os from github import Github BASE = """--- id: default_repositories title: Default repositories description: "Default repositories in HACS" --- <!-- The content of this file is autogenerated during build with script/generate_default_r...
2.40625
2
jp.atcoder/abc005/abc005_2/26220615.py
kagemeka/atcoder-submissions
1
36490
import sys import typing def main() -> typing.NoReturn: n = int(input()) (*t,) = map(int, sys.stdin.read().split()) print(min(t)) main()
2.6875
3
List Events.py
hcaushi/higgs-hunters
0
36491
import csv import sys #This program was written in Python 3.6.3 by <NAME>. You are free to use it for any reason, without my permission, without having to inform myself or anyone else #This program was was written to aid other programs, by providing a list of all event IDs so that they appear only once #List of all ...
3.34375
3
custom_latex_cell_style/scenario2/ipython_nbconvert_config.py
isabella232/nbconvert-examples
120
36492
c = get_config() #Export all the notebooks in the current directory to the sphinx_howto format. c.NbConvertApp.notebooks = ['*.ipynb'] c.NbConvertApp.export_format = 'latex' c.NbConvertApp.postprocessor_class = 'PDF' c.Exporter.template_file = 'custom_article.tplx'
1.640625
2
setup.py
puhoy/django-s3file
0
36493
#!/usr/bin/env python from setuptools import setup setup(name='django-s3file', use_scm_version=True)
0.996094
1
hard/python3/c0084_440_k-th-smallest-in-lexicographical-order/00_leetcode_0084.py
drunkwater/leetcode
0
36494
# DRUNKWATER TEMPLATE(add description and prototypes) # Question Title and Description on leetcode.com # Function Declaration and Function Prototypes on leetcode.com #440. K-th Smallest in Lexicographical Order #Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n. #Note: 1 ...
3.453125
3
0015_3Sum.py
taro-masuda/leetcode
0
36495
class Solution: def twoSum(self, nums: List[int], target: int) -> List[List[int]]: complement = {} out = [] for i,n in enumerate(nums): complement[target-n] = i for i,n in enumerate(nums): idx = complement.get(n, None) if idx != None and idx !...
3.21875
3
app/handlers.py
zjurelinac/Bitboard
0
36496
<filename>app/handlers.py<gh_stars>0 import logging import traceback import peewee from flask import request from east.exceptions import * from app import app, db print('TESTING') class DummyLogger: def log(self, *args): pass def error(self, *args): pass logger = DummyLogger() # logger = ...
2.375
2
adapter.py
JuliaChae/Waymo-Kitti-Adapter
4
36497
import argparse import os import math # import time import numpy as np import cv2 import matplotlib.pyplot as plt import tensorflow as tf import progressbar from waymo_open_dataset.utils import range_image_utils from waymo_open_dataset.utils import transform_utils from waymo_open_dataset.utils import test_utils from ...
1.921875
2
renku/cli/_providers/__init__.py
vigsterkr/renku-python
0
36498
# -*- coding: utf-8 -*- # # Copyright 2019 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compli...
2.171875
2
POPGEN/flashpca_to_smartpca.py
Hammarn/Scripts
0
36499
<reponame>Hammarn/Scripts #!/usr/bin/env python import argparse import pandas as pd def main(input_file,output): pd_data = pd.read_csv(input_file, sep = "\t" ) import pdb pd_data['last'] = pd_data['FID'] for i in pd_data.index: pd_data.loc[i,'FID'] = "{}:{}".format(pd_data.loc[i,'FID']...
2.875
3