repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Ahmed--Mohsen/leetcode
refs/heads/master
bitwise_AND_of_numbers_range.py
1
""" Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. """ class Solution: # @param {integer} m # @param {integer} n # @return {integer} def rangeBitwiseAnd(self, m, n): # x tells ...
yamada-h/ryu
refs/heads/master
ryu/contrib/ncclient/operations/session.py
82
# Copyright 2009 Shikhar Bhushan # # 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...
mansonul/events
refs/heads/master
events/contrib/plugins/form_handlers/db_store/defaults.py
1
__title__ = 'fobi.contrib.plugins.form_handlers.db_store.defaults' __author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>' __copyright__ = '2014-2017 Artur Barseghyan' __license__ = 'GPL 2.0/LGPL 2.1' __all__ = ( 'CSV_DELIMITER', 'CSV_QUOTECHAR', ) CSV_DELIMITER = ',' CSV_QUOTECHAR = '"'
ClearCorp/server-tools
refs/heads/9.0
setup/base_suspend_security/odoo_addons/__init__.py
13048
__import__('pkg_resources').declare_namespace(__name__)
asadoughi/quark
refs/heads/master
quark/plugin.py
2
# Copyright 2013 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 requ...
fallen/linux-milkymist
refs/heads/mmu
tools/perf/scripts/python/futex-contention.py
11261
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
pwong-mapr/private-hue
refs/heads/HUE-1096-abe
desktop/core/ext-py/Django-1.4.5/django/core/management/commands/dumpdata.py
84
from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core import serializers from django.db import router, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict from optparse import make_option class Command(BaseCommand): ...
wbyne/QGIS
refs/heads/master
scripts/qgis_fixes/fix_throw.py
77
from lib2to3.fixes.fix_throw import FixThrow
fe11x/pythondotorg
refs/heads/master
jobs/migrations/0002_auto_20150211_1634.py
14
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import markupfield.fields class Migration(migrations.Migration): dependencies = [ ('jobs', '0001_initial'), ] operations = [ migrations.AlterField( model_name='job', ...
ikasumi/chainer
refs/heads/master
cupy/manipulation/dims.py
2
import cupy from cupy import internal def atleast_1d(*arys): """Converts arrays to arrays with dimensions >= 1. Args: arys (tuple of arrays): Arrays to be converted. All arguments must be cupy.ndarray objects. Only zero-dimensional array is affected. Returns: If there are onl...
sgmeyer/angular-infinitescroll
refs/heads/master
node_modules/grunt-coffee/node_modules/grunt/node_modules/gzip-js/test/runner.py
182
#!/usr/bin/env python import os import sys import shutil from colorama import Fore import argparse import zipTest import unzipTest parser = argparse.ArgumentParser(description='Process command-line arguments') parser.add_argument('--file', '-f', metavar='path/to/file', type=str, nargs='?', help='Path to file to use f...
ibinti/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/admin/helpers.py
78
from django import forms from django.conf import settings from django.contrib.admin.util import flatten_fieldsets, lookup_field from django.contrib.admin.util import display_for_field, label_for_field from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from d...
bradh/openchange
refs/heads/master
mapiproxy/services/ocsmanager/ocsmanager/controllers/as.py
8
# as.py -- GetUserAvailability Exchange Web Service # -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 Julien Kerihuel <jkerihuel@openchange.org> # Enrique J. Hernández <ejhernandez@zentyal.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of t...
DominoTree/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/wptserve/wptserve/__init__.py
186
from .server import WebTestHttpd, WebTestServer, Router # noqa: F401 from .request import Request # noqa: F401 from .response import Response # noqa: F401
loveheaven/ocropy
refs/heads/master
ocrolib/toplevel.py
2
import functools import linecache import numpy import os import sys import warnings from types import NoneType # FIXME from ... import wrap ### printing def strc(arg,n=10): """Compact version of `str`.""" if isinstance(arg,float): return "%.3g"%arg if type(arg)==list: return "[%s|%d]"%(","...
twobob/buildroot-kindle
refs/heads/master
output/build/host-python-2.7.2/Doc/includes/mp_synchronize.py
11
# # A test file for the `multiprocessing` package # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # import time, sys, random from Queue import Empty import multiprocessing # may get overwritten #### TEST_VALUE def value_func(running, mutex): random.seed() time.sleep(random.rando...
justb4/GeoHealthCheck
refs/heads/master
GeoHealthCheck/migrations/versions/992013af402f_.py
3
"""empty message Revision ID: 992013af402f Revises: 496427d03f87 Create Date: 2017-04-24 17:51:15.481079 """ from alembic import op import sqlalchemy as sa import imp import os from GeoHealthCheck.migrations import alembic_helpers # revision identifiers, used by Alembic. revision = '992013af402f' down_revision = '49...
the9ull/OpenBazaar-Server
refs/heads/master
wireprotocol.py
3
__author__ = 'chris' from zope.interface.verify import verifyObject from txrudp.rudp import ConnectionMultiplexer from txrudp.connection import HandlerFactory, Handler from txrudp.crypto_connection import CryptoConnectionFactory from interfaces import MessageProcessor from protos.message import Message from log import ...
gnuhub/intellij-community
refs/heads/master
python/testData/inspections/PyCompatibilityInspection/printStatement.py
69
<warning descr="Python version >= 3.0 do not support this syntax. The print statement has been replaced with a print() function">print "One value"</warning>
RuudBurger/CouchPotatoV1
refs/heads/master
library/hachoir_parser/image/jpeg.py
12
""" JPEG picture parser. Information: - APP14 documents http://partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/doc-files/jpeg_metadata.html#color - APP12: http://search.cpan.org/~exiftool/Image-ExifTool/lib/Image/ExifTool/TagNames....
mavenlin/tensorflow
refs/heads/master
tensorflow/python/ops/math_grad_test.py
26
# 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...
provaleks/o8
refs/heads/8.0
addons/stock_account/wizard/stock_return_picking.py
342
# -*- 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...
haad/ansible
refs/heads/devel
lib/ansible/modules/cloud/cloudstack/cs_role.py
49
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
rsoumyassdi/nuxeo-drive
refs/heads/master
nuxeo-drive-client/nxdrive/osi/windows/windows.py
1
''' @author: Remi Cattiau ''' from nxdrive.osi import AbstractOSIntegration from nxdrive.logging_config import get_logger import os import sys if sys.platform == "win32": import _winreg log = get_logger(__name__) class WindowsIntegration(AbstractOSIntegration): RUN_KEY = 'Software\\Microsoft\\Windows\\Current...
hippich/p2pool
refs/heads/master
p2pool/web.py
8
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer, reactor from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data, p2p ...
shepdl/stream-daemon
refs/heads/master
Store.py
1
class Store(object): """ A master StorePool object provides Stores that administer saving data. Each XXListener creates a series of XXStore objects that caches and stores data. If Project.examine_message returns True, XXStore stores the data. """ def __init__(self, project, commit_limit=None): ...
erigones/esdc-ce
refs/heads/master
api/dc/image/views.py
1
from api.decorators import api_view, request_data from api.permissions import IsAdmin, IsSuperAdminOrReadOnly from api.dc.image.api_views import DcImageView __all__ = ('dc_image_list', 'dc_image') @api_view(('GET',)) @request_data(permissions=(IsAdmin, IsSuperAdminOrReadOnly)) def dc_image_list(request, data=None): ...
chirilo/mozillians
refs/heads/master
vendor-local/lib/python/south/tests/freezer.py
142
from south.tests import unittest from south.creator.freezer import model_dependencies from south.tests.fakeapp import models class TestFreezer(unittest.TestCase): def test_dependencies(self): self.assertEqual(set(model_dependencies(models.SubModel)), set([models.BaseModel, models....
sergio-incaser/odoo
refs/heads/8.0
addons/crm_helpdesk/crm_helpdesk.py
182
# -*- 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...
m-kuhn/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/r_li_dominance.py
12
# -*- coding: utf-8 -*- """ *************************************************************************** r_li_dominance.py ----------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ************************...
qedi-r/home-assistant
refs/heads/dev
tests/components/config/test_config_entries.py
3
"""Test config entries API.""" import asyncio from collections import OrderedDict from unittest.mock import patch import pytest import voluptuous as vol from homeassistant import config_entries as core_ce, data_entry_flow from homeassistant.config_entries import HANDLERS from homeassistant.core import callback from ...
Evercoder/electron
refs/heads/master
tools/mac/find_sdk.py
77
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Prints the lowest locally available SDK version greater than or equal to a given minimum sdk version to standard output. Usage:...
UstadMobile/exelearning-extjs5-mirror
refs/heads/master
twisted/test/test_util.py
16
# -*- test-case-name: twisted.test.test_util -*- # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.python import util from twisted.python.runtime import platformType import os.path, sys import shutil, errno class UtilTestCase(unittest.T...
Rafiot/misp-modules
refs/heads/master
misp_modules/modules/export_mod/cef_export.py
2
import json import base64 import datetime misperrors = {'error': 'Error'} # possible module-types: 'expansion', 'hover' or both moduleinfo = {'version': '1', 'author': 'Hannah Ward', 'description': 'Export a module in CEF format', 'module-type': ['export']} # config fields that your code ...
tht5cs/cs3240-labdemo
refs/heads/master
loop.py
1
__author__ = 'tht5cs' def badLoop(n): for i in range (0, n): print("blar")
ProfessorX/Emacs-Laptop
refs/heads/master
elpa/elpy-20140810.7/elpy/ropebackend.py
2
"""Elpy backend using the Rope library. This backend uses the Rope library: http://rope.sourceforge.net/ """ import os import time import rope.contrib.codeassist import rope.base.project import rope.base.libutils import rope.base.exceptions import rope.contrib.findit import elpy.pydocutils VALIDATE_EVERY_SECONDS ...
jayceyxc/hue
refs/heads/master
desktop/core/src/desktop/app_template_proxy/src/app_name/models.py
929
# 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...
Workday/OpenFrame
refs/heads/master
tools/auto_bisect/source_control_test.py
45
# 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. """Unit tests for the source_control module.""" import unittest import mock import source_control class SourceControlTest(unittest.TestCase): @mock.pa...
FusionSP/android_external_chromium_org
refs/heads/lp5.1
third_party/cython/src/Cython/Compiler/CodeGeneration.py
99
from Cython.Compiler.Visitor import VisitorTransform from Cython.Compiler.Nodes import StatListNode class ExtractPxdCode(VisitorTransform): """ Finds nodes in a pxd file that should generate code, and returns them in a StatListNode. The result is a tuple (StatListNode, ModuleScope), i.e. everythin...
alexallah/django
refs/heads/master
tests/unmanaged_models/models.py
27
""" Models can have a ``managed`` attribute, which specifies whether the SQL code is generated for the table on various manage.py operations. """ from django.db import models # All of these models are created in the database by Django. class A01(models.Model): f_a = models.CharField(max_length=10, db_index=Tr...
Sticklyman1936/workload-automation
refs/heads/master
wlauto/core/version.py
3
# Copyright 2014-2015 ARM Limited # # 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 w...
mandeepdhami/horizon
refs/heads/master
openstack_dashboard/dashboards/project/networks/tests.py
9
# Copyright 2012 NEC 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 # # Unless required by applicable law or ag...
code-for-india/sahana_shelter_worldbank
refs/heads/hackathon
modules/unit_tests/suite.py
6
# -*- coding: utf-8 -*- # # Sahana Eden Unit Tests # # To run this test suite use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/suite.py import unittest # ============================================================================= def run_suite(*modules): """ Run the test suite """ ...
santisiri/popego
refs/heads/master
envs/ALPHA-POPEGO/lib/python2.5/site-packages/Paste-1.4.2-py2.5.egg/paste/util/classinit.py
77
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php class ClassInitMeta(type): def __new__(meta, class_name, bases, new_attrs): cls = type.__new__(meta, class_name, bases, new_attrs) ...
rahul67/hue
refs/heads/master
desktop/core/ext-py/PyYAML-3.09/lib3/yaml/composer.py
273
__all__ = ['Composer', 'ComposerError'] from .error import MarkedYAMLError from .events import * from .nodes import * class ComposerError(MarkedYAMLError): pass class Composer: def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if self.ch...
unomena/tunobase-core
refs/heads/master
tunobase/tagging/migrations/0002_auto__add_field_tag_slug__chg_field_tag_title.py
3
# -*- coding: utf-8 -*- 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 'Tag.slug' db.add_column(u'tagging_tag', 'slug', self.gf('django.db.mod...
ppanczyk/ansible
refs/heads/devel
lib/ansible/modules/packaging/language/bundler.py
17
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Tim Hoiberg <tim.hoiberg@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
albertocottica/microfoundations-community-management
refs/heads/master
code/edgesense copy/python/edgesense/catalyst/__init__.py
3
import inference import extract
dbcollection/dbcollection
refs/heads/master
dbcollection/datasets/pascal/pascal_voc_2012/trainval_filenames.py
2
filenames = ["2008_000002", "2008_000003", "2008_000007", "2008_000008", "2008_000009", "2008_000015", "2008_000016", "2008_000019", "2008_000021", "2008_000023", "2008_000026", "2008_000027", "2008_000028", "2008_000032", "2008_000033", "2008_000034", "2008_000036", "2008_000037", "2008_000041", "2008_000042", "2008_0...
adoosii/edx-platform
refs/heads/master
common/test/acceptance/tests/lms/test_lms_problems.py
9
# -*- coding: utf-8 -*- """ Bok choy acceptance tests for problems in the LMS See also old lettuce tests in lms/djangoapps/courseware/features/problems.feature """ from textwrap import dedent from ..helpers import UniqueCourseTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import ...
selboo/easyhadoop
refs/heads/master
EasyHadoopCentral/NodeAgent.py
2
#!/usr/bin/python # -*- coding: utf8 -*- #EasyHadoopManager remote control threading daemon #Start written by Xianglei at 08/20/2012 #Support with CentOS and RedHat 5.x or 6.x #under GPLv3 lisence #modified by [] #Thank you for using easyhadoop # # Autogenerated by Thrift Compiler (0.8.0) # # DO NOT EDIT UNLESS YOU A...
konstantint/pyliftover
refs/heads/master
setup.py
1
''' Pure-python implementation of UCSC ``liftOver`` genome coordinate conversion. Setup script. Note that "python setup.py test" invokes pytest on the package. This checks both xxx_test modules and docstrings. Copyright 2013, Konstantin Tretyakov. http://kt.era.ee/ Licensed under MIT license. ''' from setuptools im...
andreparrish/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/encodings/big5.py
816
# # big5.py: Python Unicode Codec for BIG5 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_tw, codecs import _multibytecodec as mbc codec = _codecs_tw.getcodec('big5') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrementalE...
fajoy/nova
refs/heads/grizzly-2
nova/api/openstack/compute/contrib/flavor_access.py
9
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 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...
larsmans/numpy
refs/heads/master
numpy/doc/howtofind.py
134
""" ================= How to Find Stuff ================= How to find things in NumPy. """ from __future__ import division, absolute_import, print_function
yousafsyed/casperjs
refs/heads/master
bin/Lib/test/badsyntax_3131.py
181
# -*- coding: utf-8 -*- € = 2
GFEeV/SUNHand
refs/heads/master
Models/toolModel.py
1
# -*- coding: utf-8 -*- from PyQt5 import QtCore from Queue import queueItem import pickle class ToolModel (QtCore.QAbstractListModel): def __init__(self, tools, parent=None): super(ToolModel, self).__init__(parent) self.root = queueItem.Item("ROOT") for tool in tools: self.root.addChild(tool) ...
Micronaet/micronaet-production
refs/heads/master
production_grid_report/__openerp__.py
1
############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # 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 ...
lmazuel/azure-sdk-for-python
refs/heads/master
azure-mgmt-containerinstance/azure/mgmt/containerinstance/operations/container_groups_operations.py
1
# 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 ...
marshall/logcat-color
refs/heads/master
test/format_test.py
5
from common import * from logcatcolor.format import * import unittest MARKER_LINE = "--------- beginning of /dev/log/main" BRIEF_LINE = "I/Tag( 123): message" PROCESS_LINE = "I( 123) message (Tag)" TAG_LINE = "I/Tag : message" THREAD_LINE = "I( 123:0x123) message" TIME_LINE = "01-02 12:34:56.000 D/Tag( 123): mes...
peterm-itr/edx-platform
refs/heads/master
lms/djangoapps/lms_migration/migrate.py
18
# # migration tools for content team to go from stable-edx4edx to LMS+CMS # import json import logging import os import xmodule.modulestore.django as xmodule_django from xmodule.modulestore.django import modulestore from django.http import HttpResponse from django.conf import settings import track.views try: fro...
sirk390/coinpy
refs/heads/master
coinpy-lib/src/coinpy/model/blockchain/block_handle.py
1
class BlockHandle(): def __init__(self): pass def get_block(self): pass def get_height(self): pass def get_blockheader(self): pass
elijah513/ice
refs/heads/master
cpp/test/Ice/exceptions/run.py
3
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
2ndQuadrant/ansible
refs/heads/master
lib/ansible/modules/network/fortimanager/fmgr_device_group.py
39
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
devendermishrajio/nova_test_latest
refs/heads/master
nova/scheduler/manager.py
24
# Copyright (c) 2010 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
yonglehou/grpc
refs/heads/master
src/python/src/grpc/framework/foundation/_timer_future.py
47
# Copyright 2015, 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...
TheMrNomis/mavlink
refs/heads/master
pymavlink/setup.py
6
# Work around mbcs bug in distutils. # http://bugs.python.org/issue10945 import codecs try: codecs.lookup('mbcs') except LookupError: ascii = codecs.lookup('ascii') func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs') codecs.register(func) from distutils.core import setup, Extension import glob...
ytjiang/django
refs/heads/master
tests/migrations/migrations_test_apps/alter_fk/author_app/migrations/0001_initial.py
379
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Author', fields=[ ('id', models.AutoField(seria...
keen99/SickRage
refs/heads/master
lib/guessit/plugins/__init__.py
51
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
joshmoore/openmicroscopy
refs/heads/omero43-ice34
components/tools/OmeroPy/test/clitest/db.py
1
#!/usr/bin/env python """ Test of the omero db control. Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import unittest, os, subprocess, StringIO from path import path from omero.plugins.db import DatabaseControl from omero.cli import C...
fishcorn/pylearn2
refs/heads/master
pylearn2/scripts/icml_2013_wrepl/multimodal/make_wordlist.py
41
from __future__ import print_function import os from pylearn2.utils.string_utils import preprocess def main(): base = '${PYLEARN2_DATA_PATH}/esp_game/ESPGame100k/labels/' base = preprocess(base) paths = sorted(os.listdir(base)) assert len(paths) == 100000 words = {} for i, path in enumerate...
otherness-space/myProject003
refs/heads/master
my_project_003/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py
624
from MySQLdb.constants import FIELD_TYPE from django.contrib.gis.gdal import OGRGeomType from django.db.backends.mysql.introspection import DatabaseIntrospection class MySQLIntrospection(DatabaseIntrospection): # Updating the data_types_reverse dictionary with the appropriate # type for Geometry fields. d...
redhat-openstack/swift
refs/heads/master-patches
swift/common/middleware/catch_errors.py
45
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
pratheekms/nlp-class
refs/heads/master
unit_test_4/maxent.py
1
import json import random from create_history import get_tuples def f1(x,y): return random.randrange(2) def f2(x,y): return random.randrange(2) def f3(x,y): return random.randrange(2) def f4(x,y): return random.randrange(2) def f5(x,y): return random.randrange(2) def f6(x,y): return random.randrange(2) def...
kuropatkin/lte
refs/heads/master
.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Tools/gfortran.py
21
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import re from waflib import Utils from waflib.Tools import fc,fc_config,fc_scan,ar from waflib.Configure import conf @conf def find_gfortran(conf): fc=conf.find_program(['gfortran','g77'],var='FC')...
shubhamgupta123/erpnext
refs/heads/master
erpnext/templates/pages/cart.py
74
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals no_cache = 1 no_sitemap = 1 import frappe from erpnext.shopping_cart.cart import get_cart_quotation def get_context(context): context.update(get_cart...
agh-glk/pyconpl2013-nlp
refs/heads/master
z02_frequence.py
1
#!/usr/bin/env python # coding=utf-8 from collections import Counter from itertools import chain, imap import sys def tokenize_line(line): """ Ta funkcja przyjmuje linię tekstu "Ala ma kota, a kot ma Ale!". Powinna zwrócic generator, generujący kolejne wyrazy: ["Ala", "ma", "kota", "a", "kot", "ma", "Al...
gurneyalex/odoo
refs/heads/13.0-improve_sale_coupon_perf
addons/payment_paypal/models/payment.py
3
# coding: utf-8 import json import logging import dateutil.parser import pytz from werkzeug import urls from odoo import api, fields, models, _ from odoo.addons.payment.models.payment_acquirer import ValidationError from odoo.addons.payment_paypal.controllers.main import PaypalController from odoo.tools.float_utils ...
alfonsokim/nupic
refs/heads/master
tests/unit/nupic/algorithms/anomaly_test.py
15
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
tommyogden/maxwellbloch
refs/heads/master
bin/make-mp4-fixed-frame-2-fields.py
1
#!/usr/bin/env python # coding: utf-8 """ make-mp4-fixed-frame.py Make an MP4 video of a field solution in the fixed frame of reference. """ import argparse import os # Plot import matplotlib.pyplot as plt from matplotlib import animation import seaborn as sns import numpy as np from scipy.ndimage.interpolatio...
kcpawan/django
refs/heads/master
tests/template_tests/syntax_tests/test_named_endblock.py
521
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class NamedEndblockTests(SimpleTestCase): @setup({'namedendblocks01': '1{% block first %}_{% block second %}' '2{% endblock second %}_{% endblock first %}3'}) def ...
iniverno/RnR-LLC
refs/heads/master
simics-3.0-install/simics-3.0.31/amd64-linux/lib/python/mod_DS17485_commands.py
3
## Copyright 2000-2007 Virtutech AB ## ## The contents herein are Source Code which are a subset of Licensed ## Software pursuant to the terms of the Virtutech Simics Software ## License Agreement (the "Agreement"), and are being distributed under ## the Agreement. You should have received a copy of the Agreem...
tchernomax/ansible
refs/heads/devel
lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py
11
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
tanmaythakur/django
refs/heads/master
tests/test_utils/tests.py
68
# -*- coding: utf-8 -*- from __future__ import unicode_literals import unittest from django.conf.urls import url from django.contrib.staticfiles.finders import get_finder, get_finders from django.contrib.staticfiles.storage import staticfiles_storage from django.core.files.storage import default_storage from django.c...
marioaugustorama/yowsup
refs/heads/master
yowsup/common/constants.py
12
class YowConstants: DOMAIN = "s.whatsapp.net" ENDPOINTS = ( ("e1.whatsapp.net", 443), ("e2.whatsapp.net", 443), ("e3.whatsapp.net", 443), ("e4.whatsapp.net", 443), ("e5.whatsapp.net", 443), ("e6.whatsapp.net", 443), ("e7.whatsapp.net", 443), ...
jsr-d10/android_kernel_jsr_msm8226
refs/heads/mm
tools/perf/scripts/python/check-perf-trace.py
11214
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
cconrad/offlineimap
refs/heads/master
offlineimap/imapserver.py
3
# IMAP server support # Copyright (C) 2002 - 2007 John Goerzen # <jgoerzen@complete.org> # # 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 # (at y...
montefra/pytest-qt
refs/heads/master
pytestqt/wait_signal.py
1
import functools from pytestqt.qt_compat import qt_api class _AbstractSignalBlocker(object): """ Base class for :class:`SignalBlocker` and :class:`MultiSignalBlocker`. Provides :meth:`wait` and a context manager protocol, but no means to add new signals and to detect when the signals should be consid...
catapult-project/catapult
refs/heads/master
telemetry/telemetry/internal/backends/android_browser_backend_settings.py
3
# 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. from __future__ import absolute_import import logging import collections import os from telemetry.core import util from devil.android.sdk import version_co...
BoltzmannBrain/nupic.research
refs/heads/master
htmresearch/support/register_regions.py
2
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
uberamd/NGECore2
refs/heads/master
scripts/object/static/item/wp_mle_lance_vibroaxe.py
85615
import sys def setup(core, object): return
dcroc16/skunk_works
refs/heads/master
google_appengine/lib/django-1.5/django/contrib/admin/sites.py
52
from functools import update_wrapper from django.http import Http404, HttpResponseRedirect from django.contrib.admin import ModelAdmin, actions from django.contrib.admin.forms import AdminAuthenticationForm from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.contenttypes import views as contenttype_...
ABaldwinHunter/django-clone-classic
refs/heads/master
django/contrib/admin/apps.py
459
from django.apps import AppConfig from django.contrib.admin.checks import check_admin_app from django.core import checks from django.utils.translation import ugettext_lazy as _ class SimpleAdminConfig(AppConfig): """Simple AppConfig which does not do automatic discovery.""" name = 'django.contrib.admin' ...
eg-zhang/h2o-2
refs/heads/master
py/testdir_single_jvm/test_GLM2_enums_score_subset.py
9
import unittest, random, sys, time, re, math sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_util # use randChars for the random chars to use def random_enum(randChars, maxEnumSize): choiceStr = randChars r = ''.join(random.choice(choiceStr) for ...
will-moore/openmicroscopy
refs/heads/develop
components/tools/OmeroPy/test/integration/scriptsharness/test_harness.py
9
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved. # Use is subject to license terms supplied in LICENSE.txt # # 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...
ritchyteam/odoo
refs/heads/master
addons/website_membership/__init__.py
3964
import controllers import models
drptbl/webium
refs/heads/master
webium/wait.py
3
from selenium.common.exceptions import WebDriverException from waiting import wait as wait_lib import webium.settings def wait(*args, **kwargs): """ Wrapping 'wait()' method of 'waiting' library with default parameter values. WebDriverException is ignored in the expected exceptions by default. """ ...
die-uhus/blueman
refs/heads/master
blueman/Service.py
1
from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals from blueman.Sdp import uuid128_to_uuid16, uuid16_to_name class Service(object): __group__ = None __svclass_id__ = None __description__ = None __icon__ ...
fusionbox/mezzanine
refs/heads/master
mezzanine/blog/migrations/south/0004_auto__del_field_blogpost_category.py
8
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label = '%s...
zaina/nova
refs/heads/master
nova/tests/unit/virt/hyperv/test_hostops.py
61
# Copyright 2014 Cloudbase Solutions Srl # 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 r...