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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
69d42d7ed2d675c647184bb6455c10c83f8c49bd | cd9735c899dc62c56a15e17a2110ffa8e7447071 | /jmms/calculadora.py | 57e4faa42dc2ed65bd1556899a6b4c4be393e10d | [] | no_license | jmm-travis-org/python-travis-test | 3ec95cd4be1cd7ec7bd92bb82a0881dc7a22d75c | 1365c14af55b95718f803fac0632331f397d71ae | refs/heads/master | 2020-03-30T07:27:03.339024 | 2018-10-05T21:20:31 | 2018-10-05T21:20:31 | 150,940,511 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 180 | py | calculadora.py |
class Calculadora:
def suma( self, a , b):
return a + b
def resta (self, a , b ):
return (a - b)
def por (self, a, b ):
return ( a * b ) |
278baff12121f17487a370fa4e467255c376c865 | 61a7c672e1ae52b731a821758091e34901c2bef0 | /tools/set_photo_captions.py | 2f3e70a23fdb6f52c4fa12341e4d98a4a89f0677 | [] | no_license | trip20092010/site | d9bb0599bd111dac253a9af463e39caf1142c02e | aed511de6cf151b77eb68d17dfc50a94d8642183 | refs/heads/master | 2021-01-20T11:47:00.740793 | 2017-09-03T22:15:03 | 2017-09-03T22:15:03 | 101,686,559 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,636 | py | set_photo_captions.py | #!/usr/bin/python2.5
import sys
from collections import defaultdict
import gdata.photos.service
import gdata.media
import gdata.geo
summaries = defaultdict(str)
# Create photo_title -> photo_summary mapping from a flat file
fn = sys.argv[1];
album_title = ""
for l in open(fn):
fields = l.strip().split('\t')
if le... |
c51e5cf2f63435678b10722c00156a7abd30ca7c | 2663a241433baad0bfc99cb7c04cb5e99c3a9788 | /Metrics.py | 0dede72b0be8e6b76e93c71054c68f0de7d643dd | [] | no_license | niryakub/Cancer-Cell-Segmentation | c5ec946c7bce98e55395dcbaa9cfaac61986f39c | 58bb80f01e1fa86f03e05db522220ab0adb8f5b3 | refs/heads/master | 2023-07-24T02:58:16.926893 | 2021-09-02T14:08:35 | 2021-09-02T14:08:35 | 402,787,379 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 1,302 | py | Metrics.py | import torch
import torch
def calc_eval_metrics(outputs: torch.Tensor, labels: torch.Tensor):
# You can comment out this line if you are passing tensors of equal shape
# But if you are passing output from UNet or something it will most probably
# be with the BATCH x 1 x H x W shape
# TP == INTERSECTI... |
b77a4c0328ff79295e8fd0cabfa22508747dd6eb | 6a67dbd9f56080fd3ae3fd709dbcb25a1ec6d815 | /familyapp/admin.py | 0fc0af2b82e9d582653c0818f305ca3ba280c5b7 | [] | no_license | leilahassan/family-fab | c5e647f063e9f9861935f76efb1b43ce85a5164c | 15670728ec048ad34e20c5e6bdb1c5a8bdccfd6b | refs/heads/master | 2021-01-01T18:16:05.061253 | 2017-07-25T09:40:40 | 2017-07-25T09:40:40 | 98,290,084 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 127 | py | admin.py | from django.contrib import admin
# Register your models here.
from familyapp.models import Family
admin.site.register(Family)
|
87a7d6e78b9c675a48bee335b3126cfe94b01bcf | a3a3cdb7571b82e65eecf5ceb31ecebc68bdd85e | /setup.py | d8aa99b8899f12a5c7497154ab2fd56f28f52228 | [
"BSD-3-Clause"
] | permissive | bioinformaticsbejo/jupyter-vscode-proxy | b7f4aceb2848dbad1bd1332b818882b5fb9dd1ed | 4ded872dcbacdbf28e67c43b387b9c952212a7b5 | refs/heads/master | 2020-05-09T09:58:40.298189 | 2019-04-12T15:14:53 | 2019-04-12T15:14:53 | 181,024,435 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 661 | py | setup.py | import setuptools
setuptools.setup(
name="jupyter-vscode-proxy",
version='1.0dev',
url="https://github.com/bioinformaticsbejo/jupyter-vscode-proxy",
author="Ryan Lovett; Yuvi Panda; Saulo Alves @ Bejo Zaden BV",
description="Jupyter extension to proxy VScode session",
packages=setuptools.find_p... |
88bae3144ca8daa410e02fe74c036862143bda7b | f0bbca88acab9f75a534c8b228f04abac33735f3 | /python/686.RepeatedStringMatch.py | f45786e80212662c30b6a54af28a772d92a0caa8 | [] | no_license | MaxPoon/Leetcode | e4327a60d581f715a7c818b8e8e8aa472ed776c1 | 15f012927dc34b5d751af6633caa5e8882d26ff7 | refs/heads/master | 2020-09-17T05:33:13.877346 | 2019-05-09T04:34:54 | 2019-05-09T04:34:54 | 67,481,937 | 15 | 8 | null | null | null | null | UTF-8 | Python | false | false | 298 | py | 686.RepeatedStringMatch.py | from math import ceil
class Solution(object):
def repeatedStringMatch(self, A, B):
"""
:type A: str
:type B: str
:rtype: int
"""
n = int(ceil(float(len(B))/len(A)))
s = A*(n+1)
i = s.find(B)
if i + len(B) > len(A)*n:
return n+1
elif i >= 0:
return n
else:
return -1
|
7f99ce750b173c0307fc3f5143b922d59b29dd34 | 97301e5402d41199982de15178674b554d496465 | /deep_model/train.py | 35f796dc334d311f14ad5aa58249bed7400139f6 | [] | no_license | UCAS-IR-gogogo/TREC-project | 485c8c475edc84454d1f5edd8049353a628925a3 | 135228a24253ad92633d00de09f6e89092d811bb | refs/heads/master | 2022-12-22T16:05:26.472962 | 2020-01-01T07:27:20 | 2020-01-01T07:27:20 | 227,135,254 | 1 | 0 | null | 2022-12-08T07:01:53 | 2019-12-10T14:03:55 | C | UTF-8 | Python | false | false | 9,526 | py | train.py | from sklearn import metrics
from data_utils import build_tokenizer, build_embedding_matrix, ABSADataset
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
# from tensorboardX import SummaryWriter
import matplotlib.pyplot as plt
import datetime
import argparse
import math
import os
from models.c... |
310019aaa345e9d659e183b976f129fdb8a11815 | 3e1f2a50f3f3e72789824f4abb7bf650a5f679bc | /lantern/client.py | ec21d9ee57f8e543dbe6c0f371462c227ad8e593 | [] | no_license | wuxirenshi/lantern | 1563aee182c9d63c93563f0b1bfb69f879c25795 | 289d90b261290a378f4055d0d2882064d41582b1 | refs/heads/master | 2021-01-11T10:12:03.529125 | 2017-04-20T12:53:18 | 2017-04-20T12:53:18 | 78,601,852 | 4 | 3 | null | null | null | null | UTF-8 | Python | false | false | 1,331 | py | client.py | # -*- coding: utf-8 -*-
import time
from locust import events
from thriftpy.rpc import make_client
import thriftpy
class RpcClient(object):
def __init__(self, service, host, port):
self.client = make_client(service, host, port)
def __getattr__(self, rpc_method):
func = self.client.__getattr_... |
d9ce3dd98d7df021cd0859ac69c18bb0f179c3a7 | 92a1de3a321bb1d880e26c4f05800d721eb251d3 | /Python_scripts/deep_network2.py | 229d5550ce1e21550bde1c6ec861cc2d078a1435 | [] | no_license | viveksgr/Rotation1 | 27a639a0936b235e0dc618da333f89fbd9cbcd3b | ed1cd9989198792bb84d0c3f05df698b0be4e75a | refs/heads/master | 2021-01-12T17:30:30.615548 | 2016-12-07T22:38:00 | 2016-12-07T22:38:00 | 71,586,300 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 8,335 | py | deep_network2.py | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 18 11:49:33 2016
@author: viveksagar
"""
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
#from sklearn import cross_validation
with np.load('Pre_processed.npz') as data:
X1 = data['X1']
X2 = data['X2']
duration = data['X3']
all... |
e8dd30c80d5194dbf3582336681d004daef0ee01 | 77f0a86f5512951208752faa209aaad16352abfc | /freeaddr/views.py | 8f809fa55c40267b84c9947254569bcfb8076242 | [] | no_license | vsmaksimov/wcity | 8a7e34be17aad000069154aca67ae050f45aac63 | 2e8f7c556a4884cc34130e196abf9e6dcd21a2e1 | refs/heads/master | 2020-05-12T17:19:15.672962 | 2019-04-26T13:41:23 | 2019-04-26T13:41:23 | 181,537,285 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 954 | py | views.py | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render
from .models import FreeAddr
from random import uniform
from decimal import Decimal
def index(request):
# free_addrs_list = []
# free_addrs_list.append({'coords': '55.78 37.57', 'address': 'Moscow, Yamskogo polya... |
eac5554bf6fa93c348ef13913eafb383df023987 | f91ae15e969a309af8965b00b256d6ccb6771c57 | /apps/history/models.py | 93048d5178dff4083f64eb26dfeeace85b0e617f | [] | no_license | icorecool/myjiapu | c82834abd18b4671d16ce55253a02ec5a262cdfe | 183a626471b97db7410d4f394eb01860d48488d4 | refs/heads/master | 2022-10-09T16:53:55.096657 | 2020-05-25T04:25:53 | 2020-05-25T04:25:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,868 | py | models.py | from django.db import models
from apps.users.models import BaseModel
# Create your models here.
GENDER_CHOICES = (
("male", "男"),
("female", "女")
)
MIGRATE_AREA_CHOICES = (
("unknow", "未知"),
("xuan_wei", "宣威县"),
("fang_zhu", "放珠镇"),
("mai_bai", "马摆乡"),
("guan_zhai", "马摆官寨"),
("hou_cao... |
7c18d71d87885ab4ccbac65bf0f3508604976c7a | 6acea1c5206052393beb5cba132f40e55b637c11 | /doc_curation_projects/misc/sanskrit_docs.py | 690682044ac843e6cbe8c55fd8a2ee77ba44f598 | [
"MIT"
] | permissive | sanskrit-coders/doc_curation | a44afacf68d1711bcebd02c97b30a42b6d82bccc | db330393d3df052c008811f4b442421900e5fa84 | refs/heads/master | 2023-08-27T09:41:22.784001 | 2023-08-11T05:40:46 | 2023-08-11T05:40:46 | 157,027,340 | 8 | 4 | MIT | 2022-12-08T08:26:49 | 2018-11-10T22:32:26 | Python | UTF-8 | Python | false | false | 279 | py | sanskrit_docs.py | from doc_curation.scraping import sanskrit_documents
if __name__ == '__main__':
sanskrit_documents.markdownify_all(src_dir="/home/vvasuki/sanskrit/raw_etexts/mixed/sandocs-dump/sanskritdocuments.org", dest_dir="/home/vvasuki/sanskrit/raw_etexts/mixed/sandocs-dump-markdown") |
f34cff0c8ad9bf7783ded44480c388f616d5de64 | ab726c685591f60ed83b9e3a5d4e34484026d9d5 | /crawl_utils.py | 58a6753f0857a19049e622eec3c9f2cacb360fa8 | [] | no_license | crawl/dcss_tourney | 143e44a57b8424609bbb508a02bcaa7e8a90ae3c | ac820c63cc29619154ace8469677fa255c4a3988 | refs/heads/master | 2023-06-11T11:23:47.565405 | 2023-06-03T02:10:48 | 2023-06-03T02:10:48 | 1,683,418 | 4 | 6 | null | 2023-06-03T02:12:38 | 2011-04-30T01:50:38 | Python | UTF-8 | Python | false | false | 8,323 | py | crawl_utils.py | import os
import os.path
import logging
import fcntl
import sys
# Update every so often (seconds)
UPDATE_INTERVAL = 7 * 60
# Are we testing locally? If so, use file:/// urls. The urls will be have the
# script working directory and then the SCORE_FILE_DIR added.
#
# If we're not testing locally and hence want output ... |
34393beb9cada06bae8090240bd4837ce0059a1c | a4dd149ecf620623eb0e50ea0656ee63e22440a0 | /reserve/one_step_loop.py | e1ef5b4b6079b0649f237c47d3e3cde2d75146bc | [] | no_license | mylifecode/algorithms | 558a357931a3af0490c9554070f1c811426a7011 | d6b7a91233961794c941a40a8e7fcb409ec1126b | refs/heads/master | 2020-05-03T07:36:42.658583 | 2019-03-30T03:04:30 | 2019-03-30T03:04:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 242 | py | one_step_loop.py | def fn(n):
if n==1:
return 1
elif n==2:
return 2
else:
a,b=1,2
for i in range(3,n+1):
a,b=b,a+b
return b
def main():
result=fn(40)
print('result:',result)
if __name__=='__main__':
main()
|
ba6d0c2a312aed563a2b731ecf143b07a86a3c2f | 828bd40f2b500416fd679949bc06648fdf40a7e0 | /loadonemc.py | ff76926a80e7060ff9ab208c672d25f4d1858e76 | [
"MIT"
] | permissive | fameshpatel/olfactorybulb | f513c480a1010c1a30911f12a3e4cf8ab5059dee | 8d7a644b4560309ef177c0590ff73ed4c2432604 | refs/heads/master | 2023-07-24T16:35:15.855708 | 2019-09-24T19:22:26 | 2019-09-24T19:22:26 | 212,605,801 | 0 | 0 | MIT | 2023-07-06T21:23:06 | 2019-10-03T14:51:17 | Jupyter Notebook | UTF-8 | Python | false | false | 161 | py | loadonemc.py | from prev_ob_models.Birgiolas2020.isolated_cells import *;
mc1 = MC4();
gc1 = GC1()
#del mc1
from blenderneuron import neuronstart;
from neuron import h,gui
|
ba9507aabf6ca222aba691f59a5578715c6a2054 | a49c54adc5100bbe51894fdd59998fb286104613 | /app/goods.py | b6c65df151fedeadc0ab9ef3924341ac40e9d03e | [] | no_license | giwatest/pintuan | 112b873969ec141e2097c2a2f6450a26fade29b1 | f43643edd15ccf951cc5f4618f307799d3e551ec | refs/heads/master | 2020-04-07T06:58:07.636639 | 2018-11-20T05:19:16 | 2018-11-20T05:19:16 | 158,157,902 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 961 | py | goods.py | from flask import Blueprint, render_template, redirect,request
from app import db
from app.models import Goods
import json
from app.AlchemyJsonEncoder import AlchemyJsonEncoder
from flask import jsonify
goods = Blueprint('goods',__name__)
@goods.route('/getGoods',methods=['GET','POST'])
def getGoods():
goods = ... |
7fd5d162ff0c85f4750fe2613587492208eedd97 | 3ba7b96608d8c6c91f282953e2b2436f582966e7 | /python-study/range.py | 2458da74ea2f53dbabc9639350213009e3cd3278 | [] | no_license | bijp/pycharm | d3f68debf490b56461dde486586a5b22848b747e | 49ae812d2eae041d79c74faee526a481676a9e3f | refs/heads/master | 2020-05-26T02:03:18.752223 | 2019-05-26T15:05:32 | 2019-05-26T15:05:32 | 188,069,678 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,198 | py | range.py | # for i in range(1, 10):
# for j in range(1, 9):
# j+=1
# print('{}x{}={}\t'.format(j,i,i*j),end="")
# print()
#
#
#
# print(('%10d',126))
# inputStr = input('Please input student age info:')
# studentInfo = inputStr.split(';')
# for one in studentInfo:
# if ',' not in one:
# contin... |
63eb12f32a50514b2f5c2e176bbf4b1e2ff397b4 | 4b2c06fa6634f6f8fd87e6bbdf3689139f24628c | /lib/test_alg.py | faba66420bc303bcdc3d7b8ce1ed439983980700 | [] | no_license | stephenwan/adventofcode2018 | 6d674bc44fb16a8c1b6de5022459db258c0cfd98 | a1662bf2178c84d4987a2a7597ad5ced86f19ca3 | refs/heads/master | 2020-04-13T14:05:50.474858 | 2018-12-27T05:40:06 | 2018-12-27T05:40:06 | 163,251,406 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,490 | py | test_alg.py | from lib.alg import bfs
def test_bfs():
graph = {
3: [1, 4],
1: [5, 7],
4: [9],
9: [10],
10: [12, 16]
}
def lookup_children(node):
if node not in graph:
return []
return graph[node]
result = bfs(3, lookup_children, with_path=True, w... |
6581777750a3976577d6d1965fcf20bf3c337587 | 285ed25b4dabc93a31b23f7cd7fc02e95a0911c2 | /num_game.py | 2f73f4d1b16e03cc0b7729800747fbfe2199afae | [] | no_license | cbaermann/great_number_game | a18d39482860cda562fd91a904c852ea01eea6de | c028d3f31431ab62fd7cd798972b6a32b35b33c6 | refs/heads/master | 2020-06-16T03:57:26.961345 | 2019-07-05T22:44:48 | 2019-07-05T22:44:48 | 195,473,230 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 857 | py | num_game.py | from flask import Flask, render_template, request, redirect, session
import random
app = Flask(__name__)
app.secret_key = '0331'
@app.route('/')
def home():
session["number"]= int(random.random () * 100)
return render_template("num_game.html")
@app.route("/guess_again")
def guess_again():
if session["an... |
75c79a606ee4cb276a96ca5a15fdec933b02614d | a3be1d8854d1b20520a8d03d0873f90ae4f664b8 | /Tests/Ultrasound Test.py | 6233a44e9f7a05982b9cc70a2171a43c93676620 | [] | no_license | Team-Orion-Robotics/Robot-Code | ac0a46ec3d3f3a0b65b1159aed4610fe6a34d086 | 3c5e6d8d365cbb1f4d6fdf68f871abe15b372f39 | refs/heads/master | 2021-09-13T03:11:49.256648 | 2018-04-24T10:24:27 | 2018-04-24T10:24:27 | 117,354,827 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,179 | py | Ultrasound Test.py | def US(Mod):
# needs to be checked on the day that the echo and trigger pins are correct for each module
if (Mod == 0):
Trigger = 1
Echo = 2
elif(Mod == 1):
Trigger = 7
Echo = 8
elif(Mod == 2):
Trigger = 3
Echo = 4
elif(Mod == 3):
Trigger = 5
Echo = 6
RUS = r.servo_board.read_ultrasou... |
ca5057a5fdfef0edf4cf0c3ff3e2a371907ca4ee | cb446c40f725bd3048a53c07910fbe186460e4c9 | /PyGUI/PyGUI.pyw | 59eadc55164488d5a7753c81c20aebdf3a48bc8f | [] | no_license | infobound/PyGUI | 63c177130b61783d64bc96a57d281e6b43e9c913 | c7879067b3d5e429911dad53fdba9700479f91c9 | refs/heads/master | 2023-03-30T23:30:00.551827 | 2021-04-09T18:47:41 | 2021-04-09T18:47:41 | 349,204,170 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 359 | pyw | PyGUI.pyw | import tkinter as tk
import tkinter.ttk as ttk
import GUIForm
import sys
def main():
global window
global _form
print("You are using Python {}.{}.{}".format(sys.version_info.major, sys.version_info.minor, sys.version_info.micro))
window=tk.Tk()
GUIForm.BuildInterface(window)
window.mainloop()... |
11a7ebac3dad1f91a6d46b62f557b51ded8e3d7a | 6adae6bddb462955d74fe70405d31142301d28a1 | /python/math/euclidean-space.py | a157a8e0e4a2c6f740209a5fd7e9369b10e32bdf | [] | no_license | yunw/sandbox | f5060e12217cb6091e9d488949160ecaaee2e28e | d4c7359b4c6798eae55adc9480503a7c2c8350cf | refs/heads/master | 2020-05-29T11:07:29.403743 | 2014-01-15T05:05:06 | 2014-01-15T05:05:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 378 | py | euclidean-space.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ユークリッド距離
# http://en.wikipedia.org/wiki/Euclidean_space
# 多次元空間中での 2 点間の距離を探索する
def euclidean(p,q):
sumSq=0.0
# 差の平方を加算
for i in range(len(p)):
sumSq+=(p[i]-q[i])**2
# 平方根
return (sumSq**0.5)
#print euclidean([3,4,5],[4,5,6])
|
ea8676a4c55bbe0ae2ff8abf924accfc0bd8f661 | 1c2531d44c9c00ff27d36ce67bb4554beab0622f | /problems/201-300/p268.py | 9eace9b192f61c4e8cbd2d3fd196d76d72c26dd0 | [] | no_license | zpf0917/euler | c68207094331b41af381de2e08c0990acf9b0f90 | 6f21ef83668370caaf7e8262d9de7fd0efa933e1 | refs/heads/master | 2020-08-29T07:20:36.306580 | 2019-07-13T23:18:07 | 2019-07-13T23:20:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,465 | py | p268.py | from lib.utility import start_time, end_time
from lib.prime import read_primes
from bisect import bisect_left
start_time()
primes = read_primes(100)
# limit = 10 ** 16
import random
# limit = random.randint(1000, 10 ** 5)
limit = 43268
# limit = 10 ** 16
print('limit=', limit)
v1 = set()
v2 = set()
def version_100_i... |
fa081ccd8081f5c3319f482b7d8abd7415d8e757 | 6cadaecca4fc7044348076fe3d7aeccbef96283e | /max_depth_tree.py | b0ba6cc901650da355beae054ae9a30148df9c86 | [] | no_license | nperera0/coding | 4fbb21cc47f93b67a3b1c8e7362fdc47d1562da4 | fa61a9b1fdfbba800ea112ef157653096cb36cb4 | refs/heads/master | 2023-01-20T04:24:21.477659 | 2020-11-25T14:15:28 | 2020-11-25T14:15:28 | 315,776,071 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,103 | py | max_depth_tree.py | '''
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Note: A leaf is a node with no children.
'''
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val... |
af442d4a78930a0ebcd85a1cdfe4aa86461be5c1 | 828becf35e68b0e25e378da0fab07db5019b42dc | /accounts/forms.py | d92ce39c7c73549bf6d26f3af2ed29e7e7825a2f | [] | no_license | jp26jp/TPWD_Project07 | 4a432fba1699a27f7ec6cfc0a09656130fdf0566 | 753ed2cfeaa31b8bb205095678359b63c8622a74 | refs/heads/master | 2023-04-26T04:36:41.033532 | 2019-09-06T02:58:41 | 2019-09-06T02:58:41 | 155,919,773 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,932 | py | forms.py | import re
from django import forms
from django.contrib.auth import password_validation
from django.contrib.auth.forms import PasswordChangeForm
from django.contrib.auth.password_validation import validate_password
from .models import Account
class EditProfileModelForm(forms.ModelForm):
class Meta:
model... |
07a546928df1acfedf7a7735dc813de9da8373e0 | f09c95b099c1feaff1b63246d907319470432e25 | /Parse_By_Line.py | 4f7fcff462e276bc702ae6705b4fa6c4710e5445 | [] | no_license | DSFaber/Parse_File_By_Line | 8617f628366f8f08c0aa8cd60c539ca43011c06c | b40f7d62d7308566c4c7f576e38c5b78ac514073 | refs/heads/main | 2023-01-02T22:54:57.624764 | 2020-11-04T21:27:31 | 2020-11-04T21:27:31 | 310,120,513 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,214 | py | Parse_By_Line.py | ##This script looks at a path for a dated file, then parses it by row into two different files/folders based on fields being blank within each row.
import os.path
from datetime import date
##sets date variables/format
today = date.today()
todayFormatted = today.strftime("%m%d%Y")
print(todayFormatted)
##Se... |
bd00644b9cf019fe8c86d52494389b7f0f03d3c3 | f3bf1d65d799c1482c83bd47c10e1f05a99d3765 | /python/flipper/tests/conftest.py | 7cc93fec4fab6baf74c113bdf05ceeb5c831a89b | [
"BSD-3-Clause"
] | permissive | sdss/flipper | 2c4643cc5a05a9cd2dcc86e2e34c7320eff3453c | f3c9c11615ef508483dd6a0704601c022c74eda4 | refs/heads/master | 2021-11-11T18:48:24.790589 | 2021-11-04T18:29:08 | 2021-11-04T18:29:08 | 136,229,894 | 1 | 0 | BSD-3-Clause | 2021-10-02T20:40:55 | 2018-06-05T20:15:39 | HTML | UTF-8 | Python | false | false | 1,988 | py | conftest.py | # !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2018-08-16 11:43:42
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-08-16 11:58:06
from __future__ import print_function, division, absolute_import
import pytest
import os
f... |
34dd6966a971e3d32e82a17cd08c3b66bb88163b | 62740045bfa7083ea59bc89364b6096d90b49cf2 | /Lecture54_Panupong_S.py | a4474c2468d89bc4a7dfa67cf1729a30ee5b20cc | [] | no_license | kaitaklearn/CP3-Panupong-Saejong | bd24047e1090426b1f6843a772ba6e6168c16f39 | 005fd26ca93655413b2f74ed222d23d09c8928f3 | refs/heads/main | 2023-04-04T19:08:34.504436 | 2021-04-12T07:41:07 | 2021-04-12T07:41:07 | 355,228,881 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,345 | py | Lecture54_Panupong_S.py | def login():
usernameInput = input("Username : ")
passwordInput = input("Password : ")
if usernameInput == "admin" and passwordInput == "1234":
return (showMenu())
else:
print("User or Password Wrong.")
return login()
def showMenu():
print("---Please Choose Menu---")
prin... |
5461d50d3c06bc4276044cc77bd804f6e7c16b3b | ee45871ab078f349c97336b6f1a198c475329be2 | /models/engine/file_storage.py | ac9c2cac4ba9bc81de5ca42cd309a48421fe98ab | [] | no_license | SoniaChevli/AirBnB_clone | 4bcd8b872f753ea2fc80d1665f0f95c420f62473 | bf1b46ff1e7b1d4ade5aa0bfee405b66e8161cc0 | refs/heads/master | 2020-03-19T14:45:41.456229 | 2018-07-01T20:22:54 | 2018-07-01T20:22:54 | 136,638,091 | 0 | 3 | null | null | null | null | UTF-8 | Python | false | false | 1,452 | py | file_storage.py | #!/usr/bin/python3
''' FileStorage module '''
import json
from models.base_model import BaseModel
import models
from models.user import User
from models.place import Place
from models.state import State
from models.city import City
from models.amenity import Amenity
from models.review import Review
class FileStorage:... |
8b671404228642f7ef96844c33ac3cee402bdb19 | 9576655d832e55debd1f136e8752685db3d4e3ee | /shape_distribution.py | 97e53333e51ed76ad0d67d1e7567d1c5e405374e | [] | no_license | afafbioinfo/6RNA_cordero_NMIA_DMS_CMCT | 495e73b4cd287ab00e055e7854836dba40bc0bb4 | 4b84d82f4904d74c747227216a86fcb3e8671a8a | refs/heads/master | 2020-03-10T06:46:44.984475 | 2018-05-28T15:10:46 | 2018-05-28T15:10:46 | 129,246,408 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,015 | py | shape_distribution.py | import os, subprocess, time
from os.path import isfile, join
import shutil # to move files from af folder to another
import math
def GetListFile(PathFile, FileExtension):
return [os.path.splitext(f)[0] for f in os.listdir(PathFile) if isfile(join(PathFile, f)) and os.path.splitext(f)[1] == '.' + FileExtension]
d... |
05eff69d67d35d369bd41d52c632e42729783329 | eadde35af2b82fe3de7bc2f1cbc579af0a1a8816 | /bookstore/migrations/0004_auto_20180909_1735.py | e09259010beb6c58856a24a36ab83a688d069fef | [] | no_license | hdforoozan/Shop | 425a2371d2f96baca29db0948294edb31a4504b8 | 776d36149733a38bda26715bc3b16c03f0d53a9c | refs/heads/master | 2020-04-24T06:22:14.033290 | 2019-02-20T22:51:49 | 2019-02-20T22:51:49 | 171,762,724 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 650 | py | 0004_auto_20180909_1735.py | # Generated by Django 2.1 on 2018-09-09 13:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bookstore', '0003_auto_20180909_1717'),
]
operations = [
migrations.RemoveField(
model_name='book',
name='rating',
... |
70eabc054e15d159c5bc58d7d03ccbc1a7a0912b | 6ddcf002c304810c568ef7317f1c00184e603d02 | /Waveform/WebDC.py | 1fdad03f4cf8a8b223facbba17d3fe4f999f1dea | [] | no_license | lpk-py/bat | 4a0c4d5f8f784e1eb4caa1881c684437d20edb82 | a852a0d85edad0dd89f4281e3bbe612052ea8bee | refs/heads/master | 2022-12-11T19:42:30.927454 | 2017-05-22T13:35:03 | 2017-05-22T13:35:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,877 | py | WebDC.py |
import os
import platform
WINDOWS = (platform.system() == 'Windows')
from obspy.arclink.client import Client
# Import from Common
import Basic
import Globals
import Logfile
# -------------------------------------------------------------------------------------------------
# used by getStationList.py :
... |
debdf52d25bfad3ab57a364001dd94ee3c36840a | 955e99e0f46a8578562853fdb2cb9237923dcdd7 | /oj/info.py | a3acd68e95136ba6a9cba7bd1cc7a056bd6740c8 | [] | no_license | joeyac/WebServer | 7d7ccc3df3092f923e52248c15e5dbb3ad5b866b | c856ed5570712887c61df9f563a9c028c27a8367 | refs/heads/master | 2021-06-16T16:04:02.847217 | 2017-05-19T04:42:23 | 2017-05-19T04:42:23 | 81,619,078 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 514 | py | info.py | # -*- coding: utf-8 -*-
INFO = {
'POJ': {
'url_home': 'http://poj.org/',
'url_problem': 'http://poj.org/problem?id={problem_id}',
},
'HDU': {
'url_home': 'http://acm.hdu.edu.cn/',
'url_problem': 'http://acm.hdu.edu.cn/showproblem.php?pid={problem_id}',
},
'Codeforces'... |
839e8135d0b34a7dfd3ef53db57085f888b465b3 | a6a5f702705da368d9f2192446ac8137bbb03868 | /models.py | 4ffa0f5636c662fe0ca3965e52b7df10aeade365 | [] | no_license | akyurektuna/BIL372_Proje_16 | 1c8a255bacec4833e0302355c185325788cc5071 | abab7accccb366fc034d233398f71887b6e30752 | refs/heads/main | 2023-01-31T14:26:10.684700 | 2020-12-07T21:09:15 | 2020-12-07T21:09:15 | 304,269,376 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,784 | py | models.py | from flask_login import UserMixin
from datetime import datetime
from . import db
class BSUser(UserMixin, db.Model): #databasedeki users tablosu elemanlarını tanıttık!
userid = db.Column(db.String(100), primary_key=True)
firstname = db.Column(db.String(100))
lastname = db.Column(db.String(100))
email = ... |
c948b9e06f778d7f45e4afe4ac7968f578822a5e | a95bc4cd59b6b357e37c1784e133b9755d3d279e | /Crypto_COL759/02_RSA_Vignere/Receiver.py | 1623237782fe24d8ec1c34f7d92026b17063151c | [] | no_license | Vikas-Jethwani/Mtech | 30716dea6932a8b55d0ccca8752465cf1a76ff14 | f1996ef91a35cde0d8d9e512d38dcdd314098fef | refs/heads/master | 2022-04-13T08:13:45.844526 | 2020-03-04T18:19:48 | 2020-03-04T18:19:48 | 201,012,172 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,066 | py | Receiver.py | import math # for log
import gmpy2 # for mod_inverse
# ========================================================================
# Global Constants
DISTINCT = 37
S_ID = 2 # Self Id
R_ID = 1 # Retrieval sender Id
CHECK = ord('-')-ord('a') # for '-'
FIX = 26 # for '-'
FIX_NUM = 27 # for number '0' and so on...
# =======... |
3090c2e71adec43c1def739b6c8cb9d085790497 | 9bb11c547a419dedb1b6341adb3b46abbcd1466f | /client/client.py | c7c1bef157038b7e7882cdf47a7f2353a216cfa4 | [] | no_license | muhdamrullah/trilateration | 5322ae600eb06126198d5c7ec3b74dcf152547aa | 72164d1788de8105ee14415f5aef04b5a2149044 | refs/heads/master | 2021-01-10T06:50:05.607132 | 2015-06-09T02:05:40 | 2015-06-09T02:05:40 | 36,569,527 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,292 | py | client.py | import json
import requests
from urlparse import urlparse
from triangulate import triangulate
import time
signalPower = 0
#Load JSON data from API of a 'specific' MAC address
def pullApi(macAddress, ipAddress):
http = 'http://'
uri = '/todo/api/v1.0/tasks/'
target = urlparse(http + ipAddress + uri + macAdd... |
2228b32e9e9c938487ea23d49c53de048deb2501 | 02c310900d04cc44f14eef786fc2e25bd2339b9a | /vsdk/service_development/models/disease_information.py | 5d83b91dc18b4bbc41ec201a42a8b42baf680683 | [] | no_license | Jaspera1980/KasaDaka-VSDK | 611867977a9adab2f092561430f0fdd867b161e7 | d7be7e80b21f1352a0ea69fe81f9a939b84b923d | refs/heads/master | 2020-03-13T06:57:18.053770 | 2018-05-26T09:57:20 | 2018-05-26T09:57:20 | 131,015,325 | 0 | 0 | null | 2018-04-25T14:02:04 | 2018-04-25T14:02:04 | null | UTF-8 | Python | false | false | 1,055 | py | disease_information.py | from django.db import models
# from django.utils import timezone
# from django.contrib.contenttypes.fields import GenericForeignKey
# from django.contrib.contenttypes.models import ContentType
# from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from .utils import Cho... |
3902699fb9ea42ff648c3f547b7bdb1ee76f4774 | b826ee8d834714268fe760202c330646dcf12db4 | /update_pkg_list.py | 04d5a6ad38233f6ddf203e2b0b8f841ed13f0e88 | [] | no_license | ruwan800/vos-repo-sync | 9bf7601e79a0356b44799613c6a172f0dc4b9b44 | 09292dcd2d5af73811a791e89a64b7dc510f9750 | refs/heads/master | 2021-01-16T21:10:47.357458 | 2016-08-13T12:07:05 | 2016-08-13T12:07:05 | 65,615,310 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 482 | py | update_pkg_list.py | ##Wed 12 Sep 2012 01:49:43 AM IST
from db_connect import DBConnect
def update_pkg_list():
SQL = """
INSERT INTO
software_settings (package,soft_id,new)
SELECT package,id,'YES'
FROM software
WHERE
package NOT IN (SELECT package FROM software_settings)
"""
conn = DBConnect()
conn.execut... |
b1f81ddcafd922c737c4e35b055ca37e0533f8f4 | 9479123f83b566ea15a8402be8a38d875a43b483 | /bme280/usmbus.py | 38bc348ad5d8aedfbb082a453d45e65b2c890bbe | [
"MIT"
] | permissive | DrTom/py-bme280 | e1b191f37a0c0f41a88ca02570cce2c513d106b2 | 35aee1601d84b2df23e96a73671db006a332d2d6 | refs/heads/master | 2021-06-25T11:13:52.724917 | 2021-06-13T10:00:51 | 2021-06-13T10:00:51 | 224,029,048 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,226 | py | usmbus.py | """ Provides an SMBus class for use on micropython """
# MIT License
# Copyright (c) 2017 Geoff Lee, 2019 Tom Schank
#
# adopted from https://github.com/gkluoe/micropython-smbus
# this variant does not extend but really wrap machine.I2C
# which is less intrusive in some cirumstances
class SMBusWrapper():
""" Pro... |
95bfbc4654cf70dc8aa99febe37e5cb47afbd603 | 6500e15fd3b417a41bb44f1efd77b57dad52de48 | /Decision_tree.py | 903d1b4c4cfd4259f32f8a5c06ecaa611fb2f86f | [] | no_license | saeedahmadian/BiasedRandomForest_from_scratch | a6018bd113dac5b23ca6f3026c27ff1fc8226795 | 85aee5fa5a70ad4ab7f3154e857ad65157a3e10b | refs/heads/master | 2022-04-25T17:07:48.680069 | 2020-04-13T16:11:34 | 2020-04-13T16:11:34 | 255,373,991 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 10,572 | py | Decision_tree.py | import numpy as np
from Node import Node
from graphviz import Graph
from Config import args
class DecisionTree(object):
def __init__(self,name='DecisionTree',weights=[.5,1.5]):
self.total_depth = args.depth
self.metric = args.metric
self.name = name
self.weights= weights... |
e16d9ff958ad9af4117d7dc1c709682951549549 | 81edc0323e1db02f54c2c86906e8f461010007f1 | /args.py | e6660784a8ea3870b0b93eb2e449fe1acebfd422 | [] | no_license | ambarus/mcda | 24b799cea3c974fe9d05f9e18472d30c915e3171 | fa8593aabb2d7fd93f19999e36ba9cb9a531b8ee | refs/heads/master | 2021-05-16T02:36:29.437349 | 2017-06-27T14:58:27 | 2017-06-27T15:11:41 | 34,005,357 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,067 | py | args.py | #!/usr/bin/env python
# encoding: utf-8
import argparse
def restricted_float(x):
#Define a restricted float data type in interval (0, 1].
x = float(x)
if x <= 0.0 or x > 1.0:
raise argparse.ArgumentTypeError("%r not in range (0.0, 1.0]"%(x,))
return x
def parse_args():
"""Parse user arg... |
5aa2d34ae85490f5782658787a1b58c183625c44 | c283b10fa167dd943beff0cdd2281092bacf591d | /IR2.py | ea1e86d5057bf003c53f8eefde80ae140fa1fa3a | [] | no_license | pranali3/Vector-Space-Retrieval-Model | 4b48542f288bc381e1c72471d7a5cb259f9e0ef0 | b1afb066733d009c381da66410752a1b9d18db47 | refs/heads/master | 2020-04-26T22:14:39.780314 | 2019-04-07T04:00:44 | 2019-04-07T04:00:44 | 173,866,218 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,008 | py | IR2.py |
# coding: utf-8
# In[34]:
import os
import string
import math
import re
import itertools
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from lxml import html
from bs4 import BeautifulSoup
from collections import defaultdict, OrderedDict
from functools import lru_cache
from prettytable import ... |
e9dc370130526dfc638bc6922f171a0366bec405 | 6bc27634db10baf268f02712d19cd24ae6b7b324 | /bean/user.py | d28deb37f9cd64e84b11887b3663a8ff03e2f09d | [] | no_license | ranmengyuan/PredictFlow | 08d9d551a60c94b16fcac8e3599c60f6a5b16834 | 6fb06912998c7fb9ef17a531a823ada85d43ddb9 | refs/heads/master | 2021-04-26T23:56:42.533298 | 2018-03-06T02:38:10 | 2018-03-06T02:38:10 | 123,883,960 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 604 | py | user.py | class User:
"""
用户行为
"""
shop_id = 0 # 商家id,与shop_info对应
date = 0 # 距离2015年07月01号的天数
sum = 0 # 用户当天某种行为的次数
def __init__(self):
"""
构造函数
:return:
"""
self.shop_id = 0
self.date = 0
self.sum = 0
def __init__(self, shop_id, date, ... |
8d486c21ceafa21d9e790c0b908292133a10b366 | 001250f7b3f0dfaabee459a9ca1e83555c98cbe2 | /featurizer.py | 5b0a418f692055960467059a0533b7c1b2ff5d66 | [] | no_license | ShreyasMundhra/SpamClassifier | a98f07b244cda4c5ab093a6d9d6539b6de974f34 | 68a021f107050934a3f12c05323f8bfe4b8a74aa | refs/heads/master | 2021-03-27T16:05:58.530327 | 2017-11-05T16:33:50 | 2017-11-05T16:33:50 | 109,468,044 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 4,420 | py | featurizer.py | import pandas as pd
import numpy as np
import os
import nltk
from nltk.tokenize import RegexpTokenizer
from nltk import pos_tag, ne_chunk
from sklearn.feature_extraction.text import TfidfVectorizer as vec
# read txt file
def readtxt(file):
with open(file,'r+', encoding='latin-1', errors='ignore') as file_obj:
... |
b57964b23780558ce44849e1145997c1fe66b2d2 | 863168b3ec80efd9801aa21422ab6ddc8aacb416 | /honeypot.py | 33535340f8aa67b3da73e8e1fbc6022a283aa7cb | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | internetwache/SSH-Honeypot | 5284cc48688d47390bb1992422a61cf25cc3e17f | 3ee08157fcb7c32efa6ccbdb972fee035a294a7d | refs/heads/master | 2023-05-11T10:43:08.625931 | 2021-03-28T17:59:41 | 2021-03-28T17:59:41 | 28,772,417 | 65 | 34 | MIT | 2023-05-11T15:25:01 | 2015-01-04T11:27:23 | Python | UTF-8 | Python | false | false | 1,890 | py | honeypot.py | #!/usr/bin/env python2.7
import socket, sys, threading, thread
import paramiko
#generate keys with 'ssh-keygen -t rsa -f server.key'
HOST_KEY = paramiko.RSAKey(filename='server.key')
SSH_PORT = 2222
LOGFILE = 'logins.txt' #File to log the user:password combinations to
LOGFILE_LOCK = threading.Lock()
class SSHServerHa... |
20f34086d46ccc1c4b4d32afc2d3591e994b2ad4 | 4a8d25cf2ae37cac7cfbf8d2c66314bcb60950b5 | /_includes/solutions/microbit/theremin.py | 7af9b8fd3650977c6d5de1986cabafb8f609f3f8 | [] | no_license | deejaygraham/makers-n-creators | f557497bcedb937308b567a417a8c9f960f8d7ea | 3bca8f7c7fd86256e29722a4e222ef573cfb8952 | refs/heads/master | 2021-01-20T00:46:44.039274 | 2019-12-16T08:32:31 | 2019-12-16T08:32:31 | 83,799,008 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 453 | py | theremin.py | from microbit import *
import music
# where am i in space?
def calculate_movement():
scaling_factor = 20
x = accelerometer.get_x() / scaling_factor
y = accelerometer.get_y() / scaling_factor
z = accelerometer.get_z() / scaling_factor
movement = x + y + z
return int(movement)
frequency = 440 #... |
80dc13adb31a6a9ef8d4f9180e50791fb6f2e86e | 0448810521d03dc49c1416853d8f969b784f6ea0 | /tests/src/provider_test/predicates_test.py | c2e94b3c1d3b8bd2c86de1f87720f514b27f923c | [
"MIT"
] | permissive | michalbachowski/python-checklisting | 7d73ed54e670b1f9920f6b3b099d372f92fef41d | 31cbe1fb87683ffbb21104585e318d844fc7c52b | refs/heads/master | 2020-03-23T00:03:02.594860 | 2018-11-29T08:55:39 | 2018-11-29T08:55:39 | 140,841,080 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,449 | py | predicates_test.py | import unittest
from checklisting.task import Checklist
from checklisting.provider.predicates import (AllowAllChecklistsFilterPredicate, WhitelistChecklistFilterPredicate)
class AllowAllChecklistsFilterPredicateTest(unittest.TestCase):
def test_always_return_true(self):
predicate = AllowAllChecklistsFil... |
69b9bccd4170114466a28f4f7f9a068b7a190193 | 45ea6e4428ecba73ac26ba2f30f94983f40cc91c | /tests/test_presidio_analyzer.py | 3d5a24d0cfde1aa1b3268e3229fd31e649b8f22c | [
"LicenseRef-scancode-generic-cla",
"CC-BY-SA-3.0",
"MIT"
] | permissive | gabechu/presidio-research | 784e83c46773d19e1dc879abed87925b8163f117 | 9719c9c7ed52f468f354d37da22094d27c518cad | refs/heads/master | 2023-02-13T23:48:03.399578 | 2020-08-31T12:36:49 | 2020-08-31T12:36:49 | 289,817,453 | 0 | 0 | MIT | 2020-08-31T12:36:51 | 2020-08-24T03:22:47 | Python | UTF-8 | Python | false | false | 3,133 | py | test_presidio_analyzer.py | import pytest
from presidio_evaluator import InputSample, Span
from presidio_evaluator.data_generator import read_synth_dataset
from presidio_evaluator.presidio_analyzer_evaluator import PresidioAnalyzerEvaluator
# Mapping between dataset entities and Presidio entities. Key: Dataset entity, Value: Presidio entity
ent... |
b5d301efce75f631474083f5e30d7a33db75ef07 | c5fd1f08b972b904e41e1fba116c94ca81eb71b7 | /ransac_threshold_nne_distribution/src/tests/test_CsvHelper.py | 08e8b73d07ff5e6ed7bc59605073dd41ff48e45c | [] | no_license | sdg002/sdg002.github.io | f87e38f67893461121975fe0d8a57d51ac97c268 | 35d7ce52f55bdb1d1211c0209f86460aef9e7ffa | refs/heads/master | 2023-03-16T02:16:27.097941 | 2022-09-18T23:05:59 | 2022-09-18T23:05:59 | 170,031,233 | 5 | 4 | null | 2022-09-18T23:06:00 | 2019-02-10T21:47:59 | Python | UTF-8 | Python | false | false | 4,754 | py | test_CsvHelper.py | import csv
from typing import List
import unittest
from data.OutputRow import OutputRow
from data.InputRow import InputRow
from data.CsvHelper import CsvHelper
import os
class Test_CSvHelper(unittest.TestCase):
def test_write_results_to_csv(self):
row1=OutputRow()
row1.imagefile="file1.png"
... |
2df79d45fac7ded2922d83cb290eab66aef01405 | 8595a3815dc7f19d3dcdf51c6191205f652a1baa | /xi_cl.py | 68ed63846523b50cce31fc724aa30c96f880bd85 | [] | no_license | damonge/BBMoments | 9fffb5d0a8972c41778ef0a8f4db259461d493a7 | d22cd9608b182ed0b72b42f131e3bc0d6d19ffe5 | refs/heads/master | 2022-12-02T18:16:51.588738 | 2020-08-22T06:51:59 | 2020-08-22T06:51:59 | 255,594,896 | 1 | 1 | null | null | null | null | UTF-8 | Python | false | false | 5,903 | py | xi_cl.py | import os
import numpy as np
import matplotlib.pyplot as plt
import utils as ut
from scipy.interpolate import interp1d
from hankel import HankelTransform
A_dust = 28.
alpha_dust = -0.5
A_beta = 5E-6
gamma = -2.5
beta_dust = 1.6
temp_dust = 19.6
nu_0 = 353.
nu_1 = 39.
nu_2 = 39.
sed_1 = ut.comp_sed(nu_1, nu_0, beta_... |
68b0212ce7dcb958003464cae676bb104e8678de | 96ac90e66a2c7c1a11c3c1ff88aa8904a3810357 | /2018/7_AoC.py | 63a81479f8ea82f401df096ec4d11e2a40752e31 | [] | no_license | hnkryden/advent_of_code | d4a99aa50d91a287864406bf06962a6c90da96da | 9f58d7b7a8011d12c21f781e1f7d75278d988de7 | refs/heads/master | 2021-12-31T20:04:19.758362 | 2021-12-22T19:32:29 | 2021-12-22T19:32:29 | 117,689,892 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,750 | py | 7_AoC.py | # AoC 7
file = open("input_7.txt",'r')
lines = file.readlines()
def part_A(lines):
d_weight = dict()
d_is_bottom = dict()
for line in lines:
elems = line.split()
bottom = elems[0]
d_is_bottom[bottom] = 1
for line in lines:
elems = line.split()
bottom = ele... |
1317288b72ff160767ce302a1c72ded1953b1e60 | 377cbbe140fd0faf1eb53ba3794de816ac307cde | /src/config/ConfigParser.py | 16398ea0774f15a4a2701e8a98e289ede5146373 | [
"MIT"
] | permissive | dhruvtapasvi/implementation | fcbd7ab8e7b1368a0f07ee41dc5f0b6d6708c206 | 964980f431517f4548a87172a05107cdf700fb84 | refs/heads/master | 2021-09-16T01:47:50.601661 | 2018-05-17T19:22:44 | 2018-05-17T19:22:44 | 114,498,055 | 1 | 0 | MIT | 2018-05-05T02:17:35 | 2017-12-16T23:59:13 | Python | UTF-8 | Python | false | false | 171 | py | ConfigParser.py | from abc import abstractclassmethod, ABCMeta
class ConfigParser(metaclass=ABCMeta):
@abstractclassmethod
def fromConfig(self):
raise NotImplementedError
|
5324bc259a5e59673a12bd7c7a0e5b35dfcfa23e | a5a99f646e371b45974a6fb6ccc06b0a674818f2 | /RecoTracker/PixelLowPtUtilities/python/TrackSeeds_cfi.py | 4b30c3a19114f49610595102b196049cf5d4f621 | [
"Apache-2.0"
] | permissive | cms-sw/cmssw | 4ecd2c1105d59c66d385551230542c6615b9ab58 | 19c178740257eb48367778593da55dcad08b7a4f | refs/heads/master | 2023-08-23T21:57:42.491143 | 2023-08-22T20:22:40 | 2023-08-22T20:22:40 | 10,969,551 | 1,006 | 3,696 | Apache-2.0 | 2023-09-14T19:14:28 | 2013-06-26T14:09:07 | C++ | UTF-8 | Python | false | false | 458 | py | TrackSeeds_cfi.py | import FWCore.ParameterSet.Config as cms
import RecoTracker.TkSeedGenerator.SeedGeneratorFromProtoTracksEDProducer_cfi
pixelTrackSeeds = RecoTracker.TkSeedGenerator.SeedGeneratorFromProtoTracksEDProducer_cfi.SeedGeneratorFromProtoTracksEDProducer.clone(
InputCollection = '',
TTRHBuilder = 'WithTrackAngle'
... |
4101229c87fbae388ffbb1e9775fdb1b51094fad | 445ff1802dc858247bbb7331acd84e49d19aecc3 | /inference_torchhub.py | 46564afb648a6950284a99ef2a2fd6e64f0444f2 | [
"BSD-3-Clause"
] | permissive | ankitdwivedi23/tacotron2 | 57bbc2b31f5462f9365ef4eea4a869ed3fc1fc03 | 9d2b4e81aeeb15b3d59f45d4de05ad09e4c43e32 | refs/heads/master | 2022-11-19T21:45:00.686069 | 2020-07-27T08:21:40 | 2020-07-27T08:21:40 | 280,308,819 | 0 | 0 | null | 2020-07-17T02:38:21 | 2020-07-17T02:38:21 | null | UTF-8 | Python | false | false | 854 | py | inference_torchhub.py | import numpy as np
import torch
from scipy.io.wavfile import write
tacotron2 = torch.hub.load('nvidia/DeepLearningExamples:torchhub', 'nvidia_tacotron2')
tacotron2 = tacotron2.to('cuda')
tacotron2.eval()
waveglow = torch.hub.load('nvidia/DeepLearningExamples:torchhub', 'nvidia_waveglow')
waveglow = waveglow.remove_w... |
2c2049b5b8da5c90d910f64437d72e323a48af1a | f7827259ab40a903ac52cd77176be47c35e22125 | /anunidecode/x86.py | 9652f749b55b83c49a5a663073f523e23153a47a | [] | no_license | DevTable/anunidecode | 143fec2df17c494aa3adbc0bfad9de5c0c7011eb | d59236a822e578ba3a0e5e5abbd3855873fa7a88 | refs/heads/master | 2021-01-10T19:20:45.172892 | 2014-08-01T19:14:46 | 2014-08-01T19:14:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,055 | py | x86.py | page = [
'Tuo ', 'Wu ', 'Rui ', 'Rui ', 'Qi ', 'Heng ', 'Lu ', 'Su ', 'Tui ', 'Mang ', 'Yun ', 'Pin ', 'Yu ', 'Xun ', 'Ji ', 'Jiong ',
'Xian ', 'Mo ', 'Hagi ', 'Su ', 'Jiong ', '[?] ', 'Nie ', 'Bo ', 'Rang ', 'Yi ', 'Xian ', 'Yu ', 'Ju ', 'Lian ', 'Lian ', 'Yin ',
'Qiang ', 'Ying ', 'Long ', 'Tong ', 'Wei ', 'Yue ', 'L... |
8367b79d912f41de29256dd78de6409d106ae356 | e7cdced4bdfb9e39d530481a714170ea35fb3ab4 | /lof/cli.py | 15f5405df3c75011507dc12d1aa56061d025afba | [
"MIT"
] | permissive | bridgecrew-perf7/lof | 7f6b59a70803965311fd9e5c30fa7656fc4b9726 | 9efd3e0d21657de148781dd6adeaabde73506963 | refs/heads/main | 2023-08-18T08:54:24.535080 | 2021-10-08T12:58:24 | 2021-10-08T12:58:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,757 | py | cli.py | from typing import Optional
import typer
from lof import runner
def main(
template: str = typer.Option(
"template.yaml", help="Path to AWS Code Deploy template with lambdas"
),
env: str = typer.Option(None, help="Path to file with environment variables"),
exclude: Optional[str] = typer.Optio... |
31ca83869652b3f0cafaa5ff0afa2144622d7f80 | 08ad5ed44c1eca91f772b0c2866ee032bc17b3de | /requests_OAuth.py | 6f98829691c9d80f0372c6c9659f09f0895f290e | [] | no_license | MRchenone/python_test | 606eec09bc19c3d58cedbb2b61b36869bd72ba3c | 505af406581d425b28ae204978e705e1ff35ceac | refs/heads/master | 2021-01-02T23:08:44.391120 | 2017-08-06T09:27:47 | 2017-08-06T09:27:47 | 99,474,137 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 349 | py | requests_OAuth.py | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import requests
from requests_oauthlib import OAuth1
url='https://api.twitter.com/1.1/account/verify_credentials.json'
auth=OAuth1('YOUR_APP_KEY','YOUR_APP_SECRET',
'USER_OAUTH_TOKEN','USER_OAUTH_TOKEN_SECRET')
requests.get(url,auth=auth)
#r=requests.get(url,aut... |
b5f8a69dbec6ce3841b79c81447eee2b7d9aca2b | 9010f803785d4788dc086076fc29a09f6ca8fe6d | /NN_Eval.py | 571e7df672e71e4a0f81dea882402eb0d559b768 | [] | no_license | Random-Dummies/neural-network | 186dbcf7a8ad6a71eaabde9298ac4603e101c635 | fb071cff23e92fb135b461c6930f789bafc4f26c | refs/heads/master | 2021-08-19T14:58:01.749662 | 2017-11-26T19:52:00 | 2017-11-26T19:52:00 | 111,644,191 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 900 | py | NN_Eval.py | from __future__ import print_function
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
import matplotlib.pyplot as plt
from keras.models import model_from_json
from nested_json_handler import getScores
def feedNeuralNet(jsonPayload):
print(jsonPay... |
e392fe73520336d3fabf674184ea34fec2762ed8 | 411fed4ed959efcd649357822f01d67be28b24f4 | /backend/migrations/0005_auto_20210131_1549.py | 5a2d6787ef0e1f14ec7a9b6b8260cf9750dfea8f | [] | no_license | Anush-Hambaryan/Real-Home-Backend | a8cf827ed4942a69f2d4ac44fc9b8bf9d65604ec | ade63965b1fe38271226f7bacf6e12baeada6732 | refs/heads/master | 2023-03-27T01:48:52.452636 | 2021-03-17T16:07:02 | 2021-03-17T16:07:02 | 348,753,421 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,869 | py | 0005_auto_20210131_1549.py | # Generated by Django 3.1.1 on 2021-01-31 15:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('backend', '0004_auto_20210130_1543'),
]
operations = [
migrations.AlterField(
model_name='listing',
name='currency',... |
c9bd7f98567ad7e317489125a858833955e5fc0d | e573991b7f6ff6d6befbb8f4ae5541e9aa1b8bd8 | /preallocator.py | 82bce04dd8d79bc3920dd430dabcca49758ea802 | [
"Apache-2.0"
] | permissive | xyzisinus/Tango | 8d1359085018ccc2f1905102473f8af47b4d80c9 | a0a74345786852edc1841f1af3ecf3abc2bc15a9 | refs/heads/master | 2021-01-15T19:49:13.553074 | 2019-11-09T21:51:52 | 2019-11-09T21:51:52 | 99,827,297 | 0 | 1 | null | 2017-08-09T16:01:37 | 2017-08-09T16:01:37 | null | UTF-8 | Python | false | false | 13,086 | py | preallocator.py | #
# preallocator.py - maintains a pool of active virtual machines
#
import threading, logging, time, copy, os
from tangoObjects import TangoDictionary, TangoQueue, TangoIntValue
from config import Config
#
# Preallocator - This class maintains a pool of active VMs for future
# job requests. The pool is stored in dic... |
77b95eaabdd39fa9bf117809a32319e131eb1441 | dd5bdef5c5dd067986a19f5a10969757d7e81633 | /testsite.py | f1ec7649a2b83d59eb5e3ea579f3879db1777c58 | [] | no_license | jiangming1/pythoncode | b91ccc7a47cb79fe7911af46e93112dd2b9941d4 | c27819477bd6007641af8f592423d2549893bc4d | refs/heads/master | 2021-01-21T13:56:40.674815 | 2016-05-26T09:09:31 | 2016-05-26T09:09:31 | 53,423,839 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,300 | py | testsite.py | # coding: UTF-8
#作者 蒋明
#作用 定点执行指定的web脚本 模拟人的操作去执行一系列动作
#日期 2016-03-09
from selenium import webdriver
import time
runtag='fj050_site_prod_build_20160315.1'
a='2016-3-15 21:00:00'
a_struck_time=time.strptime(a,'%Y-%m-%d %H:%M:%S')
print time.mktime(a_struck_time)
print time.time()
runtime=time.mktime(a_struck_time)
while... |
b66122889f9dc8592743caff3abbb5db61b23822 | 163eba152d21d3fc0ad566c4c7ce7261dfa7c51c | /pyesg/academy_rate_model.py | 5c173c6e2dfaeae6f2ee558e69e4cadedddeaef2 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | vishalbelsare/pyesg | cb59423046198aa53b6261c36b28769ac356656b | 95183b3f8e6d37797653bb672a69a1af8a01c1f4 | refs/heads/master | 2023-04-03T04:12:54.523385 | 2021-03-19T04:17:24 | 2021-03-19T04:17:24 | 281,396,107 | 0 | 0 | MIT | 2021-04-04T14:45:15 | 2020-07-21T12:47:43 | null | UTF-8 | Python | false | false | 12,451 | py | academy_rate_model.py | """
Implements the American Academy of Actuaries stochastic interest rate model, including
stochastic rate generation, yield curve interpolation, flooring, scenario significance
testing, and yield curve perturbations.
References
----------
https://www.actuary.org/sites/default/files/pdf/life/lbrc_dec08.pdf, page 8
htt... |
50affa601acaee67d0eb985179b52800c40ce6db | 74be814f7cd10d3c91a53460bd6698aa8bc95704 | /AcWing算法基础课/bellman-ford/853. 有边数限制的最短路.py | 3185032f5c9d2b7fc6114e1d9c9e7101659d1bdb | [] | no_license | weiyuyan/LeetCode | 7202f7422bc3bef6bd35ea299550b51905401656 | 19db0e78826d3e3d27d2574abd9d461eb41458d1 | refs/heads/master | 2020-12-03T17:10:53.738507 | 2020-05-27T08:28:36 | 2020-05-27T08:28:36 | 231,402,839 | 2 | 0 | null | null | null | null | UTF-8 | Python | false | false | 853 | py | 853. 有边数限制的最短路.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author:ShidongDu time:2020/3/23
'''
给定一个n个点m条边的有向图,图中可能存在重边和自环, 边权可能为负数。
请你求出从1号点到n号点的最多经过k条边的最短距离,如果无法从1号点走到n号点,输出impossible。
注意:图中可能 存在负权回路 。
输入格式
第一行包含三个整数n,m,k。
接下来m行,每行包含三个整数x,y,z,表示存在一条从点x到点y的有向边,边长为z。
输出格式
输出一个整数,表示从1号点到n号点的最多经过k条边的最短距离。
如果不存在满足条件的路径,则输出“impo... |
0c9aaefb2923e4f8bd232c2d7224893441d7461f | 07fdfb81a90d31b7165478264777c6d75457ff4d | /Tensorflow_basics/Sentiment/sentiment_neural.py | 0208bb3f5b74f53a91cda3f7be32dee65c1d1334 | [
"MIT"
] | permissive | rsk97/tensorflow_basics | 908d02b9e5094028238b7eb3f1f4b1e54122f8af | b758fc9f07358957a1566df416f6e05a49d8525a | refs/heads/master | 2021-09-04T20:38:13.078733 | 2018-01-22T08:03:08 | 2018-01-22T08:03:08 | 112,028,130 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,316 | py | sentiment_neural.py | import tensorflow as tf
from sentiment import create_feature_label
import numpy as np
# can also be loaded from the pickle stored as well
train_x,train_y,test_x,test_y = create_feature_label('pos.txt','neg.txt')
n_nodes_hidden1 = 500
n_nodes_hidden2 = 500
n_nodes_hidden3 = 500
n_class = 2
batch_size = 100
# Variable... |
a719f60aa3caea0acd8f4209af7c09f730ab002f | 0d49d104c86fb9b512822312ff253488f27fb31d | /orchestrator/scripts/map_service.py | 77ec26cb53794140621c15b23e517f74b0bdac21 | [
"BSD-3-Clause"
] | permissive | Amoki/bebop-safe-control | 584a6b1ce7c5596d0aa30b647af2727244310951 | 831d86cc8f084247ef674ff399c52babf6c718f1 | refs/heads/master | 2021-04-29T02:21:22.885027 | 2017-02-02T09:58:45 | 2017-02-02T09:58:45 | 78,027,039 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,676 | py | map_service.py | #!/usr/bin/env python
# coding: utf-8
import rospy
import math
import itertools
import yaml
from os.path import dirname, abspath
from nav_msgs.srv import GetMap
from geometry_msgs.msg import Point
from orchestrator.srv import GetNearestObstacles
import timeit
class MappedDrone(object):
def __init__(self, positi... |
42aa64352bc8d34e696b93502a446779bcbd408a | 81c7412211dff7cc331a35207841f22ff76f98c7 | /Project_SMDA/SMDA_Feder.py | ffec05b1d507da28fbc2f075fecd7cc8f0eb4a0f | [] | no_license | fdrmrc/Statistical-methods-for-data-analysis | 7905d6c9dfc53e1f83297bb4799f8f1b9a8461e3 | 10ee8fcf6ad5e5ec0db41e0b15b7e54861c4be11 | refs/heads/master | 2022-01-21T18:41:42.716043 | 2019-08-06T12:20:27 | 2019-08-06T12:20:27 | 198,111,938 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 31,938 | py | SMDA_Feder.py | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
import seaborn as sns
import itertools
from sklearn import linear_model
from sklearn.linear_model import LinearRegression, Ridge, Lasso
from sklearn.metrics import mean_squared_error
from sklearn.decomposition import PCA... |
a98b9328d108e7500cd274d71474787b80499e95 | f065205d69b576ed313730a309f5c0198edb2c56 | /그리디/큰 수의 법칙.py | 702eef1801c6ce49fdb649885e07b1bcb2bbb6a6 | [] | no_license | ypyp66/Algorithm | e0309d842faad2dcdf3c65171a03a2b6e1112924 | a561c30f036e9c6facf759d4c6af9a3e332318c5 | refs/heads/master | 2023-04-22T08:19:04.665020 | 2021-05-05T12:11:04 | 2021-05-05T12:11:04 | 328,175,259 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 912 | py | 큰 수의 법칙.py | n, m, k = map(int, input().split()) #n= 데이터 갯수, m= 덧셈횟수, k=사용 최대 횟수
data = list(map(int, input().split()))
data.sort() # 입력받은 수 정렬
first = data[n-1] #가장 큰 수
second = data[n-2] #2번째로 큰 수
#result = 0 #결과값을 담을 변수
count = m // (k+1)
rest = m % (k+1)
result = ((first) * k + second) * count
result += first * rest
print(r... |
868e77cd4a3924e46be8a9d7ea836a51d3eb6b3a | b68c92fe89b701297f76054b0f284df5466eb698 | /Other/Companies/Amazon/SlidingWindowMaximum.py | ef6c1fa07506c704974536018fc709a5918ef4bc | [] | no_license | makrandp/python-practice | 32381a8c589f9b499ab6bde8184a847b066112f8 | 60218fd79248bf8138158811e6e1b03261fb38fa | refs/heads/master | 2023-03-27T18:11:56.066535 | 2021-03-28T04:02:00 | 2021-03-28T04:02:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 708 | py | SlidingWindowMaximum.py | from collections import deque
from typing import List
def slidingWindowMaximum(nums: List[int], windowSize: int) -> List[int]:
deq = deque()
output = list()
for idx, value in enumerate(nums):
# While the value at the last index in our deque is LESS than value, we just pop them all out
while... |
0d7c86935a31597f5732658c8360be1a16cd028a | 476cfa8c403a6b76434bc7d61a0defd032ffd154 | /src/wordbase/helpmsg.py | 35963fe38171aed292bc9ca0af6fdd5f667e5445 | [] | no_license | vsemionov/wordbase | 9cb886ae74880aed4898dc294c3c5a5f12d687f7 | 62a34c223e3acc6db9b26147e3773c623640ab00 | refs/heads/master | 2021-01-10T19:53:25.244354 | 2015-09-17T18:54:03 | 2015-09-17T18:54:03 | 42,669,234 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 3,580 | py | helpmsg.py | # Copyright (C) 2011 Victor Semionov
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and t... |
1dd0a3d0c8d3aba8de0735c537d0bb847901a0f3 | 168ae55399cbc44fb3002d118ba9e91fd7a73c89 | /problems/g5_special/Domino.py | 988c635f10ea321b7ccdf64890daf7af4386ab92 | [
"MIT"
] | permissive | cprudhom/pycsp3 | 357202e489fcb3bbcdffe4543eb6c54d5a472ab7 | 980927188f4262c9ea48a6534795712f09d731d6 | refs/heads/master | 2022-04-23T07:37:08.404773 | 2020-04-15T08:45:51 | 2020-04-15T08:45:51 | 255,852,001 | 0 | 0 | MIT | 2020-04-15T08:23:45 | 2020-04-15T08:23:44 | null | UTF-8 | Python | false | false | 603 | py | Domino.py | from pycsp3 import *
n, d = data # number of dominos -- number of values
# x[i] is the value of the ith domino
x = VarArray(size=n, dom=range(d))
if not variant():
satisfy(
AllEqual(x),
(x[0] + 1 == x[- 1]) | ((x[0] == x[- 1]) & (x[0] == d - 1))
)
elif variant("table"):
satisfy(
... |
e1531b5f15a5f9e1354a32c9b794cae77c00aca8 | 07479d2c4389b9a9ec3fd24d0977dba9b5f69341 | /eoscript-0-4-0.py | 37235fee21209d1899c5541508ff64d4e782e1c1 | [] | no_license | Chackapon/electros-python-edition | 14b947f25abe5fa5bf2ed4c153c09c552fda98ae | ec6ece4cc67d056751a1af989f3cfc4a404aa44b | refs/heads/master | 2021-01-15T16:42:28.710798 | 2017-12-22T14:22:59 | 2017-12-22T14:22:59 | 99,719,407 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,872 | py | eoscript-0-4-0.py | def ElectrOScriptN(code):
import numbers
#variables======================================
varNames = ["test"]
varDatas = ["TEST"]
varTypes = ["str"]
importCode = []
#===============================================
#getting the code===============================
if code == "":
while True:
li... |
2dd1f5bf382ddb050a779c27dbcf0f1ff4e92f1b | 27c9a13c394b38a62d256cf9ea8dd7c2c0b64844 | /redis_python.py | 51b46bac071456141f743367efc74df547a07e34 | [] | no_license | jemf17/ejercicios | 8b428b108c907a6577227cb60f5b85049d8354cf | 285596a8127186f86d1e316d6265b5ac391c2692 | refs/heads/master | 2021-03-12T09:11:39.792793 | 2020-12-03T19:57:56 | 2020-12-03T19:57:56 | 246,606,948 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 508 | py | redis_python.py | import redis
from datetime import date
r = redis.Redis(
host='localhost',
port=6379)
print("Sistema de registro de celulares")
nombre = "celular"
date=str(date.today())
while True:
celular = input("Ingrese el celular que adquirio mas recientemente o presione enter para salir ")
if celular == "":
... |
3efb3811edb52fba684fccee28fe2c78b7433841 | 2e351968234937a5d4148bbc61c78589894b4a91 | /modules/methods.py | 36a8687ce2f3786bd43d4b9809aec99c9c6b7024 | [] | no_license | radenka/MACH | ed757f08b87cc903966b4b63358d3a0b64c8bc7c | 8fc179b05590e17511269b4a3bd4ecf964964c52 | refs/heads/master | 2020-05-04T20:39:51.891461 | 2019-05-05T06:36:11 | 2019-05-05T06:36:11 | 179,446,765 | 0 | 0 | null | 2019-04-04T07:39:49 | 2019-04-04T07:39:49 | null | UTF-8 | Python | false | false | 24,459 | py | methods.py | from sys import exit
from termcolor import colored
from numba import jit
from numpy import float64, empty, array, ones, zeros, sqrt, cosh, concatenate, int64, sum, prod, dot, delete, insert, random
from numpy.linalg import solve, eigvalsh
from math import erf
from json import load
from collections import Counter
def ... |
3f5ff6f834a0cf13545320c247ace85d6b56ed95 | cdf1745c1603c7a6a0826425c7d45a6e916140fc | /ycbackend/LSTM/LSTM/hatt_classifier.py | e0edd1bab7654d2ca8142fd73d281d2f523b0397 | [
"MIT"
] | permissive | RHINYCM/Public-opinion-analysis-system-backend | 1d2cf397f59b0e96be4531878b3100bb125d98c0 | f3fce1dae9271e218369acff9abe51467aca36ed | refs/heads/master | 2023-05-28T13:16:21.102770 | 2021-06-21T05:53:37 | 2021-06-21T05:53:37 | 378,665,755 | 4 | 0 | null | null | null | null | UTF-8 | Python | false | false | 9,099 | py | hatt_classifier.py |
import json
import re
import sys
from collections import Counter, OrderedDict
import numpy as np
import pandas as pd
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils.np_utils import to_categorical
from keras.layers.wrappers import Bidirectional
fr... |
d1669c5cc09ba8fdf2b00fbaf114f31e2f4b0120 | b41ed43b43b741bf2bab9b9342f97bdbfdac3809 | /problem_21.py | 9cd3ed3c64c34b0df72ad0e793a61fa6f26eee5a | [] | no_license | salexln/project_euler | f289e143eca1c7d144e9c0547aba96c16f2df0ab | ed3b4f13f5a2a93022229dc125fce2d6ca0f4b05 | refs/heads/master | 2021-01-10T03:55:55.838403 | 2016-03-23T21:17:44 | 2016-03-23T21:17:44 | 49,071,812 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 301 | py | problem_21.py |
def get_sum_dividors(num):
sum = 0
for i in xrange(1,int(num/2) +1):
if num % i == 0:
sum += i
return sum
count = 0
for x in xrange(1,10001):
num = get_sum_dividors(x)
if num == x:
continue
num2 = get_sum_dividors(num)
if num2 == x:
count += x
count += num
print count/2 |
c3ed1d5bc2f8d76c8a78a78fe828a81a57c1fbd0 | 66b6664af0af3b127fd113ce6d56e55d7d6817ca | /py/FindAllAnagramsinaString.py | c45bc04ac88370e58452e0c744e388cff517aaf6 | [] | no_license | sangreal/PyLintcode | f830b2ab3891af9681272f0af12ab6040f8e8533 | 805d99b51df424b5b87dbc6ef2c4c5f8012f4434 | refs/heads/master | 2020-12-14T06:36:46.775392 | 2017-06-11T23:39:21 | 2017-06-11T23:39:21 | 46,391,091 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,199 | py | FindAllAnagramsinaString.py | import collections
class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
storemap = collections.defaultdict(int)
for c in p:
storemap[c] += 1
storevec = []
lens = len(p)
... |
86d2ae0bced597554325f37d26d7c7be9525aee2 | ce27d7a2c06b422f792805cc333b46c45d7a1413 | /BackTrader.py | f94d06216bbda9eabd56a51cc55994f8fe7140b8 | [
"MIT"
] | permissive | imaustinim/praos | dc06ffa38ab32bf7a87f6fadc6bc4e59db91bbfb | ad2d34e111be59682d6509bcb4c0235ca280cf78 | refs/heads/main | 2023-03-17T13:34:48.014730 | 2021-03-12T15:51:17 | 2021-03-12T15:51:17 | 346,811,185 | 1 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,655 | py | BackTrader.py | import sys
import backtrader as bt
import matplotlib
from matplotlib import pyplot as plt
import pandas as pd
import Strategies
import csv
import os
import plot
def data_processor(file_path):
df = pd.read_csv(file_path)
if "Date" in df:
data = bt.feeds.YahooFinanceCSVData(
dataname=file_pa... |
64c00e6d8286301ccfd5ff258576cc4e7b6052de | 8aa5d5d57e1a8d4ce7bbe30f251e8ad10f44fba2 | /app/views.py | 27ebb1765fa875c290b61bbfcfc5c041f2710c4e | [] | no_license | akshuglocify/Genrate-Pdf-Task | d1512dbb3c2577d9bb2debfc57ef5c7ce632c0f7 | 507a03d75bdb7b740fee82602a7cee731a907145 | refs/heads/master | 2020-12-10T07:21:29.121133 | 2020-01-13T07:15:49 | 2020-01-13T07:15:49 | 233,534,385 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,259 | py | views.py | from django.shortcuts import render
from app.forms import UserProfileForm, ProfilePictureForm
from django.shortcuts import render, redirect
import pdfkit as pdf
from .models import ProfilePicture , UserProfile
from .utils import Render
from django.utils import timezone
# Create your views here.
def userprofile(request)... |
7eff32e47cd4f894f49db5ac6db1338b2e51e1cd | 19dfe9f427f1d6ceb11b3420a6fe0b864020fa60 | /app/Data/Repository/events_repository.py | 43fa0ecad046ea50a1a2890984ead45b712a422a | [] | no_license | AndreasGustafsson88/birthdays_MongoDB | 513bd09d1ddf94ce77fb6946f920331c3e63da84 | 3fcd3b75a84818e6bf0fbdd746e981491e8276f6 | refs/heads/master | 2023-01-19T10:31:54.490654 | 2020-11-27T14:59:57 | 2020-11-27T14:59:57 | 316,228,533 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 264 | py | events_repository.py | from Data.Models.events import Event
def add_event(event):
happening = Event(event)
happening.save()
return happening
def show_events():
return Event.all()
def add_gift_to_event(event, gift):
event.gifts.append(gift._id)
event.save()
|
3fba1da0f7cec136f22d471248d3ab26f60cc17a | 5e535a5427ecbeec79d5c72abc0349b6206debbe | /listprograms/sumoflist.py | 9ca131a5198de44bc0c275d8f81cda426f2a6774 | [] | no_license | AswathiSanthosh642/luminarjango | 06d856714bd28d7a8ff77e4a3a3905b08c387581 | 519dadb28b68c5d80bd390a6412446669c85269a | refs/heads/master | 2023-01-23T02:12:52.045934 | 2020-12-02T03:50:35 | 2020-12-02T03:50:35 | 315,501,937 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 87 | py | sumoflist.py | lst=[20,25,30]
# sum = 0
# for num in lst:
# sum+=num
# print(sum)
print(sum(lst)) |
33aa5c5ab75a26705875b55baf61f7f996cb69cd | 79640c7ba532087cd7e5b2f4e4a0500186431989 | /project_vitamins/VitaminSHE/urls.py | 12b69cbab0e49130bd38af729306b19240e6c9fe | [] | no_license | elkrishn/VitaminSHE | 6bf57e7637abf1e0dcc01e6beacaaa6293749f3b | 1dd34fde42b8d736ca5ee3141ed9ced437095447 | refs/heads/main | 2023-06-28T04:33:08.845695 | 2021-08-03T19:57:30 | 2021-08-03T19:57:30 | 382,700,508 | 0 | 1 | null | null | null | null | UTF-8 | Python | false | false | 474 | py | urls.py | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='VitaminSHE-home'),
path('signup/', views.signup, name='VitaminSHE-signup'),
path('login/', views.login, name='VitaminSHE-login'),
path('healthcheck/', views.healthcheck, name='VitaminSHE-healthcheck'),
path('... |
6b616f5ee0a301b76ad3f7284b47f225a694d33c | da0f08c2e7608cfec4d2e32ec05155f2128107bc | /bam2/lib/plprofiler/__init__.py | d232664785a8b5855df0a6d404ca3324fa9ff8cf | [] | no_license | kamfasage/oarfceDll | 886ae0f7860bbbc3a8478d8167e572aa24ea39e6 | dbbe5f31fc6c82dfdc76544f606f7f1bcf76ea1e | refs/heads/master | 2021-01-22T04:34:13.653145 | 2017-03-02T13:22:09 | 2017-03-02T13:22:09 | 81,554,442 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 67 | py | __init__.py | from plprofiler_tool import main
from plprofiler import plprofiler
|
26ae44b5be1d78ed3fe9c858413ae47e163c5460 | d2332604fc80b6d622a263b2af644425a7e703de | /facebook/arrays_and_strings/14_product_of_array_except_self.py | 56305be22d3bc459a29fd38fb29a45c7a652882b | [] | no_license | abhijitdey/coding-practice | b3b83a237c1930266768ce38500d6812fc31c529 | 6ae2a565042bf1d6633cd98ed774e4a77f492cc8 | refs/heads/main | 2023-08-14T23:31:06.090613 | 2021-10-18T21:35:56 | 2021-10-18T21:35:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 790 | py | 14_product_of_array_except_self.py | from typing import List
"""
1. Generate an array containing the products of all elements to the left of current element
2. Similarly, start from the last element and generate an array containing the products to the right of each element
3. Multiply both arrays element-wise
"""
class Solution:
def productExceptS... |
284955a555ce1a727ba5041008cd0bac3c3bed49 | 17c8245e41f9b4df7ca79f8b393a43b176df5bc2 | /update/models.py | e600f731c2b37489ca20ec7f644939171d5ad3cc | [] | no_license | MdReyajuddin/Covid-19 | a8ec2d1222336cef1ce1454050a242cbdb4e8eaa | 1a37418a538315e0200e4939e0267040ce9a0507 | refs/heads/master | 2021-05-22T21:22:02.623111 | 2020-04-04T21:30:19 | 2020-04-04T21:30:19 | 253,102,168 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 288 | py | models.py | from django.db import models
# Create your models here.
class Covid(models.Model):
states= models.CharField(max_length=100, null=True, blank=True)
affected = models.IntegerField(null=True)
cured = models.IntegerField(null=True)
death = models.IntegerField(null=True)
|
3aff6bdfd7c2ffd57af7bb5d0079a8a428e02331 | b633930e7908c7c2a940cb5e6bd28c6615019c6a | /HAN_Evaluator.py | 10e78894cf2c00c812553b777b16860a0f440763 | [] | no_license | bramn22/fake-news-detection | 8d35872b9986b7eb4d3b0174888e74f0d2cc63e2 | ce6c24b558e7ae32ea20fc1a9fb8db1cc0131b8d | refs/heads/master | 2020-04-04T17:02:03.417308 | 2018-06-08T08:54:47 | 2018-06-08T08:54:47 | 156,103,595 | 1 | 2 | null | null | null | null | UTF-8 | Python | false | false | 16,845 | py | HAN_Evaluator.py | import tensorflow as tf
import numpy as np
from datetime import datetime
import os
from CNN import CNN
from LSTM import LSTM
from BiLSTM import BiLSTM
from SLAN import Attention
from HAN2 import HierarchicalAttention
import sklearn.metrics as metrics
import DataProcessor as dp
import matplotlib.pyplot as plt
import num... |
6b2f10449909d978ee294a502a376c8091af06e0 | 7667933ecb5ec02f7824ca5291e26d2badd2bf8b | /src/gerber_canvas.py | 617ffffa90bd9547f39c1c33c22daa2ee8ea52c3 | [] | no_license | lookme2/PartsPlacement | a108e413c691b2b141257f5d599bb616a953f1e4 | 2361914b7f6a24996976048f61bd929a6374fd04 | refs/heads/master | 2022-12-16T03:47:13.000928 | 2021-06-07T12:09:26 | 2021-06-07T12:09:26 | 152,262,671 | 0 | 0 | null | 2022-12-08T07:52:48 | 2018-10-09T14:10:44 | Python | UTF-8 | Python | false | false | 24,091 | py | gerber_canvas.py | import tkinter as tk
from pickplace import PickPlace
import sys
import math
from tkinter import messagebox
import os
DEBUG = False
class GerberCanvas:
file_gto = False
file_gtp = False
units = 0
units_string = ('i', 'm')
"""
my canvas
"""
def __init__(self, frame):
self.x_fo... |
d56aa0f0b7c420e4021736cf8f80923121856d1c | 3283ab354043ab86d4aac504505816622651e665 | /FactoryExmpl.py | 7e6066015caa339304c60607b847032fedb69e48 | [] | no_license | emrekndl/pythonPatterns | 24b5a614d66d1b6c8601b47ecebf39500bd7332c | c5f7a7cb864f14fbad12cc5daee6bbd738e5f3de | refs/heads/master | 2022-11-17T21:03:18.804294 | 2020-07-17T17:42:10 | 2020-07-17T17:42:10 | 280,488,904 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,021 | py | FactoryExmpl.py | import json
import requests
import time
class TRY():
rates = list()
def __init__(self, r):
# if(TRY.rates[-1] != r):
TRY.rates.append(r)
def ls(self):
# print("TRY: "+TRY.rates[e] for e in range(1, len(TRY.rates)))
print(f"TRY: {TRY.rates}")
class USD():
rates = lis... |
f3789d70f784345881f705fc809c49ad4e3526bc | ab308782b5f85d84ed1190665427d1f8cc4538e1 | /NPA_recurrence.py | 12daa33b4cdc1b732ca72c09a0f3bd1cded602a8 | [] | no_license | ZXreaper/NPA_recurrence | f301939fe466ca11b552c87034fafc4eb792dbbf | 863de9a3df31a64941b6d58ff18b0b2196b8bd8e | refs/heads/main | 2023-07-17T17:01:43.619196 | 2021-09-09T11:28:47 | 2021-09-09T11:28:47 | 404,355,428 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 5,343 | py | NPA_recurrence.py | # -*- coding: utf-8 -*-
"""
======================
@author : Zhang Xu
@time : 2021/9/8:16:29
@email : zxreaper@foxmail.com
@content : tensorflow subclassing 复现 NPA
======================
"""
import tensorflow as tf
from tensorflow.keras import *
from tensorflow.keras.layers import *
from keras import ... |
4a17db6b65e1615b0d519581b3e63bc34ad16093 | 98df5026e132ebde3efec7f3648fca1fec301269 | /Tests/best_regressor_testing_parameters.py | 7e48f8152922b51f826bf6acd8816f91aada6a7b | [] | no_license | Vaimaster/RegenerationProject-Car-1 | 75cc86b5db82d50035face5d39293db103c760bb | e78cbf3915c40ba3e0e3789e70dbcf393a398faa | refs/heads/main | 2023-09-03T19:16:44.865765 | 2021-10-22T10:29:23 | 2021-10-22T10:29:23 | 413,821,384 | 0 | 0 | null | 2021-10-05T13:05:30 | 2021-10-05T13:05:29 | null | UTF-8 | Python | false | false | 3,784 | py | best_regressor_testing_parameters.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 15 15:36:38 2021
@author: mav24
"""
import pandas as pd
import numpy as np
from sklearn.preprocessing import QuantileTransformer, StandardScaler, PowerTransformer, MaxAbsScaler
from sklearn.cross_decomposition import PLSRegression
from sklearn.en... |
563e534e4794aa872dcdc5319b9a1943d19f940f | 86c1ea4645260f24b0caf49c84f1e3f9371558ce | /lifegame_core.py | 6b034450c3608cc1038fccfe22a8a4f6eb76af48 | [] | no_license | circulene/lifegame | bebaf9185a2c17259babf99b042c5416784c4f90 | 4b02e3bef9e88747f15968551014aa1f78c1a2a6 | refs/heads/master | 2021-01-19T14:28:18.358371 | 2017-04-25T23:33:28 | 2017-04-25T23:33:28 | 88,165,553 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 2,167 | py | lifegame_core.py | import random
import time
class Cells:
UNDEFINED = 0
DEAD = 1
ALIVE = 2
def __init__(self, nx, ny, density = 5):
self.nx = nx
self.ny = ny
self._cells = [[Cells.UNDEFINED for y in range(ny)] for x in range(nx)]
self._nextCells = [[Cells.UNDEFINED for y in range(ny)] for... |
183862fe4c7f73465e064473aa312cb81753d458 | 86cef983690806682e4a5c605562549b1ba0804f | /backend/app/main.py | 108f72966e94617f43377e881a9b567576f9389c | [] | no_license | lexlem/rps_multiplayer | 998216594cad74f09ae5e0609a65aaa6ea8820b5 | c1519dd7bc5b04d774a8b3ce41610ae8855bf75a | refs/heads/master | 2022-09-22T09:51:24.885908 | 2020-06-03T06:01:02 | 2020-06-03T06:01:02 | 266,324,419 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 447 | py | main.py | from aiohttp import web
from aiojobs.aiohttp import setup
from views import wshandler
async def on_shutdown(app):
for player in app["players"]:
await player.ws.close()
def init():
app = web.Application()
app["players"] = []
app["games"] = []
app.router.add_get("/", wshandler)
app.on... |
f55400e26be4b2a2e4bf37eb1a03b2d93640f76a | 713aba548286388ca0cd0c9bcdf66e39ac9fc764 | /analytics/datamanager/datamanager.py | c6ef78ec52e10f2dbde183321a6a901c3d69c54f | [
"Apache-2.0"
] | permissive | sadikovi/pulsar | 2ca4521dd30844486615580ad029c53eb34f144c | 3267426cf5bd676a3c4c20cbee88a80b89e65b0f | refs/heads/analytics | 2016-09-06T13:38:47.321267 | 2015-03-31T06:14:36 | 2015-03-31T06:14:36 | 28,880,086 | 0 | 0 | null | 2015-03-31T06:17:41 | 2015-01-06T19:40:01 | Python | UTF-8 | Python | false | false | 10,370 | py | datamanager.py | #!/usr/bin/env python
'''
Copyright 2015 Ivan Sadikov
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... |
01eca3d81c34add6c44e23283cf89c2c003b328e | 736636ab73d7f795ce87ecb6e1823236d1acb9c1 | /231717/add_xy_loss/focal_losses.py | 6ecdde404351575c9b59a77ab50218b6376e30b6 | [] | no_license | wzlj/Learning | 3bff47500183297d8b8cde5d5c411bf496671a67 | 1d969fe8c71080956db562d7b60e7bcfcc7a3f34 | refs/heads/master | 2021-06-24T19:29:17.734851 | 2020-12-23T03:37:25 | 2020-12-23T03:37:25 | 172,167,097 | 2 | 1 | null | null | null | null | UTF-8 | Python | false | false | 702 | py | focal_losses.py | """focal loss"""
import torch
import torch.nn.functional as F
def binary_focal_loss_with_logits(input, target, focusing=2, weight=None, size_average=True, reduce=True):
"""
focusing (float): parameter of Focal Loss (0 equals standard cross entropy)
other parameters: see http://pytorch.org/docs/master/nn.... |
28a4ae941f17aa29640da1ec23631e496ed33c2b | 6bc0b0b413dd52d6abf7e78971f355c6e7566e33 | /main.py | 99d5fb2dbece3bbe5104235431556c12df6192fe | [] | no_license | HayeonLee/HELP | dd7ed9d0deb28ff3499f4bd7f8f2350f4176a970 | 3bd7003f7be185700f27bc296c900e10f3c3739d | refs/heads/main | 2023-08-30T23:17:58.786449 | 2021-10-20T08:36:30 | 2021-10-20T08:36:30 | 419,184,135 | 54 | 7 | null | null | null | null | UTF-8 | Python | false | false | 1,718 | py | main.py | ####################################################################################################
# HELP: hardware-adaptive efficient latency prediction for nas via meta-learning, NeurIPS 2021
# Hayeon Lee, Sewoong Lee, Song Chong, Sung Ju Hwang
# github: https://github.com/HayeonLee/HELP, email: hayeon926@kaist.ac... |
0bdb610717a9f8ec6d3be1f1b93d4d3c0fd854da | aac5a5708024f8c0d69fb9429315a1af9ccd664e | /src/users/views.py | a55903e12c4c06cb5b39d407ebdfd01f0d0eb9ad | [] | no_license | Roja1912/DjangoPOC | ce943e752b7fbbf9af81836ef71792ccb76dc278 | 2c205518aec6ecee62320a742fc6332727806897 | refs/heads/master | 2022-11-05T17:04:23.750442 | 2020-06-25T11:09:34 | 2020-06-25T11:09:34 | 274,866,638 | 0 | 0 | null | 2020-06-25T10:37:18 | 2020-06-25T08:33:30 | Python | UTF-8 | Python | false | false | 2,327 | py | views.py | from django.contrib.auth.views import LoginView
from django.views.generic import ListView, TemplateView, DetailView, \
UpdateView, CreateView, DeleteView
from django.urls import reverse, \
reverse_lazy
from django.http import HttpResponseRedirect
from django.contrib.auth import get_user_model
from collections i... |
c51b1fce2ef5a00a4acc98ffeb1bf090a68fdc5e | bdb719575ec8720b7a8f0f4d5c6ab438897075c1 | /lab11/__init__.py | 12116d93b0f25b438df1a208e8e603a21d956ee3 | [] | no_license | tmcvick/CPSC1111-grading | ae75de9d4796029d7bb3302a5f3328a87cc9475c | c73ecec5d76b0c950f98c38ce777eedb9d99d0a8 | refs/heads/master | 2021-01-11T17:46:36.883721 | 2017-04-23T22:05:01 | 2017-04-23T22:05:01 | 79,844,892 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 20 | py | __init__.py | __all__ = ['lab11']
|
18102ad608bc8be1b7850f16d44d7583b346f02f | baa7b744db4862c0101ea8a98fe0bb249fd7e6ca | /run.py | d99b0b7bce242f9b98e20a1420c1faa82fef33ba | [
"Unlicense"
] | permissive | chris-oreilly/NATO-alphabet | 782e8ea16a7df8f9bc652297d6127534a56f2bc5 | 1c9ec0f004c02e827a0c6aa0350d1adee6aba28d | refs/heads/master | 2021-01-12T04:14:19.393891 | 2016-12-28T22:08:42 | 2016-12-28T22:08:42 | 77,555,702 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,316 | py | run.py | import random
alphabet = {
'a': ('alfa', 'alpha'),
'b': ('bravo', ),
'c': ('charlie', ),
'd': ('delta', ),
'e': ('echo', ),
'f': ('foxtrot', ),
'g': ('golf', ),
'h': ('hotel', ),
'i': ('india', ),
'j': ('juliett', 'juliet'),
'k': ('kilo', ),
'l': ('lima', ),
'm': ('m... |
184e7c2648927302e015ff0cc1b095808cbb7df7 | 626de99d8b1bd7bfe626e8e7f33d9466897ea65c | /models/siamese_net.py | bc86b4265f262afc9634dc77584847fa1a89ca68 | [
"Apache-2.0"
] | permissive | mlelarge/graph_neural_net | 79a2be96bdca19cf789c589bc14306099e6b3eb7 | 58912098b9c98bb8eeb79bab9539c5c6c3a6420b | refs/heads/main | 2023-05-25T05:09:59.589595 | 2022-02-17T18:11:45 | 2022-02-17T18:11:45 | 238,407,933 | 42 | 18 | Apache-2.0 | 2023-08-25T09:53:11 | 2020-02-05T09:02:50 | Python | UTF-8 | Python | false | false | 4,148 | py | siamese_net.py | from typing import Tuple
from numpy.lib.arraysetops import isin
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.base_model import Simple_Node_Embedding
from models.gated_gcn import GatedGCNNet_Node, GatedGCNNet_Edge
class Siamese_Model(nn.Module):
def __init__(self, original_feature... |
41e3252fa4e0e364091452f69347eac96e6a9c13 | e026506f675d51a0b595ab60591f29a3c96acbe9 | /hello/pap_pgms/1_select.py | 47f0313e5d8a68882fb324b089d1ed266528211e | [] | no_license | hybridNeo/Compiler-design | f17ce5269745cd6d2b4c248d57ff9951af6748e6 | d7ae150f3288f3067ea1e5510f14a11bbe94cbe2 | refs/heads/master | 2020-04-04T03:48:30.462496 | 2014-10-10T04:12:34 | 2014-10-10T04:12:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 263 | py | 1_select.py | # installation
# sudo easy_install pymysql3
import pymysql
con = pymysql.connect()
cur = con.cursor()
cur.execute("use test")
cur.execute("SELECT * FROM stud")
rows = cur.fetchall()
print(type(rows))
for row in rows:
print(row)
print(type(con))
con.close()
|
216631ddb08f65552a2be8293bef67b097832c4c | 1a5f989d9b04e2caad0f778f200f33a2583577f9 | /72-edit-distance/72-edit-distance.py | 95911811bed486122eb6d47bf662487e91d2e12c | [
"Apache-2.0"
] | permissive | e-lin/LeetCode | 768830ba2b326ca91fa7d125f1113166bf259a70 | 1a00e187b5ccea3bddabf93a29164bf0ad928b7d | refs/heads/master | 2020-04-18T12:06:10.640859 | 2017-03-13T04:46:00 | 2017-03-13T04:46:00 | 67,863,935 | 0 | 0 | null | null | null | null | UTF-8 | Python | false | false | 1,425 | py | 72-edit-distance.py | # solution reference:
# http://cpmarkchang.logdown.com/posts/222651-minimum-edit-distance
class Solution(object):
def minDistance(self, word1, word2):
"""
:type word1: str
:type word2: str
:rtype: int
"""
m, n = len(word1), len(word2)
if m == 0:
r... |