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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d9f596a04d58351ab474a1e3a58f2fc454e61381 | 0dddc0508138396c740901be4a0f9eebefb8fded | /ax/global_stopping/strategies/improvement.py | 733f626cf7ad38bdf44acdb6ef716ae13d63a71c | [
"MIT"
] | permissive | facebook/Ax | 473beb143016f95f4ec381ed1bd95b32c1ca31f8 | 6443cee30cbf8cec290200a7420a3db08e4b5445 | refs/heads/main | 2023-09-01T09:29:13.684709 | 2023-08-31T21:49:30 | 2023-08-31T21:49:30 | 169,880,381 | 2,207 | 315 | MIT | 2023-09-14T21:26:51 | 2019-02-09T15:23:44 | Jupyter Notebook | UTF-8 | Python | false | false | 13,811 | py | improvement.py | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from logging import Logger
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from ax.core.base_... |
e7d92814fc0d077f70d2af0396c16e1612d8f9a6 | 30bb218864c0e02b5a65c417f019cb930acbc5b6 | /ranklist.py | 31c96f534d95d32057079a5e920cf1aaee56671d | [] | no_license | vivianjia714/Selenium | b2237b340321e8786bad1c7ff5f35176567b4c2a | 89169fbbddc2bd1dc70e8744a7c1925220513c37 | refs/heads/master | 2021-01-21T20:37:46.996794 | 2017-05-24T06:48:01 | 2017-05-24T06:48:01 | 92,257,625 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,440 | py | ranklist.py | #coding=utf-8
##验证院校库排行榜页面
from selenium import webdriver
import time
import unittest
from django.template.defaultfilters import title
class rank(unittest.TestCase):
def setUp(self):
self.driver =webdriver.Firefox()
self.verificationErrors = []
#打开院校库,根据学校名称进行查询-英国,输入学校关键字后进行查询,结果断言
def test_... |
518d27f1bab3e66dd3ab570dc6d17e188efe1a3b | 984a7b577705e4094dadfa3b4cc1f6158373faf3 | /price/xin_mysite/xin/admin.py | 2c64ab5cd7d0fad01b4a10e562df8476025f0714 | [
"Apache-2.0"
] | permissive | AugustLONG/sources-of-Xin.com | 0c561297558041909ac098cec40cbd2b86fe8a8a | 89e80d004ac212c81b1adf149bb67a9c57671383 | refs/heads/master | 2020-12-28T04:32:25.157662 | 2015-07-09T16:08:44 | 2015-07-09T16:08:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 278 | py | admin.py | from django.contrib import admin
from xin.models import XinCar
class XinAdmin(admin.ModelAdmin):
list_display = ('name', 'city', 'price', 'licensed_time', 'mile')
search_fields = ['name', 'city', 'price', 'licensed_time', 'mile']
admin.site.register(XinCar, XinAdmin)
|
2be5b3c28f742d482c6b3246d96f0bf04824bc32 | 76e3a7f9853d731f4ef02d829bf2bae8dc056b4a | /vview/database/database.py | 176e7f54c4d4fa30af2c94040e7dfd46aee24f79 | [
"LicenseRef-scancode-public-domain",
"MIT",
"BSD-3-Clause"
] | permissive | ppixiv/ppixiv | 1521178e8b1668c67f9d2b9d76c215a6a8033d3d | d09fd1d6bb42386895270ddde48e57d974fb4f37 | refs/heads/master | 2023-07-25T09:27:26.087692 | 2023-07-23T01:44:25 | 2023-07-23T01:44:25 | 141,506,792 | 129 | 10 | null | 2023-09-11T04:52:19 | 2018-07-19T01:07:07 | JavaScript | UTF-8 | Python | false | false | 9,112 | py | database.py | import asyncio, sqlite3, threading, traceback, time, logging
from contextlib import contextmanager
from ..util import misc
log = logging.getLogger(__name__)
_transactions = {}
@contextmanager
def transaction(conn):
"""
A transaction wrapper that uses savepoints to make each transaction independantly
safe... |
f027979f5c7b33996602ac999ba0cbb83807e9aa | c243cff9218b72b4171a3fc294607fa830561d08 | /3_DFS_BFS/HS/[HS] Cousins.py | 654218db6437c656940143188dded5b337ff7091 | [] | no_license | ISANGDEV/Algorithm_Study | 31e65cc6916be92d2a56aef1ad18eacb5b04f787 | 0eec5e3b2321f521e617d7bdc99fca8a4103f0bb | refs/heads/main | 2023-07-24T08:18:20.794903 | 2021-09-01T14:05:54 | 2021-09-01T14:05:54 | 347,665,106 | 0 | 0 | null | 2021-09-01T14:03:32 | 2021-03-14T14:51:24 | Python | UTF-8 | Python | false | false | 940 | py | [HS] Cousins.py | from collections import deque
def bfs(relation,q,w,visited):
que = deque()
count = 0
que.append((q,count)) # 2개 추가 할 때 괄호..
visited[q] = 1
while que:
x,y = que.popleft()
for i in relation[x]:
if visited[i] != 1 :
if i == w :
... |
9d02849297892f81775b496f8fc3fc4eebcec707 | 156d635c31f3c8400c8c459f9ea6b1563a54fd3e | /jinstall/centos7/envs/FrontBackend.py | 74f591e76f5f9751d574c5e768e00e55ec7e3217 | [
"BSD-2-Clause"
] | permissive | a07061625/swooleyaf_install | fb8e3b9c316a31a930b4aa5002c5a135c805a4bf | d82ebf8d4b8218c371610ca030504fdda205ae2c | refs/heads/master | 2023-08-02T19:58:24.956228 | 2023-08-01T03:22:40 | 2023-08-01T03:22:40 | 146,071,970 | 5 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,945 | py | FrontBackend.py | # -*- coding:utf-8 -*-
from jinstall.centos7.tools.SyCache import *
from jinstall.centos7.tools.SyCpp import *
from jinstall.centos7.tools.SyDb import *
from jinstall.centos7.tools.SyErlang import *
from jinstall.centos7.tools.SyJava import *
from jinstall.centos7.tools.SyJs import *
from jinstall.centos7.tools.SyLinux... |
3c8fbaf535c4acbf4c7ff56361ca3a7f98ed3da5 | ee70a3d2db63ef6fbf3fae336066ea791f8d0144 | /rozdzial_05/python_lst149.py | beda925e0dc347d4664b1a769092c2ae868e28fb | [] | no_license | pawelpe90/self-taught-programmer | d447d9724220c475fa775f1719c207b9ce3be3d7 | 34c4c940be665a4193b8eee94af3352015babf14 | refs/heads/master | 2022-11-11T11:54:23.609167 | 2020-07-07T20:16:02 | 2020-07-07T20:16:02 | 277,912,017 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 283 | py | python_lst149.py |
facts = dict()
# dodanie wartości
facts["programowanie"] = "zabawa"
# pobranie wartości
facts["programowanie"]
# dodanie wartości
facts["Bill"] = "Gates"
# pobranie wartości
facts["Bill"]
# dodanie wartości
facts["Grunwald"] = 1410
# pobranie wartości
facts["Grunwald"]
|
682257108575bb640da92c92eae0a79d91c62bf3 | ae7a59e6bb2d2406741e326e2b472609c9fe23e9 | /src/nvm/refvm.py | 09e46d24ad415b0a3c6933e7f4e70e06f2caf8fc | [
"MIT"
] | permissive | khushbooG9/nvm | b8ed81d89f73808d3bb3e1197fb18e5a576a6d94 | c065af6ae1cb330cf0716d35bc4aebd46547888e | refs/heads/master | 2022-01-22T05:47:47.703850 | 2019-07-25T01:31:14 | 2019-07-25T01:31:14 | 198,353,288 | 0 | 0 | MIT | 2019-07-23T04:42:55 | 2019-07-23T04:42:55 | null | UTF-8 | Python | false | false | 7,683 | py | refvm.py | """
Symbolically implemented reference machine
"""
from nvm_assembler import preprocess
class RefVM:
def __init__(self, register_names):
self.register_names = register_names
self.programs = {}
self.labels = {}
self.active_program = None
self.layers = {reg: None
f... |
811e8d68f46b4889fad75ba159149cf55c35833d | 578db86c51d44ebddd0dc7b1738985b3dc69eb74 | /corehq/apps/data_analytics/management/commands/export_form_impact_data.py | ec5302083329d8a3bf9873f9cd8977a2d3234038 | [
"BSD-3-Clause"
] | permissive | dimagi/commcare-hq | a43c7dd32b5f89c89fd5aa1b1359ab7301f4ff6b | e7391ddae1af1dbf118211ecb52c83fc508aa656 | refs/heads/master | 2023-08-16T22:38:27.853437 | 2023-08-16T19:07:19 | 2023-08-16T19:07:19 | 247,278 | 499 | 203 | BSD-3-Clause | 2023-09-14T19:03:24 | 2009-07-09T17:00:07 | Python | UTF-8 | Python | false | false | 3,097 | py | export_form_impact_data.py | from collections import defaultdict
from django.core.management.base import BaseCommand
import csv
import dateutil
from dateutil.relativedelta import relativedelta
from dimagi.utils.chunked import chunked
from corehq.apps.data_analytics.esaccessors import get_forms_for_users
from corehq.apps.domain.models import Do... |
111bf4f47478dc18945de286d87c3da05b3386d0 | d19ffea905c31b9b9234c8ce37ada27f7efafa10 | /users/urls.py | e7860792c53442065a6ce4bd3c8846bc8a5d843b | [] | no_license | chriskollias/online-university | d8fc272af4219c4095cb9c3601d8aae18171258d | f75e5904625586839fb731303ba9211ed77a0853 | refs/heads/master | 2023-05-02T14:03:17.325868 | 2021-03-19T02:38:04 | 2021-03-19T02:38:04 | 262,615,652 | 0 | 0 | null | 2023-04-21T20:53:35 | 2020-05-09T16:46:56 | Python | UTF-8 | Python | false | false | 732 | py | urls.py | from django.contrib.auth.views import LoginView
from django.urls import path
from .views import user_register_view, user_login_redirect, user_logout_view, all_users_view, user_profile_view, user_edit_view
urlpatterns = [
path('view-profile/<int:user_id>/', user_profile_view, name='user-profile'),
path('all-use... |
9c0b6ec8f8758c7a0d5d55276ffafef72108948a | 04d7aab7f3700b0e2225fe75fd31bcf9a1f01af2 | /scraper.py | bd6dd683e2ddd06f420e50c6dd8b3676caf0dbe7 | [] | no_license | cpeter256/soundstash | fbd0022b1f82a7278462847d078cd6892df4665e | 4441d385ef410cd1af64a647712e1240f075484d | refs/heads/master | 2021-01-10T13:19:06.612208 | 2015-12-02T01:38:17 | 2015-12-02T01:38:17 | 44,200,489 | 2 | 2 | null | 2015-11-22T23:51:04 | 2015-10-13T19:45:02 | Python | UTF-8 | Python | false | false | 2,487 | py | scraper.py | import re, sys
from splinter import Browser
class YoutubeScraper:
def __init__(self):
self.__browser = None
self.__open_browser()
def __del__(self):
if self.__browser: self.__browser.quit()
def scrape(self, url):
# inner function validate
def validate(url):
yt = '^.*(youtu.be\/|v\/... |
76235f7d632442ea659aadea64608a6633b227ec | b20c72f0bc5c71cb262259874a1a0d583d413a9e | /100+ Exercises course/005.py | 8c0ece70e25f6b411b919abc795c68c35dc7a7b5 | [] | no_license | Kacyk27/python-unittest-learning | f40d5748322a3c94e44330799f997f6450bb2cbd | bdc4d8cec38b306e53bb98e853bb8373d0328828 | refs/heads/main | 2023-08-12T07:18:13.481355 | 2021-09-23T00:09:23 | 2021-09-23T00:09:23 | 402,567,684 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 98 | py | 005.py | def area(width, height):
return width * height
assert area(4,10) == 40
assert area(5,6) == 30 |
bb966305b28a15ce3ee27391c30fa67569809ee1 | 15f321878face2af9317363c5f6de1e5ddd9b749 | /solutions_python/Problem_199/2741.py | 3fc6791dd5f7c51f7933a8f6e5414ad3a3f857b7 | [] | no_license | dr-dos-ok/Code_Jam_Webscraper | c06fd59870842664cd79c41eb460a09553e1c80a | 26a35bf114a3aa30fc4c677ef069d95f41665cc0 | refs/heads/master | 2020-04-06T08:17:40.938460 | 2018-10-14T10:12:47 | 2018-10-14T10:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,227 | py | 2741.py | #Meet Shah - DAIICT
#GCJ Qualification A
t = int(input())
for xx in range(t):
foo = input().split()
arr = list(foo[0])
n = int(foo[1])
ans = 0
#print(n,arr)
if(n==1):
ans = arr.count('-')
else:
for i in range(len(arr)-n+1):
if(arr[i]=='+'):
... |
bac62e9e21fda64117dcd2e5ab5032ae7c32f6ee | 20e86897572c95580596166ea3e22b63cbcc4a7c | /Basketball.py | 96d5886d0e2d9a9680973edce7a96e6df1b94207 | [] | no_license | tejas1995/Sportify | a60c21b1c382c152ada1baed12ae517ed7541cd8 | db336915978f018668e881805c9d13e5a2bb9ece | refs/heads/master | 2020-05-29T21:50:51.578060 | 2015-03-20T14:53:43 | 2015-03-20T14:53:43 | 32,248,666 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,529 | py | Basketball.py | import sys
from bs4 import BeautifulSoup
import urllib2
from Sport import *
class Basketball(Sport):
def __init__(self, site, time):
Sport.__init__(self, site)
self.teams = []
self.notifTime = time
self.image = ""
self.title = "Basketball Update"
self.oldTime = []
... |
fdd058637e29b2e3ed265fdb3921f6b2338be404 | f686431beb350fedc9309dfb1dddab8fcde0fde6 | /scripts/scan_segments.py | cf10e1c3a1025f814ac8aa1d9ed501b26f05ba5e | [] | no_license | qingpeng/jgi-ViCA | 514f051ec14baed73ecab2582a4647d4c229da06 | 71d0b1c402b035759fbf39e7a0fa66b6cb1ca6e4 | refs/heads/master | 2021-03-27T16:43:44.517536 | 2019-10-18T22:21:35 | 2019-10-18T22:21:35 | 84,887,663 | 3 | 0 | null | 2018-04-24T18:01:26 | 2017-03-14T00:26:57 | Jupyter Notebook | UTF-8 | Python | false | false | 1,698 | py | scan_segments.py | #!/usr/bin/env python
import sys
file_segment = sys.argv[1]
file_order_obj = open(sys.argv[2], 'r')
file_family_obj = open(sys.argv[3], 'r')
file_genus_obj = open(sys.argv[4], 'r')
out_order_obj = open(sys.argv[2]+'.valid.m8', 'w')
out_family_obj = open(sys.argv[3]+'.valid.m8', 'w')
out_genus_obj = open(sys.argv[4]+... |
e7d64c41981e4fc3385f6efb878d483cd4255b6b | b552dff5eed70a523493e8b0d011756331ef8fc8 | /formation_python/list/list.py | dc4f00380dbf43886d25e91a7f25062796823d77 | [] | no_license | Adib-LGS/Python-ToolsBox-OOP | eed1d57590f453a3de119fcbbdfd1ee3f8c7c974 | 3c66bae339d5cce54be9917f5744833a3d955d07 | refs/heads/main | 2023-06-15T10:34:58.791725 | 2021-07-14T15:29:21 | 2021-07-14T15:29:21 | 381,757,894 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,136 | py | list.py | import copy
list = []
#check empty list
if len(list) == 0:
list.insert(1, 'element 1')
list.insert(2, 'alement 2')
list.append('element 3')
print(len(list), list)
if len(list) > 1:
for i in list:
print(i)
print(i.count('element'))
"""-------------------------------... |
1d6945732a1608dd7669b7a917e14cbe93524d07 | 0e013e6aeb837bb81677380f54c73cfbe47d9bbe | /penaltymodel_mip/penaltymodel/mip/interface.py | 365c78867db77cfec664cb280a781cfe18ea2e81 | [
"Apache-2.0"
] | permissive | arcondello/penaltymodel | 05193d1776be1c4b84368a0ae91863fee62f9e66 | 082615bd9843a5027c9d76aa16c8adfbe3bf2a2b | refs/heads/master | 2022-08-16T02:38:44.150046 | 2021-12-14T18:13:51 | 2021-12-14T18:13:51 | 114,310,608 | 0 | 0 | Apache-2.0 | 2018-05-09T18:44:12 | 2017-12-15T00:47:34 | Python | UTF-8 | Python | false | false | 2,385 | py | interface.py | # Copyright 2018 D-Wave Systems 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 law or agreed to in w... |
9f25b4d18144cb424f8dfdd9a4bd49fd1e1bcc38 | 29a21d7278278277e80c669ab5dfacb270d7e7e5 | /Excercises/ChainMap.py | 9c6bf3da17c2a3ee5851f1e52b94108074714ae6 | [] | no_license | rastardie/Python | f33ced687ceef4bd23e8e8504fb51376c4db0a0a | a0662ba14f1a2b4e997dae234f0af186d43dcf6d | refs/heads/master | 2023-07-21T14:29:33.142155 | 2020-07-29T14:09:47 | 2020-07-29T14:09:47 | 282,957,766 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 243 | py | ChainMap.py | # A chainmap is used to create a single view of multiple mappings
from collections import ChainMap
# create two dictionaris
a = {1: 'edureka', 2: 'python'}
b = {3: 'ML', 4: 'AI'}
# assign a and b to a ChaninMap
a1 = ChainMap(a,b)
print(a1) |
318543746369037e115e4352090942bace423f4d | aa2774b620cf4e9de4d450ed7c91b83f76b15b45 | /events.py | ef9366448789f371f23d69b03373391542b12e50 | [
"MIT"
] | permissive | iamAbhishekkumar/The-Copter-with-NEAT | f109fb37adef69a17343871570e3c323f7f31d2d | dbe606ffe36c38c3f4c2cf587e52d7cdc5121bbd | refs/heads/main | 2023-04-07T22:47:12.885550 | 2021-04-25T06:56:26 | 2021-04-25T06:56:26 | 358,669,164 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 116 | py | events.py | try:
import pygame
except ImportError:
print("Fulfil requirements")
SPAWN_EVENT = pygame.USEREVENT + 1
|
8113cb77ec2bc0b8261c281b4e88289c52284957 | 0275fd2539a29966a6ee742d791b835a917cc268 | /logic.py | a953e2fb78b933a8c9d2f052ef1bd34330a06d59 | [] | no_license | milleniax/tz_dsplabs | 109fa4720eb83b3c6d4b011aae21d38c4d6e27e4 | 5be7f3554decaec0993ea7060ff6521a1d8ee9fb | refs/heads/master | 2022-12-11T03:07:19.254649 | 2020-05-20T16:07:54 | 2020-05-20T16:07:54 | 236,144,088 | 1 | 0 | null | 2022-12-08T04:06:13 | 2020-01-25T08:25:57 | Python | UTF-8 | Python | false | false | 3,668 | py | logic.py | import sqlite3
import os
import audiosegment
import numpy as np
import cv2
from PIL import Image
from config import PATH_CV2
import datetime
def get_photo_file(bot, message):
file_info = bot.get_file(message.photo[-1].file_id)
downloaded_file = bot.download_file(file_info.file_path)
return downloaded_file,... |
76fda0c4458c5bdf46e760fc2188142ccd1eec09 | f30157c3452cfe90c63bc09aac8ddcd6d6dc7941 | /main.py | df67b78344e89ea610bdf774b43199d05a56d393 | [] | no_license | rsantana-isg/FactorizedEmbeddings | 0d598c298f0e90a7e4b1d468c2ed0b23aa178400 | 03758ce7d4f0a91763e587ce30ce6bfd0376566c | refs/heads/master | 2020-04-08T20:17:38.529464 | 2018-04-27T20:43:04 | 2018-04-27T20:43:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,460 | py | main.py | #!/usr/bin/env python
import torch
import pdb
import numpy as np
from torch.autograd import Variable
import os
import argparse
import datasets
import models
import pickle
import time
import monitoring
#
def build_parser():
parser = argparse.ArgumentParser(
description="Model for convolution-graph network (C... |
d6f1479eb8572fd66494414fa4b5f0c1291737df | e972dc486e62152981177f85b5f9cff919ac0867 | /kaka/replace_cate.py | 01f3e467f3f54fa447718c0bc1cdddd3c84f64da | [] | no_license | yeongsunpark/cute | d81b9b03f747f65bed742b10b2f9a59f69efea96 | d69f918f9a1f1d6db70bc62272fc0ce582d7bf50 | refs/heads/master | 2020-03-27T12:43:41.728918 | 2019-04-29T04:41:47 | 2019-04-29T04:41:47 | 146,564,948 | 0 | 2 | null | 2018-11-06T07:45:59 | 2018-08-29T07:52:20 | Python | UTF-8 | Python | false | false | 2,196 | py | replace_cate.py | economy = ["금융기타", "대출", "증권", "취업"]
science = ["IT기타", "게임", "과학기타", "날씨", "모바일", "비만성장", "생활가전", "성형외과", "소프트웨어", "수송기기", "영상음향가전", "의료기타", "자동차", "제약", "피부과" ,"하드웨어", "항공"]
society = ["결혼", "교육", "사회기타", "생활용품", "육아", "종교"]
sports = ["경마", "골프", "동계스포츠", "레저스포츠", "스포츠기타", "야구", "축구"]
normal = ["국방", "기호식품", "복권"... |
958d16c6ab3eab1286f0584dbf3d516650987e0a | 0f9f670028949e0d72805e817a735298cab716e1 | /hooks/post_gen_project.py | a4e651b648a86d1e33bc894a05567d188314807f | [] | no_license | hiisi13/cookiecutter-django | 94c8f9cf1450f3cada94dfe7055f0f6959ca9a34 | 7b890b33ba944a50a4fb8171a30f6a81afec912c | refs/heads/master | 2020-12-11T03:33:30.663986 | 2014-02-28T07:18:05 | 2014-02-28T07:18:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 134 | py | post_gen_project.py | import subprocess
def main():
subprocess.call(['python', 'managy.py', 'createsuperuser'])
if __name__ == '__main__':
main()
|
1ed2a11ff3588233896ddfda49222c741a00c9d1 | 1351f9bc46da4977f5154d69df346b05875f83bc | /data_structures/trees/is_bst.py | 750d8c6a0e05dea183e4672facb914c982fc9d63 | [] | no_license | cecatto/hackerrank | 594ef988047e7cc36b2acb98c47430f73fe09354 | 468e351ae89354119f6a2ea295faefae4e939013 | refs/heads/master | 2020-06-26T09:59:31.587001 | 2017-09-27T20:34:52 | 2017-09-27T20:34:52 | 97,013,985 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 600 | py | is_bst.py | import math
""" Node is defined as
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
"""
def check_binary_search_tree_(root):
if not root:
return False
stack = []
node = root
max_value = -math.inf
while True:
while node:
... |
4579eadb142ed64a8787d02a7fd226993cda5e89 | 07366ef3d19a7ec1f773e54d443a7c263ea82001 | /TempLogger_complete.py | f818555bcac04a3808a21ab85028c02f0369119f | [] | no_license | NattapornTee22816/TempLogger | c878df23e088a511dd9fd6d0ba53fd1ec3eb2298 | 9a846bf521a49492bc56438e6c9d0fdcfd707be5 | refs/heads/master | 2021-01-10T18:29:34.398720 | 2016-05-15T18:13:58 | 2016-05-15T18:13:58 | 58,300,561 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,510 | py | TempLogger_complete.py | import os, glob, time, gspread, sys, datetime
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials.from_json_keyfile_name('file name.json', scope)
gc = gspread.authorize(credentials)
worksheet = gc.open("sheet na... |
925726c56fa6dfa594abfa17bc3d80d73df9908e | e84feb798166ad65670c11d3ddff7cfae0be4258 | /src/jsonspec/reference/providers.py | 09d7e39a20bb6beada30c21ae507379608269df1 | [
"BSD-3-Clause"
] | permissive | johnnoone/json-spec | 937d253061afbc69a563ac70e9009a66e077d1ed | 81520a7819d1047f7ed84a8b5a7931b0c05e1c24 | refs/heads/master | 2023-01-10T15:22:32.300844 | 2022-11-12T21:09:02 | 2022-11-12T21:09:02 | 20,410,039 | 36 | 18 | BSD-3-Clause | 2022-12-27T21:12:46 | 2014-06-02T15:59:44 | Python | UTF-8 | Python | false | false | 5,528 | py | providers.py | """
jsonspec.reference.providers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import json
import logging
import os
from pathlib import Path
import importlib_metadata
from .bases import Provider
from .exceptions import NotFound
__all__ = ["Provider", "FilesystemProvider", "PkgProvider", "SpecProvider"]
logger = loggin... |
3112b462a1c50b7cf172436e0dad00cffdb24742 | b939956d1231fb7abd92e96b80d3f8fa53b781e5 | /bfs_maze.py | 6cf4ee43878005e616a6c63685e718a81b2319e9 | [] | no_license | Office-Stapler/bfsmazesolver | 4f3d3fab05f3d902b4725799ef60dac8e5d16061 | 8a1ec80ee94fc183d20529ca05dfbb2e34948922 | refs/heads/master | 2021-02-11T13:22:47.442853 | 2020-03-02T23:11:10 | 2020-03-02T23:11:10 | 244,494,758 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,794 | py | bfs_maze.py | import queue, random
class Maze:
def __init__(self, size):
self.size = size
start = (random.randint(0, size - 1), random.randint(0, size - 1))
end = (random.randint(0, size - 1), random.randint(0, size - 1))
imaze = []
for i in range(0, size):
nmaze =[]
... |
0e131958c5f8f7779794ec093de5eed479c54d8f | 362b057f766b721ea85b33b8586866b5f5882a3c | /GarageControllerApp/forms.py | 6027f635d27fd08d18c4dd0ac1be4d0daed407e3 | [] | no_license | paulcocker33/GarageProjectWorking | d7f4263817cf1b543689e26220c1d1e8f88cf453 | 46e1a834e3fb3442e08eeb220da825196deeae56 | refs/heads/master | 2020-03-18T18:14:12.643438 | 2018-05-31T08:47:21 | 2018-05-31T08:47:21 | 135,079,312 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 249 | py | forms.py | from django import forms
from .models import Door_Controller
class Controller_Form(forms.ModelForm):
class Meta:
model = Door_Controller
fields = ('name', 'number', 'street', 'locality', 'city', 'uniqueID', 'controller_type')
|
79e7494600738c4b3ce186c169d52ad0c07e7794 | 7a4e742348145cf851020baa88f07e8c75e5f54b | /wikiblog/migrations/0016_auto_20160327_0441.py | e180736a65b1b63458948c595847849d94aa11ea | [] | no_license | jamesaud/LittleFreeLibrary | b1022baf384e848341003a827dd31124a2f5be83 | 196c10edbb4cf33c082a81032b55d5c8abc71551 | refs/heads/master | 2020-12-21T01:18:53.703122 | 2016-08-09T19:18:14 | 2016-08-09T19:18:14 | 58,175,288 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 475 | py | 0016_auto_20160327_0441.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-27 04:41
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wikiblog', '0015_auto_20160327_0407'),
]
operations = [
migrations.RemoveField(
... |
7c9457dc794660be82a4d291a8e67b5763c40b4d | 8d1142c34f7ef5cb63c5e3115f4b58e19c036b51 | /tests/bypass_antiroot.py | a90a474d6fcd81c81b80fbee46a1c482b2bab935 | [] | no_license | kingking888/android-auto-hack | b19c979f2c39a3584ba5841c7b13b253cfc798c8 | e91cb827c7ebf53ad253f965df55bfcaa9e82c32 | refs/heads/master | 2021-01-26T11:09:51.958052 | 2020-02-27T02:59:49 | 2020-02-27T02:59:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 993 | py | bypass_antiroot.py | #!/usr/bin/python3
import pyjadx
import frida
import pygments
import os
import sys
import pathlib
sys.path.append("../bypass/");
from anti_root import *
# adb connect 127.0.0.1:62001
# adb shell "/data/local/tmp/frida-server &"
# pyjadx generate bypassing script
jadx = pyjadx.Jadx()
app_path = pathlib.Path("../sampl... |
1dabd89306a5488385372d582188172827c5c898 | ab87bb7412607dcd409fdb0cfc1057f4272dd284 | /attendanceltc/__init__.py | e616526f9054fb175c7ade7efad9254b10edc3ee | [] | no_license | fasttrack-src/attendanceltc-service | 749686fe92c79aecfd6efa14a4f37332aa89baec | 6536eaf79ad899404cc9897a95ac21147f88274d | refs/heads/master | 2022-12-22T01:56:26.340951 | 2019-06-18T18:28:33 | 2019-06-18T18:28:33 | 175,846,803 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,036 | py | __init__.py | from flask import Flask, jsonify
from flask_login import UserMixin
import attendanceltc.models
from attendanceltc.models import db
from attendanceltc.views import login, login_manager, import_db, school_admin_view, school_course_view, app_api, school_component_view
app = Flask(__name__)
app.config.from_... |
8d8090a405d6ea8c0220c61c6950404f3665d068 | f727643e126151fe84ccb84ef0aa98fdba0eaee9 | /Opgave24.py | ddb81c296165ee0aed9b6fc79009b56f3d90bc3d | [] | no_license | ZyaadW/Oefeningen-Python | 18aa7a5bb111894591109bf7d6c9715c72eb3842 | e4a0291bc006fc3d0d3ec9903c2c6e26b359a049 | refs/heads/main | 2023-08-27T05:35:48.342141 | 2021-10-29T07:20:26 | 2021-10-29T07:20:26 | 405,723,312 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 45 | py | Opgave24.py | a = random.choice({10, 20, 30, 40})
print(a) |
82d4dd4164961ea012a99938323fe6908f7ead4b | de24f83a5e3768a2638ebcf13cbe717e75740168 | /moodledata/vpl_data/439/usersdata/316/100260/submittedfiles/contido.py | 5ba9ce32fd997f444b1b57f4e37e851a2a83b3ce | [] | no_license | rafaelperazzo/programacao-web | 95643423a35c44613b0f64bed05bd34780fe2436 | 170dd5440afb9ee68a973f3de13a99aa4c735d79 | refs/heads/master | 2021-01-12T14:06:25.773146 | 2017-12-22T16:05:45 | 2017-12-22T16:05:45 | 69,566,344 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 519 | py | contido.py | # -*- coding: utf-8 -*-
nm=int(input('digite o numero de elementos da primeira lista: '))
mn=int(input('digite o numero de elementos da segunda lista: '))
da=[]
vi=[]
for i in range (0,nm,1):
valor_da=float(input('digite um elemento da primeira lista: '))
da.append (valor_da)
for i in range (0,mn,1):
valor... |
81818686257d8652cf1c216e60ebcca959b8be86 | f8daed49d6ae2ffa5871f2f731b7de3e5436e3e6 | /crop/resized_order_crop.py | 864fd7430b1f6d4fc5bd989ebf07af32c35882c3 | [] | no_license | Andrewsher/xianyu_AI | b9bca579ed1623e1cee2536827d113079af06e5d | d9f1d750a7355311b827f1f1163399c821b4e47d | refs/heads/master | 2022-07-10T21:31:03.148439 | 2020-05-12T08:18:49 | 2020-05-12T08:18:49 | 263,274,552 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,242 | py | resized_order_crop.py | from PIL import Image
import numpy as np
import argparse
from tqdm import tqdm
import os
def order_crop(args):
# mkdir
if not os.path.exists(args.target_dir):
os.mkdir(args.target_dir)
if not os.path.isdir(os.path.join(args.target_dir, 'image')):
os.mkdir(os.path.join(args.target_dir, 'im... |
200548cb0d5befb85f387af05ace6a4ef32a79a1 | 200003fc23e8454f868d781b3e145744d056d16f | /eval_model.py | 7def9d5ca72da6e3ffbf890b4adb6f226c278b19 | [] | no_license | hfhfn/seq2seq | 46e17689bda494248f5779a7a8d47c1ba14b3601 | 9d2ca7c9257164989df43e788f5274ff75a5a43d | refs/heads/master | 2020-08-06T19:31:41.276057 | 2019-10-09T02:19:18 | 2019-10-09T02:19:18 | 213,124,916 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 952 | py | eval_model.py | import torch
import config
from torch import optim
import torch.nn as nn
from encode import NumEncoder
from decode import NumDecoder
from num_seq2seq import Seq2Seq
from dataset import data_loader as train_dataloader
from word_sequence import num_sequence
import numpy as np
import random
encoder = NumEncoder()
decoder... |
8f79c16808409404c0d0fa9ef7d83f203e4ae6ff | c91f37b02424f9695dade2be54829acf10c3d26d | /app/main.py | 5700ab7605e27ab858b0b8cdcb8dfbdafaeadb1d | [
"MIT"
] | permissive | ThePrankMonkey/flask-animal-camouflage | 2e5038a6acec75aa55d1015b13e25aab74d6b9d3 | 82605bfa06ad1111fc51eb812648d3d593c627e9 | refs/heads/main | 2023-01-12T21:36:35.517487 | 2020-10-30T18:49:40 | 2020-10-30T18:49:40 | 308,493,962 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,077 | py | main.py | from flask import Flask
from flask import render_template, session, redirect, request
import time
import json
import os
import random
import time
from .animals import camo, expose
app = Flask(__name__)
app.secret_key = os.environ.get("FLASK_SECRET") or "some-dummy-string-for-testing"
CAMO_COUNT = 10
EXPOSE_COUNT = 2
... |
59a8f4d585d358f31ae42c83cda053fccea1fed4 | 9a8cffe460d906aa9252c2894d22c8e06bf646db | /abc160/b.py | d5bebf7b564fad91b42df71e6c6e79f2716aef3d | [] | no_license | takaya-0808/atcoder | e955f7439e3ed573986505a45f717587ff073d55 | 6b302e73c1aa06cdc8220e3c0f43c7a6a7bccaa5 | refs/heads/master | 2021-04-08T07:28:50.904649 | 2020-08-16T05:04:14 | 2020-08-16T05:04:14 | 248,753,422 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 208 | py | b.py |
def main():
happy_count = 0
money = int(input())
happy_count = (money // 500) * 1000
money -= (money//500) * 500
happy_count += (money//5) * 5
print(happy_count)
if __name__ == "__main__":
main()
|
7e1f14e9e53a55070fa7cb3ad34a4d0d76ea4b3f | c16b07089604fd1ba144b2416ea00b0b0e549b89 | /Colletion/objetoProprio.py | f927517b5bbe6c211b4e5f4fdbd52b236c02e45d | [] | no_license | Bugvoid/LearningPython | c9e5e33b9f5e0dc79bee70b004a16b89c24d9ba2 | c42f5abaf8d81943df042259ee80ffc7ebc24e59 | refs/heads/master | 2023-06-22T07:30:19.786999 | 2023-06-17T03:09:13 | 2023-06-17T03:09:13 | 202,927,572 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,637 | py | objetoProprio.py | # class ContaCorrente:
# def __init__(self, codigo):
# self.codigo = codigo
# self.saldo = 0
# def deposita(self, valor):
# self.saldo += valor
# def __str__(self):
# return f"[>>Codigo: {self.codigo} Saldo: {self.saldo}<<]"
# conta_luan = ContaCorrente(15)
# conta_luan.d... |
507569316f066f3b05439875a37e9e08c106554a | 1e530ae53696df2230593d5a5dc850a0d815f6a5 | /src/testpackage/Input/testFronterPortfolio/testFronterPortfolio.py | 9f9174b59344f9f906e6db32077ca7b550257b00 | [] | no_license | moozer/skemapack | 8391587ef27c2fe8ded6f5a181fc99b230803aa8 | 12d2fd6aeeeb6c1654b6303e6e8a0a83579eb8b0 | refs/heads/master | 2021-01-10T21:04:40.039958 | 2012-09-01T20:50:16 | 2012-09-01T20:50:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,797 | py | testFronterPortfolio.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on May 15, 2011
@author: morten
'''
import unittest
from testpackage.Utilities.SupportStuff import * #@UnusedWildImport
from Input.FronterPortfolio.FronterPortfolio import * #@UnusedWildImport
from testpackage.Utilities.TestdataSupport.FronterPortfolio import ... |
5131585060a5dd2a9c0a034de969dcda37fb3274 | fe51effc7ccb3a1930f79cab67afb7730fc2b94e | /helpers/email.py | 49cb5528a4bf7f4b00fb81355d4e04602757f18f | [
"MIT"
] | permissive | bertrand-caron/cv_blog_flask | 326a04b4f5ed03e9f66b4ded0f862cc003d46288 | 38f966c9bee6cb9ea8611bc578671e0b500d9ce3 | refs/heads/master | 2023-01-28T17:48:37.495410 | 2023-01-16T03:03:39 | 2023-01-16T03:03:39 | 74,858,778 | 0 | 0 | MIT | 2021-03-30T22:32:29 | 2016-11-27T00:39:03 | HTML | UTF-8 | Python | false | false | 182 | py | email.py | def obfuscate_email(email: str) -> str:
assert email.count('@') == 1, email
username, domain = email.split('@')
return username + ' <AT> ' + '. '.join(domain.split('.'))
|
0dccbebb95e1c15cfc5e85574d6a9d6fc5a0b723 | 8c21dfe2ca1a0759b60b6e406c4b44c38b470ebb | /mem.py | 82fdca4b7a6d56eeab82732b2842fb49018bc9c0 | [] | no_license | AndresRenteria/iotWorkshop | 170921fa353afa527520b2a0f3766896fdf36713 | e359fd94c5b4d23b3c7a2932df01c933f8b6a0f1 | refs/heads/master | 2021-01-13T00:52:20.917408 | 2016-03-02T17:13:38 | 2016-03-02T17:13:38 | 52,980,947 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 798 | py | mem.py | import time
import pyupm_grove as grove
import pyupm_buzzer as upmBuzzer
# Create the button object using GPIO pin 0
button = grove.GroveButton(4)
# Read the input and print, waiting one second between readings
while 1:
print button.name(), ' value is ', button.value()
time.sleep(1)
buzzer = upmBuzzer.Buzz... |
9daa1f99b4169285dd890d432c6a6d63e8334bac | 3f51d8812a731fddefe80233e209ad19f1407531 | /django/orm/manytomany/models.py | 14d57bf4fd6a088b026078ad43d1421b4818b5a7 | [] | no_license | mizm/TIL-c9 | 281336cccc74809dfd5e4aa6cff0114a37059155 | 7b4c561bcbc32533852cb025a4823487caf981d6 | refs/heads/master | 2020-04-17T17:17:35.861307 | 2019-05-09T09:00:12 | 2019-05-09T09:00:12 | 166,776,970 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,258 | py | models.py | from django.db import models
# Create your models here.
# 병원에 오는 사람들을 기록하는 시스템을 만드려고 한다.
# 필수적인 모델은 환자와 의사이다.
# 어떠한 관계로 표현할 수 있을까?
class Doctor(models.Model):
name = models.TextField()
class Patient(models.Model):
name = models.TextField()
doctors = models.ManyToManyField(Doctor, related_name='pa... |
a2665be00bba0bfd7ee3ae163d94912f79a8cafa | b3cfd736303f555beab993aa90c8e3108114711d | /src/setup.py | 38ed2b96551e58aa28d10010e08665ace110ec3b | [
"MIT"
] | permissive | tfang94/paql-project | 83abe587df14c51d30c9a4e0ad0f2e42b6b5c40f | 0848d13a0f2489349d196a596cc1a1a1f2ee1bfe | refs/heads/main | 2023-08-18T18:33:54.590069 | 2021-10-01T22:25:37 | 2021-10-01T22:25:37 | 361,485,355 | 0 | 0 | MIT | 2021-04-25T17:54:25 | 2021-04-25T16:51:47 | Jupyter Notebook | UTF-8 | Python | false | false | 3,099 | py | setup.py | #!/usr/bin/env python
# ------------------------------------------------------------------------------
# Licensed Materials - Property of IBM
# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
# Copyright IBM Corporation 2008, 2020. All Rights Reserved.
#
# US Government Users Restricted Rights - Use, dup... |
376f0df024443b57ee4dc22deffdcd8cc7d29d49 | 3f3aa9756f36d88cae4e20841406c572ab7cdabc | /scrapers/scraper_utils.py | e0341ef724ee88f65bd68d2ece2a98c4730bec9b | [] | no_license | OzuYatamutsu/caas | b6658ef8702a185e3cafa1f296431ceffa2a3a9a | 72da787ee4049bf4ee9bfed5b93f841f48192487 | refs/heads/master | 2020-05-19T12:38:04.772282 | 2015-09-27T17:16:19 | 2015-09-27T17:16:19 | 35,179,353 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 611 | py | scraper_utils.py | from json import dumps
from hashlib import md5
info_tag = "<info> "
warn_tag = "<warn> "
err_tag = "<error> "
succ_tag = "<success> "
def catfact_process(cat_fact):
json_obj = {}
json_obj["_id"] = md5(cat_fact.encode("utf-8")).hexdigest()[0:24]
json_obj["text"] = cat_fact
return json_obj
def metadat... |
1a2d25c678d633c81fdd6a9cee672eb0f486879a | 850cceda632bb2cf96164156750ae8bd5c9857e6 | /MIS Final Project/Guevara_Sofia.py | 6aabd65a2da38a9b9d12076bb186651fb2a30c96 | [] | no_license | sofgu/pythonwork | af7c907f227c819d3684c2bd66372efb6835654d | 27dcea56907431ed2a107c1000edd3a22989a8e6 | refs/heads/master | 2020-03-16T13:01:55.138085 | 2018-05-09T23:19:00 | 2018-05-09T23:19:00 | 132,679,831 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,414 | py | Guevara_Sofia.py | #create global constant for student.txt input file
student_input = "students-sample.txt"
#create global constant for course.txt input file
course_input = "courses-sample.txt"
#create global constant for students updated output file
student_output = "students-updated.txt"
#create global constant for courses updated outp... |
37a239a5b517660712ecdd48628d68496c65a1e1 | 6d1a39fb197e5eefb0d8b7719893c3e81e9a8fbd | /svm.py | f1d0a0d41c821b906b06740aa85913ed4f84a110 | [] | no_license | shiji203/ML_Classification | 0cdfd224d87afdef4e8d28653142d9be8fcd9734 | 3b4044cd131ac17978098ed734a3d1a3d3402eda | refs/heads/master | 2021-05-25T17:25:46.976082 | 2020-01-05T23:53:17 | 2020-01-05T23:53:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,697 | py | svm.py | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 8 23:55:14 2019
@author: Sampritha H M
"""
import pandas as pd
#from matplotlib.colors import ListedColormap
#from sklearn import neighbors
hazelnut = pd.read_csv('./hazelnut.csv')
print("hazelnut data before separating target\n")
print(hazelnut.head())
... |
9f267012caf8a1bad12515c632d8690e81c73516 | 0cd9fceff723c8f8658b6f18974122f55b075425 | /t09other.py | eede62b977597068386e640413b65c94933d33c3 | [] | no_license | Cylowatt/python-tutorial | e153daa642dfba0a5bff06d35e92fedeac7f2a2f | f6ea5e884dee40821e17a569c306630ef24c3fe9 | refs/heads/master | 2022-12-07T19:43:10.672810 | 2020-08-23T11:10:01 | 2020-08-23T11:10:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,567 | py | t09other.py | from typing import Dict
def other_things():
a = True
b = False
# Actual words instead of &&, ||, and !.
if a and b or b and not a:
print('Never')
# Ternary operator (conditional expression).
c = 'c' if a else 'a'
def exceptions():
try:
result = sum([1, 2, 3]) / 12
e... |
a29eff5343f09a629572dfcf0cf7571ebf4eae55 | 42e79d5e8c277ff1689707369f74838ec7bf474a | /graphics(co3)/rectangle.py | 06868d19d0edb5bccf3f083c9069322cb4118e04 | [] | no_license | Sivapriyak56/pythonpg | d46cc386be408dc8b7a3a7407172db86d4939df8 | 71d26d1d65edf4900b5846a318e0c1e942143c99 | refs/heads/main | 2023-03-27T23:32:48.474333 | 2021-03-24T17:04:35 | 2021-03-24T17:04:35 | 343,643,124 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 116 | py | rectangle.py | def getPerimeter(l,b):
perimeter = 2*(l+b)
return perimeter
def getArea(l,b):
area = l*b
return area |
50d0e1a96529472ce4bc88c3c5b53e08b7d4c1bb | 99d7e12f05123a6c48f85b643b54cedd8660edad | /CREDBANK/library/plot_result.py | fc958be02383edc9c861dccbc33736901d80ec0f | [] | no_license | amalfiyd/remote_projects | 1bfcec4b4648a5eb42d2e7f2942b048c94a477a9 | 0b83e1d19e4830131de34a0609534ab922e4f658 | refs/heads/master | 2020-05-18T19:26:48.343040 | 2015-08-11T12:29:16 | 2015-08-11T12:29:16 | 37,008,393 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 844 | py | plot_result.py | import seaborn as sb
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from dateutil.parser import parse
from sklearn.neighbors.kde import KernelDensity
import re
import scipy
basedir = "/home/masdarcis/Projects/dataset/CREDBANK/"
fileplots = ["new_out_result_1-9.data", "new_out_result_2-8.data",... |
000b1c58072207a46066892cc653bc26f20cd079 | bf440d8a6a66aa74dd6072cac2adcbbeb0ff8d0e | /test/test_quiz_11.py | b12177c1f64e4f414dee2d775d99eed72584b9da | [
"Apache-2.0"
] | permissive | dmiyakawa/PythonQuiz | e909d26284647978947c09f5d68905befb25c76c | 9f34a9d977efbfd0023c8c4442938b3d447c4452 | refs/heads/master | 2020-04-06T07:06:56.169635 | 2016-09-08T03:58:33 | 2016-09-08T03:58:33 | 64,996,300 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,013 | py | test_quiz_11.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''\
時計の短針と長針間の角度
特定の時刻、時計の短針と長針間の角度を計算する
calc_degree(h, m) を完成させてください。
ここでいう時計とは12時間を1周とする
一般的なアナログ時計を指します。
hは0〜11の整数、mは0〜59の整数を取ります
戻り値は0から180度の範囲で求め、
その結果から小数点以下を切り捨てた整数とします。
例:
3時ちょうどならば引数はh=3, m=0で、正解は90です。
1時51分ならば引数はh=1, m=51で、正解は109です。
'''
import unittest
from... |
c24467b5cc52399c2c0cf70f8ac3771f23ade3d1 | 0f074e5adef64fa16e88dc2499e76f08b4c33c02 | /python3_runoob/0301 环境搭建.py | ba93def4ce07c0721867978dc04a5cee485907ba | [] | no_license | guozhenjiang/Python | 0ac39adaf72df0bfee51795fabcfd959a69b1862 | 44b07bd767f3f2a947331111ab920200ac2412c6 | refs/heads/master | 2021-05-19T16:54:40.725132 | 2020-11-19T16:26:26 | 2020-11-19T16:27:11 | 252,035,380 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 31 | py | 0301 环境搭建.py | '''
https://www.python.org/
''' |
7fe09fdcb641f9e86f049ddd025993a6a30f5a6e | 981566a6cb8493f435ac3e6dd7e520c0ebe68fcb | /src/basic-c3/task20180726Lv2.py | 8a68559cbc1761c438c60b06a702dd89eb11372b | [] | no_license | n18019/programming-term2 | fc98e1e5ade5776699ac86d8a60afce14513eb11 | 1aa9f1a45cb687b27c2217144de94d9cfdf2b19d | refs/heads/master | 2020-03-22T08:59:29.526003 | 2018-08-21T00:47:44 | 2018-08-21T00:47:44 | 139,806,130 | 0 | 0 | null | 2018-07-05T06:42:11 | 2018-07-05T06:42:11 | null | UTF-8 | Python | false | false | 1,601 | py | task20180726Lv2.py | import random
import sys
goal = 20
# ランダムに入ってきた整数
cur_x = []
print('ゴールは20です!')
def shake_dice():
'''
ランダムなサイコロを振る関数
parameters
----------
なし
Return
------
random.randint(1, 6)
1から6までのランダムな整数
'''
return random.randint(1, 6)
help(shake_dice)
def go_forward(Advance_forward)... |
328024e0a839b618141fc1dd846e5b96f6b3b951 | 763945e08ee557bd83688d9c73fda30e1b0854cd | /jsondler/json_entry.py | 16d82dbb8df5fa6c02f72c8b07f486d8103be4a5 | [
"BSD-3-Clause"
] | permissive | loven-doo/jsondler | d214e94d17c272daa9846e6764b86c7fabce96a8 | 1466f022fc059a5a58e34dcc3ebddb76b5f82c5c | refs/heads/master | 2020-03-29T22:10:50.890492 | 2019-10-25T12:43:42 | 2019-10-25T12:43:42 | 150,407,295 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,921 | py | json_entry.py | from functools import reduce
from operator import getitem
from abc import ABCMeta, abstractmethod
class JsonEntry(object, metaclass=ABCMeta):
@classmethod
@abstractmethod
def attr_scheme(cls):
"""
json scheme (the keys must match attribute names defined in __init__)
CAUTION: if at... |
71aa410583b28a7545ab6f42dd1c8a4e99a8327b | 00decfba6d99f7f85a9f52d3023f7b8385dcb580 | /markov chain and distribution sampling/MarkovModel.py | 431f95867eede0cc7b5d6145b8e5ecda55f919df | [] | no_license | chandanms/bach_ml_project | d1454e0da2a4bb4038002aec3f3be4e3ae21f594 | 33127200b7aa3480b6d3b2e1ad3f1ca47452248a | refs/heads/master | 2023-03-01T15:15:55.797808 | 2021-02-14T16:32:52 | 2021-02-14T16:32:52 | 317,567,244 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,334 | py | MarkovModel.py | import pandas as pd
import numpy as np
import collections
from tools import convertNotesTomidifile
import random
F = pd.read_csv("F.txt", sep = "\t")
F.columns = ['Soprano', 'Alto', 'Tenor', 'Bass']
F.insert(loc=0, column='Time', value=range(0, len(F)))
# make different biagrams for the columns
bigram_Bass = []
for i... |
677c8028b1223c76680d681fdc7f0f89d497e99a | aaff0fe097a820a30e84320f8e5bee1ef8e8a14f | /generate_html.py | c30fc714479a37c94b0c1fc6c7ade7c97d567ff2 | [] | no_license | jewmin/comic-spider | 4dfe843992fe7ed1013c51d9810e9915a07801ee | 13366d4869a038f6d7c3a166869a6b2619ffb27f | refs/heads/master | 2020-03-22T02:32:29.749577 | 2018-12-23T02:15:09 | 2018-12-23T02:15:09 | 139,376,615 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,379 | py | generate_html.py | # -*- coding: utf-8 -*-
import os
from download_pictures import get_info, get_info_imgs, download
import config
def generate_html(imgs):
""" 生成html """
content = {}
for img in imgs:
_, _, filepath, title = img
if title in content:
content[title] += u'<img src="' + filepath[5:] +... |
cf6a763f464ea7ab7c06961ae243a27437a10e99 | edccc564bf3699d7bab9a6b26c369ac85cd32555 | /blast/migrations/0009_auto_20191105_1631.py | 51880f66ee194ef97af2e199991ce8f959b36b48 | [
"LicenseRef-scancode-public-domain"
] | permissive | NAL-i5K/genomics-workspace | 7bb609b651b6118d3ce8aa49868d7372f5562956 | 013f44dd02980d34a00e4e9b667fa8fea6e824c5 | refs/heads/master | 2023-01-27T20:36:09.871710 | 2021-02-10T13:48:25 | 2021-02-10T13:48:25 | 72,758,632 | 14 | 6 | NOASSERTION | 2023-01-13T22:38:11 | 2016-11-03T15:20:11 | JavaScript | UTF-8 | Python | false | false | 761 | py | 0009_auto_20191105_1631.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-11-05 21:31
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blast', '0008_delete_organism'),
]
operations = [
migrations.RunSQL(
"... |
771b6a34356609645c30669083abef4b2961faf3 | afb8c2bcd1882fe3c74dc4315c593dfcfcb083ad | /exercises/03_data_structures/task_3_6.py | 4503c3db60459e9a81d0599434725dcaf80fce2e | [] | no_license | tpedko/pyneng-online | 965fbd9955b284fc448b940df251f7af3d1b0e9a | da14a2271199a7d6ca8b0d50ef4649d2a8261091 | refs/heads/master | 2021-07-01T16:32:24.824148 | 2017-09-23T21:15:55 | 2017-09-23T21:15:55 | 102,980,909 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,520 | py | task_3_6.py | # -*- coding: utf-8 -*-
'''
Задание 3.6
Обработать строку ospf_route и вывести информацию в виде:
Protocol: OSPF
Prefix: 10.0.24.0/24
AD/Metric: 110/41
Next-Hop: 10.0.13.3
Last update: 3d18h
Outbound Interface FastEthernet0/0
Ограничение: Все задания н... |
54a2b739d96cc144da8dca5f6573442fd6133762 | e363f190d21780f144897d1f8fa88d1064f966af | /share/admin.py | 6c215f6e59704efbf46488f0106d86edadbbd1a0 | [] | no_license | k-eaton/ArtemisPlayground | 7e87d0ab2170d3fe6ff49b377dcce8952c53f09e | ff819a76a34f171cf33cb5c367ad07d32ec5e570 | refs/heads/master | 2022-12-11T02:42:15.879246 | 2020-05-05T14:41:57 | 2020-05-05T14:41:57 | 246,440,026 | 1 | 4 | null | 2022-12-08T03:57:34 | 2020-03-11T00:45:00 | CSS | UTF-8 | Python | false | false | 450 | py | admin.py | from django.contrib import admin
# Register your models here.
from .models import Coder, Problem, Script, Media, Post, Comment, Photo, Profile, Friend, Follower
admin.site.register(Problem)
admin.site.register(Coder)
admin.site.register(Photo)
#iserrano4
admin.site.register(Media)
admin.site.register(Post)
admin.si... |
d375f9eccd92f3526c3f57c9e133fe3a623673d2 | 636007d520745778b34ecb57ef0fce5e9ac04481 | /mantle_transition_zone_migration_obspy/visual_py/final_plot_selected_Pds_Ppds.py | 14ccfcf5283efcb33e21638fbc6eeba4a63ee095 | [] | no_license | dIOGOLOC/codes_escritos | afc1e67686ace9162080afd6c61783508965d684 | b8b5343d1e9ff28a39fc7221f33952f0ffd3db35 | refs/heads/master | 2023-06-08T12:40:56.511078 | 2023-06-02T23:33:57 | 2023-06-02T23:33:57 | 94,356,450 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 35,718 | py | final_plot_selected_Pds_Ppds.py | # coding: utf-8
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import obspy
import os
from obspy.taup import TauPyModel
from obspy.geodetics import kilometer2degrees
import copy
import matplotlib
from matplotlib.cm import get_cmap
from mpl_toolkits.mplot3d import Axes3D
import cartopy.crs... |
a3cd990596ae8ec5a1f9fceacd4c551f3d129d04 | d01409876db7799be2353a19dd92b75dbd68538d | /bin/s.py | 78975e9105e7a5060fb53817cb14acaf9e89e34b | [] | no_license | AnchorFree/docker-kibana-exporter | 1ff059492afa55d4baf4907dd25d6c8f7aedc225 | 0a04024395618d1d03b0dbca2a14d634ca6aa6d6 | refs/heads/master | 2021-09-09T21:11:55.721436 | 2017-05-30T01:41:44 | 2017-05-30T01:41:44 | 92,788,925 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,091 | py | s.py | #!/usr/bin/env python3.5
from prometheus_client.core import CounterMetricFamily, REGISTRY
from prometheus_client import start_http_server
import json
import requests
import time
import socket
import os
class CustomCollector(object):
def _getKibanaServers(self):
for env in os.environ:
if 'kibana' in ... |
6f9c9e8eac1977d66fe12f538428eb8f95b69e17 | d75c67305b250ce9c31b1de532aa217095dd9ff1 | /src/visualize/calc_real_radius.py | d6ffe124330e7043a561eb9a3275b81dd16ba748 | [] | no_license | lenLRX/final_paper | a2c088c3114d5d5d925a3c783bb24601bc5cd918 | 643f37d4a27f0f963da9a89e356fe4911b1a81c5 | refs/heads/master | 2021-03-24T11:56:39.497999 | 2017-04-06T06:49:24 | 2017-04-06T06:49:24 | 71,214,142 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 204 | py | calc_real_radius.py | import math
def get_real_radius(r,tau):
coef2 = ((tau-0.5)/3*6.698)/(math.sqrt(6.698*0.18299))
coef1 = 1.0087 * 10 ** -3 / math.sqrt(998.23 * 72.75 * 10 ** -3)
return r * (coef1 / coef2) ** 2 |
7c797af2432faa052aa6bb95fdbe927459b05238 | dc0e4a6c30cb8aacad0da7f948595c7936456118 | /Huffman.py | 84442e10077e55a0e4facebe05226caaae6b03d3 | [] | no_license | alievaliza/HSE_Lyceum_python | bf9db7a459d7df4e354f308adc49f43897256f23 | 6b69b072d98051575a87601edcf533a43e8052e7 | refs/heads/master | 2023-06-24T07:45:27.890264 | 2021-07-20T12:05:36 | 2021-07-20T12:05:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,137 | py | Huffman.py | import collections
s = input()
d, ans = dict(), ""
for el in s:
if el in d:
d[el] += 1
else:
d[el] = 1
for el in d_ans:
d_ans[el] = ""
while len(d) >= 2:
least_common = list(reversed(collections.Counter(d).most_common()[-2:]))
d[least_common[0][0]+least_common[1][0]] = lea... |
870147aab1b9d4ed907870e7d10a000a769f63d9 | aea48d4b7cb293731a1bf92b1c2c3183efaab369 | /06_control_structures/task_6_2a.py | c1e1a76f9d1b1f21416af2d54e3147b36283720e | [] | no_license | NOKnowitAll/python | 859d8504a7cffba921dfcb28d745fd21402ca215 | c4e5ee4cf5003a270162596f5bfca302b8a18e83 | refs/heads/master | 2022-12-24T06:02:09.733898 | 2022-12-17T18:24:24 | 2022-12-17T18:24:24 | 227,146,290 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,594 | py | task_6_2a.py | # -*- coding: utf-8 -*-
"""
Задание 6.2a
Сделать копию скрипта задания 6.2.
Добавить проверку введенного IP-адреса.
Адрес считается корректно заданным, если он:
- состоит из 4 чисел (а не букв или других символов)
- числа разделенны точкой
- каждое число в диапазоне от 0 до 255
Если адрес задан неправильно,... |
d8125948ba232cd00d79f034e7c571795b744f37 | 0e9145a217bc0c474d43df1b0cfda4886d6b15f8 | /cogs/error_handler.py | 7663db40c9aa4dc83251bce7086cc4a98d3d050b | [] | no_license | Willy-C/Strawberry-Lamb | 83dbc4d5fe960b14b65a0528c0830d3fbdc30ba1 | 712c8d19266d0b8cd88f5742993e531a3c7b50a5 | refs/heads/master | 2023-02-15T17:38:27.863262 | 2021-01-18T01:37:38 | 2021-01-18T01:37:38 | 322,170,745 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,065 | py | error_handler.py | import discord
from discord.ext import commands
import traceback
from utils.common import upload_hastebin
class CommandErrorHandler(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.owner = None
bot.on_error = self.on_error
bot.loop.create_task(self.set_own... |
524d9ed8ede3a7a89178843a45ee81113c726853 | c12eba0112932cb58126b55ee5cf65673aba32d9 | /trollpy/tests.py | 0841d4319f8458a6ec31ea5e76d27d865334f840 | [
"MIT"
] | permissive | Copenbacon/TrollPy | b2cb4c408984a89142af6cd83d1d58f315eec2c7 | bafa8acb6fe7169f08bc95d620ea6a12659b68ce | refs/heads/master | 2021-01-20T03:42:08.390333 | 2017-01-13T19:53:20 | 2017-01-13T19:53:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,595 | py | tests.py | """Tests for TrollyPy App."""
import pytest
import transaction
import os
from pyramid import testing
from .models.meta import Base
from .models import (
get_engine,
get_session_factory,
get_tm_session,
User,
KillScore,
Audio
)
from gtts import gTTS
@pytest.fixture(scope="function")
def sqlengi... |
989034390232424edf30f01e63909f2fe248b004 | 6168eb6121e7af33314c92d078dccbffc93e041b | /orders/forms.py | faf0ac5372b213a10f88966658e8ef71a0075bb8 | [] | no_license | lsujh/givefree | 0c49ddc1cbbe8583d6bc5937eca748a1a67a8c23 | 9e5e0284ec333ea95385cef44e6fcf3c749f0512 | refs/heads/master | 2023-06-18T20:19:24.196920 | 2021-07-21T06:29:13 | 2021-07-21T06:29:13 | 297,262,853 | 2 | 0 | null | 2021-07-18T04:39:48 | 2020-09-21T07:33:00 | Python | UTF-8 | Python | false | false | 323 | py | forms.py | from django import forms
from .models import Order
class OrderCreateForm(forms.ModelForm):
class Meta():
model = Order
fields = ['first_name', 'last_name', 'email', 'phone',
'street', 'postal_code', 'city', 'shipping', 'department', 'region', 'province',
'coment... |
28ea220cdee864919cd8752c7d3ebc341979ba27 | f8d708484ae5ae9ff031781bc03f1ae83a34be18 | /gen-passwd.py | 1893b923ec0d9bed3fc3d71a49fdb1868b1dac8d | [] | no_license | ticosvd/utils | 903894a83bd87cd897ccbfab158c055caea06f0c | d96e017ff2b8731222abe48d3b10220ec68facb3 | refs/heads/master | 2020-03-26T16:58:13.105814 | 2018-08-17T15:06:55 | 2018-08-17T15:06:55 | 145,134,715 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 551 | py | gen-passwd.py | import argparse,string
import secrets as secs
def GeneratePassword(length_password):
alphabet = string.ascii_letters+string.digits
return ''.join(secs.choice(alphabet) for i in range(int(length_password)))
parser=argparse.ArgumentParser(description='Generate a password')
parser.add_argument('-l',help='A ... |
7b3544f7f3956987d69bdc99202b01469ea2033f | 2af5362d629b344d74ea3eff997a050d7112ecb9 | /interaction/migrations/0002_auto_20170908_0758.py | 9a3d326fe91e22d65b681e06966f7b153b44a331 | [
"Apache-2.0"
] | permissive | amcnrs/protwis | 0f4848346d0c93970b7cb073d623e5c1d506d20d | 643138ed4f9cdc3435f10045079b42243b41abdd | refs/heads/master | 2021-05-08T11:58:22.882548 | 2017-12-21T15:12:51 | 2017-12-21T15:12:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 833 | py | 0002_auto_20170908_0758.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-08 05:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('ligand', '0001_initial'),
('int... |
db58420cc6a54f5d16befe59ffa23a327c8d31a6 | ad72a31d03e375da50e0a67d2444157ae35e5d7b | /home/admin.py | f2c099d397cbbce54feca6180299eb0ec9b077dd | [] | no_license | MaxCrowder/CrosCrowd-Django | 33166c101b1db3c4d062f4435e4ee4796a4e9c92 | 68c76cb38308022f3458286fa7fd3ce1bd4e410a | refs/heads/master | 2022-10-15T06:01:38.293654 | 2020-06-15T22:29:57 | 2020-06-15T22:29:57 | 272,521,445 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 313 | py | admin.py | from django.contrib import admin
from . models import Customer
admin.site.site_header = 'CrosCrowd Creative'
admin.site.index_title = 'Admin'
admin.site.site_title = 'CrosCrowd Creative'
class CustomerAdmin(admin.ModelAdmin):
list_display = ('name', 'email')
admin.site.register(Customer, CustomerAdmin) |
5287ad5c26d446e5612a9e38f341aae333eab255 | fe28628d1d21a6f12197f9d5e74104ebe0f51005 | /StatisticNGram_char.py | 78ef9a9c67b857bf05906664addadd2d7561c31e | [] | no_license | ky941122/NgramLanguageModel | fca7ca276eca492bba2e72e9f8a03516bb0b5e15 | 5bff5d91e1a826821b42c9e618346388598549fe | refs/heads/master | 2020-05-22T21:46:37.039102 | 2019-05-14T02:59:36 | 2019-05-14T02:59:36 | 186,533,832 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,115 | py | StatisticNGram_char.py | # !/usr/bin/python
# -*- coding:utf-8 -*-
# Author: yadi Lao
import os
import re
import codecs
import pickle
import time
import logging
import math
import pandas as pd
import numpy as np
from collections import defaultdict
from nltk.lm.preprocessing import padded_everygram_pipeline, pad_both_ends
from nltk.lm import ML... |
656030476d2a2292e825bf40efca9a5d77626dcf | f3b36584a007e0885e23b1cdf3bf19b13b9d78ca | /imm_automation/Users/models.py | 9ab545e3feacd3bb2a227026e78bdd42a6adf6a9 | [] | no_license | mohitrana67/Imm-Automation | 153856c4e6e406be54431fcb0be5cb122d685055 | b8990fa0a7027755609747c41b65765456969b32 | refs/heads/master | 2023-03-09T17:31:54.366877 | 2023-02-27T22:40:08 | 2023-02-27T22:40:08 | 319,704,987 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,531 | py | models.py | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager
class CustomUserManager(BaseUserManager):
def create_user(self,email,username,f_name,l_name,password, **other_fields):
if not email:
raise ... |
9305bcf070b700f98118f3e79f233f5437953f0f | 676165562bf0b3045385477bb33f7dd96c9455d7 | /course_assignments/jarowinkler.py | 741671bce213cdaba49198fe2a905c838bcbe2af | [] | no_license | twseel/InformationScience | d1421ad0509bbc9fa02d7fd83d92a1184f2f124b | dc4841ad6ec5236881a49fd1b3563363e94c6660 | refs/heads/main | 2023-02-23T04:02:32.972446 | 2021-01-19T22:58:10 | 2021-01-19T22:58:10 | 330,283,237 | 0 | 0 | null | 2021-01-17T00:12:56 | 2021-01-17T00:12:55 | null | UTF-8 | Python | false | false | 2,644 | py | jarowinkler.py | # Python3 implementation of Jaro-Winkler distance
# https://www.geeksforgeeks.org/jaro-and-jaro-winkler-similarity/
def jaro_distance(s1, s2):
"""
Function to calculate the Jaro similarity of two strings
"""
# If the strings are equal
if (s1 == s2):
return 1.0
# Length of two strings
... |
60f7925022b8bcf4d0b166360ca9ae310a882a96 | a0a9696347fd4603259ef0f0405b7ac63e732d44 | /examples/object_detection/dataloader/mode_keys.py | 59f43ce14ff329baf71605ef99faeb1299ce039c | [
"Apache-2.0"
] | permissive | dupeljan/nncf_for_tf | f93719e3faa1f1debec8ec9fe098094c95762c1b | 5fdc4750615d47ac16b90747d9b0e82028f97ac3 | refs/heads/dl/raw_tf1 | 2023-07-03T22:57:57.778491 | 2021-07-20T10:27:18 | 2021-07-20T14:09:57 | 369,249,440 | 0 | 0 | Apache-2.0 | 2021-06-03T14:31:56 | 2021-05-20T15:09:55 | Python | UTF-8 | Python | false | false | 452 | py | mode_keys.py | """Standard names for input dataloader modes.
The following standard keys are defined:
* `TRAIN`: training mode.
* `EVAL`: evaluation mode.
* `PREDICT`: prediction mode.
* `PREDICT_WITH_GT`: prediction mode with groundtruths in returned variables.
"""
from __future__ import absolute_import
from __future__ import div... |
cb696f9ed9b8e0135364ec9593489e65fd6a5a95 | 411df5c1a190ba7a656f7a4bf594060335231fc1 | /students/urls.py | 0455f78c98b88e1fb83b6a7f876e86169639020c | [] | no_license | connormullett/eleven_data | 76c9b235b7e950537e9d475513b2010e0341f0ee | c14de10af103c47c2e1b1bbaae57650232df11c7 | refs/heads/master | 2020-04-05T01:43:46.113538 | 2018-11-21T15:17:42 | 2018-11-21T15:17:42 | 156,447,229 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 389 | py | urls.py |
from django.urls import path
from . import views
urlpatterns = [
# path('register', views.register, name='register'),
path('', views.landing, name='landing'),
path('index', views.student_list, name='index'),
path('create', views.create, name='create'),
path('update/<int:id>', views.update, name='... |
7433a93d73f3247b72fd38c7a030e101cc62a471 | a4da9c6fb5d365a6e266b772f22eef578a0f8b08 | /Aestrella.py | 52fc13ede4b7491d8b77d43c8092cda0cd9cfc7c | [] | no_license | eduardoBarajas/A-Star-Search-Algorithm | d3d97244a2a6c42295c872d55076024a398f9b1a | 2e2f27b453458a22663a0b2c64a91ff9613849ec | refs/heads/master | 2020-03-28T16:31:43.593278 | 2018-09-17T19:08:33 | 2018-09-17T19:08:33 | 148,704,282 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,060 | py | Aestrella.py | #es necesario importar la liberia time para que muestre el tiempo que tardo en la ejecucion
import time
"""
Definir la clase Node y sus propiedades
donde pos es una tupla con la posicion en X y en Y del objeto.
y en padre se almacenara el padre del nodo actual.
f = g(n) + h(n)
h = es la distancia de Manhattan
g = es l... |
6efe4e5bff85f7a451bfd23eb03a3fc70025eb6c | ba37c52ccaeac2b3c010442a995b0039c50d4d34 | /cob_3d_mapping_semantics/cfg/supporting_plane_extraction_node.cfg | 7c88b12816c7e0ef16f7025e50b9a609e5fd1dc6 | [] | no_license | ipa320/cob_environment_perception | 561e02b2432907c3daa8940c4bdaee5a26ef8ea1 | 43fccc6f8e090936ccde9424894915da8530ab7a | refs/heads/indigo_dev | 2020-04-05T03:46:13.603695 | 2019-04-24T07:51:59 | 2019-04-24T07:51:59 | 2,598,290 | 4 | 25 | null | 2019-05-03T09:27:11 | 2011-10-18T10:47:53 | C++ | UTF-8 | Python | false | false | 594 | cfg | supporting_plane_extraction_node.cfg | #!/usr/bin/env python
# field of view configuration
PACKAGE="cob_3d_mapping_semantics"
#import roslib; roslib.load_manifest(PACKAGE)
from math import pi
from dynamic_reconfigure.parameter_generator_catkin import *
gen = ParameterGenerator()
gen.add("distance_min", double_t, 3, "minimum distance", 0.5, 0, 3)
gen.ad... |
5d1cfdbc3ac7fe9254fe709e38b288ea6f0d46af | 0c64f66a48450b29a6ea5964449bc9ab69408b87 | /kolga/plugins/slack/tests/test_hooks.py | 64140762863069506d46a9b5b2974109952c02fc | [
"MIT"
] | permissive | andersinno/kolga | 1899328ad0df4306ea14ec55b0a780024d273979 | fabbbfc355df576da4c3775c3a9a64257f89e9dc | refs/heads/v3 | 2023-02-15T19:50:06.452248 | 2023-01-26T05:09:00 | 2023-01-26T05:09:00 | 242,720,365 | 7 | 6 | MIT | 2022-08-05T04:31:17 | 2020-02-24T11:37:06 | Python | UTF-8 | Python | false | false | 937 | py | test_hooks.py | from typing import Any, List, Optional, cast
from unittest import mock
import slack_sdk
from kolga.libs.project import Project
from kolga.settings import settings
from tests.testcase import load_plugin
from ..slack import KolgaSlackPlugin
@mock.patch.dict(
"os.environ",
{
"SLACK_TOKEN": "test_token... |
b69bdb6f3cf3bd2f35ab22a0512e5bb61d404d30 | 6bd7196e454bb0542432eff4a921e63f38e8a482 | /setup.py | bbf6346c982b7c815dc401c3f042798c8c660bf7 | [] | no_license | davidbmadsen/SplashID | cced97b7844fcdde6e3a5a3ba10400fff98bc305 | e64b2e500a41b4eaf2bdd07e9bd76a75865a2481 | refs/heads/master | 2020-04-30T13:12:01.897774 | 2019-12-03T07:52:28 | 2019-12-03T07:52:28 | 176,849,498 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 223 | py | setup.py | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
extensions = [Extension("MostSimilarFrame", ["MostSimilarFrame.pyx"])]
setup(ext_modules=cythonize(extensions))
|
1ebdffdf32140fbe4c8f97a1ef1441294979ea6c | a637d4cc8e2675e73a4e406ccd0cc5bcfed24075 | /7-1 표준입출력.py | 042bca99e98fe62a09177f4866fe96ed9e233d86 | [] | no_license | hskyblue22/Python_basic | fc1d12434b2eadd4b7a05cb6cf85374ce9c6cdce | 79ca017e8b432b47efeb02f87da09c4a48f7fe89 | refs/heads/master | 2022-12-30T18:36:25.188554 | 2020-10-14T15:07:44 | 2020-10-14T15:07:44 | 284,620,652 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,190 | py | 7-1 표준입출력.py | # 표준 입력(stdin)함수 ==> input()
# 표준 출력(stdout)함수 ==> print()
# sep= " , " : 각 인자들 사이를 ,로 채우기
# end= " ? " : 앞 문장의 끝부분을 ?로 넣고 뒷 문장을 연달아서 한줄에 출력
print("cake", "tart" ,"dacquoise", sep=", ", end = " 하나만 선택하세요. ")
print("전부 다 주세요!")
'''1) print("cake" "tart", "dacquoise", sep=", ", end = " 하나만 선택하세요. ")
=... |
1114ad5b898515c7542f5b399abe96cbc440b100 | c94e3b31f29e65dcc7d65b1114dc24884f25a6a0 | /python/interviews/recursion/CombinationAndPermutation/absolute_permutation.py | 7b0a8417dbcb2ac581675d12d592bcb0beb55133 | [
"Apache-2.0"
] | permissive | ohmema/interview | 1b81a0dd1ee1f09ebd1ac904b7570c1ba77b1ea6 | 8f5e3e73242a156dc38593337c73ff068b7e9a7b | refs/heads/master | 2020-03-27T08:47:21.915333 | 2018-08-09T01:21:37 | 2018-08-09T01:21:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 418 | py | absolute_permutation.py | import itertools
def absolute_permutation(N, k) :
N=list(range(1,N+1))
#l = list(itertools.permutations(N, len(N)))
for t in itertools.permutations(N):
isAbs= True
for i ,v in enumerate(t):
if abs(v-(i+1)) != k:
isAbs = False
break
if isAb... |
8da27e20db8e25076478ef1cfba6b06d80b027f1 | be5e5c2d6f2bfe9cfb12daf783daae3c1d6de4ba | /dj/chat/models.py | 183ef000ae1312d6f218d8536621c06ac514ef4b | [] | no_license | zdimon/quiz-angular-django | f781ff3cc8197c2733a3fa4fc6e6408a658eb9fe | c8ae4034f8db4416720d164bf075f28d84ac9891 | refs/heads/master | 2022-11-30T22:51:31.474109 | 2020-03-02T08:28:06 | 2020-03-02T08:28:06 | 244,317,618 | 0 | 0 | null | 2022-11-22T00:30:40 | 2020-03-02T08:26:05 | Python | UTF-8 | Python | false | false | 947 | py | models.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.db import models
# Create your models here.
class ChatRoom(models.Model):
'''
Chat room
'''
from quiz.models.models import Question
question = models.ForeignKey(Qu... |
929eacbea8ae912104c32547c582079765ee3689 | 0f84638f3c2281a5620e7950fd825393efeafb21 | /Private/program_1/main.py | 483f953f199d4de5e0805d32809f0713fce9303e | [] | no_license | cagborgli/4553-Spatial-DS | dd87565816524249df0f78e8f1d6aacc8da3d4da | 7d7c651fb0088782931dbced185201179f40401e | refs/heads/master | 2021-01-13T06:00:41.061901 | 2017-06-21T16:19:59 | 2017-06-21T16:19:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 25,064 | py | main.py | 3NLT4dfok8_W4dN-3NLT4dfok9TWntjt5m_M39Xj5dmD4t7b1NLIfM7h49TV5oXm1NPH4dKUfc7Q4tTm54XQ09ncfc7Q4tTm54XT4tfd4dmD09iU49VtfIiUusrXksjp5dfI4NmU6tTV3c7i2oXT09ncfamsxLW1x62Dr4Xj5pPT09ncocnM5NPV4MqL4dii48bX2pPm2MbP4sbo243C0cvd38rC0Y6dfW-GlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiXloiGlYiX... |
62dd329a50adc79a51fee593f9719088575434b3 | fc3e55d0e17d0bd4830a45ad0cabbdf03fb2251f | /day02.py | 278746b5e884c9a3037dc612364e9ce2e1cbbcb3 | [] | no_license | chennian0108/qhmsite | 16c2766aa09b37ab857f36791cabe1a31a3c1ef8 | 6e8fb17f03b5796939c2fbe341c90723f3477f56 | refs/heads/master | 2020-05-01T08:48:08.526964 | 2019-03-24T08:09:05 | 2019-03-24T08:09:05 | 177,386,086 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 498 | py | day02.py | print("hello world!")
print("go big or go home")
print("_____________________")
print("| python团队 |")
print("| 👨👨👦👦 |")
print("_____________________")
import datetime #调用日期模块datetime
print("当前年份:"+str(datetime.datetime.now().year)) #输出当前年份,当前为2019年,输出2019
#输出当前日期和时间,如:2019-03-17 13:53:3... |
aa653a0eac6736a00022c1d1149f1c1a832e5a5c | a72477ed645b4b5ad75122da0abf9962a05b70cb | /爬蟲/CheckChromeInfro.py | 328506766710842725e1003df8066eff1a24b6ea | [] | no_license | JaiJun/Python-Challenge | 13753b240f0bc33a9218a2cedee25080883661d8 | 494abf708a7f97369e5cb157ef3891c408214628 | refs/heads/master | 2023-08-18T19:55:33.390690 | 2021-09-02T16:32:59 | 2021-09-02T16:32:59 | 402,490,555 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 312 | py | CheckChromeInfro.py | from selenium import webdriver
from selenium.webdriver.common.by import By
# 透過Browser Driver 開啟 Chrome
driver = webdriver.Chrome(r"C:\chromedriver.exe")
# 前往特定網址
default_url = "https://www.google.com.tw"
driver.get(default_url)
# 獲取目前網頁url
url = driver.current_url
print(url)
|
84b88b8c998f5eb97f2a395fd42bdf6346b5f24b | acc25f0b528c602ee02338c67fed546395dd2aa7 | /courses/CS/CS1.1/Superhero/animal.py | eb856f110693d856e36190037029eddcd2d0adc5 | [] | no_license | AjaniLevy/BankAccount | 148af4e8e525916dec5c0d638fc63a4bd94cd96e | 0ca18ef5d2dc0e3d8c81fe7041870a3aafa7d2aa | refs/heads/master | 2023-01-16T04:57:45.455943 | 2020-11-26T02:45:18 | 2020-11-26T02:45:18 | 311,512,310 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 583 | py | animal.py | class Animal:
def __init__(self, name, sleep_duration):
self.name = name
self.sleep_duration = sleep_duration
def sleep(self):
print(
"{} sleeps for {} hours".format(
self.name,
self.sleep_duration))
def eat(self):
print (f"{self.n... |
59e4c54320c1396346529e695654316070a71245 | fc4d6e985482702360e813da1262e5974ae86b7c | /NYTimesAPI/Python-NYTimes-Event-Listings-API-Demo-master/app.py | 1bfbb39d9a07220406ba6934731c76bcb86945d9 | [] | no_license | gzpgg3x/NYTapi | 45c6e0c3d501b8049a462f54527b00c3a7efb9b5 | c4083e0c90120ee638c3bcf56ae81c107cb344e8 | refs/heads/master | 2021-01-10T21:45:31.477193 | 2013-05-03T00:48:11 | 2013-05-03T00:48:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,059 | py | app.py | #!/usr/bin/env python
import json
import web
import config
import urllib2
import HTMLParser
import re
urls = (
'/', 'index'
)
event_categories = {
'Art': 'Art',
'Classical': 'Classical & Opera',
'Dance': 'Dance',
'Jazz': 'Jazz',
'Pop': 'Rock & Pop',
'Theater': 'Theater',
'spareTimes': ... |
7036b9640843165fca08701cfac9c8bdc007570d | bddecea3ad7cb4a59da265f86e97c4b74e06dc19 | /Element2/RecurrentClassification.py | a277d269fb4895015bac4b85d9e84ccad1ab0d26 | [
"MIT"
] | permissive | AuckeBos/MLiPPaA | 4f6bf006baf9f738c1d6788728a2d023943738a1 | 4b6c563f93e1eb7fc90f66a9a6ada16c07664d71 | refs/heads/main | 2023-04-18T08:57:03.966324 | 2021-04-30T06:48:59 | 2021-04-30T06:48:59 | 351,032,962 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,148 | py | RecurrentClassification.py | from tensorflow.keras.layers import Dense, LSTM, Concatenate, Masking, LeakyReLU
from tensorflow.keras.layers import Input
from tensorflow.keras.layers import Softmax
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from Element2.BaseClassification import BaseClassifier
from Elemen... |
fd4f726b5185bfed2101225134d5e4b10bc987a9 | 681cd46ff9b6dfecdd3732c106642cbf2f89bfaa | /app/main/util/dto.py | e8db5e4339bd139ded58451e779a15633c5e2780 | [] | no_license | facade-team/sogang-register-server | 5eda2367e0eaa5cd05121d44bfef53689e84103d | 02885a6482f0c9b7eeeed57d4338d3332ba1e363 | refs/heads/master | 2023-07-09T04:14:42.605187 | 2021-08-20T06:22:58 | 2021-08-20T06:22:58 | 388,984,280 | 6 | 2 | null | 2021-08-17T10:17:57 | 2021-07-24T03:02:05 | Python | UTF-8 | Python | false | false | 6,233 | py | dto.py | from flask_restx import Namespace, fields
class UserDto:
api = Namespace('user', description='sogang-register related operations')
user = api.model('user', {
'email': fields.String(required=True, description='user email address'),
'username': fields.String(required=True, description='user usern... |
579e9376e7bdeb1dc0b0ac6743f37deae25c23e0 | d755085fac798549d42fb017bdd216d3c820aff0 | /setup.py | bc6f8c90ef0ddd74cd7fc8ad7e79774e5e69c247 | [] | no_license | MartinHowarth/microservice_example_project | 23eb7eeecef35aa568b775d4d231fbfb4f55bc1c | e67cd65724e1bd4cd4eaf99329e626852b6982e6 | refs/heads/master | 2021-09-06T07:24:54.557858 | 2018-02-03T19:09:30 | 2018-02-03T19:09:30 | 115,533,009 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,362 | py | setup.py | # Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
... |
c42bbdeb5f47a1cb59feec2e44ccdeb8617b52ce | 65ccc526c0ab00284b6712ee4401c92b18cdf295 | /tt.py | 6d0b06d560d18ada9e46f773ddaf738e29c1301a | [] | no_license | BellaZbl/SemanticMatch | 52bf05320c43fe61a8b9ea448802eb103e93942c | ae95b56e4bc3ea9f7a82dca58b74aa8a0a64320e | refs/heads/master | 2020-04-18T05:42:40.433444 | 2019-01-21T08:25:03 | 2019-01-21T08:25:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,204 | py | tt.py | import numpy as np
# # import tensorflow as tf
# # s=np.array([2,3,1,0,0,0])
# #
# # print(s.shape)
# # ss=tf.get_variable(initializer=tf.constant_initializer(s,dtype=tf.int32),shape=(6,),dtype=tf.int32,name='12')
# #
# # s1=tf.cast(ss,tf.bool)
# #
# # with tf.Session() as sess:
# # sess.run(tf.global_variables_ini... |
3b82217e62449dcc76e0cb46a1b24988e54d8cdd | 81c3a06cca9863c46261541d30ecad0731873c57 | /cache/www.opengl.org/registry/api/wglenumext.spec | 3f6ceac25bcf79969b466ae0fbb0f1bcac2b5dc8 | [
"BSL-1.0"
] | permissive | AlexandreFournier/gl-spec-parser | 94f2895da81d0005b7952ed255da0a5a85d27f96 | 41a947b14b52f314ff124b64396f6096e8a3383c | refs/heads/master | 2020-06-04T03:45:13.504102 | 2014-03-03T21:47:25 | 2014-03-03T21:47:25 | 1,471,712 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 16,468 | spec | wglenumext.spec | # Copyright (c) 1991-2005 Silicon Graphics, Inc. All Rights Reserved.
# Copyright (c) 2006-2010 The Khronos Group, Inc.
#
# This document is licensed under the SGI Free Software B License Version
# 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
#
# $Revision: 12183 $ on $Date: 2010-08-06 02:53:05 -0700 (Fri... |
8e7be92ff6d6376773549ce0a3ed82ee95e38e10 | 3d8e60783f6bb7ca836eb9da96222cb276f27981 | /Python/pratice.py | ac6cd34ba0a0faa57038bb85f2877a693212cceb | [] | no_license | leegangho/20190701 | e10b71b839cbdbe818433b40c50a7ffc4cd0d6c4 | 81a9bad418fce5449b07edc12e188f946310ad4c | refs/heads/master | 2020-06-13T08:13:56.485803 | 2019-09-18T01:29:13 | 2019-09-18T01:29:13 | 194,596,880 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 680 | py | pratice.py | class SoccerPlayer(object):
def __init__(self,name,position,back_number):
self.name=name
self.position=position
self.back_number=back_number
def change_back_number(self,new_number):
print("선수의 등번호를 변경합니다. : From %d to %d"%(self.back_number,new_number))
self.back_numb... |
c49a400c37ce7a0789daa7a052c181c270ab2e95 | 1e74b45517a4cf8df4e4648da53fb97b547d294f | /src/sampleproject/settings.py | 2b6b1886b8323e653f0b9988586bc360bdb1f095 | [] | no_license | nrolland/sweetness | 1940010a0dcc083e3cd129352c1925071386ce15 | 3bcb5595c13932ac2fed159e29310a671f5c10c8 | refs/heads/master | 2020-05-31T13:32:46.209157 | 2010-09-25T19:46:06 | 2010-09-25T19:46:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 564 | py | settings.py | import os.path
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = os.path.join(os.path.dirname(__file__), "sqlite3.db")
DATABASE_USER = ''
DATABASE_PASSWORD = ''
DATABASE_HOST = 'localhost'
DEBUG = True
INSTALLED_APPS = (
'sampleapp',
'django.contrib.auth',
'django.contrib.contenttypes',
)
ROOT_URLCONF = 'samp... |
5ade7b4b9b51de9b0d20de5c8f5509a812229fce | be4459658d667c47eefeeb3cf689a678042edb94 | /modules/core/mano/rwlaunchpad/plugins/rwvns/rift/topmgr/mock.py | 25c30a8a47d337524387f38c6cb3ea98d6f83e07 | [
"Apache-2.0"
] | permissive | kparr/RIFT.ware-1 | 7945174aa23ac1f7d74a7464b645db5824982fc3 | 6846108d70b80b95c5117fdccd44ff058ac605be | refs/heads/master | 2021-01-13T08:36:03.751610 | 2016-07-24T21:36:15 | 2016-07-24T21:36:15 | 72,420,438 | 0 | 0 | null | 2016-10-31T09:11:27 | 2016-10-31T09:11:27 | null | UTF-8 | Python | false | false | 716 | py | mock.py |
#
# (c) Copyright RIFT.io, 2013-2016, All Rights Reserved
#
import mock
import gi
gi.require_version('RwcalYang', '1.0')
from gi.repository import RwcalYang
from . import core
import logging
logger = logging.getLogger('rwsdn.mock')
class Mock(core.Topology):
"""This class implements the abstract methods in ... |
15e69afb33ebd9ac349b0116075d4ac4ffbd7673 | ac637632106b7a7d36c8eac9a9b9dcf0ce123802 | /datastructure_260621270.py | 2201be0b623d535294ba90bc497617e2d7b4389d | [] | no_license | jakezhuyi/COMP321_Assignments | 7a9ad4057b5ffd7d25fc0b6a6cbdf09c962e63c2 | 2db1bd1954d6fcb2b396525552645af3cdf47774 | refs/heads/main | 2023-02-14T04:37:33.652763 | 2021-01-13T03:08:37 | 2021-01-13T03:08:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,610 | py | datastructure_260621270.py | from sys import stdin
queue = []
stack = []
pri_queue = []
queue_status = True
stack_status = True
pri_queue_status = True
# checks to see if list is empty
# and if the element matches
def removeTup(line, queue_status, stack_status, pri_queue_status):
tup = line.split()
if(queue_status == True):
if(len(queue) ... |
7ab370988c77edb7e5bd57275df0af1c8b9d9a6a | 1279c1d605ab5cca2fb0089bc22f03ac42e50eba | /database/btreedb_test.py | 5aa90db788230e79eacdda01b9acc54a16fc7015 | [] | no_license | manuzagra/esp32-IMU_streamer | 50046d34aec2fb6404d0035ee41559baf8b98467 | f1bd5624bc5e29c2926e883aac1dda03e45fcba7 | refs/heads/master | 2022-09-08T23:54:52.017413 | 2020-05-30T10:55:41 | 2020-05-30T10:55:41 | 266,903,174 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,510 | py | btreedb_test.py | def test():
import os
from database.btreedb import BtreeDB
db = BtreeDB('test.db')
db['one'] = 'one'
db['two'] = 2
db[3] = 'three'
db['four'] = ['foo', 'bar']
db.put(5,{'first': 1, 'second': 2})
db.flush()
db.close()
db.open('test.db')
print('####################')
... |
39c168e2575c27a0057bcb871d5adce7282a75be | 31c9c1f5d22e09b4836dbd82ae2c55dccb3dc027 | /6_Learning_Pytorch_with_examples.py | 0319f6962c23093bb3bce25aa9b06f800af5e308 | [] | no_license | amazingzby/pytorch_tutorial | 26e752e0b120d29fdbb77793a7e25ea875fc7c05 | 4fa675429e4b3bdfc81789ba0434816c5406432c | refs/heads/master | 2020-06-22T12:27:39.802669 | 2019-08-02T10:42:06 | 2019-08-02T10:42:06 | 197,714,975 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 656 | py | 6_Learning_Pytorch_with_examples.py | #使用numpy构建一个简单的神经网络
import numpy as np
N,D_in,H,D_out = 64,1000,100,10
x = np.random.randn(N,D_in)
y = np.random.randn(N,D_out)
w1 = np.random.randn(D_in,H)
w2 = np.random.randn(H,D_out)
learning_rate = 1e-6
for t in range(500):
h = x.dot(w1)
h_relu = np.maximum(h,0)
y_pred = h_relu.dot(w2)
loss = ... |
f0c9637ff3f703d7849d2e80c4887d03b5d5b926 | a8062308fb3bf6c8952257504a50c3e97d801294 | /test/test_1442_count_triplets_that_can_form_two_arrays_of_equal_xor.py | b5018ea34859e06c7e627a5081686a144d5b484e | [] | no_license | wan-catherine/Leetcode | 650d697a873ad23c0b64d08ad525bf9fcdb62b1b | 238995bd23c8a6c40c6035890e94baa2473d4bbc | refs/heads/master | 2023-09-01T00:56:27.677230 | 2023-08-31T00:49:31 | 2023-08-31T00:49:31 | 143,770,000 | 5 | 0 | null | null | null | null | UTF-8 | Python | false | false | 673 | py | test_1442_count_triplets_that_can_form_two_arrays_of_equal_xor.py | from unittest import TestCase
from problems.N1442_Count_Triplet_That_Can_Form_Two_Arrays_Of_Equal_XOR import Solution
class TestSolution(TestCase):
def test_countTriplets(self):
self.assertEqual(4, Solution().countTriplets([2,3,1,6,7]))
def test_countTriplets_1(self):
self.assertEqual(10, Solu... |
25355e903c11165a7f31c74ca5b5c55271e4043c | fca28ff25b17d3f613c3684e918c1d6194119b0c | /scraping/irs_tables/zip/spiders/test.py | 1964b7f0377bfa1c3010ba52b2c297099b1d40da | [
"Apache-2.0"
] | permissive | Algomorph/nyc-data-exploration | 8b8d41f7ee6f409f6e020ff0e20c3b3c10295ece | 672dccf808642803ad066b95aea16d89ae540a0c | refs/heads/master | 2021-06-05T18:40:39.219794 | 2018-05-09T20:41:30 | 2018-05-09T20:41:30 | 13,310,472 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 188 | py | test.py | f = open("zips.txt")
myZips = [ url for url in f.readlines()]
myUrls = [ 'http://www.melissadata.com/lookups/TaxZip.asp?Zip='
+ z.strip() +
'&submit1=Submit' for z in myZips]
print myUrls |
4b4ec2e4ad7b809310af869b3af2a99fbdb51cdd | 9ac4085392620d7ee669f2972990e71616b82618 | /闭包和装饰器/01-闭包.py | 864bae7a3c132e57a49a2d784de048dd687afdcb | [] | no_license | julienwang1980/test | 2f855a1cdb92a10444708a2e4bcea06660d8a44f | d73c3d6029e255529220e5fb62ec25734aa0af25 | refs/heads/master | 2023-04-08T09:46:37.896344 | 2021-04-16T09:52:07 | 2021-04-16T09:52:07 | 322,144,203 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 751 | py | 01-闭包.py | # 闭包的作用:可以保存外部函数的变量
# 闭包的形成体哦阿健
# 1. 函数嵌套
# 2. 内部函数使用了外部函数的变量或者参数
# 3. 外部函数返回内部函数,这个使用了外部函数变量的内部函数称为闭包
# 1. 函数嵌套
def func_out():
# 外部函数
num1 = 10;
def func_inner(num2):
# 内部函数
# 2. 内部函数必须使用了外部函数的变量
result = num1 + num2;
print("结果:", result)
# 3. 外部函数要返回内部函数,这个使用了外部函数变... |