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
538fcc8b185c37e3f27fc2669698c730a2f4a3fb
bb0044798037e344c0c8a01ce5a59495b481a79f
LeoMatiass/Leo-matias-poo-python-ifce-p7
/Atividades[Avaliação] - Etapa 2/AV-06 API-Nota Fiscal-Router/model/notafiscal.py
Python
py
3,495
no_license
""" Módulo notafiscal - Classe NotaFiscal - Atributos : id - informado. codigo - informado. data - informado. cliente - informado. itens - informado valornota - calculado. """ import datetime from Atividade_06....
a284ec5a26f751400c10411ca876b3b3dacc668b
e3d029ecaf573f6ca1c6fc8e820e2d870ea94b6d
marcelovieiratecnologia/mvtec
/mvtec/urls.py
Python
py
1,559
no_license
"""mvtec URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based v...
bd46cbc1af5f89f1705136ada07b1a7a1fa46a63
c8313185b423b73dbf672752c5a0b3747095637e
DIMELOLOCO/my-first-blog
/mysite/mysite/settings.py
Python
py
3,216
no_license
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.10.7. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
4ce730216b22228b60d4c304f5544891bbbf8957
44913fb435bfe76eae11aa69570ce6e395965934
Oleksandr015/Python-podstawy
/Day_10_MOCKI/exercise_9_tdd_is_prime_number/is_prime_number.py
Python
py
863
no_license
""" IS PRIME NUMBER To zadanie ma imitować programowanie przy użyciu TDD. W pliku test_is_prime_number.py znajdują się testy dla funkcji is_prime_number(number). Na podstawie tych testów należy stworzyć ciało funkcji is_prime_number(number). Specyfikację należy odczytać z testów. Wskazówka: Prime number (liczba pier...
9f0d45ddf87002bf5d6134982e14bd171c282262
4c98182c89a469fd9148ef8448904eca5ea0914e
AldarisX/DDNS-PY
/main.py
Python
py
2,703
no_license
import json import time from util import ip from util import record from config import Config from aliyunsdkcore.acs_exception.exceptions import ServerException def ctrol(): try: rip = ip.get_ip() # 要求的域名,将DomainName作为key domainDict = {} # 读取配置文件 dnList = Config().get_rec...
54a6c64a3b91a76b7c47f8db188f819bcf9e110b
0b398a45d43738117699f372a34604ea94de4d8c
carsonmcdonald/glacier-cmd
/glaciercmd/gcconfig.py
Python
py
1,117
permissive
import logging import os from ConfigParser import SafeConfigParser from ConfigParser import NoOptionError from ConfigParser import NoSectionError class GCConfig(SafeConfigParser): _error_messages = [] def __init__(self): SafeConfigParser.__init__(self) conf_file = os.path.expanduser('~/.glaciercmd') ...
1ef1cee70752345107edc2cba99fbaf61e5def43
1c89e08c17fc694d4b3c8a83dc35414f08ce41a0
jrockway/tichu-tournament
/python/openpyxl/reader/strings.py
Python
py
708
permissive
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl from openpyxl.cell.text import Text from openpyxl.utils.indexed_list import IndexedList from openpyxl.xml.functions import iterparse from openpyxl.xml.constants import SHEET_MAIN_NS from .worksheet import _get_xml_iter def read_string_table(...
5619a869f66699af5456c38b13bade5a8f524cd2
c7f365def959ad66625955ec2c62c4f0b505e23c
sharad-saurav/mPhasePython
/uploadFile.py
Python
py
1,980
no_license
#Rule 23 - Check for Reference link for each entity and Ref URLs should not be there in Text. def import_csvfile(file): import pandas as pd import pymongo import json import os from datetime import datetime import dateutil.parser as parser mng_client = pymongo.MongoClient('mongodb://mPhase:...
6e1f71982bcc30a39f5435187a26c1a43b877425
32d2d93b2a40f8b83d3a07264898a89342ef582d
MSyvaeri/DDPG-continuous-control-Udacity
/model.py
Python
py
1,530
no_license
#!/usr/bin/env python # coding: utf-8 # In[1]: import torch import torch.nn as nn import torch.nn.functional as F #### Implemenation of a Duelling architecture class Actor(nn.Module): def __init__(self, state_size, action_size, seed, size_1=64, size_2=64, size_3=64): super(Actor, self).__ini...
acdd31039f6da07c61ebbc7befddac0c71d089b2
194fc2d8259044df583bc1f79e6ef279b5ce6a0b
wzdnzd/leetcode
/python3/0094.二叉树的中序遍历-非递归.py
Python
py
656
permissive
# # @lc app=leetcode.cn id=94 lang=python3 # # [94] 二叉树的中序遍历 # # @lc code=start # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def inorderTraversal(self...
2bfb56f6348e4bb96672238de62164659f751692
aff2462d9a3fef125cc666740daaaa9a8a4b9bc2
brobzilla/ladyluck
/xwingmetadata.py
Python
py
7,794
no_license
__author__ = 'lhayhurst' ships = { 'X-Wing': ('Wedge Antilles', 'Luke Skywalker', 'Wes Janson', 'Jek Porkins', 'Red Squadron Pilot', 'Garven Dreis', 'R...
34f5f32822d5e13a6811383193b7daf52e4944af
1383f0560914130842a7d3c106242c0c38bc6245
spacetelescope/stsdas_stripped
/stsdas/pkg/hst_calib/nicmos/rnlincor_iraf.py
Python
py
1,087
permissive
from __future__ import print_function import iraf import os no = iraf.no yes = iraf.yes from nictools import rnlincor # Point to default parameter file for task _parfile = 'nicmos$rnlincor.par' _taskname = 'rnlincor' ###### # Set up Python IRAF interface here ###### def rnlincor_iraf(input,output,nozpcorr): #...
a4a9e2137a511231716e141c49a4f26658235368
7a7ab04f6433745514a3ef9843e2218012cef844
yutoshi104/news_autoread
/nikkei.py
Python
py
5,705
permissive
from time import sleep from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys import datetime import os import shutil from gtts import gTTS from playsound import playsound import etc # 定数 EMAIL ...
56343d9c28f1268af84607f5ff39bbb6f06bdfc5
e2d8f57151877e34069185a7b59af802b3bc5e74
AlviseDeFaveri/heuristics
/particle-swarm/tsp_pso.py
Python
py
893
no_license
class velocity: def __init__(self, permlist): self.permutations = permlist def __add__(self, v2): v = self.copy() v.append(v2) return v def __mul__(self, coeff): v = self.copy() n = len(self.permutations) while len(v.permutations) < coeff*n: ...
c689c71bfe690b7fd4e09470006bd66e3791bca6
87c00d632060c294d6cc88a7cae4456283bcf7c7
anisha7025/python_Project
/scrapypro/scrapypro/items.py
Python
py
237
no_license
# Define here the models for your scraped items # # See documentation in: # https://docs.scrapy.org/en/latest/topics/items.html import scrapy class ScrapyproItem(scrapy.Item): # define the fields for your item here like: pass
cebe268ee73141525f1f1715858883dae9cef027
c391fc9a8a096e1040ade863ff72a1f95ec52413
bhaskar39/DjangoSample
/kishore/urls.py
Python
py
857
no_license
"""kishore URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
ed1bac7d39a5d046d87979e48006e4d6b590ad5c
86a607be7014ff7301b2f8097acf1b5a1bbb6484
Aasthaengg/IBMdataset
/Python_codes/p03804/s244723357.py
Python
py
549
no_license
N, M = map(int, input().split()) A = [list(input()) for i in range(N)] B = [list(input()) for i in range(M)] ans = False for i in range(N-M+1): for j in range(N-M+1): flag = True for k in range(M): for l in range(M): if A[i+k][j+l] == B[k][l]: continue...
3720fbeb94365d783e3bbff878a8fb134d9138f6
c1a928c9e8d3acf2a527982da5da4178c477e615
helenabyte/cuddly_pyme
/ex_05_02.py
Python
py
415
no_license
largest = None smallest = None while True: num = input("Enter a number") if num == "done": break try: fnum = int(num) except: print("Invalid input") continue if largest is None or fnum>largest: largest = fnum elif smallest is None or fnum<smal...
37cb2468f6490b83c4a52872cd9980a8c140336b
a442b17ba70774fc0907d36f2341825c890dd933
garciadelcastillo/DynamoCompas
/package/DynamoCompas/bin/compas/cad/rhino/conduits/lines.py
Python
py
3,110
no_license
from compas.cad.rhino.conduits import Conduit try: from Rhino.Geometry import Point3d from Rhino.Geometry import Line from System.Collections.Generic import List from System.Drawing.Color import FromArgb except ImportError: import platform if platform.python_implementation() == 'IronPython': ...
438f312a6b2ba8bac230c2b2ca802d05de90d6f5
22d6d8965877a41275e89796e0cff5a67a27d08f
HappyFox/2012_basket_ball_robot
/ut_tests.py
Python
py
3,125
no_license
import unittest import mock import drive def seq(start, stop, step=1): n = int(round((stop - start)/float(step))) if n > 1: return([start + step*i for i in range(n+1)]) else: return([]) class TestDrive(unittest.TestCase): def setUp(self): self.robot_drive = mock.RobotDrive...
bf9be0326e8d9d4adb530849d6c34a2e60025530
e0cd874a71b43217531855925d849c74d373f741
chenfsu/ML_windstress
/NN_For_Windstress/AI/models/modelBuilder1D.py
Python
py
1,545
no_license
from tensorflow.keras.layers import * from tensorflow.keras.models import Model def single_multlayer_perceptron(input, number_hidden_layers, cells_per_hidden_layer, output_layer_size, batch_norm=False, dropout=False, activation_hidden='relu', ...
d4ec34614a2c712a0aaddbbb16e5b7b4fb8f18d5
efc937ca38e9d12950c99ca591ec622536183652
brutchjd/20-Exam3Practice
/src/m6_loops_within_loops_printing.py
Python
py
3,493
permissive
""" PRACTICE Exam 3. This problem provides practice at: *** LOOPS WITHIN LOOPS in PRINTING-TO-CONSOLE problems. *** Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher, Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues, and Jared Brutcher. """ # DONE: 1. PUT YOUR NAME IN T...
d5edc86ce02779504f07dc9f0b5ad4d8b121b55d
a3eef3bf68e49836ed63b0898b5d04b2d895c977
ashishrpandey/project
/ec2django/settings.py
Python
py
3,218
no_license
""" Django settings for ec2django project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
85cca4d2ac79aa2a952761885b725101ba4c62e8
d0befccd37a3bf08ba6389ab9893c6f77b065458
dittoslash/RPGBot
/files.py
Python
py
6,341
no_license
import json import os import core from core import Parsing from core import GET def dict_to_obj(data, obj): for name, key in data.items(): if isinstance(key, (list, tuple)): setattr(obj, name, [x.copy() if isinstance(x, dict) else x for x in key].copy()) else: setattr(obj, ...
c2cde6ef2ad6efcb40bc74f55b1679c3d46eb823
b54c629969e7ad3b8ecdc046f858ccfa3deb0333
nannany/python
/src/atCoder/grand_contest_014/a.py
Python
py
412
no_license
def exchange(_A, _B, _C, _count): if _A % 2 == 1 or _B % 2 == 1 or _C % 2 == 1: return _count _count += 1 tmp1 = _A / 2 tmp2 = _B / 2 tmp3 = _C / 2 return exchange(tmp2 + tmp3, tmp1 + tmp3, tmp1 + tmp2, _count) A, B, C = list(map(int, input().split())) if A % 2 == 0 and A == B and B =...
e2260e8beadb8afa5344207d921e22c8cfad3bfe
d22dfa34e9136831c3e86d037200053f3200fcef
OwenFeik/algo2019
/fractals/mandelsplore.py
Python
py
2,867
no_license
# Owen Feik, 12K # Program uses pygame # Run "python -m pip install pygame" or "pip install pygame" before use # Then run mandelsplore.py <depth> eg "python mandelsplore.py 100" to run mandelbrot up to 100 times import pygame import time # Update loading bar at intervals import sys # Input depth def loadin...
2693bd02605121547ab0be15f1ab714eaedaef90
1b1e6f1b05d6e4b51e524b518150774822b4d0ed
Huayuehu/sw-design-and-optimization
/lab/lab2/tester.py
Python
py
730
no_license
import random import subprocess import math f = open("result.txt", 'w') def cross_entropy(Zcomputed, Zblackbox): print("<", end = "", file = f) result1 = Zcomputed * math.log(Zblackbox, 2) print(result1, end = "", file = f) print("> <", end = "", file = f) result2 = Zblackbox * math.log(Zcomputed, 2) print(resu...
c97546536899de2e6f367e52c81144ffa8586086
bc814d4b6a2f3f22f3aa22b2e2e7b038fa0eb2c5
vishen/django-cachalot
/cachalot/tests.py
Python
py
44,763
no_license
# coding: utf-8 from __future__ import unicode_literals try: from unittest import skip except ImportError: # For Python 2.6 from unittest2 import skip import datetime from django.conf import settings from django.contrib.auth.models import User, Permission, Group from django.core.exceptions import MultipleObje...
f4355afb032c309abe5a5cf84989c1a81749878a
4533625da56fcf1e86502bfae0688baeedc50ec7
Quandela/Perceval
/perceval/backends/_clifford2017.py
Python
py
3,477
permissive
# MIT License # # Copyright (c) 2022 Quandela # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pub...
0e62015384e5185a18ed0804d56d4814b192c0fb
51cc3eacae284434a71974e02106bdf09ea9b491
datapythonista/pandas
/pandas/io/sql.py
Python
py
85,482
permissive
""" Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from __future__ import annotations from abc import ( ABC, abstractmethod, ) from contextlib import ( ExitStack, contextmanager, ) from datetime import ( date, date...
ae0b55c30c0f7b93f5d042be225516a731c3fe65
3a34c3c03347fdf74f5d1dab13767cb6f06308c3
norrismei/bgvillage_marketplace
/helper.py
Python
py
3,405
no_license
import requests import crud import model import rec_helper import format_helper from flask_sqlalchemy import SQLAlchemy def get_user_own_games(username): """Returns list of user's own games as dictionary, including its sell status""" own_games = crud.get_user_current_own_games(username) results = []...
849bfd349dd7c06f2768ee20244b56ab036b3cf2
33576578f99850c5a1f2b40c3418d9356d45a3a7
Kairakvo/Tentpole
/code/blog/utils.py
Python
py
681
no_license
#import plotly.express as xp import base64 from io import BytesIO def get_graph(): buffer = BytesIO() #plt.savefig(buffer, format='png') buffer.seek(0) image_png = buffer.getvalue() graph = base64.b64encode(image_png) graph = graph.decode('utf-8') buffer.close() return graph...
8eab83ff6065690fd27668221288fa8903b5adcb
1f16a236966efc50096942b2e7ec9954982b61c0
adrinerandrade/inteligencia-artificial
/knn/demoD3.py
Python
py
1,274
no_license
# Adriner Maranho de Andrade # Fabio Luiz Fischer # Jorge Guilherme Kohn from execution import execute_scenario print('Dados já normalizados') execute_scenario('grupoDados3', 1, True, True) execute_scenario('grupoDados3', 7) execute_scenario('grupoDados3', 26) # ------------------------------------------------------...
5923f55d79e58a721a7ea756af68f8a673f22f64
e0d3e35c97824a4735473333eb0cf1ce97204d63
kevinjwalters/circuitpython-examples
/pico/pmsensors-adafruitio.py
Python
py
12,106
permissive
### pmsensors-adafruitio v1.2 ### Send values from Plantower PMS5003, Sensirion SPS-30 and Omron B5W LD0101 to Adafruit IO ### Tested with Maker Pi PICO using CircuitPython 7.0.0 ### and ESP-01S using Cytron's firmware 2.2.0.0 ### copy this file to Maker Pi Pico as code.py ### MIT License ### Copyright (c) 2021 Kev...
0db664e03837ca1785ab8f1ace0879c99f310067
4835228830759a4be7701fd71523144cdd9a9ed7
ShabbirHasan1/PredictOptionPrices
/NSEpy with backtrader.py
Python
py
2,482
no_license
#https://swapniljariwala.github.io/2017/11/03/NSEPy-with-backtrader.html #%matplotlib inline from datetime import date import pandas as pd from nsepy import get_history from nsepy import get_index_pe_history try: nifty = pd.read_csv('data/nifty17years_withPE.csv') print('Read from disk successful') e...
2980789faa1fa4bac035a76f0c19d47dc60c5f35
4dc36031c57f8f7049f65a5c918a25463ccb9469
Dengsgithub/derain_for_UAV
/config/show.py
Python
py
3,103
no_license
import os import sys import cv2 import argparse import numpy as np import itertools import time import torch from torch import nn from torch.nn import DataParallel from torch.optim import Adam from torch.autograd import Variable from torch.utils.data import DataLoader from collections import Counter from dataset impor...
73c17bcbd725ac358888856c29afeb951aea6f44
3bccefc7c0296f59358d364cf36d714d146d18d2
junxdev/this-is-coding-test-with-python-by-ndb
/part-02/ch-03-greedy/03-3-1.py
Python
py
283
no_license
# 행, 열 입력 n, m = map(int, input().split()) # 데이터 입력 tu = [] for _ in range(n): temp = list(map(int, input().split())) tu.append(temp) # 데이터 정렬 x = [] for i in range(n): tu[i].sort() x.append(tu[i][0]) x.sort() # 출력 print(x[n - 1])
e5691e6f7078a0fbeb9e5b4dacd723d3aa75fc6c
d9686bfd0b152cbb98750aba2029015ad10feb87
bear718/6_Web_server
/server.py
Python
py
3,905
no_license
import socket from settings import Settings import threading import datetime import os # Функция обрабатывающая запрос def request(conn, addr, data, directory): # Получение инфы от клиента msg = data.decode() print(msg) # Получаем имя файла, который отправим клиенту name = msg.split...
dcf1f53f8215257d6efcbf91e5010a1a0624cec5
665e134fd3f76932bb5ddd05f0c33f2326cfb00f
siyanhu/crowdsourcing
/crowd/A1_device_calibration/CommonUtil.py
Python
py
1,176
no_license
from Position import * from Target import * class CommonUtil: def __init__(self): return @staticmethod def formatTarget(rawTarget, apidMap): tInfoMap = {} for bssid in rawTarget: if int(bssid, 16) not in apidMap.bssid2Apid: continue tInfoMap[...
c0703e5e58d7a35d0b80013ae4dc5b2c79cfaa8d
3f88272a221a54b7cc1e98d244dd1afaef60c00d
siar7178/amigos3
/codes/python/monitor.py
Python
py
7,776
no_license
# from watchdog import set_mode # from scheduler import run_schedule import shutil #import os from subprocess import Popen, PIPE, call from execp import printf from onboard_device import get_battery_current, get_battery_voltage import traceback from gpio import all_off import datetime def get_schedule(): # get the r...
660a4084e63be4cf2eb66acbbdbbb48a4e4bd137
e91fe68547cc0345f7f2fa6ec5a67fa7b3ff17c8
wkddnjset/AIRI400-2017
/AIRI400-2017/6week/Day1_mnist/DCGAN.py
Python
py
6,762
no_license
import tensorflow as tf import numpy as np from matplotlib import pyplot as plt import matplotlib.gridspec as gridspec # %matplotlib inline import sys from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) def plot(samples, D_loss, G_loss, epoch, tot...
d1caf95c56f9f48620d0f4d897c7c4db2accc8b0
0c02fe8b2fed3fcd5a451c94209b25b2f678a78e
ryu19-1/atcoder_python
/abc035/d/main.py
Python
py
808
no_license
from heapq import heappop, heappush N, M, T = map(int, input().split()) A = list(map(int, input().split())) adj = [[] for _ in range(N)] adj2 = [[] for _ in range(N)] for _ in range(M): a, b, c = map(int, input().split()) adj[a-1].append((b-1, c)) adj2[b-1].append((a-1, c)) INF = 10**12 q = [(0, 0)] d =...
c06c04d3f7daf392c1c49cf1a3380be95e16fcb3
3d5609e374be4fbfa065777be1ed723914958a64
MarkusH/django-migrations-benchmark
/rrmdjc/migrations/0003_ddzxkrvtfd_vlpnxn.py
Python
py
482
no_license
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ysgxuyu', '0002_kqlunbkaa_cexmjva'), ('rrmdjc', '0002_guhhjm_ixxlcmb'), ] operations = [ migrations.AddField( ...
fc438bd791ca4655b0d4139b525dd99374470e7f
ad74b1819ce99118410749717aa78521865566d7
baiin/tuffy-tutor
/mysite/titan/models.py
Python
py
4,121
no_license
from django.db import models import datetime # Create your models here. class User(models.Model): id = models.IntegerField(primary_key=True) email = models.EmailField() first_name = models.CharField(max_length=32) last_name = models.CharField(max_length=32) password = models.CharField(max_length=32) gender = mo...
89d42e2be9a18ee6e0840359423d37485118ce62
ab4cc822e4c882d325a2042213e179f13b36b01f
skryspin/rocket2
/utils/slack_parse.py
Python
py
1,669
permissive
"""The following are a few functions to help in handling command.""" import re from app.model import Permissions, User, Team from typing import Optional def regularize_char(c: str) -> str: """ Convert any unicode quotation marks to ascii ones. Leaves all other characters alone. :param c: character t...
498b9d9852c72a46eedc5b64f2894b86eaee3235
b718f012b590d8165d5864e652223e6783dcb883
helfi92/ichnaea
/ichnaea/log.py
Python
py
10,820
permissive
"""Functionality related to statsd, sentry and freeform logging.""" from collections import deque import logging import logging.config import time import markus from markus.utils import generate_tag from pyramid.httpexceptions import HTTPException, HTTPClientError, HTTPRedirection from raven import Client as RavenClie...
84a183bf8a95c658f1135ed601807b8017e5ab4e
d5d10025bb77f765e7903336ffaa0f43eab55d49
glomium/elmnt.de
/technologies/migrations/0004_removed_taggit.py
Python
py
1,380
permissive
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from technologies.models import TAGS def load_tags(apps, schema_editor): cls = apps.get_model("technologies", "Tag") for key, name in TAGS: data, created = cls.objects.get_or_create(tag=key) cla...
3a69e4b2b90e0de9000e9e7b12176248ebc97408
f21f840bd0b2a7601c45ee0686e777d83fd31a72
rokam/midea-msmart-1
/msmart/lan.py
Python
py
7,652
permissive
# -*- coding: UTF-8 -*- import logging import socket import time from msmart.const import MSGTYPE_ENCRYPTED_REQUEST, MSGTYPE_HANDSHAKE_REQUEST from msmart.security import security VERSION = '0.1.33' _LOGGER = logging.getLogger(__name__) class lan: def __init__(self, device_ip, device_id, device_por...
d10638704cf4c485d59a7b1958a4d9acc087514c
5c7d6be68e8853a5185231181baadbe5185403df
fengzse/Feng_Repository
/Flask-Web/flasky/Lib/site-packages/paramiko/auth_handler.py
Python
py
31,939
permissive
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
5fac0e47b1cb46ceb0ec62b3b60457ddb129f3d0
0d7aaa7793d9ef2f8d7a8c6b83a48c94338d0642
PauliSpin/3D
/hardSpehereGas.py
Python
py
6,340
no_license
import vpython as vp # Hard-sphere gas. # Bruce Sherwood win = 500 Natoms = 100 # change this to have more or fewer atoms # Typical values L = 1 # container is a cube L on a side gray = vp.color.gray(0.7) # color of edges of container mass = 4E-3/6E23 # helium mass Ratom = 0.03 # wildly exaggerated size of h...
14b559c726f932ea336a9b4900f9887234f474a1
ce5cdd944b8458cdb85e2e7a4fe22fb0230dee8e
bpkgoud/pulumi-azure-native
/sdk/python/pulumi_azure_native/databoxedge/v20190701/device.py
Python
py
21,362
permissive
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
a406cbf9ce245e233d6a80d67ead7fbf0972052c
bf7b22ce1925e27db19211c4b9404aa1912b4d7a
knockcat/Python
/dict_operation.py
Python
py
573
no_license
print('Vishal Joshi') d = {} size = int(input("Enter Size of dictionary :")) while(size>0): key = input('Enter key :') value = input('Enter Value :') d[key] = value size = size - 1 s_k = input('enter key to be searched :') m = d.get(s_k,'Key Not Exist') print(m) rem = input('Enter key f...
d8bc51232734db9dfdb356fd1eb16708d3534129
e83ec20caae6d3e41c26e19ffb180914948d9e88
mdabros/pytorch-examples
/src/models/mobilenet.py
Python
py
2,103
permissive
'''MobileNet in PyTorch. Originally from: https://github.com/kuangliu/pytorch-cifar/tree/master/models See the paper "MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications" for more details. ''' import torch import torch.nn as nn import torch.nn.functional as F class Block(nn.Module): ...
06335b82132465f29f87c68fb693c9b2f9030aec
516415842374c2afa1f90cea1159ba49a56df9c6
anantpatil/heat-convergence-poc
/heat/tests/test_cloud_config.py
Python
py
2,293
permissive
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
c4cdd8db041fb2812af31bab8cb91fb54b62e51d
49e8417727f552f27f7fbcc26fb6aa93a66169aa
LorgneSchilooch/5IABD-ML
/environments/tictactoe/experiment_tictactoe_with_tab_Q_learning_agent_training_and_command_line_play.py
Python
py
941
no_license
from agents import TabQLearningAgent, CommandLineAgent, RandomAgent from environments.tictactoe import TicTacToeGameState from runners import run_for_n_games_and_print_stats, run_step if __name__ == "__main__": gs = TicTacToeGameState() agent0 = TabQLearningAgent() agent1 = TabQLearningAgent() ...
9479be5d9715829533ddccce9a10a35c7f3927e4
8082b75f282c94ac385c287bc86c1393b69cc4f9
YuShangbin/zaqar
/zaqar/transport/validation.py
Python
py
25,960
permissive
# Copyright (c) 2013 Rackspace, Inc. # Copyright (c) 2015 Catalyst IT 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 require...
1b9b8badad89a1a20831517b0805553ff294a646
9ab35d7629f7575f136383bf19282b2001dd2c41
astroandes/CLARA_RotationOutflows
/data/tau10E7/to_join_parts_2.py
Python
py
880
no_license
import os logtau = 7 vrots = [50,100] vouts = [25,50,75] for vrot in vrots: for vout in vouts: path = './vrot'+str(vrot)+'/vout'+str(vout)+'/' filename = 'tau10E'+str(logtau)+'_vrot'+str(vrot)+'_vout'+str(vout) #os.system('rm '+path+filename+'_out.ascii') os.system('cat '+path+fi...
a73c0095c14f19a3371f5dc5ccdf80994705b75e
5949cdf5a22c988e9b0fee187b1dadcefa5fcf8e
DebashisGanguly/IoTSim
/ProcAlgo.py
Python
py
585
no_license
class ProcAlgo: def __init__(self, Name, ProcTimePerBit, CompressionRatio, Accuracy): self.Name = Name self.ProcTimePerBit = ProcTimePerBit self.CompressionRatio = CompressionRatio self.Accuracy = Accuracy def __repr__(self): string = '\n\t\tProcessing Algorithm:' string += '\n\t\t\tName = ' + self.Name ...
300209b589d0dc844513bbec951cd0fa3d5f1017
5498becec671a1d5b9201d450d42b1be2389c523
psyoblade/incubator-superset
/superset/viz.py
Python
py
91,376
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...
8206524236c1042be621ff83adc5d5be3e268995
8324fa253568a51025ed06adc4b539c9a69c757d
daniel0128/MonteCarlo
/MonteCarlo.py
Python
py
5,807
no_license
import sys import numpy as np import random import math from Bio.PDB import * import time class FileIO: def __init__(self, inFileName, outFileName): self.inFileName = inFileName self.outFileName = outFileName def readFile(self): inFile = open(self.inFileName) text = inFile.rea...
38a834d20f55e6b33e96255805733bf22b42884b
a91cacc4ab50555892ac3eb3827fb9457d376ad2
PrimozGodec/redis-cache-extraction
/run_embedders.py
Python
py
871
no_license
import os from orangecontrib.imageanalytics.image_embedder import ImageEmbedder def run_embeddings(model, image_dir): image_file_paths = [os.path.join(dr, ff) for dr, _, ffs in os.walk(image_dir) for ff in ffs if ff not in ["index.html", "README.md"]] print(image_file_paths) print...
ec5f3e33bf94c019020ec008dea78ef98fd6b18b
6d967e6d614819c996cc0f64a619dd9fdfcb03e7
posaidong/python
/PlayRating/TranslateReviews.py
Python
py
1,571
no_license
import csv import time import Util.GoogleTranslate def translateReviewsToEnglish(csvFile, outFile): file = open(csvFile, encoding='utf16') line = file.readline() out = open(outFile, 'w', encoding='utf16') out.write('App Version Name,Device,Star Rating,Review Text\n') i = 0 csvReader = csv....
c8da0bc8d8ea20c6a4fb50c69bd85a10e3accc09
72946227d49e46c6fbaaccc74bc6569fe6ea7ac5
JakeAttard/Python-2807ICT-NoteBook
/WorkshopWeek8/problem4.py
Python
py
705
no_license
def function(list, diff): state = 0 for a in list[::2]: for b in list[1::2]: if int(b) - int(a) == diff: state = 1 elif int(b) - int(a) == -1 * diff: state = 1 else: state = 0 break return state def ...
85835a8e317e35c14a5fc2d1141ebd652a30def5
bcf71aae66fa04380b1e91ad8692f1f8cbeb1225
charleshbaker/lpthw
/ex29/ex29.py
Python
py
472
no_license
people = 20 cats = 30 dogs = 15 if people < cats: print "Too many cats! The world is doomed!" if people > cats: print "Not many cats! The world is saved!" if people < dogs: print "The world is drooled on!" if people > dogs: print "The world is dry!" dogs += 5 if people >= dogs: print "People ar...
4be6ad3d5cc98a8f698321e8fd25380c2ea254e5
dffed5a0813457161f34945cad9437bbef5400d6
StockLin/trackin
/TrackIn/settings.py
Python
py
3,841
no_license
""" Django settings for TrackIn project. Generated by 'django-admin startproject' using Django 1.11. 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 ...
35efa403e37005eca7deb96faaf1e64f90df3e17
b75fe953ae6fe839b3aabe8895285091eb1cd24c
ShivanKaul/MicroProcessorLabs
/Lab3_STM32F4Cube_Base_project/calibration.py
Python
py
5,551
no_license
import csv # from statistics import mean, pstdev, pvariance import numpy as np import matplotlib.pyplot as plt from kalman_filter import KalmanFilter from numpy.linalg import inv def plot(plot_number, x, filtered_x, y, filtered_y, z, filtered_z): # Vertical distance between subplots HSPACE = 0.7 # Figure...
31c638ec0a1ff099af2b442e08c5bae718fa6631
5f245dd803dbd60e7f3bc6786fc0f8308d2c45eb
dannydi12/pi-led-server
/src/routines/siren.py
Python
py
1,124
permissive
#!/usr/bin/env python3 import time import argparse from lib import common from lib import config from random import randint, random if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('-l', '--brightness', default = 200, help='set brightness (0-255)') parser.add_argument('-r'...
fac3db395f65feeb786b609a70214500c19e0a68
234ce201b6fcf0f8f8d21b0d80d53a29c0bf3fee
thomas545/Taskers
/micro/middleware.py
Python
py
1,304
no_license
# Middlewares class MiddlewareMixin: def __init__(self, get_response=None): self.get_response = get_response print("get_response in __init__ - >>>", get_response) super().__init__() def __call__(self, request): response = None if hasattr(self, 'process_request'): ...
f74797e3130e5c1064b55cc68163e8a7981b3690
36b3be67fd6b3f1b19ff4e3201c78acf49bd2dc0
elfscript/ironpython2
/Src/StdLib/Lib/test/test_xmlrpc.py
Python
py
43,621
permissive
import base64 import datetime import sys import time import unittest import xmlrpclib import SimpleXMLRPCServer import mimetools import httplib import socket import StringIO import os import re from test import test_support try: import threading except ImportError: threading = None try: import gzip except...
db624ae7f4c0137ad07ce2d4000e3f1431ff300c
6c6b79d21d1c1d6734bff3235e1b6baabdaf7a5e
JulietaCaro/Programacion-I
/Simulacro 2do Parcial/Ejercicio 4.py
Python
py
1,121
no_license
# Desarrollar un programa principal para ingresar dos palabras por teclado e informar las letras poseen en común. Permitir # ingresar varias veces dos palabras hasta que la primera que se ingrese sea vacía. Para el ingreso de palabras, generar y # gestionar una excepcion si se ingresan numeros, espacios o símbolos, a...
00edf79ad3c4d67bd6a52a613cfc1b8101bc3acc
f94f0d33ad959b6290b6c0cfa5ea4ff1aa4d4c43
rafaellcoellho/checkers
/tests/engine/test_valid_moves.py
Python
py
4,489
permissive
import pytest from engine.defines import Players from engine.utils import cn def test_is_valid_pawn_basic_move(initial_board): # Normal moves assert initial_board.is_valid_pawn_move(*cn("C3", "B4")) is True assert initial_board.is_valid_pawn_move(*cn("C3", "C4")) is False assert initial_board.is_valid...
3efc50cc3896b91bd567e0885908c28afdd75a7d
9052f4ed4a0999655b59c529eb52b05df163a683
matiasechaharria/AleMate
/CondorDigitoverificador.py
Python
py
3,001
no_license
# -*- coding: utf-8 -*- """ Created on Tue Aug 25 20:12:08 2020 @author: Matias """ def PasoA( numero): """Hace el paso A Invierte un numero ingresado Invertir el número. (e.g: de 201012341 a 143210102). Interesante ananlis temporal de conversion: https://stackoverflow.com/questions/139...
d716579f78a1818c451ea386f03815e52801962c
0d46e1d4692cf38d34f0886bdf2810099aa02533
accountcwd/pose-estimation-lite
/alphapose/yolo/cam_demo.19:06.py
Python
py
13,450
permissive
from __future__ import division import time import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import cv2 from util import * from darknet import Darknet from preprocess import prep_image, inp_to_image import pandas as pd import random import argparse import pickle as pkl from ...
a8212bc55e76697fa78ca5d44874d3fa3e789305
d9939a69f2213e9bb961bd1bbb7adfcdbdafd649
xenron/sandbox-github-clone
/AtsushiSakai/jsk_visualization_packages/jsk_topic_tools/test/test_hz_measure.py
Python
py
1,425
permissive
#!/usr/bin/env python import os import sys import unittest sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "scripts"))) from topic_compare import ROSTopicCompare import rospy import time import numpy as np try: from std_msgs.msg ...
f6fb18adf49c0cbd6e0a47c35a4411e0862e5aa8
9522d3ab106ae2aeac86ac8807abb3eca213bf1c
plexusstudio/pengenalan_programming
/scripts/lvl3_class.py
Python
py
2,652
permissive
# -*- coding: utf-8 -*- """ Created on Fri Jan 5 10:46:38 2018 @author: iqbal """ import random print("PENGENALAN CLASS ==============================") print("===============================================") # DEKLARASI CLASS ========================= class Human(): def __init__(self, name, ...
a5b3d3829a1c011440ed605ef03dc197b95bb5ef
259cfaf368e504aba3451d63534f5f2435c9fa7e
tgetachew18/KryptChat
/Client/menu.py
Python
py
500
no_license
class Menu: def __init__(self, description, items=None): self.description = description self.items = dict([ (unicode("1"), unicode('Create new conversation')), (unicode("2"), unicode('Enter a conversation')), (unicode("3"), unicode('Quit')) ]) def dis...
7eefcfdb9682cb09ce2d85d11aafc04977016ba4
dbe7d795258cb2db61cc0baa6a79ecece1a0e324
mxl00474/Yokohama_bus_navi_gmap
/bus_monitor/BusInfo.py
Python
py
4,748
permissive
from urllib import request, parse import pandas as pd import json import os class BusInfo: url = 'https://api-tokyochallenge.odpt.org/api/v4/odpt:Bus' url_busstop = 'https://api-tokyochallenge.odpt.org/api/v4/odpt:BusstopPole.json' url_routes = 'https://api-tokyochallenge.odpt.org/api/v4/odpt:BusroutePatt...
be040a53ed383ed9c2190b29ec8192114683fab4
2d61b361994ea227774af6fc1dd585d7882cb379
sand-ci/ps-dash
/src/pages/paths_site.py
Python
py
21,144
permissive
import dash from dash import Dash, dcc, html, Input, Output, State, Patch, MATCH import dash_bootstrap_components as dbc import plotly.graph_objects as go from elasticsearch.helpers import scan import pandas as pd from utils.helpers import timer import utils.helpers as hp from model.Alarms import Alarms import model....
79be30a5e698d5ad807763c07e0ef85d99751df5
dcb2fc223fe7476190ae01a9cab2dabfd5951c3c
okcpython/battleship_django
/battleship_django/urls.py
Python
py
834
no_license
"""battleship_django URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')...
ad8d6f3f19b56fc1caf51e8cfa34a01193645e90
e7f0c71e8e781f2c9aa0bc87fe8f45c40310e493
bizzcat/Py4DataSci
/signal_lasso.py
Python
py
359
no_license
from sklearn.linear_model import Lasso clf = Lasso(alpha = 0.1) clf.fit(train_data[all_vars], train_data['MEDV']) lasso_all_predictions = clf.predict(test_data[all_vars]) test_data['lasso_all'] = lasso_all_predictions lasso_all_RMSE = mean_squared_error(train_data.MEDV[:150], test_data.lasso_all[:150])**0.5 RMSE_va...
40d15f7c173bddbd0c4bb600e17e9bc26e960e95
4482b5a54b182abf1921eac98194e629b486cef7
ashleyb55106/my-first-blog
/mysite/settings.py
Python
py
3,217
no_license
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.10.7. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
beaab92164b5a9b39a9bed3aef294c66d62dd2d8
582d3bd80412b37bccba921046724622dfe218dc
Atheros13/zo-sports
/zo/zo/urls.py
Python
py
1,495
no_license
from datetime import datetime from django.urls import include, path from django.shortcuts import reverse from django.contrib import admin from django.contrib.auth.views import LoginView, LogoutView from public import forms, views class LoginView(LoginView): def get_success_url(self): return reverse('prof...
cea0125e6d0b5d6182d8ba8cadab07c16b69d421
d591c14f5944237b323f3b763f9cf888bc9c4dfc
heesu40/STUDY
/Python/Framword(Django)/django_subway/crud/models.py
Python
py
1,193
no_license
from django.db import models # Create your models here. class Article(models.Model): title = models.CharField(max_length=50) content = models.TextField() created_at = models.DateTimeField(auto_now_add=True) #추가될때 마다 현재시간으로 저장 updated_at = models.DateTimeField(auto_now=True) #editable옵션이 False로 자동 저장된다....
d6e20e2f3f224e94dc32374b1361c1435b85a700
81a46f3822780e08808d61f46e73074e2c401e95
stealth-startup/pybit
/tests/test.py
Python
py
2,250
permissive
""" Test script *WARNING* Don't run this on a production bitcoin server! *WARNING* Only on the test network. """ import sys sys.path.append('../src') import pybit from decimal import Decimal if __name__ == "__main__": conn = pybit.local_rpc_channel() # will use read_default_config assert conn.getinfo().test...
d4f2ccbdca666d8585a0f6e6c083f1d5180ff593
5145e4fd7ecd2d0c31dd60c45082d367b788fa84
XBCJWen/XCcity
/ScrapyHotel/spiders/XCHotel.py
Python
py
1,863
no_license
# -*- coding: utf-8 -*- import json import re import scrapy from ScrapyHotel.items import ScrapyhotelItem import time class XchotelSpider(scrapy.Spider): name = 'XCHotel' start_urls = ['https://hotels.ctrip.com/'] def start_requests(self): self.headers = { 'Referer': 'https://www.ctr...
091d2104be2f4e6a65a4a4ffa905eada3cdd0a0f
77b672a991c50775b87684f315b4993dee29a3b3
DaHuO/Supergraph
/codes/CodeJamCrawler/16_0_2_neat/16_0_2_eldos_pancake_revenge.py
Python
py
1,111
no_license
from copy import deepcopy def abs_max_pos(_list): abs_max = 0 pos = 0 for i in range(len(_list)): if abs(_list[i]) > abs_max: abs_max = abs(_list[i]) pos = i # elif abs(_list[i]) == abs_max: # if _list[i] > _list[pos]: # pos = i return...
b5aefafc5aaa40aedaf7ec751d7a3ceeab092238
77b3ddf136ce50a7bfb18ca54a3dc5e947599dab
dehnert/remit
/remit/finance_core/admin.py
Python
py
1,191
no_license
from django.contrib import admin import finance_core.models class BudgetAreaAdmin(admin.ModelAdmin): list_display = ('path', 'name', 'owner', 'interested', 'always', ) #fields = [ 'path', 'name', 'comment', 'owner', 'interested', ] class BudgetTermAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": (...
d7a5ead5b1f617d7d683904d38130928067d0a59
0e6e8a37334c24dde66452b47b1adfb325a61364
JustLittleYeti/AL
/ni_dziala/peacocks.py
Python
py
4,414
no_license
import pygame import random import config class Peacock(pygame.sprite.Sprite): def __init__(self): super().__init__() self.image = pygame.image.load("images/pea.png").convert_alpha() self.mask = pygame.mask.from_surface(self.image) self.rect = self.image.get_rect() ...
239a46a91246ddfeb3b7b2e6a33b1671abea67d9
e558bf1f5a13a75c9511d1d312cf6fbb181cec9e
chandraprakashcdy/Mug-Factory
/Mug/home/migrations/0001_initial.py
Python
py
844
no_license
# Generated by Django 2.2.4 on 2019-12-17 10:40 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Mug', fields=[ ('id', models.AutoField(auto...
4f1f341b93eb10dc777522bcff1ace5467719eff
9edf0434f2d182fee16f0847ea21f37e7343e016
PascalinDeZO/webrecorder
/webrecorder/webrecorder/downloadcontroller.py
Python
py
6,360
permissive
from warcio.timeutils import timestamp_now from warcio.warcwriter import BufferWARCWriter from pywb.utils.loaders import BlockLoader from pywb.utils.io import StreamIter, chunk_encode_iter from webrecorder.basecontroller import BaseController from webrecorder import __version__ from webrecorder.models.stats import S...
f878190e1cfbaa4dda1d01df8ec47565ff032756
b22b580b920b109022c67c3c388680fdc42f41c6
Mark2Mark/Touche
/Touche.glyphsPlugin/Contents/Resources/__boot__.py
Python
py
1,506
permissive
# def _site_packages(): # import site, sys, os # paths = [] # prefixes = [sys.prefix] # if sys.exec_prefix != sys.prefix: # prefixes.append(sys.exec_prefix) # for prefix in prefixes: # if prefix == sys.prefix: # paths.append(os.path.join("/Library/Python", sys.version[:3], "site-packages")) # paths.appen...
a3e5a56fc5d0126bf9226d927c090b16c41475b3
b4994663be5cccc16292b8e492f32c2e1387cf70
isaacl8/Python-Django
/django/real_port/real_port/urls.py
Python
py
820
no_license
"""real_port URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
984ad468f931af9f7f7a7c56ae349d585c32bdf2
e7f84f56419e2954766e30dd5bb6f018d2c34c05
ResurrectionRemix/android_build
/tools/releasetools/verity_utils.py
Python
py
24,277
permissive
#!/usr/bin/env python # # Copyright (C) 2018 The Android Open Source Project # # 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 req...
f7afc10a5c19b7218d4a4d03b99b56cb2af986b7
173bb7a9dae5cce743c6849a7203cb281b399aff
R3SWebDevelopment/iseteam
/iseteam/parties/forms.py
Python
py
277
permissive
from django.forms import ModelForm from django.forms.widgets import SplitDateTimeWidget from iseteam.parties.models import Party class PartyForm(ModelForm): class Meta: model = Party widgets = {'date': SplitDateTimeWidget(date_format='%d/%m/%Y')} fields = "__all__"
b58a3336f6927fcd52e280322ddedf22483bc101
a7d94cdce659ab67c886cadf754f74d8a914402b
daldaron/cs175
/cs175utils/layer_utils.py
Python
py
3,153
no_license
from cs175.layers import * from cs175.fast_layers import * def affine_relu_forward(x, w, b): """ Convenience layer that perorms an affine transform followed by a ReLU Inputs: - x: Input to the affine layer - w, b: Weights for the affine layer Returns a tuple of: - out: Output from the Re...
2174c9e7c602c40930f054c91920c66042d8b3f5
3baff3b3cf81ebf8ae7a745fb568865f9f8fb5c8
DamianSkrzypczak/Remus
/remus/data_import/split_screen_beds.py
Python
py
7,183
permissive
#!/usr/bin/env python # # Usage: split_screen_beds.py METADATA_FILE RAW_BED_DIR SPLIT_BED_DIR # # import os, sys, glob import gzip from encode_data_import import passes_includes_and_excludes, get_collapse_beds_script, get_collapsed_bed_dir_map from encode_data_import import SUPPORTED_GENOME_BUILDS def is_header(lin...
525ee8d8931c564a43d304a5124e4644f7ad8354
f2e835700b17c3c77e070912962d6904cf48fcc1
slee981/xyzNews
/code/gcloud/cloud-scripts/python/train-all.py
Python
py
11,011
no_license
#!/usr/bin/env python # coding: utf-8 # Tokenize and Train # Author : Stephen Lee # Goal : Classify news source based on the article text # Using data from # - Fox News # - Vox News # - PBS News # Pre : Cleaned csv...
eedefafe653b978a906e032d153a58c3e7affd42
67ea3c726b28cce7ae35a7e7a66682ca9e71bf76
kiady66/Stone_Age
/Farmable/Farmable.py
Python
py
4,966
no_license
import abc from abc import ABC class Farmable(metaclass=abc.ABCMeta): """ Object Farmable which represent the different farmable """ def __init__(self, number: int, place): """ Constructor Class Building :param number: number of farmable :param place: place allocated to...
38df9b45b20c6c0d37f510af0182cf75b173f88b
759186c359b4a4b73f7b2bb53fe9086a50e9bce0
maimiaolmc/TaobaoOpenPythonSDK
/TaobaoSdk/Request/CrmGrademktMemberGradeactivityInitRequest.py
Python
py
3,309
no_license
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim: set ts=4 sts=4 sw=4 et: ## @brief 商家通过该接口设置等级活动 # @author wuliang@maimiaotech.com # @date 2013-09-22 16:52:39 # @version: 0.0.0 import os import sys import time def __getCurrentPath(): return os.path.normpath(os.path.join(os.path.realpath(__file__), os.pat...
7868e114ac356748185f6439841b67991e21a300
1796b84bdd15b6d02b62b9568108e62e281971fe
Guanchishan/bookwyrm
/bookwyrm/tests/models/test_fields.py
Python
py
19,850
no_license
""" testing models """ from io import BytesIO from collections import namedtuple from dataclasses import dataclass import json import pathlib import re from typing import List from unittest.mock import patch from PIL import Image import responses from django.core.exceptions import ValidationError from django.core.fil...