prompt large_stringlengths 72 9.34k | completion large_stringlengths 0 7.61k |
|---|---|
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | def test_simple_url_extraction(self):
""" media_utils.extract_source_url_from_dewplayer() can extract he url to an mp3 file from an embedded dewplayer object. """
dewplayer_url = "http://download.saipm.com/flash/dewplayer/dewplayer.swf?mp3=http://podcast.dhnet.be/articles/audio_dh_388635_1331708882.... |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | """ media_utils.extract_source_url_from_dewplayer() can extract he url to an mp3 file from an embedded dewplayer object. """
dewplayer_url = "http://download.saipm.com/flash/dewplayer/dewplayer.swf?mp3=http://podcast.dhnet.be/articles/audio_dh_388635_1331708882.mp3"
expected_mp3_url = "http://po... |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | """ media_utils.extract_source_url_from_dewplayer() raises ValueError when fed an empty string """
media_utils.extract_source_url_from_dewplayer("") |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | """ media_utils.extract_source_url_from_dewplayer() raises ValueError when fed an unknown dewplayer query """
wrong_dewplayer_url = "http://download.saipm.com/flash/dewplayer/dewplayer.swf?foo=bar"
media_utils.extract_source_url_from_dewplayer(wrong_dewplayer_url) |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | make_soup |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | setUp |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_embedded_script |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_embedded_script_without_noscript_fallback |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_embeded_tweet_widget |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_embedded_javascript_code |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_embedded_tweet_widget_splitted |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_simple_url_extraction |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_empty_url |
<|file_name|>test_media_utils.py<|end_file_name|><|fim▁begin|>"""
Test suite for the embedded <script> extraction
"""
from BeautifulSoup import BeautifulSoup
from nose.tools import raises, eq_
from csxj.datasources.parser_tools import media_utils
from csxj.datasources.parser_tools import twitter_utils
from tests.datas... | test_bad_query_url |
<|file_name|>Crypto.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import bcrypt
def hash_password(password):
default_rounds = 14
bcrypt_salt = bcrypt.gensalt(default_rounds)
hashed_password = bcrypt.hashpw(password, bcrypt_salt)
return hashed_password
def check_password(password, hashed):
return b... | |
<|file_name|>Crypto.py<|end_file_name|><|fim▁begin|>import bcrypt
def hash_password(password):
<|fim_middle|>
def check_password(password, hashed):
return bcrypt.checkpw(password, hashed)
<|fim▁end|> | default_rounds = 14
bcrypt_salt = bcrypt.gensalt(default_rounds)
hashed_password = bcrypt.hashpw(password, bcrypt_salt)
return hashed_password |
<|file_name|>Crypto.py<|end_file_name|><|fim▁begin|>import bcrypt
def hash_password(password):
default_rounds = 14
bcrypt_salt = bcrypt.gensalt(default_rounds)
hashed_password = bcrypt.hashpw(password, bcrypt_salt)
return hashed_password
def check_password(password, hashed):
<|fim_middle|>
<|fi... | return bcrypt.checkpw(password, hashed) |
<|file_name|>Crypto.py<|end_file_name|><|fim▁begin|>import bcrypt
def <|fim_middle|>(password):
default_rounds = 14
bcrypt_salt = bcrypt.gensalt(default_rounds)
hashed_password = bcrypt.hashpw(password, bcrypt_salt)
return hashed_password
def check_password(password, hashed):
return bcrypt.check... | hash_password |
<|file_name|>Crypto.py<|end_file_name|><|fim▁begin|>import bcrypt
def hash_password(password):
default_rounds = 14
bcrypt_salt = bcrypt.gensalt(default_rounds)
hashed_password = bcrypt.hashpw(password, bcrypt_salt)
return hashed_password
def <|fim_middle|>(password, hashed):
return bcrypt.checkp... | check_password |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University<|fim▁hole|>
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... |
# This file is part of the Pycornetto package. |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | """to prevent optparse from messing up the epilog text"""
def format_epilog(self, epilog):
return epilog or ""
def format_description(self, description):
return description.lstrip() |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | return epilog or "" |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | return description.lstrip() |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | opts.host = opts.host[7:] |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | prompt = "$ "
if opts.pretty_print is None:
opts.pretty_print = True
print startup_msg |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | opts.pretty_print = True |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | prompt = ""
if opts.pretty_print is None:
opts.pretty_print = False |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | opts.pretty_print = False |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | process = lambda c: eval('server.ask("%s")' % c.strip()) |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | process = lambda c: eval("server." + c.strip()) |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | formatter = pformat |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | formatter = repr |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | rint help_text
|
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | esult = process(command)
print encoder(formatter(result))
|
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | format_epilog |
<|file_name|>cornetto-client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2013 by
# Erwin Marsi and Tilburg University
# This file is part of the Pycornetto package.
# Pycornetto is free software; you can redistribute it and/or modify
# it under the terms of th... | format_description |
<|file_name|>UART01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# uart-eg01.py
#
# to run on the other end of the UART
# screen /dev/ttyUSB1 115200
import serial
def readlineCR(uart):
line = b''
while True:
byte = uart.read()
line += byte<|fim▁hole|>
uart = serial.Serial('/dev/ttyUSB0', baudrate=115200, t... | if byte == b'\r':
return line |
<|file_name|>UART01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# uart-eg01.py
#
# to run on the other end of the UART
# screen /dev/ttyUSB1 115200
import serial
def readlineCR(uart):
<|fim_middle|>
uart = serial.Serial('/dev/ttyUSB0', baudrate=115200, timeout=1)
while True:
uart.write(b'\r\nSay something:... | line = b''
while True:
byte = uart.read()
line += byte
if byte == b'\r':
return line |
<|file_name|>UART01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# uart-eg01.py
#
# to run on the other end of the UART
# screen /dev/ttyUSB1 115200
import serial
def readlineCR(uart):
line = b''
while True:
byte = uart.read()
line += byte
if byte == b'\r':
<|fim_middle|>
uart = serial.Serial('/d... | return line |
<|file_name|>UART01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# uart-eg01.py
#
# to run on the other end of the UART
# screen /dev/ttyUSB1 115200
import serial
def readlineCR(uart):
line = b''
while True:
byte = uart.read()
line += byte
if byte == b'\r':
return line
uart = serial.Serial('/dev/ttyU... | lineStr = '\r\nYou sent : {}'.format(line.decode('utf-8'))
uart.write(lineStr.encode('utf-8')) |
<|file_name|>UART01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# uart-eg01.py
#
# to run on the other end of the UART
# screen /dev/ttyUSB1 115200
import serial
def readlineCR(uart):
line = b''
while True:
byte = uart.read()
line += byte
if byte == b'\r':
return line
uart = serial.Serial('/dev/ttyU... | uart.write(b'\r\nexiting\r\n')
uart.close()
exit(0) |
<|file_name|>UART01.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# uart-eg01.py
#
# to run on the other end of the UART
# screen /dev/ttyUSB1 115200
import serial
def <|fim_middle|>(uart):
line = b''
while True:
byte = uart.read()
line += byte
if byte == b'\r':
return line
uart = serial.Serial('/dev/... | readlineCR |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | #print(tc.foo)
#print(dir(tc)) |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
<|fim_middle|>
tc = TestClass(1,2)
print(tc.foo)
print(tc.bar)
tc.test_method('foo')
#print(tc.foo)
#print(dir(tc))
<|fim▁end|> | def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
return locals()
foo = property(**foo())
def bar():
doc = "The bar property."
... |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
<|fim_middle|>
foo = property(**foo())
def bar():
doc = "The bar property."
def fget(self):
return self._bar
def fset(self, value):
... | doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
return locals() |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
<|fim_middle|>
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | return self._foo |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
<|fim_middle|>
def fdel(self):
del self._foo
... | self._foo = value |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
<|fim_middle|>
... | del self._foo |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | doc = "The bar property."
def fget(self):
return self._bar
def fset(self, value):
self._bar = value
def fdel(self):
del self._bar
return locals() |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | return self._bar |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | self._bar = value |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | del self._bar |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | self.foo = "foo"
self.bar = "bar" |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | if attr == 1:
prop = self.foo
else:
prop = self.bar
print(prop)
prop = 'TADA!' |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | prop = self.foo |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | prop = self.bar |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def <|fim_middle|>():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del ... | foo |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def <|fim_middle|>(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del s... | fget |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def <|fim_middle|>(self, value):
self._foo = value
def fdel(self):
del s... | fset |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def <|fim_middle|>(self):
del s... | fdel |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | bar |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | fget |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | fset |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | fdel |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | __init__ |
<|file_name|>proptest.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
class TestClass(object):
def foo():
doc = "The foo property."
def fget(self):
return self._foo
def fset(self, value):
self._foo = value
def fdel(self):
del self._foo
... | test_method |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class InstantMsg(Split):
class left(T... | from .tile import Split, Stack, TileStack |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
<|fim_middle|>
class Max(Split):
class main(Stack):
tile = False
class InstantMsg(Split):
class left(TileStack): # or maybe not tiled ?
weight = 3
class roster(St... | class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
<|fim_middle|>
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class InstantMsg(Split):
class left(TileS... | weight = 3
priority = 0
limit = 1 |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
<|fim_middle|>
class Max(Split):
class main(Stack):
tile = False
c... | pass |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
<|fim_middle|>
class InstantMsg(Split):
class ... | class main(Stack):
tile = False |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
<|fim_middle|>
class Ins... | tile = False |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | class left(TileStack): # or maybe not tiled ?
weight = 3
class roster(Stack):
limit = 1
priority = 0 # probably roster created first |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | weight = 3 |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | limit = 1
priority = 0 # probably roster created first |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | class toolbox(Stack):
limit = 1
size = 184
class main(Stack):
weight = 4
priority = 0
class dock(Stack):
limit = 1
size = 324 |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | limit = 1
size = 184 |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | weight = 4
priority = 0 |
<|file_name|>examples.py<|end_file_name|><|fim▁begin|>from .tile import Split, Stack, TileStack
class Tile(Split):
class left(Stack):
weight = 3
priority = 0
limit = 1
class right(TileStack):
pass
class Max(Split):
class main(Stack):
tile = False
class Instan... | limit = 1
size = 324 |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension<|fim▁hole|>from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETT... | |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | """
This returns the landing URL (e.g., where the user will be forwarded).
"""
return url_for('.lab') |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | """
In this code, you can do something to setup the experiment. It is
called for every user, before they start using it.
"""
print("New user!")
print(weblab_user) |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | """
In this code, you can do something to clean up the experiment. It is
guaranteed to be run.
"""
print("User expired. Here you should clean resources")
print(weblab_user) |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | """
This is your code. If you provide @requires_active to any other URL, it is secured.
"""
user = weblab_user
return "Hello %s. You didn't poll in %.2f seconds (timeout configured to %s). Total time left: %s" % (user.username, user.time_without_polling, weblab.timeout, user.time_left) |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | return "<html><head></head><body><a href='{}'>Access to the lab</a></body></html>".format(url_for('.lab')) |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | print("Run the following:")
print()
print(" (optionally) $ export FLASK_DEBUG=1")
print(" $ export FLASK_APP={}".format(__file__))
print(" $ flask run")
print() |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | initial_url |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | on_start |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | on_stop |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | lab |
<|file_name|>example.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import time
from flask import Flask, session, url_for
from flask_debugtoolbar import DebugToolbarExtension
from weblablib import WebLab, requires_active, weblab_user, poll
app = Flask(__name__)
# XXX: IMPORTANT SETTINGS TO CHA... | index |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b': ... |
def _plot_subplot(graph, new_nodes, prog, type_format, axes):
""" |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | """
Display the results using matplotlib.
"""
if not size:
size = _get_size(len(graphs))
fig, axarr = plt.subplots(size[0], size[1], figsize=(18, 10))
fig.set_facecolor('white')
x_val = 0
y_val = 0
index = 0
if size[0] == 1:
axarr = np.array(axarr).reshape((1, si... |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | """
Plot a single candidate graph.
"""
pos = nx.nx_agraph.graphviz_layout(graph, prog=prog)
# draw the nodes
for node, values in graph.nodes(data=True):
shape = 'o'
if values[stitcher.TYPE_ATTR] in type_format:
shape = type_format[values[stitcher.TYPE_ATTR]]
... |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | """
Show the candidates in 3d - the request elevated above the container.
"""
fig = plt.figure(figsize=(18, 10))
fig.set_facecolor('white')
i = 0
size = _get_size(len(graphs))
for graph in graphs:
axes = fig.add_subplot(size[0], size[1], i+1,
proj... |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | """
Plot a single candidate graph in 3d.
"""
cache = {}
tmp = graph.copy()
for node in request.nodes():
tmp.remove_node(node)
pos = nx.nx_agraph.graphviz_layout(tmp, prog=prog)
# the container
for item in tmp.nodes():
axes.plot([pos[item][0]], [pos[item][1]], [0], ... |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | """
Calculate the size of the subplot layouts based on number of items.
"""
n_cols = math.ceil(math.sqrt(n_items))
n_rows = math.floor(math.sqrt(n_items))
if n_cols * n_rows < n_items:
n_cols += 1
return int(n_rows), int(n_cols) |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | size = _get_size(len(graphs)) |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | axarr = np.array(axarr).reshape((1, size[1])) |
<|file_name|>vis.py<|end_file_name|><|fim▁begin|>
"""
Visualize possible stitches with the outcome of the validator.
"""
import math
import random
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import stitcher
SPACE = 25
TYPE_FORMAT = {'a': '^', 'b':... | type_format = TYPE_FORMAT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.