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 |
|---|---|---|---|---|---|---|---|---|
64f27ca2c9e0837007fa5bc9fd020b631200369b | 2d4e23e86386abba92b98a8289eb24103727f76b | wcy41gtc/Udaicty-Fyyur | /app.py | Python | py | 21,337 | no_license | #----------------------------------------------------------------------------#
# Imports
#----------------------------------------------------------------------------#
import sys
import json
import dateutil.parser
import babel
from flask import Flask, render_template, request, Response, flash, redirect, url_for
from fl... |
b65e6f8abdb894c945cff940a55a6bd2bd2cb49b | 213fc0236cb72e6350faa6f8cfb822098429915b | hemina/summer-intern | /movie-rating-bench/mlp.py | Python | py | 14,926 | no_license | """
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation function (usually tanh or sigmoid) . One ca... |
962858ad2e596c5e13cff8d0d60db5b53fb80d4b | fcf594e976fe240aa74c6633bd7c5f857ed04901 | naveenkambham/docker-sagemaker | /app.py | Python | py | 776 | no_license | import flask
from flask import Flask, Response
import pandas as pd
from io import StringIO
app = Flask(__name__)
import pickle
model = pickle.load(open('lr_model', 'rb'))
def run_model(input):
"""Predictor function."""
# reshape the flat [0, 255]-entry list into a [0, 1]-entry grid, as desired by the CNN.
... |
4107b84814e5ab95a5146015a39b8f867c6cd84d | 2b9913a5cdd548287af0979b192a13a3cb491476 | hideyy/WordSuggestion | /Arai/common/util.py | Python | py | 5,778 | no_license | import os
from os import path
import sys
import numpy as np
#word2vec
from gensim.models import word2vec
#wordnet
import nltk
from nltk.corpus import WordNetCorpusReader
from nltk.corpus import wordnet as wn
#pickle
import pickle
#networkx : 有向グラフ
import networkx as nx
ROOT_PATH = 'C:/research'
#ベクトルの基礎計算
class Vec... |
49bbd7070c8340396f5900fc3171fc77e9097a9d | a13205c08a9ebe7324790819761144f5ae333236 | gayhub-blackerie/poc | /bugscan/exp-1667.py | Python | py | 978 | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
POC Name : jenkins_script_console_java_execution
Author : fenyouxiangyu
mail : fenyouxiangyu@sina.cn
Referer : http://www.th3r3p0.com/vulns/jenkins/jenkinsVuln.html
"""
# Description : This module uses the Jenkins Groovy script console to execu... |
8263d0009f72e8f7bfc2e6e07f8aedcb328b249b | 9fad862073d25fc18e1359493d9db0b52cf686d6 | huskyin/python34 | /AplikasiKaryawan/PotonganGaji/Potongan.py | Python | py | 321 | no_license | ''' Modul PotonganGaji '''
class Pajak:
def __init__(self):
self.PPN = 0.1
self.PPH21 = 0.05
def PotonganPPN(self):
return self.PPN
def PotonganPPH21(self):
return self.PPN
class Tunjangan:
"""docstring for Tunjangan"""
def __init__(self, arg):
super(Tunjangan, self).__init__()
self.arg = arg
... |
8756eda18cd1f4b6c60bcbb5f0e1e2b22425ac04 | 4c730fad75cfb426b3090210dc2129f5f83b65d2 | xfsaid/django-myproject | /apps/account/models.py | Python | py | 295 | no_license | from __future__ import unicode_literals
from django.db import models
# Create your models here.
class User(models.Model):
username = models.CharField(max_length=50)
password = models.CharField(max_length=50)
email = models.EmailField()
phone = models.CharField(max_length= 20)
|
3b36978e25a3df10d48d505cd601beaa72358f44 | 50cef7070efab03f6589fd055cbc12c117a2e078 | sine69/number_guesser | /main.py | Python | py | 1,552 | no_license | from random import randint
from time import sleep
from os import system
def number_guesser():
total_guesses = 1
try:
x = int(input('Enter the lowest number here : '))
y = int(input('Enter the highest number here : '))
a = randint(x, y)
except:
print('Inco... |
2bb1396b2666ca037422ddf7a223d2096af97ec2 | 200684f401a12446a1e4d28e664fb5c2ff5a0073 | Briwisdom/Underwater-image-generate | /sgan/sgan.py | Python | py | 8,672 | no_license | from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, multiply, GaussianNoise
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
from keras.layers.advanced_activations import LeakyReLU
from keras... |
9f17fd310b4168daa7ee6f7d17a3a04bfeea9c82 | 17ec70ea8db0cc3bdef8429c5496b64d8c3145e1 | cdejong2/squirrel-project | /map.py | Python | py | 892 | no_license | import plotly.express as px
import geopandas as gpd
import pandas as pd
from sodapy import Socrata
TOKEN = 'pk.eyJ1IjoiY2Rlam9uZzIiLCJhIjoiY\
2tyZG9mbmN3NWVkNDMwcnU2N202Z2pzdiJ9.wi9xk04T5EsRZ6i2XGfIZg'
def createMap():
with Socrata("data.cityofnewyork.us", None) as client:
results = client.get("vfnx-vebw... |
ded8ea70d6f8f75e7e1e82c918bd267da0a30b6a | 931d52fd93dc3d499c8354b71a7b9f73771dab75 | dvskhamele/teleadd | /telenv/lib/python3.6/site-packages/telethon/client/updates.py | Python | py | 10,765 | no_license | import concurrent.futures
import itertools
import logging
import random
import time
from .users import UserMethods
from .. import syncio, events, utils, errors
from ..tl import types, functions
__log__ = logging.getLogger(__name__)
class UpdateMethods(UserMethods):
# region Public methods
def _run_until_d... |
f68d3d733a9e094d316a0a1ec431543903f98133 | dc869fb865fbaf7799e3b8e37b3b6ce80274800f | FrederickHou/tools | /python/rabbitmq_lib/activemq_wrapper.py | Python | py | 1,767 | no_license | #!/usr/bin/ python
# coding=utf-8
import os
import time
import stomp
import json
import logging
WORK_HOME = "/opt/SSO_TO_LDAP_SYNC"
cfg_file = os.path.join(os.getcwd(), "activemq_wrapper.json")
# cfg_file = os.path.join(WORK_HOME, "activemq_wrapper.json")
with open(cfg_file, mode='r') as f:
config_json = json.l... |
2dfe6c862dbbca4cfdaf3e517fc73edb90171684 | d302d0b0585dba6b6394d1d8db935db3b087172a | nathanaj99/prescriptive-trees | /archive/slurm/fairness/bash_generator_IPW.py | Python | py | 6,267 | no_license | import os
import sys
path = './'
approach_name = 'IPW' #
samples = [1, 2, 3, 4, 5]
time_limit = 3600
def put_qmark(s):
s = "\""+s+"\""
return s
def generate(data_groups, depths, thresholds, preds, protected_cols, fairness_bounds, array):
global time_limit, samples
slurm_file = 's... |
82e2b178216b893d3a0e41425a087c4676bf33f5 | b8dded389182c8b2bd845e97415463606554a451 | oli-harvey/house-prices | /functions/process_data.py | Python | py | 4,449 | no_license | import pandas as pd
from pandas.api.types import is_string_dtype
import os
from sklearn.experimental import enable_iterative_imputer
from sklearn.impute import IterativeImputer
funcs = os.listdir('functions')
for func in funcs:
if func.startswith('__') or func == 'import_all_functions.py':
continue
... |
370dcc861605021c9dd2ebf984850be68bd84e0e | 1f6b3ef5b2985705489c964b7d668ce79cd40334 | dtran2108/drive_api | /google_drive_api_test/method.py | Python | py | 2,736 | no_license | from io import open as ioOpen, BytesIO
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from auth import Auth
from apiclient.http import MediaFileUpload, MediaIoBaseDownload
from apiclient import errors
# If modifying these scopes, delete the file token.pickle.
SCOPES... |
5f5fb2921c57aa7af2cdb1be837f1596a3fcb905 | 38868557389aedcb5d3331081f0245b5ef92f6cb | Kurzweil-Kim/Deep-Learning-with-Python | /perceptron/nandgate.py | Python | py | 372 | permissive | # -*- coding: utf-8 -*-
import numpy as np
def NAND(x1, x2):
x = np.array([x1, x2])
w = np.array([-0.5, -0.5])
b = 0.7
tmp = np.sum(x * w) + b
if tmp <= 0:
return 0
elif tmp > 0:
return 1
def main():
print(NAND(0, 0))
print(NAND(1, 0))
print(NAND(0, 1))
print... |
4d765d410bb2492dcdcea252219673c98f7e276d | fa4de58371001a80388ec33fd19d128d52a59935 | harshp8l/deep-learning-lang-detection | /data/test/python/fa4de58371001a80388ec33fd19d128d52a59935urls.py | Python | py | 819 | permissive | from tastypie.api import Api
from django.conf.urls import patterns, include, url
from bikecompetition.bc import api, actions
bc_api = Api(api_name='bc')
bc_api.register(api.CompetitionResource())
bc_api.register(api.CompetitorResource())
urlpatterns = patterns('',
url(r'^api/', include(bc_api.u... |
bdb01ef82930a7122fb7054ea112f7f59867b90c | 5e56b938dbc0bc538ee77f4cc89bd15e5f90f40e | dijana-z/organize-me | /app/core/tests/test_admin.py | Python | py | 1,387 | no_license | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework import status
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
... |
927feb156990dad0eed955ca2208d611fcf918b8 | fb69c5974b1106717d0442716093a3bccba9e92f | hetw/aliyun-openapi-python-sdk | /aliyun-python-sdk-green/aliyunsdkgreen/request/v20170823/MarkAuditContentItemRequest.py | Python | py | 2,114 | permissive | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
d9fbb05f76b833df2107238eff3182b469ced13b | e3e9afb568df3265a87214e14de689576a749bcb | jaikko/Finance | /optimized.py | Python | py | 1,529 | no_license | import csv
import time
import os
from operator import itemgetter
# Choix du fichier
file = input("Entrez le nom du fichier csv: ")
while not os.path.exists("data/" + file + ".csv"):
print("Fichier introuvable ou mauvais type de fichier")
file = input("Entrez le nom du fichier csv: ")
# Démarrer chrono
sta... |
34d4a0c0519154fbac5116ef0bf21fb69f157800 | 57d0829522db92b9d23e31cfc78136aef5ea4782 | LukeWUK/CH2M_Toolset_v2 | /ADCS/MMS/Lidar/FinalDeliveryPreparation/LidarRoute_PrePrepQA.py | Python | py | 256 | no_license | __author__ = 'WebbL'
#Check to see if we have matching Unmatched Tiles in DB and incorporate as layer
#Check each Matched to see if on disk
#Check each Unmatched to see if on disk
if __name__ == "__main__":
inputFeatures = r''
|
74c11dd4dde474129dce791280ea752bb9ef6537 | cb2aa1af797cbf475f2f5dec76fc2b15e926d196 | CDFriend/itad-discord-bot | /discord_bot/test/itad_api_test.py | Python | py | 809 | no_license | import pytest
from unittest import mock
from discord_bot.itad_api import ITADApi
@pytest.fixture
def mock_requests():
with mock.patch("discord_bot.itad_api.requests") as mock_requests:
yield mock_requests
@pytest.fixture
def mock_api_key():
with mock.patch("discord_bot.config.ITAD_API_KEY", "TESTAPI... |
2e64e9d784e96b957cba6232b8559fb30b083c9f | cd1eff03b643b01c1b5d07a8a2557dd1f5138ab1 | yeansang/workspace | /RasPi/python/gpioTest.py | Python | py | 427 | no_license | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
print "LED PIN TEST"
pins = [13,19,26]
for pin in pins :
GPIO.setup(pin,GPIO.OUT)
GPIO.output(pin,False)
try :
while(True) :
for pin in pins :
GPIO.output(pin,True)
time.sleep(1)
GPIO.output(pin,False... |
15464ef10907d9d86ba952d09a7a49e6cf3447d7 | 6ba5e6b42bf3b1921d837b126890f1c638a3a9c4 | MeloVicG/Counter | /Counter/settings.py | Python | py | 3,110 | no_license | """
Django settings for Counter project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... |
aa5808d6b80336b2763cd7d3941afd5cefa8f746 | c6d5a94447882cd3fdb86eefc0d5e860ccb69746 | Akif-Mufti/Data_analysis_withPython | /ListVSarray.py | Python | py | 796 | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 20 14:57:19 2016
@author: CarpeDIEM
"""
import numpy as np
list = [1,2,3,4]
a = np.array([1,2,34])
for i in list:
print(i)
for i in a:
print(i)
list.append(5)
#a.append(56) we cant append in numpy array
#list = list + [4,6] #... |
ebcd34708b8652ef6a34c63d212d52e7d5ade520 | 0aea3f583ef5da34625f4de8306dc52c0e405362 | liuwenwen313/store | /day13/调用工具刘雯雯.py | Python | py | 313 | no_license | # #数据库的写入列表
from 表格连接数据库工具 import Db_to_excel #导入方法
from 表格连接数据库工具 import select
# sql="select * from bank "
# param=[]
# name="nam"
# name1="1.xls"
# Db_to_excel(sql,param,name,name1)
path=r"上传银行.xls"
name="bank"
select(path,name,start=0) |
49c5b0cdcaa2f17cbb22d4269b676d49550c7e86 | 7faf2a05403f65ae2a03e5a70a5c0935c9545c9f | DTUWindEnergy/TopFarm2 | /topfarm/cost_models/utils/spanning_tree.py | Python | py | 3,728 | permissive | from numpy import argmin, array, sqrt
import sys
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
import numpy as np
from numpy import newaxis as na
def mst(x, y):
d_ij = np.hypot(x - x[:, na], y - y[:, na])
Tcsr = minimum_spanning_tree(d_ij)
sp = (Tcsr.toarray())... |
dd80f057de9d0de521b37e1dea8fdbaf9ea5d6e6 | 8757d8c8a09f63b959d450b8e37c206e38f75fc6 | mdanassid2254/pythonTT | /constrector/superk_keyword.py | Python | py | 425 | no_license | class c1:
def __init__(self,a,b):
print(self)
self.a=a
self.b=b
def area(self):
print(self.a*self.b)
print(self)
class c2(c1):
def __init__(self,a,b,c):
self.a=a
self.b=b
self.c=c
print(self)
def vol(self):
pr... |
6b27b3b4e3c1899d359166d894f8530838a0f5c9 | 7b6f52c5d497300bca1fdb203aa36d854ac431eb | EconomyGame/EconomyGame-GamePart | /src/screens/menu.py | Python | py | 1,001 | no_license | from . import AbstractScreen, CreateScreen, JoinScreen
import src.config as config
class Menu(AbstractScreen):
def __init__(self, game):
super().__init__(game)
self.set_gui()
def _create_game(self):
self.game.current_screen = CreateScreen(self.game)
def _join_game(self):
... |
bd9e054c6ce674d5ca15cece38927c364a861805 | 7114bc8c0facfef601ef6133fd465badcfefc9e7 | rileybusche/HardStuckSilver | /item.py | Python | py | 1,235 | no_license | import json
import pprint
import re
import item_map
pp = pprint.PrettyPrinter(indent=4)
item_file = open('./json/item.json')
item_json = json.load(item_file)['data']
# Gets Basic Info for an Item and returns a dictionary
def get_item_info(item_name : str):
item_id = item_map.get_item_id_from_name(item_name=item_... |
d589028f65d05313322d80f00a90cb86f9c37a3f | 53579e9d9cbad995b3d70a70e15b72bfb22bae84 | robleroble/Virtual_Herbarium | /App/collections_bp/collections.py | Python | py | 3,879 | no_license | from flask import Flask, render_template, redirect, flash, request, session, Blueprint
from models import (
db,
connect_db,
User,
Specimen,
Collection,
CollectionSpecimen,
)
from forms import (
CollectionForm,
)
from flask_login import (
login_required,
current_user,
)
collections_b... |
3da9bd8c6cff88b5453efb71b13afbde6d691f89 | 133818f7c6f0b2146c9ad70d9fc9621a0f8e9e55 | Luyao61/Vision-Language-Project | /train_2.py | Python | py | 8,589 | no_license | import keras
import numpy as np
import my_models
import keras.preprocessing.text
import torch
from torch.autograd import Variable
import time
import copy
use_gpu = torch.cuda.is_available()
Batch_Size = 200
use_gpu = True
cocoqa_train_q = np.genfromtxt("cocoqa/train/questions.txt", dtype = str, delimiter='\n')
cocoqa... |
703ab0b9a63d7564957bc1ba2ba1b0f4ddff2e6b | c9eca16fa3f52937ce8f2d23ee4b1d9a3775b132 | LiuFang816/SALSTM_py_data | /python/KeepSafe_aiohttp/aiohttp-master/tests/test_test_utils.py | Python | py | 8,287 | no_license | import asyncio
from unittest import mock
import pytest
from multidict import CIMultiDict, CIMultiDictProxy
from yarl import URL
import aiohttp
from aiohttp import web, web_reqrep
from aiohttp.test_utils import TestClient as _TestClient
from aiohttp.test_utils import TestServer as _TestServer
from aiohttp.test_utils i... |
b50af75d61e37d2d14df8eb9e942e7420ba2f8cd | 7e1db09adf967201c40eea697b2c7342b834cbab | Evbor/Stanford_RL | /assignment2/q2_linear.py | Python | py | 10,937 | no_license | import tensorflow as tf
import tensorflow.contrib.layers as layers
from utils.general import get_logger
from utils.test_env import EnvTest
from core.deep_q_learning import DQN
from q1_schedule import LinearExploration, LinearSchedule
from configs.q2_linear import config
class Linear(DQN):
"""
I... |
3529e381ccc82107a7f9dc094d4e2175e7ace1f0 | bd8ebb3c41ac3d6d549a8264d5775cae8bd9f7ff | MateuszHolz/Pyt | /adb-automation/test_multiple_command_lines.py | Python | py | 454 | no_license | import json
import msvcrt
import os
import subprocess
import sys
import threading
import time
import re
keyWords = ["huuuge", "gamelion"]
listOfPkg = []
listOfPackages = subprocess.check_output(r"adb shell pm list packages -f")
for i in listOfPackages.decode().split():
for j in keyWords:
if j in i:
... |
7ad36e5743dbf7ec10f2d71ca0a08b098b09bd05 | e373b8acde4d62e90fec27857adc0b35b4a7d850 | xiangling1991/xiangling | /Python/导入模块.py | Python | py | 417 | no_license | #import *
#from * import *
from sys import version
print version
#__name__属性--认识主模块
#不同场景中的__name__的值
print __name__
#__name__属性的常用情况
if __name__ == "__main__":#判断该模块是否为主模块
print "It is main"
else:
print "It is not main"
#主模块:__name__ == __main__ 就是主模块,非主模块是被调用的模块
|
751d5c08a4afaf80d95bff6ec8d80ef41e14c85b | 3166d8ca86a143f182cdd2066004fdac04b06331 | ntucschen/RIT-18 | /winner/config.py | Python | py | 3,669 | no_license | import time
import os
class Config(object):
"""
class to save config parameter
"""
def __init__(self, dataset_name):
# Global
self.image_size = 720, 1280 # input image size
self.batch_size = 1 # train batch size
self.test_batch_size = 1 # test batch size
sel... |
d75deceedb24df4a75b8af72ee27e97bb4889055 | 94c36d6b3e018983392587bb79d030cddd70c2dc | josonle/Django-bootstrap | /mysite/mysite/settings.py | Python | py | 2,833 | permissive | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... |
91b55f19d5cf0ed61ea36c8d9d8b7ab659f9a4a6 | eb1420a332fc209abbc986ba7ee71844a2185499 | otcshare/chromium-src | /tools/win/trace-sandbox-viewer.py | Python | py | 6,002 | permissive | # Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Use Chromium tracing to associate mojo endpoints with sandboxes.
This script provides a rich view of where mojo interfaces are hosted
and consumed when Ch... |
8e0401990cbd5c46af426f06c40521947baf4bbe | 44660d1d5d5c78c7dcf39566a144af3cd1b1cc38 | scottpledger/compyler-csci4555 | /original/explicit.py | Python | py | 10,472 | no_license | import compiler
from compiler.ast import *
from vis import Visitor
class GetTag(Node):
def __init__(self, arg):
self.arg = arg
def getChildren(self):
return [self.arg]
def getChildNodes(self):
return [self.arg]
def __repr__(self):
return "GetTag(%s)" % repr(self.a... |
6d0b2d2843a3e1aca233a071a1cf3dac8f695d5c | f2979e1c4597666064d3eab761207dd42f81491e | parthit/Face-lock | /parthit_karan_experiments.py | Python | py | 5,802 | no_license | # import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
import imutils
import pickle
import face_recognition
import argparse
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setup(40, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Inside button for exit
GPI... |
df79f4be44eebaaff31c715339c2673f132a52ed | 63780ffaec7e9534e60afdc21b9ecee92bb82987 | yinglao/Leetcode-Lintcode | /Hash Function.py | Python | py | 1,486 | no_license | #In data structure Hash, hash function is used to convert a string(or any other type) into an integer smaller than hash size and bigger or equal to zero. The objective of designing a hash function is to "hash" the key as unreasonable as possible. A good hash function can avoid collision as less as possible. A widely us... |
1c248842903c6007d7c70990c84bfd2b9cf16911 | a56679ce7b48f61acbf1a99642f491c489287491 | kadster/DarwinProject | /Darwin.py | Python | py | 1,225 | no_license | import os
from bs4 import BeautifulSoup
folder = '/Users/nt/Desktop/Darwin'
files = os.listdir(folder)
tagnames = ['persName', 'date', 'keywords', 'abstract', 'text']
files = [f for f in files[:] if 'xml' in f]
output_strs = []
for fname in files:
with open(os.path.join(folder, fname), "r") as infile:
f... |
0ff15a7f3cf844019be43fd2d3c9c0504075b864 | 019e9b3f6a5f211d4b2798bb3bc935e0fa8b10de | a13140120a/Spark_Note | /proj_spark_streaming/top_urls.py | Python | py | 1,396 | no_license | from pyspark import SparkContext
from pyspark.streaming import StreamingContext
import re
def logPattern():
threeDigits = "\\d{1,3}"
ip = "({}\\.{}\\.{}\\.{})?".format(threeDigits, threeDigits, threeDigits, threeDigits)
client = "(\\S+)"
uid = "(\\S+)"
dateTime = "(\\[.+?\\])"
request = "\"(.*?... |
bd7817dcba446021fd8ba5846b4b3c29b9d92b6a | 7f04768a29bc7e0f695f04c07d65e3d7ad93d50a | gertdekkers/dcase_util | /dcase_util/data/probabilities.py | Python | py | 8,032 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, absolute_import
import numpy
import copy
from dcase_util.containers import ObjectContainer
class ProbabilityEncoder(ObjectContainer):
def __init__(self, label_list=None, **kwargs):
"""Constructor
Parameters
... |
318d8700b1dadfa29fd626e1e8fc001f5643a21b | 84abdcfc66431ef9ee7c808d79ff0714922ec7c4 | szymonborkowski/recipe-app-api | /app/recipe/tests/test_ingredients_api.py | Python | py | 2,144 | permissive | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_URL = reverse('recipe:ingred... |
7d3a4062fcaa58363ba8817e37ec64e03c1354b2 | e0cc36dbbfddaaa94c42a79a33e9149899dca12e | fran-penedo/dotfiles | /scripts/filter_links.py | Python | py | 931 | no_license | #!/usr/bin/python
import json
import fileinput
import re
domains = [
r"amazon\.com",
r"amazon\.es",
r"youtube\.com",
r"youtube\.es",
r"google\.com",
r"google\.es",
r"cloud\.franpenedo\.com",
r"duckduckgo\.com",
r"localhost:.+",
r"192\.168\..+",
r"4chan\.org",
r"4channel... |
b7ec3b5cea70f47847d84ad79d3dc9865ef9b3c0 | 488c187e8317264bacfa9d2a99a4442d12ad8456 | skgbanga/Sandbox | /python/build_async/example.py | Python | py | 6,138 | no_license | # https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# https://gist.github.com/dabeaz/f86ded8d61206c757c5cd4dbb5109f74
import time
def countdown(n):
while n > 0:
print(f"Down {n}")
time.sleep(1)
n -= 1
def countup(stop):
n = 0
while n < stop:
print(f"Up {n}")
time.sleep... |
dab39fc42e2d58a3c8a793748f27239509cbfa2b | 03450ea86d2d608998aace5e8af0daa25f46ea3e | faramarz-hosseini/MyInstagram | /MyInstagram/wsgi.py | Python | py | 399 | no_license | """
WSGI config for MyInstagram 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/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... |
1de0b452ec143f959fc620ade678a5edcf365cf3 | b2811f3026539b61e2a591d6cd5c5c2c0583457b | kennyjoseph/twitter_dm | /examples/simple_pull_down_user_data_print.py | Python | py | 1,654 | no_license | """
This is the most basic script for using twitter_dm.
From here, you may want to go look at some of the more complex examples
that leverage the library's NLP/rapid collection tools, as this is basically
a replication of tweepy with less documentation :)
"""
from twitter_dm.TwitterAPIHook import TwitterAPIHook
from t... |
742b2c71acbd8b810f638961a5d3fc29614bee7a | 9335e6e5d2ca4baa9e14a71c8901574f25aea726 | khannasarthak/codingPrep | /SPOJ/LASTDIG.py | Python | py | 511 | no_license | import time
start_time = time.time()
###############CODE STARRS##############
def func(a):
for i in a:
a = i[0]
b = i[1]
if b ==0:
print ('1')
else:
b = b%4
a = a%10
if b==0:
b=4
print ((a**b)%10)
a= []
n ... |
f7f52df765fd6925b5ad77f07a45d596863cf4cd | cd2e4d34a56d7fe25eac431511669ee8de5a2e9b | khs0806/mall_project | /product/models.py | Python | py | 591 | no_license | from django.db import models
# Create your models here.
class Product(models.Model):
name = models.CharField(max_length=256, verbose_name='상품명')
price = models.IntegerField(verbose_name='상품가격')
description = models.TextField(verbose_name='상품설명')
stock = models.IntegerField(verbose_name='재고')
regis... |
ee2b6292194ab6bad76218a5a9f7392754d35187 | bb17f6c20fd42dd9877e65d800fff48493abae7a | strobo-inc/nrfjprog | /nrfjprog/model/__init__.py | Python | py | 1,578 | permissive | # Copyright (c) 2016, Nordic Semiconductor
# 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 must retain the above copyright notice, this
# list of conditions ... |
902ebef6f3fb6f0e006a9298ce402e8718d9a2f9 | 216ff3947b2f436295b41d2649e8eee2a6c59ba4 | kmayika/AdvancedPython | /AdvancedPythonFunctions/docstrings_start.py | Python | py | 314 | no_license | # demonstrate the use of function docstrings
def myFunc(arg1, arg2=None):
"""myFunc(arg1, arg2=None) ---> Doesn't do nothing
Parameters:
arg1: The first argument
arg2: The second argument
"""
print(arg1, arg2)
def main():
print(myFunc.__doc__)
if __name__ == '__main__':
main() |
f82e8ed06c9350b02b39ad6bff73e7f2838bfdf1 | 0bd352cbda21ec45b9e99438353bb1ab77168e6e | Zplusless/Zplusless.github.io | /deploy_script/generate.py | Python | py | 316 | no_license | import os
lines = [
'# Mindmap list\n'
]
print('generating TOC')
for file in os.listdir('.'):
if 'html' in file:
lines.append('[{}]({})'.format(file,'https://Zplusless.github.io/'+file)+'\n\n')
with open('./README.MD', 'w') as readme:
readme.writelines(lines)
print('done!') |
5e263711b83efb6f26961389c2d0ca7b54139385 | 1e35ba04cc22b8c58f65bb1d78333f01c62f54ff | jmikkola/pytypeinf | /src/graph_test.py | Python | py | 599 | no_license | #!/usr/bin/env python3
import unittest
from graph import Graph
test_graph = Graph.parse('''
a: b
b: e f c
c: g d
d: c h
e: a f
f: g
g: f
h: g d
''')
class GraphTest(unittest.TestCase):
def test_parsing(self):
self.assertSetEqual(set('a b c d e f g h'.split()),
set(test_graph.... |
9b24f46e91a27962488f31ce080632f7c1277cc3 | 1cbc7ccf84872dfaf6d549d896616893dd4c9880 | vorrarit/dl4cv | /keras_mnist.py | Python | py | 2,966 | no_license | from sklearn.preprocessing import LabelBinarizer
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from keras.models import Sequential
from keras.layers.core import Dense
from keras.optimizers import SGD
from sklearn import datasets
import matplotlib
matplotlib.use('... |
6686f24b924a87c707cc397d2340ed0bcb427515 | 61a50ab80db874537b43f6726d8cc517a4c43eeb | openvinotoolkit/training_extensions | /src/otx/algorithms/detection/adapters/mmdet/utils/builder.py | Python | py | 1,530 | permissive | """MMdet model builder."""
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from copy import deepcopy
from typing import Optional, Union
import torch
from mmcv.runner import load_checkpoint
from mmcv.utils import Config, ConfigDict, get_logger
from otx.algorithms.common.utils.logger imp... |
5d8343a085e89966aa88b91a0fafdea5ea56e1af | a2d988e2b5b5d984a4f1872a2482e9934af22835 | Jancukers99/Gui-17104034 | /pertemuan 5/soal/2/icon.py | Python | py | 1,391 | no_license | import sys
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class DemoIcon(QWidget):
def __init__(self):
super().__init__()
self.setupUi()
def setupUi(self):
self.resize(400, 100)
self.move(300, 300)
self.setWindowTitle('Tugas ... |
384e0ecf2c751e602eca717672bf280db69c5b77 | 7adca119808fc10b2a2245a7fedc5fdd886af594 | tyohei/chainermn | /tests/links_tests/test_batch_normalization.py | Python | py | 6,102 | permissive | import chainer
import chainer.testing
import chainer.testing.attr
import chainer.utils
import mpi4py.MPI
import nose.plugins.skip
import numpy
import unittest
import chainermn
from chainermn.communicators.naive_communicator import NaiveCommunicator
import chainermn.links
class ModelNormalBN(chainer.Chain):
def _... |
c64a7116c547c16a856a3ed259648522fa0e39fa | a04c399a86587893aae652bb63b3a149b8354f73 | imaneelbakk/Glassdoor_Jobs_Salary | /flask_api/app.py | Python | py | 1,792 | no_license | import flask
from flask import Flask, jsonify, request
import json
from data_input import data_in
import numpy as np
import pickle
from sklearn import preprocessing
import pandas as pd
def load_models(model_path):
model = pickle.load(open(model_path,'rb'))
return model
app = Flask(__name__)
@app.route(... |
e01b60310b775d7dddb6055efcbdb012de23270a | 78f0c24b6bb879c6718a6c837fe38b35f35b6a60 | Confuzerpy/checkio_solve | /elementary/first_word.py | Python | py | 540 | no_license | import re
def first_word(text):
if text[0] == ' ':
text = text.lstrip()
text = re.match(r'([A-Za-z]+)', text)
return text.group(0)
elif text[0] == '.':
text = text.lstrip('.')
text = text.lstrip()
text = re.match(r'([A-Za-z]+)', text)
return text.group(0)... |
f1015c4feef5987283bd1c309a55d921bd6739d0 | ac273c3ad127f6c97a6963e0f27e938753f9ac50 | jstanley23/zenoss-RM-api | /zenApiLib.py | Python | py | 17,809 | no_license | #!/usr/bin/env python
import os
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from requests.packages.urllib3.util.retry import Retry
from httplib import HTTPConnection
from requests.adapters import HTTPAdapter
import json
import ConfigParser
from HTMLParser import HTMLParser
i... |
0bd927fc81c9bd0354965cc1c680e0a16ab9a97a | b35f65ba966388b95aa0a3d4e0135d8946d6fdb8 | joergviola/play-user | /commands.py | Python | py | 818 | no_license | # Here you can create play commands that are specific to the module, and extend existing commands
MODULE = 'user'
# Commands that are specific to your module
COMMANDS = ['user:hello']
def execute(**kargs):
command = kargs.get("command")
app = kargs.get("app")
args = kargs.get("args")
env = kargs.get... |
5121093f69a2012574cfa925cf0d5a67962a8acd | 83265498dd2d959332b66fbda400409410ab11be | germanilia/helm-charts | /metricbeat/tests/metricbeat_test.py | Python | py | 31,099 | permissive | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], "../../helpers"))
from helpers import helm_template
project = "metricbeat"
name = "release-name-" + project
def test_defaults():
config = """
"""
r = helm_template(config)
assert name in r["daemonset"]
c = r["daemonset"][name][... |
d60949186ab0e3421551d9421e2cbb74b2951383 | e1f5f2ab9ade5ce35666ea83b53921453ea85802 | Joslu/Curso-Python | /1. Datatype.py | Python | py | 633 | no_license | # What is python?
# " high-level programming language, and its core design philosophy is all about code
# readability and a syntax which allows programmers to express
# concepts in a few lines of code.”
#Float
print(23.21)
#Boolean
True
False
#list
# conformada por distintos elementos
[10,20,30,44]
["Hi",3,... |
7f20f8bd9844744f0ac9782b862a32397ce5e96c | 5f08fb81bbad71302013cde296d56ca8accb951c | salqanaei/example | /example/settings.py | Python | py | 3,091 | no_license | """
Django settings for example project.
Generated by 'django-admin startproject' using Django 2.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... |
37b3a9828a11d8c8a42a9eccc650e97b4ef4877e | a709fb0b001b5aed20a3eb29a37ad2be3e4f1755 | Sirius-social/Indy-Agent | /app/settings/base.py | Python | py | 7,000 | no_license | """
Django settings for auth project.
Generated by 'django-admin startproject' using Django 1.11.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
im... |
59aff3409a4d399e8ebad5f2a1d4dd5a805fb9ef | c32a7aa7e330d8530daf30818aec31f3782f7aa5 | xiaoyu1233/algorithm016 | /Week_04/leetcode102.二叉树的层序遍历.py | Python | py | 1,456 | no_license | #层序遍历。最适合的是使用队列结构进行广度优先搜索BFS,也可以进行深度优先搜索,记录好层数就行。
#BFS
#超84%
"""
# Definition for a Node.
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
"""
class Solution:
def levelOrder(self, root: TreeNode) -> List[List[int]]:
if not root: return []... |
fbbbce377ceba60180b1f790cae27a99f9113387 | a2ff8e0d66cedd9ae4a2029b18c974c02471c2b2 | qiumuyang/SA2021 | /video-site/client/client.py | Python | py | 3,871 | no_license | import sys
from PyQt5.QtWidgets import (
QApplication,
QMainWindow,
QTableWidget,
QTableWidgetItem,
QVBoxLayout,
QHBoxLayout,
QWidget,
QMessageBox,
QPushButton,
QFileDialog,
QInputDialog,
QLabel,
QAbstractItemView,
)
from PyQt5.QtGui import QFont
from... |
6a5f6490d4ee307fe48486cf622b7560089164c6 | e2d2bef9957caf5b581dda718dca2ac9dc127245 | havelljd/IS403Final_Project | /FinalProject/main/urls.py | Python | py | 619 | no_license | from django.urls import path
from .views import mainlogoutpageView, gameDisplayView, deletePageView, updatePageView, addPageView, indexPageView, specificgameDisplayView
urlpatterns = [
path("specificgamedisplay/", specificgameDisplayView, name= "specificgame"),
path("mainlogoutpage/", mainlogoutpageView, na... |
be2207ff6d4f17d2cde83a78cf5761972eff0751 | d8fe13858684a17154712c742c7136dbe8744f60 | Band1to/giottomultiply | /setup.py | Python | py | 472 | no_license | from setuptools import setup
setup(
name='multiply',
version='0.1.0',
description='',
long_description=open('README.md').read(),
author='',
author_email='',
url='',
packages=['multiply'],
include_package_data=True,
license='LICENSE',
classifiers=[
"Programming Langua... |
6dcc5bcd4644137f7cfda0690e55e3db5e651884 | 2e1de8fc34b706846d409af7cfc0bdea6623738a | Nevermind434/influenza-qtof | /prospective_train.py | Python | py | 3,087 | no_license | #!/usr/bin/env python
# Train and test
import sys
import os
sys.path.append('src/')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import utils
import model_selection
from models import LGBM
import plotting
import delong
import argparse
from sklearn.preprocessing import StandardScaler, MinMaxSc... |
ecf6bc8b6a4ba6deb4668b918790c5b24060a313 | 49c81c150981a9041c31f9d6e361e5aabeb91341 | rodrigopscampos/python-lp | /variaveis/ex5.py | Python | py | 226 | no_license | #Leia três números e os imprima do último para o primeiro
a = int(input("Primeiro número: "))
b = int(input("Segundo número: "))
c = int(input("Terceiro número: "))
print('Em ordem inversa:')
print(c)
print(b)
print(a) |
83da7a4dbadc63d832006820f73f0c87204fe5f5 | 1b6c6138a301d18cc223dbe96c2a12cb2a650389 | cosmosZhou/sympy | /axiom/discrete/det_block/to/mul/prod/vandermonde/st/lamda/pow/ratio.py | Python | py | 1,853 | no_license | from util import *
@apply
def apply(self):
(((j, i), (r, S[j])), (S[j], S[0], m), (S[i], S[0], d)), ((S[j], S[i]), (S[j], S[0], S[m]), (S[i], S[0], S[m - d])) = self.of(Det[BlockMatrix[Lamda[Pow * Pow], Lamda[Pow]]])
assert m > d
return Equal(self, r ** Binomial(d, 2) * (1 - r) ** (d * (m - d)) * Product[... |
c11915ebe40624cce8a9b95de5f87a07b7f39843 | e42eae58021ee55372c1eedf691be2082cab4e6e | AllisonOK/login-mgcz | /5分钟全局7.5折扣.py | Python | py | 910 | no_license | # -*- coding: UTF-8 -*-
import re
import time
import random
import requests
import json
headers = {'Host':'mall.mengguochengzhen.cn',
'Content-Type':'application/json; charset=utf-8',
'Connection':'keep-alive',
'Proxy-Connection':'keep-alive',
'Accept':'application/json',
'User-Agent':'mgcz/2.5.1 (iPhone; iOS 11.2.6; S... |
ffa530d7e29e4cfc91207bf342fdeada971695f2 | 2cb4a432fa3203db42f60b1b494d295fc4bd8a1c | ChiPowers/cinema_game | /cinema/settings.py | Python | py | 3,735 | permissive | """
Django settings for cinema project.
Generated by 'django-admin startproject' using Django 3.0.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
tr... |
a6a58f6ad96202904e01b8c5ef37f193a9e46c55 | 710d9e1b5b9576794fa67f1f9015da91131e98dd | ColonolNutty/Sims4CommunityLibrary | /Scripts/sims4communitylib/enums/common_weather_event_ids.py | Python | py | 2,857 | permissive | """
The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0).
https://creativecommons.org/licenses/by/4.0/
https://creativecommons.org/licenses/by/4.0/legalcode
Copyright (c) COLONOLNUTTY
"""
from sims4communitylib.enums.enumtypes.common_int import Co... |
1cc9952f6f44b496325e385ee8f8f6b462e1157c | db387bd234f6a11a34a2dbdcf17b3924a2915672 | 8cw/Chess-AI | /src/game.py | Python | py | 564 | permissive | import board
import moves
import chess_ai as ai
def game():
while True:
moves.board_history.append(board.chessboard)
board.printboard(board.chessboard)
moves.make_move()
moves.halfmove_checker += 1
#Checks for threefold repition
if moves.threefold_check():
... |
1838d170f6e75ef536ab04e1d955e1cf505e96ed | 22b4086d675cb0be863c6513d1b31ceef54a7deb | douwevandermeij/django-forms-builder | /forms_builder/forms/tests.py | Python | py | 6,613 | permissive | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.contrib.sites.models import Site
from django.db import IntegrityError
from django.http import HttpResponseRedirect
from django.template import Context, RequestContext, Templat... |
056344841e8544513cffcf5a2b49a757e957d379 | bf440ff438b82c834ecf2bd574555f1cbcdb3286 | Itxaka/st2 | /st2auth/st2auth/controllers/root.py | Python | py | 885 | permissive | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
7340e60d5b62c6b9a5e6da9a6e8ed4ca9525ca32 | 9fcf6d6aa595287d33c73f424216e47bb8bf34f6 | jenyf/T_06_RodriguezRamon.VegaHuaman | /vega/simple_09.py | Python | py | 362 | no_license | #progrma 09
import os
# Declaracion de variables
trabajador,renumeracion_neta_anual="",0
# INPUT via OS
trabajador=os.sys.argv[1]
renumeracion_neta_anual=int(os.sys.argv[2])
# PROCESSING
#Si la renumeracion neta anual es mayor 200
# mostrar "impuesto mensual"
if ( renumeracion_neta_anual> 200 ):
print(renumeracion... |
c861004d3122157b5f422f5040d7b2058ddbf0d0 | e13e15b48681d0aa4eab6ca3cacb3bc70429f2c3 | EFS-OpenSource/calibration-framework | /netcal/regularization/ConfidencePenalty.py | Python | py | 4,319 | permissive | # Copyright (C) 2019-2023 Ruhr West University of Applied Sciences, Bottrop, Germany
# AND e:fs TechHub GmbH, Gaimersheim, Germany
#
# This Source Code Form is subject to the terms of the Apache License 2.0
# If a copy of the APL2 was not distributed with this
# file, You can obtain one at https://www.apache.org/licens... |
8915e25dbce32c960451327dcc7dde7ae38f4e0f | 5b0913a7391fc9f6ced8d6252ae872b74287be6e | maidmentdaniel/Binary-Spiking-Neural-Network | /spnetwork/neuron/nandfbneuron.py | Python | py | 1,267 | no_license | """
Daniel Maidment
Tue Oct 22 10:48:41 2019
"""
########################################################################
import numpy as np
from spnetwork.neuron.neuron import Neuron
########################################################################
class NANDFBNeuron(Neuron):
def __init__(self, N=4):
... |
792ae42fe09c2fae440b18b0cb290cac4a136acb | a53ba599c0346e2ffb43ba4da5e297f02396df83 | Noemy166/Atividade-de-programa-ao | /atividade remota 3(4).py | Python | py | 652 | no_license | def maximo(num1, num2, num3, num4, num5):
return max(num1, num2, num3, num4, num5)
def minimo(num1, num2, num3, num4, num5):
return min(num1, num2, num3, num4, num5)
def main():
print('Insira 5 numeros: ')
num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input(... |
13ace63229a7fa9014eee346b1a614b52cdaac35 | a4d850e6ba674598c472d0a3b00baa9a1ac939e3 | gaohj/jxlg0102 | /day05/query_set_demo/front/migrations/0001_initial.py | Python | py | 701 | no_license | # Generated by Django 2.0 on 2019-06-17 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(auto_... |
24b09028bdd7440b9044f746a2076a7f7194916d | 7d1b3835b93e439f92608769f5b04661008859aa | pnave95/ORNL_public_research | /learning_from_mcvine/res_sims/Ei_125/E-113.62326251_hkl1.37589559532,-3.2036496967,-0.888382086655/run.py | Python | py | 1,138 | no_license | #!/usr/bin/env python
import mcvine.cli
from numpy import array
from mcvine_workflow.singlextal.resolution import use_res_comps as urc
beam_neutrons_path = '/SNS/users/p63/ORNL_public_research/MCViNE_Covmat_comparison/mcvine_resolution/beams/beam_125_1e9/out/neutrons'
instrument = urc.instrument('ARCS', '3.*meter', '13... |
e63036df25b301c2c525fcbedf6c4a952ff38c3f | d639a97dfbbd893a455ed186ea34ee60b87d152c | mihdalal/doodad | /doodad/launch_tools.py | Python | py | 2,854 | permissive | import os
from .arg_parse import ARGS_DATA, CLOUDPICKLE_VERSION, USE_CLOUDPICKLE, encode_args
from .mode import LOCAL, Local
from .mount import MountLocal
def launch_shell(
command,
mode=LOCAL,
dry=False,
mount_points=None,
):
if mount_points is None:
mount_points = []
mode.launch_com... |
7161839bc62b0f3a67c331d32cb7cb7f16b16204 | 6096b2c344974b3c0c019c67e90eb74c74c7f107 | farxadovich/dars | /shop/shopp/urls.py | Python | py | 371 | no_license | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('home/', views.home, name='home'),
path('', views.index, name='index'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns + static(set... |
35cdd1821c8ce3ade44c015f7786379b9c061b77 | 83607692469bd033af825861d3156a88d85df73c | adamcupial/lighthouse-python | /lighthouse/batch.py | Python | py | 988 | permissive | # Python Standard Library
from itertools import product
# Third party modules
from tqdm import tqdm
# Local imports
from .runner import LighthouseRepeatRunner
class BatchRunner(object):
def __init__(self, urls, form_factors, quiet=True,
additional_settings=None, repeats=3):
if not isin... |
13c66aec2b33400d92dd97176605fc55977728e4 | 836be748fbde2f8722b5ab5fe7f744fdec23ec06 | noodlemangos/NCSU_seniordesign | /src/data_api/entries/models.py | Python | py | 2,044 | no_license | """
.. class:: Entry
:synopsis: Model representation of a AIXPRT data entry
.. moduleauthor:: Will James
"""
from django.db import models
class Entry(models.Model):
"""
Entry class.
Args:
- **date_time** (DateTime): Date/time that data entry is created
- **workload_model** (string):... |
2348a83f1ecef98ed2d042d9709e77388c606d28 | 048be0245efb564f052841531a5b8cd46de5d132 | yuxuan2015/spacy_zh_model | /spacy/cli/converters/conllu2json.py | Python | py | 5,012 | permissive | # coding: utf8
from __future__ import unicode_literals
from .._messages import Messages
from ...compat import json_dumps, path2str
from ...util import prints
from ...gold import iob_to_biluo
import re
def conllu2json(input_path, output_path, n_sents=10, use_morphology=False):
"""
Convert conllu... |
22a2468f39e8432cdb1e2e2834e1e7323f217efe | b26f794e5d4eb025e3a89c201a393e1bf7ee2bbb | inverseTrig/leet_code | /1220_count_vowels_permutation.py | Python | py | 607 | no_license | class Solution:
def countVowelPermutation(self, n: int) -> int:
count = [1, 1, 1, 1, 1]
mod = 10 ** 9 + 7
for _ in range(1, n):
next_count = [count[1] + count[2] + count[4] % mod,
count[0] + count[2] % mod,
count[1] + count[3] %... |
60c432eb54a40c0e3757578c0da12eae55ea36db | 00005f4a70c5144076952dbbb1c77de24a5e43d7 | InternetSemLimites/PublicAPI | /InternetSemLimites/api/tests/test_edit_view.py | Python | py | 3,863 | permissive | from django.contrib.auth.models import User
from django.core import mail
from django.shortcuts import resolve_url
from django.test import TestCase
from InternetSemLimites.core.forms import ProviderForm
from InternetSemLimites.core.models import Provider, State
class TestPostValid(TestCase):
def setUp(self):
... |
499ed00a124d860d695def51763839ada8af0c3c | 60e7ac55a04186df8f4670e67586f2ecfb78825a | chenhanfang/page-object | /pageObjectwoniu/page/function/function_2.py | Python | py | 477 | no_license | from time import sleep
from pageObjectwoniu.constant_1 import CHANPIN
from pageObjectwoniu.encapsulation import UIHandle
from pageObjectwoniu.page.config.config_2 import browser_config,locat_config
def search():
driver = browser_config['chrome']()
uihandle = UIHandle(driver)
uihandle.get(CHANPIN)
sle... |
d57f86ad4dd5a0a78e9b0876ed73fdc1975d4f2f | 796983468f7acb1abcbe8f1f8372dce37959121b | xclusive43/data-science-projects | /glassdoor_scraper.py | Python | py | 8,987 | no_license | from selenium.common.exceptions import NoSuchElementException, ElementClickInterceptedException
from selenium import webdriver
import time
import pandas as pd
def get_jobs(keyword, num_jobs, verbose, path, slp_time):
'''Gathers jobs as a dataframe, scraped from Glassdoor'''
# Initializing the webdri... |
624f248d14c008a17c3c5103fa69e575d784617b | dc446ef3e65c28c901c327df70f3842ee6e921e7 | Xu-Guo/GQQLeetCode | /Stack/224_BasicCalculator.py | Python | py | 1,363 | no_license | class Solution(object):
def calculate(self, s):
"""
:type s: str
:rtype: int
"""
stk = []
isResult = False
n = len(s)
i = 0
calVal = 0
while i < n or isResult:
if not isResult:
if s[i].isdigit():
... |
7ea853ffe96775d0a69542abff718e59d3a6c37d | c430f90aa257dd4025c7e684423b9e0ca554d710 | tyronedamasceno/pyjamas | /dict.py | Python | py | 357 | no_license | """"
Exemplo de Dicionários
"""
d1 = dict()
d2 = {}
d3 = {'py': 'jamas'}
s1 = set()
# s2 = {}
s2 = {1, 2}
print('Criando um dict de pares números e seu valor ao quadrado\n')
dict_squares = {
v: v**2 for v in range(-3, 4)
}
for k, v in dict_squares.items():
print(f'{k}: {v}')
print(f'\nEste dicionário pos... |
4250ff3cc0207eed38cc902a90393f6310efc89a | 2b8e73966ccfb510cbcb765ab904e232fd2999bc | arkintof/django-learn | /website/settings.py | Python | py | 3,561 | no_license | """
Django settings for website project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... |
1ff9164eedd5c3ac5aa7d3aabe8f7437bf72041b | 78720e3b70518d31aa399afd65f5406f008a3c14 | sevikkk/valurap | /host_soft/optozero/detect_circles.py | Python | py | 1,368 | no_license | import cv2
import numpy as np
import os
param1 = np.zeros((6 * 6, 3), np.float32)
param2 = (np.mgrid[-3:3,-3:3] + 0.5).T.reshape(-1,2)
params = [param1, param2]
objp = params[0]
objp[:, :2] = params[1]
objp = 2.469438 * objp
print(objp)
objpoints = [] # 3d point in real world space
imgpoints = [] # 2d points in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.