code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import collections
from supriya import CalculationRate
from supriya.ugens.MultiOutUGen import MultiOutUGen
class PanAz(MultiOutUGen):
"""
A multi-channel equal-power panner.
::
>>> source = supriya.ugens.In.ar(bus=0)
>>> pan_az = supriya.ugens.PanAz.ar(
... channel_count=8,
... | Pulgama/supriya | supriya/ugens/PanAz.py | Python | mit | 1,001 |
#!/usr/bin/python
# coding: UTF-8
HIRAGANA = list(u'ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろわをんゎゐゑゔゕゖ')
HALF_KANA = [u'ァ',u'ア',u'ィ',u'イ',u'ゥ',u'ウ',u'ェ',u'エ',u'ォ',u'オ',u'カ',u'ガ',u'キ',u'ギ',u'ク',u'グ',u'ケ',u'ゲ',u'コ',u'ゴ',u'サ',u'ザ',u'シ',u'ジ',u'ス',u'ズ',u'セ',u'ゼ',u'ソ',u'ゾ',u'タ',u... | ktrueda/UrbanoContactsConverter | kana.py | Python | mit | 1,310 |
# 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 2 of the License, or
# (at your option) any later version.
import os
import shutil
from tests import TestCase, mkdtemp
from gi.r... | ptitjes/quodlibet | tests/test_qltk_tracker.py | Python | gpl-2.0 | 3,475 |
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | bazelbuild/bazel-bench | utils/bigquery_upload.py | Python | apache-2.0 | 2,925 |
# 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, software
# d... | phenoxim/nova | nova/tests/functional/test_multiattach.py | Python | apache-2.0 | 3,741 |
# Copyright 2015 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | akshara775/PerfKitBenchmarker-master-2 | tests/disk_metadata_test.py | Python | apache-2.0 | 5,019 |
"""
Proxy User and Role models.
"""
import base64
import hashlib
from django.db.models import Q
from django.contrib.auth.backends import ModelBackend as DjangoModelBackend
# Permission is imported solely so other places can import it from here
from django.contrib.auth.models import User as BaseUser, Group, Permissio... | peterbe/moztrap | moztrap/model/core/auth.py | Python | bsd-2-clause | 4,492 |
###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... | CSD-Public/stonix | src/tests/framework/network_tests/zzzTestFrameworkMacPkgr.py | Python | gpl-2.0 | 24,533 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-03-17 20:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AddField(
mo... | Compizfox/Inschrijflijst | app/migrations/0002_user_last_seen_at.py | Python | gpl-3.0 | 452 |
"""
You are a professional robber planning to rob houses along a street.
Each house has a certain amount of money stashed,
the only constraint stopping you from robbing each of them
is that adjacent houses have security system connected and
it will automatically contact the police if two adjacent houses
were broken int... | keon/algorithms | algorithms/dp/house_robber.py | Python | mit | 656 |
# According to A8.4
LSL = 0x0
LSR = 0x1
ASR = 0x2
ROR = 0x3
RRX = 0x3 # with imm = 0
| oblique-labs/pyVM | rpython/jit/backend/arm/shift.py | Python | mit | 86 |
class TriggerCall(object):
PROCESS_TRIGGER = 'PROCESS_TRIGGER'
TRY_NEXT_ACTION = 'TRY_NEXT_ACTION'
COMPLETE_ACTION = 'COMPLETE_ACTION'
class SubscriptionCall(object):
GENERATE = 'GENERATE'
| RetailMeNotSandbox/dart | src/python/dart/message/call.py | Python | mit | 207 |
# This file can mimic juypter running. Useful for testing jupyter crash handling
import sys
import argparse
import time
def main():
print("hello from dummy jupyter")
parser = argparse.ArgumentParser()
parser.add_argument("--version", type=bool, default=False, const=True, nargs="?")
parser.add_argumen... | glenngillen/dotfiles | .vscode/extensions/ms-toolsai.jupyter-2021.6.832593372/pythonFiles/vscode_datascience_helpers/dummyJupyter.py | Python | mit | 889 |
# Copyright 2017 DT42
#
# This file is part of BerryNet.
#
# BerryNet 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.
#
# BerryNet is d... | DT42/BerryNet | berrynet/service/movidius_service.py | Python | gpl-3.0 | 5,991 |
#!/usr/bin/env python2
import argparse
import pandas as pd
import matplotlib
matplotlib.use('Agg') # Force matplotlib to not use any Xwindows backend.
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="Plots a boxplot ... | pedrofeijao/RINGO | src/ringo/plot_ml_estimate.py | Python | mit | 1,794 |
"""
Support for IP Webcam, an Android app that acts as a full-featured webcam.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/android_ip_webcam/
"""
import asyncio
import logging
from datetime import timedelta
import voluptuous as vol
from homeassista... | MungoRae/home-assistant | homeassistant/components/android_ip_webcam.py | Python | apache-2.0 | 9,814 |
import Queue
import time
from threading import Thread
class ActiveThreadListItem():
def __init__(self, thread, name):
self.thread = thread
self.name = name
def getThread(self):
return self.thread
def getName(self):
return self.name
class EventObject():
def __init__(... | MooseDojo/apt2 | core/events.py | Python | mit | 4,988 |
"""
This script parses an ENA metadata file in XML format and prints a subset of information.
Usage: python parse_ENA_sampleInfo_XML.py ERP000909.xml > samples.txt
Input: an XML file exported for a list of ERS accession numbers from ENA using the REST URLs API. For example, one can download an XML file
for sample... | wanyuac/BINF_toolkit | parse_ENA_sampleInfo_XML.py | Python | gpl-3.0 | 2,321 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | googleads/google-ads-python | google/ads/googleads/v9/services/services/ad_group_audience_view_service/client.py | Python | apache-2.0 | 19,485 |
#!/usr/bin/env python
import cgi
reshtml = '''Content-Type: text/html\n
<HTML><HEAD><TITLE>
Friends CGI Demo (dynamic screen)
</TITLE></HEAD>
<BODY><H3>Friends list for: <I>%s</I></H3>
Your name is: <B>%s</B><P>
You have <B>%s</B> friends.
</BODY></HTML>'''
form = cgi.FieldStorage()
who = form['person'... | YuxuanLing/trunk | trunk/code/study/python/core_python_appilication/ch10/friendsA3.py | Python | gpl-3.0 | 400 |
"""
This tool does some migrations on the database.
We intend to have a format to export to be used for migration to a newer/older rhizi database,
but since this tool is currently written and useful it is being put, intended as temporary, to the db.
"""
import sys
import base64
import gzip
from py2neo import Graph, ... | shlomif/rhizi | src/temporary/migrate.py | Python | agpl-3.0 | 2,076 |
from django.conf.urls import patterns, include, url
from projects import views
urlpatterns = patterns('projects.urls',
url(r'^orte/$', views.orte),
url(r'^orte/cols$', views.orte_cols),
url(r'^orte/rows$', views.orte_rows),
url(r'^orte/(?P<pk>\d+)/$', views.ort),
url(r'^veroeffentlichungen/$', vie... | BuergerbautStadt/bbs-old | projects/urls.py | Python | agpl-3.0 | 552 |
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.net>
#
# 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 S... | TetraAsh/baruwa2 | baruwa/model/lists.py | Python | gpl-3.0 | 1,763 |
# 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 ... | Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_inbound_nat_rules_operations.py | Python | mit | 22,205 |
#!/usr/bin/env python
# encoding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Vers... | apache/cloudstack-gcestack | gstack/models/accesstoken.py | Python | apache-2.0 | 1,414 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | mfherbst/spack | var/spack/repos/builtin/packages/foam-extend/package.py | Python | lgpl-2.1 | 17,892 |
#-*- coding: utf-8 -*-
import numpy as n
from scipy.io import wavfile as w
import imp
fun=imp.load_source("functions","../aux/functions.py")
v = fun.V
def A(fa=2.,V_dB=10.,d=2.,taba=fun.S):
return fun.T(d, fa, V_dB, taba=taba)
def adsr(s, A=20, D=20, S=-10, R=100):
return fun.AD(A=A, D=D, S=S, R=R, sonic_vecto... | ttm/mass | src/pieces3/ruidosaFaixa2.py | Python | gpl-3.0 | 6,375 |
##############################################################################
#
# Copyright (C) 2016 Comunitea Servicios Tecnológicos
# $Omar Castiñeira Saavedra <omar@comunitea.com>$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pub... | Comunitea/CMNT_004_15 | project-addons/crm_claim_rma_custom/wizard/__init__.py | Python | agpl-3.0 | 1,076 |
#!/usr/bin/env python
"""
Transforms an SQL extract of pre-6.0 Stroom users to 6.0 users, ready for
import to the stroom-auth database. If you're upgrading to Stroom 6.0 then
this is a necessary step.
This scripts expects the input TSV to have the following colums: NAME, STAT.
If a user already exists it won't try and... | gchq/stroom | stroom-security/stroom-security-identity-db-jooq/src/scripts/transform_user_extract.py | Python | apache-2.0 | 3,176 |
# -*- coding: utf-8 -*-
#
##############################################################################
#
# Authors: Adrien Peiffer
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | akretion/l10n-belgium | account_companyweb/tests/test_companyweb.py | Python | agpl-3.0 | 16,078 |
# -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class SharebeesCom(DeadHoster):
__name__ = "SharebeesCom"
__type__ = "hoster"
__pattern__ = r"http://(?:\w*\.)*?sharebees.com/\w{12}"
__version__ = "0.02"
__description__ = """ShareBees hoster plugin... | wangjun/pyload | module/plugins/hoster/SharebeesCom.py | Python | gpl-3.0 | 446 |
"""Suite CodeWarrior suite: Terms for scripting the CodeWarrior IDE
Level 0, version 0
Generated from /Volumes/Sap/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/CodeWarrior IDE 4.2.5
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'CWIE'
class... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/plat-mac/lib-scriptpackages/CodeWarrior/CodeWarrior_suite.py | Python | mit | 23,097 |
from django.db import models
from django.core.exceptions import ObjectDoesNotExist
class QuestionManager(models.Manager):
def available(self, *args, **kwargs):
qs = self.get_queryset()
return qs.filter(available=True)
class SurveyResultManager(models.Manager):
def create_objects(self, user... | tndatacommons/tndata_backend | tndata_backend/survey/managers.py | Python | mit | 2,163 |
from langkit.lexer import Lexer, LexerToken, Literal, WithText, \
WithSymbol, Pattern, Ignore
class Token(LexerToken):
# Keywords
Config = WithText()
Menuconfig = WithText()
Choice = WithText()
Endchoice = WithText()
Comment = WithText()
Menu = WithText()
Endmenu = WithText()
... | Fabien-Chouteau/libkconfiglang | kconfig/language/lexer.py | Python | gpl-3.0 | 3,883 |
from dataclasses import dataclass
from mitmproxy import connection
from . import commands
@dataclass
class ClientConnectedHook(commands.StartHook):
"""
A client has connected to mitmproxy. Note that a connection can
correspond to multiple HTTP requests.
Setting client.error kills the connection.
... | mhils/mitmproxy | mitmproxy/proxy/server_hooks.py | Python | mit | 1,459 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare, float_round
from odoo.ad... | t3dev/odoo | addons/mrp/models/mrp_workorder.py | Python | gpl-3.0 | 19,034 |
import io
import os
import re
import sys
from glob import glob
from invoke import task
DOCS_PORT = os.environ.get("DOCS_PORT", 8000)
#: branch prefixes for which some checks are skipped
SPECIAL_BRANCHES = ("master", "develop", "release")
@task
def clean(c):
""" Remove artifacts and binary files. """
c.run("... | nephila/djangocms-blog | tasks.py | Python | bsd-3-clause | 4,218 |
"""XML migration script by David Jonas
This script migrates XML files into Plone Objects
Supposed to be run as an external method trhough the boilerplate script migration.py
(Instructions: http://plone.org/documentation/kb/create-and-use-an-external-method )
"""
import libxml2
import urllib2
import AccessControl
imp... | davidjonas/PloneXMLMigration | migrator.py | Python | unlicense | 20,468 |
import pytest
import numpy as np
from keras import backend as K
from keras_contrib import backend as KC
from keras_contrib.layers import core
from keras.utils.test_utils import layer_test, keras_test
from numpy.testing import assert_allclose
@keras_test
def test_cosinedense():
from keras import regularizers
... | stygstra/keras-contrib | tests/keras_contrib/layers/test_core.py | Python | mit | 2,049 |
# Copyright 2012 Nebula, 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 agree... | NCI-Cloud/horizon | horizon/tables/actions.py | Python | apache-2.0 | 38,502 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('utils', '0001_initial'),
('socialmedia', '0001_initial'),
('tenant', '0001_initial'),
('contacts', '0001_initial'),
... | HelloLily/hellolily | lily/contacts/migrations/0002_auto_20150218_1722.py | Python | agpl-3.0 | 2,655 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Julien Veyssier
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the... | vicnet/weboob | modules/becm/test.py | Python | lgpl-3.0 | 1,064 |
#-------------------------------------------------------------------------------
# Name: breakaway-parser
# Purpose: Parse Breakaway PDF into ICS file
#
# Author: cthompso
#
# Created: 12/06/2013
# Copyright: (c) cthompso 2013
# Licence: MIT
#---------------------------------------------------... | cooperthompson/breakaway-calendar | scripts/breakaway-parser.py | Python | mit | 8,066 |
# Copyright 2014 Mirantis, 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 ... | Mirantis/pumphouse | pumphouse/_vendor/fuelclient/objects/environment.py | Python | apache-2.0 | 11,875 |
#!/usr/bin/env python
import redhawk.common.node as N
import redhawk.common.types as T
import redhawk.utils.util as U
from . import writer
import itertools
import pygraphviz
def WriteToDot(tree):
s = DotWriter()
return s.WriteTree(tree)
def WriteToImage(tree, fmt='png', filename=None):
s = DotWriter()
s.Ad... | JordanMilne/Redhawk | redhawk/common/writers/dot_writer.py | Python | bsd-2-clause | 3,490 |
# Third-party
import astropy.units as u
import numpy as np
# Project
from ..data import RVData
from ..samples import JokerSamples
from ..samples_analysis import (
MAP_sample, is_P_unimodal, is_P_Kmodal,
max_phase_gap, phase_coverage, periods_spanned)
def test_MAP_sample():
samples = JokerSamples()
sa... | adrn/thejoker | thejoker/tests/test_samples_analysis.py | Python | mit | 3,194 |
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
from users.models import Hijo
class Post(models.Model):
title = models.TextField(null=True, blank=True) #Título
content = models.TextField(null=True, blank=True) #Contenido de la entrada
url = models.URLField... | pupils/pupils | pupils/tablon/models.py | Python | agpl-3.0 | 566 |
"""
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
import base64
import binascii
import cgi
from urllib.parse import unquote
from django.conf import settings
from django.core.exceptions import (
RequestDa... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/http/multipartparser.py | Python | mit | 24,849 |
###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | amcat/amcat | api/rest/viewsets/project.py | Python | agpl-3.0 | 7,130 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: identities.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | rameshbabu79/fabric | bddtests/identities_pb2.py | Python | apache-2.0 | 2,901 |
# -*- coding: utf-8 -*-
"""Tests del modulo pydatajson."""
from __future__ import print_function, unicode_literals, with_statement
import os.path
import requests_mock
import vcr
from nose.tools import assert_true, assert_false, assert_equal, \
assert_not_in, assert_in
from pydatajson.indicators import _eventua... | datosgobar/pydatajson | tests/test_indicators.py | Python | mit | 25,279 |
import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self,
plotly_name="bordercolor",
parent_name="layout.xaxis.rangeselector",
**kwargs
):
super(BordercolorValidator, self).__init__(
plot... | plotly/plotly.py | packages/python/plotly/plotly/validators/layout/xaxis/rangeselector/_bordercolor.py | Python | mit | 464 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.A... | ampax/edx-platform | openedx/core/djangoapps/api_admin/migrations/0001_initial.py | Python | agpl-3.0 | 3,299 |
import gzip
import logging
import os
import shutil
import uuid
from PIL import Image
from zipfile import ZipFile
import pandas as pd
import numpy as np
import pyresample as pr
from trollvalidation.validations import configuration as cfg
LOG = logging.getLogger(__name__)
# logging.basicConfig(level=logging.DEBUG,
# ... | HelgeDMI/trollvalidation | trollvalidation/validation_utils.py | Python | apache-2.0 | 5,738 |
import sys
import agent.DeepMindAgent as DM
import Message as M
import GameEnv as GE
import Saver as S
import QtDisplay as Qt
if len(sys.argv) != 2 :
print("Usage: {} <path to rom>".format(sys.argv[0]))
quit()
rom = sys.argv[1]
dbPath = "./data.db"
inf... | Nimoab/DQN-Deepmind-NIPS-2013 | Run.py | Python | gpl-3.0 | 950 |
import xbmc
import xbmcgui
import os
import thread
from threading import Timer
ACTION_SELECT_ITEM = 7
ACTION_PREVIOUS_MENU = 10
ACTION_NAV_BACK = 92
YES_NO_DIALOG = 0
CANCEL_RESTART_DIALOG = 1
class ConfirmDialogXML(xbmcgui.WindowXMLDialog):
def onInit(self):
self.IsInitDone = False
self.labelCo... | memphisx/alphauiplus | skin.alienware/scripts/confirmdialog.py | Python | gpl-2.0 | 4,637 |
# 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.
# This program is distributed in the hope that it will be useful,
# but... | excid3/simpyl_pastebin | urls.py | Python | gpl-3.0 | 1,542 |
import time
from threading import Timer
def loop(period, duration, callback):
t0 = time.time()
while (time.time()-t0) < duration:
timer = Timer(period, callback)
timer.start()
timer.join()
class Scheduler(object):
def __init__(self,prog, sampling_period, sampling_duration):
... | cversek/peltiator | python/src/peltiator/apps/peltier_test/lib/application/scheduler.py | Python | mit | 1,440 |
from __future__ import print_function, unicode_literals
import unittest
from binascii import unhexlify # , hexlify
from hkdf import Hkdf
# def generate_KAT():
# print("KAT = [")
# for salt in (b"", b"salt"):
# for context in (b"", b"context"):
# skm = b"secret"
# out = HKDF(s... | warner/magic-wormhole | src/wormhole/test/test_hkdf.py | Python | mit | 1,791 |
"""
This program demonstrates how unidentified keyword
arguments are handled/passed as a dictionary. The receiving
identifier is preceded by two asterisks.
"""
def gets(**kwargs):
print type(kwargs), len(kwargs), '\n', kwargs
for i in kwargs:
print i, kwargs[i], type(kwargs[i])
x =... | sharkySharks/PythonForDevs | DemoProgs/varykwargs.py | Python | mit | 385 |
########################################################################
#
# File: fields.py
# Author: Alex Samuel
# Date: 2001-03-05
#
# Contents:
# General type system for user-defined data constructs.
#
# Copyright (c) 2001, 2002, 2003 by CodeSourcery, LLC. All rights reserved.
#
# For license terms see the ... | MentorEmbedded/qmtest | qm/fields.py | Python | gpl-2.0 | 68,605 |
import wx
import time
class MyForm(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Timer Tutorial 1",
size=(500,500))
# Add a panel so it looks the correct on all platforms
panel = wx.Panel(self, wx.ID_ANY)
self.timer = ... | m-takeuchi/ilislife_wxp | test/test_timer.py | Python | mit | 1,065 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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 2 of the
## Licens... | AlbertoPeon/invenio | modules/webjournal/lib/webjournal.py | Python | gpl-2.0 | 10,968 |
# Copyright 2013 Canonical Ltd.
# This software is licensed under the GNU Affero General Public License
# version 3 (see the file LICENSE).
import logging
import sst.actions
import u1testutils.sso.sst.pages
from base64 import b32decode
from urlparse import urlparse, parse_qs
from u1testutils.sst import log_action
... | miing/mci_migo | acceptance/pages.py | Python | agpl-3.0 | 16,073 |
""" Content Selection Subsystem web interface
This module implements the CSS's web interface. The interface exposes endpoints
for voting on requests and displaying voting results.
"""
from __future__ import unicode_literals, print_function
from google.appengine.ext import ndb
from utils.routes import RedirectMixin, ... | Outernet-Project/outernet-csds | css/webui.py | Python | gpl-3.0 | 2,196 |
#!/usr/bin/env python
from . import base_repository
from .. import helper
class WordMeaningSoundRepository(base_repository.BaseRepository):
def get_sounds(self, user_id, word_meaning_id):
custom_sounds = self._call_proc_query_all(
"WordMeaningSound_Sounds_S", [user_id, word_meaning_id])
... | hiearth/langstyle | langstyle/database/word_meaning_sound_repository.py | Python | gpl-2.0 | 687 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-22 22:58
from __future__ import unicode_literals
from django.db import migrations
def image_sets(apps, schema_editor):
Post = apps.get_model("blog", "Post")
ImageSet = apps.get_model("pinax_images", "ImageSet")
db_alias = schema_editor.conne... | pinax/pinax-blog | pinax/blog/migrations/0012_set_default_imagesets.py | Python | mit | 713 |
# -*- coding: utf-8 -*-
from openprocurement.tender.belowthreshold.views.lot import TenderLotResource
from openprocurement.api.utils import (
get_now,
json_view,
context_unpack,
)
from openprocurement.tender.core.validation import (
validate_lot_data,
validate_patch_lot_data,
validate_tender_per... | openprocurement/openprocurement.tender.openua | openprocurement/tender/openua/views/lot.py | Python | apache-2.0 | 3,349 |
import _plotly_utils.basevalidators
class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="colorsrc", parent_name="waterfall.insidetextfont", **kwargs
):
super(ColorsrcValidator, self).__init__(
plotly_name=plotly_name,
pare... | plotly/plotly.py | packages/python/plotly/plotly/validators/waterfall/insidetextfont/_colorsrc.py | Python | mit | 427 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Copyright 2016,暗夜幽灵 <darknightghost.cn@gmail.com>
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 Licen... | darknightghost/fake-serial | cfg/err.py | Python | gpl-3.0 | 1,845 |
import json
from django.contrib.postgres import forms, lookups
from django.contrib.postgres.fields.array import ArrayField
from django.core import exceptions
from django.db.models import Field, TextField, Transform
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStore... | BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/contrib/postgres/fields/hstore.py | Python | mit | 2,945 |
# -*- coding: utf-8 -*-
"""Test i18n module."""
#
# (C) Pywikibot team, 2007-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id$'
import sys
import pywikibot
from pywikibot import i18n, bot, plural
from tests.aspects import unitte... | icyflame/batman | tests/i18n_tests.py | Python | mit | 17,128 |
from __future__ import absolute_import, print_function
import cython
from .. import __version__
import os
import shutil
import hashlib
import subprocess
import collections
import re, sys, time
from glob import iglob
from io import open as io_open
from os.path import relpath as _relpath
from distutils.extension import... | ryfeus/lambda-packs | HDF4_H5_NETCDF/source2.7/Cython/Build/Dependencies.py | Python | mit | 43,610 |
import pyb
print("Executing main.py")
led = pyb.LED(1)
led.on()
pyb.delay(100)
led.off()
pyb.delay(100)
led.on()
pyb.delay(100)
led.off()
| HenrikSolver/micropython | teensy/memzip_files/main.py | Python | mit | 143 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='CommonInfo',
fields=[
('id', models.AutoField(s... | max1k/cbs | p311/migrations/0001_initial.py | Python | gpl-2.0 | 1,608 |
# Copyright 2013 Red Hat, 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 agre... | ChinaMassClouds/copenstack-server | openstack/src/nova-2014.2/nova/virt/event.py | Python | gpl-2.0 | 3,342 |
import claudio
import matplotlib.pyplot as plt
import numpy as np
import minst.signal as S
def draw_onset_data(audio_file, onset_data, title):
x, fs = claudio.read(audio_file, samplerate=22050, channels=1, bytedepth=2)
fig, axes = plt.subplots(nrows=2, ncols=1, figsize=(12, 6))
nhop = 100
x_max = np.... | ejhumphrey/minst-dataset | minst/visualize.py | Python | isc | 990 |
#!/usr/bin/env python3.4
#
# 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 la... | google/mobly | tools/snippet_shell.py | Python | apache-2.0 | 2,593 |
import dis
s = open('scope01.py').read()
co = compile(s, 'scope01.py', 'exec')
print dis.dis(co)
| lizbew/code-practice | 11-pyvm/print_bytecode.py | Python | apache-2.0 | 99 |
"""Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .palettes import c... | Lx37/seaborn | seaborn/timeseries.py | Python | bsd-3-clause | 15,218 |
# Copyright 2012 the V8 project authors. 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 conditi... | macchina-io/macchina.io | platform/JS/V8/v8/tools/testrunner/local/testsuite.py | Python | apache-2.0 | 12,117 |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
from setuptools import setup, find_packages
tests_require = []
setup(
name='cloak-server',
version='0.3',
author='Encrypt.me',
author_email='hello@encrypt.me',
description="Tool... | encryptme/private-end-points | setup.py | Python | mit | 837 |
# -*- coding: UTF-8 -*-
import re
import sys
import jieba
import numpy as np
import pandas as pd
from gensim import corpora, models, similarities
sys.path.append("utility")
from utility.async_decor import async_wrapper
from utility.logger_decor import create_logger, exception
class Docsim(object):
"""
文本相似度... | jarvisqi/nlp_learn | gensim/docsim.py | Python | mit | 6,907 |
import re
import uuid as py_uuid
from common_fixtures import * # NOQA
TEST_IMAGE = 'ibuildthecloud/helloworld'
TEST_IMAGE_LATEST = TEST_IMAGE + ':latest'
TEST_IMAGE_UUID = 'docker:' + TEST_IMAGE
if_docker = pytest.mark.skipif("os.environ.get('DOCKER_TEST') == 'false'",
reason='DOCKER_T... | willseward/cattle | tests/integration/cattletest/core/test_docker.py | Python | apache-2.0 | 31,065 |
# encoding: utf-8
'''
Created on 27 avr. 2013
@author: guillaume
'''
import sys
print sys.path
from distarkcli.utils.NetInfo import NetInfo
from distarkcli.protos.generic_service_pb2 import PBOneRequest
from distarkcli.protos.generic_service_pb2 import PBOneResponse
from distarkcli.transport.transportpool import Conn... | GustavePate/distarkcli | distarkcli/transport/distarkclient.py | Python | gpl-3.0 | 2,043 |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2017 University of Tübingen, CERN
#
# B2Share 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 2 of the
# License, ... | EUDAT-B2SHARE/b2share | b2share/modules/records/cli.py | Python | gpl-2.0 | 8,025 |
from datetime import datetime, timedelta
import random
from itertools import izip
from django.test import TestCase, override_settings
from django.contrib.auth.models import User
from molo.core.tests.base import MoloTestCaseMixin
from molo.profiles import task
import responses
import json
class UserInfoTest(TestCase, ... | praekelt/molo.profiles | molo/profiles/tests/test_user_info_task.py | Python | bsd-2-clause | 3,932 |
################################################################################
#
# Copyright 2014 William Barsse
#
################################################################################
#
# This file is part of ToySM Extensions.
#
# ToySM Extensions is free software: you can redistribute it and/or modify
... | willakat/toysm | toysm/ext/tests/test_scapy.py | Python | lgpl-3.0 | 4,998 |
# Copyright 2016 Google 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 required by applicable law or a... | clarko1/Cramd | appengine/standard/ndb/async/app_async.py | Python | apache-2.0 | 1,155 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
lassplit.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | slarosa/QGIS | python/plugins/sextante/lidar/lastools/lassplit.py | Python | gpl-2.0 | 2,455 |
#
# Copyright 2015 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... | catapult-project/catapult-csm | third_party/google-endpoints/apitools/base/py/testing/mock.py | Python | bsd-3-clause | 12,590 |
#!/usr/bin/python
#===============================================================================
# Copyright (c) 2016, James Ottinger. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# MoneyWatch - https://github.com/jamesottinger/moneywatch... | jamesottinger/MoneyWatch | moneywatch/moneywatchconfig.py | Python | bsd-3-clause | 1,109 |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | deepmind/acme | acme/wrappers/open_spiel_wrapper_test.py | Python | apache-2.0 | 2,288 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/tom/x_os/src/satellite_dish_driver/include".split(';') if "/home/tom/x_os/src/satellite_dish_driver/include" != "" else []
PROJECT_CATKIN_DEPENDS = "gait_generation;ihmc_msgs;roscpp;std_msgs;tf2_... | Txion001/src_x_os | x_os/build/satellite_dish_driver/catkin_generated/pkg.develspace.context.pc.py | Python | apache-2.0 | 588 |
"""Fixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
# By Taek Joo Kim and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen
# XXX This doesn't support nested for loops like [x for x in ... | nmercier/linux-cross-gcc | win32/bin/Lib/lib2to3/fixes/fix_paren.py | Python | bsd-3-clause | 1,272 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | bhardesty/qpid-dispatch | tests/system_tests_console.py | Python | apache-2.0 | 6,863 |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 16:27:28 2017
@author: sebastian
"""
## retrieve auxiliary ECMWF forecast data, to augment temperature forecasts
## based on example from
## https://software.ecmwf.int/wiki/display/WEBAPI/TIGGE+retrieval+efficiency
## surface variables: (see https://software.ecmwf.in... | slerch/ppnn | data_retrieval/forecasts/retrieve_ecmwf_auxiliary_surface_data.py | Python | mit | 1,974 |
#!/usr/bin/python
# Import the modules to send commands to the system and access GPIO pins
import RPi.GPIO as gpio
import syslog
import os
import sys
import signal
from time import sleep
def shutdown():
# Shutdown && log
syslog.syslog('pishutdown: Soft shutdown')
gpio.cleanup()
os.system('shutdown now... | anyWareSculpture/physical | RaspberryPi/pishutdown.py | Python | mit | 1,505 |
#
# ParseFeed
# Author: Reuben Joseph <reubenej@gmail.com>
#
# -*- coding:utf-8 -*-
import feedparser
import json
import os.path
# Basic configuration details
ROOT_DIR = os.path.dirname(os.path.abspath('conf/'))
CONFIG_PATH = os.path.join(ROOT_DIR, 'conf/feeds.conf')
def main():
file = open(CONFIG_PATH, 'r')
... | rjosph/munger | munger/ParseFeed.py | Python | mit | 427 |
"""Alignment with SNAP: http://snap.cs.berkeley.edu/
"""
import os
from bcbio import bam, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.ngsalign import novoalign, postalign
from bcbio.provenance import do
def align(fastq_file, pair_file, index_dir,... | gifford-lab/bcbio-nextgen | bcbio/ngsalign/snap.py | Python | mit | 2,111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.