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
servicenowpy/tests/test_mock_api.py
henriquencmt/servicenowpy
0
50800
<reponame>henriquencmt/servicenowpy import os import unittest from servicenowpy import Client class TestMockAPI(unittest.TestCase): def test_response(self): mock_instance_url = os.environ['SERVICENOWPY_MOCK_API_URL'] sn_client = Client(mock_instance_url, 'user', 'pwd') inc_table = sn_cli...
2.765625
3
src/tag_keyboard_util.py
Stadin-helpperit/hkihelperbot-server
0
50801
<filename>src/tag_keyboard_util.py from telegram import InlineKeyboardButton from emoji import emojize from pathlib import Path import json # Helper functions to create inline keyboards for selecting search keywords # Resolves the current path path = Path(__file__).parent / "../tag_keyboard.json" # Opens the jsondat...
3.15625
3
projects/analog/weather.py
romilly/explorer-hat-examples
3
50802
<filename>projects/analog/weather.py import explorerhat as eh from time import sleep while True: v1 = eh.analog.one.read() celsius = 100.0 * (v1 - 0.5) fahrenheit = 32 + 9 * celsius / 5.0 print('Temperature is %4.1f degrees C or %4.1f degrees F' % (celsius, fahrenheit)) v2 = eh.analog.two...
3.328125
3
cartselection/utr.py
RahmanTeamDevelopment/CARTSelection
0
50803
import sys def utr_selection(transcripts, log): """UTR selection function""" tmp = [] for t in transcripts: t.utr5_exons = t.utr5_regions() t.utr3_exons = t.utr3_regions() t.utr5_start = t.start if t.strand == '+' else t.end - 1 t.utr3_end = t.end - 1 if t.strand == '+' el...
2.734375
3
sdat/sdat_cell.py
Chipeyown/SPLiT-seq-Data-Analysis_Toolkit
4
50804
import multiprocessing import os import subprocess import sys import threading import time import sdat.tmp as sdat try: from Queue import Queue #for python2 except: from queue import Queue #for python3 def cell(): print("") print("######################################################################...
2.703125
3
income_expense_tracker/authentication/views.py
gokul-sarath07/Nymblelabs-Expence-Tracker
0
50805
<reponame>gokul-sarath07/Nymblelabs-Expence-Tracker<filename>income_expense_tracker/authentication/views.py from django.views import View from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mod...
2.4375
2
news_search/utils/big2gbk.py
luzy99/news-spider
6
50806
from ..utils.langconv import Converter def Traditional2Simplified(sentence): ''' 将sentence中的繁体字转为简体字 :param sentence: 待转换的句子 :return: 将句子中繁体字转换为简体字之后的句子 ''' sentence = Converter('zh-hans').convert(sentence) return sentence
2.640625
3
Covid India Stats App/app.py
avinashkranjan/PraticalPythonProjects
930
50807
import json from flask import Flask, request import requests # Token that has to be generated from webhook page portal ACCESS_TOKEN = "random <PASSWORD>" # Token that has to be added for verification with developer portal VERIFICATION_TOKEN = "abc" # Identifier payloads for initial button C19INDIA = "C19INDIA" app = Fl...
2.953125
3
Parser/language.py
JellevanCappelle/OrganisedAssembly
0
50808
<reponame>JellevanCappelle/OrganisedAssembly from arpeggio import Optional, ZeroOrMore, OneOrMore, Sequence, Not, EOF from arpeggio import RegExMatch as regex from arpeggio import ParserPython from arpeggio import NonTerminal from arpeggio.export import PTDOTExporter import sys import json # load instructions and othe...
2.109375
2
django_model_info/management/commands/model_info.py
jacklinke/django-model-info
22
50809
import os from pathlib import Path from django.apps import apps as django_apps from django.conf import settings from django.core.management.base import BaseCommand, CommandParser, DjangoHelpFormatter from django.db.models import Model from rich.align import Align from rich.bar import Bar from rich.console import Conso...
1.726563
2
redis_ako.py
mesh-umn/TF.AKO
11
50810
<gh_stars>10-100 import os import sys import time import numpy as np import tensorflow as tf from tflearn.data_utils import to_categorical from tflearn.datasets import cifar10 import redis_ako_config from redis_ako_cluster import build_cluster from redis_ako_model import build_model from redis_ako_queue import Gradie...
2.5
2
itspylearning/user_service.py
HubertJan/itspylearning
0
50811
<gh_stars>0 import asyncio from typing import Any, Callable, Dict, List, Optional, Union, TYPE_CHECKING import aiohttp import json import datetime import math from aiohttp.client import ClientSession from itspylearning.data_objects.course import Course from itspylearning.data_objects.hierarchry_member import Hierarc...
2.3125
2
migrations/versions/57b1d6fb5b9a_.py
jindrichsamec/kontejnery
0
50812
<reponame>jindrichsamec/kontejnery """empty message Revision ID: 57b1d6fb5b9a Revises: <PASSWORD> Create Date: 2017-04-09 15:14:46.711805 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '57b1d6fb5b9a' down_revision = '<PASSWORD>' branch_labels = None depends_on...
1.601563
2
core_scripts/startup_config.py
Nijta/project-NN-Pytorch-scripts
150
50813
<gh_stars>100-1000 #!/usr/bin/env python """ startup_config Startup configuration utilities """ from __future__ import absolute_import import os import sys import torch import importlib import random import numpy as np __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2020, Xin Wang" def set_...
2.328125
2
lib/database.py
dpfried/mocs
8
50814
<filename>lib/database.py from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import _declarative_constructor from mocs_config import SQL_CONNECTION from re import sub, compile ### configur...
2.328125
2
ryu/app/network_awareness/algorithms/Relaxation.py
coolMarlon/ryu
0
50815
class Relaxation: def __init__(self): self.predecessors = {} def buildPath(self, graph, node_from, node_to): nodes = [] current = node_to while current != node_from: if self.predecessors[current] == current and current != node_from: return None ...
3.28125
3
src/sportsdata/nba/teams/__init__.py
OrangeCardinal/sportsdata
0
50816
from .atlanta_hawks import AtlantaHawks from .boston_celtics import BostonCeltics from .brooklyn_nets import BrooklynNets from .chicago_bulls import ChicagoBulls from .cleveland_cavaliers import ClevelandCavaliers from .denver_nuggets import DenverNuggets ...
1.414063
1
music/index/urls.py
xeroCBW/music
0
50817
from django.urls import path from django.conf.urls import url,include from . import views urlpatterns = [ path('',views.indexView,name='index'), ]
1.585938
2
tests/test_auth.py
matrixorz/firefly
247
50818
<filename>tests/test_auth.py # coding=utf-8 from __future__ import absolute_import from flask import url_for from flask_login import current_user import pytest from firefly.models.user import User @pytest.mark.usefixtures('client_class') class TestAuth: def setup(self): self.username = 'foo' sel...
2.625
3
splparser/rules/common/statsfnrules.py
lowell80/splparser
31
50819
<reponame>lowell80/splparser import re from splparser.parsetree import * from splparser.rules.common.evalfnexprrules import * from splparser.rules.common.simplevaluerules import * CANONICAL_FUNCTIONS ={ "c": "count", "dc": "distinct_count", "avg": "mean" } ANY_DOMAIN = ["c", "count", "dc", "distinc...
2.21875
2
sendemail.py
mesperrus/grailed-notifications
0
50820
# login.txt should contain address on first line and app specific password on the second # # <EMAIL> # <PASSWORD> def sendEmail(subject, message_): import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText with open("login.txt") as f: login = f.read()....
2.890625
3
dockit/tests/backends/common.py
zbyte64/django-dockit
5
50821
from dockit import schema from dockit import backends from django.utils import unittest from mock import Mock, patch class SimpleSchema(schema.Schema): #TODO make a more complex testcase charfield = schema.CharField() class SimpleDocument(schema.Document): #TODO make a more complex testcase charfield = sche...
2.21875
2
tests/server/risk_scores/risk_assessment/test_risk_assessment.py
Code-the-Change-YYC/YW-NLP
1
50822
<reponame>Code-the-Change-YYC/YW-NLP<gh_stars>1-10 from server.risk_scores.risk_assessment import get_current_risk_score, get_risk_assessment, RiskAssessment from unittest import TestCase, main from unittest.mock import patch from server.schemas.submit import Form mock_program_to_risk_map = { 'child care (hub)': 5...
2.015625
2
05.06.21 - Cria lista e procurar elemento.py
AdamastorLinsFrancaNetto/python-iniciante
0
50823
# Escreva um script Python que leia um vetor A de 10 elementos inteiros e um valor qualquer inteiro X. Em seguida, realize uma busca no arranjo a fim de verificar se o valor X existe no imprima na tela "ACHEI" se o valor X existir em A e "NAO ACHEI" caso contrário. listNumbers = [] for i in range(10): n = int(inpu...
3.5625
4
android_test_inspector/inspector.py
luiscruz/android_test_inspector
6
50824
<gh_stars>1-10 """Matchers to find test suite usage in Android projects.""" import os import fnmatch import re import abc import json import urllib.request, urllib.error # pylint: disable=too-few-public-methods # pylint: disable=invalid-name _FILE_IGNORE = [ '*.jar', '*.aar', '*.zip', 'index', '*...
2.375
2
script.module.urlresolver/lib/urlresolver/plugins/vidbull.py
Reapercrew666/crypt
1
50825
''' Vidbull urlresolver plugin Copyright (C) 2013 Vinnydude This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is di...
2.21875
2
markyp_bootstrap4/buttons.py
volfpeter/markyp-bootstrap4
21
50826
""" Bootstrap button elements. See https://getbootstrap.com/docs/4.3/components/buttons/. """ from typing import Optional, Type from markyp import ElementType, PropertyDict, PropertyValue from markyp.elements import Element, StandaloneElement from markyp_html import join from markyp_html.forms import button, input_,...
3.015625
3
scripts/rpc/ioat.py
webglider/spdk
6
50827
<reponame>webglider/spdk<gh_stars>1-10 from .helpers import deprecated_alias @deprecated_alias('ioat_scan_copy_engine') @deprecated_alias('scan_ioat_copy_engine') def ioat_scan_accel_engine(client, pci_whitelist): """Scan and enable IOAT accel engine. Args: pci_whitelist: Python list of PCI addresses...
2.1875
2
CNSPP/classic.py
s0uthwood/CNSPP-lab
0
50828
from .utils import inverse as _inverse, gcd as _gcd import itertools as _itertools import re as _re import copy as _copy def affine_encrypt(msg, k, b): res = '' for c in msg: if c.isalpha() == False: res += c continue t = ord('A') if c.isupper() else ord('a') re...
2.9375
3
gainsworth/tests/core_tests.py
razzlestorm/Gainsworth
8
50829
from pathlib import Path from discord.ext import commands from gainsworth.cogs.gainsworth_core import Gainsworth bot = commands.Bot(command_prefix="$") def test_logger(): g = Gainsworth(bot) assert g.logger def test_logfile(): path = Path("gainsworth_debug.log") assert path.is_file()
2.375
2
models/__init__.py
milesgray/ImageFunctions
0
50830
from .registry import register, make, lookup from . import edsr from . import rcan from . import ddbpn from . import rdn, rdn_v2, rdan, mardan, rdaidbn from . import imdn from . import freq_discriminator, mlp_discriminator from . import mlp from . import liif, liif_inr, itnsr from . import dexined_v2, dexined_...
0.929688
1
docs/source/doc_data.py
MacHu-GWU/learn_sphinx-project
0
50831
<filename>docs/source/doc_data.py # -*- coding: utf-8 -*- from rstobj.directives import ListTable ltable_user = ListTable( data=[["id", "name"], [1, "Alice"], [2, "Bob"], [3, "Cathy"]], title="User", index=False, header=True, class_="sortable", ) doc_data = dict( ltable_user=ltable_user, ...
1.960938
2
ParametersSet_Sheets.py
gnomesoup/pyDynamo
0
50832
<reponame>gnomesoup/pyDynamo<filename>ParametersSet_Sheets.py<gh_stars>0 import clr import sys clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference('RevitAPIUI') from Autodesk.Revit.UI import * clr.AddReference('RevitServices') import RevitServices from RevitServices.Persistence import Docum...
1.789063
2
examples/testnet/download.py
andef4/interpret-segmentation
0
50833
<reponame>andef4/interpret-segmentation import requests import os import inspect from pathlib import Path import shutil import gzip import tarfile import sys if __name__ == '__main__': path = Path(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))) out_file = path / 'testnet.pth' i...
2.671875
3
ppserver/__init__.py
ianthomasmccarthy/PixelPals
0
50834
from flask import Flask from celery import Celery # Create App app = Flask(__name__) app.config.from_object('config.Config') # Create pp return from ppserver.pixel.models import PPFeedback pp = PPFeedback() # Create Celery object celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL']) celery.conf.update(a...
2.21875
2
exercisefolder/views_sitemap.py
shagun30/djambala-2
0
50835
# -*- coding: utf-8 -*- """ /dms/exercisefolder/views_sitemap.py .. zeigt die Sitemap des aktuellen Lernarchivs an Django content Management System <NAME> <EMAIL> Die Programme des dms-Systems koennen frei genutzt und den spezifischen Beduerfnissen entsprechend angepasst werden. 0.01 02.05.2008 Beginn de...
1.960938
2
test/env.py
personnelink/shellish
4
50836
<reponame>personnelink/shellish<gh_stars>1-10 import shellish import unittest import os class EnvTests(unittest.TestCase): def setUp(self): self.env_save = env = os.environ os.environ = env.copy() def tearDown(self): os.environ = self.env_save def setenv(self, key, value): ...
2.828125
3
metrics/utils.py
rickardomc/setvae
45
50837
<filename>metrics/utils.py import torch def unmask(x: torch.tensor, x_mask: torch.BoolTensor): # only applies for const-sized sets bsize = x.shape[0] n_points = (~x_mask).sum(-1)[0] assert ((~x_mask).sum(-1) == n_points).all() return x[~x_mask].reshape((bsize, n_points, -1))
2.5
2
tests/test_levels.py
msabramo/twiggy
0
50838
import sys if sys.version_info >= (2, 7): import unittest else: try: import unittest2 as unittest except ImportError: raise RuntimeError("unittest2 is required for Python < 2.7") import sys from twiggy import levels class LevelTestCase(unittest.TestCase): def test_display(self): ...
3.0625
3
app/app_v4.py
dlumian/emotion_face_classification
1
50839
import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from flask import Flask, render_template, request, jsonify, flash, redirect, url_for import pickle from FaceDetector_v7 import EmotionFacePredictor import json from werkzeug.utils import secure_filename import tensorflow as tf global gr...
2.171875
2
job/migrations/0004_auto_20210302_0817.py
zakiladj/django-job-board
0
50840
<gh_stars>0 # Generated by Django 3.1.7 on 2021-03-02 08:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('job', '0003_job_discription'), ] operations = [ migrations.AddField( model_name='job', name='experience'...
1.710938
2
eris/decorators/hook.py
xesxen/eris
1
50841
""" Hook decorator. """ import logging from eris.decorators import BaseDecorator from eris.events.hooks import Hook as EventHook LOGGER = logging.getLogger(__name__) class Hook(BaseDecorator): """ Hook decorator, used for more easily setting up handlers for messages. """ hook: EventHook = None def __...
2.984375
3
real-world-examples/colorama_example.py
AlienCoders/learning-python
19
50842
#!/usr/bin/python from colorama import init, Fore, Back, Style init(autoreset=True) print(Fore.RED + 'some red text') print(Fore.GREEN + 'some green text') print(Fore.BLUE + 'some blue text') print(Fore.CYAN + 'some cyan text') print(Fore.MAGENTA + 'some magenta text') print(Back.GREEN + 'and with a green background...
2.671875
3
sub2/db_init.py
myccpb08/AI_2nd_Pos_Neg
0
50843
<reponame>myccpb08/AI_2nd_Pos_Neg import sqlite3 conn = sqlite3.connect('app.db') c = conn.cursor() c.execute('''CREATE TABLE search_history (created_datetime TIMESTAMP DEFAULT CURRENT_TIMESTAMP, id INTEGER PRIMARY KEY, question text, answer INTEGER)''') conn.co...
2.421875
2
Mundo_1/Ex014.py
alinenog/Mundo_Python-1-2-3
0
50844
<reponame>alinenog/Mundo_Python-1-2-3<filename>Mundo_1/Ex014.py #Exercício Python 14: # Escreva um programa que converta uma temperatura digitando em graus Celsius e converta para graus Fahrenheit. print('__________________________________') print(' CONVERSOR DE TEMPERATURA ') print('_____________________...
4.4375
4
02-QLabel/QLabel1.py
yurensan/PyQt5-Tutorial
0
50845
<filename>02-QLabel/QLabel1.py import sys from PyQt5.QtWidgets import QLabel,QHBoxLayout,QWidget,QApplication,QMainWindow class QLabelDemo(QMainWindow): def __init__(self): super(QLabelDemo, self).__init__() #设置窗口大小 self.resize(400, 150) #设置窗口标题 self.setWindowTitle("QLabelD...
3.1875
3
genomepy/plugins/__init__.py
tilschaef/genomepy
146
50846
<reponame>tilschaef/genomepy """Plugin class, modules & related functions""" import os import re from genomepy.config import config __all__ = ["Plugin", "manage_plugins", "get_active_plugins"] class Plugin: """Plugin base class.""" def __init__(self): self.name = convert(type(self).__name__).replac...
2.453125
2
examples/earthquake.py
paulorauber/pgm
19
50847
<reponame>paulorauber/pgm from model.factor import RandomVar from model.factor import CPD from model.gd import BayesianNetwork from inference.exact import VariableElimination from inference.exact import JointMarginalization from inference.approximate import ForwardSampler def main(): B = RandomVar('B', 2) E =...
2.390625
2
propose_list.py
mongo-tools/text-similarity
3
50848
''' Program works for current directory just be sure to have .txt data there and to output results to a file or somewhere ''' import os import codecs import numpy as np import itertools import glob import sys from sklearn.feature_extraction.text import TfidfVectorizer def allglob(args): return ...
3.046875
3
tests/test_ftplib.py
ankane/python-timeouts
6
50849
from .conftest import TestTimeouts from ftplib import FTP from socket import timeout class TestFtplib(TestTimeouts): def test_connect(self): with self.raises(timeout): with FTP(self.connect_host(), timeout=1) as ftp: ftp.login() def test_read(self): with self.raise...
2.71875
3
aoi_envs/Mobile.py
landonbutler/Learning-Connectivity
2
50850
from aoi_envs.MultiAgent import MultiAgentEnv import numpy as np class MobileEnv(MultiAgentEnv): def __init__(self, agent_velocity=1.0, initialization='Random', biased_velocities=False, flocking=False, random_acceleration=True, aoi_reward=True, flocking_position_control=False, num_agents=40): ...
2.4375
2
tests/writer/unit/redis_backend/test_redis_connection_handler.py
FinnStutzenstein/openslides-datastore-service
2
50851
from unittest.mock import MagicMock import pytest from datastore.shared.di import injector from datastore.shared.services import EnvironmentService, ShutdownService from datastore.writer.redis_backend.connection_handler import ConnectionHandler from datastore.writer.redis_backend.redis_connection_handler import ( ...
2.0625
2
GermlineFromIMGT.py
williamdlees/BioTools
0
50852
# Copyright (c) 2015 <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 to use, copy, modify, merge, publish, distribute, sub...
1.140625
1
app/router.py
sigma8/test_icreate
0
50853
from typing import List from webbrowser import get from fastapi import APIRouter, Response from .schemas import TodoItem, TodoPayload, UserPayload #,User #-----Agregado jtortolero----- from sqlalchemy.orm import Session from fastapi import Depends, HTTPException, status from .models import Item, User from .utils impor...
2.859375
3
5 - merging dataframes with pandas/concatenating horizontally to get MultiIndexed columns.py
Baidaly/datacamp-samples
0
50854
''' It is also possible to construct a DataFrame with hierarchically indexed columns. For this exercise, you'll start with pandas imported and a list of three DataFrames called dataframes. All three DataFrames contain 'Company', 'Product', and 'Units' columns with a 'Date' column as the index pertaining to sales transa...
4.3125
4
setup.py
leeshangqian/pytransmute
1
50855
from setuptools import setup setup( name='pytransmute', version='0.1.0', packages=['pytransmute', 'pytransmute.plugin'], package_data={"pytransmute": ["py.typed"]}, url='https://github.com/leeshangqian/pytransmute', license='Apache-2.0 License', author='<NAME>', author_email='<EMAIL>', ...
1.375
1
tkinter_gui/class09_02.py
chmendonca/python
0
50856
<reponame>chmendonca/python from tkinter import * from PIL import ImageTk,Image next_image = 0 root = Tk() root.title('Learn to insert Icons, Images and Exit Button') root.iconbitmap(r'C:\myScripts\GitHub\python\tkinter_gui\images\paperPlane.ico') my_img0 = ImageTk.PhotoImage(Image.open(r'C:\myScripts\GitHub\python...
3.421875
3
Bugscan_exploits-master/exp_list/exp-1275.py
csadsl/poc_exp
11
50857
#!/usr/bin/env python # -*- coding: utf-8 -*- #__Author__ = 01001000entai #_PlugName_ = wisedu_elcs_sqli #_FileName_ = wisedu_elcs_sqli.py #__Refer___ = http://www.wooyun.org/bugs/wooyun-2010-071006 import time def assign(service, arg): if service == 'wisedu_elcs': return True, arg def audit...
2.265625
2
wbb/utils/read_lines.py
Imran95942/userbotisl
1
50858
<filename>wbb/utils/read_lines.py from random import choice async def random_line(fname): with open(fname) as f: data = f.read().splitlines() return choice(data)
2.46875
2
insurance/tests.py
simonprast/wopi-engine
0
50859
<reponame>simonprast/wopi-engine<filename>insurance/tests.py<gh_stars>0 import json import re from django.http import HttpRequest from django.http.response import JsonResponse from django.test import TestCase from django.views import View from insurance.insurance_calc import calc_insurance from insurance.haushaltsver...
2.15625
2
specklepy/api/credentials.py
gjedlicska/speckle-py
26
50860
<reponame>gjedlicska/speckle-py import os from warnings import warn from pydantic import BaseModel from typing import List, Optional from urllib.parse import urlparse, unquote from specklepy.logging import metrics from specklepy.api.models import ServerInfo from specklepy.api.client import SpeckleClient from specklepy....
2.375
2
server/turb/WeatherReportSimulator/Flight_Statistics/Statistics_Fun.py
lusean/turbulence-sim
0
50861
<filename>server/turb/WeatherReportSimulator/Flight_Statistics/Statistics_Fun.py<gh_stars>0 import csv from .. import definitions def airport_statistics(): """Returns a tuple containing airport IATA codes, a dictionary containing their probabilities of being the origin of a flight, and their conditional proba...
3.5
4
aioeventbus/exceptions.py
momocow/python-aioeventbus
2
50862
<filename>aioeventbus/exceptions.py<gh_stars>1-10 from .typing import EventBase, Handler class HandlerError(Exception): def __init__(self, handler: Handler, event: EventBase): handler_name = handler.__name__ if hasattr(handler, "__name__") \ else repr(handler) super().__init__(f"Handle...
2.609375
3
cmcft/tools/graph/nodes.py
alanaberdeen/Automated-Cell-Tracking
5
50863
<reponame>alanaberdeen/Automated-Cell-Tracking # nodes.py # Functions to build nodes in graph structure. # Import external packages from itertools import combinations from cost_calcs import * def build(g, l_cells, r_cells, beta): # build # Initialise the required nodes for the graph structure. # # P...
2.953125
3
skimage/exposure/__init__.py
RKDSOne/scikit-image
1
50864
from .exposure import histogram, equalize, equalize_hist from .exposure import rescale_intensity, cumulative_distribution from ._adapthist import equalize_adapthist
1.210938
1
scripts/loss.py
headupinclouds/LightNet
737
50865
from torch.autograd import Variable import torch.nn.functional as F import scripts.utils as utils import torch.nn as nn import numpy as np import torch class CrossEntropy2d(nn.Module): def __init__(self, size_average=True, ignore_label=255): super(CrossEntropy2d, self).__init__() self.size_average...
2.90625
3
app/resources/tenders.py
BuildForSDG/team-279-vTender_Backend
2
50866
<gh_stars>1-10 from flask import request, jsonify from flask_restful import Resource, reqparse, marshal from app import db from app.resources import create_or_update_resource, delete_resource from app.models import Tender, TenderSchema, CompanySchema, Company from app.serializers import tender_serializer from sqlalchem...
2.4375
2
Element_Analytics/apps/upload/migrations/0005_auto_20180430_2348.py
drproduck/Element-Analytics
1
50867
# Generated by Django 2.0.2 on 2018-05-01 06:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('upload', '0004_auto_20180430_2344'), ] operations = [ migrations.RemoveField( model_name='logfile', name='id', ...
1.523438
2
models/pegasusFiles.py
HadiOfBBG/pegasusrises
0
50868
from google.appengine.ext import db from google.appengine.api import urlfetch class PegasusFiles(db.Model): name = db.StringProperty() file = db.BlobProperty() added = db.DateTimeProperty(auto_now_add=True)
2.28125
2
examples/demo_DDPG_TD3_SAC.py
Yonv1943/DL_RL_Zoo
129
50869
<gh_stars>100-1000 <<<<<<< HEAD import sys import gym from elegantrl.train.run import train_and_evaluate, train_and_evaluate_mp from elegantrl.train.config import Arguments from elegantrl.agents.AgentDDPG import AgentDDPG from elegantrl.agents.AgentTD3 import AgentTD3 from elegantrl.agents.AgentSAC import Agent...
2.03125
2
offer_coupon_voucher/admin.py
Parveen3300/Reans
0
50870
<filename>offer_coupon_voucher/admin.py from django.contrib import admin from datetime import datetime from .models import Offer, VoucherSetConfiguration, Voucher, VoucherApplication # Register your models here. def make_active_data(modeladmin, request, queryset): """ make_active_data: activate the data f...
2.140625
2
pycam/pycam/Plugins/ModelSupport.py
pschou/py-sdf
0
50871
""" Copyright 2011 <NAME> <<EMAIL>> This file is part of PyCAM. PyCAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. PyCAM is distributed...
1.914063
2
tests/unit/test_request.py
ecmwf-projects/polytope-server
0
50872
# # Copyright 2022 European Centre for Medium-Range Weather Forecasts (ECMWF) # # 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 req...
1.976563
2
api/tests/opentrons/hardware_control/modules/test_hc_tempdeck.py
Opentrons/protocol_framework
2
50873
<filename>api/tests/opentrons/hardware_control/modules/test_hc_tempdeck.py import asyncio from mock import AsyncMock import pytest from opentrons.drivers.rpi_drivers.types import USBPort from opentrons.drivers.temp_deck import AbstractTempDeckDriver from opentrons.hardware_control import modules, ExecutionManager @...
2.296875
2
code/extract.py
kobigurk/hadeshash
0
50874
import sys array = eval(sys.argv[1]) index = int(sys.argv[2]) print(array[index])
2.46875
2
Class7/ex5.py
Tina8S/PythonNetworkAutomation-Course
0
50875
#!/usr/bin/env python import yaml from pprint import pprint as pp from napalm import get_network_driver import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # Read YAML file with open("my_devices.yml", 'r') as strea...
2.390625
2
demo/conf_set/otb/forecasters.py
shuoli90/PAC-confidence-set
6
50876
<reponame>shuoli90/PAC-confidence-set import os, sys import math import torch as tc import torch.nn as nn import torch.tensor as T from torchvision import models from torchvision import transforms sys.path.append("../../../") from models.BaseForecasters import Forecaster from .boundingbox import BoundingBox from .he...
2
2
tests/test_gethost.py
EFXCIA/Infoblox-API-Python
5
50877
import responses from requests.exceptions import HTTPError from infoblox import infoblox from . import testcasefixture class TestGetHost(testcasefixture.TestCaseWithFixture): fixture_name = 'host_get' @classmethod def setUpClass(cls): super(TestGetHost, cls).setUpClass() with responses.Re...
2.453125
2
setup.py
nobrin/omron-2jcie-bu01
1
50878
#!/usr/bin/env python3 # Project: OMRON 2JCIE-BU01 # Module: from setuptools import setup import sys if sys.version_info < (3, 6): raise NotImplementedError("Sorry, you need at least Python 3.6 to use OMRON 2JCIE-BU01.") import omron_2jcie_bu01 MODNAME = "omron_2jcie_bu01" setup( name = "omron-...
1.945313
2
lwt/__init__.py
port-zero/lwt
3
50879
import time from lwt.args import parse_args from lwt.processes import filter_processes from lwt.report import report def run(): args = parse_args() while True: offending = filter_processes(args) report(offending) if not args.monitor: return time.sleep(ar...
2.25
2
code/figures/supplement/figS1_induced_expression_plots.py
gchure/quantitative_proteome
2
50880
<filename>code/figures/supplement/figS1_induced_expression_plots.py # %% import numpy as np import pandas as pd import matplotlib.pyplot as plt import prot.viz import prot.size import prot.estimate constants = prot.estimate.load_constants() colors = prot.viz.plotting_style() dataset_colors = prot.viz.dataset_colors() ...
2.140625
2
get_reco.py
Tintri/http_python
6
50881
#!/usr/bin/python # -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2015 Tintri, Inc. # # 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 withou...
1.8125
2
kombu/tests/test_connection.py
public/kombu
0
50882
from __future__ import absolute_import from __future__ import with_statement import pickle from nose import SkipTest from kombu import Connection, Consumer, Producer, parse_url from kombu.connection import Resource from .mocks import Transport from .utils import TestCase from .utils import Mock, skip_if_not_module ...
2.25
2
python_boilerplate/__init__.py
Mathanraj-Sharma/python_boilerplate
4
50883
"""Top-level package for Python Boilerplate.""" __author__ = """<NAME>""" __email__ = "<EMAIL>" __version__ = "0.1.0"
1.015625
1
api/predict.py
ABHISHEK-T-S/MAX-Toxic-Comment-Classifier
51
50884
<reponame>ABHISHEK-T-S/MAX-Toxic-Comment-Classifier # # Copyright 2018-2019 IBM Corp. 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/licens...
2.234375
2
PyObjCTest/test_nshost.py
linuxfood/pyobjc-framework-Cocoa-test
0
50885
import Foundation from PyObjCTest.testhelper import PyObjC_TestClass3 from PyObjCTools.TestSupport import TestCase class TestNSHost(TestCase): def testCreation(self): # # This gives an exception on GNUstep: # Foundation.NSRecursiveLockException - unlock: failed to unlock mutex # ...
2.125
2
server/__init__.py
ponyfat/httpsServer
0
50886
import httpsServer def server(): httpsServer.server()
1.273438
1
tests/test_vscode_extensions.py
AlexCovizzi/vscodenv
17
50887
<gh_stars>10-100 import unittest import os import shutil from vscodenv import vscode_extensions from vscodenv import utils class TestVscodeExtensions(unittest.TestCase): def setUp(self): # setup fake extensions self.extension_to_install = 'cstrap.python-snippets' # lightweight extension se...
2.421875
2
venv/lib/python3.8/site-packages/azureml/_workspace/_utils.py
amcclead7336/Enterprise_Data_Science_Final
0
50888
<filename>venv/lib/python3.8/site-packages/azureml/_workspace/_utils.py # --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import time import requests import uuid import random fro...
2.046875
2
namecom/result_models.py
CtheSky/namecom
3
50889
<reponame>CtheSky/namecom """ namecom: result_models.py Defines response result models for the api. <NAME> [https://github.com/CtheSky] License: MIT """ class RequestResult(object): """Base class for Response class. Attributes ---------- resp : http response from requests.Response stat...
2.859375
3
integration_tfs_clockify.py
paulossjunior/clockify_integration
0
50890
from tfs_integration import TFS_Integration tfs = TFS_Integration('') projects = tfs.get_projects() # Pegando os times e os membros de cada time for project in projects: print ("ID: "+ project.id+" - "+project.name) teams = tfs.get_teams(project_id=project.id) for team in teams: print ("Team Name...
2.890625
3
tests/test_json_field.py
mixcloud/django-extensions
1
50891
<reponame>mixcloud/django-extensions from django.test import TestCase from .testapp.models import JSONFieldTestModel class JsonFieldTest(TestCase): def test_char_field_create(self): j = JSONFieldTestModel.objects.create(a=6, j_field=dict(foo='bar')) self.assertEqual(j.a, 6) def test_default(...
2.609375
3
duke_filewalker/__init__.py
mbrner/duke_filewalker
0
50892
import os import sys from .extraction import Pattern, Extraction __all__ = ['Pattern', 'Extraction', 'Walker'] class Walker: def __init__(self, pattern, followlinks=False): if not pattern.startswith('/'): top = os.getcwd() self.pattern = Pattern(os.path.join(top, pattern)) ...
2.625
3
ros_camera_tsdf_fusion.py
jaydenwu17/cup_imagine
13
50893
<filename>ros_camera_tsdf_fusion.py # Capture different color and depth frames and the corresponding pose of the camera with ROS. # Author: <NAME> # Institution: Johns Hopkins University # Date: Nov 24, 2019 from __future__ import print_function import os import time import rospy import roslib from sensor_msgs.msg ...
2.453125
2
1-50/Problem4.py
xiaoyougang/ProjectEulerSolution
0
50894
def reverse(n): reversed = 0 while n > 0: reversed = 10*reversed + n%10 n = n/10 return reversed def isPalindrome(n): return n == reverse(n) largestPalindrome = 0 a = 999 while a >= 100: b = 999 while b >= a: if a*b <= largestPalindrome: break if isPa...
3.84375
4
slack_cache/slack_cache/apps/messages_app/scripts/_test_messages.py
learningdollars/slack-caching
0
50895
#!/usr/bin/python import os import slack import json client = slack.WebClient(token=os.environ['SLACK_API_TOKEN']) print("channels_retrieve_test: \n" ) print(client.channels_list()) # still testing files to struct a correct model for it print("channel test:\n ") client.channels_history(channel='CQNUEAH2N') print("rep...
2.28125
2
tests/features/swrl_parser.py
mpetyx/pyrif
0
50896
from lettuce import step, world @step("the empty xml swrl document") def step_impl(step): """ :type step lettuce.core.Step """ pass @step("I retrieve (\d+)") def step_impl(step, expected): """ :type step lettuce.core.Step """ assert int(expected) == 1
2.375
2
alipay/aop/api/domain/AlipayEcoTextDetectModel.py
antopen/alipay-sdk-python-all
213
50897
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.SpiDetectionTask import SpiDetectionTask class AlipayEcoTextDetectModel(object): def __init__(self): self._task = None @property def task(self): retu...
2.1875
2
ezdisteach/formats/_odpcourse.py
call-learning/ez-disteach
0
50898
<filename>ezdisteach/formats/_odpcourse.py # -*- coding: utf-8 -*- """ EZDisTeach ODP Course format support """ from io import BufferedWriter import zipfile import tempfile from odfdo import Document title = 'odpcourse' extensions = ('odp',) def export_stream(model, **kwargs): pass def import_stream(model, in...
2.84375
3
esphomeyaml/components/sensor/max6675.py
johnerikhalse/esphomeyaml
1
50899
<reponame>johnerikhalse/esphomeyaml import voluptuous as vol import esphomeyaml.config_validation as cv from esphomeyaml import pins from esphomeyaml.components import sensor from esphomeyaml.components.spi import SPIComponent from esphomeyaml.const import CONF_CS_PIN, CONF_MAKE_ID, CONF_NAME, CONF_SPI_ID, \ CONF_...
2.09375
2