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
petewarden/tensorflow
tensorflow/python/keras/applications/resnet.py
1
21438
# 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
berendkleinhaneveld/VTK
ThirdParty/Twisted/twisted/web/xmlrpc.py
31
19496
# -*- test-case-name: twisted.web.test.test_xmlrpc -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A generic resource for publishing objects via XML-RPC. Maintainer: Itamar Shtull-Trauring """ # System Imports import base64 import xmlrpclib import urlparse # Sibling Imports from twis...
bsd-3-clause
tymofij/adofex
transifex/resources/formats/utils/decorators.py
2
1446
from transifex.resources.formats import FormatError def need_resource(fn): def resource_fn(self, *args, **kw): if not self.resource: raise FormatError("Resource not specified.") return fn(self, *args, **kw) return resource_fn def need_content(fn): def content_fn(self, *args, **...
gpl-3.0
meisamhe/GPLshared
Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/pythonic.py
1
1148
import collections import functools import heapq # @include def compute_top_k_variance(students, scores, k): all_scores = collections.defaultdict(list) for student, score in zip(students, scores): all_scores[student].append(score) top_k_scores = { student: heapq.nlargest(k, scores) ...
gpl-3.0
ianw/pip
docs/conf.py
11
7029
# -*- coding: utf-8 -*- # # pip documentation build configuration file, created by # sphinx-quickstart on Tue Apr 22 22:08:49 2008 # # 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 confi...
mit
shakamunyi/neutron-dvr
neutron/tests/unit/vmware/apiclient/test_api_eventlet_request.py
7
12646
# Copyright (C) 2009-2012 VMware, 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
sangh/LaserShow
pyglet-hg/contrib/layout/tests/layout/INLINE_FORMATTING.py
29
4273
#!/usr/bin/env python '''Test line-height and vertical align properties, using test case from http://meyerweb.com/eric/css/inline-format.html The reference rendering is http://meyerweb.com/eric/css/inline-test-1-gecko.gif ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import base_layo...
bsd-3-clause
emilybache/KataTrainReservation
python2_guiding_test.py
1
1396
""" Equivalent of 'guiding_test.py' except for Python2.x, which comes as standard on many systems. Run it with: python python2_guiding_test.py """ import json import subprocess import unittest import os import urllib2, urllib url = "http://127.0.0.1:8083" interpreter = "python" reservation_script = os.path.join...
mit
rohitwaghchaure/vestasi-frappe
frappe/core/report/permitted_documents_for_user/permitted_documents_for_user.py
3
1696
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw import frappe.utils.user from frappe.permissions import check_admin_or_system_manager from frappe.model.db_schema import type_map def...
mit
SerialShadow/SickRage
lib/sqlalchemy/dialects/sybase/base.py
78
28800
# sybase/base.py # Copyright (C) 2010-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # get_select_precolumns(), limit_clause() implementation # copyright (C) 2007 Fisch Asset Management # AG http://www.fam.ch, with coding by Alexander Houben # alexander.houben@thor-solutions.ch # # This module is part ...
gpl-3.0
pytorch/vision
torchvision/datasets/mnist.py
1
20618
from .vision import VisionDataset import warnings from PIL import Image import os import os.path import numpy as np import torch import codecs import string from typing import Any, Callable, Dict, List, Optional, Tuple from urllib.error import URLError from .utils import download_and_extract_archive, extract_archive, v...
bsd-3-clause
mattclay/ansible
test/units/utils/collection_loader/test_collection_loader.py
15
38146
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import pkgutil import pytest import re import sys from ansible.module_utils.six import PY3, string_types from ansible.module_utils.compat.importlib import import_module from ansible.utils.collection_loader import Ansible...
gpl-3.0
herlo/linchpin
linchpin/provision/filter_plugins/render_os_server_insts.py
2
1039
#!/usr/bin/env python def render_os_server_insts(res_def, os_resource_name): output = [] if "count" in res_def: server_names = [os_resource_name + str(i) for i in range(1, res_def["count"] + 1)] for sname in server_names: server_dict = {} server...
gpl-3.0
hsnlab/escape
mininet/examples/controllers2.py
2
1612
#!/usr/bin/python """ This example creates a multi-controller network from semi-scratch by using the net.add*() API and manually starting the switches and controllers. This is the "mid-level" API, which is an alternative to the "high-level" Topo() API which supports parametrized topology classes. Note that one could...
apache-2.0
kevintaw/django
tests/m2m_regress/models.py
358
2826
from django.contrib.auth import models as auth from django.db import models from django.utils.encoding import python_2_unicode_compatible # No related name is needed here, since symmetrical relations are not # explicitly reversible. @python_2_unicode_compatible class SelfRefer(models.Model): name = models.CharFie...
bsd-3-clause
singer-io/singer-python
singer/__init__.py
1
1519
from singer import utils from singer.utils import ( chunk, load_json, parse_args, ratelimit, strftime, strptime, update_state, should_sync_field, ) from singer.logger import ( get_logger, log_debug, log_info, log_warning, log_error, log_critical, log_fatal, ...
apache-2.0
ecolitan/fatics
venv/lib/python2.7/site-packages/twisted/trial/test/test_output.py
35
5104
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the output generated by trial. """ import os, StringIO from twisted.scripts import trial from twisted.trial import runner from twisted.trial.test import packages def runTrial(*args): from twisted.trial import reporter con...
agpl-3.0
tejaskhot/deep-learning
nnet/fflayers.py
2
2370
"""Feed-forward Layers (not includeing ConvNet Layer) This module contains feedforward layers for + Identity layer + Tanh layer + Sigmoid layer + ReLU layer + Softmax layer """ import theano.tensor as T; import nnfuns as nnfuns; from layer import Layer; class IdentityLayer(Layer): """Identity Layer """ ...
gpl-2.0
tangyiyong/odoo
addons/hr_evaluation/__init__.py
432
1084
# -*- 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
artscoop/django-extensions
django_extensions/management/shells.py
7
10091
import traceback import django import six class ObjectImportError(Exception): pass def import_items(import_directives, style, quiet_load=False): """ Import the items in import_directives and return a list of the imported items Each item in import_directives should be one of the following forms ...
mit
endolith/scikit-image
skimage/io/tests/test_pil.py
4
7743
import os.path import numpy as np from numpy.testing import ( assert_array_equal, assert_array_almost_equal, assert_raises, assert_allclose, run_module_suite) from tempfile import NamedTemporaryFile from ... import data_dir, img_as_float from .. import imread, imsave, use_plugin, reset_plugins from ..._shared...
bsd-3-clause
kai11/ansible-modules-core
cloud/google/gce_lb.py
130
12230
#!/usr/bin/python # Copyright 2013 Google 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 vers...
gpl-3.0
StevenBlack/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/expectedfailures_unittest.py
122
5271
# Copyright (c) 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 of conditions and the ...
bsd-3-clause
ds-hwang/chromium-crosswalk
tools/memory_inspector/memory_inspector/core/native_heap.py
89
5384
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from memory_inspector.core import memory_map from memory_inspector.core import stacktrace from memory_inspector.core import symbol from memory_inspector.cor...
bsd-3-clause
krux/varnish-pkg
lib/libvmod_std/vmod.py
9
8168
#!/usr/local/bin/python #- # Copyright (c) 2010-2011 Varnish Software AS # All rights reserved. # # Author: Poul-Henning Kamp <phk@phk.freebsd.dk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions o...
bsd-2-clause
amenonsen/ansible
lib/ansible/module_utils/cloud.py
194
8653
# # (c) 2016 Allen Sanabria, <asanabria@linuxdynasty.org> # # 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...
gpl-3.0
denisenkom/django
tests/generic_relations_regress/models.py
9
4635
from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible __all__ = ('Link', 'Place', 'Restaurant', 'Person', 'Address', 'CharLink', 'TextLink', 'OddRelation1', 'OddRe...
bsd-3-clause
dc3-plaso/plaso
plaso/parsers/sqlite.py
1
12382
# -*- coding: utf-8 -*- """This file contains a SQLite parser.""" import logging import os import tempfile # pylint: disable=wrong-import-order try: from pysqlite2 import dbapi2 as sqlite3 except ImportError: import sqlite3 from dfvfs.path import factory as dfvfs_factory from plaso.lib import specification from...
apache-2.0
leilihh/cinder
cinder/api/v2/views/volumes.py
10
6169
# Copyright 2012 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
huntxu/python-neutronclient
neutronclient/osc/v2/dynamic_routing/bgp_speaker.py
1
12293
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
gpetretto/pymatgen
pymatgen/ext/cod.py
3
5037
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides classes to interface with the Crystallography Open Database. If you use data from the COD, please cite the following works (as stipulated by the COD developers):: Merkys, A., Vaitk...
mit
laosiaudi/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v2_test.py
14
10898
# 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 applicable ...
apache-2.0
Celedhrim/persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/aftonbladet.py
34
2590
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class AftonbladetIE(InfoExtractor): _VALID_URL = r'^http://tv\.aftonbladet\.se/webbtv.+?(?P<video_id>article[0-9]+)\.ab(?:$|[?#])' _TEST = { 'url': 'http://tv.aftonbladet.se/webbtv/nyheter/vetenskap...
gpl-3.0
zaffra/Inquire
GAE/django/contrib/auth/tests/forms.py
142
8721
from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm from django.test import TestCase class UserCreationFormTest(TestCase): fixtures = ['authtestdata.json'] def test_use...
bsd-3-clause
40223135/40223135-
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testwith.py
739
5806
import unittest from warnings import catch_warnings from unittest.test.testmock.support import is_instance from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call something = sentinel.Something something_else = sentinel.SomethingElse class WithTest(unittest.TestCase): def test_with_sta...
gpl-3.0
kouaw/CouchPotatoServer
libs/requests/packages/charade/langgreekmodel.py
2763
12628
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
gpl-3.0
jaidevd/scikit-learn
sklearn/ensemble/iforest.py
13
12146
# Authors: Nicolas Goix <nicolas.goix@telecom-paristech.fr> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # License: BSD 3 clause from __future__ import division import numpy as np import scipy as sp from warnings import warn from scipy.sparse import issparse import numbers from ..external...
bsd-3-clause
josephlewis42/magpie
magpie/old_plugins/hypertext.py
1
6089
#!/usr/bin/env python3 ''' This file is part of Magpie, an automated checking framework with multiple submission forms; it was originally built for automatic grading, but has many more potential uses than that. Copyright 2013 Joseph Lewis <joehms22@gmail.com> | <joseph@josephlewis.net> Redistribution and use in sou...
bsd-3-clause
squirrelo/qiime
scripts/truncate_reverse_primer.py
15
4510
#!/usr/bin/env python # File created February 29, 2012 from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters", "Jose Antonio Navas Molina"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __ema...
gpl-2.0
jmacmahon/invenio
modules/websearch/lib/services/SubmissionNameSearchService.py
3
8599
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
endlessm/chromium-browser
third_party/SPIRV-Tools/src/utils/check_copyright.py
3
8702
#!/usr/bin/env python # coding=utf-8 # Copyright (c) 2016 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...
bsd-3-clause
motoschifo/mame
3rdparty/SDL2/src/joystick/sort_controllers.py
125
2053
#!/usr/bin/env python # # Script to sort the game controller database entries in SDL_gamecontroller.c import re filename = "SDL_gamecontrollerdb.h" input = open(filename) output = open(filename + ".new", "w") parsing_controllers = False controllers = [] controller_guids = {} split_pattern = re.compile(r'([^"]*")([^,...
gpl-2.0
pyurdme/pyurdme
examples/simple_diffusion/simple_diffusion.py
5
1116
""" pyurdme model for a single species diffusing on the unit square. """ import dolfin import pyurdme import numpy class simple_diffusion(pyurdme.URDMEModel): """ Initial condition is a delta function at the center voxel. The solution should be a Gaussian, up to the point where the BC becomes imp...
gpl-3.0
wweiradio/django
django/contrib/gis/geos/prototypes/threadsafe.py
529
2859
import threading from django.contrib.gis.geos.libgeos import ( CONTEXT_PTR, error_h, lgeos, notice_h, ) class GEOSContextHandle(object): """ Python object representing a GEOS context handle. """ def __init__(self): # Initializing the context handler for this thread with # the noti...
bsd-3-clause
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/iam/test_password_policy.py
100
3943
# Copyright (c) 2014 Rocket Internet AG. # Luca Bruno <luca.bruno@rocket-internet.de> # 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 #...
bsd-3-clause
glaubitz/fs-uae-debian
launcher/OpenGL/GL/NV/gpu_shader5.py
9
6464
'''OpenGL extension NV.gpu_shader5 This module customises the behaviour of the OpenGL.raw.GL.NV.gpu_shader5 to provide a more Python-friendly API Overview (from the spec) This extension provides a set of new features to the OpenGL Shading Language and related APIs to support capabilities of new GPUs. Shaders ...
gpl-2.0
hermanliang/gitinspector
tests/test_comment.py
51
1706
# coding: utf-8 # # Copyright © 2013 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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
codekaki/odoo
addons/l10n_ro/res_partner.py
21
2200
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 (<http://www.erpsystems.ro>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
a-doumoulakis/tensorflow
tensorflow/python/keras/constraints/__init__.py
74
1830
# 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
bigzz/autotest
scheduler/drone_manager_unittest.py
4
13907
#!/usr/bin/python import os import unittest try: import autotest.common as common except ImportError: import common from autotest.client.shared.settings import settings from autotest.client.shared.test_utils import mock from autotest.scheduler import drone_manager, drones from autotest.scheduler import schedul...
gpl-2.0
sonofatailor/django-oscar
src/oscar/apps/checkout/app.py
23
2535
from django.conf import settings from django.conf.urls import url from django.contrib.auth.decorators import login_required from oscar.core.application import Application from oscar.core.loading import get_class class CheckoutApplication(Application): name = 'checkout' index_view = get_class('checkout.views...
bsd-3-clause
pombredanne/invenio
modules/bibformat/lib/elements/bfe_issn.py
1
49812
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 ve...
gpl-2.0
icaoberg/cellorganizer-galaxy-tools
datatypes/qualityscore.py
1
3966
""" Qualityscore class """ import data import logging log = logging.getLogger(__name__) class QualityScore ( data.Text ): """ until we know more about quality score formats """ file_ext = "qual" class QualityScoreSOLiD ( QualityScore ): """ until we know more about quality score formats ...
gpl-3.0
lets-software/shinken
shinken/objects/hostescalation.py
17
2767
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
ikus060/rdiffweb
rdiffweb/core/quota.py
1
5476
# -*- coding: utf-8 -*- # rdiffweb, A web interface to rdiff-backup repositories # Copyright (C) 2020 rdiffweb contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
gpl-3.0
EDUlib/eTracesX
Translation_software/edx_to_MOOCdb/resources.py
2
11354
import re import util import contentmedium import csv from helperclasses import DictionaryTable, CourseURL class Node(object): def __init__(self, uri): self._id = None self.uri = uri self.parent_id = None self.child_number = None self.children = [] def append_child...
agpl-3.0
geopython/QGIS
python/plugins/processing/gui/wrappers_postgis.py
12
7843
# -*- coding: utf-8 -*- """ *************************************************************************** postgis.py - Postgis widget wrappers --------------------- Date : December 2016 Copyright : (C) 2016 by Arnaud Morvan Email : arnaud dot morvan at campto...
gpl-2.0
jordens/rayopt
rayopt/zemax.py
1
9858
# -*- coding: utf-8 -*- # # rayopt - raytracing for optical imaging systems # Copyright (C) 2012 Robert Jordens <robert@joerdens.org> # # 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 Found...
lgpl-3.0
icztb/rs232-obd-sim
lib/Car.py
6
1552
""" Simulates a vehicle. Implements its pedals, buttons and ECUs """ ## Copyright (C) 2010 Miguel Gonzalez <enoelrocotiv@gmail.com> ## Copyright (C) 2010 Oscar Iglesias <osc.iglesias@gmail.com> ## ## This file is part of rs232-obd-sim.py. ## ## rs232-obd-sim.py is free software; you can redistrib...
gpl-3.0
kbarnes3/BaseDjangoSite
web/newdjangosite/wsgi_daily.py
1
1446
""" WSGI config for newdjangosite project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICAT...
bsd-2-clause
mvaled/sentry
src/sentry/constants.py
1
14095
""" These settings act as the default (base) settings for the Sentry-provided web-server """ from __future__ import absolute_import, print_function import logging import os.path import six from datetime import timedelta from collections import OrderedDict, namedtuple from django.conf import settings from django.utils...
bsd-3-clause
jankeromnes/depot_tools
third_party/logilab/astng/utils.py
18
8458
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # copyright 2003-2010 Sylvain Thenault, all rights reserved. # contact mailto:thenault@gmail.com # # This file is part of logilab-astng. # # logilab-astng is free software: you can redi...
bsd-3-clause
SportySpice/Collections
src/gui/Tab.py
1
4043
from SettingsWindow import SETTING_COLUMN, SETTING_COLUMN_PAD from Row import Row, EnumMode from src.li.visual import TextSettings as ts import pyxbmct.addonwindow as pyxbmct import xbmcgui LABELS_BOLD = False LABEL_COLOR = None VALUE_COLUMN = 7 VALUE_COLUMN_SPAN = 3 class Tab(object): def __init__(self, title...
gpl-2.0
ephes/scikit-learn
sklearn/datasets/__init__.py
176
3671
""" The :mod:`sklearn.datasets` module includes utilities to load datasets, including methods to load and fetch popular reference datasets. It also features some artificial data generators. """ from .base import load_diabetes from .base import load_digits from .base import load_files from .base import load_iris from ....
bsd-3-clause
jusdng/odoo
addons/hr_payroll/__init__.py
433
1137
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
erikr/django
django/utils/dateparse.py
21
4080
"""Functions to parse datetime objects.""" # We're using regular expressions rather than time.strptime because: # - They provide both validation and parsing. # - They're more flexible for datetimes. # - The date/datetime/time constructors produce friendlier error messages. import datetime import re from django.utils...
bsd-3-clause
gMagicScott/autokey
src/lib/qtui/dialogs.py
48
20532
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Chris Dekter # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
gpl-3.0
wscullin/spack
lib/spack/spack/cmd/compiler.py
3
7541
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
molmod/md-tracks
tracks/core.py
1
11157
# -*- coding: utf-8 -*- # MD-Tracks is a trajectory analysis toolkit for molecular dynamics # and monte carlo simulations. # Copyright (C) 2007 - 2012 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # #...
gpl-3.0
ratoaq2/Flexget
flexget/plugins/output/subtitles.py
8
5467
from __future__ import unicode_literals, division, absolute_import from xmlrpclib import ServerProxy import re import difflib import os.path import logging from flexget import plugin from flexget.event import event from flexget.utils.tools import urlopener """ DRAFT class SubtitleQueue(Base): __tablename__ = '...
mit
Big-B702/python-for-android
python-build/build.py
42
6957
#!/usr/bin/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 law or agr...
apache-2.0
theo-l/django
tests/serializers/models/base.py
27
3862
""" Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from decimal import Decimal from django.db import models class CategoryMetaDataManager(models.Manager): def get_by_natural_key(self, kind, name): retur...
bsd-3-clause
overtherain/scriptfile
software/googleAppEngine/lib/django_1_3/django/db/models/expressions.py
229
4992
import datetime from django.utils import tree from django.utils.copycompat import deepcopy class ExpressionNode(tree.Node): """ Base class for all query expressions. """ # Arithmetic connectors ADD = '+' SUB = '-' MUL = '*' DIV = '/' MOD = '%%' # This is a quoted % operator - it i...
mit
himleyb85/django
tests/view_tests/tests/test_debug.py
3
40539
# -*- coding: utf-8 -*- # This coding header is significant for tests, as the debug view is parsing # files to search for such a header to decode the source file content from __future__ import unicode_literals import importlib import inspect import os import re import sys import tempfile from unittest import skipIf f...
bsd-3-clause
Lh4cKg/sl4a
python/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/cache.py
129
9763
# -*- coding: utf-8 -*- """ Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
iamjakob/lumiCalc
LumiDB/python/lumiQueryAPI.py
1
86930
import os import coral,datetime from RecoLuminosity.LumiDB import nameDealer,lumiTime,CommonUtil,lumiCorrections import array from RecoLuminosity.LumiDB import argparse, nameDealer, selectionParser, hltTrgSeedMapper, \ connectstrParser, cacheconfigParser, tablePrinter, csvReporter, csvSelectionParser from RecoLumi...
apache-2.0
parastuffs/metis_unicorn
script/net_diff.py
1
1140
""" net_diff.py 2015-09-15 Compares the network list in Nets.out and WLnets.out. Lists all the nets that are in Nets.out but not in WLnets.out. """ INPUT_FILE_DIR = "../input_files/" FORBIDDEN_LINES = ["-", "#", "NAME", "NET", "Steiner"] # Strings beginning unwanted lines nets = list() WLnets = list() missingNets =...
gpl-3.0
CatsAndDogsbvba/odoo
addons/purchase/partner.py
53
2711
# -*- 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
frankcash/AcidSloth
top_block.py
1
5261
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Top Block # Generated: Sun Sep 27 04:24:11 2015 ################################################## from gnuradio import digital from gnuradio import eng_notation from gnuradio import filter from gnuradio impo...
bsd-3-clause
rjschwei/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/operations/virtual_network_gateways_operations.py
1
23552
# 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
porcobosso/spark-ec2
lib/boto-2.34.0/boto/cloudfront/exception.py
221
1205
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
Lisaveta-K/lisaveta-k.github.io
_site/tomat/apps/news/management/commands/news_import.py
1
1917
# -*- coding: utf-8 -*- import re import json import os.path import urllib2 import datetime import uuid import requests from django.conf import settings from django.core.files.base import ContentFile from django.core.management import BaseCommand from news.models import News class Command(BaseCommand): def han...
mit
dmpiergiacomo/scion
python/test/lib/sibra/state/bandwidth_test.py
3
1689
# Copyright 2016 ETH Zurich # # 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, sof...
apache-2.0
drnextgis/QGIS
python/ext-libs/future/future/backports/xmlrpc/server.py
82
37285
r""" Ported using Python-Future from the Python 3.3 standard library. XML-RPC Servers. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to handle XML-RPC requests in a CGI...
gpl-2.0
cancan101/StarCluster
starcluster/tests/conftest.py
16
5151
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 License, or (at your option) any # later ...
lgpl-3.0
Crompulence/cpl-library
src/bindings/python/cplpy/test/initialisation/cfd_test.py
1
1697
#!/usr/bin/env python2 from __future__ import print_function, division from mpi4py import MPI from cplpy import CPL import numpy as np import cPickle import sys comm_world = MPI.COMM_WORLD CPL = CPL() # Do not show any info to the stdin CPL.set("output_mode", 0) # Load parameters for the run params = cPickle.load(op...
gpl-3.0
abhishek-ch/hue
desktop/core/ext-py/MySQL-python-1.2.5/MySQLdb/connections.py
76
11777
""" This module implements connections for MySQLdb. Presently there is only one class: Connection. Others are unlikely. However, you might want to make your own subclasses. In most cases, you will probably override Connection.default_cursor with a non-standard Cursor class. """ from MySQLdb import cursors fr...
apache-2.0
jPhy/Gomoku
lib/board.py
1
4361
""" Implement the game board This module defines the stone colors `empty`, `black` and `white` """ import numpy as np # the colors empty = 0 black = +1 white = -1 class InvalidMoveError(Exception): pass class Board(object): """ Gomoku game board of the desired size (`height`, `width`). Can access...
mit
kytvi2p/Sigil
3rdparty/python/Modules/_decimal/tests/formathelper.py
52
11559
# # Copyright (c) 2008-2012 Stefan Krah. 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 ...
gpl-3.0
willprice/arduino-sphere-project
scripts/example_direction_finder/temboo/Library/Fitbit/Statistics/GetTimeSeriesByDateRange.py
5
5760
# -*- coding: utf-8 -*- ############################################################################### # # GetTimeSeriesByDateRange # Gets time series data for a given resource based on a date range you specify. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, V...
gpl-2.0
saitoha/canossa
canossa/constant.py
1
1595
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ***** BEGIN LICENSE BLOCK ***** # Copyright (C) 2012-2014, Hayaki Saito # # 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...
mit
MechCoder/sympy
sympy/functions/special/tests/test_error_functions.py
42
24182
from sympy import ( symbols, expand, expand_func, nan, oo, Float, conjugate, diff, re, im, Abs, O, exp_polar, polar_lift, gruntz, limit, Symbol, I, integrate, Integral, S, sqrt, sin, cos, sinc, sinh, cosh, exp, log, pi, EulerGamma, erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv, gamma, uppergam...
bsd-3-clause
dnozay/lettuce
tests/integration/lib/Django-1.3/django/shortcuts/__init__.py
254
4642
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpRespon...
gpl-3.0
treejames/viewfinder
backend/services/sms_util.py
13
2242
# -*- coding: utf-8 -*- # Copyright 2012 Viewfinder Inc. All Rights Reserved. """SMS utilities. Helper methods used when sending SMS messages. """ __author__ = 'andy@emailscrubbed.com (Andy Kimball)' import re from tornado import escape # Regular expression used to identify valid GSM characters, which is the 7-b...
apache-2.0
RealTimeWeb/wikisite
MoinMoin/support/werkzeug/contrib/profiler.py
91
3969
# -*- coding: utf-8 -*- """ werkzeug.contrib.profiler ~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a simple WSGI profiler middleware for finding bottlenecks in web application. It uses the :mod:`profile` or :mod:`cProfile` module to do the profiling and writes the stats to the stream provide...
apache-2.0
shangwuhencc/shogun
applications/tapkee/samples/isomap.py
26
1028
import modshogun as sg import data import numpy as np # load data feature_matrix = data.swissroll() # create features instance features = sg.RealFeatures(feature_matrix) # create Isomap converter instance converter = sg.Isomap() # set number of neighbors to be used converter.set_k(15) # set target dimensionality co...
gpl-3.0
tongxindao/Flask-micblog
MoocOnline/web/djangomooc/extra_app/xadmin/plugins/refresh.py
21
1372
# coding=utf-8 from django.template import loader from xadmin.plugins.utils import get_context_dict from xadmin.sites import site from xadmin.views import BaseAdminPlugin, ListAdminView REFRESH_VAR = '_refresh' class RefreshPlugin(BaseAdminPlugin): refresh_times = [] # Media def get_media(self, media)...
apache-2.0
omni5cience/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/django/templatetags/i18n.py
84
17694
from __future__ import unicode_literals import re import sys from django.conf import settings from django.template import (Node, Variable, TemplateSyntaxError, TokenParser, Library, TOKEN_TEXT, TOKEN_VAR) from django.template.base import render_value_in_context from django.template.defaulttags import token_kwargs ...
mit
thruflo/dogpile.cache
tests/cache/__init__.py
1
1156
import re from nose import SkipTest from functools import wraps from dogpile.cache import compat import time def eq_(a, b, msg=None): """Assert a == b, with repr messaging on failure.""" assert a == b, msg or "%r != %r" % (a, b) def is_(a, b, msg=None): """Assert a is b, with repr messaging on failure.""...
bsd-3-clause
cpina/science-cruise-data-management
ScienceCruiseDataManagement/main/management/commands/warningoversizeemail.py
1
9438
from django.core.management.base import BaseCommand, CommandError import socket import imaplib import sys import email from django.conf import settings from main.models import Email, EmailOversizeNotified, Leg import pprint from django.core.mail import send_mail # This file is part of https://github.com/cpina/science-...
mit