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 |
|---|---|---|---|---|---|
esikachev/scenario | sahara/plugins/spark/edp_engine.py | 5 | 1071 | # Copyright (c) 2014 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 |
angelapper/edx-platform | common/lib/xmodule/xmodule/tests/test_validation.py | 83 | 8741 | """
Test xblock/validation.py
"""
import unittest
from xblock.test.tools import assert_raises
from xmodule.validation import StudioValidationMessage, StudioValidation
from xblock.validation import Validation, ValidationMessage
class StudioValidationMessageTest(unittest.TestCase):
"""
Tests for `ValidationMe... | agpl-3.0 |
ljnutal6/media-recommend | app/virtualenvs/recommedia/lib/python2.7/site-packages/bson/tz_util.py | 20 | 1518 | # Copyright 2010-2014 MongoDB, 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 writin... | gpl-2.0 |
stefanweller/ansible-modules-extras | cloud/cloudstack/cs_project.py | 33 | 8481 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
furthz/colegio | src/discounts/forms.py | 1 | 4824 | from django import forms
from enrollment.models import Servicio
from enrollment.models import TipoServicio
from enrollment.models import Matricula
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django.forms import ModelForm, Form
from utils.models import TiposNivel
from django.ut... | mit |
daviddeng/azrael | demos/ctrl_swarm.py | 1 | 4132 | # Copyright 2014, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Azrael (https://github.com/olitheolix/azrael)
#
# Azrael 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... | agpl-3.0 |
fmfn/UnbalancedDataset | examples/applications/plot_outlier_rejections.py | 2 | 4354 | """
===============================================================
Customized sampler to implement an outlier rejections estimator
===============================================================
This example illustrates the use of a custom sampler to implement an outlier
rejections estimator. It can be used easily wi... | mit |
HackerEarth/cassandra-python-driver | tests/integration/cqlengine/columns/test_validation.py | 2 | 12688 | # Copyright 2015 DataStax, 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 writing, s... | apache-2.0 |
OpenLinkedSocialData/gmane-politics-organizations-metareciclagem | scripts/testTriplify.py | 4 | 1238 | import importlib, os
import multiprocessing as mp
from IPython.lib.deepreload import reload as dreload
import gmane as g, percolation as P
G=g
importlib.reload(g.listDataStructures)
importlib.reload(g.loadMessages)
importlib.reload(g.triplifyList)
importlib.reload(P.rdf)
importlib.reload(P.utils)
dreload(g,exclude="py... | artistic-2.0 |
scott-maddox/simplepl | src/simplepl/dialogs/lockin_config_dialog.py | 1 | 4145 | #
# Copyright (c) 2013-2014, Scott J Maddox
#
# This file is part of SimplePL.
#
# SimplePL 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 opt... | agpl-3.0 |
zhanqxun/cv_fish | pythonwin/pywin/framework/editor/template.py | 4 | 1826 | import string
import win32ui
import win32api
from pywin.mfc import docview
import pywin.framework.window
import os
import frame
ParentEditorTemplate=docview.DocTemplate
class EditorTemplateBase(ParentEditorTemplate):
def __init__(self, res=win32ui.IDR_TEXTTYPE, makeDoc=None, makeFrame=None, makeView=None):
... | apache-2.0 |
eawag-rdm/xlsxtocsv | xlsxtocsv/xlsxtocsv.py | 1 | 3605 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime as dt
from Tkinter import Tk
import tkFileDialog
import openpyxl as op
import argparse
import os.path
import sys
import re
import csv
__metaclass__ = type
class RFC4180(csv.Dialect):
def __i... | agpl-3.0 |
manashmndl/kivy | kivy/uix/settings.py | 8 | 41551 | '''
Settings
========
.. versionadded:: 1.0.7
This module provides a complete and extensible framework for adding a
Settings interface to your application. By default, the interface uses
a :class:`SettingsWithSpinner`, which consists of a
:class:`~kivy.uix.spinner.Spinner` (top) to switch between individual
settings ... | mit |
dtnaylor/web-profiler | webloader/docs/source/conf.py | 1 | 9104 | # -*- coding: utf-8 -*-
#
# Web Profiler documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 8 17:09:00 2014.
#
# 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 file.
... | mit |
lmprice/ansible | lib/ansible/modules/net_tools/basics/uri.py | 3 | 20205 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Romeo Theriault <romeot () hawaii.edu>
# 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_ver... | gpl-3.0 |
paradigmsort/MagicValidate | pyx/font/metric.py | 4 | 1530 | # -*- encoding: utf-8 -*-
#
#
# Copyright (C) 2007-2011 Jörg Lehmann <joergl@users.sourceforge.net>
# Copyright (C) 2007-2011 André Wobst <wobsta@users.sourceforge.net>
#
# This file is part of PyX (http://pyx.sourceforge.net/).
#
# PyX is free software; you can redistribute it and/or modify
# it under the terms of the... | mit |
cca/django-messages | docs/conf.py | 10 | 6100 | # -*- coding: utf-8 -*-
#
# django-messages documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 26 10:27:49 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't... | bsd-3-clause |
nedbat/unittest-mixins | setup.py | 1 | 1288 | #!/usr/bin/env python
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/unittest-mixins/blob/master/NOTICE.txt
from setuptools import setup
classifiers = """\
Environment :: Console
Intended Audience :: Developers
License :: OSI Approved :: Apache... | apache-2.0 |
rboman/progs | bin/powergrep.py | 1 | 3561 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# try to replace "old_div(a,b)"" by "a/b"
# with a and b being complex expressions involving brackets, etc.
# processes all the python files recursively from the current folder
#
# you must use the script several times
# (it processes 1 "old_div" per line at a time... | apache-2.0 |
sankhesh/VTK | Common/Core/Testing/Python/TestNumpySupport.py | 9 | 4853 | """Test if the NumPy array support for VTK data arrays works correctly.
The test requires that numpy (http://numpy.scipy.org) work.
Run this test like so:
$ vtkpython TestNumpySupport.py
or
$ python TestNumpySupport.py
"""
import sys
import vtk
from vtk.test import Testing
try:
import numpy
except ImportError:... | bsd-3-clause |
kittiu/odoo | addons/note/note.py | 223 | 8893 | # -*- 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 |
QinerTech/QinerApps | openerp/addons/base/res/res_partner.py | 2 | 40878 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from lxml import etree
import math
import pytz
import threading
import urlparse
import openerp
from openerp import tools, api
from openerp.osv import osv, fields
from openerp.osv.expression import get_un... | gpl-3.0 |
alexm92/sentry | src/sentry/south_migrations/0131_auto__add_organizationmember__add_unique_organizationmember_organizati.py | 36 | 29659 | # -*- 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 'OrganizationMember'
db.create_table('sentry_organizationmember', (
('id', self.g... | bsd-3-clause |
trishnaguha/ansible | lib/ansible/module_utils/netapp_module.py | 31 | 5878 | # 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 |
ram8647/gcb-mobilecsp | models/entity_transforms.py | 9 | 6650 | # Copyright 2014 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 ... | apache-2.0 |
RackSec/ansible | lib/ansible/modules/network/nxos/nxos_facts.py | 44 | 15742 | #!/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 distribut... | gpl-3.0 |
soupmonkey/pushcoin | PoS/payment-processor/settings.py | 1 | 1339 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Slawomir Lisznianski <sl@minta.com>
#
# GNU General Public Licence (GPL)
#
# 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; eithe... | gpl-3.0 |
pombredanne/pulp | server/pulp/plugins/util/metadata_writer.py | 8 | 16777 | from gettext import gettext as _
import glob
import gzip
import logging
import os
import shutil
import traceback
from xml.sax.saxutils import XMLGenerator
from pulp.common import error_codes
from pulp.server.exceptions import PulpCodedValidationException, PulpCodedException
from verification import CHECKSUM_FUNCTION... | gpl-2.0 |
Nyker510/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
nortd/bomfu | boilerplate/external/wtforms/ext/appengine/fields.py | 55 | 4307 | from __future__ import unicode_literals
import decimal
import operator
import warnings
from wtforms import fields, widgets
from wtforms.compat import text_type, string_types
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
se... | lgpl-3.0 |
PuzzleboxIO/brainstorms-python | setup.py2app.py | 1 | 3818 | """
This is a setup.py script generated by py2applet
Usage:
python2.7 setup.py py2app
"""
from setuptools import setup
APP = ['brainstorms-local.py']
data_files=[ \
(".", \
#("Content/Resources", \
["puzzlebox_brainstorms_configuration.ini"]),
("images", \
["images/puzzlebox.ico", \
"images/puzzlebox.... | agpl-3.0 |
nmih/ssbio | ssbio/databases/pdb.py | 1 | 34959 | """
PDBProp
=======
"""
import gzip
import json
import logging
import os.path as op
import mmtf
import os
from cobra.core import DictList
import pandas as pd
import requests
import deprecation
from Bio.PDB import PDBList
from lxml import etree
from six.moves.urllib_error import URLError
from six.moves.urllib.request i... | mit |
tensorflow/probability | tensorflow_probability/python/optimizer/linesearch/hager_zhang.py | 1 | 30378 | # Copyright 2018 The TensorFlow Probability 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 o... | apache-2.0 |
SiddheshK15/android_kernel_yu_msm8916_gcc5 | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
ee08b397/LintCode-1 | Longest Common Substring.py | 4 | 1132 | """
Given two strings, find the longest common substring.
Return the length of it.
"""
__author__ = 'Danyang'
class Solution:
def longestCommonSubstring(self, A, B):
"""
let f(i, j) represents the LCS END WITH A[i], B[j]
f(i, j) = f(i-1, j-1)+1 if A[i] == B[j]
f(i, j) = 0 otherwis... | apache-2.0 |
npuichigo/ttsflow | third_party/tensorflow/tensorflow/tools/compatibility/testdata/test_file_v0_11.py | 130 | 8773 | # 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 |
naturalatlas/mapnik | scons/scons-local-3.0.1/SCons/Tool/latex.py | 5 | 2759 | """SCons.Tool.latex
Tool-specific initialization for LaTeX.
Generates .dvi files from .latex or .ltx files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#... | lgpl-2.1 |
weidel-p/nest-simulator | pynest/examples/pulsepacket.py | 12 | 11358 | # -*- coding: utf-8 -*-
#
# pulsepacket.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
traxtar3/OrbitCalc | OrbitCalc_v0.0.9/sgp4/tests.py | 2 | 8690 | """Test suite for SGP4."""
import os
import re
import sys
from doctest import DocTestSuite, ELLIPSIS
from unittest import TestCase
from math import pi, isnan
from sgp4.earth_gravity import wgs72
from sgp4.ext import invjday, newtonnu, rv2coe
from sgp4.io import twoline2rv
from sgp4.propagation import sgp4
thisdir = ... | gpl-3.0 |
sergiocorato/ocb-server-61 | openerp/tools/convert.py | 5 | 43571 | # -*- 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 |
tonyduckles/svn2svn | svn2svn/run/parse.py | 1 | 2731 | """ optparser helper functions """
import optparse
import textwrap
class HelpFormatter(optparse.IndentedHelpFormatter):
"""
Modified version of certain optparse.IndentedHelpFormatter methods:
* Respect line-breaks in parser.desription and option.help_text
* Vertically-align long_opts
Inspired by: ... | gpl-3.0 |
tensorflow/tpu | models/official/detection/utils/config_utils.py | 1 | 2218 | # Copyright 2020 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 |
wenhulove333/ScutServer | Sample/Doudizhu/Server/src/ZyGames.Doudizhu.HostServer/PyScript/Action/Action9003.py | 4 | 2819 | import clr, sys
from action import *
from System import *
from mathUtils import MathUtils
from lang import Lang
clr.AddReference('ZyGames.Framework');
clr.AddReference('ZyGames.Framework.Common');
clr.AddReference('ZyGames.Framework.Game');
clr.AddReference('ZyGames.Doudizhu.Bll');
clr.AddReference('ZyGames.D... | mit |
WillsB3/glue | glue/formats/jsonformat.py | 1 | 2704 | import os
import json
import codecs
from base import BaseJSONFormat
class JSONFormat(BaseJSONFormat):
extension = 'json'
build_per_ratio = True
@classmethod
def populate_argument_parser(cls, parser):
group = parser.add_argument_group("JSON format options")
group.add_argument("--jso... | bsd-3-clause |
sivaramakrishnansr/ryu | ryu/contrib/ovs/stream.py | 46 | 12200 | # Copyright (c) 2010, 2011, 2012 Nicira, 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 |
LennonChin/Django-Practices | MxShop/apps/utils/alipay.py | 1 | 6122 | # _*_ coding: utf-8 _*_
__author__ = 'LennonChin'
__date__ = '2017/10/23 21:37'
# pip install pycryptodome
__author__ = 'bobby'
from datetime import datetime
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from base64 import b64encode, b64decode
from... | apache-2.0 |
kapt/django-oscar | tests/unit/partner/import_tests.py | 57 | 3954 | import os
from decimal import Decimal as D
from django.test import TestCase
import logging
from oscar.apps.partner.importers import CatalogueImporter
from oscar.apps.partner.exceptions import ImportingError
from oscar.apps.catalogue.models import ProductClass, Product
from oscar.apps.partner.models import Partner
from... | bsd-3-clause |
BaconPancakes/valor | lib/youtube_dl/extractor/nationalgeographic.py | 39 | 7125 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .adobepass import AdobePassIE
from .theplatform import ThePlatformIE
from ..utils import (
smuggle_url,
url_basename,
update_url_query,
get_element_by_class,
)
class NationalGeographicVideoIE(InfoExtractor):
... | gpl-3.0 |
drufat/sympy | bin/coverage_report.py | 51 | 3708 | #!/usr/bin/env python
"""
Script to generate test coverage reports.
Usage:
$ bin/coverage_report.py
This will create a directory covhtml with the coverage reports. To
restrict the analysis to a directory, you just need to pass its name as
argument. For example:
$ bin/coverage_report.py sympy/logic
runs only the t... | bsd-3-clause |
SebastianMerz/calalert | Server/venv/lib/python2.7/site-packages/unittest2/test/test_runner.py | 122 | 4644 | import pickle
from cStringIO import StringIO
from unittest2.test.support import LoggingResult, OldTestResult
import unittest2
class Test_TextTestRunner(unittest2.TestCase):
"""Tests for TextTestRunner."""
def test_init(self):
runner = unittest2.TextTestRunner()
self.assertFalse(runner.failf... | gpl-2.0 |
marcoconstancio/yanta | libs/python/NoteViewer.py | 1 | 8163 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout
from libs.python.NoteFunctions import NoteFunctions
class NoteViewer(QWidget):
def __init__(self, param):
QWidget.__init__(self)
# Function for several oprations
if 'NoteF... | gpl-2.0 |
trevor/calendarserver | txdav/who/opendirectory.py | 1 | 1226 | # -*- test-case-name: txdav.who.test.test_xml -*-
##
# Copyright (c) 2014 Apple 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/LI... | apache-2.0 |
testbetta/repo-pub | project.py | 2 | 89260 | # Copyright (C) 2008 The Android Open Source Project
#
# 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 |
leiferikb/bitpop | build/third_party/twisted_10_2/twisted/trial/test/test_doctest.py | 61 | 2405 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test twisted's doctest support.
"""
from twisted.trial import itrial, runner, unittest, reporter
from twisted.trial.test import mockdoctest
class TestRunners(unittest.TestCase):
"""
Tests for Twisted's doctest support.
... | gpl-3.0 |
Lyleo/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_fltkagg.py | 69 | 20839 | """
A backend for FLTK
Copyright: Gregory Lielens, Free Field Technologies SA and
John D. Hunter 2004
This code is released under the matplotlib license
"""
from __future__ import division
import os, sys, math
import fltk as Fltk
from backend_agg import FigureCanvasAgg
import os.path
import matplotli... | gpl-3.0 |
vvw/gensim | gensim/examples/dmlcz/dmlcorpus.py | 83 | 8703 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Corpus for the DML-CZ project.
"""
import logging
import itertools
import os.path
from gensim import interfaces, matutils
import... | gpl-3.0 |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/lib2to3/main.py | 47 | 6894 | """
Main program for 2to3.
"""
from __future__ import with_statement
import sys
import os
import difflib
import logging
import shutil
import optparse
from . import refactor
def diff_texts(a, b, filename):
"""Return a unified diff of two strings."""
a = a.splitlines()
b = b.splitlines()
return diffl... | apache-2.0 |
tonysyu/scrappyr-app | config/settings/production.py | 1 | 7727 | # -*- coding: utf-8 -*-
"""
Production Configurations
- Use Amazon's S3 for storing static files and uploaded media
- Use mailgun to send emails
- Use Redis for cache
- Use sentry for error logging
"""
from __future__ import absolute_import, unicode_literals
import logging
from boto.s3.connection import OrdinaryC... | mit |
tensorflow/tensorflow | tensorflow/python/kernel_tests/map_stage_op_test.py | 9 | 21251 | # 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 |
open-synergy/rma | crm_rma_advance_warranty/models/claim_line.py | 3 | 4721 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2015 Vauxoo
# Author: Osval Reyes, Yanina Aular
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... | agpl-3.0 |
tempbottle/ironpython3 | Src/StdLib/Lib/test/time_hashlib.py | 167 | 2887 | # It's intended that this script be run by hand. It runs speed tests on
# hashlib functions; it does not test for correctness.
import sys, time
import hashlib
def creatorFunc():
raise RuntimeError("eek, creatorFunc not overridden")
def test_scaled_msg(scale, name):
iterations = 106201/scale * 20
longSt... | apache-2.0 |
BhallaLab/moose-full | moose-examples/snippets/switchKineticSolvers.py | 2 | 5089 | #########################################################################
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2014 Upinder S. Bhalla. and NCBS
## It is made available under the terms of the
## GNU Lesser General Public License version 2... | gpl-2.0 |
MichaelDoyle/Diamond | src/diamond/handler/zmq_pubsub.py | 31 | 1993 | # coding=utf-8
"""
Output the collected values to a Zer0MQ pub/sub channel
"""
from Handler import Handler
try:
import zmq
except ImportError:
zmq = None
class zmqHandler (Handler):
"""
Implements the abstract Handler class
Sending data to a Zer0MQ pub channel
"""
def __init__(self... | mit |
GdZ/scriptfile | software/googleAppEngine/google/appengine/tools/endpointscfg.py | 2 | 11335 | #!/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 |
jasbro1/PDMProject | node_modules/nodemon/travis_after_all.py | 76 | 4308 | import os
import sys
import json
import time
import logging
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
TRAVIS_JOB_NUMBER = 'TRAVIS_JOB_NUMBER'
TRAVIS_BUILD_ID = 'TRAVIS_BU... | mit |
evanson/yowsup | yowsup/layers/protocol_media/protocolentities/message_media_downloadable_audio.py | 39 | 4229 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .message_media_downloadable import DownloadableMediaMessageProtocolEntity
class AudioDownloadableMediaMessageProtocolEntity(DownloadableMediaMessageProtocolEntity):
'''
<message t="{{TIME_STAMP}}" from="{{CONTACT_JID}}"
offline="{{OFFLINE... | gpl-3.0 |
zaxtax/scikit-learn | sklearn/linear_model/perceptron.py | 245 | 3862 | # Author: Mathieu Blondel
# License: BSD 3 clause
from .stochastic_gradient import BaseSGDClassifier
from ..feature_selection.from_model import _LearntSelectorMixin
class Perceptron(BaseSGDClassifier, _LearntSelectorMixin):
"""Perceptron
Read more in the :ref:`User Guide <perceptron>`.
Parameters
-... | bsd-3-clause |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/encodings/cp424.py | 272 | 12055 | """ Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='... | lgpl-3.0 |
jctanner/ansible | test/lib/ansible_test/_internal/cloud/aws.py | 19 | 3937 | """AWS plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ..util import (
ApplicationError,
display,
ConfigParser,
)
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..core_ci ... | gpl-3.0 |
tylertian/Openstack | openstack F/python-cinderclient/cinderclient/v1/volume_types.py | 3 | 3465 | # Copyright (c) 2011 Rackspace US, 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... | apache-2.0 |
mjg/Impressive | src/glcore.py | 2 | 17678 | ##### OPENGL (ES) 2.0 LOADER AND TOOLKIT #######################################
if os.name == 'nt':
GLFUNCTYPE = WINFUNCTYPE
else:
GLFUNCTYPE = CFUNCTYPE
class GLFunction(object):
def __init__(self, required, name, ret, *args):
self.name = name
self.required = required
... | gpl-2.0 |
edermartioli/ExoplanetLight | src/spectrum.py | 1 | 2235 | # -*- coding: utf-8 -*-
"""
Created on Nov 25 2016
@author: Eder Martioli
Laboratorio Nacional de Astrofisica, Brazil
spectrum.py is a library of classes and functions to
handle spectral data.
"""
import numpy as np
from scipy import constants
########## SPECTRUM CLASS ############
class ... | mit |
jounex/hue | desktop/core/ext-py/simplejson/simplejson/tests/test_unicode.py | 123 | 2327 | from unittest import TestCase
import simplejson as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = en... | apache-2.0 |
zhhf/charging | charging/db/migration/alembic_migrations/versions/53bbd27ec841_extra_dhcp_opts_supp.py | 16 | 2051 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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... | apache-2.0 |
ninjasftw/libertyproxybeat | vendor/github.com/elastic/beats/topbeat/tests/system/test_system.py | 6 | 1489 | from topbeat import BaseTest
import os
"""
Contains tests for system wide statistics.
"""
class Test(BaseTest):
def test_system_wide(self):
"""
Checks that system wide stats are found in the output and
have the expected types.
"""
self.render_config_template(
... | apache-2.0 |
shashank971/edx-platform | common/djangoapps/student/management/commands/get_grades.py | 165 | 5207 | """
Management command to generate a list of grades for
all students that are enrolled in a course.
"""
from courseware import grades, courses
from certificates.models import GeneratedCertificate
from django.test.client import RequestFactory
from django.core.management.base import BaseCommand, CommandError
import os
fr... | agpl-3.0 |
GingfreeX/E-Randopi | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distrib... | mit |
j00bar/ansible | lib/ansible/modules/windows/win_group.py | 56 | 1791 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Chris Hoffman <choffman@chathamfinancial.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 ... | gpl-3.0 |
3dfxmadscientist/odoo_vi | openerp/pooler.py | 374 | 2561 | # -*- 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 |
kiall/designate-py3 | designate/api/admin/controllers/extensions/counts.py | 9 | 1535 | # COPYRIGHT 2014 Rackspace
#
# Author: Betsy Luzader <betsy.luzader@rackspace.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
#
# Unle... | apache-2.0 |
LeartS/odoo | openerp/report/render/rml2html/__init__.py | 381 | 1081 | # -*- 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 |
zhenv5/scikit-learn | sklearn/neighbors/approximate.py | 71 | 22357 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
dpgaspar/Flask-AppBuilder | examples/quickactions/config.py | 1 | 1945 | import os
from flask_appbuilder.security.manager import (
AUTH_OID,
AUTH_REMOTE_USER,
AUTH_DB,
AUTH_LDAP,
AUTH_OAUTH,
)
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
OPENID_PROVIDERS = [
{"name": "Yahoo", "url": "https... | bsd-3-clause |
savoirfairelinux/OpenUpgrade | addons/l10n_at/__openerp__.py | 430 | 1785 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) conexus
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
belokop/indico_bare | indico/web/handlers/tracker.py | 1 | 1352 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
alexzoo/python | selenium_tests/env/lib/python3.6/site-packages/pip/_vendor/progress/bar.py | 510 | 2685 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | apache-2.0 |
Sylrob434/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/mechanize/_headersutil.py | 133 | 8371 | """Utility functions for HTTP header value parsing and construction.
Copyright 1997-1998, Gisle Aas
Copyright 2002-2006, John J. Lee
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD or ZPL 2.1 licenses (see the file
COPYING.txt included with the distribution).
"""
impo... | gpl-3.0 |
rmbq/bubba_kernel_3.0 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # 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 |
nonemaw/pynet | pyth_ans_ecourse/class9/exercise7/mytest/world.py | 7 | 1100 | '''
Python class on writing reusable code
'''
def func1():
'''Simple test function'''
print "Hello world"
class MyClass(object):
'''Simple test class'''
def __init__(self, var1, var2, var3):
self.var1 = var1
self.var2 = var2
self.var3 = var3
def hello(self):
'''Simp... | gpl-2.0 |
tux-mind/tf201-kernel | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
tudorvio/tempest | tempest/api/compute/flavors/test_flavors_negative.py | 44 | 1490 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
titienmiami/mmc.repository | plugin.video.tvalacarta/lib/atom/url.py | 280 | 4277 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | gpl-2.0 |
cloudera/hue | desktop/core/ext-py/odfpy-1.4.1/odf/thumbnail.py | 6 | 5058 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This contains a 104x128 px thumbnail in PNG format
# Downloaded from http://da.libreoffice.org/assets/Uploads/Da-Projekt_Billeder/IconLibreOffice.png
# Copyright information: Unless otherwise specified, all text and images on the
# http://da.libreoffice.org website are licens... | apache-2.0 |
chipaca/snapcraft | snapcraft/project/_project_options.py | 1 | 12984 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2019 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
joneit/electron | script/upload-checksums.py | 35 | 1775 | #!/usr/bin/env python
import argparse
import hashlib
import os
import tempfile
from lib.config import s3_config
from lib.util import download, rm_rf, s3put
DIST_URL = 'https://atom.io/download/atom-shell/'
def main():
args = parse_args()
url = DIST_URL + args.version + '/'
directory, files = download_files... | mit |
eroicaleo/LearningPython | interview/leet/146_LRU_Cache.py | 1 | 2568 | #!/usr/bin/env python
class LRUCache:
class Node:
def __init__(self, key, val):
self.val, self.key = val, key
self.prev = None
self.next = None
def __init__(self, capacity):
"""
:type capacity: int
"""
self.capacity = capacity
... | mit |
XiaodunServerGroup/xiaodun-platform | lms/djangoapps/courseware/migrations/0001_initial.py | 194 | 8306 | # encoding: 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 'StudentModule'
db.create_table('courseware_studentmodule', (
('id', self.gf('django.d... | agpl-3.0 |
40223231/6-22-Final-Exam-1-2 | static/Brython3.1.1-20150328-091302/Lib/test/regrtest.py | 718 | 65317 | #! /usr/bin/python3.3
"""
Usage:
python -m test [options] [test_name1 [test_name2 ...]]
python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
If no arguments or options are provided, finds all files matching
the pattern "test_*" in the Lib/test subdirectory and runs
them in alphabetical order ... | gpl-3.0 |
vaygr/ansible | test/runner/lib/thread.py | 52 | 1631 | """Python threading tools."""
from __future__ import absolute_import, print_function
import threading
import sys
try:
# noinspection PyPep8Naming
import Queue as queue
except ImportError:
# noinspection PyUnresolvedReferences
import queue # pylint: disable=locally-disabled, import-error
class Wrap... | gpl-3.0 |
TRex22/xbmc | tools/EventClients/lib/python/bt/bt.py | 181 | 2535 | # -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 Team XBMC
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.