repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
thoreg/satchmo | satchmo/apps/satchmo_store/shop/views/comments.py | 14 | 2167 | """Satchmo product rating views"""
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.contrib.comments.models import Comment
from django.contrib.comments.views.comments import post_comment
from django.contrib.contenttypes.models import ContentType
from django.http impor... | bsd-3-clause |
BrainIntensive/OnlineBrainIntensive | resources/nipype/nipype/build_docs.py | 10 | 7099 | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Code to build the documentation in the setup.py
To use this code, run::
python setup.py build_sphinx
"""
from __future__ import print_function, division, unicode_literals, ... | mit |
mrpau/kolibri | kolibri/core/content/test/test_channel_import.py | 1 | 26417 | import io
import json
import os
import pickle
import tempfile
import uuid
from django.core.management import call_command
from django.test import TestCase
from django.test import TransactionTestCase
from mock import call
from mock import MagicMock
from mock import Mock
from mock import patch
from sqlalchemy import cre... | mit |
MediaSapiens/autonormix | django/contrib/gis/db/backends/spatialite/creation.py | 16 | 4167 | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.db.backends.sqlite3.creation import DatabaseCreation
class SpatiaLiteCreation(DatabaseCreation):
def create_test_db(self, verbosity=1, autoclobber=False):
... | bsd-3-clause |
revpoint/pykafka | pykafka/common.py | 5 | 1566 | # - coding: utf-8 -
"""
Author: Keith Bourgoin
"""
__license__ = """
Copyright 2015 Parse.ly, 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
Un... | apache-2.0 |
rbarlow/pulp | client_lib/pulp/client/launcher.py | 5 | 8572 | """
Entry point for both the admin and consumer clients. The config file location
is passed in and its contents are used to drive the rest of the client execution.
"""
import errno
from gettext import gettext as _
import logging
import logging.handlers
from optparse import OptionParser
import os
import stat
import sys... | gpl-2.0 |
Makeystreet/makeystreet | woot/apps/core/migrations/0001_initial.py | 1 | 2166 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'SendMail'
db.create_table(u'core_sendmail', (
... | apache-2.0 |
dmitry-pervushin/android-linux-linaro | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
vjFaLk/frappe | frappe/patches/v6_1/rename_file_data.py | 3 | 1115 | from __future__ import print_function, unicode_literals
import frappe
def execute():
from frappe.core.doctype.file.file import make_home_folder
if not frappe.db.exists("DocType", "File"):
frappe.rename_doc("DocType", "File Data", "File")
frappe.reload_doctype("File")
if not frappe.db.exists("File", {"is_home_... | mit |
ryrzy/ics_kernel | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
rackerlabs/heat-pyrax | samples/cloud_loadbalancers/session_persistence.py | 13 | 1492 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | apache-2.0 |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/django/contrib/gis/gdal/prototypes/generation.py | 100 | 3976 | """
This module contains functions that generate ctypes prototypes for the
GDAL routines.
"""
from ctypes import c_char_p, c_double, c_int, c_void_p
from django.contrib.gis.gdal.prototypes.errcheck import (
check_arg_errcode, check_errcode, check_geom, check_geom_offset,
check_pointer, check_srs, check_str_a... | apache-2.0 |
home-assistant/home-assistant | homeassistant/components/roomba/roomba.py | 5 | 3241 | """Class for Roomba devices."""
import logging
from homeassistant.components.vacuum import SUPPORT_FAN_SPEED
from .irobot_base import SUPPORT_IROBOT, IRobotVacuum
_LOGGER = logging.getLogger(__name__)
ATTR_BIN_FULL = "bin_full"
ATTR_BIN_PRESENT = "bin_present"
FAN_SPEED_AUTOMATIC = "Automatic"
FAN_SPEED_ECO = "Eco... | apache-2.0 |
KousikaGanesh/purchaseandInventory | openerp/addons/account_asset/__init__.py | 446 | 1135 | # -*- encoding: 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 t... | agpl-3.0 |
sogelink/ansible | lib/ansible/module_utils/lxd.py | 104 | 6283 | # -*- coding: utf-8 -*-
# (c) 2016, Hiroaki Nakamura <hnakamur@gmail.com>
#
# 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 th... | gpl-3.0 |
matys18/sublime_kattis | requests/packages/urllib3/packages/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | mit |
telf/TDR_patch_series_1 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
M4573R/playground-notes | big-data/homework3/octo.py | 6 | 22188 | #!/usr/bin/python
from __future__ import with_statement
import asynchat
import asyncore
import base64
try:
import bsddb
except ImportError:
try:
import bsddb3 as bsddb
except ImportError:
del sys.modules[__name__]
import bz2
import contextlib
import imp
import i... | mit |
rwl/PyCIM | CIM15/IEC61970/Informative/InfGMLSupport/GmlStroke.py | 1 | 10341 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | mit |
cltk/latin_models_cltk | lemmata/backoff/latin_model.py | 1 | 10413 | from collections import ChainMap
# Wordlists for conjunctions, prepositions, and interjections based on Allen & Greenough; ambiguous forms removed
CONJUNCTIONS = ['-que', '-ue', '-ve', 'at', 'atque', 'atqui', 'attamen', 'aut', 'autem', 'ceu', 'dum', 'dummodo', 'enim', 'enimuero', 'ergo', 'et', 'etenim', 'etiam', 'eti... | mit |
henriquechehad/PySPED | pysped/nfe/processador_nfe.py | 1 | 48265 | # -*- coding: utf-8 -*-
#
# PySPED - Python libraries to deal with Brazil's SPED Project
#
# Copyright (C) 2010-2012
# Copyright (C) Aristides Caldeira <aristides.caldeira at tauga.com.br>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Library General Public Lic... | lgpl-2.1 |
multirom-htc/android_external_f2fs | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
lepistone/account-financial-tools | currency_rate_date_check/currency_rate_date_check.py | 7 | 4723 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Currency rate date check module for OpenERP
# Copyright (C) 2012-2013 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: y... | agpl-3.0 |
hyiltiz/youtube-dl | youtube_dl/extractor/freevideo.py | 147 | 1189 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class FreeVideoIE(InfoExtractor):
_VALID_URL = r'^http://www.freevideo.cz/vase-videa/(?P<id>[^.]+)\.html(?:$|[?#])'
_TEST = {
'url': 'http://www.freevideo.cz/vase-videa/vysukany-zadecek-22033... | unlicense |
henriklindgren/topdownshooter | actors.py | 1 | 7172 | #coding:utf-8
import pygame
from globals import *
from movementpatterns import Wander, SneakySide
class Player(pygame.sprite.Sprite):
def __init__(self, x, y, game_max_x, game_max_y):
super(Player, self).__init__()
images = [pygame.image.load(
os.path.join(SPRITES_FOLDER, 'plane', 'l0_... | apache-2.0 |
coolbombom/CouchPotatoServer | libs/suds/sax/element.py | 175 | 36480 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
roselleebarle04/opencog | opencog/python/embodiment/situation.py | 34 | 13777 | from utility.generic import subsets_of_len_two
__author__ = 'keyvan'
from opencog.atomspace import AtomSpace, types, TruthValue
from random import randrange
_default_tv = TruthValue(1, 1)
class CombinationDescriptor(object):
pass
class TypeDescriptor(CombinationDescriptor):
def __init__(self, weight, obj... | agpl-3.0 |
siosio/intellij-community | python/helpers/py3only/docutils/readers/doctree.py | 246 | 1607 | # $Id: doctree.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Martin Blais <blais@furius.ca>
# Copyright: This module has been placed in the public domain.
"""Reader for existing document trees."""
from docutils import readers, utils, transforms
class Reader(readers.ReReader):
"""
Adapt the Reader API fo... | apache-2.0 |
130s/ros_buildfarm | scripts/doc/generate_doc_metadata_job.py | 3 | 1358 | #!/usr/bin/env python3
import argparse
import sys
from ros_buildfarm.argument import add_argument_build_name
from ros_buildfarm.argument import add_argument_config_url
from ros_buildfarm.argument import add_argument_rosdistro_name
from ros_buildfarm.config import get_doc_build_files
from ros_buildfarm.config import g... | apache-2.0 |
75651/kbengine_cloud | kbe/src/lib/python/Lib/lib2to3/fixes/fix_next.py | 203 | 3174 | """Fixer for it.next() -> next(it), per PEP 3114."""
# Author: Collin Winter
# Things that currently aren't covered:
# - listcomp "next" names aren't warned
# - "with" statement targets aren't checked
# Local imports
from ..pgen2 import token
from ..pygram import python_symbols as syms
from .. import fixer_base
f... | lgpl-3.0 |
renard/ansible | test/support/windows-integration/plugins/modules/win_user_right.py | 56 | 3205 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
h4ng3r/YSO-Mobile-Security-Framework | StaticAnalyzer/tools/enjarify/enjarify/jvm/arraytypes.py | 27 | 1760 | # 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... | gpl-3.0 |
pepeportela/edx-platform | common/test/acceptance/tests/lms/test_problem_types.py | 1 | 44419 | """
Bok choy acceptance and a11y tests for problem types in the LMS
See also lettuce tests in lms/djangoapps/courseware/features/problems.feature
"""
import random
import textwrap
from abc import ABCMeta, abstractmethod
from flaky import flaky
import ddt
from nose import SkipTest
from nose.plugins.attrib import attr
... | agpl-3.0 |
hbwhlklive/color-emoji.skia | bench/tile_analyze.py | 198 | 12134 | #!/usr/bin/env python
# Copyright (c) 2013 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.
""" Analyze per-tile and viewport bench data, and output visualized results.
"""
__author__ = 'bensong@google.com (Ben Chen)'
imp... | bsd-3-clause |
paulcwatts/drf-json-schema | rest_framework_json_schema/relations.py | 1 | 4253 | """
Serializer fields and classes for handling related resources.
https://jsonapi.org/format/#document-resource-object-relationships
"""
from typing import Any, Dict, Type
from django.utils.module_loading import import_string
from rest_framework import serializers
from .schema import ResourceIdObject, ResourceObjec... | mit |
hatstand/webcal-filter | lib/setuptools/extension.py | 229 | 1649 | import sys
import re
import functools
import distutils.core
import distutils.errors
import distutils.extension
from .dist import _get_unpatched
from . import msvc9_support
_Extension = _get_unpatched(distutils.core.Extension)
msvc9_support.patch_for_specialized_compiler()
def _have_cython():
"""
Return True... | mit |
phobologic/django-avatar | avatar/tests.py | 1 | 5720 | import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
try:
# django 1.5
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError:
# before custom user models
from django.contrib.auth.models imp... | bsd-3-clause |
amarian12/p2pool-adaptive | p2pool/bitcoin/networks/Birdcoin.py | 2 | 1252 | import os
import platform
from twisted.internet import defer
from .. import data, helper
from p2pool.util import pack
P2P_PREFIX = 'ebd0c6cb'.decode('hex')
P2P_PORT = 16050
ADDRESS_VERSION = 47
RPC_PORT = 16051
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'birdcoinaddress' in (yi... | gpl-3.0 |
QiJune/Paddle | python/paddle/fluid/tests/unittests/test_listen_and_serv_op.py | 1 | 3558 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
fengzhe29888/gnuradio-old | gr-filter/examples/channelize.py | 58 | 7003 | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | gpl-3.0 |
ilyes14/scikit-learn | sklearn/decomposition/kernel_pca.py | 207 | 9120 | """Kernel Principal Components Analysis"""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from ..utils.arpack import eigsh
from ..utils.validation import check_is_fitted, NotFittedError
from ..base import BaseEstimator, TransformerMixin
from ..pre... | bsd-3-clause |
ltilve/ChromiumGStreamerBackend | chrome/common/extensions/docs/server2/host_file_system_iterator_test.py | 78 | 8159 | #!/usr/bin/env python
# Copyright 2013 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.
from copy import deepcopy
import unittest
from host_file_system_provider import HostFileSystemProvider
from host_file_system_iterator ... | bsd-3-clause |
DanCech/graphite-web | webapp/graphite/settings.py | 1 | 10215 | """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 |
ashvina/heron | heron/tools/cli/src/python/activate.py | 5 | 1421 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
jdugge/QGIS | python/plugins/processing/preconfigured/PreconfiguredAlgorithmDialog.py | 30 | 4469 | # -*- coding: utf-8 -*-
"""
***************************************************************************
PreconfiguredAlgorithmDialog.py
---------------------
Date : April 2016
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********... | gpl-2.0 |
cmtm/networkx | networkx/classes/tests/test_digraph.py | 2 | 10604 | #!/usr/bin/env python
from nose.tools import *
import networkx
from test_graph import BaseGraphTester, BaseAttrGraphTester, TestGraph
from test_graph import TestEdgeSubgraph as TestGraphEdgeSubgraph
class BaseDiGraphTester(BaseGraphTester):
def test_has_successor(self):
G=self.K3
assert_equal(G.has... | bsd-3-clause |
lstout/GendERC | get_uni_uri.py | 1 | 1228 | import sys
import pandas as pd
import requests
from bs4 import BeautifulSoup as Soup
"""
This script will try to get the dbpedia URI for a file with a list of universities.
The input is the filename of the list of universities and a file name where to save the resulting file.
"""
fn = sys.argv[1]
save_file = sys.arg... | mit |
thundernet8/WRGameVideos-Server | venv/lib/python2.7/site-packages/alembic/autogenerate/rewriter.py | 38 | 5476 | from alembic import util
from alembic.operations import ops
class Rewriter(object):
"""A helper object that allows easy 'rewriting' of ops streams.
The :class:`.Rewriter` object is intended to be passed along
to the
:paramref:`.EnvironmentContext.configure.process_revision_directives`
parameter i... | gpl-2.0 |
ahmed-mahran/hue | apps/beeswax/src/beeswax/design.py | 26 | 9530 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
agoodman/five-twelve | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
leesavide/pythonista-docs | Documentation/matplotlib/mpl_examples/pylab_examples/line_collection2.py | 9 | 1327 | from pylab import *
from matplotlib.collections import LineCollection
# In order to efficiently plot many lines in a single set of axes,
# Matplotlib has the ability to add the lines all at once. Here is a
# simple example showing how it is done.
N = 50
x = arange(N)
# Here are many sets of y to plot vs x
ys = [x+i f... | apache-2.0 |
FescueFungiShare/hydroshare | hs_composite_resource/models.py | 1 | 6773 | import os
from mezzanine.pages.page_processors import processor_for
from hs_core.models import BaseResource, ResourceManager, resource_processor
from hs_file_types.models import GenericLogicalFile
class CompositeResource(BaseResource):
objects = ResourceManager("CompositeResource")
class Meta:
ver... | bsd-3-clause |
eshijia/SUR | magnum/tests/unit/db/test_x509keypair.py | 9 | 6693 | # Copyright 2015 NEC 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 required b... | apache-2.0 |
wynn1212/dolphin | Externals/discord-rpc/build.py | 56 | 11015 | #!/usr/bin/env python
import os
import subprocess
import sys
import shutil
import zipfile
from contextlib import contextmanager
import click
def get_platform():
""" a name for the platform """
if sys.platform.startswith('win'):
return 'win'
elif sys.platform == 'darwin':
return 'osx'
... | gpl-2.0 |
kingmotley/SickRage | lib/chardet/sjisprober.py | 53 | 3690 | ######################## 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.
#
# Con... | gpl-3.0 |
daxxi13/CouchPotatoServer | libs/rtorrent/lib/bencode.py | 87 | 9140 | # Copyright (C) 2011 by clueless <clueless.nospam ! mail.com>
#
# 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, mo... | gpl-3.0 |
valtech-mooc/edx-platform | lms/djangoapps/psychometrics/models.py | 150 | 1876 | #
# db model for psychometrics data
#
# this data is collected in real time
#
from django.db import models
from courseware.models import StudentModule
class PsychometricData(models.Model):
"""
This data is a table linking student, module, and module performance,
including number of attempts, grade, max g... | agpl-3.0 |
jinnykoo/wuyisj.com | src/oscar/apps/dashboard/reports/forms.py | 28 | 1586 | from django import forms
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_class
GeneratorRepository = get_class('dashboard.reports.utils',
'GeneratorRepository')
class ReportForm(forms.Form):
generators = GeneratorRepository().get_report_g... | bsd-3-clause |
hflynn/openmicroscopy | components/tools/OmeroPy/ez_setup.py | 202 | 10285 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | gpl-2.0 |
alangwansui/mtl_ordercenter | openerp/addons/event_moodle/__openerp__.py | 54 | 2654 | # -*- 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 |
mydongistiny/external_chromium_org | third_party/closure_linter/closure_linter/javascriptlintrules.py | 83 | 31864 | #!/usr/bin/env python
# Copyright 2011 The Closure Linter 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
#
#... | bsd-3-clause |
hvy/chainer | tests/chainer_tests/functions_tests/array_tests/test_select_item.py | 12 | 4229 | import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product_dict(
[
{'in_shape': (10, 5), 'out_shape': (10,)},
{'... | mit |
inares/edx-platform | lms/djangoapps/courseware/access_response.py | 87 | 4737 | """
This file contains all the classes used by has_access for error handling
"""
from django.utils.translation import ugettext as _
from xmodule.course_metadata_utils import DEFAULT_START_DATE
class AccessResponse(object):
"""Class that represents a response from a has_access permission check."""
def __init_... | agpl-3.0 |
JamesMilnerUK/evernote2csv | evernote2csv/bs4/dammit.py | 408 | 29302 | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and XML, but it does not rewrite the
XML or HTML to reflect a new encoding; tha... | apache-2.0 |
mhnatiuk/phd_sociology_of_religion | scrapper/build/scrapy/scrapy/tests/test_selector_csstranslator.py | 59 | 6026 | """
Selector tests for cssselect backend
"""
from twisted.trial import unittest
from scrapy.http import HtmlResponse
from scrapy.selector.csstranslator import ScrapyHTMLTranslator
from scrapy.selector import Selector
from cssselect.parser import SelectorSyntaxError
from cssselect.xpath import ExpressionError
HTMLBODY... | gpl-2.0 |
kholidfu/django | django/db/transaction.py | 186 | 11823 | from django.db import (
DEFAULT_DB_ALIAS, DatabaseError, Error, ProgrammingError, connections,
)
from django.utils.decorators import ContextDecorator
class TransactionManagementError(ProgrammingError):
"""
This exception is thrown when transaction management is used improperly.
"""
pass
def get_... | bsd-3-clause |
lucalianas/openmicroscopy | components/tools/OmeroPy/src/omero/processor.py | 12 | 35532 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# OMERO Grid Processor
# Copyright 2008 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
import os
import time
import signal
import uuid
from omero_ext import killableprocess as subprocess
from path import path
im... | gpl-2.0 |
Shaps/ansible | lib/ansible/modules/system/reboot.py | 13 | 3751 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
lemonade512/BluebonnetsPointsApp | bluebonnetspointsapp/lib/jinja2/compiler.py | 335 | 63846 | # -*- coding: utf-8 -*-
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from jinja2... | gpl-3.0 |
TheDegree0/menescraper | menescraper/menescraper/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 116 | 17364 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys
import os
import marshal
import textwrap
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
# Python 2.7 or >=3.2
from sysconfig import get_path, g... | gpl-2.0 |
abloomston/sympy | sympy/assumptions/tests/test_sathandlers.py | 50 | 3844 | from sympy import Mul, Basic, Q, Expr, And, symbols, Equivalent, Implies, Or
from sympy.assumptions.sathandlers import (ClassFactRegistry, AllArgs,
UnevaluatedOnFree, AnyArgs, CheckOldAssump, ExactlyOneArg)
from sympy.utilities.pytest import raises
x, y, z = symbols('x y z')
def test_class_handler_registry():... | bsd-3-clause |
pipermerriam/flex | tests/loading/definition/responses/headers/test_multi_header_validation.py | 1 | 1205 | import pytest
from flex.exceptions import (
ValidationError,
)
from flex.error_messages import (
MESSAGES,
)
from flex.loading.definitions.responses.single import (
single_response_validator,
)
from tests.utils import (
assert_path_not_in_errors,
assert_message_in_errors,
)
def test_headers_is_n... | mit |
bharaths/CloudBot | plugins/core_misc.py | 6 | 3608 | import asyncio
import socket
from cloudbot import hook
socket.setdefaulttimeout(10)
# Auto-join on Invite (Configurable, defaults to True)
@asyncio.coroutine
@hook.irc_raw('INVITE')
def invite(irc_paramlist, conn):
"""
:type irc_paramlist: list[str]
:type conn: cloudbot.client.Client
"""
invite_... | gpl-3.0 |
wimac/home | Dropbox/skel/.config/openbox/scripts/gmail-openbox.py | 2 | 2288 | #!/usr/bin/python2.3
# Authors: cduquette@gmail.com follower@myrealbox.com
# License: GPL 2.0
# Usage:
# Put an entry in your ~/.config/openbox/menu.xml like this:
# <menu id="gmail" label="gmail" execute="~/.config/openbox/scripts/gmail-openbox.py" />
# And inside <menu id="root-menu" label="openbox">, add this somew... | gpl-2.0 |
stewartpark/django | docs/_ext/djangodocs.py | 17 | 11772 | """
Sphinx plugins for Django documentation.
"""
import json
import os
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.util.compat import Directive
from sphinx.util.console import bold
from s... | bsd-3-clause |
MatthewWilkes/django | django/db/backends/oracle/schema.py | 404 | 5313 | import binascii
import copy
import datetime
import re
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.utils import DatabaseError
from django.utils import six
from django.utils.text import force_text
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_create_column = "ALT... | bsd-3-clause |
cauchycui/scikit-learn | examples/neighbors/plot_regression.py | 349 | 1402 | """
============================
Nearest Neighbors regression
============================
Demonstrate the resolution of a regression problem
using a k-Nearest Neighbor and the interpolation of the
target using both barycenter and constant weights.
"""
print(__doc__)
# Author: Alexandre Gramfort <alexandre.gramfort@... | bsd-3-clause |
mars-knowsnothing/amos-bot | src/Lib/site-packages/pip/vcs/git.py | 340 | 11197 | from __future__ import absolute_import
import logging
import tempfile
import os.path
from pip.compat import samefile
from pip.exceptions import BadCommand
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip._vendor.packaging.versio... | gpl-3.0 |
bunburya/FlyingRobots | flying_robots/grid.py | 1 | 6511 | import random
from copy import deepcopy
from itertools import product
from operator import add
from flying_robots.chars import Player, Robot, Junk, gameclass
from flying_robots.exceptions import BadTileError, LevelComplete, GameOver
class GameGrid:
"""The game grid.
The z-axis represents the vertica... | mit |
ksmit799/Toontown-Source | toontown/building/DistributedKartShopInterior.py | 1 | 1241 | from direct.directnotify import DirectNotifyGlobal
from direct.distributed.DistributedObject import DistributedObject
from pandac.PandaModules import *
from toontown.building import ToonInteriorColors
from toontown.hood import ZoneUtil
from toontown.toonbase.ToonBaseGlobal import *
from toontown.toonbase.ToontownGlobal... | mit |
macopedia/hr | __unported__/hr_report_payroll_net/report/payroll_net.py | 21 | 9104 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>
#
# 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 Licens... | agpl-3.0 |
midma101/m0du1ar | .venv/lib/python2.7/site-packages/pip/_vendor/requests/cookies.py | 413 | 17191 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes... | mit |
RackSec/ansible | lib/ansible/modules/network/avi/avi_applicationprofile.py | 50 | 6539 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
liavkoren/djangoDev | tests/model_inheritance_same_model_name/tests.py | 22 | 1518 | from __future__ import unicode_literals
from django.test import TestCase
from model_inheritance.models import Title
class InheritanceSameModelNameTests(TestCase):
def setUp(self):
# The Title model has distinct accessors for both
# model_inheritance.Copy and model_inheritance_same_model_name.Co... | bsd-3-clause |
vasilenkomike/tarantool | test/xlog/missing.test.py | 10 | 1351 | import yaml
import os
#
# gh-716: infinite loop at start if missing xlog
#
server.stop()
server.deploy()
# Create wal#1
server.admin("space = box.schema.space.create('test')")
server.admin("index = box.space.test:create_index('primary')")
server.stop()
server.start()
# these inserts will be in their own xlog, which ... | bsd-2-clause |
halvertoluke/edx-platform | common/test/acceptance/tests/discussion/helpers.py | 46 | 4061 | """
Helper functions and classes for discussion tests.
"""
from uuid import uuid4
import json
from ...fixtures import LMS_BASE_URL
from ...fixtures.course import CourseFixture
from ...fixtures.discussion import (
SingleThreadViewFixture,
Thread,
Response,
)
from ...pages.lms.discussion import DiscussionTa... | agpl-3.0 |
hipnusleo/laserjet | resource/pypi/cryptography-1.7.1/src/cryptography/hazmat/bindings/openssl/_conditional.py | 1 | 9498 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
# This is a temporary copy of all the CONDITIONAL_NAMES from _cffi_... | apache-2.0 |
Intel-tensorflow/tensorflow | tensorflow/python/keras/datasets/fashion_mnist.py | 6 | 3462 | # 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 |
HM2MC/Webfront | reportlab-2.5/build/lib.win32-2.7/reportlab/platypus/doctemplate.py | 10 | 45792 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/doctemplate.py
__version__=''' $Id: doctemplate.py 3791 2010-09-29 19:37:05Z andy $ '''
__doc__="""
This module contains the core structure ... | mit |
fsb4000/bitcoin | qa/rpc-tests/p2p-mempool.py | 13 | 3299 | #!/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.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... | mit |
btallman/incubator-airflow | airflow/hooks/oracle_hook.py | 33 | 5920 | # -*- 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 |
bcpki/nonce2testblocks | qa/rpc-tests/test_framework.py | 15 | 3043 | #!/usr/bin/env python
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.... | mit |
binoculars/osf.io | api_tests/preprints/views/test_preprint_list.py | 2 | 38267 | import mock
from nose.tools import * # flake8: noqa
import pytest
from addons.github.models import GithubFile
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from api_tests.preprints.filters.test_filters import PreprintsListFilteringMixin
from api_tests.preprints.views.test_p... | apache-2.0 |
rooshilp/CMPUT410W15-project | testenv/lib/python2.7/site-packages/django/core/management/commands/sqlmigrate.py | 43 | 2791 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, DEFAULT_DB_ALIAS
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.loader import Ambi... | gpl-2.0 |
proversity-org/edx-platform | common/lib/xmodule/xmodule/tests/test_sequence.py | 1 | 11798 | """
Tests for sequence module.
"""
# pylint: disable=no-member
from datetime import timedelta
from django.utils.timezone import now
from freezegun import freeze_time
from mock import Mock, patch
from xmodule.seq_module import SequenceModule
from xmodule.tests import get_test_system
from xmodule.tests.helpers import Stu... | agpl-3.0 |
vibhorag/scikit-learn | sklearn/linear_model/omp.py | 58 | 30869 | """Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from distutils.version import LooseVersion
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from .base import LinearModel, _pre_fit
from ..base import RegressorM... | bsd-3-clause |
PressLabs/zipa | tests/fixtures.py | 1 | 3770 | import pytest
import httpretty
@pytest.fixture
def pretty_api():
httpretty.register_uri(httpretty.GET, 'http://api.test.com/item/a',
status=200,
content_type='application/json',
body=u'{"name": "a"}')
httpretty.register_uri(httpr... | apache-2.0 |
njayaram2/incubator-madlib | src/madpack/yaml/emitter.py | 126 | 44317 |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | apache-2.0 |
golaizola/pelisalacarta-xbmc | servers/hotfile.py | 43 | 2316 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para hotfile
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impor... | gpl-3.0 |
matteocrippa/dsl-n55u-bender | release/src/router/libxml2/python/tests/thread2.py | 87 | 2240 | #!/usr/bin/python -u
import string, sys, time
import thread
from threading import Thread, Lock
import libxml2
THREADS_COUNT = 15
failed = 0
class ErrorHandler:
def __init__(self):
self.errors = []
self.lock = Lock()
def handler(self,ctx,str):
self.lock.acquire()
self.errors... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.