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 |
|---|---|---|---|---|---|
akheron/jansson-debian-pre2.0 | doc/ext/refcounting.py | 2 | 1716 | """
refcounting
~~~~~~~~~~~
Reference count annotations for C API functions. Has the same
result as the sphinx.ext.refcounting extension but works for all
functions regardless of the signature, and the reference counting
information is written inline with the documentation instead of a
sepa... | mit |
apark263/tensorflow | tensorflow/python/profiler/internal/model_analyzer_testlib.py | 46 | 4078 | # 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 |
thanhacun/odoo | addons/mrp/procurement.py | 219 | 7347 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
bikong2/django | django/db/models/fields/files.py | 96 | 19628 | import datetime
import os
import warnings
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
f... | bsd-3-clause |
mrquim/repository.mrquim | repo/plugin.video.castaway/resources/lib/modules/f4mproxy/utils/compat.py | 144 | 2594 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Miscellaneous functions to mask Python version differences."""
import sys
import os
import math
import binascii
if sys.version_info >= (3,0):
def compat26Str(x): return x
# Python 3 requires bytes instea... | gpl-2.0 |
danmilon/fragofonias | app.py | 1 | 1092 | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.json import JSONEncoder
from datetime import date, datetime
import os
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://%s:%s@localhost/csa?charset=utf8' % (
os.environ['CSA_DB_USERNAME'], os.environ['CSA_DB... | mit |
eeshangarg/oh-mainline | vendor/packages/Django/tests/regressiontests/admin_views/admin.py | 42 | 22489 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import tempfile
import os
from django import forms
from django.contrib import admin
from django.contrib.admin.views.main import ChangeList
from django.core.files.storage import FileSystemStorage
from django.core.mail import EmailMessage
... | agpl-3.0 |
mosaic-cloud/mosaic-distribution-dependencies | dependencies/nodejs/0.10.32/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | apache-2.0 |
jorik041/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py | 120 | 7432 | # Copyright (c) 2009 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 of conditions and the... | bsd-3-clause |
sambarluc/xmitgcm | setup.py | 1 | 1468 | #!/usr/bin/env python
import os
import re
import sys
import warnings
from setuptools import setup, find_packages
VERSION = '0.2.1'
DISTNAME = 'xmitgcm'
LICENSE = 'Apache'
AUTHOR = 'Ryan Abernathey'
AUTHOR_EMAIL = 'rpa@ldeo.columbia.edu'
URL = 'https://github.com/xgcm/xmitgcm'
CLASSIFIERS = [
'Development Status ... | mit |
Bang3DEngine/Bang | Compile/CompileDependencies/ThirdParty/freetype-2.4.0/src/tools/docmaker/docmaker.py | 463 | 2766 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | lgpl-3.0 |
Necrote/PsyHeal | src/modules/Constants.py | 1 | 1897 | Openness = ['Adventurousness','Artistic interests','Emotionality','Imagination','Intellect','Authority-challenging']
Conscientiousness = ['Achievement striving','Cautiousness','Dutifulness','Orderliness','Self-discipline','Self-efficacy']
Extraversion = ['Activity level','Assertiveness','Cheerfulness','Excitement-seeki... | mit |
bdoner/SickRage | lib/bs4/builder/__init__.py | 447 | 11151 | from collections import defaultdict
import itertools
import sys
from bs4.element import (
CharsetMetaAttributeValue,
ContentMetaAttributeValue,
whitespace_re
)
__all__ = [
'HTMLTreeBuilder',
'SAXTreeBuilder',
'TreeBuilder',
'TreeBuilderRegistry',
]
# Some useful features for a Tree... | gpl-3.0 |
EuroPython/epcon | p3/management/commands/create_bulk_coupons.py | 1 | 2939 |
""" Create a batch of single use discount coupons from a CSV file.
Parameters: <conference> <csv-file>
Creates coupons based on the CSV file contents:
code - coupon code
max_usage - max. number of uses
items_per_usage - max number of items per use
value - value of the coupon in percent
de... | bsd-2-clause |
mbarnach/googletest | test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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 of... | bsd-3-clause |
Bluejudy/bluejudyd | test/fixtures/vectors.py | 1 | 85330 | from .params import ADDR, MULTISIGADDR, DEFAULT_PARAMS as DP
UNITTEST_VECTOR = {
'burn': {
'validate': [{
'in': (ADDR[0], DP['unspendable'], DP['burn_quantity'], DP['burn_start']),
'out': ([])
}, {
'in': (ADDR[0], DP['unspendable'], 1.1 * DP['burn_quantity'], DP[... | mit |
pettarin/aeneas | aeneas/res/__init__.py | 5 | 1128 | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | agpl-3.0 |
jckarter/swift | utils/cmpcodesize/setup.py | 65 | 1597 | # cmpcodesize/setup.py - Install script for cmpcodesize -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for li... | apache-2.0 |
zenefits/selenium | py/test/selenium/webdriver/common/executing_async_javascript_tests.py | 63 | 10607 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
clone1612/appstore | nextcloudappstore/core/tests/test_cert_delete_releases.py | 2 | 1598 | from django.contrib.auth.models import User
from django.test import TestCase
from nextcloudappstore.core.models import App, AppRelease
class CertDeleteReleasesTest(TestCase):
def setUp(self):
self.owner = User.objects.create(username='user', password='pass')
self.app = App.objects.create(
... | agpl-3.0 |
idreamsi/wiobot | requests/packages/urllib3/connection.py | 89 | 3386 | # urllib3/connection.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import socket
from socket import timeout as SocketTimeout
try: # Python 3
from http.cli... | gpl-3.0 |
mxOBS/deb-pkg_trusty_chromium-browser | third_party/chromite/lib/paygen/fixup_path.py | 1 | 1342 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper for other scripts that need a PYTHONPATH entry for crostools.
Generally used by import statements of the form:
from chromite.lib.paygen i... | bsd-3-clause |
heke123/chromium-crosswalk | tools/cr/cr/commands/init.py | 13 | 6044 | # 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.
"""A module for the init command."""
import os
import cr
# The set of variables to store in the per output configuration.
OUT_CONFIG_VARS = [
'CR_VERS... | bsd-3-clause |
levilucio/SyVOLT | GM2AUTOSAR_MM/Properties/from_eclipse/HP1_ConnectedLHS.py | 1 | 19004 | from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HP1_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HP1_ConnectedLHS.
"""
# Flag this ins... | mit |
aktech/sympy | sympy/polys/tests/test_solvers.py | 88 | 13327 | """Tests for low-level linear systems solver. """
from sympy.polys.rings import ring
from sympy.polys.fields import field
from sympy.polys.domains import ZZ, QQ
from sympy.polys.solvers import solve_lin_sys
def test_solve_lin_sys_2x2_one():
domain, x1,x2 = ring("x1,x2", QQ)
eqs = [x1 + x2 - 5,
2*x... | bsd-3-clause |
simianhacker/code-by-voice | macros/_vocola_main.py | 2 | 30909 | # _vocola_main.py - NatLink support for Vocola
# -*- coding: latin-1 -*-
#
# Contains:
# - "Built-in" voice commands
# - Autoloading of changed command files
#
#
# Copyright (c) 2002-2012 by Rick Mohr.
#
# Portions Copyright (c) 2012-2013 by Hewlett-Packard Development Company, L.P.
#
# Permission is... | mit |
uranusjr/django | tests/template_tests/test_engine.py | 68 | 3003 | import os
from django.core.exceptions import ImproperlyConfigured
from django.template import Context
from django.template.engine import Engine
from django.test import SimpleTestCase, override_settings
from .utils import ROOT, TEMPLATE_DIR
OTHER_DIR = os.path.join(ROOT, 'other_templates')
class RenderToStringTest(... | bsd-3-clause |
hogarthj/ansible | test/units/modules/network/nxos/test_nxos_pim_interface.py | 42 | 3684 | # (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 dis... | gpl-3.0 |
navcoindev/navcoin-core | qa/rpc-tests/txn_clone.py | 1 | 7549 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test proper accounting with an equivalent malleability clone
#
from test_framework.test_framework im... | mit |
smart-make/zxing | cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/swig.py | 34 | 7120 | """SCons.Tool.swig
Tool-specific initialization for swig.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
#... | apache-2.0 |
follow99/django | django/core/management/commands/dumpdata.py | 305 | 8545 | from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, router
class Command(BaseCommand):
help = ("Output the contents of the database as a fixture of the given ... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/django/contrib/auth/models.py | 104 | 17967 | from __future__ import unicode_literals
from django.contrib import auth
from django.contrib.auth.hashers import (
check_password, is_password_usable, make_password,
)
from django.contrib.auth.signals import user_logged_in
from django.contrib.contenttypes.models import ContentType
from django.core import validators... | mit |
mdworks2016/work_development | Python/20_Third_Certification/venv/lib/python3.7/site-packages/pip/_vendor/distlib/version.py | 88 | 23391 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2017 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Implementation of a flexible versioning scheme providing support for PEP-440,
setuptools-compatible and semantic versioning.
"""
import logging
import re
from .compat import string_types
f... | apache-2.0 |
cyberark-bizdev/ansible | lib/ansible/template/template.py | 156 | 1632 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
eahneahn/free | lib/python2.7/site-packages/pip-1.5-py2.7.egg/pip/_vendor/requests/auth.py | 294 | 6173 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import logging
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import pars... | agpl-3.0 |
zploskey/servo | tests/wpt/web-platform-tests/tools/py/py/_path/common.py | 171 | 13048 | """
"""
import os, sys, posixpath
import py
# Moved from local.py.
iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt')
class Checkers:
_depend_on_existence = 'exists', 'link', 'dir', 'file'
def __init__(self, path):
self.path = path
def dir(self):
raise NotImplemen... | mpl-2.0 |
wandec/grr | lib/access_control_test.py | 2 | 16022 | #!/usr/bin/env python
"""Tests for the access control mechanisms."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import access_control
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import d... | apache-2.0 |
croxis/SpaceDrive | spacedrive/renderpipeline/rplibs/yaml/yaml_py3/composer.py | 1 | 5020 |
__all__ = ['Composer', 'ComposerError']
from .error import MarkedYAMLError
from .events import *
from .nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer:
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
... | mit |
acimmarusti/isl_exercises | chap4/chap4ex13.py | 1 | 5743 | from __future__ import print_function, division
import matplotlib.pyplot as plt
import numpy as np
import scipy
import pandas as pd
import seaborn as sns
from sklearn.datasets import load_boston
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.linear_mod... | gpl-3.0 |
murfz/Sick-Beard | lib/requests/packages/chardet/langcyrillicmodel.py | 235 | 17817 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
algorhythms/LintCode | The Smallest Difference.py | 4 | 1382 | """
Given two array of integers(the first array is array A, the second array is array B), now we are going to find a element
in array A which is A[i], and another element in array B which is B[j], so that the difference between A[i] and B[j]
(|A[i] - B[j]|) is as small as possible, return their smallest difference.
"... | apache-2.0 |
benopotamus/steam-game-mover | main.py | 1 | 4905 | #!/usr/bin/env python
'''Allows easy moving (with symlinking) of folders to and from the SteamApps folder.
Intended for users with an SSD that cannot hold all their Steam games. Allows them to easily move games not currently being played to a slower drive easily. And then move them back at a later date. The symlinkin... | gpl-2.0 |
dd00/commandergenius | project/jni/python/src/Demo/zlib/zlibdemo.py | 43 | 1469 | #!/usr/bin/env python
# Takes an optional filename, defaulting to this file itself.
# Reads the file and compresses the content using level 1 and level 9
# compression, printing a summary of the results.
import zlib, sys
def main():
if len(sys.argv) > 1:
filename = sys.argv[1]
else:
filename ... | lgpl-2.1 |
gdimitris/ChessPuzzlerBackend | Virtual_Environment/lib/python2.7/site-packages/requests/packages/urllib3/util/retry.py | 699 | 9924 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... | mit |
BetterCollective/thumbor | vows/quality_filter_vows.py | 7 | 1028 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from pyvows import Vows, expect
from thumbor.context import Context,... | mit |
HybridF5/tempest_debug | tempest/api/compute/servers/test_server_group.py | 6 | 4606 | # Copyright 2014 NEC Technologies India 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
#
# Unle... | apache-2.0 |
hlin117/statsmodels | statsmodels/examples/ex_kernel_regression_dgp.py | 34 | 1202 | # -*- coding: utf-8 -*-
"""
Created on Sun Jan 06 09:50:54 2013
Author: Josef Perktold
"""
from __future__ import print_function
if __name__ == '__main__':
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.nonparametric.api import KernelReg
import statsmodels.sandbox.nonparametric... | bsd-3-clause |
FOSSRIT/lemonade-stand | LemonadeStand.py | 1 | 1785 | #!/usr/bin/env python
from fortuneengine.GameEngine import GameEngine
from LemonadeMain import LemonadeMain
from LemonadeGui import LemonadeGui
from optparse import OptionParser
from pygame import font
parser = OptionParser()
parser.add_option("", "--width", dest="width", help="window width",
metav... | gpl-3.0 |
danielharbor/openerp | addons/crm_profiling/__init__.py | 438 | 1089 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
andzaytsev/deepnav | GA3C/NetworkVP.py | 1 | 12801 | # Copyright (c) 2016, NVIDIA CORPORATION. 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 of conditions a... | gpl-2.0 |
AllisonWang/incubator-airflow | tests/contrib/hooks/test_wasb_hook.py | 22 | 4219 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
heroku/python-salesforce-client | salesforce/soap/base.py | 1 | 5676 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
import urlparse
logger = logging.getLogger(__name__)
try:
import suds.client
if suds.__version__ < '0.6':
raise ImportError
except ImportError:
logger.error("The metadata API requires suds-jurko >= 0.6... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/numpy-1.9.2/numpy/distutils/conv_template.py | 165 | 9681 | #!/usr/bin/python
"""
takes templated file .xxx.src and produces .xxx file where .xxx is
.i or .c or .h, using the following template rules
/**begin repeat -- on a line by itself marks the start of a repeated code
segment
/**end repeat**/ -- on a line by itself marks it's end
After the /**begin ... | mit |
elbeardmorez/quodlibet | quodlibet/quodlibet/ext/events/visualisations.py | 1 | 3329 | # -*- coding: utf-8 -*-
# Copyright 2017 Nick Boultbee
#
# 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.
import os
impo... | gpl-2.0 |
openmaraude/APITaxi | APITaxi_models2/migrations/versions/20150417_17:39:15_2831056c7dd9_add_taxi_model.py.py | 4 | 1536 | """Add taxi model
Revision ID: 2831056c7dd9
Revises: 4934186b5ce0
Create Date: 2015-04-17 17:39:15.767124
"""
# revision identifiers, used by Alembic.
revision = '2831056c7dd9'
down_revision = '4934186b5ce0'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
... | agpl-3.0 |
emrah-b/oclapi | django-nonrel/ocl/users/tests.py | 5 | 4345 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from sources.models import Source
from tes... | mpl-2.0 |
BorisJeremic/Real-ESSI-Examples | inclined_wave/uniform/poisson_ratio/0.3/comparison.py | 10 | 4826 | #! /usr/bin/env python
import h5py
import scipy as sp
import numpy as np
import time
import pickle
import sys
import math
import cmath
from os import path
import os, sys
# sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
# sys.path.append(os.path.dirname(os.path.dirnam... | cc0-1.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Tools/scripts/untabify.py | 56 | 1185 | #! /usr/bin/env python
"Replace tabs with spaces in argument files. Print names of changed files."
import os
import sys
import getopt
def main():
tabsize = 8
try:
opts, args = getopt.getopt(sys.argv[1:], "t:")
if not args:
raise getopt.error, "At least one file argument required"... | apache-2.0 |
163gal/Time-Line | libs_arm/wx/lib/pubsub/utils/exchandling.py | 4 | 3788 | """
Some utility classes for exception handling of exceptions raised
within listeners:
- TracebackInfo: convenient way of getting stack trace of latest
exception raised. The handler can create the instance to retrieve
the stack trace and then log it, present it to user, etc.
- ExcPublisher: example handler that pu... | gpl-3.0 |
Thraxis/SickRage | tests/sickrage_tests/media/show_poster_tests.py | 2 | 1568 | # coding=utf-8
# This file is part of SickRage.
#
# URL: https://SickRage.GitHub.io
# Git: https://github.com/SickRage/SickRage.git
#
# SickRage 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... | gpl-3.0 |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/ctypes/test/test_init.py | 169 | 1039 | from ctypes import *
import unittest
class X(Structure):
_fields_ = [("a", c_int),
("b", c_int)]
new_was_called = False
def __new__(cls):
result = super().__new__(cls)
result.new_was_called = True
return result
def __init__(self):
self.a = 9
sel... | lgpl-3.0 |
danielecook/gist-alfred | github/InputFileContent.py | 2 | 2969 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | mit |
kprkpr/kernel-e400 | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/dom.py | 1229 | 1457 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import Node
import gettext
_ = gettext.gettext
from . import _base
class TreeWalker(_base.NonRecursiveTreeWalker):
def getNodeDetails(self, node):
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
return _base.DOCTYP... | gpl-2.0 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.4/django/core/management/commands/loaddata.py | 79 | 12685 | # This is necessary in Python 2.5 to enable the with statement, in 2.6
# and up it is no longer necessary.
from __future__ import with_statement
import sys
import os
import gzip
import zipfile
from optparse import make_option
import traceback
from django.conf import settings
from django.core import serializers
from d... | apache-2.0 |
pyocd/pyOCD | pyocd/probe/pydapaccess/interface/pywinusb_backend.py | 2 | 6335 | # pyOCD debugger
# Copyright (c) 2006-2020 Arm Limited
# Copyright (c) 2021 Chris Reed
# SPDX-License-Identifier: Apache-2.0
#
# 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-2.0 |
cchurch/ansible-modules-extras | database/vertica/vertica_user.py | 148 | 14500 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
vjpai/grpc | src/python/grpcio_tests/tests/testing/_client_application.py | 13 | 7742 | # Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
ddico/odoomrp-wip | mrp_project_link/tests/test_mrp_project_link.py | 3 | 2248 | # -*- coding: utf-8 -*-
# (c) 2015 Pedro M. Baeza - Serv. Tecnol. Avanzados
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
import openerp.tests.common as common
class TestMrpProject(common.TransactionCase):
def setUp(self):
super(TestMrpProject, self).setUp()
self.product = self... | agpl-3.0 |
daicang/Leetcode-solutions | 004-median-of-two-sorted-arrays.py | 1 | 1417 | #!/usr/bin/python
class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
size = len(nums1) + len(nums2)
if size % 2 == 0:
return (self.getk(nums1[:], nums2[:], size/2)+
self.getk(nums1[:], nums2[:], size/2-1))/2.0
else:
return sel... | mit |
o5k/openerp-oemedical-v0.1 | openerp/addons/account_budget/report/__init__.py | 444 | 1139 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
dydek/django | django/db/models/__init__.py | 66 | 1610 | from functools import wraps
from django.core.exceptions import ObjectDoesNotExist # NOQA
from django.db.models import signals # NOQA
from django.db.models.aggregates import * # NOQA
from django.db.models.deletion import ( # NOQA
CASCADE, DO_NOTHING, PROTECT, SET, SET_DEFAULT, SET_NULL, ProtectedError,
)
from d... | bsd-3-clause |
suiyuan2009/tensorflow | tensorflow/user_ops/duplicate_op_test.py | 146 | 1303 | # 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 |
oktayacikalin/pyglet | pyglet/image/codecs/png.py | 8 | 3833 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# 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 |
bailey1234/hyeri7846 | lib/werkzeug/_internal.py | 301 | 13713 | # -*- coding: utf-8 -*-
"""
werkzeug._internal
~~~~~~~~~~~~~~~~~~
This module provides internally used helpers and constants.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import string
import inspect
from weakre... | apache-2.0 |
instinct-vfx/rez | src/rez/vendor/yaml/tokens.py | 985 | 2573 |
class Token(object):
def __init__(self, start_mark, end_mark):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in self.__dict__
if not key.endswith('_mark')]
attributes.sort()
arguments = ', '.join(['%s=... | lgpl-3.0 |
eteq/bokeh | examples/interactions/interactive_bubble/data.py | 49 | 1265 | import numpy as np
from bokeh.palettes import Spectral6
def process_data():
from bokeh.sampledata.gapminder import fertility, life_expectancy, population, regions
# Make the column names ints not strings for handling
columns = list(fertility.columns)
years = list(range(int(columns[0]), int(columns[-... | bsd-3-clause |
bnaul/scikit-learn | sklearn/neighbors/_classification.py | 2 | 23284 | """Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ul... | bsd-3-clause |
darkorb/eve-wspace | evewspace/POS/models.py | 14 | 7280 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# 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-3.0 |
BayanGroup/sentry | src/sentry/web/frontend/remove_project.py | 1 | 1378 | from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry.api import client
from sentry.models import OrganizationMemb... | bsd-3-clause |
QianBIG/odoo | openerp/addons/base/ir/ir_filters.py | 237 | 8867 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
sn1k/app_mundial | lib/python2.7/site-packages/django/contrib/auth/tests/test_models.py | 73 | 5702 | from django.contrib.auth import get_user_model
from django.contrib.auth.models import AbstractUser, Group, User, UserManager
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core import mail
from django.db.models.signals import post_save
from django.test import TestCase, override_settings
@ski... | gpl-2.0 |
attente/snapcraft | snapcraft/plugins/nodejs.py | 2 | 4091 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
nitzmahone/ansible | lib/ansible/modules/cloud/vmware/vmware_tag.py | 32 | 7683 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ty... | gpl-3.0 |
lukeiwanski/tensorflow | tensorflow/contrib/optimizer_v2/adadelta_test.py | 15 | 6887 | # 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 |
rholy/librepo | librepo/python/__init__.py | 3 | 50956 | # librepo - A library providing (libcURL like) API to downloading repository
# Copyright (C) 2012-2014 Tomas Mlcoch
#
# Licensed under the GNU Lesser General Public License Version 2.1
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# Licens... | lgpl-2.1 |
40223117cda/2015_w11 | static/Brython3.1.0-20150301-090019/Lib/heapq.py | 628 | 18065 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... | gpl-3.0 |
leiferikb/bitpop | src/android_webview/tools/known_issues.py | 3 | 2487 | # 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.
"""List of directories which are known issues for Android WebView.
There are a number of directories in the Chromium tree which should be removed
when m... | gpl-3.0 |
abhishek-ch/hue | desktop/core/ext-py/python-openid-2.2.5/openid/test/test_sreg.py | 86 | 17151 | from openid.extensions import sreg
from openid.message import NamespaceMap, Message, registerNamespaceAlias
from openid.server.server import OpenIDRequest, OpenIDResponse
import unittest
class SRegURITest(unittest.TestCase):
def test_is11(self):
self.failUnlessEqual(sreg.ns_uri_1_1, sreg.ns_uri)
class Ch... | apache-2.0 |
arbrandes/edx-platform | lms/djangoapps/course_api/tests/mixins.py | 3 | 1485 | """
Common mixins for Course API Tests
"""
from datetime import datetime
from common.djangoapps.student.tests.factories import UserFactory, CourseEnrollmentFactory, CourseAccessRoleFactory
from xmodule.modulestore.tests.factories import ToyCourseFactory
TEST_PASSWORD = 'edx'
class CourseApiFactoryMixin:
"""
... | agpl-3.0 |
moijes12/oh-mainline | vendor/packages/twisted/twisted/words/protocols/jabber/xmpp_stringprep.py | 18 | 8332 | # -*- test-case-name: twisted.words.test.test_jabberxmppstringprep -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, warnings
from zope.interface import Interface, implements
if sys.version_info < (2,3,2):
import re
class IDNA:
dots = re.compile(u"[\u002E\u3002... | agpl-3.0 |
akhmadMizkat/odoo | addons/im_livechat/controllers/main.py | 25 | 5332 | # -*- coding: utf-8 -*-
from openerp import http, _
from openerp.http import request
from openerp.addons.base.ir.ir_qweb import AssetsBundle
from openerp.addons.web.controllers.main import binary_content
import base64
class LivechatController(http.Controller):
@http.route('/im_livechat/external_lib.<any(css,js):... | gpl-3.0 |
eickenberg/scikit-learn | sklearn/cluster/bicluster/spectral.py | 1 | 19540 | """Implements spectral biclustering algorithms.
Authors : Kemal Eren
License: BSD 3 clause
"""
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.sparse import dia_matrix
from scipy.sparse import issparse
from sklearn.base import BaseEstimator, BiclusterMixin
from sklearn.externals import six
fr... | bsd-3-clause |
katsikas/gnuradio | grc/python/expr_utils.py | 28 | 4885 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
tysonclugg/django | django/middleware/clickjacking.py | 82 | 1733 | """
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class XFrameOptionsMiddleware(MiddlewareMixin):
... | bsd-3-clause |
kenju254/yowsup | yowsup/layers/protocol_groups/protocolentities/iq_result_groups_info.py | 59 | 4256 | from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class InfoGroupsResultIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{GROUP_ID}}" id="{{IQ_ID}}">
<group subject="{{GROUPSUBJ}}" creation="{{GROUP_CREATION_TYIME}}"
... | gpl-3.0 |
h3biomed/ansible-modules-core | cloud/rackspace/rax_cbs_attachments.py | 13 | 6789 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
Drooids/zulip | zerver/management/commands/create_realm.py | 114 | 3832 | from __future__ import absolute_import
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand
from zerver.lib.actions import do_create_realm, set_default_streams
from zerver.models import RealmAlias
if not settings.VOYAGER:
from zilencer.models import... | apache-2.0 |
Adai0808/BuildingMachineLearningSystemsWithPython | ch07/predict10k_en.py | 22 | 2428 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import numpy as np
from sklearn.datasets import load_svmlight_file
from sklearn.cross_validation import... | mit |
acenario/Payable | lib/python2.7/site-packages/django/contrib/postgres/forms/hstore.py | 313 | 1484 | import json
from django import forms
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStoreField']
class HStoreField(forms.CharField):
"""A field for HStore data which accepts JSON input."""
widget = forms.Te... | mit |
DragonQuiz/MCEdit-Unified | pymclevel/test/server_test.py | 13 | 1056 | import unittest
from pymclevel.minecraft_server import MCServerChunkGenerator
from templevel import TempLevel
from pymclevel.box import BoundingBox
__author__ = 'Rio'
class TestServerGen(unittest.TestCase):
def setUp(self):
# self.alphaLevel = TempLevel("Dojo_64_64_128.dat")
self.alphalevel = Tem... | isc |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.