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 |
|---|---|---|---|---|---|---|
pywinrt/winsdk/windows/web/ui/__init__.py | pywinrt/python-winsdk | 3 | 12786951 | # WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.4
import enum
import winsdk
_ns_module = winsdk._import_ns_module("Windows.Web.UI")
try:
import winsdk.windows.applicationmodel.datatransfer
except Exception:
pass
try:
import winsdk.windows.foundation
except Exception... | 1.53125 | 2 |
source/modules/tester/testtermopi.py | AdL1398/PiCasso | 3 | 12786952 | <reponame>AdL1398/PiCasso
#!/usr/bin/python
"""
title : testtermopi.py
description : This program runs the termopi.py
: Displays the status of the resources (cpu load and memory usage) consumed by a Raspberry Pi
computer and the resources consumed by one or more contain... | 2.375 | 2 |
src/genie/libs/parser/iosxe/tests/ShowPlatformSoftwareFedIfm/cli/equal/golden_output_expected.py | nielsvanhooy/genieparser | 0 | 12786953 | expected_output = {
'interfaces': {
'Tunnel1': {
'if_id': '0x0000005d',
'state': 'READY'
},
'Tunnel2': {
'if_id': '0x0000005e',
'state': 'PENDING DELETE'
}
}
}
| 1.101563 | 1 |
FuckDrcom.py | Neotter/FuckDrcom | 8 | 12786954 | <reponame>Neotter/FuckDrcom
'''
Author: MonChen
Date: 2021-01-10 13:23:43
LastEditTime: 2021-01-14 15:25:52
'''
import urllib.request
import urllib.parse
import sys, time, subprocess, platform
hostname = "www.baidu.com"
manpage = 'FuckDrcom [option]...\n\t--login [IdNumbers] [password]\n\t--autologin [IdNumbers] [pas... | 2.59375 | 3 |
clock.py | bisrat-walle/Clock-python-Turtle | 2 | 12786955 | <gh_stars>1-10
import random
import turtle
import time
def display_hour_label(turtle_object):
turtle_object.hideturtle()
turtle_object.penup()
turtle_object.goto(0, 0)
turtle_object.setheading(90)
for i in range(12):
turtle_object.forward(190)
turtle_object.pendown()
turtle_object.... | 3.4375 | 3 |
run_inference.py | bhaprayan/keras-yolo3 | 0 | 12786956 | <gh_stars>0
from yolo import YOLO
from PIL import Image
import pandas as pd
dat = open('subset_train_nuro.txt').read().split('\n')
for line in dat:
img_name = line.split()[0]
img = Image.open(img_name)
model = YOLO()
predictions_list = model.detect_image(img)
pred_str = ' '.join((predictions_list)... | 2.796875 | 3 |
tests/integration/models/test_store.py | athospg/Simple-Store-REST-Api-Auth | 1 | 12786957 | <filename>tests/integration/models/test_store.py
from models.item import ItemModel
from models.store import StoreModel
from tests.base_test import BaseTest
class StoreTest(BaseTest):
def test_crud(self):
"""
CRUD: Create, Read, Update and Delete.
These are the four major and basic... | 2.796875 | 3 |
test/sequence_tagging.py | bebound/text | 0 | 12786958 | <reponame>bebound/text<gh_stars>0
from torchtext import data
from torchtext import datasets
from torchtext.vocab import GloVe
# Define the fields associated with the sequences.
WORD = data.Field(init_token="<bos>", eos_token="<eos>")
UD_TAG = data.Field(init_token="<bos>", eos_token="<eos>")
# Download and the load d... | 2.65625 | 3 |
my_study/re_study/re_img.py | zhangyage/Python-oldboy | 1 | 12786959 | <reponame>zhangyage/Python-oldboy
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#通过使用正则表单是筛选出网页中的图片链接下载图片到本地 这里我们测试需要,直接将网站的源码粘贴到了jike.txt中
import re
import requests
#读取网站代码:
f = open('jike.txt','r')
html = f.read()
f.close()
#匹配图片网址 #img src="https://a1.jikexueyuan.com/home/201604/28/3f10/57216b7d1... | 2.71875 | 3 |
bot.py | matcool/schezo-bot | 1 | 12786960 | import discord
from discord.ext import commands
import json
import glob
import time
import os
import motor.motor_asyncio as motor
import logging
import sys
from cogs.utils.guild_features import GuildFeatures
class Schezo(commands.Bot):
__slots__ = 'config', 'start_time', '_cogs_loaded', 'db_client', 'db', 'logger'... | 2.015625 | 2 |
photologue/migrations/0013_photo_source.py | newprincip/django-photologue | 0 | 12786961 | # Generated by Django 3.0.7 on 2020-07-04 10:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photologue', '0012_auto_20200704_0747'),
]
operations = [
migrations.AddField(
model_name='photo',
name='source',
... | 1.398438 | 1 |
StackApp/env/lib/python2.7/site-packages/blueprint/context_managers.py | jonathanmusila/StackOverflow-Lite | 0 | 12786962 | <reponame>jonathanmusila/StackOverflow-Lite
import os
import shutil
import tempfile
from blueprint import util
class cd(object):
"""
Run in an alternative working directory in this context.
"""
def __init__(self, new_cwd):
self.new_cwd = new_cwd
def __enter__(self):
self.old_cwd... | 2.6875 | 3 |
setup.py | MThioub/ssl-certificate-collision | 0 | 12786963 | <filename>setup.py
from setuptools import setup, find_packages
setup(
name='engine',
description='search a prime factor to the modulus ',
packages=find_packages())
| 1.296875 | 1 |
dxm/lib/DxColumn/DxFileField.py | experiortec/dxm-toolkit | 5 | 12786964 | <gh_stars>1-10
#
# 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 writing, software
# dis... | 1.867188 | 2 |
pygraphblas/binaryop.py | sebbacon/pygraphblas | 0 | 12786965 | """Contains all automatically generated BinaryOps from CFFI.
"""
__all__ = [
"BinaryOp",
"Accum",
"current_binop",
"current_accum",
"binary_op",
]
import sys
import re
import contextvars
from itertools import chain
from collections import defaultdict
from functools import partial
import numba
fr... | 2.09375 | 2 |
bytecode_magic/__init__.py | brennie/bytecode-magic | 0 | 12786966 | <gh_stars>0
from __future__ import unicode_literals
#: The version of bytecode_magic.
#:
#: This is in the format of:
#:
#: (Major, Minor, Micro, alpha/beta/rc/final, Release Number, Released)
VERSION = (0, 0, 0, 'alpha', 0, False)
def get_version_string():
version = '%s.%s' % (VERSION[0], VERSION[1])
if ... | 2.34375 | 2 |
plugins/help_text.py | SMILE-KILLER10/rename-tg | 4 | 12786967 | <filename>plugins/help_text.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) <NAME> & @No_OnE_Kn0wS_Me
# the logging things
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
logging.getL... | 2.046875 | 2 |
ftpfs/__main__.py | rr-/ftpfs | 6 | 12786968 | <gh_stars>1-10
#!/usr/bin/env python3
import time
import datetime
import argparse
import os
import sys
import stat
import tempfile
import errno
from getpass import getpass
from ftplib import FTP
from fuse import FUSE, FuseOSError, Operations # fusepy
DEFAULT_DATE = '19700101000000'
def debug(*args):
print(*arg... | 2.53125 | 3 |
SMC100CC/smcStack.py | RobStarek/QOLO_devices | 1 | 12786969 | import serial
from time import sleep, localtime, strftime, time
from smc100py3 import SMC100CC
"""
Controller class for stack of SMC100CC drivers.
It makes easier to handle multiple controllers.
Requires smc100py3.py module.
Example:
ConstructionDict = {
1 : (1, None, 0),
2 : (2, None,... | 2.6875 | 3 |
modules/utils/module_screenshot.py | Fogapod/KiwiBot | 18 | 12786970 | <filename>modules/utils/module_screenshot.py<gh_stars>10-100
from objects.modulebase import ModuleBase
from objects.permissions import PermissionEmbedLinks, PermissionAttachFiles
import re
import time
import asyncio
import aiohttp
from os import devnull
from async_timeout import timeout
from discord import Embed, Co... | 2.421875 | 2 |
python/model/CPOMDP.py | AlgTUDelft/ConstrainedPlanningToolbox | 11 | 12786971 | #################################################################################
# ConstrainedPlanningToolbox
# Copyright (C) 2019 Algorithmics group, Delft University of Technology
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | 1.898438 | 2 |
analysis.py | numberlearning/draw | 2 | 12786972 | import warnings
warnings.filterwarnings('ignore')
import tensorflow as tf
from tensorflow.examples.tutorials import mnist
import numpy as np
import os
import random
from scipy import misc
import time
import sys
#from draw import viz_data, x, A, B, read_n, T
#from drawCopy1 import viz_data, x, A, B, read_n, T
#from dra... | 2.3125 | 2 |
django_heroku_deploy/whatever/models.py | AhmadAmmar260/temp | 0 | 12786973 | <reponame>AhmadAmmar260/temp
from django.db import models
class Whatever(models.Model):
title = models.CharField(max_length=200)
body = models.TextField()
created_at = models.DateTimeField(auto_now_add=True)
def __unicode__(self):
return self.title
| 2.390625 | 2 |
pakdump/utils/ap.py | haste/pakdump | 0 | 12786974 | import argparse
from pathlib import Path
from typing import Any, Optional, Sequence, Union
class FullDirPath(argparse.Action):
"""
argparse.Action subclass to resolve a path and make sure it's a directory
"""
def __call__(
self,
parse: argparse.ArgumentParser,
namespace: argpa... | 3.3125 | 3 |
main/reconstruction/nnmodel/lib/plot.py | awangga/braindecoding | 0 | 12786975 | <filename>main/reconstruction/nnmodel/lib/plot.py
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import matplotlib.cm as cm
def tigaKolomGambar(judul,sub1,gbr1,sub2,gbr2,sub3,gbr3):
for i in range(len(gbr3)):
fig, axs = plt.subplots(nrows=1, ncols=3, figsize=(12,4))
plt.sca(axs[0])
... | 2.375 | 2 |
element/port.py | antopenrf/FLO | 3 | 12786976 | """Illustration of the concept of using 'port' module.
c1 = Cap('c1', 1)
c1.nosp = 2, nocp: number of schematic ports
c1.nond = 4, nond: number of matrix nodes
c1.s_ports = (1, 2)
c1.m_ports = (1, 2, -1, -2)
c2 = Cap('c2', 2)
c2.nosp = 2
c2.nomp = 4
c2.s_ports = (3, 4) -- seq of ports for symbol
c2.m_ports = (3... | 3.640625 | 4 |
proma/config/migrations/0001_initial.py | erickgnavar/Proma | 3 | 12786977 | # Generated by Django 2.0.1 on 2018-03-22 20:14
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Configuration',
... | 1.828125 | 2 |
reader.py | LittleNightmare/Read_Arknights_user_data | 1 | 12786978 | <reponame>LittleNightmare/Read_Arknights_user_data
from json import load
from base64 import b64encode, b64decode
import requests
def _load_file(user_date_file="arknights user data_login.json", check_list_file="item_table.json"):
try:
with open(user_date_file, "r", encoding="utf-8") as f:
user_... | 3 | 3 |
chats.py | brivie-suni/startit-chats | 0 | 12786979 | from flask import json, jsonify
from datetime import datetime
LOGFAILS = "chats.txt"
def lasi(adresats):
chata_rindas = []
with open(LOGFAILS, "r", encoding="utf-8") as f:
for rinda in f:
r = json.loads(rinda)
if "adresats" in r:
if r["adresats"] == adresats or ... | 2.65625 | 3 |
tests/classes/cbm_article.py | Jesse-Yung/jsonclasses | 0 | 12786980 | <gh_stars>0
from __future__ import annotations
from jsonclasses import jsonclass, types
def create_first_revision(article: CBMArticle) -> None:
CBMRevision(name='First').article = article
def force_content(article: CBMArticle) -> None:
article.content = 'UPDATED'
@jsonclass
class CBMRevision:
name: st... | 2.375 | 2 |
tests/variables/test3.py | past-one/rubymine-is2018 | 0 | 12786981 | <filename>tests/variables/test3.py
x = int(input("x"))
if x != 10 and x == 10: # false
pass
| 2.828125 | 3 |
gateway/kit/pubsub.py | dustinengle/smart-mailbox | 0 | 12786982 | <reponame>dustinengle/smart-mailbox
#!/usr/bin/env python
import redis
import sys
from codec import decode, encode
from logger import error, info
fns = {}
try:
_channel = 'sensor'
redis = redis.Redis(host='localhost', port=6379, db=1)
pubsub = redis.pubsub(ignore_subscribe_messages=True)
except Exceptio... | 2.234375 | 2 |
python/highcard.py | jrduncans/highcard | 0 | 12786983 | <filename>python/highcard.py<gh_stars>0
#!/bin/env python
# Copyright 2006 <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 r... | 3.484375 | 3 |
pyqt/python/layout_dynamiczny.py | rikkt0r/presentations | 1 | 12786984 | import sys
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import (QApplication, QMainWindow, QCheckBox, QVBoxLayout,
QLineEdit, QPushButton, QWidget, QHBoxLayout)
class SuperCheckbox(QHBoxLayout):
def __init__(self, parent=None):
super(SuperCheckbox, self).__init__(parent... | 2.296875 | 2 |
burputils.py | parsiya/burputils | 3 | 12786985 | """
Burp utility module for Python Burp extensions. Author: <NAME>
License: MIT
# Usage
1. Add it as a Python Burp module and use `from burputils import BurpUtils`.
For more info see:
https://parsiya.net/blog/2018-12-19-python-utility-modules-for-burp-extensions/
2. Copy the... | 2.46875 | 2 |
adoptions/apps.py | Pruthviraj98/Wisdompets_linkedInLearning | 0 | 12786986 | from django.apps import AppConfig
class AdoptionsConfig(AppConfig):
name = 'adoptions'
| 1.164063 | 1 |
src/cake/registry.py | anlongfei/cake | 14 | 12786987 | """Utilities for querying the Windows registry.
@see: Cake Build System (http://sourceforge.net/projects/cake-build)
@copyright: Copyright (c) 2010 <NAME>, <NAME>.
@license: Licensed under the MIT license.
"""
import _winreg as winreg # Do this so Python 2to3 conversion works.
import sys
import cake.system
_shownWow... | 2.609375 | 3 |
.github/workflows/guess-the-word-minigame/guesss_the_word.py | darlingtonjones/guesss_the_word | 0 | 12786988 | import random
lives = 5 #this is a starting live
words = ['antelope', 'planet', 'science', 'measurement',
'africa', 'space', 'systems', 'continental']
secret_word = random.choice(words)
clue = list('?????')
heart_symbol = u'\u2764'
print(heart_symbol * 5)
guessed_word_correctly = False
def... | 3.890625 | 4 |
conans/test/functional/toolchains/cmake/test_cmake_toolchain_xcode_flags.py | Mu-L/conan | 1 | 12786989 | <gh_stars>1-10
import textwrap
import platform
import os
import pytest
from conans.test.utils.tools import TestClient
def _add_message_status_flags(client):
cmakelists_path = os.path.join(client.current_folder, "CMakeLists.txt")
with open(cmakelists_path, "a") as cmakelists_file:
cmakelists_file.wri... | 2 | 2 |
francis/cogs/profile.py | trantinan2512/Francis | 0 | 12786990 | <gh_stars>0
from discord.ext import commands
import discord
# import asyncio
# import operator
# from pprint import pprint
from utils.user import get_user_obj
class ProfileCommands(commands.Cog):
"""Profile related commands"""
def __init__(self, bot):
self.bot = bot
@commands.command(name='eprof... | 2.4375 | 2 |
way/python/exercises/checkio/checkio005.py | only-romano/junkyard | 0 | 12786991 |
def best_stock(data):
max, best = 0, ''
for k, v in data.items():
if v > max:
max = v
best = k
else:
pass
return best
if __name__ == '__main__':
print("Example:")
print(best_stock({
'CAC': 10.0,
'ATX': 390.2,
... | 3.46875 | 3 |
utils/initial_state.py | fhoeb/fh-thesis-scripts | 2 | 12786992 | import numpy as np
import mpnum as mp
import tmps
from tmps.utils import state_reduction_as_ndarray, convert, broadcast_number_ground_state, get_thermal_state
import time
from scipy.special import factorial
import math
def get_spin_initial_state(theta, mpa_type='mps'):
"""
Returns the initial state for the... | 2.453125 | 2 |
0x11-python-network_1/2-post_email.py | Nahi-Terefe/alx-higher_level_programming | 0 | 12786993 | #!/usr/bin/python3
""" post email """
import urllib.request
import urllib.parse
import sys
if __name__ == "__main__":
value = {'email': sys.argv[2]}
data = urllib.parse.urlencode(value)
data = data.encode('utf-8')
req = urllib.request.Request(sys.argv[1], data)
with urllib.request.urlopen(req) as ... | 3.0625 | 3 |
profiles/migrations/0002_profile_active.py | edgarceron/agent_console | 0 | 12786994 | # Generated by Django 3.0.4 on 2020-04-13 21:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='active',
f... | 1.5625 | 2 |
0004.Median of Two Sorted Arrays/test.py | zhlinh/leetcode | 0 | 12786995 | <reponame>zhlinh/leetcode<filename>0004.Median of Two Sorted Arrays/test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from solution import Solution
nums1 = [1]
nums2 = [2]
sol = Solution()
result = sol.findMedianSortedArrays(nums1, nums2)
print(result)
| 2.578125 | 3 |
examples/withRaycing/11_Waves/coherentModePropagation.py | kklmn/xrt | 71 | 12786996 | <filename>examples/withRaycing/11_Waves/coherentModePropagation.py
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__date__ = "8 Dec 2021"
# import matplotlib as mpl
# mpl.use('agg')
import os, sys; sys.path.append(os.path.join('..', '..', '..')) # analysis:ignore
import numpy as np
import xrt.plotter as xrtp
import ... | 2.171875 | 2 |
pursuit/reward.py | goncalo-rodrigues/thesis | 0 | 12786997 | <reponame>goncalo-rodrigues/thesis<filename>pursuit/reward.py<gh_stars>0
def get_reward_function(num_agents, world_size):
def reward(state, actions, next_state):
return 100 if next_state.terminal else -1
return reward
| 1.992188 | 2 |
fairseq/models/models/mm2vec.py | houshengyuan/Parsing_enhanced_NMT | 0 | 12786998 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import os
from dataclasses import dataclass, field
from typing import List, Tuple
import numpy as np
import torch
import torch.nn... | 1.945313 | 2 |
mm_scripting_util/core.py | luclepot/mm_scripting_util | 0 | 12786999 | <gh_stars>0
from mm_scripting_util.util import *
from mm_scripting_util.util import _mm_util, _mm_backend_util, _mm_base_util
class miner(_mm_util):
"""
Main container for the class.
This class should handle all necessary interfacing with
madminer and madgraph.
"""
__MODULE_NAME = "mm_scr... | 2.40625 | 2 |
models/nvidia.py | infiniai/SDCnd-Behavioural-Cloning | 0 | 12787000 | from keras.models import Sequential
from keras.models import Model
from keras.layers import Cropping2D, Conv2D, MaxPool2D, Flatten, Dense, Dropout, ELU, BatchNormalization, Lambda
from keras.layers import concatenate
import numpy as np
import tensorflow as tf
def to_yuv(img, in_cspace='RGB'):
img_float = tf.cast(... | 2.90625 | 3 |
osrefl/loaders/reduction/examples/e3a12/__init__.py | reflectometry/osrefl | 2 | 12787001 | """
Sample data from NG-1:
e3a12 rem (71g) cofe2o4,cofe(10nm),ta
"""
import numpy, os
from osrefl.loaders.reduction.data import Data,PolarizedData
PATH = os.path.dirname(os.path.realpath(__file__))
def loadABCD(file):
data = PolarizedData(xlabel="Qz",xunits="invA",vlabel="counts")
for ext,d in [('A',dat... | 2.390625 | 2 |
hw-code/HW4_7-1a.py | elsdrium/1022-Algorithm | 0 | 12787002 | <filename>hw-code/HW4_7-1a.py<gh_stars>0
def HoarePartition(A, p, r):
x = A[p]
i = p - 1
j = r + 1
counter=0
while True:
counter += 1
print( 'Iteration ' + str(counter) + ':' )
while True:
j -= 1
if A[j] <= x:
break
while T... | 2.875 | 3 |
utils.py | Danglich/flowers102_retrieval_streamlit | 3 | 12787003 | import os
import pickle
import cv2
import numpy as np
import streamlit as st
import tensorflow as tf
import grpc
from tensorflow_serving.apis import (
prediction_service_pb2_grpc,
predict_pb2
)
from consts import (
TRAIN_FD,
TRAIN_PKL_FP,
TRAIN_LABEL_FP
)
@st.cache
def load_prec_embs():
with... | 2.546875 | 3 |
everyaction/objects.py | partiallyderived/everyaction-client | 0 | 12787004 | """
This module contains EveryAction objects, such as :class:`.Person` or :class:`.CanvassResponse`, which represent
structured EveryAction data directly corresponding to objects in the
`EveryAction 8 VAN API docs <https://developers.everyaction.com/van-api>`__.
"""
from datetime import datetime
from typing import Any... | 1.992188 | 2 |
project-smokeRec/inference.py | pengxj/DeepLearningCourse | 1 | 12787005 | <reponame>pengxj/DeepLearningCourse
import torch
from torchvision import transforms
import numpy as np
from PIL import Image
from model import LeNet
img = Image.open('../data/smokedata/nn401.jpg')
img.show()
mytransform = transforms.Compose(
[transforms.Resize([32,32]),
transforms.ToTensor... | 2.984375 | 3 |
render_ospray/sync.py | surfsara-visualization/blospray | 27 | 12787006 | # Based on intern/cycles/blender/blender_camera.cpp
from mathutils import Matrix
class BlenderCamera:
def __init__(self, b_render):
self.nearclip = 1e-5
self.type = 'CAMERA_PERSPECTIVE'
self.ortho_scale = 1.0
self.lens = 50.0
self.aperturesize = 0.0
... | 2.28125 | 2 |
src/jgikbase/test/idmapping/core/user_lookup_test.py | jgi-kbase/IDMappingService | 0 | 12787007 | from unittest.mock import create_autospec
from jgikbase.idmapping.storage.id_mapping_storage import IDMappingStorage
from jgikbase.idmapping.core.user_lookup import LocalUserLookup, UserLookupSet, UserLookup
from jgikbase.idmapping.core.user import AuthsourceID, User, Username
from jgikbase.idmapping.core.tokens import... | 2.015625 | 2 |
pubcode/__init__.py | Venti-/pubcode | 4 | 12787008 | <reponame>Venti-/pubcode<filename>pubcode/__init__.py
"""A simple module for creating barcodes.
"""
__version__ = '1.1.0'
from .code128 import Code128
| 1.34375 | 1 |
todolist_app/migrations/0001_initial.py | Russel777/todolist | 0 | 12787009 | <filename>todolist_app/migrations/0001_initial.py
# Generated by Django 2.1.2 on 2018-11-04 17:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 1.625 | 2 |
sqlalchemy_ag_grid/__init__.py | ytkj/sqlalchemy-ag-grid | 5 | 12787010 | from .query import SortFilterQuery
| 1.039063 | 1 |
tiny_template_engine.py | zizon/TinyTemplate | 0 | 12787011 | <filename>tiny_template_engine.py
#!/usr/bin/env python
# -*- coding: utf8 -*-
import codecs
import xml.sax
import json
import copy
import logging
import math
import atexit
import tarfile
from datetime import datetime
from xml.sax.handler import ContentHandler
class IO(object):
def __init__(self):
self.d... | 2.3125 | 2 |
env/lib/python3.6/site-packages/chargebee/version.py | Mohitkaushal97/File | 0 | 12787012 | VERSION = '2.7.4'
| 1.101563 | 1 |
consoleme/handlers/v1/roles.py | yi2020/consoleme | 0 | 12787013 | <filename>consoleme/handlers/v1/roles.py
import ujson as json
from consoleme.config import config
from consoleme.handlers.base import BaseMtlsHandler
from consoleme.lib.crypto import Crypto
from consoleme.lib.plugins import get_plugin_by_name
stats = get_plugin_by_name(config.get("plugins.metrics"))()
log = config.ge... | 2.234375 | 2 |
autopy/core/data/Find.py | songofhawk/autopy | 0 | 12787014 | <reponame>songofhawk/autopy
from __future__ import annotations
import time
from autopy.core.action import ActionMouse
from autopy.core.data.Action import Execution, Action
from autopy.core.detection.ImageDetection import ImageDetection
from autopy.core.detection.OcrDetection import OcrDetection
from autopy.core.detec... | 2.109375 | 2 |
polling_stations/apps/data_collection/management/commands/import_west_dorset.py | chris48s/UK-Polling-Stations | 0 | 12787015 | <reponame>chris48s/UK-Polling-Stations<filename>polling_stations/apps/data_collection/management/commands/import_west_dorset.py
from data_collection.management.commands import BaseXpressDCCsvInconsistentPostcodesImporter
class Command(BaseXpressDCCsvInconsistentPostcodesImporter):
council_id = 'E07000052'
addr... | 1.734375 | 2 |
uwu_links/links.py | simonfong6/uwu-links | 1 | 12787016 | """Map of short links to the full urls."""
from google.cloud import firestore
from google.cloud.firestore import Increment
LINKS_COLLECTION_NAME = u'links'
TOTAL_VISITS_COLLECTION_NAME = u'total_visits'
URL_KEY = u'url'
VISIT_COUNT_KEY = u'visit_count'
COUNT_KEY = u'count'
class Links:
def __init__(self):
... | 3.125 | 3 |
yesterday/config/settings/dev.py | imkevinxu/yesterday | 3 | 12787017 | <reponame>imkevinxu/yesterday
"""Development settings and globals."""
from __future__ import absolute_import
from .base import *
import os
########## DEBUG CONFIGURATION
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TE... | 1.726563 | 2 |
滤波器.py | 990676/990676 | 0 | 12787018 | >>> from scipy import signal
>>> import matplotlib.pyplot as plt
>>> b, a = signal.butter(4, 100, 'low', analog=True)
>>> w, h = signal.freqs(b, a)
>>> plt.semilogx(w, 20 * np.log10(abs(h)))
>>> plt.title('Butterworth filter frequency response')
>>> plt.xlabel('Frequency [radians / second]')
>>> plt.ylabel('Amplitude [... | 3.375 | 3 |
examples/Plot_FibonacciLines.py | Physicworld/pyjuque | 343 | 12787019 | import os
import sys
curr_path = os.path.abspath(__file__)
root_path = os.path.abspath(
os.path.join(curr_path, os.path.pardir, os.path.pardir))
sys.path.append(root_path)
from pyjuque.Exchanges.CcxtExchange import CcxtExchange
from pyjuque.Plotting import PlotData
import plotly.graph_objs as go
def horizontal_lin... | 2.46875 | 2 |
Proyect/api/views.py | JZ1999/RandomProyect | 0 | 12787020 | <reponame>JZ1999/RandomProyect<filename>Proyect/api/views.py
from django.http import JsonResponse, HttpResponseBadRequest
from rest_framework import generics
from .models import Game
from .serializers import GameSerializer
from .forms import GameForm
class ListGamesView(generics.ListAPIView):
queryset = Game.obj... | 2.46875 | 2 |
src/alembic/versions/01e58ee9eccb_adjust_constraints_on_pull_request_flags.py | yifengyou/learn-pagure | 0 | 12787021 | <filename>src/alembic/versions/01e58ee9eccb_adjust_constraints_on_pull_request_flags.py<gh_stars>0
"""Adjust constraints on pull_request_flags
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2017-11-16 16:50:47.278252
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revisi... | 1.179688 | 1 |
google/cloud/aiplatform_v1beta1/types/model_monitoring.py | SinaChavoshi/python-aiplatform | 0 | 12787022 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 1.765625 | 2 |
jquery_widgets/fields.py | fu2re/django-jquery-widgets | 1 | 12787023 | <filename>jquery_widgets/fields.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from django import forms
from .widgets import JQWSlider
class ForeignKeySearchField(forms.fields.ChoiceField):
"""Form field to select a model for a ForeignKey db field"""
pass # Fix this field later
class JQWSliderField(forms.IntegerField)... | 2.0625 | 2 |
data-structures/python/fibo2.py | zubinshah/algorithms | 0 | 12787024 | <gh_stars>0
#!/usr/bin/python
import sys
#This python program implements fibonacci series of a given function.
def fibo(n): #print fibo series upto n
"""Print fibonacci series up to n numbers. """
a, b = 0, 1
fibSeq = []
while a < n:
fibSeq.append(a)
a , b = b, a+b
print fibSeq
... | 4.03125 | 4 |
functions/Naive_Bayes_Agrawal/test/test-producer.py | pandio-com/pulsar-python-functions | 7 | 12787025 | <reponame>pandio-com/pulsar-python-functions<filename>functions/Naive_Bayes_Agrawal/test/test-producer.py
import pulsar, json, numpy
from skmultiflow.data import AGRAWALGenerator
client = pulsar.Client('pulsar://127.0.0.1:6650')
producer = client.create_producer('persistent://public/default/in')
generator = AGRAWALG... | 2.234375 | 2 |
desafios/des006.py | Ericssm96/python | 0 | 12787026 | n1 = int(input('Digite um número que você deseje saber o dobro, triplo e raiz quadrada: '))
print(f'O dobro do seu número é {n1 * 2}, o triplo é {n1 * 3}, e a raiz quadrada é {n1 ** (1 / 2)}.')
| 3.6875 | 4 |
python/misc/clean-sms-mms.py | bmaupin/graveyard | 1 | 12787027 | <filename>python/misc/clean-sms-mms.py
#!/usr/bin/env python3
''' Deletes old messages from a backup file created by Titanium Backup Pro
'''
import datetime
import lxml.etree
import shutil
import sys
MAXIMUM_MESSAGE_AGE_IN_DAYS = 365
if len(sys.argv) < 2:
sys.exit('USAGE: %s /path/to/com.keramidas.virtual.XML_M... | 2.78125 | 3 |
Menu.py | MEBestawy/IMESH-Project | 0 | 12787028 | <reponame>MEBestawy/IMESH-Project<gh_stars>0
import pygame
from State import STATE
from typing import Dict
from Button import Button
import Game
WHITE = (255, 255, 255)
class Menu:
"""
This class handles the different game screens of Connect 2^2 depending on
the current game gamestate.
===Private At... | 3.3125 | 3 |
mppsolar/outputs/json.py | 20after4/mpp-solar | 0 | 12787029 | import json as js
import logging
from .baseoutput import baseoutput
log = logging.getLogger("MPP-Solar")
class json(baseoutput):
def __str__(self):
return "json - outputs the results to standard out in json format"
def __init__(self, *args, **kwargs) -> None:
log.debug(f"processor.json __in... | 2.84375 | 3 |
blog/app/crud/user_crud.py | evi1ghost/blog_on_fast_api | 1 | 12787030 | <filename>blog/app/crud/user_crud.py
from sqlalchemy.orm import Session
from fastapi import Depends, HTTPException, status
from jose import JWTError, jwt
from ..auth import (
verify_password, get_password_hash, oauth2_scheme,
SECRET_KEY, ALGORITHM
)
from ..database import get_db
from ..models import user_mode... | 2.578125 | 3 |
code/module/image_module/image_handler.py | s31b18/comp4211-spring2018-project | 1 | 12787031 | import urllib.request
import os
class ImageHandler:
def __init__(self, dir_prefix):
self.poster_dir_path = "./poster/" + dir_prefix + "/"
self.poster_url = "http://image.tmdb.org/t/p/w185"
def download_all_posters(self, df):
directory = os.path.dirname(self.poster_dir_path)
... | 3.15625 | 3 |
act/cli.py | attakei/act | 1 | 12787032 | <filename>act/cli.py
# -*- coding:utf-8 -*-
from pathlib import Path
import logging
import subprocess
import click
Logger = logging.getLogger(__name__)
ROOT = Path(__file__).resolve().parents[1] # type: Path
@click.group()
def act():
pass
@act.command()
def upgrade():
"""Upgrade act
"""
repo_dir... | 2.421875 | 2 |
2017/day6.py | JonSn0w/advent-of-code | 1 | 12787033 | <gh_stars>1-10
# There are sixteen memory banks; each memory bank can hold any number of blocks. The goal of the reallocation routine is to balance the blocks between the memory banks.
# The reallocation routine operates in cycles. In each cycle, it finds the memory bank with the most blocks (ties won by the lowest-num... | 3.953125 | 4 |
train_utils.py | ulissesbcorrea/ABSA-PyTorch | 0 | 12787034 | # -*- coding: utf-8 -*-
# file: train_utils.py
# author: songyouwei <<EMAIL>>
# Copyright (C) 2018. All Rights Reserved.
from data_utils import ABSADatesetReader
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from tensorboardX import SummaryWriter
device = torch.device('cuda' if torch.cuda... | 2.28125 | 2 |
prediction/tools/model_warmup/model_warmup.py | gogasca/ai-platform-samples-1 | 418 | 12787035 | <gh_stars>100-1000
#
# Copyright 2020 Google LLC
#
# 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.359375 | 2 |
topohiding/primes.py | jmgrosen/6857project | 0 | 12787036 | import secrets
def max_pow_2(n):
i = 0
while n % (2 ** i) != 0:
i += 1
return i
# def miller_rabin_p(n, r, d):
def miller_rabin(k, n):
if k == 1:
return False
elif k in (2, 3):
return True
elif k % 2 == 0:
return False
else:
r = max_pow_2(n)
... | 3.390625 | 3 |
mentorship_pairing/models.py | steveflys/mentorship-app | 9 | 12787037 | <reponame>steveflys/mentorship-app<filename>mentorship_pairing/models.py
from django.core.exceptions import ValidationError
from django.db import models
# Create your models here.
from mentorship_profile.models import (Mentee, Mentor, Profile)
# TODO: Different reasons for Mentor/Mentee?
DISCONTINUE_REASONS = (
... | 2.328125 | 2 |
week8/predict-sub2.py | rve/DM-Lab | 2 | 12787038 | <gh_stars>1-10
# coding: utf-8
# In[102]:
#visualization part
#import matplotlib.pyplot as plt
#import seaborn as sns
#basic libs
import pandas as pd
import numpy as np
import random as rnd
from sklearn.model_selection import cross_val_score
# machine learning
from sklearn.linear_model import LogisticRegression
... | 2.671875 | 3 |
tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unnecessary_raw_strings.py | cdhiraj40/wemake-python-styleguide | 1,931 | 12787039 | <filename>tests/test_visitors/test_tokenize/test_primitives/test_string_tokens/test_unnecessary_raw_strings.py
import pytest
from wemake_python_styleguide.violations.consistency import (
RawStringNotNeededViolation,
)
from wemake_python_styleguide.visitors.tokenize.primitives import (
WrongStringTokenVisitor,
... | 2.65625 | 3 |
leetcode/188.best-time-to-buy-and-sell-stock-iv.py | geemaple/algorithm | 177 | 12787040 | <filename>leetcode/188.best-time-to-buy-and-sell-stock-iv.py
class Solution(object):
def maxProfit(self, k, prices):
"""
:type k: int
:type prices: List[int]
:rtype: int
"""
if prices is None or len(prices) == 0 or k == 0:
return 0
res = 0
... | 3.203125 | 3 |
pyclustering/cluster/rock.py | JosephChataignon/pyclustering | 1,013 | 12787041 | """!
@brief Cluster analysis algorithm: ROCK
@details Implementation based on paper @cite inproceedings::rock::1.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
from pyclustering.cluster.encoder import type_encoding
from pyclustering.utils import euclidean_distance
from pyc... | 3.078125 | 3 |
subj_and_aspectrix.py | c0ntradicti0n/Distinctiopus | 0 | 12787042 | import itertools
from language.heuristic.hardcore_annotated_expression import eT, apply_fun_to_nested, eL, eD, ltd_ify, Argu
from language.heuristic.littletools.generator_tools import count_up
from language.heuristic.pairix import Pairix
from language.heuristic.littletools.nested_list_tools import flatten_reduce, coll... | 2.40625 | 2 |
randomOutput.py | poodarchu/SogouPersona | 1 | 12787043 | # -*- coding=utf-8 -*-
import random
def randomResult(inputFilePath, outputFilePath):
fr = open(inputFilePath, 'rb')
fw = open(outputFilePath, 'w')
userList = []
for line in fr.readlines():
list = line.split('\t')
userList.append(list[0])
# print len(userList)
# for i in user... | 3.125 | 3 |
jtalkpy/__init__.py | yhay81/jtalkpy | 1 | 12787044 | import subprocess
from typing import Union
class Jtalk:
def __init__(self,
dict_dir,
voice_file,
output_file='/dev/null',
trace_file='/dev/null',
sampling='auto',
frame_period='auto',
all_pass='a... | 2.3125 | 2 |
pysnmp/TPT-LICENSE-MIB.py | agustinhenze/mibs.snmplabs.com | 11 | 12787045 | <gh_stars>10-100
#
# PySNMP MIB module TPT-LICENSE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPT-LICENSE-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:18:56 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3... | 1.671875 | 2 |
lab-assignment-3/code/app.py | omkarshelar/CSUA32181-VIIT | 0 | 12787046 | from flask import Flask, render_template, redirect, url_for, flash
from forms import addContactForm
import db_utils
# initialize the Flask app
app = Flask(__name__)
# Note: This is a demo application hence secret is hardcoded for simplicity.
# For all practical purposes, take the key from OS environment variables or ... | 3.03125 | 3 |
tests/test_main_router.py | lokaimoma/Flask-QR-Code-Web-APP | 2 | 12787047 | <filename>tests/test_main_router.py
# Created by Kelvin_Clark on 3/10/22, 2:45 PM
from flask import url_for
import pytest
@pytest.mark.parametrize(argnames='path', argvalues=["/app/", "/app/generateQrCode/"])
def test_login_required(test_client, path):
with test_client:
response = test_client.get(path)
... | 2.71875 | 3 |
pydemic/memories.py | Catastropha/pydemic | 3 | 12787048 | <filename>pydemic/memories.py
class Memory:
"""Fixed-size buffer to store (score, object) tuples"""
def __init__(self,
memory_size: int = 1,
):
"""Initialize a MemoryBuffer object"""
self.memory_size = memory_size
self.memory = []
def add(self,
... | 3.171875 | 3 |
demos/ch4_files/basic_text_file.py | mikeckennedy/python_workshop_demos_april_2018 | 1 | 12787049 | from models import Notebook, TextNote, VideoNote
bio = Notebook("Bio 201 Notes")
bio.notes.append(TextNote("This is the first day of Bio 201"))
bio.notes.append(TextNote("Final exam is 95%."))
bio.notes.append(VideoNote("https://www.youtube.com/watch?v=PKffm2uI4dk"))
bio.display()
bio.save("bio201.txt")
bio.load("bi... | 2.578125 | 3 |
main.py | meintte/IndianPlanetaryComputation | 0 | 12787050 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
from math import sqrt
import numpy as np
import yaml
from scipy.interpolate import interp1d
class PlanetVariables:
def __init__(self, name):
self.name = name
self._getDataFromFile()
def _getDataFromFile(self):
with open("plan... | 2.546875 | 3 |