repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
bright-sparks/chromium-spacewalk | third_party/cython/src/Cython/Compiler/Pipeline.py | 90 | 13171 | import itertools
from time import time
import Errors
import DebugFlags
import Options
from Visitor import CythonTransform
from Errors import CompileError, InternalError, AbortError
import Naming
#
# Really small pipeline stages
#
def dumptree(t):
# For quick debugging in pipelines
print t.dump()
return t
... | bsd-3-clause |
hexlism/css_platform | sleepyenv/lib/python2.7/site-packages/MarkupSafe-0.23-py2.7-linux-x86_64.egg/markupsafe/tests.py | 674 | 6107 | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type="appl... | apache-2.0 |
helmuthb/devfestsched | gae/src/com/kupriyanov/spreadsheet/GoogleSpreadsheetParser.py | 3 | 1280 |
import logging
def getRowValue(row, format, column_name):
logging.info('getRowValue[%s]:%s' % (column_name, row))
if str(column_name) == '':
raise ValueError('column_name must not empty')
begin = row.find('%s:' % column_name)
logging.info('begin:%s' % begin)
if ... | apache-2.0 |
ruchee/vimrc | vimfiles/bundle/vim-python/submodules/pylint/tests/functional/t/try_except_raise.py | 2 | 2015 | # pylint:disable=missing-docstring, unreachable, bad-except-order, bare-except, unnecessary-pass
# pylint: disable=undefined-variable, broad-except, raise-missing-from
try:
int("9a")
except: # [try-except-raise]
raise
try:
int("9a")
except:
raise ValueError('Invalid integer')
try:
int("9a")
exce... | mit |
rryan/django-cms | cms/tests/menu.py | 6 | 59543 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import copy
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, Permission, Group
from django.template import Template, TemplateSyntaxError
from django.test.utils import override_settings
from django.utils.translation impo... | bsd-3-clause |
kaste/mockito-python | tests/modulefunctions_test.py | 1 | 3675 | # Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | mit |
meyskld/hammerhead_mr1 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
mauriceling/dose | examples/09_no_migration_isolated_mating.py | 2 | 5817 | '''
Example 09a: Examining the effects of no migration on genetic distance
differences from an initially identical population (development of sub-
populations or demes which may lead to speciation)
This example is identical to Example 03, except background mutation rate is
changed from 10% in Example 03 to 0.1% in t... | gpl-3.0 |
gvir/dailyreader | venv/Lib/site-packages/pip/basecommand.py | 392 | 6578 | """Base Command class, and related routines"""
import os
import sys
import tempfile
import traceback
import time
import optparse
from pip import cmdoptions
from pip.locations import running_under_virtualenv
from pip.log import logger
from pip.download import PipSession
from pip.exceptions import (BadCommand, Installa... | mit |
armersong/zato | code/alembic/versions/0009_45c5b38b620e_gh229_msg_paths.py | 7 | 1780 | """gh229 Msg paths
Revision ID: 0009_45c5b38b620e
Revises: 0008_4eb66feec2a6
Create Date: 2013-11-24 17:05:50.526032
"""
# revision identifiers, used by Alembic.
revision = '0009_45c5b38b620e'
down_revision = '0008_4eb66feec2a6'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import CreateSequ... | gpl-3.0 |
kkmonlee/Project-Euler-Solutions | Python/p412v1.py | 1 | 1413 | from kkmonleeUtils import EulerTools
import math
upperlim = 75000000
primes = EulerTools.primes_sieve(upperlim)
factor_dict = {}
# Compute how many of each prime factors are there in 75000000!
for p in primes:
num_factors = 0
q = p
while upperlim // q > 0:
num_factors += upperlim // q
q *=... | gpl-3.0 |
boooka/GeoPowerOff | venv/lib/python2.7/site-packages/django/db/backends/mysql/creation.py | 70 | 3036 | from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated MySQL column
# types, as strings. Column-type strings can contain format strings; they'll
# be interpolated against the values of Field.__dict... | apache-2.0 |
asacamano/keyczar | cpp/src/tools/swtoolkit/test/visual_studio_solution_test.py | 18 | 3689 | #!/usr/bin/python2.4
# 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... | apache-2.0 |
ioam/topographica | topo/tests/reference/common_control.py | 3 | 3736 | ### This file can't be used on its own (see e.g. lissom_or_reference)
### NOTE: c++ lissom does not output unsituated weights, so a function
### in lissom_log_parser guesses how to unsituate the weights. If your
### weights contains rows or columns of zeros, this guessing will fail.
from topo.tests.reference.lissom_l... | bsd-3-clause |
Praxyk/Praxyk-Clients | libs/python/praxyk/paginated.py | 2 | 5431 | #!/usr/bin/env python
## @auth John Allard, Nick Church, others
## @date Oct 2015
## @github https://github.com/jhallard/praxyk
## @license MIT
import os, sys, json, requests
import subproc... | mit |
jessefeinman/FintechHackathon | venv/Lib/encodings/cp720.py | 270 | 13686 | """Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
python Tools/unicode/genwincodec.py 720
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,error... | bsd-2-clause |
tcmitchell/geni-ch | plugins/chapiv1rpc/chapi/DelegateBase.py | 2 | 4206 | #----------------------------------------------------------------------
# Copyright (c) 2011-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including ... | mit |
aschn/goodtechgigs | docs/conf.py | 1 | 7831 | # -*- coding: utf-8 -*-
#
# goodtechgigs documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values h... | apache-2.0 |
sergiusens/snapcraft | snapcraft/storeapi/assertions.py | 3 | 9865 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
captainpete/rethinkdb | external/gtest_1.6.0/test/gtest_color_test.py | 3259 | 4911 | #!/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... | agpl-3.0 |
gmist/kay-ru | kay/lib/babel/dates.py | 6 | 39600 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists of v... | bsd-3-clause |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/methfix.py | 96 | 5463 | #! /usr/bin/env python
# Fix Python source files to avoid using
# def method(self, (arg1, ..., argn)):
# instead of the more rational
# def method(self, arg1, ..., argn):
#
# Command line arguments are files or directories to be processed.
# Directories are searched recursively for files whose name looks
#... | apache-2.0 |
vprabu/iotsdk | c/lib/3rdparty/libxml2-2.7.8/python/tests/outbuf.py | 87 | 3102 | #!/usr/bin/python -u
import sys
import libxml2
import StringIO
def testSimpleBufferWrites():
f = StringIO.StringIO()
buf = libxml2.createOutputBuffer(f, "ISO-8859-1")
buf.write(3, "foo")
buf.writeString("bar")
buf.close()
if f.getvalue() != "foobar":
print "Failed to save to String... | bsd-3-clause |
ODM2/YODA-Tools | yodatools/dataloader/view/clsDBConfig.py | 2 | 6433 | # -*- coding: utf-8 -*-
###########################################################################
# Python code generated with wxFormBuilder (version Jun 5 2014)
# http://www.wxformbuilder.org/
#
# TODO: (Is this something we should follow?) PLEASE DO 'NOT' EDIT THIS FILE!
##########################################... | bsd-3-clause |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/test/test_codecmaps_jp.py | 60 | 1880 | #
# test_codecmaps_jp.py
# Codec mapping tests for Japanese encodings
#
from test import support
from test import multibytecodec_support
import unittest
class TestCP932Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'cp932'
mapfileurl = 'http://www.unicode.org/... | lgpl-3.0 |
mi1980/projecthadoop3 | udacity/cs101-intro-cs/code/lesson4/problem-set/better-split.py | 4 | 1225 | # 1 Gold Star
# The built-in <string>.split() procedure works
# okay, but fails to find all the words on a page
# because it only uses whitespace to split the
# string. To do better, we should also use punctuation
# marks to split the page into words.
# Define a procedure, split_string, that takes two
# inputs: the s... | mit |
danielfaulknor/webpymail | webpymail/mailapp/views/folder.py | 7 | 2936 | # -*- coding: utf-8 -*-
# WebPyMail - IMAP python/django web mail client
# Copyright (C) 2008 Helder Guerreiro
## This file is part of WebPyMail.
##
## WebPyMail 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 Foundat... | gpl-3.0 |
hfp/tensorflow-xsmm | tensorflow/python/eager/benchmarks_test.py | 4 | 31608 | # 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... | apache-2.0 |
RealImpactAnalytics/airflow | airflow/contrib/operators/segment_track_event_operator.py | 1 | 2675 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
crafty78/ansible | test/runner/lib/http.py | 14 | 3182 | """
Primitive replacement for requests to avoid extra dependency.
Avoids use of urllib2 due to lack of SNI support.
"""
from __future__ import absolute_import, print_function
import json
try:
from urllib import urlencode
except ImportError:
# noinspection PyCompatibility,PyUnresolvedReferences,PyUnresolvedRe... | gpl-3.0 |
dreipol/cmsplugin-filer | cmsplugin_filer_video/models.py | 26 | 3036 | from cms.models import CMSPlugin
from cmsplugin_filer_video import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.file import FilerFileField
from filer.fields.image import FilerImageField
from os.path import basename
import re
class FilerVideo(CMSPlugin)... | bsd-3-clause |
RAPD/RAPD | src/plugins/subcontractors/xdsme/mos2xds.py | 10 | 4318 | #!/usr/bin/env python
"""
24/09/04 1st version pierre.legrand@synchrotron-soleil.fr
Note: This program assum that the most commons XDS frame is choosen
(see the distributed XDS input files):
Beam is along the Z axis, Y axis point verticaly down (like gravity),
and the X axis i... | agpl-3.0 |
Bulochkin/tensorflow_pack | tensorflow/contrib/learn/python/learn/estimators/run_config_test.py | 31 | 13011 | # 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... | apache-2.0 |
dneiter/exabgp | lib/exabgp/reactor/network/incoming.py | 6 | 1063 | from exabgp.util.errstr import errstr
from .connection import Connection
from .tcp import nagle
from .tcp import async
from .error import NetworkError
from .error import NotConnected
from exabgp.bgp.message import Notify
class Incoming (Connection):
direction = 'incoming'
def __init__ (self, afi, peer, local, io... | bsd-3-clause |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/ctypes/test/test_anon.py | 264 | 2051 | import unittest
from ctypes import *
class AnonTest(unittest.TestCase):
def test_anon(self):
class ANON(Union):
_fields_ = [("a", c_int),
("b", c_int)]
class Y(Structure):
_fields_ = [("x", c_int),
("_", ANON),
... | gpl-2.0 |
shashkin/django-authority | docs/conf.py | 10 | 6459 | # -*- coding: utf-8 -*-
#
# django-authority documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 9 10:52:07 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | bsd-3-clause |
pdxwebdev/yadapy | yada/lib/python2.7/site-packages/_pytest/junitxml.py | 2 | 13379 | """
report test results in JUnit-XML format,
for use with Jenkins and build integration servers.
Based on initial code from Ross Lawley.
"""
# Output conforms to https://github.com/jenkinsci/xunit-plugin/blob/master/
# src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
import py
impo... | gpl-3.0 |
elkingtonmcb/nupic | tests/swarming/nupic/swarming/experiments/dummy_multi_v2/description.py | 32 | 15364 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
kyonetca/potcoin | contrib/pyminer/pyminer.py | 6 | 6435 | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | mit |
mancoast/CPythonPyc_test | cpython/270_test_bool.py | 20 | 14185 | # Test properties of bool promised by PEP 285
import unittest
from test import test_support
import os
class BoolTest(unittest.TestCase):
def test_subclass(self):
try:
class C(bool):
pass
except TypeError:
pass
else:
self.fail("bool shou... | gpl-3.0 |
apporc/cinder | cinder/volume/drivers/huawei/huawei_driver.py | 3 | 55022 | # Copyright (c) 2015 Huawei Technologies Co., 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
#
# ... | apache-2.0 |
andrey-malets/web-page-replay | third_party/dns/set.py | 248 | 7843 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
Glottotopia/aagd | moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/userprefs/oid.py | 2 | 8766 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - OpenID preferences
@copyright: 2007 MoinMoin:JohannesBerg
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin import wikiutil, user
from MoinMoin.widget import html
from MoinMoin.userprefs import UserPrefBase
from MoinMoin.support.python... | mit |
rew4332/tensorflow | tensorflow/contrib/layers/python/kernel_tests/bucketization_op_test.py | 31 | 1508 | # 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... | apache-2.0 |
Nowheresly/odoo | openerp/osv/expression.py | 23 | 59613 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
imminent-tuba/thesis | server/chatterbot/chatterbot/adapters/storage/jsondatabase.py | 1 | 4775 | from chatterbot.adapters.storage import StorageAdapter
from chatterbot.adapters.exceptions import EmptyDatabaseException
from chatterbot.conversation import Statement, Response
# from jsondb import Database
class JsonDatabaseAdapter(StorageAdapter):
"""
The JsonDatabaseAdapter is an interface that allows Chat... | mit |
andymckay/zamboni | mkt/developers/tests/test_providers.py | 1 | 14056 | from datetime import datetime
from django.core.exceptions import ObjectDoesNotExist
from mock import ANY, Mock, patch
from nose.tools import eq_, ok_, raises
from amo.tests import app_factory, TestCase
from mkt.constants.payments import (PROVIDER_BANGO, PROVIDER_BOKU,
PROVIDER_REFEREN... | bsd-3-clause |
edx/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/gis/gdal/prototypes/generation.py | 321 | 3766 | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.prototypes.errcheck import \
check_arg_errcode, check_errcode, check_geom, check_geom_offset, \
check_pointer, check_srs, check_str... | gpl-3.0 |
ballesterus/UPhO | Get_fasta_from_Ref.py | 1 | 3740 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import argparse
#Function definitions
def Fasta_to_Dict(File):
'''Creates a dictionary of FASTA sequences in a File, with seqIs as key to the sequences.'''
with open(File, 'r') as F:
Records = {}
for Line in F:
if... | gpl-3.0 |
cctaylor/googleads-python-lib | examples/adwords/v201502/error_handling/handle_policy_violation_error.py | 3 | 4209 | #!/usr/bin/python
#
# 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 b... | apache-2.0 |
chirilo/remo | vendor-local/lib/python/rest_framework/reverse.py | 4 | 1306 | """
Provide urlresolver functions that return fully qualified URLs or view names
"""
from __future__ import unicode_literals
from django.core.urlresolvers import reverse as django_reverse
from django.utils import six
from django.utils.functional import lazy
def reverse(viewname, args=None, kwargs=None, request=None, ... | bsd-3-clause |
EzeAlbornoz5/TP-Ingenieria-web | doyourfreight/forums/views.py | 1 | 12790 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseNotFound
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from .forms import *
from .models import *
from shippings.models im... | gpl-3.0 |
faywong/FFPlayer | project/jni/python/src/Lib/test/test_index.py | 56 | 6882 | import unittest
from test import test_support
import operator
from sys import maxint
maxsize = test_support.MAX_Py_ssize_t
minsize = -maxsize-1
class oldstyle:
def __index__(self):
return self.ind
class newstyle(object):
def __index__(self):
return self.ind
class TrapInt(int):
def __index... | lgpl-2.1 |
ioram7/keystone-federado-pgid2013 | build/sqlalchemy/build/lib.linux-x86_64-2.7/sqlalchemy/dialects/sqlite/base.py | 17 | 32174 | # sqlite/base.py
# Copyright (C) 2005-2012 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
"""Support for the SQLite database.
For information on connecting using a specific dri... | apache-2.0 |
alex/raven | docs/conf.py | 6 | 7322 | # -*- coding: utf-8 -*-
#
# Sentry documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 20 16:21:42 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | bsd-3-clause |
junwoo091400/MyCODES | Projects/FootPad_Logger/logged_data_analyzer_LSTM/RNN_LSTM.py | 1 | 2131 |
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import ipdb
def RNN_LSTM(batch_size_in = 5, total_len_in = 30000, pad_len_in = 5, backprop_len_in = 50, state_size_in = 10, num_class_in = 32):
# total_len_in = (backprop_len_in) * (num_batches... | gpl-3.0 |
kelvin13/Knockout | pygments/lexers/hdl.py | 21 | 18699 | # -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, using, ... | gpl-3.0 |
radekp/qt | doc/src/diagrams/programs/mdiarea.py | 1 | 3712 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
## This file is part of the test suite of the Qt Toolkit.
##
## $QT_BEG... | lgpl-2.1 |
titansgroup/python-phonenumbers | python/phonenumbers/data/region_MX.py | 8 | 4158 | """Auto-generated file, do not edit by hand. MX metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_MX = PhoneMetadata(id='MX', country_code=52, international_prefix='0[09]',
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{9,10}', possible_number_patte... | apache-2.0 |
VisionSystemsInc/voxel_globe | voxel_globe/channel_test/tasks.py | 2 | 1715 | from voxel_globe.common_tasks import shared_task, VipTask
from voxel_globe.websockets import ws_logger
import random, time
@shared_task(base=VipTask, bind=True)
def success_task(self):
ws_logger.debug(self, "d " + str(random.random()))
ws_logger.info(self, "i " + str(random.random()))
ws_logger.warn(self, "w " +... | mit |
VerifiableRobotics/ReSpeC | test/formula/activation_outcomes_test.py | 2 | 24282 | #!/usr/bin/env python
from respec.formula.activation_outcomes import *
import unittest
class ActionFormulaGenerationTests(unittest.TestCase):
"""Test the generation of Activation-Outcomes action formulas"""
def setUp(self):
"""Gets called before every test case."""
self.sys_props = ['dance... | bsd-3-clause |
chrrrles/ansible | lib/ansible/utils/module_docs_fragments/cloudstack.py | 125 | 2515 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 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 License, or
# (... | gpl-3.0 |
MziRintu/kitsune | kitsune/wiki/migrations/0002_auto_20150430_1304.py | 20 | 6062 | # -*- coding: utf-8 -*-
"""
Update list of locale choices in the `document.locale` and `locale.locale` fields.
"""
from __future__ import unicode_literals
from django.db import models, migrations
import kitsune.sumo.models
class Migration(migrations.Migration):
dependencies = [
('wiki', '0001_initial')... | bsd-3-clause |
dharness/pebblePunch | quarry/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py | 2214 | 1347 | #!/usr/bin/env python
import re
import json
# http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
EndlessDex/euler | 13-largeSum.py | 1 | 5187 | numStr = ('''37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
2... | mit |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.3/Lib/idlelib/Percolator.py | 69 | 2600 | from WidgetRedirector import WidgetRedirector
from Delegator import Delegator
class Percolator:
def __init__(self, text):
# XXX would be nice to inherit from Delegator
self.text = text
self.redir = WidgetRedirector(text)
self.top = self.bottom = Delegator(text)
self.bottom.... | mit |
hbzhang/rsstack | bower_components/bootstrap/test-infra/s3_cache.py | 1700 | 3523 | #!/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.... | mit |
ShiYw/Sigil | 3rdparty/python/Lib/test/test_select.py | 84 | 2742 | import errno
import os
import select
import sys
import unittest
from test import support
@unittest.skipIf((sys.platform[:3]=='win'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
retur... | gpl-3.0 |
RicherMans/QPy | src/qpy.py | 1 | 8949 | import marshal
import subprocess as sub
import os
from inspect import getsource, getargspec
import re
import types
from functools import wraps
from contextlib import contextmanager
import sys
import qsubsettings
from glob import glob
def _globalimports(func):
for name, val in func.__globals__.iteritems():
... | mit |
alxgu/ansible | test/units/modules/network/f5/test_bigip_gtm_facts.py | 16 | 5948 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
import pytest
pytestmark = []
if sys.v... | gpl-3.0 |
lrr-tum/poncos | vendor/fast-lib/vendor/mosquitto-1.3.5/test/broker/07-will-null.py | 18 | 1460 | #!/usr/bin/env python
# Test whether a client will is transmitted correctly with a null character in the middle.
import struct
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.... | gpl-2.0 |
abhattad4/Digi-Menu | django/conf/locale/de/formats.py | 115 | 1100 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
rchlchang/byte1 | lib/werkzeug/script.py | 318 | 11249 | # -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... | apache-2.0 |
pgmillon/ansible | test/units/pytest/plugins/ansible_pytest_coverage.py | 1 | 1260 | """Monkey patch os._exit when running under coverage so we don't lose coverage data in forks, such as with `pytest --boxed`."""
from __future__ import (absolute_import, division, print_function)
def pytest_configure():
try:
import coverage
except ImportError:
coverage = None
try:
... | gpl-3.0 |
Schpin/schpin-chassis | schpin_tote/src/lib/stl.py | 1 | 1937 | import subprocess, os
from lib.util import convert_scad
def render(filename, scad_cfg, mirror):
""" renders scad module defined by scad_cfg into stl 'filename' """
assert filename[-1] == 'b'
scad = "../scad/tmp.scad"
with open(scad, "w") as fd:
fd.write("include <model.scad>;\n $fn=32;")
... | gpl-3.0 |
dantebarba/docker-media-server | plex/Sub-Zero.bundle/Contents/Libraries/Shared/js2py/internals/prototypes/jsregexp.py | 9 | 1627 | from __future__ import unicode_literals
from ..conversions import *
from ..func_utils import *
class RegExpPrototype:
def toString(this, args):
flags = u''
try:
if this.glob:
flags += u'g'
if this.ignore_case:
flags += u'i'
if th... | gpl-3.0 |
bmenendez/20up | tntwrapper.py | 1 | 7920 | #! /usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2016 Borja Menendez Moreno
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
any later version.
This p... | gpl-3.0 |
AIML/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 182 | 1743 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
floooh/fips | yaml/yaml2/reader.py | 424 | 6746 | # This module contains abstractions for the input stream. You don't have to
# looks further, there are no pretty code.
#
# We define two classes here.
#
# Mark(source, line, column)
# It's just a record and its only use is producing nice error messages.
# Parser does not use it for any other purposes.
#
# Reader(so... | mit |
icodedev7/customap | devkit/mingw/bin/lib/textwrap.py | 110 | 16848 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
__revision__ = "$Id$"
import string, re
# Do the right thing with boolean values for all known Python versions
# (so this module can be copied... | mit |
areitz/pants | contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_fetch.py | 2 | 7573 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import shu... | apache-2.0 |
ovnicraft/openerp-restaurant | l10n_br/account.py | 39 | 10574 | # -*- encoding: utf-8 -*-
#################################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | agpl-3.0 |
encbladexp/ansible | hacking/return_skeleton_generator.py | 35 | 3330 | #!/usr/bin/env python
# (c) 2017, Will Thames <will@thames.id.au>
#
# 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 op... | gpl-3.0 |
joachimwolff/bioconda-recipes | recipes/biopet-fastqsplitter/0.1/biopet-fastqsplitter.py | 82 | 3377 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-fastqsplitter JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shake... | mit |
salamer/django | tests/validators/tests.py | 163 | 16552 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import types
from datetime import datetime, timedelta
from unittest import TestCase
from django.core.exceptions import ValidationError
from django.core.validators import (
BaseValidator, EmailValidator, MaxLengthValidato... | bsd-3-clause |
robotpilot/crazyflie-clients-python | lib/cflib/crtp/__init__.py | 6 | 2956 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
jalourenco/wagtaildemo | demo/templatetags/demo_tags.py | 1 | 5358 | from datetime import date
from django import template
from django.conf import settings
from demo.models import *
register = template.Library()
# settings value
@register.assignment_tag
def get_googe_maps_key():
return getattr(settings, 'GOOGLE_MAPS_KEY', "")
@register.assignment_tag(takes_context=True)
def ge... | bsd-3-clause |
lucywyman/slides-ii | v/lib/python2.7/site-packages/_markerlib/markers.py | 1769 | 3979 | # -*- coding: utf-8 -*-
"""Interpret PEP 345 environment markers.
EXPR [in|==|!=|not in] EXPR [or|and] ...
where EXPR belongs to any of those:
python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
python_full_version = sys.version.split()[0]
os.name = os.name
sys.platform = sys.platfo... | apache-2.0 |
MoritzS/django | django/core/checks/templates.py | 49 | 1185 | import copy
from django.conf import settings
from . import Error, Tags, register
E001 = Error(
"You have 'APP_DIRS': True in your TEMPLATES but also specify 'loaders' "
"in OPTIONS. Either remove APP_DIRS or remove the 'loaders' option.",
id='templates.E001',
)
E002 = Error(
"'string_if_invalid' in T... | bsd-3-clause |
jigarkb/Programming | LeetCode/238-M-ProductOfArrayExceptSelf.py | 2 | 1365 | # Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product
# of all the elements of nums except nums[i].
#
# Solve it without division and in O(n).
#
# For example, given [1,2,3,4], return [24,12,8,6].
#
# Follow up:
# Could you solve it with constant space comp... | mit |
izgzhen/servo | tests/wpt/web-platform-tests/tools/py/testing/path/test_svnurl.py | 218 | 3524 | import py
from py._path.svnurl import InfoSvnCommand
import datetime
import time
from svntestbase import CommonSvnTests
def pytest_funcarg__path1(request):
repo, repourl, wc = request.getfuncargvalue("repowc1")
return py.path.svnurl(repourl)
class TestSvnURLCommandPath(CommonSvnTests):
@py.test.mark.xfail... | mpl-2.0 |
Schibum/sndlatr | gae/w69b/cache.py | 3 | 5183 | import collections
import functools
from itertools import ifilterfalse
from heapq import nsmallest
from operator import itemgetter
class Counter(dict):
'Mapping where default values are zero'
def __missing__(self, key):
return 0
def lru_cache(maxsize=100):
'''Least-recently-used cache decorator.
... | apache-2.0 |
evernym/zeno | plenum/test/bls/test_bls_bft_replica.py | 2 | 32557 | from copy import copy
import base58
import pytest
from crypto.bls.bls_bft_replica import BlsBftReplica
from crypto.bls.bls_multi_signature import MultiSignature, MultiSignatureValue
from plenum.bls.bls_bft_factory import create_default_bls_bft_factory
from plenum.common.constants import DOMAIN_LEDGER_ID, POOL_LEDGER_... | apache-2.0 |
melodous/designate | designate/backend/impl_powerdns/__init__.py | 1 | 17862 | # Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.
# Copyright 2012 Managed I.T.
#
# Author: Patrick Galbraith <patg@hp.com>
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | apache-2.0 |
rohanp/scikit-learn | sklearn/model_selection/tests/test_validation.py | 20 | 27961 | """Test the validation module"""
from __future__ import division
import sys
import warnings
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils... | bsd-3-clause |
Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/sleekxmpp/api.py | 13 | 7436 | from sleekxmpp.xmlstream import JID
class APIWrapper(object):
def __init__(self, api, name):
self.api = api
self.name = name
if name not in self.api.settings:
self.api.settings[name] = {}
def __getattr__(self, attr):
"""Curry API management commands with the API n... | gpl-2.0 |
Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/Cryptodome/Util/_file_system.py | 7 | 2183 | # ===================================================================
#
# Copyright (c) 2016, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | gpl-2.0 |
windyuuy/opera | chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/text_unittest.py | 122 | 3616 | # Copyright (C) 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 ... | bsd-3-clause |
SpookW/three.js | utils/exporters/blender/addons/io_three/exporter/api/mesh.py | 55 | 26672 | """
Blender API for querying mesh data. Animation data is also
handled here since Three.js associates the animation (skeletal,
morph targets) with the geometry nodes.
"""
import operator
import re
from bpy import data, types, context
from . import material, texture, animation
from . import object as object_
from .. im... | mit |
axiom-data-science/paegan | paegan/utils/asagreatcircle.py | 3 | 3265 | import math
from paegan.external.greatcircle import GreatCircle
import numpy as np
class AsaGreatCircle(object):
@classmethod
def great_circle(self, **kwargs):
"""
Named arguments:
distance = distance to traveled
azimuth = angle, in DECIMAL DEGREES of HEADING from N... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.