repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
karrrt/scale | lib/python2.7/site-packages/pip/_vendor/progress/spinner.py | 404 | 1341 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software 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 P... | mit |
ifwe/tasr | test/pyunit/test_client_methods.py | 1 | 21180 | '''
Created on May 7, 2014
@author: cmills
'''
from client_test import TestTASRAppClient
import unittest
import tasr.client
import tasr.client_legacy
import httmock
class TestTASRClientMethods(TestTASRAppClient):
def setUp(self):
super(TestTASRClientMethods, self).setUp()
self.event_type = "go... | apache-2.0 |
fastflo/emma | emmalib/widgets/querytab/QueryTabResultPopup.py | 1 | 12153 | """
QueryTabResultPopup
"""
# -*- coding: utf-8 -*-
# emma
#
# Copyright (C) 2006 Florian Schmidt (flo@fastflo.de)
# 2014 Nickolay Karnaukhov (mr.electronick@gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | gpl-2.0 |
robozman/pymumblegui | pymumble/pymumble_py3/commands.py | 1 | 1298 | # -*- coding: utf-8 -*-
from threading import Lock
from collections import deque
class Commands:
"""
Store to commands to be sent to the murmur server,
from whatever tread.
Each command has it's own lock semaphore to signal is received an answer
"""
def __init__(self):
self.id = 0
... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/servicebus/azure-servicebus/samples/sync_samples/schedule_topic_messages_and_cancellation.py | 1 | 2330 | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | mit |
platformio/platformio | platformio/commands/home/rpc/handlers/os.py | 1 | 4850 | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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 appli... | apache-2.0 |
DdragonEver/flasky | app/api_1_0/authentication.py | 35 | 1258 | from flask import g, jsonify
from flask.ext.httpauth import HTTPBasicAuth
from ..models import User, AnonymousUser
from . import api
from .errors import unauthorized, forbidden
auth = HTTPBasicAuth()
@auth.verify_password
def verify_password(email_or_token, password):
if email_or_token == '':
g.current_u... | mit |
smartboyathome/Wonderland-Engine | tests/CheshireCatTests/test_team_checks_attacks.py | 1 | 3636 | '''
Copyright (c) 2012 Alexander Abbott
This file is part of the Cheshire Cyber Defense Scoring Engine (henceforth
referred to as Cheshire).
Cheshire 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 Sof... | agpl-3.0 |
aeischeid/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_memorizingfile.py | 496 | 4252 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
auduny/home-assistant | homeassistant/components/lifx_cloud/scene.py | 8 | 2787 | """Support for LIFX Cloud scenes."""
import asyncio
import logging
import aiohttp
from aiohttp.hdrs import AUTHORIZATION
import async_timeout
import voluptuous as vol
from homeassistant.components.scene import Scene
from homeassistant.const import CONF_TOKEN, CONF_TIMEOUT, CONF_PLATFORM
from homeassistant.helpers.aio... | apache-2.0 |
normtown/SickRage | lib/guessit/transfo/expected_series.py | 33 | 2545 | #!/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 ... | gpl-3.0 |
Alex-Diez/python-tdd-katas | old-katas/string-compress-kata/day-4.py | 1 | 1339 | # -*- codeing: utf-8 -*-
class StringCompressor(object):
def compress(self, toCompress):
if toCompress is None:
return ""
else:
result = []
index = 0
length = len(toCompress)
while index < length:
counter = 1
... | mit |
b-dollery/testing | plugins/inventory/ec2.py | 15 | 26335 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | gpl-3.0 |
googleapis/googleapis-gen | google/appengine/v1/google-cloud-appengine-v1-py/google/cloud/appengine_admin_v1/services/versions/transports/base.py | 1 | 9187 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
CamelBackNotation/CarnotKE | jyhton/lib-python/2.7/distutils/cygwinccompiler.py | 63 | 17732 | """distutils.cygwinccompiler
Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows. It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
"""
# problems:
#
# * if you use a msvc com... | apache-2.0 |
raccoongang/edx-platform | lms/djangoapps/mobile_api/migrations/0001_initial.py | 86 | 1229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operati... | agpl-3.0 |
apanda/phantomjs-intercept | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py | 118 | 11747 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | bsd-3-clause |
n0max/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/sauce.py | 8 | 6465 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import glob
import os
import shutil
import subprocess
import tarfile
import tempfile
import time
from cStringIO import S... | mpl-2.0 |
xupit3r/askpgh | askbot/tests/utils_tests.py | 3 | 5591 | from django.test import TestCase
from askbot.tests.utils import with_settings
from askbot.utils.url_utils import urls_equal
from askbot.utils.html import absolutize_urls
from askbot.utils.html import replace_links_with_text
from askbot.utils.html import get_text_from_html
from askbot.conf import settings as askbot_sett... | gpl-3.0 |
CharlesGarrocho/JUMP | detector/detector_movimento.py | 2 | 18706 | #!/usr/bin/env python
# coding:utf-8
import cv2
import numpy as np
import sys
import json
import time
from optparse import OptionParser
from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer
from multiprocessing import Process
import threading
processo = None
class Movimentos(object):
'''
Classe... | gpl-3.0 |
SebastianMerz/calalert | Server/venv/lib/python2.7/site-packages/openid/extensions/sreg.py | 143 | 17848 | """Simple registration request and response parsing and object representation
This module contains objects representing simple registration requests
and responses that can be used with both OpenID relying parties and
OpenID providers.
1. The relying party creates a request object and adds it to the
C{L{AuthReq... | gpl-2.0 |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/encodings/cp1140.py | 593 | 13361 | """ Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='stri... | apache-2.0 |
mikekestemont/ruzicka | code/ruzicka/art.py | 1 | 45257 | #!/usr/bin/env python
__doc__ = '''art.py -- Approximate Randomization Test
This script carries out a significance test on the output of an
instance-based machine learner based on the theory of
approximate randomization tests:
Eric W. Noreen, Computer-intensive Methods for Testing Hypotheses: An Introduction, John Wi... | mit |
robertwb/incubator-beam | sdks/python/apache_beam/testing/benchmarks/nexmark/queries/query6.py | 5 | 3391 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/test/pydocfodder.py | 194 | 6329 | """Something just to look at via pydoc."""
import types
class A_classic:
"A classic class."
def A_method(self):
"Method defined in A."
def AB_method(self):
"Method defined in A and B."
def AC_method(self):
"Method defined in A and C."
def AD_method(self):
"Method de... | gpl-3.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/theano/typed_list/tests/test_basic.py | 4 | 18954 | import unittest
from nose.plugins.skip import SkipTest
import numpy
import theano
import theano.typed_list
from theano import tensor as T
from theano.tensor.type_other import SliceType
from theano.typed_list.type import TypedListType
from theano.typed_list.basic import (GetItem, Insert,
... | mit |
personalrobotics/aikido | tests/gtest/test/gtest_list_output_unittest.py | 101 | 4919 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
conwin/node-gyp | gyp/test/variants/gyptest-variants.py | 240 | 1315 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verify handling of build variants.
TODO: Right now, only the SCons generator supports this, so the
test case is SCons-specific. In pa... | mit |
beijingren/roche-website | djiki/tests.py | 2 | 9743 | # -*- coding: utf-8 -*-
from django.conf import settings
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError:
# django < 1.5
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client im... | mit |
r39132/airflow | tests/contrib/operators/test_awsbatch_operator.py | 3 | 7809 | # -*- 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 |
xwolf12/django | django/utils/deconstruct.py | 502 | 2047 | from importlib import import_module
from django.utils.version import get_docs_version
def deconstructible(*args, **kwargs):
"""
Class decorator that allow the decorated class to be serialized
by the migrations subsystem.
Accepts an optional kwarg `path` to specify the import path.
"""
path =... | bsd-3-clause |
entomb/CouchPotatoServer | libs/tmdb3/request.py | 34 | 5485 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: tmdb_request.py
# Python Library
# Author: Raymond Wagner
# Purpose: Wrapped urllib2.Request class pre-configured for accessing the
# TMDb v3 API
#-----------------------
from tmdb_exceptions import *
from locales import get_locale... | gpl-3.0 |
fkorotkov/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/test_jvm_compile.py | 7 | 1830 | # coding=utf-8
# Copyright 2017 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
from pant... | apache-2.0 |
pbaesse/Sissens | lib/python2.7/site-packages/wheel/pep425tags.py | 70 | 5760 | """Generate and work with PEP 425 Compatibility Tags."""
import distutils.util
import platform
import sys
import sysconfig
import warnings
def get_config_var(var):
try:
return sysconfig.get_config_var(var)
except IOError as e: # pip Issue #1074
warnings.warn("{0}".format(e), RuntimeWarning)
... | gpl-3.0 |
okwow123/djangol2 | example/env/lib/python2.7/site-packages/openid/extensions/draft/pape2.py | 156 | 9330 | """An implementation of the OpenID Provider Authentication Policy
Extension 1.0
@see: http://openid.net/developers/specs/
@since: 2.1.0
"""
__all__ = [
'Request',
'Response',
'ns_uri',
'AUTH_PHISHING_RESISTANT',
'AUTH_MULTI_FACTOR',
'AUTH_MULTI_FACTOR_PHYSICAL',
]
from openid.extension i... | mit |
hwroitzsch/BikersLifeSaver | lib/python3.5/site-packages/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
x303597316/hue | desktop/core/ext-py/requests-2.6.0/requests/api.py | 160 | 5280 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | apache-2.0 |
stefanweller/ansible-modules-extras | cloud/azure/azure_rm_deployment.py | 3 | 27691 | #!/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... | gpl-3.0 |
CraigHarris/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/crashrecovery/commit_create_tests/trigger_sql/test_triggersqls.py | 36 | 1128 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
glaubitz/fs-uae-debian | launcher/launcher/netplay/netplay_panel.py | 2 | 5735 | import fsui
from launcher.i18n import gettext
from launcher.netplay.irc import LOBBY_CHANNEL
from launcher.netplay.irc_broadcaster import IRCBroadcaster
from launcher.netplay.netplay import Netplay
from launcher.ui.skin import Skin
class NetplayPanel(fsui.Panel):
def __init__(self, parent, header=True):
f... | gpl-2.0 |
sodafree/backend | build/lib.linux-i686-2.7/django/core/management/commands/flush.py | 81 | 3662 | from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | bsd-3-clause |
mycFelix/heron | heron/tools/ui/src/python/handlers/__init__.py | 4 | 1938 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
lasko2112/legend-of-hondo | MMOCoreORB/utils/gmock-1.6.0/gtest/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 |
Omegaphora/external_chromium_org_tools_grit | grit/xtb_reader.py | 60 | 4925 | #!/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.
'''Fast and efficient parser for XTB files.
'''
import sys
import xml.sax
import xml.sax.handler
import grit.node.base
class X... | bsd-2-clause |
ericdill/scikit-xray | skbeam/io/tests/test_fit2d_save.py | 2 | 3310 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | bsd-3-clause |
torqie/esportscms | node_modules/node-gyp/gyp/pylib/gyp/common.py | 64 | 20173 | # Copyright (c) 2012 Google Inc. 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 with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | lgpl-3.0 |
u55/PyIOTech | examples/DaqTimer.py | 1 | 1941 | """
This program will run for 30 seconds on a python-based timer. Input will be
taken every 0.5 seconds and the output will change every 5 seconds.
Two timer functions will be set up to run at the same time.
"""
from __future__ import print_function, division
import time
from PyIOTech import daq, daqh
# De... | gpl-2.0 |
bbc/kamaelia | Code/Python/Apps/Europython09/App/MiniAxon-2.py | 3 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | apache-2.0 |
fxtentacle/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/ensurebugisopenandassigned.py | 135 | 2061 | # Copyright (C) 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 of conditions and the ... | bsd-3-clause |
ShinySide/HispAsian_Lollipop_G6 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # 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... | gpl-2.0 |
jeblair/GitPython | git/util.py | 1 | 32349 | # utils.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import contextlib
from functools import wraps
import getpass
import logging
import os
import platform
i... | bsd-3-clause |
kxliugang/edx-platform | cms/djangoapps/contentstore/views/tests/test_textbooks.py | 163 | 13515 | import json
from unittest import TestCase
from contentstore.tests.utils import CourseTestCase
from contentstore.utils import reverse_course_url
from contentstore.views.course import (
validate_textbooks_json, validate_textbook_json, TextbookValidationError)
class TextbookIndexTestCase(CourseTestCase):
"Test ... | agpl-3.0 |
tchernomax/ansible | lib/ansible/modules/database/misc/riak.py | 50 | 7213 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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_METAD... | gpl-3.0 |
mandeepdhami/horizon | openstack_dashboard/dashboards/project/volumes/volumes/tests.py | 7 | 69956 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
cloudera/hue | desktop/core/ext-py/SQLAlchemy-1.3.17/test/base/test_except.py | 3 | 13032 | #! coding:utf-8
"""Tests exceptions and DB-API exception wrapping."""
from sqlalchemy import exc as sa_exceptions
from sqlalchemy.engine import default
from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures
from sqlalchemy.util import compat
from sqlalchemy.util import u
class Error(Exception):... | apache-2.0 |
Shrulik/Open-Knesset | links/migrations/0006_auto__chg_field_linkedfile_link.py | 14 | 3052 | # encoding: 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):
# Changing field 'LinkedFile.link'
db.alter_column('links_linkedfile', 'link_id', self.gf('django.db.model... | bsd-3-clause |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/test/time_hashlib.py | 25 | 2895 | # It's intended that this script be run by hand. It runs speed tests on
# hashlib functions; it does not test for correctness.
import sys
import time
import hashlib
def creatorFunc():
raise RuntimeError("eek, creatorFunc not overridden")
def test_scaled_msg(scale, name):
iterations = 106201//scale * 20
... | gpl-2.0 |
AlkamiCode/snake-game | node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 1524 | 22178 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | mit |
ramiroluz/saap | saap/cerimonial/tests/test_model_processo.py | 2 | 4832 | from django.test import TestCase
from django.utils.datetime_safe import date
from saap.cerimonial.models import Processo, StatusProcesso, Contato, SEXO_CHOICE
from django.shortcuts import resolve_url as r
from saap.core.models import AreaTrabalho, User, Bairro
class ProcessoModelTest(TestCase):
def setUp(self):... | gpl-3.0 |
tiagochiavericosta/edx-platform | openedx/core/djangoapps/user_api/serializers.py | 49 | 2111 | from django.contrib.auth.models import User
from rest_framework import serializers
from student.models import UserProfile
from .models import UserPreference
class UserSerializer(serializers.HyperlinkedModelSerializer):
name = serializers.SerializerMethodField("get_name")
preferences = serializers.SerializerM... | agpl-3.0 |
ar4s/django | tests/datatypes/tests.py | 5 | 4208 | from __future__ import unicode_literals
import datetime
from django.test import TestCase, skipIfDBFeature
from django.utils import six
from django.utils.timezone import utc
from .models import Donut, RumBaba
class DataTypesTestCase(TestCase):
def test_boolean_type(self):
d = Donut(name='Apple Fritter'... | bsd-3-clause |
GuillaumeGomez/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/error.py | 82 | 3570 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import collections
class WebDriverException(Exception):
http_status = None
status_code = None
class Element... | mpl-2.0 |
rgom/Pydev | plugins/org.python.pydev.jython/Lib/unittest/test/test_case.py | 89 | 43816 | import difflib
import pprint
import pickle
import re
import sys
from copy import deepcopy
from test import test_support
import unittest
from .support import (
TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun
)
class Test(object):
"Keep these TestCase classes out of the main nam... | epl-1.0 |
todaychi/hue | desktop/core/ext-py/lxml-3.3.6/benchmark/bench_objectify.py | 18 | 3322 | import sys, copy
from itertools import *
import benchbase
from benchbase import (with_attributes, with_text, onlylib,
serialized, children, nochange)
############################################################
# Benchmarks
############################################################
class Ben... | apache-2.0 |
nemesisdesign/django | tests/forms_tests/widget_tests/test_checkboxinput.py | 64 | 3460 | from django.forms import CheckboxInput
from .base import WidgetTest
class CheckboxInputTest(WidgetTest):
widget = CheckboxInput()
def test_render_empty(self):
self.check_html(self.widget, 'is_cool', '', html='<input type="checkbox" name="is_cool" />')
def test_render_none(self):
self.ch... | bsd-3-clause |
aspidites/django | tests/view_tests/tests/test_debug.py | 150 | 39389 | # -*- coding: utf-8 -*-
# This coding header is significant for tests, as the debug view is parsing
# files to search for such a header to decode the source file content
from __future__ import unicode_literals
import importlib
import inspect
import os
import re
import sys
import tempfile
from unittest import skipIf
f... | bsd-3-clause |
PokemonGoF/PokemonGo-Bot-Desktop | build/pywin/Lib/lib2to3/fixes/fix_apply.py | 315 | 1904 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for apply().
This converts apply(func, v, k) into (func)(*v, **k)."""
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesi... | mit |
beni55/networkx | networkx/algorithms/tests/test_threshold.py | 19 | 6669 | #!/usr/bin/env python
"""Threshold Graphs
================
"""
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx as nx
import networkx.algorithms.threshold as nxt
from networkx.algorithms.isomorphism.isomorph import graph_could_be_isomorphic
cnlti = nx.convert_no... | bsd-3-clause |
steedos/odoo | addons/project/res_config.py | 232 | 4551 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-60/files/myenv/lib/python2.7/site-packages/pip/_vendor/requests/utils.py | 222 | 19653 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import sys
import socket
import struct
from . i... | gpl-3.0 |
chirilo/kuma | vendor/packages/pygments/lexers/testing.py | 72 | 8704 | # -*- coding: utf-8 -*-
"""
pygments.lexers.testing
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for testing languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups
from pygments.token imp... | mpl-2.0 |
Jgarcia-IAS/localizacion | openerp/addons/sale_journal/__openerp__.py | 262 | 2637 | # -*- 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... | agpl-3.0 |
snehasi/servo | tests/wpt/css-tests/tools/pytest/_pytest/resultlog.py | 208 | 3536 | """ log machine-parseable test session result information in a plain
text file.
"""
import py
import os
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting", "resultlog plugin options")
group.addoption('--resultlog', '--result-log', action="store",
metavar="path", default=None,
... | mpl-2.0 |
qpython-android/QPypi-numpy | numpy/lib/type_check.py | 2 | 13492 | ## Automatically adapted for numpy Sep 19, 2005 by convertcode.py
__all__ = ['iscomplexobj','isrealobj','imag','iscomplex',
'isreal','nan_to_num','real','real_if_close',
'typename','asfarray','mintypecode','asscalar',
'common_type']
import numpy.core.numeric as _nx
from numpy.core.num... | bsd-3-clause |
imarin/Odoo-Mexico-localization | city/__openerp__.py | 1 | 1941 | # -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
####################################... | agpl-3.0 |
yuewko/neutron | neutron/db/l3_attrs_db.py | 63 | 3677 | # Copyright (c) 2014 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 ... | apache-2.0 |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/gluon/contrib/login_methods/openid_auth.py | 42 | 25869 | #!/usr/bin/env python
# coding: utf8
"""
OpenID authentication for web2py
Allowed using OpenID login together with web2py built-in login.
By default, to support OpenID login, put this in your db.py
>>> from gluon.contrib.login_methods.openid_auth import OpenIDAuth
>>> auth.settings.login_form = ... | gpl-3.0 |
fhaoquan/shadowsocks | shadowsocks/lru_cache.py | 983 | 4290 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
mikalstill/nova | nova/cmd/common.py | 3 | 6933 | # Copyright 2016 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... | apache-2.0 |
ojengwa/oh-mainline | vendor/packages/Django/django/db/backends/oracle/base.py | 103 | 36127 | """
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
from __future__ import unicode_literals
import datetime
import decimal
import sys
import warnings
def _setup_environment(environ):
import platform
# Cygwin requires some special voodoo to set the environment var... | agpl-3.0 |
allenlavoie/tensorflow | tensorflow/contrib/gan/python/eval/python/sliced_wasserstein_test.py | 21 | 4991 | # 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 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/pygments/styles/colorful.py | 31 | 2778 | # -*- coding: utf-8 -*-
"""
pygments.styles.colorful
~~~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by CodeRay.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | gpl-3.0 |
omerwe/PCGCs | deprecated/pcgcs_direct.py | 1 | 39643 | from __future__ import division
import numpy as np
import scipy.stats as stats
import scipy.linalg as la
import sys
import random
import time
import os
import os.path
import pandas as pd
import itertools
np.set_printoptions(precision=4, linewidth=200)
from sklearn.linear_model import LinearRegression, LogisticRegressio... | mit |
googleapis/googleapis-gen | google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/errors/types/policy_violation_error.py | 1 | 1169 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | apache-2.0 |
rahushen/ansible | lib/ansible/playbook/role_include.py | 23 | 5507 |
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope th... | gpl-3.0 |
xdggplus/jsunpack-n | html.py | 23 | 9270 | #!/usr/bin/python
'''
Jsunpackn - A generic JavaScript Unpacker Network Edition
Copyright (C) 2010 Blake Hartstein
http://jsunpack.jeek.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 ve... | gpl-2.0 |
fperez/sympy | sympy/thirdparty/pyglet/pyglet/font/__init__.py | 5 | 23261 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
initcron/ansible | v2/ansible/plugins/action/include_vars.py | 15 | 1637 | # (c) 2013-2014, Benno Joy <benno@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | gpl-3.0 |
joshuajan/odoo | addons/account/wizard/account_financial_report.py | 33 | 5514 | # -*- 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... | agpl-3.0 |
siliconsmiley/QGIS | python/plugins/processing/algs/lidar/lastools/las2txtPro.py | 2 | 2582 | # -*- coding: utf-8 -*-
"""
***************************************************************************
las2txtPro.py
---------------------
Date : October 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
****************... | gpl-2.0 |
jasonseminara/OpenSourceFinal | myvenv/lib/python3.5/site-packages/pip/_vendor/progress/bar.py | 404 | 2707 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software 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 P... | mit |
msfrank/Higgins | higgins/http/dirlist.py | 1 | 4130 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Directory listing."""
# system imports
import os
import urllib
import stat
import time
# twisted imports
from higgins.http import iweb, resource, http, http_headers
def formatFileSize(size):
if size < 1024:
return '%i' ... | lgpl-2.1 |
marckuz/django | tests/utils_tests/test_dateparse.py | 293 | 5308 | from __future__ import unicode_literals
import unittest
from datetime import date, datetime, time, timedelta
from django.utils.dateparse import (
parse_date, parse_datetime, parse_duration, parse_time,
)
from django.utils.timezone import get_fixed_timezone
class DateParseTests(unittest.TestCase):
def test_... | bsd-3-clause |
joshloyal/scikit-learn | examples/plot_kernel_approximation.py | 26 | 8069 | """
==================================================
Explicit feature map approximation for RBF kernels
==================================================
An example illustrating the approximation of the feature map
of an RBF kernel.
.. currentmodule:: sklearn.kernel_approximation
It shows how to use :class:`RBFSa... | bsd-3-clause |
xiandiancloud/ji | cms/djangoapps/contentstore/views/helpers.py | 28 | 5058 | """
Helper methods for Studio views.
"""
from __future__ import absolute_import
import urllib
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from edxmako.shortcuts import render_to_string, render_to_respon... | agpl-3.0 |
shrimpboyho/flappy-bird-py | pyglet-1.1.4/pyglet/text/formats/plaintext.py | 9 | 2038 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | gpl-2.0 |
2014c2g23/2015cd_midterm- | static/Brython3.1.0-20150301-090019/Lib/optparse.py | 728 | 60616 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | gpl-3.0 |
multicastTor/multicastTor | torps/util/aggregate_relays.py | 1 | 2834 | ##### Aggregate relays that appear in consensus with descriptor 4/12-3/13 #####
## if using in pypy, i needed this first so it would grab networkx and stem correctly
## export PYTHONPATH=/usr/lib/python2.7/site-packages/:/home/rob/research/orsec/stem-install/lib/python2.7/site-packages
import json
import cPickle as p... | bsd-3-clause |
PurpleBooth/python-vm | venv/lib/python2.7/site-packages/setuptools/command/install_scripts.py | 505 | 2231 | from distutils import log
import distutils.command.install_scripts as orig
import os
from pkg_resources import Distribution, PathMetadata, ensure_directory
class install_scripts(orig.install_scripts):
"""Do normal script install, plus any egg_info wrapper scripts"""
def initialize_options(self):
ori... | mit |
stpierre/sponge | Sponge/urls.py | 1 | 2131 | from django.conf import settings
from django.conf.urls.defaults import *
urlpatterns = patterns('sponge.views.repos',
(r'^$', 'list'),
(r'^repo/$', 'list'),
(r'^repo/add/$', 'add'),
(r'^repo/(?P<repo_id>[^/]+)/$', 'view'),
(r'^repo/(?P<repo_id>[^/]+)/delete/$', 'delete'),
(r'^repo/(?P<repo_id>[... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.