repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
rtucker-mozilla/inventory | refs/heads/master | mozdns/srv/views.py | 3 | from mozdns.views import MozdnsDeleteView
from mozdns.views import MozdnsCreateView
from mozdns.views import MozdnsDetailView
from mozdns.views import MozdnsUpdateView
from mozdns.views import MozdnsListView
from mozdns.srv.models import SRV
from mozdns.srv.forms import SRVForm
class SRVView(object):
model = SRV
... |
zwily/zulip | refs/heads/master | zerver/management/commands/expunge_db.py | 118 | from __future__ import absolute_import
from django.core.management.base import BaseCommand
from zerver.retention_policy import get_UserMessages_to_expunge
from zerver.models import Message
class Command(BaseCommand):
help = ('Expunge old UserMessages and Messages from the database, '
... |
zachallaun/zulip | refs/heads/master | zerver/management/commands/import_dump.py | 115 | from __future__ import absolute_import
from optparse import make_option
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db import connection
from django.conf import settings
from zerver.lib.actions import do_create_stream
from zerver.models import Realm... |
cybernet14/scikit-learn | refs/heads/master | sklearn/cluster/tests/test_bicluster.py | 226 | """Testing for Spectral Biclustering methods"""
import numpy as np
from scipy.sparse import csr_matrix, issparse
from sklearn.grid_search import ParameterGrid
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equal
from... |
f0rki/cb-multios | refs/heads/master | original-challenges/Order_Up/support/table.py | 1 | #!/usr/bin/env python
#
# Copyright (C) 2014 Narf Industries <info@narfindustries.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
# th... |
edx/edxanalytics | refs/heads/master | src/edxanalytics/prototypemodules/course_stats/course_stats.py | 1 | import csv
import datetime
import json
import logging
import os
import re
import sys
from collections import Counter
from dateutil import parser
from pymongo import MongoClient
import django.template.loader
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.models im... |
modoboa/modoboa-amavis | refs/heads/master | modoboa_amavis/constants.py | 1 | # -*- coding: utf-8 -*-
"""Modoboa amavis constants."""
from __future__ import unicode_literals
import collections
from django.utils.translation import ugettext_lazy as _
MESSAGE_TYPES = collections.OrderedDict((
("C", _("Clean")),
("S", _("Spam")),
("Y", _("Spammy")),
("V", _("Virus")),
("H", ... |
numenta/nupic.research | refs/heads/master | projects/transformers/experiments/rigl_bert.py | 2 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, 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... |
e-davydenkova/SeleniumWebDriver_Training | refs/heads/master | test_example.py | 1 | import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
#from selenium.webdriver.support import expected_conditions as EC
@pytest.fixture
def driver(request):
wd = webdriver.Safari()
print(wd.capabilities)
request.addfinalizer(wd.quit)
return wd
def tes... |
CanWeStudio/cassandra-dbapi2 | refs/heads/master | cql/cassandra/Cassandra.py | 6 | #
# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.pro... |
marathoncoder/scrapy | refs/heads/master | scrapy_py/commands/crawlall.py | 1 | from scrapy.commands import ScrapyCommand
from scrapy.crawler import CrawlerRunner
from scrapy.utils.conf import arglist_to_dict
class Command(ScrapyCommand):
requires_project = True
def syntax(self):
return '[options]'
def short_desc(self):
return 'Runs all of the spiders'
def add_options(self, parser):
Scr... |
dsiugzda/litcoin | refs/heads/master | contrib/wallettools/walletunlock.py | 2299 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) |
lucacerone/nikola | refs/heads/master | nikola/plugins/compile/rest/post_list.py | 9 | # -*- coding: utf-8 -*-
# Copyright © 2013-2015 Udo Spallek, Roberto Alsina and others.
# 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
#... |
sertac/django | refs/heads/master | tests/view_tests/tests/test_debug.py | 150 | # -*- coding: utf-8 -*-
# This coding header is significant for tests, as the debug view is parsing
# files to search for such a header to decode the source file content
from __future__ import unicode_literals
import importlib
import inspect
import os
import re
import sys
import tempfile
from unittest import skipIf
f... |
fenginx/django | refs/heads/master | tests/redirects_tests/urls.py | 61 | from django.http import HttpResponse
from django.urls import path
urlpatterns = [
path('', lambda req: HttpResponse('OK')),
]
|
yiqingj/airflow | refs/heads/master | airflow/operators/dummy_operator.py | 62 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
you21979/phantomjs | refs/heads/2.0 | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py | 119 | # Copyright (C) 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 ... |
djangothon/django-react-comments | refs/heads/master | django_comments/comment_react/urls.py | 2 | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^$', views.home, name="home"),
]
|
pizzapanther/GAE-Bulk-Mailer | refs/heads/master | django/core/servers/fastcgi.py | 241 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... |
maru-sama/pyblosxom | refs/heads/master | Pyblosxom/tests/test_comments.py | 2 | #######################################################################
# This file is part of Pyblosxom.
#
# Copyright (C) 2010-2011 by the Pyblosxom team. See AUTHORS.
#
# Pyblosxom is distributed under the MIT license. See the file
# LICENSE for distribution details.
###############################################... |
jprice-stmarytx/eg1302 | refs/heads/master | check_for_text.py | 1 | #!/usr/bin/env python
import sys, os
search_strings = [
"There is no student submission text data for this assignment.",
"There are no student comments for this assignment."]
def search_file(filename):
found = 0
for line in file(filename,'r'):
for search in search_strings:
if line... |
antoan2/incubator-mxnet | refs/heads/master | cpp-package/scripts/OpWrapperGenerator.py | 17 | # 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... |
intoximeters/wal-e | refs/heads/master | tests/test_piper_low_mem.py | 8 | import errno
import os
import pytest
from fast_wait import fast_wait
from wal_e import piper
from wal_e import subprocess
assert fast_wait
def invoke_program():
with open(os.devnull, 'w') as devnull:
piper.popen_sp(['python', '--version'],
stdout=devnull, stderr=devnull)
def te... |
keakon/Doodle | refs/heads/master | doodle/core/models/constants.py | 1 | # -*- coding: utf-8 -*-
class ContentFormat(object):
(
PLAIN,
BBCODE,
HTML,
MARKDOWN
) = range(4)
|
bobcyw/py2app | refs/heads/master | py2app/bootstrap/boot_app.py | 9 | import re, sys
cookie_re = re.compile(b"coding[:=]\s*([-\w.]+)")
if sys.version_info[0] == 2:
default_encoding = 'ascii'
else:
default_encoding = 'utf-8'
def guess_encoding(fp):
for i in range(2):
ln = fp.readline()
m = cookie_re.search(ln)
if m is not None:
return m.gr... |
pzavolinsky/KDiskSleepPlasmoid | refs/heads/master | contents/code/main.py | 1 | # -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.plasma import Plasma
from PyKDE4 import plasmascript
from PyQt4 import QtCore
import commands
import os
class DiskSleep(plasmascript.Applet):
def __init__(self,parent,args=None):
plasmascript.Applet.__init__(self,parent)
d... |
JSteunou/comimoc-back | refs/heads/master | comimoc/admin/views.py | 1 | # -*- coding: utf-8 -*-
"""
Flask views that contains Blueprints
"""
from __future__ import unicode_literals
from comimoc.admin.models import User
from comimoc.models import Comment
from flask import flash
from flask import redirect
from flask import url_for
from flask.ext.admin import AdminIndexView
from flask.... |
alexdglover/shill-isms | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py | 326 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... |
mbr0wn/gnuradio | refs/heads/master | grc/core/io/__init__.py | 6 | # Copyright 2017 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
|
louissobel/828-qemu-fork | refs/heads/tpm | scripts/tracetool/backend/events.py | 97 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generic event description.
This is a dummy backend to establish appropriate frontend/backend compatibility
checks.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GP... |
stspyder/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/parser.py | 133 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#default_value:foo
#include: other.manifest
#
#[test_name.js]
# expected: ERROR
#
# [subtest 1]
# expected:
# ... |
stryder199/RyarkAssignments | refs/heads/master | Assignment2/ttt/code_activator/265/python/lab6_marked.py | 2 | code_lib_path = '../question_library'
question_list = [
# (mark, count, [directories])
(1, 4, ['list_multi_to_one_reference_io_*']),
# (1, 4, ['list_slices_defaultUL_io_forward_*']),
(1, 4, ['list_slices_defaultUL_io_backward_*']),
# (1, 4, ['list_slices_outOfRange_io_forward_*']),
(1, 4, ['list_slices_outOfRang... |
kkloberdanz/Piserver | refs/heads/master | ledpi/piserver/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-16 22:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... |
GeoscienceAustralia/Geodesy-Web-Services | refs/heads/master | aws/amazonia/test/sys_tests/test_sys_lambda_leaf.py | 3 | #!/usr/bin/python3
from amazonia.classes.lambda_config import LambdaConfig
from amazonia.classes.amz_lambda import LambdaLeaf
from troposphere import Template
def main():
template = Template()
lambda_config = LambdaConfig(
lambda_s3_bucket='smallest-bucket-in-history',
lambda_s3_key='test_la... |
wickman/mesos | refs/heads/trunk | frameworks/torque/torquesched.py | 7 | #!/usr/bin/env python
import mesos
import os
import sys
import time
import httplib
import Queue
import threading
import re
import socket
import torquelib
import time
import logging
import logging.handlers
from optparse import OptionParser
from subprocess import *
from socket import gethostname
PBS_SERVER_FILE = "/va... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/tlslite/integration/TLSSocketServerMixIn.py | 320 | """TLS Lite + SocketServer."""
from gdata.tlslite.TLSConnection import TLSConnection
class TLSSocketServerMixIn:
"""
This class can be mixed in with any L{SocketServer.TCPServer} to
add TLS support.
To use this class, define a new class that inherits from it and
some L{SocketServer.TCPServer} (wi... |
biocore/qiime | refs/heads/master | scripts/blast_wrapper.py | 15 | #!/usr/bin/env python
# File created on 20 Dec 2009.
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Jesse Stombaugh"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Caporaso"
__email__ = "gregcapora... |
javierder/dogestart.me | refs/heads/master | django/conf/project_template/manage.py | 1070 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
daichenge/security_monkey | refs/heads/master | security_monkey/auditors/iam/iam_ssl.py | 6 | # Copyright 2014 Netflix, 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... |
cesargtz/YecoraOdoo | refs/heads/master | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py | 293 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
glennlive/gnuradio-wg-grc | refs/heads/master | gr-vocoder/python/vocoder/qa_alaw_vocoder.py | 47 | #!/usr/bin/env python
#
# Copyright 2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your optio... |
junian/python-ach | refs/heads/master | tests/test_data_types.py | 6 | import nose.tools as nt
from ach import data_types as dt
class TestDataTypes(object):
def setup(self):
'''
We need to set up some data types
'''
self.header = dt.Header(
'123456789', '123456789', 'A', 'YOUR BANK', 'YOUR COMPANY'
)
self.file_control = d... |
Asilva4700/Aljos | refs/heads/master | Aljos/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | 327 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.generator... |
HiroIshikawa/21playground | refs/heads/master | flask-sample/hello/venv/lib/python3.5/site-packages/jinja2/exceptions.py | 977 | # -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for al... |
jswanljung/iris | refs/heads/master | lib/iris/tests/integration/test_pp_constrained_load_cubes.py | 9 | # (C) British Crown Copyright 2014 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
popgenmethods/smcpp | refs/heads/master | test/unit/fixtures.py | 2 | import pytest
import numpy as np
import smcpp._smcpp, smcpp.model
@pytest.fixture
def im():
K = 5
hidden_states = np.concatenate([[0.], np.logspace(-2, 1, 5), [np.inf]])
N0 = 10000.
theta = 1.25e-8
rho = theta / 4.
n = 26
M = len(hidden_states) - 1
s = np.diff(np.logspace(np.log10(.01... |
joliet0l/python-for-android | refs/heads/master | src/jni/freetype/builds/mac/ascii2mpw.py | 830 | #!/usr/bin/env python
import sys
import string
if len( sys.argv ) == 1 :
for asc_line in sys.stdin.readlines():
mpw_line = string.replace(asc_line, "\\xA5", "\245")
mpw_line = string.replace(mpw_line, "\\xB6", "\266")
mpw_line = string.replace(mpw_line, "\\xC4", "\304")
mpw_line = string.replace(mpw_... |
mitodl/xanalytics | refs/heads/master | unidecode/x05b.py | 252 | data = (
'Gui ', # 0x00
'Deng ', # 0x01
'Zhi ', # 0x02
'Xu ', # 0x03
'Yi ', # 0x04
'Hua ', # 0x05
'Xi ', # 0x06
'Hui ', # 0x07
'Rao ', # 0x08
'Xi ', # 0x09
'Yan ', # 0x0a
'Chan ', # 0x0b
'Jiao ', # 0x0c
'Mei ', # 0x0d
'Fan ', # 0x0e
'Fan ', # 0x0f
'Xian ', # 0x10
'Yi '... |
makinacorpus/django | refs/heads/master | django/template/defaulttags.py | 1 | """Default tags used by the template system, available to all templates."""
from __future__ import unicode_literals
import sys
import re
from datetime import datetime
from itertools import groupby, cycle as itertools_cycle
import warnings
from django.conf import settings
from django.template.base import (Node, NodeLi... |
Gustry/inasafe | refs/heads/develop | safe_extras/raven/utils/serializer/__init__.py | 25 | """
raven.utils.serializer
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from raven.utils.serializer.base import *
from raven.utils.serializer.manager import *
|
kiyukuta/chainer | refs/heads/master | chainer/functions/pooling/pooling_nd.py | 3 | import numpy
import six
from chainer import cuda
from chainer import function
from chainer.functions.pooling import pooling_2d
from chainer.utils import conv
from chainer.utils import conv_nd
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_cudnn_vers... |
valexandersaulys/prudential_insurance_kaggle | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 853 | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.... |
atheed/servo | refs/heads/master | tests/wpt/css-tests/tools/pytest/bench/manyparam.py | 225 |
import pytest
@pytest.fixture(scope='module', params=range(966))
def foo(request):
return request.param
def test_it(foo):
pass
def test_it2(foo):
pass
|
Xeralux/tensorflow | refs/heads/master | tensorflow/tools/pip_package/check_load_py_test.py | 44 | # 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... |
ominux/personfinder | refs/heads/master | app/query.py | 17 | #!/usr/bin/python2.7
# Copyright 2010 Google 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 ... |
27himanshu/vocabList-kivy | refs/heads/master | wordnik/wordnik/models/Note.py | 2 | #!/usr/bin/env python
"""
Copyright 2012 Wordnik, 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 applica... |
palaniyappanBala/thug | refs/heads/master | src/Analysis/peepdf/ccitt.py | 43 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ccitt.py
TODO
http://tools.ietf.org/pdf/rfc804.pdf
http://code.google.com/p/origami-pdf/source/browse/lib/origami/filters/ccitt.rb
"""
__author__ = 'Binjo'
__version__ = '0.1'
__date__ = '2012-04-08 14:30:05'
class BitWriterException(Exception):
pass
class B... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_fawn_moonraiser.py | 85615 | import sys
def setup(core, object):
return |
40223211/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/dom/domreg.py | 841 | """Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
# This is a list of well-known implementations. Well-known names
# should be published by posting to xml-sig@python.org, and are
# ... |
GabrieleAndrea/MEGAnnotator | refs/heads/master | bin/SPAdes/share/spades/pyyaml3/loader.py | 277 |
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from .reader import *
from .scanner import *
from .parser import *
from .composer import *
from .constructor import *
from .resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
R... |
supriyantomaftuh/notifico | refs/heads/master | notifico/models/bot.py | 3 | # -*- coding: utf8 -*-
__all__ = ('BotEvent',)
import datetime
from notifico import db
class BotEvent(db.Model):
id = db.Column(db.Integer, primary_key=True)
created = db.Column(db.TIMESTAMP(), default=datetime.datetime.utcnow)
channel = db.Column(db.String(80))
host = db.Column(db.String(255), null... |
amarandon/pinax | refs/heads/master | pinax/apps/account/openid_consumer.py | 1 | import urlparse
from openid import oidutil
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.utils.translation import ugettext
from django.co... |
ajoaoff/django | refs/heads/master | tests/known_related_objects/models.py | 269 | """
Existing related object instance caching.
Test that queries are not redone when going back through known relations.
"""
from django.db import models
class Tournament(models.Model):
name = models.CharField(max_length=30)
class Organiser(models.Model):
name = models.CharField(max_length=30)
class Pool... |
edx/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/utils/http.py | 53 | import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.Utils import formatdate
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"')
MONTHS = 'jan feb mar apr may jun jul au... |
Emergya/icm-openedx-educamadrid-platform-basic | refs/heads/ci | cms/djangoapps/contentstore/management/commands/populate_creators.py | 182 | """
Script for granting existing course instructors course creator privileges.
This script is only intended to be run once on a given environment.
"""
from course_creators.views import add_user_with_status_granted, add_user_with_status_unrequested
from django.core.management.base import BaseCommand
from django.contri... |
clinton-hall/nzbToMedia | refs/heads/master | libs/common/rebulk/__version__.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Version module
"""
# pragma: no cover
__version__ = '1.0.0'
|
lafayette/JBTT | refs/heads/master | framework/python/Lib/pkgutil.py | 66 | """Utilities to support packages."""
# NOTE: This module must remain compatible with Python 2.3, as it is shared
# by setuptools for distribution with Python 2.3 and up.
import os
import sys
import imp
import os.path
from types import ModuleType
__all__ = [
'get_importer', 'iter_importers', 'get_loader', 'find_l... |
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/apps/cherrypy_app/models.py | 77 | """Flask SQLAlchemy ORM models for Social Auth"""
import cherrypy
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from social.utils import setting_name, module_member
from social.storage.sqlalchemy_orm import SQ... |
360youlun/cmsplugin-contact | refs/heads/master | cmsplugin_contact/middleware.py | 7 |
class ForceResponseMiddleware:
def process_response(self, request, response):
if getattr(request, 'django_cms_contact_redirect_to', None) :
return request.django_cms_contact_redirect_to
return response
|
dphiffer/dna-codec | refs/heads/master | lib/dnacloud/source/barcodeGenerator.py | 3 | """
#########################################################################
Author: Shalin Shah
Project: DNA Cloud
Graduate Mentor: Dixita Limbachya
Mentor: Prof. Manish K Gupta
Date: 28 July 2013
Website: www.guptalab.org/dnacloud
This module is used to create a bracode.
#############################################... |
scottkmaxwell/papa | refs/heads/master | papa/utils.py | 1 | import socket
import sys
import select
__author__ = 'Scott Maxwell'
valid_families = dict((name[3:].lower(), getattr(socket, name))
for name in dir(socket)
if name.startswith('AF_') and getattr(socket, name))
valid_families_by_number = dict((value, name)
... |
kohnle-lernmodule/exe201based | refs/heads/master | twisted/web/widgets.py | 14 | # -*- test-case-name: twisted.web.test.test_web -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""This module is DEPRECATED."""
import warnings
warnings.warn("This module is deprecated, please use Woven instead.", DeprecationWarning)
# System Imports
import string, time, typ... |
retomerz/intellij-community | refs/heads/master | python/testData/inspections/ReplaceNotEqOperator_after.py | 83 | print(a != b) |
kyle1986/robortframe | refs/heads/master | src/robot/api/logger.py | 5 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
jank3/django | refs/heads/master | tests/gis_tests/test_geoip2.py | 47 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.geoip2 import HAS_GEOIP2
from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry
from django.utils import six
if HAS_GEOIP2:
from d... |
hydratk/hydratk | refs/heads/master | tests/yodahelpers/hydratk/core/__init__.py | 242 | from pkgutil import extend_path
__path__ = extend_path(__path__, __name__) |
Philippe12/external_chromium_org | refs/heads/kitkat | tools/gdb/gdb_chrome.py | 23 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GDB support for Chrome types.
Add this to your gdb by amending your ~/.gdbinit as follows:
python
import sys
sys.path.insert(0, "/path/to/tools... |
nathanbjenx/cairis | refs/heads/master | cairis/gui/UseCaseEnvironmentPanel.py | 1 | # 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... |
sitian/wing | refs/heads/master | services/wmd/rec.py | 1 | # rec.py
#
# Copyright (C) 2013 Yi-Wei Ci <ciyiwei@hotmail.com>
#
# 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
# ... |
Workday/OpenFrame | refs/heads/master | native_client_sdk/src/build_tools/sdk_tools/command/command_common.py | 164 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def GetValidBundles(manifest, bundle_names):
valid_bundles = [bundle.name for bundle in manifest.GetBundles()]
valid_bundles = set(bundle_names) & se... |
alphagov/notifications-api | refs/heads/master | tests/app/notifications/test_rest.py | 1 | import uuid
import pytest
from flask import current_app, json
from freezegun import freeze_time
from notifications_python_client.authentication import create_jwt_token
from app.dao.api_key_dao import save_model_api_key
from app.dao.notifications_dao import dao_update_notification
from app.dao.templates_dao import dao... |
aladagemre/robinviz | refs/heads/master | src/python/robinviz/databases/identifier_db_generator.py | 1 | # -*- coding: utf-8 -*-
"""
Generates a sqlite database from the BIOGRID-IDENTIFIERS.tab.txt file.
http://thebiogrid.org/downloads/archives/Release%20Archive/BIOGRID-3.0.67/BIOGRID-IDENTIFIERS-3.0.67.tab.zip
"""
import sqlite3
import urllib
import os
import sys
from PyQt4 import QtGui
sys.path.append("..")
sys.path.a... |
ProfessorX/Config | refs/heads/master | .PyCharm30/system/python_stubs/-1247972723/PyQt4/QtGui/QTouchEvent.py | 2 | # encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python2.7/dist-packages/PyQt4/QtGui.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from QInputEvent import QInputEvent
class QTouchEvent(QInputEvent):
"""
QTouchEvent(QEvent.Type, QTouchEvent.DeviceType deviceType=QTouc... |
arunkgupta/gramps | refs/heads/trunk | gramps/gen/filters/rules/place/_hascitation.py | 1 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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; eith... |
zjh3123629/linux-4.5.1 | refs/heads/master | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... |
florianholzapfel/home-assistant | refs/heads/dev | homeassistant/components/sensor/dht.py | 17 | """
Support for Adafruit DHT temperature and humidity sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.dht/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCH... |
collective/cyn.in | refs/heads/master | src/ubify.cyninv2theme/ubify/cyninv2theme/skins/ubify_cyninv2theme_custom_templates/pwreset_constructURL.py | 5 | ## Script (Python) "pwreset_constructURL.py"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##title=Create the URL where passwords are reset
##parameters=randomstring,userid=None
site_properties = container.portal_properties.site_properties
if ha... |
bwhmather/cryptography | refs/heads/master | src/cryptography/hazmat/backends/commoncrypto/hmac.py | 61 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... |
TheoChevalier/bedrock | refs/heads/master | bedrock/mozorg/management/commands/update_blog_feeds.py | 3 | from __future__ import print_function
from django.core.management.base import BaseCommand
from bedrock.mozorg.models import BlogArticle
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('-q', '--quiet', action='store_true', dest='quiet', default=False,
... |
actmd/Diamond | refs/heads/master | src/collectors/cpuacct_cgroup/test/testcpuacct_cgroup.py | 31 | #!/usr/bin/python
# coding=utf-8
##########################################################################
import os
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
try:
from cStringIO import StringIO
except ImportError:
from StringIO i... |
deandunbar/bitwave | refs/heads/master | hackathon_version/venv/lib/python2.7/site-packages/pip/exceptions.py | 398 | """Exceptions used throughout package"""
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class DistributionNotFound(InstallationError)... |
amoikevin/gyp | refs/heads/master | test/win/win-tool/gyptest-win-tool-handles-readonly-files.py | 164 | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure overwriting read-only files works as expected (via win-tool).
"""
import TestGyp
import filecmp
import os
import stat
import... |
BRCDcomm/pynos | refs/heads/master | pynos/versions/base/yang/brocade_system_monitor_ext.py | 10 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_system_monitor_ext(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def show_system_monitor_input_rbridge_id(self, **kwargs):
"""Auto Generate... |
RonnyPfannschmidt/pip | refs/heads/develop | tests/functional/test_install_vcs_svn.py | 3 | import pytest
from mock import patch
from pip._internal.vcs.subversion import Subversion
@patch('pip._internal.vcs.call_subprocess')
@pytest.mark.network
def test_obtain_should_recognize_auth_info_url(call_subprocess_mock, script):
svn = Subversion(url='svn+http://username:password@svn.example.com/')
svn.obt... |
firerszd/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/pip/pep425tags.py | 469 | """Generate and work with PEP 425 Compatibility Tags."""
import sys
import warnings
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
def get_abbr_impl():
"""Return abbreviated implementation name."""
if hasat... |
jamesbeebop/CouchPotatoServer | refs/heads/master | couchpotato/core/media/movie/providers/info/couchpotatoapi.py | 17 | import base64
import time
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.encoding import tryUrlencode, ss
from couchpotato.core.logger import CPLog
from couchpotato.core.media.movie.providers.base import MovieProvider
from couchpotato.environment import Env
log = CPLog(__name__)... |
elijah513/scikit-learn | refs/heads/master | sklearn/grid_search.py | 103 | """
The :mod:`sklearn.grid_search` includes utilities to fine-tune the parameters
of an estimator.
"""
from __future__ import print_function
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# ... |
patcon/open-cabinet | refs/heads/master | venv/lib/python2.7/site-packages/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... |
behzadnouri/scipy | refs/heads/master | scipy/linalg/_cython_signature_generator.py | 52 | """
A script that uses f2py to generate the signature files used to make
the Cython BLAS and LAPACK wrappers from the fortran source code for
LAPACK and the reference BLAS.
To generate the BLAS wrapper signatures call:
python _cython_signature_generator.py blas <blas_directory> <out_file>
To generate the LAPACK wrapp... |
tdeh/py-tree | refs/heads/master | py_tree/directory_explorer.py | 2 | # Copyright 2017 Taylor DeHaan
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.