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 |
|---|---|---|---|---|---|---|---|---|
a2b6ebe6a16b6259e7c9a89be600d26950aee88f | 9688fd1c4b047bf79fa9473f288ade546464157a | oaarscorp/cmepy | /cmepy/lexarrayset.py | Python | py | 7,960 | no_license | """
lexical array set operations
these operations are based upon the one dimensional array set operations
from numpy.lib.arraysetops, but generalised to work for sets of m-tuples,
where each element is stored as a row of a 2d m by n array, using numpy's
'lexsort' lexical sorting function.
"""
import numpy
def unique... |
8b4ffe936ddd44fb77e50358216d8bab6fe3308c | 089f0c09cc61ce68aaa4848f32e4970ca9f540d7 | acesadaf/fat-wallet-back | /backend/migrations/0002_auto_20200702_1810.py | Python | py | 1,336 | no_license | # Generated by Django 3.0.7 on 2020-07-02 23:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='expense',
... |
5df1d66cc02cd31fdd07f357da3093b1a85df6bb | 5fc3db2ffc856f5870ff5212b7e9547f7c3e382f | UBC-MOAD/pa-th-simple | /prelim-model/make_readme.py | Python | py | 2,942 | permissive | """CCAR-Modeling IPython Notebook collection README generator
Copyright 2014 The CCAR-Modeling Project Contributors
and their respective institutions: The University of Alberta,
The University of British Columbia,
and Fisheries and Oceans Canada.
Licensed under the Apache License, Version 2.0 (the "License");
you ma... |
2ceb242e3cf292ae9f51e129fb2b32f7fe12f47b | 56ec38cade04c890871281c6b40af20d9354dff0 | icoz/photo-archive-sorter | /config.py | Python | py | 505 | no_license | #!/usr/bin/env python3
# coding: utf8
import sys
import os
DEBUG = True
ENV = "devel"
# database settings
DATABASE_URI = "mongodb://localhost:27017"
DATABASE_NAME = "phas_test"
# datetime format for search form
DATETIME_FORMAT = '%d.%m.%Y %H:%M:%S'
# log file
# if sys.platform == 'win32':
# basedir = os.path.a... |
344fb459234365806a5265963397eb67bec08761 | 8ad2bbf982fa3e96e8f569448460606d8ad037a5 | U-Divya/loginpage | /loginpage/urls.py | Python | py | 817 | no_license | """loginpage URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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-... |
679c59dba2d98b812c10f5c4c94ac099c7e81f03 | ab53c31ba51f125f5cea09af151b2d44bdfe2930 | benhayes21/OasisLMF | /oasislmf/utils/deterministic_loss.py | Python | py | 5,988 | permissive |
__all__ = [
'generate_deterministic_losses'
]
import io
import json
import logging
import os
import re
from collections import OrderedDict
from itertools import product
try:
from json import JSONDecodeError
except ImportError:
from builtins import ValueError as JSONDecodeError
from subprocess import (
... |
2007bc45991b28654f90217e388d3022689617c8 | 7eb1686e1386bc591a03d8b8383d554d239341e4 | YimingShao/100DaysChallenge | /day40-42/day3/movie_api.py | Python | py | 638 | no_license | import requests
from collections import namedtuple
MovieResult = namedtuple(
'MovieResult',
'imdb_code, title, duration, director, year, rating, imdb_score, keywords,'
'genres'
)
def find_movies(search):
if not search or not search.strip():
raise ValueError('Search text is required.')
ur... |
289645b068e8e9ce4409ab7a364fb63da20905d0 | 91a713ecb0b9b4e51aad7e9c21d6e10b1c92116a | davidespihernandez/game-store | /gamestore/gamestore/urls.py | Python | py | 751 | no_license | """gamestore URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.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-bas... |
5cbf059c8a9161891ca8e9a4f2c10291936c90b9 | cf8b48d29a458ba9c90194e80dc8d5a89ed61675 | alexlyss/udacity_rep | /AIProgrammingWithPythonNanodegre/FinalProject/predict.py | Python | py | 1,823 | permissive | # PURPOSE: Program loads pretrained model for image classification
# and uses it as classifier for flower species. Flower labels are taken from
# JSON file according to train dataset
# Input parameters:
# - path to image
# - path to pretr... |
b5688f6ecebb74343b2cb94b727be83796b735a9 | 3d3ed77e356d84260a1f0922bdf465538656409c | NeonKirill/neon_audio | /neon_audio/__init__.py | Python | py | 2,997 | permissive | # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2021 Neongecko.com Inc.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# followin... |
5dbb67102db75a5a57e3ed60b6789aa872ebdbb0 | 08102a4073011608014422fe7326aec25450575c | yank07/WPM | /solicitudCambio/tests/test_listar_solicitudes.py | Python | py | 972 | no_license | from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from django.contrib.auth.models import User
from proyecto.models import Proyecto
__author__ = 'ccaballero'
class TestListarSolicitudes(TestCase):
"""
Clase de test para la vista solicitudCambio.views.listar_solicitudes
... |
214ab40d1815988e5f6eb31d3757c7c70e219f15 | 726e34880c441b98f1dd06d274d5c5072b5e2a18 | hojihun5516/object-detection-level2-cv-02 | /template/mmdetection/mmdet/models/backbones/resnext.py | Python | py | 5,314 | permissive | # Copyright (c) OpenMMLab. All rights reserved.
import math
from mmcv.cnn import build_conv_layer, build_norm_layer
from ..builder import BACKBONES
from ..utils import ResLayer
from .resnet import Bottleneck as _Bottleneck
from .resnet import ResNet
class Bottleneck(_Bottleneck):
expansion = 4
def __init__... |
87a752004afee34da0a2c7af3b9f4b3367135ac2 | 8ac1f896077f16228d8084c1449d7a2ae392386f | cms-sw/cmssw | /DQMOffline/Trigger/python/EgHLTOffTrigSelection_cfi.py | Python | py | 22,556 | permissive | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.EgHLTOffEleSelection_cfi import *
from DQMOffline.Trigger.EgHLTOffPhoSelection_cfi import *
egHLTOffBaseEleTrigCuts = cms.PSet (
trigName = cms.string("default"),
barrel = cms.PSet(egHLTOffEleBarrelCuts),
endcap = cms.PSet(e... |
ab37d1d21deb39e7c83e727fb66c78b1fd64b149 | 45adb97324a3679954d08d94811083e6e22a2e82 | simplynaive/Grokking-Algorithms | /4.1.py | Python | py | 414 | no_license |
# Recursively add up an array
class Solution(object):
def sum(self, nums):
"""
:type x: int
:rtype: int
"""
if not nums:
return 0
if len(nums) == 1:
return nums[0]
else:
return nums[0] + self.sum(nums[1:])
def main():
... |
8b7d8e213eb409b89eff9b5540c5cf1ef258838f | 34264bdc01a5b93cc3f92cdad3ec5d76b0194883 | peinan/fairseq | /fairseq/tasks/fairseq_task.py | Python | py | 22,503 | permissive | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import warnings
from argparse import Namespace
from typing import List
import torch
from fairseq import metrics, sea... |
4a34e9546d8cc1932ba6559767fbe570e4810906 | 0e2f701b87909214ba5ab4c1a64f6997382c21ec | jithesh944/Tubers_webapp | /tubers/youtubers/models.py | Python | py | 1,499 | no_license | from django.db import models
from datetime import datetime
from ckeditor.fields import RichTextField
# Create your models here.
class Youtuber(models.Model):
crew_choices = (
('solo', 'solo'),
('small', 'small'),
('large', 'large'),
)
camera_choices = (
('canon', 'canon')... |
505bf39d2d0e4f2cdc009f0117085fa7bfd2e7b6 | b92f3f3806ced17eaec8b97539bd285268c2ebb9 | ethanbahmanyari0122/scooteq | /venv/lib/python3.8/site-packages/setuptools/_vendor/more_itertools/more.py | Python | py | 117,984 | no_license | import warnings
from collections import Counter, defaultdict, deque, abc
from collections.abc import Sequence
from concurrent.futures import ThreadPoolExecutor
from functools import partial, reduce, wraps
from heapq import merge, heapify, heapreplace, heappop
from itertools import (
chain,
compress,
count,... |
98328ac8396fefc3e2d42aee7de5d70cfc51300b | 7d8429a70ba8a10d3683e6e6d680da897f17f27f | hatchetjackk/artemis | /cogs/events.py | Python | py | 30,335 | permissive | """ All times in events are handled as UTC and then converted to set zone times for local reference """
import asyncio
import typing
import discord
import pytz
import random
from artemis import load_db
from collections import OrderedDict
from discord.ext import commands
from discord.ext.commands import BucketType, Com... |
52e6d57f2f05db6854827bc6b5c743d5a956abd9 | 77dbab03f969ec2b35fa8ef06c51fc113654bb76 | enterstudio/forseti-security | /google/cloud/security/common/gcp_api/errors.py | Python | py | 749 | permissive | # Copyright 2017 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 agreed to in writing, s... |
7e18d8f815acc5bb335f8073369ea3dd96a31b24 | a1518df38bf93b14d7964c8d48e9dd958a93a55b | chandraharsha4807/PYTHON--CODING-PROBLEMS | /PATTERNS-ALL-TYPE/NUMBER-TRIANGLE-PATTERN.py | Python | py | 210 | no_license | n = int(input())
for i in range(n):
for j in range(n-i): # for j in range(i+1)
print(j+1, end = " ")
print()
'''
5
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
'''
'''
5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
''' |
1dca3113c28964f437f4d9f6393cd4cb403b7241 | c860b490ed37ad3c05d5f6f5bca97966192bd222 | xcode2010/chord_recognizer | /network.py | Python | py | 4,271 | no_license | import numpy as np
import tensorflow as tf
import time, sys, config
class Network(object):
"""Neural Network for Chord Recognition"""
def __init__(self, model_dest=None, lr=0.001, l1_reg=0.00005, momentum=0.95, dropout_rate=0.3):
self.lr = lr
self.chords = config.chords
self.model_dest = model_dest
self.live... |
57e7c109f2d29e7c167d7abb662eb8d3ef4714f9 | b3b2d119ac7d0c7f16cc88f9444c649703fd933b | paultaiton/azure-sdk-for-python | /sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_available_delegations_operations.py | Python | py | 5,279 | permissive | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
3a1179dfce484897e7b3d6bb9133e3089c8bd80d | 3f222824ad635e6354719f2886b56264b57e988f | pvenkat998/Flask | /psforms.py | Python | py | 1,011 | no_license | from wtforms import Form, StringField, SelectField,TextAreaField,FieldList,FormField
from wtforms.fields.html5 import DateField
from wtforms.widgets import TextArea
from wtforms import widgets
from wtforms.validators import InputRequired,Optional,Length,DataRequired,ValidationError
from datetime import date
class poin... |
478c6113ed92504ad435c04afd30408a621e7e89 | edc468ea7ded5a1b387c52b255068776257b7adf | leeeejunnnn/FittingroomAnywhere | /Segmentation/Mask_RCNN/samples/Tshirt/Tshirt_v5.py | Python | py | 10,889 | permissive | """
Mask R-CNN
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
------------------------------------------------------------
Modified by Seoyoon Park
------------------------------------------------------------
"""
import os
import sys
import json
i... |
a8e029a6cbb351aba9aab235fc02dca7a747f285 | c76027528cf6eead97bef65bb0cb850274269cae | dsy199610/Undergrad-ML-project | /regression_cross.py | Python | py | 4,860 | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 26 17:55:19 2018
@author: Administrator
"""
from regression_all import regression_all
from regression_all_net import regression_all_net
from regression_all_linear import regression_all_linear
from regression_all_svm_poly import regression_all_svm_poly
from regre... |
6af52bf058452543d33644645255857588e6d8cc | 20288c787206283b6032ce088378c9e8d291c306 | JuneKyu/torch-multi-class-deepsvdd | /src/datasets/mnist.py | Python | py | 4,079 | no_license | from torch.utils.data import Subset
from PIL import Image
from torchvision.datasets import MNIST
from base.torchvision_dataset import TorchvisionDataset
from .preprocessing import get_target_label_idx, global_contrast_normalization
import torchvision.transforms as transforms
import pdb
class MNIST_Dataset(Torchvisi... |
edc56117d6873f23d318c31b746b9c035cea8c19 | d101b8cde3b1251547f43a8b9ca5b0b7fb2f98ec | RayDragon/resume-sorter | /word_count.py | Python | py | 476 | no_license | import re
def w_count(text, word_list=[]):
words = re.findall(r"[\w']+", text)
# print(words)
d = {}
for x in words:
if x in words:
if x in d:
d[x] += 1
else:
d[x] = 1
df = {}
mx = len(word_list) + 1
sc = 0
for x in word_l... |
fd20b2e323e151c46689d092f124308e41dd1c77 | f290c4a64e783db55b34062262981cf54acdf3ae | mcszymist/IAIDSWebsite | /IAIDSWebsite/orgAdminPanel/migrations/0005_auto_20190416_1705.py | Python | py | 975 | no_license | # Generated by Django 2.1.7 on 2019-04-17 01:05
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orgAdminPanel', '0004_auto_20190414_0905'),
]
operations = [
migrations.AlterField(
model_name='event',
... |
1c69023feb548047560f0bf899489c9e1b794841 | b27451cc49916cd0c5bf4098008109aad8a149a8 | daanishrasheed/Intro-Python-II | /src/adv.py | Python | py | 2,689 | no_license | from room import Room
from player import Players
# Declare all the rooms
room = {
'outside': Room("Outside Cave Entrance",
"North of you, the cave mount beckons"),
'foyer': Room("Foyer", """Dim light filters in from the south. Dusty
passages run north and east."""),
'overlook': ... |
066a66484b7638bba06c785876564ca30c1dc352 | 890c1a02366be9fd71e36b90084c7dbd624eb2c0 | nclopezo/PRBot | /github/Tag.py | Python | py | 4,098 | no_license | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
a1a8a5b5e9fcfa8c51455db127d3e006b4616f21 | ec17af993a2b3909d4be16d5c2ddb6301b6bed64 | MKC-testcase/MKC--py-SQL | /test_repeat.py | Python | py | 235 | no_license | import os
import git
import subprocess #this one is optional for method 1 in case git library is changed
import time
import sys
while True:
print(time.localtime())
time.sleep(15)
#line below should rerun the script
|
53d148adf37ee586bcd90b5b878cc6854456636a | 82869a0645fd031af7470b7f11732e9a71ee2a91 | enterpriseih/hyperplane-google-winter-camp | /background_transfer/models/autoencoder_vgg19/vgg19_5/vgg_normalised_conv5_1.py | Python | py | 2,076 | no_license |
import torch
import torch.nn as nn
from functools import reduce
from torch.autograd import Variable
class LambdaBase(nn.Sequential):
def __init__(self, fn, *args):
super(LambdaBase, self).__init__(*args)
self.lambda_func = fn
def forward_prepare(self, input):
output = []
for ... |
d85f890eb2f5fc83c779086aa665f856a2be50af | e7f1dbc3ab3db82df0f043c837ed515aed4fbdcb | High-Tech-Team/Jasper | /client/modules/MPDControl.py | Python | py | 12,741 | permissive | # -*- coding: utf-8-*-
import re
import logging
import difflib
import mpd
from client.mic import Mic
# Standard module stuff
WORDS = ["SPOTIFY"]
def handle(text, mic, profile):
"""
Responds to user-input, typically speech text, by telling a joke.
Arguments:
text -- user-input, typically transcri... |
33bedea53bce697f89eb32cf62b6c04fec4c2a49 | d6be7d2278907a50efaec61c84afa1d2e2c2e3a5 | mimipeshy/pramp-solutions | /code/busiest_time_in_mall.py | Python | py | 1,861 | no_license | """
Busiest Time in The Mall
The Westfield Mall management is trying to figure out what the busiest moment at the mall was last year.
You’re given data extracted from the mall’s door detectors. Each data point is represented as an integer array whose size is 3.
The values at indices 0, 1 and 2 are the timestamp, the... |
08790d6609703452770409291b07257aa227340d | 23e3803f80465c8369e64d74b0cf497ed1025f94 | crhowell/django-tenant-users | /tenant_users/tenants/models.py | Python | py | 13,085 | permissive | import time
from django.db import models
from django.db import connection
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
Permission, Group
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.conf import settings
from djan... |
0ba5e97de40238261f3dafc656563d2ae5915e44 | f88aa887db98b90dc36b65184da5cc87247f85fe | SoonerRobotics/nrc_software | /trajectory_gen/segment.py | Python | py | 686 | permissive |
from math import cos, sin, radians
class Segment:
def __init__(self, x0 = None, y0 = None, xf = None, yf = None, hdg = None):
self.x0 = x0
self.xf = xf
self.y0 = y0
self.yf = yf
self.hdg = hdg
def set_start(self, x0, y0):
self.x0 = x0
self.y0 = y0
... |
112220a5ff4fb8615c3f5ba71dc7d0815d4ea935 | e69e6bd8dbd60b5b6d8b3b383919c3f682c3cc7d | weingrill/SOCS | /src/m48/m48.py | Python | py | 19,948 | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on May 8, 2013
@author: Joerg Weingrill <jweingrill@aip.de>
Data reduction Class for M48 observation
'''
import config
import logging
from m48star import M48Star
import pylab as plt
import numpy as np
logging.basicConfig(filename=config.projectpath+'... |
470ca10cab2823e732b3162d11d5cfdc4cf021d8 | 6299fc77cafaf57ca607b7f95a542cf485941c28 | vitor177/CalculoNumerico | /Newton.py | Python | py | 345 | no_license | import math
f = lambda x: math.pow(x,3)-1.7*math.pow(x,2)- 12.78*x -10.08 # funcao f
d_fun = lambda x: (f(x+1e-5)-f(x))/1e-5 # calculando derivada de f
x = 4 # Chute inicial
iteracoes = 5 # quantidade de iteracoes ate convergir
for i in range(iteracoes):
x = x - f(x)/(d_fun(x)) # iteração pelo método de newton
... |
4385ea4df6a6c7076cceffb14fda12757b30c7d2 | df035f59feee3f122883add581a5f676c1da1a10 | Wisara8/python-scribbling | /movie-viewer/app.py | Python | py | 1,876 | no_license | import datetime
import database
menu = """Please select one of the following options:
1) Add new movie.
2) View upcoming movies.
3) View all movies
4) Watch a movie
5) View watched movies.
6) Exit.
Your selection: """
welcome = "Welcome to the watchlist app!"
print(welcome)
database.create_tables()
def prompt_add_... |
0e941156108583e4938bc7b5ae139dc95309de77 | 20d3837ee71b8c2f1b9d473ef51feac05c800739 | goldenberg-lab/HydroN | /read_hn.py | Python | py | 865 | no_license | import tensorflow as tf
import numpy as np
import os
import os.path
from data_utils import subj_images, read_csv, make_seq_example
BASE_PATH = '/home/yasaman/HN/HN-sample-to-start-with-otherdata-imgs'
SURG_PATH = 'Images/Pyeloplasty/'
CONS_PATH = 'Images/No Surgery/'
CLINC_PATH = 'RAW_PHN_DATA_Sample.csv'
SURG_PAT... |
aa3add77e25b3e21bf314e8297e8e545b1057200 | bc134b9ed21835c4c3821b20e48b55a98cb5f042 | conekta/conekta-python | /conekta/api/webhooks_api.py | Python | py | 47,871 | permissive | # coding: utf-8
"""
Conekta API
Conekta sdk # noqa: E501
The version of the OpenAPI document: 2.1.0
Contact: engineering@conekta.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""
import re # noqa: F401
import io
import warnings
from ... |
a9e2d8832275959c834d231a3482c26ce6cd9297 | eecdb5386d3b2c086d522c15f6cfa53efa9c3320 | Runjing-Liu120/BNPStickBreakingSensitivity | /structure/structure_vb_lib/structure_optimization_lib.py | Python | py | 6,829 | no_license | import jax
import jax.numpy as np
import numpy as onp
import paragami
from structure_vb_lib.structure_model_lib import get_kl, get_e_loglik_gene_nlk
from structure_vb_lib.posterior_quantities_lib import get_optimal_z_from_vb_dict
import bnpmodeling.bnp_optimization_lib as bnp_optim_lib
from bnpmodeling.modeling_lib... |
7057473d5b3b5633454b1db7591cda8b5e2b33f4 | 69a3ef6da102d1e8ccc9b276729e65752918c31b | www10177/SteamCardPriceCalculator | /__int__.py | Python | py | 1,121 | no_license | block_cipher = None
# add templates and static folders to a list
added_files =[
('templates/*.html', 'templates'),
('static/*.css', 'static'),
]
a = Analysis(['web.py'],
pathex=['./'],
binaries=[],
datas = added_files, # set datas = added_files list
hidd... |
f7a0ec3aa2cf72ddd0dc090ba01fde5301e2ebdd | 7478910ce86d56d651dc7811533f84eeebde8603 | Dhananjaylodhi/Twowaitsprogramsoluution | /Day7/jarvis.py | Python | py | 3,267 | no_license | import webbrowser as wb
import speech_recognition as sr
from tkinter import *
from time import ctime
import time
import os
from gtts import gTTS
import pygame
from pygame import mixer
import pyaudio
from threadpoolctl import threadpool_info
def speak(audioString):
global x
b = audioString
if len(b) == 0:
... |
bdd83eec40345b00d23c20a82f30aa9ee4b931ea | d0b24c0f945a22f5f2e1e669b507e465ae82f6ba | Eljefemasao/MarkNet-ObjectDetector | /ssd_utils.py | Python | py | 10,556 | no_license | """Some utils for SSD."""
import numpy as np
import tensorflow as tf
class BBoxUtility(object):
"""Utility class to do some stuff with bounding boxes and priors.
# Arguments
num_classes: Number of classes including background.
priors: Priors and variances, numpy tensor of shape (num_priors, ... |
e63dbc6eae2162068e565cd5f932ae74dd7359c5 | 73526b9514f349504baa348bc3816ebc35374079 | toddrme2178/pyccel | /tests/internal/scripts/openacc/ex1.py | Python | py | 334 | permissive | # coding: utf-8
from pyccel.stdlib.internal.openacc import acc_get_device_type
from pyccel.stdlib.internal.openacc import acc_get_num_devices
dev_kind = acc_get_device_type()
dev_num = acc_get_num_devices(dev_kind)
print(' number of available OpenACC devices :', dev_num)
print(' type of available OpenACC devices ... |
9079a8e835dc7b5066bbf28010b8bd626cb01099 | f3ccaa7c2f0ae951bf0b6de262e7ab89b8cd5a13 | adeoluwa-adebiyi/monorepo-store-app | /inventory/migrations/0006_product_image.py | Python | py | 382 | no_license | # Generated by Django 3.1.5 on 2021-01-29 09:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0005_auto_20210128_2350'),
]
operations = [
migrations.AddField(
model_name='product',
name='image',
... |
08d146d503fe86b6c0a9c88e8cdd7207664da16c | 3398c4cd75eea2723232ac2552236099a22ed920 | finbourne/lusid-sdk-python | /sdk/lusid/models/date_range.py | Python | py | 4,866 | permissive | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 1.0.463
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getful... |
5558f116f2ce5bd80468e4055662ae7c50ae0884 | 30146b5946746306c5ec56525be9f538eadf00b1 | artezio-kseniav/15-MAG-PMI | /cw2.py | Python | py | 2,963 | no_license | from sklearn.datasets import fetch_20newsgroups
from pprint import pprint
from sklearn.feature_extraction.text import TfidfVectorizer
import numpy as np
import nltk
from collections import defaultdict
import string
from nltk.stem.porter import PorterStemmer
newsgroups = fetch_20newsgroups(categories=['comp.... |
42539f894a4d51364b2cd6db0e22e85757cf6f68 | cf7b680c5a6e9afaaa952e98192c8d86c47d35bc | openapi-env-test/azure-sdk-for-python | /sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py | Python | py | 1,528 | permissive | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
dfe855a46b1ebe797f3a9d1026bee3ea4a027b23 | da5640f553dbfe76fb001d0d18faf1e3336555ee | soshi-matsuo/leetcode | /485_Max_Consecutive_Ones.py | Python | py | 324 | no_license | class Solution:
def findMaxConsecutiveOnes(self, nums: List[int]) -> int:
max_con = 0
con = 0
for num in nums:
if num == 1:
con += 1
if max_con < con:
max_con = con
else:
con = 0
return max_... |
9c0d7f649ab6a398e39ed64a54d7d57c84bb6170 | 27c057901eec8aa57fa84abf4152c3a8e6e66c1d | dcbmariano/simba | /simba_1.2.1/app/bin/mcontig.py | Python | py | 1,224 | permissive | #! /usr/bin/python
# Program: mContig.py
# Function: Corta scaffold em um arquivo mulfifasta
# Description:
# Author: Diego Mariano
# Version: 1
from Bio import SeqIO
import sys
# Helper
try:
p1 = sys.argv[1]
except:
print "HELP: Use 'python mcontig.py [name_file].fasta'"
sys.exit()
if p1 == "-h"... |
3f56c3de7f6602e02e17aa1a5027b970722418c9 | 5e2368d3c37d4da015469b7d2dd3d63c82f22302 | askintution/tvm-learning | /tuner_annotation/tuner/test.py | Python | py | 986 | no_license |
'''
test for sa_model_optimizer
'''
import numpy as np
# config_space = 648
# parallel_size = 128
# points = np.array(sample_ints(0, config_space, parallel_size))
# print(points)
num = 128
heap_items = [(float('-inf'), - 1 - i) for i in range(num)]
print(heap_items)
print([x[1] for x in heap_items])
scores = [-... |
7d901a5e2fc37b24301541540b2133166a75b20d | b5e573c010e3f407e533ba6392cf5c75cb851681 | felipefdsilva/sensing_bus | /flushing/manager_fog/fog_agent_new_tests.py | Python | py | 2,929 | permissive | #Author: Roberto Goncalves Pacheco
#Universidade do Estado do Rio de Janeiro
#Departamento de Eletronica e Telecomunicacoes
#Project: Sensing Bus
#Subject: Comunication between Cloud and Fog
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import SocketServer
from signal import signal, SIGPIPE, SIG_DFL
f... |
21578daea899b00a3dcfe7a72705384095cf4c44 | c9fa1dfe4945cb42f0d9746a947af4eeab821b94 | HuyaneMatsu/hata | /hata/discord/channel/permission_overwrite/tests/test__put_deny_into.py | Python | py | 712 | permissive | import vampytest
from ....permission import Permission
from ..fields import put_deny_into
def _iter_options():
yield Permission(), False, {'deny': '0'}
yield Permission(), True, {'deny': '0'}
yield Permission(1111), False, {'deny': '1111'}
yield Permission(1111), True, {'deny': '1111'}
@vampytest.... |
459507c1ed4278e828c980ad7eb3840b9fac76fc | 1868cdf121d760447375d08066cdf70d60777854 | arpit15/skill-based-exploration-drl | /HER/envs/putaoutb_withextras.py | Python | py | 3,248 | no_license | from HER.envs import grasping_withgap
import numpy as np
from gym.envs.robotics.utils import mocap_set_action
from time import sleep
class BaxterEnv(grasping_withgap.BaxterEnv):
def __init__(self, max_len=50, test = False, filename = "mjc/putaoutb.xml"):
super(BaxterEnv, self).__init__(max_len=max_l... |
88156d8ae807dff52c389e1cd35c27f304088db1 | 63603bedeb94e9325327341f2df471203b3eb0e9 | connectthefuture/psdmrepo | /psddl/tags/V00-08-06/tags/V00-08-02/src/DdlPythonInterfaces.py | Python | py | 16,221 | no_license | #--------------------------------------------------------------------------
# File and Version Information:
# $Id: DdlPythonInterfaces.py 3643 2012-05-26 04:23:12Z jbarrera@SLAC.STANFORD.EDU $
#
# Description:
# Module DdlPythonInterfaces...
#
#------------------------------------------------------------------------
... |
913f5ab9e966005feb4a95eee810e7f131a80e4b | 9366b1e463228168755d0e3f96ab20c98b2c9346 | hemant-mehra/Django_projects | /lectures_code/social_media/simplesocial/simplesocial/urls.py | Python | py | 1,243 | no_license | """simplesocial 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-... |
13f20e5b0cc5b75f6e637234c67d93f17d9c244f | 2d1f07283570e433e2fb98bbc3e14e9629bb0172 | hashimoto-hb/commcare-hq | /custom/opm/opm_reports/beneficiary.py | Python | py | 3,272 | no_license | """
Fluff calculators that pertain to specific cases/beneficiaries (mothers)
These are used in the Incentive Payment Report
"""
import re
from .constants import *
class Beneficiary(object):
"""
Constructor object for each row in the Beneficiary Payment Report
"""
# maps method name to header
meth... |
dd487b07ccb3c0f2fc6deaaa51b67e2f50d2271e | 6e25d73341155157425c4a1fd5625821f859cdc8 | fspot/werkzeug | /werkzeug/debug/console.py | Python | py | 5,721 | permissive | # -*- coding: utf-8 -*-
"""
werkzeug.debug.console
~~~~~~~~~~~~~~~~~~~~~~
Interactive console support.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD.
"""
import sys
import code
from types import CodeType
from werkzeug.utils import escape
from werkzeug.loca... |
8083c420f96b97d6a144aab8d7e7e6f7e7ac1b1a | 0ab73a09f4273233ada63be276db563473070869 | KostivAndrii/learning | /hello-world-servlet/back/export_values.py | Python | py | 610 | no_license | from __future__ import division, print_function, unicode_literals
import json
import re
import boto3
def main(stack):
cf = boto3.client('cloudformation')
r = cf.describe_stacks(StackName=stack)
stack, = r['Stacks']
outputs = stack['Outputs']
out = {}
for o in outputs:
key = _to_env... |
21e4ed3ef28197f9122611ae62fd2fa724435fff | 3679b46fea57dfe53ba9afd81109c0271f1c4737 | h-friederich/lpm | /components.py | Python | py | 22,637 | permissive | # -*- coding: utf-8 -*-
"""
Component management module for lpm
A component definition consists of (at least):
- an ID (part number)
- a descriptive name
- a description
- a category
- a list of suppliers
- a list of manufacturers
- a list of revisions consisting of:
- a description
- a list of files
- a 'rele... |
14722848a862339d0379e9f5e4c8b172a8815fb6 | 87d985cc395e2a1def1979509f8200cc5bb958dd | wangjin/unittest-api-test | /config/config_util.py | Python | py | 433 | no_license | import os
from configparser import ConfigParser
def get_options(section, key):
"""
获取指定区域的配置项key value
:param config_file_name: 配置文件名称
:param section: 需要读取的区域
:return: 对应配置
"""
file = os.path.abspath(os.path.join(os.getcwd(), '..', 'config', 'config.ini'))
cp = ConfigParser()
cp.re... |
eef8487096fbdfede0af9f40250b5d077daf9ccd | 9e83fc1a4e38392b8f5a3306c5f2121a5bfac7a4 | delirium0712/olympic_project_new | /q01_rename_columns/build.py | Python | py | 604 | no_license | # %load q01_rename_columns/build.py
# default imports
import pandas as pd
def q01_rename_columns(path):
data=pd.read_csv(path,skiprows=[0])
# data=pd.DataFrame(data)
# data=data.drop(0)
data=data.rename(columns={data.columns[0]:'Country'})
my_list=['Gold_Summer','Silver_Summer','Bronze_Summer',... |
278d08f7d19b49335e605b2fcf277cd2ae7d9a0b | 63b37bd9bdb2c13008972aa054b1d966e4164c0d | yizhikong/Toys | /sendEmail.py | Python | py | 1,410 | no_license | # -*- coding:utf-8-*-
# maybe you should open SMTP service(in your email setting) first
import smtplib
from email.mime.text import MIMEText
import os
import time
import re
def getStatus():
info = os.popen('nvidia-smi').read()
pat = re.compile('(\d+)MiB.*?\d+MiB')
used_of_gpus = pat.findall(info)... |
3e10f02ee5e7e97eb0d4d2888592bfec56c57509 | 7e5ef9936586a608dc5e461405c421467493a263 | Nishu6129/Summer_task3 | /reciver.py | Python | py | 968 | no_license | import socket
import os
import cv2
import pickle
import threading
import struct
def sendImage():
os.system('python sender.py')
t1 = threading.Thread(target=sendImage)
t1.start()
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host_ip = '192.168.43.6'
port = 9900
client_socket.connect((host_ip... |
d3c06ad8e2a8bdebfbaf4215588971c809ff7cbc | 369a217b57bf9de24fd6e630847df88653704b30 | Mattlk13/streamalert | /stream_alert_cli/terraform/cloudtrail.py | Python | py | 4,457 | permissive | """
Copyright 2017-present, Airbnb 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 agreed to in writing, sof... |
66352612dc7a8ae75f5dd3505e9bb4ec4e390202 | 225f6e5b835469f5dfc37d80bbfbba44ba998c99 | sudo-panda/ServiceX_transformer | /servicex/transformer/tests/test_object_store_manager.py | Python | py | 2,982 | permissive | # Copyright (c) 2019, IRIS-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the foll... |
329cf57e9362fbde4834b5980d9f38d411af15c3 | 15eb40a8dd2d0a2b0e3b3a2ce10020bc64bcff25 | Nijaid/JLU-python-code | /jlu/gc/gcwork/orbits.py | Python | py | 19,183 | no_license | import asciidata, pyfits
import os, sys, math
from pylab import *
from numpy import *
from jlu.gc.gcwork import starset
from jlu.gc.gcwork import objects
from jlu.gc.gcwork import util
from jlu.gc.gcwork import young
import pdb
def plotVelVsRadius():
cc = objects.Constants()
gm = cc.mass * cc.msun * cc.G
... |
3b026819a5c00ea1d4486f265ff39784df0ed746 | 8457bcdab044f7dcdc5ae535b0380dc1ca7dfd22 | miseriae/yasb_django | /blog/models.py | Python | py | 1,589 | no_license | from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
from datetime import datetime, date
from PIL import Image
class Post(models.Model):
title = models.CharField(max_length=255)
image = models.ImageField(null=True, blank=True, upload_to='post_pictures')
... |
4cfb491169c34ae42bce698a5da4e7db41a9c469 | bd237da7e5edd37bfcb7e56da91088de40b31fd1 | benkoontz/Python-Concepts | /Python-GUI-Status-Bar/first.py | Python | py | 1,205 | no_license | # status bar
from tkinter import *
def doNothing():
print("ok ok i wont")
root = Tk() # create a blank window
# ---- main menu ----
menu = Menu(root)
root.config(menu=menu)
subMenu = Menu(menu)
menu.add_cascade(label="file", menu=subMenu) # add dropdown submenu
subMenu.add_command(label="new project", comman... |
4df546365bf2ca7a3cd43d8342608233f9a795f1 | a5e2741bfbf6ebba4d6b8a50fd88742094ccb58f | lissff/velocity_dashboard | /load_entity/context_updator.py | Python | py | 2,757 | no_license | import json
import urllib2
import pandas as pd
import os
from flatten_json import flatten
from utils.graph_db import graph
class ContextUpdator(object):
def __init__(self):
self.CHECKPOINT = ['AddCC' , 'ConsolidatedFunding' , 'WithdrawalAttempt']
self.COMPUTE_UNITS_URL = 'https://ccg22riskunifiedmgm... |
3db5d1708e4442c37938b931adc1ef3629b8572e | 288784ebc461c112300b782ab53c5de809b10e97 | Music-and-Culture-Technology-Lab/omnizart | /omnizart/drum/inference.py | Python | py | 1,343 | permissive | import pretty_midi
import numpy as np
from scipy.signal import find_peaks
def get_3inst_ary(inst_13_ary_in):
inst_3_ary_out = np.zeros_like(inst_13_ary_in)[:, :3]
inst_3_ary_out[:, 0] = inst_13_ary_in[:, 0]
inst_3_ary_out[:, 1] = inst_13_ary_in[:, 1]
inst_3_ary_out[:, 2] = np.max([inst_13_ary_in[:, 4... |
f6b8291e1286f16cd86dc657fa779eccce9cd285 | 394472c825a7524de5213d16248c441f9a7ac428 | Nexosis/nexosisclient-py | /nexosisapi/client/client_error.py | Python | py | 901 | permissive | class ErrorResponse(object):
def __init__(self, body):
self._status = body.get('statusCode')
self._message = body.get('message')
self._error_type = body.get('errorType')
self._details = body.get('errorDetails')
@property
def status(self):
return self._status
@pr... |
bd070f9c50fc35293957807395a6ce3ae96124db | ccaf954abde2c570cdb117384962494e8bacc890 | intyawlrs/OnClass | /scripts/CellTypeAnnotation/CellTypeAnnotation_TMS.py | Python | py | 1,145 | no_license | import sys
from OnClass.utils import *
from OnClass.OnClassPred import OnClassPred
## read TMS FACS data
DATA_DIR = '../../../OnClass_data/'
data_file = DATA_DIR + 'raw_data/tabula-muris-senis-facs'
X, Y = read_data(filename=data_file, DATA_DIR = DATA_DIR)
## split TMS into training and test
train_X, train_Y_str, tes... |
736a31a289cafbf2d0325dac270c7706750fc990 | 4b82dba7d03ac1adc274e11c74a52acb1ad9a841 | murmour/icfpc-2016-wild-bashkort-mages | /visualizer/facets.py | Python | py | 28,434 | no_license | '''
Created on Aug 5, 2016
@author: linesprower
'''
import io, os, json
import itertools
from fractions import Fraction
from math import sqrt
from time import clock
from geom import getDistance2, getfirst
from nagibator import nagibate
kSz = 1
def transp(p, p0):
return (float(p[0] - p0[0]), float(p[1] - p0[1]... |
fb9e3ef19ae0839e358fea09c1d3e9f201f28bee | 9ff7fe3ce5624e54f934fe0a3188e2d72bda71db | lenovo-lxca-ci/ironic-xclarity-driver | /ironic/drivers/modules/deploy_utils.py | Python | py | 58,957 | permissive | # Copyright (c) 2012 NTT DOCOMO, INC.
# 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... |
663288dc46c23860e1600502730e0c885f2465aa | be467af10f54854401e49a296da8d2a2bfb6b77f | 666sempron999/Abramyan-tasks- | /For(40)/13.py | Python | py | 428 | no_license | '''
For13 ◦ . Дано целое число N (> 0). Найти значение выражения
1.1 − 1.2 + 1.3 − . . .
'''
import math as m
N = int(input("Введите N "))
while N <= 0:
N = int(input("Введите N "))
summ = 0
coef = 1.1
for i in range(1,N):
if i % 2 != 0:
summ = summ + coef
else:
summ = summ - coef
coe... |
42d4b970f3c0a61b8dbf12bcac7a3680d520f70f | b8b2d69505a3126c796f7778a2bb89f9ffd47307 | Pcamerer/School | /MIS407HW/IA02/logging.py | Python | py | 363 | no_license | from datetime import datetime
"""Helper module to log information about function calls.
Preston D Camerer 09/27/18 MIS407"""
def log_function(f, msg):
t = datetime.now()
print("{}{}{}: {}".isformat(t.isoformat(sep=' '),
f.__module__,f.__name__,msg))
def main():
if __name__ == "__main__":
... |
6a963c35cbca41225ef71c3568e355d2e429c1f1 | 5d4acf40f36ca760b2a644b5b49a2c87c5308459 | lwang94/MDD | /app_callbacks/callbacks_fit.py | Python | py | 6,985 | no_license | from dash.dependencies import Input, Output, State, MATCH
import dash_core_components as dcc
import dash_html_components as html
from dash import callback_context
import pandas as pd
import numpy as np
import app_util as au
import MDDClass as mc
import config as cf
def linear_fit_params(app):
return (
ht... |
207dc5e451dcd71b86525877f22afac3d952ca9b | 6da46090cd2694609622fbb9b1341b022f0dbee8 | FingerLeakers/DanderSpritz_docs | /Python/Core/Lib/lib2to3/fixes/fix_exitfunc.py | Python | py | 2,524 | no_license | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.10 (default, Feb 6 2017, 23:53:20)
# [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
# Embedded file name: fix_exitfunc.py
"""
Convert use of sys.exitfunc to use the atexit module.
"""
from lib2to3 import pytree, fixer_ba... |
b96d4feca4c16d9180ba2ec8d9db263ca0d1c69f | eef9797bab6d86dd220406f296311809755dfd40 | PWZER/swagger-ui-py | /examples/sanic_test.py | Python | py | 443 | permissive | import os
from sanic import Sanic, response
app = Sanic(__name__)
@app.get(r'/hello/world')
async def index_handler(request):
return response.text('Hello World!!!')
if __name__ == '__main__':
working_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(working_dir, 'conf/test.ya... |
8acf4a884bc435c8b4e651442381c8abf03578f8 | 5644924fef4e0cd73c08b05a53d0324f9c7d4108 | valveca-ai/dash-dev | /dash_spa_template/pages/page2.py | Python | py | 1,283 | no_license | import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, State, Output
import dash_bootstrap_components as dbc
from ..app import app
from ..cache import register_layout, get_layout_values, update_layout_values
# ------------------------------------------------------... |
fc862eed566476e4ea40e83242af7b174879f9fb | 1cb57ecd47e70efa689d2d1646593517110484b3 | olga121/python_training | /generator/group.py | Python | py | 995 | permissive | from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups","file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 5
f = "data/groups.json"
for o, a in opts... |
2ccc7d4aeb48b81f399a576fa6471b8fc0c6cb5c | 8416c44d8d05b73659698bc1391635322ec5d944 | ntsystemwork/cl-ntsw | /ntsw-default/models/product_template.py | Python | py | 795 | no_license | # -*- coding: utf-8 -*-
# For copyright and license notices, see __manifest__.py file in module root
from odoo import models, fields, api, _
@api.multi
class ProductTemplate(models.Model):
_inherit = 'product.template'
def fix_template(self):
for prod in self.search([]):
prod.force_curre... |
7d5be26a3b22f587cf5dd73b1e3ea092900e69f1 | 1507299680b3ccbc977acd1a5d73a8a02886d0da | tijunoi/libpurecool | /tests/test_360_eye.py | Python | py | 17,970 | permissive | import unittest
from unittest import mock
from unittest.mock import Mock
import json
from libdyson.dyson_360_eye import Dyson360Eye, NetworkDevice, \
Dyson360EyeState, Dyson360EyeMapGlobal, Dyson360EyeMapData, \
Dyson360EyeMapGrid, Dyson360EyeTelemetryData, Dyson360Goodbye
from libdyson.const import PowerMode... |
b4e9b11039926d6516da0d54ccbe075de7330c3e | f6e51b23178e9ccb678167793148cc66b88950d2 | satyan-g/vectorbt | /vectorbt/portfolio/base.py | Python | py | 145,216 | permissive | """Base class for modeling portfolio and measuring its performance.
Provides the class `vectorbt.portfolio.base.Portfolio` for modeling portfolio performance
and calculating various risk and performance metrics. It uses Numba-compiled
functions from `vectorbt.portfolio.nb` for most computations and record classes base... |
9d9f87855684b3b0810f37b2663242cb5feafc42 | b0f44e79ae1a711e554b072b4b0ff7cd6d9c2642 | VB6Hobbyst7/xl_vb2py | /vb2py/PythonCard/tools/resourceEditor/modules/propertyEditor.py | Python | py | 19,769 | permissive | #!/usr/bin/python
"""
__version__ = "$Revision: 1.56 $"
__date__ = "$Date: 2004/10/03 19:21:34 $"
"""
from PythonCard import dialog, font, model, registry, util
from PythonCard.event import ChangeListener
import resourceOutput
import time
import os
import string
import wx
# KEA this is a load of dingos' kidneys and... |
6c52e85a529a534191012eeccd54c92b1fee589c | d4bffea3a1ada2bde3e339058123549464dba584 | Devansh2005/grok | /src/grok/ftests/security/json.py | Python | py | 1,035 | permissive | """
Let's test whether require decorators work for json methods.
>>> from zope.testbrowser.wsgi import Browser
>>> browser = Browser()
We can access the public method just fine::
>>> browser.open('http://localhost/stomp')
>>> bprint(browser.contents)
{"Manfred stomped.": ""}
We cannot access the protected... |
90709c77cc17695b6fff589556beb2bc9d11b427 | 71b34d886b9da943e6546a81916875b30c2b3d41 | MaayanLab/clustergrammer-web | /clustergrammer/upload_pages/clustergrammer_py_v112_vect_post_fix/iframe_web_app.py | Python | py | 803 | permissive | def main(net, filename=None, width=1000, height=800):
import requests, json
from flask import current_app
from io import StringIO
from IPython.display import IFrame, display
clustergrammer_url = current_app.config['ORIGIN'] + current_app.config['ENTRY_POINT'] + '/matrix_upload/'
if filename is None:
f... |
cf4f4fcf2f852be90ce01559e50c2797d6b76f18 | 1be6075c57a76030eea0cd9d5e84ce5e0bcc00d5 | StRobertCHSCS/ICS3U1d-2018-19 | /Masters/5_Arcade_Interactive/arcade_template.py | Python | py | 799 | no_license | import arcade
WIDTH = 640
HEIGHT = 480
def on_update(delta_time):
pass
def on_draw():
arcade.start_render()
# Draw in here...
arcade.draw_circle_filled(100, 100, 25, arcade.color.BLUE)
def on_key_press(key, modifiers):
pass
def on_key_release(key, modifiers):
pass
def on_mouse_press(... |
c7d13a34596a1a3c8851d8f9965652d9385c6243 | 45e40bb5317d0a6e720dbcaf06b9834e9e92ab05 | adamas-cpf/pythontest | /列表与字典/字典/字典GET.py | Python | py | 587 | no_license | print('='*25,'使用get获取一个存在的键值','='*25)
A={'qytang':1,'python':2,'cisco':3}
print(A.get('qytang'))
print('='*25,'使用get获取一个不存在的键值','='*25)
B={'qytang':1,'python':2,'cisco':3}
print(B.get('haha'))
print('='*25,'使用get获取一个不存在的键值并返回预定义结果','='*25)
D={'qytang':1,'python':2,'cisco':3}
print(B.get('haha',88))
print('='*25,'不使... |
5950ed045c61f8dffedcf830937cab6188de925b | 21b7ca1441c215feed4f7ee684d4db5400dc647f | Telestream/telestream-cloud-python-sdk | /telestream_cloud_qc_sdk/test/test_mxf_version.py | Python | py | 1,293 | permissive | # coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import datetime
import telestream_cloud_qc
from telestream_cl... |
b85471d1d59613d0b760ad143ab7c74e0cf08822 | cccdb22afeddae371b3096a5694f5336d3a2c277 | AndreLYL/Tello_python | /KeyboardControl/keyboard_control.py | Python | py | 5,064 | no_license | from djitellopy import Tello
import cv2
import pygame
import numpy as np
import time
# Speed of the drone
S = 60
# Frames per second of the pygame window display
# A low number also results in input lag, as input information is processed once per frame.
FPS = 120
class FrontEnd(object):
""" Maintains the Tello d... |
531b3f482f5149b65de15bfdbac4eab86c6e3e75 | e548640d97b95fc930267c633d052a6b9fdf3c8b | dengos/stmp_server | /src/tstmp_server.py | Python | py | 3,532 | no_license | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Author: dengos
#
import time
import socket
import threading
import logging
import sys
import json
from stmp import *
from qsession import Qsession
##
# @brief
# This is a wrap-up function, for threading
def stmp_thread(machine):
machine.run()
##
# @brief
#
... |
4da1dc8bb257aa5460b1563bfd87732dc558baee | bf7fec400532cdf672eb283a0d0eebc4f7c6a1bf | aoteman233/muscleTorchLearning-Visual-Human-Interactions | /datasets/__init__.py | Python | py | 652 | no_license | from .human_h5py_dataset import HumanH5pyDataset
from .human_contrastive_combined_dataset import HumanContrastiveCombinedDataset
#representation testing
from .epic_state_change_dataset import EpicStateChangingDataset
from .nyu_depth_dataset import NYUDepthDataset
from .sun_scene_dataset import SunDataset
from .imagene... |
9e31ba36e7146b4fefca7c14212239219d3cf544 | ab8638a411fdfc8ee241c53c57ce087b27afb035 | Nesquick0/Adventofcode | /2016/01/1.py | Python | py | 775 | no_license |
def main():
direction = 0
posx = 0
posy = 0
with open("1.input", "r") as file:
fileContent = file.readline()
instructions = fileContent.strip().split(", ")
for instr in instructions:
rotate, distance = instr[0], int(instr[1:])
if (rotate == "R"):
direction = (direction + 1) % 4... |
f8b6120d620ac183f00a4d6c2ecd362c64ee4bb1 | 3aa2feb59e70a6f95afc51d5b080a96e08a08e85 | yuany-pku/2017_CSIC5011 | /project3/12.XuLiBu_source/hodgeRank/Rank_by_accesor.py | Python | py | 857 | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 08 13:38:15 2017
@author: Jason Li
"""
import pandas as pd
path = "C:\Fall2017-HKUST\CSIC5011-Yaoyuan\Final Project\Age\\age\\Age_data.csv"
df = pd.read_csv(path,header = 0)
#We want to know how many annotators participated in the dataset.
pd.Series.unique(df.... |
383e66619abca048a1008d400f5d37792edc5323 | 18bce4ad1f11d926754700edec310075ec58f34e | urjhams/VR-2018-BUW | /A3/2018-VR-Lab-Assignment-3-Code/lib/Crane.py | Python | py | 2,752 | no_license | #!/usr/bin/python
# import guacamole libraries
import avango
import avango.gua
### import application libraries
from lib.KeyboardInput import KeyboardInput
from lib.Hinge import Hinge
from lib.Arm import Arm
from lib.Hook import Hook
class Crane:
## constructor
def __init__(self,
PARENT_NODE = N... |
5dd57230f4d87db913b28450213b09104501b8fb | 8e90b21da52915e8f107be01aa3b0017920bed62 | kovalewvladimir/afii | /afii/printer/migrations/0009_auto_20161114_1424.py | Python | py | 608 | no_license | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-14 11:24
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('printer', '0008_auto_20161114_1417'),
]
operations = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.