blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 288 | content_id stringlengths 40 40 | detected_licenses listlengths 0 112 | license_type stringclasses 2
values | repo_name stringlengths 5 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 684
values | visit_date timestamp[us]date 2015-08-06 10:31:46 2023-09-06 10:44:38 | revision_date timestamp[us]date 1970-01-01 02:38:32 2037-05-03 13:00:00 | committer_date timestamp[us]date 1970-01-01 02:38:32 2023-09-06 01:08:06 | github_id int64 4.92k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-04 01:52:49 2023-09-14 21:59:50 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-21 12:35:19 ⌀ | gha_language stringclasses 147
values | src_encoding stringclasses 25
values | language stringclasses 1
value | is_vendor bool 2
classes | is_generated bool 2
classes | length_bytes int64 128 12.7k | extension stringclasses 142
values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 132 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d289d25acaf78e7bb51c689c1de4b4495a3bbd9a | 244ecfc2017a48c70b74556be8c188e7a4815848 | /res/scripts/client/gui/scaleform/daapi/view/lobby/fortifications/fortdisabledefenceperiodwindow.py | d81f15c0ee94a51d408d7c2853b5cbd29a9df04e | [] | no_license | webiumsk/WOT-0.9.12 | c1e1259411ba1e6c7b02cd6408b731419d3174e5 | 5be5fd9186f335e7bae88c9761c378ff5fbf5351 | refs/heads/master | 2021-01-10T01:38:36.523788 | 2015-11-18T11:33:37 | 2015-11-18T11:33:37 | 46,414,438 | 1 | 0 | null | null | null | null | WINDOWS-1250 | Python | false | false | 4,109 | py | # 2015.11.18 11:54:00 Střední Evropa (běžný čas)
# Embedded file name: scripts/client/gui/Scaleform/daapi/view/lobby/fortifications/FortDisableDefencePeriodWindow.py
import BigWorld
from adisp import process
from gui import SystemMessages
from gui.Scaleform.daapi.view.lobby.fortifications.fort_utils.FortSoundController... | [
"[email protected]"
] | |
1d6d89dd402a1014ea003cc594770dd2a2538c49 | 6203b9132af8f78c6cb12242bd223fa17d14f31e | /leetcode/problems/556.py | 82b5c6ed99fea3e9b4e3d051b24c25cb28c78248 | [] | no_license | joshuap233/algorithms | 82c608d7493b0d21989b287a2e246ef739e60443 | dc68b883362f3ddcfb433d3d83d1bbf925bbcf02 | refs/heads/master | 2023-08-23T12:44:42.675137 | 2021-09-28T02:37:01 | 2021-09-28T02:37:01 | 230,285,450 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 686 | py | # https://leetcode-cn.com/problems/next-greater-element-iii/
# 556. 下一个更大元素 III
class Solution:
"""与下一个字典序的写法一样"""
MAXI = 2 ** 31 - 1
def nextGreaterElement(self, n: int) -> int:
if n <= 9:
return -1
s = list(str(n))
for i in range(len(s) - 2, -1, -1):
if... | [
"[email protected]"
] | |
99ccf909e1b7071804da551122f2a3d7c85bb020 | de24f83a5e3768a2638ebcf13cbe717e75740168 | /moodledata/vpl_data/192/usersdata/273/70732/submittedfiles/al6.py | 62617a79d4eba687c0a500c294d12922ab0a48f2 | [] | 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 | 185 | py | # -*- coding: utf-8 -*-
i= 2
c= 0
n= int(input('digite o valor de n: '))
while(i<n):
if (n%i)==0:
c=c+1
print(i)
i=i+1
if i==0
print(' primo')
if i>0
print('NAO PRIMO')) | [
"[email protected]"
] | |
6ec95f89ce993de65e468f212786248298f66665 | f07a42f652f46106dee4749277d41c302e2b7406 | /Data Set/bug-fixing-5/d79b6c84068e6f5fe995a74e39cd3f63d86bb294-<parse_lldp_intf>-bug.py | ddbc6fc1aa3322f069ebbc9cb05db83582c1618e | [] | no_license | wsgan001/PyFPattern | e0fe06341cc5d51b3ad0fe29b84098d140ed54d1 | cc347e32745f99c0cd95e79a18ddacc4574d7faa | refs/heads/main | 2023-08-25T23:48:26.112133 | 2021-10-23T14:11:22 | 2021-10-23T14:11:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 134 | py | def parse_lldp_intf(self, data):
match = re.search('Interface:\\s*(\\S+)', data, re.M)
if match:
return match.group(1) | [
"[email protected]"
] | |
7a63e1a4a6717671c7176bf91eda13961f655536 | 99094cc79bdbb69bb24516e473f17b385847cb3a | /72.Edit Distance/Solution.py | 11b4f12f5ee723dcde3137a39b89d6242e6e0462 | [] | no_license | simonxu14/LeetCode_Simon | 7d389bbfafd3906876a3f796195bb14db3a1aeb3 | 13f4595374f30b482c4da76e466037516ca3a420 | refs/heads/master | 2020-04-06T03:33:25.846686 | 2016-09-10T00:23:11 | 2016-09-10T00:23:11 | 40,810,940 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 696 | py | __author__ = 'Simon'
class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
dp = [[0 for j in range(len(word2)+1)] for i in range(len(word1)+1)]
for j in range(len(word2)+1):
dp[0][j] = j
... | [
"[email protected]"
] | |
f41bb0f627ed6d8f5fd7b2f6953ef836320c19d9 | 9b68695d6d7d05bdfdcb087db532d66188cfbcdb | /bsmsm/spiders/spider.py | 67165b7f5f3a4693d22e7d719589e6d28ffc76e2 | [] | no_license | hristo-grudev/bsmsm | 1f100180535b564cd8ca59fd62b35de4cf25b460 | e7035250b07e21e25299967eee065ea588369857 | refs/heads/main | 2023-03-13T13:13:48.075506 | 2021-03-05T08:32:08 | 2021-03-05T08:32:08 | 344,745,104 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 985 | py | import scrapy
from scrapy.loader import ItemLoader
from ..items import BsmsmItem
from itemloaders.processors import TakeFirst
class BsmsmSpider(scrapy.Spider):
name = 'bsmsm'
start_urls = ['https://www.bsm.sm/it/news-bsm.php']
def parse(self, response):
post_links = response.xpath('//div[@class="titolo-news bo... | [
"[email protected]"
] | |
5c77958a70db3fdb38303d8bf678113803c62984 | d57b51ec207002e333b8655a8f5832ed143aa28c | /.history/gos_20200614055443.py | e65771e72edd5ad03a64cf83c5b0bcf4ef404048 | [] | no_license | yevheniir/python_course_2020 | b42766c4278a08b8b79fec77e036a1b987accf51 | a152d400ab4f45d9d98d8ad8b2560d6f0b408c0b | refs/heads/master | 2022-11-15T07:13:24.193173 | 2020-07-11T15:43:26 | 2020-07-11T15:43:26 | 278,890,802 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,414 | py | # # Імпорт фажливих бібліотек
# from BeautifulSoup import BeautifulSoup
# import urllib2
# import re
# # Створення функції пошуку силок
# def getLinks(url):
# # отримання та присвоєння контенту сторінки в змінну
# html_page = urllib2.urlopen(url)
# # Перетворення контенту в обєкт бібліотеки BeautifulSoup
#... | [
"[email protected]"
] | |
abe78bc49b85c74a1b2f4932b3ed2e0bab37eb16 | ffa21e4415ead5106f7f846bc24b0d308ace90b5 | /swagger_client/models/forecast_transaction.py | be10b2bc4700700721d9092cecf9dddd1c89aefa | [] | no_license | steini58/swagger-client | fa7b6f077e5a1b01e42c4420b214b19e1d364e4e | e5fd7bf28f8529746e18bdd799c86ad78310ffd5 | refs/heads/master | 2020-03-29T09:14:26.644065 | 2018-09-20T13:29:14 | 2018-09-20T13:29:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,665 | py | # coding: utf-8
"""
[AHOI cookbook](/ahoi/docs/cookbook/index.html) [Data Privacy](/sandboxmanager/#/privacy) [Terms of Service](/sandboxmanager/#/terms) [Imprint](https://sparkassen-hub.com/impressum/) © 2016‐2017 Starfinanz - Ein Unternehmen der Finanz Informatik # noqa: E501
OpenAPI sp... | [
"[email protected]"
] | |
55d5457523106be301584f485d2044be5c180be7 | ed32eb1eb0a328a4ffe89e178fc4987470f333cd | /exercise/day1-4/compute.py | 7e64771516f775b9bee62dbd5f5d8fe460b8b9c5 | [] | no_license | xiaoyaojjian/py_learn | c6f5bdf31bcebf29dd914e81e6be9305a61265cc | 95e494ea823d2074a05c1c2a49595002a1576093 | refs/heads/master | 2020-12-05T23:22:11.017066 | 2016-09-08T01:13:08 | 2016-09-08T01:13:08 | 67,654,055 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 445 | py | """
计算器, 用了eval() 没有任何意义了, 四则运算应该单独写一个函数处理
"""
import re
a = '1 - 2 * ( (60-30 +(-40/5) * (9-2*5/3 + 7 /3*99/4*2998 +10 * 568/14 )) - (-4*3)/ (16-3*2) )'
print(eval(a))
def get_brackets_data(formula):
return re.findall('\(([^()]+)\)', formula)
while re.search('[()]', a):
for i in get_brackets_data(a):
... | [
"[email protected]"
] | |
4577eaed8369402971817fc693acae6518a09f80 | bd81142f05e57b637cc0ddd63edbc3c6b5b4a0a2 | /knowledge-driven-dialogue/generative_pt/tools/conversation_client.py | 598d22bca00ebba8dd12eac1105b2e8df08d391f | [
"MIT"
] | permissive | Chriszhangmw/ChatBots | 876d751f30d1d8ea759440fe1e7d4beb6ef94087 | 0735918e326bd6ff20b70388ae199ec11d9cbc11 | refs/heads/master | 2021-12-14T04:10:53.452552 | 2021-11-28T12:23:10 | 2021-11-28T12:23:10 | 210,681,028 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,061 | py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved
#
################################################################################
"""
File: conversation_client.py
"""
import sys
i... | [
"[email protected]"
] | |
cd7536fbdfbd4277136ae6edaee967cd1d86ab18 | 60618d48e09a140926d97b01cb9b6f76fcc65703 | /data analysis/itheima/plot.py | 6a18b4bded99c6dbf7247578045daa0392a6d27a | [] | no_license | Incipe-win/Python | ca8f36cc8785eb13512f71a3cf10149d4e1b855e | 5bab36b90591c74dedb6ead3484a279b90a1bcbd | refs/heads/master | 2021-01-07T08:11:42.293541 | 2020-12-06T09:17:02 | 2020-12-06T09:17:02 | 241,629,236 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,102 | py | from matplotlib import pyplot as plt
import random
from matplotlib import font_manager
my_font = font_manager.FontProperties(
fname="/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc")
# import matplotlib
#
# font = {"family": "Noto Sans Mono",
# "weight": "bold",
# "size": "larger"
# }
... | [
"[email protected]"
] | |
40d6ad7c3c49e310f10e435aee22d2aa9b19a03c | 68eb441faf3f9415fbcbc8330f9b01ad6933bede | /ebook/machinelearningdemo/MachineLearningLessonPro/ML_1/3.0loadfile_fromdata.py | 1711ef93a3ae8eea6d78e080a3ca39a2781775f4 | [] | no_license | OrriO/jupyter_myworkspace | fb8e97865f15abe2fb3aa01985fdb4f34317f15f | a592ab92f38a1cd466c454bb36fd0002c75202a9 | refs/heads/master | 2023-06-01T02:00:36.986439 | 2021-07-08T13:44:26 | 2021-07-08T13:44:26 | 381,997,768 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 784 | py | #-*- coding: utf-8 -*-
# @Time : 2018/12/6 10:08
# @Author : Z
# @Email : S
# @File : 3.0loadfile_fromdata.py
from surprise import BaselineOnly
from surprise import Dataset
from surprise import Reader
from surprise.model_selection import cross_validate
import os
# path to dataset file
file_path = os.path.expa... | [
"[email protected]"
] | |
ed6019a55cbe49b15e4cbe71343c9ea879f3e984 | bd14c979335112b7718b0feda18ebf0e3b40fe5c | /arihon_biginners/review_of_binsearch.py | 3ae4f4958eb3c9ebc42c27e83fb5e6cc36c26f9e | [] | no_license | ababa831/atcoder_beginners | 22c57b15333d110126d1b1afadc0ff5e8784fc4f | 1a30882ce7f20f312045d5dc7bfaa5688cc8a88e | refs/heads/master | 2023-03-07T15:47:19.750682 | 2020-03-04T19:53:45 | 2020-03-04T19:53:45 | 143,360,607 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 413 | py | # Review of a simple bit search algorithm
D = 3
print('Number of digit', D)
combinations = []
for i in range(1 << D):
flaged = []
for j in range(D):
if (i >> j) & 1:
flaged.append(j + 1)
print('Binary {} has flags at digit {}'.format(bin(i), flaged))
combinations.append(flaged)
pri... | [
"[email protected]"
] | |
195b5b5bf3d61d63758c2c4cdb7d1942a70e832d | 3f5d531abcf69bc9f7de317ce46d45786272013d | /src/config/test/test_default.py | 7711ddcd42e45b5fc7232a940a9bceb55d370e5a | [
"MIT"
] | permissive | thak123/i-tagger | 61a8880e250069fc40c0a616e718a739bd27cb58 | dd8502947011e95b72b243fad9aad094b9a7d15c | refs/heads/master | 2021-05-14T16:51:20.799677 | 2018-01-02T12:09:36 | 2018-01-02T12:09:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 477 | py | import unittest
from helpers.config_helper import *
from config.default import create_default_config
class TestDefault(unittest.TestCase):
def test_creation(self):
config_helper = ConfigManager("/tmp/config.ini")
if not os.path.exists("/tmp/config.ini"):
create_default_config(config_h... | [
"[email protected]"
] | |
17af632bafeab7fe05ec6df418b301f86f74b0cb | 582df95fc9b1d00e6c75321ad6a7894e0722245e | /tests/test_download_model.py | 34baadec66352e161086017e45cd3ea66aadfa94 | [
"Apache-2.0"
] | permissive | viniarck/podcaststore-django | 2c4db217126e3dbdf1244bb22ae1aea0cd502874 | 90316ffb18793b089291a0e28ac3ee2bb5e458cb | refs/heads/master | 2020-06-29T13:16:18.449358 | 2019-12-05T11:44:34 | 2019-12-05T11:44:34 | 200,547,759 | 0 | 0 | Apache-2.0 | 2020-06-05T22:33:18 | 2019-08-04T22:29:38 | Python | UTF-8 | Python | false | false | 828 | py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from podcaststore_api.models.download import Download, DownloadSerializer
class TestDownloadModel:
"""TestDownloadModel."""
@pytest.mark.django_db
def test_repr(self, create_download: Download) -> None:
"""Test __repr__ method."""
... | [
"[email protected]"
] | |
a161c21ea948b07a05375c924672731065a639c1 | 2e682fd72e3feaa70e3f7bf2a3b83c50d783ec02 | /PyTorch/dev/cv/detection/YOLOX_ID2833_for_PyTorch/tests/test_models/test_dense_heads/test_yolact_head.py | 11b74a3b9a7c7d2bae8547cf62e2ad4fdb73cec3 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference",
"GPL-1.0-or-later"
] | permissive | Ascend/ModelZoo-PyTorch | 4c89414b9e2582cef9926d4670108a090c839d2d | 92acc188d3a0f634de58463b6676e70df83ef808 | refs/heads/master | 2023-07-19T12:40:00.512853 | 2023-07-17T02:48:18 | 2023-07-17T02:48:18 | 483,502,469 | 23 | 6 | Apache-2.0 | 2022-10-15T09:29:12 | 2022-04-20T04:11:18 | Python | UTF-8 | Python | false | false | 5,894 | py |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | [
"[email protected]"
] | |
78a9d21635b3b2f9d4282deb74507c8b86a89628 | ea2015881c18583a4295122f2e2c1d2dbd3e32f9 | /_pipeline_scripts/script_6.4.3_ps_prot_pairDave.py | 6b12ef0ebf30ba4e369c2c941843af7dcdf42b21 | [] | no_license | panchyni/PseudogenePipeline | ad0b210d943bfdc83da1eeb63c0d7dec2a8719ae | 44a5bfd034dfd9b21808b6e6c5b789f141912c33 | refs/heads/master | 2021-01-11T15:54:57.514872 | 2017-04-17T21:13:16 | 2017-04-17T21:13:16 | 79,955,253 | 4 | 2 | null | null | null | null | UTF-8 | Python | false | false | 651 | py |
import sys
print "Read protein sequence file..."
inp = open(sys.argv[1])
inl = inp.readlines()
p = {}
for i in inl:
if i[0] == ">":
g = i[1:-1].split(".")
if g[0] not in p:
p[g[0]] = [g[1]]
else:
p[g[0]].append(g[1])
print "Read pair file..."
inp = open(sys.argv[2]) # osv5_ps_gene.pairs
oup = ope... | [
"panchyni.msu.edu"
] | panchyni.msu.edu |
a07caa95edb7398b9588e8dbf134ba5d00978be0 | 977073b97242b8bf48b49e145395d8d948890924 | /experiments/run_submission.py | 0aaa1722561252ba0e1393e56e7ad046f830a6f5 | [] | no_license | upura/booking-challenge-2021 | c80e88f8545ae1b5b8e3d9da3bac49f3ea982ee5 | 7b6daa2fabd28773cc452cd6605861372ea64d78 | refs/heads/master | 2023-03-03T16:22:45.258906 | 2021-02-17T20:36:06 | 2021-02-17T20:36:06 | 325,207,679 | 10 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,768 | py | import gc
import numpy as np
import pandas as pd
from sklearn import preprocessing
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from src.datasets import load_train_test, BookingDataset
from src.models import BookingNN
from src.utils import seed_everything
from src.runner import CustomRun... | [
"[email protected]"
] | |
263f9d74b0c56b54ae61b705fc78e35537aa37aa | 1bdf38834c22b0100595cb22f2862fd1ba0bc1e7 | /code394DecodeString.py | 6498e6f8c2f6d46d2cadc4e51089b069f52ef7bd | [] | no_license | cybelewang/leetcode-python | 48d91c728856ff577f1ccba5a5340485414d6c6e | 635af6e22aa8eef8e7920a585d43a45a891a8157 | refs/heads/master | 2023-01-04T11:28:19.757123 | 2020-10-29T05:55:35 | 2020-10-29T05:55:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,120 | py | """
394 Decode String
Given an encoded string, return it's decoded string.
The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.
You may assume that the input string is always valid; N... | [
"[email protected]"
] | |
2542635ffe3127c2fbac935e327705fd7fcb674b | cc7bbdbb22cb6f7e7916388a5ee8218bc8ffa158 | /Python3/Tornado/apps/pg/PG_Client/clientadmin/utils.py | 971af7cb5a0d2998e2e927d20769b4a5cd027213 | [
"MIT"
] | permissive | youngqqcn/QBlockChainNotes | a816e067642f48a6da38b624663254b4016ec496 | c9c143eaba6c06e3cee866669ec286e4d3cdbba8 | refs/heads/master | 2023-04-03T23:31:05.585545 | 2023-03-30T09:29:07 | 2023-03-30T09:29:07 | 155,657,459 | 37 | 15 | MIT | 2023-03-06T23:09:32 | 2018-11-01T03:33:11 | JavaScript | UTF-8 | Python | false | false | 1,574 | py |
def jwt_response_payload_handler(token, user=None, request=None):
"""
自定义jwt认证成功返回数据
:token 返回的jwt
:user 当前登录的用户信息[对象]
:request 当前本次客户端提交过来的数据
"""
if user.username != None:
return {
'code': "fail",
"status": 200,
"data": {
... | [
"[email protected]"
] | |
616481b2e75063bd42b700b4baac1bdbbd6f92b1 | 1804187f39dd6004250933b35ba9ce24297f32a5 | /car_importclass.py | 860b39b3d9c08872ea8be65c07d26f6029ef9c66 | [] | no_license | xiaomengxiangjia/Python | ecd2e3e8576364f15482669cb75b52b8790543f5 | 7f52a33d7956068d26347cf34d35c953b945a635 | refs/heads/master | 2020-03-20T23:01:09.981928 | 2018-08-23T09:04:53 | 2018-08-27T05:46:38 | 137,825,481 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,242 | py | """一个可用于表示汽车的类"""
class Car():
"""一次模拟汽车的简单尝试"""
def __init__(self, make, model, year):
"""初始化描述汽车的属性"""
self.make = make
self.model = model
self.year = year
self.odometer_reading = 0
def get_descriptive_name(self):
"""返回整洁的描述性名称"""
long_name ... | [
"[email protected]"
] | |
276bccd4f16fb7b435ac61d0da296658d2a152fd | 97ae427ff84c9b0450ed709dc55e1cc0e1edc096 | /til/future_til/class_level_operators.py | 02723ea43b703bfd62523ad8737ad110b21d2a4e | [] | no_license | OaklandPeters/til | 9081ac8b968223f4c92b38cf20cda90c92966628 | 12a1f7623916709211686d7817b93c7ef4d532d2 | refs/heads/master | 2021-01-17T14:16:48.285244 | 2016-06-20T14:23:40 | 2016-06-20T14:23:40 | 51,449,450 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,586 | py | """
This has not been made into a TIL in til/python yet, because...
it does not work correctly atm.
However, I'm reasonably sure I can get it to work (since I've got type-level operatores to work in the past)
"""
#
# Class-level operators
#--------------------------
# Requires metaclasses
# To make this work with i... | [
"[email protected]"
] | |
b0e3a882a9cb2bf2f6a1e29d61545ed83bc64a05 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02882/s441562654.py | 2251e4e406faa3b13c7d32923f7711a41c800a0e | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 171 | py | a, b, x = map(int, input().split())
if x > (a**2)*b/2:
t = 2*((a**2)*b-x)/(a**3)
else:
t = a*(b**2)/(2*x)
import math
ans = math.degrees(math.atan(t))
print(ans)
| [
"[email protected]"
] | |
7eae7b743e1fdb51757eab7546ee206614610ba1 | 43b4cabe8b711d9eb6988a17d0914cf95ac1c5a1 | /Lesson-2/7_BookmarkServer/BookmarkServer.py | b42fd8ceecfd9c42216f26e2953ac331e00dca63 | [] | no_license | fatih-iver/course-ud303 | c9aae321336c8e0b3ed1e671338cc993d04dc34b | 64d2107891cc24d303dffb98216a72505eeeb217 | refs/heads/master | 2020-03-24T21:57:30.923020 | 2018-08-04T11:50:20 | 2018-08-04T11:50:20 | 143,059,407 | 0 | 0 | null | 2018-07-31T19:40:50 | 2018-07-31T19:40:49 | null | UTF-8 | Python | false | false | 5,827 | py | #!/usr/bin/env python3
#
# A *bookmark server* or URI shortener that maintains a mapping (dictionary)
# between short names and long URIs, checking that each new URI added to the
# mapping actually works (i.e. returns a 200 OK).
#
# This server is intended to serve three kinds of requests:
#
# * A GET request... | [
"[email protected]"
] | |
759f2892a4b03efd81ece2f4d33a6eba2ba16139 | 5e84763c16bd6e6ef06cf7a129bb4bd29dd61ec5 | /blimgui/dist/OpenGL/raw/GLX/MESA/query_renderer.py | 072891b41d9ef525470951c92ec96a668f34048f | [
"MIT"
] | permissive | juso40/bl2sdk_Mods | 8422a37ca9c2c2bbf231a2399cbcb84379b7e848 | 29f79c41cfb49ea5b1dd1bec559795727e868558 | refs/heads/master | 2023-08-15T02:28:38.142874 | 2023-07-22T21:48:01 | 2023-07-22T21:48:01 | 188,486,371 | 42 | 110 | MIT | 2022-11-20T09:47:56 | 2019-05-24T20:55:10 | Python | UTF-8 | Python | false | false | 2,034 | py | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLX import _types as _cs
# End users want this...
from OpenGL.raw.GLX._types import *
from OpenGL.raw.GLX import _errors
from OpenGL.constant import Constant as _C
import ctype... | [
"[email protected]"
] | |
a585065a3adc8bc699bf8ba1c78b67358d1ea23c | c99c272181eb43df688cc6af10bfb17659014ab9 | /03_ОOP-Python/01-Defining Classes/02_Exercise/07_GuildSystem/project/venv/Scripts/easy_install-script.py | 479119ad1bbdbfaf2e56c4f7f55eb619444da6c2 | [] | no_license | LachezarKostov/SoftUni | ce89d11a4796c10c8975dc5c090edecac993cb03 | 47559e9f01f7aabd73d84aa175be37140e2d5621 | refs/heads/master | 2023-01-29T20:49:57.196136 | 2020-12-10T12:34:09 | 2020-12-10T12:34:09 | 283,491,508 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 508 | py | #!"C:\Users\dream\Desktop\Python\OP-Python\01-Defining Classes\02_Exercise\07_GuildSystem\project\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ =... | [
"[email protected]"
] | |
d518f64f0bbd5273253b9da996adb85350151238 | 730a0291d90bf220d162791287e422bc4225d164 | /samples/StackResult/fsmpy/StackSynchronized.py | ce716b3963340b6d02b4f30ab46f82112d7579f6 | [
"BSD-3-Clause"
] | permissive | jon-jacky/PyModel | 27442d062e615bd0bf1bd16d86ae56cc4d3dc443 | 457ea284ea20703885f8e57fa5c1891051be9b03 | refs/heads/master | 2022-11-02T14:08:47.012661 | 2022-10-16T09:47:53 | 2022-10-16T09:47:53 | 2,034,133 | 75 | 36 | NOASSERTION | 2021-07-11T21:15:08 | 2011-07-12T04:23:02 | Python | UTF-8 | Python | false | false | 1,026 | py |
# pma.py Stack StackOneScenario -m 6 -o StackSynchronized
# 4 states, 6 transitions, 4 accepting states, 0 unsafe states, 0 finished and 0 deadend states
# actions here are just labels, but must be symbols with __name__ attribute
def Push(): pass
def Pop(): pass
# states, key of each state here is its number in gra... | [
"[email protected]"
] | |
a914ff8c2d0018797ec75f0eb379efac9c21abef | c0a5ff5f77943a9529512e6b27148f3318ab5264 | /vowels2.py | 9fe9e3f321664f0f5ebedae52821be5fdb7ac104 | [] | no_license | smatthewenglish/head_first_python | b15cc7260fa6607759778ac37d86006f803462a9 | 6e783ce541d5462fb2f84cc901c713fcf5895240 | refs/heads/master | 2023-03-28T14:50:16.857613 | 2021-03-31T16:41:14 | 2021-03-31T16:41:14 | 350,149,656 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 287 | py | vowels = ['a', 'e', 'i', 'o', 'u']
#word = "Milliways"
word = input("Provide a word to search for vowels: ")
found = []
for letter in word:
if letter in vowels:
#print(letter)
if letter not in found:
found.append(letter)
for vowel in found:
print(vowel)
| [
"[email protected]"
] | |
bf7cccfc45cdf2461987920d5a0b5fcb107fe227 | 5488617b1b05c436b1f8c8642ea75ca754719f8d | /TW_study/LimitCode/tW_measurment/mlfitNormsToText.py | 7cbfc9933869090ddc8caf40ffac104930662672 | [] | no_license | wenxingfang/TW_Top | fdb1ba136be6ace8fdacaade58cb4ca4fcdc3c9e | 389e76c904d08a59d9141b9b66ec15d2583f8e9a | refs/heads/master | 2021-02-05T06:54:27.908688 | 2020-02-28T13:24:00 | 2020-02-28T13:24:00 | 243,754,087 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 2,037 | py | import re
from sys import argv, stdout, stderr, exit
# import ROOT with a fix to get batch mode (http://root.cern.ch/phpBB3/viewtopic.php?t=3198)
argv.append( '-b-' )
import ROOT
ROOT.gROOT.SetBatch(True)
argv.remove( '-b-' )
if len(argv) == 0: raise RuntimeError, "Usage: mlfitNormsToText.py [ -u ] mlfit.root";
erro... | [
"[email protected]"
] | |
234f9d0be069bd885e1b1e25db82bd2eb4e0e97e | d765d19f80a6bfed71685838306f2d91f6a5a7dd | /rdt/rdt21.py | 0c2bba984d0b3daf478d990edda454a24d739487 | [] | no_license | EliasFarhan/CompNet | 1f1f83e6babdb688e1d626117cdb50a642a9d2a9 | c95b36c12a7a0a0d0ac5ecdb41e1b227c3973de0 | refs/heads/master | 2021-07-16T20:33:56.803384 | 2020-09-15T18:54:18 | 2020-09-15T18:54:18 | 210,541,643 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,839 | py | from rdt.base import *
from rdt.rdt20 import ChannelRdt20
class SenderRdt21(Sender):
last_packet = ""
sequence_nmb = 1
msg_lock = threading.Lock()
def send_data(self, data, resend=False):
if not resend:
self.msg_lock.acquire()
self.last_packet = data
text_data = da... | [
"[email protected]"
] | |
63a3e633e544e4a017474a3cba78a6c0a93f189b | 17070ea982156a8553c24e2ea3b687fb1dc5544e | /shop/views.py | 02cd002f7c32aecc9a6deff58f0d5b489658af0a | [] | no_license | akiyoko/django-concurrency-sample | 75353fe55e0376e08f2c888b5feb323f9728fc1a | 8b9fd1e04a034cb0d8e6d1915d864b13b1726608 | refs/heads/main | 2023-01-22T10:49:39.375878 | 2020-12-01T05:17:53 | 2020-12-01T05:17:53 | 317,429,697 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,840 | py | import logging
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.db import transaction
# from django.http.response import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.template.response import TemplateResponse
from django.utils.decorators i... | [
"[email protected]"
] | |
c7e0e8f56c9b540a6d37dce314d31c36ea920326 | 27e890f900bd4bfb2e66f4eab85bc381cf4d5d3f | /tests/unit/modules/network/onyx/test_onyx_ospf.py | 665633222c74febcc7f196f3e51d0f6b0b91d4fb | [] | no_license | coll-test/notstdlib.moveitallout | eb33a560070bbded5032385d0aea2f3cf60e690b | 0987f099b783c6cf977db9233e1c3d9efcbcb3c7 | refs/heads/master | 2020-12-19T22:28:33.369557 | 2020-01-23T18:51:26 | 2020-01-23T18:51:26 | 235,865,139 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,664 | py | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.notstdlib.moveitallout.tests.unit.compat.mock impo... | [
"[email protected]"
] | |
317288bb41c5c374236f56788577a76f1c080b9c | 42fe2827d14a82043ade9393beaedf53e22a69f5 | /bebop_ws/devel/.private/bebop_msgs/lib/python2.7/dist-packages/bebop_msgs/msg/_CommonCommonStateCurrentDateChanged.py | 55096047d13f8e60d5b3ab4a3aa26cae99d7e236 | [] | no_license | cjbanks/bebop-software-framework | a3714646545e9d7d71299a365814bc87437f5e14 | 7da1bbdef4e84aa0ed793cfaad9fe133959ebe21 | refs/heads/master | 2023-04-30T17:52:23.255302 | 2020-11-18T18:32:41 | 2020-11-18T18:32:41 | 368,626,051 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,233 | py | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from bebop_msgs/CommonCommonStateCurrentDateChanged.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class CommonCommonStateCurrentDateChanged(genpy.Me... | [
"Chewie_Alex@nder1"
] | Chewie_Alex@nder1 |
73c728462aaa1aeb1ff14b80acd3d67f327d7557 | 106983cf0b8df622f514ecff2bb2fa4c794c9dac | /Misc/OpenCV/camshiftTest.py | 5677142b105f693d0656e9845a8b7bfcaa575dc3 | [] | no_license | michael5486/Senior-Design | 2d9ae521c637abf7c0825f85b32752ad61c62744 | 6b6c78bed5f20582a9753a9c10020c709d6b6e53 | refs/heads/master | 2021-01-19T09:58:35.378164 | 2017-05-26T17:17:13 | 2017-05-26T17:17:13 | 67,556,475 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,367 | py | #!/usr/bin/env python
import cv2.cv as cv
import serial
#ser = serial.Serial("/dev/ttyACM0",9600)
def is_rect_nonzero(r):
(_,_,w,h) = r
return (w > 0) and (h > 0)
class CamShiftDemo:
def __init__(self):
self.capture = cv.CaptureFromCAM(0)
cv.NamedWindow( "CamShiftDemo", 1 )
cv.N... | [
"[email protected]"
] | |
47befcf66e46b26472ad8cb956c2fc14284c7c9e | 3794bc772676d34a6794d19eedb41c2d8a7d39c0 | /ge_dqn/monitor.py | 53024700f3b5ca11545565d3ad057f2807cd0141 | [] | no_license | geyang/reinforcement_learning_learning_notes | 3a79af021b6b126e37b09bf1871cfe9852690abe | f862dbf496f7f5d6cb091604dfb808511de5aa9c | refs/heads/master | 2021-08-23T11:32:14.127137 | 2017-12-04T18:28:35 | 2017-12-04T18:28:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 970 | py | from copy import deepcopy
import numpy
def contextify(env):
type(env).__enter__ = lambda s: s
type(env).__exit__ = lambda s, *args: s.close()
return env
def monitor(env):
episode_rewards = []
_step = env.step
def step(action):
s, rew, done, info = _step(action)
episode_rewa... | [
"[email protected]"
] | |
815fb3177d93f4c5b3da4d57786399655d7a5e2b | 493a36f1f8606c7ddce8fc7fe49ce4409faf80be | /.history/B073040023/client_20210614185342.py | 411412020365d07802e69305599262f66838a62f | [] | no_license | ZhangRRz/computer_network | f7c3b82e62920bc0881dff923895da8ae60fa653 | 077848a2191fdfe2516798829644c32eaeded11e | refs/heads/main | 2023-05-28T02:18:09.902165 | 2021-06-15T06:28:59 | 2021-06-15T06:28:59 | 376,568,344 | 0 | 0 | null | 2021-06-13T14:48:36 | 2021-06-13T14:48:36 | null | UTF-8 | Python | false | false | 5,078 | py | import socket
import threading
import tcppacket
import struct
from time import sleep
# socket.socket() will create a TCP socket (default)
# socket.socket(socket.AF_INET, socket.SOCK_STREAM) to explicitly define a TCP socket
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) # explicitly define a UDP socket
udp_h... | [
"[email protected]"
] | |
ac61d410d9419c6949dc2e7bb0e4fd3b37e85afe | 2b7efe276d1dfdc70a4b5cd59ae863b7b7a1bd58 | /euler35.py | 24b79c529bb65377213bed68a3834c21df6f4544 | [] | no_license | mckkcm001/euler | 550bbd126e8d9bb5bc7cb854147399060f865cfc | 8cf1db345b05867d47921b01e8c7e4c2df4ee98d | refs/heads/master | 2021-01-01T17:43:28.799946 | 2017-11-07T02:17:34 | 2017-11-07T02:17:34 | 18,375,089 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 546 | py | import math
n = [2]
def is_prime(n):
if n % 2 == 0 and n > 2:
return False
for i in range(3, int(math.sqrt(n)) + 1, 2):
if n % i == 0:
return False
return True
def is_circ(n):
a = n
for i in range(len(str(n))):
a = 10**(len(str(a))-1)*(a%10)+ a/... | [
"[email protected]"
] | |
320aa009bc8015194f321089be13615ebf99be42 | 8b83d79425985e9c87ff4b641c2dcb6a151f3aa1 | /recipes/templatetags/markdown.py | 75cbd8e9f44234b8d253b147c3548fd001844065 | [] | no_license | akx/pyttipannu | e1366d982bae62a70da24b7da1a93c40efb51217 | 7b02f7d18d594beddb64beb99283c738ca06b8f0 | refs/heads/master | 2021-01-13T09:15:59.086825 | 2016-09-29T13:52:17 | 2016-09-29T13:52:17 | 69,023,828 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 287 | py | from django.template import Library
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from markdown import markdown as render_markdown
register = Library()
@register.filter
def markdown(s):
return mark_safe(render_markdown(force_text(s)))
| [
"[email protected]"
] | |
dfa802d2eab75f6143932b9db16d2742cd829829 | 84ee74894d1e6d76281dd1d3b76ee1dcde0d36b5 | /plotting/visualisePhi.py | 1c7e4c4f7e5da898e37f21b143394c229a9fa1a5 | [] | no_license | pyccel/pygyro | e3f13e5679b37a2dfebbd4b10337e6adefea1105 | a8562e3f0dd8fd56159785e655f017bbcae92e51 | refs/heads/master | 2023-03-10T07:43:17.663359 | 2022-08-17T12:06:25 | 2022-08-17T12:06:25 | 170,837,738 | 4 | 3 | null | 2023-01-02T10:09:08 | 2019-02-15T09:27:22 | Python | UTF-8 | Python | false | false | 2,652 | py | import argparse
from mpi4py import MPI
import numpy as np
from pygyro.model.grid import Grid
from pygyro.model.layout import LayoutSwapper, getLayoutHandler
from pygyro.poisson.poisson_solver import DensityFinder, QuasiNeutralitySolver
from pygyro.utilities.grid_plotter import SlicePlotterNd
from pygyro.initialisation... | [
"[email protected]"
] | |
0f59ddf53e19bb9c1f3b0b8ef1a3e04546cc89e4 | 52b5773617a1b972a905de4d692540d26ff74926 | /.history/brackets_20200810105706.py | e35d818bc5c2a83d99fa7e410edda4e403b93436 | [] | no_license | MaryanneNjeri/pythonModules | 56f54bf098ae58ea069bf33f11ae94fa8eedcabc | f4e56b1e4dda2349267af634a46f6b9df6686020 | refs/heads/master | 2022-12-16T02:59:19.896129 | 2020-09-11T12:05:22 | 2020-09-11T12:05:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 205 | py | def brackets(S):
# "{[()()]}"
stack = []
for i in S:
stack.append(i)
for i in S:
if i == "(" and stack.pop()
print(brackets("{[()()]}"))
| [
"[email protected]"
] | |
5328be94b6b7b5d34270b3276badb49bfb04b4f1 | d886f41ac037343b6b9652977f753808117e6246 | /Behaviors/FK_Relative_Reverse_01.py | 0a1594dbcc59fe2ead208d9d03c6eabe281422a2 | [] | no_license | TPayneExperience/TrevorPaynes_RigAndAnimSuite | 5e918be2de896fdacf2da039815e85b91cf0d7ed | 18e0482ca6d70277b6455d9a14e6b10406f1553f | refs/heads/master | 2023-09-03T04:14:48.862905 | 2021-11-10T02:50:54 | 2021-11-10T02:50:54 | 275,663,064 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,254 | py |
import pymel.core as pm
import Abstracts.Abstract_Behavior as absBhv
import Utilities.Rig_Utilities as rigUtil
import Utilities.Logger as log
class FK_Relative_01(absBhv.Abstract_Behavior):
bhvType = 'FK Relative Reverse'
validLimbTypes = (4,) # rigData.LIMB_TYPES
groupType = 'FKR' # LookAt, IKPV...... | [
"[email protected]"
] | |
10bf94250ae78f7e23d7e6bd2890662625883c6b | 555002c30895a1e2267d05d67d5167275ade3845 | /server/server.py | d2f825a62b33cfc1b7403d77eceaecff86615fcd | [] | no_license | odbite/jkpghack2016 | 159b2938fd8ab7a2a815c664a38c791f2fb440ec | 8b4f5b3ec555f3436f764c2b49927c200ff335a4 | refs/heads/master | 2021-01-10T05:52:52.600618 | 2016-02-27T17:41:07 | 2016-02-27T17:41:07 | 52,673,289 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 559 | py | from animals import AnimalApi
from flask import Flask, render_template
from flask_restful import Api
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
static_folder = os.path.join(BASE_DIR, 'client', 'app', 'dist')
print(static_folder)
app = Flask(__name__, template_folder='../client/app... | [
"[email protected]"
] | |
9f4802a0adb12e9e53c888ddc1d995e8c04f2963 | 82b946da326148a3c1c1f687f96c0da165bb2c15 | /sdk/python/pulumi_azure_native/web/get_static_site_user_provided_function_app_for_static_site.py | f4136b23143201325f3c527173a8c7c478e1d846 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | morrell/pulumi-azure-native | 3916e978382366607f3df0a669f24cb16293ff5e | cd3ba4b9cb08c5e1df7674c1c71695b80e443f08 | refs/heads/master | 2023-06-20T19:37:05.414924 | 2021-07-19T20:57:53 | 2021-07-19T20:57:53 | 387,815,163 | 0 | 0 | Apache-2.0 | 2021-07-20T14:18:29 | 2021-07-20T14:18:28 | null | UTF-8 | Python | false | false | 5,754 | py | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | [
"[email protected]"
] | |
51f1291b2afb40a6c8d8781e7bc461ba3d058225 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03838/s497427946.py | 53bb3ecb9f9567bfcac1e11d066677c406a3138b | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 302 | py | x, y = map(int, input().split())
cnt = 0
diff = abs(x) - abs(y)
if diff == 0:
if x * y < 0:
cnt += 1
elif diff > 0:
cnt += diff
if x > 0:
cnt += 1
if y > 0:
cnt += 1
else:
cnt += -diff
if x < 0:
cnt += 1
if y < 0:
cnt += 1
print(cnt)
| [
"[email protected]"
] | |
83fa096992b60ee9f25862dd01b9c52b2c6c1ea5 | 487ce91881032c1de16e35ed8bc187d6034205f7 | /codes/CodeJamCrawler/16_0_3_neat/16_0_3_JawBone_main.py | 9103e18ea816c4880314a942a1d0134a68bf0711 | [] | no_license | DaHuO/Supergraph | 9cd26d8c5a081803015d93cf5f2674009e92ef7e | c88059dc66297af577ad2b8afa4e0ac0ad622915 | refs/heads/master | 2021-06-14T16:07:52.405091 | 2016-08-21T13:39:13 | 2016-08-21T13:39:13 | 49,829,508 | 2 | 0 | null | 2021-03-19T21:55:46 | 2016-01-17T18:23:00 | Python | UTF-8 | Python | false | false | 1,228 | py | def cpaf(rn):
for divisor in xrange(2, 100):
if not rn % divisor:
return (False, divisor)
return (True, 1)
def baseconverter(rn, basefrom):
digits = "0123456789"
result = ""
while True:
remains = rn % basefrom
result = digits[remains] + result
rn = rn / b... | [
"[[email protected]]"
] | |
e1d28343bba645d8be668da7b073af3541987896 | 383d711b269aa42ec051a8300f9bad8cd3384de8 | /docker/models.py | 718aa7f04973c627897a573e40c8adb538b13cc7 | [] | no_license | Lupino/docker-server | 7af8dab451528704f470a19ae07fbd99afb47435 | 4a199e7e75dcf5ba5161a5373214bb03e8e2cf25 | refs/heads/master | 2021-01-10T19:30:42.888559 | 2014-04-01T07:23:22 | 2014-04-01T07:23:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,867 | py | from docker.conf import prefix
from lee import Model, query, Table, conf as lee_conf
from docker.logging import logger
class _Container(Model):
table_name = '{}container'.format(prefix)
columns = [
{'name': 'container_id', 'type': 'str', 'primary': True, 'length': 32},
{'name': 'image_id', ... | [
"[email protected]"
] | |
454d744eedb4d7ef6400ff1daf55405c7d179bc0 | feb2ad26f596045ddccf8a36b514fb0460a37e01 | /expression_data/data/models.py | dcdcdcd4988deac32f133e4a6f8e228f877dc7bc | [
"BSD-2-Clause"
] | permissive | lamarck2008/expression-data-server | 9a06de7bd3f69cfe92dcf9d7400715e8096d2c1c | 7f70fd5d5a9569a315716c389f828b17a487fdbc | refs/heads/master | 2021-01-16T20:24:14.289633 | 2012-11-19T02:52:06 | 2012-11-19T02:52:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,797 | py | '''These models control the data saved into the database for a given experiment.
There is a generic base class named Data, which is then further subclassed into specific data models.
'''
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import gen... | [
"[email protected]"
] | |
f4b7ae8e9946c91cded7fe2092eda6da7b6a3cdf | 4090d8b4e8e9e28d620d222651c73a12a753be36 | /contextadv/migrations/0006_alter_contextadvertisementdescription_description.py | d762b37198cad99a6353794de8fe7074771fc939 | [] | no_license | isaev4lex/220studio | 91aa08f9d10ff55e98effe2542e26799efb6e2f2 | 6188403eeed7ee590b21da15c67af9e6f06ab06b | refs/heads/main | 2023-08-20T07:14:18.203593 | 2021-10-31T07:24:19 | 2021-10-31T07:24:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 522 | py | # Generated by Django 3.2.4 on 2021-08-05 12:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contextadv', '0005_metatags'),
]
operations = [
migrations.AlterField(
model_name='contextadvertisementdescription',
... | [
"[email protected]"
] | |
358be1517a6567c187fc0c758e6e8ce6b61d5ae6 | 0a1356b97465cc1d5c3f661f61b3b8c51fb05d46 | /android_binding/.buildozer/android/platform/build-armeabi-v7a/build/other_builds/hostpython3/desktop/hostpython3/Tools/msi/make_zip.py | 58f3b15ef8524e3b3487ec688380a8d5b9de0e2c | [
"GPL-1.0-or-later",
"Python-2.0",
"MIT"
] | permissive | Rohan-cod/cross_platform_calc | 00360f971e4da68dd36d6836c9ddbb157f6b77d5 | 5785a5e8150d174019b330c812e7eb012cc4dd79 | refs/heads/master | 2022-12-22T10:29:05.317051 | 2021-06-05T10:52:44 | 2021-06-05T10:52:44 | 237,465,912 | 2 | 1 | MIT | 2022-12-09T05:18:55 | 2020-01-31T16:07:31 | C | UTF-8 | Python | false | false | 7,729 | py | import argparse
import py_compile
import re
import sys
import shutil
import stat
import os
import tempfile
from itertools import chain
from pathlib import Path
from zipfile import ZipFile, ZIP_DEFLATED
TKTCL_RE = re.compile(r'^(_?tk|tcl).+\.(pyd|dll)', re.IGNORECASE)
DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe|pdb|lib)... | [
"[email protected]"
] | |
253b6652ddac0a3ffbcf6e0fd96dfc8abecaf9b8 | a3bb97955ad28e8c83a23e4466bb5352ee86847d | /revision/apps/public/forms.py | 9b3b57cd9930137d58592f723e09c96bb6e411bb | [] | no_license | rosscdh/revision | 23ac75385cca5b44032ff2637eb635fa954bb2ec | 090fb2a82072c5570d89878c6f506dd22d5c5ed5 | refs/heads/master | 2016-09-05T10:53:33.652493 | 2014-11-29T10:57:41 | 2014-11-29T10:57:41 | 23,582,177 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,484 | py | # -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from django.core.urlresolvers import reverse_lazy
from parsley.decorators import parsleyfy
from crispy_forms.helper import FormHelper, Layout
from crispy_forms.layout import ButtonH... | [
"[email protected]"
] | |
4e009c93c039eb04670636eb123f6a973e479fd8 | f9d564f1aa83eca45872dab7fbaa26dd48210d08 | /huaweicloud-sdk-dbss/huaweicloudsdkdbss/v1/model/batch_delete_resource_tag_request.py | 951851e88d7c6383d31b3e128954862b7a8c1840 | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-python-v3 | cde6d849ce5b1de05ac5ebfd6153f27803837d84 | f69344c1dadb79067746ddf9bfde4bddc18d5ecf | refs/heads/master | 2023-09-01T19:29:43.013318 | 2023-08-31T08:28:59 | 2023-08-31T08:28:59 | 262,207,814 | 103 | 44 | NOASSERTION | 2023-06-22T14:50:48 | 2020-05-08T02:28:43 | Python | UTF-8 | Python | false | false | 4,953 | py | # coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class BatchDeleteResourceTagRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key i... | [
"[email protected]"
] | |
90ce17400257d8e886aa3c49973efb6bbe7e3d0f | 8830831a87f35ff2628f379d8230928ec6b5641a | /BNPParibas/code/gbc_deviance.py | f947f44609ebf50d5d1c3aa5f5f6442aa072e2f5 | [] | no_license | nickmcadden/Kaggle | e5882c9d68a81700d8d969328d91c059a0643868 | cbc5347dec90e4bf64d4dbaf28b8ffb362efc64f | refs/heads/master | 2019-07-18T08:09:40.683168 | 2018-01-26T14:35:38 | 2018-01-26T14:35:38 | 40,735,982 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,263 | py | import sys
import pandas as pd
import numpy as np
import scipy as sp
import xgboost as xgb
import data
import argparse
import pickle as pkl
from scipy import stats
from collections import OrderedDict
from sklearn.utils import shuffle
from sklearn.cross_validation import StratifiedShuffleSplit, KFold
from sklearn.ensemb... | [
"[email protected]"
] | |
50b0d0d43f43bcda2ef5a05062a45b32b719010f | 4bd5cdb67fdd6a6f0ceb3af025ceaf977b661273 | /gconv_experiments/groupy/garray/D4h_array.py | 1c0b4b98530c21dfa94b6937ccf955673ddf5fa0 | [] | no_license | andreiqv/gconv | 93d7d313cdc78e2bfefd53820918293526fc4680 | 23f9ec62b119c64cc87f8727cc1e409a469db0f1 | refs/heads/master | 2020-05-07T21:05:28.840973 | 2019-04-11T23:25:31 | 2019-04-11T23:25:31 | 180,890,960 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,376 | py | import numpy as np
from groupy.garray.finitegroup import FiniteGroup
from groupy.garray.matrix_garray import MatrixGArray
from groupy.garray.D4ht_array import D4htArray
from groupy.garray.Z3_array import Z3Array
"""
Implementation of dihedral finite group D4h, consisting of 16 elements in total.
These are the element... | [
"[email protected]"
] | |
ef955cf11a1cd96660828ba53df533af7add7417 | a9b5bc48a89329aa44cb4dd63ce47a3c0dfc90ba | /tests/test_withings_object.py | 8fa9c36a34257583ebac5c15851c1621aa312ca8 | [
"MIT"
] | permissive | randi120/python-withings | d050a263f5c500ad258072dbb3661a43dd225de3 | 016bb3cc2d62a4e2813df422829eba21530570bc | refs/heads/master | 2021-01-22T13:47:49.355343 | 2014-12-26T00:47:12 | 2014-12-26T00:47:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 938 | py | import time
import unittest
from datetime import datetime
from withings import WithingsObject
class TestWithingsObject(unittest.TestCase):
def test_attributes(self):
data = {
"date": "2013-04-10",
"string": "FAKE_STRING",
"integer": 55555,
"float": 5.67
... | [
"[email protected]"
] | |
cc1454d122573184c132666c2fe8f7e97e045849 | d8416cd4c8f532809c4c9d368d43fa773b3b198c | /torchsupport/flex/examples/cifar_tdre.py | 546881ac3c571f5f93a027d84caa06030768d4c4 | [
"MIT"
] | permissive | DavidMetzIMT/torchsupport | a53a0d532b7542d81dc158d3d67f195cbce86bf9 | a0ca719c820a4895e98091c52e43c5300e1a71a3 | refs/heads/master | 2023-05-28T21:45:09.302210 | 2021-06-14T17:30:58 | 2021-06-14T17:30:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,151 | py | from functools import partial
from torchsupport.data.namedtuple import namespace
import torch
import torch.nn as nn
import torch.nn.functional as func
from torch.distributions import Normal
from torch.utils.data import Dataset
from torchvision.datasets import CIFAR10
from torchvision.transforms import ToTensor
from ... | [
"[email protected]"
] | |
efdfe5a0a9fd4511946056b84590b1ff8569b14c | 4e7669f4234dbbcc6ef8206ac43bba33c53b8d1e | /Predictions/DataProcessing.py | 73ecbdb3270823e4d440ea305f64b9d0f26fce93 | [] | no_license | chouhansolo/edbn | 46cadbcb8d4e079cee746868663379b5b825286b | 63cfcd7e5e5e17242aed3b1968119e85b2796015 | refs/heads/master | 2023-04-05T06:54:26.380161 | 2021-04-21T08:50:30 | 2021-04-21T08:50:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,175 | py | """
Author: Stephen Pauwels
"""
import os
import pickle
import pandas as pd
from RelatedMethods.Camargo.support_modules.role_discovery import role_discovery
from Utils.LogFile import LogFile
BPIC15 = "BPIC15"
BPIC15_1 = "BPIC15_1"
BPIC15_2 = "BPIC15_2"
BPIC15_3 = "BPIC15_3"
BPIC15_4 = "BPIC15_4"
BPIC15_5 = "BPI... | [
"[email protected]"
] | |
240b97aea52be8a26c3a5cf1be0c510ebeff50e0 | bff37773d1e6c3f4bf8ae4eaa64d7a2d563ecf68 | /backend/users/migrations/0002_auto_20201217_0711.py | 46bfcb7d1b2be14df2fe21ac2b64e683539ccceb | [] | no_license | crowdbotics-apps/mobile-17-dec-dev-16856 | d405478f85248047e00ed97cd4b61fa5ca2a8fd6 | b5c60c39b4e6715b17fa1e7dff6c72527f6ae967 | refs/heads/master | 2023-02-03T00:16:51.489994 | 2020-12-17T14:12:46 | 2020-12-17T14:12:46 | 322,203,166 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 394 | py | # Generated by Django 2.2.17 on 2020-12-17 07:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("users", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="user",
name="name",
field=... | [
"[email protected]"
] | |
2c705f84317dd7fb1c449692c21c19157c862a5f | e87d793b3a5facc6e54e0263fbd67703e1fbb382 | /duckietown-world-venv/bin/jupyter-trust | b408b0d21630fc79d1e9443daa6b2a05bc45d37c | [] | no_license | llingg/behaviour-benchmarking | a860bbe709309e13f3e1133d916944882199a40f | 85bbf1a9c2c628ba74480fe7abac3804d6afdac4 | refs/heads/v1 | 2022-10-06T08:21:29.068329 | 2020-06-11T07:02:46 | 2020-06-11T07:02:46 | 259,622,704 | 0 | 0 | null | 2020-06-02T17:52:46 | 2020-04-28T11:52:08 | C++ | UTF-8 | Python | false | false | 302 | #!/home/linuslingg/duckietown-world/duckietown-world-venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from nbformat.sign import TrustNotebookApp
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(TrustNotebookApp.launch_instance())
| [
"[email protected]"
] | ||
693351d13cbca26f5dc2f674b07e879c28cc09eb | b3a55844de9ff46972448b56ccadc1e3088adae1 | /poptimizer/data/views/go.py | 8e124ea774a85d74b096f602bcad3c5d32f544ed | [
"Unlicense"
] | permissive | tjlee/poptimizer | 480a155e2f4ffd5d6eda27323c5baa682d7f9f00 | 3a67544fd4c1bce39d67523799b76c9adfd03969 | refs/heads/master | 2023-08-15T10:16:11.161702 | 2021-10-15T15:35:38 | 2021-10-15T15:35:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 583 | py | """Предварительная версия интеграции с Go."""
import aiohttp
from bson import json_util
from poptimizer.shared import connections
async def rest_reader(session: aiohttp.ClientSession = connections.HTTP_SESSION):
async with session.get("http://localhost:3000/trading_dates/trading_dates") as respond:
respo... | [
"[email protected]"
] | |
f611a878a16540a8544d96b179da3dbe91d2edf7 | 8afb5afd38548c631f6f9536846039ef6cb297b9 | /MY_REPOS/INTERVIEW-PREP-COMPLETE/notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/_Another-One/Project Euler/Problem 04/sol1.py | ba8a39290c9cd8d45a5050c08b2e276e81e6c6f9 | [
"MIT"
] | permissive | bgoonz/UsefulResourceRepo2.0 | d87588ffd668bb498f7787b896cc7b20d83ce0ad | 2cb4b45dd14a230aa0e800042e893f8dfb23beda | refs/heads/master | 2023-03-17T01:22:05.254751 | 2022-08-11T03:18:22 | 2022-08-11T03:18:22 | 382,628,698 | 10 | 12 | MIT | 2022-10-10T14:13:54 | 2021-07-03T13:58:52 | null | UTF-8 | Python | false | false | 872 | py | """
Problem:
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 x 99.
Find the largest palindrome made from the product of two 3-digit numbers which is less than N.
"""
from __future__ import print_function
limit = int(input("limit? "))
# fe... | [
"[email protected]"
] | |
f1504401ecfae9c68665a07df227490f7bdde2e6 | 4f3a4c194451eae32f1ff7cf3b0db947e3892365 | /39/main.py | 380f721980637a5dbb3d095e6966d349ecfd7c39 | [] | no_license | szhongren/leetcode | 84dd848edbfd728b344927f4f3c376b89b6a81f4 | 8cda0518440488992d7e2c70cb8555ec7b34083f | refs/heads/master | 2021-12-01T01:34:54.639508 | 2021-11-30T05:54:45 | 2021-11-30T05:54:45 | 83,624,410 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,699 | py | """
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited number of times.
Note:
All numbers (including target) will be positive integers.
The solution set must not contain duplicat... | [
"[email protected]"
] | |
482d241112ea052ce15aca3724fab31234ee9eaf | 18ab6f3ac3458db61f506bee8885c70d6de6c06e | /class_12/userhandling/accounts/models.py | 69c6252de80e13838a61f0d57c38f6c4fdd2727d | [] | no_license | coding-blocks-archives/Django2017Spring | 8ca7a14e2d867cb07a60d2dca1c9138cada6c06a | 008c32bc725918e93a0020b39e226c634b6f2e0f | refs/heads/master | 2021-06-14T15:19:40.830677 | 2017-04-16T11:22:04 | 2017-04-16T11:22:04 | 79,050,330 | 0 | 2 | null | null | null | null | UTF-8 | Python | false | false | 966 | py | from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import User
from django import forms
# Create your models here.
class MyUser(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=50, default='')
address = models.CharField(max_length=3... | [
"[email protected]"
] | |
4255b09ee52495dfc8984febfc0cf9cfe0f5ca64 | d86a7fcc543ab6066ca772f67551943ec4cad31a | /perf/metrics/aggregator.py | 4d53cd7d3a0a44abc20d2129109d660a3f90cf05 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | fossabot/lake | 184b4db5a14725da919093ef0cb392c329166b89 | 75f2bf10ef50bb4979e52a7ce539ea5de00d3647 | refs/heads/master | 2022-12-11T10:00:46.239848 | 2020-09-16T05:04:37 | 2020-09-16T05:04:37 | 295,928,404 | 0 | 0 | Apache-2.0 | 2020-09-16T05:04:36 | 2020-09-16T05:04:35 | null | UTF-8 | Python | false | false | 1,189 | py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import time
import os
import threading
class MetricsAggregator(threading.Thread):
def __init__(self, path):
super(MetricsAggregator, self).__init__()
self._stop_event = threading.Event()
self.__store = dict()
self.__path = path
self.__... | [
"[email protected]"
] | |
4e9776b12ce251408a9c5871641abe9f9225f6b2 | d79f3a31d173f18ec112c521acdcee8e8e73724d | /getid.py | 8a6fcb90734975a7c0dfc8ede803ef708a2c3468 | [] | no_license | k156/hello | 3de815de569b38f8260e774e57b138f4da43f480 | f5a7f386d3f78d15d7f166a95ad25724e168f472 | refs/heads/master | 2020-04-04T23:15:38.252126 | 2019-05-03T05:57:00 | 2019-05-03T05:57:00 | 156,352,395 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,268 | py | from time import sleep
from selenium import webdriver
from bs4 import BeautifulSoup
import requests
USER = ""
PASS = ""
browser = webdriver.Chrome()
browser.implicitly_wait(3)
# 로그인 페이지에 접근하기.
url_login = "https://www.yes24.com/Templates/FTLogin.aspx?ReturnURL=http://ticket.yes24.com/Pages/Perf/Detail/Detail.aspx&... | [
"[email protected]"
] | |
67a016a9d7ba978adccc3d947bf989f1fe06db71 | 98e944b793b2d907e802f979bc6309b75b678716 | /shell/shell_person.py | 30fde62c5f4a05fb73b9732127fd0ead9955e568 | [] | no_license | rg3915/avesmarias | 3fa17416e64908714f164254434f3ec1a6423696 | ce29072d17024b91e8afab309e203e68fc0e15d2 | refs/heads/master | 2021-01-12T11:32:45.196569 | 2016-11-06T14:54:05 | 2016-11-06T14:54:05 | 72,948,389 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 842 | py | import string
import random
import csv
from avesmarias.core.models import Person, Phone
PHONE_TYPE = ('pri', 'com', 'res', 'cel')
person_list = []
''' Read person.csv '''
with open('fix/person.csv', 'r') as f:
r = csv.DictReader(f)
for dct in r:
person_list.append(dct)
f.close()
''' Insert Person... | [
"[email protected]"
] | |
638bb6032545c27060aeaa7fbe01b9a33bcf0ea7 | d6a1630bcc03f059438f949ba4f59b86ef5a4bd6 | /features/geopy_distance_features.py | 882428e8ac4d7f9aaa832bb3288cfd7c98e3853d | [
"MIT"
] | permissive | SunnyMarkLiu/Kaggle_NYC_Taxi_Trip_Duration | 063f7327e9075fc7435930513cc36f8dbd35d256 | eca7f44bc3bf1af0690305b45858359adac617b4 | refs/heads/master | 2021-01-02T09:30:25.639858 | 2017-09-13T03:53:18 | 2017-09-13T03:53:18 | 99,228,943 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,772 | py | #!/usr/local/miniconda2/bin/python
# _*_ coding: utf-8 _*_
"""
@author: MarkLiu
@time : 17-9-12 上午11:10
"""
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
sys.path.append(module_path)
import pandas as pd
from geopy.distance import great_circle
from utils import data_utils
from conf.configure... | [
"[email protected]"
] | |
90d11cd9857b6436e79804bc753b2bbaf34a422d | fc3f784c8d00f419b11cbde660fe68a91fb080ca | /algoritm/20상반기 코딩테스트/소수 경로/bj1963.py | 6f4d4774ef60720d7fc72ff334ec8ba7ecaf763d | [] | no_license | choo0618/TIL | 09f09c89c8141ba75bf92657ac39978913703637 | 70437a58015aecee8f3d86e6bfd0aa8dc11b5447 | refs/heads/master | 2021-06-25T07:01:34.246642 | 2020-12-21T04:57:13 | 2020-12-21T04:57:13 | 163,782,782 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 869 | py | import sys
sys.stdin=open('bj1963.txt','r')
def Find(n,s):
ns=[]
for i in ['0','1','2','3','4','5','6','7','8','9']:
if not n and i=='0':continue
ss=s[:n]+i+s[n+1:]
if not Map[int(ss)] and s!=ss and not M[int(ss)]:
M[int(ss)]=1
ns.append(ss)
return ns
Map=[0... | [
"[email protected]"
] | |
ff94c4fe9772efb3f93861e6eced73496ca45bfe | f3eb45a23b421ed8b160a6cf7c8670efb7e9ff4f | /4_digits_of_pi/3_dask_multicore_digits_of_pi.py | a30c429c179e07f93e73ecee53aed9a9898800f3 | [
"MIT"
] | permissive | zonca/intro_hpc | 4197a49a3a3b2f8cfbe1cfb9d30e9d7f5100c8ac | b0ee213e95d045abdfbbf82849939a2bb4ea125b | refs/heads/master | 2021-01-23T01:41:41.809291 | 2017-07-22T20:41:53 | 2017-07-22T21:10:29 | 92,886,908 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 742 | py | #!/usr/bin/env python3
import sys
import numpy as np
import dask.array as da
def inside_circle(total_count):
x = da.random.uniform(size=total_count, chunks=total_count//48)
y = da.random.uniform(size=total_count, chunks=total_count//48)
radii_square = x**2 + y**2
count = (radii_square<=1.0).sum().co... | [
"[email protected]"
] | |
9c90fde14be791e32a374c0dd2d82fad92ea21ef | 27eec9c18320fbc20b0fbec628447a3442facc12 | /CNN_ConvLSTM/utils/convlstm.py | f03883c2e05d74cdfccb1069d5bc90d47ba8268c | [
"MIT"
] | permissive | peternara/ResNet_ConvLSTM | 06428a400f8e93209d4b81f1a6d2b55a58bdb79a | 1e2c239af6854d122f138f109d4c1de82930ce43 | refs/heads/main | 2023-05-09T12:43:49.965613 | 2021-06-01T02:49:02 | 2021-06-01T02:49:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,026 | py | import torch.nn as nn
from torch.autograd import Variable
import torch
class ConvLSTMCell(nn.Module):
def __init__(self, input_size, input_dim, hidden_dim, kernel_size, bias):
"""
Initialize ConvLSTM cell.
Parameters
----------
input_size: (int, int)
Height and... | [
"[email protected]"
] | |
82700d40eab51d34a591596e4a59417b39f75684 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03393/s165485969.py | 2108db1765fd8cb7c870158fd75a81cab596eee9 | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,027 | py | import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(inpu... | [
"[email protected]"
] | |
23532656417e4f17a6b726c887f112f46a905d58 | ce76b3ef70b885d7c354b6ddb8447d111548e0f1 | /right_life.py | a00c57735a1259cdb92912789021f1a768eacd33 | [] | no_license | JingkaiTang/github-play | 9bdca4115eee94a7b5e4ae9d3d6052514729ff21 | 51b550425a91a97480714fe9bc63cb5112f6f729 | refs/heads/master | 2021-01-20T20:18:21.249162 | 2016-08-19T07:20:12 | 2016-08-19T07:20:12 | 60,834,519 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 216 | py |
#! /usr/bin/env python
def life_or_little_time(str_arg):
hand(str_arg)
print('work_bad_part')
def hand(str_arg):
print(str_arg)
if __name__ == '__main__':
life_or_little_time('week_and_bad_fact')
| [
"[email protected]"
] | |
02a864677772bde23c7d4bf75b729b9a113adbe6 | 42240f6bbabcfb7a8e2f0957ab2d3c46c2920fd1 | /lib/python/statcode/filetype_config.py | 58a15f709ddbf0882bf49841242a61fad5dd2d34 | [
"Apache-2.0"
] | permissive | simone-campagna/statcode | 164a219c699551b70ee12640f42199b72cc76879 | a9f39b666d9670b9916623fde343b9174d563724 | refs/heads/master | 2021-01-01T06:32:25.734613 | 2013-09-17T08:12:49 | 2013-09-17T08:12:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 984 | py | #!/usr/bin/env python3
#
# Copyright 2013 Simone Campagna
#
# 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 ... | [
"[email protected]"
] | |
e71765761571691b4c463f3710a44d6329846b82 | 2031771d8c226806a0b35c3579af990dd0747e64 | /pyobjc-framework-Intents/PyObjCTest/test_inpersonhandlelabel.py | ad84f5b6277cb2d3c6b8928edf94837316b6d5fe | [
"MIT"
] | permissive | GreatFruitOmsk/pyobjc-mirror | a146b5363a5e39181f09761087fd854127c07c86 | 4f4cf0e4416ea67240633077e5665f5ed9724140 | refs/heads/master | 2018-12-22T12:38:52.382389 | 2018-11-12T09:54:18 | 2018-11-12T09:54:18 | 109,211,701 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 943 | py | import sys
from PyObjCTools.TestSupport import *
if sys.maxsize > 2 ** 32:
import Intents
class TestINPersonHandleLabel (TestCase):
@min_os_level('10.12')
def testConstants(self):
self.assertIsInstance(Intents.INPersonHandleLabelHome, unicode)
self.assertIsInstance(Inte... | [
"[email protected]"
] | |
4750432b226683768a660d9a7566173f603adfbd | 0f4cacd40260137d3d0b3d1b34be58ac76fc8bd0 | /2016/advent24.my.py | df8a2c52a1d331b2427d0dbb0405963b4335febe | [] | no_license | timrprobocom/advent-of-code | 45bc765e6ee84e8d015543b1f2fa3003c830e60e | dc4d8955f71a92f7e9c92a36caeb954c208c50e7 | refs/heads/master | 2023-01-06T07:19:03.509467 | 2022-12-27T18:28:30 | 2022-12-27T18:28:30 | 161,268,871 | 0 | 2 | null | null | null | null | UTF-8 | Python | false | false | 3,570 | py | #
# Holy shit.
#
grid = """\
###########
#0.1.....2#
#.#######.#
#4.......3#
###########""".splitlines()
xmax = len(grid[0])
ymax = len(grid)
# 0 is at row 18 col 3
# So, as long as there are no decisions, move forward. When we reach a decision point,
# push the point on a stack, pick left, continue on.
# Stop whe... | [
"[email protected]"
] | |
2a715ba1c3bd9636d92fbac36798cfaf9786dc35 | 5dd03f9bd8886f02315c254eb2569e4b6d368849 | /src/python/twitter/common/python/eggparser.py | 9b5b6bdc1282fe4543ffc44cae5daacea7063937 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | adamsxu/commons | 9e1bff8be131f5b802d3aadc9916d5f3a760166c | 9fd5a4ab142295692994b012a2a2ef3935d35c0b | refs/heads/master | 2021-01-17T23:13:51.478337 | 2012-03-11T17:30:24 | 2012-03-11T17:30:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,547 | py | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | [
"[email protected]"
] | |
10ba8b7670ca96c7d6a83e9a4cbb5484f4e95a53 | 446bd1170475e640e4a50476cd80514b0693ee61 | /demo/demo1/demo1/picture/jishe/demo2/Demo3/Demo3/spiders/main.py | 04dfd6ea4f4f2efd572b417bf2be0aa4f5725558 | [] | no_license | HarperHao/python | f040e1e76a243a3dba2b342029a74a45232c1c8d | 4bd807605c0acca57b8eea6444b63d36d758cca9 | refs/heads/master | 2021-07-20T04:40:37.515221 | 2020-10-02T08:58:37 | 2020-10-02T08:58:37 | 219,732,665 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,665 | py | # from scrapy.cmdline import execute
#
# execute("scrapy crawl zuowumianji".split())
import numpy as np
# LU分解
def LU_Decompose(matrix):
rows, columns = np.shape(matrix)
if rows != columns:
print("所输入的矩阵必须是方阵!")
return
L = np.eye(rows)
U = np.triu(matrix) # 先求出U矩阵(化上三角矩阵)
# 求L矩阵(主... | [
"[email protected]"
] | |
be0a4b0ae23f12893b303e8bc4cb504c7f517d0f | d0f11aa36b8c594a09aa06ff15080d508e2f294c | /leecode/1-500/1-100/39-组合总和.py | 751f2a332ffc2b86704c60a28303c9b7f6961e04 | [] | no_license | saycmily/vtk-and-python | 153c1fe9953fce685903f938e174d3719eada0f5 | 5045d7c44a5af5c16df5a3b72c157e9a2928a563 | refs/heads/master | 2023-01-28T14:02:59.970115 | 2021-04-28T09:03:32 | 2021-04-28T09:03:32 | 161,468,316 | 1 | 1 | null | 2023-01-12T05:59:39 | 2018-12-12T10:00:08 | Python | UTF-8 | Python | false | false | 572 | py | class Solution:
def combinationSum(self, candidates, target: int):
candidates.sort()
n = len(candidates)
res = []
def backtrack(tmp, tmp_sum=0, first=0):
if tmp_sum == target:
res.append(tmp.copy())
return
for j in range(first,... | [
"[email protected]"
] | |
eb64e5d68a519e53d4e37ab1f2670f115f660766 | f02b21d5072cb66af643a7070cf0df4401229d6e | /leetcode/depth_first_search/695-max_area_of_island.py | 939a2da8c3ed73d926cf1e1b3a4173e9f7dc2bbb | [] | no_license | dbconfession78/interview_prep | af75699f191d47be1239d7f842456c68c92b95db | 7f9572fc6e72bcd3ef1a22b08db099e1d21a1943 | refs/heads/master | 2018-10-09T22:03:55.283172 | 2018-06-23T01:18:00 | 2018-06-23T01:18:00 | 110,733,251 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,673 | py | import sys
class Solution:
# def maxAreaOfIsland_PRACTICE(self, grid):
def maxAreaOfIsland(self, grid):
retval = 0
for i in range(len(grid)):
for j in range(len(grid[i])):
if grid[i][j] == 1:
retval = max(retval, self.helper(grid, i, j, 0))
... | [
"Hyrenkosa1"
] | Hyrenkosa1 |
ae09834689a7ed3701d3ef9439f82ccc31caa63b | 3e4d78628a66927e2a640ca4f328adcc31e156b9 | /deejay/queuer.py | be6d7a434cdd0da2d3e15b533b77f38a4bf36a50 | [] | no_license | nijotz/shitstream | 360d41a1411dc480dd220790f9513d202a18ee78 | 7d11171fb35aaf6d778d5bf23046d220939711be | refs/heads/master | 2021-01-01T16:19:22.224760 | 2014-10-16T22:48:17 | 2014-10-16T22:48:17 | 23,303,299 | 5 | 1 | null | null | null | null | UTF-8 | Python | false | false | 3,892 | py | import os
import re
import pyechonest.config
import pyechonest.song
import pyechonest.playlist
from downloaders.youtube import search as youtube_search
from mpd_util import mpd
from server import app
import settings
pyechonest.config.CODEGEN_BINARY_OVERRIDE = settings.dj_codegen_binary
pyechonest.config.ECHO_NEST_A... | [
"[email protected]"
] | |
1223460f79aa83654eb9c6e0e3b50f90b2366482 | a364f53dda3a96c59b2b54799907f7d5cde57214 | /easy/35-Search Insertion Position.py | 6c7c2e089fbf94d023498b845a9645138b07243e | [
"Apache-2.0"
] | permissive | Davidxswang/leetcode | 641cc5c10d2a97d5eb0396be0cfc818f371aff52 | d554b7f5228f14c646f726ddb91014a612673e06 | refs/heads/master | 2022-12-24T11:31:48.930229 | 2020-10-08T06:02:57 | 2020-10-08T06:02:57 | 260,053,912 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,153 | py | """
https://leetcode.com/problems/search-insert-position/
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array.
Example 1:
Input: [1,3,5,6], 5
Output: 2
Example 2:
Input: [... | [
"[email protected]"
] | |
3cc745f34716dfeb254720f8c0c01a80b7c5d438 | 67ca269e39935d0c439329c3a63df859e40168bb | /autoPyTorch/pipeline/components/setup/lr_scheduler/constants.py | 2e5895632deb9caa92b26070d7495d27d57ba970 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-philippe-de-muyter"
] | permissive | automl/Auto-PyTorch | 2e67ffb44f40d9993470ded9b63f10a5164b41df | 56a2ac1d69c7c61a847c678879a67f5d3672b3e8 | refs/heads/master | 2023-07-14T22:55:57.826602 | 2022-08-23T16:43:15 | 2022-08-23T16:43:15 | 159,791,040 | 2,214 | 280 | Apache-2.0 | 2023-04-04T14:41:15 | 2018-11-30T08:18:34 | Python | UTF-8 | Python | false | false | 450 | py | from enum import Enum
class StepIntervalUnit(Enum):
"""
By which interval we perform the step for learning rate schedulers.
Attributes:
batch (str): We update every batch evaluation
epoch (str): We update every epoch
valid (str): We update every validation
"""
batch = 'batc... | [
"[email protected]"
] | |
744ef4550ea1381e96181d3d0cf7df33ca8a133d | 762de1c66746267e05d53184d7854934616416ee | /tools/MolSurfGenService/MolSurfaceGen32/chimera/share/VolumeData/tom_em/em_format.py | 6c027e9831ce8864e76310e1e1193380a04ead29 | [] | no_license | project-renard-survey/semanticscience | 6e74f5d475cf0ebcd9bb7be6bb9522cf15ed8677 | 024890dba56c3e82ea2cf8c773965117f8cda339 | refs/heads/master | 2021-07-07T21:47:17.767414 | 2017-10-04T12:13:50 | 2017-10-04T12:13:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,434 | py | # -----------------------------------------------------------------------------
# Read TOM Toolbox EM density map file (http://www.biochem.mpg.de/tom/)
# electron microscope data.
#
# Byte swapping will be done if needed.
#
# -----------------------------------------------------------------------------
#
class EM_Data... | [
"alex.gawronski@d60594c4-dda9-11dd-87d8-31aa04531ed5"
] | alex.gawronski@d60594c4-dda9-11dd-87d8-31aa04531ed5 |
778ae380f0cad62eb41f8e8dbe2862993143ee93 | 495907c7e2e2d591df2d6906335c3d89c5a4a47b | /helpers/logHelpers.py | 42129a0969e389b0136e85078c31651d76b26bbb | [] | no_license | ePandda/idigpaleo-ingest | 319194125aded01f018cfb7c1fe7044fe8c66770 | 8473ab31e7a56878236136d0ace285ab3738f208 | refs/heads/master | 2020-11-26T19:48:13.959972 | 2018-04-21T17:19:38 | 2018-04-21T17:19:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,086 | py | #
# Class for logining status/errors from the ingest
#
# Uses the main pythn logging module
import logging
import time
def createLog(module, level):
logger = logging.getLogger(module)
if level:
checkLevel = level.lower()
else:
checkLevel = 'warning'
levels = {'debug': logging.DEBUG, '... | [
"[email protected]"
] | |
5b7de37d3e3ae6122a53cb151f264294e1e07cfd | 4ec57b6ca1125feb546487ebf736fb1f7f3531ce | /src/bin/huawei_server/collect.py | 7e38908b1087dbed5c09a721f9b18ad0fac206cd | [
"MIT"
] | permissive | Huawei/Server_Management_Plugin_Nagios | df595b350ef1cf63347725e443b518c521afde5a | fbfbb852a90b6e1283288111eadbd49af2e79343 | refs/heads/master | 2022-09-14T15:59:48.438453 | 2022-08-22T03:19:20 | 2022-08-22T03:19:20 | 120,845,298 | 4 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,370 | py | #encoding:utf-8
import sys
import os
import traceback
from config import VERSTION_STR
from base.logger import Logger
from model.plugin import LoggerConfig
from service.collectservice import CollectService
from util.common import Common
from util.check import Check
from constant.constant import *
from threading import... | [
"[email protected]"
] | |
9d7664af768702a3da5d5567e409f84faf975d8a | 4380a4029bac26f205ed925026914dce9e96fff0 | /slyr/parser/exceptions.py | d791f4c9f6a447c4501d075e561829ba69832613 | [] | no_license | deepVector/slyr | 6b327f835994c8f20f0614eb6c772b90aa2d8536 | 5d532ac3eec0e00c5883bf873d30c6b18a4edf30 | refs/heads/master | 2020-12-03T10:24:39.660904 | 2019-04-08T00:48:03 | 2019-04-08T00:48:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 974 | py | #!/usr/bin/env python
"""
SLYR Exceptions
"""
class UnsupportedVersionException(Exception):
"""
Thrown when an object of an unsupported version is encountered
"""
pass
class UnreadableSymbolException(Exception):
"""
Thrown when a symbol could not be read, for whatever reason
"""
pass... | [
"[email protected]"
] | |
bbf9c3db561c3a9339d630028112a6794a730e5e | db734d1c2fa1ff072c3bad3efbc80f5fb045647b | /examples/advanced_symmetry.py | 5b838beba33fb51eb88a5bfddea66a81e01fb2ff | [
"MIT"
] | permissive | yenchunlin024/PyQchem | ff4a0f9062124c3ef47dba5e7c48b372e4a99c21 | 2edf984ba17373ad3fd450b18592c8b7827b72e5 | refs/heads/master | 2023-08-12T09:43:46.942362 | 2021-09-30T10:59:35 | 2021-09-30T10:59:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,469 | py | import numpy as np
from pyqchem.symmetry import get_wf_symmetry
from pyqchem.utils import _set_zero_to_coefficients, get_plane, crop_electronic_structure
from pyqchem.qchem_core import get_output_from_qchem, create_qchem_input
from pyqchem.structure import Structure
from pyqchem.file_io import build_fchk
# Define cu... | [
"[email protected]"
] | |
cc7027ec8852029b29739182b583c126f29a16cf | 4ab57a7bd592d267d180f0541ee18b4c544eec28 | /tests/orm/mixins/test_soft_deletes.py | bba8c0e6fcda1c345551add5b8b6bc09638e0e42 | [
"MIT"
] | permissive | mattcl/orator | f6cfb687ef8f1c3f5dd9828b2b950edbb5387cc9 | cc3d2154d596f7e6ff4274d7f8d6e8a233e12a9c | refs/heads/0.8 | 2021-01-20T17:27:16.342669 | 2016-06-02T21:55:00 | 2016-06-02T21:55:00 | 66,998,160 | 0 | 1 | null | 2018-02-22T21:29:24 | 2016-08-31T03:08:13 | Python | UTF-8 | Python | false | false | 1,362 | py | # -*- coding: utf-8 -*-
import datetime
import arrow
from flexmock import flexmock, flexmock_teardown
from orator import Model, SoftDeletes
from orator.orm import Builder
from orator.query import QueryBuilder
from ... import OratorTestCase
t = arrow.get().naive
class SoftDeletesTestCase(OratorTestCase):
def t... | [
"[email protected]"
] | |
72d8d8ac47ceb9f682800efef9aa102bd121eab5 | caa06eca3eef2549d5088f6487201f734b35822e | /NLP-PGN/utils/config_bak.py | 538451b3b9977af8e798069ab9f3e4cf5672d3bb | [] | no_license | kelvincjr/shared | f947353d13e27530ba44ea664e27de51db71a5b6 | 4bc4a12b0ab44c6847a67cbd7639ce3c025f38f8 | refs/heads/master | 2023-06-23T19:38:14.801083 | 2022-05-17T09:45:22 | 2022-05-17T09:45:22 | 141,774,490 | 6 | 1 | null | 2023-06-12T21:30:07 | 2018-07-21T02:22:34 | Python | UTF-8 | Python | false | false | 1,767 | py | """
@Time : 2021/2/814:06
@Auth : 周俊贤
@File :config.py
@DESCRIPTION:
"""
from typing import Optional
import torch
# General
hidden_size: int = 512
dec_hidden_size: Optional[int] = 512
embed_size: int = 512
pointer = True
# Data
max_vocab_size = 20000
embed_file: Optional[str] = None # use pre-trained embeddings
s... | [
"[email protected]"
] | |
01e664b7f39575e1a63a4ddf8b5dfefab7300952 | a2e638cd0c124254e67963bda62c21351881ee75 | /Python modules/SettlementRegenerate.py | f5f2ad83e3c14991b4f4775c28b52ee0110c5cdb | [] | no_license | webclinic017/fa-absa-py3 | 1ffa98f2bd72d541166fdaac421d3c84147a4e01 | 5e7cc7de3495145501ca53deb9efee2233ab7e1c | refs/heads/main | 2023-04-19T10:41:21.273030 | 2021-05-10T08:50:05 | 2021-05-10T08:50:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,110 | py | """----------------------------------------------------------------------------------------------------------
MODULE : SettlementRegenerate
PURPOSE : This module will regenerate a settlement.
DEPARTMENT AND DESK : IT
REQUASTER : Heinrich Cronje
... | [
"[email protected]"
] | |
4e5832c5c5b4c8807e7bcdabe9568f504fedc426 | 67b8ea7f463e76a74d5144202952e6c8c26a9b75 | /cluster-env/bin/undill | 455df88dec71f58462d5ce48b4a02c95dad99b63 | [
"MIT"
] | permissive | democrazyx/elecsim | 5418cb99962d7ee2f9f0510eb42d27cd5254d023 | e5b8410dce3cb5fa2e869f34998dfab13161bc54 | refs/heads/master | 2023-06-27T09:31:01.059084 | 2021-07-24T19:39:36 | 2021-07-24T19:39:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 617 | #!/home/alexkell/elecsim/cluster-env/bin/python3
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2019 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https:/... | [
"[email protected]"
] | ||
63655078077b3e9d9b986b5bf295f5aae86a05c0 | 7b26ead5cca82bc8ec8cec01505435db06959284 | /spider.py | 8ecd93d5e9b67fa07028d64a1ee83625d4721952 | [] | no_license | mnahm5/Web-Crawler | dffa8725f56a1c4c9265c120b9ac5500a497bff3 | 552ca54fd13e4fc30e1315b6a22fb511d2aaf345 | refs/heads/master | 2021-01-19T00:52:17.912824 | 2016-06-30T12:45:25 | 2016-06-30T12:45:25 | 60,887,947 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,375 | py | from urllib.request import urlopen
from link_finder import LinkFinder
from general import *
class Spider:
# Class variables (shared among all instances)
project_name = ""
base_url = ""
domain_name = ""
queue_file = ""
crawled_file = ""
queue = set()
crawled = set()
def __init__(se... | [
"[email protected]"
] | |
1c2e6fc89feaef8003cf91c6e3db19398008dde5 | fa5070498f31026b662053d1d5d91282cb1f68b9 | /test01/tapp/views.py | 36f742b4db34a7c1ddbfc041c48b401998010c04 | [
"Apache-2.0"
] | permissive | jinguangzhu/the_first_python | f074c4943028421f96285a2f772e7ccf102248e5 | d9d035b44652a4cd6ecd1834dd9930d1c78bf360 | refs/heads/master | 2020-03-19T14:16:35.860167 | 2018-06-19T13:58:25 | 2018-06-19T13:58:25 | 136,615,947 | 0 | 3 | Apache-2.0 | 2018-06-19T13:31:00 | 2018-06-08T12:27:09 | Python | UTF-8 | Python | false | false | 270 | py | from django.shortcuts import render
from tapp.models import *
# Create your views here.
def my_student(req):
student = Student.objects.all()
return render(req,"student.html",context={"student":student})
def first(req):
return render(req,"hellodjango.html") | [
"[email protected]"
] | |
79d9d6cab1424a8f758f9bc427220aa90cc5ea9a | 781e2692049e87a4256320c76e82a19be257a05d | /all_data/exercism_data/python/bob/40dea17339b24a50970c59a9ab7f2661.py | 2b91b02b1c565cfce002da2177d0c653c3e0759a | [] | no_license | itsolutionscorp/AutoStyle-Clustering | 54bde86fe6dbad35b568b38cfcb14c5ffaab51b0 | be0e2f635a7558f56c61bc0b36c6146b01d1e6e6 | refs/heads/master | 2020-12-11T07:27:19.291038 | 2016-03-16T03:18:00 | 2016-03-16T03:18:42 | 59,454,921 | 4 | 0 | null | 2016-05-23T05:40:56 | 2016-05-23T05:40:56 | null | UTF-8 | Python | false | false | 365 | py | #
# Skeleton file for the Python "Bob" exercise.
#
def hey(phrase):
if not phrase.strip() == '':
if any(c.isalpha() for c in phrase) and not any(
c.islower() for c in phrase):
return 'Whoa, chill out!'
elif phrase.endswith('?'):
return 'Sure.'
return... | [
"[email protected]"
] | |
5455dbfa3f6bdb95fbe0d82fe40400246f03ff85 | d5beb80c402954d1b66f765b5d5c93d28491324d | /evtstrd_test/filter.py | 854a71c52f33622147a05d857a11213a9abf3fb8 | [
"MIT"
] | permissive | srittau/eventstreamd | 978d822d7dd504f91aebdf11091733a04bb4c5c2 | 688ee94aea704230e2d0693195062cea8ba3eb73 | refs/heads/main | 2023-08-18T21:27:23.962517 | 2023-08-17T09:55:24 | 2023-08-17T09:55:24 | 85,480,241 | 0 | 0 | MIT | 2023-09-08T06:45:51 | 2017-03-19T14:00:49 | Python | UTF-8 | Python | false | false | 3,121 | py | from unittest import TestCase
from asserts import assert_equal, assert_false, assert_raises, assert_true
from evtstrd.filters import parse_filter
class FilterTest(TestCase):
def test_str(self) -> None:
filter_ = parse_filter("foo.bar<='ABC'")
assert_equal("foo.bar<='ABC'", str(filter_))
def... | [
"[email protected]"
] | |
3dedf611bc54472811b3f467db4eb932c8506bf7 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03971/s127085901.py | 34b5ed2240205dc9db4f33c7ab3dd930dddf6d8a | [] | no_license | Aasthaengg/IBMdataset | 7abb6cbcc4fb03ef5ca68ac64ba460c4a64f8901 | f33f1c5c3b16d0ea8d1f5a7d479ad288bb3f48d8 | refs/heads/main | 2023-04-22T10:22:44.763102 | 2021-05-13T17:27:22 | 2021-05-13T17:27:22 | 367,112,348 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 407 | py | n,a,b=map(int,input().split())
s=input()
passed=0
abroad_passed=0
for i in s:
if i=="a":
if passed<a+b:
print("Yes")
passed+=1
else:
print("No")
elif i=="b":
if passed<a+b and abroad_passed<=b-1:
print("Yes")
passed+=1
... | [
"[email protected]"
] | |
0f8ebdd234606243284b482e06e4083e1328c38d | 3ef0fd7ff4ab98da91de28b4a3ae6bbd55a38361 | /wxrobot-host/wxrobot/baidu_shibie.py | 7c2115361e6ee26f68503dd32ffd03c7d4f6470f | [] | no_license | nudepig/wxrobot | d0cbcbe0b1fb0a69532bb2c45630bc01ded8c2af | 82bd8f68d3163d8dddf1b9a8ccc14532f040fbab | refs/heads/master | 2020-12-27T13:35:24.043856 | 2020-02-03T09:30:04 | 2020-02-03T09:30:04 | 237,920,035 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,770 | py | # from aip import AipOcr # 如果已安装pip,执行pip install baidu-aip即可
# import os
# """ 你的 APPID AK SK """
# APP_ID = '16802142'
# API_KEY = 'FcIxTPz25FZOSjOfgTKfAWIn'
# SECRET_KEY = 'GKIvG4tFqqyzisDCY81ASkMihg3LHrwx'
#
# client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
# """ 读取图片 """
# def get_file_content(filePath)... | [
"[email protected]"
] | |
526a36db003f6b888927cfb7031603fc97188b7a | 2c143ba64032f65c7f7bf1cbd567a1dcf13d5bb1 | /整数转罗马数字.py | 2a08f7032b28b37c736f253256397e561ff86593 | [] | no_license | tx991020/MyLeetcode | 5b6121d32260fb30b12cc8146e44e6c6da03ad89 | cfe4f087dfeb258caebbc29fc366570ac170a68c | refs/heads/master | 2020-04-09T21:43:41.403553 | 2019-03-27T18:54:35 | 2019-03-27T18:54:35 | 160,611,089 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,205 | py | '''
罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。
字符 数值
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
例如, 罗马数字 2 写做 II ,即为两个并列的 1。12 写做 XII ,即为 X + II 。 27 写做 XXVII, 即为 XX + V + II 。
通常情况下,罗马数字中小的数字在大的数字的右边。但也存在特例,例如 4 不写做 IIII,而是 IV。数字 1 在数字 5 ... | [
"[email protected]"
] | |
5ee73a5d7a4d21e8ff1b542b13b9828616bbdac6 | e02dbefe9f362c3e9b2849c1e22c0ab27e010164 | /이것이 코딩 테스트다 - 연습문제/19. 1로 만들기.py | 18fba447785ec8766aa41a48e8bf4090b6b8e8c1 | [] | no_license | hoyeoon/CodingTest | ac77574539a7a96cbdb64eb1768ba20ab6ad3b4f | 4d34b422f0dc85f3d506a6c997f3fa883b7162ab | refs/heads/master | 2023-06-05T17:43:38.348537 | 2021-06-28T10:05:22 | 2021-06-28T10:05:22 | 378,081,127 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 738 | py | d = [0] * 30000
d[1], d[2], d[3], d[4], d[5] = 0, 1, 1, 2, 1
x = int(input())
for i in range(6, x + 1):
if i % 2 == 0 and i % 3 == 0 and i % 5 == 0:
d[i] = min(d[i - 1], d[i // 2], d[i // 3], d[i // 5]) + 1
elif i % 2 == 0 and i % 3 == 0:
d[i] = min(d[i - 1], d[i // 2], d[i // 3]) + 1
elif... | [
"[email protected]"
] | |
54ceb5d460c811307a4e5e8a7f54e6b990c302b3 | 0fbd56d4a2ee512cb47f557bea310618249a3d2e | /official/vision/image_classification/configs/base_configs.py | efdcdc0b4327871dd04a854f057cbcdf84a9db9e | [
"Apache-2.0"
] | permissive | joppemassant/models | 9968f74f5c48096f3b2a65e6864f84c0181465bb | b2a6712cbe6eb9a8639f01906e187fa265f3f48e | refs/heads/master | 2022-12-10T01:29:31.653430 | 2020-09-11T11:26:59 | 2020-09-11T11:26:59 | 294,675,920 | 1 | 1 | Apache-2.0 | 2020-09-11T11:21:51 | 2020-09-11T11:21:51 | null | UTF-8 | Python | false | false | 7,936 | py | # Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
"[email protected]"
] | |
55e3fff99a6a53657ed6aa3797ba4ebd66cd1a7a | be84495751737bbf0a8b7d8db2fb737cbd9c297c | /renlight/tests/renderer/test_sampler.py | b751d8606bc7eb66c363b055ea2f3a538bd86591 | [] | no_license | mario007/renmas | 5e38ff66cffb27b3edc59e95b7cf88906ccc03c9 | bfb4e1defc88eb514e58bdff7082d722fc885e64 | refs/heads/master | 2021-01-10T21:29:35.019792 | 2014-08-17T19:11:51 | 2014-08-17T19:11:51 | 1,688,798 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,747 | py |
import unittest
from tdasm import Runtime
from renlight.sdl.shader import Shader
from renlight.sdl import FloatArg, IntArg
from renlight.renderer.sampler import Sampler
class SamplerTest(unittest.TestCase):
def test_sampler(self):
sam = Sampler()
sam.set_resolution(2, 2)
sam.load('regu... | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.