code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent 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
# no... | nuagenetworks/monolithe | monolithe/generators/lang/java/converter.py | Python | bsd-3-clause | 2,306 |
import sys
import matplotlib.pyplot as plt
import numpy as np
import sklearn.gaussian_process
import sklearn.kernel_approximation
import splitter
from appx_gaussian_processes import appx_gp
TRAINING_NUM = 1500
TESTING_NUM = 50000
ALPHA = .003
LENGTH_SCALE = 1
GAMMA = .5 / (LENGTH_SCALE ** 2)
COMPONENTS = 100
def... | alasdairtran/mclearn | projects/jakub/test_appx_gp.py | Python | bsd-3-clause | 3,431 |
#! /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.
import itertools
import json
import os.path
import re
import sys
from json_parse import OrderedDict
# This file is a peer to jso... | patrickm/chromium.src | tools/json_schema_compiler/idl_schema.py | Python | bsd-3-clause | 16,913 |
#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
from chainer import cuda
import chainer.serializers as S
from chainer import Variable
from fcn.models import FCN32s
import numpy as np
import cv_bridge
import jsk_apc2016_comm... | start-jsk/jsk_apc | jsk_2016_01_baxter_apc/node_scripts/fcn_mask_for_label_names.py | Python | bsd-3-clause | 5,525 |
# Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | jtyuan/racetrack | tests/configs/tgen-dram-ctrl.py | Python | bsd-3-clause | 3,365 |
# Copyright (c) 2012-2015 The GPy authors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
import scipy
from ..util.univariate_Gaussian import std_norm_cdf, std_norm_pdf
import scipy as sp
from ..util.misc import safe_exp, safe_square, safe_cube, safe_quad, safe_three_ti... | befelix/GPy | GPy/likelihoods/link_functions.py | Python | bsd-3-clause | 4,850 |
"""Base classes for classifiers"""
from ..core.classes import Processor
class BaseClassifier(Processor):
'''
The base class for classifiers.
'''
def __init__(self, *args, **kwargs):
super(BaseClassifier, self).__init__(*args, **kwargs)
self.classifier = None
class SklearnClassifier(B... | Succeed-Together/bakfu | classify/base.py | Python | bsd-3-clause | 1,167 |
##########################################################################
#
# Copyright (c) 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:
#
# * Redistrib... | cedriclaunay/gaffer | python/GafferImageTest/FilterTest.py | Python | bsd-3-clause | 2,759 |
# -*- coding: utf-8 -*-
#
# Viper documentation build configuration file, created by
# sphinx-quickstart on Mon May 5 18:24:15 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 file.
#
# All c... | LMSlay/wiper | docs/source/conf.py | Python | bsd-3-clause | 7,714 |
#!/usr/bin/python
'''
This script sends a ping to a specific mote and waits for the pingResponse
notification. If any other pingResponses are received, the program
continues listening and waits until the correct one is received.
'''
#============================ adjust path =====================================
impor... | realms-team/solmanager | libs/smartmeshsdk-REL-1.3.0.1/vmanager_apps/VMgr_SendPing.py | Python | bsd-3-clause | 4,789 |
"""Test the stacking classifier and regressor."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# License: BSD 3 clause
import pytest
import numpy as np
import scipy.sparse as sparse
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.base import RegressorMixin
from ... | bnaul/scikit-learn | sklearn/ensemble/tests/test_stacking.py | Python | bsd-3-clause | 19,101 |
from __future__ import absolute_import
import six
import logging
from collections import namedtuple
from symsynd.macho.arch import get_cpu_name
from symsynd.utils import parse_addr
from sentry.interfaces.contexts import DeviceContextType
logger = logging.getLogger(__name__)
APPLE_SDK_MAPPING = {
'iPhone OS':... | JackDanger/sentry | src/sentry/lang/native/utils.py | Python | bsd-3-clause | 5,739 |
from datetime import datetime
import pandas as pd
from pandas.util.testing import assert_frame_equal
import ulmo
import ulmo.usgs.eddn.parsers as parsers
import test_util
fmt = '%y%j%H%M%S'
message_test_sets = [
{
'dcp_address': 'C5149430',
'number_of_lines': 4,
'parser': 'twdb_stevens',
... | nathanhilbert/ulmo | test/usgs_eddn_test.py | Python | bsd-3-clause | 13,809 |
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper:
def __init__(self, cursor, db):
se... | mattseymour/django | django/db/backends/utils.py | Python | bsd-3-clause | 7,044 |
import asyncio
import os
from urllib.parse import urlparse
import aiohttp
def damerau_levenshtein(first_string, second_string):
"""Returns the Damerau-Levenshtein edit distance between two strings."""
previous = None
prev_a = None
current = [i for i, x in enumerate(second_string, 1)] + [0]
for ... | nathan-hoad/aesop | aesop/utils.py | Python | bsd-3-clause | 4,678 |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/markers.py
"""
This modules defines a collection of markers used in charts.
The make* functions return a simple shape or a widget as f... | alexissmirnov/donomo | donomo_archive/lib/reportlab/graphics/charts/markers.py | Python | bsd-3-clause | 1,801 |
"""
Generalized Linear models.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Vincent Michel <vincent.michel@inria.fr>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# ... | Fireblend/scikit-learn | sklearn/linear_model/base.py | Python | bsd-3-clause | 16,019 |
# -*- coding: utf-8 -*-
'''
tag_treetagger.py
This module is a wrapper to TreeTagger.
'''
import os
import sys
import string
import six
import sklearn
from itertools import chain
from bakfu.core.routes import register
from bakfu.process.base import BaseProcessor
__errors__ = []
try:
import pattern.fr
except... | Succeed-Together/bakfu | process/tagging/tag_pattern.py | Python | bsd-3-clause | 2,918 |
from __future__ import print_function, absolute_import, division
import warnings
import pytest
import numpy as np
from astropy import units as u
from astropy.wcs import WCS
from astropy.io import fits
from radio_beam import Beam, Beams
from .helpers import assert_allclose
from .test_spectral_cube import cube_and_ra... | e-koch/spectral-cube | spectral_cube/tests/test_projection.py | Python | bsd-3-clause | 27,131 |
#!/usr/bin/env python
from __future__ import division
__author__ = 'youval.dar'
| youdar/usesul_functions | source/read_write_to_mysql/__init__.py | Python | mit | 84 |
from __future__ import absolute_import
from HTMLParser import *
| timothycrosley/pies | pies2overrides/html/parser.py | Python | mit | 65 |
import pytest
@pytest.fixture
def builtins_open(mocker):
return mocker.patch('six.moves.builtins.open')
@pytest.fixture
def isfile(mocker):
return mocker.patch('os.path.isfile', return_value=True)
@pytest.fixture
@pytest.mark.usefixtures('isfile')
def history_lines(mocker):
def aux(lines):
moc... | lawrencebenson/thefuck | tests/shells/conftest.py | Python | mit | 459 |
from datetime import date, time, timedelta
from decimal import Decimal
import itertools
from django.utils import timezone
from six.moves import xrange
from .models import Person
def get_fixtures(n=None):
"""
Returns `n` dictionaries of `Person` objects.
If `n` is not specified it defaults to 6.
"... | lead-ratings/django-bulk-update | tests/fixtures.py | Python | mit | 4,775 |
TASKS = {
"tests.tasks.general.Retry": {
"max_retries": 1,
"retry_delay": 1
}
}
| IAlwaysBeCoding/mrq | tests/fixtures/config-retry1.py | Python | mit | 105 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .. import app, celery
import hashlib
import hmac
import time
import requests
from . import wechat_custom
@celery.task
def get(openid):
"""获取天气与空气质量预报"""
content = []
current_hour = time.strftime('%H')
try:
pm_25_info = get_pm2_5_info()
ex... | 15klli/WeChat-Clone | main/plugins/weather.py | Python | mit | 4,482 |
import astropy.io.fits
import numpy as np
import matplotlib.pyplot as plt
# Create an empty numpy array. 2D; spectra with 4 data elements.
filtered = np.zeros((2040,4))
combined_extracted_1d_spectra_ = astropy.io.fits.open("xtfbrsnN20160705S0025.fits")
exptime = float(combined_extracted_1d_spectra_[0].header['EXPTIME... | mrlb05/Nifty | tests/generate_response_curve.py | Python | mit | 1,827 |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------... | dsgouda/autorest | Samples/2a-validation/Python/storage/storage_management_client.py | Python | mit | 3,693 |
"""SCons.Tool.aixc++
Tool-specific initialization for IBM xlC / Visual Age C++ compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is h... | EmanueleCannizzaro/scons | src/engine/SCons/Tool/aixc++.py | Python | mit | 2,413 |
"""SCons.Tool.yacc
Tool-specific initialization for yacc.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, ... | EmanueleCannizzaro/scons | src/engine/SCons/Tool/yacc.py | Python | mit | 4,613 |
from django.views.generic import ListView, DetailView, CreateView, \
DeleteView, UpdateView
from baseapp.models import Disadvantaged_group
from django.contrib import auth, messages
class Disadvantaged_groupView(object):
model = Disadvantaged_group
def get_template_names(sel... | tnemis/staging-server | baseapp/views/disadvantaged_group_views.py | Python | mit | 1,981 |
#!/usr/bin/env python
#
# Copyright 2001-2012 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_logging.py | Python | mit | 134,314 |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from pubnub import Pubnub as Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'demo'
subscribe_key ... | teddywing/pubnub-python | python/examples/subscribe_group.py | Python | mit | 1,925 |
# -*- coding: utf-8 -*-
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": 'この地域を地理的に指定するロケーション。これはロケーションの階層構造のうちの一つか、ロケーショングループの一つか、この地域の境界に面するロケーションです。',
"Acronym of the organ... | bobrock/eden | languages/ja.py | Python | mit | 353,167 |
# -*- coding: utf-8 -*-
from __future__ import print_function
# Form implementation generated from reading ui file './acq4/analysis/old/StdpCtrlTemplate.ui'
#
# Created: Tue Dec 24 01:49:15 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, ... | meganbkratz/acq4 | acq4/analysis/old/StdpCtrlTemplate.py | Python | mit | 3,654 |
""" Just a purple sphere """
from vapory import *
objects = [
# SUN
LightSource([1500,2500,-2500], 'color',1),
# SKY
Sphere( [0,0,0],1, 'hollow',
Texture(
Pigment( 'gradient', [0,1,0],
'color_map{[0 color White] [1 color Blu... | eelcovv/vapory | examples/pawn.py | Python | mit | 1,312 |
import logging
import re
import aexpect
from autotest.client import utils
from autotest.client.shared import error
from virttest import utils_net
from virttest import utils_test
from virttest import utils_misc
@error.context_aware
def run(test, params, env):
"""
MULTI_QUEUE chang queues number test
1)... | tolimit/tp-qemu | qemu/tests/mq_change_qnum.py | Python | gpl-2.0 | 9,855 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 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... | CERNDocumentServer/invenio | modules/miscutil/lib/mailutils.py | Python | gpl-2.0 | 22,698 |
# Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz@sorosny.org
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version 2 as published
# by the Free Software Foundation. You may not use, modify or distribu... | boothead/karl | karl/views/__init__.py | Python | gpl-2.0 | 864 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2008 Richard Spiers <richard.spiers@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 pu... | billiob/papyon | papyon/msnp2p/session.py | Python | gpl-2.0 | 11,748 |
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2012 The Chromium OS Authors.
#
"""Tests for the dtb_platdata module
This includes unit tests for some functions and functional tests for the dtoc
tool.
"""
import collections
import os
import struct
import sys
import tempfile
import unittest... | Digilent/u-boot-digilent | tools/dtoc/test_dtoc.py | Python | gpl-2.0 | 28,025 |
"""engine.SCons.Platform.sunos
Platform-specific initialization for Sun systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is h... | xiaohaidao007/pandoraBox-SDK-mt7620 | staging_dir/host/lib/scons-2.5.0/SCons/Platform/sunos.py | Python | gpl-2.0 | 1,912 |
"""
Helper functions for handling DB accesses.
"""
import subprocess
import logging
import gzip
import io
from nominatim.db.connection import get_pg_env
from nominatim.errors import UsageError
LOG = logging.getLogger()
def _pipe_to_proc(proc, fdesc):
chunk = fdesc.read(2048)
while chunk and proc.poll() is No... | lonvia/Nominatim | nominatim/db/utils.py | Python | gpl-2.0 | 3,126 |
#!/usr/bin/python
from config import hostname, port, username, password
import carddav
import sogotests
import unittest
import webdavlib
import time
class JsonDavEventTests(unittest.TestCase):
def setUp(self):
self._connect_as_user()
def _connect_as_user(self, newuser=username, newpassword=passwor... | saydulk/sogo | Tests/Integration/test-carddav.py | Python | gpl-2.0 | 6,859 |
# vi: ts=4 expandtab
#
# Copyright (C) 2013 Canonical Ltd.
#
# Author: Ben Howard <ben.howard@canonical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# Th... | prometheanfire/cloud-init | cloudinit/sources/DataSourceSmartOS.py | Python | gpl-3.0 | 29,325 |
# Copyright (C) 2016 Siavoosh Payandeh Azad
from math import ceil, log
import random
# -D [size]: sets the size of the network, it can be powers of two
# -Rand: generates random traffic patterns
import sys
if '--help' in sys.argv[1:]:
print "\t-D [network size]: makes a test bench for network of [size]X[size]. S... | siavooshpayandehazad/NoC_Router | Scripts/credit_based/network_tb_gen_parameterized_credit_based.py | Python | gpl-3.0 | 26,573 |
# -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Timesheet on Issues',
'version': '1.0',
'category': 'Project Management',
'description': """
This module adds the Timesheet support for the Issues/Bugs Management in Project.
================... | akhmadMizkat/odoo | addons/project_issue_sheet/__openerp__.py | Python | gpl-3.0 | 850 |
# Copyright 2010-2020 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | Vagab0nd/SiCKRAGE | lib3/feedparser/sanitizer.py | Python | gpl-3.0 | 24,025 |
#pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from PyQt4 import QtCore
from mantid.simpleapi import *
import numpy as n
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
def saveCustom(idx,fname,sep = ' ',logs... | dymkowsk/mantid | scripts/Reflectometry/isis_reflectometry/saveModule.py | Python | gpl-3.0 | 3,083 |
# coding=utf-8
import re
import urlparse
from feedparser.api import parse
from feedparser.util import FeedParserDict
from sickbeard import logger
from sickrage.helper.exceptions import ex
def getFeed(url, request_headers=None, handlers=None):
parsed = list(urlparse.urlparse(url))
parsed[2] = re.sub("/{2,}", ... | pkoutsias/SickRage | sickbeard/rssfeeds.py | Python | gpl-3.0 | 982 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class LoginConfig(AppConfig):
name = 'login'
| InspectorIncognito/visualization | login/apps.py | Python | gpl-3.0 | 150 |
"""
This payload receives the msfvenom shellcode, base64 encodes it, and stores it within the payload.
At runtime, the executable decodes the shellcode and executes it in memory.
module by @christruncer
"""
import base64
from datetime import date
from datetime import timedelta
from modules.common import shellcod... | g0tmi1k/veil-Evasion | modules/payloads/python/shellcode_inject/base64_substitution.py | Python | gpl-3.0 | 16,041 |
# (C) British Crown Copyright 2016, Met Office
#
# This file is part of Biggus.
#
# Biggus 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 late... | pelson/biggus | biggus/tests/unit/init/__init__.py | Python | gpl-3.0 | 882 |
# THIS FILE IS CONTROLLED BY ELASTICLUSTER
# local modifications will be overwritten
# the next time `elasticluster setup` is run!
#
#
# Configuration file for jupyterhub.
#
#------------------------------------------------------------------------------
# JupyterHub(Application) configuration
#-----------------------... | TissueMAPS/TmDeploy | elasticluster/elasticluster/share/playbooks/roles/jupyterhub/files/etc/jupyterhub/jupyterhub_config.py | Python | gpl-3.0 | 12,907 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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 dist... | brion/gimp | plug-ins/pygimp/plug-ins/palette-sort.py | Python | gpl-3.0 | 13,495 |
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
The script can be used to setup a virtual environment for running Firefox UI Tests.
It will a... | Motwani/firefox-ui-tests | .travis/create_venv.py | Python | mpl-2.0 | 3,764 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import mock
from nose.tools import ok_
from crontabber.app import CronTabber
from socorro.unittest.cron.jobs.base impo... | m8ttyB/socorro | socorro/unittest/cron/jobs/test_upload_crash_report_json_schema.py | Python | mpl-2.0 | 1,523 |
# -*- coding: utf-8 -*-
# © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from openerp import api, models
class WebsiteMenu(models.Model):
_inherit = "website.menu"
@api.multi
def get_parents(self, revert=False, inclu... | Tecnativa/website | website_breadcrumb/models/website.py | Python | agpl-3.0 | 1,026 |
"""
mock_django.signals
~~~~~~~~~~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import contextlib
import mock
@contextlib.contextmanager
def mock_signal_receiver(signal, wraps=None, **kwargs):
"""
Temporarily attaches a receiver to the provided ``signal``... | devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/mock_django/signals.py | Python | agpl-3.0 | 1,028 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('grades.rest_api.v1.tests.test_grading_policy_view'... | eduNEXT/edunext-platform | import_shims/lms/grades/rest_api/v1/tests/test_grading_policy_view.py | Python | agpl-3.0 | 470 |
##############################################################################
# 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... | EmreAtes/spack | var/spack/repos/builtin/packages/r-affyqcreport/package.py | Python | lgpl-2.1 | 2,212 |
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2018 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | romanz/python-trezor | trezorlib/tests/device_tests/test_cancel.py | Python | lgpl-3.0 | 2,032 |
from rezgui.qt import QtGui
from rezgui.util import create_pane
from rezgui.mixins.ContextViewMixin import ContextViewMixin
from rezgui.models.ContextModel import ContextModel
from rez.config import config
from rez.vendor import yaml
from rez.vendor.yaml.error import YAMLError
from rez.vendor.schema.schema import Schem... | LumaPictures/rez | src/rezgui/widgets/ContextSettingsWidget.py | Python | lgpl-3.0 | 6,497 |
#
# 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... | jasonkuster/incubator-beam | sdks/python/apache_beam/examples/snippets/snippets_test.py | Python | apache-2.0 | 28,632 |
#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... | ApolloAuto/apollo | modules/tools/ota/create_sec_package.py | Python | apache-2.0 | 1,573 |
#
# Copyright (c) 2008-2015 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwlearningsettings.py | Python | apache-2.0 | 24,257 |
#
# 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
# ... | pshchelo/heat | heat/engine/resources/openstack/ceilometer/alarm.py | Python | apache-2.0 | 14,721 |
"""
Autopsy Forensic Browser
Copyright 2016-2018 Basis Technology Corp.
Contact: carrier <at> sleuthkit <dot> org
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... | wschaeferB/autopsy | InternalPythonModules/android/googlemaplocation.py | Python | apache-2.0 | 6,752 |
# -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | nis-sdn/odenos | src/main/python/org/o3project/odenos/core/component/conversion_table.py | Python | apache-2.0 | 7,233 |
# Copyright 2015 Mirantis, Inc.
# Copyright 2012-2013 IBM Corp.
# 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... | Mirantis/vmware-firewall-driver | setup.py | Python | apache-2.0 | 738 |
#
# Copyright (C) 2014 Dell, 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 wri... | JPWKU/unix-agent | src/dcm/agent/tests/unit/test_backoff.py | Python | apache-2.0 | 7,619 |
# Copyright 2017 Predict & Truly 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 required by applic... | truly-systems/glpi-sdk-python | glpi/item_knowbase.py | Python | apache-2.0 | 1,459 |
from rest_framework import serializers as ser
from api.base.serializers import ShowIfVersion
from api.providers.serializers import PreprintProviderSerializer
class DeprecatedPreprintProviderSerializer(PreprintProviderSerializer):
class Meta:
type_ = 'preprint_providers'
# Deprecated fields
header... | icereval/osf.io | api/preprint_providers/serializers.py | Python | apache-2.0 | 1,430 |
# Copyright 2014 Mirantis, 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 ... | nebril/fuel-web | nailgun/nailgun/objects/action_log.py | Python | apache-2.0 | 3,128 |
# Copyright 2015 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 required by... | Gitweijie/first_project | networking_cisco/neutronclient/routerscheduler.py | Python | apache-2.0 | 7,544 |
# -*- coding: utf-8 -*-
from plaso.parsers.bencode_plugins import transmission
from plaso.parsers.bencode_plugins import utorrent
| ostree/plaso | plaso/parsers/bencode_plugins/__init__.py | Python | apache-2.0 | 131 |
"""Auto-generated file, do not edit by hand. IE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IE = PhoneMetadata(id='IE', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[159]\\d{2,5}', possible_number_pattern... | roubert/python-phonenumbers | python/phonenumbers/shortdata/region_IE.py | Python | apache-2.0 | 1,071 |
#! /usr/bin/env python
# Copyright (C) 2011 OpenStack, LLC.
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 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 c... | hedvig/project-config | jenkins/scripts/project-requirements-change.py | Python | apache-2.0 | 10,166 |
# 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... | orbitfp7/nova | nova/tests/unit/scheduler/filters/test_numa_topology_filters.py | Python | apache-2.0 | 7,379 |
# 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... | guanxi55nba/db-improvement | pylib/cqlshlib/helptopics.py | Python | apache-2.0 | 30,976 |
#!/usr/bin/env python
import re,urllib2
class Get_public_ip:
def getip(self):
try:
myip = self.visit("http://ip.chinaz.com/getip.aspx")
except:
try:
myip = self.visit("http://ipv4.icanhazip.com/")
except:
myip = "So sorry!!!"
return myip
def visit(self,url):
opener ... | PoplarYang/oneinstack-odm | include/get_public_ipaddr.py | Python | apache-2.0 | 536 |
# Consider a row of n coins of values v1 . . . vn, where n is even.
# We play a game against an opponent by alternating turns. In each turn,
# a player selects either the first or last coin from the row, removes it
# from the row permanently, and receives the value of the coin. Determine the
# maximum possible amount o... | bkpathak/Algorithms-collections | src/DP/coin_play.py | Python | apache-2.0 | 2,084 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | StackStorm/st2 | st2tests/st2tests/config.py | Python | apache-2.0 | 16,363 |
# -*- coding: utf-8 -*-
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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... | StackStorm/st2 | st2actions/setup.py | Python | apache-2.0 | 1,772 |
# Authors: Lars Buitinck
# Dan Blanchard <dblanchard@ets.org>
# License: BSD 3 clause
from random import Random
import numpy as np
import scipy.sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_allclose
import pytest
from sklearn.feature_extraction import DictVectori... | huzq/scikit-learn | sklearn/feature_extraction/tests/test_dict_vectorizer.py | Python | bsd-3-clause | 7,189 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from os.path import abspath, dirname, join
#
# Bokeh documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 12 23:43:03 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not a... | mindriot101/bokeh | sphinx/source/conf.py | Python | bsd-3-clause | 9,540 |
from __future__ import print_function
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem.PyMol import MolViewer
from rdkit.Chem.Subshape import SubshapeBuilder,SubshapeObjects,SubshapeAligner
from rdkit.six.moves import cPickle
import copy
m1 = Chem.MolFromMolFile('test_data/square1.mol')
m2 = Chem.... | soerendip42/rdkit | rdkit/Chem/Subshape/testCombined.py | Python | bsd-3-clause | 1,702 |
#!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | jwhui/openthread | tools/otci/otci/command_handlers.py | Python | bsd-3-clause | 9,542 |
#
# stage.py -- Classes for pipeline stages
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.misc import Bunch
#__all__ = ['Pipeline']
class StageError(Exception):
pass
class Stage(object):
"""Class to handle a pipeline stage."""
... | pllim/ginga | ginga/util/stages/base.py | Python | bsd-3-clause | 1,889 |
import optparse
import pyrax
import swiftclient
from django.core.management.base import BaseCommand, CommandError
from cumulus.settings import CUMULUS
def cdn_enabled_for_container(container):
"""pyrax.cf_wrapper.CFClient assumes cdn_connection.
Currently the pyrax swift client wrapper assumes that if
... | absoludity/django-cumulus | cumulus/management/commands/container_create.py | Python | bsd-3-clause | 2,713 |
#!/usr/bin/python
#
# This file is part of CONCUSS, https://github.com/theoryinpractice/concuss/,
# and is Copyright (C) North Carolina State University, 2015. It is licensed
# under the three-clause BSD license; see LICENSE.
#
from lib.util.memorized import memorized
from lib.graph.graph import Graph
# Calculate ... | nish10z/CONCUSS | lib/coloring/basic/trans_frater_augmentation.py | Python | bsd-3-clause | 1,365 |
import numpy as np
import pytest
pytestmark = pytest.mark.gpu
import dask.array as da
from dask.array.gufunc import apply_gufunc
from dask.array.utils import assert_eq
cupy = pytest.importorskip("cupy")
def test_apply_gufunc_axis():
def mydiff(x):
return np.diff(x)
a = cupy.random.randn(3, 6, 4)
... | dask/dask | dask/array/tests/test_cupy_gufunc.py | Python | bsd-3-clause | 532 |
#
# A test file for the `processing` package
#
import time, sys, random
from Queue import Empty
import processing # may get overwritten
#### TEST_VALUE
def value_func(running, mutex):
random.seed()
time.sleep(random.random()*4)
mutex.acquire()
print '\n\t\t\t' + ... | seishei/multiprocess | py2.5/examples/ex_synchronize.py | Python | bsd-3-clause | 6,159 |
#!/usr/bin/env python
#
# 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.
"""Renders one or more template files using the Jinja template engine."""
import codecs
import argparse
import os
import sys
from u... | chrisdickinson/nojs | build/android/gyp/jinja_template.py | Python | bsd-3-clause | 5,601 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | mindriot101/bokeh | bokeh/client/tests/test_session.py | Python | bsd-3-clause | 6,568 |
import pickle
import tempfile
import shutil
import os
import numbers
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regexp
from sklearn.utils.t... | meduz/scikit-learn | sklearn/metrics/tests/test_score_objects.py | Python | bsd-3-clause | 17,473 |
"""Test that types defined in shared libraries work correctly."""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestRealDefinition(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
def test_frame... | endlessm/chromium-browser | third_party/llvm/lldb/test/API/lang/objc/conflicting-definition/TestConflictingDefinition.py | Python | bsd-3-clause | 1,681 |
from __future__ import print_function
from bokeh.core.properties import String
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.callbacks import Callback
from bokeh.models.glyphs import Circle
from bokeh.models import Plot, DataRange1d, LinearAxis, ColumnDataSource, PanTool, Whee... | pombredanne/bokeh | examples/models/custom.py | Python | bsd-3-clause | 2,401 |
# 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.
"""TestEnvironment classes.
These classes abstract away the various setups needed to run the WebDriver java
tests in various environments.
"""
from __futur... | ric2b/Vivaldi-browser | chromium/chrome/test/chromedriver/test/test_environment.py | Python | bsd-3-clause | 3,855 |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import emission.core.get_database as edb
def fix_key(check_field, new_key):... | e-mission/e-mission-server | bin/historical/fix_sensor_config_key.py | Python | bsd-3-clause | 1,342 |
# $Id$
#
# Copyright (c) 2007, Novartis Institutes for BioMedical Research 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 abov... | soerendip42/rdkit | rdkit/Chem/Recap.py | Python | bsd-3-clause | 21,394 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.