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 |
|---|---|---|---|---|---|
simon-pepin/scikit-learn | sklearn/tree/tree.py | 113 | 34767 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... | bsd-3-clause |
JunHe77/bigtop | bigtop-packages/src/common/bigtop-ambari-mpack/bgtp-ambari-mpack/src/main/resources/stacks/BGTP/1.0/services/YARN/package/scripts/service_check.py | 10 | 6677 | """
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 use this ... | apache-2.0 |
RackSec/ansible | lib/ansible/modules/windows/win_stat.py | 16 | 7006 | #!/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 |
bcl/pykickstart | pykickstart/handlers/f24.py | 3 | 5208 | #
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be usef... | gpl-2.0 |
yohanko88/gem5-DC | src/arch/x86/isa/insts/simd64/floating_point/arithmetic/__init__.py | 91 | 2470 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
codefarmer-cyk/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
hsolbrig/SNOMEDToOWL | SNOMEDCTToOWL/RF2Files/Transitive.py | 1 | 2725 | from typing import Dict, Set
from SNOMEDCTToOWL.SNOMEDToOWLConstants import RelationshipFilePrefix
class Transitive:
relationship_prefix = RelationshipFilePrefix
def __init__(self):
self._children = {} # parent -> set(children) Dict[int, Set[int]]
self._parents = {} # child -... | apache-2.0 |
ConservationInternational/ldmp-qgis-plugin | LDMP/processing_provider/carbon.py | 1 | 8231 | import numpy as np
from osgeo import gdal, osr
from qgis import processing
from qgis.core import (QgsGeometry,
QgsProcessing,
QgsProcessingAlgorithm,
QgsProcessingException,
QgsProcessingParameterFile,
QgsProce... | gpl-2.0 |
hasgeek/funnel | migrations/versions/887db555cca9_adding_uuid_to_commentset.py | 1 | 1769 | """Adding uuid to commentset.
Revision ID: 887db555cca9
Revises: 222b78a8508d
Create Date: 2020-05-08 19:16:15.324555
"""
from uuid import uuid4
from alembic import op
from sqlalchemy.sql import column, table
from sqlalchemy_utils import UUIDType
import sqlalchemy as sa
from progressbar import ProgressBar
import p... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_MimeWriter.py | 138 | 7593 | """Test program for MimeWriter module.
The test program was too big to comfortably fit in the MimeWriter
class, so it's here in its own file.
This should generate Barry's example, modulo some quotes and newlines.
"""
import unittest, StringIO
from test.test_support import run_unittest, import_module
import_module(... | mit |
jahangir091/geodash26 | geonode/geoserver/management/__init__.py | 6 | 1812 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
brigittebigi/proceed | proceed/src/wxgui/frames/import_wizard.py | 1 | 18211 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ ___ ___ ____ ____ __
# | \ | \ | | / | | | \ Automatic
# |__/ |__/ | | | |__ |__ | | Conference
# | |\... | gpl-3.0 |
welshjf/python-bitcoinlib | bitcoin/base58.py | 24 | 4154 | # Copyright (C) 2011 Sam Rushing
# Copyright (C) 2013-2014 The python-bitcoinlib developers
#
# This file is part of python-bitcoinlib.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-bitcoinlib, including this file, may be copied... | lgpl-3.0 |
philips/shortbread | Godeps/_workspace/src/github.com/libgit2/git2go/vendor/libgit2/tests/generate.py | 27 | 7418 | #!/usr/bin/env python
#
# Copyright (c) Vicent Marti. All rights reserved.
#
# This file is part of clar, distributed under the ISC license.
# For full terms see the included COPYING file.
#
from __future__ import with_statement
from string import Template
import re, fnmatch, os, codecs, pickle
class Module(object):
... | apache-2.0 |
mch/python-ant | src/ant/core/message.py | 1 | 18462 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011, Martín Raúl Villalba
#
# 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 So... | mit |
plasticantifork/PS2Devs | retweet.py | 1 | 1421 | #!/usr/bin/python
import tweepy
import ConfigParser
import sys, os
config = ConfigParser.SafeConfigParser()
config.read(os.path.join(sys.path[0], 'config'))
auth = tweepy.OAuthHandler(config.get('auth','consumer_key'), config.get('auth','consumer_secret'))
auth.set_access_token(config.get('auth','access_token'), con... | mit |
rcbops/python-django-buildpackage | django/contrib/staticfiles/handlers.py | 160 | 2359 | import urllib
from urlparse import urlparse
from django.conf import settings
from django.core.handlers.wsgi import WSGIHandler
from django.contrib.staticfiles import utils
from django.contrib.staticfiles.views import serve
class StaticFilesHandler(WSGIHandler):
"""
WSGI middleware that intercepts calls to th... | bsd-3-clause |
carhaas/cdec-semparse | realtime/realtime.py | 5 | 3404 | #!/usr/bin/env python
import argparse
import logging
import sys
import threading
import time
import rt
ABOUT = '''Realtime adaptive translation with cdec (See README.md)
Code by Michael Denkowski
Citation:
@InProceedings{realtime,
author = {Michael Denkowski and Chris Dyer and Alon Lavie},
title ... | apache-2.0 |
minhphung171093/OpenERP_V7 | openerp/addons/portal/wizard/share_wizard.py | 13 | 10414 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
GustavoHennig/ansible | hacking/tests/gen_distribution_version_testcase.py | 58 | 1877 | #!/usr/bin/env python
"""
This script generated test_cases for test_distribution_version.py.
To do so it outputs the relevant files from /etc/*release, the output of platform.dist() and the current ansible_facts regarding the distribution version.
This assumes a working ansible version in the path.
"""
import platf... | gpl-3.0 |
barnsnake351/neutron | neutron/tests/tempest/common/generator/valid_generator.py | 34 | 2931 | # Copyright 2014 Deutsche Telekom AG
# 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 |
ufal/lindat-kontext | lib/conclib.py | 2 | 20954 | # Copyright (c) 2003-2014 Pavel Rychly, Vojtech Kovar, Milos Jakubicek, Milos Husak, Vit Baisa
# Copyright (c) 2014 Institute of the Czech National Corpus
#
# 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 ... | gpl-2.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pygments-2.0.2/pygments/styles/colorful.py | 135 | 2778 | # -*- coding: utf-8 -*-
"""
pygments.styles.colorful
~~~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by CodeRay.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | mit |
pyspeckit/pyspeckit | pyspeckit/cubes/mapplot.py | 4 | 16759 | """
MapPlot
-------
Make plots of the cube and interactively connect them to spectrum plotting.
This is really an interactive component of the package; nothing in here is
meant for publication-quality plots, but more for user interactive analysis.
That said, the plotter makes use of `APLpy <https://github.com/aplpy/a... | mit |
laszlocsomor/tensorflow | tensorflow/python/kernel_tests/sparsemask_op_test.py | 133 | 1835 | # 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 |
hsgui/interest-only | deeplearning/reinforcementlearning/keyboardAgents.py | 46 | 3045 | # keyboardAgents.py
# -----------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berk... | gpl-2.0 |
blakfeld/ansible | examples/scripts/yaml_to_ini.py | 175 | 7609 | # (c) 2012, 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) any lat... | gpl-3.0 |
isandlaTech/cohorte-devtools | org.cohorte.eclipse.runner.basic/files/jython/Lib/encodings/hex_codec.py | 528 | 2309 | """ Python 'hex_codec' Codec - 2-digit hex content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs, binascii
### Codec APIs
def hex_encode(... | apache-2.0 |
rubyinhell/brython | www/src/Lib/sre_parse.py | 630 | 29657 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... | bsd-3-clause |
JanDintel/ansible | lib/ansible/template/safe_eval.py | 14 | 4160 | # (c) 2012, 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) any lat... | gpl-3.0 |
TheWardoctor/Wardoctors-repo | script.module.urlresolver/lib/urlresolver/plugins/vidup_org.py | 6 | 1066 | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | apache-2.0 |
nuuuboo/odoo | addons/stock_landed_costs/stock_landed_costs.py | 77 | 19591 | # -*- 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 |
haad/ansible | lib/ansible/modules/network/ordnance/ordnance_facts.py | 43 | 8505 | #!/usr/bin/python
#
# Copyright: Ansible Project
# 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',
'status': ['preview'],... | gpl-3.0 |
dakrauth/picker | picker/migrations/0003_auto_20180801_0800.py | 1 | 5687 | # Generated by Django 2.0.7 on 2018-08-01 12:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import picker.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pic... | mit |
cloudControl/libcloud | libcloud/common/aws.py | 12 | 14885 | # 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 use ... | apache-2.0 |
rahimnathwani/ud858 | Lesson_5/00_Conference_Central/main.py | 39 | 1248 | #!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import webapp2
from google.appengine.api import app_identity
from google.appe... | gpl-3.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/python3-src/Lib/test/profilee.py | 398 | 3041 | """
Input for test_profile.py and test_cprofile.py.
IMPORTANT: This stuff is touchy. If you modify anything above the
test class you'll have to regenerate the stats by running the two
test files.
*ALL* NUMBERS in the expected output are relevant. If you change
the formatting of pstats, please don't just regenerate t... | apache-2.0 |
yask123/django | tests/servers/tests.py | 257 | 5907 | # -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import contextlib
import os
import socket
from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase, override_settings
from django.utils._os import upath
from django.utils.... | bsd-3-clause |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/hooks/memcache_memcache.py | 5 | 2121 | import newrelic.api.memcache_trace
def instrument(module):
if hasattr(module.Client, 'add'):
newrelic.api.memcache_trace.wrap_memcache_trace(
module, 'Client.add', 'add')
if hasattr(module.Client, 'append'):
newrelic.api.memcache_trace.wrap_memcache_trace(
modul... | agpl-3.0 |
harshilasu/GraphicMelon | y/google-cloud-sdk/.install/.backup/lib/apiclient/oauth.py | 12 | 14238 | # Copyright (C) 2010 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 agreed to in writ... | gpl-3.0 |
cloud9UG/odoo | addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py | 374 | 6855 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
apradiznewcyberproject/support-tools | googlecode-issues-exporter/generate_user_map.py | 151 | 3446 | # 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 |
jasonbot/django | tests/null_fk/models.py | 282 | 1422 | """
Regression tests for proper working of ForeignKey(null=True).
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class SystemDetails(models.Model):
details = models.TextField()
class SystemInfo(models.Model):
system_details = models.ForeignKey(SystemDetails, ... | bsd-3-clause |
rahul67/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/extension/mdattr.py | 34 | 2430 | #!/usr/bin/env python
#
# Generated Mon May 2 14:23:34 2011 by parse_xsd.py version 0.4.
#
import saml2
from saml2 import SamlBase
from saml2 import saml
NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:attribute'
class EntityAttributesType_(SamlBase):
"""The urn:oasis:names:tc:SAML:metadata:attribute:EntityAttr... | apache-2.0 |
vlegoff/tsunami | src/primaires/joueur/commandes/montrer/niveaux.py | 1 | 2438 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
# ... | bsd-3-clause |
code-sauce/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder.py | 88 | 31139 | # 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 |
cryvate/project-euler | project_euler/library/number_theory/pells_equation.py | 1 | 1029 | from .continued_fractions import convergents_sqrt
from typing import Generator, Tuple
def solve_pells_equation(n: int) -> Generator[Tuple[int, int], None, None]:
convergents = convergents_sqrt(n)
for convergent in convergents:
h = convergent.numerator
k = convergent.denominator
if h... | mit |
Yunchao/hackingchicago | Server/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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.
from __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
kernel-sanders/arsenic-mobile | Dependencies/Twisted-13.0.0/twisted/python/win32.py | 36 | 5436 | # -*- test-case-name: twisted.python.test.test_win32 -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Win32 utilities.
See also twisted.python.shortcut.
@var O_BINARY: the 'binary' mode flag on Windows, or 0 on other platforms, so it
may safely be OR'ed into a mask for os.open.
"""... | gpl-3.0 |
amyvmiwei/libgit2 | tests/generate.py | 71 | 7484 | #!/usr/bin/env python
#
# Copyright (c) Vicent Marti. All rights reserved.
#
# This file is part of clar, distributed under the ISC license.
# For full terms see the included COPYING file.
#
from __future__ import with_statement
from string import Template
import re, fnmatch, os, codecs, pickle
class Module(object):
... | lgpl-2.1 |
DaniilLeksin/gc | wx/tools/Editra/src/syntax/_perl.py | 4 | 6638 | ###############################################################################
# Name: perl.py #
# Purpose: Define Perl syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | apache-2.0 |
mozilla/stoneridge | python/src/Lib/plat-irix5/FL.py | 132 | 5600 | # Constants used by the FORMS library (module fl).
# This corresponds to "forms.h".
# Recommended use: import FL; ... FL.NORMAL_BOX ... etc.
# Alternate use: from FL import *; ... NORMAL_BOX ... etc.
from warnings import warnpy3k
warnpy3k("the FL module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
_v20 ... | mpl-2.0 |
paulgradie/SeqPyPlot | main_app/seqpyplot/parsers/htseq_parser.py | 1 | 2244 | """
Read a directory of expression counts in ht-seq format. Each sample
should be an individual file in the directory. File names and
sample order are specified in the config file (order is determined
by order IN the config.)
This class is intended to return the raw dataframe of samples with
missing sample columns as ... | gpl-3.0 |
livoras/feifanote | tasks/component/make-component.py | 2 | 2058 | # -*- coding: utf-8 -*-
import sys
import os
import shutil
import time
import re
component_dir = None
component_name = sys.argv[1]
target_dir = None
def init_component_dir():
global component_dir
component_dir = os.path.abspath(__file__) \
.replace(__file__.replace('/', '\\'), '')[:-1]
... | mit |
airbnb/airflow | tests/api_connexion/endpoints/test_import_error_endpoint.py | 7 | 9329 | # 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 |
onitake/ansible | lib/ansible/modules/network/f5/bigip_monitor_tcp.py | 4 | 20485 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
dmlc/xgboost | tests/python/test_with_pandas.py | 1 | 10402 | # -*- coding: utf-8 -*-
import numpy as np
import xgboost as xgb
import testing as tm
import pytest
try:
import pandas as pd
except ImportError:
pass
pytestmark = pytest.mark.skipif(**tm.no_pandas())
dpath = 'demo/data/'
rng = np.random.RandomState(1994)
class TestPandas:
def test_pandas(self):
... | apache-2.0 |
welshjf/bitnomon | bitnomon/formatting.py | 1 | 1555 | # Copyright 2015 Jacob Welsh
#
# This file is part of Bitnomon; see the README for license information.
"""Text/number formatting"""
class ByteCountFormatter(object):
#pylint: disable=too-few-public-methods
"""Human-readable display of byte counts in various formats.
By default, the formatter uses SI an... | apache-2.0 |
SaschaMester/delicium | tools/python/google/platform_utils_mac.py | 183 | 5676 | # 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.
"""Platform-specific utility methods shared by several scripts."""
import os
import subprocess
import google.path_utils
class PlatformUtility(object)... | bsd-3-clause |
martinhoaragao/hour-of-code | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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 collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | mit |
carolinux/QGIS | python/plugins/GdalTools/tools/inOutSelector.py | 12 | 8284 | # -*- coding: utf-8 -*-
"""
***************************************************************************
inOutSelector.py
---------------------
Date : April 2011
Copyright : (C) 2011 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
*************... | gpl-2.0 |
andela-angene/coursebuilder-core | coursebuilder/tests/functional/student_answers.py | 4 | 16815 | # 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 ... | apache-2.0 |
vincentbernat/feedhq | feedhq/feeds/management/commands/add_missing.py | 2 | 1240 | from django.conf import settings
from ...models import Feed, UniqueFeed, enqueue_favicon
from . import SentryCommand
class Command(SentryCommand):
"""Updates the users' feeds"""
def handle_sentry(self, *args, **kwargs):
missing = Feed.objects.raw(
"""
select f.id, f.url
... | bsd-3-clause |
rvalyi/OpenUpgrade | addons/hw_posbox_homepage/__init__.py | 1894 | 1075 | # -*- 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 |
HyperBaton/ansible | lib/ansible/modules/cloud/amazon/aws_config_aggregation_authorization.py | 9 | 5218 | #!/usr/bin/python
# Copyright: (c) 2018, Aaron Smith <ajsmith10381@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jythontools/pip | pip/commands/completion.py | 435 | 1991 | from __future__ import absolute_import
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
CO... | mit |
CenterForOpenScience/osf.io | api_tests/tokens/views/test_token_detail.py | 10 | 21922 | import mock
import pytest
from api.scopes.serializers import SCOPES_RELATIONSHIP_VERSION
from osf_tests.factories import (
ApiOAuth2PersonalTokenFactory,
ApiOAuth2ScopeFactory,
AuthUserFactory,
)
from tests.base import assert_dict_contains_subset
from website.util import api_v2_url
@pytest.mark.django_db
... | apache-2.0 |
warp1337/opencv_facerecognizer | src/ocvfacerec/facerec/classifier.py | 1 | 9086 | # Copyright (c) 2015.
# Philipp Wagner <bytefish[at]gmx[dot]de> and
# Florian Lier <flier[at]techfak.uni-bielefeld.de> and
# Norman Koester <nkoester[at]techfak.uni-bielefeld.de>
#
#
# Released to public domain under terms of the BSD Simplified license.
#
# Redistribution and use in source and binary forms, with or wit... | bsd-3-clause |
debbiedub/bcdef | features/steps/application.py | 1 | 1080 | import logging
from multiprocessing import Process
from bc import BCMain
from fcp.CommunicationQueues import comm
def run_create_first_block(queues, *args):
global comm
comm.set(queues=queues)
try:
logging.getLogger().setLevel(logging.DEBUG)
# logging.getLogger().addHandler(comm.get_handl... | gpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/unittest/test/test_loader.py | 40 | 49870 | import sys
import types
import unittest
class Test_TestLoader(unittest.TestCase):
### Tests for TestLoader.loadTestsFromTestCase
################################################################
# "Return a suite of all tests cases contained in the TestCase-derived
# class testCaseClass"
def te... | mit |
microcom/odoo | addons/project_issue/report/project_issue_report.py | 38 | 3441 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
from openerp import tools
class project_issue_report(osv.osv):
_name = "project.issue.report"
_auto = False
_columns = {
'team_id':fields.many2one('crm.team', '... | agpl-3.0 |
elena/django | tests/utils_tests/test_functional.py | 7 | 8133 | from unittest import mock
from django.test import SimpleTestCase
from django.utils.functional import cached_property, classproperty, lazy
class FunctionalTests(SimpleTestCase):
def test_lazy(self):
t = lazy(lambda: tuple(range(3)), list, tuple)
for a, b in zip(t(), range(3)):
self.ass... | bsd-3-clause |
cytsao/X-Informatics-1.3.0 | common/safe_dom.py | 13 | 4961 | """Classes to build sanitized HTML."""
__author__ = 'John Orr (jorr@google.com)'
import cgi
import re
def escape(strg):
return cgi.escape(strg, quote=1).replace("'", ''').replace('`', '`')
class Node(object):
"""Base class for the sanitizing module."""
@property
def sanitized(self):
... | apache-2.0 |
thomasalrin/Ghost | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/__init__.py | 364 | 2117 | # -*- coding: utf-8 -*-
"""
pygments.styles
~~~~~~~~~~~~~~~
Contains built-in styles.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.plugin import find_plugin_styles
from pygments.util import ClassNotFound
#: Maps sty... | mit |
YannThorimbert/ThorPy-1.4.1 | thorpy/painting/painters/optionnal/human.py | 5 | 3233 | from pygame import BLEND_RGBA_MIN
from pygame import Surface
from thorpy._utils.colorscomputing import grow_color, normalize_color
from thorpy.painting.painters.roundrect import RoundRect
from thorpy.painting.painters.classicframe import ClassicFrame
from thorpy.painting.graphics import linear_v_monogradation
from tho... | mit |
bancek/egradebook | src/lib/django/utils/unittest/result.py | 570 | 6105 | """Test result object"""
import sys
import traceback
import unittest
from StringIO import StringIO
from django.utils.unittest import util
from django.utils.unittest.compatibility import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'fail... | gpl-3.0 |
ttsda/beets | beets/dbcore/__init__.py | 25 | 1079 | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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, ... | mit |
40223220/w16b_test | static/Brython3.1.1-20150328-091302/Lib/shutil.py | 720 | 39101 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
from os.path import abspath
import fnmatch
import collections
import errno
import tarfile
try:
import bz2
del bz2
_... | agpl-3.0 |
terbolous/CouchPotatoServer | libs/pyutil/scripts/try_decoding.py | 106 | 3163 | #!/usr/bin/env python
import binascii, codecs, encodings, locale, os, sys, zlib
import argparse
def listcodecs(dir):
names = []
for filename in os.listdir(dir):
if filename[-3:] != '.py':
continue
name = filename[:-3]
# Check whether we've found a true codec
try:
... | gpl-3.0 |
google/capirca | capirca/lib/windows.py | 1 | 12745 | # Copyright 2016 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 agr... | apache-2.0 |
sclabs/sccms-nonrel | django/templatetags/i18n.py | 154 | 13327 | import re
from django.template import Node, Variable, VariableNode
from django.template import TemplateSyntaxError, TokenParser, Library
from django.template import TOKEN_TEXT, TOKEN_VAR
from django.template.base import _render_value_in_context
from django.utils import translation
from django.utils.encoding import for... | bsd-3-clause |
jessrosenfield/pants | src/python/pants/backend/jvm/tasks/ivy_resolve.py | 2 | 7835 | # coding=utf-8
# Copyright 2014 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 os
import shu... | apache-2.0 |
mhils/mitmproxy | test/mitmproxy/contentviews/test_auto.py | 6 | 1233 | from mitmproxy.contentviews import auto
from mitmproxy.net import http
from mitmproxy.coretypes import multidict
from . import full_eval
def test_view_auto():
v = full_eval(auto.ViewAuto())
f = v(
b"foo",
headers=http.Headers()
)
assert f[0] == "Raw"
f = v(
b"<html></html>... | mit |
CardinalTesting/kernel_lge_msm8974 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
Batterfii/django | django/contrib/auth/decorators.py | 356 | 3049 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import PermissionDenied
from django.shortcuts import resolve_url
from django.utils import six
from django.utils.decorators import available_attrs
from django.utils.six.moves.urll... | bsd-3-clause |
silveregg/moto | tests/test_swf/responses/test_workflow_executions.py | 2 | 9087 | import boto
from boto.swf.exceptions import SWFResponseError
from datetime import datetime, timedelta
import sure # noqa
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises # noqa
from moto import mock_swf
from moto.core.utils import unix_time
# Utils
@mock_swf
def ... | apache-2.0 |
Balachan27/django | django/core/management/commands/loaddata.py | 294 | 12977 | from __future__ import unicode_literals
import glob
import gzip
import os
import warnings
import zipfile
from itertools import product
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.core.exceptions import ImproperlyConfigured
from django.core.management.b... | bsd-3-clause |
AlfredNeverKog/BrainCarya | src/my/kadenze/lesson3/mnist_autoencoder.py | 1 | 2610 | from mnist import MNIST
import numpy as np
import tensorflow as tf
from src.my.lib.utils import montage
import matplotlib.pyplot as plt
from PIL import Image
src = '../../../../data/mnist/'
output='./content/1/%s.jpg'
mndata = MNIST(src)
data = np.array(mndata.load_testing())
X = data[0]
Y = data[1]
items = 100
im... | mit |
icydoge/AdventOfCodeSolutions2 | day3.py | 1 | 1161 | ###################################
# Many lines #
# Such O(n) #
# Very Doge #
###################################
# By icydoge <icydoge@gmail.com> #
###################################
with open("inputs/day3-1.txt") as f:
content = f.readlines()
#... | mit |
shapiromatron/bmds-server | bmds_server/analysis/transforms.py | 1 | 3196 | from enum import Enum
from typing import Dict, List, Union
import bmds
from bmds.bmds3.sessions import get_model
from bmds.bmds3.types.continuous import ContinuousModelSettings
from bmds.bmds3.types.dichotomous import DichotomousModelSettings
from bmds.bmds3.types.priors import PriorClass, get_continuous_prior, get_di... | mit |
Lujeni/ansible | lib/ansible/modules/network/f5/bigip_selfip.py | 24 | 26437 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2016, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
f3r/scikit-learn | examples/covariance/plot_lw_vs_oas.py | 159 | 2951 | """
=============================
Ledoit-Wolf vs OAS estimation
=============================
The usual covariance maximum likelihood estimate can be regularized
using shrinkage. Ledoit and Wolf proposed a close formula to compute
the asymptotically optimal shrinkage parameter (minimizing a MSE
criterion), yielding th... | bsd-3-clause |
promptworks/horizon | horizon/utils/filters.py | 86 | 2017 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/IPython/core/magics/display.py | 8 | 2127 | """Simple magics for display formats"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----... | gpl-3.0 |
f123h456/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/models/_resource_management_client_enums.py | 5 | 2298 | # 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 may ... | mit |
ThiefMaster/indico | indico/modules/events/notes/models/notes.py | 3 | 8477 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from functools import partial
from flask import g
from sqlalchemy.event import listen, listens_for
from s... | mit |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/db/backends/oracle/schema.py | 58 | 5290 | import binascii
import copy
import datetime
import re
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
from django.utils import six
from django.utils.text import force_text
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALT... | apache-2.0 |
himleyb85/django | tests/servers/test_basehttp.py | 7 | 4388 | import logging
from io import BytesIO
from django.core.handlers.wsgi import WSGIRequest
from django.core.servers.basehttp import WSGIRequestHandler
from django.test import SimpleTestCase
from django.test.client import RequestFactory
from django.test.utils import captured_stderr, patch_logger
class Stub(object):
... | bsd-3-clause |
Danielhiversen/home-assistant | homeassistant/components/alarm_control_panel/verisure.py | 4 | 3042 | """
Interfaces with Verisure alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.verisure/
"""
import logging
from time import sleep
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.comp... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.