repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
helgee/euroscipy_proceedings | refs/heads/master | publisher/tempita/_looper.py | 140 | """
Helper for looping over sequences, particular in templates.
Often in a loop in a template it's handy to know what's next up,
previously up, if this is the first or last item in the sequence, etc.
These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context.... |
olemis/sqlalchemy | refs/heads/master | lib/sqlalchemy/engine/util.py | 81 | # engine/util.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import util
def connection_memoize(key):
"""Decorator, memoize a functi... |
methane/minefield | refs/heads/master | setup.py | 1 | from setuptools import Extension, setup
import os
import sys
import os.path
import platform
import fnmatch
develop = False
if os.environ.get("MINEFIELD_DEVELOP") == "1":
develop = True
# develop = True
def read(name):
return open(os.path.join(os.path.dirname(__file__), name)).read()
def check_platform():
... |
openaid-IATI/OIPA | refs/heads/master | OIPA/geodata/importer/tests/test_country_import.py | 2 | from django.test import TestCase
from mock import MagicMock
from geodata.factory.geodata_factory import CountryFactory, RegionFactory
from geodata.importer.country import CountryImport
from geodata.models import Country
from iati_vocabulary.factory import vocabulary_factory
class CountryImportTestCase(TestCase):
... |
WeirdCoder/rss-2014-team-3 | refs/heads/master | devel/lib/python2.7/dist-packages/gc_msgs/msg/_SonarStatusMsg.py | 1 | """autogenerated by genpy from gc_msgs/SonarStatusMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class SonarStatusMsg(genpy.Message):
_md5sum = "52ba6afcf7d449b1d16c7d561ad4ec82"
_type = "gc_msgs/SonarStatusMsg"
_has_header = False #flag t... |
lumig242/Hue-Integration-with-CDAP | refs/heads/pull3 | apps/zookeeper/setup.py | 38 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
houshengbo/nova_vmware_compute_driver | refs/heads/attach-detach-VMware-iSCSI-driver | nova/openstack/common/notifier/rpc_notifier.py | 2 | # 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... |
DarkRainX/ufoai | refs/heads/master | contrib/buildbot/CUnitTest.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil -*-
# Copyright (C) 2002-2010 UFO: Alien Invasion.
#
# 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, eith... |
instagrambot/instabot | refs/heads/master | examples/save_users_followers_into_file.py | 2 | """
instabot example
Workflow:
Save users' followers into a file.
"""
import argparse
import os
import sys
sys.path.append(os.path.join(sys.path[0], "../"))
from instabot import Bot, utils # noqa: E402
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("-u", type=str, help="usernam... |
MichaelAquilina/numpy | refs/heads/master | numpy/lib/tests/test_regression.py | 120 | from __future__ import division, absolute_import, print_function
import os
import sys
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_array_almost_equal, assert_raises
)
from numpy.testing.utils import _assert_valid_refcount
from... |
caramucho/ns3-ndnsim | refs/heads/mybranch | src/csma-layout/bindings/modulegen__gcc_LP64.py | 24 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
jacobwindsor/django-reviewable | refs/heads/master | build/lib.linux-x86_64-2.7/Reviewable/migrations/0001_initial.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-03 22:20
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import stream_django.activity
class Migration(migrations.Migration):
initial = True
depe... |
nricklin/PyGithub | refs/heads/master | github/tests/IssueComment.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
DEAP/deap | refs/heads/master | examples/ga/nqueens.py | 12 | # This file is part of DEAP.
#
# DEAP 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) any later version.
#
# DEAP is distributed ... |
eayunstack/horizon | refs/heads/master | openstack_dashboard/dashboards/project/databases/tests.py | 23 | # Copyright 2013 Mirantis Inc.
# Copyright 2013 Rackspace Hosting.
#
# 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
#
# Unles... |
django-danceschool/django-danceschool | refs/heads/master | danceschool/core/migrations/0029_auto_20200106_2246.py | 1 | # Generated by Django 2.2.6 on 2020-01-07 03:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_merge_20190822_2304'),
]
operations = [
migrations.AlterModelOptions(
name='registration',
options={'ordering':... |
vmindru/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_ptp.py | 63 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/vehicle/landspeeder_usv5_s02.py | 85615 | import sys
def setup(core, object):
return |
LukaOo/Cervix2017 | refs/heads/master | scripts/embeding_to_features.py | 1 | import sys
import os
import h5py
import numpy as np # linear algebra
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-i", "--input", dest="input",
help="Input embedings path")
parser.add_option("-o", "--output", dest="output",
... |
imjonsnooow/vivisect | refs/heads/master | PE/ordlookup/ws2_32.py | 56 |
ord_names = {
1:'accept',
2:'bind',
3:'closesocket',
4:'connect',
5:'getpeername',
6:'getsockname',
7:'getsockopt',
8:'htonl',
9:'htons',
10:'ioctlsocket',
11:'inet_addr',
12:'inet_ntoa',
13:'listen',
14:'ntohl',
15:'ntohs',
16:'recv',
17:'recvfrom',
... |
jostep/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sinh_arcsinh_test.py | 16 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
madtypist/madtypist.github.io | refs/heads/master | .bundle/gems/pygments.rb-0.6.0/vendor/pygments-main/pygments/lexers/text.py | 47 | # -*- coding: utf-8 -*-
"""
pygments.lexers.text
~~~~~~~~~~~~~~~~~~~~
Lexers for non-source code file types.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from bisect import bisect
from pygments.lexer import Lexer, LexerC... |
kurikaesu/arsenalsuite | refs/heads/master | python/scripts/sys_path.py | 11 | from _winreg import *
import os, sys, win32gui, win32con
path = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
reg = None
key = None
def init():
global reg, key
reg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
key = OpenKey(reg, path, 0, KEY_ALL_ACCESS)
def cleanup():
CloseKey(key)
CloseKey(reg... |
jcoady9/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/AES.py | 407 | """Abstract class for AES."""
class AES:
def __init__(self, key, mode, IV, implementation):
if len(key) not in (16, 24, 32):
raise AssertionError()
if mode != 2:
raise AssertionError()
if len(IV) != 16:
raise AssertionError()
self.isBlockCipher = ... |
bignerdranch/mysql-postgresql-converter | refs/heads/master | db_converter.py | 4 | #!/usr/bin/env python
"""
Fixes a MySQL dump made with the right format so it can be directly
imported to a new PostgreSQL database.
Dump using:
mysqldump --compatible=postgresql --default-character-set=utf8 -r databasename.mysql -u root databasename
"""
import re
import sys
import os
import time
import subprocess
... |
docmeth02/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/base.py | 80 | from couchpotato.core.media._base.providers.info.base import BaseInfoProvider
class MovieProvider(BaseInfoProvider):
type = 'movie'
|
signed/intellij-community | refs/heads/master | python/testData/inspections/EmptyListOfBaseClasses_after.py | 239 | class C:
pass |
ctuning/ck | refs/heads/master | ck/repo/module/model.sklearn/module.py | 1 | #
# Collective Knowledge (Unified modeling using python sklearn)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin
#
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck=None # Will be ... |
KnCMiner/bitcoin | refs/heads/knc | qa/rpc-tests/mempool_resurrect_test.py | 133 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework.test... |
awni/tensorflow | refs/heads/master | tensorflow/python/ops/linalg_grad.py | 18 | # 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 required by applicable law or a... |
Yatekii/backdoor | refs/heads/master | webui/blueprints/control.py | 1 | """
NFC controlled door access.
Copyright (C) 2015 Yatekii yatekii(at)yatekii.ch
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (... |
alvesjnr/tOSM | refs/heads/master | tests/__init__.py | 2 |
# tOSM - Tiny Object to Structure Modeller
# Copyright (C) 2012 - Antonio Ribeiro Alves Junior
#
# 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 ... |
aspidites/django | refs/heads/master | django/contrib/gis/geos/prototypes/__init__.py | 319 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
from django.contrib.gis.geos.prototypes.coordseq import ( # NOQA
create_cs, cs_clone, cs_getdims, cs_getordinate, cs_getsize, cs_getx,
cs_gety, cs_... |
Nowheresly/account-financial-tools | refs/heads/8.0 | currency_rate_update/services/update_service_ECB.py | 41 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# Abstract class to fetch rates from European Central Bank
#
# This program is free software: you can redistribute it and/o... |
demis001/scikit-bio | refs/heads/master | skbio/io/format/lsmat.py | 11 | """
Labeled square matrix format (:mod:`skbio.io.format.lsmat`)
===========================================================
.. currentmodule:: skbio.io.format.lsmat
The labeled square matrix file format (``lsmat``) stores numeric square
matrix data relating a set of objects along each axis. The format also stores
ide... |
sysadminmatmoz/OCB | refs/heads/9.0 | addons/purchase/company.py | 41 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import fields, models
class company(models.Model):
_inherit = 'res.company'
po_lead = fields.Float(string='Purchase Lead Time', required=True,\
help="Margin of error for vendor lead times. ... |
wagnerand/zamboni | refs/heads/master | migrations/366-tier-0.py | 46 | from decimal import Decimal
from market.models import Price, PriceCurrency
def run():
tier = Price.objects.create(name='Tier 0', price=Decimal('0'),
active=True)
for currency in ['CAD', 'EUR', 'GBP', 'JPY']:
PriceCurrency.objects.create(tier=tier, price=Decimal('0'),
... |
scottdangelo/RemoveVolumeMangerLocks | refs/heads/RemoveVolumeManagerLocks | cinder/volume/drivers/rbd.py | 7 | # Copyright 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 l... |
TribeMedia/sky_engine | refs/heads/master | mojo/public/python/mojo_bindings/promise.py | 28 | # Copyright 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.
"""
Promise used by the python bindings.
The API is following the ECMAScript 6 API for promises.
"""
import sys
class Promise(object):
"""The promise o... |
lshain-android-source/external-gtest | refs/heads/master | test/gtest_catch_exceptions_test.py | 414 | #!/usr/bin/env python
#
# Copyright 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 o... |
pindia/tsaevents | refs/heads/master | lib/vobject/__init__.py | 30 | """
VObject Overview
================
vobject parses vCard or vCalendar files, returning a tree of Python objects.
It also provids an API to create vCard or vCalendar data structures which
can then be serialized.
Parsing existing streams
------------------------
Streams containing one or many L... |
dushu1203/chromium.src | refs/heads/nw12 | chrome/test/ispy/server/app.py | 101 | # 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 os
import sys
import webapp2
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
import debug_view_handler
import image_handler
impor... |
letuananh/beautifulsoup | refs/heads/master | bs4-python2/dammit.py | 408 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... |
poljeff/odoo | refs/heads/8.0 | openerp/report/render/rml2html/rml2html.py | 438 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2005, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... |
FNST-OpenStack/cloudkitty | refs/heads/master | cloudkitty/rating/__init__.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2014 Objectif Libre
#
# 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 ... |
nke001/attention-lvcsr | refs/heads/master | libs/Theano/theano/sparse/sandbox/truedot.py | 7 | import unittest
import theano
import numpy
import scipy.sparse as sp
from theano import sparse
from theano import gof, tensor, compile
from theano.sparse.tests.test_basic import eval_outputs
from theano.sparse.basic import (
_is_sparse_variable, _is_dense_variable,
as_sparse_variable, _is_sparse, _mtypes, _m... |
mhils/readthedocs.org | refs/heads/master | readthedocs/core/migrations/0002_make_userprofile_user_a_onetoonefield.py | 36 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='use... |
momentum/canteen | refs/heads/master | canteen_tests/test_test.py | 2 | # -*- coding: utf-8 -*-
"""
test tests
~~~~~~~~~~
tests, well, the upper class structure that powers unit and
integration testing stuff.
:author: Sam Gammon <sg@samgammon.com>
:copyright: (c) Sam Gammon, 2014
:license: This software makes use of the MIT Open Source License.
A copy of this ... |
jonathan-besanceney/Transition | refs/heads/dev | transitioncore/eventsinterface/__init__.py | 1 | # ------------------------------------------------------------------------------
# Name: eventsinterface
# Purpose: eventsinterface package
#
# Author: Jonathan Besanceney <jonathan.besanceney@gmail.com>
#
# Created: 01/06/14
# Copyright: (c) 2014 Jonathan Besanceney
#
# This file is a part of Tra... |
bittner/django-cms | refs/heads/develop | cms/test_utils/project/placeholderapp_urls.py | 6 | from django.views.i18n import javascript_catalog
from django.views.static import serve
from cms.test_utils.project.placeholderapp.views import detail_view, detail_view_multi
from cms.utils.compat.dj import is_installed
from cms.utils.conf import get_cms_setting
from django.conf import settings
from django.conf.urls im... |
cloudify-cosmo/cloudify-plugins-common | refs/heads/master | cloudify/dispatch.py | 1 | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... |
allotria/intellij-community | refs/heads/master | python/testData/refactoring/move/moveNamespacePackage1/after/src/b.py | 79 | import nssubpkg.a
print(nssubpkg.a.VAR) |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/py-azure-cli-telemetry/package.py | 3 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyAzureCliTelemetry(PythonPackage):
"""Microsoft Azure CLI Telemetry Package."""
homepage = "https://githu... |
varunkumta/azure-linux-extensions | refs/heads/master | VMEncryption/main/oscrypto/rhel_72_lvm/encryptstates/PatchBootSystemState.py | 3 | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
# U... |
RondaStrauch/landlab | refs/heads/master | landlab/ca/oriented_hex_cts.py | 6 | #! /usr/env/python
"""Simple hexagonal Landlab cellular automaton
This file defines the OrientedHexCTS class, which is a sub-class of
CellLabCTSModel that implements a simple, non-oriented, hex-grid
CA. Like its parent class, OrientedHexCTS implements a continuous-time,
stochastic, pair-based CA. The hex grid has 3 pr... |
datagovuk/ckanext-dgu-local | refs/heads/master | ckanext/dgulocal/tests/__init__.py | 1 | # this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
# Initialise basic logging only for tests
import logging
logging.basicConfig(level=logging.DEBUG) |
tecnovert/particl-core | refs/heads/master | contrib/testgen/gen_key_io_test_vectors.py | 18 | #!/usr/bin/env python3
# Copyright (c) 2012-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Generate valid and invalid base58/bech32(m) address and private key test vectors.
Usage:
PYTHONPA... |
AndyLavr/Aspire-SW5-012_Kernel_4.8 | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 268 | # 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... |
tebriel/dd-agent | refs/heads/master | tests/checks/integration/test_mcache.py | 16 | # stdlib
import os
from subprocess import PIPE, Popen
import time
# 3p
import memcache
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest
GAUGES = [
"total_items",
"curr_items",
"limit_maxbytes",
"uptime",
"bytes",
"curr... |
c86j224s/snippet | refs/heads/master | Python_Pygments/lib/python3.6/site-packages/pygments/lexers/oberon.py | 31 | # -*- coding: utf-8 -*-
"""
pygments.lexers.oberon
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Oberon family languages.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, words
from pygmen... |
Elbagoury/odoo | refs/heads/8.0 | openerp/addons/test_impex/__openerp__.py | 74 | # -*- coding: utf-8 -*-
{
'name': 'test-import-export',
'version': '0.1',
'category': 'Tests',
'description': """A module to test import/export.""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': ['ir.model.access... |
blazewicz/micropython | refs/heads/master | tests/basics/string1.py | 92 | # basic strings
# literals
print('abc')
print(r'abc')
print(u'abc')
print(repr('\a\b\t\n\v\f\r'))
print('\z') # unrecognised escape char
# construction
print(str())
print(str('abc'))
# inplace addition
x = 'abc'
print(x)
x += 'def'
print(x)
# binary ops
print('123' + "456")
print('123' * 5)
try:
'123' * '1'
exc... |
dkarakats/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/forms.py | 92 | """
Defines a form for providing validation of CourseEmail templates.
"""
import logging
from django import forms
from django.core.exceptions import ValidationError
from bulk_email.models import CourseEmailTemplate, COURSE_EMAIL_MESSAGE_BODY_TAG, CourseAuthorization
from opaque_keys import InvalidKeyError
from xmodu... |
JCBarahona/edX | refs/heads/master | common/test/data/uploads/python_lib_zip/sub/submodule.py | 223 | HELLO = "world"
|
sivel/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/lookup/mylookup2.py | 66 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.lookup import LookupBase
class LookupModule(LookupBase):
def run(self, terms, variables, **kwargs):
return ['mylookup2_from_user_dir']
|
marscher/bhmm | refs/heads/master | bhmm/_external/sklearn/utils.py | 3 | '''
Created on 07.07.2015
@author: marscher
'''
import warnings
import numbers
import numpy as np
import scipy.sparse as sp
import six
from inspect import getargspec
class NotFittedError(Exception):
pass
def _num_samples(x):
"""Return number of samples in array-like x."""
if hasattr(x, 'fit'):
... |
imapp-pl/golem | refs/heads/develop | tests/golem/resource/swift/test_swift_resourcemanager.py | 1 | import inspect
import os
import unittest
import uuid
import ovh
import requests
from golem.resource.client import file_multihash
from golem.resource.swift.api import api_translate_exceptions
from golem.resource.swift.resourcemanager import OpenStackSwiftClient
from golem.testutils import TempDirFixture
class TestSw... |
allo-/django-bingo | refs/heads/master | bingo/config.py | 1 | from django.db import models
from django.contrib.sites.models import Site
from colorful.fields import RGBColorField
from django.contrib.sites.shortcuts import get_current_site
from django.utils.translation import ugettext as _, pgettext_lazy
def default_time():
now = timezone.get_current_timezone().normalize(timez... |
sergio-incaser/bank-payment | refs/heads/8.0 | __unported__/bank_statement_instant_voucher/model/account_bank_statement_line.py | 19 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 - 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
RayMick/SFrame | refs/heads/master | oss_src/unity/python/sframe/extensions.py | 9 | """
This module hosts all the extension functions and classes created via SDK.
The function :py:func:`ext_import` is used to import a toolkit module (shared library)
into the workspace. The shared library can be directly imported
from a remote source, e.g. http, s3, or hdfs.
The imported module will be under namespace... |
datagovuk/ckanext-issues | refs/heads/master | ckanext/issues/__init__.py | 56 | try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
|
srisurya95/android_kernel_motorola_msm8226 | refs/heads/cm-12.1 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
srm912/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py | 499 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
debjyoti385/dartnews | refs/heads/master | crawling/newsParser.py | 1 | from HTMLParser import HTMLParser
import sys, re,os
from os import listdir
import Levenshtein
class MLStripper(HTMLParser):
def __init__(self):
self.reset()
self.fed = []
def handle_data(self, d):
self.fed.append(d)
def get_data(self):
return ''.join(self.fed)
def strip_tag... |
joaduo/mepinta | refs/heads/master | core/python_core/common/abstract/FrameworkBase.py | 1 | # -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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 opti... |
ravindrapanda/tensorflow | refs/heads/master | tensorflow/contrib/image/python/ops/single_image_random_dot_stereograms.py | 8 | # 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... |
kdeloach/raster-foundry | refs/heads/develop | src/rf/apps/home/routes.py | 24 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
|
sameenjalal/mavenize-beta | refs/heads/master | mavenize/apps/leaderboard/tests.py | 1 | from user_profile.models import KarmaUser
from item.models import Item
from review.models import Review, Agree, Thank
from bookmark.models import Bookmark
from leaderboard.models import KarmaAction
from social_graph.models import Backward
import nose.tools as nt
class TestLeaderboard(object):
def setup(self):
... |
dellysunnymtech/sakoman-oe | refs/heads/gnome-r13 | lib/oe/path.py | 31 | import os
def join(*paths):
"""Like os.path.join but doesn't treat absolute RHS specially"""
return os.path.normpath("/".join(paths))
def relative(src, dest):
""" Return a relative path from src to dest.
>>> relative("/usr/bin", "/tmp/foo/bar")
../../tmp/foo/bar
>>> relative("/usr/bin", "/us... |
lmtim/iOSBlogCN | refs/heads/master | Export.py | 65 | __author__ = 'wwxiang'
#coding=utf-8
import os
import re
work = os.getcwd()
resxml = work + os.path.sep + 'blogcn.opml'
workmd = work + os.path.sep + 'README.md'
def handler():
isblock = True
handlerData = []
lineNo = 0
try:
with open(workmd,'rb') as linefs:
lineCout = len(linefs... |
bgammill/Snarfcoin | refs/heads/master | contrib/testgen/base58.py | 2139 | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... |
DirtyPiece/dancestudio | refs/heads/master | Build/Tools/Python27/Lib/test/test_copy_reg.py | 130 | import copy_reg
import unittest
from test import test_support
from test.pickletester import ExtensionSaver
class C:
pass
class WithoutSlots(object):
pass
class WithWeakref(object):
__slots__ = ('__weakref__',)
class WithPrivate(object):
__slots__ = ('__spam',)
class WithSingleString(object):
... |
martinjungblut/craft-package-manager | refs/heads/master | craft/checksum.py | 1 | """ File checksum verification. """
# Standard library imports
import hashlib
def sha1(filepath, expected):
""" Calculates and verifies the SHA-1 checksum of a file's
contents.
Parameters
filepath
file to be read.
expected
the expected SHA-1 checksum.
Raises
... |
zadgroup/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_checklists.py | 104 | """ Unit tests for checklist methods in views.py. """
from contentstore.utils import reverse_course_url
from contentstore.views.checklist import expand_checklist_action_url
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.django import modulestore
import json
from contentstore.tes... |
lattwood/phantomjs | refs/heads/master | src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_xml_outfiles_test.py | 718 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/armor/armor_appearance_rebel_battle_utility_belt_gcw.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_sith_shadow_trn_m_02.py | 85615 | import sys
def setup(core, object):
return |
clchiou/garage | refs/heads/master | py/g1/operations/cores/tests/test_repos.py | 1 | import unittest
import dataclasses
from pathlib import Path
import g1.files
from g1.bases.assertions import ASSERT
from g1.files import locks
from g1.operations.cores import models
from g1.operations.cores import repos
from g1.texts import jsons
try:
from g1.devtools.tests import filelocks
except ImportError:
... |
ptoraskar/django | refs/heads/master | tests/generic_views/test_list.py | 309 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.utils.encoding import force_str
from django.views.generic.base import View
from .models import Artist, Author, Book, ... |
VirtualMonitor/VirtualMonitor | refs/heads/master | src/libs/libxml2-2.6.31/python/tests/tstLastError.py | 87 | #!/usr/bin/python -u
import sys, unittest
import libxml2
class TestCase(unittest.TestCase):
def runTest(self):
self.test1()
self.test2()
def setUp(self):
libxml2.debugMemory(1)
def tearDown(self):
libxml2.cleanupParser()
if libxml2.debugMemory(1) != 0:
... |
kawasaki2013/python-for-android-x86 | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/apps/migration/service.py | 168 | #!/usr/bin/python
#
# Copyright (C) 2008 Google.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
pihao/ChinaDNS | refs/heads/master | tests/iplist.py | 166 | #!/usr/bin/python
import random
import sys
from subprocess import Popen, PIPE
if __name__ == '__main__':
result = set()
start = random.randint(0, 1000000)
for i in range(start, start + 1000):
p = Popen((('dig +short @114.114.114.114 a '
'r%d-1.googlevideo.com') % i).split(),
... |
mycodeday/crm-platform | refs/heads/master | facebook_crm/__init__.py | 1 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# mga@openerp.com
#
# This program is free software: you can redistribute it and/or mo... |
cherrycheung/paparazzi | refs/heads/master | sw/tools/calibration/calibrate_gyro.py | 87 | #! /usr/bin/env python
# Copyright (C) 2010 Antoine Drouin
#
# This file is part of Paparazzi.
#
# Paparazzi 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, or (at your option)
# any later ... |
Yelp/pootle | refs/heads/master | pootle/i18n/bidi.py | 7 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from unicodedata impor... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/formtools/tests/tests.py | 106 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import warnings
from django import http
from django.contrib.formtools import preview, utils
from django.test import TestCase
from django.test.utils import override_settings
from django.utils._os import upath
from django.utils im... |
viswimmer1/PythonGenerator | refs/heads/master | data/python_files/72066776/import.py | 2 | import sys
from tobeimported import foo
sys.exit(foo())
|
matcatc/Test_Parser | refs/heads/master | src/TestParser/View/Tkinter/__init__.py | 1 | '''
@date Aug 28, 2010
@author: Matthew A. Todd
This file is part of Test Parser
by Matthew A. Todd
Test Parser 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... |
terranodo/geonode | refs/heads/master | geonode/contrib/geosites/integration.py | 21 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
marado/youtube-dl | refs/heads/master | youtube_dl/extractor/dreisat.py | 42 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate
class DreiSatIE(InfoExtractor):
IE_NAME = '3sat'
_VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php)?\?(?:(?:mode|display)=[^&]+&)*obj=(?P<id>[0-9]+)$'
_TEST = {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.