text stringlengths 48 9.16k |
|---|
def test_network_urls():
"""Test various non-socket URLs."""
actual = parse_url('redis://user:pass@localhost:6379/1')
assert dict(password='pass', host='localhost', port=6379, db=1) == actual
actual = parse_url('redis://192.168.1.100:8000/1')
assert dict(host='192.168.1.100', port=8000, db=1) == ac... |
def __repr__(self):
kls = self.__class__
return '<%s.%s object at 0x%x type=%s>' % (
kls.__module__, kls.__name__, id(self), self.type) |
def create_connect_args(self, url):
opts = url.translate_connect_args(username='user')
if 'port' in opts:
opts['port'] = int(opts['port'])
else:
opts['port'] = 5432
opts.update(url.query)
return ([], opts) |
def __setitem__(self, index, entity):
if isinstance(index, slice):
step = index.step or 1
start = index.start or 0
if start < 0:
start += len(self)
stop = index.stop or len(self)
if stop < 0:
stop += len(self)
for i in range(start, stop, step)... |
def _bindparam_requires_quotes(self, value):
"""Return True if the given identifier requires quoting."""
lc_value = value.lower()
return (lc_value in self.reserved_words
or value[0] in self.illegal_initial_characters
or not self.legal_characters.match(util.text_type(value))
... |
def _get_server_version_info(self, connection):
vers = connection.scalar("select @@version_number")
# i.e. 15500, 15000, 12500 == (15, 5, 0, 0), (15, 0, 0, 0),
# (12, 5, 0, 0)
return (vers / 1000, vers % 1000 / 100, vers % 100 / 10, vers % 10) |
def note_session_activity(req):
"""
Add a session 'timeout' whenever a user performs an action. This is
required to keep dormant (not yet expired, but inactive) sessions
from maxing out the concurrent session limit.
Parameters:
req - An HttpRequest, with a session attribute
"""
# T... |
def append_prefix(self, clause):
"""append the given columns clause prefix expression to this select()
construct.
This is an **in-place** mutation method; the
:meth:`~.Select.prefix_with` method is preferred, as it provides
standard :term:`method chaining`.
"""
clause = _literal_as_text(cl... |
@util.memoized_property
def should_autocommit(self):
autocommit = self.execution_options.get('autocommit',
not self.compiled and
self.statement and
expression.PARSE_AUTOCOMMIT
... |
def init_class_attribute(self, mapper):
self.is_class_level = True
coltype = self.columns[0].type
# TODO: check all columns ? check for foreign key as well?
active_history = self.parent_property.active_history or \
self.columns[0].primary_key or \
mapper.version_id_col in set(self.colum... |
def __init__(self, Malware_Instance=None):
if Malware_Instance is None:
self.Malware_Instance = []
else:
self.Malware_Instance = Malware_Instance |
def exportChildren(self, lwrite, level, nsmap, namespace_=XML_NS, name_='TermsOfUseMarkingStructureType', fromsubclass_=False, pretty_print=True):
super(TermsOfUseMarkingStructureType, self).exportChildren(lwrite, level, nsmap, namespace_, name_, True, pretty_print=pretty_print)
if pretty_print:
eol_ = ... |
def __add_keys_to(self, result):
try:
keyed_result = self.service.get_storage_account_keys(
result.service_name
)
except Exception as e:
raise AzureStorageAccountShowError(
'%s: %s' % (type(e).__name__, format(e))
)
result.storage_service_keys = keyed_... |
def create_expected_endpoint_output(self):
return {
'idle-timeout': '%d minutes' % self.idle_timeout,
'instance-port': self.port,
'name': self.endpoint_name,
'port': self.port,
'protocol': self.protocol
} |
def _check_spatial_resource(self, url, name, dictionary, update=False):
"""
This method will check geoserver for the existence of an object.
It will create the object if it doesn't exist.
@param url: The URL of the resource.
@param name: The name of the resource.
@param dictionary: A dictionar... |
def _parse_collected_classes(self):
collected = self._collected_classes
entity_klasses = (stix.Entity, Entity)
# Generator which yields all stix.Entity and mixbox.Entity subclasses
# that were collected.
entity_subclasses = (
klass for klass in collected if issubclass(klass, entity_klasses)... |
def get_xmlns_str(self, ns_dict):
pairs = sorted(ns_dict.iteritems())
return "\n\t".join(
'xmlns:%s="%s"' % (alias, ns) for alias, ns in pairs
) |
def get_field(self, name):
names = name.split('.', 1)
if not self._digit_re.match(names[0]):
# XXX is this needed?
return None
field = self.field(name=names[0])
if len(names) > 1:
return field.get_field(names[1])
return field |
def multiply(traj):
"""Example of a sophisticated simulation that involves multiplying two values.
:param traj:
Trajectory containing
the parameters in a particular combination,
it also serves as a container for results.
"""
z=traj.mylink1*traj.mylink2 # And again we now can a... |
def select_blogs_by_id_sql(newsid):
c = g.db.cursor()
sql ="select * from blog where newsid =%s" %(newsid)
c.execute(sql)
results=c.fetchone()
index=results[0]
sql ="select * from blog where id< %d and id>%d" %(index,index-9)
c.execute(sql)
results=c.fetchall()
blogs=[]
blogjso... |
def get_dict(self):
n = len(self)
keys = (c_void_p * n)()
values = (c_void_p * n)()
coref.CFDictionaryGetKeysAndValues(self, keys, values)
d = dict()
for i in xrange(n):
d[CFType.from_handle(keys[i])] = CFType.from_handle(values[i])
return d |
def test_clean_value(self):
class AssertConv(convs.Int):
def to_python(conv, value):
value = convs.Int.to_python(conv, value)
if value is not None:
field = conv.field.form.get_field('num')
self.assertEqual(field.clean_value, value)
return v... |
def wrapper(cls):
cls_dict = cls.__dict__.copy()
slots = cls_dict.get('__slots__', None)
if slots is not None:
if isinstance(slots, compat.base_type):
slots = (slots,)
for slot in slots:
cls_dict.pop(slot)
cls_dict.pop('__dict__', None)
cls_dict.pop('__weakref... |
def run(self, title, body, topic=None, status=0):
if topic:
topic = self._convert_slug(topic)
path = '/topics/%s/articles' % topic
else:
path = '/articles'
payload = self._create_article(title=title, body=body, status=status)
response = self._api_post(path, json=payload)
retu... |
def multiply(traj):
"""Sophisticated simulation of multiplication"""
z=traj.x*traj.y
traj.f_add_result('z',z=z, comment='I am the product of two reals!') |
def __init__(self, file_handle):
for line in file_handle:
line = line.strip()
if len(line) == 0 or line[0] == '#':
continue
key, value = line.split('=')
self[key] = value |
def _dispatch_application_normal(self, payload, attempt_no=0):
'''
Dispatches WEB_APP_NORMAL_TRIGGER_REF if the application health_status is 'green'.
'''
# basic guard to avoid queuing up forever.
if attempt_no == 10:
self._log.warning('Abandoning WEB_APP_NORMAL_TRIGGER_REF dispatch. Payload... |
def tearDown(self):
if hasattr(self, 'env') and hasattr(self.env, 'f_disable_logging'):
self.env.f_disable_logging()
self.clear_handlers()
remove_data() |
def initTree(self, notepath, parent):
if parent == "":
# site wide index page
htmlfile = os.path.join(self.sitepath, "index.html")
else:
# append subpages to page
htmlfile = os.path.join(self.htmlpath, parent + ".html")
html = QFile(htmlfile)
html.open(QIODevice.Append)
saves... |
def _get_average_contract_interval(self):
with self.contracts_lock:
if (len(self.contracts) > 0):
total = sum([c.estimated_interval.total_seconds()
for c in self.contracts.values()])
return float(total) / float(len(self.contracts))
else:
r... |
def passed(self, msg, *args, **kwargs):
self.info('PASS: ' + msg, *args, **kwargs)
if self.isEnabledFor(logging.DEBUG) and len(getLastFoundImages()) != 0:
# source image
self.html_img("Source Image", common.cfgImageLibrary + '/' + getLastFoundImage())
# matched image
last_match ... |
def test_documentation_element_reference_time(self):
xml = '<documentation type="Reference Time">' \
'2015-05-28T12:00:00Z</documentation>'
element = self._make_element(xml)
md = TDSCatalogMetadata(element).metadata
assert "documentation" in md
assert "Reference Time" in md["documentation... |
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
cache_key = 'c:' + key_func(func, args, kwargs, extra)
try:
result = self.get(cache_key)
except CacheMiss:
result = func(*args, **kwargs)
self.set(cache_key, result, timeout)
retu... |
def interfaceVersion( self ):
"""
Must return 1.
"""
try:
return 1
except Exception as e:
self.logToConsole( "interfaceVersion: %s" % str(e) ) |
def setUp(self):
if not self.udt_support:
self.skipTest("testing with Cassandra < 2.2, can't test with UDT's")
super(UDTTest, self).setUp()
self.session.execute('TRUNCATE %s' % self.table) |
def build_command(self, cmd):
return self.bin + self.opts + [c for c in cmd if c] |
def on_tag(self, repo, tag):
exit, stdout, stderr = self.git(['checkout', 'tags/%s' % tag], cwd=repo)
if exit == 0:
panel = self.window.get_output_panel('git-checkout')
panel.run_command('git_panel_write', {'content': stderr})
self.window.run_command('show_panel', {'panel': 'output.git-c... |
def setupPrivateRun(self, privateRunDir):
"""Sets up a private /run (& /var/run) directory for the node
privateRunDir: None/True for default source, else path for source"""
# Handle the input provided (either a bool or a path)
if isinstance(privateRunDir, bool):
if privateRunDir is False:
... |
def toStrNormal(self):
res = "#EXTM3U\n"
res += "#EXT-X-VERSION:" + str(self.version) + "\n"
res += "#EXT-X-TARGETDURATION:" + str(self.targetDuration) + "\n"
res += "#EXT-X-MEDIA-SEQUENCE:" + str(self.mediaSequence) + "\n"
if self.encryption != None:
res += "#EXT-X-KEY:METHOD=" + self.encry... |
def __exit__(self, *exc_info):
"""Exit the context, pop this async from the executing context stack.
"""
local_context = _local.get_local_context()
last = local_context._executing_async.pop()
if last is not self._async:
local_context._executing_async.append(last)
raise errors.Corrupt... |
def testIncludeWithPath(self):
cellVariables = getid1(
'/Cell:%(cellName)s/VariableMap:/'
% topology
)
variableCount = len(cellVariables.entries)
importConfigurationManifest(
'wdrtest/manifests/imports/include_with_path.wdrc', topology
)
self.assertEquals(len(cellVariable... |
def adminTaskAsDict(adminTaskList):
result = {}
for (key, valueQuoted, valueNotQuoted) in _itemPattern.findall(
adminTaskList
):
result[key] = valueQuoted or valueNotQuoted
return result |
def test_tasks_with_small_batch_size(self):
"""Ensure that when a batch_size parameter is smaller than 100,
that the correct number of batches are created with the tasks in them.
"""
from furious.context.context import _task_batcher
tasks = 'a' * 101
batch_size = 30
result = list(_task_bat... |
def generate_operation_metric_for_regionserver(regionserver):
task = regionserver.task
metric = []
endpoint = form_perf_counter_endpoint_name(regionserver.task)
group = 'HBase'
for operationName in metric_view_config.REGION_SERVER_OPERATION_VIEW_CONFIG:
counter = []
# first append operationName
co... |
def reset(self):
value = self.value
if value is not None:
if value is True or value is False:
self.value = False
else:
self.value = 0
if self.ref is not None:
self.ref.reset() |
def test_create_schema(tmpdir):
db_path = os.path.join(tmpdir.strpath, 'db.db')
with sqlite3.connect(db_path) as db:
create_schema(db)
results = db.execute(
"SELECT name FROM sqlite_master WHERE type = 'table'"
).fetchall()
table_names = [table_name for table_name, ... |
def authorize(self, auth_info):
username, password = auth_info
if self.dict.has_key(username):
stored_password = self.dict[username]
if stored_password.startswith('{SHA}'):
password_hash = sha1(password).hexdigest()
return stored_password[5:] == password_hash
else... |
def run_subcommand(self, arguments):
"""Load the configuration, update it with the arguments and options
specified on the command-line and then call the run method implemented
by each sub-command.
"""
# Expand path of the command-line specified config file, if any
if arguments.config_file is not... |
def receive(self, sig, frame):
if sig not in self._signals_recvd:
self._signals_recvd.append(sig) |
def _parse_hosts_list(self, job_dict, job_name):
'''
Parse the hosts list for job
'''
self.hosts = {}
self.hostnames = {}
for name, value in job_dict.iteritems():
reg_expr = HOST_RULE_REGEX.match(name)
if not reg_expr:
continue
host_id = int(reg_expr.group("id"))
self.hosts[host_id] = ... |
def __repr__(self):
return '<%s.%s instance at %s: %s>' % (
self.__class__.__module__,
self.__class__.__name__,
hex(id(self)),
self.command
) |
def parse_pattern(self, pattern, size, center):
with open(pattern) as handle:
rows = [row.rstrip() for row in handle]
# Check that the pattern fits in the grid
height = len(rows)
width = max(len(row) for row in rows)
if height > size:
raise CommandError("Too many rows in pattern. In... |
def process_config(self):
super(RedisCollector, self).process_config()
instance_list = self.config['instances']
# configobj make str of single-element list, let's convert
if isinstance(instance_list, basestring):
instance_list = [instance_list]
# process original single redis instance
i... |
def test_enqueue_user_xmpp_with_string(self):
fake_domain = "fakedomain.com"
fake_user = "fakeuser"
self.MockedSettings['xmpp']['default_domain'] = fake_domain
with mock.patch.dict(pushmanager.core.xmppclient.Settings, self.MockedSettings):
with mock.patch.object(pushmanager.core.xmppclient.XMPP... |
def autoNorm(dataSet):
minVals = dataSet.min(0)
maxVals = dataSet.max(0)
ranges = maxVals - minVals
normDataSet = zeros(shape(dataSet))
m = dataSet.shape[0]
normDataSet = dataSet - tile(minVals, (m, 1))
normDataSet = normDataSet / tile(ranges, (m, 1)) # element wise divide
return normDa... |
def readS16(self, register, little_endian=True):
"""Read a signed 16-bit value from the specified register, with the
specified endianness (default little endian, or least significant byte
first)."""
result = self.readU16(register, little_endian)
if result > 32767:
result -= 65536
return ... |
def has_buffer(self):
return self.buffer_size() > 0 |
@override_mysql_variables(SQL_MODE="ANSI")
def test_appendleft_works_in_ansi_mode(self):
CharListModel.objects.create()
CharListModel.objects.update(field=ListF('field').appendleft('big'))
CharListModel.objects.update(field=ListF('field').appendleft('bad'))
model = CharListModel.objects.get()
assert... |
def hasChild(self, childPath):
'''Return True if child exists in data.'''
if type(self.data) == type(dict()):
nodes = childPath.split('/')
child = self.data
for node in nodes:
if node:
if node == nodes[-1:]:
return node in child
... |
def _access_log(self):
host, port = self.server.addr if self.server else (None, None)
if self.request.method == b"CONNECT":
logger.info("%s:%s - %s %s:%s" % (self.client.addr[0], self.client.addr[1], self.request.method, host, port))
elif self.request.method:
logger.info("%s:%s - %s %s:%s%s ... |
def test_works_with_two_fields(self):
CharSetModel.objects.create(field={"snickers", "lion"},
field2={"apple", "orange"})
# Concurrent add
CharSetModel.objects.update(field=SetF('field').add("mars"),
field2=SetF('field2').add("banana"))
mo... |
def read(conn):
data = conn.recv(1024)
if data == b'switch':
with self.window_list_lock:
tree = self.i3.get_tree()
windows = set(w.id for w in tree.leaves())
for window_id in self.window_list[1:]:
if window_id not in windows:
self.w... |
def patch_CursorWrapper_execute():
# Be idemptotent
if getattr(CursorWrapper, '_has_django_mysql_execute', False):
return
orig_execute = CursorWrapper.execute
@functools.wraps(orig_execute)
def execute(self, sql, args=None):
if (
getattr(settings, 'DJANGO_MYSQL_REWRITE... |
def tempdir(self, path=None):
"""Creates a temporary directory.
A unique directory name is generated if no path name is specified.
The directory is created, and will be removed when the TestCmd
object is destroyed.
"""
if path is None:
try:
path = tempfile.mktemp(prefix=tempf... |
def handle(self, *args, **kwargs):
path = kwargs['path']
# With DEBUG on this will DIE.
settings.DEBUG = False
print("Begin: %s" % datetime.datetime.now())
call_command('load_zipcodes', path=path)
call_command('load_states', path=path)
call_command('load_counties', path=path)
print("... |
def inversion(self, start, end):
''' inverts sequence between start and end, bases at start and end positions are not affected '''
start = int(start)
end = int(end)
assert start < end
invseq = rc(self.seq[start:end])
self.seq = self.seq[:start] + invseq + self.seq[end:] |
def re_filter(self, conf):
return conf or self.default_pattern, None, None |
def up_to_date(self, gyp_file, target=None, **kw):
"""
Verifies that a build of the specified Make target is up to date.
"""
if target in (None, self.DEFAULT):
message_target = 'all'
else:
message_target = target
kw['stdout'] = "make: Nothing to be done for `%s'.\n" % message_target
return self.bu... |
def get_source(self, line_offset):
"""Return source of line at absolute line offset `line_offset`."""
return self.input_lines.source(line_offset - self.input_offset) |
def _create_win(self):
try:
key = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
r'Software\Microsoft\Windows NT\CurrentVersion\Fonts')
except EnvironmentError:
try:
key = _winreg.OpenKey(
_winreg.HKEY_LOCAL_MACHINE,
r'Software\Mi... |
def visit_field_list(self, node):
if 'rfc2822' in node['classes']:
raise nodes.SkipNode |
def callback(lexer, match, context):
text = match.group()
context.block_scalar_indent = None
if not text:
return
increment = match.group(1)
if increment:
current_indent = max(context.indent, 0)
increment = int(increment)
context.block_scalar_indent = current_indent + ... |
def validate_models():
"""Since BaseRunserverCommand is only run once, we need to call
model valdidation here to ensure it is run every time the code
changes.
"""
import logging
from django.core.management.validation import get_validation_errors
try:
from cStringIO import StringIO
... |
def GetToolchainEnv(self, additional_settings=None):
"""Returns the variables toolchain would set for build steps."""
env = self.GetSortedXcodeEnv(additional_settings=additional_settings)
if self.flavor == 'win':
env = self.GetMsvsToolchainEnv(
additional_settings=additional_settings)
return env |
def is_expired(self):
"""Check whether the credit card is expired or not"""
return datetime.date.today() > datetime.date(self.year, self.month, calendar.monthrange(self.year, self.month)[1]) |
def get_next_fire_time(self, previous_fire_time, now):
return self.run_date if previous_fire_time is None else None |
def _IsUniqueSymrootForTarget(self, symroot):
# This method returns True if all configurations in target contain a
# 'SYMROOT' attribute that is unique for the given target. A value is
# unique, if the Xcode macro '$SRCROOT' appears in it in any form.
uniquifier = ['$SRCROOT', '$(SRCROOT)']
if any(x in symroo... |
def test_send_frame_when_frame_overflow(self):
frame = mock()
self.connection._frame_max = 100
expect(frame.write_frame).side_effect(
lambda buf: buf.extend('a' * 200))
expect(self.connection.close).args(
reply_code=501, reply_text=var('reply'), class_id=0, method_id=0, disconnect=True)
... |
def get_image_exif_cases(self):
cases = image_test.get_image_exif_cases()
m = dict(preserve_exif="exif")
for i, case in enumerate(cases):
path = "/test/data/%s" % os.path.basename(case["source_path"])
cases[i]["source_query_params"] = dict(
url=self.get_url(path),
w=c... |
def __array_finalize__(self, obj):
if obj is None: return
self.ctypesArray = getattr(obj, 'ctypesArray', None) |
def purchase(self, money, credit_card, options = None):
"""Create a plan that bills every decade or so
and charge the plan immediately"""
options = options or {}
resp = self.store(credit_card, options = options)
subscription_id = resp["response"]["subscription"]["id"]
resp = self._chargebee_req... |
@register.simple_tag
def render_banner_ad(type, fallback='True'):
"""
Renders a BannerAd instance of the desired size. If fallback is 'True',
the site will display an AdSense ad if there is no current BannerAd of the
specified type.
"""
site = Site.objects.get_current()
# If we ask for... |
def parseBytecode(dex, insns_start_pos, shorts, catch_addrs):
ops = []
pos = 0
while pos < len(shorts):
pos, op = parseInstruction(dex, insns_start_pos, shorts, pos)
ops.append(op)
# Fill in data for move-result
for instr, instr2 in zip(ops, ops[1:]):
if not instr2.type == M... |
def get_pids(procname, plugin="psscan"):
pids = []
if procname == "":
return pids
f = open_full_plugin(plugin, 2)
for line in f:
if re.search(' ' + procname + ' ', line, re.IGNORECASE):
pids.append(re.sub(' +', ' ', line).split(' ')[2])
pids = sorted(set(pids))
f.clos... |
def data_cksum(data, cksum=0):
for b in data:
if isinstance(b, bytes):
b = ord(b)
# right-shift one with wrap-around
lowbit = (cksum & 0x0001)
cksum = (cksum >> 1)
if lowbit:
cksum = (cksum | 0x8000)
# then add in the data and clear any carrie... |
@user_passes_test(lambda u: u.is_staff or u.is_superuser)
def staff_object_list(*args, **kwargs):
return object_list(*args, **kwargs) |
def safe_single_except_nl(self, node, indent):
if '\\n' in node.value:
return '"%s"' % node.value.replace('"', '\\"')
else:
return self.safe_single(node, indent) |
def is_valid(self):
"""
Checks if the newsletter is valid. A newsletter needs to have a
subject to be valid.
"""
if self.subject == '':
return False
# todo: check if email is valid
return True |
@classmethod
def authenticate(self, email, password):
"""
Returns user and authentication status.
"""
user = User.query.filter_by(email=email).first()
if user is not None:
if user.check_password(password):
return user, True
return user, False |
def solve(self, cipher):
"""
:param cipher: the cipher
"""
m, A, n, B = cipher
result = set() # {} is for dictionary
hm = {}
for a in A:
if a not in hm:
hm[a] = 1
else:
hm[a] += 1
for b in B:
if b not in hm or hm[b] <= 0:
re... |
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('account_result')
if self.success is not... |
def __eq__(self, other):
if not isinstance(other, self.__class__):
return False
for attr in self.__slots__:
my_val = getattr(self, attr)
other_val = getattr(other, attr)
if my_val != other_val:
return False
return True |
@classmethod
def prepare_constraints(cls, labels, num_constraints):
C = np.empty((num_constraints,4), dtype=int)
a, c = np.random.randint(len(labels), size=(2,num_constraints))
for i,(al,cl) in enumerate(zip(labels[a],labels[c])):
C[i,1] = choice(np.nonzero(labels == al)[0])
C[i,3] = choice(np.nonzero(lab... |
def send_notice(self, extra_context=None):
if extra_context is None:
extra_context = {}
extra_context.update({"observed": self.observed_object})
send([self.user], self.notice_type.label, extra_context) |
def function_walk(self, node):
for j, child in enumerate(node.definitions):
if child.type == 'function_definition':
node.definitions[j] = self.transform_special_f(child)
elif child.type == 'class_definition':
self.current_class = child
if child.constructor:
... |
def __init__(self):
temper_devices = self._get_temper_devices()
if len(temper_devices) == 0:
msg = 'No TEMPer devices discovered'
raise DeviceError(msg)
# Use first device if multiple devices discovered
self._temper_device = temper_devices[0] |
def run(self, **kwargs):
"""Run function with params on external service.
Basically this method call external method with params wich it
accept. You must now about accepted params by external function
and provide it.
Args:
kwargs: A dictonary with params.
Returns:
Returns exte... |
@staticmethod
def gaussian_kernel(sigma, size=None):
if size is None:
size = int(np.ceil(sigma*2.))
if size % 2 == 0:
size += 1
x = np.linspace(-size/2., size/2., size)
kernel = 1/(np.sqrt(2*np.pi))*np.exp(-x**2/(2*sigma**2))/sigma
return kernel/np.sum(kernel) |
def do_login(self, request, extra_message=None):
if request.method == 'GET':
return self.show_login(request, extra_message)
user_url = request.POST.get('openid_url', None)
if not user_url:
return self.show_login(request, self.openid_required_message)
return self.start_openid_pr... |
def read_to_condition(self, condition_func):
start = self._l
for line in self[start:]:
if condition_func(line):
return self[start:self._l]
self._l += 1
if self.eof():
return self[start:self._l + 1]
return [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.