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 |
|---|---|---|---|---|---|
#!/usr/bin/env python3
#
# Copyright (C) 2018-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | espressomd/espresso | maintainer/gh_post_style_patch.py | Python | gpl-3.0 | 2,704 |
#!/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... | zahodi/ansible | lib/ansible/modules/cloud/amazon/ec2_asg.py | Python | gpl-3.0 | 38,091 |
import lxml.html as l
import requests
def key_char_parse(char_id):
url = 'https://vndb.org/c' + str(char_id)
page = requests.get(url)
root = l.fromstring(page.text)
name = root.cssselect('.mainbox h1')[0].text
kanji_name = root.cssselect('.mainbox h2.alttitle')[0].text
img = 'https:' + root.c... | aurora-pro/apex-sigma | sigma/plugins/fun/vn_char.py | Python | gpl-3.0 | 2,210 |
# -*- coding: utf-8 -*-
"""
pythoner.net
Copyright (C) 2013 PYTHONER.ORG
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 versio... | yohn89/pythoner.net | pythoner/accounts/admin.py | Python | gpl-3.0 | 915 |
from django.conf.urls.defaults import *
from indivo.views import *
from indivo.lib.utils import MethodDispatcher
urlpatterns = patterns('',
(r'^$', MethodDispatcher({
'DELETE' : carenet_delete})),
(r'^/rename$', MethodDispatcher({
'POST' : carenet_rename})),
(r'^/record$', ... | sayan801/indivo_server | indivo/urls/carenet.py | Python | gpl-3.0 | 1,997 |
# coding: utf-8
import json
import logging
import dateutil.parser
import pytz
from werkzeug import urls
from odoo import api, fields, models, _
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.addons.payment_paypal.controllers.main import PaypalController
from odoo.tools.float_utils ... | t3dev/odoo | addons/payment_paypal/models/payment.py | Python | gpl-3.0 | 11,083 |
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# b... | nvoron23/python-weka-wrapper | tests/wekatests/plottests/experiments.py | Python | gpl-3.0 | 2,900 |
# lint-amnesty, pylint: disable=missing-module-docstring
from unittest.mock import patch
from django.test import TestCase
from common.djangoapps.track.backends.mongodb import MongoBackend
class TestMongoBackend(TestCase): # lint-amnesty, pylint: disable=missing-class-docstring
def setUp(self):
super().... | eduNEXT/edx-platform | common/djangoapps/track/backends/tests/test_mongodb.py | Python | agpl-3.0 | 1,162 |
"""Capa's specialized use of codejail.safe_exec."""
import hashlib
from codejail.safe_exec import SafeExecException, json_safe
from codejail.safe_exec import not_safe_exec as codejail_not_safe_exec
from codejail.safe_exec import safe_exec as codejail_safe_exec
from edx_django_utils.monitoring import function_trace
i... | eduNEXT/edx-platform | common/lib/capa/capa/safe_exec/safe_exec.py | Python | agpl-3.0 | 6,279 |
from ddt import ddt, data
from django.core.urlresolvers import reverse
from django.test import TestCase
import mock
from analyticsclient.exceptions import NotFoundError
from courses.tests import SwitchMixin
from courses.tests.test_views import ViewTestMixin, DEMO_COURSE_ID, DEPRECATED_DEMO_COURSE_ID
from courses.tests... | open-craft/edx-analytics-dashboard | analytics_dashboard/courses/tests/test_views/test_csv.py | Python | agpl-3.0 | 5,748 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from odoo import api, fields, models
class ProductProduct(models.Model):
_inherit = "product.product"
date_from = fields.Date(compute='_compute_product_margin_fields_values', string='Margin Date F... | ygol/odoo | addons/product_margin/models/product_product.py | Python | agpl-3.0 | 9,711 |
# clean sequences after alignment, criteria based on sequences
# make inline with canonical ordering (no extra gaps)
import os, datetime, time, re
from itertools import izip
from Bio.Align import MultipleSeqAlignment
from Bio.Seq import Seq
from scipy import stats
import numpy as np
class virus_clean(object):
"""doc... | doerlbh/Indie-nextflu | augur/src/virus_clean.py | Python | agpl-3.0 | 3,403 |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('contentstore.rest_api.v1.serializers', 'cms.django... | eduNEXT/edunext-platform | import_shims/studio/contentstore/rest_api/v1/serializers.py | Python | agpl-3.0 | 431 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class XorgServer(AutotoolsPackage, XorgPackage):
"""X.Org Server is the free and open source imp... | iulian787/spack | var/spack/repos/builtin/packages/xorg-server/package.py | Python | lgpl-2.1 | 2,055 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | lib/spack/spack/cmd/cd.py | Python | lgpl-2.1 | 1,684 |
#
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal su... | harmy/kbengine | kbe/res/scripts/common/Lib/sre_constants.py | Python | lgpl-3.0 | 7,444 |
"""
Multiple dictation constructs
===============================================================================
This file is a showcase investigating the use and functionality of multiple
dictation elements within Dragonfly speech recognition grammars.
The first part of this file (i.e. the module's doc string) cont... | Versatilus/dragonfly | dragonfly/examples/test_multiple_dictation.py | Python | lgpl-3.0 | 7,289 |
import os
import unittest
from mock import patch, Mock
from tests.utils import (
FakedCache,
ObjectWithSignals,
setup_test_env,
)
setup_test_env()
from softwarecenter.db.database import StoreDatabase
from softwarecenter.ui.gtk3.views import lobbyview
from softwarecenter.ui.gtk3.widgets.exhibits import (... | sti-lyneos/shop | tests/gtk3/test_exhibits.py | Python | lgpl-3.0 | 6,973 |
# 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):
# Adding model 'Result'
db.create_table('taxonomy_result', (
('id', self.gf('django.db.models.... | zuck/prometeo-erp | core/taxonomy/migrations/0001_initial.py | Python | lgpl-3.0 | 8,429 |
#
# 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... | airbnb/airflow | tests/providers/google/cloud/operators/test_cloud_memorystore_system.py | Python | apache-2.0 | 2,251 |
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... | saradbowman/osf.io | api_tests/nodes/views/test_node_children_list.py | Python | apache-2.0 | 29,554 |
# Copyright 2015 Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | samstav/fastfood | fastfood/book.py | Python | apache-2.0 | 10,125 |
# 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 applicable... | ntt-sic/nova | nova/api/openstack/compute/contrib/flavormanage.py | Python | apache-2.0 | 3,894 |
# Copyright (c) 2013-2016 Cinchapi 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 wr... | remiemalik/concourse | concourse-driver-python/tests/integration_tests.py | Python | apache-2.0 | 87,056 |
"""Support for OpenWRT (ubus) routers."""
import logging
import re
from openwrt.ubus import Ubus
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CON... | jawilson/home-assistant | homeassistant/components/ubus/device_tracker.py | Python | apache-2.0 | 5,843 |
"""Support for Switchbot devices."""
from asyncio import Lock
import switchbot # pylint: disable=import-error
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SENSOR_TYPE, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNo... | home-assistant/home-assistant | homeassistant/components/switchbot/__init__.py | Python | apache-2.0 | 4,051 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/system/systemglobal_authenticationpolicy_binding.py | Python | apache-2.0 | 6,831 |
"""
Drone.io badge generator.
Currently set up to work on Mac.
Requires Pillow.
"""
import os
from PIL import Image, ImageDraw, ImageFont
SIZE = (95, 18)
def hex_colour(hex):
if hex[0] == '#':
hex = hex[1:]
return (
int(hex[:2], 16),
int(hex[2:4], 16),
int(hex[4:6], 16),
... | 21strun/django-coverage | assets/badges/drone.io/badge_maker.py | Python | apache-2.0 | 1,424 |
# -*- 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, Version 2.0 (the "Lic... | sparkslabs/kamaelia_ | Sketches/JT/Jam/library/trunk/Axon/SchedulingComponent.py | Python | apache-2.0 | 3,988 |
# 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... | ppwwyyxx/tensorflow | tensorflow/python/training/checkpoint_utils.py | Python | apache-2.0 | 19,434 |
# 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 a... | aljim/deploymentmanager-samples | examples/v2/waiter/instance.py | Python | apache-2.0 | 2,634 |
# 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 agreed to in writing, s... | clarko1/Cramd | bigquery/api/getting_started_test.py | Python | apache-2.0 | 808 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | dmlc/tvm | apps/topi_recipe/gemm/gemm_int8.py | Python | apache-2.0 | 5,879 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | vedujoshi/os_tempest | tempest/services/volume/json/snapshots_client.py | Python | apache-2.0 | 7,293 |
import os
from segments import Segment, theme
from utils import colors, glyphs
class CurrentDir(Segment):
bg = colors.background(theme.CURRENTDIR_BG)
fg = colors.foreground(theme.CURRENTDIR_FG)
def init(self, cwd):
home = os.path.expanduser('~')
self.text = cwd.replace(home, '~')
class... | nimiq/promptastic | segments/filesystem.py | Python | apache-2.0 | 916 |
from PyQt4 import QtGui, QtCore, QtSvg
from PyQt4.QtCore import QMimeData
from PyQt4.QtGui import QGraphicsScene, QGraphicsView, QWidget, QApplication
from Orange.data.io import FileFormat
class ImgFormat(FileFormat):
@staticmethod
def _get_buffer(size, filename):
raise NotImplementedError
@stat... | qPCR4vir/orange3 | Orange/widgets/io.py | Python | bsd-2-clause | 4,645 |
#! /usr/bin/python
"""versioneer.py
(like a rocketeer, but for versions)
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Version: 0.7+
This file helps distutils-based projects manage their version number by just
creating version-control tags.
For developers who work from a V... | sahat/bokeh | versioneer.py | Python | bsd-3-clause | 25,525 |
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.views import generic
from regressiontests.generic_views.models import Artist, Author, Book, Page
from regressiontests.generic_views.forms import Author... | faun/django_test | tests/regressiontests/generic_views/views.py | Python | bsd-3-clause | 3,421 |
"""A connection adapter that tries to use the best polling method for the
platform pika is running on.
"""
import os
import logging
import socket
import select
import errno
import time
from operator import itemgetter
from collections import defaultdict
import threading
import pika.compat
from pika.compat import dictk... | reddec/pika | pika/adapters/select_connection.py | Python | bsd-3-clause | 21,137 |
from __future__ import division, absolute_import, print_function
import sys
if sys.version_info[0] >= 3:
from io import StringIO
else:
from io import StringIO
import compiler
import inspect
import textwrap
import tokenize
from .compiler_unparse import unparse
class Comment(object):
""" A comment block.... | nguy/artview | docs/sphinxext/numpydoc/comment_eater.py | Python | bsd-3-clause | 5,425 |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns(
'popcorn_gallery.users.views',
url(r'^edit/$', 'edit', name='users_edit'),
url(r'^delete/$', 'delete_profile', name='users_delete'),
url(r'^(?P<username>[\w-]+)/$', 'profile', name='users_profile'),
)
| mozilla/popcorn_maker | popcorn_gallery/users/urls.py | Python | bsd-3-clause | 294 |
import copy
from django import forms
from django.db import models
from django.core.exceptions import ValidationError, ImproperlyConfigured
from django.db.models.fields.subclassing import Creator
from djangae.forms.fields import ListFormField
from django.utils.text import capfirst
class _FakeModel(object):
"""
... | nealedj/djangae | djangae/fields/iterable.py | Python | bsd-3-clause | 10,309 |
from __future__ import absolute_import
from datetime import datetime
from django.utils import timezone
from django.core.urlresolvers import reverse
from sentry.models import (
ProcessingIssue, EventError, RawEvent, EventProcessingIssue
)
from sentry.testutils import APITestCase
class ProjectProjectProcessingIss... | BuildingLink/sentry | tests/sentry/api/endpoints/test_project_processingissues.py | Python | bsd-3-clause | 4,405 |
"""Tools for manipulating of large commutative expressions. """
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.compatibility import iterable, is_sequence, SYMPY_INTS
from sympy.core.mul import Mul, _keep_coeff
from sympy.core.power import Pow
from sympy.core.basic impor... | kmacinnis/sympy | sympy/core/exprtools.py | Python | bsd-3-clause | 41,487 |
# Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from tvtk.tools.tvtk_doc import TVTKFilterChooser, TVTK_FILTERS
# Local imports.
from mayavi.filters.filter_base import FilterBase
from mayavi.core.common import ... | dmsurti/mayavi | mayavi/filters/user_defined.py | Python | bsd-3-clause | 3,082 |
"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | loli/semisupervisedforests | sklearn/feature_selection/univariate_selection.py | Python | bsd-3-clause | 18,609 |
# coding=utf-8
from __future__ import absolute_import
from .base import *
# ######### IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
},
} | manazag/hopper.pw | hopperpw/hopperpw/settings/test.py | Python | bsd-3-clause | 229 |
VERSION = (1, 0, 0,)
__version__ = '.'.join(map(str, VERSION))
default_app_config = 'admin_sso.apps.AdminSSOConfig'
# Do not use Django settings at module level as recommended
try:
from django.utils.functional import LazyObject
except ImportError:
pass
else:
class LazySettings(LazyObject):
def _se... | frog32/django-admin-sso | admin_sso/__init__.py | Python | bsd-3-clause | 716 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import versioneer
__author__ = 'Chia-Jung, Yang'
__email__ = 'jeroyang@gmail.com'
__version__ = versioneer.get_version()
from ._version imp... | jeroyang/newsletter | newsletter/__init__.py | Python | bsd-3-clause | 394 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis as vv
import numpy as np
import os
# Try importing imageio
imageio = None
try:
import imageio
except ImportError:
pass
... | chrisidefix/visvis | functions/volread.py | Python | bsd-3-clause | 1,322 |
""" test positional based indexing with iloc """
from datetime import datetime
import re
from warnings import (
catch_warnings,
simplefilter,
)
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
NA,
Categorical,
CategoricalDtype,
DataFrame,
In... | rs2/pandas | pandas/tests/indexing/test_iloc.py | Python | bsd-3-clause | 46,354 |
"""
Copyright (c) 2012-2016 Ben Croston
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribut... | anatolieGhebea/contatore | python/RPi.GPIO-0.6.3/RPi/GPIO/__init__.py | Python | mit | 1,112 |
from __future__ import print_function
from .patchpipette import PatchPipette
| pbmanis/acq4 | acq4/devices/PatchPipette/__init__.py | Python | mit | 77 |
from io import BytesIO
import tempfile
import os
import time
import shutil
from contextlib import contextmanager
import six
import sys
from netlib import utils, tcp, http
def treader(bytes):
"""
Construct a tcp.Read object from bytes.
"""
fp = BytesIO(bytes)
return tcp.Reader(fp)
@contextma... | tdickers/mitmproxy | netlib/tutils.py | Python | mit | 3,536 |
# extension imports
from _NetworKit import PageRankNibble, GCE | fmaschler/networkit | networkit/scd.py | Python | mit | 62 |
"""
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... | Solid-Mechanics/matplotlib-4-abaqus | matplotlib/sphinxext/plot_directive.py | Python | mit | 27,667 |
"""
accounts.test_views
===================
Tests the REST API calls.
Add more specific social registration tests
"""
import responses
from django.core.urlresolvers import reverse
from django.core import mail
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
... | JTarball/docker-django-polymer | docker/app/app/backend/apps/accounts/test_views.py | Python | gpl-2.0 | 42,275 |
"""
This page is in the table of contents.
Plugin to home the tool at beginning of each layer.
The home manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Home
==Operation==
The default 'Activate Home' checkbox is on. When it is on, the functions described below will work, when it is off, not... | makerbot/ReplicatorG | skein_engines/skeinforge-47/skeinforge_application/skeinforge_plugins/craft_plugins/home.py | Python | gpl-2.0 | 8,040 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# This file is part of Fail2Ban.
#
# Fail2Ban 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;... | nawawi/fail2ban | fail2ban/__init__.py | Python | gpl-2.0 | 2,770 |
# -*- coding: utf-8 -*-
#
# python-problem documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 4 12:03:58 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... | mhabrnal/abrt | src/python-problem/doc/conf.py | Python | gpl-2.0 | 8,344 |
'''
Copyright (C) 2014 Travis DeWolf
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope t... | russellgeoff/blog | Control/Controllers/target_list.py | Python | gpl-3.0 | 2,121 |
# -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import sys
import datetime
from core.transmissionrpc.constants import PRIORITY, RATIO_LIMIT, IDLE_LIMIT
from core.transmissionrpc.utils import Field, format_timedelta
from six import integer_types... | bbsan2k/nzbToMedia | core/transmissionrpc/torrent.py | Python | gpl-3.0 | 16,349 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, 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... | pford68/nupic.research | sensorimotor/sensorimotor/sensorimotor_experiment_runner.py | Python | gpl-3.0 | 9,403 |
"""
Tests for Blocks api.py
"""
from django.test.client import RequestFactory
from course_blocks.tests.helpers import EnableTransformerRegistryMixin
from student.tests.factories import UserFactory
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestC... | antoviaque/edx-platform | lms/djangoapps/course_api/blocks/tests/test_api.py | Python | agpl-3.0 | 2,533 |
"""This *was* the parser for the current HTML format on parl.gc.ca.
But now we have XML. See parl_document.py.
This module is organized like so:
__init__.py - utility functions, simple parse interface
common.py - infrastructure used in the parsers, i.e. regexes
current.py - parser for the Hansard format used from 200... | twhyte/openparliament | parliament/imports/hans_old/current.py | Python | agpl-3.0 | 11,722 |
import re
import uuid
from xmodule.assetstore.assetmgr import AssetManager
XASSET_LOCATION_TAG = 'c4x'
XASSET_SRCREF_PREFIX = 'xasset:'
XASSET_THUMBNAIL_TAIL_NAME = '.jpg'
STREAM_DATA_CHUNK_SIZE = 1024
import os
import logging
import StringIO
from urlparse import urlparse, urlunparse, parse_qsl
from urllib import ... | MakeHer/edx-platform | common/lib/xmodule/xmodule/contentstore/content.py | Python | agpl-3.0 | 14,964 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2015 Julien Veyssier, Laurent Bachelier
#
# 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 L... | sputnick-dev/weboob | modules/piratebay/browser.py | Python | agpl-3.0 | 2,463 |
"""This module implement decorators for wrapping data sources so as to
simplify their construction and attribution of properties.
"""
import functools
def data_source_generator(name=None, **properties):
"""Decorator for applying to a simple data source which directly
returns an iterable/generator with the me... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/samplers/decorators.py | Python | agpl-3.0 | 1,626 |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (c) 2010-2017, GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
#License a... | gem/oq-hazardlib | openquake/hmtk/strain/regionalisation/__init__.py | Python | agpl-3.0 | 1,925 |
class Extension(object):
"""
Base class for creating extensions.
Args:
kwargs[dict]: All key, value pairings are stored as "configuration" options, see getConfigs.
"""
def __init__(self, **kwargs):
#: Configure options
self._configs = kwargs
self._configs.setdefault('headings', ['section', '... | vityurkiv/Ox | python/MooseDocs/html2latex/Extension.py | Python | lgpl-2.1 | 735 |
#!/usr/bin/python
import math
import Sofa
def tostr(L):
return str(L).replace('[', '').replace("]", '').replace(",", ' ')
def transform(T,p):
return [T[0][0]*p[0]+T[0][1]*p[1]+T[0][2]*p[2]+T[1][0],T[0][3]*p[0]+T[0][4]*p[1]+T[0][5]*p[2]+T[1][1],T[0][6]*p[0]+T[0][7]*p[1]+T[0][8]*p[2]+T[1][2]]
def transformF(T,F):
re... | FabienPean/sofa | applications/plugins/Flexible/examples/patch_test/FEM.py | Python | lgpl-2.1 | 6,005 |
# 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 Serf(SConsPackage):
"""Apache Serf - a high performance C-based HTTP client library
bu... | LLNL/spack | var/spack/repos/builtin/packages/serf/package.py | Python | lgpl-2.1 | 3,412 |
# 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 Qnnpack(CMakePackage):
"""QNNPACK (Quantized Neural Networks PACKage) is a mobile-optimize... | LLNL/spack | var/spack/repos/builtin/packages/qnnpack/package.py | Python | lgpl-2.1 | 3,348 |
import unittest
from ctypes import *
from struct import calcsize
import _testcapi
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
class X(Structure):
_fields_ = [("a", c_int)]
class Y(X):
_fields_ = [("b", c_int)]
class Z(X):
pass
... | LaoZhongGu/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_structures.py | Python | lgpl-3.0 | 15,782 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | dmlc/tvm | tests/python/unittest/test_tir_transform_simplify.py | Python | apache-2.0 | 5,007 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# 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
# ... | mcgonagle/ansible_f5 | library_old/iworkflow_license_pool.py | Python | apache-2.0 | 10,879 |
# ./darwinpush/xb/raw/sm.py
# -*- coding: utf-8 -*-
# PyXB bindings for NM:8eb48f8f0e727f488907a816c69d6ed98ba221c7
# Generated 2015-04-23 16:42:14.513978 by PyXB version 1.2.4 using Python 3.4.1.final.0
# Namespace http://www.thalesgroup.com/rtti/PushPort/StationMessages/v1 [xmlns:sm]
from __future__ import unicode_l... | HackTrain/darwinpush | darwinpush/xb/raw/sm.py | Python | apache-2.0 | 22,743 |
from urlparse import urlparse
from api_tests.nodes.views.test_node_contributors_list import NodeCRUDTestCase
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from tests.base import fake
from osf_tests.factories import (
ProjectFactory,
... | monikagrabowska/osf.io | api_tests/registrations/views/test_withdrawn_registrations.py | Python | apache-2.0 | 7,865 |
from collections import OrderedDict
from app.master.atom_grouper import AtomGrouper
class TimeBasedAtomGrouper(object):
"""
This class implements the algorithm to best split & group atoms based on historic time values. This algorithm is
somewhat complicated, so I'm going to give a summary here.
~~~~~... | nickzuber/ClusterRunner | app/master/time_based_atom_grouper.py | Python | apache-2.0 | 11,090 |
"""
Tests for the integration test suite itself.
"""
import logging
import os
import subprocess
from collections import defaultdict
from pathlib import Path
from typing import Set
import yaml
from get_test_group import patterns_from_group
__maintainer__ = 'adam'
__contact__ = 'tools-infra-team@mesosphere.io'
log =... | GoelDeepak/dcos | packages/dcos-integration-test/extra/test_meta.py | Python | apache-2.0 | 3,623 |
# Copyright (c) 2012 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... | Juniper/neutron | neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py | Python | apache-2.0 | 24,807 |
# 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... | MJJoyce/climate | ocw/tests/test_dataset.py | Python | apache-2.0 | 8,091 |
# 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 ... | tmgstevens/flume | flume-ng-doc/sphinx/conf.py | Python | apache-2.0 | 3,274 |
# 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... | szha/mxnet | python/mxnet/gluon/probability/distributions/cauchy.py | Python | apache-2.0 | 2,935 |
from django.conf.urls import url
from admin.nodes import views
app_name = 'admin'
urlpatterns = [
url(r'^$', views.NodeFormView.as_view(),
name='search'),
url(r'^flagged_spam$', views.NodeFlaggedSpamList.as_view(),
name='flagged-spam'),
url(r'^known_spam$', views.NodeKnownSpamList.as_view(... | pattisdr/osf.io | admin/nodes/urls.py | Python | apache-2.0 | 2,100 |
#
# 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/operators/dummy_operator.py | Python | apache-2.0 | 1,203 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | Peddle/hue | desktop/core/src/desktop/lib/test_utils.py | Python | apache-2.0 | 2,861 |
"""Support for the Foobot indoor air quality monitor."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
from foobot_async import FoobotClient
import voluptuous as vol
from homeassistant.const import (
ATTR_TEMPERATURE,
ATTR_TIME,
CONF_TOKEN,
CONF_USERNAME,
TEMP_CELSIUS... | leppa/home-assistant | homeassistant/components/foobot/sensor.py | Python | apache-2.0 | 4,894 |
import six
from hamcrest.core.base_matcher import Matcher
from hamcrest.core.core.isequal import equal_to
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
import types
def wrap_matcher(x):
"""Wraps argument in a matcher, if necessary.
:returns: the ... | axbaretto/beam | sdks/python/.tox/py27gcp/lib/python2.7/site-packages/hamcrest/core/helpers/wrap_matcher.py | Python | apache-2.0 | 880 |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | CraigHarris/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/transaction_management/skip_checkpoint_abort_transaction/test_skip_checkpoint_abort_transaction.py | Python | apache-2.0 | 3,466 |
# 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... | Brocade-OpenSource/OpenStack-DNRM-Neutron | neutron/db/migration/alembic_migrations/versions/3b54bf9e29f7_nec_plugin_sharednet.py | Python | apache-2.0 | 2,645 |
from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class PrintTests(TranspileTestCase):
def test_fileobj(self):
self.assertCodeExecution("""
class FileLikeObject:
def __init__(self):
self.buffer = ''
def write(self, content):
... | pombredanne/voc | tests/builtins/test_print.py | Python | bsd-3-clause | 1,816 |
for astTuple in Query.input.tuples('ast'):
if type(astTuple.ast) is Field:
modifiers = astTuple.ast.modifiers
nonFinalPublic = modifiers.isSet(Modifier.ModifierFlag.Public) and not modifiers.isSet(Modifier.ModifierFlag.Final)
if not nonFinalPublic:
Query.input.remove(astTuple)
Q... | Vaishal-shah/Envision | InformationScripting/scripts/evaluation/nonFinalPublic.py | Python | bsd-3-clause | 345 |
"""
This module contains some assorted functions used in tests
"""
from __future__ import absolute_import
import os
from importlib import import_module
from twisted.trial.unittest import SkipTest
from scrapy.exceptions import NotConfigured
from scrapy.utils.boto import is_botocore
def assert_aws_environ():
"""... | umrashrf/scrapy | scrapy/utils/test.py | Python | bsd-3-clause | 3,020 |
#!/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.
"""Tests for jni_generator.py.
This test suite contains various tests for the JNI generator.
It exercises the low-level parser all... | heke123/chromium-crosswalk | base/android/jni_generator/jni_generator_tests.py | Python | bsd-3-clause | 39,812 |
import json
import mock
from sentry.plugins.helpers import get_option, set_option
from sentry.testutils import TestCase
from sentry.models import set_sentry_version, Option
from sentry.tasks.check_update import check_update, PYPI_URL
class CheckUpdateTest(TestCase):
OLD = '5.0.0'
CURRENT = '5.5.0-DEV'
... | beni55/sentry | tests/sentry/tasks/check_update/tests.py | Python | bsd-3-clause | 1,970 |
"""
Tests for structural time series models
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import pandas as pd
import os
import warnings
from statsmodels.datasets import macrodata
from statsmodels.tsa.statespace import structural
fr... | saketkc/statsmodels | statsmodels/tsa/statespace/tests/test_structural.py | Python | bsd-3-clause | 9,003 |
#!/usr/bin/python
# encoding: utf-8
# Jan 2011 (markus kossner) Cleaned up the code, added some documentation
# somwhere around Aug 2008 (markus kossner) created
#
# This script extracts the molecular framework for a database of molecules.
# You can use two modes (hard coded):
# - Scaff: The molecular fr... | soerendip42/rdkit | Contrib/M_Kossner/Frames.py | Python | bsd-3-clause | 6,124 |
from django.shortcuts import render
def home(request):
return render(request, 'home.html', {})
| Traviskn/django_starter_template | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/views.py | Python | mit | 101 |
# Check the various features of the ShTest format.
#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out
# RUN: FileCheck < %t.out %s
#
# END.
# CHECK: -- Testing:
# CHECK: FAIL: shtest-format :: external_shell/fail.txt
# CHECK: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED ***
# CHECK: Command Ou... | dbrumley/recfi | llvm-3.3/utils/lit/tests/shtest-format.py | Python | mit | 1,371 |