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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4e53da9b41c4cd53a0c2fa927fad554247f59a6a | 83c55af67da941c91262509c1d6461216d1ce1ba | /crontab_task/interval_get_guards.py | 69863c0f786721804d73fb86eb149ba438081697 | [] | no_license | cl-ei/storm-server | 1ecb70206468bd1c8347f88a7e26684270a14caa | 0d70da2b0cd91a5772c0e2623d60ce959f94bfbd | refs/heads/master | 2020-12-13T19:54:50.772980 | 2020-07-01T08:56:37 | 2020-07-01T08:56:37 | 234,516,080 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,953 | py | interval_get_guards.py | import time
import logging
import asyncio
from utils.biliapi import BiliApi
from utils.dao import redis_cache
from utils.udp import mq_source_to_raffle
from config.log4 import crontab_task_logger as logging
async def proc_one_room(room_id):
flag, result = await BiliApi.lottery_check(room_id=room_id, force_cloud=T... |
58d18adbdcabfe9b5db9adf3351fad489b5ad3e8 | 2b91f0b1df6634b8716b673528cd123d6892ce5a | /upload.py | 580eaf8e5210b427cda9a4d41e938b3ae8504b75 | [] | no_license | RozanovK/SafeServerApp | c95b3b616b730312dcb9959f4080f3783ca9663c | 3179bfb82b08a0eb9f6a3ad42fcc8b89058be5a0 | refs/heads/master | 2021-06-17T12:19:14.153843 | 2017-06-13T02:57:02 | 2017-06-13T02:57:02 | 92,161,399 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,385 | py | upload.py | import os
from cookie import AuthCookieFactory
from pysql import database_connect, print_ip
from vial import render_template
def upload_file(headers, body, data):
db, cursor = database_connect()
token = str((AuthCookieFactory()).get_from_headers(headers).get_token())
cursor.execute('''SELECT login FROM c... |
a22bbe81c5ed4fb900a7f5ac9bfc3fe7599df2e0 | fe92eb47c8758bda03895f7cadc97eab3dfaf156 | /gallery/s3.py | c77670afe2c681ccb63d58c211e3c010fe74a829 | [
"MIT"
] | permissive | liam-middlebrook/gallery | 302818a2927bdf008248c9f9079719468773b7eb | bf70bec4cdd8d0a91f78dad8ff5a9a80ab9efe2e | refs/heads/master | 2020-03-30T08:48:40.053526 | 2018-10-01T04:50:23 | 2018-10-01T04:50:23 | 72,478,079 | 5 | 6 | null | null | null | null | UTF-8 | Python | false | false | 1,050 | py | s3.py | import boto
import boto.s3.connection
from boto.s3.key import Key
from datetime import timedelta
class S3():
con = None
def __init__(self, host, access_key=None, secret_key=None, secure=True):
self.con = boto.connect_s3(aws_access_key_id=access_key,
aws_secret_access... |
cae4c0e5162ee5ed55162ffae82973f104f2657a | 24f76fe29e2b46fafc25d13777fe2905d8133fd9 | /artifact_evaluation/src/FuzzingEngines/Utils/testbed_parser.py | 96b8543954be22ba6a6436ae8306ac8f8bd2714a | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Delepha/COMFORT | e35073577e1e5a89ac4d33db765c98292d67979c | a76ab2cc0069542b2bd75e4952c4709eef936124 | refs/heads/main | 2023-04-10T14:57:43.746873 | 2021-04-15T14:50:32 | 2021-04-15T14:50:32 | 358,763,691 | 1 | 0 | Apache-2.0 | 2021-04-17T02:08:21 | 2021-04-17T02:08:21 | null | UTF-8 | Python | false | false | 382 | py | testbed_parser.py | # coding=utf-8
"""
@author: xing
@contact: 1059252359@qq.com
@file: testbed_parser.py
@date: 2021/3/5 16:12
@desc:
"""
def get_version(testbed: str):
path = [e for e in testbed.split(" ") if e.find("/") > -1][0]
full_name = path.split("/")[-1]
return full_name.replace(".jar", "")
def parse_engine_name(... |
361fe02a684bd61da7cdeffd44012ee647f7a73a | 18b79c2e694a04d0aba8033ac937401ae4d1c459 | /l10n_pe_pos_plate/models/pos_order.py | 3a4d439f95f7b52a8946b427753b6e8338e753c4 | [] | no_license | EnriqueDavid/Pcell-Repositori | 0c0b04a7d347b8977b43ad13f4438b169b833464 | 126f6a9a38f332a626636a224671a5b6275370f2 | refs/heads/master | 2022-11-24T01:44:32.305125 | 2020-07-28T23:21:37 | 2020-07-28T23:21:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 765 | py | pos_order.py | # -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class PosOrder(models.Model):
_inherit = "pos.order"
pe_license_plate = fields.Char("License Plate", size=10)
def _prepare_invoice(self):
res = super(PosOrder, self)._prepare_invoice()
res['pe_license_plate'] = self.pe_lice... |
b4d8ffb394f0b31e62a4fed141a0f7a499cfbba7 | ddfbcef885a7f4e99b869f164b36102f41cbc0da | /Goal_Page_UI.py | 4fa5cc1362a3338ec97bd23ac64a5bbf899dd6c8 | [] | no_license | treesakul/CalTracker | 4169401a4f79e3d7eb4b64cc684325dd3cd3a752 | 967a43763735462d77ba3cf61c52995eb2e3fdf6 | refs/heads/master | 2021-01-22T05:51:04.968195 | 2019-02-18T10:50:22 | 2019-02-18T10:50:22 | 92,501,055 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,568 | py | Goal_Page_UI.py | import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtUiTools import *
from Goal import *
from pony.orm import *
db = Database()
db.bind('oracle', 'TANAKORN/password@127.0.01')
class Goal_Page_UI(QMainWindow):
def __init__(self, parent = None):
QMainWindow.__init__(self, None)
... |
e09604ecec9db6e574afd8f0eea968592ae03933 | d95d3e3528abdabd63dc5bdea4f38e129c164a66 | /AtCoder/ABC137/C-GreenBin.py | f4df6f606a8c5e9b1d5008b6b1eab96b75bcabd8 | [] | no_license | kent-recuca/AtCoder | 707e2660fd2ba504addd3eb88b2d0d22d22bc289 | c27b798b3ab1912c8e3d32c59a8dd5d9d2a5e650 | refs/heads/master | 2020-06-11T01:45:24.612192 | 2020-05-04T06:33:19 | 2020-05-04T06:33:19 | 193,818,847 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 298 | py | C-GreenBin.py | # -*- coding: utf-8 -*-
def main():
N = int(input())
d = {}
ans = 0
for _ in range(N):
s = "".join(sorted(list(input())))
if s in d:
ans += d[s]
d[s] += 1
else:
d[s] = 1
print(ans)
if __name__ == '__main__':
main() |
a6039671682df7c133ab438e9eadf6032bce6141 | 56b47728ffe36878096fac0d8fb0deb94a8a9b7c | /withMany.py | 67d70373dd4e69e8b332d39cfb10b26e5175669b | [] | no_license | CaMeLCa5e/dailyspring2015 | 1a930fc74930bb7d286956f17fcf36ec48802b4e | 1b2039b9908407a31e951e44f66bafebf3d7422b | refs/heads/master | 2016-09-05T19:54:44.918992 | 2015-05-24T23:51:39 | 2015-05-24T23:51:39 | 33,795,537 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 408 | py | withMany.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite as lite
import sys
cars = (
(1, 'Ford', 19000)
(2, 'VW', 18000)
(3, 'Bently', 87989)
(4, 'Hummer', 198232)
)
con = lite.connect('test.db')
with con:
cur = con.cursor()
cur.execute("DROP TABLE IF EXISTS Cars")
cur.execute("CREATE TABLE Cars(Id... |
a62de5158823dd3f10dede381b73cb746cfbc8fb | 1455b334f0453f8ac1c2ac25551a5673ce098063 | /Hello.py | c918aeb886350ff6dd3a37d03b0e143c73a0e84e | [] | no_license | glasgow2016/team-7 | 00f34289b6b99b580cd6cec75b0686a28dcc6ea6 | 437f493dcc8f796766a9c7b46366d11f8efe2345 | refs/heads/master | 2021-03-27T11:08:37.396169 | 2016-11-06T06:20:59 | 2016-11-06T06:20:59 | 72,859,969 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 128 | py | Hello.py | print "Let's get this going"
character_name = null
def mainPage(name) {
character_name = name
}
print character_name
|
c999700edef6561b41d9cef1d60876f7be197067 | 27389c55b5d25fd63743d74983819a0a8208084d | /teamup/main/routes.py | 9120bcbb50da6087d43151f329edd36800495e40 | [] | no_license | lalverdacakir/teamup-flask | 18f5b293b07b6db82b87c7d61e329e481fbd4726 | f99d711060aefd5ce639ed7678f588503eb493fb | refs/heads/master | 2023-02-21T21:21:34.004823 | 2021-01-20T01:46:25 | 2021-01-20T01:46:25 | 322,169,097 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,182 | py | routes.py | from flask import render_template, request, Blueprint,redirect,url_for
from teamup import login_manager
from flask_login import LoginManager,login_user, current_user, logout_user, login_required, UserMixin
import re
from flask_mail import Message
from teamup.teams.database import get_course_team_count,get_total_op... |
287397308bde30e3c2c1f82f452f973103486a93 | 716e5b1bdd4510f05a717213d03974dd7744e6a2 | /urls.py | 60ee6c72b561291dbe231970ae61e1febf767ec5 | [] | no_license | jackd/slim_start | 742219b69072de7937cfa333932322688e5c8a89 | aa78be01c1276936e2c89451d4c5a671aef426dc | refs/heads/master | 2022-11-07T03:07:23.600714 | 2022-10-27T12:24:33 | 2022-10-27T12:24:33 | 143,848,047 | 0 | 1 | null | 2022-10-27T12:24:34 | 2018-08-07T09:07:20 | Python | UTF-8 | Python | false | false | 2,782 | py | urls.py | """
https://github.com/tensorflow/models/tree/master/research/slim
"""
# flake8: noqa
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
_urls = {
'alexnet_v2': None,
'cifarnet': None,
'overfeat': None,
'vgg_a': None,
'vgg_16': 'http://downl... |
899d595eab7d73b155addaa455c5d71bc6ed67cd | ae0aceddc4b8803f7b0a249ac250f37fea2f1a2c | /chapter8/8-interface_second_example.py | 961dfee622935e0bbea037db403ca62e0c30710c | [] | no_license | c18gour/K_book | 429d2b6f28a07f4f60b939f48cd3e03612df18b4 | f31c9955caf4b49cb066ae0fa184bf626833298b | refs/heads/master | 2021-05-30T01:34:10.280004 | 2015-11-28T13:21:18 | 2015-11-28T13:21:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 476 | py | 8-interface_second_example.py | from Tkinter import *
class Application:
def __init__(self,master):
frame = Frame(master)
frame.pack()
self.qbutton = Button(frame, text = 'Quit', fg = 'red', command=frame.quit)
self.qbutton.pack(side=LEFT)
self.mbutton = Button(frame,text='Message', command = self.print_me... |
db92a6a81a351b43c1d163361b06c05a278e15cc | d81e237fc131af3de9616cc35d28849f646c6a4a | /databuilder/extractor/bigquery_statistics_extractor.py | e3306f8a40c43e4faad7f5048bbad2185e4cec15 | [
"Apache-2.0"
] | permissive | cpnat/amundsendatabuilder | 9e3ec1dbb6b620d66d4685c84193e5d7a6dd8d71 | c70c238073b1644a76d1321016694e2c9a589751 | refs/heads/master | 2020-09-07T13:18:42.233586 | 2019-11-10T13:34:30 | 2019-11-10T13:34:30 | 220,793,394 | 0 | 0 | Apache-2.0 | 2019-11-10T13:23:06 | 2019-11-10T13:23:05 | null | UTF-8 | Python | false | false | 1,240 | py | bigquery_statistics_extractor.py | import json
import google.oauth2.service_account
from databuilder.extractor.base_extractor import Extractor
class BigQueryStatisticsExtractor(Extractor):
"""
A column profiler for bigquery tables.
"""
PROJECT_ID_KEY = 'project_id'
KEY_PATH_KEY = 'key_path'
_DEFAULT_SCOPES = ['https://www.goog... |
e2f03439080b7ddf4ff701bd2e4c6de31df766e2 | 26598ac3120d1f7addd7637337f8bea79952d4a9 | /week1/exercise/18.electronic_clock2.py | 2f247df0d7a441657a6d774ab8789b3ed8b57a65 | [] | no_license | skv-sergey/coursera_python_starter_VSHE | 215d60e86433b0cd5be35843fc89651fd2a353fd | a197148e351f56f0466b1a2796c2a760ce5f4703 | refs/heads/master | 2022-12-14T01:38:54.512216 | 2020-09-12T13:47:55 | 2020-09-12T13:47:55 | 283,580,541 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 213 | py | 18.electronic_clock2.py | n = int(input())
hour = (n // 3600) % 24
mMajor = ((n // 60) % 60) // 10
mMinor = ((n // 60) % 60) % 10
sMajor = (n % 60) // 10
sMinor = (n % 60) % 10
print(hour, ":", mMajor, mMinor, ":", sMajor, sMinor, sep="")
|
c778ef7234af5c222861cf150b3cf9739f033c81 | 2010b870f4953bf4f13fe29a50f97dae8e752532 | /ling320.py | f5568cd35a794daccfcd081297267406a0d8c3c3 | [] | no_license | vwsong/speaker-recognition | cb8dec4e4eb0ea59080771e9d00144836288ea2a | 0e8394bd94044ef3c7c5ffa19db91f6be96e2e39 | refs/heads/master | 2020-04-10T18:15:33.191429 | 2018-12-10T15:50:41 | 2018-12-10T15:50:41 | 161,198,601 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,001 | py | ling320.py | import parselmouth
import glob
import math
import random
import numpy as np
import os.path
from functools import reduce
from scipy.spatial import distance
FORMANT_1 = 0
FORMANT_2 = 1
PITCH = 2
TRAIN_COEFFICIENT = 0.75
VERIFY_COEFFICIENT = 0.25
# filename -> (pitch values, mean)
data = {}
datapoints = {}
def get_mean... |
184dbba1662edb86057a208d69957772a6c42d50 | 3fe9604267b310d1ea7108674101c5010848d09f | /km to miles.py | e608691d9aac44d5ddc52641c1f0eba8ca6ea875 | [] | no_license | swathivenkat1011/python | 23f9545e329d04e3e1638780006cf8bc2e64463f | c781a802976d15bd7e99e78692450fd558cd8f56 | refs/heads/master | 2020-07-31T05:21:24.207790 | 2020-01-08T14:52:50 | 2020-01-08T14:52:50 | 210,498,086 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 136 | py | km to miles.py | print("km to miles")
#1km=0.6214miles
len=int(input("enter the km"))
print("the value of",len,"kms inn miles is",len*0.6214)
|
e6ae24c14d78e781127712d6a0982b0813480dc4 | 94ca812c3f373a1f5f1fa17e8fefe94d15d96e89 | /create_csv.py | 99199b14408c6f72ea2e47c5930a7f43115ff0ad | [] | no_license | codecolony/caffe | ef5578dc7d9092b2937b5d0cd67040e15185f0ee | d5a7562a252c73e642ca230b0e918bfa1736e061 | refs/heads/master | 2016-09-14T18:44:31.793464 | 2016-05-10T08:17:27 | 2016-05-10T08:17:27 | 58,195,095 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 450 | py | create_csv.py | import io
import csv
output = io.StringIO()
csvdata = ["'filename, xmin, ymin, xmax, ymax'\n'group.jpg', 50, 50, 200, 200"]
writer = csv.writer(output, quoting=csv.QUOTE_NONNUMERIC)
writer.writerow(csvdata)
Some details need to be changed a bit for Python 2:
# >>> output = io.BytesIO()
# >>> writer = csv.writer(outpu... |
8162af74f3000ceb5dd248e4281d91b145b10340 | a072a312eae030c471d19f6a67735337a146d396 | /test/test_environment.py | 2fa6b3d55711e9e0708af6f73e6426c5d32a8c63 | [] | no_license | allnightlight/LearningWithTemporalPointProcess | a26ea224fa7cd3750292ea5989d50a1d03a205df | 2c2565c76878c23dba74d1447e3f0c4a50edb95b | refs/heads/master | 2022-11-09T17:47:28.979752 | 2020-06-23T07:59:48 | 2020-06-23T07:59:48 | 261,947,992 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 365 | py | test_environment.py | '''
Created on 2020/05/07
@author: ukai
'''
import unittest
from environment import TestEnvironment, IEnvironment
class Test(unittest.TestCase):
def test_001(self):
environment = TestEnvironment()
assert isinstance(environment, IEnvironment)
if __name__ == "__main__":
#import sys;sys.arg... |
943e8dcffb9f28bead3425506dab474849d27b6a | 349b0dbeaccc8b9113434c7bce7b9166f4ad51de | /src/pytrade/testpo.py | 5f620585b748e18563e22b52e0e540ccee11a78b | [] | no_license | jbailhache/log | 94a89342bb2ac64018e5aa0cf84c19ef40aa84b4 | 2780adfe3df18f9e40653296aae9c56a31369d47 | refs/heads/master | 2021-01-10T08:55:43.044934 | 2020-01-09T02:57:38 | 2020-01-09T02:57:38 | 54,238,064 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,640 | py | testpo.py |
def minindc(cours,ind,p):
m = 100000000.0
m2 = 100000000.0
# lv=titrescours(cours)
#for val in lv:
# cv = coursval (cours, val)
for cv in cours:
k = ind (cv, p)
k2 = k*cv[0][6]/cv[len(cv)-1][6]
m = min (m, k)
m2 = min (m2, k2)
# print str(k) + '\t' + str(k2) + '\t' + val
... |
dd15ffe23ba261c76a039d36f0a3a1122de8fd94 | cc216d65dcea143ebea9029b172931e30bbd8fc8 | /shaders/data/brdf_integration.py | 5aa76412df6f986ae5f96457f653325b5c05b3f0 | [
"Apache-2.0"
] | permissive | bobcao3/Wisdom-Shaders-Compute | d1e251f66a750637367655bc4bd8047ad3c97fb3 | cf3b2fd6d5a64bf3890f5f082e5050c27b8a83c4 | refs/heads/main | 2023-06-20T19:38:12.804946 | 2021-07-23T09:36:21 | 2021-07-23T09:36:21 | 340,216,949 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,032 | py | brdf_integration.py | import numpy as np
import taichi as ti
import math
import matplotlib.pyplot as plt
import os
ti.init(arch=ti.gpu)
samples = 20000
batch = 800000
integratedSpecular = ti.Vector.field(4, dtype=ti.f32, shape=(samples)) # per sample (wo, metalic, alpha, reflectance)
@ti.func
def getCosTheta(v):
return v.z
@ti.func... |
60362c4dbb78e1c6e578e23d2d1a18aad084242b | 2d9a10825316b1eceefd86cc293781685f8bb195 | /dec_profibus/layers/phy_socket.py | 6246dbd4c6def1c0d8ab41f89a30c25cd6454c6a | [] | no_license | sun221/Dec-Profibus | a5d5ee343d170e42272dd082d198fb9fbf88f2b3 | 5f3416617052244541b878fe8904c64da8533296 | refs/heads/main | 2023-04-10T03:40:40.235391 | 2021-04-25T21:05:14 | 2021-04-25T21:05:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,182 | py | phy_socket.py | from __future__ import division, absolute_import, print_function, unicode_literals
from dec_profibus.layers.phy import CpPhy , PhyError
import socket
from scapy.all import *
from layers.dec_scapy import FdlSd1
from util import *
from scapy.layers.inet import UDP,IP
from layers.databox_scapy import DataboxLayer
impo... |
620b78123a4a223f969a9f03d8fc11937878f747 | c91d907eec4c186db01122dbb1dc8d8d81ce269a | /common_nipissis.py | 95fbcb296da86acef4fed8cbc52875974b1728eb | [] | no_license | bernard-giroux/nipissis | 86b911e2182106054462c438959b059fb2292747 | b20e0a0fe9d7371c18a4cecba167de158360e5b2 | refs/heads/master | 2023-01-27T12:29:34.168891 | 2023-01-10T18:48:01 | 2023-01-10T18:48:01 | 203,840,443 | 0 | 0 | null | 2023-01-10T18:48:02 | 2019-08-22T17:16:47 | Jupyter Notebook | UTF-8 | Python | false | false | 1,659 | py | common_nipissis.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import pyfftw
import socket
if socket.gethostname() == 'harricana':
root_dir = '/Volumes/Data4/nipissis/'
elif 'saintemarguerite' in socket.gethostname():
root_dir = '/Volumes/Nipissis/'
elif socket.gethostname() == 'LAPTOP-K01UUA9T':
root... |
9d2fea857727d37c3f1423b36d2f9980af46e4b3 | f756a15c14ca3dadce424438961720969a12465d | /hongda/api/image_helper.py | e3852c741905aeaa47d13bd300446272e5c74289 | [] | no_license | buzz-buzz/hongda | 8aeca33977cdbfc52a168e29e8eef12869718155 | 248eedc78814f5d43afae11c51931db11c6f4649 | refs/heads/master | 2021-01-23T19:59:13.750210 | 2018-01-04T06:10:38 | 2018-01-04T06:10:38 | 102,840,308 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,593 | py | image_helper.py | import numpy as np
import cv2
__all__ = ['shape_to_np', 'rect_to_bounding_box', 'sub_image', 'add_paster']
def shape_to_np(shape, dtype="int"):
coords = np.zeros((68, 2), dtype=dtype)
for i in range(0, 68):
coords[i] = (shape.part(i).x, shape.part(i).y)
return coords
def rect_to_bounding_box(... |
698408869538aa5b4b906d519df85822821897f3 | 239d63c870027a7fa02888893fd7a0875f725dd5 | /maven-tests.py | 9713cedc1274ca29e031f800d7a17a8fdc6f5163 | [] | no_license | dave-t-c/hue-lighting-test-outcome | 137983858a348faf1889603d9c668c1d62b37cf0 | 85801b2dc1b9d3fe8f66e345d7769351b4abb6ad | refs/heads/main | 2023-01-11T02:08:03.746705 | 2020-11-05T09:36:49 | 2020-11-05T09:36:49 | 310,131,445 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,356 | py | maven-tests.py | import subprocess
import time
from phue import Bridge
# Input the correct IP for your bridge.
# To connect, press the button on the top of the bridge, then run the script within 30 seconds.
bridge = Bridge('Bridge IP')
bridge.connect()
# Get a dictionary of lights, then get the light you want using its name.
lights ... |
52887e662d3e4c316d61d7a0c91d1143c439a8fb | ba277b1ced9b4e93e62eb03a92c23250d832f5b7 | /ch8/RegressionTest.py | a51e950063287ab16d3993f6a38b88a6385724a8 | [] | no_license | JiinYuu/machine-learning-in-action | 1197965b467df16e43f25080301aa8d5e4fd4da1 | 1df31b74d6c897ea18005baae16aa535d726bf8b | refs/heads/master | 2020-03-20T19:53:58.326302 | 2018-06-17T14:06:59 | 2018-06-17T14:06:59 | 137,659,721 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,429 | py | RegressionTest.py | '''
Created on 2018年6月9日
@author: luomingqiang
'''
import ch8.Regression as reg
import numpy as np
# import matplotlib.pyplot as plt
# xArr, yArr = reg.loadDataSet('ex0.txt')
# print(xArr, '\n', yArr)
# ws = reg.standRegres(xArr, yArr)
# print(ws)
#
# xMat = np.mat(xArr)
# yMat = np.mat(yArr)
# yHa... |
eaeb980459da90ec1bf412be00296b4131c3095b | b2e3770aa2843a8cd2c2b6693b475fc7096d3190 | /whois.py | e265e6eb5c90a6862cbfc16c7c5f1a5c6a14ff94 | [] | no_license | JeongHaewon/bob6_forensics | 13d15d64532d16c3ead25614037fb5cded6f6ecc | 01c55bfba3b19e65b7e031a5693827953be1cccf | refs/heads/master | 2021-01-01T04:14:30.024343 | 2017-07-16T11:11:19 | 2017-07-16T11:11:19 | 97,148,495 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 417 | py | whois.py | import json
import sys
import pythonwhois
argument = sys.argv [1]
fout = open(argument, 'rt')
lines = fout.readlines()
fout.close()
file = open("file.p","wb")
for line in lines:
print line
WHOIS_DATA = pythonwhois.net.get_whois_raw(line, with_server_list=False)
print WHOIS_DATA
WHOIS_JSON = json.JS... |
58c66c8cbb1a2b30cbdccf886b5e06394927ca16 | 848d84f13953da3da48a2985d3eba414daab0e95 | /Mesos/sshcopy.py | 098f1a6bece68fb06bf74864232c93761b311332 | [] | no_license | dharamaraob/Python | 610a34dd6cbdc1cc19f64e50288a6b1f14626e5b | 62a2c058767d4607c997edb978ce8ef7d3e4a1f3 | refs/heads/master | 2020-04-27T09:55:58.533183 | 2019-03-10T22:29:10 | 2019-03-10T22:29:10 | 174,234,334 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,523 | py | sshcopy.py | #!/Users/baladh/python3/bin/python
import yaml
with open('users.yaml') as users:
usersdata = yaml.safe_load(users)
print (usersdata)
# transoform usersdata to host to group mapping
# output = list(map(lambda kv: (kv[1], kv[0]), usersdata['host_groups'].items()))
# print(str(output))
hosttogrp = dict()
for kv in u... |
669a0d890a4366c25d236e9b191ac4924df32710 | 9d83226838c80cb04c4c3052c1cb43804b75600f | /addServer/models.py | de248df75008809024e852a3da68d036cab8185c | [] | no_license | shyamkrishna123/uptime-newupdated | f6cf7ed4ffd3ec5bd0845504b4d65fc05b3a8f92 | b98dfbccc69806e5c1d5df7313ef54cc33e26939 | refs/heads/master | 2021-01-12T09:12:46.902084 | 2017-03-27T15:14:00 | 2017-03-27T15:14:00 | 76,797,789 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 858 | py | models.py | from django.db import models
from django.utils import timezone
class addServer(models.Model):
user = models.ForeignKey('auth.User')
server = models.CharField(max_length=200)
details = models.TextField()
ipAddress = models.CharField(max_length=200)
created_date = models.DateTimeField(
d... |
dc6506c984412bf7afa2ed3f8253e95fcadc21a7 | 1e76e79dce8b2dfc3186f9e78ad60b65712030ab | /mouseControl.py | 16290382d5f2cd957d805d94eee72f6d7523bd6e | [] | no_license | gchester98/Python-Projects | 019126617be9aac4c128f3b1c7261e0af2359fe4 | 83446f7c0a42662c42616bfb48a393ae9f615927 | refs/heads/master | 2021-06-21T22:30:24.328812 | 2017-07-24T15:51:11 | 2017-07-24T15:51:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 319 | py | mouseControl.py | import pyautogui
x= input("What are you looking for? ")
input("Press Enter")
pyautogui.FAILSAFE = True
pyautogui.moveTo(0,1000)
pyautogui.click()
pyautogui.PAUSE = 2.0
pyautogui.typewrite("Amazon")
pyautogui.hotkey("enter")
pyautogui.moveTo(353,115)
pyautogui.click()
pyautogui.typewrite(x)
pyautogui.hotkey("enter")
|
833654b4a6322c5e146eb5ed8aabb06611f1d17d | d4e83fa2c1f53d1dbb6da630be6bbe7cf4a4c982 | /Python-Brasil/5-Funcoes/ex_07.py | adf6b474650d76ab793196756fa829cf246eb6bf | [] | no_license | fabiorfc/Exercicios-Python | 124daae1239ebb5302f685941f9a87f1bbbd040d | c78e2e993e50b3564f3c059b89af3aaabd83fb57 | refs/heads/master | 2021-06-06T02:30:31.351273 | 2020-01-26T23:44:27 | 2020-01-26T23:44:27 | 147,123,795 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,402 | py | ex_07.py | # -*- coding: utf-8 -*-
"""
7 - Faça um programa que use a função valorPagamento para determinar o valor
a ser pago por uma prestação de uma conta. O programa deverá solicitar ao
usuário o valor da prestação e o número de dias em atraso e passar estes
valores para a função valorPagamento, que calculará o valor ... |
df5f27b8621d2d7360257e1ce81cf109f8540c69 | bade62af3028fba41af0b0d07aa3fad0f496ff52 | /api/services/access.py | 6da43f32857ee71b650b6be4637367fe9ea885f7 | [
"MIT"
] | permissive | kosyachniy/web | d03ab1fc59896e4d07554bdeff0b5051281c70e0 | fc5f5b507e9d36e871260f5badc4de7d24daf361 | refs/heads/main | 2023-08-14T02:25:35.315583 | 2023-07-30T08:02:39 | 2023-07-30T08:02:39 | 175,517,075 | 7 | 2 | MIT | 2023-05-23T06:26:12 | 2019-03-13T23:59:54 | Python | UTF-8 | Python | false | false | 1,978 | py | access.py | """
Check access by token
"""
import jwt
from fastapi import Request, Response
from starlette.middleware.base import BaseHTTPMiddleware
from lib import report
class AccessMiddleware(BaseHTTPMiddleware):
""" Access checking middleware """
def __init__(self, app, jwt_secret, whitelist):
super().__ini... |
c3c7af412856d2437ef15efcb72260e2469699e7 | b75598e0ca7d3bcef6df0f85248beae5709b7217 | /bot.py | cfd3aa9c7db995f9f628c00ed356f63e8e57a58f | [] | no_license | hp77-creator/ay-chal-batana-bot | 71f60ff183311dcbe996ddd1aaf630f583ea217f | 6f3b61fff52a2869e48bb96637888486e305c435 | refs/heads/main | 2023-04-22T08:36:40.411962 | 2021-05-21T12:37:34 | 2021-05-21T12:37:34 | 369,523,903 | 1 | 1 | null | 2021-05-21T12:28:43 | 2021-05-21T12:11:46 | Python | UTF-8 | Python | false | false | 802 | py | bot.py | #bot.py
import os
from discord.ext import commands
from discord.utils import get
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')
bot = commands.Bot(command_prefix='!ay-chal-batana ')
@bot.command(name='role')
async def tell_role(ctx):
role =... |
000dbce4513ca6bc4042d19c864e11bd6133488e | d61f7eda203a336868c010abb8f9a6f45dd51adb | /410. Split Array Largest Sum.py | 8d513b2ed93c86db19103ff84ee89075b63d5306 | [] | no_license | Mschikay/leetcode | b91df914afc728c2ae1a13d3994568bb6c1dcffb | 7c5e5fe76cee542f67cd7dd3a389470b02597548 | refs/heads/master | 2020-04-17T12:11:38.810325 | 2019-10-06T02:37:32 | 2019-10-06T02:37:32 | 166,570,922 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,083 | py | 410. Split Array Largest Sum.py |
'''dp'''
class Solution:
def splitArray(self, nums: List[int], m: int) -> int:
dp = [[float("inf") for i in range(len(nums))] for j in range(m + 1)]
pre = [nums[0]]
for n in nums[1:]: pre.append(pre[-1] + n)
for i in range(len(dp[0])):
dp[1][i] = pre[i]
for i i... |
0fb47298d414de17b4cf0540ab355afcab305d7f | 1bbe253bf98e5c75d7f9d25275b5451f6e90a34b | /test_admin/migrations/0010_questionforum_text_title.py | 4e7137a1f8755bd8759b6fbbd5c5d0595d8598d8 | [] | no_license | Marmik2003/quiz_project | 76a81c73e0bae50f377131423b5ad43c3343a598 | dfb51b4c1b63f5ee0a53f9a422698ddac27c48a6 | refs/heads/master | 2023-07-13T08:12:55.299387 | 2021-08-24T12:24:16 | 2021-08-24T12:24:16 | 397,984,831 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 407 | py | 0010_questionforum_text_title.py | # Generated by Django 3.2.6 on 2021-08-23 14:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('test_admin', '0009_alter_questionresponse_question'),
]
operations = [
migrations.AddField(
model_name='questionforum',
... |
188040aec9dbddb3eee121591cb2b3300ed81215 | b9b9360dd7d593fbf267c4a1cf46e5a665a9edfd | /notebooks/utils/satellite_util.py | dbd402b4b7ca1877c2231fa59e32932d4b0a21df | [] | no_license | cwein3/stanford-ai4all-vision | 11995efac538be7ca0d182d3d13922ec060c615e | 0f6d9888c2bbf0f5984f58dd7c2d49e003b08b17 | refs/heads/master | 2020-03-20T11:43:42.130598 | 2018-07-06T21:40:42 | 2018-07-06T21:40:42 | 137,410,568 | 3 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,570 | py | satellite_util.py | """
KEY = AIzaSyA7iLNu_ZPVjG56IB-WM1EM4zrZE9XFCQU
"""
from PIL import Image
import io
#from osgeo import gdalnumeric, gdal, osr
import matplotlib.pyplot as plt
import urllib.request
import os
import numpy as np
import h5py
import scipy.misc as misc
plt.ion()
KEY = "AIzaSyA7iLNu_ZPVjG56IB-WM1EM4zrZE9XFCQU"
with h5py.... |
ebb6d181ce6e741d9339ff354c533cf02713812e | 53fab060fa262e5d5026e0807d93c75fb81e67b9 | /backup/user_154/ch29_2019_03_31_15_13_43_248213.py | 84fadb5e7182ac347c5ec7a9e76fff5149c52629 | [] | 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 | 124 | py | ch29_2019_03_31_15_13_43_248213.py | def calcula_aumento(salário):
if salário > 1250.00:
return salário*0.1
else:
return salário*0.15 |
531b7649872aa1572f5f21d2ab0bd40caf2725e9 | 3867a1253de80d831ea7d3bba63fe11a8981bd11 | /bestbuyapi/api/products.py | ee1ce60d08768d858a8abc4d920a57848466fef9 | [
"MIT"
] | permissive | lv10/bestbuyapi | 69e754048af7cf8e04cb6139f9160052e20a6f27 | a424473e94fbcd21dd7a93d46233000c856188e8 | refs/heads/master | 2022-02-05T20:47:59.662564 | 2021-01-27T18:25:16 | 2021-01-27T18:25:16 | 35,838,468 | 11 | 2 | MIT | 2022-01-21T18:58:31 | 2015-05-18T19:37:51 | Python | UTF-8 | Python | false | false | 2,940 | py | products.py | from ..api.base import BestBuyCore
from ..utils.exceptions import BestBuyProductAPIError
from ..constants import PRODUCT_DESCRIPTION_TYPES, PRODUCT_API
class BestBuyProductsAPI(BestBuyCore):
def _api_name(self):
return PRODUCT_API
# =================================
# Search by description or S... |
3a69874e8f1cebc317fd50f298e29f789cb73559 | 4668458f6f6b02c5862c46edd637498bed52d187 | /tests/constant.py | 91bdf9d3ad77445614dac80dbb78dc1bf84030a9 | [] | no_license | anhtuan87/PySelenium | 8f1ed2fc992349b708a59403723249a2402009d4 | bd667e6f06523f8b169a0f899ae4f6f4729a214a | refs/heads/master | 2020-05-19T16:29:57.400212 | 2019-05-13T02:22:35 | 2019-05-13T02:22:35 | 185,110,587 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 147 | py | constant.py | # TIMING
LOADING_TIME = 30
# PATH FORMAT
PATH_L2_FORMAT = "{}->{}"
PATH_L3_FORMAT = "{}->{}->{}"
# TEST DATA
SPECIAL_CHARS = "/:*?<>|\"#[ ]{}=%;" |
3c571e8f11b2a67545ad108ae80d12f7276902a8 | c3f807bffb4d08d50ed01f788f28c72b1b7c7bd7 | /mysite/ScheduleOfCrawler.py | e4d074e8808fe6409bcf7c5ce946383486c8efe6 | [] | no_license | HuangLiang-Jun/PyDjango | c025a3df80837f2e0bd6ef29711de9c56264dfed | c4d1c8828f114ad37e76795e42e96280d41b0d80 | refs/heads/master | 2021-08-20T01:49:26.459267 | 2019-11-07T07:47:43 | 2019-11-07T07:47:43 | 149,743,021 | 1 | 1 | null | 2021-06-10T20:54:02 | 2018-09-21T09:39:57 | Python | UTF-8 | Python | false | false | 75 | py | ScheduleOfCrawler.py |
# 執行爬蟲任務
import fx_crawler
import ctbc_crawler
import tcbBank |
216e88bedb10363aa4f69e127fb58f92394d8ecc | 77f4c962205035f93246164c26b61b93518b2635 | /constants_h.py | 3f84cb2bf25cbc46b29df6f5950ab9e13dde5abb | [] | no_license | skywo1f/gamjam | dd4f08842c0d0f7facbc981ae39f89d01f9a78f6 | 011be6bb6ac57082c8b44661f0891b142f480c29 | refs/heads/main | 2023-05-14T11:42:26.642856 | 2021-06-08T11:26:54 | 2021-06-08T11:26:54 | 372,530,373 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 789 | py | constants_h.py | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 5 05:49:37 2021
@author: iviti
"""
import pygame
import time
import random
import math
#bulletList = []
#npcList = [] #list of npcs
reloadTime = 4 #time betwen shots
spawnRate = 30
bulletRange = 15 ... |
9efc7446a92a7357bf51c95b5e19bcf6891c59a5 | 6ef2a8e3733ac042f0c86392d2094b7ecac0d467 | /DoorTest2/DoorTest2.py | 70e8d91b0caaccbe8d1a3348723474ce832b22b0 | [] | no_license | jerryhui/thejasper | 6d278c4635339dd356cc551884a8127dda97cb20 | d470d983f28b9d0a907224b183dcff0c2f03d9f1 | refs/heads/master | 2016-09-15T21:58:46.592906 | 2013-05-10T06:54:17 | 2013-05-10T06:54:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 403 | py | DoorTest2.py | import VRScript
import lel_common
scene = lel_common.LELScenario()
scene.create_entity("DoorTest2_1", "models\\DoorTest2_1.osg", [-5.15169267326709,-4.42547834596913,-9.03557601863623e-018], True, False, "Concave", False, "Static")
scene.create_entity("stray_geometry", "models\\stray_geometry.osg", [0,0,0], True,... |
645ec1ff004e8e049fcf17c53f30e9ebe0a7ee62 | 37a89100be8fe42231b0156ee110ef917465ef1b | /data/alto_tools/scripts/alto_ocr_confidence.py | 1591324e43a8a6689559209dce929422e8e2f9c2 | [] | no_license | ml-research/moral-choice-machine-v2 | 1026a64b0d55b783625ad54cece963bce7b2db16 | 149086325731bc5330fb6609e76b23ca55ca22a0 | refs/heads/master | 2020-09-21T03:47:25.450337 | 2020-03-06T15:18:47 | 2020-03-06T15:18:47 | 224,669,595 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,572 | py | alto_ocr_confidence.py | #!/usr/bin/env python
# Usage: python alto_ocr_confidence.py <inputdir>
import os
import sys
import xml.etree.ElementTree as ET
namespace = {'alto-1': 'http://schema.ccs-gmbh.com/ALTO',
'alto-2': 'http://www.loc.gov/standards/alto/ns-v2#',
'alto-3': 'http://www.loc.gov/standards/alto/ns-v3#'... |
a23e2fdafadb1c34260779fe1b8e9f1b2b6de643 | df4361db61d10a10c46ed5f18973d89e4efda82c | /armi/nuclearDataIO/cccc/tests/test_pwdint.py | 10ab8cdc7b1453f1c4dc125be2210871e103fc9d | [
"Apache-2.0",
"GPL-1.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown"
] | permissive | terrapower/armi | 5524741c5e80781e136ea3422aed0db8398f76ae | 360791847227df3f3a337a996ef561e00f846a09 | refs/heads/main | 2023-09-04T05:16:29.080518 | 2023-09-01T16:10:29 | 2023-09-01T16:10:29 | 218,863,590 | 204 | 75 | Apache-2.0 | 2023-09-14T20:42:24 | 2019-10-31T21:18:34 | Python | UTF-8 | Python | false | false | 1,608 | py | test_pwdint.py | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
841f9a9554f2ae9e044e326af43397ac58a386c1 | 3aa35ea35eead6c37c7104a74cf8c7f08fb1af38 | /calculations.py | 3a1a7c9c286ca436ad752f6db1e4797085675b79 | [] | no_license | Bladesmc/python-calculator | 89041bd710412b158f40d93f7923ea23a6ccfed4 | eced5956ab6f7e04f5e0f07566e5adae6a594334 | refs/heads/master | 2021-04-28T04:15:10.810545 | 2018-02-23T20:08:33 | 2018-02-23T20:08:33 | 122,157,393 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,753 | py | calculations.py | # This file does all the fun math and returns it back to the command line or GUI.
import factorial as f
def calculate(inp):
inp = inp.replace(" ", "")
o = ""
if inp[-1] == "!":
o = get_factorial(inp[:-1])
elif inp.find("^") is not -1:
o = get_exponent(inp)
elif inp.find("%... |
9d389dee787b655503eaf43ef22c18c67f10ecc3 | 4d49450b3c7a0daf35022012ec7906ca556dd9e8 | /cn/2 - metode numerice de rez a sist liniare/subst_descendenta.py | d0e275806dc0a4301d2cb6cdc5ce64fa3e2496b5 | [] | no_license | rebecadiaconu/fmi | 3d3c7d977b8f61ee02a52b81c0cdc7ae0ccd31ae | 1ccee33441f6a1843bfe599eec6219b37c533c95 | refs/heads/master | 2023-04-14T08:39:11.996296 | 2021-04-22T08:49:55 | 2021-04-22T08:49:55 | 238,420,720 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 634 | py | subst_descendenta.py | import numpy as np
from sys import exit
def subst_descendenta(A, b):
n = len(A[0])
solution = [float('nan') for _ in range(n)]
solution[n - 1] = b[n - 1] / A[n - 1, n - 1]
for i in range(n - 2, -1, -1):
solution[i] = 1 / A[i, i] * (b[i] - np.sum([A[i, j] * solution[j] for j in range(i + 1, n... |
2565efc6a31587cf1ba824571084472650ab9bf1 | 60d5b5b1f1c912d1655de3884efc09dfddd8d132 | /sites/kotourism/slideshow/models.py | 2413a42d50599d2a715e0f718c396648d7f444b6 | [] | no_license | alexgula/django_sites | 15033c739401f24603e957c5a034d63652f0d21f | 038834c0f544d6997613d61d593a7d5abf673c70 | refs/heads/master | 2016-09-05T11:02:43.838095 | 2014-07-07T11:36:07 | 2014-07-07T11:36:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,325 | py | models.py | # coding=utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ..managedimage.models import upload_path
from picassoft.utils.models import ActiveManager
class Slide(models.Model):
name = models.CharField(_("Name"), max_length=250)
slug = models.SlugField(_("Slug"))
... |
d228cf27d554f7b0ef9318f38bb7dad3b3d77f78 | b7733e46123dac0ad36330203ff942a70cfa6e10 | /session2_syntax/s11_literal_string.py | 329a74c6bba11dd9b0dca386f2474639a85c6946 | [] | no_license | edu-athensoft/stem1401python | ead339f75253dc7f2851eb7ff123871064b3690c | 1fcf3f7ed47374010f8042dafbc8ed51401b4929 | refs/heads/master | 2020-04-28T19:17:01.744016 | 2019-09-21T17:57:38 | 2019-09-21T17:57:38 | 175,506,530 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 325 | py | s11_literal_string.py | #!/usr/bin/env python3
# _*_ code:utf-8 _*_
"""literals of string"""
strings = "This is Python"
char = "C"
multiline_str = """This is a multiline string with more than one line code."""
unicode = u"\u00dcnic\u00f6de"
raw_str = r"raw \n string"
print(strings)
print(char)
print(multiline_str)
print(unicode)
print(raw_... |
5898b8a5f824513ebbaca91dbf7d346dc7b7e213 | cac5b1d6bdbbaeeeb2f9176d64a0f126d92b4c42 | /user_service/parsers/user_parsers.py | 5e04ec3a9175a2fd3ba1c8a4abd719c4cd75766f | [] | no_license | garywu2/TLreaDR | 2b854d33a0e1dfd7ccde6b77686f29e54406140c | 6a336a5a391621edf0f3f85929ab4dd3df59d6ae | refs/heads/master | 2022-12-22T04:15:20.430926 | 2020-10-22T20:17:30 | 2020-10-22T20:17:30 | 240,349,018 | 6 | 0 | null | 2022-12-12T01:54:21 | 2020-02-13T19:58:39 | JavaScript | UTF-8 | Python | false | false | 1,176 | py | user_parsers.py | from flask_restplus import reqparse
user_add_parser = reqparse.RequestParser()
user_add_parser.add_argument('email', required=True, type=str, help='email of user', location='json')
user_add_parser.add_argument('username', required=True, type=str, help='username of user', location='json')
user_add_parser.add_argument('... |
6767fd354927477025b7046a3db12179c82df50a | 271e14c69d5a389df1e3abcfdef86cc7740a7fc9 | /algorithm/heap_sort.py | d3548ff4cb811606b692c0350a331fcdce5e70f8 | [] | no_license | hjpcs/sort_and_search | 25fead94579136a2c6a4ece2b8706c8bde3888c9 | fbad3f6d430bf214d7e6f200b99a650bef843a0c | refs/heads/master | 2020-04-15T05:08:58.287391 | 2019-01-07T09:41:43 | 2019-01-07T09:41:43 | 164,410,476 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,292 | py | heap_sort.py | # 堆排序
# 获取左右叶子节点
def LEFT(i):
return 2*i + 1
def RIGHT(i):
return 2*i + 2
# 调整大顶堆
# l:待调整序列 length:序列长度 i:需要调整的结点
def adjust_max_heap(l, length, i):
# 定义一个int值保存当前序列最大值的下标
largest = i
# 执行循环操作:两个任务:1.寻找最大值的下标;2.最大值与父节点交换
while (1):
# 获得序列左右叶子节点的下标
left, right = LEFT(i), RIG... |
68990583b48cfe734fcfb047c07efc2af07efafc | bc7191d61f51a382a6fc20a5bd94fd090e086a74 | /lab/sortowanie.py | e8041d3630d72c34f964e145c97b770c9f6db10c | [] | no_license | mdlutowski/PythonWyklad | c200e3f0aae4ba3fead92941bb96cda4af13a15a | 527acc5bf6a37ac248683fb6bc42d77859759064 | refs/heads/master | 2021-01-19T07:02:40.223733 | 2016-01-05T14:01:46 | 2016-01-05T14:01:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,341 | py | sortowanie.py | osoby = [{'nazwisko':'Nowak', 'waga':70, 'ulubione_dania':['schabowy', 'pomidorowa']},
{'nazwisko':'Kos', 'waga':30, 'ulubione_dania':['lody', 'ciastka']},
{'nazwisko':'Szpak', 'waga':40, 'ulubione_dania':['ryz', 'ogorkowa']},
{'nazwisko':'Kowalski', 'waga':70, 'ulubione_dania':['schabowy',... |
99cb3612c1511b11ed11bce76763767e0bdf9edc | c27c60befe8fcfd5d21c8928def6a6d7ea1501a5 | /registro/filters.py | 8d67324a4cd39a7beadd6c751712fc171f1ccc76 | [] | no_license | melaniacoronado/examenhacsys | 26df13e98e9a8e683da7305b5d3777677e71faf6 | ed28f5210586a0125681cf7d2a79cd1cbbf21224 | refs/heads/main | 2023-04-09T12:27:53.899417 | 2021-04-22T22:12:17 | 2021-04-22T22:12:17 | 360,391,865 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 861 | py | filters.py | import django_filters
from django_filters.filters import CharFilter, ChoiceFilter
from .models import *
from django_filters import DateFilter,DateRangeFilter,DateTimeFromToRangeFilter
from django import forms
opciones = [
('Abierto', 'Abierto'),
('Cerrado', 'Cerrado'),
]
class Incidenc... |
687f717eb508724a4da07d66bfb022f9d34e664d | 48946302f2cce535058dfbecc61302caf3676e1a | /simsims/euler_15_2.py | 2d1721c5341e9f512957b18e4a67e31b9ae89d19 | [] | no_license | need4spd/eulerproject | 86d39e260d80de28dc5c1b9e4d0e3d444436edb9 | 541cad4c2df692f23800f6ce8d74ee11af7f93b0 | refs/heads/master | 2020-06-04T04:16:47.190217 | 2012-06-01T05:36:21 | 2012-06-01T05:36:21 | 3,359,847 | 2 | 28 | null | null | null | null | UTF-8 | Python | false | false | 301 | py | euler_15_2.py | xList = list()
xSize = 21
for x in range(1, xSize+1):
cDict = dict()
cDict[0] = 0
cSum =0
for y in range(1,x):
cDict[y] = cDict[y-1] + xList[x-2].get(y)
cSum += cDict[y]
if x > 1:
cDict[x] = cSum
else:
cDict[x] = 1
xList.append(cDict)
print(sum(xList[xSize-1].values())) |
cd9f3a6d767c310b6ca36524609792d51838902f | b68481dec7f277a21b05a0e59e8d0e11c1ba0d0b | /homework/migrations/0001_initial.py | a02d37a15fcc1fc0a3d1693dac638e6bb3db00c1 | [] | no_license | alkiviada/grreedy_dict | 66e4209ad457344bac6a7b29726ce2c9614bda1e | 42052fe5bd26771bf2122c8385e72dc0a2c53494 | refs/heads/master | 2022-12-10T09:51:48.954980 | 2020-07-20T20:52:12 | 2020-07-20T20:52:12 | 147,335,255 | 0 | 0 | null | 2022-12-08T02:52:08 | 2018-09-04T11:25:09 | HTML | UTF-8 | Python | false | false | 2,872 | py | 0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-02-06 19:42
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('words', '0037_auto_20190206_1442'),
]... |
a40f058c47ab518c0be20302d4b87ff3eddbbe43 | 3ee59bd0729d6e7ff3e667fe7510b3bae9d3d6fa | /sdk/python-sdk/verity_sdk/__init__.py | 148d86d44da5818140d8ce04424cacd14107c21d | [
"Apache-2.0"
] | permissive | lauravuo-techlab/verity-sdk | 1525591cab8bd1fed12f79d2f5f8484aee2f1dce | c3ba9c433c8021310749330d5feeaff318f7319b | refs/heads/master | 2022-12-04T13:40:35.149564 | 2020-08-18T13:31:09 | 2020-08-18T13:31:09 | 288,653,834 | 0 | 0 | Apache-2.0 | 2020-08-19T06:37:19 | 2020-08-19T06:37:19 | null | UTF-8 | Python | false | false | 103 | py | __init__.py | """This is the official Python SDK for the verity-application"""
__pdoc__ = {
'version': False,
}
|
5c72a81e548489c2c531ef97133b90558f4b3880 | 7b5722dd76e959e816c732b87eafeb8b19e47947 | /shout_app/profile/migrations/0002_auto_20200102_1728.py | 61a4f81f4c2851427087256c3d716b8d82096b59 | [] | no_license | shhra/shout-prod | f577abc3571a7406d9d8779c005e990fd5d223b3 | 62dc87b83664f910fd81002e31e037611135a872 | refs/heads/master | 2022-04-07T18:51:53.925700 | 2020-02-08T04:59:16 | 2020-02-08T04:59:16 | 208,790,431 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 817 | py | 0002_auto_20200102_1728.py | # Generated by Django 3.0.1 on 2020-01-02 17:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('shou... |
fd6318617b7b8c8fec99177b5105ed8e060b97be | 90bc16580fbb23a7690e892680fac7b06b589d44 | /legacy/projects/state-mach-regex/extractlinks/extract_links.py | 613a8619964692735e836426faa4a215631eab32 | [] | no_license | sukhadagholba/Theory-Of-Computation | 7b6c1c0aa24d0ff08f587d85ad953050613f45a7 | 6a9e04ed3cadaa3b7478cd7351890a1586ec1ad3 | refs/heads/master | 2020-04-06T12:06:32.747751 | 2018-11-14T00:28:22 | 2018-11-14T00:28:22 | 157,443,634 | 1 | 0 | null | 2018-11-13T20:41:45 | 2018-11-13T20:41:45 | null | UTF-8 | Python | false | false | 1,142 | py | extract_links.py | import re # module for processing regular expressions https://docs.python.org/3/library/re.html
import sys
import csv
if __name__ == '__main__':
# Exit if command line args entered incorrectly
if len(sys.argv) != 2:
print("usage: extract_links.py [input_file]")
sys.exit(0)
# Filename is 2nd command line ar... |
c0a4f3816a2527e23a8d928235067a3993d0aefe | ac2a4a8b2cb994eaa9a3cb455990d88e6f9ee4a2 | /dynamic_programming/322_coinChange.py | 16c4475373d8237a89a0898d78c9dc0cf90c355d | [] | no_license | wscheng/LeetCode | 64f3e05ec2457c97aede0d7cf57533eb9f9308fb | 83e5dea02e99e512d2b34dac05dabebfdb66ef2a | refs/heads/master | 2020-04-12T14:20:20.065383 | 2019-02-01T06:04:07 | 2019-02-01T06:04:07 | 162,549,464 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,834 | py | 322_coinChange.py | import sys
class Solution(object):
# def coinChange_top_down(self, coins, amount):
# """
# :type coins: List[int]
# :type amount: int
# :rtype: int
# """
#
# def helper(coins, amount, current_num):
# # print(amount, current_num, coins)
# if... |
4e6ba757773db86a63464ac1c48f8ce21f1c581d | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5686275109552128_1/Python/linacurious/B.py | 4bbdc7eaad0d285e3b08694ece494064f19ddee3 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | Python | false | false | 637 | py | B.py | attempt = "B-large"
import time
time.clock()
def solve(plates):
result = max(plates)
for i in range(1,max(plates)):
actions = 0
for plate in plates:
actions += (plate-1)//i
result = min(result, (actions+i))
return str(result)
def main():
fin = open(attempt + ".in", 'r')
fo... |
93ea1ff9e56a0ab6c8ddddf2abfba83e7302378d | 695eff19f6ff0fa21027de121e61d50c23e27be9 | /DataLoader/loadData.py | 24387a06226a53a8d0c634406354d3a7a3384a6b | [] | no_license | PGRepo/IMDBMOVIES | 492c24d81a4038f316c18c788d3fa301ddbb62bf | 7fc4b1219832dfae69241003bdb0d72379d8085f | refs/heads/master | 2020-03-19T04:29:28.863967 | 2018-06-02T15:50:44 | 2018-06-02T15:50:44 | 135,834,430 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,220 | py | loadData.py | import requests
import json
import time
from pprint import pprint
from urllib.parse import urlencode
from urllib.request import Request, urlopen
with open('/Users/pratik/Documents/Programming/Python/Projects/IMDB_PROJECT/RestFramework/imdbmovie/restApi/imdb.json') as f:
data = json.load(f)
url = "http://localhost... |
e44feadd51081255d81403b3c81d21c97affa621 | f7688504d61e9b48a58225ef9ee828b2b6ec2f38 | /utils/dataset.py | f780aef956e155f79ab807b8c6fafc827b67107c | [
"Apache-2.0"
] | permissive | Justprogramer/JBLACN | 4826c0c568ea5ad9d19af3e9b763088681d8b5ab | 68c92afa1bc1da26ab182f377ffc3b22b621fe36 | refs/heads/master | 2021-05-26T16:08:43.523843 | 2020-04-08T16:36:54 | 2020-04-08T16:36:54 | 254,131,697 | 4 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,685 | py | dataset.py | # -*-coding:utf-8-*-
import re
from torchtext import data
import jieba
import logging
jieba.setLogLevel(logging.INFO)
regex = re.compile(r'[^\u4e00-\u9fa5aA-Za-z]')
def word_cut(text):
text = regex.sub(' ', text)
return [word for word in text if word.strip()]
def joint_word_cut(text):
return [word for... |
7503d28413d314f230f15fe103dc1b42c206fb97 | 18ce494b8b0cab95703e6b2932f5b9de29b31d36 | /shop/views.py | f859a5d9b4c718488ef161e5b3ecc41f8a5589b5 | [
"Unlicense"
] | permissive | AGNIHOTHRAM/shopping_exercise_django | 4b913e239f5dc8333f83b41c44e35109694ec4e8 | bb9b0e07735362751c319160ac4832138e0f4b5f | refs/heads/main | 2023-04-02T19:53:22.247777 | 2021-04-08T10:52:30 | 2021-04-08T10:52:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,760 | py | views.py | from django.shortcuts import redirect, render, get_object_or_404
from django.utils import timezone
from django.contrib.auth import login, authenticate
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Cart, Customer, LineItem, Order, Product
from .for... |
0d3e543aa82e9256a4147b01c2d2a92e62d4b38b | be34cfed6eb173a8ad5c909843c37710aed673da | /Archivos/App/__init__.py | 16d25c46c37df3a408b3db9b2d1421975a4704c7 | [
"MIT"
] | permissive | andrew962/Python | 9efa9ed5fd62a465f150647321eeab9f9c0a6bda | 4398da94e0f465c92bd560989ea61c324423782b | refs/heads/master | 2018-11-01T08:06:11.054162 | 2018-08-24T13:50:38 | 2018-08-24T13:50:38 | 112,813,593 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 543 | py | __init__.py | if __name__=="__main__":
"""
r #la r sobre esribe lo escrito
r+ #esta forma lee y escribe
w #Modo escritura solamente
w+ #Esta forma lee y escribe
a #Esta forma no sobre escribe
a+ #esta forma lee, escribe y no sobre escribe
"""
try:
archivo=open('clase4.txt','w+')
... |
407686ea12248860de2a23d409d2fd0c458f80f0 | 9f0e44870512328c52a5fc9345bf379cf3471e84 | /figures.py | dce90d46a9bbfe4073b54b4836595c0c389c84d1 | [] | no_license | mtolkacz/tetris | 9f7d999ab83315fdf709f7a78ab7ab4b1bde27b6 | 66cbf3902ca33428f8abac63d0a90b6dae4710c8 | refs/heads/master | 2023-03-31T05:13:34.310284 | 2021-04-08T06:00:27 | 2021-04-08T06:00:27 | 355,668,449 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 22,107 | py | figures.py | import random
from config import ROTATE_RIGHT, ROTATE_LEFT, RIGHT, LEFT
class Figure:
scope = None
fields = []
previous_fields = []
new_fields = []
new_fields_before_down = []
@staticmethod
def get_starting_position(x):
pass
def get_new_fields_before_down(self):
abov... |
97cfd5e4c913da474db41319d2fbc9e7b32f9f31 | 14d3ddb7cd699315ec4f2354e26c45138c8ecda9 | /iCompPythonFiles/usr/local/lib/iCompetition/python/scripts/updates.py | 8f4be9c480a54134b79c1eae3c07f5b5604235ba | [] | no_license | iCompetition/iCompetition_App | 36708bb8a39549618386083f3e692c4c23441635 | 2ad68f302d7784b1b4d586ac8b1f5468d784e442 | refs/heads/main | 2023-07-25T16:37:47.332127 | 2021-09-05T13:36:30 | 2021-09-05T13:36:30 | 314,947,775 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,220 | py | updates.py | #!/usr/bin/python3
##Script handles update related functions for iCompetition
##imports
import sys
import os
import logging
import json
import requests
import warnings
import argparse
import subprocess
from urllib.request import urlopen
from zipfile import ZipFile
sys.path.append("/usr/local/lib/iCompetition/python"... |
2abed503f2e6378874e9e626f58cd71b68dc6fc9 | 981cb3f9c778e7af7d13962e367fef1be0eb1a42 | /src/algos.py | e5b71f25bbe37f630dee2e80beb27ca7bbe38559 | [] | no_license | XD-OB/ft_linear_regression | 187c608a864720f665daaa5d480e3e025881fb45 | d011d01bf3c8e56049d4b03c32b5f2d8825d2fde | refs/heads/master | 2023-03-08T13:42:18.077818 | 2021-02-21T23:59:02 | 2021-02-21T23:59:02 | 321,099,466 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,007 | py | algos.py | # **************************************************************************** #
# #
# ::: :::::::: #
# algos.py :+: :+: :+: ... |
6371b5e40ec3d2b7c12d233e322240ad5e85108e | 428c1900f0a3d82fea5b5a7fcd5d93d4ca131fcc | /whmonit/client/sensors/test/__init__.py | 3db97e724d1b7f52800b1671a4e6e6a59d9dfcb0 | [
"Apache-2.0"
] | permissive | whitehats/monitowl-agent | 4a9a6dd98ef140be7f4066ee3526e2edd8a235ab | d3c36672bf444a4ab9a285f32c11a4ac3d2bda31 | refs/heads/master | 2021-01-17T10:07:27.159734 | 2016-04-26T23:53:57 | 2016-04-26T23:53:57 | 18,549,162 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 37 | py | __init__.py | '''
Sensors basic test __init__.
'''
|
38a6d10382ec1538e9df61238b88dd443c324157 | 171c19870fcfdd980651bc8d4dfc847eb8fe6513 | /wikidown-python/snakebiteClient.py | 999e8296761eb8b85815b7093d2398584b932151 | [] | no_license | chuxi/wikidown-scala | cdfde90c8d03ca25adf70aa6fe2927127ade11dc | 587547147790f7217dadcba021c1abcc6595573b | refs/heads/master | 2021-01-22T23:26:34.755639 | 2015-05-09T13:33:41 | 2015-05-09T13:33:41 | 35,192,796 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 359 | py | snakebiteClient.py | from snakebite.client import Client
if __name__ == "__main__":
client = Client("10.214.208.11", 9000, effective_user='hadoop')
for x in client.ls(['/']):
print x
print list(client.count(['/']))
print client.df()
print list(client.du(['/'], False, True))
list(client.touchz(['/test1']))
... |
92df06428c4d3341c4cd351c85de155f2440e2eb | 2450532d85ed096dbc30e1a8d1e0bd3d6fa98628 | /combinatorial_fragmentation/rank_fragments/fragment_scheme_score.py | 21fbc4e117b0fd9c629f77a0742528996caba1ca | [
"MIT"
] | permissive | choderalab/fragmenter_data | a379b623bc19927c86d0714dd9c65e5bc8ede60e | 01d63aea340e91f8cbb3a21253a906a0c3c66da3 | refs/heads/master | 2021-07-25T01:49:56.956452 | 2021-06-27T22:25:43 | 2021-06-27T22:25:43 | 131,762,688 | 5 | 3 | MIT | 2021-06-27T22:17:23 | 2018-05-01T21:01:05 | Jupyter Notebook | UTF-8 | Python | false | false | 5,477 | py | fragment_scheme_score.py | import fragmenter
import json
from openeye import oechem
import matplotlib.pyplot as plt
import numpy as np
def fragment_bond(mapped_mol, bond, threshold, path, functional_groups, keep_non_rotor):
"""
Generate fragment for bond
Parameters
----------
mapped_mol :
bond :
Returns
-------... |
5173e8a1dc8bea07026c39ea6f457320240b5728 | 31b1084062c7f137a5cd096b196e7d7a17d7bbfb | /homeworks/A10300/A10300-饱食终日-homework1/homework1.py | 1b7397c5eb3deb35adbfdde24226f766b9162552 | [] | no_license | Baoshizhongri/uband-python-s2 | 96410dfe295fe11aeb68894fc3ae5a46162de234 | aaf4a431a5919e94edc811da0655faa9df7c2c2b | refs/heads/master | 2021-01-22T18:18:16.940766 | 2017-08-18T15:20:21 | 2017-08-18T15:20:21 | 100,722,026 | 1 | 0 | null | 2017-08-18T14:49:16 | 2017-08-18T14:49:15 | null | UTF-8 | Python | false | false | 2,411 | py | homework1.py | # -*- coding: utf-8 -*-
import codecs
import os
def handle_split(words):
new_words = []
for word in words:
if '-' in word:
temp_words = word.split('-')
new_words.extend(temp_words)
else:
new_words.append(word)
return new_words
#1. 读取文件
def read_file(file_path):
f = codecs.open(file_... |
d30f1951fa8af7fd3fccbe69066b929a428a47e3 | 22b3d92cc453409e8cf4164fcb29e28e8c3424ab | /ndmusic/apps.py | d035f13e226ab9b645e1f5b0195fba7838110e7e | [] | no_license | Adnn/Collecster | 3e18733962a531ea2ca6d2d22b828620ebe63c7f | f04312484ce6cb2fe56ee49e1732aeba74332823 | refs/heads/master | 2022-12-02T06:16:05.177827 | 2021-04-14T10:36:17 | 2021-04-14T10:36:17 | 41,563,756 | 2 | 0 | null | 2022-11-22T04:06:46 | 2015-08-28T18:55:49 | Python | UTF-8 | Python | false | false | 89 | py | apps.py | from django.apps import AppConfig
class NdmusicConfig(AppConfig):
name = 'ndmusic'
|
5aa2f6241b673ab02cc2b26d022915a5c8e585f9 | 5c1e82b9a237b2a87a7d305752aec814de37f756 | /mid_element_linkedList.py | b08f7c1bcf552645b09cdfcccb292880daa278d1 | [] | no_license | rakesh-kr/Python | 301553e4d38243af81e81912cbce6dd112610ac7 | 1151be6fbd9bf695f2c805fa50de8975271613ce | refs/heads/master | 2021-01-11T05:51:52.209134 | 2016-09-24T10:36:14 | 2016-09-24T10:36:14 | 69,095,861 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,202 | py | mid_element_linkedList.py | import sys
class Node:
def __init__(self,data):
self.data=data
self.next=None
class LinkedList:
def __init__(self):
self.head=None
def insert_begining(self,data):
node=Node(data)
node.next=self.head
self.head=node
def display(self):
p=self.head... |
d40c968253ff349c7232fc3adcad4b642651dfca | 2f22bc81e3d2833c178b2f2f750bea545e9fa3bf | /py3/scrapy/scrapy_lamyoung_title.py | 7236dc19d581062b4687ae487c3ab0c76bee053f | [
"MIT"
] | permissive | SherryZhu240/python-exercise | 325efc93490528637e4c2bf9e787302ebbfd4340 | 4dc703368ac385d4d412587bc672de09a33a0381 | refs/heads/master | 2022-03-21T23:35:03.171644 | 2019-12-10T10:22:27 | 2019-12-10T10:22:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 718 | py | scrapy_lamyoung_title.py |
#author:lamyoung
import requests
import re
write_content = ''
regex = r"<a href=\"(.*)\">[\s]*?<h2 class=\"post-title\">[\s]*(.*)[\s]*</h2>[\s\S]*?</a>"
index=1
while True:
page_url = '';
if index>1:
page_url=f'page{index}/'
url=f'http://lamyoung.com/{page_url}';
print(url);
html=requests.get(url);
if html.... |
e133bfc2b64153d7b44518f6b9709ec8a81206ac | 53224f0899b4e37dc4db30d39099ab864661d9f8 | /voussoirkit/winglob.py | c2f91af42b8fea8a439dcc0c4e140ed3248081e8 | [
"BSD-3-Clause"
] | permissive | voussoir/voussoirkit | 749c48a5ffa0905fc7d6d95ee1580f5d754915a1 | 0881f43d857492a76f5f2991c2d2ee062ea0100f | refs/heads/master | 2023-09-03T20:01:39.495950 | 2023-08-19T23:37:59 | 2023-08-19T23:37:59 | 162,239,074 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,686 | py | winglob.py | '''
On Windows, square brackets do not have a special meaning in glob strings.
However, python's glob module is written for unix-style globs in which brackets
represent character classes / ranges.
On Windows we should escape those brackets to get results that are consistent
with a Windows user's expectations. But call... |
361936ce9a0cc13ab839432b107e080e1626e4ae | 6e5ab77fee1fb4a0310213dd8c6dd8601828b1b9 | /Algorithm/Swea/D4_7701.py | bbd3ceb3586fa862e3dc816a095cb2b3be5fe1ac | [] | no_license | hongyong3/TIL | 36d031c0da9e3e6db3eebb977bd3e12df00a849f | 7f1492128e957a78fc95b255f4f7f2978161e471 | refs/heads/master | 2023-08-19T09:16:03.231757 | 2023-08-18T09:38:47 | 2023-08-18T09:38:47 | 162,100,258 | 1 | 0 | null | 2023-02-11T00:52:32 | 2018-12-17T08:42:42 | Jupyter Notebook | UTF-8 | Python | false | false | 262 | py | D4_7701.py | import sys
sys.stdin = open("D4_7701_input.txt", "r")
T = int(input())
for test_case in range(T):
N = int(input())
data = sorted(list(set([input() for _ in range(N)])), key = lambda x: (len(x), x))
print("#{}".format(test_case + 1), *data, sep='\n') |
f6a3cc3a2b173b4284877c1692d75789b5b8128d | a25253ae58d65ad05c1aae23292b81876e0aa187 | /tests/test_attention.py | 853ad6706129ac3674fcbe826492810603cccf3d | [
"MIT"
] | permissive | maximzubkov/LinBERT | bd78b3a83622e601da5a85cd97e708ba9b7f90c1 | 91b06fc374287f39d37aa69f6165337fb6767bc2 | refs/heads/master | 2023-08-04T20:24:01.187231 | 2021-10-05T16:39:38 | 2021-10-05T16:39:38 | 307,974,050 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,691 | py | test_attention.py | import torch
from transformers import BertConfig
from models.modules.fast_transformers import LinearAttention
config = BertConfig(
has_batch_norm=False,
pos_bias_type=None,
feature_map="elu"
)
@torch.no_grad()
def test_lin_head_mask():
attn = LinearAttention(config)
attn.eval()
seq_len = 3
... |
f6fddc7a8eb0bd4c5900c44e1bc86f68d8d541fc | 477b5a881d281ffe2f7da7db60813ba49557b09a | /py/guild-discovery/matchmaker.py | 72d71cd6639afb0d82a8de7d89b86a812e5fc8d8 | [] | no_license | WestonJ87/guild-discovery | f0af826eaa32003e9d526027c92adeb8114311b4 | 316539b756a86537e9ca6eb4123c8c0bf8a2e7bf | refs/heads/master | 2023-01-30T01:24:41.251456 | 2020-12-04T04:31:55 | 2020-12-04T04:31:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 338 | py | matchmaker.py | from pprint import pprint
from database.models import Guilds
import json
import random
def getCorrelationsForUser(allGuilds, userInfo):
guildCorrelationList = []
for guild in allGuilds:
guildCorrelationList.append({ "guildID": guild.guildID, "correlationForUser": random.randint(0,100) })
return gu... |
e946d5de37a44f969ed3b6ac32fcf10b4c862fd2 | 419c78603992eec9946eaebf628774a60f163d85 | /distribution.py | c7128760303840c83d646c559fde4a434068e94f | [] | no_license | Binh9874123/lap2static | 092ff93af94420710e9f05961d9fbc3cc59c03f7 | 8d5f89fd2256e0ec3bd772e98b9491ffce5b8fd5 | refs/heads/master | 2023-04-20T16:55:34.568438 | 2021-05-03T20:20:13 | 2021-05-03T20:20:13 | 364,049,822 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 653 | py | distribution.py | from numpy import random
import numpy as np
loc, scale = 0.0, 1.0
def norm_distr(size):
return random.normal(loc, scale, size)
def cauchy_distr(size):
return random.standard_cauchy(size)
def laplace_distr(size):
return random.laplace(loc, 1 / np.sqrt(2), size)
def poisson_distr(size):
return ra... |
85155a797059c24be22e867ca4c5bf7a2566e1bf | 2adec8f22e1c4badb8a851500ab390ce2147ecc2 | /readers/getATL03.py | e88e0061234a18a8a393b1d7baa7afc153b21827 | [] | no_license | whigg/IS2_ML | 306dfe84e75822f0cf4c999ea851f9c1fe4d21ee | f68979e698730a116d1785c5a7ec21f8cac07655 | refs/heads/main | 2023-08-17T05:10:21.429179 | 2021-09-13T15:37:36 | 2021-09-13T15:37:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,686 | py | getATL03.py | import warnings
import h5py
warnings.filterwarnings('ignore')
import numpy as np
import pandas as pd
import datetime as dt
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import h5py
import scipy
# from astropy.time import Time
def convert_time(delta_time):
times = []
years = []
months = []
... |
a6f5fbe856b61953f8820ea9844fbd19437abc45 | 00e047fd4bac6ed22d3cf26be576ade267c59bf2 | /gaia-crf1/TEST.py | b1b81abfe63b2f1749fd2b6affea57005d6eb300 | [] | no_license | Niu-Liu/thesis-materials | 96d991ab4f9044b7884c3b75986678f0eac38606 | 478d7d484d7746131b6892ea98b5355b3118242c | refs/heads/master | 2021-03-18T20:58:42.116703 | 2020-05-28T08:49:38 | 2020-05-28T08:49:38 | 247,099,883 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 187 | py | TEST.py | ##!/usr/bin/env python3
## -*- coding: utf-8 -*-
"""
Created on Wed Jan 25 16:45:58 2017
@author: Neo
"""
OUTFILE = open('test.log', 'w')
print('a b c', file = OUTFILE)
OUTFILE.close()
|
a345121c534936f3adc916ab2305c2ec6e588a05 | c7e6813162cd195277ef83cbd584a67b6f8054a9 | /Cheat.py | 5a553460105ab669686f80a11482a134bd64541b | [] | no_license | kourgeorge/deep_cheat_game | 6943b88b39ec29d6ad565cc690f0539501f6d9bd | 5caede43c8a134ba4528a53813464deb0e4a80f3 | refs/heads/master | 2020-03-25T11:21:28.098380 | 2018-08-06T13:04:49 | 2018-08-06T13:04:49 | 143,729,354 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,688 | py | Cheat.py | import numpy as np
from Action import Action
from ActionLogger import ActionLogger
import cheat_utils
NUM_CARDS = 13
class Cheat:
def __init__(self, players):
self._players = players
self._num_players = len(players)
self._pile = []
self._turn = 0
self._acti... |
0572d3896e44f9f44f843aa0bfeab90b8755f5c6 | 8a391496435094151cf1827feec5678fe8e617eb | /Django/YaKasserole/comptes/forms.py | 16420bef7a0377d52dd8c9a1a7ea2f248a5d5e8f | [] | no_license | Mrbenoit624/Yakasserole | 93b10b55a7a1f4de34cdbc007acf045dae60b0bf | 48fe8c84a92066d3593f53067b61ca4d9263c105 | refs/heads/master | 2021-07-14T22:13:27.285143 | 2017-06-30T21:18:26 | 2017-06-30T21:18:26 | 107,598,822 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,511 | py | forms.py | import re
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.core.validators import RegexValidator
from payments import get_p... |
469ee34db35081a6de73ce632d2fde9f84e85285 | 11153b7a10f3d2c4474ec60eab4f592ae8e1d420 | /1stpython.py | 3f870d1c8406c63840449904688d66a3f8d2ac3b | [] | no_license | SuhairChohan/ibmcourse | 18a2c5daaacec6240a044af6363bfc5f66df1791 | dc62b35eec8f55e12517c429070774d0a817ea00 | refs/heads/main | 2023-02-27T13:31:58.841969 | 2021-02-07T18:16:52 | 2021-02-07T18:16:52 | 336,853,804 | 0 | 0 | null | 2021-02-07T18:16:53 | 2021-02-07T18:01:43 | Python | UTF-8 | Python | false | false | 24 | py | 1stpython.py | a = 21
b = 2000
c = a+b
|
384d927808c353aa3ac9d142c6f7544004d26e07 | 13b3e30ca425b399ef2e86e6d557af26658d173f | /etl/spark_etl.py | e545da2b7e4858016deb56011b022941d0b6f10d | [] | no_license | frankfanslc/florasense | 6c88832aee8e9fa23ece47470819d74485194a6f | 91a772d280b4b1fcd9f5f35e1485aadb8cceacf1 | refs/heads/master | 2023-08-05T08:45:34.030010 | 2021-09-19T03:39:48 | 2021-09-19T03:39:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,435 | py | spark_etl.py | from datetime import datetime
import os
from pyspark.sql import SparkSession
from pyspark.sql.functions import mean, col, current_timestamp, to_date
from pyspark.sql.functions import year, month, dayofmonth
from pyspark.sql.types import TimestampType, DateType
"""
Spark job on Amazon EMR
Writes sensor readin... |
4dce4cc9530e27f811cd233e72acc17ae189d7b5 | d545b10bcd2ab389e7384832d83d0856bb718ce3 | /count/BusCount.py | a50853a82e0b7e4767f7beb1bc1bded77deeb367 | [] | no_license | totoupup/PythonCode_E3DCM | eb8bb810f42e4ae1a06b20ca3b1214e2fefdc285 | 4f81c8bc065b98af00d2cff522ccb344df684e5f | refs/heads/master | 2023-03-21T09:19:07.247018 | 2021-03-01T07:13:16 | 2021-03-01T07:13:16 | 321,527,683 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,891 | py | BusCount.py | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Description: 统计范围内公交车Todo量
# ---------------------------------------------------------------------------
import os,time,arcpy
from city_dict import city_ce_dict,city_ec_dict #中英对照字典
from config import old_vno,new_vn... |
b19b7ab7b8b217022299df9218609c19acbd0c99 | 8a8b0267c4db8847a898ac73ccb6e78e1744e24c | /Python_Net_Programming/pnp-ex02/hellohttp/server.py | e4b337122a1952de38729360c0029c501abd991e | [] | no_license | entirelymagic/Link_Academy | 41ba890df6793924d186ea94dc8d13b0636c6679 | 844c39ff1281fae8406cd1a0dc06afd357f0bef3 | refs/heads/master | 2023-06-07T03:17:00.527924 | 2021-07-03T09:59:25 | 2021-07-03T09:59:25 | 314,755,255 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,182 | py | server.py | import socket
import selectors
def accept(sock):
conn, addr = sock.accept()
conn.setblocking(False)
sel.register(conn, selectors.EVENT_READ, read)
def read(sock):
request = sock.recv(1024).decode("utf-8")
parts = request.split("\r\n")
description = parts[0].split(" ")
filename = descript... |
d60a412192c8cbc36b8924cbd37b5cf65e172b1d | b9a2db231ee80cc38390983c2b3f77bc56d533bb | /api/urls.py | f0983d76d238bbba3cef397d149aea1d0818752d | [] | no_license | victoria-skylan/intex2db | 670bc910ee0d1d499110b82f294b266cd8fae375 | 26d3d14254c641e6d23954de224f0c586ae71013 | refs/heads/master | 2023-08-17T07:40:02.382343 | 2020-04-10T05:47:46 | 2020-04-10T05:47:46 | 254,530,008 | 0 | 1 | null | 2021-09-22T18:51:52 | 2020-04-10T02:55:08 | Python | UTF-8 | Python | false | false | 388 | py | urls.py | from django.conf.urls import url, include
from django.urls import include, path
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
from api import views
urlpatterns = [
path('campaigns/', views.CampaignList.as_view()),
path('campaigns/<int:pk>/', views.Campaig... |
c4b4a2c92404900468184aa44cf433c069d14139 | 03e3138f99f275d15d41a5c5bfb212f85d64d02e | /source/res/scripts/client/gui/Scaleform/daapi/view/meta/BattleTankCarouselMeta.py | 0be6d64b4af51c0f9428a80f6b6ecd1605f63283 | [] | no_license | TrenSeP/WorldOfTanks-Decompiled | e428728e7901146d0b599d02c930d70532232a97 | 1faa748acec1b7e435b657fd054ecba23dd72778 | refs/heads/1.4.1 | 2020-04-27T08:07:49.813023 | 2019-03-05T17:37:06 | 2019-03-05T17:37:06 | 174,159,837 | 1 | 0 | null | 2019-03-06T14:33:33 | 2019-03-06T14:24:36 | Python | UTF-8 | Python | false | false | 738 | py | BattleTankCarouselMeta.py | # Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/client/gui/Scaleform/daapi/view/meta/BattleTankCarouselMeta.py
from gui.Scaleform.daapi.view.common.vehicle_carousel.carousel_environment import CarouselEnvironment
class BattleTankCarouselMeta(CarouselEnvironment):
def setFilter(sel... |
559355e28ff8f6ff33d59ebd44a7a05991ebf30f | be0dd4305db0ed58693af484edf89b4f94765f92 | /bias_subtraction.py | 3b86fe639dc69cf29b34ac3711a1367731cc360e | [] | no_license | georgezhou/hsfu23 | 44468e2604dff31b7f5b024d25d17904f18caaf8 | 8184b23f1d3333e0fe7664db4aeb253a3caf726f | refs/heads/master | 2020-04-15T01:40:46.478620 | 2015-04-15T06:40:20 | 2015-04-15T06:40:20 | 2,831,996 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,585 | py | bias_subtraction.py | ### Load python modules
from pyraf import iraf
from numpy import *
import string
import sys
import os
import pyfits
### Load functions script (located in the same folder)
import functions
### Load iraf moduels
iraf.imred()
iraf.imred.ccdred()
iraf.imred.kpnoslit()
iraf.astutil()
###################
### Description #... |
823fa97961609c1aec2a10eaaa9e0aba220fe525 | c3a293e7c9fc24e423071a70d155aa77ec3152cd | /employee_register/urls.py | 3710fc50fa6c2a96ebc92bccc2081b8fd6900db1 | [] | no_license | PPOSM1993/employee_project | 5f8d05feb6d3fae3ff8f9a5c0987403771871be3 | 58cdf6d890142ccf99cdd6bc590e1855ec653bde | refs/heads/master | 2023-03-06T12:32:56.663857 | 2021-02-23T14:55:13 | 2021-02-23T14:55:13 | 341,589,525 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 525 | py | urls.py | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.employee_form, name='employee_insert'), #solicitudes get y post para operaciones de agregar/insertar
path('list/', views.employee_list, name='employee_list'), #solicitudes get y post para listar todos los registros
pa... |
b655b72e8534fb5f14c759e46578671722b4c46d | 32d09c807c78537df0cb7182b7df3978e00bca13 | /SimulationDoc/Point.py | 29590eb5d8f2524997e824e64fa3a5fa94132362 | [] | no_license | WoodySun1994/machinelearning-radar | 5335ff2734bb239bf128d5deb2bf141bff25ef10 | 5e0d37d53310d5281b5165a23b326468f1ea50fc | refs/heads/master | 2020-09-01T07:33:41.965285 | 2020-02-19T11:56:28 | 2020-02-19T11:56:28 | 218,909,271 | 0 | 0 | null | 2019-11-11T02:51:21 | 2019-11-01T03:48:47 | Python | UTF-8 | Python | false | false | 3,578 | py | Point.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
更新:“2020.2.17
#功能:实现仿真数据点相关类
#auther: woody sun
'''
import random
import math
class Point:
def __init__(self,x = 0, y = 0, movType = None,speed = 0, posAngle = 0, accelerate = 0,frameNO = 0,movAngle = 0, **kwargs):
'''点类,输入参数包括x坐标,y坐标,运动类型,速度,方位角,加速度,运动角度,所处帧... |
8d9bc401e73a7ad481ec69125220195c4c862141 | a1b39c2afd54772e3119b14d897232d29f168c64 | /20-day/example-project/example/spiders/mycrawler_redis.py | 68c864936b13579de892c7c27ae9db573ff0c7c5 | [] | no_license | XUANXUANXU/6-web-crawler | cd546341f1fd3ba4de37ef2df75f68108dfc88e0 | 03243fabf593b06f54fe32223e422bcb669789d0 | refs/heads/master | 2020-04-14T11:49:25.502988 | 2019-01-02T09:57:48 | 2019-01-02T09:57:48 | 163,823,715 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,488 | py | mycrawler_redis.py | from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
from scrapy_redis.spiders import RedisCrawlSpider
from example.items import bookItem
class MyCrawler(RedisCrawlSpider):
"""Spider that reads urls from redis queue (myspider:start_urls)."""
name = 'mycrawler_redis'
redis_key =... |
d58e09f250bcf5a2a8c7c2fb52a8a0e2a02609a0 | 8e30082f46128316d78504c5efa13319726a52fd | /opencv/opencv13.py | 66a4930b33f32797ab670be46da295bf1bb7efcb | [] | no_license | vbitjp/Python | 8d08bcaa8fac6348798bbc199b6cc965b163c81c | abfe098ab2152ded87d121c42c1df5ca37c7e837 | refs/heads/master | 2021-09-12T17:56:28.100117 | 2018-04-19T14:28:41 | 2018-04-19T14:28:41 | 106,935,158 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 687 | py | opencv13.py | # coding: utf-8
import numpy as np
import cv2
img = cv2.imread("./sample.jpg")
# フィルタの定義
filt = np.array([[0, 1, 0],
[1, 0, 1],
[0, 1, 0]], np.uint8)
'''
filt = np.array([[1, 1, 1],
[1, 1, 1],
[1, 1, 1]], np.uint8)
'''
# 膨張(という名のノイズ除去)
# see also http:... |
bea221a48df57184e5a878041b83241e5e42ec7e | 7e24b83ea6d9f4bc5b2cc3fd422f75eb02b43c35 | /python/dw/run.py | 7ed3a32aedaa9e6ba70cf998fb4424f7e7aea165 | [] | no_license | jmmills/notebook | 62ef39ce368e4a143a397cb851253fee5724b4a8 | 0036496573a9848f942e42a612304b22ee9d9ce9 | refs/heads/master | 2020-12-19T22:01:50.696077 | 2016-06-03T02:17:19 | 2016-06-03T02:17:19 | 14,848,191 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 285 | py | run.py | #!/usr/bin/env python
import sys
import get
try:
file = sys.argv[1]
except:
file = 'urls.txt'
rq = get.RQ(1, 3) # run once and timeout after 3 seconds
rq.run(file)
print('RQ request,', rq.stopwatch())
std = get.Std(1)
std.run(file)
print('Std request,', std.stopwatch())
|
867d23547877bf54478be876835f53e38e6764ad | 94d1face7f63908f4776d9656d7c509f1f3d7605 | /gradivo/hierarchical-clustering.py | 4614e418d2173c13087e724b78692d2776d305d2 | [] | no_license | BlazZupan/uozp-zapiski | be7f4e988f7c404db4108619c4fe73f57d726555 | 846ba038f355111f308d654451aba9f5d1126497 | refs/heads/master | 2023-06-08T03:01:08.629668 | 2023-05-28T06:33:28 | 2023-05-28T06:33:28 | 97,014,240 | 11 | 16 | null | 2023-05-28T06:33:29 | 2017-07-12T13:58:26 | TeX | UTF-8 | Python | false | false | 1,980 | py | hierarchical-clustering.py | import math
import pandas as pd
from itertools import product, combinations
class Clustering:
def __init__(self, filename):
"""load the data"""
self.data = pd.read_csv(filename, sep="\t", index_col="ime")
def row_distance(self, r1, r2):
"""distance between rows"""
return math.... |
81d24abedb27382ec4cb8aa0afe64f7dfac877a9 | fa98505a8aff45ba1d6b89e447048c436e5fbfbd | /data/scripts/collect_page_data.py | 40efda5f839277bb967a265ebef7532f62ff7990 | [
"MIT"
] | permissive | wesenu/mit-smart-confessions-data | 2b43498d30beff0dc48600b8e950cffcfbce9e64 | b2a447497af539c279587cda326b69a410cee4f3 | refs/heads/master | 2023-01-23T07:19:04.539977 | 2018-12-11T18:30:16 | 2018-12-11T18:30:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 20,012 | py | collect_page_data.py | """
The main purpose of this is to collect data from a facebook. The data
collected will include all the posts made by the page given by the page
id and dump them into a json file in /data. This is raw data, taking in
all the information possible about all the posts within that facebook
page.
Five JSON files (if ran t... |
88d88d4373dc3ea08159dfda25e60b79d070a732 | 65b4bfd1ebe8fefe0cfdd73cfd33f3b84bcdb1f9 | /tbincrease.py | 97bea627090d080c973eb3b2f60544804d02aa00 | [] | no_license | krozic/scripts | 7c6318c47acd7371460a982d1dcb3a4b6ebc514e | 06a6fb5a85bfd3acc8939edd7c9e880231a3cb4f | refs/heads/master | 2021-01-19T17:07:42.124427 | 2017-04-14T22:18:36 | 2017-04-14T22:18:36 | 88,306,930 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 690 | py | tbincrease.py | #!/usr/bin/python
#This is the...
##############################
################################
# ,,,,,,,,,,,,,,,,,,,,,,, ##
# Top-Bottom Increase ##
# ''''''''''''''''''''''' ##
###############################
import os
import subprocess
tpadding = ""
tpadding = str(subprocess.check_output([... |
9cdc026331f1b05bf9e3f8b8e4c4748b38ae7554 | 153e60ba5f164ee24cbfff15f16740348df7187a | /Computaional_tutorial/Aitken-method.py | f45722e48ee01761c32ff59aebd73b64dcf3041c | [] | no_license | vmuralee/Python-Projects | d205e64dbd8c37619b5eb1c88cefebc633f3eddb | 5ad86b6c20a49fee83b83c109f813a2e368ccafa | refs/heads/master | 2020-05-03T07:56:17.896567 | 2020-03-28T12:07:18 | 2020-03-28T12:07:18 | 178,512,146 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 786 | py | Aitken-method.py | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 22 17:39:07 2019
@author: Vinay
"""
import copy
import matplotlib.pyplot as plt
# Aitken Method
def Aitken(x_arr,y_arr,x):
npoint = len(x_arr)
ftmp=y_arr.copy()
for j in range(1,npoint):
for i in range(npoint-j):
fx = (x-x_arr[i+j])*ftmp[... |
ba49abf0c1098829a9033636558a7d721d78b9cb | 5f4a5c50adf011d6dd73202b572e1574465e6eab | /advent_of_code_2021/aoc_2021_9.py | f34fb8b9782af41f4d2d3137cd66aa038be0511b | [] | no_license | susan101566/algorithms | 118addc5b20c800869c2642a1cc557975b0715c9 | 2aafcd44d9308f11e2febe2ff4004eb86fb82dc2 | refs/heads/master | 2022-05-09T19:00:16.785162 | 2022-04-16T21:38:44 | 2022-04-16T21:38:44 | 133,849,360 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,140 | py | aoc_2021_9.py | from collections import defaultdict
f = open('input.txt', 'r')
m = []
result = 0
for line in f.read().strip().split('\n'):
m.append(map(int, list(line)))
h = len(m)
w = len(m[0])
def nei(i, j):
r = []
for x in [(i-1, j), (i+1, j), (i, j-1), (i, j+1)]:
if x[0] >= 0 and x[0] < h and x[1] >= 0 and x[... |
c40b916c53645c838bc00b57788e546fdc29d82d | a86228aa91878f26acce938ff88431eb3335ec06 | /graphicsTicTacToe.py | 8cc09271044c58fac6c785316314ee6095b96d9d | [] | no_license | CollinsLiam21/unit4 | a5b6f74231caa94fbf6c684d3aa5039a55153797 | eab89627d5199e09216496ae10df73500ac7fce9 | refs/heads/master | 2021-03-30T21:11:24.894788 | 2018-04-13T13:41:42 | 2018-04-13T13:41:42 | 124,542,445 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,654 | py | graphicsTicTacToe.py | #Liam Collins
#4/4/18
#graphicsTicTacToe.py
from ggame import *
from random import randint
#Adds an x where user clicks if possible
def mouseClick(event):
if data['gameOver'] == False:
if (event.x < 150 and event.y < 150) and isEmpty(1) == True:
Sprite(x, (25,10))
data['square1'] =... |
de7c9aa4cfd512803051b74cec26a886a6b839cc | 35e2aa7ecbb94a7f3eb07f5e326440251f0cb1a4 | /ch3.py | 50c04efca4329262c7e4be4e871633efe8640b9e | [] | no_license | Coutlaw/Programming-1 | 648929e09ad0329bfba7f477a5bd36ca1e21607c | e3e304cfe8f9b44ee5a1df4c20dbdafc740dab7a | refs/heads/master | 2020-06-13T03:59:59.860069 | 2019-06-30T14:39:25 | 2019-06-30T14:39:25 | 194,526,467 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,196 | py | ch3.py | #chapter 3 covered sigma function and loops
#sigma function is to calculate the sum of all integers in a range
#it adds all the number on a number line
def sigmaFunction():
print("code to calculate sumation between")
print("zero and upper bound specified")
print("by user")
print()
upBound = eval(in... |