repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Djabbz/wakatime | wakatime/packages/pygments_py3/pygments/lexers/dsls.py | 72 | 18768 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dsls
~~~~~~~~~~~~~~~~~~~~
Lexers for various domain-specific languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, words, inc... | bsd-3-clause |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Tools/webchecker/wcgui.py | 42 | 15090 | #! /usr/bin/env python
"""GUI interface to webchecker.
This works as a Grail applet too! E.g.
<APPLET CODE=wcgui.py NAME=CheckerWindow></APPLET>
Checkpoints are not (yet??? ever???) supported.
User interface:
Enter a root to check in the text entry box. To enter more than one root,
enter them one at a time a... | gpl-3.0 |
barnsnake351/neutron | neutron/agent/linux/polling.py | 30 | 2108 | # Copyright 2013 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 required by applicable law or agre... | apache-2.0 |
Nowis75/crazyflie-pc-client-leapmotion | setup.py | 4 | 2864 | #!/usr/bin/env python
from distutils.core import setup
import glob
import os
VERSION = '2013.4.99' # Year.Month.fix if fix=99 means dev version
try:
import py2exe
except ImportError:
print("Warning: py2exe not usable")
with open(os.path.join(os.path.dirname(__file__),
"lib",
... | gpl-2.0 |
shusenl/scikit-learn | sklearn/neighbors/nearest_centroid.py | 199 | 7249 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
marc-sensenich/ansible | lib/ansible/module_utils/network/sros/sros.py | 86 | 4333 | # 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 |
diagramsoftware/odoo | openerp/addons/base/ir/ir_config_parameter.py | 30 | 4709 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
Zhaoyanzhang/-myflasky | venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.py | 32 | 10320 | # postgresql/array.py
# Copyright (C) 2005-2017 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
from .base import ischema_names
from ...sql import expression, operators
from ..... | mit |
kanteshraj/ansible | lib/ansible/playbook/play_context.py | 8 | 17268 | # -*- coding: utf-8 -*-
# (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,... | gpl-3.0 |
manipopopo/tensorflow | tensorflow/python/keras/layers/local.py | 10 | 18583 | # 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 |
jcrudy/sklearntools | sklearntools/feature_selection.py | 1 | 15903 | import numpy as np
from sklearn.base import MetaEstimatorMixin, is_classifier, clone,\
TransformerMixin
from .sklearntools import STSimpleEstimator, _fit_and_score, DelegatingEstimator,\
BaseDelegatingEstimator, standard_methods
from sklearn.cross_validation import check_cv
from sklearn.metrics.scorer import ch... | bsd-3-clause |
haipersist/webspider | spider/jobspider/pipelines/down_image.py | 1 | 1075 | __author__ = 'BJHaibo'
import os
import scrapy
# from scrapy.spider import Request
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exceptions import DropItem
class MyImagePipeline(ImagesPipeline):
def __init__(self,store_uri,download_func=None):
# store_uri is automatically ... | mit |
CapOM/ChromiumGStreamerBackend | tools/telemetry/third_party/gsutilz/third_party/boto/boto/cloudformation/connection.py | 127 | 42922 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2014 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 wit... | bsd-3-clause |
adnanh/zulip | zerver/lib/bugdown/codehilite.py | 116 | 8441 | """
CodeHilite Extension for Python-Markdown
========================================
Adds code/syntax highlighting to standard Python-Markdown code blocks.
Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/).
Project website: <http://packages.python.org/Markdown/extensions/code_hilite.html>
Contact: markdo... | apache-2.0 |
campbe13/openhatch | vendor/packages/Django/tests/regressiontests/bug639/tests.py | 102 | 1434 | """
Tests for file field behavior, and specifically #639, in which Model.save()
gets called *again* for each FileField. This test will fail if calling a
ModelForm's save() method causes Model.save() to be called more than once.
"""
from __future__ import absolute_import
import os
import shutil
from django.core.files... | agpl-3.0 |
mbauskar/alec_frappe5_erpnext | erpnext/hr/report/employee_leave_balance/employee_leave_balance.py | 31 | 2575 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.reportview import execute as runreport
def execute(filters=None):
if not filters: filters = {}
e... | agpl-3.0 |
bcoca/ansible | lib/ansible/playbook/role_include.py | 18 | 7414 | #
# 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 in the hope tha... | gpl-3.0 |
piquadrat/django | tests/forms_tests/field_tests/test_charfield.py | 14 | 6327 | from django.forms import (
CharField, HiddenInput, PasswordInput, Textarea, TextInput,
ValidationError,
)
from django.test import SimpleTestCase
from . import FormFieldAssertionsMixin
class CharFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
def test_charfield_1(self):
f = CharField()
... | bsd-3-clause |
ebagdasa/tempest | tempest/api/image/v1/test_image_members_negative.py | 11 | 2155 | # Copyright 2013 IBM Corp.
#
# 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 t... | apache-2.0 |
e-koch/TurbuStat | Examples/paper_plots/test_fBM_delvar_vs_idl.py | 2 | 1776 |
'''
Compare Turbustat's Delta-variance to the original IDL code.
'''
from turbustat.statistics import DeltaVariance
from turbustat.simulator import make_extended
import astropy.io.fits as fits
from astropy.table import Table
import matplotlib.pyplot as plt
import astropy.units as u
import seaborn as sb
font_scale =... | mit |
RubnC/modified-spectral | spectral/tests/__init__.py | 2 | 2143 | #########################################################################
#
# __init__.py - This file is part of the Spectral Python (SPy) package.
#
# Copyright (C) 2013 Thomas Boggs
#
# Spectral Python is free software; you can redistribute it and/
# or modify it under the terms of the GNU General Public Lice... | gpl-2.0 |
ccastell/Transfer-System | Website/env/lib/python3.5/site-packages/django/db/models/fields/__init__.py | 10 | 88153 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import itertools
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import total_ordering
from django import forms
from django.apps import apps
from django.conf... | apache-2.0 |
buzz2vatsal/Deep-Bench | YOLO/retrain_yolo.py | 1 | 12522 | """
This is a script that can be used to retrain the YOLOv2 model for your own dataset.
"""
import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
import PIL
import tensorflow as tf
from keras import backend as K
from keras.layers import Input, Lambda, Conv2D
from keras.models import load_model,... | cc0-1.0 |
lokirius/python-for-android | python-build/python-libs/gdata/src/gdata/oauth/rsa.py | 225 | 4528 | #!/usr/bin/python
"""
requires tlslite - http://trevp.net/tlslite/
"""
import binascii
from gdata.tlslite.utils import keyfactory
from gdata.tlslite.utils import cryptomath
# XXX andy: ugly local import due to module name, oauth.oauth
import gdata.oauth as oauth
class OAuthSignatureMethod_RSA_SHA1(oauth.OAuthSign... | apache-2.0 |
LuckDragon82/demo | boilerplate/external/linkedin/linkedin.py | 11 | 35307 | # -*- coding: utf-8 -*-
#######################################################################################
# Python implementation of LinkedIn OAuth Authorization, Profile and Connection APIs. #
# #
# Author: Ozgur Vatansever... | lgpl-3.0 |
4022321818/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/sax/_exceptions.py | 625 | 4885 | """Different kinds of SAX Exceptions"""
#in brython the 4 lines below causes an $globals['Exception'] error
#import sys
#if sys.platform[:4] == "java":
# from java.lang import Exception
#del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can con... | gpl-3.0 |
mach0/QGIS | python/plugins/processing/modeler/OpenModelFromFileAction.py | 33 | 2413 | # -*- coding: utf-8 -*-
"""
***************************************************************************
OpenModelFromFileAction.py
---------------------
Date : February 2018
Copyright : (C) 2018 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
****... | gpl-2.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/numpy/distutils/extension.py | 89 | 2967 | """distutils.extension
Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.
Overridden to support f2py.
"""
from __future__ import division, absolute_import, print_function
import sys
import re
from distutils.extension import Extension as old_Extension
if sys.version_info[0] >= ... | bsd-3-clause |
chouseknecht/ansible | lib/ansible/module_utils/network/iosxr/argspec/l2_interfaces/l2_interfaces.py | 21 | 2647 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by ... | gpl-3.0 |
Twentysix26/26-Cogs | penis/penis.py | 1 | 1042 | import discord
import random
from discord.ext import commands
from cogs.utils.chat_formatting import pagify
class Penis:
"""Penis related commands."""
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def penis(self, ctx, *users: discord.Member):
"""D... | gpl-3.0 |
jbair34/moose | framework/contrib/nsiqcppstyle/rules/RULE_6_5_B_do_not_use_macro_for_constants.py | 43 | 2094 | """
Do not use macro for the constants.
if the constants is defined by macro. this rule reports a violation.
Instead, use enum or const variables.
However, it's ok to write a macro function.
And.. If the macro is start with underbar,
it regards this macro is defined for the special purpose
and it doesn't report a viol... | lgpl-2.1 |
skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/python/dist3.py | 23 | 8952 | # -*- test-case-name: twisted.python.test.test_dist3 -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for installing Twisted on Python 3.
Only necessary while parts of Twisted are unported.
@var modules: A list of modules that have been ported,
e.g. "twisted.python.versions... | gpl-2.0 |
pombreda/pygowave-server | pygowave_server/urls.py | 4 | 1194 |
#
# PyGoWave Server - The Python Google Wave Server
# Copyright 2009 Patrick Schneider <patrick.p2k.schneider@gmail.com>
#
# 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 |
saurabh6790/omnit-lib | webnotes/modules/import_file.py | 34 | 3331 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes, os
from webnotes.modules import scrub, get_module_path, scrub_dt_dn
import webnotes.plugins
def import_files(module, dt=None, dn=None, plugin=None, force=Fa... | mit |
Hashish420/SCRYPTCOIN | contrib/bitrpc/bitrpc.py | 1 | 7834 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:7462")
else:
access = Ser... | mit |
ajgallegog/gem5_arm | configs/topologies/Crossbar.py | 47 | 2679 | # Copyright (c) 2010 Advanced Micro Devices, 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... | bsd-3-clause |
TariqAHassan/ZeitSci | analysis/supplementary_fns.py | 1 | 4393 | import re
import time
from itertools import chain
def pprint(string, n=80):
"""
Pretty print a string, breaking it in chucks on length n.
"""
if not isinstance(string, str):
raise ValueError("Input must be a string!")
if len(string) < n:
print(string)
else:
# see http... | gpl-3.0 |
bokeh/bokeh | bokeh/models/widgets/panels.py | 1 | 1085 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
mdietrichc2c/OCB | addons/sale_crm/__openerp__.py | 52 | 2128 | # -*- 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 |
arbrandes/edx-platform | scripts/xsslint/xsslint/linters.py | 3 | 66920 | """
Linter classes containing logic for checking various filetypes.
"""
import ast
import io
import os
import re
import textwrap
from xsslint import visitors
from xsslint.reporting import ExpressionRuleViolation, FileResults, RuleViolation
from xsslint.rules import RuleSet
from xsslint.utils import Expression, Parse... | agpl-3.0 |
flying-circus/pyfilesystem | fs/expose/django_storage.py | 7 | 1948 | """
fs.expose.django
================
Use an FS object for Django File Storage
This module exposes the class "FSStorage", a simple adapter for using FS
objects as Django storage objects. Simply include the following lines
in your settings.py::
DEFAULT_FILE_STORAGE = fs.expose.django_storage.FSStorage
DEFAUL... | bsd-3-clause |
normanmaurer/autobahntestsuite-maven-plugin | src/main/resources/twisted/web/test/test_webclient.py | 1 | 38926 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the old L{twisted.web.client} APIs, C{getPage} and friends.
"""
from __future__ import division, absolute_import
import os
from errno import ENOSPC
try:
from urlparse import urlparse, urljoin
except ImportError:
from urlli... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/250_test_posix.py | 7 | 6643 | "Test posix functions"
from test import test_support
try:
import posix
except ImportError:
raise test_support.TestSkipped, "posix is not available"
import time
import os
import sys
import unittest
import warnings
warnings.filterwarnings('ignore', '.* potential security risk .*',
Runti... | gpl-3.0 |
beni55/sympy | sympy/plotting/pygletplot/__init__.py | 120 | 4266 | """Plotting module that can plot 2D and 3D functions
"""
from sympy.utilities.decorator import doctest_depends_on
try:
@doctest_depends_on(modules=('pyglet',))
def PygletPlot(*args, **kwargs):
"""
Plot Examples
=============
See examples/advanced/pyglet_plotting.py for many mo... | bsd-3-clause |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/webdesign/tests.py | 379 | 1054 | # -*- coding: utf-8 -*-
import unittest
from django.contrib.webdesign.lorem_ipsum import *
from django.template import loader, Context
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), u'lorem ipsum dolor sit amet consectetur adipisicing')
def test_paragraphs... | bsd-3-clause |
beeftornado/sentry | tests/sentry/api/serializers/test_debugfile.py | 3 | 2569 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from sentry.api.serializers import serialize
from sentry.testutils import TestCase
class DebugFileSerializerTest(TestCase):
def test_simple(self):
file = self.create_file(
name="baz.dSYM",
size=42,
headers... | bsd-3-clause |
caotianwei/django | tests/forms_tests/tests/test_error_messages.py | 169 | 11182 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import (
BooleanField, CharField, ChoiceField, DateField, DateTimeField,
DecimalField, EmailField, FileField, FloatField, Form,
GenericIPAddressField, IntegerField... | bsd-3-clause |
mwrightevent38/MissionPlanner | Lib/site-packages/numpy/core/getlimits.py | 54 | 8734 | """ Machine limits for Float32 and Float64 and (long double) if available...
"""
__all__ = ['finfo','iinfo']
from machar import MachAr
import numeric
import numerictypes as ntypes
from numeric import array
def _frz(a):
"""fix rank-0 --> rank-1"""
if a.ndim == 0: a.shape = (1,)
return a
_convert_to_float... | gpl-3.0 |
MakeHer/edx-platform | common/lib/xmodule/xmodule/modulestore/modulestore_settings.py | 197 | 5460 | """
This file contains helper functions for configuring module_store_setting settings and support for backward compatibility with older formats.
"""
import warnings
import copy
def convert_module_store_setting_if_needed(module_store_setting):
"""
Converts old-style module_store_setting configuration settings... | agpl-3.0 |
TangHao1987/intellij-community | python/helpers/profiler/profilerpy3/ttypes.py | 45 | 19680 | #
# Autogenerated by Thrift Compiler (1.0.0-dev)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thriftpy3.Thrift import TType, TMessageType, TException, TApplicationException
from thriftpy3.transport import TTransport
from thriftpy3.protocol import TBinaryProtocol,... | apache-2.0 |
vipul-sharma20/oh-mainline | vendor/packages/twisted/twisted/test/test_compat.py | 18 | 6186 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.compat}.
"""
import types, socket
from twisted.trial import unittest
from twisted.python.compat import set, frozenset, reduce
class IterableCounter:
def __init__(self, lim=0):
self.lim = lim
... | agpl-3.0 |
VirtueSecurity/aws-extender | BappModules/boto/kinesis/layer1.py | 33 | 41004 | # Copyright (c) 2014 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 ... | mit |
elssar/calibre | src/odf/style.py | 94 | 4676 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | gpl-3.0 |
keelhaule/alfanous | src/alfanous-django/wui/templatetags/kwacros.py | 7 | 6077 | #
# templatetags/kwacros.py - Support for macros in Django templates
#
# Based on snippet by
# Author: Michal Ludvig <michal@logix.cz>
# http://www.logix.cz/michal
#
# modified for args and kwargs by Skylar Saveland http://skyl.org
#
"""
Usage example:
0) Save this file as <yourapp>/templatetags/kwacros.py
... | agpl-3.0 |
iulian787/spack | var/spack/repos/builtin/packages/sloccount/package.py | 2 | 1122 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Sloccount(MakefilePackage):
"""SLOCCount is a set of tools for counting physical Source Lines of Code
(SLOC... | lgpl-2.1 |
fedebell/Laboratorio3 | relazione15/boltzPlot.py | 1 | 1911 | import uncertainties
from uncertainties import ufloat
import math
import numpy
import numpy
import pylab
from scipy.optimize import curve_fit
import math
import scipy.stats
import uncertainties
from uncertainties import unumpy
def quadratic(x, V0, Rt):
return V0*(1+(x/Rt))**0.5
INPUT = "/home/federico/Laboratorio3/... | gpl-3.0 |
lgarren/spack | var/spack/repos/builtin/packages/font-misc-ethiopic/package.py | 3 | 2109 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
browseinfo/7.0-server | openerp/tools/which.py | 456 | 6884 | #!/usr/bin/env python
""" Which - locate a command
* adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch
* see http://bugs.python.org/issue444582
* uses ``PATHEXT`` on Windows
* searches current directory before ``PATH`` on Windows,
but not before an explicitly passed ... | agpl-3.0 |
CARocha/sitioreddes | multimedia/migrations/0002_auto__add_multimedia.py | 1 | 4917 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Multimedia'
db.create_table(u'multimedia_multimedia', (
(u'id', self.gf('django.... | mit |
jhayworth/config | .emacs.d/elpy/rpc-venv/lib/python2.7/encodings/cp720.py | 417 | 13694 | """Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
python Tools/unicode/genwincodec.py 720
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,error... | gpl-3.0 |
magenta-aps/mox | oio_rest/oio_rest/db/db_helpers.py | 1 | 12383 | # Copyright (C) 2015-2019 Magenta ApS, https://magenta.dk.
# Contact: info@magenta.dk.
#
# 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/.
""""Encapsulate details about ... | mpl-2.0 |
omg-insa/server | 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 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/encodings/cp1257.py | 272 | 13374 | """ Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | lgpl-3.0 |
Sup3Roque/Pancas | plugin.video.loganaddon/resources/lib/libraries/cloudflare.py | 21 | 4174 |
#
# Copyright (C) 2015 tknorris (Derived from Mikey1234's & Lambda's)
#
# 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, or (at your option)
# any later version.
#
# ... | gpl-2.0 |
malie/theano-rbm-on-word-tuples | read.py | 1 | 1782 | import re
from sklearn.feature_extraction.text import CountVectorizer
def find_common_words(all_words, num_most_frequent_words):
vectorizer = CountVectorizer(
stop_words=None, # 'english',
max_features=num_most_frequent_words,
binary=True)
vectorizer.fit(all_words)
return (vectorize... | bsd-3-clause |
madslonnberg/blog | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/functional.py | 197 | 113704 | # -*- coding: utf-8 -*-
"""
pygments.lexers.functional
~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for functional languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, incl... | mit |
kaustubhhiware/coala-bears | bears/ruby/RubySmellBear.py | 21 | 8585 | import json
from coalib.bearlib import deprecate_settings
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.GemRequirement import GemRequirement
from coalib.results.Result import Result
from coalib.results.SourceRange import SourceRange
from coala_utils.param_conversion impo... | agpl-3.0 |
selahssea/ggrc-core | src/ggrc_basic_permissions/migrations/versions/20141217235626_51e046bb002_ensure_all_audit_leads_have_program_.py | 7 | 1449 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Ensure all Audit Leads have Program Editor role or better
Revision ID: 51e046bb002
Revises: 581a9621fac1
Create Date: 2014-12-17 23:56:26.323023
"""
# revision identifiers, used by Alembic.
revision =... | apache-2.0 |
tomlof/scikit-learn | doc/sphinxext/sphinx_gallery/docs_resolv.py | 23 | 16468 | # -*- coding: utf-8 -*-
# Author: Óscar Nájera
# License: 3-clause BSD
###############################################################################
# Documentation link resolver objects
from __future__ import print_function
import gzip
import os
import posixpath
import re
import shelve
import sys
# Try Python 2 fir... | bsd-3-clause |
Dees-Troy/android_kernel_asus_tf700t | tools/perf/python/twatch.py | 3213 | 1338 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
jchbh-duplicate/shadowsocks | shadowsocks/tcprelay.py | 922 | 28870 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
googleapis/googleapis-gen | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/user_list_service/transports/grpc.py | 1 | 11974 | # -*- coding: utf-8 -*-
# Copyright 2020 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... | apache-2.0 |
rwgdrummer/maskgen | other_plugins/CocoMaskSelector/__init__.py | 1 | 1743 | import maskgen
from maskgen_coco import createMaskImageWithParams
import sys
from maskgen.image_wrap import ImageWrapper
"""
Selects a Mask from Coco presegmented images
"""
def transform(img, source, target, **kwargs):
areaConstraints = (int(kwargs['area.lower.bound']) if 'area.lower.bound' in kwargs else 0,
... | bsd-3-clause |
40223136/2015cd_0505 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/util.py | 696 | 9917 | #
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import sys
import functools
import os
import itertools
import weakref
import atexit
import threading # we want threading to ... | agpl-3.0 |
osmr/utct | MXNet/trainer.py | 1 | 5876 | import logging
from .train_controller import TrainController, TrainControllerStopException
from utct.common.trainer_template import TrainerTemplate
import mxnet as mx
class Trainer(TrainerTemplate):
"""
Class, which provides training process under MXNet framework.
Parameters:
----------
model :... | mit |
alash3al/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | agpl-3.0 |
pinusm/Lilach-STIAT | plugins/quest_staircase_init/quest_staircase_init.py | 3 | 3970 | #-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... | gpl-3.0 |
holyangel/M9 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/site-packages/pypm/external/2/sqlalchemy/engine/ddl.py | 3 | 5234 | # engine/ddl.py
# Copyright (C) 2009-2011 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
"""Routines to handle CREATE/DROP workflow."""
from sqlalchemy import engine, schema
fr... | mit |
abstract-open-solutions/account-financial-tools | account_reversal/wizard/account_move_reverse.py | 31 | 4847 | # -*- coding: utf-8 -*-
##############################################################################
#
# Account reversal module for OpenERP
# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# Copyright (c) 2012-2013 Camp... | agpl-3.0 |
csachs/openmicroscopy | components/tools/OmeroWeb/test/unit/test_webgateway.py | 15 | 17881 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# coding=utf-8
import time
import os
import pytest
from webgateway.webgateway_cache import FileCache, WebGatewayCache
from webgateway.webgateway_cache import WebGatewayTempFile
import omero.gateway
class TestHelperObjects(object):
def testColorHolder(self):
... | gpl-2.0 |
nagyistoce/OpenBird | cocos2d/plugin/tools/toolsForGame/modifyProject.py | 255 | 1300 | import sys, string, os
from xml.etree import ElementTree as ET
from xml.dom import minidom
projFile = sys.argv[1]
targetPath = sys.argv[2]
def getLinkElement():
global targetPath
ret = ET.Element('link')
nameEle = ET.Element('name')
nameEle.text = 'plugin-x'
typeEle = ET.Element('type')
typeEl... | mit |
taoger/titanium_mobile | support/android/builder.py | 30 | 97623 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Appcelerator Titanium Mobile
# Copyright (c) 2011-2012 by Appcelerator, Inc. All Rights Reserved.
# Licensed under the terms of the Apache Public License
# Please see the LICENSE included with this distribution for details.
#
# General builder script for staging, packag... | apache-2.0 |
mgron/cf-api | ping.py | 1 | 1031 | from wheezy.http import HTTPResponse
from wheezy.http import WSGIApplication
from wheezy.routing import url
from wheezy.web.handlers import BaseHandler
from wheezy.web.middleware import bootstrap_defaults
from wheezy.web.middleware import path_routing_middleware_factory
class PingHandler(BaseHandler):
def get(sel... | mit |
crobinso/virt-manager | virtManager/object/storagepool.py | 2 | 8736 | # Copyright (C) 2008, 2013 Red Hat, Inc.
# Copyright (C) 2008 Cole Robinson <crobinso@redhat.com>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
import time
from virtinst import log
from virtinst import pollhelpers
from virtinst import StoragePool, StorageVo... | gpl-2.0 |
nicolaoun/NS3-AM-Proto-Simulation | utils/tests/test-test.py | 77 | 4843 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
#
# Copyright (c) 2014 Siddharth Santurkar
#
# 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 Softw... | gpl-2.0 |
pyupio/octohook | hook/hook.py | 2 | 3954 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import os
import imp
import hmac
import hashlib
import six
from flask import Flask, abort, request
DEBUG = os.environ.get("DEBUG", False) == 'True'
HOST = os.environ.get("HOST", '0.0.0.0')
ROOT_DIR = os.path.dirname(os.p... | mit |
cancro7/gem5 | util/stats/print.py | 90 | 5393 | # Copyright (c) 2003-2004 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
bayasist/vbox | src/VBox/Additions/common/crOpenGL/windows_exports.py | 22 | 2387 | # Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
def GenerateEntrypoints():
apiutil.CopyrightC()
print '#include "chromium.h"'
print '#include "stub.h"'
print ''
print '#define NAKED __dec... | gpl-2.0 |
payeldillip/django | django/contrib/auth/tokens.py | 433 | 2803 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | bsd-3-clause |
mangaki/mangaki | mangaki/mangaki/tests/test_anidb.py | 1 | 11241 | from datetime import datetime
import os
import responses
from django.conf import settings
from django.test import TestCase
from mangaki.models import Category, Editor, Studio, Work, RelatedWork, Role, Staff, Artist, TaggedWork, Tag
from mangaki.utils.anidb import to_python_datetime, AniDB, diff_between_anidb_and_loca... | agpl-3.0 |
chouseknecht/ansible | lib/ansible/modules/network/cloudvision/cv_server_provision.py | 52 | 24337 | #!/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 |
ronniehd/repository.ronniehd | program.plexus/resources/plexus/plexusutils/directoryhandle.py | 25 | 2478 | # -*- coding: utf-8 -*-
""" Plexus (c) 2015 enen92
This file contains the functions for xbmc addon directory handle
Functions:
addLink(name,url,iconimage,fan_art="%s/fanart.jpg"%settings.getAddonInfo("path")) -> Addlink function used in the 'whole' addon
addDir(name,url,mode,iconimage,total,pasta,... | gpl-3.0 |
jfpla/odoo | openerp/osv/query.py | 380 | 7513 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
tvibliani/odoo | openerp/addons/base/ir/ir_ui_view.py | 22 | 52474 | # -*- 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 |
gabrielfalcao/lettuce | tests/integration/django/dill/leaves/models.py | 18 | 1285 | from django.db import models
class Garden(models.Model):
name = models.CharField(max_length=100)
area = models.IntegerField()
raining = models.BooleanField()
@property
def howbig(self):
if self.area < 50:
return 'small'
elif self.area < 150:
return 'medium'... | gpl-3.0 |
skk/eche | eche/step2_eval.py | 1 | 1184 | import traceback
import sys
from eche.eche_readline import getline
from eche.reader import read_str, Blank
from eche.printer import print_str
from eche.eval import eval_ast
from eche.env import get_default_env
# noinspection PyPep8Naming
def READ(data):
return read_str(data)
# noinspection PyPep8Naming
def EV... | mit |
opensemanticsearch/open-semantic-etl | src/opensemanticetl/enhance_xml.py | 1 | 2394 | import xml.etree.ElementTree as ElementTree
import os.path
import sys
class enhance_xml(object):
def elements2data(self, element, data, path="xml"):
path += "/" + element.tag
fieldname = path + '_ss'
text = element.text.strip()
if text:
if fieldname in data:
... | gpl-3.0 |
CallaJun/hackprince | indico/matplotlib/axes/_axes.py | 10 | 260820 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import reduce, xrange, zip, zip_longest
import math
import warnings
import numpy as np
from numpy import ma
import matplotlib
rcParams = matplotlib.rcParams
import matplotlib.cbook... | lgpl-3.0 |
shahbazn/neutron | neutron/tests/unit/plugins/embrane/test_embrane_neutron_plugin.py | 40 | 2774 | # Copyright 2013 Embrane, 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.