repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
glenn124f/treeherder
tests/autoclassify/test_detect_intermittents.py
2
2211
from django.core.management import call_command from treeherder.autoclassify.detectors import TestFailureDetector from treeherder.autoclassify.matchers import PreciseTestMatcher from treeherder.model.models import (ClassifiedFailure, MatcherManager) from .utils import (create_fail...
mpl-2.0
dagwieers/ansible-modules-core
files/copy.py
6
12132
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, 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...
gpl-3.0
pferreir/indico
indico/util/string_test.py
3
7381
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from enum import Enum from itertools import count import pytest from indico.util.string import (camelize...
mit
fschill/mavue
plugins/debugger/elftools/elf/structs.py
11
10047
#------------------------------------------------------------------------------- # elftools: elf/structs.py # # Encapsulation of Construct structs for parsing an ELF file, adjusted for # correct endianness and word-size. # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #-------------------------...
bsd-3-clause
2014c2g23/2015cda
static/Brython3.1.1-20150328-091302/Lib/select.py
730
9440
""" borrowed from jython https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py """ #import java.nio.channels.SelectableChannel #import java.nio.channels.SelectionKey #import java.nio.channels.Selector #from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ...
gpl-3.0
run2/citytour
4symantec/Lib/site-packages/numpy-1.9.2-py2.7-win-amd64.egg/numpy/polynomial/tests/test_chebyshev.py
123
18026
"""Tests for chebyshev module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.chebyshev as cheb from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_...
mit
gnu-sandhi/sandhi
modules/gr36/gruel/src/python/pmt/__init__.py
9
1062
# # 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 version. # #...
gpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/simple_paths.py
2
24565
# -*- coding: utf-8 -*- # Copyright (C) 2012 by # Sergio Nery Simoes <sergionery@gmail.com> # All rights reserved. # BSD license. import collections from heapq import heappush, heappop from itertools import count import networkx as nx from networkx.utils import not_implemented_for from networkx.utils impor...
gpl-3.0
ayesandarmoe/microblog_flask_tutorial
flask/lib/python2.7/site-packages/whoosh/multiproc.py
73
15050
# Copyright 2011 Matt Chaput. 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 the...
gpl-2.0
SerCeMan/intellij-community
python/lib/Lib/site-packages/django/template/loaders/cached.py
229
2469
""" Wrapper class that takes a list of template loaders as an argument and attempts to load templates from them in order, caching the result. """ from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader, get_template_fro...
apache-2.0
amrhassan/scrobblethis
st/log.py
1
3127
# # Copyright 2009 Amr Hassan <amr.hassan@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 License, or # (at your option) any later version. # # This progr...
gpl-3.0
Cerdic/myCDN
contrib/web/utils.py
15
39949
#!/usr/bin/env python """ General Utilities (part of web.py) """ __all__ = [ "Storage", "storage", "storify", "Counter", "counter", "iters", "rstrips", "lstrips", "strips", "safeunicode", "safestr", "utf8", "TimeoutError", "timelimit", "Memoize", "memoize", "re_compile", "re_subm", "group", "uniq"...
gpl-2.0
theflofly/tensorflow
tensorflow/lite/python/tflite_convert.py
4
17390
# Copyright 2018 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
hojel/youtube-dl
youtube_dl/extractor/pinkbike.py
136
3411
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, remove_end, remove_start, str_to_int, unified_strdate, ) class PinkbikeIE(InfoExtractor): _VALID_URL = r'https?://(?:(?:www\.)?pinkbike\.com/video/|es\.pinkb...
unlicense
balloob/home-assistant
homeassistant/components/risco/config_flow.py
10
5584
"""Config flow for Risco integration.""" import logging from pyrisco import CannotConnectError, RiscoAPI, UnauthorizedError import voluptuous as vol from homeassistant import config_entries, core from homeassistant.const import ( CONF_PASSWORD, CONF_PIN, CONF_SCAN_INTERVAL, CONF_USERNAME, STATE_AL...
apache-2.0
translate/pootle
setup.py
5
18915
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import os import re im...
gpl-3.0
axeltidemann/self_dot
experiments/weightedSet_experiment7_secondary.py
1
18571
#!/usr/bin/python # -*- coding: latin-1 -*- ''' Experiments with weighted sets. Somewhat like fuzzy sets in that items can have partial membership in a set. e.g. for similarity measure and for context based on distance in time. The general format for a set here is [[item, score],[item, score],...] This is wrapped in ...
gpl-3.0
pdellaert/ansible
test/sanity/code-smell/docs-build.py
28
4436
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import subprocess import sys def main(): base_dir = os.getcwd() + os.path.sep docs_dir = os.path.abspath('docs/docsite') cmd = ['make', 'singlehtmldocs'] sphinx = subproc...
gpl-3.0
google/crmint
backends/ibackend/ads_auth_code.py
1
2759
# Copyright 2018 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 writing, ...
apache-2.0
benetech/Secure-App-Generator
SecureAppGenerator/thirdparty/Vellum/buildmain.py
9
2038
#! /usr/bin/env python """Build main.js from build.js and src/main.js - Compile RequireJS bundles from modles in build.js - Load main components from src/main.js This script prints its output to stdout. """ import json import re def main(): modules_js = "[%s]" % get_delimited_range("build.js").rstrip(",") mo...
gpl-2.0
blois/AndroidSDKCloneMin
ndk/prebuilt/linux-x86_64/lib/python2.7/test/test_genexps.py
82
7408
doctests = """ Test simple loop with conditional >>> sum(i*i for i in range(100) if i&1 == 1) 166650 Test simple nesting >>> list((i,j) for i in range(3) for j in range(4) ) [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)] Test nesting with the inner ...
apache-2.0
jfmartinez64/test
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/cinemassacre.py
23
3899
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, ) class CinemassacreIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?cinemassacre\.com/(?P<date_Y>[0-9]{4})/(?P<date_m>[0-9]{2})/(?P<date_d>[0-9]{2})...
gpl-3.0
jameshensman/GPclust
GPclust/collapsed_mixture.py
4
7997
# Copyright (c) 2012, 2013, 2014 James Hensman # Licensed under the GPL v3 (see LICENSE.txt) import numpy as np try: from .utilities import ln_dirichlet_C, softmax_weave except ImportError: from .np_utilities import ln_dirichlet_C from .np_utilities import softmax_numpy as softmax_weave from scipy.specia...
gpl-3.0
redhat-openstack/trove
trove/guestagent/strategies/backup/experimental/cassandra_impl.py
4
4715
# Copyright 2014 Mirantis Inc. # All Rights Reserved. # Copyright 2015 Tesora Inc. # All Rights Reserved.s # # 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 # # htt...
apache-2.0
ovresko/erpnext
erpnext/erpnext_integrations/doctype/shopify_log/shopify_log.py
10
1948
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json from frappe.model.document import Document from erpnext.erpnext_integrations.utils import get_webhook_address ...
gpl-3.0
wojons/ajenti
plugins/squid/ui_http_access.py
17
3861
from ajenti import apis from ajenti.com import * from ajenti.ui import * class SquidRules(Plugin): implements(apis.squid.IPluginPart) weight = 20 title = 'Rules' tab = 0 cfg = 0 parent = None def init(self, parent, cfg, tab): self.parent = parent self.cfg = cfg s...
lgpl-3.0
duane-edgington/stoqs
stoqs/loaders/CANON/loadCANON_may2015.py
4
17046
#!/usr/bin/env python __author__ = 'Mike McCann,Duane Edgington,Reiko Michisaki' __copyright__ = '2015' __license__ = 'GPL v3' __contact__ = 'duane at mbari.org' __doc__ = ''' Master loader for all CANON activities in May 2015 Mike McCann and Duane Edgington MBARI 11 May 2015 @var __date__: Date of last svn ...
gpl-3.0
fenginx/django
tests/template_tests/filter_tests/test_truncatewords.py
71
1755
from django.template.defaultfilters import truncatewords from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class TruncatewordsTests(SimpleTestCase): @setup({ 'truncatewords01': '{% autoescape off %}{{ a|truncatewords:"2" }} {{ b|truncatewords:...
bsd-3-clause
sgraham/nope
tools/perf/measurements/skpicture_printer_unittest.py
12
1314
# 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. import shutil import tempfile from measurements import skpicture_printer from telemetry import decorators from telemetry.unittest_util import options_for_un...
bsd-3-clause
tracierenea/gnuradio
gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/text.py
333
1832
# # 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
Shiroy/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_memorizingfile.py
496
4252
#!/usr/bin/env python # # Copyright 2011, 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...
mpl-2.0
maurofaccenda/ansible
lib/ansible/modules/system/aix_lvol.py
10
10849
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Alain Dejoux <adejoux@djouxtech.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 ...
gpl-3.0
neozhangthe1/dedupe
dedupe/index.py
3
2440
from __future__ import division from zope.index.text.lexicon import Lexicon from zope.index.text.stopdict import get_stopdict from zope.index.text.textindex import TextIndex from zope.index.text.cosineindex import CosineIndex from zope.index.text.setops import mass_weightedUnion from BTrees.Length import Length impor...
mit
quxiaolong1504/django
tests/absolute_url_overrides/tests.py
284
2007
from django.db import models from django.test import SimpleTestCase class AbsoluteUrlOverrideTests(SimpleTestCase): def test_get_absolute_url(self): """ get_absolute_url() functions as a normal method. """ get_absolute_url = lambda o: '/test-a/%s/' % o.pk TestA = self._cre...
bsd-3-clause
damdam-s/partner-contact
base_location_geonames_import/wizard/geonames_import.py
21
5910
# -*- encoding: utf-8 -*- ############################################################################## # # Base Location Geonames Import module for OpenERP # Copyright (C) 2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre <alexis.delattre@akretion.com> # Copyright (C) 2014 Agile Business ...
agpl-3.0
darolt/ndnSIMQoS
src/ndnSIM/docs/source/conf.py
1
8551
# -*- coding: utf-8 -*- # # ndnSIM: NS-3 based NDN simulator documentation build configuration file, created by # sphinx-quickstart on Thu May 31 18:21:13 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # au...
gpl-2.0
idrogeno/FusionOE
lib/python/Screens/Rc.py
39
2858
from Components.Pixmap import MovingPixmap, MultiPixmap from Tools.Directories import resolveFilename, SCOPE_SKIN from xml.etree.ElementTree import ElementTree from Components.config import config, ConfigInteger from Components.RcModel import rc_model from boxbranding import getBoxType config.misc.rcused = ConfigInteg...
gpl-2.0
ruba9/HotelChatbot
my_env/lib/python3.6/site-packages/pip/_vendor/html5lib/treebuilders/base.py
329
13942
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from ..constants import scopingElements, tableInsertModeElements, namespaces # The scope markers are inserted when entering object elements, # marquees, table cells, and table captions, and are used to prevent for...
mit
benfinke/ns_python
build/lib/nssrc/com/citrix/netscaler/nitro/resource/config/responder/responderaction.py
3
18812
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
lo-windigo/fragdev
fragdev/settings.py
1
5073
# This file is part of the FragDev Website. # # the FragDev Website 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. # # the FragDev W...
agpl-3.0
highweb-project/highweb-webcl-html5spec
chrome/common/extensions/docs/server2/caching_rietveld_patcher_test.py
121
2325
#!/usr/bin/env python # 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. import unittest from caching_rietveld_patcher import (CachingRietveldPatcher, _VERSION_CACHE_MAXA...
bsd-3-clause
lihkin213/ursula
library/cinder_volume_group.py
13
3599
#!/usr/bin/python #coding: utf-8 -*- DOCUMENTATION = ''' --- author: Jesse Keating and Dustin Lundquist module: cinder_volume_group short_description: Configure LVM volume groups description: - This module creates a LVM VG for Cinder to use options: size: description: - The size of the VG file to create ...
mit
chaen/DIRAC
Core/Utilities/Glue2.py
6
10789
"""Module collecting functions dealing with the GLUE2 information schema :author: A.Sailer Known problems: * ARC CEs do not seem to publish wall or CPU time per queue anywhere * There is no consistency between which memory information is provided where, execution environment vs. information for a share * Some ...
gpl-3.0
sshnaidm/ru
plugin.video.planeta-online.tv/resources/lib/html5lib/tokenizer_old.py
25
53285
try: frozenset except NameError: # Import from the sets module for python 2.3 from sets import Set as set from sets import ImmutableSet as frozenset try: from collections import deque except ImportError: from utils import deque from constants import contentModelFlags, spaceCharacters from c...
gpl-2.0
cvium/Flexget
docs/conf.py
9
8673
# -*- coding: utf-8 -*- # # FlexGet documentation build configuration file, created by # sphinx-quickstart on Thu Dec 22 21:49:19 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
mit
vincentfpgarcia/tradingtool
trash/create_datasets.py
1
1671
import json import numpy as np import random from datetime import datetime # Parameters DAY_IN_PAST = 31 TRAINING_SIZE = 0.8 # Load the JSON containing stock history json_path = 'data/stock_history.json' data = json.load(open(json_path)) # Set the random seed random.seed(datetime.now()) # Declare datasets X...
mit
muchbeli/bitcoin-abe
test/test_block_order.py
22
2486
# Copyright(C) 2014 by Abe developers. # test_block_order.py: test Abe importing blocks out of order. # 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, ...
agpl-3.0
NathanAtSamraksh/dart-linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
1891
3300
# Core.py - Python extension for perf script, core functions # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. from collections import defaultdict def aut...
gpl-2.0
stevenbrichards/boto
boto/cloudhsm/exceptions.py
135
1347
# Copyright (c) 2015 Amazon.com, Inc. or its affiliates. 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 the rights ...
mit
chouseknecht/ansible
test/lib/ansible_test/_internal/changes.py
28
5859
"""Detect changes in Ansible code.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import os from .util import ( ApplicationError, SubprocessError, MissingEnvironmentVariable, display, ) from .util_common import ( CommonConfig, ) from .http im...
gpl-3.0
drogomarks/heimdallv2
apiTool.py
1
5479
#!/usr/bin/env python import base64 import hashlib import time import requests import json import config # Get Keys & Set User Agent usrkey = config.usrkey scrtkey = config.scrtkey usr_agent = config.usr_agent # Get Date/Time: YYYYMMDDHHmmss tm_stmp = time.strftime("%Y%m%d%H%M%S") # Hash: <User Key><U...
mit
waldyrious/GraphUI
graphui/EdgeWidget.py
3
5570
# Copyright (c) 2007 Enough Project. # See LICENSE for details. import math import pygame from gui import draw from guilib import MovingLine, paint_arrowhead_by_direction, rotate_surface, repaint_arrowhead, get_default from lib.Point import Point, from_polar, point_near_polyline from gui.Widget import Widget from gui...
gpl-3.0
koniiiik/django
django/contrib/gis/geos/polygon.py
115
6932
from ctypes import byref, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos import GEOM_PTR, get_pointer_arr from django.contrib.gis.geos.linestring import LinearRing from django.utils import six from django.util...
bsd-3-clause
hdinsight/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/collections.py
219
4667
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ from ctypes import c_int, c_uint, byref from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos i...
apache-2.0
VitalPet/odoo
addons/crm_partner_assign/wizard/crm_forward_to_partner.py
48
5934
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
kaplun/ops
modules/oairepository/lib/oai_repository_webinterface.py
22
5993
## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 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 ...
gpl-2.0
nobodyisme/mastermind_toshik
src/python-mastermind/src/mastermind/utils/queue.py
1
7336
import os.path import uuid from kazoo.exceptions import NoNodeError, NodeExistsError, KazooException from kazoo.retry import RetryFailedError class LockingQueue(object): """A distributed queue with priority and locking support. Upon retrieving an entry from the queue, the entry gets locked with an ephem...
gpl-2.0
chrislyon/dj_ds1
static/Brython3.2.0-20150701-214155/Lib/test/unittests/test_pstats.py
175
1295
import unittest from test import support from io import StringIO import pstats class AddCallersTestCase(unittest.TestCase): """Tests for pstats.add_callers helper.""" def test_combine_results(self): # pstats.add_callers should combine the call results of both target # and source by adding th...
gpl-2.0
barrachri/aiodocker
setup.py
1
1577
#!/usr/bin/env python import re from pathlib import Path from setuptools import setup with (Path(__file__).parent / 'aiodocker' / '__init__.py').open() as fp: try: version = re.findall(r"^__version__ = '([^']+)'\r?$", fp.read(), re.M)[0] except IndexError: raise R...
apache-2.0
hirokihamasaki/irma
probe/modules/antivirus/mcafee/plugin.py
1
1865
# # Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA 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 in the top-level directory # of this distribution and at: # # http:...
apache-2.0
nikolas/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/generic_views/base.py
25
8991
import time import unittest from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import TestCase, RequestFactory from django.utils import simplejson from django.views.generic import View, TemplateView, RedirectView class SimpleView(View): """ A simple ...
gpl-3.0
micropython/micropython
tests/extmod/framebuf16.py
7
1212
try: import framebuf, usys except ImportError: print("SKIP") raise SystemExit # This test and its .exp file is based on a little-endian architecture. if usys.byteorder != "little": print("SKIP") raise SystemExit def printbuf(): print("--8<--") for y in range(h): print(buf[y * w * ...
mit
Pelagicore/softwarecontainer
servicetest/environment/test_environment.py
3
17334
# Copyright (C) 2016-2017 Pelagicore AB # # Permission to use, copy, modify, and/or distribute this software 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 IS" AND THE AUTHOR DISCLAIMS...
lgpl-2.1
marshall/pynaries
boto/sdb/persist/test_persist.py
4
3431
from boto.sdb.persist.object import SDBObject from boto.sdb.persist.property import * from boto.sdb.persist import Manager from datetime import datetime import time # # This will eventually be moved to the boto.tests module and become a real unit test # but for now it will live here. It shows examples of each of the ...
apache-2.0
amith01994/intellij-community
python/helpers/epydoc/docbuilder.py
91
57818
# epydoc -- Documentation Builder # # Copyright (C) 2005 Edward Loper # Author: Edward Loper <edloper@loper.org> # URL: <http://epydoc.sf.net> # # $Id: docbuilder.py 1683 2008-01-29 22:17:39Z edloper $ """ Construct data structures that encode the API documentation for Python objects. These data structures are create...
apache-2.0
dfdx2/django
tests/forms_tests/field_tests/test_regexfield.py
106
2881
import re from django.forms import RegexField, ValidationError from django.test import SimpleTestCase class RegexFieldTest(SimpleTestCase): def test_regexfield_1(self): f = RegexField('^[0-9][A-F][0-9]$') self.assertEqual('2A2', f.clean('2A2')) self.assertEqual('3F3', f.clean('3F3')) ...
bsd-3-clause
rynomster/django
tests/template_tests/filter_tests/test_join.py
362
2707
from django.template.defaultfilters import join from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class JoinTests(SimpleTestCase): @setup({'join01': '{{ a|join:", " }}'}) def test_join01(self): output = self.engine.render_to_string('join01...
bsd-3-clause
yize/grunt-tps
tasks/lib/python/Lib/python2.7/test/re_tests.py
188
31856
#!/usr/bin/env python # -*- mode: python -*- # Re test suite and benchmark suite v1.5 # The 3 possible outcomes for each pattern [SUCCEED, FAIL, SYNTAX_ERROR] = range(3) # Benchmark suite (needs expansion) # # The benchmark suite does not test correctness, just speed. The # first element of each tuple is the regex ...
mit
OriHoch/knesset-data-pipelines
committees/dist/build_meetings.py
2
3293
from datapackage_pipelines.wrapper import ingest, spew import os, logging parameters, datapackage, resources, stats = ingest() + ({},) if os.environ.get("TEST_DATA") == "1" or parameters.get("test-data"): parameters.update(**{"committee-ids": [2026, 2022, 1013, 1012, 2017], "max-meetings-...
mit
ionanrozenfeld/networkx
networkx/tests/test_convert_scipy.py
14
9372
from nose import SkipTest from nose.tools import assert_raises, assert_true, assert_equal, raises import networkx as nx from networkx.testing import assert_graphs_equal from networkx.generators.classic import barbell_graph,cycle_graph,path_graph from networkx.testing.utils import assert_graphs_equal class TestConver...
bsd-3-clause
eternity-group/eternity
qa/rpc-tests/getblocktemplate_proposals.py
32
5472
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from bi...
mit
stdweird/aquilon
lib/python2.6/aquilon/aqdb/model/router_address.py
2
3471
# -*- 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. # You may obtain a copy...
apache-2.0
yousafsyed/casperjs
bin/Lib/distutils/errors.py
152
3577
"""distutils.errors Provides exceptions used by the Distutils modules. Note that Distutils modules may raise standard exceptions; in particular, SystemExit is usually raised for errors that are obviously the end-user's fault (eg. bad command-line arguments). This module is safe to use in "from ... import *" mode; it...
mit
docusign/docusign-python-client
docusign_esign/models/bulk_send_request.py
1
4279
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
mit
FedeMPouzols/Savu
savu/test/travis/framework_tests/multiple_parameter_test.py
1
3633
# -*- coding: utf-8 -*- # Copyright 2014 Diamond Light Source Ltd. # # 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 ap...
gpl-3.0
cchristelis/watchkeeper
django_project/sms/migrations/0005_auto__add_field_gateway_check_number_url__add_field_gateway_check_numb.py
5
10915
# encoding: 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 field 'Gateway.check_number_url' db.add_column('sms_gateway', 'check_number_url', self.gf('django...
bsd-2-clause
SymbiFlow/prjxray
utils/maskview.py
1
3945
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ This tool allows to view segbits ...
isc
beardypig/streamlink
tests/plugins/test_schoolism.py
2
2507
import unittest from streamlink.plugins.schoolism import Schoolism class TestPluginSchoolism(unittest.TestCase): def test_can_handle_url(self): should_match = [ 'https://www.schoolism.com/watchLesson.php', ] for url in should_match: self.assertTrue(Schoolism.can_ha...
bsd-2-clause
drpngx/tensorflow
tensorflow/contrib/layers/python/layers/initializers_test.py
111
7640
# 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
OpenUpgrade-dev/OpenUpgrade
addons/account/wizard/account_open_closed_fiscalyear.py
104
2341
# -*- 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
Yuudachimoe/HikariChun-RedBot
lib/youtube_dl/extractor/primesharetv.py
73
1853
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, sanitized_Request, urlencode_postdata, ) class PrimeShareTVIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?primeshare\.tv/download/(?P<id>[\da-zA-Z]+)' _TEST = { 'url': 'h...
gpl-3.0
caphrim007/ansible
lib/ansible/modules/network/a10/a10_virtual_server.py
50
11177
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Mischa Peters <mpeters@a10networks.com>, # Eric Chou <ericc@a10networks.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = t...
gpl-3.0
lesteve/joblib
joblib/externals/loky/backend/queues.py
11
8827
############################################################################### # Queue and SimpleQueue implementation for loky # # authors: Thomas Moreau, Olivier Grisel # # based on multiprocessing/queues.py (16/02/2017) # * Add some compatibility function for python2.7 and 3.3 and makes sure # it uses the right sy...
bsd-3-clause
kl2532/csi_columbia
Assignment_4/get_ancestry2.py
1
3923
# -*- coding: utf-8 -*- """ Usage: (python) get_ancestry2.py genome_full_snps.txt <.csv files> Returns a dictionary of the ancestry likelihood based on SNPs Example: $ python get_ancestry2.py sample2geno.txt results_sample2.csv """ import sys import csv def build_population_dict(csv_files): ""...
gpl-2.0
defionscode/ansible
test/runner/lib/csharp_import_analysis.py
49
2452
"""Analyze C# import statements.""" from __future__ import absolute_import, print_function import os import re from lib.util import ( display, ) def get_csharp_module_utils_imports(powershell_targets, csharp_targets): """Return a dictionary of module_utils names mapped to sets of powershell file paths. ...
gpl-3.0
JimCircadian/ansible
lib/ansible/module_utils/acme.py
3
21443
# -*- coding: utf-8 -*- # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own lic...
gpl-3.0
nhicher/ansible
lib/ansible/plugins/callback/unixy.py
14
8485
# Copyright: (c) 2017, Allyson Bowles <@akatch> # Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclas...
gpl-3.0
hachard/Cra-Magnet
flask/lib/python3.5/site-packages/migrate/changeset/constraint.py
140
7318
""" This module defines standalone schema constraint classes. """ from sqlalchemy import schema from migrate.exceptions import * class ConstraintChangeset(object): """Base class for Constraint classes.""" def _normalize_columns(self, cols, table_name=False): """Given: column objects or names; retu...
gpl-3.0
tjsavage/full_nonrel_starter
django/core/mail/message.py
151
12967
import mimetypes import os import random import time from email import Charset, Encoders try: from email.generator import Generator except ImportError: from email.Generator import Generator # TODO: Remove when remove Python 2.4 support from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMult...
bsd-3-clause
stacywsmith/ansible
lib/ansible/modules/network/lenovo/cnos_factory.py
19
5084
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
gpl-3.0
xushuwei202/Vintageous
ex/parser/scanner_command_substitute.py
9
2460
from .state import EOF from .tokens import TokenEof from .tokens_base import TOKEN_COMMAND_SUBSTITUTE from .tokens_base import TokenOfCommand from Vintageous import ex @ex.command('substitute', 's') class TokenCommandSubstitute(TokenOfCommand): def __init__(self, params, *args, **kwargs): super().__init_...
mit
UniMOOC/gcb-new-module
modules/usage_reporting/students.py
9
1765
# Copyright 2015 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 by applicable law or ...
apache-2.0
dietrichc/streamline-ppc-reports
examples/dfp/v201408/creative_wrapper_service/get_all_creative_wrappers.py
4
2145
#!/usr/bin/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 b...
apache-2.0
CenterForOpenScience/osf.io
scripts/tests/test_migrate_analytics.py
8
3035
import pytz from dateutil.parser import parse from nose.tools import * # noqa from tests.base import OsfTestCase from scripts.analytics.migrate_analytics import generate_events_between_events, fill_in_event_gaps class TestMigrateAnalytics(OsfTestCase): def setUp(self): super(TestMigrateAnalytics, self)....
apache-2.0
jsirois/commons
src/python/twitter/common/log/initialize.py
14
9100
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
rpbarnes/nmrglue
examples/convert/bruker2pipe_3d.py
10
1483
#! /usr/bin/env python import nmrglue as ng # read in the varian data (any of the follow lines will work) dic,data=ng.bruker.read_lowmem("../common_data/3d_bruker") # Set the parameters (many of these can be found in the procpar file u = ng.bruker.guess_udic(dic,data) # Direct Dimension u[2]['size'] = 768 u[2]['...
bsd-3-clause
safwanrahman/kuma
kuma/core/tests/test_models.py
4
1201
from datetime import date, timedelta from django.test import TestCase from kuma.core.tests import eq_ from ..models import IPBan class RevisionIPTests(TestCase): def test_delete_older_than_default_30_days(self): old_date = date.today() - timedelta(days=31) IPBan(ip='127.0.0.1', created=old_date)...
mpl-2.0
tfryett/qotoolbox
unix2dos.py
2
1251
import sys, glob, string def unix2dos(fmask): flist = glob.glob(fmask); for fname in flist: fp = open(fname,"rb") text = fp.read() fp.close() if string.find(text,'\015') < 0: text = string.replace(text,'\012','\015\012') fp = open(fname,"wb") fp.write...
gpl-2.0
vidoardes/XS-ICS
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
CityGrid/arsenal
server/arsenalweb/views/physical_racks.py
1
3182
'''Arsenal physical_racks UI''' # Copyright 2015 CityGrid Media, 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 requir...
apache-2.0