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
6303cd3cced6dd88a6f4d972308be7036c982709
53461573b372c6c7459cb8cac9d9579166e52f59
hfiuza/Text-Mining-and-NLP
/Assignments/LinkPrediction/src/feature_extractor.py
Python
py
14,442
no_license
# coding=utf-8 import numpy as np import nltk import pandas as pd import gensim import igraph from library import read_files, clean_text_simple from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.preprocessing import scale import networkx as nx import itertools from networkx.algorithms.connectivity...
9b45c66f5118c6482883c4de0cb92d8cabf9e445
100deb7c1e1ccdbda2acd347789a457a75f013a5
igmec/igmec
/Python/Python Laptop Jan 19 17/Examples & Ref/xkcdDownload.py
Python
py
1,922
no_license
#! python3 #xkcdDownload.py - downloads all xkcd comics import requests, bs4, sys, webbrowser, time, os url = 'http://xkcd.com' os.makedirs('xkcd Comics', exist_ok=True) print("Connecting to xkcd Comics...") brokenURL = [] count = 0 while not url.endswith('#'): #Download comic's page print("Downloading Pa...
a93629c2ed01aa592a5b2e29b0a32ef75d7d2257
ab963e20e432599f17293d669733e9e87c30bf2c
bbyykk/deep-learning-from-scratch
/ch04/gradient_method.py
Python
py
756
permissive
# coding: utf-8 import numpy as np import matplotlib.pylab as plt from gradient_2d import numerical_gradient def gradient_descent(f, init_x, lr=0.01, step_num=100): x = init_x x_history = [] for i in range(step_num): x_history.append( x.copy() ) grad = numerical_gradient(f, x) x ...
72e843f689616c27c7200c4c0c1715674619278a
c326d88af5a922437fc4bddcc6e6692a046fe545
xiaoshan1213/StockProfitCalculator
/command_utilities/cmdCalculator.py
Python
py
2,960
permissive
def formatTwoDecimalPoints(floatNum): """Return a string of the float number with only two decimal points.""" return "%.2f" % floatNum def calcProceeds(finalSharePrice, allotment): """Return Final Share Price * Allotment.""" return finalSharePrice * allotment def calcPurchasePrice(initialSharePrice, a...
bbe7a6affe5889530881464cec9e94f4523db478
343172bdf7c77eeabb7cc46a0d7aea4eb2163601
pratimaupadhyay02/Stuffs
/finaltry.py
Python
py
1,360
no_license
import urllib2 from bs4 import BeautifulSoup as soup quote_page = "https://twitter.com/narendramodi" # query the website and return the html to the variable 'page' page = urllib2.urlopen(quote_page) page_soup = soup(page, "html.parser") #tweets=page_soup.findAll("p",{"class":"TweetTextSize TweetTextSize--norm...
a17ecace22069b2480bfa9a544cd949619ab3aaf
9525f21ab2bd23df9a82e12feb35e1ef3673ea37
AlyoshaS/codes
/startingPoint/03-EstruturaDeRepeticao/Exercicios/01.py
Python
py
1,061
no_license
""" 01 - Um funcionário de uma empresa recebe aumento salario anualmente. Sabe-se que: Esse funcionário foi contratado em 2005, com salário inicial de R$ 1.000,00. Em 2006, ele recebeu aumento de 1,5% sobre seu salário inicial. A partir de 2007(inclusive), os aumentos salariais sempre corresponderam a 1.3 do percen...
5232f234c40a562b1d3063a2474af3f539bf9159
d71ea45fbf949c405868e792691d248875628740
roo2319/Intro-to-Computer-Vision
/Lab 2/mandrill2fix.py
Python
py
228
no_license
import numpy as np from matplotlib import pyplot as plt import cv2 img = cv2.imread('mandrill2.jpg',1) cv2.imshow("Pic",img) img_not = cv2.bitwise_not(img) cv2.imshow("Invert1",img_not) cv2.waitKey(0) cv2.destroyAllWindows()
5711a8804243018be50a4d1e64808d3bce5a9b97
f0aacc52f4ba6052b1e2a465e6ce1a38b1dbc512
lin2724/pweb
/bin/app.py
Python
py
3,150
no_license
import web import os import sys import re import weibo_token from syncFileList import syncFileListBuilder token_store_file = 'token.db' urls = ('/img','index', "/photolib/*", "photolib", '/photodetail/*','photolib_sub', '/auth','weibo_auth', '/gettoken','givetoken', )#,('/xx...
b01b01ab70bc7320d1979077ec1b117797d86181
3a78cf5e7607396da6e4e299aa43468b61e1a46b
pyvista/pyvista
/pyvista/plotting/picking.py
Python
py
70,008
permissive
"""Module managing picking events.""" from functools import partial, wraps from typing import Tuple import warnings import weakref import numpy as np import pyvista from pyvista.core.errors import PyVistaDeprecationWarning from pyvista.core.utilities.misc import try_callback from . import _vtk from .composite_mapper...
fe2d558b19f3fd943041f45aaf1ee022efa35a2c
34807225a4347cc8031a0f0f5f072647b00a99b0
TheaterHack/code
/landingpage.py
Python
py
527
no_license
from flask import Flask from flask import render_template from flask import request from sendresult import email_result from gifsender import gif app = Flask("MyApp") @app.route("/") def hello(): return render_template("htmlforpage.html") @app.route("/signup", methods=['POST']) def sign_up(): print "y...
8bd57dd357f344af962103e3cf0b74bca4c548f3
afb5c9d399c6abca51faee211c73f61cf2aa5d86
SamarthSingh13/nifty-analysis
/end_days.py
Python
py
330
no_license
from datetime import date, timedelta from pandas import * data = read_csv('3131.csv') csv_dates = data['datetime'].tolist() d = date(2006,1,2) d += timedelta(days = 3) while d.year < 2020: if str(d) in csv_dates: print(d) elif str(d-timedelta(days=1)) in csv_dates: print(d) else: print(d) d += timedelta(day...
167a76af6a36cc38b8ea27b805085b4d9bd000ff
f3b34a6092d83b0ab6b6719ee88bbfacef085f97
bytewolves/pentest-tools
/lfi.py
Python
py
14,427
no_license
#!/usr/bin/python3.5 # I don't believe in license. # You can do whatever you want with this program. import os import sys import re import time import copy import random import argparse import requests import urllib.parse from functools import partial from threading import Thread from queue import Queue from multipro...
78a7cff384fed0a109a6651d75218de81927fae4
e7910d8a30f5fc4ece6c49bff76d472756dbed20
qrames/blog_project
/blog/models.py
Python
py
1,596
no_license
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models # Create your models here. class Article(models.Model): title = models.CharField(max_length=200) slug = models.SlugField(max_length=100) short_descr = models.TextField() content = models.TextField(max_length=1...
8f29a2ed36391ac1f6e65d0320d04fb5eead9f0e
376d993458b49dd4b0c3e099531bbb2594811c60
ovk1962/2018-10-12
/pr_file_FTP_09-10-2018.py
Python
py
3,801
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pr_file_FTP_09-10-2018.py # import os import sys if sys.version_info[0] >= 3: import PySimpleGUI as sg else: import PySimpleGUI27 as sg import time import ftplib import logging #======================================================================= def upload...
4c79e1f3fa36a58ab9adac489c7bd07a753ad422
dc53bb75d6df0cadf45369e521fce51db9d11836
sweetfruit77/Test
/python_study/day006_class012.py
Python
py
266
permissive
class A: def pr(self): print('A') # 오버라이딩, 재정의 되었다. class SubA1(A): def pr(self): print("pr1") class SubA2(A): #def pr(self): # print("pr2") pass s = SubA1() s2 = SubA2() s.pr() s2.pr() print("-"*20)
da7203c6c4465007f44ffe19da6968421f71bf25
2b61f695c45052df56cbf8d70141fd2e0f40a0f4
ricardozhang1/crawl_mtime_messages
/Downloader.py
Python
py
701
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests class HtmlDownloader(object): def download(self,url): if url is None: return None url_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36' ...
2a9016f5e7fddc6dd70309405acac0485f169ae3
4f17a4b565f3de2b8b43c981b9b0f06a0ba31686
zilunzhang/Introduction-to-Image-Understanding
/Assignment4/code/q2def.py
Python
py
10,550
permissive
import numpy as np import glob import csv import cv2 import matplotlib.pyplot as plt detector_csv_path = '../data/test/results/*detector*.csv' depth_csv_path = '../data/test/results/*depth*.csv' img1_rows_lists = [6, 2, 0] img2_rows_lists = [4, 1, 1] img3_rows_lists = [3, 0, 0] f = 721.537700/10 T = np.power(3, 2) p_x...
b6b9b42a7d8b076fcf553263c8a80253aa99273e
0a84180d05705364d5c3537a06ede728312ff05f
G4te-Keep3r/HowdyHackers
/langs/0/iw.py
Python
py
485
no_license
import sys def printFunction(lineRemaining): if lineRemaining[0] == '"' and lineRemaining[-1] == '"': if len(lineRemaining) > 2: #data to print lineRemaining = lineRemaining[1:-1] print ' '.join(lineRemaining) else: print def main(fileName): with open(fileName) as f: for line in f: ...
3897977767d888a4f2966a354b3aee529d5a3e61
fdbc5e3f0e9b5aa387bfb90745a512e4bae34fcb
RajDandekar/manim
/manim/_config/utils.py
Python
py
55,240
permissive
"""Utilities to create and set the config. The main class exported by this module is :class:`ManimConfig`. This class contains all configuration options, including frame geometry (e.g. frame height/width, frame rate), output (e.g. directories, logging), styling (e.g. background color, transparency), and general behav...
ebc9f7ca701b391d509e6d3ad06563541816f9f4
f0da86bcd39d4be48308830ade79783fc5d90716
XiaoJake/Learning-from-Sparse-Demonstrations
/test/test_gui.py
Python
py
1,142
permissive
#!/usr/bin/env python3 import os import sys sys.path.append(os.getcwd()+'/lib') import time import json from PyQt5 import QtWidgets from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure import matplotlib.pyplot as plt import matplotlib.patches as patches f...
6036c4ed8e43d8821b1f00b962d7b972b2f96006
2265e588febdb903bcad6c569730c48f8ef4cc6c
avizum/Groot
/main/utils/useful.py
Python
py
13,864
permissive
from utils._type import * import wavelink import textwrap import asyncio import functools import re import sqlite3 import sys import traceback import aiohttp import discord from datetime import datetime from discord.ext import commands, menus from discord.ext.menus import First, Last from discord.util...
cba7c56bbd7d01a25e80d36a046814d40399cefb
5946d8adebdc4600b6cb0578af6c68dcba08c0d4
addisoncole/Seattlization-API
/seattlizationAPI/models.py
Python
py
10,569
no_license
from django.db import models #Point in time Count for yearly Count Us In/One Night Count of homeless class HomelessCount(models.Model): year = models.IntegerField(null=False) total = models.IntegerField(blank=True, null=True) unsheltered = models.IntegerField(blank=True, null=True) number_in_shelter_an...
5676e38e62f759ca59865abeada6e4e030c78c53
e602f6083ba1699cb4e8240d56ed99c5e87369be
Inistlwq/Text-classification-for-BDCI2017
/char_text/train_attention.py
Python
py
6,969
no_license
import tensorflow as tf import numpy as np import os import time from data_reader import TextLoader from text_attention import HANClassifierModel # Parameters # ================================================== # Model Hyperparameters tf.flags.DEFINE_integer("embedding_dim", 128, "Dimensionality of character embeddi...
52be6073bd774c3fe88401ee1656796fd762f88d
5d15ceaa308999c710b6d8ac4f2fae8aa3e4cbdf
Harmon758/Project-Euler
/041 - Pandigital prime/HackerRank_Project_Euler_041_002_Test.py
Python
py
905
no_license
# Enter your code here. Read input from STDIN. Print output to STDOUT A = [True]*(10 ** 7) Primes = [] Primes.append(1) for i in xrange(2, int(10 ** 3.5)): if A[i] == True: Primes.append(i) for j in xrange(i * i, 10 ** 7, i): A[j] = False for i in xrange(int(10 ** 3.5), 10 ** 7): if ...
4ee054d3bef63bada30c000759ef731a6ccef711
752605fdbfd6715fb3e30a841744dd508581d0a5
abrahamgivith/Learning-Projects
/Problem solving_Python/2.py
Python
py
5,151
no_license
''' Write a function that returns a pair of numbers from a inout array, such that the sum of the pair is equal to a given sum.' Assume, all numbers are integers, the array is ordered. input : 1. An array 2. Sum S return a pair of numbers eg. [1,2,3,5,9] , sum = 8 returns (3,5) ''' def findPairForSUm(arr...
01df0b79fcd2c3325ca6779e3afb059ef0915bbb
d8274144efbe629c94e032bc1f95bd04e68c13af
rahmatsubandi/Pendeteksi-Ekspresi-Wajah
/main.py
Python
py
5,461
no_license
import numpy as np import argparse import matplotlib.pyplot as plt import cv2 from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Flatten from tensorflow.keras.layers import Conv2D from tensorflow.keras.optimizers import Adam from tensorflow.keras.layers import MaxPooling2...
70c1507e253865b4353cb78ba8835a1fe35a021a
16a610ecdf22122ac340da489a7ec4a34084b507
Naumanarif1004/dj-shop
/ecommerce_project/settings.py
Python
py
3,973
no_license
""" Django settings for ecommerce_project project. Generated by 'django-admin startproject' using Django 3.1.6. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ fr...
795dcedcfcdcdf4c798f15f5f50ab2aec590f143
723a51a8f0cbe3b43a5d0b2061e377ccaf1eeb63
jgosmann/spyke-metrics-extra
/spykeutils/sklearn_bindings.py
Python
py
4,159
no_license
""" .. data:: metric_defs Dictionary of metrics supported by :mod:`.sklearn_bindings`. Each value is a tuple consisting of the metrics name and a lambda function taking a list of spike trains and a time scale :math:`\\tau` as time quantity. The following metrics are available: * 'es': :func:`Even...
df6b18cc87b1bc93bd0e695f5aea30f7449812f2
3ca45ff5fd5c4cd7b347488e2145b9abd20069e6
daman-p/tensforflow_class
/src/env_test.py
Python
py
3,394
no_license
import gym import numpy as np def process_observation(observation): ''' :param observation: numpy array of shape (96, 96, 3) return by the environment :return: 96 x 96 grayscale image ''' rgb_weights = [0.2989, 0.5870, 0.1140] return observation.dot(rgb_weights) def compute_steering_speed_gyr...
5892e1f278af903a5090c785ee2f815fc60dbe88
489ea88dac9d81ac4fdd90181de5182688bb0698
jiushill/FrameScan-GUI
/Plugins/live800/downlog_filedownload.py
Python
py
1,110
no_license
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: live800客服系统downlog任意文件下载 referer: http://www.wooyun.org/bugs/wooyun-2010-0147322 author: Lucifer description: live800客服系统downlog.jsp参数fileName未过滤导致任意文件下载,可下载数据库配置文件 ''' import sys import requests import warnings class downlog_filedownload(): def __init__(...
01b475623af0489f23b7aaa950a16b50d9a06915
aebc6c066362be06cc9166691894550d00f089a8
Hegemege/quantum-jazz
/quantum-black-box/gym-stirap/example_stirap.py
Python
py
696
permissive
from gym_stirap import StirapEnv import numpy as np env = StirapEnv(initial_displacement=-.0) obs = [] observation = env.reset() obs.append(observation) actions_left = [-.75] * 400 actions_right = [0.75] * 400 actions = np.array([actions_left, actions_right]).T #reward = np.zeros(env.timesteps) rewards = [] t = 0 w...
1832ea036fc1dd2a0ce159c98dd1e44745a8fc5d
d036cff4da8df46c1a179b1a2ae12acfb92ca83b
jiyegege/tensorflow2_learning
/tf2_1.py
Python
py
1,551
no_license
import tensorflow as tf import numpy as np path = "MNIST_data/mnist.npz" #加载mnist数据 f = np.load(path) x_train, y_train = f['x_train'], f['y_train'] x_test, y_test = f['x_test'], f['y_test'] f.close() #读取训练数据和测试数据,将样本从整数转换为浮点数 x_train, x_test = x_train / 255.0, x_test / 255.0 # #加载mnist数据 # mnist = tf.keras.dataset...
2e04d4d828d525e0e301a3263ae020a397120652
362811cfecaaaf0916fbeb745001bc0629190376
ashrafm97/exercises_v2
/resturant_attempt.py
Python
py
959
no_license
restaurant_menu = ['falafel', 'hummus', 'couscous', 'beans on toast'] # this is the menu food_order = [] # empty list we wanna append to no_of_orderers = int(input('Table for how many?')) print(f"Table for {no_of_orderers} right over here guys!") print("Items on today's menu include: ") for food in restaurant_menu: ...
51181c2a0091eb803c3f435f26a78f8389b63bc2
0411324fc915db51d6ae816d6e08f04206552d2d
TimLeach635/stjh_videos
/make_image.py
Python
py
1,934
no_license
import math from tqdm import tqdm from pydub import AudioSegment from PIL import Image, ImageDraw def generate_waveform_image(audio_path, width, height, audio_slice=None, mirror=True): audio = AudioSegment.from_wav(audio_path) image = Image.new("RGBA", (width, height), (0, 0, 0, 0)) if audio_slice: ...
4d47fc074462b431a1eb2dc25cca114cfe0d9a0b
3030b4337e55d0ba5c9d11d7440129d024a911fd
Plachey/Api_page_version
/articles_version/settings.py
Python
py
3,323
no_license
""" Django settings for articles_version project. Generated by 'django-admin startproject' using Django 2.2.7. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/...
cfea77f833cf5b07b648224b7bbd2fd639fe4427
17b341c470a6ab933e98174e21e4e2f5ade224c7
tweak-com-public/tweak-api-client-python
/test/test_product_type_api.py
Python
py
5,222
permissive
# coding: utf-8 """ tweak-api Tweak API to integrate with all the Tweak services. You can find out more about Tweak at <a href='https://www.tweak.com'>https://www.tweak.com</a>, #tweak. OpenAPI spec version: 1.0.8-beta.0 Generated by: https://github.com/swagger-api/swagger-codegen.git ...
f0e7a75bb9a3d65bd3ba5d6b1bef9d588e346410
452104fa4cfc4c4e03bce852cc178984ac67a5eb
ftz-team/aiijc-data-parsing
/vk-rabota.py
Python
py
1,073
no_license
from typing import Iterable import requests import math def getLatestFromVk(n : int) -> Iterable: pages = math.ceil(n / 20) ans_tmp = [] ans = [] for i in range(pages): r = requests.get("https://api.iconjob.co/api/web/v1/jobs?sort=fresh&page="+str(i)+"&per_page=20") ans_tmp.extend(r.js...
50bbde9f89dae64a7dd98c8cb463e5a8bf6c2e71
698a93c1d5622290cdf018af3cc976acd94f8bed
gowin20/cs-resources
/Python/Pygame/hs-pygame-final/game1.py
Python
py
6,687
no_license
import pygame, sys, random from pygame.locals import * #defining things TILESIZE = 40 MAPWIDTH = 40 MAPHEIGHT = 20 BLACK = (0,0,0) BROWN = (153, 76, 0) GREEN = (0, 250, 0) BLUE = (0, 0, 255) WHITE = (255, 255, 255) wormx = -200 wormy = random.randint(0, MAPHEIGHT)*TILESIZE DIRT =13 GRASS =14 ...
55e14650d5c03d015910cf53f048a92d264c48ff
b09ff0f213dd16cff90f30ca6a330b9e2a1705ec
mbonsma/phageParser
/phageAPI/urls.py
Python
py
1,325
permissive
"""phageAPI 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-b...
f6073042ed5f373983cc8bc782f5ab6113442011
a602c97459c3d2f5f1b0dd786845a947b3d2538c
srossross/uvio
/examples/stream_pipes.py
Python
py
638
permissive
import sys import uvio async def run_awk(): date = await uvio.process.Popen( ['date'], stdout=uvio.process.PIPE ) awk = await uvio.process.Popen( ['awk', '{print "[AWKED] " $0}'], stdin=uvio.process.PIPE, stdout=sys.stdout ) # pipe stdout of the date program to t...
dac587ff54a5d6d7a67a5403341b023328f3210a
2a63cc517e771ffb285e7edfe02d89363e9fd665
cmontalvo251/Microcontrollers
/Circuit_Playground/CircuitPython/libraries/adafruit-circuitpython-bundle-7.x-mpy-20230406/examples/ble_magic_light_simpletest.py
Python
py
1,738
no_license
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT """This demo connects to a magic light and has it do a colorwheel.""" from rainbowio import colorwheel import adafruit_ble import _bleio from adafruit_ble.advertising.standard import ProvideServicesAdvertisement fro...
4b8e8a761c2c93841dbf1ee28102bef7ac1b7cb5
e3455c498b3b69cec0ead845f1d7fdb9141478f7
daniilkapitonov/purple_city_code_qualification
/PC_1/Application/Main_window.py
Python
py
45,651
no_license
import builtins import tkinter from tkinter import * import os import time from tkinter import font from tkinter.font import BOLD def click_btn_adm_metald(): value = rele_file_read_edit(0, adm_rele_file,0) if value == 0: lbl_adm_metald_status.configure(text= "- выключено") else: lbl_adm_met...
1c0cbc5ba820c3dbc85f02f5d76faabf7f43c1fa
d3e0ea7ea03741187175b62048f089032cfd5ea2
Pexego/bank-statement-reconcile
/account_statement_base_import/statement.py
Python
py
11,309
no_license
# -*- coding: utf-8 -*- ############################################################################## # # Author: Joel Grand-Guillaume # Copyright 2011-2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
716e53c5e2d0467f6829bc84a9c2a3e25840f762
e961d6e71f5fb4177eb9714a7aed5379c235fb8d
Kirkados/SPOT_capture
/Projects/Kirk_Phase3/Guidance Models/inertialAcceleration_noSpin_lowRandomization_highVel_rcdc-2021-06-15_16-27/code/analyze_experiment.py
Python
py
6,233
no_license
""" This script loads the deep guidance data logged from an experiment (specifically, logged by use_deep_guidance_arm.py) renders a few plots, and animates the motion. It should be run from the folder where use_deep_guidance_arm.py was run from for the given experiment. """ import numpy as np import glob import os im...
57923e77ffee15fdce00529181fe26eda194259f
5e096594e2a46c18cf9b0edaa1202470eac9251d
lanbu/SimpleFinancialRecord
/SFR_login.py
Python
py
8,458
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ' login dialog ' __author__ = 'Lanbu' from tkinter import * import pickle import tkinter.messagebox from SRF_mainPanel import * import socket import SRF_CommonDefine as commonDefine from SRF_tcpip_protocol import * #login window class class Login(Tk): def __init__(sel...
4926190b6d703479a445fef74e7446d59d019142
5133597d17f3d8f02679fde56045bdf067da151b
Mrxiang/TuGui
/New/NewMessage.py
Python
py
2,544
no_license
import random import tkinter as tk import threading from tkinter import * import tkinter as tk from tkinter import ttk from New import Utils from New.NewData import NewData class SplashMessage(tk.Tk): def __init__(self): super().__init__() self.create_widget() def create_widget(self): ...
6a82fbb036b5302c6ace4e2c1535dc0b910b381e
3b4f7ab8880b3f424564188f1de1afe4a9c9e39e
ejfitzgerald/agents-aea
/tests/test_components/test_base.py
Python
py
2,537
permissive
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
6eb38404851218aebda8c890c72f43b93c6526e1
86a34ddc9f1a314ef351a0c227ac6042f5bf5707
mireq/django-sample-data-generator
/django_sample_generator/text_generator.py
Python
py
2,672
permissive
# -*- coding: utf-8 -*- import array import os import pickle import random from io import StringIO from itertools import chain from .constants import TEXT_START, SENTENCE_END, WORD_END, SPECIAL_TOKENS class TextGenerator(object): def __init__(self, token_list, token_transitions): self.token_list = tuple(token_lis...
896532e01f42ad52e5a5e09ca229fa2d59146583
13ab88d69a504325beac82d258813dd2f9ea0103
AmanouToona/atcoder_Intermediate
/51.py
Python
py
1,050
no_license
# 51 JOI 2014 予選 4 - 部活のスケジュール表 # 列に出席者のbit 行に n日目をとる # 配るdp import sys sys.setrecursionlimit(10 ** 8) mod = 10007 N = int(input()) I = list(sys.stdin.readline()) I = I[:-1] member = ['I', 'O', 'J'] # dp 初期化 # bit: J, O, I とする。例えばJ君のみ出席ならば、100 とする。 dp = [[0] * (2 ** 3) for _ in range(N)] for i in range(2 ** 3): ...
0a10af688495d65528013bd8c91ffad83558ae1e
e747659199dc0558f65c9d159343f90e323d624a
An-Cockrell/IIRABM_MRM_GA
/PythonDev/ga_wrapper_results_allCytokines_sweep.py
Python
py
7,736
no_license
# NOTE THAT THIS CODE DOES NOT WORK WITH CURRENT VERIONS OF NUMPY, USE 1.14 instead # This is due to some bug with the numpy/cytpes interface and they arent going to fix it soon # https://github.com/numpy/numpy/pull/11277 import ctypes import numpy as np from mpi4py import MPI from numpy.ctypeslib import ndpointer fro...
a1f06d617b6c449e75486ad8505e44edab7de416
9d6cbd5d8837be081117b908d4db6e41b2fdcb7c
Juan8bits/AirBnB_clone
/tests/test_models/test_city.py
Python
py
1,563
no_license
#!/usr/bin/python3 """Unnittest for City class""" import pep8 import unittest from models import city from models.city import City class TestCity(unittest.TestCase): """City class unit testing""" def test_type(self): """Method to create and object attribute. """ city1 = City() ...
c7fd84cd655d32a3ae6017a04691041e7a5fae06
5c2efabc2669a7de843cafbdbaceac9ab9c3a07c
turbokongen/home-assistant
/homeassistant/components/mqtt/subscription.py
Python
py
3,839
permissive
"""Helper to handle a set of topics to subscribe to.""" from typing import Any, Callable, Dict, Optional import attr from homeassistant.helpers.typing import HomeAssistantType from homeassistant.loader import bind_hass from . import debug_info from .. import mqtt from .const import DEFAULT_QOS from .models import Me...
e9575e1dcb74586d8311fe8a2eb5c318419eb982
c74a96cadce41d285e23d284b9e1106e7b507dab
PrathameshDhumal/Python-programming
/OOP/oop3.py
Python
py
1,086
no_license
#public no1 #proteected _no2 #Private __no3 class Base: def __init__(self): self.no1=11 #public member self._no2=21 #protected member self.__no3=51 #private member def fun(self): #publc method print(self.no1,sel...
c112c0ad9f2731b2cf12e23cfaa15e61c86b4bab
232f8f342d40f7f7f50a372f9d2ea3ff505220c7
an-2-an/new_stuff
/cls_m.py
Python
py
763
no_license
class Boy: ID = 0 def __init__(self, name, age): self.name, self.age = name, age Boy.ID += 1 self.id = Boy.ID def __str__(self): return f'Boy {self.name}, age={self.age}, id={self.id}' @classmethod def from_str(cls, line): return cls(line.split()[0],...
63e84ade0b265ec46ff5bb2dadde1cf6b6cbc9e3
e615c485f97a97e1b9d820f24d1fe1c82e20317f
tonychangmsu/Python_Scripts
/climate/PRISM800_tiffconvert03042013.py
Python
py
4,291
no_license
# -*- coding: utf-8 -*- """ Created on Mon Mar 04 18:14:32 2013 @author: tony.chang """ import numpy from numpy import * from osgeo import osr from osgeo import gdal, gdal_array from osgeo.gdalconst import GDT_Float32 def PRISMtiffwrite(data,var,name,Nx,Ny,cellsize,yul,xll,nbands): fileformat = "GTiff" ...
fdb8fd5c3e621f78901179ca32ab3c7319b9fb7f
a6676620acf5ec0551280879b03ef90594ec2636
hy299792458/LeetCode
/python/133-cloneGraph.py
Python
py
637
no_license
# Definition for a undirected graph node # class UndirectedGraphNode: # def __init__(self, x): # self.label = x # self.neighbors = [] class Solution: # @param node, a undirected graph node # @return a undirected graph node def cloneGraph(self, node): nodes = {} def build...
3e1c8ea95f81b72a109c250547211c59a3cdca18
9c0f9d00b577c51fbe5bb3d32fe785a8f46be8b7
AleksCoolS/DungeonProject3
/GameObjects.py
Python
py
4,424
permissive
import pygame from settings import * vec = pygame.math.Vector2 class GameObject(object): def __init__(self, position): self.x = position[0] self.y = position[1] class TextureObject(GameObject, pygame.sprite.Sprite): def __init__(self, position, textureSize): GameObject.__init__(self, p...
3dd6b371636e45d6dfe4b5cfe57c6d607c512f7d
e38e54faec401aabeffca328ceeb93e7c3e482f5
fagan2888/collectionNvalidation
/collect/collect/settings.py
Python
py
2,064
no_license
""" Django settings for collect project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
cd604ec1a5b272c426d428a12cdc062a67f77834
c1abb699638d0cf49578b4508bd5405a2ab28449
nunoedgar-invest/agents-aea
/benchmark/framework/executor.py
Python
py
6,732
permissive
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
9cecb211f1d7ab2fba41f04589eec0d7c62400ac
0b40b331c252ff05811446a9e64dc45ae59d843d
meghadandapat/Clash-Round-1
/clash/clash/asgi.py
Python
py
387
no_license
""" ASGI config for clash project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTING...
d5f4ccc3ae786dbd4f3e000560e7f0fc79ce1dab
eb09df2928b173c0c80a1ce70b20e8a139960f2b
guziy/RPN
/src/rpn_utils/plot_veg_fractions.py
Python
py
13,197
no_license
import os from collections import OrderedDict from matplotlib import gridspec from matplotlib.colors import BoundaryNorm from matplotlib.gridspec import GridSpec from mpl_toolkits.basemap import Basemap, maskoceans from scipy.spatial.ckdtree import cKDTree from crcm5.analyse_hdf import common_plot_params from domains....
05b60dd58f05440195c82d8c068219a4abd19417
982bf31b84f9bbbe3e9c4743a1d3af25fdf0f2f9
wozu-dichter/sleepstages
/code/learnTransitionTensor.py
Python
py
3,380
no_license
from __future__ import print_function import sys from functools import reduce from os import listdir from os.path import splitext, exists import pickle import numpy as np from parameterSetup import ParameterSetup from stageLabelAndOneHot import restrictStages from fileManagement import readTrainFileIDsUsedForTraining ...
94b37d0157266e6f69f7c70886990c56174e975b
d46f3ee8d68946191ddd60ea426e4688bb945e35
lunayach/funnyAgain
/baselines/s_bert_concat/s_bert_trainer.py
Python
py
1,960
permissive
""" This file runs the main training/val loop, etc... using Lightning Trainer """ from pytorch_lightning import Trainer, LightningModule from argparse import ArgumentParser from s_bert_concat import S_BERT_Regression from pytorch_lightning.callbacks import ModelCheckpoint from pytorch_lightning.logging import TestT...
652b69142ff0811901c6e010c0182a788c7587ef
1cfa4434e0655e21d01c8580e89b4a3ce4784402
MudassirMontavo/montavobackend
/spendata/migrations/0028_auto__add_index_acxiombdforgs_masterrecordid__add_index_acxiombdforgs_.py
Python
py
97,459
no_license
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding index on 'AcxiomBdfOrgs', fields ['masterrecordid'] db.create_index(u'spendata_acxiombdforgs', ['ma...
ec4a289acd656d09c807f148c70a232985c38c09
5617ccc784f4655b0e58e9866f05bceaec6f0224
bigcpp110/work
/根据房间编号获取房间房东信息/根据房间编号获取房间房东信息.py
Python
py
890
no_license
# -*- coding: utf-8 -*- """ Created on Fri Jul 27 11:29:02 2018 @author: Administrator """ import pandas as pd import pymysql import datetime import smtplib from email.mime.text import MIMEText from email.header import Header dbconn=pymysql.connect( host="rr-bp1refgx3467t7y54o.mysql.rds.aliyuncs.co...
6822a6e64e2fd999b25046bacd4bf859981cd0b4
574826c07fe979c9a3ee4a6dd35c2c00cd5e9833
dooking/LikeLion
/session17/kakao/kakao/settings.py
Python
py
3,098
no_license
""" Django settings for kakao project. Generated by 'django-admin startproject' using Django 3.0.6. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os # B...
adca993a48f882aa53820345b591292b4183ddbd
bad8aed9b6e8da9a55c744b39118f97dd7fd2bcc
vincent-herm/ESP32-Les-bases
/comptage-ok.py
Python
py
587
no_license
from machine import Pin from time import sleep led = Pin(2, Pin.OUT) bp = Pin(25, Pin.IN) compt = 0 ancien_etat = bp.value() for cycle in range(500): # on fait 500 cycles, donc durant 10 s etat = bp.value() # = 1 si on appuie if not ancien_etat and etat : # si front montant com...
011c755fc806256708ddd8f5efd2f2c1dae40225
c001558e380afdf8caf9767ef16c1b8fb9eae7ad
agaca/EventSimulator
/eventGenerator.py
Python
py
630
no_license
#!/home/cloudera/anaconda3/bin/python import pandas as pd from kafka import KafkaProducer import shlex, subprocess import time subprocess.call(shlex.split('kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic taxiEventsFlow')) dfTrips=pd.read_csv('/media/sf_agu/TFM/datas...
45594a584eeb58f4c2124519d3c7280ca9ee599e
0588e19c45fc446ee382e6e84dabdc66489965f0
ethicaltechcharity/nehl-website
/clubs/migrations/0018_auto_20191030_2239.py
Python
py
415
permissive
# Generated by Django 2.1.11 on 2019-10-30 22:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('clubs', '0017_auto_20191026_0003'), ] operations = [ migrations.AlterField( model_name='club', name='dashboard_link...
4166bac205d5060c90234c2da0fe00dec89f08a1
65a65111507d0dbf7bbc908c390d57aa75febef9
zhouyangyu/cnvkit
/skgenome/tabio/__init__.py
Python
py
9,598
permissive
"""I/O for tabular formats of genomic data (regions or features). """ import collections import contextlib import logging import os import re import sys import pandas as pd from Bio.File import as_handle from ..gary import GenomicArray as GA from . import (bedio, genepred, gff, picard, seg, seqdict, tab, textcoord, v...
5a6277d9c47faa4ebc867d636aaf0f8b42f7e865
82080acebad1423ea29904f50ebdb23f74ac4ba1
fantix/anyio
/tests/test_taskgroups.py
Python
py
15,196
permissive
import asyncio import curio import pytest import trio from async_generator import async_generator, yield_ import anyio from anyio import ( create_task_group, sleep, move_on_after, fail_after, open_cancel_scope, wait_all_tasks_blocked, current_effective_deadline, current_time, get_cancelled_exc_class) from any...
f585210d6384affb5542ac2f23cc22ca7719a264
e80db52342f750d4e725ee4ff189f75fd1eefc29
cdtello/Tendencias
/apps/carrito/views.py
Python
py
5,371
no_license
from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.urls import reverse from django.shortcuts import render, redirect, get_object_or_404 from apps.productos.models import Producto from django.db import connection from apps.tenants.mo...
35da65f530bbf701a544bfcab7d0296ad16301d4
2a1d85810d758a7ed7c4365c40bb2c0aac3042a8
HackLB/hacklb
/app/business/migrations/0005_auto_20170111_0935.py
Python
py
557
no_license
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-01-11 09:35 from __future__ import unicode_literals import django.contrib.gis.db.models.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('business', '0004_auto_20170111_0709'), ] operati...
5b568e56c954ab7957f488c932ce43f8d539619a
9ab7791bb26e8e157e68bf68647c54c7f67d3c4d
shubhampotale/tacker
/tacker/vnfm/infra_drivers/kubernetes/k8s/translate_inputs.py
Python
py
11,987
permissive
# 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/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
fc5ae84b7894d2d28a772c43d64209490e3d73e9
bb087d1157c69dcc061339d7e229caae3e3f64cc
utecrobotics/labs_robotica_20191
/lab6/src/percepcion/4-morfologia.py
Python
py
1,007
no_license
import numpy as np import cv2 I = cv2.imread('imagenes/formas.png', 0) # Elemento estructurante se = cv2.getStructuringElement(cv2.MORPH_RECT, (9,9)) # Otras alternativas de elemento estructurante: # cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5,5)) # cv2.getStructuringElement(cv2.MORPH_CROSS, (5,5)) # Operaciones...
7825225dd31716e49f80e024b3026c6d1ce353eb
2e30489488d016d10281cba6bf00d50cb96a026f
feschmidt/current_detection_zenodo
/data_raw/F40_noisefloor_3/1Hz_20dB/F40_2019_05_29_13.17.07_SA_noisefloor_1Hz_allampsoff/noisefloor.py
Python
py
1,213
no_license
import stlab import stlabutils import numpy as np import time from stlab.devices.IVVI import IVVI_DAC from stlab.devices.BFWrapper import BFWrapper SA = stlab.adi('TCPIP::192.168.1.114::INSTR') # FSV-13 f0 = 7.5e9 # Signal analyzer print('Setting the SA') SA.SetPoints(2001) SA.SetVideoBW(5) SA.SetRes...
0080733c019c2624601f88cfe72d937ec430ea68
7a645dc5a5267729042901836ffba0a36a053ce0
pbs/django-cms
/cms/south_migrations/0003_remove_placeholder.py
Python
py
846
permissive
# -*- coding: utf-8 -*- from south.db import db from django.db import models from cms.models import * class Migration: def forwards(self, orm): # Deleting model 'Placeholder' db.delete_table('cms_placeholder') def backwards(self, orm): # Adding model 'Placehol...
3d841a0e9869ea5c0264ad203ed7e34a645e2408
4ce51820369e3760ddf5783e213af08da69c697f
MrHuff/kerpy
/kerpy/GaussianKernel.py
Python
py
2,847
permissive
from kerpy.Kernel import Kernel from numpy import exp, shape, reshape, sqrt, median from numpy.random import permutation,randn from scipy.spatial.distance import squareform, pdist, cdist import warnings from tools.GenericTests import GenericTests import numpy as np class GaussianKernel(Kernel): def __init__(self, ...
a17f95819c30440bd99ef5ca80e1f9ef0cf91301
863c91e5781f1896cf18779b02dc30431fd50341
terminatur/AlwaysBeCoding
/Algorithms/Strings/LongestRepeatingCharacterWithReplacements.py
Python
py
2,199
permissive
# Leetcode #424 # You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times. # Return the length of the longest substring containing the same letter you can get after performing the above...
7ca32fcc4121f8c67bf235ffa4e77e091fdb8899
5226c525faa4dfffef94581a6c26e36a52c01f79
Ankit-Developer143/Programming-Python
/list Comprehension/demo1.py
Python
py
345
no_license
square = [i**2 for i in range(10)] print(square) # op:- [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] nums = [i*2 for i in range(10)] print(nums) #op:- [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] """print Even""" evens = [i for i in range (10) if i%2 == 0 ] print(evens) #op:- i iterate :- [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] #op:- ev...
058ea5e2b56424937f8e05ca027d2b42df97012a
55fb1551a0505f1c7a40f46d9cbf0d1d0e0161c9
hpgit/HumanFoot
/DartDeep/keras_rl/visualize_log.py
Python
py
1,724
permissive
import argparse import json import matplotlib.pyplot as plt plt.ion() def visualize_log(filename, figsize=None, output=None): plt.figure(1) plt.clf() with open(filename, 'r') as f: data = json.load(f) if 'episode' not in data: raise ValueError('Log file "{}" does not contain the "epi...
fd22c6d50321f8c6c8120195ae7d31f8c3d28900
9d99dc6cc70feff2aaf28dd5de913c4d87c3fb33
radiasoft/optics
/tests/bending_magnet_shadow3_native.py
Python
py
4,766
permissive
# # Python script to run shadow3. Modified from output of Shadow.ShadowTools.make_python_script_from_current_run() # import os import numpy as np import Shadow import pytest def run_bending_magnet_shadow3_native(example_index): # set example_index=0 for infrared example and example_index=1 for xrays example ...
7577222e13028e91e5de3971b926b32403f6577a
e01deaedf833e08c4985b8bc2fe4fd346d0a4ce8
commGom/pythonStudy
/sparta_algorithim/solution/week2/06_is_existing_target_number_binary.py
Python
py
701
no_license
finding_target = 14 finding_numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] def is_existing_target_number_binary(target, array): find_count=0 curren_min=0 current_max=len(array)-1 current_guess=(current_max+curren_min)//2 while curren_min<=current_max: find_count+=1 ...
7067f8c5ce3c3caf474b263df151472ac7130e94
598c87d4b944a31851b41a95918657d5f0807fe4
qijiayi0217/Data_mining_pattern_mining
/Apriori-3-length.py
Python
py
4,572
no_license
import sqlite3 print "minimum support:" min_support=input() f=open(r'/Users/qijiayi/Desktop/data_mining/proj1/adult.data.txt') a=f.read() f.close() space="" list1=list(a) list2=space.join(list1) list3=list2.split('\n') count=0 for i in range(0,len(list3)): if list3[i]=='': count=count+1 for i in range(0,count): li...
eaf81107a2599102fd72271cdeec51a69ea3c4a3
6b470fa0bcca2ec6fe881f0d7beaa4493b8a71c6
ahua/python
/mp3/mplay/pylmp.py
Python
py
336
no_license
#!/usr/bin/env python #-*- coding: utf-8 -*- import sys from player import Player from lrc import Lrc if __name__ == "__main__": if len(sys.argv) == 1: sys.exit(0) mp3_list = sys.argv[1:] player = Player(mp3_list) while True: r = raw_input() if r == "quit\n": ...
4dc89221c314575e06e0541c96c55c914ea47062
9a11a14232e3f737b895287c9623f1138268f593
DanielMendez4/CSULB-CECS
/CECS 174/Python Test/Lab11_Test.py
Python
py
1,631
no_license
class LiquidMeasure: def __init__(self, gallons, quarts, cups, ounces): self.gallons = gallons self.quarts = quarts self.cups = cups self.ounces = ounces if type(self.gallons) != int or type(self.quarts) != int or \ type(self.cups) != int or type(self....
d9dddebb54475e21085af35133201df438841108
761462a8b11fe486674c149010a312490062b9b5
fengyuantao/pyhtonInterface
/Wuliangye/Email_get_Report/Send_Email.py
Python
py
1,404
no_license
#coding:utf-8 import smtplib from email.mime.text import MIMEText from email.header import Header from email.mime.multipart import MIMEMultipart import time class Email(object): def __init__(self,base_dir,mail_to,subject,data): self.base_dir = base_dir self.__sender = "fengyuantao@hexinpass.com" ...
11c65f2b82523224bac81748b0e641099aad91b0
ebdead7a08e11c0b18e81b3fcdbbe51f4f4f28ef
cjcruzrivera/Papeleria-Django
/practica_orm/wsgi.py
Python
py
402
no_license
""" WSGI config for practica_orm project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO...
386a1883b7b1067a97aadf5370056785168b2baa
b827f3cd3b299efc0deca18619bb82a3441b1a83
450703035/Data-Structures-Algorithms
/1_data_structures/1_arrays_and_lined_list/9_linked_list_practice.py
Python
py
4,702
no_license
''' Linked List Practice: Implement a linked list class. Your class should be able to: - Append data to the tail of the list and prepend to the head - Search the linked list for a value and return the node - Remove a node - Pop, which means to return the first node's value and delete the node from the...
993e82aad47334384f1e81aa700693d8240a98ad
49b8a536ef1ec4161358fc0fef4a9565bcdf0ffd
johnbaek12025/module_contents_system
/adm/jobs/nws01.py
Python
py
2,186
no_license
import logging from adm import to_int from adm.ad_manager import ADManager from dateutil.relativedelta import relativedelta from datetime import datetime from adm.jobs.workshop.commom_bjh import get_cybos7254 from .html.nws01_html import get_row_html, get_html from adm.jobs import ( get_dealing_str, get_kor_nam...
aff0861e4ee33fbf3300f5e2c6a72a8b22294a45
cedab0085e5c7ca3d32e01251a7c1d462e82a239
mohseni1983/coinkade_pay
/coinkade/settings.py
Python
py
3,415
no_license
""" Django settings for coinkade project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ import os from...
a35006d8d331b448f3d37c33668a8b0bcd4e1880
890952181a187052662f43a1aac7acc242f761f5
fnxL/online-judge
/judge/views.py
Python
py
1,894
no_license
from judge.models import Problems from django.shortcuts import render, HttpResponse, redirect from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from .forms import CreateUserForm from django.contrib...
073c97ac82b680aa2f796be91bc801c972b3f7ca
4c18d18a0921ea1ec0364da2fbff9e672a26920b
ccdlvc/sentryserverbak
/src/sentry/api/serializers/models/event.py
Python
py
4,995
permissive
from __future__ import absolute_import import six from datetime import datetime from django.utils import timezone from sentry.api.serializers import Serializer, register from sentry.models import Event, EventError @register(Event) class EventSerializer(Serializer): _reserved_keys = frozenset([ 'sentry....
0fede55b1fdec0875c27a412778421f42e00dffd
f947f08ead56b1a1527562495865d8a338ad0fa7
NanRenTeam-9/MongoMicroCourse
/OnlineStudy/rbac/service/routers.py
Python
py
2,058
permissive
from collections import OrderedDict from django.utils.module_loading import import_string from django.conf import settings from django.urls.resolvers import URLResolver, URLPattern import re def check_url_exclude(url): for regex in settings.AUTO_DISCOVER_EXCLUDE: if re.match(regex, url): retur...
1b89f723f39dc35ddc5f940015a4e3dec16af295
a79cf714a3f82991fa28d837c3044f7dec240bb6
ZTP-yavs/ztp
/modules/external_modules/ftp_login.py
Python
py
1,899
permissive
import socket import sys from pymongo import MongoClient from bson import ObjectId sys.path.insert(0, "./") def receive(sock): chunks = [] bytes_recd = 0 chunk = sock.recv(512) if chunk == b'': raise RuntimeError("socket connection broken") chunks.append(chunk) bytes_recd = bytes_re...
e2ee31dc33b1ea52adfbfa602dcc1b140b20fe07
204eed10c0f1da3cb9eac9747a43a3c357eefc52
matiasmjcm/proyecto2
/cuadrado.py
Python
py
4,041
no_license
import modulos print ("MENÚ: \n\ 1. Agregar una línea \n\ 2. Agregar un elipse o círculo \n\ 3. Agregar un rectángulo o cuadrado \n\ 4. Agreagar un triángulo \n\ 5. Mostrar un dibujo \n\ 6. Leer un dibujo \n\ 7. Grabar un dibujo \n\ \n\ 0. Salir del programa\n") ejey = 42 ejex = 82 matriz = [] for y in ...
1d6a2733bd89ca4845b176d6970525ec34765b4e
d4a31e2a21b94ffbdc8d198682aa3a45e7e91516
f-fathurrahman/ffr-komputasi-material
/sgdml/my_sgdml/train.py
Python
py
57,619
no_license
""" This module contains all routines for training GDML and sGDML models. """ # MIT License # # Copyright (c) 2018-2022 Stefan Chmiela # # 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 witho...
cb9ba19921f60cf6173b90d9b7f2aba8989733ab
ccae2a297e6c6adf8107cd2522405e181abd6d51
zealotnt/workspace_python
/test_pyqt5/zetcode/06.widgets/qSlider.py
Python
py
1,190
no_license
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ ZetCode PyQt5 tutorial This example shows a QSlider widget. author: Jan Bodnar website: zetcode.com last edited: January 2015 """ import sys from PyQt5.QtWidgets import (QWidget, QSlider, QLabel, QApplication) from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixma...
dfe01d4384d47745121981121fb2cbe4c59829e3
893007aa62bdd61ad8db1c2dc8afab07a445aa72
ShirinovAdil/Posty-app
/postsapp/models.py
Python
py
1,154
no_license
from django.db import models from django.contrib.auth.models import AbstractUser class User(AbstractUser): """ Custom User model to add extra fields """ birthdate = models.DateField(null=True, blank=True) avatar = models.ImageField(blank=True, null=True) class Post(models.Model): title = mod...
20ff77367388d4ebecddf504e25bc0dbd028894e
55fec7ed367dbe6fdd21db44ecb7be0a649e9282
sebasgoldberg/organizat
/planificacion/strategy/hago_lo_que_puedo.py
Python
py
1,372
no_license
# coding=utf-8 from django.utils.translation import ugettext from django.utils.translation import ugettext_lazy as _ from math import ceil from planificacion.strategy.base import PlanificadorStrategy class PlanificadorHagoLoQuePuedo(PlanificadorStrategy): def planificar(self): """ La idea es: 1) Tom...