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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b6fc80c782351937f30a7215d93ae5ed5fde8858 | 189cb3e9584e348dbc873658a38aa7d011ed7199 | /task_8_1.py | bfad97679d8fa3b3d98afd2a3c2bc18ddbf9f13d | [] | no_license | Bobbybushe/HW | ae65a1e5b2a1003e98b842985bec1d3b7d7299e6 | b694b2e0416f2a9c982bbbe781671f21fc6a8130 | refs/heads/master | 2023-01-04T23:46:17.983791 | 2020-10-26T14:41:41 | 2020-10-26T14:41:41 | 307,380,064 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 505 | py | task_8_1.py | n=16
def fuct2(n):
sp = []
if n%2==0:
for i in range(2, n+1, 2):
sp.append(i)
fn=1
print(sp)
for i in range(len(sp)):
fn=fn*sp[i]
return print('двойной факториал',n,'=',fn)
else:
for i in range(1, n+1, 2):
sp.append(i)
... |
ff3424917816073798ad22c8efffbbed5b5ae451 | 41777d4d219ea97b4632f4a8a31ab6c82a60772c | /kubernetes-stubs/leaderelection/leaderelection.pyi | 33eeaad0b5560d4ddcc475f763bb11b8c0139001 | [
"Apache-2.0"
] | permissive | gordonbondon/kubernetes-typed | 501d9c998c266386dc7f66f522f71ac3ba624d89 | 82995b008daf551a4fe11660018d9c08c69f9e6e | refs/heads/master | 2023-07-18T12:06:04.208540 | 2021-09-05T19:50:05 | 2021-09-05T19:50:05 | 319,183,135 | 24 | 2 | Apache-2.0 | 2021-09-05T19:50:06 | 2020-12-07T02:34:12 | Python | UTF-8 | Python | false | false | 499 | pyi | leaderelection.pyi | # Code generated by `stubgen`. DO NOT EDIT.
from .leaderelectionrecord import LeaderElectionRecord as LeaderElectionRecord
from typing import Any
class LeaderElection:
observed_record: Any
election_config: Any
observed_time_milliseconds: int
def __init__(self, election_config) -> None: ...
def run(... |
f1658dd9bb13d7411a8852daa7fc42f2ac2dba6a | 7361411ed88f49f9cfb3a2a33bdd8dd044d53de0 | /classes/outputer/question_item.py | 65383a86d51e6b3b57a1c53d9e9ce2e91d862076 | [] | no_license | CLOSER-Cohorts/Peter | b5585066258811b3e69d42c69f09d4d1ea2280f6 | cb4b50d06665e00a9f02b883644f176eabed3d9a | refs/heads/master | 2020-12-11T03:26:03.304966 | 2014-05-15T12:27:48 | 2014-05-15T12:27:48 | 33,941,460 | 0 | 0 | null | 2015-04-14T15:51:00 | 2015-04-14T15:51:00 | null | UTF-8 | Python | false | false | 629 | py | question_item.py | #!/usr/bin/python
import datetime
class QuestionItem(object):
def __init__(self, ID, label, literal):
self.ID = ID
self.textid = "qi_" + str(self.ID)
self.label = label
self.literal = literal
self.created_at = datetime.datetime.now().strftime("%H:%M:%S")
self.updated_at = self.created_at
def output (s... |
56dd4e9e4d5b3f92fb709623b91459a7cced5b97 | e31b5756a65b04743aa7ac873c4f8ad72aa54eef | /run.py | a329955b548bcaab789cf3905a8e0ad4f3fb948b | [
"MIT"
] | permissive | tiaotiaolong/piu | d714a3e3a1801622b3afdb478156b105cddad214 | 8e464ab62464c15763476d591df4365d434f7341 | refs/heads/master | 2022-09-14T16:10:38.720074 | 2020-06-02T10:39:45 | 2020-06-02T10:39:45 | 202,330,845 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 192 | py | run.py |
from app import create_app, make_celery
#创建Flask app实例
app = create_app('default')
#创建celery实例
celery=make_celery(app)
if __name__ == '__main__':
app.run(debug=True)
|
d49a2d360fa50ccd08b1af7a8a44887a878812f2 | 23fddc940a266c2d1d0e0b1687c36cdbcc9d54d9 | /app/chat/action/node/chat.py | 800b6889f2821de972f5be8e11900d9633e456bf | [] | no_license | Cuick/traversing | 210fcfb1c780037de59343fffeb4fa4d3f2eae32 | c78982580af7f63c8bff4dcb37005b7f7c682b5b | refs/heads/master | 2021-01-10T17:38:37.899460 | 2016-11-18T06:06:55 | 2016-11-18T06:06:55 | 55,397,540 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 4,614 | py | chat.py | # -*- coding:utf-8 -*-
"""
created by server on 14-5-20下午8:33.
"""
import time
from app.chat.core.chater_manager import ChaterManager
from app.chat.service.node.chatgateservice import nodeservice_handle
from app.proto_file import chat_pb2
from app.chat.service.node.chatgateservice import noderemote
from shared.utils im... |
74ec5ac46d9f35063624c83300ff83ab68e4ed8e | 117dceedcb8e93e40428e439fb02d16c58aa4474 | /课件/0304/1greenlet.py | dcf08c9bfa57ed703f13c832236c490e2e2934bf | [] | no_license | qwert19981228/P4 | ab5ceff94ec49ecbc47d008d6f239e03781eb0fd | b7c434cc64df64ae48a84ee056cbccc0db622fde | refs/heads/master | 2021-10-24T12:32:34.160886 | 2019-03-26T03:39:52 | 2019-03-26T03:39:52 | 167,921,434 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 253 | py | 1greenlet.py | from greenlet import greenlet
def foo1():
print(12)
g2.switch()
print(34)
g2.switch()
def foo2():
print(56)
g1.switch()
print(78)
if __name__ == '__main__':
g1 = greenlet(foo1)
g2 = greenlet(foo2)
g1.switch() |
70d0b4dd0c593364332b10da42b31a9158364d1d | ed429875633abb562391736ec6341df5e27c5d18 | /main.py | 47d46d5dd58b2f7b3e7477bcb44342875e8d23bc | [] | no_license | codingJWilliams/commandSystem | ac109681f68d04499432d7ae84fd2d294987d04b | 1f19886f420253a8ee888cb5b27b80d0a76fc5f6 | refs/heads/master | 2021-01-21T12:49:59.080081 | 2016-05-03T16:16:45 | 2016-05-03T16:16:45 | 49,520,956 | 1 | 0 | null | 2016-01-14T20:24:39 | 2016-01-12T18:39:01 | Python | UTF-8 | Python | false | false | 8,032 | py | main.py | import random
import time
import hashlib
import json
import mathslibrary
import lottery
import os
import rnum
import fileutils
# This is just a test
#Really
# Im not lying, I swear!!!
perms = {
'jay' : 'root',
'test' : 'admin',
'user' : 'root',
'default' : 'root'
}
#Below is where you assign ... |
b623f31d2466c2e9efcd39c56084a1dd705e04bd | e203ea7fa2b8b0c4d2fe0bd06b33ccd5a46980cf | /packager.py | 86bc725fb9026913f44bf914f12c9f61598859ca | [] | no_license | af6140/terraform-package-lambda | 91847d9b0978e3fff02f9b24fb01e7c1abd6fed4 | 5620e1c46f635b15f3e990883ca844676671bd23 | refs/heads/master | 2021-01-25T12:37:06.416255 | 2018-03-06T16:42:55 | 2018-03-06T16:42:55 | 123,486,746 | 0 | 1 | null | 2018-03-01T20:09:13 | 2018-03-01T20:09:13 | null | UTF-8 | Python | false | false | 8,936 | py | packager.py | #!/usr/bin/env python
#
# Python because it comes on Mac and Linux - Node must be installed.
#
import sys
import os
import os.path
import json
import shutil
import hashlib
import tempfile
import zipfile
import subprocess
import base64
import shutil
import functools
class Sandbox:
'''
A temporary directory for... |
24e18fa28ad1bfd20646c582d2dbfd8ccec6b541 | 8a86fa665a25611f66a2b8c6d7ee63c53453ad5a | /csa/views/products.py | 72ece4c3564ec0953ae04cbb8849825ed476bba6 | [] | no_license | villa-coding/open-csa | 2a25e2fe59a110fe5fe0600209647100b3f88aac | 1ae2ae0dd830da65c4f37f13fedb269b6f8409b0 | refs/heads/master | 2021-01-19T02:59:59.877930 | 2016-08-08T23:14:48 | 2016-08-08T23:14:48 | 62,965,699 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 516 | py | products.py | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from csa.models.core import Product
from csa.forms.cart import AddProductForm
@login_required
def index(request):
products = Product.objects.prefetch_related('stocks').all()
for product in products:
for stock... |
11cd46c51f30320da90b038f4602e30adf4bc9ce | a87204d1c41ba6495874bddda8facfc20bb1c4cd | /City Planning Analysis/utils.py | 4dd9df8ae5f8ea3da7df0ff6ff7e2a3fe1643539 | [] | no_license | snowdj/CP-113A | d6e004d76604a1d6a6e4a285f8e98f247dcecaf0 | 50044bda02b9236f88626b7a3f7face36f006a73 | refs/heads/master | 2020-09-27T08:03:29.024815 | 2019-11-25T21:50:39 | 2019-11-25T21:50:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 504 | py | utils.py | import numpy as np
def dollar_formatter(num):
return '$' + comma(num)
def comma(num):
'''Add comma to every 3rd digit. Takes int or float and
returns string.
@Source: dnaman7, https://stackoverflow.com/questions/5180365/
python-add-comma-into-number-string'''
if type(num) == int:
num ... |
057b8ad5b7eba7e13a8128ef6efe4ad20c14e368 | 9e059ee06b0bf943f07e2e867686c5872c03be5f | /machine_learning_POS.py | 05aa246ff9b2f44df5c647c6b5c0a6b0a321abba | [] | no_license | Prasanthi04/NLP_DOC-RETRIEVAL | bd0e5e9ccb07c569c7975fbba3dd53392d7e91c4 | 70d304fe711b0d7ae61e18ce3926005bc26721af | refs/heads/master | 2021-08-31T15:13:52.908468 | 2017-12-21T21:19:23 | 2017-12-21T21:19:23 | 115,047,515 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,494 | py | machine_learning_POS.py | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 11 15:57:07 2017
@author: prasa
"""
import pandas as pd
df = pd.read_csv("C:/Drive/FALL2017/NLP/Project/training_data_with_POSTAG_162Q.csv",header=0, quoting=3)
df_Query1 = df['Query']
lis= list(df_Query1)
lis.sort()
def sort_max(query):
df_query = query
lis... |
9fef432b86d918011f68f137efe68cc015da5c02 | fa2bb4efa5e19bc8378012c61a33c0d2f5709f74 | /conda_smithy/cli.py | cf5558933d92498dc08a49d57b89bc9df5850fec | [
"BSD-3-Clause"
] | permissive | conda-forge/conda-smithy | bb7456ebaea7db3792edd5a5d1ae77f7b6bdf9e6 | 288dea84b54e5937d9202094b2bd0580aea12ebb | refs/heads/main | 2023-08-27T12:12:36.091645 | 2023-08-24T07:06:28 | 2023-08-24T07:06:28 | 33,767,206 | 144 | 171 | BSD-3-Clause | 2023-09-12T07:56:48 | 2015-04-11T07:38:36 | Python | UTF-8 | Python | false | false | 33,315 | py | cli.py | import os
import logging
import subprocess
import sys
import time
import argparse
import io
import tempfile
from textwrap import dedent
import conda # noqa
import conda_build.api
from conda_build.metadata import MetaData
from conda_smithy.utils import get_feedstock_name_from_meta, merge_dict
from ruamel.yaml import ... |
fe2a3f0bc3fa98291dfb1f4a1e1d90e40780f3ae | 6a061c8b5c4145bc22acec9c83ea57d6081ab6a9 | /survey/migrations/0011_auto_20160208_0356.py | 0d0c7839cc092ef13587afdcf3c20ef3e04cadac | [] | no_license | microcood/dsurvey | b027439ac9b75f2e16e072ae04c9b832f1489e27 | bc3ddc240cf07f5521e598a419b8762eb93f378c | refs/heads/master | 2021-01-10T06:28:36.990273 | 2016-02-22T18:44:57 | 2016-02-22T18:44:57 | 45,636,841 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 534 | py | 0011_auto_20160208_0356.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-08 03:56
from __future__ import unicode_literals
from django.db import migrations, models
import survey.utils
class Migration(migrations.Migration):
dependencies = [
('survey', '0010_auto_20160208_0356'),
]
operations = [
... |
b32bfff6ac2966e1f727ecaba1393d33d5d652bd | 640fc7223b346fac537fa1d05731aefb66a3d367 | /home/views.py | 9ac01b202bda7b789e32857580d87bfcfe459b99 | [] | no_license | tharcissie/Final-Year-Project | 277ab40a8fb324974a8a55138dce3d16096f4522 | 0b9f07636204bd308721b21567512bdae3a49bd2 | refs/heads/master | 2022-12-30T06:16:48.153067 | 2020-10-22T18:21:57 | 2020-10-22T18:21:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 558 | py | views.py | from core.forms import *
from django.db.models import Q
from django.forms import ModelForm
from django.urls import reverse_lazy
from core.models import Article, Comment, College, Subscriber,
from core.forms import SubscriberForm
from django.views.generic import ListView, DetailView, RedirectView
from django.http impor... |
95590aa8e0446370667acaad6f254dc49f3770d9 | b59e093876a78054bf58ae16fa245bace5d924a2 | /maxIncreaseKeepingSkyline.py | 33568d5eefe9670809f34f933eaea2acd1b7d738 | [] | no_license | NeilWangziyu/Leetcode_py | 539551585413e1eebd6e6175ba3105c6bc17e943 | 4105e18050b15fc0409c75353ad31be17187dd34 | refs/heads/master | 2020-04-08T03:50:05.904466 | 2019-10-15T07:13:49 | 2019-10-15T07:13:49 | 158,991,828 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 717 | py | maxIncreaseKeepingSkyline.py | def maxIncreaseKeepingSkyline(grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
# 水平方向
h_list = []
for each in grid:
h_list.append(max(each))
print(h_list)
v_list = []
for i in range(len(grid[0])):
colum_list = []
for j in range(len(grid)):
... |
bcf4c79068b13f421b433462d64a5bee5fe0f2a5 | d98fae9cd74992a2f81f8c267a71542475b27300 | /protrusion_test/full/full.py | 1f19be4fd6b888442ee3304f7d6f5f42dbbe94e2 | [] | no_license | NicholasPiano/img-desktop | f516c4da8041aabe3cd4a1af24fdbc42eda105fa | 9a2eed6cc0d912b675d02d8b0b20f60a71a5b481 | refs/heads/master | 2021-01-23T13:17:49.601534 | 2015-10-07T11:28:25 | 2015-10-07T11:28:25 | 39,502,099 | 0 | 0 | null | 2015-10-07T11:28:26 | 2015-07-22T11:19:19 | Python | UTF-8 | Python | false | false | 1,990 | py | full.py |
import os
from os.path import join, exists
import numpy as np
from scipy.misc import imread, imsave
import matplotlib.pyplot as plt
from skimage import exposure
from scipy.ndimage.measurements import label
from scipy.ndimage.morphology import distance_transform_edt
def str_value(v, vs):
v_str_len = len(str(v))
vs... |
b2d894921594d69b134820d2af8aa626f0d8e1e3 | b794943d9e742ed479fa1fda2c2de42be5152b1a | /auth_sessions/routes/auth.py | e4c2d10ba97822e7bebbe3a9a3e3e13371ded48b | [] | no_license | RemoteCraftsmen/demo-python-django-api | 6d7f69003d7d2d5cc473fd5a09634935d0875994 | c42dbcf4062a64cd64bc71d139177309ee8ff4ef | refs/heads/develop | 2023-07-16T02:33:21.099526 | 2021-08-17T23:25:42 | 2021-08-17T23:25:42 | 385,270,657 | 0 | 0 | null | 2021-08-19T20:01:18 | 2021-07-12T14:11:54 | Python | UTF-8 | Python | false | false | 681 | py | auth.py | """
Routes for auth_session
"""
from django.urls import path
from auth_sessions.views.auth.login import Login
from auth_sessions.views.auth.logout import Logout
from auth_sessions.views.auth.register import Register
from auth_sessions.views.auth.change_password import ChangePassword
from auth_sessions.views.auth.chang... |
ea4bd4615c0be385c5cde73bc0a035af7dfa540d | 61639a67b400d5ca726eb2552645751d08df94ac | /Section 7/33/thirtythree.py | f88bb00c76277ad6fe9e7d4c903e871db685a77e | [] | no_license | sureshyhap/The-Python-Mega-Course-Build-10-Real-World-Applications | 17cfe4d057c95844f67e501ff5e3c06ec72c22a4 | b7f6e3a60ebc9750493d207f54dbc344b94d2357 | refs/heads/master | 2023-05-19T00:58:17.781456 | 2021-06-09T22:39:48 | 2021-06-09T22:39:48 | 298,668,270 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 128 | py | thirtythree.py | colors = [11, 34.1, 98.2, 43, 45.1, 54, 54]
for color in colors:
if type(color) == int and color > 50:
print(color)
|
690275347e508d712e61693889bee2c9d43861a7 | 18ad97292b34a679b8dea8a85090541c5bbf6174 | /oddbinom.py | c7b6f03bde3488d8ffcb794c894bc99d459cc022 | [] | no_license | Jyotirm0y/kattis | b941044e39dc36d169450480fc33fd33bd2e0f8e | 2b9c1819ba29419bbea3db2e8ad7851155abbb3a | refs/heads/master | 2023-05-31T21:11:38.350044 | 2021-06-12T08:21:47 | 2021-06-12T08:21:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 177 | py | oddbinom.py | import math
global a
a = {1:1}
def f(x):
if x in a:
return a[x]
a[x] = 2 * f(math.floor(x/2)) + f(math.ceil(x/2))
return a[x]
n = int(input())
print(f(n))
|
c23f772e169fc1ed41c1444e023cea545f03ae4b | e3b4bb7657f3c7a25cdf59d65a3730cd3b7055d7 | /ImageToJSON.py | 1f2920ca8ebed2078413624507db0b8c4e31d5f3 | [] | no_license | amunguia/ImageToJSON | 8fc2dfba56d1c002322fc82f4683406086c1e8e9 | 23536bdcd0a648df6a5e918dc7b4c30aedd97e1d | refs/heads/master | 2020-12-24T14:45:12.624742 | 2015-08-21T16:05:20 | 2015-08-21T16:05:20 | 21,553,107 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,725 | py | ImageToJSON.py | #! /Users/jandro/anaconda/bin/python
import numpy as np
import sys
from PIL import Image
"""Convert a color in 0-255 integer range to a string
of length 2 where digits are the integer converted to hex."""
def convertColorToHex(color):
number = str(hex(color))
start = number.find('x')+1
end = number.find(... |
96d5cf948a9b0f622889977e8b26993299bceead | 9340619d7fbf49d59f7783c8bfb560fc3f0cadc9 | /combine_all.py | 0cb15acd0100d3e216f47c846f4bbb4003ee7dfa | [] | no_license | CuiKaiChina/2018-phm-data-challenge | a5a015ffa26d5ef733bb21b8b31ccf8c28f44b0b | c153484674c98a6cb32119dd763c5af038890209 | refs/heads/master | 2021-09-19T21:14:23.284609 | 2018-07-31T15:48:52 | 2018-07-31T15:48:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,134 | py | combine_all.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 18 13:37:10 2018
@author: ninja1mmm
"""
import os
import numpy as np
import pandas as pd
from sklearn import preprocessing
def file_name(file_dir):
root_tmp=[]
dirs_tmp=[]
files_tmp=[]
for root, dirs, files in os.walk(file_dir): ... |
d09984c6e6a0ce82389dbbbade63507e9687355d | ec6f403bed63a08530594249dad10c8b3dd18c8d | /Pages/migrations/0015_auto_20191223_2208.py | 4defb645ded84b356f1fecc9e1928bc6b7c3d540 | [] | no_license | AkashMaurya09/Project_deepblue_Precdict_Queue_wait_Time_Product | 0e673b79205420244ec60dbf78e3411873fa5ecb | 02ab3c514074da2acbef940d0c685faacfce5151 | refs/heads/master | 2021-02-26T16:45:01.870002 | 2020-02-17T13:36:20 | 2020-02-17T13:36:20 | 245,541,095 | 1 | 0 | null | 2020-03-07T00:22:49 | 2020-03-07T00:22:49 | null | UTF-8 | Python | false | false | 488 | py | 0015_auto_20191223_2208.py | # Generated by Django 2.2.6 on 2019-12-23 16:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Pages', '0014_auto_20191223_2032'),
]
operations = [
migrations.AlterField(
model_name='dept',
... |
5d4ef314bb7169f5de4795e5c1aca62a1a060bae | aa840826ad7375f10c318875973dc12093656596 | /swiggy/s_admin/models.py | 5bec8df6cac0c6c1fa9106428ad295f4abfa3d88 | [] | no_license | karthik94940/Swiggy | 54f750ed6057e866c43f10d9d130dc17e43f1498 | 742c2a545ea8aed9681087c8e65bccda2fdbd5c7 | refs/heads/master | 2022-04-26T01:45:13.722653 | 2022-04-20T05:19:24 | 2022-04-20T05:19:24 | 255,484,854 | 0 | 0 | null | 2022-04-20T05:19:24 | 2020-04-14T01:53:54 | Python | UTF-8 | Python | false | false | 1,317 | py | models.py | from django.db import models
# Login Admin Model
class AdminLoginModel(models.Model):
user_name = models.CharField(max_length=30,unique=True)
password = models.CharField(max_length=16)
# Swiggy Admin State Table
class AdminStateModel(models.Model):
state_id = models.AutoField(primary_key=True)
sta... |
5c5f00084f37837b749e1fbb52a18d515e09ba06 | c9352ee153e1afd6b81c8a8e7be71ac29a6831fa | /bfs.py | 462021db49be4abea5cafe1bc309a8d353a52f26 | [] | no_license | gabtoschi/ai-2021 | b5bfaaa3e4787238d6dac26e64310c27012ec2ea | fe840addb37f313a25344093d86d7446e58f0780 | refs/heads/main | 2023-06-22T18:58:53.184280 | 2021-07-05T17:59:15 | 2021-07-05T17:59:15 | 375,025,364 | 0 | 0 | null | 2021-07-04T21:10:24 | 2021-06-08T13:48:03 | Python | UTF-8 | Python | false | false | 483 | py | bfs.py | import graph as Graph
def BFS(graph: Graph.Graph, start, end):
visited = set()
parent = dict()
parent[start] = None
queue = []
queue.append(start)
visited.add(start)
while queue:
current = queue.pop(0)
if current == end:
break
for v in graph.neighbor... |
6b785502e8a8983c164ebdffdd304da47c926acb | 5557d412bdca4a0f90d4618ea390eeda7a8e8653 | /mainApp/apps.py | 5933ec20377e1017e9dfdfe63cbeccfcf471dadf | [] | no_license | TborgTW/laughs | d8022f4a7033daf7470e99ba19c4b57ff012a31c | 4ac5f070ca6d531bfbea8b2b43feff1c13051755 | refs/heads/master | 2020-04-09T15:30:55.352041 | 2018-12-04T22:44:11 | 2018-12-04T22:44:11 | 160,428,346 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 93 | py | apps.py | from django.apps import AppConfig
class LaughsappConfig(AppConfig):
name = 'laughsApp'
|
4a7f8221208e8252c7f5c0adff2949f0e552def1 | 899ec47323d0eefa5206d264e770cf4e3ec2de66 | /machine learning/microsoft dp100 labs/code samples/run_pipeline.py | 161f822209cb70ad1cb190a7906974c05b0de5fe | [] | no_license | Ze1598/data-projects | 58706cc4f428a724ab8f8da6979455426970992a | 935632b4b98deec251381d0baa3680b397e913df | refs/heads/master | 2023-06-09T08:08:10.407270 | 2023-04-14T19:58:55 | 2023-04-14T19:58:55 | 242,784,731 | 2 | 2 | null | 2023-05-31T01:32:47 | 2020-02-24T16:23:58 | HTML | UTF-8 | Python | false | false | 1,516 | py | run_pipeline.py | from azureml.core import Workspace
from azureml.pipeline.core import Pipeline
from azureml.core import Experiment
from azureml.pipeline.steps import PythonScriptStep
import requests
ws = Workspace.from_config()
# Step to run a Python script
step1 = PythonScriptStep(
name = "prepare data",
source_di... |
03fb1cf0aac0c37858dd8163562a7139ed4e1179 | bc9d5bd2ba9ca0a80f34fb898b943ff533b4dea3 | /main.py | 6c676687865643a6a773e071c93a77ec296136e1 | [] | no_license | CalvinMT/DTW | 6d10fdcd3a71148a43f341d5ff225258baa9bdfa | 7e1b449a8f300024f96bed023b824fa783b577cd | refs/heads/main | 2023-06-19T00:26:27.302510 | 2021-07-19T20:17:33 | 2021-07-19T20:17:33 | 373,557,581 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,454 | py | main.py | import dtw
import stats
import glob
import argparse
import matplotlib.pyplot as plt
GRAPH = False
PERCENTAGE = False
VERBOSE = False
def buildExpectations(queryPath, searchPatternPath):
"""
Based on SpeechCommand_v0.02 directory structure.
"""
expectations = []
currentDirectory = ""
queryFile... |
303a8609cb21c60a416160264c3d3da805674920 | 78bff10cea25682eb06e96f9f841a4693e1b8341 | /tests/test_noise_reg.py | 7c3d703abc9e735829d5d5c5d05eea454d92942f | [] | no_license | jxzhangjhu/NormalizingFlowNetwork | 409611b80a2f489a16ca645d904db987f550130c | 26e2e9be4a0d3627a61b50566be6fa425c8b5d2d | refs/heads/master | 2023-01-31T09:54:27.348355 | 2020-12-10T09:08:47 | 2020-12-10T09:08:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,469 | py | test_noise_reg.py | import tensorflow as tf
import tensorflow_probability as tfp
import pytest
import numpy as np
from estimators import NormalizingFlowNetwork
tfd = tfp.distributions
tf.random.set_seed(22)
np.random.seed(22)
@pytest.mark.slow
def test_x_noise_reg():
x_train = np.linspace(-3, 3, 300, dtype=np.float32).reshape((300,... |
830e7e84eebd6a4adb411cc95c9e9c8ff7bdac30 | fc2ca1878cde3ab1a12dc19eee2312d382bdeafa | /Subsetsum problme.py | f197191660c3131100bf893dee4f5d8d742481db | [] | no_license | keerthi4600/Smarthinterviews-hackerrank-python | d484a4e7a3bc24f8a8cc0e466c1e69c72644a995 | a0f23dd109c8103a1bdcaa5c013f8173a09898e9 | refs/heads/master | 2022-12-15T15:59:46.536401 | 2020-08-29T12:48:11 | 2020-08-29T12:48:11 | 290,942,469 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 721 | py | Subsetsum problme.py | def isSubsetSum(set, n, sum):
subset =([[False for i in range(sum + 1)] for i in range(n + 1)])
for i in range(n + 1):
subset[i][0] = True
for i in range(1, sum + 1):
subset[0][i]= False
for i in range(1, n + 1):
for j in range(1, sum + 1):
if j<set[i-1]:
... |
e60c3a6aececd97ec08ae32b552bcda795375b3b | 3f19365f3e9ce48acb8b6638e4a1161fa025aebd | /bin/build_doc.py | d648570a649fee940faec250a0a4529a847f272b | [
"BSD-3-Clause"
] | permissive | Durburz/eMonitor | 9f57c51ecf4d68a17803b9fd630faf6d0ec5b4cd | 56f3b1fe39b9da3a12b49bdd60d0cfca51c23351 | refs/heads/master | 2021-09-28T23:37:05.778353 | 2018-11-21T13:06:17 | 2018-11-21T13:06:17 | 120,184,604 | 0 | 0 | NOASSERTION | 2018-11-21T12:57:19 | 2018-02-04T12:52:44 | Python | UTF-8 | Python | false | false | 1,243 | py | build_doc.py | import os
import sys
from shutil import copyfile
def buildDocumentation():
"""
Build eMonitor Documentation with sphinx
:param sys.argv:
* html: build html documentation in directory */docs/output/html*
* pdf: build pdf documentation in directory */docs/output/pdf*
"""
helptext = 'u... |
03b6257efb8c0b689a9a63cc47b11f4b06b30d03 | e3b0da1df48cf8114d6ceb05969a220bec7567df | /src/client/py/dircreate.py | 772d58c314bfa6744ec1b8afc766df03431ce437 | [] | no_license | JungleComputing/OSFA | b05fe40117eb73fbb87f88577058acc7820fba03 | 22145b7364761ad2a70a4ebc5014527f71d3bece | refs/heads/master | 2021-08-19T15:59:59.502149 | 2011-01-18T10:11:30 | 2011-01-18T10:11:30 | 112,114,342 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,327 | py | dircreate.py | #!/usr/bin/python
import os
import timeit
import sys
sys.path.append("../../../../thrift/lib/py/build/lib.macosx-10.6-x86_64-2.6/")
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
sys.path.append("../../thrift/gen-py")
f... |
1762dd4affbc9b28673c34f7853519f5bde42b62 | 9edaf93c833ba90ae9a903aa3c44c407a7e55198 | /netex/models/simple_object_ref.py | 097e58f8f8df556a69eabb5ba41a4b06a04f85f8 | [] | no_license | tefra/xsdata-samples | c50aab4828b8c7c4448dbdab9c67d1ebc519e292 | ef027fe02e6a075d8ed676c86a80e9647d944571 | refs/heads/main | 2023-08-14T10:31:12.152696 | 2023-07-25T18:01:22 | 2023-07-25T18:01:22 | 222,543,692 | 6 | 1 | null | 2023-06-25T07:21:04 | 2019-11-18T21:00:37 | Python | UTF-8 | Python | false | false | 279 | py | simple_object_ref.py | from dataclasses import dataclass
from .simple_object_ref_structure import SimpleObjectRefStructure
__NAMESPACE__ = "http://www.netex.org.uk/netex"
@dataclass
class SimpleObjectRef(SimpleObjectRefStructure):
class Meta:
namespace = "http://www.netex.org.uk/netex"
|
bad4d24e02de700a3709cd43178ce2891914736e | 467a9bcc443e883454ba7962a2f539efe2ae282d | /networking_bigswitch_l3_pe/lib/event.py | 7d47597bb36e251bc05f11c647fbc1cd0aeae180 | [
"Apache-2.0"
] | permissive | DeNADev/networking-bigswitch-l3-pe | a9465f022834e24e929682df901f0591b0bb7cdd | 5fa84925ff0ed7763377147fee00243f1f8509db | refs/heads/master | 2021-01-20T18:02:39.776515 | 2017-07-06T06:55:45 | 2017-07-06T06:55:45 | 66,430,274 | 2 | 0 | null | 2017-07-06T06:54:53 | 2016-08-24T04:38:49 | Python | UTF-8 | Python | false | false | 2,724 | py | event.py | # Copyright 2016 DeNA 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 agr... |
0a3b45d1734dc6d4f5cbf3b0d490e0d493e9e960 | 190870bafc18f9dfaa88092683eb3c5ad503f714 | /main/rsa_encryption/main.py | 0bc2e609b5646c9ed1077e5c2d8c957f8b38a217 | [
"MIT"
] | permissive | Risoko/RSA-Encryption | a666b4ef5cfc5a08b0fa28f6cad0bd50d3267d9f | 1bea1ef3a7609541578d784b7315c73e1e6a481b | refs/heads/master | 2020-09-10T08:02:19.277640 | 2019-11-17T12:52:06 | 2019-11-17T12:52:06 | 221,694,654 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,482 | py | main.py | import getopt, os, sys
from datetime import datetime, timedelta
from rsa_encryption.settings import PATH_FOR_PUBLIC_KEY, KEYS_EXPIRE
from rsa_encryption.tools.keys_tool import create_keys
from rsa_encryption.tools.encryption_tool import encryption
from rsa_encryption.tools.decryption_tool import decryption
from rsa_en... |
ca83d359434b08d733689f47bc98b8ee6de8c968 | 6bc58f290bc3ecd1f4d2a492f0abc5fd4b8ff9c0 | /tests/test_netapp_grid.py | d352dc3658c83d5dd53d6480215603d8f7fd97f4 | [
"Apache-2.0",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-generic-cla",
"BSD-2-Clause"
] | permissive | splunk/splunk-connect-for-syslog | c5821e025ef1b5d1312a6ac71b822262f560aa99 | 472f0b7a0bcbb29cb00a141e4fe4aa6193c49fde | refs/heads/main | 2023-08-25T03:57:40.245846 | 2023-08-21T08:55:12 | 2023-08-21T08:55:12 | 194,185,530 | 188 | 149 | Apache-2.0 | 2023-09-14T18:31:04 | 2019-06-28T01:27:07 | Python | UTF-8 | Python | false | false | 2,953 | py | test_netapp_grid.py | # Copyright 2019 Splunk, Inc.
#
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
from jinja2 import Environment
from .sendmessage import *
from .splunkutils import *
from .timeutils import *
env = E... |
f8ab9084016bfc025003e48b16df1b32b4d173ce | e7f5938bbd7aa09714d74fec547d8418c2120b53 | /makina/recipe/postgres/__init__.py | f1856489c81f32859f3ce018d5bac13856892b45 | [] | no_license | jean/makina.recipe.postgres | dde492be7893b5f4a8857b8e3899f88fa340e125 | a5368c6534870a5a4e4d248f8879813ae3e6bb9a | refs/heads/master | 2021-01-18T15:06:18.456507 | 2014-05-16T11:38:34 | 2014-05-16T11:38:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,944 | py | __init__.py | # -*- coding: utf-8 -*-
# Copyright (C)2007 'jeanmichel FRANCOIS'
# 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 2 of the License, or
# (at your option) any later version.
# Th... |
7814503e24fc4804fa10dde1a490e51a3d56bd68 | 7c0533529e844c7d9f39c3e5a5c4bd914741857f | /SmartChain/RestAPI/RestAPI/API/PasswordAuth/validate_pharma.py | 75fe84c706571636daeaa3d86b1861e784959e63 | [] | no_license | NikilMunireddy/SmartChain | b8ea87c015e4e4108dfd67ae44452fd3ebcfd16c | bb7fc84b699c1420259139b8567ccfe535423690 | refs/heads/master | 2023-01-22T13:59:16.875493 | 2019-11-21T12:39:17 | 2019-11-21T12:39:17 | 175,342,611 | 1 | 0 | null | 2023-01-03T20:45:46 | 2019-03-13T03:52:50 | JavaScript | UTF-8 | Python | false | false | 726 | py | validate_pharma.py | from django.shortcuts import render
from django.http import JsonResponse, HttpResponse
from django.views.decorators.csrf import csrf_exempt
import json
from ..Packages.auth_api import db_connection
from ..Packages.auth_api.passwordvalidate import validate_pharma_password
from .. import default_constant_values
@csrf... |
728b0cdf28e67681ddf2d6c06f139ec05914c4ca | 9a34d241175b66dfd13713655356cb8cbab895f4 | /torch_model_base.py | dc138b4692e8f89105dac444d394bb83aae87715 | [
"Apache-2.0"
] | permissive | stas00/cs224u | 38dd41421436a006a95e550e76db5b2a97cd4a75 | 0db2923dd55905bb9c88cec0a2cad5e0d411c9f1 | refs/heads/master | 2020-12-22T01:26:27.916168 | 2020-01-21T01:56:23 | 2020-01-21T01:56:23 | 236,629,457 | 1 | 0 | Apache-2.0 | 2020-01-28T00:51:36 | 2020-01-28T00:51:35 | null | UTF-8 | Python | false | false | 3,614 | py | torch_model_base.py | import pickle
import torch
import torch.nn as nn
__author__ = "Christopher Potts"
__version__ = "CS224u, Stanford, Spring 2020"
class TorchModelBase(object):
def __init__(self,
hidden_dim=50,
hidden_activation=nn.Tanh(),
batch_size=1028,
max_iter=100,
e... |
560a820fa2219d5a258b65182205fe0000ee2233 | cb30e03cda138ca368571d951a48a95abc4546b1 | /work/day7/work4.py | 75b9de15beeffc1f6d7703a0385f69a96f0e80ae | [] | no_license | yuanshun9606/python_work | 245cfeb71189f373d0867ea9620db6e68655d4ad | 46f6863ba86debcb6bab1022060310d55f77333b | refs/heads/master | 2022-11-25T08:38:51.771494 | 2020-08-01T14:16:06 | 2020-08-01T14:16:06 | 284,268,809 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 223 | py | work4.py | n = int(input())
a = []
for i in range(3):
s = input().split()
if ((n % int(s[0])) != 0):
a.append(((n // int(s[0]) + 1) * int(s[1])))
else:
a.append((n // int(s[0])) * int(s[1]))
print(min(a))
|
16dbfa862efe9c0801c379e93c30bd8233a5b895 | c49a1bb69a52cae652fef8492453cb9ced33dbfd | /Vjezbe_8/Projectile2.py | 145275e6d91f54abf4d53446d5b2dcab43c33ef9 | [] | no_license | lucijajagnjic/PAF | cf6ce1b309dbbf137d753784f3d4cb9f282d5fb4 | 5368cd1d8b6841bed26061770f36d68bdae90c7d | refs/heads/master | 2023-08-15T05:48:03.255067 | 2021-09-16T09:12:08 | 2021-09-16T09:12:08 | 344,387,165 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,178 | py | Projectile2.py | import matplotlib.pyplot as plt
import math as m
from math import pi, cos, sin
import numpy as np
class Projectile:
def __init__(self, theta, v0, S, m, p, q, r, t, dt = 0.01, C = 0.47, rho = 1.28):
self.x = 0
self.y = 0
self.m = m
self.theta =(theta/180.)*pi
self.v0 = v0
... |
a5b8cb97bab4295611d4bfc976c34689e5fd4bd8 | 1bf9b100ef60eab89cc65132e1e8ec50823a7140 | /lc/922.sort-array-by-parity-ii.py | f2268363f4631797e015d6bcca388575847516f7 | [] | no_license | obleevious/remoteWorkSyncFolder | 4003ee6297626646424e6709c550b7c21b201c98 | b44c1ca0a3824db5fb3d30c7ca9994c7b48f8ed2 | refs/heads/master | 2020-04-15T03:40:29.372391 | 2019-04-29T17:57:07 | 2019-04-29T17:57:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,282 | py | 922.sort-array-by-parity-ii.py | #
# @lc app=leetcode id=922 lang=python3
#
# [922] Sort Array By Parity II
#
# https://leetcode.com/problems/sort-array-by-parity-ii/description/
#
# algorithms
# Easy (66.27%)
# Total Accepted: 23.2K
# Total Submissions: 35K
# Testcase Example: '[4,2,5,7]'
#
# Given an array A of non-negative integers, half of the... |
681d38582f4053bea3ca44c3f6c0c144d4a94c4b | fb1f9902814019d79719700a07d87c047218f841 | /FP Overplot Variations/simulation_setup.py | 9809b6c89b324923eecb28f08d5a152e604c3478 | [] | no_license | Oliver-Price/Python-Dust-Codes | e0e63c2c94f5af754313e312f4ba35bf26b1d4d9 | 267c4cdbd6a26f0f2962ed5c8cdf07fb12d9eb00 | refs/heads/master | 2022-03-13T13:08:52.312713 | 2022-02-23T15:54:37 | 2022-02-23T15:54:37 | 49,732,772 | 4 | 0 | null | null | null | null | UTF-8 | Python | false | false | 19,407 | py | simulation_setup.py | #default parameters
import easygui
import pickle
import os
import sys
def simulation_setup(savefile):
saveexists = os.path.exists(savefile)
if (saveexists == False):
betau = 1; betal = 0.1; bno = 50
simtu = 10; simtl = 1; tno = 50
threshold = None #formerly used for phase spac... |
e308169da3287544337a762186313b8809413e99 | 7f7312b835e6139d86ddb0b7c80743d10a6d9cf6 | /analysisBase.py | f15a7dd90c56b8be4f1a8349558cf64e01e62a22 | [] | no_license | CTFallon/FAnalysis | d9d7fae002b15411a390aad4186078ec909fef9f | 92e3beb361db431024ce47f85d812857e084a4f5 | refs/heads/master | 2021-01-23T00:46:26.776137 | 2019-10-31T16:06:36 | 2019-10-31T16:06:36 | 92,847,144 | 0 | 1 | null | 2019-05-08T16:57:01 | 2017-05-30T15:24:26 | Python | UTF-8 | Python | false | false | 12,985 | py | analysisBase.py | # base class for FAnalysis, copied from Lucien Lo's PFG HcalTupleAnalyzer, adapted to python
import ROOT as rt
import datetime
class baseClass:
def __init__(self, fileID, treeList, rootDir, outFileName):
#self.fileList = fileList # .py file of dictoary
self.fileID = fileID
self.treeList = treeList # list of Tree... |
0b4b484f8dd3c2740ec7cb97df2e1714800ee881 | 0470a0c902af25b8b1ec1900a543ffd77ebd63ea | /ProjectEuler+/3 Largest prime factor.py | 0d6471e526dc17e0ca7464aa67c35a1ddcc8ba8c | [] | no_license | surajkumar19/HackerRank | bc1612ee106574e8a6abacb9d9325b8bc2b3e282 | e9e9af2fbf1bbe7def69afe2eca9f48daefb53f1 | refs/heads/master | 2020-03-23T16:01:40.305938 | 2018-07-24T03:39:08 | 2018-07-24T03:39:08 | 141,281,884 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 465 | py | 3 Largest prime factor.py | #!/bin/python3
import sys
def largest_prime_factor(n):
k=n
while k%2==0:
k=k/2
if k==1:
return 2
# k=n
# c=0
# c2=0
while True:
c=0
for i in range(3,round(n**(1/2))+1,2):
if k%i==0:
k=k//i
j=i
c+=1
break
if c==0:
break
if k>2:
return k
e... |
3fccfc08bdf0e29574bfcdfa980ebc6671d2127d | 656181bf7d15472cd0a6814eb5aafc033ecb4f23 | /DLITE/__init__.py | 1a306ce44631afc58ebf334649d5c6cd2eb04cbc | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] | permissive | Rangamani-Lab/DLITE | dc0debb119b73793e68665d6613526f4654f560e | 8b686d5e18324bdb52bb2804cc5c5aff7999931e | refs/heads/master | 2020-09-27T01:57:20.193788 | 2019-11-18T20:29:10 | 2019-11-18T20:29:10 | 226,396,706 | 0 | 1 | NOASSERTION | 2019-12-06T19:35:58 | 2019-12-06T19:35:57 | null | UTF-8 | Python | false | false | 369 | py | __init__.py | """Top-level package for DLITE."""
__author__ = 'Ritvik Vasan'
__email__ = 'rvasan@eng.ucsd.edu'
__version__ = '0.1.0'
def get_module_version():
return __version__
import matplotlib as mpl
mpl.use('TkAgg')
from . import cell_describe, ManualTracing, ManualTracingMultiple, SurfaceEvolver, AICS_data, PlottingFun... |
21f6db596d2773f40a22f0c1d1bf07e6492989b9 | 06919b9fd117fce042375fbd51d7de6bb9ae14fc | /py/tests/problems/daily/longest_substring.py | 45b2ded398667af15ad61263e2b63949295f78e6 | [
"MIT"
] | permissive | bmoretz/Daily-Coding-Problem | 0caf2465579e81996869ee3d2c13c9ad5f87aa8f | f79e062e9f6e7b18b7e95c071fbe71ad104affcb | refs/heads/master | 2022-12-07T15:41:06.498049 | 2021-11-18T19:45:19 | 2021-11-18T19:45:19 | 226,376,236 | 1 | 0 | MIT | 2022-11-22T09:20:23 | 2019-12-06T17:17:00 | C++ | UTF-8 | Python | false | false | 499 | py | longest_substring.py | import unittest
from dcp.problems.daily.longest_substring import longest_substring1
class Test_LongestSubstring1(unittest.TestCase):
def setUp(self):
pass
def test_case1(self):
assert longest_substring1('abcba', 2) == 3
from dcp.problems.daily.longest_substring import longest_subs... |
21fb5689fc6b712da76855622b580566a2aa0ec6 | 2f63688febd21dc3ae6b19abfa79ad313c820154 | /1166_Design_File_System/try_1.py | 54ea0a229bd274b942fa1d4427dcd3df18f49a06 | [] | no_license | novayo/LeetCode | cadd03587ee4ed6e35f60294070165afc1539ac8 | 54d0b3c237e0ffed8782915d6b75b7c6a0fe0de7 | refs/heads/master | 2023-08-14T00:35:15.528520 | 2023-07-30T05:56:05 | 2023-07-30T05:56:05 | 200,248,146 | 8 | 1 | null | 2022-11-19T04:37:54 | 2019-08-02T14:24:19 | Python | UTF-8 | Python | false | false | 1,576 | py | try_1.py | class Node:
def __init__(self, val=-1):
self.val = val
self.children = collections.defaultdict(Node)
class FileSystem:
def __init__(self):
self.trie = Node()
def createPath(self, path: str, value: int) -> bool:
if not self.isValid(path):
return Fals... |
33f5188fdc8434691dad2a4686164ff03336a19d | b3d95312670be48e35db5b5d89ac32d7a608f0d0 | /core/migrations/0003_auto_20210418_2149.py | 644c28b3ace8b9d8082e0d60c78e9a6c882606ef | [] | no_license | rashadgsml/Django-Chat-App | 0dc7f78166576ba084455e82887b9d7c38aefe7f | 32bc1c0702c7853ebc957faf62637b034240e69c | refs/heads/main | 2023-04-17T21:46:36.277686 | 2021-05-04T23:10:44 | 2021-05-04T23:10:44 | 346,791,906 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 811 | py | 0003_auto_20210418_2149.py | # Generated by Django 3.1.7 on 2021-04-18 17:49
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('chat', '0012_auto_20210417_1735'),
('core', '0002_auto_20210418_1745'),
]
operations = [
migrations... |
d4f336ad5f12e2e17cc84a16db8a432befc2542e | df5cd640098a10e754a9552187fc5ad8c50df90c | /colour/models/rgb/dataset/rec_709.py | 7562524c333923d61eb730c8d2bedd40aea43b59 | [
"BSD-3-Clause"
] | permissive | ofek/colour | d4963c9b77b0d119cf3ef3296dbf5369167472df | 04f4863ef49093a93244c1fedafd1d5e2b1b76da | refs/heads/develop | 2021-07-08T05:33:14.220392 | 2017-09-29T22:34:14 | 2017-09-29T22:34:14 | 105,406,461 | 0 | 0 | null | 2017-09-30T23:06:18 | 2017-09-30T23:06:18 | null | UTF-8 | Python | false | false | 2,598 | py | rec_709.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Rec. 709 Colourspace
====================
Defines the *Rec. 709* colourspace:
- :attr:`REC_709_COLOURSPACE`.
See Also
--------
`RGB Colourspaces Jupyter Notebook
<http://nbviewer.jupyter.org/github/colour-science/colour-notebooks/\
blob/master/notebooks/models/rgb.... |
42bd8f8736a16f745fdb67eca18a3d7ee6d18f44 | 37d6d527ea943e1f93ec16f23b0129ac3dc97241 | /measures/spectral_angle_mapper.py | 69e4ef0417cc34096a8766623ff8296c47b92508 | [
"Apache-2.0"
] | permissive | ECO2ZTS/data-bloodhound | b0292d59015c32e0c573fcc9afca86a193be56dc | ae0413e748e55a0d2dbae35bbe96a672f313a64b | refs/heads/master | 2021-09-12T16:35:20.113394 | 2018-04-18T19:09:23 | 2018-04-18T19:09:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,323 | py | spectral_angle_mapper.py | #!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, August 2016
from math import acos
import numpy as np
... |
1ae444ce713dd433155b3b00c5212ec0355a86e7 | a07bd0897cc17a7b6cc46ab276701c1b78501a22 | /main.py | c54a30367d2af9eb0ddeb83147783253b983192a | [] | no_license | jsamwel/SimplePhysicsSim | 999a212da5e55436257a6ce040a6f355049d80d3 | 8428133fa56d65c263b76a209a080b0831125fae | refs/heads/main | 2023-07-31T13:27:27.996828 | 2021-09-15T11:02:25 | 2021-09-15T14:24:39 | 370,581,350 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,519 | py | main.py |
import numpy as np
import open3d as o3d
import time
def main():
herz = 50
debug = False
sim = simulation(herz=herz)
for i in range(herz*5):
sim.update()
if debug:
spherepos = []
for sphere in sim.spheres:
spherepos.append(sphere.po... |
ecbb5e0276fb08229c6a31fc687817ea3405b702 | 8f778a3f0b8a4df780a3a427ea1e512ab31c7dbd | /zeepy/utilities/response_handler.py | c7efb607c60cd0bd265d21a17ae5817cb435de09 | [
"Apache-2.0"
] | permissive | uzust01/Zeepy | 293b16f6b46027bf5e5e2d66370892ba1a072bba | cbd7d6ea635ca3be848d0500ef5415024f3a0d4d | refs/heads/master | 2020-12-07T18:25:05.633600 | 2020-01-09T01:32:27 | 2020-01-09T01:32:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,186 | py | response_handler.py | '''
Copyright 2020 Guilherme Cartier de Palma
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
95eaf97eafbd22daaf689c4703a57c1d05d4885d | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p02963/s574159858.py | 67df758fda04a2add584f20bd40cecde06e6d349 | [] | 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 | 81 | py | s574159858.py | from math import ceil,sqrt;s=int(input());a=ceil(sqrt(s));print(0,0,a,1,a**2-s,a) |
ce6bca007c3fefedc3a77ae95d8ae207d9903515 | f359c953ef823cc44f7d87a3736c3e4fb1817c0b | /EDBRCommon/python/simulation/RunIIDR74X/RSGravToZZToLLQQ_M-3000.py | 8aea192ff25ae4c76273318c2290b983aa5a1461 | [] | no_license | jruizvar/ExoDiBosonResonancesRun2 | aa613200725cf6cd825d7bcbde60d2e39ba84e39 | b407ab36504d0e04e6bddba4e57856f9f8c0ec66 | refs/heads/Analysis76X | 2021-01-18T20:00:57.358494 | 2016-05-30T21:30:19 | 2016-05-30T21:30:19 | 23,619,682 | 1 | 1 | null | 2016-04-22T18:38:45 | 2014-09-03T12:41:07 | Python | UTF-8 | Python | false | false | 697 | py | RSGravToZZToLLQQ_M-3000.py | import FWCore.ParameterSet.Config as cms
maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
readFiles = cms.untracked.vstring()
secFiles = cms.untracked.vstring()
source = cms.Source ("PoolSource",fileNames = readFiles, secondaryFileNames = secFiles)
readFiles.extend( [
'/store/mc/RunIISpring15D... |
d1ace83e879fa7858b476a8d656298b831ec7a5f | 3e945ac3a5a80b08b49ffb92e33f48e24c08a34f | /sphere_generator/state_tracking.py | 4a05ae59b92c6d4f1608ce8d589a6d661b61915b | [] | no_license | tryggth/CDT | ba69d06aa234138e48d82bc8b4bbd513f9104503 | f6ecdfcc23c20b19473054089cbd68333a52d409 | refs/heads/master | 2021-01-10T20:09:51.817681 | 2013-10-12T23:57:02 | 2013-10-12T23:57:02 | 13,588,716 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 22,635 | py | state_tracking.py | """
state_tracking.py
Author: Jonah Miller (jonah.maxwell.miller@gmail.com)
This file is part of the sphere_generator program which generates
spheres of (as close as possible to) uniform curvature for a given
surface area by monte carlo simulation.
This file contains classes and functions for measuring properties of... |
b9fb1cea37e9d2ca5bf1d7868299a1e9fee5643c | 077af900994a69773cd9a711dc4da46c7d8a4939 | /iavm/libs/IAVM.py | b33e021b2f58456b70404ad384a1344956055c5e | [
"MIT"
] | permissive | cyberxml/cyberxml-django | 3c1af95f26f92e7636bad0ec6c1b36640b050f39 | 58722cd1ca5192851e894e60a063b6da84a14ed0 | refs/heads/master | 2021-05-16T03:21:52.841334 | 2018-02-03T17:21:25 | 2018-02-03T17:21:25 | 28,784,026 | 9 | 5 | null | null | null | null | UTF-8 | Python | false | false | 14,956 | py | IAVM.py | from cvrf.libs import redhat
from cvrf.libs import microsoft
from cvrf.libs import oracle
from cvrf.libs import adobe
from cvrf.libs import cisco
from cvrf.libs import vmware
from cvrf.libs import wireshark
from cve.libs import nist
from lxml import etree
from django.conf import settings
from eulexistdb import db
fr... |
e89a79b6950f264fea1ff9f5537eafc0afe1b2eb | 6e0ba9e55b00339dc1a2b3f0913c9e8185157fd0 | /photo/views.py | e924181e0dde85e9fd762c338d3ab6e858fbbd85 | [] | no_license | wlsgh7608/django_blog-album | d63f217f88c7e342ed4cf43cba9efc6da98cbfa3 | d2c1ffa73dc3c15e22aa0fc36c200cc147e23c5a | refs/heads/main | 2023-08-06T09:16:59.622815 | 2021-10-04T08:39:14 | 2021-10-04T08:39:14 | 413,339,792 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,590 | py | views.py | from django.shortcuts import redirect, render
from django.views.generic import ListView,DetailView
from photo.forms import PhotoInlineFormSet
# 인파인 폼셋이란 메인 폼에 딸려 있는 폼셋, 테이블 관계가 1:N인 경우 N 테이블의 레코드 여러개를 한꺼번에 입력받기 위함
from photo.models import Photo,Album
from django.views.generic.edit import CreateView,UpdateView,DeleteVi... |
ca144b2f79a8f8736c1a4597022472307d1537d4 | 51a33d81573f2e671c9b8ef8c926be1bc2f05049 | /Borrador.py | af718e998a862d8a9d4867f228c49d7793e292bb | [] | no_license | elite3210/algoritmo | 07708780e1a0fcb27aaa9c52d17cd627ff25c0a2 | 959df855bea15b990304af936468c1845dfca60a | refs/heads/master | 2021-02-04T07:34:55.445483 | 2020-02-28T01:23:21 | 2020-02-28T01:23:21 | 243,638,972 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 725 | py | Borrador.py | import matplotlib.pyplot as plt
from math import sin
def f(x):
return (1/3)*(x+3)**4+x
def dominio(n):
R = []
m = 100
Dominio = []
for i in range(m*n,-n):
R.append([0])
Dominio.append(i/m)
c = 0
for x in Dominio:
R[c] = x
#R[c] = round(f(x),1)
c += 1
... |
eaf5581833aa7b17f048b0703cea280bd533c652 | 5cade488077f807763c16bc6209f5c8d2f0d0c1b | /new2.py | 31bbf67aca0c8f21ad4f6d78f7dd7ffb99e23eee | [] | no_license | jamesbonanno/MTEC2280 | f540b759e42f9a0893e1e5520b91d1e39025bb71 | e60a3b2b292168a8d4c795ebdae93a4ecccc6656 | refs/heads/master | 2021-01-21T13:57:11.180393 | 2016-05-26T02:12:53 | 2016-05-26T02:12:53 | 51,025,011 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 508 | py | new2.py | import sys
import random
# vars for RNG
varA = 0
varB = 101
# the user(s) input
x = input("im thinking of a number between 1 and 100, what it it ?" "\n")
# var of user(s) imput turned into a int
var1 = int(x)
# RNG
var3 = random.randrange(varA,varB)
#check if right or wrong
if(var3 == var1):
print("\n"'you are... |
bbe1fb386136cd5cf135abd6af198db775830bf4 | 765a6447e7e455eb5ea30805aa41f7c5a965e765 | /adam_python/mbproject_pairs_adam.py | 2d287b1378964857e5d2536dad56d33823619389 | [] | no_license | yuanzhuo/Talent2018 | 97647255774fe9c8354fb108a8711d484f0f6629 | c5a418ae51ce8efa462a585a3cd7007e2eb4d3f7 | refs/heads/master | 2020-03-23T04:48:52.149179 | 2018-08-22T12:40:11 | 2018-08-22T12:40:11 | 141,106,679 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,087 | py | mbproject_pairs_adam.py | from sympy import *
from pylab import *
import matplotlib.pyplot as pltm
import numpy as np
import copy
from bit_configs import *
g = Symbol('g')
def super_ham(part_no, part_states, d, truncate):
class single_particle_states:
def __init__(self, total_number, total_levels, energy_spacing_d):
sel... |
0d67484f8707535507e8d171813f29e3933cb601 | cd22b27b286fbe9937905e0f4df8b332bfc8e250 | /IcarusWeb/Results_browser/migrations/0008_auto_20160617_1828.py | 3e8623c96718f26bdf8be882603e46d3f22343c0 | [] | no_license | rcbrgs/Icarus | 99860dcabffae708c2d539b3e251ddab2ee6d307 | 3ef263237a2f31886bfb10fead81cf16a0ffd5d5 | refs/heads/master | 2020-12-29T02:37:59.384750 | 2016-12-20T16:48:48 | 2016-12-20T16:48:48 | 53,386,269 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,437 | py | 0008_auto_20160617_1828.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-17 16:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('Results_browser', '0007_auto_20160615_2301'),
]
ope... |
85fb2ed9c5eb60673963edd75ce56df0926ba14f | 578e1b9d14c5d22a4e3147e20a13fca02f4074e5 | /rest_break.py | b0b9cc97b1748f5e2458372630b80dcf535c5841 | [] | no_license | caoscott/rest-break | 5453d5633395af96e8008d6e70ab81e926cee768 | 9433125ae231a845b26f4fa25b049efe80f99ebc | refs/heads/master | 2021-04-15T13:01:29.332880 | 2017-11-17T02:52:15 | 2017-11-17T02:52:15 | 94,581,175 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,072 | py | rest_break.py | #!/usr/bin/env python
import sys
import time
import os
import logging
import datetime
# All times are in seconds
def trigger_break(break_type, break_duration, icon_path):
while break_duration >= 30:
os.system('notify-send -t %d -u normal -i %s \"%s break: %s left\"'
%(30000, icon_path, bre... |
8aee777c5804154c1df6b59cc1b80509883681a1 | 0641ab58098bcb4c96a3a1daaa0d5f90e160f223 | /datadump.py | 32a789b14cc0c4d9f547021cc179a2205c902800 | [] | no_license | ssi-dk/cge_pointfinder_kma | 53ea32e2aebca7ab5d8896403686a34289dc87b6 | fde02dc0e0362321433fd77cbc447bacc528b3c3 | refs/heads/master | 2022-11-16T15:01:12.938762 | 2020-07-09T12:22:42 | 2020-07-09T12:22:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,315 | py | datadump.py | from bifrostlib import datahandling
def extract_cge_pointfinder_report(sampleComponentObj):
import pandas
summary, results, file_path, key = sampleComponentObj.start_data_extraction("contigs_blastn_results.tsv")
df = pandas.read_csv(file_path, sep="\t")
if df.shape[0] > 0:
# These are all the ... |
f2a7fd5a2214534c5d94617bb9f85fcf0600ebe5 | b472f57c045a110e1d757f326bae9a90fcd966ba | /d3/credicard/tmp_file.py | 5d7de96aade91da64c65a07fee826dc4b72ecbeb | [] | no_license | metook/pylearn | 5fde3093217573e1d1299cf36feb32549ba1d7bf | a21971aad335355c616016c5157cddb387117825 | refs/heads/master | 2021-01-19T08:51:32.590813 | 2017-04-27T15:34:09 | 2017-04-27T15:34:09 | 87,688,906 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,512 | py | tmp_file.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#author:lonerangerr
#time:2017/4/23 20:55
# def a(username):
# f = open('user_info', 'r')
# for i in f.readlines():
# if username == i.split()[0]:
# print type(i.split()[2])
# f.close()
# a('user2')
# def judge_user_exist(username):
# f... |
fd67a3eb180755b7df3761efa73de8a90788349e | 72abf0da7ed9b2a9bcf03a0a554f79c5e05b5798 | /fastrouting/other/DistanceMatrix.py | e8512f32078dac9d09d0fdef79912e480839bc08 | [] | no_license | isossa/fast-routing | c9cb702888204d6b4c5c2cfb6be2125ecbde018e | 1169d22c8b71e93535062a91417d88e5ac4b9eb6 | refs/heads/main | 2023-08-04T04:47:33.286828 | 2021-08-08T20:21:17 | 2021-08-08T20:21:17 | 360,698,279 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,428 | py | DistanceMatrix.py | import requests
class DistanceMatrix:
"""
This class defines the mechanics for requesting a distance/duration matrix
from a set of locations.
This implementation relies on Microsoft Bing Maps DistanceMatrix API. A
distance/duration can be requested by simply running the following line:
T... |
72e31406726827b0ed629798bfcd7080279fe1d2 | 05c7820e349c3b18836ae811e685e23b160a65c1 | /Laboratorio_2/L2_Ej10_A01636160.py | 0be718af8959513ec61a4b11c066efe48831e2a3 | [] | no_license | JonathanChavezTamales/Fundamentos-Programacion | b186a00da912cb2e0d54e37d231a986fc923f806 | a8e103e66621e7e7646aa3c710b3e2a8f7ef8a6e | refs/heads/master | 2020-03-27T02:08:46.114308 | 2018-11-07T18:19:21 | 2018-11-07T18:19:21 | 145,769,909 | 0 | 1 | null | 2018-10-19T20:16:02 | 2018-08-22T22:33:19 | Python | UTF-8 | Python | false | false | 484 | py | L2_Ej10_A01636160.py | #Autor: Jonathan de Jesús Chávez Tabares A01636160
#Verificar si es número perfecto, si la suma de sus divisores da el mismo número
n = int(input("Ingrese número para verificar si es perfecto: "))
cont = 1 #Índice del divisor
aum = 0; #Suma de los divisores
while cont<n:
if n%cont == 0: #Si es divisor
aum+=... |
78ffdb6296f632d297d623e4fe3bb7621dbd35dc | 1551908caadb38ac47726ccdbf51398cab78bdf1 | /automatic-shutdown-pc/model/state_model.py | 49550acf1ee7531cc8abdf78865b66f2010a6f32 | [] | no_license | hhvitek/python-repository | 7de72f11aade059fc56030bdb096ca12ec77b384 | 716f979e442f4df36bc84e666dc6eb1f8ea2e4b4 | refs/heads/master | 2023-02-12T19:07:59.424464 | 2021-01-09T17:48:33 | 2021-01-09T17:48:33 | 269,344,877 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,513 | py | state_model.py | #!/usr/bin/env python
import logging
from .timedelta_manager import TimedeltaManager
DEFAULT_STR_AFTERDELTA = "00:30"
class StateModel:
"""
Represents the current state (status) of this application.
This is dynamic state, possibly can be stored in database for persistence
"""
def __init__(
... |
eebd9d376f3366ef94699888a72beeccfee9cc04 | 94a98af092d8a934b6c4f4d3be95fae76e588f77 | /inherit_crm/models/models.py | 4aae0f7b0f5d0f7af55e19183df2176a5553ac1c | [] | no_license | suningwz/test4 | 070732f10ba32a22d368a0992150e77bb5013c83 | cc6aaef8469e7b53088d7f6dac2b7a9b01441679 | refs/heads/main | 2023-08-26T11:33:36.746104 | 2021-10-27T07:48:57 | 2021-10-27T07:48:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 739 | py | models.py | # -*- coding: utf-8 -*-
from odoo import models, fields, api
class SaleOrderInherit(models.Model):
_inherit = "sale.contracted.order"
def reset_draft(self):
for rec in self:
rec.state = 'draft'
class CrmLead(models.Model):
_inherit = 'crm.lead'
@api.model
def create(self, ... |
19dcd75de51e9cef11761a8e0607c1280972e978 | 75dadd12c94adf6e5a194ad774541fb542834143 | /apps/authen/social/urls.py | d558ea4eb14312207aa2157e4849af00a70d17b7 | [] | no_license | geoom/tacher-web | 3d6b6bd37eb4650324c7bee320c56fdf93a06fa2 | 46a0e2b28ee37a864d4e863deeedf8d63e04a34c | refs/heads/master | 2020-04-02T13:52:19.429189 | 2014-10-17T11:00:44 | 2014-10-17T11:00:44 | 33,969,021 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 190 | py | urls.py | from django.conf.urls import patterns, url
from .views import signin_by_access_token
urlpatterns = patterns('',
url(r'^signin-by-token/(?P<backend>[^/]+)/$', signin_by_access_token),
)
|
b05c7e327416c04e5caafc816ecb7873f55138cb | b89687872583546780e7dcd3fc792eff5025cae9 | /utils/post_processing.py | 0fa8ead5bafea490920408e4336cbaa48978b9ea | [] | no_license | antoineBarbez/2D_object_detection | c86d0e383d9aa6c06685e4eb49db702f25bec0cd | 615470c5e107075f01fba52db66dee61acf5eeb9 | refs/heads/master | 2020-12-23T07:05:26.497008 | 2020-08-26T14:34:06 | 2020-08-26T14:34:06 | 237,078,389 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,115 | py | post_processing.py | import tensorflow as tf
from utils.boxes import decode, to_relative
def postprocess_output(
image_shape,
regions,
pred_scores,
pred_boxes,
score_threshold,
iou_threshold,
max_output_size_per_class,
max_total_size,
):
"""
Args:
- image_shape: Shape of the image ... |
8867508879894c73b9f15001b3fd0895d2e2424b | cf5e767faabe7307a8e081b35fd9600d003f8665 | /src/config/settings/__init__.py | 4b6440df0c745c17583d45f265b8c5b45cbab4db | [
"BSD-3-Clause"
] | permissive | FuShengRuoXian/django-spms | bfd0ec8cc7ef957c8e6e308e1e9bf4259cf7c551 | 95ac193891f93da07c3a26feeaf846e6030f3466 | refs/heads/master | 2023-05-23T20:09:17.964349 | 2020-03-12T09:58:27 | 2020-03-12T09:58:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 329 | py | __init__.py | import os
if 'DJANGO_ENV' in os.environ:
if os.environ['DJANGO_ENV'] == 'prod':
from .prod import *
elif os.environ['DJANGO_ENV'] == 'dev':
from .dev import *
elif os.environ['DJANGO_ENV'] == 'local':
from .local import *
else:
from .local import *
else:
from .local ... |
cc72c779dae64264e1255ffaa42d7b1eaf7b0b51 | 4a0a73a39e5f1c0b4bbb3b35745c0e0be7a3b3a9 | /src/elcaminoreal/_errors.py | 0ab83b790790c9e4d241a491047d8938900c6a20 | [
"MIT"
] | permissive | elcaminoreal/elcaminoreal | 8a8eb01f524de3c75a1bbb84644592d2e577193f | ec2b447fa90b3af3b98541170ee13fe0f657dba7 | refs/heads/master | 2021-06-06T23:50:01.526339 | 2018-09-02T03:00:10 | 2018-09-02T03:00:10 | 112,864,737 | 0 | 0 | MIT | 2020-03-14T23:52:22 | 2017-12-02T18:05:03 | Python | UTF-8 | Python | false | false | 495 | py | _errors.py | """
Capture argument parsing errors
"""
import contextlib
import caparg
@contextlib.contextmanager
def errors_to(filep):
"""
A context manager for command-line parsing errors.
It will catch caparg parsing errors, and redirect
the output into the given file descriptor.
Suggested usage:
.. c... |
86e2d57920464e420eba9a02bc00ada47e5f0e52 | d9309d7de79543d22687083c5e776967470d7e9e | /Toy Shop.py | 7bb8aa88c3af994339260edd97119d2e7f652c8a | [] | no_license | AlexanderIvanofff/Software-University | 8e5d6dec0bc3c649093b0d7aae91d51a7a5c14c7 | 6435921d7e83f253a2efb7babbcce4621b5d52ab | refs/heads/master | 2023-07-13T09:48:11.943343 | 2021-08-31T14:12:12 | 2021-08-31T14:12:12 | 281,917,684 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 846 | py | Toy Shop.py | price_vacation = float(input())
count_puzzle = int(input())
count_dolls = int(input())
count_beers = int(input())
count_minions = int(input())
count_trucks = int(input())
puzzle = 2.6
dolls = 3
beers = 4.1
minion = 8.2
trucks = 2
price_toys = count_puzzle * puzzle + count_dolls * dolls + count_beers * be... |
91f861580c7500622e40de6db010227348fa0743 | 7e3f6deda126de37398b9a354f1be0ea5a90555e | /Bouquet/bouquet.py | 832547f4bca313a757f66ec9c364d3647f7e8311 | [] | no_license | Kendearoth/mdf2019 | e58d19823f8a21b47cd69086f5c24f6d2a498f32 | 5301ee2ffb207de1ab7798a526fc7c8ee77a093c | refs/heads/master | 2020-07-30T23:03:29.079466 | 2019-10-18T11:02:32 | 2019-10-18T11:02:32 | 210,390,348 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 999 | py | bouquet.py | #*******
#* Read input from STDIN
#* Use: echo or print to output your result to STDOUT, use the /n constant at the end of each result line.
#* Use: sys.stderr.write() to display debugging information to STDERR
#* ***/
import sys
lines = []
for line in sys.stdin:
lines.append(line.rstrip('\n'))
V, R, J, O = lines[... |
9e3dd481e13f29625a5a375ec5f6b1ca14d1a6f2 | 48604efb1f6ad3c4ac66f3ccb3502acd251fabc3 | /test.py | 364cd8cb45c28221bd6ced7c02b10cd468d44ed7 | [] | no_license | SZlonghua/pyqt5-test | ce7429cc383246dd3b5e861f31220c6b02a97228 | 2d99c9517388f8d0a730f5efd939abbb840db66c | refs/heads/master | 2020-09-15T05:00:53.717939 | 2019-11-22T08:58:00 | 2019-11-22T08:58:00 | 223,353,248 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,917 | py | test.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'test.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
import dialog
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
... |
493a3ff63f3824177ab4d053b33c43bea85ac163 | 2e8fe4aa9b4e3d3e91ca6dd61bc8997623e0a17d | /parselib/parselibinstance.py | 813bfb0cc08df571eaafde4cd34ef48c063a9ac4 | [
"MIT"
] | permissive | omarboukhris/parselib | 54cb347d5da2cc0e3cd49b0774d1e70cc60e9951 | dfabe8d20bd67588763e12082e8f4370f872292e | refs/heads/master | 2020-03-17T17:50:26.608437 | 2019-03-29T14:33:02 | 2019-03-29T14:33:02 | 133,803,869 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,226 | py | parselibinstance.py | from parselib.parsers.parsers import CYKParser
from parselib.parsers.grammarparser import GenericGrammarParser, Grammar
from parselib.operations.normoperators import get2nf
from parselib.datastructure.lexlib import Tokenizer, Token
from parselib.utils.onepasspreprocessor import OnePassPreprocessor
from parselib.... |
7f573ce8189fa989f6f4b1467ed63b4288681ea0 | 71f2b1a20caa53b1ec735341a54310978b17c886 | /Networks.py | ea4d071c39efa9531fd580e09d4582850337403a | [] | no_license | meelement/fastspeech-2 | 22bf0d4db2a3334070b2e80808bed112b19db5ed | fc2786d14715f385795b2bb7d44c8707b1c5e0ff | refs/heads/master | 2022-03-04T03:37:26.872253 | 2019-10-29T16:02:36 | 2019-10-29T16:02:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,900 | py | Networks.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
import hparams as hp
class LengthRegulator(nn.Module):
""" Length Regulator """
def __init__(self):
super(LengthRegulator, self).__init__()
self.duration_predictor = DurationPredictor()
... |
7eeac51b8e9da76ae9b238a2fc89d8f9ada67f4a | 0430e95775364963b9c09b97b7d9d7e8d364437d | /prediction.py | 464fa199b736370d945a65e3ebaef24750b053a1 | [] | no_license | michaelfaerber/SemEval2019-Task4 | 9107b82c95f8c3051bfe96874e748fd9b9b44d91 | 1e4f5c962f9973cf97ac605a305ccd463e9b03f2 | refs/heads/master | 2020-04-08T00:53:45.098809 | 2020-01-27T21:55:17 | 2020-01-27T21:55:17 | 158,872,512 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 6,295 | py | prediction.py | #------------------------------------------------------------------------------------
# Name: Prediction
# Purpose: This module is used to predict the hyperpartisan values for a test or
# validation set, and write the predictions to a file.
#
# Execution:
#
# Author: Ashwath Sampath
#
# ... |
3f45bbd2a899839eae4a00b6e87d1de91a848567 | b4f3ac33ee9ead27e61c5a21209bdbd05ea18dc7 | /modules/date.py | cd174e423c9d71d61843cc517b10e4c1c44abce4 | [] | no_license | limittox/date-in-between-calculator | 7a8dcfb17eb4579e5c60f6a23840e24347629423 | 0c87f3003b79730dda3e07fd301efc701d55f19f | refs/heads/master | 2020-03-27T15:07:30.840458 | 2018-08-30T05:27:19 | 2018-08-30T05:27:19 | 146,699,180 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,663 | py | date.py | days_in_months = {
1: 31,
2: 28,
3: 31,
4: 30,
5: 31,
6: 30,
7: 31,
8: 31,
9: 30,
10: 31,
11: 30,
12: 31
}
class date(object):
def __init__(self, date, month, year):
self.date = date
self.month = month
self.year = year
... |
f2a323f391190ee7468c83433cc6d944f8b3d3d3 | dfcb276c7eb30ba15d219379587d1ae3ca901044 | /app/server/models/sensor.py | 9c6ad7c29df76e4c8862db6864f6abb83df6cdd2 | [] | no_license | ngminhhieu/fimi-AI | ae5b194b6594192dce818e111d7ce5278ce967c9 | 89669a14d3cd9b3b5d87eb9fcfc9c7fd88c83938 | refs/heads/main | 2023-06-06T01:29:17.434803 | 2021-06-16T15:11:23 | 2021-06-16T15:11:23 | 372,393,991 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 645 | py | sensor.py | from typing import Optional
from pydantic import BaseModel, Field
class RawCalibration(BaseModel):
raw: float
calibrated: float
class SensorSchema(BaseModel):
device_id: str = None
datetime: str = None
PM2_5: Optional[RawCalibration] = None
PM10: Optional[RawCalibration] = None
PM1_0: Opti... |
00a0668d5fcb8358b4bd7736c48e4867afc0f5b6 | 0c14f0624562b1b6c7c2017f52595e2adac72951 | /cpr/solvers.py | da896e39dad7044be22ad8634047ae6f82db4690 | [
"Apache-2.0"
] | permissive | cvxgrp/cone_prog_refine | 452a579496d0fcf04dba237292818490ec7f426f | 9294a34ea487260a95f1c4e4ca6a3ffd62eaf681 | refs/heads/master | 2020-03-30T20:58:37.027469 | 2020-01-22T13:17:41 | 2020-01-22T13:17:41 | 151,612,070 | 11 | 5 | null | null | null | null | UTF-8 | Python | false | false | 6,999 | py | solvers.py | """
Copyright 2019 Enzo Busseti, Walaa Moursi, and Stephen Boyd
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 ... |
f5c277da2b22debe26327464ae736892360059b4 | b294201cbb7522d4c4653d607e30d6779cd69fe2 | /code/4-2.py | ce2fb555752fc6608584093c205c84bbad18464b | [
"MIT"
] | permissive | Siemingfong/FilmFeatureCrawler | 0bc688f09b7629435cfc733e5be9c8bc37b74e2d | 98ab581ca8d9df70452ff28a8d061dc658461459 | refs/heads/main | 2023-03-23T23:35:28.091510 | 2021-03-18T08:05:56 | 2021-03-18T08:05:56 | 348,987,980 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 600 | py | 4-2.py | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
month=['Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr','May']
df = pd.DataFrame([[53, 0, 5, 3, 3],[51, 0, 1, 3, 2],[70, 4, 7, 5, 1],[66, 4, 1, 4, 2],[64, 4, 4, 3, 2],[69, 4, 7, 8, 2],[45, 2, 8, 4, 2],[29, 1, 6, 6, 1],[56, 4, 4,... |
5c2a6802e89314c25f0264bbe2bc7ed2689a255a | 95466e501a176f90e418e86fdcb265dac049b09c | /Q9.py | b384b0fb3d55e420c043392aafecb6e856f20ecc | [] | no_license | sudheermanday/program_assessment | b01493e7b81dcc9a424ff4870d0bf77230d6ab9e | 2c9db3ebea459f74ac557957d7aeaa8625592cc6 | refs/heads/main | 2023-04-17T11:56:45.706937 | 2021-04-28T16:58:30 | 2021-04-28T16:58:30 | 362,544,276 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 251 | py | Q9.py | a=input("Please enter the elements with spaces between them:").split()
n=len(a)
for i in range(n):
a[i]=int(a[i])
for i in range(n-1):
for j in range(n-i-1):
if a[j]>a[j+1]:
a[j],a[j+1]=a[j+1],a[j]
print("Sortes array :",a) |
20f0480ee7e0782b23ec8ade150cdd8d8ad718bb | 20838e2f389e82540244d397969cbb1bfc4249ab | /Euler.py | da6e8a34312df78f55c78ed46c87689341a2bea0 | [] | no_license | J3FALL/HPC-Continuous-Models | c4159782fa5409c11f7cc5756db664986963e1d5 | 8c32ce1af7c22b094cbfb12ae8b8bc1006d74c38 | refs/heads/master | 2021-07-03T13:37:08.932554 | 2017-09-24T20:33:53 | 2017-09-24T20:33:53 | 104,360,522 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 973 | py | Euler.py | from math import pow
from math import tan
import plotly.figure_factory as ff
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
def euler():
h = 0.1
x = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5]
y_eval = [0.0]
delta_y = [0.0]
y_real = [0.0]
eps = [0.0]
for i in range(1, le... |
f145274c8caa1e725d12003874eb54a580a6e35e | e1b4122588e4c9cedfc143eb3c13f3f3d3a900eb | /lesson1/dic.py | e5bba91e4c4a78925384584881d14c50cf604f5b | [] | no_license | kreinhub/Learn-Python-14 | 42bc5e93d4817401573f0f31e374e0a808e9ccc5 | 75ac6ab81b1af9563977228ed9b599845c9c55bd | refs/heads/master | 2022-12-13T01:37:29.509274 | 2019-10-17T10:18:15 | 2019-10-17T10:18:15 | 207,766,593 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 184 | py | dic.py | dic = {"city": "Moscow", "temperature": 20}
# print(dic["city"])
# dic["temperature"] -= 5
# print(dic)
print(dic.get("country", "Russia"))
dic["date"] = "27.05.2019"
print(dic) |
038b8206f77b325bf43fc753f6cee8b4278f4bc9 | cd1ec0f32cb94bc23594a707b8666c60bc85ae0c | /pycqed/measurement/randomized_benchmarking/randomized_benchmarking.py | 95117d7e08578dc9c74376a5b5b04090ce9a45e9 | [
"MIT"
] | permissive | DiCarloLab-Delft/PycQED_py3 | 735a902eb7a364fd170760028f8221507c5c6864 | 4fc56396ad603bbe61e6d548f66b818d51a3301b | refs/heads/develop | 2023-08-11T15:08:28.453885 | 2023-07-20T09:12:15 | 2023-07-20T09:12:15 | 49,057,179 | 72 | 41 | MIT | 2023-08-10T13:18:51 | 2016-01-05T09:52:14 | Python | UTF-8 | Python | false | false | 8,937 | py | randomized_benchmarking.py | import logging
import numpy as np
from deprecated import deprecated
from pycqed.measurement.randomized_benchmarking.clifford_group import clifford_lookuptable
from pycqed.measurement.randomized_benchmarking.clifford_decompositions import gate_decomposition
from pycqed.measurement.randomized_benchmarking.two_qubit_clif... |
3421c3b839721694945bdbb4f17183bceaed5296 | ab4f1963364d7ff9669e6f9891b858e6df8388ab | /Lists to Dictionary/DictUnitTest.py | 1c1972e024cae153a0ffca8c1f00921729ae2c31 | [] | no_license | paawan57/InterviewCodeSubmission | bda08b84632291cea5d53cd9ca929e7fc19cb1ca | 3a8eee89d59d0c196c945fe874779f2b614dcb51 | refs/heads/master | 2023-03-19T01:37:31.157438 | 2021-03-15T10:17:01 | 2021-03-15T10:17:01 | 347,775,690 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 891 | py | DictUnitTest.py | import unittest
import ConvertListToDict as cldf
class MyDictTestCase(unittest.TestCase):
def test_Dict(self):
# Testcase1 (len(keys) == len(values))
actualDict1 = cldf.ConvertListsToDict([1, 2, 3],['a','b','c'])
expectedDict1 = {1: 'a', 2: 'b', 3: 'c'}
self.assertEqual(actualDict1,... |
1ea61ab4003de80ffe9fb3e284b6686d4bf20b15 | 96cc83063e0adbd0cc3a1f31a41e58d8c7194996 | /restaurant/migrations/0001_initial.py | 882708e851305caab3e726eef2195bbcfdf86a3d | [] | no_license | azaderdogan/celebi_rest_api | 6f0f66a01afeb96cf1c6b8d1909d5aac6e2c5f45 | 6946b1516e7c341ab8f22022a4c2b42cca913ef2 | refs/heads/master | 2023-07-25T16:03:27.887323 | 2021-09-09T10:28:48 | 2021-09-09T10:28:48 | 369,542,213 | 1 | 1 | null | 2021-05-21T13:20:32 | 2021-05-21T13:20:31 | null | UTF-8 | Python | false | false | 1,367 | py | 0001_initial.py | # Generated by Django 3.2.3 on 2021-08-26 09:18
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Restaura... |
6db7189d26c63ca9f9667045b780ec11994bac28 | 37fbaeabe9c8679af0dd289836973fc0e64213c1 | /apps/pagerank/pagerank.py | b3e0898deae6ad25f00d6f0a2d056fed65baa370 | [] | no_license | Zichen-Wang/pypregel | c7623f141b8ba02399233c449b2becb8e0e6f97d | d2443a73e3314fce6763f41f98b3fc02d86169c6 | refs/heads/master | 2023-01-12T04:08:12.752550 | 2020-07-06T01:38:39 | 2020-07-06T01:38:39 | 257,714,855 | 0 | 0 | null | 2022-12-27T15:38:34 | 2020-04-21T21:01:21 | Python | UTF-8 | Python | false | false | 1,991 | py | pagerank.py | import sys
from pypregel import Pypregel
from pypregel.vertex import Vertex, Edge
from pypregel.reader import Reader
from pypregel.writer import Writer
from pypregel.combiner import Combiner
class PageRankVertex(Vertex):
def compute(self):
if self.superstep() >= 1:
s = 0
while sel... |
78dc2193c05ddb4cd4c80b1c0322890eca7fcf19 | 7a6c3de4089c9aa433b1761460b9f1e84081b0fb | /ready_notify.py | d0ae8a030789e53bc78bb76f7b8f845619f33621 | [
"MIT"
] | permissive | adwait-thattey/systemd-service-generator | 0c7fd2bd8764fafdf16374e0554e897a3257a051 | 25ce4f9d6ec656797bb5fd18264e8acb14c0a4a6 | refs/heads/master | 2022-02-17T23:05:15.993875 | 2019-07-22T06:18:38 | 2019-07-22T06:18:38 | 198,150,340 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 147 | py | ready_notify.py | import signal
import time
import sdnotify
n = sdnotify.SystemdNotifier()
if __name__ == '__main__':
n.notify("READY=1")
time.sleep(2)
|
3935d16f504c99976b7b26dfe56d84248022ef79 | 1de6d55bf8c4d9333c9b21f9f8ee154c2aef3c7f | /user_auth/serializers/serializers.py | 8fb6c25fecae93a8699a27ac511ab90e387ea5ac | [] | no_license | FloCare/hha-backendtest | ad675c5da2fa23ec5d8ea58223bef28c4142483a | 0918b932dcc5c44fae9799c05c17519abc54f7a7 | refs/heads/master | 2022-12-10T02:20:56.200101 | 2019-05-06T11:14:09 | 2019-05-06T11:14:09 | 184,367,994 | 0 | 0 | null | 2022-12-08T02:31:35 | 2019-05-01T04:19:43 | Python | UTF-8 | Python | false | false | 1,307 | py | serializers.py | from rest_framework import serializers
from user_auth import models
# Used in PHI module. Remove when refactoring them
class AddressSerializer(serializers.ModelSerializer):
addressID = serializers.UUIDField(source='uuid', required=False)
zipCode = serializers.CharField(source='zip', required=False)
street... |
826ac74310c9919f88c1ada1c18469d169756b3e | 945c82410fda38f9665ab23e6109c8fefcdff9c7 | /she_codes_python/session4.py | 11297920c6ced548b2cce70b1f898d0ab896c9bf | [] | no_license | JuLacerdaRod/shecodespython | e65f56f72abfaf97f3c0626c040c79bd85c9f2ca | dfac7aa06233f90179f7924e0ced89b358b08c6c | refs/heads/main | 2023-06-24T07:29:57.645242 | 2021-07-31T00:20:51 | 2021-07-31T00:20:51 | 391,216,063 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 140 | py | session4.py | import csv
asli_said= []
with open("dogs_are_awesome.txt") as csv_file:
csv_reader = csv.reader(csv_file) #creates the reader object
|
398b28073f77b65eda6effbc93bf7460eef0c402 | 41c556026467a6928df11f9c2dbbae8396b6d0cf | /analysis/report.py | 03a410bb3af4e63fe4e9ec0be071fdb00d5b31c7 | [
"MIT"
] | permissive | emmazmi/research-template | 92163732f6e7f43d891d715d4b9544427021dc98 | ec175fb580075de5e7673ba1114ec11d86b72dec | refs/heads/master | 2023-09-05T02:39:31.235290 | 2021-11-14T22:08:55 | 2021-11-14T22:08:55 | 362,392,201 | 0 | 0 | MIT | 2021-04-28T08:21:51 | 2021-04-28T08:21:50 | null | UTF-8 | Python | false | false | 358 | py | report.py | import pandas as pd
data = pd.read_csv("output/input.csv")
data['covid_date'] = pd.to_datetime(data['covid_date'])
data['long_covid_date'] = pd.to_datetime(data['long_covid_date'])
data['time'] = data['long_covid_date'] - data['covid_date']
data.to_csv("output/times.csv")
#fig = data.time.plot.hist().get_figure()
... |
3cbc7440a35acbe0a80bba8d74655f3005f23752 | 943fc0eac7e872a4f77190d059607fecfd687ea1 | /lolopicker/scripts/LoLoPicker_somatic.py | 46ec26ec42346cb7d2ad43ab115c08092fa4dfe4 | [] | no_license | jcarrotzhang/LoLoPicker | 76d791219b2631e5a54eb502393527d002dd2c91 | de725bd66d1929d0fb805229b3faa96b57162c88 | refs/heads/master | 2020-12-11T22:55:08.224393 | 2018-01-04T20:59:28 | 2018-01-04T20:59:28 | 45,362,198 | 16 | 2 | null | null | null | null | UTF-8 | Python | false | false | 23,155 | py | LoLoPicker_somatic.py | #!/usr/bin/python -u
from __future__ import division
import sys, getopt
import re
import pysam
import pysamstats
def main(argv):
base_quality = 20
mapping_quality = 20
tumor_alt_cutoff = 1
tumor_alf_cutoff = 0
normal_alt_cutoff = 3
normal_alf_cutoff = 0
phasing_mode = "N"
if len(sys.argv) < 5:
print 'usage:... |
eecb7edb74c1e628d609569c152b10bd62d72cc8 | 0f47739089426e24779009a5ac506513671d52b8 | /test/python/utils.py | 42c3332a965a10b5d054b1db44fa38989a9f293a | [
"Apache-2.0"
] | permissive | neuml/paperai | bd6c5c172a6099a47f84dcea787c8a7bbc4b3390 | e9a33203ef139402523860fe5e7e8ded7521ef16 | refs/heads/master | 2023-04-06T14:38:17.723837 | 2023-03-29T19:54:03 | 2023-03-29T19:54:03 | 281,475,256 | 1,025 | 89 | Apache-2.0 | 2021-09-10T18:14:50 | 2020-07-21T18:33:30 | Python | UTF-8 | Python | false | false | 591 | py | utils.py | """
Utils module
"""
import hashlib
class Utils:
"""
Utility constants and methods
"""
PATH = "/tmp/paperai"
DBFILE = PATH + "/articles.sqlite"
VECTORFILE = PATH + "/vectors.magnitude"
@staticmethod
def hashfile(path):
"""
Builds a MD5 hash for file at path.
... |
d915b99b0dd97bec0c1b516ba645123c6f99ea67 | 9714864228bedbc6d3e5f819e7b07908ad2bb95e | /www/code.py | 227a63dd38f8f910dbdeea359183c7c0258278de | [] | no_license | xuetongiqn/commentAntiSpam | ca5c1e1607905a9208faa13844b7d728fee82a94 | 6abe0de2aa31b5a5c67b88f835c08b725ddcfab3 | refs/heads/master | 2016-09-05T22:51:44.145358 | 2014-11-13T03:06:42 | 2014-11-13T03:06:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 522 | py | code.py | #coding=utf-8
import web
import checkspam,train,sys
reload(sys)
sys.setdefaultencoding('utf8')
urls = (
'/checkspam', checkspam.app_checkspam,
'/train', train.app_train,
'/','index',
)
class index:
def __init__(self,):
self.logger = web.ctx.environ['wsgilog.logger'] # 使用日志 #
def GET(se... |
11681a62511da751cd7851c6c689caa874ad38bc | 8c529216ed5b505820936ae2dc6f5d1d12211f9a | /web-service/app.py | eea16210eb76247d43353e88af29fc2cdc66b7a8 | [] | no_license | chirumer/snakes-and-ladders | 8a2947be582ea14949e98fac60ce66f2f6ba08f6 | cd9f12e04fb9b84e1d2391379f5b61d160f4c7ba | refs/heads/master | 2023-08-15T05:46:09.746324 | 2021-10-08T15:14:48 | 2021-10-08T15:14:48 | 414,813,353 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,538 | py | app.py | # app.py
from flask import Flask, request, jsonify, send_file
from flask import request
from PIL import Image, ImageDraw
from io import BytesIO
import urllib.parse
import json
app = Flask(__name__)
def sample_image(size):
#size = 5
cell_size = 50
divider_size = 5
img_width = img_height = (size * cel... |
6c3d754ea42eae82f444fe25ea9778f50249a7f8 | 37276c1e110bc01541fe866e062a12129b34e008 | /rectangle.py | d89eebdfad6b452e7accf9f0f301536d752753f1 | [] | no_license | Alex23013/DCPD-CloudComputing | 7c2b9492c1d9751f907ce592d0d72a1c893649b9 | 4300f7b2dbe99c820b58a4cae0ee92d132b40460 | refs/heads/master | 2020-09-16T12:42:09.396363 | 2019-11-25T04:20:50 | 2019-11-25T04:20:50 | 223,773,194 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 521 | py | rectangle.py | class Rectangle:
def __init__(self, start, end):
self.start = start
self.end = end
self.tiles = 0
self.homogeneus = False
self.dir = -1
def print_rdims(self):
print " s:",
self.start.printCell2d()
print " e:",
self.end.printCell2d()
def set_features(self, tiles, homogeneu... |
92efd0380f91397cba4f365ab3e352657d26cd38 | 1fe109d9862137e92fd04a842708db77d388ffbf | /sped/fci/registros.py | 5df534c5bff58f6daf2c9833c6a5978e1e772676 | [
"MIT"
] | permissive | sped-br/python-sped | e3a506a77f6b6e3b34785f2f9a226b71236e4dff | 665db2176a561b882e8d64a7972db3fdb826be7f | refs/heads/master | 2023-08-17T19:09:32.701544 | 2023-08-15T06:06:56 | 2023-08-15T06:06:56 | 30,607,630 | 50 | 48 | MIT | 2020-05-21T14:35:43 | 2015-02-10T18:34:25 | Python | UTF-8 | Python | false | false | 6,553 | py | registros.py | # -*- coding: utf-8 -*-
from ..campos import CampoFixo, CampoAlfanumerico, CampoNumerico
from ..registros import Registro
from ..erros import CampoError
class Registro0000(Registro):
campos = [
CampoFixo(1, 'REG', '0000'),
CampoAlfanumerico(2, 'CNPJ_CONTRIBUINTE'),
CampoAlfanumerico(3, 'N... |
4754d4164053d5d5a6c32c40e20f99a8e5d3ebef | a2cfbe465719af1a950273b28f7b337b0ed3c3ca | /resultsGraph.py | 8d9c2984c950f7c19bd42bba5479e2a19a080056 | [] | no_license | kevinbyrneire/FYP | 71e86e902908c8d5670a18d0ed73c55f1ee7d90e | d25407f0842957bf7d817a73d1b9f90f16ec4c04 | refs/heads/master | 2021-01-10T20:13:34.960485 | 2015-02-18T09:24:20 | 2015-02-18T09:24:20 | 28,392,605 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 466 | py | resultsGraph.py | from varyGraph import getCompSizes
import numpy as np
import matplotlib.pyplot as plt
import sys, time
from getStats import *
def main():
t=time.time()
l = getCompSizes(sys.argv[1],int(sys.argv[2]))
t=time.time()-t
plt.plot(l,'green')#,marker=u'.')
plt.plot(len(l)*[mean(l)],label='mean')
plt.plot(len(l)*... |