repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tntraina/aff4 | refs/heads/master | python2.6/tests/encrypted.py | 3 | import pyaff4
import os, time, sys
time.sleep(1)
oracle = pyaff4.Resolver()
CERT_LOCATION = os.getcwd() + "/tests/sign.key"
SOURCE = "/bin/ls"
## For this test make sure there are certs:
try:
data = open(CERT_LOCATION).read()
except IOError:
print "Creating certs on %s" % CERT_LOCATION
os.system("openss... |
wolfier/incubator-airflow | refs/heads/master | tests/contrib/operators/test_dataproc_operator.py | 2 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
jinnykoo/christmas | refs/heads/master | sites/demo/tests/test_shipping_methods.py | 34 | from decimal import Decimal as D
from django.test import TestCase
import mock
from apps.shipping import methods
class TestStandard(TestCase):
def setUp(self):
self.method = methods.Standard()
self.basket = mock.Mock()
def test_is_free_over_threshold(self):
self.basket.total_incl_ta... |
TangHao1987/intellij-community | refs/heads/master | python/testData/mover/lastComment1.py | 166 | def f():
if True:
a = 1
else:
a = 2
#comment <caret>
|
Pure-Aosp/android_external_skia | refs/heads/5.1 | experimental/benchtools/greenify.py | 85 | #!/usr/bin/env python
# Copyright (c) 2014 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.
"""greenify.py: standalone script to correct flaky bench expectations.
Requires Rietveld credentials on the running machine... |
uw-it-aca/bridge-sis-provisioner | refs/heads/master | sis_provisioner/tests/csv/__init__.py | 1 | from django.test.utils import override_settings
from sis_provisioner.tests import (
fdao_pws_override, fdao_hrp_override, fdao_bridge_override)
from sis_provisioner.tests.account_managers import set_uw_account
user_file_name_override = override_settings(
BRIDGE_IMPORT_USER_FILENAME="users")
def set_db_record... |
mseaborn/switch | refs/heads/master | switch_mod/project/build.py | 2 | # Copyright 2015 The Switch Authors. All rights reserved.
# Licensed under the Apache License, Version 2, which is in the LICENSE file.
"""
Defines model components to describe generation projects build-outs for
the SWITCH-Pyomo model.
SYNOPSIS
>>> from switch_mod.utilities import define_AbstractModel
>>> model = de... |
Maximilian-Reuter/SickRage | refs/heads/master | lib/pyasn1/codec/cer/decoder.py | 261 | # CER decoder
from pyasn1.type import univ
from pyasn1.codec.ber import decoder
from pyasn1.compat.octets import oct2int
from pyasn1 import error
class BooleanDecoder(decoder.AbstractSimpleDecoder):
protoComponent = univ.Boolean(0)
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length,
... |
inasafe/inasafe | refs/heads/develop | safe/report/test/__init__.py | 44 | # coding=utf-8
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "info@inasafe.org"
__revision__ = '$Format:%H$'
|
Microsoft/PTVS | refs/heads/master | Python/Tests/TestData/Grammar/Literals.py | 7 | "abc"
r"raw string"
R"raw string"
"""abc"""
r"""raw string"""
R"""raw string"""
'abc'
r'raw string'
R'raw string'
'''abc'''
r'''raw string'''
R'''raw string'''
1000
2147483647
3.14
10.
.001
1e100
3.14e-10
0e0
3.14j
10.j
10j
.001j
1e100j
3.14e-10j
-2147483648
-100 |
minesense/VisTrails | refs/heads/master | contrib/itk/__init__.py | 6 | ############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... |
alex/bcrypt | refs/heads/master | bcrypt/__init__.py | 4 | # Author:: Donald Stufft (<donald@stufft.io>)
# Copyright:: Copyright (c) 2013 Donald Stufft
# License:: Apache License, Version 2.0
#
# 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:/... |
ville-k/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/__init__.py | 959 | # 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... |
teknolab/django.org.tr | refs/heads/develop | manage.py | 404 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
infoscout/python-bootcamp-pv | refs/heads/master | bootcamp/core.py | 1 | def say_hello():
print "\n* Hello InfoScout Team!\n"
def test_helper(got, expected):
if got == expected:
prefix = 'Correct!'
else:
prefix = 'Fail!'
print " {prefix} got: {got} expected: {expected}".format(prefix=prefix, got=got, expected=expected)
|
TB-Budget/T9_XMLRPC | refs/heads/master | ExtUtil/T9rpc.py | 1 | # coding=UTF-8
'''
Модуль удаленного вызова процедур Турбо9
На основе func_rpc.php
Данный проект является свободным программным обеспечением. Вы вправе распространять его
и/или модифицировать в соответствии с условиями версии 2.1 либо по вашему выбору с условиями
более поздней версии Стандартной Общественной Ли... |
TalkingCactus/Citadel-Station | refs/heads/master | tools/mapmerge/dmm2tgm.py | 24 | import map_helpers
import sys
import shutil
#main("../../_maps/")
def main(map_folder):
tgm = "1"
maps = map_helpers.prompt_maps(map_folder, "convert", tgm)
print("\nConverting these maps:")
for i in maps.indices:
print(str(maps.files[i])[len(map_folder):])
convert = input("\... |
rentodev/p2pool-nzs | refs/heads/master | p2pool/bitcoin/networks/frycoin.py | 10 | import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'fbc0b6db'.decode('hex')
P2P_PORT = 55901
ADDRESS_VERSION = 35
RPC_PORT = 55900
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'Frycoinaddress' in (yi... |
skuda/client-python | refs/heads/master | kubernetes/client/models/v1_resource_quota_spec.py | 1 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
Softmotions/edx-platform | refs/heads/master | common/test/acceptance/pages/common/logout.py | 162 | """
Logout Page.
"""
from bok_choy.page_object import PageObject
from . import BASE_URL
class LogoutPage(PageObject):
"""
Logout page to logout current logged in user.
"""
url = BASE_URL + "/logout"
def is_browser_on_page(self):
return self.q(css='.cta-login').present
|
hanlind/nova | refs/heads/master | doc/ext/nova_todo.py | 3 | # -*- coding: utf-8 -*-
# This is a hack of the builtin todo extension, to make the todo_list
# more user friendly.
import re
from sphinx.ext.todo import depart_todo_node
from sphinx.ext.todo import NoUri
from sphinx.ext.todo import nodes
from sphinx.ext.todo import process_todos
from sphinx.ext.todo import purge_tod... |
madhurrajn/samashthi | refs/heads/master | lib/django/contrib/gis/db/backends/mysql/base.py | 444 | from django.db.backends.mysql.base import \
DatabaseWrapper as MySQLDatabaseWrapper
from .features import DatabaseFeatures
from .introspection import MySQLIntrospection
from .operations import MySQLOperations
from .schema import MySQLGISSchemaEditor
class DatabaseWrapper(MySQLDatabaseWrapper):
SchemaEditorCl... |
arenadata/ambari | refs/heads/branch-adh-1.6 | ambari-server/src/main/resources/common-services/SQOOP/1.4.4.2.0/package/scripts/params.py | 4 | """
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 use this ... |
isandlaTech/cohorte-3rdparty | refs/heads/master | sleekxmpp/src/main/python/sleekxmpp/plugins/xep_0047/stream.py | 12 | import socket
import threading
import logging
from sleekxmpp.stanza import Iq
from sleekxmpp.util import Queue
from sleekxmpp.exceptions import XMPPError
log = logging.getLogger(__name__)
class IBBytestream(object):
def __init__(self, xmpp, sid, block_size, jid, peer, window_size=1, use_messages=False):
... |
berkeley-stat159/project-delta | refs/heads/master | code/scripts/pca.py | 1 | """
Purpose
-------
The script performs principal component analysis on the filtered data set to
determine spatial patterns that account for the greatest amount of variability
in a time series. This requires finding the singular value decomposition of the
data matrix, which also has the advantage of providing a way to ... |
itsjeyd/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/migrations/0004_add_email_targets.py | 36 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_groups', '0001_initial'),
('bulk_email', '0003_config_model_feature_flag'),
]
operations = [
migrations.Creat... |
introlab/rtabmap_ros | refs/heads/master | scripts/point_to_tf.py | 1 | #!/usr/bin/env python
import rospy
import tf
from geometry_msgs.msg import PointStamped
def callback(point):
global br
global frame_id
local_frame_id = point.header.frame_id
if not local_frame_id:
local_frame_id = frame_id
br.sendTransform(
(point.point.x, point.point.y, point.point... |
swails/mdtraj | refs/heads/master | mdtraj/utils/unit/mymatrix.py | 17 | """
Pure python inversion of small matrices, to avoid requiring numpy or similar in SimTK.
This is part of the OpenMM molecular simulation toolkit originating from
Simbios, the NIH National Center for Physics-Based Simulation of
Biological Structures at Stanford, funded under the NIH Roadmap for
Medical Research, gran... |
runjmc/maraschino | refs/heads/master | lib/transmissionrpc/client.py | 10 | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2011 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import re, time
import urllib2, urlparse, base64
try:
import json
except ImportError:
import simplejson as json
from transmissionrpc.constants import DEFAULT_PORT, DEFAULT_TIMEOUT
from tr... |
crankyadmin/shadowsocks | refs/heads/master | tests/test.py | 1016 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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... |
cstipkovic/spidermonkey-research | refs/heads/master | js/src/build_OPT.OBJ/_virtualenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/__init__.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# This library 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 2.1 of the License, or (at your option) any later ve... |
garbled1/ansible | refs/heads/devel | lib/ansible/modules/network/panos/panos_object.py | 42 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... |
crpalmer/android_kernel_samsung_mondrianwifi | refs/heads/cm-11.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# 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.
import errno, os
FUTEX_WAIT = 0... |
python-dirbtuves/Misago | refs/heads/ubuntu-lt | misago/management/commands/updateranking.py | 3 | from django.core.management.base import BaseCommand, CommandError
from django.db.models import F
from misago.conf import settings
from misago.models import Rank, User
class Command(BaseCommand):
"""
This command is intended to work as CRON job fired of once per day or less if you have more users to update user... |
probablytom/tomwallis.net | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 1777 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
wso2-dev/device-cloud-appliances | refs/heads/master | IU_workshop/Step 7/python_client/ControlAndPublish/BAMPythonPublisher/thrift/transport/TTransport.py | 105 | #
# 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 u... |
chrsrds/scikit-learn | refs/heads/master | sklearn/utils/optimize.py | 1 | """
Our own implementation of the Newton algorithm
Unlike the scipy.optimize version, this version of the Newton conjugate
gradient solver uses only one function call to retrieve the
func value, the gradient value and a callable for the Hessian matvec
product. If the function call is very expensive (e.g. for logistic
... |
Dentosal/python-sc2 | refs/heads/master | setup.py | 1 | from setuptools import setup, find_packages
from pipenv.project import Project
from pipenv.utils import convert_deps_to_pip
pfile = Project(chdir=False).parsed_pipfile
requirements = convert_deps_to_pip(pfile['packages'], r=False)
test_requirements = convert_deps_to_pip(pfile['dev-packages'], r=False)
setup(
nam... |
thaim/ansible | refs/heads/fix-broken-link | test/units/modules/network/fortios/test_fortios_switch_controller_qos_qos_policy.py | 21 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
novel/ecru | refs/heads/master | python/setup.py | 1 | from distutils.core import setup
setup(
name = 'ecru',
version = '0.1',
description = 'Helper classes for writing ecru hooks in python',
author = 'Roman Bogorodskiy',
maintainer = 'Roman Bogorodskiy',
maintainer_email = 'bogorodskiy@gmail.com',
py_modules = ["ecr... |
jm-begon/montef-events | refs/heads/master | montefevents/data.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
try:
# Python 2
from urllib2 import URLError, HTTPError
from urllib2 import urlopen
except ImportError:
# Python 3+
from urllib.error import URLError, HTTPError
from urllib.request import urlopen
from... |
YangSongzhou/django | refs/heads/master | django/contrib/admin/checks.py | 186 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from itertools import chain
from django.contrib.admin.utils import (
NotRelationField, flatten, get_fields_from_path,
)
from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.forms... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/conf/urls/i18n.py | 383 | from django.conf.urls.defaults import *
urlpatterns = patterns('',
(r'^setlang/$', 'django.views.i18n.set_language'),
)
|
boudewijnrempt/HyvesDesktop | refs/heads/master | 3rdparty/socorro/scripts/startMonitor.py | 1 | #! /usr/bin/env python
import sys
import logging
import logging.handlers
try:
import config.monitorconfig as config
except ImportError:
import monitorconfig as config
import socorro.monitor.monitor as monitor
import socorro.lib.ConfigurationManager as configurationManager
try:
configurationContext = configura... |
willprice/weboob | refs/heads/master | modules/bred/test.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 opti... |
tectronics/madcow | refs/heads/master | madcow/protocol/cli.py | 8 | # Copyright (C) 2007, 2008 Christopher Jones
#
# This file is part of Madcow.
#
# Madcow 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... |
jerli/sympy | refs/heads/master | sympy/simplify/trigsimp.py | 3 | from __future__ import print_function, division
from collections import defaultdict
from sympy.core.cache import cacheit
from sympy.core import (sympify, Basic, S, Expr, expand_mul, factor_terms,
Mul, Dummy, igcd, FunctionClass, Add, symbols, Wild, expand)
from sympy.core.compatibility import reduce, iterable
fro... |
ad-m/django-mailbox | refs/heads/master | django_mailbox/south_migrations/0010_auto__add_field_mailbox_from_email.py | 2 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Mailbox.from_email'
db.add_column('django_mailbox_mailbox', 'from_email',
self.gf('django.db.m... |
nnethercote/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/py/testing/io_/test_terminalwriter.py | 54 |
import py
import os, sys
from py._io import terminalwriter
import codecs
import pytest
def test_get_terminal_width():
x = py.io.get_terminal_width
assert x == terminalwriter.get_terminal_width
def test_getdimensions(monkeypatch):
fcntl = py.test.importorskip("fcntl")
import struct
l = []
monk... |
opentrials/collectors | refs/heads/master | collectors/nct/parser.py | 2 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import xmltodict
try:
from lxml import etree
except ImportError:
import xml.etree.ElementTree as etree
from .record import ... |
heynemann/mememe | refs/heads/master | urls.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.conf import settings
PLUGINS = {'document_root': settings.PLUGINS_DIRECTORY}
MEDIA = {'document_root': settings.LOCAL_FILE('media')}
urlpatterns = patterns('',
url(r'^plugins/(?P<path>.*)$', 'django.views.static.serv... |
gbwebdev/PFE-VA_Dev | refs/heads/master | components/ecl/vsc.py | 2 | """
vsc.py
Execution Control Level module : Velocity/Steering Controler
Controls the PWM module’s state in order to get desired velocity
(in % of Vmax) and steering radius (in % of Rmax)
"""
#!/usr/bin/python3.5
#-*- coding: utf-8 -*-
###Standard imports :
import atexit
import time
from os import pat... |
habibmasuro/bitcoinxt | refs/heads/master | qa/rpc-tests/test_framework/bignum.py | 230 | #
#
# bignum.py
#
# This file is copied from python-bitcoinlib.
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bignum routines"""
from __future__ import absolute_import, division, print_function, unicode_literals
imp... |
ptonner/GPy | refs/heads/master | GPy/plotting/matplot_dep/mapping_plots.py | 8 | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
try:
import Tango
from matplotlib import pyplot as pb
except:
pass
from base_plots import x_frame1D, x_frame2D
def plot_mapping(self, plot_limits=None, which_data='all', whi... |
Event38/MissionPlanner | refs/heads/master | Lib/distutils/extension.py | 59 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""
__revision__ = "$Id$"
import os, string, sys
from types import *
try:
import warnings
except ImportError:
warnings = None
# This class is really only used by the "build_ext" com... |
ywang007/odo | refs/heads/master | odo/backends/tests/test_sas.py | 9 | from __future__ import absolute_import, division, print_function
import pytest
sas7bdat = pytest.importorskip('sas7bdat')
pytest.importorskip('odo.backends.sas')
import os
import pandas as pd
from collections import Iterator
from sas7bdat import SAS7BDAT
from odo.backends.sas import discover, sas_to_iterator
from odo... |
halfwit/qutebrowser | refs/heads/master | scripts/dev/pylint_checkers/qute_pylint/modeline.py | 6 | # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# This file is part of qutebrowser.
#
# qutebrowser 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 Sof... |
NoUsername/PrivateNotesExperimental | refs/heads/master | lib/south/migration.py | 4 |
import datetime
import os
import sys
import traceback
import inspect
from django.conf import settings
from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from models import MigrationHistory
from south.db import db
from south.orm import Fa... |
syci/ingadhoc-odoo-addons | refs/heads/8.0 | product_salesman_group/sale.py | 2 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class salesman_group(osv.osv):
_name = "sale.salesman.group"
_description = "Salesman Group"
_order = "name"
_constraints = [
(osv.osv._check_recursion,
'Error ! You cannot create recursive categories.', ['parent_id'])
... |
mwiebe/numpy | refs/heads/master | doc/source/conf.py | 63 | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function
import sys, os, re
# Check Sphinx version
import sphinx
if sphinx.__version__ < "1.0.1":
raise RuntimeError("Sphinx 1.0.1 or newer required")
needs_sphinx = '1.0'
# ----------------------------------------------------------... |
torchmed/torchmed | refs/heads/master | contact/models.py | 10644 | from django.db import models
# Create your models here.
|
eworm-de/pacman | refs/heads/master | test/pacman/tests/remove-recursive-cycle.py | 5 | self.description = "Recursively remove a package with cyclical dependencies"
lpkg1 = pmpkg('pkg1')
self.addpkg2db('local', lpkg1)
lpkg1.depends = [ 'dep1' ]
lpkg2 = pmpkg('pkg2')
self.addpkg2db('local', lpkg2)
lpkg2.depends = [ 'dep3' ]
# cyclic dependency 1
ldep1 = pmpkg('dep1')
self.addpkg2db('local', ldep1)
ldep1... |
bmander/dancecontraption | refs/heads/master | django/contrib/contenttypes/management.py | 315 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... |
jlspyaozhongkai/Uter | refs/heads/master | third_party_backup/Python-2.7.9/Lib/abc.py | 488 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
import types
from _weakrefset import WeakSet
# Instance of old-style class
class _C: pass
_InstanceType = type(_C())
def abstractmethod(funcobj):
"""A d... |
leafclick/intellij-community | refs/heads/master | python/testData/completion/className/orderingUnderscoreInPath/main.py | 72 | fo<caret>o |
KDB2/veusz | refs/heads/master | veusz/setting/__init__.py | 9 | # Copyright (C) 2005 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... |
vabs22/zulip | refs/heads/master | analytics/lib/counts.py | 4 | from django.conf import settings
from django.db import connection, models
from django.db.models import F
from analytics.models import InstallationCount, RealmCount, \
UserCount, StreamCount, BaseCount, FillState, Anomaly, installation_epoch, \
last_successful_fill
from zerver.models import Realm, UserProfile, ... |
XiaosongWei/chromium-crosswalk | refs/heads/master | third_party/protobuf/python/google/protobuf/internal/wire_format.py | 561 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
ajoaoff/django | refs/heads/master | tests/template_tests/filter_tests/test_addslashes.py | 473 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... |
amy12xx/keras | refs/heads/master | tests/manual/check_yaml.py | 74 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
from keras.utils.test_utils import get_test_data
from keras.preprocessing import sequence
from keras.optimizers import SGD, RMSprop, Adagrad
from keras.utils import np_utils
from keras.models import Sequential, Graph
from k... |
openshift/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.9.14-1/roles/openshift_health_checker/test/fluentd_test.py | 55 | import pytest
import json
from openshift_checks.logging.fluentd import Fluentd, OpenShiftCheckExceptionList, OpenShiftCheckException
def assert_error_in_list(expect_err, errorlist):
assert any(err.name == expect_err for err in errorlist), "{} in {}".format(str(expect_err), str(errorlist))
fluentd_pod_node1 = {... |
hujiajie/pa-chromium | refs/heads/master | third_party/mesa/MesaLib/src/mapi/glapi/gen/glX_proto_send.py | 32 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# 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
# ... |
alexlee-gk/visual_dynamics | refs/heads/master | visual_dynamics/policies/__init__.py | 1 | from .base import Policy
from .target_policy import TargetPolicy
from .random_policy import RandomPolicy
from .additive_normal_policy import AdditiveNormalPolicy
from .momentum_policy import MomentumPolicy
from .mixed_policy import MixedPolicy
from .choice_policy import ChoicePolicy
from .constant_policy import Constan... |
anilgulecha/trelby | refs/heads/master | src/headersdlg.py | 6 | import gutil
import headers
import misc
import pdf
import pml
import util
import wx
class HeadersDlg(wx.Dialog):
def __init__(self, parent, headers, cfg, cfgGl, applyFunc):
wx.Dialog.__init__(self, parent, -1, "Headers",
style = wx.DEFAULT_DIALOG_STYLE)
self.headers = h... |
JCROM-Android/jcrom_external_chromium_org | refs/heads/kitkat | chrome/common/extensions/docs/server2/chained_compiled_file_system_test.py | 24 | #!/usr/bin/env python
# Copyright 2013 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 chained_compiled_file_system import ChainedCompiledFileSystem
from compiled_file_system import CompiledFileSystem... |
ericmjl/bokeh | refs/heads/master | sphinx/source/docs/user_guide/examples/plotting_patch_single.py | 63 | from bokeh.plotting import figure, output_file, show
output_file("patch.html")
p = figure(plot_width=400, plot_height=400)
# add a patch renderer with an alpha an line width
p.patch([1, 2, 3, 4, 5], [6, 7, 8, 7, 3], alpha=0.5, line_width=2)
show(p)
|
calvinfarias/IC2015-2 | refs/heads/master | BOOST/boost_1_61_0/libs/python/test/enum.py | 45 | # Copyright David Abrahams 2004. 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)
'''
>>> from enum_ext import *
>>> identity(color.red) # in case of duplicated enums it always take the last enum
enum_ext.color.blood
... |
Djacket/djacket | refs/heads/master | core/backend/git/statistics.py | 1 | import json
from dateutil import parser
from datetime import datetime
from utils.date import get_year, get_month, get_weeknumber, get_weekday
def extract_month(utc_timestamp):
"""
Extracts month from utc timestamp string.
"""
datetime = parser.parse(utc_timestamp)
return '{0}-{1}'.format(dat... |
meeb/txhttprelay | refs/heads/master | config.py | 1 | LISTEN_PORT = 9876
LISTEN_HOST = '127.0.0.1'
LISTEN_SOCKET = 'relay.sock'
USE = 'tcp' # 'tcp' or 'unix' to toggle which of the above to use
REQUESTS = {}
try:
from local_config import *
except ImportError:
import sys
sys.stderr.write('unable to import local_config')
sys.exit(1)
|
huzq/scikit-learn | refs/heads/master | sklearn/metrics/cluster/_bicluster.py | 11 | import numpy as np
from scipy.optimize import linear_sum_assignment
from ...utils.validation import check_consistent_length, check_array
from ...utils.validation import _deprecate_positional_args
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks the... |
ItsAGeekThing/namebench | refs/heads/master | nb_third_party/__init__.py | 176 | import os.path
import sys
# This bit of evil should inject third_party into the path for relative imports.
sys.path.insert(1, os.path.dirname(__file__))
|
sebastic/python-mapnik | refs/heads/master | test/python_tests/markers_complex_rendering_test.py | 2 | #coding=utf8
import os
import mapnik
from utilities import execution_path, run_all
from nose.tools import eq_
def setup():
# All of the paths used are relative, if we run the tests
# from another directory we need to chdir()
os.chdir(execution_path('.'))
if 'csv' in mapnik.DatasourceCache.plugin_names():
... |
smalls257/VRvisu | refs/heads/master | Library/External.LCA_RESTRICTED/Languages/CPython/27/Lib/json/tool.py | 113 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m json.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m json.tool
Expecting property name: line 1 column 2 (char 2)
"""
import sys
import json
def main():
if len(sys.argv) == 1:
... |
Brocade-OpenSource/OpenStack-DNRM-Neutron | refs/heads/master | neutron/openstack/common/notifier/test_notifier.py | 129 | # 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... |
TomTranter/OpenPNM | refs/heads/master | tests/unit/models/phase/DensityTest.py | 1 | import openpnm as op
from numpy.testing import assert_approx_equal
class DensityTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[3, 3, 3])
self.phase = op.phases.GenericPhase(network=self.net)
self.phase['pore.temperature'] = 298.0 # K
self.phase['pore.pressure'] = ... |
OmarIthawi/edx-platform | refs/heads/master | common/djangoapps/embargo/fixtures/country_codes.py | 259 | """
List of valid ISO 3166-1 Alpha-2 country codes, used for
validating entries on entered country codes on django-admin page.
"""
COUNTRY_CODES = set([
"AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", "AT",
"AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "... |
menandmice/mnm-opendnssec | refs/heads/master | suds/umx/basic.py | 211 | # 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 ... |
hachreak/zenodo | refs/heads/master | tests/unit/default/test_zenodo.py | 9 | # -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2015 CERN.
#
# Zenodo 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 v... |
georgestarcher/TA-SyncKVStore | refs/heads/master | bin/ta_synckvstore/markupsafe/_compat.py | 864 | # -*- coding: utf-8 -*-
"""
markupsafe._compat
~~~~~~~~~~~~~~~~~~
Compatibility module for different Python versions.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
if not PY2:
text_type = str
string_type... |
StratusLab/client | refs/heads/master | api/code/src/main/python/requests/cookies.py | 58 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
from .compat import cookielib, urlparse, Morsel
try:
import threading
# grr, pyflakes: this fixes "redefinition of unused... |
smartbgp/libbgp | refs/heads/master | libbgp/tests/unit/bgp/test_update.py | 1 | # Copyright 2015-2017 Cisco Systems, 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 req... |
mattilyra/gensim | refs/heads/develop | gensim/sklearn_api/ldamodel.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Chinmaya Pancholi <chinmayapancholi13@gmail.com>
# Copyright (C) 2017 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Scikit learn interface for :class:`~gensim.models.ldamodel.LdaModel`.
Fol... |
SUSE/azure-sdk-for-python | refs/heads/master | azure-mgmt-datalake-store/azure/mgmt/datalake/store/models/encryption_config.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
futurepr0n/Books-solutions | refs/heads/master | Python-For-Everyone-Horstmann/Chapter9-Objects-and-Classes/test_P9_15.py | 1 | # Unit tests for P9_15.py
# IMPORTS
from math import sqrt
from math import pi
import P9_15
import unittest
# main
class SphereTests(unittest.TestCase):
def setUp(self):
self.sphere = P9_15.Sphere(5)
def test_get_radius(self):
self.assertEqual(5, self.sphere.get_radius())
def test_volum... |
maurerpe/FreeCAD | refs/heads/master | src/Mod/Plot/plotPositions/__init__.py | 280 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... |
inspectlabs/mongo-python-driver | refs/heads/master | pymongo/thread_util.py | 24 | # Copyright 2012-2015 MongoDB, 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 writin... |
boxbillinggit/RPI_bmw-infotainment | refs/heads/master | plugin/plugin.service.bmw-infotainment/resources/lib/bmbt.py | 1 | import main_thread
import system
import kodi.builtin
import signaldb as sdb
import log as log_module
from kodi import gui
from buttons import Button
log = log_module.init_logger(__name__)
__author__ = 'lars'
def get_active_screens(bitmask):
if not bitmask:
return "None"
states = []
for idx, state in enume... |
pierce403/EmpirePanel | refs/heads/master | lib/modules/situational_awareness/network/smbautobrute.py | 1 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Invoke-SMBAutoBrute',
# list of on... |
pwmarcz/django | refs/heads/master | django/utils/html_parser.py | 79 | from django.utils.six.moves import html_parser as _html_parser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
HTMLParseError = _html_parser.HTMLParseError
if not use_workaround:
if ... |
xzYue/odoo | refs/heads/8.0 | addons/document/content_index.py | 430 | # -*- 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.