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 |
|---|---|---|---|---|---|
stvstnfrd/edx-platform | openedx/core/djangoapps/xblock/apps.py | 9 | 3611 | """
Django app configuration for the XBlock Runtime django app
"""
from django.apps import AppConfig, apps
from django.conf import settings
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
class XBlockAppConfig(AppConfig):
"""
Django app configuration for the new XBlo... | agpl-3.0 |
embray/numpy | numpy/lib/npyio.py | 1 | 66490 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter
import numpy as np
from . import format
from ._datasource import DataSource
from ._compiled_base import packbits, unpackbits
from ._iotools im... | bsd-3-clause |
xuanyuanking/spark | python/pyspark/rddsampler.py | 157 | 4250 | #
# 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 us... | apache-2.0 |
akaariai/django | django/db/backends/oracle/introspection.py | 517 | 11463 | import cx_Oracle
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type objects to Django Field types.
data_types_reverse = {
cx_Oracle.... | bsd-3-clause |
ramanala/PACE | pacersmexplorer.py | 1 | 23886 | #!/usr/bin/env python
#Copyright (c) 2016 Ramnatthan Alagappan
#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, modif... | mit |
canaltinova/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/edge.py | 7 | 2706 | from .base import Browser, ExecutorBrowser, require_arg
from ..webdriver_server import EdgeDriverServer
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorselenium import (SeleniumTestharnessExecutor,
SeleniumRefTestExecutor)
from ..executo... | mpl-2.0 |
huangkuan/hack | lib/requests/packages/charade/sjisprober.py | 167 | 3825 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
... | apache-2.0 |
jhayworth/config | .emacs.d/elpy/rpc-venv/local/lib/python2.7/site-packages/setuptools/extern/__init__.py | 10 | 2514 | import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(v... | gpl-3.0 |
py-amigos/adengine | tests/views/test_user.py | 1 | 2439 | import json
from adengine.model import User, Ad
NOT_FOUND_ERROR = {
"error": "Not found"
}
def build_api_url(id_=None):
if id_ is not None:
return "/api/users/{}".format(id_)
return "/api/users"
def _new_ad(user, text="ad-text"):
ad = Ad(text=text, author_id=user.id)
return ad
def _n... | artistic-2.0 |
tyll/fas | plugins/fas-plugin-bugzilla/fas_bugzilla/__init__.py | 11 | 5856 | # -*- coding: utf-8 -*-
import turbogears
from turbogears import controllers, expose, paginate, identity, redirect, widgets, validate, validators, error_handler
from turbogears.database import session
from fas.model import Session, People
import cherrypy
from genshi.template.plugin import TextTemplateEnginePlugin
im... | gpl-2.0 |
farvardin/txt2tags-test | test/options/run.py | 4 | 24250 | #
# txt2tags command line options tester (http://txt2tags.org)
# See also: ../run.py ../lib.py
#
# Note: The .t2t files are generated dynamicaly, based on 'tests' dict data
#
import sys, os
sys.path.insert(0, '..')
import lib
del sys.path[0]
# sux
lib.OK = lib.FAILED = 0
lib.ERROR_FILES = []
# text patterns to comp... | gpl-2.0 |
leedm777/ansible | lib/ansible/plugins/shell/sh.py | 34 | 6175 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
tartley/extending_unittest | src/all_dirs_runner.py | 1 | 3508 | '''
A test runner that augments Django's standard one by finding subclasses of
unittest.TestCase no matter where they are located in the project, even in
directories which are not django apps. (the default test runner only looks in
particular modules within each django app.)
See also tests.utils.testrunner, which uses... | bsd-3-clause |
Healthcast/RSV | python/all_year_predict/methods.py | 2 | 3879 | #!/usr/bin/pyhton
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets, neighbors, linear_model
from sklearn import svm
from sklearn import metrics
from sklearn.cross_validation import train_test_split
from sklearn.ensemble import RandomForestClassifier
def apply_algorithm(paras, X, y):
... | gpl-2.0 |
diogocs1/comps | web/addons/base_import_module/tests/test_module/__openerp__.py | 377 | 1290 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | apache-2.0 |
hrishioa/Navo | Raspi-Code/Lib/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | 436 | 117347 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceChara... | gpl-2.0 |
StudyBlue/sblibs | sblibs/display/general.py | 1 | 1801 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © Manoel Vilela 2016
#
# @project: Decorating
# @author: Manoel Vilela
# @email: manoel_vilela@engineer.com
#
# pylint: disable=redefined-builtin
# pylint: disable=invalid-name
"""
An collection of usefull decorators for debug
and time... | bsd-2-clause |
Antiun/odoomrp-wip | machine_purchase/models/account_invoice.py | 29 | 2548 |
from openerp import models, fields, api
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
@api.multi
def invoice_validate(self):
res = super(AccountInvoice, self).invoice_validate()
machinery_obj = self.env['machinery']
purchase_obj = self.env['purchase.order']
... | agpl-3.0 |
initChan/PredictionIO | examples/scala-parallel-similarproduct/filterbyyear/data/import_eventserver.py | 142 | 1844 | """
Import sample data for similar product engine
"""
import predictionio
import argparse
import random
SEED = 3
def import_events(client):
random.seed(SEED)
count = 0
print client.get_status()
print "Importing data..."
# generate 10 users, with user ids u1,u2,....,u10
user_ids = ["u%s" % i for i in ran... | apache-2.0 |
polzy/PokeManager | pogo/POGOProtos/Networking/Responses/AddFortModifierResponse_pb2.py | 6 | 1927 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Responses/AddFortModifierResponse.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
... | mit |
Donkyhotay/MoonPy | zope/wfmc/adapter/integration.py | 1 | 1606 | ##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | gpl-3.0 |
inveniosoftware/invenio-ext | invenio_ext/collect/storage/link.py | 5 | 2066 | # -*- coding: utf8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any ... | gpl-2.0 |
sss/calibre-at-bzr | src/cherrypy/_cpchecker.py | 87 | 14739 | import os
import warnings
import cherrypy
from cherrypy._cpcompat import iteritems, copykeys, builtins
class Checker(object):
"""A checker for CherryPy sites and their mounted applications.
When this object is called at engine startup, it executes each
of its own methods whose names start with ``che... | gpl-3.0 |
wagnerand/olympia | src/olympia/reviewers/tests/test_review_scenarios.py | 5 | 3491 | """Real life review scenarios.
For different add-on and file statuses, test reviewing them, and make sure then
end up in the correct state.
"""
import pytest
from olympia import amo
from olympia.addons.models import Addon
from olympia.amo.tests import user_factory
from olympia.files.models import File
from olympia.re... | bsd-3-clause |
microelly2/geodata | geodat/import_aster.py | 1 | 5208 | ''' geodat import AST (gdal)'''
# -*- coding: utf-8 -*-
#-------------------------------------------------
#-- geodat import AST (gdal)
#--
#-- microelly 2016 v 0.1
#--
#-- GNU Lesser General Public License (LGPL)
#-------------------------------------------------
#http://geoinformaticstutorial.blogspot.de/2012/09/rea... | lgpl-3.0 |
xuxiao19910803/edx | lms/djangoapps/courseware/features/video.py | 11 | 20973 | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
from lettuce import world, step, before, after
import json
import os
import time
import requests
from nose.tools import assert_equal, assert_true, assert_false
from common import i_am_registered_for_the_course, visit_scenario_item
from django.utils.translatio... | agpl-3.0 |
thombashi/pytablewriter | test/writer/text/test_html_writer.py | 1 | 14391 | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from textwrap import dedent
import pytest
import pytablewriter
from pytablewriter.style import Style
from ..._common import print_test_result
from ...data import (
Data,
headers,
mix_header_list,
mix_value_matrix,
null_test_... | mit |
gagneurlab/concise | concise/utils/splines.py | 2 | 6437 | # get the splines
import numpy as np
import scipy.interpolate as si
# TODO - BSpline.predict() -> allow x to be of any shape. return.shape = in.shape + (n_bases)
# MAYBE TODO - implement si.splev using keras.backend.
# - That way you don't have to hash the X_spline in memory.
class BSpline():
"""Cl... | mit |
nmayorov/scikit-learn | examples/plot_multilabel.py | 236 | 4157 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
mapr/hue | desktop/core/ext-py/MySQL-python-1.2.5/_mysql_exceptions.py | 99 | 2352 | """_mysql_exceptions: Exception classes for _mysql and MySQLdb.
These classes are dictated by the DB API v2.0:
http://www.python.org/topics/database/DatabaseAPI-2.0.html
"""
try:
from exceptions import Exception, StandardError, Warning
except ImportError:
# Python 3
StandardError = Exception
class ... | apache-2.0 |
lckung/spark-ec2 | launch-script/lib/boto-2.34.0/tests/integration/ec2/autoscale/test_connection.py | 114 | 6560 | # Copyright (c) 2011 Reza Lotun http://reza.lotun.name
# 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 ... | apache-2.0 |
flavoso/gerencex | gerencex/core/tests/test_view_office_tickets.py | 1 | 1342 | import datetime
from django.contrib.auth.models import User
from django.shortcuts import resolve_url as r
from django.test import TestCase
from django.utils import timezone
from gerencex.core.models import Restday, Office
class OfficeTicketsViewTest(TestCase):
def setUp(self):
self.office = Office.objec... | gpl-3.0 |
teslaji/homebase | venv/HomeBase/lib/python3.5/site-packages/pip/index.py | 237 | 47847 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | gpl-3.0 |
dr4ke616/donedeal-notifier | notifier/mail/client.py | 2 | 1978 | import smtplib
from os.path import basename
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
class Email(object):
mail_server = 'localhost'
port = 0
mail_user = None
mail_passwd = None
content_type = 'html'
... | mit |
markovmodel/PyEMMA | pyemma/coordinates/tests/test_traj_info_cache.py | 2 | 14155 | # This file is part of PyEMMA.
#
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER)
#
# PyEMMA 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 versi... | lgpl-3.0 |
trehn/teamvault | teamvault/apps/secrets/admin.py | 2 | 2477 | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .models import AccessRequest, Secret, SecretRevision
class AccessRequestAdmin(admin.ModelAdmin):
fieldsets = (
(_("Subject"), {
'fields': (
'requester',
'secret',
... | gpl-3.0 |
rs2/pandas | pandas/tests/io/parser/test_na_values.py | 2 | 15082 | """
Tests that NA values are properly handled during
parsing for all of the parsers defined in parsers.py
"""
from io import StringIO
import numpy as np
import pytest
from pandas._libs.parsers import STR_NA_VALUES
from pandas import DataFrame, Index, MultiIndex
import pandas._testing as tm
def test_string_nas(all_... | bsd-3-clause |
Livefyre/flaubert | flaubert/preprocess.py | 1 | 19265 | import nltk
import unicodedata
import regex as re
import sys
import abc
import logging
import os
import cPickle as pickle
from pkg_resources import resource_filename
from bs4 import BeautifulSoup
from itertools import islice
from functools import partial
from nltk.corpus import stopwords
from nltk.stem import wordnet, ... | mit |
fracting/depot_tools | testing_support/auto_stub.py | 53 | 2301 | # Copyright (c) 2011 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.
__version__ = '1.0'
import collections
import inspect
import unittest
class AutoStubMixIn(object):
"""Automatically restores stubbed functions on un... | bsd-3-clause |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/encodings/koi8_t.py | 101 | 13193 | """ Python Character Mapping Codec koi8_t
"""
# http://ru.wikipedia.org/wiki/КОИ-8
# http://www.opensource.apple.com/source/libiconv/libiconv-4/libiconv/tests/KOI8-T.TXT
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,err... | gpl-3.0 |
sloede/modm | modfileparser.py | 1 | 6189 | #!/usr/bin/env python
# Modm - Modules iMproved
# Copyright (C) 2013-2014 Michael Schlottke
#
# 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 opt... | gpl-2.0 |
tambetm/neon | neon/optimizers/learning_rule.py | 2 | 2780 | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | apache-2.0 |
cp16net/trove | trove/tests/unittests/guestagent/test_dbaas.py | 1 | 144181 | # Copyright 2012 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-2.0
#
# Unless required by applicable l... | apache-2.0 |
dbentley/pants | tests/python/pants_test/engine/test_round_engine.py | 5 | 10965 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
fr... | apache-2.0 |
morelab/appcomposer | alembic/versions/2ef3688b5383_add_translationexternalsuggestions.py | 3 | 1733 | """Add TranslationExternalSuggestions
Revision ID: 2ef3688b5383
Revises: 20860ffde766
Create Date: 2015-04-19 12:43:34.752894
"""
# revision identifiers, used by Alembic.
revision = '2ef3688b5383'
down_revision = '20860ffde766'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto ge... | bsd-2-clause |
wangyum/tensorflow | tensorflow/python/kernel_tests/cast_op_test.py | 62 | 8621 | # 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 |
qusp/orange3 | Orange/canvas/document/tests/test_quickmenu.py | 10 | 2542 | from PyQt4.QtGui import QStringListModel
from PyQt4.QtCore import QPoint
from ..quickmenu import QuickMenu, SuggestMenuPage, FlattenedTreeItemModel, \
MenuPage, QAction
from ...gui.test import QAppTestCase
from ...registry import global_registry
from ...registry.qt import QtWidgetRegistry
cl... | bsd-2-clause |
kazemakase/scikit-learn | sklearn/feature_extraction/text.py | 24 | 50103 | # -*- coding: utf-8 -*-
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Robert Layton <robertlayton@gmail.com>
# Jochen Wersdörfer <jochen@wersdoerfer.de>
# Roman Sinayev <roman.sinayev@gma... | bsd-3-clause |
2014c2g12/c2g12 | wsgi/exts/w2/static/Brython2.0.0-20140209-164925/Lib/unittest/test/testmock/testpatch.py | 739 | 53126 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support import SomeClass, is_instance
from unittest.mock import... | gpl-2.0 |
philippmayrth/uptime | tests/uptime_tests.py | 2 | 5533 | #!/usr/bin/env python
# coding: utf8
import imp
import sys
import time
from datetime import datetime
import unittest
sys.path.insert(0, '.')
import src as uptime
boottime_helpers = [f for f in vars(uptime) if f.startswith('_boottime_')]
uptime_helpers = [f for f in vars(uptime) if f.startswith('_uptime_')]
class... | bsd-2-clause |
ABaldwinHunter/django-clone | django/contrib/auth/urls.py | 568 | 1036 | # The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
from django.conf.urls import url
from django.contrib.auth import views
... | bsd-3-clause |
buitenzorg812/Koha-PTFS | koha-tmpl/intranet-tmpl/prog/en/lib/greybox/GreyBox_v5_5/combiner.py | 109 | 3808 | #!/usr/bin/env python
"""
Used to combine the different parts of GreyBox.
- Python 2.4 required
- Java 1.4+ required
- Dojo's JavaScript compressor (http://dojotoolkit.org/docs/compressor_system.html). Place it under compression_lib/custom_rhino.jar
"""
import os, sys, shutil
from compression_lib import AJS_minify
if... | gpl-2.0 |
omegachysis/arche-engine | arche/image.py | 1 | 11087 |
_panda = False
try:
import pygame
from pygame import locals
except:
_panda = True
import logging
log = logging.getLogger("R.Surface")
def scaleImage(surface, width, height):
""" Return surface scaled to fit width and height. """
#log.debug("scaled image %s" % repr(surface))
return pygame.tr... | apache-2.0 |
idl3r/P8000-Kernel | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
hujiajie/chromium-crosswalk | third_party/WebKit/LayoutTests/http/tests/websocket/unicode_wsh.py | 42 | 2082 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
jalexvig/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/masked_matmul_ops_test.py | 111 | 3662 | # 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 applic... | apache-2.0 |
nanditav/15712-TensorFlow | tensorflow/python/summary/impl/directory_watcher_test.py | 37 | 6719 | # 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 |
zasdfgbnm/tensorflow | tensorflow/contrib/distributions/python/ops/conditional_distribution.py | 120 | 3310 | # 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 |
fargalaxy1/geonode-wagtail | geonode/contrib/metadataxsl/views.py | 12 | 1479 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
silly-wacky-3-town-toon/SOURCE-COD | toontown/battle/DistributedBattleFinal.py | 1 | 7784 | from panda3d.core import *
from panda3d.direct import *
from direct.interval.IntervalGlobal import *
from BattleBase import *
from direct.actor import Actor
from toontown.distributed import DelayDelete
from direct.directnotify import DirectNotifyGlobal
import DistributedBattleBase
import MovieUtil
from toontown.suit im... | apache-2.0 |
SamiHiltunen/invenio-formatter | invenio_formatter/bundles.py | 9 | 1409 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
bwrsandman/OpenUpgrade | addons/base_import/models.py | 222 | 14243 | import csv
import itertools
import logging
import operator
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import psycopg2
from openerp.osv import orm, fields
from openerp.tools.translate import _
FIELDS_RECURSION_LIMIT = 2
ERROR_PREVIEW_BYTES = 200
_logger = logging.ge... | agpl-3.0 |
yograterol/django | tests/modeladmin/models.py | 108 | 1603 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Band(models.Model):
name = models.CharField(max_length=100)
bio = models.TextField()
sign_date = models.DateFiel... | bsd-3-clause |
mkieszek/jobsplus | jobsplus_recruitment/wizard/jp_recruiter2deal.py | 1 | 4127 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 26 09:48:26 2013
@author: mbereda
"""
from openerp.osv import osv,fields
from openerp.tools.translate import _
import pdb
import datetime
class jp_recruiter2deal(osv.Model):
_name = 'jp.recruiter2deal'
_columns = {
'deal_id': fields.many2one('jp... | agpl-3.0 |
ecosoft-odoo/odoo | addons/l10n_ma/l10n_ma.py | 336 | 1952 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
MSylvia/pyNES | pynes/tests/commandline_test.py | 28 | 3400 | # -*- coding: utf-8 -*-
from pynes import main
from pynes.tests import FileTestCase
from mock import patch
class CommandLineTest(FileTestCase):
@patch('pynes.compiler.compile_file')
def test_asm(self, compiler):
main("pynes asm fixtures/movingsprite/movingsprite.asm".split())
compiler.assert_... | bsd-3-clause |
kaos/ecos | packages/hal/arm/gps4020/current/support/download/download.py | 11 | 3416 | #! /usr/bin/env python
#
# Copyright (C) 2003, MLB Associates
#
# This program is used to read a Motorola S-record file and
# download it using the GDB protocol.
import os, string, sys, time
trace = open("/tmp/download.trace", "w")
#
# Use up some time
#
def spin():
j = 0
for i in range(0,200):
j =... | gpl-2.0 |
haoxli/crosswalk-test-suite | tools/xml/csv2xml.py | 18 | 10254 | #!/usr/bin/python
# encoding:utf-8
# Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of cond... | bsd-3-clause |
manojhirway/ExistingImagesOnNFS | cinder/exception.py | 8 | 27813 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
kirbyfan64/shedskin | examples/adatron.py | 6 | 6315 | #!/usr/bin/env python
# Adatron SVM with polynomial kernel
# placed in the public domain by Stavros Korokithakis
import sys
from math import exp
CYTOSOLIC = 0
EXTRACELLULAR = 1
NUCLEAR = 2
MITOCHONDRIAL = 3
BLIND = 4
D = 5.0
LENGTH = 50
PROTEINS = []
AMINOACIDS = "ACDEFGHIKLMNPQRSTVWY"
class Protein:
def __... | gpl-3.0 |
Java1Guy/ansible-modules-extras | packaging/os/pkgng.py | 60 | 11130 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, bleader
# Written by bleader <bleader@ratonland.org>
# Based on pkgin module written by Shaun Zinck <shaun.zinck at gmail.com>
# that was based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew W... | gpl-3.0 |
xianjunzhengbackup/Cloud-Native-Python | env/lib/python3.6/site-packages/flask/testsuite/basic.py | 406 | 43777 | # -*- coding: utf-8 -*-
"""
flask.testsuite.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import uuid
import flask
import pickle
import unittest
from datetime import datetime
from threading i... | mit |
mortcanty/earthengine | src/Crypto/Signature/PKCS1_v1_5.py | 126 | 8637 | # -*- coding: utf-8 -*-
#
# Signature/PKCS1-v1_5.py : PKCS#1 v1.5
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual,... | mit |
mrunge/horizon | openstack_dashboard/dashboards/project/containers/panel.py | 48 | 1079 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
EntropyFactory/creativechain-core | qa/rpc-tests/p2p-fullblocktest.py | 11 | 52732 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | mit |
Distrotech/intellij-community | python/lib/Lib/encodings/unicode_internal.py | 827 | 1196 | """ Python 'unicode-internal' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is in... | apache-2.0 |
watermelo/libcloud | libcloud/backup/drivers/dummy.py | 31 | 1460 | # 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 use ... | apache-2.0 |
pyramania/scipy | benchmarks/benchmarks/linalg.py | 41 | 4330 | from __future__ import division, absolute_import, print_function
import math
import numpy.linalg as nl
import numpy as np
from numpy.testing import assert_
from numpy.random import rand
try:
import scipy.linalg as sl
except ImportError:
pass
from .common import Benchmark
def random(size):
return rand... | bsd-3-clause |
JuliBakagianni/CEF-ELRC | metashare/repository/templatetags/email_protection.py | 6 | 2257 | from django import template
from random import randrange, shuffle
register = template.Library()
class EncryptEmail(template.Node):
"""
Template tag that allows to obfuscate email addresses in page templates.
Based on http://djangosnippets.org/snippets/1907/
"""
def __init__(self, c... | bsd-3-clause |
Microvellum/Fluid-Designer | win64-vc/2.78/python/lib/test/test_importlib/test_api.py | 8 | 17783 | from . import util as test_util
init = test_util.import_importlib('importlib')
util = test_util.import_importlib('importlib.util')
machinery = test_util.import_importlib('importlib.machinery')
import os.path
import sys
from test import support
import types
import unittest
import warnings
class ImportModuleTests:
... | gpl-3.0 |
cloudant/graphite-web | webapp/graphite/render/attime.py | 8 | 5014 | """Copyright 2008 Orbitz WorldWide
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 |
levibostian/myBlanky | googleAppEngine/google/appengine/_internal/django/utils/formats.py | 23 | 5789 | import decimal
import datetime
from google.appengine._internal.django.conf import settings
from google.appengine._internal.django.utils.translation import get_language, to_locale, check_for_language
from google.appengine._internal.django.utils.importlib import import_module
from google.appengine._internal.django.utils... | mit |
mozvip/Sick-Beard | lib/requests/packages/chardet2/constants.py | 3008 | 1335 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
a10networks/a10-neutron-lbaas | a10_neutron_lbaas/neutron_ext/services/a10_device_instance/plugin.py | 2 | 6477 | # Copyright 2015, A10 Networks
#
# 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 agr... | apache-2.0 |
mattdangerw/inkscape | share/extensions/jessyInk_keyBindings.py | 7 | 15464 | #!/usr/bin/env python
# Copyright 2008, 2009 Hannes Hochreiner
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | gpl-2.0 |
RobinD42/pyside | tests/signals/ref06_test.py | 6 | 1133 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from PySide.QtCore import QObject, QCoreApplication, QTimeLine, Signal, Slot
from helper import UsesQCoreApplication
class ExtQObject(QObject):
signalbetween = Signal('qreal')
def __init__(self):
QObject.__init__(self)
self.counter... | lgpl-2.1 |
atmtools/typhon | doc/example_google.py | 1 | 8646 | # -*- coding: utf-8 -*-
"""Example Google style docstrings.
This module demonstrates documentation as specified by the `Google Python
Style Guide`_. Docstrings may extend over multiple lines. Sections are created
with a section header and a colon followed by a block of indented text.
Example:
Examples can be give... | mit |
dwaynebailey/translate | translate/storage/tmdb.py | 3 | 13483 | # -*- coding: utf-8 -*-
#
# Copyright 2009, 2013 Zuza Software Foundation
# Copyright 2013 F Wolff
#
# This file is part of translate.
#
# translate 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 versi... | gpl-2.0 |
kirca/OpenUpgrade | doc/_themes/odoodoc/__init__.py | 90 | 1063 | # -*- coding: utf-8 -*-
from . import html_domain
from . import github
# add Odoo style to pygments
from . import odoo_pygments
from . import sphinx_monkeypatch
sphinx_monkeypatch.patch()
def setup(app):
html_domain.setup(app)
github.setup(app)
app.add_directive('exercise', Exercise)
app.add_node(exe... | agpl-3.0 |
GinnyN/towerofdimensions-django | django-social-auth/social_auth/middleware.py | 3 | 1892 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib import messages
from django.shortcuts import redirect
from social_auth.backends.exceptions import AuthException
class SocialAuthExceptionMiddleware(object):
"""Middleware that handles Social Auth AuthExceptions by providing the user
... | bsd-3-clause |
Endika/edx-platform | common/djangoapps/auth_exchange/forms.py | 113 | 3848 | """
Forms to support third-party to first-party OAuth 2.0 access token exchange
"""
from django.contrib.auth.models import User
from django.forms import CharField
from oauth2_provider.constants import SCOPE_NAMES
import provider.constants
from provider.forms import OAuthForm, OAuthValidationError
from provider.oauth2.f... | agpl-3.0 |
rjenc29/numerical | course/matplotlib/examples/fill_example.py | 1 | 2229 | """
Illustrate different ways of using the various fill functions.
"""
import numpy as np
import matplotlib.pyplot as plt
import example_utils
def main():
fig, axes = example_utils.setup_axes()
fill_example(axes[0])
fill_between_example(axes[1])
stackplot_example(axes[2])
example_utils.title(fig... | mit |
EDUlib/edx-platform | lms/djangoapps/courseware/services.py | 4 | 1267 | """
Courseware services.
"""
import json
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from lms.djangoapps.courseware.models import StudentModule
from common.djangoapps.student.models import get_user_by_username_or_email
class UserStateService:
"""
User st... | agpl-3.0 |
seninp/saxpy | saxpy/hotsax.py | 1 | 4860 | """Implements HOT-SAX."""
import numpy as np
from saxpy.znorm import znorm
from saxpy.sax import sax_via_window
from saxpy.distance import euclidean
def find_discords_hotsax(series, win_size=100, num_discords=2, alphabet_size=3,
paa_size=3, znorm_threshold=0.01, sax_type='unidim'):
"""HOT... | gpl-2.0 |
pedrobaeza/odoo | addons/membership/report/report_membership.py | 55 | 6117 | # -*- 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 |
urrego093/proyecto_mv | gluon/contrib/pyrtf/Elements.py | 43 | 33090 | from types import IntType, FloatType, LongType, StringTypes
from copy import deepcopy
from binascii import hexlify
from Constants import *
from Styles import *
class UnhandledParamError( Exception ) :
def __init__( self, param ) :
Exception.__init__( self, "Don't... | gpl-3.0 |
prop/titanium_mobile | support/common/csspacker.py | 108 | 2193 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# CSS Minification Script
# http://www.siafoo.net/snippet/16
# released in public domain
#
from __future__ import division
import sys
import getopt
import re
import string
def compress(input):
output = ''
while True:
open_c = input.find('/*')
... | apache-2.0 |
ausdim/SGS3-JB-U8 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (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, sys
sys.path.append(os.env... | gpl-2.0 |
HailStorm32/Q.bo_stacks | qbo_stereo_anaglyph/hrl_lib/src/hrl_lib/msg/_Pose3DOF.py | 1 | 5992 | """autogenerated by genpy from hrl_lib/Pose3DOF.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class Pose3DOF(genpy.Message):
_md5sum = "646ead44a0e6fecf4e14ca116f12b08b"
_type = "hrl_lib/Pose3DOF"
_has_header = True #flag ... | lgpl-2.1 |
awanke/weave | test/scheduler/main.py | 11 | 3831 | import collections
import json
import logging
import operator
import re
import flask
from oauth2client.client import GoogleCredentials
from googleapiclient import discovery
from google.appengine.api import urlfetch
from google.appengine.ext import ndb
app = flask.Flask('scheduler')
app.debug = True
# We use exponen... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.