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
amitsela/incubator-beam
sdks/python/apache_beam/examples/cookbook/coders.py
9
3380
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
jscott413/maidsinharlem
flask/lib/python2.7/site-packages/migrate/tests/versioning/test_script.py
63
10322
#!/usr/bin/env python # -*- coding: utf-8 -*- import imp import os import sys import shutil import six from migrate import exceptions from migrate.versioning import version, repository from migrate.versioning.script import * from migrate.versioning.util import * from migrate.tests import fixture from migrate.tests.f...
bsd-3-clause
hamzehd/edx-platform
openedx/core/djangoapps/course_groups/tests/test_cohorts.py
12
33673
""" Tests for cohorts """ # pylint: disable=no-member import ddt from mock import call, patch import before_after from django.contrib.auth.models import User from django.db import IntegrityError from django.http import Http404 from django.test import TestCase from opaque_keys.edx.locations import SlashSeparatedCourse...
agpl-3.0
asiersarasua/QGIS
python/plugins/processing/algs/grass7/ext/i_landsat_acca.py
12
1561
# -*- coding: utf-8 -*- """ *************************************************************************** i_landsat_acca.py ----------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ***************************...
gpl-2.0
m2candre/ansible-modules-extras
system/gluster_volume.py
76
14777
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Taneli Leppä <taneli@crasman.fi> # # This file is part of Ansible (sort of) # # 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 o...
gpl-3.0
pakesson/rednotebook
rednotebook/gui/clouds.py
1
8443
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Copyright (c) 2009 Jendrik Seipp # # RedNotebook 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 vers...
gpl-2.0
kmoocdev2/edx-platform
lms/djangoapps/ccx/migrations/0004_seed_forum_roles_in_ccx_courses.py
38
3489
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from ccx_keys.locator import CCXLocator from courseware.courses import get_course_by_id from django.db import migrations from django.http import Http404 from django_comment_common.models import FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERAT...
agpl-3.0
jack-song/evolving-life
mainsite/settings.py
1
2624
""" Django settings for mainsite project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
mit
DrMeers/django
django/contrib/gis/gdal/prototypes/errcheck.py
12
4140
""" This module houses the error-checking routines used by the GDAL ctypes prototypes. """ from ctypes import c_void_p, string_at from django.contrib.gis.gdal.error import check_err, OGRException, SRSException from django.contrib.gis.gdal.libgdal import lgdal from django.utils import six # Helper routines for retr...
bsd-3-clause
boegel/easybuild-easyblocks
easybuild/easyblocks/t/trilinos.py
1
14884
## # Copyright 2009-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
zhujianwei31415/dcnnfold
scripts/evaluation/evaluate_spec_sens_three_levels.py
2
1892
#! /usr/bin/env python # # Copyright # Author: zhujianwei@ict.ac.cn (Jianwei Zhu) from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sys from sklearn.metrics import precision_recall_curve from sklearn.metrics import average_precision_s...
gpl-3.0
ndonegan/oz
oz/Fedora.py
1
6739
# Copyright (C) 2010,2011 Chris Lalancette <clalance@redhat.com> # Copyright (C) 2012-2017 Chris Lalancette <clalancette@gmail.com> # This library 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; # ve...
lgpl-2.1
Nehmulos/knight-game
cocos2d/tools/bindings-generator/backup/clang-llvm-3.3-pybinding/enumerations.py
307
1077
#===- enumerations.py - Python Enumerations ------------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
gpl-3.0
Jandersolutions/jander777-ghost
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/terminal.py
363
4065
# -*- coding: utf-8 -*- """ pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from pygments.formatter import Format...
mit
alejo8591/maker
core/dashboard/urls.py
1
1121
# encoding: utf-8 # Copyright 2013 maker # License """ Core module Dashboard URLs """ from django.conf.urls.defaults import patterns, url urlpatterns = patterns('maker.core.dashboard.views', url(r'^(\.(?P<response_format>\w+))?$', 'index', name='core_dashboard_index'), # Widgets ...
mit
blacktear23/django
django/contrib/localflavor/id/id_choices.py
439
3217
import warnings from django.utils.translation import ugettext_lazy as _ # Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia # Indonesia does not have an official Province code standard. # I decided to use unambiguous and consistent (some are common) 3-letter codes. warnings.warn( 'There have been...
bsd-3-clause
braintree/braintree_python
tests/unit/test_us_bank_account.py
1
2169
from tests.test_helper import * from datetime import date from braintree.us_bank_account import UsBankAccount from braintree.us_bank_account_verification import UsBankAccountVerification class TestUsBankAccount(unittest.TestCase): def test_constructor(self): attributes = { "last_four": "1234", ...
mit
elParaguayo/RPi-InfoScreen-Kivy
screens/londonbus/londonbus.py
4
5544
"""This script demonstrates how to retrieve bus countdown information from the TfL website and turn it into a structure that can then be used by other python codes. Unfortunately, the bus countdown information is not true JSON so, as you'll see from the code below, we need to play with it a bit first in order to parse...
gpl-3.0
tanmaykm/edx-platform
common/lib/capa/capa/customrender.py
60
5603
""" This has custom renderers: classes that know how to render certain problem tags (e.g. <math> and <solution>) to html. These tags do not have state, so they just get passed the system (for access to render_template), and the xml element. """ import logging import re from cgi import escape as cgi_escape from lxml ...
agpl-3.0
hwfwgrp/mbed
workspace_tools/host_tests/default_auto.py
101
1236
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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
GreatFruitOmsk/screenly-ose
lib/backup_helper.py
1
1182
import tarfile from datetime import datetime from os import path, getenv, remove import sh directories = ['.screenly', 'screenly_assets'] default_archive_name = "screenly-backup" static_dir = "screenly/static" def create_backup(name=default_archive_name): home = getenv('HOME') archive_name = "{}-{}.tar.gz".f...
gpl-2.0
boundarydevices/android_external_chromium_org
tools/json_schema_compiler/schema_util.py
139
1125
# 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. """Utilies for the processing of schema python structures. """ def CapitalizeFirstLetter(value): return value[0].capitalize() + value[1:] def GetName...
bsd-3-clause
jcrist/blaze
blaze/compute/tests/test_bcolz_compute.py
9
5874
from __future__ import absolute_import, division, print_function import pytest bcolz = pytest.importorskip('bcolz') from datashape import discover, dshape import numpy as np import pandas.util.testing as tm from odo import into from blaze import by from blaze.expr import symbol from blaze.compute.core import compu...
bsd-3-clause
philippegabriel/xen
tools/python/xen/migration/libxc.py
11
14641
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Libxc Migration v2 streams Record structures as per docs/specs/libxc-migration-stream.pandoc, and verification routines. """ import sys from struct import calcsize, unpack from xen.migration.verify import StreamError, RecordError, VerifyBase # Image Header IHDR_FO...
gpl-2.0
zero-ui/miniblink49
third_party/WebKit/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py
53
5700
# 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 ...
gpl-3.0
tlatzko/spmcluster
.tox/2.6-cover/lib/python2.6/site-packages/pip/utils/deprecation.py
271
2152
""" A module that implments tooling to enable easy warnings about deprecations. """ from __future__ import absolute_import import logging import warnings class PipDeprecationWarning(Warning): pass class RemovedInPip8Warning(PipDeprecationWarning, PendingDeprecationWarning): pass class RemovedInPip9Warnin...
bsd-2-clause
safwanrahman/mozillians
vendor-local/lib/python/markdown/extensions/abbr.py
11
3057
''' Abbreviation Extension for Python-Markdown ========================================== This extension adds abbreviation handling to Python-Markdown. Simple Usage: >>> import markdown >>> text = """ ... Some text with an ABBR and a REF. Ignore REFERENCE and ref. ... ... *[ABBR]: Abb...
bsd-3-clause
klaricch/Transposons2
scripts/fix_cov.py
1
1053
#!/usr/bin/env python # this script outputs coverage per strain in a file that can be merged with T_kin_C_matrix_full.txt # USE: cov_fix.py import re infile="/lscr2/andersenlab/kml436/git_repos2/Transposons2/results/kinship/T_kin_C_matrix_full.txt" cov_file="/lscr2/andersenlab/kml436/git_repos2/Transposons2/results/k...
mit
y-j-n/pyFastfusion
OpenNI2-master-2.2.0.33/Wrappers/java/OpenNI.jni/CreateMethods.py
32
2398
#/**************************************************************************** #* * #* OpenNI 1.x Alpha * #* Copyright (C) 2012 PrimeSense Ltd. * #* ...
gpl-2.0
donK23/pyData-Projects
EventDec/event_dec/main.py
1
4294
#!/usr/bin/python import numpy as np import pickle import os from model import Model def get_input(): """ Ask user for inputs about event: Title, Main Topic, Distance to Location. Checks for correct types and value ranges. If not correct, restarts asking 5 times. :return: Tuple(Str, Int, Int) => "Tit...
apache-2.0
anaruse/chainer
chainer/utils/conv_nd.py
3
4991
import itertools import numpy import six from chainer.backends import cuda from chainer.utils.conv import get_conv_outsize from chainer.utils import conv_nd_kernel def as_tuple(x, n): if hasattr(x, '__getitem__'): assert len(x) == n return tuple(x) return (x,) * n def im2col_nd_cpu(img, ks...
mit
ezhuk/aws-tools
autoscale/configure_auto_scaling.py
1
6244
#!/usr/bin/env python # Copyright (c) 2013 Eugene Zhuk. # Use of this source code is governed by the MIT license that can be found # in the LICENSE file. """Configures AWS Auto Scaling. This script is intended to simplify the process of setting up AWS Auto Scaling to automatically manage system capacity based on aver...
mit
JulianEberius/Synonyms.tmbundle
Support/bin/pysaurus.py
1
2343
import subprocess, os, sys class Proposal(object): def __init__(self, name="", _type=None): super(Proposal, self).__init__() self.name = name self.type = _type def __repr__(self): t_string = self.type if self.type else "NoType" return t_string+": "+self.name def _filter_and_to_dict(out_line...
mit
istresearch/readthedocs.org
readthedocs/doc_builder/python_environments.py
1
8279
import logging import os import shutil from django.conf import settings from readthedocs.builds.constants import LATEST from readthedocs.doc_builder.config import ConfigWrapper from readthedocs.doc_builder.loader import get_builder_class from readthedocs.projects.constants import LOG_TEMPLATE log = logging.getLogger...
mit
mingit/mstcpV0.89.4_linux
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
famnote/pottocoin
contrib/spendfrom/spendfrom.py
792
10053
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
mit
battlemidget/juju-charm-dokuwiki
reactive/dokuwiki.py
1
2221
from charms.reactive import ( hook, when, only_once, is_state ) import os.path as path from charmhelpers.core import hookenv from charmhelpers.core.host import service_restart from charmhelpers.core.templating import render from subprocess import call from charms.layer import nginx, dokuwiki, php conf...
mit
4doemaster/openembedded
contrib/armmon_xfer/armmon_xfer.py
45
3966
#!/usr/bin/python # Small utility to upload kernel and/or ramdisk to # the compulab board through the ARMmon firmware. # Requires pyserial : http://pyserial.sourceforge.net # author: Tobias Pflug import sys, os, serial, getopt, atexit, re # regular expression to match valid IPv4 addresses ipv4_regex = r"\b(25[0-5]|2...
mit
leighpauls/k2cro4
third_party/python_26/Lib/site-packages/pythonwin/pywin/Demos/ocx/demoutils.py
68
1354
# Utilities for the demos import sys, win32api, win32con, win32ui NotScriptMsg = """\ This demo program is not designed to be run as a Script, but is probably used by some other test program. Please try another demo. """ NeedGUIMsg = """\ This demo program can only be run from inside of Pythonwin You must start Py...
bsd-3-clause
py-geek/City-Air
venv/lib/python2.7/site-packages/allauth/socialaccount/models.py
13
11749
from __future__ import absolute_import from django.core.exceptions import PermissionDenied from django.db import models from django.contrib.auth import authenticate from django.contrib.sites.models import Site from django.utils.encoding import python_2_unicode_compatible from django.utils.crypto import get_random_stri...
mit
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/mailcap.py
3
7640
"""Mailcap file handling. See RFC 1524.""" import os __all__ = ["getcaps","findmatch"] # Part 1: top-level interface. def getcaps(): """Return a dictionary containing the mailcap database. The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain') to a list of dictionaries corre...
gpl-2.0
etashjian/ECE757-final
src/arch/x86/isa/insts/simd64/integer/arithmetic/multiply_add.py
91
2946
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
MatthewWilkes/reportlab
demos/odyssey/dodyssey.py
1
7622
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__=''' $Id$ ''' __doc__='' #REPORTLAB_TEST_SCRIPT import sys, copy, os from reportlab.platypus import * _NEW_PARA=os.environ.get('NEW_PARA','0')[0] in ('y','Y','1') _REDCAP=int(os.environ.get('REDCAP','0')) _CALLBACK=os.environ.ge...
bsd-3-clause
shepdelacreme/ansible
test/units/modules/network/onyx/test_onyx_lldp.py
45
2396
# # (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
gefangenimnetz/mopidy-nfcread
mopidy_nfcread/nfc/clf/transport.py
3
16326
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2012-2015 Stephen Tiedemann <stephen.tiedemann@gmail.com> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the European Commission - subsequent # versions of the EUPL (t...
apache-2.0
dimagi/rapidsms-threadless-router
threadless_router/backends/http/tests.py
2
1963
from django.conf import settings from django.test import TestCase, RequestFactory from django.core.urlresolvers import reverse from threadless_router.backends.http import views from threadless_router.backends.http.forms import BaseHttpForm class HttpTest(TestCase): urls = 'threadless_router.backends.http.urls' ...
bsd-3-clause
quantumlib/ReCirq
recirq/qaoa/experiments/run-optimization.py
1
3558
import datetime from recirq.qaoa.experiments.optimization_tasks import ( OptimizationAlgorithm, OptimizationTask, collect_optimization_data) from recirq.qaoa.experiments.problem_generation_tasks import ( HardwareGridProblemGenerationTask, SKProblemGenerationTask, ThreeRegularProblemGenerationTask) def ma...
apache-2.0
nealtodd/django
tests/forms_tests/tests/test_media.py
76
23851
# -*- coding: utf-8 -*- from django.forms import CharField, Form, Media, MultiWidget, TextInput from django.template import Context, Template from django.test import SimpleTestCase, override_settings from django.utils.encoding import force_text @override_settings( STATIC_URL='http://media.example.com/static/', ) ...
bsd-3-clause
Khan/pyobjc-framework-Cocoa
Examples/AppKit/TinyTinyEdit/TinyTinyEdit.py
3
1064
"""TinyTinyEdit -- A minimal Document-based Cocoa application.""" from Cocoa import * from PyObjCTools import Signals from PyObjCTools import AppHelper class TinyTinyDocument(NSDocument): textView = objc.IBOutlet() path = None def windowNibName(self): return "TinyTinyDocument" def readFromFil...
mit
Shanec132006/project
lib/jinja2/testsuite/lexnparse.py
402
22314
# -*- coding: utf-8 -*- """ jinja2.testsuite.lexnparse ~~~~~~~~~~~~~~~~~~~~~~~~~~ All the unittests regarding lexing, parsing and syntax. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja...
apache-2.0
danielpataki/writing
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py
1361
45045
# 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. r"""Code to validate and convert settings of the Microsoft build tools. This file contains code to validate and convert settings of the Microsoft build tools. Th...
gpl-2.0
Coread/channels
tests/test_sessions.py
1
13015
from __future__ import unicode_literals from django.conf import settings from django.test import override_settings from channels import DEFAULT_CHANNEL_LAYER, channel_layers from channels.message import Message from channels.sessions import ( channel_and_http_session, channel_session, enforce_ordering, http_sessi...
bsd-3-clause
kiddinn/plaso
plaso/containers/event_sources.py
4
1631
# -*- coding: utf-8 -*- """Event source attribute containers.""" from plaso.containers import interface from plaso.containers import manager class EventSource(interface.AttributeContainer): """Event source attribute container. The event source object contains information about where a specific event originate...
apache-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/Sphinx-1.5.1-py3.5.egg/sphinx/util/docfields.py
4
12386
# -*- coding: utf-8 -*- """ sphinx.util.docfields ~~~~~~~~~~~~~~~~~~~~~ "Doc fields" are reST field lists in object descriptions that will be domain-specifically transformed to a more appealing presentation. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LI...
gpl-3.0
rfleissner/ChEsher
py/ui/uiChEsher.py
1
3772
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'uiChEsher.ui' # # Created: Sat May 06 23:31:14 2017 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attr...
gpl-2.0
vpetersson/ansible-modules-core
cloud/openstack/glance_image.py
33
8780
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
vponomaryov/rally
tests/functional/test_cli_info.py
1
4695
# Copyright 2013: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
apache-2.0
Bulochkin/tensorflow_pack
tensorflow/contrib/keras/python/keras/layers/noise.py
39
3671
# 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
MiLk/ansible-modules-core
system/seboolean.py
90
6637
#!/usr/bin/python # (c) 2012, Stephen Fromm <sfromm@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
gpl-3.0
aziele/alfpy
tests/test_distmatrix.py
1
4612
import numpy as np import os import unittest from alfpy import word_distance from alfpy.utils import distmatrix from . import utils class TestDistMatrix(unittest.TestCase): def setUp(self): id_list = ['seq1', 'seq2', 'seq3'] data = np.array([[0, 0.3531587, 0.35509333], ...
mit
georgefrank/ansible-modules-extras
monitoring/stackdriver.py
58
6848
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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. ...
gpl-3.0
Urokhtor/AeonEngine
World/Scene.py
1
2258
class Scene: """ Scene is the base class for playable environments, like exteriors, interiors and the world map. The interface defines methods that are called in different situations, such as entering a scene, or leaving a scene which allows the users to define things like loading and unload...
gpl-3.0
kmike/scikit-learn
examples/plot_lda_qda.py
12
4758
""" ==================================================================== Linear and Quadratic Discriminant Analysis with confidence ellipsoid ==================================================================== Plot the confidence ellipsoids of each class and decision boundary """ print(__doc__) from scipy import lin...
bsd-3-clause
lparsons/tools-iuc
tool_collections/snpeff/gbk2fa.py
21
1634
import argparse import bz2 import contextlib import gzip import sys import magic from Bio import SeqIO parser = argparse.ArgumentParser() parser.add_argument("genbank_file", help="GenBank input file. Can be compressed with gzip or bzip2") parser.add_argument("fasta_file", help="FASTA output datset") parser.add_argume...
mit
JVillella/tensorflow
tensorflow/contrib/distributions/__init__.py
9
6007
# 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
jacksonicson/paper.IS2015
control/Control/src/virtual/util.py
1
2155
import conf_nodes import libvirt # Established connections connections = {} def connect(node): # Check if connection exists if node in connections: return connections[node] try: print 'connecting with %s' % node conn_str = "qemu+ssh://root@%s/system" % (node) ...
mit
Jorge-Rodriguez/ansible
lib/ansible/plugins/doc_fragments/opennebula.py
33
1345
# -*- coding: utf-8 -*- # # Copyright 2018 www.privaz.io Valletech AB # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # OpenNebula common documentation DOCUMENTATION = ''' options: api_url: description: - The...
gpl-3.0
rmcgibbo/numpy
numpy/core/tests/test_datetime.py
38
85016
from __future__ import division, absolute_import, print_function import os, pickle import numpy import numpy as np from numpy.testing import * from numpy.compat import asbytes import datetime # Use pytz to test out various time zones if available try: from pytz import timezone as tz _has_pytz = True except Im...
bsd-3-clause
wenhuizhang/neutron
neutron/plugins/ml2/drivers/brocade/db/models.py
63
4420
# Copyright 2014 Brocade Communications System, 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 # #...
apache-2.0
tanyunshi/python-docx
tests/oxml/unitdata/text.py
10
3187
# encoding: utf-8 """ Test data builders for text XML elements """ from ...unitdata import BaseBuilder from .shared import CT_OnOffBuilder, CT_StringBuilder class CT_BrBuilder(BaseBuilder): __tag__ = 'w:br' __nspfxs__ = ('w',) __attrs__ = ('w:type', 'w:clear') class CT_EmptyBuilder(BaseBuilder): _...
mit
forcedotcom/distributions
distributions/tests/test_random.py
1
10178
# Copyright (c) 2014, Salesforce.com, 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...
bsd-3-clause
CallaJun/hackprince
indico/nose/proxy.py
94
6879
""" Result Proxy ------------ The result proxy wraps the result instance given to each test. It performs two functions: enabling extended error/failure reporting and calling plugins. As each result event is fired, plugins are called with the same event; however, plugins are called with the nose.case.Test instance tha...
lgpl-3.0
espressif/esp-idf
docs/idf_extensions/gen_defines.py
1
3181
# Sphinx extension to integrate defines into the Sphinx Build # # Runs after the IDF dummy project has been built # # Then emits the new 'idf-defines-generated' event which has a dictionary of raw text define values # that other extensions can use to generate relevant data. import glob import os import pprint import r...
apache-2.0
rockychen-dpaw/oim-cms
registers/migrations/0003_auto_20161003_2217.py
1
7301
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-10-03 14:17 from __future__ import unicode_literals from django.db import migrations, models import registers.models class Migration(migrations.Migration): dependencies = [ ('registers', '0002_auto_20160919_1303'), ] operations = [ ...
apache-2.0
DirectXMan12/nova-hacking
nova/tests/db/test_sqlite.py
12
2231
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
Srisai85/numpy
numpy/core/tests/test_indexing.py
13
39934
from __future__ import division, absolute_import, print_function import sys import warnings import functools import numpy as np from numpy.core.multiarray_tests import array_indexing from itertools import product from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_raises, ass...
bsd-3-clause
knowledgegraph/schema
scripts/fb15k_schema/fb15k_schema.py
1
1681
#!/usr/bin/python -uB # -*- coding: utf-8 -*- # Classes of methods base_vers = ['TransE', 'ScalE'] scaltrans_vers = ['ScalTransE'] xi_vers = ['XiTransE', 'XiScalE'] semixi_vers = ['XiScalTransSE', 'XiTransScalSE'] xiscaltrans_vers = ['XiScalTransE'] simple_method_set = base_vers + xi_vers #+ scaltrans_vers + semixi_v...
gpl-2.0
infobloxopen/neutron
neutron/plugins/ml2/drivers/freescale/mechanism_fslsdn.py
40
9123
# Copyright (c) 2014 Freescale Semiconductor # # 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 ...
apache-2.0
40423218/2017springcd_hw
plugin/sitemap/sitemap.py
292
8774
# -*- coding: utf-8 -*- ''' Sitemap ------- The sitemap plugin generates plain-text or XML sitemaps. ''' from __future__ import unicode_literals import re import collections import os.path from datetime import datetime from logging import warning, info from codecs import open from pytz import timezone from pelican...
agpl-3.0
m3dev/pptx-template
.eggs/python_pptx-0.6.6-py3.6.egg/pptx/parts/coreprops.py
4
3885
# encoding: utf-8 """ Core properties part, corresponds to ``/docProps/core.xml`` part in package. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from datetime import datetime from ..opc.constants import CONTENT_TYPE as CT from ..opc.package import XmlPart from ..opc....
apache-2.0
jazkarta/edx-platform
lms/djangoapps/branding/migrations/0001_initial.py
102
4789
# -*- 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 'BrandingInfoConfig' db.create_table('branding_brandinginfoconfig', ( ('id', self...
agpl-3.0
GitSomeCode/RecipeApp
Proj/initial.py
1
8001
#!/usr/bin/env python import os import sys import django import random randomUser = lambda: get_user_model().objects.all()[random.randrange(0, get_user_model().objects.count())] rr = lambda x, y: random.randrange(x, y) def endall(): # Delete Snippets. for obj in Recipe.objects.all(): obj.delete() # Delete U...
gpl-2.0
ael-code/libreant
archivant/test/test_update_volume.py
3
2363
from archivant.test.class_template import TestArchivant from nose.tools import eq_ from copy import deepcopy class TestArchivantUpdateVolume(TestArchivant): def test_update_volume_denormalize(self): volume_metadata = self.generate_volume_metadata() attachments = self.generate_attachments(2) ...
agpl-3.0
proversity-org/edx-platform
openedx/core/djangoapps/lang_pref/middleware.py
5
3773
""" Middleware for Language Preferences """ from django.conf import settings from django.utils.translation import LANGUAGE_SESSION_KEY from django.utils.translation.trans_real import parse_accept_lang_header from openedx.core.djangoapps.lang_pref import COOKIE_DURATION, LANGUAGE_HEADER, LANGUAGE_KEY from openedx.core...
agpl-3.0
yingcuhk/LeetCode
Algorithms/#1 Two Sum/PythonCode.py
1
1048
""" Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. """ class Solution(object): def t...
mit
BoldingBruggeman/gotm
gui.py/xmlplot/data/gotmtext.py
1
35659
import os, StringIO import numpy import xmlstore.xmlstore import xmlplot.common class LinkedFileVariableStore(xmlplot.common.VariableStore,xmlstore.datatypes.DataFileEx): # XML store-derived class for storing (cached) metadata of a data file, # such as coordinate ranges. # This is implemented as XML sto...
gpl-2.0
Pirata-Repository/Pirata
plugin.video.SportsDevil/lib/utils/github/Repository.py
7
45033
# -*- coding: utf-8 -*- # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub 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 Softwar...
gpl-2.0
tdtrask/ansible
lib/ansible/modules/network/f5/bigip_device_trust.py
22
10772
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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
pointhi/searx
tests/unit/engines/test_wolframalpha_api.py
1
6796
# -*- coding: utf-8 -*- from collections import defaultdict import mock from requests import Request from searx.engines import wolframalpha_api from searx.testing import SearxTestCase class TestWolframAlphaAPIEngine(SearxTestCase): def test_request(self): query = 'test_query' dicto = defaultdict(...
agpl-3.0
ledtvavs/repository.ledtv
plugin.video.kratos/resources/lib/testings.py
2
1515
# -*- coding: utf-8 -*- """ testings.py --- functions dealing with local testings xml file Copyright (C) 2017, Midraal 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 vers...
gpl-3.0
DMLoy/ECommerceBasic
bin/bin/activate/lib/python2.7/site-packages/pip/log.py
143
6371
"""Logging """ import sys import logging from pip import backwardcompat class Logger(object): """ Logging object for use in command-line script. Allows ranges of levels, to avoid some redundancy of displayed information. """ VERBOSE_DEBUG = logging.DEBUG - 1 DEBUG = logging.DEBUG INFO =...
mit
jgcaaprom/android_external_chromium_org
build/android/generate_emma_html.py
96
2874
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Aggregates EMMA coverage files to produce html output.""" import fnmatch import json import optparse import os import sys from py...
bsd-3-clause
CMLL/taiga-back
taiga/projects/history/migrations/0001_initial.py
27
1533
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import taiga.projects.history.models import django.utils.timezone import django_pgjson.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel(...
agpl-3.0
WillieMaddox/scipy
scipy/optimize/tests/test_zeros.py
7
2471
#!/usr/bin/env python from __future__ import division, print_function, absolute_import from math import sqrt, exp, sin, cos from numpy.testing import (TestCase, assert_almost_equal, assert_warns, assert_, run_module_suite, assert_allclose, assert_equal) from scip...
bsd-3-clause
aaronorosen/horizon-congress
openstack_dashboard/dashboards/admin/projects/tests.py
2
79907
# Copyright 2012 Nebula, 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 agree...
apache-2.0
leleopard/pyXPArduino
avrdude/__init__.py
1
4001
""" WORKING COMMAND: ./avrdude-x64 -p ATmega2560 -c wiring -P /dev/ttyACM0 -b 115200 -U flash:w:../XPArduinoSerial.ino.mega.hex -C ./avrdude.conf -D Copyright 2011 Ryan Fobel This file is part of dmf_control_board. dmf_control_board is free software: you can redistribute it and/or modify it under the terms of the ...
gpl-3.0
naturali/tensorflow
tensorflow/python/kernel_tests/conv3d_backprop_filter_v2_grad_test.py
25
2440
# 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
wuzhy/autotest
frontend/migrations/059_drone_sets_permissions.py
5
1333
import common from autotest_lib.database import db_utils UP_SQL = """ SET @group_id = (SELECT id FROM auth_group WHERE name = 'Basic Admin'); INSERT IGNORE INTO auth_group_permissions (group_id, permission_id) SELECT @group_id, id FROM auth_permission WHERE codename IN ( 'add_droneset', 'change_droneset', 'delete_d...
gpl-2.0
MarvinT/pyMNE
pyMNE.py
1
6335
import scipy.optimize as opt import numpy as np def log_loss(p, stim, resp, order): #get number of samples and dimensionality of stimulus Nsamples, Ndim = stim.shape resp = np.reshape(resp, (-1)) #unpack p: (var names match names in Fitzgerald paper) a = p[0] h = p[1:Ndim+1].T #ca...
bsd-2-clause
mindnervestech/mnrp
addons/hr_recruitment/wizard/__init__.py
381
1095
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-Today OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0