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 |
|---|---|---|---|---|---|---|---|---|
e9039a1f3049159a46d45507d4b081ea9a448a98 | 2f3fc972f9d943cf27d1c38c8c0c037ee3bfdbee | whigg/PySOL | /cerbere/cerbere/mapper/gpmhdf5file.py | Python | py | 17,023 | no_license | # encoding: utf-8
"""
cerbere.mapper.GPMHDF5File
==========================
Mapper class for JAXA GPM HDF5 files
:copyright: Copyright 2013 Ifremer / Cersat.
:license: Released under GPL v3 license, see :ref:`license`.
.. sectionauthor:: Jeff Piolle <jfpiolle@ifremer.fr>
.. codeauthor:: Jeff Piolle <jfpiolle@ifremer... |
a33b2c6c35f745f3f6e2adf3a4db717f2a38c2a0 | 38f1621af46362aa011087bf8ab5d8fe87b1ae7f | lonjoy/epubtestweb | /testsuite-site/testsuite_app/models/category.py | Python | py | 1,337 | no_license | from django.db import models
from test import Test
import common
class Category(models.Model, common.ItemMixin):
class Meta:
db_table = 'testsuite_app_category'
app_label= 'testsuite_app'
category_type = models.CharField(max_length = 1, choices = common.CATEGORY_TYPE)
name = models.TextFie... |
d5439f927e0c2e00840a16e0c42de0c16e56667a | 4af3d36ae84bde450ffd3670847fd35d29779ff7 | scheidguy/Advent_of_Code | /2015/day10-1.py | Python | py | 351 | no_license |
inp = list(map(int, '1113222113'))
for process in range(40):
newinp = []
num = 0
for i in range(len(inp)-1):
num += 1
if inp[i+1] == inp[i]: continue
newinp.append(num)
newinp.append(inp[i])
num = 0
num += 1
newinp.append(num)
newinp.append(inp[i+1])
... |
7c05a98bba1f03dce00fff8aa13f1f9029c791df | c56bbf2bf092783fb715c47ff46f4ef966e7617b | dzyai/tank_game | /ui/locals.py | Python | py | 395 | no_license | from enum import Enum
#游戏块
BLOCK = 50
GAME_WIDTH = BLOCK * 13
GAME_HEIGHT = BLOCK * 13
#信息块
INFO_WIDTH = BLOCK * 4
INFO_HEIGHT = GAME_HEIGHT
#窗体
WINDOW_PADDING = 4
WINDOW_WIDTH = GAME_WIDTH + INFO_WIDTH + 3*WINDOW_PADDING
WINDOW_HEIGHT = GAME_HEIGHT + 2*WINDOW_PADDING
#方向枚举列表
class Direction(Enum):
NONE = -1
... |
8a7381222badbe42058eb4c538c34395902fe681 | a699a1d73fb9847cbc5cfee855151bb825eb9fab | bloodnighttw/FileForm | /Post/migrations/0006_auto_20200223_1324.py | Python | py | 382 | permissive | # Generated by Django 3.0.3 on 2020-02-23 13:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Post', '0005_auto_20200223_0853'),
]
operations = [
migrations.AlterField(
model_name='post',
name='post_id',
... |
374c9fb89c4443b9ab580cbb2d3d5d12dc429f56 | ec8646a1f5ae334e6e7fd7d9ad32147cc4ab705b | JadenyCool/APKVersionManage | /Scripts/mako-render-script.py | Python | py | 415 | no_license | #!F:\web\flask_project\APPRelease\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'Mako==1.1.0','console_scripts','mako-render'
__requires__ = 'Mako==1.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
... |
4adb0e4f52c34cff36944393a69af67a64034829 | cec1c4e99aa6d27524c860e9090a19bd2711999d | anuragdalvi/Chat-Application | /chatServer.py | Python | py | 642 | no_license | import socket
import sys
import os
import cPickle
HOST = ''
PORT = int(sys.argv[2])
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((HOST, PORT))
print'Server Initialized...'
dict = {}
while(True):
try:
data = sock.recvfrom(1024)
except socket.timeout, e:
... |
4eb261fb394440f0a4089504916ce16c06a67c24 | 2b416aba11eaf38ff32f202088dad1540cd5ed2e | Daily-hobby-projects/Python-basics | /variables.py | Python | py | 377 | no_license | number=2
print(number+2)
name="Ssali Jonathan"
# print("My name is ",name)
print(type(name))
#Snake case
name_of_channel="Ssali Jonathan"
#Camel case
nameOfChannel="Ssali Jonathan"
#Pascal case
NameOfChannel="Ssali JOnathan"
number2=2
number_2=2
number_2_two=2
#dont do this
# 2number=2
... |
88a5fdf5047ff7fef15e81b97462c0727dca5575 | 95be51da137c3788cd4297ca7ed93a3e34178ad2 | showkit/doubango_old | /bindings/python/tinyWRAP.py | Python | py | 100,750 | no_license | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... |
0e6a4ef1a3aed46b0bda6441cb543c15e61b8809 | c8614df3be0d18028f402ef8e2b693cb1ce03fd7 | HarrismLiuch/ChuhangLiu_PHY546 | /04-matplotlib/drawing_a_circle.py | Python | py | 335 | no_license | # 04-Q2
__author__ = "Chuhang Liu"
import matplotlib.pyplot as plt
import numpy as np
theta = np.linspace(0, 2.0*np.pi, 1000)
# set radius R
R = 1
# create x, y
x = R*np.cos(theta)
y = R*np.sin(theta)
# plot
plt.plot(x,y,"g")
# set figure size
f = plt.gcf()
f.set_size_inches(6,6)
# fill the circle
ax = plt.gca()
ax.f... |
b8f510e6ebc451cb80ea839e00604aa130e12eae | 5f083ba0b3e6ef853d9b2f555f85009b880e9040 | Guwenjun2017/mynewsite | /myapp/migrations/0003_auto_20180309_2032.py | Python | py | 430 | no_license | # Generated by Django 2.0.2 on 2018-03-09 12:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapp', '0002_product'),
]
operations = [
migrations.AlterField(
model_name='product',
name='size',
fiel... |
3cc52757e2e1dd1a41cef3072ca14d0bbfc11fb2 | cc7d4cb4416c8aa07b040e484dcd8615213e22ec | felipesv/holbertonschool-higher_level_programming | /0x0C-python-almost_a_circle/models/square.py | Python | py | 1,455 | no_license | #!/usr/bin/python3
"""Square class"""
from models.rectangle import Rectangle
class Square(Rectangle):
"""square"""
def __init__(self, size, x=0, y=0, id=None):
"""constructor"""
super().__init__(size, size, x, y, id)
@property
def size(self):
"""get size"""
return sel... |
31c945f6ab6e1f23e9246fdd6ec0e947660115cf | 7808dca856e6725a2042d50b0846fc46a925d145 | yum1011/AID1909 | /mysql.py | Python | py | 554 | no_license | """
mysql.py
pymysql 操作的流程演示
"""
import pymysql
# 连接数据库
db = pymysql.connect(host='localhost',
port=3306,
user='root',
password='123456',
database='stu',
charset='utf8')
# 生成游标对象(用于操作数据库数据,获取sql执行结果的对象)
cur = db.c... |
642a478ed1e1119864107b63e38737be71c3724f | f961da8eb46f937d833a972e368dd91aece21078 | webiumsk/WOT-0.9.20.0 | /res/packages/scripts/scripts/common/Lib/ctypes/test/test_prototypes.py | Python | py | 6,078 | no_license | # 2017.08.29 21:55:48 Střední Evropa (letní čas)
# Embedded file name: scripts/common/Lib/ctypes/test/test_prototypes.py
from ctypes import *
import unittest
import _ctypes_test
testdll = CDLL(_ctypes_test.__file__)
def positive_address(a):
if a >= 0:
return a
import struct
num_bits = struct.calcsi... |
e2700d79261ce49ebbeae7c34a02969878d7ca53 | 2e32c5ef608a363b2819ff49ee6f08fb5de99668 | Aasthaengg/IBMdataset | /Python_codes/p04019/s874216841.py | Python | py | 288 | no_license | s=input()
a=s.count("N")
b=s.count("W")
c=s.count("S")
d=s.count("E")
ans=False
if a!=0 and c!=0:
if (b!=0 and d!=0) or (b==0 and d==0):
ans=True
if a==0 and c==0:
if (b!=0 and d!=0) or (b==0 and d==0):
ans=True
if ans==True:
print("Yes")
else:
print("No") |
5ba46d7875710da42b129c20e17d544a95564ac7 | 2b952db791a58ce8a258684b57e90bf40b986470 | teplofizik/objectid | /train/callback/cycliclr.py | Python | py | 5,645 | permissive | ########################################################################################
#
# https://github.com/bckenstler/CLR/blob/master/clr_callback.py
#
########################################################################################
from tensorflow.keras.callbacks import *
from tensorflow.keras import ba... |
0a43279f69d868b6bd954e8d21a053689de64f0b | 4f7ad78ad70bdaaae81d0c038ae551c190600c86 | correlation-one/C1GamesStarterKit | /python-algo/gamelib/__init__.py | Python | py | 1,608 | no_license | """
The gamelib package contains modules that assist in algo creation \n
The GameState class in game_state.py is the main class most players interact with.
It contains functions that let you get information about resources, deploy units, and help you strategize your move. \n
The GameMap class in game_map.py represen... |
002ec4a65ccac1229ddb72bd6da7a5bf9e7b610f | aa0cfd5ee3db83cdaf748bbdbd3a4249933f69ba | OA31C/RentingCar | /apps/auth_user/forms.py | Python | py | 667 | no_license | from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth import get_user_model
from django import forms
from django.utils.translation import gettext as _
class RegisterForm(UserCreationForm):
class Meta:
model = get_user_model()
fields = ('email', 'userna... |
93c6f565328317cdf77e72b75d81738a5693770f | 54cf5e9f9403aae2a7fffe47cca62c03e5975e88 | demlution/alipay-sdk-python-all | /alipay/aop/api/domain/AlipayEbppInstserviceDeductQueryModel.py | Python | py | 4,394 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppInstserviceDeductQueryModel(object):
def __init__(self):
self._bill_key = None
self._biz_type = None
self._extend_field = None
self._inst_id = None
... |
78c0276dda6416a3aa9232e3f1c0c27d255f0d1c | 0479c216bdb8c16791ef3aab61a7aa7ad1eed720 | facebookxx/python-leaderboard | /leaderboard/__init__.py | Python | py | 8,240 | permissive | from redis import Redis, ConnectionPool
from copy import deepcopy
from math import ceil
class Leaderboard(object):
VERSION = '1.1.8'
DEFAULT_PAGE_SIZE = 25
DEFAULT_REDIS_HOST = 'localhost'
DEFAULT_REDIS_PORT = 6379
DEFAULT_REDIS_DB = 0
ASC = 'asc'
DESC = 'desc'
@classmethod
def po... |
52d259d584bfe664fc8d904eac9bee9dd5138458 | 7468dbe283b8146b9505ae6871202a4943c3d40f | nandishaivalli/APS2020 | /lapindrome.py | Python | py | 531 | no_license |
for i in range(int(input())):
n=input()
f=n[0:len(n)//2:]
if(len(n)&0==0):
a=len(n)//2
else:
a=(len(n)//2)+1
s=n[a:len(n)]
dict1={}
dict2={}
for i in f:
if i in dict1:
dict1[i]+=1
else:
dict1[i]=1
for i in s:
... |
0fb07fccf1c76f4e44b3afe01450fad324688d8e | 5bb31b1df79892a1a0a327bc3bc2c8eeb2e068dc | byhob/xArm-Python-SDK | /example/wrapper/common/5000-set_tgpio_modbus.py | Python | py | 1,897 | permissive | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
"""
Example: Control the bio gripper through the modbus of the end tool
"""
import os
import sys
import time
sys.path.appen... |
8f1935716e2263d9c0c9b6a7a69dd97aed0ed3a0 | 201170c4e708fcca06caa9fa53ef08a8e313d77b | christenkinney/Flask_tutorial | /app/old_version/tests.py | Python | py | 3,484 | no_license | from datetime import datetime, timedelta
import unittest
from app import app, db
from app.models import User, Post
class UserModelCase(unittest.TestCase):
#special methods that the unit testing framework execute before and after each test
def setUp(self):
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlit... |
e9f9e2c43b9a8b69652a2ee72578245187341896 | 8d70fecee1166c1d011cec7982364ddef1893214 | DerThorsten/napari | /napari/_qt/layer_controls/qt_layer_controls_base.py | Python | py | 5,109 | permissive | from qtpy.QtCore import Qt
from qtpy.QtWidgets import QComboBox, QFormLayout, QFrame, QLabel
from ...layers.base._base_constants import BLENDING_TRANSLATIONS, Blending
from ...utils.events import disconnect_events
from ...utils.translations import trans
from ..widgets._slider_compat import QDoubleSlider
# opaque and ... |
316332cad8a3f1a27a97b4c4995e25fc572f0738 | 1ceb167b50e64c83260a76a0b260731532177d2a | bcmyers/setuptools-rust | /setuptools_rust/utils.py | Python | py | 2,387 | no_license | from __future__ import print_function, absolute_import
import sys
import subprocess
from distutils.errors import DistutilsPlatformError
import semantic_version
class Binding:
"""
Binding Options
"""
# https://github.com/PyO3/PyO3
PyO3 = 0
# https://github.com/dgrunwald/rust-cpython
RustCP... |
6800dfee340fc9713fc94836d389d069f4147b62 | 907fbdf520846dbab5e5f55b37905a60a5bbec11 | vtishchenko/TCHMK | /lab3/main.py | Python | py | 2,982 | no_license | #!/usr/bin/python3.4m
import Big_integer
import sys
import argparse
def getFromFiles (fileA, fileB, fileMod, binary):
A = Big_integer.Big_integer()
B = Big_integer.Big_integer()
modulus = Big_integer.Big_integer()
if (binary):
if not A.ReadFromBin(fileA):
print("Can't get number from:", fileA)
return Fa... |
134426d24c66baaace534327a18c1e20b75a955b | 50254e963338f7b7ad8dd3314c79d0163972fc13 | pizzapanther/Django-Next-Please | /NextPlease/__init__.py | Python | py | 2,670 | no_license | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.conf import settings
from django import http
from django.template.response import TemplateResponse
PER_PAGE = getattr(settings, 'PER_PAGE', 10)
class NextPleasePaginator (Paginator):
def __init__ (self, request, object_list, per_pa... |
ae1ed44abe704a610c716e49787c642b9a6ba304 | d2385e1d791b56317887f749725f4ac0a1305aeb | whymewhynot/hello-junior | /accounts/admin.py | Python | py | 2,091 | no_license | from django import forms
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.core.exceptions import ValidationError
from accounts.models import MyUser
... |
fb1269102680b5ae865c39a905bc1fa52c25e6f5 | 5d36041207267f8b00bf452da8abcd9f7ce27f58 | caiorasec/netprobify | /netprobify/protocol/udp_unreachable.py | Python | py | 10,940 | permissive | """Module for UDP probing."""
import logging
from scapy.all import UDP, L3RawSocket, RandString, Raw, UDPerror, conf, sr
from scapy.arch import linux as scapy_linux
from scapy.arch.bpf import core as scapy_core
from netprobify.protocol.target import Target, dscp_to_tos
from .common import patch
from .common.protocol... |
46b65774562b9c95639e81de91e014a4f35cfc48 | 060ecf4d60ad314abd406b41594bf38c9251ccab | BYZ007/BoardGame | /tests.py | Python | py | 315 | no_license | from default_config import *
from constants import *
import pandas as pd
def test_quantum_rooms()->None:
# BallRoom and DinningRoom are the 2 quantum rooms
room1 = default_mansion.rooms[RoomName.BallRoom]
room2 = default_mansion.rooms[RoomName.DinningRoom]
room1.enter(default_character,Direction) |
1dace1c9dc7796a4f5f27e45187b7ac878d5f458 | fb05b2ee3e4cca67c54de8ffbc0e38e75d97aa17 | AdamZhouSE/pythonHomework | /Code/CodeRecords/2717/60770/263888.py | Python | py | 1,129 | no_license | def solve():
letters=list('abcdefghijklmnopqrstuvwxyz')
disjointset=[-1 for i in range(26)]
def rootOf(letter):
nonlocal letters
nonlocal disjointset
index=letters.index(letter)
if disjointset[index]==-1:
return letter
else:
return rootOf(lette... |
30769e913c9bbd0d7c2b9332d40aa84af8199cc7 | 0856db80bef7cb2c867241668c27e9af796ca826 | victorkoji/gitter_sentiment_analysis | /sentiment_analyzer/src/graph.py | Python | py | 15,072 | no_license | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import os, math
from config.config import Config
from datetime import datetime
# from sklearn.preprocessing import MinMaxScaler
class Graph:
def __init__(self, folder_name, filename):
config = Con... |
7786e7d92254a4a59d4fcd25e5bd159d0e6a2b2f | c2c9ae453e35a283a0992ba1dc7920cc14caa486 | 31CFDC30/RLcode | /Alpha-Zero/21P/network.py | Python | py | 5,306 | no_license | import tensorflow as tf
import tensorlayer as tl
import os
import numpy as np
def get_avail_act(arr):
avail_act_list = []
for i in range(len(arr)):
if arr[i]==1:
avail_act_list.append(i)
return avail_act_list
class PolicyValueNet():
def __init__(self):
self.lr =1e-5
... |
871abda582ec128cf07a1b43004232ab67b34730 | 9daa0a4f3bffb7a1abe2b01c227a00a1ee24a359 | Code-Community99/vibes | /userfriendly_api/vibes.py | Python | py | 5,649 | no_license | import sqlite3 as sql
class vibes_friends:
def __init__(self):
self.db = sql.connect("platform.db")
self.dbcur = self.db.cursor()
def db_manager(self):
pass
def friends_association(self):
self.all_users_friends = dict()
sqlquery = """
SELECT * from use... |
9b6a8549a0407e91131b9ea67730d9e6eaa41026 | 5a6ec553570ebcc5e4ef9f47614311a6a9105e6c | Frostman/pyrest-skeleton | /doc/source/conf.py | Python | py | 8,417 | no_license | # -*- coding: utf-8 -*-
#
# Some project name documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 3 13:42:13 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fil... |
36d314f1b29507b8cabb1a5445e72892afcd2724 | e793f3895661b0c7c21ddebfac86d24bf18689ce | Achint08/encoder-decoder-lstm | /tests/test_skeleton.py | Python | py | 317 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from encode_decode.skeleton import fib
__author__ = "Achint08"
__copyright__ = "Achint08"
__license__ = "mit"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
|
eb3c2c097b8a64731be4bfeef228951e6b2c0f68 | 4b4714ae5c5b2957d63a5bce4ef5887f37f44d46 | ManikSinghSethi/SoftDesSp15 | /classquiz3_9.py | Python | py | 1,712 | no_license | class DNASequence(object):
""" Represents a sequence of DNA """
def __init__(self, nucleotides):
""" constructs a DNASequence with the specified nucleotides.
nucleotides: the nucleotides represented as a string of
capital letters consisting of A's, C's, G's, and T'... |
f40bce91f6ae35da6fe494f4b21f38f1b9cfecd0 | d1ae7f2d29be7bb9f22eb88d7943173dcf058952 | brunomaximom/DesafioGryfoFullStack | /Desafio/api.py | Python | py | 1,632 | no_license | from flask import Flask, flash, render_template, request, redirect, url_for, send_file
from werkzeug.utils import secure_filename
import subprocess, os
UPLOAD_FOLDER = 'Upload/'
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
options = {
"vertic... |
9753b0dfda8206982f4f7e460c3c4686d34834a8 | d997c33f404f198e74e4c8d29ea1dc498932eba4 | Atterratio/cmsplugin-slick | /aldryn_config.py | Python | py | 296 | permissive | from aldryn_client import forms
class Form(forms.BaseForm):
slick_cdn = forms.CharField ('Replaced default slick cdn url', required=False)
def to_settings(self, data, settings):
if data['slick_cdn']:
settings['SLICK_CDN'] = data['slick_cdn']
return settings |
1943db84c778f89c17a707b2e7da560989a0199d | a5c54db58b8cf7429554d6516939f39338234e20 | minf/minf1_mi2_p3 | /nettest/nettest.py | Python | py | 1,116 | no_license | #!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
"""
Option ID: aaa-ggg:Ascii-Strings, bel. Lšnge
tcp, 60666, ASCII
GET\r\n
GET aaa,bbb,cbb,dbb\r\n
ERR 1..X\r\n
OK eee,fff,ggg\r\n
"""
import socket
import signal
from threading import Thread
bRun = True
class test(Thread):
def __init__(self, i):
Thread.__ini... |
08a3c83c931e626420882fb3138abd14879819a9 | a273cb5682ff52a11662fbd04a8917105c5f621b | Andy5256/PythTB-practice | /simple.py | Python | py | 970 | no_license | #!/usr/bin/env python
# one dimensional chain
# Copyright under GNU General Public License 2010, 2012, 2016
# by Sinisa Coh and David Vanderbilt (see gpl-pythtb.txt)
from pythtb import * # import TB model class
import matplotlib.pyplot as plt
# specify model
lat=[[1.0]]
orb=[[0.0]]
my_model=tb_model(1,1,lat,orb)
my... |
8c5d4f7fedf2246ace79656abffdbe08aa386d3b | 7be93f998e41b13acfe6eebe19d969cc250c92e2 | zombeee/assignments-Chirak | /Bioinf/lib/not_sigle_string.py | Python | py | 2,973 | no_license |
"""
Contains:
- `highest_gc_content` - Find sequence with highest GC content
-
- several associated constants
"""
from typing import Generator, Tuple
import operator as op
ENTRY_START_CHAR = ">"
COMMENT_START_CHAR = "#"
CHAR_STRIP = "> \n"
def highest_gc_content(file: list) -> Tuple[str, float]:
"""
Find... |
cffdd484dc253881f61cc740386bfba8850569fe | 0b7cf7482d54c58a622d383073612522c7cbc648 | lofoio/active-directory | /python-code/google_app/helloworld/helloworld.py | Python | py | 448 | no_license | import webapp2
from google.appengine.api import users
class MainPage(webapp2.RequestHandler):
def get(self):
user = users.get_current_user()
if user:
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, ' + user.nickname())
else:
... |
efa7e0ca52b20c59b38f24f02d5a956032f6138d | 5e44e0f265f9753f5cc012a639158665f3455349 | nathanieljblack/PriceRight | /data_collection/data_collection/newyork/newyork/spiders/newyork_spider.py | Python | py | 2,881 | no_license | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.selector import Selector
from scrapy.http.request import Request
from newyork.items import NewyorkItem
#from scrapy.shell import inspect_response
class NewyorkSpider(CrawlSpider):
name = 'newyo... |
82053c05402b8a9fd33421ac8d7326ddd29f9c55 | 0976e0716c495d0604e0c2dd3accca9ff0055401 | saulshanabrook/cosc465-iprouter | /stubs/ipaddress.py | Python | py | 4,976 | no_license | # Stubs for ipaddress (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Undefined, Any
IPV4LENGTH = Undefined(Any)
IPV6LENGTH = Undefined(Any)
class AddressValueError(ValueError): pass
class NetmaskValueError(ValueError): pass
def ip_address(address): pass... |
1bd01cfb9ae57f79ece6f7c496f91e62c9d99601 | 638b19de14b0900edc7d322e7badcce6a72c0214 | xiaodongxiexie/python-widget | /PythonWidget/algorithms/quick_sort.py | Python | py | 1,098 | permissive | # encoding: utf-8
# quick sort
# method 1
# 原序列被改变
def quickSort(lists, left, right):
if left >= right:
return lists
key = lists[left]
low = left
high = right
while left < right:
while left < right and lists[right] >= key:
right -= 1
lists[left] = lists[ri... |
e204061623c151b4821394278e5005f73d6371b4 | c02b55aace40f1b1e0fa63657cba183cb0cb88b3 | ajcrites/djangosample | /polls/models.py | Python | py | 622 | no_license | from django.db import models
from django.utils import timezone
import datetime
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField("date published")
def __unicode__(self):
return self.question
def was_published_recently(self):
now = ti... |
00c9ea49492dbb8e5ff6d99c0c6592559b4e35a5 | 1b3a0cc6d2120cfefc624f2f6c6cce0a5bdd4b70 | odidev/pytype | /pytype/tests/test_anystr1.py | Python | py | 985 | permissive | """Tests for typing.AnyStr."""
from pytype import file_utils
from pytype.tests import test_base
class AnyStrTest(test_base.BaseTest):
"""Tests for issues related to AnyStr."""
def test_type_parameters(self):
with file_utils.Tempdir() as d:
d.create_file("a.pyi", """
from typing import AnyStr
... |
67573820e5a12764b1081f97dabeb166ef653dec | 062a2a68331079fc6cb3377c328f9bb39733f9c6 | marcoaureliosequeira/ubiwhere_marcosequeira | /ubiwhereExercise/ubiwhereExercise/settings.py | Python | py | 3,500 | no_license | """
Django settings for ubiwhereExercise project.
Generated by 'django-admin startproject' using Django 1.11.26.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
... |
5fdfff3b91fd2760b47a8181ada1b38ffc6b61ab | c120c695b76cec42f7ce2775e93589c4ecc58e19 | devhliu/delira | /delira/utils/config.py | Python | py | 1,986 | permissive | from trixi.util import Config
from nested_lookup import nested_lookup
from typing import Optional
class LookupConfig(Config):
"""
Helper class to have nested lookups in all subdicts of Config
"""
def nested_get(self, key, *args, **kwargs):
"""
Returns all occurances of ``key`` in ``s... |
88f30c6dd145da2b7c18c7d1b9a3d2f9f08af6f0 | 018bd6031e2c28345086b9b9d320a90d30e25de1 | ErikOsinga/MRP1 | /checking_functions/fake_data.py | Python | py | 2,148 | no_license | fake_data.py
Functions that shouldnt be found in the source_filtering.py code
but are used to test
# data_array = [[10,4,5,6,7,8,9,10,11,12,13,14,15],[2,4,5,6,7,8,9,10,11,12,13,14,15],
# [10,4,5,6,7,8,9,10,11,12,13,14,15],[2,4,5,6,7,8,9,10,11,12,13,14,15],[2,4,5,6,7,8,9,10,11,12,13,14,15],
# [2,4,5,6,7,8,9,10,11,12... |
1ecdc98c7a7422a332daab40960d5199a06417e2 | c05db4c4f08361d71b4dbe42e6a51e5ee573faf2 | Skp80/mle-tech-interviews | /data-structure-challenges/leetcode/680. Valid Palindrome II.py | Python | py | 1,686 | no_license | """
Given a string s, return true if the s can be palindrome after deleting at most one character from it.
Example 1:
Input: s = "aba"
Output: true
Example 2:
Input: s = "abca"
Output: true
Explanation: You could delete the character 'c'.
Example 3:
Input: s = "abc"
Output: false
Constraints:
1 <= s.length <= 1... |
fb9875989715a9e7f8dcd563e17093f90633ac1a | af12ed81ecfd9291cf0ddaa75624e0326e28b315 | vizun21/erowm | /accounting/migrations/0013_tblbank_business.py | Python | py | 517 | no_license | # Generated by Django 2.1.4 on 2019-02-28 15:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('accounting', '0012_deadline'),
]
operations = [
migrations.AddField(
model_name='tblbank',
... |
79954160d9bb9cb73ec8f878e4b63adb559d0557 | ef19e46ccd8a5ba0bee635c3eeefc2eae7163949 | vanderaa/geodaq | /genplot.py | Python | py | 511 | no_license | #!/usr/bin/env python
import tornado.ioloop
import tornado.web
from urlparse import parse_qs as qs_decode
from urllib import urlencode as qs_encode
from tornado import escape
from plot import plotter
from tsdb import TSDb
import sys
if __name__ == "__main__":
print sys.argv
db = TSDb('lego.xe.be',4242)
de... |
9d76a885f951a602d351d63f5f6fb5ce7e29c771 | 5bd7889f456c27dd8955b66cb69c19941b331413 | danielsaralkar/BillBoard | /mainbillboard/views.py | Python | py | 1,171 | permissive | from django.shortcuts import render
from django.utils import timezone
from mainbillboard.models import Messages
import json
from django.http import HttpResponse
from .forms import PostForm
# Create your views here.
def get_data(request):
my_result = Messages.objects.order_by('-pub_date')
for post in my_result... |
95d2fc348eca0758b2f7c362053d17f7025a8d59 | d21919e4569e83c73d17ac4165b0fc98fd5e09a3 | Jose-cmd98/Proj-python | /Backend.py | Python | py | 2,514 | no_license | import sqlite3 as sql
class TransactionObject():
database = "clientes.db"
conn = None
cur = None
connected = False
def connect(self):
TransactionObject.conn = sql.connect(TransactionObject.database)
TransactionObject.cur = TransactionObject.conn.cursor()
... |
de26e0b77c7985b4fea971bdd8dc4dad51c39289 | 652d89b90c931a7ee6e240492fe5fec2d3e863d1 | ishtiak-ahmed/coolBrowser | /main.py | Python | py | 1,640 | no_license | import sys
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtCore import *
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.browser = QWebEngineView()
self.browser.setUrl(QUrl('https:/youtube.com'))
... |
d76e3277f8da8bdffb64cf22d836047b7ebe03c3 | 1f946e391341817d224c5ed2f18f6790e3b19eab | rajagupta8899/Echo-bot | /bot.py | Python | py | 1,346 | no_license | import logging
from telegram.ext import Updater,CommandHandler,MessageHandler,Filters
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',level=logging.INFO)
logger = logging.getLogger(__name__)
TOKEN = "846730671:AAFoZYfTGvgG2poMucC-dW6_T7xHsVqxiU4"
def start(bot,update):
print(updat... |
d0ed0ffbe2c1324f151b2ff3cc797644a9898171 | 3413b08cbc6a4ed1ed7b4c26b62b5089d29c1f55 | azaroth42/pi3f | /pi3f/authHandler.py | Python | py | 6,147 | no_license |
from bottle import request, response, abort, redirect
from bottle import auth_basic, parse_auth
import json
import urllib, urllib2
class AuthHandler(object):
def __init__(self, application):
self.application = application
self.config = application.config
def check_auth(self):
cf = s... |
30061e5c962facfa96d1796755795df1603cf450 | 0132a30bd64b09314c13cecd9e199bb6fa7c3265 | mconlon17/vivo-1.6-upgrade | /tools/test_get_vivo_uri.py | Python | py | 531 | permissive | """
test_get_vivo_uri.py -- return a valid, unused, vivo URI
Version 0.1 MC 2013-12-28
-- Initial version.
Version 0.2 MC 2014-07-21
-- Formatting improvements. Tested with 1.6
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2014, University of Florida"
__license__ = "BSD 3-Clause ... |
2c95c52f3fb1b5457f04a7db4c2a658fa2ff744f | e90e97123b6da439c3804cc9a43f59544944aaf6 | MarcisinMatej/predictions | /main.py | Python | py | 3,202 | no_license | import numpy as np
import pandas as pd
import datetime as dt
from sklearn.preprocessing import MinMaxScaler
import logging
from data_loader import *
from predicition_model import *
from visualization import *
def run_trainig_and_testing(company = "FB", training_window = 60,
trainig_period_... |
ed2b9b60fd401038751e38e035e80650e84934ab | e888c994b5a915d4263098bc630c66b45a6239d4 | hossnimahmoudi/IMMO_FR_LOGICIMMONEUF | /correction.py | Python | py | 2,018 | no_license | import sys
import pandas as pd
from datetime import date
f1= "/home/h.mahmoudi/LOGICIMMONEUF/LOGICIMMONEUF/spiders/logicimmoneuf_2020_07_10.csv"
f2= date.today().strftime("LOGICIMMONEUF_%Y_%m_%d.csv") #fichier sortie entrer comme parametre
x=pd.read_csv(f1,sep=';',keep_default_na=False)
def fn_replace_0(i):
res... |
0de700c9c7491ebec5d28a798c7211c8810a2090 | b8bfe73beaa8b737861c3d6c8bd3b035b352ff03 | JeffersonLab/HPS-CODE | /PRODUCTION/data/PhysRun2016/pass0/scripts/get_tape_files.py | Python | py | 456 | no_license | #!/usr/bin/env python
import os,re,sys,glob
run_min = 7219
run_max = 8101
evio_pattern = '*.evio.*'
f_tape_list = open("lists/tepe_files.dat", 'w')
file_list_dict = dict()
for run in range(run_min, run_max):
file_list_dict[run] = glob.glob('/mss/hallb/hps/data/*'+str(run)+evio_pattern)
# print '/mss/hallb/h... |
59e08aaff17348d985f3a40ea584be65f7f2c177 | e78fad1d33c38fea08466de10eefa8c853586865 | hajimeo/samples | /python/conan-related/HelloCoan.py | Python | py | 1,951 | no_license | from conans import ConanFile, CMake, tools
class HelloConan(ConanFile):
name = "hello"
version = "0.2"
license = "<Put the package license here>"
author = "<Put your name here> <And your email here>"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Des... |
0bcf0f0cfe8d7ebf305af85678ec711ced4a20ad | e6c84d440c00f83c1155ffefbae1e58d25fd4612 | SHENOISZ/csv_reader | /csv_reader.py | Python | py | 849 | permissive | __author__ = 'shenoisz'
from csv_reader.funcs import get_object_list, get_object_dict
import os
PATH = os.path.dirname(os.path.dirname(__file__))
file_ = os.path.join(PATH, 'CSV/test.csv')
# lines = get_object_list( file_ )
#
# for video in lines[:1]:
# for x in range( 0, 11 ):
# print video[... |
58573911eae697e04f0b473c4a4119da3032f4ef | ce3ef10828c8b8fb4758ec89c6d139771cc67e84 | willbrown600/CS241-OOP-Data_Structures | /Data Structures/ds12.py | Python | py | 1,690 | no_license | ##############################################
# Lambda Functions 12, CS241
# Author: Will Brown
# Instructor: Brother N Parrish
##############################################
"""
Purpose: This file is a starting point to help you practice using lambda functions.
"""
import functools
def get_part1_list... |
10ce42e1d632f53facf32c950a45b7cc10a97341 | 78ab4011d9040e387ff1753f852dd4076f65ab77 | pyplusplusMF/202110_68 | /_68semana05clase15Numpy.py | Python | py | 3,202 | no_license | # clase miercoles 2 de junio
# linea de comando para instalar numpy
# py -m pip install numpy (conda) (En windows)
# https://numpy.org/install/
import numpy as np
arreglo = np.array([1,2,3])
print (arreglo) # [1 2 3]
arreglo1D = np.array ( [1, 2, 3] )
print ('arreglo1D = ', arreglo1D) # [1 2 3]
print ('type = ',... |
1d35a39d1198f35208065a820d4e1c688df8fc17 | d57e15a3da464fc5f2b959b5366192a22d55a2b1 | vivimouret29/pulumi-azure-native | /sdk/python/pulumi_azure_native/sql/v20201101preview/job_agent.py | Python | py | 12,902 | 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, overload
from ... import _utilities
fro... |
9a0eb274b58679d2eaad5a9c8014613c014be26b | 5899b61cb4c7bd6f0cd347a5466d1ff0767677a3 | tmpethick/thesis-code | /pyipopt/setup.py | Python | py | 2,374 | permissive | # Originally contributed by Lorne McIntosh.
# Modified by Eric Xu
# Further modification by random internet people.
# You will probably have to edit this file in unpredictable ways
# if you want pyipopt to work for you, sorry.
# When I installed Ipopt from source, I used the
# --prefix=/usr/local
# option, s... |
a2572b477d889a8681ac4cce988526b88e64a41d | 72e39c44ecde076de933b74104b17499ca1d01ee | noursecw/ev3dev-curriculum | /sandbox/noursecw/analog_sensors/pixy/m3_color_tracking.py | Python | py | 2,597 | no_license | #!/usr/bin/env python3
"""
The goal of this module to combine using the Pixy with the drive motors. You will track a color using the Pixy and turn
the robot so that it is always facing the color signature. You will need to teach Pixy a color before starting to
implement the code, then make the robot always face the c... |
b1234ef30afe06b19a7cf2f08cc2e1f76641ab0c | 05fbdb0c70c849f3b7b8bef14c58da0e3e0e6155 | Aaditya-Bhatia/Covid-19_AI_weather_prediction | /Codes/get_files_v2.py | Python | py | 1,624 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 17 11:58:13 2020
@author: aadityabhatia
Exploring the WHO api for coronavirus
DATA DOWNLOAD : https://ourworldindata.org/coronavirus-source-data
WEATHER DATA: https://www.worldweatheronline.com/developer/my/#
"""
import pandas as pd
from wwo_h... |
5c1dd665ef9ae1f3d75e429615f64f9092740b6e | f116e49c38cfaa2ee1d72dcbb64baf939e419cdb | knagakura/procon | /others/hallab/hpc2020/run_expmode.py | Python | py | 1,414 | no_license |
import subprocess
import random
import os
import pandas as pd
exp_name = input()
subprocess.run("g++ -std=c++14 -Wall -Werror -Wshadow -Wno-error=sign-compare -fno-asm -fno-exceptions -DLOCAL -MMD -O3 -DDEBUG Combine.cpp", shell = True)
os.makedirs("exp/{}/".format(exp_name), exist_ok=False)
with open("exp/seed.t... |
f3c229a2c6953d0d94e7b05c76ddadcb81cf3dad | 765c7dc919ce2b17eeed836a6d7eed38ac026053 | Suchismita17/Naturopath | /mysite/urls.py | Python | py | 1,041 | no_license | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Clas... |
17a8626e228f2a72f9ae38af28e6fa70481e9a4c | 3bc54580625310a7e7fc9ee092b6ab6ebe4db428 | Cyber-MC/MythicMusic | /mythicmusic/bot.py | Python | py | 130,066 | permissive | import os
import sys
import time
import shlex
import shutil
import random
import inspect
import logging
import asyncio
import pathlib
import traceback
import math
import re
import aiohttp
import discord
import colorlog
from io import BytesIO, StringIO
from functools import wraps
from textwrap import dedent
from datet... |
e10944974de9e621cdb3cd759cbeb27c0d9b8521 | 112f775f2c86f9ecbc3f05dd81e47a11b389a03c | Gaurishankar11/prototype | /prototype/feedback_manager/migrations/0001_initial.py | Python | py | 4,296 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-05-11 05:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.... |
bd8c2e9fc8f45c7a206c48ea7bfbc6f5261201e1 | 31ae5021ed01d99070229c9b60174079a4d4af5b | hannahbrantley/concertcollector | /main_app/migrations/0003_auto_20200627_2002.py | Python | py | 472 | no_license | # Generated by Django 3.0.5 on 2020-06-27 20:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('main_app', '0002_auto_20200627_1958'),
]
operations = [
migrations.RenameModel(
old_name='Artist',
new_name='Opener',
... |
8e5802f3c44ac47d16ba3e50acdfab0375124d26 | 2bf96069d6b535a177406cc1638f122abf34ac2c | cybber-team/Writeups | /2017/SchoolCTF/rev200/decaesared.py | Python | py | 424 | no_license | import string
FLAG = "MeW_^sto?????_v0r_qexq/ONEpto\MeW_^op\iiv_????????@^_MeW_^qefkh"
def decaesared(ct, key):
pt = ''.join(
chr((ord(c) - 0x61 - key) % len(string.ascii_lowercase) + 0x61)
if c in string.ascii_lowercase else c for c in ct
)
return pt
if __name... |
78c2cea11552832bcfa826b0cad112f2ab8ac91c | 15ee8d8deafc9d57e73c206754babae3fab72775 | BrunoKM/magenta | /magenta/models/coconet/coconet_evaluate.py | Python | py | 6,995 | permissive | # Copyright 2018 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
b229ffbf0a008b9e5d66bdfbb54fa04ab3eeb0ca | b4f3ae61cf180db25bb183a126cd60d8968a0824 | anubhavtm/cnn | /cnn.py | Python | py | 1,663 | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Oct 26 04:54:58 2019
@author: anubh
"""
from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import Flatten
from keras.layers import MaxPooling2D
from keras.layers import Dense
classifier=Sequential()
classifier.add(Co... |
a3aad98afe4666754f2c9587c852e5e0f6e94304 | 834398dc8afce07f17027a7b8cc1022661b9da27 | adafruit/Adafruit_Learning_System_Guides | /RP2040_Radio_Messenger/client.py | Python | py | 5,128 | permissive | # SPDX-FileCopyrightText: 2023 Eva Herrada for Adafruit Industries
# SPDX-FileCopyrightText: 2018 MikeTheWatchGuy
# SPDX-License-Identifier: LGPL-3.0-only
# Partially based on:
# https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_Chat_With_History.py
import time
import pathlib
import os
import ... |
591db06a575bd227e54dc8998d611479aed5f9d0 | 9b9192ce2f488f30b6a1cfed695baef6b877aa3d | andreposman/telegram-bot | /bot.py | Python | py | 1,005 | no_license | import os
import telebot
import logging
import yfinance as yf
import securities
import commands
import utils.messages
import utils.calculate
from dotenv import load_dotenv
from pathlib import Path
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG, datefmt='%d-%m-%Y %H:%M:%S')
env_path = Path... |
e986017723863ccb21ee502fada96c3a060b9368 | 565539cbd9bfff6a29429612ee02f281970d095e | roxanasoto/AttGanESRGAN | /codebase/utils/prepare.py | Python | py | 2,218 | no_license | import argparse
import random
import pprint
import datetime
import dateutil.tz
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from codebase.utils.config import cfg, cfg_from_file
class Preparation():
def parse_arguments(self, default_cfg):
args = self.get_args(default_cfg)
... |
a68cd9c4ef5b472dcebb46b78ad5eaea8e032637 | 77f53b72ec92d58948e44df91684dd05e393c89d | fawaz-dabbaghieh/msa_to_gfa | /setup.py | Python | py | 1,157 | permissive | #!/usr/bin/env python3
import sys
from distutils.core import setup
from setuptools import setup, find_packages
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 3)
# This check and everything above must remain compatible with Python 2.7.
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.stderr.write("msa_to_gfa ... |
7e94d114f0156fade2ce4df52f028dbbabd57fed | abeb1664f913b712ebd194160f1201eff16d4e9b | ViniGarcia/NFV-FLERAS | /GESEMA/local_platypus/algorithms.py | Python | py | 64,619 | permissive | # Copyright 2015-2018 David Hadka
#
# This file is part of Platypus, a Python module for designing and using
# evolutionary algorithms (EAs) and multiobjective evolutionary algorithms
# (MOEAs).
#
# Platypus is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... |
bf72eeef33e7e226bcd6e23ffbba0709407e44e5 | 5cd10264cc8369f4d9d0c9c6d4dedbc4b2a325ab | usmanjoiya/custom_scaffold | /elite.py | Python | py | 7,172 | no_license | import os, sys , re
from optparse import OptionParser
from pathlib import Path
PYTHON = 'python3'
parser = OptionParser()
parser.add_option("-f", "--form",
help="Make a form",
action="store_true",
dest="Form"
)
parser.add_option("-m", "--module",
... |
fb7341b579c0fd8e33751e1d5f565c320dd8891c | 7f91cda88d294f7c94a1b0a771dfdeab4f9b5c2d | sjh031802626/2426 | /AI大比拼+小游戏的部分代码/AI/hello.py | Python | py | 20,150 | no_license | # coding=utf-8
import os
import base64
import numpy as np
# import random # 随机打乱列表时可以用上
from PIL import Image
from io import BytesIO
import requests
import json
import copy
class Board:
def __init__(self, stat, pos, step=0, preboard=None, prepath=""):
self.stat = stat
self.pos = pos
se... |
17bc1bffcbd1451012c983f1d5246a8e18ba4282 | e4408424807b8a0ea55f44033455ae774866a9bf | sbein/RebalanceAndSmear | /tools/SimpleAnalyzer.py | Python | py | 2,416 | no_license | from ROOT import *
from utils import *
from array import array
from glob import glob
import os, sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--verbosity", type=bool, default=0,help="increase output verbosity")
parser.add_argument("-fin", "--fnamekeyword", type=str,default='RunIIFall... |
a9b357614221e18f4420e5c67d41b60ca9a0a026 | 8bb2dd7ac028110b61cd4f36a69cc87715301166 | shankar7791/MI-10-DevOps | /Personel/Yash/Python/april5/prog3.py | Python | py | 303 | no_license | f = open("demo.txt","r")
print(f.read())
# print(f.read(2)) #Return the first 2 characters of the file
# print(f.readline()) #return one line
# print(f.readline())
# print(f.readline())#return two line
# print(f.readlines()) #['Hi\n', 'hello\n', 'I am Yash']
# for x in f:
# print(x)
f.close() |
5c9a6c00b33f3fa26a16900d2e08ffe0f7cafe9e | 139b1023aea17404639847c6c0413a87824248d9 | wisdomtohe/CompetitiveProgramming | /Forks/uvapy-master/data-structures/p10107.py | Python | py | 314 | permissive | import bisect
numbers = []
num_items = 0
while True:
try:
number = int(input())
bisect.insort_right(numbers, number)
num_items += 1
if num_items & 1:
print(numbers[num_items//2])
else:
print( (numbers[num_items//2] + numbers[num_items//2-1]) // 2)
except(EOFError):
break |
6a438fffccfac74f96ca15b874dedb2b537c680e | fa0f7bb36d9c277c04acea6262d2da1b1772dbbe | melvinperello/PythonSimpleNetworkedATM | /AtmTestCase/src/main/UserInterface.py | Python | py | 25,079 | no_license | '''
Created on Jul 26, 2017
@author: Jhon Melvin
'''
from Tkinter import Tk, Toplevel
from Tkinter import Label
from Tkinter import Button
from Tkinter import PhotoImage
from Tkinter import X
from Tkinter import Entry
from tkMessageBox import showinfo,showerror,showwarning
from Oras import Time
from Depositor import ... |
3a887a93269b04301dcfbc9b8ab6fe383f7e9b4f | 64ec0ef6d06220805e8b7d0a2278fdcb10325c1f | ammantasha/MusicPlayer | /mymusic/mymusic/settings.py | Python | py | 3,429 | no_license | """
Django settings for mymusic project.
Generated by 'django-admin startproject' using Django 3.0.3.
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/
"""
... |
8f0e40f231839f2907289b40eab1438b1df4afb9 | 1789c91d981fc637d49d1797f9629da8a0858de8 | ihorm5/hotel_api | /shell.py | Python | py | 360 | no_license | #!/usr/bin/env python
import os
os.environ.setdefault('TORNADO_MODULE_SETTINGS', 'settings.development')
import readline
from pprint import pprint
from hotel_api.app import *
from server import *
def make_shell():
os.environ['PYTHONINSPECT'] = 'True'
def main():
print('Loading shell...')
make_shell()... |
7a4b3d76a0e04c1d89cd1680d8f6395c6cb8d550 | f6b1739b505a9902739d4728719e5413a8ce1047 | jjsebastianfuertes/Blog | /Scripts/django_proyecto/users/views.py | Python | py | 1,388 | no_license | from django.shortcuts import render, redirect
from django.contrib import messages
from .forms import UserRegisterForm, ProfileUpdateForm, UserUpdateForm
from django.contrib.auth.decorators import login_required
def register(request):
if request.method == 'POST':
form = UserRegisterForm(request.POST)
... |
07c5492e01e82c21726b1befd5633a4aee362422 | 61275c68e84adad8fa84fd0594a0a3038baf5254 | sandeep021/web-map | /map/web_map.py | Python | py | 1,090 | no_license | import folium
import pandas
data = pandas.read_csv("Volcanoes_USA.txt")
lat = list(data["LAT"])
lon = list(data["LON"])
elev = list(data["ELEV"])
def colour_producer(elevation):
if elevation < 1500:
return "green"
elif elevation < 3000 and elevation >= 1500:
return "orange"
... |
b7b64a227cb0b3e6d79b9db444bab275d0845336 | 944e2e50f7530920bcafc4874d04ec6389d30ac5 | alexanu/tcapy | /tcapy/conf/tcapyapi_wsgi.py | Python | py | 273 | permissive | import os
import sys
tcapy_cuemacro_home = os.environ['TCAPY_CUEMACRO']
sys.path.insert(0, tcapy_cuemacro_home)
# os.chdir(user_home + '/cuemacro/tcapy/tcapypro/vis/')
from tcapy.api.app_api import application
application.root_path = tcapy_cuemacro_home + '/tcapy/api/' |
7806d088423f11a5e7b738b9656cb48cc458e6d9 | e2801054bc425761e59f18b1bc4e589b2e9f8ebc | asiekierka/vhs-teletext | /teletext/t42/elements.py | Python | py | 3,382 | no_license | from coding import *
from descriptors import *
class Mrag(object):
"""Magazine row address group. The first two bytes of every packet."""
magazine = MagazineNumber()
row = RowNumber()
def __init__(self, magazine=1, row=0, errors=0):
self.magazine = magazine
self.row = row
sel... |
e2a95ad14504ebdb3245e80f21c750d2fad3b098 | 7d60e8bb291c3d576b8e655f433b970adc1a3c77 | DanMirz/python-adventures | /higherorlower.py | Python | py | 383 | no_license | from random import randrange
number = randrange(1, 11)
while True:
print(number)
try:
guess = float(input("Your guess? "))
except ValueError:
print("Not a number try again")
continue
if guess > number:
print("it's smaller")
elif guess < number:
print("it's l... |
7150e0f07b8749870080addba4d1cb6c739c37f0 | f306bfa9512bbf5930e31b2de4ad4734fdc702d6 | YanaPatyuk/MyProjects | /BIG DATA-PYTHON/ex1.py | Python | py | 5,584 | no_license | import requests
import lxml.html
import random
import time
import urllib.robotparser
import requests
import lxml.etree
#list of urls that we can crawl
#Base node for url
class url_node:
def __init__(self, full_url, father_url, rank):
self.full_url = full_url
self.father_url = father_url
self.rank = rank
self... |
634c73ac3fce6ee144a2a15438f0985a4c461156 | 60b8d1cfbdaebf4608cb3d8bdc96406543ffc5a4 | KevAntua/Sistema-AOC | /Index.py | Python | py | 1,921 | no_license | from flask import Flask, render_template
import os
app = Flask(__name__)
videofolder = os.path.join('static','video')
app.config['UPLOAD_FOLDER'] = videofolder
pdffolder = os.path.join('static','Docs')
app.config['UPLOAD_FOL'] = pdffolder
@app.route('/')
def home():
vid1= os.path.join(app.config['UPLOAD_FOLDE... |
2da25009b5bba96aeb1ae02610435a707f3b96b4 | 8418c6efe7e12eb353f9c79a5f51ffd9a9d25eb1 | daniel-kanchev/bankofindia | /bankofindia/spiders/india.py | Python | py | 915 | no_license | import scrapy
from scrapy.loader import ItemLoader
from itemloaders.processors import TakeFirst
from datetime import datetime
from bankofindia.items import Article
class IndiaSpider(scrapy.Spider):
name = 'india'
start_urls = ['https://www.bankofindia.co.in/']
def parse(self, response):
articles... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.