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 |
|---|---|---|---|---|---|
blazek/QGIS | tests/src/python/test_provider_spatialite.py | 10 | 50214 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsSpatialiteProvider
.. 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) any later version.
... | gpl-2.0 |
linebp/pandas | pandas/core/sparse/list.py | 9 | 4058 | import warnings
import numpy as np
from pandas.core.base import PandasObject
from pandas.io.formats.printing import pprint_thing
from pandas.core.dtypes.common import is_scalar
from pandas.core.sparse.array import SparseArray
from pandas.util._validators import validate_bool_kwarg
import pandas._libs.sparse as splib
... | bsd-3-clause |
vktr/CouchPotatoServer | libs/guessit/transfo/guess_date.py | 150 | 1217 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
frewsxcv/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/Subversion.py | 19 | 2550 | """SCons.Tool.Subversion.py
Tool-specific initialization for Subversion.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Found... | apache-2.0 |
xiiicyw/Data-Wrangling-with-MongoDB | Lesson_2_Problem_Set/03-Processing_All/process.py | 1 | 2829 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Let's assume that you combined the code from the previous 2 exercises
# with code from the lesson on how to build requests, and downloaded all the data locally.
# The files are in a directory "data", named after the carrier and airport:
# "{}-{}.html".format(carrier, airp... | agpl-3.0 |
nzlosh/st2 | st2actions/tests/unit/test_actions_registrar.py | 3 | 7947 | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | apache-2.0 |
ldgabbay/foostache-python | setup.py | 1 | 2313 | import io
import os
import re
from setuptools import setup
import sys
PACKAGES = [
"foostache",
]
INSTALL_REQUIRES = [
"future~=0.17.1",
"ujson~=1.35",
]
if sys.version_info[0] == 2:
PACKAGES.append("foostache.py2parser")
INSTALL_REQUIRES.append("antlr4-python2-runtime~=4.7.2")
elif sys.version_... | mit |
shreyans800755/coala | tests/results/result_actions/DoNothingActionTest.py | 14 | 1350 | import unittest
from coala_utils.ContextManagers import retrieve_stdout
from coalib.results.Diff import Diff
from coalib.results.Result import Result
from coalib.results.result_actions.DoNothingAction import DoNothingAction
from coalib.settings.Section import Section, Setting
class DoNothingActionTest(unittest.TestC... | agpl-3.0 |
joakim-hove/django | tests/forms_tests/tests/test_input_formats.py | 313 | 38501 | from datetime import date, datetime, time
from django import forms
from django.test import SimpleTestCase, override_settings
from django.utils.translation import activate, deactivate
@override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True)
class LocalizedTimeTests(SimpleTestCase):
def se... | bsd-3-clause |
kmaehashi/sensorbee-python | example/websocket_example.py | 1 | 1249 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WebSocket Example
``pip install websocket-client`` to use websocket client API.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from pysensorbee import SensorBeeAPI
import time
#import websocket
#websocket.enableTrace(True)
c... | mit |
js850/PyGMIN | pygmin/systems/basesystem.py | 1 | 16801 | import tempfile
from pygmin.landscape import DoubleEndedConnect, DoubleEndedConnectPar
from pygmin import basinhopping
from pygmin.storage import Database
from pygmin.takestep import RandomDisplacement, AdaptiveStepsizeTemperature
from pygmin.utils.xyz import write_xyz
from pygmin.optimize import mylbfgs
from pygmin.t... | gpl-3.0 |
b1-systems/kiwi | test/unit/package_manager_zypper_test.py | 1 | 6581 | from mock import patch
import mock
from .test_helper import raises
from kiwi.package_manager.zypper import PackageManagerZypper
from kiwi.exceptions import KiwiRequestError
class TestPackageManagerZypper(object):
def setup(self):
repository = mock.Mock()
repository.root_dir = 'root-dir'
... | gpl-3.0 |
Richard-Mathie/cassandra_benchmark | vendor/github.com/datastax/python-driver/tests/integration/cqlengine/statements/test_where_clause.py | 6 | 1642 | # Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
lduarte1991/edx-platform | common/lib/sandbox-packages/verifiers/tests_draganddrop.py | 24 | 32789 | import json
import unittest
import draganddrop
from .draganddrop import PositionsCompare
class Test_PositionsCompare(unittest.TestCase):
""" describe"""
def test_nested_list_and_list1(self):
self.assertEqual(PositionsCompare([[1, 2], 40]), PositionsCompare([1, 3]))
def test_nested_list_and_lis... | agpl-3.0 |
daxxi13/CouchPotatoServer | couchpotato/core/downloaders/putio/main.py | 7 | 5908 | from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEventAsync
from couchpotato.core._base.downloader.main import DownloaderBase, ReleaseDownloadList
from couchpotato.core.helpers.variable import cleanHost
from couchpotato.core.logger import CPLog
from couchpotato.environment import ... | gpl-3.0 |
citationfinder/scholarly_citation_finder | scholarly_citation_finder/lib/tests.py | 1 | 2060 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.test import TestCase
from file import download_file, unzip_file
from process import ProcessException
class FileTest(TestCase):
def test_download_file_success(self):
file = 'Conferences.zip'
first = download_file(path='https://academicgraph.blo... | mit |
cogmission/nupic | examples/opf/experiments/multistep/simple_0_f2/description.py | 38 | 1618 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
mrquim/repository.mrquim | plugin.video.live.ike/websocket/_ssl_compat.py | 69 | 1551 | """
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, ... | gpl-2.0 |
willusher/ansible-modules-core | cloud/openstack/os_auth.py | 67 | 2036 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 late... | gpl-3.0 |
muff1nman/password-store | contrib/importers/keepass2pass.py | 26 | 4832 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stefan Simroth <stefan.simroth@gmail.com>. All Rights Reserved.
# Based on the script for KeepassX by Juhamatti Niemelä <iiska@iki.fi>.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
#
# Usage:
# ./keepass2pass.py ... | gpl-2.0 |
cgstudiomap/cgstudiomap | main/eggs/Pillow-3.0.0-py2.7-linux-x86_64.egg/PIL/Hdf5StubImagePlugin.py | 77 | 1549 | #
# The Python Imaging Library
# $Id$
#
# HDF5 stub adapter
#
# Copyright (c) 2000-2003 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
from PIL import Image, ImageFile
_handler = None
##
# Install application-specific HDF5 image handler.
#
# @param handler Handler object.
d... | agpl-3.0 |
PetePriority/home-assistant | tests/components/media_player/test_monoprice.py | 3 | 17182 | """The tests for Monoprice Media player platform."""
import unittest
from unittest import mock
import voluptuous as vol
from collections import defaultdict
from homeassistant.components.media_player.const import (
DOMAIN, SUPPORT_TURN_ON, SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE,
SUPPORT_VOLUME_SET, SUPPORT_VOLUM... | apache-2.0 |
mario23285/ProyectoElectrico | src/Arm.py | 1 | 4020 | """
UNIVERSIDAD DE COSTA RICA Escuela de Ingeniería Eléctrica
IE0499 | Proyecto Eléctrico
Mario Alberto Castresana Avendaño
A41267
Programa: BVH_TuneUp
-------------------------------------------------------------------------------
archivo: Arm.py
descripción:
Este archivo contiene la clase Arm... | gpl-2.0 |
pravsripad/mne-python | mne/preprocessing/tests/test_artifact_detection.py | 11 | 3299 | # Author: Adonay Nunes <adonay.s.nunes@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import numpy as np
import pytest
from numpy.testing import assert_allclose
from mne.chpi import read_head_pos
from mne.datasets import testing
from mne.io import read_raw_fif
from mne.preprocessing import (annotate_move... | bsd-3-clause |
stellaf/sales_rental | account_invoice_start_end_dates/models/account_invoice.py | 1 | 3875 | # -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, UserError
class AccountInvoiceLine(models.Model):
_inherit = 'accou... | gpl-3.0 |
piffey/ansible | test/units/modules/network/netscaler/test_netscaler_service.py | 39 | 14315 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... | gpl-3.0 |
quarkonics/zstack-woodpecker | integrationtest/vm/multihosts/volumes/test_snapshot_robot_1_hour.py | 2 | 3493 | '''
Robot Test only includes Vm operations, Volume operations and Snapshot operations
Case will run 1 hour with fair strategy.
@author: Youyk
'''
import zstackwoodpecker.action_select as action_select
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import z... | apache-2.0 |
tylerjereddy/scipy | scipy/optimize/_constraints.py | 12 | 18650 | """Constraints definition for minimize."""
import numpy as np
from ._hessian_update_strategy import BFGS
from ._differentiable_functions import (
VectorFunction, LinearVectorFunction, IdentityVectorFunction)
from .optimize import OptimizeWarning
from warnings import warn
from numpy.testing import suppress_warnings
... | bsd-3-clause |
rajsadho/django | tests/utils_tests/test_baseconv.py | 326 | 1787 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... | bsd-3-clause |
kennethreitz/pipenv | pipenv/vendor/dateutil/tz/_common.py | 10 | 12977 | from six import PY2
from functools import wraps
from datetime import datetime, timedelta, tzinfo
ZERO = timedelta(0)
__all__ = ['tzname_in_python2', 'enfold']
def tzname_in_python2(namefunc):
"""Change unicode output into bytestrings in Python 2
tzname() API changed in Python 3. It used to return bytes,... | mit |
MikeAmy/django | tests/template_tests/filter_tests/test_truncatechars_html.py | 390 | 1229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import truncatechars_html
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_truncate_zero(self):
self.assertEqual(truncatechars_html('<p>one <a href="#">two - three <br>... | bsd-3-clause |
malemburg/pythondotorg | pydotorg/resources.py | 10 | 3960 | from tastypie.authentication import ApiKeyAuthentication
from tastypie.authorization import Authorization
from tastypie.exceptions import Unauthorized
from tastypie.http import HttpUnauthorized
from tastypie.resources import ModelResource
from tastypie.throttle import CacheThrottle
from django.contrib.auth import get_... | apache-2.0 |
skiselev/upm | examples/python/md-stepper.py | 7 | 1988 | #!/usr/bin/python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 l... | mit |
mattrobenolt/django | django/db/__init__.py | 146 | 2374 | from django.core import signals
from django.db.utils import (DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY,
DataError, OperationalError, IntegrityError, InternalError, ProgrammingError,
NotSupportedError, DatabaseError, InterfaceError, Error, ConnectionHandler,
ConnectionRouter)
__all__ = [
'backend', '... | bsd-3-clause |
genodeftest/exaile | xlgui/preferences/__init__.py | 2 | 9035 | # Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
leeseulstack/openstack | neutron/tests/unit/hyperv/test_hyperv_utilsv2.py | 14 | 22389 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
gizela/gizela | gizela/data/NetworkAdjList.py | 1 | 23873 | # gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id: NetworkAdjList.py 116 2010-12-17 16:04:37Z tomaskubin $
from gizela.util.Error import Error
from gizela.data.NetworkList import NetworkList
from gizela.data... | gpl-3.0 |
MissCatLady/AlarmEZ | venv/lib/python2.7/site-packages/psycopg2/tests/test_bugX000.py | 81 | 1678 | #!/usr/bin/env python
# bugX000.py - test for DateTime object allocation bug
#
# Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundati... | mit |
zetalog/linux | tools/perf/scripts/python/syscall-counts-by-pid.py | 532 | 2055 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
from __future__ import print_function
... | gpl-2.0 |
PepSalehi/boulder | backup/june 12/LTS/__init__.py | 5 | 1292 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
LTS
A QGIS plugin
Computes level of traffic stress
-------------------
begin : 2014-04-24
copyright : (C) 201... | mit |
SUSE-Cloud/nova | nova/tests/fakeguestfs.py | 7 | 4597 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Red Hat, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | apache-2.0 |
CodEnFisH/palantir | floodlight/thrift/lib/py/src/TSerialization.py | 74 | 1344 | #
# 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 |
Korkki/django | tests/invalid_models_tests/test_ordinary_fields.py | 224 | 19694 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.timezone import now
from .base i... | bsd-3-clause |
kryptine/ghilbert | verify_test.py | 3 | 5332 | #encoding: utf-8
import sys
import verify
import copy
class StringStream:
def __init__(self, s):
self.lines = s.split('\n')
self.ix = 0
def readline(self):
if self.ix >= len(self.lines):
return ''
else:
result = self.lines[self.ix] + '\n'
... | apache-2.0 |
kytvi2p/tahoe-lafs | misc/simulators/ringsim.py | 8 | 8171 | #! /usr/bin/python
# used to discuss ticket #302: "stop permuting peerlist?"
# import time
import math
from hashlib import md5 # sha1, sha256
myhash = md5
# md5: 1520 "uploads" per second
# sha1: 1350 ups
# sha256: 930 ups
from itertools import count
from twisted.python import usage
def abbreviate_space(s, SI=True)... | gpl-2.0 |
NewpTone/stacklab-nova | nova/virt/baremetal/tilera.py | 7 | 12646 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 University of Southern California
#
# 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/... | apache-2.0 |
verma-varsha/zulip | zerver/webhooks/mention/tests.py | 36 | 1368 | # -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
class MentionHookTests(WebhookTestCase):
STREAM_NAME = 'test'
URL_TEMPLATE = "/api/v1/external/mention?api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'mention'
def test_mention_webfeed(self):
... | apache-2.0 |
hzlf/openbroadcast.org | website/tools/postman/management/commands/postman_cleanup.py | 2 | 2236 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from datetime import timedelta
from optparse import make_option
from django.core.management.base import NoArgsCommand
from django.db.models import Max, Count, F, Q
try:
from django.utils.timezone import now # D... | gpl-3.0 |
DasIch/pyalysis | pyalysis/analysers/base.py | 1 | 3771 | # coding: utf-8
"""
pyalysis.analysers.base
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2014 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
from __future__ import absolute_import
import tokenize
from blinker import Signal
from pyalysis.utils import PerClassAttribute, retain_file_position
... | bsd-3-clause |
alexandreleroux/mayavi | integrationtests/mayavi/test_optional_collection.py | 2 | 4211 | """Simple test for the Optional and Collection filters.
"""
# Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in>
# Copyright (c) 2008, Prabhu Ramachandran
# License: BSD Style.
# Standard library imports.
from os.path import abspath
from StringIO import StringIO
import copy
# Local imports.
from common ... | bsd-3-clause |
senadmd/coinmarketwatch | test/functional/abandonconflict.py | 19 | 7851 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet... | mit |
tpbrisco/bender | benders_ui.py | 1 | 10713 | #!/usr/bin/python
"""Interface to a simple policy database representing network policy
This allows owners to update the own "host groups" and "service templates"
which allow policy statements.
While this version uses a CSV files, it should be easily
extensible to use more conventional databases.
"""
import bender_sql... | gpl-2.0 |
ashrith/dpkt | dpkt/diameter.py | 15 | 5848 | # $Id: diameter.py 23 2006-11-08 15:45:33Z dugsong $
"""Diameter."""
import struct
import dpkt
# Diameter Base Protocol - RFC 3588
# http://tools.ietf.org/html/rfc3588
# Request/Answer Command Codes
ABORT_SESSION = 274
ACCOUTING = 271
CAPABILITIES_EXCHANGE = 257
DEVICE_WATCHDOG = 280
DISCONNECT_PEER = 282
RE_AU... | bsd-3-clause |
stwunsch/gnuradio | gr-digital/python/digital/qa_glfsr_source.py | 57 | 3531 | #!/usr/bin/env python
#
# Copyright 2007,2010,2012,2013 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, or (at ... | gpl-3.0 |
unbit/spockfs | spockfs_tests.py | 1 | 6150 | import unittest
import os
import shutil
import stat
import time
import xattr
FS_DIR = '/tmp/.spockfs_testdir'
# clear the fs
for item in os.listdir(FS_DIR):
path = os.path.join(FS_DIR, item)
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
class SpockFS(unittest.TestCase)... | mit |
Arsey/keras-transfer-learning-for-oxford102 | models/inception_v3.py | 1 | 2743 | from keras.applications.inception_v3 import InceptionV3 as KerasInceptionV3
from keras.layers import GlobalAveragePooling2D, Dense
from keras.models import Model
from keras.optimizers import SGD
from keras.preprocessing import image
import numpy as np
import config
from .base_model import BaseModel
class InceptionV3... | mit |
CatsAndDogsbvba/odoo | addons/account_asset/wizard/__init__.py | 445 | 1122 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
DiamondLightSource/auto_tomo_calibration-experimental | old_code_scripts/lmfit-py/lmfit/models.py | 7 | 16554 | import numpy as np
from .model import Model
from .lineshapes import (gaussian, lorentzian, voigt, pvoigt, pearson7,
step, rectangle, breit_wigner, logistic,
students_t, lognormal, damped_oscillator,
expgaussian, skewed_gaussian, donaich,
... | apache-2.0 |
etuna-SBF-kog/Stadsparken | env/lib/python2.7/site-packages/django/contrib/gis/db/backends/mysql/introspection.py | 624 | 1426 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
d... | gpl-3.0 |
ankraft/onem2mlib | examples/groups.py | 1 | 1616 | #
# groups.py
#
# (c) 2017 by Andreas Kraft
# License: BSD 3-Clause License. See the LICENSE file for further details.
#
# This example shows how to create a <group> resource and how to use the fanOutPoint.jjjkkk
# Everything is deleted in the end.
#
import uuid, sys
sys.path.append('..')
from onem2mlib import *
if ... | bsd-3-clause |
wkritzinger/asuswrt-merlin | release/src/router/samba36/lib/dnspython/tests/flags.py | 21 | 2093 | # Copyright (C) 2003-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 ... | gpl-2.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/rpc.py | 44 | 20228 | """RPC Implemention, originally written for the Python Idle IDE
For security reasons, GvR requested that Idle's Python execution server process
connect to the Idle process, which listens for the connection. Since Idle has
has only one client per server, this was not a limitation.
+--------------------------------... | gpl-2.0 |
petemounce/ansible | lib/ansible/vars/manager.py | 4 | 26590 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
javierag/openchange | python/openchange/migration/openchangedb.py | 4 | 16431 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# OpenChangeDB DB schema and its migrations
# Copyright (C) Enrique J. Hernández Blasco <ejhernandez@zentyal.com> 2015
#
# 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 Sof... | gpl-3.0 |
vdloo/raptiformica | vendor/consul-kv/tests/unit/api/test_mapping_to_txn_data.py | 1 | 1819 | from base64 import b64encode
from collections import OrderedDict
from consul_kv.api import _mapping_to_txn_data
from tests.testcase import TestCase
class TestMappingToTxnData(TestCase):
def setUp(self):
self.mapping = OrderedDict([
('some/key/1', 'some_value_1'),
('some/key/2', 's... | mit |
ryanmt/mitro | mitro-core/tools/verifydevice.py | 25 | 1548 | #!/usr/bin/python
import json
import subprocess
import sys
import urllib
def print_validation(type_string, arg_string):
v = json.loads(arg_string)
if type_string == 'new_device_login':
print v[0], v[1], v[2]
print 'https://localhost:8443/mitro-core/user/VerifyDevice?' + urllib.urlencode({
... | gpl-3.0 |
mw46d/ardupilot | Tools/autotest/param_metadata/param_parse.py | 6 | 9603 | #!/usr/bin/env python
from __future__ import print_function
import glob
import os
import re
import sys
from optparse import OptionParser
from param import (Library, Parameter, Vehicle, known_group_fields,
known_param_fields, required_param_fields, known_units)
from htmlemit import HtmlEmit
from rste... | gpl-3.0 |
shakamunyi/docker-registry | depends/docker-registry-core/docker_registry/core/exceptions.py | 36 | 2180 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Docker.
#
# 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... | apache-2.0 |
anryko/ansible | test/units/module_utils/basic/test__log_invocation.py | 169 | 1797 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
# (c) 2017, Ansible Project
# 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 pytest
ARGS = dict(foo=False, bar=... | gpl-3.0 |
asm666/sympy | sympy/functions/elementary/tests/test_integers.py | 39 | 6533 | from sympy import Symbol, floor, nan, oo, E, symbols, ceiling, pi, Rational, \
Float, I, sin, exp, log, factorial, frac
from sympy.utilities.pytest import XFAIL
x = Symbol('x')
i = Symbol('i', imaginary=True)
y = Symbol('y', real=True)
k, n = symbols('k,n', integer=True)
def test_floor():
assert floor(nan) ... | bsd-3-clause |
ArcherSys/ArcherSys | MCEDIT/mcedit/stock-brushes/Replace.py | 8 | 1539 | from pymclevel.materials import Block
from editortools.brush import createBrushMask, createTileEntities
from pymclevel import block_fill
displayName = 'Replace'
mainBlock = 'Block To Replace With'
secondaryBlock = 'Block'
wildcardBlocks = ['Block']
def createInputs(self):
self.inputs = (
{'Hollow': False},
... | mit |
pepeantena4040/MiSitioWeb | meta/lib/oeqa/runtime/connman.py | 5 | 1079 | import unittest
from oeqa.oetest import oeRuntimeTest, skipModule
from oeqa.utils.decorators import *
def setUpModule():
if not oeRuntimeTest.hasPackage("connman"):
skipModule("No connman package in image")
class ConnmanTest(oeRuntimeTest):
def service_status(self, service):
if oeRuntimeTest... | gpl-2.0 |
huggingface/pytorch-transformers | src/transformers/models/vit/configuration_vit.py | 2 | 5272 | # coding=utf-8
# Copyright 2021 Google AI and The HuggingFace Inc. team. 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.... | apache-2.0 |
phihag/youtube-dl | test/test_iqiyi_sdk_interpreter.py | 36 | 1104 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL
from youtube_dl.extractor import IqiyiIE
class IqiyiIEWithCredentials(IqiyiIE):... | unlicense |
ntt-sic/heat | heat/common/exception.py | 1 | 10232 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. ... | apache-2.0 |
bwrc/export2hdf5 | export2hdf5/utilities_neurone.py | 1 | 13284 | # This file is part of export2hdf5
#
# Copyright 2017
# Andreas Henelius <andreas.henelius@ttl.fi>,
# Finnish Institute of Occupational Health
#
# This code is released under the MIT License
# http://opensource.org/licenses/mit-license.php
#
# Please see the file LICENSE for details.
"""
This module contains functions... | mit |
zhongzw/skia-sdl | platform_tools/android/bin/download_utils.py | 149 | 8464 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client 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 library to assist automatically downloading files.
This library is used by scripts that download tarballs, zipfiles, etc. as... | bsd-3-clause |
drawks/ansible | lib/ansible/modules/network/onyx/onyx_ptp_global.py | 59 | 6923 | #!/usr/bin/python
#
# Copyright: Ansible Project
# 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',
'status': ['preview'],
... | gpl-3.0 |
spadae22/odoo | addons/website_twitter/models/twitter.py | 376 | 5350 | from urllib2 import urlopen, Request, HTTPError
import base64
import json
import logging
import werkzeug
from openerp.osv import fields, osv
API_ENDPOINT = 'https://api.twitter.com'
API_VERSION = '1.1'
REQUEST_TOKEN_URL = '%s/oauth2/token' % API_ENDPOINT
REQUEST_FAVORITE_LIST_URL = '%s/%s/favorites/list.json' % (API... | agpl-3.0 |
h2oloopan/easymerge | EasyMerge/tests/scrapy/scrapy/contrib/linkextractors/htmlparser.py | 11 | 2468 | """
HTMLParser-based link extractor
"""
from HTMLParser import HTMLParser
from urlparse import urljoin
from w3lib.url import safe_url_string
from scrapy.link import Link
from scrapy.utils.python import unique as unique_list
class HtmlParserLinkExtractor(HTMLParser):
def __init__(self, tag="a", attr="href", pro... | mit |
mattdm/dnf | dnf/transaction.py | 3 | 6891 | # transaction.py
# Managing the transaction to be passed to RPM.
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later v... | gpl-2.0 |
whereismyjetpack/ansible | lib/ansible/modules/network/dellos6/dellos6_facts.py | 19 | 14318 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell 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 versi... | gpl-3.0 |
Intel-Corporation/tensorflow | tensorflow/python/data/experimental/kernel_tests/serialization/prefetch_dataset_serialization_test.py | 21 | 1539 | # Copyright 2017 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 |
DLu/rosbridge_suite | rosbridge_server/src/tornado/iostream.py | 15 | 58750 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | bsd-3-clause |
DylannCordel/django-cms | cms/tests/widgets.py | 61 | 1211 | # -*- coding: utf-8 -*-
from cms.api import create_page
from cms.forms.widgets import PageSelectWidget, PageSmartLinkWidget
from cms.test_utils.testcases import CMSTestCase
class WidgetTestCases(CMSTestCase):
def test_pageselectwidget(self):
page = create_page("Test page", "nav_playground.html", "en")
... | bsd-3-clause |
monash-merc/karaage | karaage/migrations/0001_initial.py | 3 | 20407 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import jsonfield.fields
import datetime
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrat... | gpl-3.0 |
GNOME/orca | test/keystrokes/gtk-demo/role_combo_box2.py | 1 | 2176 | #!/usr/bin/python
"""Test of labelled combo box output."""
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(KeyComboAction("<Control>f"))
sequence.append(TypeAction("Printing"))
sequence.append(KeyComboAction("Return"))
sequence.append(KeyComboAction("Right"))
sequence.append... | lgpl-2.1 |
TsubasaK111/MeetingMaster | conference.py | 1 | 20723 | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import js... | apache-2.0 |
harlowja/networkx | networkx/algorithms/tree/recognition.py | 4 | 6598 | #-*- coding: utf-8 -*-
"""
Recognition Tests
=================
A *forest* is an acyclic, undirected graph, and a *tree* is a connected forest.
Depending on the subfield, there are various conventions for generalizing these
definitions to directed graphs.
In one convention, directed variants of forest and tree are def... | bsd-3-clause |
prakxys/flask | Work/Trivia - Module 5/env/Lib/site-packages/setuptools/command/bdist_wininst.py | 325 | 2283 | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst
import os, sys
class bdist_wininst(_bdist_wininst):
_good_upload = _bad_upload = None
def create_exe(self, arcname, fullname, bitmap=None):
_bdist_wininst.create_exe(self, arcname, fullname, bitmap)
installer_name = se... | apache-2.0 |
j-haj/interview-prep | src/algorithms/binary-search/main.py | 1 | 1165 | import math
import unittest
class TestSearch(unittest.TestCase):
def test_small_search(self):
l = [i for i in range(3)]
self.assertEqual(0, bsearch(l, 0))
def test_end_range(self):
l = [i for i in range(100)]
self.assertEqual(99, bsearch(l, 99))
def test_successful_search... | mit |
kustodian/ansible | lib/ansible/module_utils/facts/sysctl.py | 135 | 1093 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
anryko/ansible | lib/ansible/modules/network/aci/mso_schema_site_anp_epg.py | 13 | 6426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Dag Wieers (@dagwieers) <dag@wieers.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_ve... | gpl-3.0 |
amyvmiwei/chromium | third_party/scons/scons-local/SCons/compat/_scons_subprocess.py | 15 | 44648 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# This module should remain compatible with Python 2.2, see PEP 291.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://ww... | bsd-3-clause |
Designist/audacity | lib-src/lv2/serd/waflib/Tools/javaw.py | 266 | 10142 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,tempfile,shutil
from waflib import TaskGen,Task,Utils,Options,Build,Errors,Node,Logs
from waflib.Configure import conf
from waflib.TaskGen import feature,before_m... | gpl-2.0 |
wzhuo918/release-1.1.2-MDP | src/contrib/hod/testing/main.py | 182 | 2928 | #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 thi... | apache-2.0 |
garlandkr/ansible | test/units/TestFilters.py | 13 | 3426 | '''
Test bundled filters
'''
import os.path
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
import ansible.runner.filter_plugins.core
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: [1,2,3] }
tasks:
- template: src=%s dest=%s... | gpl-3.0 |
feliperfranca/FelipeRFranca_site | conteudo/views.py | 1 | 3367 | # Create your views here.
from conteudo.models import Academico, Profissional, Complementar, Competencia, Informacao,\
Timeline
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.views.generic.list import ListView
from layou... | bsd-3-clause |
DeMille/emailhooks | django_nonrel/django/contrib/auth/hashers.py | 34 | 16332 | from __future__ import unicode_literals
import base64
import functools
import hashlib
from django.dispatch import receiver
from django.conf import settings
from django.test.signals import setting_changed
from django.utils import importlib
from django.utils.datastructures import SortedDict
from django.utils.encoding i... | mit |
ulif/pulp | bindings/pulp/bindings/exceptions.py | 15 | 3895 | """
Defines exception classes to handle server connection and request exceptions
"""
from gettext import gettext as _
class RequestException(Exception):
"""
Base exception class for all exceptions that originate by the Pulp server. These
exceptions coming from the server use the standard exception struct... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.