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 |
|---|---|---|---|---|---|---|---|---|
0a7e082ded92a36f9982b7d30baf4302d30fdd64 | 4b5727233e716b3e13f4f2948eeed74f8f7bcb20 | hzh595395786/wsc_django | /wsc_django/wsc_django/apps/groupon/services.py | Python | py | 14,750 | permissive | import datetime
from django.utils.timezone import make_aware
from customer.models import Customer
from customer.services import get_customer_by_user_id_and_shop_id, create_customer
from groupon.constant import GrouponStatus, GrouponAttendStatus, GrouponAttendLineStatus
from groupon.models import Groupon, GrouponAtten... |
402c50deab1a080a851701e2ddd39cac02c25caf | 9cddfe321c1bbbca2dc7ac6bd8e95ef7b0c08e2e | davemerwin/blue-channel | /bluechannel/customers/models.py | Python | py | 1,556 | permissive | from django.forms import ModelForm
from django.db import models
from django.contrib.auth.models import User
from bluechannel.media.models import Media
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
# Create your models here.
class Customer(models.Model):
user = models.Foreign... |
38a32027e8d04735e42f43cea6fc2077fe2a4a69 | ade5de05d92d219343594fa3f1dfaf3f630bdfcc | FlorianOtel/mopidy-audioaddict | /mopidy_audioaddict/actor.py | Python | py | 6,638 | permissive | from __future__ import unicode_literals
import logging
import pykka
from mopidy import backend, exceptions, stream
from mopidy.models import Ref, Track
from . import client, translator
from mopidy.internal import http, playlists
from mopidy.audio import scan
import time
logger = logging.getLogger(__name__)
def ... |
5472a788742997b931f9bc67ca84326701fb2e80 | ba77dd8f6ec044a50ba2685a24768d1f95681017 | nickborovik/django-deployment-example | /learning_template/urls.py | Python | py | 888 | no_license | """learning_template URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.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')
C... |
201b4d05adb1c0d2a7998de83fbb7f6dea59623a | 597d246934a15040ebea5d93f862ab7f0fd4a7e1 | polvanrijn/Dallinger | /dallinger/__init__.py | Python | py | 689 | permissive | """This is Dallinger, a platform for simulating evolution with people."""
from . import (
bots,
command_line,
config,
models,
information,
nodes,
networks,
processes,
transformations,
experiment,
experiments,
heroku,
registration,
)
from .patches import patch
import... |
2a850b15c63e42d587f1086bb92158e08e9ddd56 | cbafa93c59c0495bcd3bf3f82710faf2ec8a91a0 | jeongyoonlee/birdclef-2021 | /src/util.py | Python | py | 3,195 | permissive | import os
import torch
import random
import numpy as np
import torch.nn as nn
from sklearn.metrics import f1_score
from params import NUM_CLASSES
def seed_everything(seed):
"""
Seeds basic parameters for reproductibility of results
Arguments:
seed {int} -- Number of the seed
"""
ran... |
fb94b7972c2fe1a3b5ded8ff365b864364c943a9 | edbd47a7caeba5ff3ce173db94136ece5ec1ede9 | cactorium/PyKMIP | /kmip/demos/utils.py | Python | py | 22,161 | permissive | # Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# All Rights Reserved.
#
# 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/LICEN... |
6c5d294cf945b456c46bc78a194ae4728ad7cda7 | b3bd2bff64016b7385343b3a7b93a173e8785ae6 | VishalFun/Blog_Post_Scrapping | /Site_Scrapping/middlewares.py | Python | py | 3,662 | no_license | # Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class SiteScrappingSpiderMiddlewa... |
43752a41cd8238936af0175bbc2b800c0d4c6847 | 38b73aefe0ba217bb6742e43d4d1b0ce98819a3c | Shoaib0023/Show-Weather | /Weather_app/migrations/0004_auto_20181122_1448.py | Python | py | 385 | no_license | # Generated by Django 2.1 on 2018-11-22 09:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Weather_app', '0003_auto_20181122_1443'),
]
operations = [
migrations.AlterField(
model_name='city',
name='name',
... |
9f9953f63d1b8d5368223eaa2edba354bcd3ee51 | 66c86728b39dde396ac7206247aaad4c554370a3 | Christopher-Bradshaw/learning | /phys_math/hessian/helpers.py | Python | py | 1,329 | no_license | import numpy as np
import matplotlib.pyplot as plt
def taylor_1d(a, val, der, der2):
return val + der * a + 0.5 * der2 * a**2
def taylor_2d(grid, x0, val, grad, hess):
grid = np.reshape(grid, (2, -1))
res = np.zeros_like(grid[0])
for i, a in enumerate(grid.T):
a = a - x0
res[i] = val +... |
71b0cd1161fdd7884485b81c0962d3f85a09a9a1 | dea8b74323157ab598074217afb825bdd1389307 | BlastPy/tgv | /wiki/views.py | Python | py | 1,892 | no_license | # coding: utf-8
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
from django.db import models
from wiki.models import NamePart
from wiki.models import Rozdil
from wiki.models import Stats
def index(request):
foo = []
for name_part in NamePart.objects.all():
... |
97a49ea2ce1b601b3d129ab985113baf893375d3 | f5e9f6d016dd289b2e092ed0aedd0360741da61b | mannattuli/AXIS | /main.py | Python | py | 4,970 | no_license | import csv
import random
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from nltk.stem.porter import PorterStemmer
greet_in = ('hey', 'sup', 'waddup', 'wassup', 'hi', 'hello', 'good day','ola', 'bonjour', 'nama... |
6e21535648add9e4484a140bdc35ff13ac0bbe87 | a7566182bcf892867c4f8da247bcc9e0f52f4f2c | codefish-yu/cloudNote | /note/views.py | Python | py | 2,933 | no_license | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
# Create your views here.
from django.views.decorators.cache import cache_page
from note.models import Note
from user.models import User
#检查当前用户是否登录的装饰器函数
def check_logging(fn):
def wrap(request,*args,**kwargs):
... |
64dd77d50029d8b33bbc40fedf29d8ddf49256b4 | a3ebb531ae8bd2f4fbe1f4877b3eb57f6dbeb6c7 | MaikePaetzel/minetest-agent | /agent/Rob/lua_actions.py | Python | py | 3,526 | no_license | #####################_simple_commands_############################
# executable actions for the bot object
# stops the bot from doing anything
lua_stop = """
move_obj:mine_stop()
move_obj:stop()
return true
"""
# starts the mining animation
lua_mine = """
move_obj:mine()
return true
"""
# stops the mining animation
l... |
90c99e6762e88da5c36699cac36657295c629297 | b38d52178a01b3e098464273c77013727671c5ff | wzoreck/Site-4_Django-Agenda | /contatos/models.py | Python | py | 1,229 | no_license | from django.db import models
from django.utils import timezone
class Categoria(models.Model):
nome = models.CharField(max_length=255)
# Para aparecer o atributo nome no admin ao invés do "nome" do objeto
def __str__(self):
return self.nome
class Contato(models.Model):
# Atributos de clas... |
ae7fb0dda94b0a2600c56fb6a16601492bfa25fb | 864f8e0211cc62a2ddfcb493e35137ec02949ccc | naaomimore/arky | /arky/mgmt.py | Python | py | 2,920 | permissive | # -*- encoding: utf8 -*-
# © Toons
from . import __PY3__, ArkyDict, HOME
if not __PY3__: import cfg, core
else: from . import cfg, api, core
import os, sys, json, time, atexit, logging, requests, threading, binascii, traceback, requests
logging.basicConfig(
filename = os.path.normpath(os.path.join(HOME, "."+__name... |
c23a6119ad21f0c318648862996cf0ef3e4a94fe | ad28fa83d3578423a2be3649cff3378ce17e5a9f | anonymity2204/neurips2204 | /train_chinese1_resnet20.py | Python | py | 9,439 | no_license | import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import numpy as np
import datasets
import models as models
import matplotlib.pyplot as plt
import torchvision.models as torch_m... |
18dca8cc08147e1eb4fc99d684fdf6382be31ca7 | a8fb58f62a62ecfb1026d3afa504ff67f04b6756 | davep-github/dpw | /bin/paycheck.py | Python | py | 2,797 | no_license | #!/usr/bin/env python
def calculate():
married = 1
exemptions = 3
frequency = 52
add_income = 0 # 0.96 # life insurance extra premium
pay_per_period = (87006.40 / frequency) + add_income
percent_401k = 7 #9
benefits_costs = 0 + 31.37 + 4.25
# frequency = 24
# pay_per_period = (74... |
f4e98a0f6cd99fc028ee28ce27d107a37a6e3cb5 | a1f108271c4788549eb26bedb1662c2f5292cbed | Metajake/nicemurals | /rpg/functions.py | Python | py | 777 | no_license | import random
from .models import Entity
def getRpg(thisSession):
worlds = {
'colors' : ['meteor','sunset', 'grade-grey', 'cool-blue', 'ocean', 'clear-sky', 'azure-lane', 'witching-hour'],
'size' : 'is-size-outdoors',
}
locations = {
'colors' : ['old-bubblegum', 'pomegranite', 'haz... |
085bb9abae5a3051e73d16ad4364d21e68b09721 | f11332fcaa00159ba7c71c73edb438aad5b61d3e | tbergama/hb-song-analysis | /util.py | Python | py | 537 | no_license | import csv
import os
import subprocess
def ensure_dir(fname):
d = os.path.dirname(fname)
if not os.path.exists(d):
os.makedirs(d)
def write_csv(data, fname):
ensure_dir(fname)
with open(fname, "w") as f:
writer = csv.writer(f, delimiter=',')
writer.writerows(data)
def execu... |
56971dd92772c5ee9fa80b527aa1b4ba4f35c170 | 1d8cf758355c3b44b248f9793d6d794d12c7df1c | infosecjosh/plaso | /tests/cli/helpers/filter_file.py | Python | py | 2,055 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the filter file CLI arguments helper."""
from __future__ import unicode_literals
import argparse
import unittest
from plaso.cli import tools
from plaso.cli.helpers import filter_file
from plaso.lib import errors
from tests.cli import test_lib as cli_test_li... |
1a31c363c7f771f9de7c82ba12782f58044f4a00 | c6650519777cf065046e23c282b8d193ca27d118 | Aasthaengg/IBMdataset | /Python_codes/p03732/s700747435.py | Python | py | 679 | no_license | n,W = map(int,input().split())
dp = [[[0]*(3*n+1) for _ in range(n)] for _ in range(n)]
w1,v1 = map(int,input().split())
for i in range(3*n+1):
dp[0][0][i] = v1
for i in range(1,n):
w,v = map(int,input().split())
w -= w1
for j in range(min(i+1,n)):
for k in range(3*(j+1)+1):
if j>... |
6f25ad45baff3c88550ee89cc7798bc7633e65f0 | 114345140c149e939f6d1af9c22ab7cd8d1e9570 | okipriyadi/NewSamplePython | /SamplePython/dari_buku_network_programming/Bab2_multiplexing_socket.socket/_03_chat_server_using_select_select.py | Python | py | 9,749 | no_license | """
Launching a separate thread or process per client may not be viable in any larger network
server application where several hundred or thousand clients are concurrently connected
to the server. Due to the limited available memory and host CPU power, we need a better
technique to deal with large number of clients. Fo... |
0a15dcc975d6930f118bdda70e25020002101e6e | 7ec96f7f998943619373fbef3237a55ceddf7d2f | Navneet-Kaur21/NTU_Pipe_System | /data provided/codes/Transformation_Function.py | Python | py | 1,085 | no_license | import numpy as np
def transform_point_cloud(xyz,transformation_matrix):
# xyz = np.reshape(xyz,(-1,3))
if len(xyz.shape)>1:
new_xyz = np.ones((xyz.shape[0],xyz.shape[1]+1))
new_xyz[:,:-1] = xyz
return np.matmul(new_xyz,np.transpose(transformation_matrix))[:,:-1]
else:
new_x... |
2ee07c91cdf3dd2cc375e06a1eb86cc613632c3a | 95b7c0859546f84c31ac55d09c64f8e25c4a43b5 | LABSN/tdtpy | /tdt/actxobjects/TTankInterfaces.py | Python | py | 34,923 | permissive | # -*- coding: utf-8 -*-
# Created by makepy.py version 0.5.00
# By python version 2.6.6 |EPD 6.3-2 (32-bit)| (r266:84292, Sep 20 2010, 11:26:16) [MSC v.1500 32 bit (Intel)]
# From type library 'TTankInterfaces.ocx'
# On Thu Dec 02 21:00:50 2010
"""TTankInterfaces"""
makepy_version = '0.5.00'
python_version = 0x20606f0
... |
147c73fef1f6558f97ca257140790ff7f7e736d3 | 8db7e0f467242cf7a05447baa5828f534f288ead | Erick-Pardus/Pardus | /network/p2p/rtorrent/actions.py | Python | py | 436 | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
def setup():
autotools.configure()
def build():
autotools.mak... |
aff91ad4255bfefc94fc2d6ec565b28c79d9396c | d80defb8f0a9ccf7765530962f40eecad7b31e0b | ChristineKarimi/toyProblems | /primenumber.py | Python | py | 462 | no_license | # PROBLEM 7
# ---------
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
# What is the 10 001st prime number?
# SOLUTION
# ---------
def prime_number(limit):
start = 2
prime_list=[]
while len(prime_list)<limit:
for a in range(2,start):
if start%a==0:
c... |
488b73a0a2c40adb709ec5dddc25905c73ab0197 | a2c7f4c523709a3e6393b7c2b32f5645d1188681 | alifahmed/fuzzbench | /common/benchmark_utils.py | Python | py | 4,098 | permissive | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
6c5fa3c4f4331bc6df249fcbc06f1b9cd51063b9 | 27859d1e1047552b7b44aef7b56896ff653d1a5a | flopp/running_page | /scripts/nike_sync.py | Python | py | 9,592 | permissive | import argparse
import json
import logging
import os.path
import time
from datetime import datetime
from xml.etree import ElementTree
import gpxpy.gpx
import httpx
from config import (BASE_URL, GPX_FOLDER, JSON_FILE, NIKE_CLIENT_ID,
OUTPUT_DIR, SQL_FILE, TOKEN_REFRESH_URL)
from utils import make_a... |
bfc26c5d378e0a449a7b77760cc4d2ded2676b65 | 4902ef1c4365439c06428aef22c9e8d253011c69 | Ming-blue/mindspore | /model_zoo/research/cv/centernet_resnet50_v1/src/config.py | Python | py | 8,282 | permissive | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
35628e57a2cdbe388988533f332a997de9bed7b2 | 0ea41253f6af198e1a614438b5eed72dcdfb82e5 | utisz86/ThinkLike | /13 Fejezet/fejezet13113.py | Python | py | 837 | no_license | def masol_sr(beolvas, kiir):
"""[Írj egy olyan programot, amely beolvas egy szöveges fájlt, és egy kimeneti fájlt hoz létre, amely az eredeti
fájl másolata, kivéve, hogy minden egyes sor els˝o öt oszlopa tartalmaz egy négyjegy˝u sorszámot, amelyet egy
szóköz követ. A kimeneti fájl sorszámozását 1-t˝ol kezd. Gy˝oz˝o... |
3b14b761e81a7e209b63e480cb36841630935b67 | a1150704c7964221137dfc67d2630b6c414fe034 | sujoy99/crm | /accounts/migrations/0014_auto_20200719_1710.py | Python | py | 594 | no_license | # Generated by Django 3.0.8 on 2020-07-19 11:10
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),
('accounts', '0013_auto_20... |
9bfa89c217b6af4c9b6ee151442aec3cd5f8b826 | cb19fe27ed8e2a7bd47f4cb209991bbcd4355a09 | parthi-siva/FoodMenuApp | /migrations/versions/95e8d1fe55bd_.py | Python | py | 1,347 | no_license | """empty message
Revision ID: 95e8d1fe55bd
Revises: 7a2763f0402c
Create Date: 2020-03-18 20:49:40.844321
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '95e8d1fe55bd'
down_revision = '7a2763f0402c'
branch_labels = None
depends_on = None
def upgrade():
# ... |
b226c73edbbcbb4ecab2e623ceb58dea562b324d | 3bdaa77049cf3fe7822aa18af18c2a9c1307a002 | penolove/asen | /main.py | Python | py | 18,779 | no_license | import argparse
import os
import sys
import cv2
import json
import time
import shutil
import logging
import numpy as np
from PIL import Image
from visdom import Visdom
import matplotlib.cm as cm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import trans... |
5c215c4e194c48c4aa363986e2b274cf885fbc07 | ce6df8b9382984f34810cf934b15c1f34a302e67 | shubham9768/miss_mirror | /mirengine/web_interfaces.py | Python | py | 2,270 | no_license | import datetime
import json
from datetime import datetime
from urllib.request import urlopen
import requests
def get_news():
"""
:return: news list
"""
sources = "the-times-of-india"
url1 = 'https://newsapi.org/v2/top-headlines?sources=' + sources + '&apiKey=6093aae6a87b4111a426e78... |
41d1a55305402de63a411c2701221c0ecdbaffe5 | 4510414c195db137e233c679e04c1e57a5b91c18 | jwyx3/practices | /leetcode/linked-list/delete-node-in-a-linked-list.py | Python | py | 478 | no_license | # idea: 1) copy value and remove next node
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def deleteNode(self, node):
"""
:type node: ListNode
:rtype: void Do not return a... |
113a019fcc2997439d3e994fa8d4acd74a349fee | c15a07a2393120cbfa940a2912d10da754963156 | kiwiwan/python-fcl | /example/example.py | Python | py | 2,844 | no_license | from fcl import fcl, transform
objs = [fcl.CollisionObject(fcl.Box(1.0, 2.0, 3.0)),
fcl.CollisionObject(fcl.Sphere(4.0)),
fcl.CollisionObject(fcl.Cone(5.0, 6.0))]
# Register objects to DynamicAABBTreeCollisionManager
manager = fcl.DynamicAABBTreeCollisionManager()
print "Before resgister: ", manager.s... |
9b9252022c566516e13620cbe54a851561d61699 | 83ef0c1500de7dd997090d103d8ef1e709460146 | bitprophet/releases | /setup.py | Python | py | 2,386 | permissive | #!/usr/bin/env python
from setuptools import setup
# Version info -- read without importing
_locals = {}
with open("releases/_version.py") as fp:
exec(fp.read(), None, _locals)
version = _locals["__version__"]
setup(
name="releases",
version=version,
description="A Sphinx extension for changelog mani... |
18e496a8272497e5273a91634cdbe5bf422eacd1 | 34853b21e1d96b641d111f1147fbec0bc005e91e | JakubKazimierski/PythonPortfolio | /AlgoExpert_algorithms/Easy/SelectionSort/SelectionSort.py | Python | py | 770 | no_license | '''
Selection Sort from AlgoExpert.com
January 2021 Jakub Kazimierski
'''
def selectionSort(array):
'''
Write a function that takes in an array
of integers and returns a sorted version
of that array. Use the Selection Sort algorithm
to sort the array.
'''
if all(array[inde... |
69a1a978cbf506a9aec7988b124e037c8869f6d5 | f09d7129a17f2a0c9b2e614097e00bc7c048130b | naripok/API-3.0-Python | /cieloApi3/creditCard.py | Python | py | 636 | permissive |
from .objectJSON import ObjectJSON
class CreditCard(ObjectJSON):
def __init__(self, customer_name=None, card_number=None, holder=None, expiration_date=None, security_code=None, brand=None, card_token=None, save_card=False):
self.card_number = card_number
self.holder = holder
self.expirat... |
8985403a805951ae0a984f10b5f0a40118848f3d | c591252d430b42f2446ac48dd868f7016b8db6de | LeGaulois/soc | /sources/rapports/generationRapports/rapportSolutions/tableauVulnerabilites.py | Python | py | 2,579 | no_license | #-*- coding: utf-8 -*-
def tableauVulnerabilites(dictVuln,group_by,cheminFichier='./file.tex'):
fichierLatex=open(cheminFichier,'a')
fichierLatex.write('''
\\section{Vulnerabilites}
\subsection{Liste}
Le tableau ci-dessous dresse une description détaillée des vulnerabilités présentes sur les machines.\\\\''')
... |
4439ed01f50bbebeb61a50f4c8f42b75de64a9b0 | 725ae4e3f4564c70f04a9b009633bc2863cd3261 | erlliam/new.pss | /pss/__init__.py | Python | py | 288 | no_license | from flask import Flask
def create_app():
app = Flask(__name__)
app.config.from_pyfile('config.py')
from .views import index
app.register_blueprint(index.bp, url_prefix='/')
@app.errorhandler(404)
def page_not_found(error):
return error
return app
|
4b7ef02a6e102908463e30404d3443055cc075fd | 3b31c00d15f82380b4e4b7bf54c4cee8853c9180 | WilsonIsSmelly/WilsonIsSmelly.github.io | /Portfolio/Custom Cipher.py | Python | py | 1,378 | no_license | from Wilson_Substitution import vowelsrgay, vowelsrnotgay
def scramblemeplz(plaintext):
charcount = 0
empty = ''
empty2 = ''
for i in range (len(plaintext)):
if charcount % 2 == 0 :
empty = empty + plaintext[i]
else:
empty2 = empty2 + plaintext[i]
... |
7197ad606179f1028d0d20e731a1a72ba664153e | 00e07c05314b4392b298cbf06b63a48be847916b | PGYangel/python_test | /operator/arithmetic.py | Python | py | 998 | no_license | '''
算术运算符:
以下假设变量: a=10,b=20:
运算符 描述 实例
+ 加 - 两个对象相加 a + b 输出结果 30
- 减 - 得到负数或是一个数减去另一个数 a - b 输出结果 -10
* 乘 - 两个数相乘或是返回一个被重复若干次的字符串 a * b 输出结果 200
/ 除 - x除以y ... |
f62a9c0b151e19677a60f7db7b71d84b1652b9b7 | bf4dc48fd3cd3e95f5d278db1bfef771ce4e1da9 | MighteeCactus/MayaScripts | /abToggleTransformDisplay.py | Python | py | 3,941 | no_license | #!/usr/bin/python
# encoding: utf-8
import pymel.core as pm
'''
Автор Aleksander Bykov (mightee.cactus@gmail.com)
Скрипт переключает отображение элементов из меню Display -> Transform display
Порядок такой: Local rotation -> Rotate pivot -> Scale pivot -> Selection Handle -> ничего -> и все по новой.
ИСПО... |
8a78ea21aa7ac513f714dab22e11cf900cccfd69 | a7c190399185dcbcdd659761d877d324fabcc56c | pylangstudy/201711 | /05/00/0.py | Python | py | 560 | permissive | import configparser
config = configparser.ConfigParser()
config['DEFAULT'] = {'ServerAliveInterval': '45',
'Compression': 'yes',
'CompressionLevel': '9'}
config['bitbucket.org'] = {}
config['bitbucket.org']['User'] = 'hg'
config['topsecret.server.com'] = {}
topsecret = co... |
c461b13e53c777a4d615a0ab5d6062f462213a0d | a4945721b0e2cdac1b482c35899d52a01e9e39be | MarkUsProject/Markus | /db/data/autotest_files/py/script_files/test.py | Python | py | 556 | permissive | import unittest
try:
import submission
except ImportError:
pass
class Test1(unittest.TestCase):
def test_passes(self):
"""This test should pass"""
self.assertTrue(submission.return_true())
def test_fails(self):
"""This test should fail"""
self.assertTrue(submission.re... |
adaae3e7ab03e4674665402ed0ee31dd4ae740d9 | d6d5e7435a54fd4bce4a12ac8c7cf18db4257381 | MCR-2102/Celery_Pex_detached_issue | /setup.py | Python | py | 360 | no_license |
from setuptools import setup
from pathlib import Path
package = 'app'
setup(
name = 'example_celery',
include_package_data = True,
packages = [package],
install_requires = [
'flask_bootstrap==3.3.7.1',
'gunicorn==19.9.0',
'celery==4.2.1',
],
entry_points = {
'console_scripts': [
'ex... |
66c728d5daa92ae9aec04fc95a12847618109a1c | e276484b9fdce1b1767c32bdaa15c2f4eacc2152 | adonini/gammapy | /gammapy/time/simulate.py | Python | py | 2,274 | permissive | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from astropy.time import TimeDelta
from ..utils.random import get_random_state
__all__ = ["random_times"]
def random_times(
size,
rate,
dead_time=TimeDelta(0, format="sec"),
return_diff=False,
random_state="random-seed",
):
"""Ma... |
402d1dd4b3ea6a6319a87d18765dc6a14900c0d2 | 8d59f3455e393e6b4df26efb24ec21468e5a943e | jackrdavies1/MMGame | /items.py | Python | py | 843 | no_license | item_goldgoblet = {
"id": "goldgoblet",
"name": "Gold Goblet",
"description":
"""A Golden Goblet *TODO-- """,
"mass": 0
}
item_goblet = {
"id": "goblet",
"name": "Goblet",
"description":
"A standard wooden goblet. It has split and is pretty much unusable.",
"mass": 0
}
... |
b505f5e6a70090910f694c286d55f562e06f6835 | fc196a3cad68897e4991a434521bc593eaf57d77 | mrhitman/dgma | /migrations/versions/13612d2eebe1_create_trimestr.py | Python | py | 632 | no_license | """ create trimester
Revision ID: 13612d2eebe1
Revises: 8e5882db4d85
Create Date: 2016-10-25 18:08:56.026679
"""
# revision identifiers, used by Alembic.
revision = '13612d2eebe1'
down_revision = '8e5882db4d85'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('trimester',
... |
13400aa19292696939f79ae19f69bcccd7bdf6cd | 5ece0110309e2681a1e493e1f33860e8828b69d3 | citxx/competitions | /codeforces/cr-024/B.py | Python | py | 1,498 | no_license | #!/usr/bin/env python
t = int(raw_input())
scores = [25, 18, 15, 12, 10, 8, 6, 4, 2, 1] + 50*[0]
racers = {}
class racer:
def __init__(self, name):
self.score = 0
self.places = 50*[0]
self.name = name
for k in range(t):
n = int(raw_input())
for i in range(n):
name = raw_inp... |
67497bbbf65d81d3d03eda884358a85f2866cf23 | 06c244dac31b0276647dd93b75b0f4fc3959d24a | dreispt/oca-github-bot | /src/oca_github_bot/tasks/mention_maintainer.py | Python | py | 2,280 | permissive | # Copyright 2019 Simone Rubino - Agile Business Group
# Distributed under the MIT License (http://opensource.org/licenses/MIT).
from celery.task import task
from .. import github
from ..config import switchable
from ..manifest import get_manifest, git_modified_addon_dirs, is_addon_dir
from ..process import check_call... |
c6b649481f3e11ddb8ee3ef4585eb355def58b59 | 378a973764d67688e3d195d9185aa7871d03b1b5 | darylturner/napalm-yang | /napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_global_attributes/mpls_admin_groups/__init__.py | Python | py | 10,922 | permissive |
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from decimal import Decimal
from bitarray import bitar... |
79bd5db35ad0de3361b67b1316f9442e20950eff | 8c84ee9ed8e569cac45cc2aaa678fa703ca3f282 | Deites/newsboard | /newsboard/views.py | Python | py | 2,173 | no_license | from django.http import HttpResponseRedirect
from django.views import generic
from django.urls import reverse_lazy, reverse
from django.db.models import F
from django.shortcuts import get_object_or_404
from django.contrib.auth.decorators import login_required
from .models import Post, Comment, Voted
from .forms import... |
12cda1b2bd016616dc8853aac9bfe7709a59a334 | 2d5643985ad0d4281c3e3723efbb832167c1f622 | trinhkhanh/python | /video 6/exercise2.py | Python | py | 361 | no_license | __author__ = 'trinhkhanh'
weight = float(input('weight(pound): '))
height = float(input('height(inch): '))
BMI = (weight * 0.45359237)/(height*0.0254)**2
if BMI >= 18.5:
if BMI < 25:
print('normal')
else:
if BMI == 25 and BMI < 30:
print('overweight')
else:
print(... |
5d2ff7b26fa169679716e2ee6d1429ecf2e325d9 | c20de6a91af6f1997b4d111f18d73694b25c5a64 | leelasd/clusfps | /third_party_package/RDKit_2015_03_1/rdkit/DataStructs/__init__.py | Python | py | 1,575 | permissive | # $Id$
#
# Copyright (C) 2004-2006 Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from __future__ import division
from r... |
12b8bb372141127527a96971ccd5be3d9baec96f | 98a0f6006abf244c2e91c9abe6aeabcb9524681d | MMVonnSeek/python-advanced-keylogger-crash-course | /keylogger.py | Python | py | 6,375 | no_license | # keylogger.py
# Create an Advanced Keylogger in Python - Crash Course notes
# Author: Grant Collins
# Libraries
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email import encoders
import smtplib
import socket
import platfor... |
78fd2ef0ed1985b3484a1860e09726fd3dad9041 | b4f64d216259cda4038c39b0641937843733ad6f | pietroborrello/NaiveBayesClassifier | /NaiveBayesClassifier.py | Python | py | 5,130 | no_license | #!/usr/bin/env python3
#from __future__ import division
import sys
import os
import random
import time
import itertools
import functools
import re
class NaiveBayesClassifier(object):
'''
self.vocabulary = map of all words -> num of occurrences in each class (map class->num)
self.classes = map class->prob... |
654c4b4d81feaa25c88d5edabdaab6232bc0109c | 46442afb2b1e2c16c0d5b3f890484910d647f0d3 | luabras/Estudo-matrizes | /EstudoMatrizes.py | Python | py | 5,422 | no_license | import numpy as np
#--------------------Criando matrizes--------------------
#Elementos das linhas sao separados por virgulas
#Colunas sao novos colchetes
# |2 -1|
# |0 4|
A = np.array([[2, -1], [0, 4]])
print("Matriz A:\n", A, "\n")
# |1 0 -4|
# |4 -3 2|
B = np.array([[1, 0, -4], [4, -3, 2]])
print("Matriz B:\n",... |
27b0d242fdaa01079e24f799fe89116115bda763 | 6fb4e745943740dc5ad069c1ed9406fa62f94543 | salderwe/vbfHbbShare | /toolkit/fit/src/ptNuisances.py | Python | py | 7,864 | no_license | #!/usr/bin/env python
import os,re,sys
import ROOT
from ROOT import *
from optparse import OptionParser
####################################################################################################
def PAVE(x1,y1,x2,y2,text,color):
p = TPaveText(x1,y1,x2,y2)
p.SetTextAlign(31)
p.SetBorderSize(0)
p.SetFillS... |
4d1e1f4ce4b75d6cdbd8767a90a2b2859ce890ad | 23b54463c0bdc8ea54da7690cbf04213e786a77a | sebastianrcnt/earglass | /controllers/task.py | Python | py | 1,573 | no_license | from flask import Blueprint, render_template, redirect, request, make_response, flash
import services
import system
controller = Blueprint("task", __name__)
@controller.route("/detail", methods=["GET"])
def task_detail():
user_index = int(request.cookies.get("user_index"))
user_id = services.users.get_user_by... |
dfbdfe780413f4a89bd78be8ef18baa9cd419f7d | 2421daa44a716b9fbfd4fda2beb5c677dc35d790 | seany-web/store-inventory | /dbhandler.py | Python | py | 2,061 | no_license | from peewee import *
import datetime
import csvhandler
import menu
db = SqliteDatabase('inventory.db')
class Product(Model):
product_id = AutoField(primary_key=True)
product_name = CharField(unique=True)
product_price = IntegerField()
product_quantity = IntegerField(default=0)
date_updated = Dat... |
cb0ed189ca961a1afe847135f8245c54aec1cd31 | 3009f133c7e037a84012540e7468eab22278a745 | surathjhakal/Movie-theatre-api | /theatre/urls.py | Python | py | 519 | no_license | from django.urls import path
from . import views
urlpatterns = [
# This url is used to get the index page
path('', views.index, name="index"),
path('occupy/<str:name>-<int:ticket_id>', views.occupy,
name="occupy"), # This url is used for occupying ticket
# This url is used to vacate your bo... |
02caa2e51f57e0e5e71949e277d787532e68f213 | 12600f672fdd2c0c6012e1453811c3feb8256993 | Bruck1701/LSTMCryptoAPI | /TrainLSTM.py | Python | py | 2,406 | no_license |
# coding: utf-8
import pandas as pd
from dateutil.relativedelta import relativedelta
from datetime import datetime, timedelta
import yfinance as yf
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Dropout
from sklearn.preprocessing import MinMa... |
54db8c3dce416cdb59e1e3fbf2f89b9757b3ec23 | cc9018ac848e72b743b44c31a87a97602a4898ec | pelferina/RBE-3002_FinalProject | /Lab3_ws/src/afathima_lab3/scripts/prelab.py | Python | py | 30,123 | no_license | #!/usr/bin/env python
import rospy #import rospy for ROS Node
from geometry_msgs.msg import Twist
from geometry_msgs.msg import PoseArray
from geometry_msgs.msg import Quaternion
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import PoseWithCovarianceStamped
from geometry_msgs.msg import Point
from... |
ccff78123b852d9d7e71164da8f7a18adfbf195c | cf5b4fda257ec42eb9fb643f6e2f12f97bbec17b | OswaldoCaleone/transporte_uniescolar | /app/env/Lib/site-packages/sqlalchemy/ext/mypy/apply.py | Python | py | 9,503 | permissive | # ext/mypy/apply.py
# Copyright (C) 2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
from typing import List
from typing import Optional
from typing import Union
from myp... |
d90d1dadb594b036348ea91e177de4fb85485da6 | a5efaa58fc92bbc96b069228f42ee9e383ba8b83 | josearchi15/IPC2_Proyecto2_201314386 | /main.py | Python | py | 2,815 | no_license | from cola import Cola
from maquina import Maquina
import xml.etree.ElementTree as ET
from lineaProduccion import LineaProduccion
from producto import Producto
def cleanText(text):
cleanTxt = text.replace(" ", "").replace("\n","")
return cleanTxt
maquina = Maquina("Maquina")
def constuirMaquina(file):
... |
3f12918d3b5df7d5798eb398849f14e01afa95d5 | d21ae3bd4cc5ea1941bcd81a2e8f271b49b64bdc | necrospiritus/Python-Working-Examples | /P17-Infinite Monkey Theorem/infinite_monkey_theorem.py | Python | py | 1,109 | permissive | import random
def generate_sentence():
alphabet = "abcdefghijklmnoprstuvyzqwx "
sentence = ""
i = 0
while i <= 27:
sentence = sentence + alphabet[random.randint(0, 26)]
i += 1
return sentence
def calculate_score():
sentence = generate_sentence()
correct_sentence = "methin... |
108c852dced1957be129a73d2a4c7a9c1ee55dad | 64d56bde0298e2dcc76dcc5067b08c24e12ef661 | Idein/chainer-hand-pose | /experiments/notebooks/icvl_visualizer.py | Python | py | 2,242 | permissive | # ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # ICVL dataset
# +
import os... |
ddfe9d3d3992f8acd148583e0d20c8b7e2e695e8 | f2b9181dd32c0b97b78f05d377a0acec7da88827 | aReigoto/FCChhAnalyses | /analyzers/TRFbtag.py | Python | py | 6,608 | no_license | import math
import itertools
#############################################
# example usage :
# ----------------
# weight_1tagex=0.
# weight_2tagex=0.
# ipdg=0
# jet=[]
# if (len(jets_pf04)>1):
# for i in range(len(jets_pf04)):
# ipdg = jets_pf04_pdg[i].flavour
# jet.append([jets_pf04[i],ipdg])
# weight_1ta... |
c2fb1c3ec6c453fee47ce4c34e03fe946296ca0f | 259cd1461a2e52b1efbed3467e8ca7f600359f8c | KyleMMoore/Snabe | /Score.py | Python | py | 3,045 | no_license | import pygame
from Timer import Timer
from global_toolbox import GlobalSettings
class Score(Timer):
def __init__(self, screen, int, side):
self.screen = screen
self.screen_rect = screen.get_rect()
leftDigit_loc = [0, GlobalSettings().play_area_height + -10]
rightDigit_loc = [0, Gl... |
0b584f97eb03f2b6aa1f858c231a05ffe843bf6b | 2ff08c3097b8ea0486a95de966fbf9212802545e | danhdoan/vnpy | /vnpy/app/cta_strategy/template.py | Python | py | 12,014 | permissive | """"""
from abc import ABC
from copy import copy
from typing import Any, Callable
from vnpy.trader.constant import Interval, Direction, Offset
from vnpy.trader.object import BarData, TickData, OrderData, TradeData
from vnpy.trader.utility import virtual
from .base import StopOrder, EngineType
class CtaTemplate(ABC)... |
675ee46eb018cbb1061a48152323a4cc310a9e4d | 717f29b1ce8189ef8b12beeced15180f6e645a6c | GoareguerLucas/GAN-SDPC | /W16_dcgan_boost/scan_params2.py | Python | py | 984 | no_license | import sys
sys.path.append("../")
from utils import *
"""
Script à utiliser pour lancer un modèle avec différent paramètres à la suite, avec gestion des résultats dans tensorboard.
Remplir la variables exp_name avec le nom de l'expérience et le dictionnaire params avec les paramètres à tester pour
keys et leurs vale... |
f5b649000f5074b9097dd33fb67b8a99e9eb3c74 | 4bd6b64697b0ccbe464eb7e2615a607aacd8653f | suman98/TechDiscussion | /myapp/migrations/0007_auto_20190410_2027.py | Python | py | 398 | no_license | # Generated by Django 2.2 on 2019-04-10 20:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapp', '0006_auto_20190410_2023'),
]
operations = [
migrations.AlterField(
model_name='question',
name='question_img'... |
2cf32d80e4f5362f0513cbf1e6e1f23b7c1db83c | 834b24919a37c0442a237b16f7e15e93e303e02f | zhouyswo/tf-neural-network | /baseCnnModel/custom/modelpkg/architectures/densenet.py | Python | py | 3,117 | no_license | import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.training import moving_averages
import baseCnnModel.custom.modelpkg.architectures.common as common
import math
def inference(x, depth, num_output, wd, is_training, transfer_mode= False):
stages= []
K=32
if de... |
984f7bf921601b57f8a8e2ceb006cfe513ba3f77 | 7277d2fbb7f0ed67a5ca69ad2e869839ec1f078b | Ahmadam37/Saudidevorg1 | /venv/Scripts/easy_install-3.7-script.py | Python | py | 458 | no_license | #!C:\Users\admin\PycharmProjects\Python1\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install-3.7'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw... |
a612ed150fa48acd2748278591bec227fb9c97b9 | 3cd5e104136017d32538cfa68d432d0796c5476a | chiahsun/problem_solving | /LeetCode/3. Longest Substring Without Repeating Characters/solve1.py | Python | py | 322 | no_license | class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
begin, d, res = 0, defaultdict(int), 0
for i, c in enumerate(s):
d[c] += 1
while d[c] == 2:
d[s[begin]] -= 1
begin += 1
res = max(res, i-begin+1)
return res... |
0f5893adfeac74ee8f3a9ad7ad8cf189a44eee21 | 547c3f0049eae2d5e667d1b4c00071b3b8d57a8f | molpako/effective-python | /2/16_return_generator.py | Python | py | 702 | no_license | def index_words(text):
"""
文字列で全ての単語の位置の添字を見つける
"""
result = []
if text:
result.append(0)
for index, letter in enumerate(text):
if letter == ' ':
result.append(index + 1)
return result
address = 'Four score and seven years ago...'
result = index_... |
a8ceb08219316389cc570fd9e8517354eae453c7 | 07b2bba7be05046e2b8d0be4574b42fa023930b9 | xpingli/DradRNAseq_review | /lenPlot.py | Python | py | 2,115 | no_license | import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
def lenArray(contig_dict):
"""
contig_dict: a dictionary object from ContigLen()
returns a plot showing the distribution of the contigs
"""
length = []
for v in contig_dict.values():
length.append(v)
leng... |
8c7aaf516e388e4072951ee7482290d2e3f59ed5 | b34f9d41a771cdcf79c1092c98f88dd0afdb002e | qingliudao/xcrawler | /tests/test_extensions.py | Python | py | 4,042 | permissive | """
test_extensions
~~~~~~~~~~~~~~
:copyright: (c) 2017 by 0xE8551CCB.
:license: MIT, see LICENSE for more details.
"""
from xcrawler.extensions.default_useragent import DefaultUserAgentExtension
from xcrawler.extensions.default_filter import DefaultRequestFilterExtension
from xcrawler.extensions.... |
d60d91d5ddb07d91d7afa96c6a28f18f3c4385ca | 731142c227da18c3a0da524e00b5cb27bc94ab0e | SEL-Columbia/dsm | /smartAllocate.py | Python | py | 6,023 | no_license | import subfunctions_smartAllocate as sf
import pandas as p
import numpy as np
import scipy.io as spio
import datetime as dt
import matplotlib.pyplot as plt
## load in mat weather data
mat = spio.loadmat('resourceSolTim1.mat')
data = mat['MaliNTS']
## create dates from weather data using 'list comprehension'
dates = ... |
9be0f58375c8cc318cab93e076f6a69d7ccaa21e | e222b1b2e5f1b05b26cc6dd0f639789c0256c1d6 | Redoxfox/python_algoritmos | /ejercicios/esferas.py | Python | py | 2,154 | no_license | from vpython import *
# Creacion de esferas
sphere(pos = vec(0, -1, 0), radius=0.5, color=color.blue)
# Creacion de flechas
arrow(pos = vec(0, -1, 0), axis=vec(+1, -1, 0), color=color.blue)
# Asinacion de objetos a variables
particula1 = sphere(pos=vec(3, -1, 0), radius=0.5, color=color.green)
particula2 = sphere(pos=... |
9c98666de3eda9883210874c9e811df5cdfc562b | b70196539b436661eb809cc11e4b427601c0f30a | glebliutsko/sporofi | /sporofi/utils.py | Python | py | 329 | no_license | import typing
def get_all_page(func: typing.Callable, limit=50, *args, **kwargs):
offset = 0
while True:
page = func(*args, **kwargs, offset=offset, limit=limit)
if len(page['items']) != 0:
yield page['items']
offset += limit
if page['total'] <= offset:
... |
217e20b8cdd6d7a647fd5d74a2356a426816ba7c | 4b017038618ccfed76e10f48788cfb401b1ec0e6 | AzzamAlsharafi/QuranDownloader | /downlod_quran.py | Python | py | 3,423 | no_license | import os
import requests
import sys
print("Loading languages...\n")
response = requests.get("http://mp3quran.net/api/get_json.php")
data = response.json()["language"]
def get_formatted_lang(i):
# Remove the underscore, and capitalize the first letter. (Original format: _arabic)
lang_name = data... |
e344d87b552483499dce8d063f523377560ad552 | 888e00347c41e8037cbf94375d02c550036c0cd5 | iDataist/Data-Ingestion-with-Kafka-and-Kafka-Streaming | /producers/models/weather.py | Python | py | 2,787 | permissive | """Methods pertaining to weather data"""
from enum import IntEnum
import json
import logging
from pathlib import Path
import random
import requests
from models.producer import Producer
logger = logging.getLogger(__name__)
class Weather(Producer):
"""Defines a simulated weather model"""
status = IntEnum(
... |
1588013f06ac8e2ccc7562dd0e7868875d358e7f | 81a21adbf611641ca1a183104c7a71014a153768 | alexei379/CarND-Advanced-Lane-Lines | /Line.py | Python | py | 2,748 | no_license | from collections import deque
import numpy as np
import itertools
class Line:
avg_over_last_n = 5
avg_over_last_n_weights = list(range(1, avg_over_last_n + 1))
max_base_x_shift = 100
min_curve_radius_m = 500
def __init__(self):
#x values for detected line pixels
self.allx = None
... |
abde401fd14a1d52023d4309e29963a0c0b6b421 | 24d81232cbfdef827675283d06a7690c349738f6 | GIScience/openelevationservice | /openelevationservice/server/config.py | Python | py | 1,128 | permissive | # -*- coding: utf-8 -*-
from openelevationservice import SETTINGS
class BaseConfig(object):
"""Base configuration."""
# SECRET_KEY = 'my_precious'
WTF_CSRF_ENABLED = True
DEBUG_TB_ENABLED = False
DEBUG_TB_INTERCEPT_REDIRECTS = False
class ProductionConfig(BaseConfig):
"""Production configur... |
e52482615560ee1b3cd36e56762243fe0362ae79 | 592ff40d76d79d2ef3cc1ec0b702325c064cbc3c | UMCSLimit/Led | /ledserver/manage.py | Python | py | 629 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'LEDDjango.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... |
fe1d5bf3370abee63820acc506a3262b70014c30 | 58235e8509f156e69c9a43a7e59d748c76e1c088 | Fr4nc3/code-hints | /python/challenges/my_magic.py | Python | py | 1,210 | no_license | import sys
def magic_number(n, max):
n_str = str(n) # convert number in string (list)
n_list = list(map(int, n_str)) # list of integer
n_l_temp= list(map(int, n_str)) # list of integer temp copy
init = 0 #init value
valid = []
total = len(n_list)
for t in range(total):
e = n_l_te... |
8cdfadd22019de01c1681f1a7ef3d9aefbcefb70 | 688d9ab37e86bbee7ef3fb08f3c54ed4ac5afeec | Robomate/speechballa | /inference_ctc_eri_04.py | Python | py | 17,938 | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
#=======================================================================
#Purpose: Classification with a RNN-CTC Network
#
#Model: RNN architectures
#
#Inputs: MFCCs
#
#Output: 28 Classes (characters)
#Version: 11/2017 Roboball (MattK.)
#Link: Mfcc: https://github.c... |
c29eb4f4a600451f9f96bfc1861e86a4a4c39fa0 | c5e585ce22dfe09357afbf8ced6af59f4176a1aa | benningtonlee7/domain_adaptation_robustness | /experiments/svhn_mnist/svhn_mnist_dann_robust.py | Python | py | 1,804 | no_license | from models.models import Encoder, Classifier, Discriminator
from datasets.datasets import get_svhn, get_mnist
from core.train import train_dann
from core.eval import eval_tgt_robust
from utils.utils import init_random_seed, model_init
import params
def main():
# init random seed
init_random_seed(params.manua... |
d49471e973eee55263a709345804455b03c89235 | 926b29f761f53509c7602cb82de6b62284265922 | kohsmic8/test11 | /test11/wsgi.py | Python | py | 389 | no_license | """
WSGI config for test11 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.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... |
b722f14459c0e688c874560618eb86b85e565fea | 716cd1eda498bf6836e3e79bf1b2a395b192dc22 | sattree/gap | /models/utils.py | Python | py | 9,874 | permissive | from IPython.core.display import display, HTML
import logging
import time
from attrdict import AttrDict
import spacy
from allennlp.predictors.predictor import Predictor
from allennlp.models.archival import load_archive
import neuralcoref
from .base.utils import CoreNLPServer
from nltk.parse.corenlp import CoreNLPP... |
d0b6d70f714d212c95abf49283b4bbdb74226d1a | 2c13d157d54fd134bcc51e39618d1b0a59baec0b | dlax/pytype | /pytype/abstract.py | Python | py | 145,273 | permissive | """The abstract values used by vm.py.
This file contains AtomicAbstractValue and its subclasses. Mixins such as Class
are in mixin.py, and other abstract logic is in abstract_utils.py.
"""
# Because pytype takes too long:
# pytype: skip-file
# Because of false positives:
# pylint: disable=unpacking-non-sequence
# py... |
57ea6a0fa5ac57f1900ee23540c5b18a7c7cd531 | 41164bad4d0e80dfc9a46bfa5962d60c9bc45f53 | jordancaraballo/wolffia | /interface/main/Drawer.py | Python | py | 6,976 | no_license | # -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# NanoCadState.py
# Version 0.5, November, 2011
#
# Wolffia Drawer
#
"""
Copyright 2011, 2012: José O. Sotero Esteva, Carlos J. Cortés Martínez,
Computational Science Group, Department of Mathematics,
... |
13edd9a7ba0d8d752792e7294649f8c720d22182 | 9ed97b4650050a9c95cb10f368e7217906a0b912 | Klutix/Foobar-Hunter-Bot | /ProgrammingTerms.py | Python | py | 1,316 | no_license | import random
def GeneratePhrase(KeywordQuanity):
KeywordsA = ['Python','Javascript','Haskell','C#','C++','java','CSharp','kotlin']
KeywordsB =['permutate','mutex','monad','lamda','api','service APIs','stack','dictionary','functions','reverse','algorithm','branch list','database connection'
... |
e7a1916e24ebdb0615f77deca202d559ba28c890 | 5577087169ba3c1f0aa66702a0cca716ec89fe90 | enordlund/CS325 | /Homework 5/hw5p5.py | Python | py | 8,024 | no_license | #!/usr/bin/python
from collections import namedtuple
import sys
# wrestler type for code clarity
Wrestler = namedtuple("Wrestler", "name isBabyface unresolvedRivalryIndices")
Rivalry = namedtuple("Rivalry", "rival1 rival2")
wrestlers = []
wrestlerIndexFromName = dict()
rivalries = []
unresolvedRivalryIndices =... |
b5cfc6458f323f63942cf6ae6d0af5bc964fffb1 | 790c9d38e8ea30dbdc342dc03c7148f7338409ac | SaiRanaTS/OSC_Test_Realtime | /Path_Planner_Support_Files/Original_APF.py | Python | py | 5,773 | no_license |
import math
import random
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
import time
class Vector2d():
def __init__(self, x, y):
self.deltaX = x
self.deltaY = y
self.length = -1
self.direction = [0, 0]
self.vector2d_share()
def vector2d_s... |
61651e28a301149055ef85f605536c0a816d4745 | 850a8ae447f966f37f1d024386c332fe85bce4e0 | teeeeeeemo/python-ml-dl-study | /src/ch3/csv-read.py | Python | py | 247 | no_license | import codecs
filename = "list-euckr.csv"
csv = codecs.open(filename, "r", "euc_kr").read()
data = []
rows = csv.split("\n")
for row in rows:
if row == "": continue
cells = row.split(",")
data.append(cells)
for c in data:
print(c[1], c[2])
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.