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 |
|---|---|---|---|---|---|---|---|---|
67b7be2082a9511041757450f0a92d5ffa8cc9fd | 83017021812ff07eb3c029ab6bcca3bd3fde53d3 | Snex-Thadeus/Api | /core/views.py | Python | py | 1,565 | no_license | from django.shortcuts import render
from django.http import JsonResponse
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated
from .serializers import PostSerializer
from .models import Post
from rest_framework import generics, mi... |
c46c9a832ece7bc0d3fddd6fa57d99ec073b7438 | 36e8853a110b1deac0af11340ffe45a9d00a4ad6 | nidhirw/CS50W | /project2/application.py | Python | py | 2,007 | no_license | import os
from flask import Flask, render_template, request, jsonify
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY")
socketio = SocketIO(app)
@app.route("/", methods=["GET", "POST"])
def index():
return render_template("index.html")
channel_lis... |
80a2a2f7630830624b5488b2855599a8920a14a7 | 348243ba113dc5de90dfede8114255635812809e | HamzaRatrout/my_project | /python/shape_color.py | Python | py | 514 | no_license | import turtle
turtle.shape("turtle")
turtle.speed(10)
turtle.pensize(10)
turtle.circle(55)
turtle.penup()
turtle.pencolor("red")
turtle.fd(120)
turtle.pendown()
turtle.circle(55)
turtle.penup()
turtle.backward(240)
turtle.pendown()
turtle.pencolor("blue")
turtle.circle(55)
turtle.right(90)
turtle.penup()
turtle.fd(55)
... |
282a3c562e1f1c91f081aa8f117a35884ff50901 | 0840c407d2fe833d2291a15bb78d7bb798527898 | billyom/sailaway | /boats.baseline.py | Python | py | 822 | no_license | [
Boat ("dc", dc, "Billy O'Mahony", "dc", 1047),
Boat ("dc", dc, "Brendan Glynn", "dc", 1016),
Boat ("dc", dc, "Brian Park", "dc", 1004),
Boat ("dc", dc, "Chris Caher", "dc", 945),
Boat ("dc", dc, "Coranne Heffernan", "dc", 997),
Boat ("dc", dc, "Des McMahon", "dc", 1023),
Boat ("dc", dc, "Eamonn Benfredji", "dc"... |
ba5e63dec083debd4c565e058565d29587ef6168 | fd2346c45f19aa291a595ed9a189ed29ea788bb4 | juandrengifo/cp-algos | /11621.py | Python | py | 570 | no_license | from sys import stdin
def fun(c, j): return c*(3**j)
def binsearch(f, lo, hi, x, c):
ans = -1
while(lo+1<hi):
mid = (hi+lo)//2
if(x >= f(c, mid)):
lo = mid
else:
hi = mid
ans = f(c, lo)
if(ans < x): ans = f(c, lo+1)
return ans
def main():
m = in... |
57043e4180acb35302ff11fac75c03f00d6d42fa | a14692d108578b2f0c5834b068072b8bc996b60e | AthanusSimba/ecommerce2 | /orders/migrations/0006_auto_20200322_0819.py | Python | py | 836 | no_license | # Generated by Django 3.0.3 on 2020-03-22 05:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounts', '0010_auto_20200322_0805'),
('orders', '0005_auto_20200322_0812'),
]
operations = [
migr... |
410b561bfadca8344bf1f591a82fa6fcd392078f | fb16c25c87e3471c38312b15375fa68cdec04361 | SurielRuano/backend-autonomo | /back_autonomo/urls.py | Python | py | 1,349 | permissive | """back_autonomo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... |
3d364d785bcaf41cad99cf12337d602798951402 | 8628cb4695f2ffff38e1f4333a8575a952e9a7f6 | liangxh/idu | /backup/lastblog.py | Python | py | 1,943 | no_license | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Author: Xihao Liang
Created: 2016.02.26
Description: get blogs from MySQL
'''
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import time
import datetime
def exists(mid, threshold = 1, con = None):
import db
if con == None:
conn = db.connect()
cur = conn... |
78001bc9d05f2d24eebd00952fa8afe796127738 | c4f80ecc192b447bfc4b57577b029b8103382d77 | uofutahcapstoneahjregistryteam/ahj-registry | /server/core/serializers.py | Python | py | 12,296 | permissive | from rest_framework import serializers
from ahj_gis.serializers import PolygonSerializer
from rest_framework.renderers import JSONRenderer
from .models import *
class EditSerializerHelper(serializers.BaseSerializer):
def to_representation(self, value):
if value.__class__.__name__ == self.field_name[0:-2] ... |
93667b64c307f614af960d05df8f3e45a46c6ee5 | 62b489c10d07f1448ede0b893b4576e4a9da9370 | Ad115/My-Processing-sketchbook | /CellSystem/System.py | Python | py | 4,227 | no_license | import random as rnd
from CellLine import CellLine
from Site import Site
class System:
"""The whole biological system, aware of cells, space (as a grid) and the passage \
of time (steps).
It is the main struture of the program, being the only observable and given it \
coordinates all processes and auto... |
b45f8740f5a9970ef5580766e21d6461dfaf9e8e | ee46e5d3150d4eb3154569d66f904a9df1b9c883 | marialobillo/newspaper | /newspaper_project/urls.py | Python | py | 1,006 | no_license | """newspaper_project 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')
C... |
b55148ae07268845ab5bbe99ef0f8f68aa175099 | 6219967d7a4fbb590ea276f0640904b57bfad820 | EricSchles/aleph | /aleph/views/reconcile_api.py | Python | py | 6,814 | permissive | import json
import logging
from urlparse import urljoin
from flask import Blueprint, request, url_for
from apikit import jsonify
from werkzeug.exceptions import BadRequest
from aleph import authz
from aleph.events import log_event
from aleph.core import get_app_url, get_app_title
from aleph.model.validation import imp... |
ddee1b1c93261dc2a68ac308d4b299c687177bc4 | 6b05a11f3579b5ede5b0973539abee2b238d36d9 | omarelalfy1/DJANGO-2 | /manage.py | Python | py | 668 | 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', 'message_project.settings')
try:
from django.core.management import execute_from_command_line
exc... |
9c37086cae84e9baf1413ff6c97063b3558d55ff | d98c13c7af9ca9dd4a1074a6365e6b3ea711e158 | mkeilman/sirepo | /tests/template/srw_shadow_converter_test.py | Python | py | 1,139 | permissive | # -*- coding: utf-8 -*-
u"""PyTest for :mod:`sirepo.template.srw_shadow_converter`
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkio
from pykern impor... |
f90b3991ff6690f107c77d52a9823af1e881d058 | 4f60a2f755ed2ed2a137f65eb49b5598f538043f | KevinHock/checkov | /tests/terraform/checks/resource/gcp/test_GoogleComputeBootDiskEncryption.py | Python | py | 1,427 | permissive | import unittest
import hcl2
from checkov.terraform.checks.resource.gcp.GoogleComputeBootDiskEncryption import check
from checkov.common.models.enums import CheckResult
class TestGoogleComputeBootDiskEncryption(unittest.TestCase):
def test_failure(self):
hcl_res = hcl2.loads("""
resource "go... |
f5e798a18e08d50879463e3a88a2431a86c3bdb2 | 15165221bcad6c28d07ca4b2828438791b25d5cf | DanielTongAwesome/Pricing-Service-Deployed-Version | /views/users.py | Python | py | 1,386 | no_license | '''
author: Zitian(Daniel) Tong
date: 17:43 2019-05-25 2019
editor: PyCharm
email: danieltongubc@gmail.com
'''
from flask import Blueprint, render_template, request, url_for, redirect, session
from models.user import User, UserError
user_blueprint = Blueprint('users', __name__)
@user_blueprint... |
c95b7e77dd4e7d61c01fe60212db96959c6bec39 | ea82d4b82e6974ed1947c5fc0089941c6868dca6 | learning-and-control/core | /core/systems/polynomial_system.py | Python | py | 563 | permissive | from numpy import array
from core.dynamics import FBLinDynamics, SystemDynamics
class PolynomialSystem(SystemDynamics, FBLinDynamics):
def __init__(self, root=1, drift_gain=1, act_gain=1):
SystemDynamics.__init__(self, n=1, m=1)
FBLinDynamics.__init__(self, relative_degrees=[1])
self.root ... |
9ec252dbd7609570d3b83c8dd1a1cdd8ff98d0af | 3380275cf410869be031600437575a85c133ab8a | ngocminhbui/ai19_track2_hcmus | /triplet-reid/.ipynb_checkpoints/train-checkpoint.py | Python | py | 19,107 | permissive | #!/usr/bin/env python3
from argparse import ArgumentParser
from datetime import timedelta
from importlib import import_module
import logging.config
import os
from signal import SIGINT, SIGTERM
import sys
import time
import json
import ipdb
import numpy as np
import tensorflow as tf
from tensorflow.contrib import slim
... |
384e7dfbfb71bdf7529c7a14aed12bb64d4ab1ae | a1ff70bc34cdef133952ac4e7d1e6246c2903ac3 | moevm/mse_generator_of_test_works_for_Stepik | /src/convert.py | Python | py | 4,195 | no_license | import json
import download
import random
import os
import shutil
from weasyprint import HTML
def generating_works(course, test_name, var_qty=1, task_qty=5):
pdf_path = os.path.join(os.curdir, '{}'.format(course.get_id()), 'data/pdf') # папка для pdf
answers_path = os.path.join(os.curdir, '{}'.format(course.ge... |
9a7d80dfda1b687ed828d810e05b214af3435cc6 | 8c28d35cd400544a6cc35fa60fd0c85c6823867c | jyniki/few-shot-model | /train_ssl_co.py | Python | py | 8,425 | no_license | import argparse
import os
import yaml
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from tensorboardX import SummaryWriter
import models
import utils
from fewshot_dataloader import get_fewshot_dataset, get_meta_loader, split_shot_query, make_nk_label
def ... |
3049d8cc9b84827ea4db0909e3e126f5e4e34a03 | 849e0e0e53b10a22c35e272ca0928f03a9ecf46d | msabramo/python-cyrun | /setup.py | Python | py | 3,560 | permissive | """
cyrun
=====
cyrun allows you to write cython code that runs like a scripting language,
with compilation happening in the background. Here is an example::
#!/usr/bin/env cyrun
print("Hello World!")
You can use the usual cython build metadata at the beginning of the
script to adjust compilation settings::
... |
2bdf8d17ef8bd64f5fee583364cb4b0a0fb29ff3 | ea7dd47433e3d11641388802ac428ccb14599464 | BlazeKl/T3Grafos | /funciones/claseauto.py | Python | py | 704 | no_license | from .drawauto import draw
class automata:
def __init__(self):
self.estados = []
self.transiciones = []
self.inicial = []
self.alfa = []
self.final = []
def set_estados(self,input):
self.estados = input
def set_tran(self,input):
self.transiciones = ... |
723323c52dc43ff80b02c28b3f3a8f386a6c0d71 | a2ba246e58331c7305a3fc4d0e5c7a1e5be15433 | cmd410/convinst | /custom_props.py | Python | py | 659 | no_license | import bpy
from .regutil import custom_prop_group
from .operators.util import validate_extract_target
@custom_prop_group(bpy.types.Scene, "convinst_settings")
class ConvinstSettings(bpy.types.PropertyGroup):
is_asset: bpy.props.BoolProperty()
is_edited: bpy.props.BoolProperty()
# This is a hack for operato... |
c7004a63e1e3af0f939a9e032f27313bf2e0c515 | 5d1eab7fad4d1cbb39b8a2a5b9cf80753f7431b3 | luque/better-ways-of-thinking-about-software | /Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/credit/tasks.py | Python | py | 5,293 | permissive | """
This file contains celery tasks for credit course views.
"""
from celery import shared_task
from celery.utils.log import get_task_logger
from django.conf import settings
from edx_django_utils.monitoring import set_code_owner_attribute
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import Course... |
9d576a8b7823b08a28d32db175ab51f04d90db34 | 65c00d1d4c4ca1d31ffa9c088a4f39c734ecaba0 | flipsters/tensorflow | /tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch_test.py | Python | py | 37,161 | permissive | # Copyright 2017 The TensorFlow Authors. 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 applica... |
c112670d4171e546e4d98c048937cce6a40dd470 | 8a2e24b25268cc1c84e3d472fc3985a7933cdc47 | ptype/pandas | /pandas/core/util/numba_.py | Python | py | 3,097 | permissive | """Common utilities for Numba operations"""
import types
from typing import (
Callable,
Dict,
Optional,
Tuple,
)
import numpy as np
from pandas.compat._optional import import_optional_dependency
from pandas.errors import NumbaUtilError
from pandas.util.version import Version
GLOBAL_USE_NUMBA: bool =... |
33c585623201d070ff7c9b16eaab289991299b80 | c71b819a49bae33b0c9c8fabc5df8df76d7737a9 | rogerhil/heybaldock | /music/migrations/0009_auto__add_rehearsal.py | Python | py | 31,099 | no_license | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Rehearsal'
db.create_table('music_rehearsal', (
('id', self.gf('django.db.models... |
e0e7a307720e9634cda937281b6d3d76769b0e1a | 6932c1c7cb7d27d2d64c02b70183700d2d0be776 | silviapabon-u/LaboratorioVCSRemoto | /preinforme9_OmarNova_SilviaPabon.py | Python | py | 2,479 | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 26 21:45:33 2020
@author: --
"""
#%%
#Ejercicio 19 hoja de modelado
# x1, y1, x2, y2 se refiere a las coordenadas
print("Ingrese los dos valores de la primera coordenada")
x1 = int(input ("Ingrese el valor de X1: "))
y1 = int(input ("Ingrese el valor de Y1: "))
print("I... |
8a24b535568c21a8f58fadd6e4d6f207cd42931f | 022002bc9a2ca68607cbea018f2dedb2705cf59a | AgustinPardo/mycoRT | /DB/scriptsDeCarga/carga_redRTOperons.py | Python | py | 670 | no_license | # Cargo la tabla redRTOperons, con mfinderIDs
def carga_redRTOperons():
# Leo el archivo con la red de Operones pero con mfinderID
redRT_mfinderID_file=pd.read_csv('2_redT_conOperones_net_number.txt',sep='\s+',header=None)
# Inicio el cursor
cursor = cnx.cursor()
try:
for line in range(len(redRT_mfinderID_f... |
207aead19ccdc890974360b741e6e86d46c4f7f8 | db702e896d0503c932d958e35dc71321c32a5ec6 | mzywy1/pytorch-faster-rcnn | /train.py | Python | py | 5,334 | no_license | import os
import torch
from torchvision import ops
from config.train_config import cfg
from dataloader.coco_dataset import coco
from utils.im_utils import Compose, ToTensor, RandomHorizontalFlip
from utils.anchor_utils import AnchorsGenerator
from backbone.mobilenet import MobileNetV2
from utils.faster_rcnn_utils impor... |
622c782f38c0c12ef555a6c9b6eba1ce2be7fb81 | a7e7106e6f9e9a202b51f96a888e1ffb8511da22 | abhilashasancheti/CMSC-723-project | /code/beaver-base/beaver/utils/__init__.py | Python | py | 467 | permissive | # -*- coding: utf-8 -*-
import torch.cuda
from beaver.utils.metric import calculate_bleu, file_bleu
from beaver.utils.saver import Saver
from beaver.utils.saver_test import SaverTest
def get_device():
if torch.cuda.is_available():
return torch.device('cuda')
else:
return torch.dev... |
cc711342d3e246a92ad985c0a393f55c1153efb8 | 8fedc1fcb341423e4d44474faeb12de9873995ed | nemerdiaz/test-jenkins | /src/main.py | Python | py | 333 | no_license | from flask import Flask, escape, request
app = Flask(__name__)
def suma(a,b):
return a+b
@app.route('/')
def hello():
res = suma (5,5)
name = request.args.get("name", "World")
return f'Hello, {escape(name)}! %s' % (res)
# return "Hello Wolrd!"
if __name__ == "__main__":
app.run(host='0.0.0.0'... |
ef86e9a8bd83207455e84f849dbfc408d6452375 | 32386d29e163ac424cd46450387b10dc5e655806 | QGLQGL/ggg | /11.11——目标检测/作业/11.11.py | Python | py | 5,374 | no_license | # To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %% [markdown]
# # 实验一
# 自定义Inception网络,并在Kaggle猫/狗数据集上进行训练和测试
# 
# %% [markdown]
# ## 1.加载keras模块
# %%
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from k... |
df882ae5aa6255eccd83ce0e8c1b0a3ee5ef5464 | 7f6adea7952925f5d84a5b491a370e8d1f115c90 | danielperna84/hass-wh-triggers | /hass_wh_triggers/fido2/ctap1.py | Python | py | 9,518 | permissive | # Copyright (c) 2013 Yubico AB
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditi... |
853e61d125ea88bc33e4999d8804c269eb8fc30e | d5c19673643f9603a748b2eb9fe05707c678d78b | kinoute/fastai-v3 | /app/server.py | Python | py | 2,328 | no_license | from starlette.applications import Starlette
from starlette.responses import HTMLResponse, JSONResponse
from starlette.staticfiles import StaticFiles
from starlette.middleware.cors import CORSMiddleware
import uvicorn, aiohttp, asyncio
from io import BytesIO
from fastai import *
from fastai.vision import *
# export_f... |
9a1e16cec3ae9a17904fbff8db29c275be96870e | eb2d978b2c61413f299b781ee0a300b85552f273 | priyankitshukla/CurdwithDjango | /testcase/test_calculator.py | Python | py | 303 | no_license | import unittest
from testcase.calculator import add, subtract
class TestCalculator(unittest.TestCase):
def test_add(self):
self.assertEqual(add(2, 3), 5)
def test_substract(self):
self.assertRaises(ValueError, subtract(10, 0))
if __name__ == '__main__':
unittest.main() |
6c6c681b8cb5dd82f3d9974f8006aa451502f97e | 4907c4adc505dda74213ce2d973f0da0a3c659b8 | Celestial-Bai/methBERT | /methBERT/dataProcess/ref_util.py | Python | py | 8,856 | no_license | """ Function in this files are from deepSignal
(https://github.com/bioinfomaticsCSU/deepsignal)
"""
import sys, os, math
import fnmatch
import numpy as np
import random
import h5py
import scrappy
import csv
import torch
def _get_readid_from_fast5(h5file, reads_group = 'Raw/Reads'):
first_read = list(h5file[reads... |
764a3f355d87eba8769b44116d44afbc60c489e7 | 1d2296c35c03e1a07712f3f669ce2e131c120307 | ece324-2020/Darwin | /darwin/viewer/eval_viewer.py | Python | py | 4,822 | no_license | #!/usr/bin/env python
import time
import glfw
import numpy as np
from operator import itemgetter
import torch
from mujoco_py import const, MjViewer
from utils.util import listdict2dictnp, split_obs, convert_obs, extract_agent_obs, idx_to_action
STEPS = 100
EPISODES = 10
class EvalViewer(MjViewer):
'''
Poli... |
9b3d1f211ad72a86396f7f82bb471ddd9b923b09 | d61a636e6c1a2ddbc1c176fa7f29ddd714cb19fe | dsq19931221/blog | /django1.7/django1.7/my_blog/article/models.py | Python | py | 597 | no_license | from django.db import models
from django.core.urlresolvers import reverse
# Create your models here.
class Article(models.Model) :
title = models.CharField(max_length = 100)
category = models.CharField(max_length = 50, blank = True)
date_time = models.DateTimeField(auto_now_add = True)
content = models... |
b32c1cf9704d3f4d5b6d00b48f12405e5a811ff9 | 3da813077a6f10bd98823c37c9a8367e5cb84227 | DIllon-bot5000/CSC110-Projects | /nebulon.py | Python | py | 1,761 | no_license | #
# Author: Dillon Barr
# Description: This program takes user input and builds
# a neubulon ship to the desired length and layers.
largeLayers = int(input("Large Layers on bottom: \n"))
mediumLayers = int(input("Medium Layers on bottom: \n"))
smallLayers = int(input("Small Layers on bottom: \n"))
frontLe... |
e9d5a8cc0ef6715af429bb6c7d09607863609710 | 06351850079ed46cf82402b0edd42504318e6e80 | foru120/PythonRepository | /Projects/DeepLearningProject/image_classification/cnn_for_two_class_classification/ensemble_cnn_model_maxout.py | Python | py | 21,612 | no_license | ########################################################################################################################
## ▣ 가중치, 편향 파라미터 초기화
## - weight 는 layer 의 입출력 node 수에 따라 적응적으로 normal distribution 의 variance 를 정해주는 것이 좋다.
## - Bias 는 아주 작은 상수값으로 초기화 해주는 것이 낫다.
## - 따라서, weight 초기화 방법 후보로 normal, truncated_n... |
198eaf54ca3a8c7c9a9c26955fa315f7f2b66681 | 3b3aa944910f3d18fa60b72bfd52fff65463af8e | suryaten7/Basic-Python-Projects | /Machine learning Bacics/XGBoost/Hyperparameter Optimization for XGboost using RandomizedsearchCV/hyperparameter_optimization_for_xgboost.py | Python | py | 2,936 | no_license | # -*- coding: utf-8 -*-
"""Hyperparameter Optimization For Xgboost.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1-hpXv9gpG3jP-JFVnARFBEyPNXjz4Y3e
## Hyperparameter Optimization For Xgboost using RandomizedSearchCV
"""
import pandas as pd
fro... |
453c266afdeebfc8244fc60ca75daccd5efce5ff | 68beee6e4b69f7fc0a2569b5abc0aa1263462502 | soediro/erp5 | /product/ERP5Configurator/Document/CatalogKeywordKeyConfiguratorItem.py | Python | py | 3,167 | no_license | ##############################################################################
#
# Copyright (c) 2008 Nexedi SARL and Contributors. All Rights Reserved.
# Yoshinori Okuji <yo@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsa... |
d383eb894532c1f690dbab9f6c8389a19828c009 | bc9ae3da339c0fdc4857843e65cf062e2f96da03 | carlblocking/MachineLearing | /imageRelatedShell/ssim.py | Python | py | 773 | no_license | # import the necessary packages
from skimage.measure import compare_ssim
import cv2
# construct the argument parse and parse the arguments
img_source="C:/Users/Administrator/Desktop/ssim/source.jpg"
img_to_be_compare="C:/Users/Administrator/Desktop/ssim/gaijinhou.jpg"
# load the two input images
imageA = ... |
00d0335047ac1fd7d281e75afcccead5809e3db7 | 665d6816fab683fe257a9a0734940adc44d3efa8 | infidel-/igor | /igor/Battle.py | Python | py | 8,119 | no_license | # Battle class
import random
from .Enum import *
from .Game import Game
from .Dungeon import Dungeon
from .Persona import *
from .Shadow import *
class Battle:
player = None
shadow = None
def __init__(self, player):
self.player = player
self.shadow = Shadow(player)
# start new battle
def start(self... |
541ceca47adc674eebc98d5d546cdf2b5a1c14b9 | b26487375043439154ecd298672b490258f66c30 | abirhasansuvro/Profiles-Rest-Api | /profiles_api/views.py | Python | py | 3,523 | permissive | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status,viewsets
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import... |
7ca518102bf6695cf90419ae623f77a7f0bcad21 | f2bf2fc1eedd914c25cb0044e459fb60f14dc788 | utkarshiam/Security-Rating-for-a-college | /rating.py | Python | py | 2,163 | no_license | import numpy as np
import pandas as pd
from sklearn import linear_model
RANDOM_OFFSET = 0.5985
COLLEGE_1_RATING = 3.5
COLLEGE_2_RATING = 4.5
def generateDatasetArray(data_df):
data_arr = np.zeros(len(data_df))
for data in data_df.iterrows():
index = data[0]
row = data[1]
data_arr[inde... |
b40bdf9296a2b33037f0c55c37de648a661345a9 | 47775e130feefc8e0c70bb0e90e311ee23000254 | richardjoy530/Python-Scripts | /Misc/Client.py | Python | py | 234 | no_license | import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('196.168.18.10', 80))
while True:
msg = s.recv(24)
if len(msg) <= 0:
break
print(msg)
s.close()
#this is green-branch testing |
773297d9bc68b537f5d08fcfa3253ec2e7061610 | 53e6611261be75a42035b6feaf20cfbad4a6118c | ManiRamar/AnomalyDetectionExample | /AnomalyDetection/visualizer.py | Python | py | 790 | permissive | import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
import seaborn as sns
import os
import sys
import datetime
class DataVisualizer:
def __init__(self,):
pass
def plot_sensor_anomalies(self, data , sensor_name , anomaly_label):
... |
e5f6d3d65024dbeb70fa87faa16aee09873ae1d5 | e8cc53a900d9f00fdbfcb640d1cfd27ec71817ea | WeAreConfiant/security | /malware-decoders/ida-tarmac/tarmac_decryptor.py | Python | py | 2,821 | no_license | # by taha@confiant.com
import idc
import struct
import idautils
import zlib
# these are constant per OSX/Tarmac malware
xor_key = 0x33
xor_keystream = ''.join(chr(x) for x in [0x4b, 0x00, 0xe0, 0x6e,0xf1, 0xd9, 0x13, 0x3f, 0x4a, 0x6e, 0xf8, 0x9f, 0xd5, 0x9c])
def decompress(data):
try:
data2 = zlib.decompressobj... |
e1bec24d3590e7bcc79a13c0d968ae637b883735 | 4176c436e91c8c40ed7599bdc76ed5cca5ebb334 | sagarPakhrin/wsvincent | /helllo_world/urls.py | Python | py | 799 | no_license | """helllo_world URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... |
f8f8e375fd891f8db9e6be4e7c3382dea4567f13 | 5c23e226691d223ad7e862f39acf7f1fd2e25636 | rschum/game | /source/library/science/chemistry/chemicals/water.py | Python | py | 445 | no_license | from source.library.science.chemistry.element import elements
from source.abstract.chemistry.chemical import chemical
class Water(chemical.Chemical):
name = "Water"
molar_mass = 18.02
density = 1.00
formula = "H2O"
def __init__(self):
chemical.Chemical.__init__(self)
self.elements... |
132f997cad1c80498eb18c2cbf2acee1b301b2dc | 0dcb92120e39f501e3ad40cc4a074d91a835d14e | ThomasVirgo/url-shortener | /urlshortener/shortener/views.py | Python | py | 903 | no_license | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from .forms import NewUrlForm
from .models import UrlPair
# Create your views here.
def index(request):
if request.method == 'POST':
url = NewUrlForm(request.POST)
if url.is_valid():
ne... |
3be503bb7617e604ddcff249bf094555f8fbac1f | 13e3724c6010ce13d81d0284384190e0bd59cf60 | atul-singh-2809/Sentimental-Analysis | /TechShop/TechShop/urls.py | Python | py | 750 | no_license | """TechShop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-base... |
768070e785347db570228483ea2d4f1607ee6b04 | a9641023a7e35761b4fad6c893f96d68a04959af | SVSurve/Face-Recognition-Biometric-Security-Technology-for-Secure-Data-Access | /recognizer.py | Python | py | 2,367 | no_license | import cv2, numpy as np;
import xlwrite,firebase.firebase_ini as fire;
import time
import sys
import reglogingui
reglogingui.login_verify
from playsound import playsound
start=time.time()
period=8
face_cas = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
cap = cv2.VideoCapture(0);
recognizer = cv2.face.LB... |
8dec1d36b7993df93fd0989ba6abfa10cacfc218 | 11c76f33ee56339fd27c2c0559d2ea83640ddc3c | rallen0150/portfolio | /portfolio/wsgi.py | Python | py | 488 | no_license | """
WSGI config for portfolio project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
from whitenoise.django import DjangoWhiteNoise
import os
from django.core.wsgi import get_ws... |
e5238c261624ca10e7306f20d828aebaae4db89f | 6181326b44274e0c251688f8542f502d6a91c523 | viert/Pyrr | /pyrr/geometric_tests.py | Python | py | 12,531 | permissive | # -*- coding: utf-8 -*-
"""Defines a number of functions to test interactions between
various forms data types.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy
from pyrr import ray, rectangle, vector, plane
from pyrr.utils import all_parameters_as_numpy_arrays, para... |
e0bf7855a8254f8f42a4a7c2f1f949a3eaa54486 | 76ee0aacaac9e393affd8aaacf076ade3a1d1490 | edv1n/vagga-docker | /vagga_docker/network.py | Python | py | 3,030 | permissive | import logging
import docker
from . import VAGGA_IMAGE
log = logging.getLogger(__name__)
def check_container(vagga, cli):
# use storage volume as identifier for the container
container_name = vagga.storage_volume
ports = _find_all_exposed_ports(vagga)
if not _validate_container(container_name, por... |
e8539d65e575705b95bd2e22cc1baa882f082d4c | 34c1a5d58a094b274e51dcc31292e9d00074743e | jsarwar711/Cogs-18-Final-Project- | /COGS 18 Final Project 2/chatbot1.py | Python | py | 4,318 | no_license | from newspaper import Article
import random
import string
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import nltk
import numpy as np
import warnings
def lem_normal(text):
""" This is a function that returns lemmatized lower case words after ... |
83b8b0b2f3b387b8ad5cde28cfa6612fc933179b | 8f5be77e2840f96311015e65523773fdd8dda578 | kimbugs/beckhoff_mqtt_vpn | /_test_main.py | Python | py | 714 | no_license | import unittest
from mqtt_manager import MqttManager
from pms_controller import PmsController
class Test_Main(unittest.TestCase):
def test_mqtt_publish(self):
self.assertIs(MqttManager.write("helios/10000/PmsCommand", "test"), True)
def test_pms_controller(self):
pms = PmsController()
... |
33202b776cdd7e35b518c0630d7d1b2d691ceb71 | d59c484d0ae5d06d4dcd5d8a0f19fbaa3a0ae9e6 | Wendong-Huo/thesis-bodies | /cleaned_version/policies/ppo_with_body_info.py | Python | py | 12,754 | permissive | import time
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
import pathlib
import io
import gym
from gym import spaces
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3 import PPO
from stable_baselines3.common.policies import ActorCriticPolicy... |
1a4ef0caa8a81f2374338fa30a5faf47bc567b93 | 4c347ae7102841d92ed5c7579409706d443843dd | ichiong/peershark_flowaware | /FilterPacketsHelper.py | Python | py | 2,458 | permissive | from P2P_CONSTANTS import *
import os
#return a list of filenames of pcapfiles taken from InputFiles.txt
#if a directory is found then all *.pcap files in the directory are
#included(non-recursive)
def getPCapFileNames():
pcapInputFile = open(PCAPFILES)
lines = [eachline.strip() for eachline in pcapInputFile]
pcapI... |
45634ebb86e09cad12e1157a3588af712fb57757 | 0adb574d6d78cba104943374fbb5cf6fa974866f | CSX777/LMC | /LMC.py | Python | py | 5,889 | permissive | import torch
import numpy as np
import torch.nn as nn
'''
The main code is LMC
'''
def normalize_keypoints(kpts, image_shape):
height, width = image_shape[1],image_shape[0]
one = kpts.new_tensor(1)
size = torch.stack([one*width, one*height,one*width, one*height])[None]
center = size / 2
... |
c0b6d7202d0fceee38dceff501e308b15d03af83 | afa26e6de3b64e315049d55db5aec19a0208196d | dodgejesse/show_your_work | /plot.py | Python | py | 3,571 | no_license | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import expected_max_performance
def main():
# The N validation accuracies can go here:
example_valid_perf = [.8, .75, .9, .24, .45, .6, .65, .67, .49, .49, .59, .52, .78,
.84, .63, .... |
f153f719ec1304c7ba4fa8f40963ca386b36653b | 4f02d5a6f26cb68d62bbd96fb287025bd23be374 | lelhiny/Rank-ED | /python_module/PythonSerialFromArduinoToPi.py | Python | py | 737 | no_license | import time
import couchdb
import serial
ser=serial.Serial('/dev/ttyUSB0',9600)
couch=couchdb.Server('http://localhost:5984/')
db=couch['rank_ed']
while 1:
line=ser.readline()
line1=line.rstrip("\n")
arr=line1.split(";")
school,room,key,value=arr
if key == "temp":
... |
97f73d671abbaf61a0ac234f46d75451422fa835 | d004fb359a7ff8722a0a7dac610a0162841b9888 | YankunLi/neutron | /neutron/tests/unit/test_db_plugin.py | Python | py | 197,183 | permissive | # Copyright (c) 2012 OpenStack Foundation.
# 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... |
e5abc008cfd8bf4af0879ffdabc974e7e6461eb6 | ebb661e9060d51b3d758d9aa63c9f6b3035cd863 | NaStyA128/final_project_vagrant | /final_project/django_project/search_engine/migrations/0005_site.py | Python | py | 570 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-27 06:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('search_engine', '0004_auto_20160904_1535'),
]
operations = [
migrations.Creat... |
6c60cc0ee50e227f99dba3082b77a16206cc08f5 | 47cf422c07cbefb8716108a2f5553d6243b089aa | carlosfigueroa1711/Equipo53 | /M_R.py | Python | py | 13,651 | no_license | # -*- coding: cp1252 -*-
#Modulo de R
from tkinter import *
from tkinter import messagebox
#import tkMessageBox
from PIL import ImageTk, Image
import numpy as np
global x
global E1
global E2
global E3
global E4
global E5
global Nivel
global ventana
global ventana2
global ventana3
global Im1
global Im2... |
52024955da7cc22c1b36e41d1f42e8e7d171a0f3 | 156f8df9a250ab04c5c12c5f833849b131cb84e8 | gangsta0/Mafia-Bot | /mafia_bot_public.py | Python | py | 87,846 | no_license | #!/usr/bin/env python3.4
### The Mafia Bot's token is: [REDACTED]
### The TCoD Mafia chat id is: [REDACTED]
### The Private Testing chat id is: [REDACTED]
###SETUP
from telegram.ext import *
from telegram import *
from random import shuffle
from random import choice
from random import randint
import logging
logging.b... |
52b7f033484c70e3f58a263a7f4060dd9ac8db25 | 071f529c2be13f1cafa0b02e696a53a30fc743e8 | jlachowski/django-tracking | /setup.py | Python | py | 1,627 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# from __future__ import unicode_literals
# from __future__ import print_function
# from __future__ import division
# from __future__ import absolute_import
# from future import standard_library
# standard_library.install_aliases()
# from builtins import *
from setuptools ... |
46e82febb31b043b714617d2c6f4e6eb0bf77780 | 0bd5abd6016f5cb4f8c29c3acfde19840e16377b | R151865/fb_post_learning | /fb_post_clean_arch/migrations/0001_initial.py | Python | py | 5,525 | no_license | # Generated by Django 3.0.5 on 2020-06-23 15:52
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... |
2a142d0ad2e76b5c10678170fcb9d999e43deacf | 9df221da49988f231c4d5409bb4e57f7c6d8116a | betarixm/pksw-dashboard | /src/game/migrations/0001_initial.py | Python | py | 1,648 | no_license | # Generated by Django 3.2.7 on 2021-09-19 16:00
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('team', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
081b21dbea80ed5188c66c19a2759e79cd21476c | 49be742e69c08e1bbda50420f19a08b2dee0e0f4 | bellisk/nearbysources | /nearbysources/wsgi.py | Python | py | 1,440 | no_license | """
WSGI config for nearbysources project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICAT... |
6daa69812828be03acfe745666519015178eb5de | 3a91275556db0fb4611274ce49399296de0b2d12 | anku580/Upfront---Backend | /rating_app/migrations/0001_added_rating.py | Python | py | 728 | no_license | # Generated by Django 2.0 on 2019-04-01 12:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('temperorycart', '0001_initial'),
]
operations = [
migrations.CreateModel(
nam... |
3f692ef8790284117d288f3c9497ce6713635099 | 559f257c414ef9820d14f17eb4843d19a60f2fa0 | ablot/ibllib | /oneibl/webclient.py | Python | py | 24,901 | permissive | import json
import logging
import math
import os
import re
import urllib.request
from collections.abc import Mapping
from pathlib import Path
import hashlib
import requests
from ibllib.misc import pprint, print_progress
_logger = logging.getLogger('ibllib')
class _PaginatedResponse(Mapping):
"""
This class... |
0204053c5d492db0bba778a9be797c46319ada98 | fcfca9249deec02bc9e6e7d4baa96a16f1bc4297 | anlaganlag/mymdb_2 | /core/tests.py | Python | py | 2,248 | no_license | # from django.test import TestCase
# from django.test.client import RequestFactory
# from django.urls.base import reverse
# from core.models import Moive
# from core.views import MoiveList
# class MovieListPaginationTestCase(TestCase):
# ACTIVE_PAGINATION_HTML = """
# <li class="page-item active">
#... |
5a16bfeedd1d50ac8de61f6fbe8578d1c4d79842 | f8623242e0a0dfa71564999c1b3c6ce8fdacd5c7 | MelnykAndriy/transform | /tensorflow_transform/mappers_test.py | Python | py | 29,594 | permissive | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
a9e62973ac64712b3cbf097adb9a69fb5a704232 | 24016b7ddf6953271e2085e6b4c05909e0330edc | NWUCM/PythonTutorial | /mynum/euler.py | Python | py | 388 | permissive | #!/usr/bin/python3
# -*- encoding:utf-8 -*-
# @author : EastMagica
# @time : 2021/09/27 11:48:19
# @file : euler.py
# @project : PythonTutorial
# @software : VSCode
import numpy as np
def euler_explicit(f, t0, y0, h, step=10):
ys = [y0]
for i in range(step):
ys.append(
ys[... |
4fb399d76d6fd203a6b65374bfd03eda4800c24c | 5d1c1f3495d1bf7a4ff54f10b88f047a05aac0cf | IMJONEZZ/textsummarizer | /project/tests/test_summaries.py | Python | py | 6,802 | no_license | import json
import pytest
from app.api import summaries
def test_create_summary(test_app_with_db, monkeypatch):
def mock_generate_summary(summary_id, url):
return None
monkeypatch.setattr(summaries, "generate_summary", mock_generate_summary)
response = test_app_with_db.post(
"/summarie... |
54c5abacd0a197c372a5e7c762dfbb5b9727219a | 33592a68d96730bd31c03b267f7a768e4fdc0f14 | sytrus-in-github/keras | /keras/caffe/extra_layers.py | Python | py | 1,214 | permissive | from ..layers.core import Layer
from .. import initializations
import theano.tensor as T
class LRN2D(Layer):
"""
This code is adapted from pylearn2.
License at: https://github.com/lisa-lab/pylearn2/blob/master/LICENSE.txt
"""
def __init__(self, alpha=1e-4, k=2, beta=0.75, n=5):
super(LRN2... |
912347dd7c5f0aa0afcbae66129119d3ceaabce1 | 5defae14065f53175d3c6e9dcee46e873f46a2ca | Feiox/tilenol | /tilenol/xcb/xmlparse.py | Python | py | 13,017 | permissive | import os.path
import struct
import keyword
from math import ceil
from collections import namedtuple, OrderedDict
from xml.etree.ElementTree import parse, tostring
class Basic(object):
def __init__(self, name):
self.name = name
def clone(self, name):
return self.__class__(name)
class Simpl... |
0c23d8022016d1ce07428d797c3fa5566f0e788e | 51d3b7e945292aca632c937e8c03c25a18567863 | Peggy-Dong/python- | /mysite/migrations/0012_plastic.py | Python | py | 1,244 | no_license | # Generated by Django 3.2.3 on 2021-06-20 15:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mysite', '0011_paper1'),
]
operations = [
migrations.CreateModel(
name='Plastic',
fields=[
('id', mo... |
c569cc9ab87510c98959fd22565a33f6e07b375b | 7099a99bfbe91aa10caa1ead7fb6e2dcf3fcbff1 | bravesoftdz/Batch-Face-Detection-and-Cropping | /face.py | Python | py | 825 | no_license | import cv2
import sys
import glob
cascPath = "./haarcascade_frontalface_alt.xml"
#cascPath = "./haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascPath)
files=glob.glob("*.JPG")
for file in files:
image = cv2.imread(file)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
faces... |
3ca4172a1791f370afcc37bd0e1347341c161012 | 61ffc81d3baf9669da788080d1437cddad769c1e | vinlok/vinlok.github.io | /_posts/algorithms/graphs/bst/branch_sums.py | Python | py | 3,344 | no_license | # Do not edit the class below except for
# the insert, contains, and remove methods.
# Feel free to add new properties and methods
# to the class.
from collections import deque
import pdb
class BST:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def i... |
90998205ac518cad39dec5af93936607494fb1ee | 6b5faa847156b1e538e3d2719d7830dcd58d25ad | park1112/snpcompany | /snpcompany/users/tests/test_admin.py | Python | py | 1,298 | permissive | import pytest
from django.urls import reverse
from snpcompany.users.models import User
pytestmark = pytest.mark.django_db
class TestUserAdmin:
def test_changelist(self, admin_client):
url = reverse("admin:users_user_changelist")
response = admin_client.get(url)
assert response.status_cod... |
f19a181dc3edc56571d90238b16e8d499c51c56f | f2a03aea36fa80477e7adbe54e549709db3dc922 | nalger2/spotify-final-project-222 | /utils.py | Python | py | 6,757 | no_license | import pandas as pd
import numpy as np
import datetime
import matplotlib.pyplot as plt
'''
Loads spotify listening history to a dataframe from a csv file.
'''
def load_listening_history(filename):
df = pd.read_csv(filename)
return df
'''
Loads song library from a json file to a dataframe.
'''
def load_song_l... |
c7073c682d033e6883027d06de5385421bcb1172 | a84fa3865cdbbfa5c83ae1d8fdd925dda5c6943c | malaania/code_prng | /pseudorandom_number_generation/chi_square_test.py | Python | py | 1,902 | no_license | # Funkcje wspomagające przeprowadzenie testu chi-kwadrat
from math import ceil, floor
def goodness_of_fit(expected, observed):
"""Returns value of chi-square statistics.
:param expected: array of expected values
:param observed: array of observed values
:return chi-square statistics
"""
if len... |
5806f35e1c40fde4b48a00d3531655dfa7437609 | ff3c6aec8f1b7fa3635bf3300dff0ca3de061500 | umesh-timalsina/libraries.io | /hello.py | Python | py | 243 | no_license | #!/usr/bin/python2.7
from Tkinter import *
# if you are working under Python 3, comment the previous line and comment out the following line
#from tkinter import *
root = Tk()
w = Label(root, text="Hello Tkinter!")
w.pack()
root.mainloop()
|
44f74f5ca6df1824cce663ef6c8917091172935e | 0cdaf08aead1d71405074b7879378f673479e68c | terranum-ch/GraphLink | /graphlink/ui/gkui_graphic_manager.py | Python | py | 1,872 | permissive | #!/urs/bin/python
import os
import wx
import tempfile
from .gkui_link_dlg import GKUILinkDialog
from ..core.gk_link import GKLink
from ..core.gk_graphic import GKGraphic
class GKUIGraphicManager(object):
def __init__(self, parentframe, linklist, display, nodemanager):
self.m_link_list = linklist
... |
231df4059edd08ee967f161bbce162c7c0445a6d | 58bffc34d7c272cc7d948ae6666d6f615613bf08 | dsbowen/dash-fcast | /moments_app.py | Python | py | 1,358 | permissive | import dash_fcast as fcast
import dash_fcast.distributions as dist
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from dash.dependencies import Input, Output
app = dash.Dash(__name__, external_stylesheets=[db... |
67fa89e3237895f32f265c2adc00cf056de0aebf | 040377976e6115731ba5825c3aced1919e64e432 | damilare/mitiri | /setup.py | Python | py | 417 | permissive | import os
import pymongo
from flask import Flask
def setup():
app = Flask(__name__)
app.config.from_object('settings')
config = app.config
conn = pymongo.connection.Connection(config['MONGODB_HOST'],
config['MONGODB_PORT'])
db = conn[config['MONGODB_DB']]
... |
4084658e860e2c547011b6ee69e455831407989d | 694df0f4f62eb4a3f6cce2a3b6e8163727c187e4 | icyyci/Chest_X-ray_Classifier | /data.py | Python | py | 18,709 | no_license | # Matplotlib
import matplotlib.pyplot as plt
# Numpy
import numpy as np
# Pillow
from PIL import Image
# Torch
import torch
from torch.utils.data import Dataset
from torchvision import transforms
#OS
import os
import random
class Lung_Dataset(Dataset):
"""
Lung Dataset Consisting of Infected and Non-Infected.
... |
8b8ffaf4b23a35b0fafbac5ac49cac486d3cb409 | 104694d9593e6d85475115af3fe1e10e930e18f1 | nmaswood/jaynes | /jaynes/email/gmail_client.py | Python | py | 1,106 | no_license | import os.path
import pickle
from google.auth.transport.requests import Request
from googleapiclient.discovery import Resource, build
from google_auth_oauthlib.flow import InstalledAppFlow
from jaynes.constants import ROOT_DIR
SCOPES = ('https://www.googleapis.com/auth/gmail.readonly', )
def _fetch_creds(token_pat... |
15312da87c4e9b7008c1eebfcb4722d8997973cc | f459f84eb1c1ce4d96a0c13feddb5aa9d6e04437 | Peter-Chou/tensorflow-playground | /CV/mnist_MovingAverage_LearningDecay/mnist_train.py | Python | py | 2,563 | no_license | # -*- coding: utf-8 -*-
import os
import sys
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import mnist_inference
# network related parameters
BATCH_SIZE = 100
LEARNING_RATE_BASE = 0.8
LEARNING_RATE_DECAY = 0.99
REGULATION_RATE = 0.0001
TRAINING_STEPS = 30000
MOVEING_AVERAGE_DECA... |
3d86ab5f9ff59bba5ef55a0bb4ddf403aef72cb2 | 92e7cd6ef7f39cf4cd32f95b81144ed7d0f2626c | hs105/coach-1 | /agents/ppo_agent.py | Python | py | 13,127 | permissive | #
# Copyright (c) 2017 Intel Corporation
#
# 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 t... |
b7396d3f609bc132dd8de9136bbbd08b0d87a506 | 53f89fb26e114b2d51536d8e04748d14b03c2b89 | Jimmy-INL/fourier-transformer | /examples/ex3_darcy_inv.py | Python | py | 6,709 | permissive | import sys
sys.path.append("../")
from libs import *
def main():
with open(os.path.join(SRC_ROOT, 'config.yml')) as f:
config = yaml.full_load(f)
test_name = os.path.basename(__file__).split('.')[0]
config = config[test_name]
args = get_args_2d(**config)
cuda = not args.no_cuda and torch.c... |
e12abbe732032974069c051e12c1e37b652391df | b1061414aa685492e532eb638aa131803447fd04 | asears/WebSharp | /Tools/binding/generators/idl_c_sharp.py | Python | py | 13,246 | permissive | #!/usr/bin/env python
# Copyright (c) 2016 Xamarin, Inc
""" Generator for C# style binding definitions """
from datetime import datetime
import glob
import os
import re
import sys
from idl_log import ErrOut, InfoOut, WarnOut
from idl_node import IDLAttribute, IDLNode
from idl_ast import IDLAst
from idl_option import... |
71d501cdea46b75aa7a28dae203c9009d8fbd72a | 0b339710af5d7f52a313ea202a86cb1d46fc1bc0 | SarwarNeki/https-github.com-G-Node-nixpy | /docs/source/examples/spikeTagging.py | Python | py | 2,810 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright © 2014 German Neuroinformatics Node (G-Node)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted under the terms of the BSD License. See
LICENSE file in the root of the Project.
Author: Ja... |
d93d05032eaefd93229630cc31a18ca3aa9fd27d | 0ca84b521735faaa4d6b74bbe76b9ca9bff63062 | aggarwalyash/RestApi-MoneyControl | /mainapp/migrations/0005_auto_20191115_1019.py | Python | py | 494 | no_license | # Generated by Django 2.2.5 on 2019-11-15 10:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mainapp', '0004_auto_20191115_1017'),
]
operations = [
migrations.AlterField(
model_name='lendi... |
b842ad5bd8fa9ca9b0709014b3b8d4ba2c532294 | a94e021f2455b06ed229e9b8cc63b66b932fe8fe | angeldsLee/miniblog | /app/models.py | Python | py | 2,572 | no_license | from app import db
from hashlib import md5
followers = db.Table('followers',
db.Column('follower_id', db.Integer, db.ForeignKey('user.id')),
db.Column('followed_id', db.Integer, db.ForeignKey('user.id'))
)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
nickname = db.Colum... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.