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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e400b96c764133fc2738845f4996c3f42acc84b | 51c6c873d5c241bf54f14860522ae06feec730d4 | /recipe/filter_backends/recipe_filter.py | be99ea04a1ae086026f6e2abdc54975cc05dffb9 | [] | no_license | aabhas12/foodie | e0d69802cb40476fb9b997ea8442ffd8fcb5a1e5 | 72c4fc99a7f68996f8c845239089e0a06565a7ff | refs/heads/master | 2020-03-29T18:14:41.173322 | 2019-07-19T04:11:48 | 2019-07-19T04:11:57 | 101,239,600 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 701 | py | recipe_filter.py | from django.db.models import Q
from rest_framework.filters import BaseFilterBackend
class NameFilter(BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
name = request.GET.get('name')
if name:
return queryset.filter(name__icontains=type)
return queryset... |
f6456eb9f1f62a5c352e7e6e4a28cddc04af00f4 | 9b86e6eb9e88fb772f491deb978b5bfd99c69267 | /Assignment7/hexagram.py | 41e460e4e73101eb4335396c2fdc0f5087a2ce27 | [] | no_license | AaronLack/C200 | 0e6a324b5f8b645506cf474be5a33755f8a7f483 | ae4d4c7cf8048dd55a04b5d643c68e051b989b00 | refs/heads/main | 2023-05-01T04:43:23.287997 | 2021-05-14T22:06:56 | 2021-05-14T22:06:56 | 367,488,435 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 655 | py | hexagram.py | #Hex must be a string since it has letters
#Examples:
# C1 = 193; (12*(16**1))+ (1*(16**0)) = 193
# 7DE = 2014; (7(16**2))+ (13*(16**1)) + (14*(16**0))
# (Sn * B**n) is the formal conversion equation; where S = number digit; b = base, n = power
def hex_dec(hex):
d = {'0':0, '1':1, '2':2, '3':3, '4':4, '5':5, '... |
d229f30986d17e01f9b8ec1804c63742a2948bf1 | 040fbf650a95564c92632189687bc2a924d0a327 | /gmn/src/d1_gmn/tests/test_cors.py | 6845aad9e14545e79865ca0ef2bfd9aa83a1f438 | [
"Apache-2.0"
] | permissive | vchendrix/d1_python | 97b4e9671ae0642fdfa94054e270d44bcf1b6b6b | 0fa85c3a8de158d0225bd7428ddab3cf53a3d3e7 | refs/heads/master | 2020-03-20T22:25:55.987123 | 2018-06-15T18:33:06 | 2018-06-15T18:33:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,752 | py | test_cors.py | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... |
831d3c00233423a7de7cf93b4b3f92d225503660 | 4de306205679a5850907d9ae470af35229c7b046 | /alien_invasion/code/find_angle.py | 82a57dfceebb665a3e4e5c0f6ea2a312c66e146f | [] | no_license | EvilSpeedcore/alien_invasion | 2f6621cc8aba4878d8b349b6780e2b9dc8cc2403 | 2a8e28ebbd89d328549dd2f7932e708510c5a8b0 | refs/heads/master | 2021-07-25T12:23:51.381273 | 2017-11-03T08:47:51 | 2017-11-03T08:47:51 | 107,982,085 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,026 | py | find_angle.py | import csv
def find_angle_with_cos(value):
"""Find angle with cos value.
Args:
:param value: Cos value.
Returns:
:return: Angle.
"""
cos_values = []
cos = {}
with open('math/cos.csv', 'r') as f:
reader = csv.reader(f, delimiter=';')
for... |
597d2ff8a736375d5c340abe539a58a2471c7246 | e2b2f9a68249e44e8d7769c415310c1cfa532a14 | /fanfic/spiders/book_reviews.py | 422891cf8879cf6d808cd71a9515aa8655530b54 | [] | no_license | davidmcclure/fanfic-crawler-dev | 7d74175457a82bb833c20251ea02759c04e17638 | d60820f0f516782cebff9adf4f65296b686072e8 | refs/heads/master | 2021-01-12T14:36:28.403394 | 2016-10-31T20:56:17 | 2016-10-31T20:56:17 | 72,037,851 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,191 | py | book_reviews.py |
import re
from scrapy import Spider, Request
from fanfic.items import BookReviewItem
class BookReviewsSpider(Spider):
name = 'book_reviews'
start_urls = ['https://www.fanfiction.net/r/11863209/']
def parse(self, res):
"""
Extract comments, go next page.
Args:
r... |
932a18b6a088644225dc2a587ed2b1dfda783b32 | 10fbe5526e5f0b8588b65f70f088cd86b6e9afbe | /wulegwfs/models.py | 4f383c254284b3bf90bfe436e5614c7c6313a9d4 | [] | no_license | MarkusH/django-migrations-benchmark | eb4b2312bb30a5a5d2abf25e95eca8f714162056 | e2bd24755389668b34b87d254ec8ac63725dc56e | refs/heads/master | 2016-09-05T15:36:45.250134 | 2015-03-31T23:44:28 | 2015-03-31T23:44:28 | 31,168,231 | 3 | 1 | null | null | null | null | UTF-8 | Python | false | false | 236 | py | models.py | from django.db import models
class Txgqxz(models.Model):
kcqlpb = models.IntegerField(default=0)
pass
class Wseerbko(models.Model):
prcqiis = models.OneToOneField('esznwrr.Kgrzxxm', null=True, related_name='+')
pass
|
e79ca99cc9c70d4a8daae683b62007220219f105 | 3079cc4b6d6c48c92e547a33a00d1bbca314ce17 | /Cartpole/preTrained.py | b1edd2b40616f3910982e6c9c88be7324c45177f | [
"MIT"
] | permissive | VAIBHAV-2303/PiRL | 71f9a6b5b540475ed9c8e2128870bcbd6631a726 | 063aae20cce2bfc2911e7aff59f4a688740c44da | refs/heads/main | 2023-05-09T11:25:34.571635 | 2021-05-20T14:28:03 | 2021-05-20T14:28:03 | 369,163,062 | 13 | 3 | null | null | null | null | UTF-8 | Python | false | false | 1,538 | py | preTrained.py | import numpy as np
import gym
from functools import partial
def discretize_val(val, min_val, max_val, num_states):
"""
Discretizes a single float
if val < min_val, it gets a discrete value of 0
if val >= max_val, it gets a discrete value of num_states-1
Args:
val (float): value to discretize
min_val (... |
78434227039e94c7378bcc02cdfdcb3473bf915d | 307a2766eed113324148791df25a93128f8e33a8 | /Driver.py | 4fe7581f3d70eaaeb8857850279e7472e9feb9e7 | [] | no_license | Alex-Huleatt/Bin-Packing | d0f525c1dae0d2013b25a13781961281dad8334f | 7d90747427775f0312be058101cd5a1693390387 | refs/heads/master | 2021-01-21T02:36:15.650119 | 2016-02-16T19:32:10 | 2016-02-16T19:32:10 | 39,468,114 | 3 | 11 | null | null | null | null | UTF-8 | Python | false | false | 4,780 | py | Driver.py |
import sys,importlib,rect_collision,rect_gen,time,shutil,os,threading,random
try:
import visualizer
can_visualize=True
except ImportError:
can_visualize=False
def main():
global can_visualize
module1_name_default = "bin_packing"
module2_name_default = "naive_solution"
default_set_count =... |
0dda0e9bf56cdccb5d6ed8edebbb986ce03b293e | 3b484db8d1ae5f85e4519018ecab9caa2633d8d6 | /streettraffic/tools.py | 7c6d7ddfa9c95dfa3fe403248b6055f97857320e | [
"MIT"
] | permissive | streettraffic/streettraffic | 901a1baf1f6a03b1e255733905e491e95a2ae9d0 | 26cbda67b803eb42f3fe70354689648bafd6d718 | refs/heads/develop | 2021-01-01T18:27:12.495689 | 2018-03-15T01:18:15 | 2018-03-15T01:18:15 | 98,345,243 | 28 | 4 | null | 2017-10-12T03:31:41 | 2017-07-25T20:02:58 | Python | UTF-8 | Python | false | false | 711 | py | tools.py | import pickle
from typing import Any
def dump_data_object(obj: Any, path: str) -> None:
"""This function serialize ``obj`` and save it to ``path``
Args:
obj (Any): any serializable object(something like list, dataframe, dict, ...)
Returns:
None
"""
with open(path, 'wb') as handle... |
be46d2d7d42d386184e50374e5084ade46cd761e | 07f27a9707946c8e8e339ec6ce4b7f65d9e76c75 | /src/lib/get_environment.py | 37dda650a45bf7758433a075cd87a12adcb4240c | [] | no_license | uab-dtic/guacamole-wol | 6e713c1b72eff64a06166ef058b27857983d6658 | 37d1af1129eeff36b13de9d3a1b1a41a56df069d | refs/heads/main | 2023-02-23T23:24:39.204939 | 2023-02-02T12:56:27 | 2023-02-02T12:56:27 | 279,825,788 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 457 | py | get_environment.py | #!/usr/bin/env python3
import os, sys
"""
obtiene las variables de entorno
"""
def get_env( listaVariables=[], exitIsError=False ):
conjuntoVariables={}
for VARIABLE in listaVariables:
if VARIABLE in os.environ:
conjuntoVariables[VARIABLE]=os.environ[VARIABLE]
else:
... |
d0bf0f40a3d31b62b58c47aab5087b70b96b56e5 | 9f6becf49cf3ea3d2dea93c5c2b2845980c09d91 | /topicExtraction.py | b386d6aeebd6335a261639cf9e3ada2c03fcfaa4 | [] | no_license | WENNANWANG/CODE | 178fc8c1b6d2fb5f1b7c28133b6533cc9669e0c5 | d8cd31f6e9823ed062208d8d5fafdd786b06b313 | refs/heads/master | 2022-04-29T20:30:58.763819 | 2016-06-09T12:09:39 | 2016-06-09T12:09:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 22,326 | py | topicExtraction.py | # <automated topic extraction tool for PDF documents.>
# Copyright (C) <2016> <Maoyi Huang & Maomao Chen>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
dddfdeb50992dd217d54c20be7d7afe6916881af | 5bc7e601584c48f1010cf62d9e96fd9ffc5e91d4 | /crypto_gs15/Arithmod.py | 388e68460b9887a38133d77e48f0a806bf0881b2 | [] | no_license | callbasher/ThreeFish_CramerShoup_cryptosystems | 4507ff3d56663f6abc926583d00f2f81ad9fbb84 | 5035490afaf5c8f5b75b4588fc7de3e8bb66e52c | refs/heads/master | 2021-09-03T20:29:39.709492 | 2018-01-11T19:51:13 | 2018-01-11T19:51:13 | 113,366,897 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,439 | py | Arithmod.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# function that xor 2 list of binary str value
# bin_str0 = list of str
# bin_str1 = list of str
# result = str
def xor_bin_str(bin_str0, bin_str1):
result = bin(int(bin_str0, 2) ^ int(bin_str1, 2))[2:]
if len(result) < 64:
result = "0" * (64 - len(result)) +... |
2ac64ed7fd4409ac9cef3d63c5cb64c0108655ac | e4bfac05697609e691c480aa9cd8aeae292e2314 | /Flask_server/translateProductName.py | 4cdaa60a3caa425a0e104d5aac3569813363bb77 | [] | no_license | kpuce2021/Dandelion | 61434e58b6c285c2f780f2427c862b5818a3701a | 174371c1e66cda97778007b30ac33f7d273b9603 | refs/heads/master | 2023-08-11T04:59:29.694873 | 2021-10-08T16:42:58 | 2021-10-08T16:42:58 | 325,019,782 | 1 | 1 | null | 2021-06-15T07:16:18 | 2020-12-28T13:26:36 | Kotlin | UTF-8 | Python | false | false | 661 | py | translateProductName.py | def translateName(enProductList, transProductList, productName):
if productName in enProductList:
return transProductList[enProductList.index(productName)]
else:
return "없는 내용 입니다"
productEnName = ['Pepero_Original', 'Pepero_Crunch', 'Pepero_Amond', 'Jollypong', 'Chocosongyi',
... |
c65c9d7d85e2ddb99be517390052c4f247cb617d | 9ee73f30cc76adaa000f85f1faa2902077d62a91 | /file01.py | d2812bf80b92e6c6d5e0420c243509feff2798a8 | [] | no_license | ygstart/basic1 | 5dda6b34501eae4176e04e2e4f19c90292e322d2 | 9869ea64ed2c47b4b0a36d4cbeaeb0f767b8eace | refs/heads/master | 2020-03-26T16:09:37.633101 | 2018-08-17T07:49:04 | 2018-08-17T07:49:04 | 145,085,332 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 113 | py | file01.py | num1 = 10
num2 = 20
<<<<<<< HEAD
num3 = 3000
=======
num3 = 300
>>>>>>> 4629dfa7bf977c9435433367a2619090ab0f9c90
|
ea7d3800469a0dffcfa010790ea97e843862a835 | b766dc0bebf4ac180354b99bd41c8be159f3a4ea | /song.py | 7c127b14d1f6e1cc0cd204d8659edad7edc44f1a | [] | no_license | Brandon-Fong/Lyric_Bot | 8a1cf3bb953f4542177af0af8a546054ba162d3a | a8571570eafd4882d9d50b4c1dba3415125ff17c | refs/heads/master | 2021-05-13T21:06:34.076382 | 2018-01-08T14:18:34 | 2018-01-08T14:18:34 | 116,453,664 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 247 | py | song.py | class Song(object):
song_request = ""
lyrics = ""
def __init__(self, song_request, lyrics):
self.song_request = song_request
self.lyrics = lyrics
def songlyrics(self):
return self.lyrics
def songname(self):
return self.song_request |
a03fd8adf83d8b5cdead6411708ed46359c3ade1 | f9d661bd9d08615c883b6d903b6079eb7c73ca12 | /tests/test_presentation.py | f42d0cc239a2b78bc1ca2d5dc1b7ad23f442028c | [
"MIT"
] | permissive | mindscale/firstaid | 81b36d088a8a34a3fabf23ca36b5a7806464e335 | 18c12e9b93af54fcfed3e5681ceb5495aa6a5bad | refs/heads/master | 2020-03-06T15:53:26.077110 | 2018-04-12T09:27:48 | 2018-04-12T09:27:48 | 126,963,615 | 0 | 2 | null | 2018-04-12T09:27:49 | 2018-03-27T09:37:31 | Python | UTF-8 | Python | false | false | 4,319 | py | test_presentation.py | from itertools import combinations
from pathlib import Path
import unittest
import pandas as pd
from firstaid.pptx import PPTX, LineChart, BarChart
def test_bulletpoint1():
p = PPTX()
p.add('This is a test', ['first bullet', 'second bullet'])
p.save('test_bullet1.pptx')
def test_bulletpoint2():
p =... |
0a9b64aec1bc5e4b917c5e9a716c02c860c4a173 | 9357d7277d02e6191a5959e4e9670ec9668f22e1 | /ch3/list/07_list_append_ex3.py | 30c5d96cb836272d683a61433d3e1872b5f3bfa4 | [] | no_license | yschoi9930/PythonStudy | b708bd487e94accba233d1185d226434bf650f67 | 2ff351735708aaca7b4aeefc34b0aa066fe53436 | refs/heads/master | 2023-02-11T06:10:17.736603 | 2021-01-07T02:57:37 | 2021-01-07T02:57:37 | 325,318,699 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 418 | py | 07_list_append_ex3.py | # 상품을 리스트에 추가
# 엔터키 누르면 입력 종료되고 등록된 상품 리스트 출력
products = []
while True :
product = input('상품등록(엔터키만 누르면 종료) : ')
if product == '' :
break
products.append(product)
print('등록된 상품 : ', end=' ')
for product in products :
print(product, end=' ')
nums =[1,2,3,4]
nums[2:2] = [90,91]
print(nums)
|
4ae2b389396c62fe7143eef92a646525619f1df9 | c3208d19b559e884c689c115f0dc31a7390f5dda | /099 Notes Under preparation/old/etc note files. Need to move to main files and delete/Jupiterised/30-CompositeDataTypes/30.8-MappingTypes/30.8.4-DictionaryMethods.py | 08f9d78775c9203a6cb960f95f5dd531976d95fa | [] | no_license | zachsaeed/python_notes | cc750ee16dc0d7e9ddb62b8a95b93ce335933fc1 | 9fd8cbb7b5a2dc9d30ca87b71f199003b01e77b3 | refs/heads/main | 2023-09-02T15:13:09.039082 | 2021-11-22T01:29:57 | 2021-11-22T01:29:57 | 399,943,913 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,795 | py | 30.8.4-DictionaryMethods.py | # Changed in version 3.8: Dictionary views are now reversible as they preserve insertion order.
# clear()
# empty out a dictionary
d = dict(a=1, b=2, c=3)
print(d) # {'a': 1, 'b': 2, 'c': 3}
d.clear()
print(d) # {}
# copy()
# Will make a copy (clone) of the dictionary
d = dict(a=1, b=2, c=3)
d2 = d.copy()
print(d ... |
5005e7894bca3baf32abd59cc5d6fc237952d10d | 03bf4850d1baefa6ab463d5053113d9b099715e5 | /backend/scripts/add_user.py | 2b8f5dc8d68e5ff04603b8179ad6705b90b5fb74 | [] | no_license | tanaki1609/covid-supply-info | 7211d7cc27dd57b51e722760f2c7401653814b4f | cfafe1241d5b0993c30fbde1d68b32fb208d5448 | refs/heads/master | 2023-02-12T04:18:23.492402 | 2020-08-03T07:40:55 | 2020-08-03T07:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 602 | py | add_user.py | from django.contrib.auth.models import User, Group
from distributor.models import Hospital
def run(*args):
for line in args:
username, password = line.split(':')
try:
hospital = Hospital.objects.get(code=username)
user = User.objects.create_user(username, password=password... |
7af5f23b9fe1bfd5f568e9426c920c3d98496de2 | e6696e1871ea190001d4ff94b4fc0ad219c37a6c | /programas de analisis electrico/analisis python/funciones_teoria.py | c1d3044383ebab08c37bb263ad5d6ff4e17151d2 | [] | no_license | MatiasZanini/Tesis | 094890a3eec8f56bd0426e8b3bb111e15a129c1c | 488e5bec74fcf909f573c999ef5c6bef4133b057 | refs/heads/master | 2020-03-27T05:14:59.345292 | 2019-03-08T22:56:58 | 2019-03-08T22:56:58 | 146,004,717 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,470 | py | funciones_teoria.py | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 17 10:21:28 2018
@author: Matías
"""
import scipy.special as special
import scipy.integrate as integrate
import scipy.constants as ctes
import scipy.misc as misc
from scipy import interpolate
import numpy as np
import matplotlib.pyplot as plt
#%%
# Integral util para e... |
f2605f1104588004967ecc70f536482ab2c2680c | 35b2c6e3c3ec0ecadc2aa8f745bf72b61b083fb9 | /products/views.py | 68718640000ba9e971b8c4bfed687876038d29fa | [] | no_license | vinayvit/chatCP | 8019df676ddc7bc982ce56b0c4b2b64906f88cb6 | b2cb96edac64a803f6aa12768c0fdc53b25feb5e | refs/heads/master | 2021-01-20T18:43:33.879644 | 2016-06-21T10:28:05 | 2016-06-21T10:28:05 | 61,624,977 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 13,289 | py | views.py | from django.db.models import Q
from django.db import models
from django.http import Http404
from django.shortcuts import render, get_object_or_404
from django.template import Context
from products.models import ProductManager, Product
from django.views.generic.detail import DetailView
from django.views.generic.list imp... |
e8a2b68bebd2bad6dc692fa272384c8a3cfc07a9 | a9b32d40b6ad68e1b09fc8fccac4e10e853e034b | /day02 while循环和编码/while循环.py | b4f59be5216127d915cfd908eb030ae7a4f7c34d | [] | no_license | dkaiyun/pytho_code | be181a3cba8424f4d6eeeb601e2c80ab343a0433 | 0be8a42338b00a77abb456d0079354b161343595 | refs/heads/master | 2021-06-29T16:16:10.475842 | 2020-12-22T09:51:14 | 2020-12-22T09:51:14 | 200,608,465 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 279 | py | while循环.py |
# num = 1
# while num < 3:
# s = input("随便输入: ")
# print (s)
# num = num + 1
# sum = 0
# num = 1
# while num <= 100:
#
# sum = num + sum
# num = num + 1
# print(sum)
num = 1
while num <= 100:
if num % 2 == 1:
print(num)
num = num + 1
|
293a8e04a1700d73ca4558b671588d0895142276 | 646cadb1c72ef4a060343baf2fcbe271958b6878 | /tigerjython/TJ4KidsExamples/Tu14b.py | f6f17d75020e579546e0d07c3d0491fc7616a9d4 | [] | no_license | tigerjython/tjinstall | bd75cf8e4ae27b639a13865ef1ec5710391a2938 | aab61519b5299c2ab4f423c6fc5d8ea7c7860a99 | refs/heads/master | 2021-01-17T08:53:50.386905 | 2018-01-12T06:56:28 | 2018-01-12T06:56:28 | 40,659,466 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 274 | py | Tu14b.py | from gturtle import *
makeTurtle()
hideTurtle()
setPos(200, 0)
left(90)
wrap()
enableRepaint(False)
i = 0
while True:
clear()
drawImage("sprites/pony_" + str(i) + ".gif")
repaint()
delay(60)
forward(5)
i += 1
if i == 7:
i = 0
|
2473c868171710d91d61c6a6eff98194db7e64e5 | 6eac6231366615225ecf35f6e0c0aeec7ddb49e7 | /asteroids.py | 1851bcf7a694bfdae2372d6dddf4ccfd2355fbd7 | [] | no_license | izgebayyurt/asteroids | 2bae43ebf3706f5969ee934d6e6079c0fdb8a591 | c49651f8bcbde1cd2ce60a794eff8b7f6c4d7298 | refs/heads/main | 2023-05-22T06:35:56.202938 | 2021-06-14T14:14:06 | 2021-06-14T14:14:06 | 338,208,275 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 23,191 | py | asteroids.py | # Izge Bayyurt
# CS152
# Project 11
# asteroids.py
# This is the game file for full asteroids game
import graphics as gr
import physics_objects as pho
import collision as coll
import ship
import random
import math
import time
def bubbleSort(list,i):
""" Sorts a list of numbers in increasing order.
The paramet... |
7d6f214c2ab4e7f8013dd00245b2383af4a447b4 | 6a6bf5635955fcc1874d662e336a8da53552a78b | /InvalidIntException.py | 190d5c1e0ed748459964310d9722498ce681c464 | [
"Unlicense"
] | permissive | juhyun0/python_except | 817b0e4fa5788db9a7953a08d3bc954b947a1f30 | d92c37796a296bf68348627131cf972308bd2c46 | refs/heads/master | 2021-04-27T14:24:22.330345 | 2018-02-22T08:56:39 | 2018-02-22T08:56:39 | 122,453,442 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 637 | py | InvalidIntException.py | class InvalIntException(Exception):
def __init__(self,arg):
super().__init__('정수가 아닙니다.: {0}'.format(arg))
def convert_to_integer(text):
if text.isdigit(): #부호(+,-)처리 못함.
return int(text)
else:
raise InvalIntException(text)
if __name__=='__main__':
try:
print('숫자를 입력하세요... |
d6151b741c3386b7a54bfa70bbec43cdfc582556 | e29e066cfe8c9caa0267dbea6cd1e56d1e1a600d | /week5_dynamic_programming1/1_money_change_again/change_dp.py | e8c5c949f774b7d43d78d83d1eddb8c30cc20806 | [] | no_license | akashzcoder/Algorithmic-Toolbox | 32e4984129de4d29dee1226e552992329c4f0885 | 1db5b220b3170231f49e2d93b1aafc9fcb283509 | refs/heads/master | 2022-12-08T20:09:30.990272 | 2020-08-25T23:25:10 | 2020-08-25T23:25:10 | 290,335,144 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 483 | py | change_dp.py | # Uses python3
import math
import sys
def get_change(m):
money = int(input())
denominations = [1, 3, 4]
minCoins = [0] + [float('inf')] * money
for i in range(1, money + 1):
for j in denominations:
if i >= j:
coins = minCoins[i - j] + 1
if coins < mi... |
9b55353ce7135aab9efe7ee18f4f1f3b4c786639 | b626f276aa5d2efd332c9f40f5f0d03d804df78b | /processor/spider/b3log.py | 6e37b9d7ff77fdfcbfed1d7b5c3d213b78b624c6 | [] | no_license | fuermosi777/ziyue-django | 45962d4e4469cee7c5c6658c59c4be0361ed1e74 | 8896c8dccd4f11e764bf1f008df2bb63f1bdcd35 | refs/heads/master | 2021-05-01T04:32:41.361798 | 2015-10-01T01:41:16 | 2015-10-01T01:41:16 | 41,509,922 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 223 | py | b3log.py | import basic
def crawl():
return basic.list_rss_crawl(url='http://88250.b3log.org/blog-articles-rss.do', title_select='title', body_select='section.article-body', remove_tags=[])
if __name__ == "__main__":
crawl() |
fe9f4a7d00ddfa4ce4b5b5e4096d9197e91f40d7 | 846556273884898ec3ccd2c13b39ddd9a75fef7f | /chapter 8/Hat.py | fa163228e97cfbf9542cc271dee2382ad08c06c6 | [] | no_license | gitviviane/python-scipro-solutions | 647b2ac1391cc1a97e90ce2fec1e18925308288f | 7874cd292d6b58315bd170889dc22aeac14396f8 | refs/heads/master | 2021-12-11T02:25:49.109640 | 2016-10-18T16:11:13 | 2016-10-18T16:11:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,234 | py | Hat.py | """
Exercise 8.19: Make a class for drawing balls from a hat
Author: Weiyun Lu
"""
import random
class Hat:
def __init__(self, **kwargs): #allows a variable number of keyword colors and numbers
self.hat = []
self.colordict = kwargs
self.reset()
def reset(self):
... |
5e7fb31977b5f0f953a8f6d7120125ee0b85e547 | 7e35f932e8492f500887ac1538aa2802777a062b | /searchAlg.py | 2c1ff7d15874b736c7c034769946dfdec58f0fab | [] | no_license | DevanB12/Search-Algorithms | 9322fef49f4851e8f5b9ec500003bb81618dd77f | 17f9890172dfebe4f3b8fb4a3c3fa5499ddec587 | refs/heads/main | 2023-03-30T12:54:57.064057 | 2021-04-05T15:02:45 | 2021-04-05T15:02:45 | 354,872,935 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,680 | py | searchAlg.py | import random
import time
def sequentialSearch(alist, item):
pos = 0
found = False
while pos < len(alist) and not found:
if alist[pos] == item:
found = True
else:
pos += 1
return found
def binarySearch(alist, item):
if len(alist) == 0:
... |
db9c24b6436fe5340b12fb0c69419af198252f93 | fde186bd141ed055ba8ab915b2ad25355f8f3fb6 | /ABC/148/E.py | 2b91d3b55faeef4d4a0d367f1d276c35aa53a686 | [] | no_license | Tsukumo3/Atcoder | 259ea6487ad25ba2d4bf96d3e1cf9be4a427d24e | 5f8d5cf4c0edee5f54b8e78bc14a62e23cab69cb | refs/heads/master | 2020-12-20T05:04:39.222657 | 2020-10-17T01:39:04 | 2020-10-17T01:39:04 | 235,969,950 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 746 | py | E.py | class FactCounter:
def __init__(self):
self.counter5 = 0
def factrize5(self,n):
if n%5 == 0:
self.counter5 += 1
self.factrize5(n/5)
else:
return
def even_function_num5(self,n):
if n < 2:
return
else:
sel... |
113a3d1573452ac1be87d2ab34a80ca899743dc1 | 6cca802dcb2f5a72621f37b080879dba65a37a6e | /luminarpythonprograms/OOPS/Bank.py | c07f1fdb012e9888daee01ba3f158e4b12cce15a | [] | no_license | fathimashibila/pythonluminar | aedc2205e4a8566df830ed83e64b684e38a587e9 | 694259f40dd386c55bdafc6b4128cb6b2ab7889d | refs/heads/master | 2022-12-25T13:38:58.425049 | 2020-10-09T14:26:10 | 2020-10-09T14:26:10 | 290,123,294 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,116 | py | Bank.py | import datetime
class person:
def setvalues(self,pname,age):
self.age=age
self.pname=pname
def printvalues(self):
print(self.pname)
print(self.age)
class bank(person):
def __init__(self,acntno,personalname,balance,bankname):
self.acntno=acntno
self.personalnam... |
33c3cc059e445458e8260783d6e7f17dd837915c | 8957493d2f10407605afc130c8f3011bde922006 | /end/cls_Cnn/checkpointer.py | 59df20b2667d1dea745be9c9e5650902e626e577 | [] | no_license | JoeshpCheung/transformers_cls | bc9d9e59c5f1bdeef1ab16a8fefb1d4752587b09 | 33f6205697fc6bc9e07df14594afabd74a905759 | refs/heads/master | 2023-04-16T05:39:32.859349 | 2021-04-25T17:20:01 | 2021-04-25T17:20:01 | 361,485,645 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,903 | py | checkpointer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~
:author: JoeshpCheung
:python version: 3.6
"""
from typing import Union, Dict, Any, List, Tuple
import logging
import os
import re
import torch
logger = logging.getLogger(__name__)
MODEL_STATE_PREFIX = 'model_state_epoch_'
MODEL_BE... |
6273858068171955d5750e653c93c9daa335ad60 | 9e2c62d8488d3fc4692f913f019c26410bc47067 | /xrayclassifier/reproduce_run_nn.py | a8620ed350da68066e35e7a3bdc5e87df5429248 | [] | no_license | AbhiDeb/xray-classifier | 39ea629ae5c606dc63b16718e8a3d0ac41b738ee | bd1391f43aab30824f7923330fa63bfeea650f9e | refs/heads/master | 2023-06-08T17:47:10.512421 | 2021-06-30T09:40:07 | 2021-06-30T09:40:07 | 381,618,169 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,795 | py | reproduce_run_nn.py | #
# reproduce_run_nn.py
# Fetches the model run_uuid from the tracking server, reads the parameters saved,
# and recreates the experiments and runs. In essence it trains the model and predicts
# with all the parameters used from previous experiments.
#
from xrayclassifier.train_nn import KTrain
from xrayclass... |
242fa00a68dd71c45958baca60b236d322cd828b | aa3741a4edadd5acd407137554fbc8ad202a23e0 | /Google/Hangman/HangmanApp.py | 6f2ac56d96eaf1e0cbcfe17a5ca8a83af1cfa7d4 | [] | no_license | Padreco-lbr/Interview-study | ab5c343c8415a0b7b7769d2029bf7762d661d36d | a644d97e26d3a7893b40396abe07715fc9294802 | refs/heads/master | 2021-10-11T08:49:09.644126 | 2019-01-24T00:38:45 | 2019-01-24T00:38:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,839 | py | HangmanApp.py | # File: HangmanCanvas.py
# ------------------------
# This file keeps track of the Hangman display.
import kivy
import os
from pprint import pprint
from inspect import getmembers
from kivy.app import App
from kivy.config import Config
from kivy.uix.gridlayout import GridLayout
from kivy.uix.textinput import TextInput
... |
79afb130ac2286e097d4bf1702cfb1ee23a642e7 | 85c544acf4810af63c7087a55753fb3e3561119d | /sample/common.py | 1927d0c2e6b34c669d257607d5b0ccd5259538a6 | [] | no_license | bluele/Dym | 53f63a8648abb86d2337f8d8efca2bea2067ba49 | f8037db31e4e52f506a2885a06816e3cb1e2bc74 | refs/heads/master | 2023-05-31T12:27:09.931724 | 2012-02-02T13:49:35 | 2012-02-02T13:49:35 | 3,321,533 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 733 | py | common.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
from dym import Dym
def main():
# Right command line option list.
ok = ("help", "init", "add", "find", "find-name")
USAGE = '''
<USAGE>
test.py <option>
option:
''' \
+ "\t\t%s\n" * len(ok) \
% ok
if... |
2301c41d58bf4bb24da19c89b51b04db32ab4c5d | 3db45e06229498f873795820e4d765a5567dbe4c | /passport_server/create_tables.py | 037871fe9c4e00743e5279b315498bfb09e73675 | [] | no_license | sammyers/24HourPoE | 2661cdd7ef24844b38d8a8d66a0a493353ae2432 | 216dc7e05757607951886f214de14456834e1fc2 | refs/heads/master | 2022-12-14T05:43:39.895233 | 2018-12-02T18:38:24 | 2018-12-02T18:38:24 | 159,973,329 | 0 | 0 | null | 2022-12-10T02:23:27 | 2018-12-01T18:11:23 | Roff | UTF-8 | Python | false | false | 502 | py | create_tables.py | import sqlite3
DB_NAME = 'bufalonia.db'
def create_tables():
conn = sqlite3.connect(DB_NAME)
cur = conn.cursor()
cur.execute('''
CREATE TABLE IF NOT EXISTS applicants
(id text PRIMARY KEY, responses text)
''')
cur.execute('''
CREATE TABLE IF NOT EXISTS r... |
b5cd06b5a31d7ffba4c4fc00b1de1404544f4b78 | 89097bf3ae24e1f1dd884db4b4aedc1054a44565 | /apps/bot/migrations/0009_auto_20201104_0431.py | c5562f9a75ed7ee60a9de311a8e60eb411259184 | [
"MIT"
] | permissive | thallkeer/petrovich | 253a0ab2a4d26d2377659579f7511a4da8d6c54b | bfa1fb2610859ef3fb770ebc91081eea548cada0 | refs/heads/master | 2023-02-01T15:46:59.243685 | 2020-12-19T21:50:14 | 2020-12-19T21:50:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,700 | py | 0009_auto_20201104_0431.py | # Generated by Django 3.0.8 on 2020-11-04 00:31
from django.db import migrations, models
import apps.bot.classes.Consts
class Migration(migrations.Migration):
dependencies = [
('bot', '0008_auto_20201104_0344'),
]
operations = [
migrations.AlterField(
model_name='bot',
... |
f669e41823c2c731b3ea452cf4b5860d6ac3527b | 8ebfcfbabf464cee6378a706e2fccc02de6e6e3a | /Comparative.py | 0865487a90862c246a0a06036ac839cf04ae6a3c | [] | no_license | surya-lights/Python_Cracks | b9751f4cabbf109ef05805f1196cd3db13086af7 | b2a45176818d7704fd11bbff912c697befb12f83 | refs/heads/master | 2023-09-03T13:36:01.784254 | 2021-10-28T12:20:07 | 2021-10-28T12:20:07 | 411,186,276 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 684 | py | Comparative.py | a = 10
b = 20
# if two operands values are equal,then the condition becomes true.
print(a == b)
# if two operands values are not equal,then the condition becomes true.
print(a != b)
# if the value of left operand is greater than the value of right operand, then condition becomes true.
print(a > b)
# if the value of... |
200d31454a48112a11fcab4491c392a15cc5f3e0 | 0d9979de5a5b2a1dfc828fc1ca50f9fc566c68a4 | /7_new_document/test_module.py | faca1b21970d2d7418d59e590e70f99dd3db19f4 | [] | no_license | schomper/jasper | cccbee864459403f96be285fbbc82a1351a42ca4 | 4967c7a040701a9a0882631340785d7bb8211602 | refs/heads/master | 2020-05-30T00:38:43.513713 | 2015-10-20T02:16:56 | 2015-10-20T02:16:56 | 42,302,244 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,496 | py | test_module.py | #! /usr/bin/python3
import unittest
from utils import *
class TestUtils(unittest.TestCase):
# TODO: def test_remove_stopwords(self):
# TODO: def test_clean_line(self):
# TODO: def test_stem_line(self):
# TODO: def test_check_start(self):
def test_remove_digits(self):
test_string1 = '2... |
80c8b4dde8a6446b39691ef8b7279fd6b403482c | dcad5c30c1e3367a8b42a2b2bf60d065bc793ccc | /differ/db/token.py | e39c93ee2f728f8a51528c6b424a1998d20b5efe | [] | no_license | ariataylor96/differ | 14a7666250626503ca48213f60e3ff0d60614614 | 15cb740ca8558238d9454dc053e903413ec45914 | refs/heads/main | 2023-07-16T21:08:06.270605 | 2021-09-07T21:58:40 | 2021-09-07T21:58:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 223 | py | token.py | import secrets
from .base import BaseModel
from peewee import CharField
class Token(BaseModel):
user = CharField(unique=True)
value = CharField(default=lambda: secrets.token_urlsafe(32), index=True, unique=True)
|
eefcf0e2e2ca888d35dc2d3f89ebdfde4d524758 | 02459256e0c48be56eebc069d12b9cdebabb0d3b | /converter/exchange/urls.py | 081af8c1e7865799bd3e237c162771853791395e | [] | no_license | midezz/test-proj-converter | f2299c356e9dc1ce69c7f917f0ab61f8ea2d1bc1 | 43d1a29c994beed04ae65e03fa97adf19d9960ef | refs/heads/main | 2022-12-24T10:06:22.188572 | 2020-10-08T08:11:46 | 2020-10-08T08:11:46 | 301,988,796 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 233 | py | urls.py | from django.urls import path
from exchange.views import ConvertView
app_name = 'exchange'
urlpatterns = [
path(
'convert/<str:from>/<str:to>/<str:value>/',
ConvertView.as_view(),
name='convert'
)
]
|
fa6f3ffad64c9f6ed71cb415f257417fa30c6a47 | 95e7ea67986bcc821cde0b1009c8ca3108778aac | /config.py | 07f95e137ce7353b48ee0b67df979b2497f7acb7 | [] | no_license | Kideri/CW_Ping_bot | 5e46a6d8386049f3e69fe61282af8f8907086330 | 97a7a329f9f120bd83be5225f21643e462586ace | refs/heads/master | 2022-11-27T07:14:50.464022 | 2020-08-05T10:54:36 | 2020-08-05T10:54:36 | 282,953,652 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 54 | py | config.py | token='1184472795:AAHrLGX9kC7CJKeLJKtBmfHFPl-Gmga6RXY' |
651e5abd30cada1b31d4b85df5941c01a8ca0359 | c20d163f981aa753aaf1d51b5b49016e1d68ff61 | /services/ner_service.py | c324ae1d321b647b28bb4d4423a1b43df073cebf | [] | no_license | shkarcot/ZZZtesting | b8afc4f0d79486f8d5d57492f1a4891233196684 | 924e390325e0b55a852dd6ec7587d4e61e7bf558 | refs/heads/master | 2020-04-24T02:39:07.853125 | 2019-02-20T10:48:47 | 2019-02-20T10:48:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,697 | py | ner_service.py | """
@author: Manoj.kr
@date: october, 2018
@purpose: The functions mentioned in this python file are responsible
for all kind of NER service related operations.
All functions are exposed as APIs.
"""
import json
import traceback
from uuid import uuid4
from xpms_common import trace
from config_vars ... |
d893932871887aca660aae705b181a10a9d9c085 | 1b017affcaa09e0ff9b237e65ccf4d320afd7abb | /reports.py | a0d22d69eeb9399c1582727ec6538c6206ca14a2 | [] | no_license | CodecoolMSC2016/python-game-statistics-3rd-si-FerencOnodi | 6866960d96e649f03c6996a3ba62fc2150402e6b | 8a159a5f214266c7dc518805ac3650a4513ccaf0 | refs/heads/master | 2020-07-12T13:52:25.077267 | 2016-11-20T17:45:34 | 2016-11-20T17:45:34 | 73,906,587 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,736 | py | reports.py |
# Report functions
import csv
import operator
print("Greetings, Judy!\nFirst you will have to enter the name of the file which you want to use, then select from the main menu!\n")
filename = input("From which file do you want to read in information? ")
print("\nMain menu:\n1. How many games are in the file?\n2. Is t... |
ce55afcaabfaccbf0f6eb1fc5c644ca0e00d3264 | 42d59be1fcdec2cbd455b28d89d09fda02f39289 | /config.py | 3f6ad249f061d2456835532a63cd3bfc20cca806 | [] | no_license | instructor-rod/system_design | f2be89dbae1dcec1ab7811703766c538d8d7998a | 70e6737206faeb9b136feb20b364885adf58a265 | refs/heads/master | 2020-04-25T18:34:52.348506 | 2019-02-27T21:44:28 | 2019-02-27T21:44:28 | 172,988,973 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 85 | py | config.py | DB_HOST = '192.168.1.27'
DB_USER = 'db_guest'
DB_PASS = 'codingdojo17'
print('*'*50) |
b49b7eb9d31c7e9c07cd167e78b7645d71082cea | 75fdff0eebb3c20ed6584d2989e1d73bbadd3d16 | /manager/base_class.py | 2c55e6c7ac0ace40429e6fbad2257d6a1e06fdb5 | [] | no_license | xxr3376/Distribute-Crawler-Manager | eb3ebaa227fdfb7e80d63c5b26d092c804b54e75 | 8e83c7064bc0d86e548ddf2e058775ab559bf5f6 | refs/heads/master | 2020-05-17T07:45:30.149142 | 2014-08-24T08:34:09 | 2014-08-24T08:34:09 | 22,407,903 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 991 | py | base_class.py | #!encoding=utf-8
import config
class TokenExist(Exception):
pass
class TokenNotFound(Exception):
pass
class AgentHandler(object):
def __init__(self, token):
self.token = token
self.state = 0 # supervisor STOPPED
self.name = config.SUPERVISOR_NAME_TEMPLATE.format(token=self.token)
... |
a34ada43d82b1be4c3ddc92c1e48c08b1afb737d | d4c0a524b9d1b7c4daa5de8b2a088c0eef01114e | /exercises1/OpenCV_TEST_LoadVideo.py | a76aca954cfec66a39ad41f6db3d631dc593cc3c | [] | no_license | MartinFaartoft/sigb | 5a3bea68db6ef87f45b6cf01acd2b39b45bf761c | f902f3ee6c838de4c032d0c1fadd30dad29d5cd0 | refs/heads/master | 2021-01-06T20:42:24.003763 | 2014-05-18T09:05:23 | 2014-05-18T09:05:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 261 | py | OpenCV_TEST_LoadVideo.py | import cv2
cap = cv2.VideoCapture("test-03.avi")
cv2.namedWindow("input")
f=True
while(f):
f, img = cap.read()
if f==True:
cv2.imshow("input", img)
ch = cv2.waitKey(1)
if ch == 32:# Break by SPACE key
break |
625470cf00bcab0611ba71add0ab9906dfb89c9a | 17f527d6936397270183a35d7097e0a99de16cb5 | /AtCoder/ABC/51_c.py | 9764cbdab7738569ed8b1439ab4126a644c0dca0 | [] | no_license | ryosuke071111/algorithms | e942f043d08c7c7e2c926ed332ee2b8c44bdf0c5 | 867764450cc0f2a709fa2f743d9a0d95001e9296 | refs/heads/master | 2020-05-14T17:14:39.314064 | 2019-04-17T12:58:12 | 2019-04-17T12:58:12 | 181,888,623 | 11 | 0 | null | null | null | null | UTF-8 | Python | false | false | 177 | py | 51_c.py | sx,sy,tx,ty=map(int,input().split())
tx-=sx
ty-=sy
ans=""
ans+="U"*ty+"R"*tx
ans+="D"*ty+"L"*tx
ans+="L"+"U"*(ty+1)+"R"*(tx+1)+"D"
ans+="R"+"D"*(ty+1)+"L"*(tx+1)+"U"
print(ans)
|
1cc7df46a870fa314f4b11152794f748164b1f5b | da90f3255fa10375a792ceda2e0de92712d6b736 | /compress.py | e117669dac95839521f5b29d804ce832a5addc4f | [] | no_license | ashasatya/SimplePrograms | 1ab0f6d587d02f26d7c00299986a1621b1f5a6e2 | 8f2ca0c4da318f0ddf91d0df43acab2a78229ac7 | refs/heads/master | 2021-01-03T01:50:54.516733 | 2020-02-11T22:16:53 | 2020-02-11T22:16:53 | 239,864,638 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,412 | py | compress.py |
#
# strng = "Reallly"
#
# lst_strng = list(strng)
# count = 0
# i = 0
# new_strng = []
#
# for i in range(0, len(strng)):
# if lst_strng[i] != lst_strng[i+1]:
# if count != 3:
# new_strng.append(lst_strng[i])
# i += 1
# count += 1
# # print(count)
# else:... |
193e46afd35ba6bf51736a6f5f35bc3f6c2c80c3 | 2f77ec53f3597cc772e3b3566a45082f3f9013c5 | /demo/demo_onnx.py | 9ea94a27923ac2f381b246542f2eed7496ebe8cf | [
"MIT"
] | permissive | jmu201521121021/ssd.pytorch | 0265d4fb3372dbcbf081a005fc911517cb4c9181 | dd85eda6241495ea36b7d2cbdbdfabe52cbfd12e | refs/heads/master | 2020-12-01T03:38:40.241005 | 2020-01-02T14:59:52 | 2020-01-02T14:59:52 | 230,549,555 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,929 | py | demo_onnx.py | import numpy as np
import onnx
import onnxruntime
from layers import *
from data import voc, coco
import torch
import cv2
if __name__ == '__main__':
from data import VOC_CLASSES as labels
num_classes = 21
cfg = voc
priorbox = PriorBox(cfg)
with torch.no_grad():
priors = prior... |
ad26cc9cfde59904ae2e0e317d0bce25a774e162 | 78eb766321c7ed3236fb87bb6ac8547c99d0d1a4 | /oneYou2/pages/tests.py | 73b7eebc70ced4f374d8d1180d24926b193084b8 | [] | no_license | danmorley/nhs-example | 9d7be76116ed962248e1f7e287355a6870534f5d | ae4b5f395d3518ee17ef89348ed756c817e0c08c | refs/heads/master | 2022-12-13T02:13:18.484448 | 2019-02-28T11:05:31 | 2019-02-28T11:05:31 | 203,353,840 | 1 | 0 | null | 2022-12-07T04:29:46 | 2019-08-20T10:30:15 | Python | UTF-8 | Python | false | false | 21,655 | py | tests.py | import json
from collections import OrderedDict
from unittest.mock import patch
from django.core.handlers.wsgi import WSGIRequest
from django.http import HttpRequest
from rest_framework.utils.serializer_helpers import ReturnDict
from wagtail.contrib.modeladmin.views import IndexView
from wagtail.core.blocks.stream_bl... |
0cb07c3e3104a38fe3987d7a432b1461e71ed23a | 56953d87029820bcc695f428ea5d663e827aaf2d | /diagonal_diff.py | 24ec4409431bab93192ec709615c4f513edc2b6c | [] | no_license | anishakthi/pythonPrograms | d5b1230e8c04b35433125300ab6a869a6591c997 | 2dfc44be7fd9ab8a2a898b4c03d3a6bcdcf5f5d8 | refs/heads/master | 2021-01-19T19:39:48.375611 | 2017-04-16T18:29:23 | 2017-04-16T18:29:23 | 88,434,284 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 609 | py | diagonal_diff.py | size = input("Enter the size of the Square Matrix : ")
matrix = [[0 for x in range(size)] for y in range(size)]
primary = 0
secondary = 0
# get values for matrix
for i in range(0, size) :
for j in range(0, size):
matrix[i][j] = input("Enter the matrix value of matrix[%d][%d]" % (i,j))
for i in range(0,si... |
a15ddcdc69e97cfcbef439170a2b868568e684bd | f9bf5c13adb7e1f8d28806c153754263e2dd3ff7 | /q01_calculate_statistics/build.py | 460db0721d6435016a3be504f450a63365fe4896 | [] | no_license | sannidh/descriptive_statistics_project | bd4bc1bda84a5480df2f7436410927814f2d40b1 | f659f5b9ab6884934aca9c8a6d2972832a7a9472 | refs/heads/master | 2020-03-30T07:55:04.740548 | 2018-09-30T15:34:38 | 2018-09-30T15:34:38 | 150,974,430 | 0 | 0 | null | 2018-09-30T14:29:39 | 2018-09-30T14:29:39 | null | UTF-8 | Python | false | false | 442 | py | build.py | # %load q01_calculate_statistics/build.py
# Default Imports
import numpy as np
import pandas as pd
data = pd.read_csv('data/house_prices_multivariate.csv')
sale_price = data.loc[:, 'SalePrice']
# Return mean,median & mode for the SalePrice Column
# Write your code here
def calculate_statistics():
s_mean=sale_pric... |
b5056664954519169f8029777948b3c003cebd0e | 1dae87abcaf49f1d995d03c0ce49fbb3b983d74a | /programs/subroutines/B comp y ramp 0-5 5ms.sub.py | 78ca5d85f99e7e54175184dc4d2277297ebc1a6f | [] | no_license | BEC-Trento/BEC1-data | 651cd8e5f15a7d9848f9921b352e0830c08f27dd | f849086891bc68ecf7447f62962f791496d01858 | refs/heads/master | 2023-03-10T19:19:54.833567 | 2023-03-03T22:59:01 | 2023-03-03T22:59:01 | 132,161,998 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 890 | py | B comp y ramp 0-5 5ms.sub.py | prg_comment = ""
prg_version = "0.5.1"
def program(prg, cmd):
prg.add(0, "B comp y", 0.000000)
prg.add(2630, "B comp y", 0.260000)
prg.add(5260, "B comp y", 0.530000)
prg.add(7890, "B comp y", 0.790000)
prg.add(10530, "B comp y", 1.050000)
prg.add(13160, "B comp y", 1.320000)
prg.add(15790, ... |
939f67c76684456922004ac93e78037285c0af75 | cbd7191acac4fae2008694fa26d3bbd44639a82f | /gpm_api/dataset/groups_variables.py | 73a080624bd7c71251c66220bc1105ac9186b0a1 | [
"MIT"
] | permissive | ghiggi/gpm_api | 977a1dbae23392f76121f77bf1b622033a342f2b | 3cb63834fd1388c61fb7064da65717e282218349 | refs/heads/main | 2023-09-04T01:46:38.157036 | 2023-09-01T14:12:31 | 2023-09-01T14:12:31 | 286,664,485 | 21 | 2 | MIT | 2023-09-13T11:22:00 | 2020-08-11T06:30:57 | Jupyter Notebook | UTF-8 | Python | false | false | 6,896 | py | groups_variables.py | #!/usr/bin/env python3
"""
Created on Tue Jul 18 17:11:09 2023
@author: ghiggi
"""
import numpy as np
WISHED_COORDS = ["height", "dataQuality", "SCorientation"]
def flatten_list(nested_list):
flat_list = []
for item in nested_list:
if isinstance(item, list):
flat_list.extend(flatten_list... |
5d7a4bed3af7b609ec62c8d3ac89003b36e7b7a1 | 444b32c8771ca1e3f7380c8cf784a27e633131c5 | /master/models.py | ae69e3a5eb8f3e1577c86816fc8c554d21b3d37d | [
"MIT"
] | permissive | j-windsor/thebeau | 0922e8fdb0d3d9b4db2bc1d143d3f260da759367 | dd3afc77edd0c011a2f993195569b2c0db24e3e1 | refs/heads/master | 2022-07-14T05:50:51.764256 | 2016-06-07T02:53:03 | 2016-06-07T02:53:03 | 58,698,087 | 0 | 0 | MIT | 2022-06-04T23:25:20 | 2016-05-13T04:01:08 | CSS | UTF-8 | Python | false | false | 627 | py | models.py | from __future__ import unicode_literals
from django.db import models
from tinymce.models import HTMLField
class Testimonial(models.Model):
name = models.CharField(max_length=50)
text = models.TextField(max_length=300)
image = models.ImageField()
def __str__(self):
return self.name
def stat... |
86a752f45a66ddd4cd0cf7670812f48681d1ec89 | 264a82bb6f9c219c44ffd887918b696fcdc3967b | /beautifulsoup.py | ee3d700e835a4741fb84f937cc1d65be612a1ae6 | [] | no_license | cnuwhe/baidupachong | 4637896765df1e9a91195e8b357ab0e2608f04cf | d837893283ea97ea1d2fed5daf364eea2337c9e4 | refs/heads/master | 2021-01-20T15:10:23.151796 | 2017-05-18T15:22:53 | 2017-05-18T15:22:53 | 90,729,565 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,405 | py | beautifulsoup.py | import urllib.request
import re
from bs4 import BeautifulSoup
import datetime
def getyesterday():
now = datetime.datetime.now()
yesterday = now - datetime.timedelta(days=1)
yesterday = yesterday.strftime('%m-%d')
yesterday = yesterday.replace('0', '')
return yesterday
def readkeywords(filename):... |
c918db1a22dcbd5315323e8f4005ffa2924a4207 | 2dbd07e727f4674ee0adbadb5671dd1b19f2bce9 | /server.py | c4321b1b46bbcaede0532bceea0d620c14ce69a3 | [] | no_license | Shane-25/Ninja-Gold | f7de09afb2f1887f0eb442bcbb2592fae4497cc3 | 3b7fc63b2d1a41b6f103fcb7e7cc1afafaf726f1 | refs/heads/master | 2023-06-30T11:36:18.152403 | 2021-08-07T05:46:14 | 2021-08-07T05:46:14 | 393,591,902 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,958 | py | server.py | from flask import Flask, render_template, request, redirect, session
import random
from datetime import datetime
app = Flask(__name__)
app.secret_key = 'Mellon'
@app.route('/')
def index():
if 'money' not in session:
session['money'] = 0
if 'counter' not in session:
session['counte... |
0dc29412b5889844ff4097c9fc5e59f24cca8b2c | 93faee3d112d0cb64c9a3dc987a6cad094b64a7b | /python/2020/day05.py | 7965230f8325557d51aea06820e1dc818a8a75d1 | [] | no_license | codeguru42/aoc | 76013487f1ea6e7176c4d93e8959384eac0dea85 | baaeeec6142a25dbc89ff7173a6f98bf09a4b048 | refs/heads/main | 2023-04-06T16:11:55.104834 | 2023-04-04T23:06:10 | 2023-04-04T23:06:16 | 159,894,126 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,046 | py | day05.py | import itertools
import re
import unittest
class TestBinarySearch(unittest.TestCase):
def test_example1(self):
self.assertEqual((0, 63), binary_search('F', 0, 127))
def test_example2(self):
self.assertEqual((32, 63), binary_search('B', 0, 63))
def test_example3(self):
self.assert... |
09866c5232b5f079da0ed78257e7a1d1179f1f10 | 79fd5e2fd911e32635185ef73c77ecf0f8768fe1 | /nicolas_pereson_trabajo_practico_final_python_2.py | 974eb8f8378bf4c7ac133fdad66b7357c90fd930 | [] | no_license | NicoPereson/library_system | 948e9ed65c1f60e8292b538ed9e371061ac4d4c0 | 0e578b69c757d20d3cd8efb83198661c9c357e7d | refs/heads/main | 2023-07-05T00:05:11.559405 | 2021-08-22T23:45:09 | 2021-08-22T23:45:09 | 398,924,083 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 21,773 | py | nicolas_pereson_trabajo_practico_final_python_2.py | from tkinter import *
from tkinter import ttk
from tkinter import messagebox as mb
from typing import Set
import Conexion_BD
import datetime as dt
import os
class AppBiblioteca:
#Create main root
def __init__(self):
self.root = Tk()
self.root.geometry('480x400')
self.roo... |
3716ad921f4229b43180a12f577fb5ddb346a4a7 | 15874c19800ff1d63485279901aff55f96f9fc9d | /2.py | e5600272fad00615698af76a7498fd2c2ac2a311 | [] | no_license | wndus8834/Algorithm0624 | 149573744b2908756dde4b876963a91626790f01 | 29f0dd412e9f6a9acd607006bf83d6e5b8b5a684 | refs/heads/master | 2020-08-16T12:30:34.449176 | 2019-10-16T08:55:24 | 2019-10-16T08:55:24 | 215,502,017 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 304 | py | 2.py | def sol(arr):
for i in range(len(arr[0])):
for j in range(1, len(arr)):
if i==len(arr[j]) or arr[j-1][i]!=arr[j][i]:
return i
return len(arr[0])
print(sol(["apple", "apps", "ape"]))
print(sol(["hawaii", "happy"]))
print(sol(["dog", "dogs", "doge"])) |
2824fc5a982d6ef4089cf0fec49c16efd7fa5736 | 4ac800fa1d57baebb13b576901f0d921738dbcd0 | /trytalk/settings/production.py | 380d62dbdf6a53c3b50b80c8044d6b46b86c1ede | [
"Apache-2.0"
] | permissive | guyuanlin/try-talk | d2507ee971f0b01b0951cd3aa2a04546d7323df2 | 299dbc7f9c70b69f5a53a6be36e42e611dc9a999 | refs/heads/master | 2022-05-01T03:44:31.146672 | 2015-08-27T16:22:21 | 2015-08-27T16:22:21 | 35,723,264 | 0 | 0 | Apache-2.0 | 2022-03-29T21:53:52 | 2015-05-16T12:42:20 | JavaScript | UTF-8 | Python | false | false | 956 | py | production.py | from default import *
import os
# Using SpatialLite backend
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'trytalk',
'USER': os.environ.get('DATABASE_USER'),
'PASSWORD': os.environ.get('DATABASE_PASSWORD'),
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
# Honor the '... |
df89d52672383afc15074630208517f99357520c | 0bef05951a6ca4aac33233cf58b105bf36139324 | /supplyinvoice/data_processing.py | dd425dbe583ad8423865d7961675ce5e4259be77 | [] | no_license | Justin1307/book_keeping_back_end | 1a8329f42a5850ed1699222e23c967393be4c97e | 73ba5dd778b97cf1417c36edbdf0c495bd30ff89 | refs/heads/master | 2022-12-11T07:36:09.041248 | 2020-09-15T03:26:22 | 2020-09-15T03:26:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,020 | py | data_processing.py | class ProcessingData:
def __init__(self,img_data_list,mapping_list):
self.img_data_list =img_data_list
self.mapping_list = mapping_list
def process_data(self):
for map_data in self.mapping_list:
# map_data = mapping_data.get("mapping")
if map_data.ge... |
7de19c15549599855d988cfbc140c60a0c17abbb | d76ae393b03d756ae2e7f233fc89a78020855acb | /positionalIndex.py | bdea7c68a25b32c41a5e193efa7bdb88598ce5d6 | [] | no_license | Esokids/IR_BehindTheScene | 62c2276a2e6777f4f58547bcf8790411ab5b0fc0 | d1b74fcbc80856569f7ea75b2cfa059413a0222f | refs/heads/master | 2020-04-25T04:11:09.408540 | 2019-04-01T03:25:25 | 2019-04-01T03:25:25 | 172,502,474 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,682 | py | positionalIndex.py | from nltk import word_tokenize
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from collections import defaultdict
stop_words = set(stopwords.words('english'))
punctuations = '''!()-[]{};:"'\,<>./?@#$%^&*_~/—`'''
stop_words.update(punctuations)
count_comparator = 0
count_assignment = 0
def ... |
8efae1c45a680597fc1f1da993091eff91e3b0c8 | 8740da044b19ba1a26eb8313bb825ad4887f6afd | /cleaning_data_code/generatCsvGoodReadOnly.py | 7f0b76821cce39c34603ac89dbd624041b210473 | [] | no_license | NegarMirgati/Tiffany | 967b1e61d457ffc2366861d0490f5711618ecccf | fcdf5a3172b178c9bca58599940283e85c83b73f | refs/heads/master | 2022-12-24T22:47:17.036306 | 2020-02-20T10:55:45 | 2020-02-20T10:55:45 | 302,425,197 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,588 | py | generatCsvGoodReadOnly.py | from __future__ import division
import csv
import json
import datetime
from dateutil.parser import parse
import os
class dataTransformer(object):
award_dates = {}
winners = {}
winners_found = []
test_year = 2019
rootdir = '../orgenizeData'
def import_award_dates(self):
with open('../A... |
bbe2d6b49320a28a1f238065a29adc83b6baba81 | 2372203835f4550af81c2549d18d47ef7fb0b75a | /api/migrations/0029_auto_20191125_0949.py | 6a361f604b26af32f5d2108dc3b374fc7b8df841 | [
"MIT"
] | permissive | batpad/go-api | 7071b7a3ca13bdda283ae717d6cfecdf9dbd4f6b | 6c187396fddae9ebcb923540824c86c40f8254bb | refs/heads/master | 2022-12-09T22:23:52.772748 | 2019-12-11T16:15:11 | 2019-12-11T16:15:11 | 227,409,969 | 0 | 0 | MIT | 2021-12-13T20:28:13 | 2019-12-11T16:22:56 | Python | UTF-8 | Python | false | false | 1,070 | py | 0029_auto_20191125_0949.py | # Generated by Django 2.0.12 on 2019-11-25 09:49
import api.models
from django.db import migrations, models
import enumfields.fields
class Migration(migrations.Migration):
dependencies = [
('api', '0028_merge_20191125_0949'),
]
operations = [
migrations.AddField(
model_name=... |
2504433ca3942279d3f6b0dd803c10df9bba4923 | 872f0a479883c25c0eadaff6623af18af1849f39 | /scripts/drop_db.py | c788d9fd6defd0649d68138937d089beab995427 | [] | no_license | talespadua/geojson-fastapi | 4e0ac16b2a3fc2a291b694983ae30be5a92f5cf9 | ed0c52b08af6610dbad6181605f6cb85fa108e49 | refs/heads/master | 2023-02-17T21:37:30.765294 | 2021-01-18T13:57:52 | 2021-01-18T13:57:52 | 320,397,305 | 7 | 0 | null | null | null | null | UTF-8 | Python | false | false | 398 | py | drop_db.py | import logging
from project.config import settings
from project.dal.mongo_connection import MongoConnection
def drop_db() -> None:
connection = MongoConnection(
db_connection=settings.DB_CONNECTION_STRING, db_name=settings.DB_NAME
)
connection.database.partners.drop()
logging.info("partner d... |
868cbb8c37372d854eec5801664b32851a82854e | 6c09a5d4c0dac0bfbdcd60d08e12e27b3159c021 | /assetsTonk/sendErrorMessage.py | 803269954075153ecdb6dff7bd5b3d395ea202f0 | [] | no_license | ahinh43/tonk | a3bba682994c92a0c8595ae1f1ef96a11986f6d1 | 84014f7665d8563c4c43d90e65d74e64c536fb05 | refs/heads/master | 2023-01-10T10:34:50.959757 | 2020-11-10T02:04:45 | 2020-11-10T02:04:45 | 94,049,867 | 1 | 1 | null | 2020-11-10T02:04:46 | 2017-06-12T03:01:21 | Python | UTF-8 | Python | false | false | 5,959 | py | sendErrorMessage.py | import asyncio
import sys
import re
import json
import discord
helpFile = open('assetsTonk/helpTexts/configUsage.json')
helpDict = json.loads(helpFile.read())
ConfigFile = open('assetsTonk/configs/TonkConfig.json')
ConfigDict = json.loads(ConfigFile.read())
commandPrefix = f"{ConfigDict['COMMAND_PREFIX']}"
commandPref... |
d4323deb3bd6ed8c18372977336121ab328cace4 | b47c136e077f5100478338280495193a8ab81801 | /Lights/adafruit-circuitpython-bundle-6.x-mpy-20210310/examples/stmpe610_simpletest.py | 708393ff45f1ed0161eb573c43d63b6f0f479506 | [
"Apache-2.0"
] | permissive | IanSMoyes/SpiderPi | 22cd8747cc389f674cc8d95f32b4d86f9b7b2d8e | cc3469980ae87b92d0dc43c05dbd579f0fa8c4b1 | refs/heads/master | 2023-03-20T22:30:23.362137 | 2021-03-12T17:37:33 | 2021-03-12T17:37:33 | 339,555,949 | 16 | 2 | null | null | null | null | UTF-8 | Python | false | false | 455 | py | stmpe610_simpletest.py | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import busio
import board
import digitalio
from adafruit_stmpe610 import Adafruit_STMPE610_SPI
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.D6)
st = Adafruit_STMPE610_SPI(spi... |
f7197af081d972a6cede327ae9ecfc492d3c7a36 | 5a52ccea88f90dd4f1acc2819997fce0dd5ffb7d | /alipay/aop/api/domain/ContractQueryDTO.py | 5e08b3f133a1c8d5284d233a7632139fde21ff72 | [
"Apache-2.0"
] | permissive | alipay/alipay-sdk-python-all | 8bd20882852ffeb70a6e929038bf88ff1d1eff1c | 1fad300587c9e7e099747305ba9077d4cd7afde9 | refs/heads/master | 2023-08-27T21:35:01.778771 | 2023-08-23T07:12:26 | 2023-08-23T07:12:26 | 133,338,689 | 247 | 70 | Apache-2.0 | 2023-04-25T04:54:02 | 2018-05-14T09:40:54 | Python | UTF-8 | Python | false | false | 6,049 | py | ContractQueryDTO.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ContractAttachDTO import ContractAttachDTO
from alipay.aop.api.domain.ContractAttachDTO import ContractAttachDTO
class ContractQueryDTO(object):
def __init__(self):
s... |
01ad4a09c89939c6f301510ceac0013e9299051c | cdbc1cfb33fe2b0c6b475cb45960cf6c19215e48 | /password_locker.py | d12d6d6d488a721be80a0d6a4bb12b959ab8d664 | [
"MIT"
] | permissive | weshy007/password-locker | b5e9c222ad9d1db815272f8114a9faeac2bef251 | d306f3b50b96f39a1ea33e10950aa4d34185efa9 | refs/heads/master | 2023-06-29T00:43:31.919139 | 2021-08-04T13:06:43 | 2021-08-04T13:06:43 | 392,571,349 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,189 | py | password_locker.py | from user_account import User, Credentials
def create_user(fname,lname,password):
'''
create a new user account
'''
new_user = User(fname,lname,password)
return new_user
def save_user(user):
'''
save a new user account
'''
User.save_user(user)
def verify_user(first_name,password):
'''
validation of the... |
d38800caad1d9fbb644c6f20a9405b91da7f7b48 | 4ac79538f04abe557886d05de5cf3f41d65acb2b | /fluent/event.py | 1c55b77b99bb3e706313d1dc1059f56cf40c162b | [
"Apache-2.0"
] | permissive | hiroyoshikawa/fluent-logger-python | e033578c4c544810677ea5deaad6c7eeb3c4878a | 83e19b2f7a6485acf2c698a8f84c4ad88b461b3a | refs/heads/master | 2020-12-01T01:17:57.301108 | 2011-10-07T21:39:27 | 2011-10-07T21:39:27 | 2,535,615 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 296 | py | event.py | from fluent import sender
class Event(object):
def __init__(self, label, data, **kwargs):
if not isinstance(data, dict) :
raise Exception("data must be dict")
l = ('sender' in kwargs) and kwargs['sender'] or sender.get_global_sender()
l.emit(label, data)
|
1b5079dfe09ec3c25c12bb78860bd3ac3d842129 | 7e55683cbfb817b8847f1c13a3d21c3d6d4cc971 | /Week_07/773.py | 89c12ebff0ed1529b6817181d737b38dafc4caa5 | [] | no_license | zhangli709/algorithm009-class01 | 4c6b9e9ba6d809c8ec7486aac1a0f543542aabfb | 6087f9d5ea60eb9d87e2c46f4f33361e82ad9dfe | refs/heads/master | 2022-11-19T16:55:22.139311 | 2020-07-18T08:06:26 | 2020-07-18T08:06:26 | 264,695,333 | 0 | 0 | null | 2020-05-17T15:16:11 | 2020-05-17T15:16:11 | null | UTF-8 | Python | false | false | 2,336 | py | 773.py |
# 滑动谜题
"""
在一个 2 x 3 的板上(board)有 5 块砖瓦,用数字 1~5 来表示, 以及一块空缺用 0 来表示.
一次移动定义为选择 0 与一个相邻的数字(上下左右)进行交换.
最终当板 board 的结果是 [[1,2,3],[4,5,0]] 谜板被解开。
给出一个谜板的初始状态,返回最少可以通过多少次移动解开谜板,如果不能解开谜板,则返回 -1 。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/sliding-puzzle
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
"""
class Solution:
... |
bfddba88a52ed58d85913d235e0f1906b11f9de9 | 2101be2b68e8da3ddb2e24584d6ab6eb79c153d3 | /htpc/settings.py | 9810f4526c40e0c665273db9c47f60f7af4b9c12 | [] | no_license | npostma/HTPC-Manager | 25a86910c03f4028074a083618300166ac5f0e83 | 9f903059c4201714ccda74b35dadf42c657d7b88 | refs/heads/master | 2021-01-10T21:27:43.495373 | 2012-03-26T05:26:39 | 2012-03-26T05:26:39 | 3,841,275 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 907 | py | settings.py | import ConfigParser
import htpc
import os
import shutil
def saveSettings(data, section = 'htpc'):
config = ConfigParser.ConfigParser()
config.read(htpc.settingsfile)
if not config.has_section(section):
config.add_section(section)
for key in data:
val = data.get(key)
config.se... |
ae8a1d1c42d39ddd5e870e50acf9326695e8ddd9 | c02fdd8268b2d0bac3ec5aba15fc83a57bbd3720 | /data_input.py | 2b07fe49f87f36e8a62ea2c4d0496ccda19d9796 | [] | no_license | paudura/aidl-medicine | d28b06ff0686fd2ba950ff49b56d7fb54e975bc6 | de3c9196e2a7b3ac3c10b33542f3122136e2f3ad | refs/heads/main | 2023-06-19T04:51:13.573764 | 2021-07-13T17:01:35 | 2021-07-13T17:01:35 | 370,395,797 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 7,716 | py | data_input.py | import pandas as pd
import numpy
import csv
import os
from glob import glob
import json
from torchvision.transforms.functional import to_tensor
from PIL import Image, ImageDraw
import torch
import pydicom
import numpy as np
import copy
import random
torch.device("cuda" if torch.cuda.is_available() else "cpu")
import m... |
0cae4b241dfb9d14f0653bb45b6252d8e93a9ee1 | 303af22397ba79c50a34b9b8d6a6dfbd09f36413 | /ex07/ex07.py | 17ff6c4af7a13b2cb41de652b464abdc857a131e | [] | no_license | ErikFerragut/flask-tutorial | 3ad7d7257fe8711062c407b13e4e44dc84e1dca3 | e9d0c8d17efb5a531deedca43d6c5978491128d5 | refs/heads/master | 2022-12-12T01:51:45.725777 | 2019-01-17T03:14:22 | 2019-01-17T03:14:22 | 72,813,422 | 0 | 0 | null | 2022-12-08T01:32:54 | 2016-11-04T04:09:26 | Python | UTF-8 | Python | false | false | 4,111 | py | ex07.py | # Ex7 -- We use some in-template logic
import os
from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World!\n{}'.format(__file__)
# We now get rid of all animal pages, except for the data-generated ones
# Note, ... |
f3dcc475d66de6b4e58983675af80f84061a132c | de847596f82a477f655eedc1d175ccd6c4f968da | /renderdiscs.py | 5eb89f1c2d139f523f8f5e7ffba931e43f7e47f5 | [
"CC0-1.0"
] | permissive | jkominek/discs | c5306b52760e4e3f200c2b0b245bb348b944b672 | 349177e38fae31eff407c7188b243c641807dc16 | refs/heads/master | 2021-03-12T21:48:19.513928 | 2015-06-07T03:37:36 | 2015-06-07T03:37:36 | 36,947,027 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,370 | py | renderdiscs.py | #!/usr/bin/python
import sys
from math import *
import Image, ImageDraw
def quadbezier(a,b,c,t):
def f(a,b,c):
return (1-t)*((1-t)*a + t*b) + t*((1-t)*b + t*c)
return map(f, a, b, c)
def dist(a,b):
return sqrt((a[0]-b[0])**2.0 + (a[1]-b[1])**2.0)
a, b, c, = [], [], []
for l in sys.stdin.readline... |
75947b392ddabf7303f2dbf3953ff360972cbfb9 | 0e6262932746db9a8cae6147cdc1341e7b0d8b42 | /discussions/threads/migrations/0005_delete_brainstormrespresponse.py | 451971d8b70ba5e88feccc117044283e6b5621c0 | [] | no_license | svschou/discussion_test | 8618b146367fb70c3dd6ed48afc24260fb83f55b | 175f53ba097a0da3d0442b1e44b74d0cd670b5d2 | refs/heads/master | 2022-11-20T03:06:45.421899 | 2020-07-20T14:08:38 | 2020-07-20T14:08:38 | 263,418,631 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 311 | py | 0005_delete_brainstormrespresponse.py | # Generated by Django 3.0.6 on 2020-05-27 17:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('threads', '0004_auto_20200527_1444'),
]
operations = [
migrations.DeleteModel(
name='BrainstormRespResponse',
),
]
|
a280b95527f299ffa58426d75944919fb9033b5b | a31772ea2d83aa37530e55376e5b3ac3e25b7a50 | /Temperature.py | fa48de720e596876813ddc06a53e81881ad44afb | [] | no_license | MSaaad/Basic-python-programs | 00494ca19db64279e7ab8e78708cbfda4fd3c8f1 | a989152ba459085e7e94b0f627df46d89790c27c | refs/heads/master | 2021-07-06T16:43:27.857022 | 2020-09-15T12:21:48 | 2020-09-15T12:21:48 | 186,310,250 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 268 | py | Temperature.py | a=input('Enter the temperature you want in: ')
if a=='celsius':
c=int(input('Enter a temperature in Celsius:'))
f=9/5*c+32
print(f)
if a=='fahrenheit':
f=int(input('Enter the temperature in fahrenheit:'))
c=(f-32)*5/9
print(c)
|
12cba4c4fe08accfa9fdc578436cbe5fcd222cea | 0505ec505bf08a5cbb325a609293541b5525cd1c | /fMRIPreprop/PlotTimeSeries.py | f984b73462e0841b301b04514bc3d5b36b693314 | [] | no_license | sathayas/ConnectivityClassSpring2019 | cfba300ee1c742ec263cb9a6fd849921101de962 | 273e8a7ca8b6323cf53f1becdc8870257c99923b | refs/heads/master | 2020-04-12T06:04:14.336736 | 2019-04-15T20:24:10 | 2019-04-15T20:24:10 | 162,341,563 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,031 | py | PlotTimeSeries.py | import numpy as np
import matplotlib.pyplot as plt
##### File business
fTS = 'DatafMRIPreprop/Oxford_sub16112_Rt2_K200.npz'
fTS_reg = 'DatafMRIPreprop/Oxford_sub16112_WBWMCSF_Rt2_K200.npz'
fGlobalMean = 'DatafMRIPreprop/Oxford_sub16112_PhysPar.npz'
##### Loading the data
X_TS = np.load(fTS)['ts']
X_GM = np.load(fGl... |
0af44043085d8a368ce86300f8425dede1bc24a5 | efa41bd7a3d1d0bd7499a041b73e101ef6c875ba | /old_code/features.py | f06122a56e4bfbe8c96bd6494261acaa70d5fea2 | [] | no_license | prabhamatta/nlp_github_deliberations | a0bea5e89cbf8e1b4a2a33e2abba4d6b4197a00b | 16808898863a13cb2371f798d58fbcc29245906b | refs/heads/master | 2016-09-15T14:24:54.026300 | 2015-03-10T17:24:18 | 2015-03-10T17:24:18 | 14,291,302 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 16,105 | py | features.py | # functions for extracting features from users comments
#
# Still to do:
# Remaining notes:
# 1. Do not have time information in conversation detail page yet
# 2. Could explore stats about users first response.
# 3. create helper functions for reused code.
import nltk
import nltk.data
import string
import... |
914178173c15058774a28bdb6e4e6aba80fb1677 | 9689ebc06e7c9a5c1b5b19d34dbcf0f5b5b82cb6 | /discador/migrations/0006_auto_20190118_1115.py | 50fab8f94bbb561947254784c3894c063b3a8de2 | [] | no_license | tigrezhito1/Ramas | 94fe57dc4235616522aa50b36f5a655861ecbb9f | fa894fa69f6bf2a645179cadc11fb8809e82700a | refs/heads/master | 2020-05-02T07:03:03.564208 | 2019-03-26T14:55:29 | 2019-03-26T14:55:29 | 177,808,426 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 428 | py | 0006_auto_20190118_1115.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-01-18 11:15
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('discador', '0005_auto_20190117_1220'),
]
operations = [
migrations.RenameField(
... |
ed3b9caf250081c6f505bd0add688f5bdd052824 | 0a821b34438825277d8c6ed15ac09b01f0371f2e | /admin_app/urls.py | d6305f3251c1c41a8ddcc7b29765547da34bc6aa | [] | no_license | shareefmhd03/QandA | 77a02d4ad2cc2321ef7ae45c7858b185a836fdf2 | b68ebd476449d3d6b2f9b1224524bc51ef22293a | refs/heads/main | 2023-07-26T17:23:31.419016 | 2021-09-09T05:22:01 | 2021-09-09T05:22:01 | 389,026,638 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,610 | py | urls.py | from django.urls import path
from . import views
urlpatterns = [
path('user_mgmt/',views.user_mgmt, name='user_mgmt'),
path('add_user/',views.add_user, name='add_user'),
path('user_unblock/',views.user_unblock, name='user_unblock'),
path('delete_user/',views.delete_user, name='delete_user'),
path('... |
74d013fc681f0036188cfb6e6d51e05787b72e77 | 023be0453dcf39936361e79d1d9c2b487fe379e2 | /mover.py | 785803d4ba2932d43d09720c18ab7e6230a4ee26 | [] | no_license | raghu1121/Reinforcement-learning-environment | 17f43fb4384cd68fb0571af4f6bfb12fbb0bd373 | 642711d4a0535f033f3fdf0b3002531acffe44cf | refs/heads/master | 2020-07-06T09:34:41.275900 | 2019-08-20T21:34:48 | 2019-08-20T21:34:48 | 202,973,204 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,242 | py | mover.py | import os
import glob
import shutil
import multiprocessing as mp
views=['v1','v2','v3','v4']
years=['2014','2015','2016','2017']
newfolder='movedHDRs'
Ecfolder='hdrs/EC'
# for view in views:
# for year in years:
# for month in range(1,13,1):
# try: os.makedirs(os.path.join(newfolder,view,year... |
c96b27c3b175bf580e0e83ab728a4d0f0808e641 | 4ac409c295199a32f9b4140a7d24beb453233c26 | /snapshot/python/swagger_client/api/__init__.py | 1ffc10b578ae9869267e9f883fab3b1e7efd5694 | [
"Apache-2.0",
"MIT",
"Unlicense"
] | permissive | daemonl/openapi-codegen | 780aaa76c586c0863184b241238570d8cca35895 | 7dec48c1768ca6e23e6bf136df5fc7863af88c1d | refs/heads/master | 2020-03-21T21:58:35.198020 | 2018-07-02T11:44:53 | 2018-07-02T11:44:53 | 139,096,778 | 0 | 0 | Apache-2.0 | 2018-06-29T03:32:18 | 2018-06-29T03:32:18 | null | UTF-8 | Python | false | false | 219 | py | __init__.py | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from swagger_client.api.pet import petApi
from swagger_client.api.store import storeApi
from swagger_client.api.user import userApi
|
79c8a2990bc9a29cc7051477050e5518dd4c5ca9 | e4d4f13bcd735cced0521bbc5d97a7da9f1a1a51 | /main.py | c2e7eb48e418b79e8d43bc924efac154f0ea68fe | [] | no_license | Techlord-RCE/cisol | f874839017aa5a8257e1bfa7dd1a05a53785ee5c | 924dc3a4c1a65eec4c0f142fc593c35c71f27535 | refs/heads/master | 2021-06-18T17:31:56.937366 | 2017-07-10T12:52:15 | 2017-07-10T12:52:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 232 | py | main.py | from CodeGenerator import *
from os import system
cg = CodeGenerator('bin/main', 0x80, 0x9f + 3)
cCode = cg.getAsC()
out = open('out.c', 'wb')
out.write(bytes(cCode, encoding='ascii'))
out.close()
system("gcc out.c -o out")
|
cb1e2c6e33b1fe3e764151ea8e9de270f23db5c3 | 05975476e557e07443056d3be55d46e834f7b674 | /Erlang/ErlportTests/testErlport.py | 54d00198aca2375617a83d7d6963541cb8a8965a | [] | no_license | jlemus1234/Concurrent_Scrabble | 162b0c826848b4866c341655a013234ef3c2eed2 | 7f60e39d26f96bbbaae33cd9f2459159043908a8 | refs/heads/master | 2020-04-11T10:45:05.489940 | 2018-12-14T03:36:27 | 2018-12-14T03:36:27 | 161,725,120 | 2 | 0 | null | 2018-12-14T03:11:06 | 2018-12-14T03:11:05 | null | UTF-8 | Python | false | false | 181 | py | testErlport.py | # Python functions that are called from an erlang instance
def hello(): return "hello"
def goodbye(): return "goodbye"
def testArray(array):
array.append(4)
return array
|
ab8a3c3548dfdaaab360c8d564783d10d5bd434c | 54b56a5cc3ee4af3f0775a0772c5e728ecec7077 | /queue/moving_average.py | 3e04ca687bd8ea9210856c882133f604ff75682f | [] | no_license | alephmelo/algorithms | 6dfe9f373528cc30b3700cc0c081210fb3c0ff20 | ee490c18152ce3817009e98f2a1935d57e1f2646 | refs/heads/master | 2021-01-11T08:44:46.060936 | 2016-12-08T20:55:23 | 2016-12-08T20:55:23 | 77,083,423 | 1 | 1 | null | 2016-12-21T20:21:16 | 2016-12-21T20:21:16 | null | UTF-8 | Python | false | false | 787 | py | moving_average.py |
class MovingAverage(object):
def __init__(self, size):
"""
Initialize your data structure here.
:type size: int
"""
self.size = size
self.queue = collections.deque()
def next(self, val):
"""
:type val: int
:rtype: float
"""
... |
8cfea50581dd414c40217d0e698fd6e4f862ca96 | 8b4564c620d1e34568e325efb5c8b64ab872df20 | /post/views.py | b4c33af2aab7dd90f1b46649c57e97889990172c | [] | no_license | saibhaskar24/django-blog | 28a02ea8ead882387dab327fde65b74ac456e16b | 22144517d36ffa031ca6d647a783179d7d20d36e | refs/heads/master | 2020-06-01T20:39:21.123386 | 2019-12-05T05:46:48 | 2019-12-05T05:46:48 | 190,919,931 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,576 | py | views.py | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from .models import Posts
from groups.models import Com
from django.contrib.auth.models import User
from django.views.generic import (
ListView,
DetailView,
CreateView,
Up... |
6f13c05d99343235391b0147bff3ac7f3dfa4586 | adc6095c7e025996ae75400ef414f6307b765076 | /web/backend/deploy-service/utils/workflow.py | 13ffbc6b95552010ec4770c9002c6fae4fcef92c | [] | no_license | Vancior/dx-faas | 0f924389d9a04fb3c84a7f161ec4e917241ac69a | 76a3a50add184de28b416fcf666e1eec6d4f8e9e | refs/heads/master | 2022-12-20T06:19:00.646352 | 2020-03-06T09:43:22 | 2020-03-06T09:43:22 | 190,312,506 | 7 | 4 | null | 2022-12-10T00:42:05 | 2019-06-05T02:30:14 | Python | UTF-8 | Python | false | false | 4,292 | py | workflow.py | import os
def gen_runtime_id():
return os.urandom(16).hex()
class WorkflowHelper:
def __init__(self, definition):
self.definition = definition
def get_state(self, role):
return self.definition['States'][role]
def all_tasks(self):
tasks = dict()
def _r(t):
... |
e5f54154d81ecd425dac59c8703885c8f5fe799e | 4e86f168733e7fa82b0bcd374c90cc87c3d93a57 | /plugin/utils/__init__.py | 2f63b552f7ac3c0aad7a805fe9e48a2901b47364 | [
"MIT"
] | permissive | oakmountainapps/EasyClangComplete | e3889932c9d013fee9f68861cf62e62ae35c9737 | 88f0649ba0496a117bb061025a9cd54165abef0c | refs/heads/master | 2020-08-06T20:53:44.607678 | 2019-10-02T12:05:09 | 2019-10-02T12:05:09 | 213,149,764 | 0 | 0 | MIT | 2019-10-06T10:38:56 | 2019-10-06T10:38:56 | null | UTF-8 | Python | false | false | 348 | py | __init__.py | """Useful utils. Read each file to know more about them."""
__all__ = (
"catkinizer",
"compiler_builtins",
"flag",
"include_parser",
"index_location",
"macro_parser",
"module_reloader",
"progress_status",
"quick_panel_handler",
"singleton",
"singleton_thread_pool",
"threa... |
68827dd00f9bce19515192d237cd0b5491ad6f18 | 5610d408481059cac5ca87d542eb7d55f3182be4 | /apps/customer/__init__.py | c40def02de4c979e5245402b8fd7615f9413f6a8 | [] | no_license | ziven1987/django-rest-API-framework | 72d8c40d675a37d59ca82bc3ef105853933ea7f2 | 40355a20cf6f6c414370289b1fc7757f63aa7a4e | refs/heads/master | 2021-08-31T23:04:05.705151 | 2017-12-23T09:32:01 | 2017-12-23T09:32:01 | 115,183,639 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 181 | py | __init__.py | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class Config(AppConfig):
label = 'customer'
name = 'apps.customer'
default_app_config = 'apps.customer.Config'
|
d7b1a2af890b7c78c66d391e3b4231da80dd7ab5 | ab37bd9aa078a3530eef89484c6b77573b58336c | /logger.py | 3e158c86df79f329514cc834927495ff5c756325 | [] | no_license | Arpitbhawar/utilities | 561d4026c722e95299a87c523dfc446632d4329d | 395201e1ed25382d9fc87cf7477355cfaae16540 | refs/heads/master | 2020-04-13T03:59:49.786681 | 2016-09-15T09:12:58 | 2016-09-15T09:12:58 | 68,267,940 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 796 | py | logger.py | import logging
import datetime as dt
import os
import yaml
HERE = os.path.dirname(os.path.abspath(__file__))
CONFIG = yaml.load(open(os.path.join(HERE,'relativepath', filename)))
def getLogger(name, dir=None, level=logging.INFO):
"""
creates log files at the desired path with name 'name.2016-09-14.log'
"""... |
746cb3549e80f42452161cbaa6698c505a797a9c | 1c0e368efd7000ae78d980a4a03297b5f0ddf9f7 | /mlblocks/mlblock.py | cfe0f732824dd51eeccfcd716a4df4d939b0f41c | [
"MIT"
] | permissive | rbaghdadi/MLBlocks | 1b06cade1a0dc0263248c5e67153b9a5f916dabf | c97f9296672c10e18a657aa95b52ac8cea8f8b45 | refs/heads/master | 2020-03-20T12:24:30.667528 | 2018-06-13T18:50:30 | 2018-06-13T18:50:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,572 | py | mlblock.py | class MLBlock(object):
"""A single primitive in an MLPipeline.
Simply defines the interface. Implementation should be done in an
MLParser.
Attributes:
name: The name of this primitive.
model: The actual model of this primitive that acts on data.
fixed_hyperparams: A dictionary m... |
f102a4cefa14c847f6808baed8555f201b6cf147 | 72b159d723bf5b5fcf0a41df0ee92958ae8f8c36 | /代码/load_data.py | ded2d09ac391d0dc0f1b5e933cfcfed7804f007d | [] | no_license | gq-max/Lasso-and-SparseLearning | 3435be0812f0fd28ead6ba5fdfa95af40656b4e9 | f20c34da2176aa66fb59b7237d1d0ea9ffafba92 | refs/heads/master | 2023-02-02T03:07:38.235313 | 2020-12-19T13:46:20 | 2020-12-19T13:46:20 | 319,008,831 | 3 | 2 | null | 2020-12-15T02:48:00 | 2020-12-06T10:43:39 | Python | UTF-8 | Python | false | false | 1,437 | py | load_data.py | import numpy as np
from sklearn import preprocessing
def read_pgm(filename):
'''
读取pgm文件内容,并将其转换为行向量
:param filename: 文件名
:return: 10304个特征的样本值
'''
f = open(filename, 'rb')
f.readline() # P5\n
(width, height) = [int(i) for i in f.readline().split()]
depth = int(f.readline())
d... |
d22f534bdb7d9ece928b780ad52fc5ae284fb72e | 7370efd2896b7784b37e998a5fcd5f23cd2d28ff | /ML.py | c2c25f38c5bdadfbe9fcdc29e31d4223a10592ea | [] | no_license | nicktan96/version-1 | 0ba72087c2918a573b3b6b707e3a46959b391a25 | e4465143d8cfd62c95184bb59d04d74bbfaa6e4f | refs/heads/main | 2023-01-05T01:28:33.741692 | 2020-10-16T13:05:42 | 2020-10-16T13:05:42 | 304,629,215 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 833 | py | ML.py | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pickle
from sklearn.model_selection import GridSearchCV
from sklearn.ensemble import RandomForestClassifier
dataset = pd.read_csv('heartedit.csv')
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, -1].values
from sklearn.model_... |
f3fb9ecd4165bc9c920ecb5ac55be398386521a3 | 6b55ac5a6633355afbfe2a8067f851b94bc52878 | /pythontasks/users/models.py | b854ae45d80b947ec937dae1156d2125ffbb0bd4 | [] | no_license | OpportunV/py-tasks | eea7bf5b3980135d79b54c71e942d97ae9fca18b | f5edf4b5d8198f6b6b278a043358d02169fe8bb2 | refs/heads/master | 2020-09-30T02:02:02.164570 | 2020-01-08T13:58:07 | 2020-01-08T13:58:07 | 227,172,868 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 481 | py | models.py | from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
from tasks.models import Task
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
tasks = models.ManyToManyField(Task, blank=True, related_name='profiles')
def __... |
f9ddd931a0e5a4c23bdbaaee5a825eec67defb5e | 17b2f9b13ac0c6600bf1dc27794a879b11897fdb | /nsga_ii/nsga_ii_para_imple_simple_setup.py | 0c49aa04208aaa615baf7f936523d305d0c2d103 | [] | no_license | zchiam002/vecmc_codes_zhonglin | d17aa8dd0723891b61606ee4ffe9cf332f1f84a9 | fa71e7a5013b1f408717bed034c6d1eafc5a8a9e | refs/heads/master | 2020-11-30T10:27:50.933317 | 2020-08-19T03:09:55 | 2020-08-19T03:09:55 | 230,373,260 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,056 | py | nsga_ii_para_imple_simple_setup.py | ##IMPORTANT NOTICE
##PARALLEL COMPUTATION DOES NOT WORK WELL WITH IPYTHON CONSOLE, USE SEPARATE PYTHON CONSOLE, WELL SOMETIMES
##This is the interface for the modular genetic algorithm
##This genetic algorithm MINIMIZES the value for a given problem
##Data needs to be entered in the specific format shown below
##vari... |
c518f72a42fb52f0706ea318f9b75f7e71044997 | 15fe649ea901956e1f29922a7e64355ab1bf1676 | /src/HW3/misc.py | fceca7573f299928badfbbd198e74a603adad993 | [
"MIT"
] | permissive | manoj-ayyappan/engr-csc591-021-spring2023 | b6708c97dfa1d894ebe918462c9203cec9d30a83 | b77117230bdbe3a7e706dda1357fa8139e0ec1e8 | refs/heads/main | 2023-04-27T14:00:11.171221 | 2023-04-21T05:22:57 | 2023-04-21T05:22:57 | 589,767,774 | 0 | 1 | MIT | 2023-04-21T03:16:07 | 2023-01-16T22:15:40 | Python | UTF-8 | Python | false | false | 482 | py | misc.py | import strings
def show(node, what, cols, nPlaces, lvl=0): #--> nil; prints the tree generated from `DATA:tree`.
if node:
print("| "*lvl + str(len(node.get("data").rows)) + " ", end = "")
if not node.get("left") or lvl==0:
print(strings.o(node["data"].stats("mid",node["data"].cols.y,nP... |
a4093b2b4556903ebba1ab2549ad175d2666cc02 | e00b12a44083ec8d9b71cc1ff11dd4a7cf477c7a | /学习/漫画.py | a58767bd0b955c88beda02d5c3c1e2714670d631 | [] | no_license | 1807004150/chenggong | 22aee93e160a4f92542116c6e5088857942d3c3c | 143499db8058dd9461418754e79df20921c2d387 | refs/heads/master | 2020-08-07T10:59:01.382840 | 2019-10-07T15:54:11 | 2019-10-07T15:54:11 | 213,423,240 | 3 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,788 | py | 漫画.py | import os
import requests
from selenium import webdriver
import time
def mkdir(path):
'''
防止目录存在
'''
if not os.path.exists(path):
os.mkdir(path)
def SavePic(filename,url,count):
'''
通过requests库
将抓取到的图片保存到本地
'''
content = requests.get(url).content
with open("C:\\Use... |