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
BeATz-UnKNoWN/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/base_test.py
94
13455
#!/usr/bin/python # # Copyright (C) 2006 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
Stratos42/EveBot
plugins.disabled/bf.py
1
2472
'''brainfuck interpreter adapted from (public domain) code at http://brainfuck.sourceforge.net/brain.py''' import re import random from util import hook BUFFER_SIZE = 5000 MAX_STEPS = 1000000 @hook.command def bf(inp): ".bf <prog> -- executes brainfuck program <prog>""" program = re.sub('[^][<>+-.,]', ''...
gpl-3.0
koala-ai/tensorflow_nlp
nlp/chatbot/model.py
1
10775
import copy import numpy as np import tensorflow as tf from nlp.chatbot.dataset import data_utils class S2SModel(object): def __init__(self, source_vocab_size, target_vocab_size, buckets, size, dropout, num_layers, ...
apache-2.0
bernardokyotoku/skillplant
django/db/models/aggregates.py
12
2168
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra ...
bsd-3-clause
Alwnikrotikz/pyglet
tools/genmpkg/bdist_mpkg_pyglet/pkg.py
26
6256
import os import sys from cStringIO import StringIO from distutils.dir_util import mkpath from distutils.file_util import copy_file from bdist_mpkg_pyglet import tools, plists from bdist_mpkg_pyglet.util import copy_tree from bdist_mpkg_pyglet.templates import InstallationCheck def write_template((script, strings), d...
bsd-3-clause
laosiaudi/tensorflow
tensorflow/python/ops/functional_ops.py
8
23708
# 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
liosha2007/temporary-groupdocs-python-sdk
groupdocs/models/GetJobsDocumentsResponse.py
1
1166
#!/usr/bin/env python """ Copyright 2012 GroupDocs. 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
dbbhattacharya/kitsune
vendor/packages/translate-toolkit/translate/convert/symb2po.py
7
3784
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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...
bsd-3-clause
krinart/AutobahnPython
autobahn/autobahn/wamp/protocol.py
4
42459
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/test/test_coding.py
121
1212
import test.test_support, unittest import os class CodingTest(unittest.TestCase): def test_bad_coding(self): module_name = 'bad_coding' self.verify_bad_module(module_name) def test_bad_coding2(self): module_name = 'bad_coding2' self.verify_bad_module(module_name) def veri...
mit
nickweinberg/werewolf-slackbot
test_fixtures.py
1
2584
import copy def get_empty_game_state(): # hi there # make mock game state. # we'll have several fixtures # and a basic one we can set up in each test. return {'players':{}, 'votes':{}, 'STATUS': 'INACTIVE', 'ROUND': None } def all_vote_but_one_state():...
mit
2014c2g4/c2g4
wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/testmock/testmagicmethods.py
737
12145
import unittest import inspect import sys from unittest.mock import Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) mock.__getitem__ = Mock() self.asser...
gpl-2.0
filip-be/ImageComparer
exiv2/exiv2/doc/templates/gen.py
8
1538
#! /usr/bin/env python # ---------------------------------------------------------------------- # Settings vardir = "." date_format = "%d-%b-%Y" # ---------------------------------------------------------------------- # functions def usage(): print("""Usage: gen.py file.in [...] Substitute placeholders in input ...
gpl-3.0
marco-lancini/Showcase
django/contrib/localflavor/ch/forms.py
55
3882
""" Swiss-specific Form helpers """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import ugettext_lazy as _ import re id_re = re.compile(r"...
mit
manashmndl/kivy
kivy/uix/colorpicker.py
20
15505
''' Color Picker ============ .. versionadded:: 1.7.0 .. warning:: This widget is experimental. Its use and API can change at any time until this warning is removed. The ColorPicker widget allows a user to select a color from a chromatic wheel where pinch and zoom can be used to change the wheel's saturati...
mit
SamaraCardoso27/eMakeup
backend/venv/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.py
164
27956
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime import distutils.util from email import message_from_file...
mit
FeodorFitsner/coala
coalib/processes/BearRunning.py
2
24835
import queue import traceback from collections import Iterable from coalib.bears.BEAR_KIND import BEAR_KIND from coalib.bears.GlobalBear import GlobalBear from coalib.bears.LocalBear import LocalBear from coalib.misc.Constants import Constants from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT from coalib.pr...
agpl-3.0
rbuffat/pyepw
tests/test_typical_or_extreme_periods.py
1
2262
import os import tempfile import unittest from pyepw.epw import TypicalOrExtremePeriods, TypicalOrExtremePeriod, EPW class TestTypicalOrExtremePeriods(unittest.TestCase): def setUp(self): self.fd, self.path = tempfile.mkstemp() def tearDown(self): os.remove(self.path) def test_create_ty...
apache-2.0
alxgu/ansible
lib/ansible/modules/cloud/google/gcp_sql_database_facts.py
9
4766
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
3dfxsoftware/cbss-addons
project_phase_description/model/project_phase.py
1
1240
# -*- encoding: utf-8 -*- # # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/ # All Rights Reserved. # info Vauxoo (info@vauxoo.com) # # Coded by: Jorge Angel Naranjo (jorge_nr@vauxoo.com) # # # This program is free software: you can red...
gpl-2.0
crosswalk-project/blink-crosswalk
Tools/Scripts/webkitpy/layout_tests/port/builders.py
6
5428
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
wonder-sk/QGIS
python/ext-libs/pygments/console.py
49
1850
# -*- coding: utf-8 -*- """ pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" cod...
gpl-2.0
prov-suite/interop-test-harness
prov_interop/provman/converter.py
1
5717
"""Manages invocation of ProvScala `provmanagement` script. """ # Copyright (c) 2015 University of Southampton # # 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, # includi...
mit
mermi/bedrock
bedrock/settings/__init__.py
5
2988
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import sys from .base import * # noqa if os.getenv('TRAVIS', False): from .travis import * # noqa elif...
mpl-2.0
UnrememberMe/pants
contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/pyflakes.py
6
2011
# 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) from pyflakes.checke...
apache-2.0
cwisecarver/osf.io
addons/base/logger.py
39
2120
import abc class AddonNodeLogger(object): """Helper class for adding correctly-formatted addon logs to nodes. :param Node node: The node to add logs to :param Auth auth: Authorization of the person who did the action. """ __metaclass__ = abc.ABCMeta @abc.abstractproperty def addon_short_n...
apache-2.0
evanma92/routeh
flask/lib/python2.7/site-packages/whoosh/query/spans.py
30
28812
# Copyright 2010 Matt Chaput. 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
eRestin/Mezz
mhnweb/settings.py
1
12829
ALLOWED_HOSTS = ['*'] ###################### # MEZZANINE SETTINGS # ###################### # The following settings are already defined with default values in # the ``defaults.py`` module within each of Mezzanine's apps, but are # common enough to be put here, commented out, for convenient # overriding. Please consult...
bsd-2-clause
ldirer/scikit-learn
examples/classification/plot_lda_qda.py
32
5381
""" ==================================================================== Linear and Quadratic Discriminant Analysis with covariance ellipsoid ==================================================================== This example plots the covariance ellipsoids of each class and decision boundary learned by LDA and QDA. The...
bsd-3-clause
wwj718/edx-platform
openedx/core/djangoapps/programs/models.py
1
3607
"""Models providing Programs support for the LMS and Studio.""" from collections import namedtuple from urlparse import urljoin from django.utils.translation import ugettext_lazy as _ from django.db import models from config_models.models import ConfigurationModel AuthoringAppConfig = namedtuple('AuthoringAppConfig...
agpl-3.0
quaddra/engage-utils
engage_utils/test_wakeable_queue.py
1
5086
"""Test the wakeable_queue.Queue class """ import unittest import os import sys import random import logging import threading from time import sleep logger = logging.getLogger(__name__) from wakeable_queue import Queue, AbortRequested, WakeableQueueWorker, WorkerStatus random.seed() STOP_MSG = [] class Worker(Wak...
apache-2.0
hopeall/odoo
addons/l10n_us/__init__.py
893
1045
# -*- 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
tavallaie/RoboDynamixel
dxl/dxlregisters.py
1
1221
#!/usr/bin/env python # Dynamixel library for MX28 and MX64 # WINDOWS WARNING: For best performance, parameters of the COM Port should be set to maximum baud rate, and 1ms delay (Device Manager, COM Ports, properties, advanced) class DxlRegister(): def __init__(self,address,size,mode='r',eeprom=Fa...
mit
trmznt/genaf
genaf/views/utils/plot.py
1
3274
# general plot / graphics utility using matplotlib from genaf.views.tools import * from matplotlib import pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure import pandas import io, base64 @roles( PUBLIC ) def index(request): # check...
lgpl-3.0
yufengg/tensorflow
tensorflow/contrib/labeled_tensor/__init__.py
144
4001
# 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
Azure/azure-sdk-for-python
sdk/confidentialledger/azure-mgmt-confidentialledger/azure/mgmt/confidentialledger/aio/_configuration.py
1
3287
# 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
mzupan/Diamond
src/collectors/filestat/test/testfilestat.py
31
1836
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO except ImportError: fr...
mit
RO-ny9/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_build_ext.py
46
17712
import sys import os from io import StringIO import textwrap from distutils.core import Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig from distutils.tests.support import (TempdirManager, LoggingSilencer, copy_xxmodule_c, fixup_build_...
apache-2.0
Osndok/zim-desktop-wiki
zim/plugins/tasklist/__init__.py
1
8109
# -*- coding: utf-8 -*- # Copyright 2009-2017 Jaap Karssenberg <jaap.karssenberg@gmail.com> # TODO: allow more complex queries for filter, in particular (NOT tag AND tag) # allow multiple tabs in dialog / side pane with configurable query # # TODO: add an interface for this plugin in the WWW frontend # # TODO: ...
gpl-2.0
dchen1107/test-infra
kettle/make_json.py
3
7347
#!/usr/bin/env python # Copyright 2017 The Kubernetes Authors. # # 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 appli...
apache-2.0
jxzhxch/androguard
androdd.py
37
9441
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012/2013, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard 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 Founda...
apache-2.0
psolstice/zcoin
qa/rpc-tests/getblocktemplate_proposals.py
101
5726
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from bi...
mit
turdusmerula/kipartman
kipartbase/swagger_server/controllers/controller_upload_file.py
1
1796
import connexion from swagger_server.models.upload_file import UploadFile from swagger_server.models.upload_file_data import UploadFileData from swagger_server.models.error import Error from datetime import date, datetime from typing import List, Dict from six import iteritems from ..util import deserialize_date, dese...
gpl-3.0
frreiss/tensorflow-fred
tensorflow/lite/testing/op_tests/neg.py
17
1918
# Copyright 2019 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
mikelolasagasti/revelation
src/lib/ui.py
1
48073
# # Revelation - a password manager for GNOME 2 # http://oss.codepoet.no/revelation/ # $Id$ # # Module for UI functionality # # # Copyright (c) 2003-2006 Erik Grinaker # # 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 Fr...
gpl-2.0
ric2b/Vivaldi-browser
chromium/third_party/blink/web_tests/external/wpt/mathml/tools/utils/misc.py
7
1200
from __future__ import print_function import os import progressbar try: from urllib.request import urlopen except ImportError: from urllib2 import urlopen UnicodeXMLURL = "https://mathml-refresh.github.io/xml-entities/unicode.xml" InlineAxisOperatorsURL = "https://mathml-refresh.github.io/mathml-core/tables/in...
bsd-3-clause
aachik/flask-blog-abdulmx
env/lib/python2.7/site-packages/flask/_compat.py
783
2164
# -*- coding: utf-8 -*- """ flask._compat ~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import sys PY...
mit
c0710204/edx-platform
cms/djangoapps/contentstore/features/video.py
16
8655
# pylint: disable=C0111 from lettuce import world, step from selenium.webdriver.common.keys import Keys from xmodule.modulestore.django import modulestore VIDEO_BUTTONS = { 'CC': '.hide-subtitles', 'volume': '.volume', 'play': '.video_control.play', 'pause': '.video_control.pause', 'handout': '.vi...
agpl-3.0
nanolearningllc/edx-platform-cypress
openedx/core/djangoapps/credit/api/provider.py
21
15424
""" API for initiating and tracking requests for credit from a provider. """ import datetime import logging import pytz import uuid from django.db import transaction from lms.djangoapps.django_comment_client.utils import JsonResponse from openedx.core.djangoapps.credit.exceptions import ( UserIsNotEligible, ...
agpl-3.0
batxes/4Cin
Six_zebra_models/Six_zebra_models_final_output_0.1_-0.1_13000/mtx1_models/Six_zebra_models33593.py
4
13932
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
callmealien/wazimap_zambia
censusreporter/apps/census/models.py
9
5579
from django.db import models class Table(models.Model): table_id = models.CharField(max_length=8) table_name = models.CharField(max_length=255) table_universe = models.CharField(max_length=128) table_size = models.IntegerField() subject_area = models.CharField(max_length=32) topics = models.Cha...
mit
conklinbd/MovementAnalysis
TemplateInstall/PortalDeploy/arcrest/ags/featureservice.py
1
15911
""" Contains information regarding an ArcGIS Server Feature Server """ from re import search from .._abstract.abstract import BaseAGSServer, BaseSecurityHandler from ..security import security import layer import json from ..common.geometry import SpatialReference from ..common.general import FeatureSet from ..commo...
apache-2.0
popazerty/blackhole-vuplus
lib/python/Components/ScrollLabel.py
21
5642
import skin from HTMLComponent import HTMLComponent from GUIComponent import GUIComponent from enigma import eLabel, eWidget, eSlider, fontRenderClass, ePoint, eSize class ScrollLabel(HTMLComponent, GUIComponent): def __init__(self, text=""): GUIComponent.__init__(self) self.message = text self.instance = None ...
gpl-2.0
cctaylor/googleads-python-lib
examples/dfp/v201505/user_service/get_all_users.py
3
1658
#!/usr/bin/python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
2014cdbg17/2015cd_midterm2
static/Brython3.1.0-20150301-090019/Lib/multiprocessing/__init__.py
693
6866
# # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.dummy' has the same API but is a simple # wrapper for 't...
gpl-3.0
turbokongen/home-assistant
tests/components/pilight/test_init.py
3
14678
"""The tests for the pilight component.""" from datetime import timedelta import logging import socket from unittest.mock import patch from voluptuous import MultipleInvalid from homeassistant.components import pilight from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util ...
apache-2.0
bclau/nova
nova/tests/cells/test_cells_manager.py
9
37403
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
Lekanich/intellij-community
python/lib/Lib/encodings/cp437.py
593
34820
""" Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
apache-2.0
wbonnet/lffs
toolkit/dft/build_firmware_update.py
1
8151
# # The contents of this file are subject to the Apache 2.0 license you may not # use this file except in compliance with the License. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language gov...
apache-2.0
slevenhagen/odoo
openerp/addons/base/ir/ir_translation.py
117
24047
# -*- coding: 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 GNU...
agpl-3.0
fiji-flo/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treeadapters/sax.py
1835
1661
from __future__ import absolute_import, division, unicode_literals from xml.sax.xmlreader import AttributesNSImpl from ..constants import adjustForeignAttributes, unadjustForeignAttributes prefix_mapping = {} for prefix, localName, namespace in adjustForeignAttributes.values(): if prefix is not None: pre...
mpl-2.0
vthirumalai/cinder-violin-driver-juno
cinder/tests/fake_vmem_xgtools_client.py
2
1899
# Copyright 2014 Violin Memory, 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 requi...
apache-2.0
badlogicmanpreet/nupic
examples/opf/clients/hotgym/anomaly/one_gym/nupic_anomaly_output.py
49
9450
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
wd5/jangr
django/db/backends/creation.py
47
22033
import sys import time from django.conf import settings # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation(object): """ This class encapsulates all backend-specific differences that pertain to database *creation*, ...
bsd-3-clause
diegoguimaraes/django
django/contrib/gis/db/backends/postgis/creation.py
34
4625
from django.conf import settings from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation from django.utils.functional import cached_property class PostGISCreation(DatabaseCreation): geom_index_type = 'GIST' geom_index_ops = 'GIST_GEOMETRY_OPS' geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND...
bsd-3-clause
AndrewSmart/audacity
lib-src/lv2/serd/waflib/Tools/ifort.py
330
1460
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import re from waflib import Utils from waflib.Tools import fc,fc_config,fc_scan,ar from waflib.Configure import conf @conf def find_ifort(conf): fc=conf.find_program('ifort'...
gpl-2.0
fredericlepied/ansible
lib/ansible/modules/net_tools/snmp_facts.py
9
12847
#!/usr/bin/python # This file is part of Networklore's snmp library for Ansible # 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.0', ...
gpl-3.0
GoogleContainerTools/distroless
package_manager/version_utils.py
2
7668
# Copyright [2017] The Climate Corporation (https://climate.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-2.0 # # Unless required by a...
apache-2.0
rduivenvoorde/QGIS
tests/src/python/test_qgslayoutnortharrowhandler.py
31
5552
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutNorthArrowHandler. .. note:: 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 ver...
gpl-2.0
freesmartphone/framework
framework/subsystems/testing/testing.py
1
4159
#!/usr/bin/env python """ Dummy Subsystem for Testing Purposes (C) 2008-2009 Michael 'Mickey' Lauer <mlauer@vanille-media.de> (C) 2008 Openmoko, Inc. GPLv2 or later Package: testing Module: testing """ MODULE_NAME = "testing" __version__ = "0.0.0" from framework import resource import dbus import dbus.service impo...
gpl-2.0
JohnDevitt/appengine-django-skeleton-master
lib/django/db/backends/utils.py
430
6689
from __future__ import unicode_literals import datetime import decimal import hashlib import logging from time import time from django.conf import settings from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') class CursorWrapper(object...
bsd-3-clause
larsmans/scipy
scipy/sparse/linalg/matfuncs.py
30
25870
""" Sparse matrix functions """ # # Authors: Travis Oliphant, March 2002 # Anthony Scopatz, August 2012 (Sparse Updates) # Jake Vanderplas, August 2012 (Sparse Updates) # from __future__ import division, print_function, absolute_import __all__ = ['expm', 'inv'] import math import numpy as np imp...
bsd-3-clause
victorbriz/rethinkdb
external/v8_3.30.33.16/buildtools/checkdeps/java_checker.py
46
4264
# 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. """Checks Java files for illegal imports.""" import codecs import os import re import results from rules import Rule class JavaChecker(object): """...
agpl-3.0
ben-e-whitney/the-points-chart
utilities/views.py
1
2100
from django.shortcuts import render import decimal class TableElement: """ Represent an individual cell of an HTML table. """ def __init__(self, title=None, CSS_classes=None, content=None): self.title = title self.CSS_classes = CSS_classes self.content = content class TablePa...
gpl-3.0
baby2710/plugin.video.zeta
vipracing.py
186
18923
import math import urllib, urllib2 import re def vip_unlockmeta(meta): d='' for i in range(0, len(meta)): if (i % 3 == 0): d += "%"; else: d += meta[i]; return urllib.unquote(d); def get_html(meta,data): meta_un=vip_unlockmeta(meta) # print meta_un; # return oo='' x=data l = len(x) b = 1024.0 i, j,...
gpl-2.0
untom/scikit-learn
sklearn/kernel_approximation.py
258
17973
""" The :mod:`sklearn.kernel_approximation` module implements several approximate kernel feature maps base on Fourier transforms. """ # Author: Andreas Mueller <amueller@ais.uni-bonn.de> # # License: BSD 3 clause import warnings import numpy as np import scipy.sparse as sp from scipy.linalg import svd from .base im...
bsd-3-clause
ChristineLaMuse/mozillians
vendor-local/lib/python/celery/tests/functional/case.py
14
5433
from __future__ import absolute_import import atexit import logging import os import signal import socket import sys import traceback from itertools import count from time import time from celery.exceptions import TimeoutError from celery.task.control import ping, flatten_reply, inspect from celery.utils import qual...
bsd-3-clause
OpenBeta/beta
apiserver/model.py
1
9792
from flask_sqlalchemy import SQLAlchemy from sqlalchemy.dialects import postgresql from geoalchemy2 import Geometry from sqlalchemy import func, ForeignKey, PrimaryKeyConstraint, event, Sequence from sqlalchemy.schema import DropTable from sqlalchemy.ext.compiler import compiles import flask_login from datetime import ...
gpl-3.0
SINGROUP/pycp2k
pycp2k/classes/_each304.py
1
1114
from pycp2k.inputsection import InputSection class _each304(InputSection): def __init__(self): InputSection.__init__(self) self.Just_energy = None self.Powell_opt = None self.Qs_scf = None self.Xas_scf = None self.Md = None self.Pint = None self.Meta...
lgpl-3.0
flotre/Sick-Beard
lib/hachoir_parser/container/swf.py
90
15001
""" SWF (Macromedia/Adobe Flash) file parser. Documentation: - Alexis' SWF Reference: http://www.m2osw.com/swf_alexref.html - http://www.half-serious.com/swf/format/ - http://www.anotherbigidea.com/javaswf/ - http://www.gnu.org/software/gnash/ Author: Victor Stinner Creation date: 29 october 2006 """ from li...
gpl-3.0
xia2/xia2
src/xia2/Wrappers/Dials/EstimateGain.py
1
1399
from xia2.Driver.DriverFactory import DriverFactory from xia2.Schema.Interfaces.FrameProcessor import FrameProcessor def EstimateGain(DriverType=None): """A factory for EstimateGainWrapper classes.""" DriverInstance = DriverFactory.Driver(DriverType) class EstimateGainWrapper(DriverInstance.__class__, F...
bsd-3-clause
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/test/test_pprint.py
51
26585
import pprint import test.support import unittest import test.test_set import random import collections import itertools # list, tuple and dict subclasses that do or don't overwrite __repr__ class list2(list): pass class list3(list): def __repr__(self): return list.__repr__(self) class tuple2(tuple):...
apache-2.0
arokem/nipy
nipy/labs/datasets/volumes/volume_field.py
6
7703
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The base volumetric field interface This defines the nipy volumetric structure interface. """ from ..transforms.transform import CompositionError #####################################################...
bsd-3-clause
salaria/odoo
addons/stock_landed_costs/stock_landed_costs.py
19
19556
# -*- 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
yueyongyue/saltshaker
shaker/highstate.py
1
1467
import os class HighState(object): def __init__(self): if os.path.isfile('/etc/salt/master.d/file_roots.conf') == True: os.system("mkdir -p /srv/salt") else: file_roots = file("/etc/salt/master.d/file_roots.conf", "w+") add = ["file_roots:\n", " base:\n", " -...
apache-2.0
feigames/Odoo
addons/website/models/ir_qweb.py
8
19146
# -*- coding: utf-8 -*- """ Website-context rendering needs to add some metadata to rendered fields, as well as render a few fields differently. Also, adds methods to convert values back to openerp models. """ import cStringIO import datetime import itertools import logging import os import urllib2 import urlparse im...
agpl-3.0
chiragjogi/odoo
addons/hr_timesheet_sheet/__init__.py
434
1127
# -*- 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...
agpl-3.0
mkollaro/destroystack
destroystack/tools/server_manager.py
1
7151
# Copyright (c) 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
Som-Energia/invoice-janitor
invoicing/f1fixing/import_error/models.py
1
24323
# -*- coding: utf-8 -*- from lxml import etree, objectify import base64 import re import os from datetime import datetime import dateutil.parser import xmlformatter ## Codis OCSUM - F1 # Codi periode codigoPeriodo_to_P = { 1:'P1', 03:'P2',10:'P1',21:'P1',22:'P2',31:'P1',32:'P2',33:'P3',41:'P1', 42:'P...
agpl-3.0
zstackorg/zstack-woodpecker
integrationtest/vm/virt_plus/qos/test_del_data_vol_rw_qos.py
1
4158
''' This case can not execute parallelly @author: Legion ''' import os import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.host_operations as host_ops import zstackwoodpecker.operations.resource_...
apache-2.0
noba3/KoTos
addons/script.module.myconnpy/lib/mysql/connector/conversion.py
13
15618
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
gpl-2.0
sve-odoo/odoo
addons/l10n_fr_hr_payroll/__openerp__.py
374
2165
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
StephenWeber/ansible
lib/ansible/plugins/action/net_template.py
83
3775
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
nkgilley/home-assistant
tests/components/hue/conftest.py
7
3105
"""Test helpers for Hue.""" from collections import deque from aiohue.groups import Groups from aiohue.lights import Lights from aiohue.sensors import Sensors import pytest from homeassistant import config_entries from homeassistant.components import hue from homeassistant.components.hue import sensor_base as hue_sen...
apache-2.0
Kayoku/iotari
work-area/wireless-sensor/sensor.py
1
2978
import datetime import json from pprint import pprint import requests class Sensor(): """Abstract sensor class.""" def __init__(self, uuid): """Initialisation.""" # find a way to get a stable name self.uuid = uuid def save_measure(self): """How to save a ne...
mit
ContinuumIO/dask
dask/dataframe/accessor.py
2
5362
import numpy as np import pandas as pd from functools import partial from ..utils import derived_from def maybe_wrap_pandas(obj, x): if isinstance(x, np.ndarray): if isinstance(obj, pd.Series): return pd.Series(x, index=obj.index, dtype=x.dtype) return pd.Index(x) return x class...
bsd-3-clause
indictranstech/osmosis-frappe
frappe/core/report/todo/todo.py
44
1373
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.desk.reportview import execute as runreport from frappe.utils import getdate def execute(filters=None): priority_map = {"High": 3,...
mit
jk1/intellij-community
python/helpers/pydev/tests_pydevd/test_jyserver.py
11
4259
''' @author Fabio Zadrozny ''' import sys import unittest import socket import urllib import pytest import pycompletionserver IS_JYTHON = sys.platform.find('java') != -1 DEBUG = 0 def dbg(s): if DEBUG: sys.stdout.write('TEST %s\n' % s) @pytest.mark.skipif(not IS_JYTHON, reason='Jython related test') cla...
apache-2.0
fakdora/flaksy-upto-login
app/main/views.py
1
3865
from flask import render_template, redirect, url_for, abort, flash, request,\ current_app from flask.ext.login import login_required, current_user from . import main from .forms import EditProfileForm, EditProfileAdminForm, PostForm from .. import db from ..models import Permission, Role, User, Post from ..decorato...
mit
rafiqsaleh/VERCE
verce-hpc-pe/src/dispel4py/examples/graph_testing/word_count_filter.py
4
1093
# Copyright (c) The University of Edinburgh 2014 # # 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 agr...
mit