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
vizual54/MissionPlanner
Lib/site-packages/scipy/cluster/tests/test_hierarchy.py
51
56990
#!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe" # # Author: Damian Eads # Date: April 17, 2008 # # Copyright (C) 2008 Damian Eads # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
gpl-3.0
mitar/pychecker
pychecker2/utest/ops.py
11
1735
from pychecker2 import TestSupport from pychecker2 import OpChecks class OpTests(TestSupport.WarningTester): def testOperator(self): for op in ['--', '++']: self.warning('def f(x):\n' ' return %sx' % op, 2, OpChecks.OpCheck.operator, op) ...
bsd-3-clause
percona/tokudb-engine
mysql-test/suite/tokudb/replace-ignore-gen.py
56
1868
def sqlgen_setup(): print "--disable_warnings" print "drop table if exists t;" print "--enable_warnings" def sqlgen_fill_table(n): print "insert into t values" for i in range(n): print " (%s, %s, %s)," % (i, i, 10*i) print " (%s, %s, %s);" % (n, n, 10*n) def sqlgen_create_table(f...
gpl-2.0
AsherBond/MondocosmOS
grass_trunk/scripts/r.reclass.area/r.reclass.area.py
2
3579
#!/usr/bin/env python ############################################################################ # # MODULE: r.reclass.area # AUTHOR(S): NRCS # Converted to Python by Glynn Clements # PURPOSE: Reclasses a raster map greater or less than user specified area size (in hectares) # COPYRIGHT: ...
agpl-3.0
RohitDas/cubeproject
lib/django/db/backends/postgresql_psycopg2/operations.py
80
10124
from __future__ import unicode_literals from psycopg2.extras import Inet from django.conf import settings from django.db.backends.base.operations import BaseDatabaseOperations class DatabaseOperations(BaseDatabaseOperations): def unification_cast_sql(self, output_field): internal_type = output_field.get...
bsd-3-clause
zaffra/Donate
django/core/validators.py
158
6583
import re import urlparse from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode # These values, if given to validate(), will trigger the self.required check. EMPTY_VALUES = (None, '', [], (), {}) try: from django...
bsd-3-clause
danielharbor/openerp
addons/point_of_sale/wizard/pos_box.py
381
2211
from openerp.osv import osv from openerp.tools.translate import _ from openerp.addons.account.wizard.pos_box import CashBox class PosBox(CashBox): _register = False def run(self, cr, uid, ids, context=None): if not context: context = dict() active_model = context.get('active_mod...
agpl-3.0
lukeiwanski/tensorflow-opencl
tensorflow/contrib/training/python/training/feeder_test.py
43
10781
# 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
FrancescAlted/blaze
blaze/compute/ops/from_dynd.py
4
1344
""" Helper functions which constructs blaze functions from dynd kernels. """ from __future__ import absolute_import, division, print_function from dynd import _lowlevel import datashape from ..function import ElementwiseBlazeFunc def _make_sig(kern): dslist = [datashape.dshape(str(x)) for x in kern.types] ...
bsd-3-clause
NMGRL/pychron
pychron/dashboard/tasks/server/plugin.py
2
2722
# =============================================================================== # Copyright 2013 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/licens...
apache-2.0
blacktear23/django
tests/regressiontests/generic_views/models.py
52
1031
from django.db import models class Artist(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ['name'] verbose_name = 'professional artist' verbose_name_plural = 'professional artists' def __unicode__(self): return self.name @models.permalink...
bsd-3-clause
FujitsuEnablingSoftwareTechnologyGmbH/tempest
tempest/api/compute/admin/test_simple_tenant_usage.py
4
2798
# Copyright 2013 NEC 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 required ...
apache-2.0
lethargi/paparazzi
sw/tools/calibration/calibrate.py
18
6985
#! /usr/bin/env python # Copyright (C) 2010 Antoine Drouin # # This file is part of Paparazzi. # # Paparazzi 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, or (at your option) # any later ...
gpl-2.0
birocorneliu/youtube-dl
youtube_dl/extractor/tinypic.py
126
1893
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class TinyPicIE(InfoExtractor): IE_NAME = 'tinypic' IE_DESC = 'tinypic.com videos' _VALID_URL = r'http://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+' _TESTS = [ ...
unlicense
johnpbatty/python-neutronclient
neutronclient/tests/unit/lb/test_cli20_member.py
7
4933
# Copyright 2013 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 by ...
apache-2.0
glneo/gnuradio-davisaf
gr-digital/examples/ofdm/receive_path.py
13
3477
# # Copyright 2005,2006,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later ...
gpl-3.0
yeyanchao/calibre
src/calibre/gui2/store/basic_config_widget_ui.py
1
1447
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/store/basic_config_widget.ui' # # Created: Thu Oct 25 16:54:55 2012 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, Q...
gpl-3.0
karban/field
resources/python/rope/base/evaluate.py
12
12131
import rope.base.builtins import rope.base.pynames import rope.base.pyobjects from rope.base import ast, astutils, exceptions, pyobjects, arguments, worder BadIdentifierError = exceptions.BadIdentifierError def eval_location(pymodule, offset): """Find the pyname at the offset""" return eval_location2(pymodul...
gpl-2.0
Acidburn0zzz/servo
tests/wpt/webgl/tests/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py
51
3604
#!/usr/bin/env python # Copyright (c) 2016 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and/or associated documentation files (the # "Materials"), to deal in the Materials without restriction, including # without limitation the rights to use...
mpl-2.0
jahrome/viper
modules/rats/clientmesh.py
6
1536
# Originally written by Kevin Breen (@KevTheHermit): # https://github.com/kevthehermit/RATDecoders/blob/master/ClientMesh.py import re import string from base64 import b64decode def stringPrintable(line): return filter(lambda x: x in string.printable, line) def first_split(data): splits = data.split('\x00\x...
bsd-3-clause
minhtuancn/odoo
addons/mail/tests/__init__.py
261
1173
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
hanwen/artisjokke
stepmake/bin/packagepython.py
1
3487
#!/usr/bin/python #ugh. junkme. # packagepython.py -- implement general StepMake-wide python stuff # # source file of the GNU LilyPond music typesetter # # (c) 1997--1998 Han-Wen Nienhuys <hanwen@stack.nl> # Jan Nieuwenhuizen <janneke@gnu.org> import re import string import sys import os import g...
mit
kxliugang/edx-platform
common/test/acceptance/tests/studio/test_import_export.py
47
13412
""" Acceptance tests for the Import and Export pages """ from datetime import datetime from abc import abstractmethod from bok_choy.promise import EmptyPromise from .base_studio_test import StudioLibraryTest, StudioCourseTest from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.import_export import E...
agpl-3.0
sfprime/pattern
pattern/text/en/wordnet/__init__.py
21
16924
#### PATTERN | WORDNET ############################################################################# # -*- coding: utf-8 -*- # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). # http://www.clips.ua.ac.be/pages/pattern ############...
bsd-3-clause
wdurhamh/statsmodels
statsmodels/discrete/discrete_margins.py
19
25467
#Splitting out maringal effects to see if they can be generalized from statsmodels.compat.python import lzip, callable, range import numpy as np from scipy.stats import norm from statsmodels.tools.decorators import cache_readonly, resettable_cache #### margeff helper functions #### #NOTE: todo marginal effects for gr...
bsd-3-clause
RoAbreu/AulaJavaScripts
PROJETO/backend/appengine/routes/livroNovos/admin/home.py
1
1170
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from config.template_middleware import TemplateResponse from tekton import router from gaecookie.decorator import no_csrf from livroNovo_app import facade from routes.livroNovos.admin import new, edit def delete(_handler, livro_novo_id):...
mit
sjlehtin/django
django/contrib/admin/migrations/0001_initial.py
95
1893
import django.contrib.admin.models from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('contenttypes', '__first__'), ] operations = [ migratio...
bsd-3-clause
CVML/cvxpy
cvxpy/atoms/atom.py
4
7417
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
gpl-3.0
noba3/KoTos
addons/plugin.image.picasa/gdata/tlslite/utils/xmltools.py
101
7380
"""Helper functions for XML. This module has misc. helper functions for working with XML DOM nodes.""" from compat import * import os import re if os.name == "java": # Only for Jython from javax.xml.parsers import * import java builder = DocumentBuilderFactory.newInstance().newDocumentBuilder() ...
gpl-2.0
IgnitedAndExploded/pyfire
bin/server.py
1
1928
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Sample Server This module starts the main TCP listener for XMPP clients :copyright: 2011 by the pyfire Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import os.path # Add pyfire to namespace path = os.p...
bsd-3-clause
cneill/designate
designate/storage/impl_sqlalchemy/migrate_repo/versions/039_support_soa_records.py
8
6035
# Copyright (c) 2014 Rackspace Hosting # # Author: Betsy Luzader <betsy.luzader@rackspace.com> # # 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-...
apache-2.0
wanam/Adam-Kernel-GS5-LTE
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
etkirsch/scikit-learn
sklearn/metrics/cluster/supervised.py
207
27395
"""Utilities to evaluate the clustering performance of models Functions named as *_score return a scalar value to maximize: the higher the better. """ # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Wei LI <kuantkid@gmail.com> # Diego Molla <dmolla-aliod@gmail.com> # License: BSD 3 clause fr...
bsd-3-clause
MRigal/django
django/contrib/gis/serializers/geojson.py
275
2672
from __future__ import unicode_literals from django.contrib.gis.gdal import HAS_GDAL from django.core.serializers.base import ( SerializationError, SerializerDoesNotExist, ) from django.core.serializers.json import Serializer as JSONSerializer if HAS_GDAL: from django.contrib.gis.gdal import CoordTransform, S...
bsd-3-clause
tailorian/Sick-Beard
lib/hachoir_metadata/filter.py
90
1668
from lib.hachoir_metadata.timezone import UTC from datetime import date, datetime # Year in 1850..2030 MIN_YEAR = 1850 MAX_YEAR = 2030 class Filter: def __init__(self, valid_types, min=None, max=None): self.types = valid_types self.min = min self.max = max def __call__(self, value): ...
gpl-3.0
cdjones32/vertx-web
src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/command/bdist_egg.py
286
18718
"""setuptools.command.bdist_egg Build .egg distributions""" # This module should be kept compatible with Python 2.3 import sys, os, marshal from setuptools import Command from distutils.dir_util import remove_tree, mkpath try: # Python 2.7 or >=3.2 from sysconfig import get_path, get_python_version def _g...
apache-2.0
blaggacao/odoo
openerp/addons/test_converter/tests/test_html.py
61
13714
# -*- encoding: utf-8 -*- import json import os import datetime from lxml import etree from openerp.tests import common from openerp.tools import html_escape as e from openerp.addons.base.ir import ir_qweb directory = os.path.dirname(__file__) class TestExport(common.TransactionCase): _model = None def set...
agpl-3.0
huongttlan/statsmodels
statsmodels/examples/ex_sandwich.py
34
2737
# -*- coding: utf-8 -*- """examples for sandwich estimators of covariance Author: Josef Perktold """ from statsmodels.compat.python import lzip import numpy as np from numpy.testing import assert_almost_equal import statsmodels.api as sm import statsmodels.stats.sandwich_covariance as sw #import statsmodels.sandbox...
bsd-3-clause
oew1v07/scikit-image
doc/examples/plot_register_translation.py
14
2463
""" ===================================== Cross-Correlation (Phase Correlation) ===================================== In this example, we use phase correlation to identify the relative shift between two similar-sized images. The ``register_translation`` function uses cross-correlation in Fourier space, optionally emp...
bsd-3-clause
gamechanger/deferrable
deferrable/deferrable.py
1
12658
import sys import time import logging from uuid import uuid1 import socket from traceback import format_exc from .pickling import loads, dumps, build_later_item, unpickle_method_call, pretty_unpickle from .debounce import (get_debounce_strategy, set_debounce_keys_for_push_now, set_debounce_keys_...
mit
JavML/django
tests/aggregation/tests.py
57
45690
from __future__ import unicode_literals import datetime import re from decimal import Decimal from django.core.exceptions import FieldError from django.db import connection from django.db.models import ( F, Avg, Count, DecimalField, DurationField, FloatField, Func, IntegerField, Max, Min, Sum, Value, ) from d...
bsd-3-clause
jkankiewicz/kivy
kivy/uix/rst.py
4
33744
''' reStructuredText renderer ========================= .. versionadded:: 1.1.0 `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. .. note:: This widget requires the ``docutils`` package to run. Install it wi...
mit
suto/infernal-twin
build/reportlab/src/reportlab/pdfbase/pdfpattern.py
34
3771
__doc__="""helper for importing pdf structures into a ReportLab generated document """ from reportlab.pdfbase.pdfdoc import format, PDFObject, pdfdocEnc from reportlab.lib.utils import strTypes def _patternSequenceCheck(pattern_sequence): allowedTypes = strTypes if isinstance(strTypes, tuple) else (strTypes,) ...
gpl-3.0
andreoliw/clitoolkit
clit/db.py
1
5596
"""Database module.""" import argparse from pathlib import Path from subprocess import PIPE from typing import List, Optional from clit.docker import DockerContainer from clit.files import existing_directory_type, existing_file_type, shell POSTGRES_DOCKER_CONTAINER_NAME = "postgres10" class DatabaseServer: """A...
bsd-3-clause
mihailignatenko/erp
addons/mrp/product.py
131
4440
# -*- 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
nwjs/chromium.src
remoting/host/installer/build-installer-archive.py
5
8906
#!/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. """Creates a zip archive for the Chrome Remote Desktop Host installer. This script builds a zip file that contains all the files n...
bsd-3-clause
dusenberrymw/Pine-Data-Tools
lib/preprocess.py
1
2543
#! /usr/bin/env python3 """ Preprocess csv data, line by line -Reads from csv input_file, and writes to new csv output_file Usage: proprocess.py <input_file.csv> <output_file.csv> [<headers_present = 0>] [<skip_missing_or_incorrect_data = 1>] [<default_value = 0>] """ import csv import sys ...
mit
eastlhu/zulip
zerver/lib/response.py
124
1316
from __future__ import absolute_import from django.http import HttpResponse, HttpResponseNotAllowed import ujson class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, realm): HttpResponse.__init__(self) self["WWW-Authenticate"] = 'Basic realm="%s"' % (realm,) def...
apache-2.0
ChenglongChen/caffe-windows
examples/kaggle-bowl/caffe_windows/utils/compute_logloss.py
1
1105
#!/usr/bin/env python """ @file compute_logloss.py @brief compute logloss @author ChenglongChen """ import sys import numpy as np import pandas as pd def softmax(score): num = score.shape[0] maxes = np.amax(score, axis=1).reshape((num, 1)) e = np.exp(score - maxes) prob = e / np.sum(e, axis=1).reshap...
bsd-2-clause
KarrLab/Karr-Lab-build-utils
karr_lab_build_utils/templates/_package_/__main__.py
1
2009
""" {{ name }} command line interface :Author: Name <email> :Date: {{ date }} :Copyright: {{ year }}, Karr Lab :License: MIT """ import cement import {{name}} import {{name}}.core class BaseController(cement.Controller): """ Base controller for command line application """ class Meta: label = 'base...
mit
synmnstr/flexx
exp/reactive.py
22
9230
""" Attempt to implement a reactive system in Python. With that I mean a system in which signals are bound implicitly, as in Shiny. The Signal is the core element here. It is like the Property in HasProps. A function can easily be turned into a Signal object by decorating it. Other than Properties, signals have a fun...
bsd-2-clause
adamjmcgrath/glancydesign
django/core/management/commands/makemessages.py
154
16507
import fnmatch import glob import os import re import sys from itertools import dropwhile from optparse import make_option from subprocess import PIPE, Popen from django.core.management.base import CommandError, NoArgsCommand from django.utils.text import get_text_list pythonize_re = re.compile(r'(?:^|\n)\s*//') plur...
bsd-3-clause
jaksmid/gensim
gensim/test/test_similarities.py
8
22852
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for similarity algorithms (the similarities package). """ import logging import unittest import os import tempfile...
lgpl-2.1
marcreyesph/scancode-toolkit
tests/cluecode/test_authors.py
6
9569
# # Copyright (c) 2015 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB Inc. # # You may not use...
apache-2.0
nemonik/Intellect
intellect/examples/testing/__init__.py
12
1629
""" Copyright (c) 2011, The MITRE Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the...
bsd-3-clause
pettarin/aeneas
aeneas/tests/long_test_task_rconf.py
5
16852
#!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-2017, A...
agpl-3.0
bcarroll/authmgr
python-3.6.2-Win64/Lib/site-packages/flask_debugtoolbar/__init__.py
3
8540
import os import warnings from flask import Blueprint, current_app, request, g, send_from_directory from flask.globals import _request_ctx_stack from jinja2 import Environment, PackageLoader from werkzeug.urls import url_quote_plus from flask_debugtoolbar.compat import iteritems from flask_debugtoolbar.toolbar import...
bsd-3-clause
nathan-osman/python-ewp
setup.py
1
1092
from setuptools import Extension, setup setup( name='ewp', version='0.1.1', ext_modules=[Extension( 'ewp', sources=['src/ewp.c'], include_dirs=[ '/usr/local/opt/openssl/include', # macOS ], libraries=['crypto', 'ssl'], library_dirs=[ ...
mit
c00w/bitHopper
bitHopper/Website/Pool_Page.py
1
1176
from bitHopper.Website import app, flask import bitHopper.Tracking.Tracking import bitHopper.Configuration.Pools @app.route("/pool", methods=['POST', 'GET']) def pool(): handle_worker_post(flask.request.form) pools = bitHopper.Tracking.Tracking.build_dict() percentage = {} priority = {} ...
mit
kpkhxlgy0/SublimeText3
Packages/SublimeCodeIntel/libs/codeintel2/tree_javascript.py
7
44470
#!/usr/bin/env python # ***** 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.mozil...
mit
epssy/hue
desktop/core/ext-py/python-daemon/daemon/daemon.py
42
24728
# -*- coding: utf-8 -*- # daemon/daemon.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright © 2008–2009 Ben Finney <ben+python@benfinney.id.au> # Copyright © 2007–2008 Robert Niederreiter, Jens Klein # Copyright © 2004–2005 Chad J. Schroeder # Copyright © 2003 Clark Evans # Copyright © 2002 Noah S...
apache-2.0
dbertha/odoo
addons/survey/__openerp__.py
261
2391
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
MoritzS/django
tests/backends/test_postgresql.py
21
2121
import unittest from collections import namedtuple from django.db import connection from django.test import TestCase from .models import Person @unittest.skipUnless(connection.vendor == 'postgresql', "Test only for PostgreSQL") class ServerSideCursorsPostgres(TestCase): cursor_fields = 'name, statement, is_hold...
bsd-3-clause
40023256/2015cdag1man
static/Brython3.1.0-20150301-090019/Lib/xml/etree/ElementTree.py
730
61800
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed support for ...
gpl-3.0
cloudera/hadoop-common
src/contrib/hod/hodlib/Common/desc.py
182
7484
#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 use thi...
apache-2.0
iulian787/spack
var/spack/repos/builtin/packages/r-igraph/package.py
5
1357
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RIgraph(RPackage): """Routines for simple graphs and network analysis. It can handle large...
lgpl-2.1
UstadMobile/eXePUB
exe/export/pages.py
2
2677
# =========================================================================== # eXe # Copyright 2004-2005, University of Auckland # Copyright 2004-2008 eXe Project, http://eXeLearning.org/ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
gpl-2.0
Jayflux/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/testing/code/test_code.py
14
4951
# coding: utf-8 from __future__ import absolute_import, division, print_function import sys import _pytest._code import py import pytest from test_excinfo import TWMock def test_ne(): code1 = _pytest._code.Code(compile('foo = "bar"', '', 'exec')) assert code1 == code1 code2 = _pytest._code.Code(compile('...
mpl-2.0
hjarmstrong/Odme-plusplus
3rd/build/tools/build/v2/test/dependency_test.py
44
6986
#!/usr/bin/python # Copyright 2003 Dave Abrahams # Copyright 2002, 2003, 2005, 2006 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import BoostBuild def test_basic(): t = BoostBuild.Tester(["-...
mit
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/google/protobuf/json_format.py
19
29203
# 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
yugangw-msft/azure-cli
src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2020_09_01/test_storage_account_scenarios.py
2
13246
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
mit
pombredanne/timyd
timyd/console.py
1
1115
# At the time of writing, unicurses just doesn't work on Windows (pdcurses.dll # lookup is wrong) # This module provides escape sequences for terminal colors import os _DEFAULT = b'\x1B[0m' class _ColorMethod(object): def __init__(self, code): self._code = code def __get__(self, obj, type=None): ...
mit
EliotBryant/ShadDetector
shadDetector_testing/Colour Based Methods/ColorHistogram-master/color_histogram/results/hist_3d.py
2
2636
# -*- coding: utf-8 -*- # # @package color_histogram.results.hist_3d # # cCompute 3D color histogram result. # @author tody # @date 2015/08/28 import os import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from color_histogram.io_util.image import loadRGB from colo...
gpl-3.0
roystgnr/libmesh
doc/statistics/libmesh_mailinglists.py
2
12279
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np from operator import add # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num, num2date # Number of messages to libmesh-devel and libmesh-users over the life # of the project. I cut and paste...
lgpl-2.1
ecederstrand/django
tests/distinct_on_fields/tests.py
263
5996
from __future__ import unicode_literals from django.db.models import Max from django.test import TestCase, skipUnlessDBFeature from django.test.utils import str_prefix from .models import Celebrity, Fan, Staff, StaffTag, Tag @skipUnlessDBFeature('can_distinct_on_fields') @skipUnlessDBFeature('supports_nullable_uniq...
bsd-3-clause
paxapy/zulip
docs/conf.py
9
9881
# -*- coding: utf-8 -*- # # zulip-contributor-docs documentation build configuration file, created by # sphinx-quickstart on Mon Aug 17 16:24:04 2015. # # 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 # autogenera...
apache-2.0
aviciimaxwell/odoo
addons/account/wizard/account_subscription_generate.py
347
2254
# -*- 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
tchaly-bethmaure/Emotes
script/tools.py
2
4321
import sys import json class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' def lst_weight_to_freq(list_weight): sigma = sum(list_weight) lst_freq = [] for w in list_weight: lst_freq.append(w/sigma) return lst...
gpl-2.0
j-marjanovic/myhdl
myhdl/test/conversion/toVerilog/test_hec.py
2
4388
from __future__ import absolute_import import os path = os.path import unittest from random import randrange from myhdl import * from .util import setupCosimulation COSET = 0x55 def calculateHecRef(header): """ Return hec for an ATM header. Reference version. The hec polynomial is 1 + x + x**2 + x**8. ...
lgpl-2.1
nharraud/b2share
invenio/legacy/registry.py
18
2353
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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...
gpl-2.0
PetePriority/home-assistant
homeassistant/components/automation/state.py
2
2698
""" Offer state listening automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/docs/automation/trigger/#state-trigger """ import voluptuous as vol from homeassistant.core import callback from homeassistant.const import MATCH_ALL, CONF_PLATFORM, ...
apache-2.0
engagespark/django-waffle
waffle/south_migrations/0008_auto__add_field_flag_languages.py
21
6752
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Flag.languages' db.add_column('waffle_flag', 'languages', self.gf('django.db.models.fields...
bsd-3-clause
pratapvardhan/scikit-learn
sklearn/svm/setup.py
321
3157
import os from os.path import join import numpy from sklearn._build_utils import get_blas_info def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('svm', parent_package, top_path) config.add_subpackage('tests') # Section L...
bsd-3-clause
caesar2164/edx-platform
cms/djangoapps/contentstore/management/commands/export.py
8
1908
""" Script for exporting courseware from Mongo to a tar.gz file """ import os from django.core.management.base import BaseCommand, CommandError from xmodule.modulestore.xml_exporter import export_course_to_xml from xmodule.modulestore.django import modulestore from opaque_keys.edx.keys import CourseKey from xmodule.co...
agpl-3.0
jhutar/spacewalk
proxy/proxy/rhnAuthCacheClient.py
2
6945
# rhnAuthCacheClient.py #------------------------------------------------------------------------------- # Implements a client-side 'remote shelf' caching object used for # authentication token caching. # (Client, meaning, a client to the authCache daemon) # # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is...
gpl-2.0
abaditsegay/arangodb
3rdParty/V8-4.3.61/tools/testrunner/objects/testcase.py
22
3600
# Copyright 2012 the V8 project authors. 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...
apache-2.0
uberlaggydarwin/htc-desire-eye-kernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
sergiohgz/incubator-airflow
airflow/ti_deps/deps/dag_unpaused_dep.py
20
1224
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
dhocker/MPD
python/build/verify.py
22
1150
import hashlib def feed_file(h, f): """Feed data read from an open file into the hashlib instance.""" while True: data = f.read(65536) if len(data) == 0: # end of file break h.update(data) def feed_file_path(h, path): """Feed data read from a file (to be op...
gpl-2.0
winklerand/pandas
pandas/tests/series/test_timeseries.py
1
32325
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytest import numpy as np from datetime import datetime, timedelta, time import pandas as pd import pandas.util.testing as tm from pandas._libs.tslib import iNaT from pandas.compat import lrange, StringIO, product from pandas.core.indexes.timedeltas import Time...
bsd-3-clause
garvitr/sympy
sympy/polys/polyquinticconst.py
117
96143
""" Solving solvable quintics - An implementation of DS Dummit's paper Paper : http://www.ams.org/journals/mcom/1991-57-195/S0025-5718-1991-1079014-X/S0025-5718-1991-1079014-X.pdf Mathematica notebook: http://www.emba.uvm.edu/~ddummit/quintics/quintics.nb """ from __future__ import print_function, division from sy...
bsd-3-clause
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/distutils/command/bdist_dumb.py
12
4913
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" import os from distutils.core import Command from distutils.util import get_platform from distutils.dir_util import remove_tree, ...
apache-2.0
kbrebanov/ansible
lib/ansible/module_utils/vmware.py
2
28470
# -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 yo...
gpl-3.0
ktosiek/spacewalk
backend/server/test/unit-test/rhnSQL/test_rhnServerGroup.py
3
2625
#!/usr/bin/python # # Copyright (c) 2008--2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should...
gpl-2.0
evro/CouchPotatoServer
libs/subliminal/language.py
107
54658
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of...
gpl-3.0
pferreir/indico-backup
indico/MaKaC/common/utils.py
1
21170
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2013 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
gpl-3.0
GustavoHennig/ansible
lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py
49
4121
#!/usr/bin/python # Copyright (c) 2016 Hewlett-Packard Enterprise Corporation # # This module 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 ve...
gpl-3.0
diwer/sublimeconfig
Packages/Package Control/package_control/downloaders/background_downloader.py
9
1574
import threading class BackgroundDownloader(threading.Thread): """ Downloads information from one or more URLs in the background. Normal usage is to use one BackgroundDownloader per domain name. :param settings: A dict containing at least the following fields: `cache_length`, ...
mit
jeongarmy/TizenRT
external/protobuf/python/google/protobuf/message.py
43
11454
# 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...
apache-2.0
kuiwei/kuiwei
common/djangoapps/third_party_auth/provider.py
29
8241
"""Third-party auth provider definitions. Loaded by Django's settings mechanism. Consequently, this module must not invoke the Django armature. """ from social.backends import google, linkedin _DEFAULT_ICON_CLASS = 'icon-signin' class BaseProvider(object): """Abstract base class for third-party auth providers....
agpl-3.0