repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
garrettjonesgoogle/api-client-staging | refs/heads/master | generated/python/proto-google-cloud-monitoring-v3/google/cloud/proto/monitoring/v3/common_pb2_grpc.py | 83 | import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
|
robobrobro/ballin-octo-shame | refs/heads/master | lib/Python-3.4.3/Lib/lib2to3/pgen2/grammar.py | 88 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... |
bwbeach/ansible | refs/heads/devel | contrib/inventory/vbox.py | 55 | #!/usr/bin/env python
# This file is part of Ansible,
#
# Ansible 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.
#
# Ansible is distr... |
cledio66/pyglet | refs/heads/master | contrib/spryte/tests/test_rect.py | 29 | #!/usr/bin/env python
import unittest
import rect
class RectTest(unittest.TestCase):
def setUp(self):
self.r = rect.Rect(10, 10, 10, 10)
def test_top(self):
assert self.r.top == 20
self.r.top = 10
assert (self.r.x, self.r.y) == (10, 0)
def test_bottom(self):
asse... |
vjorlikowski/plexus | refs/heads/master | plexus/router.py | 1 | # Copyright (c) 2015 Duke University.
# This software is distributed under the terms of the MIT License,
# the text of which is included in this distribution within the file
# named LICENSE.
#
# Portions of this software are derived from the "rest_router" controller
# application included with Ryu (http://osrg.github.i... |
clolsonus/madesigner | refs/heads/master | tests/demo-spline.py | 2 | #!/usr/bin/env python
try:
import spline
except ImportError:
# if airfoil is not 'installed' append parent dir of __file__ to sys.path
import sys, os
sys.path.insert(0, os.path.abspath(os.path.split(os.path.abspath(__file__))[0]+'/../lib'))
import spline
points = ((0.0, 9.0), (5.0, 11.0), (10, 11.... |
itswindtw/pyMega | refs/heads/master | megadb/settings.py | 2 | import os
RELATIONS_PATH = 'relations' |
yavalvas/yav_com | refs/heads/master | build/matplotlib/doc/mpl_examples/pylab_examples/date_demo_rrule.py | 6 | #!/usr/bin/env python
"""
Show how to use an rrule instance to make a custom date ticker - here
we put a tick mark on every 5th easter
See https://moin.conectiva.com.br/DateUtil for help with rrules
"""
import matplotlib.pyplot as plt
from matplotlib.dates import YEARLY, DateFormatter, rrulewrapper, RRuleLocator, dran... |
boghison/servo | refs/heads/master | tests/wpt/web-platform-tests/referrer-policy/generic/tools/common_paths.py | 238 | import os, sys, json, re
script_directory = os.path.dirname(os.path.abspath(__file__))
generic_directory = os.path.abspath(os.path.join(script_directory, '..'))
template_directory = os.path.abspath(os.path.join(script_directory,
'..',
... |
grenade/password-store-fork | refs/heads/master | contrib/importers/revelation2pass.py | 36 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Emanuele Aina <em@nerd.ocracy.org>. All Rights Reserved.
# Copyright (C) 2011 Toni Corvera. All Rights Reserved.
# This file is licensed under the BSD 2-clause license:
# http://www.opensource.org/licenses/BSD-2-Clause
#
# Import script for the Revela... |
proxysh/Safejumper-for-Desktop | refs/heads/master | buildlinux/env32/lib/python2.7/site-packages/pycparser/ply/lex.py | 98 | # -----------------------------------------------------------------------------
# ply: lex.py
#
# Copyright (C) 2001-2015,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ar... |
rpedigoni/trackr | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('requirements.txt') as requirements_file:
requirements = requirements_file.read().split('\n')
with open('requirements_dev.txt') as requirements_dev_file:
... |
getstackd/stackd | refs/heads/master | vendor/boost-context/tools/build/v2/test/free_features_request.py | 44 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2007.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests that a free feature specified on the command line applies to all
# targets ever built.
import BoostBui... |
atmark-techno/atmark-dist | refs/heads/master | user/python/Tools/pynche/StripViewer.py | 3 | """Strip viewer and related widgets.
The classes in this file implement the StripViewer shown in the top two thirds
of the main Pynche window. It consists of three StripWidgets which display
the variations in red, green, and blue respectively of the currently selected
r/g/b color value.
Each StripWidget shows the c... |
jesseditson/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/builddir/gyptest-all.py | 185 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... |
jbosboom/opentuner | refs/heads/master | examples/py_api/api_example.py | 5 | #!/usr/bin/python
"""
Examples usage of a Python API interface to opentuner.
Unlike the other examples, this code lets the user control the main() of
the program and calls into opentuner to get new configurations to test.
"""
import adddeps # add opentuner to path in dev mode
import opentuner
from opentuner.api imp... |
zhuwenping/python-for-android | refs/heads/master | python3-alpha/extra_modules/bs4/testing.py | 46 | """Helper classes for tests."""
import copy
import functools
import unittest
from unittest import TestCase
from bs4 import BeautifulSoup
from bs4.element import (
Comment,
Doctype,
SoupStrainer,
)
from bs4.builder import HTMLParserTreeBuilder
default_builder = HTMLParserTreeBuilder
class SoupTest(unitte... |
arborworkflows/ProjectManager | refs/heads/master | tangelo/data_integrator_algorithm1.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 24 09:11:01 2013
@author: clisle
"""
# import utilities to exchange trees and matrices between APE/Geiger and Arbor
from tree_interchange import *
def InvokeDataIntegrator(tree_collection_name,tree_coll,matrix_collection_name,matrix_coll, out_tree_collection_name,verbo... |
gc313/Learning-Python | refs/heads/master | ui_npk.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'e:\Py_study\namepk\npk3.ui'
#
# Created: Mon Jan 5 19:21:11 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUt... |
benoitsteiner/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/autograph/converters/asserts.py | 6 | # Copyright 2016 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... |
mattrid93/ProjectEuler | refs/heads/master | probs/prob7.py | 1 | """Problem 7: 100001st prime.
Brute force again"""
import unittest
from utils.primes import is_prime
def nth_prime(n):
"""Returns nth prime"""
current = 1
primes = 0
while primes < n:
current += 1
if is_prime(current):
primes += 1
return current
class TestNthPrime(uni... |
erkanay/django | refs/heads/master | django/contrib/gis/maps/google/__init__.py | 158 | """
This module houses the GoogleMap object, used for generating
the needed javascript to embed Google Maps in a Web page.
Google(R) is a registered trademark of Google, Inc. of Mountain View, California.
Example:
* In the view:
return render_to_response('template.html', {'google' : GoogleMap(key="... |
sniemi/SamPy | refs/heads/master | sandbox/src1/examples/agg_resize.py | 1 | # test the resizing methods in the agg wrapper
import matplotlib.agg as agg
imMatrix = agg.trans_affine(1,0,0,1,0,0)
interp = agg.span_interpolator_linear(imMatrix);
|
DavidAndreev/indico | refs/heads/devel | indico/modules/events/registration/settings.py | 2 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
esmoyon1/GeonodeV1 | refs/heads/Branch1 | geonode/geoserver/context_processors.py | 15 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... |
jddixon/xlattice_py | refs/heads/master | src/xlattice/acceptor.py | 1 | # xlattice_py/xlattice/acceptor.py
"""
The XLattice Acceptor.
An Acceptor is used by a Node or Peer to accept connection requests.
It is an advertisement for a service within a Overlay, that is,
within a given address space and using a particular transport
protocol.
An Acceptor is an abstraction of a TCP/IP ServerSo... |
noba3/KoTos | refs/heads/master | addons/plugin.video.mega/resources/lib/platform_libraries/Linux/arm/Crypto/Hash/SHA512.py | 124 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... |
log2timeline/l2tscaffolder | refs/heads/main | l2tscaffolder/helpers/cli.py | 1 | # -*- coding: utf-8 -*-
"""Helper for command line functions."""
# This is the same class as: https://github.com/log2timeline/l2tdevtools/ \
# blob/master/l2tdevtools/review_helpers/cli.py
# TODO: Import the review helper directly instead of copy here once projects
# are merged.
import codecs
import locale
import loggi... |
shichao-an/ctci | refs/heads/master | chapter3/question3.6.py | 1 | from __future__ import print_function
class SortedStack(object):
def __init__(self):
self.stack = []
self.aux_stack = []
def push(self, data):
while self.stack and self.stack[-1] > data:
self.aux_stack.append(self.stack.pop())
self.stack.append(data)
while ... |
SurfasJones/djcmsrc3 | refs/heads/master | venv/lib/python2.7/site-packages/cms/migrations/0031_improved_language_code_support.py | 525 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... |
ParadropLabs/Paradrop | refs/heads/master | tools/pdtools/pdtools/cloud.py | 1 | import getpass
import platform
import re
import builtins
import click
from . import util
from .controller_client import ControllerClient
@click.group('cloud')
@click.pass_context
def root(ctx):
"""
Access services provided by a cloud controller.
By default the cloud controller is assumed to be paradrop... |
vitmod/enigma2 | refs/heads/wetek | lib/python/Screens/Recordings.py | 20 | from Screens.Screen import Screen
from Screens.Setup import setupdom
from Screens.LocationBox import MovieLocationBox
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Components.config import config, configfile, ConfigYesNo, ConfigNothing, ConfigSelection, getConfigListEntry
from Compon... |
Workday/OpenFrame | refs/heads/master | tools/telemetry/telemetry/internal/actions/wait.py | 39 | # Copyright 2012 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.
from telemetry.internal.actions import page_action
class WaitForElementAction(page_action.PageAction):
def __init__(self, selector=None, text=None, eleme... |
daavery/audacity | refs/heads/master | lib-src/lv2/serd/waflib/Tools/c_tests.py | 330 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature,before_method,after_method
import sys
LIB_CODE='''
#ifdef _MSC_VER
#define testEXP... |
chrishas35/django-travis-ci | refs/heads/master | django/conf/locale/es/formats.py | 100 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \d\e F \d\e... |
BaconPancakes/valor | refs/heads/master | lib/youtube_dl/extractor/clubic.py | 64 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
qualities,
)
class ClubicIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html'
_TESTS = [{
'url': 'http://www.... |
dropbox/changes | refs/heads/master | changes/testutils/helpers.py | 1 | from contextlib import contextmanager
from flask import current_app
from functools import wraps
from mock import patch
from changes.config import queue
from changes.queue.task import TooManyRetries
def eager_tasks(func):
@wraps(func)
# prevent retries due to recursion issues
def wrapped(*args, **kwargs):... |
neurodebian/htcondor | refs/heads/master | src/python-bindings/tests/event_tests.py | 2 |
import os
import time
import unittest
import threading
import classad
import htcondor
SAMPLE_EVENT_TEXT = """\
006 (23515.000.000) 04/09 17:55:39 Image size of job updated: 260
1 - MemoryUsage of job (MB)
252 - ResidentSetSize of job (KB)
...
"""
class TestEventReader(unittest.TestCase):
de... |
Agent007/deepchem | refs/heads/master | examples/binding_pockets/binding_pocket_rf.py | 6 | """
Script that trains Sklearn RF models on PDBbind Pockets dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "Bharath Ramsundar"
__copyright__ = "Copyright 2017, Stanford University"
__license__ = "MIT"
import os
import deepchem as... |
gangadhar-kadam/verve_live_erp | refs/heads/v5.0 | erpnext/hr/doctype/expense_claim_detail/__init__.py | 37694 | from __future__ import unicode_literals
|
vmax-feihu/hue | refs/heads/master | desktop/core/ext-py/pyasn1-0.1.8/test/type/test_constraint.py | 53 | from pyasn1.type import constraint, error
from pyasn1.error import PyAsn1Error
from sys import version_info
if version_info[0:2] < (2, 7) or \
version_info[0:2] in ( (3, 0), (3, 1) ):
try:
import unittest2 as unittest
except ImportError:
import unittest
else:
import unittest
class Single... |
fangxingli/hue | refs/heads/master | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/drawing/effect.py | 13 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
String,
Set,
Bool,
Integer,
NoneSet,
Float,)
from .colors import ColorChoice
class TintEffect(Serialisable):
... |
dstufft/sqlalchemy | refs/heads/master | lib/sqlalchemy/event/registry.py | 60 | # event/registry.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides managed registration services on behalf of :func:`.listen`
arguments.
... |
huiren/ece511 | refs/heads/master | ext/ply/example/ansic/cparse.py | 164 | # -----------------------------------------------------------------------------
# cparse.py
#
# Simple parser for ANSI C. Based on the grammar in K&R, 2nd Ed.
# -----------------------------------------------------------------------------
import sys
import clex
import ply.yacc as yacc
# Get the token map
tokens = cl... |
bratsche/Neutron-Drive | refs/heads/master | google_appengine/lib/django_1_2/tests/regressiontests/context_processors/tests.py | 50 | """
Tests for Django's bundled context processors.
"""
from django.conf import settings
from django.contrib.auth import authenticate
from django.db.models import Q
from django.test import TestCase
from django.template import Template
class RequestContextProcessorTests(TestCase):
"""
Tests for the ``django.cor... |
saurabh6790/omn-app | refs/heads/master | accounts/report/purchase_register/purchase_register.py | 29 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
from webnotes import msgprint, _
def execute(filters=None):
if not filters: filters = {}
invoice_l... |
ruchee/vimrc | refs/heads/master | vimfiles/bundle/vim-python/submodules/pylint/tests/extensions/data/docstring.py | 2 | """Checks of Dosctrings 'docstring-first-line-empty' 'bad-docstring-quotes'"""
def check_messages(*messages):
"""
docstring"""
return messages
def function2():
"""Test Ok"""
class FFFF:
"""
Test Docstring First Line Empty
"""
def method1(self):
'''
Test Triple Single... |
WSDC-NITWarangal/django | refs/heads/master | tests/lookup/tests.py | 153 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import Article, ... |
batazor/MyExampleAndExperiments | refs/heads/master | Python/odoo_worker_tracking/test/odoo_worker_tracking/__init__.py | 7 | # -*- coding: utf-8 -*-
from . import models
from . import controllers
|
seecr/meresco-distributed | refs/heads/master | test/remarkstest.py | 1 | ## begin license ##
#
# "Meresco Distributed" has components for group management based on "Meresco Components."
#
# Copyright (C) 2015 Koninklijke Bibliotheek (KB) http://www.kb.nl
# Copyright (C) 2015-2016, 2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2021 Data Archiving and Network Services https:... |
VentureCranial/system-status-dashboard | refs/heads/master | ssd/wsgi.py | 1 | #
# Copyright 2013 - Tom Alessi
#
# 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 writin... |
SINGROUP/pycp2k | refs/heads/master | pycp2k/classes/_torsion1.py | 1 | from pycp2k.inputsection import InputSection
class _torsion1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Atoms = None
self.Kind = None
self.K = None
self.Phi0 = None
self.M = None
self._name = "TORSION"
self._keywords = {'Atom... |
yawnosnorous/python-for-android | refs/heads/master | python3-alpha/extra_modules/bs4/tests/test_tree.py | 46 | # -*- coding: utf-8 -*-
"""Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
me... |
boneyao/sentry | refs/heads/master | tests/sentry/tasks/test_beacon.py | 12 | from __future__ import absolute_import, print_function
import json
import sentry
from mock import patch
from sentry import options
from sentry.testutils import TestCase
from sentry.tasks.beacon import BEACON_URL, send_beacon
class SendBeaconTest(TestCase):
@patch('sentry.tasks.beacon.safe_urlopen')
@patch(... |
ngoix/OCRF | refs/heads/master | examples/model_selection/plot_roc_crossval.py | 37 | """
=============================================================
Receiver Operating Characteristic (ROC) with cross validation
=============================================================
Example of Receiver Operating Characteristic (ROC) metric to evaluate
classifier output quality using cross-validation.
ROC curv... |
michael-donat/ansible | refs/heads/devel | test/units/playbook/test_play_context.py | 26 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/isy994/__init__.py | 7 | """Support the ISY-994 controllers."""
import asyncio
from functools import partial
from typing import Optional
from urllib.parse import urlparse
from pyisy import ISY
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeass... |
mdublin/Brightcove-Dynamic-Ingest-App | refs/heads/master | ENV/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py | 102 | '''SSL with SNI-support for Python 2.
This needs the following packages installed:
* pyOpenSSL (tested with 0.13)
* ndg-httpsclient (tested with 0.3.2)
* pyasn1 (tested with 0.1.6)
To activate it call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3`.
This can be done in a ``sitecustomize`` module, or at any ot... |
LaoZhongGu/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/idlelib/ScrolledList.py | 67 | from tkinter import *
class ScrolledList:
default = "(None)"
def __init__(self, master, **options):
# Create top frame, with scrollbar and listbox
self.master = master
self.frame = frame = Frame(master)
self.frame.pack(fill="both", expand=1)
self.vbar = vbar = Scrollba... |
christianmemije/kolibri | refs/heads/master | kolibri/tasks/api.py | 1 | import logging as logger
import os
from django.apps.registry import AppRegistryNotReady
from django.conf import settings
from django.core.management import CommandError, call_command
from iceqube.common.classes import State
from iceqube.exceptions import UserCancelledError
from kolibri.content.permissions import CanMa... |
jesonyang001/qarepo | refs/heads/master | askbot/utils/decorators.py | 1 | import hotshot
import time
import os
import datetime
import functools
import inspect
import logging
from django.conf import settings
from django.core import exceptions as django_exceptions
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRe... |
tunneln/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/test/test_subprocess.py | 7 | import unittest
from test import test_support
import subprocess
import sys
import signal
import os
import errno
import tempfile
import time
import re
import sysconfig
try:
import resource
except ImportError:
resource = None
mswindows = (sys.platform == "win32")
#
# Depends on the following external programs:... |
amchagas/python-neo | refs/heads/master | neo/io/pynnio.py | 2 | # -*- coding: utf-8 -*-
"""
Module for reading/writing data from/to legacy PyNN formats.
PyNN is available at http://neuralensemble.org/PyNN
Classes:
PyNNNumpyIO
PyNNTextIO
Supported: Read/Write
Authors: Andrew Davison, Pierre Yger
"""
import numpy
import quantities as pq
from neo.io.baseio import BaseIO
... |
mKeRix/home-assistant | refs/heads/dev | homeassistant/components/environment_canada/camera.py | 5 | """Support for the Environment Canada radar imagery."""
import datetime
import logging
from env_canada import ECRadar
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAM... |
bobcyw/django | refs/heads/master | tests/gis_tests/test_geoforms.py | 292 | from unittest import skipUnless
from django.contrib.gis import forms
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.forms import ValidationError
from django.test import SimpleTestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.html imp... |
evanthebouncy/nnhmm | refs/heads/master | battleship_lstm_policy/active_learning.py | 3 | from model import *
# ------------------------------------------------------------------ helpers and mgmt
def get_feed_dic_obs(obs):
# needing to create all the nessisary feeds
obs_x = []
obs_y = []
obs_tf = []
for _ in range(OBS_SIZE):
obs_x.append(np.zeros([N_BATCH,L]))
obs_y.append(np.zeros([N_... |
intgr/django | refs/heads/master | django/core/files/utils.py | 20 | class FileProxyMixin:
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
"""
encoding = property(lambda sel... |
m42e/tvnamer | refs/heads/master | tests/test_fileparse_api.py | 1 | #!/usr/bin/env python
"""Tests the FileParser API
"""
from tvnamer.utils import FileParser, EpisodeInfo, DatedEpisodeInfo, NoSeasonEpisodeInfo
from helpers import assertType, assertEquals
def test_episodeinfo():
"""Parsing a s01e01 episode should return EpisodeInfo class
"""
p = FileParser("scrubs.s01e0... |
AOSPU/external_chromium_org_tools_gyp | refs/heads/android-5.0/py3 | test/mac/gyptest-prefixheader.py | 249 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that GCC_PREFIX_HEADER works.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=['... |
Mad31/ISN | refs/heads/master | commbot.py | 1 | #! /usr/bin/env Python
# -*- coding: utf-8 -*-
import nxt.locator
from nxt.motor import *
import sys
from time import *
from nxt.sensor import *
import Tkinter
def rechercher_brique(nom_brick) :
""" cherche la brique"""
try :
brick=nxt.locator.find_one_brick(name=nom_brick)
""" tourve la brique"""... |
TeamExodus/external_chromium_org | refs/heads/EXODUS-5.1 | tools/telemetry/telemetry/unittest/simple_mock_unittest.py | 33 | # Copyright 2012 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.
import unittest
from telemetry.unittest import simple_mock
_ = simple_mock.DONT_CARE
class SimpleMockUnitTest(unittest.TestCase):
def testBasic(self):
... |
barachka/odoo | refs/heads/master | addons/l10n_in/__init__.py | 702 | # -*- 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... |
pixelated/pixelated-user-agent | refs/heads/master | service/pixelated/resources/auth.py | 2 | #
# Copyright (c) 2016 ThoughtWorks, Inc.
#
# Pixelated 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
# (at your option) any later version.
#
# Pixelated is distrib... |
ivancrneto/hip2slack-emoji | refs/heads/master | setup.py | 1 | # coding: utf-8
from setuptools import setup
from setuptools.command.test import test as TestCommand
import codecs
import io
import os
import sys
import hip2slack_emoji
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
return codecs.open(os.path.join(here, *parts), 'r').read()
long_descriptio... |
mattcaldwell/wagtail | refs/heads/master | wagtail/wagtailsearch/backends/__init__.py | 3 | # Backend loading
# Based on the Django cache framework
# https://github.com/django/django/blob/5d263dee304fdaf95e18d2f0619d6925984a7f02/django/core/cache/__init__.py
try:
from importlib import import_module
except ImportError:
# for Python 2.6, fall back on django.utils.importlib (deprecated as of Django 1.7)... |
matthewtownson/soapy | refs/heads/master | soapy/pyqtgraph/WidgetGroup.py | 34 | # -*- coding: utf-8 -*-
"""
WidgetGroup.py - WidgetGroup class for easily managing lots of Qt widgets
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
This class addresses the problem of having to save and restore the state
of a large group of widgets.
"""
from... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | openerp/addons/project/wizard/__init__.py | 55 | # -*- 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... |
equialgo/scikit-learn | refs/heads/master | sklearn/covariance/shrunk_covariance_.py | 8 | """
Covariance estimators using shrinkage.
Shrinkage corresponds to regularising `cov` using a convex combination:
shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile ... |
jskew/gnuradio | refs/heads/master | gr-qtgui/apps/plot_spectrogram_form.py | 47 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... |
sivel/ansible | refs/heads/devel | test/units/module_utils/basic/test_tmpdir.py | 35 | # -*- coding: utf-8 -*-
# Copyright (c) 2018 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import shutil
import te... |
oasiswork/odoo | refs/heads/8.0 | openerp/addons/test_impex/__openerp__.py | 361 | # -*- coding: utf-8 -*-
{
'name': 'test-import-export',
'version': '0.1',
'category': 'Tests',
'description': """A module to test import/export.""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': ['ir.model.access... |
jbuchbinder/youtube-dl | refs/heads/master | youtube_dl/extractor/ivi.py | 12 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
)
class IviIE(InfoExtractor):
IE_DESC = 'ivi.ru'
IE_NAME = 'ivi'
_VALID_URL = r'https?://(?:www\.)?ivi\.ru/(?:watch/(?... |
stevend12/SolutioCpp | refs/heads/master | Library/Utilities/fftw++-2.05/wrappers/pexample.py | 2 | #!/usr/bin/python
import sys
import numpy as np
import fftwpp
import ctypes
print "Example of calling fftw++ convolutions from python:"
nthreads = 2
fftwpp.fftwpp_set_maxthreads(nthreads)
N = 8
def init(f, g):
k = 0
while k < len(f) :
f[k] = np.complex(k, k + 1)
g[k] = np.complex(k, 2 * k +... |
nroth0815/Reboot | refs/heads/master | Fkernels.py | 1 | import numpy as np
import time
#import pynbody
class Kern(object):
def f(self, ik,jk,lk, iq,jq,lq, eps=1e-16):
k=np.array([ik,jk,lk])
q=np.array([iq,jq,lq])
p=k-q
#value=0.5*(ik*ik+jk*jk+lk*lk)/( (iq*iq+jq*jq+lq*lq)+eps ) * np.dot(q,k-q)/ (np.dot(k-q,k-q) +eps)
value=0.5*np.linalg.nor... |
woutersmet/Zeo_thesis | refs/heads/master | share/plugins/basic/help.py | 2 | # Zeobuilder is an extensible GUI-toolkit for molecular model construction.
# Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center
# for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights
# reserved unless otherwise stated.
#
# This file is part of Zeobuilder.
#
# Zeobuilde... |
edx/ecommerce-api-client | refs/heads/master | edx_rest_api_client/exceptions.py | 2 | # noinspection PyUnresolvedReferences
from requests.exceptions import Timeout # pylint: disable=unused-import
from slumber.exceptions import * # pylint: disable=wildcard-import
|
ofenerci/Pocket-Science-Lab | refs/heads/master | Test-Programs/Anemometer-Speed-magneticpickup.py | 2 | '''
Connect pickup coil to A1 and Fit the sine wave for getting frequency.
From frequency of rotation of anemometer wind speed can be calculated
'''
import gettext
gettext.bindtextdomain("expeyes")
gettext.textdomain('expeyes')
_ = gettext.gettext
import expeyes.eyemath as em
p = expeyes.eyesj.open()
t,v= p.capture(1... |
raychorn/rackspace-developer-test | refs/heads/master | q2/q2.py | 1 | import os, sys
def justify_phrase(phrase,width):
__is__ = True
while (__is__):
phrase = phrase.strip()
__words__ = phrase.split()
num_spaces = width - len(phrase)
if (num_spaces > 0) and (len(__words__) > 1):
for i in xrange(1 if ( (len(__words__) > 1) and (num_spaces > (len(__words__)/2) ) )... |
amiramix/rsted | refs/heads/master | flaskext/__init__.py | 342 | __import__('pkg_resources').declare_namespace(__name__) |
google/floq-client | refs/heads/main | test/__init__.py | 4 | # Copyright 2021 The Floq 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
greenfire27/Torque2D | refs/heads/master | engine/source/testing/googleTest/scripts/fuse_gtest_files.py | 2577 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# 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... |
davidoren/CuckooSploit | refs/heads/master | modules/processing/virustotal.py | 6 | # Copyright (C) 2010-2015 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import json
import urllib
import urllib2
from lib.cuckoo.common.abstracts import Processing
from lib.cuckoo.common.exceptions import CuckooP... |
saydulk/horizon | refs/heads/master | horizon/base.py | 8 | # 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... |
davinwang/caffe2 | refs/heads/master | caffe2/contrib/nccl/nccl_ops_test.py | 4 | # Copyright (c) 2016-present, Facebook, 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... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/test/test_sqlite.py | 19 | from test.test_support import run_unittest, TestSkipped
import unittest
try:
import _sqlite3
except ImportError:
raise TestSkipped('no sqlite available')
from sqlite3.test import (dbapi, types, userfunctions,
factory, transactions, hooks, regression)
def test_main():
run_un... |
christianurich/VIBe2UrbanSim | refs/heads/master | 3rdparty/opus/src/washtenaw/building/aliases.py | 2 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
aliases = [
"large_area_id = building.disaggregate(parcel.large_area_id)",
"number_of_home_based_jobs = building.aggregate(job.home_based_status==1)",
"number_of_non_home_based_jobs =... |
40223125/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/collections/__init__.py | 625 | #__all__ = ['deque', 'defaultdict', 'Counter']
from _collections import deque, defaultdict
#from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
'UserString', 'Counter', 'OrderedDict']
# For bootstrapping re... |
erjohnso/ansible | refs/heads/devel | test/units/executor/test_playbook_executor.py | 119 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
hsluo/youtube-dl | refs/heads/master | youtube_dl/extractor/wimp.py | 65 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .youtube import YoutubeIE
class WimpIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?wimp\.com/([^/]+)/'
_TESTS = [{
'url': 'http://www.wimp.com/maruexhausted/',
'md5': 'f1acced123ecb28d9bb79f2479f2b6a... |
colinmcglone/window-time | refs/heads/master | marketgrab/migrations/0015_movingavg_span.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-08 20:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('marketgrab', '0014_auto_20160108_1130'),
]
operations = [
migrations.AddFiel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.