prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>feed_parse_extractLittlebambooHomeBlog.py<|end_file_name|><|fim▁begin|>def extractLittlebambooHomeBlog(item):
'''
Parser for 'littlebamboo.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
<|fim_midd... | return None |
<|file_name|>feed_parse_extractLittlebambooHomeBlog.py<|end_file_name|><|fim▁begin|>def extractLittlebambooHomeBlog(item):
'''
Parser for 'littlebamboo.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
... | return buildReleaseMessageWithType(item, name, vol, chp, frag=frag, postfix=postfix, tl_type=tl_type) |
<|file_name|>feed_parse_extractLittlebambooHomeBlog.py<|end_file_name|><|fim▁begin|>def <|fim_middle|>(item):
'''
Parser for 'littlebamboo.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
... | extractLittlebambooHomeBlog |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... |
if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous():
return dict(error=True, message="Anonymous posting not allowed"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous():
return current_app.login_manager.unauthorized()
cname = to_canonical(name)
data = g.current_wiki.get_page(cname, sha=sha)
if not data:
abort(404)
return render_template('wiki/page.html', name=name, page=da... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous():
return current_app.login_manager.unauthorized()
diff = g.current_wiki.compare(name, fsha, lsha)
return render_template('wiki/compare.html',
name=name, diff=diff, old=fsha, new=lsha) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | cname = to_canonical(request.form.get('name'))
commit = request.form.get('commit')
message = request.form.get('message', "Reverting %s" % cname)
if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous():
return dict(error=True, message="Anonymous posting not allowed"), 403
... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous():
return current_app.login_manager.unauthorized()
hist = g.current_wiki.get_history(name)
for item in hist:
item['gravatar'] = gravatar_url(item['author_email'])
return render_template('wiki/history.html', name=nam... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | cname = to_canonical(name)
page = g.current_wiki.get_page(name)
if not page:
# Page doesn't exist
return redirect(url_for('wiki.create', name=cname))
name = remove_ext(page['path'])
g.assets['js'].append('editor.js')
return render_template('wiki/edit.html',
... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | cname = to_canonical(name) if name else ""
if cname and g.current_wiki.get_page(cname):
# Page exists, edit instead
return redirect(url_for('wiki.edit', name=cname))
g.assets['js'].append('editor.js')
return render_template('wiki/edit.html',
name=cname,
... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | parts = path.split('/', depth)
if len(parts) > depth:
return parts[-2] |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | depth = len(path.split("/"))
items = filter(lambda x: x['name'].startswith(path), items)
items = sorted(items, key=lambda x: x['name'])
for subdir, items in itertools.groupby(items, key=lambda x: _get_subdir(x['name'], depth)):
if not subdir:
for item in items:
yield ... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous():
return current_app.login_manager.unauthorized()
items = g.current_wiki.get_index()
if path:
path = to_canonical(path) + "/"
return render_template('wiki/index.html', index=_tree_index(items, path=path), path=pat... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | cname = to_canonical(name)
if not cname:
return dict(error=True, message="Invalid name")
if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous():
return dict(error=True, message="Anonymous posting not allowed"), 403
if request.method == 'POST':
# Create
... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if current_app.config.get('PRIVATE_WIKI') and current_user.is_anonymous():
return current_app.login_manager.unauthorized()
cname = to_canonical(name)
if cname != name:
return redirect(url_for('wiki.page', name=cname))
data = g.current_wiki.get_page(cname)
if data:
return r... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return current_app.login_manager.unauthorized() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | abort(404) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return current_app.login_manager.unauthorized() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Anonymous posting not allowed"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Page is locked"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | flash("Page reverted") |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return current_app.login_manager.unauthorized() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return redirect(url_for('wiki.create', name=cname)) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return redirect(url_for('wiki.edit', name=cname)) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return parts[-2] |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | for item in items:
yield dict(item, dir=False) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | size = 0
ctime = sys.maxint
mtime = 0
for item in items:
size += item['size']
ctime = min(item['ctime'], ctime)
mtime = max(item['mtime'], mtime)
yield dict(name=path + subdir + "/",
mtime=... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return current_app.login_manager.unauthorized() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | path = to_canonical(path) + "/" |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Invalid name") |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Anonymous posting not allowed"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if cname in current_app.config.get('WIKI_LOCKED_PAGES'):
return dict(error=True, message="Page is locked"), 403
sha = g.current_wiki.write_page(cname,
request.form['content'],
message=request.form['message'],
... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Page is locked"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | edit_cname = to_canonical(request.form['name'])
if edit_cname in current_app.config.get('WIKI_LOCKED_PAGES'):
return dict(error=True, message="Page is locked"), 403
if edit_cname != cname:
g.current_wiki.rename_page(cname, edit_cname)
sha = g.current_wiki.write... |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Page is locked"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | g.current_wiki.rename_page(cname, edit_cname) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | if cname in current_app.config.get('WIKI_LOCKED_PAGES'):
return dict(error=True, message="Page is locked"), 403
sha = g.current_wiki.delete_page(cname,
username=current_user.username,
email=current_user.email) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return dict(error=True, message="Page is locked"), 403 |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return current_app.login_manager.unauthorized() |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return redirect(url_for('wiki.page', name=cname)) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return render_template('wiki/page.html', name=cname, page=data, partials=data.get('partials')) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | return redirect(url_for('wiki.create', name=cname)) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | commit |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | compare |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | revert |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | history |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | edit |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | create |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | _get_subdir |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | _tree_index |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | index |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | page_write |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import itertools
import sys
from flask import abort, g, render_template, request, redirect, Blueprint, flash, url_for, current_app
from flask.ext.login import login_required, current_user
from realms.lib.util import to_canonical, remove_ext, gravatar_url
from .models i... | page |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... |
def test_equal_4(self):
self.assertEqual(string_color('Hayden Smith'), '7E00EE')
|
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
<|fim_middle|>
<|fim▁end|> | def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
self.assertEqual(string_color('Joshua'), '6A10D6')
def test_equal_3(self):
self.assertEqual(string_color('Joshua Smith'), '8F00FB')
def test_equal_4(self):
self.assertEqual... |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
<|fim_middle|>
def test_equal_2(self):
self.assertEqual(string_color('J... | self.assertEqual(string_color('Jack'), '79CAE5') |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | self.assertEqual(string_color('Joshua'), '6A10D6') |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | self.assertEqual(string_color('Joshua Smith'), '8F00FB') |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | self.assertEqual(string_color('Hayden Smith'), '7E00EE') |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | self.assertEqual(string_color('Mathew Smith'), '8B00F1') |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | self.assertIsNone(string_color('a')) |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def <|fim_middle|>(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | test_equal_1 |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def <|fim_middle|>(self):
... | test_equal_2 |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | test_equal_3 |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | test_equal_4 |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | test_equal_5 |
<|file_name|>test_what_color_is_your_name.py<|end_file_name|><|fim▁begin|>import unittest
from katas.beta.what_color_is_your_name import string_color
class StringColorTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_color('Jack'), '79CAE5')
def test_equal_2(self):
... | test_is_none_1 |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from ga_starters import *<|fim▁end|> | |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | url:
description: The HTTP url used for the request to the APIC
returned: failure or debug
type: string |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | argument_spec = aci_argument_spec()
argument_spec.update(
dst_group=dict(type='str', required=False, aliases=['name']), # Not required for querying all objects
tenant=dict(type='str', required=False, aliases=['tenant_name']), # Not required for querying all objects
description=dict(typ... |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | aci.payload(
aci_class='spanDestGrp',
class_config=dict(
name=dst_group,
descr=description,
),
)
aci.get_diff(aci_class='spanDestGrp')
aci.post_config() |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | aci.delete_config() |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | main() |
<|file_name|>aci_tenant_span_dst_group.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 = {'meta... | main |
<|file_name|>aiplatform_v1_generated_vizier_service_delete_study_sync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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 ... | # Create a client
client = aiplatform_v1.VizierServiceClient()
|
<|file_name|>aiplatform_v1_generated_vizier_service_delete_study_sync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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 ... | client = aiplatform_v1.VizierServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteStudyRequest(
name="name_value",
)
# Make the request
client.delete_study(request=request) |
<|file_name|>aiplatform_v1_generated_vizier_service_delete_study_sync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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 ... | sample_delete_study |
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'App.created_at'
... | models = {
'core.level': { |
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
<|fim_middle|>
<|fim▁end|> | def forwards(self, orm):
# Adding field 'App.created_at'
db.add_column('mobile_apps_app', 'created_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False)
def backwards(self, orm):
# Deleting field 'App.created_at'
db.... |
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'App.created_at'
... | db.add_column('mobile_apps_app', 'created_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False) |
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'App.created_at'
... | db.delete_column('mobile_apps_app', 'created_at') |
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def <|fim_middle|>(self, orm):
# Adding field 'App.created... | forwards |
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'App.created_at'
... | backwards |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | op.drop_column('file_type', 'created_at') |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | globals()["upgrade_%s" % engine_name]() |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | globals()["downgrade_%s" % engine_name]() |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | op.add_column('field_type', sa.Column('created_at', sa.DateTime(), nullable=True))
op.add_column('field_type', sa.Column('updated_at', sa.DateTime(), nullable=True))
op.add_column('file_columns', sa.Column('created_at', sa.DateTime(), nullable=True))
op.add_column('file_columns', sa.Column('updated_at',... |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | op.drop_column('tas_lookup', 'updated_at')
op.drop_column('tas_lookup', 'created_at')
op.drop_column('rule_type', 'updated_at')
op.drop_column('rule_type', 'created_at')
op.drop_column('rule_timing', 'updated_at')
op.drop_column('rule_timing', 'created_at')
op.drop_column('rule', 'updated_at... |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | upgrade |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | downgrade |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | upgrade_validation |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... | downgrade_validation |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def __init__(self):
pass
def get_profile(self, **kwargs):
# ip generator
ip_gen_c = ASTFIPGenDi... | dist_client=ip_gen_c,
dist_server=ip_gen_s)
c_glob_info = ASTFGlobalInfo() |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
<|fim_middle|>
def register():
return Prof1()
<|fim▁end|> | def __init__(self):
pass
def get_profile(self, **kwargs):
# ip generator
ip_gen_c = ASTFIPGenDist(ip_range=["16.0.0.0", "16.0.0.255"], distribution="seq")
ip_gen_s = ASTFIPGenDist(ip_range=["48.0.0.0", "48.0.255.255"], distribution="seq")
ip_gen = ASTFIPGen(glob=ASTFIPG... |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def __init__(self):
<|fim_middle|>
def get_profile(self, **kwargs):
# ip generator
ip_gen_c = ... | pass |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def __init__(self):
pass
def get_profile(self, **kwargs):
# ip generator
<|fim_middle|>
def ... | ip_gen_c = ASTFIPGenDist(ip_range=["16.0.0.0", "16.0.0.255"], distribution="seq")
ip_gen_s = ASTFIPGenDist(ip_range=["48.0.0.0", "48.0.255.255"], distribution="seq")
ip_gen = ASTFIPGen(glob=ASTFIPGenGlobal(ip_offset="1.0.0.0"),
dist_client=ip_gen_c,
... |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def __init__(self):
pass
def get_profile(self, **kwargs):
# ip generator
ip_gen_c = ASTFIPGenDi... | return Prof1() |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def <|fim_middle|>(self):
pass
def get_profile(self, **kwargs):
# ip generator
ip_gen_c = ASTFI... | __init__ |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def __init__(self):
pass
def <|fim_middle|>(self, **kwargs):
# ip generator
ip_gen_c = ASTFIPGe... | get_profile |
<|file_name|>param_tcp_rxbufsize_8k.py<|end_file_name|><|fim▁begin|>from trex_astf_lib.api import *
# IPV6 tunable example
#
# ipv6.src_msb
# ipv6.dst_msb
# ipv6.enable
#
class Prof1():
def __init__(self):
pass
def get_profile(self, **kwargs):
# ip generator
ip_gen_c = ASTFIPGenDi... | register |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.