code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
from sympy.integrals.transforms import (mellin_transform,
inverse_mellin_transform, laplace_transform, inverse_laplace_transform,
fourier_transform, inverse_fourier_transform,
sine_transform, inverse_sine_transform,
cosine_transform, inverse_cosine_transform,
hankel_transform, inverse_hankel_transfo... | sahilshekhawat/sympy | sympy/integrals/tests/test_transforms.py | Python | bsd-3-clause | 32,514 |
"""
Component to keep track of user controlled booleans for within automation.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/input_boolean/
"""
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN... | deisi/home-assistant | homeassistant/components/input_boolean.py | Python | mit | 3,700 |
def reraise_impl(e, traceback):
raise e.__class__, e, traceback
| dianchen96/gym | utils/reraise_impl_py2.py | Python | mit | 68 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapBoxGlStyleConverter.
.. note:: 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 vers... | nyalldawson/QGIS | tests/src/python/test_qgsmapboxglconverter.py | Python | gpl-2.0 | 31,975 |
# Copyright (C) by Josh Blum. See LICENSE.txt for licensing information.
import unittest
import gras
class ModuleLoaderTest(unittest.TestCase):
def test_load_module_cpp(self):
my_block = gras.make("/tests/my_block0")
self.assertEqual(my_block.get_num(), 42)
def test_load_module_py(self):
... | ambikeshwar1991/sandhi-2 | tests/module_loader_test.py | Python | gpl-3.0 | 463 |
'''test pycairo API
- can be expanded later as required.
- is not able to test the quality of images created. We assume cairo itself
tests for this.
'''
import tempfile as tfi
import cairo
import py.test as test
def test_context():
if cairo.HAS_IMAGE_SURFACE:
f, w, h = cairo.FORMAT_ARGB32, 100, 100
s = c... | freedesktop-unofficial-mirror/pycairo | test/api_test.py | Python | gpl-3.0 | 4,182 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | crmccreary/openerp_server | openerp/addons/l10n_ma/l10n_ma.py | Python | agpl-3.0 | 1,995 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/python/ops/losses/losses_impl.py | Python | bsd-2-clause | 32,570 |
from . import SimConcretizationStrategy
class SimConcretizationStrategyAny(SimConcretizationStrategy):
"""
Concretization strategy that returns any single solution.
"""
def _concretize(self, memory, addr):
if self._exact:
return [ self._any(memory, addr) ]
else:
... | chubbymaggie/simuvex | simuvex/concretization_strategies/any.py | Python | bsd-2-clause | 410 |
# -*- coding: utf-8 -*-
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.cache import Cache
cache = Cache()
from flask.ext.login import LoginManager
login_manager = LoginManager()
from flask.ext.openid import OpenID
oid = OpenID()
| danieltimpone/lurcat-flask | lurcat/addons/extensions.py | Python | bsd-3-clause | 310 |
#!/usr/bin/env python
# Copyright 2015 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 sys
f = open(sys.argv[1], 'w')
f.write(' '.join(sys.argv[2:]))
f.close()
| ibc/MediaSoup | worker/deps/gyp/test/dependencies/adso/write_args.py | Python | isc | 257 |
# (c) 2016, Ansible by Red Hat <support@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... | filipenf/ansible | lib/ansible/utils/helpers.py | Python | gpl-3.0 | 1,267 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 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 Affe... | crmccreary/openerp_server | openerp/addons/document_webdav/document_webdav.py | Python | agpl-3.0 | 5,106 |
"""
gargoyle.admin
~~~~~~~~~~~~~~
:copyright: (c) 2010 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
from django.contrib import admin
from gargoyle.models import Switch
class SwitchAdmin(admin.ModelAdmin):
list_display = ('label', 'key', 'status')
list_filter = ('status',)
sear... | brilliant-org/gargoyle | gargoyle/admin.py | Python | apache-2.0 | 400 |
import unittest, random, sys, time, string
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_pca, h2o_jobs as h2j
def write_syn_dataset(csvPathname, rowCount, colCount, SEED):
# do we need more than one random generator?
r1 = random.Random(SEED)
dsf = ... | rowhit/h2o-2 | py/testdir_single_jvm/test_PCA_ignore_enums_fvec.py | Python | apache-2.0 | 5,469 |
from collections import defaultdict
from sympy import Symbol
from sympy.core.compatibility import range
from sympy.ntheory import n_order, is_primitive_root, is_quad_residue, \
legendre_symbol, jacobi_symbol, totient, primerange, sqrt_mod, \
primitive_root, quadratic_residues, is_nthpow_residue, nthroot_mod, \... | ChristinaZografou/sympy | sympy/ntheory/tests/test_residue.py | Python | bsd-3-clause | 8,755 |
"Database cache backend."
import base64
import time
from datetime import datetime
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.cache.backends.base import BaseCache, DEFAULT_TIMEOUT
from django.db import connection... | denisenkom/django | django/core/cache/backends/db.py | Python | bsd-3-clause | 7,610 |
#!/usr/bin/env vpython3
# Copyright 2020 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.
#pylint: disable=protected-access
import json
import os
import sys
import tempfile
import unittest
if sys.version_info[0] == 2:
i... | ric2b/Vivaldi-browser | chromium/build/skia_gold_common/skia_gold_session_unittest.py | Python | bsd-3-clause | 40,563 |
"""Testing for bicluster metrics module"""
import numpy as np
from sklearn.utils._testing import assert_almost_equal
from sklearn.metrics.cluster._bicluster import _jaccard
from sklearn.metrics import consensus_score
def test_jaccard():
a1 = np.array([True, True, False, False])
a2 = np.array([True, True, T... | manhhomienbienthuy/scikit-learn | sklearn/metrics/cluster/tests/test_bicluster.py | Python | bsd-3-clause | 1,720 |
# -*- coding: utf-8 -*-
#
# sinusoidal_gamma_generator.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 ... | niltonlk/nest-simulator | pynest/examples/sinusoidal_gamma_generator.py | Python | gpl-2.0 | 11,812 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para buscar en tu.tv
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
import sys
... | Zanzibar82/pelisalacarta | python/main-classic/channels/tutvsite.py | Python | gpl-3.0 | 3,518 |
# -*- coding: utf-8 -*-
#
# Firefox Puppeteer documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 20 10:35:33 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated f... | cstipkovic/spidermonkey-research | testing/puppeteer/firefox/docs/conf.py | Python | mpl-2.0 | 8,594 |
#!/usr/bin/env python
# Copyright 2010-2015 RethinkDB, all rights reserved.
import sys, socket, random, time, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import rdb_workload_common
from vcoptparse import *
op = rdb_workload_common.option_parser_for_connect()
... | matthaywardwebdesign/rethinkdb | test/memcached_workloads/append_stress.py | Python | agpl-3.0 | 1,267 |
################################################################################
# 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... | hequn8128/flink | flink-python/pyflink/table/serializers.py | Python | apache-2.0 | 3,089 |
# 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.
from telemetry import benchmark
from telemetry.timeline import tracing_category_filter
from telemetry.web_perf import timeline_based_measurement
from benchma... | js0701/chromium-crosswalk | tools/telemetry/examples/benchmarks/v8_benchmark.py | Python | bsd-3-clause | 1,100 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ast
import unittest
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger
from odoo.tools.safe_eval import safe_eval
class TestSafeEval(uni... | chienlieu2017/it_management | odoo/odoo/addons/base/tests/test_base.py | Python | gpl-3.0 | 32,341 |
from coalib.results.Result import Result
from coalib.results.result_actions.ResultAction import ResultAction
class PrintMoreInfoAction(ResultAction):
@staticmethod
def is_applicable(result, original_file_dict, file_diff_dict):
return isinstance(result, Result) and result.additional_info != ""
de... | abhiroyg/coala | coalib/results/result_actions/PrintMoreInfoAction.py | Python | agpl-3.0 | 530 |
"""Test Z-Wave locks."""
from unittest.mock import patch, MagicMock
from homeassistant import config_entries
from homeassistant.components.zwave import const, lock
from tests.mock.zwave import (
MockNode, MockValue, MockEntityValues, value_changed)
def test_get_device_detects_lock(mock_openzwave):
"""Test g... | MartinHjelmare/home-assistant | tests/components/zwave/test_lock.py | Python | apache-2.0 | 12,541 |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
# Utilities to read and write .jar.info files.
#
# A .jar.info file contains a simple mapping from fully-qualified Java class
# names to the sourc... | ric2b/Vivaldi-browser | chromium/build/android/gyp/util/jar_info_utils.py | Python | bsd-3-clause | 2,123 |
from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class LinkLockFile(LockBase):
"""Lock access to a file using atomic property of link(2).
>>> lock = LinkLockFile('somefile')
>>> lock = LinkL... | mattrobenolt/pip | pip/_vendor/lockfile/linklockfile.py | Python | mit | 2,625 |
#
# Copyright (c) 2007 Hyperic, 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 w... | szabowexler/balancers | src/main/resources/hyperic-sigar-1.6.4/bindings/python/sigar.py | Python | gpl-2.0 | 607 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation
#
# 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
#... | trunglq7/horizon | openstack_dashboard/dashboards/project/networks/ports/tables.py | Python | apache-2.0 | 2,261 |
# 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... | josh-mckenzie/cassandra-dbapi2 | cql/__init__.py | Python | apache-2.0 | 1,727 |
import numpy as np
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid
from bokeh.models.glyphs import Annulus
from bokeh.io import curdoc, show
N = 9
x = np.linspace(-2, 2, N)
y = x**2
source = ColumnDataSource(dict(x=x, y=y))
xdr = DataRange1d()
ydr = DataRange1d()
plot = Plot(
tit... | percyfal/bokeh | tests/glyphs/Annulus.py | Python | bsd-3-clause | 839 |
# (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... | TeutoNet-Netzdienste/ansible | v2/ansible/executor/process/result.py | Python | gpl-3.0 | 7,189 |
# 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... | nburn42/tensorflow | tensorflow/contrib/kfac/python/ops/fisher_blocks.py | Python | apache-2.0 | 67,013 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Lexer for PPAPI IDL """
#
# IDL Lexer
#
# The lexer is uses the PLY lex library to build a tokenizer which understands
# WebID... | gavinp/chromium | ppapi/generators/idl_lexer.py | Python | bsd-3-clause | 9,089 |
"""
kombu.mixins
============
Useful mixin classes.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import with_statement
import socket
from contextlib import contextmanager
from functools import partial
from itertool... | mozilla/make.mozilla.org | vendor-local/lib/python/kombu/mixins.py | Python | bsd-3-clause | 7,733 |
#!/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',
... | Jorge-Rodriguez/ansible | lib/ansible/modules/network/f5/bigip_monitor_http.py | Python | gpl-3.0 | 23,876 |
from openerp import api, models, fields, SUPERUSER_ID
from openerp.osv import fields as old_fields
import openerp.addons.decimal_precision as dp
class sale_order_line(models.Model):
_inherit = 'sale.order.line'
def _get_price_unit_without_taxes(self, cr, uid, ids, fname, arg, context=None):
res = {}
... | litnimax/addons-yelizariev | product_without_taxes/models.py | Python | lgpl-3.0 | 1,571 |
## 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 applic... | lukeiwanski/tensorflow-opencl | tensorflow/python/saved_model/saved_model_test.py | Python | apache-2.0 | 33,383 |
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | hstefan/grpc | src/python/grpcio_tests/tests/qps/worker_server.py | Python | bsd-3-clause | 8,438 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/UseItemXpBoostResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
f... | Mickey32111/pogom | pogom/pgoapi/protos/POGOProtos/Networking/Responses/UseItemXpBoostResponse_pb2.py | Python | mit | 4,786 |
# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class ProjectTaskWork(... | InakiZabala/odoomrp-wip | mrp_wizard_filter_task/models/project_task_work.py | Python | agpl-3.0 | 668 |
#!/usr/bin/env python
from pymongo import MongoClient
import pymongo
HOST = "ip-172-31-29-102.us-west-2.compute.internal:27017,ip-172-31-29-103.us-west-2.compute.internal:27017,ip-172-31-29-104.us-west-2.compute.internal:27017,ip-172-31-29-105.us-west-2.compute.internal:27017,ip-172-31-29-101.us-west-2.compute.intern... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/10_2_workflow_full_10files_secondary_wmj_3sh_3rs_with_annot_with_proj_3s_range_old/init_0/DataStoreInit.py | Python | gpl-3.0 | 3,106 |
# coding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_duration,
parse_iso8601,
sanitized_Request,
xpath_text,
det... | fluxw42/youtube-dl | youtube_dl/extractor/niconico.py | Python | unlicense | 10,092 |
# 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... | cg31/tensorflow | tensorflow/python/kernel_tests/pooling_ops_test.py | Python | apache-2.0 | 43,495 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResumeLine(models.Model):
_inherit = 'hr.resume.line'
display_type = fields.Selection(selection_add=[('course', 'Course')])
channel_id = fields.Many2one('slide.channel... | ddico/odoo | addons/hr_skills_slides/models/hr_resume_line.py | Python | agpl-3.0 | 355 |
# pylint: disable=missing-docstring
from lettuce import world, step
from selenium.webdriver.common.keys import Keys
from xmodule.modulestore.django import modulestore
VIDEO_BUTTONS = {
'CC': '.hide-subtitles',
'volume': '.volume',
'play': '.video_control.play',
'pause': '.video_control.pause',
'ha... | olexiim/edx-platform | cms/djangoapps/contentstore/features/video.py | Python | agpl-3.0 | 8,674 |
from __future__ import division
import contextlib
import json
import numbers
try:
import requests
except ImportError:
requests = None
from jsonschema import _utils, _validators
from jsonschema.compat import (
Sequence, urljoin, urlsplit, urldefrag, unquote, urlopen,
str_types, int_types, iteritems, l... | ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/jsonschema/validators.py | Python | apache-2.0 | 15,921 |
import numpy as np
from scipy.ndimage import label
def clear_border(image, buffer_size=0, bgval=0):
"""Clear objects connected to image border.
The changes will be applied to the input image.
Parameters
----------
image : (N, M) array
Binary image.
buffer_size : int, optional
... | michaelaye/scikit-image | skimage/segmentation/_clear_border.py | Python | bsd-3-clause | 2,072 |
from pyasn1.type import univ
from pyasn1.codec.der import decoder
from pyasn1.compat.octets import ints2octs
from pyasn1.error import PyAsn1Error
from sys import version_info
if version_info[0:2] < (2, 7) or \
version_info[0:2] in ( (3, 0), (3, 1) ):
try:
import unittest2 as unittest
except ImportErr... | bertucho/epic-movie-quotes-quiz | dialogos/build/pyasn1/test/codec/der/test_decoder.py | Python | mit | 963 |
__all__ = ['ComingEpisodes', 'History', 'Show']
| mcus/SickRage | sickrage/show/__init__.py | Python | gpl-3.0 | 48 |
# 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... | drpngx/tensorflow | tensorflow/python/keras/datasets/boston_housing.py | Python | apache-2.0 | 2,226 |
# 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... | nburn42/tensorflow | tensorflow/python/ops/linalg/linear_operator_identity.py | Python | apache-2.0 | 27,557 |
# -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... | gwwfps/boxrps | werkzeug/contrib/sessions.py | Python | mit | 12,250 |
# coding=utf-8
"""
Tests for SickRage system
"""
import unittest
from restart_tests import RestartTests
from shutdown_tests import ShutdownTests
if __name__ == '__main__':
print('=====> Running all test in "sickrage_tests.system" <=====')
TEST_CLASSES = [
RestartTests,
ShutdownTests,
]
... | Jusedawg/SickRage | tests/sickrage_tests/system/__init__.py | Python | gpl-3.0 | 484 |
#!/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 distribut... | grossws/ansible-modules-core | network/ios/ios_template.py | Python | gpl-3.0 | 5,773 |
# 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... | dongjoon-hyun/tensorflow | tensorflow/contrib/integrate/__init__.py | Python | apache-2.0 | 1,147 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Li... | Panos512/invenio | modules/websearch/lib/websearch_external_collections_parser.py | Python | gpl-2.0 | 27,936 |
# 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.
from copy import deepcopy
from file_system import FileSystem, StatInfo, FileNotFoundError
from future import Gettable, Future
class _AsyncFetchFuture(objec... | qtekfun/htcDesire820Kernel | external/chromium_org/chrome/common/extensions/docs/server2/patched_file_system.py | Python | gpl-2.0 | 6,069 |
import pickle
from django.core.exceptions import ValidationError
from django.forms import BooleanField
from django.test import SimpleTestCase
class BooleanFieldTest(SimpleTestCase):
def test_booleanfield_clean_1(self):
f = BooleanField()
with self.assertRaisesMessage(ValidationError, "'This fiel... | theo-l/django | tests/forms_tests/field_tests/test_booleanfield.py | Python | bsd-3-clause | 2,750 |
#!/usr/bin/env python
"""
An example showing how to use the interface to the pygraphviz
AGraph class to draw a graph.
Also see the pygraphviz documentation and examples at
http://pygraphviz.github.io/
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2006 by
# Aric Hagberg <hagberg@lanl.g... | ltiao/networkx | examples/pygraphviz/pygraphviz_draw.py | Python | bsd-3-clause | 689 |
from scrapy.spider import BaseSpider
class Spider2(BaseSpider):
name = "spider2"
allowed_domains = ["scrapy2.org", "scrapy3.org"]
| mzdaniel/oh-mainline | vendor/packages/scrapy/scrapy/tests/test_spidermanager/test_spiders/spider2.py | Python | agpl-3.0 | 139 |
"""Test reproduce state for Input text."""
from homeassistant.core import State
from homeassistant.setup import async_setup_component
VALID_TEXT1 = "Test text"
VALID_TEXT2 = "LoremIpsum"
INVALID_TEXT1 = "This text is too long!"
INVALID_TEXT2 = "Short"
async def test_reproducing_states(hass, caplog):
"""Test repr... | jawilson/home-assistant | tests/components/input_text/test_reproduce_state.py | Python | apache-2.0 | 1,982 |
# 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... | thomasquintana/jobber | tests/protocols/__init__.py | Python | apache-2.0 | 831 |
__author__ = 'Tom Schaul, tom@idsia.ch'
from random import uniform
from scipy import array
from scipy.stats.distributions import norm
def importanceMixing(oldpoints, oldpdf, newpdf, newdistr, forcedRefresh = 0.01):
""" Implements importance mixing. Given a set of points, an old and a new pdf-function for them
... | hassaanm/stock-trading | src/pybrain/auxiliary/importancemixing.py | Python | apache-2.0 | 1,713 |
import django.dispatch
render_done = django.dispatch.Signal(providing_args=["instance"])
| biswajitsahu/kuma | kuma/wiki/signals.py | Python | mpl-2.0 | 90 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.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',... | aperigault/ansible | lib/ansible/modules/storage/purestorage/purefb_dsrole.py | Python | gpl-3.0 | 6,212 |
#!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=... | XiaosongWei/crosswalk-test-suite | wrt/tct-ui01-wrt-tests/inst.xpk.py | Python | bsd-3-clause | 6,794 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv
from openerp.tools.translate import _
class project_configuration(osv.osv_memory):
_name = 'project.config.settings'
_inherit = 'project.config.settings'
_columns = {
... | vileopratama/vitech | src/addons/project_timesheet/res_config.py | Python | mit | 633 |
# 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... | scripnichenko/nova | nova/db/sqlalchemy/api_models.py | Python | apache-2.0 | 2,611 |
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Rackspace
# 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... | UK992/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/packages/rfc3986/misc.py | Python | mpl-2.0 | 7,868 |
from oscar.apps.checkout import app
from apps.checkout import views
class CheckoutApplication(app.CheckoutApplication):
# Replace the payment details view with our own
payment_details_view = views.PaymentDetailsView
application = CheckoutApplication() | lyoniionly/django-cobra | sites/sandbox/apps/checkout/app.py | Python | apache-2.0 | 264 |
"""
.. todo::
WRITEME
"""
import subprocess
import os
def get_memory_usage():
"""
Return int containing memory used by this process. Don't trust this
too much, I'm not totally sure what ps rss measures.
"""
pid = os.getpid()
process = subprocess.Popen("ps -o rss %s | awk '{sum+=$1} END {... | fyffyt/pylearn2 | pylearn2/utils/mem.py | Python | bsd-3-clause | 1,972 |
# 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... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/keras/python/keras/applications/imagenet_utils.py | Python | bsd-2-clause | 5,775 |
#
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | xkollar/spacewalk | client/tools/rhnpush/__init__.py | Python | gpl-2.0 | 613 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Classes in this file define additional actions that need to be taken to run a
test under some kind of runtime error detection tool.
The interface is... | wangscript/libjingle-1 | trunk/build/android/pylib/valgrind_tools.py | Python | bsd-3-clause | 8,364 |
# (c) 2014 Michael DeHaan, <michael@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 later ve... | chrrrles/ansible | lib/ansible/utils/listify.py | Python | gpl-3.0 | 1,641 |
# test 'return' within the finally block
# it should swallow the exception
# simple case
def f():
try:
raise ValueError()
finally:
print('finally')
return 0
print('got here')
print(f())
# nested, return in outer
def f():
try:
try:
raise ValueError
fi... | AriZuu/micropython | tests/basics/try_finally_return2.py | Python | mit | 1,834 |
#noinspection PyUnresolvedReferences
print xxx
| akosyakov/intellij-community | python/testData/inspections/suppress/suppressedForStatement.py | Python | apache-2.0 | 47 |
x = 0
print(x)
x = 1+\
2+\
3
print(x)
x=2
print(x) | asedunov/intellij-community | python/testData/debug/test_continuation2.py | Python | apache-2.0 | 50 |
import os
import glob
import shutil
from os import path
TEST_FILE_PATTERN = "support/**.test"
TEST_OUTPUT_PATH = "tests"
TEMPLATE = """\
<!doctype html>
<!-- DO NOT EDIT! This file and %vtt_file_rel_path are generated. -->
<!-- See /webvtt/parsing/file-parsing/README.md -->
<meta charset=utf-8>
<title>WebVTT parser ... | scheib/chromium | third_party/blink/web_tests/external/wpt/webvtt/parsing/file-parsing/tools/build.py | Python | bsd-3-clause | 3,474 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | jlmenut/test | docs/conf.py | Python | isc | 8,356 |
# -*- coding: utf-8 -*-
__author__ = 'Leonardo Giordani'
__email__ = 'giordani.leonardo@gmail.com'
__version__ = '2.0.0'
| lgiordani/punch | punch/__init__.py | Python | isc | 122 |
#!/usr/bin/env python
"""fix-rpath.py - Fix run-time search paths
Usage:
python fix-rpath.py <prefix>
python fix-rpath.py [-h | --help]
"""
from __future__ import print_function
import functools
import os
import platform
import re
import stat
import subprocess
import sys
Popen = functools.partial(subproc... | eliteraspberries/minipkg | fix-rpath.py | Python | isc | 4,528 |
"""Helper functions
Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to templates as 'h'.
"""
from __future__ import absolute_import
import re
import unicodedata
import lxml.html
import lxml.html.clean
import markdown
from webhelpers.html import ... | eevee/floof | floof/lib/helpers.py | Python | isc | 3,148 |
from unittest.mock import patch
import pytest
from eleanorrigbot import ELEANOR_RIGBY, PhraseMatcher
@pytest.mark.parametrize('input_, output', [
('hello world', False),
# actual quotes from the song
('waits at the window wearing the face that she keeps in a jar by '
'the door who is it for', True... | textbook/eleanor-rigbot | tests/test_classification.py | Python | isc | 3,007 |
import urllib2
import json as J
import ssl
import boto3
import os
import uClassify_utils as u
host = 'https://api.uclassify.com/v1/'
end_points = ['prfekt/mood/classify','prfekt/tonality/classify', 'prfekt/direction-aqal-jung/classify', 'prfekt/values/classify', 'uclassify/iab-taxonomy/classify']
key = 'Token PUTTOKE... | meyhelm/traitify_consolidator | U_lambda1_handler.py | Python | isc | 2,668 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Proxy models for generating flatfiles that combine multiple table into a simplified file.
"""
from opencivicdata.elections.models import BallotMeasureContest
from calaccess_processed.proxies import OCDProxyModelMixin
from calaccess_processed_flatfiles.managers import OC... | california-civic-data-coalition/django-calaccess-processed-data | calaccess_processed_flatfiles/proxies/ballotmeasurecontests.py | Python | mit | 1,348 |
from watson.modules.chatmodule import ChatModule, command_function, overhear_function
from watson.firebot import Firebot
class CampfireModule(ChatModule):
'''
This is a module to contains functions that really only make sense in Campfire, pretty much only audio commands.
'''
__module_name__ = "campfir... | abdinoor/Watson | watson/modules/campfire.py | Python | mit | 2,369 |
import glob
import os
import sys
from setuptools import setup, Extension, find_packages
src_dir = "src"
include_dirs = glob.glob(os.path.join("src", "libqhull"))
sources = glob.glob(os.path.join("src", "libqhull", "*.c"))
if sys.platform.strip() == "darwin":
include_dirs += glob.glob(os.path.join("src", "fmemopen... | materialsvirtuallab/pyhull | setup.py | Python | mit | 2,940 |
from .commands import (
BicycleRepairRenameCommand,
BicycleRepairUndoLastRefactoringCommand
)
__all__ = [
'BicycleRepairRenameCommand',
'BicycleRepairUndoLastRefactoringCommand'
]
| srusskih/SublimeBicycleRepair | sublime_bicycle_repair/__init__.py | Python | mit | 197 |
from django.shortcuts import render
from django.views import generic
from album.models import Album
from django.utils import timezone
from django.utils.translation import ugettext as _
from django.conf import settings
from song.models import Song
from artist.models import Artist
from pure_pagination.mixins import Pagin... | contactr2m/remote_repo | src/album/views.py | Python | mit | 5,162 |
from flask_testing import TestCase
import json
from tests import app, config, db, User
class TestRegLogin(TestCase):
'''
'''
@staticmethod
def init_db():
db.drop_all()
db.create_all()
def create_app(self):
app.config.from_object('config.TestingConfig')
return app
... | andela-oadeniran/bucket_list_api | tests/test_auth.py | Python | mit | 4,257 |
#coding=utf-8
import os
import os.path
import shutil
import sys
import getopt
import string
import fnmatch
import md5
import hashlib
import zipfile
import time
import threading
import struct
from pprint import pprint
from struct import *
projectdir = os.path.dirname(os.path.realpath(__file__))
compileBin = os.pa... | lyzardiar/RETools | PublicTools/bin/tools/packLuaJit.py | Python | mit | 1,726 |
"""
Django settings for mymenu project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... | quangnguyen-asnet/python-django | mymenu/mymenu/settings.py | Python | mit | 2,804 |
from setuptools import setup
setup(name='qs_disptacher',
version='1.1.2.devel',
description='Dispatcher for Praneesh s Quick Stocks',
author='Praneesh Kataru',
author_email='pranuvitmsse05@gmail.com',
packages=['qs_dispatcher',
'qs_dispatcher.qs_wamp'],
install_requi... | Praneesh/quickstocks | qs_dispatcher/setup.py | Python | mit | 432 |
from .log import log
from .config import config
class apt:
@staticmethod
def install(*args, this=None):
log.info("install things")
# apt.install(this="""
# programa
# programb
# etc
# """)
| meantheory/dotfiles | dos/src/dos/apt.py | Python | mit | 248 |
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2020 Tobias Gruetzmacher
# Copyright (C) 2019-2020 Daniel Ring
from __future__ import absolute_import, division, print_function
from re import compile, escape, IGNO... | peterjanes/dosage | dosagelib/plugins/s.py | Python | mit | 22,937 |