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 |
|---|---|---|---|---|---|
quizlet/grpc | src/python/grpcio_tests/tests/unit/resources.py | 10 | 1267 | # Copyright 2015 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 writing... | apache-2.0 |
pedrobaeza/OpenUpgrade | addons/purchase/migrations/8.0.1.1/post-migration.py | 7 | 7140 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier, Stefan Rijnhart
# Copyright (C) 2014 Camptocamp SA
# (C) 2014 Therp BV
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... | agpl-3.0 |
waytai/django | tests/migrations/test_loader.py | 165 | 13346 | from __future__ import unicode_literals
from unittest import skipIf
from django.db import connection, connections
from django.db.migrations.exceptions import AmbiguityError, NodeNotFoundError
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.recorder import MigrationRecorder
from djang... | bsd-3-clause |
Ahmad31/Web_Flask_Cassandra | flask/lib/python2.7/site-packages/sqlalchemy/orm/base.py | 33 | 14668 | # orm/base.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Constants and rudimental functions used throughout the ORM.
"""
from .. import util... | apache-2.0 |
camallen/aggregation | experimental/condor/animal_EM.py | 2 | 7334 | #!/usr/bin/env python
__author__ = 'greghines'
import numpy as np
import os
import pymongo
import sys
import cPickle as pickle
import bisect
import csv
import matplotlib.pyplot as plt
import random
import math
import urllib
import matplotlib.cbook as cbook
def index(a, x):
'Locate the leftmost value exactly equal... | apache-2.0 |
SlimRemix/android_external_chromium_org | tools/perf/measurements/timeline_controller.py | 29 | 3494 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from measurements import smooth_gesture_util
from telemetry.core.platform import tracing_category_filter
from telemetry.core.platform import tracing_options
... | bsd-3-clause |
patilsangram/erpnext | erpnext/patches/v4_0/update_user_properties.py | 119 | 1879 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.permissions
import frappe.defaults
def execute():
frappe.reload_doc("core", "doctype", "docfield")
frappe.reload_doc("hr"... | gpl-3.0 |
zerkrx/zerkbox | lib/chardet/cli/chardetect.py | 198 | 2738 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | gpl-3.0 |
fabioz/Pydev | plugins/org.python.pydev.jython/Lib/email/mime/audio.py | 414 | 2683 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org
"""Class representing audio/* type MIME documents."""
__all__ = ['MIMEAudio']
import sndhdr
from cStringIO import StringIO
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
... | epl-1.0 |
paulmadore/Eric-IDE | 6-6.0.9/eric/Helpviewer/Bookmarks/BookmarksImporters/HtmlImporter.py | 2 | 3356 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing an importer for HTML bookmark files.
"""
from __future__ import unicode_literals
import os
from PyQt5.QtCore import QCoreApplication, QDate, Qt
from .BookmarksImporter import BookmarksImporter... | gpl-3.0 |
xHeliotrope/injustice_dropper | env/lib/python3.4/site-packages/django/contrib/sessions/backends/base.py | 99 | 11451 | 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... | mit |
sjehutch/mywebappscripts | FuzzLists/fuzz_list_generating_code/numeric_fuzz_lists.py | 4 | 1864 | import random
import sys
#Generate a random large integer
print random.randrange(0,100000000000000000000000000000)
#Generate a random large float with and without a random large decimal
print random.uniform(0.0,39873285793487643.29357)
print random.uniform(0.0,39873285793487643.2935743967439860376894768945)
#Genera... | mit |
devcline/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/test/gtest_nc_test.py | 277 | 3758 | #!/usr/bin/env python
#
# Copyright 2007, 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... | gpl-3.0 |
GheRivero/ansible | lib/ansible/modules/cloud/amazon/_ec2_vpc.py | 18 | 6016 | #!/usr/bin/python
# Copyright: Ansible Project
# 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',
'status': ['deprecated']... | gpl-3.0 |
MyRookie/SentimentAnalyse | venv/lib/python2.7/site-packages/jinja2/debug.py | 335 | 11553 | # -*- 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.
:... | mit |
wunderlins/learning | python/django/lib/python2.7/site-packages/pip/_vendor/requests/cookies.py | 177 | 17387 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import calendar
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
... | gpl-2.0 |
ChrisAntaki/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble_unittest.py | 128 | 2482 | # 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 |
KevinMidboe/statusHandler | flask/lib/python3.4/site-packages/pip/commands/uninstall.py | 798 | 2884 | from __future__ import absolute_import
import pip
from pip.wheel import WheelCache
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.basecommand import Command
from pip.exceptions import InstallationError
class UninstallCommand(Command):
"""
Uninstall packages.
pip is a... | mit |
ilya-epifanov/ansible | lib/ansible/utils/unicode.py | 88 | 11283 | # (c) 2012-2014, Toshio Kuraotmi <a.badger@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) any lat... | gpl-3.0 |
StamusNetworks/scirius | rules/migrations/0031_auto_20150103_1138.py | 1 | 1083 | # -*- coding: utf-8 -*-
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('rules', '0030_auto_20150103_1136'),
]
operations = [
migrations.AlterField(
model_name='category',
name='created_date',
... | gpl-3.0 |
peterlauri/django | tests/inspectdb/models.py | 21 | 3075 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class People(models.Model):
name = models.CharField(max_length=255)
parent = models.ForeignKey('self', models.CASCADE)
class Message(models.Model):
from_field = models.ForeignKey(People, models.CASCADE, db_co... | bsd-3-clause |
gfyoung/scipy | scipy/sparse/data.py | 7 | 12708 | """Base class for sparse matrice with a .data attribute
subclasses must provide a _with_data() method that
creates a new matrix with the same sparsity pattern
as self but with a different data array
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from .base impor... | bsd-3-clause |
hactar-is/frink | frink/base.py | 1 | 1800 | # -*- coding: utf-8 -*-
"""
frink.base
~~~~~~~~~~~~~
BaseModel class
"""
import datetime
from schematics.models import Model
from schematics.types.base import (
StringType, BooleanType, DateTimeType, IntType, UUIDType
)
from schematics.exceptions import ValidationError
# Frink
from .orm import Insta... | mit |
mne-tools/mne-tools.github.io | 0.20/_downloads/d179a09c019b9ab5cd45cfa1afebbab5/plot_dipole_orientations.py | 4 | 10814 | # -*- coding: utf-8 -*-
"""
.. _tut-dipole-orientations:
The role of dipole orientations in distributed source localization
==================================================================
When performing source localization in a distributed manner
(MNE/dSPM/sLORETA/eLORETA),
the source space is defined as a grid o... | bsd-3-clause |
afdelgado/askbot | askbot/migrations/0096_auto__del_field_repute_question.py | 17 | 30783 | # 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):
# Deleting field 'Repute.question'
db.delete_column(u'repute', 'question_id')
def backwards(self, or... | gpl-3.0 |
rbu/ansible-modules-extras | network/citrix/netscaler.py | 15 | 5051 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage Citrix NetScaler entities
(c) 2013, Nandor Sivok <nandor@gawker.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 Softwa... | gpl-3.0 |
syphar/django | django/contrib/gis/db/backends/spatialite/base.py | 59 | 3621 | import sys
from ctypes.util import find_library
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.sqlite3.base import (
Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper,
)
from django.utils import six
from .client import SpatiaL... | bsd-3-clause |
keyurpatel076/MissionPlannerGit | packages/IronPython.StdLib.2.7.4/content/Lib/encodings/mac_centeuro.py | 593 | 14358 | """ Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.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,inp... | gpl-3.0 |
double-y/django | tests/gis_tests/gdal_tests/test_geom.py | 256 | 20748 | import json
import unittest
from binascii import b2a_hex
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.utils.six.moves import range
from ..test_data import TestDataMixin
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
if... | bsd-3-clause |
wildtetris/python-social-auth | social/backends/linkedin.py | 46 | 3776 | """
LinkedIn OAuth1 and OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/linkedin.html
"""
from social.backends.oauth import BaseOAuth1, BaseOAuth2
class BaseLinkedinAuth(object):
EXTRA_DATA = [('id', 'id'),
('first-name', 'first_name', True),
('last-name... | bsd-3-clause |
franek/weboob | modules/cappedtv/backend.py | 1 | 2351 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Lord
#
# This module is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# h... | agpl-3.0 |
patricklam/signup-sheet | signup/views.py | 1 | 5682 | import re
from django.shortcuts import render
from signup.models import Slot, Signup, GroupMembership
def has_group(user):
return GroupMembership.objects.filter(watid=user).exists()
def find_group(user):
return GroupMembership.objects.filter(watid=user).first().group_id if has_group(user) else 'None'
def is_... | mit |
emonty/ansible | lib/ansible/modules/files/stat.py | 20 | 19092 | #!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# 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',
'status': ['st... | gpl-3.0 |
Noviat/odoo | addons/website_blog/__openerp__.py | 303 | 1819 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
samdoran/ansible | lib/ansible/plugins/action/ce_config.py | 89 | 4192 | #
# Copyright 2015 Peter Sprygada <psprygada@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... | gpl-3.0 |
Seinlin/codeaurora_kernel_msm | 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 |
Victordeleon/os-data-importers | eu-structural-funds/tests/processors/test_sniff_and_cast.py | 1 | 9580 | """Unit-tests for the `sniff_and_cast` processor."""
from datetime import date, datetime
from decimal import Decimal
from math import floor
from jsontableschema.types import DateType, NumberType
from pytest import fixture, mark, raises
from collections import UserList
from common.config import (
NUMBER_FORMATS,
... | mit |
eusoubrasileiro/fatiando | cookbook/grid_interpolate.py | 3 | 1845 | """
Gridding: Grid irregularly sampled data.
"""
from fatiando import gridder, utils
from fatiando.vis import mpl
# Generate random points
area = (-2, 2, -2, 2)
x, y = gridder.scatter(area, n=200, seed=0)
# And calculate 2D Gaussians on these points as sample data
def data(x, y):
return (utils.gaussian2d(x, y, -... | bsd-3-clause |
Titan-C/scikit-learn | examples/linear_model/plot_ols.py | 74 | 2047 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | bsd-3-clause |
trenttong/QEMU-TRACE | scripts/tracetool/backend/stderr.py | 94 | 1162 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Stderr built-in backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__em... | gpl-2.0 |
tkw1536/DataAnalytics | DataAnalytics/grouping.py | 1 | 1709 | import numpy as np
def group_indexes_by(data, group):
"""
groups the indexes of an array.
data: Array of which the indexes should be sorted
group: Array of functions that should return if an item belongs to a group.
"""
# create an array of groups
groups = [[] for g in group]
... | mit |
sillvan/hyperspy | doc/user_guide/conf.py | 2 | 9753 | # -*- coding: utf-8 -*-
#
# HyperSpy User Guide documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 29 15:14:48 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated f... | gpl-3.0 |
EssaAlshammri/django-by-example | online-shop/myshop/payment/signals.py | 1 | 1219 | from io import BytesIO
import weasyprint
from django.conf import settings
from django.core.mail import EmailMessage
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from paypal.standard.ipn.signals import valid_ipn_received
from paypal.standard.models import ST_PP_COMP... | mit |
magic0704/neutron | neutron/db/migration/alembic_migrations/versions/589f9237ca0e_cisco_n1kv_ml2_driver_tables.py | 15 | 4648 | # Copyright 2015 Cisco Systems, 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 |
senttech/OctoPrint | src/octoprint/server/views.py | 2 | 37190 | # coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
im... | agpl-3.0 |
comandrei/django-haystack | haystack/fields.py | 12 | 13235 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import re
from django.template import Context, loader
from django.utils import datetime_safe, six
from haystack.exceptions import SearchFieldError
from haystack.utils import get_model_ct_tuple
class NOT_PROVIDED:
... | bsd-3-clause |
exploreodoo/datStruct | odoo/addons/hr_payroll_account/hr_payroll_account.py | 240 | 10840 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | gpl-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/Crypto/SelfTest/Hash/test_SHA256.py | 116 | 3663 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/test_SHA256.py: Self-test for the SHA-256 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that... | gpl-2.0 |
Evervolv/android_external_protobuf | examples/list_people.py | 429 | 1135 | #! /usr/bin/python
# See README.txt for information and build instructions.
import addressbook_pb2
import sys
# Iterates though all people in the AddressBook and prints info about them.
def ListPeople(address_book):
for person in address_book.person:
print "Person ID:", person.id
print " Name:", person.na... | bsd-3-clause |
smac0628/android_kernel_huawei_angler | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
MichaelReiter/ProgrammingPractice | DFS.py | 1 | 1656 | #!/usr/bin/env python
def dfs_iter(graph, start, path=[]):
"""
Iterative version of depth first search.
Arguments:
graph - a dictionary of lists that is your graph and who you're connected to.
start - the node you wish to start at
path - a list of already visited nodes for a path
Returns:
path ... | mit |
konstruktoid/ansible-upstream | test/units/config/test_data.py | 61 | 1274 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests import unittest
from ansible.config.data import ConfigData
from ansible.config.manager import Setting
mykey = Setting('mykey', 'myvalue', 'test', 'string')
mykey2 = Settin... | gpl-3.0 |
ActiveState/code | recipes/Python/577083_POSIX_context_manager_temporarily_silence_or/recipe-577083.py | 1 | 3124 | #! /usr/bin/env python
"""
silence.py
Peter Waller
March 2010
"""
from __future__ import with_statement
from contextlib import contextmanager, nested
from threading import Thread
from tempfile import mkdtemp
from os.path import join as pjoin
from os import (dup, fdopen, open as osopen, O_NONBLOCK, O_RDONLY, remove,... | mit |
mashuai/Cassandra-Research | pylib/cqlshlib/test/ansi_colors.py | 192 | 6073 | # 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 |
behzadnouri/scipy | scipy/special/_mptestutils.py | 9 | 12437 | from __future__ import division, print_function, absolute_import
import sys
import time
import numpy as np
from numpy.testing import dec, assert_
from scipy._lib.six import reraise
from scipy.special._testutils import assert_func_equal
try:
import mpmath
except ImportError:
try:
import sympy.mpmath ... | bsd-3-clause |
BobBuildTool/bob | test/test_input_recipe.py | 1 | 9169 |
from unittest import TestCase
from unittest.mock import MagicMock
import os
from bob.errors import ParseError
from bob.input import Recipe
from bob.languages import ScriptLanguage
from bob.stringparser import Env
class TestDependencies(TestCase):
def cmpEntry(self, entry, name, env={}, fwd=False, use=["result",... | gpl-3.0 |
skg-net/ansible | lib/ansible/modules/network/nxos/nxos_gir.py | 30 | 12352 | #!/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 |
kurgm/gwv | gwv/validators/kosekitoki.py | 1 | 1899 | from gwv.dump import Dump
import gwv.filters as filters
from gwv.kagedata import KageData
from gwv.validators import Validator
from gwv.validators import ErrorCodes
error_codes = ErrorCodes(
NOT_ALIAS="0", # エイリアスでない(し、koseki-xxxxx0がtoki-00xxxxx0のエイリアスというわけでもない)
NOT_ALIAS_OF_KOSEKI="1", # koseki-xxxxx0のエイリア... | mit |
Wafflespeanut/servo | tests/wpt/web-platform-tests/tools/py/testing/root/test_error.py | 162 | 1111 |
import py
import errno
def test_error_classes():
for name in errno.errorcode.values():
x = getattr(py.error, name)
assert issubclass(x, py.error.Error)
assert issubclass(x, EnvironmentError)
def test_picklability_issue1():
e1 = py.error.ENOENT()
s = py.std.pickle.dumps(e1)
e2... | mpl-2.0 |
pratikmallya/hue | desktop/core/ext-py/Django-1.6.10/django/core/management/templates.py | 110 | 13207 | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
from optparse import make_option
from os import path
import django
from django.template import Template, Context
from django.utils import archive
from django.utils.six.moves.urllib.reques... | apache-2.0 |
salamer/django | tests/template_tests/syntax_tests/test_url.py | 108 | 12717 | # coding: utf-8
from django.core.urlresolvers import NoReverseMatch, resolve
from django.template import RequestContext, TemplateSyntaxError
from django.test import (
RequestFactory, SimpleTestCase, ignore_warnings, override_settings,
)
from django.utils.deprecation import RemovedInDjango110Warning
from ..utils im... | bsd-3-clause |
nikolas/lettuce | tests/integration/lib/Django-1.3/django/conf/locale/no/formats.py | 685 | 1657 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FOR... | gpl-3.0 |
amaozhao/basecms | cms/tests/navextender.py | 27 | 3475 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.models import Page
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import SettingsOverrideTestCase
from cms.test_utils.util.menu_extender import TestMenu
from django.conf import settings
from django... | mit |
pschella/scipy | scipy/linalg/__init__.py | 9 | 6404 | """
====================================
Linear algebra (:mod:`scipy.linalg`)
====================================
.. currentmodule:: scipy.linalg
Linear algebra functions.
.. seealso::
`numpy.linalg` for more linear algebra functions. Note that
although `scipy.linalg` imports most of them, identically named... | bsd-3-clause |
fearlessspider/python-social-auth | examples/pyramid_example/example/tests.py | 63 | 1499 | import unittest
import transaction
from pyramid import testing
from .models import DBSession
class TestMyViewSuccessCondition(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
from sqlalchemy import create_engine
engine = create_engine('sqlite://')
from .models i... | bsd-3-clause |
komissarex/centipede | lib/testers/base_tester.py | 1 | 5818 | from abc import ABCMeta, abstractmethod
from centipede import centipede
from shutil import rmtree
import os
import threading
import commands
import subprocess
import psutil
import time
class BaseTester(threading.Thread):
"""
Base abstract tester class, desined as thread
"""
__metaclass__ = ABCMeta
... | mit |
Sodki/ansible-modules-extras | web_infrastructure/letsencrypt.py | 16 | 31828 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version... | gpl-3.0 |
sriramsitharaman/sp17-i524 | project/S17-IR-P013/code/weather_data_analysis/src/iu/i524/S17IRP013/util/app_util.py | 20 | 1804 | import datetime as datetime
##########################################################################
def enum(**enums):
return type('Enum', (), enums)
##########################################################################
def get_year_list(start_date, end_date):
'Get list of date range with each range o... | apache-2.0 |
googleapis/python-api-common-protos | google/logging/type/http_request_pb2.py | 1 | 13178 | # -*- 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 o... | apache-2.0 |
Chilledheart/chromium | tools/auto_bisect/bisect_state.py | 58 | 3608 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
class RevisionState(object):
"""Contains bisect state for a given revision.
Properties:
depot: The depot that this revision is from (e.g. WebKit).
... | bsd-3-clause |
danmackinlay/AutoGP | experiments/sarcos.py | 2 | 3138 | import os
import subprocess
import sklearn.cluster
import numpy as np
import autogp
from autogp import likelihoods
from autogp import kernels
import tensorflow as tf
from autogp import datasets
from autogp import losses
from autogp import util
import pandas
import scipy.io as sio
DATA_DIR = "experiments/data/"
TRAIN... | apache-2.0 |
umitproject/tease-o-matic | pygments/formatters/__init__.py | 72 | 1827 | # -*- coding: utf-8 -*-
"""
pygments.formatters
~~~~~~~~~~~~~~~~~~~
Pygments formatters.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os.path
import fnmatch
from pygments.formatters._mapping import FORMATTERS
from pygments.p... | bsd-3-clause |
highweb-project/highweb-webcl-html5spec | tools/cr/cr/base/host.py | 89 | 5957 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module for build host support."""
import os
import pipes
import signal
import subprocess
import cr
# Controls what verbosity level turns on command tra... | bsd-3-clause |
orgito/ansible | lib/ansible/modules/network/avi/avi_role.py | 31 | 3395 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
KempfCreative/KempfCreative.github.io | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
pdr/django-pipeline | pipeline/templatetags/compressed.py | 11 | 4139 | try:
from staticfiles.storage import staticfiles_storage
except ImportError:
from django.contrib.staticfiles.storage import staticfiles_storage # noqa
from django import template
from django.template.loader import render_to_string
from pipeline.conf import settings
from pipeline.packager import Packager, Pack... | mit |
leekchan/django_test | django/conf/locale/pt/formats.py | 115 | 1717 | # -*- 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'j \d\e F \d\e Y'
TIME_FORMAT = '... | bsd-3-clause |
michealjroberts/stepjockey-data-retrieval | main.py | 1 | 1217 | #!/usr/bin/env python 2.7.12
#=======================================================================================================================================================#
#title :methods.py
#description :This collects KPI data from all relevant API sources
#author :Michael Roberts
#d... | gpl-3.0 |
RTsWorld/deepdive | examples/tutorial_example/step3-more-data/experiment-reports/v00003/code/udf/ext_has_spouse.py | 90 | 2326 | #! /usr/bin/env python
import csv, os, sys
# The directory of this UDF file
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
# Load the spouse dictionary for distant supervision.
# A person can have multiple spouses
spouses = set()
married_people = set()
lines = open(BASE_DIR + '/../data/spouses.tsv').readline... | apache-2.0 |
brelloch/volveR | node_modules/meanio/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 574 | 21473 | #!/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 |
prathik/thrift | tutorial/py/PythonServer.py | 26 | 2774 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
donatello/minio-py | examples/list_objects.py | 2 | 1640 | # -*- coding: utf-8 -*-
# Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, 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/licen... | apache-2.0 |
IKholopov/HackUPC2017 | hackupc/env/lib/python3.5/site-packages/django/db/models/options.py | 28 | 34250 | from __future__ import unicode_literals
import copy
import warnings
from bisect import bisect
from collections import OrderedDict, defaultdict
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core.exceptions import FieldDoesNotExist
from django.db import connection... | apache-2.0 |
geodynamics/gale | StgDomain/Mesh/Python/Mesh.py | 6 | 2137 | #!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##
## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
##
## Authors:
## Stevan M. Quen... | gpl-2.0 |
wojnilowicz/git-cola | test/cmds_test.py | 3 | 1399 | #!/usr/bin/env python
from __future__ import absolute_import, division, unicode_literals
import unittest
from cola import cmds
from cola.compat import unichr
class CmdsTestCase(unittest.TestCase):
"""Tests the cola.core module's unicode handling
"""
def test_Commit_strip_comments(self):
"""Ens... | gpl-2.0 |
fbradyirl/home-assistant | tests/components/smartthings/test_init.py | 1 | 17594 | """Tests for the SmartThings component init module."""
from uuid import uuid4
from aiohttp import ClientConnectionError, ClientResponseError
from asynctest import Mock, patch
from pysmartthings import InstalledAppStatus, OAuthToken
import pytest
from homeassistant.components import cloud, smartthings
from homeassista... | apache-2.0 |
rahuldhote/odoo | addons/mrp/report/__init__.py | 378 | 1122 | # -*- 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 |
flavour/cert | models/patient.py | 3 | 7976 | # -*- coding: utf-8 -*-
"""
Patient Tracking
@author: Fran Boon
"""
if deployment_settings.has_module("patient"):
def patient_tables():
# ---------------------------------------------------------------------
tablename = "patient_patient"
table = db.define_table(tablename,
... | mit |
flavour/cert | modules/geopy/geocoders/dot_us.py | 28 | 2098 | import getpass
import xmlrpclib
from geopy.geocoders.base import Geocoder
from geopy.point import Point
from geopy.location import Location
from geopy import util
class GeocoderDotUS(Geocoder):
def __init__(self, username=None, password=None, format_string='%s'):
super(GeocoderDotUS, self).__init__(format_... | mit |
fossoult/odoo | addons/purchase_double_validation/__init__.py | 441 | 1090 | # -*- 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 |
NL66278/OCB | addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py | 384 | 3903 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
Ashaba/rms | rmslocalenv/lib/python2.7/site-packages/django/middleware/security.py | 510 | 1753 | import re
from django.conf import settings
from django.http import HttpResponsePermanentRedirect
class SecurityMiddleware(object):
def __init__(self):
self.sts_seconds = settings.SECURE_HSTS_SECONDS
self.sts_include_subdomains = settings.SECURE_HSTS_INCLUDE_SUBDOMAINS
self.content_type_no... | mit |
jjinux/party-playlist-picker | third-party/gdata/tlslite/utils/cryptomath.py | 103 | 11654 | """cryptomath module
This module has basic math/crypto code."""
import os
import sys
import math
import base64
import binascii
if sys.version_info[:2] <= (2, 4):
from sha import sha as sha1
else:
from hashlib import sha1
from compat import *
# *******************************************************************... | apache-2.0 |
printerpam/hyde | hyde/ext/plugins/urls.py | 7 | 2399 | # -*- coding: utf-8 -*-
"""
Contains classes and utilities related to hyde urls.
"""
from hyde.plugin import Plugin
from hyde.site import Site
from functools import wraps
from fswrap import File
class UrlCleanerPlugin(Plugin):
"""
Url Cleaner plugin for hyde. Adds to hyde the ability to generate clean
u... | mit |
bunnyitvn/webptn | django/utils/timezone.py | 103 | 8344 | """Timezone helper functions.
This module uses pytz when it's available and fallbacks when it isn't.
"""
from datetime import datetime, timedelta, tzinfo
from threading import local
import time as _time
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
from django.utils impor... | bsd-3-clause |
Changaco/oh-mainline | vendor/packages/gdata/src/gdata/Crypto/Hash/HMAC.py | 226 | 3330 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
This is just a copy of the Python 2.2 HMAC module, modified to work when
used on versions of Python before 2.2.
"""
__revision__ = "$Id: HMAC.py,v 1.5 2002/07/25 17:19:02 z3p Exp $"
import strin... | agpl-3.0 |
mikejs/python-votesmart | votesmart.py | 1 | 25110 | """ Python library for interacting with Project Vote Smart API.
Project Vote Smart's API (http://www.votesmart.org/services_api.php)
provides rich biographical data, including data on votes, committee
assignments, and much more.
"""
__author__ = "James Turk (jturk@sunlightfoundation.com)"
__version__ = "0... | bsd-3-clause |
derDavidT/sympy | sympy/physics/quantum/tests/test_qexpr.py | 120 | 1457 | from sympy import Symbol, Integer
from sympy.physics.quantum.qexpr import QExpr, _qsympify_sequence
from sympy.physics.quantum.hilbert import HilbertSpace
from sympy.core.containers import Tuple
x = Symbol('x')
y = Symbol('y')
def test_qexpr_new():
q = QExpr(0)
assert q.label == (0,)
assert q.hilbert_spa... | bsd-3-clause |
josenavas/qiime | scripts/pick_de_novo_otus.py | 15 | 8993 | #!/usr/bin/env python
# File created on 27 Oct 2009.
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Kyle Bittinger"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcaporas... | gpl-2.0 |
HoboSci/OBIS-Capelin | Loop_on_date_python_script.py | 1 | 16260 | import os
import platform
import subprocess
import datetime as dt
import time
import calendar
import sys
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# General Parameters - Tools - Proxy Network - Output Directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Path declarati... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.