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
ironbox360/django
tests/auth_tests/test_views.py
35
44018
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import itertools import os import re from importlib import import_module from django.apps import apps from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth import REDIRECT_FIELD_NAME, S...
bsd-3-clause
edouard-lopez/ansible-modules-core
cloud/rackspace/rax_cbs.py
157
7106
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
ojengwa/oh-mainline
vendor/packages/twisted/twisted/trial/test/detests.py
98
4765
from __future__ import generators from twisted.trial import unittest from twisted.internet import defer, threads, reactor class DeferredSetUpOK(unittest.TestCase): def setUp(self): d = defer.succeed('value') d.addCallback(self._cb_setUpCalled) return d def _cb_setUpCalled(self, ignore...
agpl-3.0
okuta/chainer
tests/chainer_tests/links_tests/connection_tests/test_scale.py
9
4443
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 from chainer.testing import condition @testing.parameterize( {'learn_W': True, 'bias_term': False, 'bias_shape':...
mit
mahak/nova
nova/db/sqlalchemy/api_models.py
4
24311
# 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 # d...
apache-2.0
sfluo/mrbot
crypto/pycrypto-2.6/build/lib.macosx-10.7-intel-2.7/Crypto/Cipher/DES.py
117
4403
# -*- coding: utf-8 -*- # # Cipher/DES.py : DES # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # n...
bsd-3-clause
samstern/MSc-Project
pybrain/rl/environments/timeseries/autoRegRRL.py
1
3851
from pybrain.rl.environments.timeseries.maximizereturntask import MaximizeReturnTask from pybrain.rl.environments.timeseries.timeseries import RWEnvironment from pybrain.rl.learners.directsearch.rrl import RRL from pybrain.structure import RecurrentNetwork from pybrain.structure import LinearLayer, BiasUnit, FullConnec...
bsd-3-clause
Mixser/django
tests/urlpatterns_reverse/views.py
218
1538
from functools import partial, update_wrapper from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse_lazy from django.http import HttpResponse from django.views.generic import RedirectView def empty_view(request, *args, **kwargs): return HttpResponse('') def kw...
bsd-3-clause
2uller/LotF
App/Lib/logging/handlers.py
2
48645
# Copyright 2001-2013 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 perm...
gpl-2.0
cindyyu/kuma
vendor/packages/pygments/lexers/markup.py
72
16886
# -*- coding: utf-8 -*- """ pygments.lexers.markup ~~~~~~~~~~~~~~~~~~~~~~ Lexers for non-HTML markup languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.html import HtmlLexer, XmlLexer from pygme...
mpl-2.0
viraptor/cryptography
tests/hazmat/primitives/test_ec.py
1
11748
# 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 # distributed under the Li...
apache-2.0
Chilledheart/chromium
third_party/mojo/src/mojo/public/third_party/jinja2/runtime.py
606
19558
# -*- coding: utf-8 -*- """ jinja2.runtime ~~~~~~~~~~~~~~ Runtime helpers. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from itertools import chain from jinja2.nodes import EvalContext, _context_function_types from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \ ...
bsd-3-clause
rahuldhote/odoo
addons/hr_payroll/report/report_payslip.py
377
1982
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
kargakis/test-infra
gubernator-rh/third_party/defusedxml/common.py
55
6086
# defusedxml # # Copyright (c) 2013 by Christian Heimes <christian@python.org> # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/psf/license for licensing details. """Common constants, exceptions and helpe functions """ import sys from types import MethodType PY3 = sys.version_info[0] == 3 P...
apache-2.0
saurabh6790/OFF-RISAPP
hr/doctype/holiday_list/holiday_list.py
29
2486
# 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 webnotes from webnotes.utils import add_days, add_years, cint, getdate from webnotes.model import db_exists from webnotes.model.doc import ad...
agpl-3.0
tmshlvck/ulg
ulglinux.py
1
4555
#!/usr/bin/env python # # ULG - Universal Looking Glass # (C) 2015 CZ.NIC, z.s.p.o. # # 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 l...
gpl-3.0
virtool/virtool
tests/db/snapshots/snap_test_migrate.py
2
3307
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['test_migrate_status[uvloop-True-True-True] 1'] = [ { '_id': 'hmm', 'installed': None, 'process': None, 'r...
mit
Opus1no2/Ifbyphone-API-Module
src/Ifbyphone/api/locator.py
1
3965
from base import IfbyphoneApiBase class Locator(IfbyphoneApiBase): def add_location(self, **kwargs): """Add a store location keword arguments: usr_locator_id -- ID of store locator location_destination -- JSON encoded string | {"cmd":"XXXXX","parameter":"YY...
mit
BonexGu/Blik2D-SDK
Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined_test.py
7
69559
# 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 applica...
mit
UOWPhysSoc/Barnes-Hutt-Simulation--James-MattG-
barnesplayer.py
1
2783
''' Player for the barnes-Hutt N-body simulation created by Matt Griffiths and James Archer. Player Written by Matt Griffiths. REQUIRES VPYTHON TO RUN Avaliable for use under a GPL v3 licence. ''' #Import dependent libraries import pickle from time import sleep class player(): #Player Class containing unpacker and ...
gpl-3.0
fredkingham/blog-of-fred
django/db/backends/__init__.py
19
36624
from django.db.utils import DatabaseError try: import thread except ImportError: import dummy_thread as thread from contextlib import contextmanager from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.db.transaction import TransactionManageme...
bsd-3-clause
ASlave2Audio/Restaurant-App
mingw/bin/lib/sunaudio.py
286
1399
"""Interpret sun audio headers.""" from warnings import warnpy3k warnpy3k("the sunaudio module has been removed in Python 3.0; " "use the sunau module instead", stacklevel=2) del warnpy3k MAGIC = '.snd' class error(Exception): pass def get_long_be(s): """Convert a 4-char value to integer.""" r...
mit
Tatsh-ansible/ansible
lib/ansible/modules/network/iosxr/iosxr_system.py
50
8452
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
F1ashhimself/robotframework-selenium2library
src/Selenium2Library/utils/__init__.py
65
3683
import os from fnmatch import fnmatch from browsercache import BrowserCache __all__ = [ "get_child_packages_in", "get_module_names_under", "import_modules_under", "escape_xpath_value", "BrowserCache" ] # Public def get_child_packages_in(root_dir, include_root_package_name=True, exclusions=None): ...
apache-2.0
40123237/w17test
static/Brython3.1.0-20150301-090019/Lib/xml/dom/pulldom.py
850
11761
import xml.sax import xml.sax.handler START_ELEMENT = "START_ELEMENT" END_ELEMENT = "END_ELEMENT" COMMENT = "COMMENT" START_DOCUMENT = "START_DOCUMENT" END_DOCUMENT = "END_DOCUMENT" PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION" IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE" CHARACTERS = "CHARACTERS" class PullDOM(...
gpl-3.0
standaloneSA/ncclient
ncclient/operations/util.py
11
2454
# Copyright 2009 Shikhar Bhushan # # 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
t794104/ansible
lib/ansible/modules/network/fortios/fortios_extender_controller_extender.py
24
18088
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
anjan-srivastava/tornado
tornado/test/simple_httpclient_test.py
57
27142
from __future__ import absolute_import, division, print_function, with_statement import collections from contextlib import closing import errno import gzip import logging import os import re import socket import ssl import sys from tornado import gen from tornado.httpclient import AsyncHTTPClient from tornado.httputi...
apache-2.0
invisiblek/python-for-android
python3-alpha/python3-src/Lib/distutils/version.py
145
12479
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
apache-2.0
elmerdpadilla/iv
addons/l10n_fr_hr_payroll/__openerp__.py
374
2165
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
vganapath/rally
tests/unit/plugins/openstack/scenarios/murano/test_environments.py
1
6220
# Copyright 2015: Mirantis 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 b...
apache-2.0
mofarrell/osquery
tools/profile.py
28
13309
#!/usr/bin/env python # Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from...
bsd-3-clause
10fish/shadowsocks
shadowsocks/crypto/__init__.py
26
1111
#!/usr/bin/env python # Copyright (c) 2014 clowwindy # # 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, me...
mit
Spindletop16/namebench
nb_third_party/dns/rdtypes/ANY/__init__.py
243
1191
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
avaidyam/Binoculars
bin/plps/scripts/prepare_ligands.py
1
6755
import sys,os keywords = ['PLPS_path', 'PDB2PQR_path', 'APBS_path', 'XLOGP3_path', 'ligand_file', 'BABEL_path',\ 'n_conf', 'OMEGA_path'] def read_input(input_file): file = open(input_file, 'r') lig_file = [] for line in file: key = line.split()[0] if(key == keywords[0]): ...
mit
mafiya69/sympy
sympy/solvers/tests/test_constantsimp.py
112
9317
""" If the arbitrary constant class from issue 4435 is ever implemented, this should serve as a set of test cases. """ from sympy import (acos, cos, cosh, Eq, exp, Function, I, Integral, log, Pow, S, sin, sinh, sqrt, Symbol) from sympy.solvers.ode import constant_renumber, constantsimp from sympy.ut...
bsd-3-clause
koala-team/Chillin-PyServer
chillin_server/helpers/parser.py
1
2511
# -*- coding: utf-8 -*- # python imports import sys import os import imp import inspect from enum import Enum # project imports from . import messages PY3 = sys.version_info > (3,) class Parser: def __init__(self, ks_command_files): self._message_factory = MessageFactory(ks_command_files) def en...
agpl-3.0
USGSDenverPychron/pychron
pychron/hardware/linear_axis.py
1
2527
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
apache-2.0
WeichenXu123/spark
python/pyspark/conf.py
20
7601
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
ankurankan/scikit-learn
examples/ensemble/plot_gradient_boosting_oob.py
21
4761
""" ====================================== Gradient Boosting Out-of-Bag estimates ====================================== Out-of-bag (OOB) estimates can be a useful heuristic to estimate the "optimal" number of boosting iterations. OOB estimates are almost identical to cross-validation estimates but they can be compute...
bsd-3-clause
afronski/playground-notes
introduction-to-big-data-with-apache-spark/lab-0/lab0_student.py
8
5711
# coding: utf-8 # #![Spark Logo](http://spark-mooc.github.io/web-assets/images/ta_Spark-logo-small.png) + ![Python Logo](http://spark-mooc.github.io/web-assets/images/python-logo-master-v3-TM-flattened_small.png) # # **First Notebook: Virtual machine test and assignment submission** # #### This notebook will test tha...
mit
chris-chris/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/chain_impl.py
51
5160
# 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 applica...
apache-2.0
pgleeson/TestArea
lib/jython/Lib/test/test_tarfile.py
9
26406
import sys import os import shutil import tempfile import StringIO import unittest import tarfile from test import test_support # Check for our compression modules. try: import gzip gzip.GzipFile except (ImportError, AttributeError): gzip = None try: import bz2 except ImportError: bz2 = None def...
gpl-2.0
Anonymouslemming/ansible
lib/ansible/plugins/terminal/nxos.py
52
1912
# # (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 # (at your option) any later version. # # Ansible is d...
gpl-3.0
tejal29/pants
src/python/pants/backend/jvm/tasks/eclipse_gen.py
1
6935
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import pkg...
apache-2.0
rhndg/openedx
lms/djangoapps/courseware/tests/test_password_history.py
128
13071
""" This file will test through the LMS some of the PasswordHistory features """ import json from mock import patch from uuid import uuid4 from nose.plugins.attrib import attr from django.contrib.auth.models import User from django.utils import timezone from datetime import timedelta from django.test.utils import over...
agpl-3.0
ros-controls/ros_control
controller_manager_tests/test/multi_cm_dummy.py
3
3515
#!/usr/bin/env python # Copyright (C) 2014, PAL Robotics S.L. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
bsd-3-clause
cdondrup/strands_qsr_lib
qsr_prob_rep/src/qsrrep_lib/rep_hmm.py
4
5263
# -*- coding: utf-8 -*- #from rep_abstractclass import RepAbstractclass from rep_io import ServiceManager from rep_io_hmm import HMMRepRequestCreate, HMMRepRequestSample, HMMRepRequestLogLikelihood from rep_io_hmm import HMMReqResponseCreate, HMMReqResponseSample, HMMReqResponseLogLikelihood from qsrrep_hmms.qtcc_hmm ...
mit
evaschalde/odoo
addons/mail/wizard/invite.py
268
5847
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
ccarouge/cwsl-ctools
indices/nino34.py
4
1823
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Description: Calculate the Niño 3.4 index from an input netCDF. Requires program CDO (Climate Data Operators) Authors: Tim Bedin Tim.Bedin@csiro.au Copyright: 2014 CSIRO Licensed under the Apache License, Version 2.0 (the "License"); you may not...
apache-2.0
shepdelacreme/ansible
lib/ansible/modules/storage/purestorage/purefa_snap.py
32
6610
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley (simon@purestorage.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.1',...
gpl-3.0
sloot14/flexifod
simplejson/scanner.py
674
2560
"""JSON token scanner """ import re def _import_c_make_scanner(): try: from simplejson._speedups import make_scanner return make_scanner except ImportError: return None c_make_scanner = _import_c_make_scanner() __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))...
mit
usakhelo/FreeCAD
src/Mod/OpenSCAD/ply/yacc.py
9
128492
# ----------------------------------------------------------------------------- # ply: yacc.py # # Copyright (C) 2001-2011, # David M. Beazley (Dabeaz LLC) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
lgpl-2.1
disqus/django-old
django/contrib/sitemaps/tests/basic.py
1
8058
import os from datetime import date from django.conf import settings from django.contrib.auth.models import User from django.contrib.sitemaps import Sitemap, GenericSitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.u...
bsd-3-clause
iansf/engine
build/util/version.py
114
5040
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ version.py -- Chromium version string substitution utility. """ import argparse import os import sys def fetch_values_from_file(...
bsd-3-clause
supergentle/migueltutorial
flask/lib/python2.7/site-packages/pip/_vendor/requests/models.py
217
25372
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import logging import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import...
bsd-3-clause
detiber/ansible
lib/ansible/modules/system/openwrt_init.py
58
6912
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Andrew Gaffney <andrew@agaffney.org> # # 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 L...
gpl-3.0
MarcJoan/django
django/conf/project_template/project_name/settings.py
92
3218
""" Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.c...
bsd-3-clause
BhallaLab/moose
moose-examples/tutorials/Rdesigneur/ex7.5_bidirectional_transport.py
2
1294
######################################################################## # This example illustrates molecular transport of an oscillatory reaction # system, along a closed-end cylinder. Here all the molecules are #, transported, a left to right and b and s right to left. ###############################################...
gpl-3.0
mryanlam/f5-ansible
scripts/plugin_formatter.py
1
17953
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others # # 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 So...
gpl-3.0
sodafree/backend
django/conf/locale/sl/formats.py
257
1834
# -*- 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' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_...
bsd-3-clause
felix-dumit/yowsup-tutorial
yowsup/layers/protocol_ib/protocolentities/clean_iq.py
70
1297
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from yowsup.layers.protocol_iq.protocolentities import IqProtocolEntity class CleanIqProtocolEntity(IqProtocolEntity): ''' <iq id="" type="set" to="self.domain" xmlns="urn:xmpp:whatsapp:dirty"> <clean type="{{dirty_type}}"></clean> </iq> ...
mit
mmardini/django
tests/signing/tests.py
36
4807
from __future__ import unicode_literals import time from django.core import signing from django.test import TestCase from django.utils.encoding import force_str from django.utils import six class TestSigner(TestCase): def test_signature(self): "signature() method should generate a signature" si...
bsd-3-clause
ResearchSoftwareInstitute/MyHPOM
hs_core/tests/api/native/test_utils.py
2
4061
from django.contrib.auth.models import Group from django.contrib.sites.models import Site from django.test import TestCase from mezzanine.conf import settings from hs_core.hydroshare import utils from hs_core.models import GenericResource, BaseResource from hs_core import hydroshare from hs_core.testing import MockIR...
bsd-3-clause
jkonecny12/anaconda
pyanaconda/modules/common/structures/iscsi.py
6
4801
# # DBus structures for iSCSI. # # Copyright (C) 2019 Red Hat, Inc. All rights reserved. # # 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 License, or # (at your option...
gpl-2.0
farrajota/dbcollection
dbcollection/core/api/process.py
2
6154
""" Process API class. """ from __future__ import print_function import os from dbcollection.core.manager import CacheManager from .metadata import MetadataConstructor def process(name, task='default', verbose=True): """Process a dataset's metadata and stores it to file. The data is stored a a HSF5 file ...
mit
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/gsutil/gslib/boto_translation.py
3
73541
# -*- coding: utf-8 -*- # Copyright 2013 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 require...
apache-2.0
rwillmer/django
tests/model_fields/test_durationfield.py
296
2724
import datetime import json from django import forms from django.core import exceptions, serializers from django.db import models from django.test import SimpleTestCase, TestCase from .models import DurationModel, NullDurationModel class TestSaveLoad(TestCase): def test_simple_roundtrip(self): duration...
bsd-3-clause
pgmillon/ansible
lib/ansible/modules/system/runit.py
43
8633
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, 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
dcclogin/TextGenerator
TitleCrawler/ccf_conference/categories/network/conext2014.py
1
3281
# -*- coding: utf-8 -*- import re import copy import random import os, sys import MySQLdb import requests from time import sleep from threading import Thread from bs4 import BeautifulSoup reload(sys) sys.setdefaultencoding('utf-8') clade = 'http://dblp.uni-trier.de/db/conf/conext/' months = { 'January': '01', ...
mit
255BITS/HyperGAN
hypergan/tk_viewer.py
1
5690
""" Opens a window that displays an image. Usage: from viewer import GlobalViewer GlobalViewer.update(image) """ import numpy as np import os import contextlib class TkViewer: def __init__(self, title="HyperGAN", viewer_size=1, enabled=True): self.screen = None self.title = title ...
mit
mandeepdhami/nova
nova/tests/unit/fake_ldap.py
66
9265
# 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 except in compliance with the License. You may obtain # a ...
apache-2.0
brbsix/subnuker
setup.py
1
1543
# -*- coding: utf-8 -*- from setuptools import setup from subnuker import __program__ from subnuker import __version__ def read(filename): with open(filename) as f: return f.read() setup( name=__program__, version=__version__, author='Brian Beffa', author_email='brbsix@gmail.com', d...
gpl-3.0
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_descrtut.py
51
12049
# This contains most of the executable examples from Guido's descr # tutorial, once at # # http://www.python.org/2.2/descrintro.html # # A few examples left implicit in the writeup were fleshed out, a few were # skipped due to lack of interest (e.g., faking super() by hand isn't # of much interest anymore), and a f...
apache-2.0
philotas/enigma2
lib/python/Plugins/SystemPlugins/SoftwareManager/ImageBackup.py
5
17614
################################################################################# # FULL BACKUP UYILITY FOR ENIGMA2, SUPPORTS THE MODELS OE-A 2.0 # # # # MAKES A FULLBACK-UP READY FOR FLASHING. # # # ##########################...
gpl-2.0
spelteam/spel
src/python/h36m.py
1
4373
#! /usr/bin/env python2.7 import glob from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import argparse import numpy as np import matplotlib.image as mpimg from matplotlib.lines import Line2D from pylab import figure, show import math import os #os.putenv("CDF_LIB", '/usr/local/cdf') from spacepy...
gpl-3.0
mrkipling/maraschino
lib/sqlalchemy/ext/declarative.py
14
62372
# ext/declarative.py # Copyright (C) 2005-2011 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 """ Synopsis ======== SQLAlchemy object-relational configuration involves the comb...
mit
DLR-SC/DataFinder
src/datafinder/persistence/adapters/filesystem/util.py
1
10939
# pylint: disable=E1101,E0611,F0401 # E1101: Pylint cannot resolve specific win32 modules. # E0611: "shell" exists in win32com but Pylint cannot detect it. # F0401: "win32com.shell" exists but Pylint cannot import. # # $Filename$ # $Authors$ # Last Changed: $Date$ $Committer$ $Revision-Id$ # # Copyright (c) 2...
bsd-3-clause
ntymtsiv/CloudFerry
cloud/cloud_ferry.py
11
1457
# Copyright (c) 2014 Mirantis 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 writing, so...
apache-2.0
vfulco/PyPDF2
Sample_Code/basic_features.py
7
1523
from PyPDF2 import PdfFileWriter, PdfFileReader output = PdfFileWriter() input1 = PdfFileReader(open("document1.pdf", "rb")) # print how many pages input1 has: print "document1.pdf has %d pages." % input1.getNumPages() # add page 1 from input1 to output document, unchanged output.addPage(input1.getPage(0)) # add pa...
bsd-3-clause
bsmrstu-warriors/Moytri--The-Drone-Aider
Lib/distutils/cygwinccompiler.py
132
17270
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
gpl-3.0
punalpatel/st2
st2common/tests/unit/test_db_liveaction.py
6
6203
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
muzena/deluge
deluge/plugins/Feeder/deluge/plugins/feeder/core.py
8
16082
# # core.py # # Copyright (C) 2008-2009 Fredrik Eriksson <feeder@winterbird.org> # Copyright (C) 2009 David Mohr <david@mcbf.net> # # Basic plugin template created by: # Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com> # Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # ...
gpl-3.0
40223244/cdb-2
static/Brython3.1.1-20150328-091302/Lib/configparser.py
692
50025
"""Configuration file parser. A configuration file consists of sections, lead by a "[section]" header, and followed by "name: value" entries, with continuations and such in the style of RFC 822. Intrinsic defaults can be specified by passing them into the ConfigParser constructor as a dictionary. class: ConfigParse...
gpl-3.0
praekelt/django-socialregistration
socialregistration/models.py
1
2100
from django.db import models from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.sites.models import Site class FacebookProfile(models.Model): user = models.ForeignKey(User) site = models.ForeignKey(Site, default=Site.objects.get_current) uid = mod...
mit
flx2015/ns-3-dev-git
src/bridge/bindings/modulegen__gcc_ILP32.py
30
182442
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
chrys87/fenrir
src/fenrirscreenreader/commands/commands/set_bookmark_1.py
1
1527
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug class command(): def __init__(self): self.ID = '1' def initialize(self, environment): self.env = environment self.env['commandBuffer']...
lgpl-3.0
tsabi/Odoo-tsabi-fixes
addons/analytic/report/analytic_balance.py
23
7061
# -*- 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
krishauser/Klampt
Python/klampt/vis/visualization.py
1
170432
"""Klamp't visualization routines. See `vistemplate.py in Klampt-examples <https://github.com/krishauser/Klampt-examples/Python/demos/vistemplate.py>`_ for an example of how to run this module. OVERVIEW -------- The visualization module lets you draw most Klamp't objects in a 3D world using a simple interface. It ...
bsd-3-clause
Thraxis/pymedusa
lib/sqlalchemy/ext/horizontal_shard.py
55
4814
# ext/horizontal_shard.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 """Horizontal sharding support. Defines a rudimental 'horizontal sharding' ...
gpl-3.0
gx1997/chrome-loongson
third_party/mesa/MesaLib/src/mapi/glapi/gen/typeexpr.py
35
6463
#!/usr/bin/env python # (C) Copyright IBM Corporation 2005 # 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 # on the...
bsd-3-clause
bigswitch/tempest
tempest/api/compute/flavors/test_flavors_negative.py
44
1490
# Copyright 2013 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 requ...
apache-2.0
ericzundel/pants
src/python/pants/backend/codegen/tasks/jaxb_gen.py
4
3467
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import re ...
apache-2.0
haddocking/pdb-tools
pdbtools/pdb_uniqname.py
2
3668
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020 João Pedro Rodrigues # # 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
tanglei528/nova
plugins/xenserver/networking/etc/xensource/scripts/vif_rules.py
113
4858
#!/usr/bin/env python # Copyright 2010-2011 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/LIC...
apache-2.0
rex-xxx/mt6572_x201
external/webkit/Tools/Scripts/webkitpy/tool/steps/promptforbugortitle.py
147
2253
# Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
gpl-2.0
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/generating_a_b_sqrt2_improved.py
1
1541
import sys import random import math from generating_a_b_sqrt2 import generate_first_k_a_b_sqrt2 as golden from generating_a_b_sqrt2 import ABSqrt2 # @include def generate_first_k_a_b_sqrt2(k): # Will store the first k numbers of the form a + b sqrt(2). result = [ABSqrt2(0, 0)] i = j = 0 for _ in rang...
gpl-3.0
vicky2135/lucious
oscar/lib/python2.7/site-packages/unidecode/x003.py
246
3875
data = ( '', # 0x00 '', # 0x01 '', # 0x02 '', # 0x03 '', # 0x04 '', # 0x05 '', # 0x06 '', # 0x07 '', # 0x08 '', # 0x09 '', # 0x0a '', # 0x0b '', # 0x0c '', # 0x0d '', # 0x0e '', # 0x0f '', # 0x10 '', # 0x11 '', # 0x12 '', # 0x13 '', # 0x14 '', # 0x15 '',...
bsd-3-clause
varunagrawal/azure-services
varunagrawal/site-packages/django/forms/extras/widgets.py
88
5164
""" Extra HTML Widget classes """ import datetime import re from django.forms.widgets import Widget, Select from django.utils import datetime_safe from django.utils.dates import MONTHS from django.utils.safestring import mark_safe from django.utils.formats import get_format from django.conf import settings __all__ =...
gpl-2.0
ellio167/lammps
tools/python/pizza/cfg.py
11
6036
# Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html # Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories # # Copyright (2005) Sandia Corporation. Under the terms of Contract # DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains # certain rights in this software. This software is...
gpl-2.0