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 |
|---|---|---|---|---|---|
import pytest
import requests
import time
from threading import Thread
from bottle import default_app, WSGIRefServer
from tomviz.acquisition import server
class Server(Thread):
def __init__(self, dev=False, port=9999):
super(Server, self).__init__()
self.host = 'localhost'
self.port = por... | cjh1/tomviz | acquisition/tests/conftest.py | Python | bsd-3-clause | 1,440 |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from requests import RequestException
from flexget import plugin
from flexget.event import event
from flexget.utils import json
from flexget.utils.template impo... | oxc/Flexget | flexget/plugins/output/rapidpush.py | Python | mit | 6,452 |
# encoding: utf-8
"""
lxml custom element classes for core properties-related XML elements.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import re
from datetime import datetime, timedelta
from . import parse_xml
from .ns import nsdecls, qn
from .xmlchemy import Bas... | biggihs/python-pptx | pptx/oxml/coreprops.py | Python | mit | 9,971 |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permissio
"""
import logging
from sleekxmpp.stanza import Message, Error, StreamFeatures
from sleekxmpp.xmlstream import register_stanza_plugi... | Gehn/JustAChatBot | sleekxmpp/plugins/xep_0079/amp.py | Python | mit | 2,578 |
###
# *******************************************************************************
# * Copyright (c) 2011, 2016 Diamond Light Source Ltd.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribut... | IanMayo/january | org.eclipse.january/src/org/eclipse/january/dataset/internal/template/markers.py | Python | epl-1.0 | 12,983 |
##
# Copyright 2012-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | hajgato/easybuild-easyblocks | setup.py | Python | gpl-2.0 | 3,586 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 of the
# License, or (at your option) any later... | quantifiedcode-bot/invenio-base | tests/test_apps/flash_msg/views.py | Python | gpl-2.0 | 1,351 |
from django.db import models
from django import forms
class installed(models.Model):
name = models.CharField(max_length=300)
active = models.CharField(max_length=300)
class vectors(models.Model):
name = models.CharField(max_length=300)
active = models.CharField(max_len... | 0sm0s1z/subterfuge | modules/models.py | Python | gpl-3.0 | 1,614 |
# (c) 2012-2014, 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) an... | matburt/ansible | lib/ansible/playbook/block.py | Python | gpl-3.0 | 14,056 |
#!/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/.
from pypom import Region
from selenium.webdriver.common.by import By
from pages.base_page import ... | Tayamarn/socorro | e2e-tests/pages/crash_report_page.py | Python | mpl-2.0 | 2,049 |
#!/usr/bin/env python
"""Wrapper script for running jobs in TaskCluster
This is intended for running test jobs in TaskCluster. The script
takes a two positional arguments which are the name of the test job
and the script to actually run.
The name of the test job is used to determine whether the script should be run
... | pyfisch/servo | tests/wpt/web-platform-tests/tools/ci/run_tc.py | Python | mpl-2.0 | 9,392 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | cgstudiomap/cgstudiomap | main/parts/geospatial/geoengine_partner/__openerp__.py | Python | agpl-3.0 | 1,309 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | ovnicraft/odoo_addons | smile_base/models/ir_values.py | Python | agpl-3.0 | 4,447 |
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program 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 op... | ofer43211/unisubs | apps/teams/search_indexes.py | Python | agpl-3.0 | 6,266 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... | sysadminmatmoz/ingadhoc | stock_multic_fix/__openerp__.py | Python | agpl-3.0 | 1,568 |
from datetime import datetime
from sqlalchemy import *
from migrate import *
meta = MetaData()
user_table = Table('user', meta,
Column('id', Integer, primary_key=True),
Column('user_name', Unicode(255), nullable=False, unique=True, index=True),
Column('display_name', Unicode(255), nullable=True, index=Tr... | phihag/adhocracy | src/adhocracy/migration/versions/001_Initial.py | Python | agpl-3.0 | 10,657 |
# 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 PyAzureKeyvaultSecrets(PythonPackage):
"""Microsoft Azure Key Vault Secrets Client Library for Python."""
... | LLNL/spack | var/spack/repos/builtin/packages/py-azure-keyvault-secrets/package.py | Python | lgpl-2.1 | 996 |
"""
This file is boilerplate generated by Alembic; see the alembic
documentation for more information:
https://alembic.readthedocs.org/en/latest/
The Flask-Migrate extension may also be of interest:
https://flask-migrate.readthedocs.org/en/latest/
"""
from __future__ import with_statement
from alembic import context... | SahilTikale/haas | hil/migrations/env.py | Python | apache-2.0 | 3,211 |
# Copyright (c) 2018 PaddlePaddle 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 app... | chengduoZH/Paddle | python/paddle/fluid/inferencer.py | Python | apache-2.0 | 685 |
#!/usr/bin/env python
# pip installs packages in editable mode using pip_install.py
#
# cryptography is currently using this script in their CI at
# https://github.com/pyca/cryptography/blob/a02fdd60d98273ca34427235c4ca96687a12b239/.travis/downstream.d/certbot.sh#L8-L9.
# We should try to remember to keep their repo up... | letsencrypt/letsencrypt | tools/pip_install_editable.py | Python | apache-2.0 | 629 |
"""Support for HomematicIP Cloud devices."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers impor... | jawilson/home-assistant | homeassistant/components/homematicip_cloud/__init__.py | Python | apache-2.0 | 4,501 |
import paddle.v2 as paddle
__all__ = ['googlenet']
def inception(name, input, channels, filter1, filter3R, filter3, filter5R,
filter5, proj):
cov1 = paddle.layer.img_conv(
name=name + '_1',
input=input,
filter_size=1,
num_channels=channels,
num_filters=filter... | kuke/models | legacy/image_classification/googlenet.py | Python | apache-2.0 | 5,341 |
'''
Test proxy serving stale content when DNS lookup fails
'''
# 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 un... | duke8253/trafficserver | tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py | Python | apache-2.0 | 3,341 |
#
# 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... | ErnieAllen/qpid-dispatch | tests/friendship_server.py | Python | apache-2.0 | 3,531 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | manasapte/pants | tests/python/pants_test/backend/jvm/tasks/jvm_binary_task_test_base.py | Python | apache-2.0 | 3,154 |
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..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 Licens... | daodaoliang/python-phonenumbers | python/phonenumbers/geodata/data9.py | Python | apache-2.0 | 912,681 |
# coding=utf-8
__author__ = 'Rizky Maulana Nugraha "lucernae" <lana.pcfre@gmail.com>'
__date__ = '02/09/15'
| AIFDR/inasafe-django | django_project/realtime/templatetags/__init__.py | Python | bsd-2-clause | 108 |
"""
This paver file is intended to help with the release process as much as
possible. It relies on virtualenv to generate 'bootstrap' environments as
independent from the user system as possible (e.g., to make sure the sphinx doc
is built against the built SciPy, not an installed one).
The release is assumed to be don... | aeklant/scipy | pavement.py | Python | bsd-3-clause | 23,552 |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Joel Nothman <joel.nothman@gmail.com>
# Hamzeh Alsalhi <ha258@cornell.edu>
# Licens... | 0x0all/scikit-learn | sklearn/preprocessing/label.py | Python | bsd-3-clause | 28,286 |
###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | frivoal/presto-testo | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/demo/pubsub/simple/server.py | Python | bsd-3-clause | 1,625 |
# Generated by Django 3.2.4 on 2021-07-28 17:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('shelves', '0017_auto_20210726_1422'),
]
operations = [
migrations.DeleteModel(
name='ShelfManagement',
),
]
| mozilla/addons-server | src/olympia/shelves/migrations/0018_delete_shelfmanagement.py | Python | bsd-3-clause | 304 |
import StringIO
import numpy as np
from numpy.lib._iotools import LineSplitter, NameValidator, StringConverter,\
has_nested_fields
from numpy.testing import *
class TestLineSplitter(TestCase):
"Tests the LineSplitter class."
#
def test_no_delimiter(self):
"Test Line... | illume/numpy3k | numpy/lib/tests/test__iotools.py | Python | bsd-3-clause | 6,114 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
import codecs
name = 'python-slugify'
package = 'slugify'
description = 'A Python Slugify application that handles Unicode'
url = 'https://github.com/un33k/python-slugify'
author = 'Val Neekman'
author_email = '... | nMustaki/python-slugify | setup.py | Python | bsd-3-clause | 2,653 |
#!/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.
#
# Lint format strings: This program checks that the number of arguments passed
# to a variadic format ... | nlgcoin/guldencoin-official | test/lint/lint-format-strings.py | Python | mit | 12,730 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import six
from cryptography import utils
from cryptography.x509.oid imp... | aliyun/oss-ftp | python27/win32/Lib/site-packages/cryptography/x509/name.py | Python | mit | 2,116 |
from direct.interval.IntervalGlobal import *
from direct.particles import ParticleEffect
from direct.particles import Particles
from direct.particles import ForceGroup
from pandac.PandaModules import *
import random
from FireworkGlobals import *
colors = {WHITE: Vec4(1, 1, 1, 1),
RED: Vec4(1, 0.2, 0.2, 1),
BLUE: Vec4... | Spiderlover/Toontown | toontown/effects/Fireworks.py | Python | mit | 9,697 |
#!/usr/bin/env python3
if __name__ == '__main__':
print('Hello World!')
| DakRomo/2017Challenges | challenge_0/python/slandau/hello_world.py | Python | mit | 77 |
# -*- coding: utf-8 -*-
""" Tests for the alarms module """
from __future__ import unicode_literals
from soco.alarms import is_valid_recurrence
def test_recurrence():
for recur in ('DAILY', 'WEEKDAYS', 'WEEKENDS', 'ONCE'):
assert is_valid_recurrence(recur)
assert is_valid_recurrence('ON_1')
asse... | oyvindmal/SocoWebService | unittest/test_alarms.py | Python | mit | 538 |
from bcbio.ngsalign.bowtie2 import filter_multimappers
def clean_chipseq_alignment(data):
config = data["config"]
aligner = config["algorithm"].get("aligner", None)
assert aligner == "bowtie2", "ChIP-seq only supported for bowtie2."
if aligner == "bowtie2":
work_bam = filter_multimappers(data[... | hjanime/bcbio-nextgen | bcbio/chipseq/__init__.py | Python | mit | 393 |
LANG_TEXT = {'en_EN': {'tr_TR': 'Turkish',
'fr_FR': 'French',
'fi_FI': 'Finnish',
'pt_PT': 'Portuguese',
'fy_x-FY': 'Frisian',
'it_IT': 'Italian',
'et_EE': 'Estonian',
'no_NO': 'Norwegian',
'nl_NL': 'Dutch',
'lv_LV': 'Lat... | kingvuplus/ts-gui-3 | lib/python/Components/language_cache.py | Python | gpl-2.0 | 50,254 |
#! /usr/bin/env python
# This file is part of the dvbobjects library.
#
# Copyright 2009-2013 Lorenzo Pallara l.pallara@avalpa.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either vers... | pvdheijden/OpenCaster | libs/dvbobjects/dvbobjects/PSI/UNT.py | Python | gpl-2.0 | 2,864 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_richness_ascii.py
----------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************... | stevenmizuno/QGIS | python/plugins/processing/algs/grass7/ext/r_li_richness_ascii.py | Python | gpl-2.0 | 1,514 |
# _*_ coding=utf-8 _*_
"""
Solver class to interface with JCMsuite
"""
import os,sys,logging
import Waveguide, Modes
from numpy import *
from .Solver import Solve
class JCMWaveSolver(Solve):
'''
External solver class for the JCMSuite solvers
supply the project_path where the files for the solver will be ... | morris254/polymode | Polymode/ExternalSolvers.py | Python | gpl-3.0 | 14,250 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# coala documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 6 21:18:18 2016.
#
# 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
# auto... | impmihai/coala | docs/conf.py | Python | agpl-3.0 | 9,703 |
# pylint: disable=missing-docstring
from smtplib import SMTPException
from unittest import mock
import pytest
import ddt
from django.db import IntegrityError
from django.test import TestCase
from openedx.core.djangoapps.api_admin.models import ApiAccessConfig, ApiAccessRequest
from openedx.core.djangoapps.api_admin... | edx/edx-platform | openedx/core/djangoapps/api_admin/tests/test_models.py | Python | agpl-3.0 | 6,287 |
# disable missing docstring
# pylint: disable=missing-docstring
from collections import OrderedDict
from lettuce import step, world
from nose.tools import assert_equal, assert_false, assert_in, assert_true
from common import get_codemirror_value, type_in_codemirror
CODEMIRROR_SELECTOR_PREFIX = "$('iframe').contents... | kmoocdev2/edx-platform | cms/djangoapps/contentstore/features/html-editor.py | Python | agpl-3.0 | 9,937 |
"""
Template tags for working with lists of model instances which represent
trees.
"""
from django import template
from django.db.models import get_model
from django.db.models.fields import FieldDoesNotExist
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from django.utils.... | mpetyx/palmdrop | venv/lib/python2.7/site-packages/mptt/templatetags/mptt_tags.py | Python | apache-2.0 | 11,153 |
#
# 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... | wileeam/airflow | airflow/contrib/operators/bigquery_to_gcs.py | Python | apache-2.0 | 1,678 |
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | cshallue/models | research/cognitive_planning/embedders.py | Python | apache-2.0 | 19,820 |
#!/usr/bin/env python
#
# Copyright 2010 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 require... | alexandregz/simian | src/simian/mac/munki/handlers/uauth.py | Python | apache-2.0 | 2,569 |
#
# Copyright 2013 Red Hat, Inc
#
# Author: Eoghan Glynn <eglynn@redhat.com>
# Author: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ht... | MisterPup/Ceilometer-Juno-Extension | ceilometer/alarm/evaluator/threshold.py | Python | apache-2.0 | 8,086 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | rabipanda/tensorflow | tensorflow/python/grappler/memory_optimizer_test.py | Python | apache-2.0 | 12,186 |
from cyder.api.v1.endpoints.dhcp.static_interface import api
| akeym/cyder | cyder/api/v1/endpoints/dhcp/static_interface/__init__.py | Python | bsd-3-clause | 61 |
import subprocess
import setup_util
import multiprocessing
import os
home = os.path.expanduser('~')
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py3/bin')
NCPU = multiprocessing.cpu_count()
proc = None
def start(args):
global proc
setup_util.replace_text(
"frameworkbenchmarks/models.... | seem-sky/FrameworkBenchmarks | pyramid/setup_benchmark.py | Python | bsd-3-clause | 708 |
from hearthbreaker.cards.weapons.hunter import (
EaglehornBow,
GladiatorsLongbow,
Glaivezooka,
)
from hearthbreaker.cards.weapons.paladin import (
LightsJustice,
SwordOfJustice,
TruesilverChampion,
Coghammer,
)
from hearthbreaker.cards.weapons.rogue import (
AssassinsBlade,
Perditi... | bingshuika/hearthbreaker-new | hearthbreaker/cards/weapons/__init__.py | Python | mit | 594 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (start_nod... | AdrianaDinca/bitcoin | qa/rpc-tests/import-rescan.py | Python | mit | 7,007 |
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | lmazuel/autorest | src/generator/AutoRest.Python.Tests/AcceptanceTests/validation_tests.py | Python | mit | 5,290 |
import itertools
try:
import autotest.common as common
except ImportError:
import common
def _get_unpassable_types(arg):
""" Given an argument, returns a set of types contained in arg that are
unpassable. If arg is an atomic type (e.g. int) it either returns an
empty set (if the type is passable) ... | nacc/autotest | server/profiler.py | Python | gpl-2.0 | 2,528 |
# 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 even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICUL... | pmisik/buildbot | master/buildbot/test/unit/www/test_roles.py | Python | gpl-2.0 | 3,892 |
#!/usr/bin/python
# This file is part of P4wnP1.
#
# Copyright (c) 2017, Marcus Mengs.
#
# P4wnP1 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 ... | mame82/P4wnP1 | hidtools/hidsrv9.py | Python | gpl-3.0 | 10,097 |
'''
Created on Jan 30, 2011
@author: mkiyer
chimerascan: chimeric transcript discovery using RNA-seq
Copyright (C) 2011 Matthew Iyer
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 ... | tectronics/chimerascan | chimerascan/deprecated/nominate_spanning_reads_v01.py | Python | gpl-3.0 | 5,222 |
# Copyright 2008-2015 Canonical
#
# This program 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 option) any later version.
#
# This program is distributed... | zhsso/ubunto-one | src/backends/db/__init__.py | Python | agpl-3.0 | 833 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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... | rhyolight/nupic.core | bindings/py/src/nupic/bindings/regions/TestNode.py | Python | agpl-3.0 | 10,011 |
#!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | CompMusic/essentia | src/examples/python/show_algo_dependencies.py | Python | agpl-3.0 | 2,198 |
'''OpenGL extension OES.read_format
This module customises the behaviour of the
OpenGL.raw.GLES1.OES.read_format to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/OES/read_format.txt
'''
from OpenGL import platform, constant, arra... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/GLES1/OES/read_format.py | Python | lgpl-3.0 | 750 |
# 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
#
# Unless required by applicable law or agreed to in... | jumpstarter-io/keystone | keystone/tests/unit/test_v3_credential.py | Python | apache-2.0 | 16,723 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | sparkslabs/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Apps/Europython09/BB/LineOrientedInputBuffer.py | Python | apache-2.0 | 2,466 |
# Buffers allocated on the heap
from bgenOutput import *
from bgenType import OutputOnlyMixIn
from bgenBuffer import FixedInputOutputBufferType
class HeapInputOutputBufferType(FixedInputOutputBufferType):
"""Input-output buffer allocated on the heap -- passed as (inbuffer, outbuffer, size).
Inst... | google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Tools/bgen/bgen/bgenHeapBuffer.py | Python | apache-2.0 | 4,346 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | KaranToor/MA450 | google-cloud-sdk/lib/surface/debug/logpoints/create.py | Python | apache-2.0 | 4,928 |
import logging
logging.getLogger('azure.storage.common.storageclient').setLevel(logging.WARNING)
| ewbankkit/cloud-custodian | tools/c7n_mailer/c7n_mailer/azure_mailer/__init__.py | Python | apache-2.0 | 101 |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | twiest/openshift-tools | ansible/roles/lib_openshift_3.2/library/oc_pvc.py | Python | apache-2.0 | 40,439 |
from sklearn.experimental import enable_hist_gradient_boosting # noqa
from sklearn.ensemble import (RandomForestClassifier,
GradientBoostingClassifier,
HistGradientBoostingClassifier)
from .common import Benchmark, Estimator, Predictor
from .datasets import ... | xuewei4d/scikit-learn | asv_benchmarks/benchmarks/ensemble.py | Python | bsd-3-clause | 3,520 |
#!/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.
"""Compare the artifacts from two builds."""
from __future__ import print_function
import ast
import difflib
import glob
import json
... | chromium/chromium | tools/determinism/compare_build_artifacts.py | Python | bsd-3-clause | 15,490 |
"""
This is just a sample code.
LevelEditor, ObjectHandler, ObjectPalette should be rewritten
to be game specific.
"""
from .LevelEditorUI import *
from .LevelEditorBase import *
from .ObjectMgr import *
from .AnimMgr import *
from .ObjectHandler import *
from .ObjectPalette import *
from .ProtoPalette import *
clas... | tobspr/panda3d | direct/src/leveleditor/LevelEditor.py | Python | bsd-3-clause | 1,521 |
#!/usr/bin/env python
"""Show the contents of a FIFF file
You can do for example:
$ mne show_fiff test_raw.fif
"""
# Authors : Eric Larson, PhD
import sys
import mne
def run():
parser = mne.commands.utils.get_optparser(
__file__, usage='mne show_fiff <file>')
options, args = parser.parse_args()
... | ARudiuk/mne-python | mne/commands/mne_show_fiff.py | Python | bsd-3-clause | 485 |
"""
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
fro... | devanshdalal/scikit-learn | sklearn/cross_validation.py | Python | bsd-3-clause | 72,259 |
"""
The feed is an assembly of items of different content types.
For ease of querying, each different content type is housed in the FeedItem
model, which also houses metadata indicating the conditions under which it
should be included. So a feed is actually just a listing of FeedItem instances
that match the user's reg... | ingenioustechie/zamboni | mkt/feed/models.py | Python | bsd-3-clause | 17,621 |
from gym import core
class ArgumentEnv(core.Env):
calls = 0
def __init__(self, arg):
self.calls += 1
self.arg = arg
def test_env_instantiation():
# This looks like a pretty trivial, but given our usage of
# __new__, it's worth having.
env = ArgumentEnv('arg')
assert env.arg ==... | xpharry/Udacity-DLFoudation | tutorials/reinforcement/gym/gym/tests/test_core.py | Python | mit | 353 |
"""Selector event loop for Unix with signal handling."""
import errno
import os
import signal
import socket
import stat
import subprocess
import sys
import threading
import warnings
from . import base_events
from . import base_subprocess
from . import compat
from . import constants
from . import coroutines
from . im... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/asyncio/unix_events.py | Python | mit | 34,324 |
# sql/elements.py
# Copyright (C) 2005-2015 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
"""Core SQL expression elements, including :class:`.ClauseElement`,
:class:`.ColumnE... | davidfraser/sqlalchemy | lib/sqlalchemy/sql/elements.py | Python | mit | 141,433 |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Machine Translation
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>, Tah Wei Hoon <hoon.tw@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Experimental features for machine translation.
These ... | sdoran35/hate-to-hugs | venv/lib/python3.6/site-packages/nltk/translate/__init__.py | Python | mit | 913 |
from unittest import TestCase
from mock import patch
from regulations.generator.layers.paragraph_markers import *
class ParagraphMarkersLayerTest(TestCase):
@patch('regulations.generator.layers.paragraph_markers.loader')
def test_apply_layer(self, loader):
pml = ParagraphMarkersLayer({
'... | ascott1/regulations-site | regulations/tests/layers_paragraph_markers_tests.py | Python | cc0-1.0 | 1,212 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_renyi.py
--------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
*******************************... | fritsvanveen/QGIS | python/plugins/processing/algs/grass7/ext/r_li_renyi.py | Python | gpl-2.0 | 1,325 |
# -*- coding: utf-8 -*-
#
# Copyright © 2014 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 t... | crobinso/pkgdb2 | pkgdb2/lib/exceptions.py | Python | gpl-2.0 | 1,325 |
# Copyright (C) 2004-2014 Aaron Swartz
# Brian Lalor
# Dean Jackson
# Erik Hetzner
# Etienne Millon <me@emillon.org>
# Joey Hess
# Lindsey Smith <lindsey.smith@gmail.com>
# ... | sciunto/rss2email | rss2email/feeds.py | Python | gpl-2.0 | 14,342 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 of the
# License, or (at your option) any... | inspirehep/invenio-records | invenio_records/upgrades/records_2014_04_14_json_type_fix.py | Python | gpl-2.0 | 1,655 |
import frappe
from erpnext.setup.install import create_default_energy_point_rules
def execute():
frappe.reload_doc('social', 'doctype', 'energy_point_rule')
create_default_energy_point_rules() | StrellaGroup/erpnext | erpnext/patches/v12_0/create_default_energy_point_rules.py | Python | gpl-3.0 | 195 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010-2013 Elico Corp. All Rights Reserved.
# Author: Yannick Gouin <yannick.gouin@elico-corp.com>
#
# This program is free software: you can red... | udayinfy/openerp-7.0 | stock_with_cost/__init__.py | Python | agpl-3.0 | 1,119 |
"""Sensor platform for mobile_app."""
from functools import partial
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import (ATTR_SENSOR_STATE,
ATTR_SENSOR_TYPE_SENSOR as ENTITY... | molobrakos/home-assistant | homeassistant/components/mobile_app/sensor.py | Python | apache-2.0 | 2,104 |
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | dataxu/jenkins-job-builder | jenkins_jobs/modules/reporters.py | Python | apache-2.0 | 5,779 |
#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
#
# analytics_db.py
# Implementation of database purging
#
import redis
import pycassa
from pycassa.pool import ConnectionPool
from pycassa.columnfamily import ColumnFamily
from pycassa.types import *
from pycassa import *
from sandesh.viz.constants... | facetothefate/contrail-controller | src/opserver/analytics_db.py | Python | apache-2.0 | 14,728 |
#
# 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... | lukecwik/incubator-beam | sdks/python/apache_beam/examples/cookbook/bigquery_tornadoes.py | Python | apache-2.0 | 3,690 |
# 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... | sergiomt/centorion | vagrant-setup/cassandra/cqlshlib/cqlhandling.py | Python | apache-2.0 | 27,443 |
def f(x):
y = 'abc'
f(42)
| Microsoft/PTVS | Python/Tests/TestData/DebuggerProject/LocalsTest3.py | Python | apache-2.0 | 28 |
from base import OcgFunctionGroup
class BasicStatistics(OcgFunctionGroup):
name = 'Basic Statistics'
class Thresholds(OcgFunctionGroup):
name = 'Thresholds' | OpenSource-/OpenClimateGIS | src/openclimategis/util/ncconv/experimental/ocg_stat/groups.py | Python | bsd-3-clause | 176 |
from __future__ import unicode_literals
import os
import re
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.encoding import force_text
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 impo... | loic/django | django/core/validators.py | Python | bsd-3-clause | 17,864 |
from __future__ import unicode_literals
import datetime
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.test import TestCase, override_settings
from .models import A... | dydek/django | tests/admin_custom_urls/tests.py | Python | bsd-3-clause | 6,103 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import xml.etree.ElementTree as ET
def main():
parser = argparse.ArgumentParser(description="List all error without a CWE assigned in CSV format")
parser.add_argument("-F", metavar="filename", required=True,
he... | danmar/cppcheck | tools/listErrorsWithoutCWE.py | Python | gpl-3.0 | 710 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.tools import float_compare
class StockWarnInsufficientQty(models.AbstractModel):
_name = 'stock.warn.insufficient.qty'
_description = 'Warn Insufficient Quantity'
... | t3dev/odoo | addons/stock/wizard/stock_warn_insufficient_qty.py | Python | gpl-3.0 | 1,401 |
"""
Courseware views functions
"""
import logging
import urllib
import json
from collections import defaultdict
from django.utils.translation import ugettext as _
from django.conf import settings
from django.core.context_processors import csrf
from django.core.exceptions import PermissionDenied
from django.core.urlr... | hkawasaki/kawasaki-aio8-1 | lms/djangoapps/courseware/views.py | Python | agpl-3.0 | 32,876 |