repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
CourseTalk/edx-platform | refs/heads/master | lms/djangoapps/shoppingcart/processors/__init__.py | 215 | """
Public API for payment processor implementations.
The specific implementation is determined at runtime using Django settings:
CC_PROCESSOR_NAME: The name of the Python module (in `shoppingcart.processors`) to use.
CC_PROCESSOR: Dictionary of configuration options for specific processor implementations,
... |
outvader/soclone | refs/heads/master | soclone/views.py | 5 | """SOClone views."""
import datetime
import itertools
from django.contrib.auth.models import User
from django.contrib.auth import views as auth_views
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import Paginator, InvalidPage
from django.http import Http404, HttpResponseRedirect... |
Kalyzee/edx-platform | refs/heads/master | lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py | 114 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SoftwareSecurePhotoVerification.window'
db.add_column('verify_student_softwaresecurephotover... |
coursemdetw/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/color.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
googleapis/python-debugger-client | refs/heads/master | google/cloud/debugger_v2/services/controller2/__init__.py | 1 | # -*- coding: utf-8 -*-
# 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... |
the-zebulan/CodeWars | refs/heads/master | tests/beta_tests/test_multiples_2.py | 1 | import unittest
from katas.beta.multiples_2 import multiples
class MultiplesTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(multiples(49), 'Fizz')
def test_equals_2(self):
self.assertEqual(multiples(147), 'Fang')
def test_equals_3(self):
self.assertEqual(mul... |
pipoket/django-guardian | refs/heads/master | example_project/posts/views.py | 3 |
def post_detail(request):
return
|
damdam-s/OpenUpgrade | refs/heads/8.0 | addons/report/tests/test_reports.py | 385 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
Markus-Goetz/CDS-Invenio-Authorlist | refs/heads/master | modules/miscutil/lib/miscutil_config.py | 8 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## ... |
ArnossArnossi/django | refs/heads/master | django/contrib/gis/maps/google/gmap.py | 526 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.gis.maps.google.overlays import (
GMarker, GPolygon, GPolyline,
)
from django.template.loader import render_to_string
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.util... |
sdl-static/ircbot-collection | refs/heads/master | beanbot-client.py | 4 | #!/usr/bin/python
import sys, os, re, popen2
from socket import *
serve_addr = ('localhost', 47701)
def popen(cmd):
p = popen2.Popen4(cmd)
p.tochild.close()
val = p.fromchild.read()
p.fromchild.close()
return val.strip()
if __name__ == '__main__':
IRC_BOLD = '\x02'
IRC_ULINE = '\x1f'
IRC_NORMAL = '\... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/decorators/models.py | 275 | # A models.py so that tests run.
|
piotroxp/scibibscan | refs/heads/master | scib/lib/python3.5/site-packages/astropy/coordinates/tests/test_api_ape5.py | 1 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
"""
This is the APE5 coordinates API document re-written to work as a series of test
functions.
Note that new tests for c... |
xsmart/bluecherry-client | refs/heads/master | breakpad/src/tools/gyp/test/lib/TestCmd.py | 137 | """
TestCmd.py: a testing framework for commands and scripts.
The TestCmd module provides a framework for portable automated testing
of executable commands and scripts (in any language, not just Python),
especially commands and scripts that require file system interaction.
In addition to running tests and evaluating... |
schacki/djangocms-cascade | refs/heads/master | cmsplugin_cascade/south_migrations/0011_auto__add_inlinecascadeelement.py | 5 | # -*- 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 'InlineCascadeElement'
db.create_table(u'cmsplugin_cascade... |
zhumengyuan/kallithea | refs/heads/master | kallithea/lib/dbmigrate/migrate/changeset/databases/sqlite.py | 2 | """
`SQLite`_ database specific implementations of changeset classes.
.. _`SQLite`: http://www.sqlite.org/
"""
from UserDict import DictMixin
from copy import copy
from sqlalchemy.databases import sqlite as sa_base
from kallithea.lib.dbmigrate.migrate import exceptions
from kallithea.lib.dbmigrate.migrate.chan... |
akosyakov/intellij-community | refs/heads/master | python/testData/completion/propertyType.py | 83 | class C(object):
def __init__(self):
self._x = []
@property
def x(self):
return self._x
c = C()
c.x.app<caret>
|
sugartom/tensorflow-alien | refs/heads/master | tensorflow/python/ops/dequantize_op_test.py | 129 | # 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... |
tarak/django-password-policies | refs/heads/master | password_policies/tests/test_models.py | 2 | from password_policies.conf import settings
from password_policies.models import PasswordHistory
from password_policies.tests.lib import BaseTest
from password_policies.tests.lib import create_user
from password_policies.tests.lib import create_password_history
from password_policies.tests.lib import passwords
class ... |
xiaolonginfo/decode-Django | refs/heads/master | Django-1.5.1/django/views/i18n.py | 4 | import os
import gettext as gettext_module
from django import http
from django.conf import settings
from django.utils import importlib
from django.utils.translation import check_for_language, activate, to_locale, get_language
from django.utils.text import javascript_quote
from django.utils.encoding import smart_text
f... |
uclouvain/OSIS-Louvain | refs/heads/master | program_management/forms/education_groups.py | 1 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... |
cloakedcode/CouchPotatoServer | refs/heads/master | libs/sqlalchemy/engine/ddl.py | 31 | # engine/ddl.py
# Copyright (C) 2009-2011 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to handle CREATE/DROP workflow."""
from sqlalchemy import engine, schema
fr... |
hbenniou/trunk | refs/heads/master | py/_extraDocs.py | 7 | # encoding: utf-8
# 2010 © Václav Šmilauer <eudoxos@arcig.cz>
#
# This module is imported at startup. It is meant to update
# docstrings of wrapper classes, which are not practical to document
# in the c++ source itself, due to the necessity of writing
# \n for newlines and having everything as "string".
#
# PLEASE:
#
... |
fitermay/intellij-community | refs/heads/master | python/testData/intentions/convertTripleQuotedStringRawStrings.py | 79 | S = (<caret>r'''foo
double-only"
single-only'
mix'ed"
'''
"""\r\n"""
r'one line')
|
tersmitten/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_analyticsprofile.py | 29 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
Lilywei123/tempest | refs/heads/master | tempest/api/volume/test_volumes_negative.py | 2 | # Copyright 2012 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... |
erudit/eruditorg | refs/heads/master | tests/unit/core/citations/test_middleware.py | 1 | import pytest
from django.contrib.auth.models import AnonymousUser
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory
from erudit.test.factories import ArticleFactory
from erudit.test.factories import IssueFactory
from core.citations.citations import SavedCitationL... |
fishroot/nemoa | refs/heads/master | nemoa/workspace/imports/text.py | 1 | # -*- coding: utf-8 -*-
__author__ = 'Patrick Michl'
__email__ = 'frootlab@gmail.com'
__license__ = 'GPLv3'
import nemoa
import os
def filetypes():
"""Get supported text filetypes for workspace import."""
return {
'ini': 'Nemoa Workspace Description' }
def load(path, **kwds):
"""Import workspace... |
showgood/YCM_windows | refs/heads/master | python/ycm/completers/completer_utils.py | 4 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... |
leghtas/pyHFSS | refs/heads/master | hfss.py | 1 | from __future__ import division
import atexit
from copy import copy
import os
import tempfile
import types
import numpy
import signal
import pythoncom
import time
from sympy.parsing import sympy_parser
from pint import UnitRegistry # units
from win32com.client import Dispatch, CDispatch
ureg = UnitRegistry()
Q = ... |
ldoktor/avocado-vt | refs/heads/master | virttest/yumrepo.py | 38 | '''
This module implements classes that allow a user to create, enable and disable
YUM repositories on the system.
'''
import os
__all__ = ['REPO_DIR', 'YumRepo']
REPO_DIR = '/etc/yum.repos.d'
class YumRepo(object):
'''
Represents a YUM repository
The goal of this class is not to give access to al... |
jmarcelino/pycom-micropython | refs/heads/master | tests/basics/set_symmetric_difference.py | 118 | print(sorted({1,2}.symmetric_difference({2,3})))
print(sorted({1,2}.symmetric_difference([2,3])))
s = {1,2}
print(s.symmetric_difference_update({2,3}))
print(sorted(s))
|
ahmadiga/min_edx | refs/heads/master | common/test/acceptance/pages/lms/login.py | 205 | """
Login page for the LMS.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from . import BASE_URL
from .dashboard import DashboardPage
class LoginPage(PageObject):
"""
Login page for the LMS.
"""
url = BASE_URL + "/login"
def is_browser_on_page(self):
... |
moertoe1/moertoe123.github.io | refs/heads/master | src/siism2015/wsgi.py | 1 | """
WSGI config for siism2015 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "siism2015.settings.production")
from... |
taarifa/taarifa_backend | refs/heads/master | data/query_waterpoints.py | 1 | #!/usr/bin/env python
import requests
import json
def get_all_reports():
url = 'http://localhost:5000/reports'
params = {'service_code': 'wp001'}
response = requests.get(url, params=params)
print response.url
print response.ok
data = json.loads(response.text)
reports = data['result']
... |
ericholscher/django | refs/heads/master | django/contrib/auth/tests/test_signals.py | 227 | from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
@skipIfCustomUser
@override_settings(USE_TZ=Fa... |
crackerhead/nemio | refs/heads/master | lib/python2.7/site-packages/werkzeug/useragents.py | 148 | # -*- coding: utf-8 -*-
"""
werkzeug.useragents
~~~~~~~~~~~~~~~~~~~
This module provides a helper to inspect user agent strings. This module
is far from complete but should work for most of the currently available
browsers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more deta... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/gkehub/v1alpha2/gkehub-v1alpha2-py/google/cloud/gkehub_v1alpha2/types/membership.py | 1 | # -*- coding: utf-8 -*-
# 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... |
Typecraft/norsourceparser | refs/heads/develop | norsourceparser/core/config.py | 1 |
class Config(object):
DEBUG = False
MAX_PHRASES_PER_TEXT = -1
config = Config()
|
bovarysme/whisper | refs/heads/master | whisper/commands.py | 1 | import os
import click
from flask.cli import FlaskGroup
from . import create_app, db
def create_cli_app(info):
return create_app()
@click.group(cls=FlaskGroup, create_app=create_cli_app)
@click.option('--debug', is_flag=True, default=False)
def cli(debug):
if debug:
os.environ['FLASK_DEBUG'] = '1'... |
nvoron23/brython | refs/heads/master | site/tests/unittests/test/test_pickletools.py | 161 | import pickle
import pickletools
from test import support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def dumps(self, arg, proto=None):
return pickletools.optimize(pick... |
apinski-cavium/mcrouter | refs/heads/master | mcrouter/test/test_mcrouter_errors.py | 2 | # Copyright (c) 2015, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absolute_... |
AMOboxTV/AMOBox.LegoBuild | refs/heads/master | plugin.video.sembilhete.tv/resources/lib/requests/auth.py | 174 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import threading
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import pa... |
boompieman/iim_project | refs/heads/master | project_python2/lib/python2.7/site-packages/nbformat/v2/nbbase.py | 12 | """The basic dict based notebook format.
The Python representation of a notebook is a nested structure of
dictionary subclasses that support attribute access
(ipython_genutils.ipstruct.Struct). The functions in this module are merely
helpers to build the structs in the right form.
Authors:
* Brian Granger
"""
#----... |
jagguli/intellij-community | refs/heads/master | python/testData/mover/multiLineSelection6_afterUp.py | 83 | class Test(object):
def q(self):
<caret><selection> a = 1
b = 2
</selection> c = 3
|
alistairlow/tensorflow | refs/heads/master | tensorflow/contrib/timeseries/python/timeseries/test_utils.py | 86 | # 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... |
mdibaiee/servo | refs/heads/master | tests/wpt/css-tests/tools/pywebsocket/src/example/bench_wsh.py | 495 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/application_gateway_firewall_rule_set.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
Renji/weevely3 | refs/heads/master | core/messages.py | 11 | version = '3.2.0'
class generic:
file_s_not_found = "File '%s' not found"
error_creating_file_s_s = "Error creating file '%s': %s"
error_loading_file_s_s = 'Error loading file \'%s\': %s'
error_file_s_already_exists = 'Error file \'%s\' already exists'
error_url_format = 'URL error format \'http(s)... |
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price | refs/heads/master | data/20 nike/nikeAnalyze2.py | 1 |
from readStockData import readClosingPrice
from readStockData import readVolume
from dataAnalysis import calCorrelation
s = readClosingPrice('nike.xls')
v = readVolume('nike.xls')
calCorrelation(s,v)
|
SuperMass/distOS-lab3 | refs/heads/master | src/integrated/client4/client_config.py | 1 | remote_server_ips = ('127.0.0.1', '127.0.0.1')
remote_server_ports = (8005, 8006)
assigned_server_index = 1 # in real system, client is distributed by a load balancing server in general; here I just simulate the balancing policy.
process_id = 4
client_addr = ('127.0.0.1', 7004)
poisson_lambda = 5
simu_len = 60
get_s... |
dims/cinder | refs/heads/master | cinder/tests/unit/volume/drivers/netapp/eseries/test_utils.py | 31 | # Copyright (c) 2014 Clinton Knight. All rights reserved.
# 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... |
gymnasium/edx-platform | refs/heads/open-release/hawthorn.master | openedx/core/djangoapps/credit/exceptions.py | 24 | """Exceptions raised by the credit API. """
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
# TODO: Cleanup this mess! ECOM-2908
class CreditApiBadRequest(Exception):
"""
Cou... |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/inspections/PyNoneFunctionAssignmentInspection/methodWithInheritors.py | 83 | class C(object):
def foo(self):
pass
def bar(self):
pass
def test(self):
x = self.foo()
<weak_warning descr="Function 'bar' doesn't return anything">y = self.bar()</weak_warning>
class D(C):
def foo(self):
return 2
|
faywong/FFPlayer | refs/heads/trunk | project/jni/python/src/Tools/i18n/msgfmt.py | 61 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Written by Martin v. Löwis <loewis@informatik.hu-berlin.de>
"""Generate binary message catalog from textual translation description.
This program converts a textual Uniforum-style message catalog (.po file) into
a binary GNU catalog (.mo file). This is essentiall... |
aniketshukla/werkzeug | refs/heads/master | examples/coolmagic/utils.py | 44 | # -*- coding: utf-8 -*-
"""
coolmagic.utils
~~~~~~~~~~~~~~~
This module contains the subclasses of the base request and response
objects provided by werkzeug. The subclasses know about their charset
and implement some additional functionallity like the ability to link
to view functions.
:c... |
jarvys/django-1.7-jdb | refs/heads/master | tests/delete_regress/tests.py | 19 | from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import transaction, DEFAULT_DB_ALIAS, models
from django.db.utils import ConnectionHandler
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import (Book, Award, AwardNote, Pe... |
massot/odoo | refs/heads/8.0 | addons/l10n_sg/__init__.py | 669 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
kensho-technologies/graphql-compiler | refs/heads/main | graphql_compiler/tests/schema_generation_tests/__init__.py | 7 | # Copyright 2019-present Kensho Technologies, LLC.
|
ximion/dak-dep11 | refs/heads/master | dak/dakdb/update49.py | 6 | #!/usr/bin/env python
# coding=utf8
"""
Permission fixups
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2011 Mark Hymers <mhy@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU... |
rpmcpp/Audacity | refs/heads/master | lib-src/lv2/lilv/waflib/Tools/gcc.py | 64 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib import Configure,Options,Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_gcc(conf):
cc=conf.find_program([... |
kosz85/django | refs/heads/master | tests/admin_utils/test_logentry.py | 22 | import json
from datetime import datetime
from django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, override_settings
... |
plotly/plotly.py | refs/heads/master | packages/python/plotly/plotly/validators/layout/scene/annotation/_startstandoff.py | 1 | import _plotly_utils.basevalidators
class StartstandoffValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="startstandoff",
parent_name="layout.scene.annotation",
**kwargs
):
super(StartstandoffValidator, self).__init__(
... |
dishants/Land-Records-on-Blockchain | refs/heads/master | testing.py | 1 |
import pyqtree
import random, time
class Item:
def __init__(self, x, y):
left = x-1
right = x+1
top = y-1
bottom = y+1
self.bbox = [left,top,right,bottom]
#setup and populate index
items = [Item(random.randrange(5,95),random.randrange(5,95)) for _ in range(10000)]
spindex ... |
Philips14171/qt-creator-opensource-src-4.2.1 | refs/heads/master | tests/system/suite_debugger/tst_qml_js_console/test.py | 1 | ############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... |
unho/pootle | refs/heads/master | pootle/apps/pootle_project/migrations/0012_set_pootle_fs_treestyle.py | 8 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2016-10-06 13:51
from __future__ import unicode_literals
from django.db import migrations
def set_pootle_fs_style(apps, schema_editor):
Project = apps.get_model('pootle_project', 'Project')
for project in Project.objects.filter(treestyle='none'):
... |
catapult-project/catapult | refs/heads/master | third_party/cloudstorage/cloudstorage/test_utils.py | 248 | # Copyright 2013 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 ag... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/static/particle/shared_pt_flocking_bees.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/particle/shared_pt_flocking_bees.iff"
result.attribute_template_id = -1... |
sephii/django | refs/heads/master | tests/migrations/test_migrations_backwards_deps_1/0002_second.py | 416 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [('migrations', '0001_initial')]
operations = []
|
telwertowski/Books-Mac-OS-X | refs/heads/master | Versions/Books_3.0b3/OPAC SBN.plugin/Contents/Resources/PyZ3950/SRWDiagnostics.py | 30 |
# Base Class
class SRWDiagnostic (Exception):
""" Base Diagnostic Class"""
code = 0
uri = "info:srw/diagnostic/1/"
details = ""
message = ""
surrogate = 0
fatal = 1
def __str__(self):
return "%s [%s]: %s" % (self.uri, self.message, self.details)
# NB 'Need' name for seri... |
lduarte1991/edx-platform | refs/heads/master | openedx/core/djangoapps/util/management/commands/reset_db.py | 16 | # -*- coding: utf-8 -*-
"""
reset_db
========
Django command to drop and recreate a database.
Useful when running tests against a database which may previously have
had different migrations applied to it.
This handles the one specific use case of the "reset_db" command from
django-extensions that we were actually usi... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/tests/i18n/patterns/urls/default.py | 384 | from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.utils.translation import ugettext_lazy as _
from django.views.generic import TemplateView
view = TemplateView.as_view(template_name='dummy.html')
urlpatterns = [
url(r'^not-prefixed/$', view, name='not-prefixed')... |
erkanay/django | refs/heads/master | tests/many_to_one/tests.py | 5 | from copy import deepcopy
import datetime
from django.core.exceptions import MultipleObjectsReturned, FieldError
from django.db import models, transaction
from django.test import TestCase
from django.utils import six
from django.utils.translation import ugettext_lazy
from .models import (Article, Reporter, First, Thi... |
mariopro/youtube-dl | refs/heads/master | youtube_dl/extractor/minhateca.py | 127 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
int_or_none,
parse_duration,
parse_filesize,
)
class MinhatecaIE(InfoExtractor):
_VALID_URL = r'https?://minhate... |
ARISE-Initiative/robosuite | refs/heads/master | robosuite/wrappers/demo_sampler_wrapper.py | 1 | """
This file contains a wrapper for sampling environment states
from a set of demonstrations on every reset. The main use case is for
altering the start state distribution of training episodes for
learning RL policies.
"""
import random
import os
import h5py
import time
import numpy as np
from robosuite.utils.mjcf... |
tuxcanfly/flashbox | refs/heads/master | downloadr_lib/downloadrconfig.py | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2012 Javed Khan <tuxcanfly@gmail.com>
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Softwar... |
RydrDojo/Ridr | refs/heads/master | pylotVenv/lib/python2.7/site-packages/wheel/test/complex-dist/complexdist/__init__.py | 566 | def main():
return
|
follow99/django | refs/heads/master | tests/i18n/patterns/urls/path_unused.py | 452 | from django.conf.urls import url
from django.views.generic import TemplateView
view = TemplateView.as_view(template_name='dummy.html')
urlpatterns = [
url(r'^nl/foo/', view, name='not-translated'),
]
|
schlos/eden | refs/heads/master | modules/s3db/po.py | 7 | # -*- coding: utf-8 -*-
""" Sahana Eden Population Outreach Models
@copyright: 2015 (c) Sahana Software Foundation
@license: MIT
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 Softwa... |
apdjustino/DRCOG_Urbansim | refs/heads/master | src/opus_core/misc.py | 1 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
"""Collection of useful miscellaneous functions and definitions"""
import os.path
import re
import shutil
import socket
import sys
import tem... |
kreegr/PolyPasswordHasher | refs/heads/master | python-reference-implementation/setup.py | 3 | #! /usr/bin/env python
from distutils.core import setup, Extension
import sys
print "This is currently test code... You have been warned!"
# Must have Python >= 2.5 and < 3.0. If Python version == 2.5.X, then
# simplejson is required.
if sys.version_info[0] != 2 or sys.version_info[1] < 5:
print "Requires P... |
youfoh/webkit-efl | refs/heads/tizen | Tools/CodeCoverage/cov.py | 27 | # Copyright (C) 2004, 2005, 2006 Nathaniel Smith
# Copyright (C) 2006, 2007 Holger Hans Peter Freyther
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyr... |
jojohappy/falcon-plus | refs/heads/master | modules/transfer/scripts/query.py | 3 | import requests
# Copyright 2017 Xiaomi, 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 agree... |
kielr/aquaquest | refs/heads/master | data/constants.py | 1 | """
This module contains constants used by the game.
"""
__author__ = "kiel.regusters"
# Game Info
SCREEN_SIZE = (800, 600)
TILE_SIZE = 16
# Player info
MAX_VEL_X = 10
MAX_VEL_Y = 20
GRAVITY = 1
JUMP_GRAVITY = 0.5
JUMP_VEL = -7
DOUBLE_JUMP_VEL = -7
LEVEL_CAP = 20
STAT_CAP = 9
# Player states
WALKING = "walking"
IDL... |
hkchenhongyi/django | refs/heads/master | tests/properties/models.py | 542 | """
Using properties on models
Use properties on models just like on any other Python object.
"""
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
def _get_full_name(self):
return "%s %s" % (self.fi... |
mozilla/ichnaea | refs/heads/main | ichnaea/taskapp/app.py | 1 | """
Holds global celery application state and startup / shutdown handlers.
"""
from celery import Celery
from celery.app import app_or_default
from celery.signals import (
beat_init,
worker_process_init,
worker_process_shutdown,
setup_logging,
)
from ichnaea.log import configure_logging
from ichnaea.ta... |
grundprinzip/Impala | refs/heads/cdh5-trunk | thirdparty/hive-0.13.1-cdh5.4.0-SNAPSHOT/lib/py/thrift/protocol/TProtocol.py | 83 | #
# 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... |
AlekhyaMallina-Vedams/CI | refs/heads/master | nodepool/scripts/cache_git_repos.py | 2 | #!/usr/bin/env python
# Copyright (C) 2011-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
samuelmaudo/yepes | refs/heads/master | yepes/contrib/datamigrations/importation_plans/direct.py | 1 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from yepes.contrib.datamigrations.importation_plans import ModelImportationPlan
class DirectPlan(ModelImportationPlan):
updates_data = False
def import_batch(self, batch):
model = self.migration.model
manager = model._base_mana... |
damdam-s/OpenUpgrade | refs/heads/8.0 | addons/portal/tests/__init__.py | 261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
sundream/gamesrv | refs/heads/master | daobiao/parser/parse_achievement.py | 1 | # -*- coding: utf-8 -*-
from base import *
import os
import sys
def parse_achievement(sheet_name,sheet_data,dstpath):
cfg = {
"linefmt" :
"""
[%(id)d] = {
id = %(id)d,
name = "%(name)s",
event = "%(event)s",
target = %(target)d,
award = %(award)s,
desc = "%(desc)s",
},
["%(name)s"] = {
id = %(id)d,
... |
pubudu538/product-private-paas | refs/heads/master | components/org.wso2.ppaas.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/constants.py | 2 | # 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... |
bearstech/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_launch.py | 9 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# 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.0... |
LMSlay/wiper | refs/heads/master | modules/rats/clientmesh.py | 6 | # Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/ClientMesh.py
import re
import string
from base64 import b64decode
def stringPrintable(line):
return filter(lambda x: x in string.printable, line)
def first_split(data):
splits = data.split('\x00\x... |
eonpatapon/contrail-controller | refs/heads/master | src/config/device-manager/device_manager/plugins/juniper/qfx/qfx_conf.py | 1 | #
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#
"""
This file contains implementation of netconf interface for QFX physical router
configuration manager
"""
from db import *
from dm_utils import DMUtils
from juniper_conf import JuniperConf
from juniper_conf import JunosInterface
from device_api.j... |
barnsnake351/nova | refs/heads/master | nova/tests/unit/scheduler/test_rpcapi.py | 59 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
JioCloud/tempest | refs/heads/master | tempest/stress/cleanup.py | 14 | #!/usr/bin/env python
# Copyright 2013 Quanta Research Cambridge, 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
#
# U... |
Rostlab/LocText | refs/heads/develop | tests/test_evaluations.py | 2 | # Be able to call directly such as `python test_annotators.py`
try:
from .context import loctext
except SystemError: # Parent module '' not loaded, cannot perform relative import
pass
from pytest import raises
from loctext.util import PRO_ID, LOC_ID, REL_PRO_LOC_ID, repo_path, UNIPROT_NORM_ID, GO_NORM_ID
from... |
datacratic/rtbkit | refs/heads/master | rtbkit/core/banker/banker_backup.py | 20 | #!/usr/bin/python
# Wolfgang Sourdeau - march 2003
# Copyright (c) 2013 Datacratic. All rights reserved.
# backup script for the Banker database
# FIXME: this script does not perform the backup atomically, which can lead to
# small inconsistencies between the states of the accounts
import redis
import json
import d... |
Sorsly/subtle | refs/heads/master | google-cloud-sdk/platform/gsutil/third_party/boto/boto/file/connection.py | 153 | # Copyright 2010 Google Inc.
#
# 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, dis-
# trib... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.