repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
malemburg/epcon
p3/management/commands/send_talk_verification_email.py
7
1666
# -*- coding: UTF-8 -*- from django.core.management.base import BaseCommand, CommandError from conference import models from datetime import datetime from email_template import utils class Command(BaseCommand): """ """ def handle(self, *args, **options): try: conference = args[0] ...
bsd-2-clause
gangadharkadam/saloon_erp
erpnext/buying/doctype/purchase_common/purchase_common.py
17
4225
# 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 from frappe.utils import flt, cstr, cint from frappe import _ from erpnext.stock.doctype.item.item import get_last_purchase_details from ...
agpl-3.0
rosswhitfield/mantid
Framework/PythonInterface/test/python/mantid/plots/UtilityTest.py
3
1210
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
gpl-3.0
StefanRijnhart/odoo
addons/portal_sale/res_config.py
445
1479
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
Pratik151/OWASP-ZSC
lib/encoder/php/base64.py
4
2317
#!/usr/bin/env python ''' OWASP ZSC https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project https://github.com/zscproject/OWASP-ZSC http://api.z3r0d4y.com/ https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ] ''' import binascii import random import string from core.compatible import version...
gpl-3.0
vallemrv/tpvB3
cloud/contabilidad/urls.py
1
4043
# @Author: Manuel Rodriguez <valle> # @Date: 01-Jan-2018 # @Email: valle.mrv@gmail.com # @Last modified by: valle # @Last modified time: 23-Mar-2018 # @License: Apache license vesion 2.0 from django.conf.urls import url, include from . import views app_name = "conta" GASTOS = [ url(r"^gastos/$", views.gastos...
apache-2.0
pombreda/ruffus
ruffus/test/test_softlink_uptodate.py
1
3441
#!/usr/bin/env python from __future__ import print_function """ test_softlink_uptodate.py """ import os import sys # add grandparent to search path for testing grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) sys.path.insert(0, grandparent_dir) # module name = script name w...
mit
tylercal/dragonfly
dragonfly/grammar/context.py
1
8427
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly 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 3 of the...
lgpl-3.0
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/pip/_vendor/distlib/locators.py
129
50493
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
mit
gravyboat/python-exercises
exercises/ex22.py
1
1259
#!/usr/bin/python caesar_key = {'a':'n', 'b':'o', 'c':'p', 'd':'q', 'e':'r', 'f':'s', 'g':'t', 'h':'u', 'i':'v', 'j':'w', 'k':'x', 'l':'y', 'm':'z', 'n':'a', 'o':'b', 'p':'c', 'q':'d', 'r':'e', 's':'f', 't':'g', 'u':'h', 'v':'i', 'w':'j', 'x':'k', 'y':'l', 'z':'m', 'A':'N', '...
mit
PhoenixRacing/PhoenixRacingWebApp-noregrets
application/models/forms.py
1
2205
from wtforms import Form, TextField, TextAreaField, PasswordField, validators class LogInForm(Form): email = TextField('Email',[validators.Required(), validators.Length(min=6,max=50)]) password = PasswordField('Password',[validators.Required()]) class SignUpForm(Form): first_name = TextField('First Name', [validat...
bsd-3-clause
markeTIC/server-tools
database_cleanup/model/purge_modules.py
31
5140
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2014 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
trondeau/gnuradio-old
gnuradio-runtime/examples/volk_benchmark/volk_types.py
58
5995
#!/usr/bin/env python from gnuradio import gr from gnuradio import blocks import argparse from volk_test_funcs import * ###################################################################### def float_to_char(N): op = blocks.float_to_char() tb = helper(N, op, gr.sizeof_float, gr.sizeof_char, 1, 1) return...
gpl-3.0
bpsinc-native/src_tools_gyp
test/variables/commands/gyptest-commands.py
311
1208
#!/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. """ Test variable expansion of '<!()' syntax commands. """ import os import TestGyp test = TestGyp.TestGyp(format='gypd') expect = test....
bsd-3-clause
basho/dstat-riak
dstat_riak.py
2
1315
### Author: James Martin <jmartin@basho.com> class dstat_plugin(dstat): """ Riak Stats counter Displays Riak Stats """ def __init__(self): self.name = 'riak' self.nick = ('gets', 'glat', 'puts', 'plat') self.vars = ('node_gets_total', 'node_get_fsm_time_mean', ...
apache-2.0
insomnia-lab/calibre
src/calibre/devices/kindle/apnx.py
2
9359
# -*- coding: utf-8 -*- __license__ = 'GPL v3' __copyright__ = '2011, John Schember <john at nachtimwald.com>' __docformat__ = 'restructuredtext en' ''' Generates and writes an APNX page mapping file. ''' import struct from calibre.ebooks.mobi.reader.mobi6 import MobiReader from calibre.ebooks.pdb.header import P...
gpl-3.0
msdgwzhy6/enjarify
enjarify/jvm/arraytypes.py
3
1836
# Copyright 2015 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...
apache-2.0
aroche/django
tests/forms_tests/tests/test_error_messages.py
169
11182
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import ( BooleanField, CharField, ChoiceField, DateField, DateTimeField, DecimalField, EmailField, FileField, FloatField, Form, GenericIPAddressField, IntegerField...
bsd-3-clause
openprocurement/openprocurement.api
src/openprocurement/api/subscribers.py
1
2203
# -*- coding: utf-8 -*- from pyramid.events import subscriber from pyramid.events import NewRequest, BeforeRender, ContextFound from openprocurement.api.constants import VERSION from openprocurement.api.utils import get_now, update_logging_context, fix_url @subscriber(NewRequest) def add_logging_context(event): r...
apache-2.0
rebolinho/liveit.repository
plugin.video.SportsDevil/dateutil/relativedelta.py
54
21509
# -*- coding: utf-8 -*- import datetime import calendar import operator from math import copysign from six import integer_types from warnings import warn __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"] class weekday(object): __slots__ = ["weekday", "n"] def __init__(self, weekday, n=...
gpl-2.0
gauravbose/digital-menu
digimenu2/tests/admin_inlines/models.py
99
6447
""" Testing of admin inline formsets. """ from __future__ import unicode_literals import random from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible @pyt...
bsd-3-clause
dyn888/youtube-dl
youtube_dl/extractor/safari.py
13
5303
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveLegacyIE from ..utils import ( ExtractorError, sanitized_Request, smuggle_url, std_headers, urlencode_postdata, ) class SafariBaseIE(InfoExtractor): _LOGIN...
unlicense
mtrbean/scipy
scipy/optimize/linesearch.py
61
24200
""" Functions --------- .. autosummary:: :toctree: generated/ line_search_armijo line_search_wolfe1 line_search_wolfe2 scalar_search_wolfe1 scalar_search_wolfe2 """ from __future__ import division, print_function, absolute_import from warnings import warn from scipy.optimize import minpack2 i...
bsd-3-clause
khrapovs/multidensity
multidensity/skstjr.py
1
3778
#!/usr/bin/env python # -*- coding: utf-8 -*- r""" Multivariate Skewed Student (Jondeau & Rockinger) ================================================= """ from __future__ import print_function, division import numpy as np import scipy.stats as scs from scipy.special import gamma from .multidensity import MultiDens...
mit
cstavr/synnefo
snf-cyclades-app/synnefo/db/migrations/0104_public_to_nics.py
10
20138
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo...
gpl-3.0
windedge/odoo
addons/membership/__init__.py
441
1101
# -*- 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...
agpl-3.0
bitspill/electrum-doged
gui/text.py
4
17787
import curses, datetime, locale from decimal import Decimal _ = lambda x:x #from i18n import _ from electrum_doged.util import format_satoshis, set_verbosity from electrum_doged.util import StoreDict from electrum_doged.bitcoin import is_valid from electrum_doged import Wallet, WalletStorage import tty, sys class E...
gpl-3.0
qnib/qcollect
resources/diamond/collectors/nfsd/test/testnfsd.py
29
4216
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: ...
apache-2.0
OpenFacetracker/facetracker-core
lib/youtube-dl/youtube_dl/extractor/rtlnow.py
8
6981
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, clean_html, unified_strdate, int_or_none, ) class RTLnowIE(InfoExtractor): """Information Extractor for RTL NOW, RTL2 NOW, RTL NITRO, SUPER RTL NOW, VOX NOW...
gpl-2.0
onitake/ansible
lib/ansible/modules/network/f5/bigip_gtm_global.py
5
11105
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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
tximikel/kuma
vendor/packages/nose/core.py
69
13093
"""Implements nose test program and collector. """ from __future__ import generators import logging import os import sys import time import unittest from nose.config import Config, all_config_files from nose.loader import defaultTestLoader from nose.plugins.manager import PluginManager, DefaultPluginManager, \ R...
mpl-2.0
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_virtual_network_taps_operations.py
1
29365
# 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 may ...
mit
CodyKochmann/min_resolution
PIL/FontFile.py
40
3364
# # The Python Imaging Library # $Id$ # # base class for raster font file parsers # # history: # 1997-06-05 fl created # 1997-08-19 fl restrict image width # # Copyright (c) 1997-1998 by Secret Labs AB # Copyright (c) 1997-1998 by Fredrik Lundh # # See the README file for information on usage and redistribution. # ...
mit
wdv4758h/ZipPy
lib-python/3/lib2to3/fixes/fix_itertools.py
66
1547
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) imports from itertools are fixed in fix_itertools_import.py If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method calls w...
bsd-3-clause
mfriedenhagen/Diamond
src/diamond/handler/stats_d.py
32
4472
# coding=utf-8 """ Implements the abstract Handler class, sending data to statsd. This is a UDP service, sending datagrams. They may be lost. It's OK. #### Dependencies * [python-statsd](http://pypi.python.org/pypi/python-statsd/) * [statsd](https://github.com/etsy/statsd) v0.1.1 or newer. #### Configuration En...
mit
GeyerA/android_external_chromium_org
tools/valgrind/memcheck_analyze.py
24
22617
#!/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. # memcheck_analyze.py ''' Given a valgrind XML file, parses errors and uniques them.''' import gdb_helper from collections impor...
bsd-3-clause
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/registry/tests/test_personset.py
1
24433
# Copyright 2009-2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for PersonSet.""" __metaclass__ = type from testtools.matchers import LessThan from zope.component import getUtility from zope.security.proxy import removeSecurity...
agpl-3.0
copyleftdev/pyskills
koans/about_decorating_with_classes.py
97
3599
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import functools class AboutDecoratingWithClasses(Koan): def maximum(self, a, b): if a > b: return a else: return b def test_partial_that_wrappers_no_args(self): """ Before we can...
mit
mhbu50/erpnext
erpnext/hr/doctype/employee_promotion/employee_promotion.py
2
1095
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import getdate from erpnext.hr.utils imp...
gpl-3.0
baryon5/powerschool
service/dbsettings.py
1
1116
""" Django settings for service project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
apache-2.0
Austin503/pyglet
tools/license.py
29
3729
#!/usr/bin/python # $Id:$ '''Rewrite the license header of source files. Usage: license.py file.py file.py dir/ dir/ ... ''' import optparse import os import sys license = '''# pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary ...
bsd-3-clause
ol-loginov/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/distapp/data.py
114
5247
au_cities = (('Wollongong', 150.902, -34.4245), ('Shellharbour', 150.87, -34.5789), ('Thirroul', 150.924, -34.3147), ('Mittagong', 150.449, -34.4509), ('Batemans Bay', 150.175, -35.7082), ('Canberra', 144.963, -37.8143), ('Melbourne', 145.963...
apache-2.0
kdrone/crazyflie-python-client
lib/cflib/crtp/serialdriver.py
24
1961
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
gpl-2.0
gopalkoduri/pypeaks
pypeaks/examples/howto.py
1
1126
# -*- coding: utf-8 -*- #Import necessary modules import pickle from pypeaks import Data, Intervals #Load data #We already have provided some data samples and a script in examples/ directory. #If you don't have it, you can either load your own data, or download them from #https://github.com/gopalkoduri/pypeaks da...
agpl-3.0
camptocamp/odoo
openerp/service/report.py
49
5025
# -*- coding: utf-8 -*- import base64 import logging import sys import threading import openerp import openerp.report from openerp import tools import security _logger = logging.getLogger(__name__) # TODO: set a maximum report number per user to avoid DOS attacks # # Report state: # False -> True self_reports...
agpl-3.0
gthb/xhtml2pdf
xhtml2pdf/version.py
100
1531
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
alsrgv/tensorflow
tensorflow/python/keras/optimizer_v2/nadam_test.py
8
7459
# 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
rodsol/opencog
opencog/python/utility/numeric/information_theory.py
34
1111
__author__ = 'Keyvan' from math import log def mutual_information(seq, first_variable, second_variable, epsilon=0.0001): M = float(len(seq)) n_first, n_second = {True:0, False:0}, {True:0, False:0} n_first_and_second = {(True,True):0, (True,False):0, (False,True):0, (...
agpl-3.0
minhphung171093/GreenERP_V7
openerp/addons/crm_partner_assign/__openerp__.py
48
2297
# -*- 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
Mendeley/mendeley-python-sdk
test/manual/documents/test_create_group_document.py
2
1350
from test import cassette from test.resources.documents import * def test_should_create_group_document(): session = get_user_session() delete_all_group_documents() with cassette('fixtures/resources/documents/create_group_document/create_group_document.yaml'): doc = create_group_document(session) ...
apache-2.0
JHUISI/charm
charm/schemes/protocol_schnorr91.py
3
3676
from charm.core.engine.protocol import * from charm.toolbox.ecgroup import ECGroup,G from socket import socket,AF_INET,SOCK_STREAM from charm.toolbox.eccurve import prime192v1 from charm.toolbox.enum import Enum import sys party = Enum('Verifier', 'Prover') PROVER,VERIFIER = party.Prover, party.Verifier HOST, PORT = "...
lgpl-3.0
bhargav2408/python-for-android
python-build/python-libs/gdata/tests/atom_tests/service_test.py
89
6868
#!/usr/bin/python # # Copyright (C) 2006 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
krafczyk/spack
var/spack/repos/builtin/packages/neuron/package.py
2
8649
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
heeraj123/oh-mainline
vendor/packages/Django/django/core/management/__init__.py
99
18224
import collections import os import sys from optparse import OptionParser, NO_DEFAULT import imp import warnings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.core.management.color import color_style from dj...
agpl-3.0
cyberark-bizdev/ansible
lib/ansible/modules/cloud/rackspace/rax_dns_record.py
61
11386
#!/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': ['preview'], ...
gpl-3.0
Sytten/FloatingTrain
matlab/SB-1/code_trajectoire.py
1
1155
import bpy import os import math import sys import csv base_path = "G:\\Programming\\Repositories\\University\\FloatingTrain\\matlab\\SB-1\\" aller_path = base_path + "aller.csv" retour_path = base_path + "retour.csv" initial_x = -23 initial_y = -10 initial_z = -1.0 # get the train object train = bpy.d...
mit
HaydenFaulkner/bottom-up-attention
lib/fast_rcnn/bbox_transform.py
5
2539
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import numpy as np def bbox_transform(ex_rois, gt_rois): ex_widths...
mit
schreiberx/sweet
benchmarks_plane/nonlinear_interaction/benchmarks_create.py
1
4106
#! /usr/bin/env python3 # # Create series of job to be run with sweet # # Pedro Peixoto <pedrosp@ime.usp.br> # modified from Martin Schreiber initial job_create # #------------------------------------------------------- # # Usage on CoolMUC: # Change the Script # job_benchref_COMP_plspec_pldeal_numa2_fft_gnu_thomp_...
mit
ebbypeter/enso
src/platform/win32/SConsTools/Helpers.py
9
3526
import os import types def addInstanceMethodToEnv( env, function ): """ Adds the given function as an instance method to the given SCons environment. """ envClass = env.__class__ methodName = function.__name__ # Make sure the class doesn't already have a method by the same ...
bsd-3-clause
rimbalinux/MSISDNArea
docutils/parsers/rst/roles.py
2
13537
# $Id: roles.py 6121 2009-09-10 12:05:04Z milde $ # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # Copyright: This module has been placed in the public domain. """ This module defines standard interpreted text role functions, a registry for interpreted text roles, and an API for adding to and retrieving...
bsd-3-clause
paweljasinski/ironpython3
Src/StdLib/Lib/dummy_threading.py
210
2815
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``_thread`` w...
apache-2.0
wd5/jangr
django/contrib/gis/db/backends/spatialite/operations.py
282
14391
import re from decimal import Decimal from django.contrib.gis.db.backends.base import BaseSpatialOperations from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction from django.contrib.gis.db.backends.spatialite.adapter import SpatiaLiteAdapter from django.contrib.gis.geometry.backend import G...
bsd-3-clause
calvinleenyc/zulip
analytics/migrations/0001_initial.py
40
5095
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import zerver.lib.str_utils class Migration(migrations.Migration): dependencies = [ ('zerver', '0030_realm_org_type'), migrations.swappable_dependency(setting...
apache-2.0
brad999/nikita
client/populate.py
2
5053
# -*- coding: utf-8-*- import os import re from getpass import getpass import yaml from pytz import timezone import feedparser import nikitapath def run(): profile = {} print("Welcome to the profile populator. If, at any step, you'd prefer " + "not to enter the requested information, just hit 'Ente...
mit
RubenSchmidt/giscademy
layers/serializers.py
1
1084
from rest_framework import serializers from rest_framework_gis import serializers as gis_serializers from layers.models import Point, LineString, Polygon, Layer class BaseGeofeatureSerializer(gis_serializers.GeoFeatureModelSerializer): def get_properties(self, instance, fields): return instance.propertie...
mit
foobarbazblarg/stayclean
stayclean-2017-september/update-google-chart.py
1
6491
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python import json import gspread from oauth2client.client import SignedJwtAssertionCredentials import datetime from participantCollection import ParticipantCollection # Edit Me! participantFileNames =...
mit
adamwwt/chvac
venv/lib/python2.7/site-packages/sqlalchemy/orm/relationships.py
21
111121
# orm/relationships.py # Copyright (C) 2005-2015 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 """Heuristics related to join conditions as used in :func:`.relationship`. Pro...
mit
lowitty/server
libsDarwin/twisted/web/test/test_error.py
5
15239
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ HTTP errors. """ from __future__ import division, absolute_import import re import sys import traceback from twisted.trial import unittest from twisted.python.compat import nativeString, _PY3 from twisted.web import error from twisted.web.t...
mit
skhal/gmock
gtest/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 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...
bsd-3-clause
dcoles/ivle
ivle/webapp/base/test/test_rest.py
1
12189
import urllib from nose.tools import assert_equal from ivle.webapp.base.rest import (JSONRESTView, read_operation, require_permission, write_operation) from ivle.webapp.errors import BadRequest, MethodNotAllowed, Unauthorized from ivle.webapp.testing import FakeUser, FakeRequest cl...
gpl-2.0
Cinntax/home-assistant
homeassistant/components/http/data_validator.py
3
1567
"""Decorator for view methods to help with data validation.""" from functools import wraps import logging import voluptuous as vol # mypy: allow-untyped-defs _LOGGER = logging.getLogger(__name__) class RequestDataValidator: """Decorator that will validate the incoming data. Takes in a voluptuous schema a...
apache-2.0
gsuresh92/mongo-connector
mongo_connector/doc_managers/doc_manager_base.py
33
5701
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
gladk/palabos
scons/scons-local-2.1.0/SCons/Options/BoolOption.py
21
2009
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # with...
agpl-3.0
bikestra/bdapy
incumbency.py
1
7316
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # # Incumbency in Congressional Elections (BDA 14.3) # # # This notebook page reproduces analysis done in BDA 14.3, which investigates the advantage of incumbents in congressional elections. # <codecell> % pylab inline from pandas import * # <mar...
apache-2.0
vikatory/kbengine
kbe/res/scripts/common/Lib/site-packages/setuptools/tests/doctest.py
332
99828
# Module doctest. # Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org). # Major enhancements and refactoring by: # Jim Fulton # Edward Loper # Provided as-is; use at your own risk; no warranty; no promises; enjoy! try: basestring except NameError: basestring = str try: enum...
lgpl-3.0
daenamkim/ansible
test/units/plugins/inventory/test_host.py
122
3420
# Copyright 2015 Marius Gedminas <marius@gedmin.as> # # 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...
gpl-3.0
bchareyre/trial
py/plot.py
5
34986
# encoding: utf-8 # 2008 © Václav Šmilauer <eudoxos@arcig.cz> """ Module containing utility functions for plotting inside yade. See :ysrc:`examples/simple-scene/simple-scene-plot.py` or :ysrc:`examples/concrete/uniax.py` for example of usage. """ ## all exported names __all__=['data','plots','labels','live','liveInt...
gpl-2.0
jmchilton/galaxy-central
tools/data_source/encode_import.py
1
2512
#!/usr/bin/env python2.4 """ Script that imports locally stored data as a new dataset for the user Usage: import id outputfile """ import sys, os from shutil import copyfile #tempfile, shutil BUFFER = 1048576 uids = sys.argv[1].split(",") out_file1 = sys.argv[2] #remove NONE from uids have_none = True while have_non...
mit
jhona22baz/blog-flask
python2.7/lib/python2.7/site-packages/jinja2/__init__.py
130
2270
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
mit
yrizk/django-blog
blogvenv/lib/python3.4/site-packages/django/db/backends/base/base.py
103
17962
import time import warnings from collections import deque from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import utils from django.db.backends.signals import connection_created from django.db.transaction import TransactionManagementE...
apache-2.0
makielab/django-oscar
oscar/apps/offer/admin.py
6
1169
from django.contrib import admin from django.db.models import get_model ConditionalOffer = get_model('offer', 'ConditionalOffer') Condition = get_model('offer', 'Condition') Benefit = get_model('offer', 'Benefit') Range = get_model('offer', 'Range') class ConditionAdmin(admin.ModelAdmin): list_display = ('type',...
bsd-3-clause
MobinRanjbar/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/mdbcache.py
32
6873
#!/usr/bin/env python import logging __author__ = 'rolandh' from pymongo import Connection #import cjson import time from datetime import datetime from saml2 import time_util from saml2.cache import ToOld from saml2.time_util import TIME_FORMAT logger = logging.getLogger(__name__) class Cache(object): def __i...
apache-2.0
badock/nova
nova/scheduler/filters/retry_filter.py
30
1599
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
bonitadecker77/python-for-android
python-modules/twisted/twisted/test/test_process.py
49
78614
# Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Test running processes. """ import gzip import os import sys import signal import StringIO import errno import gc import stat try: import fcntl except ImportError: fcntl = process = None else: from twisted.internet impor...
apache-2.0
Neuromancer2701/mbedROS2_STF7
mbed-os/tools/host_tests/host_registry.py
122
1214
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
mit
bant4u/django-guardian
guardian/utils.py
17
6379
""" django-guardian helper functions. Functions defined within this module should be considered as django-guardian's internal functionality. They are **not** guaranteed to be stable - which means they actual input parameters/output type may change in future releases. """ from __future__ import unicode_literals import ...
bsd-2-clause
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/django/utils/translation/__init__.py
64
3222
""" Internationalization support. """ from django.utils.encoding import force_unicode from django.utils.functional import lazy, curry __all__ = ['gettext', 'gettext_noop', 'gettext_lazy', 'ngettext', 'ngettext_lazy', 'string_concat', 'activate', 'deactivate', 'get_language', 'get_language_bidi', 'get_...
mit
40223141/2015cda_g6
static/Brython3.1.1-20150328-091302/Lib/pydoc.py
637
102017
#!/usr/bin/env python3 """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydoc <name>" to show documentation ...
gpl-3.0
3dfxsoftware/cbss-addons
hr_timesheet/__openerp__.py
32
2300
# -*- 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...
gpl-2.0
kalebhartje/schoolboost
lms/djangoapps/django_comment_client/tests.py
4
2099
import string # pylint: disable=W0402 import random from django.contrib.auth.models import User from django.test import TestCase from student.models import CourseEnrollment from django_comment_client.permissions import has_permission from django_comment_common.models import Role class PermissionsTestCase(Test...
agpl-3.0
saleemjaveds/https-github.com-openstack-nova
nova/cmd/baremetal_manage.py
13
7213
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
apache-2.0
doubleshot/server
generator/sources/python/KalturaClient/Base.py
1
12008
# =================================================================================================== # _ __ _ _ # | |/ /__ _| | |_ _ _ _ _ __ _ # | ' </ _` | | _| || | '_/ _` | # |_|\_\__,_|_|\__|\_,_|_| \__,_| ...
agpl-3.0
CapeDrew/DCMTK-ITK
Examples/Filtering/CurvatureFlowImageFilter.py
13
1643
#========================================================================== # # Copyright Insight Software Consortium # # 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...
apache-2.0
hendradarwin/VTK
Common/Transforms/Testing/Python/spherical.py
20
1912
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetR...
bsd-3-clause
talasky/tennis-score
src/setup3.py
1
8311
#!/usr/bin/python """ setup3.py Copyright 2014, Ty A. Lasky Released under the GNU General Public License 3.0 See LICENSE.txt for license information. --------------------------------------------------- Third setup dialog. Gets all remaining setup information, including players. Exported classes: Setup3 -- Thir...
gpl-3.0
40223117cda/w16cdaa
static/Brython3.1.0-20150301-090019/Lib/xml/dom/minidom.py
727
66854
"""Simple implementation of the Level 1 DOM. Namespaces and other minor Level 2 features are also supported. parse("foo.xml") parseString("<foo><bar/></foo>") Todo: ===== * convenience methods for getting elements and text. * more testing * bring some of the writer and linearizer code into conformance with this ...
gpl-3.0
40223142/cda11
static/Brython3.1.0-20150301-090019/Lib/xml/etree/ElementInclude.py
784
5146
# # ElementTree # $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $ # # limited xinclude support for element trees # # history: # 2003-08-15 fl created # 2003-11-14 fl fixed default loader # # Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # http://www.pythonware...
gpl-3.0
ofisher/UAI
UAI/Utils.py
1
1626
''' Created on 19/06/2013 @author: oliver ''' import datetime import subprocess import signal import os from numpy import * def get_millis_now(): delta = datetime.datetime.now() - datetime.datetime.utcfromtimestamp(0) return delta.total_seconds() * 1000 def loadTransformationMatrix(filename)...
gpl-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/google/protobuf/descriptor_pb2.py
7
81494
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/descriptor.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import r...
bsd-2-clause
MarcJoan/django
tests/model_formsets_regress/models.py
281
1226
from django.db import models from django.utils.encoding import python_2_unicode_compatible class User(models.Model): username = models.CharField(max_length=12, unique=True) serial = models.IntegerField() class UserSite(models.Model): user = models.ForeignKey(User, models.CASCADE, to_field="username") ...
bsd-3-clause