labNo float64 1 10 ⌀ | taskNo float64 0 4 ⌀ | questioner stringclasses 2
values | question stringlengths 9 201 | code stringlengths 18 30.3k | startLine float64 0 192 ⌀ | endLine float64 0 196 ⌀ | questionType stringclasses 4
values | answer stringlengths 2 905 | src stringclasses 3
values | code_processed stringlengths 12 28.3k ⌀ | id stringlengths 2 5 ⌀ | raw_code stringlengths 20 30.3k ⌀ | raw_comment stringlengths 10 242 ⌀ | comment stringlengths 9 207 ⌀ | q_code stringlengths 66 30.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
null | null | null | What did the code require ?
| def register(linter):
linter.register_checker(ImportsChecker(linter))
| null | null | null | method to auto register this checker
| codeqa | def register linter linter register checker Imports Checker linter
| null | null | null | null | Question:
What did the code require ?
Code:
def register(linter):
linter.register_checker(ImportsChecker(linter))
|
null | null | null | Did the code require method to auto register this checker ?
| def register(linter):
linter.register_checker(ImportsChecker(linter))
| null | null | null | Yes
| codeqa | def register linter linter register checker Imports Checker linter
| null | null | null | null | Question:
Did the code require method to auto register this checker ?
Code:
def register(linter):
linter.register_checker(ImportsChecker(linter))
|
null | null | null | What should render its video output where ?
| def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawable)
| null | null | null | the media player
| codeqa | def libvlc media player set xwindow p mi drawable f Cfunctions get 'libvlc media player set xwindow' None or Cfunction 'libvlc media player set xwindow' 1 1 None None Media Player ctypes c uint 32 return f p mi drawable
| null | null | null | null | Question:
What should render its video output where ?
Code:
def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawable)
|
null | null | null | Where should the media player render its video output ?
| def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawable)
| null | null | null | where
| codeqa | def libvlc media player set xwindow p mi drawable f Cfunctions get 'libvlc media player set xwindow' None or Cfunction 'libvlc media player set xwindow' 1 1 None None Media Player ctypes c uint 32 return f p mi drawable
| null | null | null | null | Question:
Where should the media player render its video output ?
Code:
def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawab... |
null | null | null | Should the media player render its video output where ?
| def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawable)
| null | null | null | Yes
| codeqa | def libvlc media player set xwindow p mi drawable f Cfunctions get 'libvlc media player set xwindow' None or Cfunction 'libvlc media player set xwindow' 1 1 None None Media Player ctypes c uint 32 return f p mi drawable
| null | null | null | null | Question:
Should the media player render its video output where ?
Code:
def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawab... |
null | null | null | What should the media player render where ?
| def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawable)
| null | null | null | its video output
| codeqa | def libvlc media player set xwindow p mi drawable f Cfunctions get 'libvlc media player set xwindow' None or Cfunction 'libvlc media player set xwindow' 1 1 None None Media Player ctypes c uint 32 return f p mi drawable
| null | null | null | null | Question:
What should the media player render where ?
Code:
def libvlc_media_player_set_xwindow(p_mi, drawable):
f = (_Cfunctions.get('libvlc_media_player_set_xwindow', None) or _Cfunction('libvlc_media_player_set_xwindow', ((1,), (1,)), None, None, MediaPlayer, ctypes.c_uint32))
return f(p_mi, drawable)
|
null | null | null | Does the code get a clipped loop path ?
| def getClippedLoopPath(clip, loopPath):
if (clip <= 0.0):
return loopPath
loopPathLength = getPathLength(loopPath)
clip = min(clip, (0.3 * loopPathLength))
lastLength = 0.0
pointIndex = 0
totalLength = 0.0
while ((totalLength < clip) and (pointIndex < (len(loopPath) - 1))):
firstPoint = loopPath[pointIndex]
... | null | null | null | Yes
| codeqa | def get Clipped Loop Path clip loop Path if clip < 0 0 return loop Pathloop Path Length get Path Length loop Path clip min clip 0 3 * loop Path Length last Length 0 0point Index 0total Length 0 0while total Length < clip and point Index < len loop Path - 1 first Point loop Path[point Index]second Point loop Path[ point... | null | null | null | null | Question:
Does the code get a clipped loop path ?
Code:
def getClippedLoopPath(clip, loopPath):
if (clip <= 0.0):
return loopPath
loopPathLength = getPathLength(loopPath)
clip = min(clip, (0.3 * loopPathLength))
lastLength = 0.0
pointIndex = 0
totalLength = 0.0
while ((totalLength < clip) and (pointIndex <... |
null | null | null | What does the code get ?
| def getClippedLoopPath(clip, loopPath):
if (clip <= 0.0):
return loopPath
loopPathLength = getPathLength(loopPath)
clip = min(clip, (0.3 * loopPathLength))
lastLength = 0.0
pointIndex = 0
totalLength = 0.0
while ((totalLength < clip) and (pointIndex < (len(loopPath) - 1))):
firstPoint = loopPath[pointIndex]
... | null | null | null | a clipped loop path
| codeqa | def get Clipped Loop Path clip loop Path if clip < 0 0 return loop Pathloop Path Length get Path Length loop Path clip min clip 0 3 * loop Path Length last Length 0 0point Index 0total Length 0 0while total Length < clip and point Index < len loop Path - 1 first Point loop Path[point Index]second Point loop Path[ point... | null | null | null | null | Question:
What does the code get ?
Code:
def getClippedLoopPath(clip, loopPath):
if (clip <= 0.0):
return loopPath
loopPathLength = getPathLength(loopPath)
clip = min(clip, (0.3 * loopPathLength))
lastLength = 0.0
pointIndex = 0
totalLength = 0.0
while ((totalLength < clip) and (pointIndex < (len(loopPath)... |
null | null | null | Does the code turn a 1-hot encoding or a probability distribution over the possible characters back into its character representation ?
| def characters(probabilities):
return [id2bi(c) for c in np.argmax(probabilities, 1)]
| null | null | null | Yes
| codeqa | def characters probabilities return [id 2 bi c for c in np argmax probabilities 1 ]
| null | null | null | null | Question:
Does the code turn a 1-hot encoding or a probability distribution over the possible characters back into its character representation ?
Code:
def characters(probabilities):
return [id2bi(c) for c in np.argmax(probabilities, 1)]
|
null | null | null | What does the code turn back into its character representation ?
| def characters(probabilities):
return [id2bi(c) for c in np.argmax(probabilities, 1)]
| null | null | null | a 1-hot encoding or a probability distribution over the possible characters
| codeqa | def characters probabilities return [id 2 bi c for c in np argmax probabilities 1 ]
| null | null | null | null | Question:
What does the code turn back into its character representation ?
Code:
def characters(probabilities):
return [id2bi(c) for c in np.argmax(probabilities, 1)]
|
null | null | null | Does the code run the main command - line interface for beets ?
| def main(args=None):
try:
_raw_main(args)
except UserError as exc:
message = (exc.args[0] if exc.args else None)
log.error(u'error: {0}'.format(message))
sys.exit(1)
except util.HumanReadableException as exc:
exc.log(log)
sys.exit(1)
except library.FileOperationError as exc:
log.debug(traceback.forma... | null | null | null | Yes
| codeqa | def main args None try raw main args except User Error as exc message exc args[ 0 ] if exc args else None log error u'error {0 }' format message sys exit 1 except util Human Readable Exception as exc exc log log sys exit 1 except library File Operation Error as exc log debug traceback format exc log error exc sys exit ... | null | null | null | null | Question:
Does the code run the main command - line interface for beets ?
Code:
def main(args=None):
try:
_raw_main(args)
except UserError as exc:
message = (exc.args[0] if exc.args else None)
log.error(u'error: {0}'.format(message))
sys.exit(1)
except util.HumanReadableException as exc:
exc.log(log)
... |
null | null | null | What does the code run ?
| def main(args=None):
try:
_raw_main(args)
except UserError as exc:
message = (exc.args[0] if exc.args else None)
log.error(u'error: {0}'.format(message))
sys.exit(1)
except util.HumanReadableException as exc:
exc.log(log)
sys.exit(1)
except library.FileOperationError as exc:
log.debug(traceback.forma... | null | null | null | the main command - line interface for beets
| codeqa | def main args None try raw main args except User Error as exc message exc args[ 0 ] if exc args else None log error u'error {0 }' format message sys exit 1 except util Human Readable Exception as exc exc log log sys exit 1 except library File Operation Error as exc log debug traceback format exc log error exc sys exit ... | null | null | null | null | Question:
What does the code run ?
Code:
def main(args=None):
try:
_raw_main(args)
except UserError as exc:
message = (exc.args[0] if exc.args else None)
log.error(u'error: {0}'.format(message))
sys.exit(1)
except util.HumanReadableException as exc:
exc.log(log)
sys.exit(1)
except library.FileOpera... |
null | null | null | What is expected where ?
| def LoadAppInclude(app_include):
builder = yaml_object.ObjectBuilder(AppInclude)
handler = yaml_builder.BuilderHandler(builder)
listener = yaml_listener.EventListener(handler)
listener.Parse(app_include)
includes = handler.GetResults()
if (len(includes) < 1):
raise appinfo_errors.EmptyConfigurationFile()
if (l... | null | null | null | one and only one
| codeqa | def Load App Include app include builder yaml object Object Builder App Include handler yaml builder Builder Handler builder listener yaml listener Event Listener handler listener Parse app include includes handler Get Results if len includes < 1 raise appinfo errors Empty Configuration File if len includes > 1 raise a... | null | null | null | null | Question:
What is expected where ?
Code:
def LoadAppInclude(app_include):
builder = yaml_object.ObjectBuilder(AppInclude)
handler = yaml_builder.BuilderHandler(builder)
listener = yaml_listener.EventListener(handler)
listener.Parse(app_include)
includes = handler.GetResults()
if (len(includes) < 1):
raise a... |
null | null | null | Where is one and only one expected ?
| def LoadAppInclude(app_include):
builder = yaml_object.ObjectBuilder(AppInclude)
handler = yaml_builder.BuilderHandler(builder)
listener = yaml_listener.EventListener(handler)
listener.Parse(app_include)
includes = handler.GetResults()
if (len(includes) < 1):
raise appinfo_errors.EmptyConfigurationFile()
if (l... | null | null | null | where
| codeqa | def Load App Include app include builder yaml object Object Builder App Include handler yaml builder Builder Handler builder listener yaml listener Event Listener handler listener Parse app include includes handler Get Results if len includes < 1 raise appinfo errors Empty Configuration File if len includes > 1 raise a... | null | null | null | null | Question:
Where is one and only one expected ?
Code:
def LoadAppInclude(app_include):
builder = yaml_object.ObjectBuilder(AppInclude)
handler = yaml_builder.BuilderHandler(builder)
listener = yaml_listener.EventListener(handler)
listener.Parse(app_include)
includes = handler.GetResults()
if (len(includes) < 1... |
null | null | null | Is one and only one expected where ?
| def LoadAppInclude(app_include):
builder = yaml_object.ObjectBuilder(AppInclude)
handler = yaml_builder.BuilderHandler(builder)
listener = yaml_listener.EventListener(handler)
listener.Parse(app_include)
includes = handler.GetResults()
if (len(includes) < 1):
raise appinfo_errors.EmptyConfigurationFile()
if (l... | null | null | null | Yes
| codeqa | def Load App Include app include builder yaml object Object Builder App Include handler yaml builder Builder Handler builder listener yaml listener Event Listener handler listener Parse app include includes handler Get Results if len includes < 1 raise appinfo errors Empty Configuration File if len includes > 1 raise a... | null | null | null | null | Question:
Is one and only one expected where ?
Code:
def LoadAppInclude(app_include):
builder = yaml_object.ObjectBuilder(AppInclude)
handler = yaml_builder.BuilderHandler(builder)
listener = yaml_listener.EventListener(handler)
listener.Parse(app_include)
includes = handler.GetResults()
if (len(includes) < 1... |
null | null | null | What does the code get ?
| def get_current_traceback(ignore_system_exceptions=False, show_hidden_frames=False, skip=0):
(exc_type, exc_value, tb) = sys.exc_info()
if (ignore_system_exceptions and (exc_type in system_exceptions)):
raise
for x in xrange(skip):
if (tb.tb_next is None):
break
tb = tb.tb_next
tb = Traceback(exc_type, exc... | null | null | null | the current exception info
| codeqa | def get current traceback ignore system exceptions False show hidden frames False skip 0 exc type exc value tb sys exc info if ignore system exceptions and exc type in system exceptions raisefor x in xrange skip if tb tb next is None breaktb tb tb nexttb Traceback exc type exc value tb if not show hidden frames tb filt... | null | null | null | null | Question:
What does the code get ?
Code:
def get_current_traceback(ignore_system_exceptions=False, show_hidden_frames=False, skip=0):
(exc_type, exc_value, tb) = sys.exc_info()
if (ignore_system_exceptions and (exc_type in system_exceptions)):
raise
for x in xrange(skip):
if (tb.tb_next is None):
break
... |
null | null | null | Does the code get the current exception info ?
| def get_current_traceback(ignore_system_exceptions=False, show_hidden_frames=False, skip=0):
(exc_type, exc_value, tb) = sys.exc_info()
if (ignore_system_exceptions and (exc_type in system_exceptions)):
raise
for x in xrange(skip):
if (tb.tb_next is None):
break
tb = tb.tb_next
tb = Traceback(exc_type, exc... | null | null | null | Yes
| codeqa | def get current traceback ignore system exceptions False show hidden frames False skip 0 exc type exc value tb sys exc info if ignore system exceptions and exc type in system exceptions raisefor x in xrange skip if tb tb next is None breaktb tb tb nexttb Traceback exc type exc value tb if not show hidden frames tb filt... | null | null | null | null | Question:
Does the code get the current exception info ?
Code:
def get_current_traceback(ignore_system_exceptions=False, show_hidden_frames=False, skip=0):
(exc_type, exc_value, tb) = sys.exc_info()
if (ignore_system_exceptions and (exc_type in system_exceptions)):
raise
for x in xrange(skip):
if (tb.tb_next... |
null | null | null | When do things set ?
| def post_begin():
for fn in post_configure:
fn(options, file_config)
global util, fixtures, engines, exclusions, assertions, warnings, profiling, config, testing
from sqlalchemy import testing
from sqlalchemy.testing import fixtures, engines, exclusions, assertions, warnings, profiling, config
from sqlalchemy im... | null | null | null | later
| codeqa | def post begin for fn in post configure fn options file config global util fixtures engines exclusions assertions warnings profiling config testingfrom sqlalchemy import testingfrom sqlalchemy testing import fixtures engines exclusions assertions warnings profiling configfrom sqlalchemy import util
| null | null | null | null | Question:
When do things set ?
Code:
def post_begin():
for fn in post_configure:
fn(options, file_config)
global util, fixtures, engines, exclusions, assertions, warnings, profiling, config, testing
from sqlalchemy import testing
from sqlalchemy.testing import fixtures, engines, exclusions, assertions, warnin... |
null | null | null | What is making this request ?
| def is_current_user_admin():
return (os.environ.get('USER_IS_ADMIN', '0') == '1')
| null | null | null | the user
| codeqa | def is current user admin return os environ get 'USER IS ADMIN' '0 ' '1 '
| null | null | null | null | Question:
What is making this request ?
Code:
def is_current_user_admin():
return (os.environ.get('USER_IS_ADMIN', '0') == '1')
|
null | null | null | What does the code create ?
| def new_figure_manager_given_figure(num, figure):
canvas = FigureCanvasAgg(figure)
manager = FigureManagerBase(canvas, num)
return manager
| null | null | null | a new figure manager instance for the given figure
| codeqa | def new figure manager given figure num figure canvas Figure Canvas Agg figure manager Figure Manager Base canvas num return manager
| null | null | null | null | Question:
What does the code create ?
Code:
def new_figure_manager_given_figure(num, figure):
canvas = FigureCanvasAgg(figure)
manager = FigureManagerBase(canvas, num)
return manager
|
null | null | null | Does the code create a new figure manager instance for the given figure ?
| def new_figure_manager_given_figure(num, figure):
canvas = FigureCanvasAgg(figure)
manager = FigureManagerBase(canvas, num)
return manager
| null | null | null | Yes
| codeqa | def new figure manager given figure num figure canvas Figure Canvas Agg figure manager Figure Manager Base canvas num return manager
| null | null | null | null | Question:
Does the code create a new figure manager instance for the given figure ?
Code:
def new_figure_manager_given_figure(num, figure):
canvas = FigureCanvasAgg(figure)
manager = FigureManagerBase(canvas, num)
return manager
|
null | null | null | When did the system boot time express in seconds ?
| def boot_time():
global BOOT_TIME
with open_binary(('%s/stat' % get_procfs_path())) as f:
for line in f:
if line.startswith('btime'):
ret = float(line.strip().split()[1])
BOOT_TIME = ret
return ret
raise RuntimeError(("line 'btime' not found in %s/stat" % get_procfs_path()))
| null | null | null | since the epoch
| codeqa | def boot time global BOOT TIM Ewith open binary '%s/stat' % get procfs path as f for line in f if line startswith 'btime' ret float line strip split [1 ] BOOT TIME retreturn retraise Runtime Error "line'btime'notfoundin%s/stat" % get procfs path
| null | null | null | null | Question:
When did the system boot time express in seconds ?
Code:
def boot_time():
global BOOT_TIME
with open_binary(('%s/stat' % get_procfs_path())) as f:
for line in f:
if line.startswith('btime'):
ret = float(line.strip().split()[1])
BOOT_TIME = ret
return ret
raise RuntimeError(("line 'bt... |
null | null | null | How did the system boot time express since the epoch ?
| def boot_time():
global BOOT_TIME
with open_binary(('%s/stat' % get_procfs_path())) as f:
for line in f:
if line.startswith('btime'):
ret = float(line.strip().split()[1])
BOOT_TIME = ret
return ret
raise RuntimeError(("line 'btime' not found in %s/stat" % get_procfs_path()))
| null | null | null | in seconds
| codeqa | def boot time global BOOT TIM Ewith open binary '%s/stat' % get procfs path as f for line in f if line startswith 'btime' ret float line strip split [1 ] BOOT TIME retreturn retraise Runtime Error "line'btime'notfoundin%s/stat" % get procfs path
| null | null | null | null | Question:
How did the system boot time express since the epoch ?
Code:
def boot_time():
global BOOT_TIME
with open_binary(('%s/stat' % get_procfs_path())) as f:
for line in f:
if line.startswith('btime'):
ret = float(line.strip().split()[1])
BOOT_TIME = ret
return ret
raise RuntimeError(("line ... |
null | null | null | What may a string contain ?
| def unescape(s):
assert isinstance(s, basestring)
s = s.replace(' DCTB ', ',')
s = s.replace('\\,', ',')
s = s.replace('\\n', '\n')
s = s.replace('\\\\', '\\')
return s
| null | null | null | commas
| codeqa | def unescape s assert isinstance s basestring s s replace ' DCTB ' ' ' s s replace '\\ ' ' ' s s replace '\\n' '\n' s s replace '\\\\' '\\' return s
| null | null | null | null | Question:
What may a string contain ?
Code:
def unescape(s):
assert isinstance(s, basestring)
s = s.replace(' DCTB ', ',')
s = s.replace('\\,', ',')
s = s.replace('\\n', '\n')
s = s.replace('\\\\', '\\')
return s
|
null | null | null | May a string contain commas ?
| def unescape(s):
assert isinstance(s, basestring)
s = s.replace(' DCTB ', ',')
s = s.replace('\\,', ',')
s = s.replace('\\n', '\n')
s = s.replace('\\\\', '\\')
return s
| null | null | null | Yes
| codeqa | def unescape s assert isinstance s basestring s s replace ' DCTB ' ' ' s s replace '\\ ' ' ' s s replace '\\n' '\n' s s replace '\\\\' '\\' return s
| null | null | null | null | Question:
May a string contain commas ?
Code:
def unescape(s):
assert isinstance(s, basestring)
s = s.replace(' DCTB ', ',')
s = s.replace('\\,', ',')
s = s.replace('\\n', '\n')
s = s.replace('\\\\', '\\')
return s
|
null | null | null | What may contain commas ?
| def unescape(s):
assert isinstance(s, basestring)
s = s.replace(' DCTB ', ',')
s = s.replace('\\,', ',')
s = s.replace('\\n', '\n')
s = s.replace('\\\\', '\\')
return s
| null | null | null | a string
| codeqa | def unescape s assert isinstance s basestring s s replace ' DCTB ' ' ' s s replace '\\ ' ' ' s s replace '\\n' '\n' s s replace '\\\\' '\\' return s
| null | null | null | null | Question:
What may contain commas ?
Code:
def unescape(s):
assert isinstance(s, basestring)
s = s.replace(' DCTB ', ',')
s = s.replace('\\,', ',')
s = s.replace('\\n', '\n')
s = s.replace('\\\\', '\\')
return s
|
null | null | null | How did the percentage change when switching tabs ?
| def test_tab_change(percentage, fake_web_tab):
percentage.set_perc(x=None, y=10)
tab = fake_web_tab(scroll_pos_perc=(0, 20))
percentage.on_tab_changed(tab)
assert (percentage.text() == '[20%]')
| null | null | null | correctly
| codeqa | def test tab change percentage fake web tab percentage set perc x None y 10 tab fake web tab scroll pos perc 0 20 percentage on tab changed tab assert percentage text '[ 20 %]'
| null | null | null | null | Question:
How did the percentage change when switching tabs ?
Code:
def test_tab_change(percentage, fake_web_tab):
percentage.set_perc(x=None, y=10)
tab = fake_web_tab(scroll_pos_perc=(0, 20))
percentage.on_tab_changed(tab)
assert (percentage.text() == '[20%]')
|
null | null | null | When did the percentage change correctly ?
| def test_tab_change(percentage, fake_web_tab):
percentage.set_perc(x=None, y=10)
tab = fake_web_tab(scroll_pos_perc=(0, 20))
percentage.on_tab_changed(tab)
assert (percentage.text() == '[20%]')
| null | null | null | when switching tabs
| codeqa | def test tab change percentage fake web tab percentage set perc x None y 10 tab fake web tab scroll pos perc 0 20 percentage on tab changed tab assert percentage text '[ 20 %]'
| null | null | null | null | Question:
When did the percentage change correctly ?
Code:
def test_tab_change(percentage, fake_web_tab):
percentage.set_perc(x=None, y=10)
tab = fake_web_tab(scroll_pos_perc=(0, 20))
percentage.on_tab_changed(tab)
assert (percentage.text() == '[20%]')
|
null | null | null | Where is each node connected to all other nodes ?
| def is_clique(graph):
return (graph.density == 1.0)
| null | null | null | nodes
| codeqa | def is clique graph return graph density 1 0
| null | null | null | null | Question:
Where is each node connected to all other nodes ?
Code:
def is_clique(graph):
return (graph.density == 1.0)
|
null | null | null | Does the code get the max ?
| def getMax(value):
return max(value)
| null | null | null | Yes
| codeqa | def get Max value return max value
| null | null | null | null | Question:
Does the code get the max ?
Code:
def getMax(value):
return max(value)
|
null | null | null | What does the code get ?
| def getMax(value):
return max(value)
| null | null | null | the max
| codeqa | def get Max value return max value
| null | null | null | null | Question:
What does the code get ?
Code:
def getMax(value):
return max(value)
|
null | null | null | What is a dictionary of all the parameters for the media range the ?
| def parse_mime_type(mime_type):
parts = mime_type.split(';')
params = dict([tuple([s.strip() for s in param.split('=')]) for param in parts[1:]])
(type, subtype) = parts[0].split('/')
return (type.strip(), subtype.strip(), params)
| null | null | null | params
| codeqa | def parse mime type mime type parts mime type split ' ' params dict [tuple [s strip for s in param split ' ' ] for param in parts[ 1 ]] type subtype parts[ 0 ] split '/' return type strip subtype strip params
| null | null | null | null | Question:
What is a dictionary of all the parameters for the media range the ?
Code:
def parse_mime_type(mime_type):
parts = mime_type.split(';')
params = dict([tuple([s.strip() for s in param.split('=')]) for param in parts[1:]])
(type, subtype) = parts[0].split('/')
return (type.strip(), subtype.strip(), para... |
null | null | null | What has no factors over its domain ?
| def dup_irreducible_p(f, K):
return dmp_irreducible_p(f, 0, K)
| null | null | null | f
| codeqa | def dup irreducible p f K return dmp irreducible p f 0 K
| null | null | null | null | Question:
What has no factors over its domain ?
Code:
def dup_irreducible_p(f, K):
return dmp_irreducible_p(f, 0, K)
|
null | null | null | Does f have no factors over its domain ?
| def dup_irreducible_p(f, K):
return dmp_irreducible_p(f, 0, K)
| null | null | null | Yes
| codeqa | def dup irreducible p f K return dmp irreducible p f 0 K
| null | null | null | null | Question:
Does f have no factors over its domain ?
Code:
def dup_irreducible_p(f, K):
return dmp_irreducible_p(f, 0, K)
|
null | null | null | What does f have ?
| def dup_irreducible_p(f, K):
return dmp_irreducible_p(f, 0, K)
| null | null | null | no factors over its domain
| codeqa | def dup irreducible p f K return dmp irreducible p f 0 K
| null | null | null | null | Question:
What does f have ?
Code:
def dup_irreducible_p(f, K):
return dmp_irreducible_p(f, 0, K)
|
null | null | null | For what purpose is this function called ?
| def check_auth(username, password):
return ((username == 'admin') and (password == 'secret'))
| null | null | null | to check if a username / password combination is valid
| codeqa | def check auth username password return username 'admin' and password 'secret'
| null | null | null | null | Question:
For what purpose is this function called ?
Code:
def check_auth(username, password):
return ((username == 'admin') and (password == 'secret'))
|
null | null | null | What does the code get ?
| def getTetragridCopy(tetragrid):
tetragridCopy = []
for tetragridRow in tetragrid:
tetragridCopy.append(tetragridRow[:])
return tetragridCopy
| null | null | null | tetragrid copy
| codeqa | def get Tetragrid Copy tetragrid tetragrid Copy []for tetragrid Row in tetragrid tetragrid Copy append tetragrid Row[ ] return tetragrid Copy
| null | null | null | null | Question:
What does the code get ?
Code:
def getTetragridCopy(tetragrid):
tetragridCopy = []
for tetragridRow in tetragrid:
tetragridCopy.append(tetragridRow[:])
return tetragridCopy
|
null | null | null | By how much did color saturate ?
| def saturate(color):
return set_hls_values(color, s=1)
| null | null | null | fully
| codeqa | def saturate color return set hls values color s 1
| null | null | null | null | Question:
By how much did color saturate ?
Code:
def saturate(color):
return set_hls_values(color, s=1)
|
null | null | null | Does a step definition call another step definition with behave_as when ?
| @with_setup(step_runner_environ)
def test_failing_behave_as_step_doesnt_pass():
runnable_step = Step.from_string('Given I have a step which calls the "other step fails" step with behave_as')
try:
runnable_step.run(True)
except:
pass
assert_false(runnable_step.passed)
| null | null | null | Yes
| codeqa | @with setup step runner environ def test failing behave as step doesnt pass runnable step Step from string ' Given Ihaveastepwhichcallsthe"otherstepfails"stepwithbehave as' try runnable step run True except passassert false runnable step passed
| null | null | null | null | Question:
Does a step definition call another step definition with behave_as when ?
Code:
@with_setup(step_runner_environ)
def test_failing_behave_as_step_doesnt_pass():
runnable_step = Step.from_string('Given I have a step which calls the "other step fails" step with behave_as')
try:
runnable_step... |
null | null | null | What does a step definition call when ?
| @with_setup(step_runner_environ)
def test_failing_behave_as_step_doesnt_pass():
runnable_step = Step.from_string('Given I have a step which calls the "other step fails" step with behave_as')
try:
runnable_step.run(True)
except:
pass
assert_false(runnable_step.passed)
| null | null | null | another step definition with behave_as
| codeqa | @with setup step runner environ def test failing behave as step doesnt pass runnable step Step from string ' Given Ihaveastepwhichcallsthe"otherstepfails"stepwithbehave as' try runnable step run True except passassert false runnable step passed
| null | null | null | null | Question:
What does a step definition call when ?
Code:
@with_setup(step_runner_environ)
def test_failing_behave_as_step_doesnt_pass():
runnable_step = Step.from_string('Given I have a step which calls the "other step fails" step with behave_as')
try:
runnable_step.run(True)
except:
pass
assert... |
null | null | null | What calls another step definition with behave_as when ?
| @with_setup(step_runner_environ)
def test_failing_behave_as_step_doesnt_pass():
runnable_step = Step.from_string('Given I have a step which calls the "other step fails" step with behave_as')
try:
runnable_step.run(True)
except:
pass
assert_false(runnable_step.passed)
| null | null | null | a step definition
| codeqa | @with setup step runner environ def test failing behave as step doesnt pass runnable step Step from string ' Given Ihaveastepwhichcallsthe"otherstepfails"stepwithbehave as' try runnable step run True except passassert false runnable step passed
| null | null | null | null | Question:
What calls another step definition with behave_as when ?
Code:
@with_setup(step_runner_environ)
def test_failing_behave_as_step_doesnt_pass():
runnable_step = Step.from_string('Given I have a step which calls the "other step fails" step with behave_as')
try:
runnable_step.run(True)
excep... |
null | null | null | Does the code get new derivation ?
| def getNewDerivation(elementNode, prefix, sideLength):
return BevelDerivation(elementNode, prefix, sideLength)
| null | null | null | Yes
| codeqa | def get New Derivation element Node prefix side Length return Bevel Derivation element Node prefix side Length
| null | null | null | null | Question:
Does the code get new derivation ?
Code:
def getNewDerivation(elementNode, prefix, sideLength):
return BevelDerivation(elementNode, prefix, sideLength)
|
null | null | null | What does the code get ?
| def getNewDerivation(elementNode, prefix, sideLength):
return BevelDerivation(elementNode, prefix, sideLength)
| null | null | null | new derivation
| codeqa | def get New Derivation element Node prefix side Length return Bevel Derivation element Node prefix side Length
| null | null | null | null | Question:
What does the code get ?
Code:
def getNewDerivation(elementNode, prefix, sideLength):
return BevelDerivation(elementNode, prefix, sideLength)
|
null | null | null | Does the code start the named container ?
| def start(name, quiet=False, path=None):
data = _do_names(name, 'start', path=path)
if (data and (not quiet)):
__jid_event__.fire_event({'data': data, 'outputter': 'lxc_start'}, 'progress')
return data
| null | null | null | Yes
| codeqa | def start name quiet False path None data do names name 'start' path path if data and not quiet jid event fire event {'data' data 'outputter' 'lxc start'} 'progress' return data
| null | null | null | null | Question:
Does the code start the named container ?
Code:
def start(name, quiet=False, path=None):
data = _do_names(name, 'start', path=path)
if (data and (not quiet)):
__jid_event__.fire_event({'data': data, 'outputter': 'lxc_start'}, 'progress')
return data
|
null | null | null | What does the code start ?
| def start(name, quiet=False, path=None):
data = _do_names(name, 'start', path=path)
if (data and (not quiet)):
__jid_event__.fire_event({'data': data, 'outputter': 'lxc_start'}, 'progress')
return data
| null | null | null | the named container
| codeqa | def start name quiet False path None data do names name 'start' path path if data and not quiet jid event fire event {'data' data 'outputter' 'lxc start'} 'progress' return data
| null | null | null | null | Question:
What does the code start ?
Code:
def start(name, quiet=False, path=None):
data = _do_names(name, 'start', path=path)
if (data and (not quiet)):
__jid_event__.fire_event({'data': data, 'outputter': 'lxc_start'}, 'progress')
return data
|
null | null | null | What are set to run on boot ?
| def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
continue
if (not os.path.exists('{0}/etc/rc.conf.d/{1}... | null | null | null | what services
| codeqa | def get enabled jail None ret []service cmd jail prf get jail path jail if jail else '' for svc in salt ['cmd run'] '{ 0 }-e' format service splitlines ret append os path basename svc for svc in get all jail if svc in ret continueif not os path exists '{ 0 }/etc/rc conf d/{ 1 }' format prf svc continueif enabled svc ja... | null | null | null | null | Question:
What are set to run on boot ?
Code:
def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
contin... |
null | null | null | How did what services run ?
| def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
continue
if (not os.path.exists('{0}/etc/rc.conf.d/{1}... | null | null | null | on boot
| codeqa | def get enabled jail None ret []service cmd jail prf get jail path jail if jail else '' for svc in salt ['cmd run'] '{ 0 }-e' format service splitlines ret append os path basename svc for svc in get all jail if svc in ret continueif not os path exists '{ 0 }/etc/rc conf d/{ 1 }' format prf svc continueif enabled svc ja... | null | null | null | null | Question:
How did what services run ?
Code:
def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
continue... |
null | null | null | Are what services set to run on boot ?
| def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
continue
if (not os.path.exists('{0}/etc/rc.conf.d/{1}... | null | null | null | Yes
| codeqa | def get enabled jail None ret []service cmd jail prf get jail path jail if jail else '' for svc in salt ['cmd run'] '{ 0 }-e' format service splitlines ret append os path basename svc for svc in get all jail if svc in ret continueif not os path exists '{ 0 }/etc/rc conf d/{ 1 }' format prf svc continueif enabled svc ja... | null | null | null | null | Question:
Are what services set to run on boot ?
Code:
def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
... |
null | null | null | What are what services set ?
| def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
continue
if (not os.path.exists('{0}/etc/rc.conf.d/{1}... | null | null | null | to run on boot
| codeqa | def get enabled jail None ret []service cmd jail prf get jail path jail if jail else '' for svc in salt ['cmd run'] '{ 0 }-e' format service splitlines ret append os path basename svc for svc in get all jail if svc in ret continueif not os path exists '{ 0 }/etc/rc conf d/{ 1 }' format prf svc continueif enabled svc ja... | null | null | null | null | Question:
What are what services set ?
Code:
def get_enabled(jail=None):
ret = []
service = _cmd(jail)
prf = (_get_jail_path(jail) if jail else '')
for svc in __salt__['cmd.run']('{0} -e'.format(service)).splitlines():
ret.append(os.path.basename(svc))
for svc in get_all(jail):
if (svc in ret):
continu... |
null | null | null | What is starting at * node ?
| def increment_lineno(node, n=1):
if ('lineno' in node._attributes):
node.lineno = (getattr(node, 'lineno', 0) + n)
for child in walk(node):
if ('lineno' in child._attributes):
child.lineno = (getattr(child, 'lineno', 0) + n)
return node
| null | null | null | the tree
| codeqa | def increment lineno node n 1 if 'lineno' in node attributes node lineno getattr node 'lineno' 0 + n for child in walk node if 'lineno' in child attributes child lineno getattr child 'lineno' 0 + n return node
| null | null | null | null | Question:
What is starting at * node ?
Code:
def increment_lineno(node, n=1):
if ('lineno' in node._attributes):
node.lineno = (getattr(node, 'lineno', 0) + n)
for child in walk(node):
if ('lineno' in child._attributes):
child.lineno = (getattr(child, 'lineno', 0) + n)
return node
|
null | null | null | Does the code generate a hash for the contents of a file ?
| def hash_file(file_like_object):
checksum = hashlib.sha1()
for chunk in iter((lambda : file_like_object.read(32768)), ''):
checksum.update(chunk)
return checksum.hexdigest()
| null | null | null | Yes
| codeqa | def hash file file like object checksum hashlib sha 1 for chunk in iter lambda file like object read 32768 '' checksum update chunk return checksum hexdigest
| null | null | null | null | Question:
Does the code generate a hash for the contents of a file ?
Code:
def hash_file(file_like_object):
checksum = hashlib.sha1()
for chunk in iter((lambda : file_like_object.read(32768)), ''):
checksum.update(chunk)
return checksum.hexdigest()
|
null | null | null | Do a mime header contain filename= ?
| def MimeTrimFilename(header, extension):
start = header.find('filename=')
start = header.find('"', start)
end = (header.find('"', (start + 1)) + 1)
start = header.find((('.' + extension) + '"'), start, end)
if ((start > 0) and (end > start)):
headernew = (header[:start] + header[(end - 1):])
else:
headernew =... | null | null | null | Yes
| codeqa | def Mime Trim Filename header extension start header find 'filename ' start header find '"' start end header find '"' start + 1 + 1 start header find ' ' + extension + '"' start end if start > 0 and end > start headernew header[ start] + header[ end - 1 ] else headernew header[ ]return headernew
| null | null | null | null | Question:
Do a mime header contain filename= ?
Code:
def MimeTrimFilename(header, extension):
start = header.find('filename=')
start = header.find('"', start)
end = (header.find('"', (start + 1)) + 1)
start = header.find((('.' + extension) + '"'), start, end)
if ((start > 0) and (end > start)):
headernew = (... |
null | null | null | What is containing filename= ?
| def MimeTrimFilename(header, extension):
start = header.find('filename=')
start = header.find('"', start)
end = (header.find('"', (start + 1)) + 1)
start = header.find((('.' + extension) + '"'), start, end)
if ((start > 0) and (end > start)):
headernew = (header[:start] + header[(end - 1):])
else:
headernew =... | null | null | null | a mime header
| codeqa | def Mime Trim Filename header extension start header find 'filename ' start header find '"' start end header find '"' start + 1 + 1 start header find ' ' + extension + '"' start end if start > 0 and end > start headernew header[ start] + header[ end - 1 ] else headernew header[ ]return headernew
| null | null | null | null | Question:
What is containing filename= ?
Code:
def MimeTrimFilename(header, extension):
start = header.find('filename=')
start = header.find('"', start)
end = (header.find('"', (start + 1)) + 1)
start = header.find((('.' + extension) + '"'), start, end)
if ((start > 0) and (end > start)):
headernew = (header... |
null | null | null | What do a mime header contain ?
| def MimeTrimFilename(header, extension):
start = header.find('filename=')
start = header.find('"', start)
end = (header.find('"', (start + 1)) + 1)
start = header.find((('.' + extension) + '"'), start, end)
if ((start > 0) and (end > start)):
headernew = (header[:start] + header[(end - 1):])
else:
headernew =... | null | null | null | filename=
| codeqa | def Mime Trim Filename header extension start header find 'filename ' start header find '"' start end header find '"' start + 1 + 1 start header find ' ' + extension + '"' start end if start > 0 and end > start headernew header[ start] + header[ end - 1 ] else headernew header[ ]return headernew
| null | null | null | null | Question:
What do a mime header contain ?
Code:
def MimeTrimFilename(header, extension):
start = header.find('filename=')
start = header.find('"', start)
end = (header.find('"', (start + 1)) + 1)
start = header.find((('.' + extension) + '"'), start, end)
if ((start > 0) and (end > start)):
headernew = (heade... |
null | null | null | What does the code get for a given i d string ?
| def album_for_id(album_id):
for plugin in find_plugins():
album = plugin.album_for_id(album_id)
if album:
(yield album)
| null | null | null | albuminfo objects
| codeqa | def album for id album id for plugin in find plugins album plugin album for id album id if album yield album
| null | null | null | null | Question:
What does the code get for a given i d string ?
Code:
def album_for_id(album_id):
for plugin in find_plugins():
album = plugin.album_for_id(album_id)
if album:
(yield album)
|
null | null | null | When will users registry try ?
| def get_connection_info(user=True):
(section, keypath) = reg_info(user)
url = None
try:
hive = _winreg.ConnectRegistry(None, section)
key = _winreg.OpenKey(hive, (keypath + '\\api'))
for i in range(0, _winreg.QueryInfoKey(key)[1]):
(name, value, val_type) = _winreg.EnumValue(key, i)
if (name == 'url'):
... | null | null | null | first
| codeqa | def get connection info user True section keypath reg info user url Nonetry hive winreg Connect Registry None section key winreg Open Key hive keypath + '\\api' for i in range 0 winreg Query Info Key key [1 ] name value val type winreg Enum Value key i if name 'url' url value winreg Close Key key except Windows Error p... | null | null | null | null | Question:
When will users registry try ?
Code:
def get_connection_info(user=True):
(section, keypath) = reg_info(user)
url = None
try:
hive = _winreg.ConnectRegistry(None, section)
key = _winreg.OpenKey(hive, (keypath + '\\api'))
for i in range(0, _winreg.QueryInfoKey(key)[1]):
(name, value, val_type) =... |
null | null | null | What represents an ipv4 address ?
| def isIPAddress(addr):
dottedParts = addr.split('.')
if (len(dottedParts) == 4):
for octet in dottedParts:
try:
value = int(octet)
except ValueError:
return False
else:
if ((value < 0) or (value > 255)):
return False
return True
return False
| null | null | null | the given string
| codeqa | def is IP Address addr dotted Parts addr split ' ' if len dotted Parts 4 for octet in dotted Parts try value int octet except Value Error return Falseelse if value < 0 or value > 255 return Falsereturn Truereturn False
| null | null | null | null | Question:
What represents an ipv4 address ?
Code:
def isIPAddress(addr):
dottedParts = addr.split('.')
if (len(dottedParts) == 4):
for octet in dottedParts:
try:
value = int(octet)
except ValueError:
return False
else:
if ((value < 0) or (value > 255)):
return False
return True
retu... |
null | null | null | How did team topics sort ?
| def get_alphabetical_topics(course_module):
return sorted(course_module.teams_topics, key=(lambda t: t['name'].lower()))
| null | null | null | alphabetically
| codeqa | def get alphabetical topics course module return sorted course module teams topics key lambda t t['name'] lower
| null | null | null | null | Question:
How did team topics sort ?
Code:
def get_alphabetical_topics(course_module):
return sorted(course_module.teams_topics, key=(lambda t: t['name'].lower()))
|
null | null | null | Does the code get a path with only the points that are far enough away from each other ?
| def getAwayPoints(points, radius):
away = []
oneOverOverlapDistance = (100.0 / radius)
pixelDictionary = {}
for point in points:
x = int((point.real * oneOverOverlapDistance))
y = int((point.imag * oneOverOverlapDistance))
if (not getSquareIsOccupied(pixelDictionary, x, y)):
away.append(point)
stepKey =... | null | null | null | Yes
| codeqa | def get Away Points points radius away []one Over Overlap Distance 100 0 / radius pixel Dictionary {}for point in points x int point real * one Over Overlap Distance y int point imag * one Over Overlap Distance if not get Square Is Occupied pixel Dictionary x y away append point step Key get Step Key x y pixel Dictiona... | null | null | null | null | Question:
Does the code get a path with only the points that are far enough away from each other ?
Code:
def getAwayPoints(points, radius):
away = []
oneOverOverlapDistance = (100.0 / radius)
pixelDictionary = {}
for point in points:
x = int((point.real * oneOverOverlapDistance))
y = int((point.imag * oneOv... |
null | null | null | What does the code get ?
| def getAwayPoints(points, radius):
away = []
oneOverOverlapDistance = (100.0 / radius)
pixelDictionary = {}
for point in points:
x = int((point.real * oneOverOverlapDistance))
y = int((point.imag * oneOverOverlapDistance))
if (not getSquareIsOccupied(pixelDictionary, x, y)):
away.append(point)
stepKey =... | null | null | null | a path with only the points that are far enough away from each other
| codeqa | def get Away Points points radius away []one Over Overlap Distance 100 0 / radius pixel Dictionary {}for point in points x int point real * one Over Overlap Distance y int point imag * one Over Overlap Distance if not get Square Is Occupied pixel Dictionary x y away append point step Key get Step Key x y pixel Dictiona... | null | null | null | null | Question:
What does the code get ?
Code:
def getAwayPoints(points, radius):
away = []
oneOverOverlapDistance = (100.0 / radius)
pixelDictionary = {}
for point in points:
x = int((point.real * oneOverOverlapDistance))
y = int((point.imag * oneOverOverlapDistance))
if (not getSquareIsOccupied(pixelDictionar... |
null | null | null | How do inputs name ?
| def get_info_on_inputs(named_inputs, n_unnamed_inputs):
n_named_inputs = len(named_inputs)
def get_plural(n):
if (n > 1):
return 's'
else:
return ''
if (n_named_inputs == 0):
if (n_unnamed_inputs == 0):
msg = 'The function is supposed to have no input.'
elif (n_unnamed_inputs == 1):
msg = ... | null | null | null | un
| codeqa | def get info on inputs named inputs n unnamed inputs n named inputs len named inputs def get plural n if n > 1 return 's'else return ''if n named inputs 0 if n unnamed inputs 0 msg ' Thefunctionissupposedtohavenoinput 'elif n unnamed inputs 1 msg " Thefunctionhasasingleinputvariablewhichhasnoname andthuscannotbeassigne... | null | null | null | null | Question:
How do inputs name ?
Code:
def get_info_on_inputs(named_inputs, n_unnamed_inputs):
n_named_inputs = len(named_inputs)
def get_plural(n):
if (n > 1):
return 's'
else:
return ''
if (n_named_inputs == 0):
if (n_unnamed_inputs == 0):
msg = 'The function is supposed to have no input.'
... |
null | null | null | What does the code create ?
| def spawn(argv, master_read=_read, stdin_read=_read):
if (type(argv) == type('')):
argv = (argv,)
(pid, master_fd) = fork()
if (pid == CHILD):
os.execlp(argv[0], *argv)
try:
mode = tty.tcgetattr(STDIN_FILENO)
tty.setraw(STDIN_FILENO)
restore = 1
except tty.error:
restore = 0
try:
_copy(master_fd, ma... | null | null | null | a spawned process
| codeqa | def spawn argv master read read stdin read read if type argv type '' argv argv pid master fd fork if pid CHILD os execlp argv[ 0 ] *argv try mode tty tcgetattr STDIN FILENO tty setraw STDIN FILENO restore 1except tty error restore 0try copy master fd master read stdin read except IO Error OS Error if restore tty tcseta... | null | null | null | null | Question:
What does the code create ?
Code:
def spawn(argv, master_read=_read, stdin_read=_read):
if (type(argv) == type('')):
argv = (argv,)
(pid, master_fd) = fork()
if (pid == CHILD):
os.execlp(argv[0], *argv)
try:
mode = tty.tcgetattr(STDIN_FILENO)
tty.setraw(STDIN_FILENO)
restore = 1
except tty.... |
null | null | null | Does the code create a spawned process ?
| def spawn(argv, master_read=_read, stdin_read=_read):
if (type(argv) == type('')):
argv = (argv,)
(pid, master_fd) = fork()
if (pid == CHILD):
os.execlp(argv[0], *argv)
try:
mode = tty.tcgetattr(STDIN_FILENO)
tty.setraw(STDIN_FILENO)
restore = 1
except tty.error:
restore = 0
try:
_copy(master_fd, ma... | null | null | null | Yes
| codeqa | def spawn argv master read read stdin read read if type argv type '' argv argv pid master fd fork if pid CHILD os execlp argv[ 0 ] *argv try mode tty tcgetattr STDIN FILENO tty setraw STDIN FILENO restore 1except tty error restore 0try copy master fd master read stdin read except IO Error OS Error if restore tty tcseta... | null | null | null | null | Question:
Does the code create a spawned process ?
Code:
def spawn(argv, master_read=_read, stdin_read=_read):
if (type(argv) == type('')):
argv = (argv,)
(pid, master_fd) = fork()
if (pid == CHILD):
os.execlp(argv[0], *argv)
try:
mode = tty.tcgetattr(STDIN_FILENO)
tty.setraw(STDIN_FILENO)
restore = 1... |
null | null | null | What does it split ?
| def _parse_relative_url(relative_url):
if (not relative_url):
raise _RelativeUrlError('Relative URL is empty')
(scheme, netloc, path, query, fragment) = urlparse.urlsplit(relative_url)
if (scheme or netloc):
raise _RelativeUrlError('Relative URL may not have a scheme or location')
if fragment:
rais... | null | null | null | into its path and query string
| codeqa | def parse relative url relative url if not relative url raise Relative Url Error ' Relative UR Lisempty' scheme netloc path query fragment urlparse urlsplit relative url if scheme or netloc raise Relative Url Error ' Relative UR Lmaynothaveaschemeorlocation' if fragment raise Relative Url Error ' Relative UR Lmaynotspe... | null | null | null | null | Question:
What does it split ?
Code:
def _parse_relative_url(relative_url):
if (not relative_url):
raise _RelativeUrlError('Relative URL is empty')
(scheme, netloc, path, query, fragment) = urlparse.urlsplit(relative_url)
if (scheme or netloc):
raise _RelativeUrlError('Relative URL may not have a sc... |
null | null | null | Does it split into its path and query string ?
| def _parse_relative_url(relative_url):
if (not relative_url):
raise _RelativeUrlError('Relative URL is empty')
(scheme, netloc, path, query, fragment) = urlparse.urlsplit(relative_url)
if (scheme or netloc):
raise _RelativeUrlError('Relative URL may not have a scheme or location')
if fragment:
rais... | null | null | null | Yes
| codeqa | def parse relative url relative url if not relative url raise Relative Url Error ' Relative UR Lisempty' scheme netloc path query fragment urlparse urlsplit relative url if scheme or netloc raise Relative Url Error ' Relative UR Lmaynothaveaschemeorlocation' if fragment raise Relative Url Error ' Relative UR Lmaynotspe... | null | null | null | null | Question:
Does it split into its path and query string ?
Code:
def _parse_relative_url(relative_url):
if (not relative_url):
raise _RelativeUrlError('Relative URL is empty')
(scheme, netloc, path, query, fragment) = urlparse.urlsplit(relative_url)
if (scheme or netloc):
raise _RelativeUrlError('Relative ... |
null | null | null | How are query run until there are no results left ?
| def fetch_things2(query, chunk_size=100, batch_fn=None, chunks=False):
assert query._sort, 'you must specify the sort order in your query!'
orig_rules = deepcopy(query._rules)
query._limit = chunk_size
items = list(query)
done = False
while (items and (not done)):
if (len(items) < chunk_size):
done =... | null | null | null | incrementally
| codeqa | def fetch things 2 query chunk size 100 batch fn None chunks False assert query sort 'youmustspecifythesortorderinyourquery 'orig rules deepcopy query rules query limit chunk sizeitems list query done Falsewhile items and not done if len items < chunk size done Trueafter items[ -1 ]if batch fn items batch fn items if c... | null | null | null | null | Question:
How are query run until there are no results left ?
Code:
def fetch_things2(query, chunk_size=100, batch_fn=None, chunks=False):
assert query._sort, 'you must specify the sort order in your query!'
orig_rules = deepcopy(query._rules)
query._limit = chunk_size
items = list(query)
done = False
... |
null | null | null | Does it raise an exception ?
| def _retry_exception_async(reactor, f, steps=((0.1,) * 10)):
saved_failure = [None]
saved_result = [None]
def handle_success(result):
saved_result[0] = result
return True
def handle_failure(failure):
Message.log(message_type=u'flocker:provision:libcloud:retry_exception:got_exception')
write_failure(failure)... | null | null | null | Yes
| codeqa | def retry exception async reactor f steps 0 1 * 10 saved failure [ None]saved result [ None]def handle success result saved result[ 0 ] resultreturn Truedef handle failure failure Message log message type u'flocker provision libcloud retry exception got exception' write failure failure saved failure[ 0 ] failurereturn ... | null | null | null | null | Question:
Does it raise an exception ?
Code:
def _retry_exception_async(reactor, f, steps=((0.1,) * 10)):
saved_failure = [None]
saved_result = [None]
def handle_success(result):
saved_result[0] = result
return True
def handle_failure(failure):
Message.log(message_type=u'flocker:provision:libcloud:retry_e... |
null | null | null | What does it raise ?
| def _retry_exception_async(reactor, f, steps=((0.1,) * 10)):
saved_failure = [None]
saved_result = [None]
def handle_success(result):
saved_result[0] = result
return True
def handle_failure(failure):
Message.log(message_type=u'flocker:provision:libcloud:retry_exception:got_exception')
write_failure(failure)... | null | null | null | an exception
| codeqa | def retry exception async reactor f steps 0 1 * 10 saved failure [ None]saved result [ None]def handle success result saved result[ 0 ] resultreturn Truedef handle failure failure Message log message type u'flocker provision libcloud retry exception got exception' write failure failure saved failure[ 0 ] failurereturn ... | null | null | null | null | Question:
What does it raise ?
Code:
def _retry_exception_async(reactor, f, steps=((0.1,) * 10)):
saved_failure = [None]
saved_result = [None]
def handle_success(result):
saved_result[0] = result
return True
def handle_failure(failure):
Message.log(message_type=u'flocker:provision:libcloud:retry_exception... |
null | null | null | How is this function run ?
| def output_thread(log, stdout, stderr, timeout_event, is_alive, quit, stop_output_event):
readers = []
errors = []
if (stdout is not None):
readers.append(stdout)
errors.append(stdout)
if (stderr is not None):
readers.append(stderr)
errors.append(stderr)
while readers:
(outputs, inputs, err) = no_interru... | null | null | null | in a separate thread
| codeqa | def output thread log stdout stderr timeout event is alive quit stop output event readers []errors []if stdout is not None readers append stdout errors append stdout if stderr is not None readers append stderr errors append stderr while readers outputs inputs err no interrupt select select readers [] errors 1 for strea... | null | null | null | null | Question:
How is this function run ?
Code:
def output_thread(log, stdout, stderr, timeout_event, is_alive, quit, stop_output_event):
readers = []
errors = []
if (stdout is not None):
readers.append(stdout)
errors.append(stdout)
if (stderr is not None):
readers.append(stderr)
errors.append(stderr)
while... |
null | null | null | How do to work join ?
| def test_join_inplace():
s = tensor.lscalar()
x = tensor.vector('x')
z = tensor.zeros((s,))
join = Join(view=0)
c = join(0, x, z, z)
f = theano.function([theano.In(x, borrow=True), s], theano.Out(c, borrow=True))
data = numpy.array([3, 4, 5], dtype=theano.config.floatX)
print(f(data, 0))
if (theano.config.mode... | null | null | null | test
| codeqa | def test join inplace s tensor lscalar x tensor vector 'x' z tensor zeros s join Join view 0 c join 0 x z z f theano function [theano In x borrow True s] theano Out c borrow True data numpy array [3 4 5] dtype theano config float X print f data 0 if theano config mode not in [' Debug Mode' 'DEBUG MODE'] assert f data 0... | null | null | null | null | Question:
How do to work join ?
Code:
def test_join_inplace():
s = tensor.lscalar()
x = tensor.vector('x')
z = tensor.zeros((s,))
join = Join(view=0)
c = join(0, x, z, z)
f = theano.function([theano.In(x, borrow=True), s], theano.Out(c, borrow=True))
data = numpy.array([3, 4, 5], dtype=theano.config.floatX)
... |
null | null | null | Does the code process pending events only ?
| def inputhook_wx3():
try:
app = wx.GetApp()
if (app is not None):
assert wx.Thread_IsMain()
if (not callable(signal.getsignal(signal.SIGINT))):
signal.signal(signal.SIGINT, signal.default_int_handler)
evtloop = wx.EventLoop()
ea = wx.EventLoopActivator(evtloop)
t = clock()
while (not stdin_re... | null | null | null | Yes
| codeqa | def inputhook wx 3 try app wx Get App if app is not None assert wx Thread Is Main if not callable signal getsignal signal SIGINT signal signal signal SIGINT signal default int handler evtloop wx Event Loop ea wx Event Loop Activator evtloop t clock while not stdin ready while evtloop Pending t clock evtloop Dispatch ap... | null | null | null | null | Question:
Does the code process pending events only ?
Code:
def inputhook_wx3():
try:
app = wx.GetApp()
if (app is not None):
assert wx.Thread_IsMain()
if (not callable(signal.getsignal(signal.SIGINT))):
signal.signal(signal.SIGINT, signal.default_int_handler)
evtloop = wx.EventLoop()
ea = wx.E... |
null | null | null | What does the code process ?
| def inputhook_wx3():
try:
app = wx.GetApp()
if (app is not None):
assert wx.Thread_IsMain()
if (not callable(signal.getsignal(signal.SIGINT))):
signal.signal(signal.SIGINT, signal.default_int_handler)
evtloop = wx.EventLoop()
ea = wx.EventLoopActivator(evtloop)
t = clock()
while (not stdin_re... | null | null | null | pending events only
| codeqa | def inputhook wx 3 try app wx Get App if app is not None assert wx Thread Is Main if not callable signal getsignal signal SIGINT signal signal signal SIGINT signal default int handler evtloop wx Event Loop ea wx Event Loop Activator evtloop t clock while not stdin ready while evtloop Pending t clock evtloop Dispatch ap... | null | null | null | null | Question:
What does the code process ?
Code:
def inputhook_wx3():
try:
app = wx.GetApp()
if (app is not None):
assert wx.Thread_IsMain()
if (not callable(signal.getsignal(signal.SIGINT))):
signal.signal(signal.SIGINT, signal.default_int_handler)
evtloop = wx.EventLoop()
ea = wx.EventLoopActivat... |
null | null | null | When d i token ?
| @app.route('/auth/info/googleidtoken', methods=['GET'])
def auth_info_google_id_token():
return auth_info()
| null | null | null | d
| codeqa | @app route '/auth/info/googleidtoken' methods ['GET'] def auth info google id token return auth info
| null | null | null | null | Question:
When d i token ?
Code:
@app.route('/auth/info/googleidtoken', methods=['GET'])
def auth_info_google_id_token():
return auth_info()
|
null | null | null | What equals error ?
| def p_command_def_bad_rhs(p):
p[0] = 'BAD EXPRESSION IN DEF STATEMENT'
| null | null | null | rparen
| codeqa | def p command def bad rhs p p[ 0 ] 'BADEXPRESSIONINDEFSTATEMENT'
| null | null | null | null | Question:
What equals error ?
Code:
def p_command_def_bad_rhs(p):
p[0] = 'BAD EXPRESSION IN DEF STATEMENT'
|
null | null | null | How do the same function run multiple times ?
| def test_parallel(num_threads=2, kwargs_list=None):
assert (num_threads > 0)
has_kwargs_list = (kwargs_list is not None)
if has_kwargs_list:
assert (len(kwargs_list) == num_threads)
import threading
def wrapper(func):
@wraps(func)
def inner(*args, **kwargs):
if has_kwargs_list:
update_kwargs = (lambda... | null | null | null | in parallel
| codeqa | def test parallel num threads 2 kwargs list None assert num threads > 0 has kwargs list kwargs list is not None if has kwargs list assert len kwargs list num threads import threadingdef wrapper func @wraps func def inner *args **kwargs if has kwargs list update kwargs lambda i dict kwargs **kwargs list[i] else update k... | null | null | null | null | Question:
How do the same function run multiple times ?
Code:
def test_parallel(num_threads=2, kwargs_list=None):
assert (num_threads > 0)
has_kwargs_list = (kwargs_list is not None)
if has_kwargs_list:
assert (len(kwargs_list) == num_threads)
import threading
def wrapper(func):
@wraps(func)
def inner(*a... |
null | null | null | When do the same function run in parallel ?
| def test_parallel(num_threads=2, kwargs_list=None):
assert (num_threads > 0)
has_kwargs_list = (kwargs_list is not None)
if has_kwargs_list:
assert (len(kwargs_list) == num_threads)
import threading
def wrapper(func):
@wraps(func)
def inner(*args, **kwargs):
if has_kwargs_list:
update_kwargs = (lambda... | null | null | null | multiple times
| codeqa | def test parallel num threads 2 kwargs list None assert num threads > 0 has kwargs list kwargs list is not None if has kwargs list assert len kwargs list num threads import threadingdef wrapper func @wraps func def inner *args **kwargs if has kwargs list update kwargs lambda i dict kwargs **kwargs list[i] else update k... | null | null | null | null | Question:
When do the same function run in parallel ?
Code:
def test_parallel(num_threads=2, kwargs_list=None):
assert (num_threads > 0)
has_kwargs_list = (kwargs_list is not None)
if has_kwargs_list:
assert (len(kwargs_list) == num_threads)
import threading
def wrapper(func):
@wraps(func)
def inner(*arg... |
null | null | null | What does a decorator apply ?
| def make_label_dec(label, ds=None):
warnings.warn('The function `make_label_dec` is deprecated since IPython 4.0', DeprecationWarning, stacklevel=2)
if isinstance(label, str):
labels = [label]
else:
labels = label
tmp = (lambda : None)
for label in labels:
setattr(tmp, label, True)
def decor(f):
fo... | null | null | null | one or more labels
| codeqa | def make label dec label ds None warnings warn ' Thefunction`make label dec`isdeprecatedsince I Python 4 0' Deprecation Warning stacklevel 2 if isinstance label str labels [label]else labels labeltmp lambda None for label in labels setattr tmp label True def decor f for label in labels setattr f label True return fif d... | null | null | null | null | Question:
What does a decorator apply ?
Code:
def make_label_dec(label, ds=None):
warnings.warn('The function `make_label_dec` is deprecated since IPython 4.0', DeprecationWarning, stacklevel=2)
if isinstance(label, str):
labels = [label]
else:
labels = label
tmp = (lambda : None)
for label in label... |
null | null | null | What applies one or more labels ?
| def make_label_dec(label, ds=None):
warnings.warn('The function `make_label_dec` is deprecated since IPython 4.0', DeprecationWarning, stacklevel=2)
if isinstance(label, str):
labels = [label]
else:
labels = label
tmp = (lambda : None)
for label in labels:
setattr(tmp, label, True)
def decor(f):
fo... | null | null | null | a decorator
| codeqa | def make label dec label ds None warnings warn ' Thefunction`make label dec`isdeprecatedsince I Python 4 0' Deprecation Warning stacklevel 2 if isinstance label str labels [label]else labels labeltmp lambda None for label in labels setattr tmp label True def decor f for label in labels setattr f label True return fif d... | null | null | null | null | Question:
What applies one or more labels ?
Code:
def make_label_dec(label, ds=None):
warnings.warn('The function `make_label_dec` is deprecated since IPython 4.0', DeprecationWarning, stacklevel=2)
if isinstance(label, str):
labels = [label]
else:
labels = label
tmp = (lambda : None)
for label in l... |
null | null | null | Does a decorator apply one or more labels ?
| def make_label_dec(label, ds=None):
warnings.warn('The function `make_label_dec` is deprecated since IPython 4.0', DeprecationWarning, stacklevel=2)
if isinstance(label, str):
labels = [label]
else:
labels = label
tmp = (lambda : None)
for label in labels:
setattr(tmp, label, True)
def decor(f):
fo... | null | null | null | Yes
| codeqa | def make label dec label ds None warnings warn ' Thefunction`make label dec`isdeprecatedsince I Python 4 0' Deprecation Warning stacklevel 2 if isinstance label str labels [label]else labels labeltmp lambda None for label in labels setattr tmp label True def decor f for label in labels setattr f label True return fif d... | null | null | null | null | Question:
Does a decorator apply one or more labels ?
Code:
def make_label_dec(label, ds=None):
warnings.warn('The function `make_label_dec` is deprecated since IPython 4.0', DeprecationWarning, stacklevel=2)
if isinstance(label, str):
labels = [label]
else:
labels = label
tmp = (lambda : None)
for ... |
null | null | null | Do the string s convert to uppercase ?
| def upper(s):
return s.upper()
| null | null | null | Yes
| codeqa | def upper s return s upper
| null | null | null | null | Question:
Do the string s convert to uppercase ?
Code:
def upper(s):
return s.upper()
|
null | null | null | What converted to uppercase ?
| def upper(s):
return s.upper()
| null | null | null | the string s
| codeqa | def upper s return s upper
| null | null | null | null | Question:
What converted to uppercase ?
Code:
def upper(s):
return s.upper()
|
null | null | null | What do the string s convert ?
| def upper(s):
return s.upper()
| null | null | null | to uppercase
| codeqa | def upper s return s upper
| null | null | null | null | Question:
What do the string s convert ?
Code:
def upper(s):
return s.upper()
|
null | null | null | How did property type ?
| def PackString(name, value, pbvalue):
pbvalue.set_stringvalue(unicode(value).encode('utf-8'))
| null | null | null | string
| codeqa | def Pack String name value pbvalue pbvalue set stringvalue unicode value encode 'utf- 8 '
| null | null | null | null | Question:
How did property type ?
Code:
def PackString(name, value, pbvalue):
pbvalue.set_stringvalue(unicode(value).encode('utf-8'))
|
null | null | null | Does the code delete a workflow instance ?
| def trg_delete(uid, res_type, res_id, cr):
return WorkflowService.new(cr, uid, res_type, res_id).delete()
| null | null | null | Yes
| codeqa | def trg delete uid res type res id cr return Workflow Service new cr uid res type res id delete
| null | null | null | null | Question:
Does the code delete a workflow instance ?
Code:
def trg_delete(uid, res_type, res_id, cr):
return WorkflowService.new(cr, uid, res_type, res_id).delete()
|
null | null | null | What does the code delete ?
| def trg_delete(uid, res_type, res_id, cr):
return WorkflowService.new(cr, uid, res_type, res_id).delete()
| null | null | null | a workflow instance
| codeqa | def trg delete uid res type res id cr return Workflow Service new cr uid res type res id delete
| null | null | null | null | Question:
What does the code delete ?
Code:
def trg_delete(uid, res_type, res_id, cr):
return WorkflowService.new(cr, uid, res_type, res_id).delete()
|
null | null | null | What does the code remove from loader ?
| def _remove_persistent_module(mod):
if ((not mod) or (mod not in mod_list(True))):
return set()
__salt__['file.sed'](_LOADER_CONF, _MODULE_RE.format(mod), '')
return set([mod])
| null | null | null | module
| codeqa | def remove persistent module mod if not mod or mod not in mod list True return set salt ['file sed'] LOADER CONF MODULE RE format mod '' return set [mod]
| null | null | null | null | Question:
What does the code remove from loader ?
Code:
def _remove_persistent_module(mod):
if ((not mod) or (mod not in mod_list(True))):
return set()
__salt__['file.sed'](_LOADER_CONF, _MODULE_RE.format(mod), '')
return set([mod])
|
null | null | null | Does the code remove module from loader ?
| def _remove_persistent_module(mod):
if ((not mod) or (mod not in mod_list(True))):
return set()
__salt__['file.sed'](_LOADER_CONF, _MODULE_RE.format(mod), '')
return set([mod])
| null | null | null | Yes
| codeqa | def remove persistent module mod if not mod or mod not in mod list True return set salt ['file sed'] LOADER CONF MODULE RE format mod '' return set [mod]
| null | null | null | null | Question:
Does the code remove module from loader ?
Code:
def _remove_persistent_module(mod):
if ((not mod) or (mod not in mod_list(True))):
return set()
__salt__['file.sed'](_LOADER_CONF, _MODULE_RE.format(mod), '')
return set([mod])
|
null | null | null | Does the code get the largest circle outset loop from the loop ?
| def getLargestCenterOutsetLoopFromLoop(loop, radius, thresholdRatio=0.9):
radius = abs(radius)
points = getPointsFromLoop(loop, (1.01 * radius), thresholdRatio)
centers = getCentersFromPoints(points, radius)
largestCenterOutset = None
largestOutsetArea = (-999999999.0)
for center in centers:
outset = getSimplif... | null | null | null | Yes
| codeqa | def get Largest Center Outset Loop From Loop loop radius threshold Ratio 0 9 radius abs radius points get Points From Loop loop 1 01 * radius threshold Ratio centers get Centers From Points points radius largest Center Outset Nonelargest Outset Area -999999999 0 for center in centers outset get Simplified Inset From Cl... | null | null | null | null | Question:
Does the code get the largest circle outset loop from the loop ?
Code:
def getLargestCenterOutsetLoopFromLoop(loop, radius, thresholdRatio=0.9):
radius = abs(radius)
points = getPointsFromLoop(loop, (1.01 * radius), thresholdRatio)
centers = getCentersFromPoints(points, radius)
largestCenterOutset = N... |
null | null | null | What does the code get ?
| def getLargestCenterOutsetLoopFromLoop(loop, radius, thresholdRatio=0.9):
radius = abs(radius)
points = getPointsFromLoop(loop, (1.01 * radius), thresholdRatio)
centers = getCentersFromPoints(points, radius)
largestCenterOutset = None
largestOutsetArea = (-999999999.0)
for center in centers:
outset = getSimplif... | null | null | null | the largest circle outset loop from the loop
| codeqa | def get Largest Center Outset Loop From Loop loop radius threshold Ratio 0 9 radius abs radius points get Points From Loop loop 1 01 * radius threshold Ratio centers get Centers From Points points radius largest Center Outset Nonelargest Outset Area -999999999 0 for center in centers outset get Simplified Inset From Cl... | null | null | null | null | Question:
What does the code get ?
Code:
def getLargestCenterOutsetLoopFromLoop(loop, radius, thresholdRatio=0.9):
radius = abs(radius)
points = getPointsFromLoop(loop, (1.01 * radius), thresholdRatio)
centers = getCentersFromPoints(points, radius)
largestCenterOutset = None
largestOutsetArea = (-999999999.0)
... |
null | null | null | How do a test package return ?
| def make_package(name=None):
if (name is None):
name = 'test_package'
pkg = {'name': name, 'title': 'My Test Package', 'author': 'test author', 'author_email': 'test_author@test_author.com', 'maintainer': 'test maintainer', 'maintainer_email': 'test_maintainer@test_maintainer.com', 'notes': 'some test notes',... | null | null | null | in dictionary form
| codeqa | def make package name None if name is None name 'test package'pkg {'name' name 'title' ' My Test Package' 'author' 'testauthor' 'author email' 'test author@test author com' 'maintainer' 'testmaintainer' 'maintainer email' 'test maintainer@test maintainer com' 'notes' 'sometestnotes' 'url' 'www example com'}res 1 {'url'... | null | null | null | null | Question:
How do a test package return ?
Code:
def make_package(name=None):
if (name is None):
name = 'test_package'
pkg = {'name': name, 'title': 'My Test Package', 'author': 'test author', 'author_email': 'test_author@test_author.com', 'maintainer': 'test maintainer', 'maintainer_email': 'test_maintainer@... |
null | null | null | How does the specified assertions check ?
| def assert_element_text(output, path, verify_assertions_function, children):
text = xml_find_text(output, path)
verify_assertions_function(text, children)
| null | null | null | recursively
| codeqa | def assert element text output path verify assertions function children text xml find text output path verify assertions function text children
| null | null | null | null | Question:
How does the specified assertions check ?
Code:
def assert_element_text(output, path, verify_assertions_function, children):
text = xml_find_text(output, path)
verify_assertions_function(text, children)
|
null | null | null | What uses a normal path ?
| def CanonicalPathToLocalPath(path):
return path
| null | null | null | osx
| codeqa | def Canonical Path To Local Path path return path
| null | null | null | null | Question:
What uses a normal path ?
Code:
def CanonicalPathToLocalPath(path):
return path
|
null | null | null | Do a string contain commas every three digits ?
| @register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
return number_format(value, force_grouping=True)
orig = force_unicod... | null | null | null | Yes
| codeqa | @register filter is safe True def intcomma value use l10 n True if settings USE L10 N and use l10 n try if not isinstance value float value int value except Type Error Value Error return intcomma value False else return number format value force grouping True orig force unicode value new re sub '^ -?\\d+ \\d{ 3 } ' '\\... | null | null | null | null | Question:
Do a string contain commas every three digits ?
Code:
@register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
r... |
null | null | null | What do a string contain every three digits ?
| @register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
return number_format(value, force_grouping=True)
orig = force_unicod... | null | null | null | commas
| codeqa | @register filter is safe True def intcomma value use l10 n True if settings USE L10 N and use l10 n try if not isinstance value float value int value except Type Error Value Error return intcomma value False else return number format value force grouping True orig force unicode value new re sub '^ -?\\d+ \\d{ 3 } ' '\\... | null | null | null | null | Question:
What do a string contain every three digits ?
Code:
@register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
ret... |
null | null | null | What is containing commas every three digits ?
| @register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
return number_format(value, force_grouping=True)
orig = force_unicod... | null | null | null | a string
| codeqa | @register filter is safe True def intcomma value use l10 n True if settings USE L10 N and use l10 n try if not isinstance value float value int value except Type Error Value Error return intcomma value False else return number format value force grouping True orig force unicode value new re sub '^ -?\\d+ \\d{ 3 } ' '\\... | null | null | null | null | Question:
What is containing commas every three digits ?
Code:
@register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
re... |
null | null | null | When do a string contain commas ?
| @register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
return number_format(value, force_grouping=True)
orig = force_unicod... | null | null | null | every three digits
| codeqa | @register filter is safe True def intcomma value use l10 n True if settings USE L10 N and use l10 n try if not isinstance value float value int value except Type Error Value Error return intcomma value False else return number format value force grouping True orig force unicode value new re sub '^ -?\\d+ \\d{ 3 } ' '\\... | null | null | null | null | Question:
When do a string contain commas ?
Code:
@register.filter(is_safe=True)
def intcomma(value, use_l10n=True):
if (settings.USE_L10N and use_l10n):
try:
if (not isinstance(value, float)):
value = int(value)
except (TypeError, ValueError):
return intcomma(value, False)
else:
return number_f... |
null | null | null | What does the code consider as vectors ?
| def pearson_correlation(X, Y):
if (X is Y):
X = Y = np.asanyarray(X)
else:
X = np.asanyarray(X)
Y = np.asanyarray(Y)
if (X.shape[1] != Y.shape[1]):
raise ValueError('Incompatible dimension for X and Y matrices')
XY = ssd.cdist(X, Y, 'correlation', 2)
return (1 - XY)
| null | null | null | the rows of x
| codeqa | def pearson correlation X Y if X is Y X Y np asanyarray X else X np asanyarray X Y np asanyarray Y if X shape[ 1 ] Y shape[ 1 ] raise Value Error ' Incompatibledimensionfor Xand Ymatrices' XY ssd cdist X Y 'correlation' 2 return 1 - XY
| null | null | null | null | Question:
What does the code consider as vectors ?
Code:
def pearson_correlation(X, Y):
if (X is Y):
X = Y = np.asanyarray(X)
else:
X = np.asanyarray(X)
Y = np.asanyarray(Y)
if (X.shape[1] != Y.shape[1]):
raise ValueError('Incompatible dimension for X and Y matrices')
XY = ssd.cdist(X, Y, 'correla... |
null | null | null | Does the code consider the rows of x as vectors ?
| def pearson_correlation(X, Y):
if (X is Y):
X = Y = np.asanyarray(X)
else:
X = np.asanyarray(X)
Y = np.asanyarray(Y)
if (X.shape[1] != Y.shape[1]):
raise ValueError('Incompatible dimension for X and Y matrices')
XY = ssd.cdist(X, Y, 'correlation', 2)
return (1 - XY)
| null | null | null | Yes
| codeqa | def pearson correlation X Y if X is Y X Y np asanyarray X else X np asanyarray X Y np asanyarray Y if X shape[ 1 ] Y shape[ 1 ] raise Value Error ' Incompatibledimensionfor Xand Ymatrices' XY ssd cdist X Y 'correlation' 2 return 1 - XY
| null | null | null | null | Question:
Does the code consider the rows of x as vectors ?
Code:
def pearson_correlation(X, Y):
if (X is Y):
X = Y = np.asanyarray(X)
else:
X = np.asanyarray(X)
Y = np.asanyarray(Y)
if (X.shape[1] != Y.shape[1]):
raise ValueError('Incompatible dimension for X and Y matrices')
XY = ssd.cdist(X, Y,... |
null | null | null | Does the code get the names and default values of a functions arguments ?
| def getargspec(func):
if ismethod(func):
func = func.im_func
if (not isfunction(func)):
raise TypeError('{!r} is not a Python function'.format(func))
if (func.func_code.co_argcount > len(func.func_code.co_varnames)):
raise TypeError('{!r} is not a Python function'.format(func))
(args, varargs, varkw... | null | null | null | Yes
| codeqa | def getargspec func if ismethod func func func im funcif not isfunction func raise Type Error '{ r}isnota Pythonfunction' format func if func func code co argcount > len func func code co varnames raise Type Error '{ r}isnota Pythonfunction' format func args varargs varkw getargs func func code return Arg Spec args var... | null | null | null | null | Question:
Does the code get the names and default values of a functions arguments ?
Code:
def getargspec(func):
if ismethod(func):
func = func.im_func
if (not isfunction(func)):
raise TypeError('{!r} is not a Python function'.format(func))
if (func.func_code.co_argcount > len(func.func_code.co_varnames)... |
null | null | null | What does the code get ?
| def getargspec(func):
if ismethod(func):
func = func.im_func
if (not isfunction(func)):
raise TypeError('{!r} is not a Python function'.format(func))
if (func.func_code.co_argcount > len(func.func_code.co_varnames)):
raise TypeError('{!r} is not a Python function'.format(func))
(args, varargs, varkw... | null | null | null | the names and default values of a functions arguments
| codeqa | def getargspec func if ismethod func func func im funcif not isfunction func raise Type Error '{ r}isnota Pythonfunction' format func if func func code co argcount > len func func code co varnames raise Type Error '{ r}isnota Pythonfunction' format func args varargs varkw getargs func func code return Arg Spec args var... | null | null | null | null | Question:
What does the code get ?
Code:
def getargspec(func):
if ismethod(func):
func = func.im_func
if (not isfunction(func)):
raise TypeError('{!r} is not a Python function'.format(func))
if (func.func_code.co_argcount > len(func.func_code.co_varnames)):
raise TypeError('{!r} is not a Python f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.