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 |
|---|---|---|---|---|---|
AsherBond/MondocosmOS | grass_trunk/gui/wxpython/gui_modules/prompt.py | 2 | 43896 | """!
@package prompt.py
@brief wxGUI command prompt
Classes:
- PromptListCtrl
- TextCtrlAutoComplete
- GPrompt
- GPromptPopUp
- GPromptSTC
(C) 2009-2011 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for detail... | agpl-3.0 |
zonque/wireshark | tools/dftestlib/time_type.py | 27 | 2938 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# 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.
#
# Th... | gpl-2.0 |
kubikusrubikus/mkdocs | mkdocs/commands/build.py | 21 | 9619 | # coding: utf-8
from __future__ import unicode_literals
from datetime import datetime
import io
import logging
import os
from jinja2.exceptions import TemplateNotFound
import jinja2
import json
from mkdocs import nav, search, utils
from mkdocs.relative_path_ext import RelativePathExtension
import mkdocs
log = loggi... | bsd-2-clause |
ShinyROM/android_external_chromium_org | chrome/tools/build/win/syzygy_instrument.py | 71 | 5079 | #!/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.
"""A utility script to help building Syzygy-instrumented Chrome binaries."""
import glob
import logging
import optparse
import os
... | bsd-3-clause |
fidomason/kbengine | kbe/src/lib/python/Lib/test/test_generators.py | 72 | 50910 | import gc
import sys
import unittest
import weakref
from test import support
class FinalizationTest(unittest.TestCase):
def test_frame_resurrect(self):
# A generator frame can be resurrected by a generator's finalization.
def gen():
nonlocal frame
try:
yie... | lgpl-3.0 |
brokenjacobs/ansible | lib/ansible/plugins/action/ios.py | 25 | 4305 | #
# (c) 2016 Red Hat 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
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
bigswitch/neutron | neutron/plugins/ml2/plugin.py | 1 | 81865 | # Copyright (c) 2013 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 ... | apache-2.0 |
asciimoo/searx | searx/engines/base.py | 2 | 3396 | #!/usr/bin/env python
"""
BASE (Scholar publications)
@website https://base-search.net
@provide-api yes with authorization (https://api.base-search.net/)
@using-api yes
@results XML
@stable ?
@parse url, title, publishedDate, content
More info on api: http://base-search.net/about/downloa... | agpl-3.0 |
kingofsystem/django-allauth | allauth/socialaccount/providers/persona/provider.py | 68 | 1590 | import json
from django.template.loader import render_to_string
from django.template import RequestContext
from django.utils.html import escapejs
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount, Provider
from allauth.account.models import EmailAddress
cla... | mit |
alexsmx/djangoAppengineSrcTemplate | django/conf/locale/mk/formats.py | 251 | 1758 | # -*- 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 = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y. H:i'
YEAR_MONTH_F... | bsd-3-clause |
eamonnmag/hepdata3 | hepdata/modules/submission/api.py | 2 | 2394 | #
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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.
#
# HEPData is... | gpl-2.0 |
helldorado/ansible | lib/ansible/modules/net_tools/nios/nios_mx_record.py | 68 | 4314 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/django/contrib/gis/utils/layermapping.py | 61 | 27125 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
http://geodjango.org/docs/layermapping.html
"""
impo... | apache-2.0 |
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated | python-packages/pyRiemann-0.2.2/build/lib.linux-x86_64-2.7/pyriemann/clustering.py | 2 | 5060 | import numpy
from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin, ClusterMixin
from sklearn.cluster.k_means_ import _init_centroids
from sklearn.externals.joblib import Parallel
from sklearn.externals.joblib import delayed
from .utils.mean import mean_covariance
from .utils.distance import distan... | bsd-3-clause |
BeegorMif/HTPC-Manager | lib/unidecode/x09f.py | 252 | 4509 | data = (
'Cu ', # 0x00
'Qu ', # 0x01
'Chao ', # 0x02
'Wa ', # 0x03
'Zhu ', # 0x04
'Zhi ', # 0x05
'Mang ', # 0x06
'Ao ', # 0x07
'Bie ', # 0x08
'Tuo ', # 0x09
'Bi ', # 0x0a
'Yuan ', # 0x0b
'Chao ', # 0x0c
'Tuo ', # 0x0d
'Ding ', # 0x0e
'Mi ', # 0x0f
'Nai ', # 0x10
'Ding ... | gpl-3.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/skimage/data/_binary_blobs.py | 13 | 1995 | import numpy as np
from ..filters import gaussian
def binary_blobs(length=512, blob_size_fraction=0.1, n_dim=2,
volume_fraction=0.5, seed=None):
"""
Generate synthetic binary image with several rounded blob-like objects.
Parameters
----------
length : int, optional
Linear... | mit |
danielkitta/libsigrokdecode | decoders/z80/pd.py | 15 | 12627 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Daniel Elstner <daniel.kitta@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 3 of... | gpl-3.0 |
sclabs/sccms-nonrel | django/core/management/commands/diffsettings.py | 411 | 1296 | from django.core.management.base import NoArgsCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"Converts a module namespace to a Python dictionary. Used by get_settings_diff."
return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)])
class Command(NoArgsComm... | bsd-3-clause |
theodoregoetz/histogram | test/test_fitting.py | 1 | 3054 | from __future__ import division
import unittest
import numpy as np
from numpy.polynomial.polynomial import Polynomial as poly
from numpy import random as rand
from histogram import Histogram
class TestFitting(unittest.TestCase):
def setUp(self):
rand.seed(1)
def test_1dfit(self):
p = [100,-... | gpl-3.0 |
Tokyo-Buffalo/tokyosouth | env/lib/python3.6/site-packages/twisted/logger/test/test_logger.py | 13 | 6922 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.logger._logger}.
"""
from twisted.trial import unittest
from .._levels import InvalidLogLevelError
from .._levels import LogLevel
from .._format import formatEvent
from .._logger import Logger
from .._global import g... | mit |
DanForever/TimeSync | GAE/lib/requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# 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
# versio... | apache-2.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/eventlet-0.9.14/eventlet/twistedutil/__init__.py | 14 | 2177 | from eventlet.hubs import get_hub
from eventlet import spawn, getcurrent
def block_on(deferred):
cur = [getcurrent()]
synchronous = []
def cb(value):
if cur:
if getcurrent() is cur[0]:
synchronous.append((value, None))
else:
cur[0].switch(valu... | apache-2.0 |
likaiwalkman/elasticsearch | dev-tools/create_bwc_index.py | 60 | 14994 | # Licensed to Elasticsearch under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except... | apache-2.0 |
tardyp/buildbot | master/buildbot/process/log.py | 3 | 5977 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
quintopia/SELECT | selectcodegen.py | 1 | 70000 | # -*- coding: utf-8 -*-
#SELECT. Code Generator v0.6 by Quintopia
# All code-generating functions in this file are right-growing, meaning they make the following guarantees:
# * They do not read or write cells to the left of the current cell at call time.
# * The result that the algorithm computes will be contained in ... | gpl-2.0 |
changev/RackHD | test/benchmark/manipulator.py | 10 | 1059 | from benchmark.utils.ansible_control import ansibleControl
from benchmark.utils.case_recorder import caseRecorder
from benchmark.utils import parser
class manipulator(object):
"""
Class for controlling benchmark data collection process independently
without running any benchmark test cases
"""
def ... | apache-2.0 |
twitter/pants | src/python/pants/java/nailgun_io.py | 1 | 7879 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import io
import os
import select
import threading
from builtins import zip
from contextl... | apache-2.0 |
BansheeMediaPlayer/bockbuild | bockbuild/glickprofile.py | 2 | 1363 | import os
import shutil
from plistlib import Plist
from util.util import *
from unixprofile import UnixProfile
class GlickProfile (UnixProfile):
def __init__ (self):
UnixProfile.__init__ (self)
self.name = 'glick'
self.prefix = '/proc/self/fd/1023'
self.env.set ('BUILD_PREFIX', self.prefix)
self.glick... | mit |
EventGhost/EventGhost | plugins/MediaPlayerClassic/__init__.py | 2 | 106729 | # -*- coding: utf-8 -*-
#
# plugins/MediaPlayerClassic/__init__.py
#
# Copyright (C) 2006 MonsterMagnet
#
# This file is a plugin for EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU... | gpl-2.0 |
splbio/openobject-server | openerp/tools/func.py | 63 | 2118 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can red... | agpl-3.0 |
janelia-idf/elf | tests/filter.py | 4 | 1137 | # -*- coding: utf-8 -*-
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
def update_line(num, data, line):
line.set_data(data[...,:num])
return line,
fig1 = plt.figure()
data = np.random.rand(2, 25)
l, = plt.plot([], [... | bsd-3-clause |
soarpenguin/ansible | test/units/module_utils/facts/test_timeout.py | 118 | 3859 | # -*- coding: utf-8 -*-
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.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
# (a... | gpl-3.0 |
Tehsmash/nova | nova/tests/unit/api/openstack/test_common.py | 38 | 23913 | # Copyright 2010 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 |
SimplyAgree/python-docx | tests/oxml/test_ns.py | 11 | 1750 | # encoding: utf-8
"""
Test suite for docx.oxml.ns
"""
from __future__ import absolute_import, print_function, unicode_literals
import pytest
from docx.oxml.ns import NamespacePrefixedTag
class DescribeNamespacePrefixedTag(object):
def it_behaves_like_a_string_when_you_want_it_to(self, nsptag):
s = '-... | mit |
online-behaviour/find-journalists | getFriends.py | 1 | 1397 | #!/usr/bin/python3
"""
getFriends.py: get ids of users that some user is following
usage: ./getFriends.py screenname
notes: * based on getTweets.py and getFollwers.py
* manual: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-list
20200907 ... | apache-2.0 |
uclouvain/osis | learning_unit/auth/roles/central_manager.py | 1 | 9372 | import rules
from django.utils.translation import gettext_lazy as _
from learning_unit.auth import predicates
from osis_role.contrib import admin as osis_role_admin
from osis_role.contrib import models as osis_role_models
from osis_role.contrib import predicates as osis_role_predicates
class CentralManagerAdmin(osis... | agpl-3.0 |
tarttelin/pyrestmodels | xpath/parser.py | 2 | 17312 | import xpath.expr as X
from xpath.yappsrt import *
from string import *
import re
class XPathScanner(Scanner):
patterns = [
("r'\\:'", re.compile('\\:')),
("r'node'", re.compile('node')),
("r'text'", re.compile('text')),
("r'[^@]comment'", re.compile('[^@]comment')),
("r'p... | bsd-2-clause |
openevacmap/openevac-back | src/routes/stat.py | 1 | 1126 | # -*- coding: utf-8 -*-
'''
Created on 21 janv. 2016
@author: christian
'''
import falcon
import os
import config
import db
class Stat(object):
'''
Get global statistics
'''
def on_get(self, req, resp):
'''Return global statistics
'''
dbc = db.conne... | agpl-3.0 |
torwag/micropython | tests/basics/with_return.py | 82 | 1239 | class CtxMgr:
def __init__(self, id):
self.id = id
def __enter__(self):
print("__enter__", self.id)
return self
def __exit__(self, a, b, c):
print("__exit__", self.id, repr(a), repr(b))
# simple case
def foo():
with CtxMgr(1):
return 4
print(foo())
# for loop ... | mit |
xb446909/personalprojects | crosstool/source/gcc-5.2.0/libstdc++-v3/python/libstdcxx/v6/printers.py | 5 | 52694 | # Pretty-printers for libstdc++.
# Copyright (C) 2008-2015 Free Software Foundation, 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 3 of the License, or
# (at your option)... | gpl-2.0 |
Cuuuurzel/KiPyCalc | sympy/printing/tests/test_str.py | 12 | 22477 | from __future__ import division
from sympy import (Abs, Catalan, cos, Derivative, E, EulerGamma, exp,
factorial, factorial2, Function, GoldenRatio, I, Integer, Integral,
Interval, Lambda, Limit, Matrix, nan, O, oo, pi, Rational, Float, Rel,
S, sin, SparseMatrix, sqrt, summation, Sum, Symbol, symbols, Wild,... | mit |
muadibbm/gini | frontend/src/gbuilder/UI/Configuration.py | 6 | 30107 | """The configuration window and options"""
import sys, os, random
from PyQt4 import QtCore, QtGui
from Core.globals import *
class LineEdit(QtGui.QLineEdit):
def __init__(self, text=QtCore.QString()):
"""
Create a custom LineEdit so that the context menu is visible.
"""
QtGui.QLine... | mit |
TCAllen07/raspi-device-mocks | test_example.py | 1 | 2179 | #!/usr/bin/env python
__author__ = 'Trevor Allen'
## Standard Library
pass
## Non-Standard Imports
import nose.tools as nt
from nose.tools import raises
# If you don't use nose, you can simply replace the assertions below
## Custom Modules
from rpidevmocks import MockSMBus, MockGPIO, Mock_smbusModule
from display_... | gpl-2.0 |
Donkyhotay/MoonPy | twisted/test/test_dirdbm.py | 61 | 6016 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for dirdbm module.
"""
import os, shutil, glob
from twisted.trial import unittest
from twisted.persisted import dirdbm
class DirDbmTestCase(unittest.TestCase):
def setUp(self):
self.path = self.mktemp()
... | gpl-3.0 |
xHeliotrope/injustice_dropper | env/lib/python3.4/site-packages/django/core/files/uploadhandler.py | 102 | 6899 | """
Base file upload handler classes, and the built-in concrete subclasses
"""
from __future__ import unicode_literals
from io import BytesIO
from django.conf import settings
from django.core.files.uploadedfile import (
InMemoryUploadedFile, TemporaryUploadedFile,
)
from django.utils.encoding import python_2_uni... | mit |
aurelijusb/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/iso8859_16.py | 593 | 13813 | """ Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.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_table)
def decode(self,input,errors... | apache-2.0 |
pacoqueen/bbinn | PyChart-1.39/pychart/afm/NewCenturySchlbk_Roman.py | 12 | 1504 | # AFM font NewCenturySchlbk-Roman (path: /usr/share/fonts/afms/adobe/pncr8a.afm).
# Derived from Ghostscript distribution.
# Go to www.cs.wisc.edu/~ghost to get the Ghostcript source code.
import dir
dir.afm["NewCenturySchlbk-Roman"] = (500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500... | gpl-2.0 |
rev2004/android2cloud.app-engine | google_appengine/lib/django/django/db/models/manager.py | 33 | 4145 | from django.db.models.query import QuerySet, EmptyQuerySet
from django.dispatch import dispatcher
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
# Size of each "chunk" for get_iterator calls.
# Larger values are slightly faster at the expense of more storage space.
GET_ITERA... | mit |
PUNCH-Cyber/stoq-plugins-public | opswat/opswat/opswat.py | 1 | 3956 | #!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | apache-2.0 |
zcking/Pynny | mysite/pynny/views/main_views.py | 1 | 2685 | #!/usr/bin/python3
'''
File: main_views.py
Author: Zachary King
Implements the main site views (endpoint handlers) for the Pynny web app.
'''
from django.shortcuts import render, reverse, redirect
from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from datetime import d... | mit |
schleichdi2/OPENNFR-6.0-CORE | bitbake/lib/toaster/tests/browser/test_builddashboard_page.py | 4 | 13169 | #! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | gpl-2.0 |
h3llrais3r/Auto-Subliminal | lib/git/remote.py | 1 | 35554 | # remote.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
# Module implementing a remote object allowing easy access to git remotes
import logging
import re
f... | gpl-3.0 |
cmvelo/ansible-modules-extras | windows/win_regedit.py | 91 | 2856 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Adam Keech <akeech@chathamfinancial.com>, Josh Ludwig <jludwig@chathamfinancial.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 Fr... | gpl-3.0 |
jb090979/pyfranca | setup.py | 2 | 1225 | #!/usr/bin/env python
"""
Pyfranca setup script.
"""
import os
import re
from setuptools import setup, find_packages
def read_package_variable(key):
fspec = os.path.join("pyfranca", "__init__.py")
with open(fspec) as f:
for line in f:
m = re.match(r"(\S+)\s*=\s*[\"']?(.+?)[\"']?\s*$", lin... | mit |
iluxa-com/mercurial-crew-tonfa | mercurial/revlog.py | 1 | 48523 | # revlog.py - storage back-end for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""Storage back-end for Mercurial.
This provides efficient delta storage with O(1... | gpl-2.0 |
svanschalkwyk/datafari | windows/python/Lib/distutils/msvccompiler.py | 250 | 23637 | """distutils.msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""
# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
# finding DevStudio (through the registry)
__revision__ = "$Id$"
import sys
import os
im... | apache-2.0 |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/django/views/csrf.py | 49 | 5750 | from django.conf import settings
from django.http import HttpResponseForbidden
from django.template import Context, Engine, TemplateDoesNotExist, loader
from django.utils.translation import ugettext as _
from django.utils.version import get_docs_version
# We include the template inline since we need to be able to reli... | apache-2.0 |
sebdelsol/pyload | module/gui/AccountEdit.py | 41 | 3152 | # -*- coding: utf-8 -*-
"""
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 3 of the License,
or (at your option) any later version.
This program is distributed in ... | gpl-3.0 |
Beauhurst/django | tests/file_uploads/tests.py | 45 | 23742 | import base64
import hashlib
import os
import shutil
import sys
import tempfile as sys_tempfile
import unittest
from io import BytesIO, StringIO
from urllib.parse import quote
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser i... | bsd-3-clause |
FrancescoRizzi/AWSomesauce | articles/BAS4-pws/libs-for-aws/cffi/vengine_gen.py | 19 | 26597 | #
# DEPRECATED: implementation for ffi.verify()
#
import sys, os
import types
from . import model
from .error import VerificationError
class VGenericEngine(object):
_class_key = 'g'
_gen_python_module = False
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
... | mit |
Debian/britney2 | tests/__init__.py | 1 | 15973 | # This file is merged from Debian's tests and Ubuntu's autopktest implementation
# For Ubuntu's part Canonical is the original copyright holder.
#
# (C) 2015 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | gpl-2.0 |
rajashreer7/autotest-client-tests | linux-tools/perl_Date_Calc/perl_Date_Calc.py | 4 | 1281 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class perl_Date_Calc(test.test):
"""
Autotest module for testing basic functionality
of perl_Date_Calc
@author Basheer K<bkhadars@in.ibm.com> ... | gpl-2.0 |
kiddinn/plaso | plaso/formatters/winevt_rc.py | 4 | 11064 | # -*- coding: utf-8 -*-
"""Windows Event Log resources database reader."""
import re
import sqlite3
# TODO: Move the generic sqlite3 code to a different spot e.g. lib/.
class Sqlite3DatabaseFile(object):
"""Class that defines a sqlite3 database file."""
_HAS_TABLE_QUERY = (
'SELECT name FROM sqlite_master... | apache-2.0 |
UltrosBot/Ultros | system/storage/data.py | 1 | 27218 | # coding=utf-8
"""
A bunch of classes for working with data.
These are to be used in your plugins. There's several different ones to
choose from, each will store data using a different format and sometimes
method. There are, so far, three types of data storage, encapsulating a bunch
of classes.
* Key-value (Diction... | artistic-2.0 |
ddico/odoomrp-wip | product_purchase_warrant/models/stock.py | 29 | 2973 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# 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 3 of the Licen... | agpl-3.0 |
balloob/home-assistant | tests/components/filesize/test_sensor.py | 5 | 2874 | """The tests for the filesize sensor."""
import os
import pytest
from homeassistant import config as hass_config
from homeassistant.components.filesize import DOMAIN
from homeassistant.components.filesize.sensor import CONF_FILE_PATHS
from homeassistant.const import SERVICE_RELOAD
from homeassistant.setup import asyn... | apache-2.0 |
40223117cda/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/csv.py | 637 | 16166 |
"""
csv.py - read/write/investigate CSV files
"""
import re
from _csv import Error, __version__, writer, reader, register_dialect, \
unregister_dialect, get_dialect, list_dialects, \
field_size_limit, \
QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \
... | gpl-3.0 |
kartikp1995/gnuradio | gr-digital/examples/narrowband/receive_path.py | 15 | 6019 | #!/usr/bin/env python
#
# Copyright 2005-2007,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 you... | gpl-3.0 |
jan-randis/php-db2-mysql-buildpack | lib/yaml/constructor.py | 391 | 25145 |
__all__ = ['BaseConstructor', 'SafeConstructor', 'Constructor',
'ConstructorError']
from error import *
from nodes import *
import datetime
import binascii, re, sys, types
class ConstructorError(MarkedYAMLError):
pass
class BaseConstructor(object):
yaml_constructors = {}
yaml_multi_constructors =... | apache-2.0 |
sgzsh269/django | tests/auth_tests/test_middleware.py | 135 | 1247 | from django.contrib.auth.middleware import AuthenticationMiddleware
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
class TestAuthenticationMiddleware(TestCase):
def setUp(self):
self.user = User.objects.create_user('test_user', 'test@exampl... | bsd-3-clause |
prologic/compose | compose/cli/docopt_command.py | 42 | 1679 | from __future__ import unicode_literals
from __future__ import absolute_import
import sys
from inspect import getdoc
from docopt import docopt, DocoptExit
def docopt_full_help(docstring, *args, **kwargs):
try:
return docopt(docstring, *args, **kwargs)
except DocoptExit:
raise SystemExit(docst... | apache-2.0 |
chrisenuf/fullerite | src/diamond/collectors/ceph/test/testceph.py | 60 | 7717 | #!/usr/bin/python
# coding=utf-8
try:
import json
except ImportError:
import simplejson as json
import subprocess
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import patch, call
from diamond.collector import Collector
... | apache-2.0 |
VigTech/Vigtech-Services | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | lgpl-3.0 |
zhenzhai/edx-platform | common/lib/capa/capa/tests/test_util.py | 47 | 5662 | """
Tests capa util
"""
import unittest
from lxml import etree
from . import test_capa_system
from capa.util import compare_with_tolerance, sanitize_html, get_inner_html_from_xpath
class UtilTest(unittest.TestCase):
"""Tests for util"""
def setUp(self):
super(UtilTest, self).setUp()
self.syst... | agpl-3.0 |
pinax/django-user-accounts | account/forms.py | 1 | 7794 | import re
from collections import OrderedDict
from django import forms
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as _
from account.conf import settings
from account.hooks import hookset
f... | mit |
disaster37/tomcat_docker | assets/test_init.py | 1 | 1247 | #!/usr/bin/python
import unittest
import os
import init
class InitTestCase(unittest.TestCase):
"""Tests for `init.py`."""
@classmethod
def setUpClass(self):
print("Settup unit test \n")
init.TOMCAT_HOME = "/tmp/tomcat_docker"
os.system("mkdir -p /tmp/tomcat_docker/conf")
os.syste... | gpl-2.0 |
tectronics/cortex-vfx | test/IECore/TimeCodeDataTest.py | 12 | 7922 | ##########################################################################
#
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | bsd-3-clause |
KlubJagiellonski/poznaj-app-backend | poznaj/stories/filters.py | 1 | 1086 | from django.contrib.gis.geos import GEOSGeometry
from rest_framework import filters
from rest_framework.exceptions import ValidationError
WRONG_LAT_LONG_TEXT = 'Provide float for latitude and longitude'
class FirstPointFilter(filters.BaseFilterBackend):
def filter_queryset(self, request, queryset, view):
... | apache-2.0 |
radlab/sparrow | deploy/third_party/boto-2.1.1/boto/handler.py | 38 | 1849 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | apache-2.0 |
satishgoda/bokeh | bokeh/server/services.py | 29 | 2719 | from __future__ import absolute_import
import json
import os
import signal
import subprocess
import sys
class ManagedProcess(object):
def __init__(self, args, name, pidfilename,
stdout=None, stdin=None, stderr=None,
kill_old=True):
self.name = name
self.pidfilenam... | bsd-3-clause |
saleemjaveds/https-github.com-openstack-nova | nova/tests/virt/xenapi/test_volumeops.py | 15 | 24047 | # Copyright (c) 2012 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 ... | apache-2.0 |
safwanrahman/kitsune | kitsune/search/models.py | 3 | 12394 | import datetime
import logging
from threading import local
from django.conf import settings
from django.core import signals
from django.db import models
from django.db.models.signals import pre_delete, post_save, m2m_changed
from django.dispatch import receiver
from elasticutils.contrib.django import MappingType, Ind... | bsd-3-clause |
Carreau/pytest | testing/python/metafunc.py | 11 | 31510 |
import pytest, py
from _pytest import python as funcargs
class TestMetafunc:
def Metafunc(self, func):
# the unit tests of this class check if things work correctly
# on the funcarg level, so we don't need a full blown
# initiliazation
class FixtureInfo:
name2fixturedef... | mit |
galaxy-team/website | newrelic/api/import_hook.py | 1 | 2852 | import sys
import imp
_import_hooks = {}
def register_import_hook(name, callable):
imp.acquire_lock()
try:
hooks = _import_hooks.get(name, None)
if not name in _import_hooks or hooks is None:
# If no entry in registry or entry already flagged with
# None then module ... | agpl-3.0 |
fearthecowboy/pygments | Pygments/pygments-lib/pygments/lexers/dotnet.py | 26 | 27304 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dotnet
~~~~~~~~~~~~~~~~~~~~~~
Lexers for .net languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, DelegatingLexer, bygroups, include, ... | bsd-2-clause |
Flight/django-filer | filer/south_migrations/0005_auto__add_field_file_sha1__chg_field_file_file.py | 68 | 10525 | # 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 'File.sha1'
db.add_column('filer_file', 'sha1', self.gf('django.db.models.fields.CharField'... | bsd-3-clause |
mommermi/photometrypipeline | pp_photometry.py | 2 | 20265 | #!/usr/bin/env python3
""" PP_PHOTOMETRY - run curve-of-growth analysis on image files,
identify optimum aperture radius, and redo photometry
v1.0: 2015-12-30, mommermiscience@gmail.com
"""
# Photometry Pipeline
# Copyright (C) 2016-2018 Michael Mommert, mommermiscience@gmail.com
# This prog... | gpl-3.0 |
TangXT/edx-platform | common/djangoapps/dark_lang/migrations/0001_initial.py | 53 | 4800 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DarkLangConfig'
db.create_table('dark_lang_darklangconfig', (
('id', self.gf('dj... | agpl-3.0 |
kaplun/invenio | modules/miscutil/lib/upgrades/invenio_2013_03_18_wapCACHE_object_value_longblob.py | 18 | 1363 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
hubert667/AIR | build/celery/build/lib.linux-i686-2.7/celery/tests/security/test_security.py | 8 | 3845 | """
Keys and certificates for tests (KEY1 is a private key of CERT1, etc.)
Generated with:
.. code-block:: bash
$ openssl genrsa -des3 -passout pass:test -out key1.key 1024
$ openssl req -new -key key1.key -out key1.csr -passin pass:test
$ cp key1.key key1.key.org
$ openssl rsa -in key1.key.org -out ... | gpl-3.0 |
MostafaGazar/tensorflow | tensorflow/python/kernel_tests/cast_op_test.py | 11 | 7835 | # 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 |
helldorado/ansible | test/runner/lib/pytar.py | 15 | 2764 | """Python native TGZ creation."""
from __future__ import absolute_import, print_function
import abc
import tarfile
import os
from lib.util import (
display,
ABC,
)
from lib.constants import (
TIMEOUT_PATH,
)
# improve performance by disabling uid/gid lookups
tarfile.pwd = None
tarfile.grp = None
clas... | gpl-3.0 |
anant-dev/django | tests/delete/tests.py | 222 | 18346 | from __future__ import unicode_literals
from math import ceil
from django.db import IntegrityError, connection, models
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.utils.six.moves import range
from .models import... | bsd-3-clause |
nlloyd/SubliminalCollaborator | libs/twisted/trial/unittest.py | 5 | 62696 | # -*- test-case-name: twisted.trial.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Things likely to be used by writers of unit tests.
Maintainer: Jonathan Lange
"""
import doctest, inspect
import os, warnings, sys, tempfile, gc, types
from pprint import pformat
from dis import ... | apache-2.0 |
oihane/odoo | openerp/tools/convert.py | 205 | 41282 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
dylanleong/mysite | userprofile/models.py | 1 | 1670 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class UserProfile(models.Model):
user = models.OneToOneField(User)
dob = models.DateField(blank=True, null=True)
ip = models.GenericIPAddressField(blank=True, null=True)
ip_city = models.CharField(max_... | mit |
johnkeepmoving/oss-ftp | python27/win32/Lib/encodings/cp437.py | 593 | 34820 | """ Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.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... | mit |
GoogleCloudPlatform/ml-on-gcp | example_zoo/tensorflow/models/mnist/official/utils/flags/_conventions.py | 9 | 1694 | # 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 |
singleswitch/ticker | ticker_layout.py | 1 | 32970 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ticker_layout.ui'
#
# Created: Tue Mar 26 12:40:36 2013
# by: PyQt4 UI code generator 4.7.2
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, Ma... | mit |
bhaskar24/ns_3_dev_RARED | src/traffic-control/test/examples-to-run.py | 29 | 2345 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.