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 |
|---|---|---|---|---|---|---|
Application/AdminModule.py | nimitpatel26/Book-Fetch | 0 | 12799851 | from random import randint
import datetime
import pymysql
import cgi
def getConnection():
return pymysql.connect(host='localhost',
user='root',
password='<PASSWORD>',
db='BookFetch')
def newBook():
Title = input("Enter the title ... | 3.234375 | 3 |
pages/clean_box/images/sims_for_hoopla/pot_ext_shears_kappa.py | linan7788626/linan7788626.github.io | 0 | 12799852 | <filename>pages/clean_box/images/sims_for_hoopla/pot_ext_shears_kappa.py
import numpy as np
def deflection_sub_pJaffe(x0, y0, re, rc, a, x, y):
r = np.sqrt((x - x0)**2.0 + (y - y0)**2.0)
res = re / r * (np.sqrt(rc * rc + r * r) - rc - np.sqrt(a * a + r * r) + a)
return res * (x - x0) / r, res * (y - y0) ... | 1.820313 | 2 |
earsie_eats_blog/users/views.py | genomics-geek/earsie-eats.com | 0 | 12799853 | from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import LoginRequiredMixin
from django.urls import reverse
from django.views.generic import DetailView, ListView, RedirectView, UpdateView
from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from allauth.socialac... | 2.125 | 2 |
duplicateOverSurface/duplicateOverSurface.py | minoue/miMayaPlugins | 32 | 12799854 | <reponame>minoue/miMayaPlugins<gh_stars>10-100
#
# duplicaeOnSurface.py
#
#
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <<EMAIL>> wrote this file. As long as you retain this
# notice you can do whatever you want with this stuff. If w... | 2.25 | 2 |
measure_mate/migrations/0015_merge.py | niche-tester/measure-mate | 15 | 12799855 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-26 06:25
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('measure_mate', '0011_auto_20160225_1305'),
('measure_mate', '0014_auto_20160224_0207'),
]... | 1.375 | 1 |
vit/formatter/start_remaining.py | kinifwyne/vit | 179 | 12799856 | from vit.formatter.start import Start
class StartRemaining(Start):
def format_datetime(self, start, task):
return self.remaining(start)
| 2.09375 | 2 |
mpdshell.py | SirJson/mpdshell | 0 | 12799857 | <reponame>SirJson/mpdshell
#!/usr/bin/env python3
import argparse
import asyncio
from re import DEBUG
import selectors
import socket
import sys
import threading
import time
import selectors
from datetime import datetime
from pathlib import Path
from threading import Lock
from typing import List
from prompt_toolkit im... | 1.765625 | 2 |
FlaskApp/utils.py | robertavram/project5 | 7 | 12799858 | import random
import string
import other_info
import re
from dicttoxml import dicttoxml
def make_csrf_state(size):
''' Makes a CSRF state by randomly choosing uppercase letters and digits '''
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in xrange(size))
def valid_item_name(item_... | 2.921875 | 3 |
npde.py | marghetis/npde | 37 | 12799859 | import numpy as np
import tensorflow as tf
import tensorflow.contrib.distributions as tfd
from integrators import ODERK4, SDEEM
from kernels import OperatorKernel
from gpflow import transforms
from param import Param
float_type = tf.float64
jitter0 = 1e-6
class NPODE:
def __init__(self,Z0,U0,sn0,kern,jitter=jit... | 2.28125 | 2 |
python/raft/Leader.py | chenzhaoplus/vraft | 23 | 12799860 | <gh_stars>10-100
import time
from random import randrange
import grequests
from NodeState import NodeState
from client import Client
from cluster import HEART_BEAT_INTERVAL, ELECTION_TIMEOUT_MAX
import logging
from monitor import send_state_update, send_heartbeat
logging.basicConfig(format='%(asctime)s - %(levelname... | 2.359375 | 2 |
getDOBBoilerData.py | dtom90/pygotham_boiler_miner | 0 | 12799861 | import urllib.request
from bs4 import BeautifulSoup
def getDOBBoilerData( boroNum, houseNum, houseStreet ):
url = requestToDOBUrl( boroNum, houseNum, houseStreet )
soup = urlToSoup( url )
if hasDOBData( soup ):
return extractDOBDataFromSoup( soup )
else:
return "Invalid Query"
def requ... | 3.515625 | 4 |
srunner/drl_code/scenario_utils/kinetics.py | liuyuqi123/scenario_runner | 0 | 12799862 | """
Some methods for kenetics.s
"""
import carla
import numpy as np
import math
def get_speed(vehicle):
"""
Get speed consider only 2D velocity.
"""
vel = vehicle.get_velocity()
return math.sqrt(vel.x ** 2 + vel.y ** 2) # + vel.z ** 2)
def set_vehicle_speed(vehicle, speed: float):
"""
... | 3.9375 | 4 |
src/oci/adm/models/application_dependency_vulnerability_summary.py | pabs3/oci-python-sdk | 0 | 12799863 | <reponame>pabs3/oci-python-sdk<filename>src/oci/adm/models/application_dependency_vulnerability_summary.py
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.orac... | 2.25 | 2 |
scripts/typing-summary.py | AlexWaygood/typing | 1,145 | 12799864 | <gh_stars>1000+
#!/usr/bin/env python3
"""
Generate a summary of last week's issues tagged with "topic: feature".
The summary will include a list of new and changed issues and is sent each
Monday at 0200 CE(S)T to the typing-sig mailing list. Due to limitation
with GitHub Actions, the mail is sent from a private serv... | 2.84375 | 3 |
pi/ch08_rfid_read/SimpleMFRC522.py | simonmonk/hacking2 | 10 | 12799865 | import MFRC522
import RPi.GPIO as GPIO
class SimpleMFRC522:
READER = None;
TAG = { 'id' : None, 'text' : ''};
KEY = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
def __init__(self):
self.READER = MFRC522.MFRC522()
def read(self):
tag = self.read_no_block()
while not tag:
... | 2.8125 | 3 |
bigcode-fetcher/bigcode_fetcher/downloader.py | sourcery-ai-bot/bigcode-tools | 6 | 12799866 | <gh_stars>1-10
import os.path as path
from concurrent.futures import ThreadPoolExecutor
import subprocess
import logging
import json
from bigcode_fetcher.project import Project
def download_git_project(project, output_dir, full_fetch=False):
command = ["git", "clone"]
if not full_fetch:
command += ["... | 2.515625 | 3 |
main_v2.py | armsp/covid19-vis | 5 | 12799867 | import os
import glob
import json
import logging as lg
from pathlib import Path
from datetime import date, datetime
import yaml
import requests
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.dates import date2num, DateFormatter
import matplotlib.transforms ... | 1.929688 | 2 |
src/congram.py | marvintau/congram | 0 | 12799868 | <filename>src/congram.py
# -*- coding: utf-8 -*-
import os
import sys
import itertools
import numpy as np
from color_schemes import color_func
def get_term_size():
rows, columns = os.popen('stty size', 'r').read().split()
return int(rows), int(columns)
class Pos:
def __init__(self, row, col):
... | 3.09375 | 3 |
webui/chart.py | twmarshall/tbd | 0 | 12799869 | <reponame>twmarshall/tbd
import matplotlib
# prevents pyplot from trying to connect to x windowing
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
webui_root = "webui/"
points = []
for i in range(1, len(sys.argv)):
points.append(sys.argv[i])
plt.plot(points)
plt.ylabel('some numbers')
plt.savef... | 2.421875 | 2 |
5-1.py | xeno14/advent_of_code2018 | 0 | 12799870 | with open("input/5.txt") as f:
#with open("input/5.test") as f:
poly = f.read().strip()
def is_reactable(x,y):
return x.lower()==y.lower() and x.islower() != y.islower()
assert(not is_reactable("a", "a"))
assert(not is_reactable("a", "B"))
assert(is_reactable("a", "A"))
print(len(poly))
result = ""
for p in... | 3.53125 | 4 |
luizalabs/core/migrations/0011_auto_20190911_0550.py | LucasSRocha/django_rest_llabs | 0 | 12799871 | <gh_stars>0
# Generated by Django 2.1.12 on 2019-09-11 05:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20190910_1022'),
]
operations = [
migrations.AlterUniqueTogether(
name='product',
unique_toge... | 1.375 | 1 |
scripts/scraper.py | brainglobe/brainglobe-web | 1 | 12799872 | <reponame>brainglobe/brainglobe-web<filename>scripts/scraper.py
from loguru import logger
from rich import print
from rich.table import Table
from mdutils.mdutils import MdUtils
import semanticscholar as sch
from myterial import pink, blue_light
'''
Searches google scholar for papers using brainglobe's tools
''... | 2.515625 | 3 |
src/Sample_DataAnalysis/data_generator.py | techmentry/techmentry-python-bootcamp | 0 | 12799873 | import requests
from requests.compat import urljoin
import json
import os
import datetime
# https://www.covid19api.dev/#intro
# creating a static dictionary for all the month in the 3 letter format. as this is the only
# sure way of getting it correct without having to do a lot of date parsing.
months = {
1: "jan... | 3.25 | 3 |
src/gui.py | LambWolf777/Pathfinding | 0 | 12799874 | <filename>src/gui.py<gh_stars>0
""" This module handles the user interface (GUI) for the pathfinding visualizer.
It handles the function for clicking on buttons, using input buttons, displaying stats, popups and setting
start/end nodes
It also creates all buttons by the init_gui function
"""
from pickle import l... | 3.1875 | 3 |
src/examples/aircraft.py | pillmuncher/hornet | 0 | 12799875 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016 <NAME> <<EMAIL>>
__version__ = '0.2.5a'
__date__ = '2016-08-11'
__author__ = '<NAME> <<EMAIL>>'
__license__ = 'MIT'
import pprint
from hornet import *
from hornet.symbols import (
side, left, right, wing, segment, segments, section, sections,... | 2.515625 | 3 |
random/random_util_test.py | ljszalai/pyaster | 0 | 12799876 | import unittest
import random_util
class MyTestCase(unittest.TestCase):
def test_visualize_results(self):
column_width = 20
print("Generated id:".rjust(column_width, ' ') + random_util.generate_id())
print("Generated uuid:".rjust(column_width, ' ') + random_util.generate_uuid())
pr... | 2.90625 | 3 |
accounts/migrations/0001_initial.py | UniversitaDellaCalabria/IdM | 2 | 12799877 | <filename>accounts/migrations/0001_initial.py
# Generated by Django 2.1.4 on 2019-02-18 14:37
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 2.15625 | 2 |
utility/runner.py | theBraindonor/chicago-crime-arrests | 1 | 12799878 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A common training and evaluation runner to allow for easy and consistent model creation and evalutation
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2019, <NAME>"
__license__ = "Creative Commons Attribution-ShareAlike 4.0 Internationa... | 2.40625 | 2 |
almanak/file/__init__.py | clausjuhl/almanak | 0 | 12799879 | from almanak.file import compress, decompress, extract, fileinfo
__ALL__ = ['compress', 'decompress', 'extract', 'fileinfo'] | 1.34375 | 1 |
src/user_lib/connection_manager.py | crehmann/CO2Logger | 0 | 12799880 | from utime import ticks_ms
import network
import time
from umqtt.simple import MQTTClient
STATE_DISCONNECTED = 0
STATE_WLAN_CONNECTING = 1
STATE_WLAN_CONNECTED = 2
STATE_MQTT_CONNECTING = 3
STATE_MQTT_CONNECTED = 4
WLAN_CONNECTION_TIMEOUT_MS = 30 * 1000
MQTT_CONNECTION_TIMEOUT_MS ... | 2.9375 | 3 |
setup.py | karlcow/ymir | 1 | 12799881 | <reponame>karlcow/ymir<filename>setup.py<gh_stars>1-10
import distutils.core
distutils.core.setup(
name='Ymir',
author='<NAME>',
author_email='<EMAIL>',
version='0.1dev',
packages=['ymir', ],
license='LICENSE.txt',
url='http://pypi.python.org/pypi/Ymir/',
description='script to manage L... | 1.164063 | 1 |
snli/wae-stochastic/gl.py | yq-wen/probabilistic_nlg | 28 | 12799882 | <reponame>yq-wen/probabilistic_nlg
config_fingerprint = None
config = None
log_writer = None
isTrain = True | 0.855469 | 1 |
code/ch08-outbound-text-messages/db/__all_models.py | rcastleman/twilio-and-sendgrid-python-course | 29 | 12799883 | <reponame>rcastleman/twilio-and-sendgrid-python-course<gh_stars>10-100
# noinspection PyUnresolvedReferences
from db import order
# noinspection PyUnresolvedReferences
from db import user
| 1.015625 | 1 |
MyInfo/models.py | hhauer/myinfo | 2 | 12799884 | <reponame>hhauer/myinfo
from django.db import models
from localflavor.us.models import USStateField, PhoneNumberField
from MyInfo.validators import validate_psu_phone
import logging
logger = logging.getLogger(__name__)
# PSU Mailcode
class Mailcode(models.Model):
code = models.CharField(max_length=40)
descr... | 2.5 | 2 |
shapeutils/django/serializers.py | slavas62/shape-utils | 0 | 12799885 | <reponame>slavas62/shape-utils
from django.contrib.gis.geos import GEOSGeometry
from django.db import models
import json
import datetime
import decimal
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime.date):
return obj.isoformat()
if isinstance(ob... | 2.34375 | 2 |
c3po/__init__.py | yashchau1303/C-3PO | 34 | 12799886 | """__init__ module for project root."""
| 1.179688 | 1 |
app/helpers/pointdeletion.py | B-tronics/KinemAutomation | 0 | 12799887 | import cv2
import math
POINTS = []
class PointFilter:
def __init__(self, points):
self._points = points
def deletePoints(self, event, xCoordinate, yCoordinate, flags, params):
if event == cv2.EVENT_RBUTTONDOWN:
diff = list()
for point in self._points:
... | 2.890625 | 3 |
doc/examples/nonlinear_from_rest/submit_multiple_check_RB.py | snek5000/snek5000-cbox | 0 | 12799888 | import numpy as np
from fluiddyn.clusters.legi import Calcul2 as Cluster
from critical_Ra_RB import Ra_c_RB as Ra_c_RB_tests
prandtl = 1.0
dim = 2
dt_max = 0.005
end_time = 30
nb_procs = 10
nx = 8
order = 10
stretch_factor = 0.0
Ra_vert = 1750
x_periodicity = False
z_periodicity = False
cluster = Cluster()
clu... | 1.882813 | 2 |
cicada2/operator/daemon/types.py | herzo175/cicada-2 | 11 | 12799889 | <reponame>herzo175/cicada-2
from typing import Dict, List, TypedDict
class Dependency(TypedDict):
name: str
labels: Dict[str, str]
statuses: List[str]
class SetupConfig(TypedDict):
pvc: str
mountPath: str
remotePath: str
localPath: str
class Spec(TypedDict):
dependencies: List[Depe... | 2.140625 | 2 |
programs/foldtest_magic.py | yamamon75/PmagPy | 2 | 12799890 | #!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib
if matplotlib.get_backend() != "TKAgg":
matplotlib.use("TKAgg")
import pandas as pd
from matplotlib import pyplot as plt
import pmagpy.pmag as pmag
import pmagpy.pmagplotlib as pmagplotlib
from pmag_env import set_env
import operator
... | 2.515625 | 3 |
demo.py | solaaa/signal_processing_by_GPU | 0 | 12799891 | # coding=utf-8
import numpy as np
import reikna.cluda as cluda
from reikna.fft import FFT, FFTShift
import pyopencl.array as clarray
from pyopencl import clmath
from reikna.core import Computation, Transformation, Parameter, Annotation, Type
from reikna.algorithms import PureParallel
from matplotlib import cm
... | 2.140625 | 2 |
doc/source/EXAMPLES/allskyf25.py | kapteyn-astro/kapteyn | 3 | 12799892 | <gh_stars>1-10
from kapteyn import maputils
import numpy
from service import *
fignum = 25
fig = plt.figure(figsize=figsize)
frame = fig.add_axes(plotbox)
title = r"Polyconic projection (PCO). (Cal. fig.29)"
header = {'NAXIS' : 2, 'NAXIS1': 100, 'NAXIS2': 80,
'CTYPE1' : 'RA---PCO',
'CRVAL1' : 0.0,... | 2.328125 | 2 |
questionbank/comments/filters.py | SyafiqTermizi/questionbank | 1 | 12799893 | <gh_stars>1-10
import django_filters
from .models import QuestionComment, ExamComment
class QuestionCommentFilter(django_filters.FilterSet):
is_resolved = django_filters.BooleanFilter()
class Meta:
model = QuestionComment
fields = ('is_resolved',)
class ExamCommentFilter(django_filters.Fil... | 1.96875 | 2 |
botorch/test_functions/__init__.py | cnheider/botorch | 0 | 12799894 | <reponame>cnheider/botorch
#!/usr/bin/env python3
from .branin import neg_branin
from .eggholder import neg_eggholder
from .hartmann6 import neg_hartmann6
from .holder_table import neg_holder_table
from .michalewicz import neg_michalewicz
from .styblinski_tang import neg_styblinski_tang
__all__ = [
"neg_branin",... | 1.320313 | 1 |
bot/db/repos/HomeworkManager.py | WizzardHub/EcoleDirecteOrtBot | 0 | 12799895 | from bot.db.entities.Homework import Homework
class HomeworkManager:
def __init__(self, db):
self._db = db
def getAll(self):
cur = self._db.cursor()
cur.execute('SELECT * FROM Homework')
homeworks = []
for homework in cur.fetchall():
homeworks.append(Home... | 2.8125 | 3 |
dataconverter.py | zhang96/CSVToJSON | 1 | 12799896 | <gh_stars>1-10
# Simple Python program that converts CSV to JSON for my MongoDB project.
# - It converts all the csv files under the directory at once.
import csv
import json
import glob
for files in glob.glob("*.csv"):
csvfile = open(files, 'r')
jsonfile = open(files[:-4] + '.json', 'w')
reader = csv.read... | 3.609375 | 4 |
encrypt_decrypt_app/atbash_cipher_tests.py | Chika-Jinanwa/chikas-cipher | 0 | 12799897 | import unittest
from atbash_cipher import AtbashCipher
test = AtbashCipher() #instantiate test caesar cipher class
class AtbashCipherEncryptTests(unittest.TestCase):
def test_empty_string(self):
self.assertMultiLineEqual(test.encrypt(''), '')
def test_string_with_only_spaces(self):
self.asser... | 3.25 | 3 |
Pi-SMS.py | Femi123p/Pi-Sms | 1 | 12799898 | <filename>Pi-SMS.py
from firebase import firebase
import RPi.GPIO as GPIO
import plivo
from time import sleep # this lets us have a time delay (see line 15)
GPIO.setmode(GPIO.BCM) # set up BCM GPIO numbering
GPIO.setup(25, GPIO.IN) # set GPIO25 as input (button)
GPIO.setup(24, GPIO.OUT)
#pl... | 3.3125 | 3 |
dps/common.py | Kel0/django-parrallel-sessions | 0 | 12799899 | from typing import Protocol
class VEnvProtocol(Protocol):
path = None
def activate(self):
"""
Activate virtual environment
"""
class VEnvTypeProtocol(Protocol):
_manager = None
def validate(self, *args, **kwargs):
"""
Make sure that venv is exist
"""... | 2.671875 | 3 |
tests/fields/test_integer.py | Ennkua/wtforms | 1,197 | 12799900 | from tests.common import DummyPostData
from wtforms.fields import IntegerField
from wtforms.form import Form
class F(Form):
a = IntegerField()
b = IntegerField(default=48)
def test_integer_field():
form = F(DummyPostData(a=["v"], b=["-15"]))
assert form.a.data is None
assert form.a.raw_data == ... | 2.71875 | 3 |
modules/shellhelper.py | pilgun/app-run-and-log | 1 | 12799901 | <filename>modules/shellhelper.py
from loguru import logger
import subprocess
from modules import config
from modules.exceptions import AbsentPackageException, ErrorInstallingException, ErrorUninstallingException, NotEnoughSpaceException
import os
def install(new_apk_path):
cmd = '"{}" install -r "{}"'.format(con... | 2.234375 | 2 |
models/classification/train_on_flir.py | Lindronics/honours_project_dissertation | 2 | 12799902 | import os
import argparse
import numpy as np
import tensorflow as tf
import tensorflow.keras as K
from sklearn.metrics import classification_report
from dataset import FLIRDataset
def grid_search(train_labels: str,
test_labels: str,
output:str,
res:tuple=(120, 160)... | 2.609375 | 3 |
src/reader.py | DavidRivasPhD/mrse | 0 | 12799903 | """
Module to read the query and other inputs
"""
from Bio import Entrez
from filter import filter_selector
def inputnow():
"""
Reads the inputs' values
:return: query
"""
# the email must be the user's individual/personal email (NOT an institutional email or a default email
# as this could l... | 3.78125 | 4 |
jarbas_hive_mind/settings.py | flo-mic/HiveMind-core | 43 | 12799904 | <gh_stars>10-100
from os import makedirs
from os.path import isdir, join, expanduser
DATA_PATH = expanduser("~/jarbasHiveMind")
if not isdir(DATA_PATH):
makedirs(DATA_PATH)
CERTS_PATH = join(DATA_PATH, "certs")
if not isdir(CERTS_PATH):
makedirs(CERTS_PATH)
DB_PATH = join(DATA_PATH, "database")
if not isdi... | 1.867188 | 2 |
assignment4/merge.py | zhaoze1991/cs6200 | 1 | 12799905 | #!/usr/bin/env python
file1_name = 'a'
file2_name = 'titanic'
class Item(object):
"""tring for Item"""
def __init__(self):
super(Item, self).__init__()
l1 = open(file1_name, 'r').readlines()
l2 = open(file2_name, 'r').readlines()
res = open('res','w')
def run():
for i in range(len(l1)):
l... | 3.453125 | 3 |
kernal/FileSystem.py | FAWC-bupt/OS-Course-Design | 1 | 12799906 | <filename>kernal/FileSystem.py<gh_stars>1-10
"""
目录逻辑结构:树形
目录物理结构:连续形
TODO:磁盘外部碎片如何处理?
TODO:磁盘IO添加中断
"""
import math
from enum import Enum
from kernal import Tool
class FileOperation(Enum):
Read = 0
Write = 1
Create = 2
Rename = 3
Delete = 4
Redirect = 5
class FileAuthority(Enum):
Defau... | 2.40625 | 2 |
bin/karyon.py | Gabaldonlab/karyon | 0 | 12799907 | <reponame>Gabaldonlab/karyon
desc="""Karyon pipeline.
More info at: https://github.com/Gabaldonlab/karyon
"""
epilog="""Author: <NAME> (<EMAIL>) Worcester MA, 04/Nov/2021"""
import sys, os, re
import argparse
import psutil
import pysam
import pandas as pd
import string
import random
from spades_recipee import call_SPA... | 2.171875 | 2 |
setup.py | Johannes-Larsson/codeswapbot | 0 | 12799908 | <gh_stars>0
import sqlite3
db = sqlite3.connect('data.db')
c=db.cursor()
c.execute('create table users (id integer primary key, name text, partner text, recieve_date date, partnered_date date)')
db.commit()
db.close()
| 2.859375 | 3 |
misc/update_version.py | andyjgf/libcbor | 283 | 12799909 | import sys, re
from datetime import date
version = sys.argv[1]
release_date = date.today().strftime('%Y-%m-%d')
major, minor, patch = version.split('.')
def replace(file_path, pattern, replacement):
updated = re.sub(pattern, replacement, open(file_path).read())
with open(file_path, 'w') as f:
f.write... | 2.515625 | 3 |
OpenGLCffi/GL/EXT/SGIX/reference_plane.py | cydenix/OpenGLCffi | 0 | 12799910 | from OpenGLCffi.GL import params
@params(api='gl', prms=['equation'])
def glReferencePlaneSGIX(equation):
pass
| 1.59375 | 2 |
src/models/operation.py | takedarts/DenseResNet | 0 | 12799911 | from .modules import DropBlock, SEModule, SKConv2d, BlurPool2d, SplitAttentionModule
import torch.nn as nn
import collections
class BasicOperation(nn.Sequential):
def __init__(self, in_channels, out_channels, stride, groups, bottleneck,
normalization, activation, dropblock, **kwargs):
... | 2.4375 | 2 |
StkAutomation/IntegrationCertification/IntegrationCert.py | jgonzalesAGI/STKCodeExamples | 0 | 12799912 | # -*- coding: utf-8 -*-
"""
Created on Mon May 4 09:33:16 2020
@author: jvergere
Ideas: Something similar to the Iridium Constellation:
66 Sats
781 km (7159 semimajor axis)
86.4 inclination
6 Orbit planes 30 degrees apart
11 in each plane
"""
import datetime as dt
import numpy as np
import os
#N... | 2.5625 | 3 |
example_project/some_modules/third_modules/a55.py | Yuriy-Leonov/cython_imports_limit_issue | 0 | 12799913 | class A55:
pass
| 1.054688 | 1 |
retrograph/training/preprocessors.py | ai-nikolai/Retrograph-1 | 14 | 12799914 | #####################################################
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
# Copyright 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | 1.367188 | 1 |
load_data.py | penguin2048/StockIt | 32 | 12799915 | """
handle preprocessing and loading of data.
"""
import html
import os.path
import pandas as pd
import re
from nltk import word_tokenize, pos_tag
from nltk.corpus import stopwords, wordnet
from nltk.stem.wordnet import WordNetLemmatizer
class LoadData:
@classmethod
def preprocess_stocktwits_data(cls, fi... | 3.078125 | 3 |
tests/component/test_performance_log_dataframe.py | cswarth/whylogs | 603 | 12799916 | <filename>tests/component/test_performance_log_dataframe.py
import cProfile
import json
import os
import pstats
from logging import getLogger
from shutil import rmtree
from time import sleep
from typing import List
import pandas as pd
import pytest
from whylogs.app.config import SessionConfig, WriterConfig
from whylo... | 2.359375 | 2 |
thing/models/skillplan.py | Gillingham/evething | 33 | 12799917 | # ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of... | 1.460938 | 1 |
sorting-and-searching/shell-sort.py | rayruicai/coding-interview | 0 | 12799918 | import unittest
# time complexity O(n**2)
# space complexity O(1)
def shell_sort(arr):
n = len(arr)
gap = n//2
while gap >= 1:
for start in range(gap):
gap_insertion_sort(arr, start, gap)
gap = gap//2
return arr
def gap_insertion_sort(arr, start, gap):
n = len(arr)
... | 4.03125 | 4 |
tests/test_parameter.py | jlant/gagepy | 0 | 12799919 | # -*- coding: utf-8 -*-
"""
test_parameter
~~~~~~~~~~~~~~~
Tests for `gagepy.parameter` class
:copyright: 2015 by <NAME>, see AUTHORS
:license: United States Geological Survey (USGS), see LICENSE file
"""
import pytest
import os
import numpy as np
from datetime import datetime
from gagepy.parame... | 2.671875 | 3 |
Ex5.py | zelfg/Exercicios_LP_1B | 0 | 12799920 | algo = bool(input("Digite alguma coisa: "))
print("O valor {} é int?".format(algo).isnumeric()) | 3.53125 | 4 |
3/3_4_2_full_permutation_2.py | DingJunyao/aha-algorithms-py | 2 | 12799921 | <gh_stars>1-10
"""
全排列2
求1、2、3、4的全排列
"""
k = [1, 2, 3, 4]
for a in k:
for b in k:
for c in k:
for d in k:
if a != b and a != c and a != d and b != c and b != d and c != d:
print("%s%s%s%s" % (a, b, c, d))
| 3.265625 | 3 |
code/haitiwater/apps/consumers/views.py | exavince/HaitiWater | 4 | 12799922 | from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.template import loader
from haitiwater.settings import PROJECT_VERSION, PROJECT_NAME
from ..utils.get_data import *
@login_required(login_url='/login/')
def index(request):
template = loader.get_template('c... | 1.953125 | 2 |
pyrich/asset.py | choi-jiwoo/pyrich | 0 | 12799923 | from datetime import date
import pandas as pd
from pyrich.record import Record
class Asset(Record):
def __init__(self, table: str) -> None:
super().__init__(table)
def record_current_asset(self, current_asset: float) -> None:
table = 'current_asset'
query = (f'SELECT date FROM {table... | 3 | 3 |
lib/assets/Lib/browser/timer.py | s6007589/cafe-grader-web | 25 | 12799924 | <gh_stars>10-100
from browser import window
def wrap(func):
# Transforms a function f into another function that prints a
# traceback in case of exception
def f(*args, **kw):
try:
return func(*args, **kw)
except Exception as exc:
msg = '{0.info}\n{0.__name__... | 2.8125 | 3 |
update_daemon.py | dgnorth/drift-serverdaemon | 0 | 12799925 | import os, sys, shutil
import zipfile, subprocess
from serverdaemon.logsetup import setup_logging, logger, log_event
import boto3
from boto3.s3.transfer import S3Transfer, TransferConfig
REGION = "eu-west-1"
BUCKET_NAME = "directive-tiers.dg-api.com"
UE4_BUILDS_FOLDER = "ue4-builds"
INSTALL_FOLDER = r"c:\drift-serverd... | 1.984375 | 2 |
app/schemas/email_sub.py | javi-cortes/linkedon | 0 | 12799926 | from typing import Optional
from pydantic import BaseModel, EmailStr
class EmailSub(BaseModel):
email: EmailStr = None
# search patterns
salary_max: Optional[int] = 0
salary_min: Optional[int] = 0
class Config:
orm_mode = True
| 2.53125 | 3 |
goatools/ratio.py | ezequieljsosa/goatools | 0 | 12799927 | <reponame>ezequieljsosa/goatools
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__copyright__ = "Copyright (C) 2010-2016, <NAME> al., All rights reserved."
__author__ = "various"
from collections import defaultdict, Counter
def count_terms(geneset, assoc, obo_dag):
"""count the number of terms in the study group... | 2.625 | 3 |
old/cartpole_lib/cartpole_ppo.py | mmolnar0/sgillen_research | 0 | 12799928 | from baselines.common.cmd_util import make_mujoco_env
from baselines.common import tf_util as U
from baselines import logger
from baselines.ppo1 import pposgd_simple
from cartpole.cartpole_sim import cartpole_policy
def train(env_id, num_timesteps, seed=0):
U.make_session(num_cpu=1).__enter__()
def policy_f... | 1.945313 | 2 |
text_game_map_maker/forms.py | eriknyquist/text_map_builder_gui | 0 | 12799929 | from collections import OrderedDict
class AutoFormSettings(object):
def __init__(self):
if not hasattr(self, "spec"):
raise RuntimeError("%s instance has no 'spec' attribute"
% self.__class__.__name__)
for attrname in self.spec.keys():
setatt... | 2.96875 | 3 |
venv/Lib/site-packages/timingsutil/unittests/test_stopwatch.py | avim2809/CameraSiteBlocker | 0 | 12799930 | # encoding: utf-8
import time
import unittest
from timingsutil import Stopwatch
import logging_helper
logging = logging_helper.setup_logging()
class TestConfiguration(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_stopwatch(self):
stopwatch = Stopw... | 2.84375 | 3 |
model/items/apx_data.py | mlabru/visil | 0 | 12799931 | # -*- coding: utf-8 -*-
"""
apx_data
mantém as informações sobre o dicionário de procedimento de aproximação
revision 0.2 2015/nov mlabru
pep8 style conventions
revision 0.1 2014/nov mlabru
initial release (Linux/Python)
"""
# < imports >---------------------------------------------------------------------------... | 1.914063 | 2 |
autograd_manipulation/sim.py | dawsonc/a_tale_of_two_gradients | 2 | 12799932 | <reponame>dawsonc/a_tale_of_two_gradients<filename>autograd_manipulation/sim.py
"""Automatically-differentiable manipulation simulation engine using JAX"""
import jax.numpy as jnp
import jax
@jax.jit
def box_finger_signed_distance(box_pose, finger_pose, box_size):
"""Compute the signed distance from the box to th... | 2.53125 | 3 |
prodigy_backend/classes/migrations/0004_auto_20210118_0351.py | Savimaster/Prodigy | 4 | 12799933 | # Generated by Django 3.1.5 on 2021-01-18 03:51
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classes', '0003_auto_20210117_2058'),
]
operations = [
migrations.AlterField(
model_name='class',
... | 1.59375 | 2 |
tests/bugs/core_6108_test.py | reevespaul/firebird-qa | 0 | 12799934 | #coding:utf-8
#
# id: bugs.core_6108
# title: Regression: FB3 throws "Datatypes are not comparable in expression" in procedure parameters
# decription:
# Confirmed bug on 4.0.0.1567; 3.0.5.33160.
# Works fine on 4.0.0.1573; 3.0.x is still affected
# ... | 1.46875 | 1 |
test_sample_policies.py | donghun2018/adclick-simulator-v2 | 0 | 12799935 | <reponame>donghun2018/adclick-simulator-v2
"""
Sample bid policy testing script
for ORF418 Spring 2019 course
"""
import numpy as np
import pandas as pd
def simulator_setup_1day():
"""
This is a tool to set up a simulator and problem definition (state set, action set, and attribute set)
:return: simulat... | 1.929688 | 2 |
object_classification/batchbald_redux/batchbald.py | YilunZhou/optimal-active-learning | 10 | 12799936 | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_batchbald.ipynb (unless otherwise specified).
__all__ = ['compute_conditional_entropy', 'compute_entropy', 'CandidateBatch', 'get_batchbald_batch', 'get_bald_batch']
# Cell
from dataclasses import dataclass
from typing import List
import torch
import math
from tqdm.auto ... | 2.328125 | 2 |
extra/unused/check_ntis.py | whyjz/CARST | 10 | 12799937 | #/usr/bin/python
import re;
import subprocess;
cmd="\nfind . -name \"*nti21_cut.grd\"\n";
pipe=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE).stdout;
ntis=pipe.read().split();
pipe.close();
for nti in ntis:
jday=nti[nti.find(".A")+6:nti.find(".A")+9];
vdir=nti[nti.find("/")+1:nti.rfind("/")];
image="data... | 2.21875 | 2 |
src/__init__.py | btrnt/butternut_backend | 0 | 12799938 | <reponame>btrnt/butternut_backend<filename>src/__init__.py
from .gltr import *
| 1.179688 | 1 |
main.py | aishmittal/Real-time-Face-Recognition-based-Surveillance-System | 10 | 12799939 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import cv2
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import datetime
import string
import random
import shutil
from time import gmtime, strftime, sleep
import sqlite3
# import imageUpload.py for uploading captured... | 1.898438 | 2 |
server/brain/data-cleaner.py | souravchanda001/ratings-predicting-chrome-extension | 6 | 12799940 | import re
import csv
import pandas as pd
f= open("data-errors.txt",'r',encoding="utf8")
fc = f.read()
fcbRegex = re.compile(r"line(\s\d+)")
clear = re.findall(fcbRegex,fc)
for i in clear:
print("lines",i)
arr=clear
print("array is",arr)
count = 1
reader = csv.reader(open('amazon_reviews_us_Watches_v1_00.tsv'... | 3.046875 | 3 |
drmaa_futures/slave.py | ndevenish/drmaa_futures | 0 | 12799941 | # coding: utf-8
"""
Running a slave instance.
"""
import logging
import sys
import time
import traceback
import dill as pickle
import zmq
logger = logging.getLogger(__name__)
class ExceptionPicklingError(Exception):
"""Represent an error attempting to pickle the result of a task"""
class TaskSystemExit(Excepti... | 2.609375 | 3 |
trachours/web_ui.py | t-kenji/trac-hours-plugin | 0 | 12799942 | <gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 <NAME> <<EMAIL>>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import re
import calendar
import csv
import time
from StringIO import StringIO
from datetim... | 2.140625 | 2 |
unittest_reinvent/running_modes/transfer_learning_tests/test_link_invent_transfer_learning.py | lilleswing/Reinvent-1 | 183 | 12799943 | <gh_stars>100-1000
import shutil
import unittest
import os
from running_modes.configurations import TransferLearningLoggerConfig, GeneralConfigurationEnvelope
from running_modes.configurations.transfer_learning.link_invent_learning_rate_configuration import \
LinkInventLearningRateConfiguration
from running_modes.... | 1.835938 | 2 |
datasets/datasets.py | pengpeg/PFAN_MX | 0 | 12799944 | # -*- coding: utf-8 -*-
# @Time : 2020/2/12 15:47
# @Author : Chen
# @File : datasets.py
# @Software: PyCharm
import os, warnings
from mxnet.gluon.data import dataset, sampler
from mxnet import image
import numpy as np
class IdxSampler(sampler.Sampler):
"""Samples elements from [0, length) randomly without ... | 2.671875 | 3 |
dev/atlas/create_atlas/create_masks_csf_and_gm.py | valosekj/spinalcordtoolbox | 1 | 12799945 | <filename>dev/atlas/create_atlas/create_masks_csf_and_gm.py<gh_stars>1-10
#!/usr/bin/env python
# create masks of CSF and gray matter
# Author: <EMAIL>
# Created: 2014-12-06
# TODO: get GM
# TODO: add tract corresponding to the undefined values in WM atlas
import sys, io, os, glob
import numpy as np
import nibabel a... | 2.265625 | 2 |
train.py | rodolfo-mendes/diabetes-prediction-api | 0 | 12799946 | '''
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 compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | 1.585938 | 2 |
2017/day_03/day_03.py | viddrobnic/adventofcode | 0 | 12799947 | <gh_stars>0
from collections import defaultdict
number = int(input())
values = defaultdict(int)
values[(0, 0)] = 1
x, y = (0, 0)
direction = 0
directions = [(1, 0), (0, 1), (-1, 0), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
data = 1
second_result = 0
length = 1
step = 0
rotations = 0
first, second = False, False... | 3.25 | 3 |
script.py | Lets7512/Saved_WiFi_Passwords_Scraper_On_Windows | 0 | 12799948 | <reponame>Lets7512/Saved_WiFi_Passwords_Scraper_On_Windows
import os,platform,subprocess
from sys import exit
def main():
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
txt=subprocess.check_output('netsh wlan show profiles', shell=False, startupinfo=startu... | 2.609375 | 3 |
setup.py | zain/pyr | 1 | 12799949 | #!/usr/bin/env python
from setuptools import setup
setup(
name='pyr',
version='0.4.1',
description='A nicer REPL for Python.',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/zain/pyr',
packages=['pyr'],
install_requires=['pygments'],
scripts=['bin/pyr'],
)
| 0.964844 | 1 |
charis/primitives/locate_psflets.py | thaynecurrie/charis-dep | 0 | 12799950 | #!/usr/bin/env python
import copy
import glob
import logging
import os
import re
import numpy as np
from astropy.io import fits
from scipy import interpolate, ndimage, optimize, signal
try:
from charis.image import Image
except:
from image import Image
log = logging.getLogger('main')
class PSFLets:
""... | 2.203125 | 2 |