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 |
|---|---|---|---|---|---|
jdfekete/progressivis | progressivis/vis/histograms.py | 1 | 3627 | """
Visualize a data table with histograms.
"""
import logging
import numbers
import numpy as np
from progressivis.table.nary import NAry
from progressivis.core.slot import SlotDescriptor
from progressivis.stats import Histogram1D
from progressivis.table.table import BaseTable
logger = logging.getLogger(__name__)
... | bsd-2-clause |
thaim/ansible | lib/ansible/modules/cloud/azure/azure_rm_devtestlabarmtemplate_info.py | 20 | 7086 | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# 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',
... | mit |
deniederhut/redicorpus | test/objects_test.py | 1 | 4954 | #!/usr/bin/env python
from arrow import Arrow
from datetime import datetime
import json
from pkg_resources import resource_string
import pytest
from redicorpus import c, objects
import time
gram_length_list = [1, 2, 3]
def test_string():
obj = objects.String('fried')
assert str(obj) == 'fried'
assert len... | bsd-2-clause |
ananti/support-tools | wiki_to_md/impl/converter.py | 15 | 42191 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
bkrukowski/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/read_checksum_from_png.py | 207 | 1877 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/numpy/core/setupscons.py | 43 | 4516 | import os
import sys
import glob
from os.path import join, basename
from numpy.distutils import log
from numscons import get_scons_build_dir
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration,dot_join
from numpy.distutils.command.scons import get_scons_pkg... | agpl-3.0 |
Djlavoy/scrapy | scrapy/xlib/tx/client.py | 164 | 38658 | # -*- test-case-name: twisted.web.test.test_webclient,twisted.web.test.test_agent -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP client.
"""
from __future__ import division, absolute_import
import os
try:
from urlparse import urlunparse
from urllib import splithost, spl... | bsd-3-clause |
maxlikely/scikit-learn | sklearn/metrics/pairwise.py | 1 | 28395 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.metrics.pairwise` submodule implements utilities to evaluate
pairwise distances or affinity of sets of samples.
This module contains both distance metrics and kernels. A brief summary is
given on the two here.
Distance metrics are a function d(a, b) such that d(a, b) < d(... | bsd-3-clause |
gameguy43/usable_image_scraper | sites/fws_lib/tests.py | 1 | 4393 | import unittest2 as unittest
import urllib
import parser
import scraper
known_good_indeces = [1, 2, 3, 11874, 1234]
known_metadata_mappings = {
1234 : {
'url_to_lores_img': u'http://digitalmedia.fws.gov/cgi-bin/getimage.exe?CISOROOT=/natdiglib&CISOPTR=1234&DMSCALE=66.66667&DMWIDTH=700&DMHEIGHT=700&DMX=0&... | gpl-3.0 |
Tatsh-ansible/ansible-modules-core | network/dellos9/dellos9_command.py | 25 | 6997 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
kiwifig/libyuv | gyp_libyuv.py | 179 | 1124 | #!/usr/bin/env python
#
# Copyright 2014 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All cont... | bsd-3-clause |
moraesnicol/scrapy | tests/test_crawl.py | 81 | 9070 | import json
import socket
import logging
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.utils.test import get_crawler
from tests import mock
from tests.spiders import FollowAllSpider, DelaySpider, SimpleSpider, \
BrokenStartRequestsSp... | bsd-3-clause |
RainerSchulz/HomeWatch | node_modules/node-sass/node_modules/node-gyp/gyp/PRESUBMIT.py | 1369 | 3662 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | mit |
rlr/fjord | fjord/redirector/views.py | 6 | 1102 | import logging
from django.http import HttpResponseNotFound, HttpResponseRedirect
from django.views.decorators.cache import never_cache
from fjord.redirector import get_redirectors
logger = logging.getLogger('i.redirector')
# Note: We never want to cache redirects. This allows redirectors to
# capture correct met... | bsd-3-clause |
Azulinho/ansible | lib/ansible/modules/network/ovs/openvswitch_port.py | 20 | 8183 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
# Portions copyright @ 2015 VMware, 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
ANSI... | gpl-3.0 |
fr34k8/Archipel | ArchipelAgent/archipel-agent-centraldb/archipelagentcentraldb/centraldb.py | 1 | 17539 | # -*- coding: utf-8 -*-
#
# centraldb.py
#
# Copyright (C) 2013 Nicolas Ochem (nicolas.ochem@free.fr)
# This file is part of ArchipelProject
# http://archipelproject.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published ... | agpl-3.0 |
ludwiktrammer/odoo | addons/account/models/account_journal_dashboard.py | 3 | 17556 | import json
from datetime import datetime, timedelta
from babel.dates import format_datetime, format_date
from openerp import models, api, _, fields
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.tools.misc import formatLang
class account_journal(models.Model):
_inherit = "account.journa... | agpl-3.0 |
0k/OpenUpgrade | addons/website_gengo/__openerp__.py | 385 | 1387 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | agpl-3.0 |
ta264/nzbget | tests/functional/rename/rename_base_test.py | 1 | 3577 | nzbget_options = ['ParRename=yes', 'RarRename=yes', 'UnpackIgnoreExt=.cbr', 'DirectRename=no']
def test_parrename(nserv, nzbget):
hist = nzbget.download_nzb('parrename.nzb', unpack=True)
assert hist['Status'] == 'SUCCESS/UNPACK'
def test_parrename_backup(nserv, nzbget):
nzb_content = nzbget.load_nzb('parrename.nzb... | gpl-2.0 |
marcydoty/geraldo | site/newsite/django_1_0/tests/regressiontests/forms/localflavor/pl.py | 12 | 22474 | # -*- coding: utf-8 -*-
# Tests for the contrib/localflavor/ PL form fields.
tests = r"""
# PLVoivodeshipSelect ##########################################################
>>> from django.contrib.localflavor.pl.forms import PLVoivodeshipSelect
>>> f = PLVoivodeshipSelect()
>>> f.render('voivodeships','pomerania')
u'<s... | lgpl-3.0 |
ralbayaty/KaggleRetina | Misc_Code/thinning.py | 1 | 1541 | from scipy import weave
import numpy as np
import cv2
import sys
def _thinningIteration(im, iter):
I, M = im, np.zeros(im.shape, np.uint8)
expr = """
for (int i = 1; i < NI[0]-1; i++) {
for (int j = 1; j < NI[1]-1; j++) {
int p2 = I2(i-1, j);
int p3 = I2(i-1, j+1);
int p4 = I2(i, j+1);
int p5 = I2(i+1... | gpl-2.0 |
jorik041/scikit-learn | sklearn/externals/joblib/_multiprocessing_helpers.py | 326 | 1214 | """Helper module to factorize the conditional multiprocessing import logic
We use a distinct module to simplify import statements and avoid introducing
circular dependencies (for instance for the assert_spawning name).
"""
import os
import warnings
# Obtain possible configuration from the environment, assuming 1 (on... | bsd-3-clause |
chenjun0210/tensorflow | tensorflow/contrib/keras/python/keras/datasets/mnist.py | 58 | 1475 | # 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 |
gclenaghan/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
raychorn/knowu | django/djangononrelsample2/django/middleware/locale.py | 102 | 2523 | "This is the locale selecting middleware that will look at accept headers"
from django.conf import settings
from django.core.urlresolvers import (is_valid_path, get_resolver,
LocaleRegexURLResolver)
from django.http import HttpResponseRedirect
from django.utils.cache import patch_... | lgpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm-32/Python-2.7.5/lib/python2.7/distutils/tests/test_config_cmd.py | 70 | 2594 | """Tests for distutils.command.config."""
import unittest
import os
import sys
from test.test_support import run_unittest
from distutils.command.config import dump_file, config
from distutils.tests import support
from distutils import log
class ConfigTestCase(support.LoggingSilencer,
support.Temp... | lgpl-3.0 |
smarbos/adopteitor-client | node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
ballotpath/BallotPath | api/app/viewsd/district.py | 1 | 3459 | #***********************************************************************************************************
# Copyright BallotPath 2014
# Developed by Matt Clyde, Andrew Erland, Shawn Forgie, Andrew Hobbs, Kevin Mark, Darrell Sam, Blake Clough
# Open source under GPL v3 license (https://github.com/mclyde/BallotPath... | gpl-3.0 |
hieukypc/ERP | openerp/addons/analytic/models/analytic.py | 22 | 5384 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api, fields, models
class account_analytic_tag(models.Model):
_name = 'account.analytic.tag'
_description = 'Analytic Tags'
name = fields.Char(string='Analytic Tag', index=True, required... | gpl-3.0 |
openhatch/oh-mainline | mysite/bugsets/models.py | 15 | 2638 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
# vim: set ai et ts=4 sw=4:
# This file is part of OpenHatch.
# Copyright (C) 2014 Elana Hashman
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Fr... | agpl-3.0 |
mmoya/ansible | lib/ansible/inventory/script.py | 109 | 5971 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 option) an... | gpl-3.0 |
mantidproject/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/FitGaussianPeaks.py | 3 | 16972 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | gpl-3.0 |
daannijkamp/sketchy | sketchy/models/static.py | 4 | 2391 | # Copyright 2014 Netflix, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
cmlasu/smm_gem5 | src/mem/slicc/ast/VarExprAST.py | 60 | 2742 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
lijunxyz/leetcode_practice | longest_consecutive_sequence_hard/Solution2.py | 1 | 2302 | # Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
#
# For example,
# Given [100, 4, 200, 1, 3, 2],
# The longest consecutive elements sequence is [1, 2, 3, 4]. Return its length: 4.
#
# Your algorithm should run in O(n) complexity.
# A simple solution but with time co... | mit |
laiqiqi886/kbengine | kbe/src/lib/python/Lib/distutils/filelist.py | 103 | 12720 | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
import os, re
import fnmatch
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
class FileList:
"""A ... | lgpl-3.0 |
tusharjain95/Babblefire | scripts/build-all.py | 1474 | 10189 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
ubc/edx-platform | common/djangoapps/performance/tests/test_logs.py | 110 | 6444 | """Tests that performance data is successfully logged."""
import datetime
import dateutil
import json
import logging
from StringIO import StringIO
from django.test import TestCase
from django.test.client import RequestFactory
from performance.views import performance_log
class PerformanceTrackingTest(TestCase):
... | agpl-3.0 |
jamdin/jdiner-mobile-byte3 | lib/flask/testsuite/blueprints.py | 563 | 28089 | # -*- coding: utf-8 -*-
"""
flask.testsuite.blueprints
~~~~~~~~~~~~~~~~~~~~~~~~~~
Blueprints (and currently modules)
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
import warnings
from flask.testsuite import FlaskTestCase, emi... | apache-2.0 |
alkivi-sas/app-archive | www/cgi/dispatcher.py | 1 | 3515 | #!/usr/bin/python
import sys
import json
reload(sys)
sys.setdefaultencoding("utf-8")
sys.path.append('/')
import cgi
import cgitb
cgitb.enable()
from alkivi.common import logger
# Define the global logger
logger.Logger.instance(
#min_log_level_to_mail = logger.WARNING,
min_log_level_to_mail = None,... | lgpl-3.0 |
drincruz/luigi | examples/spark_als.py | 55 | 4373 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
drewis/android_kernel_msm | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
unixhot/opencmdb | django_mongoengine/mongo_admin/helpers.py | 3 | 6194 | from django.contrib.admin.utils import lookup_field
from django.contrib.admin.helpers import AdminForm as DjangoAdminForm
from django.contrib.admin.helpers import Fieldset as DjangoFieldSet
from django.contrib.admin.helpers import Fieldline as DjangoFieldLine
from django.contrib.admin.helpers import AdminReadonlyField ... | apache-2.0 |
warner/twine | twine/_installed.py | 2 | 2311 | # Copyright 2013 Tres Seaver
# Copyright 2015 Ian Cordasco
# This code was originally licensed under the Python Software Foudation
# License by Tres Seaver. In order to facilitate finding the metadata of
# installed packages, part of the most current implementation of the
# pkginfo.Installed class is reproduced here wi... | apache-2.0 |
ecolitan/fatics | venv/lib/python2.7/site-packages/twisted/scripts/test/test_scripts.py | 35 | 6654 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the command-line scripts in the top-level I{bin/} directory.
Tests for actual functionality belong elsewhere, written in a way that doesn't
involve launching child processes.
"""
from os import devnull, getcwd, chdir
from sys impor... | agpl-3.0 |
radio-astro-tools/spectral-cube | spectral_cube/__init__.py | 4 | 1147 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from ._astropy_init import __version__, test
from pkg_resources import get_distribution, DistributionNotFound
from .spectral_cube import (SpectralCube, VaryingResolutionSpectralCube)
from .dask_spectral_cube import (DaskSpectralCube, DaskVaryingResoluti... | bsd-3-clause |
WtfJoke/rtc2git | migration.py | 2 | 6494 | #!/usr/bin/python3
import argparse
import os
import sys
import configuration
import shouter
from gitFunctions import Commiter
from gitFunctions import Initializer, Differ
from rtcFunctions import ImportHandler
from rtcFunctions import RTCInitializer
from rtcFunctions import RTCLogin
from rtcFunctions import Workspace... | mit |
RO-ny9/python-for-android | python-modules/twisted/twisted/internet/epollreactor.py | 56 | 8121 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An epoll() based implementation of the twisted main loop.
To install the event loop (and you should do this before any connections,
listeners or connectors are added)::
from twisted.internet import epollreactor
epollreactor... | apache-2.0 |
gorjuce/odoo | openerp/addons/base/ir/ir_model.py | 148 | 62274 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
JAOSP/aosp_platform_external_chromium_org | tools/perf_expectations/make_expectations.py | 34 | 12417 | #!/usr/bin/env python
# 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.
# For instructions see:
# http://www.chromium.org/developers/tree-sheriffs/perf-sheriffs
import hashlib
import math
import optpars... | bsd-3-clause |
birryree/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/capture.py | 178 | 14605 | """
per-test stdout/stderr capturing mechanism.
"""
from __future__ import with_statement
import sys
import os
from tempfile import TemporaryFile
import py
import pytest
from py.io import TextIO
unicode = py.builtin.text
patchsysdict = {0: 'stdin', 1: 'stdout', 2: 'stderr'}
def pytest_addoption(parser):
grou... | mpl-2.0 |
abagh0703/RetailTrail | flask/lib/python2.7/site-packages/googlemaps/elevation.py | 3 | 2083 | #
# Copyright 2014 Google Inc. All rights reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | mit |
Cnidarias/al-go-rithms | cryptography/autokey_cipher/autokey.py | 3 | 2625 | # It uses the following Table called Tabula Recta to find the
# ciphertext. The simple intersection of the row and column
# is the ciphertext. Let's say for eg. T is the Key and E is
# the original Plaintext, then the intersection of T column
# and E row is the ciphertext i.e. X. The plaintext and key-
# length must be... | mit |
krieger-od/nwjs_chromium.src | build/vs_toolchain.py | 9 | 8491 | # 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.
import json
import os
import pipes
import shutil
import subprocess
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
chrome_src = os.path... | bsd-3-clause |
t794104/ansible | test/units/modules/network/f5/test_bigip_profile_persistence_cookie.py | 16 | 3942 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
gabrielfalcao/lettuce | tests/integration/lib/Django-1.3/django/db/backends/sqlite3/creation.py | 230 | 3239 | import os
import sys
from django.db.backends.creation import BaseDatabaseCreation
class DatabaseCreation(BaseDatabaseCreation):
# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as is so that
# schema inspection is mor... | gpl-3.0 |
kurli/blink-crosswalk | Tools/Scripts/webkitpy/style/error_handlers_unittest.py | 48 | 8758 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | bsd-3-clause |
repotvsupertuga/repo | instal/plugin.video.SportsDevil/service/oscrypto/_win/_crypt32_cffi.py | 7 | 6008 | # coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
import sys
from .._ffi import FFIEngineError, register_ffi
from .._types import str_cls
from ..errors import LibraryNotFoundError
try:
import cffi
except (ImportError):
raise FFIEngineError('Error importing cf... | gpl-2.0 |
lizardsystem/lizard-datasource | lizard_datasource/scripts.py | 1 | 4130 | import datetime
import logging
import time
from lizard_datasource import datasource
from lizard_datasource import dates
from lizard_datasource import models
from lizard_datasource import properties
logger = logging.getLogger(__name__)
def _yield_drawable_datasources(ds):
# This implements a breadth-first search... | gpl-3.0 |
deanishe/alfred-searchio | src/lib/workflow/workflow3.py | 7 | 21244 | # encoding: utf-8
#
# Copyright (c) 2016 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2016-06-25
#
"""An Alfred 3-only version of :class:`~workflow.Workflow`.
:class:`~workflow.Workflow3` supports Alfred 3's new features, such as
setting :ref:`workflow-va... | mit |
LegNeato/buck | third-party/py/pex/pex/link.py | 36 | 3733 | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import
import os
import posixpath
from collections import Iterable
from .compatibility import string as compatible_string
from .compatibility import PY3
f... | apache-2.0 |
amwelch/a10sdk-python | a10sdk/core/A10_import/import_periodic_xml_schema.py | 2 | 1752 | from a10sdk.common.A10BaseClass import A10BaseClass
class XmlSchema(A10BaseClass):
"""Class Description::
XML-Schema File.
Class xml-schema supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param uuid: {"description": "uu... | apache-2.0 |
bkeepers/pygments.rb | vendor/pygments-main/pygments/styles/murphy.py | 364 | 2751 | # -*- coding: utf-8 -*-
"""
pygments.styles.murphy
~~~~~~~~~~~~~~~~~~~~~~
Murphy's style from CodeRay.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment,... | mit |
maralla/thriftpy | tests/test_protocol_binary.py | 10 | 4294 | # -*- coding: utf-8 -*-
from io import BytesIO
from thriftpy._compat import u
from thriftpy.thrift import TType, TPayload
from thriftpy.utils import hexlify
from thriftpy.protocol import binary as proto
class TItem(TPayload):
thrift_spec = {
1: (TType.I32, "id", False),
2: (TType.LIST, "phones",... | mit |
lmazuel/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/features/v2015_12_01/feature_client.py | 2 | 3447 | # 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 |
smarani/InfraShareMobile | InfraShare Online/venv/lib/python2.7/site-packages/pip/_vendor/progress/bar.py | 510 | 2685 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | apache-2.0 |
MontrealCorpusTools/MFA-reorganization-scripts | SCOTS/clean_scots.py | 1 | 2994 | #!/usr/bin/env python
# Cleans up SCOTS textgrids to be used with the MFA
# [CENSORED: forename]
# <vocallex desc=""eh"" />
# <gap reason=""inaudible"" />
# <unclear></unclear>
# <falsestart>wor-</falsestart>
# <trunc>wor-</trunc>
# [non lexical items, non linguistic events]
import os
import sys
import re
import su... | mit |
mapsme/omim | tools/python/transit/transit_colors_export.py | 13 | 1388 | #!/usr/bin/env python2.7
# It exports all transits colors to colors.txt file.
import argparse
import json
import os.path
if __name__ == '__main__':
parser = argparse.ArgumentParser()
default_colors_path = os.path.dirname(os.path.abspath(__file__)) + '/../../../data/colors.txt'
parser.add_argument('in_out_f... | apache-2.0 |
ratnania/pyccel | pyccel/codegen/compiler.py | 1 | 10646 | # coding: utf-8
import os
import subprocess
# ...
def clean(filename):
"""
removes the generated files: .pyccel and .f90
filename: str
name of the file to parse.
"""
name = filename.split('.py')[0]
for ext in ["f90", "pyccel"]:
f_name = name + "." + ext
cmd = "rm -f " ... | mit |
areski/django | tests/project_template/test_settings.py | 274 | 1083 | import unittest
from django.test import TestCase
from django.utils import six
@unittest.skipIf(six.PY2,
'Python 2 cannot import the project template because '
'django/conf/project_template doesn\'t have an __init__.py file.')
class TestStartProjectSettings(TestCase):
def test_middleware_classes_headers(... | bsd-3-clause |
lmorchard/django | django/contrib/gis/db/backends/base/models.py | 434 | 7111 | import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redu... | bsd-3-clause |
da2ce7/cjdns | contrib/python/pingAll.py | 18 | 2683 | #!/usr/bin/env python2
# You may redistribute this program 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 program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 |
sencha/chromium-spacewalk | third_party/markdown/extensions/toc.py | 109 | 10093 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
childsish/lhc-python | lhc/binf/feature/stc.py | 1 | 6130 | #!/usr/bin/python
import numpy
import ushuffle
from string import maketrans
from sequence.rna_tools import RNAFolder
from FileFormats.FastaFile import iterFasta
FOLDER = RNAFolder()
def kshuffle(seq, k=2):
return ushuffle.shuffle(seq, len(seq), k)
def structuralFeatures(stc):
hloops = []
mloops = []... | gpl-2.0 |
lidavidm/sympy | sympy/printing/preview.py | 3 | 11445 | from __future__ import print_function, division
from os.path import join
import tempfile
import shutil
try:
from subprocess import STDOUT, CalledProcessError
from sympy.core.compatibility import check_output
except ImportError:
pass
from sympy.core.compatibility import cStringIO as StringIO
from sympy.ut... | bsd-3-clause |
courtarro/gnuradio | gr-filter/examples/channelize.py | 58 | 7003 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | gpl-3.0 |
cherusk/ansible | lib/ansible/plugins/action/__init__.py | 4 | 45946 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 option) an... | gpl-3.0 |
msyriac/alhazen | tests/matchedFilter.py | 1 | 2316 | from orphics.tools.io import Plotter
import flipper.liteMap as lm
from szlib.szcounts import ClusterCosmology
from orphics.tools.io import dictFromSection,listFromConfig
from configparser import SafeConfigParser
from alhazen.halos import NFWMatchedFilterSN
import numpy as np
from orphics.tools.cmb import loadTheorySpe... | gpl-3.0 |
krader1961/python-mode | pymode/libs/pylama/config.py | 7 | 6741 | """ Parse arguments from command line and configuration files. """
import fnmatch
import os
import sys
import re
import logging
from argparse import ArgumentParser
from . import __version__
from .libs.inirama import Namespace
from .lint.extensions import LINTERS
#: A default checkers
DEFAULT_LINTERS = 'pep8', 'pyfla... | lgpl-3.0 |
Syrcon/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/handlers.py | 44 | 13193 | import cgi
import json
import os
import traceback
import urllib
import urlparse
from constants import content_types
from pipes import Pipeline, template
from ranges import RangeParser
from request import Authentication
from response import MultipartContent
from utils import HTTPException
__all__ = ["file_handler", "p... | mpl-2.0 |
pschmitt/home-assistant | tests/components/light/test_device_trigger.py | 6 | 8140 | """The test for light device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.light import DOMAIN
from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON
from homeassistant.helpers import device_registry
from ... | apache-2.0 |
trishnaguha/ansible | test/units/modules/system/test_java_keystore.py | 45 | 10489 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Ansible Project
# Copyright (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import os
from units.modules.utils import ModuleTestCase, set_module_args
from units.compat.mock im... | gpl-3.0 |
iancmcc/droppy | droppy/server/command.py | 1 | 2745 | ###############################################################################
##
## Copyright 2013 Ian McCracken
##
## 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://ww... | apache-2.0 |
orbea/redream | deps/capstone/bindings/python/test_detail.py | 33 | 5130 | #!/usr/bin/env python
# Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
from __future__ import print_function
from capstone import *
X86_CODE16 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00"
X86_CODE64 = b"\x55\x48\x8b\x05\xb8\... | gpl-3.0 |
koorukuroo/networkx_for_unicode | networkx/linalg/graphmatrix.py | 9 | 5467 | """
Adjacency matrix and incidence matrix of graphs.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov... | bsd-3-clause |
rmolewska/Python_course | conftest.py | 1 | 2476 |
import pytest
from fixtures.application import Application
import json
import os.path
import importlib
import jsonpickle
from fixtures.db import DbFixture
fixture = None
web_config = None
def load_config(file):
global web_config
if web_config is None:
config_file = os.path.join(os.path.dirname(os.pa... | apache-2.0 |
Sw4T/Warband-Development | mb_warband_module_system_1166/Module_system 1.166/module_tableau_materials.py | 1 | 40655 | from compiler import *
####################################################################################################################
# Each tableau material contains the following fields:
# 1) Tableau id (string): used for referencing tableaux in other files. The prefix tab_ is automatically added before each... | mit |
Zypeh/tomorrow-theme | ipythonqt/tomorrownight.py | 31 | 2459 | # -*- coding: utf-8 -*-
"""
pygments.styles.autumn
~~~~~~~~~~~~~~~~~~~~~~
Tomorrow Night theme for ipython qtconsole (invoke with
ipython qtconsole --style=tomorrownight)
See https://github.com/chriskempson/tomorrow-theme for theme info
:copyright: Copyright 2012 André Risnes, risnes@gmail.c... | mit |
rhiever/bokeh | examples/plotting/file/glucose.py | 18 | 1552 | import pandas as pd
from bokeh.sampledata.glucose import data
from bokeh.plotting import figure, show, output_file, vplot
output_file("glucose.html", title="glucose.py example")
TOOLS = "pan,wheel_zoom,box_zoom,reset,save"
p1 = figure(x_axis_type="datetime", tools=TOOLS)
p1.line(data.index, data['glucose'], color=... | bsd-3-clause |
jeasoft/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py | 384 | 6603 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
debugger06/MiroX | lib/app.py | 2 | 3889 | # Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | gpl-2.0 |
pinnamur/titanium_mobile | support/common/simplejson/tests/test_encode_basestring_ascii.py | 135 | 1880 | from unittest import TestCase
import simplejson.encoder
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0... | apache-2.0 |
bhargav2408/python-for-android | python3-alpha/python3-src/Lib/sqlite3/test/transactions.py | 51 | 7338 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/transactions.py: tests transactions
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
#... | apache-2.0 |
openhatch/oh-mainline | vendor/packages/twisted/twisted/test/stdio_test_loseconn.py | 19 | 1503 | # -*- test-case-name: twisted.test.test_stdio.StandardInputOutputTestCase.test_loseConnection -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Main program for the child process run by
L{twisted.test.test_stdio.StandardInputOutputTestCase.test_loseConnection} to
test that ITransport.lose... | agpl-3.0 |
pshen/ansible | lib/ansible/plugins/action/iosxr_config.py | 79 | 4164 | #
# (c) 2017, 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... | gpl-3.0 |
abstract-open-solutions/OCB | addons/crm_partner_assign/wizard/__init__.py | 389 | 1038 | # -*- 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 |
ganeti/ganeti | lib/storage/container.py | 1 | 14259 | #
#
# Copyright (C) 2009, 2011, 2012 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of con... | bsd-2-clause |
huongttlan/statsmodels | statsmodels/sandbox/distributions/tests/_est_fit.py | 31 | 2609 | # NOTE: contains only one test, _est_cont_fit, that is renamed so that
# nose doesn't run it
# I put this here for the record and for the case when someone wants to
# verify the quality of fit
# with current parameters: relatively small sample size, default starting values
# Ran 84 tests in 401.797s
# ... | bsd-3-clause |
luthfii/xsched | tools/xm-test/tests/network/03_network_local_tcp_pos.py | 42 | 2073 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2006
# Author: <dykman@us.ibm.com>
# TCP tests on local interfaces.
# - creates a single guest domain
# - sets up a single NIC
# - conducts hping tcp tests to the local loopback and IP address
# hping2 127.0.0.1 -c 1 -d $size
# hping2 $loca... | gpl-2.0 |
Innovahn/odoo.old | addons/account/test/test_parent_structure.py | 432 | 2108 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.