repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
socialwareinc/Diamond | src/collectors/mountstats/test/testmountstats.py | 31 | 3401 | #!/usr/bin/python
# coding=utf-8
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import MagicMock, Mock
from mock import patch
from diamond.collector import Collector
from mountstats import MountStatsCollector
class TestMountStatsCollector(CollectorTestCa... | mit |
ImageEngine/gaffer | python/GafferUITest/LayoutsTest.py | 8 | 7337 | ##########################################################################
#
# Copyright (c) 2018, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
xiaojunwu/crosswalk-test-suite | wrt/wrt-rtcoremanu-android-tests/inst.xpk.py | 187 | 5919 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=u... | bsd-3-clause |
Quantipy/quantipy | quantipy/core/quantify/engine.py | 1 | 98357 | import pandas as pd
import numpy as np
from scipy.stats.stats import _ttest_finish as get_pval
from itertools import combinations, chain, product
from collections import defaultdict, OrderedDict
import quantipy as qp
import pandas as pd
import numpy as np
from operator import add, sub, mul, div
from quantipy.core.view ... | mit |
woodscn/scipy | scipy/stats/tests/test_discrete_basic.py | 38 | 8770 | from __future__ import division, print_function, absolute_import
import numpy.testing as npt
import numpy as np
from scipy._lib.six import xrange
from scipy import stats
from common_tests import (check_normalization, check_moment, check_mean_expect,
check_var_expect, check_skew_expect,
... | bsd-3-clause |
itai12312/workspaces | hellodjango/venv/lib/python2.7/site-packages/django/core/serializers/json.py | 113 | 3461 | """
Serialize data to/from JSON
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
import datetime
import decimal
import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSerializer
from django.... | gpl-2.0 |
cgwalters/anaconda | tests/gui/outside/__init__.py | 1 | 10874 | #!/usr/bin/python2
#
# Copyright (C) 2014 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.
#
# ... | gpl-2.0 |
JVenberg/PokemonGo-Bot-Desktop | pywin/Lib/test/crashers/nasty_eq_vs_dict.py | 168 | 1046 | # from http://mail.python.org/pipermail/python-dev/2001-June/015239.html
# if you keep changing a dictionary while looking up a key, you can
# provoke an infinite recursion in C
# At the time neither Tim nor Michael could be bothered to think of a
# way to fix it.
class Yuck:
def __init__(self):
self.i =... | mit |
bjko/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/irc_command.py | 115 | 13369 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
tux-00/ansible | lib/ansible/modules/network/nxos/nxos_pim_rp_address.py | 30 | 8315 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
lpryszcz/bin | bam2bigwig.py | 1 | 4219 | #!/usr/bin/env python
desc="""Convert BAM to BigWig.
Inspired by: https://www.biostars.org/p/64495/#64680
Added support for non-UCSC genomes.
Require:
- bedGraphToBigWig
- samtools
- pybedtools
- pysam
TBD:
- you can avoid genome fasta if faidx is generated from bam header
"""
epilog="""Author: l.p.pryszcz+git@gmail.... | gpl-3.0 |
dims/cinder | cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py | 2 | 23352 | # (c) Copyright 2014 Brocade Communications Systems 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/LICEN... | apache-2.0 |
b3j0f/requester | b3j0f/requester/utils.py | 1 | 1808 | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | mit |
mikebenfield/scikit-learn | sklearn/tests/test_learning_curve.py | 45 | 11897 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
asdacap/iiumschedule | server/lib/werkzeug/debug/__init__.py | 310 | 7800 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import json
import mimetypes
from os.path import join, dirname, basename, isfile
... | gpl-3.0 |
Gabriel439/pants | tests/python/pants_test/tasks/test_execution_graph.py | 3 | 9880 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
fro... | apache-2.0 |
cnsuperx/Cocos2d-x-2.2.5 | samples/Lua/TestLua/proj.marmalade/cccopy.py | 16 | 1647 | import os
import shutil
from optparse import OptionParser
def cccopy(sourcePath, destPath):
for root, dirs, files in os.walk(sourcePath):
#figure out where we're going
dest = destPath + root.replace(sourcePath, '')
destAbsPath = os.path.abspath(destPath)
#if we're in a directory tha... | mit |
fpy171/scrapy | tests/test_spiderloader/__init__.py | 107 | 3094 | import sys
import os
import shutil
from zope.interface.verify import verifyObject
from twisted.trial import unittest
# ugly hack to avoid cyclic imports of scrapy.spiders when running this test
# alone
from scrapy.interfaces import ISpiderLoader
from scrapy.spiderloader import SpiderLoader
from scrapy.settings impor... | bsd-3-clause |
astonshane/AdventOfCode | 2015/python/day13/chal25.py | 1 | 1191 | import sys
import itertools
hUnits = {}
def findHappiness(arrangment):
happiness = 0
for i in range(0, len(arrangment)):
person = arrangment[i]
personLeft, personRight = None, None
if i == 0:
personLeft = arrangment[-1]
else:
personLeft = arrangment[i-1... | mit |
aimas/TuniErp-8.0 | openerp/report/render/rml2pdf/customfonts.py | 261 | 3493 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 P. Christeas, Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA. (http://www.openerp.com)
#
# This program is free so... | agpl-3.0 |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/perf/page_sets/top_25_pages.py | 27 | 2675 | # 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 telemetry.page import page
from telemetry.page import shared_page_state
from telemetry import story
from page_sets import top_pages
class Top25PageSet... | mit |
Icenowy/MissionPlanner | Lib/encodings/aliases.py | 84 | 15375 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
... | gpl-3.0 |
asadziach/tensorflow | tensorflow/python/kernel_tests/sparse_ops_test.py | 35 | 34194 | # 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 |
domob1812/namecore | test/util/bitcoin-util-test.py | 59 | 6594 | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for bitcoin utils.
Runs automatically during `make check`.
Ca... | mit |
yejingxin/kaggle-ndsb | configurations/bagging_00_convroll4_big_wd_maxout512.py | 6 | 5478 | import numpy as np
import theano
import theano.tensor as T
import lasagne as nn
import data
import load
import nn_plankton
import dihedral
import dihedral_fast
import tmp_dnn
import tta
validation_split_path = "splits/bagging_split_0.pkl"
patch_size = (95, 95)
augmentation_params = {
'zoom_range': (1 / 1.6,... | mit |
scriptmediala/mitmproxy | libmproxy/console/pathedit.py | 33 | 2145 | import glob
import os.path
import urwid
class _PathCompleter:
def __init__(self, _testing=False):
"""
_testing: disables reloading of the lookup table to make testing
possible.
"""
self.lookup, self.offset = None, None
self.final = None
self._testin... | mit |
mjrulesamrat/xbmcbackup | resources/lib/dropbox/client.py | 12 | 40015 | """
The main client API you'll be working with most often. You'll need to
configure a dropbox.session.DropboxSession for this to work, but otherwise
it's fairly self-explanatory.
Before you can begin making requests to the dropbox API, you have to
authenticate your application with Dropbox and get the user to
autho... | mit |
dotcool/zulip | zproject/urls.py | 108 | 15143 | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.views.generic import TemplateView, RedirectView
import os.path
import zerver.forms
# NB: There are several other pieces of code which route requests by URL:
#
# - runtornado.py has its own URL list for Tornado views. Se... | apache-2.0 |
kelseyoo14/Wander | venv_2_7/lib/python2.7/site-packages/Django-1.9-py2.7.egg/django/core/management/commands/squashmigrations.py | 162 | 8767 | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections, migrations
from django.db.migrations.loader import AmbiguityError, MigrationLoader
from django.db.migrations.migration import SwappableTuple
from django.db.migrations.o... | artistic-2.0 |
qzzhang/KBSolrUtil | lib/KBSolrUtil/authclient.py | 105 | 2623 | '''
Created on Aug 1, 2016
A very basic KBase auth client for the Python server.
@author: gaprice@lbl.gov
'''
import time as _time
import requests as _requests
import threading as _threading
import hashlib
class TokenCache(object):
''' A basic cache for tokens. '''
_MAX_TIME_SEC = 5 * 60 # 5 min
_loc... | mit |
albertliangcode/Pi_MonteCarloSim | venv/lib/python2.7/site.py | 784 | 27543 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | mit |
Endika/odoo | openerp/addons/test_new_api/tests/test_new_fields.py | 9 | 19593 | #
# test cases for new-style fields
#
from datetime import date, datetime
from collections import defaultdict
from openerp.exceptions import AccessError, except_orm
from openerp.tests import common
from openerp.tools import mute_logger
class TestNewFields(common.TransactionCase):
def test_00_basics(self):
... | agpl-3.0 |
SolusOS-discontinued/pisi | pisi/component.py | 3 | 2955 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#... | gpl-2.0 |
imaculate/scikit-learn | sklearn/linear_model/tests/test_ransac.py | 52 | 17482 | from scipy import sparse
import numpy as np
from scipy import sparse
from numpy.testing import assert_equal, assert_raises
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from sklearn.utils import check_random_state
from sklearn.utils.testing import assert_raises_rege... | bsd-3-clause |
cprov/snapcraft | snapcraft/formatting_utils.py | 3 | 2778 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
Atrox/haikunatorpy | haikunator/haikunator.py | 1 | 3671 | from random import Random
class Haikunator:
_adjectives = [
'aged', 'ancient', 'autumn', 'billowing', 'bitter', 'black', 'blue', 'bold',
'broad', 'broken', 'calm', 'cold', 'cool', 'crimson', 'curly', 'damp',
'dark', 'dawn', 'delicate', 'divine', 'dry', 'empty', 'falling', 'fancy',
... | bsd-3-clause |
LLNL/spack | lib/spack/external/macholib/util.py | 12 | 7079 | import os
import sys
import stat
import struct
import shutil
from macholib import mach_o
MAGIC = [
struct.pack('!L', getattr(mach_o, 'MH_' + _))
for _ in ['MAGIC', 'CIGAM', 'MAGIC_64', 'CIGAM_64']
]
FAT_MAGIC_BYTES = struct.pack('!L', mach_o.FAT_MAGIC)
MAGIC_LEN = 4
STRIPCMD = ['/usr/bin/strip', '-x', '-S', '... | lgpl-2.1 |
zacharyvoase/zenqueue | zenqueue/utils/sync.py | 1 | 3408 | # -*- coding: utf-8 -*-
from collections import deque
from functools import wraps
import threading
def with_lock(method):
@wraps(method)
def wrapper(self, *args, **kwargs):
self._lock.acquire()
try:
return method(self, *args, **kwargs)
finally:
self._lock.rele... | mit |
sharhar/USB-Thing | UpdaterFiles/Lib/python-3.5.1.amd64/Lib/pathlib.py | 3 | 46272 | import fnmatch
import functools
import io
import ntpath
import os
import posixpath
import re
import sys
from collections import Sequence
from contextlib import contextmanager
from errno import EINVAL, ENOENT, ENOTDIR
from operator import attrgetter
from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR,... | apache-2.0 |
marc-sensenich/ansible | lib/ansible/modules/cloud/amazon/lambda.py | 30 | 22661 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/tools/compatibility/tf_upgrade.py | 17 | 25376 | # 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 |
qgis/QGIS | python/plugins/db_manager/db_plugins/vlayers/data_model.py | 53 | 5436 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : Virtual layers plugin for DB Manager
Date : December 2015
copyright : (C) 2015 by Hugo Mercier
email : hugo dot mercier at oslandia dot com
*******... | gpl-2.0 |
nivekkagicom/uncrustify | scripts/check_options.py | 8 | 2333 | #! /usr/bin/env python
#
# Check the option usage.
# Make sure the union member matches the option type.
#
from os.path import dirname, join, abspath
from os import listdir, EX_OK, EX_DATAERR
from fnmatch import filter
# just use the first letter of the member name - should be unique
map_access_type = {
'b': 'AT_B... | gpl-2.0 |
jbedorf/tensorflow | tensorflow/contrib/gan/python/losses/python/losses_impl_test.py | 8 | 29577 | # 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 |
zorojean/zulip | zproject/urls.py | 108 | 15143 | from django.conf import settings
from django.conf.urls import patterns, url, include
from django.views.generic import TemplateView, RedirectView
import os.path
import zerver.forms
# NB: There are several other pieces of code which route requests by URL:
#
# - runtornado.py has its own URL list for Tornado views. Se... | apache-2.0 |
dezelin/scons | scons-local/SCons/Variables/EnumVariable.py | 3 | 3785 | """engine.SCons.Variables.EnumVariable
This file defines the option type for SCons allowing only specified
input-values.
Usage example:
opts = Variables()
opts.Add(EnumVariable('debug', 'debug output and symbols', 'no',
allowed_values=('yes', 'no', 'full'),
map={}, ign... | mit |
Tehsmash/nova | nova/tests/unit/virt/xenapi/test_volumeops.py | 65 | 24052 | # Copyright (c) 2012 Citrix 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-2.0
#
# Unless required by applicable ... | apache-2.0 |
ORTI3D/ORTI3D_code | iliblast/ui_parameters.py | 1 | 3221 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_parameters.ui'
#
# Created: Sun Feb 16 10:03:57 2014
# by: PyQt4 UI code generator 4.8.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except A... | gpl-3.0 |
t0in4/django | tests/generic_views/test_edit.py | 199 | 19217 | from __future__ import unicode_literals
import warnings
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.test import (
SimpleTestCase, TestCase, ignore_warnings, override_settings,
)
from django.test.client import RequestFact... | bsd-3-clause |
tmtowtdi/MontyLacuna | t/bldgs/intelligence.py | 1 | 2327 |
import os, sys
bindir = os.path.abspath(os.path.dirname(sys.argv[0]))
libdir = bindir + "/../../lib"
sys.path.append(libdir)
import lacuna as lac
from lacuna.exceptions import CaptchaResponseError
glc = lac.clients.Member(
config_file = bindir + "/../../etc/lacuna.cfg",
#config_section = 'my_sitter',
con... | mit |
elkingtonmcb/pattern | pattern/server/cherrypy/cherrypy/_cpwsgi.py | 41 | 16040 | """WSGI interface (see PEP 333 and 3333).
Note that WSGI environ keys and values are 'native strings'; that is,
whatever the type of "" is. For Python 2, that's a byte string; for Python 3,
it's a unicode string. But PEP 3333 says: "even if Python's str type is
actually Unicode "under the hood", the content of native ... | bsd-3-clause |
hgl888/chromium-crosswalk-efl | 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 |
coreynicholson/youtube-dl | youtube_dl/extractor/ruv.py | 49 | 3359 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
unified_timestamp,
)
class RuvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ruv\.is/(?:sarpurinn/[^/]+|node)/(?P<id>[^/]+(?:/\d+)?)'
_TESTS = [{
# m3u8
... | unlicense |
Parisson/TimeSide | timeside/plugins/grapher/waveform_transparent.py | 1 | 2582 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2010 Guillaume Pellerin <yomguy@parisson.com>
# Copyright (c) 2010 Olivier Guilyardi <olivier@samalyse.com>
# This file is part of TimeSide.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licen... | agpl-3.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/django/db/backends/mysql/validation.py | 47 | 2611 | from django.core import checks
from django.db.backends.base.validation import BaseDatabaseValidation
from django.utils.version import get_docs_version
class DatabaseValidation(BaseDatabaseValidation):
def check(self, **kwargs):
issues = super(DatabaseValidation, self).check(**kwargs)
issues.extend... | mit |
philipdexter/rain | rain/lexer.py | 1 | 3765 | from . import error as Q
from . import module as M
from .token import bool_token
from .token import coord
from .token import dedent_token
from .token import end_token
from .token import float_token
from .token import indent_token
from .token import int_token
from .token import keyword_token
from .token import name_toke... | mit |
amghost/myblog | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/formatter.py | 198 | 2921 | # -*- coding: utf-8 -*-
"""
pygments.formatter
~~~~~~~~~~~~~~~~~~
Base formatter class.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import codecs
from pygments.util import get_bool_opt
from pygments.styles import get_style_by_nam... | mit |
Oslandia/vizitown_plugin | twisted/words/xish/xmlstream.py | 49 | 8526 | # -*- test-case-name: twisted.words.test.test_xmlstream -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
XML Stream processing.
An XML Stream is defined as a connection over which two XML documents are
exchanged during the lifetime of the connection, one for each direction. The
unit o... | gpl-2.0 |
drpaneas/linuxed.gr | lib/python2.7/site-packages/docutils/writers/odf_odt/pygmentsformatter.py | 244 | 4671 | # $Id: pygmentsformatter.py 5853 2009-01-19 21:02:02Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Additional support for Pygments formatter.
"""
import pygments
import pygments.formatter
class OdtPygmentsFormatter(pygments.formatter.For... | mit |
kyrsjo/AcdOpti | src/acdOptiGui/infoFrames/AnalysisExportedResults.py | 1 | 7845 | # -*- coding: utf8 -*-
#
# Copyright 2011 Kyrre Ness Sjøbæk
# This file is part of AcdOpti.
#
# AcdOpti 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 you... | gpl-3.0 |
xxsergzzxx/python-for-android | python3-alpha/python3-src/Lib/multiprocessing/managers.py | 46 | 36645 | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/urlpatterns_reverse/namespace_urls.py | 19 | 2458 | from django.conf.urls import include, url
from . import views
class URLObject(object):
def __init__(self, app_name, namespace):
self.app_name = app_name
self.namespace = namespace
def urls(self):
return ([
url(r'^inner/$', views.empty_view, name='urlobject-view'),
... | mit |
HaliteChallenge/Halite-II | apiserver/apiserver/web/leaderboard.py | 1 | 6215 | """
Leaderboard API endpoints - get/sort/filter the leaderboard
"""
import operator
import flask
import sqlalchemy
from .. import config, model, util
from . import util as api_util
from .blueprint import web_api
_COUNT_KEY = 'count'
_LEADERBOARD_ALIAS = 'full_leaderboard'
def _count_leaderboard_query(where_clause... | mit |
fkolacek/FIT-VUT | bp-revok/python/lib/python2.7/xml/etree/__init__.py | 1200 | 1604 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... | apache-2.0 |
BeyondTheClouds/nova | nova/tests/functional/regressions/test_bug_1548980.py | 11 | 3560 | # Copyright 2016 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
jjz/mailin | python/DNS/Class.py | 31 | 1469 | """
$Id: Class.py,v 1.6.2.1 2011/03/16 20:06:39 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License. See LICENSE for details.
CLASS values (section 3.2.4)
"""
IN = 1 # the Internet
CS = 2 # the... | mit |
gfyoung/pandas | pandas/tests/series/methods/test_astype.py | 1 | 15104 | from datetime import datetime, timedelta
from importlib import reload
import string
import sys
import numpy as np
import pytest
from pandas._libs.tslibs import iNaT
from pandas import (
NA,
Categorical,
CategoricalDtype,
Index,
Interval,
NaT,
Series,
Timedelta,
Timestamp,
cut,... | bsd-3-clause |
swigger/gdb-ios | gdb/testsuite/gdb.perf/gmonster-null-lookup.py | 13 | 1871 | # Copyright (C) 2015-2016 Free Software Foundation, Inc.
# 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 later version.
#
# This progr... | gpl-2.0 |
s4n7h0/Gooey | gooey/_tmp/example_argparse_souce_in_main.py | 9 | 4235 | #!/usr/local/bin/python2.7
# encoding: utf-8
'''
bin.example_argparse_souce -- shortdesc
bin.example_argparse_souce is a description
It defines classes_and_methods
@author: user_name
@copyright: 2013 organization_name. All rights reserved.
@license: license
@contact: user_email
@deffiel... | mit |
isandlaTech/cohorte-devtools | qualifier/deploy/cohorte-home/repo/herald/transports/peer_contact.py | 2 | 5226 | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 1.0.1
:status: Alpha
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except ... | apache-2.0 |
n0m4dz/odoo | addons/account_analytic_plans/wizard/account_crossovered_analytic.py | 341 | 2972 | # -*- 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 |
madan96/sympy | sympy/series/tests/test_fourier.py | 21 | 3982 | from sympy import (symbols, pi, Piecewise, sin, cos, sinc, Rational,
oo, fourier_series, Add)
from sympy.series.fourier import FourierSeries
from sympy.utilities.pytest import raises
x, y, z = symbols('x y z')
fo = fourier_series(x, (x, -pi, pi))
fe = fourier_series(x**2, (-pi, pi))
fp = fourier_se... | bsd-3-clause |
AnhellO/DAS_Sistemas | Ago-Dic-2019/DanielM/PracticaUno/3.10_EveryFunction.py | 1 | 1589 | # 3-10. Every Function: Think of something you could store in a list.
# For example, you could make a list of mountains, rivers, countries, cities, languages, or anything else you’d like.
# Write a program that creates a list containing these items and then uses each function introduced
# in this chapter at least once.... | mit |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/whoosh/idsets.py | 52 | 19132 | """
An implementation of an object that acts like a collection of on/off bits.
"""
import operator
from array import array
from bisect import bisect_left, bisect_right, insort
from whoosh.compat import integer_types, izip, izip_longest, next, xrange
from whoosh.util.numeric import bytes_for_bits
# Number of '1' bit... | mit |
jpotter/angel | lib/angel/util/terminal.py | 2 | 1563 | import os
def terminal_stdout_supports_color():
return os.isatty(1)
def terminal_stderr_supports_color():
return os.isatty(2)
def terminal_get_size():
''' Return a tuple of (width, height, is_true_size); where is_true_size is false when the size is only a guess. '''
# Based on http://stackoverflow.co... | apache-2.0 |
jakemadison/The_Insolvency_Solver | app/__init__.py | 1 | 1913 | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
import os
from flask.ext.login import LoginManager
from flask.ext.openid import OpenID
from config import basedir
import logging
def setup_logger(logger_instance):
if logger.handlers: # prevents the loading of duplicate handlers/log output
... | agpl-3.0 |
glawler/watcher-visualization | src/clients/gpsFeeder/gpsFeeder.py | 2 | 2909 | #!/usr/bin/env python
# @file gpsFeeder.py
# @author Geoff Lawler <geoff.lawler@cobham.com>
# @date 2009-07-15
import gps, os, time, socket, subprocess
def connect():
while 1:
try:
session = gps.gps()
except socket.error:
print "Unable to connect to gpsd, trying again in... | agpl-3.0 |
acamposruiz/quecoins | pybb/migrations/0019_remove_attachment_fields.py | 2 | 12520 | # encoding: utf-8
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()
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(Schem... | bsd-2-clause |
elkingtonmcb/nupic | src/regions/PictureSensorExplorers/horizontal.py | 17 | 1768 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
clemensv/qpid-proton | proton-j/src/main/resources/curl.py | 13 | 1678 | #
# 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... | apache-2.0 |
luxus/home-assistant | tests/components/test_recorder.py | 4 | 2116 | """The tests for the Recorder component."""
# pylint: disable=too-many-public-methods,protected-access
import unittest
import os
from homeassistant.const import MATCH_ALL
from homeassistant.components import recorder
from tests.common import get_test_home_assistant
class TestRecorder(unittest.TestCase):
"""Test... | mit |
nirvn/QGIS | python/plugins/processing/algs/qgis/DeleteColumn.py | 1 | 3179 | # -*- coding: utf-8 -*-
"""
***************************************************************************
DeleteColumn.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
************************... | gpl-2.0 |
nicoTrombon/DjangoPolls | env/Lib/site-packages/django/views/csrf.py | 437 | 5057 | from django.conf import settings
from django.http import HttpResponseForbidden
from django.template import Context, Engine
from django.utils.translation import ugettext as _
from django.utils.version import get_docs_version
# We include the template inline since we need to be able to reliably display
# this error mes... | bsd-3-clause |
kawashiro/dewyatochka2 | src/dewyatochka/core/network/xmpp/client/_base.py | 1 | 4043 | # -*- coding: UTF-8
""" Common client implementation
Private module, for internal use only
Classes
=======
Client -- Abstract XMPP client
Command -- Abstract command to extend client functionality
"""
from abc import ABCMeta, abstractmethod, abstractproperty
from dewyatochka.core.network.entity import Mes... | gpl-3.0 |
poulpito/Flexget | flexget/plugins/sites/redirect.py | 9 | 1549 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('redirect_url')
class UrlRewriteRedirect(object):
"""Rewrites urls... | mit |
gareging/SDN_Framework | ryu/ofproto/ofproto_protocol.py | 36 | 2205 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... | apache-2.0 |
py-geek/City-Air | venv/lib/python2.7/site-packages/pip/pep425tags.py | 91 | 4309 | """Generate and work with PEP 425 Compatibility Tags."""
from __future__ import absolute_import
import re
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
_osx_arch_pat = re.compile(r'(.+)_(... | mit |
Ksys-labs/l4linux | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
ilastik/ilastik-0.5 | ilastik/gui/volumeeditor.py | 1 | 115328 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 C Sommer, C Straehle, U Koethe, FA Hamprecht. 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. Redistribu... | bsd-2-clause |
emawind84/readthedocs.org | readthedocs/rtd_tests/tests/test_api_version_compare.py | 34 | 1173 | from django.test import TestCase
from readthedocs.builds.constants import LATEST
from readthedocs.projects.models import Project
from readthedocs.restapi.views.footer_views import get_version_compare_data
class VersionCompareTests(TestCase):
fixtures = ['eric.json', 'test_data.json']
def test_not_highest(se... | mit |
wmfs/chimp | src/chimp.py | 1 | 4690 | # http://diveintopython3.org/xml.html
import chimpinstall
import chimpbuild
import chimpclean
import chimpcreate
import extract
import settings as chimpSettings
from taskqueue.Queue import Queue
from taskqueue.StreamProcessor import StreamProcessor
from load.Loader import Loader
from taskqueue.Queuer import Queuer
imp... | gpl-3.0 |
abloomston/sympy | sympy/utilities/tests/test_lambdify.py | 4 | 16354 | from sympy.utilities.pytest import XFAIL, raises
from sympy import (
symbols, lambdify, sqrt, sin, cos, tan, pi, acos, acosh, Rational,
Float, Matrix, Lambda, exp, Integral, oo, I, Abs, Function, true, false)
from sympy.printing.lambdarepr import LambdaPrinter
import mpmath
from sympy.utilities.lambdify import ... | bsd-3-clause |
CospanDesign/nysa | nysa/host/driver/gpio.py | 1 | 6941 | #Distributed under the MIT licesnse.
#Copyright (c) 2011 Dave McCoy (dave.mccoy@cospandesign.com)
#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 limitati... | mit |
ariakerstein/twitterFlaskClone | project/lib/python2.7/site-packages/werkzeug/contrib/cache.py | 252 | 27983 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.cache
~~~~~~~~~~~~~~~~~~~~~~
The main problem with dynamic Web sites is, well, they're dynamic. Each
time a user requests a page, the webserver executes a lot of code, queries
the database, renders templates until the visitor gets the page he sees.
... | mit |
ThinkingBridge/platform_external_chromium_org | third_party/closure_linter/closure_linter/checkerbase.py | 135 | 10755 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
dimagol/trex-core | scripts/external_libs/pyzmq-14.5.0/python2/intel/ucs4/64bit/zmq/devices/monitoredqueuedevice.py | 44 | 1994 | """MonitoredQueue classes and functions."""
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq import ZMQError, PUB
from zmq.devices.proxydevice import ProxyBase, Proxy, ThreadProxy, ProcessProxy
from zmq.devices.monitoredqueue import monitored_queue
class Monitore... | apache-2.0 |
tudo-astroparticlephysics/starry_night | starry_night/plotting.py | 1 | 6455 | import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from matplotlib import gridspec, ticker
from matplotlib.lines import Line2D
from mpl_toolkits.axes_grid.inset_locator import inset_axes
import numpy as np
def exponential(x, m, b):
return np.exp(m * x + b)
def plot_kernel_curve(stars, outputfi... | mit |
o5k/openerp-oemedical-v0.1 | openerp/addons/base/module/wizard/base_import_language.py | 105 | 2645 | # -*- 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 |
loxal/zcash | qa/rpc-tests/reindex.py | 144 | 1063 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -reindex with CheckBlockIndex
#
from test_framework.test_framework import BitcoinTestFramework
from t... | mit |
SummerLW/Perf-Insight-Report | third_party/gsutil/third_party/boto/tests/integration/ec2containerservice/test_ec2containerservice.py | 99 | 1749 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.