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 |
|---|---|---|---|---|---|---|---|---|
d1e4986fe6c1e9e458808c6d569249895b93b13d | 411d0c629556cadfbeb8b15b5eae56529c231043 | facebook/pyre-check | /client/tests/terminal_test.py | Python | py | 719 | permissive | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-unsafe
import unittest
from unittest.mock import MagicMock, patch
from .. import terminal
class PyreTest(unittest.TestCase):
... |
72d87ef002d6642c9a19c2fffd9579c4995d4e64 | d5d6dc71ac6ddf0777ae14fd90dbe1d1246277d7 | gao1741857805/work | /pythonProject/PolicyBenchAPI/common/get_excelData.py | Python | py | 1,032 | no_license | #-*- coding utf-8 -*-
# @time : 2021/12/31
#@Author : gaojunwen
import xlrd
import json
import copy
def get_execlData(sheetName,caseName):
'''
获取中的数据
:param sheetName : 表名
:param caseName : 某一个接口的用例名
:return:返回数据
'''
resList = []
execlDir='../testdate/文件名.xls'
wordBook=xlrd.open_w... |
0da968704ac0a71d719e4abf66deb671ac4bb778 | dfebd4f31ec92e2356f67e9a1b7bbed6ad771f95 | shyamu-ar/bidrequest | /demo.py | Python | py | 56,986 | no_license |
# number = int(input("Enter number: "))
# raiseto = int(input("Enter raise to number : "))
# total = number
# for i in range(1,raiseto):
# total *= number
# print(total)
# defined_list = list(range(1,101))
# user_list = input("Enter your list with comma seperated").split(",")
# print(type(user_list))
# not_availa... |
ba94e106828f134c3ebadbc7226ec59c38e5b354 | 92738e915236036bd03919e77995b5c15da271f1 | pororo87/CallMasal | /callmas10.py | Python | py | 2,884 | permissive | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Coded by KANG-NEWBIE
"""
ini coba belajar rekode
lumayan tambah ilmu ......
"""
try:
import os, requests, time, json
except ModuleNotFoundError:
print("\nSepertinya module requests BELUM Di Install")
print("$ pip install requests\n")
exit()
os.system('clear')
c=('\033[1... |
accd9ecf0e0507471bdbd7f9cdae65ad18f64e07 | 83e898f16b7b2d804ee4c1b25e1bfe0dfcf2fea1 | pcote/mashedpotatoes | /main.py | Python | py | 3,765 | no_license | from flask import Flask, request, redirect, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
import os
import random
import time
import configparser
app = Flask(__name__)
##################################
# Setup of database configuration#
##################################
confparser = configparser.ConfigParser... |
bed5bc38f9517cc56a994045ad973b26584dd295 | deb33838f23679a7df89868b5fa17c00885fdb87 | j-j-w/sqlalchemy | /test/orm/inheritance/test_poly_persistence.py | Python | py | 16,423 | permissive | """tests basic polymorphic mapper loading/saving, minimal relationships"""
from sqlalchemy import exc as sa_exc
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy.orm import create_session
from sqlal... |
a842de32341e0c312c3d5d5b4899af646cadfe60 | c73a878007293dbe15268d083551366e7171b12a | sebastienle/learning_tdd | /tdd_with_python_jwp/tdd_01/urls.py | Python | py | 986 | no_license | """tdd_01 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... |
dd9f32b8da78d08095dabe357936f317747f95fc | deb444ebde90099e29fdd98dbe690bd1314dd2d0 | jayvdb/travis_log_parser_wip | /tests/test_parse_log.py | Python | py | 29,629 | no_license | from __future__ import absolute_import, unicode_literals
import codecs
import glob
import os
from travis_log_parser import BlockParser
from travis_log_parser.blocks import (
EmptyFold,
Fold,
Timer,
AnsiColour,
CommandLine,
Line,
TravisYmlEnvironmentVariables,
)
from travispy import Travis... |
83acd10b5248b53a303fda0da3acd755927e5a3f | b16babe65d3a980a8850c057ddf1f7bd7e92a291 | antomuli/Hadithi | /app/mod_dashboard/views.py | Python | py | 4,952 | no_license | from . import dashboard
from flask import render_template, redirect, url_for, request, flash
from flask_login import current_user, login_required
from app.forms import EditProfileForm
from app.models import AuthorAccount, Story
from app.forms import StoryForm
from app.utils.decorators import check_confirmed
from app im... |
3adbbe9eaeb66329f8b4532ab23f9cf3c974c9e5 | 4a057f972c9d2aadae22df22abdfbfb99fd9a26f | Skarlso/pythonadvent | /day1/part2.py | Python | py | 297 | no_license | from functools import reduce
with open('input.txt', 'r') as f:
data = f.read().replace('\n', '')
location = 1
index = 0
for i, ch in enumerate(data):
if ch == '(':
location += 1
else:
location -= 1
if location < 0:
index = i
break
print(index)
|
8eb2a399f788fd0b13a1c1a87c99aa7e2d42eeef | 54f016a7d554ae68d5ff0662037559cd5e388fc8 | siwei6525/AWS_smart_door | /lambda_functions/visitor_page_lf.py | Python | py | 3,404 | no_license | import json
import boto3
import time
import logging
from boto3.dynamodb.conditions import Key, Attr
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
dynamodb = boto3.resource('dynamodb')
table_p = dynamodb.Table('pwd')
table_v = dynamodb.Table('visitor_ex_img')
def lambda_handler(event, context):
log... |
8cab92b5ce564c4ab4519b18f6cdc7bdd682636d | d11d40e34f4351759f03793048ab8e5bd39bae61 | bobort/cheese | /profile/views.py | Python | py | 5,037 | permissive | import stripe
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.shortcuts import render, redirect
from django.template.loader import render_to_string
from django.urls import reverse, rever... |
196e8793ae26f9adebdefad4a3f5c55933c1699c | 29606097ed2714f851bfdd3ef07c6426c1b0d52a | dkbhadeshiya/mattermost-chatops | /Chatops/manage.py | Python | py | 627 | permissive | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Chatops.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... |
54dcd2ff3ee85a4970cb2d00648f4142d7153dc5 | 269feff45990cc831affef5281e29c31c978c326 | casbin/openstack-patron | /patronclient/v2/keypairs.py | Python | py | 2,884 | permissive | # Copyright 2011 OpenStack Foundation
# 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 requ... |
f230daba5a23b313d196fe626e1cecf8443d3376 | 7537dd786ed8b184e81bc1086bcefccec6cd312e | jamayfieldjr/iem | /htdocs/rainfall/mrms2img.py | Python | py | 3,562 | permissive | #!/usr/bin/env python
"""
Create ERDAS Imagine file from a MRMS Raster
"""
import cgi
import os
import datetime
import zipfile
from osgeo import gdal
from osgeo import osr
from imageio import imread
import numpy as np
from pyiem.util import ssw
def workflow(valid, period):
""" Actually do the work! """
fn = ... |
994eb421cc738cf93f35e035dcedde42ebe933cb | 471a583333f7eb9fc0fa2ef8dc2b2878947eeec5 | Smit1400/Blogging_Site | /Blogging_Site/blog/migrations/0001_initial.py | Python | py | 904 | no_license | # Generated by Django 3.0.2 on 2020-01-15 09:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
b066c4465048c0ce6aada90e4e1eba5054c760e4 | 317d6787ce84b230e02843b90ad7fcad00d4f072 | Rowing0914/DQN_Keras | /dqn.py | Python | py | 4,330 | no_license | import numpy as np
import gym
import random
from collections import deque
from keras.layers import Input, Activation, Dense, Flatten, RepeatVector, Reshape
from keras.layers.convolutional import Conv2D
from keras.models import Model
from keras import backend as K
from keras.utils import plot_model
class Agent:
de... |
8f337371981f01d3d2e3ef1226d8a3ec7f121f10 | 22ecdae8cc2d10381664465692a5e3fd7bcd3fc1 | KirillKrasikov/AlphaGo | /dlgo/agent/helpers.py | Python | py | 1,297 | no_license | """Agent helpers module
"""
from dlgo.gotypes import Point
def is_point_an_eye(board, point, color):
"""Whether this point is the eye
Args:
board:
point:
color:
Returns:
Move
"""
if board.get(point) is not None: # eye is a empty point
return False
... |
9864941ca9e15ec254e7c32bd2b4f2d85ba6a822 | 7eccfe71b8872d238f6c83ed5012b1d7ab589ee5 | billonalex/DiceRoller | /api/repository/userRepository.py | Python | py | 3,165 | permissive | from models.user import User
from models.response import Response
from db.db import connect
class UserRepository():
def get_users(self):
conn = connect()
sql = '''
SELECT
idutilisateur,
nom,
prenom,
adresse,
codepostal,
ville,
pays... |
ab6618f3af0d8b43712034fae5a7874cddfb418f | 5085cc522366d74397af295242bf9671f3b7a478 | Arpit2218B/WatchDogs | /screen.py | Python | py | 744 | no_license |
# Python program to take
# screenshots
import numpy as np
import cv2
import pyautogui
import time
counter = 1
def screenshot():
# take screenshot using pyautogui
image = pyautogui.screenshot()
# since the pyautogui takes as a
# PIL(pillow) and in RGB we need to
# convert ... |
4f6c1aec12e45548f6d10b0a41d1cb8c1798f4ea | 843b37c4f6aa80c15f75726b138443a8cccfce2f | farhan1ahmed/Training | /Week2Day3/Set discard() remove() pop().py | Python | py | 292 | no_license | sizeS = int(input("Size of Set S: "))
S = set(int(x) for x in input("S: ").split())
total = int(input("Number of commands: "))
for i in range(total):
inp = input().split()
com = inp[0]
val = ""
if len(inp) > 1:
val = inp[1]
eval("S."+com+"("+val+")")
print(len(S)) |
13671b85d0e8261832825a2750fea3a464875086 | 425b891b10cdfcf8a9121a6c8aaf9890351f2b5a | debeshmandal/simulearn | /course/03-artificial/preprocessing.py | Python | py | 2,180 | no_license | #!/usr/bin/env python
"""
Code for building Artificial Neural Network
https://colab.research.google.com/drive/17jqM6EqCaDENJTcUvAuo6DOf3IKYC571
"""
import numpy as np
import tensorflow as tf
import datetime
import pandas as pd
import os
# get dataset from tensorflow built-in datasets
from tensorflow.keras.datasets im... |
3279c98bc84510b96116b5d29544c8adafdfe6a7 | 9086b96f18db779698c1b33f99eba1096c09c2c3 | mayeut/pep600_compliance | /pep600_compliance/images/os/ubuntu.py | Python | py | 7,180 | permissive | from pep600_compliance.images import base, package_manager
class Ubuntu(base.Base):
def __init__(
self,
image,
eol,
machines,
packages,
apt_sources_update=[],
ppa_list=[],
python="python3",
):
_, version = image.split(":")
self._p... |
e166a09899d4689d4a847979f38a3dd4aa3de874 | 9c917555ba78ecfc620823ba28e250ec0a44d4cf | vbhattad/Hilti-IoT-2017-Challenge | /src/iot/settings_old.py | Python | py | 2,733 | no_license | """
Django settings for iot project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths insi... |
1036f7396c767d1a13a57ab51b43b51816491e3e | 5ee642d31ea78cc7c925acb5c4ca34b201945399 | surypratap496/python-program | /management/migrations/0002_auto_20190828_0512.py | Python | py | 763 | no_license | # Generated by Django 2.1.11 on 2019-08-28 05:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('management', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
32e741ad750048be323bec6c367ee0191ce3ff1a | f68c7ebb67e24f31bb363688acc578ca03942d61 | eotles/PHlth903 | /fbatFormatter.py | Python | py | 2,234 | no_license | '''
Created on Aug 1, 2014
@author: eotles
'''
import time
import sys
def main():
genFilePath = "/project/EngelmanGroup/GAW19/FBAT/genonly.txt"
pedFilePath = "/project/EngelmanGroup/GAW19/FBAT/pedonly.txt"
tmpIFilePath = "/project/EngelmanGroup/GAW19/FBAT/tmpI.txt"
genFile = open(genFilePath)
... |
135ef44097d9a92aa338094f7243f5996c56e737 | cbd6c3527a31f22087602e0662c6ee590f370f20 | catherine244/Reviews | /awwards/migrations/0002_auto_20200219_0709.py | Python | py | 500 | permissive | # -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-02-19 07:09
from __future__ import unicode_literals
from django.db import migrations
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('awwards', '0001_initial'),
]
operations = [
migrati... |
ac574f45481b4780d9f34991c9e736efb4115be8 | 689f62c2d1efad507c36bc5ff002140974ef682b | lifedotark/CloudSync | /services/search.py | Python | py | 1,816 | no_license | # -*- coding: utf-8 -*-
class SearchService(object):
def __init__(self,service):
self.service = service
def find(self, name_equals=None, mimeType=None, begin_with=None, folder_name=None):
query = "{} and trashed=False"
if begin_with:
quer... |
fda246efcbb453b1790a5ccbcdf7c63aeb07b471 | 014fe89121512055c3d4d24f3f20310dbb4f3cd8 | ravindrabharathi/python-samples | /Difference.py | Python | py | 469 | no_license | class Difference:
def __init__(self,a):
self.__elements=a
#self.__maximumDifference=0
def computeDifference(self):
a=self.__elements
a.sort()
n=len(a)
setattr(self, 'maximumDifference',a[n-1]-a[0] )
#return self.__elements
_ = input... |
1f1060d646305ca17691b7c147154d0c3768780c | 99df593be867ab6a0915a67d45eb33507c628f86 | lais-huol/software-salus-alpha-version | /base/utils.py | Python | py | 17,058 | no_license | import sys
import unicodedata
from time import time
import calendar
import datetime
import difflib
import importlib
import jellyfish
import json
import logging
import pandas as pd
import re
import threading
from datetime import date, timedelta
from django.conf import settings
from django.contrib.auth import get_user_m... |
e0a54ef9d7d409b3686384eb55d95b474b270327 | 0713b96c3d45ca6704d49c224a6c14f214b2f214 | cyberdelia/metrology | /tests/reporter/test_librato.py | Python | py | 1,109 | permissive | import requests
try:
from mock import patch
except ImportError:
from unittest.mock import patch # noqa
from unittest import TestCase
from metrology import Metrology
from metrology.reporter.librato import LibratoReporter
class LibratoReporterTest(TestCase):
def setUp(self):
self.reporter = Libr... |
e65f92e5e37993ca2443c70bd5754c858bdf4f4a | 12d92004774b935494b71114b2196dedc4234b59 | mdkearns/flask-bootstrap-templates | /Navbars/Flask-App-Bootstrap--Navbar-Fixed/app.py | Python | py | 297 | permissive | # File: app.py
# About: A Simple Flask App Template
# Author: Matthew Kearns
# Email: mattdkearns@gmail.com
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
"""index.html"""
return open('./index.html', 'r').read()
if __name__ == '__main__':
app.run()
|
c80a59429dcae0040b5f741754ec6ab65bab867c | 63b6c3860a2967db967561581fa060f5dae64082 | huggingface/diffusers | /examples/research_projects/mulit_token_textual_inversion/textual_inversion.py | Python | py | 38,161 | permissive | #!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. 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/LI... |
d53afb792a9744af77e2f77fb28f2df602041c84 | 33dcc89274b46e9e654411c7bdb0ee4631dd5c97 | choarny/systemsCNN | /Generator.py | Python | py | 1,424 | no_license | import random
import os
import urllib
if not os.path.exists('training'):
os.makedirs('training')
if not os.path.exists('test'):
os.makedirs('test')
#training data
for i in range(10):
#tiling_resolution = random.randint(0, 11)
tiling_resolution = 11
column_num = 320
row_num = 640
#column_n... |
f793c6f4a717920b9b4ce23ecaddb6f4c717a670 | 43ccce974079a9d768912abd4a763574ba2c274b | YuriiSynyavskiy/csv_gen | /manage.py | Python | py | 671 | no_license | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'csv_gen_backend.settings')
try:
from django.core.management import execute_from_command_line
exc... |
4d0ff413ff396e8984ea832666c6ec8bb42cd674 | a3804672ef9ea54db873098711c43998e392fde5 | bridgecrew-perf6/django-deployment-example-119 | /learning_templates/learning_templates/urls.py | Python | py | 955 | no_license | """learning_templates 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')
... |
8ef94e2995186a4c410c38f7b8015061c7c4e451 | 085b193d04520255a0c7deb238b355f9432f45c2 | NiiColeman/law-firm | /schedules/migrations/0002_delete_schedule.py | Python | py | 288 | no_license | # Generated by Django 2.2.6 on 2020-03-08 20:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('schedules', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='Schedule',
),
]
|
30767fdd9a30c2f86ae53230afb24b722bd3ddf1 | 06b3062dc30f83cfe16c8cf50bc0e36c6cd5b840 | ariavasulin/ants | /ants.py | Python | py | 27,990 | no_license | """CS 61A presents Ants Vs. SomeBees."""
import random
from ucb import main, interact, trace
from collections import OrderedDict
################
# Core Classes #
################
class Place:
"""A Place holds insects and has an exit to another Place."""
def __init__(self, name, exit=None):
"""Creat... |
30d996b2b7f5049aa1be3fcae6e0e1aa9d34bc10 | 5c89d8323b78acb8d836c2860210b2210e7f3323 | raghurammanyam/pythonpractice | /reportid.py | Python | py | 1,810 | no_license | import requests
import json
import pandas as pd
from pprint import pprint
def reportid():
final_data=[]
params = {
"grant_type": "password",
"client_id": "3MVG99OxTyEMCQ3gUD3vF8Y8ie97jGc2iKs__OCuoUv6ecvrUVuAyOu_qsL2zsWTeLpVZYUGEQiPJU28CTa2r", # Consumer Key
"client_secret": "70394CB345C... |
95556087ac5065b81f6e1b97d8012475a579b37e | 9e1a1ca31aaed00f4cc221cef79e9816b1bfeb2f | sungminoh/boards-notifier | /crawlers/snulife.py | Python | py | 3,347 | no_license | # -*- coding: utf-8 -*-
from datetime import datetime
import re
from crawlers.crawler import Crawler, Post
class Snulife(Crawler):
data = {'act': 'procMemberLogin',
'mid': 'main',
'success_return_url': 'http://snulife.com/main',
'keep_signed': 'Y'}
header = {'Accept': 'tex... |
7ec403fc30863dd25b9dc8f2f1d0272055380349 | bb259c6ae54fd1b45f063c00eee942fc8170edad | alkuhlani/test1 | /funding_management/program_management/doctype/program1/program1.py | Python | py | 260 | permissive | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Program1(Document):
pass
|
11aaa5dae3547a1279b5ce96188641fa2339e7bc | da705914903bbf2ffde5b6ace368d79ac4ad63e6 | 27343sven/Scrabble | /Screens/Template.py | Python | py | 1,281 | no_license | import wx
class Schermpje(wx.Panel):
def __init__(self, parent, id):
wx.Panel.__init__(self, parent, id)
boxje = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, -1, "LORUM IPSUM")
text.SetFont(wx.Font(50, wx.ROMAN, wx.NORMAL, wx.NORMAL))
boxje.Add(text, 1, wx... |
0c0dae701e67c2380b40651a43f92a1c2dcacec5 | ea6dd2b12155d5642012f5692a4fb4e2bece62fb | troylee/masking | /egs/aurora2/a12_00_convert_train_pdf.py | Python | py | 964 | no_license | #!/usr/bin/env python
import string, sys
from scipy.io import savemat
scplst=[]
fin=open('/home/li-bo/aurora2/data/lists/wav2mat_train_all.scp')
while True:
sr=fin.readline()
if sr=='':break
sr=sr.strip()
lst=sr.split(' ')
sr=lst[2]
fname=sr[sr.rfind('/')+1:] # remove path
fname=fname[:fname.rfind('.')] # remov... |
c7ed7c46888c3eb51f2f7c4f031b5e8174af462f | c3c94418b27d8579e2e1e4e64427b0ba9c1a2d59 | bingbingAshe/samples | /app/venv/Lib/site-packages/migrate3.py | Python | py | 13,093 | no_license | # -*- coding: utf-8 -*-
'''
migrate
-------
A simple generic database migration tool
:copyright: (c) 2014 Francis Asante <kofrasa@gmail.com>
:license: MIT
'''
__version__ = '0.3.11'
__all__ = ['Migrate', 'MigrateException']
import os
import pwd
import sys
import argparse
import glob
import string
import subprocess... |
a0ec99124cc2d0cad2a5e744c2af374d54a32f0c | 15c4f3a280a500ee0fc009d1ed94d7f79f52a5da | BjoB/gros | /src/gros/utils/log.py | Python | py | 445 | permissive | import logging
import colorlog
def init_logger(module_name):
log_format = (
'%(asctime)s - '
'%(name)s - '
'%(levelname)s - '
'%(message)s'
)
colorlog_format = (
'%(log_color)s '
f'{log_format}'
)
colorlog.basicConfig(format=colorlog_format)
log... |
2e6ff19fc16f2c689878f5273726f23cdfc9f9b3 | f02731615052304bd5175f7cb72d7d1ff6c46c91 | yuhonghong7035/data-science-on-gcp | /04_streaming/simulate/df05.py | Python | py | 4,265 | permissive | #!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# 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... |
a42c9b87731e92a1a6b259c64f8a84d11a9f98a5 | 9c6ba4a1dd3f7c017f70289473df0de0e73eea67 | sohn0356-git/TIL | /Django/pr_210123/pr_210123/asgi.py | Python | py | 395 | no_license | """
ASGI config for pr_210123 project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... |
a8b36b607f7a918eebc781e70706f36507013b82 | 005bc5e3f9f510f4427625ccb475a8eb60d58007 | yash0305/med | /Med_store/wsgi.py | Python | py | 395 | no_license | """
WSGI config for Med_store 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_SET... |
4dd0ae21d93ad4908ae87111a150739aa88928f7 | adb426ab2404bef21ca8a09048c4625ac7ef0f3f | AnonymousPaperCODEAccount/Plots_from_DOCTOR | /Santiago/Setup_3/run_results_analysis.py | Python | py | 24,071 | no_license | import pandas as pd
import numpy as np
import re
import os
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib
import matplotlib.ticker as mtick
import scipy.stats
def mean_confidence_interval(data, confidence=0.95):
a = 1.0 * np.array(data)
n = len(a)
m, se = np.mean(a),... |
adca447c6fd0b10f852ffe9485969ecf7b4c8223 | 92695f80a2e5dc71759bb33e816b168d0de83f77 | syssi/home-assistant | /homeassistant/components/youtube/config_flow.py | Python | py | 7,718 | permissive | """Config flow for YouTube integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import Resource, build
from googleapiclient.errors import HttpError
from googleapicli... |
6f2baafac85d375375a3245b5e873ced51ea5c52 | 5fc352e074550c75d52ba0501f2f59eeda0c44ec | lhornok/exercice08 | /tests/page.py | Python | py | 2,292 | no_license | # -*- coding: utf-8 -*-
from element import BasePageElement
from locators import MainPageLocators
from selenium.webdriver.common.keys import Keys
class SearchTextElement(BasePageElement):
"""This class gets the search text from the specified locator"""
#The locator for search box where search string is enter... |
2729de827b0664bbbe58bc59978fc7aceb736917 | bd7feaed328016a69f6e680797ffd6b463102e0b | JP09/traitsPredict | /NLP traitsPredictor/trainBuild.py | Python | py | 1,882 | no_license | import re
import string
import pandas as pd
from nltk.corpus import stopwords
class trainBuild:
def __init__(self):
self.stop = list(set(stopwords.words("english")))
self.word =[] ## NRC word list
self.better = {} ## NRC word attributes
self.data = pd.DataFrame() ## all data
## get all required values
def g... |
392b8c3a2634b1098c17d82cb079a770f65f0067 | 2a118cef91ed783a1bb9bf846796cfdc7673d1fa | 12libao/DEA | /.history/Sizing_Method/ConstrainsAnalysis/DesignPointSelectStrategy_20210716112734.py | Python | py | 14,025 | no_license | # author: Bao Li #
# Georgia Institute of Technology #
import sys
import os
sys.path.insert(0, os.getcwd())
import numpy as np
import matplotlib.pylab as plt
import Sizing_Method.Other.US_Standard_Atmosphere_1976 as atm
import Sizing_Method.Aerodynamics.ThrustLapse as thrust_lapse
import Sizing_Method.Aerodynamics.Ae... |
7dccd92866c6be9fcb49725b7886fce1ed6b37e5 | 2aa2a45fde183e566be4ff189c6cff51a2501980 | Verrah/sentiment-discovery | /cfg/configure_system.py | Python | py | 2,763 | no_license | import os
import sys
import time
import torch
from experiment_logger import Logger
class SystemConfig(object):
def __init__(self, parser):
super(SystemConfig, self).__init__()
self.parser = parser
def apply(self, cfg, opt):
"""initalizes stdout/err, distributed processes, random seeding, and logg... |
ad3be07fa305ad2dbae9c00c2bed91369a79fdad | 2d7d89504d8c94aa8698fe3031144011fc998e9c | Dongaiqing/CodeCraft | /pyModules/Queries.py | Python | py | 7,240 | no_license | class Queries():
@staticmethod
def insertIntoQuestionCode():
return 'INSERT INTO QuestionCode(title, article, answer, totalRating, numRating, author) VALUES (%s,%s,%s,%s,%s,%s);'
@staticmethod
def tryLogin():
return 'SELECT * FROM UserProfile WHERE username=%s AND password=%s'
@sta... |
8288145c299441ef0ec28f5cf72b35fd021ff4dc | 518ce7b40b52faf66610a2cd0dce90397fd0dbfd | hygenie1228/Mask_R-CNN | /common/nets/rpn.py | Python | py | 9,706 | no_license | import torch
from torch import nn
import torch.nn.functional as F
from torchvision import ops
from config import cfg
from utils.func import Box
from utils.losses import smooth_l1_loss
from utils.visualize import visualize_box, visualize_labeled_box
from nets.anchor_generator import AnchorGenerator
class RPN(nn.Module... |
2692be38fa7f9f4e03c88abf16ed48668bd07877 | 92cba8ca4eebab4603ed4c84ee0af9b47d7b2ce9 | nclv/room-assignment | /src/solution.py | Python | py | 4,930 | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Adjacency matrix for room neighbour
See https://stackoverflow.com/a/64034128
---
Assignment of n students to m rooms.
We use a cost matrix.
<student>: <room numbers>
A: 1, 2, 3
B: 4, 5, 6
C: 7, 8, 1
D: 2, 3, 4
1 2 3 4 5 6 7 8
A 1 1 1 0 ... |
d86da495df736ccdeadac2abe47f57636116136c | e0929566b4678df36fb41676e8c9963c694fe79a | YolandaLyj/leetcode | /模板/快排.py | Python | py | 853 | no_license | def quick_sort(data):
"""quick_sort"""
if len(data) >= 2:
mid = data[len(data)//2]
left,right = [], []
data.remove(mid)
for num in data:
if num >= mid:
right.append(num)
else:
left.append(num)
return quick... |
cdfef90cf30fda2f9367ec46eff0e5eb48070d36 | 838b991cdeb30cedfdea5a6b30655b4951accbcf | Dany503/SeminarioPython | /script4.py | Python | py | 637 | permissive | # -*- coding: utf-8 -*-
"""
Seminario Python
Script 4
Este script sirve de introducción a los bucles while en Python
y otros sentencias útiles para bucles en general
@author: D. G. Reina
"""
#%%
i = 0
while i < 4:
print i
i = i + 1
#%%
for i in range(0,4):
if i == 2:
con... |
62000febac7d4ae38916f4c719055ec3e66f298c | f98424045b8c2db0551d7ad9e0d19eaa6766197b | takky1154/lyricist | /venv/Scripts/easy_install-script.py | Python | py | 452 | permissive | #!D:\Documents\Programming\Python\lyricist\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|... |
a787b29e4d3a39afcf8236c042d6c333d5a36568 | ceff4eec14b2a476fadcec34497ee2a0c601e4a6 | moconnell1227/DBGroupProject | /SQLINIT/create_insert_reservations.py | Python | py | 2,264 | no_license | import csv
import datetime
reservations_path = "INN/Reservations.csv"
sql = ""
dict = {}
# process csv data into dictionary
with open(reservations_path) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
in_cols = True
# dict[<customer_name>] key is first name concatenated with last name,
#... |
620ba9c3e96a4b342348d852148b20d7052ce9db | 89b6f50422dbae4f5e43812bef0a0ee63e2f6ead | MTaylorfullStack/python_july_20 | /week_seven/groups_exam/group_pp/models.py | Python | py | 552 | no_license | from django.db import models
class User(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
email = models.CharField(max_length=255)
password = models.CharField(max_length=255)
class Organization(models.Model):
name = models.CharField(max_lengt... |
1f8eba9e8f03c6cc787a8d7afe86299ecf57621c | 9b055c68ea90ba97c7b5770df955e7980316b41e | evertacosta/pyserial-asyncio | /serial_asyncio/__init__.py | Python | py | 16,946 | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Experimental implementation of asyncio support.
#
# This file is part of pySerial. https://github.com/pyserial/pyserial-asyncio
# (C) 2015-2017 pySerial-team
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
Support asyncio with serial ports. EXPERIMENTAL
Posix platfo... |
03ea01718d07fa2a643d7b686e4dd3636e59641a | 22086770c522b9d98a6f308016f4b9737bb30934 | Hrishi5/ACI-EnhancedEndpointTracker | /Service/app/models/aci/ept/ept_manager.py | Python | py | 27,933 | permissive |
from ... utils import get_db
from ... utils import get_redis
from .. fabric import Fabric
from .. utils import terminate_process
from . common import HELLO_INTERVAL
from . common import HELLO_TIMEOUT
from . common import MANAGER_CTRL_CHANNEL
from . common import MANAGER_WORK_QUEUE
from . common import SEQUENCE_TIMEOUT... |
f2b61ce05bef7aad2e2cc943f218f63f46c006b9 | d55400a3779f4b4422e1d8ebeb53574aee179f33 | NobuyukiInoue/LeetCode | /Problems/2400_2499/2455_Average_Value_of_Even_Numbers_That_Are_Divisible_by_Three/Project_Python3/Average_Value_of_Even_Numbers_That_Are_Divisible_by_Three.py | Python | py | 1,560 | no_license | # coding: utf-8
import os
import sys
import time
from typing import List, Dict, Tuple
class Solution:
def averageValue(self, nums: List[int]) -> int:
# 85ms - 156ms
nums = [n for n in nums if not n%6]
return sum(nums)//len(nums) if nums else 0
def averageValue2(self, nums: List[int])... |
6e29d4745a285ce951c0e0375c8bb1b0782386a2 | 9a484a5645a4c44cf04156ce09960964dbaa9fd1 | teamThevibe/repository.thevibe | /Repo/plugin.video.salts/default.py | Python | py | 125,664 | no_license | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... |
0c7ac060d3e891590bc4724dc91a0ce135210855 | 84022ac5aed825ce53c0dc825a2b2efdfffa85c5 | WangGitHubWei/learn_nlp | /chapter_3/准确分词之加载自定义字典分词/test.py | Python | py | 1,467 | no_license | #! /usr/bin/env python2.7
# coding=utf-8
from jpype import *
startJVM(getDefaultJVMPath(),
"-Djava.class.path=/home/kuo/NLP/module/hanlp/hanlp-1.6.2.jar:/home/kuo/NLP/module/hanlp")
HanLP = JClass('com.hankcs.hanlp.HanLP')
# 中文分词
print(HanLP.segment('你好,欢迎在Python中调用HanLP的API'))
testCases = [
"商品和服务",
... |
2b1d52df6d57e5f0d8822b71e6fc4e5ecec59e3d | 0c3a71f13b4546f25aaca2c414a6797bab6a2149 | simright/py-fortranformat | /fortranformat/_misc.py | Python | py | 1,193 | permissive | '''
Miscellaneous functions, classes etc
'''
class has_next_iterator(object):
'''
A wrapper class for iterators so that the .has_next() method is implemented
See - http://stackoverflow.com/questions/1966591/hasnext-in-python-iterators
'''
def __init__(self, it):
self.it = iter(it)
self._... |
ab0da6c632f085333cb0e14bc5f2b33fe084d940 | 919360b8fd38c7eb4a7805f90ea8af1f1d25a10d | kunalbhangare17/One-to-One-relationship | /2021pcs1012_Lab_1_One to One.py | Python | py | 492 | no_license | file = open("test1OOM.txt", "r")
total_number_of_elements = int(input())
lst = []
total = []
r = []
s = []
k = []
for i in range(1, total_number_of_elements + 1):
input_1 = int(input())
input_total = (i, input_1)
if i == input_1:
r.append(input_total)
lst.append(input_total)
k = [t[::-1] for ... |
4261ecea3897b394df6b67ab3af74e55bf2a75e2 | bbf47e98bf0a79bc9959262989006be2a46e4ce8 | afoukal/python-selenium-automation | /pages/product_page.py | Python | py | 1,151 | no_license | from selenium.webdriver.common import actions
from selenium.webdriver.common.by import By
from pages.base_page import Page
class Product(Page):
ADD_TO_CART = (By.ID, "add-to-cart-button")
SIZE_SELECTION_TOOLTIP = (By.ID, 'a-popover-content-1')
NEW_ARRIVAL_BUTTON = (By.XPATH, "//span[contains(text(),'New ... |
d833b37c8d12cd8af24e3c20fbf91b620cbd94dc | 5a23d016b0961858a0c7e6c412f3397b67be60c5 | DataDog/integrations-core | /oracle/tests/conftest.py | Python | py | 5,879 | permissive | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.dev import WaitFor, docker_run, run_command
from datadog_checks.dev.conditions import CheckDockerLogs
from datadog_checks.oracle import Oracle
from .common import (
... |
018d41044b49c9b089a83de6f6afd29cef6c4341 | d42f03519ea6240538438e0c23096e4646b47e5f | Yoottana-Prapbuntarik/kms-media-backend | /ManageUser/serializers.py | Python | py | 1,700 | no_license | from rest_framework import serializers
# from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from .models import User
class Test(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ('name',)
# User Serializer
class UserSerializer(... |
4a759ac6734d4319ea069bc058a98dd1f50dd247 | e4a3de8b0b1476a9f7da479ef44bcf95f1cde2cd | SuperGuy10/LeetCode_Practice | /Python/950. Reveal Cards In Increasing Order.py | Python | py | 2,446 | no_license | '''
In a deck of cards, every card has a unique integer. You can order the deck in any order you want.
Initially, all the cards start face down (unrevealed) in one deck.
Now, you do the following steps repeatedly, until all cards are revealed:
Take the top card of the deck, reveal it, and take it out of the deck.
If t... |
42739b2ef2137241da7fe9845e913dfea3f739bb | 30a1a1125fe2bebb08a806a1b12ed1052e742ae8 | Sajidam94/Personal-Portfolio | /portfolio/settings/production.py | Python | py | 691 | no_license | from .base import *
DEBUG = True
ALLOWED_HOSTS = ['sajidabdullah.herokuapp.com']
AUTH_PASSWORD_VALIDATORS = [
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
{'NAME': 'django.contrib.auth.pass... |
397387e8a9b89f2e2da41ad8e285acce077649ab | 4c6a0fab907f6a11a42976034212860a207338d1 | Colaplusice/algorithm_and_data_structure | /技巧总结/O(n)找出数组重复元素.py | Python | py | 497 | no_license | # 数组里数字的范围保证在0 ~ n-1 之间
def de_duplicate(nums):
length = len(nums)
for i in range(length):
# 在数组中的标记位
index = nums[i]
if index > length:
index -= length
# index 放的是数的value值
if nums[index] > length:
return index
# 标记位加上一个长度
nums[i... |
9c1e5c1a5b9774fa8d5235eb5e59d89e4c325730 | dc55f09761825877feb4f7c31a24762676523b57 | andrey1908/dataset_scripts | /count_coco_annotation_field_values_number.py | Python | py | 1,261 | no_license | import argparse
import json
def build_parser():
parser = argparse.ArgumentParser()
parser.add_argument('-json', '--json-file', required=True, type=str)
parser.add_argument('-f', '--field', required=True, type=str)
return parser
def count_coco_annotation_field_values_number(annotations, field):
f... |
c460962f827c4f94006c5c46b56e3108d84e5ff8 | d4e976ed38c99f38d746de4addc8d0bf9f64879f | Code-Institute-Submissions/Django-Issue-Tracker-3 | /accounts/forms.py | Python | py | 1,631 | no_license | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from django.core.exceptions import ValidationError
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
# https://simpleisbetterthancomplex.com/tutorial/2018/08/13/ho... |
d128dbafe5945f0f105d82ffac5623466451e142 | b5ae6c5295d43b4cfa12607140902cdee9b85fe0 | KEVINWANGXIANG/Machine_Learning | /CH14-SVD简化数据/svdRec.py | Python | py | 5,771 | no_license | from numpy import *
# U, Sigma, VT = linalg.svd([[1, 1], [7, 7]])
# # print(U)
# # print(Sigma)
# print(VT)
def loadExData():
return [[1, 1, 1, 0, 0],
[2, 2, 2, 0, 0],
[1, 1, 1, 0, 0],
[5, 5, 5, 0, 0],
[1, 1, 0, 2, 2],
[0, 0, 0, 3, 3],
[0, 0,... |
7767de985e7e1fbc29331204a14d9b8b51fca72b | 5049ed09c542bfd86777b101b449b96453986f4b | rhiever/webstep-sklearn-quickstart-2019 | /notebooks/solutions/16A_avg_per_class_acc.py | Python | py | 528 | permissive | def accuracy(true, pred):
return (true == pred).sum() / float(true.shape[0])
def macro(true, pred):
scores = []
for l in np.unique(true):
scores.append(accuracy(np.where(true != l, 1, 0),
np.where(pred != l, 1, 0)))
return float(sum(scores)) / float(len(scores))
... |
7d1da388bdb5715a53dfdcf11ebc6617ee887666 | 6c12bed1f77e6f64c8169f9c7144e572e60b2817 | Udit107710/zulip | /zilencer/management/commands/add_mock_conversation.py | Python | py | 5,894 | permissive | from typing import Any, Dict, List
from django.core.management.base import BaseCommand
from zerver.lib.actions import bulk_add_subscriptions, do_add_reaction, \
do_change_avatar_fields, do_create_user, do_send_messages, ensure_stream, \
internal_prep_stream_message
from zerver.lib.emoji import emoji_name_to_e... |
942299498b18b60793c2823a28949438ba0db0d9 | ad049973b8685748ff24bf5d67e7be8b2569f143 | ErickRojas19/ParcialIntroduccion | /build/scripts-3.7/calculadora.py | Python | py | 3,167 | no_license | import math
menu = 0
while menu != ("9"):
print("Bienvenido a la calculadora de el tiche diego sentada :'v : ")
print("\t1 - Decimal a Binario.")
print("\t2 - Decimal a binario usando diferentes bases.")
print("\t3 - Octal a binario.")
print("\t4 - Hexadecimal a binario.")
print("\t9 -... |
ac691b2d1f9e5408b17a1b842a19e1a0f70c9978 | 033cb8d2783a6694f3a232746e6f818392c972a4 | tachiefab/codewithtm | /codewithtm/tasks/task.py | Python | py | 880 | no_license | from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from notifications.signals import notify
from posts.models import Post
from profiles.models import Profile
from django.shortcuts import get_object_or_404
User = get_user_model()
def do_notifications(target_id, v... |
1c4914ec6e52f1341bf7b0db4838e3ca14c6d05f | 34ddc74effe2216f1642074ef2d267c698f8c6eb | SimonGideon/Hands_out_fun | /Django_1/source/Products/urls.py | Python | py | 1,083 | no_license | """Products 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-base... |
3f0daf25dcc24954d6e2b73fbc97f0c97691675e | 2e47ca888c30fdcd1f80655854ef19336b87a84a | gboned/DjangoGirls | /blog/views.py | Python | py | 487 | no_license | from django.shortcuts import render
from django.utils import timezone
from .models import Post
from django.shortcuts import render, get_object_or_404
# Create your views here.
def post_list(request):
posts = Post.objects.filter(publish_date__lte=timezone.now()).order_by()
return render(request, 'blog/post_list... |
fe4c6ed2fb5fb73839c6d07d2200f9833a984b67 | ef1838a3b2a0e8851289b5252427069695836593 | Miinky-adServer/gym-adserver | /tests/env/test_adserver.py | Python | py | 1,350 | permissive | import unittest
import pytest
import gym
from gym import envs
import gym_adserver
from gym_adserver.envs.ad import Ad
from gym_adserver.envs.adserver import AdServerEnv
def test_environment_reset():
# Arrange
env = envs.make('AdServer-v0', num_ads=2, time_series_frequency=10)
# Act
(ads, impression... |
a4e4d7527b45cc97e6ac2388dfdac427b2ee114e | 540a36c51a60cffd123989de5732799616627397 | harry-gibson/modis-acquisition | /acquisition/get_modis-1.3.0/get_modis.py | Python | py | 9,314 | no_license | #!/usr/bin/env python
"""
SYNOPSIS
./get_modis.py [-h,--help] [--verbose, -v] [--platform=PLATFORM, -s PLATFORM] [--proxy=PROXY -p PROXY]\
[--product=PRODUCT, -p PRODUCT] [--tile=TILE, -t TILE] [--year=YEAR, -y YEAR] \
[--output=DIR_OUT, -o DIR_OUT] [--begin=DOY_START, -b DOY_START] [--end=DOY_END, -e DOY... |
d583fc1341af525bc17fe1f1775563c8acd4b06d | 28a50085dc27d2f8bd3bbbac69dc2215482a014e | igooralm192/lzw-compressor | /descompressor.py | Python | py | 5,015 | no_license | from helper import notFullByte, fullByte, toInt, binToByte, toByte, byteToBin
import textwrap
def decoding(filename: str):
file = open(filename, "rb")
result = open(filename.split('.')[0], "wb")
# Resgata os parametros descritos no relatório com os 4 primeiros bytes do .cmp
config_byte_1 = byteToBin(f... |
f1b45475a5bf3de731eca87599973bf7809240dd | c3da7ecd541fc705a7956569115274bbf4837150 | WatsonWoo/treeio | /settings.py | Python | py | 24,708 | permissive | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
# coding=utf-8
"""
Django settings for treeio project.
"""
from os import path
# assuming settings are in the same dir as source
PROJECT_ROOT = path.abspath(path.dirname(__file__))
import os
DEBUG = (True... |
e270ece909cfc58110d70df4c81be9052290b5c1 | f2e6143ec797a6cd4be6d3af5c90e19e35335d98 | leslieam/stt-comparison | /scripts/stt_wit.py | Python | py | 1,739 | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Speech to text using wit.ai Speech-to-Text API.
Example usage:
python stt_wit.py /path/to/audio/sample.wav
Notes:
- Default sampling rate is 16 kHz
- Language must be predefined in the user-interface
- There isn't a lot of detail regarding the desired audio for... |
5260d7ff1f055239343f1c931c0b9a46db2defe0 | c5452c61c8f1a1b22c9763134fc28c0dbbc9ad54 | vyzion-development/Ahia_3 | /marketing/forms.py | Python | py | 364 | no_license |
from django import forms
from .models import Signup
class EmailSignupForm(forms.ModelForm):
email = forms.EmailField(widget=forms.TextInput(attrs={
"type": "email",
"name": "email",
"id": "email",
"placeholder": "Type your email address",
}), label="")
class Meta:
... |
edb0a38719b15343ba9a165af03572b56ba966fd | 233454be38ff99bbe52fa3cc641da0c1c2e6d98b | libcthorne/django-tables2 | /tests/test_templatetags.py | Python | py | 12,459 | permissive | # coding: utf-8
from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.core.paginator import Paginator
from django.template import Context, RequestContext, Template, TemplateSyntaxError
from django.test import SimpleTestCase, TestCase, override_settings
from django.... |
b8e5f1dd37cc398e780c6254d71886142fff89cc | 001519031299b5442295f6c71d1aeb69a08bafab | brydenfogelman/nwHacks | /tessel-code/python/tweetSnap-tesselV2.py | Python | py | 1,638 | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import tweepy, time, sys
picture = str(sys.argv[1])
#enter the corresponding information from your Twitter application:
CONSUMER_KEY = 'HeAUdQaZ1dnSoJJguRmUHu0Uz'#keep the quotes, replace this with your consumer key
CONSUM... |
1d3853e9475152325d37d2c3d00ebe6f58ea734c | 6aa4663fc70fc93d09130ba168f785d959bf0bcb | the-graytest/CatalogScanner | /reactions.py | Python | py | 5,143 | permissive | from common import ScanMode, ScanResult
import cv2
import itertools
import functools
import json
import numpy
import os
from typing import List
# The expected color for the reactions background.
BG_COLOR = numpy.array([255, 224, 245])
# The color of the middle dot on empty icons.
SELECT_COLOR = numpy.array([169, 18... |
b2965ec1f4cf9270683bcdc3233a29fa33b7e5ab | ec8be54c089d2f66d0f4f926e5ad2d51af523606 | bkhoward/aciDOM | /venv/Lib/site-packages/cobra/modelimpl/copp/ospfallowhist1d.py | Python | py | 31,584 | no_license | # coding=UTF-8
# **********************************************************************
# Copyright (c) 2013-2020 Cisco Systems, Inc. All rights reserved
# written by zen warriors, do not modify!
# **********************************************************************
from cobra.mit.meta import ClassMeta
from cobra.m... |
5754f08979039b15d25bddf42d580b91e0d157b7 | 9c3a47fcfdf1de2d17864b98070adf7e5034b4e7 | zhanghao1989718/baizhu | /yingxiaoluodiye/moudle_5/common/warning.py | Python | py | 1,045 | no_license | # _*_ coding:utf-8 _*_
import requests
import json
# 百助测试部门token
# https://oapi.dingtalk.com/robot/send?access_token=273e79e103fd6d5705fcb6a6282df47640efdd047457dfc56a00ba620cd2c1d9
# 测试用
# https://oapi.dingtalk.com/robot/send?access_token=80755986d0bc927e5e4b8b6c26ccf3d3e2d6782d7672aef800127bf01699a184
def message(a)... |
a0a3e770c985ab651f459f69f64a81a2c1be39e8 | 3a76373e213a04a0155e8b84e76a32d33469cc03 | AntiJoe/SonosPy | /venv/mySocoTest.py | Python | py | 2,904 | no_license | import soco
import time
import sqlite3
# from soco.discovery import by_name
test_uri = 'x-sonosapi-hls:live%3a9418?sid=49&flags=8480&sn=2'
my_sonos = \
[
{"name": "Kitchen", "ip": "192.168.2.130"},
{"name": "Patio", "ip": "192.168.2.135"},
{"name": "Shop", "ip": "192.168.2.132"},
{... |
8777466e88fd3e2ef7acf2e36497d9d952f36fba | 0925d478dcaafa525bc3be018086dd762391f8ad | ashiquebiniqbal/Smart-Queuing-System | /person_detect.py | Python | py | 6,447 | no_license |
import numpy as np
import time
from openvino.inference_engine import IENetwork, IECore
import os
import cv2
import argparse
import sys
class Queue:
'''
Class for dealing with queues
'''
def __init__(self):
self.queues=[]
def add_queue(self, points):
self.queues.append(points)
... |
3ca1d956fc193a471c533a1a49df9b6c4f897862 | 38166b32fa63279e53916ed97a107da67a1b60b6 | patilvicky104/Online_Compiler | /main_compiler/views.py | Python | py | 1,404 | no_license | from django.shortcuts import render, redirect
import sys
from main_compiler.models import Savedata
# Create your views here.
def index(request):
return render(request, 'index.html',)
def runcode(request):
if request.method == "POST":
codeareadata = request.POST['codearea']
try:
... |
56668a3a25ee7b3a74869defaf4379813967914f | 14266bd0a894f0ad23a4354398bd315144464a95 | jackli-gatik/improving_vio | /compare_feature_tracking.py | Python | py | 12,542 | no_license | from __future__ import absolute_import, division, print_function
from copy import deepcopy
# from model_pwcnet import ModelPWCNet, _DEFAULT_PWCNET_TEST_OPTIONS
from tfoptflow.tfoptflow.model_pwcnet import ModelPWCNet, _DEFAULT_PWCNET_TEST_OPTIONS
import skimage.io
import cv2
import matplotlib.pyplot as plt
import numpy... |
d6b5397990e198fc5dc57feff9c8cec7a359e645 | 01baa22d1f809adbb78b2c94aa944506adee3b2d | LichenZeng/MTCNN_LieV | /gen_simple.py | Python | py | 1,906 | no_license | import numpy as np
import utils
from PIL import Image
import os
import time
import matplotlib.pyplot as plt
LABEL_FILE_PATH = r"img_celeba_4dbg/list_bbox_celeba.txt"
IMAGE_PATH = r"img_celeba_4dbg"
def gen_simple(size):
plt.ion()
for i, line in enumerate(open(LABEL_FILE_PATH)):
if i > 1:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.