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 |
|---|---|---|---|---|---|
lbeltrame/bcbio-nextgen | bcbio/ngsalign/star.py | 2 | 14590 | import os
import sys
import shutil
import subprocess
import contextlib
from collections import namedtuple
import bcbio.bed as bed
from bcbio.pipeline import config_utils
from bcbio.distributed.transaction import file_transaction, tx_tmpdir
from bcbio.utils import (safe_makedir, file_exists, is_gzipped)
from bcbio.prov... | mit |
francisco-dlp/hyperspy | hyperspy/tests/__init__.py | 4 | 1870 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
sdgdsffdsfff/QConf | test/unit/gtest/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-2-clause |
dablak/boto | boto/resultset.py | 20 | 6557 | # 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... | mit |
windinthew/audacity | lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/Logs.py | 196 | 4755 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,traceback,sys
_nocolor=os.environ.get('NOCOLOR','no')not in('no','0','false')
try:
if not _nocolor:
import waflib.ansiterm
except ImportError:
pass
try:
impo... | gpl-2.0 |
bob-white/UnityIronPythonConsole | Assets/IronPythonConsole/Plugins/Lib/repr.py | 417 | 4296 | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr","repr"]
import __builtin__
from itertools import islice
class Repr:
def __init__(self):
self.maxlevel = 6
self.maxtuple = 6
self.maxlist = 6
self.maxarray = 5
self.maxdict = 4
... | mpl-2.0 |
matt-bernhardt/trapp | trapp/check_games.py | 1 | 1339 | # -*- coding: utf-8 -*-
from trapp.checker import Checker
from trapp.competition import Competition
class CheckerGames(Checker):
def reviewCompetition(self, competition, year):
self.log.message('Reviewing competition ' + str(competition))
# Get years this competition was held
sql = ("SEL... | gpl-2.0 |
jorik041/plaso | plaso/parsers/winreg_plugins/mrulistex.py | 1 | 18044 | # -*- coding: utf-8 -*-
"""This file contains MRUListEx Windows Registry plugins."""
import abc
import logging
import construct
from plaso.events import windows_events
from plaso.lib import binary
from plaso.parsers import winreg
from plaso.parsers.shared import shell_items
from plaso.parsers.winreg_plugins import i... | apache-2.0 |
MangoMangoDevelopment/neptune | lib/std_msgs-0.5.10/gen/_Duration.py | 2 | 3637 | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from std_msgs/Duration.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import genpy
class Duration(genpy.Message):
_md5sum = "3e286caf4241d664e55f3ad380e2ae46"
_type ... | bsd-3-clause |
kivio/pysllo | docs/conf.py | 2 | 9751 | # -*- coding: utf-8 -*-
#
# Pysllo documentation build configuration file, created by
# sphinx-quickstart on Tue May 31 19:45:48 2016.
#
# 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.
#
# Al... | bsd-3-clause |
cgcgbcbc/django-xadmin | xadmin/plugins/chart.py | 17 | 5683 |
import datetime
import decimal
import calendar
from django.template import loader
from django.http import HttpResponseNotFound
from django.core.serializers.json import DjangoJSONEncoder
from django.http import HttpResponse
from django.utils.encoding import smart_unicode
from django.db import models
from django.utils.... | bsd-3-clause |
omarkhan/ansible-modules-core | cloud/google/gce_pd.py | 130 | 9532 | #!/usr/bin/python
# Copyright 2013 Google 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 vers... | gpl-3.0 |
pfmooney/dd-agent | checks.d/mesos.py | 22 | 5151 | # stdlib
from hashlib import md5
import time
# 3rd party
import requests
# project
from checks import AgentCheck
class Mesos(AgentCheck):
SERVICE_CHECK_NAME = "mesos.can_connect"
def check(self, instance):
"""
DEPRECATED:
This generic Mesosphere check is deprecated not actively deve... | bsd-3-clause |
40223137/cdag7test37 | static/Brython3.1.3-20150514-095342/Lib/weakref.py | 769 | 11495 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | gpl-3.0 |
cloudwork/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Scanner/Fortran.py | 61 | 14347 | """SCons.Scanner.Fortran
This module implements the dependency scanner for Fortran code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentati... | apache-2.0 |
LordDamionDevil/Lony | lib/discord/member.py | 14 | 8164 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
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 u... | gpl-3.0 |
JeffsFernandes/cuidando2 | projeto/projeto/views.py | 2 | 32828 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyramid.view import view_config
from .models import Cidadao, Cidadao_twitter,Atividade, Atividade_cidadao, Atividade_orcamento, Dados_site, Midia, Midia_comentario, Midia_video, Denuncia, Midia_foto
#from .models import Cidadao, UsrTree, Atividade_cidadao
#from .model... | gpl-3.0 |
jalavik/invenio | invenio/modules/upgrader/upgrades/invenio_2013_06_20_new_bibcheck_rules_table.py | 15 | 1210 | # -*- 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) any later... | gpl-2.0 |
FireWRT/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_signal.py | 79 | 33870 | import unittest
from test import support
from contextlib import closing
import gc
import pickle
import select
import signal
import struct
import subprocess
import traceback
import sys, os, time, errno
from test.script_helper import assert_python_ok, spawn_python
try:
import threading
except ImportError:
threadi... | gpl-2.0 |
harryliu/edwin | edwinAgent/site_packages/dbRowFactory/pyDbRowFactory.py | 4 | 14255 | # -*- coding: utf-8 -*-
'''
#@summary: DbRowFactory is one common factory to convert db row tuple into user-defined class object.
It is supported SqlAlchemy, and any database modules conformed to Python Database API
Specification v2.0. e.g. cx_Oracle, zxJDBC
#@note:
Note 1: The DbRowFactory wil... | apache-2.0 |
spierepf/mpf | mpf/modes/tilt/code/tilt.py | 1 | 7456 | """Contains the Tilt mode code"""
# tilt.py
# Mission Pinball Framework
# Written by Brian Madden & Gabe Knuth
# Released under the MIT License. (See license info at the end of this file.)
# Documentation and more info at http://missionpinball.com/mpf
from mpf.system.config import CaseInsensitiveDict
from mpf.system... | mit |
jkleckner/ansible | docsite/conf.py | 3 | 6348 | # -*- coding: utf-8 -*-
#
# documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleab... | gpl-3.0 |
wlanslovenija/django-tastypie | tastypie/throttle.py | 5 | 4861 | from __future__ import unicode_literals
import time
from django.core.cache import cache
class BaseThrottle(object):
"""
A simplified, swappable base class for throttling.
Does nothing save for simulating the throttling API and implementing
some common bits for the subclasses.
Accepts a number of... | bsd-3-clause |
keyurpatel076/MissionPlannerGit | packages/IronPython.StdLib.2.7.4/content/Lib/timeit.py | 76 | 12059 | #! /usr/bin/env python
"""Tool for measuring execution time of small code snippets.
This module avoids a number of common traps for measuring execution
times. See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Command line ... | gpl-3.0 |
kuredatan/taxocluster | featuresVector.py | 2 | 2904 | import sys as s
from parsingMatch import parseAllFact
from parsingFasta import parseFasta
def sanitizeNode(node):
if not node or not (len(node) == 2):
#It means this node cannot appear in the taxonomic tree
return None
else:
return node
#@allMatches is a dictionary of (key=sa... | mit |
opencloudinfra/orchestrator | venv/Lib/distutils/__init__.py | 1211 | 3983 | import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
dirname = os.path.dirname
distutils_path = o... | gpl-3.0 |
vmarkovtsev/django | tests/modeladmin/models.py | 130 | 1603 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateFiel... | bsd-3-clause |
wreckJ/intellij-community | python/helpers/pydev/runfiles.py | 43 | 10205 | import os
def main():
import sys
#Separate the nose params and the pydev params.
pydev_params = []
other_test_framework_params = []
found_other_test_framework_param = None
NOSE_PARAMS = '--nose-params'
PY_TEST_PARAMS = '--py-test-params'
for arg in sys.argv[1:]:
if not found_... | apache-2.0 |
jzbontar/orange-tree | Orange/canvas/gui/splashscreen.py | 16 | 3975 | """
A splash screen widget with support for positioning of the message text.
"""
from PyQt4.QtGui import (
QSplashScreen, QWidget, QPixmap, QPainter, QTextDocument,
QTextBlockFormat, QTextCursor, QApplication
)
from PyQt4.QtCore import Qt
from .utils import is_transparency_supported
class SplashScreen(QSp... | gpl-3.0 |
Andrew-McNab-UK/DIRAC | tests/Integration/DataManagementSystem/FC_scaling_test.py | 3 | 10751 | ########################################################################
# File : FC_Scaling_test
# Author : Andrei Tsaregorodtsev
########################################################################
"""
Test suite for a generic File Catalog scalability tests
"""
__RCSID__ = "$Id$"
from DIRAC.Core.Base impor... | gpl-3.0 |
trabacus-softapps/openerp-8.0-cc | openerp/addons/survey/wizard/survey_print_statistics.py | 4 | 1888 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
FFMG/myoddweb.piger | monitor/api/python/Python-3.7.2/Lib/test/test_int_literal.py | 21 | 7053 | """Test correct treatment of hex/oct constants.
This is complex because of changes due to PEP 237.
"""
import unittest
class TestHexOctBin(unittest.TestCase):
def test_hex_baseline(self):
# A few upper/lowercase tests
self.assertEqual(0x0, 0X0)
self.assertEqual(0x1, 0X1)
self.ass... | gpl-2.0 |
androomerrill/scikit-nano | sknano/generators/__init__.py | 2 | 1771 | # -*- coding: utf-8 -*-
"""
======================================================================
Structure generators (:mod:`sknano.generators`)
======================================================================
.. currentmodule:: sknano.generators
Contents
========
Nanostructure generators
-------------------... | bsd-2-clause |
v-iam/azure-sdk-for-python | azure-batch/azure/batch/models/node_file.py | 3 | 1414 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Zhongqilong/kbengine | kbe/src/lib/python/Lib/distutils/spawn.py | 81 | 7514 | """distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
import sys
import os
from distutils.errors import DistutilsPlatformError, D... | lgpl-3.0 |
andela-ifageyinbo/django | tests/generic_relations_regress/tests.py | 300 | 11453 | from django.db.models import Q, Sum
from django.db.models.deletion import ProtectedError
from django.db.utils import IntegrityError
from django.forms.models import modelform_factory
from django.test import TestCase, skipIfDBFeature
from .models import (
A, B, C, D, Address, Board, CharLink, Company, Contact, Conte... | bsd-3-clause |
awkspace/ansible | lib/ansible/modules/network/onyx/onyx_mlag_ipl.py | 118 | 6779 | #!/usr/bin/python
#
# Copyright: Ansible Project
# 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 |
alexandrucoman/vbox-nova-driver | nova/tests/functional/v3/test_pci.py | 8 | 7468 | # Copyright 2013 Intel.
#
# 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 i... | apache-2.0 |
hcasse/elfmake | elfmake/recipe.py | 1 | 6836 | """Classes used to represent recipes."""
import env
import action
import io
import os
import os.path
import sys
file_db = { } # file database
ext_db = { } # extension database
# base classes
class File(env.MapEnv):
"""Representation of files."""
path = None
recipe = None
is_goal = False
is_target = False
is_... | gpl-3.0 |
wkschwartz/django | tests/gis_tests/test_spatialrefsys.py | 17 | 5332 | import re
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature
from django.utils.functional import cached_property
test_srs = ({
'srid': 4326,
'auth_name': ('EPSG', True),
'auth_srid': 4326,
# Only the beginning, because there are differences depending on installed li... | bsd-3-clause |
orezpraw/gensim | gensim/test/test_miislita.py | 83 | 3928 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module replicates the miislita vector spaces from
"A Linear Algebra Approach to the Vector Space Model -- A Fast Track Tutorial"
by Dr. E. Garcia, admin@miislita.com
See http://www.miisl... | gpl-3.0 |
gangadharkadam/v4_erp | erpnext/setup/doctype/backup_manager/backup_dropbox.py | 41 | 4776 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# SETUP:
# install pip install --upgrade dropbox
#
# Create new Dropbox App
#
# in conf.py, set oauth2 settings
# dropbox_access_key
# dropbox_access_secret
from __future__ import unicode_... | agpl-3.0 |
btnpushnmunky/cupcake | monsters.py | 1 | 1918 | import pygame
import os
from random import randint
UP = 3
DOWN = 7
RIGHT = 5
LEFT = 9
EXEC_DIR = os.path.dirname(__file__)
class Monster(pygame.sprite.Sprite):
""" This is our main monster class """
def __init__(self, initial_position, type, direction):
pygame.sprite.Sprite.__init__(self)
self... | mit |
julien78910/CouchPotatoServer | libs/rtorrent/rpc/__init__.py | 158 | 10775 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# 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, ... | gpl-3.0 |
amir-qayyum-khan/edx-platform | common/djangoapps/request_cache/middleware.py | 9 | 3741 | """
An implementation of a RequestCache. This cache is reset at the beginning
and end of every request.
"""
import crum
import threading
class _RequestCache(threading.local):
"""
A thread-local for storing the per-request cache.
"""
def __init__(self):
super(_RequestCache, self).__init__()
... | agpl-3.0 |
pikeBishop/OMP_gpxReport | examples/geopy/geocoders/opencage.py | 13 | 7091 | """
:class:`.OpenCage` is the Opencagedata geocoder.
"""
from geopy.compat import urlencode
from geopy.geocoders.base import Geocoder, DEFAULT_TIMEOUT, DEFAULT_SCHEME
from geopy.exc import (
GeocoderQueryError,
GeocoderQuotaExceeded,
)
from geopy.location import Location
from geopy.util import logger
__all__... | gpl-2.0 |
atiqueahmedziad/addons-server | src/olympia/legacy_discovery/views.py | 2 | 2723 | from django.db.transaction import non_atomic_requests
from django.forms.models import modelformset_factory
from django.shortcuts import redirect
from olympia import amo
from olympia.amo.utils import render
from olympia.zadmin.decorators import admin_required
from .forms import DiscoveryModuleForm
from .models import ... | bsd-3-clause |
TomBaxter/osf.io | osf/models/tag.py | 28 | 1187 | from django.db import models
from .base import BaseModel
class TagManager(models.Manager):
"""Manager that filters out system tags by default.
"""
def get_queryset(self):
return super(TagManager, self).get_queryset().filter(system=False)
class Tag(BaseModel):
name = models.CharField(db_inde... | apache-2.0 |
rprata/boost | tools/build/src/util/set.py | 49 | 1240 | # (C) Copyright David Abrahams 2001. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
from utility... | gpl-2.0 |
Lujeni/ansible | lib/ansible/modules/network/cloudengine/ce_interface_ospf.py | 8 | 30951 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
christoph-buente/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_test_utils.py | 227 | 10685 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
signed/intellij-community | python/helpers/py3only/docutils/languages/da.py | 50 | 1872 | # -*- coding: utf-8 -*-
# $Id: da.py 7678 2013-07-03 09:57:36Z milde $
# Author: E D
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each... | apache-2.0 |
elit3ge/SickRage | lib/sqlalchemy/orm/mapper.py | 75 | 108686 | # orm/mapper.py
# Copyright (C) 2005-2014 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
"""Logic to map Python classes to and from selectables.
Defines the :class:`~sqlalchemy... | gpl-3.0 |
iamdankaufman/beets | beetsplug/info.py | 2 | 2210 | # This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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, ... | mit |
anaruse/chainer | tests/chainer_tests/functions_tests/pooling_tests/test_max_pooling_nd.py | 1 | 12854 | import unittest
import functools
import math
import numpy
from operator import mul
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chaine... | mit |
brennanblue/svgplotlib | svgplotlib/Bar.py | 2 | 6406 | #!python -u
# -*- coding: utf-8 -*-
import sys
import itertools
from svgplotlib import Base
class Bar(Base):
"""
Simple vertical bar plot
Example::
graph = Bar(
(10,50,100),
width = 1000, height = 500,
titleColor = 'blue',
title = 'Simple b... | bsd-3-clause |
fiji-flo/servo | tests/wpt/web-platform-tests/webdriver/tests/contexts/maximize_window.py | 11 | 8104 | # META: timeout=long
from tests.support.asserts import assert_error, assert_dialog_handled, assert_success
from tests.support.fixtures import create_dialog
from tests.support.inline import inline
alert_doc = inline("<script>window.alert()</script>")
def maximize(session):
return session.transport.send("POST", ... | mpl-2.0 |
nthiep/global-ssh-server | lib/python2.7/site-packages/django/contrib/gis/db/models/manager.py | 505 | 3578 | from django.db.models.manager import Manager
from django.contrib.gis.db.models.query import GeoQuerySet
class GeoManager(Manager):
"Overrides Manager to return Geographic QuerySets."
# This manager should be used for queries on related fields
# so that geometry columns on Oracle and MySQL are selected
... | agpl-3.0 |
code4futuredotorg/reeborg_tw | src/libraries/Brython3.2.3/Lib/encodings/iso8859_10.py | 272 | 13589 | """ Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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... | agpl-3.0 |
xolox/python-deb-pkg-tools | deb_pkg_tools/config.py | 1 | 2091 | # Debian packaging tools: Configuration defaults.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: February 6, 2020
# URL: https://github.com/xolox/python-deb-pkg-tools
"""Configuration defaults for the `deb-pkg-tools` package."""
# Standard library modules.
import os
# External dependencies.
from hum... | mit |
40223114/2015_g4 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/sprite.py | 603 | 55779 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; e... | gpl-3.0 |
charukiewicz/beer-manager | venv/lib/python3.4/site-packages/pip/commands/__init__.py | 476 | 2236 | """
Package containing all pip commands
"""
from pip.commands.bundle import BundleCommand
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchComman... | mit |
jpirko/lnst | lnst/Recipes/ENRT/VirtualOvsBridgeVlansOverBondRecipe.py | 1 | 7385 | import logging
from itertools import product
from lnst.Common.Parameters import Param, IntParam, StrParam
from lnst.Common.IpAddress import ipaddress
from lnst.Controller import HostReq, DeviceReq, RecipeParam
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConf... | gpl-2.0 |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/googlecloudapis/bigquery/v2/bigquery_v2_client.py | 4 | 27379 | """Generated client library for bigquery version v2."""
# NOTE: This file is autogenerated and should not be edited by hand.
from googlecloudapis.apitools.base.py import base_api
from googlecloudapis.bigquery.v2 import bigquery_v2_messages as messages
class BigqueryV2(base_api.BaseApiClient):
"""Generated client l... | apache-2.0 |
JonDoNym/peinjector | peinjector/connectors/python/libPePatch.py | 34 | 4600 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Provides de-serialization and in-stream patch applying capabilities for PE Files
"""
__author__ = 'A.A.'
# Unpack binary data
from struct import unpack_from
# Holds an single patch part
class PePatchPart(object):
# Constructor
def __init__(self, mem, ... | unlicense |
fsimkovic/cptbx | conkit/io/tests/test_pdb.py | 2 | 10444 | """Testing facility for conkit.io.PdbIO"""
__author__ = "Felix Simkovic"
__date__ = "26 Oct 2016"
import os
import unittest
from conkit.io.pdb import PdbParser
from conkit.io.tests.helpers import ParserTestCase
class TestPdbIO(ParserTestCase):
def test_read_1(self):
content = """ATOM 1 N TYR A ... | gpl-3.0 |
ncdesouza/bookworm | env/lib/python2.7/site-packages/jinja2/testsuite/core_tags.py | 412 | 11858 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.core_tags
~~~~~~~~~~~~~~~~~~~~~~~~~~
Test the core tags like for and if.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environment... | gpl-3.0 |
iamroot12C/linux | tools/perf/scripts/python/net_dropmonitor.py | 1812 | 1749 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
noroutine/ansible | lib/ansible/utils/module_docs_fragments/openstack.py | 133 | 3961 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... | gpl-3.0 |
crakensio/django_training | lib/python2.7/site-packages/pip/vcs/bazaar.py | 393 | 4943 | import os
import tempfile
import re
from pip.backwardcompat import urlparse
from pip.log import logger
from pip.util import rmtree, display_path, call_subprocess
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
class Bazaar(VersionControl):
name = 'bzr'
dirname = '.bzr'
repo_na... | cc0-1.0 |
agoravoting/agora-results | agora_results/pipes/pdf.py | 1 | 18370 | # -*- coding:utf-8 -*-
# This file is part of agora-results.
# Copyright (C) 2016-2021 Agora Voting SL <nvotes@nvotes.com>
# agora-results 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 versi... | agpl-3.0 |
PyLearner/tp-qemu | generic/tests/ioquit.py | 9 | 1206 | import logging
import time
import random
from autotest.client.shared import error
@error.context_aware
def run(test, params, env):
"""
Emulate the poweroff under IO workload(dd so far) with signal SIGKILL.
1) Boot a VM
2) Add IO workload for guest OS
3) Sleep for a random time
4) Kill the VM... | gpl-2.0 |
scripteed/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-strip-default.py | 232 | 2448 | #!/usr/bin/env python
# Copyright (c) 2013 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 that the default STRIP_STYLEs match between different generators.
"""
import TestGyp
import re
import subprocess
import sys
i... | gpl-3.0 |
saimn/astropy | astropy/wcs/wcsapi/tests/test_utils.py | 11 | 1548 | import numpy as np
from numpy.testing import assert_allclose
import pytest
from pytest import raises
from astropy import units as u
from astropy.wcs import WCS
from astropy.tests.helper import assert_quantity_allclose
from astropy.wcs.wcsapi.utils import deserialize_class, wcs_info_str
def test_construct():
r... | bsd-3-clause |
arnaudsj/suds | suds/servicedefinition.py | 200 | 8478 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 the hope that it will ... | lgpl-3.0 |
openstack/ironic | ironic/hacking/checks.py | 1 | 1950 | # Copyright 2018 FUJITSU LIMITED
#
# 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 writ... | apache-2.0 |
divio/django | django/test/runner.py | 148 | 14807 | import logging
import os
import unittest
from importlib import import_module
from unittest import TestSuite, defaultTestLoader
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, TestCase
from django.test.utils import setup_test_environment, ... | bsd-3-clause |
tiborsimko/invenio-pidstore | invenio_pidstore/providers/base.py | 1 | 3776 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Module storing implementations of PID providers."""
from __future__ import absolu... | mit |
djw8605/htcondor | src/condor_contrib/campus_factory/python-lib/campus_factory/Parsers.py | 7 | 3591 | import logging
import xml.sax.handler
import os
from select import select
from campus_factory.util.ExternalCommands import RunExternal
class AvailableGlideins(xml.sax.handler.ContentHandler, object):
# Command to query the collector for available glideins
command = "condor_status -avail -const '(IsUndef... | apache-2.0 |
linuxlewis/channels | channels/asgi.py | 4 | 3137 | from __future__ import unicode_literals
import django
from django.conf import settings
from django.utils.module_loading import import_string
from .routing import Router
from .utils import name_that_thing
class InvalidChannelLayerError(ValueError):
pass
class ChannelLayerManager(object):
"""
Takes a se... | bsd-3-clause |
dyoung418/tensorflow | tensorflow/python/keras/_impl/keras/applications/xception_test.py | 35 | 2109 | # 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 |
romankagan/DDBWorkbench | python/lib/Lib/HTMLParser.py | 103 | 12662 | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... | apache-2.0 |
axinging/chromium-crosswalk | third_party/Python-Markdown/markdown/extensions/meta.py | 114 | 2400 | """
Meta Data Extension for Python-Markdown
=======================================
This extension adds Meta Data handling to markdown.
See <https://pythonhosted.org/Markdown/extensions/meta_data.html>
for documentation.
Original code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com).
All changes Copyrigh... | bsd-3-clause |
chanderbgoel/pybrain | pybrain/supervised/evolino/filter.py | 25 | 9839 | from __future__ import print_function
__author__ = 'Michael Isik'
from pybrain.supervised.evolino.gfilter import Filter, SimpleMutation
from pybrain.supervised.evolino.variate import CauchyVariate
from pybrain.supervised.evolino.population import SimplePopulation
from pybrain.tools.validation import Validator
from py... | bsd-3-clause |
Shrews/PyGerrit | webapp/django/contrib/localflavor/es/es_provinces.py | 436 | 1482 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
PROVINCE_CHOICES = (
('01', _('Arava')),
('02', _('Albacete')),
('03', _('Alacant')),
('04', _('Almeria')),
('05', _('Avila')),
('06', _('Badajoz')),
('07', _('Illes Balears')),
('08', _('Barcelona')),
(... | apache-2.0 |
abhiQmar/servo | tests/wpt/web-platform-tests/check_stability.py | 9 | 26373 | from __future__ import print_function
import argparse
import logging
import os
import re
import stat
import subprocess
import sys
import tarfile
import zipfile
from abc import ABCMeta, abstractmethod
from cStringIO import StringIO as CStringIO
from collections import defaultdict
from ConfigParser import RawConfigParse... | mpl-2.0 |
ryano144/intellij-community | python/lib/Lib/encodings/cp1253.py | 593 | 13350 | """ Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.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,in... | apache-2.0 |
craynot/django | django/core/management/sql.py | 399 | 1890 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False):
"""
Returns a list of the SQL statements used to flush the database.
If only_django is True, then only table n... | bsd-3-clause |
dpetzold/django | django/db/backends/sqlite3/operations.py | 106 | 10799 | from __future__ import unicode_literals
import datetime
import uuid
from django.conf import settings
from django.core.exceptions import FieldError, ImproperlyConfigured
from django.db import utils
from django.db.backends import utils as backend_utils
from django.db.backends.base.operations import BaseDatabaseOperatio... | bsd-3-clause |
alexallah/django | tests/template_tests/filter_tests/test_urlizetrunc.py | 105 | 3353 | from django.template.defaultfilters import urlizetrunc
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class UrlizetruncTests(SimpleTestCase):
@setup({
'urlizetrunc01': '{% autoescape off %}{{ a|urlizetrunc:"8" }} {{ b|urlizetrunc:"8" }}{% e... | bsd-3-clause |
mcanningjr/Wallflower | Wallflower_Client.py | 1 | 7796 | '''
This is the chat client wallflower; it connects currently to a server hosted by CaveFox Telecommunications; but that
can be changed to any server hosting the Wallflower_Server.py software package.
'''
import pickle
import requests
import time
import threading
import hashlib
message = ''
startpoint = 0
endpoint = 0
... | mit |
watonyweng/neutron | neutron/db/migration/alembic_migrations/dvr_init_opts.py | 32 | 2933 | # Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
areski/django | tests/gis_tests/geogapp/tests.py | 20 | 6033 | """
Tests for geography support in PostGIS
"""
from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.contrib.gis.db.models.functions import Area, Distance
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.measure import D
from django.test import TestCase, ign... | bsd-3-clause |
rishiloyola/bedrock | bedrock/mozorg/tests/test_context_processors.py | 29 | 1553 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.test.client import RequestFactory
from bedrock.base.urlresolvers import reverse
from nose.tools import eq_
... | mpl-2.0 |
jdugge/QGIS | python/plugins/processing/script/ScriptUtils.py | 12 | 4991 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************************... | gpl-2.0 |
ChameleonCloud/horizon | openstack_dashboard/test/unit/test_error_pages.py | 10 | 1325 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
jesseditson/rethinkdb | test/rql_test/connections/http_support/werkzeug/testsuite/security.py | 145 | 4264 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.security
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the security helpers.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import unittest
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.securit... | agpl-3.0 |
vermouthmjl/scikit-learn | sklearn/metrics/classification.py | 1 | 69294 | """Metrics to assess performance on classification task given class prediction
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better
"""
# Authors: Alexandre Gramfort <alexandre.gramf... | bsd-3-clause |
pleaseproject/python-for-android | python3-alpha/python3-src/Lib/encodings/utf_32.py | 180 | 5128 | """
Python 'utf-32' Codec
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_32_encode
def decode(input, errors='strict'):
return codecs.utf_32_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def __init__(self, errors='strict'):
codecs.IncrementalEncoder.__ini... | apache-2.0 |
ianblenke/awsebcli | ebcli/bundled/botocore/vendored/requests/compat.py | 114 | 2601 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 =... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.