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 |
|---|---|---|---|---|---|---|---|---|
cb8342f3bee812187cb1b95537cda88fd478c20b | b3b7502b1cf4c98036684d648a3f0ef9936805c1 | charbel-sakr/SP-Methods-for-IMC | /simulations/imc_dp_sqnr.py | Python | py | 8,373 | no_license | import numpy as np
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
#from scipy.stats import norm
#from scipy.stats import binom
from scipy.special import comb #n choose k
from scipy.stats import norm
def evaluate_snr(Yt,Yh):
return 10.0*np.log10(np.var(Yt)/np.var(Yt-Yh))
def quantizeSigned(... |
6617fa112ed14a56a10662d1bfa4c50055303c5e | f7f3f0f12e526afca2248c602c3c553a864f1b83 | FedorSarafanov/BoltekData | /BoltekEmulator.py | Python | py | 384 | no_license | import os, tty, termios
import time
master, slave = os.openpty()
tty.setraw(master, termios.TCSANOW)
print("Connect to:", os.ttyname(slave))
N=0
while True:
N+=1
try:
if N<100:
os.write(master,b"$+19.0\n")
print(1)
else:
os.write(master,b"$+18.55\n")
... |
130fb70651b4f598a0a21442bb2cac63c9565db5 | cabb00ee6de219d947fdd8f7d20a1632b984df51 | poojaelkal/LeetCode-solutions | /Python/#804_uniqueMorseRepresentations.py | Python | py | 533 | no_license | class Solution:
def uniqueMorseRepresentations(self, words: List[str]) -> int:
code = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
s = set()
for word in words:
st ... |
bc5103904d6103a183042aeacd470e6372bef1fe | d225b6554c9a3b386f74e761136b03fe2522215d | IssamLaradji/BlockCoordinateDescent | /src/partition_rules/partition_rules.py | Python | py | 3,132 | permissive | import numpy as np
def get_partition(A, b, loss, block_size, p_rule):
n_params = int(loss.n_params)
L = loss.lipschitz
# ASSERTIONS
if p_rule != "Ada" and p_rule != "VB":
# Assert fixed block methods have block size that divides the coordinates
# equally
assert (n_params % block_size) == 0
... |
d71d615222e2e0a12cc689e077ea10438f9ea0b0 | 96c3c9cf084f068489fe2c966dcac96ea38f8eae | enakann/sgws | /storage_grid/common/templates.py | Python | py | 341 | no_license |
"""
Copyright (c) 1992-2020 NetApp, Inc.
All rights reserved.
"""
__author__ = "Naveen Jadar"
fwdOutput = '''fwd output template'''
fwdInput = '''{"sizingTitle":"Workload 1","sizingType":"FORWARD"}'''
inputTemplates = dict.fromkeys(('aws', 'azure', 'gcp'), fwdInput)
outputTemplates = dict.fromkeys(('aws', 'azure'... |
acc2969fd21a6b28ed02fda22e066cb6509b5940 | 6d2054af59e8dc66d669ab5aa57649aa8dacd270 | sohjunjie/AIAF-BC409 | /_nasdaq_stock_price/data_cleaner.py | Python | py | 3,058 | no_license | import pandas as pd
from ta import *
data_foldername = "./data/"
# not using alibaba cause its only public in 2014
symbols = ['NDAQ','FB','AAPL','AMZN','NFLX','GOOG','MSFT','IBM','ORCL','INTC']
originalfile_postfix = ".csv"
cleanedfile_postfix = "_cleaned.csv"
# how many days ahead to predict
trend_days = 10
def ... |
4f5dfdb10d980d1571cad91c3d61e48dd1f5cbe8 | 3c84537f696425ba6a2594e43d0bbcf5fc1d9a55 | leelasd/clusfps | /third_party_package/RDKit_2015_03_1/rdkit/ML/Cluster/murtagh_test.py | Python | py | 945 | permissive | from __future__ import print_function
import numpy
from rdkit.ML.Cluster import Murtagh,ClusterUtils
from rdkit.ML.Cluster import Murtagh
print('1')
d = numpy.array([[10.0,5.0],[20.0,20.0],[30.0,10.0],[30.0,15.0],[5.0,10.0]],numpy.float)
print('2')
#clusters = Murtagh.ClusterData(d,len(d),Murtagh.WARDS)
#for i in rang... |
948a8fca0754f77c03ff4aa1c829de7cec49c6dc | 6935ef83a8191f72794bfab5aa50a1faff735fb5 | fcusay/Payroll | /Payroll.py | Python | py | 4,904 | no_license | class Payroll:
time_in = "00:00"
time_out = "00:00"
time_in_for_ot = "00:00"
time_out_for_ot = "00:00"
late_time = "00:00"
under_time = "00:00"
over_time = "00:00"
salary = 0
is_holiday = bool
def isHoliday(self, boolean):
self.is_holiday = boolean
def setTimeIn(sel... |
7d2cb73e4adcd477b370110506b689d950982737 | 464fd5b8e91cb82e82afe8a645db8e144d9a2ac0 | sabren/cornerops-svn | /duckbill/trunk/duckbill/test/EventTest.py | Python | py | 541 | no_license | """
test cases for Event
"""
__ver__="$Id: EventTest.py,v 1.6 2003/02/27 21:34:57 sabren Exp $"
import unittest
import duckbill
from duckbill import Event
class EventTest(unittest.TestCase):
def setUp(self):
pass
def test_amount(self):
"""
amount should always be a decimal or None
... |
bfc35e2a0bbb22d97f89aede97932daddddbd914 | 8129eb8bd9f80acc17ef15acab5ff551344229b0 | Pigcanflysohigh/Py27 | /classes/day05/homework/recure.py | Python | py | 1,707 | no_license | # -*- coding:utf-8 -*-
# li = [2,3,5,10,15,16,18,22,26,30,32,35,41,42,43,55,56,66,67,69,72,76,82,83,88]
#
# def find(l,i):
# mid = (len(l)-1) // 2
# if l:
# if i < l[mid]:
# find(l[:mid],i)
# elif i > l[mid]:
# find(l[mid+1:],i)
# elif i == l[mid]:
# ... |
16c0679556aad444703ac251a6d27a60fa8ff10a | 9c7e97b692e75a217bb9e88cb2902eb68ed22c54 | encodingl/skadmin | /sktask/urls.py | Python | py | 1,462 | permissive | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from sktask import project,job,extravars,task
urlpatterns = [
url(r'^project/index/$', project.project_index, name='project_index'),
url(r'^project/add/$', project.project_add, name='project_add'),
url(r'^project/delete/$',... |
0b0ad6d040c72d19e6e2d0fb0a007ed38f00b42e | 9e483b299b2b7c379f96080e1d11f89b1950ee40 | Nikkuniku/AtcoderProgramming | /Other/EDPC/q.py | Python | py | 2,109 | no_license | #####segfunc#####
def segfunc(x, y):
return max(x, y)
#################
#####ide_ele#####
ide_ele = 0
#################
class SegTree:
"""
init(init_val, ide_ele): 配列init_valで初期化 O(N)
update(k, x): k番目の値をxに更新 O(logN)
query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
"""
def __init__(self, in... |
44cdbaabae86604679f75259542e0c0f30ecdc15 | 06d6d667921d659e3f98c5a72e42c449ca42b5ed | Pistonomaxime/DeepLearning-on-JPEG | /deeplearning.py | Python | py | 12,098 | no_license | import time
from pathlib import Path
import keras
import numpy as np
from keras.datasets import mnist, cifar10
from keras.layers import Conv2D, MaxPooling2D, Dropout, Flatten, Dense, Activation
from keras.models import Sequential
from keras.regularizers import l2
from keras.layers.normalization import BatchNormalizatio... |
c8d82ce95b499e66e571a8f515b3603e87d1a0b4 | 16e79c67dbac55fd129efbfa8c27ac3bf8a2be29 | btskinner/grm | /grm/loc.py | Python | py | 4,006 | permissive | # loc.py
# -*- coding: utf-8 -*-
import os
import subprocess as sp
from .utils import *
class LocalGit:
'''
Class for local machine system management
'''
def __init__(self, main_repo = None, student_repo_dir = None):
if main_repo:
main_repo = os.path.expanduser(main_repo).rstrip... |
9b2a51eb606780c07e47eca0e3bde794d93a0a76 | 8e59fa27eec0debe6e1c0d575f40916a8ae9abbc | techiewarrior/CIRTKit | /modules/reversing/yarascan.py | Python | py | 8,085 | permissive | # This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import tempfile
import string as printstring # string is being used as a var - easier to replace here
try:
from scandir import walk
except ImportError:
from os import walk
from ... |
be534cef79734f7903f3b6aca24991253b688e4d | e0bfb3575b59bc2e1f91cebda5681cfb04a66ed2 | CatalinaPrisacaru/Di-Java | /workUndone/Suite15/OpenFlight_API/samples/scripts/egdof1.py | Python | py | 9,857 | no_license | ##
##
## Sample file: egdof1.py
##
## Objective: Shows how to create DOF records.
## Shows how to set local origins and limits in DOF records.
##
## Program functions: Create new database with name from command line.
## Builds 3 bars, chain them together under DOF records.
## Set the local origin and pit... |
88d5fb1c6c71b5d64cfac6ff08ffb2730ae2e622 | a1cde7e43121ceaa39a3c7dae1907cf5b8afbff3 | streetalabu/tracker | /views.py | Python | py | 1,711 | no_license | from flask import Blueprint, request, redirect, render_template, url_for
from flask.views import MethodView
from tracker.models import Session, Student
from flask.ext.mongoengine.wtf import model_form
students = Blueprint('students', __name__, template_folder='templates')
class ClassView(MethodView):
def get(self... |
384d37e0213c84d6e5049df2d9a3a8a751b77b14 | 29a9b835e0a3a6ebf62a719158eaf1c0cb65ee7b | bhavikdesai/Test-Drive | /entrypoint/calm_approve_bp.py | Python | py | 2,135 | no_license | """
calm_approve_bp.py: automation to approve blueprints in
the Marketplace Manager on NX-on-GCP / Test Drive.
Author: michael@nutanix.com
Date: 2020-03-18
"""
import sys
import os
import json
import copy
import uuid
sys.path.append(os.path.join(os.getcwd(), "nutest_gcp.egg"))
from framework.lib.nulog import INFO... |
190b8bb95d6fdee645869a89f2d452cdbec4807a | 89dcb060e454d027a8b2863b4fce5e4e9fbad3f1 | agrawalreetika/trance | /service/datadiscovery.py | Python | py | 650 | no_license | import pandas as pd
from pyhive import presto
from requests.auth import HTTPBasicAuth
host = '<presto-url OR ip>'
port = 8443
username = '<username>'
password = '<password>'
schema = '<schema-name>'
def query_discovery(query):
requests_kwargs = {
'auth': HTTPBasicAuth(username, password),
'verify... |
247fdbe89f6705c935af7704497538095fffabf0 | e8db1808e8efa551f8008307c871ba15ea7ac0b9 | Doun92/UNIL_DH_memoire | /script_11/Marchand jureur/Marchand_jureur_dict_meta.py | Python | py | 3,453 | permissive | dict = {
"HAT" : "a",
"ACCAPTĘT" : [["achatoit"], 'verbe_imparfait'],
# " " : "ai",
# " " : "al",
"AMLĘT" : [["alloit"], 'verbe_imparfait'],
"AMĘN" : "amen",
"APPRĘSSU" : ["aprés", "apres"],
"ADRĘTYOS" : "arieres",
"ADVERSU" : "avers",
"BONUS" : "bons",
# " " : "cel",
# " " : "cest",
"CAMBYARAS" : "changer... |
a9250d53278f5cfa2eec57e4600ae3dc362491a5 | bca7675d0e5ab9b76da065d95d4a8cfa74d370e4 | robj137/ProjectEuler | /P47.py | Python | py | 1,164 | no_license | #!/usr/bin/python
from datetime import datetime
import sys
def getAllPrimes(min = 0, max = 1e10):
f = open('prime.txt')
#f = open('Primes.txt')
primes = []
for line in f:
for y in (line.rstrip('\n').split()):
if int(y) < max and int(y) > min:
primes.append(int(y))
f.close()
return primes
... |
7192308f40b84ad37ec5f85fe08d2e5ceaff546e | e322e6948d59eb1add532b217ed6d53fecaa5e9b | Andreskcrs21/Cursos | /main/models.py | Python | py | 427 | no_license | from django.db import models
from datetime import datetime
# Create your models here.
class Curso(models.Model):
curso_titulo= models.CharField(max_length=200)
curso_contenido= models.TextField()
curso_publicado= models.DateTimeField("Fecha de publicacion", default=datetime.now())
costo = models.Decim... |
fb98ad4c7cccded2c4fd11de87f5550ab3db7ff1 | 91df21f2cc50bea7d1945e7d9ff4c6da1adf5bbe | Urvashi-91/Urvashi_Git_Repo | /Leetcode_Practice/FastAndSlowPointers/middleOfTheLinkedList.py | Python | py | 768 | no_license | '''
TC: O(N)
SC: O(1)
'''
class Node:
def __init__(self, value, next=None):
self.value = value
self.next = next
def find_middle_of_linked_list(head):
slow = head
fast = head
while (fast is not None and fast.next is not None):
slow = slow.next
fast = fast.next.next
return slow
def main():
... |
98132922ba6d777aa8cb74cf54f89926af99b668 | cb270859d0070e11cbb9fff49f287fd3a741e0cd | ShraddhaVarat/VillageEmp | /app/migrations/0004_villageindustry_vname.py | Python | py | 397 | no_license | # Generated by Django 2.0.3 on 2018-11-13 11:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_villageindustry'),
]
operations = [
migrations.AddField(
model_name='villageindustry',
name='vname',
... |
133fe5eaeaba5e576fdc9fc47ddbc0a507ef8636 | 8ffe8c880948e668417b4d24d672fa31794f8c34 | rishika11A/cleverhans | /cleverhans_tutorials/mnist_vae_cw_reon.py | Python | py | 25,721 | permissive | """
This tutorial shows how to generate adversarial examples
using C&W attack in white-box setting.
The original paper can be found at:
https://nicholas.carlini.com/papers/2017_sp_nnrobustattacks.pdf
"""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __fu... |
63b509120dbd5b86172efcc7b1f419804ce89ac2 | 0dd30730adb3c8bb69f9789a5eebf36370f00dc7 | amit000/flask_api | /tests/Integration/base_test.py | Python | py | 471 | no_license | from unittest import TestCase
from app import app
from db import db
class BaseTest(TestCase):
def setUp(self):
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///"
with app.app_context():
db.init_app(app)
db.create_all()
self.app = app.test_client()
self.ap... |
68232d4f1171444408c6194ec4253165f3d0bb41 | 6556458e995fc7760dca200a3a6454f40e91ac60 | gmmallik/help-me-code-snippets | /spark/structured_streaming/py_spark_snippets.py | Python | py | 2,210 | no_license | from pyspark.sql.functions import *
from pyspark.sql.types import *
# original input schema
jsonSchema = (
StructType()
.add("timestamp", TimestampType()) #event time at the source
.add("deviceId", LongType())
.add("deviceType", StringType())
.add("signalStrength", DoubleType())
)
"""
reading from a data ... |
813c7f6f24185be3988952ae84540b9f0f000953 | e00b54c7e0c2467f39fe58bd24eb483c60d2494d | gphat/honeybird | /genny.py | Python | py | 858 | no_license | import datetime
import json
from random import choice
import requests
headers = {'content-type': 'application/json'}
services = [ "cuckoo", "hummingbird", "colony", "bigbird", "zipkin", "chickadee", "koalabird" ]
sources = [ "box1", "box2", "box3", "box4", "box5" ]
etypes = [ "incident", "deployment", "notice" ]
user... |
0cf29b257053dd607182ea99ece5e606d9ee3b10 | 563cccb2bc0d2bbb0dad7124f2aa8db091b431b5 | zhangjm12/monasca-agent | /monasca_setup/detection/service_plugin.py | Python | py | 10,870 | permissive | # (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
# 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 ap... |
431c42b56e0ff98fff00052cc40ad8f66877915e | 02ed458e8ef3f7f155552d433d0c6cc1adfd8968 | PetarDamyanov/LinkCrawler | /crawler/crawler.py | Python | py | 2,961 | no_license | from crawler.urls.url_gateway import UrlsGateway, Urls_Source_Gateway
from bs4 import BeautifulSoup as bs
import requests
from datetime import datetime
def craw_url(url):
request = None
try:
request = requests.get(url)
soup = bs(request.content, 'html.parser')
for link in soup.findAll(... |
b74baa776d59eb8fbd25f9274fe59180ed3c2840 | 89c177cd13f7f86c8a5c8a7f10abef42a812a5d4 | akhil-itc/poc | /library/migrations/0001_initial.py | Python | py | 2,462 | no_license | # Generated by Django 3.1.2 on 2020-11-08 06:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
143c89672c209871ae9951a3b770a88aedfba9b3 | f635fcc211d671e55ad914894ee4b79d8d578a3f | tejas-mulay/RoboLamp | /object_detection.py | Python | py | 1,710 | no_license | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
ret, frame1 = cap.read()
ret, frame2 = cap.read()
def musky(frame):
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_blue = np.array([110,50,50])
upper_blue = np.array([130,255,255])
mask = cv2.inRange(hsv, lower_blue, upper_blue... |
7076db45c3fb6f066ed06ef7b72b251d1bcffadc | affd48e0cb2e045c71c294cf591ea4247ab0799d | sassembla/SublimeSocketInstaller | /SublimeSocket/SublimeWSSettings.py | Python | py | 388 | no_license | SS_HOST_REPLACE = "SUBLIMESOCKET_HOST"
SS_PORT_REPLACE = "SUBLIMESOCKET_PORT"
SS_VERSION_REPLACE = "SUBLIMESOCKET_VERSION"
#Protocole version see-> http://tools.ietf.org/html/rfc6455
VERSION = 13
#Operation codes
OP_CONTINUATION = 0x0
OP_TEXT = 0x1
OP_BINARY = 0x2
OP_CLOSE = 0x8
OP_PING = 0x9
OP_PONG = 0xA
OPCODES ... |
e09329f13102848df20d2c505afb47497b916598 | 5f2c317a59eac0b0ea8545f256de60ca71655ccc | anrao91/credy | /credy/settings.py | Python | py | 3,730 | permissive | """
Django settings for credy 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
# ... |
0e2e25d4840ed50ffd06d3d6fafe3585ca5cfaef | ace4f1b25aed5ddb797d629d66461fb5b2c33500 | skittleys/dotfiles | /2-sublime/.config/sublime-text-2/Packages/Schemr/schemr.py | Python | py | 11,795 | no_license | import sublime, sublime_plugin
import sys, os, re, zipfile
from random import random
sys.path.insert(0,"/usr/lib/python2.7/")
sys.path.insert(1,"/usr/lib/python2.7/lib-dynload")
try: # ST3
import Schemr.lib.plist_parser as parser
except (ImportError): # ST2
sys.path.append(os.path.join(os.path.dirname(__file__), 'l... |
12988b823ed8920dca76950b7add79f7043d2a8b | 3b75ef6dbd4293dcba17d82aa9a1e889501062bb | bengolder/duspexplorer-graph | /main.py | Python | py | 6,608 | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
from pprint import pprint
import json
import random
import networkx
from networkx.readwrite import json_graph
import web
import pystache
from datertots.core import (
xls_to_dicts,
writeToXls,
)
g = networkx.Graph()
def simpl(stu... |
c78a69ab89efd1ba9b1c811ea136d4b7bdc58087 | b42df8ddfa3656078818f5421f343177050135b9 | Yelp/swagger-spec-compatibility | /swagger_spec_compatibility/cache.py | Python | py | 1,298 | permissive | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import typing
try:
from functools import lru_cache as _lru_cache # type: ignore # py>=3.2
except ImportError: # pragma: no cover
from functools32 import lru_cache as _... |
bdf54a8d9eb0a35055b28eca0ef773fe3b0d579f | 7e005f7289517e121092feb2746e6ed098788d8b | Kevin043/UnidadIIICAK | /Videos/KCA_Singleton.py | Python | py | 559 | no_license | # Name: Kevin Castillo Antunes
# Grup: GITI9072-e
class Borng:
_shared_state = {} # Attribute dictonary
def __init__(self):
self.__dict__ = self._shared_state # Make it an attribute dictonary
class Singleton(Borng):
def __init__(self, **kwargs):
Borng.__init__(self)
... |
ada17f85e478fe4fe578dcd416c5be6fdd33c139 | 83cc52ae12f968b0784e67cdef289964501078ac | cr8ivecodesmith/django-orm-extensions-save22 | /django_orm/postgresql/functions.py | Python | py | 272 | permissive | # -*- coding: utf-8 -*-
from django.db import models
from django_orm.core.sql import SqlFunction
"""
Functions for varchar and text fields.
"""
class Unaccent(SqlFunction):
sql_function = 'unaccent'
class BitLength(SqlFunction):
sql_function = "bit_length"
|
a9438961687c39e2bcb9335bb22280865f4de702 | 026eb9cac7fc5046241d66759af373bfb924f41c | parely/floodway | /Rubber2552.py | Python | py | 572 | no_license | import csv
import plotly.plotly as py
from plotly.graph_objs import *
py.sign_in('aul99999', 'YJdLMTY53oqOanHFhxrw')
with open("Rubber.csv", "r") as database:
reader = csv.DictReader(database)
month = {}
num = 1
for i in reader:
month.setdefault(num, [i["YEAR"], i["2552"]])
n... |
766bf68b361a59869d554f2ca4715fc73428981a | 9de3afce843388fc307375602ab015a21ce65da9 | Adamantios/NN-Train | /networks/cifar10/baseline_ensemble_v2/submodel1.py | Python | py | 974 | no_license | from typing import Union
from tensorflow.python.keras import Model
from networks.cifar10.complicated_ensemble_v2.submodel1 import cifar10_complicated_ensemble_v2_submodel1
def cifar10_baseline_ensemble_v2_submodel1(input_shape=None, input_tensor=None, n_classes=None,
weigh... |
f9a2d6ea745d467c306465a84b5a55392ac72b9d | 40a628324e273c236c7f0ebf999e951fc0e813ce | rhong3/Lionnet_Rotation | /Scripts/Legacy/loadmodelWS3D.py | Python | py | 9,280 | permissive | import numpy as np # linear algebra
import torch
from torch.autograd import Variable
from skimage import io
from torch.nn import functional as F
import skimage.morphology as mph
import sys
import os
import pickle
import scipy.misc
from scipy import ndimage as ndi
from skimage.feature import peak_local_max
import skima... |
8faaf095e689517d2892b3183ed4510ab5e6f484 | 67b044ffda521be694e5253ea04262cc4161bb47 | jmeinken/social_base | /main/templatetags/mycustom.py | Python | py | 286 | no_license | from django import template
from main import helpers
register = template.Library()
@register.filter
def pretty_html(value):
return helpers.pretty_html(value)
@register.filter
def keyvalue(dict, key):
if key in dict:
return dict[key]
return '' |
941093e423dd1f2514b82438ccace64d51f74c8c | 9937bcbf7be73ba3e8878b6ae2e3632c8b5576b1 | junlingsun/covid_tracker | /service.py | Python | py | 1,573 | no_license | import time
import pymysql
def getTime():
timeString = time.strftime("%m-%d-%Y %X")
return timeString
def getConnection():
connection = pymysql.connect(host="localhost",
user="root",
password="EllaSun-521",
... |
9ba7a30f43e4c754c27b51cb690def354eb191e0 | 210b8bf28306095fd9f62c4b7204d2dbe6202d61 | redsphinx/3tconv | /utilities/utils.py | Python | py | 15,788 | no_license | import os
import shutil
import numpy as np
from torch.nn import CrossEntropyLoss, functional as F
from torchviz import make_dot
import torch
from datetime import datetime
import subprocess
import time
from config import paths as PP
def initialize(project_variable, all_data):
loss_epoch = []
accuracy_epoch = ... |
d10353f92e96ef2b0e15e7266bb1fee3c86506ae | b906894b4834953698e396ed4aaec8c6436f0dc4 | raelga/hive | /hack/generate-operator-bundle-operatorhub.py | Python | py | 8,297 | permissive | #!/usr/bin/env python
#
# Generate an operator bundle for publishing to OLM. Copies appropriate files
# into a directory, and composes the ClusterServiceVersion which needs bits and
# pieces of our rbac and deployment files.
#
# Usage: hack/generate-operator-bundle.py (osd|operatorhub)
#
# See help for options.
#
imp... |
a603108d5ed2bb879a2a379eb8313860a2421dbb | b4f4ecc4562d17a8796e27cf5578c9c15173915f | jancajthaml-openbank/vault | /bbtest/steps/journal_steps.py | Python | py | 2,898 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from behave import *
import json
import os
import glob
from openbank_testkit import Request
@then('snapshot {tenant}/{account} version {version} should be')
def check_account_snapshot(context, tenant, account, version):
filename = os.path.realpath('/data/t_{}/account... |
d4aa46f797e5aa84ef94afa36e707ebb5109afbc | 4d16b18d93dbe6a26c1601ee062d22588f4a6af6 | Kevinxu99/NYU-Coursework | /CS-UY 1134/Lab/Lab10/Lab10_q4.py | Python | py | 4,365 | no_license | class Empty(Exception):
pass
class ArrayQueue:
INITIAL_CAPACITY = 10
def __init__(self):
self.data = [None] * ArrayQueue.INITIAL_CAPACITY
self.num_of_elems = 0
self.front_ind = 0
def __len__(self):
return self.num_of_elems
def is_empty(self):
return (self... |
20e8d8613136c358c806e52c6827522fd360fb5c | 76cde656c8676f0999b14ce9e8249a2715b11e03 | oshaughn/research-projects-RIT | /MonteCarloMarginalizeCode/Code/bin/util_ConstructIntrinsicPosterior_GenericCoordinates.py | Python | py | 164,522 | permissive | #! /usr/bin/env python
#
# GOAL
# - load in lnL data
# - fit peak to quadratic (standard), GP, etc.
# - pass as input to mcsampler, to generate posterior samples
#
# FORMAT
# - pankow simplification of standard format
#
# COMPARE TO
# util_NRQuadraticFit.py
# postprocess_1d_cumulative
# util_QuadraticMas... |
e81a77588f8a1bc18d104906cfbed80c909dbda1 | 89af10ae68ac5725bfb39ce172a37900696eab24 | matthewgall/beewa | /setup.py | Python | py | 2,191 | permissive | """A setuptools based setup module for beewa
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
import re
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with ... |
a61d1f4a8bfc4dc975f8d9a12817f32cd8b51b6a | 40540f9b0a5ff8c7c561115539f1e0065bcb38c5 | jayeetaghosh/POC | /keras-finetune-cifar10-distracteddriver/train_cifar10.py | Python | py | 3,842 | no_license | # set the matplotlib backend so figures can be saved in the background
# (uncomment the lines below if you are using a headless server)
import matplotlib
matplotlib.use("Agg")
# import the necessary packages
from sklearn.preprocessing import LabelBinarizer
from sklearn.metrics import log_loss
from keras.preprocessing.... |
dcd92567517f26c88827c769612daadaba00ce42 | c945000137e899c92ba2fb0ca75b7f8efc71a3c2 | krish1010/liquor-app | /liquor_app/settings.py | Python | py | 3,176 | no_license | """
Django settings for liquor_app 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... |
dc62a73327fbaa7c572f6633083ec9a4d1b01a84 | 49bea5fb28f7044f21532affff4c3209f73eb0ef | pramaku/hpecp-python-library | /docs/source/conf.py | Python | py | 2,391 | permissive | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
3505ead85295aff86123948077224eba5f9a3348 | cfc8e4be85f63b50c670495819c997a859a003cc | bosskme/holbertonschool-higher_level_programming | /0x05-python-exceptions/2-safe_print_list_integers.py | Python | py | 337 | no_license | #!/usr/bin/python3
def safe_print_list_integers(my_list=[], x=0):
length = 0
count = 0
for i in my_list:
length += 1
for j in range(x):
try:
print("{:d}".format(my_list[j]), end="")
count += 1
except (ValueError, TypeError):
pass
print("")
... |
e889bd01efc9a804c45b048d37cc0f41918baba1 | b828da12cf6e08a168d0a5f4529bc44aaa570843 | jeffrepo/pedidos_tienda | /__manifest__.py | Python | py | 460 | no_license | # -*- coding: utf-8 -*-
{
'name': "Pedidos Tienda",
'summary': """Pedidos Tienda""",
'description': """
Pedidos Tienda
""",
'author': "aquíH",
'website': "http://www.aquih.com",
'category': 'Uncategorized',
'version': '0.1',
'depends': ['purchase'],
'data': [
... |
50a7fb3d9fdb0b3c15605a3817892ff2ef1de5a7 | 0b3fff8e50f93f3eabc7eefa4953bf15a00bb79b | wilod98673/python-storage | /synth.py | Python | py | 1,143 | permissive | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... |
9b0d8c171f9d85984cd42d38d3772f8c10283ef9 | c5c0b583ee5525874851a84627fdcd4854597a89 | vishalramaswamy/BICapstoneProject | /TimeseriesRelated/generate_timeseries.py | Python | py | 589 | no_license | # Script to generate timeseries based on date of photos.
import csv
import re
import pickle
from datetime import datetime
from collections import defaultdict
dd = pickle.load(open('temp1.txt', 'rb'))
final_dict = defaultdict(int)
for date in dd:
#print date.year
#print date.month
final_dict[(date.year,date.month... |
8387724ec6b0ce7ef757149610fd9bcd2373054a | 275194e6706e25bf1dc243a74288e69349cc47cb | anitrajpurohit28/PythonPractice | /OTHER_PYTHON/PythonMasterclass/dict_challenge_traversing_map_impl_3.py | Python | py | 2,598 | no_license | # Challenge time!
# We have mentioned that the data for the Adventure game could be organised in many
# different ways. We've created another way for you.
# Your mission, if you choose to accept it, is to
# change the code to make it work.
# Below is the the complete program from the last video, but with the
# locatio... |
54a4ed13f84fdc0a1f5b2275d226db733a091f9a | 8cfa8aec1698765d859c4ae5c5f5131fd10e3cbc | montblake/server-only-dj-and-flask | /migrations/versions/77a959835337_episodes_table.py | Python | py | 1,213 | no_license | """episodes table
Revision ID: 77a959835337
Revises: a369d1681352
Create Date: 2021-07-26 16:09:17.885503
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '77a959835337'
down_revision = 'a369d1681352'
branch_labels = None
depends_on = None
def upgrade():
#... |
2c244ec2caf44b82c8c19a4b533bc42299dbf830 | 1348bf4366ea5a0b594fc340bf85b2086b8eee60 | weifanghuang/python_learn | /pygame_practice/Game/try again/kim_game.py | Python | py | 881 | no_license | import sys
import pygame
from preferences import Preferences
from plane import Airplane
from spider import Spider
import game_functionx as gf
from pygame.sprite import Group
from game_sta import GameSta
def kim_game():
pygame.init()
set = Preferences()
screen = pygame.display.set_mode((set.screen_width, s... |
ddca9a30277d43d543f9ffd5f574a3f8f00c7ecd | 6d6580513a5f89846eb64130b5eb72a161ce4f19 | kai-ton/foxford_gorskaya57 | /22_5.py | Python | py | 229 | no_license | a = list(map(int, input().split()))
n = int(input())
if n > a[0]:
print(1)
else:
for i in range(len(a) - 1):
if a[i] >= n > a[i + 1]:
print(i + 2)
break
else:
print(len(a) + 1)
|
d8098dd8d51441383b3ca0dea9f004ad7057d2f3 | 2bdb42d7597f2aac4cfc1631c052511a99a05d5a | pkliczewski/client-python | /test/test_v1_object_meta.py | Python | py | 877 | no_license | # coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... |
b7989b37e7961e7972ec4d8ed5d45ffed5b5a751 | 3b9404de682202d04907d1345c58b3784c8a6553 | cosmorogers/co2-monitor | /app.py | Python | py | 1,047 | permissive | from flask import Flask, render_template
from smbus import SMBus
import time
EE895ADDRESS = 0x5E
I2CREGISTER = 0x00
app = Flask(__name__)
i2cbus = SMBus(1)
@app.route("/")
def index():
return render_template('index.html')
@app.route("/api")
def api():
read_data = i2cbus.read_i2c_block_data(EE895ADDRESS, I2C... |
6088cc2024581119a737a004bd0cefd52826244e | 43ffaef04c08187d20dff62c8a8c013a3674ad56 | Stefan4472/Stefans-Blog | /stefan-on-software/stefan_on_software/api/emails_api.py | Python | py | 1,307 | permissive | import flask
import marshmallow
from flask import Response, current_app, request
from stefan_on_software.contracts.register_email import RegisterEmailContract
from stefan_on_software.email_provider import get_email_provider
from stefan_on_software.site_config import ConfigKeys
# Blueprint under which all views will be... |
b3a3bc46259ae2e616018b6aad854f944d8ffaf1 | 86e4a75aae153f531d6c0425accc6b28e4fb9441 | harshithaswarup/car-parking | /vehicle_slot.py | Python | py | 4,938 | no_license | import datetime
class Vehicle(object):
def __init__(self,vehicle_number,vehicle_type1):
self.vehicle_number=vehicle_number
self.vehicle_type1=vehicle_type1
class Parking(object):
def get_vehicle_type(self,get_type):
vehicle_type=get_type
return vehicle_type
def... |
209b2bdb200e02d843bda3062f03927eb7bf570f | d998094c7dac7632d7971f5f0603509c77672f5f | Elijah-M/Module8 | /PythonDatetimeAssignment/DateTime_test.py | Python | py | 327 | no_license | import unittest
from PythonDatetimeAssignment.DateTime import half_birthday
from datetime import timedelta
import datetime
class TestDateTime(unittest.TestCase):
def test_half_birthday(self):
self.assertEqual(half_birthday(2020, 4, 29), datetime.date(2020, 10, 28))
if __name__ == '__main__':
unittes... |
82cce97146241ff36997c04a432beb6162b7f74b | aa13d912f7488ec8b4625a77ec3f53d9571435f0 | moeabdol/sorting-algorithms-visualizer | /main.py | Python | py | 1,040 | no_license | import pygame
import display
from algs import algorithm_dict, run_algorithm
from random import randint
def main():
numbers = []
running = True
display.algorithm_box.add_options(list(algorithm_dict.keys()))
while running:
for event in pygame.event.get():
if event.type == pygame.QUI... |
af42fd6a2e3ba65a55b353c807d4e5a0cc920138 | 84130d6332ae12f7255ba8125e890bcf94de2d51 | sandyg05/leetcode | /038/Solution.py | Python | py | 2,229 | no_license | """
The count-and-say sequence is the sequence of integers with the first five terms as following:
1. 1
2. 11
3. 21
4. 1211
5. 111221
1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
Given an integer n where 1 ≤ n ≤ 30, generate the n... |
a4f032cdd5351cba615fa1a917f06d38a0c74fac | b1bf4a69224b940c99491ff6c3d089cb828dff88 | B1ztn/stock_price_analysis | /stock_models.py | Python | py | 8,437 | no_license | import urllib.request
import urllib
import requests
import json
from selenium import webdriver
import time
import os
from os import path
import pandas as pd
import openpyxl
import matplotlib
from pandas_datareader import data as pdr
import datetime
## collect universal company list
def update_universal_company_li... |
efe9087434a3ff878153e0038489c5e8ef9641a1 | 62d8778c9e583f427b2da252b8a76e34c9433cb4 | niujie/Python_Course_2020 | /code/P2/Q1_20a.py | Python | py | 501 | no_license | # 1.20 (a) on Applied Numerical Methods Using MATLAB
# p64
import numpy as np
x = 9.8e201
y = 10.2e199
def z1(x_, y_):
return np.sqrt(x_ ** 2 + y_ ** 2)
def z2(x_, y_):
return y_ * np.sqrt((x_ / y_) ** 2 + 1)
try:
print('z1({}, {}) = {}'.format(x, y, z1(x, y)))
except OverflowError:
print('Too La... |
3dae77bb908bd488a8b48578b6bafd4296bc3fd6 | dbf5bb0d4e6d0d138a4d12d849dac68a6538c352 | jan2k/trac | /trac/upgrades/db8.py | Python | py | 1,252 | permissive | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2021 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This software cons... |
2d9059f933fb73a728b9758779fd8ec2784c95f2 | 22b9f4152b3e0d8b5f9f402dd0e7f3c6b49556df | clld/clld | /src/clld/db/models/common.py | Python | py | 1,382 | permissive | # flake8: noqa
"""Common models for all clld apps."""
from ._mixins import (IdNameDescriptionMixin,
DataMixin, HasDataMixin, FilesMixin, HasFilesMixin)
from .config import Config
from .language import (Language_data, Language_files, Language,
LanguageSource,
IdentifierType, Identifier, LanguageIdentifier)... |
e067052e3114422a975fa0a7b18314a4f6c1fa0e | 182ebdb80b04e85d519cb4e5d25d87dd9cf89227 | Baraks24/python-consumer | /elasticsearch_wrapper.py | Python | py | 2,974 | no_license | from elasticsearch import Elasticsearch,helpers
from config import ELASTICSEARCH_HOSTS,USERS_INDEX,PROJECTS_INDEX,DISCUSSIONS_INDEX,TASKS_INDEX,UPDATABLE_INDICES
from JSONSerializer import JSONSerializer
import json
es = Elasticsearch(ELASTICSEARCH_HOSTS,serializer = JSONSerializer())
#TODO: actually write something ... |
8665238d65c7b1dee0b939aed9f84a79acdfa92f | d3b70367bbf5fadb86b627682e2dad4c35daa6b1 | SandraDenny/BMS | /main.py | Python | py | 1,872 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 22 17:40:11 2019
@author: admaren
"""
import sys
import npyscreen
sys.path.append("/home/admaren/Documents/BankManagementSys")
from Views.welcome import Welcome_contents, MainForm
from Views.UserHomeView import user_home_contents_viewfunc, UserHom... |
15ff89ea0cc50d15351c232180424d253107a3bc | 3fd1ec74b0074f5038cc6805db7b04d7eecc7336 | pupledeadcat/Intelligent-pension-system-based-on-Emotional-Analysis | /mysite/myapp/videoClient.py | Python | py | 2,533 | no_license |
import socket
import struct
import time
import traceback
import cv2
import numpy
class Client(object):
"""客户端"""
def __init__(self, addr_port=('192.168.1.4', 11000)):
# 连接的服务器的地址
# 连接的服务器的端口
self.addr_port = addr_port
# 创建套接字
self.client = socket.socket(socket.AF_INE... |
f6b1efad3dc9b8972454967d4987d9004df7d456 | 58e0d00998d0a9ec725503947cd88d7ea3a440fb | jbrockmendel/statsmodels | /setup.py | Python | py | 13,543 | permissive | """
To build with coverage of Cython files
export SM_CYTHON_COVERAGE=1
python setup.py develop
pytest --cov-config=tools/coveragerc/.coveragerc_cython --cov=statsmodels \
statsmodels
"""
import fnmatch
import os
import sys
import shutil
from collections import defaultdict
from os.path import relpath, abspath, sp... |
8c503e3b14567a9b2a5181cfc1c7cfe144b40445 | 1f813924d8ce3793bfee8e514ab2b3615b917bdc | studio3104/leetcodeAnswers | /30-Day-LeetCoding-Challenge/April/day07.py | Python | py | 1,025 | no_license | from typing import List, Set
import pytest
class Solution:
def countElements2(self, arr: List[int]) -> int:
return len([i for i in range(len(arr)) if arr[i] + 1 in arr])
def countElements(self, arr: List[int]) -> int:
hs: Set[int] = set(arr)
result: int = 0
for n in arr:
... |
c7008b41fac8bb26bc22721a32c7650f04ffd9cb | 4c544a1225e4f24c1c5cad6decd7ac6d3095224a | pinstinct/aws-ec2-deploy | /django_app/member/migrations/0002_myuser_user_img.py | Python | py | 455 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-11 09:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('member', '0001_initial'),
]
operations = [
migrations.AddField(
... |
4fe461218acd12219e8392c0dcfc5b9424c6793d | 098e488cc14c5553ad503cc7414d4d1272cf3093 | songtoan0201/algorithm | /leetCode/happyNumber.py | Python | py | 284 | no_license | hashset = set()
def isHappy(num):
sum = 0
for digit in str(num):
sum += int(digit)**2
print(sum)
if sum != 1 and sum not in hashset:
hashset.add(sum)
print("set", hashset)
return isHappy(sum)
return sum == 1
print(isHappy(16))
|
a5cdfe7edfc81af729ac12b4a2a5dcc692256422 | c9f02943babe900e3e9218554c30545183e1ec68 | shyamu-ar/bidrequest | /wurfl.py | Python | py | 19,214 | no_license | import requests
import datetime
import json
Start_time = datetime.datetime.now()
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'} # User Agent of Chrome, you can set any browser user agent
useragents = ["Mozilla/5.0 (Linux; Android ... |
d9eb881ae6eced7c5f28aec17e4b6170b8cb6eec | 1cabc284b2d8ef65a78898deb95fece9db00fb4a | MazDesire/Diplom | /Diplom_1/models.py | Python | py | 3,568 | no_license | from django.db import models
"""
создание таблиц бд
"""
# Create your models here.
class Client(models.Model):
SecondName = models.CharField(max_length=50)
FirstName = models.CharField(max_length=50)
LastName = models.CharField(max_length=50)
Name = models.CharField(max_length=50)
Address = models.... |
2c17eac1443bdb8ce590704255179877143ba014 | 17ad2586f82ac8b445d86b0949607ee98bdb4e12 | 1749887832/connector | /port/jky/lib/login/userLogin.py | Python | py | 2,190 | no_license | from django.contrib.auth.models import User
from django.http import JsonResponse
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.views import ObtainAuthToken
from django.contrib.auth import authenticate, login, logout
from port.jky.bin.msgDispose import msgReturn, msgCheck
class UserLo... |
5529b5df77d4149a0eafacc041e668986a678bd9 | 8c5bc932c5d3a0e97dc84e28c980a16db3b1fda7 | vksbhandary/python-programming | /problems/sets/set-operations.py | Python | py | 769 | permissive | # Name of problem: "Set .discard(), .remove() & .pop()"
# This is solution to problem stated in link https://www.hackerrank.com/challenges/py-set-discard-remove-pop/problem
# Points - 10
# Difficulty- Easy
# Concept usage - Sets
def set_pop(s):
s.pop()
return s
def set_discard(s,i):
s.discard(i)
ret... |
1b3a1ce0ad352173a5e2daf462cc3aeb36103e43 | 70dd58b506d6aa1bcc419695b201909934526e51 | ThonyPrice/Bachelor_Thesis | /old_code/chiSquare.py | Python | py | 689 | no_license | from readData import readData
from sklearn.datasets import load_iris
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
import numpy as np
def select(k):
data = readData().data
target = readData().targets
labels = readData().labels
X = data
y = target
... |
0899b8dccf0786be5a62ebb3b1b9ee7ddd677ce7 | 705366a20f990b1a9b56c66685ac068a4f91e1ca | CMAP-REPOS/cmap_trip-based_model | /src/Mode-Dest-TOD/sharrow/sharrow/tables.py | Python | py | 2,930 | permissive | import numpy as np
import pandas as pd
import pyarrow as pa
class Table:
def __new__(cls, init, *args, **kwargs):
if init is None:
return None
if isinstance(init, cls):
return init
return super().__new__(cls)
def __init__(self, init, nthreads=None):
if ... |
435a98f2f961a0ccaa67b97fa1b1bff20746c3d8 | 44191a626bd9c6e780e8f53de3a4435df9a7eb60 | jhon1204/TESIS2021 | /QairaData/TestFillGrid.py | Python | py | 350 | no_license | import unittest
import datetime
from Utils.Grid import MyGrid
from Utils.Qaira import Qaira
import numpy as np
class TestGrid2(unittest.TestCase):
def testFillGrid(self):
qaira=Qaira()
qaira.getAll()
grid=MyGrid()
grid.initializeMatrix()
grid.updateAQMatrix()
if __name__=='... |
38127f776be7c036c48c64999858d4863c1a14fd | ca4fe1d527f279f49840bab352c284a8a80a9fca | tianhaoz95/capstone | /capstone/rank.py | Python | py | 7,282 | no_license | import pandas as pd
import numpy as np
from sklearn import svm
from sklearn import tree
from sklearn.linear_model import LogisticRegression as lr
import graphviz
import nltk
from nltk.chunk import *
from nltk.chunk.util import *
from nltk.chunk.regexp import *
from nltk import Tree
import json
from sklearn.metrics impo... |
ccbf69e4ed9eeaff2a2d5539072ec2ab6d18658f | 812c1b5e53651c8d45d64c633c1cdb4653cb68e7 | Emanoid/JoesAutomotiveQuotingSystem | /Views/CarView.py | Python | py | 303 | no_license | class CarView:
def __init__(self,car):
self.car = car
def display(self):
print("Car Information")
print("ID: ",self.car.id)
print("Make: ",self.car.make)
print("Model: ",self.car.model)
print("Year: ",self.car.year)
print()
|
b0af70b81b7e26abaa462d5477de061d6361b556 | 306685d1882c8eb2dbb122194142cb56f6062476 | anodot/daria | /agent/src/agent/cli/prompt/pipeline/base.py | Python | py | 8,710 | permissive | import click
import pytz
import re
from copy import deepcopy
from agent.cli import preview
from agent.modules.tools import infinite_retry, if_validation_enabled, dict_get_nested
from agent import pipeline
from agent.pipeline import Pipeline
class Prompter:
timestamp_types = ['string', 'datetime', 'unix', 'unix_m... |
6ea60b922985f99deaab870236e67ca7e30cad3d | 8be0828ee692d01433f9a3aa2e70099264b3be46 | medetzhan1996/zhanaLike | /mysite/shop_site/migrations/0031_auto_20200713_2135.py | Python | py | 444 | no_license | # Generated by Django 3.0.8 on 2020-07-13 15:35
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shop_site', '0030_auto_20200713_2111'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='author',
... |
6586db4d28b884996e963334a34ba11af0b9d279 | 4a6769f66a63514bc0be5504e84de96ba9a377f3 | kevinkraft/World_RTS_2 | /items.py | Python | py | 4,274 | no_license | import sys
import pygame
from pygame.locals import *
"""
Items, including resources
"""
# 0 = food size 1
# 1 = wood size 1
# 2 = stone size 2
#
class Item(object):
"""
All game items
"""
def __init__(self, itm_type = 0, amount = 1, name = 'default', size = 1):
self.name = n... |
5f5350da600302b896e3e733bb3bda08ae33cc62 | 0ad0a994e8a956cadfe59976b223bbf05ca4a710 | YuliusDennyPrabowo/pandas | /pandas/core/internals/managers.py | Python | py | 68,438 | permissive | # -*- coding: utf-8 -*-
from collections import defaultdict
from functools import partial
import itertools
import operator
import re
import numpy as np
from pandas._libs import internals as libinternals, lib
from pandas.compat import map, range, zip
from pandas.util._validators import validate_bool_kwarg
from pandas... |
42a944accb3ffc6fc057c120393f7e45388a99ed | a9a1160ebb43cecd81370c385fb5233d743e894b | KasraMazaheri/URLShortener | /UrlShortener/UrlShortener/wsgi.py | Python | py | 417 | no_license | """
WSGI config for UrlShortener 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdef... |
28d1cd088738bb0883027445a5b585ded3cb0996 | 7028ed48f5173a2c0be436974f3a8fa1f2cc19e2 | wushwang/pygamedemo | /改变图片颜色/blend_fill.py | Python | py | 3,738 | no_license | #!/usr/bin/env python
import os
import pygame
from pygame.locals import *
def usage (): # 使用说明的方法
print ("按R\G\B分别改变对应颜色的值")
print ("1-9增加步长")
print ("A - ADD, S- SUB, M- MULT, - MIN, + MAX")
print ("空格改变模式")
main_dir = os.path.split(os.path.abspath(__file__))[0] # 获取文件所在路径
data_dir = os.path.join(... |
5f1c9f9260cb0c09f642a89a83d5ae96ee19e512 | 5b5a1d8d318b44d4a09c2b4637123c478913de4f | sarahperrin/open_spiel | /open_spiel/python/egt/dynamics_test.py | Python | py | 5,409 | permissive | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... |
8a84f6b9e6c5171e9cff8d23e1bf8646e97da08f | 964980b6645f970408f4742a3d921104b2d68ce3 | ariqrafikusumah/Tugas | /Chapter 2/D4 TI B/idam fadilah (1184063)/src/NPM8.py | Python | py | 384 | no_license | i=0
npm=input("Masukan NPM : ")
while i<1:
if len(npm) < 7:
print("NPM Kurang dari 7 digit")
npm=input("Masukan NPM : ")
elif len(npm) > 7:
print("NPM lebih dari 7 digit")
npm=input("Masukan NPM : ")
else:
i=1
a=npm[0]
b=npm[1]
c=npm[2]
d=npm[3]
e=npm[4... |
e6008b4df2a97853883fe529d2e77053e3af3851 | c97b6e4c16365fa41dbca590e10adc8b6c199232 | rizMehdi/data-explorer-chatbot | /modules/database/broker.py | Python | py | 9,186 | no_license | import copy
import json
import logging
import os
import string
from pprint import pprint
from mysql import connector
from modules.database import resolver
from settings import DATABASE_NAME, DB_SCHEMA_PATH, DATABASE_USER, DATABASE_PASSWORD, DATABASE_HOST, QUERY_LIMIT
logger = logging.getLogger(__name__)
db_schema =... |
8dfcd7afdd12ed2a51816539024adceeb1b1e1f1 | 493cf8a26b15b03122413142b02911b9bc50b49b | AvinashRavula/Django-Project-REST-API | /ol_db.py | Python | py | 406 | no_license | import os, django
from onlineapp.models import *
import click
from openpyxl import load_workbook
os.environ.setdefault('DJANGO_SETTINGS_MODULE', "onlineproject.settings")
django.setup()
@click.group()
@click.pass_context
def cli(ctx):
pass
def isHTML(filename):
return filename.endswith(".html")
def isE... |
21a89835f5da7c26a670258883001c60cf08db48 | 778eec94e32ff07959c2ea2fa5843dcc0f946a19 | DLR-TS/gdal | /autotest/ogr/ogr_topojson.py | Python | py | 5,920 | permissive | #!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: TopJSON driver test suite.
# Author: Even Rouault
#
###############################################################################
# Copyr... |
4557f94cc36219261c77f6bce392d12f66a441ca | f123cc779c1073a5b8a10e8ad76d9140dc74bfb8 | Mitchell55/NumericalAnalysis | /Numerical_analysis/pendulumforward.py | Python | py | 747 | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 18 19:33:02 2019
@author: Mitchell Krouss
Double Pendulem using Forward Euler
"""
import math
import numpy as np
import matplotlib.pyplot as plt
import scipy.special as sc
c = 0.16
L = 1.2
g = 9.81
m = 0.5
a = 0
b = 18
h = 0.01
n = int((b - a) / h)
def f(w,theta):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.