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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4df9a3aba41a273c62ca19e64d629ea77454e773 | cc1b02eaa10a63195a8683fdf882e5d20f971238 | /administracion/modal/venta_reserva.py | b113e256aa299f68a02de9d5d0f0136959772490 | [] | no_license | jhan-ty92/chabarria | 45f5fa2d1c0001b07d823b49b6830d263d3f8a85 | 6d48c7d33e8c3016c604344f9cfc4c2682251431 | refs/heads/master | 2022-06-14T02:07:48.072243 | 2020-05-08T14:30:52 | 2020-05-08T14:30:52 | 262,342,665 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 14,968 | py | venta_reserva.py | #!C:\Python34\python
import cgi
import os,sys,time
import pymysql
con=pymysql.connect(user="root",password="",host="",database="buses_chavarria")
try:
form = cgi.FieldStorage()
cod=form.getvalue('valor')
ide=cod.split("-")
asi=ide[0]
asi=asi[1:len(asi)]
pru=con.cursor()
pru.execute("""selec... |
b30009cde325adcea8b40b1017c1b0231b1addd2 | 2ad6ea9377e03fb56294f9f7151e66562313773f | /Astarteam.py | 06ea42ffad5074eab1b970c9b630b46aecf81199 | [
"MIT"
] | permissive | rieeeeeemo/pacman_contest | 21563fd0775d246e73a85d911de5fa3dc9eaf71a | 6cd200394408c248d1dac2dd7b9918ff42618201 | refs/heads/master | 2020-03-29T13:51:24.752769 | 2017-10-15T11:48:52 | 2017-10-15T11:48:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 30,164 | py | Astarteam.py | import util
# baselineTeam.py
# ---------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http:/... |
0172be1f9efea418b70b9da37443b73b6fa75eb7 | ee1da0cfa5ebbeeb38408e2fceba0e7d8b664eb0 | /pattern06.py | 12ce503290cb81d7749cb216c26c3185f9c31b35 | [] | no_license | josemiche11/pattern | 402fcdb9237038bf4d92b2f79f3b42e719f98d93 | a0d4b4593a79379517bba4315db28382e84ba042 | refs/heads/master | 2022-11-15T19:50:40.975498 | 2020-07-16T14:59:46 | 2020-07-16T14:59:46 | 280,182,521 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 343 | py | pattern06.py | '''
43211234
4* *
3** **
2*** ***
1********
2*** ***
3** **
4* *
'''
num= int(input("Enter the number: "))
for i in range(-num, num+1, +1):
if i!=0 and i!=1:
print("*"*(num-abs(i)+1), end="")
print(" "*(abs(i)-1), end="")
print("*"*(num-abs(i)+1), end="")... |
4cc11c503b74e0406286a9cde8dc8052176b7e93 | 41a905b3eaa37a9781db5651b18d58d292bf8d89 | /cros-garcon/garcon_trigger.py | ade55fed07911dfef9f47d78e50377a2ebdcd19f | [
"BSD-3-Clause"
] | permissive | refi64/fedora-cros-container-guest-tools | 37768707a6764ad6d11d93e444c317bacd1e14fb | ccc186c9dddddbd3970fd209664abc5c14e9ec92 | refs/heads/master | 2020-05-28T07:18:33.158640 | 2019-05-27T23:03:57 | 2019-05-27T23:03:57 | 188,919,003 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 285 | py | garcon_trigger.py | import dnf
import dnf.cli
from dnfpluginscore import logger
class GarconTrigger(dnf.Plugin):
name = 'garcon-trigger'
def transaction(self):
logger.debug('Triggering garcon...')
with open('/usr/share/applications/.garcon_trigger', 'w') as fp:
pass
|
9107b09e1e93a9ac3aa2c8e257b9d082c6be3bf8 | d0a5b5d06f908dc86e2e71bb5d151321a6d28979 | /setup.py | 321a7ee5afb4acc5370152fadeec88629acc44c8 | [] | no_license | nmaswood/sugar-bliss-back | 11675fa09e2e6d30a90404258d6f9468798cf408 | 1fad35178ba76946d9f6d3a9cc8990e06ae43725 | refs/heads/master | 2020-03-18T02:18:10.393237 | 2019-03-25T05:26:20 | 2019-03-25T05:26:20 | 134,184,021 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 233 | py | setup.py | from setuptools import find_packages, setup
setup(
name='sugarbliss',
packages=find_packages(),
include_package_data=True,
url='git@github.com:nmaswood/sugar-bliss-front.git',
description='Sugar Bliss backend'
)
|
8b0f1898f54387563b511dda2dc88d34dced1fed | 35fb8ef7f2b6673931b951c4e85a6f817238c528 | /LeetCode/897.py | 3bac656de56f0beedbdbe5be27a02c57a6d2fd24 | [] | no_license | cylinder-lee-cn/LeetCode | 0baa3cc663d54305100affa394391325abdc8766 | 62ccbdedf4e1fb9788acfeb2a5bfce70f86c68b6 | refs/heads/master | 2021-07-09T15:41:56.980481 | 2021-01-11T03:14:24 | 2021-01-11T03:14:24 | 219,885,860 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,205 | py | 897.py | """
897. 递增顺序查找树
给定一个树,按中序遍历重新排列树,使树中最左边的结点现在是树的根,并且每个结点没有左子结点,只有一个右子结点。
示例 :
输入:[5,3,6,2,4,null,8,1,null,null,null,7,9]
5
/ \
3 6
/ \ \
2 4 8
/ / \
1 7 9
输出:[1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9]
1
\
2
\
3
... |
565a55ecf2d60711930b6605d98227f8a1132561 | be3cc95a872629d17d998298af95d6b5dd939547 | /google-classify.py | a3119ebeeade524d2ce0ed55e7ff5fe368022b06 | [] | no_license | edtsoi430/AI-platform | 8f28f994f46c466df859c74c4fb16e6cc56236fe | d7607c0e23daa4daa97d06b65e0ae4840dd90502 | refs/heads/master | 2020-07-19T03:36:33.570795 | 2019-09-19T03:50:22 | 2019-09-19T03:50:22 | 206,367,328 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 962 | py | google-classify.py | # Still under development. Created by Edmond Tsoi @ 2019.
import six
from google.cloud import language
from google.cloud.language import enums
from google.cloud.language import types
client = language.LanguageServiceClient()
with open("comments.txt", "r") as file:
line = file.readline()
while line:
#... |
3ba2b70c951f6e46d95c7e105d314e91353245b1 | 5f8d7978135be731444443c6ae87a1e9c53c68b2 | /nexusutils/nexustooff.py | 585d500cf7f366cf2d09a14aa109664c7fd37521 | [
"BSD-2-Clause"
] | permissive | ess-dmsc/python-nexus-utilities | 0a0235c7d4cc86afae94517a62241c6706039073 | 1ced6e51e570cbd3e873fce0b147c7a779adcde7 | refs/heads/main | 2022-12-24T18:11:31.170146 | 2022-12-21T14:39:30 | 2022-12-21T14:39:30 | 90,849,465 | 1 | 1 | BSD-2-Clause | 2022-12-21T14:39:31 | 2017-05-10T09:59:20 | Python | UTF-8 | Python | false | false | 11,372 | py | nexustooff.py | import numpy as np
import h5py
import logging
from nexusutils.readwriteoff import (
write_off_file,
create_off_face_vertex_map,
construct_cylinder_mesh,
)
from nexusutils.detectorplotter import do_transformations
from nexusutils.utils import normalise, calculate_magnitude
logger = logging.getLogger("NeXus_... |
a0103b68266b745b922dc9751d82d967709cc30c | 43fc6f680d375ca5156ab961fc5cd5c127342c18 | /main.py | c34adf76ca6b13fb375851811ade8fb1e53c26e2 | [] | no_license | hinzwifi/Iroh-discord-quotes | 1044bace2a20ceab06cb45e1995e8197cbaceb6a | f26c75c9f2128c8c14017f7ba0a6c63ccdc6b8fd | refs/heads/main | 2023-07-15T13:35:19.145009 | 2021-08-31T12:53:06 | 2021-08-31T12:53:06 | 401,565,813 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,208 | py | main.py | import discord
import os
import random
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!help'):
await mess... |
b8e0d62fedb1943fb98ba94b4f26018fcdd33ce2 | cd3bea71faae9a19afd1baaa2fa7ac25d0a8fc33 | /data/data_raw/runthis.py | 219b30eebd5626b52d78e2529e11707fb690598f | [] | no_license | antaressgzz/SURF_2018 | 2e628e19a3003c41fcf4562ac82c900aa5a3b214 | e1df7e527b0ff269cceab4d82d38a82f0d169052 | refs/heads/master | 2020-03-25T15:59:28.563049 | 2018-10-29T12:00:50 | 2018-10-29T12:00:50 | 143,910,067 | 0 | 4 | null | null | null | null | UTF-8 | Python | false | false | 627 | py | runthis.py | import test
import datetime
# 375天的数据, 15天/ep,25个ep, 2017-07-01 to 2018-07-11
startdate="2015-04-01"
start = datetime.datetime.strptime(startdate, '%Y-%m-%d')
episodes=97
days_per_ep=15
for ep in range(episodes):
delta=datetime.timedelta(days=ep*15)
newdate=start+delta
new=newdate.strftime('%Y-%m-%d')
... |
d3782af07d718a1aea2098af8ee6452b3d2e9961 | d9c064df6e700982e5abe93fd98629c4efca5090 | /modiFile.py | f52edea43747c75e5ac72f29239e798c6d0437f9 | [] | no_license | elibm/2017-tfm-elias-barcia | d66aa427b53546ad833bad3524bf2c61968dbe98 | 1c1196da43ce27feea6fa2cd0feb5059d779299b | refs/heads/master | 2021-07-12T23:59:26.850011 | 2017-10-09T23:00:55 | 2017-10-09T23:00:55 | 105,708,240 | 0 | 0 | null | 2017-10-03T22:03:35 | 2017-10-03T22:03:35 | null | UTF-8 | Python | false | false | 2,454 | py | modiFile.py | # Small python script that reads an input file
# Performs a modification and generates a new output file with new data based on the first Input file data.
# Format of Input and Output file "timestamp tx ty tz qx qy qz qw"
import sys
import numpy
import argparse
def read_trajectory(filename, matrix=True):
"""
... |
399f8fcb72b27aa75fb57160decdb4b09a30669d | a4ff6393e74992ca86461b2e39252d71c7ae6f12 | /File Handling/File Delete.py | 96561a1d41f3b84e725d6834d015b1afa96c3f5a | [] | no_license | lion963/Python-Advance-Repo | 39ff28e8792d1328af40272b7bfc87bc315b1274 | 66db7551f8fa2896d3b1fdc1ce77b3a6e4559f54 | refs/heads/main | 2023-03-04T01:07:40.673621 | 2021-02-15T12:09:11 | 2021-02-15T12:09:11 | 326,661,899 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 112 | py | File Delete.py | import os
try:
os.remove('my_first_file.txt')
except FileNotFoundError:
print(f'File already deleted!') |
39759e35a4139eab599d67b36d7ca5b1633a7539 | f4b4b521537edccc8d7a4e6fbb8f1153d633f797 | /data/process.py | 7b6d9dc72f3bcde1701fc2c137d41ca4623058b4 | [] | no_license | safpla/zzq | aea8b7b040dea4bea3abd3bd0e1ccbe552ef4a57 | 51102b1763e8d3a5df276ee198b7b96ac3c06579 | refs/heads/master | 2021-01-22T23:01:24.340401 | 2017-09-18T10:01:37 | 2017-09-18T10:01:37 | 102,423,432 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,459 | py | process.py | # -*- coding: utf-8 -*-
import pickle as pkl
import numpy as np
import operator
import re
# from docopt import docopt
def main():
# <<<<< origin, changed by xuhaowen, 2017-09-08
#args = docopt("""
# Usage:
# process.py [options]
# Options:
# --word_embedding_dims NUM ... |
5184865a2e9f4ce76b21a3cba61b37e365f24bd7 | 6401429daf13c9b85ffad1b804b11892d73b06a3 | /for.py | 1e611273f3a9211816bf65b5e4b19e5d938e9a4c | [] | no_license | sofiigenta/Pythonbasico | 1af5d4dc5057eef98ed52d5d67964289000ad54e | b867d793a8438e0d37cb9745330b8848dc774773 | refs/heads/master | 2023-05-15T02:33:52.465111 | 2021-05-31T23:27:38 | 2021-05-31T23:27:38 | 372,626,668 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 166 | py | for.py | #imprime rango
#a = list(range(10))
#print (a)
#tabla del 11
#for i in range (11):
# i = (11*i)
# print (i)
for contador in range (1,11):
print (contador) |
8e9bd03e6d7460f485e99b21ad5f86aa2f818d29 | 6005566be062db363fc99e77b3fe93e2134dad71 | /test_imu.py | 3f15286f3141259a93c63b8df269775ed8ef8f25 | [] | no_license | Zinurist/robotino-imu | 080aa2e4539b3bcd9bf952b67320fd008803761b | 980e491986851bd19cd9c3976bbb0ea00b39af7e | refs/heads/master | 2021-05-16T07:35:37.841519 | 2017-10-14T18:34:36 | 2017-10-14T18:34:36 | 103,833,239 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 744 | py | test_imu.py | import rospy
import sys
import imu_t as im
#import imu_o as im
"""
Test for the imu reader.
"""
def imu_test(hertz=50, secs=5):
rospy.init_node('imu_tester', anonymous=True)
rate = rospy.Rate(hertz)
count = 0
#empty queue
im.get_vals()
for i in range(secs*hertz):
val = im.get_vals()
... |
4acab25ce12eee6acb8944985018d67467d07180 | dcf02967ecb25fc6159ecbd03d58b3317e25e891 | /yk/.idea/zuhecase.py | b901fc4493a3bb1053e8999c964edcbd261034b0 | [] | no_license | YanmeiLiu/MyFamilyFee | 89e83d9b4fd2c0b217d136fee9de5129f766eeaf | cf8e350a5e9864e021bb17b6864817e280ca666a | refs/heads/master | 2021-05-16T13:55:49.157658 | 2018-01-19T06:01:31 | 2018-01-19T06:01:31 | 117,810,945 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,310 | py | zuhecase.py | # coding = utf-8
import openpyxl
business = ['video_cutlimit','toutiaofeed']
is_iqiyi = ['true','false']
is_video_page = ['true','false']
categoryid = [1,2]
qypid = ['02023221010000000000']
#统计有多少种组合
blen = len(business)
ilen = len(is_iqiyi)
vlen = len(is_video_page)
clen = len(categoryid)
qlen = len(qypid)
case_num =... |
0ef4d02d365e7da77e814e1cd4943fc6fc53b1ee | 3fdbfc774eacf636217e291fcb4cd760c1a42122 | /ciclos_condicionales/rangos.py | b84e25989e295415151599621a2e6c51080cd69c | [] | no_license | josedoneguillen/python-profesional | a25661edb1213b1b861f6c3ed2afdced618e08c5 | 4bc81182c31283fc69cc04cdeed38f15be451c8c | refs/heads/master | 2021-04-14T09:56:00.474403 | 2020-03-23T22:09:23 | 2020-03-23T22:09:23 | 249,225,024 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 391 | py | rangos.py | # uso de la funcion range (desde, hasta, saltos)
for valor in range(1, 21, 2) :
print(valor)
# uso de la funcion range para iterar una lista
lista = [1,2,3,4,5]
for valor in range(len(lista)) :
print("indice: ", valor, " valor: ", lista[valor])
# uso de la funcion enumerate para iterar una lista
for indice, val... |
d3c2579f9a9dfa788027df796e7f1f5a1a757207 | d820c8efb25c9adb77015650a0f7dc6f1e983bfe | /abc/abc033_c.py | 67d8d30229577f2a6cac05ea0855326af18327c1 | [] | no_license | toshikish/atcoder | 73fdaa2310f23f846279f9f7466bdb969448371f | 33676630d6820dd92ccf0931425b8906b065bedd | refs/heads/master | 2022-05-16T20:00:52.665762 | 2022-04-02T11:55:44 | 2022-04-02T11:55:44 | 173,099,510 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 93 | py | abc033_c.py | S = input()
ans = 0
for s in S.split('+'):
if '0' not in s:
ans += 1
print(ans)
|
dfad82d01b852776ca0ade60b778c25935f7e244 | a1b6faf886086217ea62c161a27b17828649266b | /utim/workers/utim_worker_decrypt.py | 7b485ebf3d7b8b73cb00e1c4bedff71af4b375f1 | [
"Apache-2.0"
] | permissive | connax-utim/utim-python | efdea4855353fbda00d26014883e398f1112a9ae | ce4f2b465fe1a90fc4c43a0647eba1d1ce32e194 | refs/heads/master | 2020-04-03T09:42:06.401084 | 2018-11-08T09:19:40 | 2018-11-08T09:19:40 | 155,173,602 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 932 | py | utim_worker_decrypt.py | """
Encryption worker
"""
import logging
from ..utilities.cryptography import CryptoLayer
from ..utilities.address import Address
from ..utilities.status import Status
from ..utilities.data_indexes import SubprocessorIndex
def process(utim, data):
"""
Run process
"""
res = None
try:
cryp... |
43c3365b1f48dcfcf77c4ac0c4a71649b03a84ae | 2c94f23733d6b1e52f2a6aa3547cfe938bec074a | /src/sact/epoch/strptime.py | 59dbf40aad17e3f9271cf8690f93d941c48b3271 | [
"BSD-3-Clause"
] | permissive | 0k/sact.epoch | 763bdec85050ac7efe2f93aa29d52dd1133c3e38 | 6b0a47068992ff6a73f0f1da36090affad7c8be0 | refs/heads/master | 2021-01-18T08:55:56.271120 | 2015-01-20T07:42:32 | 2015-01-20T07:42:32 | 6,369,897 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,419 | py | strptime.py | # -*- coding: utf-8 -*-
"""
.. :doctest:
"""
import time
import _strptime
from datetime import date as datetime_date
def first(l, predicate):
for e in l:
if predicate(e):
return e
raise ValueError("No element in list matches given predicate.")
## Copy of ``_strptime()`` from python 2.7... |
3edf6f7004eee771d83104fb600f223e172d936c | 70cacb72d9227ab157741521c70b452c89e3b051 | /src/Slot.py | db26c10828f40ac2f36d22458024e55db51f9533 | [] | no_license | Ankhanh975/Inventory | 44d8f451003631df8a0c76236e1b29656b4ed932 | 635afd33ddb36d31176a324981fed8aecb69c645 | refs/heads/master | 2023-07-29T16:40:56.090590 | 2021-09-17T01:41:37 | 2021-09-17T01:41:37 | 397,852,728 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,018 | py | Slot.py | import functools
from lib import LoadData
ItemData = LoadData.LoadData()["item"]
@functools.total_ordering
class Slot:
rank = 1
enchanted = False
fullStack = 64
def __init__(self, name: str = "air", number: int = 1, enchanted: bool = False, haveBow: bool = False):
x=ItemData[name]
se... |
26d345eed750bde24436fee09aa691a4ab877609 | de17b04d14a7f928e12f79905a9c907b1063795e | /gfg/Sudo Placement 2019/Math/lcm_gcd.py | 72c782fb973be4fbafc0b55d517b52fb5e675ce1 | [] | no_license | AJain2810/CodingWebsites | bf5dc7dec740543ba7681393b237f2aa19cba9b4 | 6ffa865bf092ea5f4c852b094ef5b41dbed8f8a3 | refs/heads/master | 2021-07-07T10:00:47.226000 | 2020-10-06T18:24:55 | 2020-10-06T18:24:55 | 192,520,929 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 290 | py | lcm_gcd.py | #code
def gcd(x, y):
while(y):
x, y = y, x % y
return x
# define lcm function
def lcm(x, y):
lcm = (x*y)//gcd(x,y)
return lcm
import math
test=int(input())
for _ in range(test):
num1, num2 = map(int, input().split(' '))
print(lcm(num1,num2),gcd(num1,num2)) |
b3d823eb37ef4b6e9e945a7259d4fab35373c8c0 | 69f17266b4137e390fcf66ea348268cd9cf20e29 | /init/python/setup.py | d5d1dd20f330f47b68454c78502a73a5d30ecc8d | [
"BSD-3-Clause-LBNL"
] | permissive | als-computing/splash-deploy | c64e354be0b92e6c11d3b15463e809f951d2d361 | d6198eec380cd36285e74cd5f3eccdb61e8313c1 | refs/heads/master | 2023-06-19T20:41:29.631568 | 2021-07-14T19:55:21 | 2021-07-14T19:55:21 | 196,463,195 | 1 | 1 | NOASSERTION | 2021-07-14T19:55:22 | 2019-07-11T20:47:38 | Python | UTF-8 | Python | false | false | 827 | py | setup.py | from elastic_setup.elastic import elastic_setup
# from mongo_setup import generate_json, import_json
import config
# DB_NAME = config.db['name']
# DB_COLLECTION = config.db['collection']
ALIAS = config.elastic['alias']
ELASTIC_URL = config.elastic['url']
ELASTIC_INDEX_NAMED_BY_MONSTACHE = config.elastic['index_name'... |
446811085676f6b0f621c421308e8192618997e0 | ece2091476cadacff957f889ae029c53584b7edf | /python/leetcode038.py | dc7228a231cccf377109679be3a6fafe03371068 | [] | no_license | mhhuang95/LeetCode | 719091a5cde281f5d3b9388ee6696033d5475c1d | e9e74a81a7f10888c2c342c70b1ba32b09a16ab2 | refs/heads/master | 2021-06-12T08:18:21.836748 | 2019-09-24T13:27:16 | 2019-09-24T13:27:16 | 142,246,450 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 647 | py | leetcode038.py | class Solution:
def countAndSay(self, n):
"""
:type n: int
:rtype: str
"""
if n == 1:
return '1'
else:
s = self.countAndSay(n-1)
ls = len(s)
res = ''
m = 1
if ls == 1:
return '11'
... |
73a017289f3ad0767ffe0b78944cfbbf11af5a60 | c34ab29111e6451d1cc5cc15493d87889d0d0e27 | /mash2plot.py | 22f5377c7d51ac959ab4a93604690120b28e15d5 | [
"MIT"
] | permissive | esrice/misc-tools | dedf0c9a045b83db1249705e2f80c3b8625c4d68 | d52d4022091d698158d8ede17acbbfa6ff582a86 | refs/heads/master | 2021-09-25T01:50:06.011657 | 2021-09-23T22:41:24 | 2021-09-23T22:41:24 | 167,256,568 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,294 | py | mash2plot.py | #!/usr/bin/env python3
"""
mash2plot.py -- take mashmap output filtered to only one reference chromosome
and one query chromosome and plot the alignment.
"""
import sys
import argparse
import matplotlib as mpl
mpl.use("Agg")
import matplotlib.pyplot as plt
def parse_args():
parser = argparse.ArgumentParse... |
2d58566c938ab100f7773f7b83fa65060c48d86c | 9fa0a03effb3908544d2858e81b6adc09bea123b | /SciDataTool/Methods/VectorField/get_rphiz_along.py | 3a733a8f0ffb371f70805b97e219dc8f2f34104c | [
"Apache-2.0",
"LicenseRef-scancode-proprietary-license"
] | permissive | Eomys/SciDataTool | 82cd551f34331f52d4024da042932fd2513c25a5 | 2321d54d7eccfa819267b6b1a31964e9e052f85c | refs/heads/master | 2022-08-21T18:41:03.614150 | 2022-08-05T10:17:29 | 2022-08-05T10:17:29 | 252,388,550 | 27 | 19 | Apache-2.0 | 2022-08-05T10:10:22 | 2020-04-02T07:44:09 | Jupyter Notebook | UTF-8 | Python | false | false | 8,679 | py | get_rphiz_along.py | from numpy import zeros
from SciDataTool.Functions.conversions import cart2pol
from SciDataTool.Functions import AxisError
def get_rphiz_along(
self, *args, unit="SI", is_norm=False, axis_data=[], is_squeeze=True
):
"""Returns the list of the cylindrical (r,phi,z) components of the field, using conversions a... |
82c2a7da0f770646beab9a84ea3ac97ae51bb9c4 | a78d2610fe0db6f004b10255484562deefdd29dc | /Nuke/init.py | 89b1378f1635dd6303050a14eb34b6a79cc8c645 | [] | no_license | robertvigorito/feature | 740baae0668d820186f81624ab0bc0a21a1dc6e3 | ad61b33134e0b70633a6aeedaa82678aa3f015e6 | refs/heads/master | 2020-05-19T10:50:50.913540 | 2019-05-05T05:08:30 | 2019-05-05T05:08:30 | 184,978,588 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 40 | py | init.py | # nuke.pluginAddPath('d:/vfx/pipeline')
|
8073af18fbc5a220d305877d83331f44e91f46a1 | b974cc8c43752ca124d886f805b5da0c0b17778f | /launcher.py | c0768aa52b9a2fb8c2165035bb736f001f1400ed | [] | no_license | hackhitchin/piwars5 | f2d0964911ed499caba413cd31eedba522a54e08 | 9038aa52da3778bf465e254b564c521b3601e3ca | refs/heads/master | 2020-04-23T18:10:27.836133 | 2019-04-03T20:02:06 | 2019-04-03T20:02:06 | 171,357,441 | 1 | 0 | null | 2019-03-30T16:57:41 | 2019-02-18T21:17:22 | C | UTF-8 | Python | false | false | 42,905 | py | launcher.py | #!/usr/bin/env python
import os
import sys
import logging
import time
import threading
import RPi.GPIO as GPIO
import core
import rc
import speed
import wall_follower
import rainbow
import tof_calibrate
import whitebalance
from PIL import Image
# import VL53L0X
from enum import Enum
try:
from collections impo... |
da6d592b1defdf917e270208a355e33999ace72a | 6416cba6773da21f107513fd15d23c092d0e7e0e | /opendnn/loss.py | ae2ee4f339ad06f2ecb05147eeebc88c8eed5a68 | [] | no_license | claymcleod/opendnn | cad3cd08c4efb1ef26193d19ee0c60c8b18f59a4 | 07dc5978be529d0f145629c2c1b250b2f0aa252c | refs/heads/master | 2021-01-10T13:42:54.763631 | 2016-02-29T05:11:36 | 2016-02-29T05:11:36 | 50,262,647 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 377 | py | loss.py | import theano.tensor
def resolve(loss_fn):
if not loss_fn in globals():
raise NameError("Unknown loss function: {}".format(loss_fn))
return globals().get(loss_fn)
def categorical_crossentropy(y, y_hat):
return theano.tensor.nnet.categorical_crossentropy(y, y_hat).mean()
def mean_squared_error(y,... |
2f719547db3e3ad0acf18c857f6526e526d41f60 | 6a083fb3bddfa7e93d78f72157d1f73cd37ac987 | /歸檔/造市價值前五大標的.py | 11cab0557ed43379838a5b0b19a4e8b0bb10e2af | [] | no_license | leo812leo/jihsun | 1101d16912bed16665ad195047232ab3a2e08bc2 | a2a8dd27981f027cd2e3bd7af936e2d71718585c | refs/heads/main | 2023-03-24T01:17:07.186945 | 2021-03-08T11:03:20 | 2021-03-08T11:03:20 | 325,178,916 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 7,364 | py | 造市價值前五大標的.py | import datetime
from sys import path
path.append(r'C:\Users\F128537908\Desktop\WCFADOX_Python')
path.append("..")
from WCFAdox import PCAX
import pandas as pd
from pandas.tseries.offsets import BDay
from tool import Premium_cal,workingday,calculate,implied_volatility,TheoryPrice_BidVol_Theta
import numpy as np
... |
bab4b6066ca188d995f44e6eb2c3b1fa5cacf021 | c887c52d41e6f7344f431f51ff35964464abbc88 | /models.py | 21fe51e8171d177f5c9fdb546611ad65a957d1d8 | [] | no_license | GautamSagarKottur/Celery-RabbitMQ-Flask-SQLAlchemy | 1b9d4ffd1f04df0e5f0925dba91d9c99f43de561 | 264814bf3c8b36365ffa7295991f796fb2b21ebe | refs/heads/main | 2023-03-02T14:36:27.234381 | 2021-02-08T21:34:35 | 2021-02-08T21:34:35 | 337,215,064 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 266 | py | models.py | from extensions import db
class Results(db.Model):
__tablename__ = 'results'
id = db.Column('id', db.Integer, primary_key=True, autoincrement=True)
fname = db.Column('fname', db.String(50))
def __init__(self, fname):
self.fname = fname
|
441173a97b4b11eff0cab6a8fe366817a7f7c86c | 08d4be3a2599bd092438c12e3f50f5d1905267f0 | /cvplayvideo.py | e1cd79d813724c29d6fe8dc16a3082c7090ad581 | [] | no_license | yurunyang1998/process_video | 20206d3643d053c9684862a34b7fafc7c0f1fa26 | 4c0378518a6323c7b6151a61523c4118ac81d4a4 | refs/heads/master | 2021-09-14T00:17:01.962544 | 2018-05-06T12:41:29 | 2018-05-06T12:41:29 | 105,437,188 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,914 | py | cvplayvideo.py | import cv2
drawing = False #鼠标按下为真
mode = True#如果为真,画矩形,按m切换为曲线
ix,iy=1,10
TX,TY =1,10
trackbarname = 'bar'
VIDEO_DIR = r"/home/yurunyang/Desktop/smoke dataset 2017/smoke/smoke (136).avi"
img_qian_zhui = VIDEO_DIR.split('/')[-1].split('.')[0]
slider_postion = 0
videocapture = cv2.VideoCapture(VIDEO_DIR)
def ontrac... |
49ee88f4b280750bd2915d9aafa1d7c2d6739d2d | de0f998364f69757f624939280b204b8b219b340 | /qmk_bot.py | 6c5736d40eb59a91d3b9905721e65b262a1470bb | [
"MIT"
] | permissive | qmk/qmk_bot | 1bcdd02232d765325176d41c31592e573790efc7 | c1d468a46ef9972929b88dc9fd30e06676b4e3c5 | refs/heads/master | 2023-04-07T05:41:19.157233 | 2023-03-18T03:57:30 | 2023-03-18T03:57:30 | 87,220,047 | 1 | 6 | MIT | 2023-03-18T03:57:31 | 2017-04-04T18:14:01 | Python | UTF-8 | Python | false | false | 1,957 | py | qmk_bot.py | from pprint import pprint
from flask import Flask
from github_webhook import Webhook
import discord
# Setup
app = Flask(__name__)
app.config.from_object(__name__)
github_secret = None
webhook = Webhook(app, '/postreceive', github_secret)
# Views
@app.route("/")
def index():
return "Hello, World!"
@app.route(... |
5416af39f09e9ddb33abe754fd2ec2ee76e0bd0b | 18d6f2f7992d74c92508c96d33c115731da50b06 | /questions/urls.py | 8a5e22b71a9959880fdfcb6e677897f63c6294f6 | [
"Apache-2.0"
] | permissive | zinaukarenku/zkr-platform | 3ccb41bc28d7156430cdfec05c0fff098e7093d1 | 8daf7d1206c482f1f8e0bcd54d4fde783e568774 | refs/heads/master | 2022-12-09T21:00:12.364617 | 2021-03-14T07:51:38 | 2021-03-14T07:51:38 | 144,894,184 | 2 | 0 | Apache-2.0 | 2022-11-22T06:28:43 | 2018-08-15T19:21:07 | Python | UTF-8 | Python | false | false | 844 | py | urls.py | from django.urls import path
from django.views.generic import RedirectView
from questions.views import questions_list, after_registration_list, new_question, question, question_with_secret
urlpatterns = [
path('', questions_list, name="questions_list"),
path('auth/<uuid:secret_id>/', after_registration_list, ... |
8c20e86b228b71c38416f3cf8cf5b1626f42d535 | 7344c69cb33cf0bc55c951adce7b568829048ec7 | /test1-1.py | ece21564e1d428bbcf5e2408c14f5a1c0d3cb76e | [] | no_license | SnowSuno/webcam_replace | dbc14ac837e9348e4741c7d19b8566792d25b87e | 1e4d29d99d4dca23a579aad524c6a20aa566e2ee | refs/heads/main | 2023-02-18T18:03:01.001964 | 2021-01-12T16:20:40 | 2021-01-12T16:20:40 | 329,041,009 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,072 | py | test1-1.py | import cv2
import pyvirtualcam
import numpy as np
import time
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 360)
cam = pyvirtualcam.Camera(width=480, height=270, fps=30)
def toRGBA(frame):
b_channel, g_channel, r_channel = cv2.split(frame)
... |
28c4debb02df7eace556ec477068e1f03e473405 | b9b0232bd75031fe8dd921edb319c443bdc2b897 | /python/tke.py | 543cd20c2ba47a3cf93ee511cf4ce32ae7ab1fc8 | [] | no_license | Chiil/stencilbuilder | c340e9a5013af6836a747c752ef1c0f4c9929921 | 3ea5b942f7fd5eca3eebbfc58e9bc046685a3d4f | refs/heads/master | 2021-01-19T08:31:16.788018 | 2017-03-20T20:31:25 | 2017-03-20T20:31:25 | 30,501,085 | 0 | 2 | null | 2017-03-20T20:31:26 | 2015-02-08T18:37:21 | Python | UTF-8 | Python | false | false | 3,219 | py | tke.py | #!/usr/bin/python
from StencilBuilder import *
import numpy as np
p = Field("p" , sloc )
b = Field("b" , sloc )
u = Field("u" , uloc )
v = Field("u" , vloc )
w = Field("w" , wloc )
umean = Vector("umean", zloc)
vmean = Vector("vmean", zloc)
pmean = Vector("pmean", zloc)
bm... |
97c448c117c20f66ac8ae47dc3d7211cf07eb824 | fade16266878a70a31ac73242c62d5ad803b8559 | /cmd.py | e45e9205195d3738f6b94b4fd291c4b3aa16793e | [] | no_license | wow73611/raspberrypi | d6a8b68734c416254aed80b9317e7443d49eb10a | 5edb542c54b3ece0a811cf061866afd301e3b8bd | refs/heads/master | 2021-01-17T09:41:53.165736 | 2015-05-18T04:39:21 | 2015-05-18T04:39:21 | 34,173,906 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 303 | py | cmd.py | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
import sys
PIN_USB = 12
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(PIN_USB,GPIO.OUT)
if sys.argv[1] == "usbon":
GPIO.output(PIN_USB,GPIO.HIGH)
elif sys.argv[1] == "usboff":
GPIO.output(PIN_USB,GPIO.LOW)
#GPIO.cleanup()
|
34f34af05bd8b9919d20573a6c8e894637ab9e00 | f889bc01147869459c0a516382e7b95221295a7b | /test/test_gift_message_guest_cart_repository_v1_api.py | f58f8f9bcbab58ea0c16279bc1a50fb37fa445ac | [] | no_license | wildatheart/magento2-api-client | 249a86f5c0289743f8df5b0324ccabd76f326512 | e6a707f85b37c6c3e4ef3ff78507a7deb8f71427 | refs/heads/master | 2021-07-14T16:01:17.644472 | 2017-10-18T13:33:08 | 2017-10-18T13:33:08 | 107,412,121 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,244 | py | test_gift_message_guest_cart_repository_v1_api.py | # coding: utf-8
"""
Magento Community
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sy... |
19e736c3dece394e145d7cc3de3a508cf81b534b | 75e916f92a8b9e0cb92b5969677e106bd61fca09 | /Final Project/Source/main.py | dadb1beac0f886cc28924ed9657b6dfa8e0233e7 | [] | no_license | skozh/WinMLCompetitions_HSE | c749afb5ee808f18953d53ca3c2d1771e1847995 | 51e99f7e0eef49232447b36acdd3cd8b2f1704b8 | refs/heads/master | 2022-08-27T23:53:25.485696 | 2020-05-25T22:16:32 | 2020-05-25T22:16:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,996 | py | main.py | #!/usr/bin/env python3
# coding: utf-8
# # Final Project: Sales Prediction
# ## Import Libraries
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
import sklearn
import scipy.sparse
from itertools import product
import gc
from tqdm.notebook import t... |
81c78a138847f827b808dc5d48b4787f63dc5f59 | 58f822fa8ae96c3c31738215048c64af302da69c | /training/mouse/training_mouse_ca_emotional_mix.py | d1cae4564a310ae0d29ad1753e9a52b81d1a15ac | [] | no_license | BRomans/MusicEmotion.ContinuousAnnotator | f6727f08f5d1f1a8097d87fba6efc66e8e9065b4 | 009adb2ba35200e5900111b12c4eebd0400d9bed | refs/heads/main | 2023-08-04T18:27:12.291240 | 2021-08-21T15:58:17 | 2021-08-21T15:58:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 22,204 | py | training_mouse_ca_emotional_mix.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy3 Experiment Builder (v2021.1.4),
on June 07, 2021, at 17:26
If you publish work using this script the most relevant publication is:
Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindelø... |
8e629ee53f11e29aa026763508d13b06f6ced5ba | 28de04457e8ebcd1b34494db07bde8a3f25d8cf1 | /easy/binary_tree_inorder_traversal_94.py | 468477c290c092ca8227c06d840a690223275512 | [] | no_license | YangXinNewlife/LeetCode | 1df4218eef6b81db81bf2f0548d0a18bc9a5d672 | 20d3d0aa325d79c716acfc75daef32f8d4f9f1ad | refs/heads/master | 2023-08-16T23:18:29.776539 | 2023-08-15T15:53:30 | 2023-08-15T15:53:30 | 70,552,512 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 831 | py | binary_tree_inorder_traversal_94.py | # -*- coding:utf-8 -*-
__author__ = 'yangxin_ryan'
"""
Solutions:
题目要求非递归的中序遍历,
中序遍历的意思其实就是先遍历左孩子、然后是根结点、最后是右孩子。我们按照这个逻辑,应该先循环到root的最左孩子,
然后依次出栈,然后将结果放入结果集合result,然后是根的val,然后右孩子。
"""
class BinaryTreeInorderTraversal(object):
def inorderTraversal(self, root: TreeNode) -> List[int]:
result = list()
... |
bc837d95ef22bd376f8b095e7aeb1f7d15c0e22e | a1b5872262755e31bf08d0abfaab9f3161a5d3f5 | /7.StringCapitalizes.py | c60ed622cd3f76fc66a94115a6b6b686d9258127 | [] | no_license | Rajeshinu/bitrm11 | b10e1fde6b7c3c4c14f5c300c07296032cd1a630 | 6d773516cfd9976e1293687e918361656c58a64e | refs/heads/master | 2020-03-25T17:55:38.350664 | 2018-08-08T11:39:30 | 2018-08-08T11:39:30 | 144,003,777 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 377 | py | 7.StringCapitalizes.py | """Write a program that asks the user to enter a word and then
capitalizes every other letter of that word. So if the user enters "rhinoceros",
the program should print "rHiNoCeRoS"""
word=str(input("please enter the word\n"))
count=0
for char in word:
if count==0:
print(char.upper(),end="")
count=1
... |
da34eb25ec08c8311fa839a0cdcd164eff036a5d | d6d5f992bc9b620a09bf841adba7c3531d7408e6 | /w1a1_test.py | 533810bc3cbd5eaa19377fce46d95b418996ffe1 | [] | no_license | christianbillp/specialkursus | d42ef56a2239b26a4cf843e9bb49e883349f1a2d | e89867e3fa6468fcc1dccff6f399db52c133bbe3 | refs/heads/master | 2020-04-07T20:30:37.206163 | 2018-12-06T18:29:34 | 2018-12-06T18:29:34 | 158,690,999 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 991 | py | w1a1_test.py | import bnn
#get
#!wget http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
#!wget http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
#unzip
#!gzip -d t10k-images-idx3-ubyte.gz
#!gzip -d t10k-labels-idx1-ubyte.gz
#read labels
print("Reading labels")
labels = []
with open("/home/xilinx/jupyter_notebooks/... |
04b5df5cfd052390f057c6f13b2e21d27bac6449 | 4d33432d2864fbdd78e69da90f4fb11db41f65ab | /msl/examples/equipment/resources/thorlabs/ksc101.py | 20dba45ad1ea6e10a2d373d8f50a03ad9f379bc1 | [
"MIT"
] | permissive | wandyme/msl-equipment | fe12a6b4156cd7e269696647d93c207769206a9d | 84ece06461013bc6cc29e80afeea8248dea84a61 | refs/heads/master | 2023-03-21T16:49:25.903056 | 2021-03-11T23:58:41 | 2021-03-11T23:58:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,082 | py | ksc101.py | """
This example shows how to communicate with a SH05 (shutter) connected to a KSC101 (KCube Solenoid).
"""
# this "if" statement is used so that Sphinx does not execute this script when the docs are being built
if __name__ == '__main__':
import os
import time
from msl.equipment import EquipmentRecord, Co... |
11f29508d52e856f4751a5dc8911a1f1c9832374 | 7d36c4b7773b9681dd1c44612cac0785d643466a | /test_Spark.py | 2d19c57b7f171b4c257bbcbd945dba9a0e3ec071 | [] | no_license | yuanyunyy/insight_project | 1e801d7d050d8364f66541354e68567cc3e6dee4 | 024300173c05fc84ee484f82a81e81ef2d417d39 | refs/heads/master | 2021-01-10T01:09:25.970362 | 2015-10-02T09:54:21 | 2015-10-02T09:54:21 | 43,337,448 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,022 | py | test_Spark.py | def test(d_iter):
from cqlengine import columns
from cqlengine.models import Model
from cqlengine.query import ModelQuerySet
from cqlengine import connection
from cqlengine.management import sync_table
from urllib2 import urlopen, Request
from pyspark.sql import S... |
71cdddfdd7c1327a8a77808dbdd0ff98d827231f | 8b2f46b6e09a138fdeac9d64a0a37e6962e1c16a | /redash/handlers/base.py | 39f23d01ed63672f67b2893528959f8abd9d4dcc | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | sreynen/redash | d2c9e7e20670db18398bb615d36d0e27d2590e29 | d74442184e30a8aeb19edacb39e1ca22cbb523c1 | refs/heads/master | 2021-01-15T18:26:26.722627 | 2016-02-23T13:06:29 | 2016-02-23T13:06:29 | 52,392,198 | 0 | 1 | null | 2016-02-23T21:15:49 | 2016-02-23T21:15:48 | null | UTF-8 | Python | false | false | 1,207 | py | base.py | from flask.ext.restful import Resource, abort
from flask_login import current_user, login_required
from peewee import DoesNotExist
from redash.authentication.org_resolving import current_org
from redash.tasks import record_event
class BaseResource(Resource):
decorators = [login_required]
def __init__(self, ... |
0b3f16ee9b287c6c77acde674abec9deb4053c83 | 2ba5d4e4bd076465b8561b87e8f85e1799ae3d42 | /week1/q1.py | 40a9cd139c029effa51313105c4179e666702a92 | [
"MIT"
] | permissive | Mandeepsahoo/TensorFlowSpecialization | d650ba84755d57575f9498e334c87a9885092082 | 1019c810708f4dd6a0c49686358f9e3359fd5298 | refs/heads/master | 2020-08-18T22:12:21.598774 | 2019-10-20T16:43:02 | 2019-10-20T16:43:02 | 215,840,393 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 528 | py | q1.py | import tensorflow as tf
import keras
import numpy as np
def house_model(y_new):
xs = np.array([0, 1, 2, 4, 6, 8, 10], dtype=float) # Your Code Here#
ys = np.array([0.50, 0.100, 1.50, 2.50, 3.50, 4.50, 5.50], dtype=float) # Your Code Here#
model = tf.keras.Sequential([keras.layers.Dense(units=1, input_shape... |
1754bce54a47cb78dce3b545d3dce835a4e0e69f | 8895f7e7a8aead257229ae0261fec9837d1fafc1 | /utils.py | 27a493005bc040748dd25bf794125ec745c59c80 | [
"MIT"
] | permissive | SuZhiBai/websocket_messager | 9025ec669ae74861802744a579faddc2ff059571 | 2f052da6906126d6b8a52988c0aefb7246b2c858 | refs/heads/master | 2021-01-18T00:25:26.707308 | 2015-06-29T10:32:16 | 2015-06-29T10:32:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 904 | py | utils.py | #!/usr/bin/env python
# coding: utf-8
import logging
import config
def get_common_logger(name='common', logfile=None):
'''
args: name (str): logger name
logfile (str): log file, use stream handler (stdout) as default.
return:
logger obj
'''
my_logger = logging.getLogger(name)
... |
6affc182f5d3353d46f6e9a21344bc85bf894165 | c84c07160eea8552f3be1a027f210f7d9e0338f5 | /zezin/app.py | 0d66d9e750aafbca18fd6bfa4d183c6f38ffc6f1 | [] | no_license | suviolet/zezin | 3fda273629fdedfab3cf2802bff444c198c8be7c | 3421d58ae70a4af82b2b1ffc7137a9f6a36f0b02 | refs/heads/master | 2023-05-14T16:11:13.599160 | 2020-03-03T00:17:35 | 2020-03-03T00:17:35 | 244,391,578 | 1 | 1 | null | 2023-05-01T21:21:15 | 2020-03-02T14:29:07 | Python | UTF-8 | Python | false | false | 526 | py | app.py | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
# pylint: disable=dangerous-default-value,wrong-import-position,unused-import, import-outside-toplevel
def create_app(settings_override={}):
app = Flask(__name__)
app.config.from_object('zezin.settings.Configuration')
app.c... |
9abf2b9b90d18332ede94cf1af778e0dda54330b | bc2ebfdf17a805a06dacd6445c8ac791811b4b74 | /docutils-stubs/parsers/rst/directives/tables.pyi | 784446c25541cf2a3719cb71fe044e9c1ba6c838 | [
"Unlicense"
] | permissive | domdfcoding/docutils-stubs | 9f2870d6e44a60027417f90c202bf902df073c37 | b14071d065f8ee35399856fcaff6cd608294a342 | refs/heads/master | 2023-04-28T15:44:55.877639 | 2022-01-02T11:12:57 | 2022-01-02T11:12:57 | 294,172,428 | 0 | 0 | null | 2020-09-09T16:44:30 | 2020-09-09T16:44:28 | null | UTF-8 | Python | false | false | 2,679 | pyi | tables.pyi | # Stubs for docutils.parsers.rst.directives.tables (Python 3.6)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
import csv
from docutils.statemachine import StringList
from docutils.nodes import Node, system_message, table, title
from docutils.parsers.rst import Directive
from typing impo... |
ec8114a9187671328bac917b5794e61bc84e5649 | 56459d7f9ea625ed17d943047fc12c9aef6dacf8 | /day06/07-my-electric-car.py | 1ef0ac519908751a529aeeae4f4fd54fc9379fe3 | [] | no_license | LittleFee/python-learning-note | 32952d05e8b3a70db828cc72aa6e81606327fc70 | 44fa188a21abf3153ac914c14688eafea0304f5d | refs/heads/master | 2021-04-12T08:16:11.064471 | 2018-05-23T06:57:35 | 2018-05-23T06:57:35 | 125,993,480 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 192 | py | 07-my-electric-car.py | from car import ElectricCar
my_e_car=ElectricCar('Tesla','p100',2017)
print(my_e_car.get_name_des())
my_e_car.battery.get_range()
my_e_car.battery.battery_size=85
my_e_car.battery.get_range() |
015c47a741615b7238babe5a98939658769135eb | 2428252f9ad686be8556b1eb320c72249170cf3b | /week3/Lecture6/fib_efficiency.py | ffc02ddfec065bec425f4d26d7e13a7835062577 | [] | no_license | whiskey0705/MITx-6.00.1x | fc9ee1f751e63c756318b581964464151569b786 | d4f17fd46be020abac1e283771bc32c157139a80 | refs/heads/master | 2021-01-18T22:15:42.506418 | 2017-04-06T10:51:32 | 2017-04-06T10:51:32 | 87,039,279 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 655 | py | fib_efficiency.py | def fib(n):
"""
普通递归斐波那契数列
"""
global fib_count
fib_count += 1
if n == 0 or n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
fib_count = 0
print(f'fib: {fib(30)}', f'count: {fib_count}')
print('#'*20)
def fib_efficiency(n, a_dict={0:1, 1:1}):
glob... |
f363e22ef8abaa1210942e63953489e1a6db1464 | 39ffc012805e2bd14ee3c652fde52e8714f34f3e | /multiplethreading.py | 26b675874bf8211c834c03f0aadfe2e7c5593143 | [] | no_license | SomritaM/tinderCloneGUI | 3f8252aed33abd8148c59922b13eaacefac92b08 | f275b5cf88a4d63d47fa0a77e56213bfc6015904 | refs/heads/master | 2022-12-04T13:49:35.230409 | 2020-07-28T15:41:57 | 2020-07-28T15:41:57 | 261,520,600 | 2 | 1 | null | 2020-07-28T15:41:08 | 2020-05-05T16:08:26 | Python | UTF-8 | Python | false | false | 459 | py | multiplethreading.py | import threading
import time
mylist=[1,2,3,4,5]
def sq(list_arg):
for i in list_arg:
time.sleep(0.5)
print("Current:",i*i)
def cube(list_arg):
for i in list_arg:
time.sleep(0.5)
print("Current:",i*i*i)
t=time.time()
thread1=threading.Thread(target=sq,args=(mylist,))
thread2=thre... |
70e99e43e732a04ae6f9582c9bbcbe3d3fe73d1d | 7374e1883d83f01a4aeebeca7285fce2264d24e7 | /network.py | bec46f9989db38dea0b93bd913fa803d96536e81 | [] | no_license | pulkitt15/find-ddos-attack-source | 97f1006832de3574a90558b9995e5e4c23c1da91 | 734f1501d31d4d59b72f6f7090751370ce7b2821 | refs/heads/main | 2023-04-05T20:18:34.966352 | 2021-04-23T08:03:40 | 2021-04-23T08:03:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,799 | py | network.py | import math
from routing import routing_table
from random import sample, choice
from slant import ALP_solver
from FRP import FRP_solver
class network(object):
""" Remove return value in attacker & victim"""
def __init__(self, V_size, D_size, k, n, t):
super(grid, self).__init__()
self.n = n
... |
00dfca684bebb2844ca16925ed7334e915544ae6 | ba21226b20a6585f95424dfb50d13bef19dd229a | /mpa/filters.py | dcabde73a2ec5878ea4ebc6df837aba5127aa2ca | [] | no_license | mci/mpatlas | f0a6f1593fddcddaeb2135757166db59514cdc24 | e6149050d4ee7cb32be09c4e7fb259a473b84908 | refs/heads/master | 2023-07-19T22:58:31.061265 | 2023-06-13T01:07:49 | 2023-06-13T01:07:49 | 2,419,129 | 1 | 0 | null | 2023-07-05T22:59:50 | 2011-09-19T23:41:22 | Jupyter Notebook | UTF-8 | Python | false | false | 3,821 | py | filters.py | try:
import simplejson as json
except ImportError:
import json
sample_querystring_json = '''?
sort=[
{
"f": "name",
"dir": "ASC"
}
]
&filter=[
{
"depth": { "min": 0, "max": 100 }
},
{
"nation": [ "USA", "NZL", "... |
71728714150db3f627e6a2c508f1635715ed40fb | 065694179b7a132d989c373573a0e89686cc2c8c | /untitled/venv/include/task2.py | 3bdaf88c957b00a8d160dfb2b043def704b237d9 | [] | no_license | vksychev/PythonPlayground | ff267b1173f43cae2d11634b70e75c0aa3f715aa | 99c4c1471b4e3e5a528486a58bd92cfd42b33c0e | refs/heads/master | 2020-03-21T06:11:23.144147 | 2018-12-27T14:56:07 | 2018-12-27T14:56:07 | 138,204,660 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 460 | py | task2.py | def solution(n):
d = [0] * 30
l = 0
while (n > 0):
d[l] = n % 2
n //= 2
l += 1
print(d)
for p in range(1, l//2+1):
ok = True
for i in range(l - p):
if d[i] != d[i + p]:
ok = False
break
if ok:
ret... |
bac6554f1c9daf500c7214e0ef78fe44fbd75c45 | e2ade271ca598f498c935ab562bc110c4de23759 | /onnx_infer.py | 73117fc43bb658bbac28356648a76ee5ae0034e3 | [] | no_license | hegc/trt_model | 6709ccfb85b49235ea0ea1630e851b7007ae6130 | 9a8feda1d4403730871bde656be425f49a1e40f0 | refs/heads/master | 2023-01-13T10:52:29.943734 | 2020-11-19T02:06:02 | 2020-11-19T02:06:02 | 313,532,090 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 605 | py | onnx_infer.py | import onnx
import numpy as np
import onnxruntime as ort
def test():
# onnx
ort_sess = ort.InferenceSession('./Hs.onnx')
with open('1.npy', 'rb') as f:
input_tensor1 = np.load(f)
with open('2.npy', 'rb') as f:
input_tensor2 = np.load(f)
print('=========1.npy... |
2616f1b3a6d96127047c95ceb2c98a8f029e63a6 | 87622bfd18fb121c6b11d739a9d2ac01d678631b | /contrail_provisioning/config/templates/contrail_plugin_ini.py | 0a8bb2602f91d27a4286b3ef7450beeb9488be59 | [
"Apache-2.0"
] | permissive | atsgen/contrail-provisioning | 757d08fddc1028fd83e6accc41288f112ef49d61 | dda84a5ed7e17b5cc7148c2505e66ed3e8a86120 | refs/heads/master | 2021-06-28T03:28:13.368601 | 2019-09-02T01:48:32 | 2019-09-02T01:49:42 | 197,592,881 | 0 | 0 | Apache-2.0 | 2019-07-18T13:30:40 | 2019-07-18T13:30:40 | null | UTF-8 | Python | false | false | 1,117 | py | contrail_plugin_ini.py | import string
template = string.Template("""
[APISERVER]
api_server_ip = $__contrail_api_server_ip__
api_server_port = $__contrail_api_server_port__
#use_ssl = False
#insecure = False
#certfile=$__contrail_api_server_cert_file__
#keyfile=$__contrail_api_server_key_file__
#cafile=$__contrail_api_server_ca_file__
contra... |
e9389cb2b59ba1ba732d3ceb250bc2ca37e31c50 | d7dc0bf114a9cf97e76f49739d4d9986eebeb89a | /Lectures 25.07.2020/05. Character_Sequence.py | 4ac90ddc253914cbe2ba135d9bfcb4c06ed6d45b | [] | no_license | Mazev/Python-Basics | 6f300529fa1e86ed48beea708018563a5902c2df | 86fc99d62230f30a6e55005e91d4dc7fe46d52fd | refs/heads/master | 2023-02-19T13:44:52.770161 | 2021-01-19T19:50:30 | 2021-01-19T19:50:30 | 330,723,769 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 62 | py | 05. Character_Sequence.py | text = input()
for i in range(0,len(text)):
print(text[i]) |
d7f42572d3b8cff5714858367dcceac3b422a3d1 | 29624fdcd5109cd859fb21c02d3a43db56435603 | /ALL_METHODS/PLY/PLY_Check.py | ec8f234858f3fec4b22c3415a1454d8a21d7d3fd | [] | no_license | ki4mor/TA | 109933f48060e96c173a4d316f31fb3ea374ac1f | f3cc385c3063e43c3d30b00e439e7c2222a87148 | refs/heads/master | 2021-05-18T13:20:49.880676 | 2020-04-03T09:28:27 | 2020-04-03T09:28:27 | 251,259,540 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,230 | py | PLY_Check.py | from PLY import Parser
import time
import os.path
def PLYfilecheck():
_parser = Parser.Parser()
StatFile = open('PLYStatistic.txt', 'w')
inf = open('strings.txt', 'r')
ouf = open('PLYoutput.txt', 'w')
_starttime = time.time()
while True:
_string = inf.readline()
if not _string:... |
b7fa494cf5d7ac5a4b3e09f5114b9687b2cf7a60 | 2d59cf40d8f41c7f17ad7fa3486571d3e37a6956 | /simpletest.py | d2a4a17bf1a495d86501bb73998f15c89cb0a98a | [] | no_license | wuqian/servo-test | a4e6540e4d45aadea5082376449bf806e6b4de49 | a582771c60fe49a73fd60d25f2a280904e72883a | refs/heads/master | 2020-12-31T00:29:52.767926 | 2017-03-19T08:45:17 | 2017-03-19T08:45:17 | 85,404,870 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,629 | py | simpletest.py | #pressed Simple demo of of the PCA9685 PWM servo/LED controller library.
# This will move channel 0 from min to max position repeatedly.
# Author: Tony DiCola
# License: Public Domain
from __future__ import division
import time
import select
import sys
import pygame
from pygame.locals import *
import RPi.GPIO as GPIO
... |
28163162687a8916659846f431f0ec718fa28aef | eb28118fc7c49e760311b8850c029c56eb7dfc5d | /lessons/011_math.py | e083468b6756530cabc9ce732c99a04f862b328b | [] | no_license | elodiaka/udemy_python | bfbf8900308c22e54b6dfc5610e8368b4118aff9 | 9d95c335a9eba08175605cc0b9588ccf49867d61 | refs/heads/master | 2022-04-26T01:13:59.234055 | 2020-04-30T11:40:36 | 2020-04-30T11:40:36 | 260,191,517 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 322 | py | 011_math.py | import os
os.system('cls')
my_string = "my name is Elodia Ka"
#addition
print (2+3)
#subtraction
print(10-3)
#multiplication
print(10*3)
#division
print(10/2)
#exponents
print(2 **3)
#modulus (Rest)
print(10%3)
#order of operation
print(3+1*4)
print((3+1)*4)
#math with variables
num_1 = 3
num_2 = 2
print(num_1 + num_... |
a88e8d1cc160a1a3ee33de6d7a85c9ce50f74329 | d348674862c57c83dfbfb4ec1061081b7d472316 | /transformer/train.py | 3201676a90a6b0ad9928d21f1b9dfe8f369c3507 | [] | no_license | erikdao/dd2424-text-summarization | 6a090fbc669dd7065e76f0e3d480b1fb2e57df79 | a18a7dd25c3bab614b0fa48bb299748d43b0c5e5 | refs/heads/main | 2023-04-29T04:44:54.487149 | 2021-05-21T23:51:38 | 2021-05-21T23:51:38 | 357,884,500 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 7,637 | py | train.py | from utils.pickle import *
from dataload.dataloader import *
import time
from utils.glove_embedding import *
from transformer.transformer_model import *
EMBEDDING_FILE = '../preprocess/glove.6B.50d.txt'
SAVED_MODEL_FILE = '/Users/pacmac/Documents/GitHub/KTH_Projects/dd2424-text-summarization/transformer/transformer_m... |
4ca43d107e7a9e5aaec8aa7569c2382222d5d32a | a4bfd14dc4b5d6360141803daef34b407595679e | /Store/RepositoryBase.py | 79336bb6fdc1732af39757184421c8e9dcc785d2 | [] | no_license | ZijianYang/down | a2b063f34dcf401c9a76d31929c28dca7a8a809e | 2faaa2d2113772a37fe59be3a59aa777be297f93 | refs/heads/master | 2021-05-15T21:13:48.826625 | 2019-09-07T15:25:09 | 2019-09-07T15:25:09 | 106,351,148 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 279 | py | RepositoryBase.py | """仓库基类"""
import sqlalchemy
import sqlalchemy.orm
import sqlalchemy.ext.declarative
from AppConfig import AppConfig
class RepositoryBase(object):
"""仓库基类"""
def __init__(self):
""""会话对象"""
self.session = AppConfig().session
|
228fc6aa1ff343f9a13e8049a4d50fd88735e969 | d48ddf6d93252930b57d3d6983abc02899d6a293 | /python2021课程源码/15.5 增加数据.py | 525f111cbefe028c898f54ebb360502f7e3b6f43 | [] | no_license | Mr-QinJiaSheng/python2021 | 7b03a80a3705d31ea902609eeae18f2b5302fadf | 3dc9aa4fb19f64ed7b7ba06308588e908740aa2c | refs/heads/master | 2023-08-14T22:09:30.863723 | 2021-10-02T10:09:11 | 2021-10-02T10:09:11 | 412,759,070 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 809 | py | 15.5 增加数据.py | import pymysql
import random
#需要先创建一个数据库,才能连接
host="localhost"
port=3306 #注意使用数字
user="root"
password="123456"
db="51db" #数据库名称
charset="utf8"
#创建数据库连接对象,并建立连接
db=pymysql.Connect(host=host,port=port,user=user,passwd=password,db=db,charset=charset)
print("数据库已连接.....")
#创建游标对象(1.执行sql语句,2.处理数据查询结果)
cursor=db.cursor()... |
b9a8550530aa7c835692526d7c0756494c1eaf85 | 6745405a1d7d95855b9f2e7e08cbd43a3517f53e | /src/utils/params.py | 741e53c0253fe5cbca44f4ae06e540c4ca78c119 | [] | no_license | andrehoejmark/TIN175 | f3b027f6fdc5b399efa68b5e3b8e0bc434366651 | e05301ba4552afaf4fd726cccaeafbb18dd1f5d8 | refs/heads/master | 2020-04-21T12:36:01.123932 | 2019-03-18T19:45:26 | 2019-03-18T19:45:26 | 169,568,326 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,574 | py | params.py |
#
# Author: Felix Hulthén.
#
class NetowrkHyperparameterConfig:
def __init__(self):
self.read_sequence_length = 24 * 7 * 3 # How much data to read from the dataset.
self.start_learning_rate = 1e-3 # The initial learning rate.
self.loss_factor = 0.1 # The change of learning rate when uns... |
e9625b91a826e1c94e7783f607bf91c7f5ddd570 | 94e0c40f932404f1aa27fe0811881a8d10177651 | /guessing/guessing.py | ba0d95575a05aa3f404cb3954d2b50246b691c3a | [] | no_license | Gudavis/python_simple_game | 2060eb755472835282b2d440422f5cd859499655 | 1d194d7308d4631d7a02048b2ae39b7f6a88d6c8 | refs/heads/master | 2023-01-05T05:52:53.690721 | 2020-11-02T14:47:18 | 2020-11-02T14:47:18 | 294,216,891 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,393 | py | guessing.py | from random import randint
def play():
print('*****************************')
print('Bem vindo ao primeiro projeto')
print('*****************************')
secret_number = randint(1, 50)
try_number = 0
points = 1000
print('Escolha o nível de dificuldade')
print('[1] fáci... |
465918ebe99fc1e71228727c7dec6064b395a394 | 76ca0d108f1ce8273bf229d7ebf60105eb9c48cf | /03_stack/225.ImplementStackusingQueues.py | ce91394c914835bd8f20fc2981df7b0ab3c624a3 | [] | no_license | harverywxu/algorithm_python | 16e75f199253524026c4310d3b33cb6321764d97 | 00abbb9909dc8a10f274a6e8605c665ba361fa3e | refs/heads/master | 2022-03-14T08:23:59.053651 | 2019-10-30T13:16:14 | 2019-10-30T13:16:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,077 | py | 225.ImplementStackusingQueues.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Implement the following operations of a stack using queues.
push(x) -- Push element x onto stack.
pop() -- Removes the element on top of the stack.
top() -- Get the top element.
empty() -- Return whether the stack is empty.
Example:
MyStack stack = new MyStack();
st... |
a14750d087ba3f8c6e02465f2426f77168d8e6b7 | 7303b63f1ccf9bb85b0c0fecedce0de18900271b | /login/main/sent_mail.py | dbd6bbc6bb94d87dfeeb264275760c97c02523e7 | [] | no_license | DLPJ-MUDS/daily-life-is-a-game | 4c4ecd25ecc1f6392b7b470f318e2f59e7f8958d | b8904902e3081c1fdd38c31bdf7109a3398345a6 | refs/heads/main | 2023-07-08T01:19:58.399745 | 2021-08-17T18:07:57 | 2021-08-17T18:07:57 | 388,121,248 | 0 | 1 | null | 2021-07-24T16:01:42 | 2021-07-21T13:12:13 | CSS | UTF-8 | Python | false | false | 1,060 | py | sent_mail.py | import smtplib
from email.mime.text import MIMEText
from email.utils import formatdate
import hashlib
def to_mail(username, email):
sendAddress = "s2022055@stu.musashino-u.ac.jp"
password = "wlfxhlgmcybxkwsp"
username = hashlib.md5(username.encode()).hexdigest()
subject = "Daily Life is a Game パスワードリセ... |
8612760d3df1d0e97bc6297d913fce8d35994778 | 2b8d5f9d5ced3013ca08b5ba7092dee800f709c4 | /src/universe-driving/TORCH_DQN.py | 545042d11cd14904be80841a49d2a663d1c31b39 | [
"MIT"
] | permissive | arminnh/ma2-csai-deep-reinforcement-learning | d19dbb0a486e20d18321bf9f6b3188da326f5fc3 | e6ec12cfa2468b86f60a6cb2635f5feb12dcd7a6 | refs/heads/master | 2021-09-09T11:03:35.254749 | 2018-03-15T11:01:18 | 2018-03-15T11:01:18 | 107,395,858 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,812 | py | TORCH_DQN.py | # based on https://github.com/keon/deep-q-learning/blob/master/dqn.py
from collections import deque
import numpy as np
import random
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch import optim
class DQNNetwork(nn.Module):
def __init__(self, actions_... |
41919096714ad4e1d98801a5ee1868832adc94d5 | a110760d7e852c545d37051e35c3a05a9dc2a8ec | /wingoa/signals.py | c3a6d4a9b83b9e9943eb3e4cb03267143d6f3485 | [] | no_license | sanorchid/wingzen | d01c3ee1a070b1a4c12712c6d5679bc329d9a3bc | 459d4b2a07a484f8d01a8fd81084c9a6c5dc6a25 | refs/heads/master | 2016-09-16T14:59:15.143147 | 2014-09-02T07:31:48 | 2014-09-02T07:31:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 353 | py | signals.py | #coding=utf-8
from django.db.models.signals import post_save
from django.contrib.auth.models import AbstractUser
def create_user_detail(sender, instance, signal, *args, **kwargs):
from .models import Staff
if kwargs['created']:
u=Staff()
u.__dict__.update(instance.__dict__)
u.save()
post_save.connect(create_... |
520e18f6d1d8b27965b85dccf96c38e514c735db | b0b5de8c8fb6f5a19b1c73dd0b60a0e286755ef1 | /main.py | b6bb4619ba6fbdf18bacec9fc3b922d380a8fed0 | [] | no_license | fossabot/OSMChina-Yanfei_Law | fa528df87dfd3d7e116294b6236e839456381c21 | 88169bd17129942ab538f935b0a0928aa9d98269 | refs/heads/main | 2023-09-04T17:31:44.351304 | 2021-11-21T18:04:24 | 2021-11-21T18:04:24 | 430,442,287 | 0 | 0 | null | 2021-11-21T18:04:19 | 2021-11-21T18:04:19 | null | UTF-8 | Python | false | false | 1,111 | py | main.py | import argparse
import re
from keqing-sword import PyOsm, BaseOsmModel
# 做一个所有rule的主入口,由它按照rulelist去寻找和执行各条rule,不用用户一个个去翻找
def main(args: argparse.Namespace):
pyosm = PyOsm()
try:
pyosm.from_file(args.src)
except FileNotFoundError:
print('文件%s不存在' % args.src)
for node in pyosm.node_di... |
f14d71c20011e526a496cce1becc6767405a0fff | 255cc33b9a1a311ece5efda602281015bf6b29e0 | /xgds_core/sse/pubwords.py | b95a77e033c5fb56bd54cd8d8cbd548dcb4ee9df | [
"Apache-2.0"
] | permissive | xgds/xgds_core | 7da0c7c22224c0b4b52531a8fc9235d8b137b0fc | 7c2f8d56ca56321f6a9331cda38b40b503fade04 | refs/heads/master | 2022-09-08T11:44:01.189593 | 2019-06-07T00:34:53 | 2019-06-07T00:34:53 | 47,706,342 | 1 | 1 | Apache-2.0 | 2022-08-30T20:58:46 | 2015-12-09T17:08:04 | Python | UTF-8 | Python | false | false | 2,653 | py | pubwords.py | #!/usr/bin/env python3
# __BEGIN_LICENSE__
# Copyright (c) 2015, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All rights reserved.
#
# The xGDS platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this f... |
bba218b8f88624b31c1f0dfc9f41042e7cfd9bdf | 77a9d4e1f12d5e4d598fa5963ec2b21898e76001 | /gra/gra.pyde | ee8991c66ca0bbe0cdf9ebe69db4ebbc4c82d862 | [
"Unlicense"
] | permissive | pomaranga/Projekt2020 | b508a7a56bc4ace581a32a89f4ff7f580481c479 | f4ff988d913a6b1a73929aedd015040669c99aa1 | refs/heads/master | 2022-11-12T23:48:52.548206 | 2020-07-10T00:30:07 | 2020-07-10T00:30:07 | 275,688,125 | 0 | 5 | Unlicense | 2020-07-01T13:41:46 | 2020-06-28T23:46:38 | Python | UTF-8 | Python | false | false | 19,028 | pyde | gra.pyde |
add_library('sound') #musicie sobie miski doinstalowac bibliotkę - sketch - import library - Add Library - sound i będzię dzwięk! <3
###### I niech stanie się gra #######
import sys
import math
import random
import time
import processing.sound
#import turtle
w = 1366
h = 768
statusGry = 1 # 1 - wprowadź imię
... |
9bb0a6e232b6f8dac9ffb3259d794c2fe83a5ed4 | 234608a21ba01ba5a9be44307027b7649868f8a9 | /main.py | 05261ca5152ba02c359e3199fad5031099156bed | [] | no_license | jakebright/user-signup | 5e145f2f5644053a3a9f1066d961ce5608662d01 | c61611a37408b17bf55aac59f4b4b6377385b785 | refs/heads/master | 2020-03-07T07:54:58.237824 | 2018-04-09T23:55:13 | 2018-04-09T23:55:13 | 127,362,193 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,323 | py | main.py |
from flask import Flask, request, redirect, render_template
import cgi
import os
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route('/signup', methods= ['GET', 'POST'])
def sign_up():
has_errors= False
if request.method == 'POST':
username = request.form['username']
password = re... |
7116a2801921ff3d7eedcbc6057d2cbced7250e6 | 57d0b9a602c002613e626656b4647c24b7a997b6 | /PTA/【总决赛】涉外学院第三届程序设计大赛/7-5/main.py | 2cbb71157610de8cd5ec2dda7b8de2a734a5fa99 | [
"MIT"
] | permissive | iriszero48/Trash | dcf8561598beddecb06966d326af0b21f6daab10 | 6d2df1bb8bad1e6f21ee8e351b0f6fcdc79687bb | refs/heads/master | 2023-04-06T19:04:43.935105 | 2023-03-27T10:15:16 | 2023-03-27T10:15:16 | 219,259,612 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 149 | py | main.py | from functools import *
list(map(lambda _i:print(reduce(lambda a,b:a+' '+b,(list(map(lambda x: x[::-1],input().split(' ')))))),range(int(input()))))
|
2f21d74515219fe63b08c7ec3d74961b22454a35 | 5f8efb4e2dadd345952ad88f802c9884883f3d82 | /isar/events/actionsservice.py | c0e61da0fd5ba0899c92d00b0dfa942e8384edf4 | [
"MIT"
] | permissive | zardosht/isar | e593b6203ad2faa471813564607efd6ead90cb40 | b0da6bd93b2e019bfb40e393213525361031772d | refs/heads/master | 2022-12-05T13:19:04.169001 | 2020-08-27T14:51:46 | 2020-08-27T14:51:46 | 288,470,719 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,461 | py | actionsservice.py | import logging
import traceback
from isar.events import actions
from isar.events.actions import ToggleAnnotationVisibilityAction, ShowAnnotationAction, HideAnnotationAction, \
ShowSceneAction, StartAudioAction, StartTimerAction, \
StopTimerAction, ResetTimerAction, StartAnimationAction, StopAnimationAction, Pa... |
74edebd3b85725acb78a5f2a2065318a1685002b | dc55ff89fe86ba1d4b5e22ea7806676fea9b01dd | /금요일 수업/SK-T-Academy/Tip/02_2차원배열.py | b13e031247e81f9f47e95b75993988b6a19f2fc0 | [] | no_license | jangDta/Dream_dream | ed31f258850c15fb8cec25a8fbc325a2f1bb29ec | 922cb1847010ab4259764c504511263275f3b1d1 | refs/heads/master | 2023-03-19T07:22:20.681153 | 2021-03-16T00:44:51 | 2021-03-16T00:44:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 761 | py | 02_2차원배열.py | arr = [[1,2,3],[4,5,6],[7,8,9]]
# 행 우선 순회
for i in range(len(arr)):
for j in range(len(arr[0])):
print(arr[i][j], end=" ")
print()
print("------")
# 열 우선 순회
for j in range(len(arr[0])):
for i in range(len(arr)):
print(arr[i][j], end=" ")
print()
print("------")
# 지그재그 순회
for i in rang... |
fda4ef566699ab6070e30701a6fad89a6e9a708d | 1f4e53cdbeb79dc31ea5a820ce8c438b187a73f2 | /kingdom/management/commands/dependencies.py | 2695dfc42180d50acb1744fa884591d6c0b43d10 | [] | no_license | Neamar/kingdoms | d68209aec83367757467633ee057b12f0b28803d | ec872b08ea4be30372e383d473f20b794104874d | refs/heads/master | 2020-12-30T10:50:07.864441 | 2014-04-14T09:09:19 | 2014-04-14T09:09:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,556 | py | dependencies.py | # -*- coding: utf-8 -*-
"""
Generate a dot file for dependencies between Event and Mission.
"""
import re
from django.core.management.base import BaseCommand
from event.models import Event
from mission.models import Mission
from title.models import Title
from internal.models import Trigger, Recurring
class Command(... |
46be38ded38ee616ac28ad5f7017ce45d62e4211 | 19a5fdb8f5f5aa220b648ea331af4cf557140bc6 | /test/conf/test_conf.py | 36179983e8e1b823f4df924586af4661110f1d1f | [
"MIT"
] | permissive | TomBlock/cate | 14c17f8102ffd4eaf4c0d413452220ae4134cf71 | 3924300a9d85f09fd40bc67b9f8a220230788d1c | refs/heads/master | 2021-01-24T21:12:34.655128 | 2018-02-22T17:40:59 | 2018-02-26T09:36:34 | 123,267,980 | 0 | 1 | null | 2018-02-28T10:17:48 | 2018-02-28T10:17:48 | null | UTF-8 | Python | false | false | 628 | py | test_conf.py | from unittest import TestCase
from cate.conf import conf
class ConfTest(TestCase):
def test_get_variable_display_settings(self):
settings = conf.get_variable_display_settings('__bibo__')
self.assertEqual(settings, dict(color_map='inferno'))
settings = conf.get_variable_display_settings('... |
400bf076039547fffb1c69c5a1373f7e1e1066d0 | d528ac748aa406b455777170a2b28e8091c21624 | /raspberry-pi/car_led.py | 4d3b84d66ae9336e70182a2793e085828f72b03e | [] | no_license | Mitrug/car-leds | ea83d57484a9d2c7f3323b73d8a39e3a9cecb672 | 1c85ae5d851a3dd9f0fd12c96aa76bb807c00c5c | refs/heads/master | 2023-02-21T18:17:45.440089 | 2021-01-24T15:17:16 | 2021-01-24T15:17:16 | 330,391,948 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,864 | py | car_led.py | from rpi_ws281x import *
from car_led_database import update_active_profile, get_active_profile, is_led_enabled
import time
import logging
from led_colour_profiles.led_colour_profile_red import *
from led_colour_profiles.led_colour_profile_blue import *
# LED strip configuration:
LED_COUNT = 120 # Number of L... |
1fe8c2c470be43d450b40ff29df86f970cf690eb | 739023d4c0a716edeaaa166920cf2f3528ad6a46 | /imdb | c78817516e0a85b044f9e4a9224967cd7673bf64 | [] | no_license | parth-paradkar/IMDb-Info | d3fd9781bfcdfa442e833be5fb2bfe673dce600e | a998b3d06eb1c41cc9f4f92f94f5b87454dcc481 | refs/heads/master | 2022-02-04T07:03:05.083056 | 2019-07-18T16:08:02 | 2019-07-18T16:08:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,935 | imdb | #!/usr/bin/python
import imdb
import sys
new = imdb.IMDb()
movie_name = ''
for arg in sys.argv[1:]:
movie_name += arg + ' '
try:
movie_name = movie_name[:len(movie_name) - 1]
movies = new.search_movie(movie_name)
movie_code = movies[0].movieID
new_movie = new.get_movie(movie_code)
# dictio... | |
64f52056ed9b14a3008dc0df4077a9616e2267b9 | ca37e3bb690088affecc2684e7031d40f2a815fb | /tests/test_snapshots.py | 5e7c121a3b97c5e65f758481a03ca39dc161db94 | [
"MIT"
] | permissive | PyDMD/PyDMD | 8eee572f308382d8284d240948fabba9b346fffb | fd80b189a0dc98c1d864036e1433def2315ebd0f | refs/heads/master | 2023-09-05T07:56:14.766667 | 2023-08-30T07:28:44 | 2023-08-30T07:28:44 | 94,094,268 | 58 | 19 | MIT | 2023-09-13T19:50:29 | 2017-06-12T12:33:47 | Python | UTF-8 | Python | false | false | 1,486 | py | test_snapshots.py | import numpy as np
import pytest
from pydmd.snapshots import Snapshots
def test_1d():
with pytest.raises(ValueError):
Snapshots(np.ones(10))
def test_2d():
X = np.random.rand(10, 5)
snapshots = Snapshots(X)
assert np.all(snapshots.snapshots == X)
assert snapshots.snapshots_shape == (10,... |
1933c8ea98ee97d4e1979c410a731eeece5246bc | 2dab1c87f65010fa9a2da2e150fc076dd0a40c09 | /AxiomaRiskRequestConsolidated.py | dbdfc5db5708bc0964c312bc1e10e361dfcc8e20 | [] | no_license | shora666/lib | 9d5f09f1f3e57c7a3b8e6efab00b20f3c98fac13 | 4c30aa8b587eddc656fac89923b3694f3f2e87b5 | refs/heads/master | 2023-04-18T23:02:34.598005 | 2021-04-22T18:23:09 | 2021-04-22T18:23:09 | 360,642,553 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 26,683 | py | AxiomaRiskRequestConsolidated.py | import sys
import os
def normalizeR2(R2):
if R2>1:
return 1
elif R2<0:
return 0
return R2
##########################
#DB readers
##########################
def getRequestUid(req_type,step,data_reader):
request_uid = None
sql = f"select count(*) cnt from axioma_running_q where reque... |
115f305eeeb04f332ddf8b1cefc8e7493994eb58 | 7c0b96bb69edf5745fc94008021491facbdb8b27 | /webgame.py | 29574eca5b5057b128f9136ea6f6c964c00bed62 | [] | no_license | Apelsin/TTTAI | 057af2c75bc09032cad55070b47101eee6dffbfb | a96c4c071b1d64af68cc3f64144a8eedcdb05780 | refs/heads/master | 2020-05-16T09:02:15.373003 | 2019-05-22T04:56:26 | 2019-05-22T04:56:26 | 182,933,891 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,458 | py | webgame.py | from flask import Flask, Blueprint, render_template, redirect, request, url_for
from tictactoe import State, Mark
from tictactoe.cache import StateCache
from tictactoe.ai import calculate_next_state_for
import json
from random import randint
import os
FLASK_APPLICATION_ROOT = os.environ.get('FLASK_APPLICATION_ROOT', '... |
22ea8e2bc5602ae436907f60906727a25f174270 | 5672737d1ff34bebfeb408426e52ed49df8be3bb | /graphgallery/nn/losses/sce.py | 7d6843035189f805d15308caf0f6d7dadba27053 | [
"MIT"
] | permissive | sailfish009/GraphGallery | 5063ee43340a6ca8da9f2d7fb3c44349e80321b2 | 4eec9c5136bda14809bd22584b26cc346cdb633b | refs/heads/master | 2023-08-24T19:19:59.714411 | 2021-10-16T10:10:40 | 2021-10-16T10:10:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 938 | py | sce.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class SCELoss(nn.Module):
"""Symmetric Cross Entropy Loss in
`Symmetric Cross Entropy for Robust Learning with Noisy Labels<https://arxiv.org/abs/1908.06112>`__
"""
def __init__(self, a=1, b=1):
super(SCELoss, self).__init__()... |
7acbb17da2fb9847e9e0423eccf007838c0e170e | b2084084e4b791a25635b1cfb296530d1271af7c | /products/migrations/0033_test.py | 7e263c4d10d6f223d6933f7d08aa18cd3686ee6f | [] | no_license | Ark005/test | 0ed019423a34c5cf5d4715c0d5577b56f9b57a73 | 4e3aca1d8295044624eb29cf333570a7f3a332d5 | refs/heads/master | 2023-05-28T06:14:32.119903 | 2021-06-09T17:13:37 | 2021-06-09T17:13:37 | 259,024,153 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,435 | py | 0033_test.py | # Generated by Django 3.0.6 on 2021-01-27 19:11
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('products', '0032_auto_20... |
ea69283f3b307d5fb392b5f731b842c86dc2905d | f71349c56c8902f826f8a6850fa01f3aecfacddf | /run_tests.py | f7256002b00ab39290e07cbb4bf618fbad591a53 | [
"MIT"
] | permissive | jamespic/wsgi_benchmark | eea0de9f5b5385820f690ad16351685f01bb39bc | d5c02fb7530501a46c22765bf3da7c564a68872d | refs/heads/master | 2020-12-03T08:12:38.444508 | 2017-07-08T11:15:18 | 2017-07-08T11:15:18 | 95,667,980 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,106 | py | run_tests.py | #!/usr/bin/env python
import contextlib
import docker
import subprocess
import os.path
import sys
import time
import urllib2
SERVERS = {
'bjoern': ['python', '-m', 'wsgi_benchmark.bjoern_server'],
'cheroot': ['python', '-m', 'wsgi_benchmark.cheroot_server'],
'cheroot_high_concurrency': ['python', '-m', 'ws... |
3bd8cfd3ccd39e5e3288daacfbd67f6befc4e00a | 99606e55fa1f300df45b5e5ea7301efc3ddb2d08 | /Animeface.py | f0643490277220daeab4a01e0c72d818989bcf9b | [] | no_license | tuananct/MyProject | da17ec2b47f537d082d72a6821912220070d150a | 4c5f4d77b5f47c4f67a0ed5578d5716b85afdf39 | refs/heads/master | 2021-01-10T02:24:00.858949 | 2016-03-03T18:28:50 | 2016-03-03T18:28:50 | 52,498,570 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 490 | py | Animeface.py | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from Animeface import CNN
from Animeface import AnimeFaceDataset
from chainer import cuda
#GPUつかうよ
print 'load AnimeFace dataset'
dataset = AnimeFaceDataset()
dataset.read_data_target()
data = dataset.data
target = dataset.target
n_output... |
3dd7b41f72bcc6c5492c1c237e26cc626ba023a6 | f2712df4d17a08bfdb713820deb007f374a11572 | /multiplication2.py | fe2c8d4993583234ad3926d608df0a5145977bb9 | [] | no_license | AkiOhtani/ALGO | 80a95c36cf93eaed2d3b0439683da8fe41399092 | 3e062cf634e0c5d68422437fd150cf16d23d9486 | refs/heads/master | 2022-09-04T05:11:01.018493 | 2022-08-27T13:45:25 | 2022-08-27T13:45:25 | 198,734,562 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 182 | py | multiplication2.py | N = int(input())
A = map(int, input().split())
if 0 in A:
print(0)
exit(0)
mul = 1
for a in A:
mul *= a
if mul > 1e18:
print('-1')
exit(0)
print(mul) |
759c8ab7648f0bff3661a812efae75d51cc75ce0 | ffba23da7120f2b91dd6d54ad5aff49a7af84f86 | /vid_processing.py | 49fffbeb43f8c294821e68ae8bc42e49cd080407 | [] | no_license | Katatafjsh/AGN-pytorch | fa1f9671794160f25da3ffa4ed6e4588ecf967d1 | d32b35d8632b6c67a7c170190856ca985d4a808a | refs/heads/master | 2023-02-26T00:07:17.880759 | 2021-02-03T20:02:12 | 2021-02-03T20:02:12 | 395,289,114 | 1 | 0 | null | 2021-08-12T11:02:41 | 2021-08-12T11:02:40 | null | UTF-8 | Python | false | false | 4,848 | py | vid_processing.py | from imports import *
class MeDataset(Dataset):
"""Eyeglasses dataset."""
def __init__(self, csv_file, root_dir, bs, transform_img=None, transform_land=None):
"""
Args:
csv_file (string): Path to the csv file with labels.
root_dir (string): Directory with all the image... |
0084c384e16a2a917e9f1c2d8a2b3642dbbecfdf | 0385a322a9e5f88029c9a8cf468ced6ea403aa71 | /bin/akamai-visitor-prioritization.py | ade8af16b1eddd265641f3daf393efcd4e3fb114 | [
"Apache-2.0"
] | permissive | akamai/cli-visitor-prioritization | e2a6553eb6eac449e272e6909b60d43cfbce0e0e | 1062ebedb3117976199304deeb7c858697ac1be9 | refs/heads/master | 2023-07-06T23:36:24.840818 | 2020-12-22T14:39:38 | 2020-12-22T14:39:38 | 99,955,655 | 2 | 5 | Apache-2.0 | 2023-05-22T23:19:51 | 2017-08-10T18:55:40 | Python | UTF-8 | Python | false | false | 43,955 | py | akamai-visitor-prioritization.py | """
Copyright 2017 Akamai Technologies, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law... |
d0ce99a5dd795396cc66cc83e8bfb5737e98bfaf | 28a462a28f443c285ca5efec181ebe36b147c167 | /tests/compile/basic/es2019/String.fromCharCode.spec | f1b43c421af75a13feadddf3ca71d951473f6f2a | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | kaist-plrg/jstar | 63e71f9156860dc21cccc33a9f6c638dfee448ea | 1282919127ea18a7e40c7a55e63a1ddaaf7d9db4 | refs/heads/main | 2022-07-22T08:12:34.947712 | 2022-02-27T04:19:33 | 2022-02-27T11:06:14 | 384,045,526 | 6 | 4 | NOASSERTION | 2022-02-27T11:05:26 | 2021-07-08T07:53:21 | Python | UTF-8 | Python | false | false | 649 | spec | String.fromCharCode.spec | 1. Let _codeUnits_ be a List containing the arguments passed to this function.
1. Let _length_ be the number of elements in _codeUnits_.
1. Let _elements_ be a new empty List.
1. Let _nextIndex_ be 0.
1. Repeat, while _nextIndex_ < _length_
1. Let _next_ be ... |
0ab77f96f052bf03e260c391da0c8e13dd86bdcc | 3795b688ea994e9dff4160cde511d1807284ca73 | /authenticate/migrations/0002_auto_20200304_1304.py | b35671b4d45ee9f36568ad9396b88f4733dc165c | [] | no_license | owlishka/Quiz-project | 07792af63c5fdd1987bbbcfd75caf6f8beb2c192 | a4df26be0057d12743d7cdb6a5e207448774017a | refs/heads/master | 2022-12-08T21:44:30.078853 | 2020-03-25T14:01:35 | 2020-03-25T14:01:35 | 249,971,449 | 0 | 0 | null | 2022-12-08T03:53:16 | 2020-03-25T12:23:30 | HTML | UTF-8 | Python | false | false | 703 | py | 0002_auto_20200304_1304.py | # Generated by Django 3.0.3 on 2020-03-04 13:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authenticate', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='picture',
... |
3c729c86568e9077709428d3d7cda2ed957e4168 | dad01fede3f4802e98d5e6ef1d7a3d2c1c448257 | /Algorithm/Greedy(탐욕법)/[백준_1744]수 묶기(미완).py | d31827264c90d53ad5c51a2b78b913d3a5f1d879 | [] | no_license | alyssa1996/CodingExercise | 55ae8b1833552f1106a08005d651289d2dd5fd60 | d31c3822a39ae8a301d48e1926fa787f556cff87 | refs/heads/master | 2021-10-17T04:11:22.155442 | 2021-10-08T13:45:08 | 2021-10-08T13:45:08 | 218,627,544 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 636 | py | [백준_1744]수 묶기(미완).py | #음수양수 나눠서 계산해야함
n=int(input())
number=list()
for i in range(n):
number.append(int(input()))
number.sort(reverse=True)
index=0
total=0
while index<n:
print(index, number[index],total)
if index==n-1:
total+=number[index]
break
multiply= number[index]*number[index+1]
if multiply > nu... |
6e4843407b056d292d6fffde5018e1b0606b62b5 | e21aeee2e73aa6956c702932e760cc5e4ffef7a2 | /3 数字、日期和时间/10 矩阵和线性代数的计算.py | 48d4e60ac911fd53ece591fa3b74c9e35cd486c0 | [] | no_license | yourblue/pythoncookbook | 93113aa5d1d6240473344ef70b5683ae805248c9 | 6fcfef101b850098d7a5033efffeeac5951fc462 | refs/heads/master | 2021-09-05T17:44:36.037792 | 2018-01-30T01:33:57 | 2018-01-30T01:33:57 | 106,510,645 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 200 | py | 10 矩阵和线性代数的计算.py | """
同样使用NumPy,里面有一个matrix对象可以来处理这种情况
"""
import numpy as np
m = np.matrix([[1, -2, 3], [0, 4, 6], [9, -10, 2]])
print(m.A)
print(m.A1)
print(m.H)
print(m.T)
|
7d11907cde897b429adf725c7c9fc1a864f101a5 | 68a3fd553c41aa8f16ba9380fddbcfa087d6e341 | /get_bitcoin_core.py | 1f7fffd59a334f931ecff92a94bb6c792e4ee621 | [] | no_license | osgirl/bitcoind-jessie | 468aa80429068ef19f68b7ba114b946dea243554 | d9380ce9ee620ef58229d9ab7e7c9b77399392f9 | refs/heads/master | 2020-05-04T20:29:48.194380 | 2017-12-11T23:32:31 | 2017-12-11T23:32:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,153 | py | get_bitcoin_core.py | #!/usr/bin/env python3
#
# sudo pip3 install gnupg psutil clint bs4
# nice to have: dpkg debconf debhelper lintian
#
import requests
import os
import tarfile
from bs4 import BeautifulSoup
from clint.textui import progress
from hashlib import sha256
from gnupg import GPG
host = 'https://bitcoin.org'
session = request... |
3cb89a63be4e04e1b3fc7c99dbdca33edfee95e2 | 8575c7e7f49799eb7aeccb95448cea79ccd39b42 | /pwn/x86-64/04-shellcode-static.py | 9789940ec41823627a8d44a39b862460547f6d52 | [
"CC-BY-4.0"
] | permissive | xairy/easy-linux-pwn | 26b8c6ad0fa583dd91eb44ac750f0516009770cd | 203b685216d0a4c974c1ec0091a577a4e87cfb2b | refs/heads/master | 2021-12-30T02:59:43.453805 | 2021-12-26T23:55:54 | 2021-12-26T23:55:54 | 180,017,142 | 528 | 97 | null | null | null | null | UTF-8 | Python | false | false | 1,988 | py | 04-shellcode-static.py | #!/usr/bin/python
"""
(gdb) bt
#0 0x00007ffff7af4081 in __GI___libc_read (fd=0, buf=0x7fffffffdd80, nbytes=512) at ../sysdeps/unix/sysv/linux/read.c:27
#1 0x0000000000400643 in vulnerable () at src/04-shellcode-static.c:10
#2 0x0000000000400669 in main (argc=1, argv=0x7fffffffdf08) at src/04-shellcode-static.c:17
(... |
ee3c1aa6a1ef3b9ae36df1238ef4541681dd14b6 | b968bed97fa74547abcef80b1dafe4e80380c5ca | /pflotran/speciation/Dong2010/ex4/ex40.py | bec4e090ce889f81c2167e9baaf22d8ae9949785 | [] | no_license | t6g/mercurybiogeochemistry | f3b5d2849250eace0f363ec7ed47be8555b005fd | be32280e317977463c08a971af5d08e2cdfd4d77 | refs/heads/master | 2021-01-21T13:11:31.721234 | 2016-04-23T20:09:09 | 2016-04-23T20:09:09 | 54,476,666 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,362 | py | ex40.py | from pylab import *
pf = np.loadtxt('ex40.txt', skiprows=2)
phqc = np.loadtxt('../../../../phreeqc/speciation//Dong2010/ex40.txt', skiprows=2)
incr = phqc[:, 0]
xx = incr * 1e9
xp = pf[:, 0] * 1e9
ax1 = subplot(2, 1, 1)
plot(xx, np.divide(phqc[:, 1], incr)*100.0, 'b-', xx, np.divide(phqc[:, 2], incr)*100.0... |
5e5ebf96ecf7659770007570dec524bfac2577a5 | 25db699a3089086f220772297faf68c57fb26ab2 | /src/tests/LandmarkTests.py | cc4e8cb1bc8f3f6dac0a69e327aa7f5b6e538dc3 | [] | no_license | ToFec/TorchSandbox | dbd38907618d1d528502bfc6a82295ce97475e1c | 0b83583daeae9ddf8a156e2f089866301f1f80d3 | refs/heads/master | 2020-04-07T20:17:09.543482 | 2019-04-26T08:56:27 | 2019-04-26T08:56:27 | 158,682,208 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 714 | py | LandmarkTests.py | import sys
import eval.LandmarkHandler
class LandmarkHandlerTests():
def dirLabTest(self):
landmarks0 = '/home/fechter/Bilder/DirLab/Case1Pack/ExtremePhases/Case1_300_T00_xyz.txt'
landmarks5 = '/home/fechter/Bilder/DirLab/Case1Pack/ExtremePhases/Case1_300_T50_xyz.txt'
pr = eval.LandmarkHandler.PointRead... |