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 |
|---|---|---|---|---|---|
# 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 ... | SUSE/azure-sdk-for-python | azure-batch/azure/batch/models/schedule.py | Python | mit | 4,205 |
# -*- coding: utf-8 -*-
#
# CampbellSiegert.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License... | INM-6/nest-git-migration | pynest/examples/CampbellSiegert.py | Python | gpl-2.0 | 5,481 |
"""
inotify logs filesystem activity that may be directly or indirectly caused
by the test that is running. It requires the inotify-tools package, more
specifically, the inotifywait tool.
Heavily inspired / shamelessly copied from the kvm_stat profiler.
:copyright: Red Hat 2013
:author: Cleber Rosa <cleber@redhat.com... | lmr/autotest | client/profilers/inotify/inotify.py | Python | gpl-2.0 | 2,298 |
from resources.lib.handler.requestHandler import cRequestHandler
from resources.lib.util import cUtil
from resources.lib.parser import cParser
from resources.lib.gui.gui import cGui
from resources.hosters.hoster import iHoster
import urllib
class cHoster(iHoster):
def __init__(self):
self.__sDisplayName =... | mino60/venom-xbmc-addons-beta | plugin.video.vstream/resources/hosters/videoweed.py | Python | gpl-2.0 | 2,917 |
from django.conf.urls.defaults import patterns, include, url
from django.contrib.auth.decorators import login_required
from views import (OrganizationAdminView,
CustomOrganizationCreate,
CustomOrganizationDetail,
CustomOrganizationUpdate,
CustomOrg... | aptivate/econsensus | django/econsensus/custom_organizations/urls.py | Python | gpl-3.0 | 2,276 |
from __future__ import absolute_import
import re
from django.http import HttpResponseRedirect
from django.conf import settings
from ..settings import ALLOW_ANONYMOUS_ACCESS
EXEMPT_URLS = [re.compile(settings.LOGIN_URL.lstrip('/'))]
if hasattr(settings, 'LOGIN_EXEMPT_URLS'):
EXEMPT_URLS += [re.compile(expr) for ... | rosarior/rua | rua/apps/common/middleware/login_required_middleware.py | Python | gpl-3.0 | 1,503 |
"""Tests for events.py."""
import functools
import gc
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
from unittest import mock
import weakref
import... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_asyncio/test_events.py | Python | gpl-3.0 | 93,815 |
import networkx as nx
from networkx import is_strongly_regular
class TestDistanceRegular:
def test_is_distance_regular(self):
assert nx.is_distance_regular(nx.icosahedral_graph())
assert nx.is_distance_regular(nx.petersen_graph())
assert nx.is_distance_regular(nx.cubical_graph())
a... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/tests/test_distance_regular.py | Python | gpl-3.0 | 2,312 |
#
# 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 complet... | cherusk/ansible | lib/ansible/module_utils/nxos.py | Python | gpl-3.0 | 12,867 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | QijunPan/ansible | lib/ansible/plugins/action/normal.py | Python | gpl-3.0 | 1,962 |
#
# Copyright 2010-2012 Fabric Engine Inc. All rights reserved.
#
import fabric
client = fabric.createClient()
cv = client.MR.createConstValue("Size", 100)
ago = client.KLC.createArrayGeneratorOperator("foo.kl", "operator foo(io Float64 output, Size index) { output = Float64(index+1); }", "foo")
ag = client.MR.cre... | ghostx2013/FabricEngine_Backup | Native/Test/Python/mr-sum.py | Python | agpl-3.0 | 932 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | proyectos-analizo-info/pybossa-analizo-info | test/test_util.py | Python | agpl-3.0 | 6,074 |
""" parser to generate SAX events from a DOM tree
$Date: 2002/05/02 10:15:04 $ by $Author: loewis $
"""
from pyxml.sax._exceptions import SAXNotSupportedException, SAXNotRecognizedException
from pyxml.sax.xmlreader import XMLReader, AttributesNSImpl, AttributesImpl
from pyxml.sax.saxlib import LexicalHandler, DeclHa... | selfcommit/gaedav | pyxml/dom/ext/Dom2Sax.py | Python | lgpl-2.1 | 11,076 |
# -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
import math
import Box2D as box2d
from pilasengine.depurador.modo import ModoDepurador
from pilas... | hgdeoro/pilas | pilasengine/depurador/modo_fisica.py | Python | lgpl-3.0 | 4,211 |
'''
A collection of tools to assist in analyzing encrypted blobs of data
through chosen plaintext attacks.
Copyright (C) 2011-2012 Virtual Security Research, LLC
Author: Timothy D. Morgan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Licens... | umeboshi2/bletchley | lib/bletchley/chosen.py | Python | lgpl-3.0 | 2,851 |
"""helper for quick cross-platform makefile for sphinx
TODO: this was hacked up really quickly, could use lots of work.
"""
#===============================================================
#imports
#===============================================================
#core
import logging; log = logging.getLogger(__name__)
... | loriab/qcdb | docs/source/cloud_sptheme/make_helper.py | Python | lgpl-3.0 | 8,496 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_parse_qs,
compat_urllib_parse_unquote,
compat_urllib_parse_urlparse,
)
from ..utils import (
dict_get,
ExtractorError,
float_or_none,
int_... | rg3/youtube-dl | youtube_dl/extractor/twitter.py | Python | unlicense | 28,035 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | cloudant/couchdb-mango | test/05-index-selection-test.py | Python | apache-2.0 | 6,472 |
# 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... | chemelnucfin/tensorflow | tensorflow/python/tpu/datasets.py | Python | apache-2.0 | 7,774 |
"""
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 this ... | arenadata/ambari | ambari-server/src/main/resources/stacks/ADH/1.4/services/LOGSEARCH/package/scripts/logsearch_common.py | Python | apache-2.0 | 2,098 |
# Copyright 2018 ARM Limited
#
# 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 writin... | setrofim/workload-automation | wa/framework/configuration/execution.py | Python | apache-2.0 | 8,536 |
# 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... | rabipanda/tensorflow | tensorflow/python/keras/_impl/keras/datasets/cifar10.py | Python | apache-2.0 | 2,091 |
# Copyright 2013 OpenStack Foundation.
# 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 req... | apporc/cinder | cinder/brick/local_dev/lvm.py | Python | apache-2.0 | 30,849 |
"""The tests for hls streams."""
from datetime import timedelta
from urllib.parse import urlparse
import pytest
from homeassistant.components.stream import request_stream
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.common import async_fire_time_changed
fro... | leppa/home-assistant | tests/components/stream/test_hls.py | Python | apache-2.0 | 3,295 |
# Copyright 2013 Metacloud, 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 writ... | roopali8/keystone | keystone/common/kvs/core.py | Python | apache-2.0 | 17,459 |
# Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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 requi... | evewspace/eve-wspace | evewspace/POS/models.py | Python | apache-2.0 | 11,294 |
import QuestClass
import requests
import QuestParser
import time
from bs4 import BeautifulSoup
# from QuestClass import QuestSession
# Graduate URLs
myAcademicsGraduateURL = "https://quest.pecs.uwaterloo.ca/psc/SS/ACADEMIC/HRMS/c/UW_SS_MENU.UW_SS_MYPROG_GRD.GBL"
myAcademicsGraduateGradesURL_HRMS = "https://quest.pecs... | honghaoz/UWQuestAPI | uw-quest/UWQuestAPI/MyAcademics.py | Python | apache-2.0 | 13,140 |
# For detailed comments on animation and the techniqes used here, see
# the wiki entry
# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
# The number of blits() to make before exiting
NBLITS = 1000
import matplotlib
matplotlib.use('WXAgg')
matplotlib.rcParams['toolbar'] = 'None'
import wx
import sys
... | sniemi/SamPy | sandbox/src1/examples/animation_blit_wx.py | Python | bsd-2-clause | 1,914 |
import copy
import threading
import time
import warnings
from collections import deque
from contextlib import contextmanager
import _thread
import pytz
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import utils
f... | fenginx/django | django/db/backends/base/base.py | Python | bsd-3-clause | 24,322 |
from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import ProjectDSymFile, GlobalDSymFile
@register(ProjectDSymFile)
@register(GlobalDSymFile)
class DSymFileSerializer(Serializer):
def serialize(self, obj, attrs, user):
d = {
... | alexm92/sentry | src/sentry/api/serializers/models/dsym_file.py | Python | bsd-3-clause | 697 |
"""Main test file for the pyrabbit Client."""
import json
try:
#python 2.x
import unittest2 as unittest
except ImportError:
#python 3.x
import unittest
import sys
sys.path.append('..')
import pyrabbit
from mock import Mock, patch
class TestClient(unittest.TestCase):
def setUp(self):
self... | vshn/pyrabbit-debian | tests/test_pyrabbit.py | Python | bsd-3-clause | 12,041 |
from braintree.attribute_getter import AttributeGetter
class FundingDetails(AttributeGetter):
detail_list = [
"account_number_last_4",
"routing_number",
"destination",
"email",
"mobile_phone",
]
def __init__(self, attributes):
AttributeGetter.__init__(self, ... | DiptoDas8/Biponi | lib/python2.7/site-packages/braintree/merchant_account/funding_details.py | Python | mit | 427 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-search/azure/mgmt/search/models/check_name_availability_input.py | Python | mit | 1,521 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import os
import time
import redis
from functools import wraps
from frappe.utils import get_site_path
from frappe import... | indictranstech/reciphergroup-frappe | frappe/async.py | Python | mit | 7,083 |
'''Simple data loader module.
Loads data files from the "data" directory shipped with a game.
Enhancing this to handle caching etc. is left as an exercise for the reader.
'''
import os
data_py = os.path.abspath(os.path.dirname(__file__))
data_dir = os.path.normpath(os.path.join(data_py, '..', 'data'))
def filepath... | rozifus/TeamStrong14_5 | old_gamelib/data.py | Python | gpl-2.0 | 633 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_shannon.py
----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
***************************... | CS-SI/QGIS | python/plugins/processing/algs/grass7/ext/r_li_shannon.py | Python | gpl-2.0 | 1,374 |
# -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free S... | lmcro/webserver | admin/plugins/common.py | Python | gpl-2.0 | 1,972 |
#! /usr/bin/env python
# src-sniff.py: checks source code for patterns that look like common errors.
# Copyright (C) 2007, 2010, 2011 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 Fr... | krichter722/findutils | build-aux/src-sniff.py | Python | gpl-3.0 | 10,412 |
from ete3 import Tree, TextFace, NodeStyle, TreeStyle
t = Tree("((a,b),c);")
right_c0_r0 = TextFace("right_col0_row0")
right_c0_r1 = TextFace("right_col0_row1")
right_c1_r0 = TextFace("right_col1_row0")
right_c1_r1 = TextFace("right_col1_row1")
right_c1_r2 = TextFace("right_col1_row2")
top_c0_r0 = TextFace("top_col0... | karrtikr/ete | sdoc/face_grid.py | Python | gpl-3.0 | 2,223 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
("subtitles", "0015_auto__chg_field_subtitleversion_serialized_subtitles"),
)
def forwards(self, orm):
# Adding fie... | norayr/unisubs | apps/videos/migrations/0152_auto__add_field_action_new_language.py | Python | agpl-3.0 | 33,110 |
# Generated by Django 1.11.23 on 2019-08-25 16:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import opaque_keys.edx.django.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MO... | edx/edx-platform | openedx/core/djangoapps/video_config/migrations/0008_courseyoutubeblockedflag.py | Python | agpl-3.0 | 1,257 |
# 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)
from spack import *
class Gearshifft(CMakePackage):
"""Benchmark Suite for Heterogenuous FFT Implementations"""
... | LLNL/spack | var/spack/repos/builtin/packages/gearshifft/package.py | Python | lgpl-2.1 | 2,768 |
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"Base for c programs/libraries"
import os
import TaskGen, Build, Utils, Task
from Logs import debug
import ccroot
from TaskGen import feature, before, extension, after
g_cc_flag_vars = [
'CCDEPS', 'FRAMEWORK', 'FRAMEWORKPATH',
'STATICLIB', 'LIB', 'LIB... | oneman/xmms2-oneman-old | wafadmin/Tools/cc.py | Python | lgpl-2.1 | 2,882 |
# 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)
from spack import *
class RBayesm(RPackage):
"""Bayesian Inference for Marketing/Micro-Econometrics
Covers many... | LLNL/spack | var/spack/repos/builtin/packages/r-bayesm/package.py | Python | lgpl-2.1 | 2,588 |
# SU2/opt/__init__.py
from project import Project
from scipy_tools import scipy_slsqp as SLSQP
from scipy_tools import scipy_cg as CG
from scipy_tools import scipy_bfgs as BFGS
from scipy_tools import scipy_powell as POWELL
| pawhewitt/Dev | SU2_PY/SU2/opt/__init__.py | Python | lgpl-2.1 | 225 |
{
'name' : 'Discount for total amount of pos order',
'version' : '1.0.0',
'author' : 'Ivan Yelizariev',
'category' : 'Point Of Sale',
'website' : 'https://yelizariev.github.io',
'price': 9.00,
'currency': 'EUR',
'depends' : ['point_of_sale'],
'data':[
'data.xml',
],
... | tymiles003/pos-addons | pos_discount_total/__openerp__.py | Python | lgpl-3.0 | 373 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Li... | AnshulYADAV007/Lean | Algorithm.Python/MarginCallEventsAlgorithm.py | Python | apache-2.0 | 3,908 |
"""Auto-generated file, do not edit by hand. KE metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KE = PhoneMetadata(id='KE', country_code=254, international_prefix='000',
general_desc=PhoneNumberDesc(national_number_pattern='20\\d{6,7}|[4-9]\\d{6,9}', possible_num... | roubert/python-phonenumbers | python/phonenumbers/data/region_KE.py | Python | apache-2.0 | 2,224 |
import typing
MyTup1 = typing.NamedTuple("MyTup2", bar=int, baz=str)
class MyTup2(typing.NamedTuple):
bar: int
baz: str
MyTup1(1, "")._replace(<arg1>)
MyTup2(1, "")._replace(<arg2>) | goodwinnk/intellij-community | python/testData/paramInfo/TypingNamedTupleReplace.py | Python | apache-2.0 | 195 |
"""Per-prefix data, mapping each prefix to a name.
Auto-generated file, do not edit by hand.
"""
from phonenumbers.util import u
# Copyright (C) 2011-2015 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#... | dongguangming/python-phonenumbers | python/tests/testtzdata/__init__.py | Python | apache-2.0 | 835 |
# 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... | chenjun0210/tensorflow | tensorflow/contrib/factorization/python/ops/factorization_ops.py | Python | apache-2.0 | 38,639 |
#!/usr/bin/env python
# Copyright 2015, Google, 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 ... | JavaRabbit/CS496_capstone | bigquery/api/streaming.py | Python | apache-2.0 | 3,152 |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | annarev/tensorflow | tensorflow/compiler/mlir/tfr/integration/node_expansion_test.py | Python | apache-2.0 | 4,072 |
r"""
================================================================
Robust covariance estimation and Mahalanobis distances relevance
================================================================
This example shows covariance estimation with Mahalanobis
distances on Gaussian distributed data.
For Gaussian distrib... | manhhomienbienthuy/scikit-learn | examples/covariance/plot_mahalanobis_distances.py | Python | bsd-3-clause | 8,075 |
import unittest
class SampleTest(unittest.TestCase):
def test_one(self):
pass
| wfxiang08/django178 | tests/test_runner/valid_app/tests/__init__.py | Python | bsd-3-clause | 93 |
# encoding: utf-8
"""
nlri/__init__.py
Created by Thomas Mangin on 2013-08-07.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
| mshahbaz/exabgp | lib/exabgp/bgp/message/update/nlri/__init__.py | Python | bsd-3-clause | 143 |
"""
A monkeypatch for ``django.dispatch`` to send signals safely.
Usage::
>>> import safe_signals
>>> safe_signals.start_the_machine()
``django.dispatch.Signal.send`` is replaced with a safer function that catches
and logs errors. It's like ``Signal.send_robust`` but with logging.
"""
import logging
from ... | clouserw/olympia | lib/misc/safe_signals.py | Python | bsd-3-clause | 1,345 |
from __future__ import unicode_literals
import os, sys
sys.path.append('.')
sys.path.append('lib/py')
sys.path.append('erpnext')
import unittest, webnotes
from webnotes.test_runner import make_test_records
make_test_records("Profile")
class TestEmail(unittest.TestCase):
def setUp(self):
webnotes.conn.sql("""upda... | gangadhar-kadam/mic-wnframework | webnotes/tests/test_email.py | Python | mit | 2,645 |
#!/usr/bin/env python
import os
curdir = os.path.dirname(__file__)
import matplotlib as mpl
mpl.rcParams['figure.figsize'] = 12,9
from multiphonon.backward.plotutils import plot_intermediate_result_sqe as plot
plot(curdir)
from matplotlib import pyplot as plt
plt.show()
| sns-chops/multiphonon | tests/data/work-V/round-5/plot_sqe.py | Python | mit | 271 |
# Quick example of loading our data into variables
import pandas as pd
import numpy as np
# Puts tweets into a data frame
df = pd.read_csv('tweets.csv')
# Selects the first column from our data frame
target = df['is_there_an_emotion_directed_at_a_brand_or_product']
# Selects the third column from our data frame
tex... | lukas/ml-class | videos/text-classifier/load-data.py | Python | gpl-2.0 | 359 |
# Copyright 2012 the rootpy developers
# distributed under the terms of the GNU General Public License
"""
Functions useful for interfacing with C/C++ functions:
* ``callback`` => Allows you to pass ctypes CFUNCTYPE objects as parameters to
PyROOT functions
* ``objectproxy_realaddress`` => Determine the ... | mverzett/rootpy | rootpy/utils/cinterface.py | Python | gpl-3.0 | 1,146 |
#!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or... | bastibl/gnuradio | gr-blocks/python/blocks/qa_add_mult_div_sub.py | Python | gpl-3.0 | 9,642 |
# Tests for Tests for source4/dsdb/samdb/ldb_modules/password_hash.c
#
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2017
#
# 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 ... | urisimchoni/samba | python/samba/tests/password_hash_ldap.py | Python | gpl-3.0 | 4,971 |
# -*- coding: utf-8 -*-
# © 2016 Chafique DELLI @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import purchase
| factorlibre/purchase-workflow | purchase_picking_state/__init__.py | Python | agpl-3.0 | 153 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.utils import cstr, cint
from frappe import msgprint, _
from frappe.model.mapper import get_mapped_doc
from erpnext.setup... | hanselke/erpnext-1 | erpnext/crm/doctype/opportunity/opportunity.py | Python | agpl-3.0 | 7,551 |
# 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)
from spack import *
class RMlbench(RPackage):
"""A collection of artificial and real-world machine learning benchmar... | LLNL/spack | var/spack/repos/builtin/packages/r-mlbench/package.py | Python | lgpl-2.1 | 759 |
# 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 PyAiohttpCors(PythonPackage):
"""aiohttp_cors library implements Cross Origin Resource Sharing (CORS)
suppo... | LLNL/spack | var/spack/repos/builtin/packages/py-aiohttp-cors/package.py | Python | lgpl-2.1 | 827 |
from pyxb.bundles.opengis.raw.ows_1_1 import *
| CantemoInternal/pyxb | pyxb/bundles/opengis/ows_1_1.py | Python | apache-2.0 | 47 |
# 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... | tensorflow/tensorflow | tensorflow/python/platform/test.py | Python | apache-2.0 | 6,216 |
# Copyright 2017 Capital One Services, LLC
#
# 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... | taohungyang/cloud-custodian | tools/c7n_salactus/c7n_salactus/inventory.py | Python | apache-2.0 | 4,453 |
from __future__ import unicode_literals
from itertools import chain
from django.conf import settings
from django.contrib.auth import models as auth_app
from django.contrib.auth.management import create_permissions
from django.contrib.auth.models import Group, Permission, AnonymousUser
from django.contrib.contenttypes.... | TabbedOut/django-guardian | guardian/tests/core_test.py | Python | bsd-2-clause | 6,852 |
#!/usr/bin/env python
# *-* coding: UTF-8 *-*
"""
Organizaţia Internaţională a Aviaţiei Civile propune un alfabet în care
fiecărei litere îi este asignat un cuvânt pentru a evita problemele în
înțelegerea mesajelor critice.
Pentru a se păstra un istoric al conversațiilor s-a decis transcrierea lor
conform următoarelor... | iulianbute/labs | python/solutii/anda_ungureanu/from_icao.py | Python | mit | 2,123 |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/tornado/web.py | Python | mit | 125,071 |
# Natural Language Toolkit: Translation metrics
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Will Zhang <wilzzha@gmail.com>
# Guan Gui <ggui@student.unimelb.edu.au>
# Steven Bird <stevenbird1@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import div... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/translate/metrics.py | Python | mit | 1,498 |
"""
Support for the LIFX platform that implements lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.lifx/
"""
# pylint: disable=missing-docstring
import colorsys
import logging
from homeassistant.components.light import (
ATTR_BRIGHTNESS... | deisi/home-assistant | homeassistant/components/light/lifx.py | Python | mit | 8,424 |
class Singleton(object):
"""
Singleton design pattern.
"""
_instance = None
def __init__(self):
if self.__class__ is Singleton:
raise TypeError("Cannot instantiate directly.")
@classmethod
def get_instance(cls):
"""Get the class instance."""
if cls._instance is None:
cls._instance = cls()
return... | adamBrinek/tuned | tuned/tuned/patterns.py | Python | gpl-2.0 | 335 |
# -*- coding: utf-8 -*-
# code by Avigdor (https://github.com/cubicle-vdo/xbmc-israel)
import urllib, sys, xbmcplugin ,xbmcgui, xbmcaddon, xbmc, os, json
AddonID = 'plugin.video.playlistLoader'
Addon = xbmcaddon.Addon(AddonID)
AddonName = Addon.getAddonInfo("name")
icon = Addon.getAddonInfo('icon')
addonDir = Addon.g... | wndias/bc.repository | plugin.video.playlistLoader/default.py | Python | gpl-2.0 | 14,265 |
# Copyright (C) 2007-2010 Samuel Abels.
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | mpenning/exscript | src/Exscript/protocols/Telnet.py | Python | gpl-2.0 | 4,121 |
# -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2005-2007 Ali Sabil <ali.sabil@gmail.com>
# Copyright (C) 2005-2006 Ole André Vadla Ravnås <oleavr@gmail.com>
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and... | billiob/papyon | papyon/msnp/challenge.py | Python | gpl-2.0 | 2,914 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) Enrique J. Hernández 2014
# 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 l... | Zentyal/openchange | script/bug-analysis/buganalysis/mail.py | Python | gpl-3.0 | 2,084 |
# encoding: 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):
# Removing unique constraint on 'Vote', fields ['object_id', 'content_type', 'user']
db.delete_unique(u'vo... | PearsonIOKI/compose-forum | askbot/migrations/0093_auto__del_field_vote_content_type__del_field_vote_object_id__chg_field.py | Python | gpl-3.0 | 32,357 |
"""Tests for http/cookiejar.py."""
import os
import re
import test.support
import time
import unittest
import urllib.request
from http.cookiejar import (time2isoz, http2time, iso2time, time2netscape,
parse_ns_headers, join_header_words, split_header_words, Cookie,
CookieJar, DefaultCookiePolicy, LWPCookieJa... | Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_http_cookiejar.py | Python | gpl-3.0 | 73,097 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | sputnick-dev/weboob | modules/indeed/browser.py | Python | agpl-3.0 | 1,835 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2017, 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... | ywcui1990/nupic.research | projects/location_layer/single_layer_2d_experiment/runner.py | Python | agpl-3.0 | 12,574 |
# This file is part of VoltDB.
# Copyright (C) 2008-2015 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and conditions:
#
# Permission is hereby granted, free of charge, to any person obtaining
# a... | wolffcm/voltdb | lib/python/voltcli/cli.py | Python | agpl-3.0 | 28,915 |
# -*- coding: utf-8 -*-
#
# 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
... | holygits/incubator-airflow | airflow/utils/dag_processing.py | Python | apache-2.0 | 23,384 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | tpaszkowski/quantum | quantum/db/migration/alembic_migrations/versions/49332180ca96_ryu_plugin_update.py | Python | apache-2.0 | 1,687 |
# -*- coding: utf-8 -*-
__author__ = 'vahid'
| farakavco/lutino | src/lutino/caching/tests/__init__.py | Python | apache-2.0 | 45 |
# Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | brainiak/brainiak | tests/funcalign/test_srm_distributed.py | Python | apache-2.0 | 5,271 |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import tweepy
def get_oauth_file(auth_file):
try:
fh = open(auth_file, 'rt')
except IOError:
print('Could not get Twitter credentials.')
return None
lines = [l.strip() for l in fh... | jmuhlich/indra | models/rasmachine/twitter_client.py | Python | bsd-2-clause | 971 |
"""
.. _stats_cluster_sensors_2samp_spatial:
=====================================================
Spatiotemporal permutation F-test on full sensor data
=====================================================
Tests for differential evoked responses in at least
one condition using a permutation clustering test.
The Fiel... | cmoutard/mne-python | tutorials/plot_spatio_temporal_cluster_stats_sensor.py | Python | bsd-3-clause | 7,157 |
# License: BSD Style.
from ...utils import verbose
from ..utils import _data_path, _get_version, _version_doc
@verbose
def data_path(path=None, force_update=False, update_path=True, download=True,
verbose=None):
"""
Get path to local copy of the kiloword dataset.
This is the dataset from [... | olafhauk/mne-python | mne/datasets/kiloword/kiloword.py | Python | bsd-3-clause | 1,843 |
import warnings
import unittest
import sys
import os
import atexit
import numpy as np
from scipy import sparse
import pytest
from sklearn.utils.deprecation import deprecated
from sklearn.utils.metaestimators import if_delegate_has_method
from sklearn.utils._testing import (
assert_raises,
assert_warns,
... | anntzer/scikit-learn | sklearn/utils/tests/test_testing.py | Python | bsd-3-clause | 21,218 |
# Third Party Stuff
import pytest
from django.core.urlresolvers import reverse
pytestmark = pytest.mark.django_db
def test_google_analytics_rendering(client, settings):
url = reverse('pages:homepage')
response = client.get(url)
assert 'UA-MY-ID' not in response.content
settings.SITE_VARIABLES['goog... | farhaanbukhsh/junction | tests/integrations/test_google_analytics.py | Python | mit | 424 |
from math import pi
import openmc
import openmc.deplete
import matplotlib.pyplot as plt
###############################################################################
# Define materials
###############################################################################
# Instantiate some Ma... | tjlaboss/openmc | examples/pincell_depletion/run_depletion.py | Python | mit | 5,021 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | dsiddharth/access-keys | keystone/contrib/oauth1/migrate_repo/versions/001_add_oauth_tables.py | Python | apache-2.0 | 2,918 |
#!/usr/bin/env python
#
# 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
# ... | ted-ross/qpid-dispatch | tools/scraper/common.py | Python | apache-2.0 | 7,279 |
# 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... | eadgarchen/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy.py | Python | apache-2.0 | 11,260 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, Inc.
# All rights reserved.
"""
Views for managing volumes.
"""
from django.conf import settings # noqa
from django.core.urlresolvers import reverse # noqa
from django.forms import ValidationError # noqa
from django.template.defaultfilters impor... | Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/volumes/forms.py | Python | apache-2.0 | 14,674 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
import sys
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTes... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_optimize09.py | Python | bsd-2-clause | 1,168 |