repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
kalliope-project/kalliope | Tests/test_notification_manager.py | 1 | 1844 | import collections
import unittest
import mock
from kalliope.core import SignalModule
from kalliope.core.NotificationManager import NotificationManager
class FakeSignal(SignalModule):
def __init__(self, name=None, **kwargs):
super(FakeSignal, self).__init__(**kwargs)
self.name = name
def o... | gpl-3.0 |
jlorieau/mollib | analysis/datasets/ramachandran.py | 1 | 8178 | """Analysis of the Ramachandran datasets.
"""
import tarfile
import json
from itertools import izip_longest as zip_longest
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy import ndimage
# Plot parameters
figsize = (7, 1.5) # size of each subplot in inches
title_fontsize = 9 # size o... | gpl-3.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | tools/grit/grit/gather/rc_unittest.py | 61 | 13197 | #!/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 grit.gather.rc'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirnam... | bsd-3-clause |
ankur-gupta91/horizon-net-ip | openstack_dashboard/dashboards/admin/volumes/snapshots/views.py | 62 | 2756 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
Jgarcia-IAS/SAT | openerp/addons/sale_crm/__openerp__.py | 260 | 2036 | # -*- 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 GNU... | agpl-3.0 |
mathemage/h2o-3 | h2o-py/tests/testdir_algos/glrm/pyunit_NOPASS_simplexGLRM.py | 6 | 2989 | from __future__ import print_function
from builtins import str
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
import numpy as np
def glrm_simplex():
m = 1000
n = 100
k = 10
... | apache-2.0 |
Venturi/cms | env/lib/python2.7/site-packages/cms/tests/test_navextender.py | 35 | 3568 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from cms.models import Page
from cms.test_utils.fixtures.navextenders import NavextendersFixture
from cms.test_utils.testcases import CMSTestCase
from cms.test_utils.util.menu_extender import TestMenu
from django.conf import settings
from django.template imp... | gpl-2.0 |
veger/ansible | lib/ansible/modules/network/ftd/ftd_file_download.py | 7 | 4441 | #!/usr/bin/python
# Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 ... | gpl-3.0 |
Changaco/oh-mainline | vendor/packages/gdata/src/gdata/tlslite/utils/jython_compat.py | 358 | 5270 | """Miscellaneous functions to mask Python/Jython differences."""
import os
import sha
if os.name != "java":
BaseException = Exception
from sets import Set
import array
import math
def createByteArraySequence(seq):
return array.array('B', seq)
def createByteArrayZeros(howMany):
... | agpl-3.0 |
takis/odoo | openerp/addons/test_converter/tests/test_html.py | 257 | 13533 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... | agpl-3.0 |
flacjacket/sympy | sympy/functions/elementary/tests/test_complexes.py | 2 | 13017 | from sympy import (symbols, Symbol, sqrt, oo, re, nan, im, sign, I, E, log,
pi, arg, conjugate, expand, exp, sin, cos, Function, Abs, zoo, atan2,
S, DiracDelta, Rational, Heaviside)
from sympy.utilities.pytest import XFAIL
from sympy.utilities.randtest import comp
def N_equals(a, b):
"""Check wheth... | bsd-3-clause |
HubSpot/vitess | test/worker.py | 1 | 27619 | #!/usr/bin/env python
#
# 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 required by applicable la... | apache-2.0 |
aflaxman/mpld3 | examples/linked_brush.py | 21 | 1136 | """
Linked Brushing Example
=======================
This example uses the standard Iris dataset and plots it with a linked brushing
tool for dynamically exploring the data. The paintbrush button at the bottom
left can be used to enable and disable the behavior.
"""
import numpy as np
import matplotlib
import matplotli... | bsd-3-clause |
hasteur/wikipedia_bot_tasks | pywikibot/version.py | 3 | 5134 | # -*- coding: utf-8 -*-
""" Module to determine the pywikipedia version (tag, revision and date) """
#
# (C) Merlijn 'valhallasw' van Deen, 2007-2008
# (C) xqt, 2010-2011
# (C) Pywikipedia bot team, 2007-2013
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
import os
import sys
import time
i... | gpl-2.0 |
ArcherSys/ArcherSys | Lib/site-packages/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
tempbottle/servo | python/mach/mach/test/test_entry_point.py | 121 | 1886 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
import imp
import os
import sys
from mach.base import MachError
from mach.test.... | mpl-2.0 |
bmel/cassandra | pylib/cqlshlib/test/run_cqlsh.py | 46 | 10597 | # 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... | apache-2.0 |
kenorb-contrib/BitTorrent | twisted/cred/error.py | 19 | 2213 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Cred errors."""
class Unauthorized(Exception):
"""Standard unauthorized error."""
class DuplicateIdentity(KeyError):
"""There already exists an identity with that name."""
# Descends from KeyError for backwards compatib... | gpl-3.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/scons-2.3.1/SCons/compat/_scons_collections.py | 8 | 1889 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
#
# 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... | gpl-2.0 |
chriswaudby/pp | od/bruker-bits/simplejson/tests/test_recursion.py | 149 | 1679 | from unittest import TestCase
import simplejson as json
class JSONTestObject:
pass
class RecursiveJSONEncoder(json.JSONEncoder):
recurse = False
def default(self, o):
if o is JSONTestObject:
if self.recurse:
return [JSONTestObject]
else:
re... | mit |
omazapa/root | interpreter/llvm/src/utils/lit/lit/formats/googletest.py | 20 | 4185 | from __future__ import absolute_import
import os
import sys
import lit.Test
import lit.TestRunner
import lit.util
from .base import TestFormat
kIsWindows = sys.platform in ['win32', 'cygwin']
class GoogleTest(TestFormat):
def __init__(self, test_sub_dir, test_suffix):
self.test_sub_dir = os.path.normcase... | lgpl-2.1 |
henryr/Impala | thirdparty/hive-1.1.0-cdh5.5.0-SNAPSHOT/lib/py/fb303/FacebookBase.py | 173 | 1917 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
naterh/ironic | ironic/db/sqlalchemy/alembic/versions/1e1d5ace7dc6_add_inspection_started_at_and_.py | 10 | 1348 | # 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... | apache-2.0 |
jeenalee/servo | tests/wpt/css-tests/tools/html5lib/html5lib/tests/performance/concatenation.py | 451 | 1145 | from __future__ import absolute_import, division, unicode_literals
def f1():
x = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
z = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
x += y + z
def f2():
x = "ABCDEFGHIJKLMNOP... | mpl-2.0 |
mezz64/home-assistant | homeassistant/auth/mfa_modules/notify.py | 13 | 11911 | """HMAC-based One-time Password auth module.
Sending HOTP through notify service
"""
import asyncio
from collections import OrderedDict
import logging
from typing import Any, Dict, List, Optional
import attr
import voluptuous as vol
from homeassistant.const import CONF_EXCLUDE, CONF_INCLUDE
from homeassistant.core i... | apache-2.0 |
talpor/recipe-search-hackathon | recipe-search/recipe/migrations/0002_auto_20150221_2013.py | 1 | 2060 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('recipe', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | bsd-3-clause |
phektus/Django-Google-AppEngine-OpenId-Auth | django/template/loaders/filesystem.py | 229 | 2358 | """
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, temp... | bsd-3-clause |
ramanajee/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/model/queuepropertymixin_unittest.py | 125 | 2208 | # Copyright (C) 2010 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 ... | bsd-3-clause |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs32_detached_award_financial_assistance_2.py | 1 | 2326 | from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs32_detached_award_financial_assistance_2'
def test_column_headers(database):
expected_subset = {'row_number', 'period_of_performa... | cc0-1.0 |
turbomanage/training-data-analyst | blogs/goes16/maria/create_image.py | 2 | 4697 | #!/usr/bin/env python
"""
Copyright Google Inc. 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writ... | apache-2.0 |
kkoksvik/FreeCAD | src/Mod/Cam/InitGui.py | 57 | 2807 | # Cam gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.d... | lgpl-2.1 |
msebire/intellij-community | python/lib/Lib/dummy_thread.py | 86 | 4494 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import thread
except ImportError:
import dummy_thread as thread
"""
__author__ = ... | apache-2.0 |
duckinator/boreutils | test/test_basename.py | 1 | 2725 | """
Tests for POSIX-compatible `basename`.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
"""
from helpers import check, check_version, run
def test_version():
"""Check that we're using Boreutil's implementation."""
assert check_version("basename")
def test_missing_args():
""... | isc |
flavour/eden | modules/feedparser/datetimes/iso8601.py | 6 | 5630 | # Copyright 2010-2019 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | mit |
slayerjain/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/webelement.py | 251 | 1846 | """Element-level WebDriver operations."""
import searchcontext
class WebElement(searchcontext.SearchContext):
"""Corresponds to a DOM element in the current page."""
def __init__(self, driver, id):
self._driver = driver
self._id = id
# Set value of mode used by SearchContext
s... | mpl-2.0 |
PureNexusProject/android_kernel_asus_flo | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_errors.py | 1 | 2549 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
from marionette_driver import errors
from marionette_harness import marionette_test
def fake_cause():
... | mpl-2.0 |
FederatedAI/FATE | python/federatedml/protobuf/generated/poisson_model_meta_pb2.py | 1 | 6300 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: poisson-model-meta.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflectio... | apache-2.0 |
sergio-teruel/bank-payment | __unported__/account_banking/wizard/banking_transaction_wizard.py | 13 | 19538 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2011 Smile (<http://smile.fr>).
# All Rights Reserved
#
# This ... | agpl-3.0 |
mvesper/invenio | modules/bibcirculation/lib/bibcirculation_cern_ldap.py | 3 | 3885 | # This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version... | gpl-2.0 |
samsu/neutron | plugins/vmware/dbexts/servicerouter.py | 14 | 1025 | # Copyright 2013 VMware, 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 a... | apache-2.0 |
frreiss/tensorflow-fred | tensorflow/python/eager/memory_tests/memory_test.py | 15 | 3925 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
albertomurillo/ansible | lib/ansible/modules/remote_management/redfish/redfish_config.py | 2 | 5834 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2018 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
... | gpl-3.0 |
frossigneux/blazar | climate/openstack/common/fileutils.py | 2 | 3855 | # 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-2.0
#
# Unless req... | apache-2.0 |
msmolens/VTK | IO/EnSight/Testing/Python/EnSightGoldElements.py | 20 | 1238 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInte... | bsd-3-clause |
stackforge/networking-mlnx | networking_mlnx/db/models/sdn_maintenance_db.py | 2 | 1213 | # Copyright 2016 Mellanox Technologies, Ltd
# 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
#
# Unles... | apache-2.0 |
Lafaiet/Drop_Pobre | client/pynotify.py | 2 | 2373 | import sys
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from client_config import *
from xmlrpc import *
from threading import Thread
import os
def get_dir(path):
p=path.split('/')
size=len(p)
return p[size-2],p[size-1]
class custom_han... | gpl-2.0 |
chosak/fdic-call-reports | web/settings/dev.py | 1 | 1865 | import os, socket
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = '4h=6tp37*3c&92f$y00%!r4+s!l*w*iij07n-cjqk&tuf=%3wa'
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.staticfiles',
'debug_toolbar',
'reports... | mit |
vishnugonela/boto | boto/cloudhsm/layer1.py | 135 | 16187 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
pnichols104/python-koans | python2/koans/about_scope.py | 100 | 2871 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import jims
import joes
counter = 0 # Global
class AboutScope(Koan):
#
# NOTE:
# Look in jims.py and joes.py to see definitions of Dog used
# for this set of tests
#
def test_dog_is_not_available_in_the_current_sc... | mit |
CristianBB/SickRage | sickbeard/providers/hounddawgs.py | 2 | 7436 | # Author: Idan Gutman
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 o... | gpl-3.0 |
venmo/ansible | lib/ansible/plugins/action/group_by.py | 172 | 1401 | # Copyright 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 ve... | gpl-3.0 |
mrquim/mrquimrepo | script.module.pycryptodome/lib/Crypto/SelfTest/PublicKey/test_ElGamal.py | 5 | 8650 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_ElGamal.py: Self-test for the ElGamal primitive
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone ... | gpl-2.0 |
pbaesse/Sissens | lib/python2.7/site-packages/sqlalchemy/ext/horizontal_shard.py | 32 | 4814 | # ext/horizontal_shard.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Horizontal sharding support.
Defines a rudimental 'horizontal sharding' ... | gpl-3.0 |
adrienbrault/home-assistant | tests/components/smartthings/test_config_flow.py | 6 | 30216 | """Tests for the SmartThings config flow module."""
from unittest.mock import AsyncMock, Mock, patch
from uuid import uuid4
from aiohttp import ClientResponseError
from pysmartthings import APIResponseError
from pysmartthings.installedapp import format_install_url
from homeassistant import data_entry_flow
from homeas... | mit |
Maximilian-Reuter/SickRage-1 | sickbeard/helpers.py | 1 | 59305 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
# Git: https://github.com/SickRage/SickRage.git
#
# This file is part of SickRage.
#
# SickRage 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... | gpl-3.0 |
brendandahl/servo | tests/wpt/css-tests/tools/html5lib/html5lib/filters/inject_meta_charset.py | 1730 | 2746 | from __future__ import absolute_import, division, unicode_literals
from . import _base
class Filter(_base.Filter):
def __init__(self, source, encoding):
_base.Filter.__init__(self, source)
self.encoding = encoding
def __iter__(self):
state = "pre_head"
meta_found = (self.enco... | mpl-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Werkzeug-0.10.4/werkzeug/urls.py | 148 | 36596 | # -*- coding: utf-8 -*-
"""
werkzeug.urls
~~~~~~~~~~~~~
``werkzeug.urls`` used to provide several wrapper functions for Python 2
urlparse, whose main purpose were to work around the behavior of the Py2
stdlib and its lack of unicode support. While this was already a somewhat
inconvenient situat... | mit |
dmroeder/pylogix | pylogix/lgx_device.py | 1 | 54769 | """
Copyright 2021 Dustin Roeder (dmroeder@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 may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | apache-2.0 |
hachreak/invenio-previewer | invenio_previewer/extensions/csv_dthreejs.py | 2 | 2628 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015, 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your... | gpl-2.0 |
ltilve/ChromiumGStreamerBackend | third_party/boringssl/roll_boringssl.py | 17 | 3938 | #!/usr/bin/env python
# Copyright 2015 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.
"""Rolls third_party/boringssl/src in DEPS and updates generated build files."""
import os
import os.path
import shutil
import subproc... | bsd-3-clause |
francois-contat/scapy | scapy/layers/dot11.py | 1 | 37033 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Scapy 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
# any later version.
#
#... | gpl-2.0 |
mxOBS/deb-pkg_trusty_chromium-browser | tools/telemetry/telemetry/core/browser_credentials.py | 11 | 5581 | # Copyright 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.
import json
import logging
import os
from telemetry.core import util
from telemetry.core.backends import codepen_credentials_backend
from telemetry.core.bac... | bsd-3-clause |
vveerava/Openstack | neutron/common/config.py | 4 | 8551 | # Copyright 2011 VMware, 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 ... | apache-2.0 |
a-parhom/edx-platform | common/djangoapps/third_party_auth/settings.py | 1 | 4672 | """Settings for the third-party auth module.
The flow for settings registration is:
The base settings file contains a boolean, ENABLE_THIRD_PARTY_AUTH, indicating
whether this module is enabled. startup.py probes the ENABLE_THIRD_PARTY_AUTH.
If true, it:
a) loads this module.
b) calls apply_settings(), passi... | agpl-3.0 |
Kiiv/CouchPotatoServer | libs/pyasn1/codec/ber/encoder.py | 185 | 13626 | # BER encoder
from pyasn1.type import base, tag, univ, char, useful
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import int2oct, oct2int, ints2octs, null, str2octs
from pyasn1 import debug, error
class Error(Exception): pass
class AbstractItemEncoder:
supportIndefLenMode = 1
def encodeTag(self, ... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-57/modules/sheets/lib/python2.7/site-packages/pip/compat/dictconfig.py | 921 | 23096 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | gpl-3.0 |
luofei98/qgis | python/plugins/processing/modeler/ModelerDialog.py | 1 | 24658 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ModelerDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | gpl-2.0 |
alviano/wasp | tests/asp/AllAnswerSets/aggregates/sum.example7.test.py | 4 | 27383 | input = """
1 2 0 0
1 3 0 0
1 4 0 0
1 5 0 0
1 6 0 0
1 7 0 0
1 8 0 0
1 9 0 0
1 10 0 0
1 11 0 0
1 12 0 0
1 13 0 0
1 14 0 0
1 15 0 0
1 16 0 0
1 17 0 0
1 18 0 0
1 19 0 0
1 20 0 0
1 21 0 0
1 22 0 0
1 23 2 1 24 25
1 24 2 1 23 25
1 25 0 0
1 26 2 1 27 28
1 27 2 1 26 28
1 28 0 0
1 29 2 1 30 31
1 30 2 1 29 31
1 31 0 0
1 32 2 1 3... | apache-2.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/django/contrib/gis/gdal/layer.py | 477 | 8693 | from ctypes import byref, c_double
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import (
GDALException, OGRIndexError, SRSException,
)
from django.contrib.gis.gdal.feature import Feature
from django.contrib.g... | bsd-3-clause |
duyetdev/openerp-6.1.1 | openerp/pychart/afm/NewCenturySchlbk_Roman.py | 15 | 1528 | # -*- coding: utf-8 -*-
# AFM font NewCenturySchlbk-Roman (path: /usr/share/fonts/afms/adobe/pncr8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["NewCenturySchlbk-Roman"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500,... | agpl-3.0 |
smartfile/django-1.4 | tests/regressiontests/middleware/tests.py | 1 | 29035 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, with_statement
import gzip
import re
import random
import StringIO
from django.conf import settings
from django.core import mail
from django.db import (transaction, connections, DEFAULT_DB_ALIAS,
IntegrityError)
from django.http im... | bsd-3-clause |
gauravbose/digital-menu | digimenu2/tests/proxy_model_inheritance/tests.py | 13 | 1747 | from __future__ import absolute_import, unicode_literals
import os
from django.core.management import call_command
from django.test import TestCase, TransactionTestCase
from django.test.utils import extend_sys_path
from django.utils._os import upath
from .models import (
ConcreteModel, ConcreteModelSubclass, Con... | bsd-3-clause |
michaelgallacher/intellij-community | python/helpers/py2only/docutils/readers/pep.py | 136 | 1555 | # $Id: pep.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Python Enhancement Proposal (PEP) Reader.
"""
__docformat__ = 'reStructuredText'
from docutils.readers import standalone
from docutils.transforms import pep... | apache-2.0 |
dralves/nixysa | third_party/ply-3.1/example/yply/ylex.py | 165 | 2198 | # lexer for yacc-grammars
#
# Author: David Beazley (dave@dabeaz.com)
# Date : October 2, 2006
import sys
sys.path.append("../..")
from ply import *
tokens = (
'LITERAL','SECTION','TOKEN','LEFT','RIGHT','PREC','START','TYPE','NONASSOC','UNION','CODE',
'ID','QLITERAL','NUMBER',
)
states = (('code','exclusiv... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/storage/azure-storage-blob-changefeed/tests/conftest.py | 2 | 1748 | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | mit |
sameersingh/uci-statnlp | hw3/train.py | 1 | 4787 | import argparse
import copy
import datetime
import json
import os
import random
import sys
import time
from tqdm import tqdm
import torch
from torch.utils.data import DataLoader
from dataset import TwitterDataset, Vocabulary
from util import load_object_from_dict
def load_datasets(train_dataset_params: dict, valida... | apache-2.0 |
tobspr/LUI | Builtin/LUILabel.py | 1 | 2261 |
from panda3d.lui import LUIText
from LUIObject import LUIObject
from LUIInitialState import LUIInitialState
__all__ = ["LUILabel"]
class LUILabel(LUIObject):
""" A simple label, displaying text. """
# Default variables which can be overridden by skins
DEFAULT_COLOR = (0.9, 0.9, 0.9, 1)
DEFAULT_USE_... | mit |
ryfeus/lambda-packs | Sklearn_scipy_numpy/source/sklearn/datasets/samples_generator.py | 20 | 56502 | """
Generate samples of synthetic data sets.
"""
# Authors: B. Thirion, G. Varoquaux, A. Gramfort, V. Michel, O. Grisel,
# G. Louppe, J. Nothman
# License: BSD 3 clause
import numbers
import array
import numpy as np
from scipy import linalg
import scipy.sparse as sp
from ..preprocessing import MultiLabelBin... | mit |
zofuthan/edx-platform | common/lib/xmodule/xmodule/video_module/video_handlers.py | 108 | 14344 | """
Handlers for video module.
StudentViewHandlers are handlers for video module instance.
StudioViewHandlers are handlers for video descriptor instance.
"""
import json
import logging
from datetime import datetime
from webob import Response
from xblock.core import XBlock
from xmodule.exceptions import NotFoundErro... | agpl-3.0 |
Antiun/c2c-rd-addons | c2c_stock/__openerp__.py | 4 | 1536 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>)
#
# Thi... | agpl-3.0 |
fenglu-g/incubator-airflow | airflow/contrib/example_dags/example_twitter_dag.py | 20 | 7310 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
Geeglee/scrapy | tests/test_link.py | 68 | 2014 | import unittest
import warnings
from scrapy.link import Link
class LinkTest(unittest.TestCase):
def _assert_same_links(self, link1, link2):
self.assertEqual(link1, link2)
self.assertEqual(hash(link1), hash(link2))
def _assert_different_links(self, link1, link2):
self.assertNotEqual(l... | bsd-3-clause |
CalebBell/thermo | tests/test_eos_mix_methods.py | 1 | 14103 | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2020, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... | mit |
kuboschek/jay | settings/views/systems.py | 2 | 3752 | import time
from django.http import Http404
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from jay.utils import superadmin
from django.core.urlresolvers import reverse
from settings.models import VotingSystem
from settings.forms import E... | mit |
appleseedhq/gaffer | python/GafferUITest/StandardNodeUITest.py | 4 | 3230 | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | bsd-3-clause |
egaxegax/django-dbcartajs | djangoappengine/tests/test_not_return_sets.py | 28 | 4299 | import datetime
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.test import TestCase
from .models import FieldsWithOptionsModel, OrderedModel, \
SelfReferenceModel
class NonReturnSetsTest(TestCase):
floats = [5.3, 2.6, 9.1, 1.58, 2.4]
emails = ['app-engine@scho... | gpl-2.0 |
gavinfaux/namebench | nb_third_party/dns/rdtypes/IN/IPSECKEY.py | 248 | 5985 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... | apache-2.0 |
redhat-cip/tempest | tempest/api/identity/test_extension.py | 24 | 1170 | # Copyright 2014 NEC Corporation
# 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 ... | apache-2.0 |
dednal/chromium.src | tools/cr/cr/fixups/arch.py | 103 | 1581 | # 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.
"""A module for architecture output directory fixups."""
import cr
class _ArchInitHookHelper(cr.InitHook):
"""Base class helper for CR_ARCH value fixups... | bsd-3-clause |
takeshineshiro/nova | nova/tests/unit/scheduler/test_filter_scheduler.py | 15 | 14306 | # 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-2.0
#
# Unless requ... | apache-2.0 |
kernsuite-debian/lofar | SAS/TriggerEmailService/Server/lib/TriggerEmailService.py | 1 | 12860 | #!/usr/bin/env python3
#
# Copyright (C) 2017
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General... | gpl-3.0 |
h3llrais3r/SickRage | lib/twilio/rest/resources/sms_messages.py | 51 | 6376 | from .util import normalize_dates, parse_date
from . import InstanceResource, ListResource
class ShortCode(InstanceResource):
def update(self, **kwargs):
return self.parent.update(self.name, **kwargs)
class ShortCodes(ListResource):
name = "ShortCodes"
key = "short_codes"
instance = ShortC... | gpl-3.0 |
vvv1559/intellij-community | plugins/hg4idea/testData/bin/hgext/relink.py | 93 | 6018 | # Mercurial extension to provide 'hg relink' command
#
# Copyright (C) 2007 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""recreates hardlinks between repository clones"""
from mercurial imp... | apache-2.0 |
ntt-nflex/nflex_connector_utils | nflex_connector_utils/tests/test_resources.py | 1 | 8781 | import pytest
from nflex_connector_utils import (
Resource, Appliance, Network, Server, ServiceOffering, Volume,
IpAddress, ImageDetail, Region, Locations, Connections, Metadata,
ComputePool, ColoSpace, Circuit)
class TestResources(object):
def test_resource(self):
data = Resource(id='id', na... | gpl-2.0 |
jserver/mock-s3 | mock_s3/file_store.py | 1 | 10865 | import ConfigParser
import md5
import os
import shutil
from datetime import datetime
from errors import BucketNotEmpty, NoSuchBucket
from models import Bucket, BucketQuery, S3Item
CONTENT_FILE = '.mocks3_content'
METADATA_FILE = '.mocks3_metadata'
class FileStore(object):
def __init__(self, root):
self... | mit |
powerjg/gem5-ci-test | src/mem/CommMonitor.py | 27 | 5187 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
blazek/QGIS | python/plugins/processing/gui/menus.py | 6 | 13497 | # -*- coding: utf-8 -*-
"""
***************************************************************************
menus.py
---------------------
Date : February 2016
Copyright : (C) 2016 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... | gpl-2.0 |
villaverde/iredadmin | libs/ldaplib/attrs.py | 2 | 4418 | # Author: Zhang Huangbin <zhb@iredmail.org>
# ---------------------------------------------------------
# Values.
# ---------------------------------------------------------
ACCOUNT_STATUS_ACTIVE = 'active'
ACCOUNT_STATUS_DISABLED = 'disabled'
ACCOUNT_STATUSES = [ACCOUNT_STATUS_ACTIVE, ACCOUNT_STATUS_DISABLED, ]
# Al... | gpl-2.0 |
Velkan/shadowsocks | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 clowwindy
#
# 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 r... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.