repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
softlayer/softlayer-python | SoftLayer/CLI/file/snapshot/schedule_list.py | 3 | 2373 | """List scheduled snapshots of a specific volume"""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command()
@click.argument('volume_id')
@environment.pass_env
def cli(env, volume_id):
"""Lists snapsho... | mit |
40223119/2015cda | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_program.py | 738 | 10833 | import io
import os
import sys
import unittest
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__))
self.wasRun = False
... | gpl-3.0 |
mrcrgl/django_distributed_task | distributed_task/broker/backends/db.py | 1 | 1101 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from ..interface import BrokerInterface
from distributed_task import settings
from distributed_task.core.serializer import serialize, deserialize
from distributed_task.models import Message
import time
class DatabaseMessageBroker(BrokerInterface):
... | mit |
vileopratama/vitech | src/addons/pos_cache/models/pos_cache.py | 17 | 3362 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ast import literal_eval
from openerp import models, fields, api
from openerp.tools import pickle as cPickle
class pos_cache(models.Model):
_name = 'pos.cache'
cache = fields.Binary()
product_domain = ... | mit |
tschmorleiz/amcat | navigator/views/projectview.py | 2 | 13207 | ###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | agpl-3.0 |
chenjun0210/tensorflow | tensorflow/python/ops/sets.py | 109 | 1167 | # 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... | apache-2.0 |
gazpachoking/deluge-old | deluge/ui/gtkui/createtorrentdialog.py | 1 | 18151 | #
# createtorrentdialog.py
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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... | gpl-3.0 |
Theb-1/home-assistant | tests/components/automation/test_event.py | 16 | 4001 | """
tests.components.automation.test_event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests event automation.
"""
import unittest
import homeassistant.core as ha
import homeassistant.components.automation as automation
class TestAutomationEvent(unittest.TestCase):
""" Test the event automation. """
def setUp(s... | mit |
DazWorrall/ansible | lib/ansible/modules/network/cloudengine/ce_file_copy.py | 4 | 12670 | #!/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 distribut... | gpl-3.0 |
procangroup/edx-platform | lms/djangoapps/lms_xblock/field_data.py | 188 | 1403 | """
:class:`~xblock.field_data.FieldData` subclasses used by the LMS
"""
from xblock.field_data import ReadOnlyFieldData, SplitFieldData
from xblock.fields import Scope
class LmsFieldData(SplitFieldData):
"""
A :class:`~xblock.field_data.FieldData` that
reads all UserScope.ONE and UserScope.ALL fields fr... | agpl-3.0 |
partofthething/laserComm | laserComm/receiver.py | 1 | 2975 | '''
receiver runs the ADC and photoresistor to receive an input signal.
USes MCP3008 ADC via the hardware SPI interface.
Connections are:
MCP3008 VDD -> 3.3V (red)
MCP3008 VREF -> 3.3V (red)
MCP3008 AGND -> GND (orange)
MCP3008 CLK -> SCLK (yellow)
MCP3008 DOUT -> MISO (green)
MCP3008 DIN -> ... | mit |
windyuuy/opera | chromium/src/third_party/python_26/Tools/scripts/objgraph.py | 96 | 6018 | #! /usr/bin/env python
# objgraph
#
# Read "nm -o" input (on IRIX: "nm -Bo") of a set of libraries or modules
# and print various interesting listings, such as:
#
# - which names are used but not defined in the set (and used where),
# - which names are defined in the set (and where),
# - which modules use which other ... | bsd-3-clause |
ageron/tensorflow | tensorflow/contrib/learn/python/learn/learn_io/data_feeder_test.py | 25 | 13554 | # 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... | apache-2.0 |
Seagate/SMR_FS-EXT4 | kernel/scripts/gdb/linux/cpus.py | 997 | 3560 | #
# gdb helper commands and functions for Linux kernel debugging
#
# per-cpu tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import tasks, utils
MAX_CPUS = 4096
def get_cu... | gpl-2.0 |
naototty/vagrant-lxc-ironic | tools/states_to_dot.py | 3 | 3896 | #!/usr/bin/env python
# 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.0... | apache-2.0 |
4talesa/rethinkdb | test/rql_test/connections/http_support/werkzeug/_compat.py | 448 | 6184 | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... | agpl-3.0 |
gajim/python-nbxmpp | test/unit/test_xml_vulnerability.py | 1 | 2389 | import unittest
from unittest.mock import Mock
from nbxmpp import dispatcher
class XMLVulnerability(unittest.TestCase):
def setUp(self):
self.stream = Mock()
self.stream.is_websocket = False
self.dispatcher = dispatcher.StanzaDispatcher(self.stream)
self._error_handler = Mock()
... | gpl-3.0 |
adviti/melange | thirdparty/google_appengine/google/net/proto2/python/public/descriptor.py | 2 | 22766 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
spadae22/odoo | openerp/addons/base/ir/ir_mail_server.py | 229 | 26688 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2014 OpenERP S.A. (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
flavioamieiro/AlertaDengue | AlertaDengue/gis/tests/test_geotiff.py | 3 | 3941 | from datetime import datetime
from django.test import TestCase
from glob import glob
# local
from ..geotiff import (
get_date_from_file_name,
get_key_from_file_name,
mask_raster_with_shapefile,
increase_resolution
)
from .. import settings
import os
import numpy as np
import rasterio
import shutil
impo... | gpl-3.0 |
bitpay/bitcoin | qa/rpc-tests/test_framework/coverage.py | 75 | 2716 | """
This module contains utilities for doing coverage analysis on the RPC
interface.
It provides a way to track which RPC commands are exercised during
testing.
"""
import os
REFERENCE_FILENAME = 'rpc_interface.txt'
class AuthServiceProxyWrapper(object):
"""
An object that wraps AuthServiceProxy to record... | mit |
mammique/django | django/core/management/commands/startproject.py | 117 | 1276 | from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.crypto import get_random_string
from django.utils.importlib import import_module
class Command(TemplateCommand):
help = ("Creates a Django project directory structure for the given "... | bsd-3-clause |
Sbalbp/DIRAC | FrameworkSystem/Client/NotificationClient.py | 9 | 6829 | """ DIRAC Notification Client class encapsulates the methods exposed
by the Notification service.
"""
__RCSID__ = "$Id$"
import types
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.Core.Utilities.Mail import Mail
from DIRAC import gLogger, S_ERROR
class NotificationClient:
######################... | gpl-3.0 |
Maistho/CouchPotatoServer | libs/synchronousdeluge/rencode.py | 156 | 12982 |
"""
rencode -- Web safe object pickling/unpickling.
Public domain, Connelly Barnes 2006-2007.
The rencode module is a modified version of bencode from the
BitTorrent project. For complex, heterogeneous data structures with
many small elements, r-encodings take up significantly less space than
b-encodings:
>>> len... | gpl-3.0 |
hitmoon/ROPgadget | ropgadget/core.py | 8 | 18573 | ## -*- coding: utf-8 -*-
##
## Jonathan Salwan - 2014-05-17 - ROPgadget tool
##
## http://twitter.com/JonathanSalwan
## http://shell-storm.org/project/ROPgadget/
##
## 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
## ... | gpl-2.0 |
raghavrv/scikit-learn | sklearn/cluster/tests/test_hierarchical.py | 33 | 20167 | """
Several basic tests for hierarchical clustering procedures
"""
# Authors: Vincent Michel, 2010, Gael Varoquaux 2012,
# Matteo Visconti di Oleggio Castello 2014
# License: BSD 3 clause
from tempfile import mkdtemp
import shutil
from functools import partial
import numpy as np
from scipy import sparse
from... | bsd-3-clause |
svn2github/vbox | src/VBox/Main/webservice/samples/python/clienttest.py | 7 | 4520 | #!/usr/bin/python
#
# Copyright (C) 2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the F... | gpl-2.0 |
mikeh77/mi-instrument | mi/core/instrument/instrument_driver.py | 1 | 46251 | #!/usr/bin/env python
"""
@package ion.services.mi.instrument_driver Instrument driver structures
@file ion/services/mi/instrument_driver.py
@author Edward Hunter
@brief Instrument driver classes that provide structure towards interaction
with individual instruments in the system.
"""
__author__ = 'Steve Foley'
__lic... | bsd-2-clause |
fvbock/gDBPool | gdbpool/connection_pool.py | 1 | 6127 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Florian von Bock (f at vonbock dot info)
#
# gDBPool - db connection pooling for gevent
__author__ = "Florian von Bock"
__email__ = "f at vonbock dot info"
__version__ = "0.1.3"
import gevent
from gevent import monkey; monkey.patch_all()
import psycopg2
import sys, tra... | mit |
podemos-info/odoo | addons/event/wizard/__init__.py | 9 | 1160 | # -*- 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 |
pawelmhm/scrapy | scrapy/contracts/__init__.py | 3 | 6122 | import re
import sys
from functools import wraps
from inspect import getmembers
from typing import Dict
from unittest import TestCase
from scrapy.http import Request
from scrapy.utils.python import get_spec
from scrapy.utils.spider import iterate_spider_output
class Contract:
""" Abstract class for contracts """... | bsd-3-clause |
credativUK/purchase-workflow | __unported__/purchase_landed_costs/product.py | 27 | 2999 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2013 Camptocamp (<http://www.camptocamp.com>)
# Authors: Ferdinand Gasauer, Joel Grand-Guillaume
#
# This program is free software: you ca... | agpl-3.0 |
teoliphant/numpy-refactor | numpy/lib/tests/test_index_tricks.py | 8 | 3928 | from numpy.testing import *
import numpy as np
from numpy import ( array, ones, r_, mgrid, unravel_index, zeros, where,
ndenumerate, fill_diagonal, diag_indices,
diag_indices_from )
class TestUnravelIndex(TestCase):
def test_basic(self):
assert unravel_index(2,(2,2))... | bsd-3-clause |
GraemeFulton/job-search | docutils-0.12/build/lib/docutils/parsers/rst/directives/misc.py | 106 | 22888 | # $Id: misc.py 7487 2012-07-22 21:20:28Z milde $
# Authors: David Goodger <goodger@python.org>; Dethe Elza
# Copyright: This module has been placed in the public domain.
"""Miscellaneous directives."""
__docformat__ = 'reStructuredText'
import sys
import os.path
import re
import time
from docutils import io, nodes, ... | gpl-2.0 |
40223102/w17b_test | static/Brython3.1.1-20150328-091302/Lib/atexit.py | 743 | 1049 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... | agpl-3.0 |
nachowski/csv2sqlite | csv2sqlite.py | 1 | 3373 | # Converts a CSV file (typically exported from individual .xls sheets) to a sqlite db as a new table
#
# - The CSV filename (without .csv extension) is used as the table name.
# - The columns from the first row are used as column names in the table.
# - You can store multiple tables (from multiple csv files) in the sam... | mit |
tchellomello/home-assistant | homeassistant/components/gtfs/sensor.py | 7 | 25269 | """Support for GTFS (Google/General Transport Format Schema)."""
import datetime
import logging
import os
import threading
from typing import Any, Callable, Optional
import pygtfs
from sqlalchemy.sql import text
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.co... | apache-2.0 |
Daniel-CA/odoo | addons/stock_account/wizard/stock_valuation_history.py | 38 | 9712 |
from datetime import datetime
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
class wizard_valuation_history(osv.osv_memory):
_name = 'wizard.valuation.history'
_description = 'Wizard that opens the stock valuation history table'
_columns = {
'c... | agpl-3.0 |
AaronTao1990/scrapy | tests/test_selector_csstranslator.py | 59 | 6026 | """
Selector tests for cssselect backend
"""
from twisted.trial import unittest
from scrapy.http import HtmlResponse
from scrapy.selector.csstranslator import ScrapyHTMLTranslator
from scrapy.selector import Selector
from cssselect.parser import SelectorSyntaxError
from cssselect.xpath import ExpressionError
HTMLBODY... | bsd-3-clause |
wskplho/sl4a | python/gdata/src/gdata/Crypto/Protocol/AllOrNothing.py | 226 | 10952 | """This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... | apache-2.0 |
grlee77/scipy | scipy/_lib/doccer.py | 12 | 8300 | ''' Utilities to allow inserting docstring fragments for common
parameters into function and method docstrings'''
import sys
__all__ = ['docformat', 'inherit_docstring_from', 'indentcount_lines',
'filldoc', 'unindent_dict', 'unindent_string', 'doc_replace']
def docformat(docstring, docdict=None):
'''... | bsd-3-clause |
jspargo/AneMo | django/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py | 56 | 13461 | from __future__ import unicode_literals
import os
from collections import OrderedDict
from optparse import make_option
from django.core.files.storage import FileSystemStorage
from django.core.management.base import CommandError, NoArgsCommand
from django.utils.encoding import smart_text
from django.utils.six.moves im... | gpl-2.0 |
40223209/test111 | static/Brython3.1.1-20150328-091302/Lib/_abcoll.py | 688 | 5155 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | gpl-3.0 |
Ruide/angr-dev | angr/angr/procedures/linux_kernel/uname.py | 5 | 1149 | import angr
class uname(angr.SimProcedure):
IS_SYSCALL = True
def run(self, uname_buf): # pylint: disable=arguments-differ
# struct utsname {
# char sysname[]; /* Operating system name (e.g., "Linux") */
# char nodename[]; /* Name within "some implementation-defined
... | bsd-2-clause |
oreilly-japan/deep-learning-from-scratch | ch07/apply_filter.py | 4 | 1634 | # coding: utf-8
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
import matplotlib.pyplot as plt
from simple_convnet import SimpleConvNet
from matplotlib.image import imread
from common.layers import Convolution
def filter_show(filters, nx=4, show_num=16):
"""
c.f. http... | mit |
huihoo/reader | vendor/haystack/templatetags/more_like_this.py | 28 | 3333 | from django import template
from django.db import models
from haystack.query import SearchQuerySet
register = template.Library()
class MoreLikeThisNode(template.Node):
def __init__(self, model, varname, for_types=None, limit=None):
self.model = template.Variable(model)
self.varname = varname
... | mit |
slvnperron/luigi | luigi/lock.py | 27 | 3102 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
837278709/metro-openerp | metro_mrp/wizard/add_common_bom.py | 2 | 4188 | # -*- 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 |
lduarte1991/edx-platform | openedx/core/djangoapps/video_config/tests/test_models.py | 18 | 8733 | """
Tests for the models that configures HLS Playback feature.
"""
import ddt
import itertools
from contextlib import contextmanager
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from openedx.core.djangoapps.video_config.models import (
CourseHLSPlaybackEnabledFlag, HLSPlayba... | agpl-3.0 |
CropCircleSys/bsd-cloudinit | cloudbaseinit/tests/plugins/common/test_fileexecutils.py | 5 | 2323 | # Copyright 2014 Cloudbase Solutions Srl
#
# 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... | apache-2.0 |
arenadata/ambari | ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/YARN/package/scripts/yarn.py | 3 | 5265 | """
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 this ... | apache-2.0 |
seanjensengrey/moveonpc | examples/python/beat.py | 7 | 3134 |
#
# PS Move API - An interface for the PS Move Motion Controller
# Copyright (c) 2011 Thomas Perl <m@thp.io>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source co... | bsd-2-clause |
ShaunRW/keyModder | KeycodeTranslator.py | 1 | 2907 | #! /usr/bin/python2.6
# KEYCODE TRANSLATOR
#-----------------------------------------#
# Filename: KeycodeTranslator.py
# Belongs To: keyModder
# Usage: from KeycodeTranslator import KeycodeTranslator
# Description: Offers function to convert key codes to the key name and vice versa.
# Cr... | gpl-2.0 |
alexthered/kienhoc-platform | lms/djangoapps/commerce/api/v0/tests/test_views.py | 12 | 15270 | """ Commerce API v0 view tests. """
import json
import itertools
from uuid import uuid4
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
import mock
from nose.plugins.attrib import attr
from xmodule... | agpl-3.0 |
razziel89/ManipulateAggregates | ManipulateAggregates/collection/gnuplot/__init__.py | 1 | 33249 | """Class definition to control Gnuplot from Python.
"""
# This file is part of ManipulateAggregates.
#
# Copyright (C) 2016 by Torsten Sachse
#
# ManipulateAggregates 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 Found... | gpl-3.0 |
f-prettyland/angr | tests/syscalls/test_lseek.py | 4 | 4401 | import nose
import archinfo
import logging
l = logging.getLogger('angr.tests.syscalls.lseek')
from angr import SIM_PROCEDURES
from angr import SimState, SimPosixError
FAKE_ADDR = 0x100000
lseek = lambda state, arguments: SIM_PROCEDURES['linux_kernel']['lseek']().execute(state, arguments=arguments)
# Taken from un... | bsd-2-clause |
endthestart/tinsparrow | tinsparrow/tinsparrow/urls.py | 1 | 2739 | from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from rest_framework.authtoken.views import obtain_auth_token
from .views import LibraryView, songfile, LayoutView
from .api import api_root, s... | mit |
tjanez/ansible | lib/ansible/modules/cloud/openstack/os_quota.py | 6 | 16160 | #!/usr/bin/python
# Copyright (c) 2016 Pason System Corporation
#
# This module 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.
#
# Thi... | gpl-3.0 |
SivilTaram/edx-platform | common/djangoapps/track/tests/__init__.py | 150 | 2277 | """Helpers for tests related to emitting events to the tracking logs."""
from datetime import datetime
from django.test import TestCase
from django.test.utils import override_settings
from freezegun import freeze_time
from pytz import UTC
from eventtracking import tracker
from eventtracking.django import DjangoTrack... | agpl-3.0 |
relekang/python-semantic-release | semantic_release/settings.py | 1 | 4061 | """Helpers to read settings from setup.cfg or pyproject.toml
"""
import configparser
import importlib
import logging
import os
from collections import UserDict
from functools import wraps
from os import getcwd
from typing import Callable, List
import tomlkit
from tomlkit.exceptions import TOMLKitError
from .errors im... | mit |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.5/Lib/test/test_imp.py | 33 | 1113 | import imp
from test.test_support import TestFailed, TestSkipped
try:
import thread
except ImportError:
raise TestSkipped("test only valid when thread support is available")
def verify_lock_state(expected):
if imp.lock_held() != expected:
raise TestFailed("expected imp.lock_held() to be %r" % expec... | mit |
jasuarez/minbif | tests/test.py | 1 | 14535 | # -*- coding: utf-8 -*-
"""
Minbif - IRC instant messaging gateway
Copyright(C) 2009 Romain Bignon
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, version 2 of the License.
This program is distribu... | gpl-2.0 |
affo/nova | nova/api/openstack/compute/plugins/v3/user_data.py | 37 | 1449 | # Copyright 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 ... | apache-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/test/test_filecmp.py | 136 | 5396 |
import os, filecmp, shutil, tempfile
import unittest
from test import test_support
class FileCompareTestCase(unittest.TestCase):
def setUp(self):
self.name = test_support.TESTFN
self.name_same = test_support.TESTFN + '-same'
self.name_diff = test_support.TESTFN + '-diff'
data = 'Co... | gpl-2.0 |
MITHyperloopTeam/software_core | software/UI/pod_tube_vis.py | 1 | 8129 | #!/usr/bin/env python
#signif reference to http://pastebin.com/k87sfiEf
import sys
import math
import signal
import time
import os
import math, random
import numpy as np
from numpy import linalg
from PIL import Image
#interface stuff
from PyQt4 import QtCore, QtGui, QtOpenGL
import pyqtgraph as pg
#comms stuff
i... | lgpl-3.0 |
pincopallino93/rdfendpoints | flankers/long_task.py | 3 | 3493 | import time
from bs4 import BeautifulSoup
import lib.longtask as longtask
from datastore.models import Indexer, WebResource
from google.appengine.api import memcache
__author__ = 'Lorenzo'
def store_feed(e):
"""
store a single entry from the feedparser
:param e: the entry
:return: if succeed the stor... | apache-2.0 |
ilpianista/ansible | lib/ansible/plugins/action/uri.py | 70 | 2293 | # -*- coding: utf-8 -*-
# (c) 2015, Brian Coca <briancoca+dev@gmail.com>
# (c) 2018, Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__... | gpl-3.0 |
fbudin69500/ITK | Modules/ThirdParty/pygccxml/src/pygccxml/declarations/__init__.py | 13 | 12490 | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
"""
Contains classes that describe different C++ declarations
"""
# Keep compilers for backward compatibility
from . import... | apache-2.0 |
klahnakoski/Bugzilla-ETL | vendor/mo_collections/index.py | 2 | 4634 | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... | mpl-2.0 |
LeeRisk/zulip | zerver/lib/timeout.py | 115 | 3045 | from __future__ import absolute_import
import sys
import time
import ctypes
import threading
# Based on http://code.activestate.com/recipes/483752/
class TimeoutExpired(Exception):
'''Exception raised when a function times out.'''
def __str__(self):
return 'Function call timed out.'
def timeout(time... | apache-2.0 |
GitHublong/hue | apps/sqoop/src/sqoop/api/decorators.py | 32 | 3268 | #!/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... | apache-2.0 |
JuliaSprenger/python-neo | neo/rawio/micromedrawio.py | 3 | 8998 | """
Class for reading/writing data from micromed (.trc).
Inspired by the Matlab code for EEGLAB from Rami K. Niazy.
Completed with matlab Guillaume BECQ code.
Author: Samuel Garcia
"""
# from __future__ import unicode_literals is not compatible with numpy.dtype both py2 py3
from .baserawio import (BaseRawIO, _signa... | bsd-3-clause |
seann1/portfolio5 | .meteor/dev_bundle/python/Lib/test/test_slice.py | 6 | 4432 | # tests for slice objects; in particular the indices method.
import unittest
from test import test_support
from cPickle import loads, dumps
import sys
class SliceTest(unittest.TestCase):
def test_constructor(self):
self.assertRaises(TypeError, slice)
self.assertRaises(TypeError, slice, 1, 2, 3, ... | gpl-2.0 |
Azure/WALinuxAgent | tests/protocol/mocks.py | 1 | 9717 | # Copyright 2020 Microsoft Corporation
#
# 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... | apache-2.0 |
FXIhub/hummingbird | src/simulation/fromfile.py | 2 | 1320 | # --------------------------------------------------------------------------------------
# Copyright 2016, Benedikt J. Daurer, Filipe R.N.C. Maia, Max F. Hantke, Carl Nettelblad
# Hummingbird is distributed under the terms of the Simplified BSD License.
# ----------------------------------------------------------------... | bsd-2-clause |
taotie12010/bigfour | lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py | 114 | 7638 | # -*- coding: 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):
# Changing field 'StudentModuleHistory.version'
db.alter_column('courseware_studentmodulehistory', 'version... | agpl-3.0 |
dunkhong/grr | grr/server/grr_response_server/server_stubs_test.py | 2 | 1490 | #!/usr/bin/env python
"""Tests for server stubs for client actions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from future.utils import iteritems
from grr_response_client import client_actions
from grr_response_server import a... | apache-2.0 |
PennartLoettring/Poettrix | rootfs/usr/share/glib-2.0/codegen/codegen_docbook.py | 33 | 16240 | # -*- Mode: Python -*-
# GDBus - GLib D-Bus Library
#
# Copyright (C) 2008-2011 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at ... | gpl-2.0 |
HyperBaton/ansible | test/units/modules/network/f5/test_bigip_appsvcs_extension.py | 21 | 2904 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
shepdelacreme/ansible | lib/ansible/modules/cloud/openstack/os_user_group.py | 86 | 2880 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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': '1.1',
... | gpl-3.0 |
BengtOFFIS/simpy | simpy/resources/resource.py | 2 | 8080 | """
Shared resources supporting priorities and preemption.
These resources can be used to limit the number of processes using them
concurrently. A process needs to *request* the usage right to a resource. Once
the usage right is not needed anymore it has to be *released*. A gas station
can be modelled as a resource wi... | mit |
nlsdfnbch/bitex-crawler | docs/conf.py | 2 | 9163 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# BitEx documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 24 10:29:19 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | mit |
Hanaasagi/sorator | orator/query/grammars/postgres_grammar.py | 1 | 4336 | # -*- coding: utf-8 -*-
from .grammar import QueryGrammar
class PostgresQueryGrammar(QueryGrammar):
_operators = [
'=', '<', '>', '<=', '>=', '<>', '!=',
'like', 'not like', 'between', 'ilike',
'&', '|', '#', '<<', '>>'
]
marker = '%s'
def _compile_lock(self, query, value):... | mit |
peckhams/topoflow | topoflow/utils/ncts_files.py | 1 | 27069 |
# This new verion (6/11/10) hasn't been tested yet.
# Can't run unit tests on my MacPro w/o Nio.
#---------------------------------------------------
# S.D. Peckham
# Sept 2014 (new version to use netCDF4)
# May, June 2010
import os
import sys
import time
import numpy as np
import file_utils
import netCDF4 as nc
... | mit |
konstruktoid/ansible-upstream | test/units/modules/network/aireos/test_aireos_config.py | 18 | 5371 | #
# (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... | gpl-3.0 |
napkindrawing/ansible | lib/ansible/modules/network/f5/bigip_routedomain.py | 59 | 16497 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 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
# ... | gpl-3.0 |
tthtlc/volatility | volatility/plugins/linux/psaux.py | 45 | 1333 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
compiteing/flask-ponypermission | venv/lib/python2.7/site-packages/pony/orm/tests/test_relations_one2one1.py | 1 | 4536 | from __future__ import absolute_import, print_function, division
import unittest
from pony.orm.core import *
db = Database('sqlite', ':memory:')
class Male(db.Entity):
name = Required(unicode)
wife = Optional('Female', column='wife')
class Female(db.Entity):
name = Required(unicode)
hus... | mit |
misgeatgit/opencog | opencog/python/spatiotemporal/temporal_events/composition/railway_framework.py | 34 | 8054 | from itertools import chain
from spatiotemporal.temporal_events.composition.emperical_distribution import overlaps
from spatiotemporal.temporal_events.util import Dijkstra
from utility.functions import almost_equals
__author__ = 'keyvan'
EPSILON = 1e-12
class Wagon(object):
def __init__(self, a, b):
sel... | agpl-3.0 |
jianghuaw/nova | nova/tests/unit/api/openstack/compute/test_block_device_mapping.py | 1 | 17244 | # Copyright 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/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
math-a3k/django-ai | tests/apps/bayesian_networks/test_bns.py | 1 | 27510 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-ai
------------
Tests for `django-ai` models module.
"""
import random
import numpy as np
from bayespy.nodes import Gaussian
from django.test import (TestCase, )
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions impor... | lgpl-3.0 |
mosquito/Tornado-MySQL | tornado_mysql/tests/thirdparty/test_MySQLdb/capabilities.py | 5 | 10125 | #!/usr/bin/env python -O
""" Script to test database capabilities and the DB-API interface
for functionality and memory leaks.
Adapted from a script by M-A Lemburg.
"""
import sys
from time import time
import unittest
PY2 = sys.version_info[0] == 2
class DatabaseTest(unittest.TestCase):
db_module = Non... | mit |
nomadjourney/django-tastypie | tests/complex/api/resources.py | 30 | 1179 | from django.contrib.auth.models import User, Group
from django.contrib.comments.models import Comment
from tastypie.fields import CharField, ForeignKey, ManyToManyField, OneToOneField, OneToManyField
from tastypie.resources import ModelResource
from complex.models import Post, Profile
class ProfileResource(ModelResou... | bsd-3-clause |
spadae22/odoo | addons/stock_account/wizard/stock_invoice_onshipping.py | 1 | 6916 | # -*- 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 |
jralls/gramps | gramps/gen/filters/rules/person/_hassourceof.py | 6 | 1798 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... | gpl-2.0 |
agaldona/odoo-addons | project_partner_event_registration/models/project.py | 2 | 1183 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 Licens... | agpl-3.0 |
rednach/krill | shinken/safepickle.py | 15 | 1971 | # -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/... | agpl-3.0 |
Ecogenomics/GTDBNCBI | scripts_dev/lpsn_scrape/lpsn_to_database.py | 1 | 4370 | #!/usr/bin/env python
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License... | gpl-3.0 |
openvenues/libpostal | scripts/geodata/osm/definitions.py | 1 | 2511 | import os
import re
import six
from collections import defaultdict
from geodata.graph.topsort import topsort
this_dir = os.path.realpath(os.path.dirname(__file__))
DEFAULT_SCRIPT_PATH = os.path.join(this_dir, 'fetch_osm_address_data.sh')
valid_key_regex = re.compile('VALID_(.*?)_KEYS="(.*)"')
variable_regex = re.c... | mit |
opatut/i3pystatus | i3pystatus/core/desktop.py | 6 | 1844 | class BaseDesktopNotification:
"""
Class to display a desktop notification
:param title: Title of the notification
:param body: Body text of the notification, depending on the users system configuration HTML may be used, but is not recommended
:param icon: A XDG icon name, see http://standards.free... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.