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 |
|---|---|---|---|---|---|
factorlibre/sale-workflow | sale_exception_nostock/model/sale.py | 33 | 9058 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi, Leonardo Pistone
# Copyright 2013, 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version ... | agpl-3.0 |
rdo-infra/releng | rdoutils/cmd/check_dependants.py | 1 | 10118 | #! /usr/bin/python3
#
# Mostly copied code from find_unblocked_orphans.py in fedora
#
# Credits to original authors:
# Jesse Keating <jkeating@redhat.com>
# Till Maas <opensource@till.name>
#
# Copyright (c) 2009-2013 Red Hat
# SPDX-License-Identifier: GPL-2.0
#
# From:
# https://pagure.io/releng/blob/main/f/sc... | apache-2.0 |
Shanto/ajenti | plugins/filesystems/main.py | 2 | 7594 | from ajenti.ui import *
from ajenti.com import implements
from ajenti.app.api import ICategoryProvider
from ajenti.app.helpers import *
from ajenti.utils import *
import backend
class FSPlugin(CategoryPlugin):
text = 'Filesystems'
icon = '/dl/filesystems/icon_small.png'
folder = 'system'
def on_init... | lgpl-3.0 |
PatrickOReilly/scikit-learn | sklearn/tests/test_metaestimators.py | 57 | 4958 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
XBMC-Addons/script.module.geopy | lib/geopy/geocoders/bing.py | 2 | 6001 | """
:class:`.Bing` geocoder.
"""
from geopy.compat import urlencode
from geopy.geocoders.base import Geocoder, DEFAULT_FORMAT_STRING, \
DEFAULT_TIMEOUT, DEFAULT_SCHEME
from geopy.location import Location
from geopy.util import logger, join_filter
class Bing(Geocoder):
"""
Geocoder using the Bing Maps Loc... | mit |
dpiers/coderang-meteor | public/jsrepl/extern/python/unclosured/lib/python2.7/encodings/iso2022_jp_1.py | 816 | 1061 | #
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_1')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incrementa... | mit |
dhellmann/openstack-release-test | doc/source/conf.py | 1 | 2460 | # -*- 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 |
golismero/golismero | misc/old_tests/plugin_tests/ui/test.py | 8 | 4271 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it under the terms of... | gpl-2.0 |
dannyperry571/theapprentice | plugin.video.youtube/resources/lib/kodion/impl/xbmc/xbmc_items.py | 25 | 2538 | __author__ = 'bromix'
import xbmcgui
from ...items import VideoItem, AudioItem, UriItem
from . import info_labels
def to_video_item(context, video_item):
context.log_debug('Converting VideoItem')
item = xbmcgui.ListItem(label=video_item.get_name(),
iconImage=u'DefaultVideo.png',
... | gpl-2.0 |
tasleson/lsm-ci | testing/server.py | 1 | 1369 | #!/usr/bin/env python3
"""
Test development server.
"""
import socket
import ssl
import testlib
import traceback
import sys
bindsocket = socket.socket()
bindsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
bindsocket.bind(("", 8675))
bindsocket.listen(5)
while True:
print("Waiting for a client...")
... | apache-2.0 |
dkillick/iris | tools/generate_std_names.py | 12 | 4673 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris 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 the License, or
# (at your option) any l... | lgpl-3.0 |
hisaharu/ryu | ryu/tests/unit/ofproto/test_ofproto.py | 36 | 3093 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
tommo/gii | lib/3rdparty/common/pygments/lexers/haxe.py | 72 | 30953 | # -*- coding: utf-8 -*-
"""
pygments.lexers.haxe
~~~~~~~~~~~~~~~~~~~~
Lexers for Haxe and related stuff.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, by... | mit |
agry/NGECore2 | scripts/static_spawns/naboo/theed.py | 2 | 1499 | import sys
from resources.datatables import Options
from resources.datatables import StateStatus
def addPlanetSpawns(core, planet):
stcSvc = core.staticService
objSvc = core.objectService
#junkdealer
stcSvc.spawnObject('junkdealer', 'naboo', long(0), float(-5694), float(6.5), float(4182), float(0.707), float(... | lgpl-3.0 |
PurpleBooth/python-vm | venv/lib/python2.7/site-packages/setuptools/tests/__init__.py | 147 | 11160 | """Tests for the 'setuptools' package"""
import sys
import os
import distutils.core
import distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
from distutils.errors import DistutilsSetupError
from distutils.core import Extension
from distutils.version import LooseVersion
from setupto... | mit |
edx-solutions/edx-platform | common/lib/xmodule/xmodule/timeinfo.py | 4 | 1499 |
import logging
import six
from xmodule.fields import Timedelta
log = logging.getLogger(__name__)
class TimeInfo(object):
"""
This is a simple object that calculates and stores datetime information for an XModule
based on the due date and the grace period string
So far it parses out three differen... | agpl-3.0 |
meteorfox/PerfKitBenchmarker | perfkitbenchmarker/providers/rackspace/flags.py | 3 | 2355 | # Copyright 2015 PerfKitBenchmarker 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 appli... | apache-2.0 |
SoftwareMaven/django | django/core/mail/__init__.py | 347 | 4697 | """
Tools for sending email.
"""
from __future__ import unicode_literals
from django.conf import settings
# Imported for backwards compatibility and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (Se... | bsd-3-clause |
wrzwicky/fofix | fofix/core/Mesh.py | 6 | 8951 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/docutils/parsers/rst/directives/admonitions.py | 126 | 2413 | # $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst import Directive
from docutils.parsers.rst import states, di... | agpl-3.0 |
kbase/data_api | lib/doekbase/data_api/sequence/assembly/service/thrift_service.py | 3 | 143255 | #
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:twisted
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTr... | mit |
martinwicke/tensorflow | tensorflow/python/framework/dtypes_test.py | 9 | 11907 | # 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 |
aakashsinha19/Aspectus | Image Classification/models/slim/nets/inception_resnet_v2.py | 3 | 12785 | # 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 applicable ... | apache-2.0 |
ridfrustum/lettuce | tests/integration/lib/Django-1.3/django/contrib/gis/maps/google/__init__.py | 603 | 2648 | """
This module houses the GoogleMap object, used for generating
the needed javascript to embed Google Maps in a Web page.
Google(R) is a registered trademark of Google, Inc. of Mountain View, California.
Example:
* In the view:
return render_to_response('template.html', {'google' : GoogleMap(key="... | gpl-3.0 |
nanorepublica/err | errbot/__init__.py | 3 | 12055 | import argparse
from functools import wraps
import logging
import re
import shlex
import sys
from .core_plugins.wsview import bottle_app, WebView
from .utils import compat_str
from .utils import PY2, PY3 # noqa gbin: this is now used by plugins
from .botplugin import BotPlugin, SeparatorArgParser, ShlexArgParser # n... | gpl-3.0 |
tmagomedov/clBLAS | src/library/blas/AutoGemm/UserGemmKernelSources/create_user_gemm_cl_kernels.py | 5 | 1300 | """
Run from same directory as this file is in
Generates UserGemmClKernels.cc
Would be nice to use Jinja2 for this, but using print for now, for consistency
"""
kernelNames = []
# lets just read the kernel names from UserGemmClKernels.h:
ifile = open('UserGemmClKernels.h', 'r')
contents = ifile.read()
for line in con... | apache-2.0 |
dlstadther/luigi | test/task_history_test.py | 26 | 1687 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
telefonicaid/murano | murano/common/messaging/mqclient.py | 1 | 3376 | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | apache-2.0 |
MehtapIsik/bayesian-itc | bitc/instruments.py | 2 | 4124 | """Contains Isothermal titration calorimeter instrument classes."""
import re
import logging
from bitc.units import ureg
logger = logging.getLogger(__name__)
class Instrument(object):
"""
An isothermal titration calorimeter instrument.
An instrument object consists of several types of data:
* the... | gpl-3.0 |
mxd1971/-ssh-root-2a02-4780-1-1--1-e01 | shadowsocks/utils.py | 26 | 10309 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 clowwindy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... | mit |
ms-iot/python | cpython/Lib/logging/config.py | 17 | 35944 | # Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | bsd-3-clause |
annarev/tensorflow | tensorflow/python/kernel_tests/spacetobatch_op_test.py | 9 | 26055 | # 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 |
ASoftTech/Scons-Tools-Grbd | scons_tools_grbd/Tools/Docs/Doxygen/DoxygenCommon.py | 1 | 12301 | """
DoxygenCommon
Common code associated with doxygen builders
"""
import os, sys, os.path as path, yaml
import SCons.Script
from SCons.Environment import Environment
from SCons.Script import File, Dir
import glob
from fnmatch import fnmatch
from functools import reduce
# Currently supported output for... | mit |
pepetreshere/odoo | addons/l10n_fr/__init__.py | 11 | 1225 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
from . import models
from odoo import api, SUPERUSER_ID
def _l10n_fr_post_init_hook(cr, registry):
_preserve_tag_on_taxes(cr, registry)
_setup_i... | agpl-3.0 |
s40523231/2016fallcp_hw | plugin/liquid_tags/graphviz.py | 26 | 3326 | """
GraphViz Tag
---------
This implements a Liquid-style graphviz tag for Pelican. You can use different
Graphviz programs like dot, neato, twopi etc. [1]
[1] http://www.graphviz.org/
Syntax
------
{% graphviz
<program> {
<DOT code>
}
%}
Examples
--------
{% graphviz
dot {
... | agpl-3.0 |
thnee/ansible | lib/ansible/modules/network/fortios/fortios_web_proxy_global.py | 13 | 15618 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
marcoserafini/h-store | third_party/python/boto/emr/step.py | 9 | 6128 | # Copyright (c) 2010 Spotify AB
# Copyright (c) 2010-2011 Yelp
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, m... | gpl-3.0 |
mpdehaan/camp | camp/tracker/scenes.py | 1 | 1248 | """
Copyright 2016, Michael DeHaan <michael.dehaan@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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | apache-2.0 |
rahul67/hue | desktop/core/ext-py/Django-1.6.10/tests/reverse_single_related/tests.py | 150 | 1491 | from __future__ import absolute_import
from django.test import TestCase
from .models import Source, Item
class ReverseSingleRelatedTests(TestCase):
"""
Regression tests for an object that cannot access a single related
object due to a restrictive default manager.
"""
def test_reverse_single_rel... | apache-2.0 |
partofthething/home-assistant | homeassistant/components/aemet/weather.py | 7 | 3266 | """Support for the AEMET OpenData service."""
from homeassistant.components.weather import WeatherEntity
from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import (
ATTR_API_CONDITION,
ATTR_API_HUMIDITY,
ATTR_API_PRESSURE,
ATT... | mit |
AdrianGaudebert/socorro | socorro/external/es/base.py | 3 | 3334 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
from configman import Namespace, class_converter
from socorro.app.generic_app import App
class Elast... | mpl-2.0 |
nearai/program_synthesis | program_synthesis/naps/examples/seq2seq/pointer_seq_encoder.py | 1 | 1895 | import torch
import torch.nn as nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from torch.autograd import Variable
class SeqEncoder(nn.Module):
def __init__(self, args):
super(SeqEncoder, self).__init__()
self.num_units = args.num_units
self.num_encoder_layers... | apache-2.0 |
wwj718/edx-video | common/lib/capa/capa/tests/test_correctmap.py | 61 | 5833 | """
Tests to verify that CorrectMap behaves correctly
"""
import unittest
from capa.correctmap import CorrectMap
import datetime
class CorrectMapTest(unittest.TestCase):
"""
Tests to verify that CorrectMap behaves correctly
"""
def setUp(self):
self.cmap = CorrectMap()
def test_set_inpu... | agpl-3.0 |
chrisatthestudy/jot | src/test.py | 1 | 8053 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python CLI Test Unit
"""
# Standard library imports
import datetime
import os
# Third party imports
# Application specific imports
import jot
if (__name__ == "__main__"):
# Basic unit tests for API()
import unittest
class APITestCase(unittest.TestC... | mit |
mrquim/repository.mrquim | script.module.unidecode/lib/unidecode/x05d.py | 252 | 4670 | data = (
'Lang ', # 0x00
'Kan ', # 0x01
'Lao ', # 0x02
'Lai ', # 0x03
'Xian ', # 0x04
'Que ', # 0x05
'Kong ', # 0x06
'Chong ', # 0x07
'Chong ', # 0x08
'Ta ', # 0x09
'Lin ', # 0x0a
'Hua ', # 0x0b
'Ju ', # 0x0c
'Lai ', # 0x0d
'Qi ', # 0x0e
'Min ', # 0x0f
'Kun ', # 0x10
'... | gpl-2.0 |
ninotoshi/tensorflow | tensorflow/python/kernel_tests/random_crop_test.py | 15 | 2626 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
cybertk/depot_tools | owners.py | 18 | 11840 | # 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.
"""A database of OWNERS files.
OWNERS files indicate who is allowed to approve changes in a specific directory
(or who is allowed to make changes withou... | bsd-3-clause |
patholden/linux | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/lib2to3/fixes/fix_types.py | 5 | 1859 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for removing uses of the types module.
These work for only the known names in the types module. The forms above
can include types. or not. ie, It is assumed the module is imported either as:
imp... | gpl-2.0 |
vesellov/bitdust.devel | transport/tcp/tcp_connection.py | 1 | 16191 | #!/usr/bin/env python
# tcp_connection.py
#
# Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io
#
# This file (tcp_connection.py) is part of BitDust Software.
#
# BitDust is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | agpl-3.0 |
atareao/nautilus-imgur-uploader | src/imgurpython/helpers/format.py | 22 | 2213 | from ..helpers import Comment
from ..helpers import GalleryAlbum
from ..helpers import GalleryImage
from ..helpers import Notification
def build_comment_tree(children):
children_objects = []
for child in children:
to_insert = Comment(child)
to_insert.children = build_comment_tree(to_insert.chi... | gpl-3.0 |
Intel-tensorflow/tensorflow | tensorflow/python/kernel_tests/barrier_ops_test.py | 14 | 28170 | # 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 |
sebfung/yellowpillowcase | vendor/cache/gems/pygments.rb-0.6.3/vendor/pygments-main/tests/test_objectiveclexer.py | 34 | 2522 | # -*- coding: utf-8 -*-
"""
Basic CLexer Test
~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import unittest
import os
from pygments.token import Token
from pygments.lexers import ObjectiveCLexer
class ObjectiveCLexer... | mit |
Triv90/SwiftUml | test/unit/container/test_updater.py | 8 | 8220 | # Copyright (c) 2010-2012 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
mcardillo55/django | tests/messages_tests/test_session.py | 368 | 1870 | from django.contrib.messages import constants
from django.contrib.messages.storage.base import Message
from django.contrib.messages.storage.session import SessionStorage
from django.test import TestCase
from django.utils.safestring import SafeData, mark_safe
from .base import BaseTests
def set_session_data(storage, ... | bsd-3-clause |
camilonova/django | tests/m2m_intermediary/tests.py | 91 | 1244 | from datetime import datetime
from django.test import TestCase
from .models import Article, Reporter, Writer
class M2MIntermediaryTests(TestCase):
def test_intermeiary(self):
r1 = Reporter.objects.create(first_name="John", last_name="Smith")
r2 = Reporter.objects.create(first_name="Jane", last_n... | bsd-3-clause |
NcLang/vimrc | sources_non_forked/YouCompleteMe/third_party/ycmd/third_party/python-future/src/future/backports/email/encoders.py | 82 | 2800 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Encodings and related functions."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future.builtins import str
__all__ = [
'encode_7or8... | mit |
quokkaproject/flask-admin | flask_admin/contrib/mongoengine/form.py | 13 | 8916 | from mongoengine import ReferenceField, ListField
from mongoengine.base import BaseDocument, DocumentMetaclass, get_document
from wtforms import fields, validators
from flask_mongoengine.wtf import orm, fields as mongo_fields
from flask_admin import form
from flask_admin.model.form import FieldPlaceholder
from flask_... | bsd-3-clause |
charukiewicz/beer-manager | venv/lib/python3.4/site-packages/pip/_vendor/html5lib/constants.py | 963 | 87346 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | mit |
vad/django-cms | cms/exceptions.py | 61 | 1374 | # -*- coding: utf-8 -*-
class PluginAlreadyRegistered(Exception):
pass
class PluginNotRegistered(Exception):
pass
class PluginLimitReached(Exception):
"""
Gets triggered when a placeholder has reached it's plugin limit.
"""
pass
class AppAlreadyRegistered(Exception):
pass
class Toolb... | bsd-3-clause |
andresgz/ekratia | ekratia/core/email.py | 1 | 2332 | from ekratia.conversations.models import Thread
from ekratia.referendums.models import Referendum
from django_email import EmailTemplate
import logging
logger = logging.getLogger('ekratia')
def notify_comment_node(request, node, object_type):
"""
Method to create new comment for the current Thread
"""
... | bsd-3-clause |
LukeHoersten/ansible | v1/ansible/utils/module_docs.py | 85 | 4484 | #!/usr/bin/env python
# (c) 2012, Jan-Piet Mens <jpmens () 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... | gpl-3.0 |
chadversary/chromiumos.chromite | cbuildbot/stages/sync_stages.py | 1 | 40929 | # Copyright (c) 2013 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.
"""Module containing the sync stages."""
import contextlib
import datetime
import logging
import os
import sys
from xml.etree import ElementTree
from... | bsd-3-clause |
caphrim007/ansible | lib/ansible/module_utils/network/avi/avi.py | 93 | 4188 | # 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 |
kursitet/edx-platform | common/lib/xmodule/xmodule/modulestore/perf_tests/generate_asset_xml.py | 83 | 5955 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generates fake XML for asset metadata.
"""
import random
from lxml import etree
from datetime import datetime, timedelta
from xmodule.assetstore import AssetMetadata
from opaque_keys.edx.keys import CourseKey
try:
import click
except ImportError:
click = None... | agpl-3.0 |
defionscode/ansible | lib/ansible/modules/system/systemd.py | 20 | 20067 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Brian Coca <bcoca@ansible.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__ = type
ANSIBLE_METADATA = {'metadata_version': '1... | gpl-3.0 |
tahmid-tanzim/youtube-dl | youtube_dl/extractor/rts.py | 90 | 9607 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlparse,
)
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
unescapeHTML,
xpath_text,
)
class RTSIE(InfoExtractor):... | unlicense |
thor/django-localflavor | docs/conf.py | 6 | 10724 | # -*- coding: utf-8 -*-
#
# django-localflavor documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 2 17:56:28 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fi... | bsd-3-clause |
sacharya/nova | nova/tests/objects/test_flavor.py | 17 | 9499 | # 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 a... | apache-2.0 |
AlexanderFabisch/scikit-learn | examples/missing_values.py | 71 | 3055 | """
======================================================
Imputing missing values before building an estimator
======================================================
This example shows that imputing the missing values can give better results
than discarding the samples containing any missing value.
Imputing does not ... | bsd-3-clause |
baylee-d/osf.io | osf/management/commands/migrate_deleted_date.py | 8 | 4808 | import datetime
import logging
from django.core.management.base import BaseCommand
from django.db import connection, transaction
from framework.celery_tasks import app as celery_app
from framework import sentry
logger = logging.getLogger(__name__)
LIMIT_CLAUSE = ' LIMIT %s) RETURNING id;'
NO_LIMIT_CLAUSE = ');'
TAB... | apache-2.0 |
russel1237/scikit-learn | sklearn/utils/tests/test_sparsefuncs.py | 157 | 13799 | import numpy as np
import scipy.sparse as sp
from scipy import linalg
from numpy.testing import assert_array_almost_equal, assert_array_equal
from sklearn.datasets import make_classification
from sklearn.utils.sparsefuncs import (mean_variance_axis,
inplace_column_scale,
... | bsd-3-clause |
jmesteve/openerpseda | openerp/addons_extra/point_of_sale/wizard/pos_sales_user_today.py | 55 | 2088 | # -*- 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 |
nkurihar/pulsar | docker/pulsar-standalone/django/stats/migrations/0001_initial.py | 3 | 11985 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
browseinfo/odoo_saas3_nicolas | addons/portal/mail_thread.py | 390 | 2004 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
rapidhere/rpbtman_autosign | pytz/zoneinfo/America/Eirunepe.py | 9 | 1723 | '''tzinfo timezone information for America/Eirunepe.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Eirunepe(DstTzInfo):
'''America/Eirunepe timezone definition. See datetime.tzinfo for details'''
zone = 'America/Eirunep... | gpl-3.0 |
RamaraoDonta/ramarao-clone | py/selenium/webdriver/__init__.py | 5 | 1334 | #!/usr/bin/python
#
# Copyright 2008-2013 Software Freedom Conservancy
#
# 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 |
schoonc/AutobahnPython | examples/twisted/wamp/app/calculator/calculator.py | 8 | 3593 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
RO-ny9/python-for-android | python3-alpha/python3-src/Lib/test/test_audioop.py | 51 | 7803 | import audioop
import unittest
from test.support import run_unittest
def gendata1():
return b'\0\1\2'
def gendata2():
if audioop.getsample(b'\0\1', 2, 0) == 1:
return b'\0\0\0\1\0\2'
else:
return b'\0\0\1\0\2\0'
def gendata4():
if audioop.getsample(b'\0\0\0\1', 4, 0) == 1:
re... | apache-2.0 |
firm1/zmarkdown-editor | src/pygments/styles/murphy.py | 135 | 2751 | # -*- coding: utf-8 -*-
"""
pygments.styles.murphy
~~~~~~~~~~~~~~~~~~~~~~
Murphy's style from CodeRay.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment,... | mit |
sinbazhou/odoo | addons/email_template/res_partner.py | 432 | 1688 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
lsst-sqre/sqre-apikit | tests/test_lsstflask_type_errors.py | 1 | 1993 | #!/usr/bin/env python
"""Test APIFlask class for input parameters causing TypeErrors.
"""
import apikit
import pytest
def test_lsstflask_type_errors():
"""Test APIFlask for input parameters causing TypeErrors.
"""
# No arguments at all.
# Obviously the linter is correct here...
with pytest.raises(... | mit |
tomashaber/raiden | raiden/network/protocol.py | 1 | 24753 | # -*- coding: utf-8 -*-
import logging
import random
from collections import (
namedtuple,
defaultdict,
)
from itertools import repeat
import cachetools
import gevent
from gevent.event import (
_AbstractLinkable,
AsyncResult,
Event,
)
from ethereum import slogging
from raiden.exceptions import (
... | mit |
sbradley7777/glocktop_analyze | glocktop_analyze/plugins/snapshots.py | 1 | 5213 | #!/usr/bin/python
"""
@author : Shane Bradley
@contact : sbradley@redhat.com
@copyright : GPLv3
* This plugin outputs the number of snapshots taken for a filesystem, the start
time, and end time or last snapshot taken.
* This plugin outputs the filesystem name, time when snapshot taken when dlm
activity is g... | gpl-3.0 |
commtrack/commtrack-old-to-del | tests/deployment/selenium/hq_test.py | 1 | 3617 | from selenium import selenium
import unittest, time, re, urllib2
from post import *
import os
import sys
import time
class testingPost(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*firefox", server)
self.selenium.start()
... | bsd-3-clause |
MisanthropicBit/bibpy | bibpy/entry/base.py | 1 | 1986 | # -*- coding: utf-8 -*-
"""Base class for all types of entries."""
class BaseEntry:
"""Base class for all types of entries."""
def format(self, **options):
raise NotImplementedError()
def format_auxiliary_entry(self, entry_type, contents, indent=' ',
singleline... | mit |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/UserDict.py | 65 | 5778 | """A more or less complete user-defined wrapper around dictionary objects."""
class UserDict:
def __init__(self, dict=None, **kwargs):
self.data = {}
if dict is not None:
self.update(dict)
if len(kwargs):
self.update(kwargs)
def __repr__(self): return repr(self.d... | apache-2.0 |
vrum/pym2 | examples/ChangeAnimations.py | 2 | 3972 | from m2 import *
from RaceInfo import *
input = SkeletonMale
output = Murloc
inName = input.filename
outName = output.filename
im2 = M2File(inName)
om2 = M2File(outName)
#some bones might be ported also
#but not the bones depending on it
changeBones = (0,1,2,3)#,4)
#change the anims of the bon... | lgpl-3.0 |
msiedlarek/qtwebkit | Tools/Scripts/webkitpy/style/checker_unittest.py | 121 | 35416 | # -*- coding: utf-8; -*-
#
# Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2009 Torch Mobile Inc.
# Copyright (C) 2009 Apple Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
#
# Redistribution and use in source and binary forms, with or without
# modificatio... | lgpl-3.0 |
bop/hybrid | lib/python2.6/site-packages/django/contrib/humanize/tests.py | 100 | 9960 | from __future__ import unicode_literals
import datetime
try:
import pytz
except ImportError:
pytz = None
from django.conf import settings
from django.contrib.humanize.templatetags import humanize
from django.template import Template, Context, defaultfilters
from django.test import TestCase
from django.test.ut... | gpl-2.0 |
SummerLW/Perf-Insight-Report | dashboard/dashboard/task_runner_test.py | 1 | 1415 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import mock
from dashboard import task_runner
from dashboard import testing_common
class TaskRunnerTest(testing_common.TestCase):
def setUp(self):
... | bsd-3-clause |
ArcherSys/ArcherSys | Lib/site-packages/cms/test_utils/project/emailuserapp/admin.py | 79 | 1336 | # -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as OriginalUserAdmin
from .models import EmailUser
from .forms import UserChangeForm, UserCreationForm
class UserAdmin(OriginalUserAdmin):
# The form to add and change user instances
form = UserChangeForm... | mit |
tscloud/hamsalad | callservice_class.py | 1 | 6917 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
# Copyright (C) 2014 Tom Cloud
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | agpl-3.0 |
ludoT/PFCLS | node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # 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
class Writer(object):
"""Visual Studio XML tool file writer."""
... | gpl-3.0 |
yongfuyang/vnpy | vn.how/tick2trade/vn.trader_t2t/ctaAlgo/tools/multiTimeFrame/strategyBreakOut.py | 22 | 11811 | # encoding: UTF-8
"""
This file tweaks ctaTemplate Module to suit multi-TimeFrame strategies.
"""
from ctaBase import *
from ctaTemplate import CtaTemplate
import numpy as np
########################################################################
class BreakOut(CtaTemplate):
"""
"infoArray" 字典是用来储存辅助品种信息的, ... | mit |
CumulusNetworks/ansible-modules-extras | notification/pushbullet.py | 69 | 5843 | #!/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 |
sidvishnoi/jekyll-comments | jekyll-comments/comments.py | 2 | 8734 | import requests, yaml, json
import mdv # recommended mdv themes: 729.8953 960.847 785.3229 880.1331 696.6153
from urllib import unquote
from sys import argv as cli_args
from hashlib import md5
from datetime import datetime, timedelta
from time import timezone
from dateutil.parser import parse
def print_error():
st... | mit |
hchim/stockanalyzer | simulator/TradeSimulator.py | 1 | 4978 | import pandas as pd
import numpy as np
from utils.webdata import get_close_of_symbols
class TradeSimulator(object):
def __init__(self, start_val=1000000, leverage=2.0, allow_short=True):
"""
Parameters
----------
start_val: float
start value of the portfolio
l... | mit |
icodedev7/customap | devkit/mingw/bin/lib/wave.py | 117 | 18099 | """Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... | mit |
aflaxman/scikit-learn | sklearn/tests/test_learning_curve.py | 33 | 12840 | # Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import sys
from sklearn.externals.six.moves import cStringIO as StringIO
import numpy as np
import warnings
from sklearn.base import BaseEstimator
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.