repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tpeek/bike_safety | refs/heads/master | imagersite/imager_api/models.py | 10644 | from django.db import models
# Create your models here.
|
t-miyamae/teuthology | refs/heads/master | scripts/test/test_run.py | 13 | import docopt
from script import Script
from scripts import run
doc = run.__doc__
class TestRun(Script):
script_name = 'teuthology'
def test_all_args(self):
args = docopt.docopt(doc, [
"--verbose",
"--archive", "some/archive/dir",
"--description", "the_descriptio... |
rosmo/ansible | refs/heads/devel | test/units/modules/network/ios/test_ios_facts.py | 15 | # 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 distributed in the hope that ... |
likeyiyy/readbooks | refs/heads/master | flask/json.py | 428 | # -*- coding: utf-8 -*-
"""
flask.jsonimpl
~~~~~~~~~~~~~~
Implementation helpers for the JSON support in Flask.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import io
import uuid
from datetime import datetime
from .globals import current_app, request
fro... |
hieukypc/ERP | refs/heads/master | openerp/addons/test_mimetypes/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
cathywu/flow | refs/heads/master | flow/controllers/base_lane_changing_controller.py | 1 | """Contains the base lane change controller class."""
class BaseLaneChangeController:
"""Base class for lane-changing controllers.
Instantiates a controller and forces the user to pass a
lane_changing duration to the controller.
Parameters
----------
veh_id : str
ID of the vehi cle t... |
ramcn/demo3 | refs/heads/master | venv/lib/python3.4/site-packages/django/core/management/commands/squashmigrations.py | 103 | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections, migrations
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.loader import AmbiguityError
from django.db.migrations.migration import... |
nanolearningllc/edx-platform-cypress | refs/heads/master | common/djangoapps/student/tests/test_enrollment.py | 96 | """
Tests for student enrollment.
"""
import ddt
import unittest
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from util.testing im... |
aksaxena80/test | refs/heads/master | tensorflow/python/training/moving_averages.py | 5 | """Maintain moving averages of parameters."""
from tensorflow.python.framework import ops
from tensorflow.python.framework import types
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import constant_op
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
... |
salguarnieri/intellij-community | refs/heads/master | python/testData/copyPaste/EmptyLineInList.after.py | 102 | # original function # this is line 1 of the code.
def foo():
print 'f00'
def bar(num):
for _ in range(num):
print 'bar'
bar(7)
def bar(num):
for _ in range(num):
print 'bar'
bar(7)
|
denny820909/builder | refs/heads/master | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/internet/test/test_gtkreactor.py | 14 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests to ensure all attributes of L{twisted.internet.gtkreactor} are
deprecated.
"""
import sys
from twisted.trial.unittest import TestCase
class GtkReactorDeprecation(TestCase):
"""
Tests to ensure all attributes of L{twisted.int... |
dbertha/odoo | refs/heads/8.0 | addons/crm_partner_assign/wizard/crm_forward_to_partner.py | 377 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
neharejanjeva/techstitution | refs/heads/master | venv/lib/python2.7/site-packages/wtforms/ext/django/templatetags/wtforms.py | 177 | """
Template tags for easy WTForms access in Django templates.
"""
from __future__ import unicode_literals
import re
from django import template
from django.conf import settings
from django.template import Variable
from ....compat import iteritems
register = template.Library()
class FormFieldNode(template.Node):
... |
csherwood-usgs/landlab | refs/heads/master | landlab/ca/tests/cts_model.py | 4 | #!/usr/env/python
"""
Base class for a "full" generic CTS model.
"""
_DEBUG = False
import time
#import random
from numpy import zeros, bincount, arange, savetxt, sqrt, log10, mean, arctan, pi, random
from landlab.io.native_landlab import save_grid
from landlab.ca.celllab_cts import Transition, CAPlotter
from matplot... |
ericgarrigues/ansible-modules-extras | refs/heads/devel | messaging/rabbitmq_policy.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, John Dewey <john@dewey.ws>
#
# 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, o... |
ESS-LLP/erpnext | refs/heads/develop | erpnext/accounts/doctype/fiscal_year/__init__.py | 37694 | from __future__ import unicode_literals
|
gvir/dailyreader | refs/heads/master | venv/Lib/site-packages/pip/_vendor/requests/status_codes.py | 695 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... |
mokuki082/EggDrop | refs/heads/master | code/eval_seed.py | 1 | duplicates = {}
with open('data/client.log', 'r') as f:
for n, line in enumerate(f):
if line in duplicates:
duplicates[line].append(n)
else:
duplicates[line] = [n]
for i in sorted(duplicates, key=lambda x: (len(duplicates[x]), duplicates[x][0])):
print("%{}s %s".format(... |
mzdaniel/oh-mainline | refs/heads/master | vendor/packages/twisted/doc/core/howto/tutorial/listings/finger/finger10.py | 21 | # Read username, output from factory interfacing to web, drop connections
from twisted.internet import protocol, reactor, defer, utils
from twisted.protocols import basic
from twisted.web import client
class FingerProtocol(basic.LineReceiver):
def lineReceived(self, user):
d = self.factory.getUser(user)
... |
jacekm-git/BetBoy | refs/heads/master | data/links_creator.py | 2 | # -*- coding: utf-8 -*-
"""
Copyright 2013 Jacek Markowski, jacek87markowski@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless require... |
jeffery-do/Vizdoombot | refs/heads/master | doom/lib/python3.5/site-packages/theano/tensor/shared_randomstreams.py | 6 | """
Define RandomStreams, providing random number variables for Theano
graphs.
"""
import copy
import numpy
from theano.compile.sharedvalue import (SharedVariable, shared_constructor,
shared)
from theano.tensor import raw_random
__docformat__ = "restructuredtext en"
class R... |
htwenhe/DJOA | refs/heads/master | env/Lib/site-packages/pip/_vendor/distlib/index.py | 328 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... |
endlessm/chromium-browser | refs/heads/master | third_party/catapult/third_party/gsutil/gslib/utils/encryption_helper.py | 4 | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
vianuevm/Webparser | refs/heads/master | ENV/Lib/site-packages/blinker/_saferef.py | 174 | # extracted from Louie, http://pylouie.org/
# updated for Python 3
#
# Copyright (c) 2006 Patrick K. O'Brien, Mike C. Fletcher,
# Matthew R. Scott
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#... |
vamshedhar/smschannel-api-old | refs/heads/dev | sms-channel-api/phonebook/models.py | 10644 | from django.db import models
# Create your models here.
|
YueLinHo/Subversion | refs/heads/master | tools/dev/benchmarks/suite1/benchmark.py | 2 | #!/usr/bin/env python
# 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
# "L... |
Tesora/tesora-horizon | refs/heads/master | openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py | 1 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... |
aaronzirbes/ansible | refs/heads/devel | v1/ansible/runner/lookup_plugins/fileglob.py | 176 | # (c) 2012, 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) any lat... |
pusnik/pyexchange | refs/heads/master | tests/exchange2010/test_get_folder.py | 5 | """
(c) 2013 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... |
cswiercz/sympy | refs/heads/master | examples/advanced/autowrap_integrators.py | 85 | #!/usr/bin/env python
"""
Numerical integration with autowrap
-----------------------------------
This example demonstrates how you can use the autowrap module in SymPy
to create fast, numerical integration routines callable from python. See
in the code for detailed explanations of the various steps. An
autowrapped sy... |
martinjina/git-repo | refs/heads/master | subcmds/forall.py | 48 | #
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
RiccardoPecora/MP | refs/heads/master | Lib/encodings/iso8859_16.py | 93 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self... |
Abhinav1997/kernel_z3 | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
KokareIITP/django | refs/heads/master | django/db/backends/oracle/schema.py | 404 | import binascii
import copy
import datetime
import re
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
from django.utils import six
from django.utils.text import force_text
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALT... |
badreddinetahir/pwn_plug_sources | refs/heads/master | src/grabber/crystal.py | 8 | #!/usr/bin/env python
"""
Crystal Module for Grabber v0.1
Copyright (C) 2006 - Romain Gaucher - http://rgaucher.info
"""
import sys,os,re, string, shutil
from xml.sax import * # Need PyXML [http://pyxml.sourceforge.net/]
from grabber import getContent_POST, getContentDirectURL_POST
from grabber import getCo... |
Drimmark/Kinegraphus | refs/heads/master | models/cinema.py | 1 | # -*- coding: utf-8 -*-
from models.basicmodel import db
class Cinema(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=1)
name = db.Column(db.String(128), nullable=False)
telephone = db.Column(db.String(128))
street = db.Column(db.String(128), nullable=False)
city = db.Column(... |
mudbungie/carrieocoyle | refs/heads/master | gallery/migrations/0019_auto_20151028_0012.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('gallery', '0018_auto_20151028_0011'),
]
operations = [
migrations.RenameField(
model_name='piece',
o... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/badsyntax_future3.py | 383 | """This is a test"""
from __future__ import nested_scopes
from __future__ import rested_snopes
def f(x):
def g(y):
return x + y
return g
result = f(2)(4)
|
graphite/TeX4Web-INVENIO | refs/heads/master | modules/bibsword/lib/bibsword_client_http.py | 10 | ## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
... |
sanghinitin/golismero | refs/heads/master | tools/sqlmap/lib/techniques/union/__init__.py | 200 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
pass
|
smallyear/linuxLearn | refs/heads/master | salt/salt/states/lvs_service.py | 3 | # -*- coding: utf-8 -*-
'''
Management of LVS (Linux Virtual Server) Service
================================================
'''
def __virtual__():
'''
Only load if the lvs module is available in __salt__
'''
return 'lvs_service' if 'lvs.get_rules' in __salt__ else False
def present(name,
... |
cchurch/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/async_wrapper.py | 17 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# 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 json
import... |
pwoodworth/intellij-community | refs/heads/master | python/helpers/pydev/pydevd_attach_to_process/winappdbg/module.py | 102 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... |
poiesisconsulting/openerp-restaurant | refs/heads/master | google_account/__init__.py | 143 | # -*- 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... |
c0defreak/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/pprint.py | 47 | # Author: Fred L. Drake, Jr.
# fdrake@acm.org
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-desc... |
neykov/chipidea-device-driver | refs/heads/linux-3.7.y | Documentation/target/tcm_mod_builder.py | 2358 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
Varriount/Colliberation | refs/heads/master | libs/twisted/internet/test/test_address.py | 6 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import re
import os
from twisted.trial import unittest
from twisted.internet.address import IPv4Address, UNIXAddress
try:
os.symlink
except AttributeError:
symlinkSkip = "Platform does not support symlinks"
else:
symlinkSkip = None
... |
LeandroRoberto/sapl | refs/heads/master | sapl/materia/views.py | 1 | from datetime import datetime
from random import choice
from string import ascii_letters, digits
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML
from django.contrib import messages
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.mixins import Perm... |
TelematicaUSM/EduRT | refs/heads/master | locking_panels/alternatives/control/__init__.py | 2 | # -*- coding: UTF-8 -*-
# COPYRIGHT (c) 2016 Cristóbal Ganter
#
# GNU AFFERO GENERAL PUBLIC LICENSE
# Version 3, 19 November 2007
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, eit... |
rsvip/Django | refs/heads/master | django/db/migrations/operations/special.py | 374 | from __future__ import unicode_literals
from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Takes two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't ... |
lfcnassif/MultiContentViewer | refs/heads/master | release/modules/ext/libreoffice/program/python-core-3.3.0/lib/lib2to3/fixes/fix_filter.py | 164 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes filter(F, X) into list(filter(F, X)).
We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.
NOTE: This... |
smx-smx/dsl-n55u-bender | refs/heads/master | release/src/router/samba-3.5.8/source4/heimdal/lib/wind/rfc4518.py | 22 | #!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
# $Id: rfc4518.py,v 1.1.1.1 2011/06/10 09:34:42 andrew Exp $
# Copyright (c) 2004, 2008 Kungliga Tekniska Högskolan
# (Royal Institute of Technology, Stockholm, Sweden).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or withou... |
ryanbackman/zulip | refs/heads/master | zerver/migrations/0065_realm_inline_image_preview.py | 10 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-21 15:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0064_sync_uploads_filesize_with_db'),
]
operations = [
migrations... |
holmes/intellij-community | refs/heads/master | python/testData/resolve/QualifiedFunc.py | 83 | class Foo:
def bar():
pass
Foo().<ref>bar()
|
seanbell/opensurfaces | refs/heads/master | server/normals/perspective.py | 1 | """
Utilities for handling shape perspective, vanishing points, and perspective
"""
import json
import copy
from normals.models import ShapeRectifiedNormalLabel
from common.geom import abs_dot, normalized, normalized_cross, \
complete_vector_triplets, construct_uvn_frame, most_orthogonal_vector
def vanishing_poi... |
incuna/incuna-groups | refs/heads/master | groups/tests/utils.py | 1 | from incuna_test_utils.testcases.integration import BaseIntegrationTestCase
from incuna_test_utils.testcases.request import BaseRequestTestCase
from .factories import UserFactory
class RequestTestCase(BaseRequestTestCase):
user_factory = UserFactory
class RenderedContentTestCase(BaseIntegrationTestCase):
u... |
awalls-cx18/gnuradio | refs/heads/master | gr-comedi/python/comedi/qa_comedi.py | 4 | #!/usr/bin/env python
#
# Copyright 2005,2007,2012 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 ... |
NetApp/manila | refs/heads/master | manila/tests/monkey_patch_example/__init__.py | 9 | # Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
mahinthjoe/bedrock | refs/heads/master | py3env/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py | 252 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
yaybu/hyperkit | refs/heads/master | hyperkit/spec/image.py | 1 | # 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 ... |
JorgeCoock/django | refs/heads/master | tests/template_tests/filter_tests/test_linebreaksbr.py | 331 | from django.template.defaultfilters import linebreaksbr
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LinebreaksbrTests(SimpleTestCase):
"""
The contents in "linebreaksbr" are escaped according to the current
autoescape setting.
"... |
naturali/tensorflow | refs/heads/r0.11 | tensorflow/contrib/distributions/python/kernel_tests/dirichlet_multinomial_test.py | 4 | # 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... |
skwbc/numpy | refs/heads/master | numpy/core/tests/test_indexing.py | 10 | from __future__ import division, absolute_import, print_function
import sys
import warnings
import functools
import operator
import numpy as np
from numpy.core.multiarray_tests import array_indexing
from itertools import product
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert... |
tigeorgia/fixmystreet | refs/heads/master | static/bootstrap/test-infra/s3_cache.py | 1700 | #!/usr/bin/env python2.7
from __future__ import absolute_import, unicode_literals, print_function, division
from sys import argv
from os import environ, stat, remove as _delete_file
from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
from boto.s3.... |
sanghinitin/golismero | refs/heads/master | thirdparty_libs/nltk/inference/api.py | 12 | # Natural Language Toolkit: Classifier Interface
#
# Author: Ewan Klein <ewan@inf.ed.ac.uk>
# Dan Garrette <dhgarrette@gmail.com>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Interfaces and base classes for theorem provers and model builders.
``Prover`` is a standard interfac... |
diegoguimaraes/django | refs/heads/master | django/core/management/sql.py | 5 | from __future__ import unicode_literals
import codecs
import os
import re
import warnings
from django.apps import apps
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models, router
from django.utils.deprecation import RemovedInDjango19Warning
def check_fo... |
wsilva/fdp-folha-de-ponto-ach2077 | refs/heads/master | fdp/settings/prod.py | 1 | import os
from django.conf import settings
DEBUG=False
TEMPLATE_DEBUG=False
# Parse database configuration from $DATABASE_URL
import dj_database_url
DATABASES = {}
DATABASES['default'] = dj_database_url.config()
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWAR... |
tarzan0820/odoo | refs/heads/8.0 | addons/web_graph/controllers/__init__.py | 2262 | import main |
ParadropLabs/Paradrop | refs/heads/master | tests/paradrop/test_general.py | 1 | '''
General tests for stability
'''
import paradrop
def testParadropImportable():
import paradrop
|
sauloal/pycluster | refs/heads/master | pypy-1.9_64/lib-python/2.7/test/warning_tests.py | 398 | # Helper module for testing the skipmodules argument of warnings.warn()
import warnings
def outer(message, stacklevel=1):
inner(message, stacklevel)
def inner(message, stacklevel=1):
warnings.warn(message, stacklevel=stacklevel)
|
dfromero/rango | refs/heads/master | rango_project/rango_project/wsgi.py | 1 | """
WSGI config for rango_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICAT... |
cselis86/edx-platform | refs/heads/installer | lms/djangoapps/courseware/features/events.py | 177 | # pylint: disable=missing-docstring
from lettuce import step
from lettuce import world
from lettuce import before
from pymongo import MongoClient
from nose.tools import assert_equals
from nose.tools import assert_in
REQUIRED_EVENT_FIELDS = [
'agent',
'event',
'event_source',
'event_type',
'host',
... |
OpenFEI/p2os_dashboard | refs/heads/master | scripts/p2os_dashboard/diagnostics_frame.py | 1 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... |
MaizerGomes/youtube-dl | refs/heads/master | youtube_dl/extractor/onionstudios.py | 109 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import determine_ext
class OnionStudiosIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?onionstudios\.com/(?:videos/[^/]+-|embed\?.*\bid=)(?P<id>\d+)(?!-)'
_TESTS = [{
'url': 'http:/... |
pfctdayelise/pytest | refs/heads/master | src/_pytest/terminal.py | 1 | """ terminal reporting of the full testing process.
This is a good source for looking at the various reporting hooks.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import itertools
import platform
import sys
import time
import attr
im... |
vileopratama/vitech | refs/heads/master | src/addons/website_blog/tests/test_website_blog_flow.py | 45 | # -*- coding: utf-8 -*-
from openerp.addons.website_blog.tests.common import TestWebsiteBlogCommon
class TestWebsiteBlogFlow(TestWebsiteBlogCommon):
def test_website_blog_followers(self):
""" Test the flow of followers and notifications for blogs. Intended
flow :
- people subscribe to ... |
vmarkovtsev/django | refs/heads/master | tests/template_tests/filter_tests/timezone_utils.py | 523 | from datetime import date, datetime
from django.test import SimpleTestCase
from django.utils import timezone
class TimezoneTestCase(SimpleTestCase):
def setUp(self):
self.now = datetime.now()
self.now_tz = timezone.make_aware(
self.now, timezone.get_default_timezone(),
)
... |
simbha/mAngE-Gin | refs/heads/master | lib/Django 1.7/django/db/backends/__init__.py | 20 | from collections import deque
import datetime
import time
import warnings
try:
from django.utils.six.moves import _thread as thread
except ImportError:
from django.utils.six.moves import _dummy_thread as thread
from collections import namedtuple
from contextlib import contextmanager
from importlib import impor... |
jfarcher/checkinapi | refs/heads/master | flask/lib/python2.7/site-packages/werkzeug/contrib/lint.py | 131 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.lint
~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module provides a middleware that performs sanity checks of the WSGI
application. It checks that :pep:`333` is properly implemented and warns
on some common HTTP errors such as non-empty respons... |
retomerz/intellij-community | refs/heads/master | python/testData/editing/firstParamSimpleInit.py | 83 | class A(object):
def __init__<caret>
|
TeachAtTUM/edx-platform | refs/heads/master | common/djangoapps/student/management/commands/create_random_users.py | 16 | """
A script to create some dummy users
"""
from __future__ import print_function
import uuid
from django.core.management.base import BaseCommand
from student.models import CourseEnrollment
from opaque_keys.edx.keys import CourseKey
from student.forms import AccountCreationForm
from student.helpers import do_create_ac... |
tschmorleiz/amcat | refs/heads/master | navigator/utils/__init__.py | 2 | from misc import * |
mgahsan/QuantEcon.py | refs/heads/master | quantecon/tests/test_quad.py | 7 | """
Filename: test_quad.py
Authors: Spencer Lyon
Date: 2014-07-02
Tests for quantecon.quad module
Notes
-----
Many of tests were derived from the file demqua## in the CompEcon
toolbox.
For all other tests, the MATLAB code is provided here in
a section of comments.
"""
from __future__ import division
import os
impor... |
goliate/sarakha63-persomov | refs/heads/master | couchpotato/core/media/movie/providers/automation/__init__.py | 95 | config = [{
'name': 'automation_providers',
'groups': [
{
'label': 'Watchlists',
'description': 'Check watchlists for new movies',
'type': 'list',
'name': 'watchlist_providers',
'tab': 'automation',
'options': [],
},
... |
liumeixia/xiaworkspace | refs/heads/master | pythonProject/automate/crmtest/address.py | 1 | #-*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import logging
import os
from datetime import datetime
from time import clock
#if not os.path.isdir(r"c:\screenshot\"):
# os.makedirs(r"c:\screenshot\")
#for i in range(10):
def FileName():
filesave='c:\\... |
nwchandler/ansible | refs/heads/devel | lib/ansible/plugins/cache/jsonfile.py | 37 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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.
... |
xia0pin9/capstone | refs/heads/next | bindings/python/test_mips.py | 44 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
from capstone.mips import *
from xprint import to_hex, to_x
MIPS_CODE = b"\x0C\x10\x00\x97\x00\x00\x00\x00\x24\x02\x00\x0c\x8f\xa2\x00\x00\x34\x21\x34\x56"
MIPS_CODE2... |
ltilve/chromium | refs/heads/igalia-sidebar | chrome/common/extensions/docs/server2/api_list_data_source.py | 41 | # 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.
from data_source import DataSource
from future import Future
from operator import itemgetter
from platform_util import GetPlatforms
from docs_server_uti... |
timqian/sms-tools | refs/heads/master | lectures/9-Sound-description/plots-code/k-means.py | 25 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import os, sys
from scipy.cluster.vq import vq, kmeans, whiten
from numpy import random
import pickle
n = 30
features = np.hstack((np.array([np.random.normal(-2,1.1,n), np.random.normal(-2,1.1,n)]), np.array([np.random.normal(2,1.5,... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/furniture/wod_pro_ns_tree_07.py | 85615 | import sys
def setup(core, object):
return |
rmawong/Android-To-PC-Keyboard | refs/heads/master | Server/keystrokes.py | 1 | import time
import win32com.client
time.sleep(3) # allow user quickly switch to another window's text field
shell = win32com.client.Dispatch("WScript.Shell")
while True:
shell.SendKeys("Hi Byron")
time.sleep(1)
shell.SendKeys("{Enter}")
time.sleep(5)
|
armab/st2contrib | refs/heads/master | packs/opscenter/actions/get_cluster_info.py | 6 | import requests
from lib.base import OpscenterAction
class GetClusterInfoAction(OpscenterAction):
def run(self, cluster_id=None, cluster_property=None):
if not cluster_id:
cluster_id = self.cluster_id
url_parts = [cluster_id, 'cluster']
if cluster_property:
url_... |
osan15/projet-BANO | refs/heads/master | srv/utils/List_Tools.py | 1 | class List_Tools(object):
@classmethod
def all_indices(cls ,value, qlist):
indices = []
idx = -1
while True:
try:
idx = qlist.index(value, idx + 1)
indices.append(idx)
except ValueError:
break
return indices
... |
adamkh/kivy | refs/heads/master | kivy/core/audio/audio_avplayer.py | 30 | '''
AudioAvplayer: implementation of Sound using pyobjus / AVFoundation.
Works on iOS / OSX.
'''
__all__ = ('SoundAvplayer', )
from kivy.core.audio import Sound, SoundLoader
from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework, INCLUDE
import sys
load_framework(INCLUDE.AVFoundation)
AVAudio... |
nvoron23/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/null_fk_ordering/tests.py | 150 | from __future__ import absolute_import
from django.test import TestCase
from .models import Author, Article, SystemInfo, Forum, Post, Comment
class NullFkOrderingTests(TestCase):
def test_ordering_across_null_fk(self):
"""
Regression test for #7512
ordering across nullable Foreign Keys... |
warnes/irrigatorpro | refs/heads/master | irrigator_pro/farms/forms.py | 1 | from django.forms import ModelForm
from django.forms.models import BaseModelFormSet
from django.forms.models import inlineformset_factory, modelformset_factory
from django.forms import Textarea
from farms.models import Farm, Field, CropSeason, CropSeasonEvent, Probe, WaterHistory
from common.models import Audit, Commen... |
blazekadam/opencv | refs/heads/master | test/distutils/setup.py | 82 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import envoy
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == "publish":
os.system("python setup.py sdist upload")
sys.exit()
required = []
setup(
name='envoy',
vers... |
opensvn/python | refs/heads/master | pygame/bpwpapcode/Chapter06/keymovement.py | 2 | background_image_filename = 'sushiplate.jpg'
sprite_image_filename = 'fugu.png'
import pygame
from pygame.locals import *
from sys import exit
from gameobjects.vector2 import Vector2
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
background = pygame.image.load(background_image_filenam... |
oscaro/django | refs/heads/oscaro-backports-1.7.10 | django/contrib/gis/tests/geogapp/tests.py | 3 | """
Tests for geography support in PostGIS
"""
from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.measure import D
from django.contrib.gis.tests.utils import postgis
from dj... |
tornadozou/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/ops/bijectors/affine_linear_operator_impl.py | 45 | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.