repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
shownomercy/django
tests/gis_tests/relatedapp/tests.py
199
15937
from __future__ import unicode_literals from django.contrib.gis.db.models import F, Collect, Count, Extent, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point from django.db import connection from django.test import TestCase, ignore_warnin...
bsd-3-clause
txemi/ansible
lib/ansible/module_utils/f5_utils.py
45
10364
# # Copyright 2016 F5 Networks 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. # # An...
gpl-3.0
seppi91/CouchPotatoServer
CouchPotato.py
14
4660
#!/usr/bin/env python from __future__ import print_function from logging import handlers from os.path import dirname import logging import os import select import signal import socket import subprocess import sys import traceback # Root path base_path = dirname(os.path.abspath(__file__)) # Insert local directories in...
gpl-3.0
40223219/w16b_test
static/Brython3.1.1-20150328-091302/Lib/codecs.py
739
35436
""" codecs -- Python Codec Registry, API and helpers. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import builtins, sys ### Registry and builtin stateless codec functions try: from _codecs import * except ImportError as why: raise SystemErro...
agpl-3.0
nightjean/Deep-Learning
tensorflow/contrib/framework/python/ops/__init__.py
43
1321
# 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
tximikel/kuma
vendor/packages/logilab/common/test/unittest_graph.py
14
3196
# unit tests for the cache module # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Les...
mpl-2.0
blyap/my2
app/models.py
1
13818
from datetime import datetime import hashlib from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from markdown import markdown import bleach from flask import current_app, request, url_for from flask.ext.login import UserMixin,...
mit
megraf/asuswrt-merlin
release/src/router/samba36/lib/subunit/python/iso8601/test_iso8601.py
92
3044
import iso8601 def test_iso8601_regex(): assert iso8601.ISO8601_REGEX.match("2006-10-11T00:14:33Z") def test_timezone_regex(): assert iso8601.TIMEZONE_REGEX.match("+01:00") assert iso8601.TIMEZONE_REGEX.match("+00:00") assert iso8601.TIMEZONE_REGEX.match("+01:20") assert iso8601.TIMEZONE_REGEX.mat...
gpl-2.0
TimothyBest/Django_Boilerplate
mysite/pipeline_jinja2/jinja2/ext.py
3
3066
from __future__ import unicode_literals from jinja2 import nodes, TemplateSyntaxError from jinja2.ext import Extension from django.contrib.staticfiles.storage import staticfiles_storage from pipeline.packager import PackageNotFound from pipeline.utils import guess_type from pipeline.templatetags.pipeline import Pipe...
mit
837468220/python-for-android
python3-alpha/python3-src/Lib/reprlib.py
923
5110
"""Redo the builtin repr() (representation) but with limits on most sizes.""" __all__ = ["Repr", "repr", "recursive_repr"] import builtins from itertools import islice try: from _thread import get_ident except ImportError: from _dummy_thread import get_ident def recursive_repr(fillvalue='...'): 'Decorato...
apache-2.0
a-doumoulakis/tensorflow
tensorflow/python/training/queue_runner_test.py
56
14970
# 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
alexzoo/python
selenium_tests/env/lib/python3.6/site-packages/pip/commands/download.py
340
7810
from __future__ import absolute_import import logging import os from pip.exceptions import CommandError from pip.index import FormatControl from pip.req import RequirementSet from pip.basecommand import RequirementCommand from pip import cmdoptions from pip.utils import ensure_dir, normalize_path from pip.utils.build...
apache-2.0
ZENGXH/scikit-learn
examples/calibration/plot_compare_calibration.py
241
5008
""" ======================================== Comparison of Calibration of Classifiers ======================================== Well calibrated classifiers are probabilistic classifiers for which the output of the predict_proba method can be directly interpreted as a confidence level. For instance a well calibrated (bi...
bsd-3-clause
hellais/luigi
luigi/db_task_history.py
2
8669
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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
juztas/fdtcp
legacy/apmonexample.py
2
2118
from __future__ import print_function # example for testing / setting up ApMon MonALISA monitoring import apmon import time import random # read destination hosts from file #apm = apmon.ApMon("http://monalisa2.cern.ch/~catac/apmon/destinations.conf"); # set the destinations as a tuple of strings apm = apmon.ApMon(("...
apache-2.0
denizs/torchUp
torchup/agents/DoubleDQN.py
1
6576
import torch import torch.optim as optim import torch.nn as nn from torchup.agents.DQN import DQNAgent from torchup.utils.utils import Transition from torchup.base.models import Variable class DoubleDQNAgent(DQNAgent): ''' The DoubleDQNAgent is an implemenation of the Deep Reinforcement Agent outlined in ...
bsd-2-clause
40123148/w17b
static/Brython3.1.3-20150514-095342/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...
agpl-3.0
jkshaver/virtualenv-1.8.2
env/lib/python2.7/site-packages/django/utils/translation/trans_null.py
97
1983
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_unicode from django...
mit
maxive/erp
odoo/addons/test_inherit/models.py
40
3890
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api # We create a new model class mother(models.Model): _name = 'test.inherit.mother' name = fields.Char(default='Foo') state = fields.Selection([('a', 'A'), ('b', 'B')], de...
agpl-3.0
KrzysztofStachanczyk/Sensors-WWW-website
www/env/lib/python2.7/site-packages/django/db/backends/postgresql/schema.py
33
6005
import psycopg2 from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_alter_column_type = "ALTER COLUMN %(column)s TYPE %(type)s USING %(column)s::%(type)s" sql_create_sequence = "CREATE SEQUENCE %(sequence)s" sql_delete_sequence =...
gpl-3.0
otsaloma/gaupol
gaupol/attrdict.py
1
2782
# -*- coding: utf-8 -*- # Copyright (C) 2006 Osmo Salomaa # # 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 pr...
gpl-3.0
dabrahams/offlineimap
offlineimap/accounts.py
4
18479
# Copyright (C) 2003-2011 John Goerzen & contributors # # 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) any later version. # # ...
gpl-2.0
jclc/discus-inferno
flaskenv/lib/python2.7/site-packages/setuptools/depends.py
410
6221
from __future__ import generators import sys, imp, marshal from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN from distutils.version import StrictVersion, LooseVersion __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Require: """A prerequisite to building o...
mit
RachitKansal/scikit-learn
sklearn/decomposition/pca.py
192
23117
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # Michael Eickenberg <michael.eickenberg@inria.fr> # # Lice...
bsd-3-clause
timsavage/odin
odin/resources.py
1
18168
# -*- coding: utf-8 -*- import copy import six from odin import exceptions, registration from odin.exceptions import ValidationError from odin.fields import NOT_PROVIDED from odin.utils import cached_property, field_iter_items DEFAULT_TYPE_FIELD = '$' META_OPTION_NAMES = ( 'name', 'namespace', 'name_space', 'verb...
bsd-3-clause
mattcaldwell/boto
boto/sqs/message.py
10
9184
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
swistaq/aoc2016
src/day10.py
1
2065
from __future__ import print_function import re # id low high # {botno : ((bot|output, id), (bot|output, id))} bots = {} # (value, botno) vals = [] # {output_id : [values]} outputs = {} # {botno : [values]} states = {} def parse(line): global bots, vals, outputs if line.startswith(...
gpl-3.0
elba7r/system
erpnext/manufacturing/doctype/workstation/workstation.py
34
3885
# 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 import _ from frappe.utils import flt, cint, getdate, formatdate, comma_and, time_diff_in_seconds, to_timedelta from frappe.mo...
gpl-3.0
tbalden/android_kernel_htc_m9pw
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
mahak/cinder
cinder/tests/unit/api/v3/test_groups.py
2
66851
# Copyright (C) 2016 EMC Corporation. # 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
pigeonflight/strider-plone
docker/appengine/lib/django-1.5/django/core/management/color.py
635
1608
""" Sets up the terminal color scheme. """ import os import sys from django.utils import termcolors def supports_color(): """ Returns True if the running system's terminal supports color, and False otherwise. """ unsupported_platform = (sys.platform in ('win32', 'Pocket PC')) # isatty is not ...
mit
PXke/invenio
invenio/legacy/oaiharvest/scripts/oaiharvest.py
4
1916
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 ...
gpl-2.0
crazy-canux/django
tests/admin_views/admin.py
89
30722
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import tempfile from wsgiref.util import FileWrapper from django import forms from django.conf.urls import url from django.contrib import admin from django.contrib.admin import BooleanFieldListFilter from django.contrib.admin.views.main import ...
bsd-3-clause
benthomasson/ansible
lib/ansible/plugins/action/dellos10_config.py
113
4230
# # Copyright 2015 Peter Sprygada <psprygada@ansible.com> # # Copyright (c) 2017 Dell 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 L...
gpl-3.0
tjssmy/CuviewerPy
vtkTests/PyQtInter.py
1
1292
#!/usr/bin/env python import sys import vtk from PyQt4 import QtCore, QtGui from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, parent) self.frame = QtGui.QFrame() ...
mit
esri-es/awesome-arcgis
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
gpl-3.0
r0zar/ember-rails-stocks
stocks/node_modules/ember-cli-sass/node_modules/broccoli-sass-source-maps/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
1569
23354
#!/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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
peerster/CouchPotatoServer
couchpotato/core/media/_base/providers/torrent/torrentz.py
34
4766
import re import traceback from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.rss import RSS from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentMagnetPro...
gpl-3.0
Karel-van-de-Plassche/bokeh
bokeh/application/handlers/script.py
2
3365
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
bsd-3-clause
HiSPARC/station-software
user/python/Lib/lib-tk/ttk.py
2
56173
"""Ttk wrapper. This module provides classes to allow using Tk themed widget set. Ttk is based on a revised and enhanced version of TIP #48 (http://tip.tcl.tk/48) specified style engine. Its basic idea is to separate, to the extent possible, the code implementing a widget's behavior from the code implementing its ap...
gpl-3.0
comepradz/pybrain
pybrain/structure/networks/bidirectional.py
31
4053
__author__ = 'Tom Schaul, tom@idsia.ch' from pybrain.structure.modules import TanhLayer, SigmoidLayer from pybrain.structure.networks.feedforward import FeedForwardNetwork from pybrain.structure.connections.shared import MotherConnection, SharedFullConnection from pybrain.structure.modules.linearlayer import LinearLay...
bsd-3-clause
randall-frank/heresy
card_objects.py
1
23728
# # T.I.M.E Stories card editor # Copyright (C) 2017 Randall Frank # See LICENSE for details # import base64 import os import os.path from PyQt5 import QtXml from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5 import QtWidgets # these are the core objects that represent a deck of cards to the editor class B...
mit
admcrae/tensorflow
tensorflow/contrib/keras/python/keras/applications/inception_v3.py
31
15049
# 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
praekelt/nurseconnect
nurseconnect/celery.py
1
1088
from __future__ import absolute_import import os from celery import Celery from django.conf import settings from celery.signals import celeryd_init from django.core.management import call_command os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nurseconnect.settings.production") app = Celery...
bsd-2-clause
bigdatauniversity/edx-platform
common/lib/xmodule/xmodule/mixin.py
70
2601
""" Reusable mixins for XBlocks and/or XModules """ from xblock.fields import Scope, String, XBlockMixin # Make '_' a no-op so we can scrape strings. Using lambda instead of # `django.utils.translation.ugettext_noop` because Django cannot be imported in this file _ = lambda text: text class LicenseMixin(XBlockMixin...
agpl-3.0
physycom/QGIS
python/plugins/db_manager/sqledit.py
33
6295
# -*- coding: utf-8 -*- """ *************************************************************************** ScriptEdit.py --------------------- Date : February 2014 Copyright : (C) 2014 by Alexander Bruy Email : alexander dot bruy at gmail dot com *************...
gpl-2.0
argv0/cloudstack
test/integration/component/test_project_configs.py
2
52250
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
bhavin04890/finaldashboard
modules/tests/hrm/create_staff_training.py
3
2954
""" Sahana Eden Automated Test - HRM003 Create Staff Training @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT 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 Softwar...
mit
tafaRU/odoo
addons/l10n_be_invoice_bba/partner.py
379
2268
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Created by Luc De Meyer # Copyright (c) 2010 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribu...
agpl-3.0
jbedorf/tensorflow
tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_benchmark.py
47
9869
# Copyright 2017 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
Elico-Corp/odoo_OCB
addons/delivery/models/sale_order.py
16
4841
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import models, fields, api, _ from openerp.exceptions import UserError import openerp.addons.decimal_precision as dp class SaleOrder(models.Model): _inherit = 'sale.order' delivery_price = fields....
agpl-3.0
cernops/rally
tests/unit/verification/test_json2html.py
12
3855
# 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
CredoReference/edx-platform
lms/djangoapps/ccx/migrations/0003_add_master_course_staff_in_ccx.py
53
3403
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from ccx_keys.locator import CCXLocator from courseware.courses import get_course_by_id from django.db import migrations from django.http import Http404 from lms.djangoapps.ccx.utils import ( add_master_course_staff_to_ccx, remove...
agpl-3.0
Varriount/Colliberation
libs/twisted/conch/test/test_window.py
15
2129
""" Tests for the insults windowing module, L{twisted.conch.insults.window}. """ from twisted.trial.unittest import TestCase from twisted.conch.insults.window import TopWindow, ScrolledArea, TextOutput class TopWindowTests(TestCase): """ Tests for L{TopWindow}, the root window container class. """ ...
mit
JioEducation/edx-platform
common/djangoapps/pipeline_js/views.py
60
1230
""" Views for returning XModule JS (used by requirejs) """ import json from django.conf import settings from django.http import HttpResponse from django.contrib.staticfiles.storage import staticfiles_storage from edxmako.shortcuts import render_to_response def get_xmodule_urls(): """ Returns a list of the URL...
agpl-3.0
nmardosz/freedb-to-json-parser
freedbparser.py
1
7260
import os import sys import xml.sax.handler import xml.sax import codecs import re import time import json reload(sys) sys.setdefaultencoding('utf8') releaseCounter = 0 if ( __name__ == "__main__"): trackslength = [] #trackoffsets = [] disclength = [] prevcombinenum = '' trackcombinenum = '' par...
mit
mrtnrdl/.macdots
scripts/bin/platform-tools/systrace/catapult/devil/devil/utils/mock_calls_test.py
10
5597
#!/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. """ Unit tests for the contents of mock_calls.py. """ import logging import os import unittest from devil import devil_env from devil...
unlicense
nickster5001/ctracker
flask/lib/python3.4/site-packages/sqlalchemy/orm/query.py
22
131475
# orm/query.py # Copyright (C) 2005-2014 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 """The Query class and support. Defines the :class:`.Query` class, the central constru...
mit
jlegendary/orange
Orange/classification/svm/kernels.py
6
3904
import math from Orange.core import SVMLearner as _SVMLearner from Orange.core import KernelFunc Linear = _SVMLearner.Linear Polynomial = _SVMLearner.Polynomial RBF = _SVMLearner.RBF Sigmoid = _SVMLearner.Sigmoid Custom = _SVMLearner.Custom class KernelWrapper(object): """A base class for kernel function wr...
gpl-3.0
jhjguxin/blogserver
lib/python2.7/site-packages/django/core/paginator.py
356
4021
from math import ceil class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): self.object_list = object_list self.per_pa...
mit
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/topi/tests/python/test_topi_bnn.py
1
2015
"""Test code for binary neural network operators.""" import numpy as np import tvm import topi from topi.util import get_const_tuple from tvm.contrib.pickle_memoize import memoize def verify_binary_dense(batch, in_dim, out_dim): A = tvm.placeholder((batch, in_dim), name='A') B = tvm.placeholder((out_dim, in_d...
apache-2.0
ResearchComputing/myhat
app/models.py
2
1508
from app import app, db from itsdangerous import (TimedJSONWebSignatureSerializer as Serializer, BadSignature, SignatureExpired) class User(db.Model): id = db.Column(db.Integer, primary_key = True) username = db.Column(db.String(32), index=True) name = db.Column(db.String...
mit
jchevin/MissionPlanner-master
Lib/macpath.py
191
6252
"""Pathname and path-related operations for the Macintosh.""" import os import warnings from stat import * import genericpath from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getc...
gpl-3.0
jcai19/smm_gem5
src/python/m5/event.py
51
2816
# Copyright (c) 2006 The Regents of The University of Michigan # Copyright (c) 2013 Advanced Micro Devices, Inc. # Copyright (c) 2013 Mark D. Hill and David A. Wood # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following con...
bsd-3-clause
6WIND/scapy
scapy/asn1packet.py
4
1048
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ ASN.1 Packet Packet holding data in Abstract Syntax Notation (ASN.1). """ from __future__ import absolute_import from sc...
gpl-2.0
wetneb/django
tests/gis_tests/relatedapp/models.py
31
1809
from django.contrib.gis.db import models from django.utils.encoding import python_2_unicode_compatible class SimpleModel(models.Model): objects = models.GeoManager() class Meta: abstract = True @python_2_unicode_compatible class Location(SimpleModel): point = models.PointField() def __str...
bsd-3-clause
sorenk/ansible
lib/ansible/modules/files/tempfile.py
66
3141
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Krzysztof Magosa <krzysztof@magosa.pl> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = t...
gpl-3.0
raven47git/readthedocs.org
readthedocs/projects/version_handling.py
3
5128
from collections import defaultdict from packaging.version import Version from packaging.version import InvalidVersion from builds.constants import LATEST_VERBOSE_NAME from builds.constants import STABLE_VERBOSE_NAME def get_major(version): return version._version.release[0] def get_minor(version): try: ...
mit
Stan1989/volatility
volatility/debug.py
54
2718
# Volatility # # Authors: # Michael Cohen <scudette@users.sourceforge.net> # # This file is part of Volatility. # # Volatility 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, o...
gpl-2.0
citrix-openstack-build/horizon
openstack_dashboard/dashboards/router/nexus1000v/tests.py
11
2616
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
apache-2.0
fedorpatlin/ansible
lib/ansible/playbook/conditional.py
19
10551
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
tmxdyf/CouchPotatoServer
couchpotato/core/notifications/core/main.py
5
8627
from couchpotato import get_session from couchpotato.api import addApiView, addNonBlockApiView from couchpotato.core.event import addEvent, fireEvent from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import tryInt, splitString from couchpotato.core.logger import CPLog from c...
gpl-3.0
dvro/UnbalancedDataset
imblearn/under_sampling/tests/test_nearmiss_3.py
2
7992
"""Test the module nearmiss.""" from __future__ import print_function import os import numpy as np from numpy.testing import assert_raises from numpy.testing import assert_equal from numpy.testing import assert_array_equal from numpy.testing import assert_warns from sklearn.datasets import make_classification from s...
mit
testmana2/test
Preferences/ConfigurationPages/DebuggerGeneralPage.py
2
11999
# -*- coding: utf-8 -*- # Copyright (c) 2006 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the Debugger General configuration page. """ from __future__ import unicode_literals import socket from PyQt5.QtCore import QRegExp, pyqtSlot from PyQt5.QtWidgets import QLineEdit, QInputDialog...
gpl-3.0
ArneBab/pypyjs
website/demo/home/rfk/repos/pypy/lib-python/2.7/ctypes/test/test_returnfuncptrs.py
37
1437
import unittest from ctypes import * import _ctypes_test class ReturnFuncPtrTestCase(unittest.TestCase): def test_with_prototype(self): # The _ctypes_test shared lib/dll exports quite some functions for testing. # The get_strchr function returns a *pointer* to the C strchr function. dll =...
mit
dnil/OGTtoPED
OGTtoPED.py
1
3605
import argparse import sys from openpyxl import load_workbook import config from sample import Sample from family import update_family, family_ped # CLI parser = argparse.ArgumentParser(description="Convert OGT xlsx to PED file") parser.add_argument("orderform", help="OGT order form with sample ID, status and...
artistic-2.0
mc-coal/mc-coal
lib/dateutil/relativedelta.py
257
17135
""" Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime import calendar __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "F...
agpl-3.0
chand3040/sree_odoo
openerp/addons/hr_recruitment/report/__init__.py
442
1107
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
ric2b/Vivaldi-browser
chromium/third_party/blink/renderer/build/scripts/core/style/make_computed_style_base.py
1
23462
#!/usr/bin/env python # Copyright 2016 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 math import json5_generator import template_expander import keyword_utils import bisect from blinkbuild.name_style_converter i...
bsd-3-clause
boyuegame/kbengine
kbe/res/scripts/common/Lib/ensurepip/__init__.py
67
6388
import os import os.path import pkgutil import sys import tempfile __all__ = ["version", "bootstrap"] _SETUPTOOLS_VERSION = "2.1" _PIP_VERSION = "1.5.6" # pip currently requires ssl support, so we try to provide a nicer # error message when that is missing (http://bugs.python.org/issue19744) _MISSING_SSL_MESSAGE ...
lgpl-3.0
disqus/kombu
examples/complete_send.py
4
1342
""" Example producer that sends a single message and exits. You can use `complete_receive.py` to receive the message sent. """ from kombu import BrokerConnection, Exchange, Queue, Producer #: By default messages sent to exchanges are persistent (delivery_mode=2), #: and queues and exchanges are durable. exchange =...
bsd-3-clause
aisipos/django
tests/template_tests/filter_tests/test_timesince.py
161
5510
from __future__ import unicode_literals from datetime import datetime, timedelta from django.template.defaultfilters import timesince_filter from django.test import SimpleTestCase from django.test.utils import requires_tz_support from ..utils import setup from .timezone_utils import TimezoneTestCase class Timesinc...
bsd-3-clause
Vido/pingo
pingo/parts/spi/mcp3008.py
7
1982
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Object interface for MCP3008 A/D converter using bit-banged SPI """ import time import atexit import RPi.GPIO as GPIO # make sure GPIO.cleanup will be called when script exits atexit.register(GPIO.cleanup) class Mcp3008(object): def __init__(self, spi_clock, sp...
mit
fmcardoso/aco-scs
pantspath/__init__.py
1
1809
"""A Python3 implementation of the Ant Colony Optimization Meta-Heuristic. **Pants** provides you with the ability to quickly determine how to visit a collection of interconnected nodes such that the work done is minimized. Nodes can be any arbitrary collection of data while the edges represent the amount of "work" re...
mit
mathslinux/ceilometer
ceilometer/tests/functional/api/v2/test_compute_duration_by_resource_scenarios.py
3
7927
# # Copyright 2012 New Dream Network, LLC (DreamHost) # # 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
Kazade/NeHe-Website
google_appengine/lib/django-1.2/tests/regressiontests/forms/localflavor/ro.py
39
5387
# -*- coding: utf-8 -*- from django.contrib.localflavor.ro.forms import (ROCIFField, ROCNPField, ROCountyField, ROCountySelect, ROIBANField, ROPhoneNumberField, ROPostalCodeField) from utils import LocalFlavorTestCase class ROLocalFlavorTests(LocalFlavorTestCase): def test_ROCountySelect(self): f...
bsd-3-clause
ErnstHowie/Lasagne
lasagne/tests/layers/test_helper.py
12
31990
from mock import Mock, PropertyMock import pytest import numpy import theano class TestGetAllLayers: def test_stack(self): from lasagne.layers import InputLayer, DenseLayer, get_all_layers from itertools import permutations # l1 --> l2 --> l3 l1 = InputLayer((10, 20)) l2 = ...
mit
zengenti/ansible
lib/ansible/modules/storage/infinidat/infini_fs.py
34
4819
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Gregory Shulov (gregory.shulov@gmail.com) # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
SiriusBizniss/evetowerthing
requests-master/requests/packages/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
mit
twiest/openshift-tools
ansible/roles/lib_openshift_3.2/library/oc_process.py
6
37409
#!/usr/bin/env python # pylint: disable=too-many-lines # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| # | |) | (_) ...
apache-2.0
iansf/engine
sky/tools/webkitpy/common/config/irc.py
69
1467
# Copyright (c) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
jiangjinjinyxt/vnpy
vnpy/api/oanda/test.py
19
2815
# encoding: utf-8 from vnoanda import OandaApi if __name__ == '__main__': token = '' accountId = '' api = OandaApi() api.DEBUG = True api.init('practice', token, accountId) # 获取交易合约列表,通过 #api.getInstruments({'accountId': accountId}) # 获取价格,通过 #api.getPrices...
mit
mrjaydee82/SinLessKerne1-m8-GPE
toolchains/a8483/share/gdb/python/gdb/types.py
137
5421
# Type utilities. # Copyright (C) 2010-2013 Free Software Foundation, 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 License, or # (at your option) any later versi...
gpl-2.0
kaiserroll14/301finalproject
main/numpy/linalg/info.py
264
1198
"""\ Core Linear Algebra Tools ------------------------- Linear algebra basics: - norm Vector or matrix norm - inv Inverse of a square matrix - solve Solve a linear system of equations - det Determinant of a square matrix - lstsq Solve linear least-squares problem...
gpl-3.0
tchernomax/ansible
lib/ansible/modules/cloud/cloudstack/cs_network_acl.py
50
5618
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
thkl/YAHM
share/tools/ubi_reader/ubi_extract_files.py
3
3979
#!/usr/bin/env python ############################################################# # ubi_reader # (c) 2013 Jason Pruitt (jrspruitt@gmail.com) # # 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, e...
cc0-1.0
ville-k/tensorflow
tensorflow/tools/pip_package/setup.py
5
7056
# 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
vmax-feihu/hue
desktop/core/ext-py/Mako-0.8.1/test/test_template.py
36
44478
# -*- coding: utf-8 -*- from mako.template import Template, ModuleTemplate from mako.lookup import TemplateLookup from mako.ext.preprocessors import convert_comments from mako import exceptions, runtime from mako import compat from mako import util import os from test.util import flatten_result, result_lines from mako...
apache-2.0
dvliman/jaikuengine
.google_appengine/lib/django-1.3/django/contrib/admin/validation.py
153
19088
from django.core.exceptions import ImproperlyConfigured from django.db import models from django.db.models.fields import FieldDoesNotExist from django.forms.models import (BaseModelForm, BaseModelFormSet, fields_for_model, _get_foreign_key) from django.contrib.admin.util import get_fields_from_path, NotRelationFiel...
apache-2.0
dd00/commandergenius
project/jni/python/src/Lib/webbrowser.py
62
20990
#! /usr/bin/env python """Interfaces for launching and remotely controlling Web browsers.""" # Maintained by Georg Brandl. import os import shlex import sys import stat import subprocess import time __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] class Error(Exception): pass _browsers...
lgpl-2.1