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 |
|---|---|---|---|---|---|
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | dennybaa/st2 | st2common/st2common/persistence/base.py | Python | apache-2.0 | 12,025 |
# Copyright 2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | luogangyi/bcec-nova | nova/tests/api/openstack/compute/contrib/test_server_external_events.py | Python | apache-2.0 | 6,660 |
#-----------------------------------------------------------------------
#
# tinyfont.py -- a very small font
#
#-----------------------------------------------------------------------
#
# Description:
#
# The tiny font is an 3x5 pixel monospaced font where each character
# is placed in a box of 4x6... | kervinck/gigatron-rom | Contrib/pkupper/BabelFish/tinyfont.py | Python | bsd-2-clause | 4,452 |
from unittest import mock
import os
import pytest
from django.conf import settings
from waffle.testutils import override_switch
from olympia import amo
from olympia.addons.tasks import (
recreate_theme_previews,
update_addon_average_daily_users,
update_addon_hotness,
update_addon_weekly_downloads,
)
... | mozilla/addons-server | src/olympia/addons/tests/test_tasks.py | Python | bsd-3-clause | 8,920 |
from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.is_.forms import (ISIdNumberField, ISPhoneNumberField,
ISPostalCodeSelect)
class ISLocalFlavorTests(SimpleTestCase):
def test_ISPostalCodeSelect(self):
f = ISPostalCodeSelec... | M157q/django-localflavor | tests/test_is.py | Python | bsd-3-clause | 9,213 |
default_app_config = 'hs_tracking.apps.HSTrackingAppConfig'
| ResearchSoftwareInstitute/MyHPOM | hs_tracking/__init__.py | Python | bsd-3-clause | 60 |
# Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | axinging/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/commandtest.py | Python | bsd-3-clause | 2,622 |
"""
.. todo::
WRITEME
"""
import os
import gc
import warnings
try:
import tables
except ImportError:
warnings.warn("Couldn't import tables, so far SVHN is "
"only supported with PyTables")
import numpy
from theano import config
from pylearn2.datasets import dense_design_matrix
from pylearn2.uti... | skearnes/pylearn2 | pylearn2/datasets/svhn.py | Python | bsd-3-clause | 18,086 |
"""
This module contains query handlers responsible for calculus queries:
infinitesimal, bounded, etc.
"""
from __future__ import print_function, division
from sympy.logic.boolalg import conjuncts
from sympy.assumptions import Q, ask
from sympy.assumptions.handlers import CommonHandler
class AskInfinitesimalHandler(... | hrashk/sympy | sympy/assumptions/handlers/calculus.py | Python | bsd-3-clause | 8,090 |
# Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | axinging/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py | Python | bsd-3-clause | 3,090 |
from nbgrader import utils
from nbgrader.preprocessors import NbGraderPreprocessor
class ComputeChecksums(NbGraderPreprocessor):
"""A preprocessor to compute checksums of grade cells."""
def preprocess_cell(self, cell, resources, cell_index):
# compute checksums of grade cell and solution cells
... | alope107/nbgrader | nbgrader/preprocessors/computechecksums.py | Python | bsd-3-clause | 771 |
#!/usr/bin/env python
NAME = 'F5 Trafficshield'
def is_waf(self):
for hv in [['cookie', '^ASINFO='], ['server', 'F5-TrafficShield']]:
r = self.matchheader(hv)
if r is None:
return
elif r:
return r
# the following based on nmap's http-waf-fingerprint.nse
if... | thinksabin/wafw00f | wafw00f/plugins/f5trafficshield.py | Python | bsd-3-clause | 408 |
from django.conf import settings
from django.contrib.comments.managers import CommentManager
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core import urlresolvers
from django.db import models
from djan... | RichardLitt/wyrd-django-dev | django/contrib/comments/models.py | Python | bsd-3-clause | 7,766 |
import unittest
from rmgpy.molecule.molecule import Molecule
from .parser import *
class ParserTest(unittest.TestCase):
def test_fromAugmentedInChI(self):
aug_inchi = 'InChI=1S/CH4/h1H4'
mol = fromAugmentedInChI(Molecule(), aug_inchi)
self.assertTrue(not mol.InChI == '')
aug_inc... | chatelak/RMG-Py | rmgpy/molecule/parserTest.py | Python | mit | 2,890 |
import copy
from collections import OrderedDict
from collections.abc import Mapping
class OrderedSet:
"""
A set which keeps the ordering of the inserted items.
Currently backs onto OrderedDict.
"""
def __init__(self, iterable=None):
self.dict = OrderedDict.fromkeys(iterable or ())
de... | sametmax/Django--an-app-at-a-time | ignore_this_directory/django/utils/datastructures.py | Python | mit | 10,194 |
"""SCons.Tool.sgicc
Tool-specific initialization for MIPSPro cc on SGI.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtai... | timj/scons | src/engine/SCons/Tool/sgicc.py | Python | mit | 1,780 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | mrquim/mrquimrepo | repo/plugin.video.salts/scrapers/treasureen_scraper.py | Python | gpl-2.0 | 3,727 |
from pyjsparserdata import *
class BaseNode:
def finish(self):
pass
def finishArrayExpression(self, elements):
self.type = Syntax.ArrayExpression
self.elements = elements
self.finish()
return self
def finishArrayPattern(se... | AMOboxTV/AMOBox.LegoBuild | script.module.liveresolver/lib/js2py/translators/std_nodes.py | Python | gpl-2.0 | 15,390 |
import logging
from ..util import properties
from ..util import XDG
from ..backend import KeyringBackend
from ..errors import (InitError, PasswordDeleteError,
ExceptionRaisedContext)
try:
import secretstorage
import secretstorage.exceptions as exceptions
except ImportError:
pass
log = logging.getLogg... | ruuk/script.module.password.storage | lib/keyring/backends/SecretService.py | Python | gpl-2.0 | 2,786 |
# -*- coding: utf-8 -*-
#
# GObject-Introspection documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 16 15:34:52 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | davibe/gobject-introspection | docs/giscanner/conf.py | Python | gpl-2.0 | 8,112 |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, ... | gw-sd-2016/Codir | codirSublime/SocketIO/websocket/_core.py | Python | gpl-2.0 | 16,014 |
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: output.py,v 1.1 2006/03/06 18:13:31 henrique Exp $
import os
import sys
import re
havecolor = 1
dotitles = 1
spinpos = 0
spinner = "/-\\|/-\\|/-\\|/-\\|\\-/|\\-/|\\-/|\\-/|"
esc_seq = "\x1b["
g_attr =... | ankanaan/chimera | src/chimera/util/output.py | Python | gpl-2.0 | 5,104 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | timlinux/geonode | geonode/layers/metadata.py | Python | gpl-3.0 | 7,943 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (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... | sonaht/ansible | lib/ansible/modules/source_control/git.py | Python | gpl-3.0 | 45,468 |
# -*- coding: utf-8 -*-
from odoo.addons.account_edi.tests.common import AccountEdiTestCommon
from odoo.tests import tagged
from odoo import Command
@tagged('post_install_l10n', 'post_install', '-at_install')
class TestL10nBeEdi(AccountEdiTestCommon):
@classmethod
def setUpClass(cls, chart_template_ref='l10n... | jeremiahyan/odoo | addons/l10n_be_edi/tests/test_ubl.py | Python | gpl-3.0 | 8,636 |
# -*- coding: utf-8 -*-
# Automatic provisioning of Azure DNS zones.
import os
import azure
import json
from requests import Request
try:
from urllib import quote
except:
from urllib.parse import quote
from nixops.util import attr_property
from nixops.azure_common import ResourceDefinition, ResourceState, R... | coreyoconnor/nixops | nixops/resources/azure_dns_zone.py | Python | lgpl-3.0 | 4,631 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | asolntsev/selenium | py/selenium/webdriver/common/action_chains.py | Python | apache-2.0 | 12,537 |
# Copyright 2011 Denali Systems, 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 requ... | sileht/deb-openstack-nova | nova/tests/api/openstack/compute/contrib/test_snapshots.py | Python | apache-2.0 | 10,216 |
# Copyright 2016 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 requ... | bswartz/cinder | cinder/tests/unit/test_quota_utils.py | Python | apache-2.0 | 10,416 |
# Copyright (c) 2010-2015 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 agree... | hbhdytf/mac | swift/obj/reconstructor.py | Python | apache-2.0 | 41,578 |
#!/usr/bin/env python
# Copyright 2012 Red Hat
# 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
#
# Un... | rackerlabs/rackspace-python-neutronclient | neutronclient/tests/unit/test_cli20_floatingips.py | Python | apache-2.0 | 8,263 |
from alembic import context
from sqlalchemy import create_engine, pool
from warehouse import db
def run_migrations_offline():
"""
Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine ... | chopmann/warehouse | warehouse/migrations/env.py | Python | apache-2.0 | 1,309 |
"""Tests for the Linky config flow."""
from pylinky.exceptions import (
PyLinkyAccessException,
PyLinkyEnedisException,
PyLinkyException,
PyLinkyWrongLoginException,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.linky.const import DEFAULT_TIMEOUT, DOMAIN
from h... | nkgilley/home-assistant | tests/components/linky/test_config_flow.py | Python | apache-2.0 | 6,904 |
import logging
import os
import subprocess
import threading
import util
logger = logging.getLogger('rt.decoder')
class Decoder:
def close(self, force=False):
if not force:
self.lock.acquire()
self.decoder.stdin.close()
self.decoder.wait()
if not force:
sel... | veer66/cdec | realtime/rt/decoder.py | Python | apache-2.0 | 2,899 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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... | ntt-sic/cinder | cinder/openstack/common/periodic_task.py | Python | apache-2.0 | 6,920 |
# 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... | annarev/tensorflow | tensorflow/python/kernel_tests/lrn_op_test.py | Python | apache-2.0 | 5,781 |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
import unittest
from io import BytesIO, StringIO
from decimal import Decimal
import threading
from importlib import import_module
from ijson import common
from ijson.backends.python import basic_parse, Lexer
from ijson.compat import IS_PY2
JSON = b'''
{
... | catapult-project/catapult | third_party/ijson/tests.py | Python | bsd-3-clause | 8,608 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/client/gtk_builder_lint.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice,... | securestate/king-phisher | tests/client/gtk_builder.py | Python | bsd-3-clause | 2,305 |
"""
====================================================
Compute envelope correlations in volume source space
====================================================
Compute envelope correlations of orthogonalized activity
:footcite:`HippEtAl2012,KhanEtAl2018` in source
space using resting state CTF data in a volume sour... | olafhauk/mne-python | examples/connectivity/plot_mne_inverse_envelope_correlation_volume.py | Python | bsd-3-clause | 3,736 |
import sys
import re
import codecs
import snowballstemmer
def usage():
print('''usage: %s [-l <language>] [-i <input file>] [-o <output file>] [-c <character encoding>] [-p[2]] [-h]
The input file consists of a list of words to be stemmed, one per
line. Words should be in lower case, but (for English) A-Z letters... | assem-ch/snowball | python/stemwords.py | Python | bsd-3-clause | 3,277 |
''' Fvtk module implements simple visualization functions using VTK.
The main idea is the following:
A window can have one or more renderers. A renderer can have none, one or more actors. Examples of actors are a sphere, line, point etc.
You basically add actors in a renderer and in that way you can visualize the fore... | jyeatman/dipy | dipy/viz/fvtk.py | Python | bsd-3-clause | 53,175 |
#!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
__version__='''$Id: test_geomutils.py 3355 2009-01-08 14:58:44Z jonas $'''
__doc__="""Tests for geometry utility functions."""
import unittest
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses
setOutDir(__... | ejucovy/reportlab | tests/test_geomutils.py | Python | bsd-3-clause | 1,009 |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2018 CERN.
#
# CERN Analysis Preservation Framework 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... | cernanalysispreservation/analysis-preservation.cern.ch | cap/modules/deposit/minters.py | Python | gpl-2.0 | 1,769 |
#
# Copyright 2014 Red Hat, Inc
#
# Author: Chris Dent <chdent@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/tests/ipmi/notifications/test_ironic.py | Python | gpl-2.0 | 8,529 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | alberts/check_mk | web/htdocs/hooks.py | Python | gpl-2.0 | 2,947 |
print ("Hello World!")
| hacktoberfest17/programming | hello_world/python/hello_world_py3.py | Python | gpl-3.0 | 23 |
#!/bin/env python
""" Extract and tag References from a PDF.
Created on Mar 1, 2010
@author: John Harrison
Usage: headings.py OPTIONS FILEPATH
OPTIONS:
--help, -h Print help and exit
--noxml Do not tag individual headings with XML tags.
Default is to include tagging.
--title Only pr... | valentinedwv/pdfssa4met | headings.py | Python | gpl-3.0 | 4,413 |
test_records = [
[{
"doctype": "Country",
"country_name": "_Test Country"
}]
] | gangadhar-kadam/mtn-erpnext | setup/doctype/country/test_country.py | Python | agpl-3.0 | 84 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2019-12-13 07:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | stvstnfrd/edx-platform | openedx/core/djangoapps/programs/migrations/0013_customprogramsconfig.py | Python | agpl-3.0 | 1,294 |
#!/usr/bin/python -tt
#
# Copyright (C) 2005-2017 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# Released under the 2 clause BSD license.
"""
This program checks C code for compliance to coding standards used in
libsndfile and other projects I run.
"""
import re
import sys
class Preprocessor:
"""
Preprocess lines ... | jniemann66/ReSampler | android/src/libsndfile/Scripts/cstyle.py | Python | lgpl-2.1 | 8,137 |
# -*- Mode:Python -*-
##########################################################################
# #
# This file is part of AVANGO. #
# ... | vrsys/avangong | examples/inspector/inspector_qt.py | Python | lgpl-3.0 | 13,470 |
#!/usr/bin/env python
#
# Copyright 2010 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 o... | rolepoint/appengine-mapreduce | python/src/mapreduce/namespace_range.py | Python | apache-2.0 | 14,002 |
# 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/kernel_tests/nn_ops/embedding_ops_test.py | Python | apache-2.0 | 47,859 |
"""Support for Matrix notifications."""
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_MESSAGE,
ATTR_TARGET,
PLATFORM_SCHEMA,
BaseNotificationService,
)
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN, SERVICE_SEND_MESSAGE
CON... | jawilson/home-assistant | homeassistant/components/matrix/notify.py | Python | apache-2.0 | 1,313 |
from zerver.lib.test_classes import WebhookTestCase
class LidarrHookTests(WebhookTestCase):
STREAM_NAME = "lidarr"
URL_TEMPLATE = "/api/v1/external/lidarr?api_key={api_key}&stream={stream}"
WEBHOOK_DIR_NAME = "lidarr"
def test_lidarr_test(self) -> None:
"""
Tests if lidarr test payloa... | rht/zulip | zerver/webhooks/lidarr/tests.py | Python | apache-2.0 | 4,458 |
"""Translate generators test."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import tarfile
import tensorflow as tf
from data_generators import text_problems
from data_generators import translate
class TranslateTest(tf.test.Te... | mlperf/training_results_v0.6 | Google/benchmarks/transformer/implementations/tpu-v3-512-transformer/transformer/data_generators/translate_test.py | Python | apache-2.0 | 2,128 |
"""
Upload handlers to test the upload API.
"""
from django.core.files.uploadhandler import (
FileUploadHandler, StopUpload, TemporaryFileUploadHandler,
)
class QuotaUploadHandler(FileUploadHandler):
"""
This test upload handler terminates the connection if more than a quota
(5MB) is uploaded.
""... | elena/django | tests/file_uploads/uploadhandler.py | Python | bsd-3-clause | 1,171 |
from __future__ import absolute_import
import logging
import requests
from six.moves.urllib.parse import quote
from sentry import options
logger = logging.getLogger(__name__)
def sms_available():
return bool(options.get('sms.twilio-account'))
def send_sms(body, to, from_=None):
account = options.get('s... | JamesMura/sentry | src/sentry/utils/sms.py | Python | bsd-3-clause | 976 |
# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | soltanmm-google/grpc | src/python/grpcio/grpc/beta/_client_adaptations.py | Python | bsd-3-clause | 26,840 |
from __future__ import absolute_import
from qinfer.tomography.distributions import *
from qinfer.tomography.models import *
from qinfer.tomography.plotting_tools import *
from qinfer.tomography.bases import *
from qinfer.tomography.expdesign import *
| QInfer/python-qinfer | src/qinfer/tomography/__init__.py | Python | bsd-3-clause | 251 |
from __future__ import absolute_import
from future.standard_library import suspend_hooks
from future.utils import PY3
if PY3:
from urllib.request import *
# This aren't in __all__:
from urllib.request import (getproxies,
pathname2url,
proxy_b... | PythonCharmers/python-future | src/future/moves/urllib/request.py | Python | mit | 3,496 |
# -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub 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 Softwar... | azumimuo/family-xbmc-addon | plugin.video.dragon.sports/lib/utils/github/Comparison.py | Python | gpl-2.0 | 6,448 |
#!/usr/bin/python
#
# Reporter: pixdamix
#
# What steps will reproduce the problem?
# ======================================
#
# 1. Given three packages A, B, C
# A depends on B
# A failed postinst and is in unpacked state
# C depends on B
#
# 2. Upgrade to a new version of C which do not depends on B anymore, and use
... | nrclark/opkg | tests/regress/issue79.py | Python | gpl-2.0 | 1,182 |
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class ClientScript(Plugin):
urls = {
'style': {},
'script': {},
}
html = {
'style': '<link rel="stylesheet" href="%s" type... | jayme-github/CouchPotatoServer | couchpotato/core/_base/clientscript/main.py | Python | gpl-3.0 | 1,521 |
from _test_lbfgs_cpp import *
from _test_lj_cpp import *
from _test_lj_interaction_list import *
from _test_frozen_atoms import *
from _test_bljcut import *
if __name__ == "__main__":
unittest.main()
| khs26/pele | playground/native_code/tests/__init__.py | Python | gpl-3.0 | 206 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# test_cancel.py - unit test for query cancellation
#
# Copyright (C) 2010-2011 Jan Urbański <wulczer@wulczer.org>
#
# psycopg2 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... | nwokeo/supysonic | venv/lib/python2.7/site-packages/psycopg2/tests/test_cancel.py | Python | agpl-3.0 | 3,785 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Mathieu Jourdan
#
# 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 op... | sputnick-dev/weboob | modules/gdfsuez/pages/homepage.py | Python | agpl-3.0 | 2,508 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/OpenGL/raw/GL/EXT/vertex_shader.py | Python | lgpl-3.0 | 11,362 |
import pilas
def test_todos_los_objetos_de_interfaz_se_pueden_crear():
pilas.iniciar()
deslizador = pilas.interfaz.Deslizador()
assert deslizador
assert deslizador.progreso == 0
boton = pilas.interfaz.Boton()
assert boton
ingreso = pilas.interfaz.IngresoDeTexto()
assert ingreso
... | irvingprog/pilas | pilas/test/test_interface.py | Python | lgpl-3.0 | 736 |
# 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 by applicable law or a... | DeepThoughtTeam/tensorflow | tensorflow/python/training/input_test.py | Python | apache-2.0 | 20,244 |
# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
FORMAT = """%(asctime)s
:%(name)s:
%(levelname)s
:%(module)s
:%(funcName)
:%(lineno)s
:%(message)s"""
SELENIUM_REMOTE_CONNECTION = "selenium.webdriver.re... | NejcZupec/ggrc-core | test/selenium/src/lib/constants/log.py | Python | apache-2.0 | 344 |
# Copyright 2013-2015 DataStax, 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 writi... | bbirand/python-driver | benchmarks/callback_full_pipeline.py | Python | apache-2.0 | 1,906 |
from types import *
from robot import utils
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.common.exceptions import NoSuchWindowException
class WindowManager(object):
def __init__(self):
self._strategies = {
'title': self._select_by_title,
'name': self._sel... | gotcha/Selenium2Library | src/Selenium2Library/locators/windowmanager.py | Python | apache-2.0 | 5,724 |
import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import AbstractNode, NodeLog
from osf.utils import permissions
from osf.utils.sanitize import strip_html
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
OSFGroupFactory,
Reg... | Johnetordoff/osf.io | api_tests/nodes/views/test_node_children_list.py | Python | apache-2.0 | 30,028 |
#
# 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... | LedaLima/incubator-spot | spot-oa/api/resources/proxy.py | Python | apache-2.0 | 17,096 |
# 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 by applicable law or agree... | petrutlucian94/nova | nova/objects/migration.py | Python | apache-2.0 | 4,655 |
#! /usr/bin/env python
import os
import sys
from barf.barf import BARF
if __name__ == "__main__":
#
# Open file
#
try:
filename = os.path.abspath("../../samples/toy/arm/branch4")
barf = BARF(filename)
except Exception as err:
print err
print "[-] Error opening fil... | ignaeche/barf-project | barf/examples/arm/translate_smt.py | Python | bsd-2-clause | 1,055 |
# 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 posixpath
import traceback
from app_yaml_helper import AppYamlHelper
from appengine_wrappers import IsDeadlineExceededError, logservic... | TeamEOS/external_chromium_org | chrome/common/extensions/docs/server2/cron_servlet.py | Python | bsd-3-clause | 12,019 |
"""Convert Wavefront OBJ / MTL files into Three.js (JSON model version, to be used with ascii / binary loader)
-------------------------
How to use this converter
-------------------------
python convert_obj_three.py -i infile.obj -o outfile.js [-m "morphfiles*.obj"] [-c "morphcolors*.obj"] [-a center|centerxz|top|bo... | css-umsetzung/three.js | utils/exporters/convert_obj_three.py | Python | mit | 46,781 |
###########################################################
#
# Copyright (c) 2005-2009, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... | Southpaw-TACTIC/TACTIC | src/tactic/ui/examples/__init__.py | Python | epl-1.0 | 823 |
"""SCons.Environment
Base class for construction Environments. These are
the primary objects used to communicate dependency and
construction information to the build engine.
Keyword arguments supplied when the construction Environment
is created are construction variables used to initialize the
Environment
"""
#
# ... | h4ck3rm1k3/OpenWrt-Firefly-SDK | staging_dir/host/lib/scons-2.3.1/SCons/Environment.py | Python | gpl-2.0 | 96,203 |
"""SCons.Tool.Perforce.py
Tool-specific initialization for Perforce Source Code Management system.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 20... | michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/scons-2.3.1/SCons/Tool/Perforce.py | Python | gpl-2.0 | 3,834 |
callback_classes = [
['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
['... | pradeepnazareth/NS-3-begining | src/lte/bindings/callbacks_list.py | Python | gpl-2.0 | 6,324 |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for nacl_utils.py."""
import fileinput
import mox
import nacl_utils
import os
import sys
import unittest
def TestM... | aYukiSekiguchi/ACCESS-Chromium | native_client_sdk/src/build_tools/nacl_sdk_scons/nacl_utils_test.py | Python | bsd-3-clause | 4,315 |
'''tzinfo timezone information for Africa/Asmera.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Asmera(DstTzInfo):
'''Africa/Asmera timezone definition. See datetime.tzinfo for details'''
zone = 'Africa/Asmera'
_ut... | newvem/pytz | pytz/zoneinfo/Africa/Asmera.py | Python | mit | 483 |
from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=100)
bar = models.ForeignKey('Bar', related_name='bar_fk')
def __unicode__(self):
return self.name
class Bar(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
re... | spookylukey/django-autocomplete-light | test_project/admin_test_autocomplete/models.py | Python | mit | 335 |
#
# sublimelinter.py
# Part of SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ryan Hileman and Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter3
# License: MIT
#
"""This module provides the SublimeLinter plugin class and supporting methods."""
import os
import... | yubchen/Qlinter | sublimelinter.py | Python | mit | 15,716 |
#!/usr/bin/python
# 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 later version.
#
# Ansible is distributed... | thaim/ansible | lib/ansible/modules/cloud/amazon/lambda.py | Python | mit | 23,103 |
#!/usr/bin/env cctools_python
# CCTOOLS_PYTHON_VERSION 2.7 2.6
import random
import math
#-------------------------------Constants-----------------------------------
DEFAULT_MONTE_CARLO_STEPS = 100
DEFAULT_OUTPUT_PATH = '.'
DEFAULT_MDSTEPS = 10000
DEFAULT_BOUNDARY_CONDITIONS = "Vacuum"
DEFAULT_OUTPUT_FREQ = 10000
DEFA... | charleszheng44/cctools | apps/wq_replica_exchange/protomol_functions.py | Python | gpl-2.0 | 5,145 |
"""Module containing tools that are useful when benchmarking algorithms
"""
from math import hypot, sqrt
from functools import wraps
from itertools import repeat
try:
import numpy
except ImportError:
numpy = False
class translate(object):
"""Decorator for evaluation functions, it translates the objective
... | CG-F16-24-Rutgers/steersuite-rutgers | steerstats/tools/deap/benchmarks/tools.py | Python | gpl-3.0 | 11,120 |
#!/usr/bin/env python
from setuptools import setup
with open('README.txt') as f:
readme = f.read()
setup(
name="cppcheck",
description='Python script to parse the XML (version 2) output of ' +
'cppcheck and generate an HTML report using Pygments for syntax ' +
'highlightin... | geminy/aidear | snippets/cppfunc/cppcheck/cppcheck-1.80/htmlreport/setup.py | Python | gpl-3.0 | 536 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | crmccreary/openerp_server | openerp/tools/test_reports.py | Python | agpl-3.0 | 13,310 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | Johnzero/erp | openerp/addons/auction/report/photo_shadow.py | Python | agpl-3.0 | 2,248 |
# 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 by applicable law or agree... | HybridF5/nova | nova/tests/unit/objects/test_aggregate.py | Python | apache-2.0 | 8,667 |
# Copyright 2006 James Tauber and contributors
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
# Copyright (C) 2010 Serge Tarkovski <serge.tarkovski@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | Hasimir/pyjs | pyjswidgets/pyjamas/ui/GlassWidget.py | Python | apache-2.0 | 6,537 |
# 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... | karllessard/tensorflow | tensorflow/compiler/mlir/tensorflow/tests/tf_saved_model/structured_output.py | Python | apache-2.0 | 5,614 |
# Natural Language Toolkit: Interface to Weka Classsifiers
#
# Copyright (C) 2001-2008 University of Pennsylvania
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
#
# $Id: naivebayes.py 2063 2004-07-17 21:02:24Z edloper $
import time, tempfi... | hectormartinez/rougexstem | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/classify/weka.py | Python | apache-2.0 | 8,796 |
#
# 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/runners/runner.py | Python | apache-2.0 | 12,102 |
from collections import namedtuple
# Structure returned by DatabaseIntrospection.get_table_list()
TableInfo = namedtuple('TableInfo', ['name', 'type'])
# Structure returned by the DB-API cursor.description interface (PEP 249)
FieldInfo = namedtuple('FieldInfo', 'name type_code display_size internal_size precision sca... | mattseymour/django | django/db/backends/base/introspection.py | Python | bsd-3-clause | 7,643 |
"""
GravMag: Use the DipoleMagDir class to estimate the magnetization direction
of dipoles with known centers
"""
import numpy
from fatiando import mesher, gridder
from fatiando.utils import ang2vec, vec2ang, contaminate
from fatiando.gravmag import sphere
from fatiando.vis import mpl
from fatiando.gravmag.magdir impo... | eusoubrasileiro/fatiando_seismic | cookbook/gravmag_magdir_dipolemagdir.py | Python | bsd-3-clause | 2,519 |