repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Tatsh/youtube-dl | refs/heads/master | youtube_dl/extractor/kaltura.py | 3 | # coding: utf-8
from __future__ import unicode_literals
import re
import base64
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_parse_qs,
)
from ..utils import (
clean_html,
ExtractorError,
int_or_none,
unsmuggle_url,
smuggle_url,
)
class KalturaIE(InfoEx... |
nashmit/GMolModel | refs/heads/master | extra_tools/analyzeAlkans.py | 2 | import sys, os, glob
import numpy as np
import argparse
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
# Return a tuple indicating if Fixman potential or torque is present
def FPFTLabel(inpString):
try:
if inpString.find('NFPNFT') >... |
cernops/ceilometer | refs/heads/master | ceilometer/cmd/eventlet/alarm.py | 9 | # -*- encoding: utf-8 -*-
#
# Copyright 2014 OpenStack Foundation
#
# 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 ap... |
echochamber/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py | 241 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... |
louismerlin/merlin-hub | refs/heads/master | hub/multim/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(prim... |
zuku1985/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_pca.py | 14 | import numpy as np
import scipy as sp
from itertools import product
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_gre... |
FedeRez/webldap | refs/heads/master | app/webldap/local_settings.sample.py | 1 | DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3'.
'NAME': '', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', ... |
rubinovitz/project-x | refs/heads/master | boilerplate/lib/i18n.py | 27 | import re
import logging
from google.appengine.api.urlfetch_errors import DownloadError
from google.appengine.api import urlfetch
from webapp2_extras import i18n
from babel import Locale
def parse_accept_language_header(string, pattern='([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?'):
"""
... |
anishnarang/gswift | refs/heads/master | swift/container/updater.py | 13 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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... |
suhe/odoo | refs/heads/master | openerp/report/printscreen/ps_form.py | 49 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import openerp
from openerp.report.interface import report_int
import openerp.tools as tools
from openerp.report import render
from lxml import etree
import time, os
class report_printscreen_list(report_int):
def... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/social/storage/sqlalchemy_orm.py | 53 | """SQLAlchemy models for Social Auth"""
import base64
import six
import json
try:
import transaction
except ImportError:
transaction = None
from sqlalchemy import Column, Integer, String
from sqlalchemy.exc import IntegrityError
from sqlalchemy.types import PickleType, Text
from sqlalchemy.schema import Uniqu... |
M4573R/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | refs/heads/master | Chapter5_LossFunctions/draw_sky2.py | 93 | import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import numpy as np
def draw_sky( galaxies ):
"""adapted from Vishal Goklani"""
size_multiplier = 45
fig = plt.figure(figsize=(10,10))
#fig.patch.set_facecolor("blue")
ax = fig.add_subplot(111, aspect='equal')
n = galaxies.sh... |
nhorelik/openmc | refs/heads/develop | tests/test_source_point/results.py | 107 | #!/usr/bin/env python
import sys
# import statepoint
sys.path.insert(0, '../../src/utils')
import statepoint
# read in statepoint file
if len(sys.argv) > 1:
sp = statepoint.StatePoint(sys.argv[1])
else:
sp = statepoint.StatePoint('statepoint.10.binary')
sp.read_results()
# set up output string
outstr = ''
... |
toa5/libgdx | refs/heads/master | extensions/gdx-freetype/jni/freetype-2.6.2/src/tools/docmaker/tohtml.py | 55 | #
# tohtml.py
#
# A sub-class container of the `Formatter' class to produce HTML.
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use, mo... |
MattsFleaMarket/python-for-android | refs/heads/master | python-modules/twisted/twisted/internet/__init__.py | 69 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted Internet: Asynchronous I/O and Events.
Twisted Internet is a collection of compatible event-loops for Python. It contains
the code to dispatch events to interested observers and a portable API so that
observers need not care... |
rogueleaderr/definitive_guide_to_django_deployment_2 | refs/heads/master | src/example/settings.py | 2 | # Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', ... |
bretlowery/snakr | refs/heads/master | lib/django/contrib/auth/tests/custom_user.py | 463 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom User uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... |
aniketmaithani/kimani-adserver | refs/heads/master | tests/factories.py | 1 | # -*- coding: utf-8 -*-
# Third Party Stuff
import factory
from django.conf import settings
class Factory(factory.DjangoModelFactory):
class Meta:
strategy = factory.CREATE_STRATEGY
model = None
abstract = True
class UserFactory(Factory):
class Meta:
model = settings.AUTH_US... |
RackSec/ansible | refs/heads/devel | lib/ansible/plugins/action/win_reboot.py | 108 | # (c) 2016, Matt Davis <mdavis@ansible.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) any later version... |
MartinSavc/scikit-learn | refs/heads/master | examples/manifold/plot_mds.py | 261 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... |
kmoocdev/edx-platform | refs/heads/kmooc.rc0 | common/test/acceptance/tests/lms/test_lms.py | 6 | # -*- coding: utf-8 -*-
"""
End-to-end tests for the LMS.
"""
from textwrap import dedent
from unittest import skip
from nose.plugins.attrib import attr
from bok_choy.promise import EmptyPromise
from bok_choy.web_app_test import WebAppTest
from ..helpers import (
UniqueCourseTest,
load_data_str,
generate_... |
mpac/glyphmeme | refs/heads/master | glyphmeme/apps/core/models.py | 1 | # Copyright 2013, Michael Pacchioli.
#
# This file is part of GlyphMeme.
#
# GlyphMeme is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 3,
# as published by the Free Software Foundation.
#
# GlyphMeme is distributed in the hope that it will be u... |
renyi533/tensorflow | refs/heads/master | tensorflow/python/tpu/async_checkpoint.py | 9 | # 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... |
havard024/prego | refs/heads/master | crm/lib/python2.7/site-packages/unidecode/x0a4.py | 252 | data = (
'qiet', # 0x00
'qiex', # 0x01
'qie', # 0x02
'qiep', # 0x03
'quot', # 0x04
'quox', # 0x05
'quo', # 0x06
'quop', # 0x07
'qot', # 0x08
'qox', # 0x09
'qo', # 0x0a
'qop', # 0x0b
'qut', # 0x0c
'qux', # 0x0d
'qu', # 0x0e
'qup', # 0x0f
'qurx', # 0x10
'qur', # 0x11
... |
babyliynfg/cross | refs/heads/master | tools/project-creator/Python2.6.6/Lib/encodings/big5hkscs.py | 61 | #
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_hk, codecs
import _multibytecodec as mbc
codec = _codecs_hk.getcodec('big5hkscs')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... |
Kongsea/tensorflow | refs/heads/master | tensorflow/contrib/opt/python/training/nadam_optimizer_test.py | 58 | # Copyright 2015 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... |
c22n/ion-channel-ABC | refs/heads/master | docs/examples/hl1/experiments/ito_markov.py | 1 | import data.ito.data_ito as data
import numpy as np
from ionchannelABC.experiment import Experiment
from ionchannelABC.protocol import availability
import myokit
import warnings
import scipy.optimize as so
# Q10 [Kiyosue1993] from iK currents (may not be VALID!)
Q10_cond = 4.4
Q10_tau = 4.1
room_temp = 296
#
# IV c... |
loicbaron/nutrition | refs/heads/master | import_data/mysql-connector-python-2.1.6/lib/mysql/connector/django/base.py | 19 | # MySQL Connector/Python - MySQL driver written in Python.
"""Django database Backend using MySQL Connector/Python
This Django database backend is heavily based on the MySQL backend coming
with Django.
Changes include:
* Support for microseconds (MySQL 5.6.3 and later)
* Using INFORMATION_SCHEMA where possible
* Usi... |
smokorg/termite-platform | refs/heads/master | termite/__main__.py | 1 | __author__ = 'pavle'
from .platformctl import ctl_main
ctl_main()
|
eJRF/ejrf | refs/heads/master | questionnaire/views/home.py | 1 | from django.db.models import Q
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.views.generic import View
from django.core.urlresolvers import reverse
from braces.views import MultiplePermissionsRequiredMixin
from questionnaire.models import Questionnaire, Answer
from questi... |
cypsun/FreeCAD | refs/heads/master | src/3rdParty/Pivy/coin.py | 19 | null |
zhukaixy/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/crashers/bogus_code_obj.py | 189 | """
Broken bytecode objects can easily crash the interpreter.
This is not going to be fixed. It is generally agreed that there is no
point in writing a bytecode verifier and putting it in CPython just for
this. Moreover, a verifier is bound to accept only a subset of all safe
bytecodes, so it could lead to unnecessa... |
kgori/treeCl | refs/heads/master | treeCl/concatenation.py | 1 | from .alignment import Alignment
from .tasks import TreeCollectionTaskInterface
from .utils.decorators import lazyprop
from .utils import concatenate, fileIO
from Bio import AlignIO
__author__ = 'kgori'
class Concatenation(object):
"""docstring for Concatenation"""
def __init__(self, collection, indices):
... |
ajaybhatia/archlinux-dotfiles | refs/heads/master | Scripts/chromium2dwb.py | 1 | #! /usr/bin/env python
# converts Chromium bookmarks (usually in '~/.config/chromium/<profile>/Bookmarks') to format suitable for dwb
import json
import sys
def parse(js):
if "url" in js.keys():
print("%s %s" % (js["url"], js["name"]))
return
if "children" in js.keys():
for child in ... |
quinot/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_interface_policy_port_security.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
kromain/chromium-tools | refs/heads/master | third_party/logilab/astng/inference.py | 15 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2010 Sylvain Thenault, all rights reserved.
# contact mailto:thenault@gmail.com
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redi... |
googlegenomics/gcp-variant-transforms | refs/heads/master | gcp_variant_transforms/beam_io/bgzf_io_test.py | 1 | # Copyright 2019 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 agreed to in writing,... |
vasili-v/actuator | refs/heads/master | test/test__utils.py | 1 | import unittest
from actuator._utils import _initialize_class
class Test_Utils(unittest.TestCase):
def test__initialize_class(self):
checkpoints = {'init': False, 'self': None}
class Test(object):
def __init__(self):
checkpoints['init'] = True
checkpoint... |
mbayon/TFG-MachineLearning | refs/heads/master | venv/lib/python3.6/site-packages/numpy/distutils/tests/test_system_info.py | 13 | from __future__ import division, print_function
import os
import shutil
from tempfile import mkstemp, mkdtemp
from subprocess import Popen, PIPE
from distutils.errors import DistutilsError
from numpy.distutils import ccompiler
from numpy.testing import TestCase, run_module_suite, assert_, assert_equal
from numpy.test... |
2014c2g5/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/dom/expatbuilder.py | 733 | """Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
"""
# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations. This
# is due... |
jiachenning/odoo | refs/heads/8.0 | addons/stock_picking_wave/controllers/__init__.py | 2262 | import main |
leliel12/scikit-otree | refs/heads/master | ez_setup.py | 18 | #!/usr/bin/env python
"""
Setuptools bootstrapping installer.
Run this script to install or upgrade setuptools.
"""
import os
import shutil
import sys
import tempfile
import zipfile
import optparse
import subprocess
import platform
import textwrap
import contextlib
import warnings
from distutils import log
try:
... |
jusdng/odoo | refs/heads/8.0 | addons/account/report/account_general_journal.py | 381 | # -*- 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... |
Ander-Alvarez/UltraPluscondor | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
gkmngrgn/radpress | refs/heads/master | radpress/south_migrations/0006_zen_mode_integration.py | 3 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from radpress.readers import get_reader
class Migration(DataMigration):
no_dry_run = True
def forwards(self, orm):
reader = get_reader()
model_names = ['radpress.Art... |
mats116/gae-boilerplate | refs/heads/master | bp_content/themes/__init__.py | 88 | __author__ = '@coto'
|
PyDev777/studentsdb | refs/heads/master | students/templatetags/pagenav.py | 1 | from django import template
register = template.Library()
# Usage: {% pagenav object_list=students base_url=students_url order_by=order_by reverse=reverse cur_month=cur_month is_paginated=is_paginated paginator=paginator %}
@register.inclusion_tag('students/pagination.html')
def pagenav(object_list, base_url, order... |
2014c2g19/2014c2g19 | refs/heads/master | exts/setup.py | 63 | from setuptools import setup
setup(name='YourAppName',
version='1.0',
description='OpenShift App',
author='Your Name',
author_email='example@example.com',
url='http://www.python.org/sigs/distutils-sig/',
install_requires=['CherryPy'],
)
|
zhushun0008/sms-tools | refs/heads/master | lectures/04-STFT/plots-code/hanning.py | 24 | import matplotlib.pyplot as plt
import numpy as np
from scipy.fftpack import fft
M = 64
N = 512
hN = N/2
hM = M/2
fftbuffer = np.zeros(N)
mX1 = np.zeros(N)
plt.figure(1, figsize=(7.5, 3.5))
fftbuffer[hN-hM:hN+hM]=np.hanning(M)
plt.subplot(2,1,1)
plt.plot(np.arange(-hN, hN), fftbuffer, 'b', lw=1.5)
plt.axis([-hN,... |
janebeckman/gpdb | refs/heads/master | gpMgmt/bin/gpconfig_modules/parse_guc_metadata.py | 23 | import errno
import os
import re
import sys
# this finds all instances of a property name that is both surrounded with quotes and is adjacent
# to the metadata "GUC_DISALLOW_IN_FILE", where adjacent means not separated by a closing } bracket,
# assuming all the separate lines have been combined together into one strin... |
baslr/ArangoDB | refs/heads/3.1-silent | 3rdParty/V8/V8-5.0.71.39/build/gyp/test/win/gyptest-cl-exception-handling.py | 344 | #!/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.
"""
Make sure exception handling settings are extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = Test... |
hexid/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/library/gyptest-static.py | 430 | #!/usr/bin/env python
# Copyright (c) 2009 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 simple build of a "Hello, world!" program with static libraries,
including verifying that libraries are rebuilt correctly when ... |
romain-li/edx-platform | refs/heads/master | openedx/core/lib/rooted_paths.py | 186 | """Provides rooted_glob, for finding relative glob paths in another director."""
import glob2
def rooted_glob(root, glob):
"""
Returns the results of running `glob` rooted in the directory `root`.
All returned paths are relative to `root`.
Uses glob2 globbing
"""
return remove_root(root, sor... |
mtp1376/youtube-dl | refs/heads/master | youtube_dl/extractor/rbmaradio.py | 145 | # encoding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class RBMARadioIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?rbmaradio\.com/shows/(?P<videoID>[^/]+)$'
_TEST = {
'url': 'http://www.rbm... |
jzoldak/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/pages.py | 35 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
from nose.tools import assert_equal, assert_in
CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox"
@step(u'I go to the pages page$')
def go_to_static(step):
... |
s40523233/2016fallcp_hw | refs/heads/gh-pages | plugin/liquid_tags/youtube.py | 284 | """
Youtube Tag
---------
This implements a Liquid-style youtube tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% youtube id [width height] %}
Example
-------
{% youtube dQw4w9WgXcQ 640 480 %}
Output
------
<iframe
width="640" height="480" src="https://www.youtube.com/embed/dQw4... |
ludmilamarian/invenio | refs/heads/master | invenio/legacy/refextract/__init__.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 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
# License, or (at your option) any later... |
nttks/jenkins-test | refs/heads/gacco/birch | common/djangoapps/student/models.py | 1 | """
Models for User Information (students, staff, etc)
Migration Notes
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration student --auto description_of_... |
Suwmlee/XX-Net | refs/heads/python3 | Python3/lib/netrc.py | 108 | """An object-oriented interface to .netrc files."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
import os, shlex, stat
__all__ = ["netrc", "NetrcParseError"]
class NetrcParseError(Exception):
"""Exception raised on syntax errors in the .netrc file."""
def __init__(self, msg, filename=None, l... |
youdonghai/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/gl/formats.py | 322 | # -*- 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 = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = 'F ... |
spigwitmer/mysqlproxy | refs/heads/master | tests/test_packets.py | 1 | """
Packet encapsulation unit tests
"""
from unittest import main, TestCase
from StringIO import StringIO
class PacketChainTest(TestCase):
"""
Test MySQL protocol packet read-ins, both single and multi
"""
def runTest(self):
"""
Single/multi packet processing
"""
from m... |
2ndQuadrant/ansible | refs/heads/master | test/units/modules/network/f5/test_bigip_gtm_pool.py | 37 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... |
braams/shtoom | refs/heads/master | shtoom/test/test_callcontrol.py | 1 | from twisted.internet import reactor, defer
from twisted.python import log
import twisted.trial.util
from shtoom.i18n import install as i18n_install
i18n_install()
#TDEBUG=True
TDEBUG=False
callFlowOutboundHorror = """
For an outbound call:
UI calls app.placeCall(), which calls sip.SIP.placeCall(), which
returns ... |
oeeagle/quantum | refs/heads/master | neutron/tests/unit/mlnx/test_agent_scheduler.py | 34 | # Copyright (c) 2013 OpenStack Foundation
#
# 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 ... |
psf/black | refs/heads/mypyc-support-pt2 | tests/data/slices.py | 1 | slice[a.b : c.d]
slice[d :: d + 1]
slice[d + 1 :: d]
slice[d::d]
slice[0]
slice[-1]
slice[:-1]
slice[::-1]
slice[:c, c - 1]
slice[c, c + 1, d::]
slice[ham[c::d] :: 1]
slice[ham[cheese ** 2 : -1] : 1 : 1, ham[1:2]]
slice[:-1:]
slice[lambda: None : lambda: None]
slice[lambda x, y, *args, really=2, **kwargs: None :, None:... |
ibinti/intellij-community | refs/heads/master | python/testData/resolve/ImportInTryExcept.py | 83 | try:
import sys
except:
sys = None
print sys
# <ref>
|
AdamBark/xspress3 | refs/heads/master | iocgen.py | 1 | # Required input: Number of channels
# Optional inputs: Number of ROIs per channel, port basename (may not work),
# same things as with builder
# Generate substitutions file with: xspress3.template,
# xspress3_highlevel.template and availableFrame if required (was just made for
# GDA so probably not). Per channel xsp... |
ocadotechnology/django-nuit | refs/heads/master | example_project/demo/urls.py | 1 | '''Demo URLs'''
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from demo.views import MyListView
urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name='demo/introduction.html'), name='introduction'),
url(r'^kitchen-sink/$', 'demo.views.kitchen_sink',... |
johnbachman/indra | refs/heads/master | indra/ontology/bio/__main__.py | 4 | """
The BioOntology is built and cached automatically during runtime. If
a cached version already exists, it is loaded from the cache.
To control the build and clean up caches if necessary, one can call
.. code-block:: bash
python -m indra.ontology.bio <operation>
to build or clean up the INDRA bio ontology. Th... |
saurabh6790/medsyn-lib1 | refs/heads/master | webnotes/plugins.py | 34 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
def get_code_and_execute(module, doctype, docname, plugin=None, namespace=None):
code = get_code(module, doctype, docname, plugin)
return exec_code(code, na... |
thonkify/thonkify | refs/heads/master | src/lib/telegram/inlinequeryresultaudio.py | 3 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
ujenmr/ansible | refs/heads/devel | test/units/errors/test_errors.py | 42 | # (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... |
int19h/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/requests/exceptions.py | 48 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from pip._vendor.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.
... |
sixpearls/django-menutia | refs/heads/master | menutia/templatetags/menutia_tags.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django import template
from django.template.loader import render_to_string
from menutia import settings # cache menus?
from menutia.models import Menu, MenuItem
from django.utils.safestring import mark_safe
from django.conf import settings
# also add a jQuery u... |
patrys/opbeat_python | refs/heads/master | tests/config/tests.py | 2 | from __future__ import absolute_import
import logging
import mock
from opbeat.conf import setup_logging
from tests.utils.compat import TestCase
class SetupLoggingTest(TestCase):
def test_basic_not_configured(self):
with mock.patch('logging.getLogger', spec=logging.getLogger) as getLogger:
l... |
kleingeist/xtreemfs | refs/heads/master | tests/test_config.py | 4 | # Copyright (c) 2009-2011 by Bjoern Kolbeck, Zuse Institute Berlin
# Licensed under the BSD License, see LICENSE file for details.
TestSets = {
'short' : {
'ssl': False,
'mrc_repl': False,
'dir_repl': False,
'snmp': False,
},
'full' : {
... |
ceb8/astroquery | refs/heads/track_master | astroquery/xmatch/tests/test_xmatch.py | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os.path
import requests
import pytest
from astropy.io import ascii
from astropy.table import Table
from astropy.units import arcsec
from ...utils import commons
from ...utils.testing_tools import MockResponse
from ...xmatch import XMatch
DATA_FIL... |
sunils34/buffer-django-nonrel | refs/heads/master | tests/regressiontests/generic_views/detail.py | 50 | from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from regressiontests.generic_views.models import Artist, Author, Page
class DetailViewTest(TestCase):
fixtures = ['generic-views-test-data.json']
urls = 'regressiontests.generic_views.urls'
def test_simple_object(se... |
analyticalmonk/faltuminds-landing | refs/heads/master | joins/migrations/0006_auto__del_unique_join_email.py | 2 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'join', fields ['email']
db.delete_unique... |
admetricks/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py | 126 | # Copyright (C) 2010 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 of conditions and th... |
EdgarSun/Django-Demo | refs/heads/master | django/contrib/gis/geos/prototypes/coordseq.py | 624 | from ctypes import c_double, c_int, c_uint, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR
from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
## Error-checking routines specific to coordinate seq... |
lowtraxx/kernel | refs/heads/android-7.1 | tools/perf/scripts/python/net_dropmonitor.py | 2669 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
calvinpy/django-guardian | refs/heads/devel | guardian/testapp/tests/core_test.py | 17 | from __future__ import unicode_literals
from itertools import chain
from django.conf import settings
# Try the new app settings (Django 1.7) and fall back to the old system
try:
from django.apps import apps as django_apps
auth_app = django_apps.get_app_config("auth")
except ImportError:
from django.contrib... |
CapOM/ChromiumGStreamerBackend | refs/heads/master | tools/check_grd_for_unused_strings.py | 49 | #!/usr/bin/env python
# Copyright (c) 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.
"""Without any args, this simply loads the IDs out of a bunch of the Chrome GRD
files, and then checks the subset of the code that ... |
newvem/pytz | refs/heads/master | pytz/zoneinfo/America/Vancouver.py | 9 | '''tzinfo timezone information for America/Vancouver.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Vancouver(DstTzInfo):
'''America/Vancouver timezone definition. See datetime.tzinfo for details'''
zone = 'America/Vanc... |
bohdan7/python_koans | refs/heads/master | python2/runner/mockable_test_result.py | 278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
# Needed to stop unittest.TestResult itself getting Mocked out of existence,
# which is a problem when testing the helper classes! (It confuses the runner)
class MockableTestResult(unittest.TestResult):
pass |
baojianzhou/DLReadingGroup | refs/heads/master | keras/examples/babi_memnn.py | 4 | '''Trains a memory network on the bAbI dataset.
References:
- Jason Weston, Antoine Bordes, Sumit Chopra, Tomas Mikolov, Alexander M. Rush,
"Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks",
http://arxiv.org/abs/1502.05698
- Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, Rob Fergus,
"... |
nishnik/networkx | refs/heads/master | networkx/readwrite/tests/test_yaml.py | 23 | """
Unit tests for yaml.
"""
import os,tempfile
from nose import SkipTest
from nose.tools import assert_equal
import networkx as nx
from networkx.testing import assert_edges_equal, assert_nodes_equal
class TestYaml(object):
@classmethod
def setupClass(cls):
global yaml
try:
im... |
Endika/account-financial-tools | refs/heads/8.0 | account_chart_update/wizard/wizard_chart_update.py | 20 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Zikzakmedia S.L. (http://www.zikzakmedia.com)
# Copyright (c) 2010 Pexego Sistemas Informáticos S.L.(http://www.pexego.es)
# @authors: Jordi Esteve (Zikzakmedia), Borja López Soilán (Pe... |
indiependente/Social-Networks-Structure | refs/heads/master | cascade_rdbg.py | 1 |
# coding: utf-8
# # Random Direct Graph
# In[1]:
import sys
# get_ipython().magic('matplotlib inline')
import random
# import matplotlib.pyplot as plt
from dgraph import standardize
from lesson1 import averageClustering as ac
from dgraph import countEdges
from lesson4 import topk
from lesson4 import betweenness
from... |
DNSUsher/securethenews | refs/heads/master | securethenews/sites/migrations/0013_auto_20161020_0023.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-20 00:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0012_rename_site_url_to_domain'),
]
operations = [
migrations.Rena... |
boxed/CMi | refs/heads/master | web_frontend/CMi/tvshows/views.py | 1 | import subprocess
from CMi.utils import ListItem
from django.db import IntegrityError
from CMi.engine import playable_path, canonical_format
from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404
from CMi.tvshows.models import *
import tvdb
from math import ceil
def index(request, ... |
jounex/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/conf/locale/te/formats.py | 118 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y'
TIME_FORMAT = 'g:i:s A'
# ... |
apyrgio/synnefo | refs/heads/release-0.16 | snf-cyclades-app/synnefo/logic/management/commands/queue-inspect.py | 10 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 i... |
Framework43/touchpad-kernel | refs/heads/master | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
arnaudoff/watcher | refs/heads/master | dashboard/triggers/admin.py | 1 | from django.contrib import admin
from dashboard.triggers.models import (Trigger, Capture)
class TriggerModelAdmin(admin.ModelAdmin):
list_display = ["time_triggered", "__str__"]
list_filter = ["time_triggered"]
class Meta:
model = Trigger
class CaptureModelAdmin(admin.ModelAdmin):
list_displ... |
lowitty/alarmfiles | refs/heads/master | lib/pyasn1/codec/ber/__init__.py | 3653 | # This file is necessary to make this directory a package.
|
asm-products/chartspree | refs/heads/master | charts/settings.py | 1 | import os
# load a bunch of environment
DEBUG = os.getenv('DEBUG', '').lower() in ['true', '1', 'yes']
NONCE_SECRET = os.getenv('NONCE_SECRET')
REDIS_URL = os.getenv('REDISTOGO_URL', 'redis://localhost:6379')
SERVICE_NAME = os.getenv('SERVICE_NAME') or 'Charts'
SERVICE_URL = os.getenv('SERVICE_URL') or 'http://local... |
kittiu/sale-workflow | refs/heads/10.0 | sale_revert_done/tests/__init__.py | 1 | # coding: utf-8
from . import test_sale_revert_done
|
cratuki/solent | refs/heads/master | solent/draft/demonstrate_linetalk.py | 2 | # // license
# Copyright 2016, Free Software Foundation.
#
# This file is part of Solent.
#
# Solent 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 License, or (at your option)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.