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
aman-iitj/scipy
scipy/io/matlab/mio5.py
23
31748
''' Classes for read / write of matlab (TM) 5 files The matfile specification last found here: http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/matfile_format.pdf (as of December 5 2008) ''' from __future__ import division, print_function, absolute_import ''' ================================= Note on f...
bsd-3-clause
Event38/MissionPlanner
Lib/dummy_threading.py
70
2882
"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``. The module ``_dummy_threading`` is added to ``sys.modules`` in order to not have ``threading`` considered imported. Had ``threading`` been directly imported it would have made all subsequent imports succeed regardless of whether ``thread...
gpl-3.0
slozier/ironpython2
Src/StdLib/Lib/bsddb/test/test_join.py
111
3168
"""TestCases for using the DB.join and DBCursor.join_item methods. """ import os import unittest from test_all import db, dbshelve, test_support, verbose, \ get_new_environment_path, get_new_database_path #---------------------------------------------------------------------- ProductIndex = [ ('apple',...
apache-2.0
acsone/odoo
addons/sale/__init__.py
378
1085
# -*- 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
certsocietegenerale/fame_modules
processing/apk/apk_plugins/bankbot.py
1
2299
import json from base64 import b64decode from . import APKPlugin def is_url(string): return string.startswith('http') def is_package(string): return '.' in string class BankBot(APKPlugin): name = "bankbot" extraction = "BankBot Configuration" probable_name = "BankBot" def find_targets_me...
gpl-3.0
goliveirab/odoo
addons/hr_recruitment/report/__init__.py
442
1107
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
debugger22/sympy
sympy/geometry/tests/test_geometry.py
36
32248
from __future__ import division import warnings from sympy import (Abs, I, Dummy, Rational, Float, S, Symbol, cos, oo, pi, simplify, sin, sqrt, symbols, Derivative, asin, acos) from sympy.core.compatibility import range from sympy.functions.elementary.trigonometric import tan from sympy.geometry imp...
bsd-3-clause
dronefly/dronefly.github.io
flask/lib/python2.7/site-packages/setuptools/tests/test_find_packages.py
109
5619
"""Tests for setuptools.find_packages().""" import os import sys import shutil import tempfile import unittest import platform import setuptools from setuptools import find_packages from setuptools.tests.py26compat import skipIf find_420_packages = setuptools.PEP420PackageFinder.find def has_symlink(): bad_symli...
apache-2.0
jauhien/g-sorcery
g_sorcery/package_db.py
1
24306
#!/usr/bin/env python # -*- coding: utf-8 -*- """ package_db.py ~~~~~~~~~~~~~ package database :copyright: (c) 2013-2015 by Jauhien Piatlicki :license: GPL-2, see LICENSE for more details. """ import os import portage from .compatibility import basestring, py2k from .db_layout import DBLayout...
gpl-2.0
greyfenrir/taurus
tests/resources/apiritif/test_transactions.py
2
1116
# coding=utf-8 import logging import random import string import sys import unittest from time import time, sleep import apiritif class TestAPI(unittest.TestCase, ): def setUp(self): self.vars = { } timeout = 30.0 apiritif.put_into_thread_store(timeout=timeout, func_mode=False,...
apache-2.0
instinct-vfx/rez
src/rez/tests/test_completion.py
3
3001
""" test completions """ import rez.vendor.unittest2 as unittest from rez.tests.util import TestBase from rez.config import Config, get_module_root_config from rez.packages_ import get_completions import os import os.path class TestCompletion(TestBase): @classmethod def setUpClass(cls): path = os.path...
lgpl-3.0
mglukhikh/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/sk/sk_districts.py
543
2453
""" Slovak districts according to http://sk.wikipedia.org/wiki/Administrat%C3%ADvne_%C4%8Dlenenie_Slovenska """ from django.utils.translation import ugettext_lazy as _ DISTRICT_CHOICES = ( ('BB', _('Banska Bystrica')), ('BS', _('Banska Stiavnica')), ('BJ', _('Bardejov')), ('BN', _('Banovce nad Bebravo...
apache-2.0
rv816/wagtail
wagtail/contrib/wagtailstyleguide/views.py
11
2523
from django import forms from django.shortcuts import render from django.utils.translation import ugettext as _ from wagtail.wagtailadmin import messages from wagtail.wagtailadmin.forms import SearchForm from wagtail.wagtailadmin.widgets import AdminPageChooser, AdminDateInput, AdminTimeInput, AdminDateTimeInput from ...
bsd-3-clause
LazyCodingCat/gyp
test/cxxflags/gyptest-cxxflags.py
128
1034
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies the use of the environment during regeneration when the gyp file changes, specifically via build of an executable with C++ flag...
bsd-3-clause
larsks/blivet
tests/devices_test/device_properties_test.py
2
38660
# vim:set fileencoding=utf-8 import unittest import gi gi.require_version("BlockDev", "1.0") from gi.repository import BlockDev as blockdev from mock import Mock import blivet from blivet.errors import BTRFSValueError from blivet.errors import DeviceError from blivet.devices import BTRFSSnapShotDevice from blive...
gpl-2.0
chengyi818/openwrt
scripts/flashing/jungo-image.py
758
7069
#!/usr/bin/env python # # Copyright 2008, 2009 (C) Jose Vasconcellos <jvasco@verizon.net> # # A script that can communicate with jungo-based routers # (such as MI424-WR, USR8200 and WRV54G) to backup the installed # firmware and replace the boot loader. # # Tested with Python 2.5 on Linux and Windows # """Usage: %s [op...
gpl-2.0
dkerwin/ansible-modules-core
cloud/amazon/elasticache.py
8
21878
#!/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
welshjf/pyqtgraph
pyqtgraph/graphicsItems/GraphicsObject.py
44
1720
from ..Qt import QtGui, QtCore, USE_PYSIDE if not USE_PYSIDE: import sip from .GraphicsItem import GraphicsItem __all__ = ['GraphicsObject'] class GraphicsObject(GraphicsItem, QtGui.QGraphicsObject): """ **Bases:** :class:`GraphicsItem <pyqtgraph.graphicsItems.GraphicsItem>`, :class:`QtGui.QGraphicsObject`...
mit
cloudfoundry/php-buildpack-legacy
builds/runtimes/python-2.7.6/lib/python2.7/compiler/transformer.py
176
53108
"""Parse tree transformation module. Transforms Python source code into an abstract syntax tree (AST) defined in the ast module. The simplest ways to invoke this module are via parse and parseFile. parse(buf) -> AST parseFile(path) -> AST """ # Original version written by Greg Stein (gstein@lyra.org) # ...
mit
ftrader-bitcoinabc/bitcoin-abc
test/functional/feature_logging.py
2
3032
#!/usr/bin/env python3 # Copyright (c) 2017 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 debug logging.""" import os from test_framework.test_framework import BitcoinTestFramework from test_...
mit
xxsergzzxx/python-for-android
python-modules/twisted/twisted/plugins/twisted_qtstub.py
61
1417
# Copyright (c) 2006 Twisted Matrix Laboratories. # See LICENSE for details. """ Backwards-compatibility plugin for the Qt reactor. This provides a Qt reactor plugin named C{qt} which emits a deprecation warning and a pointer to the separately distributed Qt reactor plugins. """ import warnings from twisted.applica...
apache-2.0
huguesv/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/encodings/mac_arabic.py
593
36723
""" Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
apache-2.0
talbrecht/pism_pik06
doc/site-packages/pybtex/richtext.py
4
10407
# Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Andrey Golovizin # # 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 to ...
gpl-3.0
beav/pulp
server/pulp/server/db/model/repository.py
2
19235
import traceback as traceback_module from pulp.server.db.model.base import Model from pulp.server.db.model.reaper_base import ReaperMixin import pulp.common.dateutils as dateutils class Repo(Model): """ Represents a Pulp repository. Instances of this class will have references into the repo importer and ...
gpl-2.0
ngokevin/beets
beets/autotag/musicbrainz3/mbxml.py
1
16349
import xml.etree.ElementTree as ET import string import StringIO import logging try: from ET import fixtag except: # Python < 2.7 def fixtag(tag, namespaces): # given a decorated tag (of the form {uri}tag), return prefixed # tag and namespace declaration, if any if isinstance(tag, ET.QName): tag = tag.text ...
mit
Dandandan/wikiprogramming
jsrepl/build/extern/python/reloop-closured/lib/python2.7/glob.py
173
2249
"""Filename globbing utility.""" import sys import os import re import fnmatch __all__ = ["glob", "iglob"] def glob(pathname): """Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. """ return list(iglob(pathname)) def iglob(pathna...
mit
murfz/Sick-Beard
sickbeard/notifiers/pushalot.py
46
3698
# Author: Maciej Olesinski (https://github.com/molesinski/) # Based on prowl.py by Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
gpl-3.0
joescape/DeembedProject
DeembeddingTool.py
1
2376
# importing wx files import wx import skrf as rf import matplotlib.pylab as plt import numpy as np import DeembedGUI import DeembedFiles class DeembedWiz(DeembedGUI.DeembedWiz): # constructor def __init__(self,parent): # type: (object) -> object # initialize parent class De...
gpl-3.0
sputnick-dev/weboob
modules/ina/module.py
7
1886
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Christophe Benz # # This file is part of weboob. # # weboob 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 yo...
agpl-3.0
resync/resync
tests/test_resource_dump_manifest.py
1
3269
import unittest try: # python2 # Must try this first as io also exists in python2 # but in the wrong one! import StringIO as io except ImportError: # python3 import io import re from resync.resource import Resource from resync.resource_dump_manifest import ResourceDumpManifest from resync.sitemap imp...
apache-2.0
40223226/W17test2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_setups.py
791
16440
import io import sys import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=io.StringIO()) def runTests(self, *cases...
gpl-3.0
Panos512/invenio
modules/bibrank/lib/bibrank_citation_searcher.py
1
13347
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2015 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 ...
gpl-2.0
yukoba/sympy
sympy/polys/tests/test_specialpolys.py
115
3481
"""Tests for functions for generating interesting polynomials. """ from sympy import Poly, ZZ, symbols from sympy.utilities.pytest import raises from sympy.polys.specialpolys import ( swinnerton_dyer_poly, cyclotomic_poly, symmetric_poly, random_poly, interpolating_poly, fateman_poly_F_1, ...
bsd-3-clause
betoesquivel/fil2014
filenv/lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py
224
6622
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from django.utils.six.moves import xrange from math import pi, sin, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 18...
mit
keen99/SickRage
lib/requests/__init__.py
151
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
gpl-3.0
sankhesh/VTK
Common/Core/Testing/Python/TestCommand.py
13
5762
"""Test the wrapping of vtkCommand The following vtkCommmand functionality must be tested - Event enum constants - Event names Created on Mar 22, 2012 by David Gobbi Updated on Feb 12, 2014 by Jean-Christophe Fillion-Robin """ import sys import gc import vtk from vtk.test import Testing class callback: def __in...
bsd-3-clause
WarrenWeckesser/scipy
scipy/sparse/linalg/dsolve/linsolve.py
16
21172
from warnings import warn import numpy as np from numpy import asarray from scipy.sparse import (isspmatrix_csc, isspmatrix_csr, isspmatrix, SparseEfficiencyWarning, csc_matrix, csr_matrix) from scipy.sparse.sputils import is_pydata_spmatrix from scipy.linalg import LinAlgError import copy f...
bsd-3-clause
gkunter/coquery
test/test_options.py
1
1829
# -*- coding: utf-8 -*- """ This module tests the the options module. Run it like so: coquery$ python -m test.test_options """ from __future__ import print_function from coquery.options import decode_query_string, encode_query_string from test.testcase import CoqTestCase, run_tests class TestQueryStringParse(Coq...
gpl-3.0
sshmakov/conopy
conopy/excel.py
1
2666
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import datetime from PyQt5.QtCore import * from PyQt5.QtWidgets import * import xlsxwriter def exportToExcel(): win = focusTaskWindow() if win == None: print("No focused window") return view = focusItemView(win) title = win.windowTi...
mit
appsembler/mayan_appsembler
apps/installation/classes.py
2
4680
from __future__ import absolute_import from collections import namedtuple import os import sys import pbs try: from pbs import pip PIP = True except pbs.CommandNotFound: PIP = False from django.conf import settings from django.utils.simplejson import dumps class PIPNotFound(Exception): pass cla...
gpl-3.0
TwoD/ansible
lib/ansible/runner/action_plugins/assert.py
138
2123
# Copyright 2012, Dag Wieers <dag@wieers.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 versi...
gpl-3.0
sublime1809/django
tests/csrf_tests/tests.py
17
18530
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.core.context_processors import csrf from django.http import HttpRequest, HttpResponse from django.middleware.csrf import CsrfViewMiddleware, CSRF_KEY_LENGTH from django.template import RequestCon...
bsd-3-clause
rhunwicks/django-import-export
import_export/formats/base_formats.py
2
5780
from __future__ import unicode_literals from django.utils.six import moves import sys import warnings import tablib try: from tablib.compat import xlrd XLS_IMPORT = True except ImportError: try: import xlrd # NOQA XLS_IMPORT = True except ImportError: xls_warning = "Installe...
bsd-2-clause
harme199497/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
Chapter2_MorePyMC/separation_plot.py
86
1494
# separation plot # Author: Cameron Davidson-Pilon,2013 # see http://mdwardlab.com/sites/default/files/GreenhillWardSacks.pdf import matplotlib.pyplot as plt import numpy as np def separation_plot( p, y, **kwargs ): """ This function creates a separation plot for logistic and probit classification. Se...
mit
ScottHull/Field-Camp-Tools
quad2azi.py
2
4124
import os, time, csv home_dir_list = [] home_dir_list.append(os.getcwd()) def initialization(): print("_____________________________________________________\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n") print("Quadrant to Azimuth Converter") print("Scott D. Hull, 2016\n\n") pr...
cc0-1.0
fastbot3d/linux-3.2.0
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # 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 i...
gpl-2.0
Lupino/containerops
component/python/test/unittest/bootstrap.py
5
4681
#!/usr/bin/env python3 import subprocess import os import sys import glob import anymarkup REPO_PATH = 'git-repo' def git_clone(url): r = subprocess.run(['git', 'clone', url, REPO_PATH]) if r.returncode == 0: return True else: print("[COUT] Git clone error: Invalid argument to exit", ...
apache-2.0
sdlovecraft/samhains
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/bbcode.py
362
3314
# -*- coding: utf-8 -*- """ pygments.formatters.bbcode ~~~~~~~~~~~~~~~~~~~~~~~~~~ BBcode formatter. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_bool_opt __al...
mit
dqnykamp/sympy
sympy/mpmath/tests/test_diff.py
20
2472
from sympy.mpmath import * def test_diff(): mp.dps = 15 assert diff(log, 2.0, n=0).ae(log(2)) assert diff(cos, 1.0).ae(-sin(1)) assert diff(abs, 0.0) == 0 assert diff(abs, 0.0, direction=1) == 1 assert diff(abs, 0.0, direction=-1) == -1 assert diff(exp, 1.0).ae(e) assert diff(exp, 1.0, ...
bsd-3-clause
lavajumper/sexcoin
test/functional/rawtransactions.py
9
10750
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the rawtranscation RPCs. Test the following RPCs: - createrawtransaction - signrawtransacti...
mit
yqm/sl4a
python/src/Lib/plat-sunos5/TYPES.py
75
5806
# Generated by h2py from /usr/include/sys/types.h # Included from sys/isa_defs.h _CHAR_ALIGNMENT = 1 _SHORT_ALIGNMENT = 2 _INT_ALIGNMENT = 4 _LONG_ALIGNMENT = 8 _LONG_LONG_ALIGNMENT = 8 _DOUBLE_ALIGNMENT = 8 _LONG_DOUBLE_ALIGNMENT = 16 _POINTER_ALIGNMENT = 8 _MAX_ALIGNMENT = 16 _ALIGNMENT_REQUIRED = 1 _CHAR_ALIGNMENT ...
apache-2.0
banditlev/meangarden
node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
mit
mpi-sws-rse/thingflow-python
thingflow/filters/take.py
1
2796
# Copyright 2016 by MPI-SWS and Data-Ken Research. # Licensed under the Apache 2.0 License. from thingflow.base import OutputThing, FunctionFilter, FatalError, filtermethod class ArgumentOutOfRangeException(FatalError): pass class SequenceContainsNoElementsError(FatalError): pass @filtermethod(OutputThing) d...
apache-2.0
sjones4/eutester
testcases/cloud_admin/3-2/Euca2264.py
6
2983
''' Created on Oct 29, 2012 @author: mmunn Unit test : EUCA-2264 Binding error when registering image with multiple device mappings. euca-run-instances and euca-register have the same code path This test only checks for this binding error: 412 Pre...
bsd-2-clause
dvm-bitspilani/BITS-BOSM-2015
bosm2015/registration/views.py
2
21319
# -*- coding: utf-8 -*- from registration.forms import UserForm, UserProfileForm from django.template import RequestContext from django.shortcuts import render_to_response, render, redirect from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from registration.models import * from e...
mit
louietsai/python-for-android
python-modules/twisted/twisted/web/test/test_http_headers.py
49
19508
# Copyright (c) 2008-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.http_headers}. """ import sys from twisted.python.compat import set from twisted.trial.unittest import TestCase from twisted.web.http_headers import _DictHeaders, Headers class HeadersTests(TestCase): ...
apache-2.0
fanzhanggoogle/three.js
utils/exporters/blender/addons/io_three/exporter/geometry.py
19
22783
""" Module for creating Three.js geometry JSON nodes. """ import os from .. import constants, logger from . import base_classes, io, api FORMAT_VERSION = 3 class Geometry(base_classes.BaseNode): """Class that wraps a single mesh/geometry node.""" def __init__(self, node, parent=None): logger.debug(...
mit
apfeltee/clearsilver
scripts/document.py
11
9431
#!/usr/bin/env python """ document.py -- Simple script to generate manpages from C header files. Looks for the following formatted C comments in the C header files: /* * Function: my_function - This is my function * Description: My function does the following things, in no particular * or...
bsd-2-clause
HKUST-SING/tensorflow
tensorflow/python/kernel_tests/confusion_matrix_test.py
52
17490
# 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
google/pymql
util/unionfind.py
1
1773
# Copyright 2020 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, ...
apache-2.0
gyang/nova
nova/tests/test_objectstore.py
13
4908
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
disigma/depot_tools
third_party/pylint/utils.py
56
36187
# Copyright (c) 2003-2014 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
bsd-3-clause
karlch/vimiv
tests/vimiv_testcase.py
1
3723
# vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Wrapper of TestCase which sets up the vimiv class and quits it when done.""" import os import time from unittest import TestCase, main from gi import require_version require_version("GdkPixbuf", "2.0") require_version("Gtk", "3.0") from gi.repository import GdkPixb...
mit
ciarams87/PyU4V
PyU4V/tests/unit_tests/test_pyu4v_replication.py
1
33730
# Copyright (c) 2020 Dell Inc. or its subsidiaries. # # 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...
mit
nicday/kala
examples/example_dependent_jobs.py
5
1436
import requests import simplejson import os from time import sleep from datetime import datetime, timedelta from dateutil.tz import tzlocal API_URL = "http://127.0.0.1:8000/api/v1/job/" scheduled_start = datetime.isoformat(datetime.now(tzlocal()) + timedelta(0, 10)) parent_job = { "name": "test_job", "command...
mit
marcosdiez/ansible-modules-extras
cloud/cloudstack/cs_ip_address.py
29
7962
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <darren@iweb.co.uk> # # 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 L...
gpl-3.0
adrienbrault/home-assistant
homeassistant/components/simplisafe/__init__.py
2
25850
"""Support for SimpliSafe alarm systems.""" import asyncio from uuid import UUID from simplipy import API from simplipy.entity import EntityTypes from simplipy.errors import EndpointUnavailable, InvalidCredentialsError, SimplipyError from simplipy.websocket import ( EVENT_CAMERA_MOTION_DETECTED, EVENT_CONNECTI...
mit
codificat/sos
sos/plugins/rpm.py
5
2671
# 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 distributed in the hope that it will be useful, # but...
gpl-2.0
brandon-rhodes/numpy
numpy/lib/stride_tricks.py
5
5179
""" Utilities that manipulate strides to achieve desirable effects. An explanation of strides can be found in the "ndarray.rst" file in the NumPy reference guide. """ from __future__ import division, absolute_import, print_function import numpy as np __all__ = ['broadcast_arrays'] class DummyArray(object): """...
bsd-3-clause
ashmastaflash/gwdetect
dependencies/netaddr-0.7.10/build/lib/netaddr/strategy/ipv4.py
9
9889
#----------------------------------------------------------------------------- # Copyright (c) 2008-2012, David P. D. Moss. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. #----------------------------------------------------------------------------- """IPv4 address logic....
mit
vvuk/servo
tests/wpt/web-platform-tests/tools/py/testing/path/test_svnwc.py
162
19775
import py import os, sys import pytest from py._path.svnwc import InfoSvnWCCommand, XMLWCStatus, parse_wcinfotime from py._path import svnwc as svncommon from svntestbase import CommonSvnTests def test_make_repo(path1, tmpdir): repo = tmpdir.join("repo") py.process.cmdexec('svnadmin create %s' % repo) if s...
mpl-2.0
leiferikb/bitpop-private
content/browser/gpu/generate_webgl_conformance_test_list.py
38
3326
#!/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. """Auto-generates the WebGL conformance test list header file. Parses the WebGL conformance test *.txt file, which contains a list...
bsd-3-clause
crepererum/invenio
invenio/ext/template/context_processor.py
9
4485
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014 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 optio...
gpl-2.0
brian-yang/mozillians
vendor-local/lib/python/tablib/packages/xlwt/antlr.py
57
84201
## This file is part of PyANTLR. See LICENSE.txt for license ## details..........Copyright (C) Wolfgang Haefelinger, 2004. ## This file was copied for use with xlwt from the 2.7.7 ANTLR distribution. Yes, it ## says 2.7.5 below. The 2.7.5 distribution version didn't have a ## version in it. ## Here is the contents of...
bsd-3-clause
esevlogiev/FrontDesk-System
classes/convert_to_class_object.py
1
1456
import sys import os.path sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from classes.room import Room from classes.food import Food from classes.client import Client from classes.bath_items import BathItems from classes.sleeping_furniture import Furniture, SleepingFurniture def convert_ro...
gpl-3.0
marcelocure/django
django/core/management/commands/makemessages.py
108
22869
from __future__ import unicode_literals import fnmatch import glob import io import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.core.management....
bsd-3-clause
michelle/sink
164/rparse.py
1
4441
#!/usr/bin/python '''A small application for invoking the reference parser over its RESTful web interface. ''' import sys import json import webbrowser import pprint import pickle, hashlib from itertools import chain from optparse import OptionParser from os.path import abspath from urllib import urlencode from urllib...
mit
w1ll1am23/home-assistant
tests/components/buienradar/test_camera.py
3
7322
"""The tests for generic camera component.""" import asyncio from contextlib import suppress from aiohttp.client_exceptions import ClientResponseError from homeassistant.const import HTTP_INTERNAL_SERVER_ERROR from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util # An inf...
apache-2.0
mdavid/zulip
tools/deprecated/finbot/monthdelta.py
115
6015
"""monthdelta Date calculation with months: MonthDelta class and monthmod() function. """ __all__ = ['MonthDelta', 'monthmod'] from datetime import date, timedelta class MonthDelta: """Number of months offset from a date or datetime. MonthDeltas allow date calculation without regard to the different length...
apache-2.0
wildchildyn/autism-website
yanni_env/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/enumerated.py
32
11435
# mysql/enumerated.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import re from .types import _StringType from ... import exc, sql, util from .....
gpl-3.0
pypa/setuptools_scm
testing/test_mercurial.py
2
5225
from setuptools_scm import format_version from setuptools_scm.hg import archival_to_version, parse from setuptools_scm import integration from setuptools_scm.config import Configuration from setuptools_scm.utils import has_command import pytest pytestmark = pytest.mark.skipif( not has_command("hg", warn=False), r...
mit
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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...
mit
saimn/astropy
astropy/timeseries/sampled.py
3
16089
# Licensed under a 3-clause BSD style license - see LICENSE.rst from copy import deepcopy import numpy as np from astropy.table import groups, QTable, Table from astropy.time import Time, TimeDelta from astropy import units as u from astropy.units import Quantity, UnitsError from astropy.utils.decorators import depr...
bsd-3-clause
tastynoodle/django
tests/custom_columns/models.py
114
1396
""" 17. Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column name, in API usage. If your database table name is different than your model name, use the ``db_table`` Meta attribute. This has...
bsd-3-clause
hickeroar/project-euler
030/solution033.py
1
1192
""" The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is obtained by cancelling the 9s. We shall consider fractions like, 30/50 = 3/5, to be trivial examples. There are exactly four non-trivial exa...
mit
kamyu104/django
django/contrib/gis/geoip/prototypes.py
535
3943
from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at from django.contrib.gis.geoip.libgeoip import free, lgeoip # #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('cou...
bsd-3-clause
gdg-garage/knihovna-db
knihovna-server/third_party/unidecode/x010.py
252
4110
data = ( 'k', # 0x00 'kh', # 0x01 'g', # 0x02 'gh', # 0x03 'ng', # 0x04 'c', # 0x05 'ch', # 0x06 'j', # 0x07 'jh', # 0x08 'ny', # 0x09 'nny', # 0x0a 'tt', # 0x0b 'tth', # 0x0c 'dd', # 0x0d 'ddh', # 0x0e 'nn', # 0x0f 'tt', # 0x10 'th', # 0x11 'd', # 0x12 'dh', ...
mit
sadanandb/pmt
src/pyasm/prod/checkin/comp_checkin.py
6
5305
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
CredoReference/edx-platform
common/test/acceptance/tests/video/test_studio_video_editor.py
9
21386
# -*- coding: utf-8 -*- """ Acceptance tests for CMS Video Editor. """ import ddt from nose.plugins.attrib import attr from common.test.acceptance.pages.common.utils import confirm_prompt from common.test.acceptance.tests.video.test_studio_video_module import CMSVideoBaseTest @attr(shard=6) @ddt.ddt class VideoEdito...
agpl-3.0
pymedusa/SickRage
ext/chardet/compat.py
270
1134
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Dan Blanchard # Ian Cordasco # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versi...
gpl-3.0
maisim/django-localflavor
tests/test_in.py
4
6387
from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.in_.forms import INAadhaarNumberField, INPhoneNumberField, INStateField, INStateSelect, INZipCodeField class INLocalFlavorTests(SimpleTestCase): def test_INPhoneNumberField(self): error_format = ['Phone numbe...
bsd-3-clause
wallynm/wallynm.github.io
projects/hotmart-academy/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
jasimpson/gnuradio-jasimpson
gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
9
14686
# # Copyright 2005,2006,2007,2009 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 l...
gpl-3.0
superhuahua/xunfengES
server/vulscan/vuldb/crack_mongo.py
4
1215
# coding=utf-8 import socket import binascii def get_plugin_info(): plugin_info = { "name": "MongoDB未授权访问", "info": "导致数据库敏感信息泄露。", "level": "中危", "type": "未授权访问", "author": "wolf@YSRC", "url": "", "keyword": "server:mongodb", "source": 1 } r...
gpl-3.0
ajaybhat/scikit-image
skimage/morphology/__init__.py
11
1373
from .binary import (binary_erosion, binary_dilation, binary_opening, binary_closing) from .grey import (erosion, dilation, opening, closing, white_tophat, black_tophat) from .selem import (square, rectangle, diamond, disk, cube, octahedron, ball, octagon, sta...
bsd-3-clause
yjmade/odoo
addons/google_calendar/google_calendar.py
11
47467
# -*- coding: utf-8 -*- import operator import simplejson import urllib2 import openerp from openerp import tools from openerp import SUPERUSER_ID from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools.translate import _ from openerp.http import request from datetime i...
agpl-3.0
sidzan/netforce
netforce_general/netforce_general/models/address.py
2
5546
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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 # to use, copy, modify, merge, publ...
mit
510908220/lintjenkins
setup.py
1
1757
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'Click>=6.0', # TODO: put pa...
mit
vkroz/kafka
system_test/system_test_runner.py
66
15030
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
seungjin/app5-seungjin-net.appspot.com
django/contrib/comments/templatetags/comments.py
309
11845
from django import template from django.template.loader import render_to_string from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib import comments from django.utils.encoding import smart_unicode register = template.Library() class BaseCommentNode(template.N...
bsd-3-clause