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 |
|---|---|---|---|---|---|---|---|---|
75bfe8a4b5edf9815509975e3f85fdf4a0612c39 | 47ddfb50c3d072b8c21406c5291cc35fa3fcbe30 | lucabrasi83/anutacpedeployment | /scripts/managed_cpe_services/customer/single_cpe_dual_wan_site/single_cpe_dual_wan_site_services/lan/switches/interface/service_customization.py | Python | py | 5,446 | no_license | #
# This computer program is the confidential information and proprietary trade
# secret of Anuta Networks, Inc. Possessions and use of this program must
# conform strictly to the license agreement between the user and
# Anuta Networks, Inc., and receipt or possession does not convey any rights
# to divulge, reproduce,... |
e34ffb9e46adb7caeb60d8afe2c5d77f87df3839 | d882d1ebc52cc4f641ee3a5ba9cd49ff491d03e1 | ManarHasan/Python_Stack | /Django/counter/counter/urls.py | Python | py | 805 | no_license | """counter URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... |
a260478766ada4b277badac21e151ed188cf8149 | c4aada77bcb8059e582ef2840b90a674688a9a68 | dollarkid1/pythonProjectSemicolon | /chp6/nested_dict.py | Python | py | 285 | no_license | my_family = {
"child1": {
"name": "Emil",
"year": 2004
},
"child2": {
"name": "Tobias",
"year": 2007
},
"child3": {
"name": "Linus",
"year": 2011
}
}
for x,y in my_family.items():
print(f'{x:<10} {y}')
|
61f9c43aeeb9a864512ee8a095fc4ddea0695f06 | 7354d0d6a58c84c53d9a7aea5a399c5293ad1044 | naduhrin78/TangoRango | /rango/migrations/0008_auto_20180623_1131.py | Python | py | 516 | no_license | # Generated by Django 2.0.6 on 2018-06-23 11:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rango', '0007_auto_20180623_1122'),
]
operations = [
migrations.AlterField... |
d69ec7dc77920965cdf31ad53ccacc247855050f | 4d001719f6c8fe4cf4ad5baf142ff7fe2772ab88 | scottwedge/NUSBusArrivalBot | /bus_stop.py | Python | py | 3,165 | no_license | from bs4 import BeautifulSoup
import datetime
import json
import requests
from shuttle_service import ShuttleService
from utils import BUS_STOP_URL
# Constants
TIMEOUT = 30
class BusStop:
def __init__(self, name, caption, latitude, longitude):
self.time_created = datetime.datetime.min # datetime
... |
acb60bfffaf2066980e8ac4588f8e640cc6f47a1 | 1e98e857abb9f28c28cba2e2feb09e468d2abcb1 | flowerhost/securityproject | /blog/urls.py | Python | py | 1,896 | no_license | # -*- coding: utf-8 -*-
"""
#Python 3.6
-------------------------------------------------
Project Name: securityproject
File Name: urls.py
Description :
Author : flowerhost
date: 2020/5/6
-------------------------------------------------
Change Activity:
... |
14bb9fd66b3896f39dbe071065bbc7a10fc1d47b | 3b614c67c2c81c4a0a847095e1639bd9f8dd6e3c | chrisroat/dask | /dask/array/slicing.py | Python | py | 73,852 | permissive | import bisect
import functools
import math
import warnings
from itertools import product
from numbers import Integral, Number
from operator import add, itemgetter
import numpy as np
from tlz import accumulate, concat, memoize, merge, pluck
from .. import config, core, utils
from ..base import is_dask_collection, toke... |
7e4ad30c5517374f3afcc1b50e80dd32f9368d45 | cee25b01b6c6ebf0e9ee35aa32769af13b207766 | satyamgovila/Leetcode | /Longest_Palindrome.py | Python | py | 913 | no_license | class Solution:
def longestPalindrome(self, s: str) -> int:
seen={}
for i in s:
if i in seen:
seen[i]+=1
else:
seen[i]=1
count=0
flag=0
for i in seen:
if seen[i]%2==0:
... |
b85e048db54aa30bd9a55373316d4d83bd0d2123 | d65a2573afd81fc4a753cd5c5ddb1fbec030ae05 | tumblrdeneme/deneme | /tumblr/views.py | Python | py | 2,514 | no_license | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse
from tumblpy import Tumblpy, TumblpyAuthError
from blogger import settings
from tumblr.models import TumblrToken
def auth(request):
t = Tumblpy(app_key=settings.TUMBLR_CONSUMER_KEY, ap... |
247b957e1bffe8fcd8c32f0636cf7a3f3276d9db | ae317f233fcad6aa17789635ce2d48b9fa1a62b8 | anhydrous99/Thesis | /Scripts/conv_test.py | Python | py | 248 | no_license | from torch import Tensor
import torch.nn.functional as func
import numpy as np
a = Tensor(np.array([[[[1, 0, 2, 3], [4, 6, 6, 8], [3, 1, 1, 0], [1, 2, 2, 4]]]]))
w = Tensor(np.array([[[[1, 2], [3, 4]]]]))
o = func.conv2d(a, w, stride=1)
print(o) |
9220c7ede47e5026cb55b04b2bea28def9423660 | 279965f4d70c55e065b6e385ad0046d0ee78745f | ShravyaKadur/search-engine-using-ir | /Indexer/test/main.py | Python | py | 6,512 | no_license | import json
import re
import sys
def createIndex():
with open('data/shakespeare-scenes.json') as f:
content = json.loads(f.read())
sceneMapping = []
playMapping = []
wordStats = {}
invertedIndex = {}
for scene in content["corpus"]:
docId = scene["sceneNum"]
sceneMapping.append([docId, scene["sceneId"]])... |
d86faaa72950f1289811c5eb9f684ef52f8e1f61 | 517e882133998180b4f417c9a99ebc63f277ea99 | 32x32/fufufuu | /fufufuu/account/models.py | Python | py | 2,526 | no_license | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.db import models
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
from fufufuu.core.uploads import user_avatar_upload_to
from fufufuu.image.enums import ImageKeyType
from fufufuu.image.fil... |
5ffd473c280a4efbf732426c21eabd33de0092b5 | 7fb6067d94900a9be57e3cb436db5a17eaeab676 | ganzourii/SE2018G10 | /CareHub/Staff/migrations/0004_auto_20190206_1658.py | Python | py | 397 | no_license | # Generated by Django 2.1.2 on 2019-02-06 14:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Staff', '0003_auto_20190206_1657'),
]
operations = [
migrations.AlterField(
model_name='doctor',
name='email',
... |
e5f895b96fec2c8420b7e79fcc08ef1d2a1807f6 | c5fc0afbcd5c5f1a4496d3d162bd0ddf8f8f8089 | MeetLuck/works | /pygame/thepythongamebook/004alphademo_pretty.py | Python | py | 4,701 | no_license | ''' 004 alphademo pretty.py
colorkey and alpha-value
'''
import pygame,os,itertools
white = pygame.Color('white')
yellow = pygame.Color('yellow')
BLENDMODES = [ (pygame.BLEND_ADD,'ADD'), (pygame.BLEND_SUB,'SUB'), (pygame.BLEND_MULT,'MULT'),
(pygame.BLEND_MIN,'MIN'), (pygame.BLEND_MAX,'MAX'),
... |
b0f5dcef7fa87ce2e68df9322bf8fbd5acd8497f | 3b4ba7787191d58f2e1b1751c7bab18aedfad86a | mweissbacher/exploit_farm | /start_sploit.py | Python | py | 3,051 | no_license | #!/usr/bin/env python
# author: Alexander Bersenev (Bay) from Hackerdom team
# starts one sploit for all teams
from flag_format import FLAG_FORMAT
from team_list import TEAMS
from time import sleep, strftime
from os.path import basename, splitext, abspath, exists
from subprocess import Popen, PIPE, STDO... |
3d88dde395410b44c7d8cfc8e4c31074dc38f9a0 | 505f239d8c3d77f5364ff79330bbe13efebd1592 | FscoreLab/faster-rcnn.pytorch | /lib/model/rpn/rpn.py | Python | py | 4,456 | permissive | from __future__ import absolute_import
import math
import pdb
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from model.utils.config import cfg
from model.utils.net_utils import _smooth_l1_loss
from .anchor_target_layer import _A... |
51ee40a05099fbebd0f92fd4a1858c775147cff7 | 97ae68dcb46131d1befd23849b498a1fac3e74cd | suren9393/django-oscar | /src/oscar/apps/catalogue/config.py | Python | py | 280 | permissive | from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class CatalogueConfig(AppConfig):
label = 'catalogue'
name = 'oscar.apps.catalogue'
verbose_name = _('Catalogue')
def ready(self):
from . import receivers # noqa
|
1e197280915ea1f175e16f37f0c8fc66208b69f9 | 024952f4866ac428025c76d19f423edfffd92ab9 | sprinfall/blog-ginko | /mysite/ginko/models.py | Python | py | 2,202 | no_license | # -*- coding: utf-8 -*-
# import os
from django.db import models
# from django.contrib.auth.models import User
# from django.utils import timezone
# from django.template.defaultfilters import slugify
#-------------------------------------------------------------------------------
# TODO
# - Primary key
# 不要以 nam... |
2ae3ec1760263c5e8ec0c064e212c39bddb18e6c | 37983769e131c72c34542135fc489df490346ef7 | mshelll/practice | /datastructures/reverselinked.py | Python | py | 792 | no_license | class Node:
def __init__(self, val):
self.data = val
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def display(head):
if head is None:
return
cur = head
while cur:
print(cur.data)
cur = cur.next
def reverse(node):
if... |
02a3e64379bf93f52a228255bdcee1ab6a1d148f | cdc5f06d69b98f621d1da479effb332599896f8d | schanlar/astropy | /astropy/nddata/mixins/tests/test_ndio.py | Python | py | 266 | permissive | from astropy.nddata import NDData, NDDataRef, NDIOMixin
# Alias NDDataAllMixins in case this will be renamed ... :-)
NDDataIO = NDDataRef
def test_simple_write_read():
ndd = NDDataIO([1, 2, 3])
assert hasattr(ndd, 'read')
assert hasattr(ndd, 'write')
|
c0db8a4ed3a7fe523556607757b9f1d6f9623e47 | 443f0905ba61d361ba400c836117af7241fc4f98 | standardgalactic/aljpy | /setup.py | Python | py | 361 | permissive | from setuptools import setup, find_packages
setup(name='aljpy',
version='0.7',
description='Andy\'s common tools',
author='Andy Jones',
author_email='andyjones.ed@gmail.com',
url='https://github.com/andyljones/aljpy',
packages=find_packages(),
package_data={'aljpy': ['*.txt']}... |
1b00647918dee717e643c5d1ac8eb8ce37e58359 | 4ccab0f100be7e93d4a99380cdba0169a3bdd139 | olifog/kermit | /coms/warn.py | Python | py | 1,689 | permissive | import asyncio, discord
try:
from _command import Command
except:
from coms._command import Command
import pickle
class Com(Command):
def __init__(self):
self.usage = "!warn @user [rule #]"
self.description = "Warns the user, logs what happened, and direct messages the rule to them."
... |
2224e46706ee8f2a20960f9dfeeabe4b34bb0f40 | 5318d89fc54ae6f7286424cac116a3b5e604e81d | moble/quaternionic | /quaternionic/arrays.py | Python | py | 12,552 | permissive | # Copyright (c) 2020, Michael Boyle
# See LICENSE file for details:
# <https://github.com/moble/quaternionic/blob/master/LICENSE>
import numpy as np
from . import jit
from .properties import QuaternionPropertiesMixin
from .converters import QuaternionConvertersMixin
def QuaternionicArray(jit=jit, dtype=float):
... |
17e8c86de566f4bc778d321b457fc584b7f9a3ba | dbb36b9c8b22eec5fc6418a86d8374a259051919 | sunpan822/caffe2 | /caffe2/python/operator_test/gru_test.py | Python | py | 12,878 | permissive | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import workspace, core, scope, gru_cell
from caffe2.python.model_helper import ModelHelper
from caffe2.python.rnn.rnn_cell_test_util import sigmoid, ta... |
a42a74f7c626f0b70c4ebbdad5ac23da1c16892b | c9056f4e7dd7c30eb25a939970c39d827610aea3 | otcshare/chromium-src | /tools/perf/page_sets/rendering/tough_pinch_zoom_mobile_cases.py | Python | py | 3,747 | permissive | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import shared_page_state
from page_sets.rendering import rendering_story
from page_sets.rendering import story_tags
from page_sets.system... |
7037c5f64f633c974dee93c6c50830889a3fea0e | d4e5e71b661c317598697ac2022e982f3a24ce53 | chin2/Hackathon_FullStackApp-ClassRoomDUB | /manage.py | Python | py | 666 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Gclassroom.settings')
try:
from django.core.management import execute_from_command_line
except I... |
417c3acade55399419bae3bc93b7a43bfff7607c | 0004c33703860ef251b3b4a20cfcd27b1fc54f50 | xsmart/nokkhum | /nokkhum/controller/compute_node/update.py | Python | py | 12,012 | no_license | '''
Created on Dec 23, 2011
@author: boatkrap
'''
import threading
import datetime
import time
import json
from nokkhum.messaging import connection
import logging
from nokkhum import models
from nokkhum import config
logger = logging.getLogger(__name__)
class ComputeNodeResource:
def initial_central_config... |
b85c9935735bfc2617fa8f4b8ffdd3045a3e7c3f | 31965576ce6a89f0a82f55503ba1dc214609bbb5 | crosswalk-project/web-testing-service | /wts/tests/csp/csp_script-src_self_unsafe-inline.py | Python | py | 3,347 | permissive | def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
_CSP = "script-src 'self' 'un... |
749ec002254a8c7aa26cc108a73cfba41afbdf9a | 1de41add06645846c7b60252cf9373012d74fbf4 | worko1/python_learn | /pLearn-JS/Week6/jinja_files.py | Python | py | 639 | permissive | from __future__ import unicode_literals, print_function
import jinja2
'''
intf_config = """
interface GigabitEthernet0/1
description {{ descript }}
no switchport
ip address {{ ip_addr }} {{ netmask }}
speed auto
duplex auto
"""
'''
with open("template_jinja.j2") as file: # read whatever is in the file defined... |
880a3985308691a8ae3921f7fc49f002a57841b6 | c4193ed951f554d114d004ab7f4731561b07d61d | ricardovv/2015_tipopython | /b8_clases.py | Python | py | 647 | no_license | # B8, CLASES
# Ejemplo basado en ejemplo de Gustavo Ferreira.
# https://gist.github.com/gferreira/10da8431c22a205d4ca1
#1 se define la clase
class Square(object):
fillColor = 1, 0, 0
def __init__(self, side):
self.side = side
def draw(self, pos):
x, y = pos
fill(*se... |
9daba6d99344698f3d9a0780cf2d938909b2334c | 9ce71b2ceb6294e14fb9a983eb5a023cfc09f6ca | rosoareslv/SED99 | /python/nilearn/2019/12/test_html_surface.py | Python | py | 6,128 | no_license | import json
import numpy as np
from numpy.testing import assert_raises
from nilearn import datasets, surface, image
from nilearn.plotting import html_surface
from nilearn.plotting.js_plotting_utils import decode
from nilearn.datasets import fetch_surf_fsaverage
from nilearn._utils.exceptions import DimensionError
fro... |
38ac6e0baf148a1ae3e6ff01fa4b5dfb10219821 | b381fe96f4297c8d929ed50433c0427f37dbed4c | GEYIWEN/yiwenblog | /blogpro/settings.py | Python | py | 4,004 | no_license | """
Django settings for blogpro project.
Generated by 'django-admin startproject' using Django 2.2.13.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... |
3812ffca8afb12a3da61668b9e618551f5901171 | c6a5d6681e017104fc14fc77b3def1f829e98124 | bondlee/leetcode | /indeed/D.py | Python | py | 229 | no_license | # coding: utf-8
# Created by bondlee on 2016/6/4
def min_cost(matrix, m, n):
s = raw_input()
H, W = map(int, s.split())
lines = []
for i in xrange(H):
lines.append(raw_input())
lines = map(lambda x : map(int, x),lines)
|
488dc4357767ea118bd99d430259e19f1d511068 | d1158eeccc8833de1ada78049b1bf913901b267b | isgasho/Shio_no_Tsukurikata | /bot/toot.py | Python | py | 2,335 | no_license | from mastodon import Mastodon
from time import time
import os, gc, threading
from bot import conv
class count():
print(os.getcwd())
CT = 0
end = 0
learn_toot = ""
count()
def __init__(self):
self.status = status
self.content = conv.text(status["content"])
self.account = status["account"]... |
91fc9f37ba882a0a3d0062e916bccb012867df93 | 2568ef5bf5c471fc991e88a3b6247d7d953556c9 | gabrielkerchner/caobravo | /manage.py | Python | py | 807 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cao_bravo.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that th... |
0a288b5de15555ee716e9a89e5463a6f34b83853 | ca1e632ed3393fef8fa5ac6b51d3fe2ffd0f5424 | woobyoungho/GoodData | /shareRes/views.py | Python | py | 3,362 | no_license | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from .models import *
# Create your views here.
def index(request) :
categories = Category.objects.all()
restaurants = Restaurant.objects.all()
content = {'categories' : categorie... |
12ba748d2132c59da9a0a7f62715c7098747f2b5 | c3f7f6c38c296b2c735c1ffffc6d433c025cc4f8 | Equinox-13/library-management | /library.py | Python | py | 4,579 | no_license | # -*- coding: utf-8 -*-
"""
Library Management System
~~~~~~~~~~~~~~~~~~~~~~~~~
Menu driven program that helps to perform
basic operations for library management.
"""
class Library:
def __init__(self, list_of_books):
# List of books initialized
self.books = list_of_books
def display_books(se... |
fd2cc58333140d586567a666056ca57b79843955 | 415fdfbb0e08d61fad610974f0fe578882dffb50 | juandsc/docker-django | /test_app/app/app/wsgi.py | Python | py | 452 | no_license | """
WSGI config for app 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.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_... |
30a28c0a3d2cf6c7d5fea7952c02bf59ca44a5ae | 28046523e80b9c3da624f54ad255e3e96daae58a | chonkerboi/prosperpy | /prosperpy/traders/trader.py | Python | py | 4,142 | permissive | import decimal
import logging
import prosperpy
LOGGER = logging.getLogger(__name__)
class TickTrader:
def __init__(self, product, feed, api, investment=decimal.Decimal('100.0'), recurring=decimal.Decimal('0.0')):
self.product = product
self.feed = feed
self.api = api
self.investm... |
11c23067f2102cc15d52eebb301b2a69a65c917a | ed84e04b50c67f816040a7930dea9217925834ed | LuisVJ/100-days-of-python | /projects/day45-web-scraping/intro/main.py | Python | py | 731 | no_license | from bs4 import BeautifulSoup
with open("website.html") as file:
contents = file.read()
soup = BeautifulSoup(contents, "html.parser")
print(soup.p) # finds the first p tag
print(soup.p.getText()) # gets the inner text
print(soup.find_all(name="p")) # finds all p tags
all_anchor_tags = soup.find_all(name="a")
... |
28ba05ea9c6537140288432eb047293c44ff5196 | c82aac51e953d1f8d13287794589260076102ff3 | tylerharkcom/NBAsim | /nba.py | Python | py | 14,867 | permissive | # Tyler Harkcom
# Developed in 2020
# Simple CSV file reader that takes nba_elo.csv files from FiveThirtyEight (https://github.com/fivethirtyeight/data/tree/master/nba-forecasts)
# and produces a game-by-game summary of a user-inputted year's NBA results, given
# a year between 1946 and 2020. Standings are tabula... |
cbb808e834e49fc52417a9ad1b31654842aad79c | 61b2ff43c11f7419405556ebc2201588f41b0e91 | KameliyaN/calories_counter | /calories_app/forms.py | Python | py | 461 | permissive | from django import forms
from django.forms import Select
from calories_app.models import Customer, CustomerFoods
class CustomerForm(forms.ModelForm):
class Meta:
model = Customer
fields = '__all__'
class CustomerFoodsForm(forms.ModelForm):
# select_foods=forms.ChoiceField(choices=fo.name fo... |
8851c27193ac8c29db087c804eb38fb16ab51d75 | 9f1b0320bf04a93beff2c1371e1abcc900d56514 | Melifire/CS120 | /Projects/Short 9/Part 1/TestCases/test_depth_8_two_nodes.py | Python | py | 801 | no_license | #! /usr/bin/python3
""" Code to test the tree_depth() function
Author: Russ Lewis
"""
import simple_tree_funcs
###########################################################
# INPUT #
###########################################################
from tree_node imp... |
ea75f66a37d3702fdd8593aa79562ea05ef4c4db | 3c77a4c93d85ec43129bc6c6f88750c4b8902f6b | ProFL/TADGrafo_Python | /cap3/autoreferencia/Fila.py | Python | py | 1,362 | no_license | ''' Módulo com implementação de uma fila encadeada '''
class Fila:
''' Classe com implementação de uma fila encadeada '''
class Celula:
''' Classe que define uma célula da fila '''
def __init__(self, _item=object(), _prox=object()):
self.item = _item
self.prox = _prox
... |
8936ea5918b2919dad3a5c9e6a0c97e96bfa1984 | 9bb4d151350b43603215b9453e2ee436bfc7d976 | appressoas/cradmin_legacy | /cradmin_legacy/tests/viewhelpers/test_objecttable.py | Python | py | 24,986 | permissive | from __future__ import unicode_literals
from builtins import str
from builtins import range
import htmls
from cradmin_legacy.python2_compatibility import mock
from django.test import TestCase, RequestFactory
from cradmin_legacy.tests.viewhelpers.cradmin_viewhelpers_testapp.models import TestModel
from cradmin_legacy.v... |
1c83a602485572bd6c49acdb5b779eaf14111560 | 602387979ae2bd45b1e6197e3da3426391b274bd | viacheslavy/GalDB | /project/controllers/asynctask.py | Python | py | 649 | no_license | from flask import render_template, request, json, session, Response, url_for
from project.models import *
from project.views import app, login_required, g
@app.route('/TaskStatus/<int:task_id>')
def task_status(task_id):
result = {'task_id': task_id, 'status': '', 'info': ''}
task = Tasks.query.filter(Tasks.i... |
86ed973b6a756c489b18cb8c144affa20cbb7143 | ff39145998dec45055148cc5803a252fb2fd2221 | KadirHakeem/self-DrivingCarsSpecialization | /introductionToSelf-DrivingCars/weekSevenFinalProject/Course1FinalProject/controller2d.py | Python | py | 11,782 | no_license | #!/usr/bin/env python3
"""
2D Controller Class to be used for the CARLA waypoint follower demo.
"""
import cutils
import numpy as np
class Controller2D(object):
def __init__(self, waypoints):
self.vars = cutils.CUtils()
self._current_x = 0
self._current_y ... |
56d075d9922198c6052db2dfcec4879f9d0e2de3 | 534cec2ade200b302e411702ca9776147f4c9ff4 | bschweiz/levelup | /levelupapi/models/event.py | Python | py | 487 | no_license | from django.db import models
from .gamer import Gamer
from .game import Game
class Event(models.Model):
scheduler = models.ForeignKey("Gamer", on_delete=models.CASCADE)
game = models.ForeignKey("Game", on_delete=models.CASCADE)
event_time = models.DateTimeField(auto_now=False)
location = models.CharFi... |
e566cbafb1a3881a7a666d031a02010abdd94f49 | 88321d6ce27493cf42210b75c4d8d9a51158f542 | panosit/LawFirm | /firm/models.py | Python | py | 1,274 | no_license | from django.db import models
from django.conf import settings
class appointment(models.Model):
user=models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)
name=models.CharField(max_length=40)
email=models.CharField(max_length=50)
date=models.CharField(max_length=50)
class practic... |
6400db9fd98886ed18f4e3a1260287f824bf9854 | 9ad30688c30d6e0e98747f52d4593502fc13674c | li-yi-cloud/logbee2 | /logbeelib/settings/config.py | Python | py | 6,932 | no_license | '''
Created on May 3, 2018
@author: cloud
'''
import logging
logger = logging.getLogger()
class LogbeeBaseConfiguration(dict):
'''logbee base configuration object'''
def __init__(self,*args,**kwargs):
super(LogbeeBaseConfiguration,self).__init__(*args,**kwargs)
def __setattr__(self, ... |
5e92f5ef854fcbca959aecc1681f28786e65145a | 352cafa3251d9375638f5689964856fc82782c26 | iRT-CS/ShallowMind | /iterTesting.py | Python | py | 650 | permissive | from keras.models import Sequential
from keras.layers import Dense, Activation
from keras.utils import to_categorical
from db import createDatasetsDocument, createNeuralNetsDocument, createExperimentsDocument
import GaussianBoundary as gb
import numpy as np
import keras
from testNN import test
from Utils import iterate... |
0a105a616ede7f1abfbeee706ab2780adce106ef | ea1b5b22e8cb29eff04b342b466a5f1df5500f09 | Abhishek-IITM/elo-kaggle | /features/month_lag_feature_maker.py | Python | py | 1,137 | no_license | from config import path
from services.lag_distribution import month_lag_distribution
from utils.log_setup import _log
_log.info("-----------------------------------------------------------------------------------------------------------")
_log.info("| Running month lag feature maker ... |
b48370dfeaba1c2d351fd8b14644b4adb099a471 | 5cb17fa78c36d1e6c588f463d9ace0c0c0b88901 | Code-Institute-Submissions/Milestone-Project4-5 | /green_toys/wsgi.py | Python | py | 397 | no_license | """
WSGI config for green_toys project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... |
7f76e1354103d9440ce5c338fc28e0beef71902e | fbdf9e0f0a9c77a07d363ac95101fb56f16bbe8a | geditzh/data_structure | /python_data/graph/graph.py | Python | py | 2,363 | no_license | #!/usr/bin/python3
#-*- coding:utf-8 -*-
__author__ = "Zhang Han"
class Graph():
def __init__(self, mat, uncon=0):
vnum = len(mat)
for x in mat:
if len(x) != vnum:
raise ValueError('in init')
self._mat = [mat[i][:] for i in range(vnum)]
self._uncon = unc... |
3993b63fd8e91eaba88bbc75f139f913f220771a | c2d5525cdfd156afb012150b6b03ef02ef7bedcd | BCCW/python__atwiki_backup | /main.py | Python | py | 668 | permissive | # -*- coding: utf-8 -*-
import time
import sys
import codecs
import lxml.html
import urllib2
query = 'http://www39.atwiki.jp/osakahennyu/?cmd=backup&action=source&pageid=<PLACEHOLDER>&num=0'
for line in open(sys.argv[1], 'r'):
url = query.replace('<PLACEHOLDER>', line.rstrip())
while True:
try:
html = urllib... |
1c8209ebcb31c5a4c7801b7cd640d1ea3587b5e2 | 93f8fa621f7374d8cc83b609e42abfcd8664d480 | j-i-l/SwissR0 | /analysis/obsolete/import_kmz.py | Python | py | 293 | no_license | __author__ = 'Jonas I Liechti'
from zipfile import ZipFile
from pykml import parser
zf = ZipFile('Data/gg25_v2.kmz', 'r')
for fn in zf.namelist():
if fn.endswith('.kml'):
with open('Data/cantons.kml', 'r') as f:
doc = parser.parse(f)
root = doc.getroot() |
6aa240262bce419b40842484e86265eea2ea55f1 | 09b8de33dd7a3066ca7c09ce0dced8349e1c48a9 | oltoco/googleapis-gen | /google/cloud/speech/v1p1beta1/speech-v1p1beta1-py/google/cloud/speech_v1p1beta1/services/adaptation/transports/grpc.py | Python | py | 22,061 | permissive | # -*- coding: utf-8 -*-
# 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... |
706ac0b00759067311b97c58293d604a595021f6 | 414130f330fe19e62f10d0f8fd320c35f2fb19c6 | zkbt/mosasaurus | /junk/demo.py | Python | py | 1,146 | permissive | import mosasaurus.transmission as transmission
import matplotlib.pyplot as plt, numpy as np
files = ['wasp94_140801.obs', 'wasp94_140805.obs', 'wasp94_140809.obs']
spectra = []
plt.figure('three spectra')
toshow = ['k']
plt.figure('comparison')
gs = plt.matplotlib.gridspec.GridSpec(1,1)
count =0
sharex=None
ax = {}
me... |
0613a96b62a0a70d286458189c80ca942b065677 | 6012acb8e6db3034c8d6e0c464197a253036048f | happpyosu/leetcode-solution-python | /20201116.py | Python | py | 2,060 | no_license |
# leetcode 1318. 或运算的最小翻转次数
# medium
class Solution:
def minFlips(self, a: int, b: int, c: int) -> int:
inc = 0
sa = bin(a)[2:]
sb = bin(b)[2:]
sc = bin(c)[2:]
maxLen = max(len(sc), len(sa), len(sb))
sa = '0'*(maxLen - len(sa)) + sa
sb = '0'*(maxLen - len(s... |
a9dbac6324595429878408d5a191b984085769a0 | 3aebbf16d299b5a68920ad6836a07a859994c782 | kabilan1830/Joynter-Online-Personal-Counselling-Software- | /Joynter (Online Personal Counselling Software)/main_part/sub_part/models.py | Python | py | 2,405 | no_license | from django.db import models
# Create your models here.
class feedback(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField()
msg = models.CharField(max_length=250)
def __str__(self):
return self.name
class stdsignin(models.Model):
name = models.CharField(ma... |
5ae1bd68e539c67eb514edd99a6dc3c6df3fc88a | 057fb733777d02d86c24f3a061578c9026cfb729 | Conansoloman/API | /tradingSystem.py | Python | py | 1,452 | no_license | import numpy as np
import pandas as pd
import MySQLdb as mdb
'''
def availableStockMarket():
# Open database connection
db = mdb.connect("localhost","sec_user", "password","securities_master")
# Prepare a cursor object using cursor() method
cursor = db.cursor()
'''
class Portfolio():
cash = 100000.... |
32929e997fc638fad019e1e06e02d4184b258254 | d92a9e9229e24d630f95a4b5c819512787401cc3 | youngyjd/amundsen | /search/search_service/proxy/es_proxy_utils.py | Python | py | 501 | permissive | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from enum import Enum
class Resource(Enum):
TABLE = 0
DASHBOARD = 1
FEATURE = 2
USER = 3
RESOURCE_STR_MAPPING = {
'table': Resource.TABLE,
'dashboard': Resource.DASHBOARD,
'feature': Resource.FEATURE... |
896916451164b7ba64b4fd0796ee71d56dce0a2d | 0cdb17282aa2e1c3d87b0b27d16aac9d0f9ba996 | naraharipatro/RNN-Auto-Speech-Recognizer | /sample_models.py | Python | py | 6,940 | permissive | from keras import backend as K
from keras.models import Model
from keras.layers import (BatchNormalization, Conv1D, Dense, Input,
TimeDistributed, Activation, Bidirectional, SimpleRNN, GRU, LSTM, Dropout)
def simple_rnn_model(input_dim, output_dim=29):
""" Build a recurrent network for speech
"""
# M... |
e53f97a8b9025401efec3c7415ab232939414526 | ddb08a1e702003e48a338d1ca74ff4d524374c00 | kenyonke/CS224N_NLP_with_DeepLearning | /assignment1/q3_run.py | Python | py | 2,347 | no_license | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import random
import numpy as np
from utils.treebank import StanfordSentiment
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import time
from q3_word2vec import word2vec_sgd_wrapper,skipgram,negSamplingCostAndGradient
from q3_sgd import sgd
# Rese... |
560b26b2a1d865c9f4758a004bb33c2ed60359c2 | 1595d6b5dc3ceb3aa5ee8234cc75c6fb3a13f539 | tddesjardins/stsynphot_refactor | /stsynphot/spparser.py | Python | py | 15,898 | permissive | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Synthetic photometry language parser.
See :ref:`stsynphot-parser` for more details and
:func:`BaseParser.p_top` for language definition.
.. note::
Like `stsynphot.spark`, parser docstrings in this module
are used by the parser itself... |
c7cd1b3d7dd20f85e9884e61862e24a2a3414523 | c0fc5d7625527bd6c93f8b3bcbc2d64c94e5b0c3 | RishiMenon2004/med-bay | /pharma/migrations/0017_auto_20201225_1548.py | Python | py | 516 | permissive | # Generated by Django 3.0.7 on 2020-12-25 15:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pharma', '0016_prescription_bill'),
]
operations = [
migrations.AlterField(
model_name='epmedic... |
2e4e2191160529f3bc439c7cdaa2a2bd03853374 | 3a2b3a85725762f0530c031dbab919d2cc7d9dae | KaitlinJKelley/levelup | /levelup/settings.py | Python | py | 3,814 | no_license | """
Django settings for levelup 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/
"""
from pathlib i... |
e386980e8b094ea05ce5b52f559faad8e88bfddf | efa99d09a9a5f1e3b88d69097acd1059d5dd45b7 | brettcannon/toga | /src/django/toga_django/widgets/textinput.py | Python | py | 1,516 | permissive | from toga.interface import TextInput as TextInputInterface
from .base import WidgetMixin
from .. import impl
class TextInput(TextInputInterface, WidgetMixin):
def __init__(self, id=None, initial='', placeholder=None, readonly=False, style=None):
super().__init__(id=id, style=style, initial=initial, place... |
337ed4b14147109bca4750f9c16b2b2358d03d1e | 20960e891aee43e839005d87a0f76e696c7ee775 | yeanay/yeanay.io | /yeanay/yeanay/urls.py | Python | py | 724 | no_license | from django.conf.urls import patterns, include, url
from ideology.views import congress, polarization_over_time
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'^ideology/congress/(\d+)/(\w+)/', congress),
url(r'^po... |
17630db22eb4e170372c1051fd4bc7b1550b7718 | 2d1ee01deb6cb909a212dc025e02cfa6d854a9da | juliocesar898/apiRestINE | /apiTest/apiTest/settings.py | Python | py | 3,894 | no_license | """
Django settings for apiTest 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
#... |
cf928636428aadc65a8d9f68b75ed215b6f46542 | 6d85bff8996ac281aa32c86069185f4f7e58fce2 | PRO3600-Developpement-Informatique/GhostRun | /GhostRunWeb/manage.py | Python | py | 631 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'GhostRunWeb.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... |
1b6285c95288dfcad8a42699a67b1e80577ed91d | b7a8731289ad552c51c4faa0533e61e8bcc53e04 | ancient-clever/django_notion | /django_notion/wsgi.py | Python | py | 403 | no_license | """
WSGI config for django_notion 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.setdefault('DJANGO... |
b14a3d38b673d6ca86ca4fbcf9a4a9dafbac23a6 | 7149a182d4c3cc7a7f462649d954e360096c8b65 | drwitt/covid19-sir | /tests/test_param_tracker.py | Python | py | 4,315 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from covsirphy.phase.phase_unit import PhaseUnit
import warnings
import pytest
from covsirphy import SIRF, PhaseSeries, ParamTracker
@pytest.fixture(scope="module")
def tracker(jhu_data, population_data):
population = population_data.value(country="Japan")
recor... |
52067cd7999fc445e323efa7b79c67646737d258 | e7acac0cdd03741401e3ea5f69a4b6ffa4665f84 | danbailo/Python | /Conceitos Básicos/teste_obj_ed/teste.py | Python | py | 2,730 | no_license | #Escreva uma breve descrição de todos os seguintes tipos de objetos e estruturas de dados sobre os quais aprendemos:
#Números:
#Strings:
#Listas:
#Tuplas:
#Dicionários:
#Números
#Escreva uma equação que use multiplicação, divisão, expoente, adição e subtração igual a 100.25;
print('Multiplicação -', 10025*0.... |
a345a744108b9823476a7352df8baa6a008f8dcc | 6d03424ac22300daa57f1b1a6436c06ff86ee7fa | snail15/CodingDojo | /Python/djangoprojects/apps/blogs/urls.py | Python | py | 445 | no_license | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index),
url(r'^new$', views.new),
url(r'^create$', views.create),
url(r'^[0-9]{1,}$', views.show),
url(r'^[0-9]{1,}/edit$', views.edit),
url(r'^[0-9]{1,}/delete$', views.destroy)
# url(r'^(?P<blog_id>\d+... |
e77e680af3387fa9589f347c5b44aaad6cd1a2d7 | a6c12472d85dd20307062f53420212b729df2eec | BradenM/aws-connect-vanify | /backend/vanify/app.py | Python | py | 2,760 | no_license | """AWS Connect Vanify handler."""
import json
import logging
import sys
from datetime import datetime
from typing import Any, Dict, TypedDict
import phonenumbers
from vanify import convert
from vanify.models import VanifyModel
from vanify.types import ConnectContactFlowEvent
# TODO: For a real application, setup prop... |
47aa61b76bc34e480bff4c5bf2c56c2bf3c4c580 | f48000eb75df1179d5acb588b0aaf5ea2e78ab09 | yoshiM85T/django_app | /star2/settings.py | Python | py | 3,059 | no_license | """
Django settings for star2 project.
Generated by 'django-admin startproject' using Django 3.1.1.
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/
"""
from pathlib i... |
5db146cb69df26c45d87ba8f24dc4830354e8374 | 31ebf6accdce40c5fa07d727b96eb493e92d49cb | JimmyJUNUCAS/LC | /0514.py | Python | py | 3,922 | no_license | # def maxProfit_inf(nums):
# n = len(nums)
# dp = [[0 for i in range(2)]for j in range(n+1)]
# dp[0][1] = -nums[0]
# for i in range(1,n+1):
# dp[i][0] = max(dp[i-1][0],dp[i-1][1]+nums[i-1])
# dp[i][1] = max(dp[i-1][1],dp[i-1][0]-nums[i-1])
# return dp[n][0]
# prices = [2,3,6,-1,5,4]
... |
f67f06d3045eb2980a73048904433b928b7ad5e6 | 39d3ae2916df85a22bf8b72d58a976e71d36b424 | kiettv54/LearnPython | /leetcode/bt.py | Python | py | 518 | no_license | import math
value = []
a ='100,150,180'.split(',') #[x for x in input('Nhap chuoi so:').split(',')]
C = 50
H = 30
for value1 in range(len(a)):
Q = str(int(round(math.sqrt((2 * C * float(a[value1]))/H))))
value.append(Q)
print(value)
num = '3,5'.split(',')
row = int(num[0])
colum = int(num[1])
value = [[0 for l in ra... |
9d92020b6ce786d2873f6d8d3dae9fd3589d8cdf | 5c2d47836350fd5a177bae7c8b2f5241bd1cb948 | yuchunsheng/isawyou_server | /app/app.py | Python | py | 4,855 | no_license | import base64
import json
import numpy as np
import cv2
from bson.json_util import dumps
from mimetypes import guess_type
from flask import Blueprint, jsonify
from flask import current_app, abort, flash, redirect, request, url_for, render_template
from flask_pymongo import GridFS, NoFile
from werkzeug.utils import s... |
27415bb093ebc34dceb252b2687fc584d4ad6a28 | 8035c6fc5882906da0cf703bf7f00fc9fb5c2416 | alsrhkd77/Raspberry | /testlcd.py | Python | py | 264 | no_license | from Adafruit_CharLCD import Adafruit_CharLCD
from time import sleep
lcd = Adafruit_CharLCD(rs=22, en=11, d4=23, d5=10, d6=9, d7=25, cols=16, lines=2)
i = 0
while True:
lcd.clear()
lcd.message('Counting: ' + str(i))
sleep(1)
i = i + 1
|
491d99547077ab40375ac36bbfdbe86b7cb86f74 | ad1ae75fdd154f62a4eddce085ee429c56b9bb31 | vivekgupta8983/python3 | /sets.py | Python | py | 378 | no_license | #!/usr/bin/python3
#Sets is collection of unordered and unindexed. It is written in {} curly brackes and set functions
# set_a = {'A', 'B', 'C'} # Define a set using {} curly brackets
# set_b = set(['A', 'B', 'C']) # Define a set using set functions
# print(set_a)
# print(set_b)
odd_set = set(range(1,10,2))
eve... |
1b4d53da46d87b056fc0ab2682059ba3fb6ecb12 | 306b59bc73ede57731640cfd55597e6d18eb6528 | ronitray95/distributed_iot_app_deployment_platform | /Team_specific_codes/Team4/Applications/hkr/App/Algo1/API.py | Python | py | 1,036 | no_license | import sys
from commAPI import obj
import json
class sensorapi(object):
def __init__(self):
self.sensor_count = int()
self.controller_count = int()
self.sensor = {"temp":"","ldr":"","ac":""}
def setSensorCount(self, count):
self.sensor_count = count
def setControl... |
641a9dffa80fce05b40893be2309e72827a5d29f | 732d2d4091250fda5b18b45239b13a0510ba3aca | KvyatkovskyAleksey/ScrapeWebdriver | /scrapy_webdriver/extension_creator.py | Python | py | 1,967 | permissive | import os
import re
from zipfile import ZipFile
import shutil
def create_extension(username, password):
path = os.path.dirname(os.path.realpath(__file__))
with open(f'{path}/extension/background.js', 'w') as file:
text = """
function callbackFn(details) {
return {
... |
1a8d42a093a7d2afa84114bb779cf271b46abac7 | e2c51acda2ee215214ac3b80f819452868350d44 | IpunkDkk/linksaver | /linksaver/wsgi.py | Python | py | 395 | no_license | """
WSGI config for linksaver project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... |
32d0ed219f3445f997239fad358054357a6dd342 | d1b2173ec64d967cd9488298db6f7eaba597ae31 | b0y101/deface | /slim.py | Python | py | 1,952 | no_license | import re,sys,os,requests
from include import diq,post
from time import sleep
def param_check():
try:
a = sys.argv[1]
except IndexError:
print("Usage python2 manual.py file.txt")
os.sys.exit()
def file_check():
try:
open(sys.argv[1])
except IOError:
print("Pastikan file yang mau di upload benar")
os.s... |
1e94f4cb8baef28a64822cd176da76bcf43e5a0f | 10e5d0f7a7333e514014a984022ded20ef3cec2d | hojohn2561/fantasy_sports_hub | /fantasy_sports_hub/players/migrations/0003_nflplayer_team_drafted_id.py | Python | py | 582 | no_license | # Generated by Django 3.1.1 on 2020-12-08 22:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('teams', '0005_auto_20201130_1336'),
('players', '0002_nflplayer_current_team'),
]
operations = [
mi... |
a2263c6d02cd3cbed86e033fb4d2e1fff42e8c51 | 36316e8d2f2aa1dd9dc6c510095098e65864281e | briancappello/flask-unchained | /flask_unchained/bundles/mail/extensions/mail.py | Python | py | 1,792 | permissive | from flask_mail import _MailMixin, Message
from flask_unchained import FlaskUnchained
from flask_unchained.utils import ConfigProperty, ConfigPropertyMetaclass
from types import FunctionType
from typing import *
class Mail(_MailMixin, metaclass=ConfigPropertyMetaclass):
"""
The `Mail` extension::
fro... |
20e8d353b8140520b51adaa449d5a2be86d4639c | 0d7f6bc60e61f8b7316aa25a95f4d3dda4828705 | hyeonggeun2/python | /web_db/festa/festa/middlewares.py | Python | py | 3,595 | no_license | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class FestaSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy a... |
853ecdf0d015b704439d58c91835f4f6cd59a015 | 2e298fe16d867079f60cb7727242ac8ee2e5a6ae | c4chow/SpaGE | /benchmark/seqFISH_AllenVISp/SpaGE/seqFISH_data_preprocessing.py | Python | py | 1,036 | permissive | import os
os.chdir('seqFISH_AllenVISp/')
import numpy as np
import pandas as pd
import scipy.stats as st
import pickle
seqFISH_data = pd.read_csv('data/seqFISH/sourcedata/cortex_svz_counts.csv',header=0)
seqFISH_meta = pd.read_csv('data/seqFISH/sourcedata/cortex_svz_cellcentroids.csv',header=0)
seqFISH_data = seqFIS... |
044594b6ba1ee632deb3d00fe330b0584eec4fd7 | 1686b3ce5fd1e5a88b80e2aeaf2faf533c0e9a8a | zaxat/psi | /Order.py | Python | py | 2,425 | no_license | class Order:
Order_content = [[0] * 4 for i in range(100)] #содержимое заказа ID продукта из меню/Название продукта/Цена продукта/Кол-во продуктов
Content = 0 #Кол-во продуктов в заказе
def setnumFood(self, seller, id, num): #Добавить продукт
if self.checkID(id) == 0:
if seller.Getmenu(... |
fb71a1486c567422e1f4ae81124d5737e89b664e | e4d50e1933e55ac6a515459e721ab90a83e73f68 | coginvasion/src | /lib/coginvasion/manager/SettingsManager.py | Python | py | 3,383 | no_license | # Embedded file name: lib.coginvasion.manager.SettingsManager
"""
Filename: SettingsManager.py
Created by: blach (??July14)
"""
from panda3d.core import *
from pandac.PandaModules import *
from direct.directnotify.DirectNotify import DirectNotify
import json
notify = DirectNotify().newCategory('SettingsManager')
... |
94cd8f5484b737f6a51143f449625a813e4f5955 | 26cc10d3da54f2d21ef631b6dc21861452a10be5 | ViishalTyagi/SportsTeamManager | /teams/models.py | Python | py | 839 | no_license | import os
import random
from django.db import models
def get_filename_ext(filepath):
base_name = os.path.basename(filepath)
name, ext = os.path.splitext(base_name)
return name, ext
def image_path(instance, filename):
new_filename = random.randint(1,3245621256)
name, ext = get_filename_ext(filename... |
0e5f8bff3014d79aa68db0e3253d70997d11ba4b | 628ccb8baf315b2d0e4903df7e0b1528a3e648c2 | HEP-DL/LArCV | /mac/pyrgb/display/roilayout.py | Python | py | 28,257 | no_license | from .. import pg
from .. import QtGui, QtCore
from ..lib.roislider import ROISliderGroup
from ..lib import storage as store
from ..lib.iomanager import IOManager
from .. import larcv
import os
from crosshairs import CrossHairs
from LabelingTool import LabelingTool
class ROIToolLayout(QtGui.QGridLayout):
def __i... |
655c5ca34c64f21eb8bee522614ad6bac50795d6 | 107441b821f8fe344e662ff68c8adfe8b7e64244 | xlchan/bag_xbase_logic | /scripts/test/tinv_dsn.py | Python | py | 1,511 | permissive | import bag.core
# from xbase_logic_repo.src.xbase_logic_repo.layout.tinv import TINV
from bag.io.file import read_yaml
from xbase_logic_repo.scripts._misc import generate, extract, simulate
def run_main(prj):
config_file = 'bag_xbase_logic/specs/logic_parameters.yaml'
specs = read_yaml(config_file)
# lib... |
fb584661115c94411b11b9629160234159faa21c | 20912e71187cdc2386c84f228eb16bfb4d455547 | hanifbirgani/codemelli | /codemelli/codemelli.py | Python | py | 4,717 | permissive | """Main functions for Codemelli."""
from json import load
from os import path
from random import randint, choice
from re import search
from typing import Union
def city_codes_data() -> dict:
"""Return a dict containing city codes.
:return: city codes
:rtype: dict
"""
with open(f'{path.dirname(pa... |
c8c7790e81fa4eaf06fb09d945cea74b5e3e5e97 | f12fd5df3e5f5cb6aedfba595f6d35bb4531df3b | fiefdx/MyNote | /app/utils/multi_async_tea.py | Python | py | 7,504 | no_license | # -*- coding: utf-8 -*-
'''
Created on 2015-03-04
@summary: multi-process encrypt & decrypt with tea
@author: YangHaitao
'''
import os
import sys
import logging
import time
import signal
import random
import binascii
from time import localtime, strftime
from multiprocessing import Process, Pipe
import tornado
from to... |
c71617c7b2dd2cc898cd431aeb5c68edc55da564 | 4349375c0ac4595b15661b557776f360f8ba42b2 | XoveR1/DjEnergeo | /energeo/manage.py | Python | py | 250 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "energeo.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
ab79060421889d289b84a7810b68d7e59015bc46 | d34086a13ff3ecc56b9786ecf2b3d05db556e0a4 | saksham219/soc_comp_analysis | /tdg-probe-social/tdg_social/models/user.py | Python | py | 992 | no_license | # -*- coding: utf-8 -*-
from tdg_social import db
from tdg_social.models.base import Base
class User(Base):
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String(40), index=True)
user_name = db.Column(db.String(40))
user_screen_name = db.Column(db.String(40))
user_description ... |
74d58959c6b538c48b8b764ec526870ceaef11e3 | 7a3a88c42f3a701e0d7f6e39830dff1b9b2bb0fe | lemonnight/Vehicle-Detection | /detect_functions.py | Python | py | 11,482 | no_license | import matplotlib.image as mpimg
import numpy as np
from skimage.feature import hog
import cv2
# Detection functions for the pipeline
def get_hog_features(img, orient, pix_per_cell, cell_per_block,
vis=False, feature_vec=True):
""" Function returns HOG features as well as visuali... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.