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 |
|---|---|---|---|---|---|
"""Functions to plot epochs data
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.f... | lorenzo-desantis/mne-python | mne/viz/epochs.py | Python | bsd-3-clause | 60,756 |
#! /usr/bin/env python
# This file is part of khmer, https://github.com/dib-lab/khmer/, and is
# Copyright (C) 2011-2015, Michigan State University.
# Copyright (C) 2015, The Regents of the University of California.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted pro... | ged-lab/khmer | sandbox/graph-size.py | Python | bsd-3-clause | 3,122 |
# Copyright 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.
from itertools import izip
import logging
import re
from net import bsonrpc
from net import gorpc
from vtdb import cursor
from vtdb import dbexceptions
from vtdb imp... | HeisenbergUncertain/vitess | py/vtdb/tablet.py | Python | bsd-3-clause | 9,958 |
import os
import xbmc
import urllib2
import threading
from quasar.config import QUASARD_HOST
from quasar.daemon import shutdown
class QuasarMonitor(xbmc.Monitor):
def __init__(self):
self._closing = threading.Event()
@property
def closing(self):
return self._closing
def onAbortReques... | peer23peer/plugin.video.quasar | resources/site-packages/quasar/monitor.py | Python | bsd-3-clause | 891 |
"""
Test that C++ template classes that have integer parameters work correctly.
We must reconstruct the types correctly so the template types are correct
and display correctly, and also make sure the expression parser works and
is able the find all needed functions when evaluating expressions
"""
import lldb
from lldb... | youtube/cobalt | third_party/llvm-project/lldb/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py | Python | bsd-3-clause | 6,473 |
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('coapResource')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import coapException as e
class coapResource(object):
def __init__(self,path):
assert ty... | Infixz/coap | coap/coapResource.py | Python | bsd-3-clause | 1,271 |
#!/usr/bin/env python
#coding=utf-8
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of co... | pk-sam/crosswalk-test-suite | stability/stability-iterative-android-tests/iterative/Install_Uninstall_Repeatedly.py | Python | bsd-3-clause | 3,521 |
# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
"""
Widgets to extend Urwid capabilities
"""
from urwid import *
... | akosthekiss/fuzzinator | fuzzinator/ui/tui/decor_widgets.py | Python | bsd-3-clause | 2,954 |
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import imp
import os
import platform
import re
import subprocess
import sys
from . import config_option
from . import prompt
from digits import device_query
from digits.utils import parse_version
from digits.ut... | jmancewicz/DIGITS | digits/config/caffe_option.py | Python | bsd-3-clause | 11,787 |
#!/usr/bin/env python
#
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""A tiny web server.
This is intended to be used for testing.
"""
import BaseHTTPServer
import logging
import os
import... | kosyak/naclports_samsung-smart-tv | httpd.py | Python | bsd-3-clause | 5,816 |
import os
import vtkAll as vtk
import math
import time
import numpy as np
from director import callbacks
from director import transformUtils
from director import lcmUtils
from director import objectmodel as om
from director.utime import getUtime
from director import robotstate
try:
import robotlocomotion as lcmrl... | patmarion/director | src/python/director/robotplanlistener.py | Python | bsd-3-clause | 10,144 |
'''
Copyright (c) 2011-2014, Agora Games, LLC All rights reserved.
https://github.com/agoragames/haigha/blob/master/LICENSE.txt
'''
class ConnectionError(Exception):
'''Base class for all connection errors.'''
class ConnectionClosed(ConnectionError):
'''The connection is closed. Fatal.'''
class Channe... | simomo/haigha | haigha/exceptions.py | Python | bsd-3-clause | 463 |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.encoding import iri_to_uri
from django.utils.timezone import now
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
fr... | flamingspaz/remo | remo/profiles/tests/test_views.py | Python | bsd-3-clause | 16,218 |
from __future__ import unicode_literals
import io
import json
import os
presets_file = os.path.join(
os.path.dirname(__file__), "./facility_configuration_presets.json"
)
with io.open(presets_file, mode="r", encoding="utf-8") as f:
presets = json.load(f)
choices = [(key, key) for key in presets]
mappings = {... | lyw07/kolibri | kolibri/core/auth/constants/facility_presets.py | Python | mit | 461 |
# orm/interfaces.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Contains various base classes used throughout the ORM.
Defines the now depreca... | gujiawen/flask_web | venv/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.py | Python | mit | 28,559 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import os
from logging import getLogger
from flexget import plugin
from flexget.event import event
from flexget.utils import requests
from flexget.utils.soup import get_soup
fr... | oxc/Flexget | flexget/plugins/output/utorrent.py | Python | mit | 6,128 |
# -*- coding: utf-8 -*-
import pytest
from pandas import compat
from pandas.compat import PY3
import numpy as np
from pandas import (Series, Index, Float64Index, Int64Index, UInt64Index,
RangeIndex, MultiIndex, CategoricalIndex, DatetimeIndex,
TimedeltaIndex, PeriodIndex, Int... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/pandas/tests/indexes/common.py | Python | mit | 35,517 |
"""
Support for RFXtrx sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rfxtrx/
"""
import logging
import voluptuous as vol
import homeassistant.components.rfxtrx as rfxtrx
import homeassistant.helpers.config_validation as cv
from homeassi... | srcLurker/home-assistant | homeassistant/components/sensor/rfxtrx.py | Python | mit | 4,743 |
#!/usr/bin/env python3
# Copyright (c) 2018-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoin-wallet."""
import hashlib
import os
import stat
import subprocess
import textwrap
from t... | nikkitan/bitcoin | test/functional/tool_wallet.py | Python | mit | 9,501 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | thonkify/thonkify | src/lib/telegram/location.py | Python | mit | 1,631 |
__author__ = 'hannes'
| 5monkeys/django-formapi | formapi/templatetags/__init__.py | Python | mit | 22 |
from types import SimpleNamespace
import pytest
from fontTools.misc.loggingTools import CapturingLogHandler
from ufo2ft.filters import (
FILTERS_KEY,
BaseFilter,
getFilterClass,
loadFilterFromString,
loadFilters,
logger,
)
from ..testSupport import _TempModule
class FooBarFilter(BaseFilter)... | jamesgk/ufo2fdk | tests/filters/filters_test.py | Python | mit | 6,969 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | John-Hart/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/CustomBaseUri/autorestparameterizedhosttestclient/auto_rest_parameterized_host_test_client.py | Python | mit | 2,522 |
# coding: utf8
from __future__ import unicode_literals, division, print_function
import plac
from pathlib import Path
import ujson
import cProfile
import pstats
import spacy
import sys
import tqdm
import cytoolz
import thinc.extra.datasets
def read_inputs(loc):
if loc is None:
file_ = sys.stdin
... | aikramer2/spaCy | spacy/cli/profile.py | Python | mit | 1,299 |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class ImdbItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
| Nathx/parental_advisory_ml | scraping/imdb/imdb/items.py | Python | mit | 283 |
#!/usr/bin/python3
from ExtensionCore import ManageSpicesPage, DownloadSpicesPage
from Spices import Spice_Harvester
from GSettingsWidgets import *
from gi.repository import GLib, Gtk
class Module:
comment = _("Manage your Cinnamon desklets")
name = "desklets"
category = "prefs"
def __init__(self, co... | collinss/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/modules/cs_desklets.py | Python | gpl-2.0 | 3,501 |
# flake8: noqa
import os
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView, CreateView, UpdateView
from django.views.generic.edit import DeleteView
from ava.google_auth.views import retrieve_credential_from_session, django... | mattyjones/ava | ava/import_google/views.py | Python | gpl-2.0 | 4,584 |
#
# Copyright (C) 2011-2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it wi... | mairin/anaconda | pyanaconda/ui/gui/spokes/lib/lang_locale_handler.py | Python | gpl-2.0 | 6,599 |
#!/usr/bin/env python2
import socket
import struct
import time
import dns
import dns.message
import libnacl
import libnacl.utils
class DNSCryptResolverCertificate(object):
DNSCRYPT_CERT_MAGIC = '\x44\x4e\x53\x43'
DNSCRYPT_ES_VERSION = '\x00\x01'
DNSCRYPT_PROTOCOL_MIN_VERSION = '\x00\x00'
def __init__(... | hlindqvist/pdns | regression-tests.dnsdist/dnscrypt.py | Python | gpl-2.0 | 6,883 |
"""
Functionality around parsing the metadata within a packaged module (.tar.gz).
"""
import hashlib
import os
import shutil
import sys
import tarfile
import tempfile
from pulp.common.compat import json
from pulp.server.exceptions import PulpCodedException
from pulp_puppet.common import constants
from pulp_puppet.pl... | ammaritiz/pulp_puppet | pulp_puppet_plugins/pulp_puppet/plugins/importers/metadata.py | Python | gpl-2.0 | 4,180 |
# Copyright (C) 2010 Oregon State University et al.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program i... | dmS0Zq/ganeti_webmgr | ganeti_webmgr/utils/tests/ganeti_errors.py | Python | gpl-2.0 | 15,455 |
from cfme.utils.log import logger
def _remove_page(roles, group, pages):
if group in roles:
for page in pages:
if page in roles[group]:
roles[group].remove(page)
else:
logger.info("Page %s attempted to be removed from role %s, "
... | Yadnyawalkya/integration_tests | cfme/roles.py | Python | gpl-2.0 | 17,163 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... | goodwinos/sos | sos/plugins/kernel.py | Python | gpl-2.0 | 2,856 |
import builtins
import keyword
import re
import time
from idlelib.config import idleConf
from idlelib.delegator import Delegator
DEBUG = False
def any(name, alternates):
"Return a named group pattern matching list of alternates."
return "(?P<%s>" % name + "|".join(alternates) + ")"
def make_pat():
kw ... | bruderstein/PythonScript | PythonLib/full/idlelib/colorizer.py | Python | gpl-2.0 | 14,773 |
# -*- coding: utf-8 -*-
#
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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... | eamonnmag/hepdata3 | hepdata/utils/users.py | Python | gpl-2.0 | 2,279 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | zozo123/buildbot | master/buildbot/test/util/logging.py | Python | gpl-3.0 | 1,275 |
"""
Copyright (c) 2012-2015 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... | gkadillak/rockstor-core | src/rockstor/storageadmin/models/email.py | Python | gpl-3.0 | 1,120 |
## filename: LongestSubSequence.py
## Dynamic Programming
## CS6101: Design and Analysis of Algorithms
## Reference :
## http://www.geeksforgeeks.org
## http://topcoder.com
## Introduction to Algorithms, CLRS
## Description :
## Find the longest non-decreasing subSequence of a given Sequence
##
## Time Complexity ... | sukhoi/daa_cs6101 | dynamicProgramming/LongestSubSequence.py | Python | gpl-3.0 | 500 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MigrationEvent'
db.create_table(u'otm1_migrator_migrationevent', (
(u'id', self.... | ctaylo37/OTM2 | opentreemap/otm1_migrator/migrations/0009_auto__add_migrationevent__add_field_otm1modelrelic_migration_event__ad.py | Python | gpl-3.0 | 14,562 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | aperigault/ansible | lib/ansible/modules/cloud/google/gcp_spanner_database.py | Python | gpl-3.0 | 10,312 |
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from frappe.contacts.address_and_contact import (
delete_contact_and_address,
load_address_and_contact,
)
from frappe.model.document import Document
class Bank(Document):
def onload(self):
"""... | mhbu50/erpnext | erpnext/accounts/doctype/bank/bank.py | Python | gpl-3.0 | 466 |
import os
import sys
import cPickle
import numpy as np
import matplotlib.pyplot as plt
# PARAMS
filename = "/home/sforesti/ros/home/ros/Repos/NIPS2016/ros/nips2016/logs/experiment.pickle"
filename = "/home/sforesti/ros/home/ros/Repos/NIPS2016/ros/nips2016/logs/experiment_FGB_4.pickle"
with open(filename, 'r') as f:
... | sebastien-forestier/NIPS2017 | scripts/analyze_ergo_ball.py | Python | gpl-3.0 | 1,902 |
from django.test import SimpleTestCase
from osgeo_importer.inspectors import OGRInspector, GDALInspector
from osgeo_importer.utils import NoDataSourceFound
import logging
def check_inspector_open_bad_connection(test_case, InspectorClass):
""" Checks that InspectorClass.open() raises NoDataSourceFound if connectio... | davisc/django-osgeo-importer | osgeo_importer/tests/test_inspectors.py | Python | gpl-3.0 | 1,128 |
from __future__ import absolute_import
from .gene.homology import *
| ales-erjavec/orange-bio | orangecontrib/bio/obiHomoloGene.py | Python | gpl-3.0 | 69 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 VT SuperDARN Lab
# Full license can be found in LICENSE.txt
"""Ray tracing for SuperDARN (raydarn)
This module wraps the ray-tracing coupled with IRI and IGRF
Modules
--------------------------------
raydarn.rt interfacing run code
--------------------------------
"""
i... | aburrell/davitpy | davitpy/models/raydarn/__init__.py | Python | gpl-3.0 | 447 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para descargaya
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core i... | CarlosCondor/pelisalacarta-xbmc-plus | pelisalacarta/channels/descargaya.py | Python | gpl-3.0 | 4,940 |
# 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/.
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from page import Page,... | jpetto/bedrock | tests/pages/base.py | Python | mpl-2.0 | 3,446 |
from django.contrib import admin
from account.models import SignupCode, AccountDeletion, Account, EmailAddress
class SignupCodeAdmin(admin.ModelAdmin):
list_display = ["code", "max_uses", "use_count", "expiry", "created"]
search_fields = ["code", "email"]
list_filter = ["created"]
admin.site.register(S... | thierrymarianne/valuenetwork | account/admin.py | Python | agpl-3.0 | 562 |
#!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-
#
# NetProfile: WebDAV value objects
# © Copyright 2013 Alex 'Unik' Unigovsky
#
# This file is part of NetProfile.
# NetProfile is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public
#... | nikitos/npui | netprofile/netprofile/dav/values.py | Python | agpl-3.0 | 5,252 |
# Copyright 2013-2020 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)
from spack import *
class DependencyInstall(Package):
"""Dependency which has a working install method"""
homep... | iulian787/spack | var/spack/repos/builtin.mock/packages/dependency-install/package.py | Python | lgpl-2.1 | 560 |
from StandardModules import *
##########################################################################
#
# QGIS-meshing plugins.
#
# Copyright (C) 2012-2013 Imperial College London and others.
#
# Please see the AUTHORS file in the main source directory for a
# full list of copyright holders.
#
# Dr Ada... | adamcandy/QGIS-Meshing | extras/raster_tools/RastorTools.py | Python | lgpl-2.1 | 2,743 |
#
# RPC client implementation
#
import logging
import xem_rpc
class _rpc_proxy_caller:
def __init__(self, sk, typ, fname):
self._rpc_sk = sk
self._fn_typ = typ
self._fn_name = fname
def __call__(self, *args):
call = (self._fn_typ, self._fn_name, args)
raw_data = repr(call)
self._rpc_sk.send(raw_data)
... | arthurlockman/p.haul | phaul/xem_rpc_client.py | Python | lgpl-2.1 | 838 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This file is part of the prometeo project.
This program 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... | zuck/prometeo-erp | settings/addressing.py | Python | lgpl-3.0 | 1,358 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
import logging
import unittest
class BaseTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
logging.captureWarnings(... | mnubo/kubernetes-py | tests/BaseTest.py | Python | apache-2.0 | 469 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 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... | takeshineshiro/nova | nova/tests/functional/v3/test_security_groups.py | Python | apache-2.0 | 7,411 |
import sys
import time
import pkg_resources
import Image
import tg
from pylons import c
from paste.deploy.converters import asint
from ming.orm import mapper, ThreadLocalORMSession, session, state, Mapper
from allura.command import base
import forgetracker.model
class RethumbCommand(base.Command):
min_args=1
... | pombredanne/SourceForge-Allura | scripts/rethumb.py | Python | apache-2.0 | 4,935 |
"""Support for showing the date and the time."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_DISPLAY_OPTIONS
from homeassistant.core import callback
import homeassistant.helpers.co... | kennedyshead/home-assistant | homeassistant/components/time_date/sensor.py | Python | apache-2.0 | 5,188 |
#
# 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/authentication/authenticationsamlaction.py | Python | apache-2.0 | 45,780 |
'''
'''
def main():
info('Pump Microbone')
if is_closed('A'):
open(description= 'F')
sleep(1)
close(description= 'CO2 Laser to Roughing')
close(description= 'Microbone to Minibone')
open(description= 'Microbone to Turbo')
open(description= 'Microbone to Getter NP-10H')
... | USGSDenverPychron/pychron | docs/user_guide/operation/scripts/examples/helix/post_equilibration/felix/PumpMicrobone.py | Python | apache-2.0 | 602 |
# 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... | DinoCow/airflow | tests/airflow_pylint/do_not_use_asserts.py | Python | apache-2.0 | 1,435 |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import subprocess
import io
import os
"""
IBM Streams utilities using `streamtool`.
Requires a local IBM Streams installation
located by the environment varible `STREAMS_INSTALL`.
"""
if 'STREAMS_INSTALL' in os.environ:
_install = os... | ddebrunner/streamsx.topology | test/python/spl/tk17/opt/.__splpy/packages/streamsx/st.py | Python | apache-2.0 | 1,369 |
# 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... | jostep/tensorflow | tensorflow/python/eager/tensor.py | Python | apache-2.0 | 1,671 |
# 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... | anand-c-goog/tensorflow | tensorflow/contrib/distributions/python/ops/distribution.py | Python | apache-2.0 | 32,993 |
#
# 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... | dhalperi/beam | sdks/python/apache_beam/io/gcp/datastore/v1/datastoreio_test.py | Python | apache-2.0 | 10,317 |
# Copyright (c) 2014-2018 The Khronos Group Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and/or associated documentation files (the "Materials"),
# to deal in the Materials without restriction, including without limitation
# the rights to use, copy, modify, m... | Degryll/ZBE | extlibs/Vulkan/1.1.77.0/include/vulkan/spirv.py | Python | apache-2.0 | 31,557 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | Kami/libcloud | integration/compute/api/routes.py | Python | apache-2.0 | 1,125 |
#!/usr/bin/python
#
# Copyright 2015 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 b... | coxmediagroup/googleads-python-lib | examples/dfp/v201502/user_team_association_service/get_user_team_associations_for_user.py | Python | apache-2.0 | 2,460 |
# 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... | dmlc/tvm | python/tvm/contrib/target/onnx.py | Python | apache-2.0 | 38,598 |
"""Add things to old Pythons so I can pretend they are newer."""
# This file does lots of tricky stuff, so disable a bunch of lintisms.
# pylint: disable=F0401,W0611,W0622
# F0401: Unable to import blah
# W0611: Unused import blah
# W0622: Redefining built-in blah
import os, sys
# Python 2.3 doesn't have `set`
try:
... | akiokio/centralfitestoque | src/.pycharm_helpers/coverage/backward.py | Python | bsd-2-clause | 2,838 |
# -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from django.conf import settings
class Migration(SchemaMigration):
def forwards(self, orm):
if not db.dry_run:
# For permissions to work properly after migrating
orm['contenttypes.contenttype'].ob... | johan--/Geotrek | geotrek/tourism/migrations/0004_auto__add_informationdesktype__add_informationdesk.py | Python | bsd-2-clause | 4,793 |
"""
This module houses a utility class for mocking deprecated modules.
It is for internal use only and should not be used beyond this purpose.
"""
import importlib
import warnings
class _DeprecatedModule(object):
""" Class for mocking deprecated modules.
Parameters
----------
deprmod : name of modul... | GuessWhoSamFoo/pandas | pandas/util/_depr_module.py | Python | bsd-3-clause | 3,574 |
"""Kernel Principal Components Analysis."""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Sylvain Marie <sylvain.marie@schneider-electric.com>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from scipy.sparse.linalg import eigsh
from ..utils._arpack import _init_arpack_v0
from ..util... | shyamalschandra/scikit-learn | sklearn/decomposition/_kernel_pca.py | Python | bsd-3-clause | 19,479 |
import os
from io import BytesIO
from six.moves.urllib.parse import urlparse
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.internet import defer
from w3lib.url import path_to_file_uri
from scrapy.spider import Spider
from scrapy.contrib.feedexport import IFeedStorage, ... | devGregA/code | scrapy/tests/test_contrib_feedexport.py | Python | bsd-3-clause | 3,563 |
# 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 os
import sys
from telemetry import benchmark
from telemetry.core import util
from telemetry.core import wpr_modes
from telemetry import decorators
f... | mou4e/zirconium | tools/telemetry/telemetry/page/record_wpr_unittest.py | Python | bsd-3-clause | 7,891 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-17 07:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('django_chatterbot', '0005_stateme... | Gustavo6046/ChatterBot | chatterbot/ext/django_chatterbot/migrations/0006_create_conversation.py | Python | bsd-3-clause | 1,113 |
# -*- coding: utf-8 -*-
__docformat__='restructuredtext'
from formencode import Schema
import popserver.validators as v
from datetime import datetime
#from popserver.model import Country
from popserver.model import User
usernameValidator = v.Regex(r'^[a-zA-Z0-9_.-]+$', not_empty=True, strip=True)
passwordValidator =... | santisiri/popego | popego/popserver/popserver/forms.py | Python | bsd-3-clause | 2,275 |
##########################################################################
#
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | hradec/gaffer | python/GafferUI/PathVectorDataPlugValueWidget.py | Python | bsd-3-clause | 4,053 |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from blinkpy.common.host_mock import MockHost
from blinkpy.common.system.executive import ScriptError
from blinkpy.common.system.executive_m... | scheib/chromium | third_party/blink/tools/blinkpy/w3c/wpt_manifest_unittest.py | Python | bsd-3-clause | 8,914 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import pipes
import sys
import time
from telemetry.core import exceptions
from telemetry.core import forwarders
from telemetry.core import ut... | sgraham/nope | tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py | Python | bsd-3-clause | 6,669 |
# -*- coding: utf-8 -*-
"""Ordering Points To Identify the Clustering Structure (OPTICS)
These routines execute the OPTICS algorithm, and implement various
cluster extraction methods of the ordered list.
Authors: Shane Grigsby <refuge@rocktalus.com>
Adrin Jalali <adrinjalali@gmail.com>
Erich Schuber... | sergeyf/scikit-learn | sklearn/cluster/_optics.py | Python | bsd-3-clause | 38,551 |
import numpy as np
from . import is_scalar_nan
from .fixes import _object_dtype_isnan
def _get_mask(X, value_to_mask):
"""Compute the boolean mask X == value_to_mask."""
if is_scalar_nan(value_to_mask):
if X.dtype.kind == "f":
return np.isnan(X)
elif X.dtype.kind in ("i", "u"):
... | bnaul/scikit-learn | sklearn/utils/_mask.py | Python | bsd-3-clause | 570 |
#!/usr/bin/env python3.5
import unittest
from neuralmonkey.evaluators.ter import TER
from neuralmonkey.tests.test_bleu import DECODED, REFERENCE
class TestBLEU(unittest.TestCase):
def test_empty_decoded(self):
self.assertEqual(TER([[] for _ in DECODED], REFERENCE), 1.0)
def test_empty_reference(se... | bastings/neuralmonkey | neuralmonkey/tests/test_ter.py | Python | bsd-3-clause | 892 |
import os
import shutil
import sys
import tempfile
import unittest
from attic.platform import acl_get, acl_set
from attic.testsuite import AtticTestCase
ACCESS_ACL = """
user::rw-
user:root:rw-:0
user:9999:r--:9999
group::r--
group:root:r--:0
group:9999:r--:9999
mask::rw-
other::r--
""".strip().encode('ascii')
DEFAU... | pombredanne/attic | attic/testsuite/platform.py | Python | bsd-3-clause | 4,191 |
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import errno
import os.path
from IPython.config.application import Application
from IPython.core.application import (
BaseIPythonApplication, base_flags, base_aliases
)
from IPython.utils.traitlets import Instanc... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/kernel/kernelspecapp.py | Python | mit | 5,112 |
try:
from django_mongoengine import Document
except ImportError:
from mongoengine import Document
from mongoengine import StringField, IntField
from mongoengine import EmbeddedDocument
from django.conf import settings
from crits.core.crits_mongoengine import CritsBaseAttributes, CritsSourceDocument
from crits.core.... | Magicked/crits | crits/pcaps/pcap.py | Python | mit | 4,614 |
"""
Make sure to check out the TwiML overview and tutorial
"""
import xml.etree.ElementTree as ET
class TwimlException(Exception):
pass
class Verb(object):
"""Twilio basic verb object.
"""
def __init__(self, **kwargs):
self.name = self.__class__.__name__
self.body = None
sel... | gtracy/math-facts | twilio/twiml.py | Python | mit | 14,144 |
# coding=utf-8
import json
from django.test import TestCase
from mock import Mock
from silk.model_factory import RequestModelFactory, ResponseModelFactory
DJANGO_META_CONTENT_TYPE = 'CONTENT_TYPE'
HTTP_CONTENT_TYPE = 'Content-Type'
class TestEncodingForRequests(TestCase):
"""
Check that the RequestModelFac... | CloudNcodeInc/silk | tests/tests/test_encoding.py | Python | mit | 5,854 |
class IncorrectParametersException(Exception):
pass
class APIErrorException(Exception):
pass
| thurask/soccer-cli | soccer/exceptions.py | Python | mit | 103 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import sys
from antlr4 import *
from antlr4.InputStream import InputStream
from antlr4.error.ErrorStrategy import DefaultErrorStrategy
from UnitXLexer import UnitXLexer
from UnitXParser import UnitXParser
from eval_visitor import EvalVisitor
from eval_error_strategy import ... | 0ED/UnitX | unitx/example.py | Python | mit | 6,946 |
# -*- coding: utf-8 -*-
"""
Defines the settings class for ICgen
USAGE:
Load settings from file:
import ICgen_settings
settings = ICgen_settings.settings('filename')
Load settings from defaults (Defined in ICgen_settings.py):
import ICgen_settings
settings = ICgen_settings.settings()
AFTER... | dflemin3/ICgen | backup03/ICgen_settings.py | Python | mit | 8,726 |
# Copyright (c) 2009-2011 Denis Bilenko. See LICENSE for details.
"""Managing greenlets in a group.
The :class:`Group` class in this module abstracts a group of running greenlets.
When a greenlet dies, it's automatically removed from the group.
The :class:`Pool` which a subclass of :class:`Group` provides a way to li... | ubuntuvim/GoAgent | local/gevent-1.0rc2/gevent/pool.py | Python | mit | 12,306 |
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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, ... | lnielsen/invenio | invenio/legacy/websubmit/web/yourapprovals.py | Python | gpl-2.0 | 4,595 |
"""test string format error
"""
__revision__ = 1
PARG_1 = PARG_2 = PARG_3 = 1
def pprint():
"""Test string format
"""
print "%s %s" % {'PARG_1': 1, 'PARG_2': 2} # E1306
print "%s" % (PARG_1, PARG_2) # E1305
print "%(PARG_1)d %d" % {'PARG_1': 1, 'PARG_2': 2} # E1302
print "%(PARG_1)d %(PARG_2)... | godfryd/pylint | test/input/func_e13xx.py | Python | gpl-2.0 | 661 |
# Copyright (C) 2016-2020 Free Software Foundation, 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 License, or
# (at your option) any later version.
#
# This prog... | mattstock/binutils-bexkat1 | gdb/testsuite/gdb.python/py-breakpoint-create-fail.py | Python | gpl-2.0 | 969 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | tomsilver/nupic | tests/swarming/nupic/swarming/experiments/max_branching_temporal/permutations.py | Python | gpl-3.0 | 6,015 |
# MAC Changer: IEEE OUI "parser"
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2002,2003,2013 Alvaro Lopez Ortega
#
# 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... | alpha14/macchanger | tools/IEEE_OUI.py | Python | gpl-3.0 | 2,033 |
HOST = "ip-172-31-29-102.us-west-2.compute.internal:27017,ip-172-31-29-103.us-west-2.compute.internal:27017,ip-172-31-29-104.us-west-2.compute.internal:27017,ip-172-31-29-105.us-west-2.compute.internal:27017,ip-172-31-29-101.us-west-2.compute.internal:27017,ip-172-31-29-106.us-west-2.compute.internal:27017,ip-172-31-29... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1A/instances/11_2_workflow_full_10files_secondary_wmj_3sh_3rs_with_annot_with_proj_3s_hash/work/ubuntu/pegasus/example_workflow/20161109T024901+0000/ConfigDB_GeneralInfo_0.py | Python | gpl-3.0 | 838 |
#!/usr/bin/env python
# encoding: utf-8
"""
Waf tool for PX4 build
"""
from waflib import Errors, Logs, Task, Utils
from waflib.TaskGen import after_method, before_method, feature
import os
import shutil
import sys
_dynamic_env_data = {}
def _load_dynamic_env_data(bld):
bldnode = bld.bldnode.make_node('modules/... | phoneguy/ardupilot | Tools/ardupilotwaf/px4.py | Python | gpl-3.0 | 11,093 |
import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo8-addons-oca-project",
description="Meta package for oca-project Odoo addons",
version=version,
install_requires=[
'odoo8-addon-project_analytic_line_view',
'odoo8-addon-pro... | ddico/project | setup/_metapackage/setup.py | Python | agpl-3.0 | 1,691 |
# -*- coding: utf-8 -*-
import os
import re
import sys
from pyflakes.scripts import pyflakes
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
class Reporter(object):
def add_arguments(self, parser):
parser.add_argument("--pyflakes-exclude-dir",
... | orbitvu/django-jenkins | django_jenkins/tasks/run_pyflakes.py | Python | lgpl-3.0 | 1,816 |