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 python
# -*- coding: utf-8 -*-
# Copyright 2013-2014, Nigel Small
#
# 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... | mariosky/evo-drawings | venv/lib/python2.7/site-packages/py2neo/packages/httpstream/__init__.py | Python | agpl-3.0 | 842 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# 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 F... | Tigerwhit4/taiga-back | taiga/projects/tasks/api.py | Python | agpl-3.0 | 7,479 |
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from actstream.exceptions import check_actionable_model
def follow(user, obj, send_action=True, actor_only=False, request=None):
"""
Creates a relationship al... | pirata-cat/agora-ciudadana | actstream/actions.py | Python | agpl-3.0 | 3,984 |
"""
Tests for xblock_utils.py
"""
import uuid
import ddt
import six
from django.conf import settings
from django.test.client import RequestFactory
from mock import patch
from opaque_keys.edx.asides import AsideUsageKeyV1, AsideUsageKeyV2
from web_fragments.fragment import Fragment
from xblock.core import XBlockAside... | msegado/edx-platform | openedx/core/lib/tests/test_xblock_utils.py | Python | agpl-3.0 | 9,421 |
#!/usr/bin/env python
from peacock.utils import TerminalUtils
from peacock.utils import Testing
from PyQt5 import QtWidgets
class Tests(Testing.PeacockTester):
qapp = QtWidgets.QApplication([])
def test_convert(self):
output = "\33[1m\33[31mred <&> text\33[39m"
html_output = TerminalUtils.term... | Chuban/moose | python/peacock/tests/utils/test_TerminalUtils.py | Python | lgpl-2.1 | 923 |
import sys, os, platform, math
import Sofa
import Flexible.IO
import Flexible.sml
import SofaPython.Tools
from SofaPython.Tools import listToStr as concat
import numpy
from numpy import linalg
# variables
__file = __file__.replace('\\', '/') # windows
CURRENTDIR = os.path.dirname(os.path.abspath(__fil... | FabienPean/sofa | applications/plugins/SofaPython/examples/sceneDataIO_write.py | Python | lgpl-2.1 | 5,843 |
from __future__ import absolute_import, unicode_literals
import logging
import pykka
logger = logging.getLogger(__name__)
def send(cls, event, **kwargs):
listeners = pykka.ActorRegistry.get_by_class(cls)
logger.debug('Sending %s to %s: %s', event, cls.__name__, kwargs)
for listener in listeners:
... | mokieyue/mopidy | mopidy/listener.py | Python | apache-2.0 | 1,658 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | junneyang/taskflow | taskflow/tests/unit/worker_based/test_pipeline.py | Python | apache-2.0 | 3,812 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions Srl
# 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.ap... | ntt-sic/nova | nova/virt/hyperv/vhdutils.py | Python | apache-2.0 | 7,795 |
"""Demo platform that has a couple of fake sensors."""
from __future__ import annotations
from typing import Any
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
CONCENTR... | sander76/home-assistant | homeassistant/components/demo/sensor.py | Python | apache-2.0 | 3,738 |
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... | CropCircleSys/bsd-cloudinit | cloudbaseinit/openstack/common/log.py | Python | apache-2.0 | 26,597 |
from hamcrest import assert_that, not_, is_
from hamcrest import has_length
from hamcrest.core.base_matcher import BaseMatcher
def has_xpath(xpath, matcher):
return XPathMatcher(xpath, matcher)
class XPathMatcher(BaseMatcher):
def __init__(self, xpath, matcher):
self.xpath = xpath
self.match... | internap/fake-switches | tests/juniper/assertion_tools.py | Python | apache-2.0 | 679 |
# Copyright 2013 IBM Corp.
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses... | tlakshman26/cinder-https-changes | cinder/tests/unit/test_ibm_xiv_ds8k.py | Python | apache-2.0 | 30,480 |
class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
n = len(haystack)
m = len(needle)
for i in range(n + 1 - m):
matched = True
for k in range(m):
... | huanqi/leetcode-python | implement_strstr/solution.py | Python | bsd-2-clause | 483 |
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
from flask.ext.wtf import Form
from digits import utils
from digits.utils import subclass
@subclass
class ConfigForm(Form):
"""
A form used to display the network output as an image
"""
colorm... | ethantang95/DIGITS | digits/extensions/view/imageSegmentation/forms.py | Python | bsd-3-clause | 633 |
from .enums import IncrementalSearchDirection
from .filters import SimpleFilter, Never
__all__ = (
'SearchState',
)
class SearchState(object):
"""
A search 'query'.
"""
__slots__ = ('text', 'direction', 'ignore_case')
def __init__(self, text='', direction=IncrementalSearchDirection.FORWARD, ... | ddalex/python-prompt-toolkit | prompt_toolkit/search_state.py | Python | bsd-3-clause | 1,105 |
# 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 cStringIO
import json
import logging
import unittest
from telemetry.core import util
from telemetry.timeline import model
from telemetry.timeline imp... | ondra-novak/chromium.src | tools/telemetry/telemetry/core/backends/chrome/tracing_backend_unittest.py | Python | bsd-3-clause | 2,594 |
"""
Multiclass and multilabel classification strategies
===================================================
This module implements multiclass learning algorithms:
- one-vs-the-rest / one-vs-all
- one-vs-one
- error correcting output codes
The estimators provided in this module are meta-estimators: they re... | Vimos/scikit-learn | sklearn/multiclass.py | Python | bsd-3-clause | 28,158 |
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import MigrationGraph
from django.test import modify_settings, override_settings, TestCase
from django.apps.registry import apps as global_apps
from .test_base import MigrationTestBase
@modify... | Sonicbids/django | tests/migrations/test_executor.py | Python | bsd-3-clause | 19,946 |
from __future__ import unicode_literals
from datetime import date
from django.conf import settings
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.auth.tests.custom_user import ExtensionUser, CustomPermission... | mammique/django | django/contrib/auth/tests/auth_backends.py | Python | bsd-3-clause | 15,671 |
import FWCore.ParameterSet.Config as cms
import pickle
process = pickle.load(open('PSet.pkl', 'rb'))
| avkhadiev/bbtoDijet | bbtoDijetAnalyzer/test/crab_test_bbtoDijetAnalyzer_test/crab_bbtoDijetAnalyzer_test/inputs/PSet.py | Python | mit | 101 |
# -*- coding: utf-8 -*-
u"""
.. module:: utils
"""
from django.contrib.admin.models import LogEntry
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import get_object_or_404
from django.shortcuts import redirect
from django.utils.text import s... | KrzysztofMadejski/volontulo | apps/volontulo/utils.py | Python | mit | 2,269 |
"""empty message
Revision ID: 44c3becf9745
Revises: 34d183116728
Create Date: 2015-02-01 17:18:35.172244
"""
# revision identifiers, used by Alembic.
revision = '44c3becf9745'
down_revision = '34d183116728'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | WatchPeopleCode/WatchPeopleCode | migrations/versions/44c3becf9745_.py | Python | mit | 884 |
# -*- coding: utf-8 -*-
import os
import re
from .cache_utils import cpickle_cache
from ._current_dir import current_dir
from .design_pattern import singleton, cached_property
@singleton()
class LazyData(object):
@cached_property
def en_us_dict(self):
"""
werid example.
>>> en_us_dic... | Luiti/etl_utils | etl_utils/lazy_data.py | Python | mit | 3,045 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscópio Tecnologia
# Author: Luciana Fujii Pontello <luciana@holoscopio.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 version 2 of... | Geheimorganisation/sltv | sltv/effect/video_effect.py | Python | gpl-2.0 | 1,698 |
#!/usr/bin/env python
#
import sys, cpp, kernel, glob, os, re, getopt, clean_header
from defaults import *
from utils import *
def usage():
print """\
usage: %(progname)s [kernel-original-path]
this program is used to update all the auto-generated clean headers
used by the Bionic C library. it assumes t... | zunaid321/Lenovo_A820_kernel_kk | bionic/libc/kernel/tools/update_all.py | Python | gpl-2.0 | 2,397 |
# This file is part of PyBing (http://pybing.googlecode.com).
#
# Copyright (C) 2009 JJ Geewax http://geewax.org/
# All rights reserved.
#
# This software is licensed as described in the file COPYING.txt,
# which you should have received as part of this distribution.
"""
This module holds the Bing WebQuery class use... | forweipan/fimap | src/pybing/query/web.py | Python | gpl-2.0 | 514 |
# -*- coding: utf-8 -*-
#
# Cherokee-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free S... | cherokee/webserver | admin/Handler.py | Python | gpl-2.0 | 1,775 |
#!/usr/bin/env python
import os
import sys
from glob import glob
sys.path.insert(0, os.path.abspath('lib'))
from ansible import __version__, __author__
from distutils.core import setup
# find library modules
from ansible.constants import DEFAULT_MODULE_PATH
dirs=os.listdir("./library/")
data_files = []
for i in dirs... | bezhermoso/home | setup.py | Python | gpl-3.0 | 1,396 |
"""
URLs for the Enrollment API
"""
from django.conf import settings
from django.conf.urls import url
from .views import (
CourseEnrollmentsApiListView,
EnrollmentCourseDetailView,
EnrollmentListView,
EnrollmentUserRolesView,
EnrollmentView,
UnenrollmentView
)
urlpatterns = [
url(r'^enr... | stvstnfrd/edx-platform | openedx/core/djangoapps/enrollments/urls.py | Python | agpl-3.0 | 1,148 |
"""
These views handle all actions in Studio related to import and exporting of
courses
"""
import base64
import logging
import os
import re
import shutil
import tarfile
from path import Path as path
from tempfile import mkdtemp
from django.conf import settings
from django.contrib.auth.decorators import login_required... | devs1991/test_edx_docmode | cms/djangoapps/contentstore/views/import_export.py | Python | agpl-3.0 | 21,168 |
##############################################################################
# Copyright (c) 2013-2018, 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... | krafczyk/spack | var/spack/repos/builtin/packages/lumpy-sv/package.py | Python | lgpl-2.1 | 1,769 |
{
"name" : "Partner info extension",
"version" : "0.1",
"author" : "IT-Projects LLC, Ivan Yelizariev",
'license': 'GPL-3',
"category" : "Sales Management",
"website" : "https://yelizariev.github.io",
"description": """
Добавляет ИНН-КПП, расчетный счет в виджет contact
""",
"dep... | ufaks/addons-yelizariev | res_partner_ru/__openerp__.py | Python | lgpl-3.0 | 461 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# Copyright 2017 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 re... | tst-mswartz/earthenterprise | earth_enterprise/src/server/wsgi/search/plugin/coordinate_search_handler.py | Python | apache-2.0 | 10,743 |
# Copyright 2014 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 agreed ... | kimjaejoong/nova | nova/tests/unit/virt/hyperv/test_vmops.py | Python | apache-2.0 | 51,872 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Rackspace Hosting
#
# 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... | Havate/havate-openstack | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/database_backups/tables.py | Python | apache-2.0 | 3,772 |
# 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... | sxjscience/tvm | python/tvm/relay/op/image/__init__.py | Python | apache-2.0 | 900 |
# 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... | rahulunair/nova | nova/db/sqlalchemy/api_migrations/migrate_repo/versions/058_cell_mapping_add_disabled.py | Python | apache-2.0 | 974 |
# 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... | Juniper/nova | nova/tests/functional/api_sample_tests/test_server_migrations.py | Python | apache-2.0 | 8,557 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | hazelnusse/sympy-old | sympy/thirdparty/pyglet/pyglet/gl/glext_nv.py | Python | bsd-3-clause | 581,882 |
'''Tests the RPC "calculator" example.'''
import unittest
import types
from pulsar import send
from pulsar.apps import rpc, http
from pulsar.apps.test import dont_run_with_thread
from .manage import server, Root, Calculator
class TestRpcOnThread(unittest.TestCase):
app_cfg = None
concurrency = 'thread'
... | nooperpudd/pulsar | examples/calculator/tests.py | Python | bsd-3-clause | 9,018 |
from typing import Optional, Union
from .color import Color
from .console import Console, ConsoleOptions, RenderResult
from .jupyter import JupyterMixin
from .measure import Measurement
from .segment import Segment
from .style import Style
# There are left-aligned characters for 1/8 to 7/8, but
# the right-aligned ch... | pradyunsg/pip | src/pip/_vendor/rich/bar.py | Python | mit | 3,264 |
# Grayscale Bilteral Filter Example
#
# This example shows off using the bilateral filter on grayscale images.
import sensor, image, time
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565
sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others)
sensor.skip... | openmv/openmv | scripts/examples/OpenMV/04-Image-Filters/grayscale_bilateral_filter.py | Python | mit | 1,399 |
# coding=utf-8
"""
Openstack swift collector.
#### Dependencies
* swift-dispersion-report commandline tool (for dispersion report)
if using this, make sure swift.conf and dispersion.conf are reable by diamond
also get an idea of the runtime of a swift-dispersion-report call and make
sure the collect interv... | datacratic/Diamond-old | src/collectors/openstackswift/openstackswift.py | Python | mit | 3,925 |
# -*- coding: utf-8 -*-
"""
oauthlib.parameters
~~~~~~~~~~~~~~~~~~~
This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec.
.. _`section 3.5`: http://tools.ietf.org/html/rfc5849#section-3.5
"""
from __future__ import absolute_import, unicode_literals
try:
from urlparse import urlparse, url... | lucasrangit/twitter-winner | twitter-winner/oauthlib/oauth1/rfc5849/parameters.py | Python | mit | 4,909 |
#
# (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is d... | le9i0nx/ansible | lib/ansible/plugins/action/aireos.py | Python | gpl-3.0 | 3,433 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | ppanczyk/ansible | lib/ansible/modules/source_control/git.py | Python | gpl-3.0 | 44,717 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3... | iohannez/gnuradio | gr-analog/python/analog/qa_random_uniform_source.py | Python | gpl-3.0 | 2,736 |
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# 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 h... | muet/Espruino | boards/OLIMEXINO_STM32_RE.py | Python | mpl-2.0 | 4,169 |
# -*- coding: utf-8 -*-
''' Test the QMenu.addAction() method'''
import unittest
import sys
from PySide import QtGui
from helper import UsesQApplication
class QMenuAddAction(UsesQApplication):
def openFile(self, *args):
self.arg = args
def testQMenuAddAction(self):
fileMenu = QtGui.QMenu(... | M4rtinK/pyside-android | tests/QtGui/qmenuadd_test.py | Python | lgpl-2.1 | 518 |
# 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 a... | Metaswitch/calico-nova | nova/tests/unit/api/openstack/compute/contrib/test_extended_evacuate_find_host.py | Python | apache-2.0 | 4,623 |
"""
Check for ensuring logs from pods can be queried in a reasonable amount of time.
"""
import json
import time
from uuid import uuid4
from openshift_checks import OpenShiftCheckException
from openshift_checks.logging.logging import LoggingCheck
ES_CMD_TIMEOUT_SECONDS = 30
class LoggingIndexTime(LoggingCheck):
... | ttindell2/openshift-ansible | roles/openshift_health_checker/openshift_checks/logging/logging_index_time.py | Python | apache-2.0 | 4,995 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.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
#
# ... | NeCTAR-RC/ceilometer | ceilometer/api/acl.py | Python | apache-2.0 | 2,172 |
# 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... | nanditav/15712-TensorFlow | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | Python | apache-2.0 | 163,728 |
"""Test the Dexcom config flow."""
from unittest.mock import patch
from pydexcom import AccountError, SessionError
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.dexcom.const import DOMAIN, MG_DL, MMOL_L
from homeassistant.const import CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
... | lukas-hetzenecker/home-assistant | tests/components/dexcom/test_config_flow.py | Python | apache-2.0 | 4,420 |
import sys
sys.path.insert(1, "../../")
import h2o, tests
import random
def get_set_list_timezones():
origTZ = h2o.get_timezone()
print "Original timezone: {0}".format(origTZ)
timezones = h2o.list_timezones()
# don't use the first one..it's a header for the table
print "timezones[0]:", ... | brightchen/h2o-3 | h2o-py/tests/testdir_misc/pyunit_get_set_list_timezones.py | Python | apache-2.0 | 805 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
vtkbase provides some helpers to use VTK through the tvtk package (mayavi)
Code using tvtk should import it through this module
"""
import os
from .. import logging
iflogger = logging.getLogger('inte... | sgiavasis/nipype | nipype/interfaces/vtkbase.py | Python | bsd-3-clause | 1,997 |
# Copyright (c) 2004-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, o... | dbbhattacharya/kitsune | vendor/packages/pylint/pyreverse/diagrams.py | Python | bsd-3-clause | 8,677 |
# Copyright (c) 2003-2008 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, o... | dbbhattacharya/kitsune | vendor/packages/pylint/test/test_func.py | Python | bsd-3-clause | 7,955 |
#!/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.
"""
This script is based on chromium/chromium/master/tools/clang/scripts/update.py.
It is used on Windows platforms to copy the co... | chinmaygarde/flutter_engine | tools/dia_dll.py | Python | bsd-3-clause | 2,094 |
"""
Sleep sort is a proof of concept sorting algorithm that creates threads for
each number in the sorting queue and sleeps for the amount of time before
giving the result.
It has no practical usage and doesn't works for negative numbers. Also for
very close positive numbers, results are not guaranteed to be consisten... | Enether/algos | sleep_sort/sleep_sort.py | Python | mit | 1,634 |
# This file is part of beets.
# Copyright 2015, Pedro Silva.
#
# 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, mod... | ruippeixotog/beets | beetsplug/duplicates.py | Python | mit | 13,370 |
verifyOrder = {
'orderId': 1234,
'orderDate': '2013-08-01 15:23:45',
'prices': [{
'id': 1,
'laborFee': '2',
'oneTimeFee': '2',
'oneTimeFeeTax': '.1',
'quantity': 1,
'recurringFee': '2',
'recurringFeeTax': '.1',
'hourlyRecurringFee': '2',
... | cloudify-cosmo/softlayer-python | SoftLayer/testing/fixtures/SoftLayer_Product_Order.py | Python | mit | 433 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006 Ali Sabil <ali.sabil@gmail.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 version 2 of the License, or
# (at your option) any later... | billiob/papyon | papyon/gnet/message/SOAP.py | Python | gpl-2.0 | 5,704 |
# Copyright (C) 2007-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | yland/mailman3 | src/mailman/interfaces/runner.py | Python | gpl-2.0 | 4,700 |
from os import path
from enigma import eServiceCenter, eServiceReference, eTimer, pNavigation, getBestPlayableServiceReference, iPlayableService
from Components.ParentalControl import parentalControl
from Components.config import config
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDes... | schleichdi2/OpenNfr_E2_Gui-6.0 | Navigation.py | Python | gpl-2.0 | 15,954 |
# Generated by Django 2.2.11 on 2020-03-21 22:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('base', '0038_delete_backup'),
('base', '0039_auto_20200321_1338'),
]
operations = [
]
| tomkralidis/geonode | geonode/base/migrations/0040_merge_20200321_2245.py | Python | gpl-3.0 | 263 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version'... | Tatsh-ansible/ansible | lib/ansible/modules/messaging/rabbitmq_parameter.py | Python | gpl-3.0 | 4,458 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | thresholdsoftware/asylum-v2.0 | openerp/addons/mail/mail_thread.py | Python | agpl-3.0 | 79,884 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 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 License, or
# (at ... | sputnick-dev/weboob | modules/citelis/module.py | Python | agpl-3.0 | 2,036 |
#!/usr/bin/python
from lib import sensu
import argparse
import json
import time
parser = argparse.ArgumentParser(description='Sensu Silence Actions')
parser.add_argument('--client', nargs='?', required=True)
parser.add_argument('--check', nargs='?', default=False)
parser.add_argument('--expiration', nargs='?', defau... | armab/st2contrib | packs/sensu/actions/silence.py | Python | apache-2.0 | 833 |
# 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... | chemelnucfin/tensorflow | tensorflow/python/summary/writer/writer.py | Python | apache-2.0 | 17,167 |
"""composite primary key port ip association
Revision ID: 3b467be51e43
Revises: 26e984b48a0d
Create Date: 2014-10-09 15:42:58.104964
"""
# revision identifiers, used by Alembic.
revision = '3b467be51e43'
down_revision = '26e984b48a0d'
import contextlib
import itertools
from alembic import op
import sqlalchemy as s... | asadoughi/quark | quark/db/migration/alembic/versions/3b467be51e43_composite_primary_key_port_ip_.py | Python | apache-2.0 | 3,036 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
# 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/licen... | tylertian/Openstack | openstack F/python-novaclient/novaclient/v1_1/floating_ips_bulk.py | Python | apache-2.0 | 1,938 |
# 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/python/ops/tensor_array_ops_test.py | Python | apache-2.0 | 3,060 |
# Imported via `make aws_managed_policies`
aws_managed_policies_data = """
{
"AWSAccountActivityAccess": {
"Arn": "arn:aws:iam::aws:policy/AWSAccountActivityAccess",
"AttachmentCount": 0,
"CreateDate": "2015-02-06T18:41:18+00:00",
"DefaultVersionId": "v1",
"Document": {
... | botify-labs/moto | moto/iam/aws_managed_policies.py | Python | apache-2.0 | 495,649 |
"""
tests: this package contains all Scrapy unittests
see http://doc.scrapy.org/en/latest/contributing.html#running-tests
"""
import os
# ignore system-wide proxies for tests
# which would send requests to a totally unsuspecting server
# (e.g. because urllib does not fully understand the proxy spec)
os.environ['http... | rolando-contrib/scrapy | tests/__init__.py | Python | bsd-3-clause | 1,205 |
"""Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ulg.ac... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/sklearn/neighbors/regression.py | Python | mit | 10,967 |
def task_hello():
"""hello py """
def python_hello(times, text, targets):
with open(targets[0], "a") as output:
output.write(times * text)
return {'actions': [(python_hello, [3, "py!\n"])],
'targets': ["hello.txt"],
}
| gh0std4ncer/doit | doc/tutorial/tutorial_02.py | Python | mit | 276 |
#!/usr/bin/env python
"""
This activity will calculate the ratio between CPU request and Memory request by (job ID, task index, event type).
These fields are optional and could be null.
"""
# It will connect to DataStoreClient
from sciwonc.dataflow.DataStoreClient import DataStoreClient
import ConfigDB_TaskEvent_0
imp... | elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/4-mongodb-rp-3sh/9_workflow_full_10files_primary_3sh_noannot_with_proj_9s/calculateratio_0/CalculateRatioCpuMemory_0.py | Python | gpl-3.0 | 3,196 |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | Fale/ansible | lib/ansible/module_utils/urls.py | Python | gpl-3.0 | 77,490 |
# -*- coding: utf-8 -*-
import re
import time
from ..internal.Account import Account
from ..internal.misc import json
class EuroshareEu(Account):
__name__ = "EuroshareEu"
__type__ = "account"
__version__ = "0.12"
__status__ = "testing"
__description__ = """Euroshare.eu account plugin"""
__l... | Arno-Nymous/pyload | module/plugins/accounts/EuroshareEu.py | Python | gpl-3.0 | 1,755 |
#!/usr/bin/env python
# Copyright 2011 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... | vuntz/glance | glance/cmd/cache_manage.py | Python | apache-2.0 | 16,590 |
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseSite(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_site_disable(self):
self.app = get_test_app(argv=['site', 'disable', 'example2.com'])... | harshadyeola/easyengine | tests/cli/a_test_site_disable.py | Python | mit | 394 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutGuide/QgsLayoutGuideCollection.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) ... | CS-SI/QGIS | tests/src/python/test_qgslayoutguides.py | Python | gpl-2.0 | 17,536 |
# Base folder support
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.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 2 of the License, or
# (at your opt... | avsm/perscon-imap | offlineimap/folder/UIDMaps.py | Python | gpl-2.0 | 8,119 |
# -*- 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... | crmccreary/openerp_server | openerp/addons/board/__init__.py | Python | agpl-3.0 | 1,082 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.convert import ProcStreamlines
def test_ProcStreamlines_inputs():
input_map = dict(allowmultitargets=dict(argstr='-allowmultitargets',
),
args=dict(argstr='%s',
),
datadims=di... | JohnGriffiths/nipype | nipype/interfaces/camino/tests/test_auto_ProcStreamlines.py | Python | bsd-3-clause | 3,121 |
"""
Demo platform for the cover component.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.cover import CoverDevice
from homeassistant.helpers.event import track_utc_time_change
def setup_platform(hass, config, add_d... | xifle/home-assistant | homeassistant/components/cover/demo.py | Python | mit | 5,129 |
# -*- coding: utf-8 -*-
from cms.exceptions import LanguageError
from cms.utils import get_language_from_request
from cms.utils.i18n import get_language_object
from django.contrib.sites.models import Site
class CMSToolbar(object):
def __init__(self, request, toolbar, is_current_app, app_path):
self.reque... | SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/cms/toolbar_base.py | Python | mit | 832 |
##
# Copyright 2009-2015 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... | ULHPC/modules | easybuild/easybuild-easyblocks/easybuild/easyblocks/q/quantumespresso.py | Python | mit | 14,580 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | bhattmansi/Implementation-of-CARED-in-ns3 | src/stats/bindings/modulegen__gcc_LP64.py | Python | gpl-2.0 | 256,748 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | grnet/synnefo | snf-cyclades-app/synnefo/db/migrations/old/0080_nics_to_ips.py | Python | gpl-3.0 | 20,524 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Pool'
db.create_table(u'storageadmin_pool', (
... | schakrava/rockstor-core | src/rockstor/storageadmin/south_migrations/0001_initial.py | Python | gpl-3.0 | 36,999 |
# (C) British Crown Copyright 2013 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | mo-g/iris | lib/iris/tests/unit/fileformats/pp/test__field_gen.py | Python | gpl-3.0 | 5,006 |
# disable missing docstring
# pylint: disable=C0111
import json
from lettuce import world, step
from nose.tools import assert_equal, assert_true # pylint: disable=E0611
from common import type_in_codemirror, open_new_course
from advanced_settings import change_value, ADVANCED_MODULES_KEY
from course_import import imp... | xiandiancloud/edxplaltfom-xusong | cms/djangoapps/contentstore/features/problem-editor.py | Python | agpl-3.0 | 12,050 |
import httplib as http
from dataverse import Connection
from dataverse.exceptions import ConnectionError, UnauthorizedError, OperationFailedError
from framework.exceptions import HTTPError
from addons.dataverse import settings
from website.util.sanitize import strip_html
def _connect(host, token):
try:
... | aaxelb/osf.io | addons/dataverse/client.py | Python | apache-2.0 | 3,545 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Citrix Systems, Inc.
# Copyright 2011 OpenStack LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# htt... | tylertian/Openstack | openstack F/nova/nova/virt/vmwareapi/io_util.py | Python | apache-2.0 | 5,907 |
import json
import logging
import datetime
from celery import task
import mkt
from mkt.constants.regions import REGIONS_CHOICES_SLUG
from mkt.monolith.models import MonolithRecord
from mkt.site.decorators import use_master
from mkt.ratings.models import Review
from mkt.webapps.models import AddonUser, Webapp
from mkt... | ingenioustechie/zamboni | mkt/stats/tasks.py | Python | bsd-3-clause | 6,127 |
from taggit.forms import TagField as TaggitTagField
from taggit.models import Tag
from wagtail.admin.widgets import AdminTagWidget
class TagField(TaggitTagField):
"""
Extends taggit's TagField with the option to prevent creating tags that do not already exist
"""
widget = AdminTagWidget
def __in... | zerolab/wagtail | wagtail/admin/forms/tags.py | Python | bsd-3-clause | 1,354 |