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
admiralspark/NetSpark-Scripts
Example_Scripts/Cisco/auditQOS.py
1
2040
#Global imports from netmiko import ConnectHandler from datetime import datetime import csv, os.path #Local imports import credentials # Begin timing the script start_time = datetime.now() # Define the primary function (to be moved to a separate module some day...) def nc(username, password, secret, customer): wi...
gpl-3.0
TheWardoctor/Wardoctors-repo
script.stargate.guide/resources/playwith/playwith.py
1
2975
import sys import xbmc,xbmcaddon,xbmcvfs import sqlite3 from subprocess import Popen import datetime,time # from vpnapi import VPNAPI channel = sys.argv[1] start = sys.argv[2] ADDON = xbmcaddon.Addon(id='script.stargate.guide') def adapt_datetime(ts): # http://docs.python.org/2/library/sqlite3.html#registering-a...
apache-2.0
Kazade/NeHe-Website
google_appengine/lib/django_1_2/tests/regressiontests/get_or_create_regress/tests.py
88
2540
from django.test import TestCase from models import Author, Publisher class GetOrCreateTests(TestCase): def test_related(self): p = Publisher.objects.create(name="Acme Publishing") # Create a book through the publisher. book, created = p.books.get_or_create(name="The Book of Ed & Fred") ...
bsd-3-clause
partofthething/home-assistant
homeassistant/components/dweet/sensor.py
21
3239
"""Support for showing values from Dweet.io.""" from datetime import timedelta import json import logging import dweepy import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_DEVICE, CONF_NAME, CONF_UNIT_OF_MEASUREMENT, CONF_VALUE_TE...
mit
pk-sam/crosswalk-test-suite
usecase/usecase-wrt-auto-tests/samples/ApkBuildAnyLocation/absolutePath.py
2
2850
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
capocchi/DEVSimPy-plugin-SIG-viewer
ExtendedFrame.py
1
9957
# -*- coding: utf-8 -*- #import wxversion #wxversion.select('2.8.11') import wx import os import sys import wx.combo import wx.lib.agw.foldpanelbar as fpb _ = wx.GetTranslation def GetCollapsedIconData(): return \ '\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\ \x00\x00\x00\x1f\x...
lgpl-3.0
vaygr/ansible
lib/ansible/utils/module_docs_fragments/ipa.py
27
2627
# Copyright (c) 2017-18, Ansible Project # Copyright (c) 2017-18, Abhijeet Kasurde (akasurde@redhat.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) class ModuleDocFragment(object): # Parameters for FreeIPA/IPA modules DOCUMENTATION = ''' options: ipa_port: ...
gpl-3.0
openhatch/oh-mainline
vendor/packages/Django/django/contrib/gis/tests/inspectapp/tests.py
134
5128
from __future__ import absolute_import import os from django.db import connections from django.test import TestCase from django.contrib.gis.gdal import Driver from django.contrib.gis.geometry.test_data import TEST_DATA from django.contrib.gis.utils.ogrinspect import ogrinspect from .models import AllOGRFields clas...
agpl-3.0
phimpme/generator
Phimpme/site-packages/requests/packages/charade/utf8prober.py
205
2728
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. ...
gpl-3.0
ajoaoff/django
tests/generic_views/test_base.py
269
19854
from __future__ import unicode_literals import time import unittest from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import resolve from django.http import HttpResponse from django.test import RequestFactory, SimpleTestCase, override_settings from django.test.utils import require_...
bsd-3-clause
malisal/bfdpie
tests/bfdpie_test.py
1
14822
import unittest from bfdpie import * class Test(unittest.TestCase): def test_large_vma(self): b = Binary() # 32-bit limit test dis1 = b.disassemble(b"\x90", ARCH_I686, 0x80000000) dis2 = b.disassemble(b"\x90", ARCH_X86_64, 0x80000000) self.assertTrue(dis1[0].vma >= 0) self.asse...
mit
dingdong-io/brackets.beautify.io
thirdparty/js-beautify/python/cssbeautifier/tests/test.py
1
20342
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import cssbeautifier class CSSBeautifierTest(unittest.TestCase): def resetOptions(self): false = False true = True self.options = cssbeautifier.default_options() self.options.indent_size = 1 self.options.indent...
mit
bcheung92/Paperproject
gem5/tests/configs/memtest-filter.py
23
3208
# Copyright (c) 2006-2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this ...
mit
thiagoss/splitencoder
splitencoder/splitter.py
1
4258
#!/usr/bin/env python # # splitencoder # # Copyright (C) 2015 Samsung Electronics. All rights reserved. # Author: Thiago Santos <thiagoss@osg.samsung.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free ...
lgpl-2.1
aio-libs/aiohttp_session
tests/test_nacl_storage.py
1
9303
import asyncio import json import time from typing import Any, Dict, MutableMapping, Optional, cast import nacl.secret import nacl.utils import pytest from aiohttp import web from aiohttp.test_utils import TestClient from aiohttp.web_middlewares import _Handler from nacl.encoding import Base64Encoder from aiohttp_ses...
apache-2.0
deanhiller/databus
webapp/play1.3.x/python/Lib/nturl2path.py
5
2302
"""Convert a NT pathname to a file URL and vice versa.""" def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. # ///C|/foo/bar/spam.foo # becomes # C:\foo\bar\spam.foo import stri...
mpl-2.0
SDX2000/hotwire
hotwire/builtins/json.py
1
2675
# This file is part of the Hotwire Shell project API. # Copyright (C) 2007 Colin Walters <walters@verbum.org> # 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, includin...
gpl-2.0
paineliu/tflearn
helen.py
1
1084
import os from PIL import Image img_path = '/home/palm/deep/helen/train' lab_path = '/home/palm/deep/helen/annotation' filename = '/home/palm/deep/helen/trainnames.txt' f = open(filename) index = 1 for each in f: each = each.strip() img_file = os.path.join(img_path, each + '.jpg') img = Image.open(img_fi...
apache-2.0
douglask3/allocationModules
runGday/DUKE/simulations/duke_spinup_to_equilibrium.py
1
24694
#!/usr/bin/env python """ Duke Simulation for NCEAS FACE experiment Site History: ------------- * Pre-1850 temperate broadleaved deciduous forest * Harvest forest. * Grassland from 1850-1982, mowed (+/- annually - DO NOT SIMULATE MOWING :P) * burnt prior to planting * At start of experiment aboveground biomass 5.5-1...
gpl-2.0
odoousers2014/odoo
addons/account/report/common_report_header.py
8
6346
# -*- 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
peterlauri/django
django/contrib/gis/forms/widgets.py
14
3351
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Widget from django.template import loader from django.utils import six, translation logger = log...
bsd-3-clause
nathanial/lettuce
tests/integration/lib/Django-1.3/django/contrib/admin/templatetags/log.py
310
2270
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
gpl-3.0
safwanrahman/mozillians
vendor-local/lib/python/markdown/inlinepatterns.py
11
17252
""" INLINE PATTERNS ============================================================================= Inline patterns such as *emphasis* are handled by means of auxiliary objects, one per pattern. Pattern objects must be instances of classes that extend markdown.Pattern. Each pattern object uses a single regular ...
bsd-3-clause
bponsler/pysiriproxy
pysiriproxy/config/plugins/resetPlugin.py
1
1672
# Copyright 2012 Brett Ponsler # This file is part of pysiriproxy. # # pysiriproxy 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
wxgeo/geophar
wxgeometrie/sympy/functions/special/tests/test_mathieu.py
85
1080
from sympy import (sqrt, sin, cos, diff, conjugate, mathieus, mathieuc, mathieusprime, mathieucprime) from sympy.abc import a, q, z def test_mathieus(): assert isinstance(mathieus(a, q, z), mathieus) assert mathieus(a, 0, z) == sin(sqrt(a)*z) assert conjugate(mathieus(a, q, z)) == math...
gpl-2.0
nawawi/poedit
deps/boost/tools/build/test/collect_debug_info.py
51
8397
#!/usr/bin/python # Copyright 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # Temporarily enabled dummy test that always fails and is used to collect # extra debugging information from Boost Build...
mit
seem-sky/kbengine
kbe/res/scripts/common/Lib/site-packages/setuptools/command/develop.py
477
6447
from setuptools.command.easy_install import easy_install from distutils.util import convert_path, subst_vars from pkg_resources import Distribution, PathMetadata, normalize_path from distutils import log from distutils.errors import DistutilsError, DistutilsOptionError import os, sys, setuptools, glob class develop(ea...
lgpl-3.0
arximboldi/jagsat
lib/tf/gfx/widget/basic.py
1
14927
# # Copyright (C) 2009 TribleFlame Oy # # This file is part of TF. # # TF 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
ToonTownInfiniteRepo/ToontownInfinite
toontown/toon/InventoryNew.py
1
56688
from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toonbase.ToontownBattleGlobals import * import InventoryBase from toontown.toonbase import TTLocalizer from toontown.quest import BlinkingArrows from direct.interval.IntervalGlobal import * from direct.directnotify import DirectNotifyGlo...
mit
TheWardoctor/Wardoctors-repo
script.module.schism.common/lib/requests/packages/chardet/mbcssm.py
1783
19590
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
apache-2.0
athkishore/vgr
tests/test_user_model.py
16
5437
import unittest import time from datetime import datetime from app import create_app, db from app.models import User, AnonymousUser, Role, Permission class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self...
mit
yasirkhan380/Tutorials
notebooks/fig_code/svm_gui.py
47
11549
""" ========== Libsvm GUI ========== A simple graphical frontend for Libsvm mainly intended for didactic purposes. You can create data points by point and click and visualize the decision region induced by different kernels and parameter settings. To create positive examples click the left mouse button; to create neg...
bsd-3-clause
jlelli/sched-deadline
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (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. import os import sys sys.path.append(os.envir...
gpl-2.0
GustavoHennig/ansible
lib/ansible/utils/module_docs_fragments/cloudstack.py
175
2631
# -*- coding: utf-8 -*- # Copyright (c) 2015 René Moser <mail@renemoser.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
thiagopio/vendas_healthcheck
vendas/healthcheck/models.py
1
3084
# -*- coding: utf-8 -*- from django.db import models import requests import re class Project(models.Model): name = models.CharField(max_length=50) environment = models.CharField(max_length=10, choices=(('DEV', 'DEV'), ('QA', 'QA'), ('PROD', 'PROD'))) related_project = models.ManyToManyField('Project', bla...
gpl-2.0
fufufanatic/pyNES
pynes/tests/guide_test.py
28
5904
# -*- coding: utf-8 -*- import unittest from pynes.compiler import lexical, syntax ''' Those tests are based on examples from: http://nesdev.parodius.com/6502guid.txt ''' class GuideTest(unittest.TestCase): def test_example_16_bit_subtraction_routine(self): ex_2 = ''' SEC ;clear the...
bsd-3-clause
maxlikely/scikit-learn
sklearn/ensemble/tests/test_partial_dependence.py
44
7031
""" Testing for the partial dependence module. """ import numpy as np from numpy.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.utils.testing import if_matplotlib from sklearn.ensemble.partial_dependence import partial_dependence from sklearn.ensemble.partial_dependence...
bsd-3-clause
hrjn/scikit-learn
examples/feature_selection/plot_f_test_vs_mi.py
75
1647
""" =========================================== Comparison of F-test and mutual information =========================================== This example illustrates the differences between univariate F-test statistics and mutual information. We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the targ...
bsd-3-clause
yufengg/tensorflow
tensorflow/python/framework/framework_lib.py
15
4208
# Copyright 2015 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
fbidu/namebench
nb_third_party/dns/e164.py
248
3063
# Copyright (C) 2006, 2007, 2009 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 "AS I...
apache-2.0
Sylrob434/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/newgrounds.py
19
1277
from __future__ import unicode_literals import json import re from .common import InfoExtractor class NewgroundsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?newgrounds\.com/audio/listen/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.newgrounds.com/audio/listen/549479', 'md5': 'fe6033d2...
gpl-3.0
etherkit/OpenBeacon2
client/linux-arm/venv/lib/python3.6/site-packages/serial/tools/list_ports_linux.py
12
4427
#!/usr/bin/env python # # This is a module that gathers a list of serial ports including details on # GNU/Linux systems. # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C) 2011-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import glob import os from seria...
gpl-3.0
ojengwa/odoo
addons/crm/report/crm_phonecall_report.py
309
3982
# -*- 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
PeterWangIntel/chromium-crosswalk
third_party/libxml/src/check-relaxng-test-suite2.py
343
10578
#!/usr/bin/python import sys import time import os import string import StringIO sys.path.insert(0, "python") import libxml2 # Memory debug specific libxml2.debugMemory(1) debug = 0 quiet = 1 # # the testsuite description # CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml") LOG="check-relaxng-...
bsd-3-clause
jodal/comics
comics/core/migrations/0001_initial.py
1
5776
import django.core.files.storage from django.db import migrations, models import comics.core.models class Migration(migrations.Migration): dependencies = [] operations = [ migrations.CreateModel( name="Comic", fields=[ ( "id", ...
agpl-3.0
pbrod/scipy
scipy/interpolate/tests/test_ndgriddata.py
50
7259
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_equal, assert_array_equal, assert_allclose, run_module_suite, assert_raises) from scipy.interpolate import griddata, NearestNDInterpolator class TestGriddata(object): def test_fill_value...
bsd-3-clause
dcroc16/skunk_works
google_appengine/lib/yaml-3.10/yaml/resolver.py
474
8972
__all__ = ['BaseResolver', 'Resolver'] from error import * from nodes import * import re class ResolverError(YAMLError): pass class BaseResolver(object): DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map' ...
mit
matteoalessiocarrara/lib-figafind
src/filter_rules.py
2
2575
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016 Matteo Alessio Carrara <sw.matteoac@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Lice...
gpl-3.0
jjscarafia/odoo
addons/hr_recruitment/wizard/__init__.py
381
1095
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-Today OpenERP (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
2013Commons/HUE-SHARK
build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/db/models/fields/related.py
6
54548
from django.conf import settings from django.db import connection, router, transaction from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist) from dja...
apache-2.0
ndn/somacube
python/somacube.py
1
1941
#!/usr/bin/python import sys import argparse from threading import Thread import problems from solver import Solver if __name__ != "__main__": sys.exit() parser = argparse.ArgumentParser(description="Kloetze algorithm.") parser.add_argument("-p", "--problem") parser.add_argument("-a", "--all", action="store_tru...
mit
RO-ny9/python-for-android
python-modules/twisted/twisted/internet/_sslverify.py
49
24224
# -*- test-case-name: twisted.test.test_sslverify -*- # Copyright (c) 2005 Divmod, Inc. # Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. # Copyright (c) 2005-2008 Twisted Matrix Laboratories. import itertools from OpenSSL import SSL, crypto from twisted.python import reflect, util from twi...
apache-2.0
bq-dev/android_kernel_bq_msm8976
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
impl/rbppc-linux
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
codilime/contrail-controller
src/config/svc-monitor/svc_monitor/tests/test_virtual_machine_manager.py
2
12304
import mock import unittest from vnc_api.vnc_api import * from svc_monitor.virtual_machine_manager import VirtualMachineManager from svc_monitor.config_db import * import test_common_utils as test_utils class VirtualMachineManagerTest(unittest.TestCase): def setUp(self): VirtualMachineSM._cassandra = mock....
apache-2.0
david-ragazzi/nupic
examples/network/temporal_anomaly_network_demo.py
8
3405
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
SalesforceEng/Providence
tests/plugins/__init__.py
8
1491
''' Copyright (c) 2015, Salesforce.com, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the foll...
bsd-3-clause
ashang/calibre
src/calibre/gui2/tweak_book/function_replace.py
14
13782
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import re, io, weakref, sys from cStringIO import StringIO from PyQt5.Qt im...
gpl-3.0
kimkulling/osre
contrib/gmock-1.7.0/gtest/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
mit
prohaska7/ft-index
scripts/run.stress-tests.py
32
33186
#!/usr/bin/env python """ A script for running our stress tests repeatedly to see if any fail. Runs a list of stress tests in parallel, reporting passes and collecting failure scenarios until killed. Runs with different table sizes, cachetable sizes, and numbers of threads. Suitable for running on a dev branch, or a...
gpl-2.0
undefinedv/Jingubang
sqlmap/lib/core/optiondict.py
1
13064
#!/usr/bin/env python """ Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ optDict = { # Format: # Family: { "parameter name": "parameter datatype" }, # Or: # Family: { "parameter name"...
gpl-3.0
smn/onadata
onadata/apps/api/migrations/0001_initial.py
20
6989
# -*- 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): # Adding model 'OrganizationProfile' db.create_table('api_organizationprofile', ( ('userprofile_...
bsd-2-clause
kambysese/mne-python
mne/preprocessing/nirs/tests/test_temporal_derivative_distribution_repair.py
12
1068
# Authors: Robert Luke <mail@robertluke.net> # # License: BSD (3-clause) import os.path as op import pytest import numpy as np from mne.datasets.testing import data_path from mne.io import read_raw_nirx from mne.preprocessing.nirs import optical_density, tddr from mne.datasets import testing fname_nirx_15_2 = op.j...
bsd-3-clause
vampirekiss/wechat_message
tests/__init__.py
2
1628
# -*- coding: utf-8 -*- from tornado.testing import IOLoop, AsyncHTTPTestCase as BaseAsyncHTTPTestCase from tornado.gen import coroutine, Return from app.application import Application from urllib import urlencode import mock class TestCaseMixin(object): def get_new_ioloop(self): return IOLoop.instance(...
gpl-2.0
luiseduardohdbackup/odoo
addons/product_visible_discount/product_visible_discount.py
165
5466
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
scorphus/politicos
politicos/migrations/versions/585774625ec2_create_mandate_events_table.py
1
1328
"""create mandate events table Revision ID: 585774625ec2 Revises: 2cbbef3d8e8f Create Date: 2015-07-06 00:58:44.470013 """ # revision identifiers, used by Alembic. revision = '585774625ec2' down_revision = '2cbbef3d8e8f' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( 'm...
agpl-3.0
orekyuu/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/gdal/geomtype.py
404
2967
from django.contrib.gis.gdal.error import OGRException #### OGRGeomType #### class OGRGeomType(object): "Encapulates OGR Geometry Types." wkb25bit = -2147483648 # Dictionary of acceptable OGRwkbGeometryType s and their string names. _types = {0 : 'Unknown', 1 : 'Point', 2 ...
apache-2.0
tima/ansible
lib/ansible/modules/cloud/docker/docker_secret.py
39
8291
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # 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': ['prev...
gpl-3.0
chripede/django-js-reverse
django_js_reverse/management/commands/collectstatic_js_reverse.py
2
1127
# -*- coding: utf-8 -*- import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.base import ContentFile from django.core.files.storage import FileSystemStorage from django.core.management.base import BaseCommand from django_js_reverse.views ...
mit
ThQ/luigi
test/contrib/pig_test.py
34
6792
# -*- 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
hofschroeer/gnuradio
docs/doxygen/doxyxml/__init__.py
7
2515
# # Copyright 2010 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 version. # #...
gpl-3.0
Crystalnix/bitpop-omaha
run_unit_tests.py
65
3468
#!/usr/bin/python2.4 # # Copyright 2010 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
borysiasty/inasafe
safe/impact_functions/generic/classified_polygon_people/metadata_definitions.py
1
4522
# coding=utf-8 """InaSAFE Disaster risk tool by Australian Aid - Classified Polygon on Land Cover Metadata Definitions. Contact : ole.moller.nielsen@gmail.com .. 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 t...
gpl-3.0
kotejante/python-moodle
examples/get_user.py
1
1498
# -*- encoding: utf-8 -*- ############################################################################## # # Moodle Webservice # Copyright (c) 2011 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Raimon Esteve <resteve@zikzakmedia.com> # Jesus Martín <j...
agpl-3.0
luhanhan/horizon
openstack_dashboard/dashboards/project/data_processing/clusters/tests.py
26
2651
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
jcanizales/grpc
src/python/grpcio_tests/tests/unit/framework/common/__init__.py
1496
1530
# Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
xombiemp/CouchPotatoServer
libs/dateutil/zoneinfo/__init__.py
144
2773
# -*- coding: utf-8 -*- """ Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard Python datetime module. """ from dateutil.tz import tzfile from tarfile import TarFile import os __author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>" __license__ = "Simplifie...
gpl-3.0
artemh/asuswrt-merlin
release/src/router/libxml2/python/tests/xpathret.py
87
1312
#!/usr/bin/python -u import sys import libxml2 #memory debug specific libxml2.debugMemory(1) # # A document hosting the nodes returned from the extension function # mydoc = libxml2.newDoc("1.0") def foo(ctx, str): global mydoc # # test returning a node set works as expected # parent = mydoc.newD...
gpl-2.0
kushalbhola/MyStuff
Practice/PythonApplication/env/Lib/site-packages/pandas/tests/indexes/multi/test_contains.py
2
3306
import numpy as np import pytest from pandas.compat import PYPY import pandas as pd from pandas import MultiIndex import pandas.util.testing as tm def test_contains_top_level(): midx = MultiIndex.from_product([["A", "B"], [1, 2]]) assert "A" in midx assert "A" not in midx._engine def test_contains_wit...
apache-2.0
slonik-az/cython
tests/run/withstat_py.py
29
4281
import sys def typename(t): name = type(t).__name__ if sys.version_info < (2,5): if name == 'classobj' and issubclass(t, MyException): name = 'type' elif name == 'instance' and isinstance(t, MyException): name = 'MyException' return "<type '%s'>" % name class MyEx...
apache-2.0
darkdukey/sdkbox-facebook-sample-v2
tools/cocos2d-console/console/cocos2d.py
4
2601
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos2d-console: command line tool manager for cocos2d # # Author: Ricardo Quesada # Copyright 2013 (C) Zynga, Inc # # License: MIT # ---------------------------------------------------------------------------- ''' Comman...
mit
mendersoftware/meta-mender-qemu
scripts/list-all-org-repos.py
1
1955
#!/usr/bin/python3 import argparse import json import re import subprocess import sys parser = argparse.ArgumentParser() parser.add_argument( "--token", help="Github Personal Access token, get it from https://github.com/settings/tokens.", ) parser.add_argument( "--org", default="mendersoftware", h...
apache-2.0
subho007/androguard
androguard/session.py
14
4216
import hashlib import collections from androguard.core import androconf from androguard.core.bytecodes.apk import * from androguard.core.bytecodes.dvm import * from androguard.core.analysis.analysis import * from androguard.decompiler.decompiler import * from androguard.misc import save_session, load_session class Se...
apache-2.0
vmthunder/nova
nova/api/openstack/compute/contrib/server_password.py
17
2930
# Copyright (c) 2012 Nebula, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
M4rtinK/anaconda
tests/nosetests/regex_tests/username_test.py
3
3827
#!/usr/bin/python3 # vim:set fileencoding=utf-8 # # Copyright (C) 2010-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 version. # Th...
gpl-2.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/numpy/polynomial/tests/test_legendre.py
58
18006
"""Tests for legendre module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.legendre as leg from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_mod...
mit
darjeeling/django
tests/m2m_recursive/models.py
90
1029
""" Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can als...
bsd-3-clause
blacklin/kbengine
kbe/src/lib/python/Lib/lib2to3/fixes/fix_sys_exc.py
203
1034
"""Fixer for sys.exc_{type, value, traceback} sys.exc_type -> sys.exc_info()[0] sys.exc_value -> sys.exc_info()[1] sys.exc_traceback -> sys.exc_info()[2] """ # By Jeff Balogh and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms clas...
lgpl-3.0
kurtrwall/wagtail
wagtail/wagtailsearch/tests/test_elasticsearch_backend.py
2
41987
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime import json import os import time import unittest import warnings import mock from django.core import management from django.db.models import Q from django.test import TestCase from django.utils.six import StringIO from e...
bsd-3-clause
siosio/intellij-community
python/helpers/py3only/docutils/core.py
44
29431
# $Id: core.py 7466 2012-06-25 14:56:51Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Calling the ``publish_*`` convenience functions (or instantiating a `Publisher` object) with component names will result in default behavior. For custom beha...
apache-2.0
suyashphadtare/vestasi-update-erp
erpnext/patches/v4_0/global_defaults_to_system_settings.py
39
1360
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from collections import Counter from frappe.core.doctype.user.user import STANDARD_USERS def execute(): frappe.reload_doc("core", "doctype", "system_settings")...
agpl-3.0
vityagi/azure-linux-extensions
DSC/test/env.py
8
1260
#!/usr/bin/env python # #CustomScript extension # # Copyright 2014 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 # #...
apache-2.0
Nikea/VisTrails
examples/vtk_examples/Annotation/cubeAxes.py
15
3797
#!/usr/bin/env python # This example demonstrates the use of vtkCubeAxesActor2D to indicate # the position in space that the camera is currently viewing. The # vtkCubeAxesActor2D draws axes on the bounding box of the data set # and labels the axes with x-y-z coordinates. import vtk from vtk.util.misc import vtkGetDa...
bsd-3-clause
sasshka/x264
tools/digress/errors.py
144
1065
""" Digress errors. """ class DigressError(Exception): """ Digress error base class. """ class NoSuchTestError(DigressError): """ Raised when no such test exists. """ class DisabledTestError(DigressError): """ Test is disabled. """ class SkippedTestError(DigressError): """ ...
gpl-2.0
Ensighten/ansible
test/units/playbook/test_playbook.py
290
2230
# (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
stdweird/aquilon
lib/python2.6/aquilon/aqdb/shell.py
2
3101
#!/usr/bin/env python2.6 # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor # # 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
pscedu/slash2
utils/ssh.py
2
4852
import paramiko, getpass, logging import os, re from time import sleep log = logging.getLogger("slash2") class SSH(object): """Helpful SSH abstractions for executing remote applications.""" def __init__(self, user, host, password=None, port=22): """Initialize SSH object. Args: user: username....
gpl-2.0
marctc/django
tests/utils_tests/test_crypto.py
447
4581
from __future__ import unicode_literals import binascii import hashlib import unittest from django.utils.crypto import constant_time_compare, pbkdf2 class TestUtilsCryptoMisc(unittest.TestCase): def test_constant_time_compare(self): # It's hard to test for constant time, just test the result. s...
bsd-3-clause
ChawalitK/odoo
doc/_extensions/odoo/switcher.py
262
1500
from docutils import nodes, utils from docutils.parsers.rst import Directive from pygments.lexers import get_lexer_by_name def setup(app): app.add_directive('switcher', SwitcherDirective) app.add_directive('case', CaseDirective) class SwitcherDirective(Directive): has_content = True def run(self): ...
gpl-3.0
dsajkl/123
scripts/metrics/publish.py
69
1310
""" Publish Build Stats. """ import os import subprocess from dogapi import dog_http_api from coverage_metrics import CoverageMetrics class PublishStats(object): """ Publish stats to DataDog. """ def __init__(self, api_key): dog_http_api.api_key = api_key @staticmethod def report_met...
agpl-3.0