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 |
|---|---|---|---|---|---|
windinthew/audacity | lib-src/lv2/lv2/plugins/eg-metro.lv2/waflib/Utils.py | 181 | 9106 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,traceback,inspect,re,shutil,datetime,gc
import subprocess
try:
from collections import deque
except ImportError:
class deque(list):
def popleft(self):
... | gpl-2.0 |
bbc/kamaelia | Sketches/TG/soc2007/shard_final/InitShard.py | 15 | 2624 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | apache-2.0 |
spektom/incubator-airflow | airflow/providers/google/cloud/operators/functions.py | 4 | 16420 | #
# 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 |
Mec-iS/chronostriples-backup | lib/rdflib/events.py | 22 | 2618 | __doc__ = """
Dirt Simple Events
A Dispatcher (or a subclass of Dispatcher) stores event handlers that
are 'fired' simple event objects when interesting things happen.
Create a dispatcher:
>>> d = Dispatcher()
Now create a handler for the event and subscribe it to the dispatcher
to handle Event events. A handler... | apache-2.0 |
emmanuelle/multi-diffusion | doc/conf.py | 1 | 8597 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# multidiff documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 5 15:11:19 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# ... | bsd-3-clause |
TheWardoctor/Wardoctors-repo | plugin.video.oculus/resources/lib/plugins/unidecode/x07f.py | 252 | 4664 | data = (
'Zhui ', # 0x00
'Zi ', # 0x01
'Ke ', # 0x02
'Xiang ', # 0x03
'Jian ', # 0x04
'Mian ', # 0x05
'Lan ', # 0x06
'Ti ', # 0x07
'Miao ', # 0x08
'Qi ', # 0x09
'Yun ', # 0x0a
'Hui ', # 0x0b
'Si ', # 0x0c
'Duo ', # 0x0d
'Duan ', # 0x0e
'Bian ', # 0x0f
'Xian ', # 0x10
'... | apache-2.0 |
hoheinzollern/tracker | tests/functional-tests/common/utils/dconf.py | 3 | 2822 | from gi.repository import GLib
from gi.repository import Gio
import os
from helpers import log
class DConfClient(object):
"""
Allow changing Tracker configuration in DConf.
Tests should be run with a separate DConf profile so that these changes do
not affect the user's configuration. The 'trackertes... | lgpl-2.1 |
tmhm/scikit-learn | sklearn/mixture/tests/test_gmm.py | 200 | 17427 | import unittest
import copy
import sys
from nose.tools import assert_true
import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_raises)
from scipy import stats
from sklearn import mixture
from sklearn.datasets.samples_generator import make_spd_ma... | bsd-3-clause |
piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/io/fits/hdu/nonstandard.py | 1 | 4066 | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import gzip
import io
from ..file import _File
from .base import NonstandardExtHDU
from .hdulist import HDUList
from ..header import Header, _pad_length
from ..util import fileobj_name
from ....extern.six import string_types
from ....utils import lazypro... | mit |
thnee/ansible | lib/ansible/modules/cloud/ovirt/ovirt_host.py | 13 | 26104 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | gpl-3.0 |
SSJohns/osf.io | website/tokens/__init__.py | 38 | 3558 | import httplib as http
import functools
import jwt
from flask import request
from framework.exceptions import HTTPError
from website import settings
from website.tokens import handlers
from website.tokens.exceptions import TokenHandlerNotFound
class TokenHandler(object):
HANDLERS = {
'approve_registrati... | apache-2.0 |
sh-ft/mudwyrm_users | mudwyrm_users/admin/achaea/scripts/brain/combat.py | 1 | 8663 | from mudwyrm_users.admin.achaea import ScriptState
from mudwyrm_users.admin.achaea.action import Action, Outcome, EventOutcome
from mudwyrm_users.admin.achaea.trigger import Trigger, Alias, OnEvent, TriggerPack
from mudwyrm_users.admin.achaea.common import not_, traverse_scripts, AttrDict, partition_action
from mudwyrm... | mit |
majora2007/plexpy | lib/mutagen/aac.py | 31 | 11384 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
"""
* ADTS - Audio Data Transport Stream
* ADIF - Audio Data Interch... | gpl-3.0 |
DougFirErickson/PDAL | vendor/gtest-1.7.0/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | bsd-3-clause |
GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/windows_benchmarks/diskspd_benchmark.py | 1 | 1623 | # Copyright 2018 PerfKitBenchmarker 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 appli... | apache-2.0 |
georgemarshall/django | django/db/migrations/writer.py | 59 | 11293 |
import os
import re
from importlib import import_module
from django import get_version
from django.apps import apps
# SettingsReference imported for backwards compatibility in Django 2.2.
from django.conf import SettingsReference # NOQA
from django.db import migrations
from django.db.migrations.loader import Migrati... | bsd-3-clause |
brennie/reviewboard | contrib/internal/webapi-lint.py | 8 | 16606 | #!/usr/bin/env python
from __future__ import print_function, unicode_literals
import os
import re
import sys
scripts_dir = os.path.abspath(os.path.dirname(__file__))
rb_dir = os.path.abspath(os.path.join(scripts_dir, '..', '..'))
sys.path.insert(0, rb_dir)
sys.path.insert(0, os.path.join(scripts_dir, 'conf'))
os.e... | mit |
garnertb/fire-risk | fire_risk/backends/__init__.py | 1 | 2548 | import psycopg2
from .queries import ALL_RESIDENTIAL_FIRES
from psycopg2.extras import DictCursor
class Backend(object):
"""
Backend mixin that should be used to implement APIs to read data.
"""
def connect(self):
"""
Connect to the backend.
"""
raise NotImplementedEr... | mit |
ychaim/explorer | addresses/migrations/0001_initial.py | 2 | 1797 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | apache-2.0 |
daeiron/LGD855_kernel | 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 |
godfather1103/WeiboRobot | python27/1.0/lib/lib2to3/fixes/fix_throw.py | 327 | 1586 | """Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. im... | gpl-3.0 |
bitbouncer/avro | lang/py/test/test_tether_task.py | 20 | 3589 | # 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 u... | apache-2.0 |
costypetrisor/scikit-learn | examples/linear_model/plot_ols_ridge_variance.py | 387 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Ordinary Least Squares and Ridge Regression Variance
=========================================================
Due to the few points in each dimension and the straight
line that linear regression uses to follow thes... | bsd-3-clause |
edxnercel/edx-platform | .pycharm_helpers/profiler/thrift/Thrift.py | 253 | 4543 | #
# 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 u... | agpl-3.0 |
gardir/Devilry_sort | sort_deliveries.py | 1 | 18439 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
import time
import shutil
import glob
from rettescript import print_failed
class Devilry_Sort:
def __init__(self,
rootDir,
execute=True,
delete=False,
log=False,
... | gpl-2.0 |
ruijie/quantum | quantum/plugins/cisco/tests/unit/test_l2networkApi.py | 6 | 48730 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco 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... | apache-2.0 |
caioariede/sorl-thumbnail | sorl/thumbnail/management/commands/thumbnail.py | 3 | 1544 | # -*- encoding: utf8 -*-
from __future__ import unicode_literals, print_function
import sys
from django.core.management.base import BaseCommand, CommandError
from sorl.thumbnail import default
class Command(BaseCommand):
help = (
'Handles thumbnails and key value store'
)
args = '[cleanup, clea... | bsd-3-clause |
billyhunt/osf.io | scripts/osfstorage/fix_download_counts.py | 40 | 4754 | from __future__ import unicode_literals
import sys
import logging
from datetime import datetime
from framework.mongo import database
from website.app import init_app
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
logger = logging.getLogger(__name__)
# 2015 Sept 1... | apache-2.0 |
dariemp/odoo | addons/base_report_designer/__init__.py | 421 | 1136 | # -*- 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 |
nguyenquach/pychess | lib/pychess/Utils/Cord.py | 22 | 2392 | from __future__ import absolute_import
from .lutils.lmove import FILE, RANK
class CordFormatException(Exception): pass
class Cord:
def __init__ (self, var1, var2 = None):
""" Inits a new highlevel cord object.
The cord B3 can be inited in the folowing ways:
Cord(17), Cord("b3")... | gpl-3.0 |
mne-tools/mne-tools.github.io | 0.22/_downloads/52a5ebd4d6b8bcb7eccdf9bc2b0fcfcc/plot_cluster_stats_evoked.py | 18 | 3021 | """
=======================================================
Permutation F-test on sensor data with 1D cluster level
=======================================================
One tests if the evoked response is significantly different
between conditions. Multiple comparison problem is addressed
with cluster level permuta... | bsd-3-clause |
wholebiome/aegea | aegea/packages/github3/repos/status.py | 5 | 1413 | # -*- coding: utf-8 -*-
"""
github3.repos.status
====================
This module contains the Status object for GitHub's commit status API
"""
from __future__ import unicode_literals
from ..models import GitHubObject
from ..users import User
class Status(GitHubObject):
"""The :class:`Status <Status>` object. ... | apache-2.0 |
taxido/django-xadmin | xadmin/filters.py | 9 | 21480 | from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.template.loader import get_template
from django.template.context import Context
from ... | bsd-3-clause |
ravindrapanda/tensorflow | tensorflow/contrib/training/python/training/sequence_queueing_state_saver.py | 28 | 78840 | # 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 |
kaplun/invenio | modules/oairepository/lib/oai_repository_webinterface.py | 22 | 5993 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your ... | gpl-2.0 |
run2/citytour | 4symantec/Lib/site-packages/numpy-1.9.2-py2.7-win-amd64.egg/numpy/lib/user_array.py | 111 | 7764 | """
Standard container-class for easy multiple-inheritance.
Try to inherit from the ndarray instead of using this class as this is not
complete.
"""
from __future__ import division, absolute_import, print_function
from numpy.core import (
array, asarray, absolute, add, subtract, multiply, divide,
remainder, p... | mit |
Hazelsuko07/17WarmingUp | py3.6/lib/python3.6/site-packages/pip/_vendor/requests/packages/chardet/constants.py | 3008 | 1335 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
srluge/SickRage | lib/guessit/quality.py | 51 | 2245 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Rémi Alvergnat <toilal.dev@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the... | gpl-3.0 |
fypyuhu/laravel5.0 | public/filemanager/utils/generate-lang.py | 76 | 2866 | #!/usr/bin/python2.6
# Generate lang files with en.js file as reference
# if key does not exist in json file, the key and value are added from reference file (en.js)
# Usage : $ python ./utils/generate-lang.py
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\03... | mit |
sandeepgupta2k4/tensorflow | tensorflow/python/saved_model/builder.py | 126 | 1271 | # 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 |
yashsharan/sympy | sympy/printing/llvmjitcode.py | 11 | 16760 | from __future__ import print_function, division
'''
Use llvmlite to create executable functions from Sympy expressions
This module requires llvmlite (https://github.com/numba/llvmlite).
'''
import ctypes
from sympy.external import import_module
from sympy.printing.printer import Printer
from sympy import S, Indexed... | bsd-3-clause |
googlearchive/big-rig | app/src/thirdparty/telemetry/internal/story_runner_unittest.py | 4 | 23387 | # 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 os
import StringIO
import sys
import unittest
from catapult_base import cloud_storage
from telemetry import benchmark
from telemetry.core import exce... | apache-2.0 |
wbyne/QGIS | python/ext-libs/pygments/lexers/chapel.py | 19 | 3458 | # -*- coding: utf-8 -*-
"""
pygments.lexers.chapel
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Chapel language.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, bygroups, words
from pygments.token import... | gpl-2.0 |
Sorsly/subtle | google-cloud-sdk/lib/third_party/dns/rdata.py | 13 | 15532 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation 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 PROVIDED ... | mit |
aljim/deploymentmanager-samples | tools/scheduled-deployments/sd_template.py | 3 | 2110 | """Create resources needed to implement Scheduled Deployments."""
def generate_config(context):
"""Generates configuration."""
deployment_name = context.env['deployment']
type_provider_name = context.properties['typeProviderName']
scheduling_function_name = context.properties['routerFunctionName']
deployme... | apache-2.0 |
gurnec/HashCheck | UnitTests/get-sha-test-vectors.py | 1 | 3573 | #!/usr/bin/python3
#
# SHA test vector downloader & builder
# Copyright (C) 2016 Christopher Gurnee. All rights reserved.
#
# Please refer to readme.md for information about this source code.
# Please refer to license.txt for details about distribution and modification.
#
# Downloads/builds SHA1-3 test vectors... | bsd-3-clause |
WeichenXu123/spark | examples/src/main/python/ml/bisecting_k_means_example.py | 31 | 1992 | #
# 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 |
psi29a/txmongo | examples/inlinecallbacks/group.py | 5 | 1087 | #!/usr/bin/env python
# coding: utf-8
# Copyright 2009-2014 The txmongo authors. All rights reserved.
# Use of this source code is governed by the Apache License that can be
# found in the LICENSE file.
import _local_path
import txmongo
from twisted.internet import defer, reactor
@defer.inlineCallbacks
def example()... | apache-2.0 |
silenceli/nova | nova/network/base_api.py | 4 | 11985 | # Copyright 2014 OpenStack Foundation
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
Architektor/PySnip | venv/lib/python2.7/site-packages/pip/_vendor/packaging/version.py | 1151 | 11556 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... | gpl-3.0 |
jendap/tensorflow | tensorflow/contrib/distributions/python/ops/mvn_diag_plus_low_rank.py | 22 | 10166 | # 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 |
slevenhagen/odoo-npg | addons/mrp_operations/report/__init__.py | 443 | 1131 | # -*- 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 |
kkoksvik/FreeCAD | src/Mod/Start/StartPage/LoadMRU0.py | 32 | 1836 | #***************************************************************************
#* *
#* Copyright (c) 2012 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
reviewboard/reviewboard | reviewboard/accounts/backends/nis.py | 2 | 4451 | """NIS authentication backend."""
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from reviewboard.accounts.backends.base import BaseAuthBackend
from reviewboard.accounts.form... | mit |
drewandersonnz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/openshift_health_checker/test/elasticsearch_test.py | 49 | 6248 | import pytest
import json
from openshift_checks.logging.elasticsearch import Elasticsearch, OpenShiftCheckExceptionList
task_vars_config_base = dict(openshift=dict(common=dict(config_base='/etc/origin')))
def canned_elasticsearch(task_vars=None, exec_oc=None):
"""Create an Elasticsearch check object with stubb... | apache-2.0 |
eeason3/Bootstrap | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | mit |
0-wiz-0/audacity | lib-src/lv2/sord/waflib/Tools/c_tests.py | 330 | 4280 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature,before_method,after_method
import sys
LIB_CODE='''
#ifdef _MSC_VER
#define testEXP... | gpl-2.0 |
xodus7/tensorflow | tensorflow/python/layers/normalization.py | 9 | 15178 | # 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 |
scrollback/kuma | migrations/south/constance/0001_initial.py | 5 | 1103 | # encoding: 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 'Constance'
db.create_table('constance_config', (
('id', self.gf('django.db.mod... | mpl-2.0 |
kevin-intel/scikit-learn | sklearn/cluster/tests/test_dbscan.py | 14 | 15405 | """
Tests for DBSCAN clustering algorithm
"""
import pickle
import numpy as np
import warnings
from scipy.spatial import distance
from scipy import sparse
import pytest
from sklearn.utils._testing import assert_array_equal
from sklearn.neighbors import NearestNeighbors
from sklearn.cluster import DBSCAN
from skle... | bsd-3-clause |
eleonrk/SickRage | lib/webencodings/mklabels.py | 512 | 1305 | """
webencodings.mklabels
~~~~~~~~~~~~~~~~~~~~~
Regenarate the webencodings.labels module.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
import json
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
def asser... | gpl-3.0 |
wazeerzulfikar/scikit-learn | sklearn/svm/tests/test_bounds.py | 6 | 2369 | import numpy as np
from scipy import sparse as sp
from sklearn.svm.bounds import l1_min_c
from sklearn.svm import LinearSVC
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.utils.testing import assert_true, raises
from sklearn.utils.testing import assert_raise_message
dense_X = [[-1, 0], [0... | bsd-3-clause |
ktan2020/legacy-automation | win/Lib/_LWPCookieJar.py | 63 | 6723 | """Load / save to libwww-perl (LWP) format files.
Actually, the format is slightly extended from that used by LWP's
(libwww-perl's) HTTP::Cookies, to avoid losing some RFC 2965 information
not recorded by LWP.
It uses the version string "2.0", though really there isn't an LWP Cookies
2.0 format. This indicate... | mit |
hobarrera/django | django/db/backends/postgresql/introspection.py | 51 | 10204 | from __future__ import unicode_literals
from collections import namedtuple
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
class DatabaseIntr... | bsd-3-clause |
Eksmo/calibre | src/calibre/ebooks/lrf/pylrs/pylrs.py | 24 | 80650 | # Copyright (c) 2007 Mike Higgins (Falstaff)
# Modifications from the original:
# Copyright (C) 2007 Kovid Goyal <kovid@kovidgoyal.net>
# 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 with... | gpl-3.0 |
alhashash/account-financial-tools | account_asset_management_xls/report/account_asset_report_xls.py | 34 | 40165 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | agpl-3.0 |
PKUCloud/qemu-1.2.2-replay | scripts/qemu-gdb.py | 286 | 2813 | #!/usr/bin/python
# GDB debugging support
#
# Copyright 2012 Red Hat, Inc. and/or its affiliates
#
# Authors:
# Avi Kivity <avi@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2. See
# the COPYING file in the top-level directory.
#
# Contributions after 2012-01-13 are licensed under the... | gpl-2.0 |
birkin/illiad_webservice | config/passenger_wsgi.py | 2 | 1664 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, pprint, sys
"""
WSGI config for django_template_project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
... | mit |
tcheehow/MissionPlanner | Lib/pkgutil.py | 50 | 20596 | """Utilities to support packages."""
# NOTE: This module must remain compatible with Python 2.3, as it is shared
# by setuptools for distribution with Python 2.3 and up.
import os
import sys
import imp
import os.path
from types import ModuleType
__all__ = [
'get_importer', 'iter_importers', 'get_load... | gpl-3.0 |
NINAnor/QGIS | python/plugins/processing/gui/AlgorithmDialogBase.py | 1 | 6211 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmDialogBase.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************... | gpl-2.0 |
ominux/scikit-learn | examples/linear_model/plot_sgd_iris.py | 4 | 2171 | """
========================================
Plot multi-class SGD on the iris dataset
========================================
Plot decision surface of multi-class SGD on iris dataset.
The hyperplanes corresponding to the three one-versus-all (OVA) classifiers
are represented by the dashed lines.
"""
print __doc__
i... | bsd-3-clause |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v2_2_0/device_viewer_security_acls_ckp_grid_broker.py | 18 | 4822 | from ..broker import Broker
class DeviceViewerSecurityAclsCkpGridBroker(Broker):
controller = "device_viewer_security_acls_ckp_grids"
def index(self, **kwargs):
"""Lists the available device viewer security acls ckp grids. Any of the inputs listed may be be used to narrow the list; other inputs will ... | apache-2.0 |
sgallagher/anaconda | pyanaconda/display.py | 3 | 12577 | #
# display.py: graphical display setup for the Anaconda GUI
#
# Copyright (C) 2016
# Red Hat, Inc. All rights reserved.
#
# 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 t... | gpl-2.0 |
OPM/opm-common | python/pybind11/tests/test_chrono.py | 27 | 2890 | from pybind11_tests import chrono as m
import datetime
def test_chrono_system_clock():
# Get the time from both c++ and datetime
date1 = m.test_chrono1()
date2 = datetime.datetime.today()
# The returned value should be a datetime
assert isinstance(date1, datetime.datetime)
# The numbers sho... | gpl-3.0 |
shravya-ks/ECN-ns3 | src/virtual-net-device/bindings/modulegen__gcc_LP64.py | 2 | 225256 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
nathanielvarona/airflow | airflow/providers/apache/sqoop/hooks/sqoop.py | 1 | 15515 | #
# 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 |
gaganmac/learnfast | lib/werkzeug/formparser.py | 312 | 21127 | # -*- coding: utf-8 -*-
"""
werkzeug.formparser
~~~~~~~~~~~~~~~~~~~
This module implements the form parsing. It supports url-encoded forms
as well as non-nested multipart uploads.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more deta... | apache-2.0 |
andywalz/PyFileMaker | setup.py | 1 | 1145 | #!/usr/bin/env python
from setuptools import setup
from PyFileMaker import __version__
setup(
name='PyFileMaker',
version=__version__,
description='Python Object Wrapper for FileMaker Server XML Interface',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
... | bsd-3-clause |
ApuliaSoftware/odoo | addons/hr_timesheet_invoice/report/account_analytic_profit.py | 281 | 5811 | # -*- 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 |
PongPi/isl-odoo | addons/hr_holidays/__openerp__.py | 260 | 3101 | # -*- 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 |
mrphrazer/miasm | test/arch/x86/unit/mn_psrl_psll.py | 5 | 1561 | #! /usr/bin/env python2
import sys
from asm_test import Asm_Test_32
class Test_PSRL(Asm_Test_32):
TXT = '''
main:
CALL next
.byte 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11
.byte 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
next:
POP EBP
MOVQ MM0, QWORD PTR [EBP]
... | gpl-2.0 |
hoatle/odoo | addons/l10n_hn/__openerp__.py | 343 | 2260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore Josué Trimarchi Pinto <salvatore@trigluu.com>
# (http://trigluu.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | agpl-3.0 |
haykeh/capirca | tools/ldpush/push.py | 7 | 5873 | #!/usr/bin/python
#
# Copyright 2013 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
jpvanhal/cloudsizzle | cloudsizzle/scrapers/oodi/items.py | 1 | 1589 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009-2010 CloudSizzle Team
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
#... | mit |
openstack/nova-powervm | nova_powervm/tests/virt/powervm/volume/test_vscsi.py | 2 | 25564 | # Copyright 2015, 2018 IBM Corp.
#
# 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 require... | apache-2.0 |
sigma-random/pyew | envi/memcanvas/renderers/__init__.py | 17 | 1219 |
"""
Some of the basic/universal memory renderers.
"""
import struct
import envi.memcanvas as e_canvas
class ByteRend(e_canvas.MemoryRenderer):
__fmt_char__ = "B"
def __init__(self, bigend=False):
self.fmtbase = "<"
if bigend:
self.fmtbase = ">"
self.width = struct.cal... | gpl-2.0 |
srluge/SickRage | sickbeard/versionChecker.py | 1 | 33707 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | gpl-3.0 |
stev47/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 |
Integral-Technology-Solutions/ConfigNOW | Lib/xml/dom/html/HTMLBaseFontElement.py | 3 | 1779 | ########################################################################
#
# File Name: HTMLBaseFontElement
#
# Documentation: http://docs.4suite.com/4DOM/HTMLBaseFontElement.html
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM ... | mit |
Vvucinic/Wander | venv_2_7/lib/python2.7/site-packages/traitlets/config/loader.py | 3 | 28215 | # encoding: utf-8
"""A simple configuration system."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import argparse
import copy
import logging
import os
import re
import sys
import json
from ast import literal_eval
from ipython_genutils.path import filefind
fro... | artistic-2.0 |
damonkohler/sl4a | python/src/Lib/test/test_zipfile.py | 48 | 40477 | # We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import zipfile, os, unittest, sys, shutil, struct
from StringIO import StringIO
from tempfile import TemporaryFile
from random import randint, random
import test.test_support as support
from test.test_support impo... | apache-2.0 |
mjmaldonado/Introduction-To-Python | lesson_002/lists.py | 2 | 3677 | from __future__ import print_function # Ignore this line until next month
# Section 5 of Lesson 2
# The following are lists
['here', 'is', 'a', 'list', 'of', 'strings']
['one element list']
[] # Empty list
# Unlike strings and tuples, lists *are* mutable.
fibonacci = [1, 1, 2, 3, 5, 8, 13, 21, 34]
print('Before:', ... | mit |
frt-arch/taiga-back | taiga/projects/wiki/admin.py | 13 | 1373 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | agpl-3.0 |
Jigsaw-Code/net-analysis | netanalysis/traffic/data/api_repository.py | 1 | 3175 | #!/usr/bin/python
#
# Copyright 2019 Jigsaw Operations LLC
#
# 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 applicabl... | apache-2.0 |
openstate/yournextrepresentative | candidates/diffs.py | 1 | 8701 | # The functions in this file are to help produce human readable diffs
# between our JSON representation of candidates.
import re
from django.conf import settings
from django.utils.translation import ugettext as _
import jsonpatch
import jsonpointer
def get_descriptive_value(election, attribute, value, leaf):
... | agpl-3.0 |
indictranstech/fbd_frappe | frappe/hooks.py | 2 | 5173 | from __future__ import unicode_literals
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """## Frappe Framework
Frappe is a full stack web application framework written in Python,
Javascript, HTML/CSS with MySQL as the backend. It was built for ERPNex... | mit |
iwm911/plaso | plaso/classifier/scanner.py | 1 | 24473 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | apache-2.0 |
ojii/sandlib | lib/lib-python/2.7/lib2to3/btm_matcher.py | 326 | 6834 | """A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes ... | bsd-3-clause |
Lancher/tornado | tornado/httpserver.py | 4 | 12986 | #
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
DougBurke/astropy | astropy/convolution/tests/test_convolve_nddata.py | 2 | 1720 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from ..convolve import convolve, convolve_fft
from ..kernels import Gaussian2DKernel
from ...nddata import NDData
def test_basic_nddata():
arr = np.zeros((11, 11))
arr[5, 5] = 1
ndd = NDData(arr)
test_ke... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.