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 |
|---|---|---|---|---|---|
aviciimaxwell/odoo | openerp/service/wsgi_server.py | 335 | 9490 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
boehm-s/dotfiles | .emacs.d/elpy/rpc-venv/lib/python3.7/site-packages/pkg_resources/extern/__init__.py | 245 | 2487 | import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(v... | gpl-3.0 |
kayak/fireant | fireant/queries/builder/dimension_latest_query_builder.py | 1 | 2026 | import pandas as pd
from fireant.dataset.fields import Field
from fireant.utils import (
alias_for_alias_selector,
immutable,
)
from fireant.queries.builder.query_builder import QueryBuilder, QueryException, add_hints
from fireant.queries.execution import fetch_data
class DimensionLatestQueryBuilder(QueryBui... | apache-2.0 |
nkhuyu/commons | tests/python/twitter/common/collections/test_ringbuffer.py | 13 | 1710 | # ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
bdarnell/tornado | tornado/routing.py | 1 | 25147 | # Copyright 2015 The Tornado Authors
#
# 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... | apache-2.0 |
BigAN/OztrendDelpoy | cartridge/shop/management/commands/product_db.py | 7 | 8543 | from __future__ import print_function
import csv
import os
import shutil
import sys
import datetime
from optparse import make_option
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from django.utils.translation import ugettext as _
from django.db.utils import I... | bsd-2-clause |
keimlink/django-cms | cms/extensions/extension_pool.py | 26 | 5091 | from cms.exceptions import SubClassNeededError
from .models import PageExtension, TitleExtension
class ExtensionPool(object):
def __init__(self):
self.page_extensions = set()
self.title_extensions = set()
self.signaling_activated = False
def register(self, extension):
"""
... | bsd-3-clause |
trnewman/VT-USRP-daughterboard-drivers | gnuradio-examples/python/digital/benchmark_rx.py | 10 | 3329 | #!/usr/bin/env python
#
# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (a... | gpl-3.0 |
jmt4/Selenium2 | py/selenium/webdriver/common/alert.py | 44 | 1289 | #Copyright 2007-2009 WebDriver committers
#Copyright 2007-2009 Google Inc.
#
#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 |
quinot/ansible | test/units/playbook/test_taggable.py | 119 | 4453 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
aserranoh/picc | picc/coff.py | 1 | 21846 |
'''Inspect Microchip's PIC objects in COFF format.
Copyright 2016 Antonio Serrano Hernandez
This file is part of picc.
picc 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 |
jean/sentry | src/sentry/api/endpoints/organization_shortid.py | 2 | 1666 | from __future__ import absolute_import
import six
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint
from sentry.models import Group
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.utils.apidocs import ... | bsd-3-clause |
throwable-one/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/localflavor/in_/in_states.py | 296 | 1859 | """
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('KA', 'Karnataka'),
('AP', 'Andhra Pr... | gpl-3.0 |
RichardLitt/wyrd-django-dev | django/utils/dates.py | 488 | 2237 | "Commonly-used date structures"
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')... | bsd-3-clause |
Kotaimen/georest | georest/geo/feature.py | 1 | 6761 | # -*- encoding: utf-8 -*-
__author__ = 'kotaimen'
__date__ = '5/29/14'
"""
georest.geo.feature
~~~~~~~~~~~~~~~~~~~
Geo Feature object
"""
import copy
import six
import shapely.geometry.base
import geojson.base
from . import jsonhelper as json
from .key import Key
from .geometry import Geometry
from .s... | bsd-2-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.1/Lib/distutils/command/install_scripts.py | 3 | 2102 | """distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
Python scripts."""
# contributed by Bastian Kleineidam
__revision__ = "$Id: install_scripts.py 57699 2007-08-30 03:52:21Z collin.winter $"
import os
from distutils.core import Command
from distutils import log
fr... | mit |
ddd332/presto | presto-docs/target/sphinx/jinja2/debug.py | 112 | 11028 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... | apache-2.0 |
nathanial/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/modeladmin/tests.py | 39 | 41732 | from datetime import date
import unittest
from django import forms
from django.conf import settings
from django.contrib.admin.options import ModelAdmin, TabularInline, \
HORIZONTAL, VERTICAL
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.validation import validate
from django.contrib.ad... | gpl-3.0 |
tareqalayan/ansible | test/legacy/cleanup_rax.py | 160 | 6547 | #!/usr/bin/env python
import os
import re
import yaml
import argparse
try:
import pyrax
HAS_PYRAX = True
except ImportError:
HAS_PYRAX = False
from ansible.module_utils.six.moves import input
def rax_list_iterator(svc, *args, **kwargs):
method = kwargs.pop('method', 'list')
items = getattr(svc,... | gpl-3.0 |
ritchyteam/odoo | openerp/report/render/odt2odt/__init__.py | 381 | 1085 | # -*- 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... | agpl-3.0 |
rsalmaso/python-social-auth | social/tests/actions/test_associate.py | 80 | 2932 | import json
from social.exceptions import AuthAlreadyAssociated
from social.tests.models import User
from social.tests.actions.actions import BaseActionTest
class AssociateActionTest(BaseActionTest):
expected_username = 'foobar'
def setUp(self):
super(AssociateActionTest, self).setUp()
self... | bsd-3-clause |
bema-ligo/pycbc | pycbc/filter/zpk.py | 2 | 3957 | # Copyright (C) 2014 Christopher M. Biwer
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distrib... | gpl-3.0 |
RuudBurger/CouchPotatoServer | libs/html5lib/treebuilders/_base.py | 715 | 13699 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# fr... | gpl-3.0 |
NeCTAR-RC/nova | nova/api/openstack/compute/legacy_v2/limits.py | 12 | 15266 | # Copyright 2011 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... | apache-2.0 |
isralopez/geonode | geonode/proxy/tests.py | 5 | 2790 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 |
anomam/pvlib-python | pvlib/tests/test_bifacial.py | 2 | 5958 | import pandas as pd
import numpy as np
from datetime import datetime
from pvlib.bifacial import pvfactors_timeseries, PVFactorsReportBuilder
from conftest import requires_pvfactors
import pytest
@requires_pvfactors
@pytest.mark.parametrize('run_parallel_calculations',
[False, True])
def test_... | bsd-3-clause |
dlazz/ansible | lib/ansible/modules/cloud/google/gcp_compute_backend_bucket_facts.py | 11 | 5704 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
QiJune/Paddle | python/paddle/v2/dataset/tests/mnist_test.py | 16 | 1421 | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 |
MotorolaMobilityLLC/external-chromium_org | chrome/tools/check_grd_for_unused_strings.py | 25 | 6425 | #!/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.
"""Without any args, this simply loads the IDs out of a bunch of the Chrome GRD
files, and then checks the subset of the code that ... | bsd-3-clause |
jobovy/galpy | galpy/potential/SpiralArmsPotential.py | 1 | 29343 | ###############################################################################
# SpiralArmsPotential.py: class that implements the spiral arms potential
# from Cox and Gomez (2002)
#
# https://arxiv.org/abs/astro-ph/0207635
#
# Phi(r, phi, z) = -4*pi*G*H*rho0*exp(-(r-r0)/Rs)*sum(Cn/(Kn*Dn)... | bsd-3-clause |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/protorpc/transport.py | 24 | 12805 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# 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 o... | apache-2.0 |
bswartz/cinder | cinder/tests/unit/api/contrib/test_services.py | 1 | 27106 | # Copyright 2012 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
sumspr/scikit-learn | benchmarks/bench_plot_ward.py | 290 | 1260 | """
Benchmark scikit-learn's Ward implement compared to SciPy's
"""
import time
import numpy as np
from scipy.cluster import hierarchy
import pylab as pl
from sklearn.cluster import AgglomerativeClustering
ward = AgglomerativeClustering(n_clusters=3, linkage='ward')
n_samples = np.logspace(.5, 3, 9)
n_features = n... | bsd-3-clause |
slohse/ansible | lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py | 12 | 22222 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
drjeep/django | tests/many_to_one_null/tests.py | 142 | 6484 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Car, Driver, Reporter
class ManyToOneNullTests(TestCase):
def setUp(self):
# Create a Reporter.
self.r = Reporter(name='John Smith')
self.r.save()
# Create an Article.
se... | bsd-3-clause |
echanna/EdxNotAFork | common/lib/xmodule/xmodule/combined_open_ended_module.py | 10 | 22637 | import logging
from lxml import etree
from pkg_resources import resource_string
from xmodule.raw_module import RawDescriptor
from .x_module import XModule, module_attr
from xblock.fields import Integer, Scope, String, List, Float, Boolean
from xmodule.open_ended_grading_classes.combined_open_ended_modulev1 import Com... | agpl-3.0 |
elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/pegasus/externals/python/boto/dynamodb/table.py | 153 | 21808 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | gpl-3.0 |
xiaohan2012/cotrain | util.py | 1 | 1501 |
def sample_from_list_and_split(items, n, rng):
"""Sample n examples from items using random generator rng
>>> from numpy.random import RandomState
>>> rng = RandomState(1)
>>> items = ['a', 'b', 'c', 'd', 'e', 'f']
>>> sample_from_list_and_split(items, 2, rng)
(['b', 'c'], ['a', 'd', 'e',... | mit |
IONISx/edx-platform | openedx/core/djangoapps/theming/test_util.py | 23 | 3004 | """
Test helpers for Comprehensive Theming.
"""
from functools import wraps
import os
import os.path
from mock import patch
from django.conf import settings
from django.test.utils import override_settings
import edxmako
from .core import comprehensive_theme_changes
def with_comp_theme(theme_dir):
"""
A d... | agpl-3.0 |
apporc/cinder | cinder/tests/unit/zonemanager/test_brcd_fc_san_lookup_service.py | 2 | 6588 | # (c) Copyright 2014 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Copyright 2014 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
#
# ... | apache-2.0 |
milinda/samza | samza-test/src/main/python/templates.py | 25 | 1511 | # 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 |
piffey/ansible | lib/ansible/plugins/terminal/nxos.py | 8 | 2005 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
ASMfreaK/sensorika-robot | sensorika/locator.py | 2 | 10172 | import datetime
try:
import ujson as json
except:
#print('ujson not found, using json')
import json
import logging
import signal
import threading
import time
import plyvel
import zmq
from .connector import ConnectorAsync
from .tools import getLocalIp
PORT = 15701
"""
class ThreadedConnector(threading.T... | lgpl-3.0 |
sachitanandpandey/sos_spandey | sos/plugins/qpid.py | 5 | 2541 | # 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 your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 |
tchernomax/ansible | test/units/modules/network/nxos/test_nxos_evpn_global.py | 53 | 2780 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
Fokko/incubator-airflow | tests/contrib/sensors/test_jira_sensor_test.py | 1 | 2859 | # -*- 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 |
Azure/azure-documentdb-python | test/session_token_unit_tests.py | 1 | 3972 | import unittest
import uuid
import pytest
import azure.cosmos.documents as documents
from azure.cosmos.vector_session_token import VectorSessionToken
from azure.cosmos.errors import CosmosError
@pytest.mark.usefixtures("teardown")
class SessionTokenUnitTest(unittest.TestCase):
"""Test to ensure escaping of non-asc... | mit |
clovertrail/cloudinit-bis | cloudinit/util.py | 1 | 73447 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yaho... | gpl-3.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python-modules/twisted/twisted/conch/scripts/conch.py | 59 | 18094 | # -*- test-case-name: twisted.conch.test.test_conch -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# $Id: conch.py,v 1.65 2004/03/11 00:29:14 z3p Exp $
#""" Implementation module for the `conch` command.
#"""
from twisted.conch.client import connect, default, options
from tw... | apache-2.0 |
preete-dixit-ck/incubator-airflow | airflow/contrib/operators/databricks_operator.py | 15 | 11115 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
moacirnq/camdroid_server_usp | config.py | 1 | 1175 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or '123456'
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
FLASKY_MAIL_SUBJECT_PREFIX = '[Flasky]'
FLASKY_MAIL_SENDER = 'Flasky Admin <camdroid_usp@gmail.com>'
FLASKY_ADMIN = os.environ.get(... | gpl-2.0 |
ProfessionalIT/professionalit-webiste | sdk/google_appengine/lib/django-1.3/django/views/generic/base.py | 56 | 6110 | from django import http
from django.core.exceptions import ImproperlyConfigured
from django.template import RequestContext, loader
from django.template.response import TemplateResponse
from django.utils.functional import update_wrapper
from django.utils.log import getLogger
from django.utils.decorators import classonly... | lgpl-3.0 |
oli-kester/advanced-av-examples | amp-osc-lv2/.waf-1.8.5-3556be08f33a5066528395b11fed89fa/waflib/ConfigSet.py | 2 | 3763 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Logs,Utils
re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M)
class ConfigSet(object):
__slots__=('table','parent')
def __init__(self,... | gpl-2.0 |
selvakarthik21/newspaper | newspaperdemo/source/source.py | 1 | 15524 | # -*- coding: utf-8 -*-
"""
Source objects abstract online news source websites & domains.
www.cnn.com would be its own source.
"""
__title__ = 'newspaper'
__author__ = 'Lucas Ou-Yang'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014, Lucas Ou-Yang'
import logging
from urllib.parse import urljoin, urlsplit, urlunsp... | mit |
alexteodor/odoo | addons/membership/membership.py | 128 | 27626 | # -*- 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 |
Donkyhotay/MoonPy | twisted/internet/wxsupport.py | 61 | 1455 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Old method of wxPython support for Twisted.
twisted.internet.wxreactor is probably a better choice.
To use::
| # given a wxApp instance called myWxAppInstance:
| from twisted.internet import wxsupport
| wxsupport.ins... | gpl-3.0 |
fengsp/plan | plan/testsuite/output.py | 5 | 1778 | # -*- coding: utf-8 -*-
"""
plan.testsuite.output
~~~~~~~~~~~~~~~~~~~~~
Tests the output for Plan.
:copyright: (c) 2014 by Shipeng Feng.
:license: BSD, see LICENSE for more details.
"""
import unittest
from plan.output import Output
from plan.testsuite import BaseTestCase
class OutputTestCase(... | bsd-3-clause |
shaistaansari/django | django/contrib/gis/forms/widgets.py | 422 | 3659 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.gis import gdal
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.forms.widgets import Widget
from django.template import loader
from django.utils import six, translation
logger = log... | bsd-3-clause |
mr-niels-christensen/environment-scotland-dot-rural | src/main/rdflib/__init__.py | 4 | 3049 | """\
A pure Python package providing the core RDF constructs.
The packages is intended to provide the core RDF types and interfaces
for working with RDF. The package defines a plugin interface for
parsers, stores, and serializers that other packages can use to
implement parsers, stores, and serializers that will plug ... | apache-2.0 |
luci/luci-py | client/third_party/colorama/ansi.py | 640 | 2524 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
OSC = '\033]'
BEL = '\007'
def code_to_chars(code):
return CSI + str(code) + 'm'
def set... | apache-2.0 |
robbi/pyload | module/plugins/hoster/ShareonlineBiz.py | 7 | 5866 | # -*- coding: utf-8 -*-
import re
import time
from module.network.RequestFactory import getURL as get_url
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.SimpleHoster import SimpleHoster
class ShareonlineBiz(SimpleHoster):
__name__ = "ShareonlineBiz"
__type__ = "hoster"
__version__ = "0.66"
... | gpl-3.0 |
goldeneye-source/ges-python | lib/encodings/mac_turkish.py | 272 | 13513 | """ Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.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... | gpl-3.0 |
crosswalk-project/blink-crosswalk-efl | LayoutTests/http/tests/websocket/echo-requested-extensions_wsh.py | 5 | 1778 | # Copyright (C) 2013 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 |
steynovich/ansible-modules-extras | network/f5/bigip_monitor_tcp.py | 32 | 15166 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, serge van Ginderachter <serge@vanginderachter.be>
#
# 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 vers... | gpl-3.0 |
mdsafwan/Deal-My-Stuff | Lib/site-packages/django/contrib/admin/utils.py | 21 | 17140 | from __future__ import unicode_literals
import datetime
import decimal
from collections import defaultdict
from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.... | apache-2.0 |
atsaki/libcloud | libcloud/dns/drivers/vultr.py | 3 | 11986 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
liukaijv/XlsxWriter | xlsxwriter/test/comparison/test_button10.py | 8 | 1309 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
jwhui/openthread | tests/scripts/thread-cert/Cert_9_2_02_MGMTCommissionerSet.py | 3 | 16733 | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# 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. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
jennyzhang0215/incubator-mxnet | example/bi-lstm-sort/lstm.py | 19 | 8237 | # 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 |
adam111316/SickGear | lib/unidecode/x010.py | 252 | 4110 | data = (
'k', # 0x00
'kh', # 0x01
'g', # 0x02
'gh', # 0x03
'ng', # 0x04
'c', # 0x05
'ch', # 0x06
'j', # 0x07
'jh', # 0x08
'ny', # 0x09
'nny', # 0x0a
'tt', # 0x0b
'tth', # 0x0c
'dd', # 0x0d
'ddh', # 0x0e
'nn', # 0x0f
'tt', # 0x10
'th', # 0x11
'd', # 0x12
'dh', ... | gpl-3.0 |
HomeRad/TorCleaner | wc/filter/rules/Rule.py | 1 | 9905 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2000-2009 Bastian Kleineidam
"""
Basic rule class and routines.
"""
import re
from wc.XmlUtils import xmlquote, xmlquoteattr, xmlunquote
from . import register_rule
def compileRegex(obj, attr, fullmatch=False, flags=0):
"""
Regex-compile object attribute into <attr... | gpl-2.0 |
kanagasabapathi/python-for-android | python3-alpha/python3-src/Lib/tkinter/tix.py | 45 | 77690 | # -*-mode: python; fill-column: 75; tab-width: 8 -*-
#
# $Id$
#
# Tix.py -- Tix widget wrappers.
#
# For Tix, see http://tix.sourceforge.net
#
# - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995.
# based on an idea of Jean-Marc Lugrin (lugrin@ms.com)
#
# NOTE: In order to minimize changes to Tkinter.py, ... | apache-2.0 |
xiaoyaozi5566/GEM5_DRAMSim2 | src/mem/MemObject.py | 4 | 1786 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
fxfitz/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork.py | 7 | 13252 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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
ANS... | gpl-3.0 |
devs1991/test_edx_docmode | common/lib/symmath/symmath/formula.py | 58 | 22439 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Flexible python representation of a symbolic mathematical formula.
Acceptes Presentation MathML, Content MathML (and could also do OpenMath).
Provides sympy representation.
"""
#
# File: formula.py
# Date: 04-May-12 (creation)
# Author: I. Chuang <ichuang@mit.edu>
#
im... | agpl-3.0 |
picca/hkl | tests/bindings/polarisation.py | 1 | 13010 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import math
import unittest
from collections import namedtuple
from gi.repository import GLib
from gi.repository import Hkl
from numpy import (array, cross, dot, empty, hstack, reshape, vstack)
from numpy.linalg import inv, norm
#########
# Types #
#########
D... | gpl-3.0 |
jlegendary/nupic | examples/tp/tp_overlapping_sequences.py | 8 | 31874 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | gpl-3.0 |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/sphinx/ext/apidoc.py | 1 | 18689 | """
sphinx.ext.apidoc
~~~~~~~~~~~~~~~~~
Parses a directory tree looking for Python modules and packages and creates
ReST files appropriately to create code documentation with Sphinx. It also
creates a modules index (named modules.<suffix>).
This is derived from the "sphinx-autopackage" script... | mit |
kamcpp/tensorflow | tensorflow/python/training/momentum_test.py | 16 | 20682 | # Copyright 2015 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 |
aisk/grumpy | third_party/stdlib/re.py | 7 | 13461 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | apache-2.0 |
dyn888/youtube-dl | youtube_dl/extractor/expotv.py | 35 | 2961 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
)
class ExpoTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])'
_TEST = {
'url': 'http://www.expotv.com/vide... | unlicense |
Samuel789/MediPi | MedManagementWeb/env/lib/python3.5/site-packages/idna/uts46data.py | 143 | 184931 | # This file is automatically generated by tools/build-uts46data.py
# vim: set fileencoding=utf-8 :
"""IDNA Mapping Table from UTS46."""
def _seg_0():
return [
(0x0, '3'),
(0x1, '3'),
(0x2, '3'),
(0x3, '3'),
(0x4, '3'),
(0x5, '3'),
(0x6, '3'),
(0x7, '3'),
(0x8, '3'),
(0x9, ... | apache-2.0 |
a-sk/alot | alot/addressbook/abook.py | 4 | 1088 | # Copyright (C) 2011-2015 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import os
from . import AddressBook
from ..settings.utils import read_config
class AbookAddressBook(AddressBook):
""":class:`Add... | gpl-3.0 |
iModels/mbuild | mbuild/utils/conversion.py | 1 | 6621 | """mBuild conversion utilities."""
import numpy as np
def RB_to_OPLS(c0, c1, c2, c3, c4, c5):
"""Convert Ryckaert-Bellemans type dihedrals to OPLS type.
Parameters
----------
c0, c1, c2, c3, c4, c5 : Ryckaert-Belleman coefficients (in kcal/mol)
Returns
-------
opls_coeffs : np.array, sha... | mit |
scipy/SciPyCentral | scipy_central/submission/views/show.py | 3 | 13053 | # django imports
from django.conf import settings
from django.shortcuts import render_to_response, redirect, HttpResponse
from django.template import RequestContext
from django.template.defaultfilters import slugify
from django.contrib.sites.models import Site
from django.contrib.auth.decorators import login_required
f... | bsd-3-clause |
Stavitsky/neutron | neutron/tests/unit/plugins/ml2/drivers/test_type_vlan.py | 48 | 11910 | # Copyright (c) 2014 Thales Services SAS
# 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 |
BurgyDev/mongoose | bindings/python/example.py | 106 | 2433 | # This is Python example on how to use Mongoose embeddable web server,
# http://code.google.com/p/mongoose
#
# Before using the mongoose module, make sure that Mongoose shared library is
# built and present in the current (or system library) directory
import mongoose
import sys
# Handle /show and /form URIs.
def Even... | mit |
cython-testbed/pandas | pandas/tests/groupby/test_function.py | 3 | 38905 | import pytest
import numpy as np
import pandas as pd
from pandas import (DataFrame, Index, compat, isna,
Series, MultiIndex, Timestamp, date_range)
from pandas.errors import UnsupportedFunctionCall
from pandas.util import testing as tm
import pandas.core.nanops as nanops
from string import ascii_lo... | bsd-3-clause |
libscie/liberator | liberator/lib/python3.6/site-packages/django/apps/config.py | 51 | 8187 | import os
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.utils._os import upath
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django application and its con... | cc0-1.0 |
piohhmy/euler | p010.py | 1 | 1626 | import math
from timeit import Timer
def solve_p10_sieve():
return sum(sieve_primes_up_to(2000000))
def solve_p10_sieve_w_generator():
return sum(prime_sieve_generator(2000000))
def sieve_primes_up_to(num):
num_list = list(range(num))
num_list[1] = 0 # cross out 1, special case
i = 2
while ... | mit |
xujun10110/golismero | thirdparty_libs/django/views/decorators/debug.py | 48 | 2337 | import functools
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two forms are accepted:
* with specif... | gpl-2.0 |
garbled1/ansible | lib/ansible/module_utils/exoscale.py | 39 | 6661 | # -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the aut... | gpl-3.0 |
ChanderG/scikit-learn | sklearn/neighbors/tests/test_kde.py | 208 | 5556 | import numpy as np
from sklearn.utils.testing import (assert_allclose, assert_raises,
assert_equal)
from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors
from sklearn.neighbors.ball_tree import kernel_norm
from sklearn.pipeline import make_pipeline
from sklearn.dataset... | bsd-3-clause |
xiejianying/pjsip | tests/automated/configure.py | 93 | 11490 | #!/usr/bin/python
import optparse
import os
import platform
import socket
import subprocess
import sys
PROG = "r" + "$Rev: 17 $".strip("$ ").replace("Rev: ", "")
PYTHON = os.path.basename(sys.executable)
build_type = ""
vs_target = ""
s60_target = ""
no_test = False
no_pjsua_test = False
#
# Get gcc version
#
def gc... | gpl-2.0 |
dnozay/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/gdal/__init__.py | 397 | 2173 | """
This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
reference system to another.
Driver: Wraps an OGR data source driver.
DataSource: Wrapper for the OGR data source object, supports
OGR-... | gpl-3.0 |
runarberg/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_whitespace_filter.py | 453 | 5642 | from __future__ import absolute_import, division, unicode_literals
import unittest
from html5lib.filters.whitespace import Filter
from html5lib.constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
try:
unittest.TestCase.assertEqual
except AttributeError:
unittest.TestCase.assertEqual =... | mpl-2.0 |
calaldees/KaraKara | website/tests/conftest.py | 1 | 3304 | import pytest
import logging
log = logging.getLogger(__name__)
from .data.queue import queue
from .data.tracks import tags, attachments, tracks, tracks_volume, track_unicode_special
from .data.tracks_random import random_tracks
from .data.auth import users
# Markers -------------------------------------------------... | gpl-3.0 |
PokemonGoF/PokemonGo-Bot-Desktop | build/pywin/Lib/curses/textpad.py | 212 | 7338 | """Simple textbox editing widget with Emacs-like keybindings."""
import curses
import curses.ascii
def rectangle(win, uly, ulx, lry, lrx):
"""Draw a rectangle with corners at the provided upper-left
and lower-right coordinates.
"""
win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
win.hline(u... | mit |
jendap/tensorflow | tensorflow/contrib/boosted_trees/python/kernel_tests/prediction_ops_test.py | 25 | 59018 | # 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 |
EmanueleCannizzaro/scons | test/MSVC/batch-longlines.py | 1 | 2071 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 right... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.