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
gg7/sentry
src/sentry/interfaces/base.py
13
3049
from __future__ import absolute_import from django.conf import settings from django.utils.html import escape from django.utils.translation import ugettext as _ from sentry.utils.imports import import_string def get_interface(name): try: import_path = settings.SENTRY_INTERFACES[name] except KeyError:...
bsd-3-clause
nirmeshk/oh-mainline
mysite/profile/migrations/0023_asheesh_add_person_tag_link_person_column.py
17
8391
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later v...
agpl-3.0
beckdaniel/metacritic-crawler
metacritic_crawler/spiders/game_spider.py
1
6094
import scrapy from scrapy.contrib.spiders import CrawlSpider, Rule from metacritic_crawler.items import GameItem, ReviewItem import sys class GameSpider(scrapy.Spider): name = "game_spider" allowed_domains = ["www.metacritic.com"] start_urls = ["http://www.metacritic.com/browse/games/release-date/availab...
gpl-2.0
atodorov/anaconda
pyanaconda/core/dbus.py
1
2677
# # DBus connections # # Copyright (C) 2019 Red Hat, Inc. All rights reserved. # # 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 late...
gpl-2.0
sivaprakashniet/push_pull
p2p/lib/python2.7/site-packages/celery/utils/debug.py
3
3561
# -*- coding: utf-8 -*- """ celery.utils.debug ~~~~~~~~~~~~~~~~~~ Utilities for debugging memory usage. """ from __future__ import absolute_import, print_function import os from contextlib import contextmanager from functools import partial from celery.five import range from celery.platforms import sig...
bsd-3-clause
dlstadther/luigi
luigi/contrib/bigquery.py
4
28334
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter 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 ...
apache-2.0
cntnboys/410Lab6
build/django/tests/expressions/tests.py
4
10566
from __future__ import unicode_literals from copy import deepcopy from django.core.exceptions import FieldError from django.db.models import F from django.db import transaction from django.test import TestCase, skipIfDBFeature from django.utils import six from .models import Company, Employee class ExpressionsTest...
apache-2.0
COHRINT/cops_and_robots
src/cops_and_robots/display_tools/display.py
1
10731
#!/usr/bin/env python """Manages all display elements (figures, axes, etc.) """ import os import logging import numpy as np import matplotlib matplotlib.use('Qt4Agg') import matplotlib.pyplot as plt from cops_and_robots.fusion.gaussian_mixture import GaussianMixture from cops_and_robots.display_tools.human_interface i...
apache-2.0
qma/pants
src/python/pants/invalidation/cache_manager.py
3
14019
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import shu...
apache-2.0
f2nd/yandex-tank
yandextank/plugins/Telegraf/reader.py
1
3778
""" Monitoring stdout pipe reader. Read chunks from stdout and produce data frames """ import logging import queue import json from ..Telegraf.decoder import decoder logger = logging.getLogger(__name__) class MonitoringReader(object): def __init__(self, source): self.buffer = [] self.source = so...
lgpl-2.1
kybriainfotech/iSocioCRM
addons/procurement/wizard/__init__.py
374
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...
agpl-3.0
JCA-Developpement/Odoo
addons/portal_project/project.py
103
1769
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
RBruceElder/python-music-gen
music/bassline2.py
4
2179
import sys sys.path.append("../") from midiutil.TrackGen import LoopingArray from midiutil.MidiGenerator import MidiGenerator midiGenerator = MidiGenerator(tempo=90) scale = reduce(lambda x,y:x+y,[[y+(12*x)+36 for y in [0,7,14,8,10,7,8]] for x in range (2)]) pos = 0 for base in [10,9,8,7,6,5,4,3,2,1]: #...
gpl-3.0
Anfauglith/iop-hd
test/functional/wallet-hd.py
2
4356
#!/usr/bin/env python3 # Copyright (c) 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 Hierarchical Deterministic wallet function.""" from test_framework.test_framework import IoPTestFramew...
mit
sbbic/core
sfx2/qa/python/check_sidebar.py
3
4301
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # ...
gpl-3.0
skoslowski/gnuradio
gnuradio-runtime/python/gnuradio/eng_option.py
3
1059
# # Copyright 2004 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # '''Add support for engineering notation to optparse.OptionParser''' from __future__ import absolute_import from __future__ import unicode_literals from copy import copy from optparse ...
gpl-3.0
betoesquivel/fil2014
build/django/django/contrib/staticfiles/management/commands/runserver.py
243
1343
from optparse import make_option from django.conf import settings from django.core.management.commands.runserver import Command as RunserverCommand from django.contrib.staticfiles.handlers import StaticFilesHandler class Command(RunserverCommand): option_list = RunserverCommand.option_list + ( make_optio...
mit
py-geek/City-Air
venv/lib/python2.7/site-packages/django/conf/locale/hu/formats.py
118
1118
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y. F j.' TIME_FORMAT = 'G.i.s' DA...
mit
WASPACDC/hmdsm.repository
plugin.video.acdcIPTV/_ytplist.py
1
4154
import urllib import urllib2,json import xbmcvfs import requests,time import os,xbmc,xbmcaddon,xbmcgui,re addon = xbmcaddon.Addon('plugin.video.acdcIPTV') profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8')) cacheDir = os.path.join(profile, 'cachedir') clean_cache=os.path.join(cacheDir,'cleancach...
gpl-2.0
AnturK/-tg-station
tools/ss13_genchangelog.py
29
8654
''' Usage: $ python ss13_genchangelog.py [--dry-run] html/changelog.html html/changelogs/ ss13_genchangelog.py - Generate changelog from YAML. Copyright 2013 Rob "N3X15" Nelson <nexis@7chan.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documenta...
agpl-3.0
spirrello/spirrello-pynet-work
applied_python/lib/python2.7/site-packages/pip/_vendor/lockfile/__init__.py
475
9162
""" lockfile.py - Platform-independent advisory file locks. Requires Python 2.5 unless you apply 2.4.diff Locking is done on a per-thread basis instead of a per-process basis. Usage: >>> lock = LockFile('somefile') >>> try: ... lock.acquire() ... except AlreadyLocked: ... print 'somefile', 'is locked already...
gpl-3.0
goodwinnk/intellij-community
python/lib/Lib/site-packages/django/views/debug.py
71
32197
import datetime import os import re import sys import types from django.conf import settings from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound from django.template import (Template, Context, TemplateDoesNotExist, TemplateSyntaxError) from django.utils.html import escape from djang...
apache-2.0
bakaat/xhtml2pdf
xhtml2pdf/turbogears.py
99
1449
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
plorch/FocusOnWildlifeCMPScripts
aggregate_cleveland_survey.py
1
5774
import sys, os, glob import pandas as pd, numpy as np import ujson import datetime from ast import literal_eval from get_workflow_info import get_workflow_info, translate_non_alphanumerics, get_short_slug from aggregate_question_utils import breakout_anno_survey, getfrac, aggregate_survey, write_class_row classfile ...
gpl-2.0
druuu/django
tests/contenttypes_tests/test_models.py
249
12059
from __future__ import unicode_literals import warnings from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.views import shortcut from django.contrib.sites.shortcuts import get_current_site from django.db.utils import IntegrityError, OperationalError, ProgrammingError from djan...
bsd-3-clause
goulu/networkx
networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py
6
7533
""" Tests for the temporal aspect of the Temporal VF2 isomorphism algorithm. """ from nose.tools import assert_true, assert_false, assert_equal from nose import SkipTest import networkx as nx from networkx.algorithms import isomorphism as iso from datetime import date, datetime, timedelta def provide_g1_edgelist()...
bsd-3-clause
LittleLama/Sick-Beard-BoxCar2
lib/subliminal/services/tvsubtitles.py
30
7310
# -*- coding: utf-8 -*- # Copyright 2012 Nicolas Wack <wackou@gmail.com> # # This file is part of subliminal. # # subliminal 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 3 of the Licen...
gpl-3.0
jonparrott/google-cloud-python
storage/google/cloud/storage/notification.py
3
13181
# Copyright 2017 Google LLC # # 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, s...
apache-2.0
mileto94/Data-Mining
homework2/tests.py
1
1147
import unittest # noqa from sliding_blocks import a_star, State class TestSlidingBlocks(unittest.TestCase): """docstring for TestSlidingBlocks.""" @staticmethod def read_user_input(start, end): """"Imitate reading user input.""" return State(start), State(end) def test_with_zero_sli...
mit
sergio-incaser/odoo
addons/procurement/wizard/schedulers_all.py
306
3456
# -*- 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
catapult-project/catapult-csm
third_party/gsutil/third_party/protorpc/demos/quotas/backend/quotas/services.py
20
14871
#!/usr/bin/env python # # 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...
bsd-3-clause
yousrabk/mne-python
examples/visualization/plot_channel_epochs_image.py
8
2653
""" ========================================= Visualize channel over epochs as an image ========================================= This will produce what is sometimes called an event related potential / field (ERP/ERF) image. 2 images are produced. One with a good channel and one with a channel that does not see any e...
bsd-3-clause
cloudbase/neutron-virtualbox
neutron/plugins/ml2/drivers/helpers.py
2
6211
# Copyright (c) 2014 Thales Services SAS # 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
Intel-Corporation/tensorflow
tensorflow/contrib/framework/python/framework/checkpoint_utils_test.py
25
13190
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
lalinsky/picard
picard/ui/itemviews.py
2
34304
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2006 Lukáš Lalinský # # 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...
gpl-2.0
LordCorellon/plugin.video.9anime
resources/lib/ui/http.py
1
4848
import urllib from http_imports import * _USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' _SESSION = None class SSLAdapter(HTTPAdapter): '''An HTTPS Transport Adapter that uses an arbitrary SSL version.''' def init_poolmanager(...
gpl-3.0
AICP/external_chromium_org
tools/cr/cr/commands/command.py
103
3033
# 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. """Module to hold the Command plugin.""" import argparse import cr class Command(cr.Plugin, cr.Plugin.Type): """Base class for implementing cr commands....
bsd-3-clause
se4u/pylearn2
pylearn2/testing/datasets.py
32
3424
""" Simple datasets to be used for unit tests. """ __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" import numpy as np from theano.compat.six.move...
bsd-3-clause
LaoZhongGu/kbengine
kbe/res/scripts/common/Lib/ctypes/__init__.py
4
17026
"""create and manipulate C data types in Python""" import os as _os, sys as _sys __version__ = "1.1.0" from _ctypes import Union, Structure, Array from _ctypes import _Pointer from _ctypes import CFuncPtr as _CFuncPtr from _ctypes import __version__ as _ctypes_version from _ctypes import RTLD_LOCAL, RTLD_GLOBAL from...
lgpl-3.0
KiChjang/servo
tests/wpt/web-platform-tests/tools/third_party/pluggy/testing/test_details.py
14
3588
import warnings import pytest from pluggy import PluginManager, HookimplMarker, HookspecMarker hookspec = HookspecMarker("example") hookimpl = HookimplMarker("example") def test_parse_hookimpl_override(): class MyPluginManager(PluginManager): def parse_hookimpl_opts(self, module_or_class, name): ...
mpl-2.0
foglamp/FogLAMP
python/foglamp/common/process.py
1
6686
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """Common FoglampProcess Class""" from abc import ABC, abstractmethod import argparse import time from foglamp.common.storage_client.storage_client import StorageClientAsync, ReadingsStorageClientAsync from foglamp.common imp...
apache-2.0
ichko/PyLearn
pylearn/neural_network.py
1
5402
"""Module containing implementation of neural network multiclass classifier with sigmoid neurons using batch gradient descent and backpropagation. """ import random import numpy as np from .math import sigmoid, sigmoid_prime from .preprocess import InitialParameters class NeuralNetwork: """NeuralNetwork clas...
mit
quheng/scikit-learn
examples/ensemble/plot_adaboost_hastie_10_2.py
355
3576
""" ============================= Discrete versus Real AdaBoost ============================= This example is based on Figure 10.2 from Hastie et al 2009 [1] and illustrates the difference in performance between the discrete SAMME [2] boosting algorithm and real SAMME.R boosting algorithm. Both algorithms are evaluate...
bsd-3-clause
sahildua2305/eden
modules/unit_tests/s3/s3resource.py
4
152869
# -*- coding: utf-8 -*- # # S3Resource Unit Tests # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3resource.py # import unittest import datetime from lxml import etree from gluon import * from gluon.storage import Storage from gluon.dal import Row from s3.s3resource...
mit
safaricoin/trenchcoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
thunderhoser/GewitterGefahr
gewittergefahr/gg_utils/linkage.py
1
114840
"""Links hazardous events to storm cells. Currently the only "hazardous events" handled by this code are damaging straight-line wind and tornadoes. --- DEFINITIONS --- "Storm cell" = a single thunderstorm (standard meteorological definition). I will use S to denote a storm cell. "Storm object" = one thunderstorm a...
mit
Beomi/irkshop
goods/migrations/0006_auto_20161025_2149.py
1
1076
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-25 12:49 from __future__ import unicode_literals import address.models from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('address', '0001_initial'), ('...
apache-2.0
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/wave.py
117
18099
"""Stuff to parse WAVE files. Usage. Reading WAVE files: f = wave.open(file, 'r') where file is either the name of a file or an open file pointer. The open file pointer must have methods read(), seek(), and close(). When the setpos() and rewind() methods are not used, the seek() method is not necessary. This ...
agpl-3.0
El-Tata/botarot
card.py
1
1635
#!/usr/bin/env python2 # -*- coding: utf8 -*- class Card(): def __init__(self, trump, value, color, points): self.trump = trump self.value = value self.color = color self.points = points self.strg = self.setStrg() pos = self.strg.find(' ') self.strgPoor = se...
gpl-3.0
siliconsmiley/QGIS
python/plugins/GdalTools/tools/doBuildVRT.py
1
7029
# -*- coding: utf-8 -*- """ *************************************************************************** doBuildVRT.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com *****************...
gpl-2.0
abridgett/boto
tests/integration/ec2/elb/test_connection.py
100
12554
# Copyright (c) 2010 Hunter Blanks http://artifex.org/~hblanks/ # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation th...
mit
se01/android_kernel_msm
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
mohsinjuni/androguard
androguard/core/api_specific_resources/aosp_permissions/aosp_permissions_api15.py
15
66415
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################# ### Extracted from platform version: 4.0.4 ################################################# AOSP_PERMISSIONS = { 'android.permission.BIND_WALLPAPER': { 'permissionGroup': '', 'description': 'Allows ...
apache-2.0
amosnier/code
python_code/arithmetic_tokenizer.py
1
1472
OPERATORS = '+', '-', '*', '/' class Tokenizer: def __init__(self, expression): self.token = None self.char_consumed = True self.state = Tokenizer._state_none self.expression = iter(expression) def __iter__(self): return self def _state_none(self, c): ...
gpl-3.0
houseind/robothon
GlyphProofer/dist/GlyphProofer.app/Contents/Resources/lib/python2.6/numpy/fft/__init__.py
1
1678
""" Discrete Fast Fourier Transform (FFT) ===================================== ========= ========================================================= Standard FFTs =================================================================== fft Discrete Fourier transform. ifft Inverse discrete Fourier transform. fft2 ...
mit
pombredanne/pants
tests/python/pants_test/engine/base_engine_test.py
15
2038
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.goal.goal...
apache-2.0
eadgarchen/tensorflow
tensorflow/contrib/training/python/training/resample.py
36
5845
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ruyang/ironic
ironic/conf/oneview.py
6
2255
# Copyright 2016 Intel Corporation # Copyright 2015 Hewlett Packard Development Company, LP # Copyright 2015 Universidade Federal de Campina Grande # # 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 t...
apache-2.0
jasonwzhy/django
django/contrib/postgres/fields/hstore.py
172
2803
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
bsd-3-clause
tesidroni/mp
Scripts/PARACHUTE LANDING APPROACH.py
60
3557
approach_azimuth = 180 parachute_deploy_altitude = 40 parachute_deploy_distance_from_home = 25 parachute_deploy_azimuth_from_home = 90 #DONT MESS WITH ANYTHING BELOW THIS LINE import sys import math import clr import time import System from System import Byte clr.AddReference("MissionPlanner") import MissionPlan...
gpl-3.0
lukasmartinelli/opencodereview
opencodereview/settings.py
1
3650
""" Django settings for opencodereview project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Bui...
mit
wnoc-drexel/gem5-stable
tests/configs/alpha_generic.py
48
4110
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
napkindrawing/ansible
lib/ansible/plugins/lookup/etcd.py
34
3787
# (c) 2013, Jan-Piet Mens <jpmens(at)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) any later ver...
gpl-3.0
nathana1/FrameworkBenchmarks
toolset/benchmark/benchmarker.py
1
43175
from setup.linux.installer import Installer from setup.linux import setup_util from benchmark import framework_test from benchmark.test_types import * from utils import header from utils import gather_tests from utils import gather_frameworks from utils import verify_database_connections import os import shutil impor...
bsd-3-clause
wegamekinglc/alpha-mind
alphamind/tests/data/engines/test_universe.py
1
1374
# -*- coding: utf-8 -*- """ Created on 2018-2-9 @author: cheng.li """ import unittest from alphamind.data.engines.universe import Universe from alphamind.data.engines.universe import load_universe class TestUniverse(unittest.TestCase): def test_universe_equal(self): universe1 = Universe('zz500') ...
mit
Tejeshwarabm/MADPIE
examples/routing/simple-routing-ping6.py
58
3376
# # Copyright (c) 2008-2009 Strasbourg University # # 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; # # This program is distributed in the hope that it will be useful, # but WITHOUT AN...
gpl-2.0
daniel-brettschneider/SiENA
ns-3.26/src/csma-layout/bindings/modulegen__gcc_LP64.py
38
520197
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-3.0
Carralex/landlab
landlab/ca/examples/rock_weathering.py
6
5506
#!/usr/env/python """ rock_weathering.py CellLab-CTS model that simulates the weathering of rock to saprolite around a network of fractures. Created (and translated from earlier code by) by Greg Tucker, Jul 2015 """ from __future__ import print_function import time import numpy as np from landlab import RasterModel...
mit
jjaviergalvez/CarND-Term3-Quizzes
search/value.py
1
1812
# ---------- # User Instructions: # # Create a function compute_value which returns # a grid of values. The value of a cell is the minimum # number of moves required to get from the cell to the goal. # # If a cell is a wall or it is impossible to reach the goal from a cell, # assign that cell a value of 99. # -------...
mit
gerardlt/tagsets
test/test_config.py
1
8049
import os import pytest import yaml from tagsets.config import Config, TagConf, FileSearchConf, GlobSearchConf from tagsets.tagsearch import TagFileMatcher, TagTextMatcher from testsupport import PathGenerator # path to the test files / directories TEST_DATA_PATH = os.path.join(os.path.dirname(os.path.realpath(__fil...
mit
leiferikb/bitpop
src/tools/json_schema_compiler/idl_schema.py
2
16913
#! /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. import itertools import json import os.path import re import sys from json_parse import OrderedDict # This file is a peer to jso...
gpl-3.0
turon/openthread
tools/harness-automation/cases/router_5_1_7.py
1
2067
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
txm/potato
django/conf/locale/ko/formats.py
313
2016
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i:s' DATETIME_FORMAT = 'Y년 n월 j일 g:i:s A' YE...
bsd-3-clause
tjsavage/sfcsdatabase
sfcs/django/contrib/auth/tokens.py
245
3206
from datetime import date from django.conf import settings from django.utils.hashcompat import sha_constructor from django.utils.http import int_to_base36, base36_to_int from django.utils.crypto import constant_time_compare, salted_hmac class PasswordResetTokenGenerator(object): """ Strategy object used to ge...
bsd-3-clause
calvinfarias/IC2015-2
BOOST/boost_1_61_0/libs/python/pyste/tests/SmartFileUT.py
54
2479
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import sys sys.path.append('../src') from SmartFile import * import unittest import tempf...
mit
junhuac/MQUIC
depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/crcmod/test/examples.py
33
1656
#----------------------------------------------------------------------------- # Demonstrate the use of the code generator from crcmod import Crc g8 = 0x185 g16 = 0x11021 g24 = 0x15D6DCB g32 = 0x104C11DB7 def polyFromBits(bits): p = 0 for n in bits: p = p | (1 << n) return p # The following is fr...
mit
avneesh91/django
tests/auth_tests/test_deprecated_views.py
32
19259
import datetime import itertools import re from urllib.parse import ParseResult, urlparse from django.conf import settings from django.contrib.auth import SESSION_KEY from django.contrib.auth.forms import ( AuthenticationForm, PasswordChangeForm, SetPasswordForm, ) from django.contrib.auth.models import User from ...
bsd-3-clause
halberom/ansible
lib/ansible/modules/cloud/amazon/iam_cert.py
25
11993
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
gdelpierre/ansible-modules-core
network/nxos/nxos_vtp_version.py
20
12438
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
lyceel/engine
tools/valgrind/memcheck/PRESUBMIT.py
68
3158
# Copyright (c) 2011 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. """ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API built into depot_tools. """ import...
bsd-3-clause
tsl143/addons-server
src/olympia/addons/buttons.py
1
7738
from django.template.loader import render_to_string from django.utils.translation import ( ugettext, ugettext_lazy as _, pgettext_lazy) import jinja2 from olympia import amo from olympia.amo.templatetags.jinja_helpers import urlparams from olympia.amo.urlresolvers import reverse @jinja2.contextfunction def inst...
bsd-3-clause
Veil-Framework/Veil-Evasion
tools/backdoor/arm/LinuxARMLELF32.py
12
9227
''' Copyright (c) 2013-2014, Joshua Pitts All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and t...
gpl-3.0
tushar7795/MicroBlog
flask/lib/python2.7/site-packages/pip/operations/freeze.py
284
3984
from __future__ import absolute_import import logging import re import pip from pip.compat import stdlib_pkgs from pip.req import InstallRequirement from pip.utils import get_installed_distributions from pip._vendor import pkg_resources logger = logging.getLogger(__name__) # packages to exclude from freeze output ...
bsd-3-clause
hjooyang/php-buildpack-3.2.2-
tests/test_compile.py
5
9299
import shutil import tempfile import os.path from nose.tools import eq_ from nose.tools import raises from nose.tools import with_setup from build_pack_utils import BuildPack from build_pack_utils.runner import CalledProcessError from common.integration import FileAssertHelper from common.integration import ErrorHelpe...
apache-2.0
gsehub/edx-platform
lms/envs/bok_choy_docker.py
18
1090
# -*- coding: utf-8 -*- """ Settings for Bok Choy tests that are used when running Studio in Docker-based devstack. """ # noinspection PyUnresolvedReferences from .bok_choy import * # pylint: disable=wildcard-import CMS_BASE = '{}:{}'.format(os.environ['BOK_CHOY_HOSTNAME'], os.environ['BOK_CHOY_CMS_PORT']) LMS_BASE ...
agpl-3.0
semonte/intellij-community
python/helpers/pydev/pydev_ipython/matplotlibtools.py
10
5496
import sys backends = {'tk': 'TkAgg', 'gtk': 'GTKAgg', 'wx': 'WXAgg', 'qt': 'Qt4Agg', # qt3 not supported 'qt4': 'Qt4Agg', 'qt5': 'Qt5Agg', 'osx': 'MacOSX'} # We also need a reverse backends2guis mapping that will properly choose which # GUI sup...
apache-2.0
jmighion/ansible
test/units/modules/cloud/amazon/test_ec2_vpc_nat_gateway.py
74
15753
import pytest import unittest from collections import namedtuple from ansible.parsing.dataloader import DataLoader from ansible.vars.manager import VariableManager from ansible.inventory.manager import InventoryManager from ansible.playbook.play import Play from ansible.executor.task_queue_manager import TaskQueueMana...
gpl-3.0
staute/shinken_deb
test/shinken_test.py
3
18067
#!/usr/bin/env python # # This file is used to test host- and service-downtimes. # import sys from sys import __stdout__ from functools import partial import time import datetime import os import string import re import random import copy import locale import unittest2 as unittest # import the shinken library fro...
agpl-3.0
gqwest-erp/server
openerp/addons/account_report_company/__init__.py
52
1091
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
efornal/mollys
app/tests.py
1
4109
# -*- encoding: utf-8 -*- from django.test import TestCase from .models import Person class PersonTests(TestCase): def test_compose_suggested_name(self): name = 'Alan Mathison' surname = 'Turing' self.assertEqual( Person.compose_suggested_name(surname, name), 'aturing') def test_...
gpl-3.0
h2oloopan/easymerge
EasyMerge/tests/scrapy/scrapy/tests/test_stats.py
15
2206
import unittest from scrapy.spider import Spider from scrapy.statscol import StatsCollector, DummyStatsCollector from scrapy.utils.test import get_crawler class StatsCollectorTest(unittest.TestCase): def setUp(self): self.crawler = get_crawler() self.spider = Spider('foo') def test_collector...
mit
kawamuray/ganeti
lib/serializer.py
2
11009
# # # Copyright (C) 2007, 2008, 2014 Google Inc. # # 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. # # This program is ...
gpl-2.0
KaranToor/MA450
google-cloud-sdk/.install/.backup/platform/bq/third_party/oauth2client/gce.py
8
3668
#!/usr/bin/env python # Copyright 2014 Google 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
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/matplotlib/tri/tricontour.py
10
10588
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from matplotlib.contour import ContourSet from matplotlib.tri.triangulation import Triangulation import matplotlib._tri as _tri import numpy as np class TriContourSet(ContourSet): """ Crea...
mit
citrix-openstack-build/trove
trove/extensions/account/service.py
2
2168
# Copyright 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
midma101/AndIWasJustGoingToBed
.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
magosil86/ruffus
ruffus/test/test_graphviz.py
5
7140
#!/usr/bin/env python from __future__ import print_function """ test_graphviz.py """ import unittest import os tempdir = os.path.relpath(os.path.abspath(os.path.splitext(__file__)[0])) + "/" import sys # add grandparent to search path for testing grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__f...
mit
persandstrom/home-assistant
homeassistant/helpers/translation.py
3
4133
"""Translation string lookup helpers.""" import logging from os import path from homeassistant import config_entries from homeassistant.loader import get_component, bind_hass from homeassistant.util.json import load_json _LOGGER = logging.getLogger(__name__) TRANSLATION_STRING_CACHE = 'translation_string_cache' de...
apache-2.0
s20121035/rk3288_android5.1_repo
cts/tools/selinux/SELinuxNeverallowTestFrame.py
2
3688
#!/usr/bin/python src_header = """/* * Copyright (C) 2014 The Android Open Source Project * * 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/LICEN...
gpl-3.0
sougou/vitess
test/cluster/keytar/keytar_test.py
5
3663
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0