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 |
|---|---|---|---|---|---|---|---|---|
f3daa0ad8020c74173b145e85a69919c423669c7 | 3a1475ed1ba49b4a5aaa3cc2fa7cb623559c0a70 | rosoareslv/SED99 | /python/nilearn/2015/12/version.py | Python | py | 3,616 | no_license | # *- encoding: utf-8 -*-
"""
nilearn version, required package versions, and utilities for checking
"""
# Author: Loïc Estève, Ben Cipollini
# License: simplified BSD
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix release... |
950c4c6ab53fbe103139a576122fad8e5ae03ed7 | 77bfde86dc5379b6b154b9eab36c05b1bfad7c38 | remcous/Python-Crash-Course | /Ch15/rw_visual.py | Python | py | 904 | no_license | import matplotlib.pyplot as plt
from random_walk import RandomWalk
# Keep making new walks, as long as the program is active.
while True:
# Make a RandomWalk, and plot the points
rw = RandomWalk(50000)
rw.fill_walk()
# Set the size of the plotting window.
plt.figure(dpi=128, figsize=(10, 6))
... |
342f328e1fa2e7e876faf37932e2faa20aa1c906 | 10a3b028361be0db6a5116a764f21df82024ab79 | BBcan177/FreeBSD-ports | /www/ungoogled-chromium/files/patch-tools_protoc__wrapper_protoc__wrapper.py | Python | py | 976 | permissive | --- tools/protoc_wrapper/protoc_wrapper.py.orig 2022-10-01 07:40:07 UTC
+++ tools/protoc_wrapper/protoc_wrapper.py
@@ -182,15 +182,19 @@ def main(argv):
if not options.exclude_imports:
protoc_cmd += ["--include_imports"]
+ nenv = os.environ.copy()
+ nenv["PATH"] = "${WRKOBJDIR}/bin:" + nenv["PATH"]
+ n... |
3c36119c25453915a9f4feb01d5c6aa20c45e851 | 110346c033fd85b9c02804b66fb86573ff733d9d | KPW10452025/PythonCodeRecipes | /p194_sys_argv.py | Python | py | 686 | no_license | # 命令行參數
# import sys
# sys.argv
# 平時在 terminal 會輸入 python3 p194_sys_argv.py 以執行本檔案
# 但因為今天這個檔案有 import sys
# 所以可以在 python3 p194_sys_argv.py 後面放入一些參數
# 這些參數稱為「命令行參數」
# 在 terminal 輸入 python3 p194_sys_argv.py 12345678 apple 3.14
# 12345678 和 apple 和 3.14 就是「命令行參數」
from sys import argv
print(argv)
# ['p194_sys_argv.py'... |
9ead45edac6c6136f80b0a1d5b3b7100d82b713e | e0911fdfd95acb7eda54829be271ca3178226ccc | liuhu-bigeye/continuous_sign_recog | /all_vgg_s_multi_modal/reader_pool.py | Python | py | 11,534 | no_license | import os
import cv2
import sys
import pdb
import time
import glog
import h5py
import random
import pickle
import multiprocessing
import numpy as np
data_dir = '/var/disk1/RWTH2014'
database_file = os.path.join(data_dir, 'database_2014_combine.pkl')
data_file = os.path.join(data_dir, 'feat_multimodal.h5')
sys.path.ins... |
4521d3f829efbf816a2a264a2589993d9cec4620 | 0ad6135c9fec323af1835225afce351faa05e118 | danielzengqx/iotdashboard | /channels/models.py | Python | py | 1,496 | permissive | # -*- coding: utf-8 -*-
"""
Channel
https://iothook.com/
"""
from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
from django.template.defaultfilters import slugify as djslugify
from django.contrib.auth.models import User
from django.utils.... |
ab8e141340e5315016d03c973d90881f8a17720e | 142a2c7145be1e5f180c5abf359d9953e27df848 | sai-krishna-msk/ML_Firewall | /train/train_model.py | Python | py | 757 | no_license |
import pandas as pd
import numpy as np
from xgboost import XGBClassifier
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.pipeline import Pipeline
df = pd.read_csv("payloads.csv")
df.info()
df.replace('', np.nan, inplace=True)
df.dropna(subset=['payload' ,'is_malicious' ], inplace=True)
df.... |
c41bc4afa4c0b21f365fd1c932ddd97873af274b | d090f6ac8b2cd5dd37a1bcb501b59ece370a52ab | zengruizhao/crawlQiuShiBaiKe | /qsbk/items.py | Python | py | 306 | no_license | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
import scrapy
class QsbkItem(scrapy.Item):
# define the fields for your item here like:
author = scrapy.Field()
content = scrapy.Field()
|
8eab27ec0559667f8996fd4d5fbc69b4262c4301 | ab95cc4e16c92e9a0a2fd6d88680e8f3bb4be7c1 | VRn00b/scam-blockchain | /scam/consensus/get_block_challenge.py | Python | py | 4,776 | permissive | import logging
from typing import List, Union
from scam.consensus.block_record import BlockRecord
from scam.consensus.blockchain_interface import BlockchainInterface
from scam.consensus.constants import ConsensusConstants
from scam.types.blockchain_format.sized_bytes import bytes32
from scam.types.full_block import Fu... |
dad9c9281dbecbf8cdc325975c3c572f6bc6fa29 | a73f08bad37a2b9886e21c6ce54047aa75a3e3b3 | mcne65/group-work-setup | /group_work_setup/utils.py | Python | py | 524 | no_license | from .conf import TEAM_NAME_TEMPLATE, TEAM_REPO_NAME_TEMPLATE
def generate_team_name(batch, course, group, team_name):
return TEAM_NAME_TEMPLATE.format(
batch=batch, course=course,
group=group, team_name=team_name)
def generate_repo_name_for_team(batch, course, group, _class,
... |
59e4c644b573dcc98d2e993b6c546f34c8e51027 | 4fd06fb2e13609230996a925d52cd06a49160e33 | luisman1987/biblioteca | /blogbiblioteca/views.py | Python | py | 984 | no_license | from django.shortcuts import render
from blogbiblioteca.models import Libro
from django.shortcuts import render, get_object_or_404
from blogbiblioteca.forms import LibroForm
from django.shortcuts import redirect
# Create your views here.
def post_list(request):
posts = Libro.objects.all()
return render(reques... |
a5ac57a7e1b951e257e014b031e27e9e0e8ff8cb | 0aeadf0c94ac53c722415dcdcac5f57f5be00998 | Nemie/syco | /bin/public/installES.py | Python | py | 1,640 | no_license | #!/usr/bin/env python
'''
Install/configure Elasticsearch.
'''
__author__ = "mattias.hemmingsson@fareoffice.com"
__copyright__ = "Copyright 2014, The System Console project"
__maintainer__ = "Mattias Hemmingsson"
__email__ = "syco@cybercow.se"
__credits__ = ["Daniel Lindh"]
__license__ = "???"
__version__ = "1.0.0"
_... |
1cf9ede3fa56851209611f6e269913e6eb05e916 | da2ec42747ddca1c7276e1e5b055c4a6a570780e | henri25/PDI-UFS | /venv/Scripts/pip3.6-script.py | Python | py | 415 | no_license | #!C:\Users\henri\PycharmProjects\Paulo\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.6'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[... |
28ec044c6811e99355f8fd63741c0fee798d9321 | 447906b721a2d631801b5264d592d28bf9852f19 | dtravisany/CoV2CLBackEnd | /cov2cl/migrations/0037_gene_min_name.py | Python | py | 387 | no_license | # Generated by Django 3.0.8 on 2020-09-09 21:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cov2cl', '0036_gene_color'),
]
operations = [
migrations.AddField(
model_name='gene',
name='min_name',
f... |
5b65fb28aac00bda2ef2a8b8685c605d74245ec2 | 982c93560bccdb5946e8a9529b2c8f6675c174d7 | Wesley-yang/abm1559-1 | /abm1559/simulator.py | Python | py | 6,149 | permissive | from typing import Sequence, Dict
import numpy as np
from abm1559.config import rng
from abm1559.utils import (
constants,
)
from abm1559.chain import Block
from abm1559.users import User, User1559
def spawn_poisson_demand(timestep: int, demand_lambda: float, UserClass, rng: np.random.Generator = rng, **kwargs)... |
657cf53f05d924c39fa59ce0bfff22497fce126d | 2d126c7fe32bc6642cf841e8c7a4d0600359c858 | fbhs-cs/PreAPCS-classcode | /2017-09-13-Variables-Strings/variables_strings_demo.py | Python | py | 1,337 | no_license |
#This is a one-line comment
'''This is a longer comment that can
continue over multiple lines. We will use
this type of comment to describe many of
the functions that we create'''
#Assignment statements
n = 17
first = 'bob'
last = 'smith'
birth_date = '9/27/2003'
#Variable names
'''variable names should be... |
d0ade586f0681590037e36378a5a68cd8aeeaea7 | a216e53b9cce14d58f6e7486cc9aa51185578621 | kbase/relation_engine_importers | /src/modelseed/import_json_data.py | Python | py | 1,929 | permissive | """
Import data into arangodb from a directory filled with json files.
Each filename should be a collection name
Each line in the file should be a json record
"""
import time
import os
import sys
import requests
import logging
log_file_path = 'import_json_data.log'
logging.basicConfig(filename=log_file_path, filemod... |
bf03e124176f8f7f26f7e8a77388a2327913524a | 3a36978df20bc8f9b1998013ce7d711b6673379b | SapnaGulati/Digit-Recognition | /logistic_regression.py | Python | py | 779 | no_license | # Train a logistic regression classifier to predict whether a flower is iris verginica or not
from sklearn import datasets
from sklearn.linear_model import LogisticRegression
import numpy as np
import matplotlib.pyplot as plt
iris = datasets.load_iris()
# print(list(iris.keys()))
# print(iris['data'])
# print(iris['... |
cd96f41a78f8873cdd35bf508ab16969311a6f4d | ecd47cf4a32bed529c561048061696d9207e26f6 | DITIntl/GoodERP_OCC | /my_addons/my_equipment_parts/__manifest__.py | Python | py | 605 | no_license | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': '设备备件',
'version': '12.1',
'summary': '记录设备备件的名称、内部编号',
'description': 'E-Mail:992102498@qq.com',
'author': '保定-粉刷匠',
'website': 'http://blog.sina.com.cn/kaiyuanlvzhou',
'depends': ... |
2867e748da928612430ee262039e183494e69ad2 | a01e982730a8f8676e5ef2b63d79bae860a7ef4f | ahmad-asadi/CLPDetector | /Coordinator.py | Python | py | 4,429 | no_license | import sys
import os
from image_processings.ImageProcessor import ImageProcessor
from image_processings.preprocessors import ImagePreprocessor as Preprocessor
from vision.Detector import Detector
from Classifiers.classification import Classifier
import requests
import json
class Coordinator:
def __init__(self):
... |
c3ff864aa1e360e871fb3a2f0d90249b443205cf | 8fda03a0b4fe54689a7e8f7ba20da57768cf0f39 | Hins/progressive-neural-architecture-search | /score_architectures.py | Python | py | 1,786 | permissive | import numpy as np
import tensorflow as tf
from encoder import ControllerManager, StateSpace
tf.enable_eager_execution()
B = 5 # number of blocks in each cell
K = None # number of children networks to train
INPUT_B = 3 # number of blocks in each cell during training
MAX_EPOCHS = 3 # maximum number ... |
290c3b5785b81a1eddd6c966cd2aa2b452ea5ff5 | bd9dd136e3b0a179ab0df749ae6b54585f801456 | ShihMengLi/nerf | /load_llff.py | Python | py | 12,710 | permissive | import numpy as np
import os, imageio
########## Slightly modified version of LLFF data loading code
########## see https://github.com/Fyusion/LLFF for original
def _minify(basedir, factors=[], resolutions=[]):
needtoload = False
for r in factors:
imgdir = os.path.join(basedir, 'images_{}'.format(r... |
8a35eabed1b41242f747261183a1f0d7955b6de8 | ad5a810ff786a51b7f95f1a3c12fc36d56e1ee06 | swayamz/Sensor-Display | /calc/migrations/0007_auto_20190719_1110.py | Python | py | 383 | no_license | # Generated by Django 2.2.2 on 2019-07-19 18:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('calc', '0006_auto_20190719_1050'),
]
operations = [
migrations.AlterField(
model_name='farmdata',
name='time',
... |
8e0ea5739d41545c3627dac360f2ae4821a905f3 | 46846cb6892fef968371529ec90d79f4d65f67b9 | tofufi/aznhusband.github.io | /src/plugin.video.icdrama/lib/config.py | Python | py | 2,013 | permissive | import os.path
from urlparse import urljoin
from lib.common import diritem, action_url, profile_dir
base_url = 'http://icdrama.to'
domains = ['icdrama.to']
cache_file = os.path.join(profile_dir, 'cache.pickle')
store_file = os.path.join(profile_dir, 'store.pickle')
# the trailing forward slashes are necessary
# witho... |
02924c9b6833005c2278450e760c6b297812caa4 | 3f0df0084a64fa6eb8023edd96d5a0b0666c3152 | saribmahmood55/Docors | /practitioner/models.py | Python | py | 9,742 | no_license | from django.db import models
from django.db.models import Q
from autoslug import AutoSlugField
from sorl.thumbnail import ImageField
from docorsauth.models import docorsUser
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
class SpecializationManager(models.Manager)... |
3be8134c2d73183b8f8af48b464e5c99ecb7f58f | d6cb149933d701b4a14c3b4259e662c845e41e98 | jbkornegay/first_django_project | /mysite/myinfo/views.py | Python | py | 277 | no_license | from django.http import JsonResponse
def student_info(request):
data = {
"Name" : "Jarla Kornegay",
"Track" : "Backend(Python)",
"Message" : "Hi mentor, I hope this works!"
}
return JsonResponse(data)
# Create your views here.
|
4d58afcfbfbaed3039fc920f3b3c795873ea8444 | 0179a40b7bb34a868ea688106c10c7e3ea97d9d0 | fancyQB/test_code | /effective_python/generator_func.py | Python | py | 3,216 | no_license | '''
考虑用生成器来改写直接返回列表的函数
'''
def index_words(txt):
'''
查找字符串中的每个首字母
:param txt:
:return:
'''
result = []
if txt:
result.append(0)
for index, letters in enumerate(txt):
if letters == ' ':
result.append(index + 1)
return result
address = 'FOUR SCORE AND SEVEN... |
ec751117ea98409ef9161a5dc6b4a7ce4a891fa6 | 990416c1be67d3aeeea8cff3e241591f68257358 | Tower1189/An-algorithm-for-a-day | /all/7.py | Python | py | 566 | no_license | array = [7, 2, 5, 4, 1, 8, 12, 6, 8]
# def quicksort(array):
# if len(array) <= 1:
# return array
# l = [x for x in array[1:] if x <= array[0]]
# r = [x for x in array[1:] if x > array[0]]
# return quicksort(l) + [array[0]] + quicksort(r)
# print(quicksort(array))
def quicksort(array... |
212715f39a1b1649f0da8907756df084b18008ad | 5a8ea7a3ffc750c4dd8b215a7a82ff06e682ef1a | josephsmartinez/python | /FlaskRESTful/Python_Refresher/oopPython/classes_object.py | Python | py | 1,515 | no_license | class Store:
def __init__(self, name):
# You'll need 'name' as an argument to this method.
# Then, initialise 'self.name' to be the argument, and 'self.items' to be an empty list.
self.name = name
self.items = []
def add_item(self, name, price):
# Create a dictio... |
f6d17208c7b7ac2cfa355afd6dc4d60ee5f2a766 | 5d1d45b2acd2aa091e73e8e9f829a26ae3f1a2d6 | Cloudxtreme/httoop | /tests/headers/test_host_header.py | Python | py | 1,695 | permissive | from httoop.exceptions import InvalidHeader
import pytest
def test_http1_1_request_without_host_header():
pass
def test_http1_0_request_without_host_header():
pass
def test_host_header_is_fqdn(headers):
hosts = {
'Www.exaMple.com': ('www.example.com', None),
'localhost:8090': ('localhost', 8090),
}
for e... |
e1391b7fa459313a40f6640cfa56b6c0b58fa5b0 | 4f443a22a599ad4ab5eb15eb4c2f9db4d7132506 | sthartman/pymatgen | /pymatgen/analysis/diffusion_analyzer.py | Python | py | 37,616 | permissive | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
A module to perform diffusion analyses (e.g. calculating diffusivity from
mean square displacements etc.). If you use this module, please consider
citing the following papers::
Ong, S. P., Mo, Y., Richards, W. D., Mia... |
1e9f6b5ddcec62e000a4fcfea150b5da90646b35 | b0b7b5d3eff5a4704267fca59dfecfae338cd88b | VictorCastao/Curso-em-Video-Python | /Desafio54.py | Python | py | 452 | permissive | from datetime import datetime
print('=' * 12 + 'Desafio 54' + '=' * 12)
maiores = 0
menores = 0
ano = datetime.today().year
for i in range(0, 7):
nascimento = int(input(f'Digite o ano de nascimento {i + 1}: '))
if ano - nascimento >= 21:
maiores += 1
else:
menores += 1
print('Após a contage... |
17e4f3d3ada699280967198ce5a79f318e42e009 | 27a728527947c8a268bac1939e5d06906f8f8bf1 | zhitaoguo/BM3D_py | /precompute_BM.py | Python | py | 4,232 | permissive | import numpy as np
def precompute_BM(img, kHW, NHW, nHW, tauMatch):
img = img.astype(np.float64)
height, width = img.shape
Ns = 2 * nHW + 1
threshold = tauMatch * kHW * kHW
sum_table = np.ones((Ns, Ns, height, width)) * 2 * threshold # di, dj, ph, pw
row_add_mat, column_add_mat = get_add_patc... |
757507db4abe35a1a333f21180b22bc8b2e831e6 | e8f4ba4e47b5cb57dbe912432b2f25862d4ba831 | OseiasBeu/webScrapping | /.history/toolbox/baixaArquivo_20191128093907.py | Python | py | 2,167 | no_license | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import os
# import tempfile
import time
import pandas as pd
def baixaArquivo():
driver = webdriver.Chrome(executable_path='chromedriver.exe')
driver.get("http... |
e81495fb6bc13027b9078f6e70539a8529f3f5d2 | bb1eb2aab6e569991cd4b595bde9319f05c10c50 | ChrisIck/milsed | /models_dcase/01_prepare.py | Python | py | 5,583 | no_license | #!/usr/bin/env python
'''DCASE pre-processing'''
import argparse
import sys
import os
import pickle
from tqdm import tqdm
from joblib import Parallel, delayed
from jams.util import smkdirs
import pumpp
import milsed.utils
OUTPUT_PATH = 'resources'
DCASE_CLASSES = ['Air horn, truck horn',
'Ambul... |
d3c5321dd315b21a8e40dcbc925ab89d54a8758e | f4d9589fef5d79a5126366cd96e4c0ab8262e55d | Samwalton9/TWL-tools | /proxy.py | Python | py | 3,155 | permissive | import datetime
import numpy as np
import gspread
import logins
def get_worksheet(key, sheet_num):
# Return a worksheet given a sheet key and tab number
g_client = logins.gspread_login()
g_sheet = g_client.open_by_key(key)
worksheet = g_sheet.get_worksheet(sheet_num)
return worksheet
def gen_part... |
05ffe1e91570bac27aa22d94328df7859ef5a0f6 | 4275b3b4c08f53155e7800beb54576762bf77f30 | AkshayReghunath/CRiC11 | /crick11/CRiC11/migrations/0006_auto_20190201_1419.py | Python | py | 1,490 | no_license | # Generated by Django 2.1.5 on 2019-02-01 08:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('CRiC11', '0005_auto_20190201_1419'),
]
operations = [
migrations.AlterField(
model_name='balltype',
name='Avg',
... |
7567a6a57629f63db2f718596692b16658f50311 | 0372957a28c8f7ea6cbf857bcd09510bbd162422 | Barnsa/Dissertation | /host_im/mount/malware-classification-master/samples/not/sample_good578.py | Python | py | 395 | no_license | import random
import difflib
import math
import array
import stringprep
import re
import datetime
nterms = 672
n1, n2 = 0, 1
if nterms <= 0:
print("Please provide a positive integer.")
elif nterms == 1:
print("Fibonacci sequence upto", nterms, ":")
print(n1)
else:
print("Fibonacci sequence:")
count = 0
while 672 ... |
a6069d9812d04064d2d16497c39dc05d31a53fd3 | 4ffd8835e0d16b3852a500f01a9d9d60e9fb898d | Simonskiii/Reading-App | /backGround/apps/goods/migrations/0006_auto_20191125_2049.py | Python | py | 3,097 | no_license | # Generated by Django 2.2.4 on 2019-11-25 12:49
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('goods', '0005_auto_20191125_2024'),
]
operations = [
migrations.AlterField(
mod... |
27b102efb37d73193e76a9e6340d8f892ebe4d0e | cf81b2be51f054653243dc9db8f4058a7568fd53 | skreimeyer/NPDES-Report | /scripts/cors_parser.py | Python | py | 4,298 | permissive | #! /usr/bin/env python3
"""
EPA discharge monitoring reports can be downloaded as 'CORS'
CORS are available in XML format. This parser will walk a directory for files
named 'dmrSubmission.xml', queue these filenames and then spawn a few processes
to extract the target information and write these files out to a csv.
##... |
3d4aada06ca957324dee5f2cc469fe836395f6e2 | 0b0fdf199d1b1d2fc9d1d8b0775c06e41440b3ba | iamTanTanTan/python_programming | /039平衡二叉树.py | Python | py | 1,376 | no_license | '''
输入一棵二叉树,判断该二叉树是否是平衡二叉树。
'''
'''
基于二叉树的深度,再次进行递归。
以此判断左子树的高度和右子树的高度差是否大于1,若是则不平衡,反之平衡。
'''
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def get_depth(self, root):
if not root:
return... |
236ae4a7d092dab874cb9c0c2530cf532cadbc1c | e0a611c9b7450d89e0432a5c0c3abfbb4d639979 | HeatherHeath5/progcon | /08/spring/failed/rack_em_up/1.py | Python | py | 1,217 | no_license | def score(frames):
total = 0
output = ""
format = "%5d"
s_i_minus_2 = 0
s_i_minus_1 = 0
for x, frame in enumerate(frames):
r = len(frame)
p = sum(frame)
i = x + 1
if p == 10 and r == 1 and i >= 3:
s = p + s_i_minus_1 + s_i_minus_2
e... |
848ed4481da08ed718dfc75f7493e15aee19c810 | 3b76bda9ed6c9a76739297555117988ead8dafca | megosha/church22_bot | /constants.py | Python | py | 2,274 | no_license | import settings
STATUS = {"1": 'Хожу в вашу церковь',
"2": 'Хожу в другую церковь',
"3": 'Не хожу в церковь, в Бога верю',
"4": 'Не верю в Бога',
"5": 'Нет моего варианта'
} # 0, 'Неизвестно'
FEEDBACK = {"answered": "✅ Да, со мной связались",
"ignored":... |
1eb6424c3d25750428c482d8b0ab54fa96d6b998 | ae63f6b7eaa3daece9666bd7f861b77fca07f532 | FalconLee1011/ntou-cs-computer-vision-homework-collection | /hw3_stitching/__main__.py | Python | py | 1,170 | no_license | import argparse
def initARG():
parser = argparse.ArgumentParser(
prog="Computer Vision HW3 - Stitching",
description="Stitching images or videos",
)
parser.add_argument(
"--type", help="Input type [ video | frames ], default is video"
)
parser.add_argument(
"--sourc... |
bf3d45b21710ff5e8f2a59ebd512089511ed17d7 | 2c2adeb3f1ac45d5d743d4c0b08144ab13add170 | nagyistge/brain-mri | /src/voxel_grid.py | Python | py | 1,408 | no_license | import numpy as np
class VoxelGrid:
def __init__(self, img_array, size=16):
self.voxelSize = size
size_x, size_y, size_z, dim = img_array.shape
size_x /= size
size_y /= size
size_z /= size
self.grid = np.zeros((size_x, size_y, size_z))
for x in range(0, ... |
d1f16bf0a21d1c275a0e974cbf802d5f627d9bc6 | ad88c8b38960e723ca3bf170b5e4fb9b1dc5777a | 13528770807/practice | /qiang13_working/q16_wrapper.py | Python | py | 1,946 | permissive |
# 实例一
import time
def f1(x):
print('4 >> x:', x)
return x * x
def new_fn(f):
print('1 >> f:', f.__name__)
def fn(j):
print('3 >> print ' + f.__name__)
return f(j)
return fn
g1 = new_fn(f1)
print('2 >> g1:', g1.__name__)
print('5 >> g1:', g1(5))
# 实例二
def wrapper(fun): # ... |
932c2a0b906034803cdfcbfb083a0f62ac5099a9 | 46f074e55e57101eaeba261d1a740be50292a2d2 | projectpai/pouw-main-iteration | /pai/pouw/dkg/start_dkg_cluster.py | Python | py | 2,072 | permissive | import argparse
import random
import subprocess
from multiprocessing.pool import Pool
import pai
from pai.pouw.dkg.distributed_joint_feldman import DKGSupervisor
from pai.pouw.dkg.joint_feldman import generate_task_id
def call_worker(index, task_id, leader_index, nodes_number, redis_host='localhost', redis_port=6379... |
302a8433a99c82e3ec7b290b2d20d7fdf0431264 | a4756c91961018210ffaabe5246bd3f66090c228 | HechtYehuda/Melanoma_model | /Preprocessing/images_to_hist.py | Python | py | 402 | no_license | import os
import test
import pandas as pd
import preprocessing_functions
path = '../processed_data/jpeg/train/'
files = [image for image in os.listdir(path)]
# Combine histogram and metadata
hist_df = preprocessing_functions.files_to_hist_df(path, files)
meta_df = pd.read_csv('../data/train.csv')
df = meta_df.merge(h... |
f70768b9cf8c6e54bffc0cfe07df63c0a0b67077 | a235737f7d4d4396f916ffb5e2e95ac417499448 | ArtObr/indy-node | /indy_node/test/nym_txn/test_nym_resend.py | Python | py | 1,847 | permissive | import json
from indy_client.test.cli.helper import createHalfKeyIdentifierAndAbbrevVerkey
from indy.ledger import sign_request, submit_request, build_nym_request
from indy.error import IndyError, ErrorCode
from plenum.common.constants import REPLY, REJECT
def test_nym_send_twice(looper, sdk_pool_handle, sdk_wallet_... |
285d1dd825ef38a9479460ae3df036eeb7245df7 | fec8b892ab844f9803d4a138cae2493d2b08a74e | minth/riscv-security-tutorial | /tools/tutgui/rx.py | Python | py | 2,131 | permissive | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ************************************************************************
#
# (C) COPYRIGHT 2016 TECHNOLUTION BV, GOUDA NL
# | ======= I == I =
# | I I I I
# | I === === I === I === ===... |
18108bf6197515a14dc8595b5c6d2c7af68f99a6 | aa94ec93a07aff9777fe18b12de9cc3417e3fa10 | jerhabor/boutique_ado_v1 | /boutique_ado/settings.py | Python | py | 6,398 | no_license | """
Django settings for boutique_ado project.
Generated by 'django-admin startproject' using Django 3.0.1.
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
... |
7ba62d635ca57a887d5f506b6a6edcac26af3e77 | 02d1a65697ee07054ecf275e503cb250b3c6396a | som-sinha/learning-autopy | /guessTheNumber.py | Python | py | 1,488 | no_license | # Containes a bit of every concept learned up until https://youtu.be/48WXHT0dfEY?list=PLGoJzB271_7r-iLYuEHEPJ5pSIYxXjJEn
from random import randint
while True:
# Choosing upper limit
UPPER_LIMIT = randint(10, 100)
# Creating a random secret number
secretNum = randint(0, UPPER_LIMIT)
# Asking use... |
1cc8fe8262be2ff64800fb765d1b30d73c258afa | 5b790dee7eac9d9b4e53ab43870870b5e005850f | roy-shuvashish/pygridtools | /pygridtools/tests/test_gefdc.py | Python | py | 9,863 | permissive | import os
from pkg_resources import resource_filename
import tempfile
import numpy
import pandas
from shapely import geometry
import geopandas
import pytest
import numpy.testing as nptest
import pandas.util.testing as pdtest
from pygridtools import gefdc
from . import utils
@pytest.mark.parametriz... |
d4ab7afdacd1bee4c0a457a60219440cab682b5a | 940e5e3428be3dc171f6979369aa0808b13577c7 | macarthur-lab/MyoSeq_reports | /seqr/bigquery.py | Python | py | 3,206 | permissive | #!/usr/bin/env python
import argparse
import logging
import os
from utils import get_samples
logging.basicConfig(format='%(asctime)s (%(name)s %(lineno)s): %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
logger = logging.getLogger('bigquery')
logger.setLevel(logging.INFO)
def parse_var(var, samples):
"""
Ge... |
1289aa544c996a681764d0c3e04c0628cd35ce74 | b30963822291337a58a923ccb0309f44d509e1d4 | yqu1/NLP_final_project | /NB_model.py | Python | py | 2,799 | no_license | from __future__ import division
from nltk import word_tokenize
from sklearn.metrics import accuracy_score
import pandas as pd
import numpy as np
import re
import json
"""
df = pd.read_csv('disaster_data.csv')
df.dropna(axis = 0, how = 'any')
data = []
df = df.reindex(np.random.permutation(df.index))
for index, row in d... |
bf1524f87fb016a925b71e9ba5cf23381c666a26 | 24058c0b19e6d81f4bc25ee1464538ab8dcb156c | INSRapperswil/async-webservice | /tasks/models.py | Python | py | 4,237 | no_license | from celery import shared_task
from datetime import datetime
from datetime import timezone
from django.db.models import CharField
from django.db.models import DateTimeField
from django.db.models import Model
from logging import error
from updatechannel.consumers import UpdateChannelConsumer
from webservice.celery impor... |
809e885caf685bcf2d946175f59a3ac303d51496 | f00ba0115f0929d475765c3e659d8a50c566081b | ceag235/ParroquiaWeb | /parroquialista/models.py | Python | py | 367 | no_license | from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Parroquia(models.Model):
nombre = models.CharField(max_length=300)
direccion=models.CharField(max_length=200)
latitud=models.CharField(max_length=20)
longitud=models.CharField(max_length=20)
... |
d7e4cc23d34127b9cb9ed2969cc3b4a184cfa9f1 | c18caceb163fac41fc89516992e80c6829362790 | grayson5454/Swarm | /Engine.py | Python | py | 9,203 | no_license | from Tkinter import * #Importing module " Tkinter" which contains many window and color functions for user interface, the pygane did not support arrays
from nathan_maze import * #Imports code from a fellow student in my high school, my list of arrays
while True: #Intiates engine
current_map = maze_11 #Sets the map... |
a84ddb8024019500c81674e06bd86929fbac68b7 | 3ce5e39242e6734f149a9577ec15eff81c1f7b18 | kusalhasintha/tic-tac-toe | /tictactoe.py | Python | py | 7,222 | permissive | import random
from collections import Counter
player_modes = ["user", "easy", "medium", "unbeatable"]
default_mode = "easy"
INFINITY = 999999
class Board:
def __init__(self, config: str = " " * 9):
config = config.replace("_", " ")
self.config = config
def get_sq(self, x, y):
return ... |
b95fda3d1c2303df1053cb55b7be2ef3faace88d | db818ce44b910afdc9569fb04728afdd95624444 | MohamedAshrafIbraheem97/buyersStation | /buyersStation/buyersStation/urls.py | Python | py | 812 | no_license | """buyersStation URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/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... |
11f735a927f1b5717546541c831bbf07deb965a7 | 37a3dd381f9367527c9a51e7eccf60b3a0a0504f | moyhSpider/Flask-Blogging | /test/test_views.py | Python | py | 16,720 | permissive | try:
from builtins import str, range
except ImportError:
pass
import os
import tempfile
from flask import redirect, url_for, current_app
from flask_login import LoginManager, login_user, logout_user, current_user
from sqlalchemy import create_engine, MetaData
from flask_blogging.sqlastorage import SQLAStorage
f... |
b9ca67c4664b3ead5fe3a740bdb544a34944b22a | 2e4ed23e0abc8af615187be32a1a773089f05228 | enjoy82/atcodersyozin | /train/TR/ABC117c.py | Python | py | 236 | no_license | N, M = map(int, input().split())
X = list(map(int, input().split()))
if N < M:
x = sorted(X)
B = []
for i in range(0, M-1):
B.append(x[i+1]-x[i])
B.sort(reverse=True)
for l in range(N-1):
B.pop(0)
print(sum(B))
else:
print(0) |
f8549385ac99864028c35389704a00f50ebc3d94 | 9b2611be902b316b99b7c98876888627a962ce8d | hqwisen/django-oauth2-login-client | /oauth2_login_client/views.py | Python | py | 1,239 | no_license | import logging
from time import time
from django.conf import settings
from django.contrib.auth import login as auth_login, authenticate
from django.shortcuts import redirect
from django.core.exceptions import PermissionDenied
from .utils import get_login_url
def login_redirect(request):
request.session['next'] = ... |
c2e3f621436618daed86b7176d2d6c8528d72701 | 2a28873c301bd8f84211e2ec38b2a3dccbbbd814 | batman004/femhelper-backend | /app/migrations/0009_auto_20200314_1903.py | Python | py | 809 | no_license | # Generated by Django 2.2 on 2020-03-14 13:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("app", "0008_auto_20200314_1853"),
]
operations = [
migrations.AlterField(
... |
361dbd032a6f3d33c6170a600f7d88c56709c03f | 72a4ca9ae8f34970cd63d34cf1aebd95a676bcf0 | huang1125677925/fta | /server/fta/utils/cipher.py | Python | py | 2,076 | permissive | # coding: utf-8
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance... |
edc1fae852b9ccff72fd3f6749694c561487209d | 8ed4daa6e61321913b1bdb25b18a349f053aebea | adhaimovich/USPro | /manage.py | Python | py | 552 | permissive | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "USPro.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Djan... |
063e11818f1e4cec5b4e87d66e8d8dcf32ae0182 | a20545984014f0398e91fb4fbec9923e54d3a8ab | kb2623/raspi-trash-bin | /translator/translate_eazyraspi.py | Python | py | 13,213 | permissive | from typing import List, Optional, NoReturn
from textx.export import model_export
from textx.metamodel import TextXMetaMetaModel
import util as utl
import metamodel_eazyraspi as me
import validate_eazyraspi as ve
# Output file variables
DATE_FORMAT = '%b. %d. %Y %H:%M:%S'
LOGGER_FORMAT = 'sample_format.tmp'
LOGGER_... |
1903a382b34f967718a957b2f905ff342f2dfc74 | 141430c229ba647592f81519cfafbb8389efefd7 | 2019-system-analysis-team/New-Demo | /back_end/moneyapp/models.py | Python | py | 520 | no_license | from moneyapp import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(30), unique=True, nullable=False)
password = db.Column(db.String(60), nullable=False)
email = db.Column(db.String(100), unique=True, nullable=False)
telephone = db.Column(db.String(30), unique... |
d9b4571e95e9b1993a4cd4a89c8e8fbe509ba331 | bd18ec20d52d33f94d1c8ae131ac32c9d6ea790d | Git-Math/DSLR | /scatter_plot.py | Python | py | 2,153 | no_license | #!/usr/bin/python3.7
import sys
import os
import matplotlib.pyplot as plt
import utils
from utils import error
import describe
def usage():
error('%s [dataset]' % sys.argv[0])
def scatter(h1, f1, h2, f2, house):
to_pop = [i for i in range(len(f1)) if not f1[i] or not f2[i]]
f1_clean = [x for i, x in enu... |
6afd5ee62a550abfb7b8b41935c1185085c63344 | 46458c4fbb0121adee5ac42c5c0790e46ffd410b | theshivanjali/Pollster-Django-Project | /pollster/polls/admin.py | Python | py | 570 | no_license | from django.contrib import admin
# Register your models here.
from .models import Question, Choice
admin.site.site_header = "Pollster Admin"
admin.site.site_title = "Pollster Admin Area"
admin.site.index_title = "Welcome to the Pollster admin area!"
class ChoiceInLine(admin.TabularInline):
model = Choice
extra = ... |
63b03c9ca3e4e12d452031675bbd0af54820b0d8 | e0ea38513c4d32c4f4cebb7feb65bc4976fe611b | Syndorik/BI | /tests/test_script/test_tdfnotes.py | Python | py | 1,421 | no_license | from random import shuffle
import sys
import os
sys.path.insert(0,"../../lib")
import argparse
import pandas as pd
import numpy as np
from colors import color
from colorama import init
from colorama import Fore, Style
init()
OK = Fore.GREEN+"OK"+color.END
ERROR = Fore.RED+"ERROR"+color.END
valtest = 0
print(Styl... |
35e0284dd5d21ba9ded5ae2aa10ea4c9ae107e7a | 0a0a6f4ce0f1d3ba38222e1220973d01801464e2 | netsec-ethz/scionlab | /scionlab/models/user_as.py | Python | py | 19,952 | permissive | # Copyright 2018 ETH Zurich
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... |
830288477adeaf84cb27783c95337748d20ce717 | e0a1bfd62340023a268391e0b3104f8c4c2eb5af | Abrascha/OpenPCDet | /pcdet/models/detectors/detector3d_template.py | Python | py | 14,739 | permissive | import torch
import os
import torch.nn as nn
from .. import backbones_3d, backbones_2d, dense_heads, roi_heads
from ..backbones_3d import vfe, pfe
from ..backbones_2d import map_to_bev
from ..model_utils.model_nms_utils import class_agnostic_nms
from ...ops.iou3d_nms import iou3d_nms_utils
class Detector3DTemplate(nn... |
d8997a2296be08ff82e4b121db0846f490b030bf | 9b86b9c846fb44c4440f6b63b1756019eb8d6c32 | SpencerGraffunder/Tetrisn-t | /common/connection.py | Python | py | 951 | no_license | import copy
import pygame
from threading import Lock
from common.player_input import *
class GameState:
def __init__(self):
self.board_width = 10
self.board_height = 20
self.board = []
self.players = []
self.current_level = 0
self.score = 0
self.game_over = ... |
43d94d15116b78adcd832ad76bd9fccc5dc7bfe7 | f0ea98551da01798f26869ca6900b4e99954fe6a | stragulus/buildpipe | /buildpipe/pipeline.py | Python | py | 9,289 | permissive | """Dynamically generate Buildkite pipeline artifact based on git changes."""
import re
import os
import sys
import json
import fnmatch
import pathlib
import datetime
import functools
import subprocess
import collections
from typing import Dict, List, Tuple, Set, Generator, Callable, NoReturn, Union
import box
import y... |
365a5595f659c5c228abf6ad71317b1e600bbfc7 | 1f734f036032a33552a597fe3e194bb93c7e2dbe | brianjgeiger/osf.io | /addons/osfstorage/tests/test_views.py | Python | py | 59,637 | permissive | # encoding: utf-8
from __future__ import unicode_literals
import json
import mock
import datetime
import pytest
import responses
from waffle.testutils import override_flag
from nose.tools import * # noqa
from dateutil.parser import parse as parse_datetime
from website import settings
from addons.osfstorage.models i... |
39df9158460592e2a5a6b5c00e43511c540a5053 | f1dff6025d2536268cbf48922fd2373791d33e73 | kbee181756/labspt15-cityspire-g-ds | /app/ml.py | Python | py | 1,459 | permissive | """Machine learning functions"""
from fastapi import APIRouter
from pydantic import BaseModel
router = APIRouter()
class City(BaseModel):
city: str
state: str
class CityData(BaseModel):
city: City
latitude: float
longitude: float
rental_price: float
crime: str
pollution: str
w... |
522893f30698dee4cbd5ae4e48078934bdb0252e | 04b8ac1208bfca496965f0f8cc84dc430dfcfb41 | microsoftgraph/msgraph-sdk-python | /msgraph/generated/sites/item/term_stores/item/groups/item/sets/item/relations/item/set/set_request_builder.py | Python | py | 4,901 | permissive | from __future__ import annotations
from dataclasses import dataclass, field
from kiota_abstractions.base_request_builder import BaseRequestBuilder
from kiota_abstractions.get_path_parameters import get_path_parameters
from kiota_abstractions.method import Method
from kiota_abstractions.request_adapter import RequestAda... |
553a3ebebe9630042e644d2d21c700ec83edbfbe | fa726650923adc9ef3ff1e47aa98ccd11ed65142 | Andrew-Finn/DCU | /Year3/CA318/week02/8209 - Puzzle8Node.py | Python | py | 4,916 | no_license | from Node import Node
class Move:
def __init__(self, row, col):
self.row = row
self.col = col
def __str__(self):
return "({0}, {1})".format(self.row, self.col)
class Puzzle8Node(Node):
def __init__(self, name, parent=None):
# The name will be the square
# The nam... |
e66fce2155141b7cbe38af1883c4bb3c2cd2c1c6 | 91c961ecf6fff38cb56f031e62b0115fa3b45f8c | DayaB/portfolio-project-django3 | /shorter/models.py | Python | py | 378 | no_license | import subprocess
from django.db import models
# Create your models here.
class Short_Url(models.Model):
short_url = models.CharField(max_length=20)
long_url = models.URLField("URL", unique=True)
def copy2clip(self, txt):
print(txt)
cmd = 'echo ' + (txt + self.short_url).strip() + '|pbco... |
4f71cb47dbe252f8f40249c88990561a00e7ebd6 | dcfc879780854cc2708c43fc9cc6c913009396cd | arokem/mne-python | /mne/fiff/evoked.py | Python | py | 12,595 | permissive | # Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
import numpy as np
from .constants import FIFF
from .open import fiff_open
from .tag import read_tag
from .tree import dir_tree_find
from .meas_info import read_meas_info
de... |
c87a420a5f95faa04dafc5426479f3a595b5bb1e | 8a99ee355337c84760ff0727c1575d422cd9e93b | amitray1608/PCcodes | /python/ramanTest5.py | Python | py | 771 | no_license | import numpy as np
str1 = "this is string example....wow!!!"
str2 = "exam"
print(str1.find(str2))
print(str1.find(str2, 10))
print(str1.find(str2, 40))
Ar = [1, 3, 5, 7, 11, 13, 15, 20, 21]
print(Ar[1:8:2])
import numpy as np
print(np.random.rand(10, 5))
import pandas as pd
data1 = {"id" : [10,20,30,40],
"Na... |
f5430209b343eedebbe1c62cce4f9d67af2aa77e | f114a11f39e09e61d747e144c77a4eb27235317f | minatuyang/RASP-ATTA | /face_detect/sample_cv.py | Python | py | 469 | permissive | import cv2
camera = cv2.VideoCapture(0)
while True:
ret, frame = camera.read()
if not ret:
break
#frame = cv2.flip(frame, 0) # 上下翻转
frame = cv2.flip(frame, 1) # 左右翻转
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
gray = cv2.GaussianBlur(gray, (21, 21), 0)
cv2.imshow('source', frame... |
d702a2571d52579fe705c9fcc326f373d71c55d4 | b0f5816e631b142126925c97fed67ccd18586fa3 | luqmantuke/Faulu-Hub | /contact/models.py | Python | py | 309 | no_license | from django.db import models
# Create your models here.
class Contact(models.Model):
name = models.CharField(max_length=50)
email = models.EmailField()
subject = models.CharField(max_length=80)
message = models.CharField(max_length=20000)
def __str__(self):
return self.name
|
12501395b213cd30af7d3852ba0c6ed066030731 | 02f3fd692149fc60f636b92f191239a3e84aaa7f | griffinelijah/flask-lab-hw | /resources/plants.py | Python | py | 4,131 | no_license | import models
from flask import Blueprint, jsonify, request
from flask_login import current_user, login_required
from playhouse.shortcuts import model_to_dict
plant = Blueprint('plants', 'plant')
@plant.route('/', methods=['GET'])
@login_required
def plant_index():
try:
#find all plants that have an owner mat... |
330eb339809c0ccd94324d3586ca5b478a3cc181 | 631ca895242bc7f6de0fd0e8f1c2f1b94e0ced89 | mun1shk/DeepLearning | /firstKeras.py | Python | py | 575 | no_license | import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.optimizers import SGD
import numpy as np
model = Sequential()
model.add(Dense(32, activation= 'relu',input_dim= 100))
model.add(Dense(1, activation='sigmoid'))
model.compile(optimizer='rmsprop',... |
7a57e3982d864b86680d261e13b271055e3dd160 | ffdf0f55c91bf8b2a94b7313350fde15c2380179 | VeroniqueSoleil/material | /mng/views.py | Python | py | 22,124 | no_license | import calendar
import logging
import math
import os
from datetime import date, timedelta
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.db.models.aggregates import Sum
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
# Create your views... |
18e3e6c51f4ef883f75e348184298d81fcd448bb | 060515ddf919b5185c17df96d4567917e4cbc30a | eepgxxy/Paddle_Attention_CNNs | /networks/RAN/attention_module.py | Python | py | 20,016 | permissive | import paddle.nn as nn
from basic_layers import ResidualBlock
class AttentionModule_pre(nn.Layer):
def __init__(self, in_channels, out_channels, size1, size2, size3):
super(AttentionModule_pre, self).__init__()
self.first_residual_blocks = ResidualBlock(in_channels, out_channels)
self.t... |
d5b7dd025e77097207c7cf8a77660bceff16baf4 | 495f33c452764a32c7e0920c091985b154c0b997 | wjddn803/TeamAlpha | /scripts/oracle-estimator/estimate_multiple_oracles.py | Python | py | 4,484 | permissive |
# Credits
# Written by Shashi Narayan to use original ROUGE
# Improved by Yang Liu to use a must faster ROUGE
import os
import re
import itertools
from multiprocessing import Pool
import sys
from preprocess import rouge
import codecs
def cal_rouge(fullset, sentdata, golddata):
fullset.sort()
model_highligh... |
996b5329ebbbfe15e88c496f34a5f4e634714ab9 | aeabf3cf1083b608af0ca0375de283a8d147c5ef | likelyzhao/QPCM-toolbox | /pytorch/video-cls/i3d-pytorch/dataset.py | Python | py | 4,376 | no_license | import torch.utils.data as data
from PIL import Image
import os
import os.path
import numpy as np
from numpy.random import randint
class VideoRecord(object):
def __init__(self, row):
self._data = row
@property
def path(self):
return self._data[0]
@property
def num_frames(self):
... |
a8b73d77e1dd56a22e8234b59810919a4fce6f04 | 966d785690b932e613da2111209943e4a96cc9b0 | jonpurdy/statsd2prtg | /statsd2prtg/__main__.py | Python | py | 14,396 | no_license | #!/usr/bin/env python
"""Usage:
statsd2prtg [--debug][--httpbin][--interval <seconds> ]
Options:
-d, --debug Log debug messages
-b, --httpbin Post HTTP to httpbin.org
-i, --interval Number of seconds between HTTP POSTs
-h, --help Print this help screen
"""
#from .statsd2prtg impor... |
692c4a967706e57c311b95de69403504ffd79b95 | db245bdbf19bb8191063b5c2f64fe5e5446018bb | arrteme/reddit2telegram | /reddit2telegram/reporting_stuff.py | Python | py | 1,921 | permissive | #enconding:utf-8
import logging
import sys
import os
import yaml
from raven import Client
from raven.handlers.logging import SentryHandler
from raven.conf import setup_logging
import utils
with open(os.path.join('configs', 'prod.yml')) as config_file:
config = yaml.safe_load(config_file.read())
if 'sentry' in... |
61114f13aae087e0c5c58e85c837e30330c5ed8a | 68f1d4f92ae430acdf279b477aeee5b9425b3e65 | dianaxime/Lab1-Filling-any-polygon | /lib.py | Python | py | 4,224 | no_license | '''
Diana Ximena de León Figueroa
Carne 18607
Lab 1 Filling any polygon
Graficas por Computadora
21 de julio de 2020
'''
from utils import color, char, word, dword
BLACK = color(0, 0, 0)
WHITE = color(255, 255, 255)
class Render(object):
def __init__(self):
self.framebuffer = []
... |
c62e9a85dada6508141a3acce31314d8624cd640 | fbcb3948d40dd6ef1c95b50a2f03337f0ca8f1fc | RobotColony-UEFS/feature-match | /Desempenho/Arquivos_Desempenho/HARRIS/HARRIS_sift/parserSiftTime.py | Python | py | 4,729 | no_license | import math
nImg = 1
con=0
l8 = []
l9 = []
l11 = []
l12 = []
l13 = []
l14 = []
l15 = []
l16 = []
l17 = []
l18 = []
l19 = []
l20 = []
l21 = []
l22 = []
l23 = []
l24 = []
l26 = []
l28 = []
l29 = []
l30 = []
l31 = []
l32 = []
l33 = []
l34 = []
l35 = []
l36 = []
l37 = []
l38 = []
l39 = []
l40 = []
l41 = []
l42 = []
l44 = ... |
8b441f36094f15fdc18c2bfcacdc7f37b6c967b0 | d75959537e7737915140ddf6a87f464a1f64828d | zelvor/cse-ppl | /Week2 - Lexer/Tut1/initial/target/BKITVisitor.py | Python | py | 505 | no_license | # Generated from main/bkit/parser/BKIT.g4 by ANTLR 4.9
from antlr4 import *
if __name__ is not None and "." in __name__:
from .BKITParser import BKITParser
else:
from BKITParser import BKITParser
# This class defines a complete generic visitor for a parse tree produced by BKITParser.
class BKITVisitor(ParseTr... |
34bcb1b8476fe5de5d72d02aba5101d3efa61f64 | 7cff2f6024864b2357e8b66bff43e1bd703a6cf8 | Basavsagar/walmart-assessment | /UnitTest.py | Python | py | 1,609 | no_license | import unittest
import json
import Solution
class UnitTest(unittest.TestCase):
def validate(self,actual,expected):
for location, count in actual.items():
self.assertEqual(count,expected[location])
def test_findStoreCount_HappyPath(self):
stores = [{"x": 5, "y": 3}, {"x": 0, "y": 0... |
a9b6e6c6a88f999598f04e1016794b9449da3715 | bf68e35ffe31f8dbe01b1344a372b1b9cb375d47 | tmm1/home-assistant | /homeassistant/components/alarm_control_panel/__init__.py | Python | py | 2,797 | permissive | """
homeassistant.components.alarm_control_panel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component to interface with a alarm control panel.
"""
import logging
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.components import verisure
from hom... |
635db75f2e9d807997606417962e996be7a12fa8 | 3f594e1609684c2aeaa5dfd8ee3c834ce7c4d59c | NKPmedia/delira | /delira/training/__init__.py | Python | py | 432 | permissive |
from .parameters import Parameters
from .experiment import BaseExperiment
from .base_trainer import BaseNetworkTrainer
from .predictor import Predictor
from delira import get_backends
if "TORCH" in get_backends():
from .experiment import PyTorchExperiment
from .pytorch_trainer import PyTorchNetworkTrainer
i... |
2c9abadcf1ccc268bc4ed0a8752a05189d32b325 | 1863be5e0de0a14115c8baba26901d418b7535f7 | drincruz/simple-django-blog | /tests.py | Python | py | 712 | permissive | """
This will be your unit tests for the simple blog
"""
from django.test import TestCase
from models import Post
class SimplePostTest(TestCase):
def setUp(self):
# Create a 'Post' object
blog_post = Post.objects.create(
title = 'My test title',
content = 'This i... |
dffd4fcce08a2e88915293958ff06733936f8c9d | e7f626bcc14238059021988ca569505f5c9675de | bhavishya18/Let-s-Code-Python- | /RotateMatrix.py | Python | py | 495 | no_license | #!/usr/bin/env python
# coding: utf-8
# In[7]:
def rotatematrix(matrix):
if matrix==None:
return
result = []
submat= []
n=len(matrix)
for i in range(0, n):
submat= []
for j in range(n-1,-1,-1):
submat.append(matrix[j][i])
result.append(submat)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.