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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
afde856e904a23b87fb492703e0aa2efe25c4a86 | d3a4460f0a8de5500ab29be65fd33a41b9a34263 | /Python/Medium/Skynet_Revolution_1.py | 4ca12c4747315db093fe23474337afc9a7df88d4 | [] | no_license | Araggar/CodinGame | 9b3963eee059cfb661fe25e8b59841002625940f | 9b7a5ca7faa97f23335baeda31838ec5e4abcae5 | refs/heads/master | 2021-03-22T00:28:57.794925 | 2017-01-31T20:18:53 | 2017-01-31T20:18:53 | 76,899,528 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,397 | py | Skynet_Revolution_1.py | import sys
import math
# n: the total number of nodes in the level, including the gateways
# l: the number of links
# e: the number of exit gateways
n, l, e = [int(i) for i in raw_input().split()]
lines = []
gates = []
used = []
for i in xrange(l):
# n1: N1 and N2 defines a link between these nodes
... |
830d4814d47418d33507b26fb95c640597a5da31 | d2c3c1199483304e6ef04e912d86dd5355a2123b | /degerelerve_degiskenler02[1].py | 68c0e0255719070d2782349e6d59d43f7a98c8ef | [] | no_license | rpehlivan08/python-calismalari | 098a1f994d690423e425b90b6b07e635feec981a | 556459c96165594c67d12363249048f0dc2fe6ae | refs/heads/master | 2020-04-12T18:17:12.911854 | 2019-01-04T11:23:42 | 2019-01-04T11:23:42 | 162,675,063 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 111 | py | degerelerve_degiskenler02[1].py | x = 10
print("x'in degeri....:\n " + str(x))
y = 20
print("y = " + str(y))
z = 30
print("z = " + str(z))
|
c21329b4bd51f8ac88c5f08050cc35454ecfb55d | 0ea9d7053b05dd2bc0e5e0863d4e94c299b44bbc | /Gui/currentUserPassChange.py | ca11320141d64884e2af274a440227d4ba599683 | [] | no_license | ChrisSW921/EmployeeDatabase | da9fd8425989eecedad2752fee722ba185dbf677 | 6d407ae83aeba314c4f7557f22f1f231924b779d | refs/heads/master | 2023-02-07T11:40:24.034256 | 2020-12-15T16:05:46 | 2020-12-15T16:05:46 | 292,326,795 | 0 | 0 | null | 2020-12-15T16:05:47 | 2020-09-02T15:49:45 | Python | UTF-8 | Python | false | false | 1,986 | py | currentUserPassChange.py | import sys
import os
sys.path.insert(0,os.getcwd())
from tkinter import *
from tkinter import ttk
from Gui.errorMessage import errorWindow
from Database import database
from Backend.employee import Employee
class changeUserPassword:
def __init__(self, user : Employee):
self.window = Tk()
self.win... |
2437b39085a275698443abb07a0dc216d76f27aa | b2b91305f4b977a1b28597d0797d02899c7b817d | /snaps/openstack/utils/tests/nova_utils_tests.py | 7c343f81181fc1da0d0c0a90ff766f64e419e307 | [
"Apache-2.0"
] | permissive | opnfv/snaps | e0091bc8bfe777c0bbaa279873a83fe73964e6e1 | 567cdf25e1319fbc8a1a874dd18d21f88948e67e | refs/heads/master | 2021-06-30T19:09:35.602782 | 2019-01-25T18:21:50 | 2019-01-25T18:21:50 | 105,573,873 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 22,265 | py | nova_utils_tests.py | # Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
# and others. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://w... |
c6ad53c56870e311fc7162cc3a921d904f5c2031 | ce4a5f400df7d73e70f4bd670709f21fe7a9c29d | /init.py | 4d3ae3c0441bc1d413f28acefce52935562fab54 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | seuxw/spider_paocao | 8522cdbb6e4ae2c00447f78aa86e7080c9de39d4 | 69bc8f1a6216bc583ab818ff205c5aba43b66853 | refs/heads/master | 2020-03-08T10:14:18.936822 | 2018-11-22T07:53:37 | 2018-11-22T07:53:37 | 127,425,566 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,089 | py | init.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# 初始化运行环境及配置
import configparser
from database.create_database import init_database
def create_spider_cfg(card_no, card_passwd):
"""创建爬虫配置文件.
创建爬虫调用的一卡通信息配置.
Args:
card_no: 待调用一卡通号
card_passwd: 待调用一卡通密码
"""
CONFIG_FILE = "spider.cfg"
... |
9390e095eb0dc884c697503ba50e5ccdca1e8a13 | 48ca89245a05251425e8cc25334bf31138a55ef0 | /commitment.py | 1c5ad3815a733d4a387d76a62e9b3a755dd9978b | [] | no_license | dfex/junos-ops | cb95ab28b84b8b915dcb2bbff75c0cdb22a88320 | 164d78206b495b12fdcf1f6249b975da2f3a9ae9 | refs/heads/master | 2021-03-12T23:07:42.116042 | 2015-06-29T05:12:44 | 2015-06-29T05:12:44 | 38,228,954 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,334 | py | commitment.py | #!/usr/bin/python
# commitment.py
# June 2015 - ben.dale@gmail.com
# Take a list of IP addresses of Junos devices and force a commit on each of them
# Used to trigger a configuration backup via system archival
import sys
import shlex
from jnpr.junos import Device
from jnpr.junos.utils.config import Config
from getpas... |
3fa5f92bcfdbfb0a5665c0e74a7e5e5a6ece9c15 | bbc62096f987330bbc86360a2abc960fe527acae | /kra/migrations/0022_delete_psrecord.py | 2ab11de0851dad84ee66677648be8ecfab904fac | [
"MIT"
] | permissive | smpio/kube-resource-analyzer | 77a5cef218ce64ab469a1bc77f5501d84f991aa3 | a96070931c8a03b1584ca7617a3f26fc8236b6e5 | refs/heads/master | 2022-08-04T16:25:18.517869 | 2022-07-30T22:07:49 | 2022-07-30T22:07:49 | 229,058,900 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 292 | py | 0022_delete_psrecord.py | # Generated by Django 3.2.2 on 2021-06-11 22:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('kra', '0021_adjustment_update'),
]
operations = [
migrations.DeleteModel(
name='PSRecord',
),
]
|
e0b6464cf93eb7881c6d1f50656e71b8bd6985a1 | 85a9ffeccb64f6159adbd164ff98edf4ac315e33 | /pysnmp/SS7VIEW-MIB.py | 5e620c159ea1cdb62e5450a52fec3f154c9b288c | [
"Apache-2.0"
] | permissive | agustinhenze/mibs.snmplabs.com | 5d7d5d4da84424c5f5a1ed2752f5043ae00019fb | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | refs/heads/master | 2020-12-26T12:41:41.132395 | 2019-08-16T15:51:41 | 2019-08-16T15:53:57 | 237,512,469 | 0 | 0 | Apache-2.0 | 2020-01-31T20:41:36 | 2020-01-31T20:41:35 | null | UTF-8 | Python | false | false | 13,567 | py | SS7VIEW-MIB.py | #
# PySNMP MIB module SS7VIEW-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SS7VIEW-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:02:49 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 0... |
80d39181da243a26260eb27eec3c12000545be0e | 64c7e268be96245f72467d218bdc9b7eac54af2e | /library.py | f8c045dbf8fd39d833a3c3630fa11d009b44c0ef | [] | no_license | emmanuelrutto06/lib-system | ec12212aaaa1eda2ff71782b864cf9343438bc3e | d0bbfe46dbc37d4cc84fc7ee1e7c463fab137d6a | refs/heads/master | 2021-05-18T15:26:25.688276 | 2020-04-06T10:08:31 | 2020-04-06T10:08:31 | 251,296,899 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,972 | py | library.py | from tkinter import*
from tkinter import ttk
import random
from datetime import datetime
import tkinter.messagebox
class Library:
def __init__(self,root):
self.root = root
self.root.title("Rutto's Library Mangaement System")
self.root.geometry("1350x750+0+0")
self.root.configure(... |
582c3b665745389d942f18c065e44edf6e34f18f | e97bee9ff8354ed737405b6f8a9eedb98f8bb763 | /Functions/Functions-More-Exercise/04_tribonacci_sequence.py | 2555a3af9be103889cbcde7f7f1c828f03b99b05 | [] | no_license | momchilantonov/SoftUni-Python-Fundamentals-September-2020 | 4e12e4c9c60cf7092d6c1da7b8dcf9aabee87ae5 | 14af019471e1b4dc3ea93835c5757b58d07cf434 | refs/heads/main | 2023-02-25T10:11:50.250509 | 2021-01-28T22:43:42 | 2021-01-28T22:43:42 | 324,743,709 | 5 | 2 | null | null | null | null | UTF-8 | Python | false | false | 563 | py | 04_tribonacci_sequence.py | # Solution with loop
num = int(input())
def tribonacci(signature, n):
res = signature[:n]
for i in range(n-3):
res.append(sum(res[-3:]))
res = [str(el) for el in res]
return res
print(f"{' '.join(tribonacci([1, 1, 2], num))}")
# Solution with recursion
# def trib_rec(n):
# if n == 0 o... |
3f7c40837ac32cd29d24ae3abcfc6bb5f69a8609 | 44f6c119d2c861dc7622cb2f312073c24d7a16f8 | /drftests/migrations/0004_auto_20160304_2043.py | 705b894b7f39db1845b614b36bdb04966c676582 | [] | no_license | nvwlspls/eagle | 00b5b798ddd01714172799956b35761590990a0b | 2afa2c37cdde34317ef90ff1e74c1e1472c76157 | refs/heads/master | 2021-01-10T05:48:29.509189 | 2016-03-04T23:51:21 | 2016-03-04T23:51:21 | 53,172,925 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 732 | py | 0004_auto_20160304_2043.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-03-04 20:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('drftests', '0003_show_venue'),
]
operations = [
migrations.AlterModelOptions... |
b655c83739038aa9b2477c942383a0b877370bda | abb259d88bc7802cd3b90320d66eb2edb3239de7 | /hmsclient/hmsclient.py | 2116df72b37732050a20e942cf449830baf74ce8 | [
"BSD-3-Clause",
"Apache-2.0",
"BSD-2-Clause",
"GPL-1.0-or-later",
"Python-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | zhangzhikuan/hmsclient | 30025fca4626cbbbac2abb99aaffa413388cf44b | 7090fa0a6c612b61abb5e210b16f8163e14a1587 | refs/heads/master | 2020-03-19T05:18:55.821550 | 2018-06-26T08:30:05 | 2018-06-26T08:30:05 | 135,919,901 | 0 | 0 | Apache-2.0 | 2018-06-03T16:13:15 | 2018-06-03T16:13:15 | null | UTF-8 | Python | false | false | 5,925 | py | hmsclient.py | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
00ba2d8b544dc39e8e90cfd2710e68df2d266e9f | e6654e1b15e720f85746b0fb364e369784050446 | /lib/train/optimizers.py | 0005750771f8af83427f9cc54570ae677318c72d | [
"Apache-2.0"
] | permissive | f121606/OrigNet | d10993fdf5a95ff9bcaa0ed9eebab56dfbe04539 | 3684b1c53fc401b4d6b6c129d46ddb76a29294df | refs/heads/main | 2023-08-22T13:22:47.692979 | 2021-09-24T04:11:58 | 2021-09-24T04:11:58 | 409,793,448 | 0 | 0 | Apache-2.0 | 2021-09-24T01:24:05 | 2021-09-24T01:24:03 | null | UTF-8 | Python | false | false | 1,006 | py | optimizers.py | import torch
from lib.utils.optimizer.radam import RAdam
_optimizer_factory = {"adam": torch.optim.Adam, "radam": RAdam, "sgd": torch.optim.SGD}
def make_optimizer(cfg, network):
if (
"train" not in cfg
and "lr" not in cfg.train
and "weight_decay" not in cfg.train
and "optim" not ... |
4f7dffa9bde24db12c40ce55fa21f15697aad239 | 869dc1327f4dc9a71625ba15ad219473b8980b39 | /predict.py | fa7ed2202d51c285b4eb2651c14be54b11de4619 | [] | no_license | Atlains/Hand-Keypoint-Recognition | 1708bd0c8dee2fee6c6b5a1772a767e24088b82a | 740638c61b4ede0f19c4e844aa5eaecfcc8cd951 | refs/heads/master | 2023-07-12T11:23:20.617156 | 2021-05-04T11:26:09 | 2021-05-04T11:26:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,192 | py | predict.py | import numpy as np
import paddle
import cv2
import config
from dataset import TestDataset
from resnet import ResNet
def predict():
testdataset = TestDataset('test')
net = ResNet(class_dim=config.CLASS_NUMBER)
model = paddle.Model(net)
model.load('output/resnetv11')
model.prepare()
outs = model... |
6da25f5da3552bbb1b5015cafb2a094dbf8b6ec7 | 0e54436033fca19c212b13f343f0957aef6f20a9 | /backend/utils/aliyunoss.py | 484c175289530496e67df8ad636a1dbde1a4715b | [
"MIT"
] | permissive | StageStone/funTools | 6afa26b7509d49144d2625a2908471ffb776a140 | 63bb1dd95942dba192956fb529158343b2794bc9 | refs/heads/master | 2023-02-12T06:36:30.781960 | 2020-08-02T07:07:23 | 2020-08-02T07:07:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,349 | py | aliyunoss.py | import oss2
def upload_file(fileName, content):
# 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
auth = oss2.Auth('', '')
# Endpoint以杭州为例,其它Region请按实际情况填写。
bucket = oss2.Bucket(auth, 'http://oss-accelerate.aliyuncs.com', 'wngj')
# 上传文件
... |
12e1ae6d4ba9a75a1706efa66592a3738dc2526b | 96dab35c1b10ba25337c0672b61a4806f94b5e18 | /GetInputData.py | dd20b2fa2ee2826bbf906122ae4dfb75cbf6a708 | [] | no_license | feiyue33/EC601-MiniProject2 | 97e890a4c3109a424318779f3554231fa99cab2f | e4433d3b3632a011fc613574c3e2df2ec5025e34 | refs/heads/master | 2020-04-01T05:36:20.904594 | 2018-10-22T03:47:58 | 2018-10-22T03:47:58 | 152,911,424 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,130 | py | GetInputData.py | import os
import math
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
train_dir = './training_dataset/out'
husky = []
label_husky = []
kiwawa = []
label_kiwawa = []
def get_files(file_dir, ratio):
for file in os.listdir(train_dir):
if file.endswith('0.jpg'):
husk... |
2fe7d5bd3f0214bb96dc72cf331e665cd6b72573 | 04ff255ec232ed0acb4ab80c49dd637964167c34 | /kri/apps/autofill/autofill.py | 99c48f6d8b2c461e16abe4082516ac6c11af632b | [] | no_license | ilhamadun/kri | 97d4538a432c290053ad2e250df2094b4cfcd202 | d52980ffab75f3d87af381f5713de6d1a4ca5cd8 | refs/heads/master | 2021-06-19T01:24:44.061111 | 2017-05-12T00:25:30 | 2017-05-12T00:25:30 | 83,636,432 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,363 | py | autofill.py | import os
from PIL import Image, ImageDraw, ImageFont
class AutoFill:
WIDTH, HEIGHT = (1000, 1000)
def __init__(self, base_image):
self.img = Image.open(base_image)
self.font = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', 24)
self.draw = ImageDraw.Draw(self.im... |
9c7932c4781f725b849f5a4e7a9eb97f3d8e44d2 | d99a66ec15531006e60f2364f9371f4164d26cc8 | /rnn.py | e5227d316829221e6e89ba78e400c53c5a47d6dd | [] | no_license | jdbrandon/15780proj | b2682c4e00c0865837dcdea9e907cabe88097630 | 7cbce90ed6e0e960036c5db272ee672b37370eae | refs/heads/master | 2021-01-21T13:57:06.242938 | 2016-04-19T01:16:41 | 2016-04-19T01:16:41 | 55,864,322 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,099 | py | rnn.py | import numpy as np
import itertools,sys
START_TOKEN = "START_TOKEN"
END_TOKEN = "END_TOKEN"
UNKNOWN_TOKEN = "UNKNOWN_TOKEN"
def error(y_hat,y):
return float(np.sum(np.argmax(y_hat,axis=1) !=
np.argmax(y,axis=1)))/y.shape[0]
softmax_loss = lambda yp,y : (np.log(np.sum(np.exp(yp))) - yp.do... |
969d1da79e77137b76b107a727984b26868727e4 | c01605913d1193f5de51ad96b3e2b7db70cea49a | /src/web/teams/views.py | 1835b27880a1b1e64038095ec39cbe5bab686e35 | [
"MIT"
] | permissive | andgein/drapo | 0d2b26d38dd68e1444c1481fa6582321d16064f4 | ebbc0d5bbd4605391464dbf67be38c3a84657e7a | refs/heads/master | 2020-04-05T22:44:39.923731 | 2017-10-25T04:24:58 | 2017-10-25T04:24:58 | 62,514,434 | 10 | 4 | MIT | 2018-12-03T07:17:10 | 2016-07-03T20:42:49 | Python | UTF-8 | Python | false | false | 7,767 | py | views.py | from django.contrib import messages
from django.core import urlresolvers
from django.db import transaction
from django.http.response import HttpResponseNotFound
from django.shortcuts import render, get_object_or_404, redirect
from django.views.decorators.http import require_POST
from django.conf import settings
from u... |
c00f73793e3e153789831455e93d280bd9184530 | 6f537283820856ef76ebfe267df3b984018eb6c3 | /test/untitled2.py | b53f6b98d0378f4d5a60f8c2b2fb3bf18d8cec6f | [] | no_license | SheikhRabiul/mining_bad_credit_card_accounts | ca586d642464a06f01801d10ec2e850b08199f6c | 7c8700ce26e62f05e77682491eb9ef28cae6d179 | refs/heads/master | 2021-01-19T14:46:53.769947 | 2018-02-20T18:00:39 | 2018-02-20T18:00:39 | 100,923,930 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,242 | py | untitled2.py | <<<<<<< HEAD
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 16 20:55:27 2017
@author: SheikhRabiul
"""
from flask import Flask, render_template, Response,make_response
import random
import json
import pandas
import numpy as np
df = pandas.DataFrame({
"x" : [11,28,388,400,420],
"y" : np.rand... |
4ebf8230a608d938a57aa07aaff49fbc84089aa9 | bbbf4eef8f18c8a03e7d3cd4d140d057ed2b9dee | /script.py | f848dfa4c5ec23f3f41fcca75957cf0fef0a86c5 | [] | no_license | tramvn1996/hardware-data | 8ab8081304d3a9cbec66279750a8f1a0d645f277 | 1f96918c627a4e7d3158d60febe5b36232b2cd0f | refs/heads/master | 2020-03-26T22:30:48.323408 | 2018-08-20T20:09:53 | 2018-08-20T20:09:53 | 145,464,911 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,868 | py | script.py | from pyspark.sql import SparkSession
from pyspark import SparkContext, SparkConf
from pyspark.rdd import RDD
from pyspark.sql.functions import lit
from pyspark.sql import functions as F
from pyspark.sql.window import Window
import time
start_time = time.time()
conf = SparkConf().setAppName("Hard Drive")
sc = SparkCont... |
c427e5610bf264b137b5e97b771d13b0fc4940a5 | 0c7b9f6a3f98fd96222bfc79badf52cd8873829a | /WEBAPP_MVC/application/controllers/clientes/update.py | 7a2746949a1654a77199a90b43a28254ae17c390 | [] | no_license | EstebanIslas/Python_AppWeb_MVC | 2507cb0950d34ac0fead60841282324c171b027b | 0a5969893ba5090928d4cd0195c92e0925215e6b | refs/heads/master | 2020-04-21T04:55:29.965549 | 2019-02-05T23:04:09 | 2019-02-05T23:04:09 | 168,902,556 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 909 | py | update.py | import web
import config as config
class Update:
def __init__(self):
pass
def GET(self, nombre):
clientes = config.model_clientes.select_nombre(nombre) # Selecciona el registro que coincida con nombre
return config.render.update(clientes) # Envia el registro y renderiza upd... |
63e7c10ccd74473102ba16e3dcae2562fd580045 | 211d35d855386ba414d964026267cc27c5b72607 | /math_interface/views.py | e8a719a9484d71bb61b88ad54ff80749eed38401 | [] | no_license | luizfrias/uowfram | 375130aa0e239613b5802b2b0e6de71afbdd6f28 | dfbc9b76b03cb9359d128397e1483ff53a93cdde | refs/heads/master | 2021-01-10T07:43:46.167058 | 2016-10-19T21:27:46 | 2016-10-19T21:27:46 | 52,740,438 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 419 | py | views.py | from django.shortcuts import render
from django.http import HttpResponse
import json
from math_interface.core import MathPlot
def index(request):
return render(request, 'index.html')
def get_plot_image(request):
post = json.loads(request.body)
plot_params = post['plot']
fn_params = post['fn']
m... |
7ce6782f27466f5428693c0725b954233054695f | c9fa521223c992b2739a14a7fc6e49d254f849bd | /multiBalls.py | 415e84ac69a43a7c71e9917386186078c1497bc7 | [] | no_license | jagriti204006/multipleBallCollision | a7b7e0bdae98911c6c442cd263760b79a2ddc033 | c869c728728ed7407664cb14dd2f65ed3775a1f7 | refs/heads/main | 2023-05-03T21:18:13.722567 | 2021-05-24T08:12:16 | 2021-05-24T08:12:16 | 370,261,929 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,116 | py | multiBalls.py | import pygame,random,math
pygame.init()
white = 255,255,255
green = 0,255,0
red = 255,0,0
blue = 0,0,255
width = 800
height = 400
class Ball:
balls_list = []
def __init__(self): #initialize the newly created object
self.x = random.randint(0,width)
self.y = random.randint(0,hei... |
ed392144357c0e0ea542769925184dce2f6982ce | 5030821c5315c6f38f125b8e6023e6c634c4c408 | /tasks/urls.py | 0f332c9c81f4a75661ddc5e959a958a824add0ac | [] | no_license | dragonee/tasks-collector | a6a7922b982ef5ce34a50ecd3b2f7eaa4a2622f0 | 60e1b04f8985f2b6f3a3c0365db9090777b6948e | refs/heads/main | 2023-03-18T10:50:38.044851 | 2022-12-19T23:05:47 | 2022-12-19T23:05:47 | 238,055,120 | 0 | 0 | null | 2023-03-15T07:07:26 | 2020-02-03T20:26:45 | Python | UTF-8 | Python | false | false | 756 | py | urls.py | from django.conf.urls import url, include
from django.conf.urls.static import static
from django.urls import path
from django.contrib import admin
from django.conf import settings
from django.urls import reverse_lazy
from django.views.generic import RedirectView
urlpatterns = [
url(r'^admin/', admin.site.urls),
... |
84d481e8f52f050d1747d775b5155c94a1cd7a0c | 6f1b05d3e8c4cdb155ba00043f431129da49189e | /tests/core/optimizers/optimizer_test.py | 9ccb2594ac4a28b5bce9fa9c922331806a791c39 | [
"MIT"
] | permissive | wx-b/pyribs | 875b2c53b72bff9e6fa0edb1e8402d4b7441efb4 | d686f7e8b36e7efaa4c18b672b9933137326f369 | refs/heads/master | 2023-03-14T01:22:02.515871 | 2021-02-28T20:51:42 | 2021-02-28T20:51:42 | 334,487,222 | 0 | 0 | MIT | 2021-02-28T20:51:42 | 2021-01-30T18:48:59 | null | UTF-8 | Python | false | false | 3,371 | py | optimizer_test.py | """Tests for the Optimizer."""
import pytest
from ribs.archives import GridArchive
from ribs.emitters import GaussianEmitter
from ribs.optimizers import Optimizer
@pytest.fixture
def _optimizer_fixture():
"""Returns an Optimizer with GridArchive and one GaussianEmitter."""
solution_dim = 2
archive = Gri... |
429cad202f81c1b585d39ff51ee5d286a6e2b5a8 | af9e2cc73c4d185cd627bab0c9f9cb4f4ed1d151 | /main.py | cebc784b9069603efb5e8c079c685747af0715a0 | [] | no_license | sahil27301/huffmanEncoding | b40f4816827f5a4bf576a736b674495bbf61c11d | d749cfe757a897a36efb9e97dfc5ee12dd1a4158 | refs/heads/main | 2023-01-02T17:26:22.309603 | 2020-10-30T08:20:40 | 2020-10-30T08:20:40 | 305,998,188 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 11,078 | py | main.py | # A GUI to accept file input
from tkinter.filedialog import askopenfilename
# To print tables
from tabulate import tabulate
import os
# Recursive function to get height of a node, height of leaves is 0
def height(node):
if not node:
return -1
return 1 + max(height(node.left), height(node.right))
d... |
4b0898db0a11f53391dc981fdef17dfb9e3fbc54 | e66f01dd48a656cb31e3bddc60c9eaf31d2ed88f | /code/mendel-first-law.py | 205992241ee977ac513d064f4eec565ee971169e | [
"MIT"
] | permissive | joaopalmeiro/rosalind | a41bdcb3210e0799962e1e5f8933d6a111184add | 8917fa22a7ac34b1a8089ee332d856fd210f6188 | refs/heads/master | 2022-04-12T21:02:33.846778 | 2020-03-27T19:26:42 | 2020-03-27T19:26:42 | 250,364,663 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 627 | py | mendel-first-law.py | # ID: IPRB
sample = "2 2 2"
with open('../datasets/rosalind_iprb.txt', 'r') as file:
data = file.read()
def prob_dominant_allele(sample: str) -> float:
k = int(sample.split()[0])
m = int(sample.split()[1])
n = int(sample.split()[2])
population = k + m + n
hetero_hetero = m/population * (m-... |
b7b8255eea137edada85f084d70475c2a95f352c | 585ef069bbc319c0df6af5fa8103fae4c2c9bfde | /Basic_Algorithm_Scripting/RepeatAString.py | 14f42aa85d01ca8d9cd2c0259bc952503d83351a | [] | no_license | JaiRaga/FreeCodeCamp-Data-Structures-and-Algorithms-in-Python | edb9649b648aa13398a86d22a6e27b7f77966118 | e104a28a21990f72e10efa14dc7038745899792c | refs/heads/master | 2020-08-20T16:35:19.811088 | 2019-12-18T15:13:55 | 2019-12-18T15:13:55 | 216,043,943 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 340 | py | RepeatAString.py | def repeatStringNumTimes(s, num):
newStr = ''
if num <= 0:
return ""
for i in range(num):
newStr += s
return newStr
print(repeatStringNumTimes("*", 3))
print(repeatStringNumTimes("abc", 4))
print(repeatStringNumTimes("abc", -2))
print(repeatStringNumTimes("*", 8))
print(repeatStringNu... |
afe84a3c87bb927cb15b288a086fe9ba9f5961c9 | 0851767480e53471180937cac3b0bf964c610846 | /project/VWork/contractor_reg/apps.py | ea7780343b025b4036eb2c9a5822229fb9092b51 | [] | no_license | ShilpaRaju20/V-Work | 2cebb7c5a9b33a5717bce3902fef05628ad223be | da6d653e7c33567ec041eee2e305447ec4bf30e7 | refs/heads/master | 2020-04-06T18:20:12.560087 | 2018-11-15T10:37:06 | 2018-11-15T10:37:06 | 157,694,448 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 102 | py | apps.py | from django.apps import AppConfig
class ContractorRegConfig(AppConfig):
name = 'contractor_reg'
|
a50cf1d09ee2331ee13ce363da062d8b37c50d3c | c36fb4fb69e1fc9f77a476053f10249594a76d18 | /LogicaDeProgramação.py | b1dcedd91399cb50814fc48fb1c389e0919d81c8 | [] | no_license | depaulo/TestIn8 | bb8ffda79b053d9cce84617e2c696bec6707a146 | 0df8b35293b819f556624c2b99d9b4325ec4b421 | refs/heads/master | 2020-09-20T12:27:11.603578 | 2019-11-27T18:22:45 | 2019-11-27T18:22:45 | 224,476,407 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 336 | py | LogicaDeProgramação.py | def Multiplos(multiplo1, multiplo2, limite) :
result = []
for each in range(limite) :
if each % multiplo1 == 0 and each % multiplo2 == 0 :
result.append(each)
return result
if __name__ == '__main__' :
result=Multiplos(3, 5, 1000)
print(result)
result=Multiplos(6, 7, 1000)
... |
82279b4db1b16a1b339696bd8c74c6f25ae4fc1f | c9966ac5bc0792fd93f9f8ce6ced1d5bd84f3cb0 | /tf_quant_finance/experimental/dates/daycounts.py | c3b0f1650ca2ed4b07fb14f493809fc2bbb1bc1c | [
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-generic-cla"
] | permissive | rajflume/tf-quant-finance | 1c6ddf18e9b008a8cfc26c20ab6d9aa7351bc972 | 5cb9474f6f2e74617735d38ef26aaef28ce69aff | refs/heads/master | 2021-02-07T06:39:55.241409 | 2020-03-03T21:06:17 | 2020-03-03T21:06:17 | 243,992,951 | 0 | 0 | Apache-2.0 | 2020-02-29T15:28:15 | 2020-02-29T15:28:14 | null | UTF-8 | Python | false | false | 7,779 | py | daycounts.py | # Lint as: python3
# Copyright 2020 Google LLC
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
8cf99a5603e9abbf8961016bcc7140e6b9a35f46 | 85f2ce8f647661e3d21622adef78f8d3aa14b9cf | /Sprint 3/Back-End Folder/forms.py | d1024b439f99350f7c62bb187c0a63a7c2cb4035 | [] | no_license | dosado/CMSC-126-LAB- | 25f31002f65fccb266b0e8a95b9e8c134efcc004 | 890ab1c9b639455ce32f222ab8c83f2cb18f1283 | refs/heads/main | 2023-06-30T13:39:20.311382 | 2021-08-04T13:12:29 | 2021-08-04T13:12:29 | 345,130,956 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 309 | py | forms.py | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length
class NameForm(FlaskForm):
name = StringField('Name',
validators=[DataRequired(), Length(min=2, max=20)])
submit = SubmitField('This way please') |
2458e5359fe641aa56beb8191704bc7e7e7db3f9 | 763194e438c28567fd2f7d47d35d5925409fed0f | /perpustakaan/models.py | e30f01980ecc5b5c84826d05fcfce6420923bd05 | [] | no_license | dendyjuliano/PerpustakaanApps_Python | 2eee6fd6d783fe806494a28becb51bc5899b6f16 | 239675534dbc90761c6ad83bbc51d1e79d761259 | refs/heads/master | 2023-01-21T06:29:25.531502 | 2020-11-27T12:07:27 | 2020-11-27T12:07:27 | 316,452,967 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 684 | py | models.py | from django.db import models
# Create your models here.
class Kelompok (models.Model) :
nama = models.CharField(max_length=50)
keterangan = models.TextField()
def __str__(self):
return self.nama
class Buku (models.Model) :
judul = models.CharField(max_length=50)
penulis = models.CharFie... |
3c982873a431dfd9fcc1bf4b299609e828000077 | cbe264842df4eae3569b28ed4aae9489014ed23c | /python/gil/counter.py | 7b66f63b61f248beca0d6c40e2480ae44229a7b1 | [
"MIT"
] | permissive | zeroam/TIL | 31e176c2f4c3e1ef72b1155353690cc2f7160f96 | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | refs/heads/master | 2021-07-23T01:43:34.135033 | 2021-07-10T06:47:17 | 2021-07-10T06:47:17 | 167,952,375 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 733 | py | counter.py | import threading
class Counter:
def __init__(self):
self.count = 0
def increment(self):
self.count += 1
def worker(sensor_index, items, counter):
for _ in range(items):
# Read from the sensor
# ...
counter.increment()
def run_threads(func, items, counter):
... |
46279817325ca4a088c2c415c41518bac56b6b4b | ee9305646c2a1f3c02820fe3fafd0a7619826651 | /4_hr_test/remove_kth_node.py | 680e53e61199af32bdbcd99adc3e0d1e57ac8808 | [] | no_license | azrap/ls-hackerrank | 2899916c7d77e48bbeda4a9d92351876b6e40b43 | e87537bd5d6d31f3aba3077b3c3dd633fe3b90a2 | refs/heads/master | 2020-09-04T15:56:49.669151 | 2020-03-10T20:24:10 | 2020-03-10T20:24:10 | 219,790,339 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,885 | py | remove_kth_node.py | #!/bin/python3import math
import os
import random
import re
import sys
class SinglyLinkedListNode:
def __init__(self, node_data):
self.data = node_data
self.next = None
class SinglyLinkedList:
def __init__(self):
self.head = None
self.tail = None
def insert_node(self, no... |
af351ac979921a0242d72239bec10bff1bd676d1 | 958bf1f01d68100ccd790e966176ae74bd889461 | /parsers/java_parser.py | ad3c29c858e585fa7993a6902a81d631bfd7756a | [] | no_license | kirmani/presubmit | 06c12649153b8232cc85b8013c79fafecd63e2cd | 62f022bfcbc6d729efba55d262d596ccac29f877 | refs/heads/master | 2016-09-06T02:37:23.168567 | 2015-07-09T16:10:16 | 2015-07-09T16:10:16 | 38,700,679 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 7,870 | py | java_parser.py | #!public /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 Sean Kirmani <sean@kirmani.io>
#
# Distributed under terms of the MIT license.
"""TODO(Sean Kirmani): DO NOT SUBMIT without one-line documentation for test
TODO(Sean Kirmani): DO NOT SUBMIT without a detailed description of tes... |
5b8ab9d6ad743e2fdc5d16416bb567951234d108 | 307870ed4a2c83103af908c5acdcc867339e236b | /Products/DiPP/BibTool.py | 490f3b507906b4b52670b5466560284194d75d1a | [] | no_license | dipp/Products.DiPP | 58734a67bf6b5980a16307d1eb602f2326c7679b | 6170be02d99c120e185e5373f6e24203e2353aa9 | refs/heads/master | 2023-03-31T11:34:58.720459 | 2021-03-26T15:15:05 | 2021-03-26T15:15:05 | 311,725,504 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 12,836 | py | BibTool.py | # -*- coding: utf-8 -*-
#
# German Free Software License (D-FSL)
#
# This Program may be used by anyone in accordance with the terms of the
# German Free Software License
# The License may be obtained under <http://www.d-fsl.org>.
#
# $Id$
from elementtree.ElementTree import Element, SubElement
import elementtree.Elem... |
b9494550fb4a2fd4a784ebe919c2769bb7f5f052 | fac2a3e4f132ee1b1972d117855c48add74d75b6 | /App.py | 725f5587e2cb63da2a1a67adc0aabc84bbffdde4 | [] | no_license | Ratansingh648/MLaS-Backend | 48ffc18c3aeaacf7ecc2ef22c4871cb9b5b8f7b6 | 8f5a5174b9ef9ee7297d169e2465b573ba5d8773 | refs/heads/master | 2020-03-07T05:52:49.554957 | 2018-06-11T17:09:35 | 2018-06-11T17:09:35 | 127,308,004 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 16,498 | py | App.py | from flask import *
from flask import request
import pickle
from ML import LogisticModel,KNNModel,DecisionTreeModel
from flask_pymongo import PyMongo
from bson.binary import Binary
from MachineLearning import *
import datetime
import uuid
import random
import pandas as pd
import numpy as np
app = Flask(__name__)
mongo... |
1bb4ac15474617d9cbd571426376d0c33a24291a | 74ee19c82fc54ab620d6569fb266efa0fd1f7490 | /EVEIndustryProjectManagement/EVEAPI/tests.py | f3316519465d1060ce68ac9b3e16efcab91451ee | [] | no_license | khariq/EVE-Industry-Website | 307cb824f9e7e5cda837233910fd992731c3e6d4 | 1884dfb85423c3756bd0ff9e876ce2f4c0873214 | refs/heads/master | 2020-03-26T18:52:51.594119 | 2014-01-03T18:57:38 | 2014-01-03T18:57:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,461 | py | tests.py | ##########################################################################################################################
## Module for interacting with the EVE Online API
## Full reference found at https://wiki.eveonline.com/en/wiki/Category:API
## Michael Pickens
## 6/26/2013
## Partial implementation of the API set... |
f03c5083b89d7a10c916d859b3ef19949ba222d6 | 3b191ec86ccb181902a7f12930abcd772605e6f2 | /data/filter.py | 6541a0f6b69c0b5d051e1dd0c5ef41c9c72307b3 | [] | no_license | SecoWWW/assignment-gis | 48a2d9ecfc9e2ee781beaa43a6592232acc03b94 | 772eca73e667ff8e3cbbc0a34a710169652030f0 | refs/heads/master | 2020-04-02T02:17:49.341962 | 2019-01-02T19:47:09 | 2019-01-02T19:47:09 | 153,901,950 | 0 | 0 | null | 2018-10-20T12:11:22 | 2018-10-20T12:11:22 | null | UTF-8 | Python | false | false | 1,354 | py | filter.py | import csv
from datetime import datetime
import json
with open('ChicagoData.csv') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',')
mydict = {}
i = 0
for row in spamreader:
date = row[3].split()[0]
i += 1
try:
date = datetime.strptime(date, '%d/... |
d2c441504a9bbae243bbfbce7550be1b9141784a | 781e2692049e87a4256320c76e82a19be257a05d | /all_data/exercism_data/python/leap/52cc699564ad402c908245c53f3ca750.py | cfd79ac18ac4b4c9d3d3789cc507d8d1774fed46 | [] | no_license | itsolutionscorp/AutoStyle-Clustering | 54bde86fe6dbad35b568b38cfcb14c5ffaab51b0 | be0e2f635a7558f56c61bc0b36c6146b01d1e6e6 | refs/heads/master | 2020-12-11T07:27:19.291038 | 2016-03-16T03:18:00 | 2016-03-16T03:18:42 | 59,454,921 | 4 | 0 | null | 2016-05-23T05:40:56 | 2016-05-23T05:40:56 | null | UTF-8 | Python | false | false | 214 | py | 52cc699564ad402c908245c53f3ca750.py | """year.py - take a year and report if it is a leap year."""
def is_leap_year(year):
"""Take a year and report if it is a leap year."""
return ((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0)
|
8501b248e5f691a585e3b691619a40fb1c814671 | a59231cdf10a83b9f7a6a670fff24f52cb3b4642 | /Python/DSImplementation/stack.py | aae28e8ccec2aba72e621548f5ed8e3395471fc0 | [] | no_license | jadenpadua/ICPC | afae2b3e7c4eb2a5c841bfbadb6c6c8c06599f40 | 6f4edeb36391c4afdde9f8f15e39a25895183f95 | refs/heads/master | 2020-09-12T06:17:12.508460 | 2020-09-11T23:05:11 | 2020-09-11T23:05:11 | 222,338,314 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 158 | py | stack.py | string = "Hello World"
stack = []
for i in range(len(string)):
stack.append(string[i])
print(stack)
for i in range(len(stack)):
print(stack.pop())
|
afbedc5074316e2c011f30017dd6280ca3d67803 | 6b1cd439b4bffd52204389fd4516fea861751fb6 | /api/migrations/0001_initial.py | e08ee2d27e89d083a60fcbf4893322f09895ba12 | [] | no_license | abduev/yamdb_final | 799b434e7d6d6f221fcab5d309a834e3a031ba03 | 956797d71bfe64bec7eb2f20d225f2dd64a9f2bc | refs/heads/master | 2023-08-22T01:32:32.422760 | 2021-10-17T08:25:52 | 2021-10-17T08:25:52 | 391,638,190 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,713 | py | 0001_initial.py | # Generated by Django 3.0.5 on 2021-07-26 07:39
import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
import api.validators
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable... |
8506ddcbbea3c629e2816777bbb59db07ad2548e | c747e1f6dc4c0a0237c841406c15ddca91ab104a | /cip/content-export/sumo_shared.py | b50c69d23ef1748b48d505c9d48c80abf5e31200 | [] | no_license | tdiderich/sumologic | e1199ac2ff9dcac17707e4284d5c7ef841a78ca6 | bb0ecaac0fa728cd5da2c176558db38dc3b44882 | refs/heads/main | 2023-07-16T00:19:05.379879 | 2021-08-26T18:47:56 | 2021-08-26T18:47:56 | 307,392,581 | 9 | 2 | null | null | null | null | UTF-8 | Python | false | false | 19,122 | py | sumo_shared.py | import sys
import time
import os
import json
import threading
import requests
import logging
try:
import coloredlogs
coloredlogs.install(level='INFO', fmt='%(asctime)s %(levelname)s %(message)s')
except:
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S', level=... |
52808282e5d66cdc321b2ddedb0242014ce8b10a | 1dec9c562490d7549d40c6ec1d2cf48dc3c91897 | /train.py | e9dad6275c3b2b1d2c27da1dc924e9f9968d0374 | [] | no_license | YaoJiajie/kaggle_salt_segment | 0929003600afbf0bc8591ba98bd66dd2c858f6f8 | 01781f6950793c57bdfe978ca93c4bf2f9c7152c | refs/heads/master | 2020-04-02T03:27:26.680723 | 2018-10-29T02:20:25 | 2018-10-29T02:20:25 | 153,967,161 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,715 | py | train.py | from data import load_train_data, load_val_data
from LovaszSoftmax.pytorch.lovasz_losses import lovasz_hinge
from model import ResUNet
import numpy as np
import torch
import os
import torch.nn.functional as F
from metric import get_ave_precision
import sys
from time import gmtime, strftime
def criterion(logits, targe... |
06bde8ba8fd67f550cdb3046bb5ce868c75b4207 | b9fb0e05ec0a916dcb760eaa2ebdc61e3fc13e14 | /KeyValueDataStore/main/___init__.py | 98a177264efa6a5df171819fdd68814314036248 | [] | no_license | anirudh-08/LeapFinanceProject_KeyValueDatastore | 83f47def0ff93ed2429710b1befb82a7f3b4165c | d54e2a16831b1706a66bce070e1979f4c7413f1f | refs/heads/main | 2023-04-06T00:37:26.661285 | 2021-04-24T06:07:07 | 2021-04-24T06:07:07 | 361,076,387 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,225 | py | ___init__.py | import os
import fcntl
from . import config
from .data_store import DataStore
def get_file_name() -> str:
"""
To create a new file name
"""
import uuid
uniq_append_string = uuid.uuid4().hex
return "LOCAL_STORAGE_{}".format(uniq_append_string)
def get_instance(file_name=None) -> DataStore:
... |
582bf1097665d0cb52df2d65f0bd732ac803237c | 1a6fc97dd49f2227293bcc2ce86fcfb003c774e6 | /Assets/Plugins/CreateWeaponTable.py | a0541203f62da245bd5592a85bdb5da28c7006bd | [] | no_license | UnicornOfDoom12/NEA | 54249ca4e10056683a85babfc72e3011468b6a3c | ade1574c8322a3f17bb768aa0377b9d961f1bf14 | refs/heads/master | 2020-04-15T14:08:29.781466 | 2019-05-15T08:23:32 | 2019-05-15T08:23:32 | 164,743,315 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 405 | py | CreateWeaponTable.py | import sqlite3
import os
os.remove("WeaponsTable.db")
conn = sqlite3.connect("WeaponsTable.db")
cursor = conn.cursor()
cursor.execute("""CREATE TABLE tblWeapon
(id INTEGER,
Name STRING,
Category STRING,
Damage INTEGER,
Inaccuracy FLOAT,
Magazine I... |
b99c5d124ab67a07cdf8cae3dd6d6332c9cf7582 | 38cec28b79bc35ba8a7f5c2571558c30f7c0b1b6 | /Problem1.py | e3b923cada4de3ebce9b0a45b789b67e11d56c90 | [
"MIT"
] | permissive | ashleshp/Alphabets-Problem | 2c27f20505e4135ad273a1d2ac011f3106f55159 | 19b9313da40b5095225ee0cec50db034eeb44c86 | refs/heads/main | 2023-05-15T05:11:09.751015 | 2021-05-30T19:08:40 | 2021-05-30T19:08:40 | 372,293,425 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 379 | py | Problem1.py |
def encode(s, n):
newS = ""
for i in range(len(s)):
val = ord(s[i])
dup = n
if val + n>122:
n -= (122-val)
n = n % 26
newS += chr(96 + n)
else:
newS += chr(val + n)
n = dup
... |
8eab319ae2880ba55be47007898b6896dc07b956 | b4ab96338f9f6c2db67a375b41f8edff9088adcb | /python/tinyPro/getPid.py | 61b1c3fb7e8c09c37a0ea306f4303ce505621dc0 | [] | no_license | yanspirit/mytest | 08fdd69fdc9e1871ed4a369410ebd08263976d0a | 90292c72815ee7dc9a4d44bdc1c17fffb6e684d2 | refs/heads/master | 2020-06-06T16:20:02.537327 | 2012-09-16T15:25:45 | 2012-09-16T15:25:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 264 | py | getPid.py | #!/usr/local/bin/python
import psutil
import re
import sys
def processinfo(x):
p=psutil.get_process_list()
for r in p:
aa = str(r)
f=re.compile(x,re.I)
if f.search(aa):
print aa.split('pid=')
processinfo(sys.argv[1]) |
1f40b4c3470d5848f5341e095f678411fbca569c | 15fd40caf9143d9f313846e25f86d37126bdc759 | /buildfarm/maintenance/normalize-masters.py | f28f231ad5c3a76eb330b9b2b5fe2cc2fceb96a2 | [] | no_license | lsblakk/tools | e07ae50d7bb14a95241c64e83133d14493c7b3d2 | a427d8b2790350b524b66ac14534fd836ae10476 | HEAD | 2016-09-06T10:13:15.460163 | 2012-03-28T23:13:23 | 2012-03-28T23:13:23 | 2,156,912 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 251 | py | normalize-masters.py | #!/usr/bin/python
import simplejson, sys, os
fn = sys.argv[1]
data = simplejson.load(open(sys.argv[1]))
data.sort(key=lambda master:master['name'])
os.rename(fn, '%s.bak' % fn)
open(fn, 'w').write(simplejson.dumps(data, indent=2, sort_keys=True))
|
5da15e19480ae210f03a7f6baee4eb7a5939788a | f5b3178f2e1b92cd1b8bd00076f33aa03789b709 | /copy txt to excel_1.0_2nd step.py | f6971cbaca8a11c356936bc60d97f160efe4588e | [] | no_license | CK642509/FLIM-image-processing | 519118d52800c9ca65619b2f7661e0b6fc9a65f4 | fcd0beeaa5acad34747a650f5d845d8051616ab7 | refs/heads/master | 2022-04-16T11:29:50.340050 | 2020-04-10T15:04:03 | 2020-04-10T15:04:03 | 254,661,184 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,772 | py | copy txt to excel_1.0_2nd step.py | import openpyxl
import os
# show information
print("This is version 1.0 2nd step")
# get the path of target folder
path = input("The path of target folder:")
folder_name = path.split("\\")[-1] # split with "/" and select the last one
print("folder name: " + str(folder_name))
# get the results
wb = openpy... |
b3e23dfeed6ad7c21c0e1f612f52c4d407d86cde | 3aeb377c267559d7fea83675eab7b7ce84e97bde | /untitled31.py | d4e40eafaa39d71f58241a669103e00aaf8887fd | [] | no_license | Sitych/hack21_final | 3cff02791fe71578e7dda1d0ab243b9ac1c5965a | ec824f881f4ed0de35782c95c052e3f727640a9c | refs/heads/main | 2023-03-26T11:02:47.450953 | 2021-03-27T10:28:34 | 2021-03-27T10:28:34 | 352,013,921 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 15,132 | py | untitled31.py | # -*- coding: utf-8 -*-
"""Untitled31.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1OSRzbxQcUg7jvYtRFL2_1vY8PNySf2G6
"""
from google.colab import drive
drive.mount('/content/gdrive')
import os
import numpy as np
from PIL import Image
from tor... |
1b427f57df608f05381f00771fae45cc7d147bd1 | 14cabf0911badc0672a6115c2f1a2528108e99d7 | /Mundo 1/Aula 08 /Desafio 017.py | a8832990c39eca22b31c5e29780c89c8d25fcc43 | [] | no_license | alvarohenriquecz/Curso-Python-Guanabara | 7015ad3f90d4c87c010c855658ee7011f971a16e | 7ccaa28d308dde814b189e121ad34c1474cac57a | refs/heads/master | 2022-11-10T05:46:51.336580 | 2020-06-21T21:24:34 | 2020-06-21T21:24:34 | 272,767,990 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 404 | py | Desafio 017.py | """
Desafio 017: Catetos e Hipotenusa
Faca um programa que leia o comprimento do cateto oposto e do cateto adjacente
de um retangulo, calcule e mostre o comprimeto da hipotenusa
"""
from math import hypot
c1 = float(input('Digite o comprimento do cateto oposto: '))
c2 = float(input('Digite o comprimento do cateto adja... |
c13a8b271bfcbaa838353bb40eee87095d4523b1 | 44a7101ae18c84ffa0e3c674763ba7b500937773 | /root/Desktop/Scripts/pyinstaller-1.5.1/hooks/hook-pygments.lexers.py | ce152a05ad234379f601c4e17c2ba5366c466357 | [] | no_license | Draft2007/Scripts | cbaa66ce0038f3370c42d93da9308cbd69fb701a | 0dcc720a1edc882cfce7498ca9504cd9b12b8a44 | refs/heads/master | 2016-09-05T20:05:46.601503 | 2015-06-23T00:05:02 | 2015-06-23T00:05:02 | 37,945,893 | 7 | 2 | null | null | null | null | UTF-8 | Python | false | false | 36 | py | hook-pygments.lexers.py |
hiddenimports = ['agile', 'dotnet'] |
348ee5393c1dc76df6dc12f8a029a3a4e5d2ad49 | afb41f2f780b5adcb2fc330cfcfad9eade31e516 | /homework1problem2partg.py | d239a8ce8539c4a24a6feb9f1d107033b1011c03 | [] | no_license | BrianTCook/NR_homework1 | 944df4440a5946931ed52914c5804754b2ce0071 | 3fb76b92850c1ab53cde331b81d80bafd59c7b17 | refs/heads/master | 2020-05-05T11:41:41.730666 | 2019-04-09T11:43:39 | 2019-04-09T11:43:39 | 179,999,762 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,041 | py | homework1problem2partg.py | # Problem 2, Part G
import numpy as np
import matplotlib.pyplot as plt
import math as m
from random import sample
random_numbers = np.loadtxt('homework1problem1partb_randomnumbers.txt')
a, b, c = np.loadtxt('abc.txt')
Aval = np.loadtxt('Aval.txt')
def mergesort(lst, N_lst):
flag = 0
while flag == 0:
... |
78ed8edfda2f7d5cee46474c325c23ad1e8856ee | f72098b4b6b0213a6b13ab7a9d0886ed39d61c9b | /Preprocessing/Theano.py | f738bc713e60024b406e8b83d80330beaf3c5d12 | [] | no_license | Sameer-Arora/ML_Project | d5357df9449cbe8baafa016019c60076ba69b68f | 9ee5ee105112d89eae567eb327909c3431b54833 | refs/heads/master | 2020-04-06T19:03:59.353758 | 2018-11-29T19:05:03 | 2018-11-29T19:05:03 | 157,724,103 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,105 | py | Theano.py | # Numeric Computing (GPU)
import theano
import theano.tensor as T
import theano.tensor.nnet.neighbours
def compile(self, arguments, function):
"""Build a Theano function that will run the specified expression on the GPU.
"""
return theano.function(list(arguments), function, on_unused_input='ignore')
def... |
f6033b129e6d195175ada1be4604ead215a2fd4e | 71a9060cc1ab70850f4f17f7291a7b00ad5706d0 | /src/services/temperature_factory.py | a4f946cac48c525601ae237b18ea0b54abb82ecd | [
"MIT"
] | permissive | terrazoon/measurement_converter | 61a4652a09295c19867b61eca17eb434c8b7def0 | 462768fb2620ba61495846639ec07778a2f5d548 | refs/heads/master | 2022-05-29T09:31:54.574274 | 2020-05-03T22:30:49 | 2020-05-03T22:30:49 | 259,431,288 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,433 | py | temperature_factory.py | class TemperatureFactory:
"""
Returns a formula to use to do the required temperature conversion.
Given how simple these conversions are, an alternative approach would have been
to just make a lookup table and a generic function (similar to what was done in
temperature_service_test,... |
b639f0dfa03b6f40439a7c0fbfa16edb74a8bfd6 | ca9173159f31b9122cbe532068710b980f94cb98 | /python_complete/SetsAndDictionaries/join1.py | 6aa9900dbf0c0ab931b171e2162d9eb93243c69d | [] | no_license | bobheck/tut | d4c0b974246756e320044223f9671459b48eced9 | d4a2424ca7f947eee06f340a228b501c7d1e9c3b | refs/heads/master | 2023-05-13T09:37:15.860387 | 2023-05-09T15:44:54 | 2023-05-09T15:44:54 | 116,607,002 | 0 | 0 | null | 2023-01-13T22:32:12 | 2018-01-07T23:24:03 | Python | UTF-8 | Python | false | false | 635 | py | join1.py | import time
my_list = ["a", "b", "c", "d"]
letters = "abcdefjhijklmnopqrstuvwxyz"
numbers = "0123456789"
# inefficient, strings are immutable so it is destroyed each time
tic = time.perf_counter()
new_string = ''
for c in my_list:
new_string += c + ", "
toc = time.perf_counter()
print(new_string, end="\t ")
print... |
bee246459a41ee775b995e4f8c3312caeeec01ae | 34fc9bcb802522b661dfe53aed67165cf50d325a | /hidden.py | e9081dee8918e03a610cb81d35ac579eb198f5f9 | [] | no_license | az-cheng/Trump_Twitter_Project | 57817d926a67ff9037567903e1e8fe0d220ebaf3 | 5efbb9de8c9694fcb5d0691c95ce7dff1f2d5dca | refs/heads/master | 2020-03-30T18:15:37.953626 | 2018-10-03T23:12:54 | 2018-10-03T23:12:54 | 151,491,297 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 650 | py | hidden.py |
# Keep this file separate
# def oauth() :
# return { "consumer_key" : "2pd5WYH6wEkJ8Je5sux9F2l7G",
# "consumer_secret" : "xp21i0NqlXOkuDK2CqQYXXcEDMLUMgpqFdUTX1oV0lLKeYDLJ2",
# "token_key" : "2227811952-0iHFgphunHtlO8u1nebeUgL5TA8IPRpLfAvK8IP",
# "token_secret" : "dPLYLbQia6lqFXNa8JA6fccc... |
7498e35468f8f6623edd8f5b7fe99e3b48e96595 | e5b35aef8fa917aa7cf42f0f9f9b12b5fc5ba4ef | /ann/__init__.py | c026dd2faeab2f2034901c7a30d1409edc51e6a6 | [] | no_license | luiseduardohdbackup/aNeuralN | fd8028ba3ce7178ef861912bb92b23055acfcf16 | 417e6186c27c4b6b0b4c8987b5d82dd10706fdf6 | refs/heads/master | 2021-01-17T22:42:51.450638 | 2013-12-12T12:14:07 | 2013-12-12T12:14:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 314 | py | __init__.py | #Want training functions available at package level
from trainingfunctions.davis_genetic import train_davis_genetic
from trainingfunctions.genetic import train_evolutionary
from trainingfunctions.gradientdescent import traingd
from trainingfunctions.rprop import train_rprop
from mp_network import train_committee
|
c1640575662e6bc6070f7e306af5e4a309aa177f | b96d8b9d7ab5e6b9384c3777cbf5170dd85381a8 | /project3/project3/orders/models.py | d0162a6eb39420030ba2ea63aa0aa5bd0813a5e1 | [] | no_license | jsaylor525/WebProgrammingWithPythonAndJavascript | 2b8b746b26b3042005ece7aff27582bc63c4a6e0 | c95403fd5f4b12005c485ac29ea001e8a162bcfa | refs/heads/master | 2020-03-27T08:44:40.781848 | 2018-10-18T17:04:54 | 2018-10-18T17:04:54 | 146,283,503 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,102 | py | models.py | from django.db import models
# Create your models here.
class Menu(models.Model):
food_item = 0 # Link to the available food items
class Topping(models.Model):
name = models.CharField(max_length=64)
price = models.DecimalField(max_digits=6, decimal_places=2, default=2.00)
def __str__(self,):
return... |
26171568b9cc786eadaa47a5c82dc42af5e97ead | 0a2fa84b863576f015c5095e1bbc55670f2bab98 | /leetcode/validateStackSequences.py | e6e71b3dbe9e5c24134fdd4d37b00980fb89ead6 | [] | no_license | cheoljoo/problemSolving | 6d1ed165286c2790f6226f6ddfc698c246fc778a | 2fb6246be3bf48eb8ad626217300a1a9328f541a | refs/heads/master | 2023-03-31T12:54:54.487215 | 2023-03-18T08:21:32 | 2023-03-18T08:21:32 | 180,464,867 | 1 | 0 | null | 2022-01-07T14:33:41 | 2019-04-09T23:32:53 | C++ | UTF-8 | Python | false | false | 2,169 | py | validateStackSequences.py | from collections import defaultdict
import enum
from re import A
#import numpy as np
import sys
import argparse
import math
import random
from tkinter import N
# https://www.daleseo.com/python-typing/
from typing import Optional
from typing import Union
from typing import List
from typing import Final
from typing impo... |
d54b2c0eda40645042754a30a4517f969e8331c4 | 4a3d5904441535e77d39e1f6d9552433d297ce0a | /recursion/fabbu.py | 2ab196aa008462623eacd5636cad2d0947bb066c | [] | no_license | Rinkikumari19/codechef_questions | b2a5d3b483f3aa8ef70d4af963f7315dca308e6e | 2b1f991d3e2faad4ca5d7ce9af4fad0c35e7b087 | refs/heads/master | 2022-11-23T19:00:21.589006 | 2020-08-02T18:22:38 | 2020-08-02T18:22:38 | 280,680,989 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 119 | py | fabbu.py | def fabb(n):
if n==1:
return 0
if n==2:
return 1
return(fabb(n-1)+fabb(n-2))
print(fabb(6)) |
dbe7d59c97599b04a57e573fa25dfa9802dcca15 | 6d226750ddc3999333969253901e1f6dd6da519d | /input/plugin/websocket.py | a593f5fb427acd6052a78d80ee056f031ce5fce5 | [] | no_license | CYBEX-P/cybexp-cs | b3ed007eda02e2258c88574a543ca4bfef5881b6 | 117ea13a1d67955532755e934d7e09663015aebf | refs/heads/master | 2022-12-11T17:45:01.515679 | 2020-09-18T19:33:36 | 2020-09-18T19:33:36 | 172,636,225 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 888 | py | websocket.py | #!/usr/bin/env python3
from .common import *
from lomond import WebSocket
from lomond.persist import persist
class WebsocketSource(CybexSource):
def __init__(self, api_config, input_config):
super().__init__(api_config, input_config)
self.ws = WebSocket(self.url)
def __str__(self):
r... |
9546fd926b3e8fd55a443904f15c578d66470ceb | cdb7bb6215cc2f362f2e93a040c7d8c5efe97fde | /R/ReorderDatainLogFiles.py | d3524cb13c988ea2db3dafd64596e12e2c8a5cc6 | [] | no_license | bssrdf/pyleet | 8861bbac06dfe0f0f06f6ad1010d99f8def19b27 | 810575368ecffa97677bdb51744d1f716140bbb1 | refs/heads/master | 2023-08-20T05:44:30.130517 | 2023-08-19T21:54:34 | 2023-08-19T21:54:34 | 91,913,009 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,897 | py | ReorderDatainLogFiles.py | '''
-Medium-
You are given an array of logs. Each log is a space-delimited string of words, where the first word is the identifier.
There are two types of logs:
Letter-logs: All words (except the identifier) consist of lowercase English letters.
Digit-logs: All words (except the identifier) consist of digits.
Reord... |
3f8ee8805675da2251096e7df4b046c2fe8bd433 | b53b3d59057ab372fcc01d2a5670bee7bd66ce4b | /constants.py | 58de2d6677341896d2490e3e10592b440838f5bf | [] | no_license | BigDataPlayground178/stormbreaker-kafka-client | c726165b888b14510cadc4224fd16c93fecf342f | d8e2a532c2d16c9cbbbc9ae143215bb2818d5fea | refs/heads/master | 2020-03-21T19:05:58.475335 | 2018-07-01T05:06:47 | 2018-07-01T05:06:47 | 138,930,229 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 630 | py | constants.py | """
Constants of the Kafka producer client
"""
# topic
TOPIC_FRIENDSHIP = "friendships"
TOPIC_POSTS = "posts"
TOPIC_COMMENTS = "comments"
# datasets
DATASET_FRIENDSHIP = "./datasets/friendships.dat"
DATASET_POSTS = "./datasets/posts.dat"
DATASET_COMMENTS = "./datasets/comments.dat"
SOURCES =... |
92a9514c10a4b031ca968b4c3bc8a78ae0c5dbe6 | ddafdcbed5353c50f9f6338875612de30bd7c699 | /lektion7/feature_selection_kbest_and_percentile.py | e1df92b0dd4496c7908f4cbbabdec6b271f10b78 | [] | no_license | zaifrun/ML2020 | 1a3e83357a3bf5d09809633fd59f76a3b3887d16 | ef285417df0ab6cdae48712003e2d6f589932253 | refs/heads/master | 2023-01-29T12:05:42.206561 | 2020-12-09T11:53:50 | 2020-12-09T11:53:50 | 292,808,220 | 1 | 3 | null | null | null | null | UTF-8 | Python | false | false | 1,161 | py | feature_selection_kbest_and_percentile.py |
from sklearn.datasets import load_iris
from sklearn.feature_selection import SelectKBest, SelectPercentile
print("*********** selectKbest ************\n")
iris = load_iris() # load iris sample dataset
X = iris.data
y = iris.target
print("Original dimensions of data:")
print(X.shape)
selector = SelectKBest(k=2)
p... |
45278e47aee9e526e0d40cea773127a9e73a3517 | 5f052c5ebc53e8d72978fad1f6232778c404b417 | /hera/measurements/GIS/utils.py | 2935ef38039a5344aa6408901aaaf8931f72588f | [] | no_license | swipswaps/Hera | e7afa0cb0f15f377cd0ed47a27ff47c6e248439e | 7fbf20536c81c54cd69d1745f88bbcb264158e82 | refs/heads/master | 2023-01-23T02:36:26.581758 | 2020-12-07T14:20:57 | 2020-12-07T14:20:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,801 | py | utils.py | import geopandas
import shapely
import pandas
def PolygonDataFrameIntersection(dataframe, polygon):
"""
Creates a new dataframe based on the intersection of a dataframe and a polygon.
Parameters:
----------
dataframe: A geopandas dataframe.
polygon: A shapely polygon
Returns:
--------... |
9bad98f3944b6a242508e18eadd3ebb140dfbdc7 | e691e9f6ef489fcdbdd36a951261b5987204f48b | /app/__init__.py | 7a3ddf11e6e973761cd98e6dc2001fc74ce2969e | [] | no_license | LeslyDev/-Event-Planning-Multiuser | 023a9e8833c9c54f735965275c14b8e0840b7c60 | 47aaa0b63a5ccccdcf60510dafc1ee0bf133080b | refs/heads/master | 2023-05-12T17:02:24.819912 | 2020-05-19T11:43:28 | 2020-05-19T11:43:28 | 264,397,033 | 0 | 0 | null | 2023-05-02T19:14:25 | 2020-05-16T08:55:08 | Python | UTF-8 | Python | false | false | 544 | py | __init__.py | from flask import Flask
from config import Config
from flask_wtf import CSRFProtect
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
app = Flask(__name__)
app.config.from_object(Config)
# CSRFProtect(app)
db = SQLAlchemy(ap... |
7c935d7539e8178317b8b7fc43a423b7f5bd44b6 | 2308c94f3ba8295866624a54a00b4ddc252ec557 | /questions/drone-flight-planner/solution_py3.py | f4664998fb79f334b0a4be8e69b863b5968bc9bd | [] | no_license | shalini1803/pramp_questions | 0ee55a2098f6f9f6d7dd85ce18d50dca576cb6ae | 3b43d0fa7301151593ba0da78077283590bb28b9 | refs/heads/master | 2023-03-17T01:21:30.588083 | 2020-09-28T17:07:51 | 2020-09-28T17:07:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 484 | py | solution_py3.py | def calc_drone_min_energy(route):
maxH = route[0][2]
for i in range(1, len(route)):
if route[i][2] > maxH:
maxH = route[i][2]
return maxH - route[0][2]
route = [[0, 2, 10],
[3, 5, 0],
[9, 20, 6],
[10, 12, 15],
[10, 10, 8]]
""" Expected output: 5 #
... |
50e96b96718db49abd32b68295526e5e322be250 | d14b27e4ce1619f5bdd0fbabf939f3b19d79040b | /scraper/utils/data/gino_utils.py | 0096c4ac33d2897a5e84c61246caee20fcd346ad | [] | no_license | austincollinpena/spell-check-scraper | aff7441d754701597fdf96cb582fe4f7304c88bf | b6ee8e133d89fe062386ee27917300c170c75783 | refs/heads/master | 2022-09-19T13:50:49.497434 | 2020-06-03T21:56:48 | 2020-06-03T21:56:48 | 268,925,729 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 398 | py | gino_utils.py | from db import gino_db
from db.models import Domain
from scraper import config
async def init_db():
engine = await gino_db.set_bind(config.DB_DSN, echo=False)
domain = await Domain.query.where(Domain.domain == 'http://equipomedia.com').gino.first()
domain
async def get_list_of_domains():
domains = a... |
ef475091a92af7dee1276b4581dfb417f76f12bc | 8f84abe87489cf4d054097d3101603bf63768b32 | /ICP-1/Source/FirstLastName.py | 93ac4196baea73a92a762db047fcbbbab39e5ef4 | [] | no_license | SASLEENREZA/Python_DeepLearning | 4777a8b474a9e96e4f075c369979085428ddbc52 | b8d61989b52dc9af22cdea43e0ab273e998e26ee | refs/heads/master | 2020-03-27T05:41:26.218544 | 2018-12-08T04:52:46 | 2018-12-08T04:52:46 | 146,040,145 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 222 | py | FirstLastName.py | def reverse(s):
str=""
for i in s:
str = i+str
return str
s=input("enter the string")
print("the input string is : ", end="")
print(s)
print("the reveresed string is : " , end ="")
print(reverse(s))
|
95993c82c10509b9b5ef0dc9361c993aff3580f5 | 5c2daaac679a27ca8931cab6a9fb47a7bac84429 | /3_lesson/list_with_int.py | c8b35ac6afa21f0047f2ec8ee3437d3a82d54ba9 | [] | no_license | ZenKaban/frii-python | 8ef46e8a513e3b885e3a3d03fe137936bec8f2e3 | 98449b474a040b173b5ad64dc5024f25cd9a3971 | refs/heads/master | 2021-06-21T02:22:31.784424 | 2019-09-23T20:10:40 | 2019-09-23T20:10:40 | 199,621,779 | 0 | 0 | null | 2021-03-20T01:33:15 | 2019-07-30T09:38:14 | Python | UTF-8 | Python | false | false | 235 | py | list_with_int.py | def sort_int_list(list):
for item in list:
if not isinstance(item, int):
raise ValueError
sorted_list = sorted(list)
return sorted_list
list = [1,6.0,6]
print(sort_int_list(list))
|
e12dc94cf0ffb694792236e9e4ebc4216159d819 | c04aae293d583ed95d8755456262d41335b29f61 | /forum-scraper-rss/javahova_rss | 42424aa68a1cb69e3a918623332f93661c03f58c | [
"LicenseRef-scancode-public-domain"
] | permissive | fritids/quick-hacks | 0a30f5037242bebdf725ea595da1b847c187c6c5 | c59ebae8968e38a99468f130b6a48464de5055e2 | refs/heads/master | 2021-01-21T20:42:10.582214 | 2011-07-27T11:19:06 | 2011-07-27T11:19:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,520 | javahova_rss | #!/opt/local/bin/python
"""JavahovaRSS
http://www.cs.vu.nl/~mvermaat/
Usage:
RSSify(url) - returns RSS document for the active topics list at url
Example:
Make a cronjob that runs every hour or so that executes javahova_rss.py and
redirects the output to a file in your www-root:
$ python javahova_rss.py > ~/www/jav... | |
97ccc6fd9c0a0db2b026791cbb01955d9457cd4e | cdb3c90b4114dfd1ad8c0619fb3164dc3356b828 | /DialogModule.py | 99dde81b1b23f3fe982076588c484225bf56c73d | [] | no_license | Xiaomeng-X/NaoTask-grab-red-ball--python | 60c4fc890e0051d93361d5c858a713bd5897d9a2 | 4e0e653ba9f19c23042e4932eba4228952e61a22 | refs/heads/master | 2020-06-12T09:37:02.552670 | 2019-09-03T13:52:40 | 2019-09-03T13:52:40 | 194,260,440 | 7 | 2 | null | null | null | null | UTF-8 | Python | false | false | 4,202 | py | DialogModule.py | #-*-encoding:UTF-8-*-
#做处理命令行参数使用
import argparse
import time
import re
from naoqi import ALProxy
from naoqi import ALModule
from naoqi import ALBroker
dialog = None
class DialogModule(ALModule): #创建自己的模块,所有的模块都来自almodule
"A simple module able to react to facedetection events"
def __init__(self,name,robot_ip,r... |
06b322d5c06700f89e91edc4baf856c3a55966a0 | fef413ab914d264d7cf9e59d6831f052d4d68053 | /game.py | 2085204719abba6a4b6c98b9e72bf34a90f42acd | [] | no_license | CompThinking20/python-project-sd1067 | 572be3b5a6a6b830c13b4f128250f99c851d34ec | a5ead8a1b24251ef8c9212c74ee14c9eedab0aee | refs/heads/main | 2023-01-31T19:30:04.462282 | 2020-12-15T20:49:34 | 2020-12-15T20:49:34 | 317,381,917 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,940 | py | game.py | import random
import time
import source as sgs
import combat as combat
import rooms as rooms
import tags as tags
A1=sgs.skill("Attack", 1, 0, "PHY")#default skills
M1=sgs.skill("Cast", 1, "Drain" , "MAG")#default skills
choices={0:"Fighter", 1:"Mage", 2:"Assassin", 3:"Arcanist"}#for later
room_c=["c","e","g","h"]#for ... |
f970f50f4c723e38cb0893867fd3ec270d4f4a3b | dde951c8bcfb79cdead3449de42d9ed3e6f24fbe | /LearnPythontheHradWay/ex5.py | e7b0b885e85000876550481b4bfcf4fe53e97338 | [] | no_license | wolfeyuanwei/study-python | c764353cbf75b0ccd79dc562fe11eebee712510b | be1a9ec93cd29d9fe6b69ad4f9c059fb9dd308de | refs/heads/master | 2021-05-11T22:57:51.541684 | 2018-02-08T05:03:10 | 2018-02-08T05:03:10 | 117,504,326 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 620 | py | ex5.py | #!/usr/bin/python
#filename:ex5.py
#-*-coding:utf-8 -*-
my_name = 'wolfe_yuan'
my_age = 35
my_height = 72
my_weight = 176
my_eyes = 'Brown'
my_teeth = 'White'
my_hair = "Head"
print "Let's talk about %s." %my_name
print "He's %d inches tall." %my_height
print "He's %d pounds heavy." %my_weight
print "Actually that's ... |
79434322519420b73830b2ed3471687148781406 | c6a186e2a7a61327c92333167b08c12dd5220725 | /StirlingS2.py | f8a15f08cd5dd6f9f66870ec9c587552cd63eac4 | [] | no_license | winkelmantanner/math5107 | 5fec5ff6b03ca153256b99d2e5410b4f70b69eb0 | e723c13a54aacc47b0ced394a901957b81a33e9e | refs/heads/master | 2023-07-19T21:09:40.376273 | 2019-04-23T01:21:22 | 2019-04-23T01:21:22 | 176,800,218 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 457 | py | StirlingS2.py | import sys
def StirlingS2(n, k):
if k == 1 or k == n:
return 1
elif n < k or k <= 0:
raise Exception("StirlingS2 was passed invalid input: n=" + str(n) + ", k=" + str(k))
else:
return StirlingS2(n-1, k-1) + (k * StirlingS2(n-1, k))
if __name__=='__main__':
for n in range(1, 12)... |
900e7371f14d916834d9f5a510fb7f81cb0c6956 | 27835ef20e83c8e39f60ea6f8f74ed96bc39540c | /yatube/users/tests.py | 6cc913a0568a4b4cea8b05272de3e325bf6d8b3a | [
"BSD-3-Clause"
] | permissive | matveymex/yatube-1 | d008a6170f206e215a330917eef82df1ca6f4f17 | 746a6b8b57c58a5cab23999b46ca2e81019aa9c6 | refs/heads/master | 2023-01-10T17:17:15.368139 | 2020-10-30T07:44:33 | 2020-10-30T07:44:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,416 | py | tests.py | from django.test import TestCase, Client
from django.core import mail
class ProfileCasesTests(TestCase):
def setUp(self):
self.client = Client()
self.client.post ('/auth/signup/', {'first_name': 'Test', 'last_name': 'User',
'username': 'TestUser', 'email': 'mail@mail.ru', 'password1':... |
f10775f770c816178f9ebd1bc0d5573e10e7a1e8 | 705e3557aa1cce2fe05ef8db2f2b556b89fe5592 | /example_folder/trace.py | fe900291a4f86880ff2765cf2076a6a3c77f2606 | [] | no_license | jmcunnin/tracking-ctl | 6d1b488ffab633d9ad724ffa553a96a95695757c | a49ef919d7b8bf247376bbfd8b9f80e75e259591 | refs/heads/master | 2020-12-30T09:38:13.571822 | 2015-06-23T04:05:18 | 2015-06-23T04:05:18 | 33,621,821 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 625 | py | trace.py | #!/usr/bin/env python
import sys
from copy import deepcopy
class trace_object:
### trace_object is an object to keep track of individual paths
###### it is defined by a list of stays, a list of trips, and a string identifying it
def __init__(self, stays, trips, trace_id):
self.stays = stays
self.trips = trips
... |
dff40695cca8cbac3121d7e8214bbe2aa8575cd4 | c031ae1a20c4a6a2bfd03e06cf4d2c7c5c2574df | /GC/highest_gc_content.py | eb6331eff9c33f6a6cd52352af26d3015858fe3e | [] | no_license | lucianoinso/bioinf-rosalind-problemset | 6f60c251c812a7589558edfc9edddb17fec2d6c3 | f32cd63a72f8831e298fa3a9949d3f236def8c3c | refs/heads/master | 2022-12-02T14:56:42.810952 | 2020-08-23T07:49:00 | 2020-08-23T07:49:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,731 | py | highest_gc_content.py | def strandGContent(seq):
return ((seq.count("C") + seq.count("G"))/len(seq))*100
def parseFasta(filename):
strandList = []
f = open(filename, 'r')
# Save the lines without the jumplines '\n'
lines = f.read().splitlines()
for line in lines:
if (line[0] == '>'):
strandList.... |
5362431f45447880e56e178ea0e7cba193753e2b | 9afeac89a4a4c2129dc999237a06f072171aae9b | /machineB.py | ff59f308219a0980ac5399f443cfdaf6c9cb437f | [] | no_license | matejpokorny/diffie-hellman-demo | 950649e0fa8132cfdb0f214cb7e28ca8c82dc057 | aa122c22abbd24d763ba3d3696322be7562caa4d | refs/heads/main | 2023-08-17T15:34:01.302371 | 2021-04-12T15:16:35 | 2021-04-12T15:16:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 820 | py | machineB.py | # Matěj Pokorný, leden 2021
from random import randint
def main():
# 1. Domluveni se na modulu m a zakladu z
m = input("Zadejte modulo urcene strojem A: ")
z = input("Zadejte zaklad urceny strojem A: ")
print("Modulo je " + str(m) + "\nZaklad je " + str(z))
# 4. Vyber tajneho cisla b
print("\... |
e2abf4c91ea97637981c2b573ec79886ae905ac5 | ba7cd62bc577bbafef73e8be6e400cbdcca066f6 | /calculo_Theo/main.py | f10846bbf0a1f8cee86f477aeca9416cb2eefb3d | [
"MIT"
] | permissive | Future-Aperture/Rodrigues_Online | 93d52e445c6b8f6cfde25340b4965f3c1a93ac5b | d6c355eac299737d507fb2de05caa185b02070c5 | refs/heads/master | 2022-12-01T00:54:10.328802 | 2020-08-20T16:14:34 | 2020-08-20T16:14:34 | 286,541,590 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 646 | py | main.py | from functions import menu, titulo, lin
titulo('CÁLCULO')
menu()
while True:
try:
op = int(input('Sua opção:\n> '))
except:
print('Digite um valor inválido.')
if op == 1:
print()
titulo('opção 1!')
p = float(input('Preço do item R$: '))
peso = flo... |
8b4943ed938d632e2dcdc8f7ab44ff443274741b | e60d80c00decadf99a7e4551c76b0bbc83ab9c86 | /tests/iiwa7/iiwa_materials.py | 5f1c549a258ad1fd99e6a8628d67d2a3c503c092 | [] | no_license | hauptmech/odio_urdf | 992a8ad35626a41c10c5f6afeb91aecbf4be8e78 | 8039543c5d4d66182f242313402ae84e38a5c8ea | refs/heads/master | 2022-11-18T04:04:46.234123 | 2022-11-13T09:28:37 | 2022-11-13T09:28:37 | 58,005,206 | 77 | 16 | null | 2023-09-09T13:36:05 | 2016-05-03T22:20:55 | Python | UTF-8 | Python | false | false | 2,224 | py | iiwa_materials.py | # odio_urdf definition of iiwa7
# Copyright 2016, hauptmech <hauptmech@gmail.com>
#
# Data copied from iiwa_description by Salvo Virga <salvo.virga@tum.de>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permit
# ted provided that the following condition... |
782ddb749431a08e084a5377c8f0f726dd79a3f3 | 8d161515037cd42dcd6404a068620c11b2597ae8 | /LeetCode/Sorting/daily_temperatures.py | a936b61d66951d1c3b49fa764a5909b670b14b57 | [] | no_license | YiseBoge/CompetitiveProgramming | 433526d18a7bfe754f9e1c8d20b2b234d7b7568c | 26b720623bcc1afe054101a13ca37b65ff518ce1 | refs/heads/master | 2021-12-03T17:52:00.048476 | 2021-11-23T17:40:14 | 2021-11-23T17:40:14 | 225,392,780 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 802 | py | daily_temperatures.py | import sys
def daily_temperatures(T):
count_temp = [[] for i in range(71)]
for i in range(len(T)):
count_temp[T[i] - 30].append(i)
result = []
for i in range(len(T)):
mini = 30001
for j in range(T[i] - 29, 71):
while count_temp[j] != [] and count_temp[j][0] < i:
... |
614e612d370b252562108a67358f9aef48a1de2a | 3129b81f08f6a6f95fbb883dccec8e73ab7e7375 | /app.py | b8df8cd78edaf643c111806d06007d52b98e8ec8 | [] | no_license | audiodude/beg-neon | 4597034ecfd8e9c356091d1fb70b3e2157960e47 | 484a9dd3a9714ee5861fd480340cac9be6365fc2 | refs/heads/master | 2021-01-18T23:56:33.792382 | 2017-04-04T01:11:44 | 2017-04-04T01:11:44 | 87,135,018 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,504 | py | app.py | import random
import re
import flask
from twilio import twiml
app = flask.Flask(__name__)
BANNED_PINS = [
'12345678',
'87654321',
'12341234',
'43214321',
'12123434',
'123456789',
'987654321',
'1234567890',
'0123456789'
'987654321',
'0987654321',
]
@app.route('/init', methods=['GET', 'POST'])
... |
eb7ae2dd15ff360640d3f0ec5273b33b6fe9aaec | 7b679ceebd61acd413d35a45ca74df8234d32328 | /Alexnet-ranking/ranknet.py | db138f4c72c63c17c571bbd2ffdac6e2694c972e | [] | no_license | gdp953456352gh/pairwise-DCNN | d4b625713596126cc5fb13830a899cdb434c6c54 | f3f2da6f861e0a8e72827ba8c203649a8763c1a0 | refs/heads/master | 2020-03-17T07:40:43.179355 | 2018-05-20T18:26:54 | 2018-05-20T18:26:54 | 133,408,201 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,976 | py | ranknet.py | import numpy as np
from keras import backend
from keras.layers import Activation, Add, Dense, Input, Lambda
from keras.models import Model
from keras.models import load_model
from keras import backend as K
INPUT_DIM = 1000
# Model.
h_1 = Dense(1000, activation = "relu")
h_2 = Dense(512, activation = "relu")
h_3 = Den... |
55eb705f2f2a1a0706462b95e58f9eaede1142f0 | c4a41d9101d9e9dc826a3216cf0dab86048325b1 | /GeekTime/search_engine.py | bb912d8b84994523b1d606d876b28a06b3e63669 | [
"Apache-2.0"
] | permissive | xxwqlee/pylearn | f8a2d736e01694fd846564a53082e51215ca8f1f | 6eb9ad61bc68b3d0ca0b093f9876df3105efd98e | refs/heads/master | 2020-04-28T15:43:37.232772 | 2019-06-24T04:59:29 | 2019-06-24T04:59:29 | 175,385,796 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 6,162 | py | search_engine.py | """
Create a simple search engine:搜索器、索引器、检索器和用户接口
语料(corpus)、倒序索引(inverted index)
模拟敏捷开发过程中的迭代开发流程
合并K个有序数组
LRU缓存
"""
import re
import pylru
class SearchEngineBase: # 搜索引擎基类
def __init__(self):
pass
# 读取文件内容,将文件路径作为ID,和内容一起送到process_corpus
def add_corpus(self, file_path):
... |
fbeec8ba22802ed0674da6d58edddd6675db6c31 | dd1614963c5ceebe2a56f960ece82698147c4dee | /PycharmProjects/CNN/computation.py | bc45fe4277d93d977b1025eb479be8e8b6b9a988 | [] | no_license | jiaxinLin92/test | 904fa0fd2a6fa82c3cc0a9d2f9218620b46ae2a3 | b7c84ab681c40a184012a9b9f1af1d52ab488a49 | refs/heads/master | 2020-12-30T14:12:26.291446 | 2017-05-15T02:02:05 | 2017-05-15T02:02:05 | 91,284,472 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,495 | py | computation.py | # -*- coding: UTF-8 -*-
# import tensorflow as tf
# a=tf.constant(4,name="input_a")
# b=tf.constant(3,name="input_b")
# c=tf.add(a,b,name="add_c")
# d=tf.mul(a,b,name="mul_d")
# e=tf.mul(c,d,name="mul_e")
#
# sess=tf.Session()
# print (sess.run(e))
# #writer=tf.train.SummaryWriter('./Users/Jessie/Desktop/my_graph',se... |
c705d8b4e03d2391d2969720cde6c885af37ebc5 | c88a67d802e40d390f1a3a136471c970a984fb1f | /lab2/Main.py | 599bbe162fd2cbb9edca2daa443df89e48930b88 | [] | no_license | TarasBilous/PythonLabs | 758602681f461d02fe1c5ef32a87667ade331bd0 | fe7ea1ac86fa8b49b92274895a4f9fb3877b94e9 | refs/heads/master | 2020-03-19T01:29:07.438168 | 2018-05-31T07:40:36 | 2018-05-31T07:40:36 | 135,549,056 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 741 | py | Main.py | from Plate import *
from FryingPan import*
from Pan import *
from Cup import *
from Cutlery import *
from PartyManager import *
manager = PartyManager()
plate = Plate(DishesType.KITCHENWARE, Material.CERAMICS, 0.5, "plate")
fryingPan = FryingPan(DishesType.TABLEWARE, Material.METAL, 2.5, True, "fryingPan")
... |
06dffd6f3eb475fce5c7ad40b2e57dce8454caa1 | ca7aa979e7059467e158830b76673f5b77a0f5a3 | /Python_codes/p03959/s828420029.py | cee0fede966b79bf99dc01babb77aa21c85e78c1 | [] | 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 | 720 | py | s828420029.py | p = 10**9+7
N = int(input())
T = list(map(int,input().split()))
A = list(map(int,input().split()))
H = [0 for _ in range(N)]
cnt = 1
H[0] = T[0]
for i in range(1,N):
if T[i]>T[i-1]:
H[i] = T[i]
if H[-1]>0 and H[-1]!=A[-1]:
cnt = 0
else:
H[-1] = A[-1]
for i in range(-2,-N-1,-1):
if H[i]==... |
6e745512b327e4b4b83c8add2d9d7e015ecbafa9 | 6a7be15f043d24178fc7d9502da5aedd550c5ba5 | /titanic/pipelines/data_science/pipeline.py | 7c2288fb6da9997d8ddc98bdbfc165b7a90ec6ea | [
"MIT"
] | permissive | Ryusuketa/titanic | 0f34b4565592c46da93f48fc6727b0d5ecc19a96 | fb359ab562633ba5b61c43dee526399146355578 | refs/heads/master | 2023-03-02T14:15:08.028737 | 2021-02-06T08:58:00 | 2021-02-06T08:58:00 | 336,494,245 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,256 | py | pipeline.py | from kedro.pipeline import Pipeline, node
from .evaluation.evaluate import run_evaluation
from .parameter_search.search_parameter import run_parameter_search
from .model.inference import run_inference
from .model.train import train
def create_training_pipeline(**kwargs):
return Pipeline([
node(
... |
8e62c894bac1c76bc32349d9dfa440ba8c67a954 | fbfcfd8ffdd76492d218ef5e553c3cf2f258197a | /NetworkSearch2/common/logging/utils.py | cc8439f12b9880d51d51bdf76f6b40420a389a24 | [] | no_license | cseminhaj/NetworkSearch | 733fbffc0fd61b7166dd9c65bf1c28c5a25f3add | 7369d16562d298d06a3e73b2641b2ea432dba6ac | refs/heads/master | 2016-09-02T00:25:43.277079 | 2014-04-14T05:07:34 | 2014-04-14T05:07:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 139 | py | utils.py | def isstr(instance):
if isinstance(instance, str) or isinstance(instance, unicode):
return True
else:
return False
|
6a40ac7544686878b39ee84dc391d1fd7db260c8 | a89e2ddc2ede8300c98a7265c605e28db3611a66 | /PySnake-term/PySnake.py | 9fb9c07a74e75ad20657b0fa062e983dcb1ee3a3 | [] | no_license | AILearnerNTHU/PySnake | 97c51bc77b2b418ba5054e59088ad85af58a4554 | 9295f75c2cc4e38d76a43a461825572eba5c64dc | refs/heads/master | 2020-03-30T19:49:02.750937 | 2018-10-18T13:28:55 | 2018-10-18T13:28:55 | 151,539,328 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,855 | py | PySnake.py | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 17:39:38 2018
@author: Computer-User
"""
from pynput import keyboard
from PySnakeGame import Map , Snake , SnakeDirection ,GamePad
#import GameMode
import GameScreen as gs
class PySnakeGUI:
#Select mode of game
# mode = input("Which mode would yo... |
d83161cbd321f5184baab387f2e80e793b6f9ca0 | 44c31a17693403420b3652d323cb9d4b86b4e745 | /Python/9.py | 3ef6138e9761e29acd0cd700b4306f882208570b | [] | no_license | EkremDincel/Project-Euler | 577d92ed4f1b510dbf36849e2e3bf57c2d7312b2 | 230246eb6052bbead8699f125e604ba139b2bc79 | refs/heads/master | 2021-04-11T11:46:52.693410 | 2020-12-07T19:34:02 | 2020-12-07T19:34:02 | 249,017,150 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 441 | py | 9.py | from math import sqrt
from utils import number_combinations
def calc_hypo(a, b):
c = sqrt(a**2 + b**2)
return 0 if c%1 else int(c)
for a, b in number_combinations(1000, 1000):
c = calc_hypo(a, b)
if c and a+b+c == 1000:
print(a * b * c)
break
## if c := calc_hypo(a, ... |
0aabb81720f3f61922c49420cf83471fe00e1824 | b8970b205be401789b644dd4cda5fd96c49b9ce4 | /AD/python/protect.py | 370add85bcce163dba72e2dba3f1341ed46427d2 | [] | no_license | v1cker/CTFtools | bcdbf66e61ab417884d3fad643fccf10a9eabf2d | 5ad446c404f0dee0e144d18f4906636f90e3c1dd | refs/heads/master | 2021-07-17T20:00:59.474601 | 2017-10-26T08:29:32 | 2017-10-26T08:29:32 | 110,318,976 | 4 | 1 | null | 2017-11-11T04:51:58 | 2017-11-11T04:51:58 | null | UTF-8 | Python | false | false | 981 | py | protect.py | #! python
import os, sys
import shutil
import time
import getopt
base = ''
ignore_type = ['jpeg']
if len(sys.argv) > 1:
base = sys.argv[1]
else:
print 'need dir'
dirs = {}
def get_files(now):
global dirs
nxt = os.listdir(now)
dirs[now]=nxt
for s in nxt:
to = os.path.join(now,s)
... |
7eb1064ebd3f7e3574a89831242c443a836057f6 | a3622a303cf353fa5997085feb8b60aae92b6a9a | /sensors/urls.py | a0235cc230851e1531cbdf1a244b601311c56275 | [] | no_license | TheFormulaCruisers/UI-remote | fed37c2ae7419243bdee7ab49c7c5037a59e6191 | de2e3f0aacc197f16c9e57faefe18d909448b123 | refs/heads/master | 2021-01-03T20:21:43.799979 | 2020-02-18T11:05:54 | 2020-02-18T11:05:54 | 240,223,325 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 157 | py | urls.py | from django.urls import path
from sensors import views
urlpatterns = [
path('', views.index, name='index'),
path('<int:sensor_id>', views.sensor)
]
|
498835b57f30bee5fd2c5b2d631cf8c887e334cc | 404420843f663918ac18e0f2e4ecb9a4d16dec30 | /min_maxing.py | 24ff7b10265dc80ba9e97a270961cf82c9f068d2 | [] | no_license | vdpham326/Python-Challenges | fa04efd331d38ddd5a5d504230038bdc370cb597 | 3be26b9efa0ddc9af7cf307c55ed146e73511261 | refs/heads/master | 2022-11-17T14:16:35.290927 | 2020-07-06T09:44:44 | 2020-07-06T09:44:44 | 277,206,744 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 955 | py | min_maxing.py | def largest_difference(l):
'''
Define a function named largest_difference that takes a list of numbers as its only parameter.
Your function should compute and return the difference between the largest and smallest number in the list.
'''
# largest = smallest = l[0]
# for index in range(1, len(l... |
4e9be5005bd09893535c979416ca00130a721b73 | 1ca27fadf7b9ba8755da6ffe5c63a7a55b0b3bbe | /CodigoJesus/ProgramacionFuncional/filter2.py | 65dc76a820c88811cdf380566e3f7c792920845b | [] | no_license | xexugarcia95/LearningPython | d11b91040ce909727206d5e59fe010341299d04a | adf20fccf0b7c3e4e9077d55abb3b9b5475f14b2 | refs/heads/master | 2023-01-24T01:10:48.784039 | 2020-11-21T01:02:57 | 2020-11-21T01:02:57 | 297,922,804 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 132 | py | filter2.py | tupla = (2, 3, 8, 1, 5, 6, 9, 4, 1, 7, 5, 4, 10)
resultado = tuple(filter(lambda elemento: elemento > 5, tupla))
print(resultado)
|