blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 283 | content_id stringlengths 40 40 | detected_licenses listlengths 0 91 | license_type stringclasses 2
values | repo_name stringlengths 3 135 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 68 | visit_date timestamp[ns]date 2015-07-25 20:53:29 2023-09-06 10:46:05 | revision_date timestamp[ns]date 1970-01-01 00:00:00 2037-05-03 13:00:00 | committer_date timestamp[ns]date 1970-01-01 00:00:00 2036-02-09 17:40:36 | github_id int64 1.61k 691M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 24
values | gha_event_created_at timestamp[ns]date 2012-06-03 10:21:33 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[ns]date 2008-03-27 23:40:48 2023-09-13 22:40:33 ⌀ | gha_language stringclasses 250
values | src_encoding stringclasses 27
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 6 10M | extension stringclasses 289
values | filename stringlengths 1 218 | content stringlengths 6 10M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dfd23cd6b4d0029bde130179dbb760b61a6340db | c34f0c273735bc6739b9ddf79be02f1bb8be99ac | /TM perceptron fonction logique XOR.py | 31ef99e56f261be3c5bca74a2ac4a382df223ed6 | [] | no_license | roxasboss/TM-lyca-2018 | a05adcb45a5049799ed69648b8858d92ba537d1f | 847ca18c57a3527227ca4f517a43e6704d011ecf | refs/heads/master | 2020-03-27T07:24:33.223200 | 2018-10-28T18:21:30 | 2018-10-28T18:21:30 | 146,188,960 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,212 | py | TM perceptron fonction logique XOR.py | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 20:29:05 2018
@author: Maxwell
"""
import numpy as np
"""activation, la fonction de Heavside(threshold) fonctionne bien ici
car on veut un résultat de 0 ou 1"""
def threshold(x):
if x >=0:
return 1
else:
return 0
inputs =np.a... |
ae8966ae5aa27a43475cf32276aea557cc3d410e | 04cb6bdda051127da4bda02edc25ebcdf83c11f6 | /functions_Problem_4.py | 9cad67b47a464e0f2235a776bd5f7f76a948b979 | [] | no_license | stefanc88/self_taught_programmer | 419dedd22e8e7c28acc52beb19b49f2badabca04 | 3d544bcb5be42fc39d65075f64e42745cf6db531 | refs/heads/master | 2022-12-18T02:14:17.319185 | 2020-09-22T13:30:03 | 2020-09-22T13:30:03 | 297,656,680 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 300 | py | functions_Problem_4.py |
# two functions
def f_1():
try:
x = input("Please enter an integer value:")
x = int(x)
a = x/2
a = int(a)
print(a)
return a
except ValueError:
print("Invalid input.")
def f_2(y):
return y * 4
a = f_1()
b = f_2(a)
print(b)
|
fb7c6111923576f17c9ed7b04dbff38d74c0aa56 | b52387be5ae3b4a45e7b6823b2491aeec99e3a4c | /sublist.py | b47c407861ff69c4cb91fa06c2896fb48f5df58f | [] | no_license | makanju0la/Data-Structures-and-Algorithms | 0fd290335b834b977e23005cdee236cfeffb5629 | 15120614c686944f0a75abc370fd16fb9b9b67d0 | refs/heads/master | 2022-05-04T06:58:16.870371 | 2022-03-27T06:14:59 | 2022-03-27T06:14:59 | 218,407,072 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,087 | py | sublist.py | # 1. Given a list of integers nums and an integer k,
# return the total number of continuous sublist whose sum equals to k
# brute force:
# double iteration. get each cont sublist. check if sum = k. if so increment count. edge cases: if lst is empty, print None. if no sublist sum = k, print 0
# time = O(n^2), space = ... |
12389a0838c756fdd58348cf9a0a58eedcc5ed91 | bc97d853e546724e497696a2aa1e37207b477c2e | /shapash/webapp/smart_app.py | 14fdf393e5605d5cfdb372f1ca1e36937873b01a | [
"Apache-2.0"
] | permissive | mvavouri/shapash | fa70ec2d33d36527dcbecfc470ea962391999918 | e9d84bf47d0a892c5968480b7c9f3288cd157732 | refs/heads/master | 2023-07-30T20:10:20.066759 | 2021-09-28T08:22:41 | 2021-09-28T08:22:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 49,995 | py | smart_app.py | """
Main class of Web application Shapash
"""
import dash
import dash_table
import dash_daq as daq
from dash import no_update
from dash.exceptions import PreventUpdate
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Output, Inp... |
7af8fb8ca3dfcc8826d84a1d3374b02a2f63163a | 29d6427c94f3dcf9046dcb733a561351afedab26 | /game_functions.py | ba274c39a082f173b90cb90fa3b7f37aaada0a52 | [] | no_license | hom113/alien_invasion | 73654f79eb2dd9055334084cc3e732ad3c861ff4 | 0b82b3e7f405d18a305db4b26544b9b4c0757603 | refs/heads/master | 2020-06-21T05:09:20.929475 | 2019-07-17T08:04:46 | 2019-07-17T08:04:46 | 197,352,113 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,727 | py | game_functions.py | import sys
import pygame
from bullet import Bullet
def check_keydown_events(event,ai_settings,screen,ship,bullets):
if event.key==pygame.K_RIGHT:
ship.moving_right=True
if event.key==pygame.K_LEFT:
ship.moving_left=True
if event.key==pygame.K_UP:
ship.moving_up=True
if event.key... |
c49fb6106e329fd837983993f2320e91e6044101 | 53fab060fa262e5d5026e0807d93c75fb81e67b9 | /backup/user_370/ch18_2019_08_19_13_05_55_214949.py | 1c580d145694fcdbb83244a41c0b0fd8a710d504 | [] | no_license | gabriellaec/desoft-analise-exercicios | b77c6999424c5ce7e44086a12589a0ad43d6adca | 01940ab0897aa6005764fc220b900e4d6161d36b | refs/heads/main | 2023-01-31T17:19:42.050628 | 2020-12-16T05:21:31 | 2020-12-16T05:21:31 | 306,735,108 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 62 | py | ch18_2019_08_19_13_05_55_214949.py | def encontra_cateto (b,a):
c=(a**2-b**2)**(1/2)
return c |
b0ba7abaa064f69ec76b77d15b2a504df1b1ae51 | 24f354c0a362c0a44fe0946f0a947930f0724f4d | /tests/unit/create/via_global_ref/builtin/cpython/test_cpython3_win.py | f831de11473f87d45922bbff67aa96c4c8ffadf5 | [
"MIT"
] | permissive | pypa/virtualenv | 783cf226c806bcb44ee63fd87c37d76e90c121ce | 6d22da631fd289f89f921a4010047ad969b7bfa7 | refs/heads/main | 2023-09-04T06:50:16.410634 | 2023-08-30T14:32:38 | 2023-08-30T14:32:38 | 1,446,474 | 4,313 | 1,073 | MIT | 2023-09-12T14:54:09 | 2011-03-06T14:33:27 | Python | UTF-8 | Python | false | false | 4,289 | py | test_cpython3_win.py | from __future__ import annotations
import pytest
from testing.helpers import contains_exe, contains_ref
from testing.path import join as path
from virtualenv.create.via_global_ref.builtin.cpython.cpython3 import CPython3Windows
CPYTHON3_PATH = (
"virtualenv.create.via_global_ref.builtin.cpython.common.Path",
... |
4b80507e38daabc2cec8c2451e5f5bedc61d0b68 | 8d07ab9f043432878118e7475d451297b369b8c1 | /src/updatechangelog/main.py | e636fabdfecaf7c69db24e31d55258b2f64cd341 | [] | no_license | gsemet/update-changelog | 7c6cd2be0bd59762f45162cba1e1ca8d56b3d7b0 | 7d392dc1763b71bc01775e6256583fc28dbdd373 | refs/heads/master | 2021-05-28T11:31:11.344617 | 2014-11-02T13:31:12 | 2014-11-02T13:31:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 858 | py | main.py | from argh import ArghParser, arg, expects_obj
from updatechangelog.version import getVersionString
from updatechangelog.updater import Updater
@arg('--config',
dest='config',
default='.update-changlog',
help='Set the path to the .update-changelog file (default ".update-changelog')
@expects_obj
def exe... |
f005875db1ef996f8eaeb992b74996b92d8318bb | 04767fd9b970f9dd32226e422ba2e3cdfdd157f6 | /CNN-model.py | d5c5b6125398964b1b84d56890effdd12f9ccf60 | [] | no_license | nnajeh/Handwritten-digit-recognition | cad0de56f3a80e60d0514431fe49dcc98b184bad | 93abf580eeb41c51ce8a789110ce4a9db7583db7 | refs/heads/master | 2021-02-07T15:36:35.879972 | 2020-02-29T21:41:12 | 2020-02-29T21:41:12 | 244,045,113 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,179 | py | CNN-model.py | #Load libraries
# import the dataset directly from the internet
from keras.datasets import mnist
import numpy as np
import pandas as pd
# CNN model Sequential
from keras.models import Sequential
# CNN layers
from keras.layers import Dense
# Reduce overfitting
from keras.layers import Dropout
from keras.layers import F... |
d77c4d8284e1cef73b121b0af5d5e84dbde0dfd8 | 815a1541af288c5844a675d1037e231cf7d8bcd1 | /chip8.py | b0a73c6d8eda10041d4b0b9e192e909476725efd | [] | no_license | djfoote/chip8-python | 28574823e343f4d7ad6e3cff41fb27e3eeca72f7 | 696645b8e6137b709536d0b738559a5887fe3bfa | refs/heads/master | 2021-01-09T09:39:45.247587 | 2020-02-26T17:00:37 | 2020-02-26T17:00:37 | 242,254,079 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 187 | py | chip8.py | import sys
from emulator import session
def main():
rom_path = sys.argv[1]
chip8_session = session.Chip8Session(rom_path)
chip8_session.start()
if __name__ == '__main__':
main()
|
5b0a7e4281621770f773c61d248042bec3372150 | a512b8893b0d2de827d6292e810f3a98b41e132c | /Week11/Day4/Solutions/Python/prog5.py | 07bf2e4aaa4fb8634df23baad10b35f340435b51 | [] | no_license | Audarya07/Daily-Flash-Codes | d771079fd0d470e2d3e05679f17f32fb64b4f426 | cf96ca2b1676b038e243fac67be778381492ffeb | refs/heads/master | 2022-11-06T15:37:47.180729 | 2020-06-25T16:20:55 | 2020-06-25T16:20:55 | 274,960,651 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 187 | py | prog5.py | length = float(input("Length of pendulum:"))
period = float(input("Enter period of pendulum:"))
g = (4*3.142*3.142*length)/(period**2)
print("Period of pendulum:",round(g,4),"m/s^2")
|
a4a7e9a28cf2b39a520c675a4d2f30a67ea5ee1e | 97dded22777ec4a32979ffae3ca1ce0916a89648 | /plotting.py | 9a5a3e4d16a6df894d5fe3e63d9e72a124cbf578 | [] | no_license | Gmishra2000/PredictionModel | bdcb088bcfc3e0b12d580fcba030c3ca5108ae48 | a325a5fb0497e524c8958ff8e346c5e577b9301e | refs/heads/master | 2021-02-26T03:16:37.098255 | 2020-03-07T04:45:50 | 2020-03-07T04:45:50 | 245,491,483 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,620 | py | plotting.py | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 19 21:02:25 2020
@author: User
"""
import pandas as pd
import numpy as np
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score,confusion_matrix
data_inco... |
ce72efb6240486e30d281b5261eca30582c70875 | 25e2fa9652d1ab443b7a04bcd58fdec2fb56400c | /leetcode/reverse-int-7.py | 381ad1d4159b95d1bf143723e5384baebc317eeb | [] | no_license | pittcat/Algorithm_Practice | 475e97e9dc91777a8826d1e886c302e0dd1b7567 | 9bd2d706f014ce84356ba38fc7801da0285a91d3 | refs/heads/master | 2020-04-03T20:33:10.349859 | 2018-11-26T21:20:38 | 2018-11-26T21:20:38 | 155,548,668 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,152 | py | reverse-int-7.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Output: 21
Note:
Assume we are dealing with an environment which could only store integers within the 32-bit sign... |
29fdf144ad73b4d515ac89edc1d66a90fdeb41ca | e6a86d37b51ea424b7ecb76c2fac436bf225ad65 | /test.py | e3bd797ef6c73707529c5858f3cc13975252f85e | [] | no_license | kevinxia787/Emily | 84f464b019122b4003e4f0af4a92905d983232ce | d4db9923a17f7270cd1d864bda7f6bf307423c88 | refs/heads/master | 2022-12-21T15:48:57.241118 | 2018-01-21T01:25:11 | 2018-01-21T01:25:11 | 116,312,827 | 1 | 0 | null | 2022-11-22T01:52:01 | 2018-01-04T22:13:44 | Python | UTF-8 | Python | false | false | 160 | py | test.py | import datetime
now = datetime.datetime.utcnow()
print(type(now))
maxN = now.replace(hour=0, minute=0, second=0)
maxN = now.replace(day=now.day+1)
print(now)
|
7c8273c390c2393f70855b9e81f161b33de828f4 | 08706f4718154466512698a3e49c3ce469518718 | /web2/class/test_movie.py | 0dc2a673d52a7ff960572c2b73aa918cd4f4c3dd | [] | no_license | harleyng/nguyenlethanhha-webmodule-c4e24 | 479ae2f51d779fe7c7fb59de139c73b3055d4aea | 08ea561a4534cd4aa3c0a83587fe44032406f955 | refs/heads/master | 2020-04-14T03:35:46.673268 | 2019-01-15T04:40:47 | 2019-01-15T04:40:47 | 163,611,754 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 679 | py | test_movie.py | # 1. connect to databas
import mlab
from mongoengine import Document, StringField, IntField
mlab.connect()
# 2. define model
class Movie(Document):
title = StringField()
image = StringField()
link = StringField()
rate = IntField()
movie_list = Movie.objects(rate__gte=7, title_icontains="Aquaman")... |
cf4d2386721a6c5ca0db2cc278db38c911352850 | 2bf1dd03d0fba03e3accff4e2d896c484e49e9d5 | /rocketstore/orders/migrations/0001_initial.py | 5bd23ff7e0a2922f7ccf0e227d5f0611bb6beeaf | [] | no_license | andreynorvatov/rocket_store | 479ebcf57ac06ab208706178a3c3e04c311d5698 | e677fdf74ef44d779643525a0b47afc67984b92a | refs/heads/main | 2023-04-11T00:31:40.938113 | 2023-04-08T08:00:34 | 2023-04-08T08:00:34 | 358,319,698 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,688 | py | 0001_initial.py | # Generated by Django 3.1.7 on 2021-04-11 15:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('shop', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Orde... |
2f1e5a75ad6cb82ccfc71bfb5cc554b4a98c0bb9 | dd765af928341acab35d21632deaa3278f3f92be | /test/test_csv_format.py | c9d32758d9f4a445ac0abcd3c864f5fb305eb673 | [] | no_license | mikebird28/pjrdb | 102f4144e9e43f23d0c0b07c69014368aabce570 | e75e114e158af147348127ad19f571489f948691 | refs/heads/master | 2020-04-09T04:55:52.120038 | 2018-12-02T13:23:39 | 2018-12-02T13:23:39 | 160,043,734 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 640 | py | test_csv_format.py | import unittest
from pjrdb import csv_format
class TestCsvFormat(unittest.TestCase):
def test_format(self):
pairs = [
("horse_result","formats/horse_result.csv"),
("basic_info","formats/basic_info.csv"),
("horse_info","formats/horse_info.csv"),
("race_info"... |
0947fa0a30ebece01dc625e0c63d90245a65beac | d9ba86ecaa0e37923909df851742a03ffc8aa16b | /python/Advance/File/CodeFileCreater.py | ef66b650b3da3814728223f5e00a1264c085f851 | [
"Unlicense"
] | permissive | itzsoumyadip/study-repo- | 2257b0b2f92b2db87fb69c8b5e7e2f66dda04e09 | acf32cd0bacb26e62854060e0acf5eb41b7a68c8 | refs/heads/master | 2022-12-13T09:52:36.520534 | 2020-09-27T08:03:53 | 2020-09-27T08:03:53 | 192,583,911 | 4 | 0 | Unlicense | 2022-12-13T09:16:05 | 2019-06-18T17:21:59 | HTML | UTF-8 | Python | false | false | 262 | py | CodeFileCreater.py |
comments="# code start from here "
def create_code_File(filename=""):
with open(filename, 'w') as timedate:
timedate.write(comments)
print("File created")
fname=str(input("Enter your code files name with extension"))
create_code_File(fname.strip()) |
00c0939fb207617f4947c191a93bc1f7bf5c93e6 | ff33fdc95e43f00f3bfeab883a3e3dc6d4e9f50d | /4-1/WIndow Programing/20180328/ex1.py | 4ac2507490af544995ca4c8888b848e6f1b6ed96 | [
"Apache-2.0"
] | permissive | define16/Class | e2da95b744e2be8fc40342d127f0f401787b9a6f | 8b0771a348b2bcb19ba338ebff94326828a293ea | refs/heads/master | 2021-06-27T20:08:05.578408 | 2019-09-08T15:49:57 | 2019-09-08T15:49:57 | 148,975,197 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 259 | py | ex1.py |
aa = [0,0,0,0];
hap = 0;
aa[0] = int(input("1번째 숫자 : "));
aa[1] = int(input("1번째 숫자 : "));
aa[2] = int(input("1번째 숫자 : "));
aa[3] = int(input("1번째 숫자 : "));
hap = aa[0] + aa[1] + aa[2] + aa[3];
print("합계 ==> %d" % hap); |
e801649033157712bf67c10269e73b817713956d | 38abe3668d5c4fd459b7e2839bf1f38f65d60b34 | /upload_locally.py | b4e927745fb8c3b0756e7aa2edfd3dd9caffd448 | [] | no_license | Hong-Deokgi/Flask_test | 8315fd475ecaffeb7c8a55ee8c597bcdc6921f77 | 21eb82166f7103c1ecbf154f80b36022777a0574 | refs/heads/master | 2020-06-18T04:51:24.238366 | 2019-07-10T09:00:02 | 2019-07-10T09:00:02 | 196,169,705 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 878 | py | upload_locally.py | from flask import Flask, request
from flask_pymongo import PyMongo
app = Flask(__name__, upload_folder="/Users/xi/Desktop/images", static_folder="images")
app.config['MONGO_URI'] = 'mongodb://localhost:27017/localTest'
mongo = PyMongo(app)
@app.route('/')
def index():
return '''
<form method="POST" actio... |
b32f923a73d884edc03d1b48f16de01a2478b51d | 1578ce8cc9d5d2af4500fadd3d6cabf42e3389fc | /dict_merge.py | 525ac8c0441e70ef5618e0f4e77e69e10d4501c5 | [] | no_license | Man0j-kumar/python | 28bb0291a39c90bcaeab73fc46c6973ac91f6255 | 43e9e8ce2b90c2b8f9318ea4724d23786ac46629 | refs/heads/master | 2020-06-28T09:38:07.618541 | 2019-08-16T10:26:06 | 2019-08-16T10:26:06 | 200,201,198 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 62 | py | dict_merge.py | d1={'a':1,'b':2}
d2={'c':3,'d':4}
d2.update(d1)
print(d2)
|
f85030805db41e0205f587a38ed05af6185ea763 | 67c4ea16936e50d3a2758305787ff7d570db7544 | /.c9/metadata/environment/home/urls.py | d29014700bcf0437332d014e7c469edab875f134 | [] | no_license | dennyshow/myauction | c12089f057a0c9ac88afef5444bb2d19c81d4d9d | cc0c12b17543bdedc4aacd45534e7336a0307ffb | refs/heads/master | 2020-09-14T11:34:49.028982 | 2019-11-26T13:32:29 | 2019-11-26T13:32:29 | 223,117,407 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,531 | py | urls.py | {"filter":false,"title":"urls.py","tooltip":"/home/urls.py","undoManager":{"mark":7,"position":7,"stack":[[{"start":{"row":1,"column":5},"end":{"row":1,"column":6},"action":"insert","lines":["h"],"id":42},{"start":{"row":1,"column":6},"end":{"row":1,"column":7},"action":"insert","lines":["o"]},{"start":{"row":1,"column... |
8bea061eab30ab0da4885134ebbefc624dd48cce | cfe948cf97ae1b17f466ebdf3a45583ae75d7ce1 | /1alg.lab.py | 85b1340da42120c166183e468845db39c9f16a32 | [] | no_license | Ilya18322/Algoritmss | 3bd9f94778509649703aea2fdf968d8a0b5b9252 | 0034658bbc46b76fbe64bd774b413bbb689b6e85 | refs/heads/master | 2022-11-14T01:33:55.068011 | 2020-06-24T18:24:33 | 2020-06-24T18:24:33 | 256,006,508 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 298 | py | 1alg.lab.py |
import math
def z1(a):
return 1 - 1/4 * (math.sin(2 * a) * math.sin(2 * a)) + math.cos(2 * a)
def z2(a):
return (math.cos(a) * math.cos(a)) + (math.cos(a) * math.cos(a) * math.cos(a) * math.cos(a))
a = float(input("Ввидите значение a = "))
print (z1(a),z2(a)) |
21af089ce276128d312b112c1dc1dd0065163d89 | 73fbea240b10d5a88f547a9de0bda956eda01dc8 | /tf2/resnet_acnn_test_trials_tf2.py | 5e8339d7e18f91edde45e47371071be295e0e629 | [] | no_license | btekgit/AdaptiveCNN | c47845da23c2db66505ccc4811f6ee96aefb00d7 | 463e3f70f1df331d55e67bfcb64a3a82da661069 | refs/heads/master | 2023-01-29T08:43:29.427879 | 2020-12-12T13:15:18 | 2020-12-12T13:15:18 | 192,106,228 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 16,949 | py | resnet_acnn_test_trials_tf2.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 3 15:57:27 2019
@author: btek
"""
from __future__ import print_function
import os
if 'CUDA_VISIBLE_DEVICES' not in os.environ.keys():
os.environ['CUDA_VISIBLE_DEVICES']="0"
os.environ['TF_FORCE_GPU_ALLOW_GROWTH']="true"
import tensorflow ... |
b3890cfb1f6149e1b223d8c1d58c9486cb3944d4 | b16312e3660cbc9b7d95998cdefd9daff35c1bce | /django_app/gymsearch/admin.py | 9e1deb9bb5d23a301ddcd30c14e2b41701dec813 | [
"Apache-2.0"
] | permissive | SpirosChadoulos/t2t | a8c670cdba31fb9e6394735975e74d8bed5cf3bc | 87b6ca45aa7e9ca627eaac304107d75c9571b1a9 | refs/heads/master | 2021-09-05T06:34:38.988486 | 2018-01-24T21:15:00 | 2018-01-24T21:15:00 | 118,814,850 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 122 | py | admin.py | from django.contrib import admin
from .models import Gym, Comment
admin.site.register(Gym)
admin.site.register(Comment)
|
e46e02f03a4241eba506f29275b2f900b7b3e83e | b3d6255659422f865aacbb6b2e66c9cfbb23663d | /account/admin.py | 79a697c92255274e16f8b704e96684de3e7e490a | [] | no_license | littmus/django-board | 690a2a2537742eedd5f1f7c2f89c46b48abf7350 | 7af3be2f68231a02afca7bf6e54e8817571dcb6f | refs/heads/master | 2021-01-22T07:03:07.919104 | 2014-07-31T07:05:05 | 2014-07-31T07:05:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 352 | py | admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
class ProfileInline(admin.StackedInline):
model = User
fk_name = 'user'
max_num = 1
#class CustomUserAdmin(UserAdmin):
# inlines = [ProfileInline,]
#admin.site... |
9044cc8ef5d4d1682512de2e9ec495746b5ffd78 | 3547dccb6e39e3f7ad094ac1ee1354917ce90065 | /mysite/urls.py | 7f9694b18e933972e54be3950e93434616572ce8 | [] | no_license | JasonZhao86/mysite | c33fe176234b711b5cfd2df9982570f277e9b577 | 731b3682feb8b3eedc632241707c3c6903143c3e | refs/heads/master | 2021-03-21T08:39:45.557420 | 2020-03-14T13:17:51 | 2020-03-14T13:17:51 | 247,279,478 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,363 | py | urls.py | """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... |
f3991b6f3b9dda1a7908f26ff007d1e25eb266eb | adbc2b8cd9c6c980580be92f82dbfdb985d54576 | /slack2doc/google_client.py | 954ff549d2354fd022e0b9cc906b13392cb71cca | [] | no_license | brianschubert/Slack2Doc-Scribe | dce0dd8c29954e5bb2dc6b350147adba54c45311 | 3798ed503f20f5693741f3d1c5fc86defdbfdc8d | refs/heads/master | 2023-07-22T16:12:27.843950 | 2019-10-23T00:07:52 | 2019-10-23T00:07:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,886 | py | google_client.py | """
Interface for writing Slack message updates to a Google Sheet.
"""
import logging
import os
from collections import defaultdict
from datetime import datetime
from enum import Enum, unique
from typing import DefaultDict, List
import gspread
import pytz
from oauth2client.service_account import ServiceAccountCredenti... |
9aba1437bdaff3ea4c11ace0040cc3c4c7a4b9ab | 0432fbdf7c27d478d3ac0e81a7f7e9f3a0836d89 | /Python_data analysis/实验三/源程序/第一题.py | 356e3209c3bb13f2c08eb4f60470830a85193162 | [] | no_license | wuyu-olivia/wuyu-olivia.github.io | eb65acb142a52569aa2191e9dc8989c33c7fd2e2 | cc675b4684b24648d282ea109ffa639dfa7c5a12 | refs/heads/main | 2023-07-24T10:17:01.734754 | 2021-09-10T10:47:52 | 2021-09-10T10:47:52 | 404,712,829 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 829 | py | 第一题.py | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 18 17:40:25 2020
@author: wuyu
"""
'''编写程序。先生成一个密码(允许含有数字与字母),再要求用户从键盘输入密码,
用户只有三次输入错误密码的机会。'''
import random
import string
def function():
print('生成密码:(8位)')
ran_str = ''.join(random.sample(string.ascii_letters + string.digits, 8))
print(ran_... |
04341a7f13f05dadf43c8a931767e28fd3728dd6 | ab983fd52c2c895d8d0aca61cd3200c00b596a27 | /coldcore | 78abe920f22738c1f0198cf1b798ff8d8b6c6503 | [
"MIT"
] | permissive | casey/coldcore | e60e705cfc73d5c163afaf132253d314ace9d9a6 | ee352558bbe63ef06b017a170c8f94831bf4180b | refs/heads/master | 2023-03-28T07:42:31.809336 | 2021-03-18T17:42:51 | 2021-03-18T17:42:51 | 351,585,312 | 0 | 0 | MIT | 2021-03-25T21:51:54 | 2021-03-25T21:51:53 | null | UTF-8 | Python | false | false | 99,561 | coldcore | #!/usr/bin/env python3
"""
_ _
___ ___| |_| |___ ___ ___ ___
| _| . | | . | _| . | _| -_|
|___|___|_|___|___|___|_| |___|
a trust minimized Bitcoin wallet interface
# TODO
- [ ] add wallet name
- [ ] add version birthday to new config
- [ ] allow manual coin selection when sending
- [ ] address lab... | |
488f95d5e55db86fdc2eb3a5269439bc03bfbe3a | 1442f3fd57e70d467e3e36fcfa61e06f14e86717 | /true_false.py | 649656ce3494f21e7a5474c03f416feaceca0881 | [] | no_license | vlad-zankevich/LearningPython | 2235edd7757873e2c8090931231b1599ff7f3a81 | f233e676e701b6739dfd648cbaff3b04569af776 | refs/heads/master | 2021-09-09T19:30:51.359067 | 2018-03-19T08:37:36 | 2018-03-19T08:37:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 276 | py | true_false.py | def run():
# This module contains how Boolean operators work
car = 'subaru'
print("Is car == 'subaru'? I predict True.")
print(car == 'subaru')
print("\nIs car == 'audi'? I predict False.")
print(car == 'audi')
if __name__ == "__main__":
run()
|
5d06d7cb75de449dcc9ca8eee8a839b92b7a55d3 | 79364c20d3fa7e0d02f099a408b56d43726fb748 | /deal/app/migrations/0061_auto_20210221_2034.py | 7afda7988f96d53693984b906099d28c29a487bb | [] | no_license | sudheesh85/dealapp | bffb6f6d9b35305b34a313f2a6388dd855678b92 | 22c4555f21df1a74fefe6a7379db74dacba20883 | refs/heads/master | 2023-05-02T04:34:39.308198 | 2021-05-31T06:05:24 | 2021-05-31T06:05:24 | 294,015,429 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,033 | py | 0061_auto_20210221_2034.py | # Generated by Django 3.1.2 on 2021-02-21 20:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0060_auto_20210221_1810'),
]
operations = [
migrations.AlterField(
model_name='vendor',
name='vendor_img2',
... |
3ca71683ff14d9dfb27a0017fde89a5bc7de12d7 | 63d0e4df6913ae7c7cedd8d72b074273d934c204 | /src/domainconfs/aids.py | 2ed16a83192c7e76496fc97354113e21bbd05dd0 | [] | no_license | karanbudhraja/PABMD | d8622289ebb1dd6fff60be22034d7633dd9bcad5 | 29982bef9fbd89e05404adfa1afe15c7a5ccd350 | refs/heads/master | 2020-06-14T17:50:29.006765 | 2019-07-15T21:12:47 | 2019-07-15T21:12:47 | 195,070,897 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 157 | py | aids.py | TRAINING_SIZE = 300
VALIDATION_SIZE = 1000
RM_GRANULARITY = 55
REGRESSION = "sklearn.neighbors.KNeighborsRegressor()"
NUM_INDEPENDENT = 2
NUM_DEPENDENT = 2
|
f00b325a4da150bb764a1e87289441a3e4c35078 | 7caf0ef2c08ff664ce0794966996bf42733459f4 | /smartsheetbulkedit/smartsheet/systemcolumntype.py | bf2ef86c14a1bfe2a48f9a2ef69e6328b0fce214 | [
"MIT"
] | permissive | cheneric/smartsheetbulkedit | b8c9abada9f466517301db7a1c9a08b7e0dfb6ac | 0a1f83c927239b40c84c983eab6c0f508041bfed | refs/heads/master | 2021-01-19T06:25:19.976059 | 2015-07-15T05:55:21 | 2015-07-15T05:55:21 | 38,907,805 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 215 | py | systemcolumntype.py | class SystemColumnType:
""" Valid Smartsheet system column types. """
autoNumber = "AUTO_NUMBER"
createdBy = "CREATED_BY"
createdDate = "CREATED_DATE"
modifiedBy = "MODIFIED_BY"
modifiedDate = "MODIFIED_DATE"
|
cc211e2ac81c0d1eef7a0504d9e24e9503644805 | 3ca9ca57afc5ca547566ec042b2e0cf344254740 | /OS_Independant_Admin-CG5-RunSession-LVL1-160428-VVD-0.1.sikuli/OS_Independant_Admin-CG5-RunSession-LVL1-160428-VVD-0.1.py | fb0bd1adcf943b9c1a9ca5264757df3b6166f234 | [] | no_license | vincent-tygron/Scripts | 8d99763b662ef82c6c6a96889c247b84da605f80 | 2a01f5f94b7dd6ee6a74fe223f43c266e83f05d1 | refs/heads/master | 2020-12-24T07:59:44.331880 | 2016-08-25T07:37:13 | 2016-08-25T08:03:08 | 57,968,773 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,249 | py | OS_Independant_Admin-CG5-RunSession-LVL1-160428-VVD-0.1.py | import logging; reload(logging)
FORMAT=("%(asctime) -8s %(message) s")
logging.basicConfig(format=FORMAT, filename="testLog.txt", level=logging.DEBUG)
logging.info("[info] Admin runs session LVL1...")
if Settings.isLinux() or Settings.isWindows():
if exists("Admin-CG5-Team1-MessageIcon2-160428-VVD-0.1.png", 60):
... |
d5c8821a8685f0ab690b4f419c9916decf2e8b83 | 4c76c88f6421abb52a9e68ae48d33f32b0fcf5af | /traffic/dao.py | 34690a3b2ea9ec456d7113abe5577c306f76ced1 | [
"Apache-2.0"
] | permissive | aperturetechnology/starthinker | 76ba1d8883dbcf32eff4164f57f4342d0b912b70 | fd2d70e39f05cb29afc65b8a78ea38441e1e2b9a | refs/heads/master | 2020-04-09T22:19:14.752457 | 2018-11-27T13:52:49 | 2018-11-27T13:52:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,501 | py | dao.py | ###########################################################################
#
# Copyright 2017 Google 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
#
# https://www.apache.org/... |
b08ac27d115fc8b1b10b873837182dbfd792ea78 | 4e4b4f8cbe32f56ec4d91332c7cb65d60baeb0eb | /leetcode_85.py | 324968a84fc467c52d5469d20ccceb9b027daa1e | [] | no_license | jodiezhu/leetcode_algo | e8edb692ab45ce0eb5cf926f818fb23ff0820037 | 57b84d77b7b601eb45b5fefbd8a31c0952ea9f78 | refs/heads/master | 2021-08-18T21:27:18.101545 | 2017-11-23T23:08:46 | 2017-11-23T23:08:46 | 105,473,571 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,041 | py | leetcode_85.py | class Solution(object):
def maxrect(self,matrix):
if not matrix or len(matrix)==0 or len(matrix[0])==0:
return 0
row=len(matrix)
col=len(matrix[0])
max_area=0
heights=[0]*col
for i in range(row):
for j in range(col):
if matrix[... |
0a9f3f8774f179a341776758fc18c3e8d4d14a2d | f557870a8524fbca3b355f0505c245e672ea9e28 | /rural_norte/core/forms.py | 5945b7c5e91a9ee9168abc740ae545a4eb3ed6f0 | [] | no_license | Alquimar/RuralNorte | 89484249fbedeaec75e0a3899bb8158e191f19ca | a2ed465794155eb6e74635402844eb2bc7a1b9ae | refs/heads/master | 2021-07-15T21:08:01.686262 | 2018-09-26T01:13:35 | 2018-09-26T01:13:35 | 131,191,392 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 60,768 | py | forms.py | from django import forms
from . import models
class ContatoForm(forms.ModelForm):
class Meta:
model = models.Contato
fields = '__all__'
ContatoFormSet = forms.modelformset_factory(
models.Contato,
form=ContatoForm,
extra=0
)
ContatoInlineFormSet = forms.inlineformset_factory(
mode... |
f5aa651e2e06465604ebcebc89cd11fe1dc500c6 | 523716812894908711cfc31cd781a7ab239389b7 | /lpthw/FizzBuzz1.py | 0ade510542d50012f954a55f87a956c1d0e82c0f | [
"MIT"
] | permissive | seesiva/ML | a6b94e07571dddd42d53a9c1bcb01a14d8b9891c | ba87803cd0bb9e4f48932927cd2da53dc8db5433 | refs/heads/master | 2021-10-01T17:59:56.700809 | 2018-11-28T00:39:57 | 2018-11-28T00:39:57 | 115,467,161 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 427 | py | FizzBuzz1.py | """
Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". (Thanks to Jeff Atwood)
"""
for num in range(1,100):
print num
if num%15==... |
4343002e37f4027d1c1d0c4e1d2effdced816310 | 82202384f2ea55b3a8a49125700b4d2f1fdb0921 | /ml06pyPackeg/pk13pytorch/03systemFunctions/nn.Unfold.py | 9af15ccf1e3409c562a5d1778b2f86b170ca7194 | [] | no_license | LittleSheepy/MyMLStudy | 86846a0181b0a70ad8fe55b7ab0bba74047e802f | e1ccdd7d7551f9c54259877e1ed0cd4d0a6e173f | refs/heads/master | 2023-08-18T02:37:00.255666 | 2023-08-12T14:07:32 | 2023-08-12T14:07:32 | 146,740,737 | 5 | 0 | null | 2023-06-27T10:21:56 | 2018-08-30T11:36:58 | Jupyter Notebook | UTF-8 | Python | false | false | 837 | py | nn.Unfold.py | import torch
import torch.nn as nn
inp = torch.tensor([[[[1.0, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18],
[19, 20, 21, 22, 23, 24],
[25, 26, 27, 28, 29, 30],
[31, 32, 33, 34, 35, 36],
... |
eb631f786f8abee33a5c41e35dafa64732c08141 | 568345ee64e3e283a916af372a40b34b595d6ff3 | /third_party/Python/module/pexpect-2.4/examples/sshls.py | 8e4909ac48c8555a785ce33b4401f73c820de750 | [
"NCSA",
"Apache-2.0",
"LLVM-exception",
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | enterstudio/swift-lldb | b16fb3f067da3933af0fb1024630f7066b38a7ef | af85d636d230da2460f91938b1ff734b0fb64b42 | refs/heads/stable | 2020-04-27T01:43:35.935989 | 2019-03-05T01:43:09 | 2019-03-05T01:43:09 | 173,973,645 | 2 | 0 | Apache-2.0 | 2019-03-05T15:37:31 | 2019-03-05T15:37:26 | null | UTF-8 | Python | false | false | 1,797 | py | sshls.py | #!/usr/bin/env python
"""This runs 'ls -l' on a remote host using SSH. At the prompts enter hostname,
user, and password.
$Id: sshls.py 489 2007-11-28 23:40:34Z noah $
"""
import pexpect
import getpass
import os
def ssh_command(user, host, password, command):
"""This runs a command on the remote host. This cou... |
9195c5c531a09c00b2de598bf578032e02dc20b4 | e81fa582e9449ba0876a62cb0088d212021a50d0 | /paper_scissors_rock/tests.py | 13ae9e3fb02a74816b515b6d76a32eec7c383ef7 | [] | no_license | sstollenwerk/learn-game-write | 70d2e798b6bddc808694a17970dbe25b659794f0 | 32c7bc7a9f75dd1767fa796298e760e58ad055c1 | refs/heads/main | 2023-04-16T02:30:11.229450 | 2021-04-25T01:49:07 | 2021-04-25T01:49:07 | 361,299,133 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 449 | py | tests.py | from hypothesis import given
import hypothesis.strategies as st
import game
move = st.sampled_from(game.Move)
def test_basic():
assert game._round(game.Move.PAPER, game.Move.SCISSORS) == False
assert game._round(game.Move.SCISSORS, game.Move.SCISSORS) == None
assert game._round(game.Move.PAPER, game.Mov... |
5a10afbf88a6940f6df73c7caacdb4de2b8bca67 | 4cb1fd4f6f4a8e57ca3d222007c1a5cde3deebfe | /Chapter19/19_3_maxinet_emulation.py | 04efec04b81c91a91ceb8d4a9a0a75bee3229f83 | [
"MIT"
] | permissive | PacktPublishing/Python-Network-Programming | 838097e82762fed54fbc2abffe4db71d5acd350b | 416cea10fe56b2312cf25150ed7ba27837cddf18 | refs/heads/master | 2023-02-11T00:34:43.611524 | 2023-01-30T08:58:32 | 2023-01-30T08:58:32 | 166,771,428 | 52 | 51 | null | null | null | null | UTF-8 | Python | false | false | 1,286 | py | 19_3_maxinet_emulation.py | #!/usr/bin/env python
# Python Network Programming Cookbook, Second Edition -- Chapter - 9
# This program is optimized for Python 2.7.12.
# It may run on any other version with/without modifications.
import sys
import maxinet
from mininet.topolib import TreeTopo
# Emulate a network with depth of depth_ and fanout of ... |
4b3ca18089912954eac6374806c25ede5c6bcec5 | b779669a40feb3b9fd3079412c381d2104e60087 | /setup.py | 40a9913b13f01d9f77691cf2697ac0ba03c8e8e4 | [
"MIT"
] | permissive | lijie96/auk | 9cbb472b79914529d31ddf5bc0d44295997077d1 | 17784dff8714ea9152e1c64df5cbad563b155e78 | refs/heads/master | 2020-05-06T15:21:39.686533 | 2018-07-29T12:48:55 | 2018-07-29T12:48:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 880 | py | setup.py | from setuptools import setup
setup(
name = 'auk',
version = '0.1.1',
license = 'MIT',
requires = ['python (>= 3.4)'],
provides = ['auk'],
description = 'Micro-package for compiling s-expressions into Python\'s predicate functions' ,
url ... |
d4a4b0f8f2053c88f1760f56894bf347039b6185 | 00be5339e665f15053a6054f228375c9b4636d03 | /lswifi/appsetup.py | 6a54ed6d06f49d4a16bd3dee9cf882086d872329 | [
"BSD-3-Clause"
] | permissive | jrajappa/lswifi | bbf21f694fe3d4eb6c7da35a9266cfca62ae5cf4 | f570958075c22661082ffb18d8410cd70515c435 | refs/heads/main | 2023-02-10T16:09:10.565610 | 2021-01-05T03:14:40 | 2021-01-05T03:22:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,125 | py | appsetup.py | # -*- coding: utf-8 -*-
"""
lswifi.appsetup
~~~~~~~~~~~~~~
Provides init functions that are used to help set up the app.
"""
import argparse
import logging
import logging.config
import textwrap
from .__version__ import __version__
class ExportAction(argparse.Action):
def __call__(self, parser, namespace, valu... |
191dc3c55e07b6fc2550d601866780602df3d9ed | 915039d761296584928479e3f6f47a94c00f8277 | /armory/dbpr.py | 8e8ab07d360f52ae09180f9c76ee1d43f71425eb | [] | no_license | ajdevaux/rosalind | e6d8a91cf081c36f1f7f170c3eb295aedd55e636 | ef668b3b3e687a490931cc3695ce88b28b94eb58 | refs/heads/master | 2020-09-30T03:42:11.524264 | 2019-12-10T19:01:47 | 2019-12-10T19:01:47 | 227,194,477 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 420 | py | dbpr.py | import requests
import re
query_list = ['Q08DA1']
for query in query_list:
params = {'query':query, 'format':'tab', 'columns':'go'}
uniprot_resp = requests.get("https://www.uniprot.org/uniprot/", params=params)
data = uniprot_resp.text
list_data = re.split(r"[\n;]", data)
for val in list_data:
s... |
73824b3aabf735537c53c6057de3f65ec48456fa | aa8d330fb8bba0bff9ffb3388e163987addd20a0 | /docker-mongo-kafka-spark/producer_twitter_user.py | 85db7ea873278238f6b6cc891221ce6f401cc6c4 | [] | no_license | hafid75/streaming_Kafka-binance-twitter | d527eb4fe0c09f2d06762d12da1433ab8202966b | e993e35d53aa906c5802a3407c233b3c3995ee20 | refs/heads/main | 2023-07-07T05:44:59.517487 | 2021-08-01T21:42:29 | 2021-08-01T21:42:29 | 344,825,218 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,881 | py | producer_twitter_user.py | from kafka import KafkaProducer
import json
import numpy as np
import time
import requests
import tweepy
p = KafkaProducer(bootstrap_servers=['localhost:9092'])
consumer_key = 'XXXXXXX'
consumer_secret = 'XXXXXX'
access_token = 'XXXXXX'
access_token_secret = 'XXXXXX'
authentification = tweepy.OAuthHandler(consumer_... |
a10665366b415d9f057bc6d273f0c2203abd0844 | 79f5c059d0766a36d60d926ce6627a51f690e130 | /ddos-attack.py | b8ab5ddf66a8ba79e2b04326ffcb83d2aeee62cc | [] | no_license | jamieduk/Auto_Attacker | 8f431180149ce8eec5a7ab95c206ed6c37597eab | 6df26271de5b9dee1f59ed2ac10ab9fed4cf7d27 | refs/heads/main | 2022-12-26T12:39:37.529623 | 2020-10-09T19:32:49 | 2020-10-09T19:32:49 | 302,735,426 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,110 | py | ddos-attack.py | import sys
import os
import time
import socket
import random
#Code Time
from datetime import datetime
now=datetime.now()
hour=now.hour
minute=now.minute
day=now.day
month=now.month
year=now.year
##############
sock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
bytes=random._urandom(1490)
#############
os.system("c... |
04dbceafc193dea7edbe1469f7172d1533e60554 | a49dcb00fdbc45bb6aaeecd741302d3ed907bf6b | /helper/sinoptik_city_id_scanner.py | 2f72e187d9a2e6525cecfaaa75d066c818fdc282 | [] | no_license | yperevera/sinoptik_ua | 6342c0ddffcf73121c508ed548302f626763edc5 | 9c88e7ed6b316feee17bda340194c7059534600c | refs/heads/master | 2021-05-12T06:30:50.384145 | 2018-01-15T19:04:30 | 2018-01-15T19:04:30 | 117,220,581 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 13,734 | py | sinoptik_city_id_scanner.py | from selenium.webdriver import Chrome
from time import sleep
import sqlite3
import os
import ast
import logging
# ---- logs config ----------- #
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# create a file handler
handler = logging.FileHandler('sinoptik_parser.log', 'w')
handler.setLe... |
f6d30552b81b92ed684fba22cfa35225e1f7040d | 905c450d012434f79274f982e9b664a5f2dfd48a | /profileView.py | 552daea67e067e58bd21e6bdb6ff00d73e68ffba | [] | no_license | Hm20-ops/health-tracker-group-20-desktop | 68112cdb06fcf77c361381197000b671360d711f | 5f3d6bb15215167ced51bcdf61d473a400a1c8e4 | refs/heads/master | 2023-01-11T17:33:17.445987 | 2020-11-16T21:04:22 | 2020-11-16T21:04:22 | 313,425,344 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,228 | py | profileView.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'profile.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Profile(object):
def __init__(self, parent, user_data=()):
self.se... |
366eec442dc4708163a05123bca7ce48c91c4dbd | 8e89e7c769af3129fd299be41093de6df1b981b3 | /unit_tests/test_swift_context.py | da83e39fd8de1f35875c93dbb40b3c63be142bef | [
"Apache-2.0"
] | permissive | openstack/charm-swift-proxy | 360102f2338c69e4abde3bc050bfffb57257fdd8 | fb1a1bbcf787ed89fcd6684d456da63aaf48822d | refs/heads/master | 2023-08-23T05:21:17.867561 | 2023-08-04T16:31:16 | 2023-08-04T17:49:29 | 52,858,929 | 17 | 14 | null | 2018-07-18T20:57:58 | 2016-03-01T07:57:22 | Python | UTF-8 | Python | false | false | 9,664 | py | test_swift_context.py | # Copyright 2016 Canonical Ltd
#
# 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 writing, s... |
760ae57918a003ccb93bf5c4a7cde1db11dee3f1 | 7b13b23b6de710a58dfc169c5bb0405a377784df | /migrations/schematic_settings.py | e9a6fe76eae3a02eb4dbca96728cbeaaf7643a02 | [
"Apache-2.0"
] | permissive | Happy-Ferret/jstestnet | ec0d1c4809e9b2a82d10ea9177c351ed39d82e08 | 48f6022ea379e22b768d6197218ba9ce62a8ee10 | refs/heads/master | 2020-12-28T10:34:17.788959 | 2014-03-07T16:01:16 | 2014-03-07T16:01:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 445 | py | schematic_settings.py | import os
import sys
sys.path.append(os.getcwd()) # add project root, to import settings_local
# For database migrations
import settings_local as settings
db = "mysql --silent -u %s -p'%s' -D %s" % (
settings.DATABASES['default']['USER'],
settings.DATAB... |
252255846e405d997e31d9a39e4bac352c401b99 | 7159d8ec0653f81acbd0d87d311cb2dba235eb0d | /resize.py | 4719aeda7ec5eed3c45c5a192f606e15344df177 | [] | no_license | RamanS11/SCAV_LAB2 | 114dcef9c4077b0ab12bae6a7d37bc8047aa6bff | 1c903983928d7ff0dfd26af02d3ff8465697c46d | refs/heads/main | 2023-01-22T23:53:39.749815 | 2020-12-06T16:38:26 | 2020-12-06T16:38:26 | 316,273,888 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,732 | py | resize.py | import os
def compute(quality, in_file, out_file):
# Compute the command that changes the quality.
os.system(" ffmpeg -i " + in_file + " -filter:v scale=" + quality + ":-1 -c:a copy " + out_file + '.mp4')
def resize():
print("\nSelect the video you want to resize:")
# Create aux variables.
direc ... |
30167a869760119180f14f73ea1c26a2fad36a84 | db92a73094ebcdccd98aa2f94723a005b4f15115 | /additional/generator.py | 36779f33cfca61104f8d24a0bb7e809148eabc9e | [] | no_license | aakashkaji/PythonTutorial | 56ad33b31aafa4aaafb7a7e62d6f9af71830cd93 | 4e09cf6608c46f3153d170ce20a950f33f9ac174 | refs/heads/master | 2021-06-22T01:00:13.507817 | 2018-07-06T18:52:56 | 2020-11-24T03:17:47 | 140,000,810 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,114 | py | generator.py | ### python generators example here
def generator_exp():
for i in range(1,10):
yield i
x=generator_exp()
for a in x:
print(a)
#python generators are used in calculate large set of resource becoz they don't store any value
def fibon(n):
a=b=1
print('calling')
for i in range(n):
yield a
a,b=b,a+b
for x in fi... |
9f69deec8edf1210ca3de58e3f907c744c214bbc | dd4fdd906a95f6ec8710f1b57f9dd6035eefc61f | /daawat/views/feedback.py | 7e5d6f1722a96a8b8235b793afeb39b5633e467f | [] | no_license | Kingpins/Daawat | c3070d6f9afa2bedc75f26cce5914630abc52306 | 9fe07435ca1343c00330c3ff22f94fa2ab8c3f2d | refs/heads/main | 2023-06-28T14:28:21.624063 | 2021-08-03T13:11:38 | 2021-08-03T13:11:38 | 327,538,195 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 818 | py | feedback.py | from django.shortcuts import render , redirect, HttpResponse
from django.contrib import messages
from django.views import View
from daawat.service.astra_service import *
class Feedback(View):
def post(self , request):
pass
def get(self , request):
data = {}
feedbackLi... |
983a6057470b41432d76162aef6862371f04b084 | 7113c62d0a0d7b9a9384210d42d7671d37779e8c | /nurseApp/models.py | 64a727bc8f1105947393cba3fc02882cc8f5787a | [] | no_license | JorgeDom/SoftNatura_NurseApp | 3577ad438dd46d56a69ab13114986729583442df | 84ed5bdb76e0c46c3c9d3002a9daa4794b2bc2bb | refs/heads/master | 2023-05-10T10:56:01.405742 | 2020-05-20T18:07:33 | 2020-05-20T18:07:33 | 265,571,365 | 1 | 0 | null | 2021-06-10T22:56:10 | 2020-05-20T13:18:24 | JavaScript | UTF-8 | Python | false | false | 2,625 | py | models.py | from djongo import models
from django.core.validators import MaxValueValidator, RegexValidator
class Record(models.Model):
id_responsible = models.CharField(default='',
max_length=50,
blank=False)
id_patient = models.CharField(default... |
dc4a14821f0ac1a36099d7f307d8fac4b9d94fd6 | c1358ff781d3b33cc14ab6a8fbfed7c8b0f29fda | /implement/np_cnn.py | cae27a27a226b740eded08b3db3880f23bb830e3 | [] | no_license | WhpHenry/Fundamental_ML | 44102f31e6e508beb300a98a41a518ca5c31f070 | 60681f797ae4472cfc46b2f9d3617920fe5e8bf6 | refs/heads/master | 2020-03-19T13:08:11.080978 | 2018-06-16T10:42:07 | 2018-06-16T10:42:07 | 136,562,732 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,755 | py | np_cnn.py | # coding: utf-8
import sys
import skimage.data
import numpy as np
import matplotlib.pyplot as plt
def img_show(img, name=None):
fig , ax = plt.subplots(nrows=1, ncols=1)
ax.imshow(img).set_cmap("gray")
if name != None:
plt.savefig(name)
else:
plt.show()
plt.close(fig)
# each filt... |
8a7e4508c5b2ffeada254419f9bbbd3a23dad124 | fe3b12b2b7a003a7c4e92c84928a96925e0c7a1f | /itemcollector/main_app/migrations/0004_alter_plant_date_watered.py | a13b0ccc9fa24c1a4f02d7739adfda00e4c1d641 | [] | no_license | rohitgj169/item_collector | 2588dd90be2a06308f461ba51d508474336faa29 | 2de9e47456c9b618d025133074fd2b4ed42282bf | refs/heads/master | 2023-04-28T18:19:15.574232 | 2021-05-20T19:04:55 | 2021-05-20T19:04:55 | 367,464,371 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 402 | py | 0004_alter_plant_date_watered.py | # Generated by Django 3.2.3 on 2021-05-17 19:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main_app', '0003_plant_date_watered'),
]
operations = [
migrations.AlterField(
model_name='plant',
name='date_watere... |
386a32d34ec00108fd1cc4153bc4f05b54396608 | d8a7980d57532e4bf875bf77d5735aac48e712af | /Scripts/se_demo.py | 8bd1dc53b00644fb7cce9b230b14ebf635b457e4 | [] | no_license | mirc-dsi/pulseq-gpi | fe1c2a8ec7b763e0fc98a0885f623ad6e6cf232c | 2a93801b5a6c36140a3b14ec85c419e1c8ac60c0 | refs/heads/master | 2021-08-29T01:56:37.656152 | 2017-12-13T10:53:04 | 2017-12-13T10:53:04 | 113,945,544 | 6 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,729 | py | se_demo.py | """
This is starter code to demonstrate a working example of a Spin Echo as a pure Python implementation.
"""
from math import pi
from mr_gpi.Sequence.sequence import Sequence
from mr_gpi.calcduration import calcduration
from mr_gpi.makeadc import makeadc
from mr_gpi.makedelay import makedelay
from mr_gpi.makesinc imp... |
1ed0bc98b895db408f7c47242dbd4b898b9e0359 | 748c4ba7058336eb2d09b413066d21582e26d71b | /course_catalog/views.py | 0342c5e04bdefc569e1a605ffd6278b28e701850 | [
"BSD-3-Clause"
] | permissive | mitodl/open-discussions | 6dbb8ae2843263889634849ddd9096f74536b78e | ba7442482da97d463302658c0aac989567ee1241 | refs/heads/master | 2023-08-10T02:54:45.706067 | 2023-08-01T17:05:36 | 2023-08-01T17:05:36 | 93,760,926 | 13 | 3 | BSD-3-Clause | 2023-08-01T17:05:40 | 2017-06-08T14:46:35 | Python | UTF-8 | Python | false | false | 21,846 | py | views.py | """
course_catalog views
"""
import logging
import operator
from hmac import compare_digest
import rapidjson
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError
from django.db.models import Count, Prefetch, Q
from django.http import HttpRespo... |
694bc2a44a6029a7c9cf32ef0641b165fc7b777c | d0533b0574494b13606a557620f38f5a2c74ce16 | /vnpy/data/tushare_demo.py | eedcb0d926161fce834950601d6fd9bcbd3458a2 | [
"MIT"
] | permissive | CatTiger/vnpy | af889666464ab661fb30fdb0e8f71f94ba2d1e41 | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | refs/heads/master | 2020-09-26T00:37:54.123877 | 2020-07-13T10:15:46 | 2020-07-13T10:15:46 | 226,124,078 | 0 | 0 | MIT | 2020-04-21T03:02:20 | 2019-12-05T14:44:55 | C++ | UTF-8 | Python | false | false | 1,041 | py | tushare_demo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
import tushare as ts
import vnpy.trader.constant as const
from vnpy.trader.object import BarData
from vnpy.trader.database import database_manager
if __name__ == "__main__":
bars = []
pro = ts.pro_api('b730ba51af2da59c857f33c67a26e... |
36bde2954da5b7f2c80fe1a7246eb6ba16fe2a8b | 5c2f0d1fb3ab72691a9ed1ea94380ed6fd3b32ca | /pythonscripts/significance.py | a63a59ef9307fbccc81bff842897e1a8b3c8c2e7 | [] | no_license | andresgur/Python-Line-Significance-Scripts | 2b9787f5a1af8c0ca8de3cf9306ace3fcb196e67 | 7a5e4bd20897dfc6332e73e272b0a20de5eaf217 | refs/heads/master | 2021-06-26T09:07:55.497636 | 2020-09-15T15:08:27 | 2020-09-15T15:08:27 | 130,853,500 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,389 | py | significance.py | #Script to account for the significance of a certain line. The program asks for the delta C-stat of the line you want to study and two files:
# - the simple model: no line
# - the complex model: with line
#the program substracts the C-stats that finds in both files and finally plots the C-stat probabily distribution of... |
74af25b84a7dc96ba68138bfdaede7aabd3e7d18 | 9fea15e6ea43e7a18cf7a8395e720a70e081cbcc | /controllers/IndexController.py | 31ec66b3f58eed88c6e7e0e464bd2c0c37be30b2 | [] | no_license | scriptkid23/deploying-structure-flask-react | 9390587ee379a8b697e84fbf633674adcaab2d60 | b4f1a1df5859fc60ad4867a4f4cae6eac0860443 | refs/heads/master | 2021-08-10T08:45:48.684809 | 2020-09-13T15:25:52 | 2020-09-13T15:25:52 | 246,473,875 | 0 | 0 | null | 2021-03-20T05:00:39 | 2020-03-11T04:24:34 | Python | UTF-8 | Python | false | false | 966 | py | IndexController.py | from flask import Response, request
from flask_restful import Resource,reqparse
import json
from services.ScratchCardService import ScratchCardService
scratchCardService = ScratchCardService()
class AdminLoginController(Resource):
def post(self):
return None
class AwardController(Resource):
def get(s... |
5080b5380f6ecc3f5258c94edca2410f9f67877b | f3fab34ad1ccc055fce161dd7484821381e2b45c | /advancedclipboard.py | 1ccf862dba5abae2765ce0ecc98fcc2d45478ee8 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | David-Cosby/advanced-clipboard | d44900941a56cb1a6f2353797099e146efd3f3a0 | 981330df7bfc9499d49a8f9b1efd53cf1f1e584e | refs/heads/master | 2021-06-21T21:12:52.439819 | 2017-06-14T01:21:47 | 2017-06-14T01:21:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,958 | py | advancedclipboard.py | #! /usr/bin/python3
# DISCLAIMER #
# ADVANCED CLIPBOARD IS A MULTI-PLATFORM SOFTWARE DEVELOPED BY DAVID
# COSBY, A 15 YEAR OLD KID WHO HAS NO IDEA WHAT HE IS DOING.
# THE FOLLOWING CODE HAS SEVERAL EXAMPLES OF BAD PRACTICE, AND HURTS
# TO LOOK AT.
# BY DOWNLOADING THIS APPLICATION, YOU UNDERSTAND TH... |
8d1bb608729a222d0926454785844875ad725c5f | 422dd5d3c48a608b093cbfa92085e95a105a5752 | /students/wwhite/Lesson10/Lesson08.1/source/learnnosql.py | 1e7c639c939b3cdcfe68c051dcfd9c7ac7cae16b | [] | no_license | UWPCE-PythonCert-ClassRepos/SP_Online_Course2_2018 | a2052fdecd187d7dd6dbe6f1387b4f7341623e93 | b1fea0309b3495b3e1dc167d7029bc9e4b6f00f1 | refs/heads/master | 2021-06-07T09:06:21.100330 | 2019-11-08T23:42:42 | 2019-11-08T23:42:42 | 130,731,872 | 4 | 70 | null | 2021-06-01T22:29:19 | 2018-04-23T17:24:22 | Python | UTF-8 | Python | false | false | 1,319 | py | learnnosql.py | """
Integrated example for nosql databases
"""
import learn_data
import mongodb_script
import redis_script
import neo4j_script
import persistence_serialization
import simple_script
import utilities
def showoff_databases():
"""
Here we illustrate basic interaction with nosql databases
"""
log = uti... |
1edbe5cc70daf4e2606ac0c5f6c2def777fefb46 | 32618694e849fc479c6c01473fc6168679eb93c1 | /change.py | cb81e309edb65597118f01a2cf96caf9606fe51d | [] | no_license | guipleite/code-interview | 39b92684c1a4e04743a330018c43fcc8645359e6 | a06ed4507b74e38b4b12a26d10904361e231a8ee | refs/heads/master | 2023-03-06T13:24:13.963649 | 2021-02-17T01:51:01 | 2021-02-17T01:51:01 | 295,729,365 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 267 | py | change.py | def troca(n):
coins=[25, 10, 5, 1]
ans = []
for i in range(n+1):
ans.append(0)
ans[0] = 1
for coin in coins:
for curr in range(coin,n+1):
nval = curr - coin
ans[curr] += ans[nval]
return ans[-1]
|
f508294e23c511701012036cac7faaf41f34bedf | 51a7ce93f556c46af89e534c6b22dc08846600a5 | /examples/repo-cli.py | 529fd1edc90ab23317ee5c61e8462b3f4ae536d7 | [] | no_license | listenfield/listenfield-apis | b9371feed4276fea6121bfb4d436931cdf4cebea | 9a8fa439559c564ce81022dfd12808452606bc9f | refs/heads/master | 2021-09-10T10:38:43.239265 | 2018-03-24T16:32:28 | 2018-03-24T16:32:28 | 121,394,843 | 2 | 1 | null | 2018-03-03T14:41:50 | 2018-02-13T14:50:44 | Python | UTF-8 | Python | false | false | 12,450 | py | repo-cli.py | import argparse
import json
import sys
import time
# pip install grpcio-tools
import grpc
# pip install python-jose
try:
from jose import jwt, exceptions as jose
except:
jose = None
from uuid import uuid4
from listenfield_client import api
from listenfield_client.repo import common_rpc as common
from listenfield_... |
8a22e3e07401b26c2c2b44e5876e38c78e907b56 | 7bdcf4bedd8acf6539513cc7d1fbfe32fdd11a84 | /lib/__init__.py | a811bd372872554120c332abb962801b3fff626d | [
"MIT"
] | permissive | rdonato/DXMate | b99f3a54858b117b4ea8f79d4e0605ef5c44d501 | ffaedb295996c1b4ac8fab4c707944a9c42afd04 | refs/heads/master | 2020-06-01T18:40:17.791114 | 2017-09-20T22:56:46 | 2017-09-20T22:56:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 85 | py | __init__.py | from .util import util
from .event_hub import EventHub
_all_ = [
'util',
'EventHub'
] |
30ffc2de46afbb449a75b323ad286134e7ff5eb7 | bba5fba866d367a717d9700a580be52e159a1cd0 | /Semana 3/12. Transformaciones geometricas/transformation.py | ad47efc64cac07b50f6e14307a47f099840336af | [
"MIT"
] | permissive | NSnietol/Introduccion-vision-computador-opencv-edx | 10c49849ecd0fba434dcae99edaedd46cbd94f94 | 93f6f3989d9320fb6be9b28c687ea3ae337ba8c5 | refs/heads/master | 2020-03-15T08:42:58.835137 | 2018-05-19T12:42:15 | 2018-05-19T12:42:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,895 | py | transformation.py | import cv2
import numpy as np
img = cv2.imread('IVVI.jpg')
"""
Scaling
Scaling is just resizing of the image. OpenCV comes with a function cv2.resize() for this purpose. The size of
the image can be specified manually, or you can specify the scaling factor. Different interpolation methods are
used... |
7cb1338493a9c6db7cfe4548b26209c490328fb3 | f0417264adb22d064b0b83b5a24ae33208c0a62b | /H2TauTau/python/heppy/analyzers/TrigMatcher.py | b6112309b80a35ac4c39158313528bb45f4f3f26 | [] | no_license | cbernet/cmgtools-lite | 6ae1a0bfc45ff03b14195ab0f05b353ffde9cd2e | 359209cd4f982cd1b9d8e3cb366de32b7b46113d | refs/heads/htt_9_4_11_cand1_v1 | 2021-01-18T15:56:14.845371 | 2019-10-24T14:00:32 | 2019-10-24T14:00:32 | 86,693,438 | 1 | 0 | null | 2019-06-07T09:04:05 | 2017-03-30T11:09:21 | Python | UTF-8 | Python | false | false | 8,155 | py | TrigMatcher.py | from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle
from PhysicsTools.Heppy.physicsobjects.Particle import Particle
from PhysicsTools.HeppyCore.utils.deltar import deltaR2, bestMatch
from ROOT import TLorentzVector
class TrigMatcher(Analyz... |
f6963b6faefa90b2e309955063ab32011d1782a6 | 5069f980dfaf6e690c5d128f0eae80414e701620 | /untitled4/opencv/erodeAndDilate.py | 411871964d55386e285f5a5b3eeabf14260184ff | [] | no_license | liusanchuan/pythonDemo | be390c0b5ca256fc1ac3c160ec2910fb35ecf359 | acaff0c9f3a8cdc3afc3b1aaf6f118256304777a | refs/heads/master | 2021-01-22T22:35:24.680881 | 2017-04-20T10:15:14 | 2017-04-20T10:15:14 | 85,558,321 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 546 | py | erodeAndDilate.py | import cv2
import numpy as np
img=cv2.imread('j.png')
for i in range(0,img.shape[0],5):
for j in range(0,img.shape[1],5):
img[i,j]=[0,0,0]
cv2.imshow("", img)
kernel=np.ones((2,2),np.uint8)
erosion=cv2.dilate(img,kernel,iterations=1)
erosion=cv2.erode(erosion,kernel,iterations=1)
cv2.imshow("se",erosion)
... |
11a76c88f02780d48348438b881d2002dade647c | da23effead2ef1a9b0a5ab36cce384c265b83456 | /np9.py | c30cf4693195c4b323ec2931cc0c897566cac956 | [] | no_license | srajulu/Python-basics | f43f1385dc548fda1a851fababe960b01eac73dd | d5b9b67b1856721bbbd4c7f06d64d8dc564d1713 | refs/heads/master | 2022-12-18T21:01:12.024884 | 2020-10-06T16:14:46 | 2020-10-06T16:14:46 | 211,473,754 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 76 | py | np9.py | import numpy as np
a=np.array([3,4,6,10,24,89,45,43,46,99,100])
print(a)
|
141608135f73b8e590a10dfb953f9e2c752bf84d | b9022c3d2a463ca3f363b09ee5c387a76fa10fbd | /abc032c.py | 1f0ed71890482a8723bc6e2309846543d24514b6 | [] | no_license | galileo15640215/atcoder | 1371c90bbed185327cd5c3ce32516b5306889db8 | 27f17573589a43e5ac479e8df048ba461b942b83 | refs/heads/master | 2021-07-20T14:19:29.361693 | 2021-07-11T14:34:56 | 2021-07-11T14:34:56 | 194,278,891 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 442 | py | abc032c.py | n, k = map(int, input().split())
s = []
for i in range(n):
t = int(input())
s.append(t)
sum = 1
right = 0
ans = 0
if 0 in s:
print(n)
else:
for left in range(n):
while right < n and sum*s[right] <= k:
sum *= s[right]
right += 1
if ans < right - left:
a... |
e00ae035191533a134d5c80281ec6efcad056663 | f1ccf489512578a1c4d44200e12a29d1d194f448 | /stats.py | cd234a386c437054ebef2ec4634c5c8a4dabffd8 | [] | no_license | rwsproat/writing_evolution | 97b8b638e0c7a7c0e3a08ea232ce55afb969fcce | 31596f35c469a175c802a1153cc1efb334b4e7d4 | refs/heads/master | 2021-01-11T22:25:02.202311 | 2017-04-02T18:30:22 | 2017-04-02T18:30:22 | 78,960,212 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,041 | py | stats.py | #!/usr/bin/env python
## 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 writing, s... |
cb4a19d8b7d04aa5bb72c1d572106165abf010a1 | 7144aec5e58158dfb146029169ec894e6f5cc6f4 | /payment/views.py | 165ac0d104ff0c76830d8d86f507d5343e0c720b | [
"MIT"
] | permissive | pauljherrera/avantiweb | c25abe60f4a930bdb0aad0cf5cf9ce292ac36353 | 40b87e754e68a0e2adcf5e1640d5e2e0c8637d0a | refs/heads/master | 2021-10-13T05:29:21.564466 | 2021-10-06T11:50:31 | 2021-10-06T11:50:31 | 85,970,460 | 0 | 0 | MIT | 2021-10-06T11:50:32 | 2017-03-23T16:10:46 | HTML | UTF-8 | Python | false | false | 3,439 | py | views.py | from decimal import Decimal
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import render, get_object_or_404, redirect
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse, HttpResponseForbidden, JsonResponse
from django.contrib.au... |
377d415c64d774d0692c340b803f581ae597249c | f990ac1823da79c8ee2f82dd0b2dd0527a6c6f32 | /scatter_plot.py | 9e7c866c7dcfd3753905049a12055d7de73b0900 | [] | no_license | leomessiah10/matplot_charts | 64b7e7e59a9c183fb00d672dec65207feb23d74e | da6ecd10932d3eea4b41e04c475a27a3bc7fc406 | refs/heads/master | 2021-09-05T02:28:08.949480 | 2018-01-23T16:45:11 | 2018-01-23T16:45:11 | 118,637,938 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 285 | py | scatter_plot.py | import matplotlib.pyplot as plt
messi = [32,7,68,57,42,78,65,12,15,75,34]
bins = [0,10,20,30,40,50,60,70,80,90,100]
plt.xlabel('x-axis')
plt.ylabel('y-axis')
plt.title('Random figure')
plt.scatter(messi, snig, label='scattering points', marker='x', s=100 )
plt.legend()
plt.show()
|
b1587bf56a8d2bfc7494e91014604354b7e82859 | 88415105fe0c83421243d03303f6ce5ca942094a | /QPackage/QPackage_dialog_base.py | 82f9c22e213ccf1a0a7d0bd2bbce0accfea1338e | [] | no_license | sigeal/QPackage | b892fad31e36b3712b1fbdec60527893a692be55 | aa67c5f0eea234b9b487b4251addc92c9c665611 | refs/heads/master | 2021-01-17T04:52:05.064068 | 2019-02-16T18:39:32 | 2019-02-16T18:39:32 | 54,130,716 | 0 | 0 | null | 2016-03-17T15:44:32 | 2016-03-17T15:44:31 | null | UTF-8 | Python | false | false | 8,082 | py | QPackage_dialog_base.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'QPackage_dialog_base.ui'
#
# Created: Sat Mar 26 17:13:17 2016
# by: PyQt4 UI code generator 4.10.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QStri... |
422cad9e560aaaa8c08454059bb25422a16d866e | 762197be5e5720d3e2bab282b18fb392ed60f4b0 | /207_course_schedule/course_schedule.py | a55d849e4a57558824cc796a303b8910213de0fa | [] | no_license | Leo-Liu-us/Python | db40c3fdbba4e458f5c8b709c98d8f49eb87ea94 | b27db09b577e992d5a5c28550ed796df768deb4d | refs/heads/master | 2020-05-29T09:26:43.134290 | 2015-09-16T23:12:49 | 2015-09-16T23:12:49 | 39,859,587 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,609 | py | course_schedule.py | class Solution(object):
def canFinish(self, num_courses, prerequisites):
"""
:type numCourses: int
:type prerequisites: List[List[int]]
:rtype: bool
"""
#use dict to store node and its predecessor
#key: node label
#value: list of predecessors
p... |
3feac9162857a934d8454b56639894de11a4804e | 1816378da612c7db376934b033e4fd64951338b6 | /gui/contrib/IPAddressField.py | aef7357e5c6b879d0a84fdf9b192b70c3bb869cb | [] | no_license | quater/freenas-9.2-xen | 46517a7a23546764347d3c91108c70a8bd648ec6 | 96e580055fa97575f0a0cb23a72495860467bcfb | refs/heads/master | 2021-01-16T22:21:38.781962 | 2014-02-07T05:59:13 | 2014-02-07T05:59:13 | 16,609,785 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,406 | py | IPAddressField.py | from ipaddr import _IPAddrBase, IPAddress, IPNetwork
from django.core.exceptions import ValidationError
from django.db import models
from dojango import forms
from dojango.forms import widgets
from south.modelsinspector import add_introspection_rules
add_introspection_rules([],
["^freenasUI\.contrib\.IPAddressFi... |
4b3c8567da5ef441e97985fdb14b2ec48689cf63 | 9043b6be740ac328bfe0bfccbfc19cdde1755fc2 | /test.py | bcdf59e3bba8c689dc254dc90ec2a0ba12357924 | [] | no_license | sushant071996/Heroku | 1e8ca88ae91bdfca53a7b8bb56ae507296de087d | 5b28210f108c3d1f823c8ec10c93c98de54c78e6 | refs/heads/master | 2023-03-24T08:14:53.787030 | 2020-04-30T12:31:46 | 2020-04-30T12:31:46 | 260,197,796 | 0 | 0 | null | 2021-03-20T03:49:08 | 2020-04-30T11:51:27 | Python | UTF-8 | Python | false | false | 1,173 | py | test.py | from flask import Flask , render_template , request
import pickle
app = Flask(__name__)
model = pickle.load(open('C:\\Users\\Sushant\\Desktop\\python\\Heroku\\model.pkl','rb'))
@app.route('/')
def index():
return "Hello World!.."
@app.route('/test')
def home():
return render_template('index.htm... |
4c3a6182435f804a6187f67abf8aaa865185b024 | 2de4592c8fd0f5bcade27707436baa9019582a5c | /test/test_client_check_in.py | 0a4d8941fd62d8210aeb3b5ffd6945b8ddf437b3 | [] | no_license | jensenbox/python-jamf | 2222c409fe57473934e5a4f9851250df66383a76 | 85213085b1064a00375a7aa7df5e33c19f5178eb | refs/heads/master | 2023-01-04T00:42:44.252879 | 2020-11-03T00:24:56 | 2020-11-03T00:24:56 | 309,518,981 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,168 | py | test_client_check_in.py | # coding: utf-8
"""
Jamf Pro API
## Overview This is a sample Jamf Pro server which allows for usage without any authentication. The Jamf Pro environment which supports the Try it Out functionality does not run the current beta version of Jamf Pro, thus any newly added endpoints will result in an error and sh... |
24a54ca7bc3511f06c6ec2fb7c3f78c8f4aff6fe | b5f77af6df51de8dc7fa5e8a7f2cb42bc45221d2 | /p1ej1.py | 786e7309acbf1519c74fd2c1e2626bbb88ce2db9 | [] | no_license | Kherdu/GIW | b92b79528148b4dd69015d1707548e213cb161c3 | b636f6fa97e65c4b73b4a30f022386c78e0baec8 | refs/heads/master | 2021-01-09T08:05:49.610320 | 2016-01-28T15:40:59 | 2016-01-28T15:40:59 | 43,770,305 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 416 | py | p1ej1.py |
def Cesar(texto, despl):
i = 0
z = 124
text = list(texto)
while i<len(text):
ascii= ord(text[i])
if (ascii >= 97) and (ascii<123):
num_max = ascii+despl
if num_max >= 123:
ascii = ascii+despl-26
else:
ascii = ascii+desp... |
67ec185205446c2e7a6ebd02cd0cfbf78370e759 | 178d2d3fad0fcc24a243da5deef640ffcd27a080 | /myblog/blog_statistics/models.py | 01d251501ebe51c549b665fa64a5af5fe0cb6e57 | [] | no_license | tanyujian/my_blog_blog | 9fbabd526dae418aa687e74cdcb88fc13a48e1a7 | e0bd5348be12a18d60b26625274309b0d9430499 | refs/heads/master | 2021-02-11T19:28:48.484070 | 2020-03-13T07:06:57 | 2020-03-13T07:06:57 | 244,522,491 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,972 | py | models.py | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.utils import timezone
from ckeditor_uploader.fields import RichTextUploadingField
from myuser.models import MyUser
# Create your models here.
class BlogRe... |
4108020e529d3cfc818fc30afdd92a2283ddaca1 | 09369462ec6ca407b98971317e31886d464e5fce | /pythonCrashCourse/AlienInvasion/alien_invasion.py | 98e115653b2fb77a8d376dec44fff5ff011a3794 | [] | no_license | breimanbzx/TheWayOfImage | fb394e24b7760f49671e659068e957e33f98109b | 31cb75ebbaf0b96969cca0d3de893f7a1e7b97d9 | refs/heads/main | 2023-04-15T17:11:16.921344 | 2021-04-09T12:27:42 | 2021-04-09T12:27:42 | 352,533,401 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,316 | py | alien_invasion.py | import sys
import pygame
from pythonCrashCourse.AlienInvasion import \
setting, dog, bullet, alien, game_stats, button
import time
# 1. 创建空白屏幕:set_mode访问屏幕模式(fill/get_rect访问位置/)设置尺寸 、 事件循环
# 2. 创建飞船的类
# **项目规划
# 玩家控制一艘最初出现在屏幕底部中央 的飞船。玩家可以使用箭头键左右移动飞船,还可使用空格键射 击。
# 在屏幕左上角添加一个外星人,并指定合适的边距。
# 根据第一个外星人的边距和屏幕尺寸计算屏幕上可容纳... |
969cca75bc2904ea3c29cf06f7a937dd0f97e715 | 703f52408815ade4da32faf34902337b0d83e3dc | /Course-3(Numpy-Pandas)/numpy_example02/numpy_example02/numpy_example02.py | cdace347bd60ed84ab7e641d27a4f8fb62ce7f13 | [] | no_license | berkabay4/University-of-Michigan-Python-Course | a356e5812ecc73acd256e095f385369f90854712 | 2297318cfa8d1f88e7b5ee5fb4ee68ebf1aa0a26 | refs/heads/master | 2023-06-07T08:59:11.815802 | 2021-06-17T20:43:40 | 2021-06-17T20:43:40 | 370,663,369 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 933 | py | numpy_example02.py | # Accessing/Changig specific elements, row, columns etc.
import numpy as np
a = np.array([[1,2,3,4,5,6,7], [8,9,10,11,12,13,14]])
print("Matris A ->", a)
# Get a specific element [r,c]
print("2. row, 6. column ->", a[1,5]) # or a[1, -2]
# Get a specific row
print("1. Row -> ", a[0, :])
# Get a specific column
prin... |
769f84fbc7dbb4713cd4fa0177aa35537292cb15 | ff781938e715b9377c07efa69eeff9e9c9187344 | /webapp/db/DBUserInfo.py | b0b4c0787c91aa98b01d3243fe22352b7de60906 | [] | no_license | SealOfFire/webpy_test | 6d6c387544686ed224a2a3b59d430396703d2fc2 | 6d97b4e519b0f76c50b684b832948cc6583a1382 | refs/heads/master | 2016-09-01T21:48:15.057181 | 2015-08-31T07:08:25 | 2015-08-31T07:08:25 | 41,660,526 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,511 | py | DBUserInfo.py | # encoding:utf-8
from DBBase import DBBase
from webapp.db.Log import Logger
from utils.DBUtil import DBConn
class DBUserInfo(DBBase):
"""
用户信息表
"""
@classmethod
def login(self, userName, password):
'''
用户登录
'''
Logger.info('DBUserInfo.login begin')
# Logger.info('DBUserInfo.login begin')
db = DBC... |
32906f8ef2f505cc934b92e726ed3ecb2c9afe79 | 27f4e39cdb8364a041b5fdf8d1ea1a6b9aeaa321 | /sql-course/exercises/FSND-Virtual-Machine/vagrant/project/logs_analysis.py | cd877ee847c3e216178548021c639ed6a5fc1db2 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | wakqasahmed/full-stack-udacity | f3ac5505a0d8c4d4f175e6a236b2dff62018a5a0 | 7889105279ea1864b5fbd031ba278f11d6f0247d | refs/heads/master | 2020-03-18T15:51:43.454281 | 2018-08-03T00:31:20 | 2018-08-03T00:31:20 | 134,933,457 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,447 | py | logs_analysis.py | #!/usr/bin/env python3
#
# A web service to display the analysis of news articles logs.
from flask import Flask, request, redirect, url_for
from logs_analysis_db import (most_popular_articles,
most_popular_article_authors,
erroneous_req_per_day_gt_a_percent)... |
34f718184f1d444d600d6ed09994464db2ddf807 | fd61b3bc497c79aab94dcef02e7c13f57b880707 | /backend/api/tests/test_login.py | b04a4407b00d8b0866279f79b69ae4898d1f1918 | [] | no_license | RJ-0605/ghana-prime-backend-frontend-andrew | ff50074e9b5d8f74cbfcad1ff4a86882bae86d1d | a642d6ab56c0470717345f6aced59c1d382b2cf8 | refs/heads/main | 2023-06-18T06:00:30.451909 | 2021-07-20T18:02:49 | 2021-07-20T18:02:49 | 387,874,746 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,863 | py | test_login.py | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.contrib.auth import get_user_model
from rest_framework.test import APITestCase, APIClient
User = get_user_model()
class GPrimeLoginViewTest(APITestCase):
def setUp(self):
self.client = APIClient()
self.u... |
e0c01a96a6fcf33e42a1e0332613bef31cf9d8e6 | ece6d577323146ff2b80e49c39a24b8750f2bf5c | /sem_01/lab_01/lab_01.py | e24b9072a1c602cdb74239758822a04775f807b2 | [] | no_license | MyMiDiII/bmstu-python | 355d72da0c5babb03ef2955563a5798ac122ffda | 926347e28cc043de886d0ddeb3443ec7d5200d10 | refs/heads/main | 2023-02-25T20:09:03.243521 | 2021-02-02T08:37:16 | 2021-02-02T08:37:16 | 334,646,799 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,937 | py | lab_01.py | ''' Лабораторная работа №1
"Объем шарового слоя и площадь шарового пояса"
Вычисление объема шарового слоя и площади
шарового пояса.
Переменные, используемые в программе:
radius1 -- первый заданный радиус шарового слоя;
radius2 -- второй заданный радиус шарового слоя;
height -- выс... |
d85124d78a44bc3d5968867095114071a2d3ce59 | f92cd68df190480bc72d32c6a023d542292f2e6d | /logparser.py | 0adf11acfab580a24f67f06561c8ff7fc48373dc | [] | no_license | Shivang-Bhandari/Log-Analysis | 557974c4190fda1eb2b383af45a6b8c8562fbb4b | 3902268f56fe12da85511092f9e87f09138ec9a5 | refs/heads/master | 2021-03-19T14:19:50.119388 | 2017-06-12T21:34:54 | 2017-06-12T21:34:54 | 93,043,807 | 0 | 2 | null | null | null | null | UTF-8 | Python | false | false | 2,228 | py | logparser.py | #!/usr/bin/env python2
import psycopg2
# list of queries to run on the DB
queries = ["select title,hits from articleHits limit 3",
"""select name,sum(articleHits.hits) as num from authors,
articleHits where authors.id = articleHits.author
group by name order by num desc;""",
... |
d67abd7ef4dcb7e92efdece5da1c544ce0238328 | 9611557417cd0bbfede77465b6295d436075666a | /lambda_function.py | 984691516ec30bd1041be73b3c900319552328f8 | [
"MIT"
] | permissive | dbnegative/lambda-elasticsearch-index-cleaner | 9fe9ee8e9b4ce407a34593d6fcba50ddd9e38d80 | 611a77d294a5f43552e691030152d58384d70467 | refs/heads/master | 2021-05-01T04:34:55.576411 | 2017-03-16T20:01:36 | 2017-03-16T20:01:36 | 72,462,512 | 3 | 2 | null | null | null | null | UTF-8 | Python | false | false | 4,695 | py | lambda_function.py | '''
Elasticsearch Index Clean - Cleans up old index's according to retention
dates specified in config. This lambda function is triggered by an AWS cron event
Author: Jason Witting
Version: 0.1
Copyright (c) 2016 Jason Witting
Permission is hereby granted, free of charge, to any person obtaining a
copy of this softw... |
9625537495265b54b83cadb4e26103f898c70297 | 843d894d64c96235692d3068d39cf0c233556bb8 | /sourceCode/DatabaseWindows/maspit_window.py | 533858fc1d8030e3443b820e8a96ef7495915305 | [
"Apache-2.0"
] | permissive | compomics/MAPPI-DAT | 47e69972b01b754443a1f3c7fd12f9ce8f771f0a | 5d6502ffd58d643729f28c2416e1cd58b9088eaf | refs/heads/master | 2020-04-12T09:32:18.331123 | 2017-05-17T09:38:14 | 2017-05-17T09:38:14 | 64,203,167 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,696 | py | maspit_window.py | __author__ = 'surya'
from Tkinter import *
from tkFileDialog import askopenfilename
from Gui_support import Gui_looks
#background="snow3"
background = "grey95"
#################################################################################################
#################################### DATABASE WINDOW ##... |
b443339b278273fbabd28e9fb20ea85ac9d6f0b9 | bfba738bd85e5c3406c128373ce10d39e92986b4 | /src/data/interim/teams/loteca.py | 9ec9aa48e9ca6dc9bba8ce0dc13ffea4372a902c | [] | no_license | lowerthansound/laughing-telegram | 6ad8462d4f49ffa5332f70444b7a9872061c7149 | 2e26b462353cf3ed6eaae6dba8fe35f64f5509ed | refs/heads/master | 2021-09-12T18:00:57.203504 | 2018-04-19T15:31:02 | 2018-04-19T15:31:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,244 | py | loteca.py | import re
from unidecode import unidecode
from src.data.interim.teams.commons import Team
from src.util import load_pickle, re_strip
REPLACEMENTS = {
'sao jose (pa' : 'sao jose',
'a b c' : 'abc',
'atalanta bergamas' : 'atalanta',
'boa esporte' : 'bo... |
8752b3463cee6836f1c767f86ada6327bec381c2 | 865dd2eeee0c7c5a32d0539e7031538d30956913 | /typist.py | 72870aceeb512ae4f873a49828e532fbef9480e9 | [] | no_license | L-E-Freeman/Typist-Game | 2df056eb6becc09b22134ce30c68915a839e84f9 | c8643bbb755580a9a88896b3ec85b3ba33da7bc7 | refs/heads/main | 2023-05-21T18:35:41.553084 | 2021-06-16T14:30:49 | 2021-06-16T14:30:49 | 377,524,267 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,355 | py | typist.py | # Author: Laurence Freeman
# Date: 07.06.21
# Importing the necessary modules for the game.
import sys
import pygame
from settings import Settings
from game_stats import GameStats
from score_screen import ScoreScreen
from text import Text
from button import Button
class Typist:
"""Class to manage as... |
2cac12ca7987e9050e95aba605a475b685702867 | ce87e97f49428ebd33e43abf0a3a6b579407c807 | /session-3/shortlist.py | 454095479d40d38a5a2b24a0fdb5c4eadb653e3a | [] | no_license | djrrb/Python-for-Visual-Designer-Summer-2021 | c93f502f16aa24266548352d574ba01bd767054c | 5caff9a1c0686580debb49dd6008e54fbc1d95db | refs/heads/main | 2023-07-11T21:22:40.421631 | 2021-08-04T22:21:23 | 2021-08-04T22:21:23 | 382,945,173 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 30 | py | shortlist.py | print(installedFonts()[2500:]) |
1fdf1f74b62893506ae8dd876d3756de8a6e589f | d9b811be830053aaf86c158eaa603c5904e916a0 | /file.py | 4a4a10835859c62e96f70ae8a9656d76642a7f4f | [] | no_license | zurgis/forme | 83e61aa2f7437da098e3830cc829c6ea117b3f13 | c70960a92f020a6c1fef41906b91829b6fbaca70 | refs/heads/master | 2020-08-07T19:36:18.200577 | 2019-10-08T06:39:52 | 2019-10-08T06:39:52 | 213,566,713 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 173 | py | file.py | with open('test.txt', 'a') as f:
aa = input('Введите текст: ')
f.write(aa)
print('---------')
with open('test.txt') as f:
a = f.read()
print(a) |
43a953895167ccb98a5bafdc66a110ab991aa109 | 19ddab74600f71700a6b693281d0180d5271f295 | /codeforces/1059A_Cashier.py | 0760ef1f4036aaa675bbc62f02d30d7d7a6aa592 | [] | no_license | zhulf0804/Coding.Python | 4d55a430da1a8077c81feba65c13ac654aaf094a | 46ab03e23d15ebd5434ef4dd5ae99130000b00a5 | refs/heads/master | 2022-09-14T18:40:59.880941 | 2022-08-20T08:25:51 | 2022-08-20T08:25:51 | 213,113,482 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 235 | py | 1059A_Cashier.py | import sys
input=sys.stdin.readline
N, L, M = list(map(int, input().split()))
ans = 0
cur = 0
for i in range(N):
t, l = list(map(int, input().split()))
ans += (t - cur) // M
cur = t + l
ans += ((L - cur) // M)
print(ans) |
aa00fcac011cce52881d84c69161f3e4331f9ca9 | 92d219b36cd54ce8d0188341cfbd0c58f6b0ceb2 | /analyze_basic_json.py | 98de0ea51fa45ac2eefe6bf028b8b845025659bd | [] | no_license | jssmith/ray-scheduler-prototype | 62ef10f104ea7e06787a39afa1fd69de02e57cc9 | b2e07feda31d746fd4c150e45245d1bfc2898bdc | refs/heads/master | 2020-12-26T04:56:38.576546 | 2017-01-11T18:47:17 | 2017-01-11T18:47:39 | 68,567,872 | 1 | 3 | null | 2017-01-11T11:42:59 | 2016-09-19T04:01:06 | OpenEdge ABL | UTF-8 | Python | false | false | 516 | py | analyze_basic_json.py | import sys
import json
from analyze_basic import analyze_basic
from helpers import setup_logging
def analyze_basic_json(in_fn, out_fn):
stats = analyze_basic(in_fn)
with open(out_fn, 'w') as f:
f.write(json.dumps(stats,
sort_keys=True,
indent=4,
... |
d60de82f8068363e8e370fe6438cc235267486a5 | ed4238a0c4992af60dc7bcff50c32e9af0ae02ce | /Flask_REST/aeneid/tests/test_update_by_path.py | 045f0819f406dee4f74edb16d271513f2fe974b3 | [] | no_license | zyx124/lahman_baseball_my_sql | ae2375c530ed26b91a3cf16635723b538a876f28 | 2426a76b45efefbca7d800df1e9a72ac00e1ad8c | refs/heads/master | 2022-06-20T04:08:48.122805 | 2019-10-05T01:38:31 | 2019-10-05T01:38:31 | 174,061,860 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,258 | py | test_update_by_path.py | import requests
import json
def display_response(rsp):
try:
print("Printing a response.")
print("HTTP status code: ", rsp.status_code)
h = dict(rsp.headers)
print("Response headers: \n", json.dumps(h, indent=2, default=str))
try:
body = rsp.json()
p... |
63c9357c26387397941e9ed1d6bc48c33d0c1d54 | 88963402ff8c2877e90804b54491f342686d5dcf | /generators/cifar_vae/layers.py | 80d778162a459fe21b0d55981a01f721ed84986d | [
"CC0-1.0"
] | permissive | TanmDL/black-box-ripper | 3fffe78fc876b35838f2409fff807f92d59d8d0d | f461e140979bf43200bd4ec6872731f07a2ca15f | refs/heads/master | 2022-12-31T02:35:34.418418 | 2020-10-25T09:48:14 | 2020-10-25T09:48:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,084 | py | layers.py | import torch
from torch import nn
from numpy import sqrt
class EqualLR:
def __init__(self, name):
self.name = name
def compute_weight(self, module):
weight = getattr(module, self.name + '_orig')
fan_in = weight.data.size(1) * weight.data[0][0].numel()
return weight * sqrt(2 / ... |