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 |
|---|---|---|---|---|---|
alwayskidd/LRB | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Tools/ccroot.py | 19 | 13272 | #! /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
from waflib import Task,Utils,Node,Errors
from waflib.TaskGen import after_method,before_method,feature,taskgen_method,extension
from waflib.Tools import c_aliase... | gpl-2.0 |
kenorb/BitTorrent | twisted/scripts/tkmktap.py | 16 | 17390 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Implementation module for the graphical version of the `mktap` command.
"""
# System imports
import Tkinter, tkMessageBox, tkFileDialog, StringIO, os
import traceback
# Twisted imports
from twisted.application import service
fro... | gpl-3.0 |
google/trax | trax/models/rnn.py | 1 | 9301 | # coding=utf-8
# Copyright 2021 The Trax 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 a... | apache-2.0 |
umitproject/tease-o-matic | django/contrib/gis/gdal/prototypes/errcheck.py | 404 | 4207 | """
This module houses the error-checking routines used by the GDAL
ctypes prototypes.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.gdal.error import check_err, OGRException, SRSException
from django.contrib.gis.gdal.libgdal import lgdal
# Helper routines for retrieving pointers and/or values f... | bsd-3-clause |
AkihikoITOH/capybara | capybara/virtualenv/lib/python2.7/site-packages/pip/req/req_install.py | 30 | 43196 | from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import warnings
import zipfile
from distutils.util import change_root
from distutils import sysconfig
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from pip._vendor.dist... | mit |
kingthorin/zaproxy | docker/zap-api-scan.py | 6 | 25656 | #!/usr/bin/env python
# Zed Attack Proxy (ZAP) and its related class files.
#
# ZAP is an HTTP/HTTPS proxy for assessing web application security.
#
# Copyright 2017 ZAP Development Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... | apache-2.0 |
Priyansh2/test | web2py/taskmanagement/languages/id.py | 148 | 11233 | # coding: utf8
{
'!langcode!': 'id',
'!langname!': 'Indonesian',
'%d days ago': '%d hari yang lalu',
'%d hours ago': '%d jam yang lalu',
'%d minutes ago': '%d menit yang lalu',
'%d months ago': '%d bulan yang lalu',
'%d seconds ago': '%d detik yang lalu',
'%d seconds from now': '%d detik dari sekarang',
'%d weeks ago':... | gpl-3.0 |
textcad/pyMagpie | magpie/motor.py | 1 | 2154 | #!/usr/bin/env python
from textcad import *
import magpie.utility
import magpie.hardware
class Stepper(component.Element):
def __init__(self,
size="GenericNEMA17",
negative=False,
negativeLength=10):
component.Element.__init__(self, name="stepper")
... | mit |
inveniosoftware/invenio-base | invenio_base/__init__.py | 2 | 7398 | # -*- 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.
"""Invenio application loader.
Quickstart
----------
Invenio-Base is taking advantag... | mit |
foss-transportationmodeling/rettina-server | .env/local/lib/python2.7/encodings/big5hkscs.py | 816 | 1039 | #
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_hk, codecs
import _multibytecodec as mbc
codec = _codecs_hk.getcodec('big5hkscs')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.Multib... | apache-2.0 |
bodi000/odoo | addons/stock/report/product_stock.py | 376 | 4868 | # -*- 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 |
restless/django-guardian | guardian/utils.py | 1 | 4832 | """
django-guardian helper functions.
Functions defined within this module should be considered as django-guardian's
internal functionality. They are **not** guaranteed to be stable - which means
they actual input parameters/output type may change in future releases.
"""
import os
import logging
from itertools import ... | bsd-2-clause |
omnirom/android_kernel_oppo_apq8064 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
hamole/pbl8 | pbl8_project/pbl/migrations/0003_auto.py | 1 | 3700 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding M2M table for field studies_for on 'Treatment'
m2m_table_name = db.shorten_name(u'pbl_treatment_stu... | mit |
blurstudio/cross3d | cross3d/softimage/external.py | 1 | 4267 | ##
# \namespace cross3d.softimage.external
#
# \remarks This class can be used even outside of softimage. It gives you info on where
# softimage is installed, and allows you to run scripts in softimage.
# To Access this class use: cross3d.external('softimage')
#
# \author dougl
# \author Blur Studio
... | mit |
provaleks/o8 | addons/account_budget/wizard/account_budget_crossovered_report.py | 375 | 2089 | # -*- 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 |
Geof23/SESABench_II | parboil/driver/benchmark.py | 1 | 19162 | # (c) 2007 The Board of Trustees of the University of Illinois.
import sys
import os
from os import path
import re
from itertools import imap, repeat, chain
import globals
import process
import parboilfile as pbf
from futures import Future
from error import ErrorType
class Benchmark(object):
"""A benchmark.
... | mit |
molotof/infernal-twin | build/pip/pip/_vendor/packaging/version.py | 439 | 11949 | # Copyright 2014 Donald Stufft
#
# 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, so... | gpl-3.0 |
agry/NGECore2 | scripts/mobiles/instances/tuskenking/tusken/tusken_raider.py | 2 | 1552 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
jakirkham/bokeh | bokeh/command/subcommands/html.py | 3 | 4243 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
theo-l/django | tests/admin_inlines/models.py | 10 | 7855 | """
Testing of admin inline formsets.
"""
import random
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Parent(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
retur... | bsd-3-clause |
realsobek/freeipa | ipalib/cli.py | 2 | 47051 | # Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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, ei... | gpl-3.0 |
oxc/Flexget | flexget/plugins/sites/bakabt.py | 3 | 1621 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugins.internal.urlrewriting import UrlRewritingError
from flexget.utils.soup import get... | mit |
yongtang/tensorflow | tensorflow/python/keras/utils/generic_utils_test.py | 6 | 15931 | # 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 |
cristian69/KernotekV3 | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py | 949 | 19104 | ######################## 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 |
systers/mailman-old-archive | src/mailman/utilities/modules.py | 7 | 3895 | # Copyright (C) 2009-2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... | gpl-3.0 |
mapennell/ansible | lib/ansible/vars/hostvars.py | 36 | 1758 | # (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 |
alistairlow/tensorflow | tensorflow/contrib/graph_editor/tests/util_test.py | 154 | 6110 | # 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 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/numpy/distutils/tests/gen_ext/setup.py | 49 | 1099 | #!/usr/bin/env python
fib3_f = '''
C FILE: FIB3.F
SUBROUTINE FIB(A,N)
C
C CALCULATE FIRST N FIBONACCI NUMBERS
C
INTEGER N
REAL*8 A(N)
Cf2py intent(in) n
Cf2py intent(out) a
Cf2py depend(n) a
DO I=1,N
IF (I.EQ.1) THEN
A(I) = 0.0D0
ELSEIF (I.EQ.2) THEN
... | agpl-3.0 |
chrisdearman/micropython | py/makeqstrdata.py | 29 | 5496 | """
Process raw qstr file and output qstr data with length, hash and data bytes.
This script works with Python 2.6, 2.7, 3.3 and 3.4.
"""
from __future__ import print_function
import re
import sys
# Python 2/3 compatibility:
# - iterating through bytes is different
# - codepoint2name lives in a different module... | mit |
NeuralEnsemble/elephant | elephant/test/test_change_point_detection.py | 2 | 8884 | # -*- coding: utf-8 -*-
import unittest
import neo
import numpy as np
import quantities as pq
from numpy.testing import assert_array_almost_equal, assert_allclose
import elephant.change_point_detection as mft
class FilterTestCase(unittest.TestCase):
def setUp(self):
self.test_array = [0.4, 0.5, 0.65, 0.... | bsd-3-clause |
cloudbau/keystone | keystone/tests/test_singular_plural.py | 8 | 2293 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
aspidites/django | tests/app_loading/tests.py | 288 | 3113 | from __future__ import unicode_literals
import os
from django.apps import apps
from django.test import SimpleTestCase
from django.test.utils import extend_sys_path
from django.utils import six
from django.utils._os import upath
class EggLoadingTest(SimpleTestCase):
def setUp(self):
self.egg_dir = '%s/e... | bsd-3-clause |
DANCEcollaborative/forum-xblock | XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/views/csrf.py | 91 | 3798 | from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.conf import settings
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and there isn't any
# other way of making it available ... | mit |
allenlavoie/tensorflow | tensorflow/contrib/receptive_field/python/util/examples/write_inception_resnet_v2_graph.py | 49 | 2032 | # 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 |
simongibbons/numpy | numpy/polynomial/tests/test_polynomial.py | 10 | 20035 | """Tests for polynomial module.
"""
from functools import reduce
import numpy as np
import numpy.polynomial.polynomial as poly
from numpy.testing import (
assert_almost_equal, assert_raises, assert_equal, assert_,
assert_warns, assert_array_equal, assert_raises_regex)
def trim(x):
return poly.polytrim(x... | bsd-3-clause |
xiongzhenggang/xiongzhenggang.github.io | AI/data/deeplearning24054/planar_utils.py | 2 | 2271 | import matplotlib.pyplot as plt
import numpy as np
import sklearn
import sklearn.datasets
import sklearn.linear_model
def plot_decision_boundary(model, X, Y):
# Set min and max values and give it some padding
x_min, x_max = X[0, :].min() - 1, X[0, :].max() + 1
y_min, y_max = X[1, :].min() - 1, X[1, :].max(... | gpl-3.0 |
allevin/PyGithub | tests/SourceImport.py | 2 | 3879 | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2018 Hayden Fuss <wifu1234@gmail.com> #
# ... | lgpl-3.0 |
bchareyre/ratchet | gui/qt4/SerializableEditor.py | 1 | 34633 | # encoding: utf-8
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4 import QtGui
import re,itertools
import logging
logging.trace=logging.debug
logging.basicConfig(level=logging.INFO)
from yade import *
import yade.qt
try:
from minieigen import *
except ImportError:
from miniEigen import *
seqSeri... | gpl-2.0 |
kalahbrown/HueBigSQL | desktop/core/ext-py/requests-2.6.0/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | apache-2.0 |
chenbojian/SU2 | SU2_PY/parallel_computation.py | 1 | 3981 | #!/usr/bin/env python
## \file parallel_computation.py
# \brief Python script for doing the continuous adjoint computation using the SU2 suite.
# \author T. Economon, T. Lukaczyk, F. Palacios
# \version 3.2.9 "eagle"
#
# SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
# ... | lgpl-2.1 |
citrix-openstack-build/keystoneauth | keystoneauth1/service_providers.py | 6 | 1590 | # 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
# distributed under the Li... | apache-2.0 |
midniteio/npm | node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 1524 | 22178 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | artistic-2.0 |
donaldharvey/snappy | snappy/utils.py | 1 | 2623 | import urllib2
import urllib
import os
from mimetools import choose_boundary
from mimetypes import guess_type
import stat
class Singleton(type):
def __init__(self, name, bases, dict):
super(Singleton, self).__init__(name, bases, dict)
self.instance = None
def __call__(self, *args, **kw):
if self.instance is No... | gpl-3.0 |
tjwei/jedi | sith.py | 24 | 7100 | #!/usr/bin/env python
"""
Sith attacks (and helps debugging) Jedi.
Randomly search Python files and run Jedi on it. Exception and used
arguments are recorded to ``./record.json`` (specified by --record)::
./sith.py random /path/to/sourcecode
Redo recorded exception::
./sith.py redo
Show recorded exceptio... | mit |
gonboy/sl4a | python/src/Lib/test/test_audioop.py | 56 | 5833 | import audioop
import unittest
from test.test_support import run_unittest
def gendata1():
return '\0\1\2'
def gendata2():
if audioop.getsample('\0\1', 2, 0) == 1:
return '\0\0\0\1\0\2'
else:
return '\0\0\1\0\2\0'
def gendata4():
if audioop.getsample('\0\0\0\1', 4, 0) == 1:
re... | apache-2.0 |
bplancher/odoo | addons/web_editor/models/ir_ui_view.py | 40 | 4947 | # -*- coding: utf-8 -*-
import copy
import openerp
from openerp.exceptions import AccessError
from openerp.osv import osv
from lxml import etree, html
from openerp import api
class view(osv.osv):
_inherit = 'ir.ui.view'
@api.cr_uid_ids_context
def render(self, cr, uid, id_or_xml_id, values=None, engine='... | agpl-3.0 |
pavlova-marina/QGIS | python/plugins/processing/algs/qgis/Delaunay.py | 8 | 4281 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Delaunay.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************************... | gpl-2.0 |
chippey/gaffer | python/GafferTest/UndoTest.py | 1 | 5828 | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | bsd-3-clause |
simonwydooghe/ansible | lib/ansible/plugins/terminal/dellos10.py | 125 | 2767 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Copyright (c) 2017 Dell Inc.
#
# 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 |
bjmorgan/vasppy | docs/source/conf.py | 1 | 5544 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# vasppy documentation build configuration file, created by
# sphinx-quickstart on Tue Mar 6 13:36:30 2018.
#
# 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
# aut... | mit |
michaelBenin/django-oscar | tests/unit/offer/results_tests.py | 62 | 1039 | from decimal import Decimal as D
from django.test import TestCase
from oscar.apps.offer import models, results
class TestOfferApplicationsObject(TestCase):
def setUp(self):
self.applications = results.OfferApplications()
self.offer = models.ConditionalOffer()
def test_is_countable(self):
... | bsd-3-clause |
blackbliss/callme | flask/lib/python2.7/site-packages/sqlalchemy/util/topological.py | 79 | 2656 | # util/topological.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
"""Topological sorting algorithms."""
from ..exc import CircularDependencyError
f... | mit |
therearesomewhocallmetim/omim | 3party/Alohalytics/tests/googletest/xcode/Scripts/versiongenerate.py | 3088 | 4536 | #!/usr/bin/env python
#
# Copyright 2008, 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... | apache-2.0 |
farazaftab/sjhschool | node_modules/node-gyp/gyp/pylib/gyp/__init__.py | 1524 | 22178 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import traceback
from gyp.common import GypErr... | mit |
mydongistiny/android_external_skia | gm/rebaseline_server/column.py | 67 | 2679 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
ColumnHeaderFactory class (see class docstring for details)
"""
# Keys used within dictionary representation of each column header.
# NOTE: Keep these in sync with stati... | bsd-3-clause |
intel-hadoop/Big-Data-Benchmark-for-Big-Bench | engines/hive/queries/q08/q08_filter_sales_with_reviews_viewed_before.py | 1 | 3144 | #"INTEL CONFIDENTIAL"
#Copyright 2016 Intel Corporation All Rights Reserved.
#
#The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers and... | apache-2.0 |
DavidNorman/tensorflow | tensorflow/python/keras/layers/core_test.py | 2 | 16420 | # 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 |
goddardl/cortex | test/IECore/GenericImageTest.py | 12 | 11703 | ##########################################################################
#
# Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | bsd-3-clause |
2014c2g9/c2g9 | wsgi/static/reeborg/src/libraries/brython/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-2.0 |
40223211/cadb_g7_w18test | static/Brython3.1.1-20150328-091302/Lib/_struct.py | 726 | 13787 | #
# This module is a pure Python version of pypy.module.struct.
# It is only imported if the vastly faster pypy.module.struct is not
# compiled in. For now we keep this version for reference and
# because pypy.module.struct is not ootype-backend-friendly yet.
#
# this module 'borrowed' from
# https://bitbucket.org/p... | gpl-3.0 |
Just-D/chromium-1 | tools/telemetry/third_party/gsutilz/third_party/boto/boto/ec2/autoscale/limits.py | 152 | 1958 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | bsd-3-clause |
jasco/authomatic | tests/functional_tests/expected_values/plurk.py | 3 | 3359 | # -*- coding: utf-8 -*-
import re
import fixtures
import constants
from authomatic.providers import oauth1
conf = fixtures.get_configuration('plurk')
LINK = 'http://www.plurk.com/{0}/'.format(conf.user_username)
PICTURE = 'http://avatars.plurk.com/{0}-big2.jpg'.format(conf.user_id)
CONFIG = {
'login_xpath': '/... | mit |
richard-willowit/odoo | setup/setup_dev.py | 3 | 5655 | #!/usr/bin/env python
#----------------------------------------------------------
# odoo cli
#
# To install your odoo development environement type:
#
# wget -O- https://raw.githubusercontent.com/odoo/odoo/10.0/setup/setup_dev.py | python
#
# The setup_* subcommands used to boostrap odoo are defined here inline and may... | gpl-3.0 |
cyberark-bizdev/ansible | lib/ansible/modules/network/f5/bigip_snmp.py | 23 | 8174 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
venmo/ansible | lib/ansible/module_utils/gce.py | 305 | 4179 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
def-/commandergenius | project/jni/python/src/Demo/sockets/gopher.py | 47 | 9784 | #! /usr/bin/env python
# A simple gopher client.
#
# Usage: gopher [ [selector] host [port] ]
import string
import sys
import os
import socket
# Default selector, host and port
DEF_SELECTOR = ''
DEF_HOST = 'gopher.micro.umn.edu'
DEF_PORT = 70
# Recognized file types
T_TEXTFILE = '0'
T_MENU = '1'
T_CSO... | lgpl-2.1 |
Communities-Communications/cc-odoo | addons/website_sale/controllers/main.py | 7 | 41959 | # -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
from openerp.addons.website.models.website import slug
from openerp.addons.web.controllers.main import login_redirect
PPG = 20 # Products Per Page
PP... | agpl-3.0 |
Venturi/cms | env/lib/python2.7/site-packages/cms/migrations/0002_auto_20140816_1918.py | 45 | 8472 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import cms.models.static_placeholder
import cms.models.fields
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models, migrations
import django.utils.timezone
User = get_user_model()
user_model_label ... | gpl-2.0 |
viswimmer1/PythonGenerator | data/python_files/34574373/cmss.py | 1 | 2623 | import win32pipe
import win32console
import win32process
import time
import win32con
import codecs
import ctypes
user32 = ctypes.windll.user32
CONQUE_WINDOWS_VK = {
'3' : win32con.VK_CANCEL,
'8' : win32con.VK_BACK,
'9' : win32con.VK_TAB,
'12' : win32con.VK_CLEAR,
'13' : win32con.V... | gpl-2.0 |
Immortalin/python-for-android | python3-alpha/extra_modules/gdata/Crypto/Util/RFC1751.py | 43 | 20130 | #!/usr/bin/python
# rfc1751.py : Converts between 128-bit strings and a human-readable
# sequence of words, as defined in RFC1751: "A Convention for
# Human-Readable 128-bit Keys", by Daniel L. McDonald.
__revision__ = "$Id: RFC1751.py,v 1.6 2003/04/04 15:15:10 akuchling Exp $"
import string, binascii
from functools... | apache-2.0 |
Dubniak/SafeDroid | FeatureExtractionServer/androguard/core/bytecode.py | 2 | 13435 | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... | gpl-3.0 |
ravibhure/ansible | lib/ansible/modules/cloud/google/gce_mig.py | 23 | 30107 | #!/usr/bin/python
# Copyright 2016 Google Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
airanmehr/bio | Scripts/TimeSeriesPaper/Plot/topSNPs.py | 1 | 1589 | '''
Copyleft Oct 14, 2016 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com
'''
import numpy as np;
np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd;
pd.options.display.max_rows = 20;
pd.options.display.expand_frame_repr = False
import seaborn as sns
im... | mit |
adpg211/bitcoin-master | qa/rpc-tests/p2p-acceptblock.py | 2 | 12388 | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
fro... | mit |
libvirt/autotest | server/hosts/base_classes.py | 4 | 2686 | #
# Copyright 2007 Google Inc. Released under the GPL v2
"""
This module defines the base classes for the server Host hierarchy.
Implementation details:
You should import the "hosts" package instead of importing each type of host.
Host: a machine on which you can run programs
RemoteHost: a remote mac... | gpl-2.0 |
hronoses/vispy | examples/collections/tiger.py | 18 | 2455 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: testskip
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License.
# -------------------------------------------------------------------... | bsd-3-clause |
svn2github/kgyp | test/win/gyptest-link-generate-manifest.py | 238 | 4708 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure we generate a manifest file when linking binaries, including
handling AdditionalManifestFiles.
"""
import TestGyp
import sys... | bsd-3-clause |
chewable/django | django/contrib/comments/views/comments.py | 4 | 4457 | from django import http
from django.conf import settings
from utils import next_redirect, confirmation_view
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.template.loader import ren... | bsd-3-clause |
SDSG-Invenio/invenio | invenio/modules/records/upgrades/records_2014_08_22_create_record_json.py | 15 | 2007 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
denisenkom/django | django/db/models/sql/aggregates.py | 4 | 4124 | """
Classes to represent the default SQL aggregate functions
"""
import copy
from django.db.models.fields import IntegerField, FloatField
# Fake fields used to identify aggregate types in data-conversion operations.
ordinal_aggregate_field = IntegerField()
computed_aggregate_field = FloatField()
class Aggregate(obj... | bsd-3-clause |
edensparkles/FIRSTAID | FIRST_AID/venv/Lib/site-packages/flask/config.py | 45 | 9602 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import types
import errno
from werkzeug.utils import import_string
from ._compat import string_ty... | mit |
Serag8/Bachelor | google_appengine/google/appengine/tools/devappserver2/channel.py | 8 | 3687 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
krisys/django | tests/check_framework/test_multi_db.py | 50 | 1661 | from django.db import connections, models
from django.test import TestCase, mock
from django.test.utils import isolate_apps, override_settings
class TestRouter(object):
"""
Routes to the 'other' database if the model name starts with 'Other'.
"""
def allow_migrate(self, db, app_label, model_name=None,... | bsd-3-clause |
edx/edx-load-tests | util/generate_summary.py | 1 | 3450 | # -*- coding: utf-8 -*-
"""
Generate a summary of a previous loadtest run in this environment.
See for usage example in a jenkins job dsl:
https://github.com/edx/jenkins-job-dsl/blob/master/testeng/jobs/loadtestDriver.groovy
Prerequisites:
A logfile produced by util/run-loadtest.sh should be present in its
s... | apache-2.0 |
davidmueller13/ZenKernel_Flounder | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
windyuuy/opera | chromium/src/third_party/python_26/Lib/site-packages/isapi/samples/test.py | 21 | 6282 | # This extension is used mainly for testing purposes - it is not
# designed to be a simple sample, but instead is a hotch-potch of things
# that attempts to exercise the framework.
from isapi import isapicon
from isapi.simple import SimpleExtension
import sys, os, stat
if hasattr(sys, "isapidllhandle"):
import wi... | bsd-3-clause |
fenginx/django | django/contrib/gis/gdal/field.py | 59 | 6626 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils.encoding import force_str
# For more information, see the OGR... | bsd-3-clause |
sociateru/django-nose | testapp/settings.py | 9 | 1272 | """
Django settings for testing django-nose.
Configuration is overriden by environment variables:
DATABASE_URL - See https://github.com/kennethreitz/dj-database-url
USE_SOUTH - Set to 1 to include South in INSTALLED_APPS
TEST_RUNNER - Dotted path of test runner to use (can also use --test-runner)
NOSE_PLUGINS - Comma... | bsd-3-clause |
SiccarPoint/numpy | numpy/core/tests/test_unicode.py | 33 | 14427 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.compat import asbytes, unicode, sixu
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_array_equal)
# Guess the UCS length for this python interpreter
if sys.version_info[... | bsd-3-clause |
lmregus/Portfolio | python/design_patterns/env/lib/python3.7/site-packages/prompt_toolkit/eventloop/coroutine.py | 1 | 3783 | from __future__ import unicode_literals
import types
from prompt_toolkit.eventloop.defaults import get_event_loop
from prompt_toolkit.eventloop.future import Future
__all__ = [
'From',
'Return',
'ensure_future',
]
def ensure_future(future_or_coroutine):
"""
Take a coroutine (generator) or a `Futu... | mit |
adamwwt/chvac | venv/lib/python2.7/site-packages/sqlalchemy/orm/path_registry.py | 21 | 8069 | # orm/path_registry.py
# Copyright (C) 2005-2015 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
"""Path tracking utilities, representing mapper graph traversals.
"""
from .. ... | mit |
mttr/django | django/db/migrations/graph.py | 351 | 10956 | from __future__ import unicode_literals
import warnings
from collections import deque
from functools import total_ordering
from django.db.migrations.state import ProjectState
from django.utils.datastructures import OrderedSet
from django.utils.encoding import python_2_unicode_compatible
from .exceptions import Circu... | bsd-3-clause |
yitian134/chromium | chrome/test/functional/ap_lab/dlink_ap_configurator.py | 76 | 12111 | # 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.
import logging
import os
import ap_configurator
import selenium.common.exceptions
class DLinkAPConfigurator(ap_configurator.APConfigurator):
"""Deri... | bsd-3-clause |
Filechaser/nzbToMedia | libs/unidecode/x063.py | 252 | 4656 | data = (
'Bo ', # 0x00
'Chi ', # 0x01
'Gua ', # 0x02
'Zhi ', # 0x03
'Kuo ', # 0x04
'Duo ', # 0x05
'Duo ', # 0x06
'Zhi ', # 0x07
'Qie ', # 0x08
'An ', # 0x09
'Nong ', # 0x0a
'Zhen ', # 0x0b
'Ge ', # 0x0c
'Jiao ', # 0x0d
'Ku ', # 0x0e
'Dong ', # 0x0f
'Ru ', # 0x10
'Tiao ... | gpl-3.0 |
hyqneuron/pylearn2-maxsom | pylearn2/expr/tests/test_normalize.py | 44 | 3322 | from __future__ import print_function
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
import warnings
from theano.compat.six.move... | bsd-3-clause |
crepererum/invenio | invenio/legacy/docextract/convert_journals.py | 15 | 4921 | # -*- 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 |
Unow/edx-platform | lms/djangoapps/instructor/features/data_download.py | 34 | 3374 | """
Define steps for instructor dashboard - data download tab
acceptance tests.
"""
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_in, assert_regexp_matches # pylint: disable=E0611
from terrain.steps import reload_the_page
from splinter.request_handler.r... | agpl-3.0 |
candango/firenado | tests/util/url_util_test.py | 2 | 1895 | #!/usr/bin/env python
#
# Copyright 2015-2021 Flavio Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
azmikamis/ud032 | Lesson_5_Problem_Set/02-Region_Cities/region.py | 9 | 1642 | #!/usr/bin/env python
"""
Use an aggregation query to answer the following question.
Which Region in India has the largest number of cities with longitude between 75 and 80?
Please modify only the 'make_pipeline' function so that it creates and returns an aggregation
pipeline that can be passed to the MongoDB aggre... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.