repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jhawkesworth/ansible | lib/ansible/modules/remote_management/oneview/oneview_logical_interconnect_group_facts.py | 115 | 3101 | #!/usr/bin/python
# Copyright: (c) 2016-2017, Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
ganeti-github-testing/ganeti-test-1 | test/py/ganeti.luxi_unittest.py | 9 | 1635 | #!/usr/bin/python
#
# Copyright (C) 2010, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this l... | bsd-2-clause |
weihautin/anki | aqt/forms/preview.py | 1 | 1921 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer/preview.ui'
#
# Created: Fri Aug 22 00:57:31 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
exce... | agpl-3.0 |
carljm/django | tests/proxy_models/tests.py | 20 | 15823 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User as AuthUser
from django.contrib.contenttypes.models import ContentType
from django.core import checks, management
from django.db import DEFAULT_DB_ALIAS, models
from django.db.models import signals
from... | bsd-3-clause |
catapult-project/catapult | third_party/google-endpoints/endpoints/protojson.py | 7 | 3743 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
inspirehep/beard-server | tests/test_celery.py | 1 | 8690 | # -*- coding: utf-8 -*-
#
# This file is part of Inspire.
# Copyright (C) 2016 CERN.
#
# Inspire 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... | gpl-2.0 |
sameerparekh/pants | tests/python/pants_test/android/tasks/test_dx_compile_integration.py | 15 | 1523 | # coding=utf-8
# Copyright 2014 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 uni... | apache-2.0 |
tonyseek/sqlalchemy-utils | sqlalchemy_utils/functions/render.py | 2 | 1977 | import inspect
import six
import sqlalchemy as sa
from .mock import create_mock_engine
def render_expression(expression, bind, stream=None):
"""Generate a SQL expression from the passed python expression.
Only the global variable, `engine`, is available for use in the
expression. Additional local variabl... | bsd-3-clause |
zlorb/mitmproxy | mitmproxy/net/server_spec.py | 7 | 2088 | """
Parse scheme, host and port from a string.
"""
import collections
import re
from typing import Tuple
from mitmproxy.net import check
ServerSpec = collections.namedtuple("ServerSpec", ["scheme", "address"])
server_spec_re = re.compile(
r"""
^
(?:(?P<scheme>\w+)://)? # scheme is optional
... | mit |
leekchan/djangae | djangae/db/backends/appengine/dnf.py | 6 | 9258 | import copy
from itertools import product
from django.db.models.sql.datastructures import EmptyResultSet
from djangae.db.backends.appengine.query import WhereNode
from django.db import NotSupportedError
def preprocess_node(node, negated):
to_remove = []
# Go through the children of this node and if any of t... | bsd-3-clause |
Red--Code/mt6589_kernel_3.4.67 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
lukebarnard1/bokeh | bokeh/models/widgets/inputs.py | 24 | 4851 | """ Various kinds of input widgets and form controls.
"""
from __future__ import absolute_import
import six
from ...properties import Bool, Int, Float, String, Date, RelativeDelta, Enum, List, Dict, Tuple, Either, Instance
from ..actions import Callback
from ..widget import Widget
class InputWidget(Widget):
"""... | bsd-3-clause |
aospx-kitkat/platform_external_chromium_org | tools/site_compare/drivers/win32/mouse.py | 189 | 6462 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""SiteCompare module for simulating mouse input.
This module contains functions that can be used to simulate a user
navigating us... | bsd-3-clause |
aaron-fz/neutron_full_sync | neutron/plugins/vmware/dbexts/nsxrouter.py | 16 | 2668 | # Copyright 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
jonasfoe/COPASI | stochastic-testsuite/compare_sd.py | 2 | 1614 | #!/usr/bin/python
import sys
import math
import string
SD_FILE=sys.argv[1]
REFERENCE_SD_FILE=sys.argv[2]
REPEATS=float(sys.argv[3])
OUTFILE=sys.argv[4]
SD=file(SD_FILE,"r").readlines()
REFERENCE_SD=file(REFERENCE_SD_FILE,"r").readlines()
EXIT_STATUS=0
if(len(SD) != len(REFERENCE_SD)):
print "ERROR: The input f... | artistic-2.0 |
msmania/grpc | tools/distrib/python/grpcio_tools/protoc_lib_deps.py | 4 | 9508 |
# Copyright 2016 gRPC 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 writin... | apache-2.0 |
utecuy/edx-platform | lms/envs/static.py | 100 | 2249 | """
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We intentionally define lot... | agpl-3.0 |
hofschroeer/gnuradio | gr-fec/python/fec/LDPC/Generate_LDPC_matrix.py | 7 | 3273 | #!/usr/bin/env python
#
# Copyright 2015 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 (at your option)
# ... | gpl-3.0 |
Arkahnn/VanillaRNN | VanillaRNN.py | 1 | 13887 | import random
import numpy as np
import numpy.matlib as mat
import tools
class RNN:
def __init__(self, dictionary, train, val, test, H, eta, alpha, t_prev):
self.dictionary, self.train, self.val, self.test = dictionary, train, val, test
self.D = len(dictionary)
#self.DU = self.D + 1
... | apache-2.0 |
meabsence/python-for-android | python3-alpha/python3-src/Lib/test/make_ssl_certs.py | 89 | 1886 | """Make the custom certificate and private key files used by test_ssl
and friends."""
import os
import sys
import tempfile
from subprocess import *
req_template = """
[req]
distinguished_name = req_distinguished_name
x509_extensions = req_x509_extensions
prompt = no
[re... | apache-2.0 |
amlyj/pythonStudy | 2.7/contributed_modules/requests/thread_downloader.py | 1 | 5761 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 18-4-23 下午3:24
# @Author : Tom.Lee
# @CopyRight : 2016-2017 OpenBridge by yihecloud
# @File : thread_downloader.py
# @Product : PyCharm
# @Docs :
# @Source :
import math
import os
import sys
import threa... | mit |
dhruvagarwal/django | django/contrib/admin/tests.py | 301 | 6166 | import os
from unittest import SkipTest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.utils.module_loading import import_string
from django.utils.translation import ugettext as _
class AdminSeleniumWebDriverTestCase(StaticLiveServerTestCase):
available_apps = [
'dja... | bsd-3-clause |
bitmovin/bitcodin-python | examples/create_job_rotation.py | 1 | 1687 | #!/usr/bin/env python
from time import sleep
import bitcodin
bitcodin.api_key = 'YOUR API KEY'
input_obj = bitcodin.Input(url='http://bitbucketireland.s3.amazonaws.com/Sintel-original-short.mkv')
input_result = bitcodin.create_input(input_obj)
video_configs = list()
video_configs.append(bitcodin.VideoStreamConfig(... | unlicense |
scizzorz/rain | rain/lexer.py | 1 | 3763 | from . import error as Q
from . import module as M
from .token import bool_token
from .token import coord
from .token import dedent_token
from .token import end_token
from .token import float_token
from .token import indent_token
from .token import int_token
from .token import keyword_token
from .token import name_toke... | mit |
robbiet480/home-assistant | homeassistant/components/zwave/light.py | 2 | 13266 | """Support for Z-Wave lights."""
import logging
from threading import Timer
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
DOMAIN,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_TRA... | apache-2.0 |
napkindrawing/ansible | lib/ansible/modules/database/postgresql/postgresql_db.py | 54 | 10855 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
nju520/django | django/db/backends/oracle/introspection.py | 517 | 11463 | import cx_Oracle
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_types_reverse = {
cx_Oracle.... | bsd-3-clause |
mixman/djangodev | tests/regressiontests/null_fk_ordering/models.py | 34 | 1358 | """
Regression tests for proper working of ForeignKey(null=True). Tests these bugs:
* #7512: including a nullable foreign key reference in Meta ordering has un
xpected results
"""
from django.db import models
# The first two models represent a very simple null FK ordering case.
class Author(models.Model):
... | bsd-3-clause |
Thraxis/pymedusa | lib/adba/aniDBlink.py | 69 | 7333 | #!/usr/bin/env python
#
# This file is part of aDBa.
#
# aDBa 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.
#
# aDBa is distributed i... | gpl-3.0 |
dustymabe/atomic | Atomic/satellite.py | 3 | 13673 | import sys
import requests
import json
import os
import base64
from Atomic import util
try:
import ConfigParser as configparser
except ImportError: # py3 compat
import configparser
# On latest Fedora, this is a symlink
if hasattr(requests, 'packages'):
requests.packages.urllib3.disable_warnings()
else:
... | lgpl-2.1 |
hirunatan/anillo | tests/middlewares/test_sessions.py | 3 | 1121 | # -*- coding: utf-8 -*-
"""
tests.middlwares.test_session
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests session middleware
:copyright: (c) 2015 by Jesús Espino.
:license: BSD, see LICENSE for more details.
"""
from anillo.middlewares.cookies import wrap_cookies
from anillo.middlewares.session import wrap_s... | bsd-2-clause |
grantvk/aima-python | submissions/Hess/vacuum2.py | 18 | 1142 | import agents as ag
def HW2Agent() -> object:
def program(percept):
bump, status = percept
if status == 'Dirty':
action = 'Suck'
else:
lastBump, lastStatus = program.oldPercepts[-1]
lastAction = program.oldActions[-1]
if lastAction == 'Suck'... | mit |
ueg1990/flask-restful | tests/test_cors.py | 19 | 2247 | import unittest
from flask import Flask
import flask_restful
from flask_restful.utils import cors
from nose.tools import assert_equals, assert_true
class CORSTestCase(unittest.TestCase):
def test_crossdomain(self):
class Foo(flask_restful.Resource):
@cors.crossdomain(origin='*')
... | bsd-3-clause |
mibanescu/pulp | server/pulp/server/async/app.py | 3 | 2642 | """
This module is the Pulp Celery App. It is passed to the workers from the command line, and they
will see the "celery" module attribute and use it. This module also initializes the Pulp app after
Celery setup finishes.
"""
from celery.signals import celeryd_after_setup
# This import will load our configs
from pulp.... | gpl-2.0 |
saydulk/django | django/contrib/sessions/backends/base.py | 298 | 12046 | from __future__ import unicode_literals
import base64
import logging
import string
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.sessions.exceptions import SuspiciousSession
from django.core.exceptions import SuspiciousOperation
from django.utils import timezone
from dj... | bsd-3-clause |
redhat-openstack/cinder | cinder/tests/test_vmware_vmdk.py | 2 | 126862 | # Copyright (c) 2013 VMware, 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... | apache-2.0 |
edmstudio/ansible | lib/ansible/utils/module_docs_fragments/backup.py | 427 | 1071 | # Copyright (c) 2015 Ansible, 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.
#
# Ansi... | gpl-3.0 |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.7.42-1/roles/lib_openshift/src/test/unit/test_oc_clusterrole.py | 64 | 3914 | '''
Unit tests for oc clusterrole
'''
import copy
import os
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-er... | apache-2.0 |
kashif/scikit-learn | benchmarks/bench_glmnet.py | 297 | 3848 | """
To run this, you'll need to have installed.
* glmnet-python
* scikit-learn (of course)
Does two benchmarks
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of... | bsd-3-clause |
HiSPARC/station-software | user/python/Tools/Scripts/reindent.py | 2 | 11418 | #! /usr/bin/env python
# Released to the public domain, by Tim Peters, 03 October 2000.
"""reindent [-d][-r][-v] [ path ... ]
-d (--dryrun) Dry run. Analyze, but don't make any changes to, files.
-r (--recurse) Recurse. Search for all .py files in subdirectories too.
-n (--nobackup) No backup. Does not make a... | gpl-3.0 |
daizhengy/RDS | trove/tests/api/instances_delete.py | 4 | 6330 | # Copyright 2013 OpenStack Foundation
# Copyright 2013 Rackspace Hosting
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 co... | apache-2.0 |
RobertoMalatesta/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/options.py | 131 | 6106 | # 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 |
jacobsenanaizabel/shoop | shoop_tests/admin/test_order_module.py | 6 | 1652 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from shoop.admin.modules.orders.dashboard import OrderValueCha... | agpl-3.0 |
melbit-kevinwessel/ansible-modules-extras | network/dnsmadeeasy.py | 77 | 13305 | #!/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 distributed... | gpl-3.0 |
wbap/Hackathon2015 | Hiroshiba/NeuralNetwork/test_check.py | 2 | 7036 |
# coding: utf-8
# In[ ]:
import os
import sys
import re # for regex
import math
import json
import pickle
from PIL import Image
import numpy as np
from sklearn.datasets import fetch_mldata
import matplotlib.pyplot as plt
get_ipython().magic('matplotlib inline')
# import pycuda.autoinit
from chainer import cuda,... | apache-2.0 |
kazemakase/scikit-learn | examples/applications/plot_out_of_core_classification.py | 255 | 13919 | """
======================================================
Out-of-core classification of text documents
======================================================
This is an example showing how scikit-learn can be used for classification
using an out-of-core approach: learning from data that doesn't fit into main
memory. ... | bsd-3-clause |
dyyi/moneybook | venv/Lib/site-packages/django/conf/locale/lt/formats.py | 504 | 1830 | # -*- 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 = r'Y \m. E j \d.'
TIME_FORMAT = 'H:... | apache-2.0 |
pra85/calibre | src/calibre/ebooks/oeb/transforms/guide.py | 4 | 2067 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
class Clean(object):
'''Clean up guide, leaving only known values '''
def _... | gpl-3.0 |
binarytemple/ansible | lib/ansible/module_utils/splitter.py | 2 | 6643 | # (c) 2014 James Cammarata, <jcammarata@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 late... | gpl-3.0 |
be-cloud-be/horizon-addons | server/addons/mail/wizard/invite.py | 16 | 3680 | # -*- coding: utf-8 -*-
from openerp import _, api, fields, models
class Invite(models.TransientModel):
""" Wizard to invite partners (or channels) and make them followers. """
_name = 'mail.wizard.invite'
_description = 'Invite wizard'
@api.model
def default_get(self, fields):
result = ... | agpl-3.0 |
depet/scikit-learn | sklearn/ensemble/tests/test_partial_dependence.py | 44 | 7031 | """
Testing for the partial dependence module.
"""
import numpy as np
from numpy.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import if_matplotlib
from sklearn.ensemble.partial_dependence import partial_dependence
from sklearn.ensemble.partial_dependence... | bsd-3-clause |
nukru/projectQ | app/auth/views.py | 1 | 4303 | from app import app, db, lm
from flask import Blueprint, request, url_for, flash, redirect, abort, session, g
from flask import render_template
from flask.ext.login import login_user, logout_user, current_user, login_required
from forms import LoginFormOpenID, RegistrationForm, LoginFormEmail, RegistrationForm2
from . ... | apache-2.0 |
kaniblu/wiki-mysql | filters.py | 1 | 1818 | # encoding: utf-8
from __future__ import unicode_literals
import re
import string
import six
import gensim
class WikiBodyFilter(object):
"""Generic wikipedia article filter
Strips off illegal characters and markups. Borrows some basic logic from
gensim utils.
"""
def __init__(self, remove_ht... | mit |
openhatch/oh-mainline | vendor/packages/django-http-proxy/versioneer.py | 7 | 38235 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Versioneer 2
============
* Like a rocketeer, but for versions!
* Based on https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy
* Edited by Ryan Dwyer
This is a... | agpl-3.0 |
tlksio/tlksio | env/lib/python3.4/site-packages/pytz/__init__.py | 70 | 34435 | '''
datetime.tzinfo timezone definitions generated from the
Olson timezone database:
ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
See the datetime section of the Python Library Reference for information
on how to use these modules.
'''
# The IANA (nee Olson) database is updated several times a year.
OLSON_VERSION = '2... | mit |
dahlstrom-g/intellij-community | python/helpers/pycharm/_jb_pytest_runner.py | 6 | 1693 | # coding=utf-8
import pytest
from distutils import version
import sys
from _pytest.config import get_plugin_manager
from pkg_resources import iter_entry_points
from _jb_runner_tools import jb_patch_separator, jb_doc_args, JB_DISABLE_BUFFERING, start_protocol, parse_arguments, \
set_parallel_mode
from teamcity import... | apache-2.0 |
jima80525/pyres | pavement.py | 1 | 3641 | # -*- coding: utf-8 -*-
""" File to drive paver scripts """
from __future__ import print_function
import sys
import subprocess
# Import parameters from the setup file.
sys.path.append('.')
from setup import (
print_success_message, print_failure_message,
setup_dict, _lint, _test, _test_all, _test_file)
from... | mit |
mdeejay/android_kernel_dlxu | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
moreati/django | django/db/backends/postgresql/base.py | 143 | 10451 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends.base.base import BaseDatabaseWrapper
from djan... | bsd-3-clause |
tiagofrepereira2012/tensorflow | tensorflow/contrib/rnn/python/kernel_tests/rnn_cell_test.py | 20 | 61091 | # 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 |
mjtamlyn/django | django/utils/encoding.py | 38 | 8986 | import codecs
import datetime
import locale
from decimal import Decimal
from urllib.parse import quote
from django.utils import six
from django.utils.functional import Promise
class DjangoUnicodeDecodeError(UnicodeDecodeError):
def __init__(self, obj, *args):
self.obj = obj
super().__init__(*args... | bsd-3-clause |
Laurawly/tvm-1 | tests/python/contrib/test_thrust.py | 1 | 5987 | # 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 |
ynikulin/tapp | tapp/core/data_flow/mq/rabbitmq.py | 1 | 2524 | from pika.adapters.tornado_connection import TornadoConnection
from pika import ConnectionParameters
from pika import PlainCredentials
from pika import BasicProperties
import tornado.ioloop
import tornado.web
class TornadoQueueConnection(object):
def __init__(self, host, port, virtual_host, user, password):
... | apache-2.0 |
BV-DR/foamBazar | pythonScripts/foamStarForces.py | 1 | 1326 | #!/usr/bin/env python
"""
Plot force output for foamStar post-processing output files
"""
import pandas as pd
import matplotlib.pyplot as plt
try :
from droppy.Reader import dfRead
except ImportError as e:
print("Can not load TimeSignals, please add 'droppy' (from repo https://github.com/BV-DR/droppy) to you... | gpl-3.0 |
palica/efikamx-smartbook | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
marcore/edx-platform | common/djangoapps/student/tests/test_parental_controls.py | 155 | 3850 | """Unit tests for parental controls."""
import datetime
from django.test import TestCase
from django.test.utils import override_settings
from student.models import UserProfile
from student.tests.factories import UserFactory
class ProfileParentalControlsTest(TestCase):
"""Unit tests for requires_parental_consent... | agpl-3.0 |
canaltinova/servo | tests/wpt/web-platform-tests/tools/pywebsocket/test/test_stream_hixie75.py | 496 | 2285 | #!/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 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Tools/versioncheck/pyversioncheck.py | 98 | 4051 | """pyversioncheck - Module to help with checking versions"""
import types
import rfc822
import urllib
import sys
# Verbose options
VERBOSE_SILENT=0 # Single-line reports per package
VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated
VERBOSE_EACHFILE=2 # Report on each URL chec... | mit |
dataversioncontrol/dvc | dvc/command/destroy.py | 1 | 1496 | from __future__ import unicode_literals
import argparse
import dvc.prompt as prompt
import dvc.logger as logger
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
class CmdDestroy(CmdBase):
def run_cmd(self):
try:
statement = (
"This... | apache-2.0 |
neloe/EasyZMQ-Cpp | tests/gtest-1.7.0/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | lgpl-2.1 |
WholeGrainGoats/servo | components/script/dom/bindings/codegen/parser/tests/test_duplicate_qualifiers.py | 241 | 1893 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface DuplicateQualifiers1 {
getter getter byte foo(unsigned long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... | mpl-2.0 |
CivilHub/CivilHub | articles/migrations/0004_auto_20150319_1520.py | 3 | 2272 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('articles', '0003_article_subtitle'),
]
operations = [
migrations.AddField(
model_name='article',
nam... | gpl-3.0 |
eezee-it/addons-yelizariev | project_kanban_customer/models.py | 16 | 1384 | from openerp import api, models, fields, SUPERUSER_ID
class project_project(models.Model):
_inherit = 'project.project'
partner_country_image = fields.Binary('Partner\'s country flag', related='partner_id.country_id.image')
partner_country_name = fields.Char('Partner\'s country name', related='partner_id.... | lgpl-3.0 |
valkyriesavage/gasustainability | django/template/loader.py | 149 | 8326 | # Wrapper for loading templates from storage of some sort (e.g. filesystem, database).
#
# This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use.
# Each loader is expected to have this interface:
#
# callable(name, dirs=[])
#
# name is the template name.
# dirs is an optional list of directories ... | bsd-3-clause |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/twisted/conch/avatar.py | 12 | 1438 | # -*- test-case-name: twisted.conch.test.test_conch -*-
from __future__ import absolute_import, division
from zope.interface import implementer
from twisted.conch.error import ConchError
from twisted.conch.interfaces import IConchUser
from twisted.conch.ssh.connection import OPEN_UNKNOWN_CHANNEL_TYPE
from twisted.py... | gpl-2.0 |
simalytics/askbot-devel | askbot/migrations/0112_add_model_ReplyAddress.py | 17 | 24822 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ReplyAddress'
db.create_table('askbot_replyaddress', (
('id', self.gf('django.db... | gpl-3.0 |
andersinno/suds-jurko | tests/test_document_store.py | 7 | 5052 | # -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify it under
# the terms of the (LGPL) GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distri... | lgpl-3.0 |
ahmadiga/min_edx | lms/djangoapps/django_comment_client/management/commands/assign_role.py | 251 | 1144 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django_comment_common.models import Role
from django.contrib.auth.models import User
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--remove',
ac... | agpl-3.0 |
JGarcia-Panach/odoo | openerp/addons/base/__openerp__.py | 336 | 3703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/setuptools/extension.py | 192 | 1821 | import sys
import re
import functools
import distutils.core
import distutils.errors
import distutils.extension
from .dist import _get_unpatched
from . import msvc9_support
_Extension = _get_unpatched(distutils.core.Extension)
msvc9_support.patch_for_specialized_compiler()
def have_pyrex():
"""
Return True i... | apache-2.0 |
flwh/KK_mt6589_iq451 | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/test/test_structmembers.py | 88 | 3438 | from _testcapi import _test_structmembersType, \
CHAR_MAX, CHAR_MIN, UCHAR_MAX, \
SHRT_MAX, SHRT_MIN, USHRT_MAX, \
INT_MAX, INT_MIN, UINT_MAX, \
LONG_MAX, LONG_MIN, ULONG_MAX, \
LLONG_MAX, LLONG_MIN, ULLONG_MAX
import unittest
from test import test_support
ts=_test_structmembersType(False, 1, 2, 3... | gpl-2.0 |
tensorflow/io | tensorflow_io/python/experimental/parse_avro_ops.py | 1 | 23257 | # Copyright 2020 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 |
MikeMarcin/UIforETW | LabScripts/ETWPMCDemo/etwpmc_parser.py | 2 | 8792 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
100health/RedoxBlog | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/shell.py | 287 | 15340 | # -*- coding: utf-8 -*-
"""
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu... | mit |
marclaporte/fail2ban | fail2ban/tests/clientreadertestcase.py | 2 | 21517 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | gpl-2.0 |
mlperf/training_results_v0.6 | Google/benchmarks/ssd/implementations/tpu-v3-1024-ssd/ssd/topk_mask.py | 6 | 6592 | # Copyright 2018 Google. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
RuudBurger/CouchPotatoServer | libs/guessit/transfo/guess_language.py | 94 | 1946 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 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 |
WhySoGeeky/DroidPot | venv/lib/python2.7/site-packages/sphinx/util/osutil.py | 4 | 5151 | # -*- coding: utf-8 -*-
"""
sphinx.util.osutil
~~~~~~~~~~~~~~~~~~
Operating system-related utility functions for Sphinx.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import os
import re
import sy... | mit |
NationalSecurityAgency/ghidra | Ghidra/Extensions/SleighDevTools/pcodetest/pcode_defs.py | 1 | 18035 | ## ###
# IP: GHIDRA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 |
jbuchbinder/youtube-dl | youtube_dl/extractor/kickstarter.py | 71 | 2708 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import smuggle_url
class KickStarterIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?kickstarter\.com/projects/(?P<id>[^/]*)/.*'
_TESTS = [{
'url': 'https://www.kickstarter.com/projects/14044618... | unlicense |
Venturi/cms | env/lib/python2.7/site-packages/phonenumbers/shortdata/region_SE.py | 11 | 1356 | """Auto-generated file, do not edit by hand. SE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_SE = PhoneMetadata(id='SE', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[1-37-9]\\d{2,5}', possible_number_patt... | gpl-2.0 |
gjtorikian/readthedocs.org | readthedocs/rtd_tests/tests/test_middleware.py | 3 | 2874 | from django.http import Http404
from django.core.cache import cache
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from readthedocs.core.middleware import SubdomainMiddleware
class MiddlewareTests(TestCase):
def setUp(self):
... | mit |
Alp-Phone/django-mobile-app-distribution | django_mobile_app_distribution/views.py | 2 | 4690 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import os.path
from itertools import chain
from operator import attrgetter
from os.path import basename
from wsgiref.util import FileWrapper
from future.builtins import (int, map, open)
from django.contrib.auth.decorators import login_requi... | mit |
bigoldboy/repository.bigoldboy | plugin.video.VADER/unidecode/util.py | 51 | 1790 | # vim:ts=4 sw=4 expandtab softtabstop=4
from __future__ import print_function
import optparse
import locale
import os
import sys
import warnings
from unidecode import unidecode
PY3 = sys.version_info[0] >= 3
def fatal(msg):
sys.stderr.write(msg + "\n")
sys.exit(1)
def main():
default_encoding = locale.g... | gpl-3.0 |
boundarydevices/android_external_chromium_org | chrome/tools/build/win/resedit.py | 152 | 11259 | #!/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.
"""A utility script that can extract and edit resources in a Windows binary.
For detailed help, see the script's usage by invoking... | bsd-3-clause |
ryansb/mdtocs | mdtocs/__init__.py | 1 | 7184 | #!/bin/env python2
# mdtocs/__init__.py
#
# Copyright (c) 2013, Ryan S. Brown <sb@ryansb.com>
#
# All rights reserved.
#
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 3.0 as published by the Free Software Foundation.
#
# Th... | lgpl-3.0 |
rickyzhang82/bbb-linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
goodliang/bootstrap | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
MjAbuz/fabric | fabric/job_queue.py | 23 | 7673 | """
Sliding-window-based job/task queue class (& example of use.)
May use ``multiprocessing.Process`` or ``threading.Thread`` objects as queue
items, though within Fabric itself only ``Process`` objects are used/supported.
"""
from __future__ import with_statement
import time
import Queue
from fabric.state import en... | bsd-2-clause |
Brett55/moto | moto/ec2/responses/__init__.py | 9 | 2225 | from __future__ import unicode_literals
from .account_attributes import AccountAttributes
from .amazon_dev_pay import AmazonDevPay
from .amis import AmisResponse
from .availability_zones_and_regions import AvailabilityZonesAndRegions
from .customer_gateways import CustomerGateways
from .dhcp_options import DHCPOptions... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.