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
EDUlib/edx-platform
common/djangoapps/pipeline_mako/tests/test_render.py
4
3488
""" Tests for rendering functions in the mako pipeline. """ from unittest import skipUnless from unittest.mock import patch import ddt from django.conf import settings from django.test import TestCase from common.djangoapps.pipeline_mako import compressed_css, compressed_js, render_require_js_path_overrides class...
agpl-3.0
wwrechard/pydlm
pydlm/tuner/dlmTuner.py
1
4269
""" =============================================================== The discount factor tuner for dlm =============================================================== The modelTuner class provides the tuning functionality for the dlm class. It makes use of the gradient descent to optimize the discount factor for each...
bsd-3-clause
alanjw/GreenOpenERP-Win-X86
openerp/addons/hr_timesheet_invoice/report/report_analytic.py
52
5253
# -*- 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...
agpl-3.0
agualis/test-django-nonrel
django/forms/widgets.py
155
33059
""" HTML Widget classes """ import datetime from itertools import chain import time from urlparse import urljoin from util import flatatt import django.utils.copycompat as copy from django.conf import settings from django.utils.datastructures import MultiValueDict, MergeDict from django.utils.html import escape, condi...
bsd-3-clause
jeffery9/mixprint_addons
ineco_merge_invoice/__init__.py
1
1097
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 - INECO PARTNERSHIP LIMITE (<http://www.ineco.co.th>). # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
lecaoquochung/ddnb.django
tests/admin_inlines/admin.py
37
5354
from django.contrib import admin from django import forms from .models import ( Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2, Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder, Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stacked, Inner4Tabular, NonAut...
bsd-3-clause
hernanramirez/venezuela
venezuela_project/venezuela_project/settings/local.py
58
1632
"""Development settings and globals.""" from __future__ import absolute_import from os.path import join, normpath from .base import * ########## DEBUG CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-deb...
gpl-2.0
Yarrick13/hwasp
tests/sat/Models/c692.170.SAT.dimacs.test.py
5
9560
input = """ c num blocks = 1 c num vars = 170 c minblockids[0] = 1 c maxblockids[0] = 170 p cnf 170 692 -66 -52 106 0 -89 -84 -148 0 119 -84 96 0 114 -105 -10 0 93 31 74 0 -63 146 -100 0 -132 28 -99 0 105 97 -154 0 2 -19 124 0 122 -74 -52 0 137 6 98 0 104 36 55 0 -5 75 -40 0 43 -47 110 0 5 -75 25 0 55 -165 -71 0 -170 -...
apache-2.0
home-assistant/home-assistant
tests/components/fritzbox/test_binary_sensor.py
2
2763
"""Tests for AVM Fritz!Box binary sensor component.""" from datetime import timedelta from unittest import mock from unittest.mock import Mock from requests.exceptions import HTTPError from homeassistant.components.binary_sensor import DOMAIN from homeassistant.components.fritzbox.const import DOMAIN as FB_DOMAIN fro...
apache-2.0
Apoc2400/Reftag
gdata/tlslite/constants.py
279
7476
"""Constants used in various places.""" class CertificateType: x509 = 0 openpgp = 1 cryptoID = 2 class HandshakeType: hello_request = 0 client_hello = 1 server_hello = 2 certificate = 11 server_key_exchange = 12 certificate_request = 13 server_hello_done = 14 certificate_ve...
gpl-3.0
rimacone/testing2
tests/processes/communication/LogMessageTest.py
34
3288
import unittest from datetime import datetime from coalib.misc import Constants from coalib.output.printers.LOG_LEVEL import LOG_LEVEL from coalib.processes.communication.LogMessage import LogMessage class LogMessageTest(unittest.TestCase): timestamp = datetime.today() def setUp(self): self.uut = Lo...
agpl-3.0
wvangeit/python-mode
pymode/libs2/rope/base/resources.py
58
6191
import os import re import rope.base.change import rope.base.fscommands from rope.base import exceptions class Resource(object): """Represents files and folders in a project""" def __init__(self, project, path): self.project = project self._path = path def move(self, new_location): ...
lgpl-3.0
linuxdaemon/CloudBot
plugins/minecraft_wiki.py
3
1938
import re import requests from lxml import html from cloudbot import hook from cloudbot.util import formatting api_url = "http://minecraft.gamepedia.com/api.php?action=opensearch" mc_url = "http://minecraft.gamepedia.com/" @hook.command() def mcwiki(text, reply): """<phrase> - gets the first paragraph of the M...
gpl-3.0
gogogo/gogogo-hk
common/appenginepatch/aecmd.py
1
4878
# -*- coding: utf-8 -*- import os, sys COMMON_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) PROJECT_DIR = os.path.dirname(COMMON_DIR) ZIP_PACKAGES_DIRS = (os.path.join(PROJECT_DIR, 'zip-packages'), os.path.join(COMMON_DIR, 'zip-packages')) # Overrides for os.environ env_ext = {...
agpl-3.0
hnakamur/django
tests/gis_tests/geoapp/tests.py
189
41436
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from django.core.man...
bsd-3-clause
albertrdixon/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
mhnatiuk/phd_sociology_of_religion
scrapper/build/scrapy/scrapy/tests/test_cmdline/__init__.py
18
1076
import sys from subprocess import Popen, PIPE import unittest from scrapy.utils.test import get_testenv class CmdlineTest(unittest.TestCase): def setUp(self): self.env = get_testenv() self.env['SCRAPY_SETTINGS_MODULE'] = 'scrapy.tests.test_cmdline.settings' def _execute(self, *new_args, **kw...
gpl-2.0
minhphung171093/GreenERP_V9
openerp/addons/web/tests/test_menu.py
41
1626
# -*- coding: utf-8 -*- import unittest from ..controllers import main class ActionMungerTest(unittest.TestCase): def test_actual_treeview(self): action = { "views": [[False, "tree"], [False, "form"], [False, "calendar"]], "view_type": "tree", "vi...
gpl-3.0
redline-forensics/auto-dm
views/scene_vehicle_view.py
1
1443
from views.gen.ui_scene_vehicle_view import Ui_scene_vehicle_view from views.scene_view import SceneView class SceneVehicleView(SceneView): def build_ui(self): super(SceneVehicleView, self).build_ui() self.ui = Ui_scene_vehicle_view() self.ui.setupUi(self) # Tell controller that U...
gpl-3.0
infoxchange/lettuce_webdriver
lettuce_webdriver/tests/test_css_selector_steps.py
4
1470
import os import unittest from lettuce import world from lettuce.core import Feature from lettuce_webdriver.tests import html_pages PAGES = {} for filename in os.listdir(html_pages): name = filename.split('.html')[0] PAGES[name] = 'file://%s' % os.path.join(html_pages, filename) FEATURES = [ """ Fe...
mit
MarcusTan/yncn-grid
venv/lib/python2.7/distutils/__init__.py
1211
3983
import os import sys import warnings import imp import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory dirname = os.path.dirname distutils_path = o...
mit
zyingp/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
girving/tensorflow
tensorflow/contrib/graph_editor/tests/reroute_test.py
131
3915
# 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
kartvep/Combaine
combaine/plugins/DistributedStorage/elliptics_http.py
1
3035
import requests import hashlib import string import random from cPickle import dumps as PACK from cPickle import loads as UNPACK from __AbstractStorage import AbstractDistributedStorage from combaine.common.loggers import CommonLogger class Elliptics(AbstractDistributedStorage): def __init__(self, **config): ...
lgpl-3.0
vially/xbmc-protobuf
lib/google/protobuf/compiler/plugin_pb2.py
1
4777
# Generated by the protocol buffer compiler. DO NOT EDIT! from google.protobuf import descriptor from google.protobuf import message from google.protobuf import reflection from google.protobuf import service from google.protobuf import service_reflection from google.protobuf import descriptor_pb2 _CODEGENERATORREQ...
bsd-3-clause
Thanu/stratos
components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/event/instance/status/events.py
11
4337
# 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 u...
apache-2.0
rhertzog/django
tests/test_client/test_conditional_content_removal.py
14
2248
from __future__ import unicode_literals import gzip import io from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.test import SimpleTestCase from django.test.client import conditional_content_removal # based on Python 3.3's gzip.compress def gzip_compress(data): buf = io.BytesIO...
bsd-3-clause
jralls/gramps
test/GrampsLogger/ErrorReportAssistant_Test.py
10
2327
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # # 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 you...
gpl-2.0
pk400/catering
myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py
3133
82594
######################## 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...
mit
qtproject/pyside-pyside
tests/QtWidgets/qvariant_test.py
1
1805
############################################################################# ## ## Copyright (C) 2016 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of the test suite of PySide2. ## ## $QT_BEGIN_LICENSE:GPL-EXCEPT$ ## Commercial License Usage ## Licensees holding valid commercial ...
lgpl-2.1
kuiwei/kuiwei
lms/djangoapps/courseware/tests/modulestore_config.py
30
1068
""" Define test configuration for modulestores. """ from xmodule.modulestore.tests.django_utils import xml_store_config, \ mixed_store_config from django.conf import settings TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT TEST_DATA_XML_MODULESTORE = xml_store_config(TEST_DATA_DIR) # Map all XML course fixtures ...
agpl-3.0
indrajitr/ansible
test/support/integration/plugins/modules/hcloud_server.py
26
20279
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de> # 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 = { "met...
gpl-3.0
yongshengwang/hue
build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/views/decorators/cache.py
129
2286
from functools import wraps from django.utils.decorators import decorator_from_middleware_with_args, available_attrs from django.utils.cache import patch_cache_control, add_never_cache_headers from django.middleware.cache import CacheMiddleware def cache_page(*args, **kwargs): """ Decorator for views that tri...
apache-2.0
dvliman/jaikuengine
.google_appengine/lib/django-1.4/django/contrib/gis/geos/tests/test_geos.py
47
43712
import ctypes import random import unittest from django.contrib.gis.geos import * from django.contrib.gis.geos.base import gdal, numpy, GEOSBase from django.contrib.gis.geos.libgeos import GEOS_PREPARE from django.contrib.gis.geometry.test_data import TestDataMixin class GEOSTest(unittest.TestCase, TestDataMixin): ...
apache-2.0
imsplitbit/nova
nova/api/openstack/compute/plugins/v3/versions.py
12
1953
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 IBM Corp. # 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/licen...
apache-2.0
ericzundel/commons
tests/python/twitter/common/metrics/test_sampling.py
13
3108
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
MatthewWilkes/django
tests/urlpatterns_reverse/erroneous_urls.py
199
1350
import warnings from django.conf.urls import url from django.utils.deprecation import RemovedInDjango110Warning from . import views # Test deprecated behavior of passing strings as view to url(). # Some of these can be removed in Django 1.10 as they aren't convertable to # callables. with warnings.catch_warnings(): ...
bsd-3-clause
rofehr/enigma2
lib/python/Components/Sources/FrontendInfo.py
130
2058
from enigma import iPlayableService from Source import Source from Components.PerServiceDisplay import PerServiceBase from enigma import eDVBResourceManager class FrontendInfo(Source, PerServiceBase): def __init__(self, service_source = None, frontend_source = None, navcore = None): self.navcore = None Source.__i...
gpl-2.0
carthage-college/django-djspace
djspace/application/models.py
1
95424
# -*- coding: utf-8 -*- import re from functools import partial from django.conf import settings from django.contrib.auth.models import User from django.core.validators import FileExtensionValidator from django.db import models from django.urls import reverse from django.utils.safestring import mark_safe from djspace...
mit
galaxy001/libtorrent
python_BTL_BitTorrent-5.3-GPL/BTL/defer.py
8
5561
# The contents of this file are subject to the Python Software Foundation # License Version 2.3 (the License). You may not copy or use this file, in # either source code or executable form, except in compliance with the License. # You may obtain a copy of the License at http://www.python.org/license. # # Software dist...
mit
iLoop2/ResInsight
ThirdParty/Ert/devel/python/test/ert_tests/ecl/test_fortio.py
1
3460
#!/usr/bin/env python # Copyright (C) 2011 Statoil ASA, Norway. # # The file 'kw_test.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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,...
gpl-3.0
ibmjstart/bluemix-python-sample-twitter-influence-app
app/oauth2/setup.py
295
1233
#!/usr/bin/env python from setuptools import setup, find_packages import os, re PKG='oauth2' VERSIONFILE = os.path.join('oauth2', '_version.py') verstr = "unknown" try: verstrline = open(VERSIONFILE, "rt").read() except EnvironmentError: pass # Okay, there is no version file. else: MVSRE = r"^manual_verstr...
apache-2.0
ArteliaTelemac/PostTelemac
PostTelemac/meshlayerlibs/tri/trifinder.py
1
3419
from __future__ import print_function """ from matplotlib.tri import Triangulation import matplotlib._tri as _tri """ from .triangulation import Triangulation import ._tri class TriFinder(object): """ Abstract base class for classes used to find the triangles of a Triangulation in which (x,y) points lie. ...
gpl-3.0
CubicERP/geraldo
site/newsite/site-geraldo/django/utils/datetime_safe.py
33
2684
# Python's datetime strftime doesn't handle dates before 1900. # These classes override date and datetime to support the formatting of a date # through its full "proleptic Gregorian" date range. # # Based on code submitted to comp.lang.python by Andrew Dalke # # >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%M/%d was...
lgpl-3.0
wd5/jangr
_django/core/context_processors.py
151
3868
""" A set of request processors that return dictionaries to be merged into a template context. Each function takes the request object as its only parameter and returns a dictionary to add to the context. These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from django.conf...
bsd-3-clause
opencorato/mapit
mapit_gb/management/commands/mapit_UK_import_nspd_ni.py
3
4408
# This script is used to import Northern Ireland postcode information from the # National Statistics Postcode Database. # http://www.ons.gov.uk/about-statistics/geography/products/geog-products-postcode/nspd/ # # The fields of NSPD Open CSV file are: # Postcode (7), Postcode (8), Postcode (sp), Start date, End date, ...
agpl-3.0
OpenUpgrade/OpenUpgrade
addons/website_membership/models/membership.py
221
1642
# -*- 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 ...
agpl-3.0
tensorflow/probability
spinoffs/oryx/oryx/core/serialize.py
1
1273
# Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
marty331/jakesclock
flask/lib/python2.7/site-packages/webob/static.py
75
5642
import mimetypes import os from webob import exc from webob.dec import wsgify from webob.response import Response __all__ = [ 'FileApp', 'DirectoryApp', ] mimetypes._winreg = None # do not load mimetypes from windows registry mimetypes.add_type('text/javascript', '.js') # stdlib default is application/x-javascri...
gpl-2.0
gift-surg/VolumetricReconstructionFromPrintedFilms
volumetricreconstructionfromprintedfilms/application/reconstruct_volume.py
1
12867
## # \file reconstruct_volume.py # # \author Michael Ebner (michael.ebner.14@ucl.ac.uk) # \date Nov 2016 # import SimpleITK as sitk import numpy as np import os import niftymic.base.stack as st import niftymic.reconstruction.admm_solver as admm import niftymic.reconstruction.tikhonov_solver as tk import ni...
bsd-3-clause
nhippenmeyer/django
django/utils/http.py
285
9978
from __future__ import unicode_literals import base64 import calendar import datetime import re import sys import unicodedata from binascii import Error as BinasciiError from email.utils import formatdate from django.utils import six from django.utils.datastructures import MultiValueDict from django.utils.encoding im...
bsd-3-clause
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/distutils/tests/test_filelist.py
47
1413
"""Tests for distutils.filelist.""" import unittest from distutils.filelist import glob_to_re, FileList from test.support import captured_stdout, run_unittest from distutils import debug class FileListTestCase(unittest.TestCase): def test_glob_to_re(self): # simple cases self.assertEqual(glob_to_...
apache-2.0
alu0100207385/dsi_3Django
tests/admin_custom_urls/models.py
67
2501
from functools import update_wrapper from django.contrib import admin from django.core.urlresolvers import reverse from django.db import models from django.http import HttpResponseRedirect from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Action(models.Model): name ...
bsd-3-clause
paolodoz/timesheet
core/api/uploads.py
1
3083
import tempfile, os, shutil, cherrypy, time from core.config import conf_uploads from core.api.crud import db from core.validation.validation import TSValidationError, validate_request, cgi, ObjectId, sanitize_objectify_json from core.validation.permissions import check_datamine_permissions import logging db_log_sever...
gpl-2.0
GoogleCloudPlatform/python-docs-samples
run/markdown-preview/e2e_test.py
1
6871
# Copyright 2020 Google, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
zoidbergwill/lint-review
tests/test_repo.py
2
5756
import json from . import load_fixture from contextlib import contextmanager from github3.repos.repo import Repository from github3.pulls import PullRequest from lintreview.config import load_config from lintreview.repo import GithubRepository from lintreview.repo import GithubPullRequest from mock import Mock, patch,...
mit
sunilthorat09/code-for-blog
2009/pygame_creeps_game/creeps.py
13
22081
import os, sys from random import randint, choice from math import sin, cos, radians import pygame from pygame import Rect, Color from pygame.sprite import Sprite from gridmap import GridMap from pathfinder import PathFinder from simpleanimation import SimpleAnimation from utils import Timer from vec2d import vec2d f...
unlicense
skoczen/will
will/backends/generation/fuzzy_all_matches.py
3
4443
import logging import regex from fuzzywuzzy import fuzz from fuzzywuzzy import process as fuzz_process from will import settings from will.decorators import require_settings from will.utils import Bunch from .base import GenerationBackend, GeneratedOption class FuzzyAllMatchesBackend(GenerationBackend): def _gen...
mit
tectronics/web2conf
controllers/conference.py
4
1212
# coding: utf8 def index(): return plugin_flatpage() def about(): return plugin_flatpage() def venue(): redirect(URL(c="venue", f="index", vars=request.vars)) def maps(): redirect(URL(c="venue", f="maps", vars=request.vars)) def schedule(): redirect(URL(c='schedule', f='index')) def proposals(): return plugin_flatpage...
bsd-3-clause
Mazecreator/tensorflow
tensorflow/python/keras/applications/xception/__init__.py
74
1142
# 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
weidongxu84/info-gatherer
django/utils/translation/trans_real.py
21
22634
"""Translation helper functions.""" import locale import os import re import sys import gettext as gettext_module from threading import local try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.utils.importlib import import_module from django.utils.safestring imp...
mit
brentp/inheritance
inheritance/evalfam.py
1
7598
from __future__ import print_function import os import sys import tempfile import atexit import itertools as it try: basestring ints = (int, long) except NameError: basestring = str ints = int def tmp(pedstr, suf=".ped"): t = tempfile.mktemp(suffix=suf) atexit.register(os.unlink, t) with...
mit
geekaia/edx-platform
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
3
81986
""" Test split modulestore w/o using any django stuff. """ import datetime import unittest import uuid from importlib import import_module from path import path import re import random from xblock.fields import Scope from xmodule.course_module import CourseDescriptor from xmodule.modulestore.exceptions import (Ins...
agpl-3.0
manhhomienbienthuy/pythondotorg
jobs/migrations/0010_auto_20150416_1853.py
12
1344
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('jobs', '0009_auto_20150317_1815'), ] operations = [ migrations.AlterField( model_name='job', name='c...
apache-2.0
hirofumi0810/asr_preprocessing
csj/path.py
1
7340
#! /usr/bin/env python # -*- coding: utf-8 -*- """Prepare for making dataset (CSJ corpus).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, basename, isfile, abspath from glob import glob class Path(object): """Prepare for...
mit
disqus/mule
setup.py
1
1066
#!/usr/bin/env python try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import os.path tests_require = [ 'redis', 'unittest2', 'dingus', ] setup( name='Mule', versio...
apache-2.0
moreati/numpy
numpy/polynomial/_polybase.py
75
29910
""" Abstract base class for the various polynomial Classes. The ABCPolyBase class provides the methods needed to implement the common API for the various polynomial classes. It operates as a mixin, but uses the abc module from the stdlib, hence it is only available for Python >= 2.6. """ from __future__ import divisi...
bsd-3-clause
kxliugang/edx-platform
common/djangoapps/third_party_auth/tasks.py
81
6641
# -*- coding: utf-8 -*- """ Code to manage fetching and storing the metadata of IdPs. """ #pylint: disable=no-member from celery.task import task # pylint: disable=import-error,no-name-in-module import datetime import dateutil.parser import logging from lxml import etree import requests from onelogin.saml2.utils impor...
agpl-3.0
2014c2g23/2015cd_midterm-
static/Brython3.1.0-20150301-090019/Lib/xml/sax/__init__.py
637
3505
"""Simple API for XML (SAX) implementation for Python. This module provides an implementation of the SAX 2 interface; information about the Java version of the interface can be found at http://www.megginson.com/SAX/. The Python version of the interface is documented at <...>. This package contains the following modu...
gpl-3.0
sdopoku/flask-blog
env/lib/python2.7/site-packages/pip/wheel.py
145
20120
""" Support for installing and building the "wheel" binary package format. """ from __future__ import with_statement import compileall import csv import functools import hashlib import os import re import shutil import sys from base64 import urlsafe_b64encode from email.parser import Parser from pip.backwardcompat i...
gpl-2.0
mattip/numpy
numpy/lib/tests/test_histograms.py
17
33672
import numpy as np from numpy.lib.histograms import histogram, histogramdd, histogram_bin_edges from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_array_max_ulp, assert_raises_regex, suppress_warnings...
bsd-3-clause
Batterfii/django
tests/template_tests/filter_tests/test_cut.py
521
2269
from django.template.defaultfilters import cut from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class CutTests(SimpleTestCase): @setup({'cut01': '{% autoescape off %}{{ a|cut:"x" }} {{ b|cut:"x" }}{% endautoescape %}'}) def test_cut01(self): ...
bsd-3-clause
cilcoberlin/pressgang
pressgang/actions/install/addblogs/views.py
2
1395
from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404 from pressgang.accounts.decorators import can_manage_blogs from pressgang.actions import store_action from pressgang.actions.install.addblogs import AddBlogsAction from pre...
bsd-3-clause
diogocs1/comps
web/addons/l10n_in_hr_payroll/report/payslip_report.py
340
3978
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-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
odejesush/tensorflow
venv/lib/python2.7/site-packages/pip/req/req_uninstall.py
510
6897
from __future__ import absolute_import import logging import os import tempfile from pip.compat import uses_pycache, WINDOWS, cache_from_source from pip.exceptions import UninstallationError from pip.utils import rmtree, ask, is_local, renames, normalize_path from pip.utils.logging import indent_log logger = loggin...
apache-2.0
OSSystems/lava-server
dashboard_app/migrations/0007_auto__add_tag.py
1
14928
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Tag' db.create_table('dashboard_app_tag', ( ('id', self.gf('django.db.models.fields.A...
agpl-3.0
ErinCall/sync-engine
migrations/versions/096_migrate_secret_data.py
8
2459
"""migrate_secret_data Revision ID: 38c29430efeb Revises: 1683790906cf Create Date: 2014-09-18 03:03:42.131932 """ # revision identifiers, used by Alembic. revision = '38c29430efeb' down_revision = '1683790906cf' import sqlalchemy as sa def upgrade(): from inbox.config import config import nacl.secret ...
agpl-3.0
bwrsandman/OpenUpgrade
addons/portal_project_issue/tests/__init__.py
260
1086
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
itzzshirlayyy/Online_Ordering
venv/lib/python2.7/site-packages/pip/utils/logging.py
31
3359
from __future__ import absolute_import import contextlib import logging import logging.handlers import os try: import threading except ImportError: import dummy_threading as threading from pip.compat import WINDOWS try: from pip._vendor import colorama # Lots of different errors can come from this, incl...
mit
linsomniac/luigi
test/notifications_test.py
9
14740
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
Empire-of-Code-Puzzles/checkio-empire-calls-home
verification/src/tests.py
2
8316
TESTS = { "Level_1": [ { "input": ["2014-01-01 01:12:13 181", "2014-01-02 20:11:10 600", "2014-01-03 01:12:13 6009", "2014-01-03 12:13:55 200"], "answer": 124, }, { "input": ["2014-02-05 01:...
gpl-2.0
neerajvashistha/pa-dude
lib/python2.7/site-packages/pymongo/errors.py
25
6317
# Copyright 2009-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
mit
tempbottle/logcabin
scripts/config.py
8
3108
#!/usr/bin/env python # Copyright (c) 2011 Stanford University # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND T...
isc
Zord13appdesa/python-for-android
python-modules/twisted/twisted/python/test/test_hashlib.py
60
3313
# Copyright (c) 2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.python.hashlib} """ from twisted.trial.unittest import TestCase from twisted.python.hashlib import md5, sha1 class HashObjectTests(TestCase): """ Tests for the hash object APIs presented by L{hashlib}, C{md...
apache-2.0
nathanaevitas/odoo
openerp/addons/crm/__init__.py
329
1265
# -*- 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
hgl888/chromium-crosswalk-efl
tools/metrics/histograms/update_policies.py
66
4404
# 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. """Updates EnterprisePolicies enum in histograms.xml file with policy definitions read from policy_templates.json. If the file was pretty-printed, the updat...
bsd-3-clause
sbalde/edxplatform
common/lib/xmodule/xmodule/tests/test_util_open_ended.py
15
84429
""" Utility classes and data structures supporting the Open-Ended Grading feature of Open edX """ import json from StringIO import StringIO from xmodule.modulestore.xml import XMLModuleStore from xmodule.tests import DATA_DIR OPEN_ENDED_GRADING_INTERFACE = { 'url': 'blah/', 'username': 'incorrect', 'pass...
agpl-3.0
eduNEXT/edx-platform
openedx/features/calendar_sync/ics.py
5
3023
""" Generate .ics files from a user schedule """ from datetime import datetime, timedelta import pytz from django.conf import settings from django.utils.translation import gettext as _ from icalendar import Calendar, Event, vCalAddress, vText from lms.djangoapps.courseware.courses import get_course_assignments from ...
agpl-3.0
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/LoginWithAmazon/FinalizeOAuth.py
4
5330
# -*- coding: utf-8 -*- ############################################################################### # # FinalizeOAuth # Completes the OAuth process by retrieving an Amazon access token for a user, after they have visited the authorization URL returned by the InitializeOAuth Choreo and clicked "allow." # # Python v...
apache-2.0
OSU-Net/cyder
vendor-local/src/django-extensions/django_extensions/management/commands/runscript.py
39
6135
from django.core.management.base import BaseCommand from django.core.management.color import no_style from optparse import make_option import sys import os import imp try: set except NameError: from sets import Set as set # Python 2.3 fallback def vararg_callback(option, opt_str, opt_value, parser): pa...
bsd-3-clause
sambitgaan/nupic
examples/opf/experiments/multistep/hotgym/description.py
32
16546
# ---------------------------------------------------------------------- # 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...
agpl-3.0
undoware/neutron-drive
google_appengine/lib/PyAMF/doc/tutorials/examples/gateways/appengine/demo/settings.py
9
3042
# Django settings for google_appengine project. import os, sys DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or p...
bsd-3-clause
cboling/xos
xos/synchronizers/base/steps/sync_controller_users.py
6
3112
import os import base64 from collections import defaultdict from django.db.models import F, Q from xos.config import Config from synchronizers.base.openstacksyncstep import OpenStackSyncStep from synchronizers.base.syncstep import * from core.models.site import Controller, SiteDeployment, SiteDeployment from core.model...
apache-2.0
agrista/odoo-saas
openerp/addons/base/ir/ir_model.py
7
61350
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
kaffeel/oppia
extensions/interactions/EndExploration/EndExploration.py
9
1767
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
stephawe/kerrokantasi
democracy/migrations/0029_add django-parler fields.py
2
6680
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-12-08 11:55 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion from django.utils.translation import ugettext_lazy as _ class Migration(migrations.Migration): dependencies = [ ('dem...
mit
shoelzer/buildbot
master/buildbot/buildslave/libvirt.py
11
1438
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
gfonk/ansible
docsite/build-site.py
211
2937
#!/usr/bin/env python # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of the Ansible Documentation # # 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 th...
gpl-3.0
daenamkim/ansible
lib/ansible/modules/cloud/softlayer/sl_vm.py
52
11276
#!/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) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
roaet/wafflehaus.neutron
wafflehaus/neutron/nova_interaction/common.py
1
6282
# Copyright 2013 Openstack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0