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
amadeusproject/amadeuslms
dashboards/utils.py
1
62643
import calendar import os from datetime import date, datetime, timedelta from django.utils import formats, timezone from django.conf import settings from django.utils.dateparse import parse_datetime from django.core.urlresolvers import reverse from django.utils.formats import get_format from django.utils.translation im...
gpl-2.0
dionescu/gmock
gtest/test/gtest_throw_on_failure_test.py
2917
5766
#!/usr/bin/env python # # Copyright 2009, 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...
bsd-3-clause
titusfortner/selenium
py/test/selenium/webdriver/common/form_handling_tests.py
1
8158
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
brototyp/CouchPotato
library/sqlalchemy/orm/exc.py
11
3814
# exc.py - ORM exceptions # Copyright (C) the SQLAlchemy authors and contributors # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """SQLAlchemy ORM exceptions.""" import sqlalchemy as sa NO_STATE = (AttributeError, KeyError) """Except...
gpl-3.0
denisenkom/django
tests/generic_inline_admin/tests.py
2
17626
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.contrib import admin from django.contrib.admin.sites import AdminSite from django.contrib.contenttypes.generic import ( generic_inlineformset_factory, GenericTabularInline) from django.forms.formsets import...
bsd-3-clause
jslhs/clFFT
src/scripts/perf/fftPerformanceTesting.py
2
11673
# ######################################################################## # Copyright 2013 Advanced Micro Devices, 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.apach...
apache-2.0
manishpatell/erpcustomizationssaiimpex123qwe
addons/l10n_in_hr_payroll/__init__.py
430
1117
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
fvcproductions/dotfiles
bin/sketch/Plugins/WakaTime.sketchplugin/Contents/Resources/wakatime/packages/pygments/styles/lovelace.py
31
3173
# -*- coding: utf-8 -*- """ pygments.styles.lovelace ~~~~~~~~~~~~~~~~~~~~~~~~ Lovelace by Miikka Salminen Pygments style by Miikka Salminen (https://github.com/miikkas) A desaturated, somewhat subdued style created for the Lovelace interactive learning environment. :copyright: Copyright 2...
mit
liqi328/rjrepaircompany
django/contrib/gis/gdal/geometries.py
388
26357
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
bsd-3-clause
Salat-Cx65/python-for-android
python-build/python-libs/gdata/src/gdata/youtube/service.py
141
57914
#!/usr/bin/python # # Copyright (C) 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
peterbe/moztrap
tests/model/tags/api/test_tags_resource.py
2
12279
""" Tests for TagResource api. """ from tests.case.api.crud import ApiCrudCases import logging mozlogger = logging.getLogger('moztrap.test') class TagResourceTest(ApiCrudCases): @property def factory(self): """The model factory for this object.""" return self.F.TagFactory() @property...
bsd-2-clause
s2oBCN/selenium
py/test/selenium/webdriver/common/driver_element_finding_tests.py
60
7171
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
mbauskar/omnitech-frappe
frappe/website/context.py
27
3030
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.website.doctype.website_settings.website_settings import get_website_settings from frappe.website.template import build_template from frappe.website.rou...
mit
mrozekma/Sprint
Retrospective.py
1
1171
from collections import OrderedDict from Project import Project from Sprint import Sprint from utils import * from stasis.ActiveRecord import ActiveRecord, link DEFAULT_CATEGORIES = ['Product Management', 'Infrastructure', 'Teamwork', 'Release Planning', 'Scrum Process', 'Engineering Practices'] class Category(Acti...
mit
luisibanez/vista-debian-med-package
Packages/Scheduling/Testing/RAS/SCMain01_test.py
6
1609
''' Created on Jun 14, 2012 @author: bcaine This is the main Scheduling script that calls the underlying scheduling functional tests located in SCMain01_suite ''' import sys sys.path = ['./RAS/lib'] + ['./dataFiles'] + ['../Python/vista'] + sys.path import SCMain01_suite import TestHelper def main(): test_suite_d...
apache-2.0
iABC2XYZ/abc
DM_Twiss/TwissTrain3.py
2
4285
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Sep 20 13:37:16 2017 Author: Peiyong Jiang : jiangpeiyong@impcas.ac.cn Function: Check that the Distribution generation method is right. """ import matplotlib.pyplot as plt import tensorflow as tf import numpy as np from Orth import LambdaR,OrthT...
gpl-3.0
myarjunar/inasafe
safe_extras/raven/events.py
26
4122
""" raven.events ~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import logging import sys from raven.utils import varmap from raven.utils.encoding import shorten, to_unicode from raven.utils.stacks import get_stack_info, iter_trace...
gpl-3.0
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/twisted/web/domhelpers.py
60
8562
# -*- test-case-name: twisted.web.test.test_domhelpers -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A library for performing interesting tasks with DOM objects. """ import StringIO from twisted.web import microdom from twisted.web.microdom import getElementsByTagName, escape, unesc...
gpl-2.0
thodoris/djangoPharma
djangoPharma/env/Lib/site-packages/pip/utils/packaging.py
343
2080
from __future__ import absolute_import from email.parser import FeedParser import logging import sys from pip._vendor.packaging import specifiers from pip._vendor.packaging import version from pip._vendor import pkg_resources from pip import exceptions logger = logging.getLogger(__name__) def check_requires_pyth...
apache-2.0
4022321818/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/xml/dom/domreg.py
841
3402
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" # This is a list of well-known implementations. Well-known names # should be published by posting to xml-sig@python.org, and are # ...
agpl-3.0
asi-uniovi/malloovia
malloovia/lpsolver.py
1
33503
# coding: utf-8 #  import pandas as pd """Malloovia interface to LP solver""" from typing import Sequence, List, Any from itertools import product as cartesian_product from inspect import ismethod from collections import namedtuple from uuid import uuid4 import os import pulp # type: ignore from pulp import ( L...
mit
ruibarreira/linuxtrail
usr/lib/python2.7/_pyio.py
28
69294
""" Python implementation of the io module. """ from __future__ import (print_function, unicode_literals) import os import abc import codecs import warnings import errno # Import thread instead of threading to reduce startup cost try: from thread import allocate_lock as Lock except ImportError: from dummy_thr...
gpl-3.0
lauregonnord/cap-labs
TP04/Mu-evalntype/MyMuTypingVisitor.py
1
1555
from MuVisitor import MuVisitor from MuParser import MuParser from enum import Enum class MuTypeError(Exception): pass class BaseType(Enum): Float, Integer, Boolean, String, Nil = range(5) def printBaseType(self): print(self) # Basic Type Checking for Mu programs. class MyMuTypingVisitor(MuV...
gpl-3.0
benpatterson/edx-platform
lms/djangoapps/mobile_api/testutils.py
57
8425
""" Test utilities for mobile API tests: MobileAPITestCase - Common base class with helper methods and common functionality. No tests are implemented in this base class. Test Mixins to be included by concrete test classes and provide implementation of common test methods: MobileAuthTestMixin - tests for...
agpl-3.0
tumbl3w33d/ansible
lib/ansible/modules/cloud/azure/azure_rm_devtestlabschedule_info.py
20
6599
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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
Erotemic/plottool
plottool_ibeis/viz_keypoints.py
1
4272
from __future__ import absolute_import, division, print_function import utool import plottool_ibeis.draw_func2 as df2 import numpy as np from plottool_ibeis import plot_helpers as ph #(print, print_, printDBG, rrr, profile) = utool.inject(__name__, '[viz_keypoints]', DEBUG=False) utool.noinject(__name__, '[viz_keypoint...
apache-2.0
maikelwever/glances
glances/plugins/glances_help.py
11
8932
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
lgpl-3.0
miguelpalacio/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/mathtls.py
273
11647
"""Miscellaneous helper functions.""" from utils.compat import * from utils.cryptomath import * import hmac import md5 import sha #1024, 1536, 2048, 3072, 4096, 6144, and 8192 bit groups] goodGroupParameters = [(2,0xEEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D...
apache-2.0
timkahlke/BASTA
basta/test_tax_creator.py
1
4320
import unittest import os import sys from basta import NCBITaxonomyCreator class TestDB(unittest.TestCase): def setUp(self): dir_path = os.path.dirname(os.path.realpath(__file__)) self.pwd = dir_path with open(os.path.join(self.pwd,"names.tab"), "w") as f: f.write("2|\tBacteri...
gpl-3.0
huihoo/reader
vendor/paypal/standard/ipn/migrations/0001_first_migration.py
2
21676
# -*- coding: utf-8 -*- from django.db import models from south.db import db from vendor.paypal.standard.ipn.models import * class Migration: def forwards(self, orm): # Adding model 'PayPalIPN' db.create_table('paypal_ipn', ( ('id', models.AutoField(primary_key=True)), ...
mit
chris-chris/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/inline_test.py
79
3122
# 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
dgillis/scrapy
tests/test_downloadermiddleware_redirect.py
47
11713
# -*- coding: utf-8 -*- import unittest from scrapy.downloadermiddlewares.redirect import RedirectMiddleware, MetaRefreshMiddleware from scrapy.spiders import Spider from scrapy.exceptions import IgnoreRequest from scrapy.http import Request, Response, HtmlResponse from scrapy.utils.test import get_crawler class Re...
bsd-3-clause
gnychis/grforwarder
gnuradio-core/src/python/gnuradio/gr/gr_threading_24.py
94
25507
"""Thread module emulating a subset of Java's threading model.""" # This started life as the threading.py module of Python 2.4 # It's been patched to fix a problem with join, where a KeyboardInterrupt # caused a lock to be left in the acquired state. import sys as _sys try: import thread except ImportError: ...
gpl-3.0
Kingclove/ChannelAPI-Demo
server/lib/flask/templating.py
783
4707
# -*- coding: utf-8 -*- """ flask.templating ~~~~~~~~~~~~~~~~ Implements the bridge to Jinja2. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import posixpath from jinja2 import BaseLoader, Environment as BaseEnvironment, \ TemplateNotFound from .glo...
apache-2.0
bjornlevi/5thpower
nefndaralit/env/lib/python3.6/site-packages/chardet/sbcharsetprober.py
269
5657
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mit
alanjw/GreenOpenERP-Win-X86
openerp/addons/decimal_precision/decimal_precision.py
35
3065
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
nagaozen/my-os-customizations
home/nagaozen/gedit-plugins-2.30.1/usr/local/lib/gedit-2/plugins/codecomment.py
1
9563
# -*- coding: utf-8 -*- # Code comment plugin # This file is part of gedit # # Copyright (C) 2005-2006 Igalia # Copyright (C) 2006 Matthew Dugan # Copyrignt (C) 2007 Steve Frécinaux # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
gpl-3.0
LibriCerule/Cerulean_Tracking
env/lib/python3.5/site-packages/pip/utils/__init__.py
22
26034
from __future__ import absolute_import from collections import deque import contextlib import errno import locale # we have a submodule named 'logging' which would shadow this if we used the # regular name: import logging as std_logging import re import os import posixpath import shutil import stat import subprocess i...
mit
hasecbinusr/pysal
pysal/cg/sphere.py
7
12483
""" sphere: Tools for working with spherical geometry. Author(s): Charles R Schmidt schmidtc@gmail.com Luc Anselin luc.anselin@asu.edu Xun Li xun.li@asu.edu """ __author__ = "Charles R Schmidt <schmidtc@gmail.com>, Luc Anselin <luc.anselin@asu.edu, Xun Li <xun.li@asu.edu" import math import random impor...
bsd-3-clause
kamyu104/django
django/core/management/commands/flush.py
200
3905
from __future__ import unicode_literals import sys from importlib import import_module from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.core.management.color import no_style from django.core.management.sql import emit_post_migrate_signal, sql_flush from django...
bsd-3-clause
scorphus/thumbor
thumbor/filters/convolution.py
4
1197
# -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.ext.filters import _convolution from thumbor.filters import BaseFilter, f...
mit
openstack/tempest
tempest/api/network/admin/test_external_networks_negative.py
1
2655
# Copyright 2014 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
jpakkane/meson
mesonbuild/modules/rpm.py
2
8284
# Copyright 2015 The Meson development team # 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 ...
apache-2.0
manipopopo/tensorflow
tensorflow/python/ops/image_grad.py
31
4235
# 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
eliben/deep-learning-samples
cs231n/linear_classifier.py
1
2603
# This is a generic linear classifier that implements SGD - Stochastic Gradient # Descent (actually its mini-batch generalization). # # It has to be derived from by classes that provide a 'loss' member function, # to implement different classifiers. # See http://cs231n.github.io/classification/ for background. import n...
unlicense
Knownly/Cactus
cactus/utils/filesystem.py
5
1445
import os import shutil import tempfile from contextlib import contextmanager from cactus.utils.helpers import map_apply def mkdtemp(): return tempfile.mkdtemp(dir=os.environ.get("TEMPDIR")) def fileList(paths, relative=False, folders=False): """ Generate a recursive list of files from a given path. ...
bsd-3-clause
pombreda/labyrinth
src/Links.py
3
10425
# Link.py # This file is part of Labyrinth # # Copyright (C) 2006 - Don Scorgie <Don@Scorgie.org> # # Labyrinth 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 op...
gpl-2.0
AlanZatarain/pybootchartgui
pybootchartgui/draw.py
3
12094
# This file is part of pybootchartgui. # pybootchartgui 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. # pybootchartgui is dis...
gpl-3.0
bergholz/trello2misc
trello2misc.py
1
5884
#!/usr/bin/python3 """trello2misc.py Pulls your cards from Trello to your console or your local todo.txt-file. Broadly speaking, one card corresponds to one entry. Boards correspond to contexts, lists to priorities, and labels to projects. See the README.md and trello2misc.ini files for more information. Author: Andr...
mit
SpeedBienal/app-bienal
Bienal/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py
1407
47697
# 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. """ This module helps emulate Visual Studio 2008 behavior on top of other build systems, primarily ninja. """ import os import re import subprocess import sys fr...
gpl-3.0
MSeifert04/numpy
numpy/f2py/tests/test_return_real.py
13
5619
from __future__ import division, absolute_import, print_function import platform import pytest from numpy import array from numpy.compat import long from numpy.testing import assert_, assert_raises from . import util class TestReturnReal(util.F2PyTest): def check_function(self, t): if t.__doc__.split()...
bsd-3-clause
40223123/finaltest2
static/Brython3.1.0-20150301-090019/Lib/socket.py
730
14913
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are available a...
gpl-3.0
AladdinSonni/youtube-dl
youtube_dl/extractor/mdr.py
73
2124
from __future__ import unicode_literals import re from .common import InfoExtractor class MDRIE(InfoExtractor): _VALID_URL = r'^(?P<domain>https?://(?:www\.)?mdr\.de)/(?:.*)/(?P<type>video|audio)(?P<video_id>[^/_]+)(?:_|\.html)' # No tests, MDR regularily deletes its videos _TEST = { 'url': 'ht...
unlicense
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/test/test_xml_etree_c.py
6
2602
# xml.etree test for cElementTree from test import test_support from test.test_support import precisionbigmemtest, _2G import unittest cET = test_support.import_module('xml.etree.cElementTree') # cElementTree specific tests def sanity(): """ Import sanity. >>> from xml.etree import cElementTree ""...
gpl-3.0
MauHernandez/cyclope
cyclope/apps/staticpages/admin.py
1
4324
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010-2013 Código Sur Sociedad Civil. # All rights reserved. # # This file is part of Cyclope. # # Cyclope 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 Foundat...
gpl-3.0
redbaron/ansible
lib/ansible/runner/action_plugins/assemble.py
14
6198
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # Stephen Fromm <sfromm@gmail.com> # Brian Coca <briancoca+dev@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 publish...
gpl-3.0
techdragon/django
tests/utils_tests/test_decorators.py
319
4870
from django.http import HttpResponse from django.template import engines from django.template.response import TemplateResponse from django.test import RequestFactory, SimpleTestCase from django.utils.decorators import classproperty, decorator_from_middleware class ProcessViewMiddleware(object): def process_view(s...
bsd-3-clause
ncos/lisa
src/lisa_drive/scripts/venv/lib/python3.5/site-packages/pip-10.0.1-py3.5.egg/pip/_vendor/chardet/eucjpprober.py
8
3841
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
mit
HybridF5/jacket
jacket/tests/compute/functional/api_sample_tests/test_migrations.py
1
7205
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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
manasapte/pants
tests/python/pants_test/goal/test_products.py
17
4205
# coding=utf-8 # Copyright 2015 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 from colle...
apache-2.0
ivanovev/tmb
gui/RSW.py
1
1830
from collections import OrderedDict as OD from util import Data, control_cb, monitor_cb, alarm_trace_cb, dev_io_cb def status_fmt_cb(val, read=True, n=0): val = int(val, 16) return '1' if val & (1 << n) else '0' def get_ctrl(dev): ctrl = Data(name='Settings', send=True, io_cb=dev_io_cb) ctrl.add('chu...
gpl-3.0
moijes12/oh-mainline
mysite/customs/management/commands/customs_debugger.py
15
3664
# This file is part of OpenHatch. # Copyright (C) 2010 Jack Grigg # Copyright (C) 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
agpl-3.0
ClimbsRocks/scikit-learn
sklearn/linear_model/tests/test_bayes.py
299
1770
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Fabian Pedregosa <fabian.pedregosa@inria.fr> # # License: BSD 3 clause import numpy as np from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.linear_model.bayes import BayesianRidge, ARDRegres...
bsd-3-clause
bbsan2k/nzbToMedia
libs/unidecode/x054.py
251
4583
data = ( 'Mie ', # 0x00 'Xu ', # 0x01 'Mang ', # 0x02 'Chi ', # 0x03 'Ge ', # 0x04 'Xuan ', # 0x05 'Yao ', # 0x06 'Zi ', # 0x07 'He ', # 0x08 'Ji ', # 0x09 'Diao ', # 0x0a 'Cun ', # 0x0b 'Tong ', # 0x0c 'Ming ', # 0x0d 'Hou ', # 0x0e 'Li ', # 0x0f 'Tu ', # 0x10 'Xiang ...
gpl-3.0
mheap/ansible
lib/ansible/modules/system/sefcontext.py
15
8216
#!/usr/bin/python # (c) 2016, Dag Wieers <dag@wieers.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', 'status': ['...
gpl-3.0
GiovanniConserva/TestDeploy
venv/Lib/warnings.py
68
14748
"""Python part of the warnings subsystem.""" # Note: function level imports should *not* be used # in this module as it may cause import lock deadlock. # See bug 683658. import linecache import sys import types __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", "simplefil...
bsd-3-clause
Yen-Chung-En/2015cdb_g1_0420
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_loader.py
738
49593
import sys import types import unittest class Test_TestLoader(unittest.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################ # "Return a suite of all tests cases contained in the TestCase-derived # class testCaseClass" def te...
gpl-3.0
adrienverge/linux
scripts/gdb/linux/utils.py
509
4833
# # gdb helper commands and functions for Linux kernel debugging # # common utilities # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb class CachedType: def __init__(self, name): s...
gpl-2.0
DeanSherwin/django-dynamic-scraper
dynamic_scraper/models.py
1
17900
#Stage 2 Update (Python 3) from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from builtins import range from builtins import str from builtins import object import datetime from django.db import models from django.db.models import Q @python_2_unicode_compatible clas...
bsd-3-clause
agconti/njode
env/lib/python2.7/site-packages/pip/commands/show.py
344
2767
import os from pip.basecommand import Command from pip.log import logger from pip._vendor import pkg_resources class ShowCommand(Command): """Show information about one or more installed packages.""" name = 'show' usage = """ %prog [options] <package> ...""" summary = 'Show information about in...
bsd-3-clause
saguziel/incubator-airflow
airflow/contrib/operators/dataflow_operator.py
22
9090
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
ericmjl/chameleon
game/player.py
1
3954
from random import choice class Player(object): """ A base Python class to represent game players. """ def __init__(self, chameleon): super(Player, self).__init__() self.hand = [] # the five cards that the player has. self.penalty = [] # the penalty pile that belongs to the pl...
mit
openstack/zaqar
zaqar/conf/opts.py
1
3623
# 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 t...
apache-2.0
nwchandler/ansible
lib/ansible/modules/system/make.py
69
4784
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # # This file is part of Ansible # # 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 ...
gpl-3.0
mgagne/nova
nova/cmd/console.py
37
1284
# Copyright (c) 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
bowang/tensorflow
tensorflow/tools/pip_package/simple_console_for_windows.py
605
1028
# 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
megalithic/wee-slack
wee_slack.py
1
88248
# -*- coding: utf-8 -*- # from functools import wraps import time import json import os import pickle import sha import re import urllib import HTMLParser import sys import traceback import collections import ssl from websocket import create_connection,WebSocketConnectionClosedException # hack to make tests possible...
mit
mikekap/batchy
batchy/clients/memcached.py
1
4404
from collections import defaultdict from itertools import chain from ..compat import iteritems, itervalues from ..runloop import coro_return, runloop_coroutine from ..batch_coroutine import class_batch_coroutine class BatchMemcachedClient(object): def __init__(self, real_client): self.client = real_client...
apache-2.0
int19h/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/sqlite3/dbapi2.py
126
2687
# pysqlite2/dbapi2.py: the DB-API 2.0 interface # # Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this sof...
apache-2.0
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/pandas/tseries/tests/test_frequencies.py
9
25284
from datetime import datetime, time, timedelta from pandas.compat import range import sys import os import nose import numpy as np from pandas import Index, DatetimeIndex, Timestamp, Series, date_range, period_range import pandas.tseries.frequencies as frequencies from pandas.tseries.tools import to_datetime impor...
apache-2.0
LandRegistry/address-search-api
service/es_access.py
1
2191
from elasticsearch import Elasticsearch # type: ignore from elasticsearch_dsl import Search # type: ignore from typing import Any, Dict, List, Tuple, Union from service import app ELASTICSEARCH_ENDPOINT = app.config['ELASTIC_SEARCH_ENDPOINT'] MAX_NUMBER_SEARCH_RESULTS = app.config['MAX_NUMBER_SEARCH_RESULTS'] SE...
mit
mrquim/repository.mrquim
script.kodilogemail/pyaes/util.py
81
2050
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # 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, mod...
gpl-2.0
anryko/ansible
lib/ansible/module_utils/facts/timeout.py
62
2452
# 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 in the hope that ...
gpl-3.0
compas-dev/compas
src/compas_rhino/forms/image.py
1
3344
from __future__ import print_function from __future__ import absolute_import from __future__ import division try: basestring except NameError: basestring = str from compas_rhino.forms.base import BaseForm from System.Windows.Forms import PictureBox from System.Windows.Forms import PictureBoxSizeMode from Sys...
mit
DroneMapp/powerlibs-django-restless-contrib
setup.py
1
1772
import re try: from setuptools import setup except ImportError: from distutils.core import setup version = '0.30.0' def pip_git_to_setuptools_git(url): match = re.match(r'git\+https://github.com/(?P<organization>[^/]+)/(?P<repository>[^/]+).git@(?P<tag>.+)', url.strip()) if match: url = 'htt...
mit
Seek/RayTracing
blender_export/blender_scene_export.py
1
2760
import bpy import bmesh import gzip # Date 12/28/15 # Wrriten for Blender ver. 2.76.2b # This file will serve as a record of how we will transmit data from blender to our raytracer. # These parameters are more or less mirrored information about BlendData types from: # http://www.blender.org/api/blender_python_api_2_76...
mit
Azure/azure-sdk-for-python
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/models/__init__.py
1
5249
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
SpaceGroupUCL/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/community/lukes.py
1
8124
"""Lukes Algorithm for exact optimal weighted tree partitioning.""" from copy import deepcopy from functools import lru_cache from random import choice import networkx as nx from networkx.utils import not_implemented_for __all__ = ["lukes_partitioning"] D_EDGE_W = "weight" D_EDGE_VALUE = 1.0 D_NODE_W = "weight" D_N...
gpl-3.0
p0psicles/SickGear
sickbeard/notifiers/libnotify.py
3
5011
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickGear. # # SickGear 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,...
gpl-3.0
ErasRasmuson/LA
LogTestGen/LogTestGen.py
1
34979
# -*- coding: cp1252 -*- """ ############################################################################### HEADER: LogTestGen.py AUTHOR: Esa Heikkinen DATE: 13.10.2016 DOCUMENT: - VERSION: "$Id$" REFERENCES: - PURPOSE: CHANGES: "$Log$" ##############################################################...
gpl-3.0
dushu1203/chromium.src
remoting/tools/build/remoting_copy_locales.py
142
5150
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper script to repack paks for a list of locales. Gyp doesn't have any built-in looping capability, so this just provides a way t...
bsd-3-clause
ponty/arduino-sketchbook
libacoll/xtests/test_examples.py
1
2094
from nose.tools import eq_, ok_ from path import path from pyavrutils import support, arduino from pyavrutils.arduino import Arduino, ArduinoCompileError import logging root = path(__file__).parent.parent examples = support.find_examples(root) fails = [ ('PWM.pde', 'atmega8'), ] # def check_build(ex, hwpack, bo...
bsd-2-clause
rosmo/boto
boto/ec2/autoscale/limits.py
152
1958
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
dvliman/jaikuengine
.google_appengine/lib/django-1.2/tests/regressiontests/one_to_one_regress/models.py
92
1180
from django.db import models class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) def __unicode__(self): return u"%s the place" % self.name class Restaurant(models.Model): place = models.OneToOneField(Place) serves_hot_dogs = models.B...
apache-2.0
tdautc19841202/SmartQQ-for-Raspberry-Pi
HttpClient.py
5
1871
import cookielib, urllib, urllib2, socket class HttpClient: __cookie = cookielib.CookieJar() __req = urllib2.build_opener(urllib2.HTTPCookieProcessor(__cookie)) __req.addheaders = [ ('Accept', 'application/javascript, */*;q=0.8'), ('User-Agent', 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; ...
gpl-3.0
DavidLi2010/ramcloud
scripts/common.py
7
10155
#!/usr/bin/env python # Copyright (c) 2010 Stanford University # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND T...
isc
szopu/datadiffs
datadiffs/freezing.py
1
1812
from collections import Mapping class frozendict(Mapping): def __init__(self, input): if not isinstance(input, dict): raise TypeError('{0} is not type of dict'.format(type(input))) self.__dict = input.copy() def __getitem__(self, key): return self.__dict[key] def __l...
mit
jorik041/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/config.py
126
6136
# 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 the ...
bsd-3-clause
mne-tools/mne-tools.github.io
0.13/_downloads/plot_stats_cluster_methods.py
6
8607
# doc:slow-example """ .. _tut_stats_cluster_methods: ====================================================== Permutation t-test on toy data with spatial clustering ====================================================== Following the illustrative example of Ridgway et al. 2012, this demonstrates some basic ideas behin...
bsd-3-clause
ashishnitinpatil/django_appengine_project_template
django/core/management/__init__.py
104
15442
import collections import os import sys from optparse import OptionParser, NO_DEFAULT import imp from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.core.management.color import color_style from django.utils.impor...
bsd-2-clause