repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
adaur/SickRage | lib/sqliteshelf.py | 50 | 3661 | """
by default, things are stored in a "shelf" table
>>> d = SQLiteShelf("test.sdb")
you can put multiple shelves into a single SQLite database
>>> e = SQLiteShelf("test.sdb", "othertable")
both are empty to start with
>>> d
{}
>>> e
{}
adding stuff is as simple as a regular dict
>>> d['a'] = "moo"
>>> e['a'] = "... | gpl-3.0 |
kgao/MediaDrop | mediadrop/lib/storage/bliptv.py | 2 | 3454 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2014 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
florinp/untitled_game | scripts/objects/baseObject.py | 1 | 5799 | import sys, os, re, math, random, shutil
from fife import fife
from fife.extensions.loaders import loadMapFile
from scripts.misc.exceptions import *
from scripts.misc.serializer import Serializer
GameObjectTypes = {
"DEFAULT": 0,
"ITEM": 1,
"QUESTGIVER": 2,
"PLAYER": 3,
"NPC": 4,
"ENEMY": 5,
... | mit |
lukecwik/incubator-beam | sdks/python/apache_beam/io/filesystem.py | 2 | 29289 | #
# 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 us... | apache-2.0 |
bigunagi/vnpy | vn.trader/ctpGateway/ctpDataType.py | 129 | 257031 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@system 新一代交易所系统
#@company 上海期货信息技术有限公司
#@file ThostFtdcUserApiDataType.h
#@brief 定义了客户端接口使用的业务数据类型
#@history
#20060106 赵鸿昊 创建该文件
#/////////////////////////////////////////////////////////////... | mit |
XiaodunServerGroup/ddyedx | common/djangoapps/terrain/stubs/tests/test_lti_stub.py | 8 | 2919 | """
Unit tests for stub LTI implementation.
"""
from mock import Mock, patch
import unittest
import urllib2
import requests
from terrain.stubs.lti import StubLtiService
class StubLtiServiceTest(unittest.TestCase):
"""
A stub of the LTI provider that listens on a local
port and responds with pre-defined gra... | agpl-3.0 |
carrillo/scikit-learn | examples/linear_model/plot_omp.py | 385 | 2263 | """
===========================
Orthogonal Matching Pursuit
===========================
Using orthogonal matching pursuit for recovering a sparse signal from a noisy
measurement encoded with a dictionary
"""
print(__doc__)
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import OrthogonalM... | bsd-3-clause |
jgcaaprom/android_external_chromium_org | tools/perf/page_sets/simple_mobile_sites.py | 33 | 1879 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SimplePage(page_module.Page):
def __init__(se... | bsd-3-clause |
Beauhurst/django | tests/auth_tests/test_management.py | 6 | 26322 | import builtins
import getpass
import sys
from datetime import date
from io import StringIO
from unittest import mock
from django.apps import apps
from django.contrib.auth import management
from django.contrib.auth.management import (
create_permissions, get_default_username,
)
from django.contrib.auth.management.... | bsd-3-clause |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/plat-mac/argvemulator.py | 73 | 3061 | """argvemulator - create sys.argv from OSA events. Used by applets that
want unix-style arguments.
"""
from warnings import warnpy3k
warnpy3k("In 3.x, the argvemulator module is removed.", stacklevel=2)
import sys
import traceback
from Carbon import AE
from Carbon.AppleEvents import *
from Carbon import Evt
from Carb... | apache-2.0 |
sirrice/pygg | tests/pygg_tests.py | 2 | 15120 | import unittest
import io
import pandas
import tempfile
import os.path
import pygg
import pandas.util.testing as pdt
class IPythonTests(unittest.TestCase):
"""Test IPython integration"""
def setUp(self):
"""Setup IPython tests, skipping if IPython isn't present"""
try:
import IPyt... | mit |
multicastTor/multicastTor | shadow/contrib/topology/collapse-topology.py | 1 | 1984 | #!/usr/bin/python
import networkx as nx
from numpy import median
INPUT_GRAPH="topology.complete.graphml.xml"
OUTPUT_GRAPH="topology.graphml.xml"
def copy_edge_props(srce, dste):
for attr in srce:
if attr not in dste: dste[attr] = []
dste[attr].append(float(srce[attr]))
def copy_node_props(srcn, ... | bsd-3-clause |
pelson/pelican-plugins | interlinks/interlinks.py | 41 | 1434 | # -*- coding: utf-8 -*-
"""
Interlinks
=========================
This plugin allows you to include "interwiki" or shortcuts links into the blog, as keyword>rest_of_url
"""
from bs4 import BeautifulSoup
from pelican import signals
import re
interlinks = {}
def getSettings (generator):
global interlinks
interl... | agpl-3.0 |
travisfcollins/gnuradio | gnuradio-runtime/lib/pmt/gen-serial-tags.py | 88 | 1724 | """
//
// Copyright 2011 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 your option)
// any later... | gpl-3.0 |
sserrot/champion_relationships | venv/Lib/site-packages/networkx/algorithms/__init__.py | 1 | 5825 | from networkx.algorithms.assortativity import *
from networkx.algorithms.asteroidal import *
from networkx.algorithms.boundary import *
from networkx.algorithms.bridges import *
from networkx.algorithms.chains import *
from networkx.algorithms.centrality import *
from networkx.algorithms.chordal import *
from networkx.... | mit |
eblur/newdust | newdust/halos/galhalo.py | 1 | 10891 | import numpy as np
from scipy.integrate import trapz
from scipy.interpolate import interp1d, InterpolatedUnivariateSpline
import astropy.units as u
from astropy.io import fits
from .halo import Halo
from ..grainpop import *
from .. import constants as c
__all__ = ['UniformGalHalo','ScreenGalHalo','path_diff','time_d... | bsd-2-clause |
azureplus/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/request.py | 31 | 8378 | import logging
from attribute_converter import to_local
from saml2 import time_util, BINDING_HTTP_REDIRECT
from saml2.s_utils import OtherError
from saml2.validate import valid_instance
from saml2.validate import NotValid
from saml2.response import IncorrectlySigned
logger = logging.getLogger(__name__)
def _dummy(... | apache-2.0 |
Ademan/python-xlib-branch | Xlib/X.py | 6 | 10209 | # Xlib.X -- basic X constants
#
# Copyright (C) 2000 Peter Liljenberg <petli@ctrl-c.liu.se>
#
# 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
# ... | gpl-2.0 |
rminnich/linux | tools/perf/scripts/python/netdev-times.py | 268 | 15299 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
sinhrks/pandas-ml | pandas_ml/skaccessors/test/test_naive_bayes.py | 1 | 1236 | #!/usr/bin/env python
import sklearn.datasets as datasets
import sklearn.naive_bayes as nb
import pandas_ml as pdml
import pandas_ml.util.testing as tm
class TestNaiveBayes(tm.TestCase):
def test_objectmapper(self):
df = pdml.ModelFrame([])
self.assertIs(df.naive_bayes.GaussianNB, ... | bsd-3-clause |
brotchie/keepnote | keepnote/notebook/connection/fs/__init__.py | 2 | 44679 | """
KeepNote
Low-level Create-Read-Update-Delete (CRUD) interface for notebooks.
"""
#
# KeepNote
# Copyright (c) 2008-2011 Matt Rasmussen
# Author: Matt Rasmussen <rasmus@alum.mit.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Genera... | gpl-2.0 |
andykimpe/chromium-test-npapi | build/android/pylib/system_properties.py | 97 | 1431 | # 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.
class SystemProperties(dict):
"""A dict interface to interact with device system properties.
System properties are key/value pairs as exposed by adb s... | bsd-3-clause |
Nikoala/CouchPotatoServer | libs/rsa/_version200.py | 177 | 15007 | """RSA module
Module for calculating large primes, and RSA encryption, decryption,
signing and verification. Includes generating public and private keys.
WARNING: this implementation does not use random padding, compression of the
cleartext input to prevent repetitions, or other common security improvements.
Use with... | gpl-3.0 |
dshlai/oyprojectmanager | oyProjectManager/ui/version_creator_UI_pyside.py | 3 | 35069 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/eoyilmaz/Documents/development/oyProjectManager/oyProjectManager/ui/version_creator.ui'
#
# Created: Sun Oct 21 23:07:49 2012
# by: pyside-uic 0.2.13 running on PySide 1.1.1
#
# WARNING! All changes made in this file will be lost!... | bsd-2-clause |
vybstat/scikit-learn | sklearn/tree/tests/test_export.py | 130 | 9950 | """
Testing for export functions of decision trees (sklearn.tree.export).
"""
from re import finditer
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
from sklearn.ensemble import GradientBoostingClassifier
from sklearn... | bsd-3-clause |
ashutosh-mishra/youtube-dl | youtube_dl/extractor/ustream.py | 5 | 2529 | import json
import re
from .common import InfoExtractor
from ..utils import (
compat_urlparse,
get_meta_content,
)
class UstreamIE(InfoExtractor):
_VALID_URL = r'https?://www\.ustream\.tv/recorded/(?P<videoID>\d+)'
IE_NAME = u'ustream'
_TEST = {
u'url': u'http://www.ustream.tv/recorded/20... | unlicense |
40223149/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/importlib/basehook.py | 608 | 1396 | from javascript import JSObject
from browser import window
import urllib.request
class TempMod:
def __init__(self, name):
self.name=name
#define my custom import hook (just to see if it get called etc).
class BaseHook:
def __init__(self, fullname=None, path=None):
self._fullname=fullname
self._p... | gpl-3.0 |
wikimedia/mediawiki-extensions-WikidataEntitySuggester | wikiparser/top-global-properties/topproperties.py | 2 | 2346 | #!/usr/bin/python
""" The mapper script to count global property frequencies from the wikidata dump using Hadoop.
Sample command to run this on Hadoop:
bin/hadoop jar contrib/streaming/hadoop*streaming*jar -libjars /tmp/entity-suggester-client.jar \
-inputformat org.wikimedia.wikibase.entitysuggester.wikiparser.Wik... | mit |
bfontaine/alfred-pp | unidecode/x078.py | 252 | 4648 | data = (
'Dang ', # 0x00
'Ma ', # 0x01
'Sha ', # 0x02
'Dan ', # 0x03
'Jue ', # 0x04
'Li ', # 0x05
'Fu ', # 0x06
'Min ', # 0x07
'Nuo ', # 0x08
'Huo ', # 0x09
'Kang ', # 0x0a
'Zhi ', # 0x0b
'Qi ', # 0x0c
'Kan ', # 0x0d
'Jie ', # 0x0e
'Fen ', # 0x0f
'E ', # 0x10
'Ya ', ... | mit |
linchaoyang/fabric | bddtests/chaincode_pb2.py | 38 | 37031 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: chaincode.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as ... | apache-2.0 |
russellb/nova-docker | novadocker/virt/docker/hostinfo.py | 9 | 2283 | # Copyright (c) 2013 dotCloud, 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 requir... | apache-2.0 |
loco-odoo/localizacion_co | openerp/addons/base_gengo/wizard/__init__.py | 434 | 1077 | # -*- 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 |
jonathanverner/circular | tests/circular/template/tag/test_text.py | 1 | 1038 | from tests.brython.browser.html import MockElement
from src.circular.template.context import Context
from src.circular.template.tags import TextPlugin
from src.circular.template.tpl import _compile
def test_text_plugin():
text_elem = MockElement('#text')
text_elem.text = "Hello {{ name }}"
tp = TextPlugi... | mit |
mikelarre/hr-addons | hr_employee_deactivate/tests/test_hr_employee_deactivate.py | 1 | 1229 | # -*- coding: utf-8 -*-
# Copyright 2017 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import openerp.tests.common as common
class TestHrEmployeeDeactivate(common.TransactionCase):
def setUp(self):
super(TestHrEmployeeDeactivate, self).setUp()
us... | agpl-3.0 |
wilsaj/flask-admin | examples/methodview/methodview.py | 6 | 1134 | from flask import Flask, redirect, request
from flask.ext import admin
from flask.views import MethodView
class ViewWithMethodViews(admin.BaseView):
@admin.expose('/')
def index(self):
return self.render('methodtest.html')
@admin.expose_plugview('/_api/1')
class API_v1(MethodView):
d... | bsd-3-clause |
richardbeare/SimpleITK | Examples/Python/SimpleGaussianProcedural.py | 4 | 1254 | #!/usr/bin/env python
# =========================================================================
#
# Copyright NumFOCUS
#
# 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:/... | apache-2.0 |
sgso/RIOT | tests/netdev/tests/01-interaction.py | 20 | 5777 | #!/usr/bin/env python
# Copyright (C) 2014 Martine Lenders <mlenders@inf.fu-berlin.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os, signal, sys, time
from pexpect import spawn, TIMEO... | lgpl-2.1 |
ABaldwinHunter/django-clone | django/db/models/query.py | 6 | 68782 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import sys
import warnings
from collections import OrderedDict, deque
from django.conf import settings
from django.core import exceptions
from django.db import (
DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ... | bsd-3-clause |
arijitt/HiBench | bin/functions/monitor.py | 19 | 36542 | #!/usr/bin/env python2
# 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 "Lice... | apache-2.0 |
devs1991/test_edx_docmode | common/djangoapps/util/models.py | 61 | 1934 | """Models for the util app. """
import cStringIO
import gzip
import logging
from django.db import models
from django.utils.text import compress_string
from config_models.models import ConfigurationModel
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
class RateLimitConfiguration(ConfigurationM... | agpl-3.0 |
snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/docs/_themes/flask_theme_support.py | 38 | 6672 | """
Copyright (c) 2010 by Armin Ronacher.
Some rights reserved.
Redistribution and use in source and binary forms of the theme, 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 condition... | gpl-3.0 |
piotr1212/graphite-web | webapp/graphite/metrics/urls.py | 11 | 1089 | """Copyright 2009 Chris Davis
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
... | apache-2.0 |
Eigenlabs/EigenD | tools/packages/SCons/Tool/gs.py | 2 | 2551 | """SCons.Tool.gs
Tool-specific initialization for Ghostscript.
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 Foundation
#
# ... | gpl-3.0 |
takis/django | tests/utils_tests/test_autoreload.py | 191 | 7073 | import os
import shutil
import tempfile
from importlib import import_module
from django import conf
from django.contrib import admin
from django.test import SimpleTestCase, override_settings
from django.test.utils import extend_sys_path
from django.utils import autoreload
from django.utils._os import npath
LOCALE_PAT... | bsd-3-clause |
vv1133/home_web | build/lib.linux-armv6l-2.7/django/contrib/gis/db/models/fields.py | 110 | 11660 | from django.db.models.fields import Field
from django.db.models.sql.expressions import SQLEvaluator
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis import forms
from django.contrib.gis.db.models.proxy import GeometryProxy
from django.contrib.gis.geometry.backend import Geometry, Geometry... | bsd-3-clause |
samdroid-apps/something-for-reddit | redditisgtk/test_identity.py | 1 | 2386 | import json
import pytest
import shutil
from unittest.mock import MagicMock, patch
from redditisgtk import api
from redditisgtk import identity
def build_identity_controller(path: str = None):
if path is None:
path = '/fake/wow-this-is-a-fake-path'
session = MagicMock()
ic = identity.IdentityCon... | gpl-3.0 |
dmehra/mkdocs | mkdocs/tests/utils/utils_tests.py | 22 | 6610 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import mock
import os
import unittest
from mkdocs import nav, utils, exceptions
from mkdocs.tests.base import dedent
class UtilsTests(unittest.TestCase):
def test_html_path(self):
expected_results = {
'index.md': ... | bsd-2-clause |
RockySteveJobs/python-for-android | python-modules/twisted/twisted/python/test/test_inotify.py | 56 | 3188 | # Copyright (c) 2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python._inotify}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.runtime import platform
if platform.supportsINotify():
from ctypes import c_int, c_char_p
from twisted.python import _inot... | apache-2.0 |
goddardl/gaffer | python/GafferUI/NameLabel.py | 2 | 6765 | ##########################################################################
#
# 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 |
stopstalk/stopstalk-deployment | aws_lambda/spoj_aws_lambda_function/lambda_code/setuptools/monkey.py | 11 | 5204 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
from importlib import import_module
import inspect
from setuptools.extern import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need this ... | mit |
iago-suarez/ancoweb-TFG | src/integration_tests/tests.py | 1 | 5612 | import os
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from djangojs.runners import QUnitSuite, PhantomJsRunner, JsTestException
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.conf import settings
from selenium.webdriver.common.by import ... | apache-2.0 |
ramaseshan/Spirit | spirit/comment/bookmark/models.py | 4 | 1525 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from djconfig import config
from ...core.utils import paginator
class CommentBookmark(models.Model):
user = models.ForeignKey(s... | mit |
ennoborg/gramps | gramps/gui/ddtargets.py | 5 | 9540 | # -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2005 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 publishe... | gpl-2.0 |
kmonsoor/python-for-android | python3-alpha/python3-src/Doc/includes/test.py | 139 | 3744 | """Test module for the noddy examples
Noddy 1:
>>> import noddy
>>> n1 = noddy.Noddy()
>>> n2 = noddy.Noddy()
>>> del n1
>>> del n2
Noddy 2
>>> import noddy2
>>> n1 = noddy2.Noddy('jim', 'fulton', 42)
>>> n1.first
'jim'
>>> n1.last
'fulton'
>>> n1.number
42
>>> n1.name()
'jim fulton'
>>> n1.first = 'will'
>>> n1.n... | apache-2.0 |
abdoosh00/edx-platform | common/lib/xmodule/xmodule/tests/__init__.py | 3 | 11773 | """
unittests for xmodule
Run like this:
rake test_common/lib/xmodule
"""
import json
import os
import pprint
import unittest
from mock import Mock
from path import path
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds
from xmodule.x_module import ModuleSystem, XModuleDescriptor... | agpl-3.0 |
mvaled/sentry | src/sentry/api/endpoints/sentry_app_installation_external_issues.py | 3 | 1473 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.bases import SentryAppInstallationBaseEndpoint
from sentry.api.serializers import serialize
from sentry.mediators.external_issues import IssueLinkCreator
from sentry.models import Group, Project
class SentryAppInstal... | bsd-3-clause |
conda/kapsel | conda_kapsel/provide.py | 1 | 1156 | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © 2016, Continuum Analytics, Inc. All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -------------------------------------------------------------------... | bsd-3-clause |
marcusramberg/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/packaging/language/composer.py | 11 | 6007 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Dimitrios Tydeas Mengidis <tydeas.dr@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... | mit |
albertomurillo/ansible | test/units/plugins/inventory/test_constructed.py | 48 | 7438 | # -*- coding: utf-8 -*-
# Copyright 2019 Alan Rominger <arominge@redhat.net>
#
# 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 |
ZdrowyGosciu/kernel_lge_d802_v30d | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
sgallagher/anaconda | pyanaconda/modules/storage/partitioning/manual/manual_module.py | 6 | 6444 | #
# Manual partitioning module.
#
# Copyright (C) 2018 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 version.
# This program is distribu... | gpl-2.0 |
laslabs/odoo | openerp/addons/test_impex/models.py | 392 | 5891 | # -*- coding: utf-8 -*-
from openerp.osv import orm, fields
def selection_fn(obj, cr, uid, context=None):
return list(enumerate(["Corge", "Grault", "Wheee", "Moog"]))
def function_fn(model, cr, uid, ids, field_name, arg, context):
return dict((id, 3) for id in ids)
def function_fn_write(model, cr, uid, id, f... | agpl-3.0 |
bpilania/Comp621Project | lib/antlr-3.0.1/runtime/Python/tests/t044trace.py | 3 | 2566 | import antlr3
import testbase
import unittest
class T(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar(options='-trace')
def lexerClass(self, base):
class TLexer(base):
def __init__(self, *args, **kwargs):
base.__init__(self, *args, **kwargs)
... | apache-2.0 |
MathiasGruber/plmd | src/plmd/caseAnalyses/pca.py | 1 | 2580 | #!/usr/bin/python
import plmd.generalAnalyses.componentAnalysis as pcaFuncs
import plmd.plotData as myPlot
import numpy as np
# Function for running the actual analysis
def runAnalysis( caseDir, mdTrajectory ):
# Create eigenvalue file
with open( caseDir+"/analysis/data/evecs-cleaned.dat", "w" ) as fo:
... | gpl-2.0 |
kntem/webdeposit | modules/miscutil/lib/paginationutils_unit_tests.py | 3 | 2190 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 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) a... | gpl-2.0 |
p0psicles/SickRage | lib/hachoir_parser/image/tiff.py | 74 | 2337 | """
TIFF image parser.
Authors: Victor Stinner, Sebastien Ponce, Robert Xiao
Creation date: 30 september 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import FieldSet, SeekableFieldSet, RootSeekableFieldSet, Bytes
from hachoir_core.endian import LITTLE_ENDIAN, BIG_ENDIAN
from hachoir_parser.image... | gpl-3.0 |
zstackio/zstack-woodpecker | integrationtest/vm/virt_plus/test_create_UEFI_vm.py | 2 | 2110 | '''
New Integration test for testing create a vm with UEFI BIOS.
@author: Pengtao.Zhang
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.zstack_test.zstack_test_vm as test_vm_header
import zstackwoo... | apache-2.0 |
osh/gnuradio | gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py | 58 | 14253 | #!/usr/bin/env python
#
# Copyright 2005-2007,2011,2012 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 |
dungvtdev/upsbayescpm | bayespy/inference/vmp/nodes/tests/test_poisson.py | 3 | 2500 | ################################################################################
# Copyright (C) 2014 Jaakko Luttinen
#
# This file is licensed under the MIT License.
################################################################################
"""
Unit tests for `poisson` module.
"""
import numpy as np
import sc... | mit |
wcmitchell/insights-core | insights/parsers/ceph_cmd_json_parsing.py | 1 | 11355 | """
Ceph status commands
====================
This module provides processing for the output of the following ceph related
commands with `-f json-pretty` parameter.
CephOsdDump - command ``ceph osd dump -f json-pretty``
------------------------------------------------------
CephOsdDf - command ``ceph osd df -f json-... | apache-2.0 |
FarnazH/horton | horton/meanfield/test/test_orbitals.py | 4 | 10829 | # -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by th... | gpl-3.0 |
keitaroyam/yam_scripts | xparm.py | 1 | 9153 | """
xparm.py
(c) RIKEN 2015. All rights reserved.
Author: Keitaro Yamashita
This software is released under the new BSD License; see LICENSE.
"""
import numpy
from xds import get_xdsinp_keyword
from util import safe_float
class XPARM:
def __init__(self, xparm_file=None):
if xparm_file is not None:
... | bsd-3-clause |
hottwaj/django | tests/validation/test_error_messages.py | 398 | 3642 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from django.core.exceptions import ValidationError
from django.db import models
class ValidationMessagesTest(TestCase):
def _test_validation_messages(self, field, value, expected):
with self.assertRaises(Val... | bsd-3-clause |
gf53520/kafka | tests/kafkatest/services/trogdor/process_stop_fault_spec.py | 17 | 1899 | # 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 ... | apache-2.0 |
Carreau/pytest | _pytest/config.py | 1 | 40525 | """ command line options, ini-file and conftest.py processing. """
import argparse
import shlex
import traceback
import types
import warnings
import py
# DON't import pytest here because it causes import cycle troubles
import sys, os
import _pytest.hookspec # the extension point definitions
from pluggy import PluginM... | mit |
ifarup/website | imt6131/code/12_anisotropic_diff/12_anisotropic_diff.py | 1 | 1125 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
im = plt.imread('lena.png')
im = np.sum(im, 2) / 3.
dt = .25
eps = 1e-5
kappa = 1e4
gx, gy = np.gradient(im)
gnormsq = gx**2 + gy**2
gnorm = np.sqrt(gnormsq)
v1x = np.zeros(np.shape(gx))
v1y = np.zeros(np.shape(gx))
v2x = np.zeros(np.shape(g... | gpl-3.0 |
easycoin-core/Easycoin | qa/rpc-tests/rest.py | 45 | 15163 | #!/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 REST interface
#
from test_framework.test_framework import BitcoinTestFramework
from test_fram... | mit |
andymckay/zamboni | mkt/api/renderers.py | 6 | 2039 | import json
from django.http.multipartparser import parse_header
from rest_framework.negotiation import DefaultContentNegotiation
from rest_framework.renderers import JSONRenderer
class SuccinctJSONRenderer(JSONRenderer):
"""
JSONRenderer subclass that strips spaces from the output.
"""
def render(s... | bsd-3-clause |
amitdeutsch/oppia | core/domain/obj_services.py | 7 | 2448 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
quizlet/grpc | examples/python/helloworld/helloworld_pb2_grpc.py | 85 | 1378 | import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
import helloworld_pb2 as helloworld__pb2
class GreeterStub(object):
"""The greeting service definition.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel... | apache-2.0 |
akiss77/servo | tests/wpt/css-tests/tools/pytest/_pytest/unittest.py | 176 | 7094 | """ discovery and running of std-library "unittest" style tests. """
from __future__ import absolute_import
import sys
import traceback
import pytest
# for transfering markers
import _pytest._code
from _pytest.python import transfer_markers
from _pytest.skipping import MarkEvaluator
def pytest_pycollect_makeitem(co... | mpl-2.0 |
Jeff-Tian/mybnb | Python27/Lib/test/test_cookie.py | 2 | 7277 | # Simple test suite for Cookie.py
from test.test_support import run_unittest, run_doctest, check_warnings
import unittest
import Cookie
import pickle
class CookieTests(unittest.TestCase):
# Currently this only tests SimpleCookie
def test_basic(self):
cases = [
{ 'data': 'chips... | apache-2.0 |
cpe/VAMDC-VALD | nodes/ExampleNode/mapping_examplenode.py | 12 | 11800 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The config file for importing the example_data dataset into
ExampleNode.
Go to http://vamdc.tmy.se/doc/importing.html
for understanding what happens below.
Use this file this way (first edit base path) :
$ cd ../imptools
$ python run_rewrite.py ../nodes/ExampleNode/... | gpl-3.0 |
Dik1s/volatility | volatility/plugins/imagecopy.py | 44 | 3210 | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# 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 op... | gpl-2.0 |
danielcbit/vdt | src/propagation/bindings/modulegen__gcc_ILP32.py | 6 | 181016 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
shaohung001/tornado | tornado/auth.py | 68 | 46108 | #!/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... | apache-2.0 |
colinligertwood/odoo | addons/account_check_writing/account.py | 379 | 2032 | # -*- 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 |
rmboggs/django | tests/file_storage/tests.py | 35 | 30366 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import errno
import os
import shutil
import sys
import tempfile
import threading
import time
import unittest
from datetime import datetime, timedelta
from django.core.cache import cache
from django.core.exceptions import SuspiciousFileOperation, Suspicio... | bsd-3-clause |
SomethingExplosive/android_external_chromium_org | win8/util/check_sdk_patch.py | 68 | 1559 | #!/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.
"""Script to check that the Windows 8 SDK has been appropriately patched so that
it can be used with VS 2010.
In practice, t... | bsd-3-clause |
tobegit3hub/glance_docker | glance/tests/functional/v2/test_tasks.py | 9 | 4767 | # Copyright 2013 IBM Corp.
# All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
timoc/autokey | src/test/configurationmanagertest.py | 53 | 1681 | import unittest
import lib.configurationmanager as conf
from lib.phrase import *
CONFIG_FILE = "../../config/abbr.ini"
class LegacyImporterTest(unittest.TestCase):
def setUp(self):
self.importer = conf.LegacyImporter()
self.importer.load_config(CONFIG_FILE)
def testGlobalSetting... | gpl-3.0 |
ahb0327/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/backends/postgis/adapter.py | 311 | 1165 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom):
"Initializes on the geometry."
# Getting the WKB (in string form, to allow easy pickling ... | apache-2.0 |
miguelparaiso/PracticaOdoo | addons/google_calendar/controllers/main.py | 420 | 3002 | import openerp.addons.web.http as http
from openerp.addons.web.http import request
class google_calendar_controller(http.Controller):
@http.route('/google_calendar/sync_data', type='json', auth='user')
def sync_data(self, arch, fields, model, **kw):
"""
This route/function is called when ... | agpl-3.0 |
tahazayed/cookpadscraper | cookpad/pipelines.py | 1 | 2709 | # -*- coding: utf-8 -*-
import json
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
from scrapy.conf import settings
from scrapy.exceptions import DropItem
from cookpad.items import R... | mit |
bitcoinknots/bitcoin | test/functional/data/invalid_txs.py | 5 | 7093 | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Templates for constructing various sorts of invalid transactions.
These templates (or an iterator ove... | mit |
dan-and/linux-sunxi | modules/wifi/ar6302/AR6K_SDK_ISC.build_3.1_RC.329/host/tools/athbtfilter/bluez/testscripts/bthstereoheadset.py | 185 | 1575 | #!/usr/bin/python
import dbus
import os
import sys
def printusage():
print 'bthstereoheadset.py <options>'
print ' create - create a stereo headset'
print ' start - connect sink'
print ' stop - disconnect sink'
return
headsetAddress = os.getenv("BTSTEREO_HEADSET")
print 'BT Stereo Headset Is : =>... | gpl-2.0 |
40223143/cda-w15 | static/Brython3.1.3-20150514-095342/Lib/site-packages/pygame/base.py | 603 | 4652 | #!/usr/bin/env python
## https://bitbucket.org/pygame/pygame/raw/2383b8ab0e2273bc83c545ab9c18fee1f3459c64/pygame/base.py
'''Pygame core routines
Contains the core routines that are used by the rest of the
pygame modules. Its routines are merged directly into the pygame
namespace. This mainly includes the auto-initia... | agpl-3.0 |
ivan-fedorov/intellij-community | python/helpers/pydev/_pydev_imps/_pydev_pkgutil_old.py | 234 | 20346 | """Utilities to support packages."""
# NOTE: This module must remain compatible with Python 2.3, as it is shared
# by setuptools for distribution with Python 2.3 and up.
import os
import sys
import imp
import os.path
from types import ModuleType
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_l... | apache-2.0 |
fast90/youtube-dl | youtube_dl/extractor/metacritic.py | 14 | 2670 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
)
class MetacriticIE(InfoExtractor):
_VALID_URL = r'https?://www\.metacritic\.com/.+?/trailers/(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.metacritic.com/game/playstatio... | unlicense |
mpharrigan/msmbuilder | scripts/CalculateImpliedTimescales.py | 2 | 3945 | #!/usr/bin/env python
# This file is part of MSMBuilder.
#
# Copyright 2011 Stanford University
#
# MSMBuilder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your opt... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.