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 |
|---|---|---|---|---|---|
a-nai/django-wiki | wiki/plugins/images/south_migrations/0001_initial.py | 16 | 11291 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Image'
db.create_table(u'wiki_images_image', (
... | gpl-3.0 |
eduNEXT/edx-platform | common/djangoapps/entitlements/management/commands/tests/test_expire_old_entitlements.py | 4 | 1880 | """Test Entitlements models"""
from unittest import mock
from django.core.management import call_command
from django.test import TestCase
from common.djangoapps.entitlements.tests.factories import CourseEntitlementFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
@skip_unless_lms
@mock.patc... | agpl-3.0 |
andyzsf/django-cms | cms/test_utils/fixtures/menus.py | 46 | 5039 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.api import create_page
class MenusFixture(object):
def create_fixtures(self):
"""
Tree from fixture:
+ P1
| + P2
| + P3
+ P4
| + P5
+ P6 (not in menu)
... | bsd-3-clause |
edx/pyrasite | pyrasite/inspector.py | 1 | 1168 | # This file is part of pyrasite.
#
# pyrasite 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.
#
# pyrasite is distributed in the hope t... | gpl-3.0 |
dgladkov/django | django/contrib/auth/forms.py | 22 | 14665 | from __future__ import unicode_literals
from django import forms
from django.contrib.auth import (
authenticate, get_user_model, password_validation,
)
from django.contrib.auth.hashers import (
UNUSABLE_PASSWORD_PREFIX, identify_hasher,
)
from django.contrib.auth.models import User
from django.contrib.auth.tok... | bsd-3-clause |
kevclarx/ansible | lib/ansible/modules/storage/infinidat/infini_vol.py | 69 | 4675 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Gregory Shulov (gregory.shulov@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... | gpl-3.0 |
zhaodelong/django | tests/schema/models.py | 237 | 4275 | from django.apps.registry import Apps
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Because we want to test creation and deletion of these as separate things,
# these models are all inserted into a separate Apps so the main test
# runner doesn't migrate them.
new_apps = ... | bsd-3-clause |
googleapis/python-asset | google/cloud/asset_v1/types/asset_service.py | 1 | 63408 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
Comunitea/CMNT_00098_2017_JIM_addons | partner_consolidate/models/res_partner.py | 1 | 1064 | # -*- coding: utf-8 -*-
# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields
class ResPartner(models.Model):
_inherit = "res.partner"
consolidate = fields.Boolean("Consolidate", company_depend... | agpl-3.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/numpy/core/tests/test_umath.py | 12 | 80826 | from __future__ import division, absolute_import, print_function
import sys
import platform
import warnings
import itertools
from numpy.testing.utils import _gen_alignment_data
import numpy.core.umath as ncu
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_r... | gpl-3.0 |
dawnpower/nova | nova/api/openstack/compute/plugins/v3/volumes.py | 8 | 19863 | # Copyright 2011 Justin Santa Barbara
# 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 |
ccsplit/spiderfoot | modules/sfp_pgp.py | 7 | 5409 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_pgp
# Purpose: SpiderFoot plug-in for looking up received e-mails in PGP
# key servers as well as finding e-mail addresses belonging to
# your target.
#
#... | gpl-2.0 |
djhenderson/dpkt | dpkt/diameter.py | 17 | 5802 | # $Id$
"""Diameter."""
import struct
import dpkt
# Diameter Base Protocol - RFC 3588
# http://tools.ietf.org/html/rfc3588
# Request/Answer Command Codes
ABORT_SESSION = 274
ACCOUTING = 271
CAPABILITIES_EXCHANGE = 257
DEVICE_WATCHDOG = 280
DISCONNECT_PEER = 282
RE_AUTH = 258
SESSION_TERMINATION = 275
class Di... | bsd-3-clause |
jordanemedlock/psychtruths | temboo/core/Library/Foursquare/Venues/VenueLinks.py | 5 | 4267 | # -*- coding: utf-8 -*-
###############################################################################
#
# VenueLinks
# Returns URLs or identifiers from third parties that have been applied to this venue.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version ... | apache-2.0 |
kdeloach/nyc-trees | src/nyc_trees/apps/users/views/group.py | 2 | 11901 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
import json
from django.conf import settings
from django.contrib.gis.geos import Polygon
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.m... | agpl-3.0 |
huiyiqun/check_mk | tests/pylint/test_pylint_check_plugins.py | 1 | 1148 | #!/usr/bin/python
# encoding: utf-8
import os
import sys
from testlib import repo_path, cmc_path
import testlib.pylint_cmk as pylint_cmk
def test_pylint_checks(pylint_test_dir):
f = file(pylint_test_dir + "/cmk-checks.py", "w")
# Fake data structures where checks register (See cmk_base/checks.py)
f.writ... | gpl-2.0 |
popazerty/test-1 | tools/create_picon_links.py | 192 | 1273 | #
# create links for picon
# usage: create_picon_links lamedb
# run in picon directory.
# It will read the servicenames from the lamedb and create symlinks
# for the servicereference names.
import os, sys
f = open(sys.argv[1]).readlines()
f = f[f.index("services\n")+1:-3]
while len(f):
ref = [int(x, 0x10) for x ... | gpl-2.0 |
thinkle/gourmet | gourmet/plugins/import_export/mealmaster_plugin/mealmaster_importer.py | 1 | 22802 | from gourmet.importers import importer, plaintext_importer
import re, os.path, string, array
from gourmet import convert, check_encodings
from gourmet.gdebug import debug,TimeAction
#from gourmet.gglobals import gt
from gettext import gettext as _
class mmf_constants:
def __init__ (self):
self.committed = ... | gpl-2.0 |
analysiscenter/dataset | batchflow/models/tf/vgg.py | 1 | 4561 | """ Simonyan K., Zisserman A. "`Very Deep Convolutional Networks for Large-Scale Image Recognition
<https://arxiv.org/abs/1409.1556>`_"
"""
import tensorflow as tf
from . import TFModel
from .layers import conv_block
_VGG16_ARCH = [
(2, 0, 64, 1),
(2, 0, 128, 1),
(3, 0, 256, 1),
(3, 0, 512, 1),
(... | apache-2.0 |
ojii/django-shop | tests/testapp/settings.py | 1 | 4005 | # Django settings for example project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Christopher Glass', 'tribaal@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | bsd-3-clause |
cgqyh/pyalgotrade-mod | pyalgotrade/tools/quandl.py | 1 | 5711 | # PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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 ap... | apache-2.0 |
evancasey/demeter | demeter/unsup/common/image_pool.py | 1 | 1090 | import tensorflow as tf
import copy
class ImagePool:
def __init__(self, pool_size):
self.pool_size = pool_size
if self.pool_size > 0:
self.num_imgs = 0
self.images = []
def query(self, images):
if self.pool_size == 0:
return images
ret_imgs ... | mit |
joyaether/zxing | cpp/scons/scons-local-2.0.0.final.0/SCons/SConf.py | 34 | 39052 | """SCons.SConf
Autoconf-like configuration support.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 i... | apache-2.0 |
robhudson/django | django/db/backends/base/introspection.py | 370 | 7363 | from collections import namedtuple
from django.utils import six
# Structure returned by DatabaseIntrospection.get_table_list()
TableInfo = namedtuple('TableInfo', ['name', 'type'])
# Structure returned by the DB-API cursor.description interface (PEP 249)
FieldInfo = namedtuple('FieldInfo',
'name type_code displa... | bsd-3-clause |
romain-dartigues/ansible | lib/ansible/modules/cloud/vultr/vultr_firewall_group.py | 27 | 5529 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# 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 |
kouk/boto | tests/unit/cloudfront/test_connection.py | 113 | 9736 | from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.cloudfront import CloudFrontConnection
from boto.cloudfront.distribution import Distribution, DistributionConfig, DistributionSummary
from boto.cloudfront.origin import CustomOrigin
class TestCloudFrontConnection(AWSMockServiceTe... | mit |
NicholasFengTW/linux | tools/perf/scripts/python/netdev-times.py | 1544 | 15191 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
OpenPymeMx/OCB | openerp/osv/query.py | 61 | 7542 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
mvaled/sentry | src/sentry/south_migrations/0277_auto__add_commitfilechange__add_unique_commitfilechange_commit_filenam.py | 1 | 92625 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'CommitFileChange'
db.create_table(
'sentry_com... | bsd-3-clause |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/site-packages/OpenSSL/test/test_ssl.py | 6 | 30797 | # Copyright (C) Jean-Paul Calderone 2008, All rights reserved
"""
Unit tests for L{OpenSSL.SSL}.
"""
from sys import platform
from socket import socket
from os import makedirs
from os.path import join
from unittest import main
from OpenSSL.crypto import TYPE_RSA, FILETYPE_PEM, PKey, dump_privatekey, load_certificate... | gpl-2.0 |
arielzn/lammps | python/examples/plot.py | 3 | 1909 | #!/usr/bin/env python -i
# preceeding line should have path for Python on your machine
# plot.py
# Purpose: plot Temp of running LAMMPS simulation via GnuPlot in Pizza.py
# Syntax: plot.py in.lammps Nfreq Nsteps compute-ID
# in.lammps = LAMMPS input script
# Nfreq = plot data point every this many s... | gpl-2.0 |
paeschli/scons-builder | modules/axtor_check.py | 1 | 2706 | from builder.btools import RegisterCustomTest
from builder.btools import AddConfigKey
from builder.bconfig import getAutoconfPrefix
from builder.bconfig import filterOut
from builder.bconfig import Version
def CheckAxtor(ctx, write_config_h=False, add_to_compiler_env=False,
min_version=None, max_version... | gpl-2.0 |
quadrismegistus/prosodic | prosodic/dicts/fi/syllabifier/finnish_functions.py | 2 | 3416 | # coding=utf-8
# symbol to demarcate syllable boundaries; should be one character
#SYLLABLE_SEPARATOR = '.'
# consonant clusters that should be kept together, following Karlsson 1985: (4)
#CLUSTERS = set(['bl', 'br', 'dr', 'fl', 'fr', 'gl', 'gr', 'kl', 'kr', 'kv', 'pl', 'pr', 'cl', 'qv', 'schm'])
#CLUSTER_LENGTHS = s... | gpl-3.0 |
nvoron23/socialite | jython/Lib/logging/handlers.py | 92 | 38944 | # Copyright 2001-2007 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | apache-2.0 |
ztemt/Z7Max_NX505J_H129_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
SpaceKatt/CSPLN | apps/scaffolding/mac/web2py/web2py.app/Contents/Resources/lib/python2.7/numpy/f2py/setupscons.py | 45 | 4181 | #!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | gpl-3.0 |
gnowxilef/Wox | PythonHome/Lib/site-packages/setuptools/command/setopt.py | 458 | 5080 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsOptionError
import distutils
import os
from setuptools import Command
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, lo... | mit |
slava-sh/NewsBlur | apps/feed_import/tasks.py | 19 | 2194 | from celery.task import Task
from django.contrib.auth.models import User
from apps.feed_import.models import UploadedOPML, OPMLImporter, GoogleReaderImporter
from apps.reader.models import UserSubscription
from apps.rss_feeds.models import MStarredStory
from utils import log as logging
class ProcessOPML(Task):
... | mit |
JacerOmri/PokemonGo-Bot-Desktop | pywin/Lib/email/quoprimime.py | 246 | 10848 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... | mit |
sjp38/linux.doc_trans_membarrier | scripts/checkkconfigsymbols.py | 92 | 15782 | #!/usr/bin/env python2
"""Find Kconfig symbols that are referenced but not defined."""
# (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com>
# (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de>
#
# Licensed under the terms of the GNU GPL License version 2
import difflib
import os
import re
import signal
i... | gpl-2.0 |
seanwestfall/django | tests/test_client_regress/views.py | 71 | 5160 | import json
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import render_to_response
from django.template import RequestC... | bsd-3-clause |
srjoglekar246/sympy | sympy/core/__init__.py | 2 | 1308 | """Core module. Provides the basic operations needed in sympy.
"""
from sympify import sympify
from cache import cacheit
from basic import Basic, Atom, C, preorder_traversal
from singleton import S
from expr import Expr, AtomicExpr
from symbol import Symbol, Wild, Dummy, symbols, var
from numbers import Number, Float,... | bsd-3-clause |
nthuoj/NTHUOJ_web | index/admin.py | 7 | 1220 | '''
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | mit |
sassoftware/mint | mint/buildtypes.py | 1 | 14373 | #
# Copyright (c) SAS Institute 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 or agreed to in w... | apache-2.0 |
funkring/fdoo | addons/stock/procurement.py | 18 | 22205 | # -*- 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 |
shrikantgond/ecView | node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # Copyright (c) 2013 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | apache-2.0 |
dwlehman/blivet | tests/size_test.py | 2 | 17077 | #!/usr/bin/python
# pylint: disable=environment-modify
#
# tests/storage/size_tests.py
# Size test cases for the blivet module
#
# Copyright (C) 2010 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the G... | lgpl-2.1 |
sankha93/servo | tests/wpt/harness/wptrunner/webdriver_server.py | 40 | 5935 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import abc
import errno
import os
import platform
import socket
import threading
import time
import traceback
import url... | mpl-2.0 |
giorgiop/scikit-learn | examples/linear_model/plot_sgd_loss_functions.py | 73 | 1232 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... | bsd-3-clause |
pducks32/intergrala | python/sympy/sympy/physics/quantum/tests/test_cg.py | 35 | 8514 | from __future__ import division
from sympy import S, sqrt, Sum, symbols
from sympy.physics.quantum.cg import Wigner3j, Wigner6j, Wigner9j, CG, cg_simp
from sympy.functions.special.tensor_functions import KroneckerDelta
def test_cg_simp_add():
j, m1, m1p, m2, m2p = symbols('j m1 m1p m2 m2p')
# Test Varshalovic... | mit |
trungnt13/scikit-learn | sklearn/datasets/lfw.py | 38 | 19042 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
lastweek/gem5 | util/gem5img.py | 86 | 11642 | #!/usr/bin/python
#
# gem5img.py
# Script for managing a gem5 disk image.
#
from optparse import OptionParser
import os
from os import environ as env
import string
from subprocess import CalledProcessError, Popen, PIPE, STDOUT
from sys import exit, argv
# Some constants.
MaxLBACylinders = 16383
MaxLBAHeads = 16
MaxL... | bsd-3-clause |
KIOS-Research/effinet-smart-water-game | test.py | 1 | 6635 | # -*- coding: cp1253 -*-
from tkinter import *
from time import sleep
def create(w, x1, y1):
w.place(x=x1, y=y1)
def erase(w):
w.destroy()
def reset(w):
w.destroy()
start()
def exit(w):
w.destroy()
def e_q1(root, counter, step):
TL = Toplevel()
w, h = TL.winfo_screenwidth(), TL.winf... | bsd-2-clause |
kiwicopple/MyMDb | venv/Lib/site-packages/sphinx/domains/rst.py | 11 | 4254 | # -*- coding: utf-8 -*-
"""
sphinx.domains.rst
~~~~~~~~~~~~~~~~~~
The reStructuredText domain.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from sphinx import addnodes
from sphinx.domains import Domain, ObjType
from sphinx... | mit |
kenshay/ImageScripter | Script_Runner/PYTHON/Lib/_sitebuiltins.py | 137 | 3115 | """
The objects used by the site module to add custom builtins.
"""
# Those objects are almost immortal and they keep a reference to their module
# globals. Defining them in the site module would keep too many references
# alive.
# Note this means this module should also avoid keep things alive in its
# globals.
imp... | gpl-3.0 |
iberben/django-notifier | demo/demo/wsgi.py | 16 | 1413 | """
WSGI config for demo project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` set... | bsd-2-clause |
stuntman723/rap-analyzer | rap_analyzer/lib/python2.7/site-packages/django/db/backends/sqlite3/features.py | 119 | 2631 | from __future__ import unicode_literals
import sys
from django.db import utils
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDataba... | mit |
Epirex/android_external_chromium_org | components/test/data/autofill/merge/tools/reserialize_profiles_from_query.py | 162 | 1177 | #!/usr/bin/env python
# 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.
import sys
from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType
def main():
"""Serializes the output of the ... | bsd-3-clause |
indictranstech/phrerp | erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py | 18 | 4072 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_co... | agpl-3.0 |
jbedorf/tensorflow | tensorflow/contrib/data/python/ops/parsing_ops.py | 19 | 2284 | # Copyright 2018 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 |
tux-mind/platform_external_subversion | subversion/tests/cmdline/svntest/verify.py | 2 | 20280 | #
# verify.py: routines that handle comparison and display of expected
# vs. actual output
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Licensed to the Apache Softwar... | apache-2.0 |
samkuehn/box-python-sdk | test/unit/object/test_file.py | 6 | 7917 | # coding: utf-8
from __future__ import unicode_literals
import json
from mock import mock_open, patch
import pytest
from six import BytesIO
from boxsdk.config import API
from boxsdk.exception import BoxAPIException
from boxsdk.object.file import File
# pylint:disable=protected-access
# pylint:disable=redefined-outer... | apache-2.0 |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/third_party/pep8/lib2to3/lib2to3/fixes/fix_renames.py | 326 | 2218 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... | mit |
bbengfort/inigo | inigo/image.py | 1 | 7931 | # inigo.image
# Handles data dealing with images, particularly EXIF for JPEG
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sun Jun 14 22:32:17 2015 -0400
#
# Copyright (C) 2015 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: image.py [] benjamin@bengfort.com $
"""
Handles data dea... | mit |
zofuthan/edx-platform | common/djangoapps/enrollment/tests/test_data.py | 84 | 10377 | """
Test the Data Aggregation Layer for Course Enrollments.
"""
import ddt
from mock import patch
from nose.tools import raises
import unittest
from django.conf import settings
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from enr... | agpl-3.0 |
macarthur-lab/xbrowse | seqr/views/apis/locus_list_api_tests.py | 1 | 8486 | import json
import mock
from django.test import TransactionTestCase
from django.urls.base import reverse
from seqr.models import LocusList, Project
from seqr.views.apis.locus_list_api import locus_lists, locus_list_info, create_locus_list_handler, \
update_locus_list_handler, delete_locus_list_handler, add_projec... | agpl-3.0 |
bjtox/ec2ssh-manager | ec2ssh/ec2ssh.py | 1 | 11122 | import subprocess
import boto3
import sys
import configparser
from codecs import open
from os.path import expanduser
import os
import glob
import inquirer
import argparse
import libtmux
import time
class Connector:
def __init__(self, connection_name, profile):
self.hosts_folder = expanduser("~")
print(self.... | mit |
mmahut/openshift-ansible | roles/openshift_health_checker/action_plugins/openshift_health_check.py | 1 | 5501 | """
Ansible action plugin to execute health checks in OpenShift clusters.
"""
# pylint: disable=wrong-import-position,missing-docstring,invalid-name
import sys
import os
from collections import defaultdict
try:
from __main__ import display
except ImportError:
from ansible.utils.display import Display
displ... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/272_test_scope.py | 114 | 15536 | import unittest
from test.test_support import check_syntax_error, check_py3k_warnings, \
check_warnings, run_unittest
class ScopeTests(unittest.TestCase):
def testSimpleNesting(self):
def make_adder(x):
def adder(y):
return x + y
retu... | gpl-3.0 |
jakub-m/phantomcurl | phantomcurl/test/test_post_data.py | 1 | 1059 | from nose.tools import *
from phantomcurl.utils import split_post_items
def test_post_data_good():
expected_given = [
([('foo', 'bar')], ['foo=bar']),
([('foo', '')], ['foo=']),
([('foo', '=')], ['foo==']),
([('', '')], ['=']),
([('', '=')], ['==']),
([('', 'bar')]... | gpl-2.0 |
ryano144/intellij-community | python/lib/Lib/encodings/cp1256.py | 593 | 13070 | """ Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.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,in... | apache-2.0 |
2014cdbg4/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/test/pystone.py | 718 | 7379 | #! /usr/bin/python3.3
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness ha... | gpl-2.0 |
elioth010/lugama | venv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/__init__.py | 34 | 1171 | # mysql/__init__.py
# Copyright (C) 2005-2016 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
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... | gpl-2.0 |
richardkiss/pycoinnet | pycoinnet/peer/Fetcher.py | 1 | 4318 | import asyncio
import logging
import weakref
from pycoin.serialize import b2h_rev
from pycoinnet.InvItem import InvItem, ITEM_TYPE_TX, ITEM_TYPE_BLOCK, ITEM_TYPE_MERKLEBLOCK
class Fetcher:
"""
Fetching a merkleblock also fetches the transactions that follow, and
includes them in the message as the "tx" ... | mit |
scvalencia/ROBOCOL_desastres | Galileo/Python/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py | 950 | 5241 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
pwoodworth/intellij-community | python/lib/Lib/xml/dom/minicompat.py | 139 | 5287 | """Python version compatibility support for minidom."""
# This module should only be imported using "import *".
#
# The following names are defined:
#
# isinstance -- version of the isinstance() function that accepts
# tuples as the second parameter regardless of the
# Python... | apache-2.0 |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/tests/geoapp/models.py | 259 | 1546 | from django.contrib.gis.db import models
from django.contrib.gis.tests.utils import mysql, spatialite
# MySQL spatial indices can't handle NULL geometries.
null_flag = not mysql
class Country(models.Model):
name = models.CharField(max_length=30)
mpoly = models.MultiPolygonField() # SRID, by default, is 4326
... | apache-2.0 |
abantam/pmtud | nsc/scons-local-1.2.0.d20090223/SCons/Tool/packaging/tarbz2.py | 19 | 1795 | """SCons.Tool.Packaging.tarbz2
The tarbz2 SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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... | gpl-2.0 |
apocalypsebg/odoo | addons/hr_contract/__openerp__.py | 260 | 1834 | # -*- 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 |
GNOME/orca | src/orca/scripts/apps/Instantbird/chat.py | 1 | 6860 | # Orca
#
# Copyright 2010 Joanmarie Diggs.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library i... | lgpl-2.1 |
emwno/android_kernel_konaxx | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
cmvelo/ansible | lib/ansible/module_utils/junos.py | 3 | 11362 | #
# (c) 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 late... | gpl-3.0 |
cristiana214/cristianachavez214-cristianachavez | python/gdata/src/gdata/tlslite/utils/rijndael.py | 359 | 11341 | """
A pure python (slow) implementation of rijndael with a decent interface
To include -
from rijndael import rijndael
To do a key setup -
r = rijndael(key, block_size = 16)
key must be a string of length 16, 24, or 32
blocksize must be 16, 24, or 32. Default is 16
To use -
ciphertext = r.encrypt(plaintext)
plai... | apache-2.0 |
haoyunfeix/crosswalk-test-suite | apptools/apptools-linux-tests/apptools/manifest_app_version.py | 12 | 2303 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
liangazhou/django-rdp | packages/PyDev/plugins/org.python.pydev_4.4.0.201510052309/pysrc/pydev_monkey.py | 6 | 17159 | # License: EPL
import os
import sys
import traceback
try:
xrange
except:
xrange = range
#===============================================================================
# Things that are dependent on having the pydevd debugger
#===============================================================================
de... | apache-2.0 |
wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/rsa/varblock.py | 216 | 4360 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... | apache-2.0 |
dya2/python-for-android | python3-alpha/python3-src/Lib/ctypes/util.py | 46 | 8575 | import sys, os
import contextlib
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":
def _get_build_version():
"""Return the version of MSVC that was used to build Python.
For Python 2.3 and up, the version number is included in
sys.version. For earlier v... | apache-2.0 |
pvrgoku/Plugin.Video.Goku | servers/letitbit.py | 44 | 2598 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para letitbit
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... | gpl-2.0 |
wfhio/tramcar | job_board/models/site_config.py | 1 | 2504 | from __future__ import unicode_literals
from django.db import models
from django.contrib.sites.models import Site
class SiteConfig(models.Model):
expire_after = models.SmallIntegerField(default=30)
# NOTE: We set a default here, but we will override this with a more
# suitable default when we creat... | mit |
Jorge-Rodriguez/ansible | lib/ansible/modules/storage/ibm/ibm_sa_pool.py | 61 | 2956 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 IBM CORPORATION
# Author(s): Tzur Eliyahu <tzure@il.ibm.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_META... | gpl-3.0 |
l-vincent-l/APITaxi | migrations/versions/27df69f29c56_update_nullable_and_unique_on_ads.py | 2 | 3434 | """Update nullable and unique on ADS
Revision ID: 27df69f29c56
Revises: 4bf756d958a1
Create Date: 2015-04-03 11:56:19.348354
"""
# revision identifiers, used by Alembic.
revision = '27df69f29c56'
down_revision = '497dacf2e3ba'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gen... | agpl-3.0 |
dashea/pykickstart | pykickstart/commands/__init__.py | 8 | 1604 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2009, 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will b... | gpl-2.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/fixes/fix_dict.py | 326 | 3824 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | gpl-2.0 |
UpSea/thirdParty | pyqtgraph-0.9.10/examples/FillBetweenItem.py | 5 | 1487 | # -*- coding: utf-8 -*-
"""
Demonstrates use of FillBetweenItem to fill the space between two plot curves.
"""
import initExample ## Add path to library (just for examples; you do not need this)
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
win = pg.plot()
win.setWindowTitle('pyqtgr... | mit |
unindented/streamcode | client/static/jsrepl/extern/python/reloop-closured/lib/python2.7/xml/dom/__init__.py | 327 | 3998 | """W3C Document Object Model implementation for Python.
The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.
This package contains the following modules:
minidom -- A simple implementation of the Level 1 DOM with namespace
sup... | mit |
fafaman/scrapy | tests/test_http_request.py | 54 | 36749 | import cgi
import unittest
import six
from six.moves import xmlrpc_client as xmlrpclib
from six.moves.urllib.parse import urlparse
from scrapy.http import Request, FormRequest, XmlRpcRequest, Headers, HtmlResponse
from scrapy.utils.python import to_bytes, to_native_str
class RequestTest(unittest.TestCase):
req... | bsd-3-clause |
vidartf/hyperspyUI | hyperspyui/plugins/plugin.py | 3 | 4236 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 The HyperSpyUI developers
#
# This file is part of HyperSpyUI.
#
# HyperSpyUI 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 |
trishnaguha/ansible | lib/ansible/modules/cloud/ovirt/ovirt_vm_facts.py | 40 | 4928 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... | gpl-3.0 |
emceethemouth/kernel_a5ltexx | 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 |
lmazuel/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/ip_address_availability_result.py | 9 | 1289 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.