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 |
|---|---|---|---|---|---|
#!/usr/bin/env python3
#
# Copyright 2013 The Flutter 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 argparse
import zipfile
import os
import sys
def _zip_dir(path, zip_file, prefix):
path = path.rstrip('/\\')
for root, d... | jamesr/sky_engine | build/zip.py | Python | bsd-3-clause | 1,167 |
from __future__ import absolute_import
import errno
import os
import sys
import signal
from celery import _find_option_with_arg
from celery import platforms
from celery.five import open_fqdn
from celery.platforms import (
get_fdmax,
ignore_errno,
set_process_title,
signals,
maybe_drop_privileges,
... | sunze/py_flask | venv/lib/python3.4/site-packages/celery/tests/utils/test_platforms.py | Python | mit | 23,623 |
from functools import partial
from time import sleep
from mock import call, Mock
from scrapy.crawler import Crawler
from scrapy.http import Request
from scrapy import log, signals
from scrapy.settings import Settings
from scrapy.spider import BaseSpider
from scrapy.xlib.pydispatch import dispatcher
from twisted.intern... | yupengyan/scrapy-webdriver | scrapy_webdriver/tests/test_request_queue.py | Python | mit | 3,272 |
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2008, Frank Scholz <coherence@beebits.net>
""" simple and hopefully reusable widgets to ease
the creation of UPnP UI applications
icons taken from the Tango Desktop Project
"""
import os.path
import urllib
import ... | sreichholf/python-coherence | coherence/ui/av_widgets.py | Python | mit | 32,894 |
# Module tests
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import time
import hostapd
def test_module_wpa_supplicant(dev, apdev, params):
"""wpa_supplicant module tests"""
if "OK" not in dev[0]... | s0lst1c3/eaphammer | local/hostapd-eaphammer/tests/hwsim/test_module_tests.py | Python | gpl-3.0 | 889 |
'''
Created on Jun 11, 2011
@author: mkiyer
'''
class Breakpoint(object):
def __init__(self):
self.name = None
self.seq5p = None
self.seq3p = None
self.chimera_names = []
@property
def pos(self):
"""
return position of break along sequence measured fr... | madhavsuresh/chimerascan | chimerascan/deprecated/breakpoint.py | Python | gpl-3.0 | 751 |
#!/usr/bin/python
#
# Copyright (c) 2017 Bruno Medina Bolanos Cacho <bruno.medina@microsoft.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':... | EvanK/ansible | lib/ansible/modules/cloud/azure/azure_rm_managed_disk.py | Python | gpl-3.0 | 14,499 |
#!/usr/bin/python
# James Laska (jlaska@redhat.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',
'status': ['prev... | bregman-arie/ansible | lib/ansible/modules/packaging/os/redhat_subscription.py | Python | gpl-3.0 | 28,269 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import six
from django.utils.transl... | lawzou/shoop | shoop/admin/modules/methods/views/edit_detail.py | Python | agpl-3.0 | 1,471 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Amrvis(MakefilePackage):
"""Amrvis is a visualization package specifically designed to
read and display ... | LLNL/spack | var/spack/repos/builtin/packages/amrvis/package.py | Python | lgpl-2.1 | 6,541 |
import re
from .common import InfoExtractor
class TrailerAddictIE(InfoExtractor):
_VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/(?:trailer|clip)/(?P<movie>.+?)/(?P<trailer_name>.+)'
_TEST = {
u'url': u'http://www.traileraddict.com/trailer/prince-avalanche/trailer',
u'file': u'76184.... | ashutosh-mishra/youtube-dl | youtube_dl/extractor/traileraddict.py | Python | unlicense | 2,278 |
# PyKinect
# Copyright(c) Microsoft Corporation
# 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
#
# THIS CODE IS PROVIDED ON ... | DinoV/PTVS | Python/Product/PyKinect/PyKinect/winspeech/recognition.py | Python | apache-2.0 | 8,335 |
# 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... | Mirantis/mos-horizon | openstack_dashboard/test/integration_tests/pages/project/compute/volumes/volumesnapshotspage.py | Python | apache-2.0 | 5,448 |
#
# 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... | mxm/incubator-beam | sdks/python/apache_beam/examples/wordcount_debugging.py | Python | apache-2.0 | 6,652 |
# Copyright 2018 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/distribute/one_device_strategy.py | Python | apache-2.0 | 18,606 |
# 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... | tensorflow/tensorflow | tensorflow/python/profiler/pprof_profiler_test.py | Python | apache-2.0 | 5,145 |
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# This library 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... | mytliulei/DCNRobotInstallPackages | windows/win32/pygal-1.7.0/pygal/graph/horizontal.py | Python | apache-2.0 | 1,780 |
import random
from tests.checks.common import AgentCheckTest, load_check
from utils.containers import hash_mutable
MOCK_CONFIG = {
'init_config': {},
'instances' : [{
'url': 'http://localhost:8500',
'catalog_checks': True,
}]
}
MOCK_CONFIG_SERVICE_WHITELIST = {
'init_config': {},
... | Wattpad/dd-agent | tests/checks/mock/test_consul.py | Python | bsd-3-clause | 21,895 |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core import management
from django.test import TestCase
from django.utils.six import StringIO
from .models import (
Car, CarDriver, Driver, Group, Membership, Person, UserMembership,
)
class M2MThroughTestCase(TestCa... | frishberg/django | tests/m2m_through_regress/tests.py | Python | bsd-3-clause | 10,478 |
'''"Executable documentation" for the pickle module.
Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here. Some functions meant for external use:
genops(pickle)
Generate all the opcodes in a pickle, as (opcode, arg, position) triples.
dis(pickle, out=None, memo=None, indentl... | yotchang4s/cafebabepy | src/main/python/pickletools.py | Python | bsd-3-clause | 91,809 |
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
def test_basic():
s = pd.Series([[0, 1, 2], np.nan, [], (3, 4)], index=list("abcd"), name="foo")
result = s.explode()
expected = pd.Series(
[0, 1, 2, np.nan, np.nan, 3, 4], index=list("aaabcdd"), dtype=object, name=... | dsm054/pandas | pandas/tests/series/methods/test_explode.py | Python | bsd-3-clause | 4,090 |
# $Id$
# importing this module shouldn't directly cause other large imports
# do large imports in the init() hook so that you can call back to the
# ModuleManager progress handler methods.
"""vtk_kit package driver file.
This performs all initialisation necessary to use VTK from DeVIDE. Makes
sure that all VTK clas... | nagyistoce/devide | module_kits/vtk_kit/__init__.py | Python | bsd-3-clause | 3,965 |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | davideuler/foursquared | util/gen_parser.py | Python | apache-2.0 | 4,392 |
"""
WSGI config for made_with_twd_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_... | leifos/tango_with_django | made_with_twd_project/made_with_twd_project/wsgi.py | Python | mit | 1,464 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
# All Rights Reserved
###############Credits##########################... | 3dfxsoftware/cbss-addons | report_move_voucher/report/__init__.py | Python | gpl-2.0 | 1,449 |
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2018 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Support for a Chromium OS Google Binary Block, used to record read-only
# information mostly used by firmware.
from collections import OrderedDict
from patman import command
from binman.entry import E... | Digilent/u-boot-digilent | tools/binman/etype/gbb.py | Python | gpl-2.0 | 3,381 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 3 of the Lic... | kustodian/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ipsec_phase1.py | Python | gpl-3.0 | 49,802 |
# (C) British Crown Copyright 2015 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | QuLogic/iris | lib/iris/tests/unit/analysis/cartography/test_rotate_winds.py | Python | gpl-3.0 | 20,624 |
# -*- coding: utf-8 -*-
import math
EARTH_RADIUS = 6367009
METERS_PER_DEGREE = 111319.0
FEET_PER_METER = 3.2808399
def geographic_distance(loc1, loc2):
"""
Calculate the great circle distance between two points
on the earth (specified in decimal degrees)
"""
# convert decimal degrees to radians
... | kerel-fs/skylines | skylines/lib/geo.py | Python | agpl-3.0 | 737 |
"""Support for Roku API emulation."""
import voluptuous as vol
from homeassistant import config_entries, util
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from .binding import EmulatedRoku
from .config_flow import configured_servers
from .const import (
CONF_ADVER... | jabesq/home-assistant | homeassistant/components/emulated_roku/__init__.py | Python | apache-2.0 | 2,359 |
import time
import pytest
import logging
from repair_tests.repair_test import BaseRepairTest
since = pytest.mark.since
logger = logging.getLogger(__name__)
LEGACY_SSTABLES_JVM_ARGS = ["-Dcassandra.streamdes.initial_mem_buffer_size=1",
"-Dcassandra.streamdes.max_mem_buffer_size=5",
... | aweisberg/cassandra-dtest | upgrade_tests/repair_test.py | Python | apache-2.0 | 1,656 |
# Copyright (c) 2011 Citrix Systems, 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 ... | tylertian/Openstack | openstack F/nova/nova/volume/xensm.py | Python | apache-2.0 | 9,841 |
"""Support for Hydrawise cloud switches."""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
from . import (
ALLOWED_WATERING_TIME, CONF_... | MartinHjelmare/home-assistant | homeassistant/components/hydrawise/switch.py | Python | apache-2.0 | 3,451 |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Index for object_folders
Revision ID: 1efacad0fff5
Revises: 4d7ce1eaddf2
Create Date: 2014-09-12 21:11:35.908034
"""
# revision identifiers, used by Alembic.
revision = '1efacad0fff5'
down_revision = ... | NejcZupec/ggrc-core | src/ggrc_gdrive_integration/migrations/versions/20140912211135_1efacad0fff5_index_for_object_folders.py | Python | apache-2.0 | 609 |
"""Base test class for nbconvert"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import glob
import shlex
import shutil
import sys
import unittest
import nbconvert
from subprocess import Popen, PIPE
import nose.tools as nt
from nbformat imp... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/nbconvert/tests/base.py | Python | bsd-2-clause | 5,773 |
from sqlalchemy import *
from sqlalchemy.test import *
class FoundRowsTest(TestBase, AssertsExecutionResults):
"""tests rowcount functionality"""
__requires__ = ('sane_rowcount', )
@classmethod
def setup_class(cls):
global employees_table, metadata
metadata = MetaData(testing... | dbbhattacharya/kitsune | vendor/packages/sqlalchemy/test/sql/test_rowcount.py | Python | bsd-3-clause | 2,268 |
from datetime import datetime
from decimal import Decimal
from django.contrib.sites.models import Site
from django.db import models
from django.utils.translation import ugettext_lazy as _
from l10n.utils import moneyfmt
from payment.modules.giftcertificate.utils import generate_certificate_code
from payment.utils impor... | russellmayhew/satchmo | satchmo/apps/payment/modules/giftcertificate/models.py | Python | bsd-3-clause | 6,200 |
##########################################################################
#
# Copyright (c) 2009-2013, 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... | lento/cortex | test/IECoreRI/ParameterisedProcedural.py | Python | bsd-3-clause | 4,780 |
import dask.dataframe as dd
import pandas.util.testing as tm
import pandas as pd
from dask.dataframe.shuffle import shuffle
import partd
from dask.async import get_sync
dsk = {('x', 0): pd.DataFrame({'a': [1, 2, 3], 'b': [1, 4, 7]},
index=[0, 1, 3]),
('x', 1): pd.DataFrame({'a': [4... | vikhyat/dask | dask/dataframe/tests/test_shuffle.py | Python | bsd-3-clause | 1,642 |
import argparse
import os
import subprocess
import mongoengine as me
import rmc.html_snapshots.utils as utils
import rmc.shared.constants as c
def crawl_page(url):
args = [
'phantomjs',
'--disk-cache=true',
os.path.join(utils.FILE_DIR, 'phantom-server.js'),
url,
]
rendere... | JGulbronson/rmc | html_snapshots/snapshot.py | Python | mit | 1,734 |
#!/usr/bin/env python3.4
# -*- coding: utf-8 -*-
| welblade/pyrom | test/__init__.py | Python | mit | 49 |
from sympy import symbols, Symbol, exp, log, pi, Rational, S
from sympy.codegen.cfunctions import (
expm1, log1p, exp2, log2, fma, log10, Sqrt, Cbrt, hypot
)
from sympy.core.function import expand_log
def test_expm1():
# Eval
assert expm1(0) == 0
x = Symbol('x', real=True, finite=True)
# Expand ... | wxgeo/geophar | wxgeometrie/sympy/codegen/tests/test_cfunctions.py | Python | gpl-2.0 | 4,553 |
# https://djangosnippets.org/snippets/2566/
from django import template
from django.template import resolve_variable, NodeList
from django.contrib.auth.models import Group
register = template.Library()
@register.tag()
def ifusergroup(parser, token):
""" Check to see if the currently logged in user belongs to a ... | mupi/tecsaladeaula | core/templatetags/usergroup.py | Python | agpl-3.0 | 1,920 |
from machinekit import hal
from machinekit import rtapi as rt
from machinekit import config as c
from fdm.config import base
def hardware_read():
hal.addf('hpg.capture-position', 'servo-thread')
hal.addf('bb_gpio.read', 'servo-thread')
def hardware_write():
hal.addf('hpg.update', 'servo-thread')
ha... | strahlex/machinekit | configs/ARM/BeagleBone/MendelMax-CRAMPS/cramps.py | Python | lgpl-2.1 | 5,005 |
"""
Copyright 2009 55 Minutes (http://www.55minutes.com)
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... | UT-Austin-FIS/django-coverage | django_coverage/utils/coverage_report/templates/default_module_exceptions.py | Python | apache-2.0 | 2,058 |
import sublime
import collections
VAR_MAP_LEADER = 'mapleader'
VAR_MAP_LOCAL_LEADER = 'maplocalleader'
# well-known variables
_SPECIAL_STRINGS = {
'<leader>': VAR_MAP_LEADER,
'<localleader>': VAR_MAP_LOCAL_LEADER,
}
_DEFAULTS = {
VAR_MAP_LEADER: '\\',
VAR_MAP_LOCAL_LEADER: '\\'
}
_VARIABLES = {... | zhangtuoparis13/Vintageous | vi/variables.py | Python | mit | 1,741 |
# -*- 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... | Johnzero/erp | openerp/addons/account/wizard/account_reconcile.py | Python | agpl-3.0 | 8,252 |
"""Provides the constants needed for component."""
from typing import Final
SUPPORT_ALARM_ARM_HOME: Final = 1
SUPPORT_ALARM_ARM_AWAY: Final = 2
SUPPORT_ALARM_ARM_NIGHT: Final = 4
SUPPORT_ALARM_TRIGGER: Final = 8
SUPPORT_ALARM_ARM_CUSTOM_BYPASS: Final = 16
SUPPORT_ALARM_ARM_VACATION: Final = 32
CONDITION_TRIGGERED: F... | jawilson/home-assistant | homeassistant/components/alarm_control_panel/const.py | Python | apache-2.0 | 642 |
#!/usr/bin/python -u
# Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | kun--hust/sccloud | test/probe/test_object_failures.py | Python | apache-2.0 | 7,804 |
# -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# License: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | potash/scikit-learn | sklearn/gaussian_process/gaussian_process.py | Python | bsd-3-clause | 35,041 |
# Copyright 2015 gRPC 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 agreed to in writing... | endlessm/chromium-browser | third_party/grpc/src/src/python/grpcio_tests/tests/protoc_plugin/beta_python_plugin_test.py | Python | bsd-3-clause | 26,919 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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... | maartenq/ansible | lib/ansible/modules/cloud/vmware/vmware_host_firewall_manager.py | Python | gpl-3.0 | 8,047 |
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from common import *
from terrain.steps import reload_the_page
from selenium.common.exceptions import (
InvalidElementStateException, WebDriverException)
from nose.tools import assert_in, assert_not_in, assert_equal, assert_not_equal ... | hkawasaki/kawasaki-aio8-1 | cms/djangoapps/contentstore/features/grading.py | Python | agpl-3.0 | 7,108 |
# 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... | jbedorf/tensorflow | tensorflow/python/kernel_tests/where_op_test.py | Python | apache-2.0 | 8,003 |
import sys, imp
from . import model, ffiplatform
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._struct_pending_verification = {}
self._types_of_builtin_functions ... | ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/cffi/vengine_cpy.py | Python | apache-2.0 | 41,164 |
"""
This module converts requested URLs to callback view functions.
RegexURLResolver is the main class here. Its resolve() method takes a URL (as
a string) and returns a ResolverMatch object which provides access to all
attributes of the resolved URL match.
"""
from __future__ import unicode_literals
import functools... | bobcyw/django | django/core/urlresolvers.py | Python | bsd-3-clause | 26,463 |
# The MIT License
#
# Copyright (c) 2008 William T. Katz
#
# 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,... | unixboy/stashboard | stashboard/handlers/api.py | Python | mit | 20,209 |
"""Precompute the polynomials for the asymptotic expansion of the
generalized exponential integral.
Sources
-------
[1] NIST, Digital Library of Mathematical Functions,
http://dlmf.nist.gov/8.20#ii
"""
from __future__ import division, print_function, absolute_import
import os
import warnings
try:
# Can remo... | asnorkin/sentiment_analysis | site/lib/python2.7/site-packages/scipy/special/_precompute/expn_asy.py | Python | mit | 1,585 |
# -*- coding: utf-8 -*-
'''
test_qgscomposerlabel.py
--------------------------------------
Date : Oct 2012
Copyright : (C) 2012 by Dr. Hugo Mercier
email : hugo dot mercier at oslandia dot com
*****************... | herow/planning_qgis | tests/src/python/test_qgscomposerlabel.py | Python | gpl-2.0 | 4,750 |
from __future__ import print_function
import lammps
import ctypes
import traceback
import numpy as np
class LAMMPSFix(object):
def __init__(self, ptr, group_name="all"):
self.lmp = lammps.lammps(ptr=ptr)
self.group_name = group_name
class LAMMPSFixMove(LAMMPSFix):
def __init__(self, ptr, group... | quang-ha/lammps | examples/python/py_nve.py | Python | gpl-2.0 | 3,986 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Isaku Yamahata <yamahata at private email ne jp>
# 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
#... | Juniper/neutron | neutron/plugins/ryu/db/api_v2.py | Python | apache-2.0 | 8,246 |
# mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 0.8.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts... | mozilla/popcorn_maker | vendor-local/lib/python/mock.py | Python | bsd-3-clause | 73,348 |
#!/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
#... | kaarolch/ansible | lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py | Python | gpl-3.0 | 7,687 |
# 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 ... | ychen820/microblog | y/google-cloud-sdk/platform/gsutil/third_party/oauth2client/oauth2client/tools.py | Python | bsd-3-clause | 8,468 |
import os
from chainer import serializers
from chainer import utils
def save_and_load(src, dst, filename, saver, loader):
"""Saves ``src`` and loads it to ``dst`` using a de/serializer.
This function simply runs a serialization and deserialization to check if
the serialization code is correctly implemen... | rezoo/chainer | chainer/testing/serializer.py | Python | mit | 1,562 |
import urllib
def basic_authentication(username=None, password=None, protocol="http"):
from .fixtures import server_config, url
build_url = url(server_config())
query = {}
return build_url("/webdriver/tests/support/authentication.py",
query=urllib.urlencode(query),
... | UK992/servo | tests/wpt/web-platform-tests/webdriver/tests/support/authentication.py | Python | mpl-2.0 | 800 |
#!/usr/bin/python2.4
# Copyright (c) 2009 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.
"""Visual Studio user preferences file writer."""
import common
import os
import re
import socket # for gethostname
import xml.dom
import xm... | nawawi/wkhtmltopdf | webkit/Source/ThirdParty/gyp/pylib/gyp/MSVSUserFile.py | Python | lgpl-3.0 | 6,250 |
#!/usr/bin/env python
# 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.
"""
Test that two targets with the same name generates an error.
"""
import os
import sys
import TestGyp
import TestCmd
# TODO(sbc): Remo... | xforce/diorama-native-modding | tools/gyp/test/errors/gyptest-errors.py | Python | bsd-3-clause | 2,537 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=no-self-use, pointless-statement, missing-docstring, invalid-name,len-as-condition
from functools import partial
from rebulk.pattern import StringPattern
from ..validators import chars_before, chars_after, chars_surround, validators
chars = ' _.'
left ... | Toilal/rebulk | rebulk/test/test_validators.py | Python | mit | 2,170 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012 University of Dundee & Open Microscopy Environment.
All Rights Reserved.
Copyright 2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
pytest fixtures used as def... | dominikl/openmicroscopy | components/tools/OmeroPy/test/integration/gatewaytest/test_chgrp.py | Python | gpl-2.0 | 12,030 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Cloudbase Solutions Srl
#
# 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/LICE... | sacharya/nova | nova/tests/virt/hyperv/db_fakes.py | Python | apache-2.0 | 5,743 |
from django.conf.urls import url
from wagtail.documents.views import serve
urlpatterns = [
url(r'^(\d+)/(.*)$', serve.serve, name='wagtaildocs_serve'),
url(r'^authenticate_with_password/(\d+)/$', serve.authenticate_with_password,
name='wagtaildocs_authenticate_with_password'),
]
| mikedingjan/wagtail | wagtail/documents/urls.py | Python | bsd-3-clause | 298 |
#!/usr/bin/env python
# File created on 10 Nov 2011
from __future__ import division
__author__ = "Jesse Stombaugh"
__copyright__ = "Copyright 2011, The QIIME project"
__credits__ = ["Jesse Stombaugh"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Jesse Stombaugh"
__email__ = "jesse.stombaugh@colorado... | josenavas/qiime | scripts/clean_raxml_parsimony_tree.py | Python | gpl-2.0 | 3,356 |
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | zouyapeng/horizon-newtouch | openstack_dashboard/dashboards/admin/info/tabs.py | Python | apache-2.0 | 3,879 |
# -*- coding: utf-8 -*-
import collections
import logging
import time
from mock import MagicMock, patch
from . import unittest
from kafka import KafkaClient, SimpleProducer
from kafka.common import (
AsyncProducerQueueFull, FailedPayloadsError, NotLeaderForPartitionError,
ProduceResponse, RetryOptions, Topic... | nmandavia/kafka-python | test/test_producer.py | Python | apache-2.0 | 8,543 |
""" Additional extras go here.
""" | kartta-labs/mapwarper | lib/tilestache/TileStache-1.51.5/TileStache/Goodies/__init__.py | Python | mit | 34 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | legalsylvain/OpenUpgrade | openerp/modules/graph.py | Python | agpl-3.0 | 8,097 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/manage/cmdshell.py | Python | gpl-3.0 | 8,585 |
import time
from ajenti.com import *
from ajenti.ui import *
from ajenti.utils import shell, str_fsize
class BSDIfconfig(Plugin):
platform = ['FreeBSD']
def get_info(self, iface):
ui = UI.Container(
UI.Formline(
UI.HContainer(
UI.Image(... | DVSBA/ajenti | plugins/network/nctp_bsd.py | Python | lgpl-3.0 | 2,275 |
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | liefdiy/bite-project | tools/bugs/server/appengine/providers/provider.py | Python | apache-2.0 | 816 |
# Copyright (c) 2014 Thales Services SAS
#
# 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... | cernops/neutron | neutron/db/migration/alembic_migrations/versions/4eba2f05c2f4_correct_vxlan_endpoint_primary_key.py | Python | apache-2.0 | 1,254 |
#!/usr/bin/env python3
from storer import Storer
import sys
s = Storer()
if s.get_value() != 0:
print('Initial value incorrect.')
sys.exit(1)
s.set_value(42)
if s.get_value() != 42:
print('Setting value failed.')
sys.exit(1)
try:
s.set_value('not a number')
print('Using wrong argument type... | aaronp24/meson | test cases/python3/3 cython/cytest.py | Python | apache-2.0 | 380 |
#
# The Python Imaging Library.
# $Id$
#
# MSP file handling
#
# This is the format used by the Paint program in Windows 1 and 2.
#
# History:
# 95-09-05 fl Created
# 97-01-03 fl Read/write MSP images
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1995-97.
#
# See the README fi... | havard024/prego | venv/lib/python2.7/site-packages/PIL/MspImagePlugin.py | Python | mit | 2,173 |
from .wiki import *
| procamora/Wiki-Personal | pelican-plugins/github-wiki/__init__.py | Python | gpl-3.0 | 20 |
"""SymPy is a Python library for symbolic mathematics. It aims to become a
full-featured computer algebra system (CAS) while keeping the code as
simple as possible in order to be comprehensible and easily extensible.
SymPy is written entirely in Python and does not require any external
libraries, except optionally for ... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/__init__.py | Python | mit | 2,176 |
# test construction of bytearray from different objects
try:
from uarray import array
except ImportError:
try:
from array import array
except ImportError:
print("SKIP")
raise SystemExit
# arrays
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))
| kerneltask/micropython | tests/basics/bytearray_construct_array.py | Python | mit | 314 |
# Copyright (C) 2014, Red Hat, 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... | petrutlucian94/nova | nova/objects/dns_domain.py | Python | apache-2.0 | 2,520 |
#!/usr/bin/env python
try:
from collections import OrderedDict
import json
except ImportError:
from ordereddict import OrderedDict
import simplejson as json
import itertools
import six
from csvkit import CSVKitWriter
def parse_object(obj, path=''):
"""
Recursively parse JSON objects and a di... | unpingco/csvkit | csvkit/convert/ndjs.py | Python | mit | 1,769 |
'''
This is a one-off command aimed at fixing a temporary problem encountered where input_state was added to
the same dict object in capa problems, so was accumulating. The fix is simply to remove input_state entry
from state for all problems in the affected date range.
'''
import json
import logging
from optparse im... | beni55/edx-platform | lms/djangoapps/courseware/management/commands/remove_input_state.py | Python | agpl-3.0 | 6,715 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | alxgu/ansible | lib/ansible/module_utils/ec2.py | Python | gpl-3.0 | 28,571 |
from robot.api.deco import keyword
def defined_twice():
1/0
@keyword('Defined twice')
def this_time_using_custom_name():
2/0
def defined_thrice():
1/0
def definedThrice():
2/0
def Defined_Thrice():
3/0
@keyword('Embedded ${arguments} twice')
def embedded1(arg):
1/0
@keyword('Embedded ${a... | ChrisHirsch/robotframework | atest/testdata/keywords/DupeKeywords.py | Python | apache-2.0 | 372 |
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
apiutil.CopyrightDef()
print """DESCRIPTION ""
EXPORTS
"""
keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
for func_name in ap... | yuyuyu101/VirtualBox-NetBSD | src/VBox/GuestHost/OpenGL/state_tracker/state_defs.py | Python | gpl-2.0 | 1,397 |
# -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
class HelloSignHookTests(WebhookTestCase):
STREAM_NAME = 'hellosign'
URL_TEMPLATE = "/api/v1/external/hellosign?stream={stream}&api_key={api_key}"
FIXTURE_DIR_NAME = 'hellosign'
def test_signatures_mess... | sonali0901/zulip | zerver/webhooks/hellosign/tests.py | Python | apache-2.0 | 884 |
from tornado.concurrent import Future
from tornado import gen
from tornado.httpclient import HTTPError
from tornado.log import gen_log
from tornado.testing import AsyncHTTPTestCase, gen_test, bind_unused_port, ExpectLog
from tornado.web import Application, RequestHandler
from tornado.websocket import WebSocketHandler, ... | Drvanon/Game | venv/lib/python3.3/site-packages/tornado/test/websocket_test.py | Python | apache-2.0 | 2,935 |
# 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.
import logging
import os
import sys
import unittest
from telemetry.core import browser_options
from telemetry.core import discover
from telemetry.unittes... | gfreed/android_external_chromium-org | tools/telemetry/telemetry/unittest/run_tests.py | Python | bsd-3-clause | 4,642 |
# 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... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/learn/python/learn/dataframe/transforms/example_parser.py | Python | apache-2.0 | 2,407 |
# -*- coding: utf-8 -*-
"""
Basic CLexer Test
~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import unittest
import os
from pygments.token import Text, Number
from pygments.lexers import CLexer
class CLexerTest(unitte... | djanowski/pygmentize | vendor/pygments/tests/test_clexer.py | Python | mit | 898 |
from __future__ import unicode_literals
import errno
import os
import re
import socket
import sys
from datetime import datetime
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import get_internal_wsgi_applicati... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py | Python | agpl-3.0 | 7,307 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-04-03 20:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0005_merge'),
]
operations = [
migrations.RunSQL(
[
... | aaxelb/osf.io | osf/migrations/0006_add_jsonb_index_for_fileversions.py | Python | apache-2.0 | 765 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from collections import namedtuple
from cryptography import utils
from c... | ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/cryptography/hazmat/backends/commoncrypto/backend.py | Python | apache-2.0 | 8,577 |