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 |
|---|---|---|---|---|---|
from iotile.core.hw.proxy.proxy import TileBusProxyObject
from typedargs.annotate import context
@context("SimpleProxy")
class SimpleProxyObject(TileBusProxyObject):
"""A simply proxy object to correspond with SimpleVirtualDevice
"""
@classmethod
def ModuleName(cls):
return 'Simple'
| iotile/coretools | iotiletest/iotile/mock/devices/simple_virtual_proxy.py | Python | gpl-3.0 | 311 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 b... | cackharot/suds-py3 | suds/metrics.py | Python | lgpl-3.0 | 1,965 |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... | justinvforvendetta/electrum-boli | plugins/cosigner_pool.py | Python | gpl-3.0 | 6,043 |
#!/usr/bin/python
#
# Copyright 2012 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 b... | google/textfsm | tests/clitable_test.py | Python | apache-2.0 | 11,883 |
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
# This file is part of the E-Cell System
#
# Copyright (C) 1996-2016 Keio University
# Copyright (C) 2008-2016 RIKEN
# Copyright (C) 2005-2009 The Molecular Sciences Institute
#
#:::::::::::::::::::::::::::::::::::::::... | ecell/ecell3 | ecell/frontend/model-editor/ecell/ui/model_editor/ComplexLine.py | Python | lgpl-3.0 | 13,350 |
import os
import sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
'pyramid==1.4.2',
'SQLAlchemy==0.8.2',
'transaction',
'zope.s... | pombredanne/Bookie | setup.py | Python | agpl-3.0 | 1,317 |
class Solution(object):
def removeComments(self, source):
"""
:type source: List[str]
:rtype: List[str]
"""
ans = []
in_comment_block = False
for line in source:
i = 0
if not in_comment_block:
new_line = []
w... | Mlieou/oj_solutions | leetcode/python/ex_722.py | Python | mit | 929 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import json
import socket
import shutil
import signal
import logging
import tempfile
import threading
import subprocess
'''
tgcli.py - Library to interact with telegram-cli.
Copyright (C) 2015-2016 Dingyuan Wang
This program is free software: you ... | gumblex/tg-export | tgcli.py | Python | lgpl-3.0 | 8,131 |
#!/usr/bin/env python3
import argparse
import sys
import yaml
from pf_focus.markdown import output_markdown
from pf_focus.bbcode import output_bbcode
from pf_focus.parse import parse_pfsense
from pf_focus.pfsense import PfSenseDocument
from pf_focus.progress import Animation
def output_yaml(doc, stream):
yaml.s... | TKCERT/pfFocus | pf_focus/format.py | Python | gpl-3.0 | 2,598 |
#!/usr/bin/env python
import logging
import os.path
import pandas as pd
import numpy as np
from KaggleWord2VecUtility import KaggleWord2VecUtility
from gensim.models import Doc2Vec
from gensim.models.doc2vec import LabeledSentence
def getFeatureVecs(reviews, model, num_features):
reviewFeatureVecs = np.zeros((l... | tjflexic/kaggle-word2vec-movie-reviews | generate_d2v.py | Python | gpl-2.0 | 3,034 |
#!/usr/bin/env python
"""
Given 3 files, creates a 3-way Venn diagram of intersections using matplotlib; \
see :mod:`pybedtools.contrib.venn_maker` for more flexibility.
Numbers are placed on the diagram. If you don't have matplotlib installed.
try venn_gchart.py to use the Google Chart API instead.
The values in th... | jos4uke/getSeqFlankBlatHit | lib/python2.7/site-packages/pybedtools/scripts/venn_mpl.py | Python | gpl-2.0 | 4,952 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.shortcuts import render
from django import forms
from django.contrib.auth import (
password_validation,
)
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from dj... | foohooboo/graphql-cookiecutter | graphql_cookiecutter/users/admin.py | Python | mit | 11,277 |
# -*- coding: utf-8 -*-
"""
"""
import collections
from dibble.operations import SetMixin, IncrementMixin, RenameMixin, UnsetMixin, PushMixin, PushAllMixin
from dibble.operations import AddToSetMixin, PopMixin, PullMixin, PullAllMixin
class InvalidatedSubfieldError(Exception):
"""
Error raised when using a Su... | voxelbrain/dibble | dibble/fields.py | Python | bsd-3-clause | 8,657 |
from django_webtest import WebTest
from pylab.core.factories import EventFactory
class EventListTest(WebTest):
def test_no_events_on_page(self):
resp = self.app.get('/events/')
self.assertEqual(resp.status_int, 200)
self.assertTrue(b'No events yet.' in resp.content)
def test_event_l... | python-dirbtuves/website | pylab/website/tests/test_event_list.py | Python | agpl-3.0 | 547 |
#!/usr/bin/env python3
"""Package Providing classes to write ptTools.ParseTreeNodes to output
channels."""
__author__ = "Markus Rother - python@markusrother.de"
__date__ = "06/2013"
__version__ = "0.1"
__all__ = [
'AbstractTreeWriter',
'AbstractParseTreeWriter',
'AnsiParseTreeWriter',
'VerbosePar... | 941design/ptTools | ptTools/writers/__init__.py | Python | gpl-3.0 | 541 |
from observertest import BaseObserverToscaTest
from core.models import Instance, Site
# Note that as a side effect, these tests will also create a Site
class ObserverContainerTest(BaseObserverToscaTest):
tests = ["create_container"]
# hide_observer_output = False # uncomment to display lots of stuff to scree... | xmaruto/mcord | xos/tosca/tests/observerContainerTest.py | Python | apache-2.0 | 4,363 |
n = 1
x = int(input()) + n
while ('8' not in str(x)):
n += 1
x += 1
print(n)
| yamstudio/Codeforces | 400/488A - Giga Tower.py | Python | gpl-3.0 | 85 |
#Necessary file.. I think.
| Vaquh/FagBotService | __init__.py | Python | gpl-2.0 | 29 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2006 Donald N. Allingham
# Copyright (C) 2009-2010 Gary Burton
# Copyright (C) 2010 Nick Hall
#
# 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
#... | Nick-Hall/gramps | gramps/gui/selectors/selectplace.py | Python | gpl-2.0 | 3,146 |
# Copyright (c) 2015 Kurt Yoder
# See the file LICENSE for copying permission.
import logging
from . import common
class System(common.Diff):
'''Compare two systems data objects. It is valid to pass a
mismatched data type, or None as the second data object. In this
case, the types will evaluate as differe... | Doveps/bassist | bassist/diff/system.py | Python | mit | 1,687 |
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
import unittest
from scipy.signal import butter, lfilter, freqz
import matplotlib.pyplot as plt
import numpy as np
from ndnoise import filtration
import ndnoise.generator
class MyTestCase(unittest.TestCase):
def test_butter(self):
... | mjirik/ndnoise | tests/filtration_test.py | Python | mit | 14,184 |
from django.test import TestCase
from django.template import Context, Template
from .base import PermissionsRegistry, Model, User, AnonymousUser
filters_called = set()
def can_do(user):
filters_called.add('can_do')
return 'can_do' in user.permissions
def can_do_with_model(user, instance):
filters_ca... | PSU-OIT-ARC/django-perms | permissions/tests/test_templatetags.py | Python | mit | 2,795 |
# -*- encoding: utf-8 -*-
"""twitter demo for CodeBug Tether.
Call with no arguments to pull latest tweets from home timeline.
Call with string argument to search for that term
"""
# only needed for testing
import os
import sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, p... | cymplecy/codebug_tether | examples/tweets.py | Python | gpl-3.0 | 4,341 |
import StringIO, csv
from flask import Blueprint, request, render_template, flash, g, session, \
redirect, url_for, jsonify, make_response, Response
from dataviva import db
from dataviva.utils.make_query import make_query
from dataviva.rais.models import Yb_rais, Yi, Yo, Ybi, Ybo, Yio, Ybio
mod = Blueprint... | dogobox/datavivamaster | dataviva/rais/views.py | Python | mit | 3,092 |
#!/usr/bin/python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Build and push the {vers}/{platform}/download_file_types.pb files to GCS so
# that the component update system will pick them up and push... | geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/chrome/browser/resources/safe_browsing/push_file_type_proto.py | Python | gpl-3.0 | 2,407 |
"""
Jhonatan da Silva
Last Updated version :
Sun Feb 5 11:02:55 2017
Number of code lines:
61
"""
import time
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import bokeh.plotting as bp
from matplotlib import style
import numpy as np
import random
#style.use('fivethirtyeight')
class gradient... | sjhonatan/intro-python | 28-liveplot/gradientDescent.py | Python | mit | 1,751 |
"""Open an arbitrary URL.
See the following document for more info on URLs:
"Names and Addresses, URIs, URLs, URNs, URCs", at
http://www.w3.org/pub/WWW/Addressing/Overview.html
See also the HTTP spec (from which the error codes are derived):
"HTTP - Hypertext Transfer Protocol", at
http://www.w3.org/pub/WWW/P... | ai-ku/langvis | jython-2.1/Lib/urllib.py | Python | mit | 48,972 |
from unittest import TestCase
import os
from ddt import ddt, unpack, data
import auxlib.configuration
from auxlib.configuration import make_env_key, Configuration, reverse_env_key, YamlSource
from auxlib.exceptions import AssignmentError, NotFoundError
from auxlib.type_coercion import typify
APP_NAME = 'test'
PACK... | kalefranz/auxlib | tests/test_configuration.py | Python | isc | 6,114 |
# SOME OPTIMIZATION WITH RING COMPRESSION
from abapy import materials
from compmod.models import CuboidTest_VER
from scipy import interpolate
from scipy.optimize import minimize
import matplotlib.pyplot as plt
import numpy as np
import pickle, copy
import platform
node = platform.node()
def read_file(file_name):
''... | lcharleux/compmod | doc/example_code/models/cuboidTest_opti.py | Python | gpl-2.0 | 6,573 |
import sys
import os
sys.path.insert(1, os.path.join("..", "..", ".."))
import h2o
from tests import pyunit_utils
from h2o.grid.grid_search import H2OGridSearch
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def grid_resume():
train = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris_whe... | h2oai/h2o-3 | h2o-py/tests/testdir_algos/grid/pyunit_grid_manual_export_resume_new_hyperspace.py | Python | apache-2.0 | 2,413 |
#!/usr/bin/env python
from pprint import pprint as pp
import json, yaml
my_dict = {}
my_dict_yaml = {}
with open('json.txt', 'r') as f:
my_dict[0] = json.load(f)
with open('yaml.txt', 'r') as f:
my_dict[1] = yaml.load(f)
pp(my_dict)
| tomjshine/pynet | week1/ex7.py | Python | apache-2.0 | 247 |
# -*- coding: utf-8 -*-
import json
import logging
from stubo.testing import Base
log = logging.getLogger(__name__)
class TestPutDelay(Base):
def test_put_fixed(self):
self.http_client.fetch(self.get_url('/stubo/api/put/delay_policy?'
'name=rtz_1&delay_type=fi... | rusenask/stubo-app | stubo/tests/integration/test_api.py | Python | gpl-3.0 | 109,045 |
# Copyright 2015-2018 ARM Limited
#
# 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 w... | setrofim/workload-automation | wa/utils/trace_cmd.py | Python | apache-2.0 | 12,093 |
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | redhat-cip/hardware | hardware/tests/utils.py | Python | apache-2.0 | 772 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/distributions/python/ops/trig.py | Python | apache-2.0 | 6,603 |
import unittest
import random
import numpy as np
from sapphire.simulations import ldf
class BaseLdfSimulationTest(unittest.TestCase):
def setUp(self):
self.simulation = ldf.BaseLdfSimulation
random.seed(1)
np.random.seed(1)
def test_simulate_particles_for_density(self):
sel... | tomkooij/sapphire | sapphire/tests/simulations/test_ldf.py | Python | gpl-3.0 | 2,199 |
import re
from random import randrange
def test_some_contact_on_home_page(app):
index = randrange(len(app.contact.get_contact_list()))
contact_from_home_page = app.contact.get_contact_list()[index]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(index)
assert contact_from_home_pag... | evgeniy-shorgin/python_training | test/test_some_contact_on_home_page.py | Python | apache-2.0 | 1,440 |
import unittest
from helper import UsesQApplication
from PySide2.QtGui import QItemSelection, QStandardItemModel
class QItemSelectionTest(UsesQApplication):
def testLen(self):
model = QStandardItemModel(2, 2)
model.insertRow(0)
model.insertRow(1)
model.insertColumn(0)
model... | BadSingleton/pyside2 | tests/QtGui/qitemselection_test.py | Python | lgpl-2.1 | 501 |
# generate random input for the 'conway' polyhedron generator from
# the 'antiprism' collection of polyhedron programs
seeds ='TOCIDPAY'
operators = 'abcdegjkmoprst'
interesting = {
'blobball':'btD','flowerball':'bgbD','ovalishball':'ebmC','brickerball':'bpdO',
'paths':'tadbsP6','capsule':'atY6','nonsymmegg':'taotY... | donbright/piliko | antiprism/conwayfuzz.py | Python | bsd-3-clause | 1,085 |
#!/usr/bin/python
import sys
import server
# Graph windowed bandwidth for all servers from the given data file
def GraphWindowedBandwidth(filename):
server_graph = server.ServerGraph()
fp = open(filename, 'r')
for line in fp:
[server1, server2, time, bandwidth] = line.split(' ')
server_gr... | sirikata/sirikata | scripts/graph/windowed_bandwidth.py | Python | bsd-3-clause | 753 |
# Refer to http://www.learnopencv.com/blob-detection-using-opencv-python-c/
# https://github.com/spmallick/learnopencv/blob/master/BlobDetector/blob.py
# Import is still cv2 when using OpenCV 3.0
import cv2
import numpy as np;
# Read image
imgFile = "blob.jpg"
im = cv2.imread(imgFile, cv2.IMREAD_GRAYSCALE)
# Setup... | ciauri/CoffeeRobot | imaging/blob_detector.py | Python | mit | 1,588 |
"""Linear structure features
This module provides an implementation of the orientated bins feature for
detecting breast ducts in mammograms.
Reference: Reyer Zwiggelaar, Tim C. Parr, and Christopher J. Taylor.
"Finding Orientated Line Patterns in Digital Mammographic Images." BMVC. 1996.
"""
import pandas as pd
imp... | samueljackson92/major-project | src/mia/features/linear_structure.py | Python | mit | 3,171 |
#
# This file is part of Healpy.
#
# Healpy 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.
#
# Healpy is distributed in the h... | pchanial/healpy | healpy/projaxes.py | Python | gpl-2.0 | 39,008 |
"""
Support for the voicerss speech service.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts.voicerss/
"""
import asyncio
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.const import CONF_API_KEY
from ... | eagleamon/home-assistant | homeassistant/components/tts/voicerss.py | Python | apache-2.0 | 5,042 |
from unittest.mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
from zerver.lib.webhooks.git import COMMITS_LIMIT
class GogsHookTests(WebhookTestCase):
STREAM_NAME = 'commits'
URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'gogs... | showell/zulip | zerver/webhooks/gogs/tests.py | Python | apache-2.0 | 11,619 |
"""
Django settings for roosterNotificationsWebsite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.jo... | okul1999/roosterNotificationsWebsite | roosterNotificationsWebsite/settings.py | Python | gpl-3.0 | 2,683 |
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the ... | Micronaet/micronaet-bom | lavoration_cl_sl_mrp/__openerp__.py | Python | agpl-3.0 | 1,541 |
from behave import *
from modules.bundle import Bundle
import json
@given('For bundles, I am connected to "{url}"')
def step_impl(context, url):
context.url = url
@when('For bundles, I request the URL "{endpoint}"')
def step_impl(context, endpoint):
context.endpoint = endpoint
@step('For bundles, I provide a... | monchitos82/shop | tests/features/steps/bundle.py | Python | bsd-2-clause | 1,036 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Forum on Courses',
'category': 'Hidden',
'version': '1.0',
'summary': 'Allows to link forum on a course',
'description': """A Slide channel can be linked to forum. Also, profiles from slide... | t3dev/odoo | addons/website_slides_forum/__manifest__.py | Python | gpl-3.0 | 707 |
# Copyright (c) 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 agreed to in writ... | rackerlabs/marconi | marconi/queues/storage/mongodb/controllers.py | Python | apache-2.0 | 1,339 |
import rendermanScene
| Black-Cog/BCnukeTools | core/__init__.py | Python | bsd-3-clause | 23 |
# Our friend Monk has an exam that has quite weird rules. Each question has a difficulty level in the form of an
# Integer. Now, Monk can only solve the problems that have difficulty level less than X . Now the rules are-
#
# Score of the student is equal to the maximum number of answers he/she has attempted without sk... | OmkarPathak/Python-Programs | CompetitiveProgramming/HackerEarth/DataStructures/Arrays/P02_Mark-The-Answer.py | Python | gpl-3.0 | 1,372 |
from __future__ import unicode_literals
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import MiddlewareNotUsed
from django.http import HttpResponse, Http404
from mezzanine.conf import settings
from mezzanine.pages import context_processors, page_processors
from mezzanine.pages.mo... | promil23/mezzanine | mezzanine/pages/middleware.py | Python | bsd-2-clause | 5,404 |
#!/usr/bin/env python
# Copyright (c) 2014 Arista Networks, Inc. All rights reserved.
# Arista Networks, Inc. Confidential and Proprietary.
import eossdk
import sys
# This is the python version of the HelloWorld.cpp program. See the
# explanation there, or a more detailed walkthrough at the GitHub wiki.
class Hell... | leopoul/EosSdk | examples/HelloWorld.py | Python | bsd-3-clause | 1,754 |
# 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... | wenwei202/terngrad | terngrad/inception/mnist_eval.py | Python | apache-2.0 | 1,561 |
import os
import datetime
from dataactcore.config import CONFIG_BROKER
from dataactcore.scripts import load_duns_exec_comp
from dataactcore.models.domainModels import DUNS
def test_load_duns(database):
""" Test a local run load duns with the test files """
sess = database.session
duns_dir = os.path.join(... | fedspendingtransparency/data-act-broker-backend | tests/unit/dataactbroker/test_duns.py | Python | cc0-1.0 | 14,712 |
from django.db import models
from django.core.exceptions import MultipleObjectsReturned
from expedient.clearinghouse.aggregate.models import Aggregate
from expedient.common.permissions.shortcuts import must_have_permission
from vt_plugin.models.VM import VM
# Virtualization Plugin class
class VtPlugin(Aggregate):
... | dana-i2cat/felix | expedient/src/python/plugins/vt_plugin/models/VtPlugin.py | Python | apache-2.0 | 3,112 |
# Recall is a program for storing bookmarks of different things
# Copyright (C) 2012 Cal Paterson
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | calpaterson/recall | src/server.py | Python | agpl-3.0 | 1,654 |
import os
from dktemplate.templatetags.dktemplate_tags import freevars
DIRNAME = os.path.dirname(__file__)
class Context(dict):
def __init__(self, *args, **kw):
super(Context, self).__init__(*args, **kw)
self.__dict__ = self
def test_freevars():
context = Context({
'dbg_template_na... | datakortet/dk-template | tests/test_template_tags.py | Python | mit | 520 |
import argparse
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.command.config import CmdConfig
from dvc.compare import TabularData
from dvc.config import ConfigError
from dvc.exceptions import DvcException
from dvc.types import Dict, List
from dvc.ui import ui
from dvc.utils import form... | dmpetrov/dataversioncontrol | dvc/command/machine.py | Python | apache-2.0 | 16,882 |
#!/usr/bin/env python3
# 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.
import re
import time
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestMcrouterToMcrouterTko(M... | facebook/mcrouter | mcrouter/test/test_mcrouter_to_mcrouter_tko.py | Python | mit | 1,294 |
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.Console import Console
from Screens.Standby import TryQuitMainloop
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Pixmap import Pixmap
from Tools.LoadPixmap import LoadPixmap
from Components.Label impor... | Ophiuchus1312/enigma2-master | lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py | Python | gpl-2.0 | 20,416 |
# 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 req... | paramite/blazar | climate/openstack/common/lockutils.py | Python | apache-2.0 | 12,049 |
from django.test import TestCase
from mozdns.soa.models import SOA
from mozdns.srv.models import SRV
from mozdns.txt.models import TXT
from mozdns.ptr.models import PTR
from mozdns.mx.models import MX
from mozdns.cname.models import CNAME
from mozdns.address_record.models import AddressRecord
from mozdns.nameserver.mo... | rtucker-mozilla/inventory | mozdns/mozbind/tests/dirty_soa.py | Python | bsd-3-clause | 6,724 |
# -*- coding: utf-8 -*-
""" Sahana Eden Fire Models
@copyright: 2009-2014 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without... | julianprabhakar/eden_car | modules/s3db/fire.py | Python | mit | 20,259 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-10-02 22:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foro', '0002_comentario_usuario'),
]
operations = [
migrations.AddField(
... | corumcorp/redsentir | redsentir/foro/migrations/0003_comentario_fecha.py | Python | gpl-3.0 | 453 |
# Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
import itertools
from oslo_log import log as logging
from coriolis import constants
from coriolis import exception
from coriolis.osmorphing.osmount import redhat
from coriolis.osmorphing.osmount import ubuntu
from coriolis.osmorphing.osmount import wind... | cloudbase/coriolis | coriolis/osmorphing/osmount/factory.py | Python | agpl-3.0 | 1,254 |
import datetime
from flask import Flask, Blueprint, request, Response, jsonify
import jwt
import database as db
import properties
from api import auth_decorator
auth_api = Blueprint('auth_api', __name__)
@auth_api.route('/api/auth/register', methods=['POST'])
@auth_decorator.register_validation
def register():
... | mtlevine0/scrapeit | api/auth_api.py | Python | mit | 2,905 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 VMware, Inc.
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack 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... | maoy/zknova | nova/virt/vmwareapi/vmops.py | Python | apache-2.0 | 63,434 |
# Copyright (C) 2014-2015 Codethink Limited
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but... | nuxeh/morph | morphlib/extensions.py | Python | gpl-2.0 | 9,249 |
# encoding: utf-8
import random
import time
from selenium import webdriver
class Connection(object):
def __init__(self):
super(Connection, self).__init__()
self.follows = []
def getstr(self):
result = "{\n \"followsID\": \n [\n"
if len(self.follows) == 0:
resu... | chenyang03/Dianping_Crawler | User_Crawler/dianping_u_follows_crawler.py | Python | mit | 2,088 |
#====================== BEGIN GPL LICENSE BLOCK ======================
#
# 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 vers... | cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/addons/rigify/rigs/finger.py | Python | gpl-3.0 | 15,346 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('location', '0007_add_panchayat_and_alter_subdistrict_fields'),
]
operations = [
migrations.AlterUniqueTogether(
... | PARINetwork/pari | location/migrations/0008_alter_unique_constraint.py | Python | bsd-3-clause | 454 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import gae_form as form
import model
# Commons Validators Expressions
vemail = form.regexp("^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*(.){1}[a-zA-Z]{2,4})+$", "Precisa ser um endereco de e-mail válido !.")
vdigito = form.regexp("\d+", "Precisa ser um di... | ProfessionalIT/customers | enveloprint/src/enveloprint/forms.py | Python | mit | 21,590 |
from __future__ import print_function
from setuptools import setup
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import io
import codecs
import os
import sys
# import master8
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
e... | smackesey/master8 | setup.py | Python | mit | 1,389 |
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to plot the results of a bisect run."""
from __future__ import absolute_import
from __future__ import print_function
import ... | catapult-project/catapult | experimental/plot_bisect_results.py | Python | bsd-3-clause | 4,470 |
# -*- coding: utf-8 -*-
import datetime
import os
import six
from .model_base import AccessControlledModel
from girder.constants import AccessType
from girder.exceptions import ValidationException
from girder.settings import SettingKey
from girder.utility.progress import noProgress
class Collection(AccessControlledM... | jbeezley/girder | girder/models/collection.py | Python | apache-2.0 | 16,266 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from functools import total_ordering
from opeNotes.sound import Sound, pitchNames
from opeNotes.octave import Octave
from opeNotes.interval import Interval, semitones
@total_ordering
class Pitch(object):
"""Represents class of music pitches.
Attrs:
sound (... | pt12lol/opeNotes | opeNotes/pitch.py | Python | gpl-3.0 | 7,277 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import matplotlib.cm as cm
import pylab
import pywt
Fs=2048
x = pylab.arange(0, 1, 1. / Fs)
#data = pylab.sin((5 * 50 * pylab.pi * x ** 2))
data = pylab.sin((100 * 2*pylab.pi * x**2))
wavelet = 'db4'
level = 4
order = "freq" # "normal"
interpolation = 'nearest'
cmap = ... | astroclark/bhextractor | patrec/wavelets/wp_scalogram.py | Python | gpl-2.0 | 1,614 |
# -*- coding: utf-8 -*-
"""
Created on Mar 03, 2015
@author: Tyranic-Moron
"""
import json
import random
from IRCMessage import IRCMessage
from IRCResponse import IRCResponse, ResponseType
from CommandInterface import CommandInterface
from Data.api_keys import load_key
from Utils import WebUtils
from twisted.words.... | Heufneutje/PyMoronBot | Commands/RedditImage.py | Python | mit | 2,501 |
# -*- coding: utf-8 -*-
# This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Foundation.... | sunshine027/iris-panel | iris/packagedb/views/scm.py | Python | gpl-2.0 | 2,713 |
#
# 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... | irinabov/debian-qpid-proton | python/proton/__init__.py | Python | apache-2.0 | 3,837 |
../../../../../share/pyshared/butterfly/channel/conference.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/butterfly/channel/conference.py | Python | gpl-3.0 | 61 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
import sh... | shoopio/shoop | shuup/customer_group_pricing/__init__.py | Python | agpl-3.0 | 1,143 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | gunan/tensorflow | tensorflow/python/distribute/distribute_lib_test.py | Python | apache-2.0 | 21,696 |
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | Nexenta/s3-tests | virtualenv/lib/python2.7/site-packages/boto/cognito/__init__.py | Python | mit | 1,123 |
#
# Copyright 2019 The FATE 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... | FederatedAI/FATE | examples/benchmark_quality/homo_sbt/gbdt-binary.py | Python | apache-2.0 | 2,478 |
#from __future__ import print_function
import random
import random_value_testing
import numpy as np
import content_based_tags
import collabFiltering_cross
import pymp
import copy
import dimreductionCollab
import collab_content_based_tags
import os
def cv(k):
folds = 8
trainData = []
with open('../train_data/invi... | jashwanth9/Expert-recommendation-system | code/allsvdpp.py | Python | apache-2.0 | 2,091 |
#Convert .tex file with equations into wikiText with multiple wikiText files for each equation
inFileName=raw_input("Input file name: ")
inFile=open(inFileName,"r")
for line in inFile:
if line[0]=="$":
#print ("equation found")
flag=False
string="<math>"
for char in line[1:]:
if char=="$":
... | DRMF/LaTeXML-Plugin-Expander | e2Wikis.py | Python | unlicense | 435 |
"""
Django settings for god project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# Build... | ekaradon/god-backend | god/settings.py | Python | apache-2.0 | 4,007 |
def unittest_test():
assert True == True
from nose.tools import assert_equals
def nosetest_test():
assert_equals(True, True)
from nose import with_setup
def setup_function():
global a
a = 5
def teardown_function():
global a
a = None
@with_setup(setup_function, teardown_function)
def test... | utecht/eve-rdf | tests/testtest.py | Python | gpl-2.0 | 354 |
#!/usr/bin/python
import numpy as np
def dp2(gapcost, S):
w = gapcost; (rows, cols) = S.shape
## init
dir = np.zeros((rows, cols), dtype=np.int32)
val = np.zeros((rows, cols), dtype=np.int32)
## decide matrix and path
for i in xrange(1, rows):
for j in xrange(1, cols):
D = ... | xulesc/algos | dp.py | Python | gpl-3.0 | 2,878 |
'''
Created on May 6, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
from devices.device import Device
import utilities.utilities as utilities
# Here are a list of .mp3 files that *should be* pre-installed o... | peoplepower/botlab | com.ppc.Bot/devices/pictureframe/pictureframe_peoplepower.py | Python | apache-2.0 | 11,660 |
class Solution(object):
def candy_2(self, ratings):
"""
:type ratings: List[int]
:rtype: int
"""
n = len(ratings)
cdy = [1,] * n
# climb from left -> right
v, p = 0, 0
while p < n:
# local min
v = p
... | sogapalag/problems | leetcode/135.Candy.py | Python | mit | 1,335 |
# -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | vrsys/avangong | avango-utils/tests/TestProximitySensor.py | Python | lgpl-3.0 | 1,844 |
from setuptools import setup, find_packages
version = '0.3.dev0'
setup(name='django-external-feed',
version=version,
description="Show content from an XML feed on your own site.",
long_description=open('README.rst').read() + '\n\n'+ open('CHANGES.rst').read(),
# Get strings from http://pypi.py... | nederhoed/django-external-feed | setup.py | Python | gpl-3.0 | 1,152 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | ovnicraft/openerp-restaurant | purchase/report/purchase_report.py | Python | agpl-3.0 | 6,538 |
import numpy as np
from ..simulation.sampling import rejection_sampling
__all__ = ['pdf', 'rvs']
def pdf(r, beta, alpha, eta):
""" Computes the probability density function (pdf) of a random variable
with Exponentiated Weibull distribution.
Parameters
----------
r : numpy.ndarray
Suppor... | mirca/fsopy | fsopy/distributions/exp_weibull.py | Python | mit | 2,292 |
from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(Account)
admin.site.register(Lesson)
admin.site.register(LessonTracker) | IhtishamShah/GamifiedLearningApp | Project/main/admin.py | Python | mit | 178 |
from functools import partial
from typing import List
from sanic.models.futures import FutureMiddleware
class MiddlewareMixin:
def __init__(self, *args, **kwargs) -> None:
self._future_middleware: List[FutureMiddleware] = []
def _apply_middleware(self, middleware: FutureMiddleware):
raise No... | channelcat/sanic | sanic/mixins/middleware.py | Python | mit | 2,008 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.