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 .base import TransactionChannelTestCase, ChannelTestCase, Client, apply_routes # NOQA isort:skip
from .http import HttpClient # NOQA isort:skip
| raphael-boucher/channels | channels/tests/__init__.py | Python | bsd-3-clause | 151 |
import datetime
import os
from django import forms
from django.db.models.fields import Field
from django.core import checks
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils... | mbox/django | django/db/models/fields/files.py | Python | bsd-3-clause | 18,658 |
from __future__ import division, print_function, absolute_import
from numpy import sqrt, inner, zeros, inf, finfo
from numpy.linalg import norm
from .utils import make_system
__all__ = ['minres']
def minres(A, b, x0=None, shift=0.0, tol=1e-5, maxiter=None,
M=None, callback=None, show=False, check=False)... | gertingold/scipy | scipy/sparse/linalg/isolve/minres.py | Python | bsd-3-clause | 10,577 |
# -*- coding: utf-8 -*-
from frontera.contrib.scrapy.converters import RequestConverter, ResponseConverter
from scrapy.http.request import Request as ScrapyRequest
from scrapy.http.response import Response as ScrapyResponse
from frontera.core.models import Request as FrontierRequest
class TestSpider(object):
def... | pombredanne/frontera | frontera/tests/test_scrapy.py | Python | bsd-3-clause | 2,597 |
import os
import re
import sys
import imp
import copy
import glob
import atexit
import tempfile
import subprocess
import shutil
from distutils.errors import DistutilsError
try:
set
except NameError:
from sets import Set as set
from numpy.distutils.compat import get_exception
__all__ = ['Configuration', 'get... | jasonmccampbell/numpy-refactor-sprint | numpy/distutils/misc_util.py | Python | bsd-3-clause | 80,942 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
import dynamic_forms.fields
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
bases = (models.Model,),... | uhuramedia/django-dynamic-forms | dynamic_forms/migrations/0001_initial.py | Python | bsd-3-clause | 4,424 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
import StringIO
import mock # pylint: disable=F0401
import fetch_benchmark_deps
def NormPaths(paths):
return sorte... | Chilledheart/chromium | tools/perf/fetch_benchmark_deps_unittest.py | Python | bsd-3-clause | 2,479 |
#!/usr/bin/env python
# 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.
"""Re-runs the ChromeDriver's client-side commands, given a log file.
Takes a ChromeDriver log file that was created with the --replay... | ric2b/Vivaldi-browser | chromium/chrome/test/chromedriver/log_replay/client_replay.py | Python | bsd-3-clause | 37,637 |
import collections
import os
import unittest
import mpi4py.MPI
import pytest
from chainermn.communicators.mpi_communicator_base import MpiCommunicatorBase
class NodeAwareNaiveCommunicator(MpiCommunicatorBase):
def __init__(self, mpi_comm):
super(NodeAwareNaiveCommunicator, self).__init__(mpi_comm)
... | rezoo/chainer | tests/chainermn_tests/communicator_tests/test_node_aware_communicator_base.py | Python | mit | 2,933 |
# 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
# distributed under the... | deandunbar/html2bwml | venv/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/x509.py | Python | mit | 5,608 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now_datetime, cint
def set_new_name(doc):
"""Sets the `name`` property for the document based on various rules.
1. ... | sbktechnology/trufil-frappe | frappe/model/naming.py | Python | mit | 5,880 |
from mbuild.lib.surfaces.amorphous_silica import AmorphousSilica
from mbuild.lib.surfaces.betacristobalite import Betacristobalite | ctk3b/mbuild | mbuild/lib/surfaces/__init__.py | Python | mit | 130 |
"""Prepares the views for point scoreboard widget."""
import datetime
from apps.managers.challenge_mgr import challenge_mgr
from apps.managers.player_mgr import player_mgr
from apps.managers.team_mgr import team_mgr
def supply(request, page_name):
"""Supply the view_objects content for this widget, which is all t... | KendyllD/boukenda-project | makahiki/apps/widgets/scoreboard/views.py | Python | mit | 2,747 |
#! /usr/bin/env python
# Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 3085 $
# Date: $Date: 2005-03-22 21:38:43 +0100 (Tue, 22 Mar 2005) $
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils.transforms.components.Filter.
"""
from __init__ imp... | pombreda/django-hotclub | libs/external_libs/docutils-0.4/test/test_transforms/test_filter.py | Python | mit | 962 |
#!/usr/bin/env python
from distutils.core import setup
import os, sys
if 'sdist' in sys.argv:
os.system('./admin/epyrun')
# patch distutils if it can't cope with the "classifiers" or
# "download_url" keywords
if sys.version < '2.2.3':
from distutils.dist import DistributionMetadata
DistributionMetadata.c... | alon/polinax | libs/external_libs/python-yadis-1.1.0/setup.py | Python | gpl-2.0 | 1,649 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ansible, 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
# (at your o... | dav1x/ansible | lib/ansible/modules/windows/win_command.py | Python | gpl-3.0 | 4,255 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def install(company):
docs = [
{'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional T... | elba7r/lite-system | erpnext/setup/doctype/company/fixtures/india/__init__.py | Python | gpl-3.0 | 861 |
#!/usr/bin/env python
# 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.
#
# This program is distributed in the hope that ... | RannyeriDev/Solfege | tools/fix_feta.py | Python | gpl-3.0 | 926 |
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/lib2to3/pgen2/tokenize.py | Python | gpl-3.0 | 21,803 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/xcb-util-cursor/package.py | Python | lgpl-2.1 | 2,067 |
# -*- encoding: utf-8 -*-
# Pilas engine - A video game framework.
#
# Copyright 2010 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
from pilasengine.actores.actor import Actor
class EstrellaNinja(Actor):
""" Representa una estrella ninj... | apehua/pilas | pilasengine/actores/estrella_ninja.py | Python | lgpl-3.0 | 1,023 |
# 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... | HaebinShin/tensorflow | tensorflow/python/kernel_tests/reduction_ops_test.py | Python | apache-2.0 | 31,377 |
# 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... | rabipanda/tensorflow | tensorflow/python/keras/_impl/keras/datasets/fashion_mnist.py | Python | apache-2.0 | 2,033 |
"""Implements the graph generation for computation of gradients."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import warnings
import tensorflow.python.platform
import numpy as np
from six.moves import xrange # pylint: disable=red... | arunhotra/tensorflow | tensorflow/python/ops/gradients.py | Python | apache-2.0 | 24,433 |
"""Tests for the Z-Wave init."""
import asyncio
from collections import OrderedDict
from datetime import datetime
from unittest.mock import MagicMock, patch
import pytest
import voluptuous as vol
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import zwave
from homeassistant.co... | jawilson/home-assistant | tests/components/zwave/test_init.py | Python | apache-2.0 | 62,662 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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... | Hybrid-Cloud/cinder | cinder/tests/unit/test_service.py | Python | apache-2.0 | 23,882 |
#
# Copyright 2006 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... | wiltonlazary/arangodb | 3rdParty/s2geometry/dfefe0c/src/python/pywraps2_test.py | Python | apache-2.0 | 18,635 |
#
# 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... | mtagle/airflow | airflow/contrib/hooks/aws_logs_hook.py | Python | apache-2.0 | 1,139 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | FreescaleSemiconductor/quantum | quantum/plugins/cisco/services/services_logistics.py | Python | apache-2.0 | 4,003 |
# ***** BEGIN LICENSE BLOCK *****
#
# For copyright and licensing please refer to COPYING.
#
# ***** END LICENSE BLOCK *****
from __future__ import nested_scopes
import os
import sys
RABBITMQ_PUBLIC_UMBRELLA = '../../rabbitmq-public-umbrella'
RABBITMQ_CODEGEN = 'rabbitmq-codegen'
PIKA_SPEC = '../pika/spec.py'
CODEG... | vrtsystems/pika | utils/codegen.py | Python | bsd-3-clause | 14,858 |
import operator
import re
import xapian
from django.db import models
from django.utils.functional import curry
class X(models.Q):
pass
i = lambda f: lambda a, b: f(a.lower(), b.lower())
startswith = lambda a, b: a.startswith(b)
endswith = lambda a, b: a.endswith(b)
regex = lambda a, b: re.match(b, a) is not No... | pombreda/djapian | src/djapian/decider.py | Python | bsd-3-clause | 2,849 |
# encoding: utf-8
"""
coroutine.py
Created by Thomas Mangin on 2013-07-01.
Copyright (c) 2009-2012 Exa Networks. All rights reserved.
"""
from functools import wraps
def each(function):
@wraps(function)
def start(*args, **kwargs):
generator = function(*args, **kwargs)
return lambda: generator.next()
return st... | mshahbaz/exabgp | lib/exabgp/util/coroutine.py | Python | bsd-3-clause | 452 |
import functools
from django.shortcuts import redirect
def submit_step(outer_step):
"""Wraps the function with a decorator that bounces to the right step."""
def decorator(f):
@functools.wraps(f)
def wrapper(request, *args, **kw):
from mkt.submit.views import _resume
f... | wagnerand/zamboni | mkt/submit/decorators.py | Python | bsd-3-clause | 1,263 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
def get_notification_config():
return {
"for_doctype": {
"Error Log": {"seen": 0},
"Communication": {"status": "Open", "communication_type": "Communication... | bcornwellmott/frappe | frappe/core/notifications.py | Python | mit | 2,601 |
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, HttpResponseRedirect, redirect
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
# Create your views here.
from billing.mo... | climberwb/video-api | src/accounts/views.py | Python | mit | 2,552 |
from math import sqrt
from ase import Atom, Atoms
from ase.neb import NEB
from ase.constraints import FixAtoms
from ase.vibrations import Vibrations
from ase.visualize import view
from ase.calculators.emt import EMT
from ase.optimize import QuasiNewton, BFGS
# Distance between Cu atoms on a (100) surface:
d = 3.6 / sq... | grhawk/ASE | tools/ase/test/Ag-Cu100.py | Python | gpl-2.0 | 1,654 |
import operator
import re
from distutils.version import LooseVersion # pylint: disable=no-name-in-module,import-error
class VersionInterval(object):
"""
A class for a Version Interval object.
An interval is a string representation of a mathmetical like interval.
e.g: "(3,4]", "[3.10.0,)"
A veris... | clebergnu/avocado-vt | virttest/utils_version.py | Python | gpl-2.0 | 2,256 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 - Wolter Hellmund <wolterh6@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 lat... | jakubbrindza/gtg | GTG/plugins/urgency_color/__init__.py | Python | gpl-3.0 | 884 |
# -*- 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 ... | cjahangir/geodash | geonode/security/views.py | Python | gpl-3.0 | 4,620 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Angus Gratton <gus@projectgus.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 2 of the ... | sigrokproject/libsigrokdecode | decoders/swd/pd.py | Python | gpl-3.0 | 12,080 |
#!/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
#
#
from gnuradio import gr, gr_unittest, blocks
import pmt
import numpy
import time
# Simple block to generate messages
class message_generator(gr.sync_block):
... | dl1ksv/gnuradio | gr-blocks/python/blocks/qa_python_message_passing.py | Python | gpl-3.0 | 3,246 |
try:
import unittest2 as unittest
except:
import unittest
from Orange.testing import testing
from Orange.regression import pls
@testing.datasets_driven(datasets=testing.REGRESSION_DATASETS)
class TestPLS(testing.LearnerTestCase):
LEARNER = pls.PLSRegressionLearner
# TODO: Test the PLS by passing x_var... | qPCR4vir/orange | Orange/testing/unit/tests/test_pls.py | Python | gpl-3.0 | 330 |
# Generated by Django 1.11.20 on 2019-06-05 13:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | edx/edx-platform | lms/djangoapps/grades/migrations/0015_historicalpersistentsubsectiongradeoverride.py | Python | agpl-3.0 | 2,222 |
import copy
from datetime import datetime
from fs.errors import ResourceNotFoundError
import logging
from lxml import etree
import os
from path import Path as path
from pkg_resources import resource_string
import re
import sys
import textwrap
import dogstats_wrapper as dog_stats_api
from xmodule.util.misc import escap... | TheMOOCAgency/edx-platform | common/lib/xmodule/xmodule/html_module.py | Python | agpl-3.0 | 17,460 |
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | mirrorcoder/paramiko | paramiko/ecdsakey.py | Python | lgpl-2.1 | 10,385 |
# This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... | camptocamp/mapproxy | mapproxy/cache/couchdb.py | Python | apache-2.0 | 10,510 |
# Copyright 2014 IBM Corp.
#
# 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 t... | silenceli/nova | nova/tests/functional/v3/test_cloudpipe.py | Python | apache-2.0 | 3,032 |
# Copyright 2019 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... | tensorflow/tensorflow | tensorflow/python/kernel_tests/nn_ops/cudnn_deterministic_base.py | Python | apache-2.0 | 7,357 |
"""Tests for AVM Fritz!Box config flow."""
from unittest import mock
from pyfritzhome import LoginError
import pytest
from requests.exceptions import HTTPError
from homeassistant.components.fritzbox.const import DOMAIN
from homeassistant.components.ssdp import (
ATTR_SSDP_LOCATION,
ATTR_UPNP_FRIENDLY_NAME,
... | tboyce021/home-assistant | tests/components/fritzbox/test_config_flow.py | Python | apache-2.0 | 9,231 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'cssauto.py',
]
PACKAGE = {
'title': 'cssauto',
'desc': 'CSS autoloading',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate example, MUST c... | Hasimir/pyjs | examples/cssauto/__main__.py | Python | apache-2.0 | 1,045 |
from __future__ import division, print_function, absolute_import
import os
import sys
import subprocess
from .utils.six.moves import configparser
COMMIT_INFO_FNAME = 'COMMIT_INFO.txt'
def pkg_commit_hash(pkg_path):
''' Get short form of commit hash given directory `pkg_path`
There should be a file called '... | mdesco/dipy | dipy/pkg_info.py | Python | bsd-3-clause | 2,859 |
from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.test import TestCase, ignore_warnings, skipUnlessDBFeature
from django.utils._os import upath
from django.utils.deprecation ... | h4r5h1t/django-hauthy | tests/gis_tests/geo3d/tests.py | Python | bsd-3-clause | 12,627 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Mapper to compute distance matrix
Date: 2012.05.29
"""
__docformat__ = 'restructuredtext'
import numpy as np
import scipy.sparse as sp
from mvpa2.base import warning
from mvpa2.base.d... | sealhuang/FreeROI | froi/algorithm/unused/featuredistancemapper.py | Python | bsd-3-clause | 1,951 |
from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... | rebost/django | django/core/management/commands/flush.py | Python | bsd-3-clause | 3,988 |
# 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 collections
import logging
import os
import plistlib
import shutil
import tempfile
import xml.parsers.expat
from telemetry.core import os_version
fro... | sahiljain/catapult | telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py | Python | bsd-3-clause | 12,065 |
import os
import sys
import traceback
import urllib
import urllib2
import base64
import json
import requests
import subprocess
#set Jenkins build description using submitDescription to mock browser behavior
http_proxy = ''
if('HTTP_PROXY' in os.environ):
http_proxy = os.environ['HTTP_PROXY']
proxyDict = {'http': h... | dios-game/dios-cocos | src/oslibs/cocos/cocos-src/tools/jenkins-scripts/pull-request-builder.py | Python | mit | 4,685 |
from functools import partial
import logging
from six import iteritems
from bravado_core.docstring import docstring_property
from bravado_core.schema import SWAGGER_PRIMITIVES
log = logging.getLogger(__name__)
# Models in #/definitions are tagged with this key so that they can be
# differentiated from 'object' typ... | MphasisWyde/eWamSublimeAdaptor | src/third-party/bravado_core/model.py | Python | mit | 8,303 |
"""
Neighbours was moved into theano.tensor.nnet.neighbours.
This file was created for compatibility.
"""
from theano.tensor.nnet.neighbours import (images2neibs, neibs2images,
Images2Neibs)
__all__ = ["images2neibs", "neibs2images", "Images2Neibs"]
| valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/sandbox/neighbours.py | Python | gpl-2.0 | 294 |
# Volatility
# Copyright (C) 2007,2008 Volatile Systems
#
# Volatools Basic
# Copyright (C) 2007 Komoku, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, o... | backupManager/pyflag | src/plugins_old/MemoryForensics/Volatility-1.3_Linux_rc.1/forensics/win32/tasks.py | Python | gpl-2.0 | 12,448 |
"idlelib.filelist"
import os
from tkinter import messagebox as tkMessageBox
class FileList:
# N.B. this import overridden in PyShellFileList.
from idlelib.editor import EditorWindow
def __init__(self, root):
self.root = root
self.dict = {}
self.inversedict = {}
self.vars... | FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/idlelib/filelist.py | Python | gpl-2.0 | 3,896 |
#!/usr/bin/env python
import sys
import os
import re
import urlparse
def usage():
message = """ usage: {program} inDir outDir
inDir: directory containing .ht files
outDir: target for the new files"""
print(message.format(program = os.path.basename(sys.argv[0])))
def parseFile(filename):
file = open(filena... | jvanz/core | bin/extract-tooltip.py | Python | gpl-3.0 | 3,242 |
# Copyright (c) 2014 Cisco Systems
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | subramani95/neutron | neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py | Python | apache-2.0 | 5,358 |
"""Support for retrieving status info from Google Wifi/OnHub routers."""
import logging
from datetime import timedelta
import voluptuous as vol
import requests
from homeassistant.util import dt
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeas... | MartinHjelmare/home-assistant | homeassistant/components/google_wifi/sensor.py | Python | apache-2.0 | 6,588 |
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from rest_framework import exceptions
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
)
@pytest.fixture()
def admin_contributor():
return AuthUserFactory()
@pytest.fixture()
def write_c... | erinspace/osf.io | api_tests/nodes/views/test_node_citations.py | Python | apache-2.0 | 4,342 |
# -*- coding: utf-8 -*-
import unittest
import re
from rdflib import ConjunctiveGraph, URIRef, Literal
from rdflib.util import from_n3
HOST = 'http://localhost:3031'
DB = '/db/'
# this assumes SPARQL1.1 query/update endpoints running locally at
# http://localhost:3031/db/
#
# The ConjunctiveGraph tests below require... | armandobs14/rdflib | test/test_sparqlupdatestore.py | Python | bsd-3-clause | 11,424 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# This is an auto-generated file. Do not edit it.
"""
Provides Twisted version information.
"""
from twisted.python import versions
version = versions.Version('twisted.news', 15, 2, 1)
| bdh1011/wau | venv/lib/python2.7/site-packages/twisted/news/_version.py | Python | mit | 260 |
"""MiniAEFrame - A minimal AppleEvent Application framework.
There are two classes:
AEServer -- a mixin class offering nice AE handling.
MiniApplication -- a very minimal alternative to FrameWork.py,
only suitable for the simplest of AppleEvent servers.
"""
import sys
import traceback
import MacOS
fro... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/MiniAEFrame.py | Python | gpl-2.0 | 6,454 |
#!/usr/bin/env python
# encoding: utf-8
#
# This file is part of BeRTOS.
#
# Bertos is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
#... | dereks/bertos | wizard/exception_handler.py | Python | gpl-2.0 | 2,479 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | Hellowlol/PyTunes | libs/guessit/transfo/guess_release_group.py | Python | gpl-3.0 | 6,537 |
#!/usr/bin/env python
# DExTer : Debugging Experience Tester
# ~~~~~~ ~ ~~ ~ ~~
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""DExTer entry poin... | google/llvm-propeller | debuginfo-tests/dexter/dexter.py | Python | apache-2.0 | 653 |
from UnitTest import UnitTest
from random import randrange, shuffle
class PassThru(Exception):
pass
def check_pass_thru():
raise PassThru
yield 1
class BadCmp:
def __hash__(self):
return 1
def __cmp__(self, other):
raise RuntimeError
class ReprWrapper:
'Used to test self... | Hasimir/pyjs | examples/libtest/SetTest.py | Python | apache-2.0 | 54,895 |
"""one spout bolt multi tasks integration test topology"""
__all__ = ['one_spout_bolt_multi_tasks']
from .one_spout_bolt_multi_tasks import one_spout_bolt_multi_tasks_builder
| objmagic/heron | integration-test/src/python/integration_test/topology/one_spout_bolt_multi_tasks/__init__.py | Python | apache-2.0 | 176 |
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import Prefetch, QuerySet
from django.db.models.query import get_prefetcher
from django.test import TestCase, override_settings
from django.test.utils i... | tomchristie/django | tests/prefetch_related/tests.py | Python | bsd-3-clause | 62,680 |
# 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... | jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/tensorflow/contrib/linalg/python/ops/linear_operator_matrix.py | Python | mit | 6,593 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth import get_user_model
from django.conf import settings
from ...topic.models import Topic
from ...category.models import Category
from ...comment.models import Comment
from ...topic.private.models import TopicPrivate
User = get_... | ramaseshan/Spirit | spirit/core/tests/utils.py | Python | mit | 2,284 |
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | terryyin/linkchecker | third_party/dnspython/dns/set.py | Python | gpl-2.0 | 7,899 |
import json
import unittest
from app import current_app as app
from test_post_api_auth import PostApiAuthTestCase
from tests.unittests.api.utils import create_event, get_path
from tests.unittests.auth_helper import register
from tests.unittests.setup_database import Setup
from tests.unittests.utils import OpenEventTes... | Achint08/open-event-orga-server | tests/unittests/api/test_post_api_permissions.py | Python | gpl-3.0 | 1,382 |
#!/usr/bin/env python3
# Copyright (C) 2018 Freie Universitat Berlin
# Copyright (C) 2018 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
# @author Koen Zandberg <koen@bergzand.net>
impo... | mtausig/RIOT | dist/tools/backport_pr/backport_pr.py | Python | lgpl-2.1 | 9,797 |
# Natural Language Toolkit: Finite State Automata
#
# Copyright (C) 2001-2006 University of Pennsylvania
# Authors: Steven Bird <sb@ldc.upenn.edu>
# Rob Speer <rspeer@mit.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
"""
A module for finite state automata.
Operations are based o... | hectormartinez/rougexstem | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/fsa.py | Python | apache-2.0 | 19,337 |
import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(3, java_heap_GB=4)
@classmethod
def tearDownClas... | vbelakov/h2o | py/testdir_multi_jvm/test_rf_hhp_2_fvec.py | Python | apache-2.0 | 723 |
##########################################################################
#
# Copyright (c) 2008-2011, Image Engine Design 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:
#
# * Redis... | code-google-com/cortex-vfx | test/IECoreMaya/ParameterisedHolder.py | Python | bsd-3-clause | 67,200 |
from __future__ import absolute_import, print_function
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.models import ProjectKey, ProjectKeyStatus
from sentry.testutils import TestCase
class EnableProjectKeyTest(TestCase):
def setUp(self):
super(EnableProjectKeyTest, sel... | alexm92/sentry | tests/sentry/web/frontend/test_enable_project_key.py | Python | bsd-3-clause | 977 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class StudentBatchCreationTool(Document):
def make_batch(self):
if self.aca... | hassanibi/erpnext | erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py | Python | gpl-3.0 | 994 |
from __future__ import unicode_literals
try:
from unittest import skipIf
except ImportError:
from django.utils.unittest.case import skipIf
import django
from django.test import TestCase
from django.test.utils import override_settings
from django.core.exceptions import ValidationError
from django.utils import ... | jensadne/django-oauth-toolkit | oauth2_provider/tests/test_models.py | Python | bsd-2-clause | 4,920 |
"""
A dialog widget for selecting an item.
"""
from PyQt4.QtGui import QDialog, QWidget, QVBoxLayout, QDialogButtonBox, \
QStringListModel, QLabel, QSizePolicy
from PyQt4.QtCore import Qt
from PyQt4.QtCore import pyqtSignal as Signal
from . import previewbrowser
class PreviewDialog(QDialog)... | marinkaz/orange3 | Orange/canvas/preview/previewdialog.py | Python | bsd-2-clause | 3,701 |
CONSTANT1 = 10
CONSTANT2 = 20 | siddhika1889/Pydev-Editor | tests/pysrc/extendable/constants/__init__.py | Python | epl-1.0 | 29 |
import os
import re
import subprocess
from .. import vcs
from ..vcs import bind_to_repo, git, hg
def get_unique_name(existing, initial):
"""Get a name either equal to initial or of the form initial_N, for some
integer N, that is not in the set existing.
:param existing: Set of names that must not be ch... | anthgur/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/update/tree.py | Python | mpl-2.0 | 10,874 |
# coding=utf-8
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.translation import ugettext_lazy as _
from pybb import defaults, util
from pybb.compat import get_image_field_class, get_username_field
TZ_CHOICES = [(float(x[0]), x[1... | just-work/pybbm | pybb/profiles.py | Python | bsd-2-clause | 3,029 |
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal
def fft1(x):
L = len(x)
phase = -2j*np.pi*(np.arange(L)/float(L))
phase = np.arange(L).reshape(-1, 1) * phase
return np.sum(x*np.exp(phase... | AdaptiveApplications/carnegie | tarc_bus_locator_client/numpy-1.8.1/numpy/fft/tests/test_fftpack.py | Python | mit | 686 |
# -*- coding: utf-8 -*-
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.exceptions import ValidationError
from odoo.tests import tagged
import time
@tagged('post_install', '-at_install')
class TestAccountInvoiceRounding(AccountingTestCase):
def setUp(self):
super... | t3dev/odoo | addons/account/tests/test_account_invoice_rounding.py | Python | gpl-3.0 | 4,432 |
# 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 ... | harshilasu/LinkurApp | y/google-cloud-sdk/lib/oauth2client/keyring_storage.py | Python | gpl-3.0 | 3,220 |
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Contact")
frappe.db.sql("""update tabContact, tabUser set tabContact.user = tabUser.name
where tabContact.email_id = tabUser.email""")
| ovresko/erpnext | erpnext/patches/v6_4/set_user_in_contact.py | Python | gpl-3.0 | 232 |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 2 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import re
import urllib
from con... | jeanlinux/calibre | src/calibre/gui2/store/stores/ebooks_com_plugin.py | Python | gpl-3.0 | 3,922 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import flt
from erpnext.accounts.doctype.journal_entry.test_journal_entry import make_journal_entry
cl... | meisterkleister/erpnext | erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py | Python | agpl-3.0 | 1,929 |
# -*- 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
# License,... | zenodo/invenio | invenio/modules/formatter/format_elements/bfe_video_sources.py | Python | gpl-2.0 | 2,331 |
class SamplePlugin(object):
def __init__(self):
self.__count = 10
| punalpatel/st2 | st2common/tests/resources/loadableplugin/plugin/sampleplugin3.py | Python | apache-2.0 | 78 |
#
# 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
# ... | dragorosson/heat | heat/tests/test_stack_user.py | Python | apache-2.0 | 16,620 |
class Base:
def m(self, x):
pass
class Sub(Base):
def m<warning descr="Signature of method 'Sub.m()' does not match signature of base method in class 'Base'">(<caret>self)</warning>:
pass | goodwinnk/intellij-community | python/testData/inspections/AddKwargsToIncompatibleOverridingMethod.py | Python | apache-2.0 | 221 |
from .vartypes import *
from .model import *
from .theanof import *
from .blocking import *
import numpy as np
| superbobry/pymc3 | pymc3/core.py | Python | apache-2.0 | 111 |
from ..broker import Broker
class IfTrunkBroker(Broker):
controller = "if_trunks"
def show(self, **kwargs):
"""Shows the details for the specified if trunk.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:`` True
... | infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_8_0/if_trunk_broker.py | Python | apache-2.0 | 50,853 |