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 |
|---|---|---|---|---|---|
linuxium/ubuntu-yakkety | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
lenovor/scikit-learn | examples/mixture/plot_gmm_selection.py | 248 | 3223 | """
=================================
Gaussian Mixture Model Selection
=================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in th... | bsd-3-clause |
lakshayg/tensorflow | tensorflow/examples/speech_commands/train.py | 12 | 16629 | # 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 |
particleKIT/hostlist | hostlist/hostlist.py | 1 | 9496 | #!/usr/bin/env python3
import logging
import types
from collections import defaultdict
import os
import sys
import ipaddress
import itertools
import glob
import yaml
from typing import Dict, Tuple
try:
from yaml import CSafeLoader as SafeLoader # type: ignore
except ImportError:
from yaml import SafeLoader # t... | gpl-3.0 |
grue/kafka-python | kafka/util.py | 15 | 4482 | import binascii
import collections
import struct
import sys
from threading import Thread, Event
import six
from kafka.common import BufferUnderflowError
def crc32(data):
return binascii.crc32(data) & 0xffffffff
def write_int_string(s):
if s is not None and not isinstance(s, six.binary_type):
raise... | apache-2.0 |
florianbeer/librenms | services-wrapper.py | 6 | 13196 | #! /usr/bin/env python2
"""
services-wrapper A small tool which wraps around check-services.php and tries to
guide the services process with a more modern approach with a
Queue and workers.
Based on the original version of poller-wrapper.py by Job Snijders
Author: Neil Lathwo... | gpl-3.0 |
djbaldey/django | django/db/backends/mysql/client.py | 520 | 1518 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
@classmethod
def settings_to_cmd_args(cls, settings_dict):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dic... | bsd-3-clause |
DamnWidget/mamba | mamba/enterprise/mysql.py | 3 | 17269 | # -*- test-case-name: mamba.test.test_database -*-
# Copyright (c) 2012 Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
"""
.. module:: mysql_adapter
:platform: Unix, Windows
:synopsis: MySQL adapter for create MySQL tables
.. moduleauthor:: Oscar Campos <oscar.campos@member.fsf.org>... | gpl-3.0 |
FederatedAI/FATE | python/fate_client/pipeline/component/hetero_fast_secureboost.py | 1 | 1367 | #
# Copyright 2019 The FATE 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 |
nubjs/nubjs | tools/gyp/pylib/gyp/easy_xml.py | 1049 | 4803 | # Copyright (c) 2011 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.
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
... | mit |
ishank08/scikit-learn | sklearn/ensemble/base.py | 19 | 5168 | """
Base class for ensemble-based estimators.
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
import numbers
from ..base import clone
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..utils import _get_n_jobs, check_random_state
MAX_RAND_SEED = np.iinfo(np.int32).... | bsd-3-clause |
Juniper/nova | nova/tests/unit/fake_pci_device_pools.py | 83 | 1457 | # Copyright 2014 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 required by app... | apache-2.0 |
fly19890211/edx-platform | lms/djangoapps/lms_xblock/migrations/0001_initial.py | 110 | 4883 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'XBlockAsidesConfig'
db.create_table('lms_xblock_xblockasidesconfig', (
('id', se... | agpl-3.0 |
jerome-jacob/selenium | py/selenium/webdriver/opera/webdriver.py | 71 | 3352 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
cycotech/WAR-app | env/lib/python3.5/site-packages/django/views/decorators/clickjacking.py | 335 | 1744 | from functools import wraps
from django.utils.decorators import available_attrs
def xframe_options_deny(view_func):
"""
Modifies a view function so its response has the X-Frame-Options HTTP
header set to 'DENY' as long as the response doesn't already have that
header set.
e.g.
@xframe_optio... | mit |
alexgorban/models | research/attention_ocr/python/train.py | 17 | 7328 | # 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 applicab... | apache-2.0 |
veger/ansible | contrib/inventory/cloudstack.py | 42 | 10491 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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... | gpl-3.0 |
nburn42/tensorflow | tensorflow/contrib/text/python/ops/skip_gram_ops_test.py | 50 | 23107 | # 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 |
zaenalarifin/openshot_jmd | openshot/windows/TransitionProperties.py | 1 | 6330 | # OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
jstasiak/python-zeroconf | tests/test_updates.py | 1 | 2301 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Unit tests for zeroconf._services. """
import logging
import socket
from threading import Event
import pytest
import zeroconf as r
from zeroconf import const
from zeroconf import Zeroconf
from zeroconf._services.browser import ServiceBrowser
from zeroconf._services... | lgpl-2.1 |
sajeeshcs/nested_projects_keystone | keystone/tests/test_no_admin_token_auth.py | 6 | 2214 | # Copyright 2013 OpenStack Foundation
#
# 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 |
edx/edx-platform | common/djangoapps/student/management/tests/test_transfer_students.py | 4 | 5736 | """
Tests the transfer student management command
"""
import unittest
from unittest.mock import call, patch
import ddt
from django.conf import settings
from django.core.management import call_command
from opaque_keys.edx import locator
from common.djangoapps.course_modes.models import CourseMode
from common.djangoa... | agpl-3.0 |
varunarya10/boto | boto/vpc/vpngateway.py | 170 | 2853 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
abhi11/tanglu-dak | dak/generate_packages_sources2.py | 3 | 15706 | #!/usr/bin/python
"""
Generate Packages/Sources files
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2011 Ansgar Burchardt <ansgar@debian.org>
@copyright: Based on daklib/lists.py and dak/generate_filelist.py:
2009-2011 Torsten Werner <twerner@debian.org>
@copyright: Based on dak/generat... | gpl-2.0 |
yetilinux/yetiweb | main/migrations/0044_auto__chg_field_todolist_date_added.py | 4 | 12236 | # 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):
db.alter_column('todolists', 'date_added', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True))
def ba... | gpl-2.0 |
MoonshineSG/OctoPrint | src/octoprint/plugin/__init__.py | 3 | 23582 | # coding=utf-8
"""
This module represents OctoPrint's plugin subsystem. This includes management and helper methods as well as the
registered plugin types.
.. autofunction:: plugin_manager
.. autofunction:: plugin_settings
.. autofunction:: call_plugin
.. autoclass:: PluginSettings
:members:
"""
from __future__... | agpl-3.0 |
halfcrazy/sqlalchemy | test/orm/test_composites.py | 24 | 29356 | from sqlalchemy.testing import assert_raises, assert_raises_message
import sqlalchemy as sa
from sqlalchemy import testing
from sqlalchemy import Integer, String, ForeignKey, \
select
from sqlalchemy.testing.schema import Table, Column
from sqlalchemy.orm import mapper, relationship, \
CompositeProperty, aliase... | mit |
zengchunyun/s12 | day9/temp/salt_server.py | 1 | 2506 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
# import salt
#
# <Salt ID>: # The id to reference the target system with
# host: # The IP address or DNS name of the remote host
# user: # The user to log in as
# passwd: # The password to log in with
#
# ... | gpl-2.0 |
numerigraphe/odoo | addons/website_customer/controllers/main.py | 251 | 4306 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import unslug
from openerp.tools.translate import _
from openerp.addons.web.http import request
import werkzeug.urls
class WebsiteCustomer(http.Controller):
_refere... | agpl-3.0 |
wojenny/THash | p2pool/bitcoin/networks/polcoin.py | 1 | 1145 | import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'a5725982'.decode('hex') #pchmessagestart
P2P_PORT = 9338
ADDRESS_VERSION = 0 #pubkey_address
RPC_PORT = 9337
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
... | gpl-3.0 |
wtsi-ssg/pcp | pcplib/lustreapi.py | 4 | 7128 | # Copyright (c) Genome Research Ltd 2012
# Author Guy Coates <gmpc@sanger.ac.uk>
# This program is released under the GNU Public License V2 (GPLv2)
"""
Python bindings to minimal subset of lustre api.
This module requires a dynamically linked version of the lustre
client library (liblustreapi.so).
Older version of t... | gpl-2.0 |
esbullington/pynode-asyncio | bitcoinlib/script.py | 7 | 10368 |
#
# script.py
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import absolute_import, division, print_function, unicode_literals
import struct
SIGHASH_ALL = 1
SIGHASH_NONE = 2
SIGHASH_SINGLE = 3
SIGHASH_... | mit |
scalingdata/Impala | thirdparty/hive-1.2.1.2.3.0.0-2557/lib/py/thrift/server/TServer.py | 71 | 8153 | #
# 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 |
cynngah/uofthacksIV | generate-jobs/lib/python2.7/site-packages/wheel/metadata.py | 93 | 11676 | """
Tools for converting old- to new-style metadata.
"""
from collections import namedtuple
from .pkginfo import read_pkg_info
from .util import OrderedDefaultDict
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict
import re
import os.path
import textwrap
import pkg_resources
impo... | mit |
jasonzzz/ansible | lib/ansible/module_utils/shell.py | 2 | 8009 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.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) any late... | gpl-3.0 |
ASAZING/android_kernel_lanix_l900 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
KodiColdkeys/coldkeys-addons | repository/plugin.video.white.devil/resources/lib/sources/wrzcraft_wp_jh.py | 6 | 6526 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
c-a/jhbuild | jhbuild/cut_n_paste/subprocess.py | 8 | 40883 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2004 by Peter Astrand <astrand@lysator.liu.se>
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# ... | gpl-2.0 |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/contrib/auth/migrations/0001_initial.py | 143 | 4370 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.auth.models
from django.core import validators
from django.db import migrations, models
from django.utils import timezone
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '__first__'),
]
... | mit |
SerCeMan/intellij-community | python/lib/Lib/StringIO.py | 150 | 10593 | r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly release resources held
flag = f.isatty() # always false
pos = f.tell() # get current pos... | apache-2.0 |
kayhayen/Nuitka | nuitka/importing/IgnoreListing.py | 1 | 10934 | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | apache-2.0 |
gauravbose/digital-menu | digimenu2/tests/template_tests/syntax_tests/test_if_changed.py | 16 | 9575 | from django.template import Context, Template
from django.test import SimpleTestCase
from ..utils import setup
class IfChangedTagTests(SimpleTestCase):
@setup({'ifchanged01': '{% for n in num %}{% ifchanged %}{{ n }}{% endifchanged %}{% endfor %}'})
def test_ifchanged01(self):
output = self.engine.r... | bsd-3-clause |
a113n/bcbio-nextgen | tests/integration/test_S3_pipelines.py | 3 | 1641 | import os
import subprocess
import pytest
from tests.conftest import make_workdir
from tests.conftest import get_post_process_yaml
@pytest.mark.S3
@pytest.mark.install_required
def test_fusion(install_test_files, data_dir):
"""Run an RNA-seq analysis and test fusion genes, with human-mouse
disambiguation.
... | mit |
MackZxh/OCA-Choice | contract/contract_show_invoice/__openerp__.py | 3 | 1462 | # -*- coding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 Domatix (<www.domatix.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | lgpl-3.0 |
manipopopo/tensorflow | tensorflow/contrib/autograph/converters/call_trees_test.py | 5 | 4240 | # 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 |
patrickm/chromium.src | printing/cups_config_helper.py | 2 | 1983 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""cups-config wrapper.
cups-config, at least on Ubuntu Lucid and Natty, dumps all
cflags/ldflags/libs when passed the --libs argu... | bsd-3-clause |
tynn/numpy | benchmarks/benchmarks/bench_function_base.py | 14 | 3841 | from __future__ import absolute_import, division, print_function
from .common import Benchmark
import numpy as np
class Histogram1D(Benchmark):
def setup(self):
self.d = np.linspace(0, 100, 100000)
def time_full_coverage(self):
np.histogram(self.d, 200, (0, 100))
def time_small_coverag... | bsd-3-clause |
draugiskisprendimai/odoo | addons/crm/res_partner.py | 159 | 5149 | # -*- 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 |
fritsvanveen/QGIS | python/plugins/processing/algs/qgis/CheckValidity.py | 5 | 6424 | # -*- coding: utf-8 -*-
"""
***************************************************************************
CheckValidity.py
---------------------
Date : May 2015
Copyright : (C) 2015 by Arnaud Morvan
Email : arnaud dot morvan at camptocamp dot com
************... | gpl-2.0 |
yatinkumbhare/openstack-nova | nova/tests/unit/image/test_s3.py | 69 | 11230 | # Copyright 2011 Isaku Yamahata
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
dongguangming/python-phonenumbers | python/phonenumbers/data/region_CL.py | 9 | 4333 | """Auto-generated file, do not edit by hand. CL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CL = PhoneMetadata(id='CL', country_code=56, international_prefix='(?:0|1(?:1[0-69]|2[0-57]|5[13-58]|69|7[0167]|8[018]))0',
general_desc=PhoneNumberDesc(national_numbe... | apache-2.0 |
vladimir-ipatov/ganeti | test/py/ganeti.utils.log_unittest.py | 8 | 8494 | #!/usr/bin/python
#
# Copyright (C) 2011 Google 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 2 of the License, or
# (at your option) any later version.
#
# This program... | gpl-2.0 |
jorge2703/scikit-learn | sklearn/datasets/rcv1.py | 113 | 8170 | """RCV1 dataset.
"""
# Author: Tom Dupre la Tour
# License: BSD 3 clause
import logging
from os.path import exists, join
from gzip import GzipFile
from io import BytesIO
from contextlib import closing
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
import numpy as np... | bsd-3-clause |
rtindru/django | tests/introspection/tests.py | 207 | 8471 | from __future__ import unicode_literals
from unittest import skipUnless
from django.db import connection
from django.db.utils import DatabaseError
from django.test import TransactionTestCase, mock, skipUnlessDBFeature
from .models import Article, Reporter
class IntrospectionTests(TransactionTestCase):
availab... | bsd-3-clause |
Varentsov/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/protocol.py | 12 | 1163 | import json
import webdriver
"""WebDriver wire protocol codecs."""
class Encoder(json.JSONEncoder):
def __init__(self, *args, **kwargs):
kwargs.pop("session")
super(Encoder, self).__init__(*args, **kwargs)
def default(self, obj):
if isinstance(obj, (list, tuple)):
retur... | mpl-2.0 |
cudadog/django-allauth | allauth/socialaccount/providers/stackexchange/tests.py | 71 | 1518 | from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry
from .provider import StackExchangeProvider
class StackExchangeTests(create_oauth2_tests(registry.by_id(StackExchangeProvider.id))):
def get_mocked_response(sel... | mit |
lz1988/company-site | django/test/utils.py | 24 | 10922 | import re
import warnings
from xml.dom.minidom import parseString, Node
from django.conf import settings, UserSettingsHolder
from django.core import mail
from django.template import Template, loader, TemplateDoesNotExist
from django.template.loaders import cached
from django.test.signals import template_rendered, sett... | bsd-3-clause |
awohns/selection | python_lib/lib/python3.4/site-packages/numpy/testing/nosetester.py | 36 | 19120 | """
Nose test running.
This module implements ``test()`` and ``bench()`` functions for NumPy modules.
"""
from __future__ import division, absolute_import, print_function
import os
import sys
import warnings
from numpy.compat import basestring
import numpy as np
from .utils import import_nose, suppress_warnings
d... | mit |
jblackburne/scikit-learn | sklearn/utils/_scipy_sparse_lsqr_backport.py | 378 | 18021 | """Sparse Equations and Least Squares.
The original Fortran code was written by C. C. Paige and M. A. Saunders as
described in
C. C. Paige and M. A. Saunders, LSQR: An algorithm for sparse linear
equations and sparse least squares, TOMS 8(1), 43--71 (1982).
C. C. Paige and M. A. Saunders, Algorithm 583; LSQR: Sparse... | bsd-3-clause |
sbidoul/buildbot | master/buildbot/data/schedulers.py | 11 | 4869 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
yjmade/odoo | addons/stock_picking_wave/__init__.py | 374 | 1105 | # -*- 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 |
andrey-malets/web-page-replay | third_party/dns/rcode.py | 248 | 3106 | # 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 ... | apache-2.0 |
duducosmos/pgs4a | python-install/lib/python2.7/test/test_enumerate.py | 84 | 7513 | import unittest
import sys
from test import test_support
class G:
'Sequence using __getitem__'
def __init__(self, seqn):
self.seqn = seqn
def __getitem__(self, i):
return self.seqn[i]
class I:
'Sequence using iterator protocol'
def __init__(self, seqn):
self.seqn = seqn
... | lgpl-2.1 |
lekum/ansible | lib/ansible/module_utils/rax.py | 280 | 11974 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their own
# license to the complete wo... | gpl-3.0 |
unicornis/suds-uis | suds/xsd/sxbasic.py | 7 | 23898 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 b... | lgpl-3.0 |
catapult-project/catapult | firefighter/update/handlers/builds.py | 7 | 5951 | # Copyright 2015 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 collections
import logging
import re
import time
from google.appengine.api import urlfetch
import webapp2
from base import bigquery
from base import... | bsd-3-clause |
guiquanz/zulip | zilencer/models.py | 125 | 1148 | from django.db import models
import zerver.models
def get_deployment_by_domain(domain):
return Deployment.objects.get(realms__domain=domain)
class Deployment(models.Model):
realms = models.ManyToManyField(zerver.models.Realm, related_name="_deployments")
is_active = models.BooleanField(default=True)
... | apache-2.0 |
xzturn/caffe2 | caffe2/python/layers/sparse_lookup.py | 1 | 13116 | ## @package sparse_lookup
# Module caffe2.python.layers.sparse_lookup
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python.helpers.arg_scope import get_current_scope
from caffe2.python import schema
from ... | apache-2.0 |
jihyun-kim/heekscnc | nc/emc2tap.py | 32 | 3103 | import nc
import iso_codes
import emc2
class CodesEMC2(iso_codes.Codes):
def SPACE(self): return(' ')
def TAP(self): return('G33.1')
def TAP_DEPTH(self, format, depth): return(self.SPACE() + 'K' + (format % depth))
# This version of COMMENT removes comments from the resultant GCode
... | bsd-3-clause |
vmax-feihu/hue | desktop/core/ext-py/ssl-1.15/setup.py | 40 | 9811 | import os, sys
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_lib
from distutils.cmd import Command
from distutils.command.build import build
if (sys.version_info >= (2, 6, 0)):
sys.stderr.write("Skipping building ssl-1.15 because" +
"it is a built-in mo... | apache-2.0 |
chouseknecht/ansible | lib/ansible/modules/cloud/cloudstack/cs_volume.py | 25 | 17290 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Jefferson Girão <jefferson@girao.net>
# (c) 2015, René Moser <mail@renemoser.net>
# 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': ['stableint... | gpl-3.0 |
drcapulet/sentry | src/sentry/api/endpoints/project_group_index.py | 9 | 12177 | from __future__ import absolute_import, division, print_function
from datetime import timedelta
from django.db.models import Q
from django.utils import timezone
from rest_framework import serializers
from rest_framework.response import Response
from sentry.app import search
from sentry.api.base import DocSection
from... | bsd-3-clause |
xiandiancloud/edxplaltfom-xusong | common/djangoapps/course_groups/tests/test_views.py | 20 | 7018 | import json
from django.test.client import RequestFactory
from django.test.utils import override_settings
from factory import post_generation, Sequence
from factory.django import DjangoModelFactory
from course_groups.models import CourseUserGroup
from course_groups.views import add_users_to_cohort
from courseware.tes... | agpl-3.0 |
Dreizan/csci1200OnlineCourse | scripts/modules.py | 6 | 11360 | #!/usr/bin/python
# 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... | apache-2.0 |
shaufi10/odoo | addons/lunch/wizard/__init__.py | 440 | 1053 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
crakensio/django_training | lib/python2.7/site-packages/django/db/models/sql/datastructures.py | 114 | 1853 | """
Useful auxilliary data structures for query construction. Not useful outside
the SQL domain.
"""
class EmptyResultSet(Exception):
pass
class MultiJoin(Exception):
"""
Used by join construction code to indicate the point at which a
multi-valued join was attempted (if the caller wants to treat that
... | cc0-1.0 |
Zouyiran/ryu | .eggs/pbr-1.8.1-py2.7.egg/pbr/tests/test_core.py | 86 | 5269 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 |
Drooids/odoo | addons/l10n_ro/res_partner.py | 309 | 2255 | # -*- encoding: utf-8 -*-
##############################################################################
#
# @author - Fekete Mihai <feketemihai@gmail.com>
# Copyright (C) 2011 TOTAL PC SYSTEMS (http://www.www.erpsystems.ro).
# Copyright (C) 2009 (<http://www.filsystem.ro>)
#
# This program is free softwa... | agpl-3.0 |
JuliBakagianni/CEF-ELRC | lib/python2.7/site-packages/django/views/decorators/cache.py | 229 | 3639 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cach... | bsd-3-clause |
chawlanikhil24/glustercli-python | gluster/cli/quota.py | 1 | 4960 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
# This file is part of GlusterFS.
#
# This file is licensed to you under your choice of the GNU Lesser
# General Public License, version 3 or any later version (LGPLv3 or
# later), or the GNU General Public License, version 2 (GPL... | gpl-2.0 |
rohit21122012/DCASE2013 | runs/2016/dnn2016med_traps/traps39/src/sound_event_detection.py | 56 | 6116 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy
def event_detection(feature_data, model_container, hop_length_seconds=0.01, smoothing_window_length_seconds=1.0,
decision_threshold=0.0, minimum_event_length=0.1, minimum_event_gap=0.1):
"""Sound event detection
Parameters
--... | mit |
dneg/gaffer | doc/GafferUserGuide/images/autoGenerated_source/interface_layouts_figAA.py | 10 | 2044 | import IECore
import GafferUI
import GafferScene
import GafferSceneUI
import os
scriptNode = script
scriptWindow = GafferUI.ScriptWindow.acquire( script )
layout = eval( "GafferUI.CompoundEditor( scriptNode, children = ( GafferUI.SplitContainer.Orientation.Horizontal, 0.495974, ( ( GafferUI.SplitContainer.Orientation.V... | bsd-3-clause |
Electroscholars/P.E.E.R.S | MainWindowArrowTest/youtube_dl/extractor/sockshare.py | 23 | 2628 | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
determine_ext,
ExtractorError,
)
from .common import InfoExtractor
class SockshareIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?soc... | mit |
Tithen-Firion/youtube-dl | youtube_dl/extractor/animeondemand.py | 45 | 11014 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_str,
)
from ..utils import (
determine_ext,
extract_attributes,
ExtractorError,
sanitized_Request,
urlencode_postdata,
)
class AnimeOnDemandIE(InfoExtractor)... | unlicense |
qma/pants | contrib/node/tests/python/pants_test/contrib/node/tasks/test_npm_resolve.py | 3 | 7155 | # 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 json
import o... | apache-2.0 |
diydrones/ardupilot | Tools/autotest/pysim/vehicleinfo.py | 4 | 15380 | class VehicleInfo(object):
def __init__(self):
"""
waf_target: option passed to waf's --target to create binary
default_params_filename: filename of default parameters file. Taken to be relative to autotest dir.
extra_mavlink_cmds: extra parameters that will be passed to mavproxy
... | gpl-3.0 |
zeptonaut/catapult | dashboard/dashboard/alerts_test.py | 2 | 7848 | # Copyright 2015 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 unittest
import webapp2
import webtest
from dashboard import alerts
from dashboard import testing_common
from dashboard import utils
from dashboard.... | bsd-3-clause |
xwolf12/scikit-learn | benchmarks/bench_glm.py | 297 | 1493 | """
A comparison of different methods in GLM
Data comes from a random square matrix.
"""
from datetime import datetime
import numpy as np
from sklearn import linear_model
from sklearn.utils.bench import total_seconds
if __name__ == '__main__':
import pylab as pl
n_iter = 40
time_ridge = np.empty(n_it... | bsd-3-clause |
jasonwzhy/django | django/contrib/contenttypes/migrations/0001_initial.py | 585 | 1227 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.contenttypes.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=... | bsd-3-clause |
keen99/SickRage | tornado/platform/asyncio.py | 65 | 5689 | """Bridges between the `asyncio` module and Tornado IOLoop.
This is a work in progress and interfaces are subject to change.
To test:
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop
(the tests log a f... | gpl-3.0 |
wileeam/airflow | tests/providers/apache/spark/hooks/test_spark_sql.py | 4 | 4146 | #
# 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 |
TiVoMaker/boto | tests/integration/rds/test_cert_verification.py | 126 | 1548 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 withou... | mit |
RafayelGardishyan/Python-minis | TheCoiner/main.py | 1 | 7776 | import time
import datetime
d = datetime.date.today()
dm = d.month
dd = d.day
print ('Welkom bij TheCoiner')
file = 'data/monthday/month.txt'
f = open(file)
file_contents = f.read()
pdm = file_contents
file = 'data/monthday/day.txt'
f = open(file)
file_contents = f.read()
pdd = file_contents ... | gpl-2.0 |
raccoongang/edx-platform | lms/djangoapps/shoppingcart/processors/tests/test_CyberSource.py | 10 | 13182 | """
Tests for the CyberSource processor handler
"""
from collections import OrderedDict
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from mock import Mock, patch
from shoppingcart.models import Order, OrderItem
from shoppingcart.processors.CyberSour... | agpl-3.0 |
kleintom/dxr | tests/test_query.py | 9 | 1458 | """Tests for the dxr.build module
Much of the module is covered in the course of the integration tests that test
everything else. Here are a few unit tests.
"""
from unittest import TestCase
from nose.tools import eq_
from dxr.query import fix_extents_overlap
class FixExtentsOverlapTests(TestCase):
"""Tests f... | mit |
napkindrawing/ansible | lib/ansible/modules/cloud/amazon/s3_sync.py | 43 | 18266 | #!/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 |
golaizola/pelisalacarta-xbmc | pelisalacarta/channels/voxfilme.py | 1 | 5019 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para voxfilme
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core imp... | gpl-3.0 |
savoirfairelinux/django | tests/utils_tests/test_termcolors.py | 134 | 7045 | import unittest
from django.utils.termcolors import (
DARK_PALETTE, DEFAULT_PALETTE, LIGHT_PALETTE, NOCOLOR_PALETTE, PALETTES,
colorize, parse_color_setting,
)
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE... | bsd-3-clause |
ahmadio/edx-platform | lms/djangoapps/instructor/views/instructor_dashboard.py | 6 | 28232 | """
Instructor Dashboard Views
"""
import logging
import datetime
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
import uuid
import pytz
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_POST
from django.utils.translation imp... | agpl-3.0 |
mixman/djangodev | django/contrib/localflavor/tr/tr_provinces.py | 316 | 2191 | # -*- coding: utf-8 -*-
"""
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
PROVINCE_CHOICES = (
('01', ('Adana')),
('02', ('Adıyaman')),
('03', ('Afyonkarahisar')),
('04', ('Ağrı')),
('68', ('Aksaray')),
('05', ('Amasya')),
('06', ('An... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.