max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
tests/logger/check_logger.py
rancp/ducktape-docs
0
26900
<reponame>rancp/ducktape-docs # Copyright 2016 Confluent Inc. # # 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 ...
2.109375
2
Egzersiz/ege/egzersizSet.py
ibrahimediz/ornekproje
0
26901
first_angle = int(input("Lütfen ilk açıyı giriniz: ")) second_angle = int(input("Lütfen ilk açıyı giriniz: ")) gelenAcilar = {first_angle, second_angle} eskenar = {60, 60, 60} dik = {25, 65, 90} ikizKenar = {45, 45, 90} cesitKenar = {120, 41, 19} if gelenAcilar.intersection(ikizKenar): print("ikizkenar") elif ge...
3.734375
4
src/tests/presale/test_customer.py
n0emis/pretix
0
26902
<reponame>n0emis/pretix # # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License ...
1.648438
2
build/python_module.py
Romit-Maulik/CBurgers
5
26903
print("From python: Within python module") import os,sys HERE = os.getcwd() sys.path.insert(0,HERE) import numpy as np import tensorflow as tf import matplotlib.pyplot as plt data_array = np.zeros(shape=(2001,258)) # Very important that this matches the number of timesteps in the main solver x = np.arange(start=0,st...
2.4375
2
Tutorials/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_iso_catalyst_3d.py
ylunalin/amrex
0
26904
from paraview.simple import * from paraview import coprocessing #-------------------------------------------------------------- # Code generated from cpstate.py to create the CoProcessor. # ParaView 5.4.1 64 bits #-------------------------------------------------------------- # Global screenshot output options imag...
2.453125
2
tests/integration/test_integration_foreign_payment_codes.py
pwitab/visma
5
26905
<filename>tests/integration/test_integration_foreign_payment_codes.py from visma.models import ForeignPaymentCodes class TestForeignPaymentCodes: def test_list_foregin_payment_codes(self): codes = ForeignPaymentCodes.objects.all() assert len(codes) is not 0
1.914063
2
performance/forms.py
linikerunk/tcc-people-analytics
0
26906
""" This is a forms.py that helps to work on the payload of front-end """ from django import forms from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.forms import ModelForm from django.forms.models import inlineformse...
2.21875
2
answers/Python/@oseme-techguy/03-word-in-reverse.py
Flipponachi/20-questions
1
26907
<reponame>Flipponachi/20-questions<filename>answers/Python/@oseme-techguy/03-word-in-reverse.py """ Solution to Word in Reverse """ if __name__ == '__main__': while True: word = input('Enter a word: ') word = str(word) i = len(word) reversed_word = '' while i...
4.15625
4
src/spooq2/spooq2_logger.py
rt-phb/Spooq
0
26908
<reponame>rt-phb/Spooq """ Global Logger instance used by Spooq2. Example ------- >>> import logging >>> logga = logging.getLogger("spooq2") <logging.Logger at 0x7f5dc8eb2890> >>> logga.info("Hello World") [spooq2] 2020-03-21 23:55:48,253 INFO logging_example::<module>::4: Hello World """ import os import sys import...
2.5625
3
tests/extra/math_ops_test.py
yaroslavvb/imperative
20
26909
# Copyright 2015 Google 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 law or a...
2.0625
2
battlefortune/batchrunner.py
pfassina/BattleFortune
3
26910
import keyboard from logparser import parselog, validate_log import os from psutil import process_iter from pyautogui import click import subprocess from turnhandler import backupturn, clonegame, cleanturns, delete_log, delete_temp import yaml from time import sleep import threading import time import win32gui import w...
2.59375
3
preprocess.py
austinben/ECE470
0
26911
<reponame>austinben/ECE470 import numpy as np import os import cv2 import imutils import numpy as np from keras.preprocessing import image from matplotlib import pyplot as plt def crop_image(img): #convert the images to greyscale and add a slight guassian blur gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) b...
2.96875
3
tests/test_db_awssimpledb.py
gyrospectre/securitybot
3
26912
<gh_stars>1-10 import unittest from unittest.mock import MagicMock from unittest.mock import patch from securitybot.db.awssimpledb import DbClient from securitybot.exceptions import DbException SDB_CFG = { 'domain_prefix': 'secbot' } class TestChatProviderSlack(unittest.TestCase): @patch('securitybot.db....
2.390625
2
src/waiting.py
aquova/bouncer
5
26913
<reponame>aquova/bouncer import datetime, discord from dataclasses import dataclass from commonbot.utils import getTimeDelta @dataclass class AnsweringMachineEntry: name: str timestamp: datetime last_message: str message_url: str class AnsweringMachine: def __init__(self): self.waiting_lis...
2.703125
3
estimation/sample_z.py
yiruiliu110/eegnn
0
26914
""" this script contains the function to compute z from sparse v , pi and w """ import torch from estimation.truncated_poisson import TruncatedPoisson def compute_z(log_w: torch.tensor, pi: torch.sparse, c: torch.sparse): """ This function computes the class indicators given cluster proportion vector pi and ...
2.734375
3
test3/routes/MainRoute.py
Ca11MeE/dophon
1
26915
from dophon import * from dophon.annotation import * app = blue_print('main', __name__,url_prefix='/main') @RequestMapping('/', ['get']) @ResponseTemplate(['index.html']) def index(): return {} @GetRoute('/get') @ResponseTemplate(['index.html']) def get_index(): return {} @PostRoute('/post') @ResponseTe...
2.03125
2
paint_program.py
nick-tkachov/paint-program
0
26916
<filename>paint_program.py # ---------------------------------------------------------------------------------------------------# # Program Name: PAINT PROGRAM OOP ASSIGNMENT # Programmer: <NAME> # Date: November 20, 2017 # Input: Options at the beginning of the game allow user to select SMALL,MEDIUM,LARGE grid siz...
3.953125
4
Pcolor_Peaks.py
nchaparr/Sam_Output_Anls
0
26917
from __future__ import division from netCDF4 import Dataset import glob,os.path import numpy as np import numpy.ma as ma from scipy.interpolate import UnivariateSpline from matplotlib import cm from matplotlib import ticker import matplotlib.pyplot as plt #import site #site.addsitedir('/tera/phil/nchaparr/SAM2/sam_main...
2.375
2
plio/sqlalchemy_json/alchemy.py
kaitlyndlee/plio
11
26918
# Third-party modules try: import simplejson as json except ImportError: import json import sqlalchemy from sqlalchemy.ext import mutable # Custom modules from . import track class NestedMutable(mutable.MutableDict, track.TrackedDict): """SQLAlchemy `mutable` extension dictionary with nested change tracking."...
2.34375
2
squirrel/__main__.py
egxdigital/squirrel
0
26919
<gh_stars>0 """Squirrel Main This module contains the entry point code for the Squirrel program. """ from squirrel.squirrel import main if __name__ == '__main__': main()
1.367188
1
clairvoyance/preprocessing/__init__.py
ZhaozhiQIAN/SyncTwin-NeurIPS-2021
5
26920
<filename>clairvoyance/preprocessing/__init__.py from .encoding import ( MinMaxNormalizer, Normalizer, OneHotEncoder, ProblemMaker, ReNormalizer, StandardNormalizer, ) from .outlier_filter import FilterNegative, FilterOutOfRange __all__ = [ "FilterNegative", "FilterOutOfRange", "One...
1.390625
1
csrc/layers/cfc2.py
radu-dogaru/numpyCNN
0
26921
import cupy as cp from csrc.activation import SoftMax from csrc.layers.layer import Layer # Cu sinapsa comparativa GPU from csrc.comp_syn import cp_comp class C2FullyConnected(Layer): """Densely connected layer (comparative). Attributes ---------- size : int Number of neurons. activa...
2.375
2
ryu/app/network_ding/network_loss.py
nicePaul521/Ryu
0
26922
<filename>ryu/app/network_ding/network_loss.py from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER,DEAD_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.base.app_manager import lookup_service_brick from ryu.lib import hub from ryu.base import app_manager from operato...
1.898438
2
dealWithDataNpy.py
ItGirls/autoencoding_vi_for_topic_models
0
26923
<gh_stars>0 #!/usr/local/bin/python3 # -*-coding:utf-8 -*- """ @Date : 2020/7/28 下午7:01 @Author : zhutingting @Desc : ============================================== Blowing in the wind. === # ====================================================== @Project : autoencoding_vi_for_topic_models @FileName: dealWithDat...
2.59375
3
yoga/project/yoga/Database/migrations/0001_initial.py
sherlklee/yoga
0
26924
<reponame>sherlklee/yoga<filename>yoga/project/yoga/Database/migrations/0001_initial.py # Generated by Django 2.2.1 on 2019-06-03 11:46 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
1.632813
2
1GDL - Newmark.py
ZibraMax/tkinter-y-sus-cosas
0
26925
<filename>1GDL - Newmark.py<gh_stars>0 import math from tkinter import Tk, Canvas, W, E, NW from tkinter.filedialog import askopenfilename from tkinter import messagebox from scipy.interpolate import interp1d import time import numpy as np # Definición recursiva, requiere numpy # def B(t,P): # if len(P)==1: ...
2.421875
2
python/parserDev/brothon/live_simulator.py
jzadeh/aktaion
112
26926
"""LiveSimulator: This class reads in various Bro IDS logs. The class utilizes the BroLogReader and simply loops over the static bro log file, replaying rows and changing any time stamps Args: eps (int): Events Per Second that the simulator will emit events (default...
3.125
3
dataset_scripts/merge_results_as_csv.py
contec-korong/r3det-on-mmdetection
0
26927
<reponame>contec-korong/r3det-on-mmdetection from glob import glob import os import pandas as pd import argparse CATEGORIES_5 = ('background', 'small ship', 'large ship', 'individual container', 'grouped container', 'crane') CATEGORIES_15 = ('background', 'small ship', 'large ship', 'civilian aircraft', 'military airc...
2.484375
2
testcases/OpTestIPMILockMode.py
vaibhav92/op-test-framework
0
26928
<filename>testcases/OpTestIPMILockMode.py #!/usr/bin/env python2 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/testcases/OpTestIPMILockMode.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2015 # [+] International Business Machines ...
1.695313
2
scripts/update_pins.py
machow/gh-projects-cli
0
26929
import jq from dotenv import load_dotenv from gh_projects import ( update_project_with_repo_issues, fetch_all_issues, push_issues_to_project_next, ) load_dotenv() PROJECT_ID = "PN_kwHOACdIos4AAto7" # fetch_project_item_issue_ids("PN_kwHOACdIos4AAYbQ") all_issues = fetch_all_issues("machow", "pins-pyth...
2.234375
2
aiosvc/amqp/pool.py
acsnem/aiosvc
0
26930
<gh_stars>0 import logging import asyncio from aiosvc import Componet from .simple import Publisher # class Pool(Componet): # # def __init__(self, exchange, *, publish_timeout=5, try_publish_interval=.9, size=1, max_size=2, loop=None, start_priority=1): # super().__init__(loop=loop, start_priority=start_...
2.578125
3
src/result.py
danbailo/T2-Analise-Algoritmos
1
26931
<filename>src/result.py from knapsack import Knapsack, read_instances, organize_instances from os import path,mkdir from platform import system import json def number_solutions(n): with open('./number_of_results.txt', 'w') as result_txt: result_txt.write(n) try: number = int(n) if number == 0: ...
3.546875
4
parse.py
lpmi-13/telegramStressBot
0
26932
import nltk from nltk import word_tokenize def create_POS_tags(sentence): parsedSentence = word_tokenize(sentence) return nltk.pos_tag(parsedSentence)
2.6875
3
matplotlib_examples/examples_src/pylab_examples/ellipse_demo.py
xzlmark/webspider
3
26933
import matplotlib.pyplot as plt import numpy.random as rnd from matplotlib.patches import Ellipse NUM = 250 ells = [Ellipse(xy=rnd.rand(2)*10, width=rnd.rand(), height=rnd.rand(), angle=rnd.rand()*360) for i in range(NUM)] fig = plt.figure(0) ax = fig.add_subplot(111, aspect='equal') for e in ells: ax.ad...
2.84375
3
messageAnalysis.py
brennanmcmicking/message-counter
0
26934
<reponame>brennanmcmicking/message-counter # Standard library imports import glob import json import argparse # Third-party imports import pandas as pd # Parse command line parameters parser = argparse.ArgumentParser(description=''' Process facebook json message data. The messages directory from the d...
2.8125
3
robogen/rgkit/backup bots/KarenRoper10.py
andrewgailey/robogen
0
26935
# <NAME> 1.0 by Adam # http://robotgame.net/viewrobot/7819 import rg escapeSquares = [] globTurn = 0 class Robot: def act(self, game): # reset the escape squares for this turn global escapeSquares global globTurn if globTurn != game.turn: globTurn = game.turn ...
2.9375
3
tests/cli/tools.py
CNR-ITTIG/plasodfaxp
1
26936
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the CLI tools classes.""" import argparse import io import sys import unittest from plaso.cli import tools from plaso.lib import errors from tests.cli import test_lib class CLIToolTest(test_lib.CLIToolTestCase): """Tests for the CLI tool base class.""" _E...
2.46875
2
src/sklearndf/transformation/wrapper/_wrapper.py
mtsokol/sklearndf
37
26937
""" Core implementation of :mod:`sklearndf.transformation.wrapper` """ import logging from abc import ABCMeta, abstractmethod from typing import Any, Generic, List, Optional, TypeVar, Union import numpy as np import pandas as pd from sklearn.base import TransformerMixin from sklearn.compose import ColumnTransformer f...
1.914063
2
tests/test_graph.py
nokia/PyBGL
11
26938
<reponame>nokia/PyBGL #!/usr/bin/env pytest-3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright (C) 2020, Nokia" __license__ = "BSD-3" from pybgl.graph import * from pybgl.graphviz import graph_to_html def test_graph_verte...
2.609375
3
tests/engine/test_error_handling.py
vanguard/sql_translate
3
26939
<filename>tests/engine/test_error_handling.py<gh_stars>1-10 import unittest import pytest import sqlparse from sql_translate.engine import error_handling from typing import Dict, List import re E = error_handling._ErrorHandler() # Just for coverage @pytest.mark.parametrize(['statement', 'error_message', 'expected']...
2.578125
3
day1/debugme.py
autotaker/training-domo
0
26940
<filename>day1/debugme.py def convert_fizzbuzz(n: int) -> str: s = str(n) if n % 3 == 0 and n % 5 == 0: s = "FizzBuzz" if n % 3 == 0: s = "Fizz" if n % 5 == 0: s = "Buzz" return s def fizzbuzz() -> None: """ 1から100までの整数nに対して * nが3の倍数かつ5の倍数の時はFizzBuzz * nが3の倍...
3.625
4
src/Selenium2Library/locators/windowmanager.py
tanggai/robotframework_selenium2library
2
26941
from types import * from robot import utils from selenium.webdriver.remote.webdriver import WebDriver from selenium.common.exceptions import NoSuchWindowException class WindowManager(object): def __init__(self): self._strategies = { 'title': self._select_by_title, 'name':...
2.703125
3
localshop/urls.py
rcoup/localshop
0
26942
import re from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.views.generic.base import RedirectView from localshop.apps.packages.xmlrpc import handle_request admin.autodiscover() static_prefix = re.escape(settings.STATIC_URL.lstrip('/')) ...
1.882813
2
test/util_test.py
quiet-oceans/libais
161
26943
#!/usr/bin/env python """Tests for ais.util.""" import unittest from ais import util import six class UtilTest(unittest.TestCase): def testMaybeToNumber(self): self.assertEqual(util.MaybeToNumber(None), None) self.assertEqual(util.MaybeToNumber([]), []) self.assertEqual(util.MaybeToNumber({}), {}) ...
3.046875
3
16_1.py
yunjung-lee/class_python_numpy
0
26944
import numpy as np import pandas as pd from pandas import DataFrame, Series import matplotlib.pyplot as plt num = np.array(['3.14','-2.7','30'], dtype=np.string_) #코드 이해 쉽게 : dtype=np.string_ # num=num.astype(int) # print(num) # ValueError: invalid literal for int() with base 10: '3.14' num=num.astype(float)....
3.484375
3
Chapter8/listing8_1.py
hohsieh/osgeopy-code
160
26945
<filename>Chapter8/listing8_1.py # Script to reproject a shapefile. from osgeo import ogr, osr # Create an output SRS. sr = osr.SpatialReference() sr.ImportFromProj4('''+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +...
2.921875
3
examples/seq2seq/task_seq2seq_simbert_v2_stage2.py
Tongjilibo/bert4torch
49
26946
#! -*- coding: utf-8 -*- # SimBERT_v2预训练代码stage2,把simbert的相似度蒸馏到roformer-sim上 # 官方项目:https://github.com/ZhuiyiTechnology/roformer-sim import json import numpy as np import torch from torch import nn, optim from torch.utils.data import DataLoader import torch.nn.functional as F from bert4torch.models import build_trans...
2.25
2
Validation/RecoTrack/python/customiseMTVForBPix123Holes.py
ckamtsikis/cmssw
852
26947
<filename>Validation/RecoTrack/python/customiseMTVForBPix123Holes.py from __future__ import print_function # This customise file provides an example (in the form of holes in # BPix L1-L2 and L3-L3) on how to select a subset of generalTracks # (e.g. by phi and eta) and setup various MTV instances for those # (selected t...
1.65625
2
helloworld/api/v1.py
ElyasSantana/example-api
0
26948
from fastapi import APIRouter router_helloworld = APIRouter() @router_helloworld.get("/") def get_helloworld(): return {"Hello": "World"}
2.34375
2
projects/slots/activities/activity_randomizer.py
only-romano/junkyard
0
26949
from random import sample, randint """ Randomizer for available lists plus radio broadcasting randomizer """ # Available lists randomizer class class Randomize_and_pop_on_call: """ Randomize given array and on call pop given value from array. If array is empty - returns None """ # created only to ea...
3.625
4
tests/test_contract.py
iwob/pysv
2
26950
import unittest from pysv.contract import * class TestsContract(unittest.TestCase): def test_program_vars_input_and_local(self): vars = ProgramVars({'x': 'Int'}, {'y': 'Int'}) vars.add_marked_variables(["|x|'", "|y|'", "|y|''"]) self.assertEquals({'x': 'Int', "|x|'": 'Int'}, vars.input_v...
2.875
3
unittests/unintary_tests.py
OneCricketeer/pysqoop
9
26951
<filename>unittests/unintary_tests.py import unittest from pysqoop.SqoopImport import Sqoop class TestStringMethods(unittest.TestCase): def test_empty_sqoop(self): try: Sqoop() except Exception as e: self.assertEqual(str(e), 'all parameters are empty') def test_proper...
2.875
3
tests/base.py
strukovsv/PyHAML
21
26952
<reponame>strukovsv/PyHAML from unittest import TestCase, main, SkipTest import os from mako.template import Template import haml def skip(func): def test(*args, **kwargs): raise SkipTest() return test def skip_on_travis(func): if os.environ.get('TRAVIS') == 'true': def test(*args, **k...
2.234375
2
playground/basis_set.py
not-matt/QuantumPlayground
0
26953
<filename>playground/basis_set.py import requests import logging import numpy as np from playground.utils import elements, angular_quanta _LOGGER = logging.getLogger(__name__) class AO(object): """ atomic orbital """ def __init__(self, orbital_type: str, ...
2.9375
3
controls.py
juandigomez/me366j
0
26954
import pygame import sys pygame.init() screen = pygame.display.set_mode((640, 480)) clock = pygame.time.Clock() x = 0 y = 0 # use a (r, g, b) tuple for color yellow = (255, 255, 0) # create the basic window/screen and a title/caption # default is a black background screen = pygame.display.set_mode((640, 280)) pygame....
3.59375
4
scripts/conversion/rename_associations.py
xapple/libcbm_runner
2
26955
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by <NAME> and <NAME>. JRC Biomass Project. Unit D1 Bioeconomy. This script will rename the header column of the file: * /common/associations.csv Before running this script the headers are simply "A", "B", "C". After running this script, the new headers wi...
3.265625
3
_Training_/RegEx - HackerRank/1. Introduction/Matching Anything But a Newline.py
JUD210/Study-Note
0
26956
# https://www.hackerrank.com/challenges/matching-anything-but-new-line/problem import re # Inputs standard_input = """123.456.abc.def""" regex_pattern = r".{3}\..{3}\..{3}\..{3}$" # Do not delete 'r'. test_string = input() # 123.456.abc.def match = re.match(regex_pattern, test_string) is not None print(str(m...
3.421875
3
test1.py
czyczyyzc/MyForElise
0
26957
import time import numpy as np import tensorflow as tf from yalenet import YaleNet from Mybase.solver import Solver """ def test(): mdl = YaleNet(cls_num=1000, reg=1e-4, typ=tf.float32) sov = Solver(mdl, opm_cfg={ 'lr_base': 0.005, 'decay_rul...
2.0625
2
a4/decrypt/elliptic.py
fultonms/crypto
0
26958
<gh_stars>0 import argparse parser = argparse.ArgumentParser(description="Decrpyt a selection of text from a substitution cypher, with the provided key") parser.add_argument('cryptFile', metavar='encrypted', type=str, help='Path to the encrpyted text') parser.add_argument('keyFile', metavar='key', type=str, help='Path...
3.203125
3
examples/hist.py
RyanAugust/geoplotlib
1,021
26959
<reponame>RyanAugust/geoplotlib """ Example of 2D histogram """ import geoplotlib from geoplotlib.utils import read_csv, BoundingBox data = read_csv('data/opencellid_dk.csv') geoplotlib.hist(data, colorscale='sqrt', binsize=8) geoplotlib.set_bbox(BoundingBox.DK) geoplotlib.show()
2.8125
3
gui/StaffScreen.py
Harsh0294/carrentsystem
0
26960
<gh_stars>0 from PyQt4 import QtCore, QtGui from Vehicles import * class StaffScreen(QtGui.QMainWindow): combo_box_items = ["Car", "Van", "<NAME>"] # Class constructor parent represents login screen def __init__(self, parent, staff_user, vehicles): super(StaffScreen, self).__init__(parent) ...
2.703125
3
southwestalerts/southwest.py
hoopsbwc34/southwest-alerts
0
26961
<reponame>hoopsbwc34/southwest-alerts import json import time import requests BASE_URL = 'https://mobile.southwest.com' class Southwest(object): def __init__(self, username, password, headers, cookies, account): self._session = _SouthwestSession(username, password, headers, cookies, account) def ...
2.96875
3
lear-db/test_data/data_loader.py
jachurchill/lear
1
26962
<reponame>jachurchill/lear # Copyright © 2019 Province of British Columbia # # 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.664063
2
compiler/extensions/python/runtime/src/zserio/bitfield.py
PeachOS/zserio
2
26963
<filename>compiler/extensions/python/runtime/src/zserio/bitfield.py """ The module provides help methods for bit fields calculation. """ from zserio.exception import PythonRuntimeException def getBitFieldLowerBound(length): """ Gets the lower bound of a unsigned bitfield type with given length. :param le...
3.03125
3
pacote-download/Mundo1/ex002.py
ariadne-pereira/cev-python
0
26964
<gh_stars>0 nome = input('Qual o seu nome?') print('Bem vindo ' , nome)
2.90625
3
eqparse/spaceloads/__init__.py
TfedUD/eqparse
3
26965
<gh_stars>1-10 from .spaceloads import *
1.210938
1
demos/HFL/example/pytorch/hugging_face/local_bert_text_classifier/dataset.py
monadyn/fedlearn-algo
86
26966
# Copyright 2021 Fedlearn authors. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
2.75
3
egtaonline/__init__.py
egtaonline/egtaonline-api
0
26967
<filename>egtaonline/__init__.py """Module for egta online api""" __version__ = '0.8.7'
0.960938
1
views.py
wbellman/Python-Fate-Example
0
26968
<filename>views.py<gh_stars>0 import time import settings from printLibs import printl, printc from inputLibs import get_number def print_character(character): print() printc(character["realname"],"-",40) print() print( character["name"] + " (" + character["role"] + ") -- " + character["pole"].title() + ":" +...
3
3
recipes/Python/578871_Simple_Tkinter_strip_chart/recipe-578871.py
tdiprima/code
2,023
26969
# (c) MIT License Copyright 2014 <NAME> # Please reuse, modify or distribute freely. from collections import OrderedDict import tkinter as tk class StripChart( tk.Frame ): def __init__( self, parent, scale, historySize, trackColors, *args, **opts ): # Initialize super().__init__( parent, *args, **opts ...
3.203125
3
sendmail.py
jvadair/simpleforum
0
26970
<filename>sendmail.py import smtplib, ssl from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart SMTP_URL = "example.com" def send_verification_code(recipient, recipient_name, verification_code): sender_email = "<EMAIL>" with open('.smtp_passwd') as password_file: ...
3.59375
4
research/compression/entropy_coder/lib/block_util.py
Dzinushi/models_1_4
0
26971
<filename>research/compression/entropy_coder/lib/block_util.py # Copyright 2017 The TensorFlow Authors 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....
2.203125
2
core/models.py
ditttu/gymkhana-Nominations
3
26972
<reponame>ditttu/gymkhana-Nominations from django.db import models from django.contrib.auth.models import User from .choices import * from datetime import datetime,date from django.dispatch import receiver from django.db.models.signals import post_save from django.utils import timezone def default_end_date(): now ...
2.296875
2
tests/test/search/test_references_searcher_db_files.py
watermelonwolverine/fvttmv
1
26973
<reponame>watermelonwolverine/fvttmv from fvttmv.search.__references_searcher_db_files import ReferencesSearcherDbFiles from test.common import TestCase, AbsPaths, References class ReferencesSearcherDbFilesTest(TestCase): def test_search_for_references_in_db_files1(self): print("test_search_for_reference...
2.59375
3
apps/quiver/views.py
OpenAdaptronik/Rattler
2
26974
from apps.quiver.models import AnalyticsService, AnalyticsServiceExecution from django.shortcuts import render, HttpResponseRedirect from django.core.exceptions import PermissionDenied from django.views.generic import FormView, CreateView, ListView, DetailView, UpdateView from django.contrib.auth.mixins import LoginRe...
1.898438
2
boml/load_data/experiment.py
LongMa319/BOML
2
26975
<reponame>LongMa319/BOML """ Simple container for useful quantities for a supervised learning experiment, where data is managed with feed dictionary """ import tensorflow as tf class BOMLExperiment: def __init__(self, datasets, dtype=tf.float32): self.datasets = datasets self.x = tf.placeholder(dt...
2.609375
3
pypy/translator/jvm/opcodes.py
camillobruni/pygirl
12
26976
""" Mapping from OOType opcodes to JVM MicroInstructions. Most of these come from the oosupport directory. """ from pypy.translator.oosupport.metavm import \ PushArg, PushAllArgs, StoreResult, InstructionList, New, DoNothing, Call,\ SetField, GetField, DownCast, RuntimeNew, OOString, OOUnicode, \ Cas...
2.25
2
graph_explorer/structured_metrics/plugins/vmstat.py
farheenkaifee/dashboard_3
284
26977
from . import Plugin class VmstatPlugin(Plugin): targets = [ { 'match': '^servers\.(?P<server>[^\.]+)\.vmstat\.(?P<type>.*)$', 'target_type': 'rate', 'tags': {'unit': 'Page'} } ] def sanitize(self, target): target['tags']['type'] = target['tags'...
2.3125
2
2018/day02.py
iKevinY/advent
11
26978
import fileinput from collections import Counter BOXES = [line.strip() for line in fileinput.input()] DOUBLES = 0 TRIPLES = 0 COMMON = None for box_1 in BOXES: doubles = 0 triples = 0 for char, count in Counter(box_1).items(): if count == 2: doubles += 1 elif count == 3: ...
3.3125
3
pyreindexer/tests/tests/test_sql.py
Restream/reindexer-py
2
26979
from hamcrest import * from tests.helpers.sql import sql_query class TestSqlQueries: def test_sql_select(self, namespace, index, item): # Given("Create namespace with item") db, namespace_name = namespace item_definition = item # When ("Execute SQL query SELECT") query = f...
2.671875
3
app/auth/__init__.py
Muxi-Studio/ccnu-network-culture-festival
3
26980
<reponame>Muxi-Studio/ccnu-network-culture-festival # coding: utf-8 from flask import Blueprint auth = Blueprint( 'auth', __name__, template_folder = 'templates', static_folder = 'static' ) from . import views, forms
1.320313
1
generator/paperplane.py
isikdogan/paperplane
3
26981
<gh_stars>1-10 # -*- coding: utf-8 -*- """ PaperPlane: a very simple, flat-file, static blog generator. Created on Sat Feb 21 2015 Author: <NAME> """ import codecs, unicodedata import dateutil.parser import os, re, glob import markdown import jinja2 class Page: def __init__(self, markdown_file): self._rea...
2.46875
2
app/recepie/tests/test_recepie_api.py
TheMysteryPuzzles/recepie-app-api
0
26982
<filename>app/recepie/tests/test_recepie_api.py import tempfile import os from PIL import Image from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse from rest_framework import status from rest_framework.test import APIClient from core.models import Recepie,...
2.40625
2
scrap_single_news.py
pralhad88/Web_scraping
1
26983
<reponame>pralhad88/Web_scraping from bs4 import BeautifulSoup import urllib.request article = [] data_storage = {} source = urllib.request.urlopen("https://www.ndtv.com/india-news/pm-modi-in-telangana-says-seek-your-support-blessings-for-bjp-in-coming-polls-1953954").read() soup = BeautifulSoup(source,'lxml') data_s...
3.25
3
localstack/services/awslambda/multivalue_transformer.py
zonywhoop/localstack
1
26984
from collections import defaultdict from localstack.utils.common import to_str def multi_value_dict_for_list(elements): temp_mv_dict = defaultdict(list) for key in elements: if isinstance(key, (list, tuple)): key, value = key else: value = elements[key] key = to...
2.796875
3
code/dgp/dgp_sorf_optim.py
GiaLacTRAN/convolutional_deep_gp_random_features
5
26985
## Copyright 2019 <NAME>, <NAME>, <NAME>, <NAME>, and <NAME> ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by...
1.898438
2
tests/__init__.py
antoinebourayne/sd2c
0
26986
# -*- coding: utf-8 -*- """ Ceci est un module avec les tests unitaires et les tests d'intégrations. """
0.960938
1
Tutorial 2 - Data Navigation/PlugIns/experimental/scripts/MultiEELS.py
paradimdata/Cornell_EM_SummerSchool_2021
8
26987
<reponame>paradimdata/Cornell_EM_SummerSchool_2021 import numpy import uuid from nion.data import Calibration from nion.data import DataAndMetadata from nion.data import xdata_1_0 as xd from nion.utils import Registry def acquire_multi_eels(interactive, api): # first grab the stem controller object by asking the R...
2.546875
3
torch_connectomics/data/augmentation/rotation.py
al093/pytorch_connectomics
2
26988
import cv2 import numpy as np from .augmentor import DataAugment import math class Rotate(DataAugment): """ Continuous rotatation. The sample size for x- and y-axes should be at least sqrt(2) times larger than the input size to make sure there is no non-valid region after center-crop. Args: ...
2.921875
3
constants.py
LuisHernandez96/Pichon
1
26989
import re # Used to access the DATA_TYPES dictionary INT = "INT" FLOAT = "FLOAT" BOOLEAN = "BOOLEAN" INT_LIST = "INT_LIST" FLOAT_LIST = "FLOAT_LIST" BOOLEAN_LIST = "BOOLEAN_LIST" VOID = "VOID" OBJECT = "OBJECT" SEMANTIC_ERROR = 99 # Regular expressiones to match data types REGEX_BOOLEAN = r'true|false' regex_boolean ...
3.015625
3
server/app/__init__.py
mrchipzhou/simple-android-demo
0
26990
<reponame>mrchipzhou/simple-android-demo from flask import Flask from . import user from . import attendance app = Flask(__name__) app.register_blueprint(user.bp, url_prefix='/User') app.register_blueprint(attendance.bp, url_prefix='/Attend')
1.984375
2
SimCalorimetry/EcalSelectiveReadoutProducers/python/ecalDigis_craft_cfi.py
ckamtsikis/cmssw
852
26991
import FWCore.ParameterSet.Config as cms simEcalDigis = cms.EDProducer("EcalSelectiveReadoutProducer", # Label of input EB and EE digi collections digiProducer = cms.string('simEcalUnsuppressedDigis'), # Instance name of input EB digi collections EBdigiCollection = cms.string(''), # Instance name...
1.554688
2
HDXer/methods.py
TMB-CSB/HDXer
3
26992
<filename>HDXer/methods.py<gh_stars>1-10 #!/usr/bin/env python # Class for HDX trajectories, inherited from MDTraj # import mdtraj as md import numpy as np import os, glob, copy from .dfpred import DfPredictor from .errors import HDX_Error from . import functions class BV(DfPredictor): """Class for Best/Vendrusc...
2.40625
2
datasource/interface.py
YAmikep/datasource
1
26993
<reponame>YAmikep/datasource<gh_stars>1-10 MAX_MEMORY = 5 * 1024 * 2 ** 10 # 5 MB BUFFER_SIZE = 1 * 512 * 2 ** 10 # 512 KB class DataSourceInterface(object): """Provides a uniform API regardless of how the data should be fetched.""" def __init__(self, target, preload=False, **kwargs): raise NotImple...
2.90625
3
python/mock_patch/test_topathch.py
amitsaha/playground
4
26994
<gh_stars>1-10 from mock import patch @patch('topatch.afunction') class TestToPatch(): def test_afunction(self, mock_afunction): mock_afunction('foo', 'bar') mock_afunction.assert_any_call('foo', 'bar')
2.421875
2
pyjsg/parser/jsgParser.py
hsolbrig/pyjsg
3
26995
# Generated from jsgParser.g4 by ANTLR 4.9 # encoding: utf-8 from antlr4 import * from io import StringIO import sys if sys.version_info[1] > 5: from typing import TextIO else: from typing.io import TextIO def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u77...
1.421875
1
Nokore/scripts/main-simon-transfer.py
algorine/nokware
0
26996
<reponame>algorine/nokware<gh_stars>0 import time import numpy as np import pandas as pd import random from Simon import Simon from Simon.Encoder import Encoder from Simon.LengthStandardizer import DataLengthStandardizerRaw start_time = time.time() ### Read-in the emails and print some basic statistics # Enron En...
2.78125
3
example/familytree.py
realistschuckle/pyvisitor
15
26997
<gh_stars>10-100 from __future__ import print_function import sys import os # Put the path to the visitor module on the search path path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src')) if not path in sys.path: sys.path.insert(1, path) import visitor class Person(object): def __init__(self,...
3.15625
3
bgui/server/server/config.py
monash-emu/Legacy-AuTuMN
0
26998
SQLALCHEMY_DATABASE_URI = 'sqlite:///database.sqlite' SECRET_KEY = '<KEY>' SAVE_FOLDER = '../../../projects' SQLALCHEMY_TRACK_MODIFICATIONS = 'False' PORT = '3000' STATIC_FOLDER = '../../client/dist/static'
1.359375
1
dentexchange/apps/location/tests/test_zip_code.py
hellhound/dentexchange
1
26999
<gh_stars>1-10 # -*- coding:utf-8 -*- import unittest import mock import decimal from ..models import ZipCode class ZipCodeTestCase(unittest.TestCase): def test_unicode_should_return_code(self): # setup model = ZipCode() code = '1.0' model.code = decimal.Decimal(code) # a...
3.0625
3