blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
773d323967b2a5660eaac511c244f9c52d1343b2 | 560fde21b9c7268705251eb7c33d5f50154c2f0d | sdhamdar7890/python-Data-type-and-Algorithm | /search.py | Python | py | 470 | no_license | def linearSearch(arr, x):
for i in range(len(arr)):
if arr[i] == x:
return i
return -1
def binarySearch(sorted_arr, x, min_index = 0):
n = len(sorted_arr)
mid = n//2
if x == sorted_arr[mid]:
return min_index + mid
elif x > sorted_arr[mid]:
return binarySearc... |
de6e8f4c9a19d586d317d11558bef8a1af0fea96 | 9f03c043827c7bb454ed27bf44ec2ebfd3d30181 | explosion/thinc | /thinc/tests/backends/test_ops.py | Python | py | 52,692 | permissive | import inspect
import platform
from typing import Tuple, cast
import numpy
import pytest
from hypothesis import given, settings
from hypothesis.strategies import composite, integers
from numpy.testing import assert_allclose
from packaging.version import Version
from thinc.api import (
LSTM,
CupyOps,
Numpy... |
0b76f67d99ab17731cac8b3435253e644544a34b | 7353d935d4810ef5b6d679bd27ac6127ebc515da | Hardik27/SADP-Tutorial | /TUT/TUT1/python/client.py | Python | py | 478 | no_license | import socket
host= input("Enter Host: ")
port= 5444
server=('localhost', 5454)
#server=((host,port)) //doesn't work
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((host,port))
expr=input("input expression: ")
while expr!='q':
s.sendto(expr.encode('utf-8'),server)
ans,addr=s.recvfrom(1024)
an... |
21bc3bf98d260fdc3ccc1d25ab1f1752c8bbbbbe | 094e2ca880d24bc81e1b57fc96b33e0615849fdc | mirfarzam/python-advance-jadi-maktabkhooneh | /.history/antz/crawler_20200405024438.py | Python | py | 2,118 | no_license | import requests
from bs4 import BeautifulSoup
import time
import re
# from antz.models import CardBrand, CardModel, CardTrim, Car
def crawlCarPage(url):
time.sleep(1)
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
title = soup.findAll("h1", {"class": "addetail-title"})[0]
titleSpans = ... |
fa91d272e363559ce9a72dd3f78844c454697952 | be477b0bf5d006bfe94a9fb246892312a1426d59 | nivagator/tweetme | /src/accounts/api/urls.py | Python | py | 251 | no_license | from django.conf.urls import url
from django.views.generic.base import RedirectView
from tweets.api.views import (
TweetListAPIView
)
urlpatterns = [
url(r'^(?P<username>[\w.@+-]+)/tweet/$', TweetListAPIView.as_view(), name='list'),
]
|
a41c356cfa755c5815c6e8e69b0cf0a85d24719e | 6cf4ac0d846642040693c6f91246400196a6cbb3 | aimldspro/dvc | /dvc/remote/base.py | Python | py | 17,720 | permissive | import errno
import hashlib
import itertools
import logging
from concurrent import futures
from concurrent.futures import ThreadPoolExecutor
from functools import partial, wraps
from dvc.exceptions import DownloadError, UploadError
from dvc.hash_info import HashInfo
from ..progress import Tqdm
from .index import Remo... |
f19a74d83a22cf64a5b5a2c1c8b40c14a61475d3 | a609119c481004aaeaa4c44611df3f690f22b560 | laowuniubi/python_master | /apps/user/forms.py | Python | py | 10,059 | no_license | from django import forms
from apps.user.models import UserModel
from tools.tool_form import ErrorInfoForm
from tools.password_tools import my_make_password, my_check_password
from tkinter import messagebox
from django.contrib import messages
import tkinter.messagebox
from tkinter import *
import win32api,win32con
# m... |
7e32403065b96fc1b2f36c65576e1eaa49bc8d6b | 8d7de4017ebfc5778d1afffa7766563a719f2c57 | Ophthalmology-CAD/CSLSTM-ResNet | /myself/cost-test/3-4-resnet50_classify_video.py | Python | py | 7,583 | permissive |
import numpy as np
import glob
#caffe_root = '../../../'
import sys
sys.path.insert(0,'../../python')
import caffe
caffe.set_mode_gpu()
caffe.set_device(0)
import pickle
cross = ['1','2','3','4','5']
for i in range(5):
RGB_video_path = '/home/shiyan/lisa-caffe-public-lstm_video_deploy/examples/LRCN_activity_recognit... |
f1552825a3e0154f0f5175e046475c1b0c50a91e | 23ab58e464e7c201ec619829e7e7dc8f13d95175 | pyqg/pyqg | /pyqg/xarray_output.py | Python | py | 6,235 | permissive | import numpy as np
try:
import xarray as xr
except ImportError:
raise ImportError(
"Xarray output in Pyqg requires the Xarray package, which is not installed on your system. "
"Please install Xarray in order to activate this feature. "
"Instructions at http://xarray.pydata.org/en/stable... |
f1b2bb435c651b61bd894e5a16972dbcfd651c7c | 806692e8dbc72961c23d12efe331d7a2d7b362c0 | winhtaikaung/lay-zate-api | /server.py | Python | py | 1,533 | permissive | import os
from os.path import dirname, join
import tornado.options
import tornado.web
from dotenv import load_dotenv
from tornado.ioloop import IOLoop
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)
load_dotenv(dotenv_path, verbose=True)
from db.db_helper import DBHelper
from handlers.base_han... |
e18a0f426d46b2dc33ecc88047dbb89a6aab1409 | 36c955d57f434cce2a5805eb56e0b36ff2db2858 | GiulioRossetti/cdlib | /cdlib/prompt_utils.py | Python | py | 471 | permissive | def report_missing_packages(package_list: list):
if len(package_list) > 0:
print(
"Note: to be able to use all crisp methods, you need to install some additional packages: ",
package_list,
)
def prompt_import_failure(package: str, exception: Exception, show_details=False):
... |
90483a7d7a445bd403496303c647edc8ad4dfff7 | a0894a3940745b4a9a06febd1e6f0ddc33e8d735 | theChad/ThinkPython | /chap13/analyze_book.py | Python | py | 9,124 | permissive | import string, random
# Exercise 13.1
# I didn't use translate. I search the strings for the offending
# characters one by one.
# General function I can use to create the punctuation and whitespace functions below.
def remove_chars(s, chars):
"""Remove any character in chars from string s
s: string
chars:... |
43a0cd06955736203ff2f839b54554dbd65c5db5 | 65a7930c1a9f85921dc75cf7cc4dbb439ddb0763 | ciucu3madalina/magazin_online | /magazin.py | Python | py | 2,486 | no_license | import flask
from flask.ext.sqlalchemy import SQLAlchemy
app = flask.Flask(__name__)
app.config['SECRET_KEY'] = 'ceva secret'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////home/student/osss-web/db.sqlite'
db = SQLAlchemy(app)
class Product(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = d... |
9ade91adb1ce8b347c87bd4e0f0e203b4c289130 | 0074034fe2dbe498578bbfedde542dbf00949006 | pdhhiep/Computation_using_Python | /test_values/arcsinh_values.py | Python | py | 3,264 | no_license | #!/usr/bin/env python
#
def arcsinh_values ( n_data ):
#*****************************************************************************80
#
## ARCSINH_VALUES returns some values of the hyperbolic arc sine function.
#
# Discussion:
#
# In Mathematica, the function can be evaluated by:
#
# ArcSinh[x]
#
# Licensi... |
185e2b67e9d8b750302a4b70ba0adbf7bdc29875 | 8a8e4e5638b5d4fb1b045bbf8a4fd9bf7412c1f9 | bitcoinnano/btcnano-wallet-client-desktop | /plugins/labels/kivy.py | Python | py | 335 | permissive | from .labels import LabelsPlugin
from bitcoinnano.plugins import hook
class Plugin(LabelsPlugin):
@hook
def load_wallet(self, wallet, window):
self.window = window
self.start_wallet(wallet)
def on_pulled(self, wallet):
self.print_error('on pulled')
self.window._trigger_upd... |
306220bc73bce5e21f438d734ffa00590b9d459e | db3672c41ce2e4244baa99a7c495f963156f418f | caschindler/machine-learning | /classification/logistic_regression-gradient_ascent.py | Python | py | 5,683 | no_license | # Load Graphlab to use SFrames/SArrays
import graphlab
# DATA PREPARATION
# Example runs on an Amazon baby products review dataset
products = graphlab.SFrame('amazon_baby_subset.gl/')
# Check balance of positive and negative reviews
print '# of positive reviews =', len(products[products['sentiment']==1])
print '# o... |
6e3a585d34608ce53fb7d468f5f24bc06bc4b83d | da7fe739f1972ed4575424d4e48fd692db32ebbd | TATlong/keras_bert | /bertTAT/transformer/transformer.py | Python | py | 6,871 | no_license | # -*- coding: UTF-8 -*-
from bertTAT.transformer_utils.layer_normalization import LayerNormalization
from bertTAT.transformer_utils.multi_head_attention import MultiHeadAttention, attention_builder
from bertTAT.transformer_utils.feedforward import FeedForward
from bertTAT.transformer_utils.triangle_position_embedding i... |
e76278dca53068363e75e7c8442b5d978f944c25 | e3a5ccea78222a2061b135129faa66d4dcd4c0a6 | dimara/synnefo | /snf-webproject/synnefo/webproject/management/tests.py | Python | py | 949 | permissive | import sys
from synnefo.webproject.management import utils
# Use backported unittest functionality if Python < 2.7
try:
import unittest2 as unittest
except ImportError:
if sys.version_info < (2, 7):
raise Exception("The unittest2 package is required for Python < 2.7")
import unittest
class ParseF... |
88100f816eb17b62b1922f2ff30a7e67d72c0706 | e0d14b884cd2058885e14ae83f4abd3538271c15 | DrFunny/DeepLav-V3-Custom-Dataset | /deeplab_model.py | Python | py | 13,258 | permissive | """DeepLab v3 models based on slim library."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib.slim.nets import resnet_v2
from tensorflow.contrib import layers as layers_lib
from tensorflow.contrib.framework.... |
898c5ff48004674a7282bd847fc69df3561e0dbe | 24d00b4c61038e9c5f9baae9dcf23754054da9ae | NullMobGu/django_learning | /my_lea/urls.py | Python | py | 748 | no_license | """my_lea URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
7900d1ed059e46b542099af302bbcfede64823ce | 62886026c5f01c6b15a4dc0251aae02a1a8d5b66 | harryprince/probability | /tensorflow_probability/python/positive_semidefinite_kernels/psd_kernel_properties_test.py | Python | py | 9,783 | permissive | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... |
25f8f98ef0bc35545627a3c2aabde12cac157677 | 313682957ef51aa34b12b20da7f0a714a663fd15 | isaif1/Blogging_With_Admin | /blog/migrations/0002_comment.py | Python | py | 1,053 | no_license | # Generated by Django 3.2.3 on 2021-05-20 13:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Comment',
fi... |
bcde78aa36c61f2c8cf8723e004c70cdafc04339 | 82f35d81934fccd61928804ff50d4815ef4fec92 | libincla/MyDjango | /index/models.py | Python | py | 3,538 | no_license | from django.db import models
from django.utils.html import format_html
# 创建产品分类表
class Type(models.Model):
id = models.AutoField(primary_key=True)
type_name = models.CharField(max_length=20)
# 设置返回值,若不设置,则默认返回Type对象。可使下拉框显示字段 type_name
def __str__(self):
return self.type_name
# 创建产品信息表
# 设置... |
1c2bf7c4904cf8876eb685dc842eb9e73552a94b | 751c601222349edd87d20c62f134b1d63deea792 | ctn-archive/nengo_theano | /nengo_theano/scripts/cortical_action.py | Python | py | 3,106 | permissive | import nengo_theano as nef
import random
def make(net, name, neurons, dimensions, action_vals=None,
scale=2.0, mode='spiking'):
"""A function that makes a subnetwork to calculate the weighted
value of a specified cortical action.
:param Network net: the network to add it to ... |
25c5506fdddd3b59f9a71f22437cad83349bdf73 | 745ccabcf3aef7b827ff72b1d4cf0ed5250b445c | cheneyuwu/rlfd_experiments | /d4rl/halfcheetah-medium-v0/july20/td3_orl.py | Python | py | 704 | no_license | from copy import deepcopy
from rlfd.params.td3 import gym_mujoco_params
from rlfd.params.shaping import orl_params
params_config = deepcopy(gym_mujoco_params)
shaping_params_config = deepcopy(orl_params)
params_config["config"] = ("TD3_OfflineRLShaping",)
params_config["env_name"] = "halfcheetah-medium-v0"
# ORL Sha... |
db6faee3442fb6145ec0dc20f404fd69f91529e6 | bcea8d433c6d10351015d8d0ffbf6a68f620891d | otus-devops-2019-02/yyashkin_infra | /ansible/my_env/lib/python2.7/site-packages/ansible/utils/module_docs_fragments/ovirt.py | Python | py | 4,068 | permissive | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... |
851844b10f45f20a69919f0a9b18125988605314 | c5ad9954bd5848e9f04629b921673613ffac8458 | rubiyadav18/WebScrapping-IMDB | /task2.py | Python | py | 459 | permissive | import json,os
f=open("web_task1.json","r")
data=json.load(f)
print(data)
empty=[]
dict1={}
for i in data:
if int(i["year"]) not in empty:
empty.append(int(i['year']))
empty.sort()
print(empty)
for j in empty:
store_year=[]
for k in data:
if j==int(k['year']):
store_year.app... |
8344192359b11cf0fd8124730b743f80fbf6af4c | a6c0a28cb984ab710769c27ec8b81cb3ec1a644f | llamicron/cse3380 | /extra_credit/problem6.py | Python | py | 576 | no_license | import numpy as np
import matplotlib.pyplot as plt
# Load the data
data = np.loadtxt("dataset2.txt")
# All the x values
a = data[:,0]
# Filled in with ones because that's how least-squares works
filled_a = np.vstack([a, np.ones(len(a))]).T
# all the y values
b = data[:,1]
# Compute least-squares
lsq = np.linalg.lstsq(... |
8c90ac32895ca98bb24e314ca82722c9c1666c30 | f5d09d15fe0967c49be09aecd5422a260c330dc4 | lkc9015/freestyle_project | /app/NLP_NMF.py | Python | py | 4,288 | permissive | import csv
import numpy as np
import sklearn.feature_extraction.text as text
from sklearn import decomposition
import matplotlib.pyplot as plt
### customize function ###
def read_letter_from_file(csv_file_path):
letters = []
with open(csv_file_path, "r") as csv_file:
reader = csv.reader(csv_file)
... |
6ae41d409a2485098f48b61d37dc17536186f786 | 25207d75698897d5157d1d13576a2d9640687f1f | LeopoldACC/Algorithm | /dp/矩阵路径型/120三角形最小路径和.py | Python | py | 446 | no_license | class Solution:
def minimumTotal(self, triangle) -> int:
n = len(triangle)
dp = [[0] * n for _ in range(n)]
for i in range(n):
dp[-1][i] = triangle[-1][i]
for i in range(n-2,-1,-1):
for j in range(i+1):
dp[i][j]=triangle[i][j] +max(dp[... |
45bc1b7c2aa6611ddd67d9d24aa1e6f79ed2bdf1 | a9c9933b4a351e0748ab03fb9a1d4d64d7d7b14c | Taewoong-H/algorithm | /백준/5568번 카드 놓기.py | Python | py | 254 | no_license | import itertools
n = int(input())
k = int(input())
card = []
for _ in range(n):
card.append(input())
nPr = itertools.permutations(card, k)
list_nPr = list(nPr)
answer = []
for i in list_nPr:
answer.append(''.join(i))
print(len(set(answer)))
|
1863ad35dab0aa6bce3db5cf3e20558f1ab7061d | 2f4eacb2160a8c3a1cdf16ee5d9c970e536b6a4d | softdevteam/eco | /lib/eco/incparser/astree.py | Python | py | 24,676 | permissive | # Copyright (c) 2012--2013 King's College London
# Created by the Software Development Team <http://soft-dev.org/>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, inclu... |
92ff1f21f24f0525690b2e7697e4fda97a854023 | 94f9a1b0bd735218f40ec6fb60d6e6ebdd6bcf4e | masteranimax/pixelete-2020 | /ps1_code.py | Python | py | 23,541 | no_license | import numpy as np
import cv2
import cv2.aruco as aruco
import serial
import heapq
import math
import time
from time import sleep
# loading caliberataed things
lr = np.load('lrr.npy')
ur = np.load('urr.npy')
ly = np.load('lry.npy')
uy = np.load('ury.npy')
lb = np.load('lrb.npy')
ub = np.load('urb.npy')
... |
4ae8d702896a473dd928f4ce491caa4b604c123f | 78e7e3c530e264fefb89d31a1970ea6118f21afe | GotEmCoach/cossh | /cossh/shell.py | Python | py | 428 | no_license | #!/usr/bin/env python3
import asyncio
from socket import socketpair
import asyncssh
async def writer(session):
print('this')
async def shellloop(initshell, debug):
await initshell[0].wait_closed()
await writer(initshell[1])
async def remote_shell(initshell, debug):
try:
await shellloop(... |
f88d05fe4ce1692acff0c660b0e0306da2a99037 | 9f32b58ec4397fe1b13d9f1285f60116d091071f | sawarn-mayank/educa | /courses/migrations/0001_initial.py | Python | py | 2,196 | no_license | # Generated by Django 3.2.6 on 2021-08-20 16:26
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
dec8dbde59a597cefe7d62cb1b61703f541c96b4 | f3daf42da2037a47d125a5ae3baa2b6a8cbf9d53 | MadDinosaur/AdventOfCode2020 | /Day6.py | Python | py | 1,182 | no_license | # For each group, count the number of questions to which anyone answered "yes". What is the sum of those counts?
def part_one():
group_answers = []
answers = set()
while True:
line = input()
if line == "end":
group_answers.append(answers)
break
if line != "":
... |
5af0b3d55896cde3629310feba03f74e61b437f8 | a65599359d5b68598512979cc014c90788b90133 | NULLCT/LOMC | /src/data/22.py | Python | py | 612 | permissive | from sys import stdin
read = stdin.readline
(N, Q) = map(int, read().split())
AB = [list(map(lambda i: int(i) - 1, read().split())) for j in range(N - 1)]
CD = [list(map(lambda i: int(i) - 1, read().split())) for j in range(Q)]
nbr = [set() for i in range(N)]
for (a, b) in AB:
nbr[a].add(b), nbr[b].add(a)
dtc = ... |
44951c0737a7d05303d85c4a9103c7fad5975466 | d0af49a2476bb4b99130d5cf7e263cf26ed0f2a6 | nishant42491/mb-app | /mb_project/settings.py | Python | py | 3,152 | no_license | """
Django settings for mb_project project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from path... |
0488f289dd545b02d653fb7ded56817dde209e8b | 100473748c36a2c84f02b668d66c9d36d525f08d | akackon/machineLearning | /functions.py | Python | py | 255 | no_license | import pandas as pd
import numpy as np
data = np.array([[1,2,3], [3,4,5], [4,5,6]])
df = pd.DataFrame(data)
df.columns = list('ABC')
print(df['A'])
def foo(x):
return(x**2)
print(foo(4))
print(df.shape)
print(df['C'].apply(foo))
print(df['C']) |
013d14ea497b95f7a8d437c6b35d5a0f3ea6912f | a0338432f1c524f19be7062d90a194ecf68afac5 | NYPL/gazetteer | /etl/parser/digitizer_shapefile.py | Python | py | 3,825 | permissive | import sys, json, os, datetime
from shapely.geometry import asShape, mapping
from fiona import collection
from core import Dump
from feature_type_maps.digitizer_types import use_types_map, use_sub_types_map
def extract_shapefile(shapefile, uri_name, simplify_tolerance=None):
for feature in collection(shape... |
5334c3eb4c5d4ec1fb9f9324b5c4f871aeddc443 | 8fcce5cc085680010fbc6474c0db7494728239da | LittleFee/python-learning-note | /day07/13-json-practice-2.py | Python | py | 587 | no_license | # 10-12 记住喜欢的数字:将练习10-11 中的两个程序合而为一。如果存储了用户喜
# 欢的数字,就向用户显示它,否则提示用户输入他喜欢的数字并将其存储到文件中。运
# 行这个程序两次,看看它是否像预期的那样工作。
import json
fname = 'num.json'
try:
with open(fname) as f_obj:
num = json.load(f_obj)
except FileNotFoundError:
num = input('你喜欢那个数字: ')
with open(fname, 'w') as f_obj:
json.dump(n... |
7bdb8d3dedf72bd3e74f95c6bb11048da2b58d16 | f36d3beea705bba575edd85f746ee378625b5c0e | ZakariaBrahimi/mindset_team_project | /env/Scripts/src/project/settings.py | Python | py | 4,684 | no_license | """
Django settings for project project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
#... |
81d9c55ef86144a35d97f1181fdc3bff2f5b1e76 | b03aa8ef4354cded6c79d19e810743a4e606773b | IkhwanSalleh/Automated-Dose-tracking-and-Reporting-system-Python | /PROCESS2.py | Python | py | 1,570 | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 12 12:38:25 2019
@author: 60111
"""
import DICOMTOIMAGE2
import IMAGEPROCESSING2
import METADATAPYDICOMANALYSIS2
import REGIONOFINTEREST2
import TOEXCEL2
from matplotlib import pyplot as plt
def processingmaster2(path,q2,Series_library,q2A):
t... |
6e0bbee20127c62651c06431a3210fb1e41320fe | a102582fca8e1a81f0a9b30dd3d389d9255d7e6c | sciris/openpyexcel | /openpyexcel/worksheet/protection.py | Python | py | 3,883 | permissive | from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyexcel
from openpyexcel.descriptors import (
Bool,
String,
Alias,
Integer,
)
from openpyexcel.descriptors.serialisable import Serialisable
from openpyexcel.descriptors.excel import (
HexBinary,
Base64Binary,
)
from openpyexce... |
74c34f664e9b7672adbe1eb9169d2c37ca23c927 | 209639af7c9e9aa2be21d5c6c4dbd3e056bb8f9d | timcera/wdmtoolbox | /src/wdmtoolbox/__init__.py | Python | py | 703 | permissive | """Package __init__.py.
Taken from numpy that they use to import openblas.
Helper to preload windows DLLs to prevent DLL not found errors.
Once a DLL is preloaded, its namespace is made available to any
subsequent DLL.
"""
import glob
import os
import sysconfig
if os.name == "nt":
from ctypes import WinDLL
... |
9b9cd2264ce0c58f973e4bc8403a00154a817fa0 | f9b4cd6111d8fbbaad0fd5a05cb8b0afcd5cbf56 | andrewdes/IRobot_website | /RobotWebsite/wsgi.py | Python | py | 402 | no_license | """
WSGI config for RobotWebsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... |
4ec432871fadf023457fe2d4518f3e817ef4f8cc | d351935972a2b795944e79c120919d06d2945729 | dodgrile/django-testing | /config/wsgi.py | Python | py | 1,708 | permissive | """
WSGI config for Project Tracker project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLIC... |
15c53e70df0b3d326655411f8e22124638aa9664 | 0f9af43ff1563ffa39f9148cf49301781fcf894d | elliotthwang/glyce | /glyce/models/glyce_bert/glyce_bert_classifier.py | Python | py | 2,082 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Yuxian Meng
# Last update: 2019.03.25
# First create: 2019.03.25
# Description:
#
import os
import sys
root_path = "/".join(os.path.realpath(__file__).split("/")[:-4])
if root_path not in sys.path:
sys.path.insert(0, root_path)
import torch
i... |
561dc65a9d2934078126a08b7fb6c69fd7074716 | 8e0cd71f2e6c607822931f4f071658b074e9d40a | ciel-yu/canal-aux | /scripts/scanean.py | Python | py | 1,016 | no_license | # -*- coding: UTF-8 -*-
from tio.barcode import InbarcodeOcr
import argparse
import os
import re
import sys
def main():
parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter )
parser.set_defaults( **{
'verbose': False,
'version': False
} )
parser.add_ar... |
d84091fcffb3fe2c1aaf8d7b6e1026830f793801 | 70506101d3086999e9585f754a871e59ca23c612 | novakale/openvino | /tools/mo/openvino/tools/mo/front/kaldi/tanh_component_ext.py | Python | py | 399 | permissive | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.ops.activation_ops import Tanh
from openvino.tools.mo.front.extractor import FrontExtractorOp
class TanhFrontExtractor(FrontExtractorOp):
op = 'tanhcomponent'
enabled = True
@classmethod
def extr... |
efd2a8d8299907d5dfebd31e7697e5e203aa0941 | 7c5e5b98bdc44fbd05eb41fb3e95fe293745949b | rhzx3519/leetcode | /python/1695. Maximum Erasure Value.py | Python | py | 511 | no_license | class Solution(object):
def maximumUniqueSubarray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
ans = 0
l = s = 0
mem = {}
n = len(nums)
for r in range(n):
s += nums[r]
while l < r and nums[r] in me... |
887d34078f849b37e5c548190bbce2f454dac45d | 9b173eb7eb0efed4ba8f58b503d7823f5b4ed159 | mingmingl233666/tensorflow | /tensorflow/python/compat/compat.py | Python | py | 5,758 | permissive | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
f62fc96b9f6926a89bc938f049a6e895e80909fb | 088d5aa296868108685b0670315c1bd8afd472d4 | shaohu/pysal_core | /pysal_core/cg/ops/tests/test_shapely.py | Python | py | 6,939 | no_license | import unittest as ut
from .. import _shapely as sht
from ...shapes import Point, Chain, Polygon
#from ... import comparators as comp
from pysal.contrib import shapely_ext as she
from pysal.contrib.pdio import read_files as rf
from pysal.examples import get_path
import numpy as np
from warnings import warn
@ut.skip('... |
de3db7daa61fcc8bfb0d4296a1841f24eb810c9c | b83cc728e664474fc99f41fac0893a8cd81bc568 | 15914145294/HelloWorld | /database/newsTables.py | Python | py | 1,613 | no_license | # -*- coding: utf-8 -*-
"""
Created on 2016-12-27
@author hechangshu1
"""
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
# from lib import config
from datetime import datetime
# 获取公共帐号信息
database = "news"
config_name = "test"
# config_name = "selfstockdb"
# 获取对应模块的数据库信息
# databaseInf... |
be676ed551e19d704e6d202844c5f00b1e9180a8 | e8c545ffabea120610036a4cd0b141314c9f87ae | Thakur-Govind/SudokuSolver | /Sudokuu-BackEnd/Sudokuu/settings.py | Python | py | 3,647 | no_license | """
Django settings for Sudokuu project.
Generated by 'django-admin startproject' using Django 2.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... |
4485ac7e303f664c0fc83713715dc7d87153cc17 | 7a1795f64237eae788f72679d4fc2f6b527b04e5 | konradkusiak97/PPSTM | /IETS_test_FePc.py | Python | py | 13,555 | no_license | #!/usr/bin/python
import os
import numpy as np
import pyProbeParticle.GridUtils as GU
import pyPPSTM as PS
import pyPPSTM.ReadSTM as RS
import matplotlib
matplotlib.use('Agg') # Force matplotlib to not use any Xwindows backend. ## !!! important for working on clusters !!!!
import matplotl... |
36f50617222ee8a6e44cc1fe493b132f9495b8d8 | 8d8d497f10e85b4eefb89726e7adb16e6bf1b778 | asterter5/Universidad | /1. Primero/Algorismica/practica5.py | Python | py | 2,918 | no_license | # practica5.py
#
# autor: Astor Prieto (aprietde10)
import time
import math
def fib(n):
if n == 1:
return 1
if n == 0:
return 0
return fib(n-1) + fib(n-2) #si n es mes gran que 1, la funcio es va cridant a ella mateixa fins a arribar a 1 o 0.
def fib1():
x = input("Quin numero vols d... |
afe794b698cc6b502e69a60e5e327270eacd04e8 | ff6bf65f72d0f1b3e48e77ab72b6dbb9b3e902cd | neoclide/npm.nvim | /rplugin/python3/denite/source/npm/used.py | Python | py | 1,808 | permissive | # pylint: disable=E0401,C0411
from os.path import expanduser
from ..base import Base
from ...kind.npm import Kind as BaseKind
class Source(Base):
def __init__(self, vim):
Base.__init__(self, vim)
self.name = 'npm/used'
self.kind = Kind(vim)
self.home = expanduser('~')
self.... |
09d5a93d35563836586aafe04bb4f3ae09151bb3 | b75482e9c5a54ea0f38c6de486ff92ace21d2ae7 | database-ai4db-group/Dotil | /data/Dataset/Watdiv.py | Python | py | 995 | no_license | """
author: zhr
处理和分解Watdiv文件
"""
import re
def parse_csv(num):
f = open("D:\\research_data\\watdiv_2g\\bin\\Release\\factor" + str(num) + ".nt", "r", encoding="utf8")
fw = open("D:\\research_data\\watdiv_2g\\bin\\Release\\factor" + str(num) + ".csv", "w", encoding="utf8")
line = f.readline()
while li... |
963d75d7548c0df3027de798fe73bc7d9540dfa8 | 3d0707aae7873092fb9043fa0cf949cd3c1c7149 | Dark-on/pms-labs | /lab1_2/coordinate.py | Python | py | 3,950 | no_license | from __future__ import annotations
from enum import Enum
class Direction(Enum):
LONGITUDE = 0
LATITUDE = 1
class CoordinateDS():
""" Abbreviations in this class:
d - degree
m - minute
s - second
D - direction
"""
_CARDINAL_DIRECTIONS = (('N', 'S'), ('W', 'E'))
... |
71a3f4a5f3c721208487149bda24b1f17d7c75eb | 4ef92ecaf32deff37317c8caf9826a2a0edaf532 | aartij17/DiSC | /protocols/streamlet_blockchain.py | Python | py | 6,225 | no_license | from common.hash import hash_function
from main import log
STREAMLETBLOCKDELIMITER = ","
class StreamletBlockchain:
def print_blockchain(self):
for i, end_block in enumerate(self.blockchain_top):
curr_block = end_block
log.debug("Blockchain fork " + str(i))
while (cur... |
77afbb7bbf7ffdcbd8cfb353c1ca669f15ebca8a | e47e60a102221bdb71dac1e010072f36b7cb4bf9 | astagi/exp-api | /tests/test_search.py | Python | py | 932 | permissive | from taiga import TaigaAPI
import unittest
from mock import patch
from .tools import create_mock_json
from .tools import MockResponse
from taiga.models import Task, UserStory, Issue
class TestSearch(unittest.TestCase):
@patch('taiga.requestmaker.RequestMaker.get')
def test_single_user_parsing(self, mock_requ... |
2098bb72b6b541eb81871a9a4d5db40727db9bc2 | f1f05597da88a26a260fd16e7ceba0f04f386f5f | ibmresilient/resilient-community-apps | /fn_jira/fn_jira/util/config.py | Python | py | 5,384 | permissive | # -*- coding: utf-8 -*-
"""Generate a default configuration-file section for fn_jira"""
from __future__ import print_function
def config_section_data():
"""Produce the default configuration section for app.config,
when called by `resilient-circuits config [-c|-u]`
"""
return u"""
[fn_jira:global_set... |
fb2ed8540963bf0171014c929e12857a50a95318 | 5ef4e42f71a7a8103f15ebe78e710c445862f7be | qwisz/cyber_punk_me | /cpm.py | Python | py | 1,998 | no_license | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split, cross_val_score as cv_score, GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.decomposition import PCA
from sklearn import svm
import seaborn as sns
... |
149c168bea0be8b508dfaad749f9d6227c699f9d | 23998e4b4ba819566de829196d8eb7fbd70361c5 | pkhmath/PCB_Detection_and_Sensor_Fusion | /consolidated_spr_processing.py | Python | py | 7,401 | no_license | #******************************************************************************************************************************************
# TITLE : CONSOLIDATED_SPR_PROCESSING
# AUTHOR : PRAKASH HIREMATH M
# DATE : AUG 2018 - JUN 2019
# INSTITUTE : INDIAN INSTITUTE OF SCIENCE
#****************************... |
09bf04cd1c3c846d57a48215b5d008b530eedc2e | ce7390f7e6d9b2708d06dc912047e3f9a3d13941 | dongtaoy/STGdjango | /system/label/views.py | Python | py | 1,141 | no_license | __author__ = 'dongtaoy'
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from system.forms import LabelForm
from system.models import Label
class LabelCreateView(SuccessMessageMixin, CreateView):
... |
8d6a6052d8c52e4979099ddaa4303541308a4262 | 983da3b2c696b5d2a6fa1b8d3be2654036890307 | mne-tools/mne-features | /mne_features/univariate.py | Python | py | 53,284 | permissive | # Author: Jean-Baptiste Schiratti <jean.baptiste.schiratti@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD 3 clause
"""Univariate feature functions."""
from math import sqrt, log, floor, gamma
from collections.abc import Iterable
import numpy as np
from scipy import stats
from sc... |
15df00be87ecd603b62668e01747ee2945e501eb | 65e271904509525b6d048a8b6850b7809041b57d | IIShawnII/ChanImageDownloader | /chanImageDownloader.py | Python | py | 4,770 | no_license | #!/usr/bin/python3
"""
Use: ./chanimagedownloader.py [-h] -b Board [-t Thread] [-d]
8chan Downloader
Required arguments:
-b Board name of the board to downlaod everything within,
unless thread number is provided.
Optional arguments:
-h, --help show this help message and exit
-t ... |
a43e78bcf86f1c898ccdd209ed2361e0e1b8e7fd | 3087815bca0bcdabc4f19131d28d9ac3645fb2e8 | vladimir-chernenko/fgen | /utils.py | Python | py | 1,554 | no_license | import os
from isort import SortImports
def j(*args):
return os.path.join(*args)
def file_writer(file_name, text_dict):
"""Safely insert text to file, and sorts imports automatically
Args:
file_name (TYPE): File name, will be used as ``
text_dict (TYPE):
{
's... |
a2be6ad4ddc7f09cc072b1bc571e725404a5e8bc | d88d658aa26855d3c4dcfeab4b20865f60fa4670 | RaulCatalano/meraki-python-sdk | /meraki_sdk/models/update_network_one_to_one_nat_rules_model.py | Python | py | 1,704 | permissive | # -*- coding: utf-8 -*-
"""
meraki_sdk
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
import meraki_sdk.models.rule_8_model
class UpdateNetworkOneToOneNatRulesModel(object):
"""Implementation of the 'updateNetworkOneToOneNatRules' model.
... |
d914cda5954afc126c7d8f648a752e707bbf35f2 | 2995665ccad785dfd5c33bb63cc23b5edef04625 | rafaelperazzo/programacao-web | /moodledata/vpl_data/10/usersdata/2/9650/submittedfiles/testes.py | Python | py | 490 | no_license | # -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
#COMECE AQUI ABAIXO
n = input('Digite n: ')
m = input('Digite o valor de m: ')
#Contar digitos de m
cont = 0
temp = m
while temp>0:
temp = temp//10
cont = cont + 1
divisor = 10**(cont-1)
temp = n
verdade = False
while temp>0:
nume... |
419a3621b6be242df38eef472af3a50e10a20572 | e06d1fcf1ce57b4119445442269cc16140f243c7 | Jitter00/ixnetwork_restpy | /testplatform/sessions/ixnetwork/globals/topology/tlveditor/tlv.py | Python | py | 8,415 | no_license | # Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge... |
abdd328c239c70640df6d034bddb4bce38725222 | 9231d08b5e184dd4ae415269a657544e14d33a7a | nerosketch/djing2 | /apps/messenger/models/base_messenger.py | Python | py | 4,329 | no_license | import abc
from typing import Optional, Generator
from urllib.parse import urljoin
from django.shortcuts import resolve_url
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.base import ModelBase
from django.utils.translation imp... |
ec314fa6c87bef233ec64069654312a4937b0973 | 49df15fe5f8f9af64b34879541a7ea0a88a075c5 | Eulerianial/premise-selection-deepmath-style | /models_evaluation/xgboost/grid_search/jobs_test/10.0_0.05_0.1_200.0_10.0.job.py | Python | py | 1,638 | no_license | import xgboost as xgb
import argparse
import sys
import os
from saving_loading import *
#####################################
p = {
"max_depth":int(10.0),
"eta":0.05,
"gamma":0.1,
"num_boost_round":int(200.0),
"early_stopping_rounds":int(10.0)
}
#####################################
if __name__ ==... |
df7fd563bc70598cd238dace1bd8f046b5144dfb | f04436ea23a7535ef43c9efda3e5c09397fefcf8 | aalex/txosc | /examples/async_udp_receiver.py | Python | py | 3,170 | permissive | #!/usr/bin/env python
"""
Example of a UDP txosc receiver with Twisted.
This example is in the public domain.
"""
from twisted.internet import reactor
from txosc import osc
from txosc import dispatch
from txosc import async
def foo_handler(message, address):
"""
Function handler for /foo
"""
print("fo... |
7174ecac70d28d9acf5598593f7f75edd2687b24 | 7a9c08354b966a627ad9fea7bcc9f5d2714c6b25 | danielvilas/bm_python | /protocolsoap/Soap.py | Python | py | 1,448 | permissive | from common.Types import ParsedPacket,Protocol,Cfg
import requests
class SoapProtocol(Protocol):
url:str
def initProtocol(self,cfg:Cfg):
self.url ="http://"+cfg.server+":9090/ws"
#todo change port
def sendPacket(self,parsedPacket:ParsedPacket):
super().sendPacket(parsedPacket)
... |
4fc3b336b1c6dc70c602e54c6972310a2c30d321 | e7c6eadeebbdb46384d2d6528a71584dbca0242d | lonelam/TheLastShame | /evaluate.py | Python | py | 2,898 | no_license | # ./evaluate.py
from network import get_compiled_model, get_data, get_pca_model, get_raw_data, MyPca
from residual_network import get_compiled_residual_model
from util.constants import *
import pickle
from util.ploter import plot_from_point_list, Framework, get_frame_shape
import numpy as np
import matplotlib.pyplot as... |
be6c12f81d02ce61bc80129a48cbdfeb8334e2f6 | 77718b639324f760b2752dd4898688905920fa57 | Vigneshwaran3112/project | /core/migrations/0016_userattendancebreak.py | Python | py | 1,314 | no_license | # Generated by Django 3.1.3 on 2021-01-25 18:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0015_usersalary_date'),
]
operations = [
migrations.CreateModel(
... |
b223c3592643cd445374150398d32b5b8f6e911a | ca5dfa98d374ecb74cf8af1b494b09238f3a823f | levivm/dwn-backend | /accounts/urls.py | Python | py | 970 | no_license | from django.conf.urls import url
from .views import AccountsViewSet, AvailableAdminAccountsView, AccountSourcesView,\
AccountReportsView
urlpatterns = [
# accounts:accounts - api/accounts/
url(
regex=r'^/?$',
view=AccountsViewSet.as_view({'get': 'list', 'post': 'create'}),
name='ac... |
d11c0130335134a776f75ed6fc367b991f99f9b0 | 2901588d2ed8cf52e2173cec97a6bf7dfb904b6e | zvercodebender/xld-windows-file-plugin | /src/test/resources/docker/initialize/xld_initialize.py | Python | py | 2,173 | permissive | '''
Copyright 2017 XEBIALABS
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, s... |
368cb65ab0ea43f52c5e62372610eae63b0f9c3e | d12cfb1cea49afb65c22f821c0b7352e85e72590 | IDR/idr-utils | /test/test_file_pattern.py | Python | py | 3,504 | permissive | import unittest
import pyidr.file_pattern as fp
class TestRange(unittest.TestCase):
def setUp(self):
self.bad = [
("0-2:a", ValueError),
("!-A", ValueError),
("a-E", ValueError),
("A-e", ValueError),
("2-1", ValueError),
("B-A", Val... |
8590973fccca165eaef2528ff5fb105300551e57 | 22dcf5085fafc6cdfffa1b1ffdd2eacd087e394b | niterain/digsby | /digsby/src/util/callbacks.py | Python | py | 11,665 | permissive | '''
Easy network callbacks.
>> @callsback
def longNetworkOperation(callback = None):
if socket.performOp():
callback.success()
else:
callback.error()
>> longNetworkOperation(success = lambda: log('yay'), error = on_fail)
Inspiration fro... |
aeb6b703a5fe7af56828221bae2f448f9a930b75 | 7ac63396a62da27bc5778673624c7099ccec0390 | GanbaruTobi/AFLplusplus | /.custom-format.py | Python | py | 4,434 | permissive | #!/usr/bin/env python3
#
# american fuzzy lop++ - custom code formatter
# --------------------------------------------
#
# Written and maintaned by Andrea Fioraldi <andreafioraldi@gmail.com>
#
# Copyright 2015, 2016, 2017 Google Inc. All rights reserved.
# Copyright 2019-2022 AFLplusplus Project. All rights reserved.
#... |
25f25ba0da5044d69654d95043737f4a2411f5a7 | 492957bde135e2e8a571be74f10792d996974d82 | nicksonlangat/startup | /accounts/migrations/0001_initial.py | Python | py | 1,675 | no_license | # Generated by Django 3.0.8 on 2020-07-02 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(aut... |
40804d5b2d8ea71192c903e432910accc8dee299 | 92b18c3ecc4159e031c80a00d9c64ced5afc19fa | SharifAIChallenge/AIC21-Infra-Gateway | /gateway/wsgi.py | Python | py | 391 | permissive | """
WSGI config for gateway project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... |
5a4a14a967f80b5cdc746cf5868577eff6a80051 | 7090ebbfd8a4e6cec53da3dd837c91d6942f7906 | yc-li20/LeetCode | /62. Unique Paths.py | Python | py | 369 | no_license | #动态规划的思想
class Solution(object):
def uniquePaths(self, m, n):
"""
:type m: int
:type n: int
:rtype: int
"""
mtx = [ [1 for i in range(n)] for i in range(m)]
for i in range(1, m):
for j in range(1, n):
mtx[i][j] = mtx[i-1][j] + mtx[... |
78d99d1435525842fac2475d2f57e457ce8a6fae | 14d7084344a03ffae7f5e64ada3e24ce9ce4a405 | clovett/tools | /PowerMonitor/logger.py | Python | py | 4,423 | no_license | ####################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: logger.py
# Authors: Chris Lovett, Lisa Ong
#
# Requires: Python 3.x
#
#####################################################################################... |
7065883229cbaeb92059a0c600e1abb515dc6027 | ead419d2b4965227ae20c155eccecf8f8cb3f1c8 | jheiv/pyreadline | /pyreadline/console/ironpython_console.py | Python | py | 14,289 | no_license | # -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2003-2006 Gary Bishop.
# Copyright (C) 2006 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file ... |
8be74b05f32b1085a4497ea551bb31aa7e7d8bb4 | 935e1770154928ea86fa172a7282c220ad4a6ba0 | zhangjiemin000/fast-neural-style-tensorflow | /model.py | Python | py | 6,515 | no_license | import tensorflow as tf
def conv2d(x, input_filters, output_filters, kernel, strides, mode='REFLECT'):
with tf.variable_scope('conv'):
#输入卷积的shape
shape = [kernel, kernel, input_filters, output_filters]
# 随机的weight, 均方差为0.1,其实就是按照卷积核来配置一个随机的参数
weight = tf.Variable(tf.truncated_norm... |
e92f617315a82198d4a7a875f91b5db9df4372df | 1efeb49f5d889dca5ee085a74f173504d6ef211d | Aadil-Rashid/shop_Project | /product/migrations/0001_initial.py | Python | py | 2,338 | no_license | # Generated by Django 3.2.4 on 2021-06-22 10:05
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CategoryM... |
0c41cf030d5898744d2dacfd3103525ef2b2091a | 389518775b65b44bd7db74fb34cb5c364252a81c | pombredanne/BooleanSolver | /boolean_solver/output.py | Python | py | 941 | permissive | #!/usr/bin/env python
"""Defines a class containing possible outputs"""
import warnings
import util
__author__ = 'juan pablo isaza'
class Output():
"""
Contains any output properties.
"""
@staticmethod
def valid_arguments(function, arguments):
"""
Returns boolean indicating if a... |
e7010c118623b6b947c97c48458777ced5ca1efd | e8e800252a7662c8218fb7cb42a8b2cdf9391214 | kieserjw/southwest-alerts | /southwestalerts/app.py | Python | py | 3,662 | permissive | import logging
import requests
import sys
from southwest import Southwest
import settings
def check_for_price_drops(username, password, email):
southwest = Southwest(username, password)
for trip in southwest.get_upcoming_trips()['trips']:
for flight in trip['flights']:
passenger = flight[... |
a1261aed4733dbd4c7eadde0d1f14e5baa576dd6 | 097f4a78b0678e7980d480b02d34287458fd5945 | scantu/ugali-IMF | /ugali/isochrone/parsec.py | Python | py | 14,309 | permissive | """
Module for wrapping PARSEC isochrones.
http://stev.oapd.inaf.it
"""
import os
import sys
import glob
import copy
from collections import OrderedDict as odict
# For downloading isochrones...
try:
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import URLError
exce... |
c46607480e2f38827478f6d8a1cd65336e3fc5e5 | 1ac37a30a6cf3c8303831d101bff056dcded5297 | aiko11/MoonPython | /01.Concept/11.closure_misuse.py | Python | py | 888 | no_license | # --------------------------------------------------------------------------------------------
# 클로저에서 외부 함수의 변수들 즉, nonlocal 변수들은 외부 함수가 실행되는 시점에 생성되고,
# 복사되어 내부 함수의 __closure__ 속성에 저장됩니다.
# 그래서 nonlocal 변수로 시간과 관련된 값을 사용하게 되면 의도하지 않은 결과가 나올 수 있습니다.
# 예제를 통해서 출력결과를 확인하세요.
# --------------------------------------------... |
24b72c1a4eb63de2d077d741177b5a350017014b | c386a418d79f33730a2161af7845e8f4947a8791 | gdshen/age_classification | /utils/face_alignment.py | Python | py | 4,905 | no_license | from imutils.face_utils import FACIAL_LANDMARKS_IDXS, shape_to_np, rect_to_bb
import numpy as np
import cv2
import argparse
import dlib
import imutils
# according to link https://www.pyimagesearch.com/2017/05/22/face-alignment-with-opencv-and-python/
class FaceAligner:
def __init__(self, predictor, de... |
362d84868e03cb0b5f5bb7ed0e8c682edaed8ae1 | 547c1abdbd6f753e781bd8a615b1d865b05984cf | pipixiapipi/Intelligent-Pixel-Annotation-Tool | /python_script/dataloaders/custom_transforms.py | Python | py | 10,454 | no_license | import torch, cv2
import numpy.random as random
import numpy as np
import dataloaders.helpers as helpers
import scipy.misc as sm
from dataloaders.helpers import *
class ScaleNRotate(object):
"""Scale (zoom-in, zoom-out) and Rotate the image and the ground truth.
Args:
two possibilities:
1. rot... |
8bfdbae9333f76019aa69db14074a1a47f77b278 | 433248901df3622f92d578c9942b6ac67ae36774 | webosce/chromium53 | /src/content/test/gpu/gpu_tests/context_lost.py | Python | py | 13,821 | permissive | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import time
from gpu_tests import context_lost_expectations
from gpu_tests import gpu_test_base
from gpu_tests import path_util
from telemetry... |
773c970b849d96676548432458db2967849125dc | e957df362987069bcec29e30e32f05f8a747d99b | hackable/ecgtk | /ecgtk/rdetect.py | Python | py | 9,518 | no_license | #!/usr/bin/env python
# Design
# ------
# Basic philosophy is to provide a gui for qrs detection / verification and modification in an ecg.
# Should provide for
# - Input : Read ECG of different formats
# - QRS detection : Ability t... |
333a934413237cea6d28736b49eae4907f020f2c | 249eae724e52a4e673b45c7bc0747fca7fc33fd7 | dgnsrekt/telegram-analytics | /setup.py | Python | py | 468 | no_license | import setuptools
setuptools.setup(
name="telegram-analytics",
version="0.0.1",
url="https://www.fomo-dd.io",
author="run2dev",
author_email="run2devtest@gmail.com",
description="write a description",
long_description=open('README.rst').read(),
packages=setuptools.find_packages(),
... |
bc8490144b9d7eb2191c124522677a5dd35ee3b1 | 2d218cae468148c4fb93d73d07d0bf3cd05f34c8 | mun-sathish/Raspberry-Pi | /Numpad/Numpad.py | Python | py | 672 | no_license | import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
matrix = [ [1,2,3,'A'],
[4,5,6,'B'],
[7,8,9,'C'],
['*',0,'#','D'] ]
row = [4,17,27,22] #first 4 pins
col = [19,6,13,26] #last 4 pins
for j in range(4):
print j
GPIO.setup(col[j], GPIO.OUT)
GPIO.output(col[j], 1)
for i in range(4):
GPIO.setu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.