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
cc0e6308f200bad01f13432422b30016f862d9e6
4a54121ce0bd5894cb51dc690ad637dd2759fdf3
ManojDatt/gkbank-app
/GkBank/settings.py
Python
py
7,002
permissive
""" Django settings for GkBank project. Generated by 'django-admin startproject' using Django 3.0.7. 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 # ...
f9daa3377482ad273f4a4f75805fe318722f5436
65bc26cffe0a29e83e07783c0912b0d15c2d174d
putupradnya/streamlit-app
/example/widget_with_plot.py
Python
py
2,185
permissive
import streamlit as st import pandas as pd from bokeh.plotting import figure from bokeh.models import ColumnDataSource, CustomJS from bokeh.models import DataTable, TableColumn from bokeh.plotting import figure from streamlit_bokeh_events import streamlit_bokeh_events st.set_page_config(layout="wide") # import functio...
28912c1159dee1c24fe40695966d4a6d942915fb
5ed8470689ddf39582d996dad81740813da46632
IanMK-1/The-news
/app/__init__.py
Python
py
440
permissive
from flask import Flask from config import config_options from flask_bootstrap import Bootstrap bootstrap = Bootstrap() def create_app(config_name): app = Flask(__name__) app.config.from_object(config_options[config_name]) bootstrap.init_app(app) from .main import main as main_blueprint app.re...
34711201a233195427220024aa7b4b0c99699a0e
0d2b3d7934b8f2ebafb73de116286c2bb65d66bd
asomya/vmware-nsx
/devstack/tools/nsxp_cleanup.py
Python
py
19,291
permissive
# Copyright 2018 VMware 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 app...
379776599991b86bc0f7dc9a879c21d011c73750
9986213de1de94cac6be13def9bdae02d7df2929
shubhamJadhao2805/ILLEGAL_THINGS_DETECTION_USING_MACHINE_LEARNING_PYTHON
/detect_illigal_things.py
Python
py
1,675
no_license
import cv2 import numpy as np import PIL.Image import coremltools import operator cam = cv2.VideoCapture(0) cv2.namedWindow("test") img_counter = 0 Height = 227 # use the correct input image height Width = 227# use the correct input image width print("Select your option :") print("1.For Illegal Things ") print("2.F...
5d9ec404fda03570fdffa198b10713652b9f3ecc
b832e38509b0f515127b46cd53030b8a3f2b2ad9
alvarovdt/100-Days-Of-Code-Udemy
/100 Days of Code/3. Intermediate+ [32-57]/Day 53 Zillow Rental Research/main.py
Python
py
3,333
no_license
from bs4 import BeautifulSoup import requests from selenium import webdriver import time header = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8" } response = requests.g...
0159fc37e1094b35680ae00603be6a15daa33f48
07762ebc8085228fed2996e71737bbfe4dd9caf1
Amanda-Carmo/p4_robcomp
/projetos_py/src/cor.py
Python
py
3,430
no_license
#! /usr/bin/env python # -*- coding:utf-8 -*- __author__ = ["Rachel P. B. Moraes", "Igor Montagner", "Fabio Miranda"] import rospy import numpy as np import tf import math import cv2 import time from geometry_msgs.msg import Twist, Vector3, Pose from nav_msgs.msg import Odometry from sensor_msgs.msg import Image, Co...
ae6c3012336d6f5eb795a3a813037b99537d4c4c
a9e337e66f9eddbc2162053ab5acb737f512d906
isabella232/autoconj
/autoconj/tracers.py
Python
py
18,880
permissive
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
6cec1d895d32e438df6ed76e2095ad02e40ce097
7bd1749ea77233a1cbf9b0dccfa09d2904073814
mohiteotia/Alien-Game
/game_functions.py
Python
py
6,386
no_license
import sys from time import sleep import pygame from bullet import Bullet from alien import Alien def check_keydown_events(event, ai_settings, screen, ship, bullets): if event.key == pygame.K_RIGHT: ship.moving_right = True elif event.key == pygame.K_LEFT: ship.moving_left = True ...
6874e83241e83695eb1c727ce6ec9c934ea4f729
5e8804e9b7885ac55ec3badf01ed3321a17388ec
test-wiz-sec/pulumi-azure-nextgen
/sdk/python/pulumi_azure_nextgen/network/v20170901/get_public_ip_address.py
Python
py
9,893
permissive
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
eef5b560c3e14caf9a875aafd11b2efdd7742d60
40d6992650f559c6d582c3dfa92418b769150894
psuman10/Suman
/venv/Lib/site-packages/sorting/radix.py
Python
py
736
no_license
def radix(arr, simulation=False): isDone = False position = 1 iteration = 0 if simulation: print("iteration",iteration,":",*arr) while not isDone: queueList = [list() for _ in range(10)] isDone = True for num in arr: digitNumber = num // position % 10 ...
4d864ec1f15102f93111e2a231fb83e4d4144384
82c30aadd279728d04500c44b74d8dfa717d479b
baverman/taburet
/tests/test_mongokit.py
Python
py
4,524
permissive
from datetime import datetime from bson import Code from pymongo import Connection from taburet.mongokit import Document, Field, wrap_collection def pytest_funcarg__db(request): db = Connection().test db.collection1.drop() db.collection2.drop() return db def test_document_must_contain_possible_filed...
ed0c27869d1e7e37363e54829698d644ad01fc35
0c3d2978e51d2222949df3894942b3a5a9c423f0
qgrasso/nova
/nova/virt/configdrive.py
Python
py
5,375
permissive
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Michael Still and Canonical 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:...
f8d666e7de5123a3eda8b39334341968035d8d71
3ce6f0feec5024607c715c86f3e25755c72553b3
scanner/my-django-survey
/survey/templatetags/survey.py
Python
py
579
permissive
from django import template register = template.Library() @register.filter def has_answered(request, survey): if not hasattr(request, 'session'): return False return (survey.has_answers_from(request.session.session_key) or (request.user.is_authenticated() and survey.has_answers_from_u...
4814ad25ec9e8227f5308c6ade85ce37c0ad7444
04159b800baefaecc05f5f5b3d52cef49fe6d1a6
explod1983/coin_webview
/crypto_web/morda/models.py
Python
py
434
no_license
from django.db import models class Coin(models.Model): name = models.CharField(max_length=30, primary_key=True, blank=True) amount = models.CharField(max_length=30) buy_price = models.CharField(max_length=30) desired_price_fall = models.CharField(max_length=30) desired_sell_price = models....
c2a4116bcd9f1bf53b1685defb1341860ebf53b0
428255d87790fd30872bec801e4254042e452b87
chinashenqiuwuyanzu/wuyanzu
/python1/aaaaaaa.py
Python
py
2,617
no_license
# import requests # import re # url='http://www.qiushibaike.com/imgrank/page/2/' # head = { # 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' # } # res = requests.post(url, headers=head) # html = res.content.decode('utf-8') # prin...
2f7aaee0f74c3ff41d14a6a8ca5c788d0fa5d51f
41ebc191e0a05c70bb79ebbfdb02e92cf7740116
xiawuchaa/Flask-ihome
/ihome/models.py
Python
py
10,482
no_license
from datetime import datetime from . import db from werkzeug.security import generate_password_hash, check_password_hash from ihome import constants class BaseModel(object): """模型基类,为每个模型补充创建时间与更新时间""" create_time = db.Column(db.DateTime, default=datetime.now) # 记录的创建时间 update_time = db.Column(db.DateTi...
4fb6a27959a31f73ee6e0e8dd6ca43ddd4d1137b
77a4668a82f2b6b8709f7fff530a38b551749a61
migaweb/py_networking
/mac_changer.py
Python
py
1,658
no_license
#!/usr/bin/env python import subprocess import optparse import re def get_current_mac(interface): ifconfig_result = subprocess.check_output(['ifconfig', interface]) mac_address_search_result = re.search(r'\w\w:\w\w:\w\w:\w\w:\w\w:\w\w', str(ifconfig_result)) if mac_address_search_result: return ...
d4e35782dc8c7fa18e2e75c7950fa3ceff479520
b626620531720ce7e8fef231a671d7ba8fadb31e
nischalstha9/myPortfolioSerever
/Userprofile/migrations/0002_auto_20200910_0555.py
Python
py
433
no_license
# Generated by Django 3.0.7 on 2020-09-10 05:55 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('Userprofile', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='profile', name='first_name', ), ...
265ff8b127e653465237b30f1b1c31665aced6e6
5f2b03aa20f2f4aaf64cc26fe2fb538a13aaf62b
hhe07/civ-kata-B
/main.py
Python
py
6,302
no_license
from command import Client from player import Player from consts import TileType, ProduceType, PlayerTag, TileProps, TechType from units import Army, Worker from tile import Tile from board import Board def __main__(name: str, key: str, url: str): cl = Client(key, url) cl.setName(name) board = Board() ...
31dd67a5f08cc858d28893dbea57f3180ca9dbd0
39de747b175da5667fad4261bb2f6c6cb8ae15f8
auduno/scikit-learn
/sklearn/feature_extraction/text.py
Python
py
44,525
permissive
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck <L.J.Buitinck@uva.nl> # Robert Layton <robertlayton@gmail.com> # # License: BSD Style. """ The :mod:`sklearn.feature_extraction.text` submodule gathers utiliti...
a5c4acfe34cdb9e04dbb30a807c5f0924f89e944
b44b89e1254f8a1fc5ef2fc7f946909408da49dc
nitikayad96/chandra_suli
/chandra_suli/separate_CCD.py
Python
py
1,242
permissive
#!/usr/bin/env python """" Take event file and create multiple new event files separated by CCD command from CIAO: dmcopy filtered_event.fits[EVENTS][ccd_id=N] out.fits clobber=yes Make sure CIAO is running before running this script """ import argparse import os import subprocess import astropy.io.fits as pyfits ...
128c640ffac7e9a4b3d6a3d067514dbd3df6a478
18db8fe9d291a57d28051e322dfbdc3e5f737c00
zaipingy/learn_django
/django_test/urls.py
Python
py
1,658
no_license
"""django_test URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/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-b...
9f511a08386f01c981c43e84985b811c858a8cfa
9c461900bcfca70a117b0be945f2b0cfdc423139
Xianchao-Wu/megatron2
/megatron/mpu/tests/test_initialize.py
Python
py
4,038
permissive
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. 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 re...
52496f981b090237c5b43a613d8c054d63abb668
bd6c5533210fdef4d04b29a026df990191acf170
yktoo/rattle
/pkg/etl/handlers/sql_query.py
Python
py
3,479
no_license
from etl import logger from etl import context from etl.handlers import base class Handler(base.Handler): """Allows to execute an SQL query and fetch data from a database. Relevant configuration entries: output_param -- Name of the parameter used for returning result data. Optional, default is 'd...
c0c2a2960ce5f9d93d73118937935aff9b4ce5ff
657c4ed4ecd2a30fdc5536877de196d0c654fe20
jason0x43/home-assistant
/homeassistant/components/enocean/sensor.py
Python
py
8,167
permissive
"""Support for EnOcean sensors.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorStateClass, ) from homeassistant.const import ( CONF_DEVICE_CLASS, C...
b1228f48af9eb7428d8b7e371c1b156bb573ce39
818495c52c57f13891321c8aba705947b597f219
arpreading/ISD2014
/multipleChoice.py
Python
py
470
no_license
from choiceQuestion import * class MultipleChoiceQuestion(ChoiceQuestion): def __init__(self): super().__init__() def addChoice(self, choice, correct): self._choices.append(choice) if correct: ans = self.getAnswer() newAns = ans + " " + str(len(self._choices)) self.s...
8bf3a6d4e97e9fd2d18d2293ed4b6e4a82ce697c
d9180b38d5f2a3e882a6671f56b85d974c1da005
johnjdailey/autogluon
/autogluon/core/decorator.py
Python
py
10,591
permissive
import copy import logging import argparse import functools from collections import OrderedDict import numpy as np import multiprocessing as mp import ConfigSpace as CS from .space import * from .space import _add_hp, _add_cs, _rm_hp, _strip_config_space from ..utils import EasyDict as ezdict from ..utils.deprecate im...
eef5af9c32764e1c1601a983e0d6fb66b5681b91
88f50d52bc7e40e4a73e313a03c134511a358fd5
uccser/cs-unplugged
/csunplugged/at_home/management/commands/_ChallengeLoader.py
Python
py
2,892
permissive
"""Custom loader for loading activity challenges.""" from django.db import transaction from utils.TranslatableModelLoader import TranslatableModelLoader from utils.check_required_files import find_image_files from at_home.models import Challenge CHALLENGES_FILENAME = 'challenges.yaml' class ChallengeLoader(Translat...
1fb337b00c96c836413a395affa7941135d9a2f4
3d58dd89bf0bf7ae0ff664f8efb339b6262d842c
zhangdavids/workspace
/Daily/180510.py
Python
py
4,058
no_license
# Python implemenation of Elevator Allocation Algorithm # Written by Austin G. Walters for austingwalters.com # July 2014 - Python 2.7 peoplePerFloor = 100.0 timePerFloor = 5 timePerWait = 20 # 3600 seconds per hours rushHour = 3600.0 floorCount = 10 elevatorCount = 3 # Sets up the building, filling all the floors ...
b28e2b2c37edc61fe8a59a2ca01cec8d6f6cfaec
17b13b67e94efb145c0d8b1accc3c463312351c8
Ash-K/ydk-py
/cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_atm_common_datatypes.py
Python
py
1,938
permissive
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
fc4ebc3c353886cf3ed2cc15c0bbd7e3973dc4d3
be62ddadfdbc5187fe01cde6c97cf7d4906ccace
yagizkurtoglu/Selenium-Python-Twitter-Following
/following.py
Python
py
1,841
no_license
def getFollowing(user): driver.get("https://twitter.com/"+user+"/following") time.sleep(2) notfollowing = [] notfollowing.append(driver.find_element_by_xpath("//*[@id='react-root']/div/div/div/main/div/div/div/div[2]/div/div[2]/div/div/div/div[5]/aside/div[2]/div[1]/div/div[2]/div/div[1]/a/div/div[2...
25e8e95fd175f71c2074ffab1b8140ae30d7ac7d
771666813478228fff4a1ed89818b086e4feb90d
biplovbhandari/OSM_DataManipulation
/Sateltiles/getPassword.py
Python
py
3,146
no_license
import wx import admin_email as adminEmail import login as log import database_api as db import settings as setting class GetPasswordPage(wx.Frame): def __init__(self, parent, title): super(GetPasswordPage, self).__init__(parent, title=title, size=(400,320) , style=wx.MINIMIZE_BOX| wx....
478faf3365b1d8a2d1b5e324d4aeff574cf12d77
216d4f76d68d36e73f51b58bb17821243587b896
santiweide/genetic-algorithm
/venv/Scripts/rst2latex.py
Python
py
833
no_license
#!D:\coding\python\genetic-algorithm\venv\Scripts\python.exe # $Id: rst2latex.py 5905 2009-04-16 12:04:49Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing LaTeX. """ try: import locale...
76e6801d3e970151f1cf5a42decc49bba82ca85a
e48f07ea2ccabf32de7929d9b43a548404d2ae3d
sh9369/mal_ip_check
/project/get_blacklist/bitnodes.py
Python
py
2,035
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- import requests,json,time from store_json import store_json import blacklist_tools def bitnodes(mylog): requests.adapters.DEFAULT_RETRIES = 5 try: http = requests.get('https://bitnodes.earn.com/api/v1/snapshots/latest/',verify=False,timeout=120) neir =...
78c8cb6545e3153be665768e08a8f7ca178dbd68
8a2a7f08312eb5ce60d16c3707938a2b2bdcdc02
crowdbotics-apps/igive-aloha-21815
/backend/igive_aloha_21815/wsgi.py
Python
py
411
no_license
""" WSGI config for igive_aloha_21815 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('DJ...
b25d29f7e7748007fcb58932ad6ad494e177495a
718828dd02f74a7ecc05b05f9e7dd64c9a4c925f
practicum/poq
/docs/ex_06_lambda.py
Python
py
464
no_license
Supplier = [ [3], [4], [5] ] Part = [ [0], [1], [2] ] SPJoin = [ [3,0], [4,1], [3,1], [5,0], [3,2] ] def select( collection, filter_function ): return filter( filter_function, collection ) def execute(): global Supplier, Part, SPJoin q = select( Supplier, lambda s : 0 == len( ...
3a6bb85f010576892604aa15f26074d08b9ffbae
02c12fc56dfa25b4ef57af473acda85d27fb437f
houmenou-cheikh/AI-Runtrack-1
/Job_jour4/teste_recursif.py
Python
py
293
no_license
#une fonction qui fait appel à elle mm tant #que la condition définie n est pas verifier def my_function(k): if(k > 0): result = k + my_function(k - 1) print(result) else: result = 0 return result print("\nRecursion Example Results:") my_function(6)
8be2a87765dc5b05648114868f88cf773833e853
72651329963ae74476a93e659aef376c67f2386d
prameshstha/myMarket
/myMarket/urls.py
Python
py
968
no_license
"""myMarket 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-base...
7b73294123095d7a765c3250c0bdb3bf3a7a00ac
7078fd361f2b84863a64b279fc23690f8da6bad4
matthieuchoplin/jwg-python
/exercises/TestCircleWithCustomException.py
Python
py
389
no_license
from CircleWithCustomException import Circle, InvalidRadiusException try: c1 = Circle(5) print("c1's area is", c1.getArea()) c2 = Circle(-5) print("c2's area is", c2.getArea()) c3 = Circle(0) print("c3's area is", c3.getArea()) except InvalidRadiusException as ex: print("The radius", ex.rad...
242793ee54d3ffac251bad752a0abb84103c2b2e
4bcd4478a4fbecc61e3a6a5ade29273a5d9da536
AdamZhouSE/pythonHomework
/Code/CodeRecords/2142/60785/286801.py
Python
py
285
no_license
t=int(input()) for test in range(t): str=input() count=0 for i in str: if i=='(': count+=1 print(count,end=" ") if i==')': print(count,end=' ') count-=1
433c0016a60c8dc9a1209ba9639006f5f47a8dc4
35ff6783e69f990230f5e6078cac52779966a26c
shagunsodhani/consistent-dynamics
/codes/model/imagination_model/components/consistency_model/cosine.py
Python
py
455
permissive
from torch import nn import torch from codes.model.base_model import BaseModel class Model(BaseModel): """ Model to compute inconsistency between two input distributions """ def __init__(self, config): super().__init__(config=config) self.pdist = nn.CosineSimilarity() def forward(self, ...
acde23dcd996058d19462c73eaa23a63273e9e2d
aa8777e8c6dada1a266a10c813e400ff20794fbd
amjith/django
/tests/generic_views/views.py
Python
py
6,759
permissive
from __future__ import absolute_import from django.contrib.auth.decorators import login_required from django.contrib.messages.views import SuccessMessageMixin from django.core.paginator import Paginator from django.core.urlresolvers import reverse, reverse_lazy from django.utils.decorators import method_decorator from...
a0c7d67234f0baeed95b5d01f4e00fed774170e7
5c9a5d01c76e0db6ca6ff75e774c948e871443c6
zoelesv/Smathchat
/venv/Lib/site-packages/django/utils/decorators.py
Python
py
6,834
permissive
"Functions that help with dynamically creating decorators for views." from functools import partial, update_wrapper, wraps class classonlymethod(classmethod): def __get__(self, instance, cls=None): if instance is not None: raise AttributeError("This method is available only on the class, not ...
c55dbef116394bc465b42bc23f85ab3d92af8cfa
ae80b5469b662c51476322a0b1d46340c32c065d
gitter-badger/openprocurement.planning
/src/openprocurement/planning/api/traversal.py
Python
py
1,538
permissive
# -*- coding: utf-8 -*- from pyramid.security import ( Allow, Deny, Everyone, ) from openprocurement.api.utils import error_handler from openprocurement.planning.api.models import Plan def get_planning_acl(): return PlanRoot.__acl__ class PlanRoot(object): __name__ = None __parent__ = None ...
7267b79af8d89276bf1f9e046ea976ad4e1d54ba
b43fbee81231ac970aec6a46e5d635db2f107323
wislish/Machine-Learning
/Regression/week3-assignment.py
Python
py
2,383
no_license
import pandas as pd import numpy as np import math from sklearn import linear_model import matplotlib.pyplot as plt import seaborn as sns dtype_dict = {'bathrooms': float, 'waterfront': int, 'sqft_above': int, 'sqft_living15': float, 'grade': int, 'yr_renovated': int, 'price': float, 'bedrooms': float, ...
a5037e9e07a5508844d39e1b13a25dde32fedfd3
395b7b2eb03037446fc5f14aa1130feb514c03f9
zoesteier/finalproject2
/finalproject2/rap1net.py
Python
py
12,986
permissive
# -*- coding: utf-8 -*- """ Created on Fri Mar 17 11:05:47 2017 @author: Zoë """ #%% This neural network will learn to identify the RAP1 transcription factor binding site from dna sequences. import neuralnet as nn import os import numpy as np from sklearn.metrics import roc_curve, auc import matplotlib.pyplot as plt...
9780b47711c1107b1baa796e9f208ee54e6891aa
a771bbb39b602f720926bbdca7138b71fd3e7bf3
ninjahoahong/django-examples
/django-yaas/manage.py
Python
py
257
permissive
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "YAAS.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
96150553a1af76f849fbae1468e8b671c09fcd89
3ac6951b34afef22766b005fd208fa8ebc8f9f65
ehsan-hn/my-first-blog
/mysite/settings.py
Python
py
3,198
no_license
""" Django settings for mysite project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
f8d388dfcacd85af32a43488e76fe6596f14f3f6
4169223b4974643f3e03e72a5e0bb74dd374e13f
googleinterns/vm-network-migration
/vm_network_migration/modules/forwarding_rule_modules/regional_forwarding_rule.py
Python
py
4,557
permissive
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
7f97ee6f11d1aa3eff23493997e502270f9e4d1b
60bb90926275200172202dc465e05e0ffed0d70a
Gustavo-Lourenco/Python
/Exercícios/ex039.py
Python
py
365
permissive
from datetime import date ano = int(input('Digite o ano do seu nascimento: ')) x = date.today().year - ano if x == 18: print('Você deve se alistar ainda esse ano!!') elif x < 18: print('Você deve se alistar em {} anos'.format(18-x)) else: print('Você deveria ter se alistado há {} anos atrás'.format(x-18))...
3f14052a20ff2231310eed2686f325e7f8224364
98275d0959b2f9d3b93b3207138cf7375e7573de
svestark/mushroom
/tests/utils/test_callbacks.py
Python
py
2,251
permissive
from mushroom.core import Core from mushroom.environments import GridWorld from mushroom.algorithms.value import SARSA from mushroom.policy import EpsGreedy from mushroom.utils.parameters import Parameter, ExponentialParameter from mushroom.utils.callbacks import * def test_collect_dataset(): np.random.seed(88) ...
d7d81f32d181117ac1f1c0b73f2d32bcbe98787a
0d0b4704118a2005d009418d4d82ecdd0005ebd7
rforien/IBD-Analysis
/IBD-Simulations/analysis.py
Python
py
31,283
no_license
''' Created on 21.10.2014 This is the class for Analysis and Data Visualisation @author: hringbauer ''' import os import numpy as np import bisect import itertools import matplotlib.pyplot as plt import matplotlib.cm as cmx import matplotlib.colors as colors from matplotlib.widgets import Slider from math import sqrt ...
5faf9242097ac2460ad50832993c57abda56394b
7dae800fdad9526dbc81b44732988a7ae6a6fb01
oboehmer/genieparser
/src/genie/libs/parser/iosxe/tests/ShowIpv6AccessLists/cli/equal/golden_ipv6_access_list_output_expected.py
Python
py
9,148
permissive
expected_output = { "OutFilter_IPv6": { "aces": { "120": { "statistics": {"matched_packets": 3974749339}, "matches": { "l4": {"ipv6": {"established": False}}, "l3": { "ipv6": { ...
220240f3655f7705c46981b1a99b88716f972831
9e01af36781237854fbd1fc7f41cdc94c4c26f82
mariobeaulieu/Adeept_Ultrasonic_Kit
/Lesson04/04_btnAndLed_1.py
Python
py
1,355
no_license
#!/usr/bin/env python import RPi.GPIO as GPIO import time LedPin = 11 # pin11 --- led BtnPin = 12 # pin12 --- button def setup(): GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output GPIO.setup(BtnPin, GPIO.IN, pull_up_down=GPIO.PUD_...
454f30ff88cbcf5e2c12343eb4d86e7f85af4b5e
6c31e33e1fcd9ad8196c37219e098f181bce8e60
884980336/yian
/user/views.py
Python
py
9,179
no_license
from django.shortcuts import render, HttpResponse, redirect from django.core.mail import send_mail from django.http import JsonResponse from django.db.models import Count from django.db.models import F, Q from django import contrib from user import formclass from user import models from shihui import models as shihui_...
419d4c08e7acfb7515d405cee66bdc2432fda79c
fec9866a1255e576f07005e084257e60347cbea1
SAM33/Pytube-excel-list-downloader
/downloader.py
Python
py
2,518
no_license
import sys import os import xlrd import json from pytube import YouTube import time from random import randint from tkinter import Tk from tkinter.filedialog import askopenfilename from tkinter.filedialog import askdirectory Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing download_lis...
f3ae9085921e7da8efa88c924f26121dd949a47b
d4f448647641ec6159ddf2db5c2277a4ecb38213
ustcmike/xnmt
/xnmt/loss_calculators.py
Python
py
10,326
permissive
from typing import List, Optional, Sequence, Union import numbers import dynet as dy import numpy as np from xnmt import batchers, event_trigger, losses, search_strategies, sent, vocabs from xnmt.persistence import bare, Ref, Serializable, serializable_init from xnmt.modelparts import transforms from xnmt.eval import...
575134c356e9a0e241b2192aa3f156f789e6b7bf
98254d1efe1e251fbf36bc08449b58bc1392396d
xavi1989/cs231n
/CS231N/MyHW/assignment1/cs231n/classifiers/softmax.py
Python
py
3,359
no_license
import numpy as np from random import shuffle def softmax_loss_naive(W, X, y, reg): """ Softmax loss function, naive implementation (with loops) Inputs have dimension D, there are C classes, and we operate on minibatches of N examples. Inputs: - W: A numpy array of shape (D, C) containing weights. - X:...
dff7e686e234a94f43733f1ecd2928ba00ca9d5b
22d2b21ea7e35f0fca69186f22230bdf95721397
AnfisaAnisimova/Geekbrains_student
/Введение в Python/Anisimova_Anfisa_dz_3/Task_3_3.py
Python
py
350
no_license
employees_dict = {} def thesaurus(*args): for name in args: if name[0] in employees_dict: employees_dict[name[0]].append(name) else: employees_dict.setdefault(name[0], [name]) thesaurus("Иван", "Мария", "Петр", "Илья", "Максим", "Анна", "Андрей") print(employees_dict)
a6d3c174ea2e3f8ae6aa188f5d5daf0bac3d91de
dfb2506eaba950cb25e42e5285325a9240ae7732
keatonh/drf_tutorial
/snippets/models.py
Python
py
1,613
no_license
from django.db import models from pygments.lexers import get_all_lexers from pygments.styles import get_all_styles from pygments.lexers import get_lexer_by_name from pygments.formatters.html import HtmlFormatter from pygments import highlight LEXERS = [item for item in get_all_lexers() if item[1]] LANGUAGE_CHOICES = s...
062bf08d58bffdb2e9d52be98bd85dc6e8b16f77
12e5b38f083aabe90810b981580133785ac4be2b
hreso110100/RL-Tic_tac_toe
/src/players/agents/SarsaBot.py
Python
py
2,735
no_license
import random from src.players.CommonPlayer import CommonPlayer class SarsaBot(CommonPlayer): def __init__(self, name, q_function=None): super().__init__(name) self.initial_values = 0.5 if q_function is None: q_function = {} self.q_function = q_function def mark...
082b0698aa073b1cfa3a954b2d3e35a6248051af
3c54b94866e0aa3b80795bceb76d8c609e0b46a7
LAPS-Group/gym-drone
/gym_drone/envs/drone_cardinal_directions.py
Python
py
7,666
no_license
import gym from gym import spaces from gym.utils import seeding import numpy as np import matplotlib.pyplot as plt class Path(object): def __init__(self, capacity): self.capacity = capacity self.memory = [] self.position = 0 def push(self, point): if len(self.memory) < self.c...
a1a157ab5cea80a7c499e2fb7a0c8c13e341569e
882c29daed4224f3a6caf31f8b1dcc570bd4692e
zanshuxun/DeepCTR
/tests/models/FNN_test.py
Python
py
2,089
permissive
import pytest import tensorflow as tf from deepctr.estimator import FNNEstimator from deepctr.models import FNN from ..utils import check_model, get_test_data, SAMPLE_SIZE, get_test_data_estimator, check_estimator, \ Estimator_TEST_TF1 @pytest.mark.parametrize( 'sparse_feature_num,dense_feature_num', [(1...
83938a76dfe176da4676b10858aa4b28bfd00e5f
d3f3721c6777972f2a397b6df794029a12f66cee
vova292/pyomo
/pyomo/core/tests/unit/test_derivs.py
Python
py
9,832
permissive
# ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright 2017 National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and # Engineering Solutions of Sandia, LLC...
d2b9c097d5ca563f7763c73f8c8b0735ea0b4235
bb82401ceb63194052a732e11a81f34241262967
quarkfin/qf-lib
/demo_scripts/data_providers/portara/portara_intraday_strategy.py
Python
py
5,158
permissive
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
9576689f9002602c6742f2e4026bf123cae5aa8e
d41d076fd32f73917da3d8cd08777f2885e032f7
manudeepsinha/daily_commit
/2021/01/python/29 - Print Special Character count (Technical round).py
Python
py
522
no_license
''' The following question came in the technical coding round where for the input string, the output should generate an integer of the count of special characters present in the input string. ''' string = input() string = string.split() special = 0 for i in range(len(string)): if not string[i].isalnum(): ...
5cf3ff137d488115fe3efec475f75e9912e8a0e2
d4c42dd0a44238af65ac13d097c7282ce9dbc904
UWRealityLab/xrcapstone21sp-team4
/chord_recognizer-master/generate_wav_files.py
Python
py
1,414
no_license
import numpy as np import pyaudio, wave import os.path # create wav files: chords/chord_name/chord_name_#.wav (with # in [start_n, end_n] inclusive) def generate_wavs(chord_name, start_n, end_n, overwrite=False): CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 2 RATE = 44100 RECORD_SECONDS = 4 BASE_DIR = 'chord...
0ac93edd5f047e171105abe88838a949a31171e9
a408dc4b624741e4f5572afbc8902fc16409a1f5
sskelton90/CorrectTwitter
/src/python/validate.py
Python
py
611
no_license
import sys from word_tools import * import re file1 = open(sys.argv[1]) file2 = open(sys.argv[2]) correct = 0 size = 0.0 f1 = [] f2 = [] for line in file1: f1.append(line) for line in file2: f2.append(line) # Compare every word in the corrected version to the hand-corrected version # Return percentage accurac...
9408b86c37a1c829622cdf268c2c62e8c090a3f8
fbea4836c2f505a02a320a1538597383625c425e
fdemello/intersight-python
/intersight/apis/hyperflex_node_profile_api.py
Python
py
34,665
permissive
# coding: utf-8 """ Intersight REST API This is Intersight REST API OpenAPI spec version: 1.0.9-255 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os import re # python 2 and python 3 compatibility library from s...
a11ade7cb248833a0972eeeddeada3c0855ece3b
0b90b6b062f99528cb6db047f1aab8d17ce4f155
proequilibrium/flight_booking_test
/book_flight.py
Python
py
5,607
no_license
import requests import ujson from datetime import datetime, timedelta from pprint import pprint from uuid import uuid4 from argparse import ArgumentParser def search_flight(one_way, departure_from=None, arrival_to=None, datetime_from=None, datetime_to=None, daysInDestination=0): """ Find flights...
07803763d01b6652db88e161dd9d41af596d267f
b30ab343174865ade7cb0a77448dd7513f1519bd
alexfertel/fuzzy
/fuzzy/system.py
Python
py
3,257
no_license
from fuzzy import membership as m from fuzzy.rules import Rule from fuzzy.utils import plot from fuzzy.aggregations import * from fuzzy import nodes from functools import partial class Fuzzy: def __init__(self, inputs, outputs, operators, rules, aggregation_method, defuzzification_method): self.inputs = i...
b68b4e23586e84d07004635e48885b74f1da5225
3b29abbf5c742a2b02b67dd9b829c7f0f92d6c69
MikeMcGarry/lusid-python-tools
/lusidtools/lpt/qry_instruments.py
Python
py
1,968
permissive
import pandas as pd import dateutil from lusidtools.lpt import lse from lusidtools.lpt import stdargs from lusidtools.lpt import qry_instr_ids, lpt from .either import Either import re import urllib.parse rexp = re.compile(r".*page=([^=']{10,}).*") TOOLNAME = "instr_list" TOOLTIP = "List all instruments" def parse(...
d65527a14b3e565564257af98e8776788a94eacb
3ceda96b1d90b76841d39835504704932ff67290
PaddlePaddle/PLSC
/task/ssl/cae/engine_finetune.py
Python
py
5,212
permissive
# Copyright (c) 2023 PaddlePaddle 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 ap...
de58a3e79bf890602dcf07266ceff062fb4ad01c
bdf5ee8ead5c43c8740e93e9b94e1620400c8ce1
slinn0/ciscosparkapi
/examples/pyramidSparkBot/setup.py
Python
py
889
permissive
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst')) as f: README = f.read() setup(name='pyramidSparkBot', version=0.1, description='Pyramid Spark Bot application', long_description=README, cla...
19f6f3b483ee506206090d682286ff5f200b7d43
fd691be82dce224eb701d44e29c3df18673f870b
kahihia/Django_buddyinc
/rest_api/migrations/0015_deal_installation.py
Python
py
464
no_license
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rest_api', '0014_auto_20170223_2044'), ] operations = [ migrations.AddField( model_name='deal', name...
763dc84d0befea30bacb92a88e50405c206b8c89
25d46834b3212b87720ee23232b0113df1bd9959
jnhro1/CS_python
/지헌/5의 배수의 합.py
Python
py
229
no_license
num = int(input("정수를 입력해주세요 : ")) result = 0 ''' for i in range(1,num+1): if i % 5 == 0: result += i print(result) ''' for i in range(0,num+1,5): result += i print(result)
ed5ba263fb657665e3e6ac0a4585a42a3180e030
a3d2a0b025e3b88cdd81c15a896c7f6e98cabf7f
PhilipRodger/tango_with_django_project
/rango/models.py
Python
py
1,526
no_license
from django.db import models from django.contrib.auth.models import User from django.template.defaultfilters import slugify class UserProfile(models.Model): # To link the UserProfile to the in built User model, # Inheriting the use model derectly could cause problems if other apps want to use the User model ...
eed150a6786421240f6c34d12cf7607a814f42b5
fdca79b3e7069ce4f559ca297915bab607a151c7
ErickFDeveloper/Python_App
/src/app.py
Python
py
2,000
permissive
from flask import Flask, render_template, request, redirect, url_for from flask_mysqldb import MySQL app = Flask(__name__) #Coneccion a la bases de datos app.config['MYSQL_HOST'] = 'db' app.config['MYSQL_USER'] = 'root' app.config['MYSQL_PASSWORD'] = '12345' app.config['MYSQL_DB'] = 'noteapp' app.config['MY...
cdaac65cd29bd254dd70fc933089d05687b85920
93889658bf5a10c765bf30c65cd7b892c10fa5bf
dizcology/googleapis-gen
/google/streetview/publish/v1/streetview-publish-v1-py/tests/unit/gapic/publish_v1/test_street_view_publish_service.py
Python
py
107,507
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...
7776bba41415adf4d75beefd6cdc73977bc41378
e978c121c179306bb85cdf1d7b395f7e5336071c
penguinman543/Pi
/src/gz_piter/Python/symbolIdentifier.py
Python
py
3,074
no_license
#!/usr/bin/python # # symbolIdentifier.py # # Author: Derek Campbell # Date : 22/10/2014 # # Copyright 2014 <guzunty@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either v...
1f4b3ed8972cd0928ade464875e828a4afaa7275
693fce0c7289f953419107560ee2d8048d2ed40a
man4ish/MotifUtils
/lib/MotifUtils/Utils/parse.py
Python
py
3,084
permissive
import logging import os from pprint import pprint as pp from urllib import request, parse from .GibbsUtil import GibbsUtil as Gibbs from .HomerUtil import HomerUtils as Homer from .MemeUtil import MEMEUtil as MEME from .MFMDUtil import MFMDUtil as MFMD from installed_clients.DataFileUtilClient import DataFileUtil ...
dda6db347d075afff6a312bc71c1f9a6459cd530
60bcc4b44d257b9d669f191bf68efbe8f4c0e16a
MeRajat/zincbase
/logic/Negative.py
Python
py
508
permissive
"""Internal ZincBase class for negative training examples""" from utils.string_utils import split_on class Negative: def __init__(self, expr): sub_exprs = split_on(expr, '(', all=False) if len(sub_exprs) != 2: raise Exception('Syntax error') atoms = split_on(sub_exprs[1][:-1], ...
8ec1728ba9024a63536da03d45e2586f2d163829
9a1985ea79986363809ed09b103adbe9acdf92b5
BryanKoo/alpha
/cefr/make_frequency.py
Python
py
1,462
no_license
#-*- encoding: utf-8 -*- # calculate word frequencies for prepating sub-level for cefr 6 levels import sqlite3 import re import os, sys import pdb import random reload(sys) sys.setdefaultencoding('utf-8') def create_connection(db_file): try: conn = sqlite3.connect(db_file) return conn except sqlite3.Erro...
12ba9e0542c441d9948c2e41759044183ea7ad28
c1664d9ef5a3b0a398db24bbc8d27f67a5efd214
tingjianlau/my-leetcode
/83_remove_duplicates_from_sorted_list/83_remove_duplicates_from_sorted_list.py
Python
py
862
no_license
#!/usr/bin/env python # -*- coding: UTF-8 -*- ########################################################################## # > File Name: 83_remove_duplicates_from_sorted_list.py # > Author: Tingjian Lau # > Mail: tjliu@mail.ustc.edu.cn # > Created Time: 2016/05/16 #######################################################...
bf27766213ed6035fe56556a34be8e0cc0ef90cc
cfe6b8e2f0a4e401179349eb74bae85f5a337a49
lwc2016/supersummer_server_app
/app/models/option.py
Python
py
779
no_license
#encoding=utf-8 from app import db from datetime import datetime class Option(db.Model): '''问题选项数据模型''' __tablename__ = "options"; id = db.Column(db.Integer, primary_key = True) question_id = db.Column(db.Integer, nullable=False) content = db.Column(db.String(1000), nullable=False) label = db.Column(db.Enum("A",...
a8d7445c03737dcc2ac9434934972619003c336d
534444f3c5d7ac909ec60d5f0d21eeded08c89fd
indspug/deep_learning_zero
/05.back_propagation/train_mnist.py
Python
py
2,989
no_license
# -*- coding: utf-8 -*- import sys, os sys.path.append(os.pardir) from dataset.mnist import load_mnist from two_layer_net import TwoLayerNet import numpy as np import matplotlib.pylab as plt ################################################## # メイン ################################################## if __name__ == '__...
685fbc684ac5affe2e8fe1bd85c1e0f4b1137dd1
9d8b36fbf1081c3d9cc702811713eaffee0afad8
kailunww/Datasite
/history/migrations/0002_auto_20160504_1258.py
Python
py
1,217
no_license
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-05-04 04:58 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('history', '0001_initial'), ] operations = [ ...
c5546b47a66e368641fb76e01bf99f891342c27a
5cebebcbdc3b56eb27301e760417343184055641
OTL/jsk_robot
/jsk_pr2_robot/jsk_pr2_startup/jsk_pr2_move_base/fullbody_action_node.py
Python
py
3,869
no_license
#!/usr/bin/env python # -*- mode: python -*- import roslib; roslib.load_manifest('setup_fullbody_controller') import rospy import actionlib import math import thread from threading import Thread from geometry_msgs.msg import PointStamped, Point from trajectory_msgs.msg import * from pr2_controllers_msgs.msg import *...
515b355141b05852c6aa9f822a9161b688d1ea01
20b3f22cb22421b91a7be2dc1e39481dd28ba165
jochem725/deepracer-simapp
/bundle/deepracer_simulation_environment/lib/deepracer_simulation_environment/tournament_node.py
Python
py
20,969
permissive
#!/usr/bin/env python3 """script to download yaml param from S3 bucket to local directory and start tournament ROS launch Example: $ python tournament_node.py s3_region, s3_bucket, s3_prefix, s3_yaml_name """ from collections import deque import copy import json import logging import os import pickle import sys ...
e4549fcf7eda253dea7911056cb1bfe3c259a258
848b260ea5a0f551792e031f9a20ab1a553dd107
adityaramesh/ipc_circbuf
/scripts/test_circular_buffer.py
Python
py
21,188
no_license
import attr import asyncio import struct import fire import os, time import numpy as np from typing import Optional, List from posix_ipc import Semaphore, ExistentialError, unlink_semaphore, unlink_shared_memory from multiprocessing.shared_memory import SharedMemory @attr.s ...
8b8a8d1e77024309c865dfc977a6869c3108da29
81659c3fb2609d1d5076a3a1c9a09d04cf170983
bloodywing/blog-assets
/20120517-Github-Python-Projects/ghpp.py
Python
py
1,492
no_license
#!/usr/bin/python """ Random Python projects from GitHub. The first one is a popular one from the Top 100. The second one is from the rest. Gist: https://gist.github.com/2716997 Reddit: http://www.reddit.com/r/learnpython/comments/trb4j/if_you_are_looking_for_python_projects_to/ """ import random import urllib2 ...
2602e5d8eb45a2b4e049bfeb717f2240e3a64e53
916a15adc126923ae00c6bdd12ce19d1b8c34efb
APSL/deploy_talk
/examples/djangoapp/manage.py
Python
py
252
no_license
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoapp.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
36043a096d1759f5ec20bcc04f5315198d314c3c
3a374315c8b2145316389fc63b47af1328e2c4e2
icon-hackathons/201902-dapp-competition-bu
/team2/src/Without_Doubt_Project/venv/lib/python3.6/site-packages/tbears/util/keystore_manager.py
Python
py
2,143
no_license
# -*- coding: utf-8 -*- # Copyright 2018 ICON Foundation # # 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 o...
d4b359cc0ada734896fc33325697d0861c9309b5
0852a84013f6debfa01978b7a6e856b36c880f3c
Naurislv/P12.1-Semantic-Segmentation
/main.py
Python
py
16,241
no_license
"""Train and test FCN 8s model for road segmentation.""" # Standard imports import os import warnings from distutils.version import LooseVersion import logging import time import argparse # Local imports import helper import project_tests as tests import tensorflow_ops as tf_ops # Dependecy imports import tensorflow ...
f238f4feeeb06ba399322ae53cdf4323a2ed4b51
03317db5a11f618625a28abf4e5e15ae70675d5d
emi-si/pythonProject
/Assignment0 Task6.py
Python
py
1,294
no_license
class Car: def __init__(self, speed=0): self.speed = speed self.odometer = 0 self.time = 0 def say_state(self): print("I'm going {} kph!".format(self.speed)) def accelerate(self): self.speed += 6 def brake(self): if self.speed < 5: self.spe...
ba4ee985a4dfd166ff488a62e8725cf9e48054c0
ab03ebd8bd9ca28137b56e27cb77ae92903b2ab7
poeticcapybara/LisbonITN2014
/notebooks/Numbapro/python_cuda_matrix_mul.py
Python
py
1,255
no_license
from numbapro import cuda from numba import * import numpy as np import math from timeit import default_timer as time bpg = 50 tpb = 32 n = bpg * tpb @cuda.jit(argtypes=[f4[:,:], f4[:,:], f4[:,:]]) def cu_square_matrix_mul(A, B, C): tx = cuda.threadIdx.x ty = cuda.threadIdx.y bx = cuda.blockIdx.x by ...
1bc05d0ae15132701f34ed8821540a04aeedea63
b77b4948e77560b28ed3ff7401b69a83fb7aaa39
alephist/edabit-coding-challenges
/python/test/test_count_number_of_instances.py
Python
py
793
no_license
import unittest from typing import Tuple from count_number_of_instances import User test_values: Tuple[Tuple[User, int, str]] = ( ("johnsmith10", 1, "johnsmith10"), ("marysue1989", 2, "marysue1989"), ("milan_rodrick", 3, "milan_rodrick"), ("joshua_senoron", 4, "joshua_senoron"), ("LuckyLootCrate1...
4b84e61f6cf8335c879f2c8c6e2a3a41476d4454
f8bc22ae43b541230421d7a24444e90f6c8a5585
kishanrajasekhar/Othello
/game_runner.py
Python
py
1,756
no_license
#Kishan Rajasekhar, 57609613, Project 5, Lab Section 12 import tkinter import othello_game_logic2 import othello_board2 import othello_options class start_game: def __init__(self): '''Initialized the game board.''' self._window = tkinter.Tk() self._play_button = tkinter.Button(master = self...
834a6f9ba38165abdc8c9ae9de641bc760b778f2
f8fe378614a56044b9f186eabbfa47b91f9b9617
haleyKinoshita/House-Obstruction-Modeling
/server.py
Python
py
2,744
no_license
import requests, os from PIL import Image from io import BytesIO from flask import Flask, render_template, jsonify, send_file from tempfile import NamedTemporaryFile from shutil import copyfileobj import pymysql import matplotlib.pyplot as plt, mpld3 import numpy as np import pandas a...