blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
f5cee80bbf728eb9732f98d12787ffc88d18abc6 | ccb0619aaae96cff38cb20c36cc80bbf72d19649 | Junga15/Keras2 | /keras2.0/keras38_dropout5_wine.py | Python | py | 1,263 | no_license | #실습,드롭아웃 적용
#DNN계열
#LSTM 구현과 비교 keras33_LSTM5_wine.py
'''
드롭아웃 전
RMSE: 2.1139790426970655
R2: -6.349878148831565
드롭아웃 후
RMSE: 0.6813611053792119
R2: 0.2030836677126333
'''
import numpy as np
from sklearn.datasets import load_wine
datasets=load_wine()
x=datasets. data
y=datasets.target
print(x)
print(y) #[0000..1... |
ed03599d494b683c63cb4541ec929a19c2dd75c6 | 09b111eaeaabc6cebf7848baaa3531fd27f5ac08 | tsv1/hiphip | /hiphip/http/response.py | Python | py | 1,229 | permissive | import json
from collections import OrderedDict
import requests
class Response(requests.Response):
def __repr__(self):
def _log_body(headers, body):
r = ""
request_content_type = headers.get("content-type", "text/plain").lower()
if request_content_type.startswith("tex... |
5c4be193b67fc217bc68cb9afd24ce2c1f22ffb7 | 9168c51c8e52bb0f05bd6138d11f06553f3a2261 | salgozino/AlgoTrading | /utils/menu.py | Python | py | 4,732 | no_license | #import getpass
import utils.PMY_REST as pmy
def select_tickers_pase():
"""
Menu for select the ticker to use for the PASE arbitrator.
The menu just can select tickers for ROFEX20 futures, or Dolars futures.
Take care selecting the futures, this function not check if exist information
in the d... |
d20c59bde18f6a2f489ed3a50cd889a2976c9c15 | 432aefeb8cbf6ae72d61be8ef96be12169f41acf | ds-forks/playconda | /playconda/wsgi.py | Python | py | 395 | no_license | """
WSGI config for playconda project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... |
b96ce6daa6282faf302758919e3c0216abbf8c0f | 71cfff5f36de85150e7b7147d1bdc0a7b6fe8a57 | aid402/uPyEsp | /wifi/wifi/smartconfig.py | Python | py | 1,585 | no_license | def smartconfig():
html = """<!DOCTYPE html>
<html>
<head> <title>ESP8266 Smart Config</title> </head>
<body> <h1 style="color:White;background-color:DodgerBlue">ESP8266 Smart Config</h1>
<table border="1"> <tr><th>SSID</th><th>channel</th><th>signal</th></tr> %s </table>
... |
28ca001caa0fd37d49a712d05dc679f9154cab2e | 1a9381ec9d13c6870da6875fc05db16c6b755cd0 | BiancaArantes28/Curso-Python | /app.py | Python | py | 1,378 | no_license | # -*- coding: UTF-8 -*-
def cadastrar(nomes):
print "Digite o nome"
nome = raw_input()
nomes.append(nome)
def listar(nomes):
print "Listando nomes:"
for nome in nomes:
print nome
def remover(nomes):
print "Qual nome vc deseja remover?"
nome = raw_input()
nomes.remove(nome)
def alterar(nomes):
print 'Qual... |
bb636911acfc52a02b62f8fe512dd93929098302 | 36234609d1a6359458e78159445eb84104b96cb1 | crowdbotics-apps/tuto-22970 | /backend/course/models.py | Python | py | 3,176 | no_license | from django.conf import settings
from django.db import models
class Enrollment(models.Model):
"Generated Model"
user = models.ForeignKey(
"users.User",
on_delete=models.CASCADE,
related_name="enrollment_user",
)
course = models.ForeignKey(
"course.Course",
on_de... |
1266ccc5402923cdc0ba1f7364383b74e2750c2e | 59abf5f321ac4378556c214af5542f5ab4bf7623 | hjffily/YOLOv3-ModelCompression-MultidatasetTraining-Multibackbone | /utils/datasets.py | Python | py | 32,132 | no_license | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.utils import xyxy2xywh, xywh2xyxy
img_format... |
318c29cb48c4dd1b96e7fc649c1387a539b4f679 | d23448f2aaf4c7152770dd3028aa4016b31178a3 | BrentHebert/CSCI3308Lab12 | /adapter.py | Python | py | 766 | no_license | import facade
# The Adaptor class should be implemented so that it has two methods that can be called by the running code.
# As you can see, it should contain a start function to start the computer, and a getComputerInfo function to get the information of the CPU, memory and hard disk.
# You can only use the Computer... |
549aab2eb2c67b88d6e294d344838183bec66e85 | 4199fb606792ffc9fbf3b867479c0242093ab7e7 | lzy2099/FastAPI_TEST | /two_1_response/response_model_4.py | Python | py | 993 | no_license | # -*- coding:utf-8 -*-
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
description: str = None
price: float
tax: float = 10.4
items = {
"foo": {"name": "Foo", "price": 50.2},
"bar": {"name": "Bar", "description": "The Bar fighters"... |
028d8810676b1c2c742196924c30ffefda3ad12c | d30c43d8f5e6ea72deab467bac25fb51a04ec2ea | chester5009/html_finder | /Settings.py | Python | py | 536 | no_license | # -*- coding: utf-8 -*-
class Settings():
def __init__(self):
self.settings=[]
pass
def setSettings(self,path):
file=open(path,'r')
for line in file:
oneTask=line.split('~')
oneTask[1]=oneTask[1].split(' ')
oneTask[2]=oneTask[2].split(' ')
... |
1623b81508e42f3abda7b6f78a37ad641203e605 | 44cec5c99bf719e1085353a60b4a862967c61492 | citrusbolt/CrystalDust | /alpha_builds.py | Python | py | 1,201 | no_license | #!/usr/bin/python3
from sys import argv
from pathlib import Path
from shlex import quote
import os, subprocess, zlib
def flips(params):
subprocess.call(["/mnt/c/Hacking/Tools/Flips/flips-linux"] + params)
def create_bps(name):
flips(["--create", "--bps", "/mnt/c/Hacking/Pokemon 3rd generation/Pokemon - Emera... |
fa045e1ef5730402ba234d1944d4d8741d06ef2a | 367ff74436f292e0ec236dd9ebe93bcce72130fe | mshakerinava/vae-lib | /examples/mnist/mnist_reader.py | Python | py | 565 | no_license | import os
import gzip
import numpy as np
def load_mnist(path, kind='train'):
"""Load MNIST data from `path`"""
labels_path = os.path.join(path, '%s-labels-idx1-ubyte.gz' % kind)
images_path = os.path.join(path, '%s-images-idx3-ubyte.gz' % kind)
with gzip.open(labels_path, 'rb') as lbpath:
lab... |
d27bcd9fa668cceabf2442c395425ab85d467b63 | 43c71500e102bb0661464f3f3d11056f629adfe1 | Rekt77/Algorithm | /programmers/programmers_menu.py | Python | py | 1,291 | no_license | from itertools import combinations
from collections import Counter
def solution(orders, course):
answer = []
for num in course:
order_combinations = []
for order in orders:
for temp in combinations(order, num):
order_combinations.append(''.join(sorted(temp)))
... |
6bb36be76ecc023d843fdaceb2a966264f97aa06 | 954803dbe18b6eed578132d568b726bd8299a45c | ahmadkilani/Microsoft-DAT210x | /Module-2/assignment3.py | Python | py | 1,262 | permissive | '''
author Lama Hamadeh
'''
import pandas as pd
# TODO: Load up the dataset
# Ensuring you set the appropriate header column names
#
# .. your code here ..
df=pd.read_csv('/Users/lamahamadeh/Downloads/Modules/DAT210x-master/Module2/Datasets/servo.data')
df.columns = ['motor', 'screw', 'pgain', 'vgain', 'class']
print... |
cc432d6bb0765e929dd30a70fc41d0cd3b5e92fa | 611418bd106fb422cab00a4b4906f998dfbf7d84 | matchodura/Messier-Object-Identification | /gui/model_creation.py | Python | py | 2,206 | no_license | from keras import Sequential
from keras import backend as K
from keras.optimizers import Adam
from keras.layers.normalization import BatchNormalization
from keras.utils import np_utils
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Conv2D, Activation, MaxPooling2D, Flatten, Dropout, D... |
3dbb55dedd6b406033077c26ccf83b441fb0ba20 | 3343c4df45b361e9c1e6073df955918d04d0bbfa | eisakeramati/Typist-Monkey | /typist_monkey.py | Python | py | 2,797 | no_license |
# coding: utf-8
# In[4]:
#calcScore returns a score that represents how much the 2 strings are alike
def calcScore(string, target):
score = 0
for i in range(len(target)):
if (target[i] == string[i]):
score = score + 1
else:
break
return score
# The method throu... |
ef409cd9fc5cff93c3ccdab16409011eb5bbab3e | 95d6670bbe02016deb061e5000e5bf88dcc34b90 | madgik/galaxy | /galaxyCodeBase/lib/galaxy/tools/parameters/validation.py | Python | py | 17,351 | permissive | """
Classes related to parameter validation.
"""
import logging
import re
from six import string_types
from galaxy import (
model,
util
)
log = logging.getLogger(__name__)
class Validator(object):
"""
A validator checks that a value meets some conditions OR raises ValueError
"""
requires_da... |
c5dbd8d4a18e9f9b5d65be717115baa95a8922c1 | 257a7c0f94583945bdfe945dad25313740230983 | Jeffmusa/De-o-clock | /cream/migrations/0012_auto_20190305_1542.py | Python | py | 417 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-05 12:42
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cream', '0011_auto_20190305_1540'),
]
operations = [
migrations.RenameField(
... |
09ecb218f49fff8914c95e652de161639d1bb1c1 | af353b638d1259e0447c8a5a293ca118c401cf88 | terrymyy-zz/Python | /numbers.py | Python | py | 3,237 | no_license | import math
import sys
def isPrime(x):
## function that returns whether or not the given number x is prime.
## This funtion returns boolean.
counter = 0
for i in range(1,x+1):
if x % i == 0:
counter += 1
if counter == 2 :
return True
else:
return False
def... |
556c3f33e26655dd547cb4a30455c5272d5f0f9e | 628808221c6c2e35f4871fc5675a8d91dbbc6d99 | acorg/gor4 | /gor4/gor4.py | Python | py | 2,656 | no_license | from ._gor4 import ffi, lib
from os.path import dirname, join
import gor4
_DATA_DIR = join(dirname(gor4.__file__), 'data')
_SEQUENCES = join(_DATA_DIR, 'new-gor4.seq')
_SECONDARY = join(_DATA_DIR, 'new-gor4.obs')
class GOR4(object):
"""
Interface with the C GOR IV code (see src/gor4).
@param sequenceFi... |
0438a14da8ace761112eed11b04b10a9bc7b2105 | a0f5ccc5e2b2705082b2daf40b0218eb1cf07a23 | a10networks/acos-client | /acos_client/tests/unit/v21/test_slb_service_group.py | Python | py | 8,554 | permissive | # Copyright 2014, Doug Wiegley, A10 Networks.
#
# 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 appli... |
86cb82c66501c7851120c4f5cd799877a8416d90 | f5f32b0f09754a814a57511fddcb5046bc7599a3 | leonex16/BestFruit | /administrador/views.py | Python | py | 2,977 | no_license | from administrador.functionSql import VIEW_CANTIDAD_OC_RECHAZADAS, VIEW_CANTIDAD_PUBLICACIONES_X_ESTADO, VIEW_COSTOS_X_MES, VIEW_EXTERNO_ORDENES_RECHAZADAS, VIEW_FRUTAS_DONADAS, VIEW_GANANCIAS_X_MES, VIEW_PEDIDOS, VIEW_CANTIDAD_SOLICITUDES_PENDIENTES, VIEW_PREFERENCIAS_BANCO, VIEW_PRODUCTORES_OFERTAS_APROBADAS, VIEW_VE... |
cc83cb9d7ef593d19e4760be42aba6220e9b0e3c | 7b5b8d2aa84be7e2d930f309825f37f843ead07f | theasad/mdrive-api | /apps/drive/migrations/0004_remove_file_file.py | Python | py | 308 | no_license | # Generated by Django 2.2.2 on 2019-06-25 20:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('drive', '0003_file'),
]
operations = [
migrations.RemoveField(
model_name='file',
name='file',
),
]
|
ef1dc7aeb56b94518cb48c88c58ed96c81c893a9 | eff59cf4a78d48d80883b253cd46f8ce88499d45 | foosel/cookiecutter | /setup.py | Python | py | 2,834 | permissive | #!/usr/bin/env python
import os
import platform
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = "1.2.1"
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
... |
fe5a00c9fc5e263a67c7897761c943ce87c169f3 | f69458657896e8afa6f9ee70d34262b425f4de16 | microsoftgraph/msgraph-sdk-python | /msgraph/generated/drives/item/items/item/workbook/functions/chi_sq_dist_r_t/chi_sq_dist_r_t_request_builder.py | Python | py | 4,248 | permissive | from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.base_request_builder import BaseRequestBuilder
from kiota_abstractions.get_path_parameters import get_path_parameters
from kiota_abstractions.method import Method
from kiota_abstractions.request_adapter import RequestAda... |
0e10cad63b73cd6620b188ef5bb43afe00dd39da | 01c23f69b1e00b603c20d5a021a017a7f7d50ce4 | cookyourweb/kc-Wordplease-Python-Django-Rest | /src/wordplease/urls.py | Python | py | 2,039 | no_license | """wordplease URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... |
8388fd56c006bf3b03812b6486065ab3b2826e3f | 356224010072786817a6cc22be9740d5da292e38 | alanmartinc/Taller-APIS-Django-con-Backbone.js-Libreria | /apps/usuarios/migrations/0001_initial.py | Python | py | 1,824 | no_license | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Usuario',
... |
71a97f8129d679557be8d26cf22a7e6df539c333 | 63412d688687f55c32b4af84c490d3d3df10ed41 | dudeov/UC1_python | /crap/t_xssh.py | Python | py | 515 | no_license | #!/usr/bin/env python3
from pexpect import pxssh
import re
import getpass
try:
s = pxssh.pxssh()
password = 'utDbTpgBiaCJmqKevwzY8E7L'
username = 'root'
hostname = '10.124.15.68'
s.login(hostname, username, password)
s.sendline('show version')
s.expect('found')
string = str(s.before + s... |
0e4e4c4cb52ffb48d920a79e672347d3b6ebf62a | 6f2e815fb080b26536c57dbae7abe20b14aa34e3 | webclinic017/usstock | /src/headline_writer.py | Python | py | 5,518 | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Tables required: mongoDB::ara::headline_hist, ara:record_hilo
Usage of:
# simulation run
headline_writer.py --lang=cn --extra_xs=nlookback=30 --debug
# OR onTheFly run
headline_writer.py --lang=cn --extra_xs='onTheFly=True;dirname="templates"'
# OR onTheFly run with s... |
f58b964b2039cbdaaada6b7dd4f2e31b3746444f | 97e0cc3d462039412027df0e01c484b7803783cf | Xtazzy23/Functions | /venv/Scripts/pip-script.py | Python | py | 410 | no_license | #!C:\Users\HP\PycharmProjects\Functions\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]... |
e22da77a88446efbd0fb1e719ff7f167dba1c905 | e5ef065b0258759d4f6834b55165e07c45b846a4 | astooke/rl-nn-benchmarks | /atari_cnn/settings.py | Python | py | 1,624 | no_license |
import numpy as np
IMG = (4, 84, 84)
OUTPUT = 10
INF_BATCH = 16
TR_BATCH = 128
TR_BATCHES = 50
DATA = TR_BATCH * TR_BATCHES
INF_BATCHES = DATA // INF_BATCH
REPEAT = 10
small_cnn_spec = dict(
num_filters=[16, 32],
filter_sizes=[8, 4],
strides=[4, 2],
hidden_sizes=[512],
)
large_cnn_spec = dict(
... |
552fd07b2f8098cad88048abfdd89eea7a4c537b | 958210f90747bca745e76722f835d9824db4c8e3 | bkeybmetz/b2gautomation | /gitutils.py | Python | py | 3,392 | no_license | from git import *
import json
from optparse import OptionParser
import os
import sys
def write_tags(repopath, tagfilepath):
taglist = tags(repopath)
f = open(tagfilepath, 'w')
f.write(json.dumps(taglist))
return taglist
def check_for_new_tags(repopath, tagfilepath):
try:
f = open(tagfilepa... |
73b4330d7bfa5ee75ae4630a2aafb2e61d560ebe | f37339aa192b05d65b1b5726999807df9e5d414c | pcgrosen/595g-files | /solutions/scheme-whata/solution.py | Python | py | 2,842 | no_license | import requests
REMOTE = "http://10.0.10.10:5003"
record = {"count": 0}
def char_is_above(table, column, index, guess, extra_criteria="1", offset=0):
injection = "' OR (SELECT count(*) FROM (SELECT * FROM {table} WHERE {extra_criteria} ORDER BY 1 LIMIT 1 OFFSET {offset}) WHERE unicode(substr({column}, {index}, 1... |
91e58ebac9f0b75fa455c2e829519f5f89a64e36 | 6ed07d3c4cb5b527ec3254d2c955b2805b9d02cf | qchiujunhao/cs562NLP | /hw1/part3.py | Python | py | 4,472 | no_license | import argparse
import nltk
from nltk.tokenize import word_tokenize
from nltk.probability import FreqDist
import collections
import matplotlib
import matplotlib.pyplot as plt
import operator
from nltk.corpus import stopwords
def compute_pmi(prob_unis, prob_bigrams, freqdist, threshold=0):
dict_freqdist = dict(freqd... |
a11ddf506e981b3b99b4d1e8c17c5cb34df456bd | 238e52a214f040372d7492977d04680b013f679c | productinfo/erpnext-shipping | /erpnext_shipping/config/desktop.py | Python | py | 281 | permissive | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "ERPNext Shipping",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("ERPNext Shipping")
}
]
|
a9aab3fa5c852505da95d856e246b54481d4627b | 7e3ae10ccbbeb8bdd9266bee336452caefa3a364 | Younglu125/A10_Networks | /a10API/a10API/app/scripts/axapisdk/python_sdk/ddos_tap/ddos_tap.py | Python | py | 7,782 | no_license | ########################################################################################################################
# File name: ddos_tap.py
# Copyright(C) 2007-2013, A10 Networks Inc. All rights reserved.
# Software for all A10 products contain trade secrets and confidential
# information of A10 Networks and its ... |
a17249172f37b918279b7895f4fb1a10a0017181 | a90499060f30385f6b4f5e65084e49835570e122 | explosionraptors/CSEE-4920 | /led.py | Python | py | 1,154 | no_license | #!/usr/bin/python
import RPi.GPIO as gpio
from time import sleep
# States
ERR=-1
OFF=0
RED=1
GREEN=2
BOTH=3
class Led(object):
def __init__(self, red_pin=4, green_pin=17):
self.red_pin = red_pin
self.green_pin = green_pin
self.ERR = ERR
self.OFF = OFF
self.RED = RED
self.GREEN = GREEN
self.BOTH = BOTH... |
f1b62b7820017ede00e057395518e93f68a1847f | 366e05c00280d724c49c29f6b3bc6122a9f940a3 | jbgitmoney/ssense-accountCreator | /ssenseAcc.py | Python | py | 2,009 | no_license | ## ssense account creator by @donjawn(s)
import requests
from random import getrandbits
import time
from datetime import datetime
datetime.now().strftime('%H:%M:%S') # time
url = 'https://www.ssense.com/en-us/account/register'
text_file = open("Accounts.txt", "w")
headers = {'User-Agent':
'Mozilla/5.0 (M... |
97747143b04e3abbc1af1b81fa5654b4b1997ede | 9bf1e0103d3e350e664e5efc1581b8781e7b15b6 | tiagojc/interviews_codes | /arrays/left_rotation.py | Python | py | 1,761 | no_license | # Check out the resources on the page's right side to learn more about arrays. The video tutorial is by Gayle Laakmann
# McDowell, author of the best-selling interview book Cracking the Coding Interview.
# A left rotation operation on an array shifts each of the array's elements unit to the left. For example, if left... |
4d77750c95c106befada2234bf73c61240fb58f7 | 150ed6e01e416d2bd765ff2357b800b165ae320f | arielgwapo/geniust | /geniust/bot.py | Python | py | 25,683 | permissive | import logging
import traceback
import warnings
from typing import Any, Dict
import lyricsgenius as lg
import tekore as tk
from notifiers.logging import NotificationHandler
from requests.exceptions import HTTPError
from telegram import InlineKeyboardButton as IButton
from telegram import InlineKeyboardMarkup as IBKeyb... |
0996c31b3d18a94a372f4068e0a35d5c1c7590ef | 8c28acd18201d50c9e50adc6ce785487c54e1eea | quater/freenas-9.2-xen | /gui/plugins/migrations/0004_auto__add_pluginsmountpoints.py | Python | py | 2,461 | no_license | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PluginsMountPoints'
db.create_table('plugins_pluginsmountpoints', (
('id', sel... |
8a724720dabe3c15a02a9d9af3c13d6d85de4b4c | 25d0f23744579363c60f08dd4ac4336cc44a9096 | datalets/public-health-ch | /publichealth/home/migrations/0008_auto_20170313_1755.py | Python | py | 414 | permissive | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-13 16:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0007_articlepage_date'),
]
operations = [
migrations.AlterModelOptions(
... |
66a0777a7386b34df4b8a27db99d830140e1b9e6 | b1d726637d6a9ccf1d28fdadc4f2b0cc31d35f13 | sabbir1021/django-account-with-email-confirmation | /accounts/urls.py | Python | py | 1,708 | no_license | from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy
app_name = "accounts"
urlpatterns = [
path('', views.home, name='home'),
path('login/',auth_views.LoginView.as_view(template_name='accounts/login.html'), name='login'),
... |
7da379c81471f54c1211475df8b030e8b0af7eb5 | fc9888ed3e03dce70b98d69a6be8c8d6947122eb | JessyX001/equipments_manage | /equipments/manage.py | Python | py | 955 | no_license | #!/usr/bin/env python
import os
import sys
# //sys.setdefaultencoding('utf8')
import logging
logging.debug('debug message')
logging.info('info message')
logging.warning('warning message')
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "equipments.settings")
try:
from djang... |
5aaf8596a582d44d0bad3f71e36314016212eae7 | 93f45491f1efb3a991fafa41d65936684f096416 | wangtiancai/ActionRecognition | /ExtractData/Detection.py | Python | py | 1,692 | no_license | import cv2
import imutils
import numpy as np
import sys
sys.path.insert(0, '../pose_estimation/')
from estimator import TfPoseEstimator
from networks import get_graph_path, model_wh
needed_elements = np.arange(0,14,1)
class Detector:
def __init__(self):
model = 'mobilenet_thin'
w, h = model_wh('4... |
fddbfff71689aa13babac28a0027f24577c2f067 | c902affad1f62acbd19f329c0f069af9d79df978 | Pandinosaurus/PSVH-3d-reconstruction | /Refinement_utils.py | Python | py | 23,859 | permissive | import numpy as np
import tensorflow as tf
import os
import voxel
from binvox_rw import Voxels
import time
from math import cos
from math import sin
from math import pi
from math import sqrt
voxel_size = 32
img_h = 128
img_w = 128
vector_channel = 1024
id_x = None
id_y = None
def pre_process()... |
0754d942cf0c15ad24dbd7d18dd8c4b1750fe908 | dfed4f32ff1fb4b97ae174f1c2474b2f052565ea | nfonseca/pyvmomi-community-samples | /samples/update_esxi_advanced_settings.py | Python | py | 4,221 | permissive | #!/usr/bin/env python
# William Lam
# www.virtuallyghetto.com
"""
vSphere Python SDK program for updating ESXi Advanced Settings
Usage:
python update_esxi_advanced_settings.py -s 192.168.1.200 \
-u 'administrator@vsphere.local' \
-p VMware1! -c VSAN-Cluster -k VSAN.ClomRepairDelay -v 120
"""
import argpa... |
1a6a0cbc54b993f8a657af32d362afbf561c0e1e | b84e2e2943e2db33b92f6742b7020a44973ab2ff | cottjr/piMegaSPI | /piSPImaster/piSPImaster.py | Python | py | 12,905 | no_license | # PiSPImaster.py
# https://learn.sparkfun.com/tutorials/raspberry-pi-spi-and-i2c-tutorial/all
import sys
import time
import spidev # https://github.com/doceme/py-spidev
# import RPi.GPIO as GPIO # https://learn.sparkfun.com/tutorials/raspberry-gpio/python-rpigpio-api
try:
import RPi.GPIO as GPIO
except Ru... |
a24079109b4f318429fd58fae29d3f5ac28b2634 | cbff94f46bb718b308c52414211cc118531f42cf | kwankong-git/luci-py | /appengine/swarming/proto/api/swarming_prpc_pb2.py | Python | py | 46,526 | permissive | # Generated by the pRPC protocol buffer compiler plugin. DO NOT EDIT!
# source: proto/api/swarming.proto
import base64
import zlib
from google.protobuf import descriptor_pb2
# Includes description of the proto/api/swarming.proto and all of its transitive
# dependencies. Includes source code info.
FILE_DESCRIPTOR_SE... |
ec155c46d283ec2815e516a164da09f3f2282cf4 | 550ef2270b97c7617f9ded04ab3677a8c7d0964c | sweetcczhang/docker-dashboard | /harbor/__init__.py | Python | py | 683 | no_license | #!/usr/local/miniconda2/bin/python
# _*_ coding:utf-8 _*_
"""
# @Time : 2018/7/21 15:59
# @Author : 张城城
"""
import pbr.version
from harbor import api_versions
__version__ = pbr.version.VersionInfo('python-harborclient').version_string()
API_MIN_VERSION = api_versions.APIVersion("2.0")
# The max version should be t... |
b6608d703dcec015a67332c9b24a504b44cfe7d5 | 78d033fda026230a794075c6f8eadf870c8a44fe | walaro/ais | /exhibitors/migrations/0015_exhibitor_transport_to_fair_type.py | Python | py | 713 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-11 22:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exhibitors', '0014_exhibitor_other_information_about_the_stand'),
]
operations = [
... |
73371850364ec556f484dd24620c0119349fe88a | 942525a276cf9f4c8f492bf399e2f4a7677c18d3 | ksrntheja/08-Python-Core | /venv/operators/01arithmetic/04ArithmeticOperatorsFloat.py | Python | py | 375 | no_license | a = 10.5
b = 2
print('a = ', a)
print('b = ', b)
print('a + b = ', a + b)
print('a - b = ', a - b)
print('a * b = ', a * b)
print('a / b = ', a / b)
print('a // b = ', a // b)
print('a % b = ', a % b)
print('a ** b = ', a ** b)
# a = 10.5
# b = 2
# a + b = 12.5
# a - b = 8.5
# a * b = 21.0
# a / b = 5... |
8c6ad20211f6fecf23f2b206378c33aab22ebc5d | 6aacb35f70feeb2fb8a8752adfc993dfc92e4a71 | keesterbrugge/probability | /tensorflow_probability/python/internal/test_util.py | Python | py | 33,686 | permissive | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
ea203e86c89e7b35dd828b3c6413a2e4c52470de | 822857c084d78ebc6eef2477ecb9010106202f41 | learning888/Credit-Risk-Modeling | /tseries_processing.py | Python | py | 7,559 | no_license | """
Created on Fri Sep 6 10:37:52 2019
@author: jcondori
"""
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncoder
import pandas as pd
from statsmodels.tsa.stattools import adfuller
from statsmodels.stats.diagnostic import acorr_breusch_godfrey
from statsmodels.graphics.gofpl... |
93de42fe86d1cbc7d07770606d9d09ab1ddf8154 | fa938cf03ee49773512de55de57dd2a3fc0f51dc | GroupCloudberry/CS-1830-Development | /src/story_screen_demo.py | Python | py | 3,199 | no_license | from story_screen import StoryScreen, StoryPage
try:
import simplegui
except ImportError:
import simpleguitk as simplegui
class StoryScreenDemo:
WIDTH = 800
HEIGHT = 600
def __init__(self):
self.frame = simplegui.create_frame("BerryDrive (CS1830 Group Cloudberry)", StoryScreenDemo.WIDTH... |
969fff287b4b00d15e1309ee4fb0a8c696ae8706 | 3b7c2378457b6fc6f2c517242209db7507153fa1 | ns96/ShopkinsSense | /draw_match.py | Python | py | 1,706 | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 12 13:20:24 2017
A nice function for drawing the matches found.
caode taken from stack overflow
@author: nathan
"""
import numpy as np
import cv2
def drawMatches(img1, kp1, img2, kp2, matches):
# Create a new output image that concatenates the two images together... |
118113c9908c561ef8bc743600a19a92d98fdf85 | 8dac0c703022562f775eb42a1273637b47c62e80 | evennia/evennia | /evennia/game_template/server/conf/lockfuncs.py | Python | py | 1,065 | permissive | """
Lockfuncs
Lock functions are functions available when defining lock strings,
which in turn limits access to various game systems.
All functions defined globally in this module are assumed to be
available for use in lockstrings to determine access. See the
Evennia documentation for more info on locks.
A lock fun... |
7d95317d50f7a6aff4c5f54db95d07c637a3f486 | 66d3b6f1f9bdc18db9b84906971e7fd2da4beb79 | ashwingonsalves/EchaloASuerte | /tests/mongo/sanity_test.py | Python | py | 1,266 | no_license | from django.test import TestCase
from server.mongodb.driver import *
import django
class SanityMongo(TestCase):
""" Basic sanity test for mongodb driver"""
def setUp(self):
django.setup()
self._driver = MongoDriver.instance()
self.dummy_doc = {"test-id": "SINGLE TEST ID"}
def con... |
cdca3fe4a9c56c7aa1592d3f0121c2ec2e567f52 | 4637b4d225a8679a748797a3baf2730a2f3b7832 | Eric2Hamel/Neuraxle | /neuraxle/plotting.py | Python | py | 3,762 | permissive | """
Notebook matplotlib plotting functions
================================================
Utility function for plotting in notebooks.
..
Note: some of the code in the present code block is derived from another project licensed under The MIT License (MIT),
Copyright (c) 2017 Vooban Inc. For the full informat... |
58c51ebbf13af5df341182ab82707957d0c36b84 | 58d29714e16f26ca164d132285887ab8993c5909 | ivanilla/oink | /V1PER/bb.py | Python | py | 1,242 | no_license | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
user_search = input('Which item to search on Best Buy?')
PATH ... |
061bafb2fd6061a51d71f3b7cf0aa49148981ec2 | 52f2404bf5f411fd3b89a3d00ec3a1f6f37ec7dc | caitlinwhiteley/pointsonasphere | /points_on_a_sphere_genetic_algorithm.py | Python | py | 9,585 | no_license | # python code to compute points on a sphere using genetic algoirthm
# uses a method of steepest descent
import numpy as np
import random
import time
starttime = time.time()
# project one or all points to the sphere
def proj(x): #called within relax function
lenx = len(x)
for i in range(0,lenx):
norm... |
2a082ea946f8e0a633798d1cee47c761b86bc3b0 | 497c09e70de0d58f664aada994d8493888534371 | NHopewell/django-fans | /django_project/blog/migrations/0002_comment.py | Python | py | 992 | no_license | # Generated by Django 3.1 on 2020-10-04 22:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... |
d8538a037d2ccd5f64700eaf4d19c0ecc240ebba | 04479ce941962f9112a2261471f15042c5826838 | nikregrado/rocklab_test | /board_app/models.py | Python | py | 2,316 | no_license | from django.db import models
from accounts.models import UserProfile as User
from django.utils.html import mark_safe
from markdown import markdown
import math
# Create your models here.
class Board(models.Model):
name = models.CharField(max_length=30, unique=True)
description = models.CharField(max_length=1... |
186a88978d1c8eff7cdcd920f6d2c10e771028da | 23abfa8b3fca145ed309441c39bf29fca1f97320 | mwaskom/pandas | /pandas/core/computation/expr.py | Python | py | 26,694 | permissive | """:func:`~pandas.eval` parsers
"""
import ast
import tokenize
from functools import partial
import numpy as np
import pandas as pd
from pandas import compat
from pandas.compat import StringIO, lmap, zip, reduce, string_types
from pandas.core.base import StringMixin
from pandas.core import common as com
import panda... |
d09832c773b8e382f26b7f4c7528600b03cd482c | a4230ba8480456f3268fdbc7891ae33d88999f61 | biomal/HCPT | /Section.py | Python | py | 981 | no_license | from Attribute import Attribute
import sys
class Section:
def __init__(self,name):
self.name = name
self.attributes = {}
def addAttribute(self,name,value,category):
attribute = Attribute(name,value,category)
self.attributes[name] = attribute
def getAttributeValue(self,name):
return self.attributes[name]
... |
61f63f4535d6404fa0020fcdcb94766154289983 | 72358468b51b64567185399db2770bd0dc83015a | PROGRAMMINinGPYTHON/minilogia | /OIJ_olimpiada_konkurs/warsztaty_OIJ/deszczyk.py | Python | py | 799 | no_license |
print("a")
def deszczyk():
a = input()
a = a.split()
for i in range(len(a)):
a[i] = int(a[i])
liczba_dni = a[0]
liczba_miast = a[1]
liczba_zapytan = a[2]
opisy_dni = []
for j in range(liczba_dni):
opisy_dni.append(input())
print(opisy_dni)
for k in range(len(opi... |
c94a74dfe3a97b3f66013fa56060bd99339edb0c | a5cd34a679e94ae071d9f8cf9f958b5e6a946d89 | wangdong0306/yolov4_GUI | /MainWindow.py | Python | py | 27,417 | no_license | import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from gui.picture_gui import runimage
from gui.cameraset import Camera
import os
from gui.yolo_gui_vedio import YOLO
from PIL import Image
import numpy as np
import cv2
import time
import tensorflow as tf
import threading
impor... |
d083965480c8d3a0bfe3495c848427f9dd186840 | 957f6c65fc3122134cd0b4e6da52caaae238d2a7 | EuanDodds/tango_with_django_project | /rango/tests.py | Python | py | 1,508 | no_license | from django.test import TestCase
from rango.models import Category
from django.urls import reverse
# Create your tests here.
def add_cat(name, views, likes):
c = Category.objects.get_or_create(name=name)[0]
c.views = views
c.likes = likes
c.save()
return c
class CategoryMethodTests(TestCase):
... |
e599b78ccc78bb7369036ceba49ed4bfbf95e75b | 69f939fbf83fb6d2d7fcd4dfea9bf84ea526e647 | mikhail-paramon/Django_project | /learning_logs/migrations/0003_topic_owner.py | Python | py | 618 | no_license | # Generated by Django 3.0.4 on 2020-03-20 02:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('learning_logs', '0002_en... |
3a254f1a944e7f78850b1e61e215c7c1ff3fb17a | 68bc1a288e0e7fc776648ccaa100578884f3a6e8 | jykim4024/nms | /src/views/auth_views.py | Python | py | 2,764 | no_license | from flask import Blueprint, url_for, render_template, flash, request, session, g
from werkzeug.security import generate_password_hash, check_password_hash
from werkzeug.utils import redirect
from .. import db
from ..forms import UserCreateForm, UserLoginForm
from ..models import User
import functools
bp = Blueprint... |
1218bb7d8067f1be95dc3c43b58f4a557fd439e7 | e10f1a2318dec742306f01b1093f71c366793859 | zhangmeishan/BiaffineParser-Dynet | /driver/train.py | Python | py | 6,455 | no_license | import sys
sys.path.extend(["../../","../","./"])
from driver.graph import *
from data.dataloader import *
from driver.config import *
import time
import numpy as np
import dynet as dy
import pickle
def train(data, dev_data, test_data, graph, vocab, config):
pc = graph.parameter_collection
trainer = dy.AdamTr... |
d769761936ff74bde78b4a702038b8887b7161a4 | e006e4b788ed0383459bd8ab1c22f4f005181f82 | andrewgodwin/airport-mogul | /Polygon/IO.py | Python | py | 12,249 | no_license | # -*- coding: utf-8 -*-
# $Id: Polygon.py,v 1.27 2006/04/19 09:41:12 joerg Exp $
"""
This module provides functions for reading and writing Polygons in different
formats.
The following write-methods will accept different argument types for the
output. If ofile is None, the method will create and return a Str... |
46c9d488a61004b4ad1183203bc5fe4d389bcb1d | d32f5da31dd1af64226161625a028e4c2a3e08ad | bhaveshAn/gI-task | /app/__init__.py | Python | py | 1,795 | no_license | import os.path
from envparse import env
from flask import Flask, json, make_response
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_rest_jsonapi.exceptions import JsonApiException
from flask_rest_jsonapi.errors import jsonapi_errors
from flask_cors import CORS
from app.mo... |
327206eed2e4dd4005f949677c0a20f5ae5ee0ef | 3cc0ac006a327e42790d27aa34c07041f657329a | majorgreys/opentelemetry-python | /ext/opentelemetry-ext-http-requests/tests/test_requests_integration.py | Python | py | 6,969 | permissive | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
6ab57e2f24882eece3deb358b639a2e9fbdda38c | 700ed9175aa674a306ffd7f198e9621b70f9c8fa | mdobrychlop/ebacteria | /main.py | Python | py | 2,733 | no_license | from pygame.locals import *
from pygame import gfxdraw
from Bacterium import Bacterium
from Events import EventControl
from Hud import InfoBox, ScreenText
import Config
import math
import pygame
import random
import sys
def generate_cells():
"""
Generates bacteria objects for all bacteria.
"""
bacteri... |
03d8620f2932fa05dc7f7e1e4076b48f35db4314 | 5410f4ccd381d38b77f7a8a7258fbeae7f8ba611 | RurkaJaroslaw/IO_Project | /IO_project/venv/Lib/site-packages/pip-9.0.1-py3.6.egg/pip/_vendor/requests/packages/urllib3/util/retry.py | Python | py | 10,655 | no_license | from __future__ import absolute_import
import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
E... |
e1b27b0dd50cb651dc3e2d099cb0b09e18a83a3e | a042820af7880393bd5de3c7913091e060e78613 | scality/Zenko | /docs/docsource/conf.py | Python | py | 12,529 | permissive | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
import os
import pathlib
import sys
from sphinx.highlighting import PygmentsBridge
# -- Path setup -----... |
37c32bcf04e1cfabb23482e3fb924f32d60d0070 | 5a77888c70cc174d43928aa3b997f3c0ddab47d6 | Vitali12/stochastic | /stochastic/diffusion/vasicek.py | Python | py | 1,294 | permissive | """Vasicek process."""
from stochastic.diffusion.ornstein_uhlenbeck import OrnsteinUhlenbeckProcess
class VasicekProcess(OrnsteinUhlenbeckProcess):
r"""Vasicek process.
A model for instantaneous interest rate.
.. image:: _static/vasicek_process.png
:scale: 50%
The Vasicek process :math:`X_t... |
e513c2597066e2d2277e14fbd8ec15e1e6215a28 | d76891c792a7eb3701f13ecbe31e4f83402f655d | One-punch24/Malware_Markov_Image-ViT | /benignware/benign.py | Python | py | 595 | no_license | import os
import shutil
source = "C:\\"
dist = "binary"
cnt = 1
for root, dirs, files in os.walk(source):
for file in files:
if file.endswith(".exe") or file.endswith(".dll"):
q = os.path.join(root, file)
if os.path.exists(q) and os.path.getsize(q) > 100*1024 and os.path.getsi... |
d2ed7bb539d64b70613b46581482ea88c8482568 | 7f920a33d6d0b5d5da17ea444de6b43f438fb82f | rushioda/PIXELVALID_athena | /athena/TileCalorimeter/TileTrackingGeometry/python/ConfiguredTileVolumeBuilder.py | Python | py | 1,664 | no_license | # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
######################################################
# ConfiguredTileVolumeBuilder module
#
# it inherits from TileVolumeBuilder and performs
# standard configuration
#
######################################################
# import the Ex... |
c797eebf4d43b11c6fc9d71f2f176c9ad1e283c1 | c10a52003bb62eeb97f012ce85306118cdd1dcd6 | masiro97/kakao-chatbot | /test.py | Python | py | 1,993 | no_license | import requests
from bs4 import BeautifulSoup
import random
import re
# url = "https://movie.naver.com/movie/running/current.nhn"
# res = requests.get(url).text
# doc = BeautifulSoup(res, "html.parser")
# pick = doc.select("#content > div.article > div > div.lst_wrap > ul > li > dl > dt > a")
# for movieNm in pick:
#... |
d4b210a75016b3aad3657c77a01f623822835f07 | 939bcc55fe68c476ee297ad70e13a02c393ededd | celine-yeh/celineyeh | /celineyeh/util.py | Python | py | 310 | no_license | class Proxy:
def __init__(self, factory):
self._factory = factory
self._target = None
def __getattr__(self, attr):
if not self._target:
self._target = self._factory()
return getattr(self._target, attr)
def lazy_service(factory):
return Proxy(factory) |
f82b459fec11250c3aa1c72923ea19139a1824a1 | dba0c03650c2f6e3d595f68fee8ba4205686cfbe | daoran/multimaster_fkie | /fkie_node_manager/src/fkie_node_manager/common.py | Python | py | 5,421 | permissive | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# 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 source code mus... |
2594668db85fc2998990d960c6296de57a2034a4 | da0cee4ea86a9d03f90d8aa611c7e09a8e116a6b | staminazhu/CDMATH | /tests/validation/scripts/TransportEquationUpwind/TransportEquationUpwind.py | Python | py | 15,031 | no_license | #!/usr/bin/env python
# -*-coding:utf-8 -*
from math import sin, cos, pi, sqrt
import time, json
import cdmath
import PV_routines
import VTK_routines
test_desc={}
precision=1e-5
def initial_conditions_transport_equation(my_mesh):
test_desc["Initial_data"]="Shock"
dim = my_mesh.getMeshDimension()
nbC... |
6fda660a6c18aca0978df9cbc0e68c84c415c72d | 7df884ebef568f264a60bba47fcd22d27da7824d | rafaelperazzo/programacao-web | /moodledata/vpl_data/428/usersdata/283/107248/submittedfiles/jogoDaVelha.py | Python | py | 14,007 | no_license | # -*- coding: utf-8 -*-
# COLOQUE SEU PROGRAMA A PARTIR DAQUI
from jogoDaVelha_BIB import verificar_vitoria
from jogoDaVelha_BIB import sorteio
from jogoDaVelha_BIB import sorteio2
from jogoDaVelha_BIB import maquinainteligente
from jogoDaVelha_BIB import maquinainteligente2
from jogoDaVelha_BIB import mostrar_t... |
9c4db02d9a758e270f6c786619080da72fca6874 | 511fa0d9788624af0aa9603d50a30672d7e84b0a | julystone/keyou | /package_401/common/R_r_config.py | Python | py | 472 | no_license | # @File : R_r_config.py.py
# @Author : July401
# @Date : 2019/6/3
# @Email : july401@qq.com
import configparser
from package_401.common.R_r_os import CONF_DIR
config_path = CONF_DIR
class ConfigData(configparser.ConfigParser):
def __init__(self, choice=0):
super().__init__()
if cho... |
f9f688501ecf0ab08a2ec0585d4c39fccf434224 | 8e1c0598c1ae1b5a05c706e99b126542b9f5eae5 | psawaya/addon-sdk | /python-lib/cuddlefish/manifest.py | Python | py | 29,347 | no_license |
import os, sys, re, hashlib
import simplejson as json
SEP = os.path.sep
def js_zipname(packagename, modulename):
return "%s-lib/%s.js" % (packagename, modulename)
def docs_zipname(packagename, modulename):
return "%s-docs/%s.md" % (packagename, modulename)
def datamap_zipname(packagename):
return "%s-data... |
7e43565d43e82df7a09edeac0fc56971aba3d3a7 | bdf9ff46f10ed640601dd02dab1c1d35bbf93d35 | MudimukkuSreenath/python | /database.py | Python | py | 455 | no_license | import pyodbc
conn=pyodbc.connect('Driver={SQL server};Server=DESKTOP-T66VEKU\SREENATHSQL;Database=master;')
cursor=conn.cursor()
cursor.execute("select * from dbo.emp")
while 1:
row=cursor.fetchone()
if not row:
break
print(row .ename)
cursor.execute("select * from dbo.emp")
for row in cu... |
8a4ae595054918f7b4844d7f973dc0c8beb85c84 | 39df4bb82e4962c46db8dac98810700ac6906e29 | TrihstonMadden/Python | /tproject/tms.py | Python | py | 302 | no_license | import turtle, colorsys
def bryan():
turtle.bgcolor("black")
t = turtle.Turtle()
w = turtle.Screen()
t.speed(0)
def why(idx):
for i in range(idx):
color = colorsys.hsv_to_rgb(i / float(idx), 1.0, 1.0)
t.color(color)
t.forward(10 + (i / 16))
t.right(10)
why(500)
w.exitonclick()
|
3d8c2b246a82e2c9ebf2c610cd6f1a0ba310e1d4 | 69e2db7ab0ef675e0db2c3fc7f90b7fc40f45c1e | Jonathan-MW/plotly.py | /plotly/validators/histogram2dcontour/contours/labelfont/__init__.py | Python | py | 1,657 | permissive |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='size',
parent_name='histogram2dcontour.contours.labelfont',
**kwargs
):
super(SizeValidator, self).__init__(
plotly_nam... |
2edbde225f6cffa1e1437fd3dcfd0f0fe9f2880c | 2dcbc816e42ea7322a75b186a62d83a32c9f56d2 | openstack/security-doc | /security-threat-analysis/source/conf.py | Python | py | 8,759 | no_license | # 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
# distributed under the... |
30145e560e6137cba38bcf50e65be264089eda34 | 6a91cbf726c744f5782ea961cf0b55f743d45806 | datlife/cargan | /demo/test.py | Python | py | 4,107 | no_license | import os
import sys
import time
import cv2
import numpy as np
from glob import glob
from cargan.utils.painter import draw_boxes
from cargan.utils.parser import parse_label_map
from cargan.utils.tfserving import DetectionClient, DetectionServer
TEST_DATA = './test_data/JPEGImages'
OUTPUT_DIR = './test_data/Main/'
D... |
aeeb0d6ea0c2746bf81c507a6965ceedd74ea12c | c41836edf9bb666b59ac20c50b665b5de6c62421 | levylll/NGB | /xadmin/plugins/batch.py | Python | py | 6,016 | no_license |
import copy
from django import forms
from django.db import models
from django.core.exceptions import PermissionDenied
from django.forms.models import modelform_factory
from django.template.response import TemplateResponse
from django.utils.encoding import force_str
from django.utils.safestring import mark_safe... |
bdece9aaabe251c433c8ee88b8d1d3def5343e0b | 40be69c08dfbe33e4dcbbf49fc5f4ee6f82d5423 | ljvannoo/delvernmud | /src/commands/cmd_who.py | Python | py | 704 | no_license | import logging
from src.commands.command import Command
from src.entities.action import Action
from src.entities.character import Character
from src.managers.game_manager import GameManager
class CmdWho(Command):
name = 'who'
usage = 'who'
description = 'Shows a list of everyone who is logged in.'
def execut... |
6f3d9e580b57536298840edbe4b482eb01811acd | 88699a83f769d942196468fa3fc2de3c47a21024 | kmvinayaka/database | /weather/store_Sensor_Data_to_DB.py | Python | py | 1,652 | no_license |
import json
import sqlite3
# SQLite DB Name
DB_Name = "Weather-DB.db"
#===============================================================
# Database Manager Class
class DatabaseManager():
def __init__(self):
self.conn = sqlite3.connect(DB_Name)
self.conn.execute('pragma foreign_keys = on')
self.c... |
95053dd806ae3e134f072755d5b97392f53e024e | 86f7bddb3e7fd31fabb0ef01de226df7ef565b4e | CharlBrook47/PData_Augmentation | /augmentation_script.py | Python | py | 7,589 | no_license | import imgaug as ia
import imgaug.augmenters as iaa
import imgaug.parameters as iap
from imgaug.augmentables.bbs import BoundingBox, BoundingBoxesOnImage
from PIL import Image
import numpy as np
import os
import imageio
import argparse
# get input folders (images, annotations) and output folders (images, annotations)
... |
78acd5295721e5e0c6b66266e007e5eb23c5c09c | e4d5fdd2cf4ec7a8f4a999ada742de5e2c504fd6 | SeanMFranklin/ProjectEuler | /Euler12.py | Python | py | 346 | no_license | import math
high = 0
triangle = 1
k = 1
def numberofdivisors(x):
global high
z=[]
y=0
for i in range(1,int((x**.5+1))):
if x%i==0:
y+=2
if x/i == i:
y-=1
if y>high:
high = y
print(str(high) +": " + str(x))
return(y)
for i in range(15000):
k+=1
triangle += k
if numberofdivisors(triangle)>500:
... |
537fa1ca7d8fed334566d901c2b0544a25c13ef2 | 69b8b6dcc75c615dd3891ec1d10b887d93bb1ba1 | javidgon/alpaca-code-challenge | /tasks/views.py | Python | py | 1,175 | no_license | from rest_framework.authentication import TokenAuthentication
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView, get_object_or_404
from rest_framework.permissions import IsAuthenticated
from tasks.models import Task
from tasks.serializers import TaskSerializer
class TaskList(ListCre... |
05a74fc462edbbe31c32ec657fc8ec779602bd59 | ca48433a0054be887128aa2811a18a89147e2c82 | Beiusxzw/TRIBECaller | /TRIBECaller/Utilities/Parsers.py | Python | py | 665 | permissive | # -*- coding: utf-8 -*-
#!/usr/bin/env python
# Author: Ziwei Xue
def parse_region(s:str):
try:
[chr_,pos] = s.split(":")
if '-' not in pos:
return chr_,int(''.join(pos.split(','))),None
[start,end]=pos.split("-")
return chr_,int(''.join(start.split(','))),int(''.join(end.split(',')))
except ValueError:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.