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 |
|---|---|---|---|---|---|---|---|---|
de78a202297f125118092db42a0d6711ad7fb930 | 78a2eba694b294b1f3d086cf17a9a96706776fda | name-chichi/KDT-BigData | /01_python/day0888/itemvo.py | Python | py | 732 | no_license | # itemvo.py Model 역할을 하는 Class
class ItemVO:
def __init__(self,id,name,price,regdate):
self.__id = id;
self.__name = name;
self.__price = price;
self.__regdate = regdate;
def __str__(self):
return '%d, %s, %f, %s' % (self.__id,self.__name,self.__price,self.__regdate);
... |
543beb0695cf1f1086d84898577a721a8012f617 | 441e33354d35087974d4a70fc2ddd0dc6589f069 | thelunatic/rtems-tools | /rtemstoolkit/textbox.py | Python | py | 4,375 | no_license | #
# RTEMS Tools Project (http://www.rtems.org/)
# Copyright 2017 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condi... |
0704a9e36e0b065a6df277f8bb6fac049f0312ee | f1011ea03b8f3c549ac35cd20b351daf3159a546 | araquila/sinkorporated | /concept_design/strutwing/fuel_fraction.py | Python | py | 3,725 | no_license | # FUEL FRACTIONS
# Inputs are: LD_cruise_jet or LD_cruise_tbp and V_cruise_jet or V_loiter_tbp and jet or tbp = True
#test
# Import modules
import numpy as np
g = 9.80665
def fuel_fraction(eff_cruise_tbp = 0.85, eff_loiter_tbp = 0.77, LD_cruise_jet = 12, cp_cruise_tbp = 0.5, LD_cruise_tbp = 14, cj_cruise_jet = 0.6, c... |
92e0264246cb57eb5ce31199967fb5ef9497f1fb | eb8c8d712668e0814c0f25c162d7a73b329a4da4 | anoopkunchukuttan/indic_nlp_library | /indicnlp/cli/cliparser.py | Python | py | 9,102 | permissive | import argparse
import sys
from indicnlp import loader
from indicnlp.tokenize import indic_tokenize
from indicnlp.tokenize import indic_detokenize
from indicnlp.normalize import indic_normalize
from indicnlp.morph import unsupervised_morph
from indicnlp.tokenize import sentence_tokenize
from indicnlp.syllable import ... |
1a4d9dfd393552384adb2292edf796ffb707e3d7 | e39823d6b560dd8f5cc8e62d3a7559dd2822513f | shreshthaarnd/shreshtharnd | /manage.py | Python | py | 623 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'srd.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportErro... |
018f802feeb8114d908c7a3d46c52790e2f7c9f2 | 2490ad3323f271b7b5f83cc9bc3aa395a8bfcaf5 | SuperMMORPG/scrapy_project | /hot_info/dongchedi_info/dongchedi_info/middlewares.py | Python | py | 3,662 | no_license | # Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class DongchediInfoSpiderMiddlewa... |
20f04d6e51fa8dbedaa1aac56c9d5ea5d72e0d30 | 10e148e8c3ad944bcd724121dc89aa2893328566 | Python3pkg/FERMI | /fermi/src/intcore_py.py | Python | py | 8,350 | no_license |
import numpy as np
class Tsintegrator(object):
"""
Super class for the the integration via Tanh-Sinh quadrature.
"""
def __init__(self,N=20,hstep=3.15):
"""
:param N: Precision number, the number of functional evaluation is equal to
Nf=2N+1.
:param hstep:... |
ef56e507b87359b64c733479b4f185c070b84433 | 2a59e0dc7949cb6d3ec5d65d0c6c3be9f3efbd51 | TanFluent/fashionai | /research/deeplab/datasets/build_voc2012_data.py | Python | py | 4,864 | permissive | # Copyright 2018 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 applicab... |
4156bb613a9faf0dbf8fe568aa54f88f5952fdd4 | b119d0ac87060d1b5c1a46e94ec115d68415d4b6 | yinjiakang/MyComputerVision | /手写体识别/Mnist-Dataset/adaboost.py | Python | py | 1,317 | no_license | import sys
import scipy.io as sio
import numpy as np
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
if __name__ == '__main__':
np.set_printoptions(edgeitems=5)
trainingdata = sio.loadmat('mnist_dataset/mnist_train.mat')
traininglabeldata = sio.loadmat('mni... |
ee7738334efc57f88a4797c58c303efa980ef39a | 4084c116784e27defe6c7592e6ba2a1c8d5d248a | bylake/CcxMLOGE-0.2.3 | /ccxMLogE/ccx_Logistic/ModelTrain.py | Python | py | 4,456 | no_license | from sklearn.linear_model import LogisticRegression as LR
import pandas as pd
import numpy as np
import pickle,os
from ccxMLogE.ccx_Logistic.cut_bins import get_woe_class,get_woe_num
import statsmodels.api as sm
import warnings
warnings.filterwarnings("ignore")
def lr_fit(modelpath,x,y,k=0):
'''
:param x: trai... |
0335c894b220c61ada780f55bc088c6e40449c53 | cad47b6b62a3479efb1b8ae52742becc2813184d | neuxxm/leetcode | /problems/145/test.py | Python | py | 788 | no_license | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
#15:18fail
class Solution(object):
def postorderTraversal(self, root):
"""
:type root: TreeNode
:rtype: List[int]
... |
729b0c57243bda88fe645cfd904ed7623edd3c1a | 77b1ec0088aed355995b91c6f35b8772872cff19 | ls1intum/Athena | /athena/athena/models/model.py | Python | py | 576 | no_license | import importlib
from pydantic import BaseModel
class Model:
@classmethod
def get_schema_class(cls) -> BaseModel:
# The schema class has the same name as myself, but without the "DB" prefix.
# We can import it from athena.schemas
# and then use getattr to get the class from the module... |
77446bdf1ac1a196f7219dbe431280424b7d6c92 | 20cee45b56e66d92bc3fdc6df72deaf11c343630 | akshaim/Raspberry_Server | /light_sensor.py | Python | py | 921 | no_license | #!/usr/local/bin/python
#refer https://pimylifeup.com/wp-content/uploads/2016/01/Light-Sensor-Circuit.jpg for connection
import RPi.GPIO as GPIO
import time
__author__ = 'Gus (Adapted from Adafruit)'
__license__ = "GPL"
GPIO.setmode(GPIO.BOARD)
#define the pin that goes to the circuit
pin_to_circuit = 7... |
4fe8521e86f7ade6f3cf6f8e0e95a1c0369cf1c3 | 729e316e270aac43441dfaca9d4d9e6b63341b23 | theoad/pscgan | /train.py | Python | py | 484 | permissive | from runner import runner
import argparse
import utils.argparse_utils as argparse_utils
if __name__ == '__main__':
parent_parser = argparse.ArgumentParser(add_help=False)
parent_parser = argparse_utils.add_base_args(parent=parent_parser, test_flag=False)
parent_parser = argparse_utils.add_train_args(parent... |
bfa2acba23a3a8690ab477ce5a412256bdef494b | 6c6c278c085394270529f32f21e1318c1620f4fb | syedfarazhus/Uber-Backend-Simulation | /container.py | Python | py | 3,194 | no_license | """Containers of objects"""
class Container:
"""A container that holds objects.
This is an abstract class. Only child classes should be instantiated.
"""
def add(self, item: object) -> None:
"""Add <item> to this Container.
"""
raise NotImplementedError("Implemented in a su... |
de99fae0ab0f19220fbc12d8fb453706365c68dc | bfdaf073acfd7064bce0c0565b8a8cc45e5d38a2 | Javvadhi/currypoint | /manage.py | Python | py | 808 | no_license | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "currypoint.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that t... |
4637582c646ca2412023b66bb906963697aeac81 | 418979cbe8ac044ad5f4b3ae137425ef429ec08e | ayush220/COL_PRED | /accounts/forms.py | Python | py | 2,650 | no_license | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm,AuthenticationForm,UserChangeForm
class SignupForm(UserCreationForm):
email=forms.EmailField(required=True,widget=forms.EmailInput(attrs={'placeholder':'Enter Email'}))
class Meta:
model=Use... |
fcf53f5229412aac5d3d229ed419df5a208befae | 17da00bd369e77cddbf857f472ebe6f11a0f0511 | feitianyiren/geodjango | /django/db/backends/mysql/creation.py | Python | py | 1,365 | permissive | # This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict__ before being output.
# If a column type is set to None, it won't be included in the output.
DATA_TYPES = {
'AutoFi... |
5d5f109dbd886cd5a877dd7d09992ec51065189b | 9a8129d49683134264476fb3532752d5457160ca | Fathma/imdbclone | /watchlist_app/migrations/0001_initial.py | Python | py | 617 | no_license | # Generated by Django 3.2.4 on 2021-06-22 17:26
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Movie',
fields=[
('id', models.BigAutoField... |
e55f296f671cdd284b15935cb32cee798a8e5195 | 4884e26d455b19bb6c40ac2dcda926fce82cb828 | nehagup/benchmarks | /methods/mlpack/perceptron.py | Python | py | 7,273 | no_license | '''
@file perceptron.py
@author Anand Soni
Class to benchmark the mlpack Perceptron method.
'''
import os
import sys
import inspect
import numpy as np
# Import the util path, this method even works if the path contains symlinks to
# modules.
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(
os.p... |
59817d0ae857db6ff2073a7a04115d4cba485928 | e030f5fc9a20176773ad07858a36edcc76d1b262 | EdisonZhu33/Algorithm | /剑指offer/008-跳台阶.py | Python | py | 1,298 | no_license | """
@file : 008-跳台阶.py
@author : xiaolu
@time : 2019-07-31
"""
'''
题目:
一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。
解法类似fabnici数列
解析: https://blog.csdn.net/shawroad88/article/details/88383878
'''
def dp_solver(n):
# 迭代解法
temp = [0] * n # 建立一个长度为n的列表
if n == 1:
temp[0] = 1
r... |
5e2b7aa0647081259ae7945acb8c0603a1783186 | 41a29e657e161dcbc762f692490dbb638bf84f17 | amriikk/CS31-Python | /ICA/Car.py | Python | py | 432 | no_license | # Week 16 - ICA 1
class Car():
def __inti__(self,yr,mk,md):
self.year = yr
self.make = mk
self.model = md
self.speed = 0
def accelerate(self):
self.__speed += 10
def brake(self):
self.__speed -= 10
def how_fast(self):
return self.__speed
... |
29c94c86628b1d5751e6e72211e3b160c339ce61 | 90a6818b04fae4c80fcd27b45ed3cbbcbb79980c | victoriast0408/py | /donut-chart.py | Python | py | 328 | no_license | import pandas as pd
import plotly.graph_objects as go
df = pd.read_excel('abcjan2018bm.xlsx')
labels = df.umsatzgruppe
values = df.betrag
# Use `hole` to create a donut-like pie chart
fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.3)])
fig.show()
if __name__ == '__main__':
app.run_server(deb... |
15a3986bd2895e89af96817273c177c7451f473d | 71462c3c2c8bd09acf63eb9bb95c323ad57a242c | Srigadgeter/Basics | /exception.py | Python | py | 382 | no_license | # >>>>> Exceptions <<<<<
try:
age = int(input('Age: '))
if age > 0:
income = 10000
risk = income / age
print(f'Your risk according to your age is {risk}')
else:
print('You should not provide the negative value for age')
except ValueError:
print('Invalid value')
except Zer... |
f9c72f4328f4c74fddabb2ae0b6f0a65b4e03020 | 2a31a3cece86c217f23007d317f79c7b00f0c5e9 | adzest/py4qa | /fixture/contact.py | Python | py | 6,891 | no_license | import re
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from model.contact import Contact
class ContactHelper:
contact_cache = None
def __init__(self, a... |
973e729e63ed2fd7f4db29160a130d2dbf0effed | f90e1f213bc1b4abd72be5f7da7313a8c6616ccf | Johnny618122/csc148 | /labs/lab2/quiz.py | Python | py | 618 | no_license | from typing import List, Dict
class Tournament:
teams: List[str]
team_stats: Dict[str, List[int]]
def __init__(self, teams: List[str])->None:
self.team_stats = {}
self.teams = []
for team_name in teams:
self.teams.append(team_name)
self.team_stats[team_nam... |
0fee42e7433782d0d015a64c89bbc3f4a11e697f | 390a239490a8d21b5665610b71f459dc870ebdda | PaeP3nguin/home-automation | /read_adc.py | Python | py | 812 | no_license | # Simple example of reading the MCP3008 analog input channels and printing
# them all out.
# Author: Tony DiCola
# License: Public Domain
import time
# Import SPI library (for hardware SPI) and MCP3008 library.
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008
# Software SPI configuration:
#CLK = 18
#MISO = 2... |
474d431fb21ebad5a535a0a98e5da7b89c369053 | 7a2959cea4d1799b8352621108f11b7fcbe885d8 | wojtasfi/sentiment_analysis | /sentiments/migrations/0007_auto_20190112_1857.py | Python | py | 981 | no_license | # Generated by Django 2.1.5 on 2019-01-12 18:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sentiments', '0006_analysis_std'),
]
operations = [
migrations.AlterField(
model_name='analysis',
name='best',
... |
ece3adeb13317fa0c673cb4d6b22133a44a41f93 | b630a3062dec984699ba6a6421bdb251f8b3bf60 | janetlauyeung/allennlp | /allennlp/training/callbacks/checkpoint.py | Python | py | 7,373 | permissive | from typing import List, Optional, TYPE_CHECKING
import traceback
import time
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import Params
from allennlp.training import util as training_util
from allennlp.training.checkpointer import Checkpointer
from allennlp.training.callbacks.call... |
9b8a071319b8ce2ff62b6281b4ce502c846c65df | 4a1530bb92f4322d9454554b2be3b578a57be4aa | AriannaLanz/GalSim | /galsim/shapelet.py | Python | py | 10,783 | permissive | # Copyright (c) 2012-2016 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... |
ebab299e1d2cc6326669a137188ed40bfb179da0 | 1dabb51fddb307e2c14589efafef2cf1bdd18dc9 | Ry-C123/Freefall | /freefall/speedyboi.py | Python | py | 1,162 | permissive | import time
import os
import math
import fcntl
def RUN(ID,x,y,z,vx,vy,vz, m_p,r_p, K,runname, restart, PLOT_ON, OUTPUT_int, write_files,dt, M, R, B, TEMP,omega,inc, func, ACC_RAD, EJE_RAD):
i = 0
NOT_GONE = True
while i < OUTPUT_int:
T = ((K*OUTPUT_int)+i+1+restart)*dt*3.17098e-8 #Get actual times... |
4d6f5ab5b2301fe403ac5300118a7cab175c969b | e94fa39d49eb5837d6fa0017b5924b622b9c2c25 | kexiaojiu/python_based_programming | /chapter_12/exercise_12_1.py | Python | py | 402 | no_license | #!/usr/bin/env python3
import sys
import pygame
def run_game():
pygame.init()
screen = pygame.display.set_mode((1200,800))
pygame.display.set_caption("Test")
while True:
for event in pygame.event.get():
if event == pygame.QUIT:
sys.exit()
... |
01d7f4e70db30d69cfd9dbdd98edc1ab8eadcf78 | 3afa3d8a8d3cf7e104578f678f3778aefb007215 | kurtzeborn/azure-sdk-for-python | /sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py | Python | py | 17,652 | permissive | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
dc442383f8bb3f55a6d92f8a00a80c62d44072e8 | 716d469c9ccbea5bdac3ae5206264043b76adf67 | Wzyblur/ansible_test | /gunicorn_conf.py | Python | py | 6,811 | no_license | #coding=utf8
# http://docs.gunicorn.org/en/latest/settings.html
import multiprocessing
# 监听端口
bind = '0.0.0.0:10000'
# 工作进程数 即gunicorn进程的数量(1) 另外有一个master进程 杀死gunicorn进程只需要杀死master进程即可 pid记录的也是master进程
workers = multiprocessing.cpu_count() * 2 + 1 # 工作进程9 master进程1
# 连接(等待被处理)数量上限(2048)
backlog = 1024
# 工作模式(... |
0d98a2a1d72c076d708d33577345116b4e3da8cf | d54644a43b36376ca64e5190fd1b252ebdfacc4f | dehu4ka/lna | /lna/contrib/sites/migrations/0003_set_site_domain_and_name.py | Python | py | 1,071 | permissive | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... |
b802dd76ea807e9843c3a06521f8a679d31b23e6 | bc0eeec6cfedaa70f6b41d212e1835568df6cea9 | gladiray/vergersdupuit | /homepage/translation.py | Python | py | 378 | no_license | from modeltranslation.translator import register, TranslationOptions
from homepage.models import HomePage, HomePageSection
@register(HomePageSection)
class HomePageSectionTranslationOptions(TranslationOptions):
fields = ('text', 'alt_photo1', 'alt_photo2')
"""
@register(StartPage)
class StartPageTranslationOpti... |
d3f53fa213d3819793154b0144a14bfac7fb3646 | 90fc651c896c16599f0b5f81c3b90a230252904a | Sebastian-Soto-M/pyno | /pyno/parsers/database.py | Python | py | 669 | permissive | from typing import NewType, Union
from requests import Response
from ..models import DatabaseModel
from . import ResponseListModel
DatabaseListModel = NewType(
'DatabaseListModel', ResponseListModel[DatabaseModel])
def parse_database(response: Response) -> DatabaseModel:
if response.ok:
return Data... |
094fae9aa08de9f06245113ca67142e90869f425 | 4935d79c4fe9086d80c26b39a74db82544b5c96c | wkgud9090/carla | /PythonAPI/examples/manual_control_carsim.py | Python | py | 52,167 | permissive | #!/usr/bin/env python
# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Allows controlling a vehicle with a keyboard. For a simpler and more
# docu... |
638da44b1f4c7f700395b662aa66ceda14366867 | 8a82f40c382929e9d8ef9fc10643fcddfce6a1df | ganeshrn/network_collections_migration | /collections/ansible_collections/cisco/nxos/plugins/module_utils/network/nxos/config/interfaces/interfaces.py | Python | py | 10,169 | no_license | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The nxos_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary t... |
6f472535d827708a355eda5a3de4524e0caebf69 | 8c57b0f3192d8f315e1fb2a859a00564e94d0a3b | clokep/YHandler | /YHandler/resources/base.py | Python | py | 2,814 | no_license | class YahooApiData(object):
"""Provides the results of an API request as properties on an object."""
def __init__(self, api_dict):
self._api_dict = api_dict
def __getattr__(self, attribute):
"""Proxy access to stored attributes."""
if attribute not in self._api_dict:
rai... |
c76aca6699c9219215ec2afbaf02b412e32b8fd0 | 4f82bd68e2fa44b5e997da10817f06b566556003 | dudulydesign/python_2018_WG | /git_backup/attendance_sys20180529/medusa_site/attendance/models.py | Python | py | 586 | no_license | from django.db import models
from django.contrib.auth.models import User
class OvertimeEntry(models.Model):
user = models.ForeignKey(User)
status = models.IntegerField()
start_time = models.DateTimeField()
end_time = models.DateTimeField()
reason = models.TextField()
pub_date = models.DateTimeField()
da... |
ec7d4c15e21cf662bf27916bca65bfd8e8ecf889 | caccbd65e2b22c0607bd9b30fba1bdaf4673b26b | teinei/pyweb | /zProject/baa.py | Python | py | 1,475 | no_license | class RiseClass(Base):
__tablename__ = 'rise_class'
id=Column(Integer,primary_key=True)
class_stage=Column(String(80))
class_name=Column(Integer,nullable=False)
main_teacher=Column(String(80)) #main_teacher
teaching_assistant=Column(String(80)) #TA
start_date=Column(DateTime)
open1=Colum... |
82a63ec4761a0d604998ca0b81175d2a7cf81979 | aef6ff971c09b57509aca0ae3c02d10a11df75e8 | fjanuska/python-ovirt-engine-sdk4 | /examples/reduce_disk.py | Python | py | 2,278 | permissive | #!/usr/bin/env python
#
# Copyright (c) 2020 Red Hat, Inc.
#
# 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 l... |
7207fb07400bf8ff48b85e4ca41b4a3807094f97 | b55ecb479ece272c73b4e8eb4cf99a8e0dee7de7 | kitague/policyuniverse | /policyuniverse/tests/test_statement.py | Python | py | 17,766 | permissive | # Copyright 2017 Netflix, Inc.
#
# 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... |
9d1ec2886bd68c5c90d1a1b9f0e5e1c799005a31 | d97f47471b99a49816c9e4116558f8254aaab952 | nanjigirl/bs-server-project | /.history/bsServer/views_20200503163738.py | Python | py | 321 | no_license | import json
from django.http import HttpResponse,JsonResponse
from .models import *
# Create your views here.
def index(request):
if request.method == "GET":
try {
booklist = BookInfo.objects.all()
}
return JsonResponse({"status": "200", "list": booklist, "msg": "query articles sucess."})... |
c5625e8895c5a69f7226abf3d2d524e28a473281 | 7fba107300191e62367df4094165c534918e508f | tabithableil/library | /sort/merge_sort.py | Python | py | 952 | no_license | def merge_sort(lst):
""" merge sort: break up the list into sublists with only one element, then merge them back together in sorted
order. the merge step works by comparing sublists and appending the smallest element in either list to result
best/average/worst-case behavior: O(nlogn)
spac... |
06e1b6de317129cb5f039a0b02a84a9f7b3e2d4a | 8a6f0a8f0eb29ae0ba340702274c40b57e19d4b8 | franroldans/real_robot_challenge | /setup.py | Python | py | 1,819 | permissive | import os
import setuptools
PACKAGE_NAME = "rrc_example_package"
setuptools.setup(
name=PACKAGE_NAME,
version="2.0.0",
# Packages to export
packages=setuptools.find_packages(),
data_files=[
# Install "marker" file in package index
(
"share/ament_index/resource_index/pac... |
9ab0c7d9df9ad6d6b1ee6a25e0f164e717ee76b8 | 80304d2eedaa4678f005b4cd48fcbfa579da0950 | geekgirl681/Twitter_sentiment_analysis | /twitter_sentiment_analysis.py | Python | py | 2,561 | no_license | import nltk
#nltk.download()
from twython import Twython
def bagOfWords(tweets):
wordsList = []
for (words, sentiment) in tweets:
wordsList.extend(words)
return wordsList
def wordFeatures(wordList):
wordList = nltk.FreqDist(wordList)
wordFeatures = wordList.keys()
return wordFeatures
d... |
da24e67d88eb45d7e2ce1c04b69c740454ac64e7 | eac9de7c6bd99e2c2416067657e57f73b282379d | zanaca/docker-dns | /src/OSes/macos.py | Python | py | 3,086 | permissive | import os
import shutil
import time
import sys
import config
import dockerapi as docker
import util
FLAVOR = 'macos'
PLIST_PATH = '/Library/LaunchDaemons/com.zanaca.dockerdns-tunnel.plist'
KNOWN_HOSTS_FILE = f'{config.HOME_ROOT}/.ssh/known_hosts'
APP_DESTINATION = f'{config.HOME}/Applications/dockerdns-tunnel.app'
DO... |
5d93aa9202e09d7c0fd96554d9f42aa489bd9f5b | 0a4f6ab7569c5d1231b8f4205825415cd2207148 | jvaque/NetNinjaDjangoTutorial | /djangonautic/articles/migrations/0003_article_author.py | Python | py | 611 | no_license | # Generated by Django 3.0.8 on 2020-08-16 20:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('articles', '0002_article... |
80781d8b4f23ed68015cb508e3c3621c2b6dc7b2 | a89eb518bd0b6fdfc5cabae7f6e5a5977f95f7ce | smvenkat1/smvenkatmlops-master | /ml_service/util/smoke_test_scoring_service.py | Python | py | 3,062 | permissive | import argparse
import requests
import time
from azureml.core import Workspace
from azureml.core.webservice import AksWebservice, AciWebservice
from ml_service.util.env_variables import Env
import secrets
import json
import numpy
#input = {"data": { # NOQA: E265
# 'id': [0, 1, 2, 3, 4],
# 'target': [0, 0... |
a2996a58ca3af1328c7235ef1121fe13d2027e10 | b426fc490fcfcd7377370c5bdca633b737721798 | rknguyen/lqd-face-detection | /pcn/utils.py | Python | py | 1,929 | no_license | "code originally in PCN.h"
import numpy as np
import cv2
class Window:
def __init__(self, x, y, width, angle, score):
self.x = x
self.y = y
self.width = width
self.angle = angle
self.score = score
def rotate_point(x, y, centerX, centerY, angle):
x -= centerX
y -= ... |
dd3c3ed11819aec1baae636fcc97555246be733f | 97ed55a52038c7f0318d27a1e07924620da255c3 | HakkiAkut/python-learning | /day5/properties.py | Python | py | 968 | no_license | class Product:
def __init__(self,name,price):
self.name = name
if price >=0:
self._price = price
else:
raise ValueError("price can't be negative")
def __str__(self):
return f"{self.name} {self._price}"
def __repr__(self):
return f"{self.na... |
f749e7de8ed7d06cf7ae11e2817b17d8148dfb0a | 82256f6bdd023b453f8f3427dc59531a5a47ab3c | GSCrawley/refactoring | /16_replace_nested_conditional_with_guard_clauses2.py | Python | py | 338 | no_license | # Replace nested conditional with gaurd clases.
ADJ_FACTOR = 0.7
def get_adjusted_capital(capital, rate, duration, income):
result = 0
if (capital > 0 and rate > 0 and duration > 0):
return income / duration * ADJ_FACTOR
return result
adjusted_capital = get_adjusted_capital(50000, 4,10, 10000)
print(... |
6b67539586a80478221d5f8fb78263f870949162 | 618dd6e8e703d265ab128a8dba5fdbdfa6b95cee | tumb1er/django-admin-smoke | /testproject/testapp/migrations/0002_project_created.py | Python | py | 483 | permissive | # Generated by Django 3.0.4 on 2020-04-13 13:16
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('testapp', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='project',
... |
5092b2e026e529436882a87f66ad0d53e56cbe03 | f71abf5e691251b7cd57938ad248c69e42d48cd4 | xiaolcqbug/aiai | /River/s20190903月考/s1.py | Python | py | 461 | no_license | from multiprocessing import Process
# def shushu(a,b):
# for i in range(a,b):
# print(i)
# if __name__=='__main__':
# p1=Process(target=shushu,args=(1,10))
# p1.start()
class Myprocess(Process):
def __init__(self,a,b):
super(Myprocess, self).__init__()
self.a=a
self.b=b... |
53f8d4a88a80e18a443becfb8fefaf92311adc06 | 44ef581a9c7e22ccf98c11d33f02873d546d1b66 | msaad1311/Data-Imputation-using-DL | /reader.py | Python | py | 2,263 | no_license | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from pandas import DataFrame
def read_data(name, missing_flag):
data = pd.read_excel(name).iloc[:,1 :6]
columns_n... |
ef982033a3d32eff1846755e48e5d71ef9b64d29 | d5da629442b9c3e19115c1bf4d0575e039b7fa8f | Madhu-balaji-01/beaconrunner | /notebooks/beaconRL/beaconRL1/specs.py | Python | py | 43,108 | permissive | from constants import *
from typing import Set, Optional, Sequence, Tuple
from ssz_impl import (hash_tree_root, signing_root)
from ssz_typing import (Container, boolean, Bytes4, Bytes8, Bytes32, Bytes48, Bytes96, Vector, Bitlist, Bitvector, List, uint64)
from hash_function import hash
from spec_typing import *
import s... |
76125da3390855161d7c8f5e7a1d5b91e0758da9 | 65fdc5ef33e46e5980ed1033d19431a879b23255 | gabriellaec/desoft-analise-exercicios | /backup/user_393/ch117_2020_10_07_00_22_42_329880.py | Python | py | 273 | no_license | import math
def snell_descartes(n1,n2,teta1):
y= math.degrees(math.asin((n1*math.sin(math.radians(teta1))/n2)))
return y
7
import math
def snell_descartes(n1,n2,teta1):
y= math.degrees(math.asin((n1*math.sin(math.radians(teta1)))/n2)
return y
|
d358e4111079e04e576ffcdd33adeff6baf1020d | 4bb052ed92845cf33caf81df91572950c5341c20 | rushioda/PIXELVALID_athena | /athena/Generators/MadGraphModels/python/models/darkHiggs/coupling_orders.py | Python | py | 444 | no_license | # This file was automatically created by FeynRules 2.0.25
# Mathematica version: 9.0 for Mac OS X x86 (64-bit) (January 24, 2013)
# Date: Tue 19 Aug 2014 17:54:53
from object_library import all_orders, CouplingOrder
QCD = CouplingOrder(name = 'QCD',
expansion_order = 99,
hier... |
c5676027ea23b73a5524e0f0f5acddf57f472743 | 93dbf94aa43b176c88020f84a7a8bad59ec1a3bf | yutotakamatsu/Tensorflow-seminar | /ch2/digits/show-digits.py | Python | py | 255 | no_license | import matplotlib.pyplot as plt
from sklearn import datasets
digits = datasets.load_digits()
for i in range(15):
plt.subplot(3,5,i+1)
plt.axis('off')
plt.title(str(digits.target[i]))
plt.imshow(digits.images[i], cmap='gray')
plt.show()
|
5b071171e48b30b2803daa15cec53083647e1220 | 5ed6c17b26d43b1799f7911142c55d47c31f9e61 | DiAifU/robot_decapsuleur_ws | /src/darknet_detector/scripts/find_object.py | Python | py | 874 | no_license | #!/usr/bin/env python
import rospy
from darknet_detector.srv import ObjectInfo
from sensor_msgs.msg import Image
import os
import sys
darknet_path = os.path.dirname(os.path.realpath(__file__)).replace('scripts', 'darknet_files')
os.chdir(darknet_path)
sys.path.insert(0, darknet_path)
import darknet
from cv_bridge impo... |
9249009d3f91f312c18f565254509f8a41d86490 | 2f1fa6ced269f422ddd3d68b122cbbc92e0dc89a | BhaveshKapre19/seakschooldj | /SchoolAdmin/signal.py | Python | py | 2,160 | no_license | from django.db.models.signals import post_save,pre_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import SchoolAdminUser,Notice,NonTeachingStaff
from School.models import TeachingStaff
from django.utils.text import slugify
from datetime import datetime
import string
... |
1b0ca1d1371ac72f9726b989e11e12247d3513ac | 00424138fd0c313d78376b9033726ebb0fbb536b | vis7/salesdata | /sales/migrations/0001_initial.py | Python | py | 494 | no_license | # Generated by Django 2.2.7 on 2020-10-14 08:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='UploadFile',
fields=[
('id', models.AutoFie... |
5bd7739ca2022ad8c3a566129fd25e1973241838 | 4bb2a3d7393b501818f705b7a454ec762b048f8c | DeveloperRyan/Hermes | /image-ordering.py | Python | py | 527 | no_license | import os
search_path = "C:/Users/Ryan/Desktop/lfw/"
output_path = "C:/Users/Ryan/Desktop/lfw/"
img_num = 0
for root, dirs, files in os.walk(search_path, topdown=False): # Walk through all directories found within the search path
for file in files: # Loop all files found
if '.jpg' in file.lower() or '.jpe... |
05fdd71aa4ff6bd63585e9bab780a81bd6604b21 | 66e0915ea5bd2c928df64b56630133e450dd2246 | yakumo1255/jet_py | /tarkov/profile/service.py | Python | py | 2,532 | permissive | from __future__ import annotations
from pathlib import Path
from typing import Final, TYPE_CHECKING
import ujson
from server import db_dir, root_dir
from tarkov.profile.models import ProfileModel
if TYPE_CHECKING:
# pylint: disable=cyclic-import
from tarkov.launcher.accounts import AccountService
from t... |
d6a72718a5ad7779aa0110639ba9d76e1f396cab | 3a8fa4b98af1f3d949321edb4ae81fce72fa5f19 | pawangeek/Python-codes | /leetcode/30_days/25th.py | Python | py | 302 | no_license | # @Date: 2020-04-26T23:44:16+05:30
# @Last modified time: 2020-04-26T23:53:09+05:30
# https://leetcode.com/problems/jump-game/
nums = [2,3,1,1,4]
m = 0
for i, n in enumerate(nums):
if i>m:
print(False)
# Cover till (i+n) and put to m
else:
m = max(m,i+n)
print(True)
|
8d2f4acbcbde9aefed267cd198efeea02eaff546 | 5daa2017317f3cb64c3d0cb0498a569210bd4624 | Radbull123/cs50 | /project1/newbe_flask.py | Python | py | 1,820 | no_license | import os
import datetime
from werkzeug.middleware.proxy_fix import ProxyFix
from flask_caching import Cache
from flask import Flask, session, render_template, request, redirect, url_for, flash
from flask_session import Session
app = Flask(__name__)
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"]... |
f6556e5f4de2c1bf546f8516ecb5955acd0a9458 | 3f66b1ebd22cc74c6bc3a3fb521f6dee66bfc716 | yzhao66/python-learn | /list.py | Python | py | 204 | permissive | list = [ 'abcd',786,2.23,'john',70.2]
tinylist=[123,'john']
print (list)
print (list[0])
print (list[1:3])
print (list[2:])
print (tinylist * 2)
print (list+tinylist)
print ("len of list is",len(list))
|
5effe9c4eb82e806669359cd2b2e9dcbd2524a91 | 507f7cf4f26590680113020eb784fb834b6f36ab | haaagi/TIL | /06_DJANGO_ADVANCE/06_OCT_EXAM/oct_exam/settings.py | Python | py | 3,173 | no_license | """
Django settings for oct_exam project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... |
86eb540ddbb2a0a60b165a23f3650935ed4ed5d6 | e0fff69424bf1c42fefa6abf31e763d61ed9ade4 | sachinprabhu007/HackerRank-Solutions | /Python/Alphabet Rangoli/alphabet_rangoli.py | Python | py | 1,870 | permissive | from __future__ import print_function
def print_rangoli(size):
# The whole alphabet.
alpha = "abcdefghijklmnopqrstuvwxyz"
# The subset on which we are operating.
subset = alpha[:size]
# The base string, will be something like "e-d-c-b-a"
# It will go in the middle, every row w... |
209fa72cf36379802d73bbb69d0d806689367f5c | d42addd43ad5bebc9224991ec35bed4aa46812c9 | kaosbeat/roboarch | /pytest/p10.py | Python | py | 988 | no_license | from morse.builder import *
# adds a default robot (the MORSE mascott!)
robot = ATRV()
pose = Pose()
pose.add_interface('socket')
robot.append(pose)
motion = Waypoint()
motion.add_interface('socket')
robot.append(motion)
# # creates a new instance of the actuator
# pa10 = PA10()
# pa10.add_interface('socket')
# rob... |
28e14c40ddc1eb8d012971e08902cc5f5d26f9c2 | 6433a61c09430ed02ee8f6c7160c8f73d92de427 | hitochan777/kata | /atcoder/mayokon/20230111/C.py | Python | py | 736 | no_license | import sys
from collections import defaultdict
sys.setrecursionlimit(10**6)
N, M = (int(x) for x in input().split())
g = defaultdict(list)
for _ in range(M):
A, B = (int(x)-1 for x in input().split())
g[A].append(B)
g[B].append(A)
if any(len(v) > 2 for v in g.values()):
print("No")
exit()
def _has_loop(no... |
8a3423ba136dcf0ed9cdcf944d28efa5f5675114 | 6ba5b7b8057cdfb6dbbbcf0b18480fa8b5c06f48 | luckylyk/ncachefactory | /ncachefactory/optionvars.py | Python | py | 3,591 | permissive | """
This module contains all preferences saved available for the ncachefactory app
"""
import os
from maya import cmds
# Ensure compatibility Py2 and Py3
try:
import ConfigParser
except BaseException:
import configparser as ConfigParser
_current_dir = os.path.dirname(os.path.realpath(__file__))
CONFIGFILE_PAT... |
04fe9a50b8ad18665ba80127ca38dcdeb93904b9 | 89a06ed7be02e8944fef8413b1d7ee8ed8608d88 | jun2018cn/covid-19-norway | /live.py | Python | py | 7,590 | no_license | import os
import json
import time
import pickle
import urllib3
import traceback
from covid import get_current_data, LOCALE_MAPPING
from datetime import datetime
from pprint import pprint
SLACK_WEBHOOK_URL = os.getenv("SLACK_WEBHOOK_URL", None)
if SLACK_WEBHOOK_URL is None:
print("ERROR: Set SLACK_WEBHOOK_URL env ... |
b62be7ebd7cbee2ff9c13f748991a4f41ab932b0 | 3cf0d498acb93e91309980942d0ee4e4d5f51448 | nanxijw/Clara-Pretty-One-Dick | /trinutils/sceneutils.py | Python | py | 3,256 | no_license | #Embedded file name: trinutils\sceneutils.py
import blue
import trinity
try:
import jessica
except ImportError:
jessica = None
def FindScene(useDeviceSceneIfFound = True, types = None):
"""Returns a scene fitting the given criteria, or None if none found.
If ``types`` is none default
to ``(tri... |
9aeb590348477a34b6efb55c097f3343849ca9df | 3e0a92cbac404b8709075e1f07c3453fa53d82da | DSmedley1989/little-projects | /Conflictr/Conflictr.py | Python | py | 2,764 | no_license | import sublime, sublime_plugin
class ConflictrCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.starts = self.view.find_all('<{5,}')
self.middles = self.view.find_all('={5,}')
self.ends = self.view.find_all('>{5,}')
self.number_of_conflicts = len(self.starts)
self.create_conflict_areas()
self... |
2e9adda9e445b31c37c6d9ba0ad7deab442a0fa1 | 2467d8588ac39c05063ed9e4dc69c04bb283d775 | JonAWhite/choir_tracker | /song_extractor/bin/classes/email_retriever.py | Python | py | 4,489 | no_license | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
if sys.version_info[0] < 3:
import codecs
_open_func_bak = open # Make a back up, just in case
open = codecs.open
import httplib2
import json
import oauth2client
import os
from apiclient import discovery
from oauth2client import cli... |
eaeced6c5dcde3cb0cb5ed98937defee4b26d026 | 70f864b7ed4ee4390d71bef8e8b1043496e72ce4 | ashishbaghudana/san_mrc | /train.py | Python | py | 6,504 | permissive | import json
import os
from datetime import datetime
from shutil import copyfile
from config import set_args
from my_utils.data_utils import predict_squad, gen_name, gen_gold_name, load_squad_v2_label, compute_acc
from my_utils.log_wrapper import create_logger
from my_utils.squad_eval import evaluate
from my_utils.squa... |
93571d8624c918b5c3bc3f29cfe4c4a5db2d1b00 | 761490e75ece46c0f1e80c1b191aa590038d6197 | jwyles/cugraph | /python/cugraph/dask/traversal/bfs.py | Python | py | 3,788 | permissive | # Copyright (c) 2019-2020, NVIDIA 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 agre... |
61470a2a6c875b5e8cafa835c638d16450d663d3 | b2f6808b2cdf8d9fdec832eb92447d13296adc42 | mesosphere/dcos-perf-test-driver | /tests/unit/mocks/httpserver.py | Python | py | 3,802 | permissive | import socket
import sys
import threading
import time
import signal
import random
class MockHTTPServer:
"""
A mock HTTP server that always responds with HTTP/200 OK, but also counts
the total and maximum number of connections that were established.
"""
def __init__(self, backlogSize=1000, port=0, fakeLatten... |
8887fc439e0e9c63bef67ae080acc2b8bc38a34c | 8a105722b10edbee7e096e3b2ab947987fd3ec26 | loni-mitch/Photogram | /app/.~c9_invoke_z19FTv.py | Python | py | 12,662 | no_license | """
Flask Documentation: http://flask.pocoo.org/docs/
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
This file creates your application.
"""
import os
from app import app,db,filefolder,token_key
from flask import render_template, r... |
3282194efff491121e3bc5a32faf7193c76de149 | 585eb911763a9ca712aed1e49120a2d17428f559 | jielulovesdessert/jielulovesdessert.github.io | /Gutenberg-LSTM/python/Preprocessing.py | Python | py | 1,289 | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 23 00:42:58 2018
@author: Jie Lu
"""
#download data with nltk gutenberg
import nltk
import numpy as np
nltk.download('gutenberg')
nltk.download('punkt')
from nltk.corpus import gutenberg
book1 = gutenberg.sents('milton-paradise.txt')[:1000]
book2 = gutenberg.sents('shak... |
58d52d9ab9e74bd8228017319647c217464a62fa | f307fc7cda48b4eddbf551d386651aa27ba7d756 | elham-khazaie/cmssw | /Configuration/Geometry/python/dict2026Geometry.py | Python | py | 63,808 | permissive | maxSections = 5
commonDict = {
"abbrev" : "O",
"name" : "common",
"default" : 4,
"O4" : {
1 : [
'Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v2/cmsextent.xml',
'Geome... |
bc195dd8968a642db4083f61b3471ea48106ba7f | 696fe80689bf9b17b609f33deb3ec2bdac1bcc4f | talkedu/bank_challenge | /app.py | Python | py | 1,782 | permissive | from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
import sys
import json
def download_from_folder(drive, folder_id):
file_list = drive.ListFile({'q': "'%s' in parents and trashed=false" % folder_id}).GetList()
file_map = {}
for file1 in file_list:
file_map[file1['title']] =... |
b33e9f94ca1b4d9969a0c3bc8bc7d74e0967aea2 | 34d69f9fc406699196a7399f0e3feb9eea0c96d6 | tellapaneni/personal | /matplotlib_stock.py | Python | py | 3,886 | no_license | import matplotlib.pyplot as plt
import csv
import numpy as np
import urllib.request
import matplotlib.dates as mdates
# x =[1,2,3,4,5]
# y =[1,4,6,8,10]
# xy=[[1,2,3,4,5],
# [2,3,4,5,6],
# [4,5,6,7,8],
# [10,11,12,13,14]]
# plt.plot(x,y)
# plt.scatter(x,y,edgecolors="green")
#
# slices = [... |
d703609bf90a9d0a68d06f2ec353e39b2f54b751 | 6b331b07da4c601d0c514355403964f88eeec0a6 | rentalita/django-layout | /django-layout/src/python/ovid/default/views.py | Python | py | 234 | permissive | # -*- coding: utf-8 -*-
from django.template.response import TemplateResponse
def index(request):
return TemplateResponse(request, 'default/index.html')
# Local Variables:
# indent-tabs-mode: nil
# End:
# vim: ai et sw=4 ts=4
|
8bed174c1ae06849bf5f2fd54e7c311cfbc0d7a3 | f096efa25b51f6c3d611d0da1eae41a836801d09 | AdamZhouSE/pythonHomework | /Code/CodeRecords/2249/60627/300922.py | Python | py | 201 | no_license | try:
s = input()+input()+input()
except:
print(10)
if s== '21,00,2':
print(16)
elif s== '21,23,4':
print(17)
elif s== '31,1,11,0,1':
print(14)
elif s== '32,2,22,1,2':
print(46)
|
cc0204bae3abe731d2072da60565394711f51d37 | d49327741fc43ba3b04e03d9216c9215512e601f | jacobaustin123/pytorch-alphazero | /setup.py | Python | py | 358 | no_license | from setuptools import setup, find_packages
setup(
name="alphazero",
author='Jacob Austin',
author_email='jacob.austin@columbia.edu',
packages=find_packages(),
description='A PyTorch implementation of the 2017 Nature AlphaZero paper from Google DeepMind',
install_requires=[
"pytest",
... |
9f97b15f2c3bf238f1a099ec340cc5118b48e358 | 3a3f1510bbdac1c585596e7191c59713d26cc157 | gotha331/python-learning | /04-字典/04-序列解包.py | Python | py | 715 | no_license | x, y, z = (20, 30, 10)
print(x, end='\t')
print(y, end="\t")
print(z, end="\t")
print()
(a, b, c) = (10, 11, 12)
print(a, end="\t")
print(b, end="\t")
print(c, end="\t")
print()
[d, e, f] = [66, 88, 99]
print(d, end="\t")
print(e, end="\t")
print(f, end="\t")
print()
s = {'name': 'shuai', 'age': 18, 'job': 'CEO'}
a,... |
58f47152333bfef217bc17fa4a9f63b002b4d93f | 810348bf02e6add25a09e6ec7542798260147767 | RichardWLaub/pulumi-kubernetes | /sdk/python/pulumi_kubernetes/rbac/v1/Role.py | Python | py | 4,672 | permissive | # *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
from typing import Optional
import pulumi
import pulumi.runtime
from pulumi import Input, ResourceOptions
from ... import tables, version
... |
02c56f16c07574b6629e335cdcb9e7bdaf71b4f4 | b33577b172787c31e6ea8b58a31420e78585d546 | eugen-vusak/zavrsni-rad | /RecognitionApp/main.py | Python | py | 6,001 | no_license | import sys
from PyQt5 import QtCore, QtWidgets
from collections import deque
import numpy as np
from Serial import Serial
import Neural_Networks as nn
import Data.gestures as gestures
np.set_printoptions(suppress=True)
GESTURE_SIZE = 360
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
Main... |
2c0d7e8d5fb9da8e9bc20b41b6414f6bdb8cdc6d | 506f2f258fcaace76fad483ab67d3aa8bbd27c55 | tanli1/hillstone_python | /16-excel/16-excel.py | Python | py | 2,735 | no_license | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2016-2019 Hillstone Networks, Inc.
#
# Author:ltan
#
# https://www.jianshu.com/p/f2c9dff344c6
import xlrd
import json
import sys
from optparse import OptionParser
reload(sys)
sys.setdefaultencoding('utf8')
def filePath(file_para):
p... |
15f62f663e49d669d20c03c370adb2bcee059821 | aed49a5f03ea45c9a417b8f9cb15a15e4f278ff0 | Wil10w/Beginner-Library-2 | /Functions/SnowedIn.py | Python | py | 1,182 | no_license | def snowed_in(temp, weather, is_celsius=True):
today_is = True
if is_celsius is True:
if temp <= 0:
if weather == 'sunny':
today_is = False
elif temp > 0:
if weather == "sunny":
today_is = False
elif weather == 'snowy':
... |
45b4b9d32de269228d09af118f235d8fa35684d1 | 45a2a5151afd3929d4fdafabea1999619e48513a | Philip-Loeffler/python | /Game/player.py | Python | py | 1,504 | no_license | class Player(object):
# when we create a new player object, we can pass one param, giving them a name. the other values are default values
def __init__(self, name):
self.name = name
self._lives = 3
self._level = 1
self._score = 1000
# underscore is suppose to represent to th... |
5ce8baa9909973a14285e5bfc59f69b33de0b375 | 01b30121b2d4efa35de2963f38d85819cbf9ac42 | wangyu190810/ufind | /views/user.py | Python | py | 32,406 | no_license | # coding: utf-8
# email: khahux@163.com
import json
from flask import g, jsonify, request, session
from models.score import Score
from models.major import Major
from models.offer import Offer
from models.stasub import Stasub
from models.message import Message
from models.university import University
from models.user... |
2e9833a9c8dca664469054382573e62c3c35ae1c | abbf5fcc6d6eac989ae6a1e65a9af132b3769504 | arita37/django-cartodb | /django_cartodb/models.py | Python | py | 5,775 | no_license | # coding=utf-8
import _geohash
from django.db import models
from django.conf import settings
from django.core.cache import cache
from django.utils.datastructures import SortedDict
import lib as cartodb
CACHE_DURATION = getattr(settings, 'CARTODB_CACHE_DURATION', 120 * 60)
class CartoQuerySet(models.query.QuerySe... |
87734a875a388b6e742d63d36c629f5b2f46505a | d18e6b6b133fdc271f8618d90ce20c7083be6d83 | saporitigianni/flaskapp | /main.py | Python | py | 1,829 | no_license | """
Microservice that provides the hash of a string or the string of a hash (of a
string previously hashed)
###############################################################################
What would the bottleneck(s) be in your implementation as you acquire more
users? How you might scale your microservice?
##########... |
0d4a79677ef7eb42be2058a0bb4ec8b5c809b3ec | 29e691b341ae1e609e44882ae1a71c3918234de4 | falconmutant/elciudadano | /blog/migrations/0004_auto_20181207_1903.py | Python | py | 651 | no_license | # Generated by Django 2.1.4 on 2018-12-08 01:03
import django.contrib.postgres.search
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_gallery_is_cover'),
]
operations = [
migrations.AddField(
model_name='notice'... |
62f7fc4a8bbc2d850bfdca8ede013772cdfdca3e | 6bb933972824e7a009900644d138151f5d670544 | cshaowang/photinia | /photinia/data.py | Python | py | 5,662 | no_license | #!/usr/bin/env python3
"""
@author: xi
@since: 2017-12-24
"""
import pickle
import queue
import threading
import numpy as np
import pymongo
class DataSource(object):
"""DataSource
"""
def next_batch(self, size=0):
"""Get a batch of data.
:param size: Batch size. Default is zero, which... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.