repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
INTERACT-IV/sockjs-twisted
txsockjs/factory.py
1
6498
# Copyright (c) 2012, Christopher Gamble # 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 condition...
bsd-3-clause
nborggren/zipline
tests/test_munge.py
34
1794
# # Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
zhang0137/chromite
lib/parallel_unittest.py
2
7647
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import contextlib import multiprocessing import os import sys import tempfile import time import Queue sys.path.insert(0, os.path.a...
bsd-3-clause
AutorestCI/azure-sdk-for-python
azure-mgmt-resource/azure/mgmt/resource/resources/v2016_09_01/models/tag_details.py
2
1516
# 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 ...
mit
nico-izo/kobato
kobato/tests/templates/test_post.py
1
4615
import unittest from kobato.template import render class TestRenderPost(unittest.TestCase): def test_render_post(self): post_obj = { 'post': { 'author': { 'login': 'test_user' }, 'comments_count': 3, 'created'...
gpl-3.0
lnielsen/invenio
invenio/base/testsuite/test_scripts_config.py
3
4749
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2014 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
shakamunyi/tensorflow
tensorflow/python/debug/lib/dist_session_debug_grpc_test.py
50
8619
# 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
Kalyzee/edx-platform
lms/djangoapps/shoppingcart/migrations/0019_auto__add_donationconfiguration.py
120
16295
# -*- coding: 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 model 'DonationConfiguration' db.create_table('shoppingcart_donationconfiguration', ( (...
agpl-3.0
jenalgit/flask
docs/conf.py
140
9573
# -*- coding: utf-8 -*- # # Flask documentation build configuration file, created by # sphinx-quickstart on Tue Apr 6 15:24:58 2010. # # 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 # autogenerated file. # # All c...
bsd-3-clause
rui-castro/Sick-Beard
lib/bs4/builder/_html5lib.py
119
7746
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableStr...
gpl-3.0
slyphon/pants
src/python/pants/backend/jvm/subsystems/jar_tool.py
7
1730
# 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 pants.backend.j...
apache-2.0
sanjeevtripurari/hue
desktop/core/ext-py/kazoo-2.0/kazoo/tests/test_lock.py
36
16235
import uuid import threading from nose.tools import eq_, ok_ from kazoo.exceptions import CancelledError from kazoo.exceptions import LockTimeout from kazoo.testing import KazooTestCase from kazoo.tests.util import wait class KazooLockTests(KazooTestCase): def setUp(self): super(KazooLockTests, self).se...
apache-2.0
PetePriority/home-assistant
tests/components/config/test_device_registry.py
1
2566
"""Test device_registry API.""" import pytest from homeassistant.components.config import device_registry from tests.common import mock_device_registry @pytest.fixture def client(hass, hass_ws_client): """Fixture that can interact with the config manager API.""" hass.loop.run_until_complete(device_registry.a...
apache-2.0
dhruvsrivastava/OJ
flask/lib/python2.7/site-packages/requests/packages/chardet/euckrprober.py
2931
1675
######################## 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. # # Con...
bsd-3-clause
neilhan/tensorflow
tensorflow/contrib/bayesflow/python/ops/stochastic_variables.py
9
6154
# 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
yelongyu/chihu
venv/lib/python2.7/site-packages/mako/codegen.py
61
48384
# mako/codegen.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides functionality for rendering a parsetree constructing into module source code.""" impo...
gpl-3.0
tianweizhang/nova
nova/virt/hyperv/hostops.py
8
7144
# Copyright 2012 Cloudbase Solutions Srl # 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 r...
apache-2.0
mcrowson/django
django/contrib/gis/db/models/functions.py
209
15213
from decimal import Decimal from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import AreaField from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.measure import ( Area as AreaMeasure, Distance as DistanceMeasure, ) from django.core.ex...
bsd-3-clause
ncclient/ncclient
ncclient/devices/default.py
2
9667
""" Handler for default device information. Some devices require very specific information and action during client interaction. The "device handlers" provide a number of callbacks that return the necessary information. This allows the ncclient code to merely call upon this device handler - once configured - instead ...
apache-2.0
marcsans/cnn-physics-perception
phy/lib/python2.7/site-packages/sklearn/feature_selection/base.py
119
4187
# -*- coding: utf-8 -*- """Generic feature selection mixin""" # Authors: G. Varoquaux, A. Gramfort, L. Buitinck, J. Nothman # License: BSD 3 clause from abc import ABCMeta, abstractmethod from warnings import warn import numpy as np from scipy.sparse import issparse, csc_matrix from ..base import TransformerMixin f...
mit
fdvarela/odoo8
addons/account/wizard/account_period_close.py
341
2646
# -*- 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
zyga/guacamole
examples/rainbow.py
1
8164
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2015, Canonical Ltd. # 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 copyrig...
gpl-3.0
alexandrucoman/vbox-nova-driver
nova/tests/unit/api/ec2/test_middleware.py
11
8067
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
apache-2.0
Glasgow2015/team-10
env/lib/python2.7/site-packages/reversion/south_migrations/0001_initial.py
15
6489
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() class Migration(Sche...
apache-2.0
chirilo/bedrock
bedrock/firefox/tests/test_firefox_details.py
12
14106
# -*- coding: utf-8 -*- # 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 from urlparse import parse_qsl, urlparse from django.conf import settings from django....
mpl-2.0
hendradarwin/VTK
Common/Core/Testing/Python/TestNumpySupport.py
6
4853
"""Test if the NumPy array support for VTK data arrays works correctly. The test requires that numpy (http://numpy.scipy.org) work. Run this test like so: $ vtkpython TestNumpySupport.py or $ python TestNumpySupport.py """ import sys import vtk from vtk.test import Testing try: import numpy except ImportError:...
bsd-3-clause
rui-castro/Sick-Beard
sickbeard/notifiers/libnotify.py
14
4460
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
MIPS/external-chromium_org-tools-gyp
test/variables/filelist/gyptest-filelist.py
102
1583
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test variable expansion of '<|(list.txt ...)' syntax commands. """ import os import sys import TestGyp test = TestGyp.TestGyp(format=...
bsd-3-clause
Jumpscale/web
pythonlib/gdata/test_config.py
72
17854
#!/usr/bin/env python # Copyright (C) 2009 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 l...
apache-2.0
dhalleine/tensorflow
tensorflow/python/framework/errors_test.py
19
3496
# 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
aparrish/everywordbot
everywordbot.py
1
5317
import tweepy import os class EverywordBot(object): def __init__(self, consumer_key, consumer_secret, access_token, token_secret, source_file_name, index_file_name, lat=None, long=None, place_id=None, prefix=None, suffix=None, bbox=None, ...
mit
DefyVentures/edx-platform
common/djangoapps/util/tests/test_milestones_helpers.py
15
3459
""" Tests for the milestones helpers library, which is the integration point for the edx_milestones API """ from mock import patch from util import milestones_helpers from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory @patch.dict('djan...
agpl-3.0
Jgarcia-IAS/SAT
openerp/addons/stock/res_config.py
115
8115
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
SickRage/subliminal
subliminal/utils.py
36
4070
# -*- coding: utf-8 -*- from datetime import datetime import hashlib import os import re import struct def hash_opensubtitles(video_path): """Compute a hash using OpenSubtitles' algorithm. :param str video_path: path of the video. :return: the hash. :rtype: str """ bytesize = struct.calcsize...
mit
willhardy/django
django/core/files/uploadedfile.py
48
4318
""" Classes representing uploaded files. """ import errno import os from io import BytesIO from django.conf import settings from django.core.files import temp as tempfile from django.core.files.base import File from django.utils.encoding import force_str __all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryU...
bsd-3-clause
Kiiv/CouchPotatoServer
couchpotato/core/media/_base/searcher/__init__.py
20
3166
from .main import Searcher def autoload(): return Searcher() config = [{ 'name': 'searcher', 'order': 20, 'groups': [ { 'tab': 'searcher', 'name': 'searcher', 'label': 'Basics', 'description': 'General search options', 'options': [ ...
gpl-3.0
rspavel/spack
var/spack/repos/builtin/packages/m4/package.py
1
3026
# 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) import re class M4(AutotoolsPackage, GNUMirrorPackage): """GNU M4 is an implementation of the traditional Unix macro...
lgpl-2.1
mairin/anaconda
tests/kickstart_tests/version_test.py
4
2176
#!/usr/bin/python # # Copyright (C) 2013 Red Hat, Inc. # # This program 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 2.1 of the License, or # (at your option) any later version. # # T...
gpl-2.0
bkirui/odoo
addons/point_of_sale/point_of_sale.py
16
77943
# -*- 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
Glasgow2015/team-10
env/lib/python2.7/site-packages/django/contrib/flatpages/forms.py
143
2036
from django import forms from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext, ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text=_("E...
apache-2.0
dawnpower/nova
nova/tests/unit/api/openstack/fakes.py
7
22326
# Copyright 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 requ...
apache-2.0
sclabs/sccms-nonrel
django/utils/unittest/result.py
570
6105
"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from django.utils.unittest import util from django.utils.unittest.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'fail...
bsd-3-clause
adam111316/SickGear
lib/unidecode/x0ff.py
252
3983
data = ( '[?]', # 0x00 '!', # 0x01 '"', # 0x02 '#', # 0x03 '$', # 0x04 '%', # 0x05 '&', # 0x06 '\'', # 0x07 '(', # 0x08 ')', # 0x09 '*', # 0x0a '+', # 0x0b ',', # 0x0c '-', # 0x0d '.', # 0x0e '/', # 0x0f '0', # 0x10 '1', # 0x11 '2', # 0x12 '3', # 0x13 '4', ...
gpl-3.0
xorobabel/dagbok
dagbok/__init__.py
1
1731
from flask import Flask, render_template, redirect, url_for, send_from_directory from views.admin import admin from models import Entry from sqlalchemy.sql import extract app = Flask(__name__) app.config.from_pyfile('dagbok.cfg') app.register_blueprint(admin, url_prefix='/admin') app.debug = True @app.route('/<path:r...
gpl-2.0
napsternxg/gensim
gensim/test/test_summarization.py
1
11583
#!/usr/bin/env python # encoding: utf-8 # # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated test to reproduce the results of Mihalcea and Tarau (2004). Mihalcea and Tarau (2004) introduces the TextRank summarization algorithm. As a validation of the gensim implementation we repr...
gpl-3.0
karaariana/slideviewer_new
slideviewer/slideviewer.py
1
6274
""" Google Document XBlock implementation """ # -*- coding: utf-8 -*- # # Imports ########################################################### import logging import textwrap import requests import re from xblock.core import XBlock from xblock.fields import Scope, String, Integer from xblock.fragment import Fragment f...
agpl-3.0
amohanta/barf-project
barf/barf/core/disassembler.py
7
1763
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky # 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 condit...
bsd-2-clause
andrewsmedina/django
tests/comment_tests/tests/test_app_api.py
58
2664
from __future__ import absolute_import from django.conf import settings from django.contrib import comments from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.core.exceptions import ImproperlyConfigured from django.test.utils import override_settings fr...
bsd-3-clause
andrewsmedina/django
django/contrib/comments/views/moderation.py
210
5204
from __future__ import absolute_import from django import template from django.conf import settings from django.contrib import comments from django.contrib.auth.decorators import login_required, permission_required from django.contrib.comments import signals from django.contrib.comments.views.utils import next_redirec...
bsd-3-clause
mozilla/stoneridge
python/src/Lib/test/test_popen2.py
83
4338
#! /usr/bin/env python """Test script for popen2.py""" import warnings warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*", DeprecationWarning) warnings.filterwarnings("ignore", "os\.popen. is deprecated.*", DeprecationWarning) import os import sys impor...
mpl-2.0
torchingloom/edx-platform
lms/djangoapps/branding/tests.py
10
2744
""" Tests for branding page """ import datetime from pytz import UTC from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.test.utils import override_settings from django.test.client import RequestFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase...
agpl-3.0
nicolargo/glances
glances/plugins/glances_percpu.py
1
4183
# -*- coding: utf-8 -*- # # This file is part of Glances. # # Copyright (C) 2019 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
liamgh/liamgreenhughes-sl4a-tf101
python/src/Lib/distutils/dir_util.py
52
8136
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: dir_util.py 60923 2008-02-21 18:18:37Z guido.van.rossum $" import os, sys from types import * from distutils.errors import DistutilsFileError, Di...
apache-2.0
mikemow/youtube-dl
youtube_dl/extractor/aljazeera.py
95
1253
from __future__ import unicode_literals from .common import InfoExtractor class AlJazeeraIE(InfoExtractor): _VALID_URL = r'http://www\.aljazeera\.com/programmes/.*?/(?P<id>[^/]+)\.html' _TEST = { 'url': 'http://www.aljazeera.com/programmes/the-slum/2014/08/deliverance-201482883754237240.html', ...
unlicense
boooka/GeoPowerOff
venv/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.py
1002
25650
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os...
apache-2.0
dbnicholson/merge-our-misc
util/__init__.py
1
2540
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2008 Canonical Ltd. # Author: Scott James Remnant <scott@ubuntu.com>. # # This program is free software: you can redistribute it and/or modify # it under the terms of version 3 of the GNU General Public License as # published by the Free Software Foundation....
gpl-3.0
Jgarcia-IAS/Fidelizacion_odoo
openerp/addons/hw_posbox_homepage/__init__.py
1894
1075
# -*- 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
ddico/server-tools
server_environment/tests/test_server_environment.py
54
1836
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
technologiescollege/Blockly-rduino-communication
scripts_XP/rDuino/rDuino_uploader_server.py
2
32647
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # -------------------------------------------------------------------- # rDuino_Uploader_Server : Mini server to compile and upload # a code to the target board. # # This program serves HTTP requests on port 888 # Compile and upload the code using the arduino IDE (linux)...
gpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/contrib/messages/tests/base.py
63
14277
from django import http from django.conf import settings, global_settings from django.contrib.messages import constants, utils, get_level, set_level from django.contrib.messages.api import MessageFailure from django.contrib.messages.storage import default_storage, base from django.contrib.messages.storage.base import M...
bsd-3-clause
mkrzewic/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/plots/MCTruthPlot.py
41
6247
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
phenoxim/nova
nova/tests/unit/conductor/test_conductor.py
1
146395
# Copyright 2012 IBM Corp. # Copyright 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 r...
apache-2.0
scanny/python-pptx
tests/opc/test_rels.py
1
9218
# encoding: utf-8 """Test suite for pptx.part module.""" from __future__ import absolute_import import pytest from pptx.opc.constants import RELATIONSHIP_TYPE as RT from pptx.opc.oxml import CT_Relationships from pptx.opc.package import Part, _Relationship, RelationshipCollection from pptx.opc.packuri import PackUR...
mit
Comunitea/OCB
openerp/addons/base/ir/ir_fields.py
194
17664
# -*- coding: utf-8 -*- import cStringIO import datetime import functools import itertools import time import psycopg2 import pytz from openerp import models, api, _ from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, ustr REFERENCING_FIELDS = set([None, 'id', '.id']) def only_ref_f...
agpl-3.0
hybrideagle/django
tests/app_loading/tests.py
288
3113
from __future__ import unicode_literals import os from django.apps import apps from django.test import SimpleTestCase from django.test.utils import extend_sys_path from django.utils import six from django.utils._os import upath class EggLoadingTest(SimpleTestCase): def setUp(self): self.egg_dir = '%s/e...
bsd-3-clause
MaxRobinson/CS449
project7/ValueIteration.py
1
7032
import copy import pprint import sys from Game import Game from Game import GameState class ValueIteration: def __init__(self, game): """ Init Variables for tracking the V_S values and the Q values. Init possible actions as well. """ self.game = game self.gamma =...
apache-2.0
unseenlaser/python-for-android
python3-alpha/python3-src/Lib/tkinter/test/test_ttk/test_functions.py
45
16204
# -*- encoding: utf-8 -*- import unittest from tkinter import ttk class MockTclObj(object): typename = 'test' def __init__(self, val): self.val = val def __str__(self): return str(self.val) class MockStateSpec(object): typename = 'StateSpec' def __init__(self, *args): s...
apache-2.0
bearstech/ansible
lib/ansible/modules/storage/zfs/zpool_facts.py
9
6172
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.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.0', ...
gpl-3.0
Anderson-Lab/anderson-lab.github.io
csc_466_2021_spring/MLCode/Ch14/iris.py
3
2295
# Code from Chapter 14 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by Stephen Marsland (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code comes with n...
mit
etherkit/OpenBeacon2
client/linux-arm/venv/lib/python3.6/site-packages/cmd2/history.py
1
11877
# coding=utf-8 """ History management classes """ import re from typing import List, Union import attr from . import utils from .parsing import Statement @attr.s(frozen=True) class HistoryItem(): """Class used to represent one command in the history list""" _listformat = ' {:>4} {}' _ex_listformat = ...
gpl-3.0
rmulton/lawen
webservice_caller/_ParisOpenDataAPICaller.py
1
5479
import json import re from webservice_caller.GoogleAPICaller import GoogleAPICaller from model.Request import Request from model.Transport.Velib import Velib from model.Transport.Bicycle import Bicycle from model.Transport.Drive import Drive from model.Transport.Autolib import Autolib from model.Possibilities import Po...
mit
lingyunyumo/PyLinden
pygments/unistring.py
240
404696
# -*- coding: utf-8 -*- """ pygments.unistring ~~~~~~~~~~~~~~~~~~ Strings of all Unicode characters of a certain category. Used for matching in Unicode-aware languages. Run to regenerate. Inspired by chartypes_create.py from the MoinMoin project. :copyright: Copyright 2006-2013 by the Pygment...
mit
tquizzle/Sick-Beard
cherrypy/lib/covercp.py
39
11308
"""Code-coverage tools for CherryPy. To use this module, or the coverage tools in the test suite, you need to download 'coverage.py', either Gareth Rees' original implementation: http://www.garethrees.org/2001/12/04/python-coverage/ or Ned Batchelder's enhanced version: http://www.nedbatchelder.com/code/modules/cover...
gpl-3.0
drepetto/chiplotle
chiplotle/tools/geometrytools/get_line_intersection.py
1
2222
from chiplotle.geometry.core.coordinate import Coordinate from chiplotle.geometry.core.path import Path def get_line_intersection(line_a, line_b): ''' Finds the intersection point, if any, between lines a and b. Returns a Coordinate or None if there is no intersection. ''' #make sure we have two l...
gpl-3.0
eino-makitalo/odoo
openerp/addons/base/res/res_lang.py
49
12612
# -*- 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
tensorflow/privacy
setup.py
1
1376
# Copyright 2018, The TensorFlow 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 applicable law or agreed t...
apache-2.0
ericchill/gnofract4d
fractutils/slave.py
1
6608
# slave.py - run a subordinate process asynchronously import sys import os if "win" == sys.platform[:3]: import win32api else: import fcntl import signal import select import errno import time import subprocess def makeNonBlocking(fd): fl = fcntl.fcntl(fd, fcntl.F_GETFL) try: fcntl.fcntl(fd...
bsd-3-clause
kbrebanov/ansible
lib/ansible/modules/cloud/vmware/vmware_datacenter.py
47
4916
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
pcu4dros/pandora-core
workspace/lib/python3.5/site-packages/alembic/autogenerate/api.py
26
14714
"""Provide the 'autogenerate' feature which can produce migration operations automatically.""" from ..operations import ops from . import render from . import compare from .. import util from sqlalchemy.engine.reflection import Inspector import contextlib def compare_metadata(context, metadata): """Compare a dat...
mit
dforste/pypuppetdb
pypuppetdb/api/v2.py
5
4151
from __future__ import unicode_literals from __future__ import absolute_import import logging from pypuppetdb.api import BaseAPI from pypuppetdb.types import ( Node, Fact, Resource, ) log = logging.getLogger(__name__) class API(BaseAPI): """The API object for version 2 of the PuppetDB API. This object ...
apache-2.0
taknevski/tensorflow-xsmm
tensorflow/python/framework/common_shapes_test.py
60
2551
# 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
openre/openre
openre/metadata.py
1
7391
# -*- coding: utf-8 -*- """ Метаданные. """ class Metadata(object): """ Метаданные для части данных, хранящихся в векторе (vector). Например это может быть двухмерный массив нейронов. Класс позволяет сохранить изначальные размеры массива после преобразования его в вектор и упрощает преобразование к...
mit
xchenum/quantum
quantum/plugins/cisco/db/nexus_models_v2.py
6
1362
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Cisco Systems, 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-...
apache-2.0
jehiah/tornado
demos/blog/blog.py
97
8511
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
apache-2.0
stievie/Tiny3D
ThirdParty/soloud/scripts/gen_python.py
2
7353
""" SoLoud Python wrapper generator """ import soloud_codegen fo = open("../glue/soloud.py", "w") # # from ctypes import * # # soloud_dll = CDLL("soloud_x86") # # myfunc = soloud_dll.myfunc # myfunc.argtypes = [c_char_p, c_int, c_double] # myfunc.restype = c_int # C_TO_PY_TYPES = { "int":"ctypes....
mit
virtuald/exaile
xl/metadata/_apev2.py
3
2024
# Copyright (C) 2008-2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that...
gpl-2.0
kczapla/pylint
pylint/test/functional/inconsistent_returns.py
1
6212
#pylint: disable=missing-docstring, no-else-return, invalid-name, unused-variable, superfluous-parens, try-except-raise """Testing inconsistent returns""" import math import sys # These ones are consistent def explicit_returns(var): if var >= 0: return math.sqrt(var) else: return None def expl...
gpl-2.0
jakobworldpeace/scikit-learn
sklearn/cluster/__init__.py
364
1228
""" The :mod:`sklearn.cluster` module gathers popular unsupervised clustering algorithms. """ from .spectral import spectral_clustering, SpectralClustering from .mean_shift_ import (mean_shift, MeanShift, estimate_bandwidth, get_bin_seeds) from .affinity_propagation_ import affinity_propagati...
bsd-3-clause
HardySimpson/kubernetes
cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
7
32408
#!/usr/bin/env python # Copyright 2015 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
mspark93/VTK
ThirdParty/Twisted/twisted/internet/test/test_epollreactor.py
39
7386
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.epollreactor}. """ from __future__ import division, absolute_import from twisted.trial.unittest import TestCase try: from twisted.internet.epollreactor import _ContinuousPolling except ImportError: _Conti...
bsd-3-clause
pandegroup/vs-utils
vs_utils/features/tests/test_shape_grid.py
2
2015
""" Tests for grid-based shape features. """ import unittest from rdkit import Chem from vs_utils.features.shape_grid import ShapeGrid from vs_utils.utils.rdkit_utils import conformers class TestShapeGrid(unittest.TestCase): """ Tests for ShapeGrid featurizer. """ def setUp(self): """ ...
gpl-3.0
beepee14/scikit-learn
sklearn/cluster/affinity_propagation_.py
224
10733
""" Algorithms for clustering : Meanshift, Affinity propagation and spectral clustering. """ # Author: Alexandre Gramfort alexandre.gramfort@inria.fr # Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import numpy as np from ..base import BaseEstimator, ClusterMixin from ..utils import a...
bsd-3-clause
p4datasystems/CarnotKE
jyhton/Lib/test/test_traceback.py
14
6311
"""Test cases for traceback module""" from __future__ import with_statement import unittest from test.test_support import run_unittest, is_jython import traceback class TracebackCases(unittest.TestCase): # For now, a very minimal set of tests. I want to be sure that # formatting of SyntaxErrors works based ...
apache-2.0
zycdragonball/tensorflow
tensorflow/python/ops/data_flow_ops.py
9
84261
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
h4/fuit-webdev
projects/books/library/models.py
1
1433
# -*- coding: utf-8 -*- from datetime import datetime from django.db import models # Create your models here. class Author(models.Model): first_name = models.CharField('Имя', max_length=32) last_name = models.CharField('Фамилия', max_length=32) email = models.EmailField('Email', null=True, blank=True) ...
mit
nicolaerosia/linux-bn-omap4
scripts/checkkconfigsymbols.py
92
15782
#!/usr/bin/env python2 """Find Kconfig symbols that are referenced but not defined.""" # (c) 2014-2015 Valentin Rothberg <valentinrothberg@gmail.com> # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> # # Licensed under the terms of the GNU GPL License version 2 import difflib import os import re import signal i...
gpl-2.0
JunctionAt/JunctionWWW
blueprints/auth/views/reauth.py
1
1261
from flask import request, flash, redirect, render_template from flask_login import confirm_login, current_user from flask_wtf import Form from wtforms import PasswordField from wtforms.validators import InputRequired, Length from .. import blueprint, login_required from blueprints.auth.util import authenticate_user, ...
agpl-3.0
aperigault/ansible
lib/ansible/modules/monitoring/zabbix/zabbix_group.py
13
6720
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2013-2014, Epic Games, Inc. # 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
marcore/edx-platform
lms/djangoapps/courseware/tests/test_entrance_exam.py
11
26676
""" Tests use cases related to LMS Entrance Exam behavior, such as gated content access (TOC) """ from mock import patch, Mock from django.core.urlresolvers import reverse from django.test.client import RequestFactory from nose.plugins.attrib import attr from capa.tests.response_xml_factory import MultipleChoiceRespo...
agpl-3.0
deandunbar/html2bwml
venv/lib/python2.7/site-packages/django/test/_doctest.py
54
103225
# This is a slightly modified version of the doctest.py that shipped with Python 2.5 # It incorporates changes that have been submitted to the Python ticket tracker # as ticket #1521051. These changes allow for a DoctestRunner and Doctest base # class to be specified when constructing a DoctestSuite. # Module doctest....
mit