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 |
|---|---|---|---|---|---|
dednal/chromium.src | tools/profile_chrome/perf_controller.py | 16 | 6890 | # 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 logging
import os
import signal
import subprocess
import sys
import tempfile
from profile_chrome import controllers
from profile_chrome import ui
fr... | bsd-3-clause |
manojhirway/ExistingImagesOnNFS | cinder/tests/unit/volume/drivers/netapp/eseries/fakes.py | 3 | 19127 | # Copyright (c) - 2015, Alex Meade
# Copyright (c) - 2015, Yogesh Kshirsagar
# 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... | apache-2.0 |
Dandandan/wikiprogramming | jsrepl/extern/python/unclosured/lib/python2.7/audiodev.py | 286 | 7597 | """Classes for manipulating audio devices (currently only for Sun and SGI)"""
from warnings import warnpy3k
warnpy3k("the audiodev module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
__all__ = ["error","AudioDev"]
class error(Exception):
pass
class Play_Audio_sgi:
# Private instance variables
... | mit |
andrejb/cloudant_bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/packaging/zip.py | 61 | 1775 | """SCons.Tool.Packaging.zip
The zip SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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... | apache-2.0 |
ArthurGarnier/SickRage | sickbeard/history.py | 5 | 4481 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# 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... | gpl-3.0 |
tanzquotient/tq_website | cms_plugins/migrations/0001_squashed_0008_upcomingeventsandcoursespluginmodel.py | 2 | 4898 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.27 on 2020-02-15 11:08
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.image
class Migration(migrations.Migration):
replaces = [('cms_plugins'... | gpl-2.0 |
ShuboshaKuro/SimpleGameEngine | Test.py | 1 | 1251 | import numpy as np
import os
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# has to change whenever noise_width and noise_height change in the PerlinNoise.hpp file
DIMENSION1 = 200
DIMENSION2 = 200
# works if the working directory is set
path = os.path.dirname(os.path.realpath(__file__)... | mit |
Southpaw-TACTIC/Team | src/python/Lib/encodings/iso8859_11.py | 93 | 12898 | """ Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self... | epl-1.0 |
barbarubra/Don-t-know-What-i-m-doing. | python-build/python-libs/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/cache.py | 129 | 9763 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2008, appengine-utilities project
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
... | apache-2.0 |
OCA/account-financial-tools | account_journal_lock_date/tests/test_journal_lock_date.py | 1 | 8511 | # Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from datetime import date, timedelta
from odoo import tools
from odoo.modules import get_module_resource
from odoo.tests import common
from ..exceptions import JournalLockDateError
class TestJournalLockDate(common.Transac... | agpl-3.0 |
zenefits/sentry | src/sentry/south_migrations/0277_auto__add_commitfilechange__add_unique_commitfilechange_commit_filenam.py | 4 | 64322 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'CommitFileChange'
db.create_table('sentry_commitfilechang... | bsd-3-clause |
janhahne/nest-simulator | extras/ConnPlotter/examples/simple.py | 20 | 3445 | # -*- coding: utf-8 -*-
#
# simple.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
# (a... | gpl-2.0 |
michigraber/scikit-learn | sklearn/cluster/dbscan_.py | 106 | 11120 | # -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Joel Nothman <joel.nothman@gmail.com>
# Lars Buitinck
#
# License: BSD 3 clause
import warnings
import numpy as np
from ..base import BaseEstimator, ... | bsd-3-clause |
Tao-Ma/gpdb | gpMgmt/bin/ext/yaml/representer.py | 120 | 17705 |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
try:
set
except NameError:
from sets import Set as set
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
... | apache-2.0 |
ros2/rclpy | rclpy/rclpy/action/client.py | 1 | 22966 | # Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
iuliat/nova | nova/tests/unit/virt/libvirt/volume/test_gpfs.py | 46 | 1302 | # 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, software
# d... | apache-2.0 |
tomsilver/nupic | nupic/support/features.py | 7 | 4619 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | gpl-3.0 |
ahu-odoo/odoo | addons/account_asset/wizard/__init__.py | 445 | 1122 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
Centre-Alt-Rendiment-Esportiu/att | old_project/Python/win_libs/scipy/weave/tests/test_slice_handler.py | 96 | 5756 | from __future__ import absolute_import, print_function
import parser
from numpy.testing import TestCase, assert_equal, run_module_suite
from scipy.weave import slice_handler
from scipy.weave.slice_handler import indexed_array_pattern
from scipy.weave.ast_tools import ast_to_string, find_first_pattern
from weave_test... | gpl-3.0 |
errx/django | django/contrib/flatpages/views.py | 105 | 2813 | from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import get_object_or_404
from django.template import loader, RequestContext... | bsd-3-clause |
Tao-Ma/gpdb | src/test/tinc/tincrepo/resource_management/memory_accounting/test_oom.py | 3 | 8712 | import tinctest
import unittest2 as unittest
from mpp.models import MPPTestCase
from mpp.lib.PSQL import PSQL
from gppylib.commands.base import Command
from mpp.lib.gpConfig import GpConfig
from tinctest.models.scenario import ScenarioTestCase
class OOMTestCase(MPPTestCase, ScenarioTestCase):
"""
@product_ve... | apache-2.0 |
defance/edx-platform | common/djangoapps/terrain/stubs/comments.py | 85 | 5565 | """
Stub implementation of cs_comments_service for acceptance tests
"""
import re
import urlparse
from .http import StubHttpRequestHandler, StubHttpService
class StubCommentsServiceHandler(StubHttpRequestHandler):
@property
def _params(self):
return urlparse.parse_qs(urlparse.urlparse(self.path).que... | agpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/stats/tests/test_stats.py | 2 | 170720 | """ Test functions for stats module
WRITTEN BY LOUIS LUANGKESORN <lluang@yahoo.com> FOR THE STATS MODULE
BASED ON WILKINSON'S STATISTICS QUIZ
http://www.stanford.edu/~clint/bench/wilk.txt
Additional tests by a host of SciPy developers.
"""
from __future__ import division, print_function, absolute_impo... | gpl-3.0 |
iambibhas/django | tests/admin_custom_urls/models.py | 78 | 2482 | from functools import update_wrapper
from django.contrib import admin
from django.core.urlresolvers import reverse
from django.db import models
from django.http import HttpResponseRedirect
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Action(models.Model):
name ... | bsd-3-clause |
nikhilprathapani/python-for-android | sl4atools/fullscreenwrapper2/examples/fullscreenwrapper2demo/fullscreenwrapper2demo.py | 44 | 3252 | '''
@copyright: Hariharan Srinath, 2012
@license: This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/
'''
xmldata = """<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="... | apache-2.0 |
nhomar/odoo-mirror | addons/hr_timesheet_sheet/__init__.py | 434 | 1127 | # -*- 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 |
rvs/gpdb | gpMgmt/bin/lib/gppinggpfdist.py | 54 | 1089 | #!/usr/bin/env python
import sys, httplib, getopt, socket
def usage(exitarg):
print 'usage: %s [-q] host:port' % sys.argv[0]
print
print ' -q: quiet mode'
print
print 'e.g. %s localhost:8080' % sys.argv[0]
print
sys.exit(exitarg)
gpfdist = ''
quiet = 0
uri = ''
try:
(options, args... | apache-2.0 |
suiyuan2009/tensorflow | tensorflow/contrib/learn/python/learn/estimators/estimator_test_utils.py | 81 | 2065 | # 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 |
jlegendary/orange | Orange/OrangeCanvas/help/intersphinx.py | 6 | 2259 | """
Parsers for intersphinx inventory files
Taken from `sphinx.ext.intersphinx`
"""
import re
import codecs
import zlib
b = str
UTF8StreamReader = codecs.lookup('utf-8')[2]
def read_inventory_v1(f, uri, join):
f = UTF8StreamReader(f)
invdata = {}
line = f.next()
projname = line.rstrip()[11:]
l... | gpl-3.0 |
biocore/qiime | scripts/multiple_rarefactions_even_depth.py | 15 | 3623 | #!/usr/bin/env python
# File created on 09 Feb 2010
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski"
__email__ = "just... | gpl-2.0 |
vilorious/pyload | module/plugins/hoster/MystoreTo.py | 13 | 1208 | # -*- coding: utf-8 -*-
#
# Test link:
# http://mystore.to/dl/mxcA50jKfP
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class MystoreTo(SimpleHoster):
__name__ = "MystoreTo"
__type__ = "hoster"
__version__ = "0.04"
__status__ = "testing"
__patte... | gpl-3.0 |
formath/mxnet | benchmark/python/sparse/cast_storage.py | 57 | 3691 | # 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 |
markredballoon/clivemizen | wp-content/themes/redballoon/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 437 | 43606 | # 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.
"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. The... | gpl-2.0 |
armersong/letsencrypt | letsencrypt/tests/client_test.py | 11 | 8012 | """Tests for letsencrypt.client."""
import os
import shutil
import tempfile
import unittest
import configobj
import OpenSSL
import mock
from acme import jose
from letsencrypt import account
from letsencrypt import configuration
from letsencrypt import errors
from letsencrypt import le_util
from letsencrypt.tests im... | apache-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/test/test_popen2.py | 45 | 4315 | """Test script for popen2.py"""
import warnings
warnings.filterwarnings("ignore", ".*popen2 module is deprecated.*",
DeprecationWarning)
warnings.filterwarnings("ignore", "os\.popen. is deprecated.*",
DeprecationWarning)
import os
import sys
import unittest
import popen... | gpl-3.0 |
mmalyska/eve-wspace | evewspace/Map/views.py | 1 | 36404 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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... | gpl-3.0 |
arshaver/django-photologue | urls.py | 23 | 2931 | from django.conf import settings
from django.conf.urls.defaults import *
from models import *
# Number of random images from the gallery to display.
SAMPLE_SIZE = ":%s" % getattr(settings, 'GALLERY_SAMPLE_SIZE', 5)
# galleries
gallery_args = {'date_field': 'date_added', 'allow_empty': True, 'queryset': Gallery.object... | bsd-3-clause |
frouty/odoo_oph | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py | 384 | 2324 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
jcftang/ansible-modules-extras | cloud/amazon/ec2_vpc_nat_gateway.py | 36 | 34426 | #!/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 |
nirmeshk/mase | src/abstract.py | 4 | 13355 | from __future__ import print_function, division
from ok import *
import random,re,sys
sys.dont_write_bytecode = True
"""
# Abstraction (Advanced Python Coding)
Layers within layers within layers..
In the following, we will
divide the problem into layers of abstraction where `iterators`
separate out the various c... | unlicense |
mzizzi/ansible | lib/ansible/modules/network/aci/aci_rest.py | 9 | 13219 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Jason Edelman <jason@networktocode.com>, Network to Code, LLC
# Copyright 2017 Dag Wieers <dag@wieers.com>
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-3.0 |
scavarda/mysql-dbcompare | mysql-utilities-1.6.0/scripts/mysqlserverinfo.py | 3 | 5949 | #!/usr/bin/env python
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. 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; version 2 of the License.
#
# This progra... | apache-2.0 |
le9i0nx/ansible | lib/ansible/modules/cloud/ovirt/ovirt_tags_facts.py | 73 | 4844 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | gpl-3.0 |
rhli/hadoop-EAR | build/hadoop-0.20/contrib/hod/hodlib/Common/setup.py | 182 | 45814 | #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 thi... | apache-2.0 |
tedlaz/pyted | tedutil/db_context_manager.py | 1 | 5076 | '''
Module db_context_manager.py
Connect to sqlite database and perform crud functions
'''
import sqlite3
import os
PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
print(PATH)
def grup(txtv):
'''
Trasforms a string to uppercase special for Greek comparison
'''
ar1 = u"αάΆΑβγδεέΈζ... | gpl-3.0 |
baroquebobcat/pants | src/python/pants/backend/jvm/targets/jvm_target.py | 2 | 9510 | # 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)
from twitter.common.... | apache-2.0 |
Erotemic/local | build_scripts/custom_fletch.py | 1 | 5960 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
from os.path import dirname # NOQA
import sys
def disable_packages():
if pkgname == 'OpenBLAS':
"""
PKGNAME=OpenBLAS
PKGNAME=Zlib
find build/src/ -iname CMakeCache.txt -delete
rm -rf build/src/$PKGNAME*
rm -... | gpl-3.0 |
vidyar/testing-yml | setup.py | 1 | 1647 | # dockerpty.
#
# Copyright 2014 Chris Corbyn <chris@w3style.co.uk>
#
# 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 ap... | apache-2.0 |
apagac/cfme_tests | cfme/tests/networks/test_sdn_downloads.py | 2 | 2791 | import random
import pytest
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.gce import GCEProvider
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.utils.appliance.implementations.ui import navigate_to
pytestmark = [
... | gpl-2.0 |
gnuradio/gnuradio | gr-blocks/python/blocks/qa_throttle.py | 7 | 1711 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
import pmt
from gnuradio import gr, gr_unittest, blocks
class test_throttle(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_b... | gpl-3.0 |
hgiemza/DIRAC | tests/System/dirac-test-production.py | 1 | 4565 | """ This script submits a test prodJobuction with filter
"""
import time
import os
import json
from DIRAC.Core.Base import Script
Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
'Usage:',
' %s test directory' % Script.scriptName... | gpl-3.0 |
DavidLP/home-assistant | homeassistant/components/logi_circle/sensor.py | 4 | 4867 | """Support for Logi Circle sensors."""
import logging
from homeassistant.const import (
ATTR_ATTRIBUTION, ATTR_BATTERY_CHARGING, CONF_MONITORED_CONDITIONS,
CONF_SENSORS, STATE_OFF, STATE_ON)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.icon import icon_for_battery_level
from homea... | apache-2.0 |
RKD314/yumstat | simple/apiclient/errors.py | 108 | 3516 | #!/usr/bin/python2.4
#
# 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 l... | mit |
savanu/servo | tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-ruby-tests.py | 829 | 3042 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... | mpl-2.0 |
cournape/Bento | bento/commands/build.py | 1 | 2331 | import os
import os.path as op
from bento.utils.utils \
import \
subst_vars
from bento.installed_package_description \
import \
BuildManifest, build_manifest_meta_from_pkg
from bento._config \
import \
BUILD_MANIFEST_PATH
from bento.commands.core \
import \
Option
from... | bsd-3-clause |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/internal/backends/chrome/chrome_browser_backend_unittest.py | 7 | 3764 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
from telemetry.internal import forwarders
from telemetry.internal.backends.chrome import chrome_browser_backend
from telemetry.i... | gpl-3.0 |
kohr-h/odl | examples/solvers/denoising_with_entropy_type_regularization.py | 2 | 2338 | """Denoising using PDHG with TV & entropy-type data term.
Solves the following optimization problem:
min_{x > 0} KL(x, g) + lam || |grad(x)| ||_1
where ``KL(x, g)`` is the Kullback-Leibler divergence, ``grad`` is the
spatial gradient, ``|| . ||_1`` is the 1 norm and lam is a regularization
constant.
For detail... | mpl-2.0 |
gencer/sentry | src/sentry/south_migrations/0235_auto__add_projectbookmark__add_unique_projectbookmark_project_id_user_.py | 2 | 64945 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'ProjectBookmark'
db.create_table(
'sentry_proj... | bsd-3-clause |
abartlet/samba | third_party/waf/wafadmin/Scripting.py | 32 | 15298 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005 (ita)
"Module called for configuring, compiling and installing targets"
import os, sys, shutil, traceback, datetime, inspect, errno
import Utils, Configure, Build, Logs, Options, Environment, Task
from Logs import error, warn, info
from Constants import *
... | gpl-3.0 |
Endika/edx-platform | lms/djangoapps/instructor/features/bulk_email.py | 33 | 6776 | """
Define steps for bulk email acceptance test.
"""
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from lettuce.django import mail
from nose.tools import assert_in, assert_equal
from django.core.management import call_command
from django.conf import setting... | agpl-3.0 |
aimas/TuniErp-8.0 | addons/website_mail/__openerp__.py | 379 | 1623 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
ghchinoy/tensorflow | tensorflow/contrib/copy_graph/__init__.py | 55 | 1187 | # 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 |
MoKee/android_kernel_sony_msm8974pro | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
joowani/dtags | dtags/commands/tags.py | 1 | 5372 | import json
import sys
from pathlib import Path
from typing import List, Optional, Set, Tuple
from dtags import style
from dtags.commons import (
dtags_command,
get_argparser,
normalize_tags,
prompt_user,
reverse_map,
)
from dtags.files import get_new_config, load_config_file, save_config_file
USA... | mit |
muntasirsyed/intellij-community | python/helpers/epydoc/docwriter/dotgraph.py | 91 | 53233 | # epydoc -- Graph generation
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: dotgraph.py 1663 2007-11-07 15:29:47Z dvarrazzo $
"""
Render Graphviz directed graphs as images. Below are some examples.
.. importgraph::
.. classtree:: epydoc.apidoc.A... | apache-2.0 |
orisi/orisi | src/oracle/handlers/handlers.py | 2 | 1334 | from timelock_contract.timelock_create_handler import TimelockCreateHandler
from bounty_contract.bounty_create_handler import BountyCreateHandler
from bounty_contract.bounty_redeem_handler import GuessPasswordHandler
from transactionsigner import TransactionSigner
from safe_timelock_contract.timelock_mark_release_handl... | mit |
NL66278/OCB | addons/account/report/__init__.py | 381 | 1513 | # -*- 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 |
Alphadelta14/ansible | lib/ansible/cli/__init__.py | 3 | 22439 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
sahutd/youtube-dl | youtube_dl/extractor/libsyn.py | 39 | 1996 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate
class LibsynIE(InfoExtractor):
_VALID_URL = r'https?://html5-player\.libsyn\.com/embed/episode/id/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://html5-player.libsyn.com/... | unlicense |
yangdw/repo.python | src/annotation/WeRoBot/werobot/session/saekvstorage.py | 14 | 1134 | # -*- coding: utf-8 -*-
from . import SessionStorage
class SaeKVDBStorage(SessionStorage):
"""
SaeKVDBStorage 使用SAE 的 KVDB 来保存你的session ::
import werobot
from werobot.session.saekvstorage import SaeKVDBStorage
session_storage = SaeKVDBStorage()
robot = werobot.WeRoBot(token=... | mit |
mmardini/django | django/views/static.py | 45 | 5174 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
from __future__ import unicode_literals
import mimetypes
import os
import stat
import posixpath
import re
from django.http import (Http404, HttpResponse, HttpResponseRedi... | bsd-3-clause |
tonnrueter/pymca_devel | PyMca/TiffStack.py | 1 | 14610 | #/*##########################################################################
# Copyright (C) 2004-2012 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
#
# This file is free software; you can redistribute it and/or modi... | gpl-2.0 |
actuaryzhang/spark | python/pyspark/conf.py | 20 | 7601 | #
# 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 |
rickyHong/Tensorflow_modi | tensorflow/python/ops/sparse_ops_test.py | 5 | 7482 | """Tests for Python ops defined in sparse_ops."""
import tensorflow.python.platform
import numpy as np
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.framework import types
from tensorflow.python.ops import constant_op
from tensorflow.python.ops i... | apache-2.0 |
wilson208/MapMaker | MapMaker/MapMaker/env/Lib/encodings/mac_iceland.py | 593 | 13754 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | apache-2.0 |
shzygmyx/Adaboost | boosting.py | 1 | 13043 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 14 14:39:38 2016
@author: Meng Yuxian
This is an implementation of <Improved boosting algorithms using
confidence-rated predictions>, Schapire, 1999.
"""
from math import e, log
import numpy as np
from sklearn.tree import DecisionTreeClassifier
class Ada... | gpl-3.0 |
dionhaefner/veros | test/pyom_consistency/eke_test.py | 1 | 3344 | from collections import OrderedDict
import numpy as np
from test_base import VerosPyOMUnitTest
from veros.core import eke
class EKETest(VerosPyOMUnitTest):
nx, ny, nz = 70, 60, 50
extra_settings = {
'enable_cyclic_x': True,
'enable_eke_leewave_dissipation': True,
'enable_eke': True,
... | mit |
rohitwaghchaure/erpnext_develop | erpnext/setup/setup_wizard/data/industry_type.py | 76 | 1174 | from frappe import _
def get_industry_types():
return [
_('Accounting'),
_('Advertising'),
_('Aerospace'),
_('Agriculture'),
_('Airline'),
_('Apparel & Accessories'),
_('Automotive'),
_('Banking'),
_('Biotechnology'),
_('Broadcasting'),
_('Brokerage'),
_('Chemical'),
_('Computer'),
_('Cons... | gpl-3.0 |
PulsePod/evepod | lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/hooks/external_feedparser.py | 4 | 2136 | import sys
import types
import newrelic.packages.six as six
import newrelic.api.transaction
import newrelic.api.object_wrapper
import newrelic.api.external_trace
class capture_external_trace(object):
def __init__(self, wrapped):
newrelic.api.object_wrapper.update_wrapper(self, wrapped)
self._nr_... | apache-2.0 |
miraculixx/heroku-buildpack-python | vendor/pip-pop/pip/_vendor/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
google-research/simclr | tf2/data_util.py | 1 | 18220 | # coding=utf-8
# Copyright 2020 The SimCLR 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
heeraj123/oh-mainline | vendor/packages/Django/django/http/cookie.py | 110 | 3535 | from __future__ import absolute_import, unicode_literals
from django.utils.encoding import force_str
from django.utils import six
from django.utils.six.moves import http_cookies
# Some versions of Python 2.7 and later won't need this encoding bug fix:
_cookie_encodes_correctly = http_cookies.SimpleCookie().value_enc... | agpl-3.0 |
benhamner/GEFlightQuest | PythonModule/geflight/fq2/basic_filter.py | 3 | 3642 | import csv
from geflight.transform import flighthistory
from geflight.transform import utilities
import gzip
import os
import pandas as pd
def get_us_airport_icao_codes(codes_file):
df = pd.read_csv(codes_file)
return set(df["icao_code"])
def is_flight_in_or_out_of_us(row, us_icao_codes):
if ((row["arriva... | bsd-2-clause |
diego-plan9/beets | test/test_ui_init.py | 10 | 3579 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, 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 t... | mit |
Daniel-CA/odoo-addons | stock_quant_expiry/models/stock_quant.py | 1 | 1792 | # -*- coding: utf-8 -*-
# Copyright 2017 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class StockQuant(models.Model):
_inherit = 'stock.quant'
@api.multi
@api.depends('lot_id.life_date', 'lot_id.mrp_date')
def _co... | agpl-3.0 |
carsongee/edx-platform | common/djangoapps/external_auth/tests/test_openid_provider.py | 46 | 16144 | #-*- encoding=utf-8 -*-
'''
Created on Jan 18, 2013
@author: brian
'''
import openid
import json
from openid.fetchers import HTTPFetcher, HTTPResponse
from urlparse import parse_qs, urlparse
from django.conf import settings
from django.test import TestCase, LiveServerTestCase
from django.core.cache import cache
from ... | agpl-3.0 |
hastexo/edx-platform | common/djangoapps/terrain/stubs/xqueue.py | 24 | 8740 | """
Stub implementation of XQueue for acceptance tests.
Configuration values:
"default" (dict): Default response to be sent to LMS as a grade for a submission
"<submission>" (dict): Grade response to return for submissions containing the text <submission>
"register_submission_url" (str): URL to send grader... | agpl-3.0 |
harpribot/deep-summarization | train_scripts/train_script_lstm_stacked_bidirectional_attention.py | 1 | 1043 | import os
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '..'))
from models import lstm_stacked_bidirectional
from helpers import checkpoint
# Get the review summary file
review_summary_file = 'extracted_data/review_summary.csv'
# Initialize Checkpointer to ensure checkpointing
checkpoint... | mit |
ScanOC/trunk-player | radio/receivers.py | 1 | 1882 | # receivers.py
import json
import logging
import datetime
from django.dispatch import receiver
from django.contrib.auth.models import User
from pinax.stripe.signals import WEBHOOK_SIGNALS
from radio.models import Plan, StripePlanMatrix, Profile
from pinax.stripe.models import Plan as pinax_Plan
# Get an instance of... | mit |
GitHublong/hue | desktop/core/ext-py/South-1.0.2/south/tests/autodetection.py | 93 | 12026 | from south.tests import unittest
from south.creator.changes import AutoChanges, InitialChanges
from south.migration.base import Migrations
from south.tests import Monkeypatcher
from south.creator import freezer
from south.orm import FakeORM
from south.v2 import SchemaMigration
try:
from django.utils.six.moves imp... | apache-2.0 |
Grumbel/rfactorlcd | rfactorlcd/state.py | 1 | 13232 | # rFactor Remote LCD
# Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com>
#
# 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 versi... | gpl-3.0 |
bagcoin/bagcoin | qa/rpc-tests/listtransactions.py | 164 | 4718 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework import BitcoinTestFramework
from bitcoinrpc.authproxy... | apache-2.0 |
lacrazyboy/scrapy | scrapy/linkextractors/htmlparser.py | 90 | 2883 | """
HTMLParser-based link extractor
"""
import warnings
from six.moves.html_parser import HTMLParser
from six.moves.urllib.parse import urljoin
from w3lib.url import safe_url_string
from scrapy.link import Link
from scrapy.utils.python import unique as unique_list
from scrapy.exceptions import ScrapyDeprecationWarni... | bsd-3-clause |
azverkan/scons | src/engine/SCons/Node/AliasTests.py | 3 | 3939 | #
# __COPYRIGHT__
#
# 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, modify, merge, publish,
# distribute, sublicen... | mit |
sarantapichos/faircoop-market | addons/base_import_module/models/base_import_module.py | 344 | 2066 | import base64
from StringIO import StringIO
from io import BytesIO
from openerp.osv import osv, fields
class base_import_module(osv.TransientModel):
""" Import Module """
_name = "base.import.module"
_description = "Import Module"
_columns = {
'module_file': fields.binary('Module .ZIP file', r... | agpl-3.0 |
andyfaff/scipy | scipy/signal/tests/test_bsplines.py | 12 | 13021 | # pylint: disable=missing-docstring
import numpy as np
from numpy import array
from numpy.testing import (assert_equal,
assert_allclose, assert_array_equal,
assert_almost_equal)
import pytest
from pytest import raises
import scipy.signal.bsplines as bsp
from scipy ... | bsd-3-clause |
ocelot-collab/ocelot | unit_tests/ebeam_test/acc_utils/acc_utils_test.py | 1 | 4045 | """Test of the demo file demos/ebeam/csr_ex.py"""
import os
import sys
import copy
import time
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
REF_RES_DIR = FILE_DIR + '/ref_results/'
from unit_tests.params import *
from acc_utils_conf import *
def test_lattice_transfer_map(lattice, p_array, parameter=None, ... | gpl-3.0 |
magvugr/AT | EntVirtual/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/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... | gpl-3.0 |
jelly/arch-security-tracker | test/test_group.py | 2 | 19809 | from flask import url_for
from werkzeug.exceptions import Forbidden
from werkzeug.exceptions import NotFound
from config import TRACKER_BUGTRACKER_URL
from tracker.model.cve import CVE
from tracker.model.cve import issue_types
from tracker.model.cvegroup import CVEGroup
from tracker.model.enum import Affected
from tra... | mit |
ellisztamas/faps | faps/pr_unsampled.py | 1 | 2716 | import numpy as np
def pr_unsampled(offspring_diploid, maternal_diploid, allele_freqs, offspring_genotype, maternal_genotype, male_genotype, mu):
"""
Calculate the transitions probability for a given set of parental and offspring
alleles.
Transitipn probabilities are then weight by the probability of... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.