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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
086a9e13dd03ead1333e9b05c9235377b59a30d4 | 9b0ccf8746ff73c42aa7a77bb5bf62356147cc9f | /ManoelGadiFA/H5_Method_picking.py | ef0a10994e48f83706d1303fd1cf7c60746407ec | [] | no_license | iyadaqel/ManoelGadiFA | 6493a3458cd3a13f84dd95cae9e0c5d063b53c9c | f0ccf18248405a84979e50a34dc4b68b7932b832 | refs/heads/master | 2021-01-20T21:11:58.535826 | 2016-06-19T20:44:36 | 2016-06-19T20:44:36 | 61,152,423 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,566 | py | H5_Method_picking.py | def mp(x, y, testSize=0.25, randomState=0, peceptronIteration = 20, perceptronLearningRate = 0.01, svmCost = 10, rfTrees = 10):
from sklearn import cross_validation
X_train, X_test, y_train, y_test = cross_validation.train_test_split(x,y, test_size=testSize, random_state=randomState)
from sklearn import l... |
71efe8da743de42d7cf7395ff29f68735c0be39c | b59b2d77a7c7088527a488736ba3a594d3956f54 | /data/terraform_openstack/openstack_terraform.py | 87a5b585cd873a37eb838181a710d29d7ccdfda2 | [] | no_license | ddorahee/openstack_agent | 0838b36af10691540e6c26427afd1924e6ec85ad | 844ee9ac9c702fa34d1039c4811e216f60872ad2 | refs/heads/master | 2022-07-10T00:05:10.751634 | 2020-05-21T07:46:33 | 2020-05-21T07:46:33 | 235,734,947 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,094 | py | openstack_terraform.py | import os
class Terraform:
@staticmethod
def make_terraform_provider(path, key, OS_TOKEN) :
if not(os.path.isdir(path)):
os.makedirs(os.path.join(path))
try :
provider = open(path + "provider.tf", 'w')
content = 'provider "openstack" {\n\t auth_url = "%s" \n... |
672596e59e71941db7a8436f24b0986746af3117 | 07fde133fbfea8a634d70cb8775228ca4dd9316f | /button_test.py | b4fe680b191c0ec56d3a6d6bc53d55257c9e5160 | [] | no_license | christophkormesser/FORB | 43cb8d9c05792adbe24e864c124a0a071b2674cf | dca5d319d9c0940f511fedfe7ea2c715fc20a11b | refs/heads/master | 2021-06-05T13:55:44.375475 | 2021-04-20T11:09:04 | 2021-04-20T11:09:04 | 157,603,345 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 368 | py | button_test.py | import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(21, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
if (GPIO.input(10) == False):
print ("Pin 10 is true")
# do stuff based on pin 10 here
elif(GPIO.input(21) == False):
print ("Pin 21 ... |
f01228b371d3db39ca5a511099eb5809dff29154 | 4cda19d066c6641b73574eaec9a2b27fdd8de6bd | /main.py | 2144cfd0d464430996485fa753e3ea882f4dd15b | [
"MIT"
] | permissive | Mrestof/FRDownloader | bacfdcc4a65d5726ec5f338cabbda41d521318ae | c2b93819032a0320cfcdd134dbe9d5354fa306dd | refs/heads/master | 2023-05-07T11:25:34.648811 | 2020-09-07T16:39:30 | 2020-09-07T16:39:30 | 260,980,908 | 3 | 0 | MIT | 2021-06-02T02:06:45 | 2020-05-03T17:12:30 | Python | UTF-8 | Python | false | false | 6,839 | py | main.py | import os
import requests
from functions import parse, get_link, download_and_place, compile_path, save_path_to_config, get_path_from_config
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.popup import Popup
from kivy.uix... |
934a73deb43010274085949548edd0b2dd37deba | 405f98192a83e9fb042289627eafb9b608c0d4f8 | /afros_uploader/vex_serial/vex_device.py | 44932b4a87cae81a5b45214b8d19bb9806615563 | [] | no_license | Aggie-FIRST-Robotics/AFROS_uploader | c27636d24cb62cca049ed146d8f046469733cce6 | d254c918a5d09e99cc7093ca8a8dba66aecfc388 | refs/heads/master | 2020-08-19T09:04:14.604935 | 2019-10-21T00:20:04 | 2019-10-21T00:20:04 | 215,902,464 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,271 | py | vex_device.py | import struct
import time
from typing import *
from ..util import *
from . import bytes_to_str
from .base_port import BasePort
from . import comm_error
from .message import Message
from .generic_device import GenericDevice
def debug(msg):
print(msg)
class VEXDevice(GenericDevice):
ACK_BYTE = 0x76
NACK_... |
fab9ef2a6efb543cfc3305acf0910eb53547bc38 | 2ea93d1a3cc00d1369b7f0a958c8ea2b94776d16 | /FabioPagani/new_plugins/workqueues.py | b82280b1e0091adf29be3493da9bf843021279e7 | [] | no_license | pagabuc/community | 905a4e4407937cff7ffebc2056c17a355af691a6 | 8ecfc10eba06c3378abf211b3e56da6d09cc1a7e | refs/heads/master | 2022-10-25T00:27:03.424920 | 2020-06-15T17:09:48 | 2020-06-15T17:09:48 | 272,495,351 | 0 | 0 | null | 2020-06-15T16:54:48 | 2020-06-15T16:54:47 | null | UTF-8 | Python | false | false | 1,529 | py | workqueues.py | """
@author: Fabio Pagani (pagabuc)
@license: GNU General Public License 2.0
@contact: pagani@eurecom.fr
@organization: EURECOM
"""
import volatility.obj as obj
import volatility.plugins.linux.common as linux_common
import volatility.plugins.linux.pslist as linux_pslist
# Note: another way to list wor... |
d3c034a68eb190da073dbde70038ec9a065c537a | 79b1c7633f389e89529f963934ada18105a5e62b | /engine/sample_alert.py | 494745f4f1d2089e21a2a67143d51f608713b57d | [
"MIT"
] | permissive | x-risk/x-risk | 045b15c11d97feefc186f6027fd580c0d903683b | 2f39055d735415aefdc4b99d2a44dbe8b96979bd | refs/heads/master | 2023-04-14T18:22:50.452841 | 2023-04-10T01:50:28 | 2023-04-10T01:50:28 | 253,483,156 | 7 | 0 | MIT | 2022-11-21T22:09:12 | 2020-04-06T11:55:43 | CSS | UTF-8 | Python | false | false | 2,238 | py | sample_alert.py | # Run this script as a "standalone" script (terminology from the Django
# documentation) that uses the Djano ORM to get data from the database.
# This requires django.setup(), which requires the settings for this project.
# Appending the root directory to the system path also prevents errors when
# importing the models... |
24a08a72264a0dc5ecf9cb7cc62fa5c7e7bc85b7 | 8fdf3edc49ac05419e08e45d94f6179107b10ff2 | /CAIL/models/CNN.py | 383bf452043675aff977eee5d1b55d5fb27e1b05 | [] | no_license | zenRRan/muti-classification-of-law | f78fa6b781291b1c61f9f2bad37cf2b2a7ada67e | fa3f98e45e88226be7e10e2134bccb5d934ea84c | refs/heads/master | 2020-03-21T14:56:01.471198 | 2018-06-30T13:10:19 | 2018-06-30T13:10:19 | 138,683,993 | 5 | 3 | null | null | null | null | UTF-8 | Python | false | false | 193 | py | CNN.py | #!/usr/bin/env python
# encoding: utf-8
"""
@version: python3.6
@author: 'zenRRan'
@license: Apache Licence
@contact: zenrran@qq.com
@software: PyCharm
@file: CNN.py
@time: 2018/5/15 9:05
""" |
f9f307c44b2f2b3fd90c6d2d4242219448b5fd72 | 662b6dbbfb8d0b9ad57ad15c0fe36e6998364c81 | /management/library/urls.py | 947fa85b3d1dd53cea066e13b6ac99a5535d144c | [] | no_license | PunitSolanki1999/Managgiamo | ee7d70db4b0cba6a4bbcf95f1acf946450aaabde | c37f00dc1807b456615f32d998fb8b073716b01b | refs/heads/master | 2022-12-12T19:29:30.114080 | 2020-09-07T09:20:03 | 2020-09-07T09:20:03 | 293,479,910 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,685 | py | urls.py | from django.urls import path
from .views import register,library_interface,library_book_register,library_member_register,update_fine,book_issue,return_book_form,return_book,book_in_library,book_in_library_form,member_in_library_form,member_in_library,book_issue_detail_form,library_book_fine,library_account_detail, upd... |
bac050f16bd4b1d2a25875256d68e7ffa02968c9 | 710f1e1eefde21255c6d05b3d55ef95a1236db83 | /kingfisher_scrapy/spiders/panama_dgcp_base.py | bcfc00d32946d92bf7c2a4e526cb1901e52bdf2c | [
"BSD-3-Clause"
] | permissive | open-contracting/kingfisher-collect | 7320a67c29ef56a426d1671236b09baff817767b | 83c445879189ef3c52c9e9e89e024aa8e303f5f7 | refs/heads/main | 2023-08-13T12:36:27.200328 | 2023-08-09T20:37:27 | 2023-08-09T20:37:27 | 162,262,509 | 11 | 8 | BSD-3-Clause | 2023-09-04T19:16:40 | 2018-12-18T09:21:59 | Python | UTF-8 | Python | false | false | 446 | py | panama_dgcp_base.py | import scrapy
from kingfisher_scrapy.base_spiders import IndexSpider
class PanamaDGCPBase(IndexSpider):
# IndexSpider
page_count_pointer = '/pages'
# url_path must be provided by subclasses.
def start_requests(self):
yield scrapy.Request(f'https://ocds.panamacompraencifras.gob.pa/{self.url_... |
ddbf53a225e98be95b383b8d986c7368cf674f30 | 0e8e31e1da6e9da0b84f4149a1c5ff00a473b96d | /data/ubuntu vm/GraphDB/check_status_restart.py | 9d34a10393c1b902eb7c36e9ce9978c1de0fb103 | [] | no_license | jsheng1996/fyp-monero-tracability | 1b76d86462a2fb6e2ae112140a51b6f7e2633c3b | 2a14dbba132e0adc77f0653dc95354e70d6ac5d3 | refs/heads/main | 2023-06-12T09:49:28.715168 | 2021-07-01T10:03:48 | 2021-07-01T10:03:48 | 381,983,027 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 855 | py | check_status_restart.py | import requests
import os
import subprocess
import locale
import datetime
cmd1 = ['pgrep', '-f', 'anon_analysis.py']
#Function to check if process is running
def check_proc(cmd):
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
o, e = proc.communicate()
return o.dec... |
555f1edebfc755052914269621acc523196f40e0 | c32eefcc6d30e6a1cb91f392d894c71258966e63 | /stats.py | 9e99f3f30321a87ea7f2b877eb112ceb856b787a | [] | no_license | UNREALre/TelegramBotProductsKK | 7a37e2d2463854ada6a11f2fec216df5d142a4d6 | 061981e4498d66180b21474f2a6121edd74e276e | refs/heads/master | 2022-07-06T02:35:35.280242 | 2020-05-19T13:46:38 | 2020-05-19T13:46:38 | 263,036,857 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 880 | py | stats.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from config import db
requests_collection = db['user_request']
def get_top_10_requests(n=10):
"""
Возвращает топ n запросов пользователей за все время
По умолчанию - 10
"""
cursor = requests_collection.aggregate([
# Group the documents and "... |
f3b2f2913dbefeaab53773aead451b44a223de5e | dd9614f891b2465d91afd1fe44ab0450c58cb5fa | /sprint8.py | 95892b71be64e55146ad52211d8539efabe40e7d | [] | no_license | graceekerr123/Pizza-Time | 83cecf3f86695cea6e10dd65c23de0116433d0d2 | adab48ebf170d98f341970e28f884557b26f3241 | refs/heads/master | 2023-01-11T17:06:44.541338 | 2020-11-12T00:03:35 | 2020-11-12T00:03:35 | 275,714,347 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 17,432 | py | sprint8.py | """This is a pizza ordering program."""
# import validation functions from another file
from validationsoption2 import get_one_string2, validate_quantity, validate_index, validate_string, validate_number
def print_list(plist):
"""
Print pizza list with no index numbers.
:param plist: list (with name and ... |
75ed9115aadebfeecdd8609d0df9c93360924c06 | 98deb23c3c2efea3f197afbc81b8f0d81538ec39 | /openstack/os_service_check.py | 90ffa14048997a2f54d0cf9d419892ceb6eeacb5 | [] | no_license | aneeshkp/highlander | a778dc5fcf1a30d58264e9a2d71310f5293cf5a8 | a5e582eca8e1aac3346a2d829f2b77697b2b121c | refs/heads/master | 2021-01-19T12:39:34.753334 | 2017-03-13T14:30:52 | 2017-03-13T14:30:52 | 82,197,635 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,050 | py | os_service_check.py | # Copyright 2015 - Aneesh Puttur, Inc.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
e23db31bf3389171763cd3ec4d7a9a789208be02 | e05ee5dd435dc691a4b39f4cd4035a22d6eeb6ab | /IN104/GIT/Hello_word.py | 23862fadf2dbaf200c1699ffd6fefc9bba2008a5 | [] | no_license | gabriel514/IN104_Derrida_Gabriel_Loire_Baptiste | b7ba0057eea6140c9329772ace87468c14a3943d | d0d5ae55542a4c09f31793f9e2bb40f539616c15 | refs/heads/master | 2021-05-21T03:08:00.389328 | 2020-04-02T17:38:21 | 2020-04-02T17:38:21 | 252,515,385 | 1 | 1 | null | 2020-04-02T17:31:32 | 2020-04-02T16:57:52 | Python | UTF-8 | Python | false | false | 137 | py | Hello_word.py | print("Hello, Word!")
#Bonjour Gabriel, ce commentaire je l'écris en tant que collaborateur, donc tout marche comme sur des roulettes.
|
476993ecea1c398b77f3967ac5d7122fe25405df | 3cc529fdc6f35183d0e5d9ed517cdf9f5e3f7d5f | /Computer Science 2 (Sophomore, Python)/Labs/lab12/csc102_lab12_queue_computer.py | 11b87bf3f54a7b8e6dbece95e40a2be6e3643c0f | [] | no_license | fsnuth98/Computer-Science-Coursework | 53a236763fe6ec53eedb24bb623e7e41225a0d63 | 948c536ddaf4269fb0b40677bd64dde30bc9373c | refs/heads/master | 2022-12-14T08:19:59.465724 | 2020-09-24T02:17:43 | 2020-09-24T02:17:43 | 298,101,115 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 756 | py | csc102_lab12_queue_computer.py | from queue import *
def main():
print("Queue computer.")
print("Enter a sequence of + and - characters (no spaces).")
queue_program = input("Enter queue program: ")
q = Queue()
count = 1
for character in queue_program:
if character == '+':
q.enqueue(count)
... |
ab904fd1c5d57f727fcb33708263ccaad2332608 | 1a6ce2bbd750db01e6a02c89e4a300cafee5ec35 | /Fletcher_PPO/AUVSim-v0/Dec-24_11-20-31/fakegym.py | d607a8cc73268ab51073721754da63921bba7ff0 | [] | no_license | FletcherFT/RL | bf7f25fc98aa40d1b3b9345439be2d272443e411 | cd646a3d1a78d93d639c0c1acfedff167f508f98 | refs/heads/master | 2021-09-02T20:19:38.643316 | 2018-01-03T21:30:58 | 2018-01-03T21:30:58 | 116,162,514 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,665 | py | fakegym.py | import rospy
import dynamic_reconfigure.client
from sensor_msgs.msg import JointState
from nav_msgs.msg import Odometry
from gazebo_msgs.msg import ModelState
from geometry_msgs.msg import PoseStamped
from std_srvs.srv import Empty
import tf.transformations as transform
import random
from math import pi, sqrt
from gym ... |
1506b135f013c5c7f58311fcbaabf8b21c5a14da | 736f042e489f0cc7e0b77f1b78a0de4d1054deed | /src/api/admin.py | d4d0da89e6df2da0d6cb771c9bf637ccada03133 | [] | no_license | Zarbul/apptrix_test | 6602102119e7a87e14ac0fcdaa03ab164aee7dc2 | 53da2a062380bbc6c89f0aa236a30f8c17e778c5 | refs/heads/master | 2023-08-16T06:47:27.228609 | 2021-10-19T22:32:05 | 2021-10-19T22:32:05 | 418,605,983 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 226 | py | admin.py | from django.contrib import admin
from . import models
@admin.register(models.AuthUser)
class AuthUserAdmin(admin.ModelAdmin):
list_display = ('id', 'first_name', 'last_name', 'email')
list_display_links = ('email',)
|
5ed22d4b16d17a6993d6274f4534042f8a2b9442 | a42500eff450ab6122c036abb85c6cd21227b795 | /test/test_py_code/py_type_annotations.py | 09953eca2583439f1482311466abd0211fe5ac5b | [
"MIT"
] | permissive | chenjd/pyuml | cc98af07dbc57efee63565bf3034fe8de54f137b | d4af3040f443d61d339c06faab51a4c3aa4775b4 | refs/heads/master | 2023-07-27T13:27:13.407057 | 2021-04-18T21:22:31 | 2021-04-18T21:22:31 | 245,058,855 | 5 | 2 | MIT | 2022-11-22T07:41:01 | 2020-03-05T03:22:12 | Python | UTF-8 | Python | false | false | 841 | py | py_type_annotations.py | class MovementObject:
def __init__(self):
pass
class Car(MovementObject):
def __init__(self):
self.num_one: int = 1
self.num_two: float = 2.0
self.name: str = "car"
def get_user_name(self, user_id: int) -> str:
return 'car'
class Car2(Car):
def __init__(self)... |
3f6f6c527633fd5771dc55269daf62d4fc361401 | 42e7bf5f7b480d221a40d0e356abb703a910f297 | /leasing/models/contract.py | 9a38fdb46b0126d87fced9efab2364b83109703e | [
"MIT"
] | permissive | tuomas777/mvj | 42a424be9af32265ab4a736d0d484bf28dd72f08 | e9a12e42c399b9fb77fd8fad85fc8f0f6d4ce405 | refs/heads/master | 2020-03-11T03:11:28.597189 | 2018-04-10T10:50:31 | 2018-04-10T10:50:31 | 129,739,969 | 0 | 0 | MIT | 2018-04-16T12:28:43 | 2018-04-16T12:28:43 | null | UTF-8 | Python | false | false | 4,325 | py | contract.py | from auditlog.registry import auditlog
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .mixins import NameModel, TimeStampedSafeDeleteModel
class ContractType(NameModel):
"""
In Finnish: Sopimuksen tyyppi
"""
class Contract(TimeStampedSafeDeleteModel):
"""
... |
ea0351706f3bf8d4fa0f4ceb978e78d7105b5cf9 | e9b7f94749026c0fbbdced8dc7b2a1b844062d90 | /p.10.1.py | f669089db9d6245c75f335dd17c10ac99cc811f1 | [] | no_license | thijsishiernietgoedinaarts/prog | 54aa9cf61349946e03eb3f490e8004a3a4624d3d | e42f81eb9aaa39face5513e1bb6c6035c711ecce | refs/heads/master | 2020-04-01T20:47:19.847590 | 2018-10-23T11:16:41 | 2018-10-23T11:16:41 | 153,620,630 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 527 | py | p.10.1.py | bruin = {'boxtel','best','beukenlaan','eindhoven','helmond t hout','helmond','helmond brouwhuis deurne'}
groen={'boxtel','best','beukenlaan','eindhoven','geldrop','heeze','weert'}
print('dit zijn de haltes die beide trajecten hebben: ', end='')
for x in bruin:
if x in groen:
print(x, end=' ')
antwoord1=brui... |
c189c0eb0ec80d6ced44a7c6e7f6aaae54ff48b6 | 0d6de4231f66336011b97aaa4b1169b055aa08a3 | /users/migrations/0017_auto_20190101_1603.py | cbe3caa33494ed0131bfc618ae02aedff664d3f9 | [
"MIT"
] | permissive | shinying/SA | 71510a8987e8093bf095d58844fc1c24321a882e | 9473fc8fb987b8b1a4c8194f6e8311a27a00ca4b | refs/heads/master | 2021-08-18T02:52:45.395957 | 2019-06-11T07:35:30 | 2019-06-11T07:35:30 | 191,021,362 | 0 | 0 | MIT | 2020-06-05T21:41:12 | 2019-06-09T15:12:13 | JavaScript | UTF-8 | Python | false | false | 994 | py | 0017_auto_20190101_1603.py | # Generated by Django 2.1.1 on 2019-01-01 08:03
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('users', ... |
2c086835f1ea33d337c91299dc5f544aef62cc8e | 401f9d26571d67c014f060bb7427aba1f533dbce | /handlers/admin/start.py | e192b3c0b1e1ac1e79722e6b5014eb4009e0cf7b | [] | no_license | rezakien/docker-ready-python-shop | 7802f2e5fa034ffc1d52ed2ae008af3a2b9c9a14 | 50c484c151a1b0dfd18ed23c34ab1c7c73d02f00 | refs/heads/master | 2023-05-16T17:00:44.789418 | 2021-06-10T10:27:03 | 2021-06-10T10:27:03 | 367,644,858 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 918 | py | start.py | from aiogram.types import Message
from aiogram.dispatcher.filters import Text, Command, CommandHelp
from keyboards.inline.admin.menu import get_admin_menu
from loader import dp, _
from utils.helpers.decorators import admin_sign_in_message
@dp.message_handler(Command("admin"))
@admin_sign_in_message
async def menu_or... |
84272d6c5a0dee516fbb18d74485c34fda98bc2d | 477b082091ae22bd15febb68f9a4b9dff4189516 | /parameter/model.py | 999b40ae72a0f5e880867d44268231573af6db09 | [
"Apache-2.0"
] | permissive | coldnight/parameter | 74098fac2047eaa6615de61b1f68e5cd79ea80d1 | 70a9f5e21ebb78d526d074eea64a16242b129848 | refs/heads/master | 2021-01-19T09:49:13.490543 | 2017-04-28T03:45:17 | 2017-04-28T03:45:17 | 87,789,936 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,436 | py | model.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Model and Argument."""
from __future__ import print_function, division, unicode_literals
import abc
import inspect
import six
from .types import Nested
from .exception import ConvertError, ArgumentMissError, ArgumentInvalidError
@six.add_metaclass(abc.ABCMeta)
class ... |
c3f8e181ccb8d69bbb679065cf22233854d74770 | f1b4c7550410e5206087195a8d6fdfb89272ba0c | /organizations/migrations/0041_auto_20160122_1705.py | 83817a9d94f955b9a5f53cffdcf07e56cf0bf9ba | [
"MIT"
] | permissive | getcircle/services | c2fb0f0a5b3844e62e05320752309fc13564de5a | 5673b198e95bdab26788c4603c26e0854758c30b | refs/heads/master | 2022-10-24T04:19:28.100600 | 2016-12-05T04:45:02 | 2016-12-05T04:45:02 | 27,793,404 | 0 | 0 | MIT | 2022-09-23T21:14:41 | 2014-12-09T23:53:24 | Python | UTF-8 | Python | false | false | 661 | py | 0041_auto_20160122_1705.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('organizations', '0040_auto_20160122_1614'),
]
operations = [
migrations.RemoveField(
model_name='sso',
... |
4b4c8e84075c6aa35a82bfb859f24daf2cf0720c | d7531e06948de16b63fb4b25a7560a226a8c01cf | /restaurants/models.py | 898215a3637f7ccefbda6967ec211d50aca4f721 | [] | no_license | sunilgenius/django1.11 | d848366617b01bd9fea6d4ef2bee9321318fdfbd | ce432d146b1af22eedd606bc0d4aa6e38eb448a1 | refs/heads/master | 2020-04-03T21:55:19.537455 | 2017-12-20T17:34:56 | 2017-12-20T17:34:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,387 | py | models.py | from django.conf import settings
from django.db import models
from django.db.models.signals import pre_save, post_save
from .utils import unique_slug_generator
from .validators import validate_category
User = settings.AUTH_USER_MODEL
# Create your models here.
class RestaurantLocation(models.Model):
owner ... |
103b807fc258356224ec783048dcb4cff12c1a64 | 6d6cb15a59e2bdc2ac7fb4425d1c2baccfabc703 | /nln_old.py | 2a8fc8b122101cbc4774ecb71f83ab22f9e7c807 | [] | no_license | atbolsh/glowLU | 63ff5a609105b73e8d38530192301878eb765c4d | 069904026fb10c157e573ddbdbd9b1fce61a5761 | refs/heads/master | 2020-03-27T22:38:30.628262 | 2018-09-18T19:52:05 | 2018-09-18T19:52:05 | 147,248,038 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,315 | py | nln_old.py | """
Module to compute the nonlinearity used.
"""
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import torch
import torch.utils.data
from torch import nn, optim
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
from torc... |
692b000ac94139b72a3ee5742fd84fa50da238a4 | 991c16d2b65bbd87eae74f6be81d037674fb2ee6 | /1-evaluating_word_reps/src/reading_word_embeddings.py | 859c5603a3111455dd4a268b2d7592e147ebc7d9 | [] | no_license | Jack-Harding1/ULL | 314a2437438ec778ec9b26723584a1516f8ad27b | 33ab2a8c5c8fc6fd8128b009a4f2f592ffc1a04d | refs/heads/master | 2020-03-09T12:19:16.343931 | 2018-06-05T22:06:57 | 2018-06-05T22:06:57 | 128,782,748 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,397 | py | reading_word_embeddings.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 19 18:43:18 2018
@author: jackharding
"""
from scipy.spatial.distance import cosine
from collections import defaultdict
from scipy.stats.stats import spearmanr
from scipy.stats.stats import pearsonr
def run_experiment_one():
word_embeddings_fi... |
83d950984e6de7359515973b7f4c0d5117f9d426 | a81a1efe1a93d5af0ef3f6403862a1544befd6cf | /TwoPointers/532_K-diffPairsInAnArray.py | f3aa9096eec15f031d60be0c8a389f0d850c7abd | [] | no_license | fishleongxhh/LeetCode | 89da4ae3ca1715b1909c350437c0ba79eb2a8349 | d0352fecc61396fc460e1350572189b175a13f61 | refs/heads/master | 2020-04-05T17:14:27.976946 | 2018-12-16T14:10:54 | 2018-12-16T14:10:54 | 157,050,997 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,226 | py | 532_K-diffPairsInAnArray.py | # -*- coding: utf-8 -*-
# Author: Xu Hanhui
# 此程序用来求解LeetCode532: K-diff Pairs in an Array问题
#用到了排序和两个指针的方法, 排序会大幅降低运算速度
def findPairs(nums, k):
nums.sort()
n = len(nums)
if n <= 1:
return 0
start, end, cnt = 0, 1, 0
while end <= n-1:
target_num = nums[start] + k
while end <... |
d27df5e4bb337705ebadf2b7623776030ebdeedc | 00d52ccd6a28975ac1cab4dea50850e1477bf67a | /day12/main.py | 7883a80ddf513eefd58093511213858a65c932d7 | [] | no_license | joel-lim/Advent-Of-Code-2020 | d845104da0c1778af7401809839d1521e8ec0906 | e5fb32d8d64e671f1292becd8d06d2d988fa2d3f | refs/heads/master | 2023-01-25T04:08:53.068266 | 2020-12-14T12:36:35 | 2020-12-14T12:36:35 | 317,200,175 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 615 | py | main.py | """
https://adventofcode.com/2020/day/12
"""
from ship import Ship, ShipWithWaypoint
FILE = 'input.txt'
def main():
ship1 = Ship()
ship2 = ShipWithWaypoint()
instructions = parse_input(FILE)
for instruction in instructions:
ship1.read(instruction)
ship2.read(instruction)
print(f'P... |
44ea6add560474f3de887a1f56bc31ac2250ac4b | 23f42ca7d3ee17d64488e5c51840e0c44f808754 | /customers.py | 6f612c1e0d93c24c2d3fdd3b7d7469112eb29df7 | [] | no_license | AlexGeorgeLain/OOIS_System_Implementation | 79a9facaad13d354a877a13e5cc05ffe254cf384 | 5d6dc405121799f41adcdcfd4104053b1ad37345 | refs/heads/master | 2023-04-11T01:31:46.743003 | 2021-04-19T19:50:15 | 2021-04-19T19:50:15 | 359,579,881 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,485 | py | customers.py | import config
#import config module for database connection
from tabulate import tabulate
#import tabulate module for displaying tables
con = config.con
cur = con.cursor()
#sqlite connection and cursor variables
class Customer:
"""Customer class which has attributes for username, saved address, and saved payment... |
a2c1b554717913bf7d3983e3d02209a428a1a09e | a706e24122d8112179ab0156b244160b9c15b16a | /span_model/models/embedder.py | 216dad8654561bbec6aa71e16144ec4b47ba8b0a | [] | no_license | anshiquanshu66/Span-ASTE | ca38ed682f7e15b55955c8752a2e918d95e7a575 | 39863f8f8a988a83eb04d43a7834df178c3f22b0 | refs/heads/main | 2023-06-21T05:49:02.282519 | 2021-07-30T08:01:36 | 2021-07-30T08:01:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,218 | py | embedder.py | from typing import Optional, Tuple
from overrides import overrides
import torch
from allennlp.modules.token_embedders import PretrainedTransformerEmbedder, TokenEmbedder
from allennlp.nn import util
from allennlp.modules.scalar_mix import ScalarMix
@TokenEmbedder.register("double_mix_ptm")
class DoubleMixPTMEmbedde... |
c4ea6e4412e4dffcad4b37a839cd7510e4f5dceb | 937dfcdd39ae9ee418be85db3c226bdb0354f799 | /tbp/tbpscraper.py | ffdc1e8e522d6db63430940d8704eaa0b9ab51b6 | [] | no_license | dibyaghosh/scrapers | 918b6932f2ebf95ccf06fb20186e223935b011bf | 316a4493fe1178650c9cfd40163abe6edfe4c25c | refs/heads/master | 2021-01-10T12:03:17.898443 | 2016-04-06T01:00:58 | 2016-04-06T01:00:58 | 51,264,201 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,678 | py | tbpscraper.py | from lxml import html
import requests
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import *
base_url = "https://tbp.berkeley.edu/"
class TBPScraper:
def __init__(self):
self.engine = create_engine('sqlite:///exams.db', echo=False)
self.Session = sessionm... |
605c4ba500d90c5712aad163bb1db5cb0521c8ae | 03380b70eb5fc421718cb817491c2870ef7f6e18 | /ssbr/__init__.py | 2469d413d9f7c669729c86b8b92ec8df247f0f35 | [] | no_license | Gabsha/ssbr | 03f602f8cdf5eea486d017c75292538eb9dfbcca | 47695f5dea0d4b6b37f877763b74e3248e63ede3 | refs/heads/master | 2021-07-03T02:44:25.690848 | 2021-01-04T15:08:12 | 2021-01-04T15:12:05 | 214,079,470 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 91 | py | __init__.py | import os
from pathlib import Path
DATAFOLDER = Path(os.path.dirname(__file__)) / '../data' |
763d13bffc3e97e088d6408045691c5ce331d0db | 4af8fc0ffa9b8d1d23fe70864e06c16b95ab15fe | /dish.py | 4eb46f9955d2debcd4d139bd23fcb0f930cd9b8c | [] | no_license | lepinglaosentou/food_crawler | ff9997b4158deca1ee40bcbce4b7edc1af3cdca4 | e6c970100821af9b71def173a28caabe86d1e038 | refs/heads/master | 2021-05-09T03:28:22.018080 | 2018-02-05T14:38:45 | 2018-02-05T14:38:45 | 119,242,169 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,808 | py | dish.py | # -*- coding:utf-8 -*-
from bs4 import BeautifulSoup as bs
import requests
import re
import pymysql
url = 'http://www.dianping.com/leping/ch10' #乐平美食初始页面
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'
}
def par... |
80a86ce03a6c0a8154879accaff9ecb7a6b2c786 | b91f68dca588f326562e47124dd42c0040ca2eeb | /Lista.1/ex003.py | e279ff620f7be1ef9f850dd900a7cd0387785a19 | [
"MIT"
] | permissive | ajose-equinix/python-para-zumbis | 32e3d9b74d6c8b0f8c07b6f5a340dc1b59705528 | 7e3255af44e14abac32d0dde025757170142044a | refs/heads/master | 2022-04-09T19:55:37.835101 | 2020-03-10T15:22:05 | 2020-03-10T15:22:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 371 | py | ex003.py | dias = int(input('Quantos dias? '))
horas = int(input('Quantas horas? '))
minutos = int(input('Quantos minutos? '))
segundos = int(input('Quantos segundos? '))
total_em_segundos = dias * 24 * 60 * 60 + horas * 60 * 60 + minutos * 60 + segundos
print(f'{dias} dias, {horas} horas, {minutos} minutos e {segundos} segundo... |
577153a02db96adc1f988560fa0abfdba0576aad | 5768a71dc91088404fcc342b1fd42af0a7c0fd57 | /certml/certify/poison/__init__.py | 3ef128201ce1c5fcd771b6cb3ba755a87ac038db | [] | no_license | adversarialml/certml | 0ccccb46592c49316f2165a532b28b4905be51a2 | 83a2888e7520de7ccfaed7b7294f53c35c50834d | refs/heads/master | 2021-01-25T14:45:18.830267 | 2018-04-04T20:33:01 | 2018-04-04T20:33:01 | 123,724,263 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 61 | py | __init__.py | from .upper_bound import UpperBound
__all__ = ['UpperBound'] |
ef286e0f03b1befda9fa5c6e76e754b4f26597ac | b4bfc9281cc4fd0742bfd8668b6217f67fc050b8 | /09.py | 70f4821fc19af30cd84e7e09bd99299e1af56a17 | [] | no_license | SlayerSvamp/AdventOfCode2019 | 47faa30b1f6db792f8284b32ee8bc7acaeddf378 | 6d4323fd55c6cf1811f20db66184978baf93c7be | refs/heads/master | 2020-09-22T08:46:30.780845 | 2019-12-19T20:18:14 | 2019-12-19T20:18:14 | 225,126,769 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 209 | py | 09.py | from aoc import split
from intcode import Intcode
intcode = split(int, ',')
part_1 = Intcode(intcode).run(1).last()
part_2 = Intcode(intcode).run(2).last()
print('part 1:', part_1)
print('part 2:', part_2)
|
d6b7557d19e3de286fd43e8e8e3f67810d63d906 | 97a85e739891cdb42600f108c99431fee8c4be0b | /SearchService/search.py | 05cf29194f7f0d2ae00f7030b8ca2c0c8572db95 | [
"MIT"
] | permissive | richardy2012/Novel-Sou-Sou | 7a0fd8935c6eece0f882d468d4afc5d62c26d36c | 41049bff17b764f4ed24463b9f8f8e21a3523958 | refs/heads/master | 2023-01-22T10:24:43.600742 | 2020-11-25T14:06:23 | 2020-11-25T14:06:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,908 | py | search.py | # -*- encoding: utf-8 -*-
"""
@File : search.py
@Time : 2020/11/22
@Author : Yuan Yifu
"""
import os
from whoosh.index import open_dir
from whoosh.qparser import QueryParser, MultifieldParser
from whoosh import sorting
LIMIT = None # 显示所有匹配的结果
class Searcher(object):
def __init__(self, path):
if... |
0ad3b8bbea04820e39bda0656b915d85404f83fa | c1821f34140c55b9932353f7eb342c2ba89380a8 | /wikiSpider/wikiSpider/spiders/noteCrawl.py | 7e91c5987bbb0b87a1bada9d12610cdcd04cb12a | [] | no_license | zmh93/reptile_py | b9a19839ed812a2b47eef7de8c818c8ce4e9809e | b5e1fb79cc51e1bdb12065d09f75ca75095f8339 | refs/heads/master | 2022-03-03T11:15:08.979137 | 2018-11-26T16:50:19 | 2018-11-26T16:50:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,114 | py | noteCrawl.py | from wikiSpider.items import YouNote
from scrapy.spiders import CrawlSpider,Rule
from scrapy.linkextractors import LinkExtractor
tiebaName = ""
aim = ""
def urlGen():
L = []
base_str = "http://tieba.baidu.com/f?kw="+tiebaName+"&ie=utf-8&pn="
for i in range(0, 2000):
L.append(base_str + (i * 50).__... |
78546edeb4ef48e82110079a58c737d7f65da875 | e503550141b0814beee1f77718831ec4289938c1 | /teacher_app/apps/classes/tests/test_filter_students_by_subject.py | 3418b4e77a3b8b66b89ffe37bf76e057d3a4421d | [
"MIT"
] | permissive | Darius-Ndubi/Teacher_APP_API | 9e7440af289d331be783a37b470ad328bcd10161 | 1bafbccbbb3f8a9cc4b396bdd91e0d8c8e9a17dc | refs/heads/master | 2022-12-13T02:56:10.748994 | 2020-02-03T11:10:33 | 2020-02-03T11:10:33 | 212,774,318 | 0 | 0 | MIT | 2022-05-25T02:39:01 | 2019-10-04T08:56:24 | Python | UTF-8 | Python | false | false | 1,797 | py | test_filter_students_by_subject.py | import json
from rest_framework import status
from django.test import TestCase,Client
from rest_framework.test import APIClient
from teacher_app.apps.classes.tests.test_add_student_class import TestAddstudentClass
from teacher_app.apps.classes.tests.test_view_subjects_student import TestViewStudentSubjects
login_res... |
9a4f6adf062787a748e6ff43bb9a4c7494f1e825 | 1958f7c997fc7678a56330a009bd5498ab795c7d | /multish.py | 41b1ac0dcd609e1d4f46485fc8e2585ec059a0ce | [] | no_license | MrJJJ/jpy | 34a89ab2ac03c1c56806e5d21a23d56cc1c2ef5b | c3c3ef5c5f274e350db91b10d479a576caf99d62 | refs/heads/master | 2021-01-10T15:48:29.105394 | 2015-10-16T16:00:47 | 2015-10-16T16:00:47 | 8,579,201 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,751 | py | multish.py | #!/usr/bin/env python
# encoding: utf-8
import sys
import glob
import os
if len(sys.argv)==1:
print '***************************'
print '*** Welcome in multish ****'
print '***************************'
print "Parameters MUST be between SIMPLE quote"
print "-c or --command : The command you want to execute with $... |
189523db20c8fb21fa8d9e96b4ee8fbb16649e75 | b1a17ddddb1b30130bb6ee9e5614b858e8211b8a | /kffz/homepage/migrations/0009_auto_20180318_1438.py | 2b6de1bec7e77096279fb878634a507f4633c7b7 | [] | no_license | kffz/python-web | 238f71e189ab222829f3dd3bf25af1ab239a88d0 | 1727b79f1cfcf9633048c92223e189b91f9d862c | refs/heads/master | 2020-03-23T15:58:39.231174 | 2018-07-22T02:01:23 | 2018-07-22T02:01:23 | 141,787,357 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 925 | py | 0009_auto_20180318_1438.py | # Generated by Django 2.0.2 on 2018-03-18 06:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0008_auto_20180318_1424'),
]
operations = [
migrations.AlterField(
model_name='blog... |
37ba1a292771b6ec38fe333f4b8cbf39f024366f | 23c1f0fa3a7d7724369f2eba894fbe6ff2e07c81 | /regexp/re_exm.py | 5b4fedd7fec368f808194b20ba83998dda3205a5 | [] | no_license | jsonhc/project_for_linux | f769a3dd73ac520a6a0fe9602caef6b7ccb8d771 | 4bd9deba04b80e595369e954135e7b88adfab435 | refs/heads/master | 2021-05-07T20:04:42.830863 | 2018-12-19T11:19:45 | 2018-12-19T11:19:45 | 108,939,901 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 176 | py | re_exm.py | #!/usr/bin/python3
import re
content="hello world,my name is wadeson"
print(content)
result=re.match(r'hello',content)
print(result)
print(result.group())
print(result.span())
|
b1ff8a427e2f38b763855a2fdc2ea307a06dae03 | 8f9dd83ec6f65c5c56ab337bcbde81889358b57a | /sg-blog-static/new_article.py | ddee058d83afee4e83d94b5b8cd837eaf1fcfb89 | [] | no_license | propeersinfo/investigations | f74badfa227d8ba953eb289cfa98da76b624f77e | d7a7b6054520df69e6fffcfec9009e5a8b8aa254 | refs/heads/master | 2016-09-05T22:33:04.601413 | 2015-01-08T00:24:45 | 2015-01-08T00:24:45 | 37,665,143 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,312 | py | new_article.py | # coding=utf-8
# utility script adding new article to the static blog
import codecs
import os
import datetime
import subprocess
# this must go first - this var is to be checked in defs.py
os.environ.setdefault('SERVER_PROFILE', 'DEVELOPMENT')
import defs
import utils
import sys
sys.stdout.write('Ty... |
0293553e6b660db1ee4ecc165ab90cff1ec2d6cf | 1f920606452645d8ae03af3238b445d846d4c8f0 | /march/prof.py | dbdc04b2c0c7829fda9b2b23bc22856ce575b33d | [] | no_license | NeoWhiteHatA/all_my_python | 07e35f77f7447473e408934f3cb168029af24152 | 68126ac2f8cc622d14227273cf7d5e2fcac6d2bc | refs/heads/main | 2023-04-01T13:20:57.113716 | 2021-04-03T11:02:46 | 2021-04-03T11:02:46 | 354,266,298 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 931 | py | prof.py | p = int(input('Введите основную сумму на вашем счету: '))
R = int(input('''Введите вашу годовую процентную ставку
в виде числа без знака процентов.
В случае, если проценты начисляются каждый месяц: '''))
r = R / 100 #перевод в проценты
n = int(input('''
как часто вам начисляю... |
6762730d021d4abf5948fc96b13ced8008e45b37 | bb4e01c67327ddfc75d6cf57c667895edded0b1e | /Admin_Commands/UserInfo.py | fe9d3d8729a9264c7458d0abda0078364324b0ac | [] | no_license | NullPointer-Nico-zz/Xan | 52159802c059bb6b8f33c5de9e0f5f2bbcbaee89 | 8b26dd8b72533a8ee42e81b75a61bd1989bf856c | refs/heads/master | 2022-12-20T10:59:05.808736 | 2020-09-25T16:42:52 | 2020-09-25T16:42:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,860 | py | UserInfo.py | import discord
from discord.ext import commands
class UserInfo(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
async def userinfo(self, ctx, member: discord.Member = None):
if ctx.message.author.guild_permissions.administrator:
if... |
998543c0dea36a6be98b949489308460e5d4973c | 492a8c1ad8211c2986de00ba95faf920ec97c1fd | /tests/test_shortener.py | 5466c755da1005e035f4e5ce81ba8caf2975311f | [] | no_license | mpirnat/chiisai | 832c62681ea55ccce6ac823b6dd64f1c4742b3dc | c228bb4ecd1a01a1f071a8028306be582edbf355 | refs/heads/master | 2016-09-05T16:30:50.522460 | 2012-11-06T02:21:29 | 2012-11-06T02:21:29 | 6,098,841 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,177 | py | test_shortener.py | """Tests for the shortener component"""
from nose.tools import assert_equals
from chiisai import shortener
class TestWhenMakingHash(object):
def test_it_makes_a_hash(self):
value = 'http://example.com'
expected_hash = 'qbnwQzbOAYGgjndOARE7MQ'
hashed = shortener.make_hash(value)
... |
8c0e65a76efa4ea0d7fafa7f2f530e8c72c788cc | 2d87841b0d1cd559ba7395e5d71997d9d40d5ffb | /Project3/SuffixTree.py | c1095038ef760ee996e6f81465e1b238ee6e6b4c | [] | no_license | izabelcavassim/Genome_scale_algorithms | 9c6a0d99324640203cd6fd46555f58eaf509d0e1 | a8c06965a04dc935b80c36d97e7d303698536dc8 | refs/heads/master | 2021-05-02T12:48:24.597082 | 2018-05-10T15:55:06 | 2018-05-10T15:55:06 | 120,747,735 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 18,566 | py | SuffixTree.py |
import Const
## ete3 for Tree support
class SuffixTree_Naive:
# -- A compacted Trie
'''
Construct tree Ii.
For i from 1 to m — 1 do
begin [phase i + 1}
For j from 1 to i + 1
begin {extension j}
Find the end of the path from the root labeled S[j..i] in the
... |
7b09b6231855e34ff1c0ef936931f9d28033cd24 | 8ef8e6818c977c26d937d09b46be0d748022ea09 | /cv/pose/alphapose/pytorch/detector/tracker_cfg.py | b33c316dfecae0386b7b8afa8262dc4930502c75 | [
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Deep-Spark/DeepSparkHub | eb5996607e63ccd2c706789f64b3cc0070e7f8ef | 9d643e88946fc4a24f2d4d073c08b05ea693f4c5 | refs/heads/master | 2023-09-01T11:26:49.648759 | 2023-08-25T01:50:18 | 2023-08-25T01:50:18 | 534,133,249 | 7 | 6 | Apache-2.0 | 2023-03-28T02:54:59 | 2022-09-08T09:07:01 | Python | UTF-8 | Python | false | false | 280 | py | tracker_cfg.py | from easydict import EasyDict as edict
cfg = edict()
cfg.CONFIG = 'detector/tracker/cfg/yolov3.cfg'
cfg.WEIGHTS = 'detector/tracker/data/jde.1088x608.uncertainty.pt'
cfg.IMG_SIZE = (1088, 608)
cfg.NMS_THRES = 0.6
cfg.CONFIDENCE = 0.4
cfg.BUFFER_SIZE = 30 # frame buffer |
60f971642fead7b62377591a585367db5b042220 | 891854335ef9f023d5dd1135682e9b93b0b73223 | /data.py | 67d1c632c8707123e1fdbef594061ddb6793b2b9 | [] | no_license | zixiliuUSC/Polyvore_outfit_classification | ff3620db49b9e46accbe0b096d355f2c2e52e1f8 | bdf6da4a33948a46d2876a66cd2352f2ceb8f64c | refs/heads/master | 2022-04-09T04:23:49.578717 | 2020-03-28T12:47:53 | 2020-03-28T12:47:53 | 250,797,032 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,133 | py | data.py | import torch
import torch as th
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
from torch.utils.data import Dataset, DataLoader
import random
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from itertools import combinations
i... |
abaf137a97b231718b3085f0243474c02561c1ba | 2b60d6dfe98b6f85e073a70c614d73da0cda83d4 | /orders/migrations/0007_auto_20200910_1903.py | 062269bbcafe38380c5d059e6fa6148add152cd1 | [] | no_license | csailer/foresideapi | 4821ba76d824f13543de6262ba3d37daffe5e1ad | 24f01c104f034c2d9dc93f06f86180a02333b027 | refs/heads/master | 2022-12-13T20:47:21.612379 | 2020-09-11T12:50:50 | 2020-09-11T12:50:50 | 294,399,872 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 529 | py | 0007_auto_20200910_1903.py | # Generated by Django 3.1.1 on 2020-09-10 19:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0006_auto_20200910_1806'),
]
operations = [
migrations.AlterField(
model_name='orderstatus',
name='status'... |
fd21721bb65c1428ae8e951519dfb4602150f7b9 | 47aebe6d838f345aa8c7ca297f6e84c79cb0144b | /tests/functional/stats.py | 31e334b48fc3c174327b0a04891bf40ace7e65f5 | [
"BSD-3-Clause",
"Python-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | MicrohexHQ/twemcache | 1e6197f1c764387adc39766d1eeac009f9263e9a | a7f5987aabfb5ee8b86ae6dc6204aeab8a120653 | refs/heads/master | 2020-06-21T10:10:31.008217 | 2019-07-17T15:40:26 | 2019-07-17T15:40:26 | 197,418,094 | 0 | 0 | BSD-3-Clause | 2019-07-17T15:39:57 | 2019-07-17T15:39:57 | null | UTF-8 | Python | false | false | 7,943 | py | stats.py | __doc__ = '''
Testing stats related commands.
'''
__author__ = "Yao Yue <yao@twitter.com>"
__version__ = "0.1-1.45"
import sys
import time
try:
from lib import memcache
except ImportError:
print "Check your sys.path setting to include lib/memcache.py."
sys.exit()
try:
import unittest2 as unittest
excep... |
513b641a7ca576d89094dd0e106e28e2144f8dc3 | 51be227c555ff490f800edd769361e8b46c57dca | /lectures/oop-05-when-to-use-oop/code/namespaces.py | 060df2ffa646692c6ec3c2eb56de40ba250769e5 | [] | no_license | uit-inf-1400-2021/uit-inf-1400-2021.github.io | 447d57e2fc94d608fb4b87dd1ef2136f3f9baa01 | dbffb85b4ed8ab2e886b1e934f73bf197e0df0a3 | refs/heads/main | 2023-04-22T20:52:34.164995 | 2021-05-08T11:30:11 | 2021-05-08T11:30:11 | 326,972,899 | 23 | 17 | null | null | null | null | UTF-8 | Python | false | false | 104 | py | namespaces.py | from random import *
def getstate():
return None
if __name__ == "__main__":
print(getstate())
|
03a04836b63da892de491c9d7d54bb1c6a3f7761 | 9889e7fd73314382fb2f9e8f63d92cf3254b75fb | /ThirdParty/BMPM2D_Python/src/material_stationary.py | 327c775fcbc236624896fcf23a8c7ce81002108b | [] | no_license | bbanerjee/ParSim | 0b05f43cff8e878658dc179b4a604eabd873f594 | 87f87816b146f40013a5e6648dfe20f6d2d002bb | refs/heads/master | 2023-04-27T11:30:36.252023 | 2023-04-13T22:04:50 | 2023-04-13T22:04:50 | 13,608,512 | 16 | 3 | null | null | null | null | UTF-8 | Python | false | false | 3,293 | py | material_stationary.py | #
# The MIT License
#
# Copyright (c) 2013-2014 Callaghan Innovation, New Zealand
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rig... |
ccac1603594ee6c1c9e37c07d91363bec56184a9 | ba47672f76aca2c009d4db300fc3654c537508da | /userApp/views.py | 827a97eee631cb363439b22b001fb6e398f2ff99 | [] | no_license | Umut-Deniz1/Django-Project | 15f4a8ce0cb19a0aee700c60591a2244beda8bd5 | 27bce40b591a3dff0d53dc747a4d1eaf7d615cdd | refs/heads/main | 2023-02-05T05:18:53.356941 | 2020-12-22T09:52:18 | 2020-12-22T09:52:18 | 320,963,863 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,142 | py | views.py | from django.shortcuts import render, redirect
from .forms import UserForm
from .models import Users
def create(response):
if response.method == "POST":
form = UserForm(response.POST)
if form.is_valid:
form.save()
form = UserForm()
return redirect('/home')
... |
ba4ef885078e08f8b3a14a9dd13ffeb87710cf2e | c7ced61bee59ad00c6e1c3480aa5ff528dabd6dd | /src/labos4/zad7.py | 8df9b61ea8d8c0c8e72a13ec04f4fbce59e15803 | [] | no_license | ivanamesic/ICGlabs | cbb1772abc073d9acddedaa0a6fb1020154846a1 | e4f7486ac8c4900e770b90779980be31fb344295 | refs/heads/main | 2023-02-13T17:53:23.411267 | 2021-01-13T20:44:24 | 2021-01-13T20:44:24 | 329,425,459 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,979 | py | zad7.py | from pyglet.gl import *
import sys
import numpy
import math
class Coefs:
def __init__(self,a,b,c,d):
self.a=a
self.b=b
self.c=c
self.d=d
class Point:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
class Polygon:
def __init__(self, v):
... |
4f0a4803309281bbb71562b0580efda204d12020 | da4cde8f9f9f3c946102b149c3a820409b6d3456 | /wrapper/utils/sol_to_xy.py | b8b68918078dfa607b0bf62a573d685b7d0c23c4 | [
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-protobuf",
"Apache-2.0"
] | permissive | SonyMobile/tsp-wrapper | 31d0080e708113fca2548cc9fe2820ed1b785c0b | aa08805799a7eec19532230bb308cdb16181e03a | refs/heads/trunk | 2023-05-26T08:57:59.423153 | 2019-10-11T10:40:22 | 2019-10-16T14:27:22 | 215,566,787 | 1 | 0 | MIT | 2023-05-01T21:16:05 | 2019-10-16T14:19:45 | Python | UTF-8 | Python | false | false | 3,964 | py | sol_to_xy.py | #
# Licensed under the LICENSE.
# Copyright 2017, Sony Mobile Communications Inc.
#
'''
# name: for debugging. pass in "" if not needed
# coords_path_bef_sol:
# list of ndarrays with [x, y]'s.
# [array([128600., 79250.]), array([112600., 25577.]), ...]
# It is ndarrays instead of tuples bcs the file with ... |
48a2b79d849687967795df8bd22ddb32ac8af56b | 561dddbb07dde7bdb27975f31f58edf9f78a103d | /Practicas/Practica_2/Ejercicios_P2.py | 8b9c1c6caa26ba6aea226e523cffc57af69df1c7 | [] | no_license | saazcona/Python_2020 | b7139e50036594a15651bd3c6fcdb4d369570613 | f67131080ca67514a9d02908938c4f297f1718bd | refs/heads/master | 2022-12-25T15:23:40.578446 | 2020-10-02T03:01:20 | 2020-10-02T03:01:20 | 292,959,217 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,303 | py | Ejercicios_P2.py | # ~~~~~~~~~~~~~~~~~~~~~~~~
# Práctica 2: Saul Azcona
# ~~~~~~~~~~~~~~~~~~~~~~~~
# 1 – Realizar un programa que solicite al usuario un número indeterminado de
# números (mientras se tecleen números que no sean cero). Al salir el programa
# debe dar en pantalla el total de números dados y la suma de ellos.
numero_solic... |
6fad6c2d56623f079bd13314451cc4209ba5ae0b | 80dc215725e6e070f98d451037260a2050aa4a46 | /settings/api/notes.py | 2c6a46703ab10b4db35cd6ede0c78f40abf73586 | [] | no_license | agustin2791/notes | 3596845366d35cccbeb54a79a649310080a01585 | 25cd537a12998f1f9b91d59b63aa91f0fe71c603 | refs/heads/master | 2022-12-09T16:51:59.917854 | 2019-10-17T23:57:58 | 2019-10-17T23:57:58 | 170,402,529 | 0 | 1 | null | 2022-12-09T12:43:02 | 2019-02-12T22:41:20 | Vue | UTF-8 | Python | false | false | 1,621 | py | notes.py | from flask import Flask, jsonify, request, url_for, session, redirect
from flask_restful import Resource, Api
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
app = Flask(__name__)
app.config['MONGO_URI'] = 'mongodb://mongod:27017/notesdb'
api = Api(app)
db = PyMongo(app)
connect = db.db.notes
cla... |
d46944eb0c8c80366a60dc08cc7de1e39aadc1e4 | 85eee99d079b4db860104b7472941d24977df480 | /ptrlib/pwn/dl.py | 47832026d0a19fb0d10c578e5720776711855985 | [
"MIT"
] | permissive | alissonbezerra/ptrlib | 67bff684e7eea2ef9a70ecb7f1b9d2daa825762f | 67a557acfa5069a66dd26670f53d94e63b023642 | refs/heads/master | 2022-11-06T08:12:02.954886 | 2020-06-16T03:18:35 | 2020-06-16T03:18:35 | 270,858,458 | 0 | 0 | MIT | 2020-06-08T23:54:04 | 2020-06-08T23:54:03 | null | UTF-8 | Python | false | false | 1,477 | py | dl.py | from logging import getLogger
from ptrlib.util.packing import *
logger = getLogger(__name__)
def struct_ret2dl(addrList, elf, base=None):
"""
Args:
addrList (int): Address to put reloc, sym, symstr
elf (ELF) : Target ELF
base (int) : PIE base if PIE is enabled
"""
if not elf.p... |
d6fd1d4733c32f0bd04813ace326da1b4c0f4d9d | 0af01832058ce95587ad06465f5d2ea7a76e53aa | /models/conv_base/basic_blocks/__init__.py | 8f328d00d80dac8287ba9c7713d8496f0167dbd5 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | xroynard/ms_deepvoxscene | 6f8c32e7f72d5f5e2801555742d43b3a97623e13 | e1800a5628e6b9ab20c12d1939e04ac2fd3b4cfc | refs/heads/master | 2021-12-20T03:19:21.978775 | 2019-06-26T11:20:15 | 2019-06-26T11:20:15 | 193,741,542 | 16 | 2 | null | null | null | null | UTF-8 | Python | false | false | 158 | py | __init__.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Xavier Roynard
"""
from .voxel_blocks import Initializer, GlobalPoolingBlock, SENet, Conv3dBlock
|
3c6987fce37abf0854706ab9934f24b63e604ed8 | b01587bf304a6be061653906067d010f097e3c94 | /common_functions.py | 9586af74d8b974cbf9c2c69f7576a67aa465fbbb | [
"MIT"
] | permissive | KirillYabl/recognize_speech_bot | 7b96befcc4d797d3110320ed509d7c60ae7c991f | f4bab6f48f22e6e693daa7f2aa17ffd48e8af5e7 | refs/heads/master | 2020-12-12T14:41:04.432567 | 2020-01-21T18:53:13 | 2020-01-21T18:53:13 | 234,151,807 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,658 | py | common_functions.py | import dialogflow_v2 as dialogflow
import logging
def detect_intent_texts(project_id, session_id, texts, language_code):
"""Returns the result of detect intent with texts as inputs.
Using the same `session_id` between requests allows continuation
of the conversation.
:param project_id: str, secret p... |
7d063a2ca75bec9faf941defabaa066466bd0fe3 | 0333c707f8d50211f302e853867eac38e6e9edec | /python/csv/highs_low.py | 31cf11aa0890fd8332d88197a1c73d1cf457ce80 | [] | no_license | ws18503469313/python_learnng | d62409de117090e13ed387be0f878620c806f51f | 13c45e6396e434e04bb672e25ef447e14c883f99 | refs/heads/master | 2020-07-16T22:31:33.530986 | 2019-09-02T15:25:18 | 2019-09-02T15:25:18 | 205,882,168 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,071 | py | highs_low.py | import csv
import matplotlib.pyplot as plt
from datetime import datetime
filename = 'death_valley_2014.csv'
with open(filename, 'r') as obj:
reader = csv.reader(obj)
#print(next(reader))
head = next(reader)
dates, hights, lows = [], [], []
for line in reader:
try:
date = datet... |
d3ec6c8d92070150a7251084a509d63387603367 | 7f7be0c8e87fa1d315db331bd3d64d1f6c68a7eb | /apps/.ipynb_checkpoints/calculos-checkpoint.py | 638bb9002b0f75708beed1a5b6711af8a79330f2 | [] | no_license | rzz71/turbiedad | 364c6dd2c0d8e983b97aa41f3000da6c9b210b4e | 3ffa4dbb1c54cab896711f398595848607a01bc8 | refs/heads/master | 2023-07-18T14:09:58.275786 | 2021-09-03T17:47:56 | 2021-09-03T17:47:56 | 401,395,415 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,628 | py | calculos-checkpoint.py | # Calls the model to calculate the turbidity
import pickle
import tpot
import pandas as pd
# load the model from disk
loaded_model = pickle.load(open('model/model_4_Variables.sav', 'rb'))
def calcule_turbiedad(pH, Temp, PreVap, Prec):
"""
Calcule turbidity. Call the model (Random Forest) save whit pickle.
... |
8e1268818b6b253204a26ae4f6de6c1b874430c3 | a73a7374856e33e2e39977ab16d0ab5b64bd0fac | /src/hackerearth/VowelPhobia.py | 95eb7b71d7b8952b2912c8e66e86acb13172eaf0 | [] | no_license | gspindev/Competitive-Coding | 2f16cf114a692147fbb2a98512d6f1386b66dc40 | ea1560e357edea27633c01d692f0c05c321a8ba2 | refs/heads/master | 2023-07-02T19:59:39.782292 | 2019-10-21T13:14:22 | 2019-10-21T13:14:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 290 | py | VowelPhobia.py | def countVowels(a):
a = a.lower()
c = 0
for i in a:
if i == 'a' or i == 'e' or i == 'o' or i == 'u' or i == 'i':
c += 1
return c
def main():
t = int(input())
while t > 0:
s = input()
print(countVowels(s))
t -= 1
main()
|
55d017796cbcde3ad300d30e6ffa9a52a450f655 | c00ecba7f9dfe7cf5e850f658f7a545a3dff3899 | /hardwaypy/ex3calculator.py | 6f5a452e94f59842fe2c61b7a8b0c5c92c5c05e6 | [] | no_license | jaycody/mypy | 38eb946718364b577cb992e7439c13dcc69823bf | f8d18e0ad22232febe8fcfabddee1fa6c6be1f05 | refs/heads/master | 2021-01-16T17:08:39.224233 | 2017-11-13T10:38:23 | 2017-11-13T10:38:23 | 18,936,273 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 182 | py | ex3calculator.py | # this is a calculation of something I need to calculate
totalStudentLoans = 169000
interest = .05
totalOwed = totalStudentLoans + (totalStudentLoans * interest)
print totalOwed |
9fc9e20fede4563fa8d1c739aeb6591dbf2d9bfa | 98e639ca2af7612e17dd8b0069641e949f999871 | /readySetGoPythonLab/ready_set_go.py | 0a81394d775f3947088f5fc4d053428c36e02efb | [] | no_license | vlazaro/labaws | 9d97646c5c29bebd837dfdcde8427425e915407f | 16bdd5dfe29318589ada4b25c1f7cfd3fb07dbdb | refs/heads/main | 2023-05-03T14:26:29.192579 | 2021-05-17T08:09:40 | 2021-05-17T08:09:40 | 365,170,484 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 910 | py | ready_set_go.py | # Copyright 2017 Amazon Web Services, Inc. or its affiliates. All rights
# reserved.
import boto3
from botocore.exceptions import NoCredentialsError,ClientError
import sys
# Before running the code, check that the ~/.aws/credentials file contains your credentials.
def get_bucket_count():
print("=======... |
98f66b36f9f36e4d01251727f5798a11fb267199 | 34a05e1db4fd91ed5fda90a87688764f74b6d6b7 | /{{cookiecutter.package_name}}/{{cookiecutter.package_name}}/user/views.py | 09b13a36abe13835dfcebaecd4290e8a9855957c | [
"MIT",
"BSD-3-Clause"
] | permissive | Anioko/fbone-marrow | c9eeb3b8714939f1327165d1aca8fa6791fce8c4 | 0c69bcafbe21c48641cc9759f2a959b9b7881ce3 | refs/heads/master | 2021-06-16T04:54:06.429336 | 2017-03-01T16:03:47 | 2017-03-01T16:03:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 180 | py | views.py | from flask import Blueprint, render_template
user = Blueprint('user', __name__, url_prefix='/user')
@user.route('/')
def index():
return render_template('user/index.html')
|
51e8c7fdd218e1da7b44837611029893881726e7 | 50a94cd9ef2fc466c540668751c2fd69b298dc60 | /local functions/ColorCoordinator.py | 1f157e0001d9f1a7ea144b53ef3918fccb95f686 | [] | no_license | Kailuu/Capstone498 | aafccd3667581cbbaf1b2676b32aebb640cc3b89 | 8e191169cc054b965b2063771eab9cc43ed825b0 | refs/heads/main | 2023-04-09T04:58:41.795584 | 2021-04-27T21:32:17 | 2021-04-27T21:32:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 84 | py | ColorCoordinator.py | #this file is simply used as an enterance point to call Interface
import Interface
|
9eb247c0f27fcca3f30767bdd66d6b45c9fd4036 | 5f9b2dbec0969eb21359aaf3fdfb270fd9528448 | /python/get_middle.py | 13eeda216fb85d9743f5d12eeaa9477735bb4773 | [] | no_license | j0a0m4/kata | e725c46680fa10ed6498003711cbe18a90584639 | 5df849af5ae051bae8ea5281cb75013db7469f0c | refs/heads/main | 2023-06-04T15:27:53.893468 | 2021-06-23T23:22:46 | 2021-06-23T23:22:46 | 344,647,637 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 496 | py | get_middle.py | # kata: https://www.codewars.com/kata/56747fd5cb988479af000028
def get_middle(s: str):
mid: int = len(s) // 2
return (
s[mid - 1:mid + 1]
if is_even(len(s))
else s[mid:mid+1]
)
def is_even(num: int) -> bool:
return int(num) % 2 == 0
assert get_middle("test") == "es", "Assert... |
5ce92c0e9d9c80083feedc3842779bc95b0333e4 | 876748084687d1b8642255404ffe28f76dba058b | /tradingDev/marketImpact2.py | 4bf5bc3f53bbb2b2790a42ee595b6e49e2a4a911 | [] | no_license | kyle49/odysseia | e9d45235d2f99d07edb67e476dba9acf26bd959c | 37bd5a3a8943f8f624744c5122e4e8a8816c29e2 | refs/heads/master | 2021-07-31T13:27:14.391546 | 2021-07-25T15:15:12 | 2021-07-25T15:15:12 | 126,179,472 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,452 | py | marketImpact2.py | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 15:31:09 2018
@author: Kyle
"""
import numpy as np
from random import gauss
from itertools import product
def gridSearch(sigma=1, maxHP=100):
rPT = rSLm = np.linspace(0, 10, 21)
count = 0
out = {}
for prod_ in product([10, 5, 0, -5, -10], [5, 10, 25, ... |
24663e1d01aed59cc683cf24014ab2fcb1330ac1 | 890844d4d519f5b4cab71bdd86c04ce808b5ca2e | /09WebFramework/day04/basic04.py | 2bc00265a709828bcb44535b1333cf0cc4954225 | [
"MIT"
] | permissive | mumudexiaomuwu/Python24 | 01ccb828813cbacf8c24a98aaf05cc79692d0765 | 771a3f44c5d0e9a7be1118b84ca89cd34c3d7293 | refs/heads/master | 2022-03-21T19:23:40.159333 | 2019-12-22T13:59:16 | 2019-12-22T13:59:16 | 268,305,437 | 1 | 0 | MIT | 2020-05-31T15:13:32 | 2020-05-31T15:13:31 | null | UTF-8 | Python | false | false | 5,118 | py | basic04.py | """
ORM是django的核心思想, object-related-mapping对象-关系-映射
ORM核心就是操作数据库的时候不再直接操作sql语句,而是操作对象
定义一个类,类中有uid,username等类属型,sql语句insert修改的时候直接插入这个User对象
"""
# ORM映射实现原理,通过type修改类对象信息
# 定义这个元类metaclass
class ModelMetaclass(type):
def __new__(cls, name, bases, attrs):
# name --> User
# bases --> o... |
d3ac09929296151ae8c6d528978467b5b6fb7352 | 5e2c29fa77603304140b5b9453e30009e022bd46 | /libzilla/configmanager.py | 3a39dfd80da8d8a12896dfaea1268cf2d1b26659 | [
"MIT"
] | permissive | monsieurp/libzilla | 5979452b702180d75181e0dabcf6ee20a8db3524 | b41bc4ca44549824151693514184af04fe7f4e6a | refs/heads/master | 2020-04-03T09:56:34.211141 | 2018-06-24T15:22:53 | 2018-06-24T15:22:53 | 62,863,720 | 5 | 1 | null | 2016-07-26T08:52:20 | 2016-07-08T06:16:55 | Python | UTF-8 | Python | false | false | 4,363 | py | configmanager.py | ##############################################################################
#
# Copyright (c) 2016 Patrice Clement
#
# This file is part of libzilla
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in th... |
9e1e0954360749f120db6ed25bd86050baf3eb6c | dfccaab21cfc289091479a77be43f2261370b5d8 | /dashboard/migrations/0016_auto_20190707_0725.py | cbbdec1e66821515c25999b5d4bdb9f4dd3c0981 | [] | no_license | Brinkley97/accountaFitBuddy | e995a5354b1d4abe646657807e0b761290df813c | c54f4a4b55ecfe9015c9cbf9e61ed36c36f9ee7d | refs/heads/production | 2023-02-05T03:56:11.385421 | 2020-12-02T22:58:32 | 2020-12-02T22:58:32 | 267,914,005 | 3 | 0 | null | 2020-12-22T18:49:51 | 2020-05-29T17:14:50 | JavaScript | UTF-8 | Python | false | false | 691 | py | 0016_auto_20190707_0725.py | # Generated by Django 2.0.3 on 2019-07-07 07:25
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0015_auto_20190707_0724'),
]
operations = [
migrations.AlterField(
model_name='gen... |
018f904b5d0c628b78535d2a9f2942fbc553e838 | 2c5c03c8befe6cd3934397ab05836556bc014523 | /Client.py | 0707229bf42132509bb989d6503d924a59c73b5b | [] | no_license | erikebj/KTN_prosjekt | cadb0fc87264b61b7230c1d632a4800dbd717b97 | 6f5f652819eb7653b4ae1de5efb9203887bc06e7 | refs/heads/master | 2016-08-11T07:22:45.449594 | 2016-03-10T12:16:13 | 2016-03-10T12:16:13 | 53,486,377 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,499 | py | Client.py | # -*- coding: utf-8 -*-
import socket
import json
from MessageReceiver import MessageReceiver
from MessageParser import MessageParser
class Client:
"""
This is the chat client class
"""
def __init__(self, host, server_port):
"""
This method is run when creating a new Client object
... |
a5697e78d27e6fbcd7eb1db34b7dcf3a37f87e38 | 99da8a6d2392472cb66e5b12c03142c90640186a | /BOJ/Brute-force/15686.py | 05d1f889647c7e64197294e2250e8230846fe502 | [] | no_license | chorwonkim/__Algorithms__ | cf6cf4ae5cf091d856397369b6db1bb41f925377 | 0c1e58410ae90b72c0d7e44a6179b8fedc786131 | refs/heads/master | 2022-09-28T16:59:20.841482 | 2022-09-25T09:57:58 | 2022-09-25T09:57:58 | 130,082,803 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,013 | py | 15686.py | from sys import stdin
from collections import deque
Read = stdin.readline
N, M = map(int, Read().split())
Map = [list(map(int, Read().split())) for _ in range(N)]
house = deque()
chicken = deque()
d = deque()
result = 10000000
for i in range(N):
for j in range(N):
if Map[i][j] == 1:
house.appe... |
7246bc3c8bc1dde24a2cd4d67b7eedeb254c8341 | 031ba0ea6a160b06092ccdb5a572bed1863b6beb | /Day11/bai2.py | 7e59a19b78f81bcb84f1de88ae17dc943fd2cf56 | [] | no_license | lephu0803/Big-O | 36c0c30bfda0760e2e97d9737cee31888b17816a | fa842dadda24ab7353cc84c68de44aebd77e704e | refs/heads/master | 2020-04-11T11:51:59.166901 | 2019-01-28T12:35:50 | 2019-01-28T12:35:50 | 161,761,780 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 611 | py | bai2.py | def merge(L,R):
inf=-10000001
a = []
L.append(inf)
R.append(inf)
i = j = 0
while (i<len(L)-1) or (j<len(R)-1):
if L[i] > R[j]:
a.append(L[i])
i+=1
else:
a.append(R[j])
j+=1
return a
def mergeSort(a):
if len(a)<=1:
... |
df3622da0277a1637ac5365b49e6f68547095332 | 524976e775239f27f9d2f3cd2a56a2f0d8867d1c | /systems/models.py | 0bd7633c5c7c974f997667a87c67dea8896d0457 | [] | no_license | eittech/megamercado-django | fa85bf16420b20a0ea8225a98a0cd77ecb5d722e | 306fa82d432c0a8b01d76aa1ac37c89b5dd7b17a | refs/heads/develop | 2020-06-03T02:05:28.181192 | 2019-07-24T14:59:02 | 2019-07-24T14:59:02 | 191,385,272 | 0 | 0 | null | 2019-07-24T14:59:04 | 2019-06-11T14:10:25 | CSS | UTF-8 | Python | false | false | 3,503 | py | models.py | from django.db import models
from django.contrib.auth.models import User
from products.models import *
import requests
# from django.contrib.gis.utils import GeoIP
# Create your models here.
class RegisterActivitySystem(models.Model):
TYPE_REGISTER = (
('click', 'Clicks'),
('click_publicity', 'Cli... |
a765edac24cf014bfa2a5642cd3d6595c396f510 | 8fd513ff433cb199e8f3b87c88b997e475f84dc5 | /Upmc_TP/eratosthene.py | dc21a6ce8fcb0fb0cb1b38e5ca9e916890f7273b | [] | no_license | ebarillot/Python2 | bfd65307f4f5f4bce13c7709b121d8548f6f77a8 | 7979edbca62e1e1d38b4b71c46004fc39ccf33b0 | refs/heads/master | 2021-07-04T12:39:28.659253 | 2019-05-23T16:13:56 | 2019-05-23T16:13:56 | 103,239,608 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 590 | py | eratosthene.py | # coding: Utf8
def eratosthene(n):
print "Crible d'Eratosthène : "
L=range(2,n+1)
LP=[]
while len(L):
LP.append(L[0])
L=[nombre for nombre in L if nombre % LP[-1] !=0]
print 'Nombres premiers plus petits que ', n
print LP
n=input('Entrez un entier ')
eratosthene(n)
def era... |
de4b06f5359007b4fe6c8399241f686149393fe0 | 36efd518cdbe9478c468b3f116f40a164990e265 | /mywebsite/feed/urls.py | c73d5116acd2f020ff743aaef5cfa5f49af88a37 | [
"MIT"
] | permissive | Zadigo/mytumblr | 709ffddc4d65440ac450bab96272446a0a90d4d3 | e5fe49547eaaf177521f8768bf2482bb5c67e829 | refs/heads/master | 2023-06-20T06:00:59.092214 | 2021-07-06T17:20:39 | 2021-07-06T17:20:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,090 | py | urls.py | from django.conf.urls import url
from feed import views
app_name = 'feed'
urlpatterns = [
url(r'^test-feed-more$', views.test_timeline_more, name='test_timeline_more'),
url(r'^test-feed$', views.test_timeline, name='test_timeline'),
url(r'^single-card-comments', views.single_card_comments, name='single_... |
e779daa1085280cc610a5eab49b03f52d44d0ee7 | e79d1cfe8fe957deeb4e7ab4cbf91d8e8b526538 | /Traffic_Sign_Classifier-95TestAcc-Submission.py | a496d504e4e7e5d2fa8f70ac79f53a39719ff25b | [] | no_license | mmsarode/Udacity-P2 | 582e4bc622c2b444d327922229678468ec2ac464 | 6ca9591f7e4163bd73f47fb7b6ef54fe52e72ff2 | refs/heads/master | 2021-01-09T05:36:01.666010 | 2017-02-18T19:53:58 | 2017-02-18T19:53:58 | 80,798,658 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 28,047 | py | Traffic_Sign_Classifier-95TestAcc-Submission.py |
# coding: utf-8
# # Self-Driving Car Engineer Nanodegree
#
# ## Deep Learning
#
# ## Project: Build a Traffic Sign Recognition Classifier
#
# In this notebook, a template is provided for you to implement your functionality in stages, which is required to successfully complete this project. If additional code is re... |
58c4b3cb3172bb7ce9d05ff4de10fd8e40d0dbae | 7b54fe5ae6248fbcae8aeeffecbb648f8e3153f9 | /Crawler.py | 6b65d3efaf4b533cb1391a2621a9df514b6c971c | [] | no_license | zhangxin0/Doctors_relationship | da1d692da999f493f49a537227f887d69c7984d8 | 2940211c065c7e82e7ecafd251ed43a95ee482db | refs/heads/master | 2020-09-14T21:52:20.187079 | 2019-11-20T06:06:00 | 2019-11-20T06:06:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,122 | py | Crawler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/11/10 14:07
# @Author : Patrick
# @File : Crawler.py
# @Software: PyCharm
import requests
import cfscrape
from bs4 import BeautifulSoup as bs
import time
from pprint import pprint as pprint
import redis
import mysql.connector
import random
SLEEP_TIME = ... |
3808db4166666ae7f2d9c0d8d3b2434ae19db8f8 | 11060ca244940baef96a51d794d73aab44fc31c6 | /src/pysmve/protocols/constructs/tests/test_sampled_data.py | e26bdbb4f9976babbd12adef0cd608d17009f38d | [] | no_license | D3f0/txscada | eb54072b7311068a181c05a03076a0b835bb0fe1 | f8e1fd067a1d001006163e8c3316029f37af139c | refs/heads/master | 2020-12-24T06:27:17.042056 | 2016-07-27T17:17:56 | 2016-07-27T17:17:56 | 3,565,335 | 9 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,066 | py | test_sampled_data.py | from unittest import TestCase
from ..structs import MaraFrame, any2buffer
class SampledDataTestCase(TestCase):
FRAMES = [
"""
FE 44 40 01 4A 10 19 00 00 90 1D 01 00 00 00 00 00 80 80 00 00 80 80 00 00 80 80 00
00 80 80 0F 00 00 43 00 00 00 00 04 00 04 00 04 00 04 13 48 05 51 00 51 ... |
a82d4c8b9823c066ae8e292a39614406055338e7 | fa8db0699e9a55b5f9f19c8b9857cfc6835e507d | /day05.py | d652f22044bcc2ec42d64aece1f2c87194916530 | [
"Apache-2.0"
] | permissive | xmmmt/Test | 5b938452c704ffbc4db0128f8344dc59a7c86f55 | 39227a2ed22987ee34ac18fac89acf97b6c7df8b | refs/heads/master | 2020-03-29T18:05:46.707143 | 2018-10-09T07:29:34 | 2018-10-09T07:29:34 | 150,194,309 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,400 | py | day05.py | #_*_coding:utf8-
'''
#1:类
class Joker(object):
print'[+] Joker is a good man'
class Joker2:
a = 1000
print a
if __name__ == '__main__':
pass
#2:初始化的类
class joker:
def __init__(self):
# print'hiahiahia~'
self.shuai = 'lalalal'
self.chou = 'hiahiahiah'
def fuc(self):
print self.shua... |
1bd68f8e49240afb75584228006a5dea97716494 | 5479fe03c0f3a5d5140338526b341ce259e9b3ad | /python/kakao대비/디스크_컨트롤러.py | a9a49fc20b3dcbaf245d45f12fdcc19b3a04a9c9 | [] | no_license | mnoko33/algo | fca9364128cb449af2a65bd1bfebf24ad716c579 | 382d4cfeb2535f3183e3163ece6debd7badb153c | refs/heads/master | 2020-12-20T03:32:32.653314 | 2020-10-09T08:43:24 | 2020-10-09T08:43:24 | 235,947,731 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 853 | py | 디스크_컨트롤러.py | import heapq
from collections import deque
def solution(jobs):
jobs.sort(key=lambda x: x[0])
jobs = deque(jobs)
waiting_queue = []
result = []
now = 0
while jobs or waiting_queue:
while jobs and jobs[0][0] <= now:
job = jobs.popleft()
heapq.heappush(waiting_queue... |
b8c591d66ffd426ba2b3d9fdd6c43c1922f6d507 | fdf0876095753835ee885475d7ad313fc38921c8 | /glacier_backup/glacierbackup.py | e68aa83243706c94c17b9b11b1432489641ee79e | [
"MIT"
] | permissive | omarx3/glacier-backup | 528891eb0fcb9650a01f731816644406e0410472 | 5dbe844a172b0065b7402a80d35298151017966b | refs/heads/master | 2021-06-07T09:46:56.294141 | 2016-11-09T17:16:58 | 2016-11-09T17:16:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,271 | py | glacierbackup.py | from shutil import copyfile
from os.path import normpath, isdir, basename
from os import remove
from subprocess import call
import lzma
class GlacierBackup:
def __init__(self, parser, rotator, cloud_driver):
self.args = parser.get_args()
self.rotator = rotator
self.cloud_driver = cloud_dr... |
eda537a6a957455110d5ca98cf27e3d974919616 | 94f29ab72bc543378a87a81e4a7e1e84fbe72108 | /Coaxial/te.py | ff8937e770b474a113064a075bfa9a23f0bc0533 | [] | no_license | tnakaicode/OCCGO | 8bc8169442dbae59d308d533876459ae85eec29a | 03eca6919609a2087f6094cc1775d7eb46bb30f8 | refs/heads/master | 2022-04-29T17:18:11.976951 | 2022-04-20T10:14:15 | 2022-04-20T10:14:15 | 148,886,174 | 0 | 1 | null | 2018-12-02T13:32:04 | 2018-09-15T08:58:47 | Python | UTF-8 | Python | false | false | 1,890 | py | te.py | import numpy as np
import matplotlib.pyplot as plt
import scipy.special
import json
import glob
import sys
import time
import os
import scipy.constants as cnt
from unwrap.unwrap import unwrap
from mpl_toolkits.axes_grid1 import make_axes_locatable
import argparse
from linecache import getline, clearcache
from scipy.int... |
deb47796a4d4067b12f62ac730c31f72a422f142 | 644c900d368634cd540f9e5c9c0f455685c3c760 | /bgp-python/src/ES_put_buffer.py | ade0840cc42729b0fe6e87f6e691cff10e3df2d1 | [] | no_license | asemwal/thesis-project | 31bc16a35b93c88f061c3921af702a11ed224250 | eeb496f400453ed630b45c32e9e8851fa8ecf793 | refs/heads/master | 2020-04-13T16:23:38.184240 | 2019-02-25T14:24:42 | 2019-02-25T14:24:42 | 163,319,867 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,181 | py | ES_put_buffer.py | import json, requests
from printer import Printer
from file_tool import File_Tool
from ES_local_interface import ES_Local_Interface
class ES_Put_Buffer():
buffer_send_size = None
type = None
__DEFAULT_TYPE = "default_type"
auto_bulk_list = None
print_debug = False
FT = None
ESLI = None
headers_url = {'content... |
f10c4d356b173a7295ffaa8a3113a69149598e38 | 9d9c0b63ff938120fdd6dc77eb620c08b3b0ca6f | /news.py | 01a888fc446386fcfe9497d155d52ef0e8e75387 | [] | no_license | SYK-08/Latest-news | 65da43ec1d9643f1a078fd0f0ede1c5e4e35c325 | 080845c31b8d409d5ebc36125dc1366c1c029b72 | refs/heads/main | 2023-06-26T05:26:13.215840 | 2021-07-28T13:25:44 | 2021-07-28T13:25:44 | 390,358,745 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 839 | py | news.py | import config
import requests
import pyttsx3
def headlines():
endpoint = "https://newsapi.org/v2/top-headlines"
query_params = {
"source": "bbc-news",
"language": "en",
"apiKey": config.api_key,
"page_size": 10,
"sortBy": "top"
}
res = requests.get(endpoint... |
feb70b1ee7e4176846d35875f15ae6eddf3986c4 | db876cf6de2bb293b92bc62f480b0900dffcddcf | /fetch_py_problems_output/ex154.py | c218f865967fcb894951722a4079e9672dec6140 | [] | no_license | stubs/fetch_py_interview_questions | eec76cda8190c7fba9ab0c2b2a92cb3a85d45419 | 9b6c07020c5a92040dd1d7c3b5f73b2fd747d2f0 | refs/heads/master | 2021-01-15T17:10:10.920517 | 2017-09-17T02:54:04 | 2017-09-17T02:54:04 | 99,737,897 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,528 | py | ex154.py |
archive_analytics.values.service='wb';archive_analytics.values.server_name='wwwb-app46.us.archive.org';archive_analytics.values.server_ms=495;
__wbhack.init('https://web.archive.org/web');
Recycling
Recycling
Kerbside recycling has come to New Zealand, and every city from
Auckland t... |
9f6e1e2aa523258486fab35a10fddaaa913566ed | 6af433278098404d0d0fd2942db1d549ae85972e | /testchild.py | 251b6a808ce41c09d8d8eb2d549e318644b5d2fe | [] | no_license | Xavieroc93/DATASCIENCE | af34c3e05ccd240912ba00b83aa71cee0c6c1763 | 48b3e22550d16c0df6e0c27d1aa7aef223219268 | refs/heads/Master | 2023-09-05T16:04:39.271146 | 2021-11-20T20:25:44 | 2021-11-20T20:25:44 | 430,198,066 | 0 | 0 | null | 2021-11-20T20:25:45 | 2021-11-20T20:01:48 | Python | UTF-8 | Python | false | false | 71 | py | testchild.py | ##adicionar un nuevo archivo child branch
print("Inside Child branch")
|
b765c58c4e28d0fc96deb18d6a60ef7769af96bb | 15b24d61d37c0d46172eafe50b58a3a9efbccc3b | /TestingBits/bits.py | 62bfa480cc1817697e18aa506bee6fb15a9e4083 | [] | no_license | KonyPL/ServerCalc | fd753f8e27a3ffd47dbdf6b551c23f9eff1729c9 | fc622948bf2350fd774b0fb1e24ca93517eb14c5 | refs/heads/master | 2020-08-28T04:16:03.076303 | 2019-10-25T22:35:16 | 2019-10-25T22:35:16 | 217,586,069 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,550 | py | bits.py | # after connection sever will send sessionId to use
sessionId = bin(0)[2:].zfill(8)
flags = bin(2)[2:].zfill(3)
# flags:
# 0-- last message, calculate
# 1-- next messages coming, wait
# -0- sessionId obtained
# -1- sessionId pending
# --0 for future use
# --1 ^
status = bin(0)[2:].zfill(2)
# 00 - all good
... |
298ab76c06a825a029a751bdfe37b60c7a3f7621 | b0a0c149fbf108136c97608332781fe5583aa803 | /DMC/DMC_Procedural1MultiD.py | 94c49bf17684c6127b34f3855a83bb2dc2105935 | [] | no_license | lmad13/dmcPy3 | 1045c85012e505b040aed9f94d98deb515fda7bd | 8ccf9c8edb91ac84b14ac821a20decd821c882ff | refs/heads/master | 2021-06-11T12:40:33.487748 | 2021-05-17T06:06:59 | 2021-05-17T06:06:59 | 188,305,647 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,035 | py | DMC_Procedural1MultiD.py | import numpy as np
import matplotlib.pyplot as plt
#DMC procedural programing style
#Define simulation parameters:
#Parameters below are simulation specific
#The length of time each timeStep is meant to simulate:
timeStep=1.0
#The number of walkers in the simulation
nWalkers=1000
#The number of timesteps in the simu... |
be100ccfa809626e64a8c3e81d55ba54db8e164e | 60b26ce0e0bf31cfa4e03dfd5a654e9f532374c3 | /BACK_END/API_REST_MADERA/apps.py | daf74453665d58e7d8f9268fe7776c9173303776 | [] | no_license | EmoFile/Madera | c3f8c278d16fff8dc5349a8b19f5ef5efe9dfc05 | 38b7a3d9473e6f5d9354e5568a29d5d662883605 | refs/heads/main | 2023-03-01T06:14:17.365805 | 2021-02-10T02:15:58 | 2021-02-10T02:15:58 | 329,629,957 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 103 | py | apps.py | from django.apps import AppConfig
class ApiRestMaderaConfig(AppConfig):
name = 'API_REST_MADERA'
|
e9434829526b8d7cca6e5968c0ab1f5c5534921f | dd784eedbc97c1e3bfc1a71c23fd32de680414fa | /distances/Distance.py | 5e9f2f5bbe11a4b1f7a7a70362aa1b8277f2e30c | [] | no_license | vittorio96/HKNN | bd10f8700e614b4242c2179fbdcc98db736ce066 | 483bee89d30c5f72a63420c661b8eb979933bee1 | refs/heads/master | 2022-03-23T17:11:38.489130 | 2019-11-18T07:24:28 | 2019-11-18T07:24:28 | 212,528,108 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 293 | py | Distance.py | from abc import ABC, abstractmethod
"""
@author: Vittorio Maria Enrico Denti, Cornelis Tim Brinkman
"""
class Distance(ABC):
@abstractmethod
def compute_distances_from_points(self, point1, points_list):
pass
@abstractmethod
def get_distance_name(self):
pass |
b3ad34875f3a4f42688ac41ea4779f69cb15f6bd | 79db60e7018eec6f6c9c3ad47d552ca5c2fee7a6 | /FishC签到.py | c2d393a94058d1bf9031ad9563348df18532e763 | [
"Apache-2.0"
] | permissive | lc6464/python-files | d53ac348c24527fd70de40e832170143c445eebe | dd1a6cfd593200f31197bdd9247761f685f85451 | refs/heads/main | 2023-08-05T19:58:06.266220 | 2021-09-30T14:56:17 | 2021-09-30T14:56:17 | 310,996,241 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,232 | py | FishC签到.py | from urllib.request import Request,urlopen
def findUrl(Cookies):
"参数Cookies,值:鱼C账号的Cookies。\n以Windows 10 64位的UA,合适的Referer以及你的账号的Cookies为请求头,\n向鱼C签到页面发起请求获取签到链接。"
url='https://fishc.com.cn/plugin.php?id=k_misign:sign'
cookies=Cookies if Cookies != '' else None
if cookies==None:
print('未输入Cookies... |
374487512dc3f868e88f8231faae064e5bebe58e | e9cba805a93320e4e453e19d735563937102ca5b | /packet_sender.py | fc67fa523eabf9df80e22ef1de942cbadd6efab7 | [] | no_license | ipsheeta/gopro-sd-scripts | 5574c4e7a3675428e7a68065a083b4a4b220ee3b | 52de9e25840a808d4b4d17b9ef25d10c730a263d | refs/heads/master | 2021-01-15T19:28:06.207605 | 2014-04-01T06:25:34 | 2014-04-01T06:25:34 | 17,462,365 | 1 | 0 | null | 2014-06-17T09:32:13 | 2014-03-06T01:43:48 | Python | UTF-8 | Python | false | false | 741 | py | packet_sender.py | from scapy.all import *
# we've set a range for the 27 camera IPs using dnsmasq.conf dhcp-range
IP_dest = "10.0.0.3/20"
cam_port = 8484
remote:10.71.79.1
gopro:10.71.79.2
command_turn_on = srloop(IP(dst=IP_dest)/UDP(dport=cam_port)
command_record =
command_stop =
gp_packets = rdpcap("/home/ipsheeta/Downloads/g... |
dc21dc547009c5c6aa7236d8af40d90fca45f668 | be0ff4485875ea205982fba033c22fac1c3c52c5 | /SimilarProblem/013_01.py | c60347171aaca05ca2ae45142d9fd7f1f77943f5 | [] | no_license | Nishin-0141/kyopro_educational_90_python | d68f3f330b075233fd1b4847b0d7c7ea4e7f3fb8 | 1259be8d4214209b7c7d3783f33aa6de4ea04a01 | refs/heads/main | 2023-07-09T21:52:42.751251 | 2021-08-18T12:33:56 | 2021-08-18T12:33:56 | 397,585,300 | 0 | 0 | null | 2021-08-18T12:28:18 | 2021-08-18T12:02:52 | null | UTF-8 | Python | false | false | 270 | py | 013_01.py | n, x, y = map(int,input().split())
x, y = x - 1, y - 1
num = [0] * (n - 1)
for i in range(n - 1):
for j in range(i + 1, n):
num[min(j - i, abs(x - i) + 1 + abs(j - y), abs(y - i) + 1 + abs(j - x))] += 1
for i in range(n - 2):
print(num[i + 1])
print(0) |
8b3b575b438e5904ed89cbab50edfb8062510d55 | 1557d3e46420bf0b743004124267a96acd1a869b | /dealer/game.py | aa9b015f8a6af704253c61bfc0bacfd22b14f0ff | [
"MIT"
] | permissive | samtherussell/poker | 9cde4401297fde4fa27a231619fd785b2a80e588 | 35d371f8866dbf6e793530e62bb608a2a0f8eeee | refs/heads/master | 2020-12-13T08:51:40.059419 | 2020-02-07T16:35:00 | 2020-02-07T16:35:00 | 234,367,084 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,619 | py | game.py | import random
from typing import List
from .hand import Hand
from .player import Player
from .cards import deck
class Game:
def __init__(self, players: List[Player], verbose=True):
self.players_still_in = list(players)
self.deck = list(deck)
random.shuffle(self.deck)
... |