repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
akvo/django-registration
refs/heads/master
registration/admin.py
107
from django.contrib import admin from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from registration.models import RegistrationProfile class RegistrationAdmin(admin.ModelAdmin): actions = ['activate_users', 're...
telerik/cloudbase-init
refs/heads/master
cloudbaseinit/plugins/windows/sethostname.py
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Cloudbase Solutions Srl # # 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/LICEN...
impulse-cloud/django-crispy-forms
refs/heads/dev
crispy_forms/base.py
9
class KeepContext(object): """ Context manager that receives a `django.template.Context` instance and a list of keys Once the context manager is exited, it removes `keys` from the context, to avoid side effects in later layout objects that may use the same context variables. Layout objects shoul...
onecloud/neutron
refs/heads/master
neutron/tests/unit/nec/test_config.py
8
# Copyright 2012 NEC Corporation. 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 ...
isb-cgc/ISB-CGC-Webapp
refs/heads/master
workbooks/migrations/0004_auto_20160614_1131.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-14 18:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('workbooks', '0003_auto_20160304_1518'), ] operation...
jamescoineron/octane
refs/heads/master
share/qt/make_spinner.py
4415
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
datapythonista/pandas
refs/heads/master
pandas/tests/tseries/holiday/test_observance.py
7
from datetime import datetime import pytest from pandas.tseries.holiday import ( after_nearest_workday, before_nearest_workday, nearest_workday, next_monday, next_monday_or_tuesday, next_workday, previous_friday, previous_workday, sunday_to_monday, weekend_to_monday, ) _WEDNES...
agermanidis/Pattern
refs/heads/master
en/inflect/__init__.py
1
#### PATTERN | EN | INFLECT ########################################################################## # Copyright (c) 2010 University of Antwerp, Belgium # Author: Tom De Smedt <tom@organisms.be> # License: BSD (see LICENSE.txt for details). ############################################################################...
2ndy/RaspIM
refs/heads/master
usr/lib/python2.6/distutils/version.py
259
# # distutils/version.py # # Implements multiple version numbering conventions for the # Python Module Distribution Utilities. # # $Id$ # """Provides classes to represent module version numbers (one class for each style of version numbering). There are currently two such classes implemented: StrictVersion and LooseVe...
itsjeyd/edx-platform
refs/heads/master
cms/djangoapps/contentstore/tests/test_course_settings.py
11
""" Tests for Studio Course Settings. """ import datetime import ddt import json import copy import mock from mock import Mock, patch import unittest from django.conf import settings from django.utils.timezone import UTC from django.test.utils import override_settings from contentstore.utils import reverse_course_url...
0x0all/SASM
refs/heads/master
Windows/MinGW64/opt/lib/python2.7/sre_parse.py
49
# # Secret Labs' Regular Expression Engine # # convert re-style regular expression to sre pattern # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for information on usage and redistribution. # """Internal support module for sre""" # XXX: show string offset and offending ch...
alikins/ansible
refs/heads/devel
lib/ansible/modules/windows/win_group.py
47
#!/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 ...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/surface/_hoverlabel.py
2
import _plotly_utils.basevalidators class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="hoverlabel", parent_name="surface", **kwargs): super(HoverlabelValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
wendellpbarreto/badroc
refs/heads/master
system/dashboard.py
1
""" This file was generated with the customdashboard management command and contains the class for the main dashboard. To activate your index dashboard add the following to your settings.py:: GRAPPELLI_INDEX_DASHBOARD = 'rochas.dashboard.CustomIndexDashboard' """ from django.utils.translation import ugettext_lazy...
CoDaS-Lab/image_analysis
refs/heads/master
demo/img_classifier.py
1
import os import sys from sklearn import datasets, metrics from image_analysis.pipeline import Pipeline from image_analysis.pipeline import SVM digits = datasets.load_digits() images_and_labels = list(zip(digits.images, digits.target)) n_samples = len(digits.images) data = digits.images.reshape((n_samples, -1)) pipe ...
philanthropy-u/edx-platform
refs/heads/master
openedx/core/lib/xblock_builtin/__init__.py
34
""" Helper functions shared by built-in XBlocks. """ from django.conf import settings def get_css_dependencies(group): """ Returns list of CSS dependencies belonging to `group` in settings.PIPELINE_JS. Respects `PIPELINE_ENABLED` setting. """ if settings.PIPELINE_ENABLED: return [setti...
luistorresm/odoo
refs/heads/8.0
openerp/addons/base/module/wizard/__init__.py
365
# -*- 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...
dovydas/mezzanine
refs/heads/master
mezzanine/accounts/urls.py
5
from __future__ import unicode_literals from django.conf.urls import patterns, url from mezzanine.conf import settings ACCOUNT_URL = getattr(settings, "ACCOUNT_URL", "/accounts/") SIGNUP_URL = getattr(settings, "SIGNUP_URL", "/%s/signup/" % ACCOUNT_URL.strip("/")) SIGNUP_VERIFY_URL = getattr(se...
mitar/django
refs/heads/master
django/db/models/query.py
2
""" The main QuerySet implementation. This provides the public API for the ORM. """ import copy import itertools import sys from django.core import exceptions from django.db import connections, router, transaction, IntegrityError from django.db.models.fields import AutoField from django.db.models.query_utils import (...
camptocamp/odoo
refs/heads/master
addons/resource/faces/resource.py
433
#@+leo-ver=4 #@+node:@file resource.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softwa...
RuiNascimento/krepo
refs/heads/master
script.areswizard/requests/packages/chardet/jpcntx.py
1776
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
vishh/kubernetes
refs/heads/master
Godeps/_workspace/src/github.com/ugorji/go/codec/test.py
1139
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
stargaser/astropy
refs/heads/placeholder
astropy/visualization/wcsaxes/wcsapi.py
3
# Functions/classes for WCSAxes related to APE14 WCSes import numpy as np from astropy.coordinates import SkyCoord, ICRS, BaseCoordinateFrame from astropy import units as u from astropy.wcs import WCS from astropy.wcs.utils import local_partial_pixel_derivatives from astropy.wcs.wcsapi import SlicedLowLevelWCS from ...
sobjornstad/esc
refs/heads/master
esc/commands.py
1
""" commands.py - implement menus, operations, and other things that show up in the commands window We use menus to register and keep track of the commands the user can choose. Actual calculator functionality is defined in functions.py (and in user plugins). First come EscCommand and its subclasses, whi...
jrief/easy-thumbnails
refs/heads/postprocessor
easy_thumbnails/migrations/0012_build_storage_hashes.py
15
# encoding: utf-8 import datetime import hashlib from south.db import db from south.v2 import DataMigration from django.db import models from django.core.files.storage import default_storage import pickle class Migration(DataMigration): """ Migrate storage hashes. """ def get_storage_hash(self, stor...
foobarbazblarg/stayclean
refs/heads/master
stayclean-2020-december/venv/lib/python3.8/site-packages/pip/__main__.py
17
from __future__ import absolute_import import os import sys # Remove '' and current working directory from the first entry # of sys.path, if present to avoid using current directory # in pip commands check, freeze, install, list and show, # when invoked as python -m pip <command> if sys.path[0] in ('', os.getcwd()): ...
has2k1/plotnine
refs/heads/master
plotnine/themes/theme_classic.py
1
from .elements import element_line, element_rect, element_blank from .theme import theme from .theme_bw import theme_bw class theme_classic(theme_bw): """ A classic-looking theme, with x & y axis lines and no gridlines. Parameters ---------- base_size : int, optional Base font size. A...
cynrd/blog
refs/heads/master
sokoban_astar/move.py
1
from state import State class Move: def __init__(self, walls): self.walls = walls def get_state(self, state): if not self.can_move_in_direction(state): return None target_player_pos = (self.next_row(state), self.next_col(state)) if self.walls[target_player_pos[0]][...
bireme/django-fossil
refs/heads/master
fossil/tests/test_models.py
1
import datetime from django.db import models, connection from django.core.management.color import no_style from django.contrib.flatpages.models import FlatPage from django.contrib.contenttypes import generic from django.db.models.sql.query import setup_join_cache from django.contrib.auth.models import User from fossi...
linebp/pandas
refs/heads/master
pandas/core/common.py
1
""" Misc tools for implementing data structures """ import sys import warnings from datetime import datetime, timedelta from functools import partial import inspect import collections import numpy as np from pandas._libs import lib, tslib from pandas import compat from pandas.compat import long, zip, iteritems from ...
obreitwi/nest-simulator
refs/heads/master
doc/nest_by_example/scripts/one_neuron_with_sine_wave.py
4
# -*- coding: utf-8 -*- # # one_neuron_with_sine_wave.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 t...
gorserg/openprocurement.tender.competitivedialogue
refs/heads/master
openprocurement/tender/competitivedialogue/views/stage2/award_document.py
2
# -*- coding: utf-8 -*- from openprocurement.tender.core.utils import optendersresource from openprocurement.tender.openua.views.award_document import ( TenderUaAwardDocumentResource ) from openprocurement.tender.openeu.views.award_document import ( TenderAwardDocumentResource as TenderEUAwardDocumentResource )...
dmazzella/micropython
refs/heads/master
tests/basics/string_endswith_upy.py
32
# MicroPython doesn't support tuple argument try: "foobar".endswith(("bar", "sth")) except TypeError: print("TypeError")
soedinglab/hh-suite
refs/heads/master
scripts/hhmakemodel.py
1
#!/usr/bin/env python from hh_reader import read_result from copy import deepcopy from pdbx.reader.PdbxReader import PdbxReader from pdbx.writer.PdbxWriter import PdbxWriter import re, os, sys, tempfile, glob from operator import itemgetter # hzhu from itertools import groupby # hzhu EMPTY = '*' GAP = '-' DEBUG_...
hiroakis/ansible
refs/heads/devel
test/units/executor/__init__.py
7690
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
Maccimo/intellij-community
refs/heads/master
python/testData/intentions/PyAnnotateVariableTypeIntentionTest/notSuggestedForComprehensionTarget.py
19
[v<caret>ar for var in range(10)]
romankagan/DDBWorkbench
refs/heads/master
python/testData/refactoring/extractsuperclass/multifile/target.append.py
83
# existing module A = 1 class Suppa: def foo(self): print "bar"
nullx002/pychess
refs/heads/master
lib/pychess/Utils/lutils/strateval.py
20
""" This module differs from leval in that it is not optimized for speed. It checks differences between last and current board, and returns not scores, but strings describing the differences. Can be used for commenting on board changes. """ from __future__ import absolute_import from .ldata import * fr...
BartDeWaal/libsigrokdecode
refs/heads/unclean
decoders/i2c/pd.py
11
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2010-2014 Uwe Hermann <uwe@hermann-uwe.de> ## ## 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 t...
MQQiang/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_longexp.py
182
import unittest from test import support class LongExpText(unittest.TestCase): def test_longexp(self): REPS = 65580 l = eval("[" + "2," * REPS + "]") self.assertEqual(len(l), REPS) def test_main(): support.run_unittest(LongExpText) if __name__=="__main__": test_main()
Empeeric/dirometer
refs/heads/master
django/core/exceptions.py
292
""" Global Django exception and warning classes. """ class DjangoRuntimeWarning(RuntimeWarning): pass class ObjectDoesNotExist(Exception): "The requested object does not exist" silent_variable_failure = True class MultipleObjectsReturned(Exception): "The query returned multiple objects when only one w...
debugger06/MiroX
refs/heads/master
lib/downloader.py
2
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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...
SummerLW/Perf-Insight-Report
refs/heads/test
dashboard/dashboard/add_point_queue_test.py
5
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from dashboard import add_point_queue from dashboard import testing_common from dashboard import utils from dashboard.models import graph_da...
gurkerl83/millipede-xtreemfs
refs/heads/pseiferth-libxtreemfsjava
contrib/ganglia-plugin/src/xtfs-osd-plugin.py
7
''' Created on May 25, 2011 @author: bzcseife This is a python ganglia plugin which monitors the status of an OSD service of the XtreemFS filesystem. It is intend to run on the same host as the OSD and gathers information of the OSD per SNMP. Therefore you have to configure your OSD to provide a SNMP Agent on this h...
geminy/aidear
refs/heads/master
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/build/android/gyp/aidl.py
8
#!/usr/bin/env python # # Copyright 2014 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. """Invokes Android's aidl """ import optparse import os import re import sys import zipfile from util import build_utils def main...
babyliynfg/cross
refs/heads/master
tools/project-creator/Python2.6.6/Lib/test/test_operator.py
1
import operator import unittest from test import test_support class Seq1: def __init__(self, lst): self.lst = lst def __len__(self): return len(self.lst) def __getitem__(self, i): return self.lst[i] def __add__(self, other): return self.lst + other.lst ...
eigenn/flaskengine
refs/heads/master
tests/views/test_edit.py
1
from .base import BaseTest, TestModel, BpAppRegister, test_bp from flaskengine import ModelEdit class EditTestView(ModelEdit): admin = False model = TestModel EditTestView.register_bp(test_bp) class TestEditModel(BaseTest): def setUp(self): super(TestEditModel, self).setUp() BpAppRegist...
vwvww/servo
refs/heads/master
tests/wpt/web-platform-tests/tools/third_party/py/testing/io_/test_capture.py
55
from __future__ import with_statement import os, sys import py needsdup = py.test.mark.skipif("not hasattr(os, 'dup')") from py.builtin import print_ if sys.version_info >= (3,0): def tobytes(obj): if isinstance(obj, str): obj = obj.encode('UTF-8') assert isinstance(obj, bytes) ...
TheMOOCAgency/edx-platform
refs/heads/master
lms/djangoapps/shoppingcart/exceptions.py
191
""" Exceptions for the shoppingcart app """ # (Exception Class Names are sort of self-explanatory, so skipping docstring requirement) # pylint: disable=missing-docstring class PaymentException(Exception): pass class PurchasedCallbackException(PaymentException): pass class InvalidCartItem(PaymentException)...
LuminateWireless/grpc
refs/heads/master
test/core/http/test_server.py
30
#!/usr/bin/env python2.7 # Copyright 2015, 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 lis...
imaculate/scikit-learn
refs/heads/master
sklearn/neighbors/nearest_centroid.py
34
# -*- coding: utf-8 -*- """ Nearest Centroid Classification """ # Author: Robert Layton <robertlayton@gmail.com> # Olivier Grisel <olivier.grisel@ensta.org> # # License: BSD 3 clause import warnings import numpy as np from scipy import sparse as sp from ..base import BaseEstimator, ClassifierMixin from ..met...
gnmiller/craig-bot
refs/heads/master
craig-bot/lib/python3.6/site-packages/pyasn1_modules/rfc1905.py
11
# # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # # SNMPv2c PDU syntax # # ASN.1 source from: # http://www.ietf.org/rfc/rfc1905.txt # from pyasn1.type import constraint from pyasn1.type import namedtype fr...
Yen-Chung-En/2015cdb_g1_0623-2
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/errno.py
624
""" This module makes available standard errno system symbols. The value of each symbol is the corresponding integer value, e.g., on most systems, errno.ENOENT equals the integer 2. The dictionary errno.errorcode maps numeric codes to symbol names, e.g., errno.errorcode[2] could be the string 'ENOENT'. Symbols that ar...
trabacus-softapps/openerp-8.0-cc
refs/heads/master
openerp/addons/account_asset/report/__init__.py
445
# -*- 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...
gavrieltal/opencog
refs/heads/master
opencog/nlp/anaphora/agents/testingAgent.py
11
from __future__ import print_function from pprint import pprint from pln.examples.deduction import deduction_agent from opencog.atomspace import types, AtomSpace, TruthValue from hobbs import HobbsAgent from dumpAgent import dumpAgent from opencog.scheme_wrapper import load_scm,scheme_eval_h, __init__ __author__ = 'H...
acsone/hr
refs/heads/8.0
hr_expense_sequence/__openerp__.py
13
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Odoo Source Management Solution # Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # # This pro...
HeinAtCERN/MyUtility
refs/heads/master
PythonUtil/python/utility.py
2
import FWCore.ParameterSet.Config as cms def make_histo_analyzer( src, plot_quantity, n_bins, low=0., high=0., x_label="", y_label="number of candidates", weights="" ): """tokens: (low, high, n_bins, x_label, y_label)""" if not x_label: x...
bepitulaz/huntingdimana
refs/heads/master
env/Lib/site-packages/pip/_vendor/distlib/version.py
426
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2014 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-386, distribute-compatible and semantic versioning. """ import logging import re from .compat import string_types ...
jhseu/tensorflow
refs/heads/master
tensorflow/python/keras/distribute/keras_premade_models_test.py
1
# Copyright 2019 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...
gmsn-ita/vaspirin
refs/heads/master
vaspirin/procar.py
2
import sys, os, shutil from . import projection class PROCAR (object): ''' Deals with PROCAR-related information, such as band composition, projection onto orbitals and atomic sites. The PROCAR file should be passed as input to this class. The PROCAR class cannot deals with very large (~ GB) PROCAR files, since a ...
andrewnc/scikit-learn
refs/heads/master
sklearn/preprocessing/__init__.py
268
""" The :mod:`sklearn.preprocessing` module includes scaling, centering, normalization, binarization and imputation methods. """ from ._function_transformer import FunctionTransformer from .data import Binarizer from .data import KernelCenterer from .data import MinMaxScaler from .data import MaxAbsScaler from .data ...
msebire/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/tests/geo3d/views.py
6027
# Create your views here.
chaomodus/pixywerk
refs/heads/master
pixywerk/__init__.py
1
"""PixyWerk - a framework for serving metadata-rich, templated files for the web.""" from . import simpleconfig from . import utils from . import werk from . import wsgi from .version import *
fellchase/4chan-media-downloader
refs/heads/master
bs4/tests/test_docs.py
607
"Test harness for doctests." # pylint: disable-msg=E0611,W0142 __metaclass__ = type __all__ = [ 'additional_tests', ] import atexit import doctest import os #from pkg_resources import ( # resource_filename, resource_exists, resource_listdir, cleanup_resources) import unittest DOCTEST_FLAGS = ( doctes...
yannrouillard/weboob
refs/heads/master
modules/taz/pages/article.py
11
"ArticlePage object for Taz newspaper" # -*- coding: utf-8 -*- # Copyright(C) 2012 Florent Fourcot # # This file is part of weboob. # # weboob 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 ver...
carze/cutlass
refs/heads/master
examples/host_seq_prep.py
2
#!/usr/bin/env python # pylint: disable=C0111, C0325 import logging import sys from pprint import pprint from cutlass import HostSeqPrep from cutlass import iHMPSession username = "test" password = "test" def set_logging(): """ Setup logging. """ root = logging.getLogger() root.setLevel(logging.DEBUG) ...
brentn/plover
refs/heads/master
plover/gui/lookup.py
7
# Copyright (c) 2013 Hesky Fisher # See LICENSE.txt for details. import wx from wx.lib.utils import AdjustRectToScreen import sys from plover.steno import normalize_steno import plover.gui.util as util TITLE = 'Plover: Lookup' class LookupDialog(wx.Dialog): BORDER = 3 TRANSLATION_TEXT = 'Text:' oth...
kmoocdev2/edx-platform
refs/heads/real_2019
common/djangoapps/third_party_auth/tests/utils.py
19
"""Common utility for testing third party oauth2 features.""" import json import httpretty from provider.constants import PUBLIC from provider.oauth2.models import Client from social_core.backends.facebook import FacebookOAuth2, API_VERSION as FACEBOOK_API_VERSION from social_django.models import UserSocialAuth, Parti...
kisna72/django
refs/heads/master
tests/generic_inline_admin/admin.py
513
from django.contrib import admin from django.contrib.contenttypes.admin import GenericTabularInline from .models import ( Category, Contact, Episode, EpisodePermanent, Media, PhoneNumber, ) site = admin.AdminSite(name="admin") class MediaInline(GenericTabularInline): model = Media class EpisodeAdmin(admin...
richardtran415/pymatgen
refs/heads/master
pymatgen/io/abinit/tests/test_netcdf.py
5
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import os import unittest import numpy as np from pymatgen.core.structure import Structure from pymatgen.io.abinit import ETSF_Reader from pymatgen.util.testing import PymatgenTest try: import netCDF4 ex...
nphyx/jsvolume
refs/heads/master
node_modules/jsdoc/node_modules/esprima/tools/generate-unicode-regex.py
260
#!/usr/bin/python # -*- coding: utf-8 -*- # By Yusuke Suzuki <utatane.tea@gmail.com> # Modified by Mathias Bynens <http://mathiasbynens.be/> # http://code.google.com/p/esprima/issues/detail?id=110 import sys import string import re class RegExpGenerator(object): def __init__(self, detector): self.detector = det...
dmwyatt/django-rest-framework
refs/heads/master
rest_framework/throttling.py
2
""" Provides various throttling policies. """ from __future__ import unicode_literals import time from django.core.cache import cache as default_cache from django.core.exceptions import ImproperlyConfigured from rest_framework.settings import api_settings class BaseThrottle(object): """ Rate throttling of ...
zouyapeng/horizon
refs/heads/stable/juno
openstack_dashboard/dashboards/project/volumes/backups/tests.py
6
# 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 # distributed under t...
blckshrk/Weboob
refs/heads/master
modules/popolemploi/pages.py
1
# -*- coding: utf-8 -*- # Copyright(C) 2013 Bezleputh # # This file is part of weboob. # # weboob 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...
DDelon/youtube-dl
refs/heads/master
youtube_dl/extractor/traileraddict.py
146
from __future__ import unicode_literals import re from .common import InfoExtractor class TrailerAddictIE(InfoExtractor): _WORKING = False _VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/(?:trailer|clip)/(?P<movie>.+?)/(?P<trailer_name>.+)' _TEST = { 'url': 'http://www.traileraddict.com/...
ustramooner/CouchPotato
refs/heads/NzbIndexCom
library/sqlalchemy/orm/unitofwork.py
11
# orm/unitofwork.py # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """The internals for the unit of work system. The session's flush() process pa...
mrrusof/snippets
refs/heads/master
python/utils.py
1
import sys def failwith(str): print 'FAILURE:',str sys.exit(1) def warn(str): print 'WARNING:', str
apark263/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/padding_fifo_queue_test.py
8
# 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...
kuipertan/vitess
refs/heads/master
py/vtproto/automation_pb2.py
8
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: automation.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf i...
JeyZeta/Dangerous
refs/heads/master
Dangerous/Weevely/core/argparse.py
1
# Author: Steven J. Bethard <steven.bethard@gmail.com>. from moduleexception import ModuleException from ast import literal_eval """Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informati...
kalvdans/scipy
refs/heads/master
scipy/special/tests/test_gammainc.py
48
from __future__ import division, print_function, absolute_import import numpy as np from scipy.special import gammainc from scipy.special._testutils import FuncData def test_line(): # Test on the line a = x where a simpler asymptotic expansion # (analog of DLMF 8.12.15) is available. def gammainc_line(x)...
Rona111/website
refs/heads/8.0
website_event_register_free_with_sale/__openerp__.py
8
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2015 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # # This program is free software: you can redistribute it a...
ahmedaljazzar/edx-platform
refs/heads/master
lms/djangoapps/certificates/services.py
17
""" Certificate service """ import logging from django.core.exceptions import ObjectDoesNotExist from lms.djangoapps.utils import _get_key from opaque_keys.edx.keys import CourseKey from .models import GeneratedCertificate log = logging.getLogger(__name__) class CertificateService(object): """ User Certifi...
kaste/mockito-python
refs/heads/master
tests/staticmethods_test.py
1
# Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste # # 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...
syl20bnr/nupic
refs/heads/master
nupic/regions/ImageSensorFilters/Rotation2D.py
17
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
xifle/greensc
refs/heads/master
tools/scons/scons-local-2.0.1/SCons/Options/PathOption.py
61
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
bristy/login_app_flask
refs/heads/master
env/lib/python2.7/site-packages/flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py
629
from flask import Module, render_template admin = Module(__name__, url_prefix='/admin') @admin.route('/') def index(): return render_template('admin/index.html') @admin.route('/index2') def index2(): return render_template('./admin/index.html')
larsbutler/zpa
refs/heads/master
publish/yaml/representer.py
360
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', 'RepresenterError'] from error import * from nodes import * import datetime import sys, copy_reg, types class RepresenterError(YAMLError): pass class BaseRepresenter(object): yaml_representers = {} yaml_multi_representers = {} d...
ahmadshahwan/cohorte-runtime
refs/heads/master
python/src/lib/python/unidecode/x0bc.py
253
data = ( 'mil', # 0x00 'milg', # 0x01 'milm', # 0x02 'milb', # 0x03 'mils', # 0x04 'milt', # 0x05 'milp', # 0x06 'milh', # 0x07 'mim', # 0x08 'mib', # 0x09 'mibs', # 0x0a 'mis', # 0x0b 'miss', # 0x0c 'ming', # 0x0d 'mij', # 0x0e 'mic', # 0x0f 'mik', # 0x10 'mit', # ...
Arelle/Arelle
refs/heads/master
arelle/CntlrQuickBooks.py
3
''' Created on Jan 19, 2012 This module implements Quick Books server mode @author: Mark V Systems Limited (c) Copyright 2012 Mark V Systems Limited, All rights reserved. ''' from lxml import etree import uuid, io, datetime from arelle import XmlUtil clientVersion = None userName = None sessions = {} # use when int...
unseenlaser/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/importlib/test/extension/util.py
51
import imp import os import sys PATH = None EXT = None FILENAME = None NAME = '_testcapi' _file_exts = [x[0] for x in imp.get_suffixes() if x[2] == imp.C_EXTENSION] try: for PATH in sys.path: for EXT in _file_exts: FILENAME = NAME + EXT FILEPATH = os.path.join(PATH, FILENAME) ...
ocefpaf/system-test
refs/heads/master
pelican-plugins/representative_image/__init__.py
65
from .representative_image import *
ricardosiri68/patchcap
refs/heads/master
PatchMan/patchman/controller/device_controller.py
1
from patchman.models import Device, DBSession from formencode import validators from formencode.schema import Schema from pyramid.httpexceptions import (HTTPFound, HTTPNotFound) from pyramid.renderers import render_to_response from pyramid.view import view_config from pyramid_uniform import Form from pyramid_uniform im...
mayblue9/scikit-learn
refs/heads/master
sklearn/linear_model/perceptron.py
245
# 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 -...
SinnerSchraderMobileMirrors/django-cms
refs/heads/develop
cms/migrations/0016_author_copy.py
385
# -*- 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): # Dummy migration pass def backwards(self, orm): # Dummy migration pass models = { ...
nexiles/odoo
refs/heads/8.0
addons/base_setup/__openerp__.py
259
# -*- 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...
GdZ/scriptfile
refs/heads/master
software/googleAppEngine/lib/django_1_4/tests/modeltests/order_with_respect_to/tests.py
150
from __future__ import absolute_import from operator import attrgetter from django.test import TestCase from .models import Post, Question, Answer class OrderWithRespectToTests(TestCase): def test_basic(self): q1 = Question.objects.create(text="Which Beatle starts with the letter 'R'?") q2 = Qu...
nemonik/CoCreateLite
refs/heads/master
ccl-cookbook/files/default/cocreatelite/cocreate/views/playgrounds.py
1
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.core.urlresolvers import reverse from ..models import VMPlayground from ..forms import VMPlaygroundForm, VMPlaygroundDescriptionForm, VMPlaygroundUserAccessForm, VMPlaygroundGroupAccessForm fr...
ingadhoc/odoo-saas-manager
refs/heads/master
addons/saas_manager_x/product_template.py
1
# -*- coding: utf-8 -*- ############################################################################## # # Nautical # Copyright (C) 2013 Sistemas ADHOC # No email # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # ...
iuliat/nova
refs/heads/master
nova/api/openstack/compute/plugins/v3/suspend_server.py
36
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...