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
rl_groundup/functions/linear_policy.py
TristanBester/rl_groundup
1
12768951
<filename>rl_groundup/functions/linear_policy.py # Created by <NAME>. import numpy as np class LinearPolicy(object): '''A parametric function used to approximate the state-action value function for a specific policy. The approximate value for a given state- action pair is equal to the dot product of ...
2.78125
3
test/tests/test_environments/python_src/main.py
jithindevasia/fission
6,891
12768952
<gh_stars>1000+ def main(): return 'THIS_IS_MAIN_MAIN' def func(): return 'THIS_IS_MAIN_FUNC'
1.320313
1
test_scripts/ns_instance/get_one.py
lremember/VFC
1
12768953
import requests resp = requests.get('http://10.12.5.131:30280/api/nslcm/v1/ns/caaed655-8eee-47eb-8649-7fbef4e8fb29') print resp.status_code, resp.json()
2.203125
2
mailman2/models.py
edinburghhacklab/hackdb
0
12768954
# SPDX-FileCopyrightText: 2022 <NAME> <<EMAIL>> # # SPDX-License-Identifier: MIT import re from allauth.account.models import EmailAddress from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.core.exceptions import ValidationError from django.db import models def f...
2.203125
2
src/python/datatype/BooleanType.py
hiteshsahu/Python4ML
0
12768955
<filename>src/python/datatype/BooleanType.py """ Boolean Data Type(bool): - Only be True or False - None is false - All numbers are True, except 0. - All strings are True, except Empty strings. ie "" - All Collections(list, tuple, set, and dictionary) are True, except Empty ones.ie. (), [], {}, - Objects from a class ...
4.375
4
bin/python/divvy/ledger/commands/Print.py
coinjet/rippled
0
12768956
from __future__ import absolute_import, division, print_function, unicode_literals from divvy.ledger.Args import ARGS from divvy.ledger import SearchLedgers import json SAFE = True HELP = """print Print the ledgers to stdout. The default command.""" def run_print(server): ARGS.display(print, server, SearchLe...
2.140625
2
can_tools/scrapers/official/AL/al_vaccine.py
kxdan/can-scrapers
0
12768957
<filename>can_tools/scrapers/official/AL/al_vaccine.py import pandas as pd import us from can_tools.scrapers import CMU, variables from can_tools.scrapers.official.base import ArcGIS pd.options.mode.chained_assignment = None # Avoid unnessacary SettingWithCopy warning class ALCountyVaccine(ArcGIS): ARCGIS_ID =...
2.515625
3
printBlockAnsi.py
oshaboy/PrintUnicode
0
12768958
#!/usr/bin/python3 from PIL import Image import math, sys figure=" " regular=" " em = " " en = " " scale=[ "\x1b[30m█", "\x1b[3{}m░", "\x1b[9{}m░", "\x1b[3{}m▒", "\x1b[9{}m▒", "\x1b[3{}m▓", "\x1b[9{}m▓", "\x1b[3{}m█", "\x1b[9{}m█" ] def hue_raw(fullpixel): global threshhold_global hue_arr = [Fals...
2.90625
3
setup.py
codeRulc/pytest-progress
0
12768959
import os import io from setuptools import setup def get_version(filename): here = os.path.dirname(os.path.abspath(__file__)) f = open(os.path.join(here, filename)) version_match = f.read() f.close() if version_match: return version_match raise RuntimeError("Unable to find version s...
1.820313
2
PlanheatMappingModule/PlanHeatDMM/dialogs/protection_level_map_dialog.py
Planheat/Planheat-Tool
2
12768960
<reponame>Planheat/Planheat-Tool # -*- coding: utf-8 -*- """ Matching user fields dialog :author: <NAME> :version: 0.1 :date: 19 Oct. 2017 """ __docformat__ = "restructuredtext" import os import sys from PyQt5 import uic from PyQt5 import QtCore,QtWidgets, QtGui from PyQt5.Qt import QTableWidgetI...
2.125
2
projects/tutorials/pointnav_habitat_rgb_ddppo.py
ehsanik/allenact
0
12768961
<gh_stars>0 import os from typing import Dict, Any, List, Optional, Sequence import gym import torch import torch.nn as nn import torch.optim as optim from torch.optim.lr_scheduler import LambdaLR from torchvision import models from core.algorithms.onpolicy_sync.losses import PPO from core.algorithms.onpolicy_sync.lo...
1.851563
2
Array/387FirstUniqueCharacterString.py
john-the-dev/leetcode
0
12768962
<gh_stars>0 # 387. First Unique Character in a String ''' Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. Examples: s = "leetcode" return 0. s = "loveleetcode" return 2. Note: You may assume the string contains only lowercase English letters. ''' ...
3.71875
4
try1/libs/__init__.py
kiranscaria/structure_knowledge_distillation
0
12768963
<gh_stars>0 from .bn import ABN from .misc import GlobalAvgPool2d from .residual import IdentityResidualBlock from .dense import DenseModule
1.109375
1
src/dbxdeploy/deploy/WorkingDirFactory.py
DataSentics/dbx-deploy
0
12768964
import os from pathlib import Path class WorkingDirFactory: def create(self): return Path(os.getcwd())
2.21875
2
ui_automation_core/unit_test/logging_test.py
Harshavardhanchowdary/python-ui-testing-automation
0
12768965
import os from unittest import TestCase from unittest.mock import patch from ui_automation_core.utilities.log_utils import LogUtils class LoggingTest(TestCase): def test_LogUtils_is_instantiate(self): log_dir = '../logs/' log_util = LogUtils(log_dir) self.assertEqual('An instance of LogU...
2.765625
3
train.py
vincentyexiang/AI_Make_Music
1
12768966
# -*- coding: UTF-8 -*- """ 训练神经网络,将参数(Weight)存入 HDF5 文件 """ import numpy as np import tensorflow as tf from utils import * from network import * """ ==== 一些术语的概念 ==== # Batch size : 批次(样本)数目。一次迭代(Forword 运算(用于得到损失函数)以及 BackPropagation 运算(用于更新神经网络参数))所用的样本数目。Batch size 越大,所需的内存就越大 # Iteration : 迭代。每一次迭代更新一次权重(网络参数)...
2.625
3
tests/integration/test_project_view.py
alexcfaber/katka-core
1
12768967
from uuid import UUID import pytest from katka import models @pytest.mark.django_db class TestProjectViewSet: def test_list(self, client, logged_in_user, my_team, my_project): response = client.get("/projects/") assert response.status_code == 200 parsed = response.json() assert le...
2.4375
2
opac/apps.py
rimphyd/Django-OPAC
1
12768968
<reponame>rimphyd/Django-OPAC from django.apps import AppConfig class OpacConfig(AppConfig): name = 'opac'
1.257813
1
src/polkadot/globber.py
brian-l/polkadot
3
12768969
<reponame>brian-l/polkadot import fnmatch import os def glob(path, base): """ glob.glob ignores hidden files. this one allows them, and matches against the relative path provided in the config. :param str path: string or wildcard that represents one or more files :param str base: base directory to ru...
3.296875
3
pytgbot/webhook.py
annihilatorrrr/pytgbot
52
12768970
# -*- coding: utf-8 -*- from luckydonaldUtils.logger import logging from pytgbot.bot import Bot from pytgbot.exceptions import TgApiServerException, TgApiParseException __author__ = 'luckydonald' logger = logging.getLogger(__name__) class Webhook(Bot): """ Subclass of Bot, will be returned of a sucessful we...
2.578125
3
lib.py
tekton/redis_browser
0
12768971
import base64 from simple_redis_conn import r import json # from simple_redis_conn import w # connect to redis # scan for all the things to create an in-memory DB of things # go through all the keys and get their types # for a key, check its type- don't have it? get it! # # based on the type get the stuff... # # if ...
2.796875
3
hammer/clienttype.py
usd-yamazaki/chainhammer
0
12768972
<gh_stars>0 #!/usr/bin/env python3 """ @summary: Which client type do we have? quorum-raft/ibft OR energyweb OR parity OR geth OR ... @version: v43 (16/December/2018) @since: 29/May/2018 @organization: @author: https://github.com/drandreaskrueger @see: https://github.com/drandreaskrueger/chainhammer...
2.15625
2
parseepo/validate.py
cverluise/parseEPO
0
12768973
<gh_stars>0 from parseepo.exception import SingleAttrException, RowException def single_attr(val, attr, publication_number): if len(val) == 1: # Temporary check, might be discarded if no error pass else: raise SingleAttrException( f"{publication_number}: Number of values exceed ex...
2.84375
3
built-in/PyTorch/Official/cv/image_classification/Shufflenetv2_for_PyTorch/prof_demo.py
Ascend/modelzoo
12
12768974
<reponame>Ascend/modelzoo<gh_stars>10-100 # -*- coding: utf-8 -*- # Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licen...
2.078125
2
main.py
GabrielMissael/solution
0
12768975
from solution.recollection.get_tweets import get_tweets from solution.ml.sentiment import AddSentimentAnalysis from solution.ml.clustering import cluster from solution.viz.wordclouds import GenWordcloud from solution.viz.ngrams import ngram from solution.viz.visualization import scatter import pandas as pd import os...
2.6875
3
examples/performance/__main__.py
gujun4990/sqlalchemy
1
12768976
<gh_stars>1-10 """Allows the examples/performance package to be run as a script.""" from . import Profiler if __name__ == '__main__': Profiler.main()
1.171875
1
installer.py
Marusoftware/Marutools
0
12768977
#! /usr/bin/python3 # -*- coding: utf-8 -*- import tkinter from tkinter import ttk from tkinter import filedialog import tkinter.messagebox as tkmsg import os import time import sys import subprocess ############add APP info here############### APP_NAME = "marueditor" APP_NAME_TITLE = "Maruediter" APP_LUA_JP = [""] AP...
2.578125
3
menustoolbars/simple_menu.py
gnthibault/PyQt6-Tutorial-Examples
38
12768978
<gh_stars>10-100 #!/usr/bin/python """ ZetCode PyQt6 tutorial This program creates a menubar. The menubar has one menu with an exit action. Author: <NAME> Website: zetcode.com """ import sys from PyQt6.QtWidgets import QMainWindow, QApplication from PyQt6.QtGui import QIcon, QAction class Example(QMainWindow): ...
3.453125
3
two_d_nav/tests/test_astar.py
ZikangXiong/two-d-nav-gym
0
12768979
<filename>two_d_nav/tests/test_astar.py import numpy as np from two_d_nav.elements import VelRobot, Cat, create_maze from two_d_nav.engine import MazeNavigationEngine from two_d_nav.search import constants as c from two_d_nav.search.a_star import Agent from two_d_nav.search.location import Location from two_d_nav.sear...
2.90625
3
CalibTracker/SiStripChannelGain/test/Gains_CT_step2.py
PKUfudawei/cmssw
1
12768980
# Auto generated configuration file # using: # Revision: 1.381.2.28 # Source: /local/reps/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v # with command line options: step4 --data --conditions auto:com10 --scenario pp -s ALCAHARVEST:SiStripGains --filein file:PromptCalibProdSiStripGains.root ...
1.539063
2
Dermis2.py
cheapjack/StasisCraft
0
12768981
<reponame>cheapjack/StasisCraft<gh_stars>0 #!/usr/bin/python #Install the modules we need #from pyfirmata import Arduino, util, INPUT from mcpi import minecraft from mcpi import minecraftstuff from time import sleep import server import serial # Use the command /getpos or F3 in Minecraft client to find out where you...
2.46875
2
data/datasets/.ipynb_checkpoints/aic-checkpoint.py
lxc86739795/vehicle_reid_by_parsing
36
12768982
<gh_stars>10-100 # encoding: utf-8 """ @author: <NAME> @contact: <EMAIL> """ import glob import re import os.path as osp from .bases import ImageDataset import warnings class AICity19(ImageDataset): """ AICYTY Reference: Zheng et al. CityFlow: A City-Scale Benchmark for Multi-Target Multi-Camera V...
2.140625
2
textconverter.py
adityaDave2011/InformationSecurity
0
12768983
def get_msg_with_punctuations(old, new): new_org_text = new for i in range(len(old)): if not str.isalpha(old[i]): new_org_text = new_org_text[0:i] + old[i] + new_org_text[i:] for i in range(len(old)): if str.isupper(old[i]): new_org_text = new_org_text[0:i] + str.uppe...
3.328125
3
tests/test_dimension.py
ckauth/eurostat-api-client
4
12768984
from eurostatapiclient.models.dimension import Category, BaseItem, ItemList, \ Dimension import unittest class TestCategory(unittest.TestCase): def test_properties(self): id = 'ID0' index = 4 label = 'label with text' category = Category(id, index, label) self.assert...
2.515625
3
ds4se/_nbdev.py
rmclanton/ds4se
0
12768985
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {} modules = [].py", "exp/info.py"].py"] doc_url = "https://ncoop57.github.io/ds4se/" git_url = "https://github.com/ncoop57/ds4se/tree/master/" def custom_doc_links(name): return None
1.296875
1
scripts/ingest/main.py
shlomo88/Nietzsche
41
12768986
import os import json import requests from elasticsearch import Elasticsearch, RequestsHttpConnection, helpers, exceptions HOST = os.environ.get('ES_ENDPOINT') INDEX = os.environ.get('ES_INDEX') QUOTES_DUMP = os.environ.get('QUOTES_DUMP') headers = {"Content-Type": "application/json"} def main(): try: e...
2.734375
3
mysite/LibreBadge/migrations/0014_auto_20200317_0237.py
energized-id/energized-id
8
12768987
# Generated by Django 3.0.3 on 2020-03-17 02:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('LibreBadge', '0013_auto_20200317_0236'), ] operations = [ migrations.AlterField( model_name='badgetemplate', name='b...
1.335938
1
src/notifier_script/notifier_script.pyw
kroutsis/Lan-Notifications
3
12768988
#<NAME> import socket, threading, sys, time, os import tkinter as tk client_list = [] connections = {} check_buttons = {} window = tk.Tk() text_header = tk.StringVar() text_message_wid = tk.Text(window, height=5, width=40, font=("Calibri")) outer_frame = tk.Frame(window) cb_canvas = tk.Canvas(outer_frame,...
2.921875
3
test/test_server.py
keredson/tinyweb
138
12768989
<reponame>keredson/tinyweb #!/usr/bin/env micropython """ Unittests for Tiny Web MIT license (C) <NAME> 2017-2018 """ import unittest import uos as os import uerrno as errno import uasyncio as asyncio from tinyweb import webserver from tinyweb.server import urldecode_plus, parse_query_string from tinyweb.server import...
2.40625
2
nought/wizard.py
cole-wilson/nought
10
12768990
<reponame>cole-wilson/nought<filename>nought/wizard.py<gh_stars>1-10 import sys, os, toml def main(): # sys.exit(0) print('Hello! The best way to setup nought is to go to the github page:\n\thttps://github.com/cole-wilson/nought#configuration') # mode = input("\nYou have several choices:\n\t\1:Create a config file....
2.609375
3
examples/common/python/utility/hex_utils.py
gbarcomu/avalon
0
12768991
# Copyright 2019 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 applicable law or agreed to in wri...
3
3
znail/ui/api/test/test_ipredirect.py
Risca/znail
15
12768992
<gh_stars>10-100 import unittest from unittest.mock import patch from znail.netem.ipredirect import IpRedirect, IpRedirectDescriptor from znail.ui import app class TestIpRedirect(unittest.TestCase): def setUp(self): ip_redirect_clear_patcher = patch.object(IpRedirect, "_clear") self.ip_redirect_c...
2.390625
2
pypospack/task/tasks_lammps/structural_minimization.py
eragasa/pypospack
4
12768993
import os,copy from collections import OrderedDict from pypospack.task.lammps import LammpsSimulation class LammpsStructuralMinimization(LammpsSimulation): """ Class for LAMMPS structural minimization This data class defines additional attributes and methods necessary to interact with the Workflow manage...
2.5625
3
infobip_channels/email/models/path_paramaters/get_domain_details.py
infobip-community/infobip-api-python-sdk
0
12768994
<gh_stars>0 from infobip_channels.email.models.path_paramaters.core import EmailPathParameter class GetDomainDetailsPathParameter(EmailPathParameter): pass
1.203125
1
plot/plotPuddleworld.py
architsakhadeo/Offline-Hyperparameter-Tuning-for-RL
0
12768995
<filename>plot/plotPuddleworld.py import os import numpy as np import matplotlib.pyplot as plt import scipy.stats as st datapath = ["../data/best/puddleworldOptimal/", "../data/best/puddleworldSubOptimal/", "../data/best/puddleworldSubSubOptimal/"] labels = ["optimal", "average", "bad"] num_runs = 50 def findIndex(...
2.515625
3
testData/typeinspection/fieldFieldInvalid.py
seandstewart/typical-pycharm-plugin
0
12768996
<gh_stars>0 import typic from builtins import * @typic.klass class A: a: int = typic.field(int(123)) b = typic.field(int(123)) c = typic.field(default=int(123)) A(<warning descr="Expected type 'int', got 'str' instead">a=str('123')</warning>, <warning descr="Expected type 'int', got 'str' instead">b=str(...
2.703125
3
leetCode/algorithms/medium/lowest_common_ancestor_of_a_binary_tree.py
ferhatelmas/algo
25
12768997
class Solution: def lowestCommonAncestor(self, root, p, q): if root is None or p == root or q == root: return root l = self.lowestCommonAncestor(root.left, p, q) r = self.lowestCommonAncestor(root.right, p, q) if l is None: return r if r is None: ...
3.359375
3
orders/migrations/0001_initial.py
toert/django-shop-template
1
12768998
<filename>orders/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-22 05:52 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ...
1.476563
1
vagalume_json/busca_top_100_artistas_vagalume.py
Koalapvh13/python_exercises
0
12768999
import json import requests def remove_repetidos(lista): l = [] for i in lista: if i not in l: l.append(i) l.sort() return l def busca_musicas(id_api): r = requests.get(id_api+'index.js') if r.status_code == 200: reddit_data = json.loads(r.content) musicas ...
3.046875
3
tests/test_dependency_duplicates.py
Aryabhata-Rootspring/fastapi
53,007
12769000
<reponame>Aryabhata-Rootspring/fastapi<gh_stars>1000+ from typing import List from fastapi import Depends, FastAPI from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() client = TestClient(app) class Item(BaseModel): data: str def duplicate_dependency(item: Item): retur...
2.265625
2
packios.py
skela/r
0
12769001
<filename>packios.py #!/usr/bin/env python import os import plistlib class PackIOS(object): def __init__(self, root, proj_folder, project, solution, release_notes=None, mdtool=None, configuration="Ad-Hoc"): self.name = proj_folder self.mdtool = mdtool self.proj_folder = os.path.join(root...
2.3125
2
novaplaylist/scrapers/__init__.py
gtnx/nova-playlist
0
12769002
<reponame>gtnx/nova-playlist # -*- coding: utf-8 -*- from Scraper import Scraper from FipScraper import FipScraper from NovaScraper import NovaScraper from OuiScraper import OuiScraper from NostalgieScraper import NostalgieScraper from RadioparadiseScraper import RadioparadiseScraper
1.117188
1
src/sima/post/nonequidistantsignal.py
SINTEF/simapy
0
12769003
<gh_stars>0 # This an autogenerated file # # Generated with NonEquidistantSignal from typing import Dict,Sequence,List from dmt.entity import Entity from dmt.blueprint import Blueprint from .blueprints.nonequidistantsignal import NonEquidistantSignalBlueprint from typing import Dict from sima.post.generatorsignal impo...
2.125
2
app/holidays.py
seratch/jp-holidays-for-slack
5
12769004
import logging from typing import Optional import requests import datetime from dataclasses import dataclass logger = logging.getLogger(__name__) @dataclass class Holiday: title: str date: str day_of_week: str day_of_week_text: str def fetch_public_holiday(token: str, target_date: datetime.date) ...
3.015625
3
precis/util.py
rukmal/precis
0
12769005
<reponame>rukmal/precis<filename>precis/util.py import collections import json import logging def buildData(data_file: str, override_files: list=[]) -> dict: """Initializes the static configuration variables used in the PaperRank system. Provides a method to override base configuration. Keyword Arguments...
3.0625
3
account/forms.py
ShwethaRGowda/FADB
149
12769006
from django import forms from .models import UserProfile class ProfileForm(forms.ModelForm): class Meta: model = UserProfile fields = ['name', 'photo'] widgets = { 'name': forms.TextInput(attrs={'class': 'form-control'}), 'photo': forms.FileInput(attrs={'class': 'for...
2.25
2
assignments/09-bottles/bottles.py
jaeanderson/biosys-analytics
0
12769007
<filename>assignments/09-bottles/bottles.py<gh_stars>0 #!/usr/bin/env python3 """ Name: jranderson Date: 03.16.19 Purpose: bottles of beers """ import argparse import os import re import sys # -------------------------------------------------------- def get_args(): """get command-line arguments""" parser = a...
3.328125
3
riskrate_data/__init__.py
riskrate/riskrate-data-python
0
12769008
<gh_stars>0 from .connection import DataClient from .helper import ( simple_query, simple_query_dict, simple_mutation, insert_chunked, )
1.234375
1
BasicPythonPrograms/Operator_Module_3.py
Pushkar745/PythonProgramming
0
12769009
import operator s1="Marlin" s2="beard" print("The Concatenated string is :",end="") print(operator.concat(s1,s2)) #using contains() to check if s1 contains s2 if(operator.contains(s1, s2)): print("Marlin Contains Beard") else: print("Marlin Does not contains Beard")
4.34375
4
p110_balanced_binary_tree.py
feigaochn/leetcode
0
12769010
<reponame>feigaochn/leetcode<gh_stars>0 # coding: utf-8 # author: <NAME> <<EMAIL>> # Problem: balanced binary tree # # Given a binary tree, determine if it is height-balanced. # # For this problem, a height-balanced binary tree is defined as a binary tree # in which the depth of the two subtrees of every node never ...
4.03125
4
cpa/imagelist.py
oba14/CellProfiler-Analyst
1
12769011
<gh_stars>1-10 from __future__ import print_function import logging import wx import numpy as np from properties import Properties from dbconnect import * from UserDict import DictMixin import imagetools p = Properties.getInstance() db = DBConnect.getInstance() class ImageListCtrl(wx.ListCtrl): def __init__(self,...
1.90625
2
h2o-py/tests/testdir_munging/pyunit_runif.py
ahmedengu/h2o-3
6,098
12769012
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def runif_check(): fr = h2o.H2OFrame([[r] for r in range(1,1001)]) runif1 = fr[0].runif(1234) runif2 = fr[0].runif(1234) runif3 = fr[0].runif(42) assert (runif1 == runif2).all(), "Expected...
2.25
2
Practical3-AddIns/ExplosionAddin/Install/ExplosionAddin_addin.py
masher92/GEOG_5790
0
12769013
import arcpy import pythonaddins class ExplosionButtonClass(object): """Implementation for ExplosionAddin_addin.explosionbutton (Button)""" def __init__(self): self.enabled = True self.checked = False def onClick(self): # Print message to confirm initialisation #pythonaddi...
2.46875
2
Programming_for_GIA_Core_Skills/Assessment_1/Task8_GUI's/model.py
jord9762/jordy9762.github.io
0
12769014
<reponame>jord9762/jordy9762.github.io import matplotlib matplotlib.use('TkAgg') #imports random library which is helpful for testing outcomes, contains functions such as shuffle import random #imports operators which may be missing from default Spyder import operator #imports the csv library necessary for readin...
3
3
spvcm/both_levels/sma_se/__init__.py
weikang9009/spvcm
14
12769015
from .model import SMASE
1.101563
1
users/forms.py
faisoabdirisak/NextDoor
0
12769016
<filename>users/forms.py from cProfile import label from django.forms import ModelForm from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User class CustomUserCreation(UserCreationForm): class Meta: model=User fields=['username','email','<PASSWORD>','<PAS...
2.34375
2
coursesApp/migrations/0005_delete_lessons.py
glen-s-abraham/Elearning-platform
0
12769017
<gh_stars>0 # Generated by Django 3.0.6 on 2020-06-03 12:42 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('coursesApp', '0004_auto_20200603_1809'), ] operations = [ migrations.DeleteModel( name='Lessons', ), ]
1.289063
1
src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py
benety/mongo
0
12769018
#!/usr/bin/env python # # Public Domain 2014-present MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a com...
1.296875
1
murano/tests/unit/api/v1/test_schemas.py
openstack/murano
91
12769019
<reponame>openstack/murano # Copyright (c) 2016 AT&T Corp # # 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 l...
1.867188
2
autocomplete_light/example_apps/unuseable_virtualfield/models.py
metzlar/django-autocomplete-light
1
12769020
<filename>autocomplete_light/example_apps/unuseable_virtualfield/models.py from django.db import models from vote.managers import VotableManager class HasVotes(models.Model): votes = VotableManager()
1.59375
2
MicroPython/esptool-master/espressif/efuse/esp32s2/__init__.py
hu-tianyi/AuTrix
1
12769021
<filename>MicroPython/esptool-master/espressif/efuse/esp32s2/__init__.py from .fields import EspEfuses # noqa: F401 from . import operations # noqa: F401
0.976563
1
simscale_eba/cli/set_env_variables.py
SimScaleGmbH/external-building-aerodynamics
0
12769022
import os import click def SetVars(api_url, api_key): ''' Takes API key and URL, sets them to environment variables Parameters ---------- api_url : str The SimScale API URL to call. api_key : str The SimScale API Key to use when calling, this is equivilent to the user...
2.625
3
repository/templatetags/file_type_tags.py
christianwgd/django_restic_gui
5
12769023
import os from django import template from django.utils.safestring import mark_safe from repository.models import FileExt register = template.Library() generic = '<path fill-rule="evenodd" d="M4 0h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm0 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2...
2.34375
2
data_helpers.py
nicholaswen/cnn-text-classification-tf
0
12769024
import numpy as np import re import pandas as pd def clean_str(string): """ Tokenization/string cleaning for all datasets except for SST. Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py """ string = re.sub(r"[^A-Za-z0-9(),!?\'\`]", " ", string) string = r...
3.09375
3
2020/adventofcode.py
wmdrthr/advent-of-code
0
12769025
#! /usr/bin/env python3 # encoding: utf-8 import os, sys, re import time from pprint import pprint from datetime import datetime, timedelta import itertools import collections import functools import math import pytz import requests YEAR = 2020 SESSIONID_FILE = '~/.config/adventofcode/session' USER_AGENT = 'wm...
2.765625
3
pdfserver/views.py
cburgmer/pdfserver
2
12769026
<filename>pdfserver/views.py<gh_stars>1-10 # -*- coding: utf-8 -*- import re from operator import attrgetter from flask import g, request, Response, session, render_template from flask import abort, redirect, url_for, jsonify from flaskext.babel import gettext from werkzeug import wrap_file from werkzeug.exceptions im...
2.359375
2
kong-python-pdk/kong_pdk/pdk/kong/nginx/__init__.py
srAtKong/kong-custom-plugin-py-tcp
18
12769027
<gh_stars>10-100 # AUTO GENERATED BASED ON Kong 2.4.x, DO NOT EDIT # Original source path: kong/pdk/nginx.lua from typing import TypeVar, Any, Union, List, Mapping, Tuple, Optional number = TypeVar('number', int, float) table = TypeVar('table', List[Any], Mapping[str, Any]) # XXX cdata = Any err = str from .shared i...
2.25
2
src/Memory.py
sumanthreddy07/uPower_Assembler
0
12769028
import sys class Memory: def __init__(self): self.memory = {} #single byte def get_address(self, address_str): if address_str in self.memory: return self.memory[addresss_str] else: print("memory not assigned, returning zero") return '0'*8 #s...
3.71875
4
fr/modules/actions/moveToFace.py
ktnyt/SeedWBA
0
12769029
# -*- coding: utf-8 -*- import cv2 import math from ..analyzers.facedetector import FaceDetector class Noaction(object): def activate(self): # Called when action activated return {} def update(self): act = { "wheelleft": 0.0, "wheelright": 0.0 } ...
2.78125
3
pyproteome/pathways/enrichments.py
white-lab/pyproteome
8
12769030
<gh_stars>1-10 # -*- coding: utf-8 -*- ''' This module does most of the heavy lifting for the pathways module. It includes functions for calculating enrichment scores and generating plots for GSEA / PSEA. ''' from __future__ import division from collections import defaultdict from functools import partial import logg...
2.25
2
crypto.py
manu9812/MongoDB
0
12769031
<filename>crypto.py import pymongo from flask import Flask, request, jsonify from werkzeug.exceptions import BadRequest from agent import main as agent app = Flask(__name__) @app.route("/") def index(): """ :return: Endpoints Cryptongo API """ # jsonify: Convierte diccionarios de python al formato ...
2.6875
3
examples/tensorflow/decoding/translate_example.py
hieuhoang/FasterTransformer
0
12769032
""" Modified From https://github.com/OpenNMT/OpenNMT-tf/blob/r1/examples/library/minimal_transformer_training.py MIT License Copyright (c) 2017-present The OpenNMT Authors. This example demonstrates how to train a standard Transformer model using OpenNMT-tf as a library in about 200 lines of code. While relatively s...
2.453125
2
fides/constants.py
dweindl/fides
0
12769033
<reponame>dweindl/fides """ Constants ----------- This module provides a central place to define native python enums and constants that are used in multiple other modules """ import enum import numpy as np class Options(str, enum.Enum): """ Defines all the fields that can be specified in Options to :py:c...
2.859375
3
VariationalPrinciple/VariationalPrinciple.py
szhang-cis/Kuru_Mac
0
12769034
import numpy as np from Kuru import QuadratureRule, FunctionSpace , Mesh from Kuru.FiniteElements.LocalAssembly._KinematicMeasures_ import _KinematicMeasures_ from Kuru.VariationalPrinciple._GeometricStiffness_ import GeometricStiffnessIntegrand as GetGeomStiffness from .DisplacementApproachIndices import FillGeometric...
2.28125
2
tests/application_tests.py
dhdemerson/azure-lightning-flask
0
12769035
"""Tests for the azure_lightning_flask application""" import unittest from mock import patch from azure.common import AzureMissingResourceHttpError from azure_lightning_flask.application import create_app from tests.test_config import TestConfig class TestApplication(unittest.TestCase): """Tests for the azure_lig...
2.40625
2
year1/python/week3/q9_minus.py
OthmanEmpire/university
1
12769036
### This program subtracts ### def minus(a, b): sub = a - b print(sub) print("Welcome to subtracting your life version 1.0.0.0.0.0.0.1!") x,y = input("Please input the digits of your life that you wish to subtract: ").split() x = int(x) y = int(y) minus(x,y)
3.9375
4
sendHeartbeat.py
lvoleing/rabbitMQ
3
12769037
from flask import Flask, request from flask_apscheduler import APScheduler import json import socket import datetime import mqManagementClass class Config(object): # 任务列表 JOBS = [ { 'id': 'heratbeat', 'func': '__main__:sendHeartbeat', #执行函数 'args': N...
2.375
2
tests/unit/test_jobs_storage.py
neuro-inc/platform-api
0
12769038
<filename>tests/unit/test_jobs_storage.py from datetime import timedelta from typing import Any import pytest from platform_api.orchestrator.job import ( JobRecord, JobRequest, JobStatus, current_datetime_factory, ) from platform_api.orchestrator.job_request import Container, ContainerResources from p...
2.15625
2
src/itoolkit/transport/base.py
jkyeung/python-itoolkit
1
12769039
class XmlServiceTransport(object): """XMLSERVICE transport base class Args: ctl (str): XMLSERVICE control options, see http://yips.idevcloud.com/wiki/index.php/XMLService/XMLSERVICEQuick#ctl ipc (str): An XMLSERVICE ipc key for stateful conections, see http://yips.idevcloud.com/wiki...
2.53125
3
main.py
musebc/pyplotgui
0
12769040
<reponame>musebc/pyplotgui """The main window for the PyPlot GUI""" import sys import random from PyQt5.QtWidgets import QApplication from matplotlib.figure import Figure from views.edit import PlotEdit from views.plot import Plot def create_a_sample_plot(): figure = Figure(figsize=(5, 4), dpi=100) data = [...
2.875
3
recursion/0206_reverse_linked_list.py
MartinMa28/Algorithms_review
0
12769041
<reponame>MartinMa28/Algorithms_review class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def reverseList(self, head: ListNode) -> ListNode: if head == None or head.next == None: return head next_node = head.next head.next ...
3.953125
4
setup.py
add30417/Py-Weishaupt-WCM-COM
4
12769042
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="weishaupt-wcm-com", version="0.0.10", author="<NAME>", author_email="<EMAIL>", description="Interfacing the Weishaupt WCM-COM module", long_description=long_description, long_descr...
1.390625
1
Harris_Corner_Detection_And_SIFT/code/student_code.py
dasdristanta13/Computer-vision
0
12769043
<reponame>dasdristanta13/Computer-vision import numpy as np import cv2 # You must not use cv2.cornerHarris() # You must not add any other library ### If you need additional helper methods, add those. ### Write details description of those """ Returns the harris corners, image derivative in X direction, and i...
3.390625
3
BasicPythonScripts/Temperature Conveter/temperature_converter.py
tanvi355/Awesome_Python_Scripts
3
12769044
def Cel(): celsius = float(input("Enter the temperature in Celsius ")) # It will take user input fahrenheit :float = (celsius * 9 / 5) + 32 # calculation part print("Value in Fahrenheit ", fahrenheit) def Far(): fahrenheit = float(input("Enter the temperature in Fahrenheit ")) # It will take user i...
4.09375
4
cp2/parser.py
thomas-franceschi/theory-project-pied-piper
0
12769045
#CP2 #<NAME> #<NAME> #import sys class baseParser: def __init__(self, expression, length, counter): self.expression = expression #String being parsed self.length = length #Max range for token self.counter = counter #Token self.M = '' #Output def parseRegexp(self): self.M = self.pa...
3.171875
3
python/rapids_triton/triton/client.py
divyegala/rapids-triton
1
12769046
<reponame>divyegala/rapids-triton # Copyright (c) 2021, NVIDIA 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 requi...
2.171875
2
home/migrations/0011_auto_20200217_1647.py
IATI/new-website
4
12769047
# Generated by Django 2.2.9 on 2020-02-17 16:47 from django.db import migrations, models import django.db.models.deletion import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0001_squashed_0021'), ('wagtailcore', '0041_group_collection_permissions...
1.585938
2
StoppingTargetAcceptanceCalculator.py
HCasler/SSC-Acceptance
0
12769048
#! usr/bin/env python #import calcGeomAcceptancePointSource as ptSrc from PointSourceAcceptanceCalculator import PointSourceAcceptanceCalculator from CollimatorGeometry import CollimatorGeometry import math from scipy import integrate class StoppingTargetAcceptanceCalculator: def __init__(self, collimatorGeometr...
2.1875
2
fairest/models/Rule.py
houfu/fairest
0
12769049
<reponame>houfu/fairest # Copyright (c) 2021. <NAME> # # This software is licensed under the The MIT License. # You should have received a copy of the license terms with the software. # Otherwise, you can find the text here: https://opensource.org/licenses/MIT # # # This software is licensed under the The MIT Lic...
2.453125
2
Week 1/PS1_Problem3.py
NagiLam/MIT-6.00.1x_2018
0
12769050
""" Problem Set 1 - Problem 3 Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then your program should print Longest substring in alphabetical order is: beggh In the case of t...
4.25
4