repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
boto/botocore | botocore/hooks.py | 4 | 24573 | # Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | apache-2.0 |
jonparrott/gcloud-python | storage/tests/unit/test_blob.py | 2 | 123557 | # Copyright 2014 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/raw/GL/ARB/shader_objects.py | 3 | 17124 | '''OpenGL extension ARB.shader_objects
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_ARB_shader_objects'
_DEPRECATED = False
GL_PROGRAM_OBJEC... | mit |
powerjg/gem5-ci-test | src/python/m5/internal/params.py | 8 | 2361 | # Copyright (c) 2017 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
jiangzhuo/kbengine | kbe/src/lib/python/Lib/encodings/tis_620.py | 272 | 12300 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.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='st... | lgpl-3.0 |
pfnet/chainer | chainer/links/normalization/decorrelated_batch_normalization.py | 5 | 7674 | import functools
import warnings
import numpy
import chainer
from chainer import configuration
from chainer import functions
from chainer import link
import chainer.serializer as serializer_mod
from chainer.utils import argument
class DecorrelatedBatchNormalization(link.Link):
"""Decorrelated batch normalizati... | mit |
leansoft/edx-platform | cms/djangoapps/contentstore/views/tests/test_group_configurations.py | 65 | 37638 | #-*- coding: utf-8 -*-
"""
Group Configuration Tests.
"""
import json
from mock import patch
from contentstore.utils import reverse_course_url, reverse_usage_url
from contentstore.views.component import SPLIT_TEST_COMPONENT_TYPE
from contentstore.course_group_config import GroupConfiguration
from contentstore.tests.ut... | agpl-3.0 |
matthew-tucker/mne-python | mne/viz/tests/test_topo.py | 7 | 4728 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import os.path as op
import warnings
from collections import n... | bsd-3-clause |
ict-felix/stack | vt_manager_kvm/src/python/vt_manager_kvm/communication/sfa/trust/auth.py | 1 | 11404 | #
# SfaAPI authentication
#
import sys
from vt_manager_kvm.communication.sfa.util.faults import InsufficientRights, MissingCallerGID, MissingTrustedRoots, PermissionError, \
BadRequestHash, ConnectionKeyGIDMismatch, SfaPermissionDenied
#from vt_manager_kvm.communication.sfa.util.config import Config
from vt_manag... | apache-2.0 |
lexus24/40223224final | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testmagicmethods.py | 737 | 12145 | import unittest
import inspect
import sys
from unittest.mock import Mock, MagicMock, _magics
class TestMockingMagicMethods(unittest.TestCase):
def test_deleting_magic_methods(self):
mock = Mock()
self.assertFalse(hasattr(mock, '__getitem__'))
mock.__getitem__ = Mock()
self.asser... | gpl-3.0 |
qpython-android/QPypi-numpy | numpy/lib/tests/test__iotools.py | 4 | 6114 |
import StringIO
import numpy as np
from numpy.lib._iotools import LineSplitter, NameValidator, StringConverter,\
has_nested_fields
from numpy.testing import *
class TestLineSplitter(TestCase):
"Tests the LineSplitter class."
#
def test_no_delimiter(self):
"Test Line... | bsd-3-clause |
Stolas/vim-exploit | plugin/templates/python_file.py | 1 | 1431 | #!/usr/bin/env python
# $$COPYRIGHT$$
# Author: $$AUTHOR$$
from struct import pack, unpack
from subprocess import call
### The Exploit
buff = "AAAA"
buff += "\x42\x42\x42\x42"
buff += pack("<L", 0x43434343)
# exploit += $$SHELLCODE$$
## The delivery script
def exploit(filename, binary, shellcode=None):
if shel... | gpl-3.0 |
haad/ansible | lib/ansible/plugins/action/sros.py | 10 | 3128 | #
# (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 |
hongguangguo/shogun | examples/undocumented/python_modular/evaluation_cross_validation_classification.py | 9 | 2189 | #!/usr/bin/env python
#
# 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.
#
# Written (W) 2012 Heiko Strathmann
# Copyrigh... | gpl-3.0 |
dankilman/claw | claw/tests/test_configuration.py | 1 | 9543 | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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 |
40223137/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/difflib.py | 737 | 82544 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... | gpl-3.0 |
catapult-project/catapult | third_party/gae_ts_mon/gae_ts_mon/protobuf/google/protobuf/internal/more_messages_pb2.py | 43 | 4177 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/more_messages.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.proto... | bsd-3-clause |
UFOCoins/ufo | contrib/devtools/copyright_header.py | 58 | 22374 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import re
import fnmatch
import sys
import subprocess
import datetime
import os
#############################... | mit |
szopu/django | django/contrib/admin/views/main.py | 21 | 16837 | from collections import OrderedDict
import sys
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils imp... | bsd-3-clause |
vipulroxx/sympy | sympy/matrices/expressions/inverse.py | 84 | 2258 | from __future__ import print_function, division
from sympy.core.sympify import _sympify
from sympy.core import S, Basic
from sympy.matrices.expressions.matexpr import ShapeError
from sympy.matrices.expressions.matpow import MatPow
class Inverse(MatPow):
"""
The multiplicative inverse of a matrix expression
... | bsd-3-clause |
Kongsea/tensorflow | tensorflow/contrib/gan/python/losses/python/losses_impl.py | 20 | 36658 | # Copyright 2017 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 |
k3nnyfr/s2a_fr-nsis | s2a/Python/Lib/doctest.py | 10 | 104460 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | gpl-3.0 |
shishaochen/TensorFlow-0.8-Win | tensorflow/python/summary/event_accumulator_test.py | 6 | 26822 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
zrhans/pythonanywhere | .virtualenvs/django19/lib/python3.4/site-packages/pip/commands/list.py | 269 | 7251 | from __future__ import absolute_import
import logging
from pip._vendor import pkg_resources
from pip.basecommand import Command
from pip.exceptions import DistributionNotFound
from pip.index import FormatControl, fmt_ctl_formats, PackageFinder, Search
from pip.req import InstallRequirement
from pip.utils import get_... | apache-2.0 |
flashycud/timestack | django/contrib/localflavor/pl/forms.py | 273 | 5444 | """
Polish-specific form helpers
"""
import re
from django.forms import ValidationError
from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
from django.core.validators import EMPTY_VALUES
class PLProvinceSelect(Select):
"""
A select widget with list of P... | mit |
jonahzheng/server | storage/tokudb/mysql-test/tokudb/t/change_column_multiple_columns.py | 56 | 1497 | import sys
import itertools
cols = [ 'a', 'b', 'c', 'd', 'e' ]
old_types = [ 'VARCHAR(1)', 'VARBINARY(1)', 'INT', 'CHAR(1)', 'BINARY(1)' ]
new_types = [ 'VARCHAR(2)', 'VARBINARY(2)', 'BIGINT', 'CHAR(2)', 'BINARY(2)' ]
def main():
print "# this test generated by change_multiple_columns.py"
print "# this test g... | gpl-2.0 |
mahak/ansible | test/support/windows-integration/plugins/modules/win_dsc.py | 50 | 6598 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Trond Hindenes <trond@hindenes.com>, and others
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'statu... | gpl-3.0 |
rolobio/DictORM | dictorm/test/test_dictorm.py | 1 | 57518 | #! /usr/bin/env python
import sqlite3
import unittest
import psycopg2
from psycopg2.extras import DictCursor
import dictorm
test_db_login = {
'database': 'postgres',
'user': 'postgres',
'password': 'dictorm',
'host': 'localhost',
'port': '54321',
'connect_timeout': 3,
}
def _no_refs(o):
... | apache-2.0 |
palaniyappanBala/thug | src/Analysis/peepdf/PDFCore.py | 17 | 334169 | #
# peepdf is a tool to analyse and modify PDF files
# http://peepdf.eternal-todo.com
# By Jose Miguel Esparza <jesparza AT eternal-todo.com>
#
# Copyright (C) 2011-2014 Jose Miguel Esparza
#
# This file is part of peepdf.
#
# peepdf is free software: you can redistribute it and/or modify
# ... | gpl-2.0 |
jiyuren/android_kernel_oneplus_msm8994 | tools/perf/scripts/python/net_dropmonitor.py | 2669 | 1738 | # 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 |
sbbic/core | pyuno/qa/pytests/testcollections_XIndexAccess.py | 4 | 9978 | #!/usr/bin/env python
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import unittest
import uno
from inspect imp... | gpl-3.0 |
noellekimiko/HMC-Grader | TestFiles/CS5GreenTests/hw5tests/sexChromosomeEvolutiontests.py | 2 | 2283 | import sexChromosomeEvolution as hw
import unittest
testScoresD = {('h4', 'c17'): -158, ('h9', 'c22'): 2374, ('h6', 'c22'): -1149,
('h4', 'c8'): -134, ('h4', 'c19'): 1140, ('h17', 'c22'): -1305,
('h7', 'c17'): -614, ('h6', 'c8'): -195, ('h17', 'c17'): -135,
('h6', 'c19'): -195, ('h9', 'c19'): -1115, ('h9', 'c17'):... | mit |
alexallah/django | django/forms/formsets.py | 15 | 17870 | from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils.functional import cached_property
from django.utils.html import html_safe
fr... | bsd-3-clause |
charbull/GeminiTest | reader.py | 1 | 1669 | #!/usr/bin/env python3
import asyncio
import json
import datetime
import websockets
@asyncio.coroutine
async def market_data():
"""Returns the latest market data"""
timestampms = []
async with websockets.connect('wss://api.gemini.com/v1/marketdata/ethusd') as websocket:
var_eth_usd_price = await w... | mit |
cm12-g600/chil360-kernel | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
seem-sky/kbengine | kbe/src/lib/python/Lib/uuid.py | 63 | 22451 | r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | lgpl-3.0 |
rimbalinux/MSISDNArea | django/contrib/admin/templatetags/admin_list.py | 3 | 13519 | import datetime
from django.conf import settings
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE
from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR
from djan... | bsd-3-clause |
emonty/pyos | samples/cloud_databases/list_flavors.py | 1 | 1110 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.ap... | apache-2.0 |
sou81821/chainer | tests/chainer_tests/functions_tests/activation_tests/test_clipped_relu.py | 11 | 2171 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
class TestClippedReLU(unittest.TestCase):
def setUp(self):
self.x = numpy.random.uniform(-1, 1, (3, 2)).asty... | mit |
amitsela/beam | sdks/python/apache_beam/examples/complete/juliaset/juliaset/juliaset.py | 9 | 4504 | #
# 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 us... | apache-2.0 |
jose36/plugin.video.Jmdl2 | servers/cineraculo.py | 44 | 3872 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para cineraculo (genera vinculos desde videos de megaupload)
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#----------------------------------------------------... | apache-2.0 |
lhopps/grit-i18n | grit/node/misc_unittest.py | 3 | 17115 | #!/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.
'''Unit tests for misc.GritNode'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname... | bsd-2-clause |
gmatteo/pymatgen | pymatgen/util/serialization.py | 5 | 3711 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Most features of this module has been moved to monty. Please refer to
monty.json and monty.serialization documentation.
"""
import functools
import json
import pickle
from pymatgen.core.periodic_table imp... | mit |
dkroy/luigi | test/recursion_test.py | 35 | 1635 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
egaxegax/django-dbcartajs | django/contrib/localflavor/ch/forms.py | 101 | 3963 | """
Swiss-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.ch.ch_states import STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
f... | gpl-2.0 |
danieljaouen/ansible | lib/ansible/plugins/action/package.py | 48 | 3275 | # (c) 2015, Ansible 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 di... | gpl-3.0 |
jtpaasch/armyguys | armyguys/cli/commands/loadbalancers.py | 1 | 4802 | # -*- coding: utf-8 -*-
"""Commands for managing load balancers."""
import click
from ...jobs import loadbalancers as loadbalancer_jobs
from ...jobs.exceptions import AwsError
from ...jobs.exceptions import ImproperlyConfigured
from ...jobs.exceptions import MissingKey
from ...jobs.exceptions import Non200Response
... | mit |
Glottotopia/aagd | moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/support/xappy/marshall.py | 2 | 1315 | #!/usr/bin/env python
#
# Copyright (C) 2007 Lemur Consulting 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versio... | mit |
oew1v07/scikit-image | doc/source/random_gallery.py | 37 | 1328 | # Generate a javascript snippet that links to a random gallery example
import os
import glob
base = os.path.abspath(os.path.dirname(__file__))
example_dir = os.path.join(base, 'auto_examples')
js_fn = os.path.join(base, '_static/random.js')
javascript = '''\
function insert_gallery() {
var images = {{IMAG... | bsd-3-clause |
mapzen/vector-datasource | vectordatasource/collision.py | 2 | 2159 | from vectordatasource.meta.python import FilterCompiler
from vectordatasource.meta.python import create_matcher
class CollisionRanker(object):
def __init__(self, cases):
def _output_fn(datum):
return datum['index']
index = 1
matchers = []
for case in cases:
... | mit |
skimpax/python-rfxcom | tests/protocol/test_lighting1.py | 1 | 2738 | from unittest import TestCase
from rfxcom.protocol.lighting1 import Lighting1
from rfxcom.exceptions import (InvalidPacketLength, UnknownPacketSubtype,
UnknownPacketType)
class Lighting1TestCase(TestCase):
def setUp(self):
self.data = bytearray(b'\x07\x10\x00\x01\x41\x0A... | bsd-3-clause |
valentin-krasontovitsch/ansible | lib/ansible/modules/remote_management/cpm/cpm_plugconfig.py | 55 | 9057 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) 2018 Red Hat Inc.
# Copyright (C) 2018 Western Telematic Inc. <kenp@wti.com>
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FI... | gpl-3.0 |
dfang/odoo | addons/account/wizard/account_report_general_ledger.py | 24 | 1362 | # -*- coding: utf-8 -*-
from odoo import fields, models, _
from odoo.exceptions import UserError
class AccountReportGeneralLedger(models.TransientModel):
_inherit = "account.common.account.report"
_name = "account.report.general.ledger"
_description = "General Ledger Report"
initial_balance = fields... | agpl-3.0 |
crmccreary/openerp_server | openerp/osv/osv.py | 8 | 8809 | # -*- 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 |
falseen/shadowsocks | shadowsocks/crypto/hkdf.py | 21 | 3050 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Void Copyright NO ONE
#
# Void License
#
# The code belongs to no one. Do whatever you want.
# Forget about boring open source license.
#
# HKDF for AEAD ciphers
#
from __future__ import division
import hmac
import hashlib
import sys
if sys.version_info[0] == 3:
... | apache-2.0 |
LCLS/Protein-Folding-Sims | analysis/state.py | 1 | 1766 | import sys
import numpy as np
import os
import os.path
import argparse
def parse_args(args=None):
parser = argparse.ArgumentParser()
parser.add_argument("--h1",
default=None,
type=float,
help='RMSD threshold to helix 1'
)
parser.add_argument("--h2",
... | mit |
SiriusBizniss/evetowerthing | lib/requests/packages/poster/__init__.py | 2 | 1479 | # Copyright (c) 2010 Chris AtLee
#
# 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, publish, distri... | mit |
NeilT-UK/python-utilities | quantiser.py | 1 | 7435 | """ export qXXX quantiser functions, and general make_quant function
use function closures to return the following pre-defined qXXX functions
qE3 to qE192, the standard resistor ranges
qE2 [1, 3, 10]
qE5 [1, 1.6, 2.5, 4, 6.3, 10]
qE10 [1, 1.25, 1.6, 2, 2.5, 3.2, 4, 5, 6.3, 8, 10]
return a function that quantises ac... | bsd-2-clause |
keuv-grvl/bioconda-recipes | recipes/biopet-validatefastq/biopet-validatefastq.py | 62 | 3379 | #!/usr/bin/env python
#
# Wrapper script for starting the biopet-validatefastq JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shake... | mit |
hdinsight/hue | desktop/core/ext-py/Django-1.6.10/django/template/loader.py | 117 | 7545 | # Wrapper for loading templates from storage of some sort (e.g. filesystem, database).
#
# This uses the TEMPLATE_LOADERS setting, which is a list of loaders to use.
# Each loader is expected to have this interface:
#
# callable(name, dirs=[])
#
# name is the template name.
# dirs is an optional list of directories ... | apache-2.0 |
benbenbenbenbenbenbenbenben/mitsingen | sing/models.py | 1 | 3770 | from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from django.db.models.signals import post_delete
from django.dispatch.dispatcher import receiver
import datetime
class Song(models.Model):
name = models.CharField(max_length=200)
notes = models.CharField(max_... | agpl-3.0 |
ShortsTravel/stm-microservices | node_modules/node-gyp/gyp/pylib/gyp/input.py | 578 | 116086 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
kaushik94/sympy | sympy/printing/mathml.py | 1 | 74156 | """
A MathML printer.
"""
from __future__ import print_function, division
from sympy import sympify, S, Mul
from sympy.core.compatibility import range, string_types, default_sort_key
from sympy.core.function import _coeff_isneg
from sympy.printing.conventions import split_super_sub, requires_partial
from sympy.printi... | bsd-3-clause |
bright-sparks/chromium-spacewalk | build/android/buildbot/bb_host_steps.py | 45 | 4630 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import bb_utils
import bb_annotations
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from pylib ... | bsd-3-clause |
ltilve/ChromiumGStreamerBackend | third_party/protobuf/python/google/protobuf/internal/descriptor_pool_test.py | 210 | 9375 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
pychess/pychess | lib/pychess/widgets/playerinfoDialog.py | 1 | 2716 | from gi.repository import Gtk, GObject
firstRun = True
def run(widgets):
global firstRun
if firstRun:
initialize(widgets)
firstRun = False
widgets["player_info"].show_all()
def initialize(widgets):
def addColumns(treeview, *columns):
model = Gtk.ListStore(*((str, ) * len(co... | gpl-3.0 |
bmoar/ansible | lib/ansible/playbook/role/__init__.py | 13 | 15291 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
ArnossArnossi/django | django/conf/locale/en_AU/formats.py | 504 | 2117 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oc... | bsd-3-clause |
jarped/QGIS | python/ext-libs/pygments/plugin.py | 365 | 1862 | # -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
yourlexer = yourmodule:YourLexer
formatter pl... | gpl-2.0 |
hefen1/chromium | components/cronet/tools/cronet_licenses.py | 59 | 2832 | #!/usr/bin/python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates the contents of an Cronet LICENSE file for the third-party code.
It makes use of src/tools/licenses.py and the README.chromiu... | bsd-3-clause |
Volcanoscar/omim | 3party/freetype/src/tools/docmaker/tohtml.py | 109 | 21251 | #
# tohtml.py
#
# A sub-class container of the `Formatter' class to produce HTML.
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use, mo... | apache-2.0 |
sebastic/QGIS | python/ext-libs/pytz/exceptions.py | 657 | 1333 | '''
Custom exceptions raised by pytz.
'''
__all__ = [
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
'NonExistentTimeError',
]
class UnknownTimeZoneError(KeyError):
'''Exception raised when pytz is passed an unknown timezone.
>>> isinstance(UnknownTimeZoneError(), LookupError)... | gpl-2.0 |
opoplawski/ansible-modules-core | cloud/openstack/os_auth.py | 131 | 2039 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... | gpl-3.0 |
narogon/linuxcnc | lib/python/hal.py | 32 | 2238 | #!/usr/bin/env python
# vim: sts=4 sw=4 et
"""
This module allows the creation of userspace HAL components in Python.
This includes pins and parameters of the various HAL types.
Typical usage:
import hal, time
h = hal.component("component-name")
# create pins and parameters with calls to h.newpin and h.newparam
h.n... | lgpl-2.1 |
guanquan94/orbis | reviews_user/views.py | 1 | 4607 | from urllib import quote_plus
from account.decorators import login_required
from annoying.decorators import render_to
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http... | mit |
SnappleCap/oh-mainline | vendor/packages/PyYaml/tests/lib/test_errors.py | 56 | 1994 |
import yaml, test_emitter
def test_loader_error(error_filename, verbose=False):
try:
list(yaml.load_all(open(error_filename, 'rb')))
except yaml.YAMLError, exc:
if verbose:
print "%s:" % exc.__class__.__name__, exc
else:
raise AssertionError("expected an exception")
te... | agpl-3.0 |
actus/koin | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
havard024/prego | venv/lib/python2.7/site-packages/whoosh/util/varints.py | 95 | 3198 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | mit |
PyORBIT-Collaboration/JPARC_Accelerator | JPARC_Linac/jparc_linac_model/jparc_linac_bunch_generator.py | 2 | 3411 | #!/usr/bin/env python
#--------------------------------------------------------
# The classes will generates bunches for pyORBIT J-PARC linac
# at the entrance of LI_MEBT1 accelerator line (by default)
# It is parallel, but it is not efficient.
#--------------------------------------------------------
import math
im... | mit |
shail2810/nova | nova/tests/unit/api/openstack/compute/test_extended_server_attributes.py | 33 | 8459 | # Copyright 2011 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 |
simon-pepin/scikit-learn | sklearn/ensemble/tests/test_base.py | 284 | 1328 | """
Testing for the base module (sklearn.ensemble.base).
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
from numpy.testing import assert_equal
from nose.tools import assert_true
from sklearn.utils.testing import assert_raise_message
from sklearn.datasets import load_iris
from sklearn.ensemble import BaggingCla... | bsd-3-clause |
Phonebooth/depot_tools | third_party/boto/file/connection.py | 111 | 1480 | # Copyright 2010 Google Inc.
#
# 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, publish, dis-
# trib... | bsd-3-clause |
Gitlab11/odoo | openerp/addons/test_limits/models.py | 435 | 1034 | # -*- coding: utf-8 -*-
import time
import openerp
class m(openerp.osv.osv.Model):
""" This model exposes a few methods that will consume between 'almost no
resource' and 'a lot of resource'.
"""
_name = 'test.limits.model'
def consume_nothing(self, cr, uid, context=None):
return True... | agpl-3.0 |
wyc/django | tests/annotations/models.py | 238 | 2901 | # coding: utf-8
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
age = models.IntegerField()
friends = models.ManyToManyField('self', blank=True)
def __str__(self... | bsd-3-clause |
philipn/sycamore | Sycamore/support/pool.py | 2 | 8837 | # pool.py - Connection pooling for SQLAlchemy
# Copyright (C) 2005,2006 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides a connection pool implementation, which optionally manages connec... | gpl-2.0 |
Fillll/reddit2telegram | reddit2telegram/channels/r_battlestations/app.py | 1 | 1028 | #encoding:utf-8
from utils import weighted_random_subreddit
# Subreddit that will be a source of content
subreddit = weighted_random_subreddit({
'battlestations': 1.0,
# If we want get content from several subreddits
# please provide here 'subreddit': probability
# 'any_other_subreddit': 0.02
})
# Te... | mit |
75651/kbengine_cloud | kbe/res/scripts/common/Lib/site-packages/setuptools/command/upload_docs.py | 332 | 6811 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
import os
import socket
import zipfile
import tempfile
import sys
import shutil
from base64 import standard_b64encode
from pkg_resources import iter_entry_points
from distuti... | lgpl-3.0 |
Godiyos/python-for-android | python-modules/twisted/twisted/internet/test/process_helper.py | 145 | 1081 |
# A program which exits after starting a child which inherits its
# stdin/stdout/stderr and keeps them open until stdin is closed.
import sys, os
def grandchild():
sys.stdout.write('grandchild started')
sys.stdout.flush()
sys.stdin.read()
def main():
if sys.argv[1] == 'child':
if sys.argv[2]... | apache-2.0 |
BeiLuoShiMen/nupic | tests/unit/nupic/research/spatial_pooler_cpp_api_test.py | 35 | 1320 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | agpl-3.0 |
andreikop/enki | enki/lib/buffpopen.py | 3 | 5426 | """
buffpopen --- Buffered subprocess. Popen implementation
=======================================================
This implementation allows to read and write output without blocking
"""
import subprocess
import threading
import os
import copy
import time
import shlex
from queue import Queue, Empty, Full # python... | gpl-2.0 |
laurenrevere/osf.io | addons/owncloud/migrations/0001_initial.py | 28 | 1511 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-23 20:34
from __future__ import unicode_literals
from django.db import migrations, models
import osf.models.base
import osf.utils.datetime_aware_jsonfield
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operation... | apache-2.0 |
homecon/homecon | homecon/plugins/weather.py | 2 | 11099 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import datetime
import asyncio
import ephem
import numpy as np
from .. import core
from .. import util
class Weather(core.plugin.Plugin):
"""
Class to control the HomeCon weather functions
"""
def initialize(self):
... | gpl-3.0 |
Bysmyyr/chromium-crosswalk | build/android/devil/android/logcat_monitor_test.py | 7 | 6779 | #!/usr/bin/env python
# Copyright 2015 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.
# pylint: disable=protected-access
import itertools
import os
import sys
import unittest
from devil.android import logcat_monitor
fro... | bsd-3-clause |
ehealthafrica-ci/onadata | onadata/apps/viewer/migrations/0017_remove_odk_prefix.py | 13 | 12530 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from onadata.libs.data.db import rename_table_pending_creates
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_table('odk_viewer_columnrename', 'viewer_columnrename')
db.rename_table('odk_vie... | bsd-2-clause |
chuan9/chromium-crosswalk | chrome/test/chromedriver/test/webserver.py | 68 | 6705 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import BaseHTTPServer
import os
import threading
class Responder(object):
"""Sends a HTTP response. Used with TestWebServer."""
def __init__(self, han... | bsd-3-clause |
entropy1337/infernal-twin | Modules/build/pip/build/lib.linux-i686-2.7/pip/utils/ui.py | 316 | 6774 | from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip._vendor import six
from pip._vendor.progress... | gpl-3.0 |
Desterly/android_kernel_motorola_msm8994 | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
anant-dev/django | django/db/backends/base/base.py | 184 | 23050 | import copy
import time
import warnings
from collections import deque
from contextlib import contextmanager
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import utils
from django.db.backends.signals import connect... | bsd-3-clause |
GEHC-Surgery/ITK | Modules/ThirdParty/GDCM/src/gdcm/Source/InformationObjectDefinition/ParseAttributes.py | 42 | 18708 | #!/usr/bin/env python
# vim: set fileencoding=iso-8859-1
"""
$ pdftotext -layout -nopgbrk -f 303 -l 305 07_03pu.pdf page303.txt
$ python ParseAttributes.py page273-1000.txt out.txt > log2
$ grep ADD log2 | grep -v "Notes:" | grep -v "Note:" | grep -v "C.8" | grep -v "C.7"
"""
import re,os
"""
"""
class Attribute:... | apache-2.0 |
liangazhou/django-rdp | packages/Django-1.8.6/build/lib/django/contrib/sessions/backends/cache.py | 45 | 2594 | from django.conf import settings
from django.contrib.sessions.backends.base import CreateError, SessionBase
from django.core.cache import caches
from django.utils.six.moves import range
KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.