repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
NicoVarg99/daf-recipes
ckan/ckan/ckanext-dcatapit/ckanext/dcatapit/helpers.py
1
5235
import logging import ckan.lib.helpers as h import ckan.plugins.toolkit as toolkit import ckanext.dcatapit.schema as dcatapit_schema import ckanext.dcatapit.interfaces as interfaces import datetime from webhelpers.html import escape, HTML, literal, url_escape log = logging.getLogger(__file__) dateformats = [ "...
gpl-3.0
Weihonghao/ECM
Vpy34/lib/python3.5/site-packages/tensorflow/contrib/ndlstm/python/lstm1d.py
8
6601
# Copyright 2016 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 applicable ...
agpl-3.0
liberation/django-elasticsearch
django_elasticsearch/views.py
6
2335
from django.http import Http404 from django.views.generic import View from django.views.generic.list import BaseListView from django.views.generic.detail import BaseDetailView from elasticsearch import NotFoundError try: from elasticsearch import ConnectionError except ImportError: from urllib3.connection impo...
mit
nielsbuwen/ilastik
ilastik/applets/counting/countingGuiBoxesInterface.py
4
42739
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
gpl-3.0
bunnyitvn/webptn
tests/regressiontests/admin_validation/models.py
192
1332
""" Tests of ModelAdmin validation logic. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharField(max_length=150) @python_2_unicode_compatible class Song(models.Model): title = models.CharField(max_length=150) al...
bsd-3-clause
ajweiss/bitcoin
qa/rpc-tests/script_test.py
94
9499
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # ''' Test notes: This test uses the script_valid and script_invalid tests from the unittest framework to do end-to-end testing where we compare that two...
mit
inspirehep/invenio-upgrader
invenio_upgrader/upgrades/invenio_2013_03_18_aidPERSONIDDATA_last_updated.py
5
1696
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
amyshi188/osf.io
api_tests/wikis/views/test_wiki_content.py
13
3821
from nose.tools import * # flake8: noqa from api.base.settings.defaults import API_BASE from tests.base import ApiWikiTestCase from tests.factories import ProjectFactory, RegistrationFactory class TestWikiContentView(ApiWikiTestCase): def _set_up_public_project_with_wiki_page(self): self.public_projec...
apache-2.0
fluxer/spm
nuitka/nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/tlib.py
7
1831
"""SCons.Tool.tlib XXX """ # # Copyright (c) 2001 - 2014 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the righ...
gpl-2.0
19kestier/taiga-back
taiga/hooks/github/event_hooks.py
2
6439
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
mikrosimage/rez
src/rez/config.py
1
28061
from rez import __version__ from rez.util import deep_update from rez.utils.data_utils import AttrDictWrapper, RO_AttrDictWrapper, \ convert_dicts, cached_property, cached_class_property, LazyAttributeMeta from rez.utils.formatting import expandvars, expanduser from rez.utils.logging_ import get_debug_printer from ...
lgpl-3.0
wkrzemien/DIRAC
tests/Integration/Resources/Catalog/FIXME_Test_CatalogPlugin.py
4
18169
#! /usr/bin/env python # FIXME: it has to be seen if this is any useful # FIXME: to bring back to life from __future__ import print_function from DIRAC.Core.Base.Script import parseCommandLine parseCommandLine() from DIRAC.Resources.Catalog.FileCatalog import FileCatalog fro...
gpl-3.0
MattFaus/CrowdTube-Connector
lib/gdata-2.0.18/src/gdata/Crypto/PublicKey/DSA.py
228
6674
# # DSA.py : Digital Signature Algorithm # # Part of the Python Cryptography Toolkit # # Distribute and use freely; there are no restrictions on further # dissemination and usage except those imposed by the laws of your # country of residence. This software is provided "as is" without # warranty of fitness for use...
mit
master-g/vogenerator
google/protobuf/internal/type_checkers.py
76
14229
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
mit
saurabh6790/ON-RISAPP
clinical/report/referral_payment_info/referral_payment_info.py
2
1452
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes import _, msgprint def execute(filters=None): if not filters: filters = {} columns = get_columns() data = get_entries(filters) ...
agpl-3.0
KaiSzuttor/espresso
testsuite/scripts/tutorials/test_04-lattice_boltzmann_part3_solution.py
2
1097
# Copyright (C) 2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 versio...
gpl-3.0
Elastica/kombu
kombu/transport/mongodb.py
1
13600
""" kombu.transport.mongodb ======================= MongoDB transport. :copyright: (c) 2010 - 2013 by Flavio Percoco Premoli. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, unicode_literals import datetime import pymongo from pymongo import errors from pymongo import Mongo...
bsd-3-clause
jotes/boto
tests/integration/awslambda/test_awslambda.py
99
1668
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
supernova2468/gae-smart-relay
lib/flask/module.py
850
1363
# -*- coding: utf-8 -*- """ flask.module ~~~~~~~~~~~~ Implements a class that represents module blueprints. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from .blueprints import Blueprint def blueprint_is_module(bp): """Used to figure ou...
mit
nubark/odoo
addons/hr_gamification/models/gamification.py
45
3976
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv class hr_gamification_badge_user(osv.Model): """User having received a badge""" _name = 'gamification.badge.user' _inherit = ['gamification.badge.user'] _columns = ...
gpl-3.0
abhiii5459/sympy
sympy/solvers/diophantine.py
38
83608
from __future__ import print_function, division from sympy import (Add, ceiling, divisors, factor_list, factorint, floor, igcd, ilcm, Integer, integer_nthroot, isprime, Matrix, Mul, nextprime, perfect_power, Poly, S, sign, solve, sqrt, Subs, Symbol, symbols, sympify, Wild) from sympy.core.function import ...
bsd-3-clause
patsissons/Flexget
flexget/plugins/operate/proxy.py
23
1525
from __future__ import unicode_literals, division, absolute_import import logging import os from flexget import plugin from flexget import validator from flexget.event import event log = logging.getLogger('proxy') PROTOCOLS = ['http', 'https', 'ftp'] class Proxy(object): """Adds a proxy to the requests session...
mit
jfpla/odoo
addons/l10n_in_hr_payroll/__openerp__.py
374
2622
# -*- encoding: 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 G...
agpl-3.0
pepetreshere/odoo
odoo/addons/base/tests/test_ir_http.py
13
5140
# -*- coding: utf-8 -*- from odoo.tests import common import odoo GIF = b"R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=" class test_ir_http_mimetype(common.TransactionCase): def test_ir_http_mimetype_attachment(self): """ Test mimetype for attachment """ attachment = self.env['ir.attachment'...
agpl-3.0
ChenJunor/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/sitemaps/kml.py
121
2480
from django.core import urlresolvers from django.contrib.sitemaps import Sitemap from django.contrib.gis.db.models.fields import GeometryField from django.db import models class KMLSitemap(Sitemap): """ A minimal hook to produce KML sitemaps. """ geo_format = 'kml' def __init__(self, locations=Non...
apache-2.0
GeoMop/GeoMop
src/gm_base/geomop_dialogs/error_dialog.py
1
1339
"""GeoMop's dialogs shared between different contexts. Dialogs have a standard appearance across contexts. .. codeauthor:: Pavel Richter <pavel.richter@tul.cz> """ import PyQt5.QtWidgets as QtWidgets class GMErrorDialog(QtWidgets.QMessageBox): """Error dialog for GeoMop graphic applications""" def __init__(...
gpl-3.0
lattwood/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/find_files_unittest.py
124
2677
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
PatKayongo/patkayongo.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/other.py
363
3811
# -*- coding: utf-8 -*- """ pygments.formatters.other ~~~~~~~~~~~~~~~~~~~~~~~~~ Other formatters: NullFormatter, RawTokenFormatter. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments...
mit
theheros/kbengine
kbe/src/lib/python/Lib/smtplib.py
45
35108
#! /usr/bin/env python3 '''SMTP/ESMTP client class. This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP Authentication) and RFC 2487 (Secure SMTP over TLS). Notes: Please remember, when doing ESMTP, that the names of the SMTP service extensions are NOT the same thing as the option keywords for the R...
lgpl-3.0
Ingenico-ePayments/connect-sdk-python3
ingenico/connect/sdk/domain/services/definitions/swift.py
2
5472
# -*- coding: utf-8 -*- # # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # from ingenico.connect.sdk.data_object import DataObject class Swift(DataObject): __bic = None __category = None __chips_uid = None __extra_info = None...
mit
brev/nupic
scripts/profiling/profile_opf_memory.py
35
2076
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
kjw0106/boto
tests/unit/provider/test_provider.py
79
17271
#!/usr/bin/env python from datetime import datetime, timedelta from tests.compat import mock, unittest import os from boto import provider from boto.compat import expanduser INSTANCE_CONFIG = { 'allowall': { u'AccessKeyId': u'iam_access_key', u'Code': u'Success', u'Expiration': u'2012-09...
mit
malikabhi05/mraa
examples/python/i2c_rgb.py
7
1465
#!/usr/bin/env python # Author: Brendan Le Foll <brendan.le.foll@intel.com> # Copyright (c) 2014 Intel Corporation. # # 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, inc...
mit
BillMills/AutoQC
qctests/Argo_pressure_increasing_test.py
4
1494
""" Implements the pressure increasing check used in the Argo quality control system. See Argo quality control manual (based on version 2.5), http://w3.jcommops.org/FTPRoot/Argo/Doc/argo-quality-control-manual.pdf page 8. """ import numpy from util import obs_utils def test(p, parameters): """ Runs the q...
mit
RRCKI/panda-jedi
pandajedi/jedicore/JediFileSpec.py
1
8285
""" file specification for JEDI """ import re import types from taskbuffer.FileSpec import FileSpec as JobFileSpec class JediFileSpec(object): # attributes _attributes = ('jediTaskID','datasetID','fileID','creationDate','lastAttemptTime', 'lfn','GUID','type','status','fsize','checksum','...
apache-2.0
dgasmith/psi4
psi4/driver/qcdb/testing.py
3
9109
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2019 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
saimn/astropy
astropy/io/tests/test_registry.py
4
19681
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from copy import copy from io import StringIO from collections import Counter import pytest import numpy as np from astropy.io.registry import _readers, _writers, _identifiers from astropy.io import registry as io_registry from astropy.table i...
bsd-3-clause
saukrIppl/seahub
thirdpart/Django-1.8.10-py2.7.egg/django/core/serializers/__init__.py
121
8167
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_queryset) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
apache-2.0
happy6666/stockStrategies
fenhong/dumpData.py
1
1052
import sys import time import urllib2 from bs4 import BeautifulSoup def parseData(url): req=urllib2.urlopen(url) data=req.read() soup=BeautifulSoup(data,from_encoding='utf-8') target=soup.find(id='sharebonus_1') if target is None: return None tds=target.find('tbody').find_all('td') result=[] tmp=[] for i,td...
apache-2.0
przemo27/mid712-kernel
tools/perf/scripts/python/syscall-counts.py
944
1429
# system call counts # (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 import sys sys.path.append(os.envir...
gpl-2.0
pravsripad/mne-python
examples/visualization/plot_topo_compare_conditions.py
20
1828
""" ================================================= Compare evoked responses for different conditions ================================================= In this example, an Epochs object for visual and auditory responses is created. Both conditions are then accessed by their respective names to create a sensor layout...
bsd-3-clause
mat650/metagoofil
parser.py
24
2957
import string import re class parser: def __init__(self,results,word,file): self.results=results self.word=word self.temp=[] self.file=file def genericClean(self): self.results = re.sub('<em>', '', self.results) self.results = re.sub('<b>', '', self.results) self.results = re.sub('</b>', '', self.re...
gpl-2.0
pipermerriam/flex
tests/validation/response/test_response_header_validation.py
1
2229
import pytest from flex.exceptions import ValidationError from flex.validation.response import ( validate_response, ) from flex.error_messages import MESSAGES from flex.constants import ( INTEGER, NUMBER, BOOLEAN, STRING, ) from tests.factories import ( SchemaFactory, ResponseFactory, ) fr...
mit
SINGROUP/pycp2k
pycp2k/classes/_pair_potential4.py
1
1669
from pycp2k.inputsection import InputSection from ._print_dftd4 import _print_dftd4 class _pair_potential4(InputSection): def __init__(self): InputSection.__init__(self) self.R_cutoff = None self.Type = None self.Parameter_file_name = None self.Reference_functional = None ...
lgpl-3.0
GlobalFishingWatch/vessel-scoring
vessel_scoring/base_model.py
1
1158
import vessel_scoring.add_measures import six class BaseModel(object): # def train_on_messages(self, messages): # messages = AddMeasures(messages, self.windows) # y_train = utils.is_fishy(train_data) # model.fit(train_data, y_train) # return model def predict_messages(s...
apache-2.0
kkdd/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/adodbapi/tests/dbapi20.py
17
31576
#!/usr/bin/env python ''' Python DB API 2.0 driver compliance unit test suite. This software is Public Domain and may be used without restrictions. "Now we have booze and barflies entering the discussion, plus rumours of DBAs on drugs... and I won't tell you what flashes through my mind each time I read...
apache-2.0
mszewczy/odoo
addons/sale_journal/sale_journal.py
276
4290
# -*- 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
bgshih/tf_resnet_cifar
src/main_train.py
1
6069
from __future__ import division import sys import os import time import math import ipdb from datetime import datetime import numpy as np import tensorflow as tf from tensorflow.python import control_flow_ops import joblib import model_resnet as m import model_utils as mu FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFI...
mit
traviswp/pybluez
examples/simple/rfcomm-client.py
19
1195
# file: rfcomm-client.py # auth: Albert Huang <albert@csail.mit.edu> # desc: simple demonstration of a client application that uses RFCOMM sockets # intended for use with rfcomm-server # # $Id: rfcomm-client.py 424 2006-08-24 03:35:54Z albert $ from bluetooth import * import sys if sys.version < '3': input ...
gpl-2.0
Ban3/Limnoria
plugins/Later/config.py
4
3141
### # Copyright (c) 2005, Jeremiah Fincher # 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 conditi...
bsd-3-clause
Memeo/samba-unovero
python/samba/provision/__init__.py
21
92446
# Unix SMB/CIFS implementation. # backend code for provisioning a Samba4 server # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2012 # Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008-2009 # Copyright (C) Oliver Liebel <oliver@itc.li> 2008-2009 # # Based on the original in EJS: # Copyright (C) Andrew Tr...
gpl-3.0
gaddman/ansible
lib/ansible/modules/system/systemd.py
20
20067
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Brian Coca <bcoca@ansible.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_METADATA = {'metadata_version': '1...
gpl-3.0
djeo94/CouchPotatoServer
libs/apscheduler/jobstores/mongodb_store.py
132
2903
""" Stores jobs in a MongoDB database. """ import logging from apscheduler.jobstores.base import JobStore from apscheduler.job import Job try: import cPickle as pickle except ImportError: # pragma: nocover import pickle try: from bson.binary import Binary from pymongo.connection import Connection ex...
gpl-3.0
TridevGuha/django
django/template/engine.py
199
10778
import warnings from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import Context, Template f...
bsd-3-clause
oliviertilmans/ipmininet
ipmininet/router/config/__init__.py
1
1205
"""This module holds the configuration generators for daemons that can be used in a router.""" from .base import BasicRouterConfig, RouterConfig, NodeConfig from .zebra import Zebra from .staticd import STATIC, StaticRoute from .ospf import OSPF, OSPFArea from .ospf6 import OSPF6 from .bgp import BGP, AS, iBGPFullMesh,...
gpl-2.0
F-Secure/watchdog
docs/source/conf.py
2
8621
# -*- coding: utf-8 -*- # # watchdog documentation build configuration file, created by # sphinx-quickstart on Tue Nov 30 00:43:58 2010. # # 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 file. # # Al...
apache-2.0
mshafiq9/django
tests/template_tests/syntax_tests/test_numpy.py
353
1429
import warnings from unittest import skipIf from django.test import SimpleTestCase from ..utils import setup try: import numpy except ImportError: numpy = False @skipIf(numpy is False, "Numpy must be installed to run these tests.") class NumpyTests(SimpleTestCase): # Ignore numpy deprecation warnings (...
bsd-3-clause
prymatex/SublimeCodeIntel
libs/langinfo_doc.py
8
9198
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozilla.org/MPL/ # # Softwa...
gpl-2.0
snasoft/QtCreatorPluginsPack
Bin/3rdParty/vera/bin/lib/bsddb/test/test_join.py
111
3168
"""TestCases for using the DB.join and DBCursor.join_item methods. """ import os import unittest from test_all import db, dbshelve, test_support, verbose, \ get_new_environment_path, get_new_database_path #---------------------------------------------------------------------- ProductIndex = [ ('apple',...
lgpl-3.0
wenhuizhang/neutron
neutron/extensions/netmtu.py
30
1398
# Copyright 2015 Openstack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
nriley/LBOfficeMRU
Recent Word Documents.lbaction/Contents/Scripts/mruuserdata.py
1
1986
from collections import OrderedDict from urlparse import urlsplit import os, sqlite3 __all__ = ('items_for_app',) SQL = """select url.value URL, ts.value Timestamp from HKEY_CURRENT_USER_values url join HKEY_CURRENT_USER_values ts using (node_id) join HKEY_CURRENT_USER_values filename using (node_id) join HKEY_CURREN...
apache-2.0
recall704/django-r3call-blog
blogproject/thirdparty/south/introspection_plugins/django_audit_log.py
154
1436
""" South introspection rules for django-audit-log """ from django.contrib.auth.models import User from django.conf import settings from south.modelsinspector import add...
apache-2.0
noirbizarre/django-eztables
eztables/tests.py
5
25759
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import random from django import forms from django.core.urlresolvers import reverse from django.test import TestCase from django.utils import unittest from django.utils.six import iteritems from django.utils.six.moves import xrange from facto...
lgpl-3.0
beeftornado/sentry
tests/apidocs/endpoints/projects/test-dsyms.py
1
1673
# -*- coding: utf-8 -*- from __future__ import absolute_import import zipfile from six import BytesIO from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from django.test.client import RequestFactory from tests.apidocs.util import APIDocsTestCase class Projec...
bsd-3-clause
tangfeixiong/nova
tools/xenserver/destroy_cached_images.py
59
1897
""" destroy_cached_images.py This script is used to clean up Glance images that are cached in the SR. By default, this script will only cleanup unused cached images. Options: --dry_run - Don't actually destroy the VDIs --all_cached - Destroy all cached images instead of just unused cached ...
apache-2.0
flimberger/textcom
textcom/map.py
1
4643
# Copyright (c) 2015 TachyonNZ # Copyright (c) 2015 Florian Limberger <flo@snakeoilproductions.net> # # 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 ...
mit
pierreg/tensorflow
tensorflow/python/framework/errors_test.py
19
3496
# 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
pixelogik/NearPy
nearpy/distances/__init__.py
8
1372
# -*- coding: utf-8 -*- # Copyright (c) 2013 Ole Krause-Sparmann # 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,...
mit
dpetzold/django
tests/db_typecasts/tests.py
134
2490
# Unit tests for typecast functions in django.db.backends.util import datetime import unittest from django.db.backends import utils as typecasts from django.utils import six TEST_CASES = { 'typecast_date': ( ('', None), (None, None), ('2005-08-11', datetime.date(2005, 8, 11)), ('1...
bsd-3-clause
qhw0820/blog
DMPs/dmp_discrete.py
4
5988
''' Copyright (C) 2013 Travis DeWolf This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope t...
gpl-3.0
daspots/dasapp
lib/unidecode/x055.py
252
4599
data = ( 'You ', # 0x00 'Yan ', # 0x01 'Gu ', # 0x02 'Gu ', # 0x03 'Bai ', # 0x04 'Han ', # 0x05 'Suo ', # 0x06 'Chun ', # 0x07 'Yi ', # 0x08 'Ai ', # 0x09 'Jia ', # 0x0a 'Tu ', # 0x0b 'Xian ', # 0x0c 'Huan ', # 0x0d 'Li ', # 0x0e 'Xi ', # 0x0f 'Tang ', # 0x10 'Zuo ', ...
mit
sodafree/backend
build/lib.linux-i686-2.7/django/views/decorators/csrf.py
88
2855
import warnings from django.middleware.csrf import CsrfViewMiddleware, get_token from django.utils.decorators import decorator_from_middleware, available_attrs from functools import wraps csrf_protect = decorator_from_middleware(CsrfViewMiddleware) csrf_protect.__name__ = "csrf_protect" csrf_protect.__doc__ = """ Thi...
bsd-3-clause
elainenaomi/sciwonc-dataflow-examples
dissertation2017/Experiment 1B/instances/9_1_workflow_full_10files_secondary_nocons_nosh_nors_noannot_with_proj_3s/mediancpu_0/MedianCPU_0.py
58
1084
#!/usr/bin/env python # It will connect to DataStoreClient from sciwonc.dataflow.DataStoreClient import DataStoreClient import ConfigDB_MedianCPU_0 # connector and config client = DataStoreClient("mongodb", ConfigDB_MedianCPU_0) data = client.getData() output = [] if(data): #docs = [] n = 0 # processi...
gpl-3.0
uofis/namcap
Namcap/tests/package/test_hicoloricons.py
4
3290
# -*- coding: utf-8 -*- # # namcap tests - hicoloricons # Copyright (C) 2011 Rémy Oudompheng <remy@archlinux.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the...
gpl-2.0
brunolimawd/talk-nodebots-roll-out
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py
1825
17014
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
campenberger/boto
tests/integration/ec2/vpc/test_connection.py
114
8619
#!/usr/bin/env python # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without ...
mit
zcoinofficial/zcoin
contrib/devtools/github-merge.py
46
10860
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # This script will locally construct a merge commit for a pull request on a # github repository, inspect it, s...
mit
cmouse/buildbot
master/buildbot/reporters/pushjet.py
5
3627
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
unindented/streamcode
client/static/jsrepl/extern/python/reloop-closured/lib/python2.7/encodings/iso2022_jp_2004.py
816
1073
# # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class I...
mit
DavidLP/home-assistant
homeassistant/components/vlc/media_player.py
7
4924
"""Provide functionality to interact with vlc devices on the network.""" import logging import voluptuous as vol from homeassistant.components.media_player import ( MediaPlayerDevice, PLATFORM_SCHEMA) from homeassistant.components.media_player.const import ( MEDIA_TYPE_MUSIC, SUPPORT_PAUSE, SUPPORT_PLAY, ...
apache-2.0
SOKP/external_chromium_org
chrome/app/PRESUBMIT.py
80
1770
# 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. """Presubmit script for changes affecting chrome/app/ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the...
bsd-3-clause
richardcornish/richlearnspythonthehardway
exercises/ex27.py
2
1514
# Exercise 27 # https://learnpythonthehardway.org/book/ex27.html import random print "Truth Table quiz!" print "Answer t for True and f for False" print "Press any key to begin" raw_input() questions = [ {'q': 'not False', 'a': 't'}, {'q': 'not True', 'a': 'f'}, {'q': 'True or False', 'a': 't'}, {'q...
bsd-3-clause
darkrho/scrapy-scrapy
scrapy/utils/sitemap.py
23
1518
""" Module for processing Sitemaps. Note: The main purpose of this module is to provide support for the SitemapSpider, its API is subject to change without notice. """ import lxml.etree from six.moves.urllib.parse import urljoin class Sitemap(object): """Class to parse Sitemap (type=urlset) and Sitemap Index ...
bsd-3-clause
CallaJun/hackprince
indico/PIL/ImtImagePlugin.py
52
2222
# # The Python Imaging Library. # $Id$ # # IM Tools support for PIL # # history: # 1996-05-27 fl Created (read 8-bit images only) # 2001-02-17 fl Use 're' instead of 'regex' (Python 2.1) (0.2) # # Copyright (c) Secret Labs AB 1997-2001. # Copyright (c) Fredrik Lundh 1996-2001. # # See the README file for informatio...
lgpl-3.0
stuarteberg/numpy
numpy/distutils/command/build_clib.py
152
12217
""" Modified version of build_clib that handles fortran source files. """ from __future__ import division, absolute_import, print_function import os from glob import glob import shutil from distutils.command.build_clib import build_clib as old_build_clib from distutils.errors import DistutilsSetupError, DistutilsError...
bsd-3-clause
palisadoes/switchmap-ng
switchmap/cli/cli.py
2
14010
#!/usr/bin/env python3 """switchmap CLI classes. Manages basic CLI parsing. """ # Main python libraries import textwrap import sys import argparse from inspect import ismethod # Do switchmap-ng imports from switchmap.cli import show, start, test, stop, restart class CLI(object): """Class that manages the CLI....
apache-2.0
ipanova/pulp_puppet
pulp_puppet_plugins/test/unit/plugins/importer/downloaders/test_factory.py
3
1818
# -*- coding: utf-8 -*- # # Copyright © 2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
gpl-2.0
daineseh/kodi-plugin.video.ted-talks-chinese
youtube_dl/extractor/lecture2go.py
87
2402
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, determine_protocol, parse_duration, int_or_none, ) class Lecture2GoIE(InfoExtractor): _VALID_URL = r'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(...
gpl-2.0
mjvakili/supermean
code/matrix.py
1
1525
import sampler import profile import matplotlib.pyplot as plt from matplotlib.colors import LogNorm M , H = 25 , 3 y = profile.makeGaussian(H*M, H*M/6. ,0.1, (H*M/2.+0.83*H, H*M/2.+1.45*H)) hx, hy, hf = sampler.test_imatrix_new(M, H, -1.45, -0.83) qw = hx.dot(y).dot(hy) qq = y.flatten().dot(hf).reshape(M,M) plt.su...
mit
phdfbk/phdfbk.github.io
bin/create_alumni.py
1
1828
#!/usr/bin/python # -*- coding: utf-8 -*- import weakref import unicodecsv import requests import cgi from cStringIO import StringIO #from builtins import str, unicode, open url_alumni ="https://docs.google.com/spreadsheets/d/1UJ8eHwcBsdKRjwc6uu2KVhNIn_FSEpLMh6xqMNQ5sUY/pub?gid=2103651667&single=true&output=csv" r = re...
apache-2.0
web30s/odoo-9.0c-20160402
hello/templates/openerp/addons/sale/sale_analytic.py
11
5149
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import api, fields, models, _ from openerp.exceptions import UserError class SaleOrderLine(models.Model): _inherit = "sale.order.line" @api.multi def _compute_analytic(self, domain=None): ...
gpl-3.0
kuri65536/python-for-android
python-modules/twisted/twisted/python/usage.py
61
20710
# -*- test-case-name: twisted.test.test_usage -*- # Copyright (c) 2001-2007 Twisted Matrix Laboratories. # See LICENSE for details. """ twisted.python.usage is a module for parsing/handling the command line of your program. For information on how to use it, see U{http://twistedmatrix.com/projects/core/documentation/...
apache-2.0
andresgz/portal
djangocali-portal/users/migrations/0004_auto_20151111_1529.py
3
1541
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('users', '0003_auto_20150928_1431'), ] operations = [ migrations.AddField( model_name='user', name='b...
bsd-3-clause
rocopartners/django-oscar
src/oscar/apps/dashboard/promotions/views.py
22
12196
import itertools from django.views import generic from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from django.conf import settings from django.contrib import messages from django.http import HttpResponseRedi...
bsd-3-clause
keisuke-umezawa/chainer
tests/chainer_tests/links_tests/connection_tests/test_n_step_gru.py
3
13106
import unittest import numpy import chainer from chainer.backends import cuda from chainer import gradient_check from chainer import links from chainer import testing from chainer.testing import attr def sigmoid(x): return numpy.tanh(x * 0.5) * 0.5 + 0.5 @testing.parameterize(*testing.product({ 'hidden_no...
mit
akosyakov/intellij-community
python/lib/Lib/site-packages/django/conf/locale/it/formats.py
232
1838
# -*- 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 = 'd F Y' # 25 Ottobre 2006 TIME_FORMAT = 'H:i:s' # 14:30:59 DATETIME_FORMAT...
apache-2.0
hgl888/chromium-crosswalk
native_client_sdk/src/build_tools/tests/parse_dsc_test.py
20
2484
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import datetime import os import posixpath import subprocess import sys import unittest SCRIPT_DIR = os.path.dirname(o...
bsd-3-clause
cryptickp/heat
heat/api/cfn/v1/__init__.py
7
2979
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
IronLanguages/ironpython2
Tests/Tools/cpy_tests.py
2
2070
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ''' Utility script used to determine which CPython tests IronPython can run correctly. USAGE: ipy cmodule....
apache-2.0
cyberark-bizdev/ansible
lib/ansible/modules/network/vyos/vyos_logging.py
38
7851
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0